diff --git a/3rdparty/bgfx/3rdparty/ocornut-imgui/imgui.cpp b/3rdparty/bgfx/3rdparty/ocornut-imgui/imgui.cpp index 9db3eced5b8..866bec93420 100644 --- a/3rdparty/bgfx/3rdparty/ocornut-imgui/imgui.cpp +++ b/3rdparty/bgfx/3rdparty/ocornut-imgui/imgui.cpp @@ -353,6 +353,9 @@ #endif #ifdef __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 +#pragma GCC diagnostic ignored "-Wmaybe-uninitialized" // warning: ‘xxxx’ may be used uninitialized in this function #endif //------------------------------------------------------------------------- @@ -5618,8 +5621,8 @@ bool ImGui::InputText(const char* label, char* buf, size_t buf_size, ImGuiInputT // From the moment we focused we are ignoring the content of 'buf' ImFormatString(edit_state.InitialText, IM_ARRAYSIZE(edit_state.InitialText), "%s", buf); const char* buf_end = NULL; - edit_state.CurLenW = ImTextStrFromUtf8(edit_state.Text, IM_ARRAYSIZE(edit_state.Text), buf, NULL, &buf_end); - edit_state.CurLenA = buf_end - buf; // We can't get the result from ImFormatString() above because it is not UTF-8 aware. Here we'll cut off malformed UTF-8. + edit_state.CurLenW = (int)ImTextStrFromUtf8(edit_state.Text, IM_ARRAYSIZE(edit_state.Text), buf, NULL, &buf_end); + edit_state.CurLenA = (int)(buf_end - buf); // We can't get the result from ImFormatString() above because it is not UTF-8 aware. Here we'll cut off malformed UTF-8. edit_state.Width = w; edit_state.InputCursorScreenPos = ImVec2(-1.f,-1.f); edit_state.CursorAnimReset(); diff --git a/3rdparty/bgfx/README.md b/3rdparty/bgfx/README.md index bdad511f2cb..e0fd614bb36 100644 --- a/3rdparty/bgfx/README.md +++ b/3rdparty/bgfx/README.md @@ -4,7 +4,8 @@ What is it? ----------- -Cross-platform rendering library. +Cross-platform, graphics API agnostic, "Bring Your Own Engine/Framework" style +rendering library. Supported rendering backends: @@ -319,18 +320,27 @@ Building Steps bellow are for default build system inside bgfx repository. There is alterative way to build bgfx and examples with [fips](https://github.com/floooh/fips-bgfx/#fips-bgfx). -### Prerequisites - -Windows users download GnuWin32 utilities from: -[http://gnuwin32.sourceforge.net/packages/make.htm](http://gnuwin32.sourceforge.net/packages/make.htm) -[http://gnuwin32.sourceforge.net/packages/coreutils.htm](http://gnuwin32.sourceforge.net/packages/coreutils.htm) -[http://gnuwin32.sourceforge.net/packages/libiconv.htm](http://gnuwin32.sourceforge.net/packages/libiconv.htm) -[http://gnuwin32.sourceforge.net/packages/libintl.htm](http://gnuwin32.sourceforge.net/packages/libintl.htm) - ### Getting source git clone git://github.com/bkaradzic/bx.git git clone git://github.com/bkaradzic/bgfx.git + +### Quick start (Windows with Visual Studio) + +Enter bgfx directory: + + cd bgfx + +Generate Visual Studio 2013 project files: + + ..\bx\tools\bin\windows\genie vs2013 + +Open bgfx solution in Visual Studio 2013: + + start .build\projects\vs2013\bgfx.sln + +### Generating project files for all targets + cd bgfx make @@ -361,6 +371,12 @@ Download Native Client SDK from: ### Prerequisites for Windows +Windows users download GnuWin32 utilities from: +[http://gnuwin32.sourceforge.net/packages/make.htm](http://gnuwin32.sourceforge.net/packages/make.htm) +[http://gnuwin32.sourceforge.net/packages/coreutils.htm](http://gnuwin32.sourceforge.net/packages/coreutils.htm) +[http://gnuwin32.sourceforge.net/packages/libiconv.htm](http://gnuwin32.sourceforge.net/packages/libiconv.htm) +[http://gnuwin32.sourceforge.net/packages/libintl.htm](http://gnuwin32.sourceforge.net/packages/libintl.htm) + When building on Windows, you have to set DXSDK_DIR environment variable to point to DirectX SDK directory. diff --git a/3rdparty/bgfx/examples/08-update/fs_update_3d.sc b/3rdparty/bgfx/examples/08-update/fs_update_3d.sc new file mode 100644 index 00000000000..dad87e9cfdb --- /dev/null +++ b/3rdparty/bgfx/examples/08-update/fs_update_3d.sc @@ -0,0 +1,17 @@ +$input v_texcoord0 + +/* + * Copyright 2011-2015 Branimir Karadzic. All rights reserved. + * License: http://www.opensource.org/licenses/BSD-2-Clause + */ + +#include "../common/common.sh" + +SAMPLER3D(u_texColor, 0); +uniform float u_time; + +void main() +{ + vec3 uvw = vec3(v_texcoord0.xy*0.5+0.5, sin(u_time)*0.5+0.5); + gl_FragColor = vec4_splat(texture3D(u_texColor, uvw).x); +} diff --git a/3rdparty/bgfx/examples/08-update/update.cpp b/3rdparty/bgfx/examples/08-update/update.cpp index 0ed14fa3f9d..d87371aeb92 100644 --- a/3rdparty/bgfx/examples/08-update/update.cpp +++ b/3rdparty/bgfx/examples/08-update/update.cpp @@ -149,6 +149,31 @@ int _main_(int /*_argc*/, char** /*_argv*/) loadTexture("texture_compression_ptc24.pvr"), }; + const bgfx::Memory* mem8 = bgfx::alloc(32*32*32); + const bgfx::Memory* mem16f = bgfx::alloc(32*32*32*2); + const bgfx::Memory* mem32f = bgfx::alloc(32*32*32*4); + for (uint8_t zz = 0; zz < 32; ++zz) + { + for (uint8_t yy = 0; yy < 32; ++yy) + { + for (uint8_t xx = 0; xx < 32; ++xx) + { + const uint32_t offset = ( (zz*32+yy)*32+xx); + const uint32_t val = xx ^ yy ^ zz; + mem8->data[offset] = val<<3; + *(uint16_t*)&mem16f->data[offset*2] = bx::halfFromFloat( (float)val/32.0f); + *(float*)&mem32f->data[offset*4] = (float)val/32.0f; + } + } + } + + bgfx::TextureHandle textures3d[] = + { + 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), + }; + // Create static vertex buffer. bgfx::VertexBufferHandle vbh = bgfx::createVertexBuffer(bgfx::makeRef(s_cubeVertices, sizeof(s_cubeVertices) ), PosTexcoordVertex::ms_decl); @@ -156,12 +181,14 @@ int _main_(int /*_argc*/, char** /*_argv*/) bgfx::IndexBufferHandle ibh = bgfx::createIndexBuffer(bgfx::makeRef(s_cubeIndices, sizeof(s_cubeIndices) ) ); // Create texture sampler uniforms. - bgfx::UniformHandle u_texCube = bgfx::createUniform("u_texCube", bgfx::UniformType::Uniform1iv); - + bgfx::UniformHandle u_texCube = bgfx::createUniform("u_texCube", bgfx::UniformType::Uniform1iv); bgfx::UniformHandle u_texColor = bgfx::createUniform("u_texColor", bgfx::UniformType::Uniform1iv); - bgfx::ProgramHandle program = loadProgram("vs_update", "fs_update"); - bgfx::ProgramHandle programCmp = loadProgram("vs_update", "fs_update_cmp"); + bgfx::UniformHandle u_time = bgfx::createUniform("u_time", bgfx::UniformType::Uniform1f); + + 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"); const uint32_t textureSide = 2048; @@ -210,6 +237,7 @@ int _main_(int /*_argc*/, char** /*_argv*/) const int64_t freq = bx::getHPFrequency(); const double toMs = 1000.0/double(freq); float time = (float)( (now - timeOffset)/double(bx::getHPFrequency() ) ); + bgfx::setUniform(u_time, &time); // Use debug font to print information about this example. bgfx::dbgTextClear(); @@ -345,10 +373,11 @@ int _main_(int /*_argc*/, char** /*_argv*/) // Submit primitive for rendering to view 1. bgfx::submit(1); + const float xpos = -8.0f - BX_COUNTOF(textures)*0.1f*0.5f; for (uint32_t ii = 0; ii < BX_COUNTOF(textures); ++ii) { - bx::mtxTranslate(mtx, -8.0f - BX_COUNTOF(textures)*0.1f*0.5f + ii*2.1f, 4.0f, 0.0f); + bx::mtxTranslate(mtx, xpos + ii*2.1f, 4.0f, 0.0f); // Set model matrix for rendering. bgfx::setTransform(mtx); @@ -370,9 +399,33 @@ int _main_(int /*_argc*/, char** /*_argv*/) bgfx::submit(1); } + for (uint32_t ii = 0; ii < BX_COUNTOF(textures3d); ++ii) + { + bx::mtxTranslate(mtx, xpos + ii*2.1f, -4.0f, 0.0f); + + // Set model matrix for rendering. + bgfx::setTransform(mtx); + + // Set vertex and fragment shaders. + bgfx::setProgram(program3d); + + // Set vertex and index buffer. + bgfx::setVertexBuffer(vbh); + bgfx::setIndexBuffer(ibh, 0, 6); + + // Bind texture. + bgfx::setTexture(0, u_texColor, textures3d[ii]); + + // Set render states. + bgfx::setState(BGFX_STATE_DEFAULT); + + // Submit primitive for rendering to view 1. + bgfx::submit(1); + } + for (uint32_t ii = 0; ii < 3; ++ii) { - bx::mtxTranslate(mtx, -8.0f - BX_COUNTOF(textures)*0.1f*0.5f + 8*2.1f, -4.0f + ii*2.1f, 0.0f); + bx::mtxTranslate(mtx, xpos + 8*2.1f, -4.0f + ii*2.1f, 0.0f); // Set model matrix for rendering. bgfx::setTransform(mtx); @@ -412,12 +465,19 @@ int _main_(int /*_argc*/, char** /*_argv*/) bgfx::destroyTexture(textures[ii]); } + for (uint32_t ii = 0; ii < BX_COUNTOF(textures3d); ++ii) + { + bgfx::destroyTexture(textures3d[ii]); + } + bgfx::destroyTexture(texture2d); bgfx::destroyTexture(textureCube); bgfx::destroyIndexBuffer(ibh); bgfx::destroyVertexBuffer(vbh); + bgfx::destroyProgram(program3d); bgfx::destroyProgram(programCmp); bgfx::destroyProgram(program); + bgfx::destroyUniform(u_time); bgfx::destroyUniform(u_texColor); bgfx::destroyUniform(u_texCube); diff --git a/3rdparty/bgfx/examples/25-c99/helloworld.c b/3rdparty/bgfx/examples/25-c99/helloworld.c new file mode 100644 index 00000000000..b3862ebd2a1 --- /dev/null +++ b/3rdparty/bgfx/examples/25-c99/helloworld.c @@ -0,0 +1,68 @@ +/* + * Copyright 2011-2015 Branimir Karadzic. All rights reserved. + * License: http://www.opensource.org/licenses/BSD-2-Clause + */ + +#include +#include "../00-helloworld/logo.h" + +extern bool entry_process_events(uint32_t* _width, uint32_t* _height, uint32_t* _debug, uint32_t* _reset); + +uint16_t uint16_max(uint16_t _a, uint16_t _b) +{ + return _a < _b ? _b : _a; +} + +int _main_(int _argc, char** _argv) +{ + (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_reset(width, height, reset); + + // Enable debug text. + bgfx_set_debug(debug); + + bgfx_set_view_clear(0 + , BGFX_CLEAR_COLOR|BGFX_CLEAR_DEPTH + , 0x303030ff + , 1.0f + , 0 + ); + + while (!entry_process_events(&width, &height, &debug, &reset) ) + { + // Set view 0 default viewport. + bgfx_set_view_rect(0, 0, 0, width, height); + + // This dummy draw call is here to make sure that view 0 is cleared + // if no other draw calls are submitted to view 0. + bgfx_submit(0, 0); + + // Use debug font to print information about this example. + bgfx_dbg_text_clear(0, false); + bgfx_dbg_text_image(uint16_max(width/2/8, 20)-20 + , uint16_max(height/2/16, 6)-6 + , 40 + , 12 + , s_logo + , 160 + ); + bgfx_dbg_text_printf(0, 1, 0x4f, "bgfx/examples/25-c99"); + bgfx_dbg_text_printf(0, 2, 0x6f, "Description: Initialization and debug text with C99 API."); + + // Advance to next frame. Rendering thread will be kicked to + // process submitted rendering primitives. + bgfx_frame(); + } + + // Shutdown bgfx. + bgfx_shutdown(); + + return 0; +} diff --git a/3rdparty/bgfx/examples/common/entry/entry.cpp b/3rdparty/bgfx/examples/common/entry/entry.cpp index 1007787a0bd..7ef7853145f 100644 --- a/3rdparty/bgfx/examples/common/entry/entry.cpp +++ b/3rdparty/bgfx/examples/common/entry/entry.cpp @@ -60,15 +60,17 @@ namespace entry switch (_key) { - case Key::Esc: { return 0x1b; } break; - case Key::Return: { return 0x0d; } break; - case Key::Tab: { return 0x09; } break; - case Key::Space: { return 0xa0; } break; - case Key::Backspace: { return 0x08; } break; - case Key::Plus: { return 0x2b; } break; - case Key::Minus: { return 0x2d; } break; - default: { return '\0'; } break; + case Key::Esc: return 0x1b; + case Key::Return: return '\n'; + case Key::Tab: return '\t'; + case Key::Space: return ' '; + case Key::Backspace: return 0x08; + case Key::Plus: return '+'; + case Key::Minus: return '-'; + default: break; } + + return '\0'; } bool setOrToggle(uint32_t& _flags, const char* _name, uint32_t _bit, int _first, int _argc, char const* const* _argv) diff --git a/3rdparty/bgfx/examples/common/entry/entry_osx.mm b/3rdparty/bgfx/examples/common/entry/entry_osx.mm index b46fbdb4b9f..14a4930128a 100644 --- a/3rdparty/bgfx/examples/common/entry/entry_osx.mm +++ b/3rdparty/bgfx/examples/common/entry/entry_osx.mm @@ -584,10 +584,10 @@ namespace entry if (!s_ctx.m_fullscreen) { - [NSMenu setMenuBarVisible: false]; s_ctx.m_style &= ~NSTitledWindowMask; dispatch_async(dispatch_get_main_queue() , ^{ + [NSMenu setMenuBarVisible: false]; [window setStyleMask: s_ctx.m_style]; [window setFrame:screenRect display:YES]; }); @@ -596,10 +596,10 @@ namespace entry } else { - [NSMenu setMenuBarVisible: true]; s_ctx.m_style |= NSTitledWindowMask; dispatch_async(dispatch_get_main_queue() , ^{ + [NSMenu setMenuBarVisible: true]; [window setStyleMask: s_ctx.m_style]; [window setFrame:s_ctx.m_windowFrame display:YES]; }); diff --git a/3rdparty/bgfx/examples/common/entry/entry_sdl.cpp b/3rdparty/bgfx/examples/common/entry/entry_sdl.cpp index c279f0fd2a6..b9564339c11 100644 --- a/3rdparty/bgfx/examples/common/entry/entry_sdl.cpp +++ b/3rdparty/bgfx/examples/common/entry/entry_sdl.cpp @@ -211,6 +211,9 @@ namespace entry : m_width(ENTRY_DEFAULT_WIDTH) , m_height(ENTRY_DEFAULT_HEIGHT) , m_aspectRatio(16.0f/9.0f) + , m_mx(0) + , m_my(0) + , m_mz(0) , m_mouseLock(false) , m_fullscreen(false) { @@ -376,10 +379,13 @@ namespace entry case SDL_MOUSEMOTION: { const SDL_MouseMotionEvent& mev = event.motion; + m_mx = mev.x; + m_my = mev.y; + WindowHandle handle = findHandle(mev.windowID); if (isValid(handle) ) { - m_eventQueue.postMouseEvent(handle, mev.x, mev.y, 0); + m_eventQueue.postMouseEvent(handle, m_mx, m_my, m_mz); } } break; @@ -411,6 +417,30 @@ namespace entry } break; + case SDL_MOUSEWHEEL: + { + const SDL_MouseWheelEvent& mev = event.wheel; + m_mz += mev.y; + + WindowHandle handle = findHandle(mev.windowID); + if (isValid(handle) ) + { + m_eventQueue.postMouseEvent(handle, m_mx, m_my, m_mz); + } + } + break; + + case SDL_TEXTINPUT: + { + const SDL_TextInputEvent& tev = event.text; + WindowHandle handle = findHandle(tev.windowID); + if (isValid(handle) ) + { + m_eventQueue.postCharEvent(handle, 1, (const uint8_t*)tev.text); + } + } + break; + case SDL_KEYDOWN: { const SDL_KeyboardEvent& kev = event.key; @@ -745,6 +775,7 @@ namespace entry int32_t m_mx; int32_t m_my; + int32_t m_mz; bool m_mouseLock; bool m_fullscreen; }; diff --git a/3rdparty/bgfx/examples/common/imgui/imgui.cpp b/3rdparty/bgfx/examples/common/imgui/imgui.cpp index cdd918c0fbb..646d13b0d0a 100644 --- a/3rdparty/bgfx/examples/common/imgui/imgui.cpp +++ b/3rdparty/bgfx/examples/common/imgui/imgui.cpp @@ -388,6 +388,8 @@ struct Imgui , m_halfTexel(0.0f) , m_nvg(NULL) , m_view(255) + , m_surfaceWidth(0) + , m_surfaceHeight(0) , m_viewWidth(0) , m_viewHeight(0) , m_currentFontIdx(0) @@ -810,20 +812,31 @@ struct Imgui m_char = _inputChar; } - void beginFrame(int32_t _mx, int32_t _my, uint8_t _button, int32_t _scroll, uint16_t _width, uint16_t _height, char _inputChar, uint8_t _view) + void beginFrame(int32_t _mx, int32_t _my, uint8_t _button, int32_t _scroll, uint16_t _width, uint16_t _height, uint16_t _surfaceWidth, uint16_t _surfaceHeight, char _inputChar, uint8_t _view) { - IMGUI_beginFrame(_mx, _my, _button, _width, _height, _inputChar, _view); - m_view = _view; m_viewWidth = _width; m_viewHeight = _height; + m_surfaceWidth = _surfaceWidth; + m_surfaceHeight = _surfaceHeight; + + const float xscale = float(m_surfaceWidth) /float(m_viewWidth); + const float yscale = float(m_surfaceHeight)/float(m_viewHeight); + const int32_t mx = int32_t(float(_mx)*xscale); + const int32_t my = int32_t(float(_my)*yscale); + + IMGUI_beginFrame(mx, my, _button, _width, _height, _inputChar, _view); + nvgBeginFrameScaled(m_nvg, m_viewWidth, m_viewHeight, m_surfaceWidth, m_surfaceHeight, 1.0f); + nvgViewId(m_nvg, _view); + bgfx::setViewName(_view, "IMGUI"); bgfx::setViewSeq(_view, true); const bgfx::HMD* hmd = bgfx::getHMD(); if (NULL != hmd) { - m_viewWidth = _width / 2; + m_viewWidth = _width / 2; + m_surfaceWidth = _surfaceWidth / 2; float proj[16]; bx::mtxProj(proj, hmd->eye[0].fov, 0.1f, 100.0f); @@ -836,22 +849,22 @@ struct Imgui const float offset1 = -proj[8] + (hmd->eye[1].viewOffset[0] / dist * proj[0]); float ortho[2][16]; - const float viewOffset = _width/4.0f; - const float viewWidth = _width/2.0f; - bx::mtxOrtho(ortho[0], viewOffset, viewOffset + viewWidth, (float)m_viewHeight, 0.0f, 0.0f, 1000.0f, offset0); - bx::mtxOrtho(ortho[1], viewOffset, viewOffset + viewWidth, (float)m_viewHeight, 0.0f, 0.0f, 1000.0f, offset1); + const float viewOffset = _surfaceWidth/4.0f; + const float viewWidth = _surfaceWidth/2.0f; + bx::mtxOrtho(ortho[0], viewOffset, viewOffset + viewWidth, (float)m_surfaceHeight, 0.0f, 0.0f, 1000.0f, offset0); + bx::mtxOrtho(ortho[1], viewOffset, viewOffset + viewWidth, (float)m_surfaceHeight, 0.0f, 0.0f, 1000.0f, offset1); bgfx::setViewTransform(_view, NULL, ortho[0], BGFX_VIEW_STEREO, ortho[1]); bgfx::setViewRect(_view, 0, 0, hmd->width, hmd->height); } else { float ortho[16]; - bx::mtxOrtho(ortho, 0.0f, (float)m_viewWidth, (float)m_viewHeight, 0.0f, 0.0f, 1000.0f); + bx::mtxOrtho(ortho, 0.0f, (float)m_surfaceWidth, (float)m_surfaceHeight, 0.0f, 0.0f, 1000.0f); bgfx::setViewTransform(_view, NULL, ortho); bgfx::setViewRect(_view, 0, 0, _width, _height); } - updateInput(_mx, _my, _button, _scroll, _inputChar); + updateInput(mx, my, _button, _scroll, _inputChar); m_hot = m_hotToBe; m_hotToBe = 0; @@ -883,6 +896,7 @@ struct Imgui clearInput(); + nvgEndFrame(m_nvg); IMGUI_endFrame(); } @@ -936,12 +950,7 @@ struct Imgui setEnabled(m_areaId); } - nvgScissor(m_nvg - , float(area.m_scissorX) - , float(area.m_scissorY-1) - , float(area.m_scissorWidth) - , float(area.m_scissorHeight+1) - ); + nvgScissor(m_nvg, area); m_insideArea |= area.m_inside; @@ -1079,12 +1088,7 @@ struct Imgui } } - nvgScissor(m_nvg - , float(parentArea.m_scissorX) - , float(parentArea.m_scissorY-1) - , float(parentArea.m_scissorWidth) - , float(parentArea.m_scissorHeight+1) - ); + nvgScissor(m_nvg, parentArea); } bool beginArea(const char* _name, int32_t _x, int32_t _y, int32_t _width, int32_t _height, bool _enabled, int32_t _r) @@ -1158,13 +1162,7 @@ struct Imgui } area.m_scissorEnabled = true; - nvgBeginFrame(m_nvg, m_viewWidth, m_viewHeight, 1.0f); - nvgScissor(m_nvg - , float(area.m_scissorX) - , float(area.m_scissorY-1) - , float(area.m_scissorWidth) - , float(area.m_scissorHeight+1) - ); + nvgScissor(m_nvg, area); m_insideArea |= area.m_inside; return area.m_inside; @@ -1172,8 +1170,8 @@ struct Imgui void endArea() { + m_areaId.pop(); nvgResetScissor(m_nvg); - nvgEndFrame(m_nvg); } bool button(const char* _text, bool _enabled, ImguiAlign::Enum _align, uint32_t _rgb0, int32_t _r) @@ -1202,7 +1200,7 @@ struct Imgui //|| ImguiAlign::CenterIndented == _align). { xx = area.m_widgetX; - width = area.m_widgetW - (area.m_widgetX-area.m_scissorX); + width = area.m_widgetW - (area.m_widgetX-area.m_contentX); } const bool enabled = _enabled && isEnabled(m_areaId); @@ -1385,7 +1383,7 @@ struct Imgui //|| ImguiAlign::CenterIndented == _align). { xx = area.m_widgetX; - width = area.m_widgetW - (area.m_widgetX-area.m_scissorX); + width = area.m_widgetW - (area.m_widgetX-area.m_contentX); } const bool drawLabel = (NULL != _label && _label[0] != '\0'); @@ -1524,7 +1522,7 @@ struct Imgui //|| ImguiAlign::CenterIndented == _align). { xx = area.m_widgetX; - width = area.m_widgetW - (area.m_widgetX-area.m_scissorX); + width = area.m_widgetW - (area.m_widgetX-area.m_contentX); } uint8_t selected = _selected; @@ -1744,7 +1742,7 @@ struct Imgui //|| ImguiAlign::CenterIndented == _align). { xx = area.m_widgetX; - width = area.m_widgetW - (area.m_widgetX-area.m_scissorX); + width = area.m_widgetW - (area.m_widgetX-area.m_contentX); } const int32_t height = width/2; @@ -1797,7 +1795,7 @@ struct Imgui //|| ImguiAlign::CenterIndented == _align). { xx = area.m_widgetX; - width = area.m_widgetW - (area.m_widgetX-area.m_scissorX); + width = area.m_widgetW - (area.m_widgetX-area.m_contentX); } const bool adjustHeight = (_cross && _sameHeight); @@ -2023,39 +2021,39 @@ struct Imgui xx = -borderSize; yy = -1; width = 2*borderSize+1; - height = m_viewHeight+1; + height = m_surfaceHeight+1; triX = 0; - triY = (m_viewHeight-triSize)/2; + triY = (m_surfaceHeight-triSize)/2; orientation = _checked ? TriangleOrientation::Left : TriangleOrientation::Right; } else if (ImguiBorder::Right == _border) { - xx = m_viewWidth - borderSize; + xx = m_surfaceWidth - borderSize; yy = -1; width = 2*borderSize+1; - height = m_viewHeight+1; - triX = m_viewWidth - triSize - 2; - triY = (m_viewHeight-width)/2; + height = m_surfaceHeight+1; + triX = m_surfaceWidth - triSize - 2; + triY = (m_surfaceHeight-width)/2; orientation = _checked ? TriangleOrientation::Right : TriangleOrientation::Left; } else if (ImguiBorder::Top == _border) { xx = 0; yy = -borderSize; - width = m_viewWidth; + width = m_surfaceWidth; height = 2*borderSize; - triX = (m_viewWidth-triSize)/2; + triX = (m_surfaceWidth-triSize)/2; triY = 0; orientation = _checked ? TriangleOrientation::Up : TriangleOrientation::Down; } else //if (ImguiBorder::Bottom == _border). { xx = 0; - yy = m_viewHeight - borderSize; - width = m_viewWidth; + yy = m_surfaceHeight - borderSize; + width = m_surfaceWidth; height = 2*borderSize; - triX = (m_viewWidth-triSize)/2; - triY = m_viewHeight-triSize; + triX = (m_surfaceWidth-triSize)/2; + triY = m_surfaceHeight-triSize; orientation = _checked ? TriangleOrientation::Down : TriangleOrientation::Up; } @@ -2146,7 +2144,7 @@ struct Imgui //|| ImguiAlign::CenterIndented == _align). { xx = area.m_widgetX; - width = area.m_widgetW - (area.m_widgetX-area.m_scissorX); + width = area.m_widgetW - (area.m_widgetX-area.m_contentX); } drawRoundedRect( (float)xx, (float)yy, (float)width, (float)height, 4.0f, imguiRGBA(0, 0, 0, 128) ); @@ -2264,19 +2262,40 @@ struct Imgui area.m_widgetY += _height; } - void separatorLine(uint16_t _height) + void separatorLine(uint16_t _height, ImguiAlign::Enum _align) { Area& area = getCurrentArea(); - const int32_t rectWidth = area.m_widgetW; - const int32_t rectHeight = 1; - const int32_t xx = area.m_widgetX; - const int32_t yy = area.m_widgetY + _height/2 - rectHeight; + //const int32_t width = area.m_widgetW; + const int32_t height = 1; + //const int32_t xx = area.m_widgetX; + const int32_t yy = area.m_widgetY + _height/2 - height; + + int32_t xx; + int32_t width; + if (ImguiAlign::Left == _align) + { + xx = area.m_contentX + SCROLL_AREA_PADDING; + width = area.m_widgetW; + } + else if (ImguiAlign::LeftIndented == _align + || ImguiAlign::Right == _align) + { + xx = area.m_widgetX; + width = area.m_widgetW; + } + else //if (ImguiAlign::Center == _align + //|| ImguiAlign::CenterIndented == _align). + { + xx = area.m_widgetX; + width = area.m_widgetW - (area.m_widgetX-area.m_contentX) + 1; + } + area.m_widgetY += _height; drawRect( (float)xx , (float)yy - , (float)rectWidth - , (float)rectHeight + , (float)width + , (float)height , imguiRGBA(255, 255, 255, 32) ); } @@ -3047,10 +3066,16 @@ struct Imgui const Area& area = getCurrentArea(); if (area.m_scissorEnabled) { - bgfx::setScissor(uint16_t(IMGUI_MAX(0, area.m_scissorX) ) - , uint16_t(IMGUI_MAX(0, area.m_scissorY-1) ) - , area.m_scissorWidth - , area.m_scissorHeight+1 + const float xscale = float(m_viewWidth) /float(m_surfaceWidth); + const float yscale = float(m_viewHeight)/float(m_surfaceHeight); + const int16_t scissorX = int16_t(float(area.m_scissorX)*xscale); + const int16_t scissorY = int16_t(float(area.m_scissorY)*yscale); + const int16_t scissorWidth = int16_t(float(area.m_scissorWidth)*xscale); + const int16_t scissorHeight = int16_t(float(area.m_scissorHeight)*yscale); + bgfx::setScissor(uint16_t(IMGUI_MAX(0, scissorX) ) + , uint16_t(IMGUI_MAX(0, scissorY-1) ) + , scissorWidth + , scissorHeight+1 ); } else @@ -3059,6 +3084,23 @@ struct Imgui } } + inline void nvgScissor(NVGcontext* _ctx, const Area& _area) + { + if (_area.m_scissorEnabled) + { + ::nvgScissor(_ctx + , float(IMGUI_MAX(0, _area.m_scissorX) ) + , float(IMGUI_MAX(0, _area.m_scissorY-1) ) + , float(_area.m_scissorWidth) + , float(_area.m_scissorHeight+1) + ); + } + else + { + nvgResetScissor(_ctx); + } + } + template struct IdStack { @@ -3146,6 +3188,8 @@ struct Imgui NVGcontext* m_nvg; uint8_t m_view; + uint16_t m_surfaceWidth; + uint16_t m_surfaceHeight; uint16_t m_viewWidth; uint16_t m_viewHeight; @@ -3202,9 +3246,14 @@ ImguiFontHandle imguiGetCurrentFont() return handle; } +void imguiBeginFrame(int32_t _mx, int32_t _my, uint8_t _button, int32_t _scroll, uint16_t _width, uint16_t _height, uint16_t _surfaceWidth, uint16_t _surfaceHeight, char _inputChar, uint8_t _view) +{ + s_imgui.beginFrame(_mx, _my, _button, _scroll, _width, _height, _surfaceWidth, _surfaceHeight, _inputChar, _view); +} + void imguiBeginFrame(int32_t _mx, int32_t _my, uint8_t _button, int32_t _scroll, uint16_t _width, uint16_t _height, char _inputChar, uint8_t _view) { - s_imgui.beginFrame(_mx, _my, _button, _scroll, _width, _height, _inputChar, _view); + s_imgui.beginFrame(_mx, _my, _button, _scroll, _width, _height, _width, _height, _inputChar, _view); } void imguiEndFrame() @@ -3287,9 +3336,9 @@ void imguiSeparator(uint16_t _height) s_imgui.separator(_height); } -void imguiSeparatorLine(uint16_t _height) +void imguiSeparatorLine(uint16_t _height, ImguiAlign::Enum _align) { - s_imgui.separatorLine(_height); + s_imgui.separatorLine(_height, _align); } int32_t imguiGetWidgetX() diff --git a/3rdparty/bgfx/examples/common/imgui/imgui.h b/3rdparty/bgfx/examples/common/imgui/imgui.h index ba99291a7f7..0ab69038d3f 100644 --- a/3rdparty/bgfx/examples/common/imgui/imgui.h +++ b/3rdparty/bgfx/examples/common/imgui/imgui.h @@ -137,6 +137,7 @@ ImguiFontHandle imguiCreate(const void* _data = NULL, uint32_t _size = 0, float void imguiDestroy(); void imguiBeginFrame(int32_t _mx, int32_t _my, uint8_t _button, int32_t _scroll, uint16_t _width, uint16_t _height, char _inputChar = 0, uint8_t _view = 255); +void imguiBeginFrame(int32_t _mx, int32_t _my, uint8_t _button, int32_t _scroll, uint16_t _width, uint16_t _height, uint16_t _surfaceWidth, uint16_t _surfaceHeight, char _inputChar = 0, uint8_t _view = 255); void imguiEndFrame(); void imguiDrawText(int _x, int _y, ImguiTextAlign::Enum _align, const char* _text, uint32_t _argb); @@ -158,7 +159,7 @@ void imguiEndScrollArea(int32_t _r = IMGUI_SCROLL_BAR_R); void imguiIndent(uint16_t _width = IMGUI_INDENT_VALUE); void imguiUnindent(uint16_t _width = IMGUI_INDENT_VALUE); void imguiSeparator(uint16_t _height = IMGUI_SEPARATOR_VALUE); -void imguiSeparatorLine(uint16_t _height = IMGUI_SEPARATOR_VALUE); +void imguiSeparatorLine(uint16_t _height = IMGUI_SEPARATOR_VALUE, ImguiAlign::Enum = ImguiAlign::LeftIndented); int32_t imguiGetWidgetX(); int32_t imguiGetWidgetY(); diff --git a/3rdparty/bgfx/examples/common/imgui/ocornut_imgui.cpp b/3rdparty/bgfx/examples/common/imgui/ocornut_imgui.cpp index 62cb1c87a79..19726040b04 100644 --- a/3rdparty/bgfx/examples/common/imgui/ocornut_imgui.cpp +++ b/3rdparty/bgfx/examples/common/imgui/ocornut_imgui.cpp @@ -165,7 +165,7 @@ struct OcornutImguiContext ImGui::NewFrame(); - ImGui::ShowTestWindow(); + //ImGui::ShowTestWindow(); //Debug only. } void endFrame() diff --git a/3rdparty/bgfx/examples/common/nanovg/nanovg.cpp b/3rdparty/bgfx/examples/common/nanovg/nanovg.cpp index 1cbb58b5794..bb0e6bb3571 100644 --- a/3rdparty/bgfx/examples/common/nanovg/nanovg.cpp +++ b/3rdparty/bgfx/examples/common/nanovg/nanovg.cpp @@ -296,7 +296,7 @@ void nvgDeleteInternal(NVGcontext* ctx) free(ctx); } -void nvgBeginFrame(NVGcontext* ctx, int windowWidth, int windowHeight, float devicePixelRatio) +void nvgBeginFrameScaled(NVGcontext* ctx, int windowWidth, int windowHeight, int surfaceWidth, int surfaceHeight, float devicePixelRatio) { /* printf("Tris: draws:%d fill:%d stroke:%d text:%d TOT:%d\n", ctx->drawCallCount, ctx->fillTriCount, ctx->strokeTriCount, ctx->textTriCount, @@ -307,8 +307,8 @@ void nvgBeginFrame(NVGcontext* ctx, int windowWidth, int windowHeight, float dev nvgReset(ctx); nvg__setDevicePixelRatio(ctx, devicePixelRatio); - - ctx->params.renderViewport(ctx->params.userPtr, windowWidth, windowHeight); + + ctx->params.renderViewport(ctx->params.userPtr, windowWidth, windowHeight, surfaceWidth, surfaceHeight); ctx->drawCallCount = 0; ctx->fillTriCount = 0; @@ -316,6 +316,11 @@ void nvgBeginFrame(NVGcontext* ctx, int windowWidth, int windowHeight, float dev ctx->textTriCount = 0; } +void nvgBeginFrame(NVGcontext* ctx, int windowWidth, int windowHeight, float devicePixelRatio) +{ + nvgBeginFrameScaled(ctx, windowWidth, windowHeight, windowWidth, windowHeight, devicePixelRatio); +} + void nvgCancelFrame(NVGcontext* ctx) { ctx->params.renderCancel(ctx->params.userPtr); diff --git a/3rdparty/bgfx/examples/common/nanovg/nanovg.h b/3rdparty/bgfx/examples/common/nanovg/nanovg.h index 4ff96151d73..f43f90f4651 100644 --- a/3rdparty/bgfx/examples/common/nanovg/nanovg.h +++ b/3rdparty/bgfx/examples/common/nanovg/nanovg.h @@ -116,6 +116,7 @@ enum NVGimageFlags { // frame buffer size. In that case you would set windowWidth/Height to the window size // devicePixelRatio to: frameBufferWidth / windowWidth. void nvgBeginFrame(NVGcontext* ctx, int windowWidth, int windowHeight, float devicePixelRatio); +void nvgBeginFrameScaled(NVGcontext* ctx, int windowWidth, int windowHeight, int surfaceWidth, int surfaceHeight, float devicePixelRatio); // Cancels drawing the current frame. void nvgCancelFrame(NVGcontext* ctx); @@ -588,7 +589,7 @@ struct NVGparams { int (*renderDeleteTexture)(void* uptr, int image); int (*renderUpdateTexture)(void* uptr, int image, int x, int y, int w, int h, const unsigned char* data); int (*renderGetTextureSize)(void* uptr, int image, int* w, int* h); - void (*renderViewport)(void* uptr, int width, int height); + void (*renderViewport)(void* uptr, int width, int height, int surfaceWidth, int surfaceHeight); void (*renderCancel)(void* uptr); void (*renderFlush)(void* uptr); void (*renderFill)(void* uptr, NVGpaint* paint, NVGscissor* scissor, float fringe, const float* bounds, const NVGpath* paths, int npaths); @@ -599,6 +600,7 @@ struct NVGparams { typedef struct NVGparams NVGparams; NVGcontext* nvgCreate(int edgeaa, unsigned char viewid); +void nvgViewId(struct NVGcontext* ctx, unsigned char viewid); void nvgDelete(struct NVGcontext* ctx); // Contructor and destructor, called by the render back-end. diff --git a/3rdparty/bgfx/examples/common/nanovg/nanovg_bgfx.cpp b/3rdparty/bgfx/examples/common/nanovg/nanovg_bgfx.cpp index 40a1fbe8418..39402237031 100644 --- a/3rdparty/bgfx/examples/common/nanovg/nanovg_bgfx.cpp +++ b/3rdparty/bgfx/examples/common/nanovg/nanovg_bgfx.cpp @@ -132,6 +132,7 @@ namespace struct GLNVGtexture* textures; float view[2]; + float surface[2]; int ntextures; int ctextures; int textureId; @@ -516,11 +517,13 @@ namespace gl->th = handle; } - static void nvgRenderViewport(void* _userPtr, int width, int height) + static void nvgRenderViewport(void* _userPtr, int width, int height, int surfaceWidth, int surfaceHeight) { struct GLNVGcontext* gl = (struct GLNVGcontext*)_userPtr; gl->view[0] = (float)width; gl->view[1] = (float)height; + gl->surface[0] = (float)surfaceWidth; + gl->surface[1] = (float)surfaceHeight; bgfx::setViewRect(gl->viewid, 0, 0, width, height); } @@ -720,7 +723,7 @@ namespace ); } - bgfx::setUniform(gl->u_viewSize, gl->view); + bgfx::setUniform(gl->u_viewSize, gl->surface); for (uint32_t ii = 0, num = gl->ncalls; ii < num; ++ii) { @@ -1051,6 +1054,13 @@ error: return NULL; } +void nvgViewId(struct NVGcontext* ctx, unsigned char viewid) +{ + struct NVGparams* params = nvgInternalParams(ctx); + struct GLNVGcontext* gl = (struct GLNVGcontext*)params->userPtr; + gl->viewid = uint8_t(viewid); +} + void nvgDelete(struct NVGcontext* ctx) { nvgDeleteInternal(ctx); diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_update_3d.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_update_3d.bin new file mode 100644 index 00000000000..e73f85355ef Binary files /dev/null and b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_update_3d.bin differ diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_update_3d.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_update_3d.bin new file mode 100644 index 00000000000..08c745a4e7f Binary files /dev/null and b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_update_3d.bin differ diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_update_3d.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_update_3d.bin new file mode 100644 index 00000000000..636d67fcb21 Binary files /dev/null and b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_update_3d.bin differ diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_update_3d.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_update_3d.bin new file mode 100644 index 00000000000..0dd12aaa48e Binary files /dev/null and b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_update_3d.bin differ diff --git a/3rdparty/bgfx/scripts/bgfx.lua b/3rdparty/bgfx/scripts/bgfx.lua index 30646cfd1ac..644f9c4e96d 100644 --- a/3rdparty/bgfx/scripts/bgfx.lua +++ b/3rdparty/bgfx/scripts/bgfx.lua @@ -25,6 +25,11 @@ function bgfxProject(_name, _kind, _defines) "-shared", } + configuration { "linux-*" } + buildoptions { + "-fPIC", + } + configuration {} end diff --git a/3rdparty/bgfx/scripts/genie.lua b/3rdparty/bgfx/scripts/genie.lua index 9056714240e..9f7888a2a70 100644 --- a/3rdparty/bgfx/scripts/genie.lua +++ b/3rdparty/bgfx/scripts/genie.lua @@ -84,13 +84,14 @@ function exampleProject(_name) end includedirs { - path.join(BX_DIR, "include"), + path.join(BX_DIR, "include"), path.join(BGFX_DIR, "include"), path.join(BGFX_DIR, "3rdparty"), path.join(BGFX_DIR, "examples/common"), } files { + path.join(BGFX_DIR, "examples", _name, "**.c"), path.join(BGFX_DIR, "examples", _name, "**.cpp"), path.join(BGFX_DIR, "examples", _name, "**.h"), } @@ -308,6 +309,7 @@ exampleProject("21-deferred") exampleProject("22-windows") exampleProject("23-vectordisplay") exampleProject("24-nbody") +exampleProject("25-c99") if _OPTIONS["with-shared-lib"] then group "libs" diff --git a/3rdparty/bgfx/src/bgfx_shader.sh b/3rdparty/bgfx/src/bgfx_shader.sh index e0e14cf544b..52de12e84a0 100644 --- a/3rdparty/bgfx/src/bgfx_shader.sh +++ b/3rdparty/bgfx/src/bgfx_shader.sh @@ -74,6 +74,16 @@ struct BgfxSampler3D Texture3D m_texture; }; +struct BgfxISampler3D +{ + Texture3D m_texture; +}; + +struct BgfxUSampler3D +{ + Texture3D m_texture; +}; + vec4 bgfxTexture3D(BgfxSampler3D _sampler, vec3 _coord) { return _sampler.m_texture.Sample(_sampler.m_sampler, _coord); @@ -84,6 +94,20 @@ vec4 bgfxTexture3DLod(BgfxSampler3D _sampler, vec3 _coord, float _level) return _sampler.m_texture.SampleLevel(_sampler.m_sampler, _coord, _level); } +ivec4 bgfxTexture3D(BgfxISampler3D _sampler, vec3 _coord) +{ + ivec3 size; + _sampler.m_texture.GetDimensions(size.x, size.y, size.z); + return _sampler.m_texture.Load(ivec4(_coord * size, 0) ); +} + +uvec4 bgfxTexture3D(BgfxUSampler3D _sampler, vec3 _coord) +{ + uvec3 size; + _sampler.m_texture.GetDimensions(size.x, size.y, size.z); + return _sampler.m_texture.Load(uvec4(_coord * size, 0) ); +} + struct BgfxSamplerCube { SamplerState m_sampler; @@ -121,6 +145,12 @@ vec4 bgfxTextureCubeLod(BgfxSamplerCube _sampler, vec3 _coord, float _level) uniform SamplerState _name ## Sampler : register(s[_reg]); \ uniform Texture3D _name ## Texture : register(t[_reg]); \ static BgfxSampler3D _name = { _name ## Sampler, _name ## Texture } +# define ISAMPLER3D(_name, _reg) \ + uniform Texture3D _name ## Texture : register(t[_reg]); \ + static BgfxISampler3D _name = { _name ## Texture } +# define USAMPLER3D(_name, _reg) \ + uniform Texture3D _name ## Texture : register(t[_reg]); \ + static BgfxUSampler3D _name = { _name ## Texture } # define sampler3D BgfxSampler3D # define texture3D(_sampler, _coord) bgfxTexture3D(_sampler, _coord) # define texture3DLod(_sampler, _coord, _level) bgfxTexture3DLod(_sampler, _coord, _level) @@ -247,6 +277,13 @@ vec4 mod(vec4 _a, vec4 _b) { return _a - _b * floor(_a / _b); } # define uvec3_splat(_x) uvec3(_x) # define uvec4_splat(_x) uvec4(_x) +# if BGFX_SHADER_LANGUAGE_GLSL >= 130 +# define ISAMPLER3D(_name, _reg) uniform isampler3D _name +# define USAMPLER3D(_name, _reg) uniform usampler3D _name +ivec4 texture3D(isampler3D _sampler, vec3 _coord) { return texture(_sampler, _coord); } +uvec4 texture3D(usampler3D _sampler, vec3 _coord) { return texture(_sampler, _coord); } +# endif // BGFX_SHADER_LANGUAGE_GLSL >= 130 + vec3 instMul(vec3 _vec, mat3 _mtx) { return mul(_vec, _mtx); } vec3 instMul(mat3 _mtx, vec3 _vec) { return mul(_mtx, _vec); } vec4 instMul(vec4 _vec, mat4 _mtx) { return mul(_vec, _mtx); } diff --git a/3rdparty/bgfx/src/image.cpp b/3rdparty/bgfx/src/image.cpp index 53e3acbcd8d..c18d4e939cf 100644 --- a/3rdparty/bgfx/src/image.cpp +++ b/3rdparty/bgfx/src/image.cpp @@ -19,55 +19,55 @@ namespace bgfx // | | | | +----- min blocks x // | | | | | +-- min blocks y // | | | | | | - { 4, 4, 4, 8, 1, 1 }, // BC1 - { 8, 4, 4, 16, 1, 1 }, // BC2 - { 8, 4, 4, 16, 1, 1 }, // BC3 - { 4, 4, 4, 8, 1, 1 }, // BC4 - { 8, 4, 4, 16, 1, 1 }, // BC5 - { 8, 4, 4, 16, 1, 1 }, // BC6H - { 8, 4, 4, 16, 1, 1 }, // BC7 - { 4, 4, 4, 8, 1, 1 }, // ETC1 - { 4, 4, 4, 8, 1, 1 }, // ETC2 - { 8, 4, 4, 16, 1, 1 }, // ETC2A - { 4, 4, 4, 8, 1, 1 }, // ETC2A1 - { 2, 8, 4, 8, 2, 2 }, // PTC12 - { 4, 4, 4, 8, 2, 2 }, // PTC14 - { 2, 8, 4, 8, 2, 2 }, // PTC12A - { 4, 4, 4, 8, 2, 2 }, // PTC14A - { 2, 8, 4, 8, 2, 2 }, // PTC22 - { 4, 4, 4, 8, 2, 2 }, // PTC24 - { 0, 0, 0, 0, 1, 1 }, // Unknown - { 1, 8, 1, 1, 1, 1 }, // R1 - { 8, 1, 1, 1, 1, 1 }, // R8 - { 16, 1, 1, 2, 1, 1 }, // R16 - { 16, 1, 1, 2, 1, 1 }, // R16F - { 32, 1, 1, 4, 1, 1 }, // R32 - { 32, 1, 1, 4, 1, 1 }, // R32F - { 16, 1, 1, 2, 1, 1 }, // RG8 - { 32, 1, 1, 4, 1, 1 }, // RG16 - { 32, 1, 1, 4, 1, 1 }, // RG16F - { 64, 1, 1, 8, 1, 1 }, // RG32 - { 64, 1, 1, 8, 1, 1 }, // RG32F - { 32, 1, 1, 4, 1, 1 }, // BGRA8 - { 32, 1, 1, 4, 1, 1 }, // RGBA8 - { 64, 1, 1, 8, 1, 1 }, // RGBA16 - { 64, 1, 1, 8, 1, 1 }, // RGBA16F - { 128, 1, 1, 16, 1, 1 }, // RGBA32 - { 128, 1, 1, 16, 1, 1 }, // RGBA32F - { 16, 1, 1, 2, 1, 1 }, // R5G6B5 - { 16, 1, 1, 2, 1, 1 }, // RGBA4 - { 16, 1, 1, 2, 1, 1 }, // RGB5A1 - { 32, 1, 1, 4, 1, 1 }, // RGB10A2 - { 32, 1, 1, 4, 1, 1 }, // R11G11B10F - { 0, 0, 0, 0, 1, 1 }, // UnknownDepth - { 16, 1, 1, 2, 1, 1 }, // D16 - { 24, 1, 1, 3, 1, 1 }, // D24 - { 32, 1, 1, 4, 1, 1 }, // D24S8 - { 32, 1, 1, 4, 1, 1 }, // D32 - { 16, 1, 1, 2, 1, 1 }, // D16F - { 24, 1, 1, 3, 1, 1 }, // D24F - { 32, 1, 1, 4, 1, 1 }, // D32F - { 8, 1, 1, 1, 1, 1 }, // D0S8 + { 4, 4, 4, 8, 1, 1, 0, 0 }, // BC1 + { 8, 4, 4, 16, 1, 1, 0, 0 }, // BC2 + { 8, 4, 4, 16, 1, 1, 0, 0 }, // BC3 + { 4, 4, 4, 8, 1, 1, 0, 0 }, // BC4 + { 8, 4, 4, 16, 1, 1, 0, 0 }, // BC5 + { 8, 4, 4, 16, 1, 1, 0, 0 }, // BC6H + { 8, 4, 4, 16, 1, 1, 0, 0 }, // BC7 + { 4, 4, 4, 8, 1, 1, 0, 0 }, // ETC1 + { 4, 4, 4, 8, 1, 1, 0, 0 }, // ETC2 + { 8, 4, 4, 16, 1, 1, 0, 0 }, // ETC2A + { 4, 4, 4, 8, 1, 1, 0, 0 }, // ETC2A1 + { 2, 8, 4, 8, 2, 2, 0, 0 }, // PTC12 + { 4, 4, 4, 8, 2, 2, 0, 0 }, // PTC14 + { 2, 8, 4, 8, 2, 2, 0, 0 }, // PTC12A + { 4, 4, 4, 8, 2, 2, 0, 0 }, // PTC14A + { 2, 8, 4, 8, 2, 2, 0, 0 }, // PTC22 + { 4, 4, 4, 8, 2, 2, 0, 0 }, // PTC24 + { 0, 0, 0, 0, 1, 1, 0, 0 }, // Unknown + { 1, 8, 1, 1, 1, 1, 0, 0 }, // R1 + { 8, 1, 1, 1, 1, 1, 0, 0 }, // R8 + { 16, 1, 1, 2, 1, 1, 0, 0 }, // R16 + { 16, 1, 1, 2, 1, 1, 0, 0 }, // R16F + { 32, 1, 1, 4, 1, 1, 0, 0 }, // R32 + { 32, 1, 1, 4, 1, 1, 0, 0 }, // R32F + { 16, 1, 1, 2, 1, 1, 0, 0 }, // RG8 + { 32, 1, 1, 4, 1, 1, 0, 0 }, // RG16 + { 32, 1, 1, 4, 1, 1, 0, 0 }, // RG16F + { 64, 1, 1, 8, 1, 1, 0, 0 }, // RG32 + { 64, 1, 1, 8, 1, 1, 0, 0 }, // RG32F + { 32, 1, 1, 4, 1, 1, 0, 0 }, // BGRA8 + { 32, 1, 1, 4, 1, 1, 0, 0 }, // RGBA8 + { 64, 1, 1, 8, 1, 1, 0, 0 }, // RGBA16 + { 64, 1, 1, 8, 1, 1, 0, 0 }, // RGBA16F + { 128, 1, 1, 16, 1, 1, 0, 0 }, // RGBA32 + { 128, 1, 1, 16, 1, 1, 0, 0 }, // RGBA32F + { 16, 1, 1, 2, 1, 1, 0, 0 }, // R5G6B5 + { 16, 1, 1, 2, 1, 1, 0, 0 }, // RGBA4 + { 16, 1, 1, 2, 1, 1, 0, 0 }, // RGB5A1 + { 32, 1, 1, 4, 1, 1, 0, 0 }, // RGB10A2 + { 32, 1, 1, 4, 1, 1, 0, 0 }, // R11G11B10F + { 0, 0, 0, 0, 1, 1, 0, 0 }, // UnknownDepth + { 16, 1, 1, 2, 1, 1, 16, 0 }, // D16 + { 24, 1, 1, 3, 1, 1, 24, 0 }, // D24 + { 32, 1, 1, 4, 1, 1, 24, 8 }, // D24S8 + { 32, 1, 1, 4, 1, 1, 32, 0 }, // D32 + { 16, 1, 1, 2, 1, 1, 16, 0 }, // D16F + { 24, 1, 1, 3, 1, 1, 24, 0 }, // D24F + { 32, 1, 1, 4, 1, 1, 32, 0 }, // D32F + { 8, 1, 1, 1, 1, 1, 0, 8 }, // D0S8 }; BX_STATIC_ASSERT(TextureFormat::Count == BX_COUNTOF(s_imageBlockInfo) ); diff --git a/3rdparty/bgfx/src/image.h b/3rdparty/bgfx/src/image.h index 3ddb1086f7c..ab1430c375d 100644 --- a/3rdparty/bgfx/src/image.h +++ b/3rdparty/bgfx/src/image.h @@ -45,6 +45,8 @@ namespace bgfx uint8_t blockSize; uint8_t minBlockX; uint8_t minBlockY; + uint8_t depthBits; + uint8_t stencilBits; }; /// diff --git a/3rdparty/bgfx/src/renderer_d3d11.cpp b/3rdparty/bgfx/src/renderer_d3d11.cpp index d49987e2fdf..1ccaeffd290 100644 --- a/3rdparty/bgfx/src/renderer_d3d11.cpp +++ b/3rdparty/bgfx/src/renderer_d3d11.cpp @@ -203,7 +203,7 @@ namespace bgfx { DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // Unknown { DXGI_FORMAT_R1_UNORM, DXGI_FORMAT_R1_UNORM, DXGI_FORMAT_UNKNOWN }, // R1 { DXGI_FORMAT_R8_UNORM, DXGI_FORMAT_R8_UNORM, DXGI_FORMAT_UNKNOWN }, // R8 - { DXGI_FORMAT_R16_UNORM, DXGI_FORMAT_R16_UNORM, DXGI_FORMAT_UNKNOWN }, // R16 + { DXGI_FORMAT_R16_UINT, DXGI_FORMAT_R16_UINT, DXGI_FORMAT_UNKNOWN }, // R16 { DXGI_FORMAT_R16_FLOAT, DXGI_FORMAT_R16_FLOAT, DXGI_FORMAT_UNKNOWN }, // R16F { DXGI_FORMAT_R32_UINT, DXGI_FORMAT_R32_UINT, DXGI_FORMAT_UNKNOWN }, // R32 { DXGI_FORMAT_R32_FLOAT, DXGI_FORMAT_R32_FLOAT, DXGI_FORMAT_UNKNOWN }, // R32F @@ -728,7 +728,40 @@ namespace bgfx for (uint32_t ii = 0; ii < TextureFormat::Count; ++ii) { - g_caps.formats[ii] = DXGI_FORMAT_UNKNOWN == s_textureFormat[ii].m_fmt ? 0 : 1; + uint8_t support = BGFX_CAPS_FORMAT_TEXTURE_NONE; + + if (DXGI_FORMAT_UNKNOWN != s_textureFormat[ii].m_fmt) + { + 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) ); + if (SUCCEEDED(hr) ) + { + support |= 0 != (data.OutFormatSupport & (0 + | D3D11_FORMAT_SUPPORT_TEXTURE2D + | D3D11_FORMAT_SUPPORT_TEXTURE3D + | D3D11_FORMAT_SUPPORT_TEXTURECUBE + ) ) + ? BGFX_CAPS_FORMAT_TEXTURE_COLOR + : BGFX_CAPS_FORMAT_TEXTURE_NONE + ; + + support |= 0 != (data.OutFormatSupport & (0 + | D3D11_FORMAT_SUPPORT_BUFFER + | D3D11_FORMAT_SUPPORT_IA_VERTEX_BUFFER + | D3D11_FORMAT_SUPPORT_IA_INDEX_BUFFER + ) ) + ? BGFX_CAPS_FORMAT_TEXTURE_VERTEX + : BGFX_CAPS_FORMAT_TEXTURE_NONE + ; + } + else + { + BX_TRACE("CheckFeatureSupport failed with %x for format %s.", hr, getName(TextureFormat::Enum(ii) ) ); + } + } + + g_caps.formats[ii] = support; } // Init reserved part of view name. diff --git a/3rdparty/bgfx/src/renderer_d3d9.h b/3rdparty/bgfx/src/renderer_d3d9.h index 586a41f81b8..e32a91a18d8 100644 --- a/3rdparty/bgfx/src/renderer_d3d9.h +++ b/3rdparty/bgfx/src/renderer_d3d9.h @@ -10,7 +10,7 @@ #if BX_PLATFORM_WINDOWS # if !BGFX_CONFIG_RENDERER_DIRECT3D9EX -# define D3D_DISABLE_9EX +//# define D3D_DISABLE_9EX # endif // !BGFX_CONFIG_RENDERER_DIRECT3D9EX # include diff --git a/3rdparty/bgfx/src/renderer_gl.cpp b/3rdparty/bgfx/src/renderer_gl.cpp index c6cffc511fd..6d4dc557175 100644 --- a/3rdparty/bgfx/src/renderer_gl.cpp +++ b/3rdparty/bgfx/src/renderer_gl.cpp @@ -713,6 +713,17 @@ namespace bgfx NULL }; + static const char* s_uisamplers[] = + { + "isampler2D", + "usampler2D", + "isampler3D", + "usampler3D", + "isamplerCube", + "usamplerCube", + NULL + }; + static void GL_APIENTRY stubVertexAttribDivisor(GLuint /*_index*/, GLuint /*_divisor*/) { } @@ -2603,25 +2614,35 @@ namespace bgfx GLSL_TYPE(GL_FLOAT_MAT2); GLSL_TYPE(GL_FLOAT_MAT3); GLSL_TYPE(GL_FLOAT_MAT4); -// GLSL_TYPE(GL_FLOAT_MAT2x3); -// GLSL_TYPE(GL_FLOAT_MAT2x4); -// GLSL_TYPE(GL_FLOAT_MAT3x2); -// GLSL_TYPE(GL_FLOAT_MAT3x4); -// GLSL_TYPE(GL_FLOAT_MAT4x2); -// GLSL_TYPE(GL_FLOAT_MAT4x3); -// GLSL_TYPE(GL_SAMPLER_1D); - GLSL_TYPE(GL_SAMPLER_2D); + + GLSL_TYPE(GL_SAMPLER_2D); + GLSL_TYPE(GL_INT_SAMPLER_2D); + GLSL_TYPE(GL_UNSIGNED_INT_SAMPLER_2D); + GLSL_TYPE(GL_SAMPLER_3D); + GLSL_TYPE(GL_INT_SAMPLER_3D); + GLSL_TYPE(GL_UNSIGNED_INT_SAMPLER_3D); + GLSL_TYPE(GL_SAMPLER_CUBE); -// GLSL_TYPE(GL_SAMPLER_1D_SHADOW); + GLSL_TYPE(GL_INT_SAMPLER_CUBE); + GLSL_TYPE(GL_UNSIGNED_INT_SAMPLER_CUBE); + GLSL_TYPE(GL_SAMPLER_2D_SHADOW); + GLSL_TYPE(GL_IMAGE_1D); - GLSL_TYPE(GL_IMAGE_2D); - GLSL_TYPE(GL_IMAGE_3D); - GLSL_TYPE(GL_IMAGE_CUBE); + GLSL_TYPE(GL_INT_IMAGE_1D); GLSL_TYPE(GL_UNSIGNED_INT_IMAGE_1D); + + GLSL_TYPE(GL_IMAGE_2D); + GLSL_TYPE(GL_INT_IMAGE_2D); GLSL_TYPE(GL_UNSIGNED_INT_IMAGE_2D); + + GLSL_TYPE(GL_IMAGE_3D); + GLSL_TYPE(GL_INT_IMAGE_3D); GLSL_TYPE(GL_UNSIGNED_INT_IMAGE_3D); + + GLSL_TYPE(GL_IMAGE_CUBE); + GLSL_TYPE(GL_INT_IMAGE_CUBE); GLSL_TYPE(GL_UNSIGNED_INT_IMAGE_CUBE); } @@ -2687,27 +2708,34 @@ namespace bgfx case GL_FLOAT_MAT4: return UniformType::Uniform4x4fv; -// case GL_FLOAT_MAT2x3: -// case GL_FLOAT_MAT2x4: -// case GL_FLOAT_MAT3x2: -// case GL_FLOAT_MAT3x4: -// case GL_FLOAT_MAT4x2: -// case GL_FLOAT_MAT4x3: -// break; - -// case GL_SAMPLER_1D: case GL_SAMPLER_2D: + case GL_INT_SAMPLER_2D: + case GL_UNSIGNED_INT_SAMPLER_2D: + case GL_SAMPLER_3D: + case GL_INT_SAMPLER_3D: + case GL_UNSIGNED_INT_SAMPLER_3D: + case GL_SAMPLER_CUBE: -// case GL_SAMPLER_1D_SHADOW: - case GL_SAMPLER_2D_SHADOW: + case GL_INT_SAMPLER_CUBE: + case GL_UNSIGNED_INT_SAMPLER_CUBE: + + case GL_SAMPLER_2D_SHADOW: + case GL_IMAGE_1D: - case GL_IMAGE_2D: - case GL_IMAGE_3D: - case GL_IMAGE_CUBE: + case GL_INT_IMAGE_1D: case GL_UNSIGNED_INT_IMAGE_1D: + + case GL_IMAGE_2D: + case GL_INT_IMAGE_2D: case GL_UNSIGNED_INT_IMAGE_2D: + + case GL_IMAGE_3D: + case GL_INT_IMAGE_3D: case GL_UNSIGNED_INT_IMAGE_3D: + + case GL_IMAGE_CUBE: + case GL_INT_IMAGE_CUBE: case GL_UNSIGNED_INT_IMAGE_CUBE: return UniformType::Uniform1iv; }; @@ -2899,16 +2927,33 @@ namespace bgfx switch (gltype) { case GL_SAMPLER_2D: + case GL_INT_SAMPLER_2D: + case GL_UNSIGNED_INT_SAMPLER_2D: + case GL_SAMPLER_3D: + case GL_INT_SAMPLER_3D: + case GL_UNSIGNED_INT_SAMPLER_3D: + case GL_SAMPLER_CUBE: + case GL_INT_SAMPLER_CUBE: + case GL_UNSIGNED_INT_SAMPLER_CUBE: + case GL_SAMPLER_2D_SHADOW: + case GL_IMAGE_1D: - case GL_IMAGE_2D: - case GL_IMAGE_3D: - case GL_IMAGE_CUBE: + case GL_INT_IMAGE_1D: case GL_UNSIGNED_INT_IMAGE_1D: + + case GL_IMAGE_2D: + case GL_INT_IMAGE_2D: case GL_UNSIGNED_INT_IMAGE_2D: + + case GL_IMAGE_3D: + case GL_INT_IMAGE_3D: case GL_UNSIGNED_INT_IMAGE_3D: + + case GL_IMAGE_CUBE: + case GL_INT_IMAGE_CUBE: case GL_UNSIGNED_INT_IMAGE_CUBE: BX_TRACE("Sampler #%d at location %d.", m_numSamplers, loc); m_sampler[m_numSamplers] = loc; @@ -3285,13 +3330,14 @@ namespace bgfx blockHeight = blockInfo.blockHeight; } - BX_TRACE("Texture %3d: %s (requested: %s), %dx%d%s%s." + BX_TRACE("Texture%-4s %3d: %s (requested: %s), %dx%dx%d%s." + , imageContainer.m_cubeMap ? "Cube" : (1 < imageContainer.m_depth ? "3D" : "2D") , this - s_renderGL->m_textures , getName( (TextureFormat::Enum)m_textureFormat) , getName( (TextureFormat::Enum)m_requestedFormat) , textureWidth , textureHeight - , imageContainer.m_cubeMap ? "x6" : "" + , imageContainer.m_cubeMap ? 6 : (1 < imageContainer.m_depth ? imageContainer.m_depth : 0) , 0 != (m_flags&BGFX_TEXTURE_RT_MASK) ? " (render target)" : "" ); @@ -3871,14 +3917,22 @@ namespace bgfx else if (BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGL) && BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGL <= 21) ) { - bool usesTextureLod = s_extension[Extension::ARB_shader_texture_lod].m_supported + bool usesTextureLod = true + && s_extension[Extension::ARB_shader_texture_lod].m_supported && bx::findIdentifierMatch(code, s_ARB_shader_texture_lod) ; + bool usesIUsamplers = !!bx::findIdentifierMatch(code, s_uisamplers); + + uint32_t version = usesIUsamplers ? 130 : (usesTextureLod ? 120 : 0); + + if (0 != version) + { + writeStringf(&writer, "#version %d\n", version); + } + if (usesTextureLod) { - writeString(&writer, "#version 120\n"); - if (m_type == GL_FRAGMENT_SHADER) { writeString(&writer, "#extension GL_ARB_shader_texture_lod : enable\n"); @@ -4072,9 +4126,22 @@ namespace bgfx } GLenum attachment = GL_COLOR_ATTACHMENT0 + colorIdx; - if (isDepth( (TextureFormat::Enum)texture.m_textureFormat) ) + TextureFormat::Enum format = (TextureFormat::Enum)texture.m_textureFormat; + if (isDepth(format) ) { - attachment = GL_DEPTH_ATTACHMENT; + const ImageBlockInfo& info = getBlockInfo(format); + if (0 < info.stencilBits) + { + attachment = GL_DEPTH_STENCIL_ATTACHMENT; + } + else if (0 == info.depthBits) + { + attachment = GL_STENCIL_ATTACHMENT; + } + else + { + attachment = GL_DEPTH_ATTACHMENT; + } } else { diff --git a/3rdparty/bgfx/src/renderer_gl.h b/3rdparty/bgfx/src/renderer_gl.h index b65a8499670..9160fbfe44f 100644 --- a/3rdparty/bgfx/src/renderer_gl.h +++ b/3rdparty/bgfx/src/renderer_gl.h @@ -424,6 +424,30 @@ typedef uint64_t GLuint64; # define GL_COMPARE_REF_TO_TEXTURE 0x884E #endif // GL_COMPARE_REF_TO_TEXTURE +#ifndef GL_INT_SAMPLER_2D +# define GL_INT_SAMPLER_2D 0x8DCA +#endif // GL_INT_SAMPLER_2D + +#ifndef GL_UNSIGNED_INT_SAMPLER_2D +# define GL_UNSIGNED_INT_SAMPLER_2D 0x8DD2 +#endif // GL_UNSIGNED_INT_SAMPLER_2D + +#ifndef GL_INT_SAMPLER_3D +# define GL_INT_SAMPLER_3D 0x8DCB +#endif // GL_INT_SAMPLER_3D + +#ifndef GL_UNSIGNED_INT_SAMPLER_3D +# define GL_UNSIGNED_INT_SAMPLER_3D 0x8DD3 +#endif // GL_UNSIGNED_INT_SAMPLER_3D + +#ifndef GL_INT_SAMPLER_CUBE +# define GL_INT_SAMPLER_CUBE 0x8DCC +#endif // GL_INT_SAMPLER_CUBEER_3D + +#ifndef GL_UNSIGNED_INT_SAMPLER_CUBE +# define GL_UNSIGNED_INT_SAMPLER_CUBE 0x8DD4 +#endif // GL_UNSIGNED_INT_SAMPLER_CUBE + #ifndef GL_SAMPLER_2D_SHADOW # define GL_SAMPLER_2D_SHADOW 0x8B62 #endif // GL_SAMPLER_2D_SHADOW @@ -484,6 +508,22 @@ typedef uint64_t GLuint64; # define GL_IMAGE_CUBE 0x9050 #endif // GL_IMAGE_CUBE +#ifndef GL_INT_IMAGE_1D +# define GL_INT_IMAGE_1D 0x9057 +#endif // GL_INT_IMAGE_1D + +#ifndef GL_INT_IMAGE_2D +# define GL_INT_IMAGE_2D 0x9058 +#endif // GL_INT_IMAGE_2D + +#ifndef GL_INT_IMAGE_3D +# define GL_INT_IMAGE_3D 0x9059 +#endif // GL_INT_IMAGE_3D + +#ifndef GL_INT_IMAGE_CUBE +# define GL_INT_IMAGE_CUBE 0x905B +#endif // GL_INT_IMAGE_CUBE + #ifndef GL_UNSIGNED_INT_IMAGE_1D # define GL_UNSIGNED_INT_IMAGE_1D 0x9062 #endif // GL_UNSIGNED_INT_IMAGE_1D diff --git a/3rdparty/bgfx/src/vertexdecl.cpp b/3rdparty/bgfx/src/vertexdecl.cpp index c0c4edeef1d..83435fa8cf2 100644 --- a/3rdparty/bgfx/src/vertexdecl.cpp +++ b/3rdparty/bgfx/src/vertexdecl.cpp @@ -41,27 +41,21 @@ namespace bgfx static const uint8_t (*s_attribTypeSize[])[AttribType::Count][4] = { -#if BGFX_CONFIG_RENDERER_DIRECT3D9 - &s_attribTypeSizeDx9, -#elif BGFX_CONFIG_RENDERER_DIRECT3D11 || BGFX_CONFIG_RENDERER_DIRECT3D12 - &s_attribTypeSizeDx1x, -#elif BGFX_CONFIG_RENDERER_OPENGL || BGFX_CONFIG_RENDERER_OPENGLES || BGFX_CONFIG_RENDERER_VULKAN - &s_attribTypeSizeGl, -#else - &s_attribTypeSizeDx9, -#endif // BGFX_CONFIG_RENDERER_ + &s_attribTypeSizeDx9, // Null &s_attribTypeSizeDx9, // Direct3D9 &s_attribTypeSizeDx1x, // Direct3D11 &s_attribTypeSizeDx1x, // Direct3D12 &s_attribTypeSizeGl, // OpenGLES &s_attribTypeSizeGl, // OpenGL &s_attribTypeSizeGl, // Vulkan + &s_attribTypeSizeDx9, // Count }; - BX_STATIC_ASSERT(BX_COUNTOF(s_attribTypeSize) == bgfx::RendererType::Count); + BX_STATIC_ASSERT(BX_COUNTOF(s_attribTypeSize) == RendererType::Count+1); void initAttribTypeSizeTable(RendererType::Enum _type) { - s_attribTypeSize[0] = s_attribTypeSize[_type]; + s_attribTypeSize[0] = s_attribTypeSize[_type]; + s_attribTypeSize[RendererType::Count] = s_attribTypeSize[_type]; } void dbgPrintfVargs(const char* _format, va_list _argList) diff --git a/3rdparty/bgfx/tools/shaderc/shaderc.cpp b/3rdparty/bgfx/tools/shaderc/shaderc.cpp index 0e3a0c9c60b..a4a42af5af6 100644 --- a/3rdparty/bgfx/tools/shaderc/shaderc.cpp +++ b/3rdparty/bgfx/tools/shaderc/shaderc.cpp @@ -751,7 +751,8 @@ int main(int _argc, const char* _argv[]) bool raw = cmdLine.hasArg('\0', "raw"); - uint32_t gles = 0; + uint32_t glsl = 0; + uint32_t essl = 0; uint32_t hlsl = 2; uint32_t d3d = 11; const char* profile = cmdLine.findOption('p', "profile"); @@ -774,10 +775,14 @@ int main(int _argc, const char* _argv[]) { hlsl = 5; } + else + { + glsl = atoi(profile); + } } else { - gles = 2; + essl = 2; } const char* bin2c = NULL; @@ -811,7 +816,7 @@ int main(int _argc, const char* _argv[]) bool preprocessOnly = cmdLine.hasArg("preprocess"); const char* includeDir = cmdLine.findOption('i'); - Preprocessor preprocessor(filePath, 0 != gles, includeDir); + Preprocessor preprocessor(filePath, 0 != essl, includeDir); std::string dir; { @@ -839,43 +844,38 @@ int main(int _argc, const char* _argv[]) preprocessor.setDefaultDefine("BGFX_SHADER_TYPE_FRAGMENT"); preprocessor.setDefaultDefine("BGFX_SHADER_TYPE_VERTEX"); - bool glsl = false; + char glslDefine[128]; + bx::snprintf(glslDefine, BX_COUNTOF(glslDefine), "BGFX_SHADER_LANGUAGE_GLSL=%d", glsl); if (0 == bx::stricmp(platform, "android") ) { preprocessor.setDefine("BX_PLATFORM_ANDROID=1"); preprocessor.setDefine("BGFX_SHADER_LANGUAGE_GLSL=1"); - glsl = true; } else if (0 == bx::stricmp(platform, "asm.js") ) { preprocessor.setDefine("BX_PLATFORM_EMSCRIPTEN=1"); preprocessor.setDefine("BGFX_SHADER_LANGUAGE_GLSL=1"); - glsl = true; } else if (0 == bx::stricmp(platform, "ios") ) { preprocessor.setDefine("BX_PLATFORM_IOS=1"); preprocessor.setDefine("BGFX_SHADER_LANGUAGE_GLSL=1"); - glsl = true; } else if (0 == bx::stricmp(platform, "linux") ) { preprocessor.setDefine("BX_PLATFORM_LINUX=1"); - preprocessor.setDefine("BGFX_SHADER_LANGUAGE_GLSL=1"); - glsl = true; + preprocessor.setDefine(glslDefine); } else if (0 == bx::stricmp(platform, "nacl") ) { preprocessor.setDefine("BX_PLATFORM_NACL=1"); preprocessor.setDefine("BGFX_SHADER_LANGUAGE_GLSL=1"); - glsl = true; } else if (0 == bx::stricmp(platform, "osx") ) { preprocessor.setDefine("BX_PLATFORM_OSX=1"); - preprocessor.setDefine("BGFX_SHADER_LANGUAGE_GLSL=1"); - glsl = true; + preprocessor.setDefine(glslDefine); } else if (0 == bx::stricmp(platform, "windows") ) { @@ -1120,7 +1120,7 @@ int main(int _argc, const char* _argv[]) bx::write(writer, outputHash); } - if (glsl) + if (0 != glsl) { bx::write(writer, uint16_t(0) ); @@ -1155,7 +1155,7 @@ int main(int _argc, const char* _argv[]) } else { - if (glsl) + if (0 != glsl) { } else @@ -1269,18 +1269,17 @@ int main(int _argc, const char* _argv[]) bx::write(writer, BGFX_CHUNK_MAGIC_CSH); bx::write(writer, outputHash); - if (glsl) + if (0 != glsl) { std::string code; - if (gles) + if (essl) { bx::stringPrintf(code, "#version 310 es\n"); } else { - int32_t version = atoi(profile); - bx::stringPrintf(code, "#version %d\n", version == 0 ? 430 : version); + bx::stringPrintf(code, "#version %d\n", glsl == 0 ? 430 : glsl); } code += preprocessor.m_preprocessed; @@ -1294,7 +1293,7 @@ int main(int _argc, const char* _argv[]) compiled = true; #else - compiled = compileGLSLShader(cmdLine, gles, code, writer); + compiled = compileGLSLShader(cmdLine, essl, code, writer); #endif // 0 } else @@ -1339,15 +1338,19 @@ int main(int _argc, const char* _argv[]) } else { - if (glsl) + if (0 != glsl) { - preprocessor.writef( - "#define ivec2 vec2\n" - "#define ivec3 vec3\n" - "#define ivec4 vec4\n" - ); + if (120 == glsl + || essl) + { + preprocessor.writef( + "#define ivec2 vec2\n" + "#define ivec3 vec3\n" + "#define ivec4 vec4\n" + ); + } - if (0 == gles) + if (0 == essl) { // bgfx shadow2D/Proj behave like EXT_shadow_samplers // not as GLSL language 1.2 specs shadow2D/Proj. @@ -1645,7 +1648,7 @@ int main(int _argc, const char* _argv[]) return EXIT_FAILURE; } - if (glsl) + if (0 != glsl) { const char* profile = cmdLine.findOption('p', "profile"); if (NULL == profile) @@ -1697,16 +1700,15 @@ int main(int _argc, const char* _argv[]) bx::write(writer, outputHash); } - if (glsl) + if (0 != glsl) { std::string code; bool hasTextureLod = NULL != bx::findIdentifierMatch(input, s_ARB_shader_texture_lod /*EXT_shader_texture_lod*/); - if (0 == gles) + if (0 == essl) { bx::stringPrintf(code, "#version %s\n", profile); - int32_t version = atoi(profile); bx::stringPrintf(code , "#define bgfxShadow2D shadow2D\n" @@ -1714,7 +1716,7 @@ int main(int _argc, const char* _argv[]) ); if (hasTextureLod - && 130 > version) + && 130 > glsl) { bx::stringPrintf(code , "#extension GL_ARB_shader_texture_lod : enable\n" @@ -1767,7 +1769,7 @@ int main(int _argc, const char* _argv[]) } code += preprocessor.m_preprocessed; - compiled = compileGLSLShader(cmdLine, gles, code, writer); + compiled = compileGLSLShader(cmdLine, essl, code, writer); } else { diff --git a/3rdparty/bx/include/bx/platform.h b/3rdparty/bx/include/bx/platform.h index 373c991769a..c3eda5f4123 100644 --- a/3rdparty/bx/include/bx/platform.h +++ b/3rdparty/bx/include/bx/platform.h @@ -19,11 +19,13 @@ #define BX_PLATFORM_LINUX 0 #define BX_PLATFORM_NACL 0 #define BX_PLATFORM_OSX 0 +#define BX_PLATFORM_PS4 0 #define BX_PLATFORM_QNX 0 #define BX_PLATFORM_RPI 0 #define BX_PLATFORM_WINDOWS 0 #define BX_PLATFORM_WINRT 0 #define BX_PLATFORM_XBOX360 0 +#define BX_PLATFORM_XBOXONE 0 #define BX_CPU_ARM 0 #define BX_CPU_JIT 0 @@ -120,6 +122,9 @@ #if defined(_XBOX_VER) # undef BX_PLATFORM_XBOX360 # define BX_PLATFORM_XBOX360 1 +#elif defined (_DURANGO) +# undef BX_PLATFORM_XBOXONE +# define BX_PLATFORM_XBOXONE 1 #elif defined(_WIN32) || defined(_WIN64) // http://msdn.microsoft.com/en-us/library/6sehtctf.aspx # ifndef NOMINMAX @@ -173,6 +178,9 @@ #elif defined(EMSCRIPTEN) # undef BX_PLATFORM_EMSCRIPTEN # define BX_PLATFORM_EMSCRIPTEN 1 +#elif defined(__ORBIS__) +# undef BX_PLATFORM_PS4 +# define BX_PLATFORM_PS4 1 #elif defined(__QNX__) # undef BX_PLATFORM_QNX # define BX_PLATFORM_QNX 1 @@ -242,6 +250,8 @@ BX_STRINGIZE(BX_PLATFORM_NACL) #elif BX_PLATFORM_OSX # define BX_PLATFORM_NAME "OSX" +#elif BX_PLATFORM_PS4 +# define BX_PLATFORM_NAME "PlayStation 4" #elif BX_PLATFORM_QNX # define BX_PLATFORM_NAME "QNX" #elif BX_PLATFORM_RPI @@ -250,6 +260,10 @@ # define BX_PLATFORM_NAME "Windows" #elif BX_PLATFORM_WINRT # define BX_PLATFORM_NAME "WinRT" +#elif BX_PLATFORM_XBOX360 +# define BX_PLATFORM_NAME "Xbox 360" +#elif BX_PLATFORM_XBOXONE +# define BX_PLATFORM_NAME "Xbox One" #endif // BX_PLATFORM_ #if BX_CPU_ARM diff --git a/3rdparty/bx/scripts/toolchain.lua b/3rdparty/bx/scripts/toolchain.lua index 5c2cf4c86e9..85f24e10746 100644 --- a/3rdparty/bx/scripts/toolchain.lua +++ b/3rdparty/bx/scripts/toolchain.lua @@ -298,12 +298,12 @@ function toolchain(_buildDir, _libDir) premake.vstudio.toolset = ("v110_xp") location (path.join(_buildDir, "projects", _ACTION .. "-xp")) end - + if ("vs2013-xp") == _OPTIONS["vs"] then premake.vstudio.toolset = ("v120_xp") location (path.join(_buildDir, "projects", _ACTION .. "-xp")) end - + elseif _ACTION == "xcode4" then if "osx" == _OPTIONS["xcode"] then @@ -414,7 +414,6 @@ function toolchain(_buildDir, _libDir) defines { "WIN32" } includedirs { path.join(bxDir, "include/compat/mingw") } buildoptions { - "-std=c++11", "-Wunused-value", "-fdata-sections", "-ffunction-sections", @@ -422,6 +421,9 @@ function toolchain(_buildDir, _libDir) "-Wunused-value", "-Wundef", } + buildoptions_cpp { + "-std=c++0x", + } linkoptions { "-Wl,--gc-sections", "-static-libgcc", @@ -486,11 +488,13 @@ function toolchain(_buildDir, _libDir) configuration { "linux-*" } buildoptions { - "-std=c++0x", "-msse2", "-Wunused-value", "-Wundef", } + buildoptions_cpp { + "-std=c++0x", + } links { "rt", "dl", @@ -845,10 +849,12 @@ function toolchain(_buildDir, _libDir) "__STDC_VERSION__=199901L", } buildoptions { - "-std=c++0x", "-Wunused-value", "-Wundef", } + buildoptions_cpp { + "-std=c++0x", + } includedirs { "/opt/vc/include", "/opt/vc/include/interface/vcos/pthreads", diff --git a/3rdparty/bx/tools/bin/darwin/genie b/3rdparty/bx/tools/bin/darwin/genie index 5480af740cc..19f84f8eb7f 100644 Binary files a/3rdparty/bx/tools/bin/darwin/genie and b/3rdparty/bx/tools/bin/darwin/genie differ diff --git a/3rdparty/bx/tools/bin/linux/genie b/3rdparty/bx/tools/bin/linux/genie index 752d1894fbc..db40bf0bce2 100644 Binary files a/3rdparty/bx/tools/bin/linux/genie and b/3rdparty/bx/tools/bin/linux/genie differ diff --git a/3rdparty/bx/tools/bin/windows/genie.exe b/3rdparty/bx/tools/bin/windows/genie.exe index 0cc72817afc..3075bc286ee 100644 Binary files a/3rdparty/bx/tools/bin/windows/genie.exe and b/3rdparty/bx/tools/bin/windows/genie.exe differ diff --git a/3rdparty/genie/.editorconfig b/3rdparty/genie/.editorconfig new file mode 100644 index 00000000000..e9070240b79 --- /dev/null +++ b/3rdparty/genie/.editorconfig @@ -0,0 +1,13 @@ +root = true + +[*] +indent_style = tab +indent_size = 4 +end_of_line = lf +max_line_length = 100 +insert_final_newline = true +trim_trailing_whitespace = true + +[*.md] +trim_trailing_whitespace = false +max_line_length = 80 diff --git a/3rdparty/genie/README.md b/3rdparty/genie/README.md index 0fc9c18128d..e5e20890119 100644 --- a/3rdparty/genie/README.md +++ b/3rdparty/genie/README.md @@ -14,7 +14,7 @@ Supported project generators: Download (stable) ----------------- - version 206 (commit e65d8143b1186496b9da03c6461a25402a2ee873) + version 225 (commit 2321131cbf61d5a13df44c255b8d18d73121149d) Linux: https://github.com/bkaradzic/bx/raw/master/tools/bin/linux/genie diff --git a/3rdparty/genie/build/gmake.darwin/genie.make b/3rdparty/genie/build/gmake.darwin/genie.make index e532179d4b1..e1dbd874d32 100644 --- a/3rdparty/genie/build/gmake.darwin/genie.make +++ b/3rdparty/genie/build/gmake.darwin/genie.make @@ -3,8 +3,6 @@ ifndef config config=release endif -override undefine TARGET - ifndef verbose SILENT = @ endif @@ -20,9 +18,11 @@ endif ifeq (posix,$(SHELLTYPE)) MKDIR = $(SILENT) mkdir -p "$(1)" COPY = $(SILENT) cp -fR "$(1)" "$(2)" + RM= $(SILENT) rm -f "$(1)" else MKDIR = $(SILENT) mkdir "$(subst /,\\,$(1))" 2> nul || exit 0 COPY = $(SILENT) copy /Y "$(subst /,\\,$(1))" "$(subst /,\\,$(2))" + RM = $(SILENT) del /F "$(subst /,\\,$(1))" 2> nul || exit 0 endif CC = gcc @@ -40,68 +40,69 @@ endif ifeq ($(config),release) OBJDIR = obj/Release TARGETDIR = ../../bin/darwin - TARGET = $(TARGETDIR)/genie + override TARGET = $(TARGETDIR)/genie DEFINES += -DNDEBUG -DLUA_COMPAT_MODULE -DLUA_USE_MACOSX INCLUDES += -I../../src/host/lua-5.2.3/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) $(ALL_CFLAGS) + ALL_CXXFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os -mmacosx-version-min=10.4 + ALL_OBJCFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os -mmacosx-version-min=10.4 ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) ALL_LDFLAGS += $(LDFLAGS) -L. -Wl,-x -mmacosx-version-min=10.4 LDDEPS += LIBS += $(LDDEPS) -framework CoreServices LINKCMD = $(CC) -o $(TARGET) $(OBJECTS) $(RESOURCES) $(ARCH) $(ALL_LDFLAGS) $(LIBS) OBJECTS := \ - $(OBJDIR)/src/host/os_isfile.o \ + $(OBJDIR)/src/host/os_getcwd.o \ $(OBJDIR)/src/host/os_stat.o \ - $(OBJDIR)/src/host/os_rmdir.o \ - $(OBJDIR)/src/host/os_copyfile.o \ - $(OBJDIR)/src/host/string_hash.o \ $(OBJDIR)/src/host/os_chdir.o \ - $(OBJDIR)/src/host/os_is64bit.o \ - $(OBJDIR)/src/host/os_match.o \ + $(OBJDIR)/src/host/premake_main.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_mkdir.o \ $(OBJDIR)/src/host/os_getversion.o \ - $(OBJDIR)/src/host/premake_main.o \ - $(OBJDIR)/src/host/path_isabsolute.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_uuid.o \ - $(OBJDIR)/src/host/os_pathsearch.o \ - $(OBJDIR)/src/host/os_getcwd.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lbaselib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lvm.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lcorolib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ltablib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lobject.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lcode.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ldo.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/liolib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ltable.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/loadlib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lundump.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/loslib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lfunc.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/linit.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lstate.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/llex.o \ + $(OBJDIR)/src/host/os_mkdir.o \ + $(OBJDIR)/src/host/path_isabsolute.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/lmathlib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lauxlib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lopcodes.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/lapi.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ldblib.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/lgc.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ltm.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/lctype.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 \ define PREBUILDCMDS @@ -115,68 +116,69 @@ endif ifeq ($(config),debug) OBJDIR = obj/Debug TARGETDIR = ../../bin/darwin - TARGET = $(TARGETDIR)/genie + override TARGET = $(TARGETDIR)/genie DEFINES += -D_DEBUG -DLUA_COMPAT_MODULE -DLUA_USE_MACOSX INCLUDES += -I../../src/host/lua-5.2.3/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) $(ALL_CFLAGS) + ALL_CXXFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g -mmacosx-version-min=10.4 + ALL_OBJCFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g -mmacosx-version-min=10.4 ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) ALL_LDFLAGS += $(LDFLAGS) -L. -mmacosx-version-min=10.4 LDDEPS += LIBS += $(LDDEPS) -framework CoreServices LINKCMD = $(CC) -o $(TARGET) $(OBJECTS) $(RESOURCES) $(ARCH) $(ALL_LDFLAGS) $(LIBS) OBJECTS := \ - $(OBJDIR)/src/host/os_isfile.o \ + $(OBJDIR)/src/host/os_getcwd.o \ $(OBJDIR)/src/host/os_stat.o \ - $(OBJDIR)/src/host/os_rmdir.o \ - $(OBJDIR)/src/host/os_copyfile.o \ - $(OBJDIR)/src/host/string_hash.o \ $(OBJDIR)/src/host/os_chdir.o \ - $(OBJDIR)/src/host/os_is64bit.o \ - $(OBJDIR)/src/host/os_match.o \ + $(OBJDIR)/src/host/premake_main.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_mkdir.o \ $(OBJDIR)/src/host/os_getversion.o \ - $(OBJDIR)/src/host/premake_main.o \ - $(OBJDIR)/src/host/path_isabsolute.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_uuid.o \ - $(OBJDIR)/src/host/os_pathsearch.o \ - $(OBJDIR)/src/host/os_getcwd.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lbaselib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lvm.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lcorolib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ltablib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lobject.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lcode.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ldo.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/liolib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ltable.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/loadlib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lundump.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/loslib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lfunc.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/linit.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lstate.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/llex.o \ + $(OBJDIR)/src/host/os_mkdir.o \ + $(OBJDIR)/src/host/path_isabsolute.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/lmathlib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lauxlib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lopcodes.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/lapi.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ldblib.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/lgc.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ltm.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/lctype.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 \ define PREBUILDCMDS @@ -190,68 +192,69 @@ endif ifeq ($(config),releaseuniv32) OBJDIR = obj/Universal32/Release TARGETDIR = ../../bin/darwin - TARGET = $(TARGETDIR)/genie + override TARGET = $(TARGETDIR)/genie DEFINES += -DNDEBUG -DLUA_COMPAT_MODULE -DLUA_USE_MACOSX INCLUDES += -I../../src/host/lua-5.2.3/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) $(ALL_CFLAGS) + ALL_CXXFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os -arch i386 -arch ppc -mmacosx-version-min=10.4 + ALL_OBJCFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os -arch i386 -arch ppc -mmacosx-version-min=10.4 ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) ALL_LDFLAGS += $(LDFLAGS) -L. -Wl,-x -arch i386 -arch ppc -mmacosx-version-min=10.4 LDDEPS += LIBS += $(LDDEPS) -framework CoreServices LINKCMD = $(CC) -o $(TARGET) $(OBJECTS) $(RESOURCES) $(ARCH) $(ALL_LDFLAGS) $(LIBS) OBJECTS := \ - $(OBJDIR)/src/host/os_isfile.o \ + $(OBJDIR)/src/host/os_getcwd.o \ $(OBJDIR)/src/host/os_stat.o \ - $(OBJDIR)/src/host/os_rmdir.o \ - $(OBJDIR)/src/host/os_copyfile.o \ - $(OBJDIR)/src/host/string_hash.o \ $(OBJDIR)/src/host/os_chdir.o \ - $(OBJDIR)/src/host/os_is64bit.o \ - $(OBJDIR)/src/host/os_match.o \ + $(OBJDIR)/src/host/premake_main.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_mkdir.o \ $(OBJDIR)/src/host/os_getversion.o \ - $(OBJDIR)/src/host/premake_main.o \ - $(OBJDIR)/src/host/path_isabsolute.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_uuid.o \ - $(OBJDIR)/src/host/os_pathsearch.o \ - $(OBJDIR)/src/host/os_getcwd.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lbaselib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lvm.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lcorolib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ltablib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lobject.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lcode.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ldo.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/liolib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ltable.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/loadlib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lundump.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/loslib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lfunc.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/linit.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lstate.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/llex.o \ + $(OBJDIR)/src/host/os_mkdir.o \ + $(OBJDIR)/src/host/path_isabsolute.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/lmathlib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lauxlib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lopcodes.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/lapi.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ldblib.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/lgc.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ltm.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/lctype.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 \ define PREBUILDCMDS @@ -265,68 +268,69 @@ endif ifeq ($(config),debuguniv32) OBJDIR = obj/Universal32/Debug TARGETDIR = ../../bin/darwin - TARGET = $(TARGETDIR)/genie + override TARGET = $(TARGETDIR)/genie DEFINES += -D_DEBUG -DLUA_COMPAT_MODULE -DLUA_USE_MACOSX INCLUDES += -I../../src/host/lua-5.2.3/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) $(ALL_CFLAGS) + ALL_CXXFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g -arch i386 -arch ppc -mmacosx-version-min=10.4 + ALL_OBJCFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g -arch i386 -arch ppc -mmacosx-version-min=10.4 ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) ALL_LDFLAGS += $(LDFLAGS) -L. -arch i386 -arch ppc -mmacosx-version-min=10.4 LDDEPS += LIBS += $(LDDEPS) -framework CoreServices LINKCMD = $(CC) -o $(TARGET) $(OBJECTS) $(RESOURCES) $(ARCH) $(ALL_LDFLAGS) $(LIBS) OBJECTS := \ - $(OBJDIR)/src/host/os_isfile.o \ + $(OBJDIR)/src/host/os_getcwd.o \ $(OBJDIR)/src/host/os_stat.o \ - $(OBJDIR)/src/host/os_rmdir.o \ - $(OBJDIR)/src/host/os_copyfile.o \ - $(OBJDIR)/src/host/string_hash.o \ $(OBJDIR)/src/host/os_chdir.o \ - $(OBJDIR)/src/host/os_is64bit.o \ - $(OBJDIR)/src/host/os_match.o \ + $(OBJDIR)/src/host/premake_main.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_mkdir.o \ $(OBJDIR)/src/host/os_getversion.o \ - $(OBJDIR)/src/host/premake_main.o \ - $(OBJDIR)/src/host/path_isabsolute.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_uuid.o \ - $(OBJDIR)/src/host/os_pathsearch.o \ - $(OBJDIR)/src/host/os_getcwd.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lbaselib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lvm.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lcorolib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ltablib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lobject.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lcode.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ldo.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/liolib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ltable.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/loadlib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lundump.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/loslib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lfunc.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/linit.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lstate.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/llex.o \ + $(OBJDIR)/src/host/os_mkdir.o \ + $(OBJDIR)/src/host/path_isabsolute.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/lmathlib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lauxlib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lopcodes.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/lapi.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ldblib.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/lgc.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ltm.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/lctype.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 \ define PREBUILDCMDS @@ -360,9 +364,7 @@ $(TARGETDIR): $(OBJDIRS): @echo Creating $(OBJDIR) - -$(call MKDIR,$(OBJDIR)) - -$(call MKDIR,$(OBJDIR)/src/host) - -$(call MKDIR,$(OBJDIR)/src/host/lua-5.2.3/src) + -$(call MKDIR,$@) clean: @echo Cleaning genie @@ -386,7 +388,7 @@ $(GCH): $(PCH) $(SILENT) $(CC) -x c-header $(ALL_CFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) -o "$@" -MF "$(@:%.gch=%.d)" -c "$<" endif -$(OBJDIR)/src/host/os_isfile.o: ../../src/host/os_isfile.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 "$<" @@ -394,27 +396,23 @@ $(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_rmdir.o: ../../src/host/os_rmdir.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 - @echo $(notdir $<) - $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -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_chdir.o: ../../src/host/os_chdir.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/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_match.o: ../../src/host/os_match.c +$(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 + @echo $(notdir $<) + $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -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 "$<" @@ -426,19 +424,23 @@ $(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_mkdir.o: ../../src/host/os_mkdir.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/premake_main.o: ../../src/host/premake_main.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/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_rmdir.o: ../../src/host/os_rmdir.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 @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" @@ -450,79 +452,15 @@ $(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/os_uuid.o: ../../src/host/os_uuid.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 "$<" -$(OBJDIR)/src/host/os_pathsearch.o: ../../src/host/os_pathsearch.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 "$<" -$(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/lua-5.2.3/src/lbaselib.o: ../../src/host/lua-5.2.3/src/lbaselib.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 - @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 - @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 - @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 - @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 - @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 - @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 - @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 - @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 - @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 - @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 - @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 - @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 - @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 - @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/os_is64bit.o: ../../src/host/os_is64bit.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" @@ -530,19 +468,23 @@ $(OBJDIR)/src/host/lua-5.2.3/src/ldump.o: ../../src/host/lua-5.2.3/src/ldump.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 + @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 + @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 @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.2.3/src/liolib.o: ../../src/host/lua-5.2.3/src/liolib.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 - @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.2.3/src/lcode.o: ../../src/host/lua-5.2.3/src/lcode.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" @@ -550,11 +492,7 @@ $(OBJDIR)/src/host/lua-5.2.3/src/lparser.o: ../../src/host/lua-5.2.3/src/lparser @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 - @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.2.3/src/loadlib.o: ../../src/host/lua-5.2.3/src/loadlib.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" @@ -562,23 +500,27 @@ $(OBJDIR)/src/host/lua-5.2.3/src/lbitlib.o: ../../src/host/lua-5.2.3/src/lbitlib @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 - @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 - @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 @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 + @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 + @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 + @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 @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.2.3/src/lgc.o: ../../src/host/lua-5.2.3/src/lgc.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" @@ -586,6 +528,66 @@ $(OBJDIR)/src/host/lua-5.2.3/src/lstring.o: ../../src/host/lua-5.2.3/src/lstring @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 + @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 + @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 + @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 + @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 + @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 + @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 + @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 + @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 + @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 + @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 + @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 + @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 + @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 + @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 + @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 @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 bc4c40cda53..ee290792707 100644 --- a/3rdparty/genie/build/gmake.linux/genie.make +++ b/3rdparty/genie/build/gmake.linux/genie.make @@ -3,8 +3,6 @@ ifndef config config=release endif -override undefine TARGET - ifndef verbose SILENT = @ endif @@ -20,9 +18,11 @@ endif ifeq (posix,$(SHELLTYPE)) MKDIR = $(SILENT) mkdir -p "$(1)" COPY = $(SILENT) cp -fR "$(1)" "$(2)" + RM= $(SILENT) rm -f "$(1)" else MKDIR = $(SILENT) mkdir "$(subst /,\\,$(1))" 2> nul || exit 0 COPY = $(SILENT) copy /Y "$(subst /,\\,$(1))" "$(subst /,\\,$(2))" + RM = $(SILENT) del /F "$(subst /,\\,$(1))" 2> nul || exit 0 endif CC = gcc @@ -40,68 +40,69 @@ endif ifeq ($(config),release) OBJDIR = obj/Release TARGETDIR = ../../bin/linux - TARGET = $(TARGETDIR)/genie + override TARGET = $(TARGETDIR)/genie DEFINES += -DNDEBUG -DLUA_COMPAT_MODULE -DLUA_USE_POSIX -DLUA_USE_DLOPEN INCLUDES += -I../../src/host/lua-5.2.3/src ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os - ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CFLAGS) + ALL_CXXFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os + ALL_OBJCFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) ALL_LDFLAGS += $(LDFLAGS) -L. -s -rdynamic LDDEPS += LIBS += $(LDDEPS) -ldl -lm LINKCMD = $(CC) -o $(TARGET) $(OBJECTS) $(RESOURCES) $(ARCH) $(ALL_LDFLAGS) $(LIBS) OBJECTS := \ - $(OBJDIR)/src/host/os_isfile.o \ + $(OBJDIR)/src/host/os_getcwd.o \ $(OBJDIR)/src/host/os_stat.o \ - $(OBJDIR)/src/host/os_rmdir.o \ - $(OBJDIR)/src/host/os_copyfile.o \ - $(OBJDIR)/src/host/string_hash.o \ $(OBJDIR)/src/host/os_chdir.o \ - $(OBJDIR)/src/host/os_is64bit.o \ - $(OBJDIR)/src/host/os_match.o \ + $(OBJDIR)/src/host/premake_main.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_mkdir.o \ $(OBJDIR)/src/host/os_getversion.o \ - $(OBJDIR)/src/host/premake_main.o \ - $(OBJDIR)/src/host/path_isabsolute.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_uuid.o \ - $(OBJDIR)/src/host/os_pathsearch.o \ - $(OBJDIR)/src/host/os_getcwd.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lbaselib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lvm.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lcorolib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ltablib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lobject.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lcode.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ldo.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/liolib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ltable.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/loadlib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lundump.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/loslib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lfunc.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/linit.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lstate.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/llex.o \ + $(OBJDIR)/src/host/os_mkdir.o \ + $(OBJDIR)/src/host/path_isabsolute.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/lmathlib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lauxlib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lopcodes.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/lapi.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ldblib.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/lgc.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ltm.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/lctype.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 \ define PREBUILDCMDS @@ -115,68 +116,69 @@ endif ifeq ($(config),debug) OBJDIR = obj/Debug TARGETDIR = ../../bin/linux - TARGET = $(TARGETDIR)/genie + 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 ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g - ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CFLAGS) + ALL_CXXFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g + ALL_OBJCFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) ALL_LDFLAGS += $(LDFLAGS) -L. -rdynamic LDDEPS += LIBS += $(LDDEPS) -ldl -lm LINKCMD = $(CC) -o $(TARGET) $(OBJECTS) $(RESOURCES) $(ARCH) $(ALL_LDFLAGS) $(LIBS) OBJECTS := \ - $(OBJDIR)/src/host/os_isfile.o \ + $(OBJDIR)/src/host/os_getcwd.o \ $(OBJDIR)/src/host/os_stat.o \ - $(OBJDIR)/src/host/os_rmdir.o \ - $(OBJDIR)/src/host/os_copyfile.o \ - $(OBJDIR)/src/host/string_hash.o \ $(OBJDIR)/src/host/os_chdir.o \ - $(OBJDIR)/src/host/os_is64bit.o \ - $(OBJDIR)/src/host/os_match.o \ + $(OBJDIR)/src/host/premake_main.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_mkdir.o \ $(OBJDIR)/src/host/os_getversion.o \ - $(OBJDIR)/src/host/premake_main.o \ - $(OBJDIR)/src/host/path_isabsolute.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_uuid.o \ - $(OBJDIR)/src/host/os_pathsearch.o \ - $(OBJDIR)/src/host/os_getcwd.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lbaselib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lvm.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lcorolib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ltablib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lobject.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lcode.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ldo.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/liolib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ltable.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/loadlib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lundump.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/loslib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lfunc.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/linit.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lstate.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/llex.o \ + $(OBJDIR)/src/host/os_mkdir.o \ + $(OBJDIR)/src/host/path_isabsolute.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/lmathlib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lauxlib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lopcodes.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/lapi.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ldblib.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/lgc.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ltm.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/lctype.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 \ define PREBUILDCMDS @@ -189,8 +191,8 @@ endif OBJDIRS := \ $(OBJDIR) \ - $(OBJDIR)/src/host \ $(OBJDIR)/src/host/lua-5.2.3/src \ + $(OBJDIR)/src/host \ RESOURCES := \ @@ -210,9 +212,7 @@ $(TARGETDIR): $(OBJDIRS): @echo Creating $(OBJDIR) - -$(call MKDIR,$(OBJDIR)) - -$(call MKDIR,$(OBJDIR)/src/host) - -$(call MKDIR,$(OBJDIR)/src/host/lua-5.2.3/src) + -$(call MKDIR,$@) clean: @echo Cleaning genie @@ -236,7 +236,7 @@ $(GCH): $(PCH) $(SILENT) $(CC) -x c-header $(ALL_CFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) -o "$@" -MF "$(@:%.gch=%.d)" -c "$<" endif -$(OBJDIR)/src/host/os_isfile.o: ../../src/host/os_isfile.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 "$<" @@ -244,27 +244,23 @@ $(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_rmdir.o: ../../src/host/os_rmdir.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 - @echo $(notdir $<) - $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -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_chdir.o: ../../src/host/os_chdir.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/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_match.o: ../../src/host/os_match.c +$(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 + @echo $(notdir $<) + $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -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 "$<" @@ -276,19 +272,23 @@ $(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_mkdir.o: ../../src/host/os_mkdir.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/premake_main.o: ../../src/host/premake_main.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/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_rmdir.o: ../../src/host/os_rmdir.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 @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" @@ -300,79 +300,15 @@ $(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/os_uuid.o: ../../src/host/os_uuid.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 "$<" -$(OBJDIR)/src/host/os_pathsearch.o: ../../src/host/os_pathsearch.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 "$<" -$(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/lua-5.2.3/src/lbaselib.o: ../../src/host/lua-5.2.3/src/lbaselib.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 - @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 - @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 - @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 - @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 - @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 - @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 - @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 - @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 - @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 - @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 - @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 - @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 - @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 - @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/os_is64bit.o: ../../src/host/os_is64bit.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" @@ -380,19 +316,23 @@ $(OBJDIR)/src/host/lua-5.2.3/src/ldump.o: ../../src/host/lua-5.2.3/src/ldump.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 + @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 + @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 @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.2.3/src/liolib.o: ../../src/host/lua-5.2.3/src/liolib.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 - @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.2.3/src/lcode.o: ../../src/host/lua-5.2.3/src/lcode.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" @@ -400,11 +340,7 @@ $(OBJDIR)/src/host/lua-5.2.3/src/lparser.o: ../../src/host/lua-5.2.3/src/lparser @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 - @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.2.3/src/loadlib.o: ../../src/host/lua-5.2.3/src/loadlib.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" @@ -412,23 +348,27 @@ $(OBJDIR)/src/host/lua-5.2.3/src/lbitlib.o: ../../src/host/lua-5.2.3/src/lbitlib @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 - @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 - @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 @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 + @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 + @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 + @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 @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.2.3/src/lgc.o: ../../src/host/lua-5.2.3/src/lgc.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" @@ -436,6 +376,66 @@ $(OBJDIR)/src/host/lua-5.2.3/src/lstring.o: ../../src/host/lua-5.2.3/src/lstring @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 + @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 + @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 + @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 + @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 + @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 + @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 + @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 + @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 + @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 + @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 + @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 + @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 + @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 + @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 + @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 @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 237eebc1c18..73f6d7218a3 100644 --- a/3rdparty/genie/build/gmake.windows/genie.make +++ b/3rdparty/genie/build/gmake.windows/genie.make @@ -3,8 +3,6 @@ ifndef config config=release endif -override undefine TARGET - ifndef verbose SILENT = @ endif @@ -20,9 +18,11 @@ endif ifeq (posix,$(SHELLTYPE)) MKDIR = $(SILENT) mkdir -p "$(1)" COPY = $(SILENT) cp -fR "$(1)" "$(2)" + RM= $(SILENT) rm -f "$(1)" else MKDIR = $(SILENT) mkdir "$(subst /,\\,$(1))" 2> nul || exit 0 COPY = $(SILENT) copy /Y "$(subst /,\\,$(1))" "$(subst /,\\,$(2))" + RM = $(SILENT) del /F "$(subst /,\\,$(1))" 2> nul || exit 0 endif CC = gcc @@ -40,68 +40,69 @@ endif ifeq ($(config),release) OBJDIR = obj/Release TARGETDIR = ../../bin/windows - TARGET = $(TARGETDIR)/genie.exe + override TARGET = $(TARGETDIR)/genie.exe DEFINES += -DNDEBUG -DLUA_COMPAT_MODULE INCLUDES += -I../../src/host/lua-5.2.3/src ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os - ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CFLAGS) + ALL_CXXFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os + ALL_OBJCFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) ALL_LDFLAGS += $(LDFLAGS) -L. -s LDDEPS += LIBS += $(LDDEPS) -lole32 LINKCMD = $(CC) -o $(TARGET) $(OBJECTS) $(RESOURCES) $(ARCH) $(ALL_LDFLAGS) $(LIBS) OBJECTS := \ - $(OBJDIR)/src/host/os_isfile.o \ + $(OBJDIR)/src/host/os_getcwd.o \ $(OBJDIR)/src/host/os_stat.o \ - $(OBJDIR)/src/host/os_rmdir.o \ - $(OBJDIR)/src/host/os_copyfile.o \ - $(OBJDIR)/src/host/string_hash.o \ $(OBJDIR)/src/host/os_chdir.o \ - $(OBJDIR)/src/host/os_is64bit.o \ - $(OBJDIR)/src/host/os_match.o \ + $(OBJDIR)/src/host/premake_main.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_mkdir.o \ $(OBJDIR)/src/host/os_getversion.o \ - $(OBJDIR)/src/host/premake_main.o \ - $(OBJDIR)/src/host/path_isabsolute.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_uuid.o \ - $(OBJDIR)/src/host/os_pathsearch.o \ - $(OBJDIR)/src/host/os_getcwd.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lbaselib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lvm.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lcorolib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ltablib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lobject.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lcode.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ldo.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/liolib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ltable.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/loadlib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lundump.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/loslib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lfunc.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/linit.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lstate.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/llex.o \ + $(OBJDIR)/src/host/os_mkdir.o \ + $(OBJDIR)/src/host/path_isabsolute.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/lmathlib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lauxlib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lopcodes.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/lapi.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ldblib.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/lgc.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ltm.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/lctype.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 \ define PREBUILDCMDS @@ -115,68 +116,69 @@ endif ifeq ($(config),debug) OBJDIR = obj/Debug TARGETDIR = ../../bin/windows - TARGET = $(TARGETDIR)/genie.exe + override TARGET = $(TARGETDIR)/genie.exe DEFINES += -D_DEBUG -DLUA_COMPAT_MODULE INCLUDES += -I../../src/host/lua-5.2.3/src ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g - ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CFLAGS) + ALL_CXXFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g + ALL_OBJCFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) ALL_LDFLAGS += $(LDFLAGS) -L. LDDEPS += LIBS += $(LDDEPS) -lole32 LINKCMD = $(CC) -o $(TARGET) $(OBJECTS) $(RESOURCES) $(ARCH) $(ALL_LDFLAGS) $(LIBS) OBJECTS := \ - $(OBJDIR)/src/host/os_isfile.o \ + $(OBJDIR)/src/host/os_getcwd.o \ $(OBJDIR)/src/host/os_stat.o \ - $(OBJDIR)/src/host/os_rmdir.o \ - $(OBJDIR)/src/host/os_copyfile.o \ - $(OBJDIR)/src/host/string_hash.o \ $(OBJDIR)/src/host/os_chdir.o \ - $(OBJDIR)/src/host/os_is64bit.o \ - $(OBJDIR)/src/host/os_match.o \ + $(OBJDIR)/src/host/premake_main.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_mkdir.o \ $(OBJDIR)/src/host/os_getversion.o \ - $(OBJDIR)/src/host/premake_main.o \ - $(OBJDIR)/src/host/path_isabsolute.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_uuid.o \ - $(OBJDIR)/src/host/os_pathsearch.o \ - $(OBJDIR)/src/host/os_getcwd.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lbaselib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lvm.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lcorolib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ltablib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lobject.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lcode.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ldo.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/liolib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ltable.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/loadlib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lundump.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/loslib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lfunc.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/linit.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lstate.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/llex.o \ + $(OBJDIR)/src/host/os_mkdir.o \ + $(OBJDIR)/src/host/path_isabsolute.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/lmathlib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lauxlib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lopcodes.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/lapi.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ldblib.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/lgc.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ltm.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/lctype.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 \ define PREBUILDCMDS @@ -189,8 +191,8 @@ endif OBJDIRS := \ $(OBJDIR) \ - $(OBJDIR)/src/host/lua-5.2.3/src \ $(OBJDIR)/src/host \ + $(OBJDIR)/src/host/lua-5.2.3/src \ RESOURCES := \ @@ -210,9 +212,7 @@ $(TARGETDIR): $(OBJDIRS): @echo Creating $(OBJDIR) - -$(call MKDIR,$(OBJDIR)) - -$(call MKDIR,$(OBJDIR)/src/host/lua-5.2.3/src) - -$(call MKDIR,$(OBJDIR)/src/host) + -$(call MKDIR,$@) clean: @echo Cleaning genie @@ -236,7 +236,7 @@ $(GCH): $(PCH) $(SILENT) $(CC) -x c-header $(ALL_CFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) -o "$@" -MF "$(@:%.gch=%.d)" -c "$<" endif -$(OBJDIR)/src/host/os_isfile.o: ../../src/host/os_isfile.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 "$<" @@ -244,27 +244,23 @@ $(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_rmdir.o: ../../src/host/os_rmdir.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 - @echo $(notdir $<) - $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -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_chdir.o: ../../src/host/os_chdir.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/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_match.o: ../../src/host/os_match.c +$(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 + @echo $(notdir $<) + $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -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 "$<" @@ -276,19 +272,23 @@ $(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_mkdir.o: ../../src/host/os_mkdir.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/premake_main.o: ../../src/host/premake_main.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/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_rmdir.o: ../../src/host/os_rmdir.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 @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" @@ -300,79 +300,15 @@ $(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/os_uuid.o: ../../src/host/os_uuid.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 "$<" -$(OBJDIR)/src/host/os_pathsearch.o: ../../src/host/os_pathsearch.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 "$<" -$(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/lua-5.2.3/src/lbaselib.o: ../../src/host/lua-5.2.3/src/lbaselib.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 - @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 - @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 - @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 - @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 - @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 - @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 - @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 - @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 - @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 - @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 - @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 - @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 - @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 - @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/os_is64bit.o: ../../src/host/os_is64bit.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" @@ -380,19 +316,23 @@ $(OBJDIR)/src/host/lua-5.2.3/src/ldump.o: ../../src/host/lua-5.2.3/src/ldump.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 + @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 + @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 @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.2.3/src/liolib.o: ../../src/host/lua-5.2.3/src/liolib.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 - @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.2.3/src/lcode.o: ../../src/host/lua-5.2.3/src/lcode.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" @@ -400,11 +340,7 @@ $(OBJDIR)/src/host/lua-5.2.3/src/lparser.o: ../../src/host/lua-5.2.3/src/lparser @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 - @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.2.3/src/loadlib.o: ../../src/host/lua-5.2.3/src/loadlib.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" @@ -412,23 +348,27 @@ $(OBJDIR)/src/host/lua-5.2.3/src/lbitlib.o: ../../src/host/lua-5.2.3/src/lbitlib @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 - @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 - @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 @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 + @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 + @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 + @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 @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.2.3/src/lgc.o: ../../src/host/lua-5.2.3/src/lgc.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" @@ -436,6 +376,66 @@ $(OBJDIR)/src/host/lua-5.2.3/src/lstring.o: ../../src/host/lua-5.2.3/src/lstring @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 + @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 + @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 + @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 + @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 + @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 + @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 + @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 + @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 + @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 + @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 + @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 + @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 + @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 + @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 + @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 @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" diff --git a/3rdparty/genie/makefile b/3rdparty/genie/makefile index c3caf34e9af..e1219351156 100644 --- a/3rdparty/genie/makefile +++ b/3rdparty/genie/makefile @@ -41,7 +41,12 @@ release-linux: $(GENIE) $(SILENT) $(GENIE) release $(SILENT) make -C build/gmake.darwin clean all CC=x86_64-apple-darwin13-clang++ $(SILENT) make -C build/gmake.linux clean all - $(SILENT) make -C build/gmake.windows clean all CC=x86_64-w64-mingw32-gcc + $(SILENT) make -C build/gmake.windows clean all CC=i686-w64-mingw32-gcc $(SILENT) git checkout src/host/version.h release: release-$(OS) + +dist: release + cp bin/linux/genie ../bx/tools/bin/linux/ + cp bin/windows/genie.exe ../bx/tools/bin/windows/ + cp bin/darwin/genie ../bx/tools/bin/darwin/ diff --git a/3rdparty/genie/scripts/genie.lua b/3rdparty/genie/scripts/genie.lua index 24fe8313c58..fbf273030b9 100644 --- a/3rdparty/genie/scripts/genie.lua +++ b/3rdparty/genie/scripts/genie.lua @@ -7,8 +7,8 @@ -- default when folks build using the makefile. That way they don't have to -- worry about the /scripts argument and all that. -- - premake.make.undefine = { "TARGET" } - + premake.make.override = { "TARGET" } + solution "genie" configurations { "Release", @@ -33,15 +33,15 @@ "../**.lua", "../src/**.h", "../src/**.c", - "../src/host/scripts.c" + "../src/host/scripts.c", } - excludes { + removefiles { "../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.2.3/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 d4f5c3b351a..cff6ddebe86 100644 --- a/3rdparty/genie/src/actions/make/make_cpp.lua +++ b/3rdparty/genie/src/actions/make/make_cpp.lua @@ -5,7 +5,7 @@ -- premake.make.cpp = { } - premake.make.undefine = { } + premake.make.override = { } local cpp = premake.make.cpp local make = premake.make @@ -89,8 +89,10 @@ if (not prj.options.ArchiveSplit) then _p('\t$(SILENT) $(LINKCMD) $(OBJECTS)') else + _p('\t$(call RM,$(TARGET))') _p('\t@$(call max_args,$(LINKCMD),'.. prj.archivesplit_size ..',$(OBJECTS))') - end + _p('\t$(SILENT) $(LINKCMD_NDX)') + end else if prj.msglinking then _p('\t@echo ' .. prj.msglinking) @@ -111,10 +113,7 @@ if (not prj.solution.messageskip) or (not table.contains(prj.solution.messageskip, "SkipCreatingMessage")) then _p('\t@echo Creating $(OBJDIR)') end - _p('\t-$(call MKDIR,$(OBJDIR))') - for dir, _ in pairs(objdirs) do - _p('\t-$(call MKDIR,$(OBJDIR)/%s)', dir) - end + _p('\t-$(call MKDIR,$@)') _p('') -- Mac OS X specific targets @@ -174,10 +173,7 @@ _p(' config=%s', _MAKE.esc(premake.getconfigname(prj.solution.configurations[1], platforms[1], true))) _p('endif') _p('') - for _, variable in ipairs(premake.make.undefine) do - _p('override undefine '.. variable) - end - _p('') + _p('ifndef verbose') _p(' SILENT = @') _p('endif') @@ -196,9 +192,11 @@ _p('ifeq (posix,$(SHELLTYPE))') _p(' MKDIR = $(SILENT) mkdir -p "$(1)"') _p(' COPY = $(SILENT) cp -fR "$(1)" "$(2)"') + _p(' RM = $(SILENT) rm -f "$(1)"') _p('else') _p(' MKDIR = $(SILENT) mkdir "$(subst /,\\\\,$(1))" 2> nul || exit 0') _p(' COPY = $(SILENT) copy /Y "$(subst /,\\\\,$(1))" "$(subst /,\\\\,$(2))"') + _p(' RM = $(SILENT) del /F "$(subst /,\\\\,$(1))" 2> nul || exit 0') _p('endif') _p('') @@ -228,9 +226,9 @@ -- if this platform requires a special compiler or linker, list it here cpp.platformtools(cfg, cc) - _p(' OBJDIR = %s', _MAKE.esc(cfg.objectsdir)) - _p(' TARGETDIR = %s', _MAKE.esc(cfg.buildtarget.directory)) - _p(' TARGET = $(TARGETDIR)/%s', _MAKE.esc(cfg.buildtarget.name)) + _p(' ' .. (table.contains(premake.make.override,"OBJDIR") and "override " or "") .. 'OBJDIR = %s', _MAKE.esc(cfg.objectsdir)) + _p(' ' .. (table.contains(premake.make.override,"TARGETDIR") and "override " or "") .. 'TARGETDIR = %s', _MAKE.esc(cfg.buildtarget.directory)) + _p(' ' .. (table.contains(premake.make.override,"TARGET") and "override " or "") .. 'TARGET = $(TARGETDIR)/%s', _MAKE.esc(cfg.buildtarget.name)) _p(' DEFINES +=%s', make.list(cc.getdefines(cfg.defines))) _p(' INCLUDES +=%s', make.list(cc.getincludedirs(cfg.includedirs))) @@ -241,7 +239,7 @@ cpp.flags(cfg, cc) -- write out libraries, linker flags, and the link command - cpp.linker(cfg, cc) + cpp.linker(prj, cfg, cc) -- add objects for compilation, and remove any that are excluded per config. _p(' OBJECTS := \\') @@ -329,8 +327,8 @@ _p(' ALL_CPPFLAGS += $(CPPFLAGS) %s $(DEFINES) $(INCLUDES)', table.concat(cc.getcppflags(cfg), " ")) _p(' ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH)%s', make.list(table.join(cc.getcflags(cfg), cfg.buildoptions, cfg.buildoptions_c))) - _p(' ALL_CXXFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH)%s', make.list(table.join(cc.getcxxflags(cfg), cfg.buildoptions, cfg.buildoptions_cpp))) - _p(' ALL_OBJCFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH)%s', make.list(table.join(cc.getcxxflags(cfg), cfg.buildoptions, cfg.buildoptions_objc))) + _p(' ALL_CXXFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH)%s', make.list(table.join(cc.getcflags(cfg), cc.getcxxflags(cfg), cfg.buildoptions, cfg.buildoptions_cpp))) + _p(' ALL_OBJCFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH)%s', make.list(table.join(cc.getcflags(cfg), cc.getcxxflags(cfg), cfg.buildoptions, cfg.buildoptions_objc))) _p(' ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES)%s', make.list(table.join(cc.getdefines(cfg.resdefines), @@ -343,7 +341,7 @@ -- and the linker command. -- - function cpp.linker(cfg, cc) + function cpp.linker(prj, cfg, cc) -- Patch #3401184 changed the order _p(' ALL_LDFLAGS += $(LDFLAGS)%s', make.list(table.join(cc.getlibdirflags(cfg), cc.getldflags(cfg), cfg.linkoptions))) @@ -354,10 +352,20 @@ if cfg.platform:startswith("Universal") then _p(' LINKCMD = libtool -o $(TARGET)') else - if cc.llvm then - _p(' LINKCMD = $(AR) rcs $(TARGET)') + if (not prj.options.ArchiveSplit) then + if cc.llvm then + _p(' LINKCMD = $(AR) rcs $(TARGET)') + else + _p(' LINKCMD = $(AR) -rcs $(TARGET)') + end else - _p(' LINKCMD = $(AR) -rcs $(TARGET)') + if cc.llvm then + _p(' LINKCMD = $(AR) qc $(TARGET)') + _p(' LINKCMD_NDX= $(AR) cs $(TARGET)') + else + _p(' LINKCMD = $(AR) -qc $(TARGET)') + _p(' LINKCMD_NDX= $(AR) -cs $(TARGET)') + end end end else diff --git a/3rdparty/genie/src/actions/vstudio/_vstudio.lua b/3rdparty/genie/src/actions/vstudio/_vstudio.lua index ab82613c3d9..22fdb9f99f8 100644 --- a/3rdparty/genie/src/actions/vstudio/_vstudio.lua +++ b/3rdparty/genie/src/actions/vstudio/_vstudio.lua @@ -11,7 +11,7 @@ -- local toolsets = { - vs2010 = "v90", + vs2010 = "v100", vs2012 = "v110", vs2013 = "v120", vs2015 = "v140" diff --git a/3rdparty/genie/src/actions/vstudio/vs2010_vcxproj.lua b/3rdparty/genie/src/actions/vstudio/vs2010_vcxproj.lua index 62e66924bcc..c5ee17d841c 100644 --- a/3rdparty/genie/src/actions/vstudio/vs2010_vcxproj.lua +++ b/3rdparty/genie/src/actions/vstudio/vs2010_vcxproj.lua @@ -262,20 +262,20 @@ local function compile_language(cfg) if cfg.options.ForceCPP then - _p(3,'CompileAsCpp') + _p(3,'CompileAsCpp') else if cfg.language == "C" then _p(3,'CompileAsC') end end end - + local function forcedinclude_files(indent,cfg) if #cfg.forcedincludes > 0 then _p(indent,'%s' ,premake.esc(path.translate(table.concat(cfg.forcedincludes, ";"), '\\'))) end - end + end local function vs10_clcompile(cfg) _p(2,'') @@ -343,7 +343,7 @@ end compile_language(cfg) - + forcedinclude_files(3,cfg); _p(2,'') end @@ -484,6 +484,15 @@ + function exists(table, fine) + for _, value in ipairs(table) do + if value == find then return true end + end + + return false + end + + -- -- Retrieve a list of files for a particular build group, one of -- "ClInclude", "ClCompile", "ResourceCompile", and "None". @@ -505,7 +514,9 @@ if path.iscppfile(file.name) then table.insert(sortedfiles.ClCompile, file) elseif path.iscppheader(file.name) then - table.insert(sortedfiles.ClInclude, file) + if not exists(prj.removefiles, file) then + table.insert(sortedfiles.ClInclude, file) + end elseif path.isresourcefile(file.name) then table.insert(sortedfiles.ResourceCompile, file) else @@ -594,13 +605,36 @@ end end - -- 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 + -- 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, 'true' + , premake.esc(vsconfig.name) + ) + end + excluded = true + break + end + end - if exclude == file.name then - _p(3, 'true', premake.esc(vsconfig.name)) + 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, 'true' + , premake.esc(vsconfig.name) + ) + end end end end @@ -739,7 +773,7 @@ io.eol = "\r\n" _p('') _p('') - + _p(1,'') @@ -777,4 +811,4 @@ _p(1,'') _p('') - end \ No newline at end of file + end diff --git a/3rdparty/genie/src/base/api.lua b/3rdparty/genie/src/base/api.lua index 86665e4f928..9a3a26d0c43 100644 --- a/3rdparty/genie/src/base/api.lua +++ b/3rdparty/genie/src/base/api.lua @@ -17,7 +17,7 @@ kind = "string", scope = "config", }, - + basedir = { kind = "path", @@ -47,19 +47,19 @@ kind = "list", scope = "config", }, - + buildoptions_cpp = { kind = "list", scope = "config", }, - + buildoptions_objc = { kind = "list", scope = "config", }, - + configurations = { kind = "list", @@ -109,6 +109,12 @@ scope = "config", }, + removefiles = + { + kind = "filelist", + scope = "config", + }, + flags = { kind = "list", @@ -189,7 +195,7 @@ } }, - forcedincludes = + forcedincludes = { kind = "absolutefilelist", scope = "config", @@ -305,7 +311,7 @@ kind = "list", scope = "config", }, - + messageskip = { @@ -335,31 +341,31 @@ { kind = "string", scope = "config", - }, + }, msgcompile = { kind = "string", scope = "config", - }, + }, msgcompile_objc = { kind = "string", scope = "config", - }, - + }, + msgresource = { kind = "string", scope = "config", - }, + }, msglinking = { kind = "string", scope = "config", - }, + }, objdir = { @@ -536,7 +542,7 @@ premake.check_paths = false - + -- -- Check to see if a value exists in a list of values, using a -- case-insensitive match. If the value does exist, the canonical @@ -640,7 +646,7 @@ if value then add(value, 5) end - + return obj[fieldname] end @@ -664,7 +670,7 @@ if value:find("*") then local arr = matchfunc(value); if (premake.check_paths) and (#arr == 0) then - error("Can't find matching files for pattern :" .. value) + error("Can't find matching files for pattern :" .. value) end makeabsolute(arr, depth + 1) else @@ -770,7 +776,7 @@ end end - -- find the container for the value + -- find the container for the value local container, err = premake.getobject(scope) if (not container) then error(err, 3) @@ -804,10 +810,10 @@ end -- list value types get a remove() call too - if info.kind == "list" or - info.kind == "dirlist" or + if info.kind == "list" or + info.kind == "dirlist" or info.kind == "filelist" or - info.kind == "absolutefilelist" + info.kind == "absolutefilelist" then _G["remove"..name] = function(value) premake.remove(name, value) @@ -895,7 +901,7 @@ -- the path to create groups from (i.e. "Examples/Simple") -- @param sln -- the solution to add the groups to --- @returns +-- @returns -- the group object for the deepest folder -- @@ -960,7 +966,7 @@ prj.basedir = os.getcwd() prj.uuid = os.uuid(prj.name) prj.blocks = { } - prj.usage = isUsage + prj.usage = isUsage prj.group = group return prj; @@ -985,46 +991,46 @@ error("no active solution", 2) end - -- if this is a new project, or the project in that slot doesn't have a usage, create it - if((not sln.projects[name]) or - ((not sln.projects[name].usage) and (not sln.projects[name].usageProj))) then - premake.CurrentContainer = createproject(name, sln, true) - else - premake.CurrentContainer = iff(sln.projects[name].usage, - sln.projects[name], sln.projects[name].usageProj) - end - - -- add an empty, global configuration to the project - configuration { } - - return premake.CurrentContainer - end - - function project(name) - if (not name) then - --Only return non-usage projects - if(type(premake.CurrentContainer) ~= "project") then return nil end - if(premake.CurrentContainer.usage) then return nil end - return premake.CurrentContainer + -- if this is a new project, or the project in that slot doesn't have a usage, create it + if((not sln.projects[name]) or + ((not sln.projects[name].usage) and (not sln.projects[name].usageProj))) then + premake.CurrentContainer = createproject(name, sln, true) + else + premake.CurrentContainer = iff(sln.projects[name].usage, + sln.projects[name], sln.projects[name].usageProj) end - -- identify the parent solution - local sln - if (type(premake.CurrentContainer) == "project") then - sln = premake.CurrentContainer.solution - else - sln = premake.CurrentContainer - end - if (type(sln) ~= "solution") then - error("no active solution", 2) - end + -- add an empty, global configuration to the project + configuration { } - -- if this is a new project, or the old project is a usage project, create it - if((not sln.projects[name]) or sln.projects[name].usage) then - premake.CurrentContainer = createproject(name, sln) - else - premake.CurrentContainer = sln.projects[name]; - end + return premake.CurrentContainer + end + + function project(name) + if (not name) then + --Only return non-usage projects + if(type(premake.CurrentContainer) ~= "project") then return nil end + if(premake.CurrentContainer.usage) then return nil end + return premake.CurrentContainer + end + + -- identify the parent solution + local sln + if (type(premake.CurrentContainer) == "project") then + sln = premake.CurrentContainer.solution + else + sln = premake.CurrentContainer + end + if (type(sln) ~= "solution") then + error("no active solution", 2) + end + + -- if this is a new project, or the old project is a usage project, create it + if((not sln.projects[name]) or sln.projects[name].usage) then + premake.CurrentContainer = createproject(name, sln) + else + premake.CurrentContainer = sln.projects[name]; + end -- add an empty, global configuration to the project configuration { } @@ -1055,7 +1061,7 @@ function group(name) - if not name then + if not name then return premake.CurrentGroup end premake.CurrentGroup = name diff --git a/3rdparty/genie/src/base/bake.lua b/3rdparty/genie/src/base/bake.lua index 7a12e6b8528..62737fa4d19 100644 --- a/3rdparty/genie/src/base/bake.lua +++ b/3rdparty/genie/src/base/bake.lua @@ -2,8 +2,8 @@ -- base/bake.lua -- -- Takes all the configuration information provided by the project scripts --- and stored in the solution->project->block hierarchy and flattens it all --- down into one object per configuration. These objects are cached with the +-- and stored in the solution->project->block hierarchy and flattens it all +-- down into one object per configuration. These objects are cached with the -- project, and can be retrieved by calling the getconfig() or eachconfig(). -- -- Copyright (c) 2008-2011 Jason Perkins and the Premake project @@ -15,7 +15,7 @@ -- do not copy these fields into the configurations - local nocopy = + local nocopy = { blocks = true, keywords = true, @@ -25,11 +25,11 @@ -- do not cascade these fields from projects to configurations - local nocascade = + local nocascade = { makesettings = true, } - + -- leave these paths as absolute, rather than converting to project relative local keeprelative = @@ -47,7 +47,7 @@ function premake.getactiveterms() local terms = { _action = _ACTION:lower(), os = os.get() } - + -- add option keys or values for key, value in pairs(_OPTIONS) do if value ~= "" then @@ -56,15 +56,15 @@ table.insert(terms, key:lower()) end end - + return terms end - - + + -- -- Test a single configuration block keyword against a list of terms. -- The terms are a mix of key/value pairs. The keyword is tested against --- the values; on a match, the corresponding key is returned. This +-- the values; on a match, the corresponding key is returned. This -- enables testing for required values in iskeywordsmatch(), below. -- @@ -73,7 +73,7 @@ if keyword:startswith("not ") then return not premake.iskeywordmatch(keyword:sub(5), terms) end - + for _, pattern in ipairs(keyword:explode(" or ")) do for termkey, term in pairs(terms) do if term:match(pattern) == term then @@ -82,9 +82,9 @@ end end end - - - + + + -- -- Checks a set of configuration block keywords against a list of terms. -- The required flag is used by the file configurations: only blocks @@ -104,7 +104,7 @@ hasrequired = true end end - + if terms.required and not hasrequired then return false else @@ -125,15 +125,15 @@ local function adjustpaths(location, obj) function adjustpathlist(list) for i, p in ipairs(list) do - list[i] = path.getrelative(location, p) + list[i] = path.getrelative(location, p) end end - + for name, value in pairs(obj) do local field = premake.fields[name] if field and value and not keeprelative[name] then if field.kind == "path" then - obj[name] = path.getrelative(location, value) + obj[name] = path.getrelative(location, value) elseif field.kind == "dirlist" or field.kind == "filelist" then adjustpathlist(value) elseif field.kind == "keypath" then @@ -144,8 +144,8 @@ end end end - - + + -- -- Merge all of the fields from one object into another. String values are overwritten, @@ -176,21 +176,21 @@ local function removevalues(tbl, removes) for i=#tbl,1,-1 do - for _, pattern in ipairs(removes) do - if pattern == tbl[i] then - table.remove(tbl, i) - break - end - end - end + for _, pattern in ipairs(removes) do + if pattern == tbl[i] then + table.remove(tbl, i) + break + end + end + end end - + local function mergeobject(dest, src) -- if there's nothing to add, quick out - if not src then - return + if not src then + return end - + for fieldname, value in pairs(src) do if not nocopy[fieldname] then -- fields that are included in the API are merged... @@ -207,7 +207,7 @@ else dest[fieldname] = value end - + -- ...everything else is just copied as-is else dest[fieldname] = value @@ -215,8 +215,8 @@ end end end - - + + -- -- Merges the settings from a solution's or project's list of configuration blocks, @@ -245,33 +245,33 @@ if pltname ~= "Native" then key = key .. pltname end - + -- add the configuration and platform to the block filter terms terms.config = (cfgname or ""):lower() terms.platform = pltname:lower() - + -- 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) - + -- add `kind` to the filter terms - if (cfg.kind) then + if (cfg.kind) then terms['kind']=cfg.kind:lower() end - + -- now add in any blocks that match the filter terms for _, blk in ipairs(obj.blocks) do if (premake.iskeywordsmatch(blk.keywords, terms))then mergeobject(cfg, blk) - if (cfg.kind and not cfg.terms.kind) then + if (cfg.kind and not cfg.terms.kind) then cfg.terms['kind'] = cfg.kind:lower() terms['kind'] = cfg.kind:lower() end end end - + -- package it all up and add it to the result set cfg.name = cfgname cfg.platform = pltname @@ -280,9 +280,9 @@ end dest[key] = cfg end - - - + + + -- -- Collapse a solution or project object down to a canonical set of configuration settings, -- keyed by configuration block/platform pairs, and taking into account the current @@ -300,15 +300,15 @@ local function collapse(obj, basis) local result = {} basis = basis or {} - + -- find the solution, which contains the configuration and platform lists local sln = obj.solution or obj - -- build a set of configuration filter terms; only those configuration blocks + -- build a set of configuration filter terms; only those configuration blocks -- with a matching set of keywords will be included in the merged results local terms = premake.getactiveterms() - -- build a project-level configuration. + -- build a project-level configuration. merge(result, obj, basis, terms)--this adjusts terms -- now build configurations for each build config/platform pair @@ -322,7 +322,7 @@ end end end - + return result end @@ -339,12 +339,12 @@ local function builduniquedirs() local num_variations = 4 - + -- Start by listing out each possible object directory for each configuration. -- Keep a count of how many times each path gets used across the session. local cfg_dirs = {} local hit_counts = {} - + for sln in premake.solution.each() do for _, prj in ipairs(sln.projects) do for _, cfg in pairs(prj.__configs) do @@ -355,7 +355,7 @@ dirs[3] = path.join(dirs[2], cfg.name) dirs[4] = path.join(dirs[3], cfg.project.name) cfg_dirs[cfg] = dirs - + -- configurations other than the root should bias toward a more -- description path, including the platform or config name local start = iif(cfg.name, 2, 1) @@ -367,7 +367,7 @@ end end end - + -- Now assign an object directory to each configuration, skipping those -- that are in use somewhere else in the session for sln in premake.solution.each() do @@ -376,21 +376,17 @@ local dir local start = iif(cfg.name, 2, 1) - for v = start, num_variations do + for v = start, iif(cfg.flags.SingleOutputDir,num_variations-1,num_variations) do dir = cfg_dirs[cfg][v] if hit_counts[dir] == 1 then break end end - if (cfg.flags.SingleOutputDir) then - cfg.objectsdir = cfg.objdir or cfg.project.objdir or "obj" - else - cfg.objectsdir = path.getrelative(cfg.location, dir) - end + cfg.objectsdir = path.getrelative(cfg.location, dir) end end - end - + end + end - + -- @@ -414,24 +410,24 @@ end end - end + end end - + local function getCfgKind(cfg) if(cfg.kind) then return cfg.kind; end - + if(cfg.project.__configs[""] and cfg.project.__configs[""].kind) then return cfg.project.__configs[""].kind; end - + return nil end - + local function getprojrec(dstArray, foundList, cfg, cfgname, searchField, bLinkage) if(not cfg) then return end - + local foundUsePrjs = {}; for _, useName in ipairs(cfg[searchField]) do local testName = useName:lower(); @@ -447,7 +443,7 @@ end end end - + --Must connect to a usage project. if(theUseProj) then foundList[testName] = true; @@ -462,7 +458,7 @@ end end end - + for _, usePrj in ipairs(foundUsePrjs) do --Links can only recurse through static libraries. if((searchField ~= "links") or @@ -472,7 +468,7 @@ end end end - + -- -- This function will recursively get all projects that the given configuration has in its "uses" -- field. The return values are a list of tables. Each table in that list contains the following: @@ -490,27 +486,27 @@ local dstArray = {}; local foundList = {}; foundList[cfg.project.name:lower()] = true; - + --First, follow the uses recursively. getprojrec(dstArray, foundList, cfg, cfgname, "uses", false); - + --Next, go through all of the usage projects and recursively get their links. --But only if they're not already there. Get the links as linkage-only. local linkArray = {}; for prjName, prjEntry in pairs(dstArray) do - getprojrec(linkArray, foundList, prjEntry.usageProj.__configs[cfgname], cfgname, + getprojrec(linkArray, foundList, prjEntry.usageProj.__configs[cfgname], cfgname, "links", true); end - + --Copy from linkArray into dstArray. for prjName, prjEntry in pairs(linkArray) do dstArray[prjName] = prjEntry; end - + return dstArray; end - - + + local function isnameofproj(cfg, strName) local sln = cfg.project.solution; local strTest = strName:lower(); @@ -519,18 +515,18 @@ return true; end end - + return false; end - - + + -- -- Copies the field from dstCfg to srcCfg. -- local function copydependentfield(srcCfg, dstCfg, strSrcField) local srcField = premake.fields[strSrcField]; local strDstField = strSrcField; - + if type(srcCfg[strSrcField]) == "table" then --handle paths. if (srcField.kind == "dirlist" or srcField.kind == "filelist") and @@ -564,8 +560,8 @@ end end end - - + + -- -- This function will take the list of project entries and apply their usage project data -- to the given configuration. It will copy compiling information for the projects that are @@ -573,15 +569,15 @@ -- the source project is not a static library. It won't copy linking information -- if the project is in this solution; instead it will add that project to the configuration's -- links field, expecting that Premake will handle the rest. - -- + -- local function copyusagedata(cfg, cfgname, linkToProjs) local myPrj = cfg.project; local bIsStaticLib = (getCfgKind(cfg) == "StaticLib"); - + for prjName, prjEntry in pairs(linkToProjs) do local srcPrj = prjEntry.usageProj; local srcCfg = srcPrj.__configs[cfgname]; - + for name, field in pairs(premake.fields) do if(srcCfg[name]) then if(field.usagecopy) then @@ -598,7 +594,7 @@ end end end - + if((not bIsStaticLib) and prjEntry.proj) then table.insert(cfg.links, prjEntry.proj.name); end @@ -609,9 +605,9 @@ -- -- Main function, controls the process of flattening the configurations. -- - + function premake.bake.buildconfigs() - + -- convert project path fields to be relative to project location for sln in premake.solution.each() do for _, prj in ipairs(sln.projects) do @@ -623,9 +619,9 @@ end sln.location = sln.location or sln.basedir end - + -- collapse configuration blocks, so that there is only one block per build - -- configuration/platform pair, filtered to the current operating environment + -- configuration/platform pair, filtered to the current operating environment for sln in premake.solution.each() do local basis = collapse(sln) for _, prj in ipairs(sln.projects) do @@ -634,8 +630,8 @@ bake.postprocess(prj, cfg) end end - end - + end + -- This loop finds the projects that a configuration is connected to -- via its "uses" field. It will then copy any usage project information from that -- usage project to the configuration in question. @@ -648,7 +644,7 @@ end end end - end + end -- Remove all usage projects. for sln in premake.solution.each() do @@ -658,20 +654,20 @@ table.insert(removeList, 1, index); --Add in reverse order. end end - + for _, index in ipairs(removeList) do table.remove(sln.projects, index); end end - + -- assign unique object directories to each configuration builduniquedirs() - + -- walk it again and build the targets and unique directories buildtargets(cfg) end - + -- -- Post-process a project configuration, applying path fix-ups and other adjustments @@ -687,10 +683,10 @@ cfg.project = prj cfg.shortname = premake.getconfigname(cfg.name, cfg.platform, true) cfg.longname = premake.getconfigname(cfg.name, cfg.platform) - + -- set the project location, if not already set cfg.location = cfg.location or cfg.basedir - + -- figure out the target system local platform = premake.platforms[cfg.platform] if platform.iscrosscompiler then @@ -698,28 +694,28 @@ else cfg.system = os.get() end - + -- adjust the kind as required by the target system if cfg.kind == "SharedLib" and platform.nosharedlibs then cfg.kind = "StaticLib" end - + -- remove excluded files from the file list local files = { } for _, fname in ipairs(cfg.files) do - local excluded = false - for _, exclude in ipairs(cfg.excludes) do - excluded = (fname == exclude) - if (excluded) then break end + local removed = false + for _, removefname in ipairs(cfg.removefiles) do + removed = (fname == removefname) + if (removed) then break end end - - if (not excluded) then + + if (not removed) then table.insert(files, fname) end end cfg.files = files - -- fixup the data + -- fixup the data for name, field in pairs(premake.fields) do -- re-key flag fields for faster lookups if field.isflags then diff --git a/3rdparty/genie/src/host/scripts.c b/3rdparty/genie/src/host/scripts.c index ab706827655..c08c2b2dc3a 100644 --- a/3rdparty/genie/src/host/scripts.c +++ b/3rdparty/genie/src/host/scripts.c @@ -64,38 +64,38 @@ const char* builtin_scripts[] = { "premake.config = { }\nlocal config = premake.config\nfunction premake.config.isdebugbuild(cfg)\nif cfg.flags.Optimize or cfg.flags.OptimizeSize or cfg.flags.OptimizeSpeed then\nreturn false\nend\nif not cfg.flags.Symbols then\nreturn false\nend\nreturn true\nend\nfunction premake.config.isincrementallink(cfg)\nif cfg.kind == \"StaticLib\" \nor config.isoptimizedbuild(cfg.flags)\nor cfg.flags.NoIncrementalLink then\nreturn false\nend\nreturn true\nend\nfunction premake.config.isoptimizedbuild(flags)\nreturn flags.Optimize or flags.OptimizeSize or flags.OptimizeSpeed\nend\n", /* base/bake.lua */ - "premake.bake = { }\nlocal bake = premake.bake\nlocal nocopy = \n{\nblocks = true,\nkeywords = true,\nprojects = true,\n__configs = true,\n}\nlocal nocascade = \n{\nmakesettings = true,\n}\nlocal keeprelative =\n{\nbasedir = true,\nlocation = true,\n}\nfunction premake.getactiveterms()\nlocal terms = { _action = _ACTION:lower(), os = os.get() }\nfor key, value in pairs(_OPTIONS) do\nif value ~= \"\" then\ntable.insert(terms, value:lower())\nelse\ntable.insert(terms, key:lower())\nend\nend\nreturn terms\nend\nfunction premake.iskeywordmatch(keyword, terms)\nif keyword:startswith(\"not \") then\nreturn not premake.iskeywordmatch(keyword:sub(5), terms)\nend\nfor _, pattern in ipairs(keyword:explode(\" or \")) do\nfor termkey, term in pairs(terms) do\nif term:match(pattern) == term then\nreturn termkey\nend\nend\nend\nend\nfunction premake.iskeywordsmatch(keywords, terms)\nlocal hasrequired = false\nfor _, keyword in ipairs(keywords) do\nlocal matched = premake.iskeywordmatch(keyword, terms)\nif not matched t" - "hen\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, ite" - "m)\ntbl[item] = item\nend\nend\nend\nreturn tbl\nend\nlocal function removevalues(tbl, removes)\nfor i=#tbl,1,-1 do\n for _, pattern in ipairs(removes) do\n if pattern == tbl[i] then\n table.remove(tbl, i)\n break\n end\n end\n end\nend\nlocal function mergeobject(dest, src)\nif not src then \nreturn \nend\nfor fieldname, value in pairs(src) do\nif not nocopy[fieldname] then\nlocal field = premake.fields[fieldname]\nif field then\nif type(value) == \"table\" then\ndest[fieldname] = mergefield(field.kind, dest[fieldname], value)\nif src.removes then\nremoves = src.removes[fieldname]\nif removes then\nremovevalues(dest[fieldname], removes)\nend\nend\nelse\ndest[fieldname] = value\nend\nelse\ndest[fieldname] = value\nend\nend\nend\nend\nlocal function merge(dest, obj, basis, terms, cfgname, pltname)\nlocal key = cfgname or \"\"\npltname = pltname or \"Native\"\nif pltname ~= \"Native\" then\nkey = key .. pltname\nend" - "\nterms.config = (cfgname or \"\"):lower()\nterms.platform = pltname:lower()\nlocal cfg = {}\nmergeobject(cfg, basis[key])\nadjustpaths(obj.location, cfg)\nmergeobject(cfg, obj)\nif (cfg.kind) then \nterms['kind']=cfg.kind:lower()\nend\nfor _, blk in ipairs(obj.blocks) do\nif (premake.iskeywordsmatch(blk.keywords, terms))then\nmergeobject(cfg, blk)\nif (cfg.kind and not cfg.terms.kind) then \ncfg.terms['kind'] = cfg.kind:lower()\nterms['kind'] = cfg.kind:lower()\nend\nend\nend\ncfg.name = cfgname\ncfg.platform = pltname\nfor k,v in pairs(terms) do\ncfg.terms[k] =v\nend\ndest[key] = cfg\nend\nlocal function collapse(obj, basis)\nlocal result = {}\nbasis = basis or {}\nlocal sln = obj.solution or obj\nlocal terms = premake.getactiveterms()\nmerge(result, obj, basis, terms)--this adjusts terms\nfor _, cfgname in ipairs(sln.configurations) do\nlocal terms_local = {}\nfor k,v in pairs(terms)do terms_local[k]=v end\nmerge(result, obj, basis, terms_local, cfgname, \"Native\")--terms cam also be adjusted here\nf" - "or _, pltname in ipairs(sln.platforms or {}) do\nif pltname ~= \"Native\" then\nmerge(result, obj, basis,terms_local, cfgname, pltname)--terms also here\nend\nend\nend\nreturn result\nend\nlocal function builduniquedirs()\nlocal num_variations = 4\nlocal cfg_dirs = {}\nlocal hit_counts = {}\nfor sln in premake.solution.each() do\nfor _, prj in ipairs(sln.projects) do\nfor _, cfg in pairs(prj.__configs) do\nlocal dirs = { }\ndirs[1] = path.getabsolute(path.join(cfg.location, cfg.objdir or cfg.project.objdir or \"obj\"))\ndirs[2] = path.join(dirs[1], iif(cfg.platform == \"Native\", \"\", cfg.platform))\ndirs[3] = path.join(dirs[2], cfg.name)\ndirs[4] = path.join(dirs[3], cfg.project.name)\ncfg_dirs[cfg] = dirs\nlocal start = iif(cfg.name, 2, 1)\nfor v = start, num_variations do\nlocal d = dirs[v]\nhit_counts[d] = (hit_counts[d] or 0) + 1\nend\nend\nend\nend\nfor sln in premake.solution.each() do\nfor _, prj in ipairs(sln.projects) do\nfor _, cfg in pairs(prj.__configs) do\nlocal dir\nlocal start = iif(cfg.name, " - "2, 1)\nfor v = start, num_variations do\ndir = cfg_dirs[cfg][v]\nif hit_counts[dir] == 1 then break end\nend\nif (cfg.flags.SingleOutputDir) then\ncfg.objectsdir = cfg.objdir or cfg.project.objdir or \"obj\"\nelse\ncfg.objectsdir = path.getrelative(cfg.location, dir)\nend\nend\nend\nend\nend\nlocal function buildtargets()\nfor sln in premake.solution.each() do\nfor _, prj in ipairs(sln.projects) do\nfor _, cfg in pairs(prj.__configs) do\nlocal pathstyle = premake.getpathstyle(cfg)\nlocal namestyle = premake.getnamestyle(cfg)\ncfg.buildtarget = premake.gettarget(cfg, \"build\", pathstyle, namestyle, cfg.system)\ncfg.linktarget = premake.gettarget(cfg, \"link\", pathstyle, namestyle, cfg.system)\nif pathstyle == \"windows\" then\ncfg.objectsdir = path.translate(cfg.objectsdir, \"\\\\\")\nend\nend\nend\nend\nend\n local function getCfgKind(cfg)\n if(cfg.kind) then\n return cfg.kind;\n end\n \n if(cfg.project.__configs[\"\"] and cfg.project.__configs[\"\"].kind) then\n return cfg.project.__configs[\"\"].k" - "ind;\n end\n \n return nil\n end\n \n local function getprojrec(dstArray, foundList, cfg, cfgname, searchField, bLinkage)\n if(not cfg) then return end\n \n local foundUsePrjs = {};\n for _, useName in ipairs(cfg[searchField]) do\n local testName = useName:lower();\n if((not foundList[testName])) then\n local theProj = nil;\n local theUseProj = nil;\n for _, prj in ipairs(cfg.project.solution.projects) do\n if (prj.name:lower() == testName) then\n if(prj.usage) then\n theUseProj = prj;\n else\n theProj = prj;\n end\n end\n end\n \n --Must connect to a usage project.\n if(theUseProj) then\n foundList[testName] = true;\n local prjEntry = {\n name = testName,\n proj = theProj,\n usageProj = theUseProj,\n bLinkageOnly = bLinkage,\n };\n dstArray[testName] = prjEntry;\n table.insert(foundUsePrjs, theUseProj);\n end\n end\n end\n \n for _, usePrj in ipairs(foundUsePrjs) do\n --Links can only recurse through static libraries.\n if((searchField ~= \"links\") or\n (getCfgKind(" - "usePrj.__configs[cfgname]) == \"StaticLib\")) then\n getprojrec(dstArray, foundList, usePrj.__configs[cfgname],\n cfgname, searchField, bLinkage);\n end\n end\n end\n \n --\n -- This function will recursively get all projects that the given configuration has in its \"uses\"\n -- field. The return values are a list of tables. Each table in that list contains the following:\n --name = The lowercase name of the project.\n --proj = The project. Can be nil if it is usage-only.\n --usageProj = The usage project. Can't be nil, as using a project that has no\n -- usage project is not put into the list.\n --bLinkageOnly = If this is true, then only the linkage information should be copied.\n -- The recursion will only look at the \"uses\" field on *usage* projects.\n -- This function will also add projects to the list that are mentioned in the \"links\"\n -- field of usage projects. These will only copy linker information, but they will recurse.\n -- through other \"links\" fields.\n --\n local func" - "tion getprojectsconnections(cfg, cfgname)\n local dstArray = {};\n local foundList = {};\n foundList[cfg.project.name:lower()] = true;\n \n --First, follow the uses recursively.\n getprojrec(dstArray, foundList, cfg, cfgname, \"uses\", false);\n \n --Next, go through all of the usage projects and recursively get their links.\n --But only if they're not already there. Get the links as linkage-only.\n local linkArray = {};\n for prjName, prjEntry in pairs(dstArray) do\n getprojrec(linkArray, foundList, prjEntry.usageProj.__configs[cfgname], cfgname, \n \"links\", true);\n end\n \n --Copy from linkArray into dstArray.\n for prjName, prjEntry in pairs(linkArray) do\n dstArray[prjName] = prjEntry;\n end\n \n return dstArray;\n end\n \n \n local function isnameofproj(cfg, strName)\n local sln = cfg.project.solution;\n local strTest = strName:lower();\n for prjIx, prj in ipairs(sln.projects) do\n if (prj.name:lower() == strTest) then\n return true;\n end\n end\n \n return false;\n e" - "nd\n --\n -- Copies the field from dstCfg to srcCfg.\n --\n local function copydependentfield(srcCfg, dstCfg, strSrcField)\n local srcField = premake.fields[strSrcField];\n local strDstField = strSrcField;\n \n if type(srcCfg[strSrcField]) == \"table\" then\n --handle paths.\n if (srcField.kind == \"dirlist\" or srcField.kind == \"filelist\") and\n (not keeprelative[strSrcField]) then\n for i,p in ipairs(srcCfg[strSrcField]) do\n table.insert(dstCfg[strDstField],\n path.rebase(p, srcCfg.project.location, dstCfg.project.location))\n end\n else\n if(strSrcField == \"links\") then\n for i,p in ipairs(srcCfg[strSrcField]) do\n if(not isnameofproj(dstCfg, p)) then\n table.insert(dstCfg[strDstField], p)\n else\n printf(\"Failed to copy '%s' from proj '%s'.\",\n p, srcCfg.project.name);\n end\n end\n else\n for i,p in ipairs(srcCfg[strSrcField]) do\n table.insert(dstCfg[strDstField], p)\n end\n end\n end\n else\n if(srcField.kind == \"path\" and (not keeprelative[strSrcField])) then\n" - " dstCfg[strDstField] = path.rebase(srcCfg[strSrcField],\n prj.location, dstCfg.project.location);\n else\n dstCfg[strDstField] = srcCfg[strSrcField];\n end\n end\n end\n \n --\n -- This function will take the list of project entries and apply their usage project data\n -- to the given configuration. It will copy compiling information for the projects that are\n -- not listed as linkage-only. It will copy the linking information for projects only if\n -- the source project is not a static library. It won't copy linking information\n -- if the project is in this solution; instead it will add that project to the configuration's\n -- links field, expecting that Premake will handle the rest.\n --\n local function copyusagedata(cfg, cfgname, linkToProjs)\n local myPrj = cfg.project;\n local bIsStaticLib = (getCfgKind(cfg) == \"StaticLib\");\n \n for prjName, prjEntry in pairs(linkToProjs) do\n local srcPrj = prjEntry.usageProj;\n local srcCfg = srcPrj.__configs[cfgname];\n \n for name, field" - " in pairs(premake.fields) do\n if(srcCfg[name]) then\n if(field.usagecopy) then\n if(not prjEntry.bLinkageOnly) then\n copydependentfield(srcCfg, cfg, name)\n end\n elseif(field.linkagecopy) then\n --Copy the linkage data if we're building a non-static thing\n --and this is a pure usage project. If it's not pure-usage, then\n --we will simply put the project's name in the links field later.\n if((not bIsStaticLib) and (not prjEntry.proj)) then\n copydependentfield(srcCfg, cfg, name)\n end\n end\n end\n end\n \n if((not bIsStaticLib) and prjEntry.proj) then\n table.insert(cfg.links, prjEntry.proj.name);\n end\n end\n end\nfunction premake.bake.buildconfigs()\nfor sln in premake.solution.each() do\nfor _, prj in ipairs(sln.projects) do\nprj.location = prj.location or sln.location or prj.basedir\nadjustpaths(prj.location, prj)\nfor _, blk in ipairs(prj.blocks) do\nadjustpaths(prj.location, blk)\nend\nend\nsln.location = sln.location or sln.basedir\nend\nfor sln in premake.solution.each() do\n" - "local basis = collapse(sln)\nfor _, prj in ipairs(sln.projects) do\nprj.__configs = collapse(prj, basis)\nfor _, cfg in pairs(prj.__configs) do\nbake.postprocess(prj, cfg)\nend\nend\nend\nfor sln in premake.solution.each() do\nfor prjIx, prj in ipairs(sln.projects) do\nif(not prj.usage) then\nfor cfgname, cfg in pairs(prj.__configs) do\nlocal usesPrjs = getprojectsconnections(cfg, cfgname);\ncopyusagedata(cfg, cfgname, usesPrjs)\nend\nend\nend\nend\nfor sln in premake.solution.each() do\nlocal removeList = {};\nfor index, prj in ipairs(sln.projects) do\nif(prj.usage) then\ntable.insert(removeList, 1, index); --Add in reverse order.\nend\nend\nfor _, index in ipairs(removeList) do\ntable.remove(sln.projects, index);\nend\nend\nbuilduniquedirs()\nbuildtargets(cfg)\nend\nfunction premake.bake.postprocess(prj, cfg)\ncfg.project = prj\ncfg.shortname = premake.getconfigname(cfg.name, cfg.platform, true)\ncfg.longname = premake.getconfigname(cfg.name, cfg.platform)\ncfg.location = cfg.location or cfg.basedir\nloca" - "l platform = premake.platforms[cfg.platform]\nif platform.iscrosscompiler then\ncfg.system = cfg.platform\nelse\ncfg.system = os.get()\nend\nif cfg.kind == \"SharedLib\" and platform.nosharedlibs then\ncfg.kind = \"StaticLib\"\nend\nlocal files = { }\nfor _, fname in ipairs(cfg.files) do\nlocal excluded = false\nfor _, exclude in ipairs(cfg.excludes) do\nexcluded = (fname == exclude)\nif (excluded) then break end\nend\nif (not excluded) then\ntable.insert(files, fname)\nend\nend\ncfg.files = files\nfor name, field in pairs(premake.fields) do\nif field.isflags then\nlocal values = cfg[name]\nfor _, flag in ipairs(values) do values[flag] = true end\nend\nend\ncfg.__fileconfigs = { }\nfor _, fname in ipairs(cfg.files) do\ncfg.terms.required = fname:lower()\nlocal fcfg = {}\nfor _, blk in ipairs(cfg.project.blocks) do\nif (premake.iskeywordsmatch(blk.keywords, cfg.terms)) then\nmergeobject(fcfg, blk)\nend\nend\nfcfg.name = fname\ncfg.__fileconfigs[fname] = fcfg\ntable.insert(cfg.__fileconfigs, fcfg)\nend\nend\n", + "premake.bake = { }\nlocal bake = premake.bake\nlocal nocopy =\n{\nblocks = true,\nkeywords = true,\nprojects = true,\n__configs = true,\n}\nlocal nocascade =\n{\nmakesettings = true,\n}\nlocal keeprelative =\n{\nbasedir = true,\nlocation = true,\n}\nfunction premake.getactiveterms()\nlocal terms = { _action = _ACTION:lower(), os = os.get() }\nfor key, value in pairs(_OPTIONS) do\nif value ~= \"\" then\ntable.insert(terms, value:lower())\nelse\ntable.insert(terms, key:lower())\nend\nend\nreturn terms\nend\nfunction premake.iskeywordmatch(keyword, terms)\nif keyword:startswith(\"not \") then\nreturn not premake.iskeywordmatch(keyword:sub(5), terms)\nend\nfor _, pattern in ipairs(keyword:explode(\" or \")) do\nfor termkey, term in pairs(terms) do\nif term:match(pattern) == term then\nreturn termkey\nend\nend\nend\nend\nfunction premake.iskeywordsmatch(keywords, terms)\nlocal hasrequired = false\nfor _, keyword in ipairs(keywords) do\nlocal matched = premake.iskeywordmatch(keyword, terms)\nif not matched the" + "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", /* 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" - "\",\nscope = \"config\",\n},\nflags =\n{\nkind = \"list\",\nscope = \"config\",\nisflags = true,\nusagecopy = true,\nallowed = function(value)\nlocal allowed_flags = {\nATL = 1,\nDebugEnvsDontMerge = 1,\nDebugEnvsInherit = 1,\nEnableMinimalRebuild = 1,\nEnableSSE = 1,\nEnableSSE2 = 1,\nExtraWarnings = 1,\nFatalWarnings = 1,\nFloatFast = 1,\nFloatStrict = 1,\nManaged = 1,\nMFC = 1,\nNativeWChar = 1,\nNo64BitChecks = 1,\nNoEditAndContinue = 1,\nNoExceptions = 1,\nNoFramePointer = 1,\nNoImportLib = 1,\nNoIncrementalLink = 1,\nNoManifest = 1,\nNoMultiProcessorCompilation = 1,\nNoNativeWChar = 1,\nNoPCH = 1,\nNoRTTI = 1,\nSingleOutputDir = 1,\nOptimize = 1,\nOptimizeSize = 1,\nOptimizeSpeed = 1,\nSEH = 1,\nStaticATL = 1,\nStaticRuntime = 1,\nSymbols = 1,\nUnicode = 1,\nUnsafe = 1,\nUnsignedChar = 1,\nWinMain = 1,\n}\nlocal englishToAmericanSpelling =\n{\noptimise = 'optimize',\noptimisesize = 'optimizesize',\noptimisespeed = 'optimizespeed',\n}\nlocal lowervalue = value:lower()\nlowervalue = englishToAmericanSpell" - "ing[lowervalue] or lowervalue\nfor v, _ in pairs(allowed_flags) do\nif v:lower() == lowervalue then\nreturn v\nend\nend\nreturn nil, \"invalid flag\"\nend,\n},\nframework =\n{\nkind = \"string\",\nscope = \"container\",\nallowed = {\n\"1.0\",\n\"1.1\",\n\"2.0\",\n\"3.0\",\n\"3.5\",\n\"4.0\",\n\"4.5\",\n}\n},\nforcedincludes = \n{\nkind = \"absolutefilelist\",\nscope = \"config\",\n},\nimagepath =\n{\nkind = \"path\",\nscope = \"config\",\n},\nimageoptions =\n{\nkind = \"list\",\nscope = \"config\",\n},\nimplibdir =\n{\nkind = \"path\",\nscope = \"config\",\n},\nimplibextension =\n{\nkind = \"string\",\nscope = \"config\",\n},\nimplibname =\n{\nkind = \"string\",\nscope = \"config\",\n},\nimplibprefix =\n{\nkind = \"string\",\nscope = \"config\",\n},\nimplibsuffix =\n{\nkind = \"string\",\nscope = \"config\",\n},\nincludedirs =\n{\nkind = \"dirlist\",\nscope = \"config\",\nusagecopy = true,\n},\nkind =\n{\nkind = \"string\",\nscope = \"config\",\nallowed = {\n\"ConsoleApp\",\n\"WindowedApp\",\n\"Static" - "Lib\",\n\"SharedLib\"\n}\n},\nlanguage =\n{\nkind = \"string\",\nscope = \"container\",\nallowed = {\n\"C\",\n\"C++\",\n\"C#\"\n}\n},\nlibdirs =\n{\nkind = \"dirlist\",\nscope = \"config\",\nlinkagecopy = true,\n},\nlinkoptions =\n{\nkind = \"list\",\nscope = \"config\",\n},\nlinks =\n{\nkind = \"list\",\nscope = \"config\",\nallowed = function(value)\nif value:find('/', nil, true) then\nvalue = path.getabsolute(value)\nend\nreturn value\nend,\nlinkagecopy = true,\n},\nlocation =\n{\nkind = \"path\",\nscope = \"container\",\n},\nmakesettings =\n{\nkind = \"list\",\nscope = \"config\",\n},\nmessageskip =\n{\nkind = \"list\",\nscope = \"solution\",\nisflags = true,\nusagecopy = true,\nallowed = function(value)\nlocal allowed_messages = {\nSkipCreatingMessage = 1,\nSkipBuildingMessage = 1,\nSkipCleaningMessage = 1,\n}\nlocal lowervalue = value:lower()\nfor v, _ in pairs(allowed_messages) do\nif v:lower() == lowervalue then\nreturn v\nend\nend\nreturn nil, \"invalid message to skip\"\nend,\n},\nmsgarchiving " - "=\n{\nkind = \"string\",\nscope = \"config\",\n},\nmsgcompile =\n{\nkind = \"string\",\nscope = \"config\",\n},\nmsgcompile_objc =\n{\nkind = \"string\",\nscope = \"config\",\n},\nmsgresource =\n{\nkind = \"string\",\nscope = \"config\",\n},\nmsglinking =\n{\nkind = \"string\",\nscope = \"config\",\n},\nobjdir =\n{\nkind = \"path\",\nscope = \"config\",\n},\noptions =\n{\nkind = \"list\",\nscope = \"container\",\nisflags = true,\nusagecopy = true,\nallowed = function(value)\nlocal allowed_options = {\nForceCPP = 1,\nArchiveSplit = 1\n}\nlocal lowervalue = value:lower()\nfor v, _ in pairs(allowed_options) do\nif v:lower() == lowervalue then\nreturn v\nend\nend\nreturn nil, \"invalid option\"\nend,\n},\npchheader =\n{\nkind = \"string\",\nscope = \"config\",\n},\npchsource =\n{\nkind = \"path\",\nscope = \"config\",\n},\nplatforms =\n{\nkind = \"list\",\nscope = \"solution\",\nallowed = table.keys(premake.platforms),\n},\npostbuildcommands =\n{\nkind = \"list\",\nscope = \"config\",\n},\nprebuildcomma" - "nds =\n{\nkind = \"list\",\nscope = \"config\",\n},\nprelinkcommands =\n{\nkind = \"list\",\nscope = \"config\",\n},\nresdefines =\n{\nkind = \"list\",\nscope = \"config\",\n},\nresincludedirs =\n{\nkind = \"dirlist\",\nscope = \"config\",\n},\nresoptions =\n{\nkind = \"list\",\nscope = \"config\",\n},\nstartproject =\n{\nkind = \"string\",\nscope = \"solution\",\n},\ntargetdir =\n{\nkind = \"path\",\nscope = \"config\",\n},\ntargetsubdir =\n{\nkind = \"string\",\nscope = \"config\",\n},\ntargetextension =\n{\nkind = \"string\",\nscope = \"config\",\n},\ntargetname =\n{\nkind = \"string\",\nscope = \"config\",\n},\ntargetprefix =\n{\nkind = \"string\",\nscope = \"config\",\n},\ntargetsuffix =\n{\nkind = \"string\",\nscope = \"config\",\n},\ntrimpaths =\n{\nkind = \"dirlist\",\nscope = \"config\",\n},\nuuid =\n{\nkind = \"string\",\nscope = \"container\",\nallowed = function(value)\nlocal ok = true\nif (#value ~= 36) then ok = false end\nfor i=1,36 do\nlocal ch = value:sub(i,i)\nif (not ch:find(\"[" - "ABCDEFabcdef0123456789-]\")) then ok = false end\nend\nif (value:sub(9,9) ~= \"-\") then ok = false end\nif (value:sub(14,14) ~= \"-\") then ok = false end\nif (value:sub(19,19) ~= \"-\") then ok = false end\nif (value:sub(24,24) ~= \"-\") then ok = false end\nif (not ok) then\nreturn nil, \"invalid UUID\"\nend\nreturn value:upper()\nend\n},\nuses =\n{\nkind = \"list\",\nscope = \"config\",\n},\nvpaths =\n{\nkind = \"keypath\",\nscope = \"container\",\n},\n}\npremake.check_paths = false\nfunction premake.checkvalue(value, allowed)\nif (allowed) then\nif (type(allowed) == \"function\") then\nreturn allowed(value)\nelse\nfor _,v in ipairs(allowed) do\nif (value:lower() == v:lower()) then\nreturn v\nend\nend\nreturn nil, \"invalid value '\" .. value .. \"'\"\nend\nelse\nreturn value\nend\nend\nfunction premake.getobject(t)\nlocal container\nif (t == \"container\" or t == \"solution\") then\ncontainer = premake.CurrentContainer\nelse\ncontainer = premake.CurrentConfiguration\nend\nif t == \"solution\" then\nif " - "type(container) == \"project\" then\ncontainer = container.solution\nend\nif type(container) ~= \"solution\" then\ncontainer = nil\nend\nend\nlocal msg\nif (not container) then\nif (t == \"container\") then\nmsg = \"no active solution or project\"\nelseif (t == \"solution\") then\nmsg = \"no active solution\"\nelse\nmsg = \"no active solution, project, or configuration\"\nend\nend\nreturn container, msg\nend\nfunction premake.setarray(obj, fieldname, value, allowed)\nobj[fieldname] = obj[fieldname] or {}\nlocal function add(value, depth)\nif type(value) == \"table\" then\nfor _,v in ipairs(value) do\nadd(v, depth + 1)\nend\nelse\nvalue, err = premake.checkvalue(value, allowed)\nif not value then\nerror(err, depth)\nend\ntable.insert(obj[fieldname], value)\nend\nend\nif value then\nadd(value, 5)\nend\nreturn obj[fieldname]\nend\nlocal function domatchedarray(ctype, fieldname, value, matchfunc)\nlocal result = { }\nfunction makeabsolute(value, depth)\nif (type(value) == \"table\") then\nfor _, item in ipairs(val" - "ue) 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[fieldname] = {}\nend\nif type(values) ~= \"table\" then\nerror(\"inval" - "id 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(va" - "lue)\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 creategroupsfrompath(inpath, sln)\nif inpath == nil then return nil en" - "d\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\n" - "function 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\n -- if this is a new project, or the project in that slot doesn't have a usage, create it\n if((not sln.projects[name]) or\n ((not sln.projects[name].usage) and (not sln.projects[name].usageProj))) then\n premake.CurrentContainer = createproject(name, sln, true)\n else\n premake.CurrentContainer = iff(sln.projects[name].usage,\n sln.projects[name], sln.projects[name].usageProj)\n end\n -- add an empty, global configuration to the project\n configuration { }\n return premake.CurrentContainer\n end\n function project(name)\n if (not name) then\n --Only return non-usa" - "ge projects\n if(type(premake.CurrentContainer) ~= \"project\") then return nil end\n if(premake.CurrentContainer.usage) then return nil end\n return premake.CurrentContainer\nend\n -- identify the parent solution\n local sln\n if (type(premake.CurrentContainer) == \"project\") then\n sln = premake.CurrentContainer.solution\n else\n sln = premake.CurrentContainer\n end\n if (type(sln) ~= \"solution\") then\n error(\"no active solution\", 2)\n end\n -- if this is a new project, or the old project is a usage project, create it\n if((not sln.projects[name]) or sln.projects[name].usage) then\n premake.CurrentContainer = createproject(name, sln)\n else\n premake.CurrentContainer = sln.projects[name];\n end\nconfiguration { }\nreturn premake.CurrentContainer\nend\nfunction solution(name)\nif not name then\nif type(premake.CurrentContainer) == \"project\" then\nreturn premake.CurrentContainer.solution\nelse\nreturn premake.CurrentContainer\nend\nend\npremake.CurrentContainer = premake.solution.get(" - "name)\nif (not premake.CurrentContainer) then\npremake.CurrentContainer = premake.solution.new(name)\nend\nconfiguration { }\nreturn premake.CurrentContainer\nend\nfunction group(name)\nif not name then \nreturn premake.CurrentGroup\nend\npremake.CurrentGroup = name\nreturn premake.CurrentGroup\nend\nfunction newaction(a)\npremake.action.add(a)\nend\nfunction newoption(opt)\npremake.option.add(opt)\nend\n", + "\",\nscope = \"config\",\n},\nremovefiles =\n{\nkind = \"filelist\",\nscope = \"config\",\n},\nflags =\n{\nkind = \"list\",\nscope = \"config\",\nisflags = true,\nusagecopy = true,\nallowed = function(value)\nlocal allowed_flags = {\nATL = 1,\nDebugEnvsDontMerge = 1,\nDebugEnvsInherit = 1,\nEnableMinimalRebuild = 1,\nEnableSSE = 1,\nEnableSSE2 = 1,\nExtraWarnings = 1,\nFatalWarnings = 1,\nFloatFast = 1,\nFloatStrict = 1,\nManaged = 1,\nMFC = 1,\nNativeWChar = 1,\nNo64BitChecks = 1,\nNoEditAndContinue = 1,\nNoExceptions = 1,\nNoFramePointer = 1,\nNoImportLib = 1,\nNoIncrementalLink = 1,\nNoManifest = 1,\nNoMultiProcessorCompilation = 1,\nNoNativeWChar = 1,\nNoPCH = 1,\nNoRTTI = 1,\nSingleOutputDir = 1,\nOptimize = 1,\nOptimizeSize = 1,\nOptimizeSpeed = 1,\nSEH = 1,\nStaticATL = 1,\nStaticRuntime = 1,\nSymbols = 1,\nUnicode = 1,\nUnsafe = 1,\nUnsignedChar = 1,\nWinMain = 1,\n}\nlocal englishToAmericanSpelling =\n{\noptimise = 'optimize',\noptimisesize = 'optimizesize',\noptimisespeed = 'optimizespeed',\n}\nloc" + "al lowervalue = value:lower()\nlowervalue = englishToAmericanSpelling[lowervalue] or lowervalue\nfor v, _ in pairs(allowed_flags) do\nif v:lower() == lowervalue then\nreturn v\nend\nend\nreturn nil, \"invalid flag\"\nend,\n},\nframework =\n{\nkind = \"string\",\nscope = \"container\",\nallowed = {\n\"1.0\",\n\"1.1\",\n\"2.0\",\n\"3.0\",\n\"3.5\",\n\"4.0\",\n\"4.5\",\n}\n},\nforcedincludes =\n{\nkind = \"absolutefilelist\",\nscope = \"config\",\n},\nimagepath =\n{\nkind = \"path\",\nscope = \"config\",\n},\nimageoptions =\n{\nkind = \"list\",\nscope = \"config\",\n},\nimplibdir =\n{\nkind = \"path\",\nscope = \"config\",\n},\nimplibextension =\n{\nkind = \"string\",\nscope = \"config\",\n},\nimplibname =\n{\nkind = \"string\",\nscope = \"config\",\n},\nimplibprefix =\n{\nkind = \"string\",\nscope = \"config\",\n},\nimplibsuffix =\n{\nkind = \"string\",\nscope = \"config\",\n},\nincludedirs =\n{\nkind = \"dirlist\",\nscope = \"config\",\nusagecopy = true,\n},\nkind =\n{\nkind = \"string\",\nscope = \"co" + "nfig\",\nallowed = {\n\"ConsoleApp\",\n\"WindowedApp\",\n\"StaticLib\",\n\"SharedLib\"\n}\n},\nlanguage =\n{\nkind = \"string\",\nscope = \"container\",\nallowed = {\n\"C\",\n\"C++\",\n\"C#\"\n}\n},\nlibdirs =\n{\nkind = \"dirlist\",\nscope = \"config\",\nlinkagecopy = true,\n},\nlinkoptions =\n{\nkind = \"list\",\nscope = \"config\",\n},\nlinks =\n{\nkind = \"list\",\nscope = \"config\",\nallowed = function(value)\nif value:find('/', nil, true) then\nvalue = path.getabsolute(value)\nend\nreturn value\nend,\nlinkagecopy = true,\n},\nlocation =\n{\nkind = \"path\",\nscope = \"container\",\n},\nmakesettings =\n{\nkind = \"list\",\nscope = \"config\",\n},\nmessageskip =\n{\nkind = \"list\",\nscope = \"solution\",\nisflags = true,\nusagecopy = true,\nallowed = function(value)\nlocal allowed_messages = {\nSkipCreatingMessage = 1,\nSkipBuildingMessage = 1,\nSkipCleaningMessage = 1,\n}\nlocal lowervalue = value:lower()\nfor v, _ in pairs(allowed_messages) do\nif v:lower() == lowervalue then\nreturn v\nend\nend" + "\nreturn nil, \"invalid message to skip\"\nend,\n},\nmsgarchiving =\n{\nkind = \"string\",\nscope = \"config\",\n},\nmsgcompile =\n{\nkind = \"string\",\nscope = \"config\",\n},\nmsgcompile_objc =\n{\nkind = \"string\",\nscope = \"config\",\n},\nmsgresource =\n{\nkind = \"string\",\nscope = \"config\",\n},\nmsglinking =\n{\nkind = \"string\",\nscope = \"config\",\n},\nobjdir =\n{\nkind = \"path\",\nscope = \"config\",\n},\noptions =\n{\nkind = \"list\",\nscope = \"container\",\nisflags = true,\nusagecopy = true,\nallowed = function(value)\nlocal allowed_options = {\nForceCPP = 1,\nArchiveSplit = 1\n}\nlocal lowervalue = value:lower()\nfor v, _ in pairs(allowed_options) do\nif v:lower() == lowervalue then\nreturn v\nend\nend\nreturn nil, \"invalid option\"\nend,\n},\npchheader =\n{\nkind = \"string\",\nscope = \"config\",\n},\npchsource =\n{\nkind = \"path\",\nscope = \"config\",\n},\nplatforms =\n{\nkind = \"list\",\nscope = \"solution\",\nallowed = table.keys(premake.platforms),\n},\npostbuildcomman" + "ds =\n{\nkind = \"list\",\nscope = \"config\",\n},\nprebuildcommands =\n{\nkind = \"list\",\nscope = \"config\",\n},\nprelinkcommands =\n{\nkind = \"list\",\nscope = \"config\",\n},\nresdefines =\n{\nkind = \"list\",\nscope = \"config\",\n},\nresincludedirs =\n{\nkind = \"dirlist\",\nscope = \"config\",\n},\nresoptions =\n{\nkind = \"list\",\nscope = \"config\",\n},\nstartproject =\n{\nkind = \"string\",\nscope = \"solution\",\n},\ntargetdir =\n{\nkind = \"path\",\nscope = \"config\",\n},\ntargetsubdir =\n{\nkind = \"string\",\nscope = \"config\",\n},\ntargetextension =\n{\nkind = \"string\",\nscope = \"config\",\n},\ntargetname =\n{\nkind = \"string\",\nscope = \"config\",\n},\ntargetprefix =\n{\nkind = \"string\",\nscope = \"config\",\n},\ntargetsuffix =\n{\nkind = \"string\",\nscope = \"config\",\n},\ntrimpaths =\n{\nkind = \"dirlist\",\nscope = \"config\",\n},\nuuid =\n{\nkind = \"string\",\nscope = \"container\",\nallowed = function(value)\nlocal ok = true\nif (#value ~= 36) then ok = false " + "end\nfor i=1,36 do\nlocal ch = value:sub(i,i)\nif (not ch:find(\"[ABCDEFabcdef0123456789-]\")) then ok = false end\nend\nif (value:sub(9,9) ~= \"-\") then ok = false end\nif (value:sub(14,14) ~= \"-\") then ok = false end\nif (value:sub(19,19) ~= \"-\") then ok = false end\nif (value:sub(24,24) ~= \"-\") then ok = false end\nif (not ok) then\nreturn nil, \"invalid UUID\"\nend\nreturn value:upper()\nend\n},\nuses =\n{\nkind = \"list\",\nscope = \"config\",\n},\nvpaths =\n{\nkind = \"keypath\",\nscope = \"container\",\n},\n}\npremake.check_paths = false\nfunction premake.checkvalue(value, allowed)\nif (allowed) then\nif (type(allowed) == \"function\") then\nreturn allowed(value)\nelse\nfor _,v in ipairs(allowed) do\nif (value:lower() == v:lower()) then\nreturn v\nend\nend\nreturn nil, \"invalid value '\" .. value .. \"'\"\nend\nelse\nreturn value\nend\nend\nfunction premake.getobject(t)\nlocal container\nif (t == \"container\" or t == \"solution\") then\ncontainer = premake.CurrentContainer\nelse\ncontainer =" + " premake.CurrentConfiguration\nend\nif t == \"solution\" then\nif type(container) == \"project\" then\ncontainer = container.solution\nend\nif type(container) ~= \"solution\" then\ncontainer = nil\nend\nend\nlocal msg\nif (not container) then\nif (t == \"container\") then\nmsg = \"no active solution or project\"\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", /* 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{" @@ -179,17 +179,17 @@ const char* builtin_scripts[] = { "ative(sln.location, prj.location)), _MAKE.esc(_MAKE.getmakefilename(prj, true)))\n_p('')\nend\n_p('clean:')\nfor _ ,prj in ipairs(sln.projects) do\n_p('\\t@${MAKE} --no-print-directory -C %s -f %s clean', _MAKE.esc(path.getrelative(sln.location, prj.location)), _MAKE.esc(_MAKE.getmakefilename(prj, true)))\nend\n_p('')\n_p('help:')\n_p(1,'@echo \"Usage: make [config=name] [target]\"')\n_p(1,'@echo \"\"')\n_p(1,'@echo \"CONFIGURATIONS:\"')\nlocal cfgpairs = { }\nfor _, platform in ipairs(platforms) do\nfor _, cfgname in ipairs(sln.configurations) do\n_p(1,'@echo \" %s\"', premake.getconfigname(cfgname, platform, true))\nend\nend\n_p(1,'@echo \"\"')\n_p(1,'@echo \"TARGETS:\"')\n_p(1,'@echo \" all (default)\"')\n_p(1,'@echo \" clean\"')\nfor _, prj in ipairs(sln.projects) do\n_p(1,'@echo \" %s\"', prj.name)\nend\n_p(1,'@echo \"\"')\n_p(1,'@echo \"For more information, see http://industriousone.com/premake/quick-start\"')\nend\n", /* actions/make/make_cpp.lua */ - "premake.make.cpp = { }\npremake.make.undefine = { }\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 max_args,$(LINKCMD),'.. prj.archivesplit_size ..',$(OBJECTS))')\nend\nelse\nif prj.msglinking the" - "n\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,$(OBJDIR))')\nfor dir, _ in pairs(objdirs) do\n_p('\\t-$(call MKDIR,$(OBJDIR)/%s)', dir)\nend\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('')\nfor _, variable in ipairs(premake.make.undefine) do\n_p('override undefine '.. variable)\nend\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(' SHEL" - "LTYPE := 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('else')\n_p(' MKDIR = $(SILENT) mkdir \"$(subst /,\\\\\\\\,$(1))\" 2> nul || exit 0')\n_p(' COPY = $(SILENT) copy /Y \"$(subst /,\\\\\\\\,$(1))\" \"$(subst /,\\\\\\\\,$(2))\"')\n_p('endif')\n_p('')\n_p('CC = %s', cc.cc)\n_p('CXX = %s', cc.cxx)\n_p('AR = %s', cc.ar)\n_p('')\n_p('ifndef RESCOMP')\n_p(' ifdef WINDRES')\n_p(' RESCOMP = $(WINDRES)')\n_p(' else')\n_p(' RESCOMP = windres')\n_p(' endif')\n_p('endif')\n_p('')\nend\nfunction premake.gmake_cpp_config(prj, cfg, cc)\n_p('ifeq ($(config),%s)', _MAKE.esc(cfg.shortname))\ncpp.platformtools(cfg, cc)\n_p(' OBJDIR = %s', _MAKE.esc(cfg.objectsdir))\n_p(' TARGETDIR = %s', _MAKE.esc(cfg.buildtarget.directory))\n_p(' TARGET = $(TARGETDIR)/%s', _MAKE.esc(cfg.buildtarget.name))\n_p(' DEFINES +=%s', make.list(cc.getdefines(cfg.defines)))\n_p(' INCLUDES +=%s', make.list(" - "cc.getincludedirs(cfg.includedirs)))\ncpp.pchconfig(cfg)\ncpp.flags(cfg, cc)\ncpp.linker(cfg, cc)\n_p(' OBJECTS := \\\\')\nfor _, 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.getcxxflags(cfg), cfg.buildoptions, cfg.b" - "uildoptions_cpp)))\n_p(' ALL_OBJCFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH)%s', make.list(table.join(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(cfg, cc)\n_p(' ALL_LDFLAGS += $(LDFLAGS)%s', make.list(table.join(cc.getlibdirflags(cfg), cc.getldflags(cfg), cfg.linkoptions)))\n_p(' LDDEPS +=%s', make.list(_MAKE.esc(premake.getlinks(cfg, \"siblings\", \"fullpath\"))))\n_p(' LIBS += $(LDDEPS)%s', make.list(cc.getlinkflags(cfg)))\nif cfg.kind == \"StaticLib\" then\nif cfg.platform:startswith(\"Universal\") then\n_p(' LINKCMD = libtool -o $(TARGET)')\nelse\nif cc.llvm then\n_p(' LINKCMD = $(AR) rcs $(TARGET)')\nelse\n_p(' LINKCMD = $(AR) -rcs $(TARGET)')\nend\nend\nelse\nlocal tool = iif(cfg.language == \"C\", \"CC\", \"CXX" - "\")\n_p(' LINKCMD = $(%s) -o $(TARGET) $(OBJECTS) $(RESOURCES) $(ARCH) $(ALL_LDFLAGS) $(LIBS)', tool)\nend\nend\nfunction cpp.pchconfig(cfg)\nif not cfg.pchheader or cfg.flags.NoPCH then\nreturn\nend\nlocal pch = cfg.pchheader\nfor _, incdir in ipairs(cfg.includedirs) do\nlocal abspath = path.getabsolute(path.join(cfg.project.location, incdir))\nlocal testname = path.join(abspath, pch)\nif os.isfile(testname) then\npch = path.getrelative(cfg.location, testname)\nbreak\nend\nend\n_p(' PCH = %s', _MAKE.esc(pch))\n_p(' GCH = $(OBJDIR)/$(notdir $(PCH)).gch')\nend\nfunction cpp.pchrules(prj)\n_p('ifneq (,$(PCH))')\n_p('$(GCH): $(PCH)')\n_p('\\t@echo $(notdir $<)')\nlocal cmd = iif(prj.language == \"C\", \"$(CC) -x c-header $(ALL_CFLAGS)\", \"$(CXX) -x c++-header $(ALL_CXXFLAGS)\")\n_p('\\t$(SILENT) %s -MMD -MP $(DEFINES) $(INCLUDES) -o \"$@\" -MF \"$(@:%%.gch=%%.d)\" -c \"$<\"', cmd)\n_p('endif')\n_p('')\nend\nfunction cpp.fileRules(prj)\nfor _, file in ipairs(prj.files or {}) do\nif path.iscppf" - "ile(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", + "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", /* 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" @@ -202,12 +202,12 @@ const char* builtin_scripts[] = { "ild commands')\n_p('\\t%s', table.implode(cfg.postbuildcommands, \"\", \"\", \"\\n\\t\"))\nend\n_p(' endef')\n_p('endif')\n_p('')\nend\n", /* actions/vstudio/_vstudio.lua */ - "premake.vstudio = { }\nlocal toolsets = {\nvs2010 = \"v90\",\nvs2012 = \"v110\",\nvs2013 = \"v120\",\nvs2015 = \"v140\"\n}\npremake.vstudio.toolset = toolsets[_ACTION] or \"unknown?\"\nlocal vstudio = premake.vstudio\nvstudio.platforms = {\nany = \"Any CPU\",\nmixed = \"Mixed Platforms\",\nNative = \"Win32\",\nx86 = \"x86\",\nx32 = \"Win32\",\nx64 = \"x64\",\nPS3 = \"PS3\",\nXbox360 = \"Xbox 360\",\nARM = \"ARM\"\n}\nfunction vstudio.arch(prj)\nif (prj.language == \"C#\") then\nreturn \"Any CPU\"\nelse\nreturn \"Win32\"\nend\nend\nfunction vstudio.buildconfigs(sln)\nlocal cfgs = { }\nlocal platforms = premake.filterplatforms(sln, vstudio.platforms, \"Native\")\nlocal hascpp = premake.hascppproject(sln)\nlocal hasdotnet = premake.hasdotnetproject(sln)\nif hasdotnet and (_ACTION > \"vs2008\" or hascpp) then\ntable.insert(platforms, 1, \"mixed\")\nend\nif hasdotnet and (_ACTION < \"vs2010\" or not hascpp) then\ntable.insert(platforms, 1, \"any\")\nend\nif _ACTION > \"vs2008\" then\nl" - "ocal platforms2010 = { }\nfor _, platform in ipairs(platforms) do\nif vstudio.platforms[platform] == \"Win32\" then\nif hascpp then\ntable.insert(platforms2010, platform)\nend\nif hasdotnet then\ntable.insert(platforms2010, \"x86\")\nend\nelse\ntable.insert(platforms2010, platform)\nend\nend\nplatforms = platforms2010\nend\nfor _, buildcfg in ipairs(sln.configurations) do\nfor _, platform in ipairs(platforms) do\nlocal entry = { }\nentry.src_buildcfg = buildcfg\nentry.src_platform = platform\nif platform ~= \"PS3\" or _ACTION > \"vs2008\" then\nentry.buildcfg = buildcfg\nentry.platform = vstudio.platforms[platform]\nelse\nentry.buildcfg = platform .. \" \" .. buildcfg\nentry.platform = \"Win32\"\nend\nentry.name = entry.buildcfg .. \"|\" .. entry.platform\nentry.isreal = (platform ~= \"any\" and platform ~= \"mixed\")\ntable.insert(cfgs, entry)\nend\nend\nreturn cfgs\nend\nfunction vstudio.cleansolution(sln)\npremake.clean.file(sln, \"%%.sln\")\npremake.clean.file(sln, \"%%.suo\")\npremake.clean.file(sln, \"%%" - ".ncb\")\npremake.clean.file(sln, \"%%.userprefs\")\npremake.clean.file(sln, \"%%.usertasks\")\nend\nfunction vstudio.cleanproject(prj)\nlocal fname = premake.project.getfilename(prj, \"%%\")\nos.remove(fname .. \".vcproj\")\nos.remove(fname .. \".vcproj.user\")\nos.remove(fname .. \".vcxproj\")\nos.remove(fname .. \".vcxproj.user\")\nos.remove(fname .. \".vcxproj.filters\")\nos.remove(fname .. \".csproj\")\nos.remove(fname .. \".csproj.user\")\nos.remove(fname .. \".pidb\")\nos.remove(fname .. \".sdf\")\nend\nfunction vstudio.cleantarget(name)\nos.remove(name .. \".pdb\")\nos.remove(name .. \".idb\")\nos.remove(name .. \".ilk\")\nos.remove(name .. \".vshost.exe\")\nos.remove(name .. \".exe.manifest\")\nend\nfunction vstudio.projectfile(prj)\nlocal pattern\nif prj.language == \"C#\" then\npattern = \"%%.csproj\"\nelse\npattern = iif(_ACTION > \"vs2008\", \"%%.vcxproj\", \"%%.vcproj\")\nend\nlocal fname = premake.project.getbasename(prj.name, pattern)\nfname = path.join(prj.location, fname)\nreturn fname\nend\nf" - "unction vstudio.tool(prj)\nif (prj.language == \"C#\") then\nreturn \"FAE04EC0-301F-11D3-BF4B-00C04F79EFBC\"\nelse\nreturn \"8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942\"\nend\nend\nnewaction {\ntrigger = \"vs2008\",\nshortname = \"Visual Studio 2008\",\ndescription = \"Generate Microsoft Visual Studio 2008 project files\",\nos = \"windows\",\nvalid_kinds = { \"ConsoleApp\", \"WindowedApp\", \"StaticLib\", \"SharedLib\" },\nvalid_languages = { \"C\", \"C++\", \"C#\" },\nvalid_tools = {\ncc = { \"msc\" },\ndotnet = { \"msnet\" },\n},\nonsolution = function(sln)\npremake.generate(sln, \"%%.sln\", vstudio.sln2005.generate)\nend,\nonproject = function(prj)\nif premake.isdotnetproject(prj) then\npremake.generate(prj, \"%%.csproj\", vstudio.cs2005.generate)\npremake.generate(prj, \"%%.csproj.user\", vstudio.cs2005.generate_user)\nelse\npremake.generate(prj, \"%%.vcproj\", vstudio.vc200x.generate)\npremake.generate(prj, \"%%.vcproj.user\", vstudio.vc200x.generate_user)\nend\nend," - "\noncleansolution = vstudio.cleansolution,\noncleanproject = vstudio.cleanproject,\noncleantarget = vstudio.cleantarget,\nvstudio = {\nproductVersion = \"9.0.21022\",\nsolutionVersion = \"10\",\ntoolsVersion = \"3.5\",\n}\n}\nnewaction\n{\ntrigger = \"vs2010\",\nshortname = \"Visual Studio 2010\",\ndescription = \"Generate Microsoft Visual Studio 2010 project files\",\nos = \"windows\",\nvalid_kinds = { \"ConsoleApp\", \"WindowedApp\", \"StaticLib\", \"SharedLib\" },\nvalid_languages = { \"C\", \"C++\", \"C#\"},\nvalid_tools = {\ncc = { \"msc\" },\ndotnet = { \"msnet\" },\n},\nonsolution = function(sln)\npremake.generate(sln, \"%%.sln\", vstudio.sln2005.generate)\nend,\nonproject = function(prj)\nif premake.isdotnetproject(prj) then\npremake.generate(prj, \"%%.csproj\", vstudio.cs2005.generate)\npremake.generate(prj, \"%%.csproj.user\", vstudio.cs2005.generate_user)\nelse\npremake.generate(prj, \"%%.vcxproj\", premake.vs2010_vcxproj)\npremake.generate(prj, \"" - "%%.vcxproj.user\", premake.vs2010_vcxproj_user)\npremake.generate(prj, \"%%.vcxproj.filters\", vstudio.vc2010.generate_filters)\nend\nend,\noncleansolution = premake.vstudio.cleansolution,\noncleanproject = premake.vstudio.cleanproject,\noncleantarget = premake.vstudio.cleantarget,\nvstudio = {\nproductVersion = \"8.0.30703\",\nsolutionVersion = \"11\",\ntargetFramework = \"4.0\",\ntoolsVersion = \"4.0\",\n}\n}\n", + "premake.vstudio = { }\nlocal toolsets = {\nvs2010 = \"v100\",\nvs2012 = \"v110\",\nvs2013 = \"v120\",\nvs2015 = \"v140\"\n}\npremake.vstudio.toolset = toolsets[_ACTION] or \"unknown?\"\nlocal vstudio = premake.vstudio\nvstudio.platforms = {\nany = \"Any CPU\",\nmixed = \"Mixed Platforms\",\nNative = \"Win32\",\nx86 = \"x86\",\nx32 = \"Win32\",\nx64 = \"x64\",\nPS3 = \"PS3\",\nXbox360 = \"Xbox 360\",\nARM = \"ARM\"\n}\nfunction vstudio.arch(prj)\nif (prj.language == \"C#\") then\nreturn \"Any CPU\"\nelse\nreturn \"Win32\"\nend\nend\nfunction vstudio.buildconfigs(sln)\nlocal cfgs = { }\nlocal platforms = premake.filterplatforms(sln, vstudio.platforms, \"Native\")\nlocal hascpp = premake.hascppproject(sln)\nlocal hasdotnet = premake.hasdotnetproject(sln)\nif hasdotnet and (_ACTION > \"vs2008\" or hascpp) then\ntable.insert(platforms, 1, \"mixed\")\nend\nif hasdotnet and (_ACTION < \"vs2010\" or not hascpp) then\ntable.insert(platforms, 1, \"any\")\nend\nif _ACTION > \"vs2008\" then\n" + "local platforms2010 = { }\nfor _, platform in ipairs(platforms) do\nif vstudio.platforms[platform] == \"Win32\" then\nif hascpp then\ntable.insert(platforms2010, platform)\nend\nif hasdotnet then\ntable.insert(platforms2010, \"x86\")\nend\nelse\ntable.insert(platforms2010, platform)\nend\nend\nplatforms = platforms2010\nend\nfor _, buildcfg in ipairs(sln.configurations) do\nfor _, platform in ipairs(platforms) do\nlocal entry = { }\nentry.src_buildcfg = buildcfg\nentry.src_platform = platform\nif platform ~= \"PS3\" or _ACTION > \"vs2008\" then\nentry.buildcfg = buildcfg\nentry.platform = vstudio.platforms[platform]\nelse\nentry.buildcfg = platform .. \" \" .. buildcfg\nentry.platform = \"Win32\"\nend\nentry.name = entry.buildcfg .. \"|\" .. entry.platform\nentry.isreal = (platform ~= \"any\" and platform ~= \"mixed\")\ntable.insert(cfgs, entry)\nend\nend\nreturn cfgs\nend\nfunction vstudio.cleansolution(sln)\npremake.clean.file(sln, \"%%.sln\")\npremake.clean.file(sln, \"%%.suo\")\npremake.clean.file(sln, \"%" + "%.ncb\")\npremake.clean.file(sln, \"%%.userprefs\")\npremake.clean.file(sln, \"%%.usertasks\")\nend\nfunction vstudio.cleanproject(prj)\nlocal fname = premake.project.getfilename(prj, \"%%\")\nos.remove(fname .. \".vcproj\")\nos.remove(fname .. \".vcproj.user\")\nos.remove(fname .. \".vcxproj\")\nos.remove(fname .. \".vcxproj.user\")\nos.remove(fname .. \".vcxproj.filters\")\nos.remove(fname .. \".csproj\")\nos.remove(fname .. \".csproj.user\")\nos.remove(fname .. \".pidb\")\nos.remove(fname .. \".sdf\")\nend\nfunction vstudio.cleantarget(name)\nos.remove(name .. \".pdb\")\nos.remove(name .. \".idb\")\nos.remove(name .. \".ilk\")\nos.remove(name .. \".vshost.exe\")\nos.remove(name .. \".exe.manifest\")\nend\nfunction vstudio.projectfile(prj)\nlocal pattern\nif prj.language == \"C#\" then\npattern = \"%%.csproj\"\nelse\npattern = iif(_ACTION > \"vs2008\", \"%%.vcxproj\", \"%%.vcproj\")\nend\nlocal fname = premake.project.getbasename(prj.name, pattern)\nfname = path.join(prj.location, fname)\nreturn fname\nend\n" + "function vstudio.tool(prj)\nif (prj.language == \"C#\") then\nreturn \"FAE04EC0-301F-11D3-BF4B-00C04F79EFBC\"\nelse\nreturn \"8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942\"\nend\nend\nnewaction {\ntrigger = \"vs2008\",\nshortname = \"Visual Studio 2008\",\ndescription = \"Generate Microsoft Visual Studio 2008 project files\",\nos = \"windows\",\nvalid_kinds = { \"ConsoleApp\", \"WindowedApp\", \"StaticLib\", \"SharedLib\" },\nvalid_languages = { \"C\", \"C++\", \"C#\" },\nvalid_tools = {\ncc = { \"msc\" },\ndotnet = { \"msnet\" },\n},\nonsolution = function(sln)\npremake.generate(sln, \"%%.sln\", vstudio.sln2005.generate)\nend,\nonproject = function(prj)\nif premake.isdotnetproject(prj) then\npremake.generate(prj, \"%%.csproj\", vstudio.cs2005.generate)\npremake.generate(prj, \"%%.csproj.user\", vstudio.cs2005.generate_user)\nelse\npremake.generate(prj, \"%%.vcproj\", vstudio.vc200x.generate)\npremake.generate(prj, \"%%.vcproj.user\", vstudio.vc200x.generate_user)\nend\nend" + ",\noncleansolution = vstudio.cleansolution,\noncleanproject = vstudio.cleanproject,\noncleantarget = vstudio.cleantarget,\nvstudio = {\nproductVersion = \"9.0.21022\",\nsolutionVersion = \"10\",\ntoolsVersion = \"3.5\",\n}\n}\nnewaction\n{\ntrigger = \"vs2010\",\nshortname = \"Visual Studio 2010\",\ndescription = \"Generate Microsoft Visual Studio 2010 project files\",\nos = \"windows\",\nvalid_kinds = { \"ConsoleApp\", \"WindowedApp\", \"StaticLib\", \"SharedLib\" },\nvalid_languages = { \"C\", \"C++\", \"C#\"},\nvalid_tools = {\ncc = { \"msc\" },\ndotnet = { \"msnet\" },\n},\nonsolution = function(sln)\npremake.generate(sln, \"%%.sln\", vstudio.sln2005.generate)\nend,\nonproject = function(prj)\nif premake.isdotnetproject(prj) then\npremake.generate(prj, \"%%.csproj\", vstudio.cs2005.generate)\npremake.generate(prj, \"%%.csproj.user\", vstudio.cs2005.generate_user)\nelse\npremake.generate(prj, \"%%.vcxproj\", premake.vs2010_vcxproj)\npremake.generate(prj, " + "\"%%.vcxproj.user\", premake.vs2010_vcxproj_user)\npremake.generate(prj, \"%%.vcxproj.filters\", vstudio.vc2010.generate_filters)\nend\nend,\noncleansolution = premake.vstudio.cleansolution,\noncleanproject = premake.vstudio.cleanproject,\noncleantarget = premake.vstudio.cleantarget,\nvstudio = {\nproductVersion = \"8.0.30703\",\nsolutionVersion = \"11\",\ntargetFramework = \"4.0\",\ntoolsVersion = \"4.0\",\n}\n}\n", /* actions/vstudio/vs200x_vcproj.lua */ "premake.vstudio.vc200x = { }\nlocal vc200x = premake.vstudio.vc200x\nlocal tree = premake.tree\nlocal function bool(value)\nreturn iif(value, \"true\", \"false\")\nend\nfunction vc200x.optimization(cfg)\nlocal result = 0\nfor _, value in ipairs(cfg.flags) do\nif (value == \"Optimize\") then\nresult = 3\nelseif (value == \"OptimizeSize\") then\nresult = 1\nelseif (value == \"OptimizeSpeed\") then\nresult = 2\nend\nend\nreturn result\nend\nfunction vc200x.header(element)\nio.eol = \"\\r\\n\"\n_p('')\n_p('<%s', element)\n_p(1,'ProjectType=\"Visual C++\"')\n_p(1,'Version=\"9.00\"')\nend\nfunction vc200x.Configuration(name, cfg)\n_p(2,''\n, path.getbasename(cfg.buildtarget.name))\nend\nif cfg.flags.NoFramePointer then\n_p(3,'true')\nend\ncompile_language(cfg)\nforcedinclude_files(3,cfg);\n_p(2,'')\nend\nlocal function event_hooks(cfg)\nif #cfg.postbuildcommands> 0 then\n _p(2,'')\n_p(3,'%s',premake.esc(table.implode(cfg.postbuildcommands, \"\", \"\", \"\\r\\n\")))\n_p(2,'')\nend\nif #cfg.prebuildcommands> 0 then\n _p(2,'')\n_p(3,'%s',premake.esc(table.implode(cfg.prebuildcommands, \"\", \"\", \"\\r\\n\")))\n_p(2,'')\nend\nif #cfg.prelinkcommands> 0 then\n _p(2,'')\n_p(3,'%s',premake.esc(table.implode(cfg.prelinkcommands, \"\", \"\", \"\\r\\n\")))\n_p(2,'')\nend\nend\nlocal function additional_options(indent,cfg)\nif #cfg.linkoptions > 0 then\n_p(indent,'%s %%(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,'%s', 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,'')\n_p(2,'$(OutDir)%s',cfg.buildtarget.name)\nadditional_options(2,cfg)\nlink_target_machine(2,cfg)\n_p(1,'')\nend\nend\nlocal function import_lib(cfg)\nif cfg.kind == \"SharedLib\" then\nlocal implibname = cfg.linktarget.fullpath\n_p(3,'%s',iif(cfg.flags.NoImportLib, cfg.objectsdir .. \"\\\\\" .. path.getname(implibname), implibname))\nend\nend\nfunction vc2010.link(cfg)\n_p(2,'')\n_p(3,'%s', iif(cfg.kind == \"ConsoleApp\", \"Console\", \"Windows\"))\n_p" "(3,'%s', tostring(cfg.flags.Symbols ~= nil))\nif premake.config.isoptimizedbuild(cfg.flags) then\n_p(3,'true')\n_p(3,'true')\nend\nif cfg.kind ~= 'StaticLib' then\nvc2010.additionalDependencies(cfg)\n_p(3,'$(OutDir)%s', cfg.buildtarget.name)\nif #cfg.libdirs > 0 then\n_p(3,'%s;%%(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,'wmainCRTStartup')\nelse\n_p(3,'mainCRTStartup')\nend\nend\nimport_lib(cfg)\nlocal deffile = premake.findfile(cfg, \".def\")\nif deffile then\n_p(3,'%s', deffil" - "e)\nend\nlink_target_machine(3,cfg)\nadditional_options(3,cfg)\nend\n_p(2,'')\nend\nfunction vc2010.additionalDependencies(cfg)\nlocal links = premake.getlinks(cfg, \"system\", \"fullpath\")\nif #links > 0 then\n_p(3,'%s;%%(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,''\n,premake.esc(cfginfo.name))\nvs10_clcompile(cfg)\nresource_compile(cfg)\nitem_def_lib(cfg)\nvc2010.link(cfg)\nevent_hooks(cfg)\n_p(1,'')\nend\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\nfo" - "r file in premake.project.eachfile(prj) do\nif path.iscppfile(file.name) then\ntable.insert(sortedfiles.ClCompile, file)\nelseif path.iscppheader(file.name) then\ntable.insert(sortedfiles.ClInclude, file)\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(pr" - "j)\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,'')\nfor _, file in ipairs(files) do\n if subtype then\n _p(2,'<%s Include=\\\"%s\\\">', section, path.translate(file.name, \"\\\\\"))\n _p(3,'%s', subtype)\n _p(2,'', section)\n else\n _p(2,'<%s Include=\\\"%s\\\" />', section, path.translate(file.name, \"\\\\\"))\n end\nend\n_p(1,'')\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 i" - "pairs(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,'')\nfor _, file in ipairs(files) do\nlocal translatedpath = path.translate(file.name, \"\\\\\")\n_p(2, '', translatedpath)\n_p(3, '$(IntDir)%s.obj'\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,'Create', premake.esc(cfginfo.name))\nconfig_mappings[cfginfo] = nil --only one source file per pch\nend\nend\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 ex" - "clude == file.name then\n_p(3, 'true', premake.esc(vsconfig.name))\nend\nend\nend\n_p(2,'')\nend\n_p(1,'')\nend\nend\nfunction vc2010.header(targets)\nio.eol = \"\\r\\n\"\n_p('')\nlocal t = \"\"\nif targets then\nt = ' DefaultTargets=\"' .. targets .. '\"'\nend\n_p('', t)\nend\nfunction premake.vs2010_vcxproj(prj)\nio.indent = \" \"\nvc2010.header(\"Build\")\nvs2010_config(prj)\nvs2010_globals(prj)\n_p(1,'')\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,'')\n_p(1,'')\n_p(1,'')\nimport_props(prj)\n_p(1,'')\nvc2010.outputProperties(prj)\nitem_definitions(prj)\nvc2010.files(prj)\nvc2010.projectReferences(prj)\n_p(1,'')\n_p(1,'')\n_p(1,'')\n_p('')\nend\nfunction vc2010.projectReferences(prj)\nlocal deps = premake.getdependencies(prj)\nif #deps > 0 then\n_p(1,'')\nfor _, dep in ipairs(deps) do\nlocal deppath = path.getrelative(prj.location, vstudio.projectfile(dep))\n_p(2,'', path.translate(deppath, \"\\\\\"))\n_p(3,'{%s}', dep.uuid)\nif vstudio.toolset == \"v120_wp81\" then\n_p(3,'false')\nend\n_p(2,'')\nend\n_p(1,'')\nend\nend\nfunction vc2010.debugdir(cfg)\nif cfg.debugdir then\n_p(' %s', path.translate(cfg.debugdir, '\\\\'))\n_p(' WindowsLocalDebugger')\nend\nif cfg.debugargs then\n_p(' %s', table.concat(cfg.debugargs, \" \"))\nend\nend\nfunction vc2010.debugenvs(cfg)\nif cfg.debugenvs and #cfg.debugenvs > 0 then\n_p(2,'%s%s',table.concat(cfg.debugenvs, \"\\n\")\n,iif(cfg.flags.DebugEnvsInherit,'\\n$(LocalDebuggerEnvironment)','')\n)\nif cfg.flags.DebugEnvsDontMerge then\n_p(2,'false')\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(' ', premake.esc(cfginfo.name))\nvc2010.debugdir(cfg)\nvc2010.debugenvs(cfg)\n_p(' ')\n" - "end\n_p('')\nend\nfunction premake.vs2010_appxmanifest(prj)\nio.indent = \" \"\nio.eol = \"\\r\\n\"\n_p('')\n_p('')\n_p(1,'')\n_p(1,'')\n_p(1,'')\n_p(2,'' .. prj.name .. '')\n_p(2,'Unknown')\n_p(2,'EmptyLogo.png')\n_p(1,'')\n_p(1,'')\n_p(2,'6.3.1')\n_p(2,'6.3.1')\n_p(1,'')\n_p(1,'')\n_p(2,'')\n_p(1,'')\n_p(1,'')\n_p(2,'')\n_p(3,'')\n_p(3,'')\n_p(2,'')\n_p(1,'')\n_p('')\nend", + "e)\nend\nlink_target_machine(3,cfg)\nadditional_options(3,cfg)\nend\n_p(2,'')\nend\nfunction vc2010.additionalDependencies(cfg)\nlocal links = premake.getlinks(cfg, \"system\", \"fullpath\")\nif #links > 0 then\n_p(3,'%s;%%(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,''\n,premake.esc(cfginfo.name))\nvs10_clcompile(cfg)\nresource_compile(cfg)\nitem_def_lib(cfg)\nvc2010.link(cfg)\nevent_hooks(cfg)\n_p(1,'')\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,'')\nfor _, file in ipairs(files) do\n if subtype then\n _p(2,'<%s Include=\\\"%s\\\">', section, path.translate(file.name, \"\\\\\"))\n _p(3,'%s', subtype)\n _p(2,'', section)\n else\n _p(2,'<%s Include=\\\"%s\\\" />', section, path.translate(file.name, \"\\\\\"))\n end\nend\n_p(1,'')\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,'')\nfor _, file in ipairs(files) do\nlocal translatedpath = path.translate(file.name, \"\\\\\")\n_p(2, '', translatedpath)\n_p(3, '$(IntDir)%s.obj'\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,'Create', 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, 'true'\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, 'true'\n, premake.esc(vsconfig.name)\n)\nend\nend\nend\nend\n_p(2,'')\nend\n_p(1,'')\nend\nend\nfunction vc2010.header(targets)\nio.eol = \"\\r\\n\"\n_p('')\nlocal t = \"\"\nif targets then\nt = ' DefaultTargets=\"' .. targets .. '\"'\nend\n_p('', t)\nend\nfunction premake.vs2010_vcxproj(prj)\nio.indent = \" \"\nvc2010.header(\"Build\")\nvs2010_config(prj)\nvs2010_globals(prj)\n_p(1,'')\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,'')\n_p(1,'')\n_p(1,'')\nimport_props(prj)\n_p(1,'')\nvc2010.outputProperties(prj)\nitem_definitions(prj)\nvc2010.files(prj)\nvc2010.projectReferences(prj)\n_p(1,'')\n_p(1,'')\n_p(1,'')\n_p('')\nend\nfunction vc2010.projectReferences(prj)\nlocal deps = premake.g" + "etdependencies(prj)\nif #deps > 0 then\n_p(1,'')\nfor _, dep in ipairs(deps) do\nlocal deppath = path.getrelative(prj.location, vstudio.projectfile(dep))\n_p(2,'', path.translate(deppath, \"\\\\\"))\n_p(3,'{%s}', dep.uuid)\nif vstudio.toolset == \"v120_wp81\" then\n_p(3,'false')\nend\n_p(2,'')\nend\n_p(1,'')\nend\nend\nfunction vc2010.debugdir(cfg)\nif cfg.debugdir then\n_p(' %s', path.translate(cfg.debugdir, '\\\\'))\n_p(' WindowsLocalDebugger')\nend\nif cfg.debugargs then\n_p(' %s', table.concat(cfg.debugargs, \" \"))\nend\nend\nfunction vc2010.debugenvs(cfg)\nif cfg.debugenvs and #cfg.debugenvs > 0 then\n_p(2,'%s%s',table.concat(cfg.debugenvs, " + "\"\\n\")\n,iif(cfg.flags.DebugEnvsInherit,'\\n$(LocalDebuggerEnvironment)','')\n)\nif cfg.flags.DebugEnvsDontMerge then\n_p(2,'false')\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(' ', premake.esc(cfginfo.name))\nvc2010.debugdir(cfg)\nvc2010.debugenvs(cfg)\n_p(' ')\nend\n_p('')\nend\nfunction premake.vs2010_appxmanifest(prj)\nio.indent = \" \"\nio.eol = \"\\r\\n\"\n_p('')\n_p('')\n_p(1,'')\n_p(1,'')\n_p(1,'')\n_p(2,'' .. prj.name .. '')\n_p(2,'Unknown')\n_p(2,'EmptyLogo.png')\n_p(1,'')\n_p(1,'')\n_p(2,'6.3.1')\n_p(2,'6.3.1')\n_p(1,'')\n_p(1,'')\n_p(2,'')\n_p(1,'')\n_p(1,'')\n_p(2,'')\n_p(3,'')\n_p(3,'')\n_p(2,'')\n_p(1,'')\n_p('')\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,'')\nend\npath = path .. folders[i]\nif not filters[path] then\nfilters[path] = true\n_p(2, '', path)\n_p(3, '{%s}', os.uuid())\n_p(2, '')\nend\npath = path .. \"\\\\\"\nend\nend\nif filterfound then\n_p(1,'')\nend\nend\nfunction vc2010.filefiltergroup(prj, section)\nlocal files = vc2010.getfilegroup(prj, section)\nif #files > 0 then\n_p(1,'')\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/lua/src/luaconf.h b/3rdparty/lua/src/luaconf.h index fd28d21aec9..615f1a2da4b 100644 --- a/3rdparty/lua/src/luaconf.h +++ b/3rdparty/lua/src/luaconf.h @@ -729,6 +729,9 @@ +#ifdef __ANDROID__ +#define l_getlocaledecpoint() '.' +#endif #endif diff --git a/3rdparty/mongoose/docs/ReleaseNotes.md b/3rdparty/mongoose/docs/ReleaseNotes.md index 2b45b99a466..24874f824a0 100644 --- a/3rdparty/mongoose/docs/ReleaseNotes.md +++ b/3rdparty/mongoose/docs/ReleaseNotes.md @@ -1,5 +1,30 @@ # Mongoose Release Notes +## Release 5.6, 2015-03-17 + +Changes in Libmongoose library: + +- Added `-dav_root` configuration option that gives an ability to mount + a different root directory (not document_root) +- Fixes for build under Win23 and MinGW +- Bugfix: Double dots removal +- Bugfix: final chunked response double-send +- Fixed compilation in 64-bit environments +- Added OS/2 compatibility +- Added `getaddrinfo()` call and `NS_ENABLE_GETADDRINFO` +- Various SSL-related fixes +- Added integer overflow protection in `iobuf_append()` and `deliver_websocket_frame()` +- Fixed NetBSD build +- Enabled `NS_ENABLE_IPV6` build for Visual Studio 2008+ +- Enhanced comma detection in `parse_header()` +- Fixed unchanged memory accesses on ARM +- Added ability to use custom memory allocator through NS_MALLOC, NS_FREE, NS_REALLOC + +Changes in Mongoose binary: + +- Added `-start_browser` option to disable automatic browser launch +- Added experimental SSL support. To listen on HTTPS port, use `ssl://PORT:SSL_CERT` format. For example, to listen on HTTP port 8080 and HTTPS port 8043, use `-listening_port 8080,ssl://8043:ssl_cert.pem` + ## Release 5.5, October 28 2014 Changes in Libmongoose library: diff --git a/3rdparty/mongoose/examples/.gitignore b/3rdparty/mongoose/examples/.gitignore new file mode 100644 index 00000000000..b883f1fdc6d --- /dev/null +++ b/3rdparty/mongoose/examples/.gitignore @@ -0,0 +1 @@ +*.exe diff --git a/3rdparty/mongoose/examples/Makefile b/3rdparty/mongoose/examples/Makefile index 2964d37e9fb..43483c3f860 100644 --- a/3rdparty/mongoose/examples/Makefile +++ b/3rdparty/mongoose/examples/Makefile @@ -3,13 +3,18 @@ SUBDIRS = $(sort $(filter-out csharp/, $(dir $(wildcard */)))) X = $(SUBDIRS) +ifdef WINDIR + # appending the Winsock2 library at the end of the compiler + # invocation + CFLAGS_EXTRA += -lws2_32 +endif .PHONY: $(SUBDIRS) all: $(SUBDIRS) $(SUBDIRS): - @$(MAKE) -C $@ + @$(MAKE) CFLAGS_EXTRA="$(CFLAGS_EXTRA)" -C $@ clean: - for d in $(SUBDIRS) ; do $(MAKE) -C $$d clean ; done \ No newline at end of file + for d in $(SUBDIRS) ; do $(MAKE) -C $$d clean ; done diff --git a/3rdparty/mongoose/examples/web_server/web_server.c b/3rdparty/mongoose/examples/web_server/web_server.c index 07fda84ed17..03c13d0aab2 100644 --- a/3rdparty/mongoose/examples/web_server/web_server.c +++ b/3rdparty/mongoose/examples/web_server/web_server.c @@ -71,12 +71,7 @@ static char server_name[50]; // Set by init_server_name() static char s_config_file[PATH_MAX]; // Set by process_command_line_arguments static struct mg_server *server; // Set by start_mongoose() static const char *s_default_document_root = "."; -#ifndef NS_ENABLE_SSL static const char *s_default_listening_port = "8080"; -#else -static const char *s_default_listening_port = "ssl://8443:certs/cert.pem"; -#endif - static char **s_argv = { NULL }; static void set_options(char *argv[]); @@ -101,11 +96,8 @@ static void __cdecl signal_handler(int sig_num) { } static void vnotify(const char *fmt, va_list ap, int must_exit) { - char msg[200]; - - vsnprintf(msg, sizeof(msg), fmt, ap); - fprintf(stderr, "%s\n", msg); - + vfprintf(stderr, fmt, ap); + fputc('\n', stderr); if (must_exit) { exit(EXIT_FAILURE); } diff --git a/3rdparty/mongoose/mongoose.c b/3rdparty/mongoose/mongoose.c index f7f47cadadd..d85f6ff3c0a 100644 --- a/3rdparty/mongoose/mongoose.c +++ b/3rdparty/mongoose/mongoose.c @@ -34,8 +34,6 @@ // // Alternatively, you can license this software under a commercial // license, as set out in . -// -// $Date: 2014-09-28 05:04:41 UTC $ #ifndef NS_SKELETON_HEADER_INCLUDED #define NS_SKELETON_HEADER_INCLUDED @@ -46,7 +44,9 @@ #undef _UNICODE // Use multibyte encoding on Windows #define _MBCS // Use multibyte encoding on Windows #define _INTEGRAL_MAX_BITS 64 // Enable _stati64() on Windows +#ifndef _CRT_SECURE_NO_WARNINGS #define _CRT_SECURE_NO_WARNINGS // Disable deprecation warning in VS2005+ +#endif #undef WIN32_LEAN_AND_MEAN // Let windows.h always include winsock2.h #ifdef __Linux__ #define _XOPEN_SOURCE 600 // For flockfile() on Linux @@ -63,6 +63,14 @@ #pragma warning (disable : 4204) // missing c99 support #endif +#ifndef MONGOOSE_ENABLE_THREADS +#define NS_DISABLE_THREADS +#endif + +#ifdef __OS2__ +#define _MMAP_DECLARED // Prevent dummy mmap() declaration in stdio.h +#endif + #include #include #include @@ -80,6 +88,8 @@ #ifdef _WIN32 #ifdef _MSC_VER #pragma comment(lib, "ws2_32.lib") // Linking with winsock library +#include +typedef SSIZE_T ssize_t; #endif #include #include @@ -262,7 +272,7 @@ struct ns_connection *ns_bind(struct ns_mgr *, const char *, struct ns_connection *ns_connect(struct ns_mgr *, const char *, ns_callback_t, void *); -int ns_send(struct ns_connection *, const void *buf, int len); +int ns_send(struct ns_connection *, const void *buf, size_t len); int ns_printf(struct ns_connection *, const char *fmt, ...); int ns_vprintf(struct ns_connection *, const char *fmt, va_list ap); @@ -612,8 +622,6 @@ static int ns_resolve2(const char *host, struct in_addr *ina) { int rv = 0; struct addrinfo hints, *servinfo, *p; struct sockaddr_in *h = NULL; - char *ip = NS_MALLOC(17); - memset(ip, '\0', 17); memset(&hints, 0, sizeof hints); hints.ai_family = AF_INET; @@ -699,8 +707,8 @@ static int ns_parse_address(const char *str, union socket_address *sa, sa->sin.sin_port = htons((uint16_t) port); } - if (*use_ssl && (sscanf(str + len, ":%99[^:]:%99[^:]%n", cert, ca, &n) == 2 || - sscanf(str + len, ":%99[^:]%n", cert, &n) == 1)) { + if (*use_ssl && (sscanf(str + len, ":%99[^:,]:%99[^:,]%n", cert, ca, &n) == 2 || + sscanf(str + len, ":%99[^:,]%n", cert, &n) == 1)) { len += n; } @@ -1017,14 +1025,14 @@ static void ns_write_to_socket(struct ns_connection *conn) { } } -int ns_send(struct ns_connection *conn, const void *buf, int len) { +int ns_send(struct ns_connection *conn, const void *buf, size_t len) { return (int) ns_out(conn, buf, len); } static void ns_handle_udp(struct ns_connection *ls) { struct ns_connection nc; char buf[NS_UDP_RECEIVE_BUFFER_SIZE]; - int n; + ssize_t n; socklen_t s_len = sizeof(nc.sa); memset(&nc, 0, sizeof(nc)); @@ -1381,7 +1389,7 @@ typedef pid_t process_id_t; struct vec { const char *ptr; - int len; + size_t len; }; // For directory listing and WevDAV support @@ -1404,6 +1412,7 @@ enum { CGI_PATTERN, #endif DAV_AUTH_FILE, + DAV_ROOT, DOCUMENT_ROOT, #ifndef MONGOOSE_NO_DIRECTORY_LISTING ENABLE_DIRECTORY_LISTING, @@ -1442,6 +1451,7 @@ static const char *static_config_options[] = { "cgi_pattern", DEFAULT_CGI_PATTERN, #endif "dav_auth_file", NULL, + "dav_root", NULL, "document_root", NULL, #ifndef MONGOOSE_NO_DIRECTORY_LISTING "enable_directory_listing", "yes", @@ -1501,7 +1511,7 @@ struct connection { char *request; int64_t num_bytes_recv; // Total number of bytes received int64_t cl; // Reply content length, for Range support - int request_len; // Request length, including last \r\n after last header + ssize_t request_len; // Request length, including last \r\n after last header }; #define MG_CONN_2_CONN(c) ((struct connection *) ((char *) (c) - \ @@ -1743,9 +1753,9 @@ static int mg_snprintf(char *buf, size_t buflen, const char *fmt, ...) { // -1 if request is malformed // 0 if request is not yet fully buffered // >0 actual request length, including last \r\n\r\n -static int get_request_len(const char *s, int buf_len) { +static int get_request_len(const char *s, size_t buf_len) { const unsigned char *buf = (unsigned char *) s; - int i; + size_t i; for (i = 0; i < buf_len; i++) { // Control characters are not allowed but >=128 are. @@ -2336,7 +2346,7 @@ static void on_cgi_data(struct ns_connection *nc) { // If reply has not been parsed yet, parse it if (conn->ns_conn->flags & NSF_BUFFER_BUT_DONT_SEND) { struct iobuf *io = &conn->ns_conn->send_iobuf; - int s_len = sizeof(cgi_status) - 1; + size_t s_len = sizeof(cgi_status) - 1; int len = get_request_len(io->buf + s_len, io->len - s_len); char buf[MAX_REQUEST_SIZE], *s = buf; @@ -2428,7 +2438,9 @@ static void remove_double_dots_and_double_slashes(char *s) { // Skip all following slashes, backslashes and double-dots while (s[0] != '\0') { if (s[0] == '/' || s[0] == '\\') { s++; } - else if (s[0] == '.' && s[1] == '.') { s += 2; } + else if (s[0] == '.' && (s[1] == '/' || s[1] == '\\')) { s += 2; } + else if (s[0] == '.' && s[1] == '.' && s[2] == '\0') { s += 2; } + else if (s[0] == '.' && s[1] == '.' && (s[2] == '/' || s[2] == '\\')) { s += 3; } else { break; } } } @@ -2436,13 +2448,14 @@ static void remove_double_dots_and_double_slashes(char *s) { *p = '\0'; } -int mg_url_decode(const char *src, int src_len, char *dst, - int dst_len, int is_form_url_encoded) { - int i, j, a, b; -#define HEXTOI(x) (isdigit(x) ? x - '0' : x - 'W') +int mg_url_decode(const char *src, size_t src_len, char *dst, + size_t dst_len, int is_form_url_encoded) { + size_t i, j = 0; + int a, b; +#define HEXTOI(x) (isdigit(x) ? (x) - '0' : (x) - 'W') for (i = j = 0; i < src_len && j < dst_len - 1; i++, j++) { - if (src[i] == '%' && i < src_len - 2 && + if (src[i] == '%' && i + 2 < src_len && isxdigit(* (const unsigned char *) (src + i + 1)) && isxdigit(* (const unsigned char *) (src + i + 2))) { a = tolower(* (const unsigned char *) (src + i + 1)); @@ -2464,14 +2477,16 @@ int mg_url_decode(const char *src, int src_len, char *dst, static int is_valid_http_method(const char *s) { return !strcmp(s, "GET") || !strcmp(s, "POST") || !strcmp(s, "HEAD") || !strcmp(s, "CONNECT") || !strcmp(s, "PUT") || !strcmp(s, "DELETE") || - !strcmp(s, "OPTIONS") || !strcmp(s, "PROPFIND") || !strcmp(s, "MKCOL"); + !strcmp(s, "OPTIONS") || !strcmp(s, "PROPFIND") || !strcmp(s, "MKCOL") || + !strcmp(s, "PATCH"); } // Parse HTTP request, fill in mg_request structure. // This function modifies the buffer by NUL-terminating // HTTP request components, header names and header values. // Note that len must point to the last \n of HTTP headers. -static int parse_http_message(char *buf, int len, struct mg_connection *ri) { +static size_t parse_http_message(char *buf, size_t len, + struct mg_connection *ri) { int is_request, n; // Reset the connection. Make sure that we don't touch fields that are @@ -2479,6 +2494,8 @@ static int parse_http_message(char *buf, int len, struct mg_connection *ri) { ri->request_method = ri->uri = ri->http_version = ri->query_string = NULL; ri->num_headers = ri->status_code = ri->is_websocket = ri->content_len = 0; + if (len < 1) return ~0; + buf[len - 1] = '\0'; // RFC says that all initial whitespaces should be ingored @@ -2494,7 +2511,7 @@ static int parse_http_message(char *buf, int len, struct mg_connection *ri) { is_request = is_valid_http_method(ri->request_method); if ((is_request && memcmp(ri->http_version, "HTTP/", 5) != 0) || (!is_request && memcmp(ri->request_method, "HTTP/", 5) != 0)) { - len = -1; + len = ~0; } else { if (is_request) { ri->http_version += 5; @@ -2553,7 +2570,7 @@ const char *mg_get_header(const struct mg_connection *ri, const char *s) { } // Perform case-insensitive match of string against pattern -int mg_match_prefix(const char *pattern, int pattern_len, const char *str) { +int mg_match_prefix(const char *pattern, ssize_t pattern_len, const char *str) { const char *or_str; int len, res, i = 0, j = 0; @@ -2625,6 +2642,12 @@ void mg_template(struct mg_connection *conn, const char *s, } #ifndef MONGOOSE_NO_FILESYSTEM +static int is_dav_request(const struct connection *conn) { + const char *s = conn->mg_conn.request_method; + return !strcmp(s, "PUT") || !strcmp(s, "DELETE") || + !strcmp(s, "MKCOL") || !strcmp(s, "PROPFIND"); +} + static int must_hide_file(struct connection *conn, const char *path) { const char *pw_pattern = "**" PASSWORDS_FILE_NAME "$"; const char *pattern = conn->server->config_options[HIDE_FILES_PATTERN]; @@ -2637,19 +2660,24 @@ static int convert_uri_to_file_name(struct connection *conn, char *buf, size_t buf_len, file_stat_t *st) { struct vec a, b; const char *rewrites = conn->server->config_options[URL_REWRITES]; - const char *root = conn->server->config_options[DOCUMENT_ROOT]; + const char *root = +#ifndef MONGOOSE_NO_DAV + is_dav_request(conn) && conn->server->config_options[DAV_ROOT] != NULL ? + conn->server->config_options[DAV_ROOT] : +#endif + conn->server->config_options[DOCUMENT_ROOT]; #ifndef MONGOOSE_NO_CGI const char *cgi_pat = conn->server->config_options[CGI_PATTERN]; char *p; #endif const char *uri = conn->mg_conn.uri; const char *domain = mg_get_header(&conn->mg_conn, "Host"); - int match_len, root_len = root == NULL ? 0 : strlen(root); + size_t match_len, root_len = root == NULL ? 0 : strlen(root); // Perform virtual hosting rewrites if (rewrites != NULL && domain != NULL) { const char *colon = strchr(domain, ':'); - int domain_len = colon == NULL ? (int) strlen(domain) : colon - domain; + size_t domain_len = colon == NULL ? strlen(domain) : colon - domain; while ((rewrites = next_option(rewrites, &a, &b)) != NULL) { if (a.len > 1 && a.ptr[0] == '@' && a.len == domain_len + 1 && @@ -2709,7 +2737,7 @@ static int should_keep_alive(const struct mg_connection *conn) { (header == NULL && http_version && !strcmp(http_version, "1.1"))); } -size_t mg_write(struct mg_connection *c, const void *buf, int len) { +size_t mg_write(struct mg_connection *c, const void *buf, size_t len) { struct connection *conn = MG_CONN_2_CONN(c); ns_send(conn->ns_conn, buf, len); return conn->ns_conn->send_iobuf.len; @@ -2873,8 +2901,8 @@ static void SHA1Init(SHA1_CTX *context) { } static void SHA1Update(SHA1_CTX *context, const unsigned char *data, - uint32_t len) { - uint32_t i, j; + size_t len) { + size_t i, j; j = context->count[0]; if ((context->count[0] += len << 3) < j) @@ -2962,7 +2990,7 @@ static void send_websocket_handshake(struct mg_connection *conn, mg_write(conn, buf, strlen(buf)); } -static int deliver_websocket_frame(struct connection *conn) { +static size_t deliver_websocket_frame(struct connection *conn) { // Having buf unsigned char * is important, as it is used below in arithmetic unsigned char *buf = (unsigned char *) conn->ns_conn->recv_iobuf.buf; size_t i, len, buf_len = conn->ns_conn->recv_iobuf.len, frame_len = 0, @@ -3241,7 +3269,8 @@ static int find_index_file(struct connection *conn, char *path, const char *list = conn->server->config_options[INDEX_FILES]; file_stat_t st; struct vec filename_vec; - size_t n = strlen(path), found = 0; + size_t n = strlen(path); + int found = 0; // The 'path' given to us points to the directory. Remove all trailing // directory separator characters from the end of the path, and @@ -3255,8 +3284,12 @@ static int find_index_file(struct connection *conn, char *path, // path and see if the file exists. If it exists, break the loop while ((list = next_option(list, &filename_vec, NULL)) != NULL) { + if (path_len <= n + 2) { + continue; + } + // Ignore too long entries that may overflow path buffer - if (filename_vec.len > (int) (path_len - (n + 2))) + if (filename_vec.len > (path_len - (n + 2))) continue; // Prepare full path to the index file @@ -3324,7 +3357,8 @@ static void open_file_endpoint(struct connection *conn, const char *path, // Prepare Etag, Date, Last-Modified headers. Must be in UTC, according to // http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3 gmt_time_string(date, sizeof(date), &curtime); - gmt_time_string(lm, sizeof(lm), &st->st_mtime); + time_t t = st->st_mtime; + gmt_time_string(lm, sizeof(lm), &t); construct_etag(etag, sizeof(etag), st); n = mg_snprintf(headers, sizeof(headers), @@ -3499,7 +3533,7 @@ static int scan_directory(struct connection *conn, const char *dir, return arr_ind; } -int mg_url_encode(const char *src, size_t s_len, char *dst, size_t dst_len) { +size_t mg_url_encode(const char *src, size_t s_len, char *dst, size_t dst_len) { static const char *dont_escape = "._-$,;~()"; static const char *hex = "0123456789abcdef"; size_t i = 0, j = 0; @@ -3544,7 +3578,8 @@ static void print_dir_entry(const struct dir_entry *de) { mg_snprintf(size, sizeof(size), "%.1fG", (double) fsize / 1073741824); } } - strftime(mod, sizeof(mod), "%d-%b-%Y %H:%M", localtime(&de->st.st_mtime)); + time_t t = de->st.st_mtime; + strftime(mod, sizeof(mod), "%d-%b-%Y %H:%M", localtime(&t)); mg_url_encode(de->file_name, strlen(de->file_name), href, sizeof(href)); mg_printf_data(&de->conn->mg_conn, "%s%s" @@ -3615,8 +3650,8 @@ static void send_directory_listing(struct connection *conn, const char *dir) { static void print_props(struct connection *conn, const char *uri, file_stat_t *stp) { char mtime[64]; - - gmt_time_string(mtime, sizeof(mtime), &stp->st_mtime); + time_t t = stp->st_mtime; + gmt_time_string(mtime, sizeof(mtime), &t); mg_printf(&conn->mg_conn, "" "%s" @@ -3796,7 +3831,7 @@ static void handle_put(struct connection *conn, const char *path) { static void forward_put_data(struct connection *conn) { struct iobuf *io = &conn->ns_conn->recv_iobuf; size_t k = conn->cl < (int64_t) io->len ? conn->cl : (int64_t) io->len; // To write - int n = write(conn->endpoint.fd, io->buf, k); // Write them! + size_t n = write(conn->endpoint.fd, io->buf, k); // Write them! if (n > 0) { iobuf_remove(io, n); conn->cl -= n; @@ -4175,17 +4210,12 @@ static int is_authorized_for_dav(struct connection *conn) { return authorized; } - -static int is_dav_request(const struct connection *conn) { - const char *s = conn->mg_conn.request_method; - return !strcmp(s, "PUT") || !strcmp(s, "DELETE") || - !strcmp(s, "MKCOL") || !strcmp(s, "PROPFIND"); -} #endif // MONGOOSE_NO_AUTH -static int parse_header(const char *str, int str_len, const char *var_name, +static int parse_header(const char *str, size_t str_len, const char *var_name, char *buf, size_t buf_size) { - int ch = ' ', ch1 = ',', len = 0, n = strlen(var_name); + int ch = ' ', ch1 = ',', len = 0; + size_t n = strlen(var_name); const char *p, *end = str + str_len, *s = NULL; if (buf != NULL && buf_size > 0) buf[0] = '\0'; @@ -4226,7 +4256,7 @@ static void send_ssi_file(struct mg_connection *, const char *, FILE *, int); static void send_file_data(struct mg_connection *conn, FILE *fp) { char buf[IOBUF_SIZE]; - int n; + size_t n; while ((n = fread(buf, 1, sizeof(buf), fp)) > 0) { mg_write(conn, buf, n); } @@ -4898,7 +4928,7 @@ static void close_local_endpoint(struct connection *conn) { static void transfer_file_data(struct connection *conn) { char buf[IOBUF_SIZE]; - int n; + size_t n; // If output buffer is too big, don't send anything. Wait until // mongoose drains already buffered data to the client. @@ -4919,7 +4949,7 @@ static void transfer_file_data(struct connection *conn) { } } -int mg_poll_server(struct mg_server *server, int milliseconds) { +time_t mg_poll_server(struct mg_server *server, int milliseconds) { return ns_mgr_poll(&server->ns_mgr, milliseconds); } @@ -5115,20 +5145,38 @@ const char *mg_set_option(struct mg_server *server, const char *name, DBG(("%s [%s]", name, *v)); if (ind == LISTENING_PORT) { + char buf[500] = ""; + size_t n = 0; struct vec vec; + /* + * Ports can be specified as 0, meaning that OS has to choose any + * free port that is available. In order to pass chosen port number to + * the user, we rewrite all 0 port to chosen values. + */ while ((value = next_option(value, &vec, NULL)) != NULL) { struct ns_connection *c = ns_bind(&server->ns_mgr, vec.ptr, mg_ev_handler, NULL); - if (c== NULL) { + if (c == NULL) { error_msg = "Cannot bind to port"; break; } else { - char buf[100]; - ns_sock_to_str(c->sock, buf, sizeof(buf), 2); - NS_FREE(*v); - *v = mg_strdup(buf); + char buf2[50], cert[100], ca[100]; + union socket_address sa; + int proto, use_ssl; + + ns_parse_address(vec.ptr, &sa, &proto, &use_ssl, cert, ca); + ns_sock_to_str(c->sock, buf2, sizeof(buf2), + memchr(vec.ptr, ':', vec.len) == NULL ? 2 : 3); + + n += snprintf(buf + n, sizeof(buf) - n, "%s%s%s%s%s%s%s", + n > 0 ? "," : "", + use_ssl ? "ssl://" : "", + buf2, cert[0] ? ":" : "", cert, ca[0] ? ":" : "", ca); } } + buf[sizeof(buf) - 1] = '\0'; + NS_FREE(*v); + *v = mg_strdup(buf); #ifndef MONGOOSE_NO_FILESYSTEM } else if (ind == HEXDUMP_FILE) { server->ns_mgr.hexdump_file = *v; diff --git a/3rdparty/mongoose/mongoose.h b/3rdparty/mongoose/mongoose.h index cfe411e3e4e..a434758dea1 100644 --- a/3rdparty/mongoose/mongoose.h +++ b/3rdparty/mongoose/mongoose.h @@ -22,6 +22,7 @@ #include // required for FILE #include // required for size_t +#include // required for time_t #ifdef __cplusplus extern "C" { @@ -88,7 +89,7 @@ enum { struct mg_server *mg_create_server(void *server_param, mg_handler_t handler); void mg_destroy_server(struct mg_server **); const char *mg_set_option(struct mg_server *, const char *opt, const char *val); -int mg_poll_server(struct mg_server *, int milliseconds); +time_t mg_poll_server(struct mg_server *, int milliseconds); const char **mg_get_valid_option_names(void); const char *mg_get_option(const struct mg_server *server, const char *name); void mg_copy_listeners(struct mg_server *from, struct mg_server *to); @@ -102,7 +103,7 @@ void mg_send_status(struct mg_connection *, int status_code); void mg_send_header(struct mg_connection *, const char *name, const char *val); size_t mg_send_data(struct mg_connection *, const void *data, int data_len); size_t mg_printf_data(struct mg_connection *, const char *format, ...); -size_t mg_write(struct mg_connection *, const void *buf, int len); +size_t mg_write(struct mg_connection *, const void *buf, size_t len); size_t mg_printf(struct mg_connection *conn, const char *fmt, ...); size_t mg_websocket_write(struct mg_connection *, int opcode, @@ -128,8 +129,8 @@ int mg_parse_multipart(const char *buf, int buf_len, void *mg_start_thread(void *(*func)(void *), void *param); char *mg_md5(char buf[33], ...); int mg_authorize_digest(struct mg_connection *c, FILE *fp); -int mg_url_encode(const char *src, size_t s_len, char *dst, size_t dst_len); -int mg_url_decode(const char *src, int src_len, char *dst, int dst_len, int); +size_t mg_url_encode(const char *src, size_t s_len, char *dst, size_t dst_len); +int mg_url_decode(const char *src, size_t src_len, char *dst, size_t dst_len, int); int mg_terminate_ssl(struct mg_connection *c, const char *cert); int mg_forward(struct mg_connection *c, const char *addr); void *mg_mmap(FILE *fp, size_t size); diff --git a/3rdparty/mongoose/test/unit_test.c b/3rdparty/mongoose/test/unit_test.c index 39e36ae02ef..6492317bcbd 100644 --- a/3rdparty/mongoose/test/unit_test.c +++ b/3rdparty/mongoose/test/unit_test.c @@ -120,8 +120,8 @@ static const char *test_parse_http_message() { ASSERT(strcmp(ri.http_version, "1.1") == 0); ASSERT(ri.num_headers == 0); - ASSERT(parse_http_message(req2, sizeof(req2) - 1, &ri) == -1); - ASSERT(parse_http_message(req6, 0, &ri) == -1); + ASSERT(parse_http_message(req2, sizeof(req2) - 1, &ri) == (size_t) ~0); + ASSERT(parse_http_message(req6, 0, &ri) == (size_t) ~0); ASSERT(parse_http_message(req8, sizeof(req8) - 1, &ri) == sizeof(req8) - 1); // TODO(lsm): Fix this. Header value may span multiple lines. @@ -198,17 +198,19 @@ static const char *test_match_prefix(void) { } static const char *test_remove_double_dots() { - struct { char before[20], after[20]; } data[] = { + struct { char before[30], after[30]; } data[] = { {"////a", "/a"}, - {"/.....", "/."}, - {"/......", "/"}, + {"/.....", "/....."}, + {"/......", "/......"}, {"...", "..."}, - {"/...///", "/./"}, + {"/...///", "/.../"}, {"/a...///", "/a.../"}, {"/.x", "/.x"}, {"/\\", "/"}, {"/a\\", "/a\\"}, - {"/a\\\\...", "/a\\."}, + {"/a\\\\...", "/a\\..."}, + {"foo/x..y/././y/../../..", "foo/x..y/y/"}, + {"foo/..x", "foo/..x"}, }; size_t i; @@ -261,6 +263,7 @@ static const char *test_url_decode(void) { ASSERT(strcmp(buf, "a ") == 0); ASSERT(mg_url_decode("%61", 1, buf, sizeof(buf), 1) == 1); + printf("[%s]\n", buf); ASSERT(strcmp(buf, "%") == 0); ASSERT(mg_url_decode("%61", 2, buf, sizeof(buf), 1) == 2); diff --git a/docs/luaengine.md b/docs/luaengine.md new file mode 100644 index 00000000000..c2f2b961492 --- /dev/null +++ b/docs/luaengine.md @@ -0,0 +1,154 @@ +# Scripting MAME via LUA + +## Introduction + +It is now possible to externally drive MAME via LUA scripts. +This feature initially appeared in version 0.148, when a minimal `luaengine` +was implemented. Nowadays, the LUA interface is rich enough +to let you inspect and manipulate devices state, access CPU +registers, read and write memory, and draw a custom HUD on screen. + +Internally, MAME makes extensive use of `luabridge` to implement +this feature: the idea is to transparently expose as many of +the useful internals as possible. + +Finally, a warning: LUA API is not yet declared stable and may +suddenly change without prior notice. +However, we expose methods to let you know at runtime which API +version you are running against, and you can introspect most of the +objects at runtime. + +## Features + +The API is not yet complete, but this is a partial list of capabilities +currently available to LUA scripts: + + * machine metadata (app version, current rom, rom details) + * machine control (starting, pausing, resetting, stopping) + * machine hooks (on frame painting and on user events) + * devices introspection (device tree listing, memory and register enumeration) + * screens introspection (screens listing, screen details, frames counting) + * screen HUD drawing (text, lines, boxes on multiple screens) + * memory read/write (8/16/32/64 bits, signed and unsigned) + * registers and states control (states enumeration, get and set) + +## Usage + +MAME supports external scripting via LUA (>= 5.3) scripts, either +written on the interactive console or loaded as a file. +To reach the console, just run MAME with `-console`; you will be +greeted by a naked `>` prompt where you can input your script. + +To load a whole script at once, store it in a plaintext file and +pass it via the `-autoboot_script`. Please note that script +loading may be delayed (few seconds by default), but you can +override the default with the `-autoboot_delay` argument. + +To control the execution of your code, you can use a loop-based or +an event-based approach. The former is not encouraged as it is +resource-intensive and makes control flow unnecessarily complex. +Instead, we suggest to register custom hooks to be invoked on specific +events (eg. at each frame rendering). + +## Walktrough + +Let's first run MAME in a terminal to reach the LUA console: +``` +$ mame -console YOUR_ROM +M.A.M.E. v0.158 (Feb 5 2015) - Multiple Arcade Machine Emulator +Copyright Nicola Salmoria and the MAME team +Lua 5.3.0 Copyright (C) 1994-2015 Lua.org, PUC-Rio + +> +``` + +At this point, your game is probably running in demo mode, let's pause it: +``` +> emu.pause() +> +``` +Even without textual feedback on the console, you'll notice the game is now paused. +In general, commands are quiet and only print back error messages. + +You can check at runtime which version of MAME you are running, with: +``` +> print(emu.app_name() .. " " .. emu.app_version()) +mame 0.158 +``` + +We now start exploring screen related methods. First, let's enumerate available screens: +``` +> for i,v in pairs(manager:machine().screens) do print(i) end +:screen +``` + +`manager:machine()` is the root object of your currently running machine: +we will be using this often. `screens` is a table with all available screens; +most machines only have one main screen. +In our case, the main and only screen is tagged as `:screen`, and we can further +inspect it: +``` +> -- let's define a shorthand for the main screen +> s = manager:machine().screens[":screen"] +> print(s:width() .. "x" .. s:height()) +320x224 +``` + +We have several methods to draw on the screen a HUD composed of lines, boxes and text: +``` +> -- we define a HUD-drawing function, and then call it +> function draw_hud() +>> s:draw_text(40, 40, "foo"); -- (x0, y0, msg) +>> s:draw_box(20, 20, 80, 80, 0, 0xff00ffff); -- (x0, y0, x1, y1, fill-color, line-color) +>> s:draw_line(20, 20, 80, 80, 0xff00ffff); -- (x0, y0, x1, y1, line-color) +>> end +> draw_hud(); +``` + +This will draw some useless art on the screen. However, when unpausing the game, your HUD +needs to be refreshed otherwise it will just disappear. In order to do this, you have to register +your hook to be called on every frame repaint: +``` +> emu.sethook(draw_hud, "frame") +``` + +Similarly to screens, you can inspect all the devices attached to a +machine: +``` +> for k,v in pairs(manager:machine().devices) do print(k) end +:audiocpu +:maincpu +:saveram +:screen +:palette +[...] +``` + +On some of them, you can also inspect and manipulate memory and state: +``` +> cpu = manager:machine().devices[":maincpu"] +> -- enumerate, read and write state registers +> for k,v in pairs(cpu.state) do print(k) end +D5 +SP +A4 +A3 +D0 +PC +[...] +> print(cpu.state["D0"].value) +303 +> cpu.state["D0"].value = 255 +> print(cpu.state["D0"].value) +255 +``` + +``` +> -- inspect memory +> for k,v in pairs(cpu.spaces) do print(k) end +program +> mem = cpu.spaces["program"] +> print(mem:read_i8(0xC000)) +41 +``` + diff --git a/hash/gamegear.xml b/hash/gamegear.xml index ca0baf647d3..922f8cabdbc 100644 --- a/hash/gamegear.xml +++ b/hash/gamegear.xml @@ -648,7 +648,7 @@ A few games have been listed as rumored, but they might very well be fake (pleas - + Barbie Super Model (Prototype) 1993 Hi Tech Expressions @@ -3222,7 +3222,7 @@ a certain item) --> - Hyokkori Hyoutanjima - Hyoutanjima no Daikoukai (Jpn) + Hyokkori Hyoutan-jima - Hyoutan-jima no Daikoukai (Jpn) 1992 Sega diff --git a/hash/gameking.xml b/hash/gameking.xml index 5ab4e90c849..40814f502d0 100644 --- a/hash/gameking.xml +++ b/hash/gameking.xml @@ -10,8 +10,8 @@ 200? TimeTop - - + + @@ -21,8 +21,8 @@ 200? TimeTop - - + + @@ -32,8 +32,8 @@ 200? TimeTop - - + + @@ -43,8 +43,8 @@ 200? TimeTop - - + + @@ -54,8 +54,30 @@ 200? TimeTop - - + + + + + + + + F1-2004 Racing + 200? + TimeTop + + + + + + + + + Feichuan VII + 200? + TimeTop + + + @@ -65,8 +87,8 @@ 200? TimeTop - - + + @@ -76,8 +98,8 @@ 200? TimeTop - - + + @@ -87,8 +109,8 @@ 200? TimeTop - - + + @@ -98,8 +120,8 @@ 200? TimeTop - - + + @@ -109,19 +131,30 @@ 200? TimeTop - - + + - + + Soldier + 200? + TimeTop + + + + + + + + Street Hero 200? TimeTop - - + + @@ -131,8 +164,8 @@ 200? TimeTop - - + + @@ -142,12 +175,10 @@ 200? TimeTop - - + + - - diff --git a/hash/gba.xml b/hash/gba.xml index 4056ff8c2c4..2cc71b2965f 100644 --- a/hash/gba.xml +++ b/hash/gba.xml @@ -12294,6 +12294,17 @@ Note: In the AGB-E05-XX and AGB-E06-XX pcbs, the chip name is hidden under the b + + Frank Herbert's Dune - Ornithopter Assault (Prototype) + 200? + Cryo + + + + + + + Dungeons & Dragons - Eye of the Beholder (Euro) 2002 diff --git a/hash/gbcolor.xml b/hash/gbcolor.xml index e3adff12197..b5b08df1930 100644 --- a/hash/gbcolor.xml +++ b/hash/gbcolor.xml @@ -23650,6 +23650,21 @@ These were produced between 2000 and 2001 by Rocket Games, run by Datel Design --> + + Emo Cheng DX (Chi) + 200? + Sintax + + + + + + + + + + + Shui Hu Shen Shou (Chi, Li Cheng) 200? @@ -24104,7 +24119,7 @@ These were produced between 2000 and 2001 by Rocket Games, run by Datel Design - + @@ -24120,7 +24135,7 @@ These were produced between 2000 and 2001 by Rocket Games, run by Datel Design - + @@ -24136,7 +24151,7 @@ These were produced between 2000 and 2001 by Rocket Games, run by Datel Design - + @@ -24152,7 +24167,7 @@ These were produced between 2000 and 2001 by Rocket Games, run by Datel Design - + @@ -24353,7 +24368,7 @@ These were produced between 2000 and 2001 by Rocket Games, run by Datel Design - + Pian Wai Zhang Huang Jin no Taiyou - Feng Yin De Yuan Gu Lian Jin Shu (Chi) @@ -24370,7 +24385,7 @@ These were produced between 2000 and 2001 by Rocket Games, run by Datel Design - + Yong Zhe Dou E Long VIII (Chi) 200? @@ -24607,7 +24622,7 @@ These were produced between 2000 and 2001 by Rocket Games, run by Datel Design - Tai Kong Bao Bei (Chi, Syntax) + Tai Kong Bao Bei (Chi, Sintax) 200? Sintax diff --git a/hash/megadriv.xml b/hash/megadriv.xml index 53778e75620..29d1e3ee77c 100644 --- a/hash/megadriv.xml +++ b/hash/megadriv.xml @@ -9583,7 +9583,7 @@ Info on Sega chip labels (from Sunbeam / Digital Corruption) - Skitchin (Euro, USA) + Skitchin' (Euro, USA) 1993 Electronic Arts @@ -9748,7 +9748,7 @@ but dumps still have to be confirmed. - AAAHH!!! Real Monsters (USA) + Aaahh!!! Real Monsters (USA) 1995 Viacom New Media @@ -9759,7 +9759,7 @@ but dumps still have to be confirmed. - AAAHH!!! Real Monsters (USA, Prototype 19950707) + Aaahh!!! Real Monsters (USA, Prototype 19950707) 1995 Viacom New Media @@ -10336,7 +10336,7 @@ but dumps still have to be confirmed. - Out of this World (Prototype) + Out of This World (Prototype) 1993 Virgin Games @@ -12991,6 +12991,17 @@ but dumps still have to be confirmed. + + Cross Fire (USA, Prototype) + 1991 + Kyugo Boueki + + + + + + + Super Airwolf (Jpn) 1991 @@ -16197,7 +16208,7 @@ but dumps still have to be confirmed. - Hyokkori Hyoutan Jima - Daitouryou o Mezase! (Jpn) + Hyokkori Hyoutan-jima - Daitouryou o Mezase! (Jpn) 1992 Sega diff --git a/hash/nes.xml b/hash/nes.xml index fedefc1e288..cac46e99d03 100644 --- a/hash/nes.xml +++ b/hash/nes.xml @@ -9553,7 +9553,7 @@ - + Dragon Ball 3 - Gokuu Den (Jpn) 1989 Bandai @@ -17078,7 +17078,7 @@ - Hyokkori Hyoutan Jima - Nazo no Kaizokusen (Jpn) + Hyokkori Hyoutan-jima - Nazo no Kaizokusen (Jpn) 1992 Yutaka @@ -45102,6 +45102,25 @@ preliminary proto for the PAL version, still running on NTSC systems) or the gfx + + Dragon Ball 3 - Gokuu Den (Jpn, Rev. A) + 1989 + Bandai + + + + + + + + + + + + + + + Dragon Ninja (Jpn, Rev. A) 1989 @@ -45822,7 +45841,7 @@ preliminary proto for the PAL version, still running on NTSC systems) or the gfx - GeGeGe no Kitarou - Youkai Dai Makyou (Jpn, Prototype) + GeGeGe no Kitarou - Youkai Daimakyou (Jpn, Prototype) 1986 Bandai @@ -50353,6 +50372,22 @@ preliminary proto for the PAL version, still running on NTSC systems) or the gfx + + Wang Pai Hai Zhan (Chi) + 19?? + TCL + + + + + + + + + + + + @@ -55148,6 +55183,27 @@ preliminary proto for the PAL version, still running on NTSC systems) or the gfx + + Kou Dai Guai Shou - Fei Cui Ban (Chi) + 19?? + Shenzen Jincota + + + + + + + + + + + + + + + + + Yong Zhe Hei An Shi Jie - Hun Dun De Shi Jie (Chi) 19?? @@ -55170,6 +55226,69 @@ preliminary proto for the PAL version, still running on NTSC systems) or the gfx + + Kou Dai Guai Shou - Zuan Shi Ban (KT-008 PCB) + 19?? + Shenzen Jincota + + + + + + + + + + + + + + + + + + + Kou Dai Guai Shou - Zhen Zhu Ban (KT-008 PCB, Alt) + 19?? + Shenzen Jincota + + + + + + + + + + + + + + + + + + + Kou Dai Guai Shou - Bai jin Ban (KT-008 PCB, Alt 2) + 19?? + Shenzen Jincota + + + + + + + + + + + + + + + + + @@ -55931,7 +56050,29 @@ preliminary proto for the PAL version, still running on NTSC systems) or the gfx - + + San Guo Zhi - Lv Bu Zhuan (Chi) + 19?? + Nanjing + + + + + + + + + + + + + + + + + + + @@ -56111,7 +56252,24 @@ preliminary proto for the PAL version, still running on NTSC systems) or the gfx - + + + Gardman (Chi) + 19?? + Nanjing + + + + + + + + + + + + + Primitive (Chi) @@ -56131,7 +56289,23 @@ preliminary proto for the PAL version, still running on NTSC systems) or the gfx - + + Primitive II (Chi) + 19?? + Nanjing + + + + + + + + + + + + + Zelda - Shen Qi De Mao Zi (Chi) @@ -56712,7 +56886,30 @@ preliminary proto for the PAL version, still running on NTSC systems) or the gfx - + + + Yong Zhe Chuan Shuo (Chi) + 19?? + Nanjing + + + + + + + + + + + + + + + + + + + @@ -56975,8 +57172,29 @@ preliminary proto for the PAL version, still running on NTSC systems) or the gfx - - Kou Dai Guai Shou (Chi) + + Kou Dai Guai Shou (Chi, Pokemon Diamond, ABC-51PCB) + 19?? + HengGedianzi? + + + + + + + + + + + + + + + + + + + Kou Dai Guai Shou (Chi, Pokemon Diamond II) 19?? HengGedianzi? @@ -56996,6 +57214,90 @@ preliminary proto for the PAL version, still running on NTSC systems) or the gfx + + Kou Dai Guai Shou III (Chi, ABC-51PCB) + 19?? + HengGedianzi? + + + + + + + + + + + + + + + + + + + Kou Dai Guai Shou - Luye Ban (Chi, BBC-21 PCB) + 19?? + HengGedianzi? + + + + + + + + + + + + + + + + + + + Kou Dai Yao Guai - Luye Ban (Chi, BBC-2 PCB) + 19?? + HengGedianzi? + + + + + + + + + + + + + + + + + + + Kou Dai Guai Shou - Luye Ban (Chi, BBC-21 PCB, Alt Title) + 19?? + HengGedianzi? + + + + + + + + + + + + + + + + + @@ -57083,6 +57385,27 @@ preliminary proto for the PAL version, still running on NTSC systems) or the gfx + + Ying Tao Xiao Wan Zi (Asia) + 19?? + Union Bond + + + + + + + + + + + + + + + + + Yuefei Chuan (Asia, Hacked) 19?? @@ -63134,6 +63457,22 @@ from the NEStopia source, hence they would require confirmation. --> + + Desert Storm (Chi, Alt) + 19?? + <unknown> + + + + + + + + + + + + Dian Shi Ma Li (Chi) 19?? @@ -63424,6 +63763,22 @@ from the NEStopia source, hence they would require confirmation. --> + + Happy Biqi - The World Fighter (Chi, Alt) + 19?? + <unknown> + + + + + + + + + + + + + + 120 in 1 + 19?? + <unknown> + + + + + + + + + + + + 126 in 1 19?? @@ -75133,10 +75520,10 @@ be better to redump them properly. --> - + - + @@ -75149,10 +75536,10 @@ be better to redump them properly. --> - + - + @@ -75385,10 +75772,10 @@ be better to redump them properly. --> - + - + @@ -75401,10 +75788,10 @@ be better to redump them properly. --> - + - + @@ -75642,10 +76029,10 @@ be better to redump them properly. --> - + - + @@ -75661,10 +76048,10 @@ be better to redump them properly. --> - + - + @@ -75677,10 +76064,10 @@ be better to redump them properly. --> - + - + @@ -75696,10 +76083,10 @@ be better to redump them properly. --> - + - + @@ -75747,10 +76134,10 @@ be better to redump them properly. --> - + - + @@ -75847,10 +76234,10 @@ be better to redump them properly. --> - + - + @@ -76218,10 +76605,10 @@ be better to redump them properly. --> - + - + @@ -76234,10 +76621,10 @@ be better to redump them properly. --> - + - + @@ -76250,10 +76637,10 @@ be better to redump them properly. --> - + - + @@ -76266,10 +76653,10 @@ be better to redump them properly. --> - + - + @@ -76282,10 +76669,10 @@ be better to redump them properly. --> - + - + @@ -76346,10 +76733,10 @@ be better to redump them properly. --> - + - + @@ -76357,6 +76744,26 @@ be better to redump them properly. --> + + + 4 in 1 (YH-481) + 19?? + <unknown> + + + + + + + + + + + + + + + 4 in 1 1993 (CK-001) @@ -76681,10 +77088,10 @@ be better to redump them properly. --> - + - + @@ -76895,10 +77302,10 @@ be better to redump them properly. --> - + - + @@ -77045,10 +77452,10 @@ be better to redump them properly. --> - + - + @@ -77483,10 +77890,10 @@ be better to redump them properly. --> - + - + @@ -77734,10 +78141,10 @@ be better to redump them properly. --> - + - + @@ -77753,10 +78160,10 @@ be better to redump them properly. --> - + - + @@ -77788,10 +78195,10 @@ be better to redump them properly. --> - + - + @@ -77993,10 +78400,10 @@ to check why this is different --> - + - + @@ -78012,10 +78419,10 @@ to check why this is different --> - + - + @@ -78114,10 +78521,10 @@ to check why this is different --> - + - + @@ -78284,10 +78691,10 @@ to check why this is different --> - + - + @@ -78300,10 +78707,10 @@ to check why this is different --> - + - + @@ -78606,10 +79013,10 @@ to check why this is different --> - + - + @@ -78622,10 +79029,10 @@ to check why this is different --> - + - + @@ -79135,7 +79542,7 @@ that the real dumps might surface --> - + @@ -79151,7 +79558,7 @@ that the real dumps might surface --> - + @@ -79167,7 +79574,7 @@ that the real dumps might surface --> - + @@ -79241,14 +79648,78 @@ that the real dumps might surface --> + + 138-in-1 CoolBaby (CoolBoy RS-5, PCB060-10009011V1.3) + 19?? + <unknown> + + + + + + + + + + + + + + 777777-in-1 (8 bit Slim Station, NEWPXP-DVT22-A PCB)(Unl)[U][!] + 19?? + <unknown> + + + + + + + + + + + + + + 888888-in-1 (8 bit Slim Station, NEWPXP-DVT22-A PCB) + 19?? + <unknown> + + + + + + + + + + + + + + 999999-in-1 (8 bit Slim Station, NEWPXP-DVT22-A PCB) + 19?? + <unknown> + + + + + + + + + + + + CoolBoy 400 in 1 19?? <unknown> - - + + @@ -79258,6 +79729,39 @@ that the real dumps might surface --> + + CoolBoy 400-in-1 (Alt Version, 403 games) + 19?? + <unknown> + + + + + + + + + + + + + + Super Game 360-in-1 + 19?? + <unknown> + + + + + + + + + + + + + Games Xplosion 121 in 1 19?? @@ -79274,6 +79778,32 @@ that the real dumps might surface --> + + + + + Pokemon HeartGold (KT-008 PCB) + 19?? + Shenzen Jincota + + + + + + + + + + + + + + + + + + + Datach Joint ROM System @@ -79337,3 +79867,4 @@ that the real dumps might surface --> + diff --git a/hash/pc8801_flop.xml b/hash/pc8801_flop.xml index 59b9a311887..cb6a34365c2 100644 --- a/hash/pc8801_flop.xml +++ b/hash/pc8801_flop.xml @@ -9657,6 +9657,20 @@ ExtractDisk [08]"下巻 ユーザー " -> "aaa_08.d88" + + Door Door mkII (Alt) + 1985 + エニックス (Enix) + + + + + + + + + + Dororo - Jigoku Emaki no Shou 1988 diff --git a/hash/pc98.xml b/hash/pc98.xml index b95ebc2c2ed..ffa860560f1 100644 --- a/hash/pc98.xml +++ b/hash/pc98.xml @@ -380,8 +380,8 @@ only have some part of Windows file and a Video driver(CLGD?). - - Windows 2.1 + + Windows 2.11 19?? <unknown> @@ -410,6 +410,36 @@ only have some part of Windows file and a Video driver(CLGD?). + + Windows 2.11 (Alt Disk 1) + 19?? + <unknown> + + + + + + + + + + + + + + + + + + + + + + + + + + EPSON Microsoft Windows 3.0 1991 @@ -739,6 +769,30 @@ only have some part of Windows file and a Video driver(CLGD?). + + Turbo C + 1989 + Borland + + + + + + + + + + + + + + + + + + + + Turbo C++ @@ -788,6 +842,30 @@ only have some part of Windows file and a Video driver(CLGD?). + + Turbo C++ (Alt Disk 1) + 1990 + Borland + + + + + + + + + + + + + + + + + + + + Microfocus Level II COBOL 19?? @@ -2458,6 +2536,32 @@ only have some part of Windows file and a Video driver(CLGD?). + + Abunai Tengu Densetsu - Yomigaetta Tengu ga Yozora o Mau + 1989 + アリスソフト (AliceSoft) + + + + + + + + + + + + + + + + + + + + + + AcroJet 1988 @@ -3259,6 +3363,32 @@ only have some part of Windows file and a Video driver(CLGD?). + + Alantia + 1988 + ビクター音楽産業 (Victor Musical Industries) + + + + + + + + + + + + + + + + + + + + + + Albatross 2 - Masters' History 1989 @@ -8974,6 +9104,32 @@ only have some part of Windows file and a Video driver(CLGD?). + + Crescent Moon Girl (Alt Format) + 1989 + アリスソフト (AliceSoft) + + + + + + + + + + + + + + + + + + + + + + Crimson 3 1990 @@ -9753,6 +9909,26 @@ only have some part of Windows file and a Video driver(CLGD?). + + D.P.S. - Dream Program System (Alt) + 1989 + アリスソフト (Alicesoft) + + + + + + + + + + + + + + + + D.P.S. SG - Dream Program System SG 1990 @@ -9817,6 +9993,38 @@ only have some part of Windows file and a Video driver(CLGD?). + + D.P.S. SG 3 - Dream Program System SG Set 3 + 1991 + アリスソフト (Alicesoft) + + + + + + + + + + + + + + + + + + + + + + + + + + + + D.Wars 1989 @@ -9972,6 +10180,50 @@ only have some part of Windows file and a Video driver(CLGD?). + + Daikaisen Solomon 1942-1943 + 1995 + システムソフト (SystemSoft) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Daikoukai Jidai 1990 @@ -11171,6 +11423,38 @@ only have some part of Windows file and a Video driver(CLGD?). + + Derby Stallion Expert Kit + 1994 + アスキー (ASCII) + + + + + + + + + + + + + + + + + + + + + + + + + + + + Derringer 1988 @@ -12781,6 +13065,25 @@ only have some part of Windows file and a Video driver(CLGD?). + + Dr. Stop! (Alt Format) + 1992 + アリスソフト (AliceSoft) + + + + + + + + + + + + + + + Dracula Hakushaku 1992 @@ -14499,6 +14802,31 @@ only have some part of Windows file and a Video driver(CLGD?). + + F-117A Nighthawk - Stealth Fighter 2.0 + 1995 + スペクトラムホロバイトジャパン (Spectrum HoloByte Japan) + + + + + + + + + + + + + + + + + + + + + F-14 Fleet Defender 1995 @@ -22740,6 +23068,19 @@ only have some part of Windows file and a Video driver(CLGD?). + + Lightning Bacchus - The Knight of Iron + 1989 + NCS + + + + + + + + + Like 1994 @@ -22889,6 +23230,26 @@ only have some part of Windows file and a Video driver(CLGD?). + + Little Vampire + 1988 + チャンピオンソフト (Champion Soft) + + + + + + + + + + + + + + + + Lodoss Tou Senki - Fukujinzuke 2 1992 @@ -23031,11 +23392,11 @@ only have some part of Windows file and a Video driver(CLGD?). - - LOGiN Disk & Book Series - SimAnt + + LOGiN Disk & Book Series - SimAnt (Alt) 1993 アスキー (ASCII) - + @@ -26524,6 +26885,44 @@ Requires MS-DOS 5.00H plus an unknown procedure (HDD install?) + + Mugen Houyou + 1995 + アリスソフト (AliceSoft) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Mugen Senshi Valis 1987 @@ -29745,6 +30144,32 @@ Requires MS-DOS 5.00H plus an unknown procedure (HDD install?) + + Popful Mail + 1992 + 日本ファルコム (Nihon Falcom) + + + + + + + + + + + + + + + + + + + + + + Populous 1990 @@ -31459,6 +31884,82 @@ Requires MS-DOS 5.00H plus an unknown procedure (HDD install?) + + Rance - Hikari o Motomete + 1989 + アリスソフト (AliceSoft) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Rance II - Hangyaku no Shoujo-tachi + 1990 + アリスソフト (AliceSoft) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Rance 3 Hint Disk 1992 @@ -31505,6 +32006,64 @@ Requires MS-DOS 5.00H plus an unknown procedure (HDD install?) + + Rance 4.1 - Okusuri Koujou o Sukue (Alt Format) + 1995 + アリスソフト (AliceSoft) + + + + + + + + + + + + + + + + + + + + + + + + Rance 4.2 - Angel Gumi + 1995 + アリスソフト (AliceSoft) + + + + + + + + + + + + + + + + + + + + + + + + + + + + Ranma½ - Ougi Jaanken 1995 @@ -34134,6 +34693,18 @@ Requires MS-DOS 5.00H plus an unknown procedure (HDD install?) + + Shin Best Nine Baseball + 1986 + アスキー (ASCII) + + + + + + + + Shin Kugyokuden 1988 @@ -35001,6 +35572,19 @@ Requires MS-DOS 5.00H plus an unknown procedure (HDD install?) + + Solitaire Royal + 1988 + ゲームアーツ (Game Arts) + + + + + + + + + Sorcerian 1988 @@ -35962,6 +36546,55 @@ Requires MS-DOS 5.00H plus an unknown procedure (HDD install?) + + Super D.P.S. + 1992 + アリスソフト (AliceSoft) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Super Daisenryaku 98 1988 @@ -38650,7 +39283,57 @@ Requires MS-DOS 5.00H plus an unknown procedure (HDD install?) - + + Toushin Toshi + 1990 + アリスソフト (AliceSoft) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Toushin Toshi Hint Disk 19?? アリスソフト (AliceSoft) @@ -38662,6 +39345,80 @@ Requires MS-DOS 5.00H plus an unknown procedure (HDD install?) + + Toushin Toshi II + 1994 + アリスソフト (AliceSoft) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The Tower? of Cabin - Cabin Panic 1992 @@ -39473,6 +40230,56 @@ Requires MS-DOS 5.00H plus an unknown procedure (HDD install?) + + Uchuu Kaitou Funny Bee (Alt Format) + 1994 + アリスソフト (AliceSoft) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Uchuu Kakeru Businessman 1990 @@ -43723,8 +44530,8 @@ Requires MS-DOS 5.00H plus an unknown procedure (HDD install?) - - Abunai Tengu Densetsu - Yomigaetta Tengu ga Yozora o Mau + + Abunai Tengu Densetsu - Yomigaetta Tengu ga Yozora o Mau (Alt Format) 1989 アリスソフト (AliceSoft) @@ -43775,8 +44582,8 @@ Requires MS-DOS 5.00H plus an unknown procedure (HDD install?) - - Alantia + + Alantia (Alt Format) 1988 ビクター音楽産業 (Victor Musical Industries) @@ -44387,7 +45194,7 @@ Requires MS-DOS 5.00H plus an unknown procedure (HDD install?) - + D.P.S. - Dream Program System (Alt Format) 1989 アリスソフト (Alicesoft) @@ -46690,6 +47497,30 @@ Requires MS-DOS 5.00H plus an unknown procedure (HDD install?) + + LOGiN Disk & Book Series - Polygon Modeling Tsukuuru (5"25 Disk) + 1992 + アスキー (ASCII) + + + + + + + + + + LOGiN Disk & Book Series - Polygon Modeling Tsukuuru (3"5 Disk) + 1992 + アスキー (ASCII) + + + + + + + + LOGiN Disk & Book Series - Polygon Shooting Tsukuuru (5"25 Disk) 1994 @@ -46785,6 +47616,32 @@ Requires MS-DOS 5.00H plus an unknown procedure (HDD install?) + + LOGiN Disk & Book Series - SimAnt (5"25 Disks) + 1993 + アスキー (ASCII) + + + + + + + + + + + LOGiN Disk & Book Series - SimAnt (3"5 Disks) + 1993 + アスキー (ASCII) + + + + + + + + + Loopz 1991 @@ -47997,8 +48854,8 @@ Requires MS-DOS 5.00H plus an unknown procedure (HDD install?) - - Rance - Hikari o Motomete + + Rance - Hikari o Motomete (Alt Format) 1989 アリスソフト (AliceSoft) @@ -48689,8 +49546,8 @@ Requires MS-DOS 5.00H plus an unknown procedure (HDD install?) - - Solitaire Royale + + Solitaire Royale (Alt Format) 1988 ゲームアーツ (Game Arts) @@ -49351,8 +50208,8 @@ Requires MS-DOS 5.00H plus an unknown procedure (HDD install?) - - Vermilion (Fixed Disks?) + + Vermilion (Alt Format) 1990 グレイト (Great) @@ -55429,8 +56286,8 @@ SPACE EMPIRE - - Mugen Houyou + + Mugen Houyou (Alt Format) 1995 アリスソフト (AliceSoft) @@ -58241,6 +59098,25 @@ SPACE EMPIRE + + Login Super Omake Disk + 1994 + <coverdisc> + + + + + + + + + + + + + + + Gekkan Pasokon+ Disk Magazine 1 19?? @@ -59016,6 +59892,124 @@ SPACE EMPIRE + + + 100 Best Freeware Programs Part 2 + 19?? + <unknown> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100 Best Freeware Programs Part 3 + 19?? + <unknown> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Free Soft Library - CG Collection 1 diff --git a/hash/pet_rom.xml b/hash/pet_rom.xml index 082bb6cb5c8..2f7cf099a17 100644 --- a/hash/pet_rom.xml +++ b/hash/pet_rom.xml @@ -92,6 +92,18 @@ + + McTerm 0.95 + 1980 + Madison Computer + + + + + + + + McTerm 1.20 1981 diff --git a/hash/pico.xml b/hash/pico.xml index 189bb62d198..280ac0f6a81 100644 --- a/hash/pico.xml +++ b/hash/pico.xml @@ -25,8 +25,6 @@ Published by Sega/Sega Toys (HPC-6*** serial codes) * クッキングピコ セット - Cooking Pico Set (Sega Toys - 1999xxxx - HPC-6076) * スージーちゃんとマービー おてつだい だ~いすき! - Susie-chan to Mabi - Otetsudai Daisuki! (Sega Toys - 200010xx - HPC-6089) * パソコン接続キット ピコタウンにでかけよう! - Pasokon Setsuzoku Kit PicoTown ni Dekakeyou! (Sega Toys - 20010601 - HPC-6097) -* アンパンマンのはじめてマウスピコ アンパンマンとパソコンれんしゅう! <同梱> - Anpanman no Hajimete Mouse Pico with Anpanman to Pasokon renshuu! (Sega Toys - 20020124 - HPC-6102) -* ECCジュニアの はじめてえいご Vol.3 - Happy Birthday, Patty! パティちゃんのお誕生日 - ECC Junior no Hajimete Eigo Vol. 3 - Happy Birthday, Patty! - Patty-chan no Otanjoubi (Sega Toys - 20020307 - HPC-6105) * ECCジュニアの はじめてえいご Vol.4 - Patty Loves Animals 動物大好き、パティちゃん - ECC Junior no Hajimete Eigo Vol. 4 - Patty Loves Animals - Doubutsu Daisuki, Patty-chan (Sega Toys - 200207xx - HPC-6106) * ECCジュニアの はじめてえいご Vol.5 - Merry Christmas, Patty! メリークリスマス、パティちゃん - ECC Junior no Hajimete Eigo Vol. 5 - Merry Christmas, Patty! - Merry Christmas, Patty-chan (Sega Toys - 200207xx - HPC-6107) * ECCジュニアの はじめてえいご Vol.6 - Patty Goes to the Amusement Park パティちゃん遊園地に行く - ECC Junior no Hajimete Eigo Vol. 6 - Patty Goes to the Amusement Park - Patty-chan Yuuenchi ni Iku (Sega Toys - 200207xx - HPC-6108) @@ -440,6 +438,26 @@ Published by Others (T-yyy*** serial codes, for yyy depending on the publisher) + + Anpanman to Pasokon Renshuu! (Jpn) + 2002 + Sega Toys + + + + + + + + + + + + + + + + Ashita no Nadja (Jpn) 2003 @@ -1165,8 +1183,8 @@ Published by Others (T-yyy*** serial codes, for yyy depending on the publisher) - - + + @@ -1182,8 +1200,25 @@ Published by Others (T-yyy*** serial codes, for yyy depending on the publisher) - - + + + + + + + + ECC Junior no Hajimete Eigo Vol. 3 - Happy Birthday, Patty! - Patty-chan no o-Tanjoubi (Jpn) + 2002 + Sega Toys + + + + + + + + + diff --git a/hash/sms.xml b/hash/sms.xml index b1a5020995f..39217697be6 100644 --- a/hash/sms.xml +++ b/hash/sms.xml @@ -3369,6 +3369,17 @@ + + Jang Pung II (Kor) + 1993 + Sieco + + + + + + + Jang Pung 3 (Kor) 1994 @@ -5432,6 +5443,18 @@ + + Sky Jaguar (Kor, Clover) + 199? + Clover + + + + + + + + Street Fighter II (Bra) 1997 diff --git a/hash/snes.xml b/hash/snes.xml index 2a197e1a665..31227844da0 100644 --- a/hash/snes.xml +++ b/hash/snes.xml @@ -627,7 +627,7 @@ Beyond that last category are the roms waiting to be classified. - + Batman Returns (Jpn, Prototype) 1993 @@ -6159,7 +6159,7 @@ more investigation needed... - Ardy Light Foot (USA) + Ardy Lightfoot (USA) 1996 Titus @@ -25753,7 +25753,7 @@ more investigation needed... - + Super Game Boy (Jpn) 1994 Nintendo @@ -25780,7 +25780,7 @@ more investigation needed... - + Super Game Boy (Jpn, Alt) 1994 Nintendo @@ -34600,7 +34600,7 @@ List of unclassified roms - + Barbie Vacation Adventure (USA, Prototype) 1994 Hi Tech Expressions @@ -34916,7 +34916,7 @@ List of unclassified roms - Beauty and the Beast (Euro, Prototype) + Disney's Beauty and the Beast (Euro, Prototype) 1994 Hudson @@ -34928,7 +34928,7 @@ List of unclassified roms - Beauty and the Beast (Euro) + Disney's Beauty and the Beast (Euro) 1994 Hudson @@ -43401,7 +43401,7 @@ List of unclassified roms - + Joe & Mac - Tatakae Genshijin (Jpn) 1991 Data East @@ -43636,7 +43636,7 @@ List of unclassified roms - + Jungle Strike (USA) 1995 Electronic Arts @@ -43649,7 +43649,7 @@ List of unclassified roms - + Jungle Strike - Uketsugareta Kyouki (Jpn) 1995 Electronic Arts Victor @@ -52093,6 +52093,18 @@ List of unclassified roms + + Targa (Prototype) + 1995 + Virgin Interactive + + + + + + + + Return of Double Dragon (Jpn) 1992 @@ -57680,7 +57692,7 @@ List of unclassified roms - + Super Pang (Jpn) 1992 Capcom @@ -62236,6 +62248,20 @@ List of unclassified roms + + Wolfenstein 3D (USA) + 1994 + Imagineer + + + + + + + + + + Wolfenstein 3D (USA, Prototype) 1994 @@ -62248,16 +62274,14 @@ List of unclassified roms - - Wolfenstein 3D (USA) + + Wolfenstein 3D (USA, Prototype 2) 1994 Imagineer - - - + @@ -63675,7 +63699,7 @@ List of unclassified roms - + Super Game Boy (Jpn, USA, Rev. A) 199? Nintendo diff --git a/hash/snes_strom.xml b/hash/snes_strom.xml index 5d1239ed0ba..7448b19f9e1 100644 --- a/hash/snes_strom.xml +++ b/hash/snes_strom.xml @@ -9,7 +9,7 @@ Bandai - + @@ -57,7 +57,7 @@ Bandai - + @@ -121,7 +121,7 @@ Bandai - + @@ -153,7 +153,7 @@ Bandai - + @@ -169,7 +169,7 @@ Bandai - + @@ -185,7 +185,7 @@ Bandai - + diff --git a/makefile b/makefile index 0182e22b8b8..679925826b8 100644 --- a/makefile +++ b/makefile @@ -474,6 +474,9 @@ 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 endif @@ -483,12 +486,10 @@ ifdef PROFILER DEFS += -DMAME_PROFILER endif -# dine USE_NETWORK if networking is enabled (not OS/2 and hasn't been disabled) -ifneq ($(TARGETOS),os2) +# define USE_NETWORK if networking is enabled (hasn't been disabled) ifndef DONT_USE_NETWORK DEFS += -DUSE_NETWORK endif -endif # need to ensure FLAC functions are statically linked ifeq ($(BUILD_FLAC),1) @@ -500,10 +501,6 @@ ifneq ($(BUILD_JPEGLIB),1) DEFS += -DUSE_SYSTEM_JPEGLIB endif -ifdef FASTDEBUG -DEFS += -DMAME_DEBUG_FAST -endif - # To support casting in Lua 5.3 DEFS += -DLUA_COMPAT_APIINTCASTS diff --git a/src/build/makedep.c b/src/build/makedep.c index 8e135871d09..09ca9a75b49 100644 --- a/src/build/makedep.c +++ b/src/build/makedep.c @@ -11,6 +11,7 @@ #include #include #include +#include #include "osdcore.h" #include "astring.h" #include "corefile.h" diff --git a/src/build/makemak.c b/src/build/makemak.c index 9f83357cac4..dfbd36cfef3 100644 --- a/src/build/makemak.c +++ b/src/build/makemak.c @@ -11,6 +11,7 @@ #include #include #include +#include #include "osdcore.h" #include "astring.h" #include "corefile.h" diff --git a/src/emu/bus/nes/nes_pcb.inc b/src/emu/bus/nes/nes_pcb.inc index 5feb92384e1..748e865631c 100644 --- a/src/emu/bus/nes/nes_pcb.inc +++ b/src/emu/bus/nes/nes_pcb.inc @@ -312,6 +312,7 @@ static const nes_pcb pcb_list[] = { "unl_dance", UNSUPPORTED_BOARD }, { "bmc_hik_kof", UNSUPPORTED_BOARD }, { "onebus", UNSUPPORTED_BOARD }, + { "coolboy", UNSUPPORTED_BOARD }, { "a9746", UNSUPPORTED_BOARD }, { "dance2k", UNSUPPORTED_BOARD }, { "pec586", UNSUPPORTED_BOARD }, diff --git a/src/emu/cpu/h8/h8.c b/src/emu/cpu/h8/h8.c index 3a7a3c27789..8d773ea7a5e 100644 --- a/src/emu/cpu/h8/h8.c +++ b/src/emu/cpu/h8/h8.c @@ -107,8 +107,9 @@ void h8_device::device_start() } save_item(NAME(PPC)); - save_item(NAME(PC)); save_item(NAME(NPC)); + save_item(NAME(PC)); + save_item(NAME(PIR)); save_item(NAME(IR)); save_item(NAME(R)); save_item(NAME(EXR)); diff --git a/src/emu/cpu/hmcs40/hmcs40.c b/src/emu/cpu/hmcs40/hmcs40.c index defd8a6e180..c279f07aec0 100644 --- a/src/emu/cpu/hmcs40/hmcs40.c +++ b/src/emu/cpu/hmcs40/hmcs40.c @@ -184,6 +184,9 @@ void hmcs40_cpu_device::device_start() m_prgmask = (1 << m_prgwidth) - 1; m_datamask = (1 << m_datawidth) - 1; m_pcmask = (1 << m_pcwidth) - 1; + + 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); @@ -210,6 +213,8 @@ void hmcs40_cpu_device::device_start() memset(m_stack, 0, sizeof(m_stack)); m_op = 0; m_prev_op = 0; + m_i = 0; + m_eint_line = 0; m_pc = 0; m_prev_pc = 0; m_page = 0; @@ -221,6 +226,13 @@ void hmcs40_cpu_device::device_start() m_spy = 0; m_s = 1; m_c = 0; + m_tc = 0; + m_cf = 0; + m_ie = 0; + m_iri = m_irt = 0; + memset(m_if, 0, sizeof(m_if)); + m_tf = 0; + memset(m_int, 0, sizeof(m_int)); memset(m_r, 0, sizeof(m_r)); m_d = 0; @@ -228,6 +240,8 @@ void hmcs40_cpu_device::device_start() save_item(NAME(m_stack)); save_item(NAME(m_op)); save_item(NAME(m_prev_op)); + save_item(NAME(m_i)); + save_item(NAME(m_eint_line)); save_item(NAME(m_pc)); save_item(NAME(m_prev_pc)); save_item(NAME(m_page)); @@ -239,6 +253,15 @@ void hmcs40_cpu_device::device_start() save_item(NAME(m_spy)); save_item(NAME(m_s)); save_item(NAME(m_c)); + save_item(NAME(m_tc)); + save_item(NAME(m_cf)); + save_item(NAME(m_ie)); + save_item(NAME(m_iri)); + save_item(NAME(m_irt)); + save_item(NAME(m_if)); + save_item(NAME(m_tf)); + save_item(NAME(m_int)); + save_item(NAME(m_r)); save_item(NAME(m_d)); @@ -275,6 +298,12 @@ void hmcs40_cpu_device::device_reset() 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; } @@ -286,7 +315,7 @@ void hmcs40_cpu_device::device_reset() UINT8 hmcs40_cpu_device::read_r(int index) { index &= 7; - UINT8 inp = 0xf; + UINT8 inp = 0; switch (index) { @@ -347,7 +376,7 @@ 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 << 1); + logerror("%s read from %s port R%d at $%04X\n", tag(), (index >= 4) ? "unknown" : "output", index, m_prev_pc); return hmcs40_cpu_device::read_r(index); } @@ -359,7 +388,7 @@ void hmcs43_cpu_device::write_r(int index, UINT8 data) if (index != 0 && index < 4) hmcs40_cpu_device::write_r(index, data); else - logerror("%s ineffective write to port R%d = $%X at $%04X\n", tag(), index, data & 0xf, m_prev_pc << 1); + logerror("%s ineffective write to port R%d = $%X at $%04X\n", tag(), index, data & 0xf, m_prev_pc); } int hmcs43_cpu_device::read_d(int index) @@ -367,7 +396,7 @@ 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 << 1); + logerror("%s read from output pin D%d at $%04X\n", tag(), index, m_prev_pc); return hmcs40_cpu_device::read_d(index); } @@ -381,7 +410,7 @@ 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 << 1); + logerror("%s read from unknown port R%d at $%04X\n", tag(), index, m_prev_pc); return hmcs40_cpu_device::read_r(index); } @@ -393,7 +422,7 @@ void hmcs44_cpu_device::write_r(int index, UINT8 data) if (index < 6) hmcs40_cpu_device::write_r(index, data); else - logerror("%s ineffective write to port R%d = $%X at $%04X\n", tag(), index, data & 0xf, m_prev_pc << 1); + logerror("%s ineffective write to port R%d = $%X at $%04X\n", tag(), index, data & 0xf, m_prev_pc); } // HMCS45: @@ -405,7 +434,7 @@ 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 << 1); + 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); } @@ -417,7 +446,86 @@ void hmcs45_cpu_device::write_r(int index, UINT8 data) if (index != 7) hmcs40_cpu_device::write_r(index, data); else - logerror("%s ineffective write to port R%d = $%X at $%04X\n", tag(), index, data & 0xf, m_prev_pc << 1); + logerror("%s ineffective write to port R%d = $%X at $%04X\n", tag(), index, data & 0xf, m_prev_pc); +} + + + +//------------------------------------------------- +// interrupt/timer handling +//------------------------------------------------- + +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); + if (m_iri) + m_iri = 0; + else + m_irt = 0; + + standard_irq_callback(line); +} + +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]) + { + if (!m_if[line]) + { + m_eint_line = line; + 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; +} + +void hmcs40_cpu_device::reset_prescaler() +{ + // reset 6-bit timer prescaler + attotime base = attotime::from_hz(unscaled_clock() / 4 / 64); + m_timer->adjust(base); +} + +TIMER_CALLBACK_MEMBER( hmcs40_cpu_device::simple_timer_cb ) +{ + // timer prescaler overflow + if (!m_cf) + increment_tc(); + + reset_prescaler(); +} + +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) + { + m_irt = 1; + m_tf = 1; + } } @@ -449,7 +557,16 @@ void hmcs40_cpu_device::execute_run() // 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) + do_interrupt(); // remember previous state m_prev_op = m_op; @@ -458,6 +575,7 @@ void hmcs40_cpu_device::execute_run() // fetch next opcode debugger_instruction_hook(this, m_pc); m_op = m_program->read_word(m_pc << 1) & 0x3ff; + m_i = BITSWAP8(m_op,7,6,5,4,0,1,2,3) & 0xf; // reversed bit-order for 4-bit immediate param (except for XAMR, REDD, SEDD) increment_pc(); // handle opcode @@ -470,20 +588,28 @@ void hmcs40_cpu_device::execute_run() case 0x004: case 0x005: case 0x006: case 0x007: op_sem(); break; case 0x008: case 0x009: case 0x00a: case 0x00b: -/* ok */ op_lam(); break; + op_lam(); break; case 0x010: case 0x011: case 0x012: case 0x013: case 0x014: case 0x015: case 0x016: case 0x017: case 0x018: case 0x019: case 0x01a: case 0x01b: case 0x01c: case 0x01d: case 0x01e: case 0x01f: -/* ok */ op_lmiiy(); break; + op_lmiiy(); break; case 0x020: case 0x021: case 0x022: case 0x023: op_lbm(); break; + case 0x024: + op_blem(); break; case 0x030: op_amc(); break; + case 0x034: + op_am(); break; case 0x03c: op_lta(); break; case 0x040: -/* ok */ op_lxa(); break; - case 0x04b: + op_lxa(); break; + case 0x045: + op_das(); break; + case 0x046: + op_daa(); break; + case 0x04c: op_rec(); break; case 0x04f: op_sec(); break; @@ -491,21 +617,23 @@ void hmcs40_cpu_device::execute_run() op_lya(); break; case 0x054: op_iy(); break; + case 0x058: + op_ayy(); break; case 0x060: op_lba(); break; case 0x064: op_ib(); break; 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: -/* ok */ op_lai(); break; + 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: -/* ok */ op_ai(); break; + op_ai(); break; case 0x090: -/* ok */ op_sed(); break; + op_sed(); break; case 0x094: -/* ok */ op_td(); break; + op_td(); break; case 0x0a0: op_seif1(); break; case 0x0a1: @@ -535,18 +663,22 @@ void hmcs40_cpu_device::execute_run() op_lmaiy(); break; case 0x114: case 0x115: op_lmady(); break; + case 0x118: + op_lay(); break; case 0x120: op_or(); break; + case 0x124: + op_anem(); break; case 0x140: case 0x141: case 0x142: case 0x143: case 0x144: case 0x145: case 0x146: case 0x147: case 0x148: case 0x149: case 0x14a: case 0x14b: case 0x14c: case 0x14d: case 0x14e: case 0x14f: -/* ok */ op_lxi(); break; + op_lxi(); break; case 0x150: case 0x151: case 0x152: case 0x153: case 0x154: case 0x155: case 0x156: case 0x157: case 0x158: case 0x159: case 0x15a: case 0x15b: case 0x15c: case 0x15d: case 0x15e: case 0x15f: -/* ok */ op_lyi(); break; + op_lyi(); break; case 0x160: case 0x161: case 0x162: case 0x163: case 0x164: case 0x165: case 0x166: case 0x167: case 0x168: case 0x169: case 0x16a: case 0x16b: case 0x16c: case 0x16d: case 0x16e: case 0x16f: -/* ok */ op_lbi(); break; + op_lbi(); break; 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; @@ -570,7 +702,7 @@ void hmcs40_cpu_device::execute_run() case 0x1e8: case 0x1e9: case 0x1ea: case 0x1eb: case 0x1ec: case 0x1ed: case 0x1ee: case 0x1ef: case 0x1f0: case 0x1f1: case 0x1f2: case 0x1f3: case 0x1f4: case 0x1f5: case 0x1f6: case 0x1f7: case 0x1f8: case 0x1f9: case 0x1fa: case 0x1fb: case 0x1fc: case 0x1fd: case 0x1fe: case 0x1ff: -/* ok */ op_br(); break; + op_br(); break; /* 0x200 */ @@ -585,27 +717,33 @@ void hmcs40_cpu_device::execute_run() case 0x218: case 0x219: case 0x21a: case 0x21b: case 0x21c: case 0x21d: case 0x21e: case 0x21f: op_mnei(); break; case 0x220: case 0x221: case 0x222: case 0x223: -/* ok */ op_xmb(); break; + op_xmb(); break; case 0x224: op_rotr(); break; case 0x225: op_rotl(); break; case 0x230: op_smc(); break; + case 0x234: + op_alem(); break; case 0x23c: op_lat(); break; case 0x240: op_laspx(); break; + case 0x244: + op_nega(); break; case 0x24f: op_tc(); break; case 0x250: op_laspy(); break; case 0x254: op_dy(); break; + case 0x258: + op_syy(); break; case 0x260: op_lab(); break; - case 0x264: + case 0x267: op_db(); break; case 0x270: case 0x271: case 0x272: case 0x273: case 0x274: case 0x275: case 0x276: case 0x277: case 0x278: case 0x279: case 0x27a: case 0x27b: case 0x27c: case 0x27d: case 0x27e: case 0x27f: @@ -615,7 +753,7 @@ void hmcs40_cpu_device::execute_run() case 0x288: case 0x289: case 0x28a: case 0x28b: case 0x28c: case 0x28d: case 0x28e: case 0x28f: op_ynei(); break; case 0x290: -/* ok */ op_red(); break; + op_red(); break; case 0x2a0: op_reif1(); break; case 0x2a1: @@ -628,7 +766,7 @@ void hmcs40_cpu_device::execute_run() op_retf(); break; case 0x2c0: case 0x2c1: case 0x2c2: case 0x2c3: case 0x2c4: case 0x2c5: case 0x2c6: case 0x2c7: -/* ok */ op_lra(); break; + op_lra(); break; case 0x2d0: case 0x2d1: case 0x2d2: case 0x2d3: case 0x2d4: case 0x2d5: case 0x2d6: case 0x2d7: case 0x2d8: case 0x2d9: case 0x2da: case 0x2db: case 0x2dc: case 0x2dd: case 0x2de: case 0x2df: op_redd(); break; @@ -639,21 +777,23 @@ void hmcs40_cpu_device::execute_run() /* 0x300 */ case 0x320: op_comb(); break; + case 0x324: + op_bnem(); break; case 0x340: case 0x341: case 0x342: case 0x343: case 0x344: case 0x345: case 0x346: case 0x347: case 0x348: case 0x349: case 0x34a: case 0x34b: case 0x34c: case 0x34d: case 0x34e: case 0x34f: case 0x350: case 0x351: case 0x352: case 0x353: case 0x354: case 0x355: case 0x356: case 0x357: case 0x358: case 0x359: case 0x35a: case 0x35b: case 0x35c: case 0x35d: case 0x35e: case 0x35f: -/* ok */ op_lpu(); break; + op_lpu(); break; case 0x360: case 0x361: case 0x362: case 0x363: case 0x364: case 0x365: case 0x366: case 0x367: op_tbr(); break; case 0x368: case 0x369: case 0x36a: case 0x36b: case 0x36c: case 0x36d: case 0x36e: case 0x36f: -/* ok */ op_p(); break; + op_p(); break; case 0x3a4: op_rtni(); break; case 0x3a7: -/* ok */ op_rtn(); break; + op_rtn(); break; case 0x3c0: case 0x3c1: case 0x3c2: case 0x3c3: case 0x3c4: case 0x3c5: case 0x3c6: case 0x3c7: case 0x3c8: case 0x3c9: case 0x3ca: case 0x3cb: case 0x3cc: case 0x3cd: case 0x3ce: case 0x3cf: @@ -663,7 +803,7 @@ void hmcs40_cpu_device::execute_run() case 0x3e8: case 0x3e9: case 0x3ea: case 0x3eb: case 0x3ec: case 0x3ed: case 0x3ee: case 0x3ef: 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: -/* ok */ op_cal(); break; + op_cal(); break; default: diff --git a/src/emu/cpu/hmcs40/hmcs40.h b/src/emu/cpu/hmcs40/hmcs40.h index 6e423a52879..6dd5166df87 100644 --- a/src/emu/cpu/hmcs40/hmcs40.h +++ b/src/emu/cpu/hmcs40/hmcs40.h @@ -27,6 +27,74 @@ hmcs40_cpu_device::set_write_d_callback(*device, DEVCB_##_devcb); +enum +{ + HMCS40_PORT_R0X = 0, + HMCS40_PORT_R1X, + HMCS40_PORT_R2X, + HMCS40_PORT_R3X, + HMCS40_PORT_R4X, + HMCS40_PORT_R5X, + HMCS40_PORT_R6X, + HMCS40_PORT_R7X +}; + + +// pinout reference + +/* + _________________ + D3 1 |* | 42 D2 + D4 2 | | 41 D1 + D5 3 | | 40 D0 + D6 4 | | 39 R33 + D7 5 | | 38 R32 + D8 6 | | 37 R31 + D9 7 | | 36 R30 + D10 8 | | 35 R23 ....................................... + D11 9 | | 34 R22 : + D12 10 | HD38750 | 33 R21 : + D13 11 | HD38800 | 32 R20 : + D14 12 | | 31 INT1 : + D15 13 | | 30 INT0 : _________________ + Vdisp 14 | | 29 R13 : D4 1 |* | 64 D3 + RESET 15 | | 28 R12 : D5 2 | | 63 D2 + Vbb 16 | | 27 R11 : D6 3 | | 62 D1 + Vdd 17 | | 26 R10 : D7 4 | | 61 D0 + OSC 18 | | 25 R03 : D8 5 | | 60 R63 + 19 | | 24 R02 : D9 6 | | 59 R62 + /TEST 20 | | 23 R01 : 7 | | 58 + Vss 21 |_________________| 22 R00 : 8 | | 57 + 9 | | 56 + D10 10 | | 55 R61 + D8 D7 D6 D5 D4 D3 D2 D1 D0 D11 11 | | 54 R60 + 5 4 3 2 1 54 53 52 51 50 D12 12 | | 53 R33 + __________________________________ D13 13 | | 52 R32 + / | D14 14 | | 51 R31 + D9 6 | | 49 R63 D15 15 | | 50 R30 + D10 7 | | 48 R62 R40 16 | | 49 R23 + D11 8 | | 47 R61 R41 17 | | 48 R22 + D12 9 | | 46 R60 R42 18 | | 47 R21 + D13 10 | | 45 R33 R43 19 | | 46 R20 + D14 11 | | 44 R32 R50 20 | | 45 INT1 + D15 12 | | 43 R31 R51 21 | | 44 INT0 + R40 13 | HD38820 | 42 R30 R52 22 | HD38820 | 43 R13 + R41 14 | (FP-54 pkg) | 41 R23 R53 23 | (DP-64S pkg) | 42 R12 + R42 15 | | 40 R22 Vdisp 24 | | 41 + R43 16 | | 39 R21 25 | | 40 + R50 17 | | 38 R20 RESET 26 | | 39 + R51 18 | | 37 INT1 Vbb 27 | | 38 R11 + R52 19 | | 36 INT0 Vdd 28 | | 37 R10 + R53 20 | | 35 R13 OSC 29 | | 36 R03 + Vdisp 21 | | 34 R12 30 | | 35 R02 + RESET 22 | | 33 R11 /TEST 31 | | 34 R01 + |__________________________________| Vss 32 |_________________| 33 R00 + + 23 24 25 26 27 28 29 30 31 32 + Vbb | OSC | Vss R00 | R02 | R10 + Vdd /TEST R01 R03 +*/ + class hmcs40_cpu_device : public cpu_device { @@ -76,9 +144,12 @@ protected: virtual void device_reset(); // device_execute_interface overrides + virtual UINT64 execute_clocks_to_cycles(UINT64 clocks) const { return (clocks + 4 - 1) / 4; } // 4 cycles per machine cycle + virtual UINT64 execute_cycles_to_clocks(UINT64 cycles) const { return (cycles * 4); } // " virtual UINT32 execute_min_cycles() const { return 1; } virtual UINT32 execute_max_cycles() const { return 2; } - virtual UINT32 execute_input_lines() const { return 1; } + virtual UINT32 execute_input_lines() const { return 2+1; } // 3rd one is internal + virtual void execute_set_input(int line, int state); virtual void execute_run(); // device_memory_interface overrides @@ -86,7 +157,7 @@ protected: // device_disasm_interface overrides virtual UINT32 disasm_min_opcode_bytes() const { return 2; } - virtual UINT32 disasm_max_opcode_bytes() const { return 2+1; } + virtual UINT32 disasm_max_opcode_bytes() const { return 2; } virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options); void state_string_export(const device_state_entry &entry, astring &string); @@ -107,6 +178,9 @@ protected: UINT16 m_stack[4]; // max 4 UINT16 m_op; // current opcode UINT16 m_prev_op; + UINT8 m_i; // 4-bit immediate opcode param + int m_eint_line; // which input_line caused an interrupt + emu_timer *m_timer; int m_icount; UINT16 m_pc; // Program Counter @@ -118,8 +192,16 @@ protected: UINT8 m_spx; // 1/3/4-bit SPX register UINT8 m_y; // 4-bit Y register UINT8 m_spy; // 4-bit SPY register - UINT8 m_s; // Status F/F + UINT8 m_s; // Status F/F (F/F = flip-flop) UINT8 m_c; // Carry F/F + UINT8 m_tc; // Timer/Counter + UINT8 m_cf; // CF F/F (timer mode or counter mode) + UINT8 m_ie; // I/E(Interrupt Enable) F/F + UINT8 m_iri; // external interrupt pending I/RI F/F + UINT8 m_irt; // timer interrupt pending I/RT F/F + UINT8 m_if[2]; // external interrupt mask IF0,1 F/F + UINT8 m_tf; // timer interrupt mask TF F/F + UINT8 m_int[2]; // INT0/1 pins state UINT8 m_r[8]; // R outputs state UINT16 m_d; // D pins state @@ -142,6 +224,11 @@ protected: virtual int read_d(int index); virtual void write_d(int index, int state); + void reset_prescaler(); + TIMER_CALLBACK_MEMBER( simple_timer_cb ); + void increment_tc(); + void do_interrupt(); + // opcode handlers void op_illegal(); diff --git a/src/emu/cpu/hmcs40/hmcs40d.c b/src/emu/cpu/hmcs40/hmcs40d.c index 53b4ebd292d..e16fa8ed618 100644 --- a/src/emu/cpu/hmcs40/hmcs40d.c +++ b/src/emu/cpu/hmcs40/hmcs40d.c @@ -3,6 +3,8 @@ /* Hitachi HMCS40 MCU family disassembler + + NOTE: start offset(basepc) is $3F, not 0 */ @@ -41,18 +43,18 @@ static const char *const s_mnemonics[] = "NOP", "?" }; -// number of bits per opcode parameter, -3 means (XY) parameter +// number of bits per opcode parameter, 99 means (XY) parameter, negative means reversed bit-order static const INT8 s_bits[] = { 0, 0, 0, 0, 0, 4, - 0, 0, 4, 4, 0, 0, 0, 0, -3, - -3, -3, -3, -3, -3, -3, - 4, 4, 4, - 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 4, 4, 0, 0, 4, 0, 0, + 0, 0, -4, -4, 0, 0, 0, 0, 99, + 99, 99, 99, 99, 99, 99, + -4, -4, -4, + -4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + -4, -4, 0, 0, -4, 0, 0, 2, 2, 2, 6, 6, 5, 3, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -4, 0, 0, 0, 0, 0, 0, 4, 4, 3, 3, 3, 3, 3, 0, 0 }; @@ -85,96 +87,98 @@ static const INT16 s_next_pc[0x40] = }; +#define m mILL static const UINT8 hmcs40_mnemonic[0x400] = { -/* 0 1 2 3 4 5 6 7 8 9 A B C D E F */ +/* 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, mILL, mILL, mILL, mILL, - mLMIIY, mLMIIY, mLMIIY, mLMIIY, mLMIIY, mLMIIY, mLMIIY, mLMIIY, mLMIIY, mLMIIY, mLMIIY, mLMIIY, mLMIIY, mLMIIY, mLMIIY, mLMIIY, - mLBM, mLBM, mLBM, mLBM, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, - mAMC, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mLTA, mILL, mILL, mILL, + 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, /* 0x040 */ - mLXA, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mREC, mILL, mILL, mILL, mSEC, - mLYA, mILL, mILL, mILL, mIY, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, - mLBA, mILL, mILL, mILL, mIB, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, - mLAI, mLAI, mLAI, mLAI, mLAI, mLAI, mLAI, mLAI, mLAI, mLAI, mLAI, mLAI, mLAI, mLAI, mLAI, mLAI, + 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, + 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, mILL, mILL, mILL, mTD, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, - mSEIF1, mSECF, mSEIF0, mILL, mSEIE, mSETF, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, - mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, + 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, /* 0x0c0 */ - mLAR, mLAR, mLAR, mLAR, mLAR, mLAR, mLAR, mLAR, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, - mSEDD, mSEDD, mSEDD, mSEDD, mSEDD, mSEDD, mSEDD, mSEDD, mSEDD, mSEDD, mSEDD, mSEDD, mSEDD, mSEDD, mSEDD, mSEDD, - mLBR, mLBR, mLBR, mLBR, mLBR, mLBR, mLBR, mLBR, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, - mXAMR, mXAMR, mXAMR, mXAMR, mXAMR, mXAMR, mXAMR, mXAMR, mXAMR, mXAMR, mXAMR, mXAMR, mXAMR, mXAMR, mXAMR, mXAMR, + 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, + 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 */ +/* 0 1 2 3 4 5 6 7 8 9 A B C D E F */ /* 0x100 */ - mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, - mLMAIY, mLMAIY, mILL, mILL, mLMADY, mLMADY, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, - mOR, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, - mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, + 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, + 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 */ - mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, - mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, - mTIF1, mTI1, mTIF0, mTI0, mILL, mTTF, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, - mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, + 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, - 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, + 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, + 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, -/* 0 1 2 3 4 5 6 7 8 9 A B C D E F */ +/* 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, mILL, mILL, mILL, mILL, - mMNEI, mMNEI, mMNEI, mMNEI, mMNEI, mMNEI, mMNEI, mMNEI, mMNEI, mMNEI, mMNEI, mMNEI, mMNEI, mMNEI, mMNEI, mMNEI, - mXMB, mXMB, mXMB, mXMB, mROTR, mROTL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, - mSMC, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mLAT, mILL, mILL, mILL, + 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, /* 0x240 */ - mLASPX, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mTC, - mLASPY, mILL, mILL, mILL, mDY, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, - mLAB, mILL, mILL, mILL, mDB, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, - mALEI, mALEI, mALEI, mALEI, mALEI, mALEI, mALEI, mALEI, mALEI, mALEI, mALEI, mALEI, mALEI, mALEI, mALEI, mALEI, + 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, + 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, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, - mREIF1, mRECF, mREIF0, mILL, mREIE, mRETF, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, - mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, + 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, /* 0x2c0 */ - mLRA, mLRA, mLRA, mLRA, mLRA, mLRA, mLRA, mLRA, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, - mREDD, mREDD, mREDD, mREDD, mREDD, mREDD, mREDD, mREDD, mREDD, mREDD, mREDD, mREDD, mREDD, mREDD, mREDD, mREDD, - mLRB, mLRB, mLRB, mLRB, mLRB, mLRB, mLRB, mLRB, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, - mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, + 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, -/* 0 1 2 3 4 5 6 7 8 9 A B C D E F */ +/* 0 1 2 3 4 5 6 7 8 9 A B C D E F */ /* 0x300 */ - mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, - mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, - mCOMB, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, - mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, + 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, - mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, + 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, /* 0x380 */ - mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, - mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, - mILL, mILL, mILL, mILL, mRTNI, mILL, mILL, mRTN, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, - mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, + 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, - 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 + 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, + 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 }; +#undef m @@ -186,7 +190,7 @@ CPU_DISASSEMBLE(hmcs40) INT8 bits = s_bits[instr]; // special case for (XY) opcode - if (bits == -3) + if (bits == 99) { dst += sprintf(dst, "%s", s_mnemonics[instr]); @@ -196,17 +200,29 @@ CPU_DISASSEMBLE(hmcs40) dst += sprintf(dst, "Y"); } else + { dst += sprintf(dst, "%-6s ", s_mnemonics[instr]); - // opcode parameter - if (bits > 0) - { - UINT8 param = op & ((1 << bits) - 1); - - if (bits > 5) - dst += sprintf(dst, "$%02X", param); - else - dst += sprintf(dst, "%d", param); + // opcode parameter + if (bits != 0) + { + UINT8 param = op; + + // reverse bits + if (bits < 0) + { + param = BITSWAP8(param,0,1,2,3,4,5,6,7); + 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; diff --git a/src/emu/cpu/hmcs40/hmcs40op.inc b/src/emu/cpu/hmcs40/hmcs40op.inc index 916af48f1b9..9732d86f53f 100644 --- a/src/emu/cpu/hmcs40/hmcs40op.inc +++ b/src/emu/cpu/hmcs40/hmcs40op.inc @@ -34,7 +34,7 @@ void hmcs40_cpu_device::push_stack() void hmcs40_cpu_device::op_illegal() { - logerror("%s unknown opcode $%03X at $%04X\n", tag(), m_op, m_prev_pc << 1); + logerror("%s unknown opcode $%03X at $%04X\n", tag(), m_op, m_prev_pc); } @@ -110,13 +110,13 @@ void hmcs40_cpu_device::op_lya() void hmcs40_cpu_device::op_lxi() { // LXI i: Load X from Immediate - m_x = m_op & 0xf; + m_x = m_i; } void hmcs40_cpu_device::op_lyi() { // LYI i: Load Y from Immediate - m_y = m_op & 0xf; + m_y = m_i; } void hmcs40_cpu_device::op_iy() @@ -223,20 +223,20 @@ void hmcs40_cpu_device::op_lmady() void hmcs40_cpu_device::op_lmiiy() { // LMIIY i: Load Memory from Immediate, Increment Y - ram_w(m_op & 0xf); + ram_w(m_i); op_iy(); } void hmcs40_cpu_device::op_lai() { // LAI i: Load A from Immediate - m_a = m_op & 0xf; + m_a = m_i; } void hmcs40_cpu_device::op_lbi() { // LBI i: Load B from Immediate - m_b = m_op & 0xf; + m_b = m_i; } @@ -245,7 +245,7 @@ void hmcs40_cpu_device::op_lbi() void hmcs40_cpu_device::op_ai() { // AI i: Add Immediate to A - m_a += (m_op & 0xf); + m_a += (m_i); m_s = m_a >> 4 & 1; m_a &= 0xf; } @@ -368,13 +368,13 @@ void hmcs40_cpu_device::op_or() void hmcs40_cpu_device::op_mnei() { // MNEI i: Memory Not Equal to Immediate - m_s = (ram_r() != (m_op & 0xf)); + m_s = (ram_r() != (m_i)); } void hmcs40_cpu_device::op_ynei() { // YNEI i: Y Not Equal to Immediate - m_s = (m_y != (m_op & 0xf)); + m_s = (m_y != (m_i)); } void hmcs40_cpu_device::op_anem() @@ -392,7 +392,7 @@ void hmcs40_cpu_device::op_bnem() void hmcs40_cpu_device::op_alei() { // ALEI i: A Less or Equal to Immediate - m_s = (m_a <= (m_op & 0xf)); + m_s = (m_a <= (m_i)); } void hmcs40_cpu_device::op_alem() @@ -458,7 +458,7 @@ void hmcs40_cpu_device::op_lpu() if (m_s) m_page = m_op & 0x1f; else - m_op = 0; + m_op = 0; // fake nop } void hmcs40_cpu_device::op_tbr() @@ -480,115 +480,118 @@ void hmcs40_cpu_device::op_rtn() void hmcs40_cpu_device::op_seie() { // SEIE: Set I/E - op_illegal(); + m_ie = 1; } void hmcs40_cpu_device::op_seif0() { // SEIF0: Set IF0 - op_illegal(); + m_if[0] = 1; } void hmcs40_cpu_device::op_seif1() { // SEIF1: Set IF1 - op_illegal(); + m_if[1] = 1; } void hmcs40_cpu_device::op_setf() { // SETF: Set TF - op_illegal(); + m_tf = 1; } void hmcs40_cpu_device::op_secf() { // SECF: Set CF - op_illegal(); + m_cf = 1; } void hmcs40_cpu_device::op_reie() { // REIE: Reset I/E - op_illegal(); + m_ie = 0; } void hmcs40_cpu_device::op_reif0() { // REIF0: Reset IF0 - op_illegal(); + m_if[0] = 0; } void hmcs40_cpu_device::op_reif1() { // REIF1: Reset IF1 - op_illegal(); + m_if[1] = 0; } void hmcs40_cpu_device::op_retf() { // RETF: Reset TF - op_illegal(); + m_tf = 0; } void hmcs40_cpu_device::op_recf() { // RECF: Reset CF - op_illegal(); + m_cf = 0; } void hmcs40_cpu_device::op_ti0() { // TI0: Test INT0 - op_illegal(); + m_s = m_int[0]; } void hmcs40_cpu_device::op_ti1() { // TI1: Test INT1 - op_illegal(); + m_s = m_int[1]; } void hmcs40_cpu_device::op_tif0() { // TIF0: Test IF0 - op_illegal(); + m_s = m_if[0]; } void hmcs40_cpu_device::op_tif1() { // TIF1: Test IF1 - op_illegal(); + m_s = m_if[1]; } void hmcs40_cpu_device::op_ttf() { // TTF: Test TF - op_illegal(); + m_s = m_tf; } void hmcs40_cpu_device::op_lti() { // LTI i: Load Timer/Counter from Immediate - op_illegal(); + m_tc = m_i; + reset_prescaler(); } void hmcs40_cpu_device::op_lta() { // LTA: Load Timer/Counter from A - op_illegal(); + m_tc = m_a; + reset_prescaler(); } void hmcs40_cpu_device::op_lat() { // LAT: Load A from Timer/Counter - op_illegal(); + m_a = m_tc; } void hmcs40_cpu_device::op_rtni() { // RTNI: Return from Interrupt - op_illegal(); + op_seie(); + op_rtn(); } @@ -659,13 +662,13 @@ void hmcs40_cpu_device::op_p() if (o & 0x100) { // B3 B2 B1 B0 A0 A1 A2 A3 - m_a = BITSWAP8((UINT8)o,7,6,5,4,0,1,2,3) & 0xf; + m_a = BITSWAP8(o,7,6,5,4,0,1,2,3) & 0xf; m_b = o >> 4 & 0xf; } if (o & 0x200) { // R20 R21 R22 R23 R30 R31 R32 R33 - o = BITSWAP8((UINT8)o,0,1,2,3,4,5,6,7); + o = BITSWAP8(o,0,1,2,3,4,5,6,7); write_r(2, o & 0xf); write_r(3, o >> 4 & 0xf); } diff --git a/src/emu/cpu/i386/i386.h b/src/emu/cpu/i386/i386.h index e994a7aa006..b2bcd3c0056 100644 --- a/src/emu/cpu/i386/i386.h +++ b/src/emu/cpu/i386/i386.h @@ -962,6 +962,7 @@ struct I386_CALL_GATE void pentium_cmovg_r32_rm32(); void pentium_movnti_m16_r16(); void pentium_movnti_m32_r32(); + void i386_cyrix_special(); void i386_cyrix_unknown(); void pentium_cmpxchg8b_m64(); void pentium_movntq_m64_r64(); @@ -1004,6 +1005,12 @@ struct I386_CALL_GATE void mmx_paddw_r64_rm64(); void mmx_paddd_r64_rm64(); void mmx_emms(); + void i386_cyrix_svdc(); + void i386_cyrix_rsdc(); + void i386_cyrix_svldt(); + void i386_cyrix_rsldt(); + void i386_cyrix_svts(); + void i386_cyrix_rsts(); void mmx_movd_r64_rm32(); void mmx_movq_r64_rm64(); void mmx_movd_rm32_r64(); diff --git a/src/emu/cpu/i386/i386ops.h b/src/emu/cpu/i386/i386ops.h index 6523dafd144..c540a7d3c16 100644 --- a/src/emu/cpu/i386/i386ops.h +++ b/src/emu/cpu/i386/i386ops.h @@ -329,6 +329,10 @@ const i386_device::X86_OPCODE i386_device::s_x86_opcode_table[] = { 0x32, OP_2BYTE|OP_PENTIUM, &i386_device::pentium_rdmsr, &i386_device::pentium_rdmsr, false}, { 0x38, OP_2BYTE|OP_PENTIUM, &i386_device::i386_decode_three_byte38, &i386_device::i386_decode_three_byte38,false}, { 0x3A, OP_2BYTE|OP_PENTIUM, &i386_device::i386_decode_three_byte3a, &i386_device::i386_decode_three_byte3a,false}, + { 0x3A, OP_2BYTE|OP_CYRIX, &i386_device::i386_cyrix_special, &i386_device::i386_cyrix_special, false}, + { 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}, { 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}, @@ -384,6 +388,12 @@ const i386_device::X86_OPCODE i386_device::s_x86_opcode_table[] = { 0x75, OP_2BYTE|OP_MMX, &i386_device::mmx_pcmpeqw_r64_rm64, &i386_device::mmx_pcmpeqw_r64_rm64, false}, { 0x76, OP_2BYTE|OP_MMX, &i386_device::mmx_pcmpeqd_r64_rm64, &i386_device::mmx_pcmpeqd_r64_rm64, false}, { 0x77, OP_2BYTE|OP_MMX, &i386_device::mmx_emms, &i386_device::mmx_emms, false}, + { 0x78, OP_2BYTE|OP_CYRIX, &i386_device::i386_cyrix_svdc, &i386_device::i386_cyrix_svdc, false}, + { 0x79, OP_2BYTE|OP_CYRIX, &i386_device::i386_cyrix_rsdc, &i386_device::i386_cyrix_rsdc, false}, + { 0x7a, OP_2BYTE|OP_CYRIX, &i386_device::i386_cyrix_svldt, &i386_device::i386_cyrix_svldt, false}, + { 0x7b, OP_2BYTE|OP_CYRIX, &i386_device::i386_cyrix_rsldt, &i386_device::i386_cyrix_rsldt, false}, + { 0x7c, OP_2BYTE|OP_CYRIX, &i386_device::i386_cyrix_svts, &i386_device::i386_cyrix_svts, false}, + { 0x7d, OP_2BYTE|OP_CYRIX, &i386_device::i386_cyrix_rsts, &i386_device::i386_cyrix_rsts, false}, { 0x7e, OP_2BYTE|OP_MMX, &i386_device::mmx_movd_rm32_r64, &i386_device::mmx_movd_rm32_r64, false}, { 0x7f, OP_2BYTE|OP_MMX, &i386_device::mmx_movq_rm64_r64, &i386_device::mmx_movq_rm64_r64, false}, { 0x80, OP_2BYTE|OP_I386, &i386_device::i386_jo_rel16, &i386_device::i386_jo_rel32, false}, diff --git a/src/emu/cpu/i386/pentops.inc b/src/emu/cpu/i386/pentops.inc index 348bd71becd..c7a341d9ba7 100644 --- a/src/emu/cpu/i386/pentops.inc +++ b/src/emu/cpu/i386/pentops.inc @@ -1062,6 +1062,18 @@ 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]) +*/ + + CYCLES(1); +} + void i386_device::i386_cyrix_unknown() // Opcode 0x0f 74 { logerror("Unemulated 0x0f 0x74 opcode called\n"); @@ -1970,6 +1982,262 @@ void i386_device::mmx_emms() // Opcode 0f 77 CYCLES(1); // TODO: correct cycle count } +void i386_device::i386_cyrix_svdc() // Opcode 0f 78 +{ + UINT8 modrm = FETCH(); + + if( modrm < 0xc0 ) { + UINT32 ea = GetEA(modrm,0); + int index = (modrm >> 3) & 7; + int limit; + switch (index) + { + case 0: + { + index = ES; + break; + } + + case 2: + { + index = SS; + break; + } + + case 3: + { + index = DS; + break; + } + + case 4: + { + index = FS; + break; + } + + case 5: + { + index = GS; + break; + } + + default: + { + i386_trap(6, 0, 0); + } + } + + limit = m_sreg[index].limit; + + if (m_sreg[index].flags & 0x8000) //G bit + { + limit >>= 12; + } + + WRITE16(ea + 0, limit); + WRITE32(ea + 2, m_sreg[index].base); + WRITE16(ea + 5, m_sreg[index].flags); //replace top 8 bits of base + WRITE8(ea + 7, m_sreg[index].base >> 24); + WRITE16(ea + 8, m_sreg[index].selector); + } else { + i386_trap(6, 0, 0); + } + CYCLES(1); // TODO: correct cycle count +} + +void i386_device::i386_cyrix_rsdc() // Opcode 0f 79 +{ + UINT8 modrm = FETCH(); + + if( modrm < 0xc0 ) { + UINT32 ea = GetEA(modrm,0); + int index = (modrm >> 3) & 7; + UINT16 flags; + UINT32 base; + UINT32 limit; + switch (index) + { + case 0: + { + index = ES; + break; + } + + case 2: + { + index = SS; + break; + } + + case 3: + { + index = DS; + break; + } + + case 4: + { + index = FS; + break; + } + + case 5: + { + index = GS; + break; + } + + default: + { + i386_trap(6, 0, 0); + } + } + + base = (READ32(ea + 2) & 0x00ffffff) | (READ8(ea + 7) << 24); + flags = READ16(ea + 5); + limit = READ16(ea + 0) | ((flags & 3) << 16); + + if (flags & 0x8000) //G bit + { + limit = (limit << 12) | 0xfff; + } + + m_sreg[index].selector = READ16(ea + 8); + m_sreg[index].flags = flags; + m_sreg[index].base = base; + m_sreg[index].limit = limit; + } else { + i386_trap(6, 0, 0); + } + CYCLES(1); // TODO: correct cycle count +} + +void i386_device::i386_cyrix_svldt() // Opcode 0f 7a +{ + if ( PROTECTED_MODE && !V8086_MODE ) + { + UINT8 modrm = FETCH(); + + if( !(modrm & 0xf8) ) { + UINT32 ea = GetEA(modrm,0); + UINT32 limit = m_ldtr.limit; + + if (m_ldtr.flags & 0x8000) //G bit + { + limit >>= 12; + } + + WRITE16(ea + 0, limit); + WRITE32(ea + 2, m_ldtr.base); + WRITE16(ea + 5, m_ldtr.flags); //replace top 8 bits of base + WRITE8(ea + 7, m_ldtr.base >> 24); + WRITE16(ea + 8, m_ldtr.segment); + } else { + i386_trap(6, 0, 0); + } + } else { + i386_trap(6, 0, 0); + } + CYCLES(1); // TODO: correct cycle count +} + +void i386_device::i386_cyrix_rsldt() // Opcode 0f 7b +{ + if ( PROTECTED_MODE && !V8086_MODE ) + { + if(m_CPL) + FAULT(FAULT_GP,0) + + UINT8 modrm = FETCH(); + + if( !(modrm & 0xf8) ) { + UINT32 ea = GetEA(modrm,0); + UINT16 flags = READ16(ea + 5); + UINT32 base = (READ32(ea + 2) | 0x00ffffff) | (READ8(ea + 7) << 24); + UINT32 limit = READ16(ea + 0) | ((flags & 3) << 16); + I386_SREG seg; + + if (flags & 0x8000) //G bit + { + limit = (limit << 12) | 0xfff; + } + + memset(&seg, 0, sizeof(seg)); + seg.selector = READ16(ea + 8); + i386_load_protected_mode_segment(&seg,NULL); + m_ldtr.limit = limit; + m_ldtr.base = base; + m_ldtr.flags = flags; + } else { + i386_trap(6, 0, 0); + } + } else { + i386_trap(6, 0, 0); + } + CYCLES(1); // TODO: correct cycle count +} + +void i386_device::i386_cyrix_svts() // Opcode 0f 7c +{ + if ( PROTECTED_MODE ) + { + UINT8 modrm = FETCH(); + + if( !(modrm & 0xf8) ) { + UINT32 ea = GetEA(modrm,0); + UINT32 limit = m_task.limit; + + if (m_task.flags & 0x8000) //G bit + { + limit >>= 12; + } + + WRITE16(ea + 0, limit); + WRITE32(ea + 2, m_task.base); + WRITE16(ea + 5, m_task.flags); //replace top 8 bits of base + WRITE8(ea + 7, m_task.base >> 24); + WRITE16(ea + 8, m_task.segment); + } else { + i386_trap(6, 0, 0); + } + } else { + i386_trap(6, 0, 0); + } +} + +void i386_device::i386_cyrix_rsts() // Opcode 0f 7d +{ + if ( PROTECTED_MODE ) + { + if(m_CPL) + FAULT(FAULT_GP,0) + + UINT8 modrm = FETCH(); + + if( !(modrm & 0xf8) ) { + UINT32 ea = GetEA(modrm,0); + UINT16 flags = READ16(ea + 5); + UINT32 base = (READ32(ea + 2) | 0x00ffffff) | (READ8(ea + 7) << 24); + UINT32 limit = READ16(ea + 0) | ((flags & 3) << 16); + + if (flags & 0x8000) //G bit + { + limit = (limit << 12) | 0xfff; + } + m_task.segment = READ16(ea + 8); + m_task.limit = limit; + m_task.base = base; + m_task.flags = flags; + } else { + i386_trap(6, 0, 0); + } + } else { + i386_trap(6, 0, 0); + } + CYCLES(1); // TODO: correct cycle count +} + void i386_device::mmx_movd_r64_rm32() // Opcode 0f 6e { MMXPROLOG(); diff --git a/src/emu/cpu/i386/x87ops.inc b/src/emu/cpu/i386/x87ops.inc index 545e9e8e684..c057138cb44 100644 --- a/src/emu/cpu/i386/x87ops.inc +++ b/src/emu/cpu/i386/x87ops.inc @@ -2185,13 +2185,41 @@ void i386_device::x87_fprem(UINT8 modrm) } else { - floatx80 a = ST(0); - floatx80 b = ST(1); + floatx80 a0 = ST(0); + floatx80 b1 = ST(1); m_x87_sw &= ~X87_SW_C2; - // TODO: Implement Cx bits - result = floatx80_rem(a, b); + //int d=extractFloatx80Exp(a0)-extractFloatx80Exp(b1); + int d = (a0.high & 0x7FFF) - (b1.high & 0x7FFF); + if (d < 64) { + floatx80 t=floatx80_div(a0, b1); + int64 q = floatx80_to_int64_round_to_zero(t); + floatx80 qf = int64_to_floatx80(q); + floatx80 tt = floatx80_mul(b1, qf); + result = floatx80_sub(a0, tt); + // C2 already 0 + m_x87_sw &= ~(X87_SW_C0|X87_SW_C3|X87_SW_C1); + if (q & 1) + m_x87_sw |= X87_SW_C1; + if (q & 2) + m_x87_sw |= X87_SW_C3; + if (q & 4) + m_x87_sw |= X87_SW_C0; + } + else { + m_x87_sw |= X87_SW_C2; + int n = 63; + int e = 1 << (d - n); + floatx80 ef = int32_to_floatx80(e); + floatx80 t=floatx80_div(a0, b1); + floatx80 td = floatx80_div(t, ef); + int64 qq = floatx80_to_int64_round_to_zero(td); + floatx80 qqf = int64_to_floatx80(qq); + floatx80 tt = floatx80_mul(b1, qqf); + floatx80 ttt = floatx80_mul(tt, ef); + result = floatx80_sub(a0, ttt); + } } if (x87_check_exceptions()) @@ -2411,7 +2439,7 @@ void i386_device::x87_fpatan(UINT8 modrm) else { // TODO: Inaccurate - double val = atan(fx80_to_double(ST(1)) / fx80_to_double(ST(0))); + double val = atan2(fx80_to_double(ST(1)) , fx80_to_double(ST(0))); result = double_to_fx80(val); } @@ -4519,7 +4547,7 @@ void i386_device::x87_fsave(UINT8 modrm) } for (int i = 0; i < 8; ++i) - x87_write_stack(i, READ80(ea + i*10), FALSE); + WRITE80(ea + i*10, ST(i)); CYCLES((m_cr[0] & 1) ? 56 : 67); } @@ -4575,7 +4603,7 @@ void i386_device::x87_frstor(UINT8 modrm) } for (int i = 0; i < 8; ++i) - WRITE80(ea + i*10, ST(i)); + x87_write_stack(i, READ80(ea + i*10), FALSE); CYCLES((m_cr[0] & 1) ? 34 : 44); } diff --git a/src/emu/cpu/i960/i960.c b/src/emu/cpu/i960/i960.c index 74666a6671e..8ddd2b6ec3e 100644 --- a/src/emu/cpu/i960/i960.c +++ b/src/emu/cpu/i960/i960.c @@ -1436,7 +1436,7 @@ void i960_cpu_device::execute_op(UINT32 opcode) case 0xd: // cosr m_icount -= 406; t1f = get_1_rif(opcode); - set_rif(opcode, sin(t1f)); + set_rif(opcode, cos(t1f)); break; case 0xe: // tanr diff --git a/src/emu/cpu/nec/v53.c b/src/emu/cpu/nec/v53.c index feae9eb20f6..0019f5bd959 100644 --- a/src/emu/cpu/nec/v53.c +++ b/src/emu/cpu/nec/v53.c @@ -215,6 +215,8 @@ void v53_base_device::device_start() m_out_dack_1_cb.resolve_safe(); m_out_dack_2_cb.resolve_safe(); m_out_dack_3_cb.resolve_safe(); + + static_set_irq_acknowledge_callback(*this, device_irq_acknowledge_delegate(FUNC(pic8259_device::inta_cb), (pic8259_device*)m_v53icu)); } void v53_base_device::install_peripheral_io() @@ -447,11 +449,34 @@ READ8_MEMBER(v53_base_device::get_pic_ack) return 0; } -WRITE_LINE_MEMBER( v53_base_device::upd71059_irq_w) + + +// the external interface provides no external access to the usual IRQ line of the V33, everything goes through the interrupt controller +void v53_base_device::execute_set_input(int irqline, int state) { - printf("upd71059_irq_w %d\n", state); + switch (irqline) + { + case INPUT_LINE_IRQ0: m_v53icu->ir0_w(state); break; + case INPUT_LINE_IRQ1: m_v53icu->ir1_w(state); break; + case INPUT_LINE_IRQ2: m_v53icu->ir2_w(state); break; + case INPUT_LINE_IRQ3: m_v53icu->ir3_w(state); break; + case INPUT_LINE_IRQ4: m_v53icu->ir4_w(state); break; + case INPUT_LINE_IRQ5: m_v53icu->ir5_w(state); break; + case INPUT_LINE_IRQ6: m_v53icu->ir6_w(state); break; + case INPUT_LINE_IRQ7: m_v53icu->ir7_w(state); break; + + case INPUT_LINE_NMI: nec_common_device::execute_set_input(irqline, state); break; + case NEC_INPUT_LINE_POLL: nec_common_device::execute_set_input(irqline, state); break; + } } +// for hooking the interrupt controller output up to the core +WRITE_LINE_MEMBER(v53_base_device::internal_irq_w) +{ + nec_common_device::execute_set_input(0, state); +} + + static MACHINE_CONFIG_FRAGMENT( v53 ) MCFG_DEVICE_ADD("pit", PIT8254, 0) // functionality identical to uPD71054 @@ -461,6 +486,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)) @@ -481,7 +507,9 @@ static MACHINE_CONFIG_FRAGMENT( v53 ) MCFG_AM9517A_OUT_DACK_3_CB(WRITELINE(v53_base_device, dma_dack3_trampoline_w)) - MCFG_PIC8259_ADD( "upd71059pic", WRITELINE(v53_base_device, upd71059_irq_w), VCC, READ8(v53_base_device,get_pic_ack)) + 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_I8251_TXD_HANDLER(WRITELINE(v53_base_device, scu_txd_trampoline_cb)) diff --git a/src/emu/cpu/nec/v53.h b/src/emu/cpu/nec/v53.h index 3eec840fcd8..dbaa7778773 100644 --- a/src/emu/cpu/nec/v53.h +++ b/src/emu/cpu/nec/v53.h @@ -235,14 +235,16 @@ public: DECLARE_READ8_MEMBER(get_pic_ack); - DECLARE_WRITE_LINE_MEMBER(upd71059_irq_w); + DECLARE_WRITE_LINE_MEMBER(internal_irq_w); + protected: // device-level overrides virtual machine_config_constructor device_mconfig_additions() const; virtual void device_start(); virtual void device_reset(); - + virtual void execute_set_input(int inputnum, int state); + required_device m_v53tcu; required_device m_v53dmau; required_device m_v53icu; @@ -286,7 +288,6 @@ protected: - }; diff --git a/src/emu/cpu/sharc/sharc.c b/src/emu/cpu/sharc/sharc.c index 5139c896e37..7505535ff64 100644 --- a/src/emu/cpu/sharc/sharc.c +++ b/src/emu/cpu/sharc/sharc.c @@ -355,9 +355,7 @@ void adsp21062_device::device_start() m_lcstack[i] = 0; m_lastack[i] = 0; } - m_lstkp = 0; m_pcstk = 0; - m_pcstkp = 0; m_laddr.addr = m_laddr.code = m_laddr.loop_type = 0; m_curlcntr = 0; m_lcntr = 0; @@ -682,6 +680,8 @@ void adsp21062_device::device_reset() m_idle = 0; m_stky = 0x5400000; + m_lstkp = 0; + m_pcstkp = 0; m_interrupt_active = 0; } diff --git a/src/emu/cpu/tms0980/tms0980.c b/src/emu/cpu/tms0980/tms0980.c index a81bbf6a886..61f9e4a102e 100644 --- a/src/emu/cpu/tms0980/tms0980.c +++ b/src/emu/cpu/tms0980/tms0980.c @@ -163,6 +163,7 @@ const device_type TMS0980 = &device_creator; // 28-pin DIP, // - 32-term microinstructions PLA between the RAM and ROM, supporting 15 microinstructions // - 16-term output PLA and segment PLA above the RAM (rotate opla 90 degrees) const device_type TMS0970 = &device_creator; // 28-pin DIP, 11 R pins +const device_type TMS1990 = &device_creator; // 28-pin DIP, ? R pins.. // TMS0950 is same? // TMS0270 on the other hand, is a TMS0980 with earrings and a new hat. The new changes look like a quick afterthought, almost hacky @@ -264,6 +265,10 @@ tms0970_cpu_device::tms0970_cpu_device(const machine_config &mconfig, device_typ : tms1000_cpu_device(mconfig, type, name, tag, owner, clock, o_pins, r_pins, pc_bits, byte_bits, x_bits, prgwidth, program, datawidth, data, shortname, source) { } +tms1990_cpu_device::tms1990_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + : tms0970_cpu_device(mconfig, TMS1990, "TMS1990", tag, owner, clock, 8, 11, 6, 8, 2, 10, ADDRESS_MAP_NAME(program_10bit_8), 6, ADDRESS_MAP_NAME(data_64x4), "tms1990", __FILE__) +{ } + tms0980_cpu_device::tms0980_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : tms0970_cpu_device(mconfig, TMS0980, "TMS0980", tag, owner, clock, 8, 9, 7, 9, 4, 12, ADDRESS_MAP_NAME(program_11bit_9), 8, ADDRESS_MAP_NAME(data_64x9_as4), "tms0980", __FILE__) diff --git a/src/emu/cpu/tms0980/tms0980.h b/src/emu/cpu/tms0980/tms0980.h index 2a44449ba1d..3b7348f0db9 100644 --- a/src/emu/cpu/tms0980/tms0980.h +++ b/src/emu/cpu/tms0980/tms0980.h @@ -312,6 +312,12 @@ protected: virtual void op_tdo(); }; +class tms1990_cpu_device : public tms0970_cpu_device +{ +public: + tms1990_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); +}; + class tms0980_cpu_device : public tms0970_cpu_device { @@ -394,6 +400,7 @@ extern const device_type TMS1370; extern const device_type TMS1400; extern const device_type TMS1470; extern const device_type TMS0970; +extern const device_type TMS1990; extern const device_type TMS0980; extern const device_type TMS0270; diff --git a/src/emu/cpu/ucom4/ucom4.h b/src/emu/cpu/ucom4/ucom4.h index c215b2336f2..8e872e41c8f 100644 --- a/src/emu/cpu/ucom4/ucom4.h +++ b/src/emu/cpu/ucom4/ucom4.h @@ -59,6 +59,36 @@ enum }; +// pinout reference + +/* + _______ _______ + CL1 1 |* \_/ | 42 CL0 + PC0 2 | | 41 Vgg + PC1 3 | | 40 PB3 + PC2 4 | | 39 PB2 + PC3 5 | | 38 PB1 + /INT 6 | | 37 PB0 + RESET 7 | | 36 PA3 + PD0 8 | | 35 PA2 + PD1 9 | uPD552 | 34 PA1 + PD2 10 | uPD553 | 33 PA0 + PD3 11 | uPD650* | 32 PI2 + PE0 12 | | 31 PI1 + PE1 13 | | 30 PI0 + PE2 14 | | 29 PH3 + PE3 15 | | 28 PH2 + PF0 16 | | 27 PH1 + PF1 17 | | 26 PH0 + PF2 18 | | 25 PG3 + PF3 19 | | 24 PG2 + TEST 20 | | 23 PG1 + Vss 21 |_________________| 22 PG0 + + *: pin 21 is Vcc, pin 41 is Vss + +*/ + class ucom4_cpu_device : public cpu_device { diff --git a/src/emu/emucore.h b/src/emu/emucore.h index 23f8808a739..899ee9fa670 100644 --- a/src/emu/emucore.h +++ b/src/emu/emucore.h @@ -15,6 +15,7 @@ #define __EMUCORE_H__ // standard C includes +#include #include #include #include @@ -218,7 +219,10 @@ inline void operator--(_Type &value, int) { value = (_Type)((int)value - 1); } #undef assert #undef assert_always -#ifdef MAME_DEBUG +#if defined(MAME_DEBUG_FAST) +#define assert(x) do { } while (0) +#define assert_always(x, msg) do { if (!(x)) throw emu_fatalerror("Fatal error: %s\nCaused by assert: %s:%d: %s", msg, __FILE__, __LINE__, #x); } while (0) +#elif defined(MAME_DEBUG) #define assert(x) do { if (!(x)) throw emu_fatalerror("assert: %s:%d: %s", __FILE__, __LINE__, #x); } while (0) #define assert_always(x, msg) do { if (!(x)) throw emu_fatalerror("Fatal error: %s\nCaused by assert: %s:%d: %s", msg, __FILE__, __LINE__, #x); } while (0) #else diff --git a/src/emu/emuopts.c b/src/emu/emuopts.c index 0b3c785fd5d..52ca361a7db 100644 --- a/src/emu/emuopts.c +++ b/src/emu/emuopts.c @@ -61,6 +61,9 @@ const options_entry emu_options::s_option_entries[] = { OPTION_RECORD ";rec", NULL, OPTION_STRING, "record an input file" }, { OPTION_MNGWRITE, NULL, OPTION_STRING, "optional filename to write a MNG movie of the current session" }, { OPTION_AVIWRITE, NULL, OPTION_STRING, "optional filename to write an AVI movie of the current session" }, +#ifdef MAME_DEBUG + { OPTION_DUMMYWRITE, "0", OPTION_BOOLEAN, "indicates if a snapshot should be created if each frame" }, +#endif { OPTION_WAVWRITE, NULL, OPTION_STRING, "optional filename to write a WAV file of the current session" }, { OPTION_SNAPNAME, "%g/%i", OPTION_STRING, "override of the default snapshot/movie naming; %g == gamename, %i == index" }, { OPTION_SNAPSIZE, "auto", OPTION_STRING, "specify snapshot/movie resolution (x) or 'auto' to use minimal size " }, diff --git a/src/emu/emuopts.h b/src/emu/emuopts.h index 17deb586576..aadb98a72c7 100644 --- a/src/emu/emuopts.h +++ b/src/emu/emuopts.h @@ -73,6 +73,9 @@ enum #define OPTION_RECORD "record" #define OPTION_MNGWRITE "mngwrite" #define OPTION_AVIWRITE "aviwrite" +#ifdef MAME_DEBUG +#define OPTION_DUMMYWRITE "dummywrite" +#endif #define OPTION_WAVWRITE "wavwrite" #define OPTION_SNAPNAME "snapname" #define OPTION_SNAPSIZE "snapsize" @@ -241,6 +244,9 @@ public: const char *record() const { return value(OPTION_RECORD); } const char *mng_write() const { return value(OPTION_MNGWRITE); } const char *avi_write() const { return value(OPTION_AVIWRITE); } +#ifdef MAME_DEBUG + bool dummy_write() const { return bool_value(OPTION_DUMMYWRITE); } +#endif const char *wav_write() const { return value(OPTION_WAVWRITE); } const char *snap_name() const { return value(OPTION_SNAPNAME); } const char *snap_size() const { return value(OPTION_SNAPSIZE); } diff --git a/src/emu/luaengine.c b/src/emu/luaengine.c index 59eae3870d5..c8bb21eedc3 100644 --- a/src/emu/luaengine.c +++ b/src/emu/luaengine.c @@ -130,7 +130,7 @@ lua_engine::hook::hook() cb = -1; } -#ifdef SDLMAME_SOLARIS +#if defined(SDLMAME_SOLARIS) || defined(__ANDROID__) #undef _L #endif @@ -639,11 +639,13 @@ int lua_engine::lua_screen::l_draw_box(lua_State *L) luaL_argcheck(L, lua_isnumber(L, 7), 7, "outline color (integer) expected"); // retrieve all parameters + int sc_width = sc->visible_area().width(); + int sc_height = sc->visible_area().height(); float x1, y1, x2, y2; - x1 = MIN(lua_tounsigned(L, 2) / static_cast(sc->visible_area().width()) , 1.0f); - y1 = MIN(lua_tounsigned(L, 3) / static_cast(sc->visible_area().height()), 1.0f); - x2 = MIN(lua_tounsigned(L, 4) / static_cast(sc->visible_area().width()) , 1.0f); - y2 = MIN(lua_tounsigned(L, 5) / static_cast(sc->visible_area().height()), 1.0f); + x1 = MIN(MAX(0, lua_tointeger(L, 2)), sc_width-1) / static_cast(sc_width); + y1 = MIN(MAX(0, lua_tointeger(L, 3)), sc_height-1) / static_cast(sc_height); + x2 = MIN(MAX(0, lua_tointeger(L, 4)), sc_width-1) / static_cast(sc_width); + y2 = MIN(MAX(0, lua_tointeger(L, 5)), sc_height-1) / static_cast(sc_height); UINT32 bgcolor = lua_tounsigned(L, 6); UINT32 fgcolor = lua_tounsigned(L, 7); @@ -675,11 +677,13 @@ int lua_engine::lua_screen::l_draw_line(lua_State *L) luaL_argcheck(L, lua_isnumber(L, 6), 6, "color (integer) expected"); // retrieve all parameters + int sc_width = sc->visible_area().width(); + int sc_height = sc->visible_area().height(); float x1, y1, x2, y2; - x1 = MIN(lua_tounsigned(L, 2) / static_cast(sc->visible_area().width()) , 1.0f); - y1 = MIN(lua_tounsigned(L, 3) / static_cast(sc->visible_area().height()), 1.0f); - x2 = MIN(lua_tounsigned(L, 4) / static_cast(sc->visible_area().width()) , 1.0f); - y2 = MIN(lua_tounsigned(L, 5) / static_cast(sc->visible_area().height()), 1.0f); + x1 = MIN(MAX(0, lua_tointeger(L, 2)), sc_width-1) / static_cast(sc_width); + y1 = MIN(MAX(0, lua_tointeger(L, 3)), sc_height-1) / static_cast(sc_height); + x2 = MIN(MAX(0, lua_tointeger(L, 4)), sc_width-1) / static_cast(sc_width); + y2 = MIN(MAX(0, lua_tointeger(L, 5)), sc_height-1) / static_cast(sc_height); UINT32 color = lua_tounsigned(L, 6); // draw the line @@ -705,8 +709,10 @@ int lua_engine::lua_screen::l_draw_text(lua_State *L) luaL_argcheck(L, lua_isstring(L, 4), 4, "message (string) expected"); // retrieve all parameters - float x = MIN(lua_tounsigned(L, 2) / static_cast(sc->visible_area().width()) , 1.0f); - float y = MIN(lua_tounsigned(L, 3) / static_cast(sc->visible_area().height()), 1.0f); + int sc_width = sc->visible_area().width(); + int sc_height = sc->visible_area().height(); + float x = MIN(MAX(0, lua_tointeger(L, 2)), sc_width-1) / static_cast(sc_width); + float y = MIN(MAX(0, lua_tointeger(L, 3)), sc_height-1) / static_cast(sc_height); const char *msg = luaL_checkstring(L,4); // TODO: add optional parameters (colors, etc.) diff --git a/src/emu/machine/i8257.c b/src/emu/machine/i8257.c index d46f9aa8ae7..791a040295f 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 index 327e9ff739a..85bfb92139d 100644 --- a/src/emu/machine/machine.mak +++ b/src/emu/machine/machine.mak @@ -1255,6 +1255,7 @@ MACHINEOBJS += $(MACHINEOBJ)/lpc.o MACHINEOBJS += $(MACHINEOBJ)/lpc-acpi.o MACHINEOBJS += $(MACHINEOBJ)/lpc-rtc.o MACHINEOBJS += $(MACHINEOBJ)/lpc-pit.o +MACHINEOBJS += $(MACHINEOBJ)/vrc4373.o endif #------------------------------------------------- diff --git a/src/emu/machine/mcf5206e.c b/src/emu/machine/mcf5206e.c index 5429cc16482..d7b99c42483 100644 --- a/src/emu/machine/mcf5206e.c +++ b/src/emu/machine/mcf5206e.c @@ -672,7 +672,7 @@ TIMER_CALLBACK_MEMBER(mcf5206e_peripheral_device::timer1_callback) debuglogtimer("timer1_callback\n"); m_TER1 |= 0x02; - timer1->adjust(attotime::from_msec(10)); // completely made up value just to fire our timers for now + m_timer1->adjust(attotime::from_msec(10)); // completely made up value just to fire our timers for now } @@ -703,11 +703,11 @@ WRITE16_MEMBER( mcf5206e_peripheral_device::TMR1_w) if (m_TMR1 & 0x0001) { - timer1->adjust(attotime::from_seconds(1)); // completely made up value just to fire our timers for now + m_timer1->adjust(attotime::from_seconds(1)); // completely made up value just to fire our timers for now } else { - timer1->adjust(attotime::never); + m_timer1->adjust(attotime::never); } @@ -859,8 +859,26 @@ void mcf5206e_peripheral_device::device_start() { init_regs(true); - timer1 = machine().scheduler().timer_alloc( timer_expired_delegate( FUNC( mcf5206e_peripheral_device::timer1_callback ), this) ); - + 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)); + save_item(NAME(m_CSCR)); + save_item(NAME(m_DMCR)); + save_item(NAME(m_PAR)); + save_item(NAME(m_TMR1)); + save_item(NAME(m_TRR1)); + save_item(NAME(m_TER1)); + save_item(NAME(m_TCN1)); + save_item(NAME(m_PPDDR)); + save_item(NAME(m_PPDAT)); + save_item(NAME(m_IMR)); + save_item(NAME(m_MBCR)); + save_item(NAME(m_MBSR)); + save_item(NAME(m_MFDR)); + save_item(NAME(m_MBDR)); + save_item(NAME(m_coldfire_regs)); } void mcf5206e_peripheral_device::device_reset() @@ -868,7 +886,7 @@ void mcf5206e_peripheral_device::device_reset() m_cpu = (cpu_device*)machine().device(":maincpu"); // hack. this device should really be attached to a modern CPU core init_regs(false); - timer1->adjust(attotime::never); + m_timer1->adjust(attotime::never); } READ32_MEMBER(mcf5206e_peripheral_device::dev_r) diff --git a/src/emu/machine/mcf5206e.h b/src/emu/machine/mcf5206e.h index 8bda69d7cfb..84c9003eafe 100644 --- a/src/emu/machine/mcf5206e.h +++ b/src/emu/machine/mcf5206e.h @@ -1,6 +1,6 @@ /*************************************************************************** - Konami 033906 + MCF5206E Peripherals ***************************************************************************/ @@ -183,7 +183,7 @@ private: UINT16 m_DMCR; UINT16 m_PAR; - emu_timer *timer1; + emu_timer *m_timer1; UINT16 m_TMR1; UINT16 m_TRR1; UINT8 m_TER1; diff --git a/src/emu/machine/tmp68301.c b/src/emu/machine/tmp68301.c index 3c88faf7f8f..9795e075b4a 100644 --- a/src/emu/machine/tmp68301.c +++ b/src/emu/machine/tmp68301.c @@ -99,8 +99,15 @@ tmp68301_device::tmp68301_device(const machine_config &mconfig, const char *tag, device_memory_interface(mconfig, *this), m_in_parallel_cb(*this), m_out_parallel_cb(*this), + m_imr(0), + m_iisr(0), + m_scr(0), + m_pdir(0), m_space_config("regs", ENDIANNESS_LITTLE, 16, 10, 0, NULL, *ADDRESS_MAP_NAME(tmp68301_regs)) { + memset(m_regs, 0, sizeof(m_regs)); + memset(m_IE, 0, sizeof(m_IE)); + memset(m_irq_vector, 0, sizeof(m_irq_vector)); } @@ -116,6 +123,14 @@ 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)); + save_item(NAME(m_imr)); + save_item(NAME(m_iisr)); + save_item(NAME(m_scr)); + save_item(NAME(m_pdir)); } //------------------------------------------------- diff --git a/src/emu/machine/tms6100.c b/src/emu/machine/tms6100.c index c261d1b949b..2df1cada967 100644 --- a/src/emu/machine/tms6100.c +++ b/src/emu/machine/tms6100.c @@ -28,6 +28,19 @@ VSS | 14 15 | NC +-----------------+ + TMS6125: + + +---------+ + DATA/ADD1 | 1 16 | NC + DATA/ADD2 | 2 15 | NC + DATA/ADD4 | 3 14 | NC + DATA/ADD8 | 4 13 | NC + CLK | 5 12 | VDD + NC | 6 11 | /CS + NC | 7 10 | M1 + M0 | 8 9 | VSS + +---------+ + M58819 (from radarscope schematics): +-----------------+ diff --git a/src/emu/machine/vrc4373.c b/src/emu/machine/vrc4373.c new file mode 100644 index 00000000000..b1e5c6e8928 --- /dev/null +++ b/src/emu/machine/vrc4373.c @@ -0,0 +1,344 @@ +#include "vrc4373.h" + +#define LOG_NILE (1) +#define LOG_NILE_MASTER (0) +#define LOG_NILE_TARGET (1) + +const device_type VRC4373 = &device_creator; + +DEVICE_ADDRESS_MAP_START(config_map, 32, vrc4373_device) + AM_RANGE(0x40, 0x43) AM_READWRITE (pcictrl_r, pcictrl_w) + AM_INHERIT_FROM(pci_host_device::config_map) +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) +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) +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) +ADDRESS_MAP_END + +vrc4373_device::vrc4373_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + : pci_host_device(mconfig, VRC4373, "NEC VRC4373 System Controller", tag, owner, clock, "vrc4373", __FILE__), + m_mem_config("memory_space", ENDIANNESS_LITTLE, 32, 32), + m_io_config("io_space", ENDIANNESS_LITTLE, 32, 32) +{ +} + +const address_space_config *vrc4373_device::memory_space_config(address_spacenum spacenum) const +{ + return (spacenum == AS_PROGRAM) ? pci_bridge_device::memory_space_config(spacenum) : (spacenum == AS_DATA) ? &m_mem_config : (spacenum == AS_IO) ? &m_io_config : NULL; +} + +void vrc4373_device::device_start() +{ + pci_host_device::device_start(); + m_cpu = machine().device(cpu_tag); + m_cpu_space = &m_cpu->space(AS_PROGRAM); + memory_space = &space(AS_DATA); + io_space = &space(AS_IO); + + memset(m_cpu_regs, 0, sizeof(m_cpu_regs)); + + memory_window_start = 0; + memory_window_end = 0xffffffff; + memory_offset = 0; + io_window_start = 0; + io_window_end = 0xffffffff; + io_offset = 0x00000000; + status = 0x0280; + m_ram_size = 1<<22; + m_ram_base = 0; + m_simm_size = 1<<21; + m_simm_base = 0; + regenerate_config_mapping(); +} + +void vrc4373_device::device_reset() +{ + pci_device::device_reset(); + memset(m_cpu_regs, 0, sizeof(m_cpu_regs)); + remap_cb(); +} + +void vrc4373_device::map_extra(UINT64 memory_window_start, UINT64 memory_window_end, UINT64 memory_offset, address_space *memory_space, + UINT64 io_window_start, UINT64 io_window_end, UINT64 io_offset, address_space *io_space) +{ + m_cpu_space->unmap_readwrite(0x00000000, 0xffffffff); + + m_cpu_space->install_rom (0x1fc00000, 0x1fcfffff, m_region->base()); + m_cpu_space->install_device(0x0f000000, 0x0f0000ff, *static_cast(this), &vrc4373_device::cpu_map); + // PCI Configuration also mapped at 0x0f000100 + m_cpu_space->install_device(0x0f000100, 0x0f0001ff, *static_cast(this), &vrc4373_device::config_map); + + UINT32 winStart, winEnd, winSize; + + if (m_cpu_regs[NREG_BMCR]&0x8) { + m_cpu_space->install_ram (m_ram_base, m_ram_base+m_ram_size-1, &m_ram[0]); + if (LOG_NILE) + logerror("%s: map_extra ram_size=%08X ram_base=%08X\n", tag(),m_ram_size,m_ram_base); + } + if (m_cpu_regs[NREG_SIMM1]&0x8) { + m_cpu_space->install_ram (m_simm_base, m_simm_base+m_simm_size-1, &m_simm[0]); + if (LOG_NILE) + logerror("%s: map_extra simm_size=%08X simm_base=%08X\n", tag(),m_simm_size,m_simm_base); + } + // PCI Master Window 1 + if (m_cpu_regs[NREG_PCIMW1]&0x1000) { + winStart = m_cpu_regs[NREG_PCIMW1]&0xff000000; + winEnd = winStart | (~(0x80000000 | (((m_cpu_regs[NREG_PCIMW1]>>13)&0x7f)<<24))); + winSize = winEnd - winStart + 1; + m_cpu_space->install_read_handler(winStart, winEnd, 0, 0, read32_delegate(FUNC(vrc4373_device::master1_r), this)); + m_cpu_space->install_write_handler(winStart, winEnd, 0, 0, write32_delegate(FUNC(vrc4373_device::master1_w), this)); + if (LOG_NILE) + logerror("%s: map_extra Master Window 1 start=%08X end=%08X size=%08X laddr=%08X\n", tag(), winStart, winEnd, winSize, m_pci1_laddr); + } + // PCI Master Window 2 + if (m_cpu_regs[NREG_PCIMW2]&0x1000) { + winStart = m_cpu_regs[NREG_PCIMW2]&0xff000000; + winEnd = winStart | (~(0x80000000 | (((m_cpu_regs[NREG_PCIMW2]>>13)&0x7f)<<24))); + winSize = winEnd - winStart + 1; + m_cpu_space->install_read_handler(winStart, winEnd, 0, 0, read32_delegate(FUNC(vrc4373_device::master2_r), this)); + m_cpu_space->install_write_handler(winStart, winEnd, 0, 0, write32_delegate(FUNC(vrc4373_device::master2_w), this)); + 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 + 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))); + winSize = winEnd - winStart + 1; + m_cpu_space->install_read_handler(winStart, winEnd, 0, 0, read32_delegate(FUNC(vrc4373_device::master_io_r), this)); + m_cpu_space->install_write_handler(winStart, winEnd, 0, 0, write32_delegate(FUNC(vrc4373_device::master_io_w), this)); + if (LOG_NILE) + 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) { + winStart = m_cpu_regs[NREG_PCITW1]&0xffe00000; + winEnd = winStart | (~(0xf0000000 | (((m_cpu_regs[NREG_PCITW1]>>13)&0x7f)<<21))); + winSize = winEnd - winStart + 1; + memory_space->install_read_handler(winStart, winEnd, 0, 0, read32_delegate(FUNC(vrc4373_device::target1_r), this)); + memory_space->install_write_handler(winStart, winEnd, 0, 0, write32_delegate(FUNC(vrc4373_device::target1_w), this)); + if (LOG_NILE) + logerror("%s: map_extra Target Window 1 start=%08X end=%08X size=%08X laddr=%08X\n", tag(), winStart, winEnd, winSize, m_target1_laddr); + } + // PCI Target Window 2 + if (m_cpu_regs[NREG_PCITW2]&0x1000) { + winStart = m_cpu_regs[NREG_PCITW2]&0xffe00000; + winEnd = winStart | (~(0xf0000000 | (((m_cpu_regs[NREG_PCITW2]>>13)&0x7f)<<21))); + winSize = winEnd - winStart + 1; + memory_space->install_read_handler(winStart, winEnd, 0, 0, read32_delegate(FUNC(vrc4373_device::target2_r), this)); + memory_space->install_write_handler(winStart, winEnd, 0, 0, write32_delegate(FUNC(vrc4373_device::target2_w), this)); + if (LOG_NILE) + logerror("%s: map_extra Target Window 2 start=%08X end=%08X size=%08X laddr=%08X\n", tag(), winStart, winEnd, winSize, m_target2_laddr); + } +} + +void vrc4373_device::reset_all_mappings() +{ + pci_device::reset_all_mappings(); +} + +void vrc4373_device::set_cpu_tag(const char *_cpu_tag) +{ + if (LOG_NILE) + logerror("%s: set_cpu_tag\n", tag()); + cpu_tag = _cpu_tag; +} +// PCI bus control +READ32_MEMBER (vrc4373_device::pcictrl_r) +{ + UINT32 result = 0; + if (LOG_NILE) + logerror("%06X:nile pcictrl_r from offset %02X = %08X & %08X\n", space.device().safe_pc(), offset*4, result, mem_mask); + return result; +} +WRITE32_MEMBER (vrc4373_device::pcictrl_w) +{ + if (LOG_NILE) + logerror("%06X:nile pcictrl_w to offset %02X = %08X & %08X\n", space.device().safe_pc(), offset*4, data, mem_mask); +} +// PCI Master Window 1 +READ32_MEMBER (vrc4373_device::master1_r) +{ + UINT32 result = this->space(AS_DATA).read_dword(m_pci1_laddr | (offset*4), mem_mask); + if (LOG_NILE_MASTER) + logerror("%06X:nile master1 read from offset %02X = %08X & %08X\n", space.device().safe_pc(), offset*4, result, mem_mask); + return result; +} +WRITE32_MEMBER (vrc4373_device::master1_w) +{ + this->space(AS_DATA).write_dword(m_pci1_laddr | (offset*4), data, mem_mask); + if (LOG_NILE_MASTER) + logerror("%06X:nile master1 write to offset %02X = %08X & %08X\n", space.device().safe_pc(), offset*4, data, mem_mask); +} + +// PCI Master Window 2 +READ32_MEMBER (vrc4373_device::master2_r) +{ + UINT32 result = this->space(AS_DATA).read_dword(m_pci2_laddr | (offset*4), mem_mask); + if (LOG_NILE_MASTER) + logerror("%06X:nile master2 read from offset %02X = %08X & %08X\n", space.device().safe_pc(), offset*4, result, mem_mask); + return result; +} +WRITE32_MEMBER (vrc4373_device::master2_w) +{ + this->space(AS_DATA).write_dword(m_pci2_laddr | (offset*4), data, mem_mask); + if (LOG_NILE_MASTER) + logerror("%06X:nile master2 write to offset %02X = %08X & %08X\n", space.device().safe_pc(), offset*4, data, mem_mask); +} + +// PCI Master IO Window +READ32_MEMBER (vrc4373_device::master_io_r) +{ + UINT32 result = this->space(AS_IO).read_dword(m_pci_io_laddr | (offset*4), mem_mask); + if (LOG_NILE_MASTER) + logerror("%06X:nile master io read from offset %02X = %08X & %08X\n", space.device().safe_pc(), offset*4, result, mem_mask); + return result; +} +WRITE32_MEMBER (vrc4373_device::master_io_w) +{ + this->space(AS_IO).write_dword(m_pci_io_laddr | (offset*4), data, mem_mask); + if (LOG_NILE_MASTER) + logerror("%06X:nile master io write to offset %02X = %08X & %08X\n", space.device().safe_pc(), offset*4, data, mem_mask); +} + +// PCI Target Window 1 +READ32_MEMBER (vrc4373_device::target1_r) +{ + UINT32 result = m_cpu->space(AS_PROGRAM).read_dword(m_target1_laddr | (offset*4), mem_mask); + if (LOG_NILE_TARGET) + logerror("%06X:nile target1 read from offset %02X = %08X & %08X\n", space.device().safe_pc(), offset*4, result, mem_mask); + return result; +} +WRITE32_MEMBER (vrc4373_device::target1_w) +{ + m_cpu->space(AS_PROGRAM).write_dword(m_target1_laddr | (offset*4), data, mem_mask); + if (LOG_NILE_TARGET) + logerror("%06X:nile target1 write to offset %02X = %08X & %08X\n", space.device().safe_pc(), offset*4, data, mem_mask); +} + +// PCI Target Window 2 +READ32_MEMBER (vrc4373_device::target2_r) +{ + UINT32 result = m_cpu->space(AS_PROGRAM).read_dword(m_target2_laddr | (offset*4), mem_mask); + if (LOG_NILE_TARGET) + logerror("%06X:nile target2 read from offset %02X = %08X & %08X\n", space.device().safe_pc(), offset*4, result, mem_mask); + return result; +} +WRITE32_MEMBER (vrc4373_device::target2_w) +{ + m_cpu->space(AS_PROGRAM).write_dword(m_target2_laddr | (offset*4), data, mem_mask); + if (LOG_NILE_TARGET) + logerror("%06X:nile target2 write to offset %02X = %08X & %08X\n", space.device().safe_pc(), offset*4, data, mem_mask); +} + +// CPU I/F +READ32_MEMBER (vrc4373_device::cpu_if_r) +{ + UINT32 result = m_cpu_regs[offset]; + switch (offset) { + case NREG_PCICAR: + result = config_address_r(space, offset); + break; + case NREG_PCICDR: + result = config_data_r(space, offset); + break; + default: + break; + } + if (LOG_NILE) + logerror("%06X:nile read from offset %02X = %08X & %08X\n", space.device().safe_pc(), offset*4, result, mem_mask); + return result; +} + +WRITE32_MEMBER(vrc4373_device::cpu_if_w) +{ + if (LOG_NILE) + logerror("%06X:nile write to offset %02X = %08X & %08X\n", space.device().safe_pc(), offset*4, data, mem_mask); + + UINT32 modData; + COMBINE_DATA(&m_cpu_regs[offset]); + switch (offset) { + case NREG_PCIMW1: + m_pci1_laddr = (data&0xff)<<24; + remap_cb(); + break; + case NREG_PCIMW2: + m_pci2_laddr = (data&0xff)<<24; + remap_cb(); + break; + case NREG_PCIMIOW: + m_pci_io_laddr = (data&0xff)<<24; + remap_cb(); + break; + case NREG_PCITW1: + m_target1_laddr = (data&0x7FF)<<21; + break; + case NREG_PCITW2: + m_target2_laddr = (data&0x7FF)<<21; + break; + 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) { + // Type 0 transaction + modData = 0; + // Select the device based on one hot bit + for (int i=11; i<24; i++) { + if ((data>>i)&0x1) { + // One hot encoding, bit 11 will mean device 1 + modData = i-10; + break; + } + } + // Re-organize into Type 1 transaction for bus 0 (local bus) + modData = (modData<<11) | (data&0x7ff) | (0x80000000); + } else { + // Type 1 transaction, no modification needed + modData = data; + } + pci_host_device::config_address_w(space, offset, modData); + break; + case NREG_PCICDR: + pci_host_device::config_data_w(space, offset, data); + break; + case NREG_BMCR: + if ((data>>3)&0x1) { + m_ram_size = 1<<22; // 4MB + for (int i=14; i<=15; i++) { + if (!((data>>i)&0x1)) m_ram_size<<=1; + else break; + } + m_ram.resize(m_ram_size/4); + m_ram_base = (data & 0x0fc00000); + } + remap_cb(); + break; + case NREG_SIMM1: + if ((data>>3)&0x1) { + m_simm_size = 1<<21; // 2MB + for (int i=13; i<=17; i++) { + if (!((data>>i)&0x1)) m_simm_size<<=1; + else break; + } + m_simm.resize(m_simm_size/4); + m_simm_base = (data & 0x0fe00000); + } + remap_cb(); + break; + default: + break; + } + +} + diff --git a/src/emu/machine/vrc4373.h b/src/emu/machine/vrc4373.h new file mode 100644 index 00000000000..17fa5de7e9c --- /dev/null +++ b/src/emu/machine/vrc4373.h @@ -0,0 +1,116 @@ +// NEC VRC 4373 System Controller + +#ifndef VRC4373_H +#define VRC4373_H + +#include "pci.h" + +#define MCFG_VRC4373_ADD(_tag, _cpu_tag) \ + MCFG_PCI_HOST_ADD(_tag, VRC4373, 0x005B1033, 0x00, 0x00000000) \ + downcast(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_PCIMW1 (0x014/4) +#define NREG_PCIMW2 (0x018/4) +#define NREG_PCITW1 (0x01C/4) +#define NREG_PCITW2 (0x020/4) +#define NREG_PCIMIOW (0x024/4) +#define NREG_PCICDR (0x028/4) +#define NREG_PCICAR (0x02C/4) +#define NREG_PCIMB1 (0x030/4) +#define NREG_PCIMB2 (0x034/4) +#define NREG_DMACR1 (0x038/4) +#define NREG_DMAMAR1 (0x03C/4) +#define NREG_DMAPCI1 (0x040/4) +#define NREG_DMACR2 (0x044/4) +#define NREG_DMAMAR2 (0x048/4) +#define NREG_DMAPCI2 (0x04C/4) + +#define NREG_BESR (0x050/4) +#define NREG_ICSR (0x054/4) +#define NREG_DRAMRCR (0x058/4) +#define NREG_BOOTWP (0x05C/4) +#define NREG_PCIEAR (0x060/4) +#define NREG_DMA_WR (0x064/4) +#define NREG_DMA_CMAR (0x068/4) +#define NREG_DMA_CPAR (0x06C/4) +#define NREG_PCIRC (0x070/4) +#define NREG_PCIEN (0x074/4) +#define NREG_PMIR (0x078/4) + +class vrc4373_device : public pci_host_device { +public: + vrc4373_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + + virtual void reset_all_mappings(); + virtual void map_extra(UINT64 memory_window_start, UINT64 memory_window_end, UINT64 memory_offset, address_space *memory_space, + UINT64 io_window_start, UINT64 io_window_end, UINT64 io_offset, address_space *io_space); + + + 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 + DECLARE_READ32_MEMBER (cpu_if_r); + DECLARE_WRITE32_MEMBER(cpu_if_w); + + DECLARE_READ32_MEMBER (master1_r); + DECLARE_WRITE32_MEMBER(master1_w); + + DECLARE_READ32_MEMBER (master2_r); + DECLARE_WRITE32_MEMBER(master2_w); + + DECLARE_READ32_MEMBER (master_io_r); + DECLARE_WRITE32_MEMBER(master_io_w); + + 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); + +protected: + address_space *m_cpu_space; + virtual const address_space_config *memory_space_config(address_spacenum spacenum) const; + virtual void device_start(); + virtual void device_reset(); + +private: + cpu_device *m_cpu; + const char *cpu_tag; + + address_space_config m_mem_config, m_io_config; + + DECLARE_ADDRESS_MAP(cpu_map, 32); + + UINT32 m_ram_size; + UINT32 m_ram_base; + dynamic_array m_ram; + + UINT32 m_simm_size; + UINT32 m_simm_base; + dynamic_array m_simm; + + + UINT32 m_cpu_regs[0x7c]; + + UINT32 m_pci1_laddr, m_pci2_laddr, m_pci_io_laddr; + UINT32 m_target1_laddr, m_target2_laddr; +}; + + +extern const device_type VRC4373; + +#endif diff --git a/src/emu/mame.c b/src/emu/mame.c index e6915e2cf48..3d8380d8666 100644 --- a/src/emu/mame.c +++ b/src/emu/mame.c @@ -286,6 +286,16 @@ 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()); +#endif + */ } } diff --git a/src/emu/netlist/plists.h b/src/emu/netlist/plists.h index c7eb594cdb2..e3d3a99d184 100644 --- a/src/emu/netlist/plists.h +++ b/src/emu/netlist/plists.h @@ -199,7 +199,7 @@ private: // pnamedlist_t: a simple list // ---------------------------------------------------------------------------------------- -#ifdef SDLMAME_SOLARIS +#if defined(SDLMAME_SOLARIS) || defined(__ANDROID__) #undef _C #endif diff --git a/src/emu/render.c b/src/emu/render.c index 2eed9176550..46ae77e8909 100644 --- a/src/emu/render.c +++ b/src/emu/render.c @@ -2483,26 +2483,41 @@ render_target *render_manager::target_by_index(int index) const // fonts //------------------------------------------------- -float render_manager::ui_aspect() +float render_manager::ui_aspect(render_container *rc) { - int orient = orientation_add(m_ui_target->orientation(), m_ui_container->orientation()); + int orient = 0; + float aspect = 1.0f; - // based on the orientation of the target, compute height/width or width/height - float aspect; - if (!(orient & ORIENTATION_SWAP_XY)) - aspect = (float)m_ui_target->height() / (float)m_ui_target->width(); - else - aspect = (float)m_ui_target->width() / (float)m_ui_target->height(); + if (rc == m_ui_container || rc == NULL) { + // ui container, aggregated multi-screen target - // 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(); + 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(); + else + aspect = (float)m_ui_target->width() / (float)m_ui_target->height(); - // if not, clamp for extreme proportions + // 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()); + } else { + // single screen container + + orient = rc->orientation(); + // based on the orientation of the target, compute height/width or width/height + if (!(orient & ORIENTATION_SWAP_XY)) + aspect = (float)rc->screen()->visible_area().height() / (float)rc->screen()->visible_area().width(); + else + aspect = (float)rc->screen()->visible_area().width() / (float)rc->screen()->visible_area().height(); + } + + // clamp for extreme proportions if (aspect < 0.66f) aspect = 0.66f; if (aspect > 1.5f) aspect = 1.5f; + return aspect; } diff --git a/src/emu/render.h b/src/emu/render.h index 2ee8e108a09..bf058258577 100644 --- a/src/emu/render.h +++ b/src/emu/render.h @@ -744,7 +744,7 @@ public: // UI targets render_target &ui_target() const { assert(m_ui_target != NULL); return *m_ui_target; } void set_ui_target(render_target &target) { m_ui_target = ⌖ } - float ui_aspect(); + float ui_aspect(render_container *rc = NULL); // UI containers render_container &ui_container() const { assert(m_ui_container != NULL); return *m_ui_container; } diff --git a/src/emu/schedule.c b/src/emu/schedule.c index 74dfa661469..d0d28af80e4 100644 --- a/src/emu/schedule.c +++ b/src/emu/schedule.c @@ -451,9 +451,7 @@ void device_scheduler::timeslice() attoseconds_t delta = target.attoseconds - exec->m_localtime.attoseconds; if (delta < 0 && target.seconds > exec->m_localtime.seconds) delta += ATTOSECONDS_PER_SECOND; -#ifndef MAME_DEBUG_FAST assert(delta == (target - exec->m_localtime).as_attoseconds()); -#endif // if we have enough for at least 1 cycle, do the math if (delta >= exec->m_attoseconds_per_cycle) diff --git a/src/emu/sound/es1373.c b/src/emu/sound/es1373.c new file mode 100644 index 00000000000..aae26ba93f9 --- /dev/null +++ b/src/emu/sound/es1373.c @@ -0,0 +1,196 @@ +#include "es1373.h" + +#define LOG_ES (1) + +const device_type ES1373 = &device_creator; + +DEVICE_ADDRESS_MAP_START(map, 32, es1373_device) + AM_RANGE(0x00, 0x3f) AM_READWRITE (reg_r, reg_w) +ADDRESS_MAP_END + +es1373_device::es1373_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + : pci_device(mconfig, ES1373, "Creative Labs Ensoniq AudioPCI97 ES1373", tag, owner, clock, "es1373", __FILE__) +{ +} + +void es1373_device::device_start() +{ + pci_device::device_start(); + add_map(0x40, M_IO, FUNC(es1373_device::map)); +} + +void es1373_device::device_reset() +{ + pci_device::device_reset(); + memset(m_es_regs, 0, sizeof(m_es_regs)); + memset(m_ac97_regs, 0, sizeof(m_ac97_regs)); + m_ac97_regs[0] = 0x0800; +} + +READ32_MEMBER (es1373_device::reg_r) +{ + UINT32 result = m_es_regs[offset]; + switch (offset) { + case ES_CODEC: + break; + case ES_HOST_IF0: // 0x30 + switch (m_es_regs[ES_MEM_PAGE]&0xf) { + case 0xc: + result = m_dac1_fr.pci_addr; + break; + case 0xd: + result = m_adc_fr.pci_addr; + break; + case 0xe: + case 0xf: + logerror("%06X:ES1373 Read UART offset %02X & %08X\n", space.device().safe_pc(), offset*4, mem_mask); + default: + break; + } + break; + case ES_HOST_IF1: // 0x34 + switch (m_es_regs[ES_MEM_PAGE]&0xf) { + case 0xc: + result = (m_dac1_fr.curr_count<<16) | m_dac1_fr.buff_size; + break; + case 0xd: + result = (m_adc_fr.curr_count<<16) | m_adc_fr.buff_size; + break; + case 0xe: + case 0xf: + logerror("%06X:ES1373 write UART offset %02X & %08X\n", space.device().safe_pc(), offset*4, mem_mask); + default: + break; + } + break; + case ES_HOST_IF2: // 0x38 + switch (m_es_regs[ES_MEM_PAGE]&0xf) { + case 0xc: + result = m_dac2_fr.pci_addr; + break; + case 0xd: + logerror("%06X:ES1373 read Unknown place offset %02X & %08X\n", space.device().safe_pc(), offset*4, mem_mask); + break; + case 0xe: + case 0xf: + logerror("%06X:ES1373 read UART offset %02X & %08X\n", space.device().safe_pc(), offset*4, mem_mask); + default: + break; + } + break; + case ES_HOST_IF3: // 0x3C + switch (m_es_regs[ES_MEM_PAGE]&0xf) { + case 0xc: + result = (m_dac2_fr.curr_count<<16) | m_dac2_fr.buff_size; + break; + case 0xd: + logerror("%06X:ES1373 read Unknown place offset %02X & %08X\n", space.device().safe_pc(), offset*4, mem_mask); + break; + case 0xe: + case 0xf: + logerror("%06X:ES1373 read UART offset %02X & %08X\n", space.device().safe_pc(), offset*4, mem_mask); + default: + break; + } + break; + default: + break; + } + if (LOG_ES) + logerror("%06X:ES1373 read from offset %02X = %08X & %08X\n", space.device().safe_pc(), offset*4, result, mem_mask); + return result; +} + +WRITE32_MEMBER(es1373_device::reg_w) +{ + COMBINE_DATA(&m_es_regs[offset]); + switch (offset) { + case ES_SRC_IF: + if (data&(1<<24)) { + // Write to Sample Rate Converter Ram + m_src_ram[(data>>25)&0x7F] = data&0xFFFF; + } else { + // Read From Sample Rate Converter Ram + m_es_regs[offset] = (data&0xFFFF0000) | m_src_ram[(data>>25)&0x7F]; + } + break; + case ES_CODEC: + if (data&(1<<23)) { + // Read from AC97 codec registers + m_es_regs[offset] = (data&0xFFFF0000) | m_ac97_regs[(data>>16)&0x7f] | 0x80000000; + } else { + // Write to AC97 codec registers + m_ac97_regs[(data>>16)&0x7f] = data&0xFFFF; + } + break; + case ES_HOST_IF0: // 0x30 + switch (m_es_regs[ES_MEM_PAGE]&0xf) { + case 0xc: + m_dac1_fr.pci_addr = data; + break; + case 0xd: + m_adc_fr.pci_addr = data; + break; + case 0xe: + case 0xf: + logerror("%06X:ES1373 write UART offset %02X = %08X & %08X\n", space.device().safe_pc(), offset*4, data, mem_mask); + default: + break; + } + break; + case ES_HOST_IF1: // 0x34 + switch (m_es_regs[ES_MEM_PAGE]&0xf) { + case 0xc: + m_dac1_fr.curr_count = (data>>16)&0xffff; + m_dac1_fr.buff_size = data&0xffff; + break; + case 0xd: + m_adc_fr.curr_count = (data>>16)&0xffff; + m_adc_fr.buff_size = data&0xffff; + break; + case 0xe: + case 0xf: + logerror("%06X:ES1373 write UART offset %02X = %08X & %08X\n", space.device().safe_pc(), offset*4, data, mem_mask); + default: + break; + } + break; + case ES_HOST_IF2: // 0x38 + switch (m_es_regs[ES_MEM_PAGE]&0xf) { + case 0xc: + m_dac2_fr.pci_addr = data; + break; + case 0xd: + logerror("%06X:ES1373 write Unknown place offset %02X = %08X & %08X\n", space.device().safe_pc(), offset*4, data, mem_mask); + break; + case 0xe: + case 0xf: + logerror("%06X:ES1373 write UART offset %02X = %08X & %08X\n", space.device().safe_pc(), offset*4, data, mem_mask); + default: + break; + } + break; + case ES_HOST_IF3: // 0x3C + switch (m_es_regs[ES_MEM_PAGE]&0xf) { + case 0xc: + m_dac2_fr.curr_count = (data>>16)&0xffff; + m_dac2_fr.buff_size = data&0xffff; + break; + case 0xd: + logerror("%06X:ES1373 write Unknown place offset %02X = %08X & %08X\n", space.device().safe_pc(), offset*4, data, mem_mask); + break; + case 0xe: + case 0xf: + logerror("%06X:ES1373 write UART offset %02X = %08X & %08X\n", space.device().safe_pc(), offset*4, data, mem_mask); + default: + break; + } + break; + default: + break; + } + + if (LOG_ES) + logerror("%06X:ES1373 write to offset %02X = %08X & %08X\n", space.device().safe_pc(), offset*4, data, mem_mask); + +} diff --git a/src/emu/sound/es1373.h b/src/emu/sound/es1373.h new file mode 100644 index 00000000000..b2ee13f1feb --- /dev/null +++ b/src/emu/sound/es1373.h @@ -0,0 +1,63 @@ +// Creative Labs Ensonic AudioPCI97 ES1373 + +#ifndef ES1373_H +#define ES1373_H + +#include "machine/pci.h" + +#define MCFG_ES1373_ADD(_tag) \ + 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) + +struct frame_reg { + UINT32 pci_addr; + UINT16 curr_count; + UINT16 buff_size; + frame_reg() : pci_addr(0), curr_count(0), buff_size(0) {} +}; + +class es1373_device : public pci_device { +public: + es1373_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + + DECLARE_READ32_MEMBER (reg_r); + DECLARE_WRITE32_MEMBER(reg_w); + +protected: + virtual void device_start(); + virtual void device_reset(); + +private: + DECLARE_ADDRESS_MAP(map, 32); + UINT16 m_ac97_regs[0x80]; + UINT32 m_es_regs[0x10]; + UINT16 m_src_ram[0x80]; + frame_reg m_dac1_fr; + frame_reg m_dac2_fr; + frame_reg m_adc_fr; +}; + +extern const device_type ES1373; + +#endif diff --git a/src/emu/sound/okim9810.c b/src/emu/sound/okim9810.c index 9b041fda765..3370ee460e8 100644 --- a/src/emu/sound/okim9810.c +++ b/src/emu/sound/okim9810.c @@ -88,6 +88,14 @@ okim9810_device::okim9810_device(const machine_config &mconfig, const char *tag, { } +okim9810_device::okim_voice *okim9810_device::get_voice(int which) +{ + which &= 8; + if (which < OKIM9810_VOICES) + return &m_voice[which]; + + return NULL; +} //------------------------------------------------- // device_start - device-specific startup @@ -103,8 +111,35 @@ void okim9810_device::device_start() m_stream = machine().sound().stream_alloc(*this, 0, 2, clock()); // save state stuff - // m_TMP_register - // m_voice + save_item(NAME(m_TMP_register)); + 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); + save_item(NAME(voice->m_adpcm2.m_step), i); + save_item(NAME(voice->m_playbackAlgo), i); + save_item(NAME(voice->m_looping), i); + save_item(NAME(voice->m_startFlags), i); + save_item(NAME(voice->m_endFlags), i); + save_item(NAME(voice->m_base_offset), i); + save_item(NAME(voice->m_count), i); + save_item(NAME(voice->m_samplingFreq), i); + save_item(NAME(voice->m_playing), i); + save_item(NAME(voice->m_sample), i); + save_item(NAME(voice->m_channel_volume), i); + save_item(NAME(voice->m_pan_volume_left), i); + save_item(NAME(voice->m_pan_volume_right), i); + save_item(NAME(voice->m_startSample), i); + save_item(NAME(voice->m_endSample), i); + save_item(NAME(voice->m_interpSampleNum), i); + } } diff --git a/src/emu/sound/okim9810.h b/src/emu/sound/okim9810.h index 75316b7cf96..823a8e25f59 100644 --- a/src/emu/sound/okim9810.h +++ b/src/emu/sound/okim9810.h @@ -134,7 +134,8 @@ protected: static const UINT8 s_volume_table[16]; }; - + 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 index de4f8024a5d..10367590e1b 100644 --- a/src/emu/sound/sound.mak +++ b/src/emu/sound/sound.mak @@ -161,6 +161,15 @@ 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 + #------------------------------------------------- diff --git a/src/emu/sound/wavwrite.c b/src/emu/sound/wavwrite.c index 36cae72ded5..4e4a5677c51 100644 --- a/src/emu/sound/wavwrite.c +++ b/src/emu/sound/wavwrite.c @@ -1,4 +1,4 @@ -#include "coretmpl.h" +#include "emu.h" #include "sound/wavwrite.h" struct wav_file diff --git a/src/emu/ui/filemngr.c b/src/emu/ui/filemngr.c index 2c4097f96b9..9b4cc42c4f4 100644 --- a/src/emu/ui/filemngr.c +++ b/src/emu/ui/filemngr.c @@ -33,6 +33,8 @@ ui_menu_file_manager::ui_menu_file_manager(running_machine &machine, render_cont m_warnings.cpy(warnings); else m_warnings.reset(); + + m_curr_selected = FALSE; } @@ -165,12 +167,16 @@ void ui_menu_file_manager::handle() if (event != NULL && event->itemref != NULL && event->iptkey == IPT_UI_SELECT) { if ((FPTR)event->itemref == 1) - machine().schedule_hard_reset(); + { + if (m_curr_selected) + machine().schedule_hard_reset(); + } else { selected_device = (device_image_interface *) event->itemref; if (selected_device != NULL) { + m_curr_selected = TRUE; ui_menu::stack_push(selected_device->get_selection_menu(machine(), container)); // reset the existing menu diff --git a/src/emu/ui/filemngr.h b/src/emu/ui/filemngr.h index 3bcdb28679b..a2d7fbca74f 100644 --- a/src/emu/ui/filemngr.h +++ b/src/emu/ui/filemngr.h @@ -32,6 +32,7 @@ public: private: astring m_warnings; + bool m_curr_selected; }; #endif /* __UI_FILEMNGR_H__ */ diff --git a/src/emu/ui/ui.c b/src/emu/ui/ui.c index 664775f2b1b..b968937cbea 100644 --- a/src/emu/ui/ui.c +++ b/src/emu/ui/ui.c @@ -456,7 +456,7 @@ void ui_manager::update_and_render(render_container *container) { float mouse_y=-1,mouse_x=-1; if (mouse_target->map_point_container(mouse_target_x, mouse_target_y, *container, mouse_x, mouse_y)) { - container->add_quad(mouse_x,mouse_y,mouse_x + 0.05*container->manager().ui_aspect(),mouse_y + 0.05,UI_TEXT_COLOR,m_mouse_arrow_texture,PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA)); + container->add_quad(mouse_x,mouse_y,mouse_x + 0.05*container->manager().ui_aspect(container),mouse_y + 0.05,UI_TEXT_COLOR,m_mouse_arrow_texture,PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA)); } } } @@ -600,7 +600,7 @@ void ui_manager::draw_text_full(render_container *container, const char *origs, const char *linestart; float cury = y; float maxwidth = 0; - float aspect = machine().render().ui_aspect(); + float aspect = machine().render().ui_aspect(container); // if we don't want wrapping, guarantee a huge wrapwidth if (wrap == WRAP_NEVER) diff --git a/src/emu/video.c b/src/emu/video.c index 2518bd101c0..11dc4545540 100644 --- a/src/emu/video.c +++ b/src/emu/video.c @@ -106,7 +106,8 @@ video_manager::video_manager(running_machine &machine) m_avi_file(NULL), m_avi_frame_period(attotime::zero), m_avi_next_frame_time(attotime::zero), - m_avi_frame(0) + m_avi_frame(0), + m_dummy_recording(false) { // request a callback upon exiting machine.add_notifier(MACHINE_NOTIFY_EXIT, machine_notify_delegate(FUNC(video_manager::exit), this)); @@ -152,6 +153,10 @@ 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 // if no screens, create a periodic timer to drive updates if (machine.first_screen() == NULL) @@ -1232,7 +1237,7 @@ file_error video_manager::open_next(emu_file &file, const char *extension) void video_manager::record_frame() { // ignore if nothing to do - if (m_mng_file == NULL && m_avi_file == NULL) + if (m_mng_file == NULL && m_avi_file == NULL && !m_dummy_recording) return; // start the profiler and get the current time diff --git a/src/emu/video.h b/src/emu/video.h index 5904b4c6c53..c5ca9c9e27b 100644 --- a/src/emu/video.h +++ b/src/emu/video.h @@ -176,6 +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 static const UINT8 s_skiptable[FRAMESKIP_LEVELS][FRAMESKIP_LEVELS]; diff --git a/src/emu/video/video.mak b/src/emu/video/video.mak index 3ac034a254d..28aeacf9e07 100644 --- a/src/emu/video/video.mak +++ b/src/emu/video/video.mak @@ -598,6 +598,16 @@ 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 diff --git a/src/emu/video/voodoo_pci.c b/src/emu/video/voodoo_pci.c new file mode 100644 index 00000000000..2b7a6f07433 --- /dev/null +++ b/src/emu/video/voodoo_pci.c @@ -0,0 +1,81 @@ +#include "voodoo_pci.h" + +static MACHINE_CONFIG_FRAGMENT( voodoo_pci ) + MCFG_DEVICE_ADD("voodoo", VOODOO_BANSHEE, STD_VOODOO_BANSHEE_CLOCK) + MCFG_VOODOO_FBMEM(16) + MCFG_VOODOO_SCREEN_TAG("screen") + MCFG_VOODOO_CPU_TAG(":maincpu") +MACHINE_CONFIG_END + +machine_config_constructor voodoo_pci_device::device_mconfig_additions() const +{ + return MACHINE_CONFIG_NAME( voodoo_pci ); +} + +const device_type VOODOO_PCI = &device_creator; + +DEVICE_ADDRESS_MAP_START(reg_map, 32, voodoo_pci_device) + AM_RANGE(0x0, 0x01ffffff) AM_DEVREADWRITE("voodoo", voodoo_banshee_device, banshee_r, banshee_w) +ADDRESS_MAP_END +DEVICE_ADDRESS_MAP_START(lfb_map, 32, voodoo_pci_device) + AM_RANGE(0x0, 0x00ffffff) AM_DEVREADWRITE("voodoo", voodoo_banshee_device, banshee_fb_r, banshee_fb_w) +ADDRESS_MAP_END +DEVICE_ADDRESS_MAP_START(io_map, 32, voodoo_pci_device) + AM_RANGE(0x000, 0x0ff) AM_DEVREADWRITE("voodoo", voodoo_banshee_device, banshee_io_r, banshee_io_w) +ADDRESS_MAP_END + +voodoo_pci_device::voodoo_pci_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + : pci_device(mconfig, VOODOO_PCI, "Voodoo PCI", tag, owner, clock, "voodoo_pci", __FILE__), + m_voodoo(*this, "voodoo") +{ +} + +void voodoo_pci_device::device_start() +{ + pci_device::device_start(); + add_map(32*1024*1024, M_MEM, FUNC(voodoo_pci_device::reg_map)); + add_map(16*1024*1024, M_MEM, FUNC(voodoo_pci_device::lfb_map)); + add_map(256, M_IO, FUNC(voodoo_pci_device::io_map)); +} + +void voodoo_pci_device::device_reset() +{ + pci_device::device_reset(); +} + +void voodoo_pci_device::map_extra(UINT64 memory_window_start, UINT64 memory_window_end, UINT64 memory_offset, address_space *memory_space, + UINT64 io_window_start, UINT64 io_window_end, UINT64 io_offset, address_space *io_space) +{ + logerror("%s: map_extra\n", tag()); + // Really awkward way of getting vga address space mapped + // Should really be dependent on voodoo VGAINIT0 bit 8 and IO base + 0xc3 bit 0 + if (1) { + // io map is on bank_infos[2] + bank_info &bi = bank_infos[2]; + if(bi.adr==-1) + return; + if(UINT32(bi.adr) == UINT32(~(bi.size - 1))) + return; + + UINT64 start; + address_space *space; + if(bi.flags & M_IO) { + space = io_space; + start = bi.adr + io_offset; + } else { + space = memory_space; + start = bi.adr + memory_offset; + } + // The mapping needs to only check high address bits + start = (start & 0xFFFF0000) + 0x300; + UINT64 end = (start & 0xFFFF0000) + 0x3ef; + space->install_device_delegate(start, end, *this, bi.map); + logerror("%s: map %s at %0*x-%0*x\n", tag(), bi.map.name(), bi.flags & M_IO ? 4 : 8, UINT32(start), bi.flags & M_IO ? 4 : 8, UINT32(end)); + } + +} + +UINT32 voodoo_pci_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +{ + return voodoo_update(m_voodoo, bitmap, cliprect) ? 0 : UPDATE_HAS_NOT_CHANGED; +} diff --git a/src/emu/video/voodoo_pci.h b/src/emu/video/voodoo_pci.h new file mode 100644 index 00000000000..878c564e4b8 --- /dev/null +++ b/src/emu/video/voodoo_pci.h @@ -0,0 +1,35 @@ +// 3dfx Voodoo Graphics SST-1/2 emulator. + +#ifndef VOODOO_PCI_H +#define VOODOO_PCI_H + +#include "machine/pci.h" +#include "voodoo.h" + +#define MCFG_VOODOO_ADD(_tag) \ + MCFG_PCI_DEVICE_ADD(_tag, VOODOO_PCI, 0x121a0005, 0x02, 0x000003, 0x000000) + +class voodoo_pci_device : public pci_device { +public: + voodoo_pci_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + virtual void map_extra(UINT64 memory_window_start, UINT64 memory_window_end, UINT64 memory_offset, address_space *memory_space, + UINT64 io_window_start, UINT64 io_window_end, UINT64 io_offset, address_space *io_space); + // optional information overrides + virtual machine_config_constructor device_mconfig_additions() const; + UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + +protected: + virtual void device_start(); + virtual void device_reset(); + +private: + required_device m_voodoo; + + DECLARE_ADDRESS_MAP(reg_map, 32); + DECLARE_ADDRESS_MAP(lfb_map, 32); + DECLARE_ADDRESS_MAP(io_map, 32); +}; + +extern const device_type VOODOO_PCI; + +#endif diff --git a/src/lib/formats/a26_cas.c b/src/lib/formats/a26_cas.c index 5d557626912..7ee425fd1af 100644 --- a/src/lib/formats/a26_cas.c +++ b/src/lib/formats/a26_cas.c @@ -4,6 +4,7 @@ Atari 2600 SuperCharger support */ +#include #include "formats/a26_cas.h" diff --git a/src/lib/formats/a5105_dsk.c b/src/lib/formats/a5105_dsk.c index 61586f93851..33d7f15e1fd 100644 --- a/src/lib/formats/a5105_dsk.c +++ b/src/lib/formats/a5105_dsk.c @@ -8,7 +8,8 @@ *********************************************************************/ -#include "emu.h" +#include + #include "formats/a5105_dsk.h" a5105_format::a5105_format() : upd765_format(formats) diff --git a/src/lib/formats/abc800_dsk.c b/src/lib/formats/abc800_dsk.c index b1d0db2c640..5686d502382 100644 --- a/src/lib/formats/abc800_dsk.c +++ b/src/lib/formats/abc800_dsk.c @@ -8,7 +8,8 @@ *********************************************************************/ -#include "emu.h" +#include + #include "formats/abc800_dsk.h" abc800_format::abc800_format() : wd177x_format(formats) diff --git a/src/lib/formats/ace_tap.c b/src/lib/formats/ace_tap.c index b57dcb03cd7..8d6d4694b05 100644 --- a/src/lib/formats/ace_tap.c +++ b/src/lib/formats/ace_tap.c @@ -7,6 +7,9 @@ For more information see: - http://www.jupiter-ace.co.uk/doc_AceTapeFormat.html ********************************************************************/ + +#include + #include "ace_tap.h" diff --git a/src/lib/formats/adam_cas.c b/src/lib/formats/adam_cas.c index 1e8e328b517..83f873c5f00 100644 --- a/src/lib/formats/adam_cas.c +++ b/src/lib/formats/adam_cas.c @@ -1,4 +1,6 @@ +#include + #include "cassimg.h" #include "adam_cas.h" diff --git a/src/lib/formats/adam_dsk.c b/src/lib/formats/adam_dsk.c index 1b966a3395b..e78e94a4763 100644 --- a/src/lib/formats/adam_dsk.c +++ b/src/lib/formats/adam_dsk.c @@ -8,7 +8,8 @@ *********************************************************************/ -#include "emu.h" +#include + #include "formats/adam_dsk.h" adam_format::adam_format() : wd177x_format(formats) diff --git a/src/lib/formats/ami_dsk.c b/src/lib/formats/ami_dsk.c index 230310c4995..a222208d46d 100644 --- a/src/lib/formats/ami_dsk.c +++ b/src/lib/formats/ami_dsk.c @@ -8,6 +8,8 @@ *********************************************************************/ +#include + #include "formats/ami_dsk.h" adf_format::adf_format() : floppy_image_format_t() diff --git a/src/lib/formats/ap_dsk35.c b/src/lib/formats/ap_dsk35.c index 8eee2ee0dab..f218c996abd 100644 --- a/src/lib/formats/ap_dsk35.c +++ b/src/lib/formats/ap_dsk35.c @@ -99,7 +99,7 @@ #include #include -#include "emu.h" +#include "emu.h" // logerror #include "ap_dsk35.h" struct apple35_tag diff --git a/src/lib/formats/apf_apt.c b/src/lib/formats/apf_apt.c index 58582ef5dc8..b609a109ef6 100644 --- a/src/lib/formats/apf_apt.c +++ b/src/lib/formats/apf_apt.c @@ -34,6 +34,8 @@ e. A checksum byte (8-bit addition) ********************************************************************/ +#include + #include "formats/apf_apt.h" #define WAVEENTRY_LOW -32768 diff --git a/src/lib/formats/apollo_dsk.c b/src/lib/formats/apollo_dsk.c index eec6e24beb2..2770122a5c9 100644 --- a/src/lib/formats/apollo_dsk.c +++ b/src/lib/formats/apollo_dsk.c @@ -8,7 +8,8 @@ *********************************************************************/ -#include "emu.h" +#include + #include "formats/apollo_dsk.h" apollo_format::apollo_format() : upd765_format(formats) diff --git a/src/lib/formats/applix_dsk.c b/src/lib/formats/applix_dsk.c index c90b93a5203..726f11daed9 100644 --- a/src/lib/formats/applix_dsk.c +++ b/src/lib/formats/applix_dsk.c @@ -8,7 +8,8 @@ *********************************************************************/ -#include "emu.h" +#include + #include "formats/applix_dsk.h" applix_format::applix_format() : wd177x_format(formats) diff --git a/src/lib/formats/apridisk.c b/src/lib/formats/apridisk.c index 016d41e6210..0416add4405 100644 --- a/src/lib/formats/apridisk.c +++ b/src/lib/formats/apridisk.c @@ -4,7 +4,7 @@ ***************************************************************************/ -#include "emu.h" +#include "emu.h" // fatalerror #include "apridisk.h" #include "imageutl.h" #include "coretmpl.h" diff --git a/src/lib/formats/asst128_dsk.c b/src/lib/formats/asst128_dsk.c index feffad34c08..fe64cc725ee 100644 --- a/src/lib/formats/asst128_dsk.c +++ b/src/lib/formats/asst128_dsk.c @@ -8,7 +8,8 @@ *********************************************************************/ -#include "emu.h" +#include + #include "formats/asst128_dsk.h" asst128_format::asst128_format() : upd765_format(formats) diff --git a/src/lib/formats/atari_dsk.c b/src/lib/formats/atari_dsk.c index 3e721adc0ff..cbfbcc3d21f 100644 --- a/src/lib/formats/atari_dsk.c +++ b/src/lib/formats/atari_dsk.c @@ -6,6 +6,8 @@ *********************************************************************/ +#include + #include "formats/atari_dsk.h" static FLOPPY_IDENTIFY( atari_dsk_identify ) diff --git a/src/lib/formats/atarist_dsk.c b/src/lib/formats/atarist_dsk.c index 7901ba2a55d..aa0761465bf 100644 --- a/src/lib/formats/atarist_dsk.c +++ b/src/lib/formats/atarist_dsk.c @@ -6,6 +6,8 @@ *********************************************************************/ +#include + #include "formats/atarist_dsk.h" #include "formats/basicdsk.h" diff --git a/src/lib/formats/atom_tap.c b/src/lib/formats/atom_tap.c index a5a76a8733e..99335fa4230 100644 --- a/src/lib/formats/atom_tap.c +++ b/src/lib/formats/atom_tap.c @@ -38,6 +38,8 @@ */ +#include + #include "atom_tap.h" #include "uef_cas.h" /*************************************************************************** diff --git a/src/lib/formats/bw12_dsk.c b/src/lib/formats/bw12_dsk.c index e497225bc08..06c8be72347 100644 --- a/src/lib/formats/bw12_dsk.c +++ b/src/lib/formats/bw12_dsk.c @@ -8,7 +8,8 @@ *********************************************************************/ -#include "emu.h" +#include + #include "formats/bw12_dsk.h" bw12_format::bw12_format() : upd765_format(formats) diff --git a/src/lib/formats/bw2_dsk.c b/src/lib/formats/bw2_dsk.c index e5f66b5fe05..3dc46e9b225 100644 --- a/src/lib/formats/bw2_dsk.c +++ b/src/lib/formats/bw2_dsk.c @@ -8,7 +8,8 @@ *********************************************************************/ -#include "emu.h" +#include + #include "formats/bw2_dsk.h" bw2_format::bw2_format() : upd765_format(formats) diff --git a/src/lib/formats/cassimg.c b/src/lib/formats/cassimg.c index 20ccbc99407..7de195315ef 100644 --- a/src/lib/formats/cassimg.c +++ b/src/lib/formats/cassimg.c @@ -6,8 +6,8 @@ *********************************************************************/ -#include #include +#include #include "imageutl.h" #include "cassimg.h" diff --git a/src/lib/formats/cbm_crt.c b/src/lib/formats/cbm_crt.c index 6ce4cc992d8..abfd85ed5c1 100644 --- a/src/lib/formats/cbm_crt.c +++ b/src/lib/formats/cbm_crt.c @@ -39,6 +39,9 @@ *********************************************************************/ +#include "emu.h" // fatalerror +#include "astring.h" +#include "corefile.h" #include "cbm_crt.h" @@ -202,8 +205,8 @@ bool cbm_crt_read_header(core_file* file, size_t *roml_size, size_t *romh_size, bool cbm_crt_read_data(core_file* file, UINT8 *roml, UINT8 *romh) { - offs_t roml_offset = 0; - offs_t romh_offset = 0; + UINT32 roml_offset = 0; + UINT32 romh_offset = 0; core_fseek(file, CRT_HEADER_LENGTH, SEEK_SET); diff --git a/src/lib/formats/cbm_crt.h b/src/lib/formats/cbm_crt.h index bfb8732442c..8049ddacff7 100644 --- a/src/lib/formats/cbm_crt.h +++ b/src/lib/formats/cbm_crt.h @@ -13,7 +13,6 @@ #ifndef __CBM_CRT__ #define __CBM_CRT__ -#include "emu.h" #include "formats/imageutl.h" diff --git a/src/lib/formats/cbm_tap.c b/src/lib/formats/cbm_tap.c index a78b03df117..f02b4ac1968 100644 --- a/src/lib/formats/cbm_tap.c +++ b/src/lib/formats/cbm_tap.c @@ -92,6 +92,8 @@ Unfortunately, I have no such a .tap file to test, so my implementation below could be not working. FP ] */ +#include + #include "cbm_tap.h" diff --git a/src/lib/formats/ccvf_dsk.c b/src/lib/formats/ccvf_dsk.c index d8dc0117bd3..dfb43565d88 100644 --- a/src/lib/formats/ccvf_dsk.c +++ b/src/lib/formats/ccvf_dsk.c @@ -8,7 +8,8 @@ *********************************************************************/ -#include "emu.h" +#include "emu.h" // BIT +#include "astring.h" #include "formats/ccvf_dsk.h" ccvf_format::ccvf_format() @@ -98,7 +99,7 @@ bool ccvf_format::load(io_generic *io, UINT32 form_factor, floppy_image *image) int start = 0, end = 0; astring line; - offs_t byteoffs = 0; + UINT32 byteoffs = 0; char hex[3] = {0}; do { diff --git a/src/lib/formats/cgen_cas.c b/src/lib/formats/cgen_cas.c index 242e833ceb2..5d29f7e2b61 100644 --- a/src/lib/formats/cgen_cas.c +++ b/src/lib/formats/cgen_cas.c @@ -7,6 +7,8 @@ Current state: Not working. Only the sync signal and 0x66 byte get ********************************************************************/ +#include + #include "formats/cgen_cas.h" #define TAPE_HEADER "Colour Genie - Virtual Tape File" diff --git a/src/lib/formats/coco_cas.c b/src/lib/formats/coco_cas.c index 880549c96ce..efc660943e3 100644 --- a/src/lib/formats/coco_cas.c +++ b/src/lib/formats/coco_cas.c @@ -31,7 +31,7 @@ **************************************************************************/ -#include "emu.h" +#include "emu.h" // PAIR #include "coco_cas.h" #define COCO_WAVESAMPLES_HEADER (1.0) diff --git a/src/lib/formats/coco_dsk.c b/src/lib/formats/coco_dsk.c index b3f2b306c43..00b785d3e8b 100644 --- a/src/lib/formats/coco_dsk.c +++ b/src/lib/formats/coco_dsk.c @@ -7,8 +7,8 @@ *********************************************************************/ #include -#include #include +#include #include "formats/coco_dsk.h" #include "formats/basicdsk.h" diff --git a/src/lib/formats/comx35_dsk.c b/src/lib/formats/comx35_dsk.c index 860cc13b74d..aa8603f3c1c 100644 --- a/src/lib/formats/comx35_dsk.c +++ b/src/lib/formats/comx35_dsk.c @@ -36,7 +36,8 @@ */ -#include "emu.h" +#include + #include "formats/comx35_dsk.h" comx35_format::comx35_format() : wd177x_format(formats) diff --git a/src/lib/formats/concept_dsk.c b/src/lib/formats/concept_dsk.c index 3c742248043..c23a3c35675 100644 --- a/src/lib/formats/concept_dsk.c +++ b/src/lib/formats/concept_dsk.c @@ -10,7 +10,8 @@ *********************************************************************/ -#include "emu.h" +#include + #include "flopimg.h" #include "formats/concept_dsk.h" diff --git a/src/lib/formats/coupedsk.c b/src/lib/formats/coupedsk.c index 30ddcd394a8..e57d01abadf 100644 --- a/src/lib/formats/coupedsk.c +++ b/src/lib/formats/coupedsk.c @@ -6,7 +6,8 @@ **************************************************************************/ -#include "emu.h" +#include + #include "formats/coupedsk.h" #include "flopimg.h" diff --git a/src/lib/formats/cpis_dsk.c b/src/lib/formats/cpis_dsk.c index 9ad24d1d236..d5a763acfb6 100644 --- a/src/lib/formats/cpis_dsk.c +++ b/src/lib/formats/cpis_dsk.c @@ -7,8 +7,8 @@ *********************************************************************/ #include +#include -#include "emu.h" #include "formats/cpis_dsk.h" #include "formats/basicdsk.h" @@ -106,7 +106,6 @@ LEGACY_FLOPPY_OPTIONS_END *********************************************************************/ -#include "emu.h" #include "formats/cpis_dsk.h" cpis_format::cpis_format() : upd765_format(formats) diff --git a/src/lib/formats/cqm_dsk.c b/src/lib/formats/cqm_dsk.c index ca8ae98039b..0061af8c869 100644 --- a/src/lib/formats/cqm_dsk.c +++ b/src/lib/formats/cqm_dsk.c @@ -7,6 +7,7 @@ *********************************************************************/ #include +#include #include "flopimg.h" #define CQM_HEADER_SIZE 133 diff --git a/src/lib/formats/csw_cas.c b/src/lib/formats/csw_cas.c index 39ceb594e8f..e6b51b78c1e 100644 --- a/src/lib/formats/csw_cas.c +++ b/src/lib/formats/csw_cas.c @@ -23,6 +23,7 @@ Offset Value Type Description #include #include +#include #include "uef_cas.h" #include "csw_cas.h" diff --git a/src/lib/formats/d64_dsk.c b/src/lib/formats/d64_dsk.c index 9c0fa259363..172918a3051 100644 --- a/src/lib/formats/d64_dsk.c +++ b/src/lib/formats/d64_dsk.c @@ -10,7 +10,7 @@ *********************************************************************/ -#include "emu.h" +#include "emu.h" // emu_fatalerror, fatalerror #include "formats/d64_dsk.h" d64_format::d64_format() @@ -167,7 +167,7 @@ floppy_image_format_t::desc_e* d64_format::get_sector_desc(const format &f, int return desc; } -void d64_format::build_sector_description(const format &f, UINT8 *sectdata, offs_t sect_offs, offs_t error_offs, desc_s *sectors, int sector_count) const +void d64_format::build_sector_description(const format &f, UINT8 *sectdata, UINT32 sect_offs, UINT32 error_offs, desc_s *sectors, int sector_count) const { for (int i = 0; i < sector_count; i++) { sectors[i].data = sectdata + sect_offs; diff --git a/src/lib/formats/d64_dsk.h b/src/lib/formats/d64_dsk.h index 34be1d8fd16..af462753348 100644 --- a/src/lib/formats/d64_dsk.h +++ b/src/lib/formats/d64_dsk.h @@ -64,7 +64,7 @@ protected: virtual int get_disk_id_offset(const format &f); void get_disk_id(const format &f, io_generic *io, UINT8 &id1, UINT8 &id2); virtual floppy_image_format_t::desc_e* get_sector_desc(const format &f, int ¤t_size, int sector_count, UINT8 id1, UINT8 id2, int gap_2); - void build_sector_description(const format &f, UINT8 *sectdata, offs_t sect_offs, offs_t error_offs, desc_s *sectors, int sector_count) const; + void build_sector_description(const format &f, UINT8 *sectdata, UINT32 sect_offs, UINT32 error_offs, desc_s *sectors, int sector_count) const; static const format file_formats[]; diff --git a/src/lib/formats/d67_dsk.c b/src/lib/formats/d67_dsk.c index 39ce16131de..b512e55b694 100644 --- a/src/lib/formats/d67_dsk.c +++ b/src/lib/formats/d67_dsk.c @@ -8,7 +8,8 @@ *********************************************************************/ -#include "emu.h" +#include + #include "formats/d67_dsk.h" d67_format::d67_format() : d64_format(file_formats) diff --git a/src/lib/formats/d71_dsk.c b/src/lib/formats/d71_dsk.c index f7925526fda..af1186948c6 100644 --- a/src/lib/formats/d71_dsk.c +++ b/src/lib/formats/d71_dsk.c @@ -8,7 +8,8 @@ *********************************************************************/ -#include "emu.h" +#include + #include "formats/d71_dsk.h" d71_format::d71_format() : d64_format(formats) diff --git a/src/lib/formats/d80_dsk.c b/src/lib/formats/d80_dsk.c index 55a6f0d8ade..fbabbf1749e 100644 --- a/src/lib/formats/d80_dsk.c +++ b/src/lib/formats/d80_dsk.c @@ -8,7 +8,8 @@ *********************************************************************/ -#include "emu.h" +#include + #include "formats/d80_dsk.h" d80_format::d80_format() : d64_format(file_formats) diff --git a/src/lib/formats/d81_dsk.c b/src/lib/formats/d81_dsk.c index 4c04ef51293..714b9c3cd9e 100644 --- a/src/lib/formats/d81_dsk.c +++ b/src/lib/formats/d81_dsk.c @@ -73,7 +73,8 @@ PER SECTOR ORGANIZATION: */ -#include "emu.h" +#include + #include "formats/d81_dsk.h" d81_format::d81_format() : wd177x_format(formats) diff --git a/src/lib/formats/d82_dsk.c b/src/lib/formats/d82_dsk.c index 4d89f5e1313..dfcff3a1f27 100644 --- a/src/lib/formats/d82_dsk.c +++ b/src/lib/formats/d82_dsk.c @@ -8,7 +8,8 @@ *********************************************************************/ -#include "emu.h" +#include + #include "formats/d82_dsk.h" d82_format::d82_format() : d80_format(file_formats) diff --git a/src/lib/formats/d88_dsk.c b/src/lib/formats/d88_dsk.c index 0d41d49db5e..abb2eac3079 100644 --- a/src/lib/formats/d88_dsk.c +++ b/src/lib/formats/d88_dsk.c @@ -27,7 +27,8 @@ * */ -#include "emu.h" + #include + #include "flopimg.h" #include "imageutl.h" @@ -390,7 +391,6 @@ FLOPPY_CONSTRUCT(d88_dsk_construct) *********************************************************************/ -#include "emu.h" #include "d88_dsk.h" d88_format::d88_format() diff --git a/src/lib/formats/dcp_dsk.c b/src/lib/formats/dcp_dsk.c index bdcc2966036..dc05f4a4b44 100644 --- a/src/lib/formats/dcp_dsk.c +++ b/src/lib/formats/dcp_dsk.c @@ -20,7 +20,8 @@ *********************************************************************/ -#include "emu.h" +#include + #include "dcp_dsk.h" dcp_format::dcp_format() diff --git a/src/lib/formats/dfi_dsk.c b/src/lib/formats/dfi_dsk.c index 28a774c906e..16341f55b26 100644 --- a/src/lib/formats/dfi_dsk.c +++ b/src/lib/formats/dfi_dsk.c @@ -11,18 +11,18 @@ * Correctly note exact index timing. */ -#include "emu.h" +#include "emu.h" // fatalerror #include "dfi_dsk.h" #include #define NUMBER_OF_MULTIREADS 3 // threshholds for brickwall windowing -//define MIN_CLOCKS 65 +//define DFI_MIN_CLOCKS 65 // number_please apple2 wants 40 min -#define MIN_CLOCKS 60 +#define DFI_MIN_CLOCKS 60 //define MAX_CLOCKS 260 -#define MAX_CLOCKS 270 -#define MIN_THRESH (MIN_CLOCKS*(clock_rate/25000000)) -#define MAX_THRESH (MAX_CLOCKS*(clock_rate/25000000)) +#define DFI_MAX_CLOCKS 270 +#define MIN_THRESH (DFI_MIN_CLOCKS*(clock_rate/25000000)) +#define MAX_THRESH (DFI_MAX_CLOCKS*(clock_rate/25000000)) // constants to help guess clockrate and rpm // constant is 25mhz / 6 revolutions per second (360rpm) = 4166667 +- 2.5% #define REV25_MIN 4062500 diff --git a/src/lib/formats/dim_dsk.c b/src/lib/formats/dim_dsk.c index 8287647483e..b78bec1ba31 100644 --- a/src/lib/formats/dim_dsk.c +++ b/src/lib/formats/dim_dsk.c @@ -7,8 +7,8 @@ *********************************************************************/ #include +#include -#include "emu.h" #include "dim_dsk.h" #include "basicdsk.h" @@ -105,13 +105,12 @@ FLOPPY_CONSTRUCT(dim_dsk_construct) // copyright-holders:Olivier Galibert /********************************************************************* - formats/dim_dsk.h + formats/dim_dsk.c DIM disk images *********************************************************************/ -#include "emu.h" #include "dim_dsk.h" dim_format::dim_format() diff --git a/src/lib/formats/dip_dsk.c b/src/lib/formats/dip_dsk.c index 85f142df8fa..ae320e4cb7e 100644 --- a/src/lib/formats/dip_dsk.c +++ b/src/lib/formats/dip_dsk.c @@ -14,7 +14,8 @@ *********************************************************************/ -#include "emu.h" +#include + #include "dip_dsk.h" dip_format::dip_format() diff --git a/src/lib/formats/dmk_dsk.c b/src/lib/formats/dmk_dsk.c index 2af453d66fa..1c87d268b48 100644 --- a/src/lib/formats/dmk_dsk.c +++ b/src/lib/formats/dmk_dsk.c @@ -13,7 +13,8 @@ TODO: *********************************************************************/ -#include "emu.h" +#include + #include "dmk_dsk.h" diff --git a/src/lib/formats/dmv_dsk.c b/src/lib/formats/dmv_dsk.c index 2dabe9ff05e..02469ed74d4 100644 --- a/src/lib/formats/dmv_dsk.c +++ b/src/lib/formats/dmv_dsk.c @@ -8,7 +8,8 @@ *********************************************************************/ -#include "emu.h" +#include + #include "formats/dmv_dsk.h" dmv_format::dmv_format() : upd765_format(formats) diff --git a/src/lib/formats/dsk_dsk.c b/src/lib/formats/dsk_dsk.c index 93ae590e846..6129ff72b77 100644 --- a/src/lib/formats/dsk_dsk.c +++ b/src/lib/formats/dsk_dsk.c @@ -7,8 +7,8 @@ *********************************************************************/ #include +#include -#include "emu.h" #include "imageutl.h" #include "flopimg.h" @@ -264,7 +264,6 @@ FLOPPY_CONSTRUCT( dsk_dsk_construct ) return FLOPPY_ERROR_SUCCESS; } -#include "emu.h" #include "dsk_dsk.h" #define DSK_FORMAT_HEADER "MV - CPC" diff --git a/src/lib/formats/ep64_dsk.c b/src/lib/formats/ep64_dsk.c index ee63ee20ab9..80981bf698e 100644 --- a/src/lib/formats/ep64_dsk.c +++ b/src/lib/formats/ep64_dsk.c @@ -8,7 +8,8 @@ *********************************************************************/ -#include "emu.h" +#include + #include "formats/ep64_dsk.h" ep64_format::ep64_format() : wd177x_format(formats) diff --git a/src/lib/formats/esq16_dsk.c b/src/lib/formats/esq16_dsk.c index 4b370cfe0bd..01b1120e677 100644 --- a/src/lib/formats/esq16_dsk.c +++ b/src/lib/formats/esq16_dsk.c @@ -8,7 +8,8 @@ *********************************************************************/ -#include "emu.h" +#include + #include "flopimg.h" #include "formats/esq16_dsk.h" diff --git a/src/lib/formats/esq8_dsk.c b/src/lib/formats/esq8_dsk.c index 8af0bc46a84..763c303d20a 100644 --- a/src/lib/formats/esq8_dsk.c +++ b/src/lib/formats/esq8_dsk.c @@ -10,7 +10,8 @@ *********************************************************************/ -#include "emu.h" +#include + #include "flopimg.h" #include "formats/esq8_dsk.h" diff --git a/src/lib/formats/excali64_dsk.c b/src/lib/formats/excali64_dsk.c index 5de86815099..cff39939171 100644 --- a/src/lib/formats/excali64_dsk.c +++ b/src/lib/formats/excali64_dsk.c @@ -8,7 +8,8 @@ *********************************************************************/ -#include "emu.h" +#include + #include "formats/excali64_dsk.h" excali64_format::excali64_format() : wd177x_format(formats) diff --git a/src/lib/formats/fc100_cas.c b/src/lib/formats/fc100_cas.c index 64deef962a0..415d3fb01db 100644 --- a/src/lib/formats/fc100_cas.c +++ b/src/lib/formats/fc100_cas.c @@ -10,6 +10,8 @@ it's all a guess. ********************************************************************/ +#include + #include "fc100_cas.h" #define WAVEENTRY_LOW -32768 diff --git a/src/lib/formats/fdd_dsk.c b/src/lib/formats/fdd_dsk.c index e9d76a99973..10d9958ca59 100644 --- a/src/lib/formats/fdd_dsk.c +++ b/src/lib/formats/fdd_dsk.c @@ -31,7 +31,8 @@ *********************************************************************/ -#include "emu.h" +#include + #include "fdd_dsk.h" fdd_format::fdd_format() diff --git a/src/lib/formats/fdi_dsk.c b/src/lib/formats/fdi_dsk.c index 9bf9019f5d3..9d556f66e9a 100644 --- a/src/lib/formats/fdi_dsk.c +++ b/src/lib/formats/fdi_dsk.c @@ -14,6 +14,7 @@ */ +#include #include "imageutl.h" #include "flopimg.h" diff --git a/src/lib/formats/flex_dsk.c b/src/lib/formats/flex_dsk.c index 975cf246ecf..34aa965643d 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" + #include "emu.h" // logerror #include "flex_dsk.h" flex_format::flex_format() diff --git a/src/lib/formats/flopimg.c b/src/lib/formats/flopimg.c index 2f3260366ce..5b9e5f7ee03 100644 --- a/src/lib/formats/flopimg.c +++ b/src/lib/formats/flopimg.c @@ -10,10 +10,10 @@ #include #include #include -#include #include +#include -#include "emu.h" +#include "emu.h" // emu_fatalerror #include "osdcore.h" #include "ioprocs.h" #include "flopimg.h" diff --git a/src/lib/formats/fm7_cas.c b/src/lib/formats/fm7_cas.c index 32ec7390459..48b0239f738 100644 --- a/src/lib/formats/fm7_cas.c +++ b/src/lib/formats/fm7_cas.c @@ -2,6 +2,8 @@ * Fujitsu FM-7 series cassette handling */ +#include + #include "fm7_cas.h" #define WAVE_HIGH 0x5a9e diff --git a/src/lib/formats/fmsx_cas.c b/src/lib/formats/fmsx_cas.c index 082be3cda3f..54b64ae4d01 100644 --- a/src/lib/formats/fmsx_cas.c +++ b/src/lib/formats/fmsx_cas.c @@ -1,3 +1,5 @@ +#include + #include "formats/fmsx_cas.h" diff --git a/src/lib/formats/fmtowns_dsk.c b/src/lib/formats/fmtowns_dsk.c index 71db43650ba..83bfd2fbd51 100644 --- a/src/lib/formats/fmtowns_dsk.c +++ b/src/lib/formats/fmtowns_dsk.c @@ -6,7 +6,8 @@ * Created on: 23/03/2014 */ -#include "emu.h" + #include + #include "formats/fmtowns_dsk.h" fmtowns_format::fmtowns_format() : wd177x_format(formats) diff --git a/src/lib/formats/g64_dsk.c b/src/lib/formats/g64_dsk.c index 5beba1ca35f..a2500b473cd 100644 --- a/src/lib/formats/g64_dsk.c +++ b/src/lib/formats/g64_dsk.c @@ -10,7 +10,7 @@ *********************************************************************/ -#include "emu.h" +#include "emu.h" // emu_fatalerror #include "formats/g64_dsk.h" #define G64_FORMAT_HEADER "GCR-1541" @@ -53,7 +53,7 @@ bool g64_format::load(io_generic *io, UINT32 form_factor, floppy_image *image) for (int track = 0; track < track_count; track++) { - offs_t track_offset = pick_integer_le(img, TRACK_OFFSET + (track * 4), 4); + UINT32 track_offset = pick_integer_le(img, TRACK_OFFSET + (track * 4), 4); if (!track_offset) continue; @@ -61,7 +61,7 @@ bool g64_format::load(io_generic *io, UINT32 form_factor, floppy_image *image) if (track_offset > size) throw emu_fatalerror("g64_format: Track %u offset %06x out of bounds", track, track_offset); - offs_t speed_zone = pick_integer_le(img, SPEED_ZONE + (track * 4), 4); + UINT32 speed_zone = pick_integer_le(img, SPEED_ZONE + (track * 4), 4); if (speed_zone > 3) throw emu_fatalerror("g64_format: Unsupported variable speed zones on track %d", track); @@ -102,9 +102,9 @@ bool g64_format::save(io_generic *io, floppy_image *image) dynamic_buffer trackbuf(TRACK_LENGTH-2); for (int track = 0; track < 84; track++) { - offs_t tpos = TRACK_OFFSET + track * 4; - offs_t spos = SPEED_ZONE + track * 4; - offs_t dpos = TRACK_DATA + tracks_written * TRACK_LENGTH; + UINT32 tpos = TRACK_OFFSET + track * 4; + UINT32 spos = SPEED_ZONE + track * 4; + UINT32 dpos = TRACK_DATA + tracks_written * TRACK_LENGTH; io_generic_write_filler(io, 0x00, tpos, 4); io_generic_write_filler(io, 0x00, spos, 4); diff --git a/src/lib/formats/gtp_cas.c b/src/lib/formats/gtp_cas.c index 47baa0aba7e..0fe391e9767 100644 --- a/src/lib/formats/gtp_cas.c +++ b/src/lib/formats/gtp_cas.c @@ -4,6 +4,8 @@ Miodrag Milanovic */ +#include + #include "gtp_cas.h" diff --git a/src/lib/formats/hect_dsk.c b/src/lib/formats/hect_dsk.c index d3644afd536..50e112f0774 100644 --- a/src/lib/formats/hect_dsk.c +++ b/src/lib/formats/hect_dsk.c @@ -6,6 +6,8 @@ *********************************************************************/ +#include + #include "formats/hect_dsk.h" #include "formats/basicdsk.h" diff --git a/src/lib/formats/hect_tap.c b/src/lib/formats/hect_tap.c index ad67de93ecc..745cf2a0038 100644 --- a/src/lib/formats/hect_tap.c +++ b/src/lib/formats/hect_tap.c @@ -12,6 +12,8 @@ You can find some *.K7 file on serveral server in France Updated 3/1/10 : use real value for timing. ********************************************************************/ +#include + #include "hect_tap.h" diff --git a/src/lib/formats/hxcmfm_dsk.c b/src/lib/formats/hxcmfm_dsk.c index 967f05539a3..0203f8f7e26 100644 --- a/src/lib/formats/hxcmfm_dsk.c +++ b/src/lib/formats/hxcmfm_dsk.c @@ -1,6 +1,7 @@ // license:BSD-3-Clause // copyright-holders:Olivier Galibert -#include "emu.h" + +#include #include "hxcmfm_dsk.h" diff --git a/src/lib/formats/imd_dsk.c b/src/lib/formats/imd_dsk.c index ef5478f638f..78f073fef1d 100644 --- a/src/lib/formats/imd_dsk.c +++ b/src/lib/formats/imd_dsk.c @@ -7,7 +7,7 @@ *********************************************************************/ #include -#include "emu.h" +#include #include "flopimg.h" struct imddsk_tag @@ -279,13 +279,13 @@ FLOPPY_CONSTRUCT( imd_dsk_construct ) // copyright-holders:Olivier Galibert /********************************************************************* - formats/imd_dsk.h + formats/imd_dsk.c IMD disk images *********************************************************************/ -#include "emu.h" +#include "emu.h" // emu_fatalerror #include "imd_dsk.h" imd_format::imd_format() diff --git a/src/lib/formats/ioprocs.c b/src/lib/formats/ioprocs.c index 3c47414ae00..b1771bf3774 100644 --- a/src/lib/formats/ioprocs.c +++ b/src/lib/formats/ioprocs.c @@ -1,5 +1,6 @@ #include #include +#include #include "osdcore.h" #include "ioprocs.h" #include "corefile.h" diff --git a/src/lib/formats/ipf_dsk.c b/src/lib/formats/ipf_dsk.c index 7e1704f9b55..3cbd46dcb5a 100644 --- a/src/lib/formats/ipf_dsk.c +++ b/src/lib/formats/ipf_dsk.c @@ -1,4 +1,4 @@ -#include "emu.h" +#include #include "ipf_dsk.h" const floppy_format_type FLOPPY_IPF_FORMAT = &floppy_image_format_creator; diff --git a/src/lib/formats/iq151_dsk.c b/src/lib/formats/iq151_dsk.c index f0df2c19555..dcffad85751 100644 --- a/src/lib/formats/iq151_dsk.c +++ b/src/lib/formats/iq151_dsk.c @@ -8,7 +8,8 @@ *********************************************************************/ -#include "emu.h" +#include + #include "formats/iq151_dsk.h" iq151_format::iq151_format() : upd765_format(formats) diff --git a/src/lib/formats/itt3030_dsk.c b/src/lib/formats/itt3030_dsk.c index 7e0a5709897..7fed1bf3505 100644 --- a/src/lib/formats/itt3030_dsk.c +++ b/src/lib/formats/itt3030_dsk.c @@ -10,7 +10,8 @@ *********************************************************************/ -#include "emu.h" +#include + #include "formats/itt3030_dsk.h" itt3030_format::itt3030_format() : wd177x_format(formats) diff --git a/src/lib/formats/kaypro_dsk.c b/src/lib/formats/kaypro_dsk.c index 3781bb3de0a..e9924ce11c9 100644 --- a/src/lib/formats/kaypro_dsk.c +++ b/src/lib/formats/kaypro_dsk.c @@ -16,7 +16,8 @@ *********************************************************************/ -#include "emu.h" +#include + #include "formats/kaypro_dsk.h" kayproii_format::kayproii_format() : upd765_format(formats) diff --git a/src/lib/formats/kc85_dsk.c b/src/lib/formats/kc85_dsk.c index 0787ef5e82e..84111ff1171 100644 --- a/src/lib/formats/kc85_dsk.c +++ b/src/lib/formats/kc85_dsk.c @@ -8,7 +8,8 @@ *********************************************************************/ -#include "emu.h" +#include + #include "formats/kc85_dsk.h" kc85_format::kc85_format() : upd765_format(formats) diff --git a/src/lib/formats/kc_cas.c b/src/lib/formats/kc_cas.c index 9198a98c4d5..7791afd2e7a 100644 --- a/src/lib/formats/kc_cas.c +++ b/src/lib/formats/kc_cas.c @@ -13,6 +13,8 @@ ********************************************************************/ +#include + #include "kc_cas.h" #define SMPLO -32768 diff --git a/src/lib/formats/kim1_cas.c b/src/lib/formats/kim1_cas.c index c3e048e6acc..b8433c0eea0 100644 --- a/src/lib/formats/kim1_cas.c +++ b/src/lib/formats/kim1_cas.c @@ -1,3 +1,5 @@ +#include + #include "kim1_cas.h" #define SMPLO -32768 diff --git a/src/lib/formats/lviv_lvt.c b/src/lib/formats/lviv_lvt.c index 62de1d63981..87a56a6e2c2 100644 --- a/src/lib/formats/lviv_lvt.c +++ b/src/lib/formats/lviv_lvt.c @@ -1,4 +1,6 @@ /* .LVT tape images */ +#include + #include "lviv_lvt.h" #define WAVEENTRY_LOW -32768 diff --git a/src/lib/formats/m20_dsk.c b/src/lib/formats/m20_dsk.c index 0371f595d63..abd2cf1b2cb 100644 --- a/src/lib/formats/m20_dsk.c +++ b/src/lib/formats/m20_dsk.c @@ -13,8 +13,8 @@ *********************************************************************/ #include +#include -#include "emu.h" #include "m20_dsk.h" #include "basicdsk.h" @@ -180,7 +180,6 @@ LEGACY_FLOPPY_OPTIONS_END *********************************************************************/ -#include "emu.h" #include "formats/m20_dsk.h" m20_format::m20_format() diff --git a/src/lib/formats/m5_dsk.c b/src/lib/formats/m5_dsk.c index fc8f9f98d43..9652eedbb72 100644 --- a/src/lib/formats/m5_dsk.c +++ b/src/lib/formats/m5_dsk.c @@ -8,7 +8,8 @@ *********************************************************************/ -#include "emu.h" +#include + #include "formats/m5_dsk.h" m5_format::m5_format() : upd765_format(formats) diff --git a/src/lib/formats/mbee_cas.c b/src/lib/formats/mbee_cas.c index 592ae38e627..fe0a2ffbc24 100644 --- a/src/lib/formats/mbee_cas.c +++ b/src/lib/formats/mbee_cas.c @@ -56,6 +56,8 @@ TAP - has an ID header of TAP_DGOS_BEE or MBEE, null terminated. ********************************************************************/ +#include + #include "mbee_cas.h" #define WAVEENTRY_LOW -32768 diff --git a/src/lib/formats/mfi_dsk.c b/src/lib/formats/mfi_dsk.c index 13a23abe94b..2bd4b326501 100644 --- a/src/lib/formats/mfi_dsk.c +++ b/src/lib/formats/mfi_dsk.c @@ -1,6 +1,7 @@ // license:BSD-3-Clause // copyright-holders:Olivier Galibert -#include "emu.h" +#include + #include "mfi_dsk.h" #include diff --git a/src/lib/formats/mm_dsk.c b/src/lib/formats/mm_dsk.c index 53939295378..0634c0e3ede 100644 --- a/src/lib/formats/mm_dsk.c +++ b/src/lib/formats/mm_dsk.c @@ -8,7 +8,8 @@ *********************************************************************/ -#include "emu.h" +#include + #include "formats/mm_dsk.h" mm1_format::mm1_format() : upd765_format(formats) diff --git a/src/lib/formats/msx_dsk.c b/src/lib/formats/msx_dsk.c index df1a318ab6e..11817d8ab32 100644 --- a/src/lib/formats/msx_dsk.c +++ b/src/lib/formats/msx_dsk.c @@ -6,6 +6,8 @@ *********************************************************************/ +#include + #include "formats/msx_dsk.h" #include "formats/basicdsk.h" diff --git a/src/lib/formats/mz_cas.c b/src/lib/formats/mz_cas.c index d7897ddf56f..56662f6c760 100644 --- a/src/lib/formats/mz_cas.c +++ b/src/lib/formats/mz_cas.c @@ -1,4 +1,5 @@ #include +#include #include "mz_cas.h" #ifndef VERBOSE diff --git a/src/lib/formats/nanos_dsk.c b/src/lib/formats/nanos_dsk.c index fd8478b5b45..1536d0677c8 100644 --- a/src/lib/formats/nanos_dsk.c +++ b/src/lib/formats/nanos_dsk.c @@ -8,7 +8,8 @@ *********************************************************************/ -#include "emu.h" +#include + #include "formats/nanos_dsk.h" nanos_format::nanos_format() : upd765_format(formats) diff --git a/src/lib/formats/naslite_dsk.c b/src/lib/formats/naslite_dsk.c index da043358b16..342407a7c95 100644 --- a/src/lib/formats/naslite_dsk.c +++ b/src/lib/formats/naslite_dsk.c @@ -8,7 +8,8 @@ *********************************************************************/ -#include "emu.h" +#include + #include "formats/naslite_dsk.h" naslite_format::naslite_format() : upd765_format(formats) diff --git a/src/lib/formats/nes_dsk.c b/src/lib/formats/nes_dsk.c index 99878833f27..ce62b4fba0e 100644 --- a/src/lib/formats/nes_dsk.c +++ b/src/lib/formats/nes_dsk.c @@ -8,6 +8,7 @@ #include +#include #include "formats/nes_dsk.h" #include "formats/basicdsk.h" diff --git a/src/lib/formats/nfd_dsk.c b/src/lib/formats/nfd_dsk.c index ea886e9dd3a..083d59417b2 100644 --- a/src/lib/formats/nfd_dsk.c +++ b/src/lib/formats/nfd_dsk.c @@ -77,7 +77,8 @@ *********************************************************************/ -#include "emu.h" + #include + #include "nfd_dsk.h" nfd_format::nfd_format() diff --git a/src/lib/formats/orao_cas.c b/src/lib/formats/orao_cas.c index 78080b19f1b..c771b234dda 100644 --- a/src/lib/formats/orao_cas.c +++ b/src/lib/formats/orao_cas.c @@ -3,6 +3,8 @@ Tape support for Orao TAP format */ +#include + #include "orao_cas.h" diff --git a/src/lib/formats/oric_dsk.c b/src/lib/formats/oric_dsk.c index aaef1928f0a..340fb507c2d 100644 --- a/src/lib/formats/oric_dsk.c +++ b/src/lib/formats/oric_dsk.c @@ -8,7 +8,7 @@ *********************************************************************/ -#include "emu.h" +#include "emu.h" // logerror #include "formats/oric_dsk.h" oric_dsk_format::oric_dsk_format() diff --git a/src/lib/formats/oric_tap.c b/src/lib/formats/oric_tap.c index ac6e6c0f72a..123552eea7a 100644 --- a/src/lib/formats/oric_tap.c +++ b/src/lib/formats/oric_tap.c @@ -1,3 +1,5 @@ +#include + #include "oric_tap.h" #define ORIC_WAV_DEBUG 0 diff --git a/src/lib/formats/p6001_cas.c b/src/lib/formats/p6001_cas.c index 78e5e929963..debe3f3b261 100644 --- a/src/lib/formats/p6001_cas.c +++ b/src/lib/formats/p6001_cas.c @@ -2,6 +2,8 @@ * NEC PC-6001 cassette format handling */ +#include + #include "p6001_cas.h" #define WAVE_HIGH 0x5a9e diff --git a/src/lib/formats/pasti_dsk.c b/src/lib/formats/pasti_dsk.c index e78f816b8df..c39954490b8 100644 --- a/src/lib/formats/pasti_dsk.c +++ b/src/lib/formats/pasti_dsk.c @@ -1,4 +1,4 @@ -#include "emu.h" +#include "emu.h" // logerror #include "pasti_dsk.h" // Pasti format supported using the documentation at diff --git a/src/lib/formats/pc98_dsk.c b/src/lib/formats/pc98_dsk.c index df527f92cc4..6ef28d01eeb 100644 --- a/src/lib/formats/pc98_dsk.c +++ b/src/lib/formats/pc98_dsk.c @@ -7,6 +7,7 @@ *********************************************************************/ #include +#include #include "formats/pc98_dsk.h" diff --git a/src/lib/formats/pc98fdi_dsk.c b/src/lib/formats/pc98fdi_dsk.c index 81aeaf7a42b..83433606400 100644 --- a/src/lib/formats/pc98fdi_dsk.c +++ b/src/lib/formats/pc98fdi_dsk.c @@ -8,7 +8,7 @@ *********************************************************************/ -#include "emu.h" +#include #include "pc98fdi_dsk.h" pc98fdi_format::pc98fdi_format() diff --git a/src/lib/formats/pc_dsk.c b/src/lib/formats/pc_dsk.c index 45a076cc91c..152dffed15a 100644 --- a/src/lib/formats/pc_dsk.c +++ b/src/lib/formats/pc_dsk.c @@ -7,6 +7,7 @@ *********************************************************************/ #include +#include #include "formats/pc_dsk.h" #include "formats/basicdsk.h" diff --git a/src/lib/formats/phc25_cas.c b/src/lib/formats/phc25_cas.c index a0d807a335c..1253bd98a3a 100644 --- a/src/lib/formats/phc25_cas.c +++ b/src/lib/formats/phc25_cas.c @@ -29,6 +29,8 @@ enough to make it work. ********************************************************************/ +#include + #include "phc25_cas.h" #define WAVEENTRY_LOW -32768 diff --git a/src/lib/formats/pmd_cas.c b/src/lib/formats/pmd_cas.c index eefb8fc9622..ba5baee1a65 100644 --- a/src/lib/formats/pmd_cas.c +++ b/src/lib/formats/pmd_cas.c @@ -10,6 +10,8 @@ ********************************************************************/ +#include + #include "pmd_cas.h" #define WAVEENTRY_LOW -32768 diff --git a/src/lib/formats/primoptp.c b/src/lib/formats/primoptp.c index ad8606617d9..6373d43fd4f 100644 --- a/src/lib/formats/primoptp.c +++ b/src/lib/formats/primoptp.c @@ -1,6 +1,8 @@ /* .PTP Microkey Primo tape images */ +#include + #include "primoptp.h" diff --git a/src/lib/formats/pyldin_dsk.c b/src/lib/formats/pyldin_dsk.c index 07d75f58724..de43ab1947b 100644 --- a/src/lib/formats/pyldin_dsk.c +++ b/src/lib/formats/pyldin_dsk.c @@ -8,7 +8,7 @@ *********************************************************************/ -#include "emu.h" +#include #include "formats/pyldin_dsk.h" pyldin_format::pyldin_format() : upd765_format(formats) diff --git a/src/lib/formats/ql_dsk.c b/src/lib/formats/ql_dsk.c index 5351a92c83f..b3ceb233218 100644 --- a/src/lib/formats/ql_dsk.c +++ b/src/lib/formats/ql_dsk.c @@ -8,7 +8,8 @@ *********************************************************************/ -#include "emu.h" +#include + #include "formats/ql_dsk.h" ql_format::ql_format() : wd177x_format(formats) diff --git a/src/lib/formats/rk_cas.c b/src/lib/formats/rk_cas.c index 2a20a8499ab..150b17c8f3b 100644 --- a/src/lib/formats/rk_cas.c +++ b/src/lib/formats/rk_cas.c @@ -3,6 +3,8 @@ Tape support for RK format */ +#include + #include "rk_cas.h" diff --git a/src/lib/formats/rx50_dsk.c b/src/lib/formats/rx50_dsk.c index 4ece096fba6..429f22eafec 100644 --- a/src/lib/formats/rx50_dsk.c +++ b/src/lib/formats/rx50_dsk.c @@ -27,7 +27,8 @@ FORMAT A: /F:160 on DOS; turn MEDIACHK ON ************************************************************************/ -#include "emu.h" +#include + #include "flopimg.h" #include "formats/rx50_dsk.h" diff --git a/src/lib/formats/sc3000_bit.c b/src/lib/formats/sc3000_bit.c index 4afe91371f9..f38f5a8d8c6 100644 --- a/src/lib/formats/sc3000_bit.c +++ b/src/lib/formats/sc3000_bit.c @@ -6,6 +6,8 @@ *********************************************************************/ +#include + #include "sc3000_bit.h" /*************************************************************************** diff --git a/src/lib/formats/sf7000_dsk.c b/src/lib/formats/sf7000_dsk.c index e15a42e7b41..31d0c37ab15 100644 --- a/src/lib/formats/sf7000_dsk.c +++ b/src/lib/formats/sf7000_dsk.c @@ -8,7 +8,8 @@ *********************************************************************/ -#include "emu.h" +#include + #include "formats/sf7000_dsk.h" sf7000_format::sf7000_format() : upd765_format(formats) diff --git a/src/lib/formats/smx_dsk.c b/src/lib/formats/smx_dsk.c index 4729f65f8bb..9158a586c13 100644 --- a/src/lib/formats/smx_dsk.c +++ b/src/lib/formats/smx_dsk.c @@ -8,7 +8,8 @@ *********************************************************************/ -#include "emu.h" +#include + #include "formats/smx_dsk.h" smx_format::smx_format() : wd177x_format(formats) diff --git a/src/lib/formats/sol_cas.c b/src/lib/formats/sol_cas.c index e5dc79cd21a..26f1bdccf00 100644 --- a/src/lib/formats/sol_cas.c +++ b/src/lib/formats/sol_cas.c @@ -34,6 +34,8 @@ SVT - The full explanation may be found on the Solace web site, ********************************************************************/ +#include + #include "sol_cas.h" #define WAVEENTRY_LOW -32768 diff --git a/src/lib/formats/sorc_cas.c b/src/lib/formats/sorc_cas.c index 99e9d46f7d9..6983dd0ba74 100644 --- a/src/lib/formats/sorc_cas.c +++ b/src/lib/formats/sorc_cas.c @@ -25,6 +25,8 @@ header and leader bytes. ********************************************************************/ +#include + #include "sorc_cas.h" #define WAVEENTRY_LOW -32768 diff --git a/src/lib/formats/sorc_dsk.c b/src/lib/formats/sorc_dsk.c index e7939456139..3c7aee10c33 100644 --- a/src/lib/formats/sorc_dsk.c +++ b/src/lib/formats/sorc_dsk.c @@ -7,6 +7,7 @@ *********************************************************************/ #include +#include #include "sorc_dsk.h" #include "basicdsk.h" diff --git a/src/lib/formats/sord_cas.c b/src/lib/formats/sord_cas.c index cab593d66e8..a2834931a2a 100644 --- a/src/lib/formats/sord_cas.c +++ b/src/lib/formats/sord_cas.c @@ -7,6 +7,7 @@ **************************************************************************/ #include +#include #include "sord_cas.h" #define SORDM5_WAVESAMPLES_HEADER 1 diff --git a/src/lib/formats/spc1000_cas.c b/src/lib/formats/spc1000_cas.c index b02c287d02b..b05844b6ee7 100644 --- a/src/lib/formats/spc1000_cas.c +++ b/src/lib/formats/spc1000_cas.c @@ -21,6 +21,8 @@ IPL: This seems a quickload format containing RAM dump, not a real tape ********************************************************************/ +#include + #include "spc1000_cas.h" #define WAVEENTRY_LOW -32768 diff --git a/src/lib/formats/st_dsk.c b/src/lib/formats/st_dsk.c index 72787b58a19..a30165993ea 100644 --- a/src/lib/formats/st_dsk.c +++ b/src/lib/formats/st_dsk.c @@ -8,7 +8,8 @@ *********************************************************************/ -#include "emu.h" +#include + #include "formats/st_dsk.h" st_format::st_format() diff --git a/src/lib/formats/svi_cas.c b/src/lib/formats/svi_cas.c index edb015382ba..6b693b4d461 100644 --- a/src/lib/formats/svi_cas.c +++ b/src/lib/formats/svi_cas.c @@ -1,3 +1,5 @@ +#include + #include "svi_cas.h" #define CAS_PERIOD_0 (37) diff --git a/src/lib/formats/svi_dsk.c b/src/lib/formats/svi_dsk.c index e94b2e2f94d..23dbb9a17e2 100644 --- a/src/lib/formats/svi_dsk.c +++ b/src/lib/formats/svi_dsk.c @@ -7,6 +7,7 @@ *********************************************************************/ #include +#include #include "svi_dsk.h" #include "basicdsk.h" diff --git a/src/lib/formats/tandy2k_dsk.c b/src/lib/formats/tandy2k_dsk.c index cc15e75b17b..e08865c9493 100644 --- a/src/lib/formats/tandy2k_dsk.c +++ b/src/lib/formats/tandy2k_dsk.c @@ -8,7 +8,8 @@ *********************************************************************/ -#include "emu.h" +#include + #include "formats/tandy2k_dsk.h" tandy2k_format::tandy2k_format() : upd765_format(formats) diff --git a/src/lib/formats/td0_dsk.c b/src/lib/formats/td0_dsk.c index cc5a72993a5..a9a7ed702a1 100644 --- a/src/lib/formats/td0_dsk.c +++ b/src/lib/formats/td0_dsk.c @@ -13,7 +13,7 @@ */ #include -#include "emu.h" +#include #include "flopimg.h" #define BUFSZ 512 // new input buffer diff --git a/src/lib/formats/thom_cas.c b/src/lib/formats/thom_cas.c index e48f217ead6..36fb6e4de51 100644 --- a/src/lib/formats/thom_cas.c +++ b/src/lib/formats/thom_cas.c @@ -7,6 +7,7 @@ **********************************************************************/ #include +#include #include "pool.h" #include "cassimg.h" diff --git a/src/lib/formats/thom_dsk.c b/src/lib/formats/thom_dsk.c index b3cf47234a2..4f7230f2421 100644 --- a/src/lib/formats/thom_dsk.c +++ b/src/lib/formats/thom_dsk.c @@ -9,6 +9,7 @@ *********************************************************************/ #include +#include #include "thom_dsk.h" #include "basicdsk.h" diff --git a/src/lib/formats/ti99_dsk.c b/src/lib/formats/ti99_dsk.c index ab6c564fb79..d18ef3c4192 100644 --- a/src/lib/formats/ti99_dsk.c +++ b/src/lib/formats/ti99_dsk.c @@ -41,11 +41,11 @@ * ********************************************************************/ -#include "emu.h" #include -#include #include +#include +#include "emu.h" // logerror #include "imageutl.h" #include "ti99_dsk.h" @@ -835,6 +835,9 @@ void ti99_sdf_format::determine_sizes(io_generic *io, int& cell_size, int& secto have_vib = true; } + // Do we have a broken VIB? The Pascal disks are known to have such incomplete VIBs + if (heads == 0 || sector_count == 0) have_vib = false; + // We're also checking the size of the image int cell_size1 = 0; int sector_count1 = 0; diff --git a/src/lib/formats/tiki100_dsk.c b/src/lib/formats/tiki100_dsk.c index 4704f6e9911..1a05af7a5af 100644 --- a/src/lib/formats/tiki100_dsk.c +++ b/src/lib/formats/tiki100_dsk.c @@ -8,7 +8,8 @@ *********************************************************************/ -#include "emu.h" +#include + #include "formats/tiki100_dsk.h" tiki100_format::tiki100_format() : wd177x_format(formats) diff --git a/src/lib/formats/trd_dsk.c b/src/lib/formats/trd_dsk.c index 6ee08e6a2c0..7cacd98fb4a 100644 --- a/src/lib/formats/trd_dsk.c +++ b/src/lib/formats/trd_dsk.c @@ -6,7 +6,8 @@ *********************************************************************/ -#include "emu.h" +#include + #include "formats/trd_dsk.h" trd_format::trd_format() : wd177x_format(formats) diff --git a/src/lib/formats/trs_cas.c b/src/lib/formats/trs_cas.c index 6956e488d4c..6e143200bc9 100644 --- a/src/lib/formats/trs_cas.c +++ b/src/lib/formats/trs_cas.c @@ -4,6 +4,8 @@ Support for TRS80 .cas cassette images ********************************************************************/ +#include + #include "formats/trs_cas.h" #define SILENCE 0 diff --git a/src/lib/formats/trs_dsk.c b/src/lib/formats/trs_dsk.c index 36c5a271622..ebe6090bcdc 100644 --- a/src/lib/formats/trs_dsk.c +++ b/src/lib/formats/trs_dsk.c @@ -1,4 +1,5 @@ #include +#include #include "trs_dsk.h" #include "basicdsk.h" #include "coco_dsk.h" diff --git a/src/lib/formats/tvc_cas.c b/src/lib/formats/tvc_cas.c index a24b1ed79b1..a33fba687b9 100644 --- a/src/lib/formats/tvc_cas.c +++ b/src/lib/formats/tvc_cas.c @@ -8,6 +8,8 @@ ********************************************************************/ +#include + #include "tvc_cas.h" #define TVC64_BIT0_FREQ 1812 diff --git a/src/lib/formats/tvc_dsk.c b/src/lib/formats/tvc_dsk.c index fdbe28365b5..8a2254cb7cc 100644 --- a/src/lib/formats/tvc_dsk.c +++ b/src/lib/formats/tvc_dsk.c @@ -8,7 +8,8 @@ *********************************************************************/ -#include "emu.h" +#include + #include "formats/tvc_dsk.h" tvc_format::tvc_format() : wd177x_format(formats) diff --git a/src/lib/formats/tzx_cas.c b/src/lib/formats/tzx_cas.c index c7950138a09..71ad4c747f5 100644 --- a/src/lib/formats/tzx_cas.c +++ b/src/lib/formats/tzx_cas.c @@ -38,6 +38,8 @@ We are currently using the numbers from the TZX specification... */ +#include + #include "tzx_cas.h" diff --git a/src/lib/formats/uef_cas.c b/src/lib/formats/uef_cas.c index 60a4ade6775..6a5c8668c8e 100644 --- a/src/lib/formats/uef_cas.c +++ b/src/lib/formats/uef_cas.c @@ -12,6 +12,7 @@ Not nice, but it works... #include #include +#include #include #include "uef_cas.h" diff --git a/src/lib/formats/upd765_dsk.c b/src/lib/formats/upd765_dsk.c index 5966e1de1a3..b26da4c2d98 100644 --- a/src/lib/formats/upd765_dsk.c +++ b/src/lib/formats/upd765_dsk.c @@ -8,7 +8,7 @@ *********************************************************************/ -#include "emu.h" +#include "emu.h" // emu_fatalerror #include "formats/upd765_dsk.h" upd765_format::upd765_format(const format *_formats) diff --git a/src/lib/formats/vg5k_cas.c b/src/lib/formats/vg5k_cas.c index 78e63cabb0b..ef648707fd8 100644 --- a/src/lib/formats/vg5k_cas.c +++ b/src/lib/formats/vg5k_cas.c @@ -5,6 +5,8 @@ Support for VG-5000 .k7 cassette images ********************************************************************/ +#include + #include "vg5k_cas.h" diff --git a/src/lib/formats/victor9k_dsk.c b/src/lib/formats/victor9k_dsk.c index 694ac3dbf80..020c4af46b3 100644 --- a/src/lib/formats/victor9k_dsk.c +++ b/src/lib/formats/victor9k_dsk.c @@ -97,7 +97,7 @@ zone. */ -#include "emu.h" +#include "emu.h" // logerror, BIT, emu_fatalerror #include "formats/victor9k_dsk.h" victor9k_format::victor9k_format() @@ -237,7 +237,7 @@ floppy_image_format_t::desc_e* victor9k_format::get_sector_desc(const format &f, return desc; } -void victor9k_format::build_sector_description(const format &f, UINT8 *sectdata, offs_t sect_offs, desc_s *sectors, int sector_count) const +void victor9k_format::build_sector_description(const format &f, UINT8 *sectdata, UINT32 sect_offs, desc_s *sectors, int sector_count) const { for (int i = 0; i < sector_count; i++) { sectors[i].data = sectdata + sect_offs; diff --git a/src/lib/formats/victor9k_dsk.h b/src/lib/formats/victor9k_dsk.h index c1d00052a62..22f43fa7e3b 100644 --- a/src/lib/formats/victor9k_dsk.h +++ b/src/lib/formats/victor9k_dsk.h @@ -35,7 +35,7 @@ public: virtual int identify(io_generic *io, UINT32 form_factor); void log_boot_sector(UINT8 *data); floppy_image_format_t::desc_e* get_sector_desc(const format &f, int ¤t_size, int sector_count); - void build_sector_description(const format &f, UINT8 *sectdata, offs_t sect_offs, desc_s *sectors, int sector_count) const; + void build_sector_description(const format &f, UINT8 *sectdata, UINT32 sect_offs, desc_s *sectors, int sector_count) const; virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image); virtual bool supports_save() const; diff --git a/src/lib/formats/vt_cas.c b/src/lib/formats/vt_cas.c index 4040b00d7aa..734954a2ab6 100644 --- a/src/lib/formats/vt_cas.c +++ b/src/lib/formats/vt_cas.c @@ -1,3 +1,5 @@ +#include + #include "formats/vt_cas.h" /********************************************************************* diff --git a/src/lib/formats/vt_dsk.c b/src/lib/formats/vt_dsk.c index c4d1fdf91d8..0021b66eaa4 100644 --- a/src/lib/formats/vt_dsk.c +++ b/src/lib/formats/vt_dsk.c @@ -8,6 +8,7 @@ #include #include +#include #include "formats/vt_dsk.h" #include "formats/basicdsk.h" diff --git a/src/lib/formats/vtech1_dsk.c b/src/lib/formats/vtech1_dsk.c index 4ee02c89104..d7194224ebd 100644 --- a/src/lib/formats/vtech1_dsk.c +++ b/src/lib/formats/vtech1_dsk.c @@ -6,6 +6,8 @@ *********************************************************************/ +#include + #include "formats/vtech1_dsk.h" static FLOPPY_IDENTIFY( vtech1_dsk_identify ) diff --git a/src/lib/formats/wd177x_dsk.c b/src/lib/formats/wd177x_dsk.c index 57223fecc2f..8ced951fd51 100644 --- a/src/lib/formats/wd177x_dsk.c +++ b/src/lib/formats/wd177x_dsk.c @@ -8,7 +8,7 @@ *********************************************************************/ -#include "emu.h" +#include "emu.h" // emu_fatalerror #include "formats/wd177x_dsk.h" wd177x_format::wd177x_format(const format *_formats) diff --git a/src/lib/formats/x07_cas.c b/src/lib/formats/x07_cas.c index fb581f6a44c..54f46acd488 100644 --- a/src/lib/formats/x07_cas.c +++ b/src/lib/formats/x07_cas.c @@ -6,6 +6,8 @@ ********************************************************************/ +#include + #include "x07_cas.h" #define WAVEENTRY_LOW -32768 diff --git a/src/lib/formats/x1_tap.c b/src/lib/formats/x1_tap.c index 3d42c41dad4..880037c8f3a 100644 --- a/src/lib/formats/x1_tap.c +++ b/src/lib/formats/x1_tap.c @@ -19,6 +19,8 @@ * */ +#include + #include "x1_tap.h" #define WAVE_HIGH 0x5a9e diff --git a/src/lib/formats/xdf_dsk.c b/src/lib/formats/xdf_dsk.c index 6b81877b701..c77d685d9be 100644 --- a/src/lib/formats/xdf_dsk.c +++ b/src/lib/formats/xdf_dsk.c @@ -8,7 +8,8 @@ *********************************************************************/ -#include "emu.h" +#include + #include "formats/xdf_dsk.h" xdf_format::xdf_format() : upd765_format(formats) diff --git a/src/lib/formats/z80ne_dsk.c b/src/lib/formats/z80ne_dsk.c index 6394e177f4f..967fecd27f5 100644 --- a/src/lib/formats/z80ne_dsk.c +++ b/src/lib/formats/z80ne_dsk.c @@ -7,6 +7,7 @@ *********************************************************************/ #include + #include "z80ne_dsk.h" #include "basicdsk.h" #include "imageutl.h" diff --git a/src/lib/formats/zx81_p.c b/src/lib/formats/zx81_p.c index bfb871c3c51..e2e1e33f035 100644 --- a/src/lib/formats/zx81_p.c +++ b/src/lib/formats/zx81_p.c @@ -29,6 +29,8 @@ medium transfer rate is approx. 307 bps (38 bytes/sec) for files that contain *****************************************************************************/ +#include + #include "zx81_p.h" diff --git a/src/lib/util/avhuff.c b/src/lib/util/avhuff.c index d2642b99b35..6684c6d7ae9 100644 --- a/src/lib/util/avhuff.c +++ b/src/lib/util/avhuff.c @@ -58,6 +58,8 @@ ***************************************************************************/ +#include + #include "avhuff.h" #include "huffman.h" #include "chd.h" diff --git a/src/lib/util/aviio.c b/src/lib/util/aviio.c index 7dd2e3bb9c1..0d0403809f8 100644 --- a/src/lib/util/aviio.c +++ b/src/lib/util/aviio.c @@ -9,6 +9,7 @@ ***************************************************************************/ #include +#include #include "aviio.h" diff --git a/src/lib/util/bitmap.c b/src/lib/util/bitmap.c index 4d1f8502f50..a6e7b02f957 100644 --- a/src/lib/util/bitmap.c +++ b/src/lib/util/bitmap.c @@ -8,6 +8,8 @@ ***************************************************************************/ +#include + #include "bitmap.h" #include diff --git a/src/lib/util/bitmap.h b/src/lib/util/bitmap.h index a82ec7eebfe..91d693124e1 100644 --- a/src/lib/util/bitmap.h +++ b/src/lib/util/bitmap.h @@ -15,7 +15,6 @@ #include "osdcore.h" #include "palette.h" -#include //************************************************************************** diff --git a/src/lib/util/cdrom.c b/src/lib/util/cdrom.c index 15c10a44452..90024420555 100644 --- a/src/lib/util/cdrom.c +++ b/src/lib/util/cdrom.c @@ -16,6 +16,8 @@ ***************************************************************************/ +#include + #include "cdrom.h" #include diff --git a/src/lib/util/chd.c b/src/lib/util/chd.c index 43539103d33..c00daf7b7cf 100644 --- a/src/lib/util/chd.c +++ b/src/lib/util/chd.c @@ -8,6 +8,8 @@ ***************************************************************************/ +#include + #include "chd.h" #include "avhuff.h" #include "hashing.h" diff --git a/src/lib/util/chdcd.c b/src/lib/util/chdcd.c index 8690cc65ffa..0e6077dd70f 100644 --- a/src/lib/util/chdcd.c +++ b/src/lib/util/chdcd.c @@ -10,6 +10,7 @@ #include #include +#include #include "osdcore.h" #include "chd.h" #include "chdcd.h" diff --git a/src/lib/util/chdcodec.c b/src/lib/util/chdcodec.c index e1a001e2ebd..3bf1d6dfd63 100644 --- a/src/lib/util/chdcodec.c +++ b/src/lib/util/chdcodec.c @@ -8,6 +8,8 @@ ***************************************************************************/ +#include + #include "chd.h" #include "hashing.h" #include "avhuff.h" diff --git a/src/lib/util/corefile.c b/src/lib/util/corefile.c index 977024b5143..abba0a6b5b9 100644 --- a/src/lib/util/corefile.c +++ b/src/lib/util/corefile.c @@ -8,6 +8,8 @@ ***************************************************************************/ +#include + #include "corefile.h" #include "unicode.h" #include diff --git a/src/lib/util/corestr.h b/src/lib/util/corestr.h index dad4880b268..e9750b5f85f 100644 --- a/src/lib/util/corestr.h +++ b/src/lib/util/corestr.h @@ -26,11 +26,11 @@ int core_stricmp(const char *s1, const char *s2); /* this macro prevents people from using stricmp directly */ #undef stricmp -#define stricmp !MUST_USE_CORE_STRICMP_INSTEAD! +#define stricmp MUST_USE_CORE_STRICMP_INSTEAD /* this macro prevents people from using strcasecmp directly */ #undef strcasecmp -#define strcasecmp !MUST_USE_CORE_STRICMP_INSTEAD! +#define strcasecmp MUST_USE_CORE_STRICMP_INSTEAD /* since strnicmp is not part of the standard, we use this instead */ @@ -38,11 +38,11 @@ int core_strnicmp(const char *s1, const char *s2, size_t n); /* this macro prevents people from using strnicmp directly */ #undef strnicmp -#define strnicmp !MUST_USE_CORE_STRNICMP_INSTEAD! +#define strnicmp MUST_USE_CORE_STRNICMP_INSTEAD /* this macro prevents people from using strncasecmp directly */ #undef strncasecmp -#define strncasecmp !MUST_USE_CORE_STRNICMP_INSTEAD! +#define strncasecmp MUST_USE_CORE_STRNICMP_INSTEAD /* since strdup is not part of the standard, we use this instead - free with osd_free() */ @@ -50,7 +50,7 @@ char *core_strdup(const char *str); /* this macro prevents people from using strdup directly */ #undef strdup -#define strdup !MUST_USE_CORE_STRDUP_INSTEAD! +#define strdup MUST_USE_CORE_STRDUP_INSTEAD /* additional string compare helper (up to 16 characters at the moment) */ diff --git a/src/lib/util/coretmpl.h b/src/lib/util/coretmpl.h index e1dd388511b..93c71f0c84b 100644 --- a/src/lib/util/coretmpl.h +++ b/src/lib/util/coretmpl.h @@ -13,7 +13,6 @@ #ifndef __CORETMPL_H__ #define __CORETMPL_H__ -#include #include "osdcore.h" #include "corealloc.h" diff --git a/src/lib/util/cstrpool.c b/src/lib/util/cstrpool.c index 874e5192ea0..ea5c637e4d4 100644 --- a/src/lib/util/cstrpool.c +++ b/src/lib/util/cstrpool.c @@ -6,6 +6,8 @@ ***************************************************************************/ +#include + #include "cstrpool.h" diff --git a/src/lib/util/delegate.c b/src/lib/util/delegate.c index ad66cc09168..6c688f72985 100644 --- a/src/lib/util/delegate.c +++ b/src/lib/util/delegate.c @@ -8,6 +8,8 @@ ***************************************************************************/ +#include + #include "osdcomm.h" #include "delegate.h" diff --git a/src/lib/util/delegate.h b/src/lib/util/delegate.h index 8cfd1c7485c..3b413456709 100644 --- a/src/lib/util/delegate.h +++ b/src/lib/util/delegate.h @@ -79,7 +79,6 @@ #define __DELEGATE_H__ // standard C++ includes -#include #include #include diff --git a/src/lib/util/flac.c b/src/lib/util/flac.c index 09e396c944e..d2f576e637e 100644 --- a/src/lib/util/flac.c +++ b/src/lib/util/flac.c @@ -8,8 +8,9 @@ ***************************************************************************/ -#include "flac.h" #include + +#include "flac.h" #include diff --git a/src/lib/util/harddisk.c b/src/lib/util/harddisk.c index 87967d41f1b..46d8f5bab9a 100644 --- a/src/lib/util/harddisk.c +++ b/src/lib/util/harddisk.c @@ -8,6 +8,8 @@ ***************************************************************************/ +#include + #include "harddisk.h" #include diff --git a/src/lib/util/huffman.c b/src/lib/util/huffman.c index eee176e13ba..2da37df8194 100644 --- a/src/lib/util/huffman.c +++ b/src/lib/util/huffman.c @@ -97,6 +97,7 @@ ***************************************************************************/ #include +#include #include "coretmpl.h" #include "huffman.h" diff --git a/src/lib/util/opresolv.c b/src/lib/util/opresolv.c index 4d093a955da..b7870842b08 100644 --- a/src/lib/util/opresolv.c +++ b/src/lib/util/opresolv.c @@ -6,10 +6,10 @@ ****************************************************************************/ -#include #include #include #include +#include #include "pool.h" #include "corestr.h" diff --git a/src/lib/util/options.c b/src/lib/util/options.c index 96315678471..ba580c9ee3a 100644 --- a/src/lib/util/options.c +++ b/src/lib/util/options.c @@ -11,6 +11,7 @@ #include #include #include +#include #include "options.h" #include "astring.h" diff --git a/src/lib/util/palette.c b/src/lib/util/palette.c index 6b3847f61da..4be66ee9f7b 100644 --- a/src/lib/util/palette.c +++ b/src/lib/util/palette.c @@ -8,6 +8,8 @@ ******************************************************************************/ +#include + #include "palette.h" #include #include diff --git a/src/lib/util/png.c b/src/lib/util/png.c index b88af8df44b..076b1b02965 100644 --- a/src/lib/util/png.c +++ b/src/lib/util/png.c @@ -10,6 +10,7 @@ #include #include +#include #include #include "png.h" diff --git a/src/lib/util/tagmap.c b/src/lib/util/tagmap.c index c3f1ad304db..c8247899dcc 100644 --- a/src/lib/util/tagmap.c +++ b/src/lib/util/tagmap.c @@ -8,6 +8,8 @@ ***************************************************************************/ +#include + #include "tagmap.h" #ifdef MAME_DEBUG diff --git a/src/lib/util/xmlfile.c b/src/lib/util/xmlfile.c index 2c8d78cdcdb..e03893134f9 100644 --- a/src/lib/util/xmlfile.c +++ b/src/lib/util/xmlfile.c @@ -8,6 +8,8 @@ ***************************************************************************/ +#include + #include "xmlfile.h" #include #include diff --git a/src/lib/util/zippath.c b/src/lib/util/zippath.c index d0f5931658d..e5e563cdbde 100644 --- a/src/lib/util/zippath.c +++ b/src/lib/util/zippath.c @@ -9,6 +9,7 @@ #include #include #include +#include #include "zippath.h" #include "unzip.h" #include "corestr.h" diff --git a/src/mame/audio/hng64.c b/src/mame/audio/hng64.c index a185b9fc44f..2cc54a21ed2 100644 --- a/src/mame/audio/hng64.c +++ b/src/mame/audio/hng64.c @@ -14,12 +14,26 @@ buriki (#)SNK R&D Center (R) HYPER NEOGEO64 Sound Driver Ver 1.15. (#)Copyrig The earlier revisions appear to have 2 banks of code (there are vectors at the end of the 0x1e0000 block and the 0x1f0000 block) -Those first two revisions also spam the entire range of I/O ports with values several times on startup causing some unexpected -writes to the V53 internal registers. The important ones are reinitialized after this however, I'm guessing this is harmless -on real hardware, as the code flow seems to be correct. +If the banking setup is wrong then those first two revisions also spam the entire range of I/O ports with values several times +on startup causing some unexpected writes to the V53 internal registers. data structures look very similar between all of them +IRQ mask register on the internal interrupt controller is set to 0xd8 + +so levels 0,1,2,5 are unmasked, vectors get set during the sound CPU init code. + + level 0/1 irq (fatfurwa) starts at 0xd277 (both the same vector) + serial comms related, maybe to get commands from main CPU if not done with shared ram? + + level 2 irq (fatfurwa) 0xdd20 + simple routine increases counter in RAM, maybe hooked to one / all of the timer irqs + + level 5 irq: (fatfurwa) starts at 0xc1e1 + largest irq, does things with ports 100 / 102 / 104 / 106, 10a (not 108 directly tho) + + no other irqs (or the NMI) are valid. + */ @@ -100,25 +114,25 @@ WRITE32_MEMBER( hng64_state::hng64_soundcpu_enable_w ) // I guess it's only one of the bits, the commands are inverse of each other if (cmd==0x55AA) { - printf("soundcpu ON\n"); + logerror("soundcpu ON\n"); m_audiocpu->set_input_line(INPUT_LINE_HALT, CLEAR_LINE); m_audiocpu->set_input_line(INPUT_LINE_RESET, CLEAR_LINE); } else if (cmd==0xAA55) { - printf("soundcpu OFF\n"); + logerror("soundcpu OFF\n"); m_audiocpu->set_input_line(INPUT_LINE_HALT, ASSERT_LINE); m_audiocpu->set_input_line(INPUT_LINE_RESET, ASSERT_LINE); } else { - printf("unknown hng64_soundcpu_enable_w cmd %04x\n", cmd); + logerror("unknown hng64_soundcpu_enable_w cmd %04x\n", cmd); } } if (mem_mask&0x0000ffff) { - printf("unknown hng64_soundcpu_enable_w %08x %08x\n", data, mem_mask); + logerror("unknown hng64_soundcpu_enable_w %08x %08x\n", data, mem_mask); } } @@ -177,7 +191,7 @@ ADDRESS_MAP_END WRITE16_MEMBER(hng64_state::hng64_sound_port_0008_w) { -// printf("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 @@ -186,36 +200,91 @@ WRITE16_MEMBER(hng64_state::hng64_sound_port_0008_w) } +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) { - // seems to write values in the format xxyy where yy is 0x00-0x1f and xx is oten 00/01/0a - // there are said to be 32 audio channels, so maybe the lower byte is the channel? + // 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; + } -// printf("hng64_sound_select_w") COMBINE_DATA(&m_audiochannel); } WRITE16_MEMBER(hng64_state::hng64_sound_data_02_w) { m_audiodat[m_audiochannel].dat[2] = data; -// 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]); + +// 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]); } WRITE16_MEMBER(hng64_state::hng64_sound_data_04_w) { m_audiodat[m_audiochannel].dat[1] = data; -// 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]); + +// 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; -// 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]); + +// 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) { - printf("%08x hng64_sound_bank_w? %02x %04x\n", space.device().safe_pc(), offset, data); + logerror("%08x hng64_sound_bank_w? %02x %04x\n", space.device().safe_pc(), offset, data); // buriki writes 0x3f to 0x200 before jumping to the low addresses.. // where it expects to find data from 0x1f0000 @@ -244,27 +313,75 @@ WRITE16_MEMBER(hng64_state::hng64_sound_bank_w) } + +WRITE16_MEMBER(hng64_state::hng64_sound_port_000a_w) +{ + logerror("%08x: hng64_port hng64_sound_port_000a_w %04x mask (%04x)\n", space.device().safe_pc(), data, mem_mask); +} + +WRITE16_MEMBER(hng64_state::hng64_sound_port_000c_w) +{ + logerror("%08x: hng64_port hng64_sound_port_000c_w %04x mask (%04x)\n", space.device().safe_pc(), data, mem_mask); +} + + WRITE16_MEMBER(hng64_state::hng64_sound_port_0102_w) { - printf("hng64_port 0x0102 %04x\n", data); + logerror("hng64_port 0x0102 %04x\n", data); } WRITE16_MEMBER(hng64_state::hng64_sound_port_0080_w) { - printf("hng64_port 0x0080 %04x\n", data); + 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) +{ + logerror("%08x: hng64_port hng64_sound_port_0100_w %04x mask (%04x)\n", space.device().safe_pc(), data, mem_mask); +} + +READ16_MEMBER(hng64_state::hng64_sound_port_0104_r) +{ + // read in irq5 + logerror("%08x: hng64_sound_port_0104_r mask (%04x)\n", space.device().safe_pc(), mem_mask); + return rand(); } 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_WRITE( hng64_sound_data_04_w ) - AM_RANGE(0x0006, 0x0007) AM_WRITE( hng64_sound_data_06_w ) - AM_RANGE(0x0008, 0x0009) AM_WRITE( hng64_sound_port_0008_w ) - // a 8 c used too? + 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(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(0x0102, 0x0103) AM_WRITE( hng64_sound_port_0102_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(0x0200, 0x021f) AM_WRITE( hng64_sound_bank_w ) // ?? @@ -285,25 +402,32 @@ WRITE8_MEMBER(hng64_state::dma_iow3_cb) // currently it reads a block of 0x20 '0x00' values from a very specific block of RAM where there is a 0x20 space in the data and transfers them repeatedly, I assume // this is some kind of buffer for the audio or DSP and eventually will be populated with other values... // if this comes to life maybe something interesting is happening! - if (data!=0x00) printf("dma_iow3_cb %02x\n", data); + if (data!=0x00) logerror("dma_iow3_cb %02x\n", data); } WRITE_LINE_MEMBER(hng64_state::tcu_tm0_cb) { // this goes high once near startup - printf("tcu_tm0_cb %02x\n", state); + logerror("tcu_tm0_cb %02x\n", state); } 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 -// printf("tcu_tm1_cb %02x\n", state); +// 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 } 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 -// printf("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; } diff --git a/src/mame/audio/subs.c b/src/mame/audio/subs.c index 286ac5c5ded..b4511bc6430 100644 --- a/src/mame/audio/subs.c +++ b/src/mame/audio/subs.c @@ -12,27 +12,27 @@ sub sound functions ***************************************************************************/ -WRITE8_MEMBER(subs_state::subs_sonar1_w) +WRITE8_MEMBER(subs_state::sonar1_w) { m_discrete->write(space, SUBS_SONAR1_EN, offset & 0x01); } -WRITE8_MEMBER(subs_state::subs_sonar2_w) +WRITE8_MEMBER(subs_state::sonar2_w) { m_discrete->write(space, SUBS_SONAR2_EN, offset & 0x01); } -WRITE8_MEMBER(subs_state::subs_crash_w) +WRITE8_MEMBER(subs_state::crash_w) { m_discrete->write(space, SUBS_CRASH_EN, offset & 0x01); } -WRITE8_MEMBER(subs_state::subs_explode_w) +WRITE8_MEMBER(subs_state::explode_w) { m_discrete->write(space, SUBS_EXPLODE_EN, offset & 0x01); } -WRITE8_MEMBER(subs_state::subs_noise_reset_w) +WRITE8_MEMBER(subs_state::noise_reset_w) { /* Pulse noise reset */ m_discrete->write(space, SUBS_NOISE_RESET, 0); diff --git a/src/mame/drivers/astinvad.c b/src/mame/drivers/astinvad.c index cc1f21bd5f4..60f1528b176 100644 --- a/src/mame/drivers/astinvad.c +++ b/src/mame/drivers/astinvad.c @@ -817,7 +817,7 @@ DRIVER_INIT_MEMBER(astinvad_state,spcking2) GAME( 1979, kamikaze, 0, kamikaze, kamikaze, astinvad_state, kamikaze, ROT270, "Leijac Corporation", "Kamikaze", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE ) GAME( 1980, astinvad, kamikaze, kamikaze, astinvad, astinvad_state, kamikaze, ROT270, "Leijac Corporation (Stern Electronics license)", "Astro Invader", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE ) -GAME( 19??, kosmokil, kamikaze, kamikaze, kamikaze, astinvad_state, kamikaze, ROT270, "bootleg", "Kosmo Killer", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE ) // says >BEM< Mi Italy but it looks hacked in, dif revision of game tho. +GAME( 19??, kosmokil, kamikaze, kamikaze, kamikaze, astinvad_state, kamikaze, ROT270, "bootleg (BEM)", "Kosmo Killer", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE ) // says >BEM< Mi Italy but it looks hacked in, dif revision of game tho. GAME( 1979, spcking2, 0, spcking2, spcking2, astinvad_state, spcking2, ROT270, "Konami", "Space King 2", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE ) GAME( 1980, spaceint, 0, spaceint, spaceint, driver_device, 0, ROT90, "Shoei", "Space Intruder", GAME_IMPERFECT_SOUND | GAME_WRONG_COLORS | GAME_SUPPORTS_SAVE ) GAME( 1980, spaceintj,spaceint, spaceint, spaceintj, driver_device, 0, ROT90, "Shoei", "Space Intruder (Japan)", GAME_IMPERFECT_SOUND | GAME_WRONG_COLORS | GAME_SUPPORTS_SAVE ) diff --git a/src/mame/drivers/astrcorp.c b/src/mame/drivers/astrcorp.c index 65aa35433c1..8ee006d0f17 100644 --- a/src/mame/drivers/astrcorp.c +++ b/src/mame/drivers/astrcorp.c @@ -67,6 +67,7 @@ public: DECLARE_READ16_MEMBER(astrocorp_unk_r); DECLARE_WRITE16_MEMBER(astrocorp_sound_bank_w); DECLARE_WRITE16_MEMBER(skilldrp_sound_bank_w); + DECLARE_DRIVER_INIT(astoneag); DECLARE_DRIVER_INIT(showhanc); DECLARE_DRIVER_INIT(showhand); DECLARE_VIDEO_START(astrocorp); @@ -1148,13 +1149,164 @@ DRIVER_INIT_MEMBER(astrocorp_state,showhanc) #endif } +DRIVER_INIT_MEMBER(astrocorp_state,astoneag) +{ +#if 0 + UINT16 *rom = (UINT16*)memregion("maincpu")->base(); + UINT16 x; + int i; + + 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; + 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; + 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; + rom[i] ^= x; + } + +/* + for (i = 0x25700/2; i < 0x25800/2; i++) + { + x = 0x6800; + if ( !(i & 0x0001) ) x |= 0x8000; + + if ( !(i & 0x0040) || ((i & 0x0001) || !(i & 0x0001)) ) x |= 0x0100; + + 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; + rom[i] ^= x; + } + +// for (i = 0x25900/2; i < 0x25a00/2; i++) + + for (i = 0x25c00/2; i < 0x25d00/2; i++) + { + // changed from 25400 +// 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; + 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; + + 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 & 0x0002) || (i & 0x0001) ) x |= 0x0001; + rom[i] ^= x; + } +*/ + + for (i = 0x26f00/2; i < 0x27000/2; i++) + { + x = 0xb94c; + rom[i] ^= x; + } + + for (i = 0x27000/2; i < 0x27100/2; i++) + { + x = 0x5f10; + rom[i] ^= x; + } + +#endif +} + GAME( 2000, showhand, 0, showhand, showhand, astrocorp_state, showhand, ROT0, "Astro Corp.", "Show Hand (Italy)", GAME_SUPPORTS_SAVE ) GAME( 2000, showhanc, showhand, showhanc, showhanc, astrocorp_state, showhanc, ROT0, "Astro Corp.", "Wang Pai Dui Jue (China)", GAME_SUPPORTS_SAVE ) GAME( 2002, skilldrp, 0, skilldrp, skilldrp, driver_device, 0, ROT0, "Astro Corp.", "Skill Drop Georgia (Ver. G1.0S)", GAME_SUPPORTS_SAVE ) GAME( 2003, speeddrp, 0, speeddrp, skilldrp, driver_device, 0, ROT0, "Astro Corp.", "Speed Drop (Ver. 1.06)", GAME_SUPPORTS_SAVE ) // Encrypted games (not working): -GAME( 2004?, astoneag, 0, skilldrp, skilldrp, driver_device, 0, ROT0, "Astro Corp.", "Stone Age (Astro, Ver. ENG.03.A)", GAME_NOT_WORKING ) +GAME( 2004?, astoneag, 0, skilldrp, skilldrp, astrocorp_state, astoneag, ROT0, "Astro Corp.", "Stone Age (Astro, Ver. ENG.03.A)", GAME_NOT_WORKING ) GAME( 2005?, winbingo, 0, skilldrp, skilldrp, driver_device, 0, ROT0, "Astro Corp.", "Win Win Bingo (set 1)", GAME_NOT_WORKING ) GAME( 2005?, winbingoa, winbingo, skilldrp, skilldrp, driver_device, 0, ROT0, "Astro Corp.", "Win Win Bingo (set 2)", GAME_NOT_WORKING ) GAME( 2005?, hacher, winbingo, skilldrp, skilldrp, driver_device, 0, ROT0, "bootleg (Gametron)", "Hacher (hack of Win Win Bingo)", GAME_NOT_WORKING ) diff --git a/src/mame/drivers/atlantis.c b/src/mame/drivers/atlantis.c index bf0971073aa..803270545b6 100644 --- a/src/mame/drivers/atlantis.c +++ b/src/mame/drivers/atlantis.c @@ -22,8 +22,6 @@ * Quantum Fireball CX 6.4GB IDE HDD (C/H/S 13328/15/63) TODO: - * Proper VR4373 implementation - * Proper PCI bus implementation * PCI peripherals NOTES: @@ -38,6 +36,8 @@ #include "machine/idectrl.h" #include "machine/midwayic.h" #include "audio/dcs.h" +#include "machine/pci.h" +#include "machine/vrc4373.h" class atlantis_state : public driver_device @@ -103,17 +103,6 @@ UINT32 atlantis_state::screen_update_mwskins(screen_device &screen, bitmap_ind16 * *************************************/ -static ADDRESS_MAP_START( main_map, AS_PROGRAM, 32, atlantis_state ) - ADDRESS_MAP_UNMAP_HIGH - AM_RANGE(0x00000000, 0x007fffff) AM_RAM // 8 MB main RAM - // 04000000 - PCI slot (ActionTec modem, ROM dump TBD) - // 08000000 - PLX9050 chip (Zeus interface?) - // 0F000000 - VR4373 ("Nile 3") registers - AM_RANGE(0x1fc00000, 0x1fc7ffff) AM_ROM AM_REGION("user1", 0) AM_SHARE("rombase") -ADDRESS_MAP_END - - - /************************************* * @@ -136,8 +125,9 @@ static MACHINE_CONFIG_START( mwskins, atlantis_state ) MCFG_CPU_ADD("maincpu", VR4310LE, 166666666) // clock is TRUSTED MCFG_MIPS3_ICACHE_SIZE(16384) MCFG_MIPS3_DCACHE_SIZE(16384) - MCFG_CPU_PROGRAM_MAP(main_map) + MCFG_PCI_ROOT_ADD( ":pci") + MCFG_VRC4373_ADD( ":pci:00.0", ":maincpu") MCFG_IDE_CONTROLLER_ADD("ide", ata_devices, "hdd", NULL, true) @@ -167,7 +157,7 @@ MACHINE_CONFIG_END *************************************/ ROM_START( mwskins ) - ROM_REGION32_LE( 0x80000, "user1", 0 ) /* 512k for R4310 code */ + ROM_REGION32_LE( 0x80000, ":pci:00.0", 0 ) /* 512k for R4310 code */ ROM_LOAD( "skins_game_u4_boot_1.00.u4", 0x000000, 0x080000, CRC(0fe87720) SHA1(4b24abbe662a2d7b61e6a3f079e28b73605ba19f) ) DISK_REGION( "ide:0:hdd:image" ) @@ -175,7 +165,7 @@ ROM_START( mwskins ) ROM_END ROM_START( mwskinsa ) - ROM_REGION32_LE( 0x80000, "user1", 0 ) /* 512k for R4310 code */ + ROM_REGION32_LE( 0x80000, ":pci:00.0", 0 ) /* 512k for R4310 code */ ROM_LOAD( "skins_game_u4_boot_1.00.u4", 0x000000, 0x080000, CRC(0fe87720) SHA1(4b24abbe662a2d7b61e6a3f079e28b73605ba19f) ) DISK_REGION( "ide:0:hdd:image" ) @@ -183,7 +173,7 @@ ROM_START( mwskinsa ) ROM_END ROM_START( mwskinso ) - ROM_REGION32_LE( 0x80000, "user1", 0 ) /* 512k for R4310 code */ + ROM_REGION32_LE( 0x80000, ":pci:00.0", 0 ) /* 512k for R4310 code */ ROM_LOAD( "skins_game_u4_boot_1.00.u4", 0x000000, 0x080000, CRC(0fe87720) SHA1(4b24abbe662a2d7b61e6a3f079e28b73605ba19f) ) DISK_REGION( "ide:0:hdd:image" ) diff --git a/src/mame/drivers/cocoloco.c b/src/mame/drivers/cocoloco.c index d47795cefb4..8932025cc9b 100644 --- a/src/mame/drivers/cocoloco.c +++ b/src/mame/drivers/cocoloco.c @@ -190,19 +190,24 @@ public: m_maincpu(*this, "maincpu"), m_palette(*this, "palette") { } - UINT8 *m_videoram; - UINT8 m_videobank; - DECLARE_READ8_MEMBER(cocoloco_vram_r); - DECLARE_WRITE8_MEMBER(cocoloco_vram_w); - DECLARE_WRITE8_MEMBER(cocoloco_vbank_w); - DECLARE_WRITE8_MEMBER(cocoloco_vram_clear_w); - DECLARE_WRITE8_MEMBER(cocoloco_coin_counter_w); - DECLARE_INPUT_CHANGED_MEMBER(coin_inserted); - virtual void video_start(); - DECLARE_PALETTE_INIT(cocoloco); - UINT32 screen_update_cocoloco(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); required_device m_maincpu; required_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); }; /*********************************** @@ -284,9 +289,12 @@ PALETTE_INIT_MEMBER(cocoloco_state, cocoloco) void cocoloco_state::video_start() { m_videoram = auto_alloc_array(machine(), UINT8, 0x2000 * 8); + + save_pointer(NAME(m_videoram), 0x2000 * 8); + save_item(NAME(m_videobank)); } -UINT32 cocoloco_state::screen_update_cocoloco(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +UINT32 cocoloco_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int x, y, count, xi; @@ -318,12 +326,12 @@ UINT32 cocoloco_state::screen_update_cocoloco(screen_device &screen, bitmap_ind1 } -READ8_MEMBER( cocoloco_state::cocoloco_vram_r ) +READ8_MEMBER( cocoloco_state::vram_r ) { return m_videoram[offset|0x0000] | m_videoram[offset|0x2000] | m_videoram[offset|0x4000] | m_videoram[offset|0x6000]; } -WRITE8_MEMBER( cocoloco_state::cocoloco_vram_w ) +WRITE8_MEMBER( cocoloco_state::vram_w ) { m_videoram[offset|0x0000] = (m_videobank == 0) ? data : 0; m_videoram[offset|0x2000] = (m_videobank & 2) ? data : 0; @@ -331,12 +339,12 @@ WRITE8_MEMBER( cocoloco_state::cocoloco_vram_w ) m_videoram[offset|0x6000] = (m_videobank & 8) ? data : 0; } -WRITE8_MEMBER( cocoloco_state::cocoloco_vbank_w ) +WRITE8_MEMBER( cocoloco_state::vbank_w ) { m_videobank = data; } -WRITE8_MEMBER( cocoloco_state::cocoloco_vram_clear_w ) +WRITE8_MEMBER( cocoloco_state::vram_clear_w ) { /* ??? */ // for(int i=0;i<0x8000;i++) @@ -346,7 +354,7 @@ WRITE8_MEMBER( cocoloco_state::cocoloco_vram_clear_w ) } -WRITE8_MEMBER( cocoloco_state::cocoloco_coin_counter_w ) +WRITE8_MEMBER( cocoloco_state::coincounter_w ) { /* - bits - 7654 3210 @@ -367,14 +375,14 @@ WRITE8_MEMBER( cocoloco_state::cocoloco_coin_counter_w ) static ADDRESS_MAP_START( cocoloco_map, AS_PROGRAM, 8, cocoloco_state ) AM_RANGE(0x0000, 0x1fff) AM_RAM - AM_RANGE(0x2000, 0x3fff) AM_READWRITE(cocoloco_vram_r, cocoloco_vram_w) // 256 x 256 x 1 + AM_RANGE(0x2000, 0x3fff) AM_READWRITE(vram_r, vram_w) // 256 x 256 x 1 AM_RANGE(0x6001, 0x6001) AM_DEVREAD("ay8910", ay8910_device, data_r) AM_RANGE(0x6002, 0x6002) AM_DEVWRITE("ay8910", ay8910_device, data_w) AM_RANGE(0x6003, 0x6003) AM_DEVWRITE("ay8910", ay8910_device, address_w) - AM_RANGE(0x8003, 0x8003) AM_WRITE(cocoloco_vbank_w) - AM_RANGE(0x8005, 0x8005) AM_WRITE(cocoloco_coin_counter_w) + AM_RANGE(0x8003, 0x8003) AM_WRITE(vbank_w) + AM_RANGE(0x8005, 0x8005) AM_WRITE(coincounter_w) AM_RANGE(0xa000, 0xa000) AM_READ_PORT("IN0") - AM_RANGE(0xa005, 0xa005) AM_WRITE(cocoloco_vram_clear_w) + AM_RANGE(0xa005, 0xa005) AM_WRITE(vram_clear_w) AM_RANGE(0xd000, 0xffff) AM_ROM ADDRESS_MAP_END @@ -465,7 +473,7 @@ static MACHINE_CONFIG_START( cocoloco, cocoloco_state ) /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_RAW_PARAMS(CPU_CLOCK * 4, 384, 0, 256, 262, 0, 256) /* TODO: not accurate, ~50 Hz */ - MCFG_SCREEN_UPDATE_DRIVER(cocoloco_state, screen_update_cocoloco) + MCFG_SCREEN_UPDATE_DRIVER(cocoloco_state, screen_update) MCFG_SCREEN_PALETTE("palette") MCFG_PALETTE_ADD("palette", 0x10) @@ -519,5 +527,5 @@ ROM_END * Game Drivers * ***********************************/ -/* YEAR NAME PARENT MACHINE INPUT STATE INIT ROT COMPANY FULLNAME FLAGS */ -GAME( 198?, cocoloco, 0, cocoloco, cocoloco, driver_device, 0, ROT90, "Petaco S.A.", "Coco Loco", 0 ) +/* YEAR NAME PARENT MACHINE INPUT STATE INIT ROT COMPANY FULLNAME FLAGS */ +GAME( 198?, cocoloco, 0, cocoloco, cocoloco, driver_device, 0, ROT90, "Petaco S.A.", "Coco Loco", GAME_SUPPORTS_SAVE ) diff --git a/src/mame/drivers/cps1.c b/src/mame/drivers/cps1.c index 7aa5a3d18c5..32ffdd00d1c 100644 --- a/src/mame/drivers/cps1.c +++ b/src/mame/drivers/cps1.c @@ -224,7 +224,7 @@ Stephh's log (2006.09.20) : - Applied these changes to src/drivers/fcrash.c as well. - Added debug features in the following sets : * 'ghoulsu' - * 'willow', 'willowo' and 'willowj' + * 'willowu', 'willowou' and 'willowj' - Checked sets with no debug features : * 'forgottnua' and 'lostwrld' * 'ghouls' and 'daimakai' @@ -4225,6 +4225,49 @@ ROM_END /* B-Board 89624B-3 */ ROM_START( willow ) + ROM_REGION( CODE_SIZE, "maincpu", 0 ) /* 68000 code */ + ROM_LOAD16_BYTE( "wle_30.11f", 0x00000, 0x20000, CRC(15372aa2) SHA1(ba8e1984180b0438255dfc68dc4eb560f3ecbe56) ) + ROM_LOAD16_BYTE( "wle_35.11h", 0x00001, 0x20000, CRC(2e64623b) SHA1(473f6fd10b2456553f1cbf92fd9a61ce94b1c59f) ) + ROM_LOAD16_BYTE( "wlu_31.12f", 0x40000, 0x20000, CRC(0eb48a83) SHA1(28c40c4b5d767f88922cd899e948abf11a85a864) ) + ROM_LOAD16_BYTE( "wlu_36.12h", 0x40001, 0x20000, CRC(36100209) SHA1(63c9338e71dba8b52daffba50b4bca31aaa10d9e) ) + ROM_LOAD16_WORD_SWAP( "wlm-32.8h", 0x80000, 0x80000, CRC(dfd9f643) SHA1(9c760c30af593a87e7fd39fb213a4c73c68ca440) ) + + ROM_REGION( 0x400000, "gfx", 0 ) + ROMX_LOAD( "wlm-7.7a", 0x000000, 0x80000, CRC(afa74b73) SHA1(09081926260c76986a13ac5351dddd2ea11d7a10) , ROM_GROUPWORD | ROM_SKIP(6) ) // in "5" socket + ROMX_LOAD( "wlm-5.9a", 0x000002, 0x80000, CRC(12a0dc0b) SHA1(fea235ce9489f04919daf52f4d3f3bac9b558316) , ROM_GROUPWORD | ROM_SKIP(6) ) // in "7" socket + ROMX_LOAD( "wlm-3.3a", 0x000004, 0x80000, CRC(c6f2abce) SHA1(ff5fcfe417c43b4747bbe12db6052fdb60f5f0e4) , ROM_GROUPWORD | ROM_SKIP(6) ) // in "1" socket + ROMX_LOAD( "wlm-1.5a", 0x000006, 0x80000, CRC(4aa4c6d3) SHA1(7dd6f18f6126c380821a2ca8955439fd6864f4c6) , ROM_GROUPWORD | ROM_SKIP(6) ) // in "3" socket + ROMX_LOAD( "wl_24.7d", 0x200000, 0x20000, CRC(6f0adee5) SHA1(07b18e51b376001f25173b78e0e816f252400210) , ROM_SKIP(7) ) + ROMX_LOAD( "wl_14.7c", 0x200001, 0x20000, CRC(9cf3027d) SHA1(1e8eb20d51a54f6f756c0ab9395ac38b96e67fb2) , ROM_SKIP(7) ) + ROMX_LOAD( "wl_26.9d", 0x200002, 0x20000, CRC(f09c8ecf) SHA1(b39f83e80af010d6481693d9ec8b1d7e258b531d) , ROM_SKIP(7) ) + ROMX_LOAD( "wl_16.9c", 0x200003, 0x20000, CRC(e35407aa) SHA1(7ddae9cef96839da72488c1fe73268c50e0262ff) , ROM_SKIP(7) ) + ROMX_LOAD( "wl_20.3d", 0x200004, 0x20000, CRC(84992350) SHA1(f0ebd810ce099337cda94222dccce8ab9b3c3281) , ROM_SKIP(7) ) + ROMX_LOAD( "wl_10.3c", 0x200005, 0x20000, CRC(b87b5a36) SHA1(25fb8f9698142473233ee509d4146089920e94e1) , ROM_SKIP(7) ) + ROMX_LOAD( "wl_22.5d", 0x200006, 0x20000, CRC(fd3f89f0) SHA1(51ff95cff56ac78682ea56401b35a0aa63cef8cb) , ROM_SKIP(7) ) + ROMX_LOAD( "wl_12.5c", 0x200007, 0x20000, CRC(7da49d69) SHA1(b0ae7ac4f858ee8d72e6877c4275da7a631e2e4c) , ROM_SKIP(7) ) + + ROM_REGION( 0x18000, "audiocpu", 0 ) /* 64k for the audio CPU (+banks) */ + ROM_LOAD( "wl_09.12b", 0x00000, 0x08000, CRC(f6b3d060) SHA1(0ed2e2f64ba53ba2c371b66ab1e52e40b16d8baf) ) + ROM_CONTINUE( 0x10000, 0x08000 ) + + ROM_REGION( 0x40000, "oki", 0 ) /* Samples */ + ROM_LOAD( "wl_18.11c", 0x00000, 0x20000, CRC(bde23d4d) SHA1(d1fee2f99c858dfb07edcd600da491c7b656afe0) ) + ROM_LOAD( "wl_19.12c", 0x20000, 0x20000, CRC(683898f5) SHA1(316a77b663d78c8b9ff6d85756cb05aaaeef4003) ) + + ROM_REGION( 0x0200, "aboardplds", 0 ) + ROM_LOAD( "buf1", 0x0000, 0x0117, CRC(eb122de7) SHA1(b26b5bfe258e3e184f069719f9fd008d6b8f6b9b) ) + ROM_LOAD( "ioa1", 0x0000, 0x0117, CRC(59c7ee3b) SHA1(fbb887c5b4f5cb8df77cec710eaac2985bc482a6) ) + ROM_LOAD( "prg1", 0x0000, 0x0117, CRC(f1129744) SHA1(a5300f301c1a08a7da768f0773fa0fe3f683b237) ) + ROM_LOAD( "rom1", 0x0000, 0x0117, CRC(41dc73b9) SHA1(7d4c9f1693c821fbf84e32dd6ef62ddf14967845) ) + ROM_LOAD( "sou1", 0x0000, 0x0117, CRC(84f4b2fe) SHA1(dcc9e86cc36316fe42eace02d6df75d08bc8bb6d) ) + + ROM_REGION( 0x0200, "bboardplds", 0 ) + ROM_LOAD( "wl24b.1a", 0x0000, 0x0117, CRC(7101cdf1) SHA1(c848f109d09641b3159dbbb2d2ee49cf30bc9e9c) ) + ROM_LOAD( "lwio.11e", 0x0000, 0x0117, CRC(ad52b90c) SHA1(f0fd6aeea515ee449320fe15684e6b3ab7f97bf4) ) +ROM_END + +/* B-Board 89624B-3 */ +ROM_START( willowu ) ROM_REGION( CODE_SIZE, "maincpu", 0 ) /* 68000 code */ ROM_LOAD16_BYTE( "wlu_30.11f", 0x00000, 0x20000, CRC(d604dbb1) SHA1(b5d78871011ff11a67f1a0cad147cd4de8d67f35) ) ROM_LOAD16_BYTE( "35.11h", 0x00001, 0x20000, CRC(7a791e77) SHA1(fe1429588b7eceab1d369abe03f2cad8de727f71) ) @@ -4270,7 +4313,7 @@ ROM_END /* Note that this set comes from a pcb running on an original Capcom USA Willow arcade cabinet, so even if there is the Japan "warning" it's confirmed to be a genuine USA set and almost certainly the first USA release. Then Capcom removed the incorrect "warning" releasing a new proper set of Willow (USA), as documented above. */ -ROM_START( willowo ) +ROM_START( willowuo ) ROM_REGION( CODE_SIZE, "maincpu", 0 ) /* 68000 code */ ROM_LOAD16_BYTE( "wlu_30.11f", 0x00000, 0x20000, CRC(d604dbb1) SHA1(b5d78871011ff11a67f1a0cad147cd4de8d67f35) ) ROM_LOAD16_BYTE( "wlu_35.11h", 0x00001, 0x20000, CRC(daee72fe) SHA1(2ec62f44394fac2887821881f56b6f24d05234b3) ) @@ -9352,6 +9395,43 @@ ROM_START( cworld2ja ) ROM_LOAD( "ioc1.ic1", 0x0000, 0x0117, CRC(0d182081) SHA1(475b3d417785da4bc512cce2b274bb00d4cc6792) ) ROM_END +/* B-Board 91634B-2 - all roms have 91634B on the labels */ +ROM_START( cworld2jb ) + ROM_REGION( CODE_SIZE, "maincpu", 0 ) /* 68000 code */ + ROM_LOAD16_WORD_SWAP( "q5 - 23_91634b.8f", 0x00000, 0x80000, CRC(709f577f) SHA1(3e0615d01f22eb1bf75cbd26dc80ca5a6d08120e) ) + ROM_LOAD16_WORD_SWAP( "q5 - 22_91634b.7f", 0x80000, 0x80000, CRC(93248458) SHA1(9dcdc6838f52efc9a0a6333fd0d734946db12dbd) ) + + ROM_REGION( 0x200000, "gfx", 0 ) + ROMX_LOAD( "q5 - 01_91634b.3a", 0x000000, 0x80000, CRC(09d0e7ce) SHA1(ea502b975986222acce82ce8396348af72e1df72) , ROM_GROUPWORD | ROM_SKIP(6) ) + ROMX_LOAD( "q5 - 02_91634b.4a", 0x000002, 0x80000, CRC(22e4ce9a) SHA1(9e49aec8e1d6d15a68da63e69765b82fd53a9562) , ROM_GROUPWORD | ROM_SKIP(6) ) + ROMX_LOAD( "q5 - 03_91634b.5a", 0x000004, 0x80000, CRC(f7b3aed6) SHA1(bdfb4d5988307b07ad878ac9129954d14da8769b) , ROM_GROUPWORD | ROM_SKIP(6) ) + ROMX_LOAD( "q5 - 04_91634b.6a", 0x000006, 0x80000, CRC(520c6c88) SHA1(19ba8ca3d75aae71cdf471e6307e86a5df8a2851) , ROM_GROUPWORD | ROM_SKIP(6) ) + + ROM_REGION( 0x18000, "audiocpu", 0 ) /* 64k for the audio CPU (+banks) */ + ROM_LOAD( "q5 - 09_91634b.12a", 0x00000, 0x08000, CRC(e14dc524) SHA1(0020a9002572002458fbfe45e8a959cb90de3f03) ) + ROM_CONTINUE( 0x10000, 0x08000 ) + + ROM_REGION( 0x40000, "oki", 0 ) /* Samples */ + ROM_LOAD( "q5 - 18_91634b.11c", 0x00000, 0x20000, CRC(d10c1b68) SHA1(2423241f3340d8ab1b6bf9514ca8c3bba1273873) ) + ROM_LOAD( "q5 - 19_91634b.12c", 0x20000, 0x20000, CRC(7d17e496) SHA1(a274b94ec4f042dddc239ecb9ac2e1e2375f5eb2) ) + + ROM_REGION( 0x0200, "aboardplds", 0 ) + ROM_LOAD( "buf1", 0x0000, 0x0117, CRC(eb122de7) SHA1(b26b5bfe258e3e184f069719f9fd008d6b8f6b9b) ) + ROM_LOAD( "ioa1", 0x0000, 0x0117, CRC(59c7ee3b) SHA1(fbb887c5b4f5cb8df77cec710eaac2985bc482a6) ) + ROM_LOAD( "prg1", 0x0000, 0x0117, CRC(f1129744) SHA1(a5300f301c1a08a7da768f0773fa0fe3f683b237) ) + ROM_LOAD( "rom1", 0x0000, 0x0117, CRC(41dc73b9) SHA1(7d4c9f1693c821fbf84e32dd6ef62ddf14967845) ) + ROM_LOAD( "sou1", 0x0000, 0x0117, CRC(84f4b2fe) SHA1(dcc9e86cc36316fe42eace02d6df75d08bc8bb6d) ) + + ROM_REGION( 0x0200, "bboardplds", 0 ) + ROM_LOAD( "q563b.1a", 0x0000, 0x0117, NO_DUMP ) + ROM_LOAD( "iob1.12d", 0x0000, 0x0117, CRC(3abc0700) SHA1(973043aa46ec6d5d1db20dc9d5937005a0f9f6ae) ) + ROM_LOAD( "bprg1.11d", 0x0000, 0x0117, CRC(31793da7) SHA1(400fa7ac517421c978c1ee7773c30b9ed0c5d3f3) ) + + ROM_REGION( 0x0200, "cboardplds", 0 ) // checkme + ROM_LOAD( "ioc1.ic7", 0x0000, 0x0117, CRC(0d182081) SHA1(475b3d417785da4bc512cce2b274bb00d4cc6792) ) + ROM_LOAD( "c632.ic1", 0x0000, 0x0117, CRC(0fbd9270) SHA1(d7e737b20c44d41e29ca94be56114b31934dde81) ) +ROM_END + /* B-Board 89624B-3 */ ROM_START( varth ) ROM_REGION( CODE_SIZE, "maincpu", 0 ) /* 68000 code */ @@ -11600,8 +11680,9 @@ GAME( 1989, dynwar, 0, cps1_10MHz, dynwar, cps_state, cps1, GAME( 1989, dynwara, dynwar, cps1_10MHz, dynwar, cps_state, cps1, ROT0, "Capcom", "Dynasty Wars (USA, B-Board 88622B-3)", GAME_SUPPORTS_SAVE ) // (c) Capcom U.S.A. GAME( 1989, dynwarj, dynwar, cps1_10MHz, dynwar, cps_state, cps1, ROT0, "Capcom", "Tenchi wo Kurau (Japan)", GAME_SUPPORTS_SAVE ) GAME( 1989, dynwarjr, dynwar, cps1_12MHz, dynwar, cps_state, cps1, ROT0, "Capcom", "Tenchi wo Kurau (Japan Resale Ver.)", GAME_SUPPORTS_SAVE ) // 12MHz verified -GAME( 1989, willow, 0, cps1_10MHz, willow, cps_state, cps1, ROT0, "Capcom", "Willow (USA)", GAME_SUPPORTS_SAVE ) -GAME( 1989, willowo, willow, cps1_10MHz, willow, cps_state, cps1, ROT0, "Capcom", "Willow (USA Old Ver.)", GAME_SUPPORTS_SAVE ) // Japan "warning" but (c) Capcom U.S.A. +GAME( 1989, willow, 0, cps1_10MHz, willow, cps_state, cps1, ROT0, "Capcom", "Willow (World)", GAME_SUPPORTS_SAVE ) // No "Warning" (c) Capcom U.S.A., genuine export ROM labels +GAME( 1989, willowu, willow, cps1_10MHz, willow, cps_state, cps1, ROT0, "Capcom", "Willow (USA)", GAME_SUPPORTS_SAVE ) +GAME( 1989, willowuo, willow, cps1_10MHz, willow, cps_state, cps1, ROT0, "Capcom", "Willow (USA Old Ver.)", GAME_SUPPORTS_SAVE ) // Japan "warning" but (c) Capcom U.S.A. GAME( 1989, willowj, willow, cps1_10MHz, willow, cps_state, cps1, ROT0, "Capcom", "Willow (Japan)", GAME_SUPPORTS_SAVE ) GAME( 1989, unsquad, 0, cps1_10MHz, unsquad, cps_state, cps1, ROT0, "Capcom / Daipro", "U.N. Squadron (USA)", GAME_SUPPORTS_SAVE ) GAME( 1989, area88, unsquad, cps1_10MHz, unsquad, cps_state, cps1, ROT0, "Capcom / Daipro", "Area 88 (Japan)", GAME_SUPPORTS_SAVE ) @@ -11718,6 +11799,7 @@ GAME( 1992, sf2koryu, sf2ce, cps1_12MHz, sf2hack, cps_state, sf2hack, GAME( 1992, sf2dongb, sf2ce, cps1_12MHz, sf2, cps_state, sf2dongb, ROT0, "bootleg", "Street Fighter II': Champion Edition (Dongfang Bubai protection, bootleg)", GAME_SUPPORTS_SAVE ) // 920313 - based on World version GAME( 1992, cworld2j, 0, cps1_12MHz, cworld2j, cps_state, cps1, ROT0, "Capcom", "Adventure Quiz Capcom World 2 (Japan 920611)", GAME_SUPPORTS_SAVE ) GAME( 1992, cworld2ja, cworld2j, cps1_12MHz, cworld2j, cps_state, cps1, ROT0, "Capcom", "Adventure Quiz Capcom World 2 (Japan 920611, B-Board 90629B-3, no battery)", GAME_SUPPORTS_SAVE ) +GAME( 1992, cworld2jb, cworld2j, cps1_12MHz, cworld2j, cps_state, cps1, ROT0, "Capcom", "Adventure Quiz Capcom World 2 (Japan 920611, B-Board 91634B-2)", GAME_SUPPORTS_SAVE ) GAME( 1992, varth, 0, cps1_12MHz, varth, cps_state, cps1, ROT270, "Capcom", "Varth: Operation Thunderstorm (World 920714)", GAME_SUPPORTS_SAVE ) // "ETC" // 12MHz verified GAME( 1992, varthr1, varth, cps1_12MHz, varth, cps_state, cps1, ROT270, "Capcom", "Varth: Operation Thunderstorm (World 920612)", GAME_SUPPORTS_SAVE ) // "ETC" GAME( 1992, varthu, varth, cps1_12MHz, varth, cps_state, cps1, ROT270, "Capcom (Romstar license)", "Varth: Operation Thunderstorm (USA 920612)", GAME_SUPPORTS_SAVE ) diff --git a/src/mame/drivers/dynax.c b/src/mame/drivers/dynax.c index d575a70bcf2..7570f3ea052 100644 --- a/src/mame/drivers/dynax.c +++ b/src/mame/drivers/dynax.c @@ -5,7 +5,7 @@ Some Dynax games using the second version of their blitter driver by Luca Elia and Nicola Salmoria CPU: Z80 or TLCS90 -Sound: [AY] + [YM] + [YM] + [M5205] +Sound: [AY] + [YM] + [YM] + [M5205] / M6295 VDP: HD46505SP (6845) (CRT controller) Custom: TC17G032AP-0246 (blitter) @@ -24,6 +24,7 @@ Year + Game Main Board Sub Board CPU Sound 90 Mj Campus Hunting D3312108L1-1 D23SUB1 Z80 AY8912 YM2413 M5205 RAM 90 Hana Jingi no number D3312108L1-2 Z80 AY8912 YM2413 M5205 RAM 90 7jigen no Youseitachi D3707198L1 D23SUB1 Z80 AY8912 YM2413 M5205 RAM +89 Mj Electromagnetic Base D3803248L1 Z80 AY8912 YM2413 M5205 RAM 90 Mj Electron Base Z80 AY8912 YM2413 RAM 90 Mj X-Tal/Diamond 7 D4005208L1-1 D23SUB Z80 AY8912 YM2413 M5205 RAM 90 Mj Neruton Haikujiradan D4005208L1-1 D4508308L-2 Z80 AY8912 YM2413 M5205 RAM @@ -33,10 +34,12 @@ Year + Game Main Board Sub Board CPU Sound 91 Mj Angels D5512068L1-1 D6107068L-1 Z80 AY8912 YM2413 M5205 RAM 91 Mj Comic Gekijou V.1 D5512068L1-1 D6107068L-1 Z80 AY8912 YM2413 M5205 M6242 RAM NL-001, Battery 91 Mj Tenkaigen TLCS AY8910 YM2413 M6242 RAM Protection, Battery +91 Mj Ougon No Pai D6209038L1-0 TLCS AY8910 YM2413 RAM Undumped TMP91P640 Code, Battery 92 Quiz TV Gassyuukoku D5512068L1-2 D6410288L-1 Z80 AY8912 YM2413 M5205 RAM 92 Hanafuda Hana Tengoku D6502208L1 D6107068L-1 Z80 AY8910 YM2413 M6242 RAM +94 Castle Of Dracula Z80 M6295 PROM Blitter is an FPGA 94 Mj Reach (bootleg) bootleg TLCS AY8910 YM2413 M6242 PROM Battery -94 Maya Z80 YM2203 PROM +94 Maya Z80 YM2203 PROM Blitter is an FPGA 96 Mj Raijinhai DX D10010318L1 D10502168 TLCS AY8910 M6242 PROM Undumped TMP91P640 Code, Battery 9? Inca Z80 YM2203 PROM --------------------------------------------------------------------------------------------------------------------- @@ -438,6 +441,11 @@ WRITE8_MEMBER(dynax_state::yarunara_layer_half2_w) hnoridur_layer_half2_w(space, 0, data >> 1); } +static ADDRESS_MAP_START( cdracula_mem_map, AS_PROGRAM, 8, dynax_state ) + AM_RANGE( 0x0000, 0xbfff ) AM_ROM + AM_RANGE( 0xc000, 0xffff ) AM_RAM +ADDRESS_MAP_END + static ADDRESS_MAP_START( sprtmtch_mem_map, AS_PROGRAM, 8, dynax_state ) AM_RANGE( 0x0000, 0x6fff ) AM_ROM AM_RANGE( 0x7000, 0x7fff ) AM_RAM AM_SHARE("nvram") @@ -555,7 +563,7 @@ static ADDRESS_MAP_START( hnoridur_io_map, AS_IO, 8, dynax_state ) AM_RANGE( 0x30, 0x30 ) AM_WRITE(adpcm_reset_w) // MSM5205 reset AM_RANGE( 0x32, 0x32 ) AM_WRITE(adpcm_data_w) // MSM5205 data AM_RANGE( 0x34, 0x35 ) AM_DEVWRITE("ym2413", ym2413_device, write) // - AM_RANGE( 0x36, 0x36 ) AM_DEVREAD("aysnd", ay8910_device, data_r) // AY8910, DSW1 + AM_RANGE( 0x36, 0x36 ) AM_DEVREAD("aysnd", ay8910_device, data_r) // AY8910, DSW0 AM_RANGE( 0x38, 0x38 ) AM_DEVWRITE("aysnd", ay8910_device, data_w) // AY8910 AM_RANGE( 0x3a, 0x3a ) AM_DEVWRITE("aysnd", ay8910_device, address_w) // AM_RANGE( 0x40, 0x40 ) AM_WRITE(dynax_blit_pen_w) // Destination Pen @@ -640,7 +648,7 @@ static ADDRESS_MAP_START( hjingi_io_map, AS_IO, 8, dynax_state ) AM_RANGE( 0x32, 0x32 ) AM_WRITE(adpcm_data_w) // MSM5205 data AM_RANGE( 0x34, 0x35 ) AM_DEVWRITE("ym2413", ym2413_device, write) // - AM_RANGE( 0x36, 0x36 ) AM_DEVREAD("aysnd", ay8910_device, data_r) // AY8910, DSW1 + AM_RANGE( 0x36, 0x36 ) AM_DEVREAD("aysnd", ay8910_device, data_r) // AY8910, DSW0 AM_RANGE( 0x38, 0x38 ) AM_DEVWRITE("aysnd", ay8910_device, data_w) // AY8910 AM_RANGE( 0x3a, 0x3a ) AM_DEVWRITE("aysnd", ay8910_device, address_w) // @@ -1044,7 +1052,7 @@ READ8_MEMBER(dynax_state::mjelctrn_keyboard_1_r) READ8_MEMBER(dynax_state::mjelctrn_dsw_r) { int dsw = (m_keyb & 0xc0) >> 6; - static const char *const dswnames[] = { "DSW0", "DSW1", "DSW3", "DSW4" }; + static const char *const dswnames[] = { "DSW0", "DSW1", "DSW2", "DSW3" }; return ioport(dswnames[dsw])->read(); } @@ -1092,6 +1100,39 @@ static ADDRESS_MAP_START( mjelctrn_io_map, AS_IO, 8, dynax_state ) AM_RANGE( 0xe7, 0xe7 ) AM_WRITE(hnoridur_palbank_w) ADDRESS_MAP_END +static ADDRESS_MAP_START( mjembase_io_map, AS_IO, 8, dynax_state ) + ADDRESS_MAP_GLOBAL_MASK(0xff) + AM_RANGE( 0x04, 0x05 ) AM_DEVWRITE("ym2413", ym2413_device, write) // + AM_RANGE( 0x06, 0x06 ) AM_DEVREAD("aysnd", ay8910_device, data_r) // AY8910, dsw0 + AM_RANGE( 0x08, 0x08 ) AM_DEVWRITE("aysnd", ay8910_device, data_w) // + AM_RANGE( 0x0a, 0x0a ) AM_DEVWRITE("aysnd", ay8910_device, address_w) // + AM_RANGE( 0x11, 0x12 ) AM_WRITE(mjelctrn_blitter_ack_w) //? + AM_RANGE( 0x1c, 0x1c ) AM_READ_PORT("DSW1") + AM_RANGE( 0x1e, 0x1e ) AM_READ_PORT("DSW2") + AM_RANGE( 0x20, 0x20 ) AM_WRITE(hanamai_keyboard_w) // keyboard row select + AM_RANGE( 0x21, 0x21 ) AM_READ_PORT("COINS") // Coins + AM_RANGE( 0x22, 0x22 ) AM_READ(mjelctrn_keyboard_1_r) // P2 + AM_RANGE( 0x23, 0x23 ) AM_READ(hanamai_keyboard_0_r) // P1 + AM_RANGE( 0x24, 0x24 ) AM_READ_PORT("DSW3") +// AM_RANGE( 0x40, 0x40 ) AM_WRITENOP // CRT Controller +// AM_RANGE( 0x41, 0x41 ) AM_WRITENOP // CRT Controller + AM_RANGE( 0x61, 0x67 ) AM_WRITE(dynax_blitter_rev2_w) // Blitter + AM_RANGE( 0x80, 0x80 ) AM_WRITE(dynax_flipscreen_w) // Flip Screen + AM_RANGE( 0x81, 0x81 ) AM_WRITE(hanamai_layer_half_w) // half of the interleaved layer to write to + AM_RANGE( 0x82, 0x82 ) AM_WRITE(hnoridur_layer_half2_w) // + AM_RANGE( 0x83, 0x83 ) AM_WRITE(dynax_coincounter_0_w) // Coin Counters + AM_RANGE( 0x84, 0x84 ) AM_WRITE(dynax_coincounter_1_w) // + AM_RANGE( 0xa0, 0xa0 ) AM_WRITE(hnoridur_rombank_w) // BANK ROM Select + AM_RANGE( 0xc0, 0xc0 ) AM_WRITE(dynax_blit_pen_w) // Destination Pen + AM_RANGE( 0xc1, 0xc1 ) AM_WRITE(mjembase_blit_dest_w) // Destination Layer + AM_RANGE( 0xc2, 0xc2 ) AM_WRITE(dynax_blit_palette01_w) // Layers Palettes + AM_RANGE( 0xc3, 0xc3 ) AM_WRITE(mjembase_blit_palette23_w) // + AM_RANGE( 0xc4, 0xc4 ) AM_WRITE(mjembase_priority_w) // layer priority and enable + AM_RANGE( 0xc5, 0xc5 ) AM_WRITE(dynax_blit_backpen_w) // Background Color + AM_RANGE( 0xc6, 0xc6 ) AM_WRITE(yarunara_blit_romregion_w) // Blitter ROM bank + AM_RANGE( 0xc7, 0xc7 ) AM_WRITE(hnoridur_palbank_w) +ADDRESS_MAP_END + /*************************************************************************** Mahjong Tenkaigen @@ -1504,6 +1545,48 @@ static ADDRESS_MAP_START( gekisha_io_map, AS_IO, 8, dynax_state ) ADDRESS_MAP_END +/*************************************************************************** + Castle Of Dracula +***************************************************************************/ + +WRITE8_MEMBER(dynax_state::cdracula_sound_rombank_w) +{ +// logerror("%s: sound bank = %02x\n", machine().describe_context(), data); + + int num_banks = memregion("oki")->bytes() / 0x40000; + if (data < num_banks) + m_oki->set_bank_base(data * 0x40000); + else + logerror("%s: warning, invalid sound bank = %02x\n", machine().describe_context(), data); +} + +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( 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( 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) + AM_RANGE( 0x35, 0x35 ) AM_WRITE(dynax_blit_palette23_w) // + AM_RANGE( 0x36, 0x36 ) AM_WRITE(dynax_blit_backpen_w) // Background Color + AM_RANGE( 0x37, 0x37 ) AM_WRITE(dynax_vblank_ack_w) // VBlank IRQ Ack + AM_RANGE( 0x41, 0x41 ) AM_WRITE(dynax_flipscreen_w) // Flip Screen + AM_RANGE( 0x44, 0x44 ) AM_WRITE(jantouki_blitter_ack_w) // Blitter IRQ Ack + AM_RANGE( 0x45, 0x45 ) AM_WRITE(dynax_blit_palbank_w) // Layers Palettes (High Bit) + AM_RANGE( 0x60, 0x60 ) AM_READ_PORT("DSW2") + AM_RANGE( 0x61, 0x61 ) AM_READ_PORT("DSW1") + AM_RANGE( 0x6b, 0x6b ) AM_WRITE(cdracula_sound_rombank_w) // OKI Bank +ADDRESS_MAP_END + + /*************************************************************************** @@ -1928,6 +2011,85 @@ static INPUT_PORTS_START( HANAFUDA_KEYS_BET_ALT ) INPUT_PORTS_END #endif +static INPUT_PORTS_START( cdracula ) + PORT_START("P1") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) // erase on highscore entry + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 ) + + PORT_START("P2") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) // erase on highscore entry + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START2 ) + + PORT_START("COINS") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(10) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(10) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) + + 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 + PORT_DIPSETTING( 0x01, DEF_STR( Hard ) ) // 4a + PORT_DIPSETTING( 0x00, DEF_STR( Hardest ) ) // 4d + PORT_DIPNAME( 0x0c, 0x08, "Time" ) PORT_DIPLOCATION( "SW1:3,4" ) + PORT_DIPSETTING( 0x0c, "120 sec" ) + PORT_DIPSETTING( 0x08, "90 sec" ) + PORT_DIPSETTING( 0x04, "60 sec" ) + PORT_DIPSETTING( 0x00, "60 sec (duplicate)" ) + PORT_DIPNAME( 0x10, 0x10, DEF_STR( Lives ) ) PORT_DIPLOCATION( "SW1:5" ) + PORT_DIPSETTING( 0x10, "3" ) + PORT_DIPSETTING( 0x00, "5" ) + PORT_DIPNAME( 0x20, 0x20, "Max Lives" ) PORT_DIPLOCATION( "SW1:6" ) + PORT_DIPSETTING( 0x20, "5" ) + PORT_DIPSETTING( 0x00, "8" ) + 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_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 ) ) + PORT_DIPSETTING( 0x03, DEF_STR( 1C_1C ) ) + PORT_DIPSETTING( 0x02, DEF_STR( 1C_2C ) ) + PORT_DIPNAME( 0x04, 0x04, "Unknown 2-3" ) PORT_DIPLOCATION( "SW2:3" ) + PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x08, 0x08, "Reset Tiles After Miss" ) PORT_DIPLOCATION( "SW2:4" ) + PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x10, 0x10, "Unknown 2-5" ) PORT_DIPLOCATION( "SW2:5" ) + PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x20, 0x20, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION( "SW2:6" ) + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x20, DEF_STR( On ) ) + PORT_DIPNAME( 0x40, 0x40, "Sound Test" ) PORT_DIPLOCATION( "SW2:7" ) + PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x80, 0x80, "Graphics Test" ) PORT_DIPLOCATION( "SW2:8" ) + PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) +INPUT_PORTS_END + static INPUT_PORTS_START( hanamai ) PORT_START("DSW0") PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) ) @@ -3026,9 +3188,9 @@ static INPUT_PORTS_START( jantouki ) PORT_DIPSETTING( 0x02, "11:00" ) PORT_DIPSETTING( 0x01, "11:30" ) PORT_DIPSETTING( 0x00, "12:00" ) - PORT_DIPNAME( 0x08, 0x08, "Moles On Gal's Face" ) - PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x08, 0x00, "Nudity" ) + PORT_DIPSETTING( 0x00, DEF_STR( Yes ) ) + 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 ) ) @@ -3097,6 +3259,131 @@ static INPUT_PORTS_START( jantouki ) INPUT_PORTS_END +static INPUT_PORTS_START( mjembase ) + PORT_START("DSW2") /* DIP1, 7c20 (port $1e) */ + PORT_DIPNAME( 0x0f, 0x07, "Pay Out Rate" ) + PORT_DIPSETTING( 0x00, "50" ) + PORT_DIPSETTING( 0x01, "53" ) + PORT_DIPSETTING( 0x02, "56" ) + PORT_DIPSETTING( 0x03, "59" ) + PORT_DIPSETTING( 0x04, "62" ) + PORT_DIPSETTING( 0x05, "65" ) + PORT_DIPSETTING( 0x06, "68" ) + PORT_DIPSETTING( 0x07, "71" ) + PORT_DIPSETTING( 0x08, "75" ) + PORT_DIPSETTING( 0x09, "78" ) + PORT_DIPSETTING( 0x0a, "81" ) + PORT_DIPSETTING( 0x0b, "84" ) + PORT_DIPSETTING( 0x0c, "87" ) + PORT_DIPSETTING( 0x0d, "90" ) + PORT_DIPSETTING( 0x0e, "93" ) + PORT_DIPSETTING( 0x0f, "96" ) + PORT_DIPNAME( 0x30, 0x30, "Max Bet" ) + PORT_DIPSETTING( 0x30, "1" ) + PORT_DIPSETTING( 0x20, "5" ) + PORT_DIPSETTING( 0x10, "10" ) + PORT_DIPSETTING( 0x00, "20" ) + PORT_DIPNAME( 0x40, 0x40, DEF_STR( Coin_B ) ) + PORT_DIPSETTING( 0x40, DEF_STR( 1C_5C ) ) + PORT_DIPSETTING( 0x00, "1 Coin/10 Credits" ) + PORT_DIPNAME( 0x80, 0x80, DEF_STR( Flip_Screen ) ) + PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + + PORT_START("DSW1") /* DIP2, 7c21 (port $1c) */ + PORT_DIPNAME( 0x03, 0x03, "Difficulty?" ) + PORT_DIPSETTING( 0x03, "0" ) // 20 + PORT_DIPSETTING( 0x00, "1" ) // 32 + PORT_DIPSETTING( 0x01, "2" ) // 64 + PORT_DIPSETTING( 0x02, "3" ) // c8 + PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Coin_A ) ) + PORT_DIPSETTING( 0x0c, DEF_STR( 1C_1C ) ) + PORT_DIPSETTING( 0x08, DEF_STR( 1C_2C ) ) + PORT_DIPSETTING( 0x04, DEF_STR( 1C_5C ) ) + PORT_DIPSETTING( 0x00, "1 Coin/10 Credits" ) + PORT_DIPNAME( 0x30, 0x30, "Min Pay?" ) + PORT_DIPSETTING( 0x30, "1" ) + PORT_DIPSETTING( 0x20, "2" ) + PORT_DIPSETTING( 0x10, "3" ) + PORT_DIPSETTING( 0x00, "5" ) + PORT_DIPNAME( 0x40, 0x40, "Allow Coin Out" ) + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x40, DEF_STR( On ) ) + PORT_DIPNAME( 0x80, 0x80, "Win A Prize?" ) + PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + + PORT_START("DSW0") /* DIP3, 7c22 (port $06, AY) */ /* note that these are in reverse order wrt the others */ + PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x02, 0x02, "DonDen Key" ) + PORT_DIPSETTING( 0x02, "A" ) + PORT_DIPSETTING( 0x00, "Flip Flop" ) + PORT_DIPNAME( 0x04, 0x04, "Draw New Tile" ) + PORT_DIPSETTING( 0x00, "Automatic" ) + PORT_DIPSETTING( 0x04, "Manual" ) + PORT_DIPNAME( 0x08, 0x08, "Win Rate?" ) + PORT_DIPSETTING( 0x08, DEF_STR( High ) ) + PORT_DIPSETTING( 0x00, DEF_STR( Low ) ) + PORT_DIPNAME( 0x10, 0x10, "YAKU times" ) + PORT_DIPSETTING( 0x10, "1" ) + PORT_DIPSETTING( 0x00, "2" ) + PORT_DIPNAME( 0xe0, 0xe0, "YAKUMAN Bonus" ) + PORT_DIPSETTING( 0xe0, "Cut" ) + PORT_DIPSETTING( 0x60, "1 T" ) + PORT_DIPSETTING( 0xa0, "300" ) + PORT_DIPSETTING( 0x20, "500" ) + PORT_DIPSETTING( 0xc0, "700" ) + PORT_DIPSETTING( 0x40, "1000" ) +// PORT_DIPSETTING( 0x80, "1000" ) +// PORT_DIPSETTING( 0x00, "1000" ) + + PORT_START("DSW3") /* DIP4, 7c23 (port $24) */ + PORT_DIPNAME( 0x01, 0x01, "Last Chance" ) + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x01, DEF_STR( On ) ) + PORT_DIPNAME( 0x02, 0x02, "Pay Rate?" ) + PORT_DIPSETTING( 0x02, DEF_STR( High ) ) + PORT_DIPSETTING( 0x00, DEF_STR( Low ) ) + PORT_DIPNAME( 0x04, 0x04, "Choose Bonus" ) + PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x08, 0x08, "In-Game Bet?" ) + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x08, DEF_STR( On ) ) + PORT_DIPNAME( 0x10, 0x00, DEF_STR( Demo_Sounds ) ) + PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x20, 0x00, "In-Game Music" ) + PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x40, 0x40, "Select Girl" ) + PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) + 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_START("FAKE") /* IN10 - Fake DSW */ + PORT_DIPNAME( 0xff, 0xff, "Allow Bets" ) + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0xff, DEF_STR( On ) ) + + PORT_START("COINS") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT ) PORT_CODE(KEYCODE_4) // Pay + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) // 18B + PORT_SERVICE( 0x04, IP_ACTIVE_LOW ) // Test + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 ) // Analyzer + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE3 ) // Memory Reset + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN2 ) // Note + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 ) // Coin + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SERVICE1 ) // Service + + PORT_INCLUDE( MAHJONG_KEYS_BET ) +INPUT_PORTS_END + + static INPUT_PORTS_START( mjelct3 ) PORT_START("DSW0") /* 7c21 (select = 00) */ PORT_DIPNAME( 0x03, 0x03, "Difficulty?" ) @@ -3163,7 +3450,7 @@ static INPUT_PORTS_START( mjelct3 ) PORT_INCLUDE( MAHJONG_KEYS_BET ) - PORT_START("DSW3") /* 7c22 (select = 80) */ + PORT_START("DSW2") /* 7c22 (select = 80) */ PORT_DIPNAME( 0x07, 0x07, "YAKUMAN Bonus" ) PORT_DIPSETTING( 0x07, "Cut" ) PORT_DIPSETTING( 0x06, "1 T" ) @@ -3189,7 +3476,7 @@ static INPUT_PORTS_START( mjelct3 ) PORT_DIPSETTING( 0x80, "None (Part 2)" ) PORT_DIPSETTING( 0x00, "Super Express (Part 3)" ) - PORT_START("DSW4") /* 7c23 (select = c0) */ + PORT_START("DSW3") /* 7c23 (select = c0) */ PORT_DIPNAME( 0x01, 0x01, "Last Chance" ) PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) PORT_DIPSETTING( 0x01, DEF_STR( On ) ) @@ -3211,9 +3498,9 @@ static INPUT_PORTS_START( mjelct3 ) PORT_DIPNAME( 0x40, 0x40, "Select Girl" ) PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x80, 0x80, "Moles On Gal's Face" ) - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x80, 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_START("FAKE") /* IN10 - Fake DSW */ PORT_DIPNAME( 0xff, 0xff, "Allow Bets" ) @@ -3288,7 +3575,7 @@ static INPUT_PORTS_START( mjelctrn ) PORT_INCLUDE( MAHJONG_KEYS_BET ) - PORT_START("DSW3") /* 7c22 (select = 80) */ + PORT_START("DSW2") /* 7c22 (select = 80) */ PORT_DIPNAME( 0x07, 0x07, "YAKUMAN Bonus" ) PORT_DIPSETTING( 0x07, "Cut" ) PORT_DIPSETTING( 0x06, "1 T" ) @@ -3314,7 +3601,7 @@ static INPUT_PORTS_START( mjelctrn ) PORT_DIPSETTING( 0x80, "None (Part 2)" ) PORT_DIPSETTING( 0x00, "???? (Part 4)" ) - PORT_START("DSW4") // 7c23 (select = c0) + PORT_START("DSW3") // 7c23 (select = c0) PORT_DIPNAME( 0x01, 0x01, "Last Chance" ) PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) PORT_DIPSETTING( 0x01, DEF_STR( On ) ) @@ -3413,7 +3700,7 @@ static INPUT_PORTS_START( majxtal7 ) PORT_INCLUDE( MAHJONG_KEYS_BET ) - PORT_START("DSW3") /* select = 80 */ + PORT_START("DSW2") /* select = 80 */ PORT_DIPNAME( 0x07, 0x07, "YAKUMAN Bonus" ) PORT_DIPSETTING( 0x07, "Cut" ) PORT_DIPSETTING( 0x06, "1 T" ) @@ -3439,7 +3726,7 @@ static INPUT_PORTS_START( majxtal7 ) PORT_DIPSETTING( 0x80, "X-Tal" ) PORT_DIPSETTING( 0x00, "Diamond" ) - PORT_START("DSW4") /* select = c0 */ + PORT_START("DSW3") /* select = c0 */ PORT_DIPNAME( 0x01, 0x01, "Last Chance" ) PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) PORT_DIPSETTING( 0x01, DEF_STR( On ) ) @@ -3533,9 +3820,9 @@ static INPUT_PORTS_START( neruton ) PORT_INCLUDE( MAHJONG_KEYS ) - /* 2008-06 FP: the following are needed to make happy the read handlers shared with mjelctrn*/ + /* 2008-06 FP: the following are needed to make happy the read handlers shared with mjelctrn */ + PORT_START("DSW2") PORT_START("DSW3") - PORT_START("DSW4") PORT_START("FAKE") INPUT_PORTS_END @@ -4052,6 +4339,45 @@ MACHINE_START_MEMBER(dynax_state,hnoridur) MACHINE_START_CALL_MEMBER(dynax); } +/*************************************************************************** + Castle Of Dracula +***************************************************************************/ + +static MACHINE_CONFIG_START( cdracula, dynax_state ) + + /* basic machine hardware */ + MCFG_CPU_ADD("maincpu", Z80, XTAL_21_4772MHz/4) /* 5.3693175MHz measured */ + MCFG_CPU_PROGRAM_MAP(cdracula_mem_map) + MCFG_CPU_IO_MAP(cdracula_io_map) + MCFG_CPU_VBLANK_INT_DRIVER("screen", dynax_state, sprtmtch_vblank_interrupt) /* IM 0 needs an opcode on the data bus */ + + MCFG_MACHINE_START_OVERRIDE(dynax_state,dynax) + MCFG_MACHINE_RESET_OVERRIDE(dynax_state,dynax) + +// MCFG_NVRAM_ADD_0FILL("nvram") // no battery + + /* video hardware */ + MCFG_SCREEN_ADD("screen", RASTER) + MCFG_SCREEN_REFRESH_RATE(58.56) + MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) + MCFG_SCREEN_SIZE(512, 256) + MCFG_SCREEN_VISIBLE_AREA(16, 512-16-1, 16, 256-1) + MCFG_SCREEN_UPDATE_DRIVER(dynax_state, screen_update_cdracula) + MCFG_SCREEN_PALETTE("palette") + + MCFG_PALETTE_ADD("palette", 512) + + MCFG_PALETTE_INIT_OWNER(dynax_state,sprtmtch) // static palette + MCFG_VIDEO_START_OVERRIDE(dynax_state,hanamai) + + /* sound hardware */ + MCFG_SPEAKER_STANDARD_MONO("mono") + + MCFG_OKIM6295_ADD("oki", XTAL_4MHz / 4, OKIM6295_PIN7_HIGH) /* 1MHz measured */ + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80) +MACHINE_CONFIG_END + + /*************************************************************************** Hana no Mai ***************************************************************************/ @@ -4482,6 +4808,14 @@ static MACHINE_CONFIG_DERIVED( mjelctrn, hnoridur ) MCFG_VIDEO_START_OVERRIDE(dynax_state,mjelctrn) MACHINE_CONFIG_END +static MACHINE_CONFIG_DERIVED( mjembase, hnoridur ) + MCFG_CPU_MODIFY("maincpu") + MCFG_CPU_PROGRAM_MAP(nanajign_mem_map) + MCFG_CPU_IO_MAP(mjembase_io_map) + MCFG_CPU_VBLANK_INT_DRIVER("screen", dynax_state, mjelctrn_vblank_interrupt) /* IM 2 needs a vector on the data bus */ + + MCFG_VIDEO_START_OVERRIDE(dynax_state,mjembase) +MACHINE_CONFIG_END /*************************************************************************** Neruton @@ -4694,6 +5028,52 @@ MACHINE_CONFIG_END ***************************************************************************/ +/*************************************************************************** + +Castle Of Dracula +1994 Y.S.E. + +Not a Dynax board: + +GoldStar Z8400A PS (40-pin plastic DIP) +GoldStar GM68B45S +TI TPC1020AFN-084C +OKI M6295 (second OKI spot is unpopulated) +2 x DSW8, 28-way connector +PAL16L8ACN +4 MHz & 21.47727 MHz XTALs + +Clocks: + Z80 - 5.359MHz measured (21.47727MHz/4) + M6295 - 1Mhz (4Mhz/4) + + V-SYNC - 58.560 Hz + H-SYNC - 15.41 KHz +***************************************************************************/ + +ROM_START( cdracula ) + ROM_REGION( 0x10000, "maincpu", 0 ) // Z80 Code + ROM_LOAD( "escape.u202", 0x000000, 0x10000, CRC(92ceb689) SHA1(1b5d6cd51fc961f1b9a7b99d9ba48da8ea2e503b) ) + + ROM_REGION( 0xc0000, "gfx1", 0 ) // blitter data + ROM_LOAD( "escape.u214", 0x00000, 0x40000, CRC(52c2f3bc) SHA1(764fb447d749c1b83d2bb6bcd517949a1cd76593) ) + ROM_LOAD( "escape.u212", 0x40000, 0x40000, CRC(df536e91) SHA1(2c988e7793b2665d8ebb12a8f80a9aefdd3ed1dd) ) + ROM_LOAD( "escape.u210", 0x80000, 0x40000, CRC(d3f5bac2) SHA1(d81ac3ca159985b0a79d02ebe707b46fdeaefe64) ) + + ROM_REGION( 0xc0000, "oki", 0 ) + ROM_LOAD( "escape.ua", 0x00000, 0x20000, CRC(2f25be27) SHA1(9b7653ae9ebfd4a301d786c5c731478774e5171d) ) + ROM_LOAD( "escape.ub", 0x20000, 0x20000, CRC(536a8dd0) SHA1(1ec226b0cd4d1320cdfce0a447ea0e481b85a802) ) + ROM_LOAD( "escape.uc", 0x40000, 0x20000, CRC(393fa285) SHA1(654ab2fb92efa28f65bcc7c70a9fae2e43657309) ) + ROM_LOAD( "escape.ud", 0x60000, 0x20000, CRC(eff474af) SHA1(7ab1f0079d051c9b0c4aa566a4d92032c7060d8e) ) + ROM_LOAD( "escape.ue", 0x80000, 0x20000, CRC(0f9dc93b) SHA1(a3b33795cf07882ecc80d9afa5174e771ee0df08) ) + ROM_FILL( 0xa0000, 0x20000, 0 ) + + ROM_REGION( 0x400, "proms", 0 ) // Color PROMs + ROM_LOAD( "82s147an.u26", 0x000, 0x200, CRC(1a3fe146) SHA1(7d1b4dd66fc95ea5ed584f0bb571cca09fe519b0) ) // FIXED BITS (00xxxxxx) + ROM_LOAD( "82s147an.u25", 0x200, 0x200, CRC(31791990) SHA1(526c0d516f290dc6cc2ec76d9bcec8c900e2ae10) ) +ROM_END + + /*************************************************************************** Hana no Mai @@ -5821,6 +6201,37 @@ ROM_START( mjelctrb ) ROM_LOAD( "eb-02.rom", 0x00000, 0x80000, CRC(e1f1b431) SHA1(04a612aff4c30cb8ea741f228bfa7e4289acfee8) ) ROM_END +/*************************************************************************** + +Mahjong Electromagnetic Base +DYNAX D3803248L1 + +AY-3-8912?, MSM5205? +HD46505SP?, Dynax blitter? (rest of the chips are scratched) +4 x DSW8, 28-way connector + +***************************************************************************/ + +ROM_START( mjembase ) + ROM_REGION( 0x30000, "maincpu", 0 ) + ROM_LOAD( "dynax_3815.20a", 0x00000, 0x20000, CRC(35b35b48) SHA1(9966804337a7c6de160a09087e1fea3b0a515fe4) ) + ROM_RELOAD( 0x10000, 0x20000 ) + + ROM_REGION( 0x100000, "gfx1", 0 ) // blitter data + ROM_LOAD( "dynax_3803.7c", 0x000000, 0x20000, CRC(5480c4f8) SHA1(8f533683eb08281f50247c17e7ccfcfd2d8f1937) ) + ROM_LOAD( "dynax_3802.6c", 0x020000, 0x20000, CRC(ba27976a) SHA1(cb9ce82054b7568507807a891ada3d39adf094d2) ) + ROM_LOAD( "dynax_3801.5c", 0x040000, 0x20000, CRC(84a013ac) SHA1(3d5c196f7474bb13d9b724befec3de7f247953e3) ) + ROM_LOAD( "dynax_3804.1a", 0x060000, 0x20000, CRC(8c055525) SHA1(8e31bef48a8b89e79ecb8b71855bc20036667561) ) + ROM_LOAD( "dynax_3805.3a", 0x080000, 0x20000, CRC(a27b2063) SHA1(9da26086832f047c65ad88147e65d1f65e9b7677) ) + ROM_LOAD( "dynax_3806.5a", 0x0a0000, 0x20000, CRC(42486764) SHA1(217ea04fad8853b03522474a70a322642a5301a5) ) + ROM_LOAD( "dynax_3807.6a", 0x0c0000, 0x20000, CRC(c29abf8f) SHA1(79e05fc0decd450622189ce1c8681c4442c566b0) ) + ROM_LOAD( "dynax_3808.7a", 0x0e0000, 0x20000, CRC(72efcd62) SHA1(9b84043fc9b2dcaf97a58aba0ba4ce27ee64381c) ) + + ROM_REGION( 0x040000, "gfx2", 0 ) // blitter data + ROM_LOAD( "dynax_3809.9a", 0x000000, 0x20000, CRC(7c239069) SHA1(71c8b437a555ab48ce600ff283d50e0a21e9f8eb) ) + ROM_LOAD( "dynax_381a.10a", 0x020000, 0x20000, CRC(72c092c7) SHA1(3a4f1cd56c9544dcd4689e385c98407c45ac894c) ) +ROM_END + /* @@ -6340,7 +6751,7 @@ ROM_START( tenkai ) // It appears that the first half of lzc-01.u6 in tenkaibb (as well as the same data in other bootleg versions) // does not exist _anywhere_ in this rom dump, and in this way some girls won't show correctly (such as the 3rd one) ROM_REGION( 0x100000, "gfx1", 0 ) // blitter data - ROM_LOAD( "tydg002.u8", 0x000000, 0x80000, BAD_DUMP CRC(b0f08a20) SHA1(5f7083d5caadd77594eaf46efa11a8756cefcf7d) ) // not dumped, rom taken from tenkaid + ROM_LOAD( "tydg002.u8", 0x000000, 0x80000, BAD_DUMP CRC(b0f08a20) SHA1(5f7083d5caadd77594eaf46efa11a8756cefcf7d) ) // not dumped, rom taken from ougonpaib ROM_LOAD( "taicom01.15b", 0x080000, 0x80000, BAD_DUMP CRC(39e4e6f3) SHA1(5b543a5933446091d7cfd519d5a6f23047d8a9f2) ) // either this was dumped half size, or the above rom was missing from the pcb ROM_REGION( 0x100000, "gfx2", 0 ) // blitter data @@ -6533,7 +6944,7 @@ ROM_START( tenkaicb ) // it doesn't need the internal rom from tenkai ROM_REGION( 0x100000, "gfx1", 0 ) // blitter data - ROM_LOAD( "tydg002.u8", 0x00000, 0x80000, BAD_DUMP CRC(b0f08a20) SHA1(5f7083d5caadd77594eaf46efa11a8756cefcf7d) ) // not dumped, rom taken from tenkaid + ROM_LOAD( "tydg002.u8", 0x00000, 0x80000, BAD_DUMP CRC(b0f08a20) SHA1(5f7083d5caadd77594eaf46efa11a8756cefcf7d) ) // not dumped, rom taken from ougonpaib ROM_LOAD( "rom.u12", 0x80000, 0x80000, BAD_DUMP CRC(39e4e6f3) SHA1(5b543a5933446091d7cfd519d5a6f23047d8a9f2) ) // either this was dumped half size, or the above rom was missing from the pcb ROM_REGION( 0x100000, "gfx2", 0 ) // blitter data @@ -6543,90 +6954,6 @@ ROM_END /*************************************************************************** -Mahjong Tenkaigen (? PCB is not working) - -PCB Layout ----------- - -|-------------------------------------------| -| 4558 3.579545MHz BATTERY | -|uPC1241H VOL K-663A DSW DSW 6264 | -| DSW DSW TYDG001 | -| DSW NL-002 YM2149 PAL | -|1 | -|8 6116 TMP91C640| -|W | -|A TYDG004 TYDG002 | -|Y PAL | -| | -| | -| TYDG005 TYDG003 | -| PAL | -| PAL | -|1 PAL | -|0 | -|W 81461 81461 TK-101 | -|A 81461 81461 | -|Y 81461 81461 21.245MHz | -|-------------------------------------------| - -romcmp tenkaid tenkaibb: - -tydg002.u8 lzc-01.u6 [1/2] IDENTICAL -tydg005.u19 lzc-01.u6 [2/2] IDENTICAL - -tydg001.u11 [1/4] tdh-12m.u11 [odd 2/2] 6.478882% -tydg001.u11 [2/4] lzc-03.u15 [odd] 31.292725% -tydg001.u11 [3/4] tdh-12m.u11 [even 2/2] 55.366516% -tydg001.u11 [4/4] lzc-03.u15 [even] 59.931946% - -tydg003.u6 [1/2] lzc-02.u19 [3/4] 2.625275% -tydg003.u6 [2/2] lzc-02.u19 [2/4] 1.834488% - -tydg004.u21 [1/2] lzc-02.u19 [1/4] 3.769302% -tydg004.u21 [2/2] lzc-02.u19 [4/4] 14.524460% - -romcmp tenkaid tenkai: - -tydg005.u19 taicom01.15b IDENTICAL - -tydg001.u11 [1/4] taicom00.2c [1/4] 26.155090% -tydg001.u11 [2/4] taicom00.2c [3/4] 22.038269% -tydg001.u11 [3/4] taicom00.2c [2/4] 4.237366% -tydg001.u11 [4/4] taicom00.2c [4/4] 59.855652% - -tydg002.u8 [4/4] taicom03.13b [2/4] 4.472351% - -tydg003.u6 [1/4] taicom02.11b [3/4] 2.860260% -tydg003.u6 [2/4] taicom03.13b [3/4] 6.129456% -tydg003.u6 [3/4] taicom02.11b [2/4] 2.205658% - -tydg004.u21 [1/4] taicom02.11b [1/4] 5.610657% -tydg004.u21 [2/4] taicom03.13b [1/4] 1.743317% -tydg004.u21 [3/4] taicom02.11b [4/4] 2.343750% -tydg004.u21 [4/4] taicom03.13b [4/4] 24.230194% - -***************************************************************************/ - -ROM_START( tenkaid ) - ROM_REGION( 0x90000, "maincpu", 0 ) - ROM_LOAD( "tydg001.u11", 0x00000, 0x40000, CRC(4ffa543c) SHA1(ab6ec7bd735358643f5186c6c983fa8b599fe84b) ) - ROM_RELOAD( 0x10000, 0x40000 ) - ROM_RELOAD( 0x50000, 0x40000 ) - // tenkai internal rom is incompatible with the code of this set - ROM_LOAD( "tenkaid_tmp91p640n-10.5b", 0x00000, 0x04000, NO_DUMP ) - - ROM_REGION( 0x100000, "gfx1", 0 ) // blitter data - ROM_LOAD( "tydg002.u8", 0x00000, 0x80000, CRC(b0f08a20) SHA1(5f7083d5caadd77594eaf46efa11a8756cefcf7d) ) - ROM_LOAD( "tydg003.u6", 0x80000, 0x80000, CRC(60717d91) SHA1(85dbb510d33b36d2255b740ccc4917216dd21497) ) - - ROM_REGION( 0x100000, "gfx2", 0 ) // blitter data - ROM_LOAD( "tydg004.u21", 0x00000, 0x80000, CRC(b7d49d04) SHA1(756c35bbe207b5bfc6e05d6da99a7ad5a3453506) ) - ROM_LOAD( "tydg005.u19", 0x80000, 0x80000, CRC(39e4e6f3) SHA1(5b543a5933446091d7cfd519d5a6f23047d8a9f2) ) -ROM_END - -/*************************************************************************** - tenkaigen set 2 romcmp tenkaie tenkai: @@ -6653,6 +6980,79 @@ ROM_START( tenkaie ) ROM_LOAD( "lzc-02.rom", 0x000000, 0x100000, CRC(90a19443) SHA1(8f593c00e39dd5acc76b058591019d117967a17b) ) ROM_END +/*************************************************************************** + +Mahjong Ougon No Pai +DYNAX D6209038L1-0 + +AY-3-8910A, rest of the chips are scratched +2 x DSW10, 2 x DSW8, 1 x DSW4, Battery + +***************************************************************************/ + +ROM_START( ougonpai ) + ROM_REGION( 0x90000, "maincpu", 0 ) + ROM_LOAD( "dynax_6201b.2c", 0x00000, 0x40000, CRC(18ef8eda) SHA1(48a3e4566b0a86db907602fd235c01d96eddec23) ) + ROM_RELOAD( 0x10000, 0x40000 ) + ROM_RELOAD( 0x50000, 0x40000 ) + ROM_LOAD( "ougonpai_tmp91p640n-10.5b", 0x00000, 0x04000, NO_DUMP ) + + ROM_REGION( 0x100000, "gfx1", 0 ) // blitter data + ROM_LOAD( "dynax_6202.11b", 0x00000, 0x80000, CRC(b0f08a20) SHA1(5f7083d5caadd77594eaf46efa11a8756cefcf7d) ) // = tydg002.u8 (ougonpaib) + ROM_LOAD( "dynax_6203.13b", 0x80000, 0x80000, CRC(60717d91) SHA1(85dbb510d33b36d2255b740ccc4917216dd21497) ) // = tydg003.u6 (ougonpaib) + + ROM_REGION( 0x100000, "gfx2", 0 ) // blitter data + ROM_LOAD( "dynax_6204.14b", 0x00000, 0x80000, CRC(4142f94b) SHA1(9982f12333973b307c210e39310eafc88b8620e1) ) // ~= tydg004.u21 (ougonpaib) + ROM_LOAD( "dynax_6205.15b", 0x80000, 0x80000, CRC(39e4e6f3) SHA1(5b543a5933446091d7cfd519d5a6f23047d8a9f2) ) // = tydg005.u19 (ougonpaib) +ROM_END + +/*************************************************************************** + +Mahjong Ougon No Pai (bootleg, PCB is not working) + +PCB Layout +---------- + +|-------------------------------------------| +| 4558 3.579545MHz BATTERY | +|uPC1241H VOL K-663A DSW DSW 6264 | +| DSW DSW TYDG001 | +| DSW NL-002 YM2149 PAL | +|1 | +|8 6116 TMP91C640| +|W | +|A TYDG004 TYDG002 | +|Y PAL | +| | +| | +| TYDG005 TYDG003 | +| PAL | +| PAL | +|1 PAL | +|0 | +|W 81461 81461 TK-101 | +|A 81461 81461 | +|Y 81461 81461 21.245MHz | +|-------------------------------------------| + +***************************************************************************/ + +ROM_START( ougonpaib ) + ROM_REGION( 0x90000, "maincpu", 0 ) + ROM_LOAD( "tydg001.u11", 0x00000, 0x40000, CRC(4ffa543c) SHA1(ab6ec7bd735358643f5186c6c983fa8b599fe84b) ) + ROM_RELOAD( 0x10000, 0x40000 ) + ROM_RELOAD( 0x50000, 0x40000 ) + // tenkai internal rom is incompatible with the code of this set + ROM_LOAD( "ougonpaib_tmp91p640n-10.5b", 0x00000, 0x04000, NO_DUMP ) + + ROM_REGION( 0x100000, "gfx1", 0 ) // blitter data + ROM_LOAD( "tydg002.u8", 0x00000, 0x80000, CRC(b0f08a20) SHA1(5f7083d5caadd77594eaf46efa11a8756cefcf7d) ) // = lzc-01.u6 [1/2] + ROM_LOAD( "tydg003.u6", 0x80000, 0x80000, CRC(60717d91) SHA1(85dbb510d33b36d2255b740ccc4917216dd21497) ) + + ROM_REGION( 0x100000, "gfx2", 0 ) // blitter data + ROM_LOAD( "tydg004.u21", 0x00000, 0x80000, CRC(b7d49d04) SHA1(756c35bbe207b5bfc6e05d6da99a7ad5a3453506) ) + ROM_LOAD( "tydg005.u19", 0x80000, 0x80000, CRC(39e4e6f3) SHA1(5b543a5933446091d7cfd519d5a6f23047d8a9f2) ) // = taicom01.15b = lzc-01.u6 [2/2] +ROM_END /*************************************************************************** @@ -6913,6 +7313,7 @@ GAME( 1991, yarunara, 0, yarunara, yarunara, driver_device, 0, ROT GAME( 1991, mjangels, 0, yarunara, yarunara, driver_device, 0, ROT180, "Dynax", "Mahjong Angels - Comic Theater Vol.2 (Japan)", GAME_SUPPORTS_SAVE ) GAME( 1992, quiztvqq, 0, quiztvqq, quiztvqq, driver_device, 0, ROT180, "Dynax", "Quiz TV Gassyuukoku Q&Q (Japan)", GAME_SUPPORTS_SAVE ) GAME( 1993, mjelctrn, 0, mjelctrn, mjelctrn, dynax_state, mjelct3, ROT180, "Dynax", "Mahjong Electron Base (parts 2 & 4, Japan)", GAME_SUPPORTS_SAVE ) +GAME( 1989, mjembase, mjelctrn, mjembase, mjembase, dynax_state, mjelct3, ROT180, "Dynax", "Mahjong Electromagnetic Base", GAME_SUPPORTS_SAVE ) GAME( 1990, mjelct3, mjelctrn, mjelctrn, mjelct3, dynax_state, mjelct3, ROT180, "Dynax", "Mahjong Electron Base (parts 2 & 3, Japan)", GAME_SUPPORTS_SAVE ) GAME( 1990, mjelct3a, mjelctrn, mjelctrn, mjelct3, dynax_state, mjelct3a, ROT180, "Dynax", "Mahjong Electron Base (parts 2 & 3, alt., Japan)", GAME_SUPPORTS_SAVE ) GAME( 1993, mjelctrb, mjelctrn, mjelctrn, mjelct3, dynax_state, mjelct3, ROT180, "bootleg", "Mahjong Electron Base (parts 2 & 4, Japan, bootleg)", GAME_SUPPORTS_SAVE ) @@ -6925,8 +7326,10 @@ GAME( 1991, tenkai, 0, tenkai, tenkai, driver_device, 0, ROT GAME( 1991, tenkai2b, tenkai, tenkai, tenkai, driver_device, 0, ROT0, "bootleg", "Mahjong Tenkaigen Part 2 (bootleg)", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) GAME( 1991, tenkaibb, tenkai, tenkai, tenkai, driver_device, 0, ROT0, "bootleg", "Mahjong Tenkaigen (bootleg b)", GAME_SUPPORTS_SAVE ) GAME( 1991, tenkaicb, tenkai, tenkai, tenkai, driver_device, 0, ROT0, "bootleg", "Mahjong Tenkaigen (bootleg c)", GAME_SUPPORTS_SAVE ) -GAME( 1991, tenkaid, tenkai, tenkai, tenkai, driver_device, 0, ROT0, "Dynax", "Mahjong Tenkaigen (set 1)", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) GAME( 1991, tenkaie, tenkai, tenkai, tenkai, driver_device, 0, ROT0, "Dynax", "Mahjong Tenkaigen (set 2)", GAME_SUPPORTS_SAVE ) +GAME( 1991, ougonpai, 0, tenkai, tenkai, driver_device, 0, ROT0, "Dynax", "Mahjong Ougon No Pai", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) +GAME( 1991, ougonpaib,ougonpai, tenkai, tenkai, driver_device, 0, ROT0, "bootleg", "Mahjong Ougon No Pai (bootleg)", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) GAME( 1994, mjreach, 0, tenkai, mjreach, dynax_state, mjreach, ROT0, "bootleg / Dynax", "Mahjong Reach (bootleg)", GAME_SUPPORTS_SAVE ) +GAME( 1994, cdracula, 0, cdracula, cdracula, driver_device, 0, ROT0, "Yun Sung (Escape license)","Castle Of Dracula", GAME_SUPPORTS_SAVE ) // not a dynax board GAME( 1995, shpeng, 0, sprtmtch, drgpunch, driver_device, 0, ROT0, "WSAC Systems?", "Sea Hunter Penguin", GAME_NO_COCKTAIL | GAME_WRONG_COLORS | GAME_SUPPORTS_SAVE ) // not a dynax board. proms? GAME( 1996, majrjhdx, 0, majrjhdx, tenkai, driver_device, 0, ROT0, "Dynax", "Mahjong Raijinhai DX", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) diff --git a/src/mame/drivers/galaxian.c b/src/mame/drivers/galaxian.c index f847b6cce86..da85af50ecb 100644 --- a/src/mame/drivers/galaxian.c +++ b/src/mame/drivers/galaxian.c @@ -10915,7 +10915,7 @@ GAME( 1981, scramble, 0, scramble, scramble, galaxian_state, scram GAME( 1981, scrambles, scramble, scramble, scramble, galaxian_state, scramble, ROT90, "Konami (Stern Electronics license)", "Scramble (Stern Electronics set 1)", GAME_SUPPORTS_SAVE ) GAME( 1981, scrambles2, scramble, scramble, scramble, galaxian_state, scramble, ROT90, "Konami (Stern Electronics license)", "Scramble (Stern Electronics set 2)", GAME_SUPPORTS_SAVE ) GAME( 1981, strfbomb, scramble, scramble, strfbomb, galaxian_state, scramble, ROT90, "bootleg (Omni)", "Strafe Bomb (bootleg of Scramble)", GAME_SUPPORTS_SAVE ) -GAME( 1981, explorer, scramble, explorer, explorer, galaxian_state, explorer, ROT90, "bootleg", "Explorer (bootleg of Scramble)", GAME_SUPPORTS_SAVE ) +GAME( 1981, explorer, scramble, explorer, explorer, galaxian_state, explorer, ROT90, "bootleg (Sidam)", "Explorer (bootleg of Scramble)", GAME_SUPPORTS_SAVE ) GAME( 1981, scramblebf, scramble, scramble, scramble, galaxian_state, scramble, ROT90, "bootleg (Karateko)", "Scramble (Karateko, French bootleg)", GAME_SUPPORTS_SAVE ) GAME( 1981, scrambp, scramble, scramble, scramble, galaxian_state, scramble, ROT90, "bootleg (Billport S.A.)", "Impacto (Billport S.A., Spanish bootleg of Scramble)", GAME_SUPPORTS_SAVE ) // similar to the Karateko set above GAME( 1981, scrampt, scramble, scramble, scramble, galaxian_state, scramble, ROT90, "bootleg (Petaco S.A.)", "Scramble (Petaco S.A., Spanish bootleg)", GAME_SUPPORTS_SAVE ) // ^^ diff --git a/src/mame/drivers/galaxold.c b/src/mame/drivers/galaxold.c index bcddcbe87e0..a6d5313c763 100644 --- a/src/mame/drivers/galaxold.c +++ b/src/mame/drivers/galaxold.c @@ -2876,10 +2876,10 @@ ROM_START( froggerv ) ROM_LOAD( "rana_ic12.ic12", 0x0800, 0x0800, CRC(c1690dfc) SHA1(c6fdb1b9ec4fb7da2566b0c71e3e2f931cdece68) ) ROM_REGION( 0x0020, "proms", 0 ) - ROM_LOAD( "ic10", 0x0000, 0x0020, CRC(4e3caeab) SHA1(a25083c3e36d28afdefe4af6e6d4f3155e303625) ) + ROM_LOAD( "ic10", 0x0000, 0x0020, CRC(4e3caeab) SHA1(a25083c3e36d28afdefe4af6e6d4f3155e303625) ) // SN74288 or equivalent BPROM ROM_REGION( 0x0020, "user1", 0 ) /* decode PROMs */ - ROM_LOAD( "ic7", 0x0000, 0x0020, CRC(4ac17114) SHA1(1fa34a556fe445a6bdabfe75b4b679cab6553c8b) ) + ROM_LOAD( "ic7", 0x0000, 0x0020, CRC(4ac17114) SHA1(1fa34a556fe445a6bdabfe75b4b679cab6553c8b) ) // SN74288 or equivalent BPROM ROM_END diff --git a/src/mame/drivers/goldstar.c b/src/mame/drivers/goldstar.c index 5d76c6b9c5c..f1868c108a5 100644 --- a/src/mame/drivers/goldstar.c +++ b/src/mame/drivers/goldstar.c @@ -117,9 +117,36 @@ Nominated for the *WORST* hacked gambling game EVER! + * unkch sets + + In unkch1/unkch2 the payout rate is set with a combination of DSW1-3 (Punti) + and DSW3-3 (Gettoni/Ticket). If Punti is set to Ticket, the payout rate is + the second number of the Gettoni/Ticket setting (100 or 200). If Punti is set + to Gettoni, the payout rate is the first number of the Gettoni/Ticket setting + (10 or 20). If your points/credits aren't a multiple of the payout rate, you + lose the remainder. If you hit Key Out when your points/credits are less than + 100, you get nothing at all. If Gettoni/Ticket is set to 20/200 and you hit + Key Out when credits/points are at least 100 but less than 200, tickets will + be dispensed continuously until you insert another coin - game bug or MAME + bug? + + Payout rate in unkch3 seems to be set with DSW1-3 (Punti) directly. This game + also seems to be able to easily get into a state where tickets are dispensed + continuously. Maybe there's something more complicated about the ticket + dispenser hookup that we're missing? + + In unkch4 the payout rate is set with DSW1-3 (Punti) - 100 for Ticket and 10 + for Gettoni. It's also nice enough to let you keep the remainder if you hit + Key Out when your credits/points aren't a multiple of 100. This is the only + set that doesn't have issues with dispensing tickets continuously + + unkch3 has a handy input test mode. To access it, first enable it with DSW4-5, + then hold the Settings button (9) during boot. + + * Crazy Bonus (crazybon): - Appears to be from a bootleg conversion set for Poker Master (pokrmast). There + Appears to be from a bootleg conversion set for Poker Master (pkrmast). There is another undumped bootleg conversion set advertised that displays Spirit or Dyna copyright depending on DIP settings and has both poker and slots games (the set in MAME displays "Crazy Co." copyright and only has a slots game). @@ -127,7 +154,7 @@ This is a stealth set that hides behind a fake Windows ME desktop if DSW2-6 is off. Push Start followed by Bet five time to access the game. It will return to the desktop after the game is over. Colours currently appear to be bad on - the desktop screen. + the desktop screen. DSW3-8 disables the button sequence for accessing the game. Judging from the contents of the graphics ROMs and the Stats screens, there's a poker game buried in there, but there's apparently no way to access it. @@ -157,16 +184,22 @@ #include "bingowng.lh" #include "cherryb3.lh" +#include "chrygld.lh" #include "cmaster.lh" #include "cmasterb.lh" #include "cmasterc.lh" +#include "cmpacman.lh" #include "cmv4.lh" #include "crazybon.lh" #include "goldstar.lh" #include "lucky8.lh" #include "nfb96.lh" +#include "nfb96tx.lh" #include "pokonl97.lh" #include "roypok96.lh" +#include "skill98.lh" +#include "tonypok.lh" +#include "unkch.lh" WRITE8_MEMBER(goldstar_state::protection_w) @@ -183,16 +216,16 @@ READ8_MEMBER(goldstar_state::protection_r) return data[m_dataoffset++]; } -WRITE8_MEMBER(goldstar_state::goldstar_lamps_w) +WRITE8_MEMBER(goldstar_state::p1_lamps_w) { /* bits - 7654 3210 goldstar crazybon - ---- ---x Bet Red / Card 2 - ---- --x- Stop 3 / Small / Info / Card 1 Start - ---- -x-- Bet Blue / Double Up / Card 3 - ---- x--- Stop 1 / Take Bet - ---x ---- Stop 2 / Big / Bonus Stop All / Take Score - --x- ---- Start / Stop All / Card 4 Double Up + 7654 3210 goldstar crazybon ncb3/cb3a lucky8/bingowng + ---- ---x Bet Red / Card 2 Stop 2 / Big + ---- --x- Stop 3 / Small / Info / Card 1 Start Blue Bet / Double D-UP + ---- -x-- Bet Blue / Double Up / Card 3 Stop 1/Take TAKE + ---- x--- Stop 1 / Take Bet Red Bet BET + ---x ---- Stop 2 / Big / Bonus Stop All / Take Score Stop 3 / Small / Info INFO + --x- ---- Start / Stop All / Card 4 Double Up Start / Stop All START -x-- ---- Small / Info x--- ---- Big @@ -204,6 +237,7 @@ WRITE8_MEMBER(goldstar_state::goldstar_lamps_w) ---x ---- info info small small/end --x- ---- start start deal start start start -x-- ---- hold + x--- ---- all cm/cmaster use the same scheme tonypok uses lamps to indicate current button functions rather than active buttons @@ -219,30 +253,21 @@ WRITE8_MEMBER(goldstar_state::goldstar_lamps_w) output_set_lamp_value(6, (data >> 6) & 1); output_set_lamp_value(7, (data >> 7) & 1); -// popmessage("lamps: %02X", data); +// popmessage("p1 lamps: %02X", data); } -WRITE8_MEMBER(goldstar_state::cb3_lamps_w) +WRITE8_MEMBER(goldstar_state::p2_lamps_w) { -/* bits - 7654 3210 - ---- ---x Stop 2 / Big - ---- --x- Blue Bet / Double - ---- -x-- Stop 1 / Take - ---- x--- Red Bet - ---x ---- Stop 3 / Small / Info - --x- ---- Start / Stop All + output_set_lamp_value(8 + 0, (data >> 0) & 1); + output_set_lamp_value(8 + 1, (data >> 1) & 1); + output_set_lamp_value(8 + 2, (data >> 2) & 1); + output_set_lamp_value(8 + 3, (data >> 3) & 1); + output_set_lamp_value(8 + 4, (data >> 4) & 1); + output_set_lamp_value(8 + 5, (data >> 5) & 1); + output_set_lamp_value(8 + 6, (data >> 6) & 1); + output_set_lamp_value(8 + 7, (data >> 7) & 1); - TODO: there are two sets of lamps for the two players at 0xf850 and 0xf860 - handle them independently -*/ - output_set_lamp_value(0, (data) & 1); /* Stop 2 / Big */ - output_set_lamp_value(1, (data >> 1) & 1); /* Blue Bet / Double */ - output_set_lamp_value(2, (data >> 2) & 1); /* Stop 1 / Take */ - output_set_lamp_value(3, (data >> 3) & 1); /* Red Bet */ - output_set_lamp_value(4, (data >> 4) & 1); /* Stop 3 / Small / Info */ - output_set_lamp_value(5, (data >> 5) & 1); /* Start / Stop All */ - -// popmessage("lamps: %02X", data); +// popmessage("p2 lamps: %02X", data); } @@ -271,7 +296,7 @@ static ADDRESS_MAP_START( goldstar_map, AS_PROGRAM, 8, goldstar_state ) AM_RANGE(0xf820, 0xf820) AM_READ_PORT("DSW2") AM_RANGE(0xf830, 0xf830) AM_DEVREADWRITE("aysnd", ay8910_device, data_r, data_w) AM_RANGE(0xf840, 0xf840) AM_DEVWRITE("aysnd", ay8910_device, address_w) - AM_RANGE(0xf900, 0xf900) AM_WRITE(goldstar_lamps_w) + AM_RANGE(0xf900, 0xf900) AM_WRITE(p1_lamps_w) AM_RANGE(0xfa00, 0xfa00) AM_WRITE(goldstar_fa00_w) AM_RANGE(0xfb00, 0xfb00) AM_DEVREADWRITE("oki", okim6295_device, read, write) AM_RANGE(0xfd00, 0xfdff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette") @@ -365,7 +390,7 @@ static ADDRESS_MAP_START( star100_readport, AS_IO, 8, sanghopm_state ) AM_RANGE(0x25, 0x25) AM_READ_PORT("DSW2") AM_RANGE(0x26, 0x26) AM_READ_PORT("DSW3") - AM_RANGE(0xf0, 0xf0) AM_WRITENOP // Writing 0's and 1's constantly. Watchdog feeder? + AM_RANGE(0xe0, 0xe0) AM_WRITENOP // Writing 0's and 1's constantly. Watchdog feeder? AM_RANGE(0xe1, 0xe1) AM_WRITE(enable_w) // enable/disable reels register. ADDRESS_MAP_END @@ -539,8 +564,8 @@ static ADDRESS_MAP_START( ncb3_map, AS_PROGRAM, 8, cb3_state ) AM_RANGE(0xf830, 0xf830) AM_DEVREADWRITE("aysnd", ay8910_device, data_r, data_w) AM_RANGE(0xf840, 0xf840) AM_DEVWRITE("aysnd", ay8910_device, address_w) - AM_RANGE(0xf850, 0xf850) AM_WRITE(cb3_lamps_w) /* Control Set 1 lamps */ - AM_RANGE(0xf860, 0xf860) AM_WRITE(cb3_lamps_w) /* Control Set 2 lamps */ + AM_RANGE(0xf850, 0xf850) AM_WRITE(p1_lamps_w) /* Control Set 1 lamps */ + AM_RANGE(0xf860, 0xf860) AM_WRITE(p2_lamps_w) /* Control Set 2 lamps */ AM_RANGE(0xf870, 0xf870) AM_DEVWRITE("snsnd", sn76489_device, write) /* guess... device is initialized, but doesn't seems to be used.*/ ADDRESS_MAP_END @@ -720,7 +745,7 @@ static ADDRESS_MAP_START( cm_portmap, AS_IO, 8, cmaster_state ) AM_RANGE(0x08, 0x0b) AM_DEVREADWRITE("ppi8255_1", i8255_device, read, write) /* DIP switches */ AM_RANGE(0x10, 0x10) AM_WRITE(outport0_w) AM_RANGE(0x11, 0x11) AM_WRITE(cm_coincount_w) - AM_RANGE(0x12, 0x12) AM_WRITE(goldstar_lamps_w) + AM_RANGE(0x12, 0x12) AM_WRITE(p1_lamps_w) AM_RANGE(0x13, 0x13) AM_WRITE(background_col_w) AM_RANGE(0x14, 0x14) AM_WRITE(girl_scroll_w) ADDRESS_MAP_END @@ -739,7 +764,7 @@ static ADDRESS_MAP_START( pkrmast_portmap, AS_IO, 8, goldstar_state ) AM_RANGE(0x20, 0x20) AM_READ_PORT("DSW3-0") AM_RANGE(0x21, 0x21) AM_READ_PORT("DSW3-1") - AM_RANGE(0x22, 0x22) AM_WRITE(goldstar_lamps_w) + AM_RANGE(0x22, 0x22) AM_WRITE(p1_lamps_w) AM_RANGE(0x24, 0x24) AM_WRITE(cm_coincount_w) AM_RANGE(0x25, 0x25) AM_READ_PORT("DSW1") @@ -766,7 +791,7 @@ static ADDRESS_MAP_START( amcoe1_portmap, AS_IO, 8, cmaster_state ) AM_RANGE(0x08, 0x0b) AM_DEVREADWRITE("ppi8255_1", i8255_device, read, write) /* DIP switches */ AM_RANGE(0x10, 0x10) AM_WRITE(outport0_w) AM_RANGE(0x11, 0x11) AM_WRITE(cm_coincount_w) - AM_RANGE(0x12, 0x12) AM_WRITE(goldstar_lamps_w) + AM_RANGE(0x12, 0x12) AM_WRITE(p1_lamps_w) AM_RANGE(0x13, 0x13) AM_WRITE(background_col_w) AM_RANGE(0x20, 0x20) AM_DEVREADWRITE("oki", okim6295_device, read, write) ADDRESS_MAP_END @@ -779,24 +804,11 @@ static ADDRESS_MAP_START( amcoe2_portmap, AS_IO, 8, cmaster_state ) AM_RANGE(0x08, 0x0b) AM_DEVREADWRITE("ppi8255_1", i8255_device, read, write) /* DIP switches */ AM_RANGE(0x10, 0x10) AM_WRITE(outport0_w) AM_RANGE(0x11, 0x11) AM_WRITE(cm_coincount_w) - AM_RANGE(0x12, 0x12) AM_WRITE(goldstar_lamps_w) + AM_RANGE(0x12, 0x12) AM_WRITE(p1_lamps_w) AM_RANGE(0x13, 0x13) AM_WRITE(background_col_w) ADDRESS_MAP_END -WRITE8_MEMBER(goldstar_state::lucky8_lamps_w) -{ - /* lamps */ - output_set_lamp_value(0, (data >> 1) & 1); /* D-UP Lamp */ - output_set_lamp_value(1, (data >> 2) & 1); /* TAKE Lamp */ - output_set_lamp_value(2, (data >> 3) & 1); /* BET Lamp */ - output_set_lamp_value(3, (data >> 4) & 1); /* INFO Lamp */ - output_set_lamp_value(4, (data >> 5) & 1); /* START Lamp */ - -// popmessage("lucky8_lamps_w %02x\n", data); - -} - static ADDRESS_MAP_START( lucky8_map, AS_PROGRAM, 8, goldstar_state ) AM_RANGE(0x0000, 0x7fff) AM_ROM AM_RANGE(0x8000, 0x87ff) AM_RAM AM_SHARE("nvram") @@ -814,7 +826,8 @@ static ADDRESS_MAP_START( lucky8_map, AS_PROGRAM, 8, goldstar_state ) AM_RANGE(0xb820, 0xb823) AM_DEVREADWRITE("ppi8255_2", i8255_device, read, write) /* Input/Output Ports */ AM_RANGE(0xb830, 0xb830) AM_DEVREADWRITE("aysnd", ay8910_device, data_r, data_w) AM_RANGE(0xb840, 0xb840) AM_DEVWRITE("aysnd", ay8910_device, address_w) /* no sound... only use both ports for DSWs */ - AM_RANGE(0xb850, 0xb850) AM_WRITE(lucky8_lamps_w) + AM_RANGE(0xb850, 0xb850) AM_WRITE(p1_lamps_w) + AM_RANGE(0xb860, 0xb860) AM_WRITE(p2_lamps_w) AM_RANGE(0xb870, 0xb870) AM_DEVWRITE("snsnd", sn76489_device, write) /* sound */ AM_RANGE(0xf800, 0xffff) AM_RAM ADDRESS_MAP_END @@ -881,7 +894,7 @@ static ADDRESS_MAP_START( kkotnoli_map, AS_PROGRAM, 8, goldstar_state ) AM_RANGE(0xb820, 0xb823) AM_DEVREADWRITE("ppi8255_2", i8255_device, read, write) /* Input Port */ AM_RANGE(0xb830, 0xb830) AM_WRITENOP /* no ay8910 */ AM_RANGE(0xb840, 0xb840) AM_WRITENOP /* no ay8910 */ - AM_RANGE(0xb850, 0xb850) AM_WRITE(lucky8_lamps_w) + AM_RANGE(0xb850, 0xb850) AM_WRITE(p1_lamps_w) AM_RANGE(0xb870, 0xb870) AM_DEVWRITE("snsnd", sn76489_device, write) /* sound */ AM_RANGE(0xf800, 0xffff) AM_RAM ADDRESS_MAP_END @@ -941,7 +954,7 @@ static ADDRESS_MAP_START( wcat3_map, AS_PROGRAM, 8, goldstar_state ) AM_RANGE(0xb820, 0xb823) AM_DEVREADWRITE("ppi8255_2", i8255_device, read, write) /* Input/Output Ports */ AM_RANGE(0xb830, 0xb830) AM_DEVREADWRITE("aysnd", ay8910_device, data_r, data_w) AM_RANGE(0xb840, 0xb840) AM_DEVWRITE("aysnd", ay8910_device, address_w) /* no sound... only use both ports for DSWs */ - AM_RANGE(0xb850, 0xb850) AM_WRITE(lucky8_lamps_w) + AM_RANGE(0xb850, 0xb850) AM_WRITE(p1_lamps_w) AM_RANGE(0xb870, 0xb870) AM_DEVWRITE("snsnd", sn76489_device, write) /* sound */ // AM_RANGE(0xc000, 0xc003) AM_DEVREADWRITE("ppi8255_3", i8255_device, read, write) /* Other PPI initialized? */ AM_RANGE(0xd000, 0xefff) AM_ROM @@ -949,14 +962,6 @@ static ADDRESS_MAP_START( wcat3_map, AS_PROGRAM, 8, goldstar_state ) ADDRESS_MAP_END -/* -READ8_MEMBER(unkch_state::unk_r) -{ - return 0xff; -} -*/ - - /* newer / more capable hw */ static ADDRESS_MAP_START( unkch_map, AS_PROGRAM, 8, unkch_state ) AM_RANGE(0x0000, 0x9fff) AM_ROM @@ -983,9 +988,55 @@ static ADDRESS_MAP_START( unkch_map, AS_PROGRAM, 8, unkch_state ) AM_RANGE(0xfe00, 0xffff) AM_RAM ADDRESS_MAP_END + +WRITE8_MEMBER(unkch_state::coincount_w) +{ +/* + 7654 3210 + ---- --x- Payout counter (rate set with DIP switches) + ---- -x-- Credit counter (1 pulse/10 credits) + ---- x--- Key In counter + --xx ---- used for something during ticket dispensing + x--- ---- Ticket Dispenser Motor + -x-- ---x unused/unknown + +*/ + + m_ticket_dispenser->write(space, offset, data & 0x80); + + coin_counter_w(machine(), 0, data & 0x04); /* Credit counter */ + coin_counter_w(machine(), 1, data & 0x08); /* Key In counter */ + coin_counter_w(machine(), 2, data & 0x02); /* payout counter */ + + //popmessage("coin counters: %02x", data); +} + WRITE8_MEMBER(unkch_state::unkcm_0x02_w) { +/* bits + 7654 3210 + ---- ---x button lamp: Bet-A / Stop 2 + ---- --x- button lamp: Start / Stop All + ---- -x-- button lamp: Info / Small / Stop 3 + ---- x--- button lamp: Big + ---x ---- button lamp: Bet-B / D-Up + --x- ---- button lamp: Take / Stop 1 + -x-- ---- unknown/unused + x--- ---- vblank IRQ enable + + these sets use crude PWM to dim lamp 2 which requires filament physics simulation to work properly +*/ + //popmessage("unkcm_0x02_w %02x", data); + + m_vblank_irq_enable = data & 0x80; + + output_set_lamp_value(0, (data >> 0) & 1); /* Bet-A / Stop 2 */ + output_set_lamp_value(1, (data >> 1) & 1); /* Start / Stop All */ + output_set_lamp_value(2, (data >> 2) & 1); /* Info / Small / Stop 3 */ + output_set_lamp_value(3, (data >> 3) & 1); /* Big */ + output_set_lamp_value(4, (data >> 4) & 1); /* Bet-B / D-Up */ + output_set_lamp_value(5, (data >> 5) & 1); /* Take / Stop 1 */ } WRITE8_MEMBER(unkch_state::unkcm_0x03_w) @@ -998,31 +1049,21 @@ WRITE8_MEMBER(unkch_state::unkcm_0x03_w) } -WRITE8_MEMBER(unkch_state::unkcm_0x11_w) -{ - //popmessage("unkcm_0x11_w %02x", data); -} - -WRITE8_MEMBER(unkch_state::unkcm_0x12_w) -{ -// popmessage("unkcm_0x12_w %02x", data); -} - - static ADDRESS_MAP_START( unkch_portmap, AS_IO, 8, unkch_state ) ADDRESS_MAP_GLOBAL_MASK(0xff) + AM_RANGE(0x01, 0x01) AM_WRITE(coincount_w) AM_RANGE(0x02, 0x02) AM_WRITE(unkcm_0x02_w) AM_RANGE(0x03, 0x03) AM_WRITE(unkcm_0x03_w) - AM_RANGE(0x11, 0x11) AM_WRITE(unkcm_0x11_w) - AM_RANGE(0x12, 0x12) AM_WRITE(unkcm_0x12_w) AM_RANGE(0x08, 0x08) AM_READ_PORT("IN0") AM_RANGE(0x09, 0x09) AM_READ_PORT("IN1") AM_RANGE(0x0a, 0x0a) AM_READ_PORT("DSW4") AM_RANGE(0x0b, 0x0b) AM_READ_PORT("DSW3") - AM_RANGE(0x10, 0x10) AM_READ_PORT("DSW2") - /* Where is DSW1? It's possible the games are buggy and use the value read from DSW3 for DSW1 as well. */ + + AM_RANGE(0x10, 0x10) AM_DEVREAD("aysnd", ay8910_device, data_r) + AM_RANGE(0x11, 0x11) AM_DEVWRITE("aysnd", ay8910_device, data_w) + AM_RANGE(0x12, 0x12) AM_DEVWRITE("aysnd", ay8910_device, address_w) ADDRESS_MAP_END @@ -2028,8 +2069,8 @@ static INPUT_PORTS_START( chryangl ) PORT_DIPSETTING( 0x10, "C-Type" ) PORT_DIPSETTING( 0x00, "D-Type" ) PORT_DIPNAME( 0x20, 0x20, "Min. Bet For Bonus Play" ) PORT_DIPLOCATION("DSW4:6") - PORT_DIPSETTING( 0x20, "16 Bet" ) - PORT_DIPSETTING( 0x00, "8 Bet" ) + PORT_DIPSETTING( 0x00, "8" ) + PORT_DIPSETTING( 0x20, "16" ) PORT_DIPNAME( 0x40, 0x40, "Reel Speed" ) PORT_DIPLOCATION("DSW4:7") PORT_DIPSETTING( 0x40, DEF_STR( Low ) ) PORT_DIPSETTING( 0x00, DEF_STR( High ) ) @@ -2074,11 +2115,11 @@ static INPUT_PORTS_START( tonypok ) PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_POKER_HOLD2 ) PORT_NAME("Hold 2 / Big / Red") - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_POKER_HOLD3 ) PORT_NAME("Hold 3 / W-Up") + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_POKER_HOLD3 ) PORT_NAME("Hold 3 / D-Up") PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_POKER_HOLD4 ) PORT_NAME("Hold 4 / Take") PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_POKER_HOLD5 ) PORT_NAME("Hold 5 / Bet") PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_POKER_HOLD1 ) PORT_NAME("Hold 1 / Small / Black") - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 ) PORT_NAME("Deal") + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 ) PORT_NAME("Start / Deal / Draw") PORT_INCLUDE( cmv4_coins ) @@ -4746,15 +4787,11 @@ static INPUT_PORTS_START( unkch_controls ) PORT_START("IN1") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) - PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) + PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) /* Trips "call attendant" state if activated while credited - something to do with hopper out? */ 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_BIT( 0x04, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("tickets", ticket_dispenser_device, line_r) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_GAMBLE_KEYOUT ) PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) @@ -4766,47 +4803,73 @@ INPUT_PORTS_END static INPUT_PORTS_START( unkch ) PORT_INCLUDE( unkch_controls ) - /* Is there a DSW1? - Like many of the other games on this hardware, there is an + /* Like many of the other games on this hardware, there is an input & dip test screen that you can stumble in to. Also a picture viewer option. Can't figure out exactly how to make it repeatable... */ - PORT_START("DSW2") - PORT_DIPNAME( 0x03, 0x03, "Game Level" ) PORT_DIPLOCATION("DSW2:1,2") /* OK */ + PORT_START("DSW1") + PORT_DIPNAME( 0x03, 0x03, "Game Level" ) PORT_DIPLOCATION("DSW1:1,2") /* OK */ PORT_DIPSETTING( 0x03, "Easy" ) PORT_DIPSETTING( 0x02, "Mid 1" ) PORT_DIPSETTING( 0x01, "Mid 2" ) PORT_DIPSETTING( 0x00, "Hard" ) - PORT_DIPNAME( 0x04, 0x04, "Punti" ) PORT_DIPLOCATION("DSW2:3") /* OK */ + PORT_DIPNAME( 0x04, 0x04, "Punti" ) PORT_DIPLOCATION("DSW1:3") /* OK */ PORT_DIPSETTING( 0x04, "Ticket" ) PORT_DIPSETTING( 0x00, "Gettoni" ) - PORT_DIPNAME( 0x08, 0x08, "Main/Bonus Game Rate" ) PORT_DIPLOCATION("DSW2:4") /* OK */ - PORT_DIPSETTING( 0x08, "83% / 88%" ) - PORT_DIPSETTING( 0x00, "71% / 76%" ) PORT_CONDITION("DSW2",0x03,EQUALS,0x03) /* Easy */ - PORT_DIPSETTING( 0x00, "68% / 73%" ) PORT_CONDITION("DSW2",0x03,EQUALS,0x02) /* Mid 1 */ - PORT_DIPSETTING( 0x00, "65% / 70%" ) PORT_CONDITION("DSW2",0x03,EQUALS,0x01) /* Mid 2 */ - PORT_DIPSETTING( 0x00, "62% / 67%" ) PORT_CONDITION("DSW2",0x03,EQUALS,0x00) /* Hard */ - PORT_DIPNAME( 0x10, 0x10, "Reel Speed / Max Bet" ) PORT_DIPLOCATION("DSW2:5") /* OK */ - PORT_DIPSETTING( 0x10, "Low / 64" ) - PORT_DIPSETTING( 0x00, "High / 40 (20)" ) /* shows 20 in settings screen but limits to 40 in gameplay */ - PORT_DIPNAME( 0x60, 0x60, "Super Jackpot" ) PORT_DIPLOCATION("DSW2:6,7") /* OK */ + PORT_DIPNAME( 0x08, 0x08, "Ticket Dispenser" ) PORT_DIPLOCATION("DSW1:4") /* OK */ + PORT_DIPSETTING( 0x00, DEF_STR( No ) ) + PORT_DIPSETTING( 0x08, DEF_STR( Yes ) ) + PORT_DIPNAME( 0x10, 0x10, "Reel Speed" ) PORT_DIPLOCATION("DSW1:5") /* OK */ + PORT_DIPSETTING( 0x10, DEF_STR( Low ) ) + PORT_DIPSETTING( 0x00, DEF_STR( High ) ) + PORT_DIPNAME( 0x60, 0x60, "Super Jackpot" ) PORT_DIPLOCATION("DSW1:6,7") /* OK */ PORT_DIPSETTING( 0x60, DEF_STR( No ) ) PORT_DIPSETTING( 0x20, "5%" ) PORT_DIPSETTING( 0x00, "10%" ) PORT_DIPSETTING( 0x40, "20%" ) - PORT_DIPNAME( 0x80, 0x80, "Bet Step On 8" ) PORT_DIPLOCATION("DSW2:8") /* OK */ + PORT_DIPNAME( 0x80, 0x80, "Bet Step On 8" ) PORT_DIPLOCATION("DSW1:8") /* OK */ PORT_DIPSETTING( 0x80, DEF_STR( No ) ) PORT_DIPSETTING( 0x00, DEF_STR( Yes ) ) + PORT_START("DSW2") + PORT_DIPNAME( 0x0f, 0x0f, "Main/Bonus Game Rate" ) PORT_DIPLOCATION("DSW2:1,2,3,4") /* OK - all other values are 83% / 88% */ + PORT_DIPSETTING( 0x00, "50% / 55%" ) + PORT_DIPSETTING( 0x01, "53% / 58%" ) + PORT_DIPSETTING( 0x02, "56% / 61%" ) + PORT_DIPSETTING( 0x03, "59% / 64%" ) + PORT_DIPSETTING( 0x04, "62% / 67%" ) + PORT_DIPSETTING( 0x05, "65% / 70%" ) + PORT_DIPSETTING( 0x06, "68% / 73%" ) + PORT_DIPSETTING( 0x07, "71% / 76%" ) + PORT_DIPSETTING( 0x08, "74% / 79%" ) + PORT_DIPSETTING( 0x09, "77% / 82%" ) + PORT_DIPSETTING( 0x0a, "80% / 85%" ) + PORT_DIPSETTING( 0x0f, "83% / 88%" ) + PORT_DIPNAME( 0x30, 0x30, "Max Bet" ) PORT_DIPLOCATION("DSW2:5,6") /* OK */ + PORT_DIPSETTING( 0x00, "10 (5)" ) PORT_CONDITION("DSW3",0x80,EQUALS,0x80) /* shows 5 in settings screen but limits at 10 in gameplay */ + PORT_DIPSETTING( 0x10, "20 (10)" ) PORT_CONDITION("DSW3",0x80,EQUALS,0x80) /* shows 10 in settings screen but limits at 20 in gameplay */ + PORT_DIPSETTING( 0x20, "40 (20)" ) PORT_CONDITION("DSW3",0x80,EQUALS,0x80) /* shows 20 in settings screen but limits at 40 in gameplay */ + PORT_DIPSETTING( 0x00, "5" ) PORT_CONDITION("DSW3",0x80,EQUALS,0x00) + PORT_DIPSETTING( 0x10, "10" ) PORT_CONDITION("DSW3",0x80,EQUALS,0x00) + PORT_DIPSETTING( 0x20, "20" ) PORT_CONDITION("DSW3",0x80,EQUALS,0x00) + PORT_DIPSETTING( 0x30, "64" ) /* always individual irrespective of DSW3-8 */ + PORT_DIPNAME( 0x40, 0x40, "Min. Bet For Bonus Play" ) PORT_DIPLOCATION("DSW2:7") /* OK */ + PORT_DIPSETTING( 0x00, "8" ) + PORT_DIPSETTING( 0x40, "16" ) + PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW2:8") + PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_START("DSW3") - PORT_DIPNAME( 0x03, 0x03, "Coin A Rate" ) PORT_DIPLOCATION("DSW3:1,2") /* OK */ + PORT_DIPNAME( 0x03, 0x00, "Coin A Rate" ) PORT_DIPLOCATION("DSW3:1,2") /* OK */ PORT_DIPSETTING( 0x00, DEF_STR( 1C_5C ) ) PORT_DIPSETTING( 0x01, "1 Coin/10 Credits" ) PORT_DIPSETTING( 0x02, "1 Coin/20 Credits" ) PORT_DIPSETTING( 0x03, "1 Coin/50 Credits" ) - PORT_DIPNAME( 0x04, 0x04, "Gettoni/Ticket" ) PORT_DIPLOCATION("DSW3:3") /* OK */ - PORT_DIPSETTING( 0x04, "20/200" ) + PORT_DIPNAME( 0x04, 0x00, "Gettoni/Ticket" ) PORT_DIPLOCATION("DSW3:3") /* OK */ PORT_DIPSETTING( 0x00, "10/100" ) - PORT_DIPNAME( 0x18, 0x18, "Key In Rate" ) PORT_DIPLOCATION("DSW3:4,5") /* OK */ + PORT_DIPSETTING( 0x04, "20/200" ) + PORT_DIPNAME( 0x18, 0x00, "Key In Rate" ) PORT_DIPLOCATION("DSW3:4,5") /* OK */ PORT_DIPSETTING( 0x00, "1 Coin/25 Credits" ) PORT_CONDITION("DSW3",0x03,EQUALS,0x00) /* 5*5 */ PORT_DIPSETTING( 0x08, "1 Coin/50 Credits" ) PORT_CONDITION("DSW3",0x03,EQUALS,0x00) /* 5*10 */ PORT_DIPSETTING( 0x10, "1 Coin/100 Credits" ) PORT_CONDITION("DSW3",0x03,EQUALS,0x00) /* 5*20 */ @@ -4823,126 +4886,149 @@ static INPUT_PORTS_START( unkch ) PORT_DIPSETTING( 0x08, "1 Coin/500 Credits" ) PORT_CONDITION("DSW3",0x03,EQUALS,0x03) /* 50*10 */ PORT_DIPSETTING( 0x10, "1 Coin/1,000 Credits" ) PORT_CONDITION("DSW3",0x03,EQUALS,0x03) /* 50*20 */ PORT_DIPSETTING( 0x18, "1 Coin/2,500 Credits" ) PORT_CONDITION("DSW3",0x03,EQUALS,0x03) /* 50*50 */ - PORT_DIPNAME( 0x20, 0x20, "Coin B Enable" ) PORT_DIPLOCATION("DSW3:6") /* OK */ + PORT_DIPNAME( 0x20, 0x00, "Coin B Enable" ) PORT_DIPLOCATION("DSW3:6") /* OK */ PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x40, 0x40, "Coin B Rate" ) PORT_DIPLOCATION("DSW3:7") /* OK */ + PORT_DIPNAME( 0x40, 0x00, "Coin B Rate" ) PORT_DIPLOCATION("DSW3:7") /* OK */ PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) PORT_DIPSETTING( 0x40, DEF_STR( 1C_2C ) ) - PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW3:8") - PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x80, 0x00, "Max Bet Type" ) PORT_DIPLOCATION("DSW3:8") /* OK */ + PORT_DIPSETTING( 0x80, "Total" ) /* Max Bet applies to total of BET-A and BET-B unless set to 64 */ + PORT_DIPSETTING( 0x00, "Individual" ) /* Max Bet applies individually to each of BET-A and BET-B */ PORT_START("DSW4") - PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW4:1") + PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW4:1") PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW4:2") + PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW4:2") PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW4:3") + PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW4:3") PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x08, 0x08, "Super Jackpot Half" ) PORT_DIPLOCATION("DSW4:4") /* OK */ + PORT_DIPNAME( 0x08, 0x08, "Super Jackpot Half" ) PORT_DIPLOCATION("DSW4:4") /* OK */ PORT_DIPSETTING( 0x08, DEF_STR( No ) ) PORT_DIPSETTING( 0x00, DEF_STR( Yes ) ) - PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW4:5") + PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW4:5") PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x60, 0x60, "Red Game Credit" ) PORT_DIPLOCATION("DSW4:6,7") /* OK */ + PORT_DIPNAME( 0x60, 0x60, "Red Game Credit" ) PORT_DIPLOCATION("DSW4:6,7") /* OK */ PORT_DIPSETTING( 0x40, "0" ) PORT_DIPSETTING( 0x20, "1" ) PORT_DIPSETTING( 0x00, "10" ) PORT_DIPSETTING( 0x60, "20" ) - PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW4:8") - PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x80, 0x80, "Cherry/Bell Bonus" ) PORT_DIPLOCATION("DSW4:8") /* OK */ + PORT_DIPSETTING( 0x80, "x6 / x3" ) + PORT_DIPSETTING( 0x00, "x9 / x5" ) INPUT_PORTS_END static INPUT_PORTS_START( unkch3 ) PORT_INCLUDE( unkch_controls ) - /* Is there a DSW1? - Like many of the other games on this hardware, there is an - input & dip test screen that you can stumble in to. Also a picture viewer option. Can't figure - out exactly how to make it repeatable... */ - - PORT_START("DSW2") - PORT_DIPNAME( 0x03, 0x03, "Game Level" ) PORT_DIPLOCATION("DSW2:1,2") /* OK */ + PORT_START("DSW1") + PORT_DIPNAME( 0x03, 0x03, "Game Level" ) PORT_DIPLOCATION("DSW1:1,2") /* OK */ PORT_DIPSETTING( 0x03, "Easy" ) PORT_DIPSETTING( 0x02, "Mid 1" ) PORT_DIPSETTING( 0x01, "Mid 2" ) PORT_DIPSETTING( 0x00, "Hard" ) - PORT_DIPNAME( 0x04, 0x04, "Punti Unit" ) PORT_DIPLOCATION("DSW2:3") /* OK */ + PORT_DIPNAME( 0x04, 0x04, "Punti Unit" ) PORT_DIPLOCATION("DSW1:3") /* OK */ PORT_DIPSETTING( 0x00, "500" ) PORT_DIPSETTING( 0x04, "1000" ) - PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW2:4") + PORT_DIPNAME( 0x08, 0x08, "Ticket Dispenser" ) PORT_DIPLOCATION("DSW1:4") /* OK */ + PORT_DIPSETTING( 0x00, DEF_STR( No ) ) + PORT_DIPSETTING( 0x08, DEF_STR( Yes ) ) + PORT_DIPNAME( 0x10, 0x10, "Reel Speed" ) PORT_DIPLOCATION("DSW1:5") /* OK */ + PORT_DIPSETTING( 0x10, DEF_STR( Low ) ) + PORT_DIPSETTING( 0x00, DEF_STR( High ) ) + PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW1:6") + PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW1:7") + PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW1:8") + PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + + PORT_START("DSW2") + PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW2:1") + PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW2:2") + PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW2:3") + PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW2:4") PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x10, 0x10, "Reel Speed" ) PORT_DIPLOCATION("DSW2:5") /* OK */ - PORT_DIPSETTING( 0x10, DEF_STR( Low ) ) /* manual start at max bet */ - PORT_DIPSETTING( 0x00, DEF_STR( High ) ) /* auto start at max bet */ - PORT_DIPNAME( 0x20, 0x20, "Bet Maximum" ) PORT_DIPLOCATION("DSW2:6") /* OK */ - PORT_DIPSETTING( 0x00, "10" ) PORT_CONDITION("DSW2",0x10,EQUALS,0x10) - PORT_DIPSETTING( 0x20, "64" ) PORT_CONDITION("DSW2",0x10,EQUALS,0x10) - PORT_DIPSETTING( 0x00, "10 (5)" ) PORT_CONDITION("DSW2",0x10,EQUALS,0x00) /* shows 5 in settings screen but limits at 10 in gameplay */ - PORT_DIPSETTING( 0x20, "40 (20)" ) PORT_CONDITION("DSW2",0x10,EQUALS,0x00) /* shows 20 in settings screen but limits at 40 in gameplay */ - PORT_DIPNAME( 0x40, 0x40, "Bet Minimum" ) PORT_DIPLOCATION("DSW2:7") /* shows in settings screen but has no effect */ + PORT_DIPNAME( 0x30, 0x30, "Max Bet" ) PORT_DIPLOCATION("DSW2:5,6") /* OK */ + PORT_DIPSETTING( 0x00, "10 (5)" ) PORT_CONDITION("DSW3",0x80,EQUALS,0x80) /* shows 5 in settings screen but limits at 10 in gameplay */ + PORT_DIPSETTING( 0x10, "20 (10)" ) PORT_CONDITION("DSW3",0x80,EQUALS,0x80) /* shows 10 in settings screen but limits at 20 in gameplay */ + PORT_DIPSETTING( 0x20, "40 (20)" ) PORT_CONDITION("DSW3",0x80,EQUALS,0x80) /* shows 20 in settings screen but limits at 40 in gameplay */ + PORT_DIPSETTING( 0x00, "5" ) PORT_CONDITION("DSW3",0x80,EQUALS,0x00) + PORT_DIPSETTING( 0x10, "10" ) PORT_CONDITION("DSW3",0x80,EQUALS,0x00) + PORT_DIPSETTING( 0x20, "20" ) PORT_CONDITION("DSW3",0x80,EQUALS,0x00) + PORT_DIPSETTING( 0x30, "64" ) /* always individual irrespective of DSW3-8 */ + PORT_DIPNAME( 0x40, 0x40, "Min. Bet For Bonus Play" ) PORT_DIPLOCATION("DSW2:7") /* OK - called 'Bet Minimum' in settings screen */ PORT_DIPSETTING( 0x00, "8" ) PORT_DIPSETTING( 0x40, "16" ) - PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown) ) PORT_DIPLOCATION("DSW2:8") + PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown) ) PORT_DIPLOCATION("DSW2:8") PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_START("DSW3") - PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW3:1") + PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW3:1") PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) - PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW3:2") + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW3:2") PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW3:3") + PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW3:3") PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW3:4") + PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW3:4") PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW3:5") + PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW3:5") PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x20, 0x20, "Coin B Enable" ) PORT_DIPLOCATION("DSW3:6") /* OK */ + PORT_DIPNAME( 0x20, 0x00, "Coin B Enable" ) PORT_DIPLOCATION("DSW3:6") /* OK */ PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x40, 0x40, "Coin B Rate" ) PORT_DIPLOCATION("DSW3:7") /* OK */ + PORT_DIPNAME( 0x40, 0x00, "Coin B Rate" ) PORT_DIPLOCATION("DSW3:7") /* OK */ PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) PORT_DIPSETTING( 0x40, DEF_STR( 1C_2C ) ) - PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW3:8") - PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x80, 0x00, "Max Bet Type" ) PORT_DIPLOCATION("DSW3:8") /* OK */ + PORT_DIPSETTING( 0x80, "Total" ) /* Max Bet applies to total of BET-A and BET-B unless set to 64 */ + PORT_DIPSETTING( 0x00, "Individual" ) /* Max Bet applies individually to each of BET-A and BET-B */ PORT_START("DSW4") - PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW4:1") + PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW4:1") PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW4:2") + PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW4:2") PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW4:3") + PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW4:3") PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW4:4") + PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW4:4") PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW4:5") - PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW4:6") + PORT_DIPNAME( 0x10, 0x10, "Test Mode" ) PORT_DIPLOCATION("DSW4:5") /* OK */ + PORT_DIPSETTING( 0x10, "Disable" ) + PORT_DIPSETTING( 0x00, "Enable" ) /* hold 'Settings' on reset to access */ + PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW4:6") PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW4:7") - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW4:7") PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) - PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW4:8") - PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x80, 0x80, "Cherry/Bell Bonus" ) PORT_DIPLOCATION("DSW4:8") /* OK */ + PORT_DIPSETTING( 0x80, "x6 / x3" ) + PORT_DIPSETTING( 0x00, "x9 / x5" ) INPUT_PORTS_END static INPUT_PORTS_START( unkch4 ) @@ -4951,110 +5037,124 @@ static INPUT_PORTS_START( unkch4 ) PORT_MODIFY("IN0") PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN3 ) PORT_IMPULSE(2) PORT_NAME("Coin C") - /* Is there a DSW1? - Like many of the other games on this hardware, there is an + /* Like many of the other games on this hardware, there is an input & dip test screen that you can stumble in to. Also a picture viewer option. Can't figure out exactly how to make it repeatable... */ - PORT_START("DSW2") - PORT_DIPNAME( 0x03, 0x03, "Game Level" ) PORT_DIPLOCATION("DSW2:1,2") /* OK */ + PORT_START("DSW1") + PORT_DIPNAME( 0x03, 0x03, "Game Level" ) PORT_DIPLOCATION("DSW1:1,2") /* OK */ PORT_DIPSETTING( 0x03, "Easy" ) PORT_DIPSETTING( 0x02, "Mid 1" ) PORT_DIPSETTING( 0x01, "Mid 2" ) PORT_DIPSETTING( 0x00, "Hard" ) - PORT_DIPNAME( 0x04, 0x04, "Punti" ) PORT_DIPLOCATION("DSW2:3") /* OK */ - PORT_DIPSETTING( 0x04, "Ticket" ) - PORT_DIPSETTING( 0x00, "Gettoni" ) - PORT_DIPNAME( 0x08, 0x08, "Main/Bonus Game Rate" ) PORT_DIPLOCATION("DSW2:4") /* OK */ - PORT_DIPSETTING( 0x08, "83% / 88%" ) - PORT_DIPSETTING( 0x00, "71% / 76%" ) PORT_CONDITION("DSW2",0x03,EQUALS,0x03) /* Easy */ - PORT_DIPSETTING( 0x00, "68% / 73%" ) PORT_CONDITION("DSW2",0x03,EQUALS,0x02) /* Mid 1 */ - PORT_DIPSETTING( 0x00, "65% / 70%" ) PORT_CONDITION("DSW2",0x03,EQUALS,0x01) /* Mid 2 */ - PORT_DIPSETTING( 0x00, "62% / 67%" ) PORT_CONDITION("DSW2",0x03,EQUALS,0x00) /* Hard */ - PORT_DIPNAME( 0x10, 0x10, "Reel Speed / Max Bet" ) PORT_DIPLOCATION("DSW2:5") /* OK */ - PORT_DIPSETTING( 0x10, "Low / 64" ) - PORT_DIPSETTING( 0x00, "High / 32" ) - PORT_DIPNAME( 0x60, 0x60, "Super Jackpot" ) PORT_DIPLOCATION("DSW2:6,7") /* OK */ + PORT_DIPNAME( 0x04, 0x04, "Punti" ) PORT_DIPLOCATION("DSW1:3") /* OK */ + PORT_DIPSETTING( 0x04, "Ticket" ) /* payout rate 100 */ + PORT_DIPSETTING( 0x00, "Gettoni" ) /* payout rate 10 */ + PORT_DIPNAME( 0x08, 0x08, "Ticket Dispenser" ) PORT_DIPLOCATION("DSW1:4") /* OK */ + PORT_DIPSETTING( 0x00, DEF_STR( No ) ) + PORT_DIPSETTING( 0x08, DEF_STR( Yes ) ) + PORT_DIPNAME( 0x10, 0x10, "Reel Speed" ) PORT_DIPLOCATION("DSW1:5") /* OK */ + PORT_DIPSETTING( 0x10, DEF_STR( Low ) ) + PORT_DIPSETTING( 0x00, DEF_STR( High ) ) + PORT_DIPNAME( 0x60, 0x60, "Super Jackpot" ) PORT_DIPLOCATION("DSW1:6,7") /* shows in test mode but always seems to be enabled in gameplay */ PORT_DIPSETTING( 0x60, DEF_STR( No ) ) PORT_DIPSETTING( 0x20, "5%" ) PORT_DIPSETTING( 0x00, "10%" ) PORT_DIPSETTING( 0x40, "20%" ) - PORT_DIPNAME( 0x80, 0x80, "Bet Step On 8" ) PORT_DIPLOCATION("DSW2:8") /* OK */ + PORT_DIPNAME( 0x80, 0x80, "Bet Step On 8" ) PORT_DIPLOCATION("DSW1:8") /* OK */ PORT_DIPSETTING( 0x80, DEF_STR( No ) ) PORT_DIPSETTING( 0x00, DEF_STR( Yes ) ) - PORT_START("DSW3") - PORT_DIPNAME( 0x03, 0x03, "Coin A Rate" ) PORT_DIPLOCATION("DSW3:1,2") /* OK */ - PORT_DIPSETTING( 0x00, DEF_STR( 1C_8C ) ) - PORT_DIPSETTING( 0x01, "1 Coin/10 Credits" ) - PORT_DIPSETTING( 0x02, "1 Coin/20 Credits" ) - PORT_DIPSETTING( 0x03, "1 Coin/50 Credits" ) - PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW3:3") - PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) + PORT_START("DSW2") + PORT_DIPNAME( 0x0f, 0x0f, "Main/Bonus Game Rate" ) PORT_DIPLOCATION("DSW2:1,2,3,4") /* OK - all other values are 83% / 88% */ + PORT_DIPSETTING( 0x00, "50% / 55%" ) + PORT_DIPSETTING( 0x01, "53% / 58%" ) + PORT_DIPSETTING( 0x02, "56% / 61%" ) + PORT_DIPSETTING( 0x03, "59% / 64%" ) + PORT_DIPSETTING( 0x04, "62% / 67%" ) + PORT_DIPSETTING( 0x05, "65% / 70%" ) + PORT_DIPSETTING( 0x06, "68% / 73%" ) + PORT_DIPSETTING( 0x07, "71% / 76%" ) + PORT_DIPSETTING( 0x08, "74% / 79%" ) + PORT_DIPSETTING( 0x09, "77% / 82%" ) + PORT_DIPSETTING( 0x0a, "80% / 85%" ) + PORT_DIPSETTING( 0x0f, "83% / 88%" ) + PORT_DIPNAME( 0x30, 0x30, "Max Bet" ) PORT_DIPLOCATION("DSW2:5,6") /* OK */ + PORT_DIPSETTING( 0x00, "8" ) + PORT_DIPSETTING( 0x10, "16" ) + PORT_DIPSETTING( 0x20, "32" ) + PORT_DIPSETTING( 0x30, "64" ) + PORT_DIPNAME( 0x40, 0x40, "Min. Bet For Bonus Play" ) PORT_DIPLOCATION("DSW2:7") /* OK */ + PORT_DIPSETTING( 0x00, "8" ) + PORT_DIPSETTING( 0x40, "16" ) + PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW2:8") + PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x18, 0x18, "Key In Rate" ) PORT_DIPLOCATION("DSW3:4,5") /* OK */ - PORT_DIPSETTING( 0x00, "1 Coin/40 Credits" ) PORT_CONDITION("DSW3",0x03,EQUALS,0x00) /* 8*5 */ - PORT_DIPSETTING( 0x08, "1 Coin/80 Credits" ) PORT_CONDITION("DSW3",0x03,EQUALS,0x00) /* 8*10 */ - PORT_DIPSETTING( 0x10, "1 Coin/160 Credits" ) PORT_CONDITION("DSW3",0x03,EQUALS,0x00) /* 8*20 */ - PORT_DIPSETTING( 0x18, "1 Coin/400 Credits" ) PORT_CONDITION("DSW3",0x03,EQUALS,0x00) /* 8*50 */ - PORT_DIPSETTING( 0x00, "1 Coin/50 Credits" ) PORT_CONDITION("DSW3",0x03,EQUALS,0x01) /* 10*5 */ - PORT_DIPSETTING( 0x08, "1 Coin/100 Credits" ) PORT_CONDITION("DSW3",0x03,EQUALS,0x01) /* 10*10 */ - PORT_DIPSETTING( 0x10, "1 Coin/200 Credits" ) PORT_CONDITION("DSW3",0x03,EQUALS,0x01) /* 10*20 */ - PORT_DIPSETTING( 0x18, "1 Coin/500 Credits" ) PORT_CONDITION("DSW3",0x03,EQUALS,0x01) /* 10*50 */ - PORT_DIPSETTING( 0x00, "1 Coin/100 Credits" ) PORT_CONDITION("DSW3",0x03,EQUALS,0x02) /* 20*5 */ - PORT_DIPSETTING( 0x08, "1 Coin/200 Credits" ) PORT_CONDITION("DSW3",0x03,EQUALS,0x02) /* 20*10 */ - PORT_DIPSETTING( 0x10, "1 Coin/400 Credits" ) PORT_CONDITION("DSW3",0x03,EQUALS,0x02) /* 20*20 */ - PORT_DIPSETTING( 0x18, "1 Coin/1,000 Credits" ) PORT_CONDITION("DSW3",0x03,EQUALS,0x02) /* 20*50 */ - PORT_DIPSETTING( 0x00, "1 Coin/250 Credits" ) PORT_CONDITION("DSW3",0x03,EQUALS,0x03) /* 50*5 */ - PORT_DIPSETTING( 0x08, "1 Coin/500 Credits" ) PORT_CONDITION("DSW3",0x03,EQUALS,0x03) /* 50*10 */ - PORT_DIPSETTING( 0x10, "1 Coin/1,000 Credits" ) PORT_CONDITION("DSW3",0x03,EQUALS,0x03) /* 50*20 */ - PORT_DIPSETTING( 0x18, "1 Coin/2,500 Credits" ) PORT_CONDITION("DSW3",0x03,EQUALS,0x03) /* 50*50 */ - PORT_DIPNAME( 0x20, 0x20, "Coin C Rate" ) PORT_DIPLOCATION("DSW3:6") /* OK */ - PORT_DIPSETTING( 0x00, "1 Coin/40 Credits" ) PORT_CONDITION("DSW3",0x03,EQUALS,0x00) /* 8*5 */ - PORT_DIPSETTING( 0x20, "1 Coin/80 Credits" ) PORT_CONDITION("DSW3",0x03,EQUALS,0x00) /* 8*10 */ - PORT_DIPSETTING( 0x00, "1 Coin/50 Credits" ) PORT_CONDITION("DSW3",0x03,EQUALS,0x01) /* 10*5 */ - PORT_DIPSETTING( 0x20, "1 Coin/100 Credits" ) PORT_CONDITION("DSW3",0x03,EQUALS,0x01) /* 10*10 */ - PORT_DIPSETTING( 0x00, "1 Coin/100 Credits" ) PORT_CONDITION("DSW3",0x03,EQUALS,0x02) /* 20*5 */ - PORT_DIPSETTING( 0x20, "1 Coin/200 Credits" ) PORT_CONDITION("DSW3",0x03,EQUALS,0x02) /* 20*10 */ - PORT_DIPSETTING( 0x00, "1 Coin/250 Credits" ) PORT_CONDITION("DSW3",0x03,EQUALS,0x03) /* 50*5 */ - PORT_DIPSETTING( 0x20, "1 Coin/500 Credits" ) PORT_CONDITION("DSW3",0x03,EQUALS,0x03) /* 50*10 */ - PORT_DIPNAME( 0x40, 0x40, "Coin B Rate" ) PORT_DIPLOCATION("DSW3:7") /* OK */ - PORT_DIPSETTING( 0x00, "1 Coin/80 Credits" ) PORT_CONDITION("DSW3",0x03,EQUALS,0x00) /* 8*10 */ - PORT_DIPSETTING( 0x40, "1 Coin/160 Credits" ) PORT_CONDITION("DSW3",0x03,EQUALS,0x00) /* 8*20 */ - PORT_DIPSETTING( 0x00, "1 Coin/100 Credits" ) PORT_CONDITION("DSW3",0x03,EQUALS,0x01) /* 10*10 */ - PORT_DIPSETTING( 0x40, "1 Coin/200 Credits" ) PORT_CONDITION("DSW3",0x03,EQUALS,0x01) /* 10*20 */ - PORT_DIPSETTING( 0x00, "1 Coin/200 Credits" ) PORT_CONDITION("DSW3",0x03,EQUALS,0x02) /* 20*10 */ - PORT_DIPSETTING( 0x40, "1 Coin/400 Credits" ) PORT_CONDITION("DSW3",0x03,EQUALS,0x02) /* 20*20 */ - PORT_DIPSETTING( 0x00, "1 Coin/500 Credits" ) PORT_CONDITION("DSW3",0x03,EQUALS,0x03) /* 50*10 */ - PORT_DIPSETTING( 0x40, "1 Coin/1,000 Credits" ) PORT_CONDITION("DSW3",0x03,EQUALS,0x03) /* 50*20 */ - PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW3:8") + + PORT_START("DSW3") + PORT_DIPNAME( 0x07, 0x00, "Coin A Rate" ) PORT_DIPLOCATION("DSW3:1,2,3") /* OK */ + PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) + PORT_DIPSETTING( 0x01, DEF_STR( 1C_2C ) ) + PORT_DIPSETTING( 0x02, DEF_STR( 1C_4C ) ) + PORT_DIPSETTING( 0x03, DEF_STR( 1C_5C ) ) + PORT_DIPSETTING( 0x04, DEF_STR( 1C_8C ) ) + PORT_DIPSETTING( 0x05, "1 Coin/10 Credits" ) + PORT_DIPSETTING( 0x06, "1 Coin/20 Credits" ) + PORT_DIPSETTING( 0x07, "1 Coin/50 Credits" ) + PORT_DIPNAME( 0x18, 0x00, "Key In Rate" ) PORT_DIPLOCATION("DSW3:4,5") /* OK */ + PORT_DIPSETTING( 0x00, "5x Coin A" ) + PORT_DIPSETTING( 0x08, "10x Coin A" ) + PORT_DIPSETTING( 0x10, "20x Coin A" ) + PORT_DIPSETTING( 0x18, "50x Coin A" ) + PORT_DIPNAME( 0x20, 0x00, "Coin C Rate" ) PORT_DIPLOCATION("DSW3:6") /* OK */ + PORT_DIPSETTING( 0x00, DEF_STR( 1C_5C ) ) PORT_CONDITION("DSW3",0x07,EQUALS,0x00) /* 1*5 */ + PORT_DIPSETTING( 0x20, "1 Coin/10 Credits" ) PORT_CONDITION("DSW3",0x07,EQUALS,0x00) /* 1*10 */ + PORT_DIPSETTING( 0x00, "1 Coin/10 Credits" ) PORT_CONDITION("DSW3",0x07,EQUALS,0x01) /* 2*5 */ + PORT_DIPSETTING( 0x20, "1 Coin/20 Credits" ) PORT_CONDITION("DSW3",0x07,EQUALS,0x01) /* 2*10 */ + PORT_DIPSETTING( 0x00, "1 Coin/20 Credits" ) PORT_CONDITION("DSW3",0x07,EQUALS,0x02) /* 4*5 */ + PORT_DIPSETTING( 0x20, "1 Coin/40 Credits" ) PORT_CONDITION("DSW3",0x07,EQUALS,0x02) /* 4*10 */ + PORT_DIPSETTING( 0x00, "1 Coin/25 Credits" ) PORT_CONDITION("DSW3",0x07,EQUALS,0x03) /* 5*5 */ + PORT_DIPSETTING( 0x20, "1 Coin/50 Credits" ) PORT_CONDITION("DSW3",0x07,EQUALS,0x03) /* 5*10 */ + PORT_DIPSETTING( 0x00, "1 Coin/40 Credits" ) PORT_CONDITION("DSW3",0x07,EQUALS,0x04) /* 8*5 */ + PORT_DIPSETTING( 0x20, "1 Coin/80 Credits" ) PORT_CONDITION("DSW3",0x07,EQUALS,0x04) /* 8*10 */ + PORT_DIPSETTING( 0x00, "1 Coin/50 Credits" ) PORT_CONDITION("DSW3",0x07,EQUALS,0x05) /* 10*5 */ + PORT_DIPSETTING( 0x20, "1 Coin/100 Credits" ) PORT_CONDITION("DSW3",0x07,EQUALS,0x05) /* 10*10 */ + PORT_DIPSETTING( 0x00, "1 Coin/100 Credits" ) PORT_CONDITION("DSW3",0x07,EQUALS,0x06) /* 20*5 */ + PORT_DIPSETTING( 0x20, "1 Coin/200 Credits" ) PORT_CONDITION("DSW3",0x07,EQUALS,0x06) /* 20*10 */ + PORT_DIPSETTING( 0x00, "1 Coin/250 Credits" ) PORT_CONDITION("DSW3",0x07,EQUALS,0x07) /* 50*5 */ + PORT_DIPSETTING( 0x20, "1 Coin/500 Credits" ) PORT_CONDITION("DSW3",0x07,EQUALS,0x07) /* 50*10 */ + PORT_DIPNAME( 0x40, 0x00, "Coin B Rate" ) PORT_DIPLOCATION("DSW3:7") /* OK */ + PORT_DIPSETTING( 0x00, "1x Coin C" ) + PORT_DIPSETTING( 0x40, "2x Coin C" ) + PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW3:8") PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_START("DSW4") - PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW4:1") + PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW4:1") PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW4:2") + PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW4:2") PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW4:3") + PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW4:3") PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW4:4") + PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW4:4") PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW4:5") + PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW4:5") PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW4:6") + PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW4:6") PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW4:7") - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW4:7") PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) - PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW4:8") - PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x80, 0x80, "Cherry/Bell Bonus" ) PORT_DIPLOCATION("DSW4:8") /* OK */ + PORT_DIPSETTING( 0x80, "x6 / x3" ) + PORT_DIPSETTING( 0x00, "x9 / x5" ) INPUT_PORTS_END @@ -5638,11 +5738,11 @@ static INPUT_PORTS_START( star100 ) PORT_START("IN0") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SLOT_STOP_ALL ) PORT_NAME("Stop All / Big") - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SLOT_STOP1 ) PORT_NAME("Stop 1 / D-UP") - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SLOT_STOP3 ) PORT_NAME("Stop 3 / Take / Select Card") + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_GAMBLE_HIGH ) PORT_NAME("Big") + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SLOT_STOP_ALL ) PORT_NAME("Hold / D-UP") + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_GAMBLE_TAKE ) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_GAMBLE_BET ) PORT_NAME("Play (Bet)") - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SLOT_STOP2 ) PORT_NAME("Stop 2 / Small") + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_GAMBLE_LOW ) PORT_NAME("Small") PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 ) PORT_NAME("Start") // PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_1) PORT_NAME("IN0-1") @@ -5791,12 +5891,11 @@ static INPUT_PORTS_START( star100 ) PORT_DIPNAME( 0x01, 0x01, "Bonus (switch-2)" ) PORT_DIPLOCATION("SW4:5") PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x02, 0x02, "Max Bonus" ) PORT_DIPLOCATION("SW4:6") PORT_DIPSETTING( 0x00, "100000" ) PORT_DIPSETTING( 0x02, "200000" ) PORT_DIPNAME( 0x0c, 0x0c, "Minimum Bet" ) PORT_DIPLOCATION("SW4:7,8") - PORT_DIPSETTING( 0x0c, "0" ) + PORT_DIPSETTING( 0x0c, "1" ) PORT_DIPSETTING( 0x08, "8" ) PORT_DIPSETTING( 0x04, "16" ) PORT_DIPSETTING( 0x00, "32" ) @@ -5869,7 +5968,7 @@ static INPUT_PORTS_START( crazybon ) PORT_INCLUDE( cmv4_coins ) PORT_MODIFY("IN1") - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* Unused coin switch */ + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) /* Unused coin switch */ PORT_INCLUDE( cmv4_service ) @@ -5877,7 +5976,7 @@ static INPUT_PORTS_START( crazybon ) PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW1:1") PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW1:2") + PORT_DIPNAME( 0x02, 0x00, "Hopper Out Switch" ) PORT_DIPLOCATION("DSW1:2") /* not checked */ PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_DIPNAME( 0x04, 0x00, "Coin Out Rate" ) PORT_DIPLOCATION("DSW1:3") /* OK */ @@ -5908,13 +6007,12 @@ static INPUT_PORTS_START( crazybon ) PORT_DIPSETTING( 0x05, "80%" ) PORT_DIPSETTING( 0x06, "85%" ) PORT_DIPSETTING( 0x07, "90%" ) - PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW2:4") - PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW2:5") - PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x20, 0x00, "Mode" ) PORT_DIPLOCATION("DSW2:6") + PORT_DIPNAME( 0x18, 0x18, "Hopper Limit" ) PORT_DIPLOCATION("DSW2:4,5") /* not checked */ + PORT_DIPSETTING( 0x18, "300" ) + PORT_DIPSETTING( 0x08, "500" ) + PORT_DIPSETTING( 0x10, "1000" ) + PORT_DIPSETTING( 0x00, "Unlimited" ) + PORT_DIPNAME( 0x20, 0x00, "Mode" ) PORT_DIPLOCATION("DSW2:6") /* OK */ PORT_DIPSETTING( 0x00, "Game" ) PORT_DIPSETTING( 0x20, "Stealth" ) PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW2:7") @@ -5947,9 +6045,9 @@ static INPUT_PORTS_START( crazybon ) PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW3:7") PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW3:8") + PORT_DIPNAME( 0x08, 0x08, "Lock Into Stealth Mode" ) PORT_DIPLOCATION("DSW3:8") /* OK */ PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) /* prevents switching to game mode with start/bet buttons */ PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_START("DSW4") @@ -5971,10 +6069,10 @@ static INPUT_PORTS_START( crazybon ) PORT_DIPNAME( 0x20, 0x20, "Bonus Min Bet" ) PORT_DIPLOCATION("DSW4:6") /* OK */ PORT_DIPSETTING( 0x20, "16" ) PORT_DIPSETTING( 0x00, "32" ) - PORT_DIPNAME( 0x40, 0x40, "C.M. Reel Speed" ) PORT_DIPLOCATION("DSW4:7") /* OK */ + PORT_DIPNAME( 0x40, 0x40, "Reel Speed" ) PORT_DIPLOCATION("DSW4:7") /* OK */ PORT_DIPSETTING( 0x40, DEF_STR( Low ) ) PORT_DIPSETTING( 0x00, DEF_STR( High ) ) - PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW4:8") + PORT_DIPNAME( 0x80, 0x80, "Hopper Out By Coin A" ) PORT_DIPLOCATION("DSW4:8") /* not working */ PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) @@ -5987,18 +6085,17 @@ static INPUT_PORTS_START( crazybon ) PORT_DIPSETTING( 0x04, "5,000" ) PORT_DIPSETTING( 0x02, "10,000" ) PORT_DIPSETTING( 0x00, "20,000" ) - PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW5:4") - PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW5:5") - PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x18, 0x18, "Condition For 3 Fruit Bonus" ) PORT_DIPLOCATION("DSW5:4,5") /* OK */ + PORT_DIPSETTING( 0x18, "5-<-7" ) /* not sure about the "<" ??? */ + PORT_DIPSETTING( 0x10, "5-9-5" ) + PORT_DIPSETTING( 0x08, "5-6-3" ) + PORT_DIPSETTING( 0x00, "5-3-2" ) PORT_DIPNAME( 0x60, 0x60, "Game Min Bet" ) PORT_DIPLOCATION("DSW5:6,7") /* OK */ PORT_DIPSETTING( 0x60, "1" ) PORT_DIPSETTING( 0x40, "8" ) PORT_DIPSETTING( 0x20, "16" ) PORT_DIPSETTING( 0x00, "32" ) - PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW5:8") + PORT_DIPNAME( 0x80, 0x80, "Card Shuffle Animation" ) PORT_DIPLOCATION("DSW5:8") /* OK */ PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) INPUT_PORTS_END @@ -6007,11 +6104,11 @@ static INPUT_PORTS_START( cmpacman ) PORT_START("IN0") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SLOT_STOP2 ) PORT_CODE(KEYCODE_X) PORT_CODE(KEYCODE_UP) PORT_NAME("Stop 2 / Big / Up") - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SLOT_STOP1 ) PORT_CODE(KEYCODE_Z) PORT_CODE(KEYCODE_LEFT) PORT_NAME("Stop 1 / D-UP / Left") - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SLOT_STOP_ALL ) PORT_CODE(KEYCODE_V) PORT_CODE(KEYCODE_DOWN) PORT_NAME("Stop All / Take / Down") + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SLOT_STOP2 ) PORT_CODE(KEYCODE_C) PORT_CODE(KEYCODE_UP) PORT_NAME("Stop 2 / Big / Up") + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SLOT_STOP1 ) PORT_CODE(KEYCODE_X) PORT_CODE(KEYCODE_LEFT) PORT_NAME("Stop 1 / D-UP / Left") + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SLOT_STOP_ALL ) PORT_CODE(KEYCODE_Z) PORT_CODE(KEYCODE_DOWN) PORT_NAME("Stop All / Take / Down") PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_GAMBLE_BET ) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SLOT_STOP3 ) PORT_CODE(KEYCODE_C) PORT_NAME("Stop 3 / Small / Info") + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SLOT_STOP3 ) PORT_CODE(KEYCODE_V) PORT_NAME("Stop 3 / Small / Info") PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 ) PORT_CODE(KEYCODE_1) PORT_CODE(KEYCODE_RIGHT) PORT_NAME("Start / Right") PORT_INCLUDE( cmv4_coins ) @@ -6118,11 +6215,11 @@ static INPUT_PORTS_START( cmtetris ) PORT_START("IN0") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SLOT_STOP2 ) PORT_CODE(KEYCODE_X) PORT_CODE(KEYCODE_RIGHT) PORT_NAME("Stop 2 / Big / Right") - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SLOT_STOP1 ) PORT_CODE(KEYCODE_Z) PORT_NAME("Stop 1 / D-UP") - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SLOT_STOP_ALL ) PORT_CODE(KEYCODE_V) PORT_CODE(KEYCODE_UP) PORT_NAME("Stop All / Take / Up") + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SLOT_STOP2 ) PORT_CODE(KEYCODE_C) PORT_CODE(KEYCODE_RIGHT) PORT_NAME("Stop 2 / Big / Right") + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SLOT_STOP1 ) PORT_CODE(KEYCODE_X) PORT_NAME("Stop 1 / D-UP") + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SLOT_STOP_ALL ) PORT_CODE(KEYCODE_Z) PORT_CODE(KEYCODE_UP) PORT_NAME("Stop All / Take / Up") PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_GAMBLE_BET ) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SLOT_STOP3 ) PORT_CODE(KEYCODE_C) PORT_CODE(KEYCODE_LEFT) PORT_NAME("Stop 3 / Small / Info / Left") + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SLOT_STOP3 ) PORT_CODE(KEYCODE_V) PORT_CODE(KEYCODE_LEFT) PORT_NAME("Stop 3 / Small / Info / Left") PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 ) PORT_CODE(KEYCODE_1) PORT_CODE(KEYCODE_DOWN) PORT_NAME("Start / Down") PORT_START("IN1") @@ -6954,56 +7051,6 @@ PALETTE_INIT_MEMBER(goldstar_state, lucky8) } -static MACHINE_CONFIG_START( chrygld, cb3_state ) - - /* basic machine hardware */ - MCFG_CPU_ADD("maincpu", Z80, CPU_CLOCK) - MCFG_CPU_PROGRAM_MAP(ncb3_map) - MCFG_CPU_IO_MAP(ncb3_readwriteport) - MCFG_CPU_VBLANK_INT_DRIVER("screen", goldstar_state, irq0_line_hold) - - MCFG_DEVICE_ADD("ppi8255_0", I8255A, 0) - MCFG_I8255_IN_PORTA_CB(IOPORT("IN0")) - MCFG_I8255_IN_PORTB_CB(IOPORT("IN3")) //Player2 controls, confirmed - - MCFG_DEVICE_ADD("ppi8255_1", I8255A, 0) - MCFG_I8255_IN_PORTA_CB(IOPORT("IN1")) - MCFG_I8255_IN_PORTB_CB(IOPORT("IN2")) - MCFG_I8255_IN_PORTC_CB(IOPORT("DSW1")) - - MCFG_DEVICE_ADD("ppi8255_2", I8255A, 0) - MCFG_I8255_IN_PORTA_CB(IOPORT("DSW2")) - - /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(60) -// MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) - MCFG_SCREEN_SIZE(64*8, 32*8) - MCFG_SCREEN_VISIBLE_AREA(0*8, 64*8-1, 2*8, 30*8-1) - MCFG_SCREEN_UPDATE_DRIVER(goldstar_state, screen_update_goldstar) - MCFG_SCREEN_PALETTE("palette") - - MCFG_GFXDECODE_ADD("gfxdecode", "palette", chry10) - MCFG_PALETTE_ADD("palette", 256) - MCFG_PALETTE_INIT_OWNER(goldstar_state,cm) - MCFG_NVRAM_ADD_1FILL("nvram") - - MCFG_VIDEO_START_OVERRIDE(goldstar_state,goldstar) - - /* sound hardware */ - MCFG_SPEAKER_STANDARD_MONO("mono") - - MCFG_SOUND_ADD("snsnd", SN76489, PSG_CLOCK) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80) - - MCFG_SOUND_ADD("aysnd", AY8910, AY_CLOCK) - MCFG_AY8910_PORT_A_READ_CB(IOPORT("DSW4")) - MCFG_AY8910_PORT_B_READ_CB(IOPORT("DSW3")) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) -MACHINE_CONFIG_END - - - static MACHINE_CONFIG_START( ncb3, cb3_state ) /* basic machine hardware */ @@ -7061,6 +7108,10 @@ static MACHINE_CONFIG_DERIVED( cb3e, ncb3 ) MCFG_GFXDECODE_MODIFY("gfxdecode", cb3e) MACHINE_CONFIG_END +static MACHINE_CONFIG_DERIVED( chrygld, ncb3 ) + MCFG_GFXDECODE_MODIFY("gfxdecode", chry10) +MACHINE_CONFIG_END + static MACHINE_CONFIG_DERIVED( cherrys, ncb3 ) MCFG_GFXDECODE_MODIFY("gfxdecode", cherrys) MACHINE_CONFIG_END @@ -7070,7 +7121,6 @@ static MACHINE_CONFIG_DERIVED( cm97, ncb3 ) MACHINE_CONFIG_END - static MACHINE_CONFIG_START( wcherry, goldstar_state ) /* basic machine hardware */ @@ -7120,7 +7170,6 @@ static MACHINE_CONFIG_START( wcherry, goldstar_state ) MACHINE_CONFIG_END - static MACHINE_CONFIG_START( cm, cmaster_state ) /* basic machine hardware */ @@ -7210,6 +7259,7 @@ static MACHINE_CONFIG_START( cmast91, goldstar_state ) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) MACHINE_CONFIG_END + INTERRUPT_GEN_MEMBER(wingco_state::masked_irq) { if (m_nmi_enable) @@ -7652,14 +7702,22 @@ static MACHINE_CONFIG_DERIVED( nfm, amcoe2 ) MCFG_GFXDECODE_MODIFY("gfxdecode", nfm) MACHINE_CONFIG_END + +INTERRUPT_GEN_MEMBER(unkch_state::vblank_irq) +{ + if (m_vblank_irq_enable) + device.execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE); +} + static MACHINE_CONFIG_START( unkch, unkch_state ) /* basic machine hardware */ MCFG_CPU_ADD("maincpu", Z80, CPU_CLOCK) MCFG_CPU_PROGRAM_MAP(unkch_map) MCFG_CPU_IO_MAP(unkch_portmap) - MCFG_CPU_VBLANK_INT_DRIVER("screen", goldstar_state, nmi_line_pulse) - //MCFG_CPU_VBLANK_INT_DRIVER("screen", goldstar_state, irq0_line_hold) + MCFG_CPU_VBLANK_INT_DRIVER("screen", unkch_state, vblank_irq) + + MCFG_NVRAM_ADD_1FILL("nvram") /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) @@ -7674,19 +7732,17 @@ static MACHINE_CONFIG_START( unkch, unkch_state ) MCFG_PALETTE_ADD("palette", 512) MCFG_PALETTE_FORMAT(xBBBBBGGGGGRRRRR) - //MCFG_NVRAM_HANDLER(goldstar) - MCFG_VIDEO_START_OVERRIDE(unkch_state, unkch) /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") + MCFG_SOUND_ADD("aysnd", AY8910, AY_CLOCK) + MCFG_AY8910_PORT_A_READ_CB(IOPORT("DSW1")) + MCFG_AY8910_PORT_B_READ_CB(IOPORT("DSW2")) + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) -// MCFG_SOUND_ADD("aysnd", AY8910, AY_CLOCK) -// -// -// MCFG_AY8910_PORT_A_READ_CB(IOPORT("DSW4")) -// MCFG_AY8910_PORT_B_READ_CB(IOPORT("DSW3")) -// MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) + /* payout hardware */ + MCFG_TICKET_DISPENSER_ADD("tickets", attotime::from_msec(200), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW) MACHINE_CONFIG_END @@ -12836,6 +12892,9 @@ DRIVER_INIT_MEMBER(cb3_state, cherrys) /* todo: remove these patches! */ DRIVER_INIT_MEMBER(unkch_state, unkch1) { + // game stores $02 at ($D75C) and expects it to change + // possibly expecting stack to grow to this point in NMI handler? + // it does this before enabling vblank irq, so if that's the case there's a missing nmi source UINT8 *ROM = memregion("maincpu")->base(); ROM[0x9d52] = 0x00; ROM[0x9d53] = 0x00; @@ -12843,6 +12902,9 @@ DRIVER_INIT_MEMBER(unkch_state, unkch1) DRIVER_INIT_MEMBER(unkch_state, unkch3) { + // game stores $04 at ($D77F) and expects it to change + // possibly expecting stack to grow to this point in NMI handler? + // it does this before enabling vblank irq, so if that's the case there's a missing nmi source UINT8 *ROM = memregion("maincpu")->base(); ROM[0x9b86] = 0x00; ROM[0x9b87] = 0x00; @@ -12850,6 +12912,9 @@ DRIVER_INIT_MEMBER(unkch_state, unkch3) DRIVER_INIT_MEMBER(unkch_state, unkch4) { + // game stores $02 at ($D75C) and expects it to change + // possibly expecting stack to grow to this point in NMI handler? + // it does this before enabling vblank irq, so if that's the case there's a missing nmi source UINT8 *ROM = memregion("maincpu")->base(); ROM[0x9a6e] = 0x00; ROM[0x9a6f] = 0x00; @@ -12943,8 +13008,8 @@ DRIVER_INIT_MEMBER(goldstar_state, wcherry) GAMEL( 199?, goldstar, 0, goldstar, goldstar, goldstar_state, goldstar, ROT0, "IGS", "Golden Star", 0, layout_goldstar ) GAMEL( 199?, goldstbl, goldstar, goldstbl, goldstar, driver_device, 0, ROT0, "IGS", "Golden Star (Blue version)", 0, layout_goldstar ) GAME( 199?, moonlght, goldstar, moonlght, goldstar, driver_device, 0, ROT0, "bootleg", "Moon Light (bootleg of Golden Star)", 0 ) -GAME( 199?, chrygld, 0, chrygld, chrygld, cb3_state, chrygld, ROT0, "bootleg", "Cherry Gold I", 0 ) -GAME( 199?, chry10, 0, chrygld, chry10, cb3_state, chry10, ROT0, "bootleg", "Cherry 10 (bootleg with PIC16F84)", 0 ) +GAMEL( 199?, chrygld, 0, chrygld, chrygld, cb3_state, chrygld, ROT0, "bootleg", "Cherry Gold I", 0, layout_chrygld ) +GAMEL( 199?, chry10, 0, chrygld, chry10, cb3_state, chry10, ROT0, "bootleg", "Cherry 10 (bootleg with PIC16F84)", 0, layout_chrygld ) GAME( 199?, goldfrui, goldstar, goldfrui, goldstar, driver_device, 0, ROT0, "bootleg", "Gold Fruit", 0 ) // maybe fullname should be 'Gold Fruit (main 40%)' GAME( 2001, super9, goldstar, super9, goldstar, goldstar_state, super9, ROT0, "Playmark", "Super Nove (Playmark)", GAME_NOT_WORKING ) // need to decode gfx and see the program loops/reset... GAME( 2001, wcherry, 0, wcherry, chrygld, goldstar_state, wcherry, ROT0, "bootleg", "Win Cherry (ver 0.16 - 19990219)", GAME_NOT_WORKING ) @@ -12959,7 +13024,7 @@ GAMEL( 199?, cb3, ncb3, ncb3, ncb3, cb3_state, cb3, GAMEL( 199?, cb3b, ncb3, cherrys, ncb3, cb3_state, cherrys, ROT0, "Dyna", "Cherry Bonus III (alt)", 0, layout_cherryb3 ) GAME( 199?, cb3c, ncb3, cb3c, chrygld, cb3_state, cb3, ROT0, "bootleg", "Cherry Bonus III (alt, set 2)", GAME_NOT_WORKING) GAMEL( 199?, cb3d, ncb3, ncb3, ncb3, driver_device, 0, ROT0, "bootleg", "Cherry Bonus III (set 3)", 0, layout_cherryb3 ) -GAMEL( 199?, cb3e, ncb3, cb3e, chrygld, cb3_state, cb3e, ROT0, "bootleg", "Cherry Bonus III (set 4, encrypted bootleg)", 0, layout_cherryb3 ) +GAMEL( 199?, cb3e, ncb3, cb3e, chrygld, cb3_state, cb3e, ROT0, "bootleg", "Cherry Bonus III (set 4, encrypted bootleg)", 0, layout_chrygld ) GAME( 1996, cmast97, ncb3, cm97, chrygld, driver_device, 0, ROT0, "Dyna", "Cherry Master '97", GAME_NOT_WORKING) // fix prom decode @@ -12990,7 +13055,7 @@ GAMEL( 1991, cmastere, cmaster, cm, cmasterb, cmaster_state, cmv4, GAMEL( 1991, cmasterf, cmaster, cm, cmasterb, cmaster_state, cmv4, ROT0, "Dyna", "Cherry Master I (ver.1.01, set 7)", 0, layout_cmasterb ) -GAME( 1991, tonypok, 0, cm, tonypok, cmaster_state, tonypok, ROT0, "Corsica", "Poker Master (Tony-Poker V3.A, hack?)", 0 ) +GAMEL( 1991, tonypok, 0, cm, tonypok, cmaster_state, tonypok, ROT0, "Corsica", "Poker Master (Tony-Poker V3.A, hack?)", 0 , layout_tonypok ) GAME( 199?, jkrmast, 0, pkrmast, pkrmast, driver_device, 0, ROT0, "", "Joker Master", GAME_NOT_WORKING ) // encrypted? GAME( 199?, pkrmast, jkrmast, pkrmast, pkrmast, driver_device, 0, ROT0, "", "Poker Master (ED-1993 set 1)", GAME_NOT_WORKING ) // incomplete dump + encrypted? GAME( 1993, pkrmasta, jkrmast, pkrmast, pkrmast, driver_device, 0, ROT0, "", "Poker Master (ED-1993 set 2)", GAME_NOT_WORKING ) // incomplete dump + encrypted? @@ -13034,7 +13099,7 @@ GAME( 1991, magoddsd, magodds, magodds, magoddsc, wingco_state, magoddsc, GAMEL( 1997, schery97, 0, amcoe1, schery97, cmaster_state, schery97, ROT0, "Amcoe", "Skill Cherry '97 (Talking ver. sc3.52)", 0, layout_nfb96 ) /* running in CB hardware */ GAMEL( 1997, schery97a, schery97, amcoe1, schery97, cmaster_state, schery97a, ROT0, "Amcoe", "Skill Cherry '97 (Talking ver. sc3.52c4)", 0, layout_nfb96 ) /* running in C4 hardware */ -GAMEL( 1998, skill98, 0, amcoe1, schery97, cmaster_state, skill98, ROT0, "Amcoe", "Skill '98 (Talking ver. s98-1.33)", 0, layout_nfb96 ) +GAMEL( 1998, skill98, 0, amcoe1, schery97, cmaster_state, skill98, ROT0, "Amcoe", "Skill '98 (Talking ver. s98-1.33)", 0, layout_skill98 ) GAMEL( 1997, pokonl97, 0, amcoe1, pokonl97, cmaster_state, po33, ROT0, "Amcoe", "Poker Only '97 (Talking ver. 3.3)", 0, layout_pokonl97 ) GAME( 1998, match98, 0, amcoe1a, match98, cmaster_state, match133, ROT0, "Amcoe", "Match '98 (ver. 1.33)", 0 ) @@ -13051,7 +13116,7 @@ GAMEL( 1996, nc96, 0, amcoe2, nfb96, cmaster_state, nfb96_c1, GAMEL( 1996, nc96a, nc96, amcoe2, nfb96, cmaster_state, nfb96_c1, ROT0, "Amcoe", "New Cherry '96 Special Edition (v3.62, C1 PCB)", 0, layout_nfb96 ) /* C1 Sub-PCB */ GAMEL( 1996, nc96b, nc96, amcoe2, nfb96, cmaster_state, nfb96_d, ROT0, "Amcoe", "New Cherry '96 Special Edition (v3.54, D PCB)", 0, layout_nfb96 ) /* D Sub-PCB */ GAMEL( 1996, nc96c, nc96, amcoe2, nfb96, cmaster_state, nfb96_dk, ROT0, "Amcoe", "New Cherry '96 Special Edition (v3.62, DK PCB)", 0, layout_nfb96 ) /* DK Sub-PCB */ -GAMEL( 2000, nc96txt, nc96, amcoe2, nfb96tx, cmaster_state, nfb96_c2, ROT0, "Amcoe", "New Cherry '96 Special Edition (v1.32 Texas XT, C2 PCB)", 0, layout_nfb96 ) /* ver. tc1.32axt C2 Sub-PCB */ +GAMEL( 2000, nc96txt, nc96, amcoe2, nfb96tx, cmaster_state, nfb96_c2, ROT0, "Amcoe", "New Cherry '96 Special Edition (v1.32 Texas XT, C2 PCB)", 0, layout_nfb96tx ) /* ver. tc1.32axt C2 Sub-PCB */ GAME( 2009, fb2010, 0, amcoe2, nfb96tx, cmaster_state, fb2010, ROT0, "Amcoe", "Fruit Bonus 2010", GAME_NOT_WORKING ) // no gfx dumped @@ -13073,20 +13138,20 @@ GAME( 2003, carb2003, nfb96, amcoe2, nfb96bl, driver_device, 0, GAME( 2003, nfm, 0, nfm, nfb96bl, driver_device, 0, ROT0, "Ming-Yang Electronic", "New Fruit Machine (Ming-Yang Electronic)", GAME_NOT_WORKING ) // vFB02-07A "Copyright By Ms. Liu Orchis 2003/03/06" // these have 'cherry 1994' in the program roms, but also "Super Cherry / New Cherry Gold '99" probably hacks of a 1994 version of Cherry Bonus / Cherry Master (Super Cherry Master?) -GAME( 1999, unkch1, 0, unkch, unkch, unkch_state, unkch1, ROT0, "bootleg", "New Cherry Gold '99 (bootleg of Super Cherry Master) (set 1)", GAME_NOT_WORKING|GAME_NO_SOUND ) -GAME( 1999, unkch2, unkch1, unkch, unkch, unkch_state, unkch1, ROT0, "bootleg", "Super Cherry Gold (bootleg of Super Cherry Master)", GAME_NOT_WORKING|GAME_NO_SOUND ) -GAME( 1999, unkch3, unkch1, unkch, unkch3, unkch_state, unkch3, ROT0, "bootleg", "New Cherry Gold '99 (bootleg of Super Cherry Master) (set 2)", GAME_NOT_WORKING|GAME_NO_SOUND ) // cards have been hacked to look like barrels, girl removed? -GAME( 1999, unkch4, unkch1, unkch, unkch4, unkch_state, unkch4, ROT0, "bootleg", "Grand Cherry Master (bootleg of Super Cherry Master)", GAME_NOT_WORKING|GAME_NO_SOUND ) // by 'Toy System' Hungary +GAMEL(1999, unkch1, 0, unkch, unkch, unkch_state, unkch1, ROT0, "bootleg", "New Cherry Gold '99 (bootleg of Super Cherry Master) (set 1)", 0, layout_unkch ) +GAMEL(1999, unkch2, unkch1, unkch, unkch, unkch_state, unkch1, ROT0, "bootleg", "Super Cherry Gold (bootleg of Super Cherry Master)", 0, layout_unkch ) +GAMEL(1999, unkch3, unkch1, unkch, unkch3, unkch_state, unkch3, ROT0, "bootleg", "New Cherry Gold '99 (bootleg of Super Cherry Master) (set 2)", 0, layout_unkch ) // cards have been hacked to look like barrels, girl removed? +GAMEL(1999, unkch4, unkch1, unkch, unkch4, unkch_state, unkch4, ROT0, "bootleg", "Grand Cherry Master (bootleg of Super Cherry Master)", 0, layout_unkch ) // by 'Toy System' Hungary /* Stealth sets. These have hidden games inside that can be switched to avoid inspections, police or whatever purposes)... */ /* YEAR NAME PARENT MACHINE INPUT STATE INIT ROT COMPANY FULLNAME FLAGS */ -GAMEL( 198?, cmpacman, 0, cm, cmpacman, cmaster_state, cm, ROT0, "", "Super Pacman (v1.2) + Cherry Master (Corsica, v8.31)", 0, layout_cmv4 ) /* need to press K to switch between games... */ -GAMEL( 198?, cmtetris, 0, cm, cmtetris, cmaster_state, cm, ROT0, "", "Tetris + Cherry Master (Corsica, v8.01, set 1)", 0, layout_cmv4 ) /* need to press K/L to switch between games... */ -GAMEL( 198?, cmtetrsa, 0, cm, cmtetris, cmaster_state, cm, ROT0, "", "Tetris + Cherry Master (Corsica, v8.01, set 2)", GAME_NOT_WORKING, layout_cmv4) // seems banked... -GAMEL( 198?, cmtetrsb, 0, cm, cmtetris, cmaster_state, cm, ROT0, "", "Tetris + Cherry Master (+K, Canada Version, encrypted)", GAME_NOT_WORKING, layout_cmv4) // different Tetris game +GAMEL( 198?, cmpacman, 0, cm, cmpacman, cmaster_state, cm, ROT0, "", "Super Pacman (v1.2) + Cherry Master (Corsica, v8.31)", 0, layout_cmpacman ) // need to press K to switch between games... +GAMEL( 198?, cmtetris, 0, cm, cmtetris, cmaster_state, cm, ROT0, "", "Tetris + Cherry Master (Corsica, v8.01, set 1)", 0, layout_cmpacman ) // need to press K/L to switch between games... +GAMEL( 198?, cmtetrsa, 0, cm, cmtetris, cmaster_state, cm, ROT0, "", "Tetris + Cherry Master (Corsica, v8.01, set 2)", GAME_NOT_WORKING, layout_cmpacman ) // seems banked... +GAMEL( 198?, cmtetrsb, 0, cm, cmtetris, cmaster_state, cm, ROT0, "", "Tetris + Cherry Master (+K, Canada Version, encrypted)", GAME_NOT_WORKING, layout_cmpacman ) // different Tetris game /* other possible stealth sets: - cmv4a ---> see the 1fxx zone. put a bp in 1f9f to see the loop. diff --git a/src/mame/drivers/iteagle.c b/src/mame/drivers/iteagle.c index 9cb6ff3e3bb..dfcf369441e 100644 --- a/src/mame/drivers/iteagle.c +++ b/src/mame/drivers/iteagle.c @@ -90,183 +90,180 @@ www.multitech.com #include "emu.h" #include "cpu/mips/mips3.h" -#include "machine/ataintf.h" -#include "video/voodoo.h" +#include "machine/pci.h" +#include "machine/vrc4373.h" +#include "video/voodoo_pci.h" +#include "sound/es1373.h" +#include "machine/iteagle_fpga.h" + +//************************************* +// Main iteagle driver +//************************************* 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_voodoo(*this, "voodoo") + m_maincpu(*this, "maincpu") {} - + required_device m_maincpu; - required_device m_voodoo; - DECLARE_DRIVER_INIT(iteagle); - DECLARE_WRITE_LINE_MEMBER(ide_interrupt); - DECLARE_WRITE_LINE_MEMBER(vblank_assert); - UINT32 screen_update_iteagle(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); virtual void machine_start(); + virtual void machine_reset(); }; - -/************************************* - * - * Machine start - * - *************************************/ - void iteagle_state::machine_start() { /* set the fastest DRC options */ m_maincpu->mips3drc_set_options(MIPS3DRC_FASTEST_OPTIONS); } - - -/************************************* - * - * Video refresh - * - *************************************/ - -UINT32 iteagle_state::screen_update_iteagle(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) -{ - return voodoo_update(m_voodoo, bitmap, cliprect) ? 0 : UPDATE_HAS_NOT_CHANGED; -} - - - -/************************************* - * - * Interrupt handling - * - *************************************/ - -WRITE_LINE_MEMBER(iteagle_state::ide_interrupt) +void iteagle_state::machine_reset() { } -/************************************* - * - * Main CPU memory handlers - * - *************************************/ - -static ADDRESS_MAP_START( main_map, AS_PROGRAM, 32, iteagle_state ) - ADDRESS_MAP_UNMAP_HIGH - AM_RANGE(0x00000000, 0x01ffffff) AM_RAM - // Nile 3 northbridge/PCI controller at 0f000000 - AM_RANGE(0x1fc00000, 0x1fcfffff) AM_ROM AM_REGION("maincpu", 0) AM_SHARE("rombase") -ADDRESS_MAP_END - -WRITE_LINE_MEMBER(iteagle_state::vblank_assert) -{ -} - -/************************************* - * - * Port definitions - * - *************************************/ - -static INPUT_PORTS_START( gtfore ) -INPUT_PORTS_END - -/************************************* - * - * Machine driver - * - *************************************/ - static MACHINE_CONFIG_START( gtfore, iteagle_state ) /* basic machine hardware */ MCFG_CPU_ADD("maincpu", VR4310LE, 166666666) MCFG_MIPS3_ICACHE_SIZE(16384) MCFG_MIPS3_DCACHE_SIZE(16384) - MCFG_CPU_PROGRAM_MAP(main_map) + + MCFG_PCI_ROOT_ADD( ":pci") + MCFG_VRC4373_ADD( ":pci:00.0", ":maincpu") + MCFG_ITEAGLE_FPGA_ADD( ":pci:06.0") + MCFG_ITEAGLE_IDE_ADD( ":pci:06.1") + MCFG_ES1373_ADD( ":pci:07.0") + MCFG_VOODOO_ADD( ":pci:09.0") + MCFG_ITEAGLE_EEPROM_ADD( ":pci:0a.0") - MCFG_ATA_INTERFACE_ADD("ata", ata_devices, "hdd", NULL, true) - MCFG_ATA_INTERFACE_IRQ_HANDLER(WRITELINE(iteagle_state, ide_interrupt)) - - /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_VIDEO_ATTRIBUTES(VIDEO_UPDATE_BEFORE_VBLANK) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) - MCFG_SCREEN_SIZE(320, 240) - MCFG_SCREEN_VISIBLE_AREA(0, 319, 0, 239) - MCFG_SCREEN_UPDATE_DRIVER(iteagle_state, screen_update_iteagle) + MCFG_SCREEN_REFRESH_RATE(56.644) + 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) + - MCFG_DEVICE_ADD("voodoo", VOODOO_BANSHEE, STD_VOODOO_BANSHEE_CLOCK) - MCFG_VOODOO_FBMEM(16) - MCFG_VOODOO_SCREEN_TAG("screen") - MCFG_VOODOO_CPU_TAG("maincpu") - MCFG_VOODOO_VBLANK_CB(WRITELINE(iteagle_state,vblank_assert)) MACHINE_CONFIG_END +/************************************* + * + * Port definitions + * + *************************************/ +static INPUT_PORTS_START( iteagle ) + + PORT_START("SW5") + PORT_DIPNAME( 0x3, 0x1, "Resolution" ) + PORT_DIPSETTING(0x1, "Medium" ) + PORT_DIPSETTING(0x0, "Low" ) + PORT_DIPSETTING(0x2, "Low_Alt" ) + PORT_DIPNAME( 0xC, 0x0, "Always" ) + + PORT_START("VERSION") + PORT_DIPNAME( 0x0F00, 0x0000, "GAME" ) + PORT_DIPNAME( 0x00F0, 0x0000, "MAJOR" ) + PORT_DIPNAME( 0x000F, 0x0000, "MINOR" ) + +INPUT_PORTS_END + +static INPUT_PORTS_START( gtfore05 ) + PORT_INCLUDE(iteagle) + + PORT_MODIFY("VERSION") + PORT_DIPNAME( 0x0F00, 0x0400, "GAME" ) + PORT_DIPNAME( 0x00F0, 0x0050, "MAJOR" ) + PORT_DIPNAME( 0x000F, 0x0001, "MINOR" ) + +INPUT_PORTS_END + +static INPUT_PORTS_START( gtfore04 ) + PORT_INCLUDE(iteagle) + + PORT_MODIFY("VERSION") + PORT_DIPNAME( 0x0F00, 0x0400, "GAME" ) + PORT_DIPNAME( 0x00F0, 0x0040, "MAJOR" ) + PORT_DIPNAME( 0x000F, 0x0000, "MINOR" ) + +INPUT_PORTS_END + +static INPUT_PORTS_START( gtfore02o ) + PORT_INCLUDE(iteagle) + + PORT_MODIFY("VERSION") + PORT_DIPNAME( 0x0F00, 0x0400, "GAME" ) + PORT_DIPNAME( 0x00F0, 0x0030, "MAJOR" ) + PORT_DIPNAME( 0x000F, 0x0000, "MINOR" ) + +INPUT_PORTS_END + +static INPUT_PORTS_START( gtfore02 ) + PORT_INCLUDE(iteagle) + + PORT_MODIFY("VERSION") + PORT_DIPNAME( 0x0F00, 0x0400, "GAME" ) + PORT_DIPNAME( 0x00F0, 0x0060, "MAJOR" ) + PORT_DIPNAME( 0x000F, 0x0000, "MINOR" ) + +INPUT_PORTS_END /************************************* * * ROM definition(s) * *************************************/ - #define EAGLE_BIOS \ - ROM_REGION( 0x100000, "maincpu", 0 ) /* MIPS code */ \ + ROM_REGION( 0x100000, ":pci:00.0", 0 ) /* MIPS code */ \ ROM_SYSTEM_BIOS( 0, "209", "bootrom 2.09" ) \ - ROM_LOAD( "eagle209.u15", 0x000000, 0x100000, CRC(e0fc1a16) SHA1(c9524f7ee6b95bd484a3b75bcbe2243cb273f84c) ) \ + ROMX_LOAD( "eagle209.u15", 0x000000, 0x100000, CRC(e0fc1a16) SHA1(c9524f7ee6b95bd484a3b75bcbe2243cb273f84c), ROM_BIOS(1) ) \ ROM_SYSTEM_BIOS( 1, "208", "bootrom 2.08" ) \ - ROM_LOAD( "eagle208.u15", 0x000000, 0x100000, CRC(772f2864) SHA1(085063a4e34f29ebe3814823cd2c6323a050da36) ) \ + ROMX_LOAD( "eagle208.u15", 0x000000, 0x100000, CRC(772f2864) SHA1(085063a4e34f29ebe3814823cd2c6323a050da36), ROM_BIOS(2) ) \ ROM_SYSTEM_BIOS( 2, "204", "bootrom 2.04" ) \ - ROM_LOAD( "eagle204.u15", 0x000000, 0x100000, CRC(f02e5523) SHA1(b979cf72a6992f1ecad9695a08c8d51e315ab537) ) \ + ROMX_LOAD( "eagle204.u15", 0x000000, 0x100000, CRC(f02e5523) SHA1(b979cf72a6992f1ecad9695a08c8d51e315ab537), ROM_BIOS(3) ) \ ROM_SYSTEM_BIOS( 3, "201", "bootrom 2.01" ) \ - ROM_LOAD( "eagle201.u15", 0x000000, 0x100000, CRC(e180442b) SHA1(4f50821fed5bcd786d989520aa2559d6c416fb1f) ) \ + ROMX_LOAD( "eagle201.u15", 0x000000, 0x100000, CRC(e180442b) SHA1(4f50821fed5bcd786d989520aa2559d6c416fb1f), ROM_BIOS(4) ) \ ROM_SYSTEM_BIOS( 4, "107", "bootrom 1.07" ) \ - ROM_LOAD( "eagle107.u15", 0x000000, 0x100000, CRC(97a01fc9) SHA1(a421dbf4d097b2f50cc005d3cd0d63e562e03df8) ) \ + ROMX_LOAD( "eagle107.u15", 0x000000, 0x100000, CRC(97a01fc9) SHA1(a421dbf4d097b2f50cc005d3cd0d63e562e03df8), ROM_BIOS(5) ) \ ROM_SYSTEM_BIOS( 5, "106a", "bootrom 1.06a" ) \ - ROM_LOAD( "eagle106a.u15", 0x000000, 0x100000, CRC(9c79b7ad) SHA1(ccf1c86e79d65bee30f399e0fa33a7839570d93b) ) \ + ROMX_LOAD( "eagle106a.u15", 0x000000, 0x100000, CRC(9c79b7ad) SHA1(ccf1c86e79d65bee30f399e0fa33a7839570d93b), ROM_BIOS(6) ) \ ROM_SYSTEM_BIOS( 6, "106", "bootrom 1.06" ) \ - ROM_LOAD( "eagle106.u15", 0x000000, 0x100000, CRC(56bc193d) SHA1(e531d208ef27f777d0784414885f390d1be654b9) ) \ + ROMX_LOAD( "eagle106.u15", 0x000000, 0x100000, CRC(56bc193d) SHA1(e531d208ef27f777d0784414885f390d1be654b9), ROM_BIOS(7) ) \ ROM_SYSTEM_BIOS( 7, "105", "bootrom 1.05" ) \ - ROM_LOAD( "eagle105.u15", 0x000000, 0x100000, CRC(3870dbe0) SHA1(09be2d86c7259cd81d945c757044b167a76f30db) ) \ + ROMX_LOAD( "eagle105.u15", 0x000000, 0x100000, CRC(3870dbe0) SHA1(09be2d86c7259cd81d945c757044b167a76f30db), ROM_BIOS(8) ) \ ROM_SYSTEM_BIOS( 8, "103", "bootrom 1.03" ) \ - ROM_LOAD( "eagle103.u15", 0x000000, 0x100000, CRC(c35f4cf2) SHA1(45301c18c7f8f78754c8ad60ea4d2da5a7dc55fb) ) \ + ROMX_LOAD( "eagle103.u15", 0x000000, 0x100000, CRC(c35f4cf2) SHA1(45301c18c7f8f78754c8ad60ea4d2da5a7dc55fb), ROM_BIOS(9) ) \ ROM_SYSTEM_BIOS( 9, "102", "bootrom 1.02" ) \ - ROM_LOAD( "eagle102.u15", 0x000000, 0x100000, CRC(1fd39e73) SHA1(d1ac758f94defc5c55c62594b3999a406dd9ef1f) ) \ + ROMX_LOAD( "eagle102.u15", 0x000000, 0x100000, CRC(1fd39e73) SHA1(d1ac758f94defc5c55c62594b3999a406dd9ef1f), ROM_BIOS(10) ) \ ROM_SYSTEM_BIOS( 10, "101", "bootrom 1.01" ) \ - ROM_LOAD( "eagle101.u15", 0x000000, 0x100000, CRC(2600bc2b) SHA1(c4b89e69c51e4a3bb1874407c4d30b6caed4f396) ) \ + ROMX_LOAD( "eagle101.u15", 0x000000, 0x100000, CRC(2600bc2b) SHA1(c4b89e69c51e4a3bb1874407c4d30b6caed4f396), ROM_BIOS(11) ) \ ROM_REGION( 0x30000, "fpga", 0 ) \ ROM_LOAD( "17s20lpc_sb4.u26", 0x000000, 0x008000, CRC(62c4af8a) SHA1(6eca277b9c66a401990599e98fdca64a9e38cc9a) ) \ ROM_LOAD( "17s20lpc_sb5.u26", 0x008000, 0x008000, CRC(c88b9d42) SHA1(b912d0fc50ecdc6a198c626f6e1644e8405fac6e) ) \ ROM_LOAD( "17s50a_red1.u26", 0x010000, 0x020000, CRC(f5cf3187) SHA1(83b4a14de9959e5a776d97d424945d43501bda7f) ) \ + ROM_REGION( 0x80, "eeprom", 0 ) \ + ROM_COPY( "fpga", 0x0, 0x0, 0x80 ) \ ROM_REGION( 0x2000, "pals", 0 ) \ ROM_LOAD( "e2-card1.u22.jed", 0x000000, 0x000bd1, CRC(9d1e1ace) SHA1(287d6a30e9f32137ef4eba54f0effa092c97a6eb) ) \ ROM_LOAD( "e2-res3.u117.jed", 0x001000, 0x000bd1, CRC(4f1ff45a) SHA1(213cbdd6cd37ad9b5bfc9545084892a68d29f5ff) ) -/* -17s20lpc_sb4.u26 & 17s20lpc_sb5.u26 are alternate versions of configuration data for GREEN boards only. -17s50a_red1.u26 is configuration data for RED boards only. -*/ - ROM_START( iteagle ) EAGLE_BIOS - DISK_REGION( "ata:0:hdd:image" ) + DISK_REGION( ":pci:06.1:ide:0:hdd:image" ) ROM_END - ROM_START( gtfore02 ) EAGLE_BIOS ROM_REGION( 0x0880, "atmel", 0 ) /* Atmel 90S2313 AVR internal CPU code */ ROM_LOAD( "g42-us-u.u53", 0x0000, 0x0880, CRC(06e0b452) SHA1(f6b865799cb94941e0e77453b9d556d5988b0194) ) - DISK_REGION( "ata:0:hdd:image" ) + 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 ) @@ -275,7 +272,7 @@ ROM_START( gtfore02o ) ROM_REGION( 0x0880, "atmel", 0 ) /* Atmel 90S2313 AVR internal CPU code */ ROM_LOAD( "g42-us-u.u53", 0x0000, 0x0880, CRC(06e0b452) SHA1(f6b865799cb94941e0e77453b9d556d5988b0194) ) - DISK_REGION( "ata:0:hdd:image" ) + DISK_REGION( ":pci:06.1:ide:0:hdd:image" ) DISK_IMAGE( "golf_fore_2002_v2.00.00", 0, SHA1(d789ef86837a5012beb224c487537dd563d93886) ) /* Labeled Golf Fore! 2002 V2.00.00 */ ROM_END @@ -285,7 +282,7 @@ ROM_START( carnking ) ROM_REGION( 0x0880, "atmel", 0 ) /* Atmel 90S2313 AVR internal CPU code */ ROM_LOAD( "ck1-us.u53", 0x0000, 0x0880, NO_DUMP ) - DISK_REGION( "ata:0:hdd:image" ) + DISK_REGION( ":pci:06.1:ide:0:hdd:image" ) DISK_IMAGE( "carnival_king_v_1.00.11", 0, SHA1(c819af66d36df173ab17bf42f4045c7cca3203d8) ) /* Labeled Carnival King V 1.00.11 */ ROM_END @@ -295,7 +292,7 @@ ROM_START( gtfore04 ) ROM_REGION( 0x0880, "atmel", 0 ) /* Atmel 90S2313 AVR internal CPU code */ ROM_LOAD( "g44-us-u.u53", 0x0000, 0x0880, NO_DUMP ) - DISK_REGION( "ata:0:hdd:image" ) + DISK_REGION( ":pci:06.1:ide:0:hdd:image" ) DISK_IMAGE( "gt2004", 0, SHA1(739a52d6ce13bb6ac7a543ee0e8086fb66be19b9) ) ROM_END @@ -305,23 +302,19 @@ ROM_START( gtfore05 ) ROM_REGION( 0x0880, "atmel", 0 ) /* Atmel 90S2313 AVR internal CPU code */ ROM_LOAD( "g45-us-u.u53", 0x0000, 0x0880, NO_DUMP ) - DISK_REGION( "ata:0:hdd:image" ) + DISK_REGION( ":pci:06.1:ide:0:hdd:image" ) DISK_IMAGE( "gt2005", 0, SHA1(d8de569d8cf97b5aaada10ce896eb3c75f1b37f1) ) ROM_END -DRIVER_INIT_MEMBER(iteagle_state, iteagle) -{ -} - /************************************* * * Game driver(s) * *************************************/ -GAME( 2000, iteagle, 0, gtfore, gtfore, iteagle_state, iteagle, ROT0, "Incredible Technologies", "Eagle BIOS", GAME_IS_BIOS_ROOT ) -GAME( 2001, gtfore02, iteagle, gtfore, gtfore, iteagle_state, iteagle, ROT0, "Incredible Technologies", "Golden Tee Fore! 2002 (v2.01.04 UMV)", GAME_NOT_WORKING | GAME_NO_SOUND ) -GAME( 2001, gtfore02o, gtfore02, gtfore, gtfore, iteagle_state, iteagle, ROT0, "Incredible Technologies", "Golden Tee Fore! 2002 (v2.00.00)", GAME_NOT_WORKING | GAME_NO_SOUND ) -GAME( 2002, carnking, iteagle, gtfore, gtfore, iteagle_state, iteagle, ROT0, "Incredible Technologies", "Carnival King (v1.00.11)", GAME_NOT_WORKING | GAME_NO_SOUND ) -GAME( 2003, gtfore04, iteagle, gtfore, gtfore, iteagle_state, iteagle, ROT0, "Incredible Technologies", "Golden Tee Fore! 2004", GAME_NOT_WORKING | GAME_NO_SOUND ) -GAME( 2004, gtfore05, iteagle, gtfore, gtfore, iteagle_state, iteagle, ROT0, "Incredible Technologies", "Golden Tee Fore! 2005", GAME_NOT_WORKING | GAME_NO_SOUND ) +GAME( 2000, iteagle, 0, gtfore, iteagle, driver_device, 0, ROT0, "Incredible Technologies", "Eagle BIOS", GAME_IS_BIOS_ROOT ) +GAME( 2001, gtfore02, iteagle, gtfore, gtfore02, driver_device, 0, ROT0, "Incredible Technologies", "Golden Tee Fore! 2002 (v2.01.04 UMV)", GAME_NOT_WORKING | GAME_NO_SOUND ) +GAME( 2001, gtfore02o, gtfore02, gtfore, gtfore02o, driver_device, 0, ROT0, "Incredible Technologies", "Golden Tee Fore! 2002 (v2.00.00)", GAME_NOT_WORKING | GAME_NO_SOUND ) +GAME( 2002, carnking, iteagle, gtfore, iteagle, driver_device, 0, ROT0, "Incredible Technologies", "Carnival King (v1.00.11)", GAME_NOT_WORKING | GAME_NO_SOUND ) +GAME( 2003, gtfore04, iteagle, gtfore, gtfore04, driver_device, 0, ROT0, "Incredible Technologies", "Golden Tee Fore! 2004", GAME_NOT_WORKING | GAME_NO_SOUND ) +GAME( 2004, gtfore05, iteagle, gtfore, gtfore05, driver_device, 0, ROT0, "Incredible Technologies", "Golden Tee Fore! 2005", GAME_NOT_WORKING | GAME_NO_SOUND ) diff --git a/src/mame/drivers/jankenmn.c b/src/mame/drivers/jankenmn.c index 4c4210295a6..c28b74a276c 100644 --- a/src/mame/drivers/jankenmn.c +++ b/src/mame/drivers/jankenmn.c @@ -152,11 +152,13 @@ public: : driver_device(mconfig, type, tag), m_maincpu(*this, "maincpu") { } - DECLARE_CUSTOM_INPUT_MEMBER(jankenmn_hopper_status_r); - DECLARE_WRITE8_MEMBER(jankenmn_lamps1_w); - DECLARE_WRITE8_MEMBER(jankenmn_lamps2_w); - DECLARE_WRITE8_MEMBER(jankenmn_lamps3_w); required_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); }; @@ -167,7 +169,7 @@ public: static const UINT8 led_map[16] = // 7748 IC? { 0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7c,0x07,0x7f,0x67,0x58,0x4c,0x62,0x69,0x78,0x00 }; -WRITE8_MEMBER(jankenmn_state::jankenmn_lamps1_w) +WRITE8_MEMBER(jankenmn_state::lamps1_w) { // hand state: d0: rock, d1: scissors, d2: paper output_set_lamp_value(8, (data & 7) != 0); @@ -183,7 +185,7 @@ WRITE8_MEMBER(jankenmn_state::jankenmn_lamps1_w) // d3: ? (only set if game is over) } -WRITE8_MEMBER(jankenmn_state::jankenmn_lamps2_w) +WRITE8_MEMBER(jankenmn_state::lamps2_w) { // button LEDs: d1: paper, d2: scissors, d3: rock output_set_lamp_value(2, data >> 3 & 1); @@ -202,7 +204,7 @@ WRITE8_MEMBER(jankenmn_state::jankenmn_lamps2_w) output_set_digit_value(0, led_map[data & 1]); } -WRITE8_MEMBER(jankenmn_state::jankenmn_lamps3_w) +WRITE8_MEMBER(jankenmn_state::lamps3_w) { // d1: blue rotating lamp on top of cab output_set_lamp_value(15, data >> 1 & 1); @@ -220,7 +222,7 @@ WRITE8_MEMBER(jankenmn_state::jankenmn_lamps3_w) // d0, d6, d7: N/C? } -CUSTOM_INPUT_MEMBER(jankenmn_state::jankenmn_hopper_status_r) +CUSTOM_INPUT_MEMBER(jankenmn_state::hopper_status_r) { // temp workaround, needs hopper return machine().rand(); @@ -257,7 +259,7 @@ static INPUT_PORTS_START( jankenmn ) PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("Paa (Paper)") PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN ) PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_COIN3 ) // 100 yen coin - PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, jankenmn_state,jankenmn_hopper_status_r, NULL) + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, jankenmn_state, hopper_status_r, NULL) PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_COIN2 ) // 10 yen coin PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_COIN1 ) // 10 yen coin @@ -315,13 +317,13 @@ static MACHINE_CONFIG_START( jankenmn, jankenmn_state ) /* (10-13) Mode 0 - Ports A & B set as input, high C & low C as output. */ MCFG_I8255_IN_PORTA_CB(IOPORT("DSW")) MCFG_I8255_IN_PORTB_CB(IOPORT("IN0")) - MCFG_I8255_OUT_PORTC_CB(WRITE8(jankenmn_state, jankenmn_lamps3_w)) + MCFG_I8255_OUT_PORTC_CB(WRITE8(jankenmn_state, lamps3_w)) MCFG_DEVICE_ADD("ppi8255_1", I8255, 0) /* (20-23) Mode 0 - Ports A, B, high C & low C set as output. */ MCFG_I8255_OUT_PORTA_CB(DEVWRITE8("dac", dac_device, write_unsigned8)) - MCFG_I8255_OUT_PORTB_CB(WRITE8(jankenmn_state, jankenmn_lamps1_w)) - MCFG_I8255_OUT_PORTC_CB(WRITE8(jankenmn_state, jankenmn_lamps2_w)) + MCFG_I8255_OUT_PORTB_CB(WRITE8(jankenmn_state, lamps1_w)) + MCFG_I8255_OUT_PORTC_CB(WRITE8(jankenmn_state, lamps2_w)) MCFG_DEVICE_ADD("ctc", Z80CTC, MASTER_CLOCK) MCFG_Z80CTC_INTR_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0)) @@ -359,4 +361,4 @@ ROM_END *********************************************/ /* YEAR NAME PARENT MACHINE INPUT INIT ROT COMPANY FULLNAME FLAGS... LAYOUT */ -GAMEL( 1991, jankenmn, 0, jankenmn, jankenmn, driver_device, 0, ROT0, "Sunwise", "Janken Man Kattara Ageru", 0, layout_jankenmn ) +GAMEL( 1991, jankenmn, 0, jankenmn, jankenmn, driver_device, 0, ROT0, "Sunwise", "Janken Man Kattara Ageru", GAME_SUPPORTS_SAVE, layout_jankenmn ) diff --git a/src/mame/drivers/karnov.c b/src/mame/drivers/karnov.c index 391489ac700..6666d06eb5e 100644 --- a/src/mame/drivers/karnov.c +++ b/src/mame/drivers/karnov.c @@ -215,8 +215,13 @@ void karnov_state::chelnov_i8751_w( int data ) if (data == 0x100 && m_microcontroller_id == CHELNOVJ) /* Japan version */ m_i8751_return = 0x71a; - if (data >= 0x6000 && data < 0x8000) - m_i8751_return = 1; /* patched */ + if ((data & 0xe000) == 0x6000) { + if (data & 0x1000) { + m_i8751_return = ((data & 0x0f) + ((data >> 4) & 0x0f)) * ((data >> 8) & 0x0f); + } else { + m_i8751_return = (data & 0x0f) * (((data >> 8) & 0x0f) + ((data >> 4) & 0x0f)); + } + } if ((data & 0xf000) == 0x1000) m_i8751_level = 1; /* Level 1 */ if ((data & 0xf000) == 0x2000) m_i8751_level++; /* Level Increment */ @@ -1283,7 +1288,6 @@ DRIVER_INIT_MEMBER(karnov_state,chelnov) m_microcontroller_id = CHELNOV; m_coin_mask = 0xe0; - RAM[0x0a26/2] = 0x4e71; /* removes a protection lookup table */ RAM[0x062a/2] = 0x4e71; /* hangs waiting on i8751 int */ } @@ -1293,7 +1297,6 @@ DRIVER_INIT_MEMBER(karnov_state,chelnovu) m_microcontroller_id = CHELNOVU; m_coin_mask = 0xe0; - RAM[0x0a26/2] = 0x4e71; /* removes a protection lookup table */ RAM[0x062a/2] = 0x4e71; /* hangs waiting on i8751 int */ } @@ -1303,7 +1306,6 @@ DRIVER_INIT_MEMBER(karnov_state,chelnovj) m_microcontroller_id = CHELNOVJ; m_coin_mask = 0xe0; - RAM[0x0a2e/2] = 0x4e71; /* removes a protection lookup table */ RAM[0x062a/2] = 0x4e71; /* hangs waiting on i8751 int */ } diff --git a/src/mame/drivers/megaplay.c b/src/mame/drivers/megaplay.c index 86dae7f694d..cd4b74fc988 100644 --- a/src/mame/drivers/megaplay.c +++ b/src/mame/drivers/megaplay.c @@ -742,7 +742,7 @@ ROM_START( mp_col3 ) /* Columns 3 */ MEGAPLAY_BIOS ROM_END -ROM_START( mp_gaxe2 ) /* Golden Axe 2 */ +ROM_START( mp_gaxe2 ) /* Golden Axe 2, revision B */ ROM_REGION( 0x400000, "maincpu", 0 ) ROM_LOAD16_BYTE( "ep15179b.ic2", 0x000000, 0x040000, CRC(00d97b84) SHA1(914bbf566ddf940aab67b92af237d251650ddadf) ) ROM_LOAD16_BYTE( "ep15178b.ic1", 0x000001, 0x040000, CRC(2ea576db) SHA1(6d96b948243533de1f488b1f80e0d5431a4f1f53) ) @@ -755,6 +755,19 @@ ROM_START( mp_gaxe2 ) /* Golden Axe 2 */ MEGAPLAY_BIOS ROM_END +ROM_START( mp_gaxe2a ) /* Golden Axe 2 */ + ROM_REGION( 0x400000, "maincpu", 0 ) + ROM_LOAD16_BYTE( "epr-15179.ic2", 0x000000, 0x040000, CRC(d35f1a35) SHA1(3105cd3b55f65337863703db04527fe298fc04e0) ) + ROM_LOAD16_BYTE( "epr-15178.ic1", 0x000001, 0x040000, CRC(2c6b6b76) SHA1(25577f49ecad451c217da9cacbd78ffca9dca24e) ) + /* Game Instruction rom copied to 0x300000 - 0x310000 (odd / even bytes equal) */ + + ROM_REGION( 0x8000, "user1", 0 ) /* Game Instructions */ + ROM_LOAD( "epr-15175-02.ic3", 0x000000, 0x08000, CRC(cfc87f91) SHA1(110609094aa6d848bec613faa0558db7ad272b77) ) + + ROM_REGION( 0x20000, "mtbios", 0 ) /* Bios */ + MEGAPLAY_BIOS +ROM_END + ROM_START( mp_gslam ) /* Grand Slam */ ROM_REGION( 0x400000, "maincpu", 0 ) ROM_LOAD16_BYTE( "epr-15181.ic2", 0x000000, 0x040000, CRC(642437c1) SHA1(cbf88e196c04b6d886bf9642b69bf165045510fe) ) @@ -928,7 +941,8 @@ didn't have original Sega part numbers it's probably a converted TWC cart /* -- */ GAME( 1993, megaplay, 0, megaplay, megaplay, mplay_state, megaplay, ROT0, "Sega", "Mega Play BIOS", GAME_IS_BIOS_ROOT ) /* 01 */ GAME( 1993, mp_sonic, megaplay, megaplay, mp_sonic, mplay_state, megaplay, ROT0, "Sega", "Sonic The Hedgehog (Mega Play)" , 0 ) -/* 02 */ GAME( 1993, mp_gaxe2, megaplay, megaplay, mp_gaxe2, mplay_state, megaplay, ROT0, "Sega", "Golden Axe II (Mega Play)" , 0 ) +/* 02 */ GAME( 1993, mp_gaxe2, megaplay, megaplay, mp_gaxe2, mplay_state, megaplay, ROT0, "Sega", "Golden Axe II (Mega Play) (Rev B)" , 0 ) +/* 02 */ GAME( 1993, mp_gaxe2a,mp_gaxe2, megaplay, mp_gaxe2, mplay_state, megaplay, ROT0, "Sega", "Golden Axe II (Mega Play)" , 0 ) /* 03 */ GAME( 1993, mp_gslam, megaplay, megaplay, mp_gslam, mplay_state, megaplay, ROT0, "Sega", "Grand Slam (Mega Play)",0 ) /* 04 */ GAME( 1993, mp_twc, megaplay, megaplay, mp_twc, mplay_state, megaplay, ROT0, "Sega", "Tecmo World Cup (Mega Play)" , 0 ) /* 05 */ GAME( 1993, mp_sor2, megaplay, megaplay, mp_sor2, mplay_state, megaplay, ROT0, "Sega", "Streets of Rage II (Mega Play)" , 0 ) diff --git a/src/mame/drivers/megasys1.c b/src/mame/drivers/megasys1.c index c874925a887..f31aad63bc7 100644 --- a/src/mame/drivers/megasys1.c +++ b/src/mame/drivers/megasys1.c @@ -40,7 +40,7 @@ Year + Game System Protection Peek-a-Boo! D Inputs --------------------------------------------------------------------- -NOTE: Chimera Beast is the game game missing a dump of it's priority PROM +NOTE: Chimera Beast is the only game missing a dump of its priority PROM Hardware Main CPU Sound CPU Sound Chips @@ -92,8 +92,8 @@ RAM RW 0f0000-0f3fff 0e0000-0effff? < -------------- - There is a 512 byte PROM in the video section (differs by game) that - controls the priorities. This prom is currently missing for two games, - so we have to use fake data for those two (64th Street & Chimera Beast). + controls the priorities. This prom is currently missing for one game, + so we have to use fake data for it (Chimera Beast). - Making the M6295 status register return 0 fixes the music tempo in avspirit, 64street, astyanax etc. but makes most of the effects in @@ -107,6 +107,11 @@ RAM RW 0f0000-0f3fff 0e0000-0effff? < - 64street: player characters in attract mode doesn't move at all, protection? they move on the real PCB +- tshingen: unemulated mosaic effect when killing enemies with the flashing sword. + See https://youtu.be/m4ZH0v8UqWs + The effect can be tested in e.g. stdragon and p47 test mode: + See https://youtu.be/zo3FTCqkNBc and https://youtu.be/dEqH017YBzw + - Understand a handful of unknown bits in video regs @@ -393,7 +398,7 @@ READ8_MEMBER(megasys1_state::oki_status_2_r) if (m_ignore_oki_status == 1) return 0; else - return m_oki1->read_status(); + return m_oki2->read_status(); } /*************************************************************************** [ Sound CPU - System A ] @@ -4130,8 +4135,8 @@ GAME( 1988, p47, 0, system_A, p47, driver_device, 0, GAME( 1988, p47j, p47, system_A, p47, driver_device, 0, ROT0, "Jaleco", "P-47 - The Freedom Fighter (Japan)", 0 ) GAME( 1988, p47je, p47, system_A, p47, driver_device, 0, ROT0, "Jaleco", "P-47 - The Freedom Fighter (Japan, Export)", 0 ) GAME( 1988, kickoff, 0, system_A, kickoff, driver_device, 0, ROT0, "Jaleco", "Kick Off (Japan)", 0 ) -GAME( 1988, tshingen, 0, system_A, tshingen, megasys1_state, phantasm, ROT0, "Jaleco", "Shingen Samurai-Fighter (Japan, English)", 0 ) -GAME( 1988, tshingena,tshingen, system_A, tshingen, megasys1_state, phantasm, ROT0, "Jaleco", "Takeda Shingen (Japan, Japanese)", 0 ) +GAME( 1988, tshingen, 0, system_A, tshingen, megasys1_state, phantasm, ROT0, "Jaleco", "Shingen Samurai-Fighter (Japan, English)", GAME_IMPERFECT_GRAPHICS ) +GAME( 1988, tshingena,tshingen, system_A, tshingen, megasys1_state, phantasm, ROT0, "Jaleco", "Takeda Shingen (Japan, Japanese)", GAME_IMPERFECT_GRAPHICS ) GAME( 1988, kazan, 0, system_A, kazan, megasys1_state, iganinju, ROT0, "Jaleco", "Ninja Kazan (World)", 0 ) GAME( 1988, iganinju, kazan, system_A, kazan, megasys1_state, iganinju, ROT0, "Jaleco", "Iga Ninjyutsuden (Japan)", 0 ) GAME( 1989, astyanax, 0, system_A, astyanax, megasys1_state, astyanax, ROT0, "Jaleco", "The Astyanax", 0 ) diff --git a/src/mame/drivers/paradise.c b/src/mame/drivers/paradise.c index c6e7a20ca87..a08aa36bb8c 100644 --- a/src/mame/drivers/paradise.c +++ b/src/mame/drivers/paradise.c @@ -1094,8 +1094,8 @@ All roms had a Yun Sung label with no other ID markings or numbers */ ROM_START( torus ) - ROM_REGION( 0x40000, "maincpu", 0 ) /* Z80 Code */ - ROM_LOAD( "yunsung.u1", 0x00000, 0x40000, CRC(55d3ef3e) SHA1(195463271fdb3f9f5c19068efd1c99105f761fe9) ) + ROM_REGION( 0x10000, "maincpu", 0 ) /* Z80 Code */ + ROM_LOAD( "yunsung.u1", 0x00000, 0x10000, CRC(55d3ef3e) SHA1(195463271fdb3f9f5c19068efd1c99105f761fe9) ) ROM_REGION( 0x80000, "gfx1", ROMREGION_INVERT) /* 16x16x8 Sprites */ ROM_LOAD( "yunsung.u67", 0x00000, 0x40000, CRC(5b60ce9f) SHA1(d5c091145e0bae7cd776e642ea17895d086ed2b0) ) diff --git a/src/mame/drivers/peplus.c b/src/mame/drivers/peplus.c index 033e73be66b..0f2eb061219 100644 --- a/src/mame/drivers/peplus.c +++ b/src/mame/drivers/peplus.c @@ -3995,7 +3995,7 @@ PayTable Js+ 2PR 3K STR FL FH 4K 4K 4A SF RF (Bonus) Programs Available: PP0516, X000516P & PP0540 - Non Double-up Only */ ROM_REGION( 0x10000, "maincpu", 0 ) - ROM_LOAD( "pp0516_989-974.u68", 0x00000, 0x10000, CRC(d9da6e13) SHA1(421678d9cb42daaf5b21074cc3900db914dd26cf) ) /* Game Version: 989, Library Version: 974 , Video Lib ver: A0Y*/ + ROM_LOAD( "pp0516_989-974.u68", 0x00000, 0x10000, CRC(d9da6e13) SHA1(421678d9cb42daaf5b21074cc3900db914dd26cf) ) /* Game Version: 989, Library Version: 974 , Video Lib ver: A0Y */ ROM_REGION( 0x020000, "gfx1", 0 ) ROM_LOAD( "mro-cg2003.u72", 0x00000, 0x8000, CRC(0d425f48) SHA1(b60aaf3f4bd76f75f72f6e8dda724bdf795cb521) ) /* 08/30/94 @ IGT L95-0145 */ @@ -4968,6 +4968,24 @@ Known to exist: ROM_LOAD( "cap707.u50", 0x0000, 0x0100, CRC(9851ba36) SHA1(5a0a43c1e212ae8c173102ede9c57a3d95752f99) ) ROM_END +ROM_START( pebe0014a ) /* Normal board : Blackjack (BE0014) English / Spanish - Key on Credit */ + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "be0014_533-a85.u68", 0x00000, 0x10000, CRC(0ce8d349) SHA1(72cdc39e4da0e016dea5aef707a9db5f9a7d500b) ) /* Game Version: 533, Library Version: A85 */ + + ROM_REGION( 0x020000, "gfx1", 0 ) + ROM_LOAD( "mro-cg1339.u72", 0x00000, 0x8000, NO_DUMP ) /* Needed for correct graphics for currency */ + ROM_LOAD( "mgo-cg1339.u73", 0x08000, 0x8000, NO_DUMP ) + ROM_LOAD( "mbo-cg1339.u74", 0x10000, 0x8000, NO_DUMP ) + ROM_LOAD( "mxo-cg1339.u75", 0x18000, 0x8000, NO_DUMP ) + ROM_LOAD( "mro-cg2036.u72", 0x00000, 0x8000, CRC(0a168d06) SHA1(7ed4fb5c7bcacab077bcec030f0465c6eaf3ce1c) ) + ROM_LOAD( "mgo-cg2036.u73", 0x08000, 0x8000, CRC(826b4090) SHA1(34390484c0faffe9340fd93d273b9292d09f97fd) ) + ROM_LOAD( "mbo-cg2036.u74", 0x10000, 0x8000, CRC(46aac851) SHA1(28d84b49c6cebcf2894b5a15d935618f84093caa) ) + ROM_LOAD( "mxo-cg2036.u75", 0x18000, 0x8000, CRC(60204a56) SHA1(2e3420da9e79ba304ca866d124788f84861380a7) ) + + ROM_REGION( 0x100, "proms", 0 ) + ROM_LOAD( "cap707.u50", 0x0000, 0x0100, CRC(9851ba36) SHA1(5a0a43c1e212ae8c173102ede9c57a3d95752f99) ) +ROM_END + ROM_START( peke0017 ) /* Normal board : Keno 1-10 Spot (KE0017) */ ROM_REGION( 0x10000, "maincpu", 0 ) ROM_LOAD( "ke0017_560-a07.u68", 0x00000, 0x08000, CRC(a0f70116) SHA1(15808cd3245e2e5934f3365f95590da0be552e8b) ) /* Game Version: 560, Library Version: A07 */ @@ -5382,6 +5400,30 @@ PayTable Js+ 2PR 3K STR FL FH 4K SF RF (Bonus) ROM_LOAD( "capx1321.u43", 0x0000, 0x0200, CRC(4b57569f) SHA1(fa29c0f627e7ce79951ec6dadec114864144f37d) ) ROM_END +ROM_START( pex0006p ) /* Superboard : Standard Draw Poker (X000006P+XP000038) */ +/* +PayTable Js+ 2PR 3K STR FL FH 4K SF RF (Bonus) +---------------------------------------------------------- + CB 1 2 3 4 6 9 25 50 250 1000 + % Range: 96.1-98.1% Optimum: 100.1% Hit Frequency: 45.2% + Programs Available: PP0006, X000006P +*/ + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "xp000038.u67", 0x00000, 0x10000, CRC(8707ab9e) SHA1(3e00a2ad8017e1495c6d6fe900d0efa68a1772b8) ) /* 09/05/95 @ IGT L95-2452 */ + + ROM_REGION( 0x10000, "user1", 0 ) + ROM_LOAD( "x000006p.u66", 0x00000, 0x10000, CRC(0ee609a1) SHA1(57043ac2c6ff4377479dd7b66d7e379053f3f602) ) /* Standard Draw 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_REGION( 0x200, "proms", 0 ) + ROM_LOAD( "capx1321.u43", 0x0000, 0x0200, CRC(4b57569f) SHA1(fa29c0f627e7ce79951ec6dadec114864144f37d) ) +ROM_END + ROM_START( pex0040p ) /* Superboard : Standard Draw Poker (X000040P+XP000038) */ /* PayTable Js+ 2PR 3K STR FL FH 4K SF RF (Bonus) @@ -5406,12 +5448,36 @@ PayTable Js+ 2PR 3K STR FL FH 4K SF RF (Bonus) ROM_LOAD( "capx1321.u43", 0x0000, 0x0200, CRC(4b57569f) SHA1(fa29c0f627e7ce79951ec6dadec114864144f37d) ) ROM_END +ROM_START( pex0042p ) /* Superboard : Standard Draw Poker (10's or Better) (X000042P+XP000038) */ +/* +PayTable 10s+ 2PR 3K STR FL FH 4K SF RF (Bonus) +---------------------------------------------------------- + P7A 1 1 3 4 6 9 25 50 300 800 + % Range: 86.8-88.8% Optimum: 90.8% Hit Frequency: 49.1% + Programs Available: PP0042, X000042P +*/ + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "xp000038.u67", 0x00000, 0x10000, CRC(8707ab9e) SHA1(3e00a2ad8017e1495c6d6fe900d0efa68a1772b8) ) /* 09/05/95 @ IGT L95-2452 */ + + ROM_REGION( 0x10000, "user1", 0 ) + ROM_LOAD( "x000042p.u66", 0x00000, 0x10000, CRC(7f803cb5) SHA1(f8f2974c78c63a608a536f2c72cf7ccb7d1ba0eb) ) /* Standard Draw Poker (10's or Better) */ + + 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_REGION( 0x200, "proms", 0 ) + ROM_LOAD( "capx1321.u43", 0x0000, 0x0200, CRC(4b57569f) SHA1(fa29c0f627e7ce79951ec6dadec114864144f37d) ) +ROM_END + ROM_START( pex0045p ) /* Superboard : Standard Draw Poker (10's or Better) (X000045P+XP000038) */ /* PayTable 10s+ 2PR 3K STR FL FH 4K SF RF (Bonus) ---------------------------------------------------------- P8A 1 1 3 4 5 8 25 50 300 800 - % Range: 84.6-86.6% Optimum: 98.6% Hit Frequency: 49.2% + % Range: 84.6-86.6% Optimum: 88.6% Hit Frequency: 49.2% Programs Available: PP0045, X000045P */ ROM_REGION( 0x10000, "maincpu", 0 ) @@ -6952,6 +7018,106 @@ PayTable Js+ 2PR 3K STR FL FH 4K 4K 4A SF RF (Bonus) ROM_LOAD( "capx1321.u43", 0x0000, 0x0200, CRC(4b57569f) SHA1(fa29c0f627e7ce79951ec6dadec114864144f37d) ) ROM_END +ROM_START( pex0764p ) /* Superboard : 4 of a Kind Bonus Poker (X000764P+XP000038) */ +/* + 5-K 2-4 +PayTable Js+ 2PR 3K STR FL FH 4K 4K 4A SF RF (Bonus) +------------------------------------------------------------------ + P596A 1 1 3 6 8 10 25 40 80 50 250 800 + % Range: 91.8-93.8% Optimum: 95.8% Hit Frequency: 42.3% + Programs Available: PP0764, X000764P +*/ + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "xp000038.u67", 0x00000, 0x10000, CRC(8707ab9e) SHA1(3e00a2ad8017e1495c6d6fe900d0efa68a1772b8) ) /* 09/05/95 @ IGT L95-2452 */ + + ROM_REGION( 0x10000, "user1", 0 ) + ROM_LOAD( "x000764p.u66", 0x00000, 0x10000, CRC(0a1213d7) SHA1(208262fa3e9642789dcedcd3551ad876e5390707) ) /* 4 of a Kind Bonus Poker */ + + ROM_REGION( 0x020000, "gfx1", 0 ) + ROM_LOAD( "mro-cg2275.u77", 0x00000, 0x8000, CRC(15d5d6b8) SHA1(61b6821d4cc059732bc3831bf19bf01aa3910b31) ) + ROM_LOAD( "mgo-cg2275.u78", 0x08000, 0x8000, CRC(bcb49579) SHA1(d5d9f523304582fa6f0a0c69aade77629bdec006) ) + ROM_LOAD( "mbo-cg2275.u79", 0x10000, 0x8000, CRC(9f893787) SHA1(0b79d5cbac920394d5f5c04d0d9d3727e0060366) ) + ROM_LOAD( "mxo-cg2275.u80", 0x18000, 0x8000, CRC(6187c68b) SHA1(7777b141fd1379d37d93a228b2e2159476c2b89e) ) + + ROM_REGION( 0x200, "proms", 0 ) + ROM_LOAD( "capx1321.u43", 0x0000, 0x0200, CRC(4b57569f) SHA1(fa29c0f627e7ce79951ec6dadec114864144f37d) ) +ROM_END + +ROM_START( pex2010p ) /* Superboard : Nevada Bonus Poker (X002010P+XP000038) */ +/* + 2-K +PayTable Js+ 2PR 3K 3A STR FL FH 4K 4A SF RF (Bonus) +----------------------------------------------------------------- + P503A 1 1 3 6 5 8 10 25 200 100 250 800 + % Range: 94.8-96.8% Optimum: 98.8% Hit Frequency: 42.7% + Programs Available: X002010P +*/ + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "xp000038.u67", 0x00000, 0x10000, CRC(8707ab9e) SHA1(3e00a2ad8017e1495c6d6fe900d0efa68a1772b8) ) /* 09/05/95 @ IGT L95-2452 */ + + ROM_REGION( 0x10000, "user1", 0 ) + ROM_LOAD( "x002010p.u66", 0x00000, 0x10000, CRC(1a76f22e) SHA1(a269391682d44fdaf4fd68fa3e3ca7366509ce92) ) /* Nevada Bonus 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_REGION( 0x200, "proms", 0 ) + ROM_LOAD( "capx1321.u43", 0x0000, 0x0200, CRC(4b57569f) SHA1(fa29c0f627e7ce79951ec6dadec114864144f37d) ) +ROM_END + +ROM_START( pex2016p ) /* Superboard : Fullhouse Bonus Poker (X002016P+XP000038) */ +/* + 5-K 2-4 +PayTable Js+ 2PR 3K STR FL FH 4K 4K 4A SF RF (Bonus) +----------------------------------------------------------------- + P530A 1 1 3 5 8 12 25 40 200 100 250 800 + % Range: 95.4-97.4% Optimum: 99.4% Hit Frequency: 42.5% + Programs Available: X002016P +*/ + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "xp000038.u67", 0x00000, 0x10000, CRC(8707ab9e) SHA1(3e00a2ad8017e1495c6d6fe900d0efa68a1772b8) ) /* 09/05/95 @ IGT L95-2452 */ + + ROM_REGION( 0x10000, "user1", 0 ) + ROM_LOAD( "x002016p.u66", 0x00000, 0x10000, CRC(77fcac28) SHA1(2d9ea5aea24295d74a3257a217717ddfe3b99736) ) /* Full House Bonus Poker */ + + ROM_REGION( 0x020000, "gfx1", 0 ) + ROM_LOAD( "mro-cg2275.u77", 0x00000, 0x8000, CRC(15d5d6b8) SHA1(61b6821d4cc059732bc3831bf19bf01aa3910b31) ) + ROM_LOAD( "mgo-cg2275.u78", 0x08000, 0x8000, CRC(bcb49579) SHA1(d5d9f523304582fa6f0a0c69aade77629bdec006) ) + ROM_LOAD( "mbo-cg2275.u79", 0x10000, 0x8000, CRC(9f893787) SHA1(0b79d5cbac920394d5f5c04d0d9d3727e0060366) ) + ROM_LOAD( "mxo-cg2275.u80", 0x18000, 0x8000, CRC(6187c68b) SHA1(7777b141fd1379d37d93a228b2e2159476c2b89e) ) + + ROM_REGION( 0x200, "proms", 0 ) + ROM_LOAD( "capx1321.u43", 0x0000, 0x0200, CRC(4b57569f) SHA1(fa29c0f627e7ce79951ec6dadec114864144f37d) ) +ROM_END + +ROM_START( pex2017p ) /* Superboard : Fullhouse Bonus Poker (X002017P+XP000038) */ +/* + 5-K 2-4 +PayTable Js+ 2PR 3K STR FL FH 4K 4K 4A SF RF (Bonus) +----------------------------------------------------------------- + P531A 1 1 3 5 7 12 25 40 200 100 250 800 + % Range: 93.7-95.7% Optimum: 97.7% Hit Frequency: 43.1% + Programs Available: X002017P +*/ + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "xp000038.u67", 0x00000, 0x10000, CRC(8707ab9e) SHA1(3e00a2ad8017e1495c6d6fe900d0efa68a1772b8) ) /* 09/05/95 @ IGT L95-2452 */ + + ROM_REGION( 0x10000, "user1", 0 ) + ROM_LOAD( "x002017p.u66", 0x00000, 0x10000, CRC(16ac0b5b) SHA1(9d92b66cec4cea72bf2c04677691cc7343676d6f) ) /* Full House Bonus Poker */ + + ROM_REGION( 0x020000, "gfx1", 0 ) + ROM_LOAD( "mro-cg2275.u77", 0x00000, 0x8000, CRC(15d5d6b8) SHA1(61b6821d4cc059732bc3831bf19bf01aa3910b31) ) + ROM_LOAD( "mgo-cg2275.u78", 0x08000, 0x8000, CRC(bcb49579) SHA1(d5d9f523304582fa6f0a0c69aade77629bdec006) ) + ROM_LOAD( "mbo-cg2275.u79", 0x10000, 0x8000, CRC(9f893787) SHA1(0b79d5cbac920394d5f5c04d0d9d3727e0060366) ) + ROM_LOAD( "mxo-cg2275.u80", 0x18000, 0x8000, CRC(6187c68b) SHA1(7777b141fd1379d37d93a228b2e2159476c2b89e) ) + + ROM_REGION( 0x200, "proms", 0 ) + ROM_LOAD( "capx1321.u43", 0x0000, 0x0200, CRC(4b57569f) SHA1(fa29c0f627e7ce79951ec6dadec114864144f37d) ) +ROM_END + ROM_START( pex2018p ) /* Superboard : Fullhouse Bonus Poker (X002018P+XP000038) */ /* 5-K 2-4 @@ -7155,6 +7321,31 @@ PayTable Js+ 2PR 3K STR FL FH 4K 4K 4A SF RF (Bonus) ROM_LOAD( "capx1321.u43", 0x0000, 0x0200, CRC(4b57569f) SHA1(fa29c0f627e7ce79951ec6dadec114864144f37d) ) ROM_END +ROM_START( pex2037p ) /* Superboard : Nevada Bonus Poker (X002037P+XP000038) */ +/* + 2-K +PayTable Js+ 2PR 3K 3A STR FL FH 4K 4A SF RF (Bonus) +----------------------------------------------------------------- + P575A 1 1 3 6 5 8 11 25 200 100 250 800 + % Range: 95.8-97.8% Optimum: 99.8% Hit Frequency: 42.7% + Programs Available: X002037P +*/ + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "xp000038.u67", 0x00000, 0x10000, CRC(8707ab9e) SHA1(3e00a2ad8017e1495c6d6fe900d0efa68a1772b8) ) /* 09/05/95 @ IGT L95-2452 */ + + ROM_REGION( 0x10000, "user1", 0 ) + ROM_LOAD( "x002037p.u66", 0x00000, 0x10000, CRC(12aea90e) SHA1(26ff0e7b81271252573739f26db9d20f35af274b) ) /* Nevada Bonus 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_REGION( 0x200, "proms", 0 ) + ROM_LOAD( "capx1321.u43", 0x0000, 0x0200, CRC(4b57569f) SHA1(fa29c0f627e7ce79951ec6dadec114864144f37d) ) +ROM_END + ROM_START( pex2038p ) /* Superboard : Nevada Bonus Poker (X002038P+XP000038) */ /* 2-K @@ -7180,6 +7371,31 @@ PayTable Js+ 2PR 3K 3A STR FL FH 4K 4A SF RF (Bonus) ROM_LOAD( "capx1321.u43", 0x0000, 0x0200, CRC(4b57569f) SHA1(fa29c0f627e7ce79951ec6dadec114864144f37d) ) ROM_END +ROM_START( pex2039p ) /* Superboard : Nevada Bonus Poker (X002039P+XP000038) */ +/* + 2-K +PayTable Js+ 2PR 3K 3A STR FL FH 4K 4A SF RF (Bonus) +----------------------------------------------------------------- + P577A 1 1 3 6 5 7 9 25 200 100 250 800 + % Range: 92.2-96.2% Optimum: 96.2% Hit Frequency: 43.4% + Programs Available: X002039P +*/ + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "xp000038.u67", 0x00000, 0x10000, CRC(8707ab9e) SHA1(3e00a2ad8017e1495c6d6fe900d0efa68a1772b8) ) /* 09/05/95 @ IGT L95-2452 */ + + ROM_REGION( 0x10000, "user1", 0 ) + ROM_LOAD( "x002039p.u66", 0x00000, 0x10000, CRC(98cb0d98) SHA1(ff5d7b085c8b11987c32e6639f013304b55cb2bc) ) /* Nevada Bonus 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_REGION( 0x200, "proms", 0 ) + ROM_LOAD( "capx1321.u43", 0x0000, 0x0200, CRC(4b57569f) SHA1(fa29c0f627e7ce79951ec6dadec114864144f37d) ) +ROM_END + ROM_START( pex2040p ) /* Superboard : Nevada Bonus Poker (X002040P+XP000038) */ /* 2-K @@ -7448,7 +7664,7 @@ PayTable Js+ 2PR 3K STR FL FH 4K 4K 4A SF RF RF (Bonus) % Range: 92.6-94.6% Optimum: 98.6% Hit Frequency: 45.0% Programs Available: X002111P -NOTE: Royal Flush bonus is 800 times max bet, Sequential Royal Flush is 10000 times max bet +NOTE: Royal Flush bonus is 800 x MAX bet, Sequential Royal Flush is 10000 x MAX bet */ ROM_REGION( 0x10000, "maincpu", 0 ) ROM_LOAD( "xp000038.u67", 0x00000, 0x10000, CRC(8707ab9e) SHA1(3e00a2ad8017e1495c6d6fe900d0efa68a1772b8) ) /* 09/05/95 @ IGT L95-2452 */ @@ -7716,6 +7932,30 @@ PayTable Js+ 2PR 3K STR FL FH 4K SF RF (Bonus) ROM_LOAD( "capx1321.u43", 0x0000, 0x0200, CRC(4b57569f) SHA1(fa29c0f627e7ce79951ec6dadec114864144f37d) ) ROM_END +ROM_START( pex2247p ) /* Superboard : Standard Draw Poker (X002247P+XP000038) */ +/* +PayTable Js+ 2PR 3K STR FL FH 4K SF RF (Bonus) +---------------------------------------------------------- + CD 1 2 3 4 6 9 25 50 250 940 + % Range: 95.9-97.9% Optimum: 99.9% Hit Frequency: 45.3% + Programs Available: X002247P +*/ + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "xp000038.u67", 0x00000, 0x10000, CRC(8707ab9e) SHA1(3e00a2ad8017e1495c6d6fe900d0efa68a1772b8) ) /* 09/05/95 @ IGT L95-2452 */ + + ROM_REGION( 0x10000, "user1", 0 ) + ROM_LOAD( "x002247p.u66", 0x00000, 0x10000, CRC(41aecb1a) SHA1(d4c5388b66b003e7f4449963d86f6b20f1954193) ) /* Standard Draw 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_REGION( 0x200, "proms", 0 ) + ROM_LOAD( "capx1321.u43", 0x0000, 0x0200, CRC(4b57569f) SHA1(fa29c0f627e7ce79951ec6dadec114864144f37d) ) +ROM_END + ROM_START( pex2250p ) /* Superboard : Shockwave Poker (X002250P+XP000050) */ /* PayTable Js+ 2PR 3K STR FL FH 4K* SF RF (Bonus) @@ -8083,7 +8323,7 @@ ROM_START( pex2314p ) /* Superboard : Triple Bonus Poker Plus (X002314P+XP000112 5-K 2-4 PayTable Js+ 2PR 3K STR FL FH 4K 4K 4A SF RF (Bonus) ----------------------------------------------------------------- - P903A 1 1 3 4 5 6 50 120 240 100 250 800 + P919BA 1 1 3 4 5 6 50 120 240 100 250 800 % Range: 92.6-94.6% Optimum: 96.6% Hit Frequency: 44.7% Programs Available: X002314P */ @@ -8153,6 +8393,31 @@ PayTable Js+ 2PR 3K STR FL FH 4K 4K 4K 4A SF RF (Bonus) ROM_LOAD( "capx1321.u43", 0x0000, 0x0200, CRC(4b57569f) SHA1(fa29c0f627e7ce79951ec6dadec114864144f37d) ) ROM_END +ROM_START( pex2386p ) /* Superboard : 4 of a Kind Bonus Poker (X002386P+XP000038) */ +/* + 5-K 2-4 +PayTable Js+ 2PR 3K STR FL FH 4K 4K 4A SF RF (Bonus) +------------------------------------------------------------------ + ???? 1 2 3 4 5 7 25 40 80 50 500 500 + % Range: 93.3-95.3% Optimum: 97.3% Hit Frequency: 42.7% + Programs Available: X002386P +*/ + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "xp000038.u67", 0x00000, 0x10000, CRC(8707ab9e) SHA1(3e00a2ad8017e1495c6d6fe900d0efa68a1772b8) ) /* 09/05/95 @ IGT L95-2452 */ + + ROM_REGION( 0x10000, "user1", 0 ) + ROM_LOAD( "x002386p.u66", 0x00000, 0x10000, CRC(3b2731e4) SHA1(aefe0fc2c2baf653cf3dc0e1394afbb55fb18f61) ) /* 4 of a Kind Bonus Poker */ + + ROM_REGION( 0x020000, "gfx1", 0 ) + ROM_LOAD( "mro-cg2275.u77", 0x00000, 0x8000, CRC(15d5d6b8) SHA1(61b6821d4cc059732bc3831bf19bf01aa3910b31) ) + ROM_LOAD( "mgo-cg2275.u78", 0x08000, 0x8000, CRC(bcb49579) SHA1(d5d9f523304582fa6f0a0c69aade77629bdec006) ) + ROM_LOAD( "mbo-cg2275.u79", 0x10000, 0x8000, CRC(9f893787) SHA1(0b79d5cbac920394d5f5c04d0d9d3727e0060366) ) + ROM_LOAD( "mxo-cg2275.u80", 0x18000, 0x8000, CRC(6187c68b) SHA1(7777b141fd1379d37d93a228b2e2159476c2b89e) ) + + ROM_REGION( 0x200, "proms", 0 ) + ROM_LOAD( "capx1321.u43", 0x0000, 0x0200, CRC(4b57569f) SHA1(fa29c0f627e7ce79951ec6dadec114864144f37d) ) +ROM_END + ROM_START( pex2419p ) /* Superboard : Deuces Wild Bonus Poker - French (X002419P+XP000064) */ /* Same payouts as X002027P English Deuces Wild Bonus Poker: @@ -8988,8 +9253,9 @@ Jacks or Better P11A 96.10% Joker Poker P17A 95.50% */ ROM_REGION( 0x10000, "maincpu", 0 ) - ROM_LOAD( "xmp00025.u67", 0x00000, 0x10000, CRC(5d39ff71) SHA1(0a5f67e61ae0e8a08cc551ab4271ffc97c343ae3) ) - + 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) ) @@ -9410,6 +9676,7 @@ GAMEL(1994, pemg0252, 0, peplus, peplus_poker, peplus_state, peplus, /* Normal board : Blackjack */ GAMEL(1994, pebe0014, 0, peplus, peplus_bjack, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (BE0014) Blackjack", 0, layout_pe_bjack ) +GAMEL(1994, pebe0014a, pebe0014, peplus, peplus_bjack, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (BE0014) Blackjack (International English/Spanish)", GAME_IMPERFECT_GRAPHICS, layout_pe_bjack ) /* Needs CG1339 graphics roms */ /* Normal board : Keno */ GAMEL(1994, peke0017, 0, peplus, peplus_keno, peplus_state, nonplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (KE0017) Keno", GAME_NOT_WORKING, layout_pe_keno ) @@ -9444,7 +9711,9 @@ GAMEL(1996, peps0716, 0, peplus, peplus_slots, peplus_state, peplus, /* Superboard : Poker */ GAMEL(1995, pex0002p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X000002P+XP000038) Standard Draw Poker", 0, layout_pe_poker ) GAMEL(1995, pex0002pa, pex0002p, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X000002P+XP000109) Standard Draw Poker", 0, layout_pe_poker ) +GAMEL(1995, pex0006p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X000006P+XP000038) Standard Draw Poker", 0, layout_pe_poker ) GAMEL(1995, pex0040p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X000040P+XP000038) Standard Draw Poker", 0, layout_pe_poker ) +GAMEL(1995, pex0042p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X000042P+XP000038) 10's or Better", 0, layout_pe_poker ) GAMEL(1995, pex0045p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X000045P+XP000038) 10's or Better", 0, layout_pe_poker ) GAMEL(1995, pex0046p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X000046P+XP000038) 10's or Better", 0, layout_pe_poker ) GAMEL(1995, pex0053p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X000053P+XP000038) Joker Poker (Aces or Better)", 0, layout_pe_poker ) @@ -9507,6 +9776,10 @@ GAMEL(1995, pex0725p, 0, peplus, peplus_poker, peplus_state, peplussb, GAMEL(1995, pex0726p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X000726P+XP000038) Double Bonus Poker", 0, layout_pe_poker ) GAMEL(1995, pex0727p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X000727P+XP000038) Double Bonus Poker", 0, layout_pe_poker ) GAMEL(1995, pex0763p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X000763P+XP000038) 4 of a Kind Bonus Poker", 0,layout_pe_poker ) +GAMEL(1995, pex0764p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X000764P+XP000038) 4 of a Kind Bonus Poker", 0,layout_pe_poker ) +GAMEL(1995, pex2010p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X002010P+XP000038) Nevada Bonus Poker", 0, layout_pe_poker ) +GAMEL(1995, pex2016p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X002016P+XP000038) Full House Bonus Poker", 0, layout_pe_poker ) +GAMEL(1995, pex2017p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X002017P+XP000038) Full House Bonus Poker", 0, layout_pe_poker ) GAMEL(1995, pex2018p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X002018P+XP000038) Full House Bonus Poker", 0, layout_pe_poker ) GAMEL(1995, pex2025p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X002025P+XP000019) Deuces Wild Bonus Poker", 0, layout_pe_poker ) GAMEL(1995, pex2026p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X002026P+XP000019) Deuces Wild Bonus Poker", 0, layout_pe_poker ) @@ -9515,7 +9788,9 @@ GAMEL(1995, pex2029p, 0, peplus, peplus_poker, peplus_state, peplussb, GAMEL(1995, pex2031p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X002031P+XP000112) Lucky Deal Poker", 0, layout_pe_poker ) GAMEL(1995, pex2035p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X002035P+XP000112) White Hot Aces Poker", 0, layout_pe_poker ) GAMEL(1995, pex2036p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X002036P+XP000112) White Hot Aces Poker", 0, layout_pe_poker ) +GAMEL(1995, pex2037p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X002037P+XP000038) Nevada Bonus Poker", 0, layout_pe_poker ) GAMEL(1995, pex2038p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X002038P+XP000038) Nevada Bonus Poker", 0, layout_pe_poker ) +GAMEL(1995, pex2039p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X002039P+XP000038) Nevada Bonus Poker", 0, layout_pe_poker ) GAMEL(1995, pex2040p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X002040P+XP000038) Nevada Bonus Poker", 0, layout_pe_poker ) GAMEL(1995, pex2042p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X002042P+XP000038) Triple Bonus Poker", 0, layout_pe_poker ) GAMEL(1995, pex2043p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X002043P+XP000038) Triple Bonus Poker", 0, layout_pe_poker ) @@ -9537,6 +9812,7 @@ GAMEL(1995, pex2241p, 0, peplus, peplus_poker, peplus_state, peplussb, GAMEL(1995, pex2244p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X002244P+XP000079) Double Bonus Poker", 0, layout_pe_poker ) GAMEL(1995, pex2245p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X002245P+XP000055) Standard Draw Poker", 0,layout_pe_poker ) GAMEL(1995, pex2245pa, pex2245p, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X002245P+XP000079) Standard Draw Poker", 0,layout_pe_poker ) +GAMEL(1995, pex2247p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X002247P+XP000038) Standard Draw Poker", 0, layout_pe_poker ) GAMEL(1995, pex2250p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X002250P+XP000050) Shockwave Poker", 0, layout_pe_poker ) GAMEL(1995, pex2251p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X002251P+XP000050) Shockwave Poker", 0, layout_pe_poker ) GAMEL(1995, pex2272p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X002272P+XP000055) Black Jack Bonus Poker", 0, layout_pe_poker ) @@ -9553,6 +9829,7 @@ GAMEL(1995, pex2310p, 0, peplus, peplus_poker, peplus_state, peplussb, GAMEL(1995, pex2314p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X002314P+XP000112) Triple Bonus Poker Plus", 0, layout_pe_poker ) GAMEL(1995, pex2374p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X002374P+XP000112) Super Aces Poker", 0, layout_pe_poker ) GAMEL(1995, pex2377p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X002377P+XP000112) Super Double Bonus Poker", 0, layout_pe_poker ) +GAMEL(1995, pex2386p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X002386P+XP000038) 4 of a Kind Bonus Poker", 0,layout_pe_poker ) GAMEL(1995, pex2419p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X002419P+XP000064) Deuces Wild Bonus Poker - French", 0, layout_pe_poker ) GAMEL(1995, pex2420p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X002420P+XP000064) Deuces Wild Bonus Poker - French", 0, layout_pe_poker ) GAMEL(1995, pex2421p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X002421P+XP000064) Deuces Wild Bonus Poker - French", 0, layout_pe_poker ) diff --git a/src/mame/drivers/pinball2k.c b/src/mame/drivers/pinball2k.c index 71c16c3f2b1..e523a0fa44f 100644 --- a/src/mame/drivers/pinball2k.c +++ b/src/mame/drivers/pinball2k.c @@ -5,12 +5,11 @@ TODO: - Everything! - - BIOS hangs waiting for port 0400h to return 0x80. If you make that happy it jumps off into the weeds. - MediaGX features should be moved out to machine/ and shared with mediagx.c once we know what these games need Hardware: - - Cyrix MediaGX processor/VGA - - Cyrix CX5520 northbridge? + - Cyrix MediaGX processor/VGA (northbridge) + - Cyrix CX5520 (southbridge) - VS9824AG SuperI/O standard PC I/O chip - 1 ISA, 2 PCI slots, 2 IDE headers - "Prism" PCI card with PLX PCI9052 PCI-to-random stuff bridge @@ -83,6 +82,10 @@ public: DECLARE_WRITE32_MEMBER(ad1847_w); DECLARE_READ8_MEMBER(io20_r); DECLARE_WRITE8_MEMBER(io20_w); + DECLARE_READ32_MEMBER(port400_r); + DECLARE_WRITE32_MEMBER(port400_w); + DECLARE_READ32_MEMBER(port800_r); + DECLARE_WRITE32_MEMBER(port800_w); DECLARE_DRIVER_INIT(pinball2k); virtual void machine_start(); virtual void machine_reset(); @@ -415,6 +418,24 @@ WRITE8_MEMBER(pinball2k_state::io20_w) } } +READ32_MEMBER(pinball2k_state::port400_r) +{ + return 0x8000; +} + +WRITE32_MEMBER(pinball2k_state::port400_w) +{ +} + +READ32_MEMBER(pinball2k_state::port800_r) +{ + return 0x80; +} + +WRITE32_MEMBER(pinball2k_state::port800_w) +{ +} + READ32_MEMBER(pinball2k_state::parallel_port_r) { UINT32 r = 0; @@ -467,6 +488,8 @@ static ADDRESS_MAP_START(mediagx_io, AS_IO, 32, pinball2k_state ) AM_IMPORT_FROM(pcat32_io_common) AM_RANGE(0x00e8, 0x00eb) AM_NOP // I/O delay port AM_RANGE(0x0378, 0x037b) AM_READWRITE(parallel_port_r, parallel_port_w) + AM_RANGE(0x0400, 0x0403) AM_READWRITE(port400_r, port400_w) + AM_RANGE(0x0800, 0x0803) AM_READWRITE(port800_r, port800_w) AM_RANGE(0x0cf8, 0x0cff) AM_DEVREADWRITE("pcibus", pci_bus_legacy_device, read, write) ADDRESS_MAP_END diff --git a/src/mame/drivers/psikyo.c b/src/mame/drivers/psikyo.c index e94c6b2c122..a53c7788fdf 100644 --- a/src/mame/drivers/psikyo.c +++ b/src/mame/drivers/psikyo.c @@ -1406,6 +1406,40 @@ ROM_START( btlkroad ) ROM_END + +ROM_START( btlkroadk ) + + ROM_REGION( 0x100000, "maincpu", 0 ) /* Main CPU Code */ + ROM_LOAD32_WORD_SWAP( "4(dot).u46", 0x000000, 0x040000, CRC(e724d429) SHA1(8b5f80366fd22d6f7e7d8a9623de4fe231303267) ) // 1&0 + ROM_LOAD32_WORD_SWAP( "5(dot).u39", 0x000002, 0x040000, CRC(c0d65765) SHA1(a6a26e6b9693a2ef245e9aaa4c9daa888aebb360)) // 3&2 + + ROM_REGION( 0x020000, "audiocpu", 0 ) /* Sound CPU Code */ + ROM_LOAD( "3(k).u71", 0x00000, 0x20000, CRC(e0f0c597) SHA1(cc337633f1f579baf0f8ba1dd65c5d51122a7e97) ) + + ROM_REGION( 0x700000, "gfx1", 0 ) /* Sprites */ + ROM_LOAD( "u14.bin", 0x000000, 0x200000, CRC(282d89c3) SHA1(3b4b17f4a37efa2f7e232488aaba7c77d10c84d2) ) + ROM_LOAD( "u24.bin", 0x200000, 0x200000, CRC(bbe9d3d1) SHA1(9da0b0b993e8271a8119e9c2f602e52325983f79) ) + ROM_LOAD( "u15.bin", 0x400000, 0x200000, CRC(d4d1b07c) SHA1(232109db8f6e137fbc8826f38a96057067cb19dc) ) +// ROM_LOAD( "u25.bin", 0x600000, 0x100000 NOT PRESENT + + ROM_REGION( 0x200000, "gfx2", 0 ) /* Layers 0 + 1 */ + ROM_LOAD( "u33.bin", 0x000000, 0x200000, CRC(4c8577f1) SHA1(d27043514632954a06667ac63f4a4e4a31870511) ) + + ROM_REGION( 0x100000, "ymsnd", 0 ) /* ADPCM Samples */ + ROM_LOAD( "u56.bin", 0x000000, 0x100000, CRC(51d73682) SHA1(562038d08e9a4389ffa39f3a659b2a29b94dc156) ) + + ROM_REGION( 0x080000, "ymsnd.deltat", 0 ) /* DELTA-T Samples */ + ROM_LOAD( "u64.bin", 0x000000, 0x080000, CRC(0f33049f) SHA1(ca4fd5f3906685ace1af40b75f5678231d7324e8) ) + + ROM_REGION( 0x040000, "spritelut", 0 ) /* Sprites LUT */ + ROM_LOAD( "u3.bin", 0x000000, 0x040000, CRC(30d541ed) SHA1(6f7fb5f5ecbce7c086185392de164ebb6887e780) ) + + ROM_REGION( 0x0400, "plds", 0 ) + ROM_LOAD( "tibpal16l8.u69", 0x0000, 0x0104, NO_DUMP ) /* PAL is read protected */ + ROM_LOAD( "tibpal16l8.u19", 0x0200, 0x0104, NO_DUMP ) /* PAL is read protected */ + +ROM_END + /*************************************************************************** Strikers 1945 (Japan, unprotected) @@ -1956,18 +1990,22 @@ DRIVER_INIT_MEMBER(psikyo_state,s1945bl) ***************************************************************************/ -/* Working Games */ GAME( 1993, samuraia, 0, sngkace, samuraia, psikyo_state, sngkace, ROT270, "Psikyo", "Samurai Aces (World)", GAME_SUPPORTS_SAVE ) // Banpresto? GAME( 1993, sngkace, samuraia, sngkace, sngkace, psikyo_state, sngkace, ROT270, "Psikyo", "Sengoku Ace (Japan)", GAME_SUPPORTS_SAVE ) // Banpresto? + GAME( 1994, gunbird, 0, gunbird, gunbird, psikyo_state, gunbird, ROT270, "Psikyo", "Gunbird (World)", GAME_SUPPORTS_SAVE ) GAME( 1994, gunbirdk, gunbird, gunbird, gunbirdj, psikyo_state, gunbird, ROT270, "Psikyo", "Gunbird (Korea)", GAME_SUPPORTS_SAVE ) GAME( 1994, gunbirdj, gunbird, gunbird, gunbirdj, psikyo_state, gunbird, ROT270, "Psikyo", "Gunbird (Japan)", GAME_SUPPORTS_SAVE ) + GAME( 1994, btlkroad, 0, gunbird, btlkroad, psikyo_state, gunbird, ROT0, "Psikyo", "Battle K-Road", GAME_SUPPORTS_SAVE ) +GAME( 1994, btlkroadk, btlkroad,gunbird, btlkroad, psikyo_state, gunbird, ROT0, "Psikyo", "Battle K-Road (Korean PCB)", GAME_SUPPORTS_SAVE ) // game code is still multi-region, but sound rom appears to be Korea specific at least + GAME( 1995, s1945, 0, s1945, s1945, psikyo_state, s1945, ROT270, "Psikyo", "Strikers 1945 (World)", GAME_SUPPORTS_SAVE ) GAME( 1995, s1945a, s1945, s1945, s1945a, psikyo_state, s1945a, ROT270, "Psikyo", "Strikers 1945 (Japan / World)", GAME_SUPPORTS_SAVE ) // Region dip - 0x0f=Japan, anything else=World GAME( 1995, s1945j, s1945, s1945, s1945j, psikyo_state, s1945j, ROT270, "Psikyo", "Strikers 1945 (Japan)", GAME_SUPPORTS_SAVE ) GAME( 1995, s1945jn, s1945, gunbird, s1945j, psikyo_state, s1945jn, ROT270, "Psikyo", "Strikers 1945 (Japan, unprotected)", GAME_SUPPORTS_SAVE ) GAME( 1995, s1945k, s1945, s1945, s1945j, psikyo_state, s1945, ROT270, "Psikyo", "Strikers 1945 (Korea)", GAME_SUPPORTS_SAVE ) GAME( 1995, s1945bl, s1945, s1945bl, s1945bl, psikyo_state, s1945bl, ROT270, "bootleg","Strikers 1945 (Hong Kong, bootleg)", GAME_SUPPORTS_SAVE ) + GAME( 1996, tengai, 0, s1945, tengai, psikyo_state, tengai, ROT0, "Psikyo", "Tengai (World)", GAME_SUPPORTS_SAVE ) GAME( 1996, tengaij, tengai, s1945, tengaij, psikyo_state, tengai, ROT0, "Psikyo", "Sengoku Blade: Sengoku Ace Episode II / Tengai", GAME_SUPPORTS_SAVE ) // Region dip - 0x0f=Japan, anything else=World diff --git a/src/mame/drivers/queen.c b/src/mame/drivers/queen.c index 25329d10b2a..2c723affe8d 100644 --- a/src/mame/drivers/queen.c +++ b/src/mame/drivers/queen.c @@ -151,9 +151,13 @@ static void intel82439tx_pci_w(device_t *busdevice, device_t *device, int functi static UINT8 piix4_config_r(device_t *busdevice, device_t *device, int function, int reg) { + if ((function >= 4) && (function <= 7)) + { + return 0; // BIOS performs a brute-force scan for devices + } + queen_state *state = busdevice->machine().driver_data(); // osd_printf_debug("PIIX4: read %d, %02X\n", function, reg); - assert(function >= 0 && function < ARRAY_LENGTH(state->m_piix4_config_reg)); return state->m_piix4_config_reg[function][reg]; } diff --git a/src/mame/drivers/re900.c b/src/mame/drivers/re900.c index 748c27d9c62..1c2cb63a56b 100644 --- a/src/mame/drivers/re900.c +++ b/src/mame/drivers/re900.c @@ -87,26 +87,33 @@ class re900_state : public driver_device public: re900_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), - m_rom(*this, "rom"), - m_maincpu(*this, "maincpu") { } + m_maincpu(*this, "maincpu"), + m_rom(*this, "rom") { } + + required_device m_maincpu; required_shared_ptr m_rom; + + // re900 specific UINT8 m_psg_pa; UINT8 m_psg_pb; UINT8 m_mux_data; 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(re900_watchdog_reset_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_WRITE_LINE_MEMBER(vdp_interrupt); + DECLARE_DRIVER_INIT(re900); - required_device m_maincpu; }; @@ -219,7 +226,7 @@ WRITE8_MEMBER(re900_state::cpu_port_0_w) // output_set_lamp_value(8,1 ^ ( (data >> 5) & 1)); /* Cont. Ent */ } -WRITE8_MEMBER(re900_state::re900_watchdog_reset_w) +WRITE8_MEMBER(re900_state::watchdog_reset_w) { //watchdog_reset_w(space,0,0); /* To do! */ } @@ -240,19 +247,13 @@ static ADDRESS_MAP_START( mem_io, AS_IO, 8, re900_state ) AM_RANGE(0xe001, 0xe001) AM_DEVWRITE("tms9128", tms9928a_device, register_write) AM_RANGE(0xe800, 0xe801) AM_DEVWRITE("ay_re900", ay8910_device, address_data_w) AM_RANGE(0xe802, 0xe802) AM_DEVREAD("ay_re900", ay8910_device, data_r) - AM_RANGE(0xe000, 0xefff) AM_WRITE(re900_watchdog_reset_w) + AM_RANGE(0xe000, 0xefff) AM_WRITE(watchdog_reset_w) AM_RANGE(MCS51_PORT_P0, MCS51_PORT_P0) AM_WRITE(cpu_port_0_w) AM_RANGE(MCS51_PORT_P2, MCS51_PORT_P2) AM_NOP AM_RANGE(MCS51_PORT_P3, MCS51_PORT_P3) AM_NOP ADDRESS_MAP_END -WRITE_LINE_MEMBER(re900_state::vdp_interrupt) -{ - m_maincpu->set_input_line(INPUT_LINE_NMI, state ? ASSERT_LINE : CLEAR_LINE ); -} - - /************************ * Input ports * ************************/ @@ -380,7 +381,7 @@ static MACHINE_CONFIG_START( re900, re900_state ) /* video hardware */ MCFG_DEVICE_ADD( "tms9128", TMS9128, XTAL_10_738635MHz / 2 ) /* TMS9128NL on the board */ MCFG_TMS9928A_VRAM_SIZE(0x4000) - MCFG_TMS9928A_OUT_INT_LINE_CB(WRITELINE(re900_state, vdp_interrupt)) + MCFG_TMS9928A_OUT_INT_LINE_CB(INPUTLINE("maincpu", INPUT_LINE_NMI)) MCFG_TMS9928A_SCREEN_ADD_NTSC( "screen" ) MCFG_SCREEN_UPDATE_DEVICE( "tms9128", tms9128_device, screen_update ) @@ -431,6 +432,13 @@ 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)); + save_item(NAME(m_ledant)); + save_item(NAME(m_player)); + save_item(NAME(m_stat_a)); } @@ -439,5 +447,5 @@ DRIVER_INIT_MEMBER(re900_state,re900) *************************/ /* YEAR NAME PARENT MACHINE INPUT INIT ROT COMPANY FULLNAME FLAGS LAYOUT */ -GAMEL( 1993, re900, 0, re900, re900, re900_state, re900, ROT90, "Entretenimientos GEMINIS", "Ruleta RE-900", 0, layout_re900) -GAME ( 1994, bs94 , 0, bs94, bs94 , re900_state, re900, ROT0, "Entretenimientos GEMINIS", "Buena Suerte '94", 0) +GAMEL( 1993, re900, 0, re900, re900, re900_state, re900, ROT90, "Entretenimientos GEMINIS", "Ruleta RE-900", GAME_SUPPORTS_SAVE, layout_re900) +GAME ( 1994, bs94 , 0, bs94, bs94 , driver_device, 0, ROT0, "Entretenimientos GEMINIS", "Buena Suerte '94", GAME_SUPPORTS_SAVE ) diff --git a/src/mame/drivers/realbrk.c b/src/mame/drivers/realbrk.c index 9c0ef1a393e..3b8a0eb77f0 100644 --- a/src/mame/drivers/realbrk.c +++ b/src/mame/drivers/realbrk.c @@ -36,7 +36,7 @@ To Do: - Priorities (e.g during the intro, there are two black bands in the backround that should obscure sprites). -- Sometimes sprites are shrinked to end up overlapping the background image +- Sometimes sprites are shrunk to end up overlapping the background image in the tilemaps, but they are a few pixels off ***************************************************************************/ @@ -155,10 +155,10 @@ static ADDRESS_MAP_START( base_mem, AS_PROGRAM, 16, realbrk_state ) AM_RANGE(0x000000, 0x0fffff) AM_ROM // ROM AM_RANGE(0x200000, 0x203fff) AM_RAM AM_SHARE("spriteram") // Sprites AM_RANGE(0x400000, 0x40ffff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette") // Palette - AM_RANGE(0x600000, 0x601fff) AM_RAM_WRITE(realbrk_vram_0_w) AM_SHARE("vram_0") // Background (0) - AM_RANGE(0x602000, 0x603fff) AM_RAM_WRITE(realbrk_vram_1_w) AM_SHARE("vram_1") // Background (1) - AM_RANGE(0x604000, 0x604fff) AM_RAM_WRITE(realbrk_vram_2_w) AM_SHARE("vram_2") // Text (2) - AM_RANGE(0x606000, 0x60600f) AM_RAM_WRITE(realbrk_vregs_w) AM_SHARE("vregs") // Scroll + Video Regs + AM_RANGE(0x600000, 0x601fff) AM_RAM_WRITE(vram_0_w) AM_SHARE("vram_0") // Background (0) + AM_RANGE(0x602000, 0x603fff) AM_RAM_WRITE(vram_1_w) AM_SHARE("vram_1") // Background (1) + AM_RANGE(0x604000, 0x604fff) AM_RAM_WRITE(vram_2_w) AM_SHARE("vram_2") // Text (2) + AM_RANGE(0x606000, 0x60600f) AM_RAM_WRITE(vregs_w) AM_SHARE("vregs") // Scroll + Video Regs AM_RANGE(0x605000, 0x61ffff) AM_RAM // AM_RANGE(0x800000, 0x800003) AM_DEVREADWRITE8("ymz", ymz280b_device, read, write, 0xff00) // YMZ280 AM_RANGE(0xfe0000, 0xfeffff) AM_RAM // RAM @@ -744,7 +744,7 @@ GFXDECODE_END Billiard Academy Real Break ***************************************************************************/ -INTERRUPT_GEN_MEMBER(realbrk_state::realbrk_interrupt) +INTERRUPT_GEN_MEMBER(realbrk_state::interrupt) { /* VBlank is connected to INT1 (external interrupts pin 1) */ m_tmp68301->external_interrupt_1(); @@ -755,7 +755,7 @@ static MACHINE_CONFIG_START( realbrk, realbrk_state ) /* basic machine hardware */ MCFG_CPU_ADD("maincpu",M68000, XTAL_32MHz / 2) /* !! TMP68301 !! */ MCFG_CPU_PROGRAM_MAP(realbrk_mem) - MCFG_CPU_VBLANK_INT_DRIVER("screen", realbrk_state, realbrk_interrupt) + MCFG_CPU_VBLANK_INT_DRIVER("screen", realbrk_state, interrupt) MCFG_CPU_IRQ_ACKNOWLEDGE_DEVICE("tmp68301",tmp68301_device,irq_callback) MCFG_DEVICE_ADD("tmp68301", TMP68301, 0) @@ -767,7 +767,7 @@ static MACHINE_CONFIG_START( realbrk, realbrk_state ) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) MCFG_SCREEN_SIZE(0x140, 0xe0) MCFG_SCREEN_VISIBLE_AREA(0, 0x140-1, 0, 0xe0-1) - MCFG_SCREEN_UPDATE_DRIVER(realbrk_state, screen_update_realbrk) + MCFG_SCREEN_UPDATE_DRIVER(realbrk_state, screen_update) MCFG_SCREEN_PALETTE("palette") MCFG_GFXDECODE_ADD("gfxdecode", "palette", realbrk) @@ -1273,13 +1273,13 @@ ROM_START( dai2kaku_alt_rom_size ) ROM_END #endif -GAME( 1998, pkgnsh, 0, pkgnsh, pkgnsh, driver_device, 0, ROT0, "Nakanihon / Dynax", "Pachinko Gindama Shoubu (Japan)", GAME_IMPERFECT_GRAPHICS ) +GAME( 1998, pkgnsh, 0, pkgnsh, pkgnsh, driver_device, 0, ROT0, "Nakanihon / Dynax", "Pachinko Gindama Shoubu (Japan)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) -GAME( 1998, pkgnshdx, 0, pkgnshdx, pkgnshdx, driver_device, 0, ROT0, "Nakanihon / Dynax", "Pachinko Gindama Shoubu DX (Japan)", GAME_IMPERFECT_GRAPHICS ) +GAME( 1998, pkgnshdx, 0, pkgnshdx, pkgnshdx, driver_device, 0, ROT0, "Nakanihon / Dynax", "Pachinko Gindama Shoubu DX (Japan)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) -GAME( 1998, realbrk, 0, realbrk, realbrk, driver_device, 0, ROT0, "Nakanihon", "Billiard Academy Real Break (Europe)", GAME_IMPERFECT_GRAPHICS ) -GAME( 1998, realbrko, realbrk, realbrk, realbrk, driver_device, 0, ROT0, "Nakanihon", "Billiard Academy Real Break (Europe, older)", GAME_IMPERFECT_GRAPHICS ) -GAME( 1998, realbrkj, realbrk, realbrk, realbrk, driver_device, 0, ROT0, "Nakanihon", "Billiard Academy Real Break (Japan)", GAME_IMPERFECT_GRAPHICS ) -GAME( 1998, realbrkk, realbrk, realbrk, realbrk, driver_device, 0, ROT0, "Nakanihon", "Billiard Academy Real Break (Korea)", GAME_IMPERFECT_GRAPHICS ) +GAME( 1998, realbrk, 0, realbrk, realbrk, driver_device, 0, ROT0, "Nakanihon", "Billiard Academy Real Break (Europe)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) +GAME( 1998, realbrko, realbrk, realbrk, realbrk, driver_device, 0, ROT0, "Nakanihon", "Billiard Academy Real Break (Europe, older)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) +GAME( 1998, realbrkj, realbrk, realbrk, realbrk, driver_device, 0, ROT0, "Nakanihon", "Billiard Academy Real Break (Japan)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) +GAME( 1998, realbrkk, realbrk, realbrk, realbrk, driver_device, 0, ROT0, "Nakanihon", "Billiard Academy Real Break (Korea)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) -GAME( 2004, dai2kaku, 0, dai2kaku, dai2kaku, driver_device, 0, ROT0, "SystemBit", "Dai-Dai-Kakumei (Japan)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) +GAME( 2004, dai2kaku, 0, dai2kaku, dai2kaku, driver_device, 0, ROT0, "SystemBit", "Dai-Dai-Kakumei (Japan)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE ) diff --git a/src/mame/drivers/rltennis.c b/src/mame/drivers/rltennis.c index 26019dce032..40f3558cddc 100644 --- a/src/mame/drivers/rltennis.c +++ b/src/mame/drivers/rltennis.c @@ -69,17 +69,17 @@ player - when there's nothing to play - first, empty 2k of ROMs are selected. #define RLT_TIMER_FREQ (RLT_REFRESH_RATE*256) #define RLT_XTAL XTAL_12MHz -READ16_MEMBER(rltennis_state::rlt_io_r) +READ16_MEMBER(rltennis_state::io_r) { return (ioport("P1" )->read()&0x1fff) | (m_unk_counter<<13); /* top 3 bits controls smaple address update */ } -WRITE16_MEMBER(rltennis_state::rlt_snd1_w) +WRITE16_MEMBER(rltennis_state::snd1_w) { COMBINE_DATA(&m_data760000); } -WRITE16_MEMBER(rltennis_state::rlt_snd2_w) +WRITE16_MEMBER(rltennis_state::snd2_w) { COMBINE_DATA(&m_data740000); } @@ -88,15 +88,15 @@ static ADDRESS_MAP_START( rltennis_main, AS_PROGRAM, 16, rltennis_state ) AM_RANGE(0x000000, 0x0fffff) AM_ROM AM_RANGE(0x100000, 0x10ffff) AM_RAM AM_SHARE("nvram") AM_RANGE(0x200000, 0x20ffff) AM_RAM - AM_RANGE(0x700000, 0x70000f) AM_WRITE(rlt_blitter_w) + AM_RANGE(0x700000, 0x70000f) AM_WRITE(blitter_w) AM_RANGE(0x720000, 0x720001) AM_DEVWRITE8("ramdac",ramdac_device,index_w,0x00ff) AM_RANGE(0x720002, 0x720003) AM_DEVREADWRITE8("ramdac",ramdac_device,pal_r,pal_w,0x00ff) AM_RANGE(0x720006, 0x720007) AM_DEVWRITE8("ramdac",ramdac_device,index_r_w,0x00ff) - AM_RANGE(0x740000, 0x740001) AM_WRITE(rlt_snd1_w) - AM_RANGE(0x760000, 0x760001) AM_WRITE(rlt_snd2_w) + AM_RANGE(0x740000, 0x740001) AM_WRITE(snd1_w) + AM_RANGE(0x760000, 0x760001) AM_WRITE(snd2_w) AM_RANGE(0x780000, 0x780001) AM_WRITENOP /* sound control, unknown, usually = 0x0044 */ AM_RANGE(0x7a0000, 0x7a0003) AM_READNOP /* unknown, read only at boot time*/ - AM_RANGE(0x7e0000, 0x7e0001) AM_READ(rlt_io_r) + AM_RANGE(0x7e0000, 0x7e0001) AM_READ(io_r) AM_RANGE(0x7e0002, 0x7e0003) AM_READ_PORT("P2") ADDRESS_MAP_END @@ -144,7 +144,7 @@ TIMER_CALLBACK_MEMBER(rltennis_state::sample_player) m_timer->adjust(attotime::from_hz( RLT_TIMER_FREQ )); } -INTERRUPT_GEN_MEMBER(rltennis_state::rltennis_interrupt) +INTERRUPT_GEN_MEMBER(rltennis_state::interrupt) { ++m_unk_counter; /* frame counter? verify */ device.execute().set_input_line(4, HOLD_LINE); @@ -157,6 +157,14 @@ 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)); + save_item(NAME(m_sample_rom_offset_1)); + save_item(NAME(m_sample_rom_offset_2)); + save_item(NAME(m_offset_shift)); + save_item(NAME(m_unk_counter)); } void rltennis_state::machine_reset() @@ -172,13 +180,13 @@ static MACHINE_CONFIG_START( rltennis, rltennis_state ) MCFG_CPU_ADD("maincpu", M68000, RLT_XTAL/2) /* 68000P8 ??? */ MCFG_CPU_PROGRAM_MAP(rltennis_main) - MCFG_CPU_VBLANK_INT_DRIVER("screen", rltennis_state, rltennis_interrupt) + MCFG_CPU_VBLANK_INT_DRIVER("screen", rltennis_state, interrupt) MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_REFRESH_RATE( RLT_REFRESH_RATE ) MCFG_SCREEN_SIZE(320, 240) MCFG_SCREEN_VISIBLE_AREA(0,319, 0, 239) - MCFG_SCREEN_UPDATE_DRIVER(rltennis_state, screen_update_rltennis) + MCFG_SCREEN_UPDATE_DRIVER(rltennis_state, screen_update) MCFG_SCREEN_PALETTE("palette") MCFG_PALETTE_ADD("palette", 256) @@ -221,4 +229,4 @@ ROM_START( rltennis ) ROM_LOAD( "tennis_3.u52", 0x00000, 0x80000, CRC(517dcd0e) SHA1(b2703e185ee8cf7e115ea07151e7bee8be34948b) ) ROM_END -GAME( 1993, rltennis, 0, rltennis, rltennis, driver_device, 0, ROT0, "TCH", "Reality Tennis", GAME_IMPERFECT_GRAPHICS) +GAME( 1993, rltennis, 0, rltennis, rltennis, driver_device, 0, ROT0, "TCH", "Reality Tennis", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) diff --git a/src/mame/drivers/seta.c b/src/mame/drivers/seta.c index f3f81918fe4..3b2ba24c92d 100644 --- a/src/mame/drivers/seta.c +++ b/src/mame/drivers/seta.c @@ -7695,6 +7695,7 @@ static MACHINE_CONFIG_START( tndrcade, seta_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) 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) @@ -7749,6 +7750,7 @@ static MACHINE_CONFIG_START( twineagl, seta_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) 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) @@ -7793,7 +7795,8 @@ static MACHINE_CONFIG_START( downtown, seta_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) 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 */ @@ -7853,7 +7856,8 @@ static MACHINE_CONFIG_START( usclssic, seta_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) 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) @@ -7907,7 +7911,8 @@ static MACHINE_CONFIG_START( calibr50, seta_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) 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 */ @@ -7950,7 +7955,8 @@ static MACHINE_CONFIG_START( metafox, seta_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) 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) @@ -7988,6 +7994,7 @@ static MACHINE_CONFIG_START( atehate, seta_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) 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) @@ -8032,7 +8039,8 @@ static MACHINE_CONFIG_START( blandia, seta_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) 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) @@ -8069,7 +8077,8 @@ static MACHINE_CONFIG_START( blandiap, seta_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) 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) @@ -8111,6 +8120,7 @@ static MACHINE_CONFIG_START( blockcar, seta_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) 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) @@ -8185,7 +8195,8 @@ static MACHINE_CONFIG_START( daioh, seta_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) 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 */ @@ -8223,7 +8234,8 @@ static MACHINE_CONFIG_START( daiohp, seta_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) 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 */ @@ -8266,7 +8278,8 @@ static MACHINE_CONFIG_START( drgnunit, seta_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) 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) @@ -8303,7 +8316,8 @@ static MACHINE_CONFIG_START( qzkklgy2, seta_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) 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) @@ -8353,7 +8367,8 @@ static MACHINE_CONFIG_START( setaroul, seta_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) 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 */ @@ -8396,7 +8411,8 @@ static MACHINE_CONFIG_START( eightfrc, seta_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) 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) @@ -8439,7 +8455,8 @@ static MACHINE_CONFIG_START( extdwnhl, seta_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) 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) @@ -8504,7 +8521,8 @@ static MACHINE_CONFIG_START( gundhara, seta_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) 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) @@ -8549,7 +8567,8 @@ static MACHINE_CONFIG_START( jjsquawk, seta_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) 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) @@ -8585,7 +8604,8 @@ static MACHINE_CONFIG_START( jjsquawb, seta_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) 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) @@ -8630,7 +8650,8 @@ static MACHINE_CONFIG_START( kamenrid, seta_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) 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) @@ -8669,6 +8690,7 @@ static MACHINE_CONFIG_START( orbs, seta_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) 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) @@ -8711,6 +8733,7 @@ static MACHINE_CONFIG_START( keroppij, seta_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) 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) @@ -8752,6 +8775,7 @@ static MACHINE_CONFIG_START( krzybowl, seta_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) 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) @@ -8795,7 +8819,8 @@ static MACHINE_CONFIG_START( madshark, seta_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) 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) @@ -8840,7 +8865,8 @@ static MACHINE_CONFIG_START( magspeed, seta_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) 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) @@ -8888,7 +8914,8 @@ static MACHINE_CONFIG_START( msgundam, seta_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) 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 */ @@ -8928,7 +8955,8 @@ static MACHINE_CONFIG_START( oisipuzl, seta_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) 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) @@ -8967,7 +8995,8 @@ static MACHINE_CONFIG_START( triplfun, seta_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) 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) @@ -9005,6 +9034,7 @@ static MACHINE_CONFIG_START( kiwame, seta_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) 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) @@ -9046,7 +9076,8 @@ static MACHINE_CONFIG_START( rezon, seta_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) 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) @@ -9087,6 +9118,7 @@ static MACHINE_CONFIG_START( thunderl, seta_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) 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) @@ -9160,6 +9192,7 @@ static MACHINE_CONFIG_START( wiggie, seta_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) 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) @@ -9197,6 +9230,7 @@ static MACHINE_CONFIG_START( wits, seta_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) 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) @@ -9235,6 +9269,7 @@ static MACHINE_CONFIG_START( umanclub, seta_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) 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) @@ -9277,7 +9312,8 @@ static MACHINE_CONFIG_START( utoukond, seta_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) 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) @@ -9328,7 +9364,8 @@ static MACHINE_CONFIG_START( wrofaero, seta_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) 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) @@ -9373,7 +9410,8 @@ static MACHINE_CONFIG_START( zingzip, seta_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) 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) @@ -9430,6 +9468,7 @@ static MACHINE_CONFIG_START( pairlove, seta_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) 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) @@ -9479,7 +9518,8 @@ static MACHINE_CONFIG_START( crazyfgt, seta_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) 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) @@ -9544,7 +9584,8 @@ static MACHINE_CONFIG_START( inttoote, seta_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) 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) diff --git a/src/mame/drivers/seta2.c b/src/mame/drivers/seta2.c index d4193425e6f..93d469a6e2a 100644 --- a/src/mame/drivers/seta2.c +++ b/src/mame/drivers/seta2.c @@ -115,6 +115,7 @@ reelquak: #include "machine/ticket.h" #include "machine/mcf5206e.h" + /*************************************************************************** @@ -123,7 +124,7 @@ reelquak: ***************************************************************************/ -WRITE16_MEMBER(seta2_state::seta2_sound_bank_w) +WRITE16_MEMBER(seta2_state::sound_bank_w) { if (ACCESSING_BITS_0_7) { @@ -169,8 +170,8 @@ static ADDRESS_MAP_START( grdians_map, AS_PROGRAM, 16, seta2_state ) AM_RANGE(0xc00000, 0xc3ffff) AM_RAM AM_SHARE("spriteram") // Sprites AM_RANGE(0xc40000, 0xc4ffff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette") // Palette AM_RANGE(0xc50000, 0xc5ffff) AM_RAM // cleared - AM_RANGE(0xc60000, 0xc6003f) AM_WRITE(seta2_vregs_w) AM_SHARE("vregs") // Video Registers - AM_RANGE(0xe00010, 0xe0001f) AM_WRITE(seta2_sound_bank_w) // Samples Banks + AM_RANGE(0xc60000, 0xc6003f) AM_WRITE(vregs_w) AM_SHARE("vregs") // Video Registers + AM_RANGE(0xe00010, 0xe0001f) AM_WRITE(sound_bank_w) // Samples Banks AM_RANGE(0xfffc00, 0xffffff) AM_DEVREADWRITE("tmp68301", tmp68301_device, regs_r, regs_w) // TMP68301 Registers ADDRESS_MAP_END @@ -207,8 +208,8 @@ static ADDRESS_MAP_START( gundamex_map, AS_PROGRAM, 16, seta2_state ) AM_RANGE(0xc00000, 0xc3ffff) AM_RAM AM_SHARE("spriteram") // Sprites AM_RANGE(0xc40000, 0xc4ffff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette") // Palette AM_RANGE(0xc50000, 0xc5ffff) AM_RAM // cleared - AM_RANGE(0xc60000, 0xc6003f) AM_WRITE(seta2_vregs_w) AM_SHARE("vregs") // Video Registers - AM_RANGE(0xe00010, 0xe0001f) AM_WRITE(seta2_sound_bank_w) // Samples Banks + AM_RANGE(0xc60000, 0xc6003f) AM_WRITE(vregs_w) AM_SHARE("vregs") // Video Registers + AM_RANGE(0xe00010, 0xe0001f) AM_WRITE(sound_bank_w) // Samples Banks AM_RANGE(0xfffc00, 0xffffff) AM_DEVREADWRITE("tmp68301", tmp68301_device, regs_r, regs_w) // TMP68301 Registers ADDRESS_MAP_END @@ -217,6 +218,11 @@ ADDRESS_MAP_END Wakakusamonogatari Mahjong Yonshimai ***************************************************************************/ +MACHINE_START_MEMBER(seta2_state, mj4simai) +{ + save_item(NAME(m_keyboard_row)); +} + READ16_MEMBER(seta2_state::mj4simai_p1_r) { switch (m_keyboard_row) @@ -260,11 +266,11 @@ static ADDRESS_MAP_START( mj4simai_map, AS_PROGRAM, 16, seta2_state ) AM_RANGE(0x600200, 0x600201) AM_WRITENOP // Leds? Coins? AM_RANGE(0x600300, 0x600301) AM_READ_PORT("DSW1") // DSW 1 AM_RANGE(0x600302, 0x600303) AM_READ_PORT("DSW2") // DSW 2 - AM_RANGE(0x600300, 0x60030f) AM_WRITE(seta2_sound_bank_w) // Samples Banks + AM_RANGE(0x600300, 0x60030f) AM_WRITE(sound_bank_w) // Samples Banks AM_RANGE(0xb00000, 0xb03fff) AM_DEVREADWRITE("x1snd", x1_010_device, word_r, word_w) // Sound AM_RANGE(0xc00000, 0xc3ffff) AM_RAM AM_SHARE("spriteram") // Sprites AM_RANGE(0xc40000, 0xc4ffff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette") // Palette - AM_RANGE(0xc60000, 0xc6003f) AM_WRITE(seta2_vregs_w) AM_SHARE("vregs") // Video Registers + AM_RANGE(0xc60000, 0xc6003f) AM_WRITE(vregs_w) AM_SHARE("vregs") // Video Registers AM_RANGE(0xfffc00, 0xffffff) AM_DEVREADWRITE("tmp68301", tmp68301_device, regs_r, regs_w) // TMP68301 Registers ADDRESS_MAP_END @@ -283,11 +289,11 @@ static ADDRESS_MAP_START( myangel_map, AS_PROGRAM, 16, seta2_state ) AM_RANGE(0x700200, 0x700201) AM_WRITENOP // Leds? Coins? AM_RANGE(0x700300, 0x700301) AM_READ_PORT("DSW1") // DSW 1 AM_RANGE(0x700302, 0x700303) AM_READ_PORT("DSW2") // DSW 2 - AM_RANGE(0x700310, 0x70031f) AM_WRITE(seta2_sound_bank_w) // Samples Banks + AM_RANGE(0x700310, 0x70031f) AM_WRITE(sound_bank_w) // Samples Banks AM_RANGE(0xb00000, 0xb03fff) AM_DEVREADWRITE("x1snd", x1_010_device, word_r, word_w) // Sound AM_RANGE(0xc00000, 0xc3ffff) AM_RAM AM_SHARE("spriteram") // Sprites AM_RANGE(0xc40000, 0xc4ffff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette") // Palette - AM_RANGE(0xc60000, 0xc6003f) AM_WRITE(seta2_vregs_w) AM_SHARE("vregs") // Video Registers + AM_RANGE(0xc60000, 0xc6003f) AM_WRITE(vregs_w) AM_SHARE("vregs") // Video Registers AM_RANGE(0xfffc00, 0xffffff) AM_DEVREADWRITE("tmp68301", tmp68301_device, regs_r, regs_w) // TMP68301 Registers ADDRESS_MAP_END @@ -306,11 +312,11 @@ static ADDRESS_MAP_START( myangel2_map, AS_PROGRAM, 16, seta2_state ) AM_RANGE(0x600200, 0x600201) AM_WRITENOP // Leds? Coins? AM_RANGE(0x600300, 0x600301) AM_READ_PORT("DSW1") // DSW 1 AM_RANGE(0x600302, 0x600303) AM_READ_PORT("DSW2") // DSW 2 - AM_RANGE(0x600300, 0x60030f) AM_WRITE(seta2_sound_bank_w) // Samples Banks + AM_RANGE(0x600300, 0x60030f) AM_WRITE(sound_bank_w) // Samples Banks AM_RANGE(0xb00000, 0xb03fff) AM_DEVREADWRITE("x1snd", x1_010_device, word_r, word_w) // Sound AM_RANGE(0xd00000, 0xd3ffff) AM_RAM AM_SHARE("spriteram") // Sprites AM_RANGE(0xd40000, 0xd4ffff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette") // Palette - AM_RANGE(0xd60000, 0xd6003f) AM_WRITE(seta2_vregs_w) AM_SHARE("vregs") // Video Registers + AM_RANGE(0xd60000, 0xd6003f) AM_WRITE(vregs_w) AM_SHARE("vregs") // Video Registers AM_RANGE(0xfffc00, 0xffffff) AM_DEVREADWRITE("tmp68301", tmp68301_device, regs_r, regs_w) // TMP68301 Registers ADDRESS_MAP_END @@ -346,7 +352,7 @@ static ADDRESS_MAP_START( pzlbowl_map, AS_PROGRAM, 16, seta2_state ) AM_RANGE(0x200000, 0x20ffff) AM_RAM // RAM AM_RANGE(0x400300, 0x400301) AM_READ_PORT("DSW1") // DSW 1 AM_RANGE(0x400302, 0x400303) AM_READ_PORT("DSW2") // DSW 2 - AM_RANGE(0x400300, 0x40030f) AM_WRITE(seta2_sound_bank_w) // Samples Banks + AM_RANGE(0x400300, 0x40030f) AM_WRITE(sound_bank_w) // Samples Banks AM_RANGE(0x500000, 0x500001) AM_READ_PORT("P1") // P1 AM_RANGE(0x500002, 0x500003) AM_READ_PORT("P2") // P2 AM_RANGE(0x500004, 0x500005) AM_READWRITE(pzlbowl_coins_r,pzlbowl_coin_counter_w) // Coins + Protection? @@ -354,7 +360,7 @@ static ADDRESS_MAP_START( pzlbowl_map, AS_PROGRAM, 16, seta2_state ) AM_RANGE(0x700000, 0x700001) AM_READ(pzlbowl_protection_r) // Protection AM_RANGE(0x800000, 0x83ffff) AM_RAM AM_SHARE("spriteram") // Sprites AM_RANGE(0x840000, 0x84ffff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette") // Palette - AM_RANGE(0x860000, 0x86003f) AM_WRITE(seta2_vregs_w) AM_SHARE("vregs") // Video Registers + AM_RANGE(0x860000, 0x86003f) AM_WRITE(vregs_w) AM_SHARE("vregs") // Video Registers AM_RANGE(0x900000, 0x903fff) AM_DEVREADWRITE("x1snd", x1_010_device, word_r, word_w) // Sound AM_RANGE(0xfffc00, 0xffffff) AM_DEVREADWRITE("tmp68301", tmp68301_device, regs_r, regs_w) // TMP68301 Registers ADDRESS_MAP_END @@ -371,7 +377,7 @@ static ADDRESS_MAP_START( penbros_map, AS_PROGRAM, 16, seta2_state ) AM_RANGE(0x300000, 0x30ffff) AM_RAM // RAM AM_RANGE(0x500300, 0x500301) AM_READ_PORT("DSW1") // DSW 1 AM_RANGE(0x500302, 0x500303) AM_READ_PORT("DSW2") // DSW 2 - AM_RANGE(0x500300, 0x50030f) AM_WRITE(seta2_sound_bank_w) // Samples Banks + AM_RANGE(0x500300, 0x50030f) AM_WRITE(sound_bank_w) // Samples Banks AM_RANGE(0x600000, 0x600001) AM_READ_PORT("P1") // P1 AM_RANGE(0x600002, 0x600003) AM_READ_PORT("P2") // P2 AM_RANGE(0x600004, 0x600005) AM_READ_PORT("SYSTEM") // Coins @@ -380,7 +386,7 @@ static ADDRESS_MAP_START( penbros_map, AS_PROGRAM, 16, seta2_state ) //AM_RANGE(0x700000, 0x700001) AM_READ(pzlbowl_protection_r) // Protection AM_RANGE(0xb00000, 0xb3ffff) AM_RAM AM_SHARE("spriteram") // Sprites AM_RANGE(0xb40000, 0xb4ffff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette") // Palette - AM_RANGE(0xb60000, 0xb6003f) AM_WRITE(seta2_vregs_w) AM_SHARE("vregs") + AM_RANGE(0xb60000, 0xb6003f) AM_WRITE(vregs_w) AM_SHARE("vregs") AM_RANGE(0xa00000, 0xa03fff) AM_DEVREADWRITE("x1snd", x1_010_device, word_r, word_w) // Sound AM_RANGE(0xfffc00, 0xffffff) AM_DEVREADWRITE("tmp68301", tmp68301_device, regs_r, regs_w) // TMP68301 Registers ADDRESS_MAP_END @@ -435,11 +441,11 @@ static ADDRESS_MAP_START( reelquak_map, AS_PROGRAM, 16, seta2_state ) AM_RANGE(0x400200, 0x400201) AM_WRITE(reelquak_coin_w) // Coin Counters / IRQ Ack AM_RANGE(0x400300, 0x400301) AM_READ_PORT("DSW1") // DSW 1 AM_RANGE(0x400302, 0x400303) AM_READ_PORT("DSW2") // DSW 2 - AM_RANGE(0x400300, 0x40030f) AM_WRITE(seta2_sound_bank_w) // Samples Banks + AM_RANGE(0x400300, 0x40030f) AM_WRITE(sound_bank_w) // Samples Banks AM_RANGE(0xb00000, 0xb03fff) AM_DEVREADWRITE("x1snd", x1_010_device, word_r, word_w) // Sound AM_RANGE(0xc00000, 0xc3ffff) AM_RAM AM_SHARE("spriteram") // Sprites AM_RANGE(0xc40000, 0xc4ffff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette") // Palette - AM_RANGE(0xc60000, 0xc6003f) AM_WRITE(seta2_vregs_w) AM_SHARE("vregs") // Video Registers + AM_RANGE(0xc60000, 0xc6003f) AM_WRITE(vregs_w) AM_SHARE("vregs") // Video Registers AM_RANGE(0xfffc00, 0xffffff) AM_DEVREADWRITE("tmp68301", tmp68301_device, regs_r, regs_w) // TMP68301 Registers ADDRESS_MAP_END @@ -453,7 +459,7 @@ static ADDRESS_MAP_START( namcostr_map, AS_PROGRAM, 16, seta2_state ) AM_RANGE(0x000000, 0x07ffff) AM_ROM // ROM AM_RANGE(0x200000, 0x20ffff) AM_RAM // RAM AM_RANGE(0xc00000, 0xc3ffff) AM_RAM AM_SHARE("spriteram") // Sprites - AM_RANGE(0xc60000, 0xc6003f) AM_WRITE(seta2_vregs_w) AM_SHARE("vregs") // Video Registers + AM_RANGE(0xc60000, 0xc6003f) AM_WRITE(vregs_w) AM_SHARE("vregs") // Video Registers AM_RANGE(0xfffc00, 0xffffff) AM_DEVREADWRITE("tmp68301", tmp68301_device, regs_r, regs_w) // TMP68301 Registers ADDRESS_MAP_END @@ -483,7 +489,7 @@ static ADDRESS_MAP_START( samshoot_map, AS_PROGRAM, 16, seta2_state ) AM_RANGE( 0x400000, 0x400001 ) AM_READ_PORT("DSW1") // DSW 1 AM_RANGE( 0x400002, 0x400003 ) AM_READ_PORT("BUTTONS") // Buttons - AM_RANGE( 0x400300, 0x40030f ) AM_WRITE(seta2_sound_bank_w ) // Samples Banks + AM_RANGE( 0x400300, 0x40030f ) AM_WRITE(sound_bank_w ) // Samples Banks AM_RANGE( 0x500000, 0x500001 ) AM_READ_PORT("GUN1") // P1 AM_RANGE( 0x580000, 0x580001 ) AM_READ_PORT("GUN2") // P2 @@ -495,7 +501,7 @@ static ADDRESS_MAP_START( samshoot_map, AS_PROGRAM, 16, seta2_state ) AM_RANGE( 0x800000, 0x83ffff ) AM_RAM AM_SHARE("spriteram") // Sprites AM_RANGE( 0x840000, 0x84ffff ) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette") // Palette - AM_RANGE( 0x860000, 0x86003f ) AM_WRITE(seta2_vregs_w) AM_SHARE("vregs") // Video Registers + AM_RANGE( 0x860000, 0x86003f ) AM_WRITE(vregs_w) AM_SHARE("vregs") // Video Registers AM_RANGE( 0x900000, 0x903fff ) AM_DEVREADWRITE("x1snd", x1_010_device, word_r, word_w) // Sound @@ -579,6 +585,11 @@ 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)); + device_serial_interface::register_save_state(machine().save(), this); } void funcube_touchscreen_device::device_reset() @@ -693,7 +704,7 @@ static ADDRESS_MAP_START( funcube_map, AS_PROGRAM, 32, seta2_state ) AM_RANGE( 0x00800000, 0x0083ffff ) AM_READWRITE16(spriteram16_word_r, spriteram16_word_w, 0xffffffff ) AM_SHARE("spriteram") AM_RANGE( 0x00840000, 0x0084ffff ) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette") // Palette - AM_RANGE( 0x00860000, 0x0086003f ) AM_WRITE16(seta2_vregs_w, 0xffffffff ) AM_SHARE("vregs") + AM_RANGE( 0x00860000, 0x0086003f ) AM_WRITE16(vregs_w, 0xffffffff ) AM_SHARE("vregs") AM_RANGE( 0x00c00000, 0x00c002ff ) AM_READWRITE(funcube_nvram_dword_r, funcube_nvram_dword_w ) @@ -712,7 +723,7 @@ static ADDRESS_MAP_START( funcube2_map, AS_PROGRAM, 32, seta2_state ) AM_RANGE( 0x00800000, 0x0083ffff ) AM_READWRITE16(spriteram16_word_r, spriteram16_word_w, 0xffffffff ) AM_SHARE("spriteram") AM_RANGE( 0x00840000, 0x0084ffff ) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette") - AM_RANGE( 0x00860000, 0x0086003f ) AM_WRITE16(seta2_vregs_w, 0xffffffff ) AM_SHARE("vregs") + AM_RANGE( 0x00860000, 0x0086003f ) AM_WRITE16(vregs_w, 0xffffffff ) AM_SHARE("vregs") AM_RANGE( 0x00c00000, 0x00c002ff ) AM_READWRITE(funcube_nvram_dword_r, funcube_nvram_dword_w ) @@ -2101,16 +2112,14 @@ static MACHINE_CONFIG_START( seta2, seta2_state ) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) MCFG_SCREEN_SIZE(0x200, 0x200) MCFG_SCREEN_VISIBLE_AREA(0x40, 0x1c0-1, 0x80, 0x170-1) - MCFG_SCREEN_UPDATE_DRIVER(seta2_state, screen_update_seta2) - MCFG_SCREEN_VBLANK_DRIVER(seta2_state, screen_eof_seta2) + MCFG_SCREEN_UPDATE_DRIVER(seta2_state, screen_update) + MCFG_SCREEN_VBLANK_DRIVER(seta2_state, screen_eof) MCFG_SCREEN_PALETTE("palette") MCFG_GFXDECODE_ADD("gfxdecode", "palette", seta2) MCFG_PALETTE_ADD("palette", 0x8000+0xf0) // extra 0xf0 because we might draw 256-color object with 16-color granularity MCFG_PALETTE_FORMAT(xRRRRRGGGGGBBBBB) - MCFG_VIDEO_START_OVERRIDE(seta2_state,seta2) - // sound hardware MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") @@ -2121,12 +2130,8 @@ MACHINE_CONFIG_END static MACHINE_CONFIG_DERIVED( mj4simai, seta2 ) - MCFG_CPU_MODIFY("maincpu") - MCFG_CPU_PROGRAM_MAP(mj4simai_map) + MCFG_MACHINE_START_OVERRIDE(seta2_state, mj4simai) - // video hardware - MCFG_SCREEN_MODIFY("screen") - MCFG_SCREEN_VISIBLE_AREA(0x40, 0x1c0-1, 0x80, 0x170-1) MACHINE_CONFIG_END @@ -2164,7 +2169,7 @@ static MACHINE_CONFIG_DERIVED( myangel, seta2 ) MCFG_SCREEN_MODIFY("screen") MCFG_SCREEN_VISIBLE_AREA(0, 0x178-1, 0x00, 0xf0-1) - MCFG_VIDEO_START_OVERRIDE(seta2_state,seta2_yoffset) + MCFG_VIDEO_START_OVERRIDE(seta2_state,yoffset) MACHINE_CONFIG_END @@ -2176,7 +2181,7 @@ static MACHINE_CONFIG_DERIVED( myangel2, seta2 ) MCFG_SCREEN_MODIFY("screen") MCFG_SCREEN_VISIBLE_AREA(0, 0x178-1, 0x00, 0xf0-1) - MCFG_VIDEO_START_OVERRIDE(seta2_state,seta2_yoffset) + MCFG_VIDEO_START_OVERRIDE(seta2_state,yoffset) MACHINE_CONFIG_END @@ -2214,7 +2219,7 @@ static MACHINE_CONFIG_DERIVED( reelquak, seta2 ) MCFG_SCREEN_MODIFY("screen") MCFG_SCREEN_VISIBLE_AREA(0x40, 0x180-1, 0x80, 0x170-1) - MCFG_VIDEO_START_OVERRIDE(seta2_state,seta2_xoffset) + MCFG_VIDEO_START_OVERRIDE(seta2_state,xoffset) MACHINE_CONFIG_END @@ -2249,7 +2254,13 @@ TIMER_DEVICE_CALLBACK_MEMBER(seta2_state::funcube_interrupt) m_maincpu->set_input_line(2, HOLD_LINE); } -MACHINE_RESET_MEMBER(seta2_state,funcube) +MACHINE_START_MEMBER(seta2_state, funcube) +{ + save_item(NAME(m_funcube_coin_start_cycles)); + save_item(NAME(m_funcube_hopper_motor)); +} + +MACHINE_RESET_MEMBER(seta2_state, funcube) { m_funcube_coin_start_cycles = 0; m_funcube_hopper_motor = 0; @@ -2272,7 +2283,8 @@ static MACHINE_CONFIG_START( funcube, seta2_state ) MCFG_NVRAM_ADD_0FILL("nvram") - MCFG_MACHINE_RESET_OVERRIDE(seta2_state, funcube ) + MCFG_MACHINE_START_OVERRIDE(seta2_state, funcube) + MCFG_MACHINE_RESET_OVERRIDE(seta2_state, funcube) // video hardware MCFG_SCREEN_ADD("screen", RASTER) @@ -2280,16 +2292,14 @@ static MACHINE_CONFIG_START( funcube, seta2_state ) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) // not accurate MCFG_SCREEN_SIZE(0x200, 0x200) MCFG_SCREEN_VISIBLE_AREA(0x0+1, 0x140-1+1, 0x80, 0x170-1) - MCFG_SCREEN_UPDATE_DRIVER(seta2_state, screen_update_seta2) - MCFG_SCREEN_VBLANK_DRIVER(seta2_state, screen_eof_seta2) + MCFG_SCREEN_UPDATE_DRIVER(seta2_state, screen_update) + MCFG_SCREEN_VBLANK_DRIVER(seta2_state, screen_eof) MCFG_SCREEN_PALETTE("palette") MCFG_GFXDECODE_ADD("gfxdecode", "palette", funcube) MCFG_PALETTE_ADD("palette", 0x8000+0xf0) // extra 0xf0 because we might draw 256-color object with 16-color granularity MCFG_PALETTE_FORMAT(xRRRRRGGGGGBBBBB) - MCFG_VIDEO_START_OVERRIDE(seta2_state,seta2) - // sound hardware MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") @@ -2333,16 +2343,14 @@ static MACHINE_CONFIG_START( namcostr, seta2_state ) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) MCFG_SCREEN_SIZE(0x200, 0x200) MCFG_SCREEN_VISIBLE_AREA(0x40, 0x1c0-1, 0x80, 0x170-1) - MCFG_SCREEN_UPDATE_DRIVER(seta2_state, screen_update_seta2) - MCFG_SCREEN_VBLANK_DRIVER(seta2_state, screen_eof_seta2) + MCFG_SCREEN_UPDATE_DRIVER(seta2_state, screen_update) + MCFG_SCREEN_VBLANK_DRIVER(seta2_state, screen_eof) MCFG_SCREEN_PALETTE("palette") MCFG_GFXDECODE_ADD("gfxdecode", "palette", funcube) MCFG_PALETTE_ADD("palette", 0x8000+0xf0) // extra 0xf0 because we might draw 256-color object with 16-color granularity MCFG_PALETTE_FORMAT(xRRRRRGGGGGBBBBB) - MCFG_VIDEO_START_OVERRIDE(seta2_state,seta2) - // sound hardware MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") diff --git a/src/mame/drivers/srmp2.c b/src/mame/drivers/srmp2.c index 24b260e53a5..85b7be44059 100644 --- a/src/mame/drivers/srmp2.c +++ b/src/mame/drivers/srmp2.c @@ -69,48 +69,81 @@ Note: ***************************************************************************/ +void srmp2_state::machine_start() +{ + save_item(NAME(m_adpcm_bank)); + save_item(NAME(m_adpcm_data)); + save_item(NAME(m_adpcm_sptr)); + save_item(NAME(m_adpcm_eptr)); + save_item(NAME(m_iox.mux)); + save_item(NAME(m_iox.ff)); + save_item(NAME(m_iox.data)); +} + MACHINE_START_MEMBER(srmp2_state,srmp2) { - iox_t &iox = m_iox; - - iox.reset = 0x1f; - iox.ff_event = -1; - iox.ff_1 = 0x00; + machine_start(); + + m_iox.reset = 0x1f; + m_iox.ff_event = -1; + m_iox.ff_1 = 0x00; /* note: protection in srmp1/mjyuugi/ponchin is never checked, assume to be the same */ - iox.protcheck[0] = 0x60; iox.protlatch[0] = 0x2a; - iox.protcheck[1] = -1; iox.protlatch[1] = -1; - iox.protcheck[2] = -1; iox.protlatch[2] = -1; - iox.protcheck[3] = -1; iox.protlatch[3] = -1; + m_iox.protcheck[0] = 0x60; m_iox.protlatch[0] = 0x2a; + 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) { - iox_t &iox = m_iox; - - iox.reset = 0xc8; - iox.ff_event = 0xef; - iox.ff_1 = -1; - iox.protcheck[0] = 0x49; iox.protlatch[0] = 0xc9; - iox.protcheck[1] = 0x4c; iox.protlatch[1] = 0x00; - iox.protcheck[2] = 0x1c; iox.protlatch[2] = 0x04; - iox.protcheck[3] = 0x45; iox.protlatch[3] = 0x00; + machine_start(); + + m_iox.reset = 0xc8; + m_iox.ff_event = 0xef; + m_iox.ff_1 = -1; + m_iox.protcheck[0] = 0x49; m_iox.protlatch[0] = 0xc9; + 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); + + save_item(NAME(m_gfx_bank)); } MACHINE_START_MEMBER(srmp2_state,rmgoldyh) { - iox_t &iox = m_iox; - - iox.reset = 0xc8; - iox.ff_event = 0xff; - iox.ff_1 = -1; - iox.protcheck[0] = 0x43; iox.protlatch[0] = 0x9a; - iox.protcheck[1] = 0x45; iox.protlatch[1] = 0x00; - iox.protcheck[2] = -1; iox.protlatch[2] = -1; - iox.protcheck[3] = -1; iox.protlatch[3] = -1; + machine_start(); + + m_iox.reset = 0xc8; + m_iox.ff_event = 0xff; + m_iox.ff_1 = -1; + m_iox.protcheck[0] = 0x43; m_iox.protlatch[0] = 0x9a; + m_iox.protcheck[1] = 0x45; m_iox.protlatch[1] = 0x00; + 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); + + 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; + /* note: protection in srmp1/mjyuugi/ponchin is never checked, assume to be the same */ + m_iox.protcheck[0] = 0x60; m_iox.protlatch[0] = 0x2a; + 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_gfx_bank)); } /*************************************************************************** @@ -207,7 +240,7 @@ WRITE8_MEMBER(srmp2_state::srmp3_adpcm_code_w) } -WRITE_LINE_MEMBER(srmp2_state::srmp2_adpcm_int) +WRITE_LINE_MEMBER(srmp2_state::adpcm_int) { UINT8 *ROM = memregion("adpcm")->base(); @@ -270,32 +303,30 @@ UINT8 srmp2_state::iox_key_matrix_calc(UINT8 p_side) READ8_MEMBER(srmp2_state::iox_mux_r) { - iox_t &iox = m_iox; - /* first off check any pending protection value */ { int i; for(i=0;i<4;i++) { - if(iox.protcheck[i] == -1) + if(m_iox.protcheck[i] == -1) continue; //skip - if(iox.data == iox.protcheck[i]) + if(m_iox.data == m_iox.protcheck[i]) { - iox.data = 0; //clear write latch - return iox.protlatch[i]; + m_iox.data = 0; //clear write latch + return m_iox.protlatch[i]; } } } - if(iox.ff == 0) + if(m_iox.ff == 0) { - if(iox.mux != 1 && iox.mux != 2 && iox.mux != 4) + if(m_iox.mux != 1 && m_iox.mux != 2 && m_iox.mux != 4) return 0xff; //unknown command /* both side checks */ - if(iox.mux == 1) + if(m_iox.mux == 1) { UINT8 p1_side = iox_key_matrix_calc(0); UINT8 p2_side = iox_key_matrix_calc(4); @@ -307,7 +338,7 @@ READ8_MEMBER(srmp2_state::iox_mux_r) } /* check individual input side */ - return iox_key_matrix_calc((iox.mux == 2) ? 0 : 4); + return iox_key_matrix_calc((m_iox.mux == 2) ? 0 : 4); } return ioport("SERVICE")->read() & 0xff; @@ -320,7 +351,6 @@ READ8_MEMBER(srmp2_state::iox_status_r) WRITE8_MEMBER(srmp2_state::iox_command_w) { - iox_t &iox = m_iox; /* bit wise command port apparently 0x01: selects both sides @@ -328,23 +358,22 @@ WRITE8_MEMBER(srmp2_state::iox_command_w) 0x04: selects p2 side */ - iox.mux = data; - iox.ff = 0; // this also set flip flop back to 0 + m_iox.mux = data; + m_iox.ff = 0; // this also set flip flop back to 0 } WRITE8_MEMBER(srmp2_state::iox_data_w) { - iox_t &iox = m_iox; - iox.data = data; + m_iox.data = data; - if(data == iox.reset && iox.reset != -1) //resets device - iox.ff = 0; + if(data == m_iox.reset && m_iox.reset != -1) //resets device + m_iox.ff = 0; - if(data == iox.ff_event && iox.ff_event != -1) // flip flop event - iox.ff ^= 1; + if(data == m_iox.ff_event && m_iox.ff_event != -1) // flip flop event + m_iox.ff ^= 1; - if(data == iox.ff_1 && iox.ff_1 != -1) // set flip flop to 1 - iox.ff = 1; + if(data == m_iox.ff_1 && m_iox.ff_1 != -1) // set flip flop to 1 + m_iox.ff = 1; } WRITE8_MEMBER(srmp2_state::srmp3_rombank_w) @@ -1163,7 +1192,7 @@ static MACHINE_CONFIG_START( srmp2, srmp2_state ) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40) MCFG_SOUND_ADD("msm", MSM5205, 384000) - MCFG_MSM5205_VCLK_CB(WRITELINE(srmp2_state, srmp2_adpcm_int)) /* IRQ handler */ + MCFG_MSM5205_VCLK_CB(WRITELINE(srmp2_state, adpcm_int)) /* IRQ handler */ MCFG_MSM5205_PRESCALER_SELECTOR(MSM5205_S48_4B) /* 8 KHz, 4 Bits */ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.45) MACHINE_CONFIG_END @@ -1185,6 +1214,7 @@ static MACHINE_CONFIG_START( srmp3, srmp2_state ) MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") MCFG_SETA001_SPRITE_PALETTE("palette") + MCFG_SETA001_SPRITE_GFXBANK_CB(srmp2_state, srmp3_gfxbank_callback) /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) @@ -1210,7 +1240,7 @@ static MACHINE_CONFIG_START( srmp3, srmp2_state ) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20) MCFG_SOUND_ADD("msm", MSM5205, 384000) - MCFG_MSM5205_VCLK_CB(WRITELINE(srmp2_state, srmp2_adpcm_int)) /* IRQ handler */ + MCFG_MSM5205_VCLK_CB(WRITELINE(srmp2_state, adpcm_int)) /* IRQ handler */ MCFG_MSM5205_PRESCALER_SELECTOR(MSM5205_S48_4B) /* 8 KHz, 4 Bits */ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.45) MACHINE_CONFIG_END @@ -1232,13 +1262,14 @@ static MACHINE_CONFIG_START( mjyuugi, srmp2_state ) MCFG_CPU_VBLANK_INT_DRIVER("screen", srmp2_state, irq4_line_assert) MCFG_CPU_PERIODIC_INT_DRIVER(srmp2_state, irq2_line_assert, 15*60) /* Interrupt times is not understood */ - MCFG_MACHINE_START_OVERRIDE(srmp2_state,srmp2) + MCFG_MACHINE_START_OVERRIDE(srmp2_state,mjyuugi) MCFG_NVRAM_ADD_0FILL("nvram") MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") MCFG_SETA001_SPRITE_PALETTE("palette") + MCFG_SETA001_SPRITE_GFXBANK_CB(srmp2_state, srmp3_gfxbank_callback) /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) @@ -1262,7 +1293,7 @@ static MACHINE_CONFIG_START( mjyuugi, srmp2_state ) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20) MCFG_SOUND_ADD("msm", MSM5205, 384000) - MCFG_MSM5205_VCLK_CB(WRITELINE(srmp2_state, srmp2_adpcm_int)) /* IRQ handler */ + MCFG_MSM5205_VCLK_CB(WRITELINE(srmp2_state, adpcm_int)) /* IRQ handler */ MCFG_MSM5205_PRESCALER_SELECTOR(MSM5205_S48_4B) /* 8 KHz, 4 Bits */ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.45) MACHINE_CONFIG_END @@ -1537,11 +1568,11 @@ ROM_END -GAME( 1987, srmp1, 0, srmp2, srmp2, driver_device, 0, ROT0, "Seta", "Super Real Mahjong Part 1 (Japan)", 0 ) -GAME( 1987, srmp2, 0, srmp2, srmp2, driver_device, 0, ROT0, "Seta", "Super Real Mahjong Part 2 (Japan)", 0 ) -GAME( 1988, srmp3, 0, srmp3, srmp3, driver_device, 0, ROT0, "Seta", "Super Real Mahjong Part 3 (Japan)", 0 ) -GAME( 1988, rmgoldyh, srmp3, rmgoldyh, rmgoldyh, driver_device, 0, ROT0, "Seta (Alba license)", "Real Mahjong Gold Yumehai / Super Real Mahjong GOLD part.2 [BET] (Japan)", 0 ) -GAME( 1990, mjyuugi, 0, mjyuugi, mjyuugi, driver_device, 0, ROT0, "Visco", "Mahjong Yuugi (Japan set 1)", 0 ) -GAME( 1990, mjyuugia, mjyuugi, mjyuugi, mjyuugi, driver_device, 0, ROT0, "Visco", "Mahjong Yuugi (Japan set 2)", 0 ) -GAME( 1991, ponchin, 0, mjyuugi, ponchin, driver_device, 0, ROT0, "Visco", "Mahjong Pon Chin Kan (Japan set 1)", 0 ) -GAME( 1991, ponchina, ponchin, mjyuugi, ponchin, driver_device, 0, ROT0, "Visco", "Mahjong Pon Chin Kan (Japan set 2)", 0 ) +GAME( 1987, srmp1, 0, srmp2, srmp2, driver_device, 0, ROT0, "Seta", "Super Real Mahjong Part 1 (Japan)", GAME_SUPPORTS_SAVE ) +GAME( 1987, srmp2, 0, srmp2, srmp2, driver_device, 0, ROT0, "Seta", "Super Real Mahjong Part 2 (Japan)", GAME_SUPPORTS_SAVE ) +GAME( 1988, srmp3, 0, srmp3, srmp3, driver_device, 0, ROT0, "Seta", "Super Real Mahjong Part 3 (Japan)", GAME_SUPPORTS_SAVE ) +GAME( 1988, rmgoldyh, srmp3, rmgoldyh, rmgoldyh, driver_device, 0, ROT0, "Seta (Alba license)", "Real Mahjong Gold Yumehai / Super Real Mahjong GOLD part.2 [BET] (Japan)", GAME_SUPPORTS_SAVE ) +GAME( 1990, mjyuugi, 0, mjyuugi, mjyuugi, driver_device, 0, ROT0, "Visco", "Mahjong Yuugi (Japan set 1)", GAME_SUPPORTS_SAVE ) +GAME( 1990, mjyuugia, mjyuugi, mjyuugi, mjyuugi, driver_device, 0, ROT0, "Visco", "Mahjong Yuugi (Japan set 2)", GAME_SUPPORTS_SAVE ) +GAME( 1991, ponchin, 0, mjyuugi, ponchin, driver_device, 0, ROT0, "Visco", "Mahjong Pon Chin Kan (Japan set 1)", GAME_SUPPORTS_SAVE ) +GAME( 1991, ponchina, ponchin, mjyuugi, ponchin, driver_device, 0, ROT0, "Visco", "Mahjong Pon Chin Kan (Japan set 2)", GAME_SUPPORTS_SAVE ) diff --git a/src/mame/drivers/ssrj.c b/src/mame/drivers/ssrj.c index 24c4a937063..b4282c1b9a2 100644 --- a/src/mame/drivers/ssrj.c +++ b/src/mame/drivers/ssrj.c @@ -21,8 +21,8 @@ HW info : f800 ?? Scroll RAM contains x and y offsets for each tileline, - as well as other data (priroities ? additional flags ?) - All moving obejcts (cars, etc) are displayed on tilemap 3. + as well as other data (priorities ? additional flags ?) + All moving objects (cars, etc) are displayed on tilemap 3. ------------------------------------ Cheat : $e210 - timer @@ -34,6 +34,11 @@ HW info : #include "sound/ay8910.h" #include "includes/ssrj.h" +void ssrj_state::machine_start() +{ + save_item(NAME(m_oldport)); +} + void ssrj_state::machine_reset() { UINT8 *rom = memregion("maincpu")->base(); @@ -42,7 +47,7 @@ void ssrj_state::machine_reset() m_oldport = 0x80; } -READ8_MEMBER(ssrj_state::ssrj_wheel_r) +READ8_MEMBER(ssrj_state::wheel_r) { int port = ioport("IN1")->read() - 0x80; int retval = port - m_oldport; @@ -53,14 +58,14 @@ READ8_MEMBER(ssrj_state::ssrj_wheel_r) static ADDRESS_MAP_START( ssrj_map, AS_PROGRAM, 8, ssrj_state ) AM_RANGE(0x0000, 0x7fff) AM_ROM - AM_RANGE(0xc000, 0xc7ff) AM_RAM_WRITE(ssrj_vram1_w) AM_SHARE("vram1") - AM_RANGE(0xc800, 0xcfff) AM_RAM_WRITE(ssrj_vram2_w) AM_SHARE("vram2") + AM_RANGE(0xc000, 0xc7ff) AM_RAM_WRITE(vram1_w) AM_SHARE("vram1") + AM_RANGE(0xc800, 0xcfff) AM_RAM_WRITE(vram2_w) AM_SHARE("vram2") AM_RANGE(0xd000, 0xd7ff) AM_RAM AM_SHARE("vram3") - AM_RANGE(0xd800, 0xdfff) AM_RAM_WRITE(ssrj_vram4_w) AM_SHARE("vram4") + AM_RANGE(0xd800, 0xdfff) AM_RAM_WRITE(vram4_w) AM_SHARE("vram4") AM_RANGE(0xe000, 0xe7ff) AM_RAM AM_RANGE(0xe800, 0xefff) AM_RAM AM_SHARE("scrollram") AM_RANGE(0xf000, 0xf000) AM_READ_PORT("IN0") - AM_RANGE(0xf001, 0xf001) AM_READ(ssrj_wheel_r) + AM_RANGE(0xf001, 0xf001) AM_READ(wheel_r) AM_RANGE(0xf002, 0xf002) AM_READ_PORT("IN2") AM_RANGE(0xf003, 0xf003) AM_WRITENOP /* unknown */ AM_RANGE(0xf401, 0xf401) AM_DEVREAD("aysnd", ay8910_device, data_r) @@ -141,8 +146,8 @@ static MACHINE_CONFIG_START( ssrj, ssrj_state ) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) MCFG_SCREEN_SIZE(40*8, 32*8) MCFG_SCREEN_VISIBLE_AREA(0*8, 34*8-1, 1*8, 31*8-1) // unknown res - MCFG_SCREEN_UPDATE_DRIVER(ssrj_state, screen_update_ssrj) - MCFG_SCREEN_VBLANK_DRIVER(ssrj_state, screen_eof_ssrj) + MCFG_SCREEN_UPDATE_DRIVER(ssrj_state, screen_update) + MCFG_SCREEN_VBLANK_DRIVER(ssrj_state, screen_eof) MCFG_SCREEN_PALETTE("palette") MCFG_GFXDECODE_ADD("gfxdecode", "palette", ssrj) @@ -179,4 +184,4 @@ ROM_START( ssrj ) ROM_END -GAME( 1985, ssrj, 0, ssrj, ssrj, driver_device, 0, ROT90, "Taito Corporation", "Super Speed Race Junior (Japan)",GAME_WRONG_COLORS|GAME_IMPERFECT_GRAPHICS ) +GAME( 1985, ssrj, 0, ssrj, ssrj, driver_device, 0, ROT90, "Taito Corporation", "Super Speed Race Junior (Japan)", GAME_WRONG_COLORS | GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) diff --git a/src/mame/drivers/sstrangr.c b/src/mame/drivers/sstrangr.c index bd2158535c0..e30b534f7ad 100644 --- a/src/mame/drivers/sstrangr.c +++ b/src/mame/drivers/sstrangr.c @@ -18,16 +18,21 @@ class sstrangr_state : public driver_device public: sstrangr_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), - m_ram(*this, "ram"), - m_maincpu(*this, "maincpu") { } + m_maincpu(*this, "maincpu"), + m_ram(*this, "ram") { } + + required_device m_maincpu; required_shared_ptr m_ram; + UINT8 m_flip_screen; - UINT8 *m_proms; + 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); - required_device m_maincpu; }; @@ -38,6 +43,11 @@ public: * *************************************/ +void sstrangr_state::video_start() +{ + save_item(NAME(m_flip_screen)); +} + UINT32 sstrangr_state::screen_update_sstrangr(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { offs_t offs; @@ -296,5 +306,5 @@ ROM_START( sstrangr2 ) ROM_END -GAMEL( 1978, sstrangr, 0, sstrangr, sstrangr, driver_device, 0, ROT270, "Yachiyo Electronics, Ltd.", "Space Stranger", GAME_NO_SOUND, layout_sstrangr ) -GAME( 1979, sstrangr2,sstrangr, sstrngr2, sstrngr2, driver_device, 0, ROT270, "Yachiyo Electronics, Ltd.", "Space Stranger 2", GAME_NO_SOUND ) +GAMEL( 1978, sstrangr, 0, sstrangr, sstrangr, driver_device, 0, ROT270, "Yachiyo Electronics, Ltd.", "Space Stranger", GAME_NO_SOUND | GAME_SUPPORTS_SAVE, layout_sstrangr ) +GAME( 1979, sstrangr2,sstrangr, sstrngr2, sstrngr2, driver_device, 0, ROT270, "Yachiyo Electronics, Ltd.", "Space Stranger 2", GAME_NO_SOUND | GAME_SUPPORTS_SAVE ) diff --git a/src/mame/drivers/sub.c b/src/mame/drivers/sub.c index d9b807cdc12..11a3100c313 100644 --- a/src/mame/drivers/sub.c +++ b/src/mame/drivers/sub.c @@ -119,39 +119,45 @@ class sub_state : public driver_device public: sub_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_palette(*this, "palette"), m_attr(*this, "attr"), m_vid(*this, "vid"), m_spriteram(*this, "spriteram"), m_spriteram2(*this, "spriteram2"), - m_scrolly(*this, "scrolly"), - m_maincpu(*this, "maincpu"), - m_soundcpu(*this, "soundcpu"), - m_gfxdecode(*this, "gfxdecode"), - m_palette(*this, "palette") { } + m_scrolly(*this, "scrolly") { } + + required_device m_maincpu; + required_device m_soundcpu; + required_device m_gfxdecode; + required_device m_palette; required_shared_ptr m_attr; required_shared_ptr m_vid; required_shared_ptr m_spriteram; required_shared_ptr m_spriteram2; required_shared_ptr m_scrolly; + UINT8 m_nmi_en; - DECLARE_WRITE8_MEMBER(subm_to_sound_w); + + DECLARE_WRITE8_MEMBER(to_sound_w); DECLARE_WRITE8_MEMBER(nmi_mask_w); - virtual void video_start(); + + virtual void machine_start(); DECLARE_PALETTE_INIT(sub); - UINT32 screen_update_sub(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - INTERRUPT_GEN_MEMBER(subm_sound_irq); - required_device m_maincpu; - required_device m_soundcpu; - required_device m_gfxdecode; - required_device m_palette; + + UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + INTERRUPT_GEN_MEMBER(sound_irq); }; -void sub_state::video_start() +void sub_state::machine_start() { + save_item(NAME(m_nmi_en)); } -UINT32 sub_state::screen_update_sub(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +UINT32 sub_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { gfx_element *gfx = m_gfxdecode->gfx(0); gfx_element *gfx_1 = m_gfxdecode->gfx(1); @@ -255,7 +261,7 @@ static ADDRESS_MAP_START( subm_map, AS_PROGRAM, 8, sub_state ) AM_RANGE(0xf060, 0xf060) AM_READ_PORT("IN0") ADDRESS_MAP_END -WRITE8_MEMBER(sub_state::subm_to_sound_w) +WRITE8_MEMBER(sub_state::to_sound_w) { soundlatch_byte_w(space, 0, data & 0xff); m_soundcpu->set_input_line(0, HOLD_LINE); @@ -268,7 +274,7 @@ WRITE8_MEMBER(sub_state::nmi_mask_w) static ADDRESS_MAP_START( subm_io, AS_IO, 8, sub_state ) ADDRESS_MAP_GLOBAL_MASK(0xff) - AM_RANGE(0x00, 0x00) AM_READ(soundlatch2_byte_r) AM_WRITE(subm_to_sound_w) // to/from sound CPU + AM_RANGE(0x00, 0x00) AM_READ(soundlatch2_byte_r) AM_WRITE(to_sound_w) // to/from sound CPU ADDRESS_MAP_END static ADDRESS_MAP_START( subm_sound_map, AS_PROGRAM, 8, sub_state ) @@ -425,7 +431,7 @@ PALETTE_INIT_MEMBER(sub_state, sub) } -INTERRUPT_GEN_MEMBER(sub_state::subm_sound_irq) +INTERRUPT_GEN_MEMBER(sub_state::sound_irq) { if(m_nmi_en) m_soundcpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE); @@ -442,7 +448,7 @@ static MACHINE_CONFIG_START( sub, sub_state ) MCFG_CPU_ADD("soundcpu", Z80,MASTER_CLOCK/6) /* ? MHz */ MCFG_CPU_PROGRAM_MAP(subm_sound_map) MCFG_CPU_IO_MAP(subm_sound_io) - MCFG_CPU_PERIODIC_INT_DRIVER(sub_state, subm_sound_irq, 120) //??? + MCFG_CPU_PERIODIC_INT_DRIVER(sub_state, sound_irq, 120) //??? /* video hardware */ @@ -451,7 +457,7 @@ static MACHINE_CONFIG_START( sub, sub_state ) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) MCFG_SCREEN_SIZE(256, 256) MCFG_SCREEN_VISIBLE_AREA(0, 256-1, 16, 256-16-1) - MCFG_SCREEN_UPDATE_DRIVER(sub_state, screen_update_sub) + MCFG_SCREEN_UPDATE_DRIVER(sub_state, screen_update) MCFG_SCREEN_PALETTE("palette") MCFG_GFXDECODE_ADD("gfxdecode", "palette", sub) @@ -502,4 +508,4 @@ ROM_START( sub ) ROM_LOAD( "prom pos c8 n82s129", 0x0600, 0x100, CRC(351e1ef8) SHA1(530c9012ff5abda1c4ba9787ca999ca1ae1a893d) ) ROM_END -GAME( 1985, sub, 0, sub, sub, driver_device, 0, ROT270, "Sigma Enterprises Inc.", "Submarine (Sigma)", GAME_NO_COCKTAIL ) +GAME( 1985, sub, 0, sub, sub, driver_device, 0, ROT270, "Sigma Enterprises Inc.", "Submarine (Sigma)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE ) diff --git a/src/mame/drivers/subs.c b/src/mame/drivers/subs.c index 4e45a78fdd5..327dfcdf941 100644 --- a/src/mame/drivers/subs.c +++ b/src/mame/drivers/subs.c @@ -47,21 +47,21 @@ PALETTE_INIT_MEMBER(subs_state, subs) static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, subs_state ) ADDRESS_MAP_GLOBAL_MASK(0x3fff) - AM_RANGE(0x0000, 0x0000) AM_WRITE(subs_noise_reset_w) - AM_RANGE(0x0000, 0x0007) AM_READ(subs_control_r) - AM_RANGE(0x0020, 0x0020) AM_WRITE(subs_steer_reset_w) - AM_RANGE(0x0020, 0x0027) AM_READ(subs_coin_r) -// AM_RANGE(0x0040, 0x0040) AM_WRITE(subs_timer_reset_w) - AM_RANGE(0x0060, 0x0063) AM_READ(subs_options_r) - AM_RANGE(0x0060, 0x0061) AM_WRITE(subs_lamp1_w) - AM_RANGE(0x0062, 0x0063) AM_WRITE(subs_lamp2_w) - AM_RANGE(0x0064, 0x0065) AM_WRITE(subs_sonar2_w) - AM_RANGE(0x0066, 0x0067) AM_WRITE(subs_sonar1_w) + AM_RANGE(0x0000, 0x0000) AM_WRITE(noise_reset_w) + AM_RANGE(0x0000, 0x0007) AM_READ(control_r) + AM_RANGE(0x0020, 0x0020) AM_WRITE(steer_reset_w) + AM_RANGE(0x0020, 0x0027) AM_READ(coin_r) +// AM_RANGE(0x0040, 0x0040) AM_WRITE(timer_reset_w) + AM_RANGE(0x0060, 0x0063) AM_READ(options_r) + AM_RANGE(0x0060, 0x0061) AM_WRITE(lamp1_w) + AM_RANGE(0x0062, 0x0063) AM_WRITE(lamp2_w) + AM_RANGE(0x0064, 0x0065) AM_WRITE(sonar2_w) + AM_RANGE(0x0066, 0x0067) AM_WRITE(sonar1_w) // Schematics show crash and explode reversed. But this is proper. - AM_RANGE(0x0068, 0x0069) AM_WRITE(subs_explode_w) - AM_RANGE(0x006a, 0x006b) AM_WRITE(subs_crash_w) - AM_RANGE(0x006c, 0x006d) AM_WRITE(subs_invert1_w) - AM_RANGE(0x006e, 0x006f) AM_WRITE(subs_invert2_w) + AM_RANGE(0x0068, 0x0069) AM_WRITE(explode_w) + AM_RANGE(0x006a, 0x006b) AM_WRITE(crash_w) + AM_RANGE(0x006c, 0x006d) AM_WRITE(invert1_w) + AM_RANGE(0x006e, 0x006f) AM_WRITE(invert2_w) AM_RANGE(0x0090, 0x009f) AM_SHARE("spriteram") AM_RANGE(0x0000, 0x01ff) AM_RAM AM_RANGE(0x0800, 0x0bff) AM_RAM AM_SHARE("videoram") @@ -179,7 +179,7 @@ static MACHINE_CONFIG_START( subs, subs_state ) /* basic machine hardware */ MCFG_CPU_ADD("maincpu", M6502,12096000/16) /* clock input is the "4H" signal */ MCFG_CPU_PROGRAM_MAP(main_map) - MCFG_CPU_PERIODIC_INT_DRIVER(subs_state, subs_interrupt, 4*57) + MCFG_CPU_PERIODIC_INT_DRIVER(subs_state, interrupt, 4*57) /* video hardware */ @@ -195,7 +195,7 @@ static MACHINE_CONFIG_START( subs, subs_state ) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */) MCFG_SCREEN_SIZE(32*8, 32*8) MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 28*8-1) - MCFG_SCREEN_UPDATE_DRIVER(subs_state, screen_update_subs_left) + MCFG_SCREEN_UPDATE_DRIVER(subs_state, screen_update_left) MCFG_SCREEN_PALETTE("palette") MCFG_SCREEN_ADD("rscreen", RASTER) @@ -203,7 +203,7 @@ static MACHINE_CONFIG_START( subs, subs_state ) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */) MCFG_SCREEN_SIZE(32*8, 32*8) MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 28*8-1) - MCFG_SCREEN_UPDATE_DRIVER(subs_state, screen_update_subs_right) + MCFG_SCREEN_UPDATE_DRIVER(subs_state, screen_update_right) MCFG_SCREEN_PALETTE("palette") @@ -250,4 +250,4 @@ ROM_END * *************************************/ -GAME( 1977, subs, 0, subs, subs, driver_device, 0, ROT0, "Atari", "Subs", GAME_IMPERFECT_SOUND ) +GAME( 1977, subs, 0, subs, subs, driver_device, 0, ROT0, "Atari", "Subs", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE ) diff --git a/src/mame/drivers/suna16.c b/src/mame/drivers/suna16.c index df926653c97..2677c793f41 100644 --- a/src/mame/drivers/suna16.c +++ b/src/mame/drivers/suna16.c @@ -25,7 +25,6 @@ Year + Game By Board Hardware #include "emu.h" #include "cpu/z80/z80.h" #include "cpu/m68000/m68000.h" -#include "sound/dac.h" #include "sound/2151intf.h" #include "sound/ay8910.h" #include "sound/3526intf.h" @@ -39,7 +38,7 @@ Year + Game By Board Hardware ***************************************************************************/ -WRITE16_MEMBER(suna16_state::suna16_soundlatch_w) +WRITE16_MEMBER(suna16_state::soundlatch_w) { if (ACCESSING_BITS_0_7) { @@ -92,11 +91,11 @@ WRITE16_MEMBER(suna16_state::bestbest_coin_w) static ADDRESS_MAP_START( bssoccer_map, AS_PROGRAM, 16, suna16_state ) AM_RANGE(0x000000, 0x1fffff) AM_ROM // ROM AM_RANGE(0x200000, 0x203fff) AM_RAM // RAM - AM_RANGE(0x400000, 0x4001ff) AM_READWRITE(suna16_paletteram16_r, suna16_paletteram16_w) // Banked Palette + AM_RANGE(0x400000, 0x4001ff) AM_READWRITE(paletteram_r, paletteram_w) // Banked Palette AM_RANGE(0x400200, 0x400fff) AM_RAM // AM_RANGE(0x600000, 0x61ffff) AM_RAM AM_SHARE("spriteram") // Sprites - AM_RANGE(0xa00000, 0xa00001) AM_READ_PORT("P1") AM_WRITE(suna16_soundlatch_w) // To Sound CPU - AM_RANGE(0xa00002, 0xa00003) AM_READ_PORT("P2") AM_WRITE(suna16_flipscreen_w) // Flip Screen + AM_RANGE(0xa00000, 0xa00001) AM_READ_PORT("P1") AM_WRITE(soundlatch_w) // To Sound CPU + AM_RANGE(0xa00002, 0xa00003) AM_READ_PORT("P2") AM_WRITE(flipscreen_w) // Flip Screen AM_RANGE(0xa00004, 0xa00005) AM_READ_PORT("P3") AM_WRITE(bssoccer_leds_w) // Leds AM_RANGE(0xa00006, 0xa00007) AM_READ_PORT("P4") AM_WRITENOP // ? IRQ 1 Ack AM_RANGE(0xa00008, 0xa00009) AM_READ_PORT("DSW1") AM_WRITENOP // ? IRQ 2 Ack @@ -148,12 +147,12 @@ WRITE8_MEMBER(suna16_state::uballoon_prot_w) static ADDRESS_MAP_START( uballoon_map, AS_PROGRAM, 16, suna16_state ) AM_RANGE(0x000000, 0x0fffff) AM_ROM // ROM AM_RANGE(0x800000, 0x803fff) AM_RAM // RAM - AM_RANGE(0x200000, 0x2001ff) AM_READWRITE(suna16_paletteram16_r, suna16_paletteram16_w) // Banked Palette + AM_RANGE(0x200000, 0x2001ff) AM_READWRITE(paletteram_r, paletteram_w) // Banked Palette AM_RANGE(0x200200, 0x200fff) AM_RAM // AM_RANGE(0x400000, 0x41ffff) AM_MIRROR(0x1e0000) AM_RAM AM_SHARE("spriteram") // Sprites - AM_RANGE(0x600000, 0x600001) AM_READ_PORT("P1") AM_WRITE(suna16_soundlatch_w) // To Sound CPU + AM_RANGE(0x600000, 0x600001) AM_READ_PORT("P1") AM_WRITE(soundlatch_w) // To Sound CPU AM_RANGE(0x600002, 0x600003) AM_READ_PORT("P2") - AM_RANGE(0x600004, 0x600005) AM_READ_PORT("DSW1") AM_WRITE(suna16_flipscreen_w) // Flip Screen + AM_RANGE(0x600004, 0x600005) AM_READ_PORT("DSW1") AM_WRITE(flipscreen_w) // Flip Screen AM_RANGE(0x600006, 0x600007) AM_READ_PORT("DSW2") AM_RANGE(0x600008, 0x600009) AM_WRITE(uballoon_leds_w) // Leds AM_RANGE(0x60000c, 0x60000d) AM_WRITENOP // ? IRQ 1 Ack @@ -168,11 +167,11 @@ ADDRESS_MAP_END static ADDRESS_MAP_START( sunaq_map, AS_PROGRAM, 16, suna16_state ) AM_RANGE(0x000000, 0x0fffff) AM_ROM // ROM - AM_RANGE(0x500000, 0x500001) AM_READ_PORT("P1") AM_WRITE(suna16_soundlatch_w) // To Sound CPU - AM_RANGE(0x500002, 0x500003) AM_READ_PORT("P2") AM_WRITE(suna16_flipscreen_w) // Flip Screen + AM_RANGE(0x500000, 0x500001) AM_READ_PORT("P1") AM_WRITE(soundlatch_w) // To Sound CPU + AM_RANGE(0x500002, 0x500003) AM_READ_PORT("P2") AM_WRITE(flipscreen_w) // Flip Screen AM_RANGE(0x500004, 0x500005) AM_READ_PORT("DSW1") AM_RANGE(0x500006, 0x500007) AM_READ_PORT("DSW2") // (unused?) - AM_RANGE(0x540000, 0x5401ff) AM_READWRITE(suna16_paletteram16_r, suna16_paletteram16_w) + AM_RANGE(0x540000, 0x5401ff) AM_READWRITE(paletteram_r, paletteram_w) AM_RANGE(0x540200, 0x540fff) AM_RAM // RAM AM_RANGE(0x580000, 0x583fff) AM_RAM // RAM AM_RANGE(0x5c0000, 0x5dffff) AM_RAM AM_SHARE("spriteram") // Sprites @@ -202,18 +201,23 @@ WRITE8_MEMBER(suna16_state::bestbest_prot_w) static ADDRESS_MAP_START( bestbest_map, AS_PROGRAM, 16, suna16_state ) AM_RANGE( 0x000000, 0x03ffff ) AM_ROM AM_MIRROR(0xc0000) // ROM AM_RANGE( 0x200000, 0x2fffff ) AM_ROM AM_REGION("user1", 0) // ROM - AM_RANGE( 0x500000, 0x500001 ) AM_READ_PORT("P1") AM_WRITE(suna16_soundlatch_w) // To Sound CPU + AM_RANGE( 0x500000, 0x500001 ) AM_READ_PORT("P1") AM_WRITE(soundlatch_w) // To Sound CPU AM_RANGE( 0x500002, 0x500003 ) AM_READ_PORT("P2") AM_WRITE(bestbest_flipscreen_w) // P2 + Coins, Flip Screen AM_RANGE( 0x500004, 0x500005 ) AM_READ_PORT("DSW") AM_WRITE(bestbest_coin_w) // Coin Counter AM_RANGE( 0x500008, 0x500009 ) AM_WRITE8(bestbest_prot_w, 0x00ff) // Protection AM_RANGE( 0x500018, 0x500019 ) AM_READ8(bestbest_prot_r, 0x00ff) // " - AM_RANGE( 0x540000, 0x540fff ) AM_READWRITE(suna16_paletteram16_r, suna16_paletteram16_w ) // Banked(?) Palette + AM_RANGE( 0x540000, 0x540fff ) AM_READWRITE(paletteram_r, paletteram_w ) // Banked(?) Palette AM_RANGE( 0x541000, 0x54ffff ) AM_RAM // AM_RANGE( 0x580000, 0x58ffff ) AM_RAM // RAM AM_RANGE( 0x5c0000, 0x5dffff ) AM_RAM AM_SHARE("spriteram") // Sprites (Chip 1) AM_RANGE( 0x5e0000, 0x5fffff ) AM_RAM AM_SHARE("spriteram2") // Sprites (Chip 2) ADDRESS_MAP_END +MACHINE_START_MEMBER(suna16_state,bestbest) +{ + save_item(NAME(m_prot)); +} + /*************************************************************************** @@ -330,11 +334,11 @@ ADDRESS_MAP_END /* 2 DACs per CPU - 4 bits per sample */ -WRITE8_MEMBER(suna16_state::bssoccer_DAC1_w) +WRITE8_MEMBER(suna16_state::DAC1_w) { m_dac1->write_unsigned8( (data & 0xf) * 0x11 ); } -WRITE8_MEMBER(suna16_state::bssoccer_DAC2_w) +WRITE8_MEMBER(suna16_state::DAC2_w) { m_dac2->write_unsigned8( (data & 0xf) * 0x11 ); } @@ -350,8 +354,8 @@ WRITE8_MEMBER(suna16_state::bssoccer_DAC4_w) static ADDRESS_MAP_START( bssoccer_pcm_1_io_map, AS_IO, 8, suna16_state ) ADDRESS_MAP_GLOBAL_MASK(0xff) AM_RANGE(0x00, 0x00) AM_READ(soundlatch2_byte_r) // From The Sound Z80 - AM_RANGE(0x00, 0x00) AM_WRITE(bssoccer_DAC1_w) // 2 x DAC - AM_RANGE(0x01, 0x01) AM_WRITE(bssoccer_DAC2_w) // 2 x DAC + AM_RANGE(0x00, 0x00) AM_WRITE(DAC1_w) // 2 x DAC + AM_RANGE(0x01, 0x01) AM_WRITE(DAC2_w) // 2 x DAC AM_RANGE(0x03, 0x03) AM_WRITE(bssoccer_pcm_1_bankswitch_w) // Rom Bank ADDRESS_MAP_END @@ -387,14 +391,16 @@ ADDRESS_MAP_END static ADDRESS_MAP_START( uballoon_pcm_1_io_map, AS_IO, 8, suna16_state ) ADDRESS_MAP_GLOBAL_MASK(0xff) AM_RANGE(0x00, 0x00) AM_READ(soundlatch2_byte_r) // From The Sound Z80 - AM_RANGE(0x00, 0x00) AM_WRITE(bssoccer_DAC1_w) // 2 x DAC - AM_RANGE(0x01, 0x01) AM_WRITE(bssoccer_DAC2_w) // 2 x DAC + AM_RANGE(0x00, 0x00) AM_WRITE(DAC1_w) // 2 x DAC + AM_RANGE(0x01, 0x01) AM_WRITE(DAC2_w) // 2 x DAC AM_RANGE(0x03, 0x03) AM_WRITE(uballoon_pcm_1_bankswitch_w) // Rom Bank ADDRESS_MAP_END MACHINE_START_MEMBER(suna16_state,uballoon) { membank("bank1")->configure_entries(0, 2, memregion("pcm1")->base() + 0x400, 0x10000); + + save_item(NAME(m_prot)); } MACHINE_RESET_MEMBER(suna16_state,uballoon) @@ -415,8 +421,8 @@ ADDRESS_MAP_END static ADDRESS_MAP_START( bestbest_pcm_1_iomap, AS_IO, 8, suna16_state ) ADDRESS_MAP_GLOBAL_MASK(0xff) AM_RANGE(0x00, 0x00) AM_READ (soundlatch2_byte_r ) // From The Sound Z80 - AM_RANGE(0x00, 0x00) AM_MIRROR(0x02) AM_WRITE(bssoccer_DAC1_w) // 2 x DAC - AM_RANGE(0x01, 0x01) AM_MIRROR(0x02) AM_WRITE(bssoccer_DAC2_w) // 2 x DAC + AM_RANGE(0x00, 0x00) AM_MIRROR(0x02) AM_WRITE(DAC1_w) // 2 x DAC + AM_RANGE(0x01, 0x01) AM_MIRROR(0x02) AM_WRITE(DAC2_w) // 2 x DAC ADDRESS_MAP_END /*************************************************************************** @@ -830,7 +836,7 @@ static MACHINE_CONFIG_START( bssoccer, suna16_state ) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) MCFG_SCREEN_SIZE(256, 256) MCFG_SCREEN_VISIBLE_AREA(0, 256-1, 0+16, 256-16-1) - MCFG_SCREEN_UPDATE_DRIVER(suna16_state, screen_update_suna16) + MCFG_SCREEN_UPDATE_DRIVER(suna16_state, screen_update) MCFG_SCREEN_PALETTE("palette") MCFG_GFXDECODE_ADD("gfxdecode", "palette", suna16) @@ -890,7 +896,7 @@ static MACHINE_CONFIG_START( uballoon, suna16_state ) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) MCFG_SCREEN_SIZE(256, 256) MCFG_SCREEN_VISIBLE_AREA(0, 256-1, 0+16, 256-16-1) - MCFG_SCREEN_UPDATE_DRIVER(suna16_state, screen_update_suna16) + MCFG_SCREEN_UPDATE_DRIVER(suna16_state, screen_update) MCFG_SCREEN_PALETTE("palette") MCFG_GFXDECODE_ADD("gfxdecode", "palette", suna16) @@ -939,7 +945,7 @@ static MACHINE_CONFIG_START( sunaq, suna16_state ) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) MCFG_SCREEN_SIZE(256, 256) MCFG_SCREEN_VISIBLE_AREA(0, 256-1, 0+16, 256-16-1) - MCFG_SCREEN_UPDATE_DRIVER(suna16_state, screen_update_suna16) + MCFG_SCREEN_UPDATE_DRIVER(suna16_state, screen_update) MCFG_SCREEN_PALETTE("palette") MCFG_GFXDECODE_ADD("gfxdecode", "palette", suna16) @@ -986,6 +992,8 @@ 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 */ MCFG_SCREEN_ADD("screen", RASTER) @@ -1357,8 +1365,8 @@ ROM_END ***************************************************************************/ -GAME( 1994, bestbest, 0, bestbest, bestbest, driver_device, 0, ROT0, "SunA", "Best Of Best", 0 ) -GAME( 1994, sunaq, 0, sunaq, sunaq, driver_device, 0, ROT0, "SunA", "SunA Quiz 6000 Academy (940620-6)", 0 ) // Date/Version on-screen is 940620-6, but in the program rom it's 1994,6,30 K.H.T V6.00 -GAME( 1996, bssoccer, 0, bssoccer, bssoccer, driver_device, 0, ROT0, "SunA (Unico license)", "Back Street Soccer (KRB-0031 PCB)", 0 ) -GAME( 1996, bssoccera, bssoccer, bssoccer, bssoccer, driver_device, 0, ROT0, "SunA (Unico license)", "Back Street Soccer (KRB-0032A PCB)", 0 ) -GAME( 1996, uballoon, 0, uballoon, uballoon, driver_device, 0, ROT0, "SunA (Unico license)", "Ultra Balloon", 0 ) +GAME( 1994, bestbest, 0, bestbest, bestbest, driver_device, 0, ROT0, "SunA", "Best Of Best", GAME_SUPPORTS_SAVE ) +GAME( 1994, sunaq, 0, sunaq, sunaq, driver_device, 0, ROT0, "SunA", "SunA Quiz 6000 Academy (940620-6)", GAME_SUPPORTS_SAVE ) // Date/Version on-screen is 940620-6, but in the program rom it's 1994,6,30 K.H.T V6.00 +GAME( 1996, bssoccer, 0, bssoccer, bssoccer, driver_device, 0, ROT0, "SunA (Unico license)", "Back Street Soccer (KRB-0031 PCB)", GAME_SUPPORTS_SAVE ) +GAME( 1996, bssoccera, bssoccer, bssoccer, bssoccer, driver_device, 0, ROT0, "SunA (Unico license)", "Back Street Soccer (KRB-0032A PCB)", GAME_SUPPORTS_SAVE ) +GAME( 1996, uballoon, 0, uballoon, uballoon, driver_device, 0, ROT0, "SunA (Unico license)", "Ultra Balloon", GAME_SUPPORTS_SAVE ) diff --git a/src/mame/drivers/supdrapo.c b/src/mame/drivers/supdrapo.c index 2166afa9c9d..84c58873ec1 100644 --- a/src/mame/drivers/supdrapo.c +++ b/src/mame/drivers/supdrapo.c @@ -27,11 +27,11 @@ - Reworked inputs to match the standard poker inputs names/layout. - Hooked the payout switch. - - Hooked a watchdog circuitery, that seems intended to reset + - Hooked a watchdog circuitry, that seems intended to reset the game and/or an external device. - Added machine start & reset. - All clocks pre defined. - - Added ay8910 interfase as a preliminary attempt to analyze the unknown + - Added ay8910 interface as a preliminary attempt to analyze the unknown port writes when these ports are set as input. - Figured out the following DIP switches: Auto Bet (No, Yes). @@ -72,18 +72,24 @@ class supdrapo_state : public driver_device public: supdrapo_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), - m_col_line(*this, "col_line"), - m_videoram(*this, "videoram"), - m_char_bank(*this, "char_bank"), m_maincpu(*this, "maincpu"), m_gfxdecode(*this, "gfxdecode"), - m_palette(*this, "palette") { } + m_palette(*this, "palette"), + m_col_line(*this, "col_line"), + m_videoram(*this, "videoram"), + m_char_bank(*this, "char_bank") { } + required_device m_maincpu; + required_device m_gfxdecode; + required_device m_palette; + required_shared_ptr m_col_line; required_shared_ptr m_videoram; required_shared_ptr m_char_bank; + UINT8 m_wdog; - DECLARE_READ8_MEMBER(sdpoker_rng_r); + + DECLARE_READ8_MEMBER(rng_r); DECLARE_WRITE8_MEMBER(wdog8000_w); DECLARE_WRITE8_MEMBER(debug8004_w); DECLARE_WRITE8_MEMBER(debug7c00_w); @@ -91,14 +97,13 @@ 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_supdrapo(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - required_device m_maincpu; - required_device m_gfxdecode; - required_device m_palette; + + UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); }; @@ -111,7 +116,7 @@ void supdrapo_state::video_start() } -UINT32 supdrapo_state::screen_update_supdrapo(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +UINT32 supdrapo_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int x, y; int count; @@ -171,7 +176,7 @@ PALETTE_INIT_MEMBER(supdrapo_state, supdrapo) R/W Handlers **********************************************************************/ -READ8_MEMBER(supdrapo_state::sdpoker_rng_r) +READ8_MEMBER(supdrapo_state::rng_r) { return machine().rand(); } @@ -251,6 +256,7 @@ WRITE8_MEMBER(supdrapo_state::payout_w) void supdrapo_state::machine_start() { + save_item(NAME(m_wdog)); } @@ -282,7 +288,7 @@ static ADDRESS_MAP_START( sdpoker_mem, AS_PROGRAM, 8, supdrapo_state ) AM_RANGE(0x8005, 0x8005) AM_READ_PORT("SW1") AM_RANGE(0x8006, 0x8006) AM_READ_PORT("SW2") AM_RANGE(0x9000, 0x90ff) AM_RAM AM_SHARE("nvram") - AM_RANGE(0x9400, 0x9400) AM_READ(sdpoker_rng_r) + AM_RANGE(0x9400, 0x9400) AM_READ(rng_r) AM_RANGE(0x9800, 0x9801) AM_DEVWRITE("aysnd", ay8910_device, data_address_w) ADDRESS_MAP_END @@ -453,7 +459,7 @@ static MACHINE_CONFIG_START( supdrapo, supdrapo_state ) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) MCFG_SCREEN_SIZE(256, 256) MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 32*8-1) - MCFG_SCREEN_UPDATE_DRIVER(supdrapo_state, screen_update_supdrapo) + MCFG_SCREEN_UPDATE_DRIVER(supdrapo_state, screen_update) MCFG_SCREEN_PALETTE("palette") MCFG_GFXDECODE_ADD("gfxdecode", "palette", supdrapo) @@ -600,6 +606,6 @@ ROM_END **********************************************************************/ /* YEAR NAME PARENT MACHINE INPUT INIT ROT COMPANY FULLNAME FLAGS... */ -GAME( 1983, supdrapo, 0, supdrapo, supdrapo, driver_device, 0, ROT90, "Valadon Automation (Stern Electronics license)", "Super Draw Poker (set 1)", 0 ) -GAME( 1983, supdrapoa, supdrapo, supdrapo, supdrapo, driver_device, 0, ROT90, "Valadon Automation / Jeutel", "Super Draw Poker (set 2)", 0 ) -GAME( 1983, supdrapob, supdrapo, supdrapo, supdrapo, driver_device, 0, ROT90, "bootleg", "Super Draw Poker (bootleg)", 0 ) +GAME( 1983, supdrapo, 0, supdrapo, supdrapo, driver_device, 0, ROT90, "Valadon Automation (Stern Electronics license)", "Super Draw Poker (set 1)", GAME_SUPPORTS_SAVE ) +GAME( 1983, supdrapoa, supdrapo, supdrapo, supdrapo, driver_device, 0, ROT90, "Valadon Automation / Jeutel", "Super Draw Poker (set 2)", GAME_SUPPORTS_SAVE ) +GAME( 1983, supdrapob, supdrapo, supdrapo, supdrapo, driver_device, 0, ROT90, "bootleg", "Super Draw Poker (bootleg)", GAME_SUPPORTS_SAVE ) diff --git a/src/mame/drivers/suprgolf.c b/src/mame/drivers/suprgolf.c index 614faaa8052..368fe3ded91 100644 --- a/src/mame/drivers/suprgolf.c +++ b/src/mame/drivers/suprgolf.c @@ -33,14 +33,20 @@ class suprgolf_state : public driver_device public: suprgolf_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), - m_videoram(*this, "videoram"), m_maincpu(*this, "maincpu"), m_msm(*this, "msm"), m_gfxdecode(*this, "gfxdecode"), - m_palette(*this, "palette") { } + m_palette(*this, "palette"), + m_videoram(*this, "videoram") { } + + required_device m_maincpu; + required_device m_msm; + required_device m_gfxdecode; + required_device m_palette; + + required_shared_ptr m_videoram; tilemap_t *m_tilemap; - required_shared_ptr m_videoram; UINT8 *m_paletteram; UINT8 *m_bg_vram; UINT16 *m_bg_fb; @@ -54,34 +60,33 @@ public: UINT8 m_palette_switch; UINT8 m_bg_vreg_test; UINT8 m_toggle; - DECLARE_READ8_MEMBER(suprgolf_videoram_r); - DECLARE_WRITE8_MEMBER(suprgolf_videoram_w); - DECLARE_READ8_MEMBER(suprgolf_bg_vram_r); - DECLARE_WRITE8_MEMBER(suprgolf_bg_vram_w); - DECLARE_WRITE8_MEMBER(suprgolf_pen_w); + + DECLARE_READ8_MEMBER(videoram_r); + DECLARE_WRITE8_MEMBER(videoram_w); + DECLARE_READ8_MEMBER(bg_vram_r); + DECLARE_WRITE8_MEMBER(bg_vram_w); + DECLARE_WRITE8_MEMBER(pen_w); DECLARE_WRITE8_MEMBER(adpcm_data_w); DECLARE_WRITE8_MEMBER(rom2_bank_select_w); - DECLARE_READ8_MEMBER(suprgolf_vregs_r); - DECLARE_WRITE8_MEMBER(suprgolf_vregs_w); + DECLARE_READ8_MEMBER(vregs_r); + DECLARE_WRITE8_MEMBER(vregs_w); DECLARE_READ8_MEMBER(rom_bank_select_r); DECLARE_WRITE8_MEMBER(rom_bank_select_w); DECLARE_READ8_MEMBER(pedal_extra_bits_r); DECLARE_READ8_MEMBER(p1_r); DECLARE_READ8_MEMBER(p2_r); - DECLARE_WRITE8_MEMBER(suprgolf_writeA); - DECLARE_WRITE8_MEMBER(suprgolf_writeB); - DECLARE_DRIVER_INIT(suprgolf); + 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_reset(); virtual void video_start(); - UINT32 screen_update_suprgolf(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - DECLARE_WRITE_LINE_MEMBER(irqhandler); - DECLARE_WRITE_LINE_MEMBER(adpcm_int); - required_device m_maincpu; - required_device m_msm; - required_device m_gfxdecode; - required_device m_palette; + + UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); }; TILE_GET_INFO_MEMBER(suprgolf_state::get_tile_info) @@ -104,9 +109,19 @@ 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)); + save_item(NAME(m_palette_switch)); + save_item(NAME(m_bg_vreg_test)); + save_pointer(NAME(m_paletteram), 0x1000); + save_pointer(NAME(m_bg_vram), 0x2000*0x20); + save_pointer(NAME(m_bg_fb), 0x2000*0x20); + save_pointer(NAME(m_fg_fb), 0x2000*0x20); } -UINT32 suprgolf_state::screen_update_suprgolf(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +UINT32 suprgolf_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int x,y,count,color; bitmap.fill(m_palette->black_pen(), cliprect); @@ -150,7 +165,7 @@ UINT32 suprgolf_state::screen_update_suprgolf(screen_device &screen, bitmap_ind1 return 0; } -READ8_MEMBER(suprgolf_state::suprgolf_videoram_r) +READ8_MEMBER(suprgolf_state::videoram_r) { if (m_palette_switch) return m_paletteram[offset]; @@ -158,7 +173,7 @@ READ8_MEMBER(suprgolf_state::suprgolf_videoram_r) return m_videoram[offset]; } -WRITE8_MEMBER(suprgolf_state::suprgolf_videoram_w) +WRITE8_MEMBER(suprgolf_state::videoram_w) { if(m_palette_switch) { @@ -180,12 +195,12 @@ WRITE8_MEMBER(suprgolf_state::suprgolf_videoram_w) } } -READ8_MEMBER(suprgolf_state::suprgolf_vregs_r) +READ8_MEMBER(suprgolf_state::vregs_r) { return m_vreg_bank; } -WRITE8_MEMBER(suprgolf_state::suprgolf_vregs_w) +WRITE8_MEMBER(suprgolf_state::vregs_w) { //printf("%02x\n",data); @@ -200,12 +215,12 @@ WRITE8_MEMBER(suprgolf_state::suprgolf_vregs_w) // printf("Video regs with data %02x activated\n",data); } -READ8_MEMBER(suprgolf_state::suprgolf_bg_vram_r) +READ8_MEMBER(suprgolf_state::bg_vram_r) { return m_bg_vram[offset+m_bg_bank*0x2000]; } -WRITE8_MEMBER(suprgolf_state::suprgolf_bg_vram_w) +WRITE8_MEMBER(suprgolf_state::bg_vram_w) { UINT8 hi_nibble,lo_nibble; UINT8 hi_dirty_dot,lo_dirty_dot; // helpers @@ -254,9 +269,14 @@ 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); + + save_item(NAME(m_rom_bank)); + save_item(NAME(m_msm5205next)); + save_item(NAME(m_msm_nmi_mask)); + save_item(NAME(m_toggle)); } -WRITE8_MEMBER(suprgolf_state::suprgolf_pen_w) +WRITE8_MEMBER(suprgolf_state::pen_w) { m_vreg_pen = data; } @@ -317,9 +337,9 @@ static ADDRESS_MAP_START( suprgolf_map, AS_PROGRAM, 8, suprgolf_state ) AM_RANGE(0x4000, 0x7fff) AM_ROMBANK("bank1") AM_RANGE(0x4000, 0x4000) AM_WRITE(rom2_bank_select_w ) AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank2") - AM_RANGE(0xc000, 0xdfff) AM_READWRITE(suprgolf_bg_vram_r, suprgolf_bg_vram_w ) // banked background vram - AM_RANGE(0xe000, 0xefff) AM_READWRITE(suprgolf_videoram_r, suprgolf_videoram_w ) AM_SHARE("videoram") //foreground vram + paletteram - AM_RANGE(0xf000, 0xf000) AM_WRITE(suprgolf_pen_w ) + AM_RANGE(0xc000, 0xdfff) AM_READWRITE(bg_vram_r, bg_vram_w ) // banked background vram + AM_RANGE(0xe000, 0xefff) AM_READWRITE(videoram_r, videoram_w ) AM_SHARE("videoram") //foreground vram + paletteram + AM_RANGE(0xf000, 0xf000) AM_WRITE(pen_w ) AM_RANGE(0xf800, 0xffff) AM_RAM ADDRESS_MAP_END @@ -416,21 +436,16 @@ static INPUT_PORTS_START( suprgolf ) PORT_DIPUNUSED_DIPLOC( 0x80, 0x00, "SW2:8" ) INPUT_PORTS_END -WRITE8_MEMBER(suprgolf_state::suprgolf_writeA) +WRITE8_MEMBER(suprgolf_state::writeA) { osd_printf_debug("ymwA\n"); } -WRITE8_MEMBER(suprgolf_state::suprgolf_writeB) +WRITE8_MEMBER(suprgolf_state::writeB) { osd_printf_debug("ymwA\n"); } -WRITE_LINE_MEMBER(suprgolf_state::irqhandler) -{ - //m_maincpu->set_input_line(INPUT_LINE_NMI, state ? ASSERT_LINE : CLEAR_LINE); -} - WRITE_LINE_MEMBER(suprgolf_state::adpcm_int) { m_msm->reset_w(0); @@ -485,8 +500,8 @@ static MACHINE_CONFIG_START( suprgolf, suprgolf_state ) MCFG_I8255_IN_PORTA_CB(IOPORT("SYSTEM")) MCFG_I8255_IN_PORTB_CB(READ8(suprgolf_state, rom_bank_select_r)) MCFG_I8255_OUT_PORTB_CB(WRITE8(suprgolf_state, rom_bank_select_w)) - MCFG_I8255_IN_PORTC_CB(READ8(suprgolf_state, suprgolf_vregs_r)) - MCFG_I8255_OUT_PORTC_CB(WRITE8(suprgolf_state, suprgolf_vregs_w)) + MCFG_I8255_IN_PORTC_CB(READ8(suprgolf_state, vregs_r)) + MCFG_I8255_OUT_PORTC_CB(WRITE8(suprgolf_state, vregs_w)) /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) @@ -494,7 +509,7 @@ static MACHINE_CONFIG_START( suprgolf, suprgolf_state ) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */) MCFG_SCREEN_SIZE(256, 256) MCFG_SCREEN_VISIBLE_AREA(0, 255, 0, 191) - MCFG_SCREEN_UPDATE_DRIVER(suprgolf_state, screen_update_suprgolf) + MCFG_SCREEN_UPDATE_DRIVER(suprgolf_state, screen_update) MCFG_SCREEN_PALETTE("palette") MCFG_GFXDECODE_ADD("gfxdecode", "palette", suprgolf) @@ -504,11 +519,11 @@ static MACHINE_CONFIG_START( suprgolf, suprgolf_state ) MCFG_SPEAKER_STANDARD_MONO("mono") MCFG_SOUND_ADD("ymsnd", YM2203, MASTER_CLOCK/4) /* guess */ - MCFG_YM2203_IRQ_HANDLER(WRITELINE(suprgolf_state, irqhandler)) + //MCFG_YM2203_IRQ_HANDLER(INPUTLINE("maincpu", INPUT_LINE_NMI)) MCFG_AY8910_PORT_A_READ_CB(IOPORT("DSW0")) MCFG_AY8910_PORT_B_READ_CB(IOPORT("DSW1")) - MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(suprgolf_state, suprgolf_writeA)) - MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(suprgolf_state, suprgolf_writeB)) + MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(suprgolf_state, writeA)) + MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(suprgolf_state, writeB)) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.5) MCFG_SOUND_ADD("msm", MSM5205, XTAL_384kHz) /* guess */ @@ -621,5 +636,5 @@ DRIVER_INIT_MEMBER(suprgolf_state,suprgolf) ROM[0x6d72+(0x4000*3)-0x4000] = 0x20; //patch ROM check } -GAME( 1989, suprgolf, 0, suprgolf, suprgolf, suprgolf_state, suprgolf, ROT0, "Nasco", "Super Crowns Golf (Japan)", GAME_IMPERFECT_GRAPHICS | GAME_NO_COCKTAIL ) -GAME( 1989, albatross, suprgolf, suprgolf, suprgolf, driver_device, 0, ROT0, "Nasco", "Albatross (US Prototype?)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_NO_COCKTAIL ) +GAME( 1989, suprgolf, 0, suprgolf, suprgolf, suprgolf_state, suprgolf, ROT0, "Nasco", "Super Crowns Golf (Japan)", GAME_IMPERFECT_GRAPHICS | GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE ) +GAME( 1989, albatross, suprgolf, suprgolf, suprgolf, driver_device, 0, ROT0, "Nasco", "Albatross (US Prototype?)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_NO_COCKTAIL| GAME_SUPPORTS_SAVE ) diff --git a/src/mame/drivers/suprloco.c b/src/mame/drivers/suprloco.c index 3f532300d01..67da4f20978 100644 --- a/src/mame/drivers/suprloco.c +++ b/src/mame/drivers/suprloco.c @@ -5,7 +5,7 @@ Super Locomotive driver by Zsolt Vasvari TODO: -- Bit 5 in suprloco_control_w is pulsed when loco turns "super". This is supposed +- Bit 5 in control_w is pulsed when loco turns "super". This is supposed to make red parts of sprites blink to purple, it's not clear how this is implemented in hardware, there's a hack to support it. @@ -25,7 +25,7 @@ Sega PCB 834-5137 #include "sound/sn76496.h" #include "includes/suprloco.h" -WRITE8_MEMBER(suprloco_state::suprloco_soundport_w) +WRITE8_MEMBER(suprloco_state::soundport_w) { soundlatch_byte_w(space, 0, data); m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE); @@ -42,11 +42,11 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, suprloco_state ) AM_RANGE(0xd800, 0xd800) AM_READ_PORT("P2") AM_RANGE(0xe000, 0xe000) AM_READ_PORT("DSW1") AM_RANGE(0xe001, 0xe001) AM_READ_PORT("DSW2") - AM_RANGE(0xe800, 0xe800) AM_WRITE(suprloco_soundport_w) - AM_RANGE(0xe801, 0xe801) AM_READWRITE(suprloco_control_r, suprloco_control_w) - AM_RANGE(0xf000, 0xf6ff) AM_RAM_WRITE(suprloco_videoram_w) AM_SHARE("videoram") + AM_RANGE(0xe800, 0xe800) AM_WRITE(soundport_w) + AM_RANGE(0xe801, 0xe801) AM_READWRITE(control_r, control_w) + AM_RANGE(0xf000, 0xf6ff) AM_RAM_WRITE(videoram_w) AM_SHARE("videoram") AM_RANGE(0xf700, 0xf7df) AM_RAM /* unused */ - AM_RANGE(0xf7e0, 0xf7ff) AM_RAM_WRITE(suprloco_scrollram_w) AM_SHARE("scrollram") + AM_RANGE(0xf7e0, 0xf7ff) AM_RAM_WRITE(scrollram_w) AM_SHARE("scrollram") AM_RANGE(0xf800, 0xffff) AM_RAM ADDRESS_MAP_END @@ -175,7 +175,7 @@ static MACHINE_CONFIG_START( suprloco, suprloco_state ) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(5000)) MCFG_SCREEN_SIZE(32*8, 32*8) MCFG_SCREEN_VISIBLE_AREA(1*8, 31*8-1, 0*8, 28*8-1) - MCFG_SCREEN_UPDATE_DRIVER(suprloco_state, screen_update_suprloco) + MCFG_SCREEN_UPDATE_DRIVER(suprloco_state, screen_update) MCFG_SCREEN_PALETTE("palette") MCFG_GFXDECODE_ADD("gfxdecode", "palette", suprloco) @@ -297,5 +297,5 @@ DRIVER_INIT_MEMBER(suprloco_state,suprloco) -GAME( 1982, suprloco, 0, suprloco, suprloco, suprloco_state, suprloco, ROT0, "Sega", "Super Locomotive (Rev.A)", 0 ) -GAME( 1982, suprlocoo, suprloco, suprloco, suprloco, suprloco_state, suprloco, ROT0, "Sega", "Super Locomotive", 0 ) +GAME( 1982, suprloco, 0, suprloco, suprloco, suprloco_state, suprloco, ROT0, "Sega", "Super Locomotive (Rev.A)", GAME_SUPPORTS_SAVE ) +GAME( 1982, suprlocoo, suprloco, suprloco, suprloco, suprloco_state, suprloco, ROT0, "Sega", "Super Locomotive", GAME_SUPPORTS_SAVE ) diff --git a/src/mame/drivers/suprridr.c b/src/mame/drivers/suprridr.c index 284d66c2970..98b114908b9 100644 --- a/src/mame/drivers/suprridr.c +++ b/src/mame/drivers/suprridr.c @@ -89,6 +89,12 @@ #include "sound/ay8910.h" +void suprridr_state::machine_start() +{ + save_item(NAME(m_nmi_enable)); + save_item(NAME(m_sound_data)); +} + /************************************* * * Interrupt generation @@ -164,8 +170,8 @@ WRITE8_MEMBER(suprridr_state::coin_lock_w) static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, suprridr_state ) AM_RANGE(0x0000, 0x7fff) AM_ROM AM_RANGE(0x8000, 0x87ff) AM_RAM - AM_RANGE(0x8800, 0x8bff) AM_RAM_WRITE(suprridr_bgram_w) AM_SHARE("bgram") - AM_RANGE(0x9000, 0x97ff) AM_RAM_WRITE(suprridr_fgram_w) AM_SHARE("fgram") + AM_RANGE(0x8800, 0x8bff) AM_RAM_WRITE(bgram_w) AM_SHARE("bgram") + AM_RANGE(0x9000, 0x97ff) AM_RAM_WRITE(fgram_w) AM_SHARE("fgram") AM_RANGE(0x9800, 0x983f) AM_RAM AM_RANGE(0x9840, 0x987f) AM_RAM AM_SHARE("spriteram") AM_RANGE(0x9880, 0x9bff) AM_RAM @@ -173,12 +179,12 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, suprridr_state ) AM_RANGE(0xa800, 0xa800) AM_READ_PORT("SYSTEM") AM_RANGE(0xb000, 0xb000) AM_READ_PORT("DSW") AM_WRITE(nmi_enable_w) AM_RANGE(0xb002, 0xb003) AM_WRITE(coin_lock_w) - AM_RANGE(0xb006, 0xb006) AM_WRITE(suprridr_flipx_w) - AM_RANGE(0xb007, 0xb007) AM_WRITE(suprridr_flipy_w) + AM_RANGE(0xb006, 0xb006) AM_WRITE(flipx_w) + AM_RANGE(0xb007, 0xb007) AM_WRITE(flipy_w) AM_RANGE(0xb800, 0xb800) AM_WRITE(sound_data_w) - AM_RANGE(0xc801, 0xc801) AM_WRITE(suprridr_fgdisable_w) - AM_RANGE(0xc802, 0xc802) AM_WRITE(suprridr_fgscrolly_w) - AM_RANGE(0xc804, 0xc804) AM_WRITE(suprridr_bgscrolly_w) + AM_RANGE(0xc801, 0xc801) AM_WRITE(fgdisable_w) + AM_RANGE(0xc802, 0xc802) AM_WRITE(fgscrolly_w) + AM_RANGE(0xc804, 0xc804) AM_WRITE(bgscrolly_w) AM_RANGE(0xc000, 0xefff) AM_ROM ADDRESS_MAP_END @@ -223,12 +229,12 @@ ADDRESS_MAP_END #define SUPRRIDR_P1_CONTROL_PORT_TAG ("CONTP1") #define SUPRRIDR_P2_CONTROL_PORT_TAG ("CONTP2") -CUSTOM_INPUT_MEMBER(suprridr_state::suprridr_control_r) +CUSTOM_INPUT_MEMBER(suprridr_state::control_r) { UINT32 ret; /* screen flip multiplexes controls */ - if (suprridr_is_screen_flipped()) + if (is_screen_flipped()) ret = ioport(SUPRRIDR_P2_CONTROL_PORT_TAG)->read(); else ret = ioport(SUPRRIDR_P1_CONTROL_PORT_TAG)->read(); @@ -239,7 +245,7 @@ CUSTOM_INPUT_MEMBER(suprridr_state::suprridr_control_r) static INPUT_PORTS_START( suprridr ) PORT_START("INPUTS") - PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, suprridr_state,suprridr_control_r, NULL) + PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, suprridr_state, control_r, NULL) PORT_START("SYSTEM") PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) @@ -353,7 +359,7 @@ static MACHINE_CONFIG_START( suprridr, suprridr_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, 2*8, 30*8-1) - MCFG_SCREEN_UPDATE_DRIVER(suprridr_state, screen_update_suprridr) + MCFG_SCREEN_UPDATE_DRIVER(suprridr_state, screen_update) MCFG_SCREEN_PALETTE("palette") MCFG_GFXDECODE_ADD("gfxdecode", "palette", suprridr) @@ -423,4 +429,4 @@ ROM_END * *************************************/ -GAME( 1983, suprridr, 0, suprridr, suprridr, driver_device, 0, ROT90, "Taito Corporation (Venture Line license)", "Super Rider", GAME_IMPERFECT_SOUND ) +GAME( 1983, suprridr, 0, suprridr, suprridr, driver_device, 0, ROT90, "Taito Corporation (Venture Line license)", "Super Rider", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE ) diff --git a/src/mame/drivers/taito_l.c b/src/mame/drivers/taito_l.c index 9315fdfa58c..49d9edb202e 100644 --- a/src/mame/drivers/taito_l.c +++ b/src/mame/drivers/taito_l.c @@ -2352,7 +2352,7 @@ ROM_START( puzznicj ) ROM_LOAD( "c20-05.ic3", 0x0000, 0x0144, CRC(f90e5594) SHA1(6181bb25b77028bb150c84bdc073f0457efd7eaa) ) // Confirmed/Matches Japan Set ROM_END -ROM_START( puzznici ) /* bootleg */ +ROM_START( puzznici ) /* bootleg (original main board, bootleg sub-board without MCU) */ ROM_REGION( 0x20000, "maincpu", 0 ) ROM_LOAD( "1.ic11", 0x00000, 0x20000, CRC(4612f5e0) SHA1(dc07a365414666568537d31ef01b58f2362cadaf) ) @@ -2361,6 +2361,15 @@ ROM_START( puzznici ) /* bootleg */ ROM_LOAD16_BYTE( "3.ic9", 0x00001, 0x20000, CRC(2bf5232a) SHA1(a8fc06bb8bae2ca6bd21e3a96c9ed38bb356d5d7) ) ROM_END +ROM_START( puzznicb ) /* bootleg (original main board, bootleg sub-board without MCU) */ + ROM_REGION( 0x20000, "maincpu", 0 ) + ROM_LOAD( "ic11.bin", 0x00000, 0x20000, CRC(2510df4d) SHA1(534327e3d7f847b6c0effc5fd0fb9f5da9b0d3b1) ) + + ROM_REGION( 0x20000, "gfx1", 0 ) // this has the bad line in tile 1 fixed (unused I believe) are we sure the roms used in the original sets are a good dump? + ROM_LOAD16_BYTE( "ic10.bin", 0x00000, 0x10000, CRC(be12749a) SHA1(c67d1a434486843a6776d89e905362b7db595d8d) ) + ROM_LOAD16_BYTE( "ic9.bin", 0x00001, 0x10000, CRC(0f183340) SHA1(9eef7de801eb9763313f55a38e567b92fca3bfa6) ) +ROM_END + /* Taito's Horse Shoe @@ -2588,13 +2597,13 @@ GAME( 1989, flipull, plotting, plotting, plotting, driver_device, 0, GAME( 1989, puzznic, 0, puzznic, puzznic, driver_device, 0, ROT0, "Taito Corporation Japan", "Puzznic (World)", 0 ) GAME( 1989, puzznicj, puzznic, puzznic, puzznic, driver_device, 0, ROT0, "Taito Corporation", "Puzznic (Japan)", 0 ) GAME( 1989, puzznici, puzznic, puzznici, puzznic, driver_device, 0, ROT0, "bootleg", "Puzznic (Italian bootleg)", 0 ) +GAME( 1989, puzznicb, puzznic, puzznici, puzznic, driver_device, 0, ROT0, "bootleg", "Puzznic (bootleg)", 0 ) GAME( 1990, horshoes, 0, horshoes, horshoes, driver_device, 0, ROT270, "Taito America Corporation", "American Horseshoes (US)", 0 ) GAME( 1990, palamed, 0, palamed, palamed, driver_device, 0, ROT0, "Taito Corporation", "Palamedes (Japan)", 0 ) GAME( 1993, cachat, 0, cachat, cachat, driver_device, 0, ROT0, "Taito Corporation", "Cachat (Japan)", 0 ) - GAME( 1993, tubeit, cachat, cachat, tubeit, driver_device, 0, ROT0, "bootleg", "Tube-It", 0 ) // No (c) message GAME( 199?, cubybop, 0, cachat, cubybop, driver_device, 0, ROT0, "Hot-B", "Cuby Bop (location test)", 0 ) // No (c) message, but Hot-B company logo in tile gfx @@ -2603,6 +2612,6 @@ GAME( 1992, plgirls, 0, cachat, plgirls, driver_device, 0, GAME( 1992, lagirl, plgirls, cachat, plgirls, driver_device, 0, ROT270, "bootleg", "LA Girl", 0 ) // bootleg hardware with changed title & backgrounds GAME( 1993, plgirls2, 0, cachat, plgirls2, driver_device, 0, ROT270, "Hot-B", "Play Girls 2", 0 ) -GAME( 1993, plgirls2b, plgirls2, cachat, plgirls2, driver_device, 0, ROT270, "bootleg", "Play Girls 2 (bootleg)", 0 ) // bootleg hardware (regular Z80 etc. instead of TC0090LVC, but acts the same) +GAME( 1993, plgirls2b, plgirls2, cachat, plgirls2, driver_device, 0, ROT270, "bootleg", "Play Girls 2 (bootleg)", GAME_IMPERFECT_GRAPHICS ) // bootleg hardware (regular Z80 etc. instead of TC0090LVC, but acts almost the same - scroll offset problems) GAME( 1990, evilston, 0, evilston, evilston, driver_device, 0, ROT270, "Spacy Industrial, Ltd.", "Evil Stone", GAME_IMPERFECT_SOUND ) // not Taito PCB, just uses TC0090LVC diff --git a/src/mame/drivers/thedeep.c b/src/mame/drivers/thedeep.c index cc3db30a16d..b28bb92237d 100644 --- a/src/mame/drivers/thedeep.c +++ b/src/mame/drivers/thedeep.c @@ -436,6 +436,11 @@ static MACHINE_CONFIG_START( thedeep, thedeep_state ) MCFG_PALETTE_ADD("palette", 512) MCFG_PALETTE_INIT_OWNER(thedeep_state, thedeep) + MCFG_DEVICE_ADD("spritegen", DECO_MXC06, 0) + deco_mxc06_device::set_gfx_region(*device, 0); + MCFG_DECO_MXC06_GFXDECODE("gfxdecode") + MCFG_DECO_MXC06_PALETTE("palette") + MCFG_DECO_MXC06_RAMSIZE(0x400) /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") diff --git a/src/mame/drivers/toaplan2.c b/src/mame/drivers/toaplan2.c index 67f321e0381..5d7bf8b8c74 100644 --- a/src/mame/drivers/toaplan2.c +++ b/src/mame/drivers/toaplan2.c @@ -4876,7 +4876,32 @@ ROM_START( bgareggabl ) ROM_REGION( 0x010000, "text", 0 ) ROM_LOAD( "1#-256", 0x00000, 0x08000, CRC(760dcd14) SHA1(e151e5d7ca5557277f306b9484ec021f4edf1e07) ) - ROM_LOAD( "2#-256", 0x08000, 0x08000, CRC(456dd16e) SHA1(84779ee64d3ea33ba1ba4dee39b504a81c6811a1) ) + + ROM_REGION( 0x010000, "user1", 0 ) // not graphics + ROM_LOAD( "2#-256", 0x00000, 0x08000, CRC(456dd16e) SHA1(84779ee64d3ea33ba1ba4dee39b504a81c6811a1) ) + + ROM_REGION( 0x140000, "oki", 0 ) /* ADPCM Samples */ + ROM_LOAD( "rom5.bin", 0x040000, 0x100000, CRC(f6d49863) SHA1(3a3c354852adad06e8a051511abfab7606bce382) ) +ROM_END + +ROM_START( bgareggabla ) + ROM_REGION( 0x100000, "maincpu", 0 ) /* Main 68K code */ + ROM_LOAD16_WORD_SWAP( "27c8100.mon-sys", 0x000000, 0x100000, CRC(d334e5aa) SHA1(41607b5630d7b92a96607ea95c5b55ad43745857) ) + + ROM_REGION( 0x20000, "audiocpu", 0 ) /* Sound Z80 code + bank */ + ROM_LOAD( "snd.bin", 0x00000, 0x20000, CRC(68632952) SHA1(fb834db83157948e2b420b6051102a9c6ac3969b) ) + + ROM_REGION( 0x800000, "gp9001", 0 ) + ROM_LOAD( "rom4.bin", 0x000000, 0x200000, CRC(b333d81f) SHA1(5481465f1304334fd55798be2f44324c57c2dbcb) ) + ROM_LOAD( "rom3.bin", 0x200000, 0x200000, CRC(51b9ebfb) SHA1(30e0c326f5175aa436df8dba08f6f4e08130b92f) ) + ROM_LOAD( "rom2.bin", 0x400000, 0x200000, CRC(b330e5e2) SHA1(5d48e9d56f99d093b6390e0af1609fd796df2d35) ) + ROM_LOAD( "rom1.bin", 0x600000, 0x200000, CRC(7eafdd70) SHA1(7c8da8e86c3f9491719b1d7d5d285568d7614f38) ) + + ROM_REGION( 0x010000, "text", 0 ) + ROM_LOAD( "text.bin", 0x00000, 0x08000, CRC(00d100bd) SHA1(fb6028e3519d6588a966d1b16d47453db2e51fd7)) + + ROM_REGION( 0x010000, "user1", 0 ) // not graphics + ROM_LOAD( "base.bin", 0x00000, 0x08000, CRC(456dd16e) SHA1(84779ee64d3ea33ba1ba4dee39b504a81c6811a1) ) ROM_REGION( 0x140000, "oki", 0 ) /* ADPCM Samples */ ROM_LOAD( "rom5.bin", 0x040000, 0x100000, CRC(f6d49863) SHA1(3a3c354852adad06e8a051511abfab7606bce382) ) @@ -5345,6 +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 ) // 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/ttchamp.c b/src/mame/drivers/ttchamp.c index 849c8797da6..1566f15d97b 100644 --- a/src/mame/drivers/ttchamp.c +++ b/src/mame/drivers/ttchamp.c @@ -1,8 +1,5 @@ -/* Peno Cup? - -no idea if this is the real title, I just see a large Peno Cup logo in the 2/3 roms - -looks like some kind of ping pong / tennis game? +/* Table Tennis Champions + (c) 1995 Gamart ___________________________________________________ | __ _________ __________ __________ | @@ -35,15 +32,39 @@ looks like some kind of ping pong / tennis game? The PCB is Spanish and manufacured by Gamart. ---- Need to work out how the program rom is banked ---- hw is similar to hotblock and twins +Table tennis Championships by Gamart 1995 +This game come from Gamart,an obscure spanish software house. +Hardware info: +main cpu: V30 +sound chip: oki6295 +custom chip: tpc1020bfn x2 +osc: 16 mhz +Rom files definition: +ttennis2/3 main program +ttennis1 adpcm data +ttennis4/5 graphics +*there is a pic16c84 that i cannot dump because my programmer doesn't support it. + +Dumped by tirino73 + + + + +- 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 */ #include "emu.h" #include "cpu/nec/nec.h" - +#include "sound/okim6295.h" class ttchamp_state : public driver_device { @@ -53,37 +74,47 @@ public: m_maincpu(*this, "maincpu"), m_palette(*this, "palette") { } - UINT16* m_peno_vram; UINT16* m_peno_mainram; UINT16 m_paloff; DECLARE_WRITE16_MEMBER(paloff_w); DECLARE_WRITE16_MEMBER(pcup_prgbank_w); DECLARE_WRITE16_MEMBER(paldat_w); - DECLARE_READ16_MEMBER(peno_rand); - DECLARE_READ16_MEMBER(peno_rand2); + + DECLARE_WRITE16_MEMBER(port10_w); + + DECLARE_WRITE16_MEMBER(port20_w); + DECLARE_WRITE16_MEMBER(port62_w); + + DECLARE_READ16_MEMBER(port1e_r); + + + UINT16 m_port10; + DECLARE_DRIVER_INIT(ttchamp); - DECLARE_WRITE16_MEMBER( penocup_vid_w ) - { - offset &=0x7fff; - COMBINE_DATA(&m_peno_vram[offset]); - } + DECLARE_READ16_MEMBER(ttchamp_blit_start_r); - DECLARE_READ16_MEMBER( penocup_mainram_r ) - { - return m_peno_mainram[offset]; - } + DECLARE_READ16_MEMBER(ttchamp_mem_r); + DECLARE_WRITE16_MEMBER(ttchamp_mem_w); - DECLARE_WRITE16_MEMBER( penocup_mainram_w ) - { - offset &=0x7fff; - COMBINE_DATA(&m_peno_mainram[offset]); -// COMBINE_DATA(&m_peno_vram[offset]); - } + UINT16 m_videoram0[0x10000 / 2]; +// UINT16 m_videoram1[0x10000 / 2]; + UINT16 m_videoram2[0x10000 / 2]; + + UINT16 m_mainram[0x10000 / 2]; + + int m_spritesinit; + int m_spriteswidth; + int m_spritesaddr; + + virtual void machine_start(); + UINT16* m_rom16; + UINT8* m_rom8; + virtual void video_start(); UINT32 screen_update_ttchamp(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(ttchamp_irq); @@ -91,46 +122,101 @@ public: required_device m_palette; }; - +void ttchamp_state::machine_start() +{ + m_rom16 = (UINT16*)memregion("maincpu")->base(); + m_rom8 = memregion("maincpu")->base(); +} void ttchamp_state::video_start() { - m_peno_vram = (UINT16*)auto_alloc_array_clear(machine(), UINT16, 0x10000/2); - m_peno_mainram = (UINT16*)auto_alloc_array_clear(machine(), UINT16, 0x10000/2); - - } UINT32 ttchamp_state::screen_update_ttchamp(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { + logerror("update\n"); int y,x,count; -// int i; + static const int xxx=320,yyy=204; bitmap.fill(m_palette->black_pen()); - -// for (i=0;i<256;i++) -// { -// int dat,r,g,b; -// dat=(hotblock_pal[i*2+1]<<8)|hotblock_pal[i*2]; -// -// b = (dat>>10)&0x1f; -// g = (dat>>5)&0x1f; -// r = (dat>>0)&0x1f; -// m_palette->set_pen_color(i,pal5bit(r),pal5bit(g),pal5bit(b)); -// } - + UINT8 *videoramfg; + UINT8* videorambg; + count=0; - UINT8 *videoram = (UINT8*)m_peno_vram; + videorambg = (UINT8*)m_videoram0; + videoramfg = (UINT8*)m_videoram2; + for (y=0;ybase(); - - if (ACCESSING_BITS_0_7) - { - bank = (data>>4) &0x07; - membank("bank2")->set_base(&ROM1[0x80000*(bank)]); - } -} -#endif WRITE16_MEMBER(ttchamp_state::paldat_w) { - m_palette->set_pen_color(m_paloff & 0x7fff,pal5bit(data>>0),pal5bit(data>>5),pal5bit(data>>10)); + // 0x8000 of offset is sometimes set + m_palette->set_pen_color(m_paloff & 0x3ff,pal5bit(data>>0),pal5bit(data>>5),pal5bit(data>>10)); } -READ16_MEMBER(ttchamp_state::peno_rand) + +READ16_MEMBER(ttchamp_state::ttchamp_mem_r) { - return 0xffff;// machine().rand(); + // bits 0xf0 are used too, so this is likely wrong. + + UINT16* vram; + if ((m_port10&0xf) == 0x00) + vram = m_videoram0; + else if ((m_port10&0xf) == 0x01) + vram = m_videoram2; + else if ((m_port10&0xf) == 0x03) + vram = m_videoram2; + else + { + printf("unhandled video bank %02x\n", m_port10); + vram = m_videoram2; + } + + if (offset < 0x10000 / 2) + { + return m_mainram[offset&0x7fff]; + } + else if (offset < 0x20000 / 2) + { + return vram[offset&0x7fff]; + } + else + { + UINT16 *src = m_rom16 + (0x100000/2); // can the CPU ever see the lower bank? + return src[offset]; + } } -#ifdef UNUSED_FUNCTION -READ16_MEMBER(ttchamp_state::peno_rand2) +WRITE16_MEMBER(ttchamp_state::ttchamp_mem_w) { - return machine().rand(); + // this is very strange, we use the offset (address bits) not data bits to set values.. + // I get the impression this might actually overlay the entire address range, including RAM and regular VRAM? + + // bits 0xf0 are used too, so this is likely wrong. + + UINT16* vram; + if ((m_port10&0xf) == 0x00) + vram = m_videoram0; + else if ((m_port10&0xf) == 0x01) + vram = m_videoram2; + else if ((m_port10&0xf) == 0x03) + vram = m_videoram2; + else + { + printf("unhandled video bank %02x\n", m_port10); + vram = m_videoram2; + } + + + if (m_spritesinit == 1) + { + // 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); + m_spriteswidth = offset & 0xff; + + m_spritesinit = 0; + + } + else + { + if (offset < 0x10000 / 2) + { + COMBINE_DATA(&m_mainram[offset&0x7fff]); + } + else if (offset < 0x20000 / 2) + { + COMBINE_DATA(&vram[offset&0x7fff]); + } + else if ((offset >= 0x30000 / 2) && (offset < 0x40000 / 2)) + { + // 0x30000-0x3ffff used, on Spider it's 0x20000-0x2ffff + offset &= 0x7fff; + + UINT8 *src = m_rom8; + + if (m_port10 & 2) // NO, wrong for the portraits + 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); + 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? + { + vram[offset] = 0x0000; + offset++; + } + else + { + 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++; + offset++; + } + + offset &= 0x7fff; + } + } + else + { + // sometimes happens, why? special meanings? wrong interpretation of something else? + printf("%06x: spider_blitter_w unhandled RAM access %08x %04x %04x\n", space.device().safe_pc(), offset * 2, data, mem_mask); + } + } } -#endif + + static ADDRESS_MAP_START( ttchamp_map, AS_PROGRAM, 16, ttchamp_state ) - AM_RANGE(0x00000, 0x0ffff) AM_RAM AM_READWRITE(penocup_mainram_r, penocup_mainram_w) - - /* 0x10000 - 0x1ffff is where it writes most image stuff, but other address get written to 0 where the left edge of 'sprites' would be? why? bad code execution, or some kind of write address based blitter? - see for example the lines written down the side of where the (not displayed) CREDIT text would go, as well as beside the actual credit number.. also ingame if you can get it to start - */ - - AM_RANGE(0x10000, 0xfffff) AM_WRITE(penocup_vid_w) - - // how are these banked? what are the bank sizes? data needed for startup is at 0x20000-0x2ffff (strings) and 0x30000-0x3ffff (code) the rest seems to be graphics.. - AM_RANGE(0x00000, 0x7ffff) AM_ROMBANK("bank1") // ? - AM_RANGE(0x80000, 0xfffff) AM_ROMBANK("bank2") // ? + AM_RANGE(0x00000, 0xfffff) AM_READWRITE(ttchamp_mem_r, ttchamp_mem_w) ADDRESS_MAP_END +READ16_MEMBER(ttchamp_state::port1e_r) +{ + return 0xff; +} + +READ16_MEMBER(ttchamp_state::ttchamp_blit_start_r) +{ + m_spritesinit = 1; + return 0xff; +} + +WRITE16_MEMBER(ttchamp_state::port10_w) +{ + UINT8 res; + 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); +} + +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; + }*/ + +} + +WRITE16_MEMBER(ttchamp_state::port62_w) +{ + printf("%06x: port62_w %04x %04x\n", space.device().safe_pc(), data, mem_mask); +} + static ADDRESS_MAP_START( ttchamp_io, AS_IO, 16, ttchamp_state ) - AM_RANGE(0x0000, 0x0001) AM_WRITENOP + AM_RANGE(0x0000, 0x0001) AM_WRITENOP // startup only AM_RANGE(0x0002, 0x0003) AM_READ_PORT("SYSTEM") AM_RANGE(0x0004, 0x0005) AM_READ_PORT("P1_P2") -// AM_RANGE(0x0018, 0x0019) AM_READ(peno_rand2) -// AM_RANGE(0x001e, 0x001f) AM_READ(peno_rand2) + AM_RANGE(0x0006, 0x0007) AM_DEVREADWRITE8("oki", okim6295_device, read, write, 0x00ff) + + AM_RANGE(0x0018, 0x0019) AM_READ(ttchamp_blit_start_r) // read before using bus write offset as blit parameters + AM_RANGE(0x001e, 0x001f) AM_READ(port1e_r) // read before some blit operations (but not all) AM_RANGE(0x0008, 0x0009) AM_WRITE(paldat_w) - AM_RANGE(0x000a, 0x000b) AM_WRITE(paloff_w) + AM_RANGE(0x000a, 0x000b) AM_WRITE(paloff_w) // bit 0x8000 sometimes gets set, why? -// AM_RANGE(0x0010, 0x0010) AM_WRITE(pcup_prgbank_w) - AM_RANGE(0x0010, 0x0011) AM_WRITENOP + AM_RANGE(0x0010, 0x0011) AM_WRITE(port10_w) - AM_RANGE(0x0020, 0x0021) AM_WRITENOP + AM_RANGE(0x0020, 0x0021) AM_WRITE(port20_w) + +// AM_RANGE(0x0034, 0x0035) AM_READ(peno_rand) AM_WRITENOP // eeprom (PIC?) / settings? + + AM_RANGE(0x0062, 0x0063) AM_WRITE(port62_w) - AM_RANGE(0x0034, 0x0035) AM_READ(peno_rand) AM_WRITENOP ADDRESS_MAP_END - static INPUT_PORTS_START(ttchamp) PORT_START("SYSTEM") PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 ) @@ -294,93 +529,49 @@ static MACHINE_CONFIG_START( ttchamp, ttchamp_state ) MCFG_SCREEN_UPDATE_DRIVER(ttchamp_state, screen_update_ttchamp) MCFG_SCREEN_PALETTE("palette") - MCFG_PALETTE_ADD("palette", 0x8000) + MCFG_PALETTE_ADD("palette", 0x400) + + MCFG_SPEAKER_STANDARD_MONO("mono") + + MCFG_OKIM6295_ADD("oki", 8000000/8, OKIM6295_PIN7_HIGH) + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) MACHINE_CONFIG_END ROM_START( ttchamp ) - - /* hopefully this is a good dump */ - - ROM_REGION16_LE( 0x200000, "user1", 0 ) + ROM_REGION16_LE( 0x200000, "maincpu", 0 ) ROM_LOAD16_BYTE( "2.bin", 0x000000, 0x080000, CRC(6a6c6d75) SHA1(3742b82462176d77732a69e142db9e6f61f25dc5) ) ROM_LOAD16_BYTE( "3.bin", 0x000001, 0x080000, CRC(6062c0b2) SHA1(c5f0ac58c847ce2588c805f40180f2586a6477b7) ) ROM_LOAD16_BYTE( "4.bin", 0x100000, 0x080000, CRC(4388dead) SHA1(1965e4b84452b244e32c8d218aace8d287c67ec2) ) ROM_LOAD16_BYTE( "5.bin", 0x100001, 0x080000, CRC(fdbf9b28) SHA1(2d260555586097c8a396f65111f55ace801c7a5d) ) - /* dumps below are bad dumps */ + ROM_REGION( 0x10000, "cpu1", 0 ) // read protected, only half the data is valid + ROM_LOAD( "pic16c84.rom", 0x000000, 0x4280, BAD_DUMP CRC(900f2ef8) SHA1(08f206fe52f413437436e4b0d2b4ec310767446c) ) - /* dump a */ -// ROM_REGION( 0x200000, "user1", 0 ) -// ROM_LOAD16_BYTE( "27c040_dump_a.2", 0x000000, 0x080000, BAD_DUMP CRC(791d68c8) SHA1(641c989d50e95ac3ff7c87d148cfab44abbdc774) ) -// ROM_LOAD16_BYTE( "27c040_dump_a.3", 0x000001, 0x080000, BAD_DUMP CRC(00c81241) SHA1(899d4d1566f5f5d2967b6a8ec7dca60833846bbe) ) -// ROM_LOAD16_BYTE( "27c040_dump_a.4", 0x100000, 0x080000, BAD_DUMP CRC(11af50f6) SHA1(1e5b6cc5c5a6c1ec302b2de7ce40c9ebfb349b46) ) -// ROM_LOAD16_BYTE( "27c040_dump_a.5", 0x100001, 0x080000, BAD_DUMP CRC(f6b87231) SHA1(3db461c0858c207e8a3dfd822c99d28e3a26b4ee) ) - - /* dump b */ -// ROM_REGION( 0x200000, "user2", 0 ) -// ROM_LOAD16_BYTE( "27c040_dump_b.2", 0x000000, 0x080000, BAD_DUMP CRC(df1f2618) SHA1(7c6abb7a6ec55c49b95809f003d217f1ea758729) ) -// ROM_LOAD16_BYTE( "27c040_dump_b.3", 0x000001, 0x080000, BAD_DUMP CRC(0292ca69) SHA1(fe3b0e78d9e946d8f8a86e8246e5a94483f44ce1) ) -// ROM_LOAD16_BYTE( "27c040_dump_b.4", 0x100000, 0x080000, BAD_DUMP CRC(f6bcadc6) SHA1(d8c61c207175d67f4229103696dc2a4447af2ba4) ) -// ROM_LOAD16_BYTE( "27c040_dump_b.5", 0x100001, 0x080000, BAD_DUMP CRC(b872747c) SHA1(24d2aa2603a71cdfd3d45608177bb60ab7cfe8a2) ) - - /* dump c */ -// ROM_REGION( 0x200000, "user3", 0 ) -// ROM_LOAD16_BYTE( "27c040_dump_c.2", 0x000000, 0x080000, BAD_DUMP CRC(be70adc7) SHA1(fe439caa54856c75ef310e456a7e61b15321031d) ) -// ROM_LOAD16_BYTE( "27c040_dump_c.3", 0x000001, 0x080000, BAD_DUMP CRC(8e3b3396) SHA1(f47243041b9283712e34ea58fa2456c35785c5ee) ) -// ROM_LOAD16_BYTE( "27c040_dump_c.4", 0x100000, 0x080000, BAD_DUMP CRC(34ab75e9) SHA1(779f03139b336cdc46f4d00bf3fd9e6de79942e2) ) -// ROM_LOAD16_BYTE( "27c040_dump_c.5", 0x100001, 0x080000, BAD_DUMP CRC(3e7b3533) SHA1(433439c2b8a8e54bb20fc3c1690d3f183c6fa6f6) ) - - /* these were the same in each dump..*/ - ROM_REGION( 0x10000, "cpu1", 0 ) /* not verified if this is correct yet, seems very empty, maybe protected */ - ROM_LOAD( "pic16c84.rom", 0x000000, 0x4280, CRC(900f2ef8) SHA1(08f206fe52f413437436e4b0d2b4ec310767446c) ) - - ROM_REGION( 0x40000, "samples", 0 ) + ROM_REGION( 0x40000, "oki", 0 ) ROM_LOAD( "27c020.1", 0x000000, 0x040000, CRC(e2c4fe95) SHA1(da349035cc348db220a1e12b4c2a6021e2168425) ) ROM_END -/* - -Table tennis Championships by Gamart 1995 - -This game come from Gamart,an obscure spanish software house. -Hardware info: -main cpu: V30 -sound chip: oki6295 -custom chip: tpc1020bfn x2 -osc: 16 mhz -Rom files definition: -ttennis2/3 main program -ttennis1 adpcm data -ttennis4/5 graphics -*there is a pic16c84 that i cannot dump because my programmer doesn't support it. - -Dumped by tirino73 >isolani (at) interfree.it< - -*/ - ROM_START( ttchampa ) - /* this is from a different board */ - - ROM_REGION16_LE( 0x200000, "user1", 0 ) + ROM_REGION16_LE( 0x200000, "maincpu", 0 ) ROM_LOAD16_BYTE( "ttennis2.bin", 0x000000, 0x080000, CRC(b060e72c) SHA1(376e71bb4b1687fec4b719cbc5a7b25b64d159ac) ) ROM_LOAD16_BYTE( "ttennis3.bin", 0x000001, 0x080000, CRC(33e085a8) SHA1(ea6af05690b4b0803c303a3c858df10e4d907fb1) ) ROM_LOAD16_BYTE( "4.bin", 0x100000, 0x080000, CRC(4388dead) SHA1(1965e4b84452b244e32c8d218aace8d287c67ec2) ) ROM_LOAD16_BYTE( "5.bin", 0x100001, 0x080000, CRC(fdbf9b28) SHA1(2d260555586097c8a396f65111f55ace801c7a5d) ) - ROM_REGION( 0x10000, "cpu1", 0 ) /* not verified if this is correct yet, seems very empty, maybe protected */ - ROM_LOAD( "pic16c84.rom", 0x000000, 0x4280, CRC(900f2ef8) SHA1(08f206fe52f413437436e4b0d2b4ec310767446c) ) + ROM_REGION( 0x10000, "cpu1", 0 ) // read protected, only half the data is valid + ROM_LOAD( "pic16c84.rom", 0x000000, 0x4280, BAD_DUMP CRC(900f2ef8) SHA1(08f206fe52f413437436e4b0d2b4ec310767446c) ) - ROM_REGION( 0x40000, "samples", 0 ) + ROM_REGION( 0x40000, "oki", 0 ) ROM_LOAD( "27c020.1", 0x000000, 0x040000, CRC(e2c4fe95) SHA1(da349035cc348db220a1e12b4c2a6021e2168425) ) 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]); +// 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 (set 1)", GAME_NOT_WORKING|GAME_NO_SOUND ) -GAME( 1995, ttchampa,ttchamp, ttchamp, ttchamp, ttchamp_state, ttchamp, ROT0, "Gamart", "Table Tennis Champions (set 2)", GAME_NOT_WORKING|GAME_NO_SOUND ) +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 diff --git a/src/mame/drivers/twins.c b/src/mame/drivers/twins.c index a80c9b1e685..6ee893004dc 100644 --- a/src/mame/drivers/twins.c +++ b/src/mame/drivers/twins.c @@ -28,7 +28,7 @@ Notes: -seems a similar board to hotblocks +seems a similar board to Hot Blocks same TPC1020 AFN-084C chip same 24c02 eeprom @@ -39,19 +39,27 @@ video is not banked in this case instead palette data is sent to the ports strange palette format. todo: -hook up eeprom -takes a long time to boot (eeprom?) - +hook up eeprom (doesn't seem to work when hooked up??) +Twins set 1 takes a long time to boot (eeprom?) +Improve blitter / clear logic for Spider. Electronic Devices was printed on rom labels 1994 date string is in ROM +Spider PCB appears almost identical but uses additional 'blitter' features. +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. + + */ #include "emu.h" #include "cpu/nec/nec.h" #include "sound/ay8910.h" - +#include "machine/i2cmem.h" +#include "video/ramdac.h" class twins_state : public driver_device { @@ -59,83 +67,84 @@ public: twins_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), m_maincpu(*this, "maincpu"), - m_videoram(*this, "videoram"), m_paletteram(*this, "paletteram"), - m_palette(*this, "palette") { } + m_palette(*this, "palette"), + m_i2cmem(*this, "i2cmem"), + m_spritesinit(0), + m_videorambank(0) + { } required_device m_maincpu; - required_shared_ptr m_videoram; - required_shared_ptr m_paletteram; + optional_shared_ptr m_paletteram; required_device m_palette; + optional_device m_i2cmem; UINT16 m_paloff; DECLARE_READ16_MEMBER(twins_port4_r); DECLARE_WRITE16_MEMBER(twins_port4_w); - DECLARE_WRITE16_MEMBER(port6_pal0_w); + DECLARE_WRITE16_MEMBER(twins_pal_w); + DECLARE_WRITE16_MEMBER(spider_pal_w); DECLARE_WRITE16_MEMBER(porte_paloff0_w); - DECLARE_WRITE16_MEMBER(twinsa_port4_w); - DECLARE_READ16_MEMBER(twinsa_unk_r); + DECLARE_WRITE16_MEMBER(spider_paloff0_w); + DECLARE_WRITE16_MEMBER(spider_blitter_w); + DECLARE_READ16_MEMBER(spider_blitter_r); + + DECLARE_READ16_MEMBER(spider_port_18_r); + DECLARE_READ16_MEMBER(spider_port_1e_r); + DECLARE_WRITE16_MEMBER(spider_port_1a_w); + DECLARE_WRITE16_MEMBER(spider_port_1c_w); + int m_spritesinit; + int m_spriteswidth; + int m_spritesaddr; + + UINT16 m_mainram[0x10000 / 2]; + UINT16 m_videoram[0x10000 / 2]; + UINT16 m_videoram2[0x10000 / 2]; + UINT16 m_videorambank; + DECLARE_VIDEO_START(twins); DECLARE_VIDEO_START(twinsa); UINT32 screen_update_twins(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_twinsa(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + UINT32 screen_update_spider(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + + virtual void machine_start(); + UINT16* m_rom16; + UINT8* m_rom8; + }; +void twins_state::machine_start() +{ + m_rom16 = (UINT16*)memregion("maincpu")->base(); + m_rom8 = memregion("maincpu")->base(); +} /* port 4 is eeprom */ READ16_MEMBER(twins_state::twins_port4_r) { - return 0xffff; +// doesn't work?? +// 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); + int i2c_clk = BIT(data, 1); + int i2c_mem = BIT(data, 0); + m_i2cmem->write_scl(i2c_clk); + m_i2cmem->write_sda(i2c_mem); } -WRITE16_MEMBER(twins_state::port6_pal0_w) +WRITE16_MEMBER(twins_state::twins_pal_w) { COMBINE_DATA(&m_paletteram[m_paloff]); - m_paloff = (m_paloff + 1) & 0xff; -} -/* ??? weird ..*/ -WRITE16_MEMBER(twins_state::porte_paloff0_w) -{ - m_paloff = 0; -} - -static ADDRESS_MAP_START( twins_map, AS_PROGRAM, 16, twins_state ) - AM_RANGE(0x00000, 0x0ffff) AM_RAM - AM_RANGE(0x10000, 0x1ffff) AM_RAM AM_SHARE("videoram") - AM_RANGE(0x20000, 0xfffff) AM_ROM -ADDRESS_MAP_END - -static ADDRESS_MAP_START( twins_io, AS_IO, 16, twins_state ) - AM_RANGE(0x0000, 0x0003) AM_DEVWRITE8("aysnd", ay8910_device, address_data_w, 0x00ff) - AM_RANGE(0x0002, 0x0003) AM_DEVREAD8("aysnd", ay8910_device, data_r, 0x00ff) - AM_RANGE(0x0004, 0x0005) AM_READWRITE(twins_port4_r, twins_port4_w) - AM_RANGE(0x0006, 0x0007) AM_WRITE(port6_pal0_w) AM_SHARE("paletteram") - AM_RANGE(0x000e, 0x000f) AM_WRITE(porte_paloff0_w) -ADDRESS_MAP_END - -VIDEO_START_MEMBER(twins_state,twins) -{ - save_item(NAME(m_paloff)); - m_paloff = 0; -} - -UINT32 twins_state::screen_update_twins(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) -{ - int y,x,count; - int i; - static const int xxx=320,yyy=204; - - bitmap.fill(m_palette->black_pen()); - - for (i=0;i<0x100;i++) { int dat,r,g,b; - dat = m_paletteram[i]; + dat = m_paletteram[m_paloff]; r = dat & 0x1f; r = BITSWAP8(r,7,6,5,0,1,2,3,4); @@ -146,11 +155,155 @@ UINT32 twins_state::screen_update_twins(screen_device &screen, bitmap_ind16 &bit b = (dat>>10) & 0x1f; b = BITSWAP8(b,7,6,5,0,1,2,3,4); - m_palette->set_pen_color(i, pal5bit(r),pal5bit(g),pal5bit(b)); + m_palette->set_pen_color(m_paloff, pal5bit(r),pal5bit(g),pal5bit(b)); + } + m_paloff = (m_paloff + 1) & 0xff; +} + +/* ??? weird ..*/ +WRITE16_MEMBER(twins_state::porte_paloff0_w) +{ +// printf("porte_paloff0_w %04x\n", data); + m_paloff = 0; +} + +READ16_MEMBER(twins_state::spider_blitter_r) +{ + UINT16* vram; + if (m_videorambank & 1) + vram = m_videoram2; + else + vram = m_videoram; + + if (offset < 0x10000 / 2) + { + return m_mainram[offset&0x7fff]; + } + else if (offset < 0x20000 / 2) + { + return vram[offset&0x7fff]; + } + else + { + UINT16 *src = m_rom16; + return src[offset]; + } +} + + +WRITE16_MEMBER(twins_state::spider_blitter_w) +{ + // this is very strange, we use the offset (address bits) not data bits to set values.. + // I get the impression this might actually overlay the entire address range, including RAM and regular VRAM? + UINT16* vram; + if (m_videorambank & 1) + vram = m_videoram2; + else + vram = m_videoram; + + if (m_spritesinit == 1) + { + // 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); + m_spriteswidth = offset & 0xff; + if (m_spriteswidth == 0) + m_spriteswidth = 80; + + m_spritesinit = 0; + + } + else + { + if (offset < 0x10000 / 2) + { + COMBINE_DATA(&m_mainram[offset&0x7fff]); + } + else if (offset < 0x20000 / 2) + { + COMBINE_DATA(&vram[offset&0x7fff]); + } + else if (offset < 0x30000 / 2) + { + 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); + 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 ++; + offset++; + + offset &= 0x7fff; + } + } + else + { + printf("spider_blitter_w unhandled RAM access %08x %04x %04x", offset * 2, data, mem_mask); + } + } +} + + +static ADDRESS_MAP_START( twins_map, AS_PROGRAM, 16, twins_state ) + AM_RANGE(0x00000, 0xfffff) AM_READWRITE(spider_blitter_r, spider_blitter_w) +ADDRESS_MAP_END + +static ADDRESS_MAP_START( twins_io, AS_IO, 16, twins_state ) + AM_RANGE(0x0000, 0x0003) AM_DEVWRITE8("aysnd", ay8910_device, address_data_w, 0x00ff) + AM_RANGE(0x0002, 0x0003) AM_DEVREAD8("aysnd", ay8910_device, data_r, 0x00ff) + AM_RANGE(0x0004, 0x0005) AM_READWRITE(twins_port4_r, twins_port4_w) + AM_RANGE(0x0006, 0x0007) AM_WRITE(twins_pal_w) AM_SHARE("paletteram") + AM_RANGE(0x000e, 0x000f) AM_WRITE(porte_paloff0_w) +ADDRESS_MAP_END + +VIDEO_START_MEMBER(twins_state,twins) +{ + save_item(NAME(m_paloff)); + + save_item(NAME(m_spritesinit)); + save_item(NAME(m_spriteswidth)); + save_item(NAME(m_spritesaddr)); + save_item(NAME(m_mainram)); + save_item(NAME(m_videoram)); + save_item(NAME(m_videoram2)); + save_item(NAME(m_videorambank)); +} + + + + +UINT32 twins_state::screen_update_twins(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + int y,x,count; + static const int xxx=320,yyy=204; + + bitmap.fill(m_palette->black_pen()); + count=0; - UINT8 *videoram = reinterpret_cast(m_videoram.target()); + UINT8 *videoram = (UINT8*)m_videoram; for (y=0;yblack_pen()); + + count=0; + UINT8 *videoram = (UINT8*)m_videoram; + for (y=0;yblack_pen()); - - for (i=0;i<0x1000-3;i+=3) - { - int r,g,b; - r = m_paletteram[i]; - g = m_paletteram[i+1]; - b = m_paletteram[i+2]; - - m_palette->set_pen_color(i/3, pal6bit(r), pal6bit(g), pal6bit(b)); - } - - count=0; - UINT8 *videoram = reinterpret_cast(m_videoram.target()); - for (y=0;y>5) & 0x1f; + b = (dat>>10) & 0x1f; + m_palette->set_pen_color(m_paloff-1, pal5bit(r),pal5bit(g),pal5bit(b)); + } + else + { + // printf("first palette write %04x\n", data); + } + + m_paloff++; + + if (m_paloff == 0x101) + m_paloff = 0; +} + + +WRITE16_MEMBER(twins_state::spider_paloff0_w) +{ + // this seems to be video ram banking + COMBINE_DATA(&m_videorambank); +} + +WRITE16_MEMBER(twins_state::spider_port_1a_w) +{ + // writes 1 +} + + +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? + + UINT16* vram; + if (m_videorambank & 1) + vram = m_videoram2; + else + vram = m_videoram; + + for (int i = 0; i < 0x8000; i++) + { + vram[i] = 0x0000; + } + +} + + +READ16_MEMBER(twins_state::spider_port_18_r) +{ + // read before each blitter command + // seems to put the bus in a state where the next 2 bus access offsets (anywhere) are the blitter params + m_spritesinit = 1; + + return 0xff; +} + +READ16_MEMBER(twins_state::spider_port_1e_r) +{ + // done before each sprite pixel 'write' + // the data read is the data written, but only reads one pixel?? + return 0xff; +} + + +static ADDRESS_MAP_START( spider_io, AS_IO, 16, twins_state ) + AM_RANGE(0x0000, 0x0003) AM_DEVWRITE8("aysnd", ay8910_device, address_data_w, 0x00ff) + AM_RANGE(0x0002, 0x0003) AM_DEVREAD8("aysnd", ay8910_device, data_r, 0x00ff) + AM_RANGE(0x0004, 0x0005) AM_READWRITE(twins_port4_r, twins_port4_w) + AM_RANGE(0x0008, 0x0009) AM_WRITE(spider_pal_w) AM_SHARE("paletteram") + AM_RANGE(0x0010, 0x0011) AM_WRITE(spider_paloff0_w) + + AM_RANGE(0x0018, 0x0019) AM_READ(spider_port_18_r) + AM_RANGE(0x001a, 0x001b) AM_WRITE(spider_port_1a_w) + AM_RANGE(0x001c, 0x001d) AM_WRITE(spider_port_1c_w) + AM_RANGE(0x001e, 0x001f) AM_READ(spider_port_1e_r) + + +ADDRESS_MAP_END + + + + + +static MACHINE_CONFIG_START( spider, twins_state ) + /* basic machine hardware */ + MCFG_CPU_ADD("maincpu", V30, 8000000) + MCFG_CPU_PROGRAM_MAP(twins_map) + MCFG_CPU_IO_MAP(spider_io) + MCFG_CPU_VBLANK_INT_DRIVER("screen", twins_state, nmi_line_pulse) + + /* video hardware */ + MCFG_SCREEN_ADD("screen", RASTER) + MCFG_SCREEN_REFRESH_RATE(50) + MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) + MCFG_SCREEN_SIZE(320,256) + MCFG_SCREEN_VISIBLE_AREA(0, 320-1, 0, 200-1) + MCFG_SCREEN_UPDATE_DRIVER(twins_state, screen_update_spider) + MCFG_SCREEN_PALETTE("palette") + + MCFG_PALETTE_ADD("palette", 0x100) + + MCFG_VIDEO_START_OVERRIDE(twins_state,twins) + + MCFG_24C02_ADD("i2cmem") + + /* sound hardware */ + MCFG_SPEAKER_STANDARD_MONO("mono") + + MCFG_SOUND_ADD("aysnd", AY8910, 2000000) + MCFG_AY8910_PORT_A_READ_CB(IOPORT("P1")) + MCFG_AY8910_PORT_B_READ_CB(IOPORT("P2")) + + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) +MACHINE_CONFIG_END + ROM_START( twins ) ROM_REGION( 0x100000, "maincpu", 0 ) @@ -337,5 +619,13 @@ ROM_START( twinsa ) ROM_LOAD16_BYTE( "hp.bin", 0x000001, 0x080000, CRC(aaf74b83) SHA1(09bd76b9fc5cb7ba6ffe1a2581ffd5633fe440b3) ) ROM_END +ROM_START( spider ) + ROM_REGION( 0x100000, "maincpu", 0 ) + ROM_LOAD16_BYTE( "20.bin", 0x000001, 0x080000, CRC(25e15f11) SHA1(b728f35c817f60a294e38d66559da8977b94a1f5) ) + ROM_LOAD16_BYTE( "21.bin", 0x000000, 0x080000, CRC(ff224206) SHA1(d8d45850983542e811facc917d016841fc56a97f) ) +ROM_END + GAME( 1994, twins, 0, twins, twins, driver_device, 0, ROT0, "Electronic Devices", "Twins (set 1)", GAME_SUPPORTS_SAVE ) GAME( 1994, twinsa, twins, twinsa, twins, driver_device, 0, ROT0, "Electronic Devices", "Twins (set 2)", GAME_SUPPORTS_SAVE ) + +GAME( 1994, spider, 0, spider, twins, driver_device, 0, ROT0, "Buena Vision", "Spider", GAME_IMPERFECT_GRAPHICS ) diff --git a/src/mame/includes/dynax.h b/src/mame/includes/dynax.h index 960eb2e559b..45c74dde3f0 100644 --- a/src/mame/includes/dynax.h +++ b/src/mame/includes/dynax.h @@ -125,6 +125,7 @@ public: DECLARE_WRITE8_MEMBER(hanamai_keyboard_w); DECLARE_WRITE8_MEMBER(dynax_rombank_w); DECLARE_WRITE8_MEMBER(jantouki_sound_rombank_w); + DECLARE_WRITE8_MEMBER(cdracula_sound_rombank_w); DECLARE_WRITE8_MEMBER(hnoridur_rombank_w); DECLARE_WRITE8_MEMBER(hnoridur_palbank_w); DECLARE_WRITE8_MEMBER(hnoridur_palette_w); @@ -186,12 +187,15 @@ public: DECLARE_WRITE8_MEMBER(dynax_blit_dest_w); DECLARE_WRITE8_MEMBER(dynax_blit2_dest_w); DECLARE_WRITE8_MEMBER(tenkai_blit_dest_w); + DECLARE_WRITE8_MEMBER(mjembase_blit_dest_w); DECLARE_WRITE8_MEMBER(dynax_blit_backpen_w); + DECLARE_WRITE8_MEMBER(dynax_blit_flags_w); DECLARE_WRITE8_MEMBER(dynax_blit_palette01_w); DECLARE_WRITE8_MEMBER(tenkai_blit_palette01_w); DECLARE_WRITE8_MEMBER(dynax_blit_palette45_w); DECLARE_WRITE8_MEMBER(dynax_blit_palette23_w); DECLARE_WRITE8_MEMBER(tenkai_blit_palette23_w); + DECLARE_WRITE8_MEMBER(mjembase_blit_palette23_w); DECLARE_WRITE8_MEMBER(dynax_blit_palette67_w); DECLARE_WRITE8_MEMBER(dynax_blit_palbank_w); DECLARE_WRITE8_MEMBER(dynax_blit2_palbank_w); @@ -209,10 +213,12 @@ public: DECLARE_WRITE8_MEMBER(dynax_blit2_scroll_w); DECLARE_WRITE8_MEMBER(dynax_blitter_rev2_w); DECLARE_WRITE8_MEMBER(tenkai_blitter_rev2_w); + DECLARE_WRITE8_MEMBER(cdracula_blitter_rev2_w); DECLARE_WRITE8_MEMBER(jantouki_blitter_rev2_w); DECLARE_WRITE8_MEMBER(jantouki_blitter2_rev2_w); DECLARE_WRITE8_MEMBER(hanamai_priority_w); DECLARE_WRITE8_MEMBER(tenkai_priority_w); + DECLARE_WRITE8_MEMBER(mjembase_priority_w); DECLARE_DRIVER_INIT(mjelct3); DECLARE_DRIVER_INIT(blktouch); @@ -226,6 +232,7 @@ public: UINT32 screen_update_mjdialq2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); UINT32 screen_update_jantouki_top(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); UINT32 screen_update_jantouki_bottom(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + UINT32 screen_update_cdracula(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(sprtmtch_vblank_interrupt); INTERRUPT_GEN_MEMBER(jantouki_vblank_interrupt); @@ -264,6 +271,7 @@ public: DECLARE_MACHINE_START(jantouki); DECLARE_VIDEO_START(jantouki); DECLARE_VIDEO_START(mjelctrn); + DECLARE_VIDEO_START(mjembase); DECLARE_VIDEO_START(mjdialq2); DECLARE_VIDEO_START(mcnpshnt); DECLARE_PALETTE_INIT(janyuki); diff --git a/src/mame/includes/goldstar.h b/src/mame/includes/goldstar.h index ae548f1215a..db8edbbb34e 100644 --- a/src/mame/includes/goldstar.h +++ b/src/mame/includes/goldstar.h @@ -1,3 +1,8 @@ +#include "emu.h" + +#include "machine/ticket.h" + + class goldstar_state : public driver_device { public: @@ -21,10 +26,9 @@ public: DECLARE_WRITE8_MEMBER(protection_w); DECLARE_READ8_MEMBER(protection_r); - DECLARE_WRITE8_MEMBER(lucky8_lamps_w); + DECLARE_WRITE8_MEMBER(p1_lamps_w); + DECLARE_WRITE8_MEMBER(p2_lamps_w); DECLARE_WRITE8_MEMBER(ncb3_port81_w); - DECLARE_WRITE8_MEMBER(goldstar_lamps_w); - DECLARE_WRITE8_MEMBER(cb3_lamps_w); DECLARE_WRITE8_MEMBER(cm_coincount_w); DECLARE_WRITE8_MEMBER(ladylinr_outport_w); DECLARE_WRITE8_MEMBER(goldstar_fg_vidram_w); @@ -251,16 +255,14 @@ public: goldstar_state(mconfig, type, tag), m_reel1_attrram(*this, "reel1_attrram"), m_reel2_attrram(*this, "reel2_attrram"), - m_reel3_attrram(*this, "reel3_attrram") + m_reel3_attrram(*this, "reel3_attrram"), + m_ticket_dispenser(*this, "tickets") { } - DECLARE_READ8_MEMBER(unk_r); - + DECLARE_WRITE8_MEMBER(coincount_w); DECLARE_WRITE8_MEMBER(unkcm_0x02_w); DECLARE_WRITE8_MEMBER(unkcm_0x03_w); - DECLARE_WRITE8_MEMBER(unkcm_0x11_w); - DECLARE_WRITE8_MEMBER(unkcm_0x12_w); DECLARE_WRITE8_MEMBER(reel1_attrram_w); DECLARE_WRITE8_MEMBER(reel2_attrram_w); @@ -273,6 +275,8 @@ public: DECLARE_VIDEO_START(unkch); UINT32 screen_update_unkch(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + INTERRUPT_GEN_MEMBER(vblank_irq); + protected: TILE_GET_INFO_MEMBER(get_reel1_tile_info); TILE_GET_INFO_MEMBER(get_reel2_tile_info); @@ -283,5 +287,8 @@ private: required_shared_ptr m_reel2_attrram; required_shared_ptr m_reel3_attrram; + UINT8 m_vblank_irq_enable; UINT8 m_vidreg; + + optional_device m_ticket_dispenser; }; diff --git a/src/mame/includes/hng64.h b/src/mame/includes/hng64.h index eee5de71afa..c8c43c858c9 100644 --- a/src/mame/includes/hng64.h +++ b/src/mame/includes/hng64.h @@ -354,7 +354,6 @@ public: int m_vertsrom_size; void reset_sound(); void reset_net(); - DECLARE_WRITE16_MEMBER(hng64_sound_port_0008_w); DECLARE_WRITE_LINE_MEMBER(dma_hreq_cb); DECLARE_READ8_MEMBER(dma_memr_cb); @@ -375,10 +374,25 @@ public: 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_WRITE16_MEMBER(hng64_sound_bank_w); - DECLARE_WRITE16_MEMBER(hng64_sound_port_0102_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); + + DECLARE_WRITE16_MEMBER(hng64_sound_port_000a_w); + DECLARE_WRITE16_MEMBER(hng64_sound_port_000c_w); + DECLARE_WRITE16_MEMBER(hng64_sound_port_0080_w); + DECLARE_WRITE16_MEMBER(hng64_sound_port_0100_w); + DECLARE_WRITE16_MEMBER(hng64_sound_port_0102_w); + DECLARE_READ16_MEMBER(hng64_sound_port_0104_r); + DECLARE_READ16_MEMBER(hng64_sound_port_0106_r); + DECLARE_WRITE16_MEMBER(hng64_sound_port_0108_w); + DECLARE_WRITE16_MEMBER(hng64_sound_port_010a_w); + DECLARE_WRITE16_MEMBER(hng64_sound_bank_w); }; diff --git a/src/mame/includes/realbrk.h b/src/mame/includes/realbrk.h index 8b3ccec5cfd..4adbdbfe9d0 100644 --- a/src/mame/includes/realbrk.h +++ b/src/mame/includes/realbrk.h @@ -5,6 +5,11 @@ class realbrk_state : public driver_device public: realbrk_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), + m_maincpu(*this, "maincpu"), + m_tmp68301(*this, "tmp68301"), + m_gfxdecode(*this, "gfxdecode"), + m_screen(*this, "screen"), + m_palette(*this, "palette"), m_spriteram(*this, "spriteram"), m_vram_0(*this, "vram_0"), m_vram_1(*this, "vram_1"), @@ -13,12 +18,13 @@ public: m_dsw_select(*this, "dsw_select"), m_backup_ram(*this, "backup_ram"), m_vram_0ras(*this, "vram_0ras"), - m_vram_1ras(*this, "vram_1ras"), - m_maincpu(*this, "maincpu"), - m_tmp68301(*this, "tmp68301"), - m_gfxdecode(*this, "gfxdecode"), - m_screen(*this, "screen"), - m_palette(*this, "palette") { } + m_vram_1ras(*this, "vram_1ras") { } + + required_device m_maincpu; + required_device m_tmp68301; + required_device m_gfxdecode; + required_device m_screen; + required_device m_palette; required_shared_ptr m_spriteram; required_shared_ptr m_vram_0; @@ -29,36 +35,42 @@ public: optional_shared_ptr m_backup_ram; optional_shared_ptr m_vram_0ras; optional_shared_ptr m_vram_1ras; + bitmap_ind16 *m_tmpbitmap0; bitmap_ind16 *m_tmpbitmap1; int m_disable_video; tilemap_t *m_tilemap_0; tilemap_t *m_tilemap_1; tilemap_t *m_tilemap_2; + + // common + DECLARE_WRITE16_MEMBER(vram_0_w); + DECLARE_WRITE16_MEMBER(vram_1_w); + DECLARE_WRITE16_MEMBER(vram_2_w); + DECLARE_WRITE16_MEMBER(vregs_w); + + // realbrk and/or dai2kaku DECLARE_READ16_MEMBER(realbrk_dsw_r); + DECLARE_WRITE16_MEMBER(realbrk_flipscreen_w); + DECLARE_WRITE16_MEMBER(dai2kaku_flipscreen_w); + + // pkgnsh and/or pkgnshdx DECLARE_READ16_MEMBER(pkgnsh_input_r); DECLARE_READ16_MEMBER(pkgnshdx_input_r); DECLARE_READ16_MEMBER(backup_ram_r); DECLARE_READ16_MEMBER(backup_ram_dx_r); DECLARE_WRITE16_MEMBER(backup_ram_w); - DECLARE_WRITE16_MEMBER(realbrk_flipscreen_w); - DECLARE_WRITE16_MEMBER(dai2kaku_flipscreen_w); - DECLARE_WRITE16_MEMBER(realbrk_vram_0_w); - DECLARE_WRITE16_MEMBER(realbrk_vram_1_w); - DECLARE_WRITE16_MEMBER(realbrk_vram_2_w); - DECLARE_WRITE16_MEMBER(realbrk_vregs_w); + TILE_GET_INFO_MEMBER(get_tile_info_0); TILE_GET_INFO_MEMBER(get_tile_info_1); TILE_GET_INFO_MEMBER(get_tile_info_2); + virtual void video_start(); - UINT32 screen_update_realbrk(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + + UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); UINT32 screen_update_dai2kaku(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - INTERRUPT_GEN_MEMBER(realbrk_interrupt); void draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect); void dai2kaku_draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect, int layer); - required_device m_maincpu; - required_device m_tmp68301; - required_device m_gfxdecode; - required_device m_screen; - required_device m_palette; + + INTERRUPT_GEN_MEMBER(interrupt); }; diff --git a/src/mame/includes/rltennis.h b/src/mame/includes/rltennis.h index bfc60e1d400..fb02b1a41b5 100644 --- a/src/mame/includes/rltennis.h +++ b/src/mame/includes/rltennis.h @@ -10,45 +10,40 @@ public: rltennis_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), m_maincpu(*this, "maincpu"), - m_data760000(0), m_data740000(0), m_dac_counter(0), m_sample_rom_offset_1(0), m_sample_rom_offset_2(0), - m_offset_shift(0), m_dac_1(*this, "dac1"), - m_dac_2(*this, "dac2") { } + m_dac_2(*this, "dac2"), + m_data760000(0), m_data740000(0), m_dac_counter(0), m_sample_rom_offset_1(0), m_sample_rom_offset_2(0), + m_offset_shift(0) { } required_device m_maincpu; - + required_device m_dac_1; + required_device m_dac_2; + UINT16 m_blitter[RLT_NUM_BLITTER_REGS]; - INT32 m_data760000; INT32 m_data740000; INT32 m_dac_counter; INT32 m_sample_rom_offset_1; INT32 m_sample_rom_offset_2; - INT32 m_offset_shift; - INT32 m_unk_counter; - bitmap_ind16 *m_tmp_bitmap[RLT_NUM_BITMAPS]; - - required_device m_dac_1; - required_device m_dac_2; - UINT8 *m_samples_1; UINT8 *m_samples_2; - UINT8 *m_gfx; - emu_timer *m_timer; - DECLARE_READ16_MEMBER(rlt_io_r); - DECLARE_WRITE16_MEMBER(rlt_snd1_w); - DECLARE_WRITE16_MEMBER(rlt_snd2_w); - DECLARE_WRITE16_MEMBER(rlt_blitter_w); + DECLARE_READ16_MEMBER(io_r); + DECLARE_WRITE16_MEMBER(snd1_w); + DECLARE_WRITE16_MEMBER(snd2_w); + DECLARE_WRITE16_MEMBER(blitter_w); + virtual void machine_start(); virtual void machine_reset(); virtual void video_start(); - UINT32 screen_update_rltennis(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - INTERRUPT_GEN_MEMBER(rltennis_interrupt); + + UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + + INTERRUPT_GEN_MEMBER(interrupt); TIMER_CALLBACK_MEMBER(sample_player); }; diff --git a/src/mame/includes/seta.h b/src/mame/includes/seta.h index 596b0f44e23..e8e2b7e821c 100644 --- a/src/mame/includes/seta.h +++ b/src/mame/includes/seta.h @@ -234,4 +234,5 @@ public: void uPD71054_timer_init( ); DECLARE_WRITE_LINE_MEMBER(pit_out0); DECLARE_WRITE_LINE_MEMBER(utoukond_ym3438_interrupt); + SETA001_SPRITE_GFXBANK_CB_MEMBER(setac_gfxbank_callback); }; diff --git a/src/mame/includes/seta2.h b/src/mame/includes/seta2.h index f17c3242b22..31c86630548 100644 --- a/src/mame/includes/seta2.h +++ b/src/mame/includes/seta2.h @@ -8,87 +8,91 @@ class seta2_state : public driver_device public: seta2_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), - m_maincpu(*this,"maincpu"), - m_tmp68301(*this, "tmp68301"), - m_nvram(*this, "nvram") , - m_spriteram(*this, "spriteram", 0), - m_vregs(*this, "vregs", 0), - m_funcube_outputs(*this, "funcube_outputs"), - m_funcube_leds(*this, "funcube_leds"), - m_x1(*this, "x1snd"), + m_maincpu(*this,"maincpu"), + m_tmp68301(*this, "tmp68301"), m_oki(*this, "oki"), m_eeprom(*this, "eeprom"), m_gfxdecode(*this, "gfxdecode"), m_screen(*this, "screen"), - m_palette(*this, "palette") { } + m_palette(*this, "palette"), + m_nvram(*this, "nvram"), + m_spriteram(*this, "spriteram", 0), + m_vregs(*this, "vregs", 0), + m_funcube_outputs(*this, "funcube_outputs"), + m_funcube_leds(*this, "funcube_leds") { } required_device m_maincpu; optional_device m_tmp68301; - optional_shared_ptr m_nvram; - - optional_shared_ptr m_spriteram; - optional_shared_ptr m_vregs; - - optional_shared_ptr m_funcube_outputs; - optional_shared_ptr m_funcube_leds; - - optional_device m_x1; optional_device m_oki; optional_device m_eeprom; required_device m_gfxdecode; required_device m_screen; required_device m_palette; + + optional_shared_ptr m_nvram; + optional_shared_ptr m_spriteram; + optional_shared_ptr m_vregs; + optional_shared_ptr m_funcube_outputs; + optional_shared_ptr m_funcube_leds; int m_xoffset; int m_yoffset; int m_keyboard_row; - UINT16 *m_buffered_spriteram; - + UINT64 m_funcube_coin_start_cycles; UINT8 m_funcube_hopper_motor; - DECLARE_WRITE16_MEMBER(seta2_vregs_w); - DECLARE_WRITE16_MEMBER(seta2_sound_bank_w); + DECLARE_WRITE16_MEMBER(vregs_w); + DECLARE_WRITE16_MEMBER(sound_bank_w); + DECLARE_WRITE16_MEMBER(grdians_lockout_w); + DECLARE_READ16_MEMBER(mj4simai_p1_r); DECLARE_READ16_MEMBER(mj4simai_p2_r); DECLARE_WRITE16_MEMBER(mj4simai_keyboard_w); + DECLARE_READ16_MEMBER(pzlbowl_protection_r); DECLARE_READ16_MEMBER(pzlbowl_coins_r); DECLARE_WRITE16_MEMBER(pzlbowl_coin_counter_w); + DECLARE_WRITE16_MEMBER(reelquak_leds_w); DECLARE_WRITE16_MEMBER(reelquak_coin_w); + DECLARE_WRITE16_MEMBER(samshoot_coin_w); + + DECLARE_READ16_MEMBER(gundamex_eeprom_r); + DECLARE_WRITE16_MEMBER(gundamex_eeprom_w); + DECLARE_READ32_MEMBER(funcube_nvram_dword_r); DECLARE_WRITE32_MEMBER(funcube_nvram_dword_w); DECLARE_WRITE16_MEMBER(spriteram16_word_w); DECLARE_READ16_MEMBER(spriteram16_word_r); - DECLARE_WRITE32_MEMBER(coldfire_regs_w); - DECLARE_READ32_MEMBER(coldfire_regs_r); DECLARE_READ32_MEMBER(funcube_debug_r); DECLARE_READ16_MEMBER(funcube_coins_r); DECLARE_WRITE16_MEMBER(funcube_leds_w); DECLARE_READ16_MEMBER(funcube_outputs_r); DECLARE_WRITE16_MEMBER(funcube_outputs_w); DECLARE_READ16_MEMBER(funcube_battery_r); - DECLARE_READ16_MEMBER(gundamex_eeprom_r); - DECLARE_WRITE16_MEMBER(gundamex_eeprom_w); DECLARE_READ32_MEMBER(oki_read); DECLARE_WRITE32_MEMBER(oki_write); + DECLARE_DRIVER_INIT(funcube3); DECLARE_DRIVER_INIT(funcube); DECLARE_DRIVER_INIT(funcube2); - DECLARE_VIDEO_START(seta2); + virtual void video_start(); + DECLARE_MACHINE_START(mj4simai); + DECLARE_MACHINE_START(funcube); DECLARE_MACHINE_RESET(funcube); - DECLARE_VIDEO_START(seta2_yoffset); - DECLARE_VIDEO_START(seta2_xoffset); - UINT32 screen_update_seta2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - void screen_eof_seta2(screen_device &screen, bool state); + DECLARE_VIDEO_START(yoffset); + DECLARE_VIDEO_START(xoffset); + INTERRUPT_GEN_MEMBER(seta2_interrupt); INTERRUPT_GEN_MEMBER(samshoot_interrupt); - INTERRUPT_GEN_MEMBER(funcube_sub_timer_irq); TIMER_DEVICE_CALLBACK_MEMBER(funcube_interrupt); + + UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + void screen_eof(screen_device &screen, bool state); void draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect); void funcube_debug_outputs(); }; diff --git a/src/mame/includes/srmp2.h b/src/mame/includes/srmp2.h index 04f9b3d63e7..3c440148725 100644 --- a/src/mame/includes/srmp2.h +++ b/src/mame/includes/srmp2.h @@ -13,51 +13,64 @@ class srmp2_state : public driver_device { public: srmp2_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag) , + : driver_device(mconfig, type, tag), m_maincpu(*this, "maincpu"), m_seta001(*this, "spritegen"), m_msm(*this, "msm") { } + required_device m_maincpu; + required_device m_seta001; + required_device m_msm; + int m_color_bank; int m_gfx_bank; - int m_adpcm_bank; int m_adpcm_data; UINT32 m_adpcm_sptr; UINT32 m_adpcm_eptr; - - int m_port_select; - iox_t m_iox; - DECLARE_WRITE16_MEMBER(srmp2_flags_w); - DECLARE_WRITE16_MEMBER(mjyuugi_flags_w); - DECLARE_WRITE16_MEMBER(mjyuugi_adpcm_bank_w); + + // common DECLARE_READ8_MEMBER(vox_status_r); DECLARE_READ8_MEMBER(iox_mux_r); DECLARE_READ8_MEMBER(iox_status_r); DECLARE_WRITE8_MEMBER(iox_command_w); DECLARE_WRITE8_MEMBER(iox_data_w); - DECLARE_WRITE8_MEMBER(srmp3_rombank_w); - DECLARE_WRITE8_MEMBER(srmp2_irq2_ack_w); - DECLARE_WRITE8_MEMBER(srmp2_irq4_ack_w); + DECLARE_WRITE_LINE_MEMBER(adpcm_int); + + // mjuugi + DECLARE_WRITE16_MEMBER(mjyuugi_flags_w); + 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); + + // srmp2 + DECLARE_WRITE8_MEMBER(srmp2_irq2_ack_w); + DECLARE_WRITE8_MEMBER(srmp2_irq4_ack_w); + DECLARE_WRITE16_MEMBER(srmp2_flags_w); + DECLARE_WRITE16_MEMBER(srmp2_adpcm_code_w); + + // srmp3 + DECLARE_WRITE8_MEMBER(srmp3_rombank_w); DECLARE_WRITE8_MEMBER(srmp3_flags_w); DECLARE_WRITE8_MEMBER(srmp3_irq_ack_w); - DECLARE_WRITE8_MEMBER(rmgoldyh_rombank_w); - DECLARE_WRITE16_MEMBER(srmp2_adpcm_code_w); DECLARE_WRITE8_MEMBER(srmp3_adpcm_code_w); + + virtual void machine_start(); DECLARE_MACHINE_START(srmp2); DECLARE_PALETTE_INIT(srmp2); DECLARE_MACHINE_START(srmp3); DECLARE_PALETTE_INIT(srmp3); DECLARE_MACHINE_START(rmgoldyh); + DECLARE_MACHINE_START(mjyuugi); + UINT32 screen_update_srmp2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); UINT32 screen_update_srmp3(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); UINT32 screen_update_mjyuugi(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + SETA001_SPRITE_GFXBANK_CB_MEMBER(srmp3_gfxbank_callback); + UINT8 iox_key_matrix_calc(UINT8 p_side); - DECLARE_WRITE_LINE_MEMBER(srmp2_adpcm_int); - required_device m_maincpu; - required_device m_seta001; - required_device m_msm; }; diff --git a/src/mame/includes/ssrj.h b/src/mame/includes/ssrj.h index 724f5800477..b9175dcc172 100644 --- a/src/mame/includes/ssrj.h +++ b/src/mame/includes/ssrj.h @@ -3,39 +3,46 @@ class ssrj_state : public driver_device public: ssrj_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_vram1(*this, "vram1"), m_vram2(*this, "vram2"), m_vram3(*this, "vram3"), m_vram4(*this, "vram4"), - m_scrollram(*this, "scrollram"), - m_maincpu(*this, "maincpu"), - m_gfxdecode(*this, "gfxdecode"), - m_palette(*this, "palette") { } + m_scrollram(*this, "scrollram") { } + + required_device m_maincpu; + required_device m_gfxdecode; + required_device m_palette; - int m_oldport; - tilemap_t *m_tilemap1; - tilemap_t *m_tilemap2; - tilemap_t *m_tilemap4; required_shared_ptr m_vram1; required_shared_ptr m_vram2; required_shared_ptr m_vram3; required_shared_ptr m_vram4; required_shared_ptr m_scrollram; + + int m_oldport; + tilemap_t *m_tilemap1; + tilemap_t *m_tilemap2; + tilemap_t *m_tilemap4; UINT8 *m_buffer_spriteram; - DECLARE_READ8_MEMBER(ssrj_wheel_r); - DECLARE_WRITE8_MEMBER(ssrj_vram1_w); - DECLARE_WRITE8_MEMBER(ssrj_vram2_w); - DECLARE_WRITE8_MEMBER(ssrj_vram4_w); + + 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_ssrj(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - void screen_eof_ssrj(screen_device &screen, bool state); + + 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 ); - required_device m_maincpu; - required_device m_gfxdecode; - required_device m_palette; }; diff --git a/src/mame/includes/subs.h b/src/mame/includes/subs.h index 72ca1adf0f1..1b9629a7b29 100644 --- a/src/mame/includes/subs.h +++ b/src/mame/includes/subs.h @@ -21,45 +21,53 @@ class subs_state : public driver_device public: subs_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), - m_spriteram(*this, "spriteram"), - m_videoram(*this, "videoram"), - m_discrete(*this, "discrete"), m_maincpu(*this, "maincpu"), m_gfxdecode(*this, "gfxdecode"), - m_palette(*this, "palette") { } + m_palette(*this, "palette"), + m_discrete(*this, "discrete"), + m_spriteram(*this, "spriteram"), + m_videoram(*this, "videoram") { } + + required_device m_maincpu; + required_device m_gfxdecode; + required_device m_palette; + required_device m_discrete; required_shared_ptr m_spriteram; required_shared_ptr m_videoram; - required_device m_discrete; + int m_steering_buf1; int m_steering_buf2; int m_steering_val1; int m_steering_val2; int m_last_val_1; int m_last_val_2; - DECLARE_WRITE8_MEMBER(subs_steer_reset_w); - DECLARE_READ8_MEMBER(subs_control_r); - DECLARE_READ8_MEMBER(subs_coin_r); - DECLARE_READ8_MEMBER(subs_options_r); - DECLARE_WRITE8_MEMBER(subs_lamp1_w); - DECLARE_WRITE8_MEMBER(subs_lamp2_w); - DECLARE_WRITE8_MEMBER(subs_invert1_w); - DECLARE_WRITE8_MEMBER(subs_invert2_w); + + DECLARE_WRITE8_MEMBER(steer_reset_w); + DECLARE_READ8_MEMBER(control_r); + DECLARE_READ8_MEMBER(coin_r); + DECLARE_READ8_MEMBER(options_r); + DECLARE_WRITE8_MEMBER(lamp1_w); + DECLARE_WRITE8_MEMBER(lamp2_w); + DECLARE_WRITE8_MEMBER(invert1_w); + DECLARE_WRITE8_MEMBER(invert2_w); + DECLARE_WRITE8_MEMBER(sonar1_w); + DECLARE_WRITE8_MEMBER(sonar2_w); + 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_subs_left(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_subs_right(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - INTERRUPT_GEN_MEMBER(subs_interrupt); - DECLARE_WRITE8_MEMBER(subs_sonar1_w); - DECLARE_WRITE8_MEMBER(subs_sonar2_w); - DECLARE_WRITE8_MEMBER(subs_crash_w); - DECLARE_WRITE8_MEMBER(subs_explode_w); - DECLARE_WRITE8_MEMBER(subs_noise_reset_w); - int subs_steering_1(); - int subs_steering_2(); - required_device m_maincpu; - required_device m_gfxdecode; - required_device m_palette; + + 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(); }; /*----------- defined in audio/subs.c -----------*/ diff --git a/src/mame/includes/suna16.h b/src/mame/includes/suna16.h index b7136d46524..6ccfc4f4045 100644 --- a/src/mame/includes/suna16.h +++ b/src/mame/includes/suna16.h @@ -6,20 +6,18 @@ public: suna16_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), m_maincpu(*this,"maincpu"), - m_spriteram(*this, "spriteram"), - m_spriteram2(*this, "spriteram2"), m_dac1(*this, "dac1"), m_dac2(*this, "dac2"), m_dac3(*this, "dac3"), m_dac4(*this, "dac4"), m_gfxdecode(*this, "gfxdecode"), m_screen(*this, "screen"), - m_palette(*this, "palette") + m_palette(*this, "palette"), + m_spriteram(*this, "spriteram"), + m_spriteram2(*this, "spriteram2") { } required_device m_maincpu; - required_shared_ptr m_spriteram; - optional_shared_ptr m_spriteram2; required_device m_dac1; required_device m_dac2; optional_device m_dac3; @@ -27,37 +25,52 @@ public: required_device m_gfxdecode; required_device m_screen; required_device m_palette; - UINT8 m_prot; + + required_shared_ptr m_spriteram; + optional_shared_ptr m_spriteram2; + UINT16 *m_paletteram; int m_color_bank; + UINT8 m_prot; - DECLARE_WRITE16_MEMBER(suna16_soundlatch_w); - DECLARE_WRITE16_MEMBER(bssoccer_leds_w); - DECLARE_WRITE16_MEMBER(uballoon_leds_w); - DECLARE_READ8_MEMBER(uballoon_prot_r); - DECLARE_WRITE8_MEMBER(uballoon_prot_w); + // common + DECLARE_WRITE16_MEMBER(soundlatch_w); + DECLARE_READ16_MEMBER(paletteram_r); + DECLARE_WRITE16_MEMBER(paletteram_w); + 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); DECLARE_READ8_MEMBER(bestbest_prot_r); DECLARE_WRITE8_MEMBER(bestbest_prot_w); + DECLARE_WRITE8_MEMBER(bestbest_ay8910_port_a_w); + + // bssoccer specific + DECLARE_WRITE16_MEMBER(bssoccer_leds_w); DECLARE_WRITE8_MEMBER(bssoccer_pcm_1_bankswitch_w); DECLARE_WRITE8_MEMBER(bssoccer_pcm_2_bankswitch_w); - DECLARE_WRITE8_MEMBER(uballoon_pcm_1_bankswitch_w); - DECLARE_WRITE16_MEMBER(suna16_flipscreen_w); - DECLARE_WRITE16_MEMBER(bestbest_flipscreen_w); - DECLARE_READ16_MEMBER(suna16_paletteram16_r); - DECLARE_WRITE16_MEMBER(suna16_paletteram16_w); - DECLARE_MACHINE_START(bssoccer); - DECLARE_WRITE8_MEMBER(bssoccer_DAC1_w); - DECLARE_WRITE8_MEMBER(bssoccer_DAC2_w); DECLARE_WRITE8_MEMBER(bssoccer_DAC3_w); DECLARE_WRITE8_MEMBER(bssoccer_DAC4_w); - DECLARE_WRITE8_MEMBER(bestbest_ay8910_port_a_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_RESET(uballoon); + DECLARE_MACHINE_START(bestbest); + DECLARE_MACHINE_START(bssoccer); DECLARE_MACHINE_START(uballoon); - UINT32 screen_update_suna16(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + 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); - TIMER_DEVICE_CALLBACK_MEMBER(bssoccer_interrupt); 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 0d9963dbf92..a04d8166faa 100644 --- a/src/mame/includes/suprloco.h +++ b/src/mame/includes/suprloco.h @@ -3,33 +3,38 @@ class suprloco_state : public driver_device public: suprloco_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), - m_spriteram(*this, "spriteram"), - m_videoram(*this, "videoram"), - m_scrollram(*this, "scrollram"), m_maincpu(*this, "maincpu"), m_audiocpu(*this, "audiocpu"), - m_gfxdecode(*this, "gfxdecode") { } + m_gfxdecode(*this, "gfxdecode"), + m_spriteram(*this, "spriteram"), + m_videoram(*this, "videoram"), + m_scrollram(*this, "scrollram") { } + + required_device m_maincpu; + required_device m_audiocpu; + required_device m_gfxdecode; required_shared_ptr m_spriteram; required_shared_ptr m_videoram; required_shared_ptr m_scrollram; + tilemap_t *m_bg_tilemap; int m_control; - DECLARE_WRITE8_MEMBER(suprloco_soundport_w); - DECLARE_WRITE8_MEMBER(suprloco_videoram_w); - DECLARE_WRITE8_MEMBER(suprloco_scrollram_w); - DECLARE_WRITE8_MEMBER(suprloco_control_w); - DECLARE_READ8_MEMBER(suprloco_control_r); - DECLARE_DRIVER_INIT(suprloco); + DECLARE_WRITE8_MEMBER(soundport_w); + DECLARE_WRITE8_MEMBER(videoram_w); + 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); - UINT32 screen_update_suprloco(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + 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); void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); - required_device m_maincpu; - required_device m_audiocpu; - required_device m_gfxdecode; }; diff --git a/src/mame/includes/suprridr.h b/src/mame/includes/suprridr.h index ac5ababb02a..fe39170bee4 100644 --- a/src/mame/includes/suprridr.h +++ b/src/mame/includes/suprridr.h @@ -11,47 +11,56 @@ class suprridr_state : public driver_device public: suprridr_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), - m_fgram(*this, "fgram"), - m_bgram(*this, "bgram"), - m_spriteram(*this, "spriteram"), m_maincpu(*this, "maincpu"), m_audiocpu(*this, "audiocpu"), m_gfxdecode(*this, "gfxdecode"), - m_palette(*this, "palette") { } + m_palette(*this, "palette"), + m_fgram(*this, "fgram"), + m_bgram(*this, "bgram"), + m_spriteram(*this, "spriteram") { } + + required_device m_maincpu; + required_device m_audiocpu; + required_device m_gfxdecode; + required_device m_palette; + + required_shared_ptr m_fgram; + required_shared_ptr m_bgram; + required_shared_ptr m_spriteram; UINT8 m_nmi_enable; UINT8 m_sound_data; - required_shared_ptr m_fgram; - required_shared_ptr m_bgram; tilemap_t *m_fg_tilemap; tilemap_t *m_bg_tilemap; tilemap_t *m_bg_tilemap_noscroll; UINT8 m_flipx; UINT8 m_flipy; - required_shared_ptr m_spriteram; + DECLARE_WRITE8_MEMBER(nmi_enable_w); DECLARE_WRITE8_MEMBER(sound_data_w); DECLARE_WRITE8_MEMBER(sound_irq_ack_w); DECLARE_WRITE8_MEMBER(coin_lock_w); - DECLARE_WRITE8_MEMBER(suprridr_flipx_w); - DECLARE_WRITE8_MEMBER(suprridr_flipy_w); - DECLARE_WRITE8_MEMBER(suprridr_fgdisable_w); - DECLARE_WRITE8_MEMBER(suprridr_fgscrolly_w); - DECLARE_WRITE8_MEMBER(suprridr_bgscrolly_w); - DECLARE_WRITE8_MEMBER(suprridr_bgram_w); - DECLARE_WRITE8_MEMBER(suprridr_fgram_w); - DECLARE_CUSTOM_INPUT_MEMBER(suprridr_control_r); + DECLARE_WRITE8_MEMBER(flipx_w); + DECLARE_WRITE8_MEMBER(flipy_w); + DECLARE_WRITE8_MEMBER(fgdisable_w); + DECLARE_WRITE8_MEMBER(fgscrolly_w); + DECLARE_WRITE8_MEMBER(bgscrolly_w); + 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); - virtual void video_start(); - DECLARE_PALETTE_INIT(suprridr); - UINT32 screen_update_suprridr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + INTERRUPT_GEN_MEMBER(main_nmi_gen); TIMER_CALLBACK_MEMBER(delayed_sound_w); - int suprridr_is_screen_flipped(); - required_device m_maincpu; - required_device m_audiocpu; - required_device m_gfxdecode; - required_device m_palette; + + 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/thedeep.h b/src/mame/includes/thedeep.h index 301bb0c8b0d..948f278ac60 100644 --- a/src/mame/includes/thedeep.h +++ b/src/mame/includes/thedeep.h @@ -1,3 +1,6 @@ +#include "video/decmxc06.h" + + class thedeep_state : public driver_device { public: @@ -12,7 +15,9 @@ public: m_vram_0(*this, "vram_0"), m_vram_1(*this, "vram_1"), m_scroll(*this, "scroll"), - m_scroll2(*this, "scroll2") { } + m_scroll2(*this, "scroll2"), + m_spritegen(*this, "spritegen") + { } required_device m_maincpu; required_device m_audiocpu; @@ -25,6 +30,7 @@ public: required_shared_ptr m_vram_1; required_shared_ptr m_scroll; required_shared_ptr m_scroll2; + required_device m_spritegen; int m_nmi_enable; UINT8 m_protection_command; @@ -59,7 +65,6 @@ public: DECLARE_PALETTE_INIT(thedeep); UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(mcu_irq); TIMER_DEVICE_CALLBACK_MEMBER(interrupt); diff --git a/src/mame/layout/bingowng.lay b/src/mame/layout/bingowng.lay index 27e21b70e4f..5a0bd24e575 100644 --- a/src/mame/layout/bingowng.lay +++ b/src/mame/layout/bingowng.lay @@ -1,12 +1,9 @@ + - - - - - - + + @@ -14,12 +11,8 @@ - - - - - - + + @@ -27,12 +20,8 @@ - - - - - - + + @@ -40,26 +29,17 @@ - - - - - - + + - - - - - - - + + @@ -67,26 +47,234 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + - - + + + + + + + + + + + + + + + + + - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/mame/layout/cherryb3.lay b/src/mame/layout/cherryb3.lay index e6822b47a8e..72a19d4b656 100644 --- a/src/mame/layout/cherryb3.lay +++ b/src/mame/layout/cherryb3.lay @@ -156,110 +156,248 @@ - - - + - - - + - - - + - - - + + + + - - - - + - - - + + + + + - - - - - - - - - - - - - - - - - - - + + + + + - + - + - - + - + - - + - + - - + - + - - + - + - - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/mame/layout/chrygld.lay b/src/mame/layout/chrygld.lay new file mode 100644 index 00000000000..f0c98344f8d --- /dev/null +++ b/src/mame/layout/chrygld.lay @@ -0,0 +1,265 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/mame/layout/cmaster.lay b/src/mame/layout/cmaster.lay index 5d0d0daf58a..f423f79e36a 100644 --- a/src/mame/layout/cmaster.lay +++ b/src/mame/layout/cmaster.lay @@ -13,7 +13,7 @@ - + @@ -30,9 +30,9 @@ - + - + @@ -47,7 +47,7 @@ - + @@ -90,7 +90,7 @@ - + @@ -116,7 +116,7 @@ - + @@ -125,7 +125,7 @@ - + @@ -211,50 +211,50 @@ - + - + - + - + - + - + - + - + - + - + - + - + diff --git a/src/mame/layout/cmasterb.lay b/src/mame/layout/cmasterb.lay index a80537d28ff..00f61ca3f7b 100644 --- a/src/mame/layout/cmasterb.lay +++ b/src/mame/layout/cmasterb.lay @@ -13,7 +13,7 @@ - + @@ -30,9 +30,9 @@ - + - + @@ -108,7 +108,7 @@ - + @@ -203,50 +203,50 @@ - + - + - + - + - + - + - + - + - + - + - + - + diff --git a/src/mame/layout/cmasterc.lay b/src/mame/layout/cmasterc.lay index 908f1fba95d..b0c787281c9 100644 --- a/src/mame/layout/cmasterc.lay +++ b/src/mame/layout/cmasterc.lay @@ -13,7 +13,7 @@ - + @@ -30,7 +30,7 @@ - + @@ -47,9 +47,9 @@ - + - + @@ -112,7 +112,7 @@ - + @@ -207,50 +207,50 @@ - + - + - + - + - + - + - + - + - + - + - + - + diff --git a/src/mame/layout/cmpacman.lay b/src/mame/layout/cmpacman.lay new file mode 100644 index 00000000000..7f7513bbc7c --- /dev/null +++ b/src/mame/layout/cmpacman.lay @@ -0,0 +1,271 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/mame/layout/cmv4.lay b/src/mame/layout/cmv4.lay index e726fc274b6..3581c676be7 100644 --- a/src/mame/layout/cmv4.lay +++ b/src/mame/layout/cmv4.lay @@ -8,29 +8,12 @@ - - - - - - - - - - - - - - - - - - + - + @@ -42,14 +25,14 @@ - + - + - + @@ -64,7 +47,7 @@ - + @@ -76,6 +59,23 @@ + + + + + + + + + + + + + + + + + @@ -116,7 +116,7 @@ - + @@ -134,7 +134,7 @@ - + @@ -211,50 +211,50 @@ - + - + - + - + - + - + - + - + - + - + - + - + diff --git a/src/mame/layout/crazybon.lay b/src/mame/layout/crazybon.lay index bfed6b53d98..daad324d85b 100644 --- a/src/mame/layout/crazybon.lay +++ b/src/mame/layout/crazybon.lay @@ -203,51 +203,51 @@ - - - - - - - - - + - + - + - + - + - + - + + + + + + + + + - + - - + + - - + + diff --git a/src/mame/layout/goldstar.lay b/src/mame/layout/goldstar.lay index cf2ede71722..81507522930 100644 --- a/src/mame/layout/goldstar.lay +++ b/src/mame/layout/goldstar.lay @@ -242,50 +242,50 @@ - + - + - + - + - + - + - + - + - + - + - + - + diff --git a/src/mame/layout/lucky8.lay b/src/mame/layout/lucky8.lay index f481c547fad..ef0f1b80c60 100644 --- a/src/mame/layout/lucky8.lay +++ b/src/mame/layout/lucky8.lay @@ -1,77 +1,54 @@ + - - - - - - + + - + - - - - - - + + - + - - - - - - + + - + - - - - - - + + - + - - - - - - + + - + - - - - - - - + + + @@ -83,29 +60,262 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + - - + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/mame/layout/nfb96.lay b/src/mame/layout/nfb96.lay index c45fb01e452..c8dbb22cea4 100644 --- a/src/mame/layout/nfb96.lay +++ b/src/mame/layout/nfb96.lay @@ -17,11 +17,11 @@ - + - + @@ -30,15 +30,15 @@ - + - + - + @@ -47,19 +47,15 @@ - + - + - - - - - + - + @@ -68,19 +64,15 @@ - + - + - - - - - + - + @@ -93,7 +85,7 @@ - + @@ -106,7 +98,7 @@ - + @@ -119,7 +111,7 @@ - + @@ -128,6 +120,15 @@ + + + + + + + + + @@ -184,77 +185,77 @@ - + - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + diff --git a/src/mame/layout/nfb96tx.lay b/src/mame/layout/nfb96tx.lay new file mode 100644 index 00000000000..4373d2a3546 --- /dev/null +++ b/src/mame/layout/nfb96tx.lay @@ -0,0 +1,262 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/mame/layout/pokonl97.lay b/src/mame/layout/pokonl97.lay index a95121453d8..a87ef2b677e 100644 --- a/src/mame/layout/pokonl97.lay +++ b/src/mame/layout/pokonl97.lay @@ -10,31 +10,39 @@ - + - + - + - + + + + + - + - + - + + + + + @@ -43,45 +51,57 @@ - + - + - + + + + + - + - + - + - + + + + + - + - + - + + + + + @@ -94,11 +114,15 @@ - + + + + + - + @@ -116,7 +140,25 @@ - + + + + + + + + + + + + + + + + + + + @@ -167,77 +209,77 @@ - + - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + diff --git a/src/mame/layout/roypok96.lay b/src/mame/layout/roypok96.lay index a9c68624a24..4dd29a2db40 100644 --- a/src/mame/layout/roypok96.lay +++ b/src/mame/layout/roypok96.lay @@ -26,7 +26,7 @@ - + @@ -56,7 +56,7 @@ - + @@ -103,7 +103,7 @@ - + @@ -112,6 +112,15 @@ + + + + + + + + + @@ -130,6 +139,15 @@ + + + + + + + + + @@ -203,50 +221,50 @@ - + - + - + - + - + - + - + - + - + - + - + - + diff --git a/src/mame/layout/skill98.lay b/src/mame/layout/skill98.lay new file mode 100644 index 00000000000..0ae14c87420 --- /dev/null +++ b/src/mame/layout/skill98.lay @@ -0,0 +1,253 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/mame/layout/tonypok.lay b/src/mame/layout/tonypok.lay new file mode 100644 index 00000000000..be0c1ba3073 --- /dev/null +++ b/src/mame/layout/tonypok.lay @@ -0,0 +1,418 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/mame/layout/unkch.lay b/src/mame/layout/unkch.lay new file mode 100644 index 00000000000..600db78a390 --- /dev/null +++ b/src/mame/layout/unkch.lay @@ -0,0 +1,180 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/mame/machine/iteagle_fpga.c b/src/mame/machine/iteagle_fpga.c new file mode 100644 index 00000000000..22f907ddcdd --- /dev/null +++ b/src/mame/machine/iteagle_fpga.c @@ -0,0 +1,364 @@ +#include "iteagle_fpga.h" +#include "coreutil.h" + +#define LOG_FPGA (1) +#define LOG_RTC (0) +#define LOG_EEPROM (1) +#define LOG_IDE (0) +#define LOG_IDE_CTRL (0) + + +const device_type ITEAGLE_FPGA = &device_creator; + +DEVICE_ADDRESS_MAP_START(ctrl_map, 32, iteagle_fpga_device) + AM_RANGE(0x000, 0x02f) AM_READWRITE(ctrl_r, ctrl_w) +ADDRESS_MAP_END + +DEVICE_ADDRESS_MAP_START(fpga_map, 32, iteagle_fpga_device) + AM_RANGE(0x000, 0x01f) AM_READWRITE(fpga_r, fpga_w) +ADDRESS_MAP_END + +DEVICE_ADDRESS_MAP_START(rtc_map, 32, iteagle_fpga_device) + AM_RANGE(0x000, 0x800) AM_READWRITE(rtc_r, rtc_w) +ADDRESS_MAP_END + +iteagle_fpga_device::iteagle_fpga_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + : pci_device(mconfig, ITEAGLE_FPGA, "ITEagle FPGA", tag, owner, clock, "iteagle_fpga", __FILE__) +{ +} + +void iteagle_fpga_device::device_start() +{ + pci_device::device_start(); + status = 0x5555; + command = 0x5555; + + 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)); + + 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)); + + 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)); +} + +void iteagle_fpga_device::device_reset() +{ + pci_device::device_reset(); + memset(m_ctrl_regs, 0, sizeof(m_ctrl_regs)); + memset(m_fpga_regs, 0, sizeof(m_fpga_regs)); + memset(m_rtc_regs, 0, sizeof(m_rtc_regs)); + // 0x23 & 0x20 = IDE LED + m_ctrl_regs[0x10/4] = 0x00000000; // 0xFFFFFFFF causes a write of 0xFFFEFFFF then 0xFFFFFFFF // Not sure + // 0x00&0x2 == 1 for boot + m_fpga_regs[0x00/4] = 0xC0000002; // 0xCF000002;// byte 3 is voltage sensor? high = 0x40 good = 0xC0 0xF0 0xFF; //0x80 0x30 0x00FF = voltage low + //m_fpga_regs[0x308/4]=0x0000ffff; // Low 16 bits gets read alot? + m_fpga_regs[0x08/4]=0x00000000; // Low 16 bits gets read alot? + m_prev_reg = 0; +} + +READ32_MEMBER( iteagle_fpga_device::ctrl_r ) +{ + UINT32 result = m_fpga_regs[offset]; + switch (offset) { + case 0x0/4: + if (LOG_FPGA) + logerror("%s:fpga ctrl_r from offset %04X = %08X & %08X\n", machine().describe_context(), offset*4, result, mem_mask); + break; + default: + if (LOG_FPGA) + logerror("%s:fpga ctrl_r from offset %04X = %08X & %08X\n", machine().describe_context(), offset*4, result, mem_mask); + break; + } + return result; +} + +WRITE32_MEMBER( iteagle_fpga_device::ctrl_w ) +{ + COMBINE_DATA(&m_fpga_regs[offset]); + switch (offset) { + case 0x20/4: // IDE LED and ?? + if (ACCESSING_BITS_16_23) { + // Probably watchdog + } else if (ACCESSING_BITS_24_31) { + // Bit 1 is IDE LED + } else { + if (LOG_FPGA) + logerror("%s:fpga ctrl_w to offset %04X = %08X & %08X\n", machine().describe_context(), offset*4, data, mem_mask); + } + break; + default: + if (LOG_FPGA) + logerror("%s:fpga ctrl_w to offset %04X = %08X & %08X\n", machine().describe_context(), offset*4, data, mem_mask); + break; + } +} + +READ32_MEMBER( iteagle_fpga_device::fpga_r ) +{ + UINT32 result = m_fpga_regs[offset]; + switch (offset) { + case 0x00/4: + 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: + 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); + break; + + case 0x08/4: + if (LOG_FPGA && (m_prev_reg != offset && m_prev_reg != (0x00/4))) + logerror("%s:fpga read from offset %04X = %08X & %08X\n", machine().describe_context(), offset*4, result, mem_mask); + break; + default: + if (LOG_FPGA) + logerror("%s:fpga read from offset %04X = %08X & %08X\n", machine().describe_context(), offset*4, result, mem_mask); + break; + } + m_prev_reg = offset; + return result; +} + +WRITE32_MEMBER( iteagle_fpga_device::fpga_w ) +{ + UINT8 byte; + + COMBINE_DATA(&m_fpga_regs[offset]); + switch (offset) { + case 0x04/4: + if (ACCESSING_BITS_0_7) { + // ATMEL Chip access. Returns version id's when bit 7 is set. + byte = data & 0xFF; + if (byte & 0x80) { + switch (byte&0x3) { + case 0: + m_fpga_regs[offset] = (m_fpga_regs[offset]&0xFFFFFF00) | ((machine().root_device().ioport("VERSION")->read()>>4)&0xF); + break; + case 1: + m_fpga_regs[offset] = (m_fpga_regs[offset]&0xFFFFFF00) | ((machine().root_device().ioport("VERSION")->read()>>8)&0xF); + break; + case 2: + m_fpga_regs[offset] = (m_fpga_regs[offset]&0xFFFFFF00) | ((machine().root_device().ioport("VERSION")->read()>>12)&0xF); + break; + case 3: + m_fpga_regs[offset] = (m_fpga_regs[offset]&0xFFFFFF00) | ((machine().root_device().ioport("VERSION")->read()>>0)&0xF); + break; + } + } // Else??? + } + if (LOG_FPGA) + logerror("%s:fpga write to offset %04X = %08X & %08X\n", machine().describe_context(), offset*4, data, mem_mask); + break; + default: + if (LOG_FPGA) + logerror("%s:fpga write to offset %04X = %08X & %08X\n", machine().describe_context(), offset*4, data, mem_mask); + break; + } +} +//************************************* +//* RTC M48T02 +//************************************* +READ32_MEMBER( iteagle_fpga_device::rtc_r ) +{ + UINT32 result = m_rtc_regs[offset]; + + switch (offset) { + default: + if (LOG_RTC) + logerror("%s:RTC read from offset %04X = %08X & %08X\n", machine().describe_context(), offset*4, result, mem_mask); + break; + } + return result; +} +WRITE32_MEMBER( iteagle_fpga_device::rtc_w ) +{ + system_time systime; + int raw[8]; + + COMBINE_DATA(&m_rtc_regs[offset]); + switch (offset) { + case 0x7F8/4: // M48T02 time + if (data & mem_mask & 0x40) { + // get the current date/time from the core + machine().current_datetime(systime); + raw[0] = 0x40; + 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); + raw[7] = dec_2_bcd(systime.local_time.year - 1900); // Epoch is 1900 + 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) + logerror("%s:RTC write to offset %04X = %08X & %08X\n", machine().describe_context(), offset*4, data, mem_mask); + break; + } + +} + +//************************************ +// Attached serial EEPROM +//************************************ + +const device_type ITEAGLE_EEPROM = &device_creator; + +DEVICE_ADDRESS_MAP_START(eeprom_map, 32, iteagle_eeprom_device) + AM_RANGE(0x0000, 0x000F) AM_READWRITE(eeprom_r, eeprom_w) AM_SHARE("eeprom") +ADDRESS_MAP_END + +static MACHINE_CONFIG_FRAGMENT( iteagle_eeprom ) + MCFG_EEPROM_SERIAL_93C46_ADD("eeprom") +MACHINE_CONFIG_END + +machine_config_constructor iteagle_eeprom_device::device_mconfig_additions() const +{ + return MACHINE_CONFIG_NAME( iteagle_eeprom ); +} + +iteagle_eeprom_device::iteagle_eeprom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + : pci_device(mconfig, ITEAGLE_EEPROM, "ITEagle EEPROM AT93C46", tag, owner, clock, "eeprom", __FILE__), + m_eeprom(*this, "eeprom") +{ +} + +void iteagle_eeprom_device::device_start() +{ + pci_device::device_start(); + skip_map_regs(1); + add_map(0x10, M_IO, FUNC(iteagle_eeprom_device::eeprom_map)); +} + +void iteagle_eeprom_device::device_reset() +{ + pci_device::device_reset(); +} + +READ32_MEMBER( iteagle_eeprom_device::eeprom_r ) +{ + UINT32 result = 0; + + switch (offset) { + case 0xC/4: // I2C Handler + if (ACCESSING_BITS_16_23) { + result = m_eeprom->do_read()<<(16+3); + } else { + if (LOG_EEPROM) + logerror("%s:eeprom read from offset %04X = %08X & %08X\n", machine().describe_context(), offset*4, result, mem_mask); + } + break; + default: + if (LOG_EEPROM) + logerror("%s:eeprom read from offset %04X = %08X & %08X\n", machine().describe_context(), offset*4, result, mem_mask); + break; + } + return result; +} + +WRITE32_MEMBER( iteagle_eeprom_device::eeprom_w ) +{ + switch (offset) { + case 0xC/4: // I2C Handler + if (ACCESSING_BITS_16_23) { + 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 { + if (LOG_EEPROM) + logerror("%s:eeprom write to offset %04X = %08X & %08X\n", machine().describe_context(), offset*4, data, mem_mask); + } + break; + default: + if (LOG_EEPROM) + logerror("%s:eeprom write to offset %04X = %08X & %08X\n", machine().describe_context(), offset*4, data, mem_mask); + break; + } +} + +//************************************ +// Attached IDE Controller +//************************************ + +const device_type ITEAGLE_IDE = &device_creator; + +DEVICE_ADDRESS_MAP_START(ide_map, 32, iteagle_ide_device) + AM_RANGE(0x0, 0xf) AM_READWRITE(ide_r, ide_w) +ADDRESS_MAP_END + +DEVICE_ADDRESS_MAP_START(ide_ctrl_map, 32, iteagle_ide_device) + AM_RANGE(0x0, 0x3) AM_READWRITE(ide_ctrl_r, ide_ctrl_w) +ADDRESS_MAP_END + + +static MACHINE_CONFIG_FRAGMENT( iteagle_ide ) + MCFG_BUS_MASTER_IDE_CONTROLLER_ADD("ide", ata_devices, "hdd", NULL, true) + MCFG_BUS_MASTER_IDE_CONTROLLER_SPACE(":maincpu", AS_PROGRAM) +MACHINE_CONFIG_END + +machine_config_constructor iteagle_ide_device::device_mconfig_additions() const +{ + return MACHINE_CONFIG_NAME( iteagle_ide ); +} +iteagle_ide_device::iteagle_ide_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + : pci_device(mconfig, ITEAGLE_IDE, "ITEagle IDE Controller", tag, owner, clock, "ide", __FILE__), + m_ide(*this, "ide") +{ +} + +void iteagle_ide_device::device_start() +{ + pci_device::device_start(); + add_map(0x10, M_IO, FUNC(iteagle_ide_device::ide_map)); + bank_infos[0].adr = 0x1f0; + add_map(0x4, M_IO, FUNC(iteagle_ide_device::ide_ctrl_map)); + bank_infos[1].adr = 0x3f4; +} + +void iteagle_ide_device::device_reset() +{ + pci_device::device_reset(); +} +//************************************* +//* IDE +//************************************* +READ32_MEMBER( iteagle_ide_device::ide_r ) +{ + UINT32 result = m_ide->read_cs0(space, offset, mem_mask); + if (LOG_IDE) + logerror("%s:ide_r read from offset %04X = %08X & %08X\n", machine().describe_context(), offset*4, result, mem_mask); + return result; +} +WRITE32_MEMBER( iteagle_ide_device::ide_w ) +{ + m_ide->write_cs0(space, offset, data, mem_mask); + if (LOG_IDE) + logerror("%s:ide_w write to offset %04X = %08X & %08X\n", machine().describe_context(), offset*4, data, mem_mask); +} +READ32_MEMBER( iteagle_ide_device::ide_ctrl_r ) +{ + UINT32 result = m_ide->read_cs1(space, offset+1, mem_mask); + if (LOG_IDE_CTRL) + logerror("%s:ide_ctrl_r read from offset %04X = %08X & %08X\n", machine().describe_context(), offset*4, result, mem_mask); + return result; +} +WRITE32_MEMBER( iteagle_ide_device::ide_ctrl_w ) +{ + m_ide->write_cs1(space, offset+1, data, mem_mask); + if (LOG_IDE_CTRL) + logerror("%s:ide_ctrl_w 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 new file mode 100644 index 00000000000..acc4bd85b00 --- /dev/null +++ b/src/mame/machine/iteagle_fpga.h @@ -0,0 +1,91 @@ +//************************************* +// iteagle fpga device +//************************************* +#ifndef ITEAGLE_FPGA_H +#define ITEAGLE_FPGA_H + +#include "machine/pci.h" +#include "machine/idectrl.h" +#include "machine/eepromser.h" + +#define MCFG_ITEAGLE_FPGA_ADD(_tag) \ + MCFG_PCI_DEVICE_ADD(_tag, ITEAGLE_FPGA, 0x55CC33AA, 0xAA, 0xAAAAAA, 0x00) + +#define MCFG_ITEAGLE_EEPROM_ADD(_tag) \ + MCFG_PCI_DEVICE_ADD(_tag, ITEAGLE_EEPROM, 0xAABBCCDD, 0x00, 0x088000, 0x00) + +#define MCFG_ITEAGLE_IDE_ADD(_tag) \ + MCFG_PCI_DEVICE_ADD(_tag, ITEAGLE_IDE, 0x11223344, 0x00, 0x010100, 0x00) + +class iteagle_fpga_device : public pci_device { +public: + iteagle_fpga_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + +protected: + virtual void device_start(); + virtual void device_reset(); + +private: + + UINT32 m_ctrl_regs[0x30]; + 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); + + DECLARE_READ32_MEMBER( ctrl_r ); + DECLARE_WRITE32_MEMBER( ctrl_w ); + DECLARE_READ32_MEMBER( fpga_r ); + DECLARE_WRITE32_MEMBER( fpga_w ); + DECLARE_READ32_MEMBER( rtc_r ); + DECLARE_WRITE32_MEMBER( rtc_w ); +}; + +class iteagle_eeprom_device : public pci_device { +public: + iteagle_eeprom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + // optional information overrides + virtual machine_config_constructor device_mconfig_additions() const; + + required_device m_eeprom; + +protected: + virtual void device_start(); + virtual void device_reset(); + +private: + DECLARE_ADDRESS_MAP(eeprom_map, 32); + DECLARE_READ32_MEMBER( eeprom_r ); + DECLARE_WRITE32_MEMBER( eeprom_w ); +}; + +class iteagle_ide_device : public pci_device { +public: + iteagle_ide_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + // optional information overrides + virtual machine_config_constructor device_mconfig_additions() const; + + required_device m_ide; + +protected: + virtual void device_start(); + virtual void device_reset(); + +private: + DECLARE_ADDRESS_MAP(ide_map, 32); + DECLARE_ADDRESS_MAP(ide_ctrl_map, 32); + + DECLARE_READ32_MEMBER( ide_r ); + DECLARE_WRITE32_MEMBER( ide_w ); + DECLARE_READ32_MEMBER( ide_ctrl_r ); + DECLARE_WRITE32_MEMBER( ide_ctrl_w ); +}; + +extern const device_type ITEAGLE_FPGA; +extern const device_type ITEAGLE_EEPROM; +extern const device_type ITEAGLE_IDE; + +#endif diff --git a/src/mame/machine/subs.c b/src/mame/machine/subs.c index 9947a95ac4b..b16c52671c7 100644 --- a/src/mame/machine/subs.c +++ b/src/mame/machine/subs.c @@ -9,8 +9,19 @@ /*************************************************************************** -subs_init_machine +machine initialization ***************************************************************************/ + +void subs_state::machine_start() +{ + save_item(NAME(m_steering_buf1)); + save_item(NAME(m_steering_buf2)); + save_item(NAME(m_steering_val1)); + save_item(NAME(m_steering_val2)); + save_item(NAME(m_last_val_1)); + save_item(NAME(m_last_val_2)); +} + void subs_state::machine_reset() { m_steering_buf1 = 0; @@ -20,9 +31,9 @@ void subs_state::machine_reset() } /*************************************************************************** -subs_interrupt +interrupt ***************************************************************************/ -INTERRUPT_GEN_MEMBER(subs_state::subs_interrupt) +INTERRUPT_GEN_MEMBER(subs_state::interrupt) { /* only do NMI interrupt if not in TEST mode */ if ((ioport("IN1")->read() & 0x40)==0x40) @@ -36,7 +47,7 @@ When D7 is high, the steering wheel has moved. If D6 is high, it moved left. If D6 is low, it moved right. Be sure to keep returning a direction until steer_reset is called. ***************************************************************************/ -int subs_state::subs_steering_1() +int subs_state::steering_1() { int this_val; int delta; @@ -64,7 +75,7 @@ int subs_state::subs_steering_1() return m_steering_val1; } -int subs_state::subs_steering_2() +int subs_state::steering_2() { int this_val; int delta; @@ -93,18 +104,18 @@ int subs_state::subs_steering_2() } /*************************************************************************** -subs_steer_reset +steer_reset ***************************************************************************/ -WRITE8_MEMBER(subs_state::subs_steer_reset_w) +WRITE8_MEMBER(subs_state::steer_reset_w) { m_steering_val1 = 0x00; m_steering_val2 = 0x00; } /*************************************************************************** -subs_control_r +control_r ***************************************************************************/ -READ8_MEMBER(subs_state::subs_control_r) +READ8_MEMBER(subs_state::control_r) { int inport = ioport("IN0")->read(); @@ -114,19 +125,19 @@ READ8_MEMBER(subs_state::subs_control_r) case 0x01: return ((inport & 0x02) << 6); /* diag hold */ case 0x02: return ((inport & 0x04) << 5); /* slam */ case 0x03: return ((inport & 0x08) << 4); /* spare */ - case 0x04: return ((subs_steering_1() & 0x40) << 1); /* steer dir 1 */ - case 0x05: return ((subs_steering_1() & 0x80) << 0); /* steer flag 1 */ - case 0x06: return ((subs_steering_2() & 0x40) << 1); /* steer dir 2 */ - case 0x07: return ((subs_steering_2() & 0x80) << 0); /* steer flag 2 */ + case 0x04: return ((steering_1() & 0x40) << 1); /* steer dir 1 */ + case 0x05: return ((steering_1() & 0x80) << 0); /* steer flag 1 */ + case 0x06: return ((steering_2() & 0x40) << 1); /* steer dir 2 */ + case 0x07: return ((steering_2() & 0x80) << 0); /* steer flag 2 */ } return 0; } /*************************************************************************** -subs_coin_r +coin_r ***************************************************************************/ -READ8_MEMBER(subs_state::subs_coin_r) +READ8_MEMBER(subs_state::coin_r) { int inport = ioport("IN1")->read(); @@ -146,9 +157,9 @@ READ8_MEMBER(subs_state::subs_coin_r) } /*************************************************************************** -subs_options_r +options_r ***************************************************************************/ -READ8_MEMBER(subs_state::subs_options_r) +READ8_MEMBER(subs_state::options_r) { int opts = ioport("DSW")->read(); @@ -164,17 +175,17 @@ READ8_MEMBER(subs_state::subs_options_r) } /*************************************************************************** -subs_lamp1_w +lamp1_w ***************************************************************************/ -WRITE8_MEMBER(subs_state::subs_lamp1_w) +WRITE8_MEMBER(subs_state::lamp1_w) { set_led_status(machine(), 0,~offset & 1); } /*************************************************************************** -subs_lamp2_w +lamp2_w ***************************************************************************/ -WRITE8_MEMBER(subs_state::subs_lamp2_w) +WRITE8_MEMBER(subs_state::lamp2_w) { set_led_status(machine(), 1,~offset & 1); } diff --git a/src/mame/mame.lst b/src/mame/mame.lst index 0ca6ffebfcf..cc31e505792 100644 --- a/src/mame/mame.lst +++ b/src/mame/mame.lst @@ -2283,7 +2283,8 @@ champwru // C01 (c) 1989 Taito America Corporation (US) champwrj // C01 (c) 1989 Taito Corporation (Japan) puzznic // C20 (c) 1989 Taito Corporation (Japan) puzznicj // C20 (c) 1989 Taito Corporation (Japan) -puzznici // C20 (c) 1989 Taito Corporation (Japan) +puzznici // bootleg +puzznicb // bootleg horshoes // C47 (c) 1990 Taito America Corporation (US) palamed // C63 (c) 1990 Taito Corporation (Japan) cachat // ??? (c) 1993 Taito Corporation (Japan) @@ -2756,6 +2757,7 @@ bgaregganv // (c) 1996 Raizing/8ing bgareggat2 // (c) 1996 Raizing/8ing bgareggacn // (c) 1996 Raizing/8ing bgareggabl // hack +bgareggabla // hack batrider // (c) 1998 Raizing/8ing batrideru // (c) 1998 Raizing/8ing batriderc // (c) 1998 Raizing/8ing @@ -3108,8 +3110,9 @@ dynwar // 4/1989 (c) 1989 (USA) dynwara // 4/1989 (c) 1989 (USA) dynwarj // 4/1989 (c) 1989 (Japan) dynwarjr // 4/1989 (c) 1989 (Japan) -willow // 6/1989 (c) 1989 (USA) -willowo // 6/1989 (c) 1989 (USA) +willow // 6/1989 (c) 1989 (World) +willowu // 6/1989 (c) 1989 (USA) +willowuo // 6/1989 (c) 1989 (USA) willowj // 6/1989 (c) 1989 (Japan) unsquad // 8/1989 (c) 1989 (USA) area88 // 8/1989 (c) 1989 (Japan) @@ -3236,6 +3239,7 @@ sf2mdtb // bootleg sf2b // bootleg cworld2j // 11/06/1992 (c) 1992 (Japan) cworld2ja // 11/06/1992 (c) 1992 (Japan) +cworld2jb // 11/06/1992 (c) 1992 (Japan) varth // 14/07/1992 (c) 1992 (World) varthr1 // 12/06/1992 (c) 1992 (World) varthu // 12/06/1992 (c) 1992 (USA) @@ -5281,6 +5285,7 @@ mt_soni2 // 62 megaplay mp_sonic // 01 mp_gaxe2 // 02 +mp_gaxe2a // 02 mp_gslam // 03 mp_twc // 04 mp_sor2 // 05 @@ -8772,6 +8777,7 @@ gunbird // (c) 1994 gunbirdk // (c) 1994 gunbirdj // (c) 1994 btlkroad // (c) 1994 +btlkroadk // (c) 1994 s1945 // (c) 1995 s1945a // (c) 1995 s1945j // (c) 1995 @@ -9602,6 +9608,7 @@ inca // (c) 199? ???? blktouch // (c) Yang Gi Co Ltd. mcnpshnt // "33" Mahjong Campus Hunting 1990 Dynax 7jigen // "37" 7jigen no Youseitachi 1990 Dynax +mjembase // "38" Mahjong Electromagnetic Base 1989 Dynax neruton // "45" Mahjong Neruton Haikujiradan 1990 Dynax nerutona // "45" Mahjong Neruton Haikujiradan 1990 Dynax mjcomv1 // 1991 Dynax @@ -9610,9 +9617,11 @@ tenkai // 1991 Dynax tenkai2b // 1991 Dynax tenkaibb // 1991 Dynax tenkaicb // 1991 Dynax -tenkaid // 1991 Dynax tenkaie // 1991 Dynax +ougonpai // 1991 Dynax +ougonpaib // bootleg htengoku // 1992 Dynax +cdracula // 1994 Y.S.E. mjreach // 1994 Dynax mjdialq2 // "52" (c) 1991 Dynax yarunara // "55" Mahjong Yarunara 1991 Dynax @@ -10102,6 +10111,7 @@ twinbrata // (c) 1995 ppmast93 // (c) 1993 Electronic Devices S.R.L. twins // (c) 1994 twinsa // (c) 1994 +spider mwarr pzletime @@ -11236,6 +11246,7 @@ peip0120 // (c) 1987 IGT - International Game Technology pemg0183 // (c) 1994 IGT - International Game Technology pemg0252 // (c) 1994 IGT - International Game Technology pebe0014 // (c) 1994 IGT - International Game Technology +pebe0014a // (c) 1994 IGT - International Game Technology peke0017 // (c) 1994 IGT - International Game Technology peke1012 // (c) 1994 IGT - International Game Technology peke1013 // (c) 1994 IGT - International Game Technology @@ -11264,7 +11275,9 @@ peps0631 // (c) 1996 IGT - International Game Technology peps0716 // (c) 1996 IGT - International Game Technology pex0002p // (c) 1995 IGT - International Game Technology pex0002pa // (c) 1995 IGT - International Game Technology +pex0006p // (c) 1995 IGT - International Game Technology pex0040p // (c) 1995 IGT - International Game Technology +pex0042p // (c) 1995 IGT - International Game Technology pex0045p // (c) 1995 IGT - International Game Technology pex0046p // (c) 1995 IGT - International Game Technology pex0054p // (c) 1995 IGT - International Game Technology @@ -11327,6 +11340,10 @@ pex0725p // (c) 1995 IGT - International Game Technology pex0726p // (c) 1995 IGT - International Game Technology pex0727p // (c) 1995 IGT - International Game Technology pex0763p // (c) 1995 IGT - International Game Technology +pex0764p // (c) 1995 IGT - International Game Technology +pex2010p // (c) 1995 IGT - International Game Technology +pex2016p // (c) 1995 IGT - International Game Technology +pex2017p // (c) 1995 IGT - International Game Technology pex2018p // (c) 1995 IGT - International Game Technology pex2025p // (c) 1995 IGT - International Game Technology pex2026p // (c) 1995 IGT - International Game Technology @@ -11335,7 +11352,9 @@ pex2029p // (c) 1995 IGT - International Game Technology pex2031p // (c) 1995 IGT - International Game Technology pex2035p // (c) 1995 IGT - International Game Technology pex2036p // (c) 1995 IGT - International Game Technology +pex2037p // (c) 1995 IGT - International Game Technology pex2038p // (c) 1995 IGT - International Game Technology +pex2039p // (c) 1995 IGT - International Game Technology pex2040p // (c) 1995 IGT - International Game Technology pex2042p // (c) 1995 IGT - International Game Technology pex2043p // (c) 1995 IGT - International Game Technology @@ -11357,6 +11376,7 @@ pex2241p // (c) 1995 IGT - International Game Technology pex2244p // (c) 1995 IGT - International Game Technology pex2245p // (c) 1995 IGT - International Game Technology pex2245pa // (c) 1995 IGT - International Game Technology +pex2247p // (c) 1995 IGT - International Game Technology pex2250p // (c) 1995 IGT - International Game Technology pex2251p // (c) 1995 IGT - International Game Technology pex2272p // (c) 1995 IGT - International Game Technology @@ -11373,6 +11393,7 @@ pex2310p // (c) 1995 IGT - International Game Technology pex2314p // (c) 1995 IGT - International Game Technology pex2374p // (c) 1995 IGT - International Game Technology pex2377p // (c) 1995 IGT - International Game Technology +pex2386p // (c) 1995 IGT - International Game Technology pex2419p // (c) 1995 IGT - International Game Technology pex2420p // (c) 1995 IGT - International Game Technology pex2421p // (c) 1995 IGT - International Game Technology diff --git a/src/mame/mame.mak b/src/mame/mame.mak index 86663f84e7a..edad5da86bd 100644 --- a/src/mame/mame.mak +++ b/src/mame/mame.mak @@ -278,6 +278,7 @@ SOUNDS += MOS7360 #SOUNDS += VRC6 SOUNDS += SB0400 SOUNDS += AC97 +SOUNDS += ES1373 #------------------------------------------------- # specify available video cores @@ -346,6 +347,7 @@ VIDEOS += TMS9928A VIDEOS += V9938 #VIDEOS += VIC4567 VIDEOS += VOODOO +VIDEOS += VOODOO_PCI #------------------------------------------------- # specify available machine cores @@ -1263,7 +1265,7 @@ $(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 \ + $(DRIVERS)/iteagle.o $(MACHINE)/iteagle_fpga.o \ $(MAMEOBJ)/jaleco.a: \ $(DRIVERS)/aeroboto.o $(VIDEO)/aeroboto.o \ @@ -2675,15 +2677,21 @@ $(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)/roypok96.lh \ + $(LAYOUT)/skill98.lh \ + $(LAYOUT)/tonypok.lh \ + $(LAYOUT)/unkch.lh $(DRIVERS)/grchamp.o: $(LAYOUT)/grchamp.lh diff --git a/src/mame/video/cps1.c b/src/mame/video/cps1.c index c79703f03bf..f50066f26ed 100644 --- a/src/mame/video/cps1.c +++ b/src/mame/video/cps1.c @@ -43,7 +43,8 @@ Dynasty Wars (USA, B-Board 89624B-?) 89624B-? TK Tenchi wo Kurau (Japan) 88622B-3 TK22B LWIO 88622-C-2 CPS-B-02 DL-0411-10002 None Tenchi wo Kurau (Japan Resale Ver.) 91634B-2 TK163B BPRG1 IOB1 92631C-6 CPS-B-21 DL-0921-10014 C632 IOC1 -Willow (USA Old Ver.) 1989 89624B-3 WL24B LWIO 88622-C-2 CPS-B-03 DL-0411-10003 None +Willow (World) 1989 89624B-3 WL24B LWIO 88622-C-4 CPS-B-03 DL-0411-10003 None +Willow (USA Old Ver.) 89624B-3 WL24B LWIO 88622-C-2 CPS-B-03 DL-0411-10003 None Willow (USA) 89624B-3 WL24B LWIO 88622-C-2/4 CPS-B-03 DL-0411-10003 None Willow (Japan) 88622B-3 WL22B LWIO 88622-C-2 CPS-B-03 DL-0411-10003 None @@ -141,6 +142,8 @@ Street Fighter II': Champion Edition (Japan 920513) 91634B-2 S9 Street Fighter II': Champion Edition (Japan 920803) 91634B-2 S9263B BPRG1 IOB1 92631C-6 CPS-B-21 DL-0921-10014 C632 IOC1 Adventure Quiz Capcom World 2* (Japan 920611) 1992 89625B-1 Q522B LWIO 92641C-1 CPS-B-21 DL-0921-10014 IOC1 +Adventure Quiz Capcom World 2* (Japan 920611) 91634B-2 Q563B BPRG1 IOB1 92641C-1 CPS-B-21 DL-0921-10014 IOC1 +Adventure Quiz Capcom World 2 (Japan 920611) 90629B-3 Q529B IOB1 92641C-1 CPS-B-21 DL-0921-10014 IOC1 Varth: Operation Thunderstorm (World 920612) 1992 89624B-? VA24B IOB1 ? CPS-B-04 DL-0411-10005 Varth: Operation Thunderstorm (World 920714) 89624B-3 VA24B IOB1 88622-C-5 CPS-B-04 DL-0411-10005 None @@ -1399,7 +1402,8 @@ static const struct CPS1config cps1_config_table[]= {"dynwarj", CPS_B_02, mapper_TK22B }, {"dynwarjr", CPS_B_21_DEF, mapper_TK22B }, // wrong, this set uses TK163B, still not dumped {"willow", CPS_B_03, mapper_WL24B }, - {"willowo", CPS_B_03, mapper_WL24B }, + {"willowu", CPS_B_03, mapper_WL24B }, + {"willowuo", CPS_B_03, mapper_WL24B }, {"willowj", CPS_B_03, mapper_WL24B }, // wrong, this set uses WL22B, still not dumped {"ffight", CPS_B_04, mapper_S224B }, {"ffighta", CPS_B_04, mapper_S224B }, @@ -1531,7 +1535,8 @@ static const struct CPS1config cps1_config_table[]= {"varthu", CPS_B_04, mapper_VA63B }, /* CPSB test has been patched out (60=0008) register is also written to, possibly leftover from development */ {"varthj", CPS_B_21_BT5, mapper_VA22B }, /* CPSB test has been patched out (72=0001) register is also written to, possibly leftover from development */ {"cworld2j", CPS_B_21_BT6, mapper_Q522B, 0x36, 0, 0x34 }, /* (ports 36, 34 probably leftover input code from another game) */ - {"cworld2ja", CPS_B_21_DEF, mapper_Q522B }, // patched set, no battery, could be desuicided + {"cworld2ja", CPS_B_21_DEF, mapper_Q522B }, // patched set, no battery, could be desuicided // wrong, this set uses Q529B, still not dumped + {"cworld2jb", CPS_B_21_BT6, mapper_Q522B, 0x36, 0, 0x34 }, // wrong, this set uses Q563B, still not dumped {"wof", CPS_B_21_QS1, mapper_TK263B }, {"wofr1", CPS_B_21_DEF, mapper_TK263B }, // patched set coming from a desuicided board? {"wofa", CPS_B_21_DEF, mapper_TK263B }, // patched set coming from a desuicided board? diff --git a/src/mame/video/decmxc06.c b/src/mame/video/decmxc06.c index 3b908b6df80..61cc9d03d93 100644 --- a/src/mame/video/decmxc06.c +++ b/src/mame/video/decmxc06.c @@ -51,6 +51,7 @@ deco_mxc06_device::deco_mxc06_device(const machine_config &mconfig, const char * : device_t(mconfig, DECO_MXC06, "DECO MXC06 Sprite", tag, owner, clock, "deco_mxc06", __FILE__), device_video_interface(mconfig, *this), m_gfxregion(0), + m_ramsize(0x800), m_gfxdecode(*this), m_palette(*this) { @@ -73,7 +74,7 @@ void deco_mxc06_device::draw_sprites( bitmap_ind16 &bitmap, const rectangle &cli int offs; offs = 0; - while (offs < 0x800 / 2) + while (offs < m_ramsize / 2) { int sx, sy, code, color, w, h, flipx, flipy, incy, flash, mult, x, y; @@ -109,36 +110,44 @@ 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++) { // maybe, birdie try appears to specify the base code for each part.. code = spriteram[offs + 1] & 0x1fff; - code &= ~(h-1); + code &= ~(h - 1); if (flipy) incy = -1; else { - code += h-1; + code += h - 1; incy = 1; } for (y = 0; y < h; y++) { - if (spriteram[offs] & 0x8000) { int draw = 0; if (!flash || (m_screen->frame_number() & 1)) { - if (m_priority_type==0) // most cases + if (m_priority_type == 0) // most cases { if ((color & pri_mask) == pri_val) { draw = 1; } } - else if (m_priority_type==1) // vaportra + else if (m_priority_type == 1) // vaportra { if (pri_mask && (color >= pri_val)) continue; @@ -152,18 +161,20 @@ void deco_mxc06_device::draw_sprites( bitmap_ind16 &bitmap, const rectangle &cli if (draw) { - m_gfxdecode->gfx(m_gfxregion)->transpen(bitmap,cliprect, + m_gfxdecode->gfx(m_gfxregion)->transpen(bitmap, cliprect, code - y * incy, color & col_mask, - flipx,flipy, - sx + (mult * x),sy + (mult * y),0); + flipx, flipy, + sx + (mult * x), sy + (mult * y), 0); } } } offs += 4; - if (offs >= 0x800 / 2) - return; + if (offs >= m_ramsize / 2) + return; + + } } } @@ -175,7 +186,7 @@ void deco_mxc06_device::draw_sprites_bootleg( bitmap_ind16 &bitmap, const rectan int offs; offs = 0; - while (offs < 0x800 / 2) + while (offs < m_ramsize / 2) { int sx, sy, code, color, flipx, flipy; diff --git a/src/mame/video/decmxc06.h b/src/mame/video/decmxc06.h index e7d5013b03f..114ffd865d6 100644 --- a/src/mame/video/decmxc06.h +++ b/src/mame/video/decmxc06.h @@ -11,6 +11,12 @@ public: static void static_set_gfxdecode_tag(device_t &device, const char *tag); static void static_set_palette_tag(device_t &device, const char *tag); static void set_gfx_region(device_t &device, int region); + static void set_ram_size(device_t &device, int size) + { + deco_mxc06_device &dev = downcast(device); + dev.m_ramsize = size; + } + void set_gfxregion(int region) { m_gfxregion = region; }; void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect, UINT16* spriteram16, int pri_mask, int pri_val, int col_mask ); @@ -23,6 +29,7 @@ protected: UINT8 m_gfxregion; int m_priority_type; // just so we can support the existing drivers without converting everything to pdrawgfx just yet + int m_ramsize; private: required_device m_gfxdecode; @@ -36,3 +43,6 @@ extern const device_type DECO_MXC06; #define MCFG_DECO_MXC06_PALETTE(_palette_tag) \ deco_mxc06_device::static_set_palette_tag(*device, "^" _palette_tag); + +#define MCFG_DECO_MXC06_RAMSIZE(_size) \ + deco_mxc06_device::set_ram_size(*device, _size); diff --git a/src/mame/video/dynax.c b/src/mame/video/dynax.c index 38551f43def..86994063971 100644 --- a/src/mame/video/dynax.c +++ b/src/mame/video/dynax.c @@ -121,6 +121,15 @@ WRITE8_MEMBER(dynax_state::tenkai_blit_dest_w) dynax_blit_dest_w(space, 0, BITSWAP8(data, 7, 6, 5, 4, 0, 1, 2, 3)); } +/* +mjelctrn: 7 d e -> 1 - 4 8 +mjembase: b d e -> - 2 4 8 +*/ +WRITE8_MEMBER(dynax_state::mjembase_blit_dest_w) +{ + dynax_blit_dest_w(space, 0, BITSWAP8(data, 7, 6, 5, 4, 2, 3, 1, 0)); +} + /* Background Color */ WRITE8_MEMBER(dynax_state::dynax_blit_backpen_w) @@ -174,6 +183,11 @@ WRITE8_MEMBER(dynax_state::tenkai_blit_palette23_w) LOG(("P23=%02X ", data)); } +WRITE8_MEMBER(dynax_state::mjembase_blit_palette23_w) +{ + dynax_blit_palette23_w(space, offset, BITSWAP8(data, 3, 2, 1, 0, 7, 6, 5, 4), mem_mask); +} + /* Layer 6&7 Palettes (Low Bits) */ WRITE8_MEMBER(dynax_state::dynax_blit_palette67_w) @@ -200,7 +214,7 @@ WRITE8_MEMBER(dynax_state::dynax_blit2_palbank_w) } -/* Which half of the layers to write two (interleaved games only) */ +/* Which half of the layers to write to (interleaved games only) */ WRITE8_MEMBER(dynax_state::hanamai_layer_half_w) { m_hanamai_layer_half = (~data) & 1; @@ -366,7 +380,15 @@ void dynax_state::blitter_plot_pixel( int layer, int mask, int x, int y, int pen } } +/* + Flags: + 7654 ---- - + ---- 3--- Rotation = SWAPXY + FLIPY + ---- -2-- - + ---- --1- 0 = Ignore the pens specified in ROM, draw everything with the pen supplied as parameter + ---- ---0 Clear +*/ int dynax_state::blitter_drawgfx( int layer, int mask, const char *gfx, int src, int pen, int x, int y, int wrap, int flags ) { UINT8 cmd; @@ -688,6 +710,7 @@ WRITE8_MEMBER(dynax_state::tenkai_blitter_rev2_w) } +// two blitters/screens WRITE8_MEMBER(dynax_state::jantouki_blitter_rev2_w) { switch (offset) @@ -716,6 +739,44 @@ WRITE8_MEMBER(dynax_state::jantouki_blitter2_rev2_w) } } +// first register does not trigger a blit, it sets the destination +WRITE8_MEMBER(dynax_state::cdracula_blitter_rev2_w) +{ + switch (offset) + { + case 0: + LOG(("DD=%02X ", data)); + + if (data & 0xf0) + { + hanamai_layer_half_w(space, offset, 0, mem_mask); + dynax_blit_dest_w(space, offset, data >> 4, mem_mask); + } + if (data & 0x0f) + { + hanamai_layer_half_w(space, offset, 1, mem_mask); + dynax_blit_dest_w(space, offset, data & 0x0f, mem_mask); + } + break; + case 1: m_blit_x = data; break; + case 2: m_blit_y = data; break; + case 3: m_blit_src = (m_blit_src & 0xffff00) | (data << 0); break; + case 4: m_blit_src = (m_blit_src & 0xff00ff) | (data << 8); break; + case 5: m_blit_src = (m_blit_src & 0x00ffff) | (data << 16); break; + case 6: dynax_blit_scroll_w(space, 0, data); break; + } +} + +WRITE8_MEMBER(dynax_state::dynax_blit_flags_w) +{ + LOG(("FLG=%02X ", data)); + + int flags = (data & 0x08) ? 0x08 : 0x00; + flags |= (data & 0x10) ? 0x02 : 0x00; + flags |= (data & 0x80) ? 0x01 : 0x00; + + dynax_blitter_start(flags); +} /*************************************************************************** @@ -729,6 +790,7 @@ WRITE8_MEMBER(dynax_state::jantouki_blitter2_rev2_w) static const int priority_hnoridur[8] = { 0x0231, 0x2103, 0x3102, 0x2031, 0x3021, 0x1302, 0x2310, 0x1023 }; static const int priority_mcnpshnt[8] = { 0x3210, 0x2103, 0x3102, 0x2031, 0x3021, 0x1302, 0x2310, 0x1023 }; static const int priority_mjelctrn[8] = { 0x0231, 0x0321, 0x2031, 0x2301, 0x3021, 0x3201 ,0x0000, 0x0000 }; // this game doesn't use (hasn't?) layer 1 +static const int priority_mjembase[8] = { 0x0231, 0x2031, 0x0321, 0x3021, 0x2301, 0x3201 ,0x0000, 0x0000 }; // this game doesn't use (hasn't?) layer 1 void dynax_state::dynax_common_reset() @@ -940,6 +1002,14 @@ VIDEO_START_MEMBER(dynax_state,mjelctrn) m_update_irq_func = &dynax_state::mjelctrn_update_irq; } +VIDEO_START_MEMBER(dynax_state,mjembase) +{ + VIDEO_START_CALL_MEMBER(hnoridur); + + m_priority_table = priority_mjembase; + m_update_irq_func = &dynax_state::mjelctrn_update_irq; +} + VIDEO_START_MEMBER(dynax_state,neruton) { VIDEO_START_CALL_MEMBER(hnoridur); @@ -1152,6 +1222,17 @@ WRITE8_MEMBER(dynax_state::tenkai_priority_w) m_hanamai_priority = BITSWAP8(data, 3, 2, 1, 0, 4, 7, 5, 6); } +/* +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 +*/ +WRITE8_MEMBER(dynax_state::mjembase_priority_w) +{ + m_hanamai_priority = BITSWAP8(data, 6, 5, 4, 3, 2, 7, 1, 0); +} + + int dynax_state::debug_mask() { #ifdef MAME_DEBUG @@ -1368,3 +1449,24 @@ UINT32 dynax_state::screen_update_mjdialq2(screen_device &screen, bitmap_ind16 & if (BIT(layers_ctrl, 1)) mjdialq2_copylayer(bitmap, cliprect, 1); return 0; } + + +UINT32 dynax_state::screen_update_cdracula(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + int layers_ctrl = ~m_layer_enable; + + if (debug_viewer(bitmap,cliprect)) + return 0; + + layers_ctrl &= debug_mask(); + + bitmap.fill((m_blit_backpen & 0xff) + (m_blit_palbank & 1) * 256, cliprect); + + m_extra_scroll_y = -8; + + if (BIT(layers_ctrl, 3)) hanamai_copylayer(bitmap, cliprect, 3); + if (BIT(layers_ctrl, 1)) hanamai_copylayer(bitmap, cliprect, 1); + if (BIT(layers_ctrl, 2)) hanamai_copylayer(bitmap, cliprect, 2); + if (BIT(layers_ctrl, 0)) hanamai_copylayer(bitmap, cliprect, 0); + return 0; +} diff --git a/src/mame/video/realbrk.c b/src/mame/video/realbrk.c index 3c793ac1c6e..0e17ba65769 100644 --- a/src/mame/video/realbrk.c +++ b/src/mame/video/realbrk.c @@ -88,13 +88,13 @@ TILE_GET_INFO_MEMBER(realbrk_state::get_tile_info_1) TILE_FLIPYX( attr >> 14 )); } -WRITE16_MEMBER(realbrk_state::realbrk_vram_0_w) +WRITE16_MEMBER(realbrk_state::vram_0_w) { COMBINE_DATA(&m_vram_0[offset]); m_tilemap_0->mark_tile_dirty(offset/2); } -WRITE16_MEMBER(realbrk_state::realbrk_vram_1_w) +WRITE16_MEMBER(realbrk_state::vram_1_w) { COMBINE_DATA(&m_vram_1[offset]); m_tilemap_1->mark_tile_dirty(offset/2); @@ -123,7 +123,7 @@ TILE_GET_INFO_MEMBER(realbrk_state::get_tile_info_2) 0); } -WRITE16_MEMBER(realbrk_state::realbrk_vram_2_w) +WRITE16_MEMBER(realbrk_state::vram_2_w) { COMBINE_DATA(&m_vram_2[offset]); m_tilemap_2->mark_tile_dirty(offset); @@ -154,6 +154,8 @@ 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)); } /*************************************************************************** @@ -167,7 +169,7 @@ void realbrk_state::video_start() of a sprite to be drawn. 0x300 items of the list seem to be used. Each sprite is made of several 16x16 tiles (from 1 to 32x32) and - can be zoomed / shrinked in size. + can be zoomed / shrunk in size. There are two set of tiles: with 256 or 16 colors. @@ -203,7 +205,6 @@ void realbrk_state::video_start() void realbrk_state::draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect) { - UINT16 *spriteram16 = m_spriteram; int offs; int max_x = m_screen->width(); @@ -220,9 +221,9 @@ void realbrk_state::draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect) UINT16 *s; - if (spriteram16[offs] & 0x8000) continue; + if (m_spriteram[offs] & 0x8000) continue; - s = &spriteram16[(spriteram16[offs] & 0x3ff) * 16/2]; + s = &m_spriteram[(m_spriteram[offs] & 0x3ff) * 16/2]; sy = s[ 0 ]; sx = s[ 1 ]; @@ -365,7 +366,6 @@ void realbrk_state::draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect) /* layer : 0== bghighwidth(); @@ -380,9 +380,9 @@ void realbrk_state::dai2kaku_draw_sprites(bitmap_ind16 &bitmap,const rectangle & UINT16 *s; - if (spriteram16[offs] & 0x8000) continue; + if (m_spriteram[offs] & 0x8000) continue; - s = &spriteram16[(spriteram16[offs] & 0x3ff) * 16/2]; + s = &m_spriteram[(m_spriteram[offs] & 0x3ff) * 16/2]; sy = s[ 0 ]; sx = s[ 1 ]; @@ -467,7 +467,7 @@ void realbrk_state::dai2kaku_draw_sprites(bitmap_ind16 &bitmap,const rectangle & ***************************************************************************/ -WRITE16_MEMBER(realbrk_state::realbrk_vregs_w) +WRITE16_MEMBER(realbrk_state::vregs_w) { UINT16 old_data = m_vregs[offset]; UINT16 new_data = COMBINE_DATA(&m_vregs[offset]); @@ -478,7 +478,7 @@ WRITE16_MEMBER(realbrk_state::realbrk_vregs_w) } } -UINT32 realbrk_state::screen_update_realbrk(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +UINT32 realbrk_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int layers_ctrl = -1; diff --git a/src/mame/video/rltennis.c b/src/mame/video/rltennis.c index 6ce70857c74..993e719d08a 100644 --- a/src/mame/video/rltennis.c +++ b/src/mame/video/rltennis.c @@ -110,7 +110,7 @@ enum #define SRC_SHIFT 8 -WRITE16_MEMBER(rltennis_state::rlt_blitter_w) +WRITE16_MEMBER(rltennis_state::blitter_w) { int old_data=m_blitter[offset]; COMBINE_DATA(&m_blitter[offset]); @@ -224,9 +224,11 @@ 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)); } -UINT32 rltennis_state::screen_update_rltennis(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +UINT32 rltennis_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { copybitmap(bitmap, *m_tmp_bitmap[BITMAP_BG], 0, 0, 0, 0, cliprect); copybitmap_trans(bitmap, *m_tmp_bitmap[BITMAP_FG_DISPLAY], 0, 0, 0, 0, cliprect, 0); diff --git a/src/mame/video/seta.c b/src/mame/video/seta.c index 74cc22b321a..ca5cfd8ea54 100644 --- a/src/mame/video/seta.c +++ b/src/mame/video/seta.c @@ -523,7 +523,7 @@ VIDEO_START_MEMBER(seta_state,twineagl_1_layer) m_tilemap_1->set_transparent_pen(0); } -int setac_gfxbank_callback( running_machine &machine, UINT16 code, UINT8 color ) +SETA001_SPRITE_GFXBANK_CB_MEMBER(seta_state::setac_gfxbank_callback) { int bank = (color & 0x06) >> 1; code = (code & 0x3fff) + (bank * 0x4000); @@ -549,10 +549,6 @@ VIDEO_START_MEMBER(seta_state,seta_no_layers) // position kludges m_seta001->set_fg_xoffsets(m_global_offsets->sprite_offs[1], m_global_offsets->sprite_offs[0]); m_seta001->set_fg_yoffsets( -0x0a, 0x0e ); - - // banking - m_seta001->set_gfxbank_callback( setac_gfxbank_callback ); - } diff --git a/src/mame/video/seta001.c b/src/mame/video/seta001.c index ed5d689ddd5..796efafbd4a 100644 --- a/src/mame/video/seta001.c +++ b/src/mame/video/seta001.c @@ -83,9 +83,9 @@ void seta001_device::device_start() m_colorbase = 0; m_spritelimit = 0x1ff; - m_bankcallback = NULL; - m_bgflag = 0x00; + + m_gfxbank_cb.bind_relative_to(*owner()); save_item(NAME(m_bgflag)); save_item(NAME(m_spritectrl)); @@ -237,7 +237,7 @@ void seta001_device::draw_background( bitmap_ind16 &bitmap, const rectangle &cli int max_y = 0xf0; // HACKS - // used in conjuntion with setac_type + // used in conjunction with setac_type int col0; /* Kludge, needed for krzybowl and kiwame */ switch (ctrl & 0x0f) { @@ -372,7 +372,7 @@ void seta001_device::draw_foreground( screen_device &screen, bitmap_ind16 &bitma flipx = ctrl_pointer[i] & 0x80; flipy = ctrl_pointer[i] & 0x40; - if (m_bankcallback) code = m_bankcallback(machine(), code, color_pointer[i]); + if (!m_gfxbank_cb.isnull()) code = m_gfxbank_cb(code, color_pointer[i]); color %= total_color_codes; diff --git a/src/mame/video/seta001.h b/src/mame/video/seta001.h index f5acc6c94d5..bd5de9d4c80 100644 --- a/src/mame/video/seta001.h +++ b/src/mame/video/seta001.h @@ -1,5 +1,10 @@ -typedef int (*seta001_gfxbank_callback_func)(running_machine &machine, UINT16 code, UINT8 color); +typedef device_delegate gfxbank_cb_delegate; + +#define SETA001_SPRITE_GFXBANK_CB_MEMBER(_name) int _name(UINT16 code, UINT8 color) + +#define MCFG_SETA001_SPRITE_GFXBANK_CB(_class, _method) \ + seta001_device::set_gfxbank_callback(*device, gfxbank_cb_delegate(&_class::_method, #_class "::" #_method, downcast<_class *>(owner))); class seta001_device : public device_t { @@ -9,6 +14,7 @@ public: // static configuration static void static_set_gfxdecode_tag(device_t &device, const char *tag); static void static_set_palette_tag(device_t &device, const char *tag); + static void set_gfxbank_callback(device_t &device, gfxbank_cb_delegate callback) { downcast(device).m_gfxbank_cb = callback; } DECLARE_WRITE8_MEMBER( spritebgflag_w8 ); @@ -46,8 +52,6 @@ public: int is_flipped() { return ((m_spritectrl[ 0 ] & 0x40) >> 6); }; - void set_gfxbank_callback(seta001_gfxbank_callback_func callback) { m_bankcallback = callback; }; - protected: virtual void device_start(); virtual void device_reset(); @@ -59,7 +63,7 @@ private: required_device m_gfxdecode; required_device m_palette; - seta001_gfxbank_callback_func m_bankcallback; + gfxbank_cb_delegate m_gfxbank_cb; // configuration int m_fg_flipxoffs, m_fg_noflipxoffs; diff --git a/src/mame/video/seta2.c b/src/mame/video/seta2.c index 229b01d81df..333bf9daa0d 100644 --- a/src/mame/video/seta2.c +++ b/src/mame/video/seta2.c @@ -108,7 +108,7 @@ ***************************************************************************/ -WRITE16_MEMBER(seta2_state::seta2_vregs_w) +WRITE16_MEMBER(seta2_state::vregs_w) { /* 02/04 = horizontal display start/end mj4simai = 0065/01E5 (0180 visible area) @@ -441,7 +441,7 @@ void seta2_state::draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect) ***************************************************************************/ -VIDEO_START_MEMBER(seta2_state,seta2) +void seta2_state::video_start() { m_gfxdecode->gfx(2)->set_granularity(16); m_gfxdecode->gfx(3)->set_granularity(16); @@ -452,26 +452,23 @@ VIDEO_START_MEMBER(seta2_state,seta2) m_xoffset = 0; m_yoffset = 0; - - //TODO:FIX - //save_pointer(NAME(m_vregs), 0x40); } -VIDEO_START_MEMBER(seta2_state,seta2_xoffset) +VIDEO_START_MEMBER(seta2_state,xoffset) { - VIDEO_START_CALL_MEMBER(seta2); - + video_start(); + m_xoffset = 0x200; } -VIDEO_START_MEMBER(seta2_state,seta2_yoffset) +VIDEO_START_MEMBER(seta2_state,yoffset) { - VIDEO_START_CALL_MEMBER(seta2); - + video_start(); + m_yoffset = 0x10; } -UINT32 seta2_state::screen_update_seta2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +UINT32 seta2_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { // Black or pen 0? bitmap.fill(m_palette->pen(0), cliprect); @@ -482,7 +479,7 @@ UINT32 seta2_state::screen_update_seta2(screen_device &screen, bitmap_ind16 &bit return 0; } -void seta2_state::screen_eof_seta2(screen_device &screen, bool state) +void seta2_state::screen_eof(screen_device &screen, bool state) { // rising edge if (state) diff --git a/src/mame/video/srmp2.c b/src/mame/video/srmp2.c index bd059fea2a0..4c3fd389786 100644 --- a/src/mame/video/srmp2.c +++ b/src/mame/video/srmp2.c @@ -37,14 +37,12 @@ PALETTE_INIT_MEMBER(srmp2_state,srmp3) } } -int srmp3_gfxbank_callback( running_machine &machine, UINT16 code, UINT8 color ) +SETA001_SPRITE_GFXBANK_CB_MEMBER(srmp2_state::srmp3_gfxbank_callback) { - srmp2_state *state = machine.driver_data(); - if (code & 0x2000) { code = (code & 0x1fff); - code += ((state->m_gfx_bank + 1) * 0x2000); + code += ((m_gfx_bank + 1) * 0x2000); } return code; @@ -77,8 +75,6 @@ UINT32 srmp2_state::screen_update_srmp3(screen_device &screen, bitmap_ind16 &bit m_seta001->set_bg_xoffsets( -0x01, 0x10 ); m_seta001->set_bg_yoffsets( -0x06, 0x06 ); - m_seta001->set_gfxbank_callback( srmp3_gfxbank_callback ); - m_seta001->draw_sprites(screen,bitmap,cliprect,0x1000, 1); return 0; } @@ -93,8 +89,6 @@ UINT32 srmp2_state::screen_update_mjyuugi(screen_device &screen, bitmap_ind16 &b m_seta001->set_spritelimit( 0x1ff-6 ); - m_seta001->set_gfxbank_callback( srmp3_gfxbank_callback ); - m_seta001->draw_sprites(screen,bitmap,cliprect,0x1000, 1); return 0; } diff --git a/src/mame/video/ssrj.c b/src/mame/video/ssrj.c index 91443bc80c2..0a227f6ecd5 100644 --- a/src/mame/video/ssrj.c +++ b/src/mame/video/ssrj.c @@ -3,7 +3,7 @@ /* tilemap 1 */ -WRITE8_MEMBER(ssrj_state::ssrj_vram1_w) +WRITE8_MEMBER(ssrj_state::vram1_w) { m_vram1[offset] = data; m_tilemap1->mark_tile_dirty(offset>>1); @@ -21,7 +21,7 @@ TILE_GET_INFO_MEMBER(ssrj_state::get_tile_info1) /* tilemap 2 */ -WRITE8_MEMBER(ssrj_state::ssrj_vram2_w) +WRITE8_MEMBER(ssrj_state::vram2_w) { m_vram2[offset] = data; m_tilemap2->mark_tile_dirty(offset>>1); @@ -39,7 +39,7 @@ TILE_GET_INFO_MEMBER(ssrj_state::get_tile_info2) /* tilemap 4 */ -WRITE8_MEMBER(ssrj_state::ssrj_vram4_w) +WRITE8_MEMBER(ssrj_state::vram4_w) { m_vram4[offset] = data; m_tilemap4->mark_tile_dirty(offset>>1); @@ -60,7 +60,7 @@ TILE_GET_INFO_MEMBER(ssrj_state::get_tile_info4) TODO: This table is nowhere near as accurate. If you bother, here's how colors should be: -"START" sign is red with dark blue background. -Sidewalk is yellow-ish. --first opponents have swapped colors (blue/yellow ?nstead of yellow/blue) +-first opponents have swapped colors (blue/yellow instead of yellow/blue) -after the first stage, houses have red/white colors. */ @@ -270,7 +270,7 @@ PALETTE_INIT_MEMBER(ssrj_state, ssrj) palette.set_pen_color(i*8+j, fakecols[i][j][0], fakecols[i][j][1], fakecols[i][j][2]); } -UINT32 ssrj_state::screen_update_ssrj(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +UINT32 ssrj_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_tilemap1->set_scrollx(0, 0xff-m_scrollram[2] ); m_tilemap1->set_scrolly(0, m_scrollram[0] ); @@ -282,7 +282,7 @@ UINT32 ssrj_state::screen_update_ssrj(screen_device &screen, bitmap_ind16 &bitma return 0; } -void ssrj_state::screen_eof_ssrj(screen_device &screen, bool state) +void ssrj_state::screen_eof(screen_device &screen, bool state) { // rising edge if (state) diff --git a/src/mame/video/subs.c b/src/mame/video/subs.c index 52a3462a167..eca6b79a098 100644 --- a/src/mame/video/subs.c +++ b/src/mame/video/subs.c @@ -8,7 +8,7 @@ #include "includes/subs.h" #include "sound/discrete.h" -WRITE8_MEMBER(subs_state::subs_invert1_w) +WRITE8_MEMBER(subs_state::invert1_w) { if ((offset & 0x01) == 1) { @@ -22,7 +22,7 @@ WRITE8_MEMBER(subs_state::subs_invert1_w) } } -WRITE8_MEMBER(subs_state::subs_invert2_w) +WRITE8_MEMBER(subs_state::invert2_w) { if ((offset & 0x01) == 1) { @@ -37,15 +37,11 @@ WRITE8_MEMBER(subs_state::subs_invert2_w) } -UINT32 subs_state::screen_update_subs_left(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +UINT32 subs_state::screen_update_left(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - UINT8 *videoram = m_videoram; - UINT8 *spriteram = m_spriteram; - int offs; - /* for every character in the Video RAM, check if it has been modified */ /* since last time and update it accordingly. */ - for (offs = 0x400 - 1; offs >= 0; offs--) + for (int offs = 0x400 - 1; offs >= 0; offs--) { int charcode; int sx,sy; @@ -55,7 +51,7 @@ UINT32 subs_state::screen_update_subs_left(screen_device &screen, bitmap_ind16 & left_sonar_window = 0; right_sonar_window = 0; - charcode = videoram[offs]; + charcode = m_videoram[offs]; /* Which monitor is this for? */ // right_enable = charcode & 0x40; @@ -84,18 +80,18 @@ UINT32 subs_state::screen_update_subs_left(screen_device &screen, bitmap_ind16 & } /* draw the motion objects */ - for (offs = 0; offs < 4; offs++) + for (int offs = 0; offs < 4; offs++) { int sx,sy; int charcode; int prom_set; int sub_enable; - sx = spriteram[0x00 + (offs * 2)] - 16; - sy = spriteram[0x08 + (offs * 2)] - 16; - charcode = spriteram[0x09 + (offs * 2)]; + sx = m_spriteram[0x00 + (offs * 2)] - 16; + sy = m_spriteram[0x08 + (offs * 2)] - 16; + charcode = m_spriteram[0x09 + (offs * 2)]; if (offs < 2) - sub_enable = spriteram[0x01 + (offs * 2)] & 0x80; + sub_enable = m_spriteram[0x01 + (offs * 2)] & 0x80; else sub_enable = 1; @@ -112,20 +108,16 @@ UINT32 subs_state::screen_update_subs_left(screen_device &screen, bitmap_ind16 & /* Update sound */ address_space &space = machine().driver_data()->generic_space(); - m_discrete->write(space, SUBS_LAUNCH_DATA, spriteram[5] & 0x0f); // Launch data - m_discrete->write(space, SUBS_CRASH_DATA, spriteram[5] >> 4); // Crash/explode data + m_discrete->write(space, SUBS_LAUNCH_DATA, m_spriteram[5] & 0x0f); // Launch data + m_discrete->write(space, SUBS_CRASH_DATA, m_spriteram[5] >> 4); // Crash/explode data return 0; } -UINT32 subs_state::screen_update_subs_right(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +UINT32 subs_state::screen_update_right(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - UINT8 *videoram = m_videoram; - UINT8 *spriteram = m_spriteram; - int offs; - /* for every character in the Video RAM, check if it has been modified */ /* since last time and update it accordingly. */ - for (offs = 0x400 - 1; offs >= 0; offs--) + for (int offs = 0x400 - 1; offs >= 0; offs--) { int charcode; int sx,sy; @@ -135,7 +127,7 @@ UINT32 subs_state::screen_update_subs_right(screen_device &screen, bitmap_ind16 left_sonar_window = 0; right_sonar_window = 0; - charcode = videoram[offs]; + charcode = m_videoram[offs]; /* Which monitor is this for? */ right_enable = charcode & 0x40; @@ -164,18 +156,18 @@ UINT32 subs_state::screen_update_subs_right(screen_device &screen, bitmap_ind16 } /* draw the motion objects */ - for (offs = 0; offs < 4; offs++) + for (int offs = 0; offs < 4; offs++) { int sx,sy; int charcode; int prom_set; int sub_enable; - sx = spriteram[0x00 + (offs * 2)] - 16; - sy = spriteram[0x08 + (offs * 2)] - 16; - charcode = spriteram[0x09 + (offs * 2)]; + sx = m_spriteram[0x00 + (offs * 2)] - 16; + sy = m_spriteram[0x08 + (offs * 2)] - 16; + charcode = m_spriteram[0x09 + (offs * 2)]; if (offs < 2) - sub_enable = spriteram[0x01 + (offs * 2)] & 0x80; + sub_enable = m_spriteram[0x01 + (offs * 2)] & 0x80; else sub_enable = 1; diff --git a/src/mame/video/suna16.c b/src/mame/video/suna16.c index b9d36b13a94..e58ce304103 100644 --- a/src/mame/video/suna16.c +++ b/src/mame/video/suna16.c @@ -60,7 +60,7 @@ #include "emu.h" #include "includes/suna16.h" -WRITE16_MEMBER(suna16_state::suna16_flipscreen_w) +WRITE16_MEMBER(suna16_state::flipscreen_w) { if (ACCESSING_BITS_0_7) { @@ -92,14 +92,16 @@ 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)); } -READ16_MEMBER(suna16_state::suna16_paletteram16_r) +READ16_MEMBER(suna16_state::paletteram_r) { return m_paletteram[offset + m_color_bank * 256]; } -WRITE16_MEMBER(suna16_state::suna16_paletteram16_w) +WRITE16_MEMBER(suna16_state::paletteram_w) { offset += m_color_bank * 256; data = COMBINE_DATA(&m_paletteram[offset]); @@ -117,11 +119,10 @@ WRITE16_MEMBER(suna16_state::suna16_paletteram16_w) void suna16_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, UINT16 *sprites, int gfx) { - int offs; int max_x = m_screen->width() - 8; int max_y = m_screen->height() - 8; - for ( offs = 0xfc00/2; offs < 0x10000/2 ; offs += 4/2 ) + for ( int offs = 0xfc00/2; offs < 0x10000/2 ; offs += 4/2 ) { int srcpg, srcx,srcy, dimx,dimy; int tile_x, tile_xinc, tile_xstart; @@ -213,7 +214,7 @@ void suna16_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, ***************************************************************************/ -UINT32 suna16_state::screen_update_suna16(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +UINT32 suna16_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { /* Suna Quiz indicates the background is the last pen */ bitmap.fill(0xff, cliprect); diff --git a/src/mame/video/suprloco.c b/src/mame/video/suprloco.c index 815a45b25a7..6021a01a2bc 100644 --- a/src/mame/video/suprloco.c +++ b/src/mame/video/suprloco.c @@ -1,6 +1,6 @@ /*************************************************************************** - video.c + suprloco.c Functions to emulate the video hardware of the machine. @@ -98,6 +98,8 @@ 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)); } @@ -108,13 +110,13 @@ void suprloco_state::video_start() ***************************************************************************/ -WRITE8_MEMBER(suprloco_state::suprloco_videoram_w) +WRITE8_MEMBER(suprloco_state::videoram_w) { m_videoram[offset] = data; m_bg_tilemap->mark_tile_dirty(offset/2); } -WRITE8_MEMBER(suprloco_state::suprloco_scrollram_w) +WRITE8_MEMBER(suprloco_state::scrollram_w) { int adj = flip_screen() ? -8 : 8; @@ -122,7 +124,7 @@ WRITE8_MEMBER(suprloco_state::suprloco_scrollram_w) m_bg_tilemap->set_scrollx(offset, data - adj); } -WRITE8_MEMBER(suprloco_state::suprloco_control_w) +WRITE8_MEMBER(suprloco_state::control_w) { /* There is probably a palette select in here */ @@ -148,7 +150,7 @@ WRITE8_MEMBER(suprloco_state::suprloco_control_w) } -READ8_MEMBER(suprloco_state::suprloco_control_r) +READ8_MEMBER(suprloco_state::control_r) { return m_control; } @@ -256,7 +258,7 @@ void suprloco_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprec } } -UINT32 suprloco_state::screen_update_suprloco(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +UINT32 suprloco_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); diff --git a/src/mame/video/suprridr.c b/src/mame/video/suprridr.c index a3e981b6c24..adaa1f4673f 100644 --- a/src/mame/video/suprridr.c +++ b/src/mame/video/suprridr.c @@ -44,6 +44,9 @@ 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)); } @@ -91,39 +94,39 @@ PALETTE_INIT_MEMBER(suprridr_state, suprridr) * *************************************/ -WRITE8_MEMBER(suprridr_state::suprridr_flipx_w) +WRITE8_MEMBER(suprridr_state::flipx_w) { m_flipx = data & 1; machine().tilemap().set_flip_all((m_flipx ? TILEMAP_FLIPX : 0) | (m_flipy ? TILEMAP_FLIPY : 0)); } -WRITE8_MEMBER(suprridr_state::suprridr_flipy_w) +WRITE8_MEMBER(suprridr_state::flipy_w) { m_flipy = data & 1; machine().tilemap().set_flip_all((m_flipx ? TILEMAP_FLIPX : 0) | (m_flipy ? TILEMAP_FLIPY : 0)); } -WRITE8_MEMBER(suprridr_state::suprridr_fgdisable_w) +WRITE8_MEMBER(suprridr_state::fgdisable_w) { m_fg_tilemap->enable(~data & 1); } -WRITE8_MEMBER(suprridr_state::suprridr_fgscrolly_w) +WRITE8_MEMBER(suprridr_state::fgscrolly_w) { m_fg_tilemap->set_scrolly(0, data); } -WRITE8_MEMBER(suprridr_state::suprridr_bgscrolly_w) +WRITE8_MEMBER(suprridr_state::bgscrolly_w) { m_bg_tilemap->set_scrolly(0, data); } -int suprridr_state::suprridr_is_screen_flipped() +int suprridr_state::is_screen_flipped() { return m_flipx; /* or is it flipy? */ } @@ -136,7 +139,7 @@ int suprridr_state::suprridr_is_screen_flipped() * *************************************/ -WRITE8_MEMBER(suprridr_state::suprridr_bgram_w) +WRITE8_MEMBER(suprridr_state::bgram_w) { m_bgram[offset] = data; m_bg_tilemap->mark_tile_dirty(offset); @@ -144,7 +147,7 @@ WRITE8_MEMBER(suprridr_state::suprridr_bgram_w) } -WRITE8_MEMBER(suprridr_state::suprridr_fgram_w) +WRITE8_MEMBER(suprridr_state::fgram_w) { m_fgram[offset] = data; m_fg_tilemap->mark_tile_dirty(offset); @@ -158,11 +161,9 @@ WRITE8_MEMBER(suprridr_state::suprridr_fgram_w) * *************************************/ -UINT32 suprridr_state::screen_update_suprridr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +UINT32 suprridr_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - UINT8 *spriteram = m_spriteram; rectangle subclip; - int i; const rectangle &visarea = screen.visible_area(); /* render left 4 columns with no scroll */ @@ -188,14 +189,14 @@ UINT32 suprridr_state::screen_update_suprridr(screen_device &screen, bitmap_ind1 m_fg_tilemap->draw(screen, bitmap, cliprect, 0, 0); /* draw the sprites */ - for (i = 0; i < 48; i++) + for (int i = 0; i < 48; i++) { - int code = (spriteram[i*4+1] & 0x3f) | ((spriteram[i*4+2] >> 1) & 0x40); - int color = spriteram[i*4+2] & 0x7f; - int fx = spriteram[i*4+1] & 0x40; - int fy = spriteram[i*4+1] & 0x80; - int x = spriteram[i*4+3]; - int y = 240 - spriteram[i*4+0]; + int code = (m_spriteram[i*4+1] & 0x3f) | ((m_spriteram[i*4+2] >> 1) & 0x40); + int color = m_spriteram[i*4+2] & 0x7f; + int fx = m_spriteram[i*4+1] & 0x40; + int fy = m_spriteram[i*4+1] & 0x80; + int x = m_spriteram[i*4+3]; + int y = 240 - m_spriteram[i*4+0]; if (m_flipx) { diff --git a/src/mame/video/thedeep.c b/src/mame/video/thedeep.c index f810cb7da58..2c081a9a05b 100644 --- a/src/mame/video/thedeep.c +++ b/src/mame/video/thedeep.c @@ -107,95 +107,6 @@ void thedeep_state::video_start() m_tilemap_0->set_scroll_cols(0x20); // column scroll for the background } -/*************************************************************************** - - Sprites Drawing - -Offset: Bits: Value: - - 0 Y (low bits, 0 is bottom) - - 1 7------- Enable - -6------ Flip Y - --5----- Flip X ? (unused) - ---43--- Height: 1,2,4 or 8 tiles - -----21- Width: 1,2,4 or 8 tiles* - -------0 Y (High bit) - - 2 Code (low bits) - - 3 Code (high bits) - - 4 X (low bits, 0 is right) - - 5 7654---- Color - ----321- - -------0 X (High bit) - - 6 Unused - - 7 Unused - -* a sprite of width N uses N consecutive sprites. The first one specifies - all the data, the following ones only the tile code and color. - -***************************************************************************/ - -void thedeep_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect) -{ - UINT8 *s = m_spriteram, *end = s + m_spriteram.bytes(); - - while (s < end) - { - int code,color,sx,sy,flipx,flipy,nx,ny,x,y,attr; - - attr = s[1]; - if (!(attr & 0x80)) { s+=8; continue; } - - sx = s[4]; - sy = s[0]; - - color = s[5]; - - flipx = attr & 0x00; // ? - flipy = attr & 0x40; - - nx = 1 << ((attr & 0x06) >> 1); - ny = 1 << ((attr & 0x18) >> 3); - - if (color & 1) sx -= 256; - if (attr & 1) sy -= 256; - - if (flip_screen()) - { - flipx = !flipx; - flipy = !flipy; - sy = sy - 8; - } - else - { - sx = 240 - sx; - sy = 240 - sy - ny * 16 + 16; - } - - for (x = 0; (x < nx) && (s < end); x++,s+=8) - { - code = s[2] + (s[3] << 8); - color = s[5] >> 4; - - for (y = 0; y < ny; y++) - { - m_gfxdecode->gfx(0)->transpen(bitmap,cliprect, - code + (flipy ? (ny - y - 1) : y), - color, - flipx,flipy, - sx + x * (flipx ? 16 : -16), sy + y * 16,0 ); - } - } - } -} - - /*************************************************************************** Screen Drawing @@ -219,7 +130,8 @@ UINT32 thedeep_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, bitmap.fill(m_palette->black_pen(), cliprect); m_tilemap_0->draw(screen, bitmap, cliprect, 0,0); - draw_sprites(bitmap,cliprect); + m_spritegen->draw_sprites(bitmap, cliprect, reinterpret_cast(m_spriteram.target()), 0x00, 0x00, 0x0f); m_tilemap_1->draw(screen, bitmap, cliprect, 0,0); return 0; } + diff --git a/src/mess/audio/gamate.c b/src/mess/audio/gamate.c index 369dac9df57..c49aeb72680 100644 --- a/src/mess/audio/gamate.c +++ b/src/mess/audio/gamate.c @@ -26,11 +26,10 @@ const int EnvelopeVolumes[]={ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, //------------------------------------------------- gamate_sound_device::gamate_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : device_t(mconfig, GAMATE_SND, "Gamate Audio Custom", tag, owner, clock, "gamate_sound", __FILE__), - device_sound_interface(mconfig, *this), - m_mixer_channel(NULL) -{ -} + : device_t(mconfig, GAMATE_SND, "Gamate Audio Custom", tag, owner, clock, "gamate_sound", __FILE__) + , device_sound_interface(mconfig, *this) + , m_mixer_channel(NULL) + {} //------------------------------------------------- // device_start - device-specific startup @@ -61,36 +60,39 @@ void gamate_sound_device::sound_stream_update(sound_stream &stream, stream_sampl for (i = 0; i < samples; i++, left++, right++) { noise.pos += noise.step; - while (noise.pos >= 1.0) { - // guess (white noise register taken from supervision) - noise.level = noise.state & 0x40 ? 1 : 0; - bool b1 = (noise.state & 0x40) != 0, b2 = (noise.state & 0x20) != 0; - noise.state=(noise.state<<1)+(b1!=b2?1:0); - noise.pos -= 1; + while (noise.pos >= 1.0) + { + // guess (white noise register taken from supervision) + noise.level = noise.state & 0x40 ? 1 : 0; + bool b1 = (noise.state & 0x40) != 0, b2 = (noise.state & 0x20) != 0; + noise.state=(noise.state<<1)+(b1!=b2?1:0); + noise.pos -= 1; } envelope.pos += envelope.step; while (envelope.pos >= 1.0) { - envelope.pos -= 1; - envelope.index++; - switch (envelope.control) { - case 0: case 1: case 2: case 3: - case 4: case 5: case 6: case 7: - case 8: case 9: case 0xb: - case 0xd: case 0xf: - if (envelope.index>=ARRAY_LENGTH(EnvelopeVolumes)/2) { - envelope.index=0; - envelope.first=false; - } - break; - default: - if (envelope.index>=ARRAY_LENGTH(EnvelopeVolumes)) { - envelope.index=0; - envelope.first=false; - } - break; - } - + envelope.pos -= 1; + envelope.index++; + switch (envelope.control) + { + case 0: case 1: case 2: case 3: + case 4: case 5: case 6: case 7: + case 8: case 9: case 0xb: + case 0xd: case 0xf: + if (envelope.index>=ARRAY_LENGTH(EnvelopeVolumes)/2) + { + envelope.index=0; + envelope.first=false; + } + break; + default: + if (envelope.index>=ARRAY_LENGTH(EnvelopeVolumes)) + { + envelope.index=0; + envelope.first=false; + } + break; + } } *left = 0; @@ -99,51 +101,67 @@ void gamate_sound_device::sound_stream_update(sound_stream &stream, stream_sampl { if (channel->size != 0) { - channel->level= channel->pos <= channel->size / 2; + channel->level= channel->pos <= channel->size / 2; bool l= channel->full_cycle? true: channel->level; - if (!channel->tone) l= l && noise.level; + if (!channel->tone) + l= l && noise.level; int volume=0; - if (l) { - if (channel->envelope_on) { - switch (envelope.control) { - case 0: case 1: case 2: case 3: - case 0x9: // one time falling, low - if (envelope.first && channel->level) volume=0xf-EnvelopeVolumes[envelope.index]; - break; - case 4: case 5: case 6: case 7: - case 0xf: // one time rising, low - if (envelope.first && channel->level) volume=EnvelopeVolumes[envelope.index]; - break; - case 8: // falling - if (channel->level) volume=0xf-EnvelopeVolumes[envelope.index]; - break; - case 0xa: // rising, falling - if (channel->level) volume=0xf-EnvelopeVolumes[envelope.index]; // cube up - break; - case 0xb: // one time falling, high - if (channel->level) volume=envelope.first? 0xf-EnvelopeVolumes[envelope.index]: 0xf; - break; - case 0xc: // rising, low - if (channel->level) volume=envelope.indexlevel) volume=envelope.first? EnvelopeVolumes[envelope.index]: 0xf; - break; - case 0xe: // falling, rising - if (channel->level) volume=0xf-EnvelopeVolumes[envelope.index]; - break; - } - } else { - volume=channel->volume; - } + if (l) + { + if (channel->envelope_on) + { + switch (envelope.control) + { + case 0: case 1: case 2: case 3: + case 0x9: // one time falling, low + if (envelope.first && channel->level) + volume=0xf-EnvelopeVolumes[envelope.index]; + break; + case 4: case 5: case 6: case 7: + case 0xf: // one time rising, low + if (envelope.first && channel->level) + volume=EnvelopeVolumes[envelope.index]; + break; + case 8: // falling + if (channel->level) + volume=0xf-EnvelopeVolumes[envelope.index]; + break; + case 0xa: // rising, falling + if (channel->level) + volume=0xf-EnvelopeVolumes[envelope.index]; // cube up + break; + case 0xb: // one time falling, high + if (channel->level) + volume=envelope.first ? 0xf-EnvelopeVolumes[envelope.index] : 0xf; + break; + case 0xc: // rising, low + if (channel->level) + volume=envelope.indexlevel) + volume=envelope.first ? EnvelopeVolumes[envelope.index] : 0xf; + break; + case 0xe: // falling, rising + if (channel->level) + volume=0xf-EnvelopeVolumes[envelope.index]; + break; + } + } + else + { + volume=channel->volume; + } } if (j == Right) - *right += Value2Volume(volume); - else if (j==Left) - *left += Value2Volume(volume); - else { - *right += Value2Volume(volume); - *left += Value2Volume(volume); + *right += Value2Volume(volume); + else + if (j==Left) + *left += Value2Volume(volume); + else + { + *right += Value2Volume(volume); + *left += Value2Volume(volume); } channel->pos++; if (channel->pos >= channel->size) @@ -169,7 +187,7 @@ WRITE8_MEMBER( gamate_sound_device::device_w ) case 3: case 4: case 5: - chan=offset/2; + chan=offset/2; size = reg[chan*2] | ((reg[chan*2+1] & 0xf) << 8); if (size) { @@ -182,40 +200,42 @@ WRITE8_MEMBER( gamate_sound_device::device_w ) m_channels[chan].pos = 0; break; case 6: - size=data&0x1f; - if (size==0) size=1; - noise.step= machine().device("maincpu")->unscaled_clock() / (1.0*ClockDelay*machine().sample_rate()*size); - break; + size=data&0x1f; + if (size==0) + size=1; + noise.step= machine().device("maincpu")->unscaled_clock() / (1.0*ClockDelay*machine().sample_rate()*size); + break; case 7: - m_channels[Right].full_cycle=data&1; - m_channels[Right].tone=data&8; - m_channels[Left].full_cycle=data&2; - m_channels[Left].tone=data&0x10; - m_channels[Both].full_cycle=data&4; - m_channels[Both].tone=data&0x20; - noise.state=1; - noise.pos=0.0; - noise.level=false; - break; + m_channels[Right].full_cycle=data&1; + m_channels[Right].tone=data&8; + m_channels[Left].full_cycle=data&2; + m_channels[Left].tone=data&0x10; + m_channels[Both].full_cycle=data&4; + m_channels[Both].tone=data&0x20; + noise.state=1; + noise.pos=0.0; + noise.level=false; + break; case 8: case 9: case 0xa: - chan=offset-8; + chan=offset-8; m_channels[chan].envelope_on = data & 0x10; // buggy aussetzer cube up m_channels[chan].volume = data & 0xf; break; case 0xb: case 0xc: size = reg[0xb] | ((reg[0xc]) << 8); - if (size==0) size=1; - envelope.step= machine().device("maincpu")->unscaled_clock() / (1.0*ClockDelay*machine().sample_rate()*size); - break; + if (size==0) + size=1; + envelope.step= machine().device("maincpu")->unscaled_clock() / (1.0*ClockDelay*machine().sample_rate()*size); + break; case 0xd: - envelope.control=data&0xf; - envelope.pos=0; - envelope.index=0; - envelope.first=true; - break; - + envelope.control=data&0xf; + envelope.pos=0; + envelope.index=0; + envelope.first=true; + break; + } envelope.pos=0; // guess envelope.index=0; @@ -224,7 +244,8 @@ WRITE8_MEMBER( gamate_sound_device::device_w ) READ8_MEMBER( gamate_sound_device::device_r ) { - UINT8 data=0; - if ((offset&0xf) 1 28 <> PB2 + PB4(/ALE) <> 2 27 <> PB1 + PB5(/RD) <> 3 26 <> PB0 + PB6(/WR) <> 4 25 <> D7(PA7) + PB7(/CS) <> 5 24 <> D6(PA6) + /RESET -> 6 23 <> D5(PA5) + [/TSTOUT?] <- 7 22 <> D4(PA4) + VCC -- 8 21 <> D3(PA3) + XI(CLK) -> 9 20 <> D2(PA2) + XO <- 10 19 <> D1(PA1) + D/A OUT + <- 11 18 <> D0(PA0) + D/A POWER -- 12 17 <- CH2 + D/A OUT - <- 13 16 <> /EXTINT and [/TSTOUT2?] (test out is related to pin 15 state) + GND -- 14 15 <- CH1 tied to pin 16 (VCC) through a resistor, on APC to VCC thru a 12k resistor and thru a 10uf cap to gnd - CH1 and CH2 are some sort of mode selects? + CH1 and CH2 are mode selects, purpose based on testing by kevtris: + CH1 CH2 + H L - 'master' mode, pb4-pb7 are i/o? /EXTINT is an input + L L - 'slave' mode where pb4-pb7 are /ale /rd /wr /cs? /EXTINT may be an output in this mode? + X H - test mode: the 512 byte 16-bit wide ROM is output sequentially on pins pa7-pa0 and pb7-pb0 for the high and low bytes of each word respectively + D/A POWER is the FET source for the D/A OUT+ and D/A OUT- push-pull dac drains; it should be tied to VCC or thereabouts In the SCV (info from plgDavid): pin 5 is tied to the !SCPU pin on the Epoch TV chip pin 29 (0x3600 writes) diff --git a/src/mess/drivers/a7800.c b/src/mess/drivers/a7800.c index 8352d1ab71f..cffcd9c747b 100644 --- a/src/mess/drivers/a7800.c +++ b/src/mess/drivers/a7800.c @@ -117,10 +117,10 @@ public: m_maria(*this, "maria"), m_io_joysticks(*this, "joysticks"), m_io_buttons(*this, "buttons"), - m_io_vblank(*this, "vblank"), m_io_console_buttons(*this, "console_buttons"), m_cart(*this, "cartslot"), - m_screen(*this, "screen") { } + m_screen(*this, "screen"), + m_bios(*this, "maincpu") { } int m_lines; int m_ispal; @@ -132,8 +132,6 @@ public: int m_p2_one_button; int m_bios_enabled; - UINT8 *m_bios; - DECLARE_READ8_MEMBER(bios_or_cart_r); DECLARE_WRITE8_MEMBER(ram0_w); DECLARE_READ8_MEMBER(tia_r); @@ -158,10 +156,10 @@ protected: required_device m_maria; required_ioport m_io_joysticks; required_ioport m_io_buttons; - required_ioport m_io_vblank; required_ioport m_io_console_buttons; required_device m_cart; required_device m_screen; + required_region_ptr m_bios; }; @@ -282,18 +280,17 @@ READ8_MEMBER(a7800_state::bios_or_cart_r) static ADDRESS_MAP_START( a7800_mem, AS_PROGRAM, 8, a7800_state ) AM_RANGE(0x0000, 0x001f) AM_MIRROR(0x300) AM_READWRITE(tia_r, tia_w) AM_RANGE(0x0020, 0x003f) AM_MIRROR(0x300) AM_DEVREADWRITE("maria", atari_maria_device, read, write) - AM_RANGE(0x0040, 0x00ff) AM_RAMBANK("ram0") // RAM (6116 block 0) - AM_RANGE(0x0140, 0x01ff) AM_RAMBANK("ram1") // RAM (6116 block 1) + AM_RANGE(0x0040, 0x00ff) AM_RAMBANK("zpmirror") // mirror of 0x2040-0x20ff, for zero page + AM_RANGE(0x0140, 0x01ff) AM_RAMBANK("spmirror") // mirror of 0x2140-0x21ff, for stack page AM_RANGE(0x0280, 0x02ff) AM_DEVREADWRITE("riot", riot6532_device, read, write) - AM_RANGE(0x0480, 0x04ff) AM_MIRROR(0x100) AM_RAMBANK("riot_ram") - AM_RANGE(0x1800, 0x27ff) AM_RAMBANK("main_ram") - - AM_RANGE(0x2040, 0x20ff) AM_RAMBANK("ram0") // mirror (6116 block 0) - AM_RANGE(0x2140, 0x21ff) AM_RAMBANK("ram1") // mirror (6116 block 1) - - AM_RANGE(0x2800, 0x2fff) AM_RAMBANK("mirror") // these should mirror "main_ram" (according to docs) - AM_RANGE(0x3000, 0x37ff) AM_RAMBANK("mirror") // but system have issues in such case... - AM_RANGE(0x3800, 0x3fff) AM_RAMBANK("mirror") + 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 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 @@ -322,10 +319,6 @@ static INPUT_PORTS_START( a7800 ) PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_PLAYER(1) PORT_BIT(0xF0, IP_ACTIVE_LOW, IPT_UNUSED) - PORT_START("vblank") - PORT_BIT(0x7F, IP_ACTIVE_LOW, IPT_UNUSED) - PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_VBLANK("screen") - PORT_START("console_buttons") PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Reset") PORT_CODE(KEYCODE_R) PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Select") PORT_CODE(KEYCODE_S) @@ -1306,7 +1299,6 @@ PALETTE_INIT_MEMBER(a7800_state,a7800p) void a7800_state::machine_start() { - m_bios = machine().root_device().memregion("maincpu")->base() + 0xc000; save_item(NAME(m_p1_one_button)); save_item(NAME(m_p2_one_button)); save_item(NAME(m_bios_enabled)); @@ -1314,6 +1306,11 @@ void a7800_state::machine_start() save_item(NAME(m_ctrl_reg)); save_item(NAME(m_maria_flag)); + // set up RAM mirrors + UINT8 *ram = reinterpret_cast(memshare("6116_2")->ptr()); + membank("zpmirror")->set_base(ram + 0x0040); + membank("spmirror")->set_base(ram + 0x0140); + // install additional handlers, if needed if (m_cart->exists()) { @@ -1420,16 +1417,16 @@ MACHINE_CONFIG_END ***************************************************************************/ ROM_START( a7800 ) - ROM_REGION(0x10000, "maincpu", ROMREGION_ERASEFF) + ROM_REGION(0x4000, "maincpu", ROMREGION_ERASEFF) ROM_SYSTEM_BIOS( 0, "a7800", "Atari 7800" ) - ROMX_LOAD("7800.u7", 0xf000, 0x1000, CRC(5d13730c) SHA1(d9d134bb6b36907c615a594cc7688f7bfcef5b43), ROM_BIOS(1)) + ROMX_LOAD("7800.u7", 0x3000, 0x1000, CRC(5d13730c) SHA1(d9d134bb6b36907c615a594cc7688f7bfcef5b43), ROM_BIOS(1)) ROM_SYSTEM_BIOS( 1, "a7800pr", "Atari 7800 (prototype with Asteroids)" ) - ROMX_LOAD("c300558-001a.u7", 0xc000, 0x4000, CRC(a0e10edf) SHA1(14584b1eafe9721804782d4b1ac3a4a7313e455f), ROM_BIOS(2)) + ROMX_LOAD("c300558-001a.u7", 0x0000, 0x4000, CRC(a0e10edf) SHA1(14584b1eafe9721804782d4b1ac3a4a7313e455f), ROM_BIOS(2)) ROM_END ROM_START( a7800p ) - ROM_REGION(0x10000, "maincpu", ROMREGION_ERASEFF) - ROM_LOAD("7800pal.rom", 0xc000, 0x4000, CRC(d5b61170) SHA1(5a140136a16d1d83e4ff32a19409ca376a8df874)) + ROM_REGION(0x4000, "maincpu", ROMREGION_ERASEFF) + ROM_LOAD("7800pal.rom", 0x0000, 0x4000, CRC(d5b61170) SHA1(5a140136a16d1d83e4ff32a19409ca376a8df874)) ROM_END diff --git a/src/mess/drivers/elecbowl.c b/src/mess/drivers/elecbowl.c index 0ae06e2b3a8..ae1e750924a 100644 --- a/src/mess/drivers/elecbowl.c +++ b/src/mess/drivers/elecbowl.c @@ -2,6 +2,8 @@ // copyright-holders:hap, Kevin Horton /*************************************************************************** + ** subclass of hh_tms1k_state (includes/hh_tms1k.h, drivers/hh_tms1k.c) ** + Marx Series 300 Electronic Bowling Game * TMS1100NLL MP3403 DBS 7836 SINGAPORE @@ -15,60 +17,32 @@ ***************************************************************************/ -#include "emu.h" -#include "cpu/tms0980/tms0980.h" -#include "sound/speaker.h" - -// internal artwork +#include "includes/hh_tms1k.h" #include "elecbowl.lh" -class elecbowl_state : public driver_device +class elecbowl_state : public hh_tms1k_state { public: elecbowl_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") + : hh_tms1k_state(mconfig, type, tag) { } - // devices - required_device m_maincpu; - required_ioport_array<4> m_inp_matrix; - required_device m_speaker; - - UINT16 m_r; - UINT16 m_o; - UINT16 m_inp_mux; - - DECLARE_READ8_MEMBER(read_k); DECLARE_WRITE16_MEMBER(write_r); DECLARE_WRITE16_MEMBER(write_o); + DECLARE_READ8_MEMBER(read_k); +protected: virtual void machine_start(); }; - /*************************************************************************** I/O ***************************************************************************/ -READ8_MEMBER(elecbowl_state::read_k) -{ - UINT8 k = 0; - - // read selected input rows - for (int i = 0; i < 4; i++) - if (m_inp_mux >> i & 1) - k |= m_inp_matrix[i]->read(); - - return k; -} - WRITE16_MEMBER(elecbowl_state::write_r) { // R4-R7: input mux @@ -86,6 +60,11 @@ WRITE16_MEMBER(elecbowl_state::write_o) // ? } +READ8_MEMBER(elecbowl_state::read_k) +{ + return read_inputs(4); +} + /*************************************************************************** @@ -130,15 +109,7 @@ INPUT_PORTS_END void elecbowl_state::machine_start() { - // zerofill - m_o = 0; - m_r = 0; - m_inp_mux = 0; - - // register for savestates - save_item(NAME(m_o)); - save_item(NAME(m_r)); - save_item(NAME(m_inp_mux)); + hh_tms1k_state::machine_start(); } @@ -189,4 +160,4 @@ ROM_START( elecbowl ) ROM_END -CONS( 1978, elecbowl, 0, 0, elecbowl, elecbowl, driver_device, 0, "Marx", "Electronic Bowling", GAME_SUPPORTS_SAVE | GAME_MECHANICAL | GAME_NOT_WORKING ) +CONS( 1978, elecbowl, 0, 0, elecbowl, elecbowl, driver_device, 0, "Marx", "Electronic Bowling (Marx)", GAME_SUPPORTS_SAVE | GAME_MECHANICAL | GAME_NOT_WORKING ) diff --git a/src/mess/drivers/gamate.c b/src/mess/drivers/gamate.c index a6e70e58e1f..3953bc5b060 100644 --- a/src/mess/drivers/gamate.c +++ b/src/mess/drivers/gamate.c @@ -9,10 +9,6 @@ ******************************************************************************/ #include "emu.h" -#include "cpu/m6502/m6502.h" -#include "bus/generic/slot.h" -#include "bus/generic/carts.h" -#include "rendlay.h" #include "includes/gamate.h" #include "ui/ui.h" @@ -38,11 +34,8 @@ public: DECLARE_WRITE8_MEMBER(cart_bankswitchmulti_w); DECLARE_WRITE8_MEMBER(cart_bankswitch_w); DECLARE_READ8_MEMBER(gamate_video_r); - DECLARE_READ8_MEMBER(gamate_pad_r); DECLARE_READ8_MEMBER(gamate_nmi_r); DECLARE_WRITE8_MEMBER(gamate_video_w); - DECLARE_READ8_MEMBER(gamate_audio_r); - DECLARE_WRITE8_MEMBER(gamate_audio_w); DECLARE_WRITE8_MEMBER(gamate_bios_w); DECLARE_DRIVER_INIT(gamate); UINT32 screen_update_gamate(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); @@ -55,24 +48,25 @@ private: struct { - UINT8 reg[8]; - struct { - bool page2; // else page1 - UINT8 ypos, xpos/*tennis*/; - UINT8 data[2][0x100][0x20]; - } bitmap; - UINT8 x, y; + UINT8 reg[8]; + struct + { + bool page2; // else page1 + UINT8 ypos, xpos/*tennis*/; + UINT8 data[2][0x100][0x20]; + } bitmap; + UINT8 x, y; bool y_increment; } video; - struct { - bool set; + struct + { + bool set; int bit_shifter; UINT8 cartridge_byte; UINT16 address; // in reality something more like short local cartridge address offset bool unprotected; bool failed; - } card_protection; required_device m_maincpu; @@ -83,156 +77,158 @@ private: required_shared_ptr m_bios; emu_timer *timer1; emu_timer *timer2; - UINT8 bank_multi; + UINT8 bank_multi; + UINT8 *m_cart_ptr; }; 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); + 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) { + switch (offset) + { case 0: card_protection.failed= card_protection.failed || ((card_protection.cartridge_byte&0x80)!=0) != ((data&4)!=0); card_protection.bit_shifter++; - if (card_protection.bit_shifter>=8) { - card_protection.cartridge_byte=m_cart->get_rom_base()[card_protection.address++]; + if (card_protection.bit_shifter>=8) + { + card_protection.cartridge_byte=m_cart_ptr[card_protection.address++]; card_protection.bit_shifter=0; } break; } } + READ8_MEMBER( gamate_state::gamate_cart_protection_r ) { - - UINT8 ret=1; - if (card_protection.bit_shifter==7 && card_protection.unprotected) { - ret=m_cart->get_rom_base()[bank_multi*0x4000]; - } else { - card_protection.bit_shifter++; - if (card_protection.bit_shifter==8) { - card_protection.bit_shifter=0; - card_protection.cartridge_byte='G'; - card_protection.unprotected=true; + UINT8 ret=1; + if (card_protection.bit_shifter==7 && card_protection.unprotected) + { + ret=m_cart_ptr[bank_multi*0x4000]; } - 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 + else + { + card_protection.bit_shifter++; + if (card_protection.bit_shifter==8) + { + card_protection.bit_shifter=0; + card_protection.cartridge_byte='G'; + card_protection.unprotected=true; + } + 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 + } + card_protection.cartridge_byte<<=1; } - card_protection.cartridge_byte<<=1; - } - logerror("%.6f protection read %x %x address:%x data:%x shift:%d\n",machine().time().as_double(), offset, ret, card_protection.address, card_protection.cartridge_byte, card_protection.bit_shifter); - return ret; + logerror("%.6f protection read %x %x address:%x data:%x shift:%d\n",machine().time().as_double(), offset, ret, card_protection.address, card_protection.cartridge_byte, card_protection.bit_shifter); + return ret; } -READ8_MEMBER( gamate_state::protection_r ) { return card_protection.set? 3: 1; } // bits 0 and 1 checked +READ8_MEMBER( gamate_state::protection_r ) +{ + return card_protection.set? 3: 1; +} // bits 0 and 1 checked WRITE8_MEMBER( gamate_state::protection_reset ) { - // writes 0x20 - card_protection.address=0x6005-0x6001; - card_protection.bit_shifter=0; - card_protection.cartridge_byte=m_cart->get_rom_base()[card_protection.address++];//m_cart_rom[card_protection.address++]; - card_protection.failed=false; - card_protection.unprotected=false; +// writes 0x20 + card_protection.address=0x6005-0x6001; + card_protection.bit_shifter=0; + card_protection.cartridge_byte=m_cart_ptr[card_protection.address++]; //m_cart_rom[card_protection.address++]; + card_protection.failed=false; + card_protection.unprotected=false; } READ8_MEMBER( gamate_state::newer_protection_set ) { - card_protection.set=true; - return 0; + card_protection.set=true; + return 0; } - WRITE8_MEMBER( gamate_state::gamate_video_w ) { - video.reg[offset]=data; - switch (offset) { - case 1: - if (data&0xf) printf("lcd mode %x\n", data); - video.y_increment=data&0x40; - break; - case 2: video.bitmap.xpos=data;break; - case 3: - if (data>=200) printf("lcd ypos: %x\n", data); - video.bitmap.ypos=data; - break; - case 4: video.bitmap.page2=data&0x80;video.x=data&0x1f;break; - case 5: video.y=data;break; - case 7: - video.bitmap.data[video.bitmap.page2][video.y][video.x&(ARRAY_LENGTH(video.bitmap.data[0][0])-1)]=data; - if (video.y_increment) video.y++; - else video.x++; // overruns - } + video.reg[offset]=data; + switch (offset) + { + case 1: + if (data&0xf) + printf("lcd mode %x\n", data); + video.y_increment=data&0x40; + break; + case 2: + video.bitmap.xpos=data; + break; + case 3: + if (data>=200) + printf("lcd ypos: %x\n", data); + video.bitmap.ypos=data; + break; + case 4: + video.bitmap.page2=data&0x80; + video.x=data&0x1f; + break; + case 5: + video.y=data; + break; + case 7: + video.bitmap.data[video.bitmap.page2][video.y][video.x&(ARRAY_LENGTH(video.bitmap.data[0][0])-1)]=data; + if (video.y_increment) + video.y++; + else + video.x++; // overruns + } } WRITE8_MEMBER( gamate_state::cart_bankswitchmulti_w ) { - bank_multi=data; - membank("bankmulti")->set_base(m_cart->get_rom_base()+0x4000*data+1); + bank_multi=data; + membank("bankmulti")->set_base(m_cart_ptr+0x4000*data+1); } WRITE8_MEMBER( gamate_state::cart_bankswitch_w ) { - membank("bank")->set_base(m_cart->get_rom_base()+0x4000*data); + membank("bank")->set_base(m_cart_ptr+0x4000*data); } READ8_MEMBER( gamate_state::gamate_video_r ) { - if (offset!=6) return 0; - UINT8 data=0; - data=video.bitmap.data[video.bitmap.page2][video.y][video.x&(ARRAY_LENGTH(video.bitmap.data[0][0])-1)]; + if (offset!=6) + return 0; + UINT8 data = video.bitmap.data[video.bitmap.page2][video.y][video.x&(ARRAY_LENGTH(video.bitmap.data[0][0])-1)]; // if (m_maincpu->pc()<0xf000) // machine().ui().popup_time(2, "lcd read x:%x y:%x mode:%x data:%x\n", video.x, video.y, video.reg[1], data); - if (video.y_increment) video.y++; - else video.x++; // overruns? + if (video.y_increment) + video.y++; + else + video.x++; // overruns? - return data; -} - -WRITE8_MEMBER( gamate_state::gamate_audio_w ) -{ -// logerror("%.6f %04x audio write %04x %02x\n",machine().time().as_double(),m_maincpu->pc(),offset,data); - m_sound->device_w(space, offset, data); -} - -READ8_MEMBER( gamate_state::gamate_audio_r ) -{ - UINT8 data=m_sound->device_r(space, offset); - return data; -} - - -READ8_MEMBER( gamate_state::gamate_pad_r ) -{ - UINT8 data=m_io_joy->read(); - return data; + return data; } READ8_MEMBER( gamate_state::gamate_nmi_r ) { - UINT8 data=0; - machine().ui().popup_time(2, "nmi/4800 read\n"); - return data; + UINT8 data=0; + machine().ui().popup_time(2, "nmi/4800 read\n"); + return data; } static ADDRESS_MAP_START( gamate_mem, AS_PROGRAM, 8, gamate_state ) - AM_RANGE(0x0000, 0x03ff) AM_RAM - AM_RANGE(0x4000, 0x400d) AM_READWRITE(gamate_audio_r, gamate_audio_w) - AM_RANGE(0x4400, 0x4400) AM_READ(gamate_pad_r) - AM_RANGE(0x4800, 0x4800) AM_READ(gamate_nmi_r) - AM_RANGE(0x5000, 0x5007) AM_READWRITE(gamate_video_r, gamate_video_w) - AM_RANGE(0x5800, 0x5800) AM_READ(newer_protection_set) - AM_RANGE(0x5900, 0x5900) AM_WRITE(protection_reset) - AM_RANGE(0x5a00, 0x5a00) AM_READ(protection_r) - - AM_RANGE(0x6001, 0x9fff) AM_READ_BANK("bankmulti") - AM_RANGE(0xa000, 0xdfff) AM_READ_BANK("bank") - + AM_RANGE(0x0000, 0x03ff) AM_RAM + AM_RANGE(0x4000, 0x400d) AM_DEVREADWRITE("custom", gamate_sound_device, device_r, device_w) + AM_RANGE(0x4400, 0x4400) AM_READ_PORT("JOY") + AM_RANGE(0x4800, 0x4800) AM_READ(gamate_nmi_r) + AM_RANGE(0x5000, 0x5007) AM_READWRITE(gamate_video_r, gamate_video_w) + AM_RANGE(0x5800, 0x5800) AM_READ(newer_protection_set) + AM_RANGE(0x5900, 0x5900) AM_WRITE(protection_reset) + AM_RANGE(0x5a00, 0x5a00) AM_READ(protection_r) + AM_RANGE(0x6001, 0x9fff) AM_READ_BANK("bankmulti") + AM_RANGE(0xa000, 0xdfff) AM_READ_BANK("bank") AM_RANGE(0x6000, 0x6000) AM_READWRITE(gamate_cart_protection_r, gamate_cart_protection_w) AM_RANGE(0x8000, 0x8000) AM_WRITE(cart_bankswitchmulti_w) AM_RANGE(0xc000, 0xc000) AM_WRITE(cart_bankswitch_w) - - AM_RANGE(0xf000, 0xffff) AM_ROM AM_SHARE("bios") + AM_RANGE(0xf000, 0xffff) AM_ROM AM_SHARE("bios") ADDRESS_MAP_END @@ -251,10 +247,10 @@ INPUT_PORTS_END /* palette in red, green, blue tribles */ static const unsigned char gamate_colors[4][3] = { - { 255,255,255 }, - { 0xa0, 0xa0, 0xa0 }, - { 0x60, 0x60, 0x60 }, - { 0, 0, 0 } + { 255,255,255 }, + { 0xa0, 0xa0, 0xa0 }, + { 0x60, 0x60, 0x60 }, + { 0, 0, 0 } }; PALETTE_INIT_MEMBER(gamate_state, gamate) @@ -277,27 +273,36 @@ static void BlitPlane(UINT16* line, UINT8 plane1, UINT8 plane2) UINT32 gamate_state::screen_update_gamate(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - int x, y, j; - for (y=0;y<152;y++) { - for (x=-(video.bitmap.xpos&7), j=0;x<160;x+=8, j++) { - UINT8 d1, d2; - if (video.bitmap.ypos<200) { - d1=video.bitmap.data[0][(y+video.bitmap.ypos)%200][(j+video.bitmap.xpos/8)&0x1f]; - d2=video.bitmap.data[1][(y+video.bitmap.ypos)%200][(j+video.bitmap.xpos/8)&0x1f]; - } else if ((video.bitmap.ypos&0xf)<8) { // lcdtest, of course still some registers not known, my gamate doesn't display bottom lines; most likely problematic 200 warp around hardware! no real usage - int yi=(y+(video.bitmap.ypos&0xf)-8); - if (yi<0) yi=video.bitmap.ypos+y; // in this case only 2nd plane used!?, source of first plane? - d1=video.bitmap.data[0][yi][(j+video.bitmap.xpos/8)&0x1f]; // value of lines bevor 0 chaos - d2=video.bitmap.data[1][yi][(j+video.bitmap.xpos/8)&0x1f]; - } else { - d1=video.bitmap.data[0][y][(j+video.bitmap.xpos/8)&0x1f]; - d2=video.bitmap.data[1][y][(j+video.bitmap.xpos/8)&0x1f]; - } - BlitPlane(&bitmap.pix16(y, x+4), d1, d2); - BlitPlane(&bitmap.pix16(y, x), d1>>4, d2>>4); - } - } - return 0; + int x, y, j; + for (y=0;y<152;y++) + { + for (x=-(video.bitmap.xpos&7), j=0;x<160;x+=8, j++) + { + UINT8 d1, d2; + if (video.bitmap.ypos<200) + { + d1=video.bitmap.data[0][(y+video.bitmap.ypos)%200][(j+video.bitmap.xpos/8)&0x1f]; + d2=video.bitmap.data[1][(y+video.bitmap.ypos)%200][(j+video.bitmap.xpos/8)&0x1f]; + } + else + if ((video.bitmap.ypos&0xf)<8) + { // lcdtest, of course still some registers not known, my gamate doesn't display bottom lines; most likely problematic 200 warp around hardware! no real usage + int yi=(y+(video.bitmap.ypos&0xf)-8); + if (yi<0) + yi=video.bitmap.ypos+y; // in this case only 2nd plane used!?, source of first plane? + d1=video.bitmap.data[0][yi][(j+video.bitmap.xpos/8)&0x1f]; // value of lines bevor 0 chaos + d2=video.bitmap.data[1][yi][(j+video.bitmap.xpos/8)&0x1f]; + } + else + { + d1=video.bitmap.data[0][y][(j+video.bitmap.xpos/8)&0x1f]; + d2=video.bitmap.data[1][y][(j+video.bitmap.xpos/8)&0x1f]; + } + BlitPlane(&bitmap.pix16(y, x+4), d1, d2); + BlitPlane(&bitmap.pix16(y, x), d1>>4, d2>>4); + } + } + return 0; } DRIVER_INIT_MEMBER(gamate_state,gamate) @@ -310,8 +315,11 @@ DRIVER_INIT_MEMBER(gamate_state,gamate) void gamate_state::machine_start() { - if (m_cart->exists()) { + 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_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 } @@ -375,10 +383,8 @@ static MACHINE_CONFIG_START( gamate, gamate_state ) MCFG_SOUND_ADD("custom", GAMATE_SND, 0) MCFG_SOUND_ROUTE(0, "lspeaker", 0.50) MCFG_SOUND_ROUTE(1, "rspeaker", 0.50) - - MCFG_GENERIC_CARTSLOT_ADD("cartslot", generic_linear_slot, "gamate_cart") - MCFG_GENERIC_MANDATORY + MCFG_GENERIC_CARTSLOT_ADD("cartslot", generic_linear_slot, "gamate_cart") MCFG_SOFTWARE_LIST_ADD("cart_list","gamate") MACHINE_CONFIG_END @@ -392,7 +398,6 @@ ROM_START(gamate) ROM_END -/* YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME */ +/* 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/hh_hmcs40.c b/src/mess/drivers/hh_hmcs40.c index 7f903114df6..45bd3f76bc7 100644 --- a/src/mess/drivers/hh_hmcs40.c +++ b/src/mess/drivers/hh_hmcs40.c @@ -15,7 +15,7 @@ *62 HD38750A 1982, Actronics(Hanzawa) Pack'n Maze *04 HD38800A 1980, Gakken Heiankyo Alien - *23 HD38800A 198?, Tomy Kingman + @23 HD38800B 1982, Tomy Kingman (THF-01II) *24 HD38800B 1982, Actronics(Hanzawa) Wanted G-Man @25 HD38800A 1981, Coleco Alien Attack @27 HD38800A 1981, Bandai Packri Monster (DM-21Z) @@ -34,6 +34,7 @@ *43 HD38820A 1982, Entex Turtles (have dump, +COP411 for audio) @45 HD38820A 1982, Coleco Donkey Kong @49 HD38820A 1983, Bandai Zackman + @61 HD38820A 1983, Coleco Ms. Pac-Man @70 HD38820A 1983, Parker Brothers Q*Bert @88 HD38820A 1984, Tomy Tron (THN-02) @@ -67,33 +68,38 @@ public: optional_device m_speaker; // misc common - UINT16 m_inp_mux; + UINT16 m_inp_mux; // multiplexed inputs mask UINT16 read_inputs(int columns); virtual void machine_start(); // display common - int m_display_wait; - int m_display_maxy; - int m_display_maxx; + 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; - UINT32 m_plate; + UINT32 m_grid; // VFD current row data + UINT64 m_plate; // VFD current column data - UINT32 m_display_state[0x20]; - UINT32 m_display_cache[0x20]; - UINT8 m_display_decay[0x20][0x20]; - UINT16 m_7seg_mask[0x20]; + UINT64 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 + 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 display_matrix(int maxx, int maxy, UINT32 setx, UINT32 sety); + void display_matrix(int maxx, int maxy, UINT64 setx, UINT32 sety); // game-specific handlers DECLARE_WRITE8_MEMBER(alnattck_plate_w); - DECLARE_READ16_MEMBER(alnattck_d_r); DECLARE_WRITE16_MEMBER(alnattck_d_w); + DECLARE_READ16_MEMBER(alnattck_d_r); + + void egalaxn2_display(); + DECLARE_WRITE8_MEMBER(egalaxn2_plate_w); + DECLARE_WRITE16_MEMBER(egalaxn2_grid_w); + DECLARE_READ8_MEMBER(egalaxn2_input_r); }; @@ -101,9 +107,9 @@ void hh_hmcs40_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_cache, ~0, sizeof(m_display_cache)); memset(m_display_decay, 0, sizeof(m_display_decay)); - memset(m_7seg_mask, 0, sizeof(m_7seg_mask)); + memset(m_display_segmask, 0, sizeof(m_display_segmask)); m_inp_mux = 0; m_grid = 0; @@ -115,9 +121,9 @@ void hh_hmcs40_state::machine_start() save_item(NAME(m_display_wait)); save_item(NAME(m_display_state)); - save_item(NAME(m_display_cache)); + /* save_item(NAME(m_display_cache)); */ // don't save! save_item(NAME(m_display_decay)); - save_item(NAME(m_7seg_mask)); + save_item(NAME(m_display_segmask)); save_item(NAME(m_inp_mux)); save_item(NAME(m_grid)); @@ -137,7 +143,7 @@ void hh_hmcs40_state::machine_start() void hh_hmcs40_state::display_update() { - UINT32 active_state[0x20]; + UINT64 active_state[0x20]; for (int y = 0; y < m_display_maxy; y++) { @@ -159,12 +165,20 @@ void hh_hmcs40_state::display_update() for (int y = 0; y < m_display_maxy; y++) if (m_display_cache[y] != active_state[y]) { - if (m_7seg_mask[y] != 0) - output_set_digit_value(y, active_state[y] & m_7seg_mask[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++) - output_set_lamp_value(y * mul + x, active_state[y] >> x & 1); + { + 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)); @@ -175,19 +189,19 @@ 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++) - if (!(m_display_state[y] >> x & 1) && m_display_decay[y][x] != 0) + if (m_display_decay[y][x] != 0) m_display_decay[y][x]--; display_update(); } -void hh_hmcs40_state::display_matrix(int maxx, int maxy, UINT32 setx, UINT32 sety) +void hh_hmcs40_state::display_matrix(int maxx, int maxy, UINT64 setx, UINT32 sety) { m_display_maxx = maxx; m_display_maxy = maxy; // update current state - UINT32 mask = (1 << maxx) - 1; + UINT64 mask = (1 << maxx) - 1; for (int y = 0; y < maxy; y++) m_display_state[y] = (sety >> y & 1) ? (setx & mask) : 0; @@ -336,17 +350,11 @@ WRITE8_MEMBER(hh_hmcs40_state::alnattck_plate_w) m_plate = (m_plate & ~(0xf << shift)) | (data << shift); // update display - UINT32 plate = BITSWAP16((UINT16)m_plate,11,9,8,10,7,2,0,1,3,4,5,6,12,13,14,15) | (m_plate & 0xf0000); + 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); } -READ16_MEMBER(hh_hmcs40_state::alnattck_d_r) -{ - // D5: inputs - return (read_inputs(7) & 1) << 5; -} - WRITE16_MEMBER(hh_hmcs40_state::alnattck_d_w) { // D4: speaker out @@ -362,6 +370,12 @@ WRITE16_MEMBER(hh_hmcs40_state::alnattck_d_w) alnattck_plate_w(space, 4, data & 0xf); } +READ16_MEMBER(hh_hmcs40_state::alnattck_d_r) +{ + // D5: inputs + return (read_inputs(7) & 1) << 5; +} + static INPUT_PORTS_START( alnattck ) PORT_START("IN.0") // D5 D7 @@ -520,6 +534,41 @@ MACHINE_CONFIG_END +/*************************************************************************** + + Coleco Ms. Pac-Man (manufactured in Taiwan) + * board label Coleco 911171 + * Hitachi HD38820A61 MCU + * cyan/red VFD display Futaba DM-60Z 3I, with color overlay + + NOTE!: MESS external artwork is recommended + +***************************************************************************/ + +static INPUT_PORTS_START( cmspacmn ) +INPUT_PORTS_END + + +static MACHINE_CONFIG_START( cmspacmn, hh_hmcs40_state ) + + /* basic machine hardware */ + MCFG_CPU_ADD("maincpu", HD38820, 400000) // approximation - RC osc. + +// 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! */ + + /* sound hardware */ + MCFG_SPEAKER_STANDARD_MONO("mono") + MCFG_SOUND_ADD("speaker", SPEAKER_SOUND, 0) + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) +MACHINE_CONFIG_END + + + + + /*************************************************************************** Entex Galaxian 2 (manufactured in Japan) @@ -530,7 +579,71 @@ 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); + 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); +} + +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(); +} + +WRITE8_MEMBER(hh_hmcs40_state::egalaxn2_plate_w) +{ + // R10-R63: vfd matrix plate + int shift = (offset - HMCS40_PORT_R1X) * 4; + m_plate = (m_plate & ~(0xf << shift)) | (data << shift); + + egalaxn2_display(); +} + +READ8_MEMBER(hh_hmcs40_state::egalaxn2_input_r) +{ + // R0x: multiplexed inputs + return read_inputs(4); +} + + static INPUT_PORTS_START( egalaxn2 ) + PORT_START("IN.0") // D1 port R0x + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_16WAY // separate directional buttons, hence 16way + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_16WAY // " + + PORT_START("IN.1") // D2 port R0x + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_COCKTAIL PORT_16WAY // separate directional buttons, hence 16way + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_COCKTAIL PORT_16WAY // " + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_COCKTAIL PORT_16WAY // " + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_COCKTAIL PORT_16WAY // " + + PORT_START("IN.2") // D3 port R0x + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED ) + + PORT_START("IN.3") // D4 port R0x + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_CONFNAME( 0x02, 0x02, "Skill" ) + PORT_CONFSETTING( 0x02, "1" ) + PORT_CONFSETTING( 0x00, "2" ) + PORT_CONFNAME( 0x0c, 0x00, "Players" ) + PORT_CONFSETTING( 0x08, "0 (Demo)" ) // for Demo mode: need to hold down Fire button at power-on + PORT_CONFSETTING( 0x00, "1" ) + PORT_CONFSETTING( 0x04, "2" ) INPUT_PORTS_END @@ -538,8 +651,16 @@ static MACHINE_CONFIG_START( egalaxn2, 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, egalaxn2_input_r)) + MCFG_HMCS40_WRITE_R_CB(1, WRITE8(hh_hmcs40_state, egalaxn2_plate_w)) + MCFG_HMCS40_WRITE_R_CB(2, WRITE8(hh_hmcs40_state, egalaxn2_plate_w)) + MCFG_HMCS40_WRITE_R_CB(3, WRITE8(hh_hmcs40_state, egalaxn2_plate_w)) + MCFG_HMCS40_WRITE_R_CB(4, WRITE8(hh_hmcs40_state, egalaxn2_plate_w)) + MCFG_HMCS40_WRITE_R_CB(5, WRITE8(hh_hmcs40_state, egalaxn2_plate_w)) + MCFG_HMCS40_WRITE_R_CB(6, WRITE8(hh_hmcs40_state, egalaxn2_plate_w)) + MCFG_HMCS40_WRITE_D_CB(WRITE16(hh_hmcs40_state, egalaxn2_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! */ @@ -564,7 +685,37 @@ 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) + static INPUT_PORTS_START( epacman2 ) + PORT_START("IN.0") // D1 port R0x + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_16WAY // separate directional buttons, hence 16way + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_16WAY // " + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_16WAY // " + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_16WAY // " + + PORT_START("IN.1") // D2 port R0x + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_COCKTAIL PORT_16WAY // separate directional buttons, hence 16way + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_COCKTAIL PORT_16WAY // " + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_COCKTAIL PORT_16WAY // " + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_COCKTAIL PORT_16WAY // " + + PORT_START("IN.2") // D3 port R0x + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START ) PORT_NAME("P1 Skill Control") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SELECT ) PORT_NAME("Demo Light Test") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED ) + + PORT_START("IN.3") // D4 port R0x + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_CONFNAME( 0x02, 0x02, "Skill" ) + PORT_CONFSETTING( 0x00, "1" ) + PORT_CONFSETTING( 0x02, "2" ) + PORT_CONFNAME( 0x0c, 0x04, "Players" ) + PORT_CONFSETTING( 0x08, "0 (Demo)" ) + PORT_CONFSETTING( 0x04, "1" ) + PORT_CONFSETTING( 0x00, "2" ) INPUT_PORTS_END @@ -572,8 +723,16 @@ static MACHINE_CONFIG_START( epacman2, 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, egalaxn2_input_r)) + MCFG_HMCS40_WRITE_R_CB(1, WRITE8(hh_hmcs40_state, egalaxn2_plate_w)) + MCFG_HMCS40_WRITE_R_CB(2, WRITE8(hh_hmcs40_state, egalaxn2_plate_w)) + MCFG_HMCS40_WRITE_R_CB(3, WRITE8(hh_hmcs40_state, egalaxn2_plate_w)) + MCFG_HMCS40_WRITE_R_CB(4, WRITE8(hh_hmcs40_state, egalaxn2_plate_w)) + MCFG_HMCS40_WRITE_R_CB(5, WRITE8(hh_hmcs40_state, egalaxn2_plate_w)) + MCFG_HMCS40_WRITE_R_CB(6, WRITE8(hh_hmcs40_state, egalaxn2_plate_w)) + MCFG_HMCS40_WRITE_D_CB(WRITE16(hh_hmcs40_state, egalaxn2_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! */ @@ -622,6 +781,41 @@ MACHINE_CONFIG_END +/*************************************************************************** + + Tomy Kingman (manufactured in Japan) + * 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 + +***************************************************************************/ + +static INPUT_PORTS_START( kingman ) +INPUT_PORTS_END + + +static MACHINE_CONFIG_START( kingman, hh_hmcs40_state ) + + /* basic machine hardware */ + MCFG_CPU_ADD("maincpu", HD38800, 400000) // approximation - RC osc. + +// 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! */ + + /* sound hardware */ + MCFG_SPEAKER_STANDARD_MONO("mono") + MCFG_SOUND_ADD("speaker", SPEAKER_SOUND, 0) + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) +MACHINE_CONFIG_END + + + + + /*************************************************************************** Tomy(tronic) Tron (manufactured in Japan) @@ -718,6 +912,13 @@ ROM_START( cpacmanr1 ) ROM_END +ROM_START( cmspacmn ) + ROM_REGION( 0x2000, "maincpu", ROMREGION_ERASE00 ) + ROM_LOAD( "hd38820a61", 0x0000, 0x1000, CRC(76276318) SHA1(9d6ff3f49b4cdaee5c9e238c1ed638bfb9b99aa7) ) + ROM_CONTINUE( 0x1e80, 0x0100 ) +ROM_END + + ROM_START( egalaxn2 ) ROM_REGION( 0x2000, "maincpu", ROMREGION_ERASE00 ) ROM_LOAD( "hd38820a13", 0x0000, 0x1000, CRC(112b721b) SHA1(4a185bc57ea03fe64f61f7db4da37b16eeb0cb54) ) @@ -739,6 +940,13 @@ ROM_START( pbqbert ) ROM_END +ROM_START( kingman ) + ROM_REGION( 0x2000, "maincpu", ROMREGION_ERASE00 ) + ROM_LOAD( "hd38800b23", 0x0000, 0x1000, CRC(f8dfe14f) SHA1(660610d92ae7e5f92bddf5a3bcc2296b2ec3946b) ) + ROM_CONTINUE( 0x1e80, 0x0100 ) +ROM_END + + ROM_START( tmtron ) ROM_REGION( 0x2000, "maincpu", ROMREGION_ERASE00 ) ROM_LOAD( "hd38800a88", 0x0000, 0x1000, CRC(33db9670) SHA1(d6f747a59356526698784047bcfdbb59e79b9a23) ) @@ -753,14 +961,17 @@ CONS( 1979, bambball, 0, 0, bambball, bambball, driver_device, 0, "Bambi 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, alnattck, 0, 0, alnattck, alnattck, driver_device, 0, "Coleco", "Alien Attack", GAME_SUPPORTS_SAVE | GAME_REQUIRES_ARTWORK | GAME_NOT_WORKING ) +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( 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( 1981, egalaxn2, 0, 0, egalaxn2, egalaxn2, driver_device, 0, "Entex", "Galaxian 2 (Entex)", GAME_SUPPORTS_SAVE | GAME_REQUIRES_ARTWORK | GAME_NOT_WORKING ) -CONS( 1981, epacman2, 0, 0, epacman2, epacman2, driver_device, 0, "Entex", "Pac Man 2 (Entex)", 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 | GAME_NOT_WORKING ) -CONS( 1982, 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 | 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 ) diff --git a/src/mess/drivers/hh_pic16.c b/src/mess/drivers/hh_pic16.c index 260c7fed605..b8281a737e0 100644 --- a/src/mess/drivers/hh_pic16.c +++ b/src/mess/drivers/hh_pic16.c @@ -48,20 +48,20 @@ public: optional_device m_speaker; // misc common - UINT8 m_b; - UINT8 m_c; + UINT8 m_b; // MCU port B data + UINT8 m_c; // MCU port C data virtual void machine_start(); // display common - int m_display_wait; - int m_display_maxy; - int m_display_maxx; + 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]; - UINT32 m_display_cache[0x20]; - UINT8 m_display_decay[0x20][0x20]; - UINT16 m_7seg_mask[0x20]; + 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(); @@ -76,9 +76,9 @@ void hh_pic16_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_cache, ~0, sizeof(m_display_cache)); memset(m_display_decay, 0, sizeof(m_display_decay)); - memset(m_7seg_mask, 0, sizeof(m_7seg_mask)); + memset(m_display_segmask, 0, sizeof(m_display_segmask)); m_b = 0; m_c = 0; @@ -89,9 +89,9 @@ void hh_pic16_state::machine_start() save_item(NAME(m_display_wait)); save_item(NAME(m_display_state)); - save_item(NAME(m_display_cache)); + /* save_item(NAME(m_display_cache)); */ // don't save! save_item(NAME(m_display_decay)); - save_item(NAME(m_7seg_mask)); + save_item(NAME(m_display_segmask)); save_item(NAME(m_b)); save_item(NAME(m_c)); @@ -132,12 +132,20 @@ void hh_pic16_state::display_update() for (int y = 0; y < m_display_maxy; y++) if (m_display_cache[y] != active_state[y]) { - if (m_7seg_mask[y] != 0) - output_set_digit_value(y, active_state[y] & m_7seg_mask[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++) - output_set_lamp_value(y * mul + x, active_state[y] >> x & 1); + { + 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)); @@ -148,7 +156,7 @@ 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++) - if (!(m_display_state[y] >> x & 1) && m_display_decay[y][x] != 0) + if (m_display_decay[y][x] != 0) m_display_decay[y][x]--; display_update(); @@ -199,7 +207,7 @@ WRITE8_MEMBER(hh_pic16_state::maniac_output_w) m_display_maxx = 7; m_display_maxy = 2; - m_7seg_mask[offset] = 0x7f; + m_display_segmask[offset] = 0x7f; m_display_state[offset] = ~data & 0x7f; display_update(); } diff --git a/src/mess/drivers/hh_tms1k.c b/src/mess/drivers/hh_tms1k.c index 28477f781ff..83d83023ef0 100644 --- a/src/mess/drivers/hh_tms1k.c +++ b/src/mess/drivers/hh_tms1k.c @@ -15,14 +15,18 @@ @MP0905B TMS0970 1977, Parker Brothers Codename Sector *MP0168 TMS1000? 1979, Conic Basketball @MP0914 TMS1000 1979, Entex Baseball 1 + @MP0923 TMS1000 1979, Entex Baseball 2 @MP1030 TMS1100 1980, APF Mathemagician + *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 @MP3226 TMS1000 1978, Milton Bradley Simon + *MP3301 TMS1000 1979, Milton Bradley Bigtrak *MP3320A TMS1000 1979, Coleco Head to Head Basketball - MP3403 TMS1100 1978, Marx Electronic Bowling + MP3403 TMS1100 1978, Marx Electronic Bowling -> elecbowl.c @MP3404 TMS1100 1978, Parker Brothers Merlin @MP3405 TMS1100 1979, Coleco Amaze-A-Tron @MP3438A TMS1100 1979, Kenner Star Wars Electronic Battle Command @@ -32,25 +36,25 @@ MP3457 TMS1100 1979, MicroVision cartridge: Mindbuster MP3474 TMS1100 1979, MicroVision cartridge: Vegas Slots MP3475 TMS1100 1979, MicroVision cartridge: Bowling + @MP3476 TMS1100 1979, Milton Bradley Super Simon MP3479 TMS1100 1980, MicroVision cartridge: Baseball MP3481 TMS1100 1979, MicroVision cartridge: Connect Four MP3496 TMS1100 1980, MicroVision cartridge: Sea Duel + M34009 TMS1100 1981, MicroVision cartridge: Alien Raiders (note: MP3498, MP3499, M34000, ..) + M34017 TMS1100 1981, MicroVision cartridge: Cosmic Hunter + M34047 TMS1100 1982, MicroVision cartridge: Super Blockbuster @MP6100A TMS0980 1979, Ideal Electronic Detective @MP6101B TMS0980 1979, Parker Brothers Stop Thief *MP6361 ? 1983, Defender Strikes *MP7303 TMS1400? 19??, Tiger 7-in-1 Sports Stadium @MP7313 TMS1400 1980, Parker Brothers Bank Shot @MP7314 TMS1400 1980, Parker Brothers Split Second - *MP7332 TMS1400 1981, Milton Bradley Dark Tower + MP7332 TMS1400 1981, Milton Bradley Dark Tower -> mbdtower.c @MP7334 TMS1400 1981, Coleco Total Control 4 inconsistent: - M34009 TMS1100 1981, MicroVision cartridge: Alien Raiders - M34017 TMS1100 1981, MicroVision cartridge: Cosmic Hunter - M34047 TMS1100 1982, MicroVision cartridge: Super Blockbuster - - @CD7282SL TMS1100 1981, Tandy-12 (serial is similar to TI Speak & Spell series?) + @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) @@ -67,21 +71,21 @@ ***************************************************************************/ -#include "emu.h" -#include "cpu/tms0980/tms0980.h" -#include "sound/speaker.h" +#include "includes/hh_tms1k.h" // internal artwork #include "amaztron.lh" #include "bankshot.lh" #include "cnsector.lh" #include "ebball.lh" +#include "ebball2.lh" #include "ebball3.lh" #include "elecdet.lh" #include "comp4.lh" #include "mathmagi.lh" #include "merlin.lh" // clickable #include "simon.lh" // clickable +#include "ssimon.lh" #include "splitsec.lh" #include "starwbc.lh" #include "stopthie.lh" @@ -89,133 +93,15 @@ #include "tc4.lh" -class hh_tms1k_state : public driver_device -{ -public: - hh_tms1k_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) - { } - - // devices - required_device m_maincpu; - optional_ioport_array<7> m_inp_matrix; // max 7 - optional_device m_speaker; - - // misc common - UINT16 m_r; - UINT16 m_o; - UINT16 m_inp_mux; - bool m_power_on; - - UINT8 read_inputs(int columns); - DECLARE_INPUT_CHANGED_MEMBER(tms0980_power_button); - DECLARE_WRITE_LINE_MEMBER(tms0980_auto_power_off); - - virtual void machine_start(); - virtual void machine_reset(); - - // display common - int m_display_wait; - int m_display_maxy; - int m_display_maxx; - - UINT32 m_display_state[0x20]; - UINT32 m_display_cache[0x20]; - UINT8 m_display_decay[0x20][0x20]; - UINT16 m_7seg_mask[0x20]; - - TIMER_DEVICE_CALLBACK_MEMBER(display_decay_tick); - void display_update(); - void display_matrix(int maxx, int maxy, UINT32 setx, UINT32 sety); - - // game-specific handlers - void mathmagi_display(); - DECLARE_READ8_MEMBER(mathmagi_read_k); - DECLARE_WRITE16_MEMBER(mathmagi_write_r); - DECLARE_WRITE16_MEMBER(mathmagi_write_o); - - void amaztron_display(); - DECLARE_READ8_MEMBER(amaztron_read_k); - DECLARE_WRITE16_MEMBER(amaztron_write_r); - DECLARE_WRITE16_MEMBER(amaztron_write_o); - - void tc4_display(); - DECLARE_READ8_MEMBER(tc4_read_k); - DECLARE_WRITE16_MEMBER(tc4_write_r); - DECLARE_WRITE16_MEMBER(tc4_write_o); - - void ebball_display(); - DECLARE_READ8_MEMBER(ebball_read_k); - DECLARE_WRITE16_MEMBER(ebball_write_r); - DECLARE_WRITE16_MEMBER(ebball_write_o); - - void ebball3_display(); - DECLARE_READ8_MEMBER(ebball3_read_k); - DECLARE_WRITE16_MEMBER(ebball3_write_r); - DECLARE_WRITE16_MEMBER(ebball3_write_o); - void ebball3_set_clock(); - DECLARE_INPUT_CHANGED_MEMBER(ebball3_difficulty_switch); - DECLARE_MACHINE_RESET(ebball3); - - DECLARE_READ8_MEMBER(elecdet_read_k); - DECLARE_WRITE16_MEMBER(elecdet_write_r); - DECLARE_WRITE16_MEMBER(elecdet_write_o); - - void starwbc_display(); - DECLARE_READ8_MEMBER(starwbc_read_k); - DECLARE_WRITE16_MEMBER(starwbc_write_r); - DECLARE_WRITE16_MEMBER(starwbc_write_o); - - DECLARE_READ8_MEMBER(comp4_read_k); - DECLARE_WRITE16_MEMBER(comp4_write_r); - DECLARE_WRITE16_MEMBER(comp4_write_o); - - DECLARE_READ8_MEMBER(simon_read_k); - DECLARE_WRITE16_MEMBER(simon_write_r); - DECLARE_WRITE16_MEMBER(simon_write_o); - - DECLARE_READ8_MEMBER(cnsector_read_k); - DECLARE_WRITE16_MEMBER(cnsector_write_r); - DECLARE_WRITE16_MEMBER(cnsector_write_o); - - DECLARE_READ8_MEMBER(merlin_read_k); - DECLARE_WRITE16_MEMBER(merlin_write_r); - DECLARE_WRITE16_MEMBER(merlin_write_o); - - DECLARE_READ8_MEMBER(stopthief_read_k); - DECLARE_WRITE16_MEMBER(stopthief_write_r); - DECLARE_WRITE16_MEMBER(stopthief_write_o); - - DECLARE_READ8_MEMBER(bankshot_read_k); - DECLARE_WRITE16_MEMBER(bankshot_write_r); - DECLARE_WRITE16_MEMBER(bankshot_write_o); - - DECLARE_READ8_MEMBER(splitsec_read_k); - DECLARE_WRITE16_MEMBER(splitsec_write_r); - DECLARE_WRITE16_MEMBER(splitsec_write_o); - - void tandy12_display(); - DECLARE_READ8_MEMBER(tandy12_read_k); - DECLARE_WRITE16_MEMBER(tandy12_write_r); - DECLARE_WRITE16_MEMBER(tandy12_write_o); -}; - - // machine_start/reset void hh_tms1k_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_cache, ~0, sizeof(m_display_cache)); memset(m_display_decay, 0, sizeof(m_display_decay)); - memset(m_7seg_mask, 0, sizeof(m_7seg_mask)); + memset(m_display_segmask, 0, sizeof(m_display_segmask)); m_o = 0; m_r = 0; @@ -228,9 +114,9 @@ void hh_tms1k_state::machine_start() save_item(NAME(m_display_wait)); save_item(NAME(m_display_state)); - save_item(NAME(m_display_cache)); + /* save_item(NAME(m_display_cache)); */ // don't save! save_item(NAME(m_display_decay)); - save_item(NAME(m_7seg_mask)); + save_item(NAME(m_display_segmask)); save_item(NAME(m_o)); save_item(NAME(m_r)); @@ -251,19 +137,6 @@ void hh_tms1k_state::machine_reset() ***************************************************************************/ -// LED segments -enum -{ - lA = 0x01, - lB = 0x02, - lC = 0x04, - lD = 0x08, - lE = 0x10, - lF = 0x20, - lG = 0x40, - lDP = 0x80 -}; - // The device may strobe the outputs very fast, it is unnoticeable to the user. // To prevent flickering here, we need to simulate a decay. @@ -291,12 +164,20 @@ void hh_tms1k_state::display_update() for (int y = 0; y < m_display_maxy; y++) if (m_display_cache[y] != active_state[y]) { - if (m_7seg_mask[y] != 0) - output_set_digit_value(y, active_state[y] & m_7seg_mask[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++) - output_set_lamp_value(y * mul + x, active_state[y] >> x & 1); + { + 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)); @@ -307,7 +188,7 @@ 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++) - if (!(m_display_state[y] >> x & 1) && m_display_decay[y][x] != 0) + if (m_display_decay[y][x] != 0) m_display_decay[y][x]--; display_update(); @@ -342,7 +223,7 @@ UINT8 hh_tms1k_state::read_inputs(int columns) // devices with a TMS0980 can auto power-off -WRITE_LINE_MEMBER(hh_tms1k_state::tms0980_auto_power_off) +WRITE_LINE_MEMBER(hh_tms1k_state::auto_power_off) { if (state) { @@ -351,7 +232,7 @@ WRITE_LINE_MEMBER(hh_tms1k_state::tms0980_auto_power_off) } } -INPUT_CHANGED_MEMBER(hh_tms1k_state::tms0980_power_button) +INPUT_CHANGED_MEMBER(hh_tms1k_state::power_button) { m_power_on = (bool)(FPTR)param; m_maincpu->set_input_line(INPUT_LINE_RESET, m_power_on ? CLEAR_LINE : ASSERT_LINE); @@ -395,7 +276,7 @@ void hh_tms1k_state::mathmagi_display() // R0-R7: 7seg leds for (int y = 0; y < 8; y++) { - m_7seg_mask[y] = 0x7f; + m_display_segmask[y] = 0x7f; m_display_state[y] = (m_r >> y & 1) ? (m_o >> 1) : 0; } @@ -408,11 +289,6 @@ void hh_tms1k_state::mathmagi_display() display_update(); } -READ8_MEMBER(hh_tms1k_state::mathmagi_read_k) -{ - return read_inputs(6); -} - WRITE16_MEMBER(hh_tms1k_state::mathmagi_write_r) { // R3,R5-R7,R9,R10: input mux @@ -431,6 +307,11 @@ WRITE16_MEMBER(hh_tms1k_state::mathmagi_write_o) m_o = data; } +READ8_MEMBER(hh_tms1k_state::mathmagi_read_k) +{ + return read_inputs(6); +} + /* physical button layout and labels is like this: @@ -558,7 +439,7 @@ void hh_tms1k_state::amaztron_display() // R8,R9: select digit for (int y = 0; y < 2; y++) { - m_7seg_mask[y] = 0x7f; + m_display_segmask[y] = 0x7f; m_display_state[y] = (m_r >> (y + 8) & 1) ? m_o : 0; } @@ -568,15 +449,6 @@ void hh_tms1k_state::amaztron_display() display_update(); } -READ8_MEMBER(hh_tms1k_state::amaztron_read_k) -{ - UINT8 k = read_inputs(6); - - // the 5th column is tied to K4+K8 - if (k & 0x10) k |= 0xc; - return k & 0xf; -} - WRITE16_MEMBER(hh_tms1k_state::amaztron_write_r) { // R0-R5: input mux @@ -598,6 +470,15 @@ WRITE16_MEMBER(hh_tms1k_state::amaztron_write_o) amaztron_display(); } +READ8_MEMBER(hh_tms1k_state::amaztron_read_k) +{ + UINT8 k = read_inputs(6); + + // the 5th column is tied to K4+K8 + if (k & 0x10) k |= 0xc; + return k & 0xf; +} + static INPUT_PORTS_START( amaztron ) PORT_START("IN.0") // R0 @@ -705,23 +586,12 @@ void hh_tms1k_state::tc4_display() // R5,7,8,9 are 7segs for (int y = 0; y < 10; y++) if (y >= 5 && y <= 9 && y != 6) - m_7seg_mask[y] = 0x7f; + 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); } -READ8_MEMBER(hh_tms1k_state::tc4_read_k) -{ - UINT8 k = read_inputs(6); - - // read from cartridge - if (m_inp_mux & 0x200) - k |= m_inp_matrix[6]->read(); - - return k; -} - WRITE16_MEMBER(hh_tms1k_state::tc4_write_r) { // R10: speaker out @@ -744,6 +614,17 @@ WRITE16_MEMBER(hh_tms1k_state::tc4_write_o) tc4_display(); } +READ8_MEMBER(hh_tms1k_state::tc4_read_k) +{ + UINT8 k = read_inputs(6); + + // read from cartridge + if (m_inp_mux & 0x200) + k |= m_inp_matrix[6]->read(); + + return k; +} + static INPUT_PORTS_START( tc4 ) PORT_START("IN.0") // R0 @@ -848,17 +729,11 @@ MACHINE_CONFIG_END void hh_tms1k_state::ebball_display() { // R8 is a 7seg - m_7seg_mask[8] = 0x7f; + m_display_segmask[8] = 0x7f; display_matrix(7, 9, ~m_o, m_r); } -READ8_MEMBER(hh_tms1k_state::ebball_read_k) -{ - // note: K8(Vss row) is always on - return m_inp_matrix[5]->read() | read_inputs(5); -} - WRITE16_MEMBER(hh_tms1k_state::ebball_write_r) { // R1-R5: input mux @@ -880,6 +755,12 @@ WRITE16_MEMBER(hh_tms1k_state::ebball_write_o) ebball_display(); } +READ8_MEMBER(hh_tms1k_state::ebball_read_k) +{ + // note: K8(Vss row) is always on + return m_inp_matrix[5]->read() | read_inputs(5); +} + static INPUT_PORTS_START( ebball ) PORT_START("IN.0") // R1 @@ -935,17 +816,125 @@ MACHINE_CONFIG_END +/*************************************************************************** + + Entex Electronic Baseball 2 + * boards are labeled: ZENY + * TMS1000 MCU, MP0923 (die labeled MP0923) + + 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 + 03 = lamp17 13 = lamp62 23 = lamp81 33 = lamp40 + 04 = lamp27 14 = lamp70 24 = lamp82 34 = lamp41 + 05 = lamp97 15 = lamp71 25 = lamp83 35 = lamp31 + 06 = lamp90 16 = lamp61 26 = lamp84 36 = lamp30 + 07 = lamp95 17 = lamp72 27 = lamp85 37 = lamp33 + 08 = lamp63 18 = lamp73 28 = lamp42 38 = lamp32 + 09 = lamp91 19 = lamp60 29 = lamp43 + +***************************************************************************/ + +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); +} + +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(); +} + +WRITE16_MEMBER(hh_tms1k_state::ebball2_write_o) +{ + // O0-O7: led row/segment + m_o = data; + ebball2_display(); +} + +READ8_MEMBER(hh_tms1k_state::ebball2_read_k) +{ + return read_inputs(4); +} + + +static INPUT_PORTS_START( ebball2 ) + PORT_START("IN.0") // R3 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_CONFNAME( 0x02, 0x02, "Pitcher" ) + PORT_CONFSETTING( 0x02, "Auto" ) + PORT_CONFSETTING( 0x00, "Manual" ) + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_NAME("P2 Fast Ball") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("P1 Batter") + + PORT_START("IN.1") // R4 + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("P1 Steal") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_NAME("P2 Change Up") + PORT_BIT( 0x09, IP_ACTIVE_HIGH, IPT_UNUSED ) + + PORT_START("IN.2") // R5 + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_PLAYER(2) PORT_NAME("P2 Slider") + PORT_BIT( 0x0b, IP_ACTIVE_HIGH, IPT_UNUSED ) + + PORT_START("IN.3") // R6 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_PLAYER(2) PORT_NAME("P2 Knuckler") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_PLAYER(2) PORT_NAME("P2 Curve") + PORT_BIT( 0x0a, IP_ACTIVE_HIGH, IPT_UNUSED ) +INPUT_PORTS_END + + +static MACHINE_CONFIG_START( ebball2, hh_tms1k_state ) + + /* basic machine hardware */ + MCFG_CPU_ADD("maincpu", TMS1000, 350000) // RC osc. R=47K, C=47pf -> ~350kHz + MCFG_TMS1XXX_READ_K_CB(READ8(hh_tms1k_state, ebball2_read_k)) + MCFG_TMS1XXX_WRITE_R_CB(WRITE16(hh_tms1k_state, ebball2_write_r)) + MCFG_TMS1XXX_WRITE_O_CB(WRITE16(hh_tms1k_state, ebball2_write_o)) + + MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_tms1k_state, display_decay_tick, attotime::from_msec(1)) + MCFG_DEFAULT_LAYOUT(layout_ebball2) + + /* no video! */ + + /* sound hardware */ + MCFG_SPEAKER_STANDARD_MONO("mono") + MCFG_SOUND_ADD("speaker", SPEAKER_SOUND, 0) + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) +MACHINE_CONFIG_END + + + + /*************************************************************************** Entex Electronic Baseball 3 - * boards are labeled: Zeny + * boards are labeled: ZENY * TMS1100NLL 6007 MP1204 (die labeled MP1204) * 2*SN75492N LED display driver This is another improvement over Entex Baseball, where gameplay is a bit more - varied, and it keeps up with score and innings. Like the others, the pitcher - controls are on a separate joypad. + varied. Like the others, the pitcher controls are on a separate joypad. lamp translation table: led zz from game PCB = MESS lampyx: @@ -979,21 +968,16 @@ void hh_tms1k_state::ebball3_display() m_display_state[y] = (m_r >> y & 1) ? m_o : 0; // R0,R1 are normal 7segs - m_7seg_mask[0] = m_7seg_mask[1] = 0x7f; + 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_7seg_mask[10] = m_7seg_mask[11] = 0x22; + m_display_segmask[10] = m_display_segmask[11] = 0x22; display_update(); } -READ8_MEMBER(hh_tms1k_state::ebball3_read_k) -{ - return read_inputs(3); -} - WRITE16_MEMBER(hh_tms1k_state::ebball3_write_r) { // R0-R2: input mux @@ -1015,6 +999,11 @@ WRITE16_MEMBER(hh_tms1k_state::ebball3_write_o) ebball3_display(); } +READ8_MEMBER(hh_tms1k_state::ebball3_read_k) +{ + return read_inputs(3); +} + /* physical button layout and labels is like this: @@ -1113,12 +1102,6 @@ MACHINE_CONFIG_END ***************************************************************************/ -READ8_MEMBER(hh_tms1k_state::elecdet_read_k) -{ - // note: the Vss row is always on - return m_inp_matrix[4]->read() | read_inputs(4); -} - WRITE16_MEMBER(hh_tms1k_state::elecdet_write_r) { // R7,R8: speaker on @@ -1126,7 +1109,7 @@ WRITE16_MEMBER(hh_tms1k_state::elecdet_write_r) // R0-R6: select digit for (int y = 0; y < 7; y++) - m_7seg_mask[y] = 0x7f; + m_display_segmask[y] = 0x7f; display_matrix(7, 7, BITSWAP8(m_o,7,5,2,1,4,0,6,3), data); } @@ -1141,6 +1124,12 @@ WRITE16_MEMBER(hh_tms1k_state::elecdet_write_o) m_o = data; } +READ8_MEMBER(hh_tms1k_state::elecdet_read_k) +{ + // note: the Vss row is always on + return m_inp_matrix[4]->read() | read_inputs(4); +} + /* physical button layout and labels is like this: @@ -1182,11 +1171,11 @@ static INPUT_PORTS_START( elecdet ) // note: even though power buttons are on the matrix, they are not CPU-controlled PORT_START("IN.4") // Vss! - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_PGUP) PORT_NAME("On") PORT_CHANGED_MEMBER(DEVICE_SELF, hh_tms1k_state, tms0980_power_button, (void *)true) + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_PGUP) PORT_NAME("On") PORT_CHANGED_MEMBER(DEVICE_SELF, hh_tms1k_state, power_button, (void *)true) PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_E) PORT_NAME("End Turn") - PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_PGDN) PORT_NAME("Off") PORT_CHANGED_MEMBER(DEVICE_SELF, hh_tms1k_state, tms0980_power_button, (void *)false) + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_PGDN) PORT_NAME("Off") PORT_CHANGED_MEMBER(DEVICE_SELF, hh_tms1k_state, power_button, (void *)false) INPUT_PORTS_END @@ -1197,7 +1186,7 @@ static MACHINE_CONFIG_START( elecdet, hh_tms1k_state ) MCFG_TMS1XXX_READ_K_CB(READ8(hh_tms1k_state, elecdet_read_k)) MCFG_TMS1XXX_WRITE_R_CB(WRITE16(hh_tms1k_state, elecdet_write_r)) MCFG_TMS1XXX_WRITE_O_CB(WRITE16(hh_tms1k_state, elecdet_write_o)) - MCFG_TMS1XXX_POWER_OFF_CB(WRITELINE(hh_tms1k_state, tms0980_auto_power_off)) + MCFG_TMS1XXX_POWER_OFF_CB(WRITELINE(hh_tms1k_state, auto_power_off)) MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_tms1k_state, display_decay_tick, attotime::from_msec(1)) MCFG_DEFAULT_LAYOUT(layout_elecdet) @@ -1228,16 +1217,11 @@ MACHINE_CONFIG_END void hh_tms1k_state::starwbc_display() { // R6,R8 are 7segs - m_7seg_mask[6] = m_7seg_mask[8] = 0x7f; + m_display_segmask[6] = m_display_segmask[8] = 0x7f; display_matrix(8, 10, m_o, m_r); } -READ8_MEMBER(hh_tms1k_state::starwbc_read_k) -{ - return read_inputs(5); -} - WRITE16_MEMBER(hh_tms1k_state::starwbc_write_r) { // R0,R1,R3,R5,R7: input mux @@ -1258,6 +1242,11 @@ WRITE16_MEMBER(hh_tms1k_state::starwbc_write_o) starwbc_display(); } +READ8_MEMBER(hh_tms1k_state::starwbc_read_k) +{ + return read_inputs(5); +} + /* physical button layout and labels is like this: @@ -1339,11 +1328,6 @@ MACHINE_CONFIG_END ***************************************************************************/ -READ8_MEMBER(hh_tms1k_state::comp4_read_k) -{ - return read_inputs(3); -} - WRITE16_MEMBER(hh_tms1k_state::comp4_write_r) { // leds: @@ -1367,6 +1351,11 @@ WRITE16_MEMBER(hh_tms1k_state::comp4_write_o) display_matrix(11, 1, m_r, m_o); } +READ8_MEMBER(hh_tms1k_state::comp4_read_k) +{ + return read_inputs(3); +} + static INPUT_PORTS_START( comp4 ) PORT_START("IN.0") // O1 @@ -1413,20 +1402,16 @@ MACHINE_CONFIG_END Milton Bradley Simon, created by Ralph Baer Revision A hardware: - * TMS1000 (die labeled MP3226), DS75494 lamp driver + * TMS1000 (die labeled MP3226) + * DS75494 lamp driver 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 find an internal ROM. It is possibly a cost-reduced custom ASIC specifically - for Simon. The semi-sequel Super Simon uses a TMS1100. + for Simon. The semi-sequel Super Simon uses a TMS1100 (see next minidriver). ***************************************************************************/ -READ8_MEMBER(hh_tms1k_state::simon_read_k) -{ - return read_inputs(4); -} - WRITE16_MEMBER(hh_tms1k_state::simon_write_r) { // R4-R8 go through an 75494 IC first: @@ -1450,6 +1435,11 @@ WRITE16_MEMBER(hh_tms1k_state::simon_write_o) // N/C } +READ8_MEMBER(hh_tms1k_state::simon_read_k) +{ + return read_inputs(4); +} + static INPUT_PORTS_START( simon ) PORT_START("IN.0") // R0 @@ -1503,10 +1493,61 @@ MACHINE_CONFIG_END +/*************************************************************************** + + Milton Bradley Super Simon + * TMS1100 MP3476NLL (die labeled MP3476) + + x + +***************************************************************************/ + +WRITE16_MEMBER(hh_tms1k_state::ssimon_write_r) +{ +} + +WRITE16_MEMBER(hh_tms1k_state::ssimon_write_o) +{ + // N/C +} + +READ8_MEMBER(hh_tms1k_state::ssimon_read_k) +{ + return 0; +} + + +static INPUT_PORTS_START( ssimon ) +INPUT_PORTS_END + + +static MACHINE_CONFIG_START( ssimon, hh_tms1k_state ) + + /* basic machine hardware */ + MCFG_CPU_ADD("maincpu", TMS1000, 350000) // x + 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)) + + MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_tms1k_state, display_decay_tick, attotime::from_msec(1)) + MCFG_DEFAULT_LAYOUT(layout_ssimon) + + /* no video! */ + + /* sound hardware */ + MCFG_SPEAKER_STANDARD_MONO("mono") + MCFG_SOUND_ADD("speaker", SPEAKER_SOUND, 0) + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) +MACHINE_CONFIG_END + + + + + /*************************************************************************** Parker Brothers Code Name: Sector, by Bob Doyle - * MP0905BNL ZA0379 (die labeled 0970F-05B) + * TMS0970 MCU, MP0905BNL ZA0379 (die labeled 0970F-05B) 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). @@ -1514,11 +1555,6 @@ MACHINE_CONFIG_END ***************************************************************************/ -READ8_MEMBER(hh_tms1k_state::cnsector_read_k) -{ - return read_inputs(5); -} - WRITE16_MEMBER(hh_tms1k_state::cnsector_write_r) { m_display_maxx = 8; @@ -1527,7 +1563,7 @@ WRITE16_MEMBER(hh_tms1k_state::cnsector_write_r) // R0-R5: select digit (right-to-left) for (int y = 0; y < 6; y++) { - m_7seg_mask[y] = 0xff; + m_display_segmask[y] = 0xff; m_display_state[y] = (data >> y & 1) ? m_o : 0; } @@ -1546,6 +1582,11 @@ WRITE16_MEMBER(hh_tms1k_state::cnsector_write_o) m_o = data; } +READ8_MEMBER(hh_tms1k_state::cnsector_read_k) +{ + return read_inputs(5); +} + static INPUT_PORTS_START( cnsector ) PORT_START("IN.0") // O0 @@ -1622,11 +1663,6 @@ MACHINE_CONFIG_END ***************************************************************************/ -READ8_MEMBER(hh_tms1k_state::merlin_read_k) -{ - return read_inputs(4); -} - WRITE16_MEMBER(hh_tms1k_state::merlin_write_r) { /* leds: @@ -1651,6 +1687,11 @@ WRITE16_MEMBER(hh_tms1k_state::merlin_write_o) m_inp_mux = data & 0xf; } +READ8_MEMBER(hh_tms1k_state::merlin_read_k) +{ + return read_inputs(4); +} + static INPUT_PORTS_START( merlin ) PORT_START("IN.0") // O0 @@ -1716,12 +1757,6 @@ MACHINE_CONFIG_END ***************************************************************************/ -READ8_MEMBER(hh_tms1k_state::stopthief_read_k) -{ - // note: the Vss row is always on - return m_inp_matrix[2]->read() | read_inputs(2); -} - WRITE16_MEMBER(hh_tms1k_state::stopthief_write_r) { m_display_maxx = 7; @@ -1731,7 +1766,7 @@ WRITE16_MEMBER(hh_tms1k_state::stopthief_write_r) UINT8 o = BITSWAP8(m_o,3,5,2,1,4,0,6,7) & 0x7f; for (int y = 0; y < m_display_maxy; y++) { - m_7seg_mask[y] = 0x7f; + m_display_segmask[y] = 0x7f; m_display_state[y] = (data >> y & 1) ? o : 0; } @@ -1751,6 +1786,12 @@ WRITE16_MEMBER(hh_tms1k_state::stopthief_write_o) m_o = data; } +READ8_MEMBER(hh_tms1k_state::stopthief_read_k) +{ + // note: the Vss row is always on + return m_inp_matrix[2]->read() | read_inputs(2); +} + /* physical button layout and labels is like this: @@ -1778,11 +1819,11 @@ static INPUT_PORTS_START( stopthief ) // note: even though power buttons are on the matrix, they are not CPU-controlled PORT_START("IN.2") // Vss! - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_PGUP) PORT_NAME("On") PORT_CHANGED_MEMBER(DEVICE_SELF, hh_tms1k_state, tms0980_power_button, (void *)true) + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_PGUP) PORT_NAME("On") PORT_CHANGED_MEMBER(DEVICE_SELF, hh_tms1k_state, power_button, (void *)true) PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_T) PORT_NAME("Tip") PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_A) PORT_NAME("Arrest") PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_C) PORT_NAME("Clue") - PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_PGDN) PORT_NAME("Off") PORT_CHANGED_MEMBER(DEVICE_SELF, hh_tms1k_state, tms0980_power_button, (void *)false) + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_PGDN) PORT_NAME("Off") PORT_CHANGED_MEMBER(DEVICE_SELF, hh_tms1k_state, power_button, (void *)false) INPUT_PORTS_END static MACHINE_CONFIG_START( stopthief, hh_tms1k_state ) @@ -1792,7 +1833,7 @@ static MACHINE_CONFIG_START( stopthief, hh_tms1k_state ) MCFG_TMS1XXX_READ_K_CB(READ8(hh_tms1k_state, stopthief_read_k)) MCFG_TMS1XXX_WRITE_R_CB(WRITE16(hh_tms1k_state, stopthief_write_r)) MCFG_TMS1XXX_WRITE_O_CB(WRITE16(hh_tms1k_state, stopthief_write_o)) - MCFG_TMS1XXX_POWER_OFF_CB(WRITELINE(hh_tms1k_state, tms0980_auto_power_off)) + MCFG_TMS1XXX_POWER_OFF_CB(WRITELINE(hh_tms1k_state, auto_power_off)) MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_tms1k_state, display_decay_tick, attotime::from_msec(1)) MCFG_DEFAULT_LAYOUT(layout_stopthie) @@ -1824,11 +1865,6 @@ MACHINE_CONFIG_END ***************************************************************************/ -READ8_MEMBER(hh_tms1k_state::bankshot_read_k) -{ - return read_inputs(2); -} - WRITE16_MEMBER(hh_tms1k_state::bankshot_write_r) { // R0: speaker out @@ -1850,6 +1886,11 @@ WRITE16_MEMBER(hh_tms1k_state::bankshot_write_o) display_matrix(7, 11, m_o, m_r); } +READ8_MEMBER(hh_tms1k_state::bankshot_read_k) +{ + return read_inputs(2); +} + /* physical button layout and labels is like this: (note: remember that you can rotate the display in MESS) @@ -1931,11 +1972,6 @@ MACHINE_CONFIG_END ***************************************************************************/ -READ8_MEMBER(hh_tms1k_state::splitsec_read_k) -{ - return read_inputs(2); -} - WRITE16_MEMBER(hh_tms1k_state::splitsec_write_r) { // R8: speaker out @@ -1957,6 +1993,12 @@ WRITE16_MEMBER(hh_tms1k_state::splitsec_write_o) display_matrix(7, 8, m_o, m_r); } +READ8_MEMBER(hh_tms1k_state::splitsec_read_k) +{ + return read_inputs(2); +} + + static INPUT_PORTS_START( splitsec ) PORT_START("IN.0") // R9 PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_16WAY // 4 separate directional buttons, hence 16way @@ -1997,7 +2039,7 @@ MACHINE_CONFIG_END /*************************************************************************** Tandy Radio Shack Computerized Arcade (1981, 1982, 1995) - * TMS1100 CD7282SL + * TMS1100 MCU, labeled CD7282SL 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 @@ -2021,11 +2063,6 @@ void hh_tms1k_state::tandy12_display() display_matrix(13, 1, (m_o << 1 & 0x1fe) | (m_r << 9 & 0x1e00), 1); } -READ8_MEMBER(hh_tms1k_state::tandy12_read_k) -{ - return read_inputs(5); -} - WRITE16_MEMBER(hh_tms1k_state::tandy12_write_r) { // R10: speaker out @@ -2045,6 +2082,11 @@ WRITE16_MEMBER(hh_tms1k_state::tandy12_write_o) tandy12_display(); } +READ8_MEMBER(hh_tms1k_state::tandy12_read_k) +{ + return read_inputs(5); +} + /* physical button layout and labels is like this: @@ -2186,6 +2228,17 @@ ROM_START( ebball ) ROM_END +ROM_START( ebball2 ) + ROM_REGION( 0x0400, "maincpu", 0 ) + ROM_LOAD( "mp0923", 0x0000, 0x0400, CRC(077acfe2) SHA1(a294ce7614b2cdb01c754a7a50d60d807e3f0939) ) + + ROM_REGION( 867, "maincpu:mpla", 0 ) + ROM_LOAD( "tms1000_ebball2_mpla.pla", 0, 867, CRC(d33da3cf) SHA1(13c4ebbca227818db75e6db0d45b66ba5e207776) ) + ROM_REGION( 365, "maincpu:opla", 0 ) + ROM_LOAD( "tms1000_ebball2_opla.pla", 0, 365, CRC(adcd73d1) SHA1(d69e590d288ef99293d86716498f3971528e30de) ) +ROM_END + + ROM_START( ebball3 ) ROM_REGION( 0x0800, "maincpu", 0 ) ROM_LOAD( "mp1204", 0x0000, 0x0800, CRC(987a29ba) SHA1(9481ae244152187d85349d1a08e439e798182938) ) @@ -2254,11 +2307,22 @@ ROM_START( simon ) ROM_REGION( 867, "maincpu:mpla", 0 ) ROM_LOAD( "tms1000_simon_mpla.pla", 0, 867, CRC(52f7c1f1) SHA1(dbc2634dcb98eac173ad0209df487cad413d08a5) ) - ROM_REGION( 365, "maincpu:opla", 0 ) + ROM_REGION( 365, "maincpu:opla", 0 ) // unused ROM_LOAD( "tms1000_simon_opla.pla", 0, 365, CRC(2943c71b) SHA1(bd5bb55c57e7ba27e49c645937ec1d4e67506601) ) ROM_END +ROM_START( ssimon ) + ROM_REGION( 0x800, "maincpu", 0 ) + ROM_LOAD( "mp3476", 0x0000, 0x800, CRC(98200571) SHA1(cbd0bcfc11a534aa0be5d011584cdcac58ff437a) ) + + ROM_REGION( 867, "maincpu:mpla", 0 ) + ROM_LOAD( "tms1100_default_mpla.pla", 0, 867, CRC(62445fc9) SHA1(d6297f2a4bc7a870b76cc498d19dbb0ce7d69fec) ) + ROM_REGION( 365, "maincpu:opla", 0 ) // unused + ROM_LOAD( "tms1100_ssimon_opla.pla", 0, 365, CRC(0fea09b0) SHA1(27a56fcf2b490e9a7dbbc6ad48cc8aaca4cada94) ) +ROM_END + + ROM_START( cnsector ) ROM_REGION( 0x0400, "maincpu", 0 ) ROM_LOAD( "mp0905bnl_za0379", 0x0000, 0x0400, CRC(201036e9) SHA1(b37fef86bb2bceaf0ac8bb3745b4702d17366914) ) @@ -2355,21 +2419,26 @@ CONS( 1979, amaztron, 0, 0, amaztron, amaztron, driver_device, 0, "Col CONS( 1981, tc4, 0, 0, tc4, tc4, driver_device, 0, "Coleco", "Total Control 4", GAME_SUPPORTS_SAVE ) CONS( 1979, ebball, 0, 0, ebball, ebball, driver_device, 0, "Entex", "Electronic Baseball (Entex)", GAME_SUPPORTS_SAVE ) +CONS( 1979, ebball2, 0, 0, ebball2, ebball2, driver_device, 0, "Entex", "Electronic Baseball 2 (Entex)", GAME_SUPPORTS_SAVE ) CONS( 1980, ebball3, 0, 0, ebball3, ebball3, driver_device, 0, "Entex", "Electronic Baseball 3 (Entex)", GAME_SUPPORTS_SAVE ) -CONS( 1979, elecdet, 0, 0, elecdet, elecdet, driver_device, 0, "Ideal", "Electronic Detective", GAME_SUPPORTS_SAVE ) // unplayable without game cards +CONS( 1979, elecdet, 0, 0, elecdet, elecdet, driver_device, 0, "Ideal", "Electronic Detective", GAME_SUPPORTS_SAVE ) // *** 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 ) 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( 1977, cnsector, 0, 0, cnsector, cnsector, driver_device, 0, "Parker Brothers", "Code Name: Sector", GAME_SUPPORTS_SAVE | GAME_NO_SOUND_HW ) // unplayable without writing board +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 ) -CONS( 1979, stopthie, 0, 0, stopthief, stopthief, driver_device, 0, "Parker Brothers", "Stop Thief (Electronic Crime Scanner)", GAME_SUPPORTS_SAVE ) // unplayable without game board +CONS( 1979, stopthie, 0, 0, stopthief, stopthief, driver_device, 0, "Parker Brothers", "Stop Thief (Electronic Crime Scanner)", GAME_SUPPORTS_SAVE ) // *** CONS( 1979, stopthiep, stopthie, 0, stopthief, stopthief, driver_device, 0, "Parker Brothers", "Stop Thief (Electronic Crime Scanner) (prototype)", GAME_SUPPORTS_SAVE | GAME_NOT_WORKING ) CONS( 1980, bankshot, 0, 0, bankshot, bankshot, driver_device, 0, "Parker Brothers", "Bank Shot - Electronic Pool", GAME_SUPPORTS_SAVE ) CONS( 1980, splitsec, 0, 0, splitsec, splitsec, driver_device, 0, "Parker Brothers", "Split Second", GAME_SUPPORTS_SAVE ) -CONS( 1981, tandy12, 0, 0, tandy12, tandy12, driver_device, 0, "Tandy Radio Shack", "Tandy-12: Computerized Arcade", GAME_SUPPORTS_SAVE ) // partially unplayable without cards/dice/.. +CONS( 1981, tandy12, 0, 0, tandy12, tandy12, driver_device, 0, "Tandy Radio Shack", "Tandy-12: Computerized Arcade", GAME_SUPPORTS_SAVE ) // some of the minigames: *** + +// ***: As far as MESS is concerned, the game is emulated fine. But for it to be playable, it requires interaction +// with other, unemulatable, things eg. game board/pieces, playing cards, pen & paper, etc. diff --git a/src/mess/drivers/hh_ucom4.c b/src/mess/drivers/hh_ucom4.c index 4f72e9e36f9..b258c942942 100644 --- a/src/mess/drivers/hh_ucom4.c +++ b/src/mess/drivers/hh_ucom4.c @@ -17,10 +17,11 @@ *102 uPD553C 1981, Bandai Block Out *127 uPD650C 198? Sony OA-S1100 Typecorder (subcpu, have dump) *128 uPD650C 1982, Roland TR-606 - 133 uPD650C 1982, Roland TB-303 + 133 uPD650C 1982, Roland TB-303 -> tb303.c @160 uPD553C 1982, Tomy Pac Man (TN-08) - *202 uPD553C 1982, Epoch Astro Command + @202 uPD553C 1982, Epoch Astro Command @206 uPD553C 1982, Epoch Dracula + *209 uPD553C 1982, Tomy Caveman (TN-12) @258 uPD553C 1984, Tomy Alien Chase (TN-16) (* denotes not yet emulated by MESS, @ denotes it's in this driver) @@ -53,25 +54,25 @@ public: optional_device m_speaker; // misc common - UINT8 m_port[9]; - UINT16 m_inp_mux; + UINT8 m_port[9]; // MCU port A-I write data + UINT16 m_inp_mux; // multiplexed inputs mask UINT8 read_inputs(int columns); virtual void machine_start(); // display common - int m_display_wait; - int m_display_maxy; - int m_display_maxx; + 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; - UINT32 m_plate; + UINT32 m_grid; // VFD current row data + UINT32 m_plate; // VFD current column data - UINT32 m_display_state[0x20]; - UINT32 m_display_cache[0x20]; - UINT8 m_display_decay[0x20][0x20]; - UINT16 m_7seg_mask[0x20]; + 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(); @@ -79,22 +80,26 @@ public: // game-specific handlers void ssfball_display(); - DECLARE_READ8_MEMBER(ssfball_input_b_r); DECLARE_WRITE8_MEMBER(ssfball_grid_w); DECLARE_WRITE8_MEMBER(ssfball_plate_w); + DECLARE_READ8_MEMBER(ssfball_input_b_r); void splasfgt_display(); - DECLARE_READ8_MEMBER(splasfgt_input_b_r); DECLARE_WRITE8_MEMBER(splasfgt_grid_w); DECLARE_WRITE8_MEMBER(splasfgt_plate_w); + DECLARE_READ8_MEMBER(splasfgt_input_b_r); + + void astrocmd_display(); + DECLARE_WRITE8_MEMBER(astrocmd_grid_w); + DECLARE_WRITE8_MEMBER(astrocmd_plate_w); DECLARE_WRITE8_MEMBER(edracula_grid_w); DECLARE_WRITE8_MEMBER(edracula_plate_w); - DECLARE_READ8_MEMBER(tmtennis_input_r); DECLARE_WRITE8_MEMBER(tmtennis_grid_w); DECLARE_WRITE8_MEMBER(tmtennis_plate_w); DECLARE_WRITE8_MEMBER(tmtennis_port_e_w); + DECLARE_READ8_MEMBER(tmtennis_input_r); void tmtennis_set_clock(); DECLARE_INPUT_CHANGED_MEMBER(tmtennis_difficulty_switch); DECLARE_MACHINE_RESET(tmtennis); @@ -103,8 +108,8 @@ public: DECLARE_WRITE8_MEMBER(tmpacman_grid_w); DECLARE_WRITE8_MEMBER(tmpacman_plate_w); - DECLARE_READ8_MEMBER(alnchase_input_r); DECLARE_WRITE8_MEMBER(alnchase_output_w); + DECLARE_READ8_MEMBER(alnchase_input_r); }; @@ -112,9 +117,9 @@ void hh_ucom4_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_cache, ~0, sizeof(m_display_cache)); memset(m_display_decay, 0, sizeof(m_display_decay)); - memset(m_7seg_mask, 0, sizeof(m_7seg_mask)); + memset(m_display_segmask, 0, sizeof(m_display_segmask)); memset(m_port, 0, sizeof(m_port)); m_inp_mux = 0; @@ -127,9 +132,9 @@ void hh_ucom4_state::machine_start() save_item(NAME(m_display_wait)); save_item(NAME(m_display_state)); - save_item(NAME(m_display_cache)); + /* save_item(NAME(m_display_cache)); */ // don't save! save_item(NAME(m_display_decay)); - save_item(NAME(m_7seg_mask)); + save_item(NAME(m_display_segmask)); save_item(NAME(m_port)); save_item(NAME(m_inp_mux)); @@ -172,12 +177,20 @@ void hh_ucom4_state::display_update() for (int y = 0; y < m_display_maxy; y++) if (m_display_cache[y] != active_state[y]) { - if (m_7seg_mask[y] != 0) - output_set_digit_value(y, active_state[y] & m_7seg_mask[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++) - output_set_lamp_value(y * mul + x, active_state[y] >> x & 1); + { + 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)); @@ -188,7 +201,7 @@ 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++) - if (!(m_display_state[y] >> x & 1) && m_display_decay[y][x] != 0) + if (m_display_decay[y][x] != 0) m_display_decay[y][x]--; display_update(); @@ -249,12 +262,6 @@ void hh_ucom4_state::ssfball_display() display_matrix(16, 9, plate, m_grid); } -READ8_MEMBER(hh_ucom4_state::ssfball_input_b_r) -{ - // B: input port 2, where B3 is multiplexed - return m_inp_matrix[2]->read() | read_inputs(2); -} - WRITE8_MEMBER(hh_ucom4_state::ssfball_grid_w) { // C,D(,E): vfd matrix grid 0-7(,8) @@ -283,6 +290,12 @@ WRITE8_MEMBER(hh_ucom4_state::ssfball_plate_w) ssfball_display(); } +READ8_MEMBER(hh_ucom4_state::ssfball_input_b_r) +{ + // B: input port 2, where B3 is multiplexed + return m_inp_matrix[2]->read() | read_inputs(2); +} + static INPUT_PORTS_START( ssfball ) PORT_START("IN.0") // F3 port B3 @@ -346,7 +359,7 @@ MACHINE_CONFIG_END Bambino Space Laser Fight (manufactured in Japan) * PCB label Emix Corp. ET-12 * NEC uCOM-43 MCU, labeled D553C 055 - * blue VFD display Emix-104 (some versions had a green display) + * cyan VFD display Emix-104, with color overlay (blue or green overlay, depending on region) NOTE!: MESS external artwork is recommended @@ -358,12 +371,6 @@ void hh_ucom4_state::splasfgt_display() display_matrix(16, 9, plate, m_grid); } -READ8_MEMBER(hh_ucom4_state::splasfgt_input_b_r) -{ - // B: multiplexed buttons - return read_inputs(4); -} - WRITE8_MEMBER(hh_ucom4_state::splasfgt_grid_w) { // G,H,I0: vfd matrix grid @@ -393,6 +400,12 @@ WRITE8_MEMBER(hh_ucom4_state::splasfgt_plate_w) ssfball_display(); } +READ8_MEMBER(hh_ucom4_state::splasfgt_input_b_r) +{ + // B: multiplexed buttons + return read_inputs(4); +} + /* physical button layout and labels is like this: @@ -474,6 +487,102 @@ MACHINE_CONFIG_END +/*************************************************************************** + + Epoch Astro Command (manufactured in Japan) + * PCB label 96111 + * NEC uCOM-43 MCU, labeled D553C 202 + * cyan/red VFD display NEC FIP9AM20T NO.42, with color overlay + + known releases: + - Japan: Astro Command + - USA: Astro Command, published by Tandy + - UK: Scramble, published by Grandstand + + NOTE!: MESS external artwork is recommended + +***************************************************************************/ + +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); + 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); +} + +WRITE8_MEMBER(hh_ucom4_state::astrocmd_grid_w) +{ + // C,D(,E3): vfd matrix grid + int shift = (offset - NEC_UCOM4_PORTC) * 4; + m_grid = (m_grid & ~(0xf << shift)) | (data << shift); + + astrocmd_display(); +} + +WRITE8_MEMBER(hh_ucom4_state::astrocmd_plate_w) +{ + // E01,F,G,H,I: vfd matrix plate + int shift = (offset - NEC_UCOM4_PORTE) * 4; + m_plate = (m_plate & ~(0xf << shift)) | (data << shift); + + if (offset == NEC_UCOM4_PORTE) + { + // E2: speaker out + m_speaker->level_w(data >> 2 & 1); + + // E3: vfd matrix grid 8 + astrocmd_grid_w(space, offset, data >> 3 & 1); + } + else + astrocmd_display(); +} + + +static INPUT_PORTS_START( astrocmd ) + PORT_START("IN.0") // port A + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SELECT ) + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START ) + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("Missile") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("Bomb") + + PORT_START("IN.1") // port B + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) +INPUT_PORTS_END + + +static MACHINE_CONFIG_START( astrocmd, hh_ucom4_state ) + + /* basic machine hardware */ + MCFG_CPU_ADD("maincpu", NEC_D553, XTAL_400kHz) + MCFG_UCOM4_READ_A_CB(IOPORT("IN.0")) + MCFG_UCOM4_READ_B_CB(IOPORT("IN.1")) + MCFG_UCOM4_WRITE_C_CB(WRITE8(hh_ucom4_state, astrocmd_grid_w)) + MCFG_UCOM4_WRITE_D_CB(WRITE8(hh_ucom4_state, astrocmd_grid_w)) + MCFG_UCOM4_WRITE_E_CB(WRITE8(hh_ucom4_state, astrocmd_plate_w)) + MCFG_UCOM4_WRITE_F_CB(WRITE8(hh_ucom4_state, astrocmd_plate_w)) + MCFG_UCOM4_WRITE_G_CB(WRITE8(hh_ucom4_state, astrocmd_plate_w)) + MCFG_UCOM4_WRITE_H_CB(WRITE8(hh_ucom4_state, astrocmd_plate_w)) + MCFG_UCOM4_WRITE_I_CB(WRITE8(hh_ucom4_state, astrocmd_plate_w)) + + MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_ucom4_state, display_decay_tick, attotime::from_msec(1)) + MCFG_DEFAULT_LAYOUT(layout_hh_ucom4_test) + + /* no video! */ + + /* sound hardware */ + MCFG_SPEAKER_STANDARD_MONO("mono") + MCFG_SOUND_ADD("speaker", SPEAKER_SOUND, 0) + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) +MACHINE_CONFIG_END + + + + + /*************************************************************************** Epoch Dracula (manufactured in Japan) @@ -574,12 +683,6 @@ MACHINE_CONFIG_END ***************************************************************************/ -READ8_MEMBER(hh_ucom4_state::tmtennis_input_r) -{ - // A,B: multiplexed buttons - return ~read_inputs(2) >> (offset*4); -} - WRITE8_MEMBER(hh_ucom4_state::tmtennis_grid_w) { // G,H,I: vfd matrix grid @@ -608,6 +711,12 @@ WRITE8_MEMBER(hh_ucom4_state::tmtennis_port_e_w) m_speaker->level_w(data >> 2 & 1); } +READ8_MEMBER(hh_ucom4_state::tmtennis_input_r) +{ + // A,B: multiplexed buttons + return ~read_inputs(2) >> (offset*4); +} + /* Pro-Tennis physical button layout and labels is like this: @@ -719,7 +828,7 @@ MACHINE_CONFIG_END void hh_ucom4_state::tmpacman_display() { - UINT8 grid = BITSWAP8((UINT8)m_grid,0,1,2,3,4,5,6,7); + UINT32 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 @@ -750,10 +859,10 @@ WRITE8_MEMBER(hh_ucom4_state::tmpacman_plate_w) static INPUT_PORTS_START( tmpacman ) PORT_START("IN.0") // port A - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_16WAY // 4 separate directional buttons, hence 16way - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_16WAY - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_16WAY - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_16WAY + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_16WAY // separate directional buttons, hence 16way + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_16WAY // " + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_16WAY // " + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_16WAY // " PORT_START("IN.1") // port B PORT_CONFNAME( 0x01, 0x00, DEF_STR( Difficulty ) ) @@ -810,12 +919,6 @@ MACHINE_CONFIG_END ***************************************************************************/ -READ8_MEMBER(hh_ucom4_state::alnchase_input_r) -{ - // A: buttons - return read_inputs(2); -} - WRITE8_MEMBER(hh_ucom4_state::alnchase_output_w) { if (offset <= NEC_UCOM4_PORTE) @@ -843,6 +946,12 @@ WRITE8_MEMBER(hh_ucom4_state::alnchase_output_w) display_matrix(17, 9, m_plate, m_grid); } +READ8_MEMBER(hh_ucom4_state::alnchase_input_r) +{ + // A: buttons + return read_inputs(2); +} + /* physical button layout and labels is like this: @@ -867,9 +976,9 @@ static INPUT_PORTS_START( alnchase ) PORT_START("IN.1") // D0 port A PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2) // on non-mirrored view, swap P2 left/right - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2) // " - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2) - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(2) + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2) // " + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2) + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(2) PORT_START("IN.2") // port B PORT_CONFNAME( 0x01, 0x01, "Players" ) @@ -929,9 +1038,15 @@ ROM_START( splasfgt ) ROM_END +ROM_START( astrocmd ) + ROM_REGION( 0x0800, "maincpu", 0 ) + ROM_LOAD( "d553c-202.s01", 0x0000, 0x0800, CRC(b4b34883) SHA1(6246d561c2df1f2124575d2ca671ef85b1819edd) ) +ROM_END + + ROM_START( edracula ) ROM_REGION( 0x0800, "maincpu", 0 ) - ROM_LOAD( "d553c-206", 0x0000, 0x0800, CRC(b524857b) SHA1(c1c89ed5dd4bb1e6e98462dc8fa5af2aa48d8ede) ) + ROM_LOAD( "d553c-206.s01", 0x0000, 0x0800, CRC(b524857b) SHA1(c1c89ed5dd4bb1e6e98462dc8fa5af2aa48d8ede) ) ROM_END @@ -958,6 +1073,7 @@ ROM_END CONS( 1979, ssfball, 0, 0, ssfball, ssfball, driver_device, 0, "Bambino", "Superstar Football", GAME_SUPPORTS_SAVE | GAME_REQUIRES_ARTWORK ) CONS( 1980, splasfgt, 0, 0, splasfgt, splasfgt, driver_device, 0, "Bambino", "Space Laser Fight", GAME_SUPPORTS_SAVE | GAME_REQUIRES_ARTWORK ) +CONS( 1982, astrocmd, 0, 0, astrocmd, astrocmd, driver_device, 0, "Epoch", "Astro Command", GAME_SUPPORTS_SAVE | GAME_REQUIRES_ARTWORK ) CONS( 1982, edracula, 0, 0, edracula, edracula, driver_device, 0, "Epoch", "Dracula (Epoch)", GAME_SUPPORTS_SAVE | GAME_REQUIRES_ARTWORK ) CONS( 1980, tmtennis, 0, 0, tmtennis, tmtennis, driver_device, 0, "Tomy", "Tennis (Tomy)", GAME_SUPPORTS_SAVE | GAME_REQUIRES_ARTWORK ) diff --git a/src/mess/drivers/imds2.c b/src/mess/drivers/imds2.c new file mode 100644 index 00000000000..cf192dd63e8 --- /dev/null +++ b/src/mess/drivers/imds2.c @@ -0,0 +1,739 @@ +// license:MAME +// copyright-holders:fulivi +// +// *************************************** +// Driver for Intel Intellec MDS series-II +// *************************************** +// +// Documentation used for this driver: +// [1] Intel, manual 9800554-04 rev. D - Intellec series II MDS - Schematic drawings +// [2] Intel, manual 9800556-02 rev. B - Intellec series II MDS - Hardware reference manual +// [3] Intel, manual 9800555-02 rev. B - Intellec series II MDS - Hardware interface manual +// [4] Intel, manual 9800605-02 rev. B - Intellec series II MDS - Boot/monitor listing +// +// All these manuals are available on http://www.bitsavers.org +// +// An Intellec MDS series-II is composed of the following boards: +// +// ********** +// Integrated Processor Card (IPC) or Integrated Processor Board (IPB) +// +// This is the board where the OS (ISIS-II) and the application software run. +// This driver emulates an IPC. +// IPC is composed as follows: +// A83 8085A-2 CPU @ 4 MHz +// 64k of DRAM +// A82 2732 EPROM with monitor & boot firmware (assembly source of this ROM is in [4]) +// A66 8259A System PIC +// A89 8259A Local PIC +//*A86 8253 PIT +//*A91 8251A Serial channel #0 +//*A90 8251A Serial channel #1 +// +// ********** +// I/O Controller (IOC) +// +// This board acts as a controller for all I/O of the system. +// It is structured as if it were 2 boards in one: +// One part (around 8080) controls Keyboard, CRT & floppy, the other part (around PIO 8741) controls all parallel I/Os +// (Line printer, Paper tape puncher, Paper tape reader, I/O to PROM programmer). +// Both parts are interfaced to IPC through a bidirectional 8-bit bus. +// IOC is composed of these parts: +// A69 8080A-2 CPU @ 2.448 MHz +// 8k of DRAM +// A50 2716 +// A51 2716 +// A52 2716 +// A53 2716 EPROMs with IOC firmware +// A58 8257 DMA controller +// A35 8253 PIT +// A1 8271 Floppy controller +// A20 8275 CRT controller +// A19 2708 Character generator ROM +// LS1 3.3 kHz beeper +//*A72 8741-4 CPU @ 6 MHz (PIO: parallel I/O) +// +// ********** +// Keyboard controller +// +// Keyboard is controlled by a 8741 CPU that scans the key matrix and sends key codes to IOC through a 8-bit bus. +// +// A3 8741 CPU @ 3.58 MHz +// +// ICs that are not emulated yet are marked with "*" +// +// TODO: +// - Improve keyboard mapping +// - Emulate PIO. No known dumps of its ROM are available, though. +// - Emulate line printer output on PIO +// - Emulate serial channels on IPC +// - Emulate PIT on IPC +// - Adjust speed of processors. Wait states are not accounted for yet. +// +// 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) + +#include "includes/imds2.h" + +// CPU oscillator of IPC board: 8 MHz +#define IPC_XTAL_Y2 XTAL_8MHz + +// Main oscillator of IOC board: 22.032 MHz +#define IOC_XTAL_Y2 22032000 + +// FDC oscillator of IOC board: 8 MHz +#define IOC_XTAL_Y1 XTAL_8MHz + +// Frequency of beeper +#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) +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_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 +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); +// 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) +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) +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") +{ +} + +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 ]; + } +} + +WRITE8_MEMBER(imds2_state::ipc_mem_write) +{ + 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)); + + 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)); +} + +READ8_MEMBER(imds2_state::imds2_ipcsyspic_r) +{ + return m_ipcsyspic->read(space , offset == 0); +} + +READ8_MEMBER(imds2_state::imds2_ipclocpic_r) +{ + return m_ipclocpic->read(space , offset == 0); +} + +WRITE8_MEMBER(imds2_state::imds2_ipcsyspic_w) +{ + m_ipcsyspic->write(space , offset == 0 , data); +} + +WRITE8_MEMBER(imds2_state::imds2_ipclocpic_w) +{ + 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)); +} + +READ8_MEMBER(imds2_state::imds2_miscin_r) +{ + 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(); +} + +WRITE8_MEMBER(imds2_state::imds2_start_timer_w) +{ + // 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); +} + +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; + } +} + +WRITE8_MEMBER(imds2_state::imds2_kb_port_p1_w) +{ + 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; +} + +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; +} + +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); +} + +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); +} + +WRITE8_MEMBER(imds2_state::imds2_ioc_set_f1_w) +{ + // 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; +} + +READ8_MEMBER(imds2_state::imds2_ioc_status_r) +{ + 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; +} + +READ8_MEMBER(imds2_state::imds2_ipc_dbbout_r) +{ + // 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; +} + +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; +} + +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; +} + +WRITE_LINE_MEMBER(imds2_state::imds2_hrq_w) +{ + // 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); +} + +WRITE8_MEMBER(imds2_state::imds2_ioc_mem_w) +{ + 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 ]; + } +} + +void imds2_state::driver_start() +{ + // 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(); + } +} + +void imds2_state::machine_start() +{ + 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(); +} + +void imds2_state::machine_reset() +{ + 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; + + // 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 f800-ffff is always in ROM + if (masked_offset == 0xf800) { + return true; + } + + return false; +} + +void imds2_state::imds2_update_beeper(void) +{ + 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") +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_END + +static LEGACY_FLOPPY_OPTIONS_START(imds2) +LEGACY_FLOPPY_OPTIONS_END + +static const floppy_interface imds2_floppy_interface = +{ + 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)) +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_END + +/* YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY FULLNAME */ +COMP( 1979, imds2, 0, 0, imds2, imds2, driver_device, 0, "Intel", "Intellec MDS-II" , 0) diff --git a/src/mess/drivers/m24.c b/src/mess/drivers/m24.c index ff388e6a1b2..b29edcf54ae 100644 --- a/src/mess/drivers/m24.c +++ b/src/mess/drivers/m24.c @@ -4,7 +4,7 @@ #include "cpu/tms7000/tms7000.h" #include "bus/isa/isa.h" #include "bus/isa/isa_cards.h" -#include "machine/pckeybrd.h" +#include "machine/m24_kbd.h" #include "machine/mm58274c.h" #include "includes/genpc.h" @@ -15,11 +15,13 @@ public: driver_device(mconfig, type, tag), m_maincpu(*this, "maincpu"), m_mb(*this, "mb"), - m_kbc(*this, "kbc") + m_kbc(*this, "kbc"), + m_keyboard(*this, "keyboard") { } required_device m_maincpu; required_device m_mb; required_device m_kbc; + required_device m_keyboard; DECLARE_READ8_MEMBER(keyboard_r); DECLARE_WRITE8_MEMBER(keyboard_w); @@ -27,19 +29,30 @@ public: DECLARE_WRITE8_MEMBER(pb_w); DECLARE_READ8_MEMBER(kbcdata_r); DECLARE_WRITE8_MEMBER(kbcdata_w); + DECLARE_WRITE_LINE_MEMBER(kbcin_w); - UINT8 m_sysctl, m_pa, m_kbcdata; - bool m_kbcibf; + void machine_reset(); + + UINT8 m_sysctl, m_pa, m_kbcin, m_kbcout; + bool m_kbcibf, m_kbdata; }; +void m24_state::machine_reset() +{ + m_sysctl = 0; + m_pa = 0x40; + m_kbcibf = false; + m_kbdata = true; +} + READ8_MEMBER(m24_state::keyboard_r) { switch(offset) { case 0: - m_pa &= ~0x40; + m_pa |= 0x40; m_mb->m_pic8259->ir1_w(0); - return m_kbcdata; + return m_kbcout; case 1: return m_sysctl; case 2: @@ -57,41 +70,49 @@ WRITE8_MEMBER(m24_state::keyboard_w) case 0: m_kbc->set_input_line(TMS7000_INT1_LINE, ASSERT_LINE); m_kbcibf = true; - m_kbcdata = data; + m_kbcin = data; break; case 1: m_sysctl = data; m_mb->m_pit8253->write_gate2(BIT(data, 0)); m_mb->pc_speaker_set_spkrdata(BIT(data, 1)); if(BIT(data, 6)) - m_pa |= 2; + m_pa |= 4; else - m_pa &= ~2; + m_pa &= ~4; break; } } READ8_MEMBER(m24_state::pa_r) { - return m_pa; + return m_pa & (m_kbdata ? 0xff : 0xfd); } WRITE8_MEMBER(m24_state::pb_w) { + m_keyboard->clock_w(!BIT(data, 0)); + m_keyboard->data_w(!BIT(data, 1)); + m_pa = (m_pa & ~3) | (~data & 3); } READ8_MEMBER(m24_state::kbcdata_r) { m_kbc->set_input_line(TMS7000_INT1_LINE, CLEAR_LINE); m_kbcibf = false; - return m_kbcdata; + return m_kbcin; } WRITE8_MEMBER(m24_state::kbcdata_w) { - m_pa |= 0x40; + m_pa &= ~0x40; m_mb->m_pic8259->ir1_w(1); - m_kbcdata = data; + m_kbcout = data; +} + +WRITE_LINE_MEMBER(m24_state::kbcin_w) +{ + m_kbdata = state; } static ADDRESS_MAP_START( m24_map, AS_PROGRAM, 16, m24_state ) @@ -159,8 +180,6 @@ static INPUT_PORTS_START( m24 ) PORT_DIPSETTING( 0x4000, "2" ) PORT_DIPSETTING( 0x8000, "3" ) PORT_DIPSETTING( 0xc000, "4" ) - - PORT_INCLUDE(pc_keyboard) INPUT_PORTS_END static MACHINE_CONFIG_START( olivetti, m24_state ) @@ -185,6 +204,9 @@ static MACHINE_CONFIG_START( olivetti, m24_state ) MCFG_CPU_PROGRAM_MAP(kbc_map) MCFG_CPU_IO_MAP(kbc_io) + MCFG_DEVICE_ADD("keyboard", M24_KEYBOARD, 0) + MCFG_M24_KEYBOARD_OUT_DATA_HANDLER(WRITELINE(m24_state, kbcin_w)) + MCFG_DEVICE_ADD("mm58174an", MM58274C, 0) MCFG_MM58274C_MODE24(1) // ? MCFG_MM58274C_DAY1(1) // ? @@ -199,7 +221,7 @@ ROM_START( m24 ) ROMX_LOAD("olivetti_m24_version_1.43_low.bin", 0x4000, 0x2000, CRC(ff7e0f10) SHA1(13423011a9bae3f3193e8c199f98a496cab48c0f), ROM_SKIP(1)) ROM_REGION(0x800, "kbc", 0) - ROM_LOAD("PDBD.tms2516.KeyboardMCUReplacementDaughterboard_10U", 0x000, 0x800, CRC(b8c4c18a) SHA1(25b4c24e19ff91924c53557c66513ab242d926c6)) + ROM_LOAD("pdbd.tms2516.keyboardmcureplacementdaughterboard_10u", 0x000, 0x800, CRC(b8c4c18a) SHA1(25b4c24e19ff91924c53557c66513ab242d926c6)) ROM_END ROM_START( m240 ) @@ -209,7 +231,7 @@ ROM_START( m240 ) // is this one the same? ROM_REGION(0x800, "kbc", 0) - ROM_LOAD("PDBD.tms2516.KeyboardMCUReplacementDaughterboard_10U", 0x000, 0x800, BAD_DUMP CRC(b8c4c18a) SHA1(25b4c24e19ff91924c53557c66513ab242d926c6)) + ROM_LOAD("pdbd.tms2516.keyboardmcureplacementdaughterboard_10u", 0x000, 0x800, BAD_DUMP CRC(b8c4c18a) SHA1(25b4c24e19ff91924c53557c66513ab242d926c6)) ROM_END COMP( 1983, m24, ibm5150, 0, olivetti, m24, driver_device, 0, "Olivetti", "M24", GAME_NOT_WORKING) diff --git a/src/mess/drivers/mbdtower.c b/src/mess/drivers/mbdtower.c new file mode 100644 index 00000000000..802db8e59dd --- /dev/null +++ b/src/mess/drivers/mbdtower.c @@ -0,0 +1,284 @@ +// license:BSD-3-Clause +// copyright-holders:hap, Sean Riddle +/*************************************************************************** + + ** subclass of hh_tms1k_state (includes/hh_tms1k.h, drivers/hh_tms1k.c) ** + + Milton Bradley Dark Tower + * TMS1400NLL MP7332-N1.U1(Rev. B) or MP7332-N2LL(Rev. C), die labeled MP7332 + (assume same ROM contents between revisions) + * SN75494N MOS-to-LED digit driver + * rotating reel + lightsensor + + This is a board game, it obviously requires game pieces and the board. + 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. + +***************************************************************************/ + +#include "includes/hh_tms1k.h" +#include "mbdtower.lh" + + +class mbdtower_state : public hh_tms1k_state +{ +public: + mbdtower_state(const machine_config &mconfig, device_type type, const char *tag) + : hh_tms1k_state(mconfig, type, tag) + { } + + void mbdtower_display(); + bool sensor_led_on() { return m_display_decay[0][0] != 0; } + + int m_motor_pos; + int m_motor_pos_prev; + int m_motor_decay; + bool m_motor_on; + bool m_sensor_blind; + + TIMER_DEVICE_CALLBACK_MEMBER(motor_sim_tick); + + DECLARE_WRITE16_MEMBER(write_r); + DECLARE_WRITE16_MEMBER(write_o); + DECLARE_READ8_MEMBER(read_k); + +protected: + virtual void machine_start(); +}; + + +/*************************************************************************** + + Display, Motor + +***************************************************************************/ + +void mbdtower_state::mbdtower_display() +{ + // declare display matrix size and the 2 7segs + m_display_maxx = 7; + m_display_maxy = 3; + m_display_segmask[1] = m_display_segmask[2] = 0x7f; + + // update current state + if (~m_r & 0x10) + { + UINT8 o = BITSWAP8(m_o,7,0,4,3,2,1,6,5) & 0x7f; + m_display_state[2] = (m_o & 0x80) ? o : 0; + m_display_state[1] = (m_o & 0x80) ? 0 : o; + m_display_state[0] = (m_r >> 8 & 1) | (m_r >> 4 & 0xe); + + display_update(); + } + else + { + // display items turned off + display_matrix(7, 3, 0, 0); + } +} + + +TIMER_DEVICE_CALLBACK_MEMBER(mbdtower_state::motor_sim_tick) +{ + // it rotates counter-clockwise (when viewed from above) + 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); + else if (m_motor_decay > 0) + m_motor_decay--; + else + m_motor_on = false; + } + + // 8 evenly spaced holes in the rotation disc for the sensor to 'see' through. + // The first hole is much bigger, enabling the game to determine the position. + if ((m_motor_pos & 0xf) < 4 || m_motor_pos < 0xc) + 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 + */ + 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; +} + + + +/*************************************************************************** + + I/O + +***************************************************************************/ + +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); + if (data & 0x200) + m_motor_on = true; + + // R3: N/C + // R4: 75494 /EN (speaker, lamps, digit select go through that IC) + // R5-R7: tower lamps + // R8: rotation sensor led + m_r = data; + mbdtower_display(); + + // R10: speaker out + m_speaker->level_w(~data >> 4 & data >> 10 & 1); +} + +WRITE16_MEMBER(mbdtower_state::write_o) +{ + // O0-O6: led segments A-G + // O7: digit select + m_o = data; + mbdtower_display(); +} + +READ8_MEMBER(mbdtower_state::read_k) +{ + // rotation sensor is on K8 + return read_inputs(3) | ((!m_sensor_blind && sensor_led_on()) ? 8 : 0); +} + + + +/*************************************************************************** + + Inputs + +***************************************************************************/ + +/* physical button layout and labels is like this: + + (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] +*/ + +static INPUT_PORTS_START( mbdtower ) + PORT_START("IN.0") // R0 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_C) PORT_NAME("Inventory") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_3) PORT_NAME("No/End") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_E) PORT_NAME("Clear") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_D) PORT_NAME("Sanctuary/Citadel") + + PORT_START("IN.1") // R1 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_X) PORT_NAME("Frontier") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_2) PORT_NAME("Repeat") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_W) PORT_NAME("Bazaar") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_S) PORT_NAME("Move") + + PORT_START("IN.2") // R2 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_Z) PORT_NAME("Dark Tower") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_1) PORT_NAME("Yes/Buy") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_Q) PORT_NAME("Haggle") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_A) PORT_NAME("Tomb/Ruin") +INPUT_PORTS_END + + + +/*************************************************************************** + + Machine Config + +***************************************************************************/ + +void mbdtower_state::machine_start() +{ + hh_tms1k_state::machine_start(); + + // zerofill/register for savestates + m_motor_pos = 0; + m_motor_pos_prev = -1; + 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)); + save_item(NAME(m_motor_on)); + save_item(NAME(m_sensor_blind)); +} + + +static MACHINE_CONFIG_START( mbdtower, mbdtower_state ) + + /* basic machine hardware */ + MCFG_CPU_ADD("maincpu", TMS1400, 425000) // approximation - RC osc. R=43K, C=56pf, but unknown RC curve + MCFG_TMS1XXX_READ_K_CB(READ8(mbdtower_state, read_k)) + MCFG_TMS1XXX_WRITE_R_CB(WRITE16(mbdtower_state, write_r)) + MCFG_TMS1XXX_WRITE_O_CB(WRITE16(mbdtower_state, write_o)) + + MCFG_TIMER_DRIVER_ADD_PERIODIC("tower_motor", mbdtower_state, motor_sim_tick, attotime::from_msec(3500/0x80)) // ~3.5sec for a full rotation + MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_tms1k_state, display_decay_tick, attotime::from_msec(1)) + MCFG_DEFAULT_LAYOUT(layout_mbdtower) + + /* no video! */ + + /* sound hardware */ + MCFG_SPEAKER_STANDARD_MONO("mono") + MCFG_SOUND_ADD("speaker", SPEAKER_SOUND, 0) + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) +MACHINE_CONFIG_END + + + +/*************************************************************************** + + Game driver(s) + +***************************************************************************/ + +ROM_START( mbdtower ) + ROM_REGION( 0x1000, "maincpu", 0 ) + ROM_LOAD( "mp7332", 0x0000, 0x1000, CRC(ebeab91a) SHA1(7edbff437da371390fa8f28b3d183f833eaa9be9) ) + + ROM_REGION( 867, "maincpu:mpla", 0 ) + ROM_LOAD( "tms1100_default_mpla.pla", 0, 867, CRC(62445fc9) SHA1(d6297f2a4bc7a870b76cc498d19dbb0ce7d69fec) ) + ROM_REGION( 557, "maincpu:opla", 0 ) + ROM_LOAD( "tms1400_mbdtower_opla.pla", 0, 557, CRC(64c84697) SHA1(72ce6d24cedf9c606f1742cd5620f75907246e87) ) +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 ) diff --git a/src/mess/drivers/sms.c b/src/mess/drivers/sms.c index 4187054462c..a6c95158206 100644 --- a/src/mess/drivers/sms.c +++ b/src/mess/drivers/sms.c @@ -825,7 +825,7 @@ ROM_START(sms1) ROM_REGION(0x20000, "user1", 0) ROM_SYSTEM_BIOS( 0, "bios13", "US/European BIOS v1.3 (1986)" ) - ROMX_LOAD("bios13fx.rom", 0x0000, 0x2000, CRC(0072ed54) SHA1(c315672807d8ddb8d91443729405c766dd95cae7), ROM_BIOS(1)) + ROMX_LOAD("mpr-10052.rom", 0x0000, 0x2000, CRC(0072ed54) SHA1(c315672807d8ddb8d91443729405c766dd95cae7), ROM_BIOS(1)) ROM_SYSTEM_BIOS( 1, "hangonsh", "US/European BIOS v2.4 with Hang On and Safari Hunt (1988)" ) ROMX_LOAD("mpr-11459a.rom", 0x0000, 0x20000, CRC(91e93385) SHA1(9e179392cd416af14024d8f31c981d9ee9a64517), ROM_BIOS(2)) ROM_SYSTEM_BIOS( 2, "hangon", "US/European BIOS v3.4 with Hang On (1988)" ) @@ -864,13 +864,15 @@ ROM_START(sms1pal) ROM_REGION(0x20000, "user1", 0) ROM_SYSTEM_BIOS( 0, "bios13", "US/European BIOS v1.3 (1986)" ) - ROMX_LOAD("bios13fx.rom", 0x0000, 0x2000, CRC(0072ed54) SHA1(c315672807d8ddb8d91443729405c766dd95cae7), ROM_BIOS(1)) - ROM_SYSTEM_BIOS( 1, "hangonsh", "US/European BIOS v2.4 with Hang On and Safari Hunt (1988)" ) - ROMX_LOAD("mpr-11459a.rom", 0x0000, 0x20000, CRC(91e93385) SHA1(9e179392cd416af14024d8f31c981d9ee9a64517), ROM_BIOS(2)) - ROM_SYSTEM_BIOS( 2, "hangon", "Sega Master System - US/European BIOS v3.4 with Hang On (1988)" ) - ROMX_LOAD("mpr-11458.rom", 0x0000, 0x20000, CRC(8edf7ac6) SHA1(51fd6d7990f62cd9d18c9ecfc62ed7936169107e), ROM_BIOS(3)) - ROM_SYSTEM_BIOS( 3, "missiled", "US/European BIOS v4.4 with Missile Defense 3D (1988)" ) - ROMX_LOAD("missiled.rom", 0x0000, 0x20000, CRC(e79bb689) SHA1(aa92ae576ca670b00855e278378d89e9f85e0351), ROM_BIOS(4)) + ROMX_LOAD("mpr-10052.rom", 0x0000, 0x2000, CRC(0072ed54) SHA1(c315672807d8ddb8d91443729405c766dd95cae7), ROM_BIOS(1)) + ROM_SYSTEM_BIOS( 1, "bios20", "European BIOS v2.0 (198?)" ) + ROMX_LOAD("mpr-10883.rom", 0x0000, 0x2000, CRC(b3d854f8) SHA1(fc7eb9141f38c92bf98d9134816f64b45e811112), ROM_BIOS(2)) + ROM_SYSTEM_BIOS( 2, "hangonsh", "US/European BIOS v2.4 with Hang On and Safari Hunt (1988)" ) + ROMX_LOAD("mpr-11459a.rom", 0x0000, 0x20000, CRC(91e93385) SHA1(9e179392cd416af14024d8f31c981d9ee9a64517), ROM_BIOS(3)) + ROM_SYSTEM_BIOS( 3, "hangon", "Sega Master System - US/European BIOS v3.4 with Hang On (1988)" ) + ROMX_LOAD("mpr-11458.rom", 0x0000, 0x20000, CRC(8edf7ac6) SHA1(51fd6d7990f62cd9d18c9ecfc62ed7936169107e), ROM_BIOS(4)) + ROM_SYSTEM_BIOS( 4, "missiled", "US/European BIOS v4.4 with Missile Defense 3D (1988)" ) + ROMX_LOAD("missiled.rom", 0x0000, 0x20000, CRC(e79bb689) SHA1(aa92ae576ca670b00855e278378d89e9f85e0351), ROM_BIOS(5)) ROM_END ROM_START(smspal) diff --git a/src/mess/drivers/snes.c b/src/mess/drivers/snes.c index 8697bb35d85..aff5e20e5f0 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 ) @@ -1191,123 +1191,128 @@ void snes_console_state::machine_start() { snes_state::machine_start(); - m_type = m_cartslot->get_type(); - - switch (m_type) + if (m_cartslot && m_cartslot->exists()) { - // LoROM & LoROM + addons - case SNES_MODE20: - case SNES_BSXLO: - case SNES_SUFAMITURBO: - case SNES_CX4: // this still uses the old simulation instead of emulating the CPU - case SNES_ST010: // this requires two diff kinds of chip access, so we handle it in snes20_lo/hi_r/w - case SNES_ST011: // this requires two diff kinds of chip access, so we handle it in snes20_lo/hi_r/w - case SNES_ST018: // still unemulated - break; - case SNES_Z80GB: // skeleton support - m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x000000, 0x7dffff, read8_delegate(FUNC(snes_console_state::snessgb_lo_r),this), write8_delegate(FUNC(snes_console_state::snessgb_lo_w),this)); - m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x800000, 0xffffff, read8_delegate(FUNC(snes_console_state::snessgb_hi_r),this), write8_delegate(FUNC(snes_console_state::snessgb_hi_w),this)); - m_maincpu->set_5a22_map(); - break; - case SNES_SA1: // skeleton support - m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x000000, 0x7dffff, read8_delegate(FUNC(snes_console_state::snessa1_lo_r),this), write8_delegate(FUNC(snes_console_state::snessa1_lo_w),this)); - m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x800000, 0xffffff, read8_delegate(FUNC(snes_console_state::snessa1_hi_r),this), write8_delegate(FUNC(snes_console_state::snessa1_hi_w),this)); - m_maincpu->set_5a22_map(); - break; - case SNES_DSP: - m_maincpu->space(AS_PROGRAM).install_read_handler(0x208000, 0x20ffff, 0, 0x9f0000, read8_delegate(FUNC(base_sns_cart_slot_device::chip_read),(base_sns_cart_slot_device*)m_cartslot)); - m_maincpu->space(AS_PROGRAM).install_write_handler(0x208000, 0x20ffff, 0, 0x9f0000, write8_delegate(FUNC(base_sns_cart_slot_device::chip_write),(base_sns_cart_slot_device*)m_cartslot)); - break; - case SNES_DSP_2MB: - m_maincpu->space(AS_PROGRAM).install_read_handler(0x600000, 0x607fff, 0, 0x8f0000, read8_delegate(FUNC(base_sns_cart_slot_device::chip_read),(base_sns_cart_slot_device*)m_cartslot)); - m_maincpu->space(AS_PROGRAM).install_write_handler(0x600000, 0x607fff, 0, 0x8f0000, write8_delegate(FUNC(base_sns_cart_slot_device::chip_write),(base_sns_cart_slot_device*)m_cartslot)); - break; - case SNES_DSP4: - m_maincpu->space(AS_PROGRAM).install_read_handler(0x308000, 0x30ffff, 0, 0x8f0000, read8_delegate(FUNC(base_sns_cart_slot_device::chip_read),(base_sns_cart_slot_device*)m_cartslot)); - m_maincpu->space(AS_PROGRAM).install_write_handler(0x308000, 0x30ffff, 0, 0x8f0000, write8_delegate(FUNC(base_sns_cart_slot_device::chip_write),(base_sns_cart_slot_device*)m_cartslot)); - break; - case SNES_OBC1: - m_maincpu->space(AS_PROGRAM).install_read_handler(0x006000, 0x007fff, 0, 0xbf0000, read8_delegate(FUNC(base_sns_cart_slot_device::chip_read),(base_sns_cart_slot_device*)m_cartslot)); - m_maincpu->space(AS_PROGRAM).install_write_handler(0x006000, 0x007fff, 0, 0xbf0000, write8_delegate(FUNC(base_sns_cart_slot_device::chip_write),(base_sns_cart_slot_device*)m_cartslot)); - break; - case SNES_SFX: - m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x000000, 0x7dffff, read8_delegate(FUNC(snes_console_state::snessfx_lo_r),this), write8_delegate(FUNC(snes_console_state::snessfx_lo_w),this)); - m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x800000, 0xffffff, read8_delegate(FUNC(snes_console_state::snessfx_hi_r),this), write8_delegate(FUNC(snes_console_state::snessfx_hi_w),this)); - m_maincpu->set_5a22_map(); - break; - case SNES_SDD1: - m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x000000, 0x7dffff, read8_delegate(FUNC(snes_console_state::snessdd1_lo_r),this), write8_delegate(FUNC(snes_console_state::snessdd1_lo_w),this)); - m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x800000, 0xffffff, read8_delegate(FUNC(snes_console_state::snessdd1_hi_r),this), write8_delegate(FUNC(snes_console_state::snessdd1_hi_w),this)); - m_maincpu->set_5a22_map(); - break; - case SNES_BSX: - m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x000000, 0x7dffff, read8_delegate(FUNC(snes_console_state::snesbsx_lo_r),this), write8_delegate(FUNC(snes_console_state::snesbsx_lo_w),this)); - m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x800000, 0xffffff, read8_delegate(FUNC(snes_console_state::snesbsx_hi_r),this), write8_delegate(FUNC(snes_console_state::snesbsx_hi_w),this)); - m_maincpu->set_5a22_map(); - break; - // HiROM & HiROM + addons - case SNES_MODE21: - case SNES_BSXHI: - m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x000000, 0x7dffff, read8_delegate(FUNC(snes_console_state::snes21_lo_r),this), write8_delegate(FUNC(snes_console_state::snes21_lo_w),this)); - m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x800000, 0xffffff, read8_delegate(FUNC(snes_console_state::snes21_hi_r),this), write8_delegate(FUNC(snes_console_state::snes21_hi_w),this)); - m_maincpu->set_5a22_map(); - break; - case SNES_DSP_MODE21: - m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x000000, 0x7dffff, read8_delegate(FUNC(snes_console_state::snes21_lo_r),this), write8_delegate(FUNC(snes_console_state::snes21_lo_w),this)); - m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x800000, 0xffffff, read8_delegate(FUNC(snes_console_state::snes21_hi_r),this), write8_delegate(FUNC(snes_console_state::snes21_hi_w),this)); - m_maincpu->space(AS_PROGRAM).install_read_handler(0x006000, 0x007fff, 0, 0x9f0000, read8_delegate(FUNC(base_sns_cart_slot_device::chip_read),(base_sns_cart_slot_device*)m_cartslot)); - m_maincpu->space(AS_PROGRAM).install_write_handler(0x006000, 0x007fff, 0, 0x9f0000, write8_delegate(FUNC(base_sns_cart_slot_device::chip_write),(base_sns_cart_slot_device*)m_cartslot)); - m_maincpu->set_5a22_map(); - break; - case SNES_SRTC: - m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x000000, 0x7dffff, read8_delegate(FUNC(snes_console_state::snes21_lo_r),this), write8_delegate(FUNC(snes_console_state::snes21_lo_w),this)); - m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x800000, 0xffffff, read8_delegate(FUNC(snes_console_state::snes21_hi_r),this), write8_delegate(FUNC(snes_console_state::snes21_hi_w),this)); - m_maincpu->space(AS_PROGRAM).install_read_handler(0x002800, 0x002800, 0, 0xbf0000, read8_delegate(FUNC(base_sns_cart_slot_device::chip_read),(base_sns_cart_slot_device*)m_cartslot)); - m_maincpu->space(AS_PROGRAM).install_write_handler(0x002801, 0x002801, 0, 0xbf0000, write8_delegate(FUNC(base_sns_cart_slot_device::chip_write),(base_sns_cart_slot_device*)m_cartslot)); - m_maincpu->set_5a22_map(); - break; - case SNES_SPC7110: - case SNES_SPC7110_RTC: - m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x000000, 0x7dffff, read8_delegate(FUNC(snes_console_state::snes7110_lo_r),this), write8_delegate(FUNC(snes_console_state::snes7110_lo_w),this)); - m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x800000, 0xffffff, read8_delegate(FUNC(snes_console_state::snes7110_hi_r),this), write8_delegate(FUNC(snes_console_state::snes7110_hi_w),this)); - m_maincpu->set_5a22_map(); - break; - case SNES_PFEST94: - m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x000000, 0x7dffff, read8_delegate(FUNC(snes_console_state::pfest94_lo_r),this), write8_delegate(FUNC(snes_console_state::pfest94_lo_w),this)); - m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x800000, 0xffffff, read8_delegate(FUNC(snes_console_state::pfest94_hi_r),this), write8_delegate(FUNC(snes_console_state::pfest94_hi_w),this)); - m_maincpu->set_5a22_map(); - break; - // pirate 'mappers' - case SNES_POKEMON: - m_maincpu->space(AS_PROGRAM).install_read_handler(0x800000, 0x80ffff, 0, 0x780000, read8_delegate(FUNC(base_sns_cart_slot_device::chip_read),(base_sns_cart_slot_device*)m_cartslot)); - m_maincpu->space(AS_PROGRAM).install_write_handler(0x800000, 0x80ffff, 0, 0x780000, write8_delegate(FUNC(base_sns_cart_slot_device::chip_write),(base_sns_cart_slot_device*)m_cartslot)); - break; - case SNES_TEKKEN2: - m_maincpu->space(AS_PROGRAM).install_read_handler(0x808000, 0x8087ff, 0, 0x3f0000, read8_delegate(FUNC(base_sns_cart_slot_device::chip_read),(base_sns_cart_slot_device*)m_cartslot)); - m_maincpu->space(AS_PROGRAM).install_write_handler(0x808000, 0x8087ff, 0, 0x3f0000, write8_delegate(FUNC(base_sns_cart_slot_device::chip_write),(base_sns_cart_slot_device*)m_cartslot)); - break; - case SNES_MCPIR1: - case SNES_MCPIR2: - m_maincpu->space(AS_PROGRAM).install_write_handler(0xffff00, 0xffffff, write8_delegate(FUNC(base_sns_cart_slot_device::chip_write),(base_sns_cart_slot_device*)m_cartslot)); - break; - case SNES_20COL: - m_maincpu->space(AS_PROGRAM).install_write_handler(0x008000, 0x008fff, write8_delegate(FUNC(base_sns_cart_slot_device::chip_write),(base_sns_cart_slot_device*)m_cartslot)); - break; - case SNES_SOULBLAD: - // reads from xxx0-xxx3in range [80-bf] return a fixed sequence of 4bits; reads in range [c0-ff] return open bus - m_maincpu->space(AS_PROGRAM).install_read_handler(0x808000, 0x808003, 0, 0x3f7ff0, read8_delegate(FUNC(base_sns_cart_slot_device::chip_read),(base_sns_cart_slot_device*)m_cartslot)); - m_maincpu->space(AS_PROGRAM).install_read_handler(0xc00000, 0xffffff, read8_delegate(FUNC(snes_console_state::snes_open_bus_r),this)); - break; - case SNES_BUGS: - case SNES_BANANA: -// m_maincpu->space(AS_PROGRAM).install_read_handler(0x808000, 0x80ffff, 0, 0x780000, read8_delegate(FUNC(base_sns_cart_slot_device::chip_read),(base_sns_cart_slot_device*)m_cartslot)); -// m_maincpu->space(AS_PROGRAM).install_write_handler(0x808000, 0x80ffff, 0, 0x780000, write8_delegate(FUNC(base_sns_cart_slot_device::chip_write),(base_sns_cart_slot_device*)m_cartslot)); -// m_maincpu->set_5a22_map(); - break; - } + 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(); - if (m_cartslot) + switch (m_type) + { + // LoROM & LoROM + addons + case SNES_MODE20: + case SNES_BSXLO: + case SNES_SUFAMITURBO: + case SNES_CX4: // this still uses the old simulation instead of emulating the CPU + case SNES_ST010: // this requires two diff kinds of chip access, so we handle it in snes20_lo/hi_r/w + case SNES_ST011: // this requires two diff kinds of chip access, so we handle it in snes20_lo/hi_r/w + case SNES_ST018: // still unemulated + break; + case SNES_Z80GB: // skeleton support + m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x000000, 0x7dffff, read8_delegate(FUNC(snes_console_state::snessgb_lo_r),this), write8_delegate(FUNC(snes_console_state::snessgb_lo_w),this)); + m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x800000, 0xffffff, read8_delegate(FUNC(snes_console_state::snessgb_hi_r),this), write8_delegate(FUNC(snes_console_state::snessgb_hi_w),this)); + m_maincpu->set_5a22_map(); + break; + case SNES_SA1: // skeleton support + m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x000000, 0x7dffff, read8_delegate(FUNC(snes_console_state::snessa1_lo_r),this), write8_delegate(FUNC(snes_console_state::snessa1_lo_w),this)); + m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x800000, 0xffffff, read8_delegate(FUNC(snes_console_state::snessa1_hi_r),this), write8_delegate(FUNC(snes_console_state::snessa1_hi_w),this)); + m_maincpu->set_5a22_map(); + break; + case SNES_DSP: + m_maincpu->space(AS_PROGRAM).install_read_handler(0x208000, 0x20ffff, 0, 0x9f0000, read8_delegate(FUNC(base_sns_cart_slot_device::chip_read),(base_sns_cart_slot_device*)m_cartslot)); + m_maincpu->space(AS_PROGRAM).install_write_handler(0x208000, 0x20ffff, 0, 0x9f0000, write8_delegate(FUNC(base_sns_cart_slot_device::chip_write),(base_sns_cart_slot_device*)m_cartslot)); + break; + case SNES_DSP_2MB: + m_maincpu->space(AS_PROGRAM).install_read_handler(0x600000, 0x607fff, 0, 0x8f0000, read8_delegate(FUNC(base_sns_cart_slot_device::chip_read),(base_sns_cart_slot_device*)m_cartslot)); + m_maincpu->space(AS_PROGRAM).install_write_handler(0x600000, 0x607fff, 0, 0x8f0000, write8_delegate(FUNC(base_sns_cart_slot_device::chip_write),(base_sns_cart_slot_device*)m_cartslot)); + break; + case SNES_DSP4: + m_maincpu->space(AS_PROGRAM).install_read_handler(0x308000, 0x30ffff, 0, 0x8f0000, read8_delegate(FUNC(base_sns_cart_slot_device::chip_read),(base_sns_cart_slot_device*)m_cartslot)); + m_maincpu->space(AS_PROGRAM).install_write_handler(0x308000, 0x30ffff, 0, 0x8f0000, write8_delegate(FUNC(base_sns_cart_slot_device::chip_write),(base_sns_cart_slot_device*)m_cartslot)); + break; + case SNES_OBC1: + m_maincpu->space(AS_PROGRAM).install_read_handler(0x006000, 0x007fff, 0, 0xbf0000, read8_delegate(FUNC(base_sns_cart_slot_device::chip_read),(base_sns_cart_slot_device*)m_cartslot)); + m_maincpu->space(AS_PROGRAM).install_write_handler(0x006000, 0x007fff, 0, 0xbf0000, write8_delegate(FUNC(base_sns_cart_slot_device::chip_write),(base_sns_cart_slot_device*)m_cartslot)); + break; + case SNES_SFX: + m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x000000, 0x7dffff, read8_delegate(FUNC(snes_console_state::snessfx_lo_r),this), write8_delegate(FUNC(snes_console_state::snessfx_lo_w),this)); + m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x800000, 0xffffff, read8_delegate(FUNC(snes_console_state::snessfx_hi_r),this), write8_delegate(FUNC(snes_console_state::snessfx_hi_w),this)); + m_maincpu->set_5a22_map(); + break; + case SNES_SDD1: + m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x000000, 0x7dffff, read8_delegate(FUNC(snes_console_state::snessdd1_lo_r),this), write8_delegate(FUNC(snes_console_state::snessdd1_lo_w),this)); + m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x800000, 0xffffff, read8_delegate(FUNC(snes_console_state::snessdd1_hi_r),this), write8_delegate(FUNC(snes_console_state::snessdd1_hi_w),this)); + m_maincpu->set_5a22_map(); + break; + case SNES_BSX: + m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x000000, 0x7dffff, read8_delegate(FUNC(snes_console_state::snesbsx_lo_r),this), write8_delegate(FUNC(snes_console_state::snesbsx_lo_w),this)); + m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x800000, 0xffffff, read8_delegate(FUNC(snes_console_state::snesbsx_hi_r),this), write8_delegate(FUNC(snes_console_state::snesbsx_hi_w),this)); + m_maincpu->set_5a22_map(); + break; + // HiROM & HiROM + addons + case SNES_MODE21: + case SNES_BSXHI: + m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x000000, 0x7dffff, read8_delegate(FUNC(snes_console_state::snes21_lo_r),this), write8_delegate(FUNC(snes_console_state::snes21_lo_w),this)); + m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x800000, 0xffffff, read8_delegate(FUNC(snes_console_state::snes21_hi_r),this), write8_delegate(FUNC(snes_console_state::snes21_hi_w),this)); + m_maincpu->set_5a22_map(); + break; + case SNES_DSP_MODE21: + m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x000000, 0x7dffff, read8_delegate(FUNC(snes_console_state::snes21_lo_r),this), write8_delegate(FUNC(snes_console_state::snes21_lo_w),this)); + m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x800000, 0xffffff, read8_delegate(FUNC(snes_console_state::snes21_hi_r),this), write8_delegate(FUNC(snes_console_state::snes21_hi_w),this)); + m_maincpu->space(AS_PROGRAM).install_read_handler(0x006000, 0x007fff, 0, 0x9f0000, read8_delegate(FUNC(base_sns_cart_slot_device::chip_read),(base_sns_cart_slot_device*)m_cartslot)); + m_maincpu->space(AS_PROGRAM).install_write_handler(0x006000, 0x007fff, 0, 0x9f0000, write8_delegate(FUNC(base_sns_cart_slot_device::chip_write),(base_sns_cart_slot_device*)m_cartslot)); + m_maincpu->set_5a22_map(); + break; + case SNES_SRTC: + m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x000000, 0x7dffff, read8_delegate(FUNC(snes_console_state::snes21_lo_r),this), write8_delegate(FUNC(snes_console_state::snes21_lo_w),this)); + m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x800000, 0xffffff, read8_delegate(FUNC(snes_console_state::snes21_hi_r),this), write8_delegate(FUNC(snes_console_state::snes21_hi_w),this)); + m_maincpu->space(AS_PROGRAM).install_read_handler(0x002800, 0x002800, 0, 0xbf0000, read8_delegate(FUNC(base_sns_cart_slot_device::chip_read),(base_sns_cart_slot_device*)m_cartslot)); + m_maincpu->space(AS_PROGRAM).install_write_handler(0x002801, 0x002801, 0, 0xbf0000, write8_delegate(FUNC(base_sns_cart_slot_device::chip_write),(base_sns_cart_slot_device*)m_cartslot)); + m_maincpu->set_5a22_map(); + break; + case SNES_SPC7110: + case SNES_SPC7110_RTC: + m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x000000, 0x7dffff, read8_delegate(FUNC(snes_console_state::snes7110_lo_r),this), write8_delegate(FUNC(snes_console_state::snes7110_lo_w),this)); + m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x800000, 0xffffff, read8_delegate(FUNC(snes_console_state::snes7110_hi_r),this), write8_delegate(FUNC(snes_console_state::snes7110_hi_w),this)); + m_maincpu->set_5a22_map(); + break; + case SNES_PFEST94: + m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x000000, 0x7dffff, read8_delegate(FUNC(snes_console_state::pfest94_lo_r),this), write8_delegate(FUNC(snes_console_state::pfest94_lo_w),this)); + m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x800000, 0xffffff, read8_delegate(FUNC(snes_console_state::pfest94_hi_r),this), write8_delegate(FUNC(snes_console_state::pfest94_hi_w),this)); + m_maincpu->set_5a22_map(); + break; + // pirate 'mappers' + case SNES_POKEMON: + m_maincpu->space(AS_PROGRAM).install_read_handler(0x800000, 0x80ffff, 0, 0x780000, read8_delegate(FUNC(base_sns_cart_slot_device::chip_read),(base_sns_cart_slot_device*)m_cartslot)); + m_maincpu->space(AS_PROGRAM).install_write_handler(0x800000, 0x80ffff, 0, 0x780000, write8_delegate(FUNC(base_sns_cart_slot_device::chip_write),(base_sns_cart_slot_device*)m_cartslot)); + break; + case SNES_TEKKEN2: + m_maincpu->space(AS_PROGRAM).install_read_handler(0x808000, 0x8087ff, 0, 0x3f0000, read8_delegate(FUNC(base_sns_cart_slot_device::chip_read),(base_sns_cart_slot_device*)m_cartslot)); + m_maincpu->space(AS_PROGRAM).install_write_handler(0x808000, 0x8087ff, 0, 0x3f0000, write8_delegate(FUNC(base_sns_cart_slot_device::chip_write),(base_sns_cart_slot_device*)m_cartslot)); + break; + case SNES_MCPIR1: + case SNES_MCPIR2: + m_maincpu->space(AS_PROGRAM).install_write_handler(0xffff00, 0xffffff, write8_delegate(FUNC(base_sns_cart_slot_device::chip_write),(base_sns_cart_slot_device*)m_cartslot)); + break; + case SNES_20COL: + m_maincpu->space(AS_PROGRAM).install_write_handler(0x008000, 0x008fff, write8_delegate(FUNC(base_sns_cart_slot_device::chip_write),(base_sns_cart_slot_device*)m_cartslot)); + break; + case SNES_SOULBLAD: + // reads from xxx0-xxx3in range [80-bf] return a fixed sequence of 4bits; reads in range [c0-ff] return open bus + m_maincpu->space(AS_PROGRAM).install_read_handler(0x808000, 0x808003, 0, 0x3f7ff0, read8_delegate(FUNC(base_sns_cart_slot_device::chip_read),(base_sns_cart_slot_device*)m_cartslot)); + m_maincpu->space(AS_PROGRAM).install_read_handler(0xc00000, 0xffffff, read8_delegate(FUNC(snes_console_state::snes_open_bus_r),this)); + break; + case SNES_BUGS: + case SNES_BANANA: +// m_maincpu->space(AS_PROGRAM).install_read_handler(0x808000, 0x80ffff, 0, 0x780000, read8_delegate(FUNC(base_sns_cart_slot_device::chip_read),(base_sns_cart_slot_device*)m_cartslot)); +// m_maincpu->space(AS_PROGRAM).install_write_handler(0x808000, 0x80ffff, 0, 0x780000, write8_delegate(FUNC(base_sns_cart_slot_device::chip_write),(base_sns_cart_slot_device*)m_cartslot)); +// m_maincpu->set_5a22_map(); + break; + } m_cartslot->save_ram(); + } } void snes_console_state::machine_reset() diff --git a/src/mess/drivers/ti99_4x.c b/src/mess/drivers/ti99_4x.c index fff2de23de1..ee661e7c471 100644 --- a/src/mess/drivers/ti99_4x.c +++ b/src/mess/drivers/ti99_4x.c @@ -351,6 +351,12 @@ static INPUT_PORTS_START(ti99_4a) PORT_START("ALPHA") /* one more port for Alpha line */ PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Alpha Lock") PORT_CODE(KEYCODE_CAPSLOCK) PORT_TOGGLE + /* another version of Alpha Lock which is non-toggling; this is useful when we want to attach + a real TI keyboard for input. For home computers, the Alpha Lock / Shift Lock was a physically + locking key. */ + PORT_START("ALPHA1") + PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Alpha Lock non-toggle") PORT_CODE(KEYCODE_RWIN) + INPUT_PORTS_END @@ -462,7 +468,7 @@ READ8_MEMBER( ti99_4x_state::read_by_9901 ) // the line enough to make the TMS9901 sense the low level. // A reported, feasible fix was to cut the line and insert a diode // below the Alphalock key. - if ((ioport("ALPHABUG")!=0) && (m_model!=MODEL_4)) answer |= ioport("ALPHA")->read(); + if ((ioport("ALPHABUG")!=0) && (m_model!=MODEL_4)) answer |= (ioport("ALPHA")->read() | ioport("ALPHA1")->read()); } else { @@ -470,7 +476,7 @@ READ8_MEMBER( ti99_4x_state::read_by_9901 ) } if (m_check_alphalock) // never true for TI-99/4 { - answer &= ~(ioport("ALPHA")->read()); + answer &= ~(ioport("ALPHA")->read() | ioport("ALPHA1")->read()); } answer = (answer << 3); if (m_int1 == CLEAR_LINE) answer |= 0x02; diff --git a/src/mess/drivers/ticalc1x.c b/src/mess/drivers/ticalc1x.c index 3558f8854e4..37d90600162 100644 --- a/src/mess/drivers/ticalc1x.c +++ b/src/mess/drivers/ticalc1x.c @@ -8,13 +8,16 @@ TODO: - - MCU clocks are unknown + - MCU clocks are unknown where noted + - lilprof78 equals-sign is always on ***************************************************************************/ #include "emu.h" #include "cpu/tms0980/tms0980.h" +#include "sound/speaker.h" +// internal artwork #include "ti1270.lh" #include "ti30.lh" #include "tisr16.lh" @@ -27,91 +30,157 @@ public: ticalc1x_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), m_maincpu(*this, "maincpu"), - m_button_matrix(*this, "IN") + m_inp_matrix(*this, "IN"), + m_speaker(*this, "speaker"), + m_display_wait(33), + m_display_maxy(1), + m_display_maxx(0) { } + // devices required_device m_maincpu; - optional_ioport_array<11> m_button_matrix; // up to 11 rows + optional_ioport_array<11> m_inp_matrix; // max 11 + optional_device m_speaker; - UINT16 m_r; - UINT16 m_o; + // 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; - UINT16 m_display_state[0x10]; - UINT16 m_display_cache[0x10]; - UINT8 m_display_decay[0x100]; - - DECLARE_READ8_MEMBER(tisr16_read_k); - DECLARE_WRITE16_MEMBER(tisr16_write_o); - DECLARE_WRITE16_MEMBER(tisr16_write_r); - void tisr16_display_update(); - - DECLARE_READ8_MEMBER(ti1270_read_k); - DECLARE_WRITE16_MEMBER(ti1270_write_o); - DECLARE_WRITE16_MEMBER(ti1270_write_r); - - DECLARE_READ8_MEMBER(wizatron_read_k); - DECLARE_WRITE16_MEMBER(wizatron_write_o); - DECLARE_WRITE16_MEMBER(wizatron_write_r); - - DECLARE_READ8_MEMBER(ti30_read_k); - DECLARE_WRITE16_MEMBER(ti30_write_o); - DECLARE_WRITE16_MEMBER(ti30_write_r); - + UINT8 read_inputs(int columns); DECLARE_INPUT_CHANGED_MEMBER(power_button); DECLARE_WRITE_LINE_MEMBER(auto_power_off); - TIMER_DEVICE_CALLBACK_MEMBER(display_decay_tick); - void display_update(); - 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); + DECLARE_WRITE16_MEMBER(tisr16_write_r); + DECLARE_READ8_MEMBER(tisr16_read_k); + + DECLARE_WRITE16_MEMBER(ti1270_write_o); + DECLARE_WRITE16_MEMBER(ti1270_write_r); + DECLARE_READ8_MEMBER(ti1270_read_k); + + DECLARE_WRITE16_MEMBER(wizatron_write_o); + DECLARE_WRITE16_MEMBER(wizatron_write_r); + DECLARE_READ8_MEMBER(wizatron_read_k); + + DECLARE_WRITE16_MEMBER(lilprof_write_o); + DECLARE_READ8_MEMBER(lilprof_read_k); + + DECLARE_WRITE16_MEMBER(lilprof78_write_o); + DECLARE_WRITE16_MEMBER(lilprof78_write_r); + DECLARE_READ8_MEMBER(lilprof78_read_k); + + DECLARE_WRITE16_MEMBER(ti30_write_o); + DECLARE_WRITE16_MEMBER(ti30_write_r); + DECLARE_READ8_MEMBER(ti30_read_k); }; +// 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)); + 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; +} + + /*************************************************************************** - LED Display + Helper Functions ***************************************************************************/ -// Devices with TMS09x0 strobe the outputs very fast, it is unnoticeable to the user. +// The device may strobe the outputs very fast, it is unnoticeable to the user. // To prevent flickering here, we need to simulate a decay. -// decay time, in steps of 1ms -#define DISPLAY_DECAY_TIME 50 - void ticalc1x_state::display_update() { - UINT16 active_state[0x10]; + UINT32 active_state[0x20]; - for (int i = 0; i < 0x10; i++) + for (int y = 0; y < m_display_maxy; y++) { - active_state[i] = 0; + active_state[y] = 0; - for (int j = 0; j < 0x10; j++) + for (int x = 0; x < m_display_maxx; x++) { - int di = j << 4 | i; - // turn on powered segments - if (m_power_on && m_display_state[i] >> j & 1) - m_display_decay[di] = DISPLAY_DECAY_TIME; + 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[di] != 0) ? 1 : 0; - active_state[i] |= (ds << j); + int ds = (m_display_decay[y][x] != 0) ? 1 : 0; + active_state[y] |= (ds << x); } } // on difference, send to output - for (int i = 0; i < 0x10; i++) - if (m_display_cache[i] != active_state[i]) + for (int y = 0; y < m_display_maxy; y++) + if (m_display_cache[y] != active_state[y]) { - output_set_digit_value(i, active_state[i]); + if (m_display_segmask[y] != 0) + output_set_digit_value(y, active_state[y] & m_display_segmask[y]); - for (int j = 0; j < 8; j++) - output_set_lamp_value(i*10 + j, active_state[i] >> j & 1); + 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)); @@ -120,186 +189,111 @@ void ticalc1x_state::display_update() TIMER_DEVICE_CALLBACK_MEMBER(ticalc1x_state::display_decay_tick) { // slowly turn off unpowered segments - for (int i = 0; i < 0x100; i++) - if (!(m_display_state[i & 0xf] >> (i>>4) & 1) && m_display_decay[i]) - m_display_decay[i]--; + 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(); } - -/*************************************************************************** - - I/O - -***************************************************************************/ - -// SR-16: TMS1000 MCU labeled TMS1001NL. die labeled 1001A - -void ticalc1x_state::tisr16_display_update() +UINT8 ticalc1x_state::read_inputs(int columns) { - // update leds state - for (int i = 0; i < 11; i++) - if (m_r >> i & 1) - m_display_state[i] = m_o; + UINT8 ret = 0; - // exponent sign (not 100% sure this is correct) - m_display_state[11] = (m_display_state[0] | m_display_state[1]) ? 0x40 : 0; + // read selected input rows + for (int i = 0; i < columns; i++) + if (m_inp_mux >> i & 1) + ret |= m_inp_matrix[i]->read(); - // send to output - for (int i = 0; i < 12; i++) - output_set_digit_value(i, m_display_state[i]); -} - -READ8_MEMBER(ticalc1x_state::tisr16_read_k) -{ - UINT8 k = 0; - - // read selected button rows - for (int i = 0; i < 11; i++) - if (m_r >> i & 1) - k |= m_button_matrix[i]->read(); - - return k; -} - -WRITE16_MEMBER(ticalc1x_state::tisr16_write_r) -{ - // R0-R10: input mux - // R0-R10: select digit (right-to-left) - m_r = data; - - tisr16_display_update(); -} - -WRITE16_MEMBER(ticalc1x_state::tisr16_write_o) -{ - // O0-O7: digit segments - m_o = data; - - tisr16_display_update(); + return ret; } -// TI-1270: TMS0970 MCU labeled TMC0974NL ZA0355, DP0974A. die labeled 0970D-74A +// devices with a TMS0980 can auto power-off -READ8_MEMBER(ticalc1x_state::ti1270_read_k) +WRITE_LINE_MEMBER(ticalc1x_state::auto_power_off) { - UINT8 k = 0; - - // read selected button rows - for (int i = 0; i < 7; i++) - if (m_o >> (i+1) & 1) - k |= m_button_matrix[i]->read(); - - return k; + if (state) + { + m_power_on = false; + m_maincpu->set_input_line(INPUT_LINE_RESET, ASSERT_LINE); + } } -WRITE16_MEMBER(ticalc1x_state::ti1270_write_r) -{ - // R0-R7: select digit (right-to-left) - for (int i = 0; i < 8; i++) - m_display_state[i] = (data >> i & 1) ? m_o : 0; - - display_update(); -} - -WRITE16_MEMBER(ticalc1x_state::ti1270_write_o) -{ - // O1-O5,O7: input mux - // O0-O7: digit segments - m_o = data; -} - - -// WIZ-A-TRON (educational toy): TMS0970 MCU labeled TMC0907NL ZA0379, DP0907BS. die labeled 0970F-07B - -READ8_MEMBER(ticalc1x_state::wizatron_read_k) -{ - UINT8 k = 0; - - // read selected button rows - for (int i = 0; i < 4; i++) - if (m_o >> (i+1) & 1) - k |= m_button_matrix[i]->read(); - - return k; -} - -WRITE16_MEMBER(ticalc1x_state::wizatron_write_r) -{ - // R0-R8: select digit (right-to-left) - // note: 3rd digit is custom(not 7seg), for math symbols - for (int i = 0; i < 9; i++) - m_display_state[i] = (data >> i & 1) ? m_o : 0; - - // 6th digit only has A and G for = - m_display_state[3] &= 0x41; - - display_update(); -} - -WRITE16_MEMBER(ticalc1x_state::wizatron_write_o) -{ - // O1-O4: input mux - // O0-O6: digit segments A-G - // O7: N/C - m_o = data & 0x7f; -} - - -// TI-30: 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 - -READ8_MEMBER(ticalc1x_state::ti30_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_o >> i & 1) - k |= m_button_matrix[i]->read(); - - return k; -} - -WRITE16_MEMBER(ticalc1x_state::ti30_write_r) -{ - // R0-R8: select digit - UINT8 o = BITSWAP8(m_o,7,5,2,1,4,0,6,3); - for (int i = 0; i < 9; i++) - m_display_state[i] = (data >> i & 1) ? o : 0; - - // 1st digit only has segments B,F,G,DP - m_display_state[0] &= 0xe2; - - display_update(); -} - -WRITE16_MEMBER(ticalc1x_state::ti30_write_o) -{ - // O1-O5,O7: input mux - // O0-O7: digit segments - m_o = data; -} - - - -/*************************************************************************** - - Inputs - -***************************************************************************/ - 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); } + + +/*************************************************************************** + + Minidrivers (I/O, Inputs, Machine Config) + +***************************************************************************/ + +/*************************************************************************** + + TI SR-16 + * TMS1000 MCU labeled TMS1001NL. die labeled 1001A + +***************************************************************************/ + +void ticalc1x_state::tisr16_display() +{ + // update leds state + 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; + display_update(); +} + +WRITE16_MEMBER(ticalc1x_state::tisr16_write_r) +{ + // R0-R10: input mux + // R0-R10: select digit (right-to-left) + m_r = m_inp_mux = data; + tisr16_display(); +} + +WRITE16_MEMBER(ticalc1x_state::tisr16_write_o) +{ + // O0-O7: digit segments + m_o = data; + tisr16_display(); +} + +READ8_MEMBER(ticalc1x_state::tisr16_read_k) +{ + return read_inputs(11); +} + + static INPUT_PORTS_START( tisr16 ) PORT_START("IN.0") // R0 PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED ) @@ -369,6 +363,53 @@ static INPUT_PORTS_START( tisr16 ) INPUT_PORTS_END +static MACHINE_CONFIG_START( tisr16, ticalc1x_state ) + + /* basic machine hardware */ + MCFG_CPU_ADD("maincpu", TMS1000, 250000) // guessed + 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_DEFAULT_LAYOUT(layout_tisr16) + + /* no video! */ + + /* no sound! */ +MACHINE_CONFIG_END + + + + + +/*************************************************************************** + + TI-1270 + * TMS0970 MCU labeled TMC0974NL ZA0355, DP0974A. die labeled 0970D-74A + +***************************************************************************/ + +WRITE16_MEMBER(ticalc1x_state::ti1270_write_r) +{ + // R0-R7: select digit (right-to-left) + display_matrix_seg(8, 8, m_o, data, 0xff); +} + +WRITE16_MEMBER(ticalc1x_state::ti1270_write_o) +{ + // O1-O5,O7: input mux + // O0-O7: digit segments + m_inp_mux = (data >> 1 & 0x1f) | (data >> 2 & 0x20); + m_o = data; +} + +READ8_MEMBER(ticalc1x_state::ti1270_read_k) +{ + return read_inputs(6); +} + + static INPUT_PORTS_START( ti1270 ) PORT_START("IN.0") // O1 PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_BACKSPACE) PORT_CODE(KEYCODE_DEL) PORT_NAME("CE/C") @@ -400,10 +441,7 @@ static INPUT_PORTS_START( ti1270 ) PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_P) PORT_CODE(KEYCODE_I) 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") // O6 - PORT_BIT( 0x0f, IP_ACTIVE_HIGH, IPT_UNUSED ) - - PORT_START("IN.6") // O7 + PORT_START("IN.5") // O7 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_Q) PORT_NAME("x" UTF8_POW_2) PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_R) PORT_NAME(UTF8_SQUAREROOT"x") @@ -411,9 +449,66 @@ static INPUT_PORTS_START( ti1270 ) INPUT_PORTS_END +static MACHINE_CONFIG_START( ti1270, ticalc1x_state ) + + /* basic machine hardware */ + MCFG_CPU_ADD("maincpu", TMS0970, 250000) // guessed + MCFG_TMS1XXX_READ_K_CB(READ8(ticalc1x_state, ti1270_read_k)) + 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_DEFAULT_LAYOUT(layout_ti1270) + + /* no video! */ + + /* no sound! */ +MACHINE_CONFIG_END + + + + + +/*************************************************************************** + + TI WIZ-A-TRON + * TMS0970 MCU labeled TMC0907NL ZA0379, DP0907BS. die labeled 0970F-07B + +***************************************************************************/ + +WRITE16_MEMBER(ticalc1x_state::wizatron_write_r) +{ + // 6th digit is custom(not 7seg), for math symbols, like this: + // \./ 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); +} + +WRITE16_MEMBER(ticalc1x_state::wizatron_write_o) +{ + // O1-O4: input mux + // O0-O6: digit segments A-G + // O7: N/C + m_inp_mux = data >> 1 & 0xf; + m_o = data & 0x7f; +} + +READ8_MEMBER(ticalc1x_state::wizatron_read_k) +{ + return read_inputs(4); +} + + static INPUT_PORTS_START( wizatron ) PORT_START("IN.0") // O1 - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_DEL) PORT_CODE(KEYCODE_DEL_PAD) PORT_NAME("CLEAR") + 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("+") @@ -438,6 +533,215 @@ static INPUT_PORTS_START( wizatron ) INPUT_PORTS_END +static MACHINE_CONFIG_START( wizatron, ticalc1x_state ) + + /* basic machine hardware */ + MCFG_CPU_ADD("maincpu", TMS0970, 250000) // guessed + MCFG_TMS1XXX_READ_K_CB(READ8(ticalc1x_state, wizatron_read_k)) + 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_DEFAULT_LAYOUT(layout_wizatron) + + /* no video! */ + + /* no sound! */ +MACHINE_CONFIG_END + + + + + +/*************************************************************************** + + TI Little Professor (1976 version) + * TMS0970 MCU labeled TMS0975NL ZA0356, GP0975CS. die labeled 0970D-75C + + The hardware is nearly identical to Wiz-A-Tron (or vice versa, since this + one is older). + +***************************************************************************/ + +WRITE16_MEMBER(ticalc1x_state::lilprof_write_o) +{ + // O1-O4,O7: input mux + // O0-O6: digit segments A-G + m_inp_mux = (data >> 1 & 0xf) | (data >> 3 & 0x10); + m_o = data; +} + +READ8_MEMBER(ticalc1x_state::lilprof_read_k) +{ + return read_inputs(5); +} + + +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_START("IN.4") // O7 + PORT_CONFNAME( 0x0f, 0x01, "Level") + PORT_CONFSETTING( 0x01, "1" ) + PORT_CONFSETTING( 0x02, "2" ) + PORT_CONFSETTING( 0x04, "3" ) + PORT_CONFSETTING( 0x08, "4" ) +INPUT_PORTS_END + + +static MACHINE_CONFIG_START( lilprof, ticalc1x_state ) + + /* basic machine hardware */ + MCFG_CPU_ADD("maincpu", TMS0970, 250000) // guessed + MCFG_TMS1XXX_READ_K_CB(READ8(ticalc1x_state, lilprof_read_k)) + 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_DEFAULT_LAYOUT(layout_wizatron) + + /* no video! */ + + /* no sound! */ +MACHINE_CONFIG_END + + + + + +/*************************************************************************** + + TI Little Professor (1978 version, same as 1980 version) + * TMS1990 MCU labeled TMC1993NL. die labeled 1990C-c3C + +***************************************************************************/ + +WRITE16_MEMBER(ticalc1x_state::lilprof78_write_r) +{ + // update leds state + UINT8 o = BITSWAP8(m_o,7,4,3,2,1,0,6,5) & 0x7f; + UINT16 r = (data & 7) | (data << 1 & 0x1f0); + + for (int y = 0; y < 9; y++) + m_display_state[y] = (r >> y & 1) ? o : 0; + + // 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; + display_update(); +} + +WRITE16_MEMBER(ticalc1x_state::lilprof78_write_o) +{ + // O0-O3,O5: input mux + // O0-O6: digit segments A-G + // O7: 6th digit + m_inp_mux = (data & 0xf) | (data >> 1 & 0x10); + m_o = data; +} + +READ8_MEMBER(ticalc1x_state::lilprof78_read_k) +{ + return read_inputs(5); +} + + +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_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_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) + + // 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_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_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("+") +INPUT_PORTS_END + + +static MACHINE_CONFIG_START( lilprof78, ticalc1x_state ) + + /* basic machine hardware */ + MCFG_CPU_ADD("maincpu", TMS1990, 250000) // guessed + MCFG_TMS1XXX_READ_K_CB(READ8(ticalc1x_state, lilprof78_read_k)) + 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_DEFAULT_LAYOUT(layout_wizatron) + + /* no video! */ + + /* no sound! */ +MACHINE_CONFIG_END + + + + + +/*************************************************************************** + + Majestic-line calculators: + * 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 + +***************************************************************************/ + +WRITE16_MEMBER(ticalc1x_state::ti30_write_r) +{ + // note: 1st digit only has segments B,F,G,DP + 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); +} + +WRITE16_MEMBER(ticalc1x_state::ti30_write_o) +{ + // O0-O2,O4-O7: input mux + // O0-O7: digit segments + m_inp_mux = (data & 7) | (data >> 1 & 0x78); + m_o = data; +} + +READ8_MEMBER(ticalc1x_state::ti30_read_k) +{ + // note: the Vss row is always on + return m_inp_matrix[7]->read() | read_inputs(7); +} + + static INPUT_PORTS_START( ti30 ) PORT_START("IN.0") // O0 PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Y) PORT_NAME("y" UTF8_POW_X) @@ -460,31 +764,28 @@ static INPUT_PORTS_START( ti30 ) PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_4) PORT_CODE(KEYCODE_4_PAD) PORT_NAME("4") PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_6) PORT_CODE(KEYCODE_6_PAD) PORT_NAME("6") - PORT_START("IN.3") // O3 - PORT_BIT( 0x1f, IP_ACTIVE_HIGH, IPT_UNUSED ) - - PORT_START("IN.4") // O4 + PORT_START("IN.3") // O4 PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_SLASH_PAD) PORT_NAME(UTF8_DIVIDE) PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_P) PORT_NAME(UTF8_SMALL_PI) PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_OPENBRACE) PORT_NAME("(") PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_SLASH) PORT_NAME("%") PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_CLOSEBRACE) PORT_NAME(")") - PORT_START("IN.5") // O5 + PORT_START("IN.4") // O5 PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_PLUS_PAD) PORT_NAME("+") PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_EQUALS) PORT_NAME("SUM") PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_2) PORT_CODE(KEYCODE_2_PAD) PORT_NAME("2") PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_1) PORT_CODE(KEYCODE_1_PAD) PORT_NAME("1") PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_3) PORT_CODE(KEYCODE_3_PAD) PORT_NAME("3") - PORT_START("IN.6") // O6 + PORT_START("IN.5") // O6 PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_D) PORT_NAME("DRG") PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_I) PORT_NAME("INV") PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_C) PORT_NAME("cos") PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_S) PORT_NAME("sin") PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_T) PORT_NAME("tan") - PORT_START("IN.7") // O7 + PORT_START("IN.6") // O7 PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_ENTER) PORT_CODE(KEYCODE_ENTER_PAD) PORT_NAME("=") PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_E) PORT_NAME("EXC") PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_STOP) PORT_CODE(KEYCODE_DEL_PAD) PORT_NAME(".") @@ -492,7 +793,7 @@ static INPUT_PORTS_START( ti30 ) PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_MINUS) PORT_NAME("+/-") // note: even though power buttons are on the matrix, they are not CPU-controlled - PORT_START("IN.8") // Vss! + PORT_START("IN.7") // Vss! 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_X) PORT_NAME("1/x") PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_R) PORT_NAME(UTF8_SQUAREROOT"x") @@ -523,31 +824,28 @@ static INPUT_PORTS_START( tiprog ) PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_4) PORT_CODE(KEYCODE_4_PAD) PORT_NAME("4") PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_6) PORT_CODE(KEYCODE_6_PAD) PORT_NAME("6") - PORT_START("IN.3") // O3 - PORT_BIT( 0x1f, IP_ACTIVE_HIGH, IPT_UNUSED ) - - PORT_START("IN.4") // O4 + PORT_START("IN.3") // O4 PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_SLASH_PAD) PORT_NAME(UTF8_DIVIDE) PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_TILDE) PORT_NAME("1'sC") PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_B) PORT_NAME("b") PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_A) PORT_NAME("A") PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_C) PORT_NAME("C") - PORT_START("IN.5") // O5 + PORT_START("IN.4") // O5 PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_PLUS_PAD) PORT_NAME("+") PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_X) PORT_NAME("XOR") PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_2) PORT_CODE(KEYCODE_2_PAD) PORT_NAME("2") PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_1) PORT_CODE(KEYCODE_1_PAD) PORT_NAME("1") PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_3) PORT_CODE(KEYCODE_3_PAD) PORT_NAME("3") - PORT_START("IN.6") // O6 + PORT_START("IN.5") // O6 PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_CLOSEBRACE) PORT_NAME(")") PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_HOME) PORT_NAME("STO") PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_EQUALS) PORT_NAME("SUM") PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_END) PORT_NAME("RCL") PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_OPENBRACE) PORT_NAME("(") - PORT_START("IN.7") // O7 + PORT_START("IN.6") // O7 PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_ENTER) PORT_CODE(KEYCODE_ENTER_PAD) PORT_NAME("=") PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_BACKSPACE) PORT_NAME("CE") PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_STOP) PORT_CODE(KEYCODE_DEL_PAD) PORT_NAME(".") @@ -555,7 +853,7 @@ static INPUT_PORTS_START( tiprog ) PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_MINUS) PORT_NAME("+/-") // note: even though power buttons are on the matrix, they are not CPU-controlled - PORT_START("IN.8") // Vss! + PORT_START("IN.7") // Vss! PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_DEL) PORT_CODE(KEYCODE_PGUP) PORT_NAME("C/ON") PORT_CHANGED_MEMBER(DEVICE_SELF, ticalc1x_state, power_button, (void *)true) PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_G) PORT_NAME("DEC") PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_J) PORT_NAME("OCT") @@ -587,31 +885,28 @@ static INPUT_PORTS_START( tibusan1 ) PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_4) PORT_CODE(KEYCODE_4_PAD) PORT_NAME("4") PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_6) PORT_CODE(KEYCODE_6_PAD) PORT_NAME("6") - PORT_START("IN.3") // O3 - PORT_BIT( 0x1f, IP_ACTIVE_HIGH, IPT_UNUSED ) - - PORT_START("IN.4") // O4 + PORT_START("IN.3") // O4 PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_SLASH_PAD) PORT_NAME(UTF8_DIVIDE) PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_EQUALS) PORT_NAME(UTF8_CAPITAL_SIGMA"+ " UTF8_CAPITAL_SIGMA"-") PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_OPENBRACE) PORT_NAME("( AN-CI\"") PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_COMMA) PORT_NAME("x<>y L.R.") PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_CLOSEBRACE) PORT_NAME(") 1/x") - PORT_START("IN.5") // O5 + PORT_START("IN.4") // O5 PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_PLUS_PAD) PORT_NAME("+") PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_X) PORT_NAME("SUM x" UTF8_PRIME) PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_2) PORT_CODE(KEYCODE_2_PAD) PORT_NAME("2") PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_1) PORT_CODE(KEYCODE_1_PAD) PORT_NAME("1") PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_3) PORT_CODE(KEYCODE_3_PAD) PORT_NAME("3") - PORT_START("IN.6") // O6 + PORT_START("IN.5") // O6 PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F) PORT_NAME("FV") PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_N) PORT_NAME("N") PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_P) PORT_NAME("PMT") PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_I) PORT_NAME("%i") PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_V) PORT_NAME("PV") - PORT_START("IN.7") // O7 + PORT_START("IN.6") // O7 PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_ENTER) PORT_CODE(KEYCODE_ENTER_PAD) PORT_NAME("=") PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_E) PORT_NAME("EXC x" UTF8_PRIME) PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_STOP) PORT_CODE(KEYCODE_DEL_PAD) PORT_NAME(".") @@ -619,7 +914,7 @@ static INPUT_PORTS_START( tibusan1 ) PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_MINUS) PORT_NAME("+/-") // note: even though power buttons are on the matrix, they are not CPU-controlled - PORT_START("IN.8") // Vss! + PORT_START("IN.7") // Vss! 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_LSHIFT) PORT_CODE(KEYCODE_RSHIFT) PORT_NAME("2nd") PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Q) PORT_NAME("x" UTF8_POW_2" " UTF8_SQUAREROOT"x") @@ -628,97 +923,7 @@ static INPUT_PORTS_START( tibusan1 ) INPUT_PORTS_END - -/*************************************************************************** - - Machine Config(s) - -***************************************************************************/ - -WRITE_LINE_MEMBER(ticalc1x_state::auto_power_off) -{ - // TMS0980 auto power-off opcode - if (state) - { - m_power_on = false; - m_maincpu->set_input_line(INPUT_LINE_RESET, ASSERT_LINE); - } -} - - -void ticalc1x_state::machine_reset() -{ - m_power_on = true; -} - -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)); - - m_r = 0; - m_o = 0; - m_power_on = false; - - // register for savestates - save_item(NAME(m_display_state)); - save_item(NAME(m_display_cache)); - save_item(NAME(m_display_decay)); - - save_item(NAME(m_r)); - save_item(NAME(m_o)); - save_item(NAME(m_power_on)); -} - - -static MACHINE_CONFIG_START( tisr16, ticalc1x_state ) - - /* basic machine hardware */ - MCFG_CPU_ADD("maincpu", TMS1000, 250000) // guessed - 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_DEFAULT_LAYOUT(layout_tisr16) -MACHINE_CONFIG_END - - -static MACHINE_CONFIG_START( t9base, ticalc1x_state ) - - /* basic machine hardware */ - MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", ticalc1x_state, display_decay_tick, attotime::from_msec(1)) - - /* no video! */ - - /* no sound! */ -MACHINE_CONFIG_END - -static MACHINE_CONFIG_DERIVED( ti1270, t9base ) - - /* basic machine hardware */ - MCFG_CPU_ADD("maincpu", TMS0970, 250000) // guessed - MCFG_TMS1XXX_READ_K_CB(READ8(ticalc1x_state, ti1270_read_k)) - MCFG_TMS1XXX_WRITE_O_CB(WRITE16(ticalc1x_state, ti1270_write_o)) - MCFG_TMS1XXX_WRITE_R_CB(WRITE16(ticalc1x_state, ti1270_write_r)) - - MCFG_DEFAULT_LAYOUT(layout_ti1270) -MACHINE_CONFIG_END - -static MACHINE_CONFIG_DERIVED( wizatron, t9base ) - - /* basic machine hardware */ - MCFG_CPU_ADD("maincpu", TMS0970, 250000) // guessed - MCFG_TMS1XXX_READ_K_CB(READ8(ticalc1x_state, wizatron_read_k)) - MCFG_TMS1XXX_WRITE_O_CB(WRITE16(ticalc1x_state, wizatron_write_o)) - MCFG_TMS1XXX_WRITE_R_CB(WRITE16(ticalc1x_state, wizatron_write_r)) - - MCFG_DEFAULT_LAYOUT(layout_wizatron) -MACHINE_CONFIG_END - - -static MACHINE_CONFIG_DERIVED( ti30, t9base ) +static MACHINE_CONFIG_START( ti30, ticalc1x_state ) /* basic machine hardware */ MCFG_CPU_ADD("maincpu", TMS0980, 400000) // guessed @@ -727,11 +932,18 @@ static MACHINE_CONFIG_DERIVED( ti30, t9base ) 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_DEFAULT_LAYOUT(layout_ti30) + + /* no video! */ + + /* no sound! */ MACHINE_CONFIG_END + + /*************************************************************************** Game driver(s) @@ -748,9 +960,10 @@ ROM_START( tisr16 ) ROM_LOAD( "tms1000_sr16_opla.pla", 0, 365, CRC(29b08739) SHA1(d55f01e40a2d493d45ea422f12e63b01bcde08fb) ) ROM_END + ROM_START( ti1270 ) ROM_REGION( 0x0400, "maincpu", 0 ) - ROM_LOAD( "tms0974nl", 0x0000, 0x0400, CRC(48e09b4b) SHA1(17f27167164df223f9f06082ece4c3fc3900eda3) ) + ROM_LOAD( "za0355", 0x0000, 0x0400, CRC(48e09b4b) SHA1(17f27167164df223f9f06082ece4c3fc3900eda3) ) ROM_REGION( 782, "maincpu:ipla", 0 ) ROM_LOAD( "tms0970_ti1270_ipla.pla", 0, 782, CRC(05306ef8) SHA1(60a0a3c49ce330bce0c27f15f81d61461d0432ce) ) @@ -762,9 +975,10 @@ ROM_START( ti1270 ) ROM_LOAD( "tms0970_ti1270_spla.pla", 0, 157, CRC(56c37a4f) SHA1(18ecc20d2666e89673739056483aed5a261ae927) ) ROM_END + ROM_START( wizatron ) ROM_REGION( 0x0400, "maincpu", 0 ) - ROM_LOAD( "dp0907bs", 0x0000, 0x0400, CRC(5a6af094) SHA1(b1f27e1f13f4db3b052dd50fb08dbf9c4d8db26e) ) + ROM_LOAD( "za0379", 0x0000, 0x0400, CRC(5a6af094) SHA1(b1f27e1f13f4db3b052dd50fb08dbf9c4d8db26e) ) ROM_REGION( 782, "maincpu:ipla", 0 ) ROM_LOAD( "tms0970_wizatron_ipla.pla", 0, 782, CRC(05306ef8) SHA1(60a0a3c49ce330bce0c27f15f81d61461d0432ce) ) @@ -776,6 +990,37 @@ ROM_START( wizatron ) ROM_LOAD( "tms0970_wizatron_spla.pla", 0, 157, CRC(56c37a4f) SHA1(18ecc20d2666e89673739056483aed5a261ae927) ) ROM_END + +ROM_START( lilprof ) + ROM_REGION( 0x0400, "maincpu", 0 ) + 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_REGION( 860, "maincpu:mpla", 0 ) + ROM_LOAD( "tms0970_lilprof_mpla.pla", 0, 860, BAD_DUMP CRC(6ff5d51d) SHA1(59d3e5de290ba57694068ddba78d21a0c1edf427) ) // not verified + ROM_REGION( 352, "maincpu:opla", 0 ) + ROM_LOAD( "tms0970_lilprof_opla.pla", 0, 352, BAD_DUMP CRC(c74daf97) SHA1(c4948000196171b34d4fe9cdd2962a945da9883d) ) // not verified + 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_REGION( 860, "maincpu:mpla", 0 ) + ROM_LOAD( "tms0970_lilprof_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_REGION( 157, "maincpu:spla", 0 ) + ROM_LOAD( "tms0970_lilprof_spla.pla", 0, 157, CRC(234ca3a8) SHA1(76844dd87cb380a07c8fcbef143038087e98f138) ) +ROM_END + + ROM_START( ti30 ) ROM_REGION( 0x1000, "maincpu", 0 ) ROM_LOAD16_WORD( "tmc0981nl", 0x0000, 0x1000, CRC(41298a14) SHA1(06f654c70add4044a612d3a38b0c2831c188fd0c) ) @@ -790,6 +1035,7 @@ ROM_START( ti30 ) ROM_LOAD( "tms0980_ti30_spla.pla", 0, 157, CRC(399aa481) SHA1(72c56c58fde3fbb657d69647a9543b5f8fc74279) ) ROM_END + ROM_START( tibusan1 ) ROM_REGION( 0x1000, "maincpu", 0 ) ROM_LOAD16_WORD( "tmc0982nl", 0x0000, 0x1000, CRC(6954560a) SHA1(6c153a0c9239a811e3514a43d809964c06f8f88e) ) @@ -804,6 +1050,7 @@ ROM_START( tibusan1 ) ROM_LOAD( "tms0980_tibusan1_spla.pla", 0, 157, CRC(399aa481) SHA1(72c56c58fde3fbb657d69647a9543b5f8fc74279) ) ROM_END + ROM_START( tiprog ) ROM_REGION( 0x1000, "maincpu", 0 ) ROM_LOAD16_WORD( "za0675nl", 0x0000, 0x1000, CRC(82355854) SHA1(03fab373bce04df8ea3fe25352525e8539213626) ) @@ -820,11 +1067,14 @@ ROM_END -COMP( 1974, tisr16, 0, 0, tisr16, tisr16, driver_device, 0, "Texas Instruments", "SR-16 (Texas Instruments)", GAME_SUPPORTS_SAVE | GAME_NO_SOUND_HW ) +/* 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( 1976, ti1270, 0, 0, ti1270, ti1270, driver_device, 0, "Texas Instruments", "TI-1270", 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, ti1270, 0, 0, ti1270, ti1270, driver_device, 0, "Texas Instruments", "TI-1270", 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 ) -COMP( 1976, ti30, 0, 0, ti30, ti30, driver_device, 0, "Texas Instruments", "TI-30", GAME_SUPPORTS_SAVE | GAME_NO_SOUND_HW ) -COMP( 1977, tiprog, 0, 0, ti30, tiprog, driver_device, 0, "Texas Instruments", "TI Programmer", GAME_SUPPORTS_SAVE | GAME_NO_SOUND_HW ) -COMP( 1979, tibusan1, 0, 0, ti30, tibusan1, driver_device, 0, "Texas Instruments", "TI Business Analyst-I", GAME_SUPPORTS_SAVE | GAME_NO_SOUND_HW ) +COMP( 1976, ti30, 0, 0, ti30, ti30, driver_device, 0, "Texas Instruments", "TI-30", GAME_SUPPORTS_SAVE | GAME_NO_SOUND_HW ) +COMP( 1977, tiprog, 0, 0, ti30, tiprog, driver_device, 0, "Texas Instruments", "TI Programmer", GAME_SUPPORTS_SAVE | GAME_NO_SOUND_HW ) +COMP( 1979, tibusan1, 0, 0, ti30, tibusan1, driver_device, 0, "Texas Instruments", "TI Business Analyst-I", GAME_SUPPORTS_SAVE | GAME_NO_SOUND_HW ) diff --git a/src/mess/drivers/tispeak.c b/src/mess/drivers/tispeak.c index 1e05f4cc2a5..cc2b432106f 100644 --- a/src/mess/drivers/tispeak.c +++ b/src/mess/drivers/tispeak.c @@ -303,25 +303,40 @@ public: m_tms5100(*this, "tms5100"), m_tms6100(*this, "tms6100"), m_cart(*this, "cartslot"), - m_button_matrix(*this, "IN") + m_button_matrix(*this, "IN"), + m_display_wait(33), + m_display_maxy(1), + m_display_maxx(0) { } + // devices required_device m_maincpu; required_device m_tms5100; required_device m_tms6100; optional_device m_cart; required_ioport_array<9> m_button_matrix; - UINT16 m_r; - UINT16 m_o; + // 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) - UINT16 m_display_state[0x10]; - UINT16 m_display_cache[0x10]; - UINT8 m_display_decay[0x100]; - void display_update(); 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; UINT8* m_cart_base; DECLARE_DEVICE_IMAGE_LOAD_MEMBER(tispeak_cartridge); @@ -386,47 +401,47 @@ DRIVER_INIT_MEMBER(tispeak_state, lantutor) ***************************************************************************/ -// The device strobes the filament-enable very fast, it is unnoticeable to the user. +// The device may strobe the outputs very fast, it is unnoticeable to the user. // To prevent flickering here, we need to simulate a decay. -// decay time, in steps of 1ms -#define DISPLAY_DECAY_TIME 40 - void tispeak_state::display_update() { - int filament_on = (m_r & 0x8000) ? 1 : 0; - UINT16 active_state[0x10]; + UINT32 active_state[0x20]; - for (int i = 0; i < 0x10; i++) + for (int y = 0; y < m_display_maxy; y++) { - // update current state - m_display_state[i] = (m_r >> i & 1) ? m_o : 0; + active_state[y] = 0; - active_state[i] = 0; - - for (int j = 0; j < 0x10; j++) + for (int x = 0; x < m_display_maxx; x++) { - int di = j << 4 | i; - // turn on powered segments - if (m_power_on && filament_on && m_display_state[i] >> j & 1) - m_display_decay[di] = DISPLAY_DECAY_TIME; + 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[di] != 0) ? 1 : 0; - active_state[i] |= (ds << j); + int ds = (m_display_decay[y][x] != 0) ? 1 : 0; + active_state[y] |= (ds << x); } } // on difference, send to output - for (int i = 0; i < 0x10; i++) - if (m_display_cache[i] != active_state[i]) + for (int y = 0; y < m_display_maxy; y++) + if (m_display_cache[y] != active_state[y]) { - output_set_digit_value(i, active_state[i] & 0x3fff); + if (m_display_segmask[y] != 0) + output_set_digit_value(y, active_state[y] & m_display_segmask[y]); - // lampxyy where x=digit, y=segment - for (int j = 0; j < 0x10; j++) - output_set_lamp_value(i*100 + j, active_state[i] >> j & 1); + 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)); @@ -435,10 +450,27 @@ void tispeak_state::display_update() TIMER_DEVICE_CALLBACK_MEMBER(tispeak_state::display_decay_tick) { // slowly turn off unpowered segments - for (int i = 0; i < 0x100; i++) - if (!(m_display_state[i & 0xf] >> (i>>4) & 1) && m_display_decay[i]) - m_display_decay[i]--; + 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 tispeak_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(); } @@ -467,15 +499,17 @@ READ8_MEMBER(tispeak_state::snspell_read_k) WRITE16_MEMBER(tispeak_state::snspell_write_r) { - // R0-R7: input mux and select digit (+R8 if the device has 9 digits) - // R15: filament on (handled in leds_update) + // 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(); + // R0-R7: input mux and select digit (+R8 if the device has 9 digits) // other bits: MCU internal use - m_r = data; - display_update(); + m_r = data & 0x21ff; + display_matrix_seg(16, 16, m_o, m_r, 0x3fff); } WRITE16_MEMBER(tispeak_state::snspell_write_o) @@ -483,8 +517,7 @@ 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_update(); + display_matrix_seg(16, 16, m_o, m_r, 0x3fff); } @@ -505,8 +538,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_update(); + display_matrix_seg(16, 16, m_o, m_r, 0x3fff); } @@ -515,8 +547,9 @@ 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_r = data; - display_update(); + m_filament_on = data & 0x8000; + m_r = data & 0x21ff; + display_matrix_seg(16, 16, m_o, m_r, 0x3fff); } @@ -706,21 +739,29 @@ 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_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)); + /* 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)); // init cartridge if (m_cart != NULL && m_cart->exists()) @@ -760,7 +801,7 @@ static MACHINE_CONFIG_START( snmath, tispeak_state ) MCFG_TMS5110_ADDR_CB(DEVWRITE8("tms6100", tms6100_device, tms6100_addr_w)) MCFG_TMS5110_DATA_CB(DEVREADLINE("tms6100", tms6100_device, tms6100_data_r)) MCFG_TMS5110_ROMCLK_CB(DEVWRITELINE("tms6100", tms6100_device, tms6100_romclock_w)) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.5) MACHINE_CONFIG_END static MACHINE_CONFIG_DERIVED( snspell, snmath ) @@ -898,24 +939,6 @@ ROM_END ROM_START( snmath ) - ROM_REGION( 0x1000, "maincpu", 0 ) - // typed in from patent 4946391, verified with source code - // BTANB note: Mix It does not work at all, this is an original bug in the prototype. There are probably other minor bugs too. - ROM_LOAD( "us4946391_t2074", 0x0000, 0x1000, CRC(011f0c2d) SHA1(d2e14d72e03ca864abd51da78ffb71a9da82f624) ) - - 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_REGION( 1246, "maincpu:opla", 0 ) - ROM_LOAD( "tms0270_cd2708_opla.pla", 0, 1246, BAD_DUMP CRC(1abad753) SHA1(53d20b519ed73ce248368047a056836afbe3cd46) ) // " - - ROM_REGION( 0x8000, "tms6100", 0 ) - ROM_LOAD( "cd2392.vsm", 0x0000, 0x4000, CRC(4ed2e920) SHA1(8896f29e25126c1e4d9a47c9a325b35dddecc61f) ) - ROM_LOAD( "cd2393.vsm", 0x4000, 0x4000, CRC(571d5b5a) SHA1(83284755d9b77267d320b5b87fdc39f352433715) ) -ROM_END - -ROM_START( snmatha ) ROM_REGION( 0x1000, "maincpu", 0 ) ROM_LOAD( "cd2708n2l", 0x0000, 0x1000, CRC(35937360) SHA1(69c362c75bb459056c09c7fab37c91040485474b) ) @@ -934,6 +957,24 @@ ROM_START( snmatha ) ROM_RELOAD( 0x7000, 0x1000 ) ROM_END +ROM_START( snmathp ) + ROM_REGION( 0x1000, "maincpu", 0 ) + // typed in from patent 4946391, verified with source code + // BTANB note: Mix It does not work at all, this is an original bug in the prototype. There are probably other minor bugs too. + ROM_LOAD( "us4946391_t2074", 0x0000, 0x1000, CRC(011f0c2d) SHA1(d2e14d72e03ca864abd51da78ffb71a9da82f624) ) + + 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_REGION( 1246, "maincpu:opla", 0 ) + ROM_LOAD( "tms0270_cd2708_opla.pla", 0, 1246, BAD_DUMP CRC(1abad753) SHA1(53d20b519ed73ce248368047a056836afbe3cd46) ) // " + + ROM_REGION( 0x8000, "tms6100", 0 ) + ROM_LOAD( "cd2392.vsm", 0x0000, 0x4000, CRC(4ed2e920) SHA1(8896f29e25126c1e4d9a47c9a325b35dddecc61f) ) + ROM_LOAD( "cd2393.vsm", 0x4000, 0x4000, CRC(571d5b5a) SHA1(83284755d9b77267d320b5b87fdc39f352433715) ) +ROM_END + ROM_START( lantutor ) ROM_REGION( 0x1000, "maincpu", 0 ) @@ -951,14 +992,14 @@ ROM_END -COMP( 1978, snspell, 0, 0, snspell, snspell, tispeak_state, snspell, "Texas Instruments", "Speak & Spell (US prototype)", GAME_IMPERFECT_SOUND ) // also US set 1 -COMP( 1980, snspella, snspell, 0, snspell, snspell, tispeak_state, snspell, "Texas Instruments", "Speak & Spell (US set 2)", GAME_NOT_WORKING | GAME_IMPERFECT_SOUND ) -COMP( 1978, snspelluk, snspell, 0, snspell, snspell, tispeak_state, snspell, "Texas Instruments", "Speak & Spell (UK set 1)", GAME_NOT_WORKING | GAME_IMPERFECT_SOUND ) -COMP( 1981, snspelluka, snspell, 0, snspell, snspell, tispeak_state, snspell, "Texas Instruments", "Speak & Spell (UK set 2)", GAME_NOT_WORKING | GAME_IMPERFECT_SOUND ) -COMP( 1979, snspelljp, snspell, 0, snspell, snspell, tispeak_state, snspell, "Texas Instruments", "Speak & Spell (Japan)", GAME_NOT_WORKING | GAME_IMPERFECT_SOUND ) -COMP( 1980, ladictee, snspell, 0, snspell, snspell, tispeak_state, snspell, "Texas Instruments", "La Dictee Magique (France)", GAME_NOT_WORKING | GAME_IMPERFECT_SOUND ) // doesn't work due to missing CD2702 MCU dump, German/Italian version has CD2702 too +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( 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 +COMP( 1980, ladictee, snspell, 0, snspell, snspell, tispeak_state, snspell, "Texas Instruments", "La Dictee Magique (France)", GAME_SUPPORTS_SAVE | GAME_IMPERFECT_SOUND | GAME_NOT_WORKING ) // doesn't work due to missing CD2702 MCU dump, German/Italian version has CD2702 too -COMP( 1980, snmath, 0, 0, snmath, snmath, driver_device, 0, "Texas Instruments", "Speak & Math (US prototype)", GAME_IMPERFECT_SOUND ) // also US set 1 -COMP( 1986, snmatha, snmath, 0, snmath, snmath, driver_device, 0, "Texas Instruments", "Speak & Math (US set 2)", GAME_IMPERFECT_SOUND ) +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( 1979, lantutor, 0, 0, lantutor, lantutor, tispeak_state, lantutor, "Texas Instruments", "Language Tutor (prototype)", GAME_NOT_WORKING | 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/gamate.h b/src/mess/includes/gamate.h index 55a0be4c6a1..c230390648c 100644 --- a/src/mess/includes/gamate.h +++ b/src/mess/includes/gamate.h @@ -14,13 +14,15 @@ // ======================> gamate_sound_device -class gamate_sound_device : public device_t, - public device_sound_interface +class gamate_sound_device : public device_t, public device_sound_interface { public: gamate_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); ~gamate_sound_device() { } + DECLARE_WRITE8_MEMBER( device_w ); + DECLARE_READ8_MEMBER( device_r ); + protected: // device-level overrides virtual void device_start(); @@ -28,10 +30,6 @@ protected: // sound stream update overrides virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); -public: - DECLARE_WRITE8_MEMBER( device_w ); - DECLARE_READ8_MEMBER( device_r ); - private: static const int DAConverter[]; @@ -40,36 +38,58 @@ private: sound_stream *m_mixer_channel; struct Tone { - Tone() : - envelope_on(false), - level(false), - tone(false), full_cycle(false), - volume(0), - pos(0), - size(0) - { - } + Tone() : + envelope_on(false), + level(false), + tone(false), full_cycle(false), + volume(0), + pos(0), + size(0) + {} - bool envelope_on, level; - bool tone/*else noise*/, full_cycle/* else square signal/pulse */; - int volume; - int pos, size; + bool envelope_on, level; + bool tone/*else noise*/, full_cycle/* else square signal/pulse */; + int volume; + int pos, size; }; - enum { Right, Left, Both }; + + enum + { + Right, + Left, + Both + }; + Tone m_channels[3]; - struct Noise { - Noise(): state(1), level(false), step(0.0), pos(0.0) {} - int state; - bool level; - double step, pos; + + struct Noise + { + Noise(): + state(1), + level(false), + step(0.0), + pos(0.0) + {} + + int state; + bool level; + double step, pos; } noise; - struct Envelope { - Envelope():control(0), index(0), first(false) {} - int control; - int index; - bool first; - double step, pos; + + struct Envelope + { + Envelope(): + control(0), + index(0), + first(false) + {} + + int control; + int index; + bool first; + double step, pos; } envelope; + UINT8 reg[14]; }; diff --git a/src/mess/includes/hh_tms1k.h b/src/mess/includes/hh_tms1k.h new file mode 100644 index 00000000000..1e10012bce0 --- /dev/null +++ b/src/mess/includes/hh_tms1k.h @@ -0,0 +1,160 @@ +// license:BSD-3-Clause +// copyright-holders:hap, Sean Riddle, Kevin Horton +/* + + TMS1000 MCU series tabletops/handhelds or other simple devices. + +*/ + +#ifndef _HH_TMS1K_H_ +#define _HH_TMS1K_H_ + + +#include "emu.h" +#include "cpu/tms0980/tms0980.h" +#include "sound/speaker.h" + + +class hh_tms1k_state : public driver_device +{ +public: + hh_tms1k_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) + { } + + // devices + required_device m_maincpu; + optional_ioport_array<7> m_inp_matrix; // max 7 + optional_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); + + // 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(int maxx, int maxy, UINT32 setx, UINT32 sety); + + // game-specific handlers + void mathmagi_display(); + DECLARE_WRITE16_MEMBER(mathmagi_write_r); + DECLARE_WRITE16_MEMBER(mathmagi_write_o); + DECLARE_READ8_MEMBER(mathmagi_read_k); + + void amaztron_display(); + DECLARE_WRITE16_MEMBER(amaztron_write_r); + DECLARE_WRITE16_MEMBER(amaztron_write_o); + DECLARE_READ8_MEMBER(amaztron_read_k); + + void tc4_display(); + DECLARE_WRITE16_MEMBER(tc4_write_r); + DECLARE_WRITE16_MEMBER(tc4_write_o); + DECLARE_READ8_MEMBER(tc4_read_k); + + void ebball_display(); + DECLARE_WRITE16_MEMBER(ebball_write_r); + DECLARE_WRITE16_MEMBER(ebball_write_o); + DECLARE_READ8_MEMBER(ebball_read_k); + + void ebball2_display(); + DECLARE_WRITE16_MEMBER(ebball2_write_r); + DECLARE_WRITE16_MEMBER(ebball2_write_o); + DECLARE_READ8_MEMBER(ebball2_read_k); + + void ebball3_display(); + DECLARE_WRITE16_MEMBER(ebball3_write_r); + DECLARE_WRITE16_MEMBER(ebball3_write_o); + DECLARE_READ8_MEMBER(ebball3_read_k); + void ebball3_set_clock(); + DECLARE_INPUT_CHANGED_MEMBER(ebball3_difficulty_switch); + DECLARE_MACHINE_RESET(ebball3); + + DECLARE_WRITE16_MEMBER(elecdet_write_r); + DECLARE_WRITE16_MEMBER(elecdet_write_o); + DECLARE_READ8_MEMBER(elecdet_read_k); + + void starwbc_display(); + DECLARE_WRITE16_MEMBER(starwbc_write_r); + DECLARE_WRITE16_MEMBER(starwbc_write_o); + DECLARE_READ8_MEMBER(starwbc_read_k); + + DECLARE_WRITE16_MEMBER(comp4_write_r); + DECLARE_WRITE16_MEMBER(comp4_write_o); + DECLARE_READ8_MEMBER(comp4_read_k); + + DECLARE_WRITE16_MEMBER(simon_write_r); + DECLARE_WRITE16_MEMBER(simon_write_o); + DECLARE_READ8_MEMBER(simon_read_k); + + DECLARE_WRITE16_MEMBER(ssimon_write_r); + DECLARE_WRITE16_MEMBER(ssimon_write_o); + DECLARE_READ8_MEMBER(ssimon_read_k); + + DECLARE_WRITE16_MEMBER(cnsector_write_r); + DECLARE_WRITE16_MEMBER(cnsector_write_o); + DECLARE_READ8_MEMBER(cnsector_read_k); + + DECLARE_WRITE16_MEMBER(merlin_write_r); + DECLARE_WRITE16_MEMBER(merlin_write_o); + DECLARE_READ8_MEMBER(merlin_read_k); + + DECLARE_WRITE16_MEMBER(stopthief_write_r); + DECLARE_WRITE16_MEMBER(stopthief_write_o); + DECLARE_READ8_MEMBER(stopthief_read_k); + + DECLARE_WRITE16_MEMBER(bankshot_write_r); + DECLARE_WRITE16_MEMBER(bankshot_write_o); + DECLARE_READ8_MEMBER(bankshot_read_k); + + DECLARE_WRITE16_MEMBER(splitsec_write_r); + DECLARE_WRITE16_MEMBER(splitsec_write_o); + DECLARE_READ8_MEMBER(splitsec_read_k); + + void tandy12_display(); + DECLARE_WRITE16_MEMBER(tandy12_write_r); + DECLARE_WRITE16_MEMBER(tandy12_write_o); + DECLARE_READ8_MEMBER(tandy12_read_k); + +protected: + virtual void machine_start(); + virtual void machine_reset(); +}; + + +// LED segments +enum +{ + lA = 0x01, + lB = 0x02, + lC = 0x04, + lD = 0x08, + lE = 0x10, + lF = 0x20, + lG = 0x40, + lDP = 0x80 +}; + + +#endif /* _HH_TMS1K_H_ */ diff --git a/src/mess/includes/imds2.h b/src/mess/includes/imds2.h new file mode 100644 index 00000000000..62887b4b34e --- /dev/null +++ b/src/mess/includes/imds2.h @@ -0,0 +1,122 @@ +// license:MAME +// copyright-holders:fulivi +// Driver for Intel Intellec MDS series-II + +#ifndef _IMDS2_H_ +#define _IMDS2_H_ + +#include "emu.h" +#include "cpu/i8085/i8085.h" +#include "cpu/mcs48/mcs48.h" +#include "machine/i8257.h" +#include "video/i8275.h" +#include "sound/beep.h" +#include "machine/pit8253.h" +#include "machine/pic8259.h" +#include "machine/i8271.h" +#include "imagedev/flopdrv.h" + +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 m_ipccpu; + required_device m_ipcsyspic; + required_device m_ipclocpic; + required_device m_ioccpu; + required_device m_iocdma; + required_device m_ioccrtc; + required_device m_iocbeep; + required_device m_ioctimer; + required_device m_iocfdc; + required_device m_kbcpu; + required_device m_palette; + required_device m_gfxdecode; + required_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 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/layout/ebball2.lay b/src/mess/layout/ebball2.lay new file mode 100644 index 00000000000..91d3427f5e3 --- /dev/null +++ b/src/mess/layout/ebball2.lay @@ -0,0 +1,215 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/mess/layout/ebball3.lay b/src/mess/layout/ebball3.lay index 7338a3cc1d6..3e6a5df9031 100644 --- a/src/mess/layout/ebball3.lay +++ b/src/mess/layout/ebball3.lay @@ -156,6 +156,8 @@ + + diff --git a/src/mess/layout/hh_hmcs40_test.lay b/src/mess/layout/hh_hmcs40_test.lay index 55266384f2e..95fdc39d59d 100644 --- a/src/mess/layout/hh_hmcs40_test.lay +++ b/src/mess/layout/hh_hmcs40_test.lay @@ -16,12 +16,12 @@ - + - + - + @@ -55,6 +55,14 @@ + + + + + + + + @@ -88,6 +96,14 @@ + + + + + + + + @@ -121,6 +137,14 @@ + + + + + + + + @@ -154,6 +178,14 @@ + + + + + + + + @@ -187,6 +219,14 @@ + + + + + + + + @@ -220,6 +260,14 @@ + + + + + + + + @@ -253,6 +301,14 @@ + + + + + + + + @@ -286,6 +342,14 @@ + + + + + + + + @@ -319,6 +383,14 @@ + + + + + + + + @@ -352,6 +424,14 @@ + + + + + + + + @@ -385,6 +465,14 @@ + + + + + + + + @@ -418,6 +506,14 @@ + + + + + + + + @@ -451,6 +547,14 @@ + + + + + + + + @@ -484,6 +588,14 @@ + + + + + + + + @@ -517,6 +629,14 @@ + + + + + + + + @@ -550,6 +670,14 @@ + + + + + + + + diff --git a/src/mess/layout/mbdtower.lay b/src/mess/layout/mbdtower.lay new file mode 100644 index 00000000000..aff46ef4eff --- /dev/null +++ b/src/mess/layout/mbdtower.lay @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/mess/layout/ssimon.lay b/src/mess/layout/ssimon.lay new file mode 100644 index 00000000000..940ef1a955e --- /dev/null +++ b/src/mess/layout/ssimon.lay @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/src/mess/machine/m24_kbd.c b/src/mess/machine/m24_kbd.c new file mode 100644 index 00000000000..5a60d22e555 --- /dev/null +++ b/src/mess/machine/m24_kbd.c @@ -0,0 +1,290 @@ +#include "m24_kbd.h" + +const device_type M24_KEYBOARD = &device_creator; + +ROM_START( m24_keyboard ) + ROM_REGION(0x800, "mcu", 0) + ROM_LOAD("m24_8049_int.bin", 0x0000, 0x800, CRC(ef26ca15) SHA1(b5076d40c255e17dc93478e2254ea19aff4918b3)) +ROM_END + + +const rom_entry *m24_keyboard_device::device_rom_region() const +{ + return ROM_NAME( m24_keyboard ); +} + +static ADDRESS_MAP_START( m24_keyboard_io, AS_IO, 8, m24_keyboard_device ) + AM_RANGE(MCS48_PORT_BUS, MCS48_PORT_BUS) AM_WRITE(bus_w) + AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_READWRITE(p1_r, p1_w) + AM_RANGE(MCS48_PORT_P2, MCS48_PORT_P2) AM_READ(p2_r) AM_WRITENOP + AM_RANGE(MCS48_PORT_T0, MCS48_PORT_T0) AM_READ(t0_r) + AM_RANGE(MCS48_PORT_T1, MCS48_PORT_T1) AM_READ(t1_r) +ADDRESS_MAP_END + +static MACHINE_CONFIG_FRAGMENT( m24_keyboard ) + MCFG_CPU_ADD("mcu", I8049, XTAL_6MHz) + MCFG_CPU_IO_MAP(m24_keyboard_io) +MACHINE_CONFIG_END + +machine_config_constructor m24_keyboard_device::device_mconfig_additions() const +{ + return MACHINE_CONFIG_NAME( m24_keyboard ); +} + +INPUT_PORTS_START( m24_keyboard ) + PORT_START("ROW.0") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_1) PORT_CHAR('1') PORT_CHAR('!') + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Q) PORT_CHAR('q') PORT_CHAR('Q') + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_A) PORT_CHAR('a') PORT_CHAR('A') + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Z) PORT_CHAR('z') PORT_CHAR('Z') + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_7_PAD) PORT_CHAR(UCHAR_MAMEKEY(7_PAD)) + PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F1) PORT_CHAR(UCHAR_MAMEKEY(F1)) + + PORT_START("ROW.1") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_2) PORT_CHAR('2') PORT_CHAR('@') + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_W) PORT_CHAR('w') PORT_CHAR('W') + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_S) PORT_CHAR('s') PORT_CHAR('S') + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_X) PORT_CHAR('x') PORT_CHAR('X') + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_8_PAD) PORT_CHAR(UCHAR_MAMEKEY(8_PAD)) + PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F2) PORT_CHAR(UCHAR_MAMEKEY(F2)) + + PORT_START("ROW.2") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_3) PORT_CHAR('3') PORT_CHAR('#') + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_E) PORT_CHAR('e') PORT_CHAR('E') + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_D) PORT_CHAR('d') PORT_CHAR('D') + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_C) PORT_CHAR('c') PORT_CHAR('C') + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_9_PAD) PORT_CHAR(UCHAR_MAMEKEY(9_PAD)) + PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F3) PORT_CHAR(UCHAR_MAMEKEY(F3)) + + PORT_START("ROW.3") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_4) PORT_CHAR('4') PORT_CHAR('$') + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_R) PORT_CHAR('r') PORT_CHAR('R') + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F) PORT_CHAR('f') PORT_CHAR('F') + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_V) PORT_CHAR('v') PORT_CHAR('V') + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_4_PAD) PORT_CHAR(UCHAR_MAMEKEY(4_PAD)) + PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F4) PORT_CHAR(UCHAR_MAMEKEY(F4)) + + PORT_START("ROW.4") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_5) PORT_CHAR('5') PORT_CHAR('%') + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_T) PORT_CHAR('t') PORT_CHAR('T') + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_G) PORT_CHAR('g') PORT_CHAR('G') + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_B) PORT_CHAR('b') PORT_CHAR('B') + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_5_PAD) PORT_CHAR(UCHAR_MAMEKEY(5_PAD)) + PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F5) PORT_CHAR(UCHAR_MAMEKEY(F5)) + + PORT_START("ROW.5") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_6) PORT_CHAR('6') PORT_CHAR('^') + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Y) PORT_CHAR('y') PORT_CHAR('Y') + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_H) PORT_CHAR('h') PORT_CHAR('H') + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_N) PORT_CHAR('n') PORT_CHAR('N') + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_6_PAD) PORT_CHAR(UCHAR_MAMEKEY(6_PAD)) + PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F6) PORT_CHAR(UCHAR_MAMEKEY(F6)) + + PORT_START("ROW.6") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_7) PORT_CHAR('7') PORT_CHAR('&') + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_U) PORT_CHAR('u') PORT_CHAR('U') + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_J) PORT_CHAR('j') PORT_CHAR('J') + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_M) PORT_CHAR('m') PORT_CHAR('M') + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_1_PAD) PORT_CHAR(UCHAR_MAMEKEY(1_PAD)) + PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F7) PORT_CHAR(UCHAR_MAMEKEY(F7)) + + PORT_START("ROW.7") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_8) PORT_CHAR('8') PORT_CHAR('*') + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_I) PORT_CHAR('i') PORT_CHAR('I') + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_K) PORT_CHAR('k') PORT_CHAR('K') + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_COMMA) PORT_CHAR(',') PORT_CHAR('<') + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_2_PAD) PORT_CHAR(UCHAR_MAMEKEY(2_PAD)) + PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F8) PORT_CHAR(UCHAR_MAMEKEY(F8)) + + PORT_START("ROW.8") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_9) PORT_CHAR('9') PORT_CHAR('(') + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_O) PORT_CHAR('o') PORT_CHAR('O') + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_L) PORT_CHAR('l') PORT_CHAR('L') + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_STOP) PORT_CHAR('.') PORT_CHAR('>') + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_3_PAD) PORT_CHAR(UCHAR_MAMEKEY(3_PAD)) + PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F9) PORT_CHAR(UCHAR_MAMEKEY(F9)) + + PORT_START("ROW.9") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_0) PORT_CHAR('0') PORT_CHAR(')') + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_P) PORT_CHAR('p') PORT_CHAR('P') + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_COLON) PORT_CHAR(';') PORT_CHAR('+') + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_SLASH) PORT_CHAR('?') PORT_CHAR('/') + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_DEL_PAD) PORT_CHAR(UCHAR_MAMEKEY(DEL_PAD)) + PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F10) PORT_CHAR(UCHAR_MAMEKEY(F10)) + + PORT_START("ROW.10") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_MINUS) PORT_CHAR('-') PORT_CHAR('_') + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_OPENBRACE) PORT_CHAR('[') PORT_CHAR('{') + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_QUOTE) PORT_CHAR('\'') PORT_CHAR('"') + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_EQUALS) PORT_CHAR('=') PORT_CHAR('+') + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_0_PAD) PORT_CHAR(UCHAR_MAMEKEY(0_PAD)) + PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED ) + + PORT_START("ROW.11") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_CLOSEBRACE) PORT_CHAR(']') PORT_CHAR('}') + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_TILDE) PORT_CHAR('`') PORT_CHAR('~') + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_ENTER) PORT_CHAR('\r') + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_SCRLOCK) PORT_CHAR(UCHAR_MAMEKEY(SCRLOCK)) + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED ) + + PORT_START("ROW.12") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_BACKSPACE) PORT_CHAR(8) + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_BACKSLASH) PORT_CHAR('\\') PORT_CHAR('|') + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_ESC) PORT_CHAR(UCHAR_MAMEKEY(ESC)) + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_TAB) PORT_CHAR('\t') + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED ) + + PORT_START("ROW.13") + 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_SPACE) PORT_CHAR(' ') + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED ) + + PORT_START("ROW.14") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_PLUS_PAD) PORT_CHAR(UCHAR_MAMEKEY(PLUS_PAD)) + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_MINUS_PAD) PORT_CHAR(UCHAR_MAMEKEY(MINUS_PAD)) + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_ASTERISK) PORT_CHAR(UCHAR_MAMEKEY(ASTERISK)) + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED ) + + PORT_START("ROW.15") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Unknown 0x2A") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_RSHIFT) PORT_CODE(KEYCODE_LSHIFT) PORT_CHAR(UCHAR_SHIFT_1) + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_CAPSLOCK) PORT_CHAR(UCHAR_MAMEKEY(CAPSLOCK)) + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_LALT) PORT_CODE(KEYCODE_RALT) PORT_CHAR(UCHAR_MAMEKEY(LALT)) + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_NUMLOCK) PORT_CHAR(UCHAR_MAMEKEY(NUMLOCK)) + PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_LCONTROL) PORT_CODE(KEYCODE_RCONTROL) PORT_CHAR(UCHAR_SHIFT_2) + + PORT_START("MOUSEBTN") + 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_UNUSED ) + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("Left Btn") PORT_CODE(MOUSECODE_BUTTON1) + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("Middle Btn") PORT_CODE(MOUSECODE_BUTTON3) + PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("Right Btn") PORT_CODE(MOUSECODE_BUTTON2) + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED ) +INPUT_PORTS_END + + +ioport_constructor m24_keyboard_device::device_input_ports() const +{ + return INPUT_PORTS_NAME( m24_keyboard ); +} + +m24_keyboard_device::m24_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + : device_t(mconfig, M24_KEYBOARD, "Olivetti M24 Keyboard", tag, owner, clock, "m24_kbd", __FILE__), + m_rows(*this, "ROW"), + m_mousebtn(*this, "MOUSEBTN"), + m_out_data(*this), + m_mcu(*this, "mcu") +{ +} + +void m24_keyboard_device::device_start() +{ + m_out_data.resolve_safe(); + m_out_data(1); + m_reset_timer = timer_alloc(); +} + +void m24_keyboard_device::device_reset() +{ + m_kbcdata = true; +} + +void m24_keyboard_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) +{ + m_mcu->set_input_line(INPUT_LINE_RESET, ASSERT_LINE); + m_out_data(1); +} + +READ8_MEMBER( m24_keyboard_device::p1_r ) +{ + return m_p1 | (m_kbcdata ? 0 : 2); +} + +WRITE8_MEMBER( m24_keyboard_device::p1_w ) +{ + // bit 3 and 4 are leds and bits 6 and 7 are jumpers to ground + m_p1 = data & ~0xc0; + if(m_p1 & 4) + m_p1 |= 2; + else + m_p1 &= ~2; + m_out_data(!BIT(data, 2)); +} + +READ8_MEMBER( m24_keyboard_device::p2_r ) +{ + return (m_keypress << 7) | m_mousebtn->read(); +} + +READ8_MEMBER( m24_keyboard_device::t0_r ) +{ + return 0; +} + +READ8_MEMBER( m24_keyboard_device::t1_r ) +{ + return 0; +} + +WRITE8_MEMBER( m24_keyboard_device::bus_w ) +{ + UINT8 col = m_rows[(data >> 3) & 0xf]->read(); + m_keypress = (col & (1 << (data & 7))) ? 1 : 0; +} + +WRITE_LINE_MEMBER( m24_keyboard_device::clock_w ) +{ + m_mcu->set_input_line(MCS48_INPUT_IRQ, !state); + if(!state) + m_reset_timer->adjust(attotime::from_msec(50)); + else + { + m_reset_timer->adjust(attotime::never); + m_mcu->set_input_line(INPUT_LINE_RESET, CLEAR_LINE); + } +} + +WRITE_LINE_MEMBER( m24_keyboard_device::data_w ) +{ + m_kbcdata = state; +} diff --git a/src/mess/machine/m24_kbd.h b/src/mess/machine/m24_kbd.h new file mode 100644 index 00000000000..6a5dac2c6f7 --- /dev/null +++ b/src/mess/machine/m24_kbd.h @@ -0,0 +1,45 @@ +#ifndef M24KBD_H_ +#define M24KBD_H_ + +#include "emu.h" +#include "cpu/mcs48/mcs48.h" + +#define MCFG_M24_KEYBOARD_OUT_DATA_HANDLER(_devcb) \ + devcb = &m24_keyboard_device::set_out_data_handler(*device, DEVCB_##_devcb); + +class m24_keyboard_device : public device_t +{ +public: + m24_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + + template static devcb_base &set_out_data_handler(device_t &device, _Object object) { return downcast(device).m_out_data.set_callback(object); } + + virtual const rom_entry *device_rom_region() const; + virtual machine_config_constructor device_mconfig_additions() const; + virtual ioport_constructor device_input_ports() const; + + void device_start(); + void device_reset(); + void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr); + + DECLARE_WRITE8_MEMBER(bus_w); + DECLARE_READ8_MEMBER(p1_r); + DECLARE_WRITE8_MEMBER(p1_w); + DECLARE_READ8_MEMBER(p2_r); + DECLARE_READ8_MEMBER(t0_r); + DECLARE_READ8_MEMBER(t1_r); + DECLARE_WRITE_LINE_MEMBER(clock_w); + DECLARE_WRITE_LINE_MEMBER(data_w); +private: + required_ioport_array<16> m_rows; + required_ioport m_mousebtn; + UINT8 m_p1; + bool m_keypress, m_kbcdata; + devcb_write_line m_out_data; + required_device m_mcu; + emu_timer *m_reset_timer; +}; + +extern const device_type M24_KEYBOARD; + +#endif /* M24KBD_H_ */ diff --git a/src/mess/mess.lst b/src/mess/mess.lst index 4c788c05d81..643bd5452b8 100644 --- a/src/mess/mess.lst +++ b/src/mess/mess.lst @@ -1075,7 +1075,7 @@ snspelluka snspelljp ladictee snmath -snmatha +snmathp lantutor // Texas Instruments Calculators @@ -1085,6 +1085,8 @@ ti30 // 1976 TI-30 tiprog tibusan1 wizatron +lilprof +lilprof78 ti73 // 1990 TI-73 ti74 // 1985 TI-74 ti95 // 1986 TI-95 @@ -1655,13 +1657,14 @@ vt320 // 1987 Digital Equipment Corporation vt520 // 1994 Digital Equipment Corporation //vt525 vk100 // 1980 Digital Equipment Corporation -dectalk // 1982 Digital Equipment Corporation +dectalk // 1983 Digital Equipment Corporation //vt240 // 1983 Digital Equipment Corporation //vt241 mc7105 // Elektronika MC7105 rainbow100a // 1982 DEC Rainbow 100-A rainbow // 1983 DEC Rainbow 100-B rainbow190 // 1985 DEC Rainbow 190 +//dtc03 // 1985 Digital Equipment Corporation // Memotech mtx512 // 1983 Memotech MTX 512 @@ -2097,6 +2100,8 @@ swtpc09i // S09, DC4 Floppy + PIA IDE SBUG rom - FLEX swtpc09u // S09, DMF2 Floppy UNIBUG rom - UniFLEX swtpc09d3 // S09, DMF3 Floppy UNIBUG U3 rom - UniFLEX U3 +// Intel +imds2 // Intellec MDS series-II //***************Games****************************************************** // Computer Electronic @@ -2181,9 +2186,11 @@ cdkong // Coleco cgalaxn // Coleco cpacman // Coleco cpacmanr1 // +cmspacmn // Coleco egalaxn2 // Entex epacman2 // Entex pbqbert // Parker Brothers +kingman // Tomy tmtron // Tomy maniac // Ideal @@ -2192,12 +2199,14 @@ mathmagi // APF amaztron // Coleco tc4 // Coleco ebball // Entex +ebball2 // Entex ebball3 // Entex elecdet // Ideal starwbc // Kenner starwbcp // Kenner (prototype) comp4 // Milton Bradley simon // Milton Bradley +//ssimon // Milton Bradley cnsector // Parker Bros merlin // Parker Bros stopthie // Parker Bros @@ -2206,14 +2215,17 @@ bankshot // Parker Bros splitsec // Parker Bros tandy12 // Tandy Radio Shack +elecbowl // Marx +mbdtower // Milton Bradley + ssfball // Bambino splasfgt // Bambino +astrocmd // Epoch edracula // Epoch tmpacman // Tomy tmtennis // Tomy alnchase // Tomy -elecbowl // Marx wildfire // Parker Bros diff --git a/src/mess/mess.mak b/src/mess/mess.mak index b26b547f594..69845afe992 100644 --- a/src/mess/mess.mak +++ b/src/mess/mess.mak @@ -1335,6 +1335,7 @@ $(MESSOBJ)/intel.a: \ $(MESS_DRIVERS)/rex6000.o \ $(MESS_DRIVERS)/sdk85.o \ $(MESS_DRIVERS)/sdk86.o \ + $(MESS_DRIVERS)/imds2.o \ $(MESSOBJ)/imp.a: \ $(MESS_DRIVERS)/tim011.o \ @@ -1383,6 +1384,7 @@ $(MESSOBJ)/matsushi.a: \ $(MESS_DRIVERS)/myb3k.o \ $(MESSOBJ)/mb.a: \ + $(MESS_DRIVERS)/mbdtower.o \ $(MESS_DRIVERS)/microvsn.o \ $(MESSOBJ)/mchester.a: \ @@ -1477,6 +1479,7 @@ $(MESSOBJ)/novag.a: \ $(MESSOBJ)/olivetti.a: \ $(MESS_DRIVERS)/m20.o \ $(MESS_DRIVERS)/m24.o \ + $(MESS_MACHINE)/m24_kbd.o \ $(MESSOBJ)/omnibyte.a: \ $(MESS_DRIVERS)/msbc1.o \ @@ -2138,11 +2141,13 @@ $(MESS_DRIVERS)/hh_tms1k.o: $(MESS_LAYOUT)/amaztron.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 \ @@ -2158,6 +2163,7 @@ $(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 diff --git a/src/mess/tools/floptool/main.c b/src/mess/tools/floptool/main.c index 4575e1609cb..2cb36f3a873 100644 --- a/src/mess/tools/floptool/main.c +++ b/src/mess/tools/floptool/main.c @@ -15,8 +15,8 @@ #include #include #include -#include #include +#include #include "corestr.h" diff --git a/src/mess/tools/imgtool/iflopimg.c b/src/mess/tools/imgtool/iflopimg.c index 26a91ccf749..765245cb8ff 100644 --- a/src/mess/tools/imgtool/iflopimg.c +++ b/src/mess/tools/imgtool/iflopimg.c @@ -6,8 +6,8 @@ *********************************************************************/ -#include "formats/flopimg.h" #include "imgtool.h" +#include "formats/flopimg.h" #include "library.h" #include "iflopimg.h" diff --git a/src/mess/tools/imgtool/imgterrs.c b/src/mess/tools/imgtool/imgterrs.c index 58a2d944179..696aafdfa1a 100644 --- a/src/mess/tools/imgtool/imgterrs.c +++ b/src/mess/tools/imgtool/imgterrs.c @@ -6,7 +6,7 @@ ***************************************************************************/ -#include +#include "imgtool.h" #include "imgterrs.h" #include "osdcomm.h" diff --git a/src/mess/tools/imgtool/library.c b/src/mess/tools/imgtool/library.c index fd15243edfe..b17d837aa02 100644 --- a/src/mess/tools/imgtool/library.c +++ b/src/mess/tools/imgtool/library.c @@ -9,6 +9,7 @@ #include +#include "imgtool.h" #include "library.h" #include "pool.h" diff --git a/src/mess/tools/imgtool/library.h b/src/mess/tools/imgtool/library.h index dde2d57ed18..ff9113c748d 100644 --- a/src/mess/tools/imgtool/library.h +++ b/src/mess/tools/imgtool/library.h @@ -16,7 +16,6 @@ #define LIBRARY_H #include -#include #include "corestr.h" #include "opresolv.h" diff --git a/src/mess/tools/imgtool/modules.c b/src/mess/tools/imgtool/modules.c index 192a0176528..eec6c564025 100644 --- a/src/mess/tools/imgtool/modules.c +++ b/src/mess/tools/imgtool/modules.c @@ -6,6 +6,7 @@ ***************************************************************************/ +#include "imgtool.h" #include "modules.h" #ifndef MODULES_RECURSIVE diff --git a/src/osd/modules/debugger/debugwin.c b/src/osd/modules/debugger/debugwin.c index 1ae50bc3c8d..73bcd59c6e3 100644 --- a/src/osd/modules/debugger/debugwin.c +++ b/src/osd/modules/debugger/debugwin.c @@ -154,7 +154,7 @@ void debugger_windows::wait_for_debugger(device_t &device, bool firststop) void debugger_windows::debugger_update() { // if we're running live, do some checks - if (!winwindow_has_focus() && !debug_cpu_is_stopped(*m_machine) && (m_machine->phase() == MACHINE_PHASE_RUNNING)) + if (!winwindow_has_focus() && m_machine && !debug_cpu_is_stopped(*m_machine) && (m_machine->phase() == MACHINE_PHASE_RUNNING)) { // see if the interrupt key is pressed and break if it is if (seq_pressed()) diff --git a/src/osd/modules/font/font_windows.c b/src/osd/modules/font/font_windows.c index 458534f3a74..88606bde6e1 100644 --- a/src/osd/modules/font/font_windows.c +++ b/src/osd/modules/font/font_windows.c @@ -169,90 +169,95 @@ bool osd_font_windows::get_bitmap(unicode_char chnum, bitmap_argb32 &bitmap, INT // create a DIB to render to BYTE *bits; HBITMAP dib = CreateDIBSection(dummyDC, &info, DIB_RGB_COLORS, reinterpret_cast(&bits), NULL, 0); - HGDIOBJ oldbitmap = SelectObject(dummyDC, dib); - // clear the bitmap - int rowbytes = bmwidth / 8; - memset(bits, 0, rowbytes * bmheight); - - // now draw the character - WCHAR tempchar = chnum; - SetTextColor(dummyDC, RGB(0xff, 0xff, 0xff)); - SetBkColor(dummyDC, RGB(0x00, 0x00, 0x00)); - ExtTextOutW(dummyDC, 50 + abc.abcA, 50, ETO_OPAQUE, NULL, &tempchar, 1, NULL); - - // characters are expected to be full-height - rectangle actbounds; - actbounds.min_y = 50; - actbounds.max_y = 50 + metrics.tmHeight - 1; - - // determine the actual left of the character - for (actbounds.min_x = 0; actbounds.min_x < rowbytes; actbounds.min_x++) + if (dib) { - BYTE *offs = bits + actbounds.min_x; - UINT8 summary = 0; - for (int y = 0; y < bmheight; y++) - summary |= offs[y * rowbytes]; - if (summary != 0) - { - actbounds.min_x *= 8; - if (!(summary & 0x80)) actbounds.min_x++; - if (!(summary & 0xc0)) actbounds.min_x++; - if (!(summary & 0xe0)) actbounds.min_x++; - if (!(summary & 0xf0)) actbounds.min_x++; - if (!(summary & 0xf8)) actbounds.min_x++; - if (!(summary & 0xfc)) actbounds.min_x++; - if (!(summary & 0xfe)) actbounds.min_x++; - break; - } - } + HGDIOBJ oldbitmap = SelectObject(dummyDC, dib); - // determine the actual right of the character - for (actbounds.max_x = rowbytes - 1; actbounds.max_x >= 0; actbounds.max_x--) - { - BYTE *offs = bits + actbounds.max_x; - UINT8 summary = 0; - for (int y = 0; y < bmheight; y++) - summary |= offs[y * rowbytes]; - if (summary != 0) - { - actbounds.max_x *= 8; - if (summary & 0x7f) actbounds.max_x++; - if (summary & 0x3f) actbounds.max_x++; - if (summary & 0x1f) actbounds.max_x++; - if (summary & 0x0f) actbounds.max_x++; - if (summary & 0x07) actbounds.max_x++; - if (summary & 0x03) actbounds.max_x++; - if (summary & 0x01) actbounds.max_x++; - break; - } - } + // clear the bitmap + int rowbytes = bmwidth / 8; + memset(bits, 0, rowbytes * bmheight); - // allocate a new bitmap - if (actbounds.max_x >= actbounds.min_x && actbounds.max_y >= actbounds.min_y) - { - bitmap.allocate(actbounds.max_x + 1 - actbounds.min_x, actbounds.max_y + 1 - actbounds.min_y); + // now draw the character + WCHAR tempchar = chnum; + SetTextColor(dummyDC, RGB(0xff, 0xff, 0xff)); + SetBkColor(dummyDC, RGB(0x00, 0x00, 0x00)); + ExtTextOutW(dummyDC, 50 + abc.abcA, 50, ETO_OPAQUE, NULL, &tempchar, 1, NULL); - // copy the bits into it - for (int y = 0; y < bitmap.height(); y++) + // characters are expected to be full-height + rectangle actbounds; + actbounds.min_y = 50; + actbounds.max_y = 50 + metrics.tmHeight - 1; + + // determine the actual left of the character + for (actbounds.min_x = 0; actbounds.min_x < rowbytes; actbounds.min_x++) { - UINT32 *dstrow = &bitmap.pix32(y); - UINT8 *srcrow = &bits[(y + actbounds.min_y) * rowbytes]; - for (int x = 0; x < bitmap.width(); x++) + BYTE *offs = bits + actbounds.min_x; + UINT8 summary = 0; + for (int y = 0; y < bmheight; y++) + summary |= offs[y * rowbytes]; + if (summary != 0) { - int effx = x + actbounds.min_x; - dstrow[x] = ((srcrow[effx / 8] << (effx % 8)) & 0x80) ? rgb_t(0xff, 0xff, 0xff, 0xff) : rgb_t(0x00, 0xff, 0xff, 0xff); + actbounds.min_x *= 8; + if (!(summary & 0x80)) actbounds.min_x++; + if (!(summary & 0xc0)) actbounds.min_x++; + if (!(summary & 0xe0)) actbounds.min_x++; + if (!(summary & 0xf0)) actbounds.min_x++; + if (!(summary & 0xf8)) actbounds.min_x++; + if (!(summary & 0xfc)) actbounds.min_x++; + if (!(summary & 0xfe)) actbounds.min_x++; + break; } } - // set the final offset values - xoffs = actbounds.min_x - (50 + abc.abcA); - yoffs = actbounds.max_y - (50 + metrics.tmAscent); + // determine the actual right of the character + for (actbounds.max_x = rowbytes - 1; actbounds.max_x >= 0; actbounds.max_x--) + { + BYTE *offs = bits + actbounds.max_x; + UINT8 summary = 0; + for (int y = 0; y < bmheight; y++) + summary |= offs[y * rowbytes]; + if (summary != 0) + { + actbounds.max_x *= 8; + if (summary & 0x7f) actbounds.max_x++; + if (summary & 0x3f) actbounds.max_x++; + if (summary & 0x1f) actbounds.max_x++; + if (summary & 0x0f) actbounds.max_x++; + if (summary & 0x07) actbounds.max_x++; + if (summary & 0x03) actbounds.max_x++; + if (summary & 0x01) actbounds.max_x++; + break; + } + } + + // allocate a new bitmap + if (actbounds.max_x >= actbounds.min_x && actbounds.max_y >= actbounds.min_y) + { + bitmap.allocate(actbounds.max_x + 1 - actbounds.min_x, actbounds.max_y + 1 - actbounds.min_y); + + // copy the bits into it + for (int y = 0; y < bitmap.height(); y++) + { + UINT32 *dstrow = &bitmap.pix32(y); + UINT8 *srcrow = &bits[(y + actbounds.min_y) * rowbytes]; + for (int x = 0; x < bitmap.width(); x++) + { + int effx = x + actbounds.min_x; + dstrow[x] = ((srcrow[effx / 8] << (effx % 8)) & 0x80) ? rgb_t(0xff, 0xff, 0xff, 0xff) : rgb_t(0x00, 0xff, 0xff, 0xff); + } + } + + // set the final offset values + xoffs = actbounds.min_x - (50 + abc.abcA); + yoffs = actbounds.max_y - (50 + metrics.tmAscent); + } + + // de-select the font and release the DC + SelectObject(dummyDC, oldbitmap); + DeleteObject(dib); } - // de-select the font and release the DC - SelectObject(dummyDC, oldbitmap); - DeleteObject(dib); SelectObject(dummyDC, oldfont); DeleteDC(dummyDC); return bitmap.valid(); diff --git a/src/osd/modules/lib/osdobj_common.c b/src/osd/modules/lib/osdobj_common.c index 222a7d0aca6..f9ce3321cbf 100644 --- a/src/osd/modules/lib/osdobj_common.c +++ b/src/osd/modules/lib/osdobj_common.c @@ -179,7 +179,9 @@ void osd_common_t::register_options() REGISTER_MODULE(m_mod_man, NETDEV_PCAP); REGISTER_MODULE(m_mod_man, NETDEV_NONE); +#ifndef NO_USE_MIDI REGISTER_MODULE(m_mod_man, MIDI_PM); +#endif REGISTER_MODULE(m_mod_man, MIDI_NONE); // after initialization we know which modules are supported diff --git a/src/osd/modules/opengl/osd_opengl.h b/src/osd/modules/opengl/osd_opengl.h index 94eab4e145b..829cad43bf5 100644 --- a/src/osd/modules/opengl/osd_opengl.h +++ b/src/osd/modules/opengl/osd_opengl.h @@ -89,16 +89,25 @@ #define OSD_GL(ret,func,params) ret (APIENTRY *func) params; #define OSD_GL_UNUSED(ret,func,params) - struct osd_gl_dispatch - { - #define GET_GLFUNC 1 - #include "osd_opengl.h" - #undef GET_GLFUNC - }; +#ifdef _MSC_VER + extern "C" { +#endif + struct osd_gl_dispatch + { + #define GET_GLFUNC 1 + #include "osd_opengl.h" + #undef GET_GLFUNC + }; +#ifdef _MSC_VER + } +#endif #undef OSD_GL #undef OSD_GL_UNUSED +#ifdef _MSC_VER + extern "C" osd_gl_dispatch *gl_dispatch; +#endif extern osd_gl_dispatch *gl_dispatch; /* diff --git a/src/osd/sdl/man/castool.1 b/src/osd/sdl/man/castool.1 index 09c56270c1b..56ef844e08f 100644 --- a/src/osd/sdl/man/castool.1 +++ b/src/osd/sdl/man/castool.1 @@ -6,7 +6,7 @@ .\" Cesare Falco , February 2011 .\" .\" -.TH CASTOOL 1 2015-01-18 0.158 "MESS Generic cassette manipulation tool" +.TH CASTOOL 1 2015-03-23 0.160 "MESS Generic cassette manipulation tool" .\" .\" .\" NAME chapter diff --git a/src/osd/sdl/man/chdman.1 b/src/osd/sdl/man/chdman.1 index d95e6e2ba24..dfa9440428d 100644 --- a/src/osd/sdl/man/chdman.1 +++ b/src/osd/sdl/man/chdman.1 @@ -6,7 +6,7 @@ .\" Ashley T. Howes , February 2005 .\" updated by Cesare Falco , February 2007 .\" -.TH CHDMAN 1 2015-01-18 0.158 "MAME Compressed Hunks of Data (CHD) manager" +.TH CHDMAN 1 2015-03-23 0.160 "MAME Compressed Hunks of Data (CHD) manager" .\" .\" NAME chapter .SH NAME diff --git a/src/osd/sdl/man/floptool.1 b/src/osd/sdl/man/floptool.1 index c3cb1b0fbef..338bf9b6b3b 100644 --- a/src/osd/sdl/man/floptool.1 +++ b/src/osd/sdl/man/floptool.1 @@ -6,7 +6,7 @@ .\" Cesare Falco , April 2014 .\" .\" -.TH FLOPTOOL 1 2015-01-18 0.158 "MESS Generic floppy manipulation tool" +.TH FLOPTOOL 1 2015-03-23 0.160 "MESS Generic floppy manipulation tool" .\" .\" .\" NAME chapter diff --git a/src/osd/sdl/man/imgtool.1 b/src/osd/sdl/man/imgtool.1 index 03be2b86515..392a767c166 100644 --- a/src/osd/sdl/man/imgtool.1 +++ b/src/osd/sdl/man/imgtool.1 @@ -6,7 +6,7 @@ .\" Cesare Falco , February 2011 .\" .\" -.TH IMGTOOL 1 2015-01-18 0.158 "MESS media image manipulation tool" +.TH IMGTOOL 1 2015-03-23 0.160 "MESS media image manipulation tool" .\" .\" .\" NAME chapter diff --git a/src/osd/sdl/man/jedutil.1 b/src/osd/sdl/man/jedutil.1 index 84ec4fc2efb..f85a5a3d620 100644 --- a/src/osd/sdl/man/jedutil.1 +++ b/src/osd/sdl/man/jedutil.1 @@ -8,7 +8,7 @@ .\" References .\" http://aarongiles.com/?p=159 .\" -.TH JEDUTIL 1 2015-01-18 0.158 "MAME JEDEC file utilities" +.TH JEDUTIL 1 2015-03-23 0.160 "MAME JEDEC file utilities" .\" .\" NAME chapter .SH NAME diff --git a/src/osd/sdl/man/ldresample.1 b/src/osd/sdl/man/ldresample.1 index d84f8c1d529..cf719c41ac9 100644 --- a/src/osd/sdl/man/ldresample.1 +++ b/src/osd/sdl/man/ldresample.1 @@ -3,7 +3,7 @@ .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection .\" other parameters are allowed: see man(7), man(1) .\" -.TH LDRESAMPLE 1 2015-01-18 0.158 "MAME laserdisc audio manipulation tool" +.TH LDRESAMPLE 1 2015-03-23 0.160 "MAME laserdisc audio manipulation tool" .\" .\" Please adjust this date whenever revising the manpage. .\" diff --git a/src/osd/sdl/man/ldverify.1 b/src/osd/sdl/man/ldverify.1 index 7dc1162d7ae..83b43efe118 100644 --- a/src/osd/sdl/man/ldverify.1 +++ b/src/osd/sdl/man/ldverify.1 @@ -5,7 +5,7 @@ .\" Man page created from source and usage information by .\" Cesare Falco , August 2008 .\" -.TH LDVERIFY 1 2015-01-18 0.158 "MAME laserdisc data checker" +.TH LDVERIFY 1 2015-03-23 0.160 "MAME laserdisc data checker" .\" .\" NAME chapter .SH NAME diff --git a/src/osd/sdl/man/mame.6 b/src/osd/sdl/man/mame.6 index b378266a421..6d128814d66 100644 --- a/src/osd/sdl/man/mame.6 +++ b/src/osd/sdl/man/mame.6 @@ -13,7 +13,7 @@ .\" and updated by Andrew Burton , July 2003 .\" .\" -.TH MAME 6 2015-01-18 0.158 "MAME \- The Multiple Arcade Machine Emulator" +.TH MAME 6 2015-03-23 0.160 "MAME \- The Multiple Arcade Machine Emulator" .\" .\" .\" NAME chapter @@ -646,7 +646,7 @@ needs adjustment. This option requires a float argument in the range of .\" SDL specific .\" +++++++++++++++++++++++++++++++++++++++++++++++++++++++ .TP -.B \-video\fR [\fIsoft\fR|\fIopengl\fR|\fIopengl16\fR|\fInone\fR] +.B \-video\fR [\fIsoft\fR|\fIopengl\fR|\fInone\fR] Specifies which video subsystem to use for drawing: .br \fBsoft\fR uses software rendering, which is slower but more compatible. @@ -654,8 +654,6 @@ Specifies which video subsystem to use for drawing: \fBopengl\fR uses OpenGL and your graphics accelerator to speed up many aspects of drawing MAME including compositing artwork, overlays, and bezels, as well as stretching the image to fit your screen. -.br -\fBopengl16\fR uses alternate OpenGL code, which should provide faster output on some cards. .br \fBnone\fR does no drawing and is intended for CPU benchmarking. diff --git a/src/osd/sdl/man/mess.6 b/src/osd/sdl/man/mess.6 index 999494192df..393943979e9 100644 --- a/src/osd/sdl/man/mess.6 +++ b/src/osd/sdl/man/mess.6 @@ -16,7 +16,7 @@ .\" http://www.mess.org/ .\" .\" -.TH MESS 6 2015-01-18 0.158 "The Multiple Emulator Super System (MESS)" +.TH MESS 6 2015-03-23 0.160 "The Multiple Emulator Super System (MESS)" .\" .\" .\" NAME chapter @@ -661,7 +661,7 @@ needs adjustment. This option requires a float argument in the range of .\" SDL specific .\" +++++++++++++++++++++++++++++++++++++++++++++++++++++++ .TP -.B \-video\fR [\fIsoft\fR|\fIopengl\fR|\fIopengl16\fR|\fInone\fR] +.B \-video\fR [\fIsoft\fR|\fIopengl\fR|\fInone\fR] Specifies which video subsystem to use for drawing: .br \fBsoft\fR uses software rendering, which is slower but more compatible. @@ -670,9 +670,6 @@ Specifies which video subsystem to use for drawing: aspects of drawing MESS including compositing artwork, overlays, and bezels, as well as stretching the image to fit your screen. .br -\fBopengl16\fR uses alternate OpenGL code, which should provide faster -output on some cards. -.br \fBnone\fR does no drawing and is intended for CPU benchmarking. .br Default is SOFT. diff --git a/src/osd/sdl/man/romcmp.1 b/src/osd/sdl/man/romcmp.1 index 766dac20a41..a52c2a1b472 100644 --- a/src/osd/sdl/man/romcmp.1 +++ b/src/osd/sdl/man/romcmp.1 @@ -9,7 +9,7 @@ .\" References .\" http://www.mame.net/mamefaq.html .\" -.TH ROMCMP 1 2015-01-18 0.158 "MAME romset checking tool" +.TH ROMCMP 1 2015-03-23 0.160 "MAME romset checking tool" .\" .\" NAME chapter .SH NAME diff --git a/src/osd/sdl/man/testkeys.1 b/src/osd/sdl/man/testkeys.1 index d253f3cbb2b..4ef207a35b6 100644 --- a/src/osd/sdl/man/testkeys.1 +++ b/src/osd/sdl/man/testkeys.1 @@ -5,7 +5,7 @@ .\" Man page created from source and usage information .\" Cesare Falco , February 2007 .\" -.TH TESTKEYS 1 2015-01-18 0.158 "MAME SDL keycode scanner" +.TH TESTKEYS 1 2015-03-23 0.160 "MAME SDL keycode scanner" .\" .\" NAME chapter .SH NAME diff --git a/src/osd/sdl/sdl.mak b/src/osd/sdl/sdl.mak index 005955d3be1..2f188762da5 100644 --- a/src/osd/sdl/sdl.mak +++ b/src/osd/sdl/sdl.mak @@ -753,7 +753,7 @@ SDLLIBS := $(shell sdl-config --libs) INCPATH += $(SDLCFLAGS) LIBS += $(SDLLIBS) -lpthread -BASELIBS += += $(SDLLIBS) -lpthread +BASELIBS += $(SDLLIBS) -lpthread endif # OS2 diff --git a/src/osd/windows/windows.mak b/src/osd/windows/windows.mak index 197577e21e7..53d8be9518a 100644 --- a/src/osd/windows/windows.mak +++ b/src/osd/windows/windows.mak @@ -237,11 +237,9 @@ endif # explicitly set the entry point for UNICODE builds LDFLAGS += /ENTRY:wmainCRTStartup -ifdef MSVC_BUILD ifdef DEBUG LDFLAGS += /NODEFAULTLIB:LIBCMT endif -endif # add some VC++-specific defines DEFS += -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DXML_STATIC -DWIN32 @@ -254,7 +252,7 @@ msvcclean: $(RM) *.lib $(RM) *.exp -endif +endif # MSVC_BUILD #------------------------------------------------- diff --git a/src/osd/windows/winprefix.h b/src/osd/windows/winprefix.h index 53f03e46a1f..e506403e7b5 100644 --- a/src/osd/windows/winprefix.h +++ b/src/osd/windows/winprefix.h @@ -11,7 +11,6 @@ #endif #ifdef _MSC_VER -#include #include #if _MSC_VER < 1900 // < VS2015 #define snprintf _snprintf diff --git a/src/regtests/chdman/chdtest.py b/src/regtests/chdman/chdtest.py index 2f9e4b04811..98f0a3886f9 100644 --- a/src/regtests/chdman/chdtest.py +++ b/src/regtests/chdman/chdtest.py @@ -5,12 +5,15 @@ import hashlib import shutil def runProcess(cmd): + #print " ".join(cmd) process = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) (stdout, stderr) = process.communicate() if not isinstance(stdout, str): # python 3 stdout = stdout.decode('latin-1') if not isinstance(stderr, str): # python 3 stderr = stderr.decode('latin-1') + #if stderr: + # print stderr return process.returncode, stdout, stderr def compareInfo(info1, info2): diff --git a/src/regtests/chdman/input/createhd_4/in.params b/src/regtests/chdman/input/createhd_4/in.params index 61dfdd4701b..51eee8734e1 100644 --- a/src/regtests/chdman/input/createhd_4/in.params +++ b/src/regtests/chdman/input/createhd_4/in.params @@ -1 +1 @@ --s 1073741824 \ No newline at end of file +-s 10485760 \ No newline at end of file diff --git a/src/regtests/chdman/input/createhd_5/in.params b/src/regtests/chdman/input/createhd_5/in.params index 614d2b26384..27e6fe0e955 100644 --- a/src/regtests/chdman/input/createhd_5/in.params +++ b/src/regtests/chdman/input/createhd_5/in.params @@ -1 +1 @@ --s 1073741824 -ss 1024 \ No newline at end of file +-s 10485760 -ss 1024 \ No newline at end of file diff --git a/src/regtests/chdman/output/createhd_4/out.chd b/src/regtests/chdman/output/createhd_4/out.chd index 8e565b37993..93d60a121b7 100644 Binary files a/src/regtests/chdman/output/createhd_4/out.chd and b/src/regtests/chdman/output/createhd_4/out.chd differ diff --git a/src/regtests/chdman/output/createhd_5/out.chd b/src/regtests/chdman/output/createhd_5/out.chd index 825a3493d0b..19f90331240 100644 Binary files a/src/regtests/chdman/output/createhd_5/out.chd and b/src/regtests/chdman/output/createhd_5/out.chd differ diff --git a/src/tools/chdman.c b/src/tools/chdman.c index 9384566eb54..87e22bd2dbf 100644 --- a/src/tools/chdman.c +++ b/src/tools/chdman.c @@ -6,6 +6,8 @@ ****************************************************************************/ +#include + #include "osdcore.h" #include "corefile.h" #include "chdcd.h" diff --git a/src/tools/ldresample.c b/src/tools/ldresample.c index e027f88ec9a..7851814e0aa 100644 --- a/src/tools/ldresample.c +++ b/src/tools/ldresample.c @@ -13,6 +13,7 @@ #include #include #include +#include #include "bitmap.h" #include "chd.h" #include "avhuff.h" diff --git a/src/tools/ldverify.c b/src/tools/ldverify.c index b57f987e145..2d8ff1365d2 100644 --- a/src/tools/ldverify.c +++ b/src/tools/ldverify.c @@ -12,6 +12,7 @@ #include #include #include +#include #include "coretmpl.h" #include "aviio.h" #include "avhuff.h" diff --git a/src/tools/nltool.c b/src/tools/nltool.c index 22d4cf6bd8d..92b4960be4d 100644 --- a/src/tools/nltool.c +++ b/src/tools/nltool.c @@ -11,6 +11,7 @@ #include #include #include +#include #include "astring.h" #include "corefile.h" #include "corestr.h" diff --git a/src/tools/pngcmp.c b/src/tools/pngcmp.c index f5f1da4a2c5..31753a49be1 100644 --- a/src/tools/pngcmp.c +++ b/src/tools/pngcmp.c @@ -12,6 +12,7 @@ #include #include #include +#include #include "osdcore.h" #include "png.h" diff --git a/src/tools/regrep.c b/src/tools/regrep.c index 114d5fa467b..c720ee1354e 100644 --- a/src/tools/regrep.c +++ b/src/tools/regrep.c @@ -11,6 +11,7 @@ #include #include #include +#include #include "osdcore.h" #include "png.h" diff --git a/src/tools/split.c b/src/tools/split.c index 2144f11b9c2..02e546fce14 100644 --- a/src/tools/split.c +++ b/src/tools/split.c @@ -12,6 +12,7 @@ #include #include #include +#include #include "astring.h" #include "corefile.h" #include "corestr.h" diff --git a/src/tools/src2html.c b/src/tools/src2html.c index dbbc3512c9e..5ebe31ee71f 100644 --- a/src/tools/src2html.c +++ b/src/tools/src2html.c @@ -19,6 +19,7 @@ #include #include #include +#include #include "osdcore.h" #include "astring.h" #include "corefile.h" diff --git a/src/tools/tools.mak b/src/tools/tools.mak index 85a8fecc114..ada7c290a49 100644 --- a/src/tools/tools.mak +++ b/src/tools/tools.mak @@ -217,7 +217,8 @@ NLTOOLOBJS = \ $(TOOLSOBJ)/nltool.o \ $(NETLISTOBJS) \ -$(BIN)nltool$(EXE): $(NLTOOLOBJS) $(LIBUTIL) $(LIBOCORE) $(ZLIB) $(EXPAT) +# 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 $@