diff --git a/.github/workflows/includeguards.yml b/.github/workflows/includeguards.yml deleted file mode 100644 index e2e9c897ce9be..0000000000000 --- a/.github/workflows/includeguards.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: 'Check #include guards' - -on: - push: - paths: - - '.github/workflows/**' - - 'src/devices/**.h' - - 'src/mame/**.h' - pull_request: - - '.github/workflows/**' - - 'src/devices/**.h' - - 'src/mame/**.h' - -permissions: - contents: read - -jobs: - validate: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@main - with: - fetch-depth: 0 - - name: Validate - run: python3 scripts/build/check_include_guards.py src/devices src/mame diff --git a/3rdparty/expat/CMake.README b/3rdparty/expat/CMake.README index aa098b4f94299..86e1eb98918b7 100644 --- a/3rdparty/expat/CMake.README +++ b/3rdparty/expat/CMake.README @@ -3,25 +3,25 @@ The cmake based buildsystem for expat works on Windows (cygwin, mingw, Visual Studio) and should work on all other platform cmake supports. -Assuming ~/expat-2.2.10 is the source directory of expat, add a subdirectory +Assuming ~/expat-2.6.4 is the source directory of expat, add a subdirectory build and change into that directory: -~/expat-2.2.10$ mkdir build && cd build -~/expat-2.2.10/build$ +~/expat-2.6.4$ mkdir build && cd build +~/expat-2.6.4/build$ From that directory, call cmake first, then call make, make test and make install in the usual way: -~/expat-2.2.10/build$ cmake .. +~/expat-2.6.4/build$ cmake .. -- The C compiler identification is GNU -- The CXX compiler identification is GNU .... -- Configuring done -- Generating done --- Build files have been written to: /home/patrick/expat-2.2.10/build +-- Build files have been written to: /home/patrick/expat-2.6.4/build If you want to specify the install location for your files, append -DCMAKE_INSTALL_PREFIX=/your/install/path to the cmake call. -~/expat-2.2.10/build$ make && make test && make install +~/expat-2.6.4/build$ make && make test && make install Scanning dependencies of target expat [ 5%] Building C object CMakeFiles/expat.dir/lib/xmlparse.c.o [ 11%] Building C object CMakeFiles/expat.dir/lib/xmlrole.c.o @@ -36,7 +36,7 @@ Visual Studio Command Prompt or when using mingw, you must open a cmd.exe and make sure that gcc can be called. On Windows, you also might want to specify a special Generator for CMake: for Visual Studio builds do: -cmake .. -G "Visual Studio 15 2017" && msbuild /m expat.sln +cmake .. -G "Visual Studio 16 2019" && msbuild /m expat.sln for mingw builds do: cmake .. -G "MinGW Makefiles" -DCMAKE_INSTALL_PREFIX=D:\expat-install && gmake && gmake install diff --git a/3rdparty/expat/CMakeLists.txt b/3rdparty/expat/CMakeLists.txt index dfbd0c5943b18..1f6503390628f 100644 --- a/3rdparty/expat/CMakeLists.txt +++ b/3rdparty/expat/CMakeLists.txt @@ -1,44 +1,52 @@ -# This file is copyrighted under the BSD-license for buildsystem files of KDE -# copyright 2010, Patrick Spendrin - -cmake_minimum_required(VERSION 3.1.3) - -# This allows controlling documented build time switches -# when Expat is pulled in using the add_subdirectory function, e.g. -# -# set(EXPAT_BUILD_DOCS OFF) -# set(EXPAT_BUILD_TOOLS OFF) -# add_subdirectory(${expat_SOURCE_DIR}/expat ${expat_BINARY_DIR}) -# -# would disable compilation of the xmlwf CLI and its man page. -# Without activating behaviour NEW for policy CMP0077 here, -# a user with -Wdev enabled would see warning -# -# Policy CMP0077 is not set: option() honors normal variables. Run "cmake -# --help-policy CMP0077" for policy details. Use the cmake_policy command to -# set the policy and suppress this warning. -# -# For compatibility with older versions of CMake, option is clearing the -# normal variable 'EXPAT_BUILD_DOCS'. -# -# and effectively not be able to adjust option EXPAT_BUILD_DOCS. -# -# For more details please see: -# - https://cmake.org/cmake/help/latest/policy/CMP0077.html -# - https://github.com/libexpat/libexpat/pull/419 -# -if(POLICY CMP0077) - cmake_policy(SET CMP0077 NEW) -endif() +# __ __ _ +# ___\ \/ /_ __ __ _| |_ +# / _ \\ /| '_ \ / _` | __| +# | __// \| |_) | (_| | |_ +# \___/_/\_\ .__/ \__,_|\__| +# |_| XML parser +# +# Copyright (c) 2010 Patrick Spendrin +# Copyright (c) 2012 Karl Waclawek +# Copyright (c) 2016-2024 Sebastian Pipping +# Copyright (c) 2016 Sergei Nikulov +# Copyright (c) 2016 Björn Lindahl +# Copyright (c) 2016 Tobias Taschner +# Copyright (c) 2016 Ben Boeckel +# Copyright (c) 2017-2022 Rhodri James +# Copyright (c) 2017 Rolf Eike Beer +# Copyright (c) 2017 Stephen Groat +# Copyright (c) 2017 Franek Korta +# Copyright (c) 2018 pedro-vicente +# Copyright (c) 2018 Frank Rast +# Copyright (c) 2018 userwithuid +# Copyright (c) 2018 Yury Gribov +# Copyright (c) 2019 Kishore Kunche +# Copyright (c) 2019 xantares +# Copyright (c) 2019 Mohammed Khajapasha +# Copyright (c) 2019 David Loffredo +# Copyright (c) 2019 Bhargava Shastry +# Copyright (c) 2020 Maciej Sroczyński +# Copyright (c) 2020 Gulliver +# Copyright (c) 2020 Thomas Beutlich +# Copyright (c) 2021 Alex Richardson +# Copyright (c) 2022 Johnny Jazeix +# Copyright (c) 2022 David Faure +# Unlike most of Expat, +# this file is copyrighted under the BSD-license for buildsystem files of KDE. + +cmake_minimum_required(VERSION 3.5.0) project(expat VERSION - 2.2.10 + 2.6.4 LANGUAGES C ) +set(CMAKE_C_STANDARD 99) +set(CMAKE_C_STANDARD_REQUIRED ON) +set(CMAKE_C_EXTENSIONS OFF) # i.e. -std=c99 rather than default -std=gnu99 -set(PACKAGE_BUGREPORT "expat-bugs@libexpat.org") +set(PACKAGE_BUGREPORT "https://github.com/libexpat/libexpat/issues") set(PACKAGE_NAME "expat") set(PACKAGE_VERSION "${PROJECT_VERSION}") set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}") @@ -47,11 +55,6 @@ set(PACKAGE_TARNAME "${PACKAGE_NAME}") include(CMakePackageConfigHelpers) include(GNUInstallDirs) -# -# Detect use by means of add_subdirectory -# -get_directory_property(_EXPAT_PARENT_DIRECTORY PARENT_DIRECTORY) - # # Configuration defaults # @@ -75,51 +78,114 @@ if(MSVC) else() set(_EXPAT_BUILD_PKGCONFIG_DEFAULT ON) endif() +if(DEFINED BUILD_SHARED_LIBS) + set(_EXPAT_SHARED_LIBS_DEFAULT ${BUILD_SHARED_LIBS}) +else() + set(_EXPAT_SHARED_LIBS_DEFAULT ON) +endif() +if(NOT CMAKE_BUILD_TYPE) + set(CMAKE_BUILD_TYPE NoConfig) # so that accessing EXPAT_*_POSTFIX will be waterproof +endif() +string(TOUPPER "${CMAKE_BUILD_TYPE}" _EXPAT_BUILD_TYPE_UPPER) # # Configuration # -option(EXPAT_BUILD_TOOLS "build the xmlwf tool for expat library" ${_EXPAT_BUILD_TOOLS_DEFAULT}) -option(EXPAT_BUILD_EXAMPLES "build the examples for expat library" ON) -option(EXPAT_BUILD_TESTS "build the tests for expat library" ON) -option(EXPAT_SHARED_LIBS "build a shared expat library" ON) -option(EXPAT_BUILD_DOCS "build man page for xmlwf" ${_EXPAT_BUILD_DOCS_DEFAULT}) -option(EXPAT_BUILD_FUZZERS "build fuzzers for the expat library" OFF) -option(EXPAT_BUILD_PKGCONFIG "build pkg-config file" ${_EXPAT_BUILD_PKGCONFIG_DEFAULT}) -option(EXPAT_OSSFUZZ_BUILD "build fuzzers via ossfuzz for the expat library" OFF) + +macro(expat_shy_set var default cache type desc) + # Macro expat_shy_set came into life because: + # - Expat was previously using an inconsistent mix of CMake's native set() + # and option() to define public build time options. + # - option() is more friendly than set() with regard to configuring an + # external project that is pulled in by means of add_subdirectory() -- + # see comments in issue #597 -- so we wanted to get away from set(). + # - option() auto-converts non-bool values to bool when writing to the CMake + # cache, so we needed something that supports non-bool better and hence + # wanted to get away from plain option(), too. + # + # As a result, this function serves as a hybrid between CMake's regular set() + # and option(): from set() it takes support for non-bool types and the function + # name and signature whereas from option() (with policy CMP0077 mode NEW) it + # takes being shy when a value has previously been defined for that variable. + # + # So that resolves all need for set(.. FORCE) when pulling in Expat by means of + # add_subdirectory(). + # + if(NOT ${cache} STREQUAL "CACHE") + message(SEND_ERROR "Macro usage is: expat_shy_set(var default CACHE type desc)") + endif() + + if(DEFINED ${var}) + # NOTE: The idea is to (ideally) only add to the cache if + # there is no cache entry, yet. "if(DEFINED CACHE{var})" + # requires CMake >=3.14. + if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.14" AND NOT DEFINED "CACHE{${var}}") + set("${var}" "${${var}}" CACHE "${type}" "${desc}") + endif() + else() + set("${var}" "${default}" CACHE "${type}" "${desc}") + endif() +endmacro() + +expat_shy_set(EXPAT_BUILD_TOOLS ${_EXPAT_BUILD_TOOLS_DEFAULT} CACHE BOOL "Build the xmlwf tool for expat library") +expat_shy_set(EXPAT_BUILD_EXAMPLES ON CACHE BOOL "Build the examples for expat library") +expat_shy_set(EXPAT_BUILD_TESTS ON CACHE BOOL "Build the tests for expat library") +expat_shy_set(EXPAT_SHARED_LIBS ${_EXPAT_SHARED_LIBS_DEFAULT} CACHE BOOL "Build a shared expat library") +expat_shy_set(EXPAT_BUILD_DOCS ${_EXPAT_BUILD_DOCS_DEFAULT} CACHE BOOL "Build man page for xmlwf") +expat_shy_set(EXPAT_BUILD_FUZZERS OFF CACHE BOOL "Build fuzzers for the expat library") +expat_shy_set(EXPAT_BUILD_PKGCONFIG ${_EXPAT_BUILD_PKGCONFIG_DEFAULT} CACHE BOOL "Build pkg-config file") +expat_shy_set(EXPAT_OSSFUZZ_BUILD OFF CACHE BOOL "Build fuzzers via ossfuzz for the expat library") if(UNIX OR _EXPAT_HELP) - option(EXPAT_WITH_LIBBSD "utilize libbsd (for arc4random_buf)" OFF) + expat_shy_set(EXPAT_WITH_LIBBSD OFF CACHE BOOL "Utilize libbsd (for arc4random_buf)") endif() -option(EXPAT_ENABLE_INSTALL "install expat files in cmake install target" ON) -set(EXPAT_CONTEXT_BYTES 1024 CACHE STRING "Define to specify how much context to retain around the current parse point") +expat_shy_set(EXPAT_ENABLE_INSTALL ON CACHE BOOL "Install expat files in cmake install target") +expat_shy_set(EXPAT_CONTEXT_BYTES 1024 CACHE STRING "Define to specify how much context to retain around the current parse point, 0 to disable") mark_as_advanced(EXPAT_CONTEXT_BYTES) -option(EXPAT_DTD "Define to make parameter entity parsing functionality available" ON) +expat_shy_set(EXPAT_DTD ON CACHE BOOL "Define to make parameter entity parsing functionality available") mark_as_advanced(EXPAT_DTD) -option(EXPAT_NS "Define to make XML Namespaces functionality available" ON) +expat_shy_set(EXPAT_GE ON CACHE BOOL "Define to make general entity parsing functionality available") +mark_as_advanced(EXPAT_GE) +expat_shy_set(EXPAT_NS ON CACHE BOOL "Define to make XML Namespaces functionality available") mark_as_advanced(EXPAT_NS) -option(EXPAT_WARNINGS_AS_ERRORS "Treat all compiler warnings as errors" OFF) +expat_shy_set(EXPAT_WARNINGS_AS_ERRORS OFF CACHE BOOL "Treat all compiler warnings as errors") if(UNIX OR _EXPAT_HELP) - option(EXPAT_DEV_URANDOM "Define to include code reading entropy from `/dev/urandom'." ON) - set(EXPAT_WITH_GETRANDOM "AUTO" CACHE STRING - "Make use of getrandom function (ON|OFF|AUTO) [default=AUTO]") - set(EXPAT_WITH_SYS_GETRANDOM "AUTO" CACHE STRING - "Make use of syscall SYS_getrandom (ON|OFF|AUTO) [default=AUTO]") + expat_shy_set(EXPAT_DEV_URANDOM ON CACHE BOOL "Define to include code reading entropy from `/dev/urandom'.") + expat_shy_set(EXPAT_WITH_GETRANDOM "AUTO" CACHE STRING "Make use of getrandom function (ON|OFF|AUTO) [default=AUTO]") + expat_shy_set(EXPAT_WITH_SYS_GETRANDOM "AUTO" CACHE STRING "Make use of syscall SYS_getrandom (ON|OFF|AUTO) [default=AUTO]") mark_as_advanced(EXPAT_DEV_URANDOM) endif() -set(EXPAT_CHAR_TYPE "char" CACHE STRING "Character type to use (char|ushort|wchar_t) [default=char]") -option(EXPAT_ATTR_INFO "Define to allow retrieving the byte offsets for attribute names and values" OFF) +expat_shy_set(EXPAT_CHAR_TYPE "char" CACHE STRING "Character type to use (char|ushort|wchar_t) [default=char]") +expat_shy_set(EXPAT_ATTR_INFO OFF CACHE BOOL "Define to allow retrieving the byte offsets for attribute names and values") mark_as_advanced(EXPAT_ATTR_INFO) -option(EXPAT_LARGE_SIZE "Make XML_GetCurrent* functions return <(unsigned) long long> rather than <(unsigned) long>" OFF) +expat_shy_set(EXPAT_LARGE_SIZE OFF CACHE BOOL "Make XML_GetCurrent* functions return <(unsigned) long long> rather than <(unsigned) long>") mark_as_advanced(EXPAT_LARGE_SIZE) -option(EXPAT_MIN_SIZE "Get a smaller (but slower) parser (in particular avoid multiple copies of the tokenizer)" OFF) +expat_shy_set(EXPAT_MIN_SIZE OFF CACHE BOOL "Get a smaller (but slower) parser (in particular avoid multiple copies of the tokenizer)") mark_as_advanced(EXPAT_MIN_SIZE) if(MSVC OR _EXPAT_HELP) - set(EXPAT_MSVC_STATIC_CRT OFF CACHE BOOL "Use /MT flag (static CRT) when compiling in MSVC") + expat_shy_set(EXPAT_MSVC_STATIC_CRT OFF CACHE BOOL "Use /MT flag (static CRT) when compiling in MSVC") +endif() +if(NOT _EXPAT_HELP) + expat_shy_set(_EXPAT_M32 OFF CACHE BOOL "(Unofficial!) Produce 32bit code with -m32") + mark_as_advanced(_EXPAT_M32) +endif() + +if(EXPAT_BUILD_TESTS) + # We have to call enable_language() before modifying any CMAKE_CXX_* variables + enable_language(CXX) + + set(CMAKE_CXX_STANDARD 11) + set(CMAKE_CXX_STANDARD_REQUIRED ON) + set(CMAKE_CXX_EXTENSIONS OFF) # i.e. -std=c++11 rather than default -std=gnu++11 endif() # # Environment checks # +if(EXPAT_DTD AND NOT EXPAT_GE) + message(SEND_ERROR "Option EXPAT_DTD requires that EXPAT_GE is also enabled.") + message(SEND_ERROR "Please either enable option EXPAT_GE (recommended) or disable EXPAT_DTD also.") +endif() + if(EXPAT_WITH_LIBBSD) find_library(LIB_BSD NAMES bsd) if(NOT LIB_BSD) @@ -129,6 +195,26 @@ if(EXPAT_WITH_LIBBSD) endif() endif() +if(MSVC) + # For the three types of MSVC version values, please see: + # - https://cmake.org/cmake/help/latest/variable/MSVC_VERSION.html + # - https://sourceforge.net/p/predef/wiki/Compilers/ + # - https://en.wikipedia.org/wiki/Microsoft_Visual_Studio#History + set(_EXPAT_MSVC_REQUIRED_INT 1800) # i.e. 12.0/2013/1800; see PR #426 + set(_EXPAT_MSVC_SUPPORTED_INT 1920) + set(_EXPAT_MSVC_SUPPORTED_DISPLAY "Visual Studio 16.0/2019/${_EXPAT_MSVC_SUPPORTED_INT}") + + if(MSVC_VERSION VERSION_LESS ${_EXPAT_MSVC_SUPPORTED_INT}) + if(MSVC_VERSION VERSION_LESS ${_EXPAT_MSVC_REQUIRED_INT}) + message(SEND_ERROR "MSVC_VERSION ${MSVC_VERSION} is TOO OLD to compile Expat without errors.") + message(SEND_ERROR "Please use officially supported ${_EXPAT_MSVC_SUPPORTED_DISPLAY} or later. Thank you!") + else() + message(WARNING "MSVC_VERSION ${MSVC_VERSION} is NOT OFFICIALLY SUPPORTED by Expat.") + message(WARNING "Please use ${_EXPAT_MSVC_SUPPORTED_DISPLAY} or later. Thank you!") + endif() + endif() +endif() + macro(_expat_copy_bool_int source_ref dest_ref) if(${source_ref}) set(${dest_ref} 1) @@ -202,12 +288,16 @@ endif() _expat_copy_bool_int(EXPAT_ATTR_INFO XML_ATTR_INFO) _expat_copy_bool_int(EXPAT_DTD XML_DTD) +_expat_copy_bool_int(EXPAT_GE XML_GE) _expat_copy_bool_int(EXPAT_LARGE_SIZE XML_LARGE_SIZE) _expat_copy_bool_int(EXPAT_MIN_SIZE XML_MIN_SIZE) _expat_copy_bool_int(EXPAT_NS XML_NS) if(NOT WIN32) _expat_copy_bool_int(EXPAT_DEV_URANDOM XML_DEV_URANDOM) endif() +if(NOT EXPAT_CONTEXT_BYTES GREATER 0) # in particular with -DEXPAT_CONTEXT_BYTES=OFF + set(EXPAT_CONTEXT_BYTES 0) +endif() set(XML_CONTEXT_BYTES ${EXPAT_CONTEXT_BYTES}) macro(expat_install) @@ -217,7 +307,6 @@ macro(expat_install) endmacro() configure_file(expat_config.h.cmake "${CMAKE_CURRENT_BINARY_DIR}/expat_config.h") -add_definitions(-DHAVE_EXPAT_CONFIG_H) expat_install(FILES "${CMAKE_CURRENT_BINARY_DIR}/expat_config.h" DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) @@ -226,14 +315,24 @@ if(FLAG_NO_STRICT_ALIASING) set(EXTRA_COMPILE_FLAGS "${EXTRA_COMPILE_FLAGS} -fno-strict-aliasing") endif() if(FLAG_VISIBILITY) - add_definitions(-DXML_ENABLE_VISIBILITY=1) + if(EXPAT_SHARED_LIBS) + add_definitions(-DXML_ENABLE_VISIBILITY=1) + endif() set(EXTRA_COMPILE_FLAGS "${EXTRA_COMPILE_FLAGS} -fvisibility=hidden") endif() +if(MINGW) + # Without __USE_MINGW_ANSI_STDIO the compiler produces a false positive + set(EXTRA_COMPILE_FLAGS "${EXTRA_COMPILE_FLAGS} -Wno-pedantic-ms-format") +endif() if (EXPAT_WARNINGS_AS_ERRORS) if(MSVC) add_definitions(/WX) else() set(EXTRA_COMPILE_FLAGS "${EXTRA_COMPILE_FLAGS} -Werror") + if(MINGW) + # To avoid "error: unknown conversion type character ‘l’ in format [-Werror=format=]" + set(EXTRA_COMPILE_FLAGS "${EXTRA_COMPILE_FLAGS} -Wno-format") + endif() endif() endif() set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_COMPILE_FLAGS}") @@ -243,10 +342,12 @@ if (MSVC) if (EXPAT_MSVC_STATIC_CRT) message("-- Using static CRT ${EXPAT_MSVC_STATIC_CRT}") foreach(flag_var + CMAKE_CXX_FLAGS_${_EXPAT_BUILD_TYPE_UPPER} CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO + CMAKE_C_FLAGS_${_EXPAT_BUILD_TYPE_UPPER} CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE CMAKE_C_FLAGS_MINSIZEREL @@ -257,43 +358,32 @@ if (MSVC) endif() endif() +if(_EXPAT_M32 AND NOT MSVC) + foreach(flag_var + CMAKE_CXX_FLAGS_${_EXPAT_BUILD_TYPE_UPPER} + CMAKE_CXX_FLAGS_DEBUG + CMAKE_CXX_FLAGS_RELEASE + CMAKE_CXX_FLAGS_MINSIZEREL + CMAKE_CXX_FLAGS_RELWITHDEBINFO + CMAKE_C_FLAGS_${_EXPAT_BUILD_TYPE_UPPER} + CMAKE_C_FLAGS_DEBUG + CMAKE_C_FLAGS_RELEASE + CMAKE_C_FLAGS_MINSIZEREL + CMAKE_C_FLAGS_RELWITHDEBINFO + ) + set(${flag_var} "${${flag_var}} -m32") + endforeach() +endif() + include_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/lib) if(MSVC) add_definitions(-D_CRT_SECURE_NO_WARNINGS -wd4996) endif() -if(WIN32) - if(_EXPAT_UNICODE_WCHAR_T) - set(_POSTFIX_WIDE "w") - endif() - - if(MSVC AND NOT EXPAT_SHARED_LIBS) - if(EXPAT_MSVC_STATIC_CRT) - set(_POSTFIX_CRT "MT") - else() - set(_POSTFIX_CRT "MD") - endif() - endif() - - foreach(postfix_var - CMAKE_DEBUG_POSTFIX - CMAKE_RELEASE_POSTFIX - CMAKE_MINSIZEREL_POSTFIX - CMAKE_RELWITHDEBINFO_POSTFIX - ) - if(postfix_var STREQUAL "CMAKE_DEBUG_POSTFIX") - set(_POSTFIX_DEBUG "d") - else() - set(_POSTFIX_DEBUG "") - endif() - - set(${postfix_var} "${_POSTFIX_WIDE}${_POSTFIX_DEBUG}${_POSTFIX_CRT}" CACHE STRING "Windows binary postfix, e.g. libexpat.lib") - endforeach() -endif() # # C library # -set(expat_SRCS +set(_EXPAT_C_SOURCES lib/xmlparse.c lib/xmlrole.c lib/xmltok.c @@ -304,39 +394,116 @@ set(expat_SRCS if(EXPAT_SHARED_LIBS) set(_SHARED SHARED) - if(MSVC) - set(expat_SRCS ${expat_SRCS} lib/libexpat.def) + if(WIN32) + macro(_expat_def_file_toggle source_var target_var) + if(${source_var}) + set(${target_var} " ") # i.e. not commented out, a single space + else() + set(${target_var} ";") # i.e. commented out + endif() + endmacro() + + if(EXPAT_DTD OR EXPAT_GE) + set(_EXPAT_DTD_OR_GE TRUE) + else() + set(_EXPAT_DTD_OR_GE FALSE) + endif() + + _expat_def_file_toggle(_EXPAT_DTD_OR_GE _EXPAT_COMMENT_DTD_OR_GE) + _expat_def_file_toggle(EXPAT_ATTR_INFO _EXPAT_COMMENT_ATTR_INFO) + + configure_file("${CMAKE_CURRENT_SOURCE_DIR}/lib/libexpat.def.cmake" "${CMAKE_CURRENT_BINARY_DIR}/lib/libexpat.def") + set(_EXPAT_EXTRA_SOURCES ${_EXPAT_EXTRA_SOURCES} "${CMAKE_CURRENT_BINARY_DIR}/lib/libexpat.def") + + # Add DLL version + string(REPLACE "." "," _EXPAT_DLL_VERSION ${PROJECT_VERSION}.0) + configure_file("${CMAKE_CURRENT_SOURCE_DIR}/win32/version.rc.cmake" "${CMAKE_CURRENT_BINARY_DIR}/win32/version.rc") + set(_EXPAT_EXTRA_SOURCES ${_EXPAT_EXTRA_SOURCES} "${CMAKE_CURRENT_BINARY_DIR}/win32/version.rc") endif() else() set(_SHARED STATIC) endif() -# Avoid colliding with Expat.dll of Perl's XML::Parser::Expat -if(WIN32 AND NOT MINGW) - set(_EXPAT_OUTPUT_NAME libexpat) # CMAKE_*_POSTFIX applies, see above -else() - if(_EXPAT_UNICODE) - set(_EXPAT_OUTPUT_NAME expatw) - else() - set(_EXPAT_OUTPUT_NAME expat) - endif() +add_library(expat ${_SHARED} ${_EXPAT_C_SOURCES} ${_EXPAT_EXTRA_SOURCES}) +add_library(expat::expat ALIAS expat) +if(_EXPAT_LIBM_FOUND) + target_link_libraries(expat m) endif() - -add_library(expat ${_SHARED} ${expat_SRCS}) if(EXPAT_WITH_LIBBSD) target_link_libraries(expat ${LIB_BSD}) endif() -set(LIBCURRENT 7) # sync -set(LIBREVISION 12) # with -set(LIBAGE 6) # configure.ac! +# +# Library filename postfix +# +if(_EXPAT_UNICODE) + set(_POSTFIX_WIDE "w") +endif() + +if(MSVC AND NOT EXPAT_SHARED_LIBS) + if(EXPAT_MSVC_STATIC_CRT) + set(_POSTFIX_CRT "MT") + else() + set(_POSTFIX_CRT "MD") + endif() +endif() + +foreach(build_type_upper + ${_EXPAT_BUILD_TYPE_UPPER} + DEBUG + RELEASE + MINSIZEREL + RELWITHDEBINFO + ) + if(WIN32 AND build_type_upper STREQUAL "DEBUG") + set(_POSTFIX_DEBUG "d") + else() + set(_POSTFIX_DEBUG "") # needs a reset because of being looped + endif() + + expat_shy_set(EXPAT_${build_type_upper}_POSTFIX "${_POSTFIX_WIDE}${_POSTFIX_DEBUG}${_POSTFIX_CRT}" CACHE STRING "Library filename postfix for build type ${build_type_upper}; yields filenames libexpat.(dll|dylib|lib|so)") + mark_as_advanced(EXPAT_${build_type_upper}_POSTFIX) + set_property(TARGET expat PROPERTY ${build_type_upper}_POSTFIX ${EXPAT_${build_type_upper}_POSTFIX}) +endforeach() + +set(LIBCURRENT 11) # sync +set(LIBREVISION 0) # with +set(LIBAGE 10) # configure.ac! math(EXPR LIBCURRENT_MINUS_AGE "${LIBCURRENT} - ${LIBAGE}") -set_property(TARGET expat PROPERTY OUTPUT_NAME "${_EXPAT_OUTPUT_NAME}") if(NOT WIN32) set_property(TARGET expat PROPERTY VERSION ${LIBCURRENT_MINUS_AGE}.${LIBAGE}.${LIBREVISION}) set_property(TARGET expat PROPERTY SOVERSION ${LIBCURRENT_MINUS_AGE}) set_property(TARGET expat PROPERTY NO_SONAME ${NO_SONAME}) + + if(APPLE) + if(NOT CMAKE_VERSION VERSION_GREATER_EQUAL 3.17) + message(FATAL_ERROR "Expat requires CMake >=3.17 on platform \"APPLE\".") + endif() + + # NOTE: This intends to talk CMake into compatibility with GNU Libtool + math(EXPR _EXPAT_MACHO_COMPATIBILITY_VERSION "${LIBCURRENT} + 1") + set(_EXPAT_MACHO_CURRENT_VERSION "${_EXPAT_MACHO_COMPATIBILITY_VERSION}.${LIBREVISION}") + set_property(TARGET expat PROPERTY MACHO_COMPATIBILITY_VERSION ${_EXPAT_MACHO_COMPATIBILITY_VERSION}) + set_property(TARGET expat PROPERTY MACHO_CURRENT_VERSION ${_EXPAT_MACHO_CURRENT_VERSION}) + endif() +endif() + +if(MINGW AND EXPAT_SHARED_LIBS) + set_target_properties(expat PROPERTIES SUFFIX "-${LIBCURRENT_MINUS_AGE}.dll") +endif() + +if(WIN32 AND NOT MINGW) + # NOTE: This avoids a name collision with Expat.dll of Perl's XML::Parser::Expat + # on Windows by resorting to filename libexpat.dll since Expat 1.95.3. + # Everything but MSVC is already adding prefix "lib", automatically. + # NOTE: "set_property(TARGET expat PROPERTY PREFIX lib)" would only affect *.dll + # files but not *.lib files, so we have to rely on property OUTPUT_NAME, instead. + # Target property _POSTFIX still applies. + set(_EXPAT_OUTPUT_NAME libexpat) + set_property(TARGET expat PROPERTY OUTPUT_NAME ${_EXPAT_OUTPUT_NAME}) +else() + set(_EXPAT_OUTPUT_NAME expat) endif() target_include_directories(expat @@ -346,8 +513,8 @@ target_include_directories(expat $ ) -if(NOT EXPAT_SHARED_LIBS AND WIN32) - target_compile_definitions(expat PUBLIC -DXML_STATIC) +if(WIN32 AND EXPAT_SHARED_LIBS) + target_compile_definitions(expat PRIVATE VER_FILEVERSION=${_EXPAT_DLL_VERSION}) endif() expat_install(TARGETS expat EXPORT expat @@ -361,12 +528,42 @@ expat_install(FILES lib/expat.h lib/expat_external.h DESTINATION ${CMAKE_INSTALL # pkg-config file # if(EXPAT_BUILD_PKGCONFIG) - set(prefix ${CMAKE_INSTALL_PREFIX}) - set(exec_prefix "\${prefix}") - set(libdir "\${exec_prefix}/${CMAKE_INSTALL_LIBDIR}") - set(includedir "\${prefix}/${CMAKE_INSTALL_INCLUDEDIR}") - configure_file(expat.pc.in ${CMAKE_CURRENT_BINARY_DIR}/expat.pc @ONLY) - expat_install(FILES ${CMAKE_CURRENT_BINARY_DIR}/expat.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) + if(CMAKE_INSTALL_LIBDIR MATCHES "^/") + set(_expat_pkgconfig_libdir "${CMAKE_INSTALL_LIBDIR}") + else() + set(_expat_pkgconfig_libdir "\${exec_prefix}/${CMAKE_INSTALL_LIBDIR}") + endif() + + if(CMAKE_INSTALL_INCLUDEDIR MATCHES "^/") + set(_expat_pkgconfig_includedir "${CMAKE_INSTALL_INCLUDEDIR}") + else() + set(_expat_pkgconfig_includedir "\${prefix}/${CMAKE_INSTALL_INCLUDEDIR}") + endif() + + set_target_properties(expat PROPERTIES + pkgconfig_prefix "${CMAKE_INSTALL_PREFIX}" + pkgconfig_exec_prefix "\${prefix}" + pkgconfig_libdir "${_expat_pkgconfig_libdir}" + pkgconfig_includedir "${_expat_pkgconfig_includedir}" + pkgconfig_version "${PACKAGE_VERSION}") + + foreach(_build_type ${CMAKE_BUILD_TYPE} Debug Release RelWithDebInfo MinSizeRel) + string(TOLOWER "${_build_type}" _build_type_lower) + string(TOUPPER "${_build_type}" _build_type_upper) + set_property(TARGET expat PROPERTY "pkgconfig_${_build_type_lower}_name" "expat${EXPAT_${_build_type_upper}_POSTFIX}") + set_property(TARGET expat PROPERTY "pkgconfig_${_build_type_lower}_output_name" "${_EXPAT_OUTPUT_NAME}${EXPAT_${_build_type_upper}_POSTFIX}") + if(_EXPAT_LIBM_FOUND) + set_property(TARGET expat PROPERTY "pkgconfig_libm" "-lm") + else() + set_property(TARGET expat PROPERTY "pkgconfig_libm" "") + endif() + endforeach() + + file(GENERATE + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/$/expat.pc + INPUT ${PROJECT_SOURCE_DIR}/expat.pc.cmake) + + expat_install(FILES ${CMAKE_CURRENT_BINARY_DIR}/$/expat.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) endif() # @@ -374,15 +571,18 @@ endif() # if(EXPAT_BUILD_TOOLS) set(xmlwf_SRCS - xmlwf/xmlwf.c - xmlwf/xmlfile.c xmlwf/codepage.c xmlwf/readfilemap.c + xmlwf/xmlfile.c + xmlwf/xmlwf.c ) add_executable(xmlwf ${xmlwf_SRCS}) set_property(TARGET xmlwf PROPERTY RUNTIME_OUTPUT_DIRECTORY xmlwf) target_link_libraries(xmlwf expat) + if(_EXPAT_LIBM_FOUND) + target_link_libraries(xmlwf m) + endif() expat_install(TARGETS xmlwf DESTINATION ${CMAKE_INSTALL_BINDIR}) if(MINGW AND _EXPAT_UNICODE_WCHAR_T) @@ -409,13 +609,11 @@ endif() # C code examples # if(EXPAT_BUILD_EXAMPLES) - add_executable(elements examples/elements.c) - set_property(TARGET elements PROPERTY RUNTIME_OUTPUT_DIRECTORY examples) - target_link_libraries(elements expat) - - add_executable(outline examples/outline.c) - set_property(TARGET outline PROPERTY RUNTIME_OUTPUT_DIRECTORY examples) - target_link_libraries(outline expat) + foreach(_target element_declarations elements outline) + add_executable(${_target} examples/${_target}.c) + set_property(TARGET ${_target} PROPERTY RUNTIME_OUTPUT_DIRECTORY examples) + target_link_libraries(${_target} expat) + endforeach() endif() # @@ -423,16 +621,8 @@ endif() # if(EXPAT_BUILD_TESTS) ## these are unittests that can be run on any platform - enable_language(CXX) enable_testing() - set(test_SRCS - tests/chardata.c - tests/memcheck.c - tests/minicheck.c - tests/structdata.c - ) - if(NOT MSVC) if(MINGW) set(host whatever-mingw32) # for nothing but run.sh @@ -448,17 +638,67 @@ if(EXPAT_BUILD_TESTS) endif() endfunction() - add_executable(runtests tests/runtests.c ${test_SRCS}) - set_property(TARGET runtests PROPERTY RUNTIME_OUTPUT_DIRECTORY tests) - target_link_libraries(runtests expat) - expat_add_test(runtests $) + set(_EXPAT_TEST_TARGETS runtests runtests_cxx) + + add_executable(runtests + tests/acc_tests.c + tests/alloc_tests.c + tests/basic_tests.c + tests/chardata.c + tests/common.c + tests/dummy.c + tests/handlers.c + tests/memcheck.c + tests/minicheck.c + tests/misc_tests.c + tests/ns_tests.c + tests/nsalloc_tests.c + tests/runtests.c + tests/structdata.c + ${_EXPAT_C_SOURCES} + ) + + add_executable(runtests_cxx + tests/acc_tests_cxx.cpp + tests/alloc_tests_cxx.cpp + tests/basic_tests_cxx.cpp + tests/chardata_cxx.cpp + tests/common_cxx.cpp + tests/dummy_cxx.cpp + tests/handlers_cxx.cpp + tests/memcheck_cxx.cpp + tests/minicheck_cxx.cpp + tests/misc_tests_cxx.cpp + tests/ns_tests_cxx.cpp + tests/nsalloc_tests_cxx.cpp + tests/runtests_cxx.cpp + tests/structdata_cxx.cpp + ${_EXPAT_C_SOURCES} + ) + + foreach(_target ${_EXPAT_TEST_TARGETS}) + target_compile_definitions(${_target} PRIVATE -DXML_TESTING) + + set_property(TARGET ${_target} PROPERTY RUNTIME_OUTPUT_DIRECTORY tests) + expat_add_test(${_target} $) - add_executable(runtestspp tests/runtestspp.cpp ${test_SRCS}) - set_property(TARGET runtestspp PROPERTY RUNTIME_OUTPUT_DIRECTORY tests) - target_link_libraries(runtestspp expat) - expat_add_test(runtestspp $) + if(_EXPAT_LIBM_FOUND) + target_link_libraries(${_target} m) + endif() + + if(EXPAT_WITH_LIBBSD) + target_link_libraries(${_target} ${LIB_BSD}) + endif() + endforeach() + + add_executable(benchmark tests/benchmark/benchmark.c) + set_property(TARGET benchmark PROPERTY RUNTIME_OUTPUT_DIRECTORY tests/benchmark) + target_link_libraries(benchmark expat) endif() +# +# Fuzzers +# if(EXPAT_BUILD_FUZZERS) if(NOT "${CMAKE_C_COMPILER_ID}" STREQUAL "Clang") message(SEND_ERROR @@ -491,7 +731,7 @@ if(EXPAT_BUILD_FUZZERS) set(encoding_types UTF-16 UTF-8 ISO-8859-1 US-ASCII UTF-16BE UTF-16LE) set(fuzz_targets xml_parse_fuzzer xml_parsebuffer_fuzzer) - add_library(fuzzpat STATIC ${expat_SRCS}) + add_library(fuzzpat STATIC ${_EXPAT_C_SOURCES}) if(NOT EXPAT_OSSFUZZ_BUILD) target_compile_options(fuzzpat PRIVATE -fsanitize=fuzzer-no-link) endif() @@ -526,6 +766,23 @@ else() endif() endif() +# +# C/C++ config affecting multiple targets +# +if(WIN32) + set(_EXPAT_STATIC_TARGETS ${_EXPAT_TEST_TARGETS}) + if(NOT EXPAT_SHARED_LIBS) + list(APPEND _EXPAT_STATIC_TARGETS expat) + endif() + if(EXPAT_BUILD_FUZZERS) + list(APPEND _EXPAT_STATIC_TARGETS fuzzpat) + endif() + + foreach(_target ${_EXPAT_STATIC_TARGETS}) + target_compile_definitions(${_target} PUBLIC -DXML_STATIC) + endforeach() +endif() + # # Custom target "run-xmltest" # @@ -656,20 +913,31 @@ elseif(EXPAT_CHAR_TYPE STREQUAL "wchar_t") else() set(_EXPAT_CHAR_TYPE_SUMMARY "ERROR") endif() -string(TOUPPER "${CMAKE_BUILD_TYPE}" _EXPAT_BUILD_TYPE_UPPER) +# NOTE: We're not accessing global property GENERATOR_IS_MULTI_CONFIG +# because that would require CMake >=3.9 +if(CMAKE_CONFIGURATION_TYPES) + set(_EXPAT_GENERATOR_IS_MULTI_CONFIG TRUE) +else() + set(_EXPAT_GENERATOR_IS_MULTI_CONFIG FALSE) +endif() message(STATUS "===========================================================================") message(STATUS "") message(STATUS "Configuration") +message(STATUS " Generator .................. ${CMAKE_GENERATOR}") +if(_EXPAT_GENERATOR_IS_MULTI_CONFIG) + message(STATUS " Build types ................ ${CMAKE_CONFIGURATION_TYPES}") +else() + message(STATUS " Build type ................. ${CMAKE_BUILD_TYPE}") +endif() message(STATUS " Prefix ..................... ${CMAKE_INSTALL_PREFIX}") -message(STATUS " Build type ................. ${CMAKE_BUILD_TYPE}") message(STATUS " Shared libraries ........... ${EXPAT_SHARED_LIBS}") if(MSVC) message(STATUS " Static CRT ................. ${EXPAT_MSVC_STATIC_CRT}") endif() message(STATUS " Character type ............. ${_EXPAT_CHAR_TYPE_SUMMARY}") -if(WIN32) - message(STATUS " Binary postfix ............. ${CMAKE_${_EXPAT_BUILD_TYPE_UPPER}_POSTFIX}") +if(NOT _EXPAT_GENERATOR_IS_MULTI_CONFIG) + message(STATUS " Library name postfix ....... ${EXPAT_${_EXPAT_BUILD_TYPE_UPPER}_POSTFIX}") endif() message(STATUS "") message(STATUS " Build documentation ........ ${EXPAT_BUILD_DOCS}") @@ -685,6 +953,7 @@ message(STATUS " // Advanced options, changes not advised") message(STATUS " Attributes info .......... ${EXPAT_ATTR_INFO}") message(STATUS " Context bytes ............ ${EXPAT_CONTEXT_BYTES}") message(STATUS " DTD support .............. ${EXPAT_DTD}") +message(STATUS " General entities ......... ${EXPAT_GE}") message(STATUS " Large size ............... ${EXPAT_LARGE_SIZE}") message(STATUS " Minimum size ............. ${EXPAT_MIN_SIZE}") message(STATUS " Namespace support ........ ${EXPAT_NS}") diff --git a/3rdparty/expat/COPYING b/3rdparty/expat/COPYING index 3c0142e71c8d4..ce9e5939291e4 100644 --- a/3rdparty/expat/COPYING +++ b/3rdparty/expat/COPYING @@ -1,5 +1,5 @@ Copyright (c) 1998-2000 Thai Open Source Software Center Ltd and Clark Cooper -Copyright (c) 2001-2019 Expat maintainers +Copyright (c) 2001-2022 Expat maintainers Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the diff --git a/3rdparty/expat/Changes b/3rdparty/expat/Changes index b74a7c56a961d..aa19f70ae2195 100644 --- a/3rdparty/expat/Changes +++ b/3rdparty/expat/Changes @@ -1,6 +1,742 @@ -NOTE: We are looking for help with a few things: - https://github.com/libexpat/libexpat/labels/help%20wanted - If you can help, please get in touch. Thanks! + __ __ _ + ___\ \/ /_ __ __ _| |_ + / _ \\ /| '_ \ / _` | __| + | __// \| |_) | (_| | |_ + \___/_/\_\ .__/ \__,_|\__| + |_| XML parser + +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +!! Expat is UNDERSTAFFED and WITHOUT FUNDING. !! +!! ~~~~~~~~~~~~ !! +!! The following topics need *additional skilled C developers* to progress !! +!! in a timely manner or at all (loosely ordered by descending priority): !! +!! !! +!! - fixing a complex non-public security issue, !! +!! - teaming up on researching and fixing future security reports and !! +!! ClusterFuzz findings with few-days-max response times in communication !! +!! in order to (1) have a sound fix ready before the end of a 90 days !! +!! grace period and (2) in a sustainable manner, !! +!! - implementing and auto-testing XML 1.0r5 support !! +!! (needs discussion before pull requests), !! +!! - smart ideas on fixing the Autotools CMake files generation issue !! +!! without breaking CI (needs discussion before pull requests), !! +!! - the Windows binaries topic (needs requirements engineering first), !! +!! - pushing migration from `int` to `size_t` further !! +!! including edge-cases test coverage (needs discussion before anything). !! +!! !! +!! For details, please reach out via e-mail to sebastian@pipping.org so we !! +!! can schedule a voice call on the topic, in English or German. !! +!! !! +!! THANK YOU! Sebastian Pipping -- Berlin, 2024-03-09 !! +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +Release 2.6.4 Wed November 6 2024 + Security fixes: + #915 CVE-2024-50602 -- Fix crash within function XML_ResumeParser + from a NULL pointer dereference by disallowing function + XML_StopParser to (stop or) suspend an unstarted parser. + A new error code XML_ERROR_NOT_STARTED was introduced to + properly communicate this situation. // CWE-476 CWE-754 + + Other changes: + #903 CMake: Add alias target "expat::expat" + #905 docs: Document use via CMake >=3.18 with FetchContent + and SOURCE_SUBDIR and its consequences + #902 tests: Reduce use of global parser instance + #904 tests: Resolve duplicate handler + #317 #918 tests: Improve tests on doctype closing (ex CVE-2019-15903) + #914 Fix signedness of format strings + #919 #920 Version info bumped from 10:3:9 (libexpat*.so.1.9.3) + to 11:0:10 (libexpat*.so.1.10.0); see https://verbump.de/ + for what these numbers do + + Infrastructure: + #907 CI: Upgrade Clang from 18 to 19 + #913 CI: Drop macos-12 and add macos-15 + #910 CI: Adapt to breaking changes in GitHub Actions + #898 Add missing entries to .gitignore + + Special thanks to: + Hanno Böck + José Eduardo Gutiérrez Conejo + José Ricardo Cardona Quesada + +Release 2.6.3 Wed September 4 2024 + Security fixes: + #887 #890 CVE-2024-45490 -- Calling function XML_ParseBuffer with + len < 0 without noticing and then calling XML_GetBuffer + will have XML_ParseBuffer fail to recognize the problem + and XML_GetBuffer corrupt memory. + With the fix, XML_ParseBuffer now complains with error + XML_ERROR_INVALID_ARGUMENT just like sibling XML_Parse + has been doing since Expat 2.2.1, and now documented. + Impact is denial of service to potentially artitrary code + execution. + #888 #891 CVE-2024-45491 -- Internal function dtdCopy can have an + integer overflow for nDefaultAtts on 32-bit platforms + (where UINT_MAX equals SIZE_MAX). + Impact is denial of service to potentially artitrary code + execution. + #889 #892 CVE-2024-45492 -- Internal function nextScaffoldPart can + have an integer overflow for m_groupSize on 32-bit + platforms (where UINT_MAX equals SIZE_MAX). + Impact is denial of service to potentially artitrary code + execution. + + Other changes: + #851 #879 Autotools: Sync CMake templates with CMake 3.28 + #853 Autotools: Always provide path to find(1) for portability + #861 Autotools: Ensure that the m4 directory always exists. + #870 Autotools: Simplify handling of SIZEOF_VOID_P + #869 Autotools: Support non-GNU sed + #856 Autotools|CMake: Fix main() to main(void) + #865 Autotools|CMake: Fix compile tests for HAVE_SYSCALL_GETRANDOM + #863 Autotools|CMake: Stop requiring dos2unix + #854 #855 CMake: Fix check for symbols size_t and off_t + #864 docs|tests: Convert README to Markdown and update + #741 Windows: Drop support for Visual Studio <=15.0/2017 + #886 Drop needless XML_DTD guards around is_param access + #885 Fix typo in a code comment + #894 #896 Version info bumped from 10:2:9 (libexpat*.so.1.9.2) + to 10:3:9 (libexpat*.so.1.9.3); see https://verbump.de/ + for what these numbers do + + Infrastructure: + #880 Readme: Promote the call for help + #868 CI: Fix various issues + #849 CI: Allow triggering GitHub Actions workflows manually + #851 #872 .. + #873 #879 CI: Adapt to breaking changes in GitHub Actions + + Special thanks to: + Alexander Bluhm + Berkay Eren Ürün + Dag-Erling Smørgrav + Ferenc Géczi + TaiYou + +Release 2.6.2 Wed March 13 2024 + Security fixes: + #839 #842 CVE-2024-28757 -- Prevent billion laughs attacks with + isolated use of external parsers. Please see the commit + message of commit 1d50b80cf31de87750103656f6eb693746854aa8 + for details. + + Bug fixes: + #839 #841 Reject direct parameter entity recursion + and avoid the related undefined behavior + + Other changes: + #847 Autotools: Fix build for DOCBOOK_TO_MAN containing spaces + #837 Add missing #821 and #824 to 2.6.1 change log + #838 #843 Version info bumped from 10:1:9 (libexpat*.so.1.9.1) + to 10:2:9 (libexpat*.so.1.9.2); see https://verbump.de/ + for what these numbers do + + Special thanks to: + Philippe Antoine + Tomas Korbar + and + Clang UndefinedBehaviorSanitizer + OSS-Fuzz / ClusterFuzz + +Release 2.6.1 Thu February 29 2024 + Bug fixes: + #817 Make tests independent of CPU speed, and thus more robust + #828 #836 Expose billion laughs API with XML_DTD defined and + XML_GE undefined, regression from 2.6.0 + + Other changes: + #829 Hide test-only code behind new internal macro + #833 Autotools: Reject expat_config.h.in defining SIZEOF_VOID_P + #821 #824 Autotools: Fix "make clean" for case: + ./configure --without-docbook && make clean all + #819 Address compiler warnings + #832 #834 Version info bumped from 10:0:9 (libexpat*.so.1.9.0) + to 10:1:9 (libexpat*.so.1.9.1); see https://verbump.de/ + for what these numbers do + + Infrastructure: + #818 CI: Adapt to breaking changes in clang-format + + Special thanks to: + David Hall + Snild Dolkow + +Release 2.6.0 Tue February 6 2024 + Security fixes: + #789 #814 CVE-2023-52425 -- Fix quadratic runtime issues with big tokens + that can cause denial of service, in partial where + dealing with compressed XML input. Applications + that parsed a document in one go -- a single call to + functions XML_Parse or XML_ParseBuffer -- were not affected. + The smaller the chunks/buffers you use for parsing + previously, the bigger the problem prior to the fix. + Backporters should be careful to no omit parts of + pull request #789 and to include earlier pull request #771, + in order to not break the fix. + #777 CVE-2023-52426 -- Fix billion laughs attacks for users + compiling *without* XML_DTD defined (which is not common). + Users with XML_DTD defined have been protected since + Expat >=2.4.0 (and that was CVE-2013-0340 back then). + + Bug fixes: + #753 Fix parse-size-dependent "invalid token" error for + external entities that start with a byte order mark + #780 Fix NULL pointer dereference in setContext via + XML_ExternalEntityParserCreate for compilation with + XML_DTD undefined + #812 #813 Protect against closing entities out of order + + Other changes: + #723 Improve support for arc4random/arc4random_buf + #771 #788 Improve buffer growth in XML_GetBuffer and XML_Parse + #761 #770 xmlwf: Support --help and --version + #759 #770 xmlwf: Support custom buffer size for XML_GetBuffer and read + #744 xmlwf: Improve language and URL clickability in help output + #673 examples: Add new example "element_declarations.c" + #764 Be stricter about macro XML_CONTEXT_BYTES at build time + #765 Make inclusion to expat_config.h consistent + #726 #727 Autotools: configure.ac: Support --disable-maintainer-mode + #678 #705 .. + #706 #733 #792 Autotools: Sync CMake templates with CMake 3.26 + #795 Autotools: Make installation of shipped man page doc/xmlwf.1 + independent of docbook2man availability + #815 Autotools|CMake: Add missing -DXML_STATIC to pkg-config file + section "Cflags.private" in order to fix compilation + against static libexpat using pkg-config on Windows + #724 #751 Autotools|CMake: Require a C99 compiler + (a de-facto requirement already since Expat 2.2.2 of 2017) + #793 Autotools|CMake: Fix PACKAGE_BUGREPORT variable + #750 #786 Autotools|CMake: Make test suite require a C++11 compiler + #749 CMake: Require CMake >=3.5.0 + #672 CMake: Lowercase off_t and size_t to help a bug in Meson + #746 CMake: Sort xmlwf sources alphabetically + #785 CMake|Windows: Fix generation of DLL file version info + #790 CMake: Build tests/benchmark/benchmark.c as well for + a build with -DEXPAT_BUILD_TESTS=ON + #745 #757 docs: Document the importance of isFinal + adjust tests + accordingly + #736 docs: Improve use of "NULL" and "null" + #713 docs: Be specific about version of XML (XML 1.0r4) + and version of C (C99); (XML 1.0r5 will need a sponsor.) + #762 docs: reference.html: Promote function XML_ParseBuffer more + #779 docs: reference.html: Add HTML anchors to XML_* macros + #760 docs: reference.html: Upgrade to OK.css 1.2.0 + #763 #739 docs: Fix typos + #696 docs|CI: Use HTTPS URLs instead of HTTP at various places + #669 #670 .. + #692 #703 .. + #733 #772 Address compiler warnings + #798 #800 Address clang-tidy warnings + #775 #776 Version info bumped from 9:10:8 (libexpat*.so.1.8.10) + to 10:0:9 (libexpat*.so.1.9.0); see https://verbump.de/ + for what these numbers do + + Infrastructure: + #700 #701 docs: Document security policy in file SECURITY.md + #766 docs: Improve parse buffer variables in-code documentation + #674 #738 .. + #740 #747 .. + #748 #781 #782 Refactor coverage and conformance tests + #714 #716 Refactor debug level variables to unsigned long + #671 Improve handling of empty environment variable value + in function getDebugLevel (without visible user effect) + #755 #774 .. + #758 #783 .. + #784 #787 tests: Improve test coverage with regard to parse chunk size + #660 #797 #801 Fuzzing: Improve fuzzing coverage + #367 #799 Fuzzing|CI: Start running OSS-Fuzz fuzzing regression tests + #698 #721 CI: Resolve some Travis CI leftovers + #669 CI: Be robust towards absence of Git tags + #693 #694 CI: Set permissions to "contents: read" for security + #709 CI: Pin all GitHub Actions to specific commits for security + #739 CI: Reject spelling errors using codespell + #798 CI: Enforce clang-tidy clean code + #773 #808 .. + #809 #810 CI: Upgrade Clang from 15 to 18 + #796 CI: Start using Clang's Control Flow Integrity sanitizer + #675 #720 #722 CI: Adapt to breaking changes in GitHub Actions Ubuntu images + #689 CI: Adapt to breaking changes in Clang/LLVM Debian packaging + #763 CI: Adapt to breaking changes in codespell + #803 CI: Adapt to breaking changes in Cppcheck + + Special thanks to: + Ivan Galkin + Joyce Brum + Philippe Antoine + Rhodri James + Snild Dolkow + spookyahell + Steven Garske + and + Clang AddressSanitizer + Clang UndefinedBehaviorSanitizer + codespell + GCC Farm Project + OSS-Fuzz + Sony Mobile + +Release 2.5.0 Tue October 25 2022 + Security fixes: + #616 #649 #650 CVE-2022-43680 -- Fix heap use-after-free after overeager + destruction of a shared DTD in function + XML_ExternalEntityParserCreate in out-of-memory situations. + Expected impact is denial of service or potentially + arbitrary code execution. + + Bug fixes: + #612 #645 Fix corruption from undefined entities + #613 #654 Fix case when parsing was suspended while processing nested + entities + #616 #652 #653 Stop leaking opening tag bindings after a closing tag + mismatch error where a parser is reset through + XML_ParserReset and then reused to parse + #656 CMake: Fix generation of pkg-config file + #658 MinGW|CMake: Fix static library name + + Other changes: + #663 Protect header expat_config.h from multiple inclusion + #666 examples: Make use of XML_GetBuffer and be more + consistent across examples + #648 Address compiler warnings + #667 #668 Version info bumped from 9:9:8 to 9:10:8; + see https://verbump.de/ for what these numbers do + + Special thanks to: + Jann Horn + Mark Brand + Osyotr + Rhodri James + and + Google Project Zero + +Release 2.4.9 Tue September 20 2022 + Security fixes: + #629 #640 CVE-2022-40674 -- Heap use-after-free vulnerability in + function doContent. Expected impact is denial of service + or potentially arbitrary code execution. + + Bug fixes: + #634 MinGW: Fix mis-compilation for -D__USE_MINGW_ANSI_STDIO=0 + #614 docs: Fix documentation on effect of switch XML_DTD on + symbol visibility in doc/reference.html + + Other changes: + #638 MinGW: Make fix-xmltest-log.sh drop more Wine bug output + #596 #625 Autotools: Sync CMake templates with CMake 3.22 + #608 CMake: Migrate from use of CMAKE_*_POSTFIX to + dedicated variables EXPAT_*_POSTFIX to stop affecting + other projects + #597 #599 Windows|CMake: Add missing -DXML_STATIC to test runners + and fuzzers + #512 #621 Windows|CMake: Render .def file from a template to fix + linking with -DEXPAT_DTD=OFF and/or -DEXPAT_ATTR_INFO=ON + #611 #621 MinGW|CMake: Apply MSVC .def file when linking + #622 #624 MinGW|CMake: Sync library name with GNU Autotools, + i.e. produce libexpat-1.dll rather than libexpat.dll + by default. Filename libexpat.dll.a is unaffected. + #632 MinGW|CMake: Set missing variable CMAKE_RC_COMPILER in + toolchain file "cmake/mingw-toolchain.cmake" to avoid + error "windres: Command not found" on e.g. Ubuntu 20.04 + #597 #627 CMake: Unify inconsistent use of set() and option() in + context of public build time options to take need for + set(.. FORCE) in projects using Expat by means of + add_subdirectory(..) off Expat's users' shoulders + #626 #641 Stop exporting API symbols when building a static library + #644 Resolve use of deprecated "fgrep" by "grep -F" + #620 CMake: Make documentation on variables a bit more consistent + #636 CMake: Drop leading whitespace from a #cmakedefine line in + file expat_config.h.cmake + #594 xmlwf: Fix harmless variable mix-up in function nsattcmp + #592 #593 #610 Address Cppcheck warnings + #643 Address Clang 15 compiler warnings + #642 #644 Version info bumped from 9:8:8 to 9:9:8; + see https://verbump.de/ for what these numbers do + + Infrastructure: + #597 #598 CI: Windows: Start covering MSVC 2022 + #619 CI: macOS: Migrate off deprecated macOS 10.15 + #632 CI: Linux: Make migration off deprecated Ubuntu 18.04 work + #643 CI: Upgrade Clang from 14 to 15 + #637 apply-clang-format.sh: Add support for BSD find + #633 coverage.sh: Exclude MinGW headers + #635 coverage.sh: Fix name collision for -funsigned-char + + Special thanks to: + David Faure + Felix Wilhelm + Frank Bergmann + Rhodri James + Rosen Penev + Thijs Schreijer + Vincent Torri + and + Google Project Zero + +Release 2.4.8 Mon March 28 2022 + Other changes: + #587 pkg-config: Move "-lm" to section "Libs.private" + #587 CMake|MSVC: Fix pkg-config section "Libs" + #55 #582 CMake|macOS: Start using linker arguments + "-compatibility_version " and + "-current_version " in a way compatible with + GNU Libtool + #590 #591 Version info bumped from 9:7:8 to 9:8:8; + see https://verbump.de/ for what these numbers do + + Infrastructure: + #589 CI: Upgrade Clang from 13 to 14 + + Special thanks to: + evpobr + Kai Pastor + Sam James + +Release 2.4.7 Fri March 4 2022 + Bug fixes: + #572 #577 Relax fix to CVE-2022-25236 (introduced with release 2.4.5) + with regard to all valid URI characters (RFC 3986), + i.e. the following set (excluding whitespace): + ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz + 0123456789 % -._~ :/?#[]@ !$&'()*+,;= + + Other changes: + #555 #570 #581 CMake|Windows: Store Expat version in the DLL + #577 Document consequences of namespace separator choices not just + in doc/reference.html but also in header + #577 Document Expat's lack of validation of namespace URIs against + RFC 3986, and that the XML 1.0r4 specification doesn't + require Expat to validate namespace URIs, and that Expat + may do more in that regard in future releases. + If you find need for strict RFC 3986 URI validation on + application level today, https://uriparser.github.io/ may + be of interest. + #579 Fix documentation of XML_EndDoctypeDeclHandler in + #575 Document that a call to XML_FreeContentModel can be done at + a later time from outside the element declaration handler + #574 Make hardcoded namespace URIs easier to find in code + #573 Update documentation on use of XML_POOR_ENTOPY on Solaris + #569 #571 tests: Resolve use of macros NAN and INFINITY for GNU G++ + 4.8.2 on Solaris. + #578 #580 Version info bumped from 9:6:8 to 9:7:8; + see https://verbump.de/ for what these numbers do + + Special thanks to: + Jeffrey Walton + Johnny Jazeix + Thijs Schreijer + +Release 2.4.6 Sun February 20 2022 + Bug fixes: + #566 Fix a regression introduced by the fix for CVE-2022-25313 + in release 2.4.5 that affects applications that (1) + call function XML_SetElementDeclHandler and (2) are + parsing XML that contains nested element declarations + (e.g. ""). + + Other changes: + #567 #568 Version info bumped from 9:5:8 to 9:6:8; + see https://verbump.de/ for what these numbers do + + Special thanks to: + Matt Sergeant + Samanta Navarro + Sergei Trofimovich + and + NixOS + Perl XML::Parser + +Release 2.4.5 Fri February 18 2022 + Security fixes: + #562 CVE-2022-25235 -- Passing malformed 2- and 3-byte UTF-8 + sequences (e.g. from start tag names) to the XML + processing application on top of Expat can cause + arbitrary damage (e.g. code execution) depending + on how invalid UTF-8 is handled inside the XML + processor; validation was not their job but Expat's. + Exploits with code execution are known to exist. + #561 CVE-2022-25236 -- Passing (one or more) namespace separator + characters in "xmlns[:prefix]" attribute values + made Expat send malformed tag names to the XML + processor on top of Expat which can cause + arbitrary damage (e.g. code execution) depending + on such unexpectable cases are handled inside the XML + processor; validation was not their job but Expat's. + Exploits with code execution are known to exist. + #558 CVE-2022-25313 -- Fix stack exhaustion in doctype parsing + that could be triggered by e.g. a 2 megabytes + file with a large number of opening braces. + Expected impact is denial of service or potentially + arbitrary code execution. + #560 CVE-2022-25314 -- Fix integer overflow in function copyString; + only affects the encoding name parameter at parser creation + time which is often hardcoded (rather than user input), + takes a value in the gigabytes to trigger, and a 64-bit + machine. Expected impact is denial of service. + #559 CVE-2022-25315 -- Fix integer overflow in function storeRawNames; + needs input in the gigabytes and a 64-bit machine. + Expected impact is denial of service or potentially + arbitrary code execution. + + Other changes: + #557 #564 Version info bumped from 9:4:8 to 9:5:8; + see https://verbump.de/ for what these numbers do + + Special thanks to: + Ivan Fratric + Samanta Navarro + and + Google Project Zero + JetBrains + +Release 2.4.4 Sun January 30 2022 + Security fixes: + #550 CVE-2022-23852 -- Fix signed integer overflow + (undefined behavior) in function XML_GetBuffer + (that is also called by function XML_Parse internally) + for when XML_CONTEXT_BYTES is defined to >0 (which is both + common and default). + Impact is denial of service or more. + #551 CVE-2022-23990 -- Fix unsigned integer overflow in function + doProlog triggered by large content in element type + declarations when there is an element declaration handler + present (from a prior call to XML_SetElementDeclHandler). + Impact is denial of service or more. + + Bug fixes: + #544 #545 xmlwf: Fix a memory leak on output file opening error + + Other changes: + #546 Autotools: Fix broken CMake support under Cygwin + #554 Windows: Add missing files to the installer to fix + compilation with CMake from installed sources + #552 #554 Version info bumped from 9:3:8 to 9:4:8; + see https://verbump.de/ for what these numbers do + + Special thanks to: + Carlo Bramini + hwt0415 + Roland Illig + Samanta Navarro + and + Clang LeakSan and the Clang team + +Release 2.4.3 Sun January 16 2022 + Security fixes: + #531 #534 CVE-2021-45960 -- Fix issues with left shifts by >=29 places + resulting in + a) realloc acting as free + b) realloc allocating too few bytes + c) undefined behavior + depending on architecture and precise value + for XML documents with >=2^27+1 prefixed attributes + on a single XML tag a la + "" + where XML_ParserCreateNS is used to create the parser + (which needs argument "-n" when running xmlwf). + Impact is denial of service, or more. + #532 #538 CVE-2021-46143 (ZDI-CAN-16157) -- Fix integer overflow + on variable m_groupSize in function doProlog leading + to realloc acting as free. + Impact is denial of service or more. + #539 CVE-2022-22822 to CVE-2022-22827 -- Prevent integer overflows + near memory allocation at multiple places. Mitre assigned + a dedicated CVE for each involved internal C function: + - CVE-2022-22822 for function addBinding + - CVE-2022-22823 for function build_model + - CVE-2022-22824 for function defineAttribute + - CVE-2022-22825 for function lookup + - CVE-2022-22826 for function nextScaffoldPart + - CVE-2022-22827 for function storeAtts + Impact is denial of service or more. + + Other changes: + #535 CMake: Make call to file(GENERATE [..]) work for CMake <3.19 + #541 Autotools|CMake: MinGW: Make run.sh(.in) work for Cygwin + and MSYS2 by not going through Wine on these platforms + #527 #528 Address compiler warnings + #533 #543 Version info bumped from 9:2:8 to 9:3:8; + see https://verbump.de/ for what these numbers do + + Infrastructure: + #536 CI: Check for realistic minimum CMake version + #529 #539 CI: Cover compilation with -m32 + #529 CI: Store coverage reports as artifacts for download + #528 CI: Upgrade Clang from 11 to 13 + + Special thanks to: + An anonymous whitehat + Christopher Degawa + J. Peter Mugaas + Tyson Smith + and + GCC Farm Project + Trend Micro Zero Day Initiative + +Release 2.4.2 Sun December 19 2021 + Other changes: + #509 #510 Link againgst libm for function "isnan" + #513 #514 Include expat_config.h as early as possible + #498 Autotools: Include files with release archives: + - buildconf.sh + - fuzz/*.c + #507 #519 Autotools: Sync CMake templates with CMake 3.20 + #495 #524 CMake: MinGW: Fix pkg-config section "Libs" for + - non-release build types (e.g. -DCMAKE_BUILD_TYPE=Debug) + - multi-config CMake generators (e.g. Ninja Multi-Config) + #502 #503 docs: Document that function XML_GetBuffer may return NULL + when asking for a buffer of 0 (zero) bytes size + #522 #523 docs: Fix return value docs for both + XML_SetBillionLaughsAttackProtection* functions + #525 #526 Version info bumped from 9:1:8 to 9:2:8; + see https://verbump.de/ for what these numbers do + + Special thanks to: + Donghee Na + Joergen Ibsen + Kai Pastor + +Release 2.4.1 Sun May 23 2021 + Bug fixes: + #488 #490 Autotools: Fix installed header expat_config.h for multilib + systems; regression introduced in 2.4.0 by pull request #486 + + Other changes: + #491 #492 Version info bumped from 9:0:8 to 9:1:8; + see https://verbump.de/ for what these numbers do + + Special thanks to: + Gentoo's QA check "multilib_check_headers" + +Release 2.4.0 Sun May 23 2021 + Security fixes: + #34 #466 #484 CVE-2013-0340/CWE-776 -- Protect against billion laughs attacks + (denial-of-service; flavors targeting CPU time or RAM or both, + leveraging general entities or parameter entities or both) + by tracking and limiting the input amplification factor + ( := ( + ) / ). + By conservative default, amplification up to a factor of 100.0 + is tolerated and rejection only starts after 8 MiB of output bytes + (= + ) have been processed. + The fix adds the following to the API: + - A new error code XML_ERROR_AMPLIFICATION_LIMIT_BREACH to + signals this specific condition. + - Two new API functions .. + - XML_SetBillionLaughsAttackProtectionMaximumAmplification and + - XML_SetBillionLaughsAttackProtectionActivationThreshold + .. to further tighten billion laughs protection parameters + when desired. Please see file "doc/reference.html" for details. + If you ever need to increase the defaults for non-attack XML + payload, please file a bug report with libexpat. + - Two new XML_FEATURE_* constants .. + - that can be queried using the XML_GetFeatureList function, and + - that are shown in "xmlwf -v" output. + - Two new environment variable switches .. + - EXPAT_ACCOUNTING_DEBUG=(0|1|2|3) and + - EXPAT_ENTITY_DEBUG=(0|1) + .. for runtime debugging of accounting and entity processing. + Specific behavior of these values may change in the future. + - Two new command line arguments "-a FACTOR" and "-b BYTES" + for xmlwf to further tighten billion laughs protection + parameters when desired. + If you ever need to increase the defaults for non-attack XML + payload, please file a bug report with libexpat. + + Bug fixes: + #332 #470 For (non-default) compilation with -DEXPAT_MIN_SIZE=ON (CMake) + or CPPFLAGS=-DXML_MIN_SIZE (GNU Autotools): Fix segfault + for UTF-16 payloads containing CDATA sections. + #485 #486 Autotools: Fix generated CMake files for non-64bit and + non-Linux platforms (e.g. macOS and MinGW in particular) + that were introduced with release 2.3.0 + + Other changes: + #468 #469 xmlwf: Improve help output and the xmlwf man page + #463 xmlwf: Improve maintainability through some refactoring + #477 xmlwf: Fix man page DocBook validity + #456 Autotools: Sync CMake templates with CMake 3.18 + #458 #459 CMake: Support absolute paths for both CMAKE_INSTALL_LIBDIR + and CMAKE_INSTALL_INCLUDEDIR + #471 #481 CMake: Add support for standard variable BUILD_SHARED_LIBS + #457 Unexpose symbol _INTERNAL_trim_to_complete_utf8_characters + #467 Resolve macro HAVE_EXPAT_CONFIG_H + #472 Delete unused legacy helper file "conftools/PrintPath" + #473 #483 Improve attribution + #464 #465 #477 doc/reference.html: Fix XHTML validity + #475 #478 doc/reference.html: Replace the 90s look by OK.css + #479 Version info bumped from 8:0:7 to 9:0:8 + due to addition of new symbols and error codes; + see https://verbump.de/ for what these numbers do + + Infrastructure: + #456 CI: Enable periodic runs + #457 CI: Start covering the list of exported symbols + #474 CI: Isolate coverage task + #476 #482 CI: Adapt to breaking changes in image "ubuntu-18.04" + #477 CI: Cover well-formedness and DocBook/XHTML validity + of doc/reference.html and doc/xmlwf.xml + + Special thanks to: + Dimitry Andric + Eero Helenius + Nick Wellnhofer + Rhodri James + Tomas Korbar + Yury Gribov + and + Clang LeakSan + JetBrains + OSS-Fuzz + +Release 2.3.0 Thu March 25 2021 + Bug fixes: + #438 When calling XML_ParseBuffer without a prior successful call to + XML_GetBuffer as a user, no longer trigger undefined behavior + (by adding an integer to a NULL pointer) but rather return + XML_STATUS_ERROR and set the error code to (new) code + XML_ERROR_NO_BUFFER. Found by UBSan (UndefinedBehaviorSanitizer) + of Clang 11 (but not Clang 9). + #444 xmlwf: Exit status 2 was used for both: + - malformed input files (documented) and + - invalid command-line arguments (undocumented). + The case of invalid command-line arguments now + has its own exit status 4, resolving the ambiguity. + + Other changes: + #439 xmlwf: Add argument -k to allow continuing after + non-fatal errors + #439 xmlwf: Add section about exit status to the -h help output + #422 #426 #447 Windows: Drop support for Visual Studio <=14.0/2015 + #434 Windows: CMake: Detect unsupported Visual Studio at + configure time (rather than at compile time) + #382 #428 testrunner: Make verbose mode (argument "-v") report + about passed tests, and make default mode report about + failures, as well. + #442 CMake: Call "enable_language(CXX)" prior to tinkering + with CMAKE_CXX_* variables + #448 Document use of libexpat from a CMake-based project + #451 Autotools: Install CMake files as generated by CMake 3.19.6 + so that users with "find_package(expat [..] CONFIG [..])" + are served on distributions that are *not* using the CMake + build system inside for libexpat packaging + #436 #437 Autotools: Drop obsolescent macro AC_HEADER_STDC + #450 #452 Autotools: Resolve use of obsolete macro AC_CONFIG_HEADER + #441 Address compiler warnings + #443 Version info bumped from 7:12:6 to 8:0:7 + due to addition of error code XML_ERROR_NO_BUFFER + (see https://verbump.de/ for what these numbers do) + + Infrastructure: + #435 #446 Replace Travis CI by GitHub Actions + + Special thanks to: + Alexander Richardson + Oleksandr Popovych + Thomas Beutlich + Tim Bray + and + Clang LeakSan, Clang 11 UBSan and the Clang team Release 2.2.10 Sat October 3 2020 Bug fixes: @@ -46,7 +782,7 @@ Release 2.2.10 Sat October 3 2020 #354 #355 .. #356 #412 Address compiler warnings #368 #369 Address pngcheck warnings with doc/*.png images - Version info bumped from 7:11:6 to 7:12:6 + #425 Version info bumped from 7:11:6 to 7:12:6 Special thanks to: asavah diff --git a/3rdparty/expat/ConfigureChecks.cmake b/3rdparty/expat/ConfigureChecks.cmake index d85e48c972dbe..c06b2f27857ab 100644 --- a/3rdparty/expat/ConfigureChecks.cmake +++ b/3rdparty/expat/ConfigureChecks.cmake @@ -2,6 +2,7 @@ include(CheckCCompilerFlag) include(CheckCSourceCompiles) include(CheckIncludeFile) include(CheckIncludeFiles) +include(CheckLibraryExists) include(CheckSymbolExists) include(TestBigEndian) @@ -45,18 +46,25 @@ else(WORDS_BIGENDIAN) endif(WORDS_BIGENDIAN) if(HAVE_SYS_TYPES_H) - check_symbol_exists("off_t" "sys/types.h" OFF_T) - check_symbol_exists("size_t" "sys/types.h" SIZE_T) -else(HAVE_SYS_TYPES_H) - set(OFF_T "long") - set(SIZE_T "unsigned") -endif(HAVE_SYS_TYPES_H) + check_c_source_compiles(" + #include + int main(void) { + const off_t offset = -123; + return 0; + }" + HAVE_OFF_T) +endif() + +if(NOT HAVE_OFF_T) + set(off_t "long") +endif() check_c_source_compiles(" + #define _GNU_SOURCE #include /* for NULL */ #include /* for syscall */ #include /* for SYS_getrandom */ - int main() { + int main(void) { syscall(SYS_getrandom, NULL, 0, 0); return 0; }" @@ -64,3 +72,5 @@ check_c_source_compiles(" check_c_compiler_flag("-fno-strict-aliasing" FLAG_NO_STRICT_ALIASING) check_c_compiler_flag("-fvisibility=hidden" FLAG_VISIBILITY) + +check_library_exists(m cos "" _EXPAT_LIBM_FOUND) diff --git a/3rdparty/expat/Makefile.am b/3rdparty/expat/Makefile.am index 5e1d37dd1a830..3a7f0a0e9503e 100644 --- a/3rdparty/expat/Makefile.am +++ b/3rdparty/expat/Makefile.am @@ -6,7 +6,12 @@ # \___/_/\_\ .__/ \__,_|\__| # |_| XML parser # -# Copyright (c) 2017 Expat development team +# Copyright (c) 2017-2023 Sebastian Pipping +# Copyright (c) 2018 KangLin +# Copyright (c) 2022 Johnny Jazeix +# Copyright (c) 2023 Sony Corporation / Snild Dolkow +# Copyright (c) 2024 Alexander Bluhm +# Copyright (c) 2024 Dag-Erling Smrgrav # Licensed under the MIT license: # # Permission is hereby granted, free of charge, to any person obtaining @@ -53,20 +58,36 @@ pkgconfig_DATA = expat.pc pkgconfigdir = $(libdir)/pkgconfig +dist_cmake_DATA = \ + cmake/autotools/expat.cmake + +nodist_cmake_DATA = \ + cmake/autotools/expat-config-version.cmake \ + cmake/autotools/expat-noconfig.cmake \ + cmake/expat-config.cmake + +cmakedir = $(libdir)/cmake/expat-@PACKAGE_VERSION@ + + _EXTRA_DIST_CMAKE = \ - cmake/expat-config.cmake.in \ + cmake/autotools/expat-noconfig__linux.cmake.in \ + cmake/autotools/expat-noconfig__macos.cmake.in \ + cmake/autotools/expat-noconfig__windows.cmake.in \ + cmake/autotools/expat-package-init.cmake \ cmake/mingw-toolchain.cmake \ \ CMakeLists.txt \ CMake.README \ ConfigureChecks.cmake \ + expat.pc.cmake \ expat_config.h.cmake _EXTRA_DIST_WINDOWS = \ win32/build_expat_iss.bat \ win32/expat.iss \ win32/MANIFEST.txt \ - win32/README.txt + win32/README.txt \ + win32/version.rc.cmake EXTRA_DIST = \ $(_EXTRA_DIST_CMAKE) \ @@ -74,11 +95,14 @@ EXTRA_DIST = \ \ conftools/expat.m4 \ conftools/get-version.sh \ - conftools/PrintPath \ + \ + fuzz/xml_parsebuffer_fuzzer.c \ + fuzz/xml_parse_fuzzer.c \ \ xmlwf/xmlwf_helpgen.py \ xmlwf/xmlwf_helpgen.sh \ \ + buildconf.sh \ Changes \ README.md \ \ @@ -92,10 +116,10 @@ buildlib: @echo 'ERROR: is no longer supported. INSTEAD please:' >&2 @echo 'ERROR:' >&2 @echo 'ERROR: * Mass-patch Makefile.am, e.g.' >&2 - @echo 'ERROR: # find -name Makefile.am -exec sed \' >&2 + @echo 'ERROR: # find . -name Makefile.am -exec sed \' >&2 @echo 'ERROR: -e "s,libexpat\.la,libexpatw.la," \' >&2 @echo 'ERROR: -e "s,libexpat_la,libexpatw_la," \' >&2 - @echo 'ERROR: -i {} +' >&2 + @echo 'ERROR: -i.bak {} +' >&2 @echo 'ERROR:' >&2 @echo 'ERROR: * Run automake to re-generate Makefile.in files' >&2 @echo 'ERROR:' >&2 @@ -110,6 +134,11 @@ buildlib: run-benchmark: $(MAKE) -C tests/benchmark ./run.sh tests/benchmark/benchmark@EXEEXT@ -n $(top_srcdir)/../testdata/largefiles/recset.xml 65535 3 + ./run.sh tests/benchmark/benchmark@EXEEXT@ -n $(top_srcdir)/../testdata/largefiles/aaaaaa_attr.xml 4096 3 + ./run.sh tests/benchmark/benchmark@EXEEXT@ -n $(top_srcdir)/../testdata/largefiles/aaaaaa_cdata.xml 4096 3 + ./run.sh tests/benchmark/benchmark@EXEEXT@ -n $(top_srcdir)/../testdata/largefiles/aaaaaa_comment.xml 4096 3 + ./run.sh tests/benchmark/benchmark@EXEEXT@ -n $(top_srcdir)/../testdata/largefiles/aaaaaa_tag.xml 4096 3 + ./run.sh tests/benchmark/benchmark@EXEEXT@ -n $(top_srcdir)/../testdata/largefiles/aaaaaa_text.xml 4096 3 .PHONY: download-xmlts-zip download-xmlts-zip: diff --git a/3rdparty/expat/Makefile.in b/3rdparty/expat/Makefile.in index ab846398cb718..2c7025471912c 100644 --- a/3rdparty/expat/Makefile.in +++ b/3rdparty/expat/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.16.2 from Makefile.am. +# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2020 Free Software Foundation, Inc. +# Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -22,7 +22,12 @@ # \___/_/\_\ .__/ \__,_|\__| # |_| XML parser # -# Copyright (c) 2017 Expat development team +# Copyright (c) 2017-2023 Sebastian Pipping +# Copyright (c) 2018 KangLin +# Copyright (c) 2022 Johnny Jazeix +# Copyright (c) 2023 Sony Corporation / Snild Dolkow +# Copyright (c) 2024 Alexander Bluhm +# Copyright (c) 2024 Dag-Erling Smrgrav # Licensed under the MIT license: # # Permission is hereby granted, free of charge, to any person obtaining @@ -134,16 +139,20 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/conftools/ax-append-compile-flags.m4 \ $(top_srcdir)/conftools/ax-append-link-flags.m4 \ $(top_srcdir)/conftools/expatcfg-compiler-supports-visibility.m4 \ + $(top_srcdir)/conftools/ax-cxx-compile-stdcxx.m4 \ + $(top_srcdir)/conftools/ax-cxx-compile-stdcxx-11.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \ - $(am__configure_deps) $(am__DIST_COMMON) + $(am__configure_deps) $(dist_cmake_DATA) $(am__DIST_COMMON) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = expat_config.h -CONFIG_CLEAN_FILES = expat.pc run.sh +CONFIG_CLEAN_FILES = expat.pc cmake/expat-config.cmake \ + cmake/autotools/expat-config-version.cmake \ + cmake/autotools/expat-noconfig.cmake run.sh CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) @@ -199,8 +208,9 @@ am__uninstall_files_from_dir = { \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } -am__installdirs = "$(DESTDIR)$(pkgconfigdir)" -DATA = $(pkgconfig_DATA) +am__installdirs = "$(DESTDIR)$(cmakedir)" "$(DESTDIR)$(cmakedir)" \ + "$(DESTDIR)$(pkgconfigdir)" +DATA = $(dist_cmake_DATA) $(nodist_cmake_DATA) $(pkgconfig_DATA) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ @@ -227,18 +237,17 @@ am__define_uniq_tagged_files = \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` -ETAGS = etags -CTAGS = ctags -CSCOPE = cscope DIST_SUBDIRS = lib examples tests xmlwf doc am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/expat.pc.in \ $(srcdir)/expat_config.h.in $(srcdir)/run.sh.in \ + $(top_srcdir)/cmake/autotools/expat-config-version.cmake.in \ + $(top_srcdir)/cmake/expat-config.cmake.in \ $(top_srcdir)/conftools/ar-lib $(top_srcdir)/conftools/compile \ $(top_srcdir)/conftools/config.guess \ $(top_srcdir)/conftools/config.sub \ $(top_srcdir)/conftools/install-sh \ $(top_srcdir)/conftools/ltmain.sh \ - $(top_srcdir)/conftools/missing AUTHORS COPYING \ + $(top_srcdir)/conftools/missing AUTHORS COPYING README.md \ conftools/ar-lib conftools/compile conftools/config.guess \ conftools/config.sub conftools/depcomp conftools/install-sh \ conftools/ltmain.sh conftools/missing @@ -281,6 +290,8 @@ DIST_ARCHIVES = $(distdir).tar.gz $(distdir).tar.bz2 $(distdir).tar.lz \ $(distdir).tar.xz GZIP_ENV = --best DIST_TARGETS = dist-lzip dist-xz dist-bzip2 dist-gzip +# Exists only to be overridden by the user if desired. +AM_DISTCHECK_DVI_TARGET = dvi distuninstallcheck_listfiles = find . -type f -print am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' @@ -301,8 +312,10 @@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ -CPP = @CPP@ +CMAKE_SHARED_LIBRARY_PREFIX = @CMAKE_SHARED_LIBRARY_PREFIX@ CPPFLAGS = @CPPFLAGS@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ @@ -318,10 +331,20 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ +ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ +EXPAT_ATTR_INFO = @EXPAT_ATTR_INFO@ +EXPAT_CHAR_TYPE = @EXPAT_CHAR_TYPE@ +EXPAT_CONTEXT_BYTES = @EXPAT_CONTEXT_BYTES@ +EXPAT_DTD = @EXPAT_DTD@ +EXPAT_LARGE_SIZE = @EXPAT_LARGE_SIZE@ +EXPAT_MIN_SIZE = @EXPAT_MIN_SIZE@ +EXPAT_NS = @EXPAT_NS@ FGREP = @FGREP@ +FILECMD = @FILECMD@ FILEMAP = @FILEMAP@ GREP = @GREP@ +HAVE_CXX11 = @HAVE_CXX11@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -331,6 +354,8 @@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBAGE = @LIBAGE@ LIBCURRENT = @LIBCURRENT@ +LIBDIR_BASENAME = @LIBDIR_BASENAME@ +LIBM = @LIBM@ LIBOBJS = @LIBOBJS@ LIBREVISION = @LIBREVISION@ LIBS = @LIBS@ @@ -339,6 +364,7 @@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ +MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ @@ -360,9 +386,12 @@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ +SIZEOF_VOID_P = @SIZEOF_VOID_P@ +SO_MAJOR = @SO_MAJOR@ +SO_MINOR = @SO_MINOR@ +SO_PATCH = @SO_PATCH@ STRIP = @STRIP@ VERSION = @VERSION@ -_EXPAT_OUTPUT_NAME = @_EXPAT_OUTPUT_NAME@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ @@ -429,20 +458,34 @@ LIBTOOLFLAGS = --verbose SUBDIRS = lib $(am__append_1) $(am__append_2) $(am__append_3) pkgconfig_DATA = expat.pc pkgconfigdir = $(libdir)/pkgconfig +dist_cmake_DATA = \ + cmake/autotools/expat.cmake + +nodist_cmake_DATA = \ + cmake/autotools/expat-config-version.cmake \ + cmake/autotools/expat-noconfig.cmake \ + cmake/expat-config.cmake + +cmakedir = $(libdir)/cmake/expat-@PACKAGE_VERSION@ _EXTRA_DIST_CMAKE = \ - cmake/expat-config.cmake.in \ + cmake/autotools/expat-noconfig__linux.cmake.in \ + cmake/autotools/expat-noconfig__macos.cmake.in \ + cmake/autotools/expat-noconfig__windows.cmake.in \ + cmake/autotools/expat-package-init.cmake \ cmake/mingw-toolchain.cmake \ \ CMakeLists.txt \ CMake.README \ ConfigureChecks.cmake \ + expat.pc.cmake \ expat_config.h.cmake _EXTRA_DIST_WINDOWS = \ win32/build_expat_iss.bat \ win32/expat.iss \ win32/MANIFEST.txt \ - win32/README.txt + win32/README.txt \ + win32/version.rc.cmake EXTRA_DIST = \ $(_EXTRA_DIST_CMAKE) \ @@ -450,11 +493,14 @@ EXTRA_DIST = \ \ conftools/expat.m4 \ conftools/get-version.sh \ - conftools/PrintPath \ + \ + fuzz/xml_parsebuffer_fuzzer.c \ + fuzz/xml_parse_fuzzer.c \ \ xmlwf/xmlwf_helpgen.py \ xmlwf/xmlwf_helpgen.sh \ \ + buildconf.sh \ Changes \ README.md \ \ @@ -467,7 +513,7 @@ all: expat_config.h .SUFFIXES: am--refresh: Makefile @: -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -493,9 +539,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck -$(top_srcdir)/configure: $(am__configure_deps) +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) -$(ACLOCAL_M4): $(am__aclocal_m4_deps) +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): @@ -506,7 +552,7 @@ expat_config.h: stamp-h1 stamp-h1: $(srcdir)/expat_config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status expat_config.h -$(srcdir)/expat_config.h.in: $(am__configure_deps) +$(srcdir)/expat_config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f stamp-h1 touch $@ @@ -515,6 +561,12 @@ distclean-hdr: -rm -f expat_config.h stamp-h1 expat.pc: $(top_builddir)/config.status $(srcdir)/expat.pc.in cd $(top_builddir) && $(SHELL) ./config.status $@ +cmake/expat-config.cmake: $(top_builddir)/config.status $(top_srcdir)/cmake/expat-config.cmake.in + cd $(top_builddir) && $(SHELL) ./config.status $@ +cmake/autotools/expat-config-version.cmake: $(top_builddir)/config.status $(top_srcdir)/cmake/autotools/expat-config-version.cmake.in + cd $(top_builddir) && $(SHELL) ./config.status $@ +cmake/autotools/expat-noconfig.cmake: $(top_builddir)/config.status + cd $(top_builddir) && $(SHELL) ./config.status $@ run.sh: $(top_builddir)/config.status $(srcdir)/run.sh.in cd $(top_builddir) && $(SHELL) ./config.status $@ @@ -526,6 +578,48 @@ clean-libtool: distclean-libtool: -rm -f libtool config.lt +install-dist_cmakeDATA: $(dist_cmake_DATA) + @$(NORMAL_INSTALL) + @list='$(dist_cmake_DATA)'; test -n "$(cmakedir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(cmakedir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(cmakedir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(cmakedir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(cmakedir)" || exit $$?; \ + done + +uninstall-dist_cmakeDATA: + @$(NORMAL_UNINSTALL) + @list='$(dist_cmake_DATA)'; test -n "$(cmakedir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(cmakedir)'; $(am__uninstall_files_from_dir) +install-nodist_cmakeDATA: $(nodist_cmake_DATA) + @$(NORMAL_INSTALL) + @list='$(nodist_cmake_DATA)'; test -n "$(cmakedir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(cmakedir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(cmakedir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(cmakedir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(cmakedir)" || exit $$?; \ + done + +uninstall-nodist_cmakeDATA: + @$(NORMAL_UNINSTALL) + @list='$(nodist_cmake_DATA)'; test -n "$(cmakedir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(cmakedir)'; $(am__uninstall_files_from_dir) install-pkgconfigDATA: $(pkgconfig_DATA) @$(NORMAL_INSTALL) @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ @@ -653,7 +747,6 @@ cscopelist-am: $(am__tagged_files) distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -rm -f cscope.out cscope.in.out cscope.po.out cscope.files - distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am @@ -797,7 +890,7 @@ distcheck: dist $(DISTCHECK_CONFIGURE_FLAGS) \ --srcdir=../.. --prefix="$$dc_install_base" \ && $(MAKE) $(AM_MAKEFLAGS) \ - && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) $(AM_DISTCHECK_DVI_TARGET) \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ @@ -853,7 +946,7 @@ check: check-recursive all-am: Makefile $(DATA) expat_config.h installdirs: installdirs-recursive installdirs-am: - for dir in "$(DESTDIR)$(pkgconfigdir)"; do \ + for dir in "$(DESTDIR)$(cmakedir)" "$(DESTDIR)$(cmakedir)" "$(DESTDIR)$(pkgconfigdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive @@ -908,7 +1001,8 @@ info: info-recursive info-am: -install-data-am: install-pkgconfigDATA +install-data-am: install-dist_cmakeDATA install-nodist_cmakeDATA \ + install-pkgconfigDATA install-dvi: install-dvi-recursive @@ -954,7 +1048,8 @@ ps: ps-recursive ps-am: -uninstall-am: uninstall-pkgconfigDATA +uninstall-am: uninstall-dist_cmakeDATA uninstall-nodist_cmakeDATA \ + uninstall-pkgconfigDATA .MAKE: $(am__recursive_targets) all install-am install-strip @@ -966,14 +1061,16 @@ uninstall-am: uninstall-pkgconfigDATA distclean-generic distclean-hdr distclean-libtool \ distclean-tags distcleancheck distdir distuninstallcheck dvi \ dvi-am html html-am info info-am install install-am \ - install-data install-data-am install-dvi install-dvi-am \ - install-exec install-exec-am install-html install-html-am \ - install-info install-info-am install-man install-pdf \ + install-data install-data-am install-dist_cmakeDATA \ + install-dvi install-dvi-am install-exec install-exec-am \ + install-html install-html-am install-info install-info-am \ + install-man install-nodist_cmakeDATA install-pdf \ install-pdf-am install-pkgconfigDATA install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags tags-am uninstall uninstall-am \ + uninstall-dist_cmakeDATA uninstall-nodist_cmakeDATA \ uninstall-pkgconfigDATA .PRECIOUS: Makefile @@ -985,10 +1082,10 @@ buildlib: @echo 'ERROR: is no longer supported. INSTEAD please:' >&2 @echo 'ERROR:' >&2 @echo 'ERROR: * Mass-patch Makefile.am, e.g.' >&2 - @echo 'ERROR: # find -name Makefile.am -exec sed \' >&2 + @echo 'ERROR: # find . -name Makefile.am -exec sed \' >&2 @echo 'ERROR: -e "s,libexpat\.la,libexpatw.la," \' >&2 @echo 'ERROR: -e "s,libexpat_la,libexpatw_la," \' >&2 - @echo 'ERROR: -i {} +' >&2 + @echo 'ERROR: -i.bak {} +' >&2 @echo 'ERROR:' >&2 @echo 'ERROR: * Run automake to re-generate Makefile.in files' >&2 @echo 'ERROR:' >&2 @@ -1002,6 +1099,11 @@ buildlib: run-benchmark: $(MAKE) -C tests/benchmark ./run.sh tests/benchmark/benchmark@EXEEXT@ -n $(top_srcdir)/../testdata/largefiles/recset.xml 65535 3 + ./run.sh tests/benchmark/benchmark@EXEEXT@ -n $(top_srcdir)/../testdata/largefiles/aaaaaa_attr.xml 4096 3 + ./run.sh tests/benchmark/benchmark@EXEEXT@ -n $(top_srcdir)/../testdata/largefiles/aaaaaa_cdata.xml 4096 3 + ./run.sh tests/benchmark/benchmark@EXEEXT@ -n $(top_srcdir)/../testdata/largefiles/aaaaaa_comment.xml 4096 3 + ./run.sh tests/benchmark/benchmark@EXEEXT@ -n $(top_srcdir)/../testdata/largefiles/aaaaaa_tag.xml 4096 3 + ./run.sh tests/benchmark/benchmark@EXEEXT@ -n $(top_srcdir)/../testdata/largefiles/aaaaaa_text.xml 4096 3 .PHONY: download-xmlts-zip download-xmlts-zip: diff --git a/3rdparty/expat/README.md b/3rdparty/expat/README.md index 428a11ab2450e..2a90b3761374c 100644 --- a/3rdparty/expat/README.md +++ b/3rdparty/expat/README.md @@ -1,12 +1,21 @@ -[![Travis CI Build Status](https://travis-ci.org/libexpat/libexpat.svg?branch=master)](https://travis-ci.org/libexpat/libexpat) +[![Run Linux CI tasks](https://github.com/libexpat/libexpat/actions/workflows/linux.yml/badge.svg)](https://github.com/libexpat/libexpat/actions/workflows/linux.yml) [![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/github/libexpat/libexpat?svg=true)](https://ci.appveyor.com/project/libexpat/libexpat) [![Packaging status](https://repology.org/badge/tiny-repos/expat.svg)](https://repology.org/metapackage/expat/versions) +[![Downloads SourceForge](https://img.shields.io/sourceforge/dt/expat?label=Downloads%20SourceForge)](https://sourceforge.net/projects/expat/files/) +[![Downloads GitHub](https://img.shields.io/github/downloads/libexpat/libexpat/total?label=Downloads%20GitHub)](https://github.com/libexpat/libexpat/releases) +> [!CAUTION] +> +> Expat is **understaffed** and without funding. +> There is a [call for help with details](https://github.com/libexpat/libexpat/blob/master/expat/Changes) +> at the top of the `Changes` file. -# Expat, Release 2.2.10 -This is Expat, a C library for parsing XML, started by -[James Clark](https://en.wikipedia.org/wiki/James_Clark_(programmer)) in 1997. +# Expat, Release 2.6.4 + +This is Expat, a C99 library for parsing +[XML 1.0 Fourth Edition](https://www.w3.org/TR/2006/REC-xml-20060816/), started by +[James Clark](https://en.wikipedia.org/wiki/James_Clark_%28programmer%29) in 1997. Expat is a stream-oriented XML parser. This means that you register handlers with the parser before starting the parse. These handlers are called when the parser discovers the associated structures in the @@ -14,13 +23,14 @@ document being parsed. A start tag is an example of the kind of structures for which you may register handlers. Expat supports the following compilers: + - GNU GCC >=4.5 - LLVM Clang >=3.5 -- Microsoft Visual Studio >=9.0/2008 +- Microsoft Visual Studio >=16.0/2019 (rolling `${today} minus 5 years`) Windows users can use the -[`expat_win32` package](https://sourceforge.net/projects/expat/files/expat_win32/), -which includes both precompiled libraries and executables, and source code for +[`expat-win32bin-*.*.*.{exe,zip}` download](https://github.com/libexpat/libexpat/releases), +which includes both pre-compiled libraries and executables, and source code for developers. Expat is [free software](https://www.gnu.org/philosophy/free-sw.en.html). @@ -30,6 +40,106 @@ contained in the file distributed with this package. This license is the same as the MIT/X Consortium license. + +## Using libexpat in your CMake-Based Project + +There are three documented ways of using libexpat with CMake: + +### a) `find_package` with Module Mode + +This approach leverages CMake's own [module `FindEXPAT`](https://cmake.org/cmake/help/latest/module/FindEXPAT.html). + +Notice the *uppercase* `EXPAT` in the following example: + +```cmake +cmake_minimum_required(VERSION 3.0) # or 3.10, see below + +project(hello VERSION 1.0.0) + +find_package(EXPAT 2.2.8 MODULE REQUIRED) + +add_executable(hello + hello.c +) + +# a) for CMake >=3.10 (see CMake's FindEXPAT docs) +target_link_libraries(hello PUBLIC EXPAT::EXPAT) + +# b) for CMake >=3.0 +target_include_directories(hello PRIVATE ${EXPAT_INCLUDE_DIRS}) +target_link_libraries(hello PUBLIC ${EXPAT_LIBRARIES}) +``` + +### b) `find_package` with Config Mode + +This approach requires files from + +- libexpat >=2.2.8 where packaging uses the CMake build system +or +- libexpat >=2.3.0 where packaging uses the GNU Autotools build system + on Linux +or +- libexpat >=2.4.0 where packaging uses the GNU Autotools build system + on macOS or MinGW. + +Notice the *lowercase* `expat` in the following example: + +```cmake +cmake_minimum_required(VERSION 3.0) + +project(hello VERSION 1.0.0) + +find_package(expat 2.2.8 CONFIG REQUIRED char dtd ns) + +add_executable(hello + hello.c +) + +target_link_libraries(hello PUBLIC expat::expat) +``` + +### c) The `FetchContent` module + +This approach as demonstrated below requires CMake >=3.18 for both the +[`FetchContent` module](https://cmake.org/cmake/help/latest/module/FetchContent.html) +and its support for the `SOURCE_SUBDIR` option to be available. + +Please note that: +- Use of the `FetchContent` module with *non-release* SHA1s or `master` + of libexpat is neither advised nor considered officially supported. +- Pinning to a specific commit is great for robust CI. +- Pinning to a specific commit needs updating every time there is a new + release of libexpat either manually or through automation , + to not miss out on libexpat security updates. + +For an example that pulls in libexpat via Git: + +```cmake +cmake_minimum_required(VERSION 3.18) + +include(FetchContent) + +project(hello VERSION 1.0.0) + +FetchContent_Declare( + expat + GIT_REPOSITORY https://github.com/libexpat/libexpat/ + GIT_TAG 000000000_GIT_COMMIT_SHA1_HERE_000000000 # i.e. Git tag R_0_Y_Z + SOURCE_SUBDIR expat/ +) + +FetchContent_MakeAvailable(expat) + +add_executable(hello + hello.c +) + +target_link_libraries(hello PUBLIC expat) +``` + + +## Building from a Git Clone + If you are building Expat from a check-out from the [Git repository](https://github.com/libexpat/libexpat/), you need to run a script that generates the configure script using the @@ -43,6 +153,11 @@ autoconf 2.58 or newer. Run the script like this: Once this has been done, follow the same instructions as for building from a source distribution. + +## Building from a Source Distribution + +### a) Building with the configure script (i.e. GNU Autotools) + To build Expat from a source distribution, you first run the configuration shell script in the top level distribution directory: @@ -88,10 +203,10 @@ support this mode of compilation (yet): 1. Mass-patch `Makefile.am` files to use `libexpatw.la` for a library name:
- `find -name Makefile.am -exec sed + `find . -name Makefile.am -exec sed -e 's,libexpat\.la,libexpatw.la,' -e 's,libexpat_la,libexpatw_la,' - -i {} +` + -i.bak {} +` 1. Run `automake` to re-write `Makefile.in` files:
`automake` @@ -132,8 +247,14 @@ A reference manual is available in the file `doc/reference.html` in this distribution. -The CMake build system is still *experimental* and will replace the primary +### b) Building with CMake + +The CMake build system is still *experimental* and may replace the primary build system based on GNU Autotools at some point when it is ready. + + +#### Available Options + For an idea of the available (non-advanced) options for building with CMake: ```console @@ -147,37 +268,37 @@ CMAKE_INSTALL_PREFIX:PATH=/usr/local // Path to a program. DOCBOOK_TO_MAN:FILEPATH=/usr/bin/docbook2x-man -// build man page for xmlwf +// Build man page for xmlwf EXPAT_BUILD_DOCS:BOOL=ON -// build the examples for expat library +// Build the examples for expat library EXPAT_BUILD_EXAMPLES:BOOL=ON -// build fuzzers for the expat library +// Build fuzzers for the expat library EXPAT_BUILD_FUZZERS:BOOL=OFF -// build pkg-config file +// Build pkg-config file EXPAT_BUILD_PKGCONFIG:BOOL=ON -// build the tests for expat library +// Build the tests for expat library EXPAT_BUILD_TESTS:BOOL=ON -// build the xmlwf tool for expat library +// Build the xmlwf tool for expat library EXPAT_BUILD_TOOLS:BOOL=ON // Character type to use (char|ushort|wchar_t) [default=char] EXPAT_CHAR_TYPE:STRING=char -// install expat files in cmake install target +// Install expat files in cmake install target EXPAT_ENABLE_INSTALL:BOOL=ON // Use /MT flag (static CRT) when compiling in MSVC EXPAT_MSVC_STATIC_CRT:BOOL=OFF -// build fuzzers via ossfuzz for the expat library +// Build fuzzers via ossfuzz for the expat library EXPAT_OSSFUZZ_BUILD:BOOL=OFF -// build a shared expat library +// Build a shared expat library EXPAT_SHARED_LIBS:BOOL=ON // Treat all compiler warnings as errors @@ -186,7 +307,7 @@ EXPAT_WARNINGS_AS_ERRORS:BOOL=OFF // Make use of getrandom function (ON|OFF|AUTO) [default=AUTO] EXPAT_WITH_GETRANDOM:STRING=AUTO -// utilize libbsd (for arc4random_buf) +// Utilize libbsd (for arc4random_buf) EXPAT_WITH_LIBBSD:BOOL=OFF // Make use of syscall SYS_getrandom (ON|OFF|AUTO) [default=AUTO] diff --git a/3rdparty/expat/acinclude.m4 b/3rdparty/expat/acinclude.m4 index 7277ab29bbb9b..498f709bdf952 100644 --- a/3rdparty/expat/acinclude.m4 +++ b/3rdparty/expat/acinclude.m4 @@ -8,5 +8,7 @@ m4_include(conftools/ax-append-flag.m4) m4_include(conftools/ax-append-compile-flags.m4) m4_include(conftools/ax-append-link-flags.m4) m4_include(conftools/expatcfg-compiler-supports-visibility.m4) +m4_include(conftools/ax-cxx-compile-stdcxx.m4) +m4_include(conftools/ax-cxx-compile-stdcxx-11.m4) ### end of file diff --git a/3rdparty/expat/aclocal.m4 b/3rdparty/expat/aclocal.m4 index b8cb1fc8ca05c..8a0016bd4e22d 100644 --- a/3rdparty/expat/aclocal.m4 +++ b/3rdparty/expat/aclocal.m4 @@ -1,6 +1,6 @@ -# generated automatically by aclocal 1.16.2 -*- Autoconf -*- +# generated automatically by aclocal 1.16.5 -*- Autoconf -*- -# Copyright (C) 1996-2020 Free Software Foundation, Inc. +# Copyright (C) 1996-2021 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -14,13 +14,13 @@ m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl -m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, -[m4_warning([this file was generated for autoconf 2.69. +m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.71],, +[m4_warning([this file was generated for autoconf 2.71. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically 'autoreconf'.])]) -# Copyright (C) 2002-2020 Free Software Foundation, Inc. +# Copyright (C) 2002-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -35,7 +35,7 @@ AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.16' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. -m4_if([$1], [1.16.2], [], +m4_if([$1], [1.16.5], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) @@ -51,12 +51,12 @@ m4_define([_AM_AUTOCONF_VERSION], []) # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], -[AM_AUTOMAKE_VERSION([1.16.2])dnl +[AM_AUTOMAKE_VERSION([1.16.5])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) -# Copyright (C) 2011-2020 Free Software Foundation, Inc. +# Copyright (C) 2011-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -118,7 +118,7 @@ AC_SUBST([AR])dnl # AM_AUX_DIR_EXPAND -*- Autoconf -*- -# Copyright (C) 2001-2020 Free Software Foundation, Inc. +# Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -170,7 +170,7 @@ am_aux_dir=`cd "$ac_aux_dir" && pwd` # AM_CONDITIONAL -*- Autoconf -*- -# Copyright (C) 1997-2020 Free Software Foundation, Inc. +# Copyright (C) 1997-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -201,7 +201,7 @@ AC_CONFIG_COMMANDS_PRE( Usually this means the macro was only invoked conditionally.]]) fi])]) -# Copyright (C) 1999-2020 Free Software Foundation, Inc. +# Copyright (C) 1999-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -392,7 +392,7 @@ _AM_SUBST_NOTMAKE([am__nodep])dnl # Generate code to set up dependency tracking. -*- Autoconf -*- -# Copyright (C) 1999-2020 Free Software Foundation, Inc. +# Copyright (C) 1999-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -460,7 +460,7 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], # Do all the work for Automake. -*- Autoconf -*- -# Copyright (C) 1996-2020 Free Software Foundation, Inc. +# Copyright (C) 1996-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -488,6 +488,10 @@ m4_defn([AC_PROG_CC]) # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.65])dnl +m4_ifdef([_$0_ALREADY_INIT], + [m4_fatal([$0 expanded multiple times +]m4_defn([_$0_ALREADY_INIT]))], + [m4_define([_$0_ALREADY_INIT], m4_expansion_stack)])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl @@ -524,7 +528,7 @@ m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if( - m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), + m4_ifset([AC_PACKAGE_NAME], [ok]):m4_ifset([AC_PACKAGE_VERSION], [ok]), [ok:ok],, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl @@ -576,6 +580,20 @@ AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], [m4_define([AC_PROG_OBJCXX], m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl ]) +# Variables for tags utilities; see am/tags.am +if test -z "$CTAGS"; then + CTAGS=ctags +fi +AC_SUBST([CTAGS]) +if test -z "$ETAGS"; then + ETAGS=etags +fi +AC_SUBST([ETAGS]) +if test -z "$CSCOPE"; then + CSCOPE=cscope +fi +AC_SUBST([CSCOPE]) + AC_REQUIRE([AM_SILENT_RULES])dnl dnl The testsuite driver may need to know about EXEEXT, so add the dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This @@ -657,7 +675,7 @@ for _am_header in $config_headers :; do done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) -# Copyright (C) 2001-2020 Free Software Foundation, Inc. +# Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -678,7 +696,7 @@ if test x"${install_sh+set}" != xset; then fi AC_SUBST([install_sh])]) -# Copyright (C) 2003-2020 Free Software Foundation, Inc. +# Copyright (C) 2003-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -697,9 +715,45 @@ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) +# Add --enable-maintainer-mode option to configure. -*- Autoconf -*- +# From Jim Meyering + +# Copyright (C) 1996-2021 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_MAINTAINER_MODE([DEFAULT-MODE]) +# ---------------------------------- +# Control maintainer-specific portions of Makefiles. +# Default is to disable them, unless 'enable' is passed literally. +# For symmetry, 'disable' may be passed as well. Anyway, the user +# can override the default with the --enable/--disable switch. +AC_DEFUN([AM_MAINTAINER_MODE], +[m4_case(m4_default([$1], [disable]), + [enable], [m4_define([am_maintainer_other], [disable])], + [disable], [m4_define([am_maintainer_other], [enable])], + [m4_define([am_maintainer_other], [enable]) + m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])]) +AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) + dnl maintainer-mode's default is 'disable' unless 'enable' is passed + AC_ARG_ENABLE([maintainer-mode], + [AS_HELP_STRING([--]am_maintainer_other[-maintainer-mode], + am_maintainer_other[ make rules and dependencies not useful + (and sometimes confusing) to the casual installer])], + [USE_MAINTAINER_MODE=$enableval], + [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes])) + AC_MSG_RESULT([$USE_MAINTAINER_MODE]) + AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes]) + MAINT=$MAINTAINER_MODE_TRUE + AC_SUBST([MAINT])dnl +] +) + # Check to see how 'make' treats includes. -*- Autoconf -*- -# Copyright (C) 2001-2020 Free Software Foundation, Inc. +# Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -742,7 +796,7 @@ AC_SUBST([am__quote])]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- -# Copyright (C) 1997-2020 Free Software Foundation, Inc. +# Copyright (C) 1997-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -763,12 +817,7 @@ AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl if test x"${MISSING+set}" != xset; then - case $am_aux_dir in - *\ * | *\ *) - MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; - *) - MISSING="\${SHELL} $am_aux_dir/missing" ;; - esac + MISSING="\${SHELL} '$am_aux_dir/missing'" fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then @@ -781,7 +830,7 @@ fi # Helper functions for option handling. -*- Autoconf -*- -# Copyright (C) 2001-2020 Free Software Foundation, Inc. +# Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -810,7 +859,7 @@ AC_DEFUN([_AM_SET_OPTIONS], AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) -# Copyright (C) 1999-2020 Free Software Foundation, Inc. +# Copyright (C) 1999-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -857,7 +906,7 @@ AC_LANG_POP([C])]) # For backward compatibility. AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) -# Copyright (C) 2001-2020 Free Software Foundation, Inc. +# Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -876,7 +925,7 @@ AC_DEFUN([AM_RUN_LOG], # Check to make sure that the build environment is sane. -*- Autoconf -*- -# Copyright (C) 1996-2020 Free Software Foundation, Inc. +# Copyright (C) 1996-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -957,7 +1006,7 @@ AC_CONFIG_COMMANDS_PRE( rm -f conftest.file ]) -# Copyright (C) 2009-2020 Free Software Foundation, Inc. +# Copyright (C) 2009-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1017,7 +1066,7 @@ AC_SUBST([AM_BACKSLASH])dnl _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) -# Copyright (C) 2001-2020 Free Software Foundation, Inc. +# Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1045,7 +1094,7 @@ fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) -# Copyright (C) 2006-2020 Free Software Foundation, Inc. +# Copyright (C) 2006-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1064,7 +1113,7 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- -# Copyright (C) 2004-2020 Free Software Foundation, Inc. +# Copyright (C) 2004-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, diff --git a/3rdparty/expat/buildconf.sh b/3rdparty/expat/buildconf.sh new file mode 100755 index 0000000000000..4e506b30082bf --- /dev/null +++ b/3rdparty/expat/buildconf.sh @@ -0,0 +1,35 @@ +#! /usr/bin/env bash +# __ __ _ +# ___\ \/ /_ __ __ _| |_ +# / _ \\ /| '_ \ / _` | __| +# | __// \| |_) | (_| | |_ +# \___/_/\_\ .__/ \__,_|\__| +# |_| XML parser +# +# Copyright (c) 2017-2022 Sebastian Pipping +# Copyright (c) 2018 Marco Maggi +# Copyright (c) 2024 Dag-Erling Smørgrav +# Licensed under the MIT license: +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to permit +# persons to whom the Software is furnished to do so, subject to the +# following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +# NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +# OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +# USE OR OTHER DEALINGS IN THE SOFTWARE. + +set -e + +exec autoreconf --warnings=all --install --verbose "$@" diff --git a/3rdparty/expat/cmake/autotools/expat-config-version.cmake.in b/3rdparty/expat/cmake/autotools/expat-config-version.cmake.in new file mode 100644 index 0000000000000..17ab1924c35a5 --- /dev/null +++ b/3rdparty/expat/cmake/autotools/expat-config-version.cmake.in @@ -0,0 +1,65 @@ +# This is a basic version file for the Config-mode of find_package(). +# It is used by write_basic_package_version_file() as input file for configure_file() +# to create a version-file which can be installed along a config.cmake file. +# +# The created file sets PACKAGE_VERSION_EXACT if the current version string and +# the requested version string are exactly the same and it sets +# PACKAGE_VERSION_COMPATIBLE if the current version is >= requested version, +# but only if the requested major version is the same as the current one. +# The variable CVF_VERSION must be set before calling configure_file(). + + +set(PACKAGE_VERSION "@PACKAGE_VERSION@") + +if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION) + set(PACKAGE_VERSION_COMPATIBLE FALSE) +else() + + if("@PACKAGE_VERSION@" MATCHES "^([0-9]+)\\.") + set(CVF_VERSION_MAJOR "${CMAKE_MATCH_1}") + if(NOT CVF_VERSION_MAJOR VERSION_EQUAL 0) + string(REGEX REPLACE "^0+" "" CVF_VERSION_MAJOR "${CVF_VERSION_MAJOR}") + endif() + else() + set(CVF_VERSION_MAJOR "@PACKAGE_VERSION@") + endif() + + if(PACKAGE_FIND_VERSION_RANGE) + # both endpoints of the range must have the expected major version + math (EXPR CVF_VERSION_MAJOR_NEXT "${CVF_VERSION_MAJOR} + 1") + if (NOT PACKAGE_FIND_VERSION_MIN_MAJOR STREQUAL CVF_VERSION_MAJOR + OR ((PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "INCLUDE" AND NOT PACKAGE_FIND_VERSION_MAX_MAJOR STREQUAL CVF_VERSION_MAJOR) + OR (PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "EXCLUDE" AND NOT PACKAGE_FIND_VERSION_MAX VERSION_LESS_EQUAL CVF_VERSION_MAJOR_NEXT))) + set(PACKAGE_VERSION_COMPATIBLE FALSE) + elseif(PACKAGE_FIND_VERSION_MIN_MAJOR STREQUAL CVF_VERSION_MAJOR + AND ((PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "INCLUDE" AND PACKAGE_VERSION VERSION_LESS_EQUAL PACKAGE_FIND_VERSION_MAX) + OR (PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "EXCLUDE" AND PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION_MAX))) + set(PACKAGE_VERSION_COMPATIBLE TRUE) + else() + set(PACKAGE_VERSION_COMPATIBLE FALSE) + endif() + else() + if(PACKAGE_FIND_VERSION_MAJOR STREQUAL CVF_VERSION_MAJOR) + set(PACKAGE_VERSION_COMPATIBLE TRUE) + else() + set(PACKAGE_VERSION_COMPATIBLE FALSE) + endif() + + if(PACKAGE_FIND_VERSION STREQUAL PACKAGE_VERSION) + set(PACKAGE_VERSION_EXACT TRUE) + endif() + endif() +endif() + + +# if the installed or the using project don't have CMAKE_SIZEOF_VOID_P set, ignore it: +if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "" OR "@SIZEOF_VOID_P@" STREQUAL "") + return() +endif() + +# check that the installed version has the same 32/64bit-ness as the one which is currently searching: +if(NOT CMAKE_SIZEOF_VOID_P STREQUAL "@SIZEOF_VOID_P@") + math(EXPR installedBits "@SIZEOF_VOID_P@ * 8") + set(PACKAGE_VERSION "${PACKAGE_VERSION} (${installedBits}bit)") + set(PACKAGE_VERSION_UNSUITABLE TRUE) +endif() diff --git a/3rdparty/expat/cmake/autotools/expat-noconfig__linux.cmake.in b/3rdparty/expat/cmake/autotools/expat-noconfig__linux.cmake.in new file mode 100644 index 0000000000000..d0ad645c03f5d --- /dev/null +++ b/3rdparty/expat/cmake/autotools/expat-noconfig__linux.cmake.in @@ -0,0 +1,19 @@ +#---------------------------------------------------------------- +# Generated CMake target import file for configuration "NoConfig". +#---------------------------------------------------------------- + +# Commands may need to know the format version. +set(CMAKE_IMPORT_FILE_VERSION 1) + +# Import target "expat::expat" for configuration "NoConfig" +set_property(TARGET expat::expat APPEND PROPERTY IMPORTED_CONFIGURATIONS NOCONFIG) +set_target_properties(expat::expat PROPERTIES + IMPORTED_LOCATION_NOCONFIG "${_IMPORT_PREFIX}/@LIBDIR_BASENAME@/libexpat.so.@SO_MAJOR@.@SO_MINOR@.@SO_PATCH@" + IMPORTED_SONAME_NOCONFIG "libexpat.so.@SO_MAJOR@" + ) + +list(APPEND _cmake_import_check_targets expat::expat ) +list(APPEND _cmake_import_check_files_for_expat::expat "${_IMPORT_PREFIX}/@LIBDIR_BASENAME@/libexpat.so.@SO_MAJOR@.@SO_MINOR@.@SO_PATCH@" ) + +# Commands beyond this point should not need to know the version. +set(CMAKE_IMPORT_FILE_VERSION) diff --git a/3rdparty/expat/cmake/autotools/expat-noconfig__macos.cmake.in b/3rdparty/expat/cmake/autotools/expat-noconfig__macos.cmake.in new file mode 100644 index 0000000000000..bb48d9810ee84 --- /dev/null +++ b/3rdparty/expat/cmake/autotools/expat-noconfig__macos.cmake.in @@ -0,0 +1,19 @@ +#---------------------------------------------------------------- +# Generated CMake target import file for configuration "NoConfig". +#---------------------------------------------------------------- + +# Commands may need to know the format version. +set(CMAKE_IMPORT_FILE_VERSION 1) + +# Import target "expat::expat" for configuration "NoConfig" +set_property(TARGET expat::expat APPEND PROPERTY IMPORTED_CONFIGURATIONS NOCONFIG) +set_target_properties(expat::expat PROPERTIES + IMPORTED_LOCATION_NOCONFIG "${_IMPORT_PREFIX}/@LIBDIR_BASENAME@/libexpat.@SO_MAJOR@.@SO_MINOR@.@SO_PATCH@.dylib" + IMPORTED_SONAME_NOCONFIG "@rpath/libexpat.@SO_MAJOR@.dylib" + ) + +list(APPEND _cmake_import_check_targets expat::expat ) +list(APPEND _cmake_import_check_files_for_expat::expat "${_IMPORT_PREFIX}/@LIBDIR_BASENAME@/libexpat.@SO_MAJOR@.@SO_MINOR@.@SO_PATCH@.dylib" ) + +# Commands beyond this point should not need to know the version. +set(CMAKE_IMPORT_FILE_VERSION) diff --git a/3rdparty/expat/cmake/autotools/expat-noconfig__windows.cmake.in b/3rdparty/expat/cmake/autotools/expat-noconfig__windows.cmake.in new file mode 100644 index 0000000000000..2f7454e2ca2e7 --- /dev/null +++ b/3rdparty/expat/cmake/autotools/expat-noconfig__windows.cmake.in @@ -0,0 +1,19 @@ +#---------------------------------------------------------------- +# Generated CMake target import file for configuration "NoConfig". +#---------------------------------------------------------------- + +# Commands may need to know the format version. +set(CMAKE_IMPORT_FILE_VERSION 1) + +# Import target "expat::expat" for configuration "NoConfig" +set_property(TARGET expat::expat APPEND PROPERTY IMPORTED_CONFIGURATIONS NOCONFIG) +set_target_properties(expat::expat PROPERTIES + IMPORTED_IMPLIB_NOCONFIG "${_IMPORT_PREFIX}/@LIBDIR_BASENAME@/libexpat.dll.a" + IMPORTED_LOCATION_NOCONFIG "${_IMPORT_PREFIX}/bin/@CMAKE_SHARED_LIBRARY_PREFIX@expat-@SO_MAJOR@.dll" + ) + +list(APPEND _cmake_import_check_targets expat::expat ) +list(APPEND _cmake_import_check_files_for_expat::expat "${_IMPORT_PREFIX}/@LIBDIR_BASENAME@/libexpat.dll.a" "${_IMPORT_PREFIX}/bin/@CMAKE_SHARED_LIBRARY_PREFIX@expat-@SO_MAJOR@.dll" ) + +# Commands beyond this point should not need to know the version. +set(CMAKE_IMPORT_FILE_VERSION) diff --git a/3rdparty/expat/cmake/autotools/expat-package-init.cmake b/3rdparty/expat/cmake/autotools/expat-package-init.cmake new file mode 100644 index 0000000000000..5cf17705329ca --- /dev/null +++ b/3rdparty/expat/cmake/autotools/expat-package-init.cmake @@ -0,0 +1,25 @@ + +####### Expanded from @PACKAGE_INIT@ by configure_package_config_file() ####### +####### Any changes to this file will be overwritten by the next CMake run #### +####### The input file was expat-config.cmake.in ######## + +get_filename_component(PACKAGE_PREFIX_DIR "${CMAKE_CURRENT_LIST_DIR}/../../../" ABSOLUTE) + +macro(set_and_check _var _file) + set(${_var} "${_file}") + if(NOT EXISTS "${_file}") + message(FATAL_ERROR "File or directory ${_file} referenced by variable ${_var} does not exist !") + endif() +endmacro() + +macro(check_required_components _NAME) + foreach(comp ${${_NAME}_FIND_COMPONENTS}) + if(NOT ${_NAME}_${comp}_FOUND) + if(${_NAME}_FIND_REQUIRED_${comp}) + set(${_NAME}_FOUND FALSE) + endif() + endif() + endforeach() +endmacro() + +#################################################################################### diff --git a/3rdparty/expat/cmake/autotools/expat.cmake b/3rdparty/expat/cmake/autotools/expat.cmake new file mode 100644 index 0000000000000..7850358bb3a17 --- /dev/null +++ b/3rdparty/expat/cmake/autotools/expat.cmake @@ -0,0 +1,107 @@ +# Generated by CMake + +if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" LESS 2.8) + message(FATAL_ERROR "CMake >= 2.8.0 required") +endif() +if(CMAKE_VERSION VERSION_LESS "2.8.12") + message(FATAL_ERROR "CMake >= 2.8.12 required") +endif() +cmake_policy(PUSH) +cmake_policy(VERSION 2.8.12...3.28) +#---------------------------------------------------------------- +# Generated CMake target import file. +#---------------------------------------------------------------- + +# Commands may need to know the format version. +set(CMAKE_IMPORT_FILE_VERSION 1) + +# Protect against multiple inclusion, which would fail when already imported targets are added once more. +set(_cmake_targets_defined "") +set(_cmake_targets_not_defined "") +set(_cmake_expected_targets "") +foreach(_cmake_expected_target IN ITEMS expat::expat) + list(APPEND _cmake_expected_targets "${_cmake_expected_target}") + if(TARGET "${_cmake_expected_target}") + list(APPEND _cmake_targets_defined "${_cmake_expected_target}") + else() + list(APPEND _cmake_targets_not_defined "${_cmake_expected_target}") + endif() +endforeach() +unset(_cmake_expected_target) +if(_cmake_targets_defined STREQUAL _cmake_expected_targets) + unset(_cmake_targets_defined) + unset(_cmake_targets_not_defined) + unset(_cmake_expected_targets) + unset(CMAKE_IMPORT_FILE_VERSION) + cmake_policy(POP) + return() +endif() +if(NOT _cmake_targets_defined STREQUAL "") + string(REPLACE ";" ", " _cmake_targets_defined_text "${_cmake_targets_defined}") + string(REPLACE ";" ", " _cmake_targets_not_defined_text "${_cmake_targets_not_defined}") + message(FATAL_ERROR "Some (but not all) targets in this export set were already defined.\nTargets Defined: ${_cmake_targets_defined_text}\nTargets not yet defined: ${_cmake_targets_not_defined_text}\n") +endif() +unset(_cmake_targets_defined) +unset(_cmake_targets_not_defined) +unset(_cmake_expected_targets) + + +# Compute the installation prefix relative to this file. +get_filename_component(_IMPORT_PREFIX "${CMAKE_CURRENT_LIST_FILE}" PATH) +get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH) +get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH) +get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH) +if(_IMPORT_PREFIX STREQUAL "/") + set(_IMPORT_PREFIX "") +endif() + +# Create imported target expat::expat +add_library(expat::expat SHARED IMPORTED) + +set_target_properties(expat::expat PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include" + INTERFACE_LINK_LIBRARIES "m" +) + +# Load information for each installed configuration. +file(GLOB _cmake_config_files "${CMAKE_CURRENT_LIST_DIR}/expat-*.cmake") +foreach(_cmake_config_file IN LISTS _cmake_config_files) + include("${_cmake_config_file}") +endforeach() +unset(_cmake_config_file) +unset(_cmake_config_files) + +# Cleanup temporary variables. +set(_IMPORT_PREFIX) + +# Loop over all imported files and verify that they actually exist +foreach(_cmake_target IN LISTS _cmake_import_check_targets) + if(CMAKE_VERSION VERSION_LESS "3.28" + OR NOT DEFINED _cmake_import_check_xcframework_for_${_cmake_target} + OR NOT IS_DIRECTORY "${_cmake_import_check_xcframework_for_${_cmake_target}}") + foreach(_cmake_file IN LISTS "_cmake_import_check_files_for_${_cmake_target}") + if(NOT EXISTS "${_cmake_file}") + message(FATAL_ERROR "The imported target \"${_cmake_target}\" references the file + \"${_cmake_file}\" +but this file does not exist. Possible reasons include: +* The file was deleted, renamed, or moved to another location. +* An install or uninstall procedure did not complete successfully. +* The installation package was faulty and contained + \"${CMAKE_CURRENT_LIST_FILE}\" +but not all the files it references. +") + endif() + endforeach() + endif() + unset(_cmake_file) + unset("_cmake_import_check_files_for_${_cmake_target}") +endforeach() +unset(_cmake_target) +unset(_cmake_import_check_targets) + +# This file does not depend on other imported targets which have +# been exported from the same project but in a separate export set. + +# Commands beyond this point should not need to know the version. +set(CMAKE_IMPORT_FILE_VERSION) +cmake_policy(POP) diff --git a/3rdparty/expat/cmake/mingw-toolchain.cmake b/3rdparty/expat/cmake/mingw-toolchain.cmake index 31a238b05ca01..9032d9e552260 100644 --- a/3rdparty/expat/cmake/mingw-toolchain.cmake +++ b/3rdparty/expat/cmake/mingw-toolchain.cmake @@ -31,6 +31,7 @@ set(CMAKE_SYSTEM_NAME Windows) set(CMAKE_C_COMPILER i686-w64-mingw32-gcc) set(CMAKE_CXX_COMPILER i686-w64-mingw32-g++) +set(CMAKE_RC_COMPILER i686-w64-mingw32-windres) set(WIN32 ON) set(MINGW ON) diff --git a/3rdparty/expat/configure b/3rdparty/expat/configure index 947bc0ebcdef8..c2f7bb797ef3f 100755 --- a/3rdparty/expat/configure +++ b/3rdparty/expat/configure @@ -1,11 +1,12 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for expat 2.2.10. +# Generated by GNU Autoconf 2.71 for expat 2.6.4. # -# Report bugs to . +# Report bugs to . # # -# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. +# Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation, +# Inc. # # # This configure script is free software; the Free Software Foundation @@ -16,14 +17,16 @@ # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : +as_nop=: +if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 +then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST -else +else $as_nop case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( @@ -33,46 +36,46 @@ esac fi + +# Reset variables that may have inherited troublesome values from +# the environment. + +# IFS needs to be set, to space, tab, and newline, in precisely that order. +# (If _AS_PATH_WALK were called with IFS unset, it would have the +# side effect of setting IFS to empty, thus disabling word splitting.) +# Quoting is to prevent editors from complaining about space-tab. as_nl=' ' export as_nl -# Printing a long string crashes Solaris 7 /usr/bin/printf. -as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -# Prefer a ksh shell builtin over an external printf program on Solaris, -# but without wasting forks for bash or zsh. -if test -z "$BASH_VERSION$ZSH_VERSION" \ - && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='print -r --' - as_echo_n='print -rn --' -elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='printf %s\n' - as_echo_n='printf %s' -else - if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then - as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' - as_echo_n='/usr/ucb/echo -n' - else - as_echo_body='eval expr "X$1" : "X\\(.*\\)"' - as_echo_n_body='eval - arg=$1; - case $arg in #( - *"$as_nl"*) - expr "X$arg" : "X\\(.*\\)$as_nl"; - arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; - esac; - expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" - ' - export as_echo_n_body - as_echo_n='sh -c $as_echo_n_body as_echo' - fi - export as_echo_body - as_echo='sh -c $as_echo_body as_echo' -fi +IFS=" "" $as_nl" + +PS1='$ ' +PS2='> ' +PS4='+ ' + +# Ensure predictable behavior from utilities with locale-dependent output. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# We cannot yet rely on "unset" to work, but we need these variables +# to be unset--not just set to an empty or harmless value--now, to +# avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct +# also avoids known problems related to "unset" and subshell syntax +# in other old shells (e.g. bash 2.01 and pdksh 5.2.14). +for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH +do eval test \${$as_var+y} \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done + +# Ensure that fds 0, 1, and 2 are open. +if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi +if (exec 3>&2) ; then :; else exec 2>/dev/null; fi # The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then +if ${PATH_SEPARATOR+false} :; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || @@ -81,13 +84,6 @@ if test "${PATH_SEPARATOR+set}" != set; then fi -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) -IFS=" "" $as_nl" - # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( @@ -96,8 +92,12 @@ case $0 in #(( for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + test -r "$as_dir$0" && as_myself=$as_dir$0 && break done IFS=$as_save_IFS @@ -109,30 +109,10 @@ if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then - $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi -# Unset variables that we do not need and which cause bugs (e.g. in -# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" -# suppresses any "Segmentation fault" message there. '((' could -# trigger a bug in pdksh 5.2.14. -for as_var in BASH_ENV ENV MAIL MAILPATH -do eval test x\${$as_var+set} = xset \ - && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : -done -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE - -# CDPATH. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. @@ -154,20 +134,22 @@ esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. -$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 -as_fn_exit 255 +printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then - as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : + as_bourne_compatible="as_nop=: +if test \${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 +then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST -else +else \$as_nop case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( @@ -187,12 +169,15 @@ as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } -if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : +if ( set x; as_fn_ret_success y && test x = \"\$1\" ) +then : -else +else \$as_nop exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 +blah=\$(echo \$(echo blah)) +test x\"\$blah\" = xblah || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO @@ -207,30 +192,38 @@ test -x / || exit 1" test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1 test \$(( 1 + 1 )) = 2 || exit 1" - if (eval "$as_required") 2>/dev/null; then : + if (eval "$as_required") 2>/dev/null +then : as_have_required=yes -else +else $as_nop as_have_required=no fi - if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null +then : -else +else $as_nop as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. - as_shell=$as_dir/$as_base + as_shell=$as_dir$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && - { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : + as_run=a "$as_shell" -c "$as_bourne_compatible""$as_required" 2>/dev/null +then : CONFIG_SHELL=$as_shell as_have_required=yes - if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : + if as_run=a "$as_shell" -c "$as_bourne_compatible""$as_suggested" 2>/dev/null +then : break 2 fi fi @@ -238,14 +231,21 @@ fi esac as_found=false done -$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && - { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : - CONFIG_SHELL=$SHELL as_have_required=yes -fi; } IFS=$as_save_IFS +if $as_found +then : + +else $as_nop + if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + as_run=a "$SHELL" -c "$as_bourne_compatible""$as_required" 2>/dev/null +then : + CONFIG_SHELL=$SHELL as_have_required=yes +fi +fi - if test "x$CONFIG_SHELL" != x; then : + if test "x$CONFIG_SHELL" != x +then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also @@ -263,22 +263,23 @@ esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. -$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi - if test x$as_have_required = xno; then : - $as_echo "$0: This script requires a shell more modern than all" - $as_echo "$0: the shells that I found on your system." - if test x${ZSH_VERSION+set} = xset ; then - $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" - $as_echo "$0: be upgraded to zsh 4.3.4 or later." + if test x$as_have_required = xno +then : + printf "%s\n" "$0: This script requires a shell more modern than all" + printf "%s\n" "$0: the shells that I found on your system." + if test ${ZSH_VERSION+y} ; then + printf "%s\n" "$0: In particular, zsh $ZSH_VERSION has bugs and should" + printf "%s\n" "$0: be upgraded to zsh 4.3.4 or later." else - $as_echo "$0: Please tell bug-autoconf@gnu.org and -$0: expat-bugs@libexpat.org about your system, including -$0: any error possibly output before this message. Then -$0: install a modern shell, or manually run the script -$0: under such a shell if you do have one." + printf "%s\n" "$0: Please tell bug-autoconf@gnu.org and +$0: https://github.com/libexpat/libexpat/issues about your +$0: system, including any error possibly output before this +$0: message. Then install a modern shell, or manually run +$0: the script under such a shell if you do have one." fi exit 1 fi @@ -302,6 +303,7 @@ as_fn_unset () } as_unset=as_fn_unset + # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. @@ -319,6 +321,14 @@ as_fn_exit () as_fn_set_status $1 exit $1 } # as_fn_exit +# as_fn_nop +# --------- +# Do nothing but, unlike ":", preserve the value of $?. +as_fn_nop () +{ + return $? +} +as_nop=as_fn_nop # as_fn_mkdir_p # ------------- @@ -333,7 +343,7 @@ as_fn_mkdir_p () as_dirs= while :; do case $as_dir in #( - *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" @@ -342,7 +352,7 @@ $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_dir" | +printf "%s\n" X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -381,12 +391,13 @@ as_fn_executable_p () # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. -if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null +then : eval 'as_fn_append () { eval $1+=\$2 }' -else +else $as_nop as_fn_append () { eval $1=\$$1\$2 @@ -398,18 +409,27 @@ fi # as_fn_append # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. -if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null +then : eval 'as_fn_arith () { as_val=$(( $* )) }' -else +else $as_nop as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith +# as_fn_nop +# --------- +# Do nothing but, unlike ":", preserve the value of $?. +as_fn_nop () +{ + return $? +} +as_nop=as_fn_nop # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- @@ -421,9 +441,9 @@ as_fn_error () as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi - $as_echo "$as_me: error: $2" >&2 + printf "%s\n" "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error @@ -450,7 +470,7 @@ as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$0" | +printf "%s\n" X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q @@ -494,7 +514,7 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || - { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + { printf "%s\n" "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall @@ -508,6 +528,10 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits exit } + +# Determine whether it's possible to make 'echo' print without a newline. +# These variables are no longer used directly by Autoconf, but are AC_SUBSTed +# for compatibility with existing Makefiles. ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) @@ -521,6 +545,13 @@ case `echo -n x` in #((((( ECHO_N='-n';; esac +# For backward compatibility with old third-party macros, we provide +# the shell variables $as_echo and $as_echo_n. New code should use +# AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. +as_echo='printf %s\n' +as_echo_n='printf %s' + + rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file @@ -590,66 +621,86 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='expat' PACKAGE_TARNAME='expat' -PACKAGE_VERSION='2.2.10' -PACKAGE_STRING='expat 2.2.10' -PACKAGE_BUGREPORT='expat-bugs@libexpat.org' +PACKAGE_VERSION='2.6.4' +PACKAGE_STRING='expat 2.6.4' +PACKAGE_BUGREPORT='https://github.com/libexpat/libexpat/issues' PACKAGE_URL='' ac_unique_file="Makefile.in" # Factoring default headers for most tests. ac_includes_default="\ -#include -#ifdef HAVE_SYS_TYPES_H -# include +#include +#ifdef HAVE_STDIO_H +# include #endif -#ifdef HAVE_SYS_STAT_H -# include -#endif -#ifdef STDC_HEADERS +#ifdef HAVE_STDLIB_H # include -# include -#else -# ifdef HAVE_STDLIB_H -# include -# endif #endif #ifdef HAVE_STRING_H -# if !defined STDC_HEADERS && defined HAVE_MEMORY_H -# include -# endif # include #endif -#ifdef HAVE_STRINGS_H -# include -#endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif +#ifdef HAVE_STRINGS_H +# include +#endif +#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_SYS_STAT_H +# include +#endif #ifdef HAVE_UNISTD_H # include #endif" -ac_header_list= +ac_header_c_list= +ac_func_c_list= ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS -_EXPAT_OUTPUT_NAME +CMAKE_SHARED_LIBRARY_PREFIX AM_LDFLAGS AM_CXXFLAGS AM_CFLAGS AM_CPPFLAGS -WITH_DOCBOOK_FALSE -WITH_DOCBOOK_TRUE +SIZEOF_VOID_P +SO_PATCH +SO_MINOR +SO_MAJOR +LIBDIR_BASENAME +EXPAT_CHAR_TYPE +EXPAT_CONTEXT_BYTES +EXPAT_NS +EXPAT_MIN_SIZE +EXPAT_LARGE_SIZE +EXPAT_DTD +EXPAT_ATTR_INFO +WITH_DISTRIBUTABLE_MANPAGE_FALSE +WITH_DISTRIBUTABLE_MANPAGE_TRUE +WITH_PREBUILT_MANPAGE_FALSE +WITH_PREBUILT_MANPAGE_TRUE +WITH_MANPAGE_FALSE +WITH_MANPAGE_TRUE DOCBOOK_TO_MAN FILEMAP +LIBM +_INTERNAL_LARGE_SIZE_FALSE +_INTERNAL_LARGE_SIZE_TRUE +_INTERNAL_MIN_SIZE_FALSE +_INTERNAL_MIN_SIZE_TRUE +_INTERNAL_UNICODE_WCHAR_T_FALSE +_INTERNAL_UNICODE_WCHAR_T_TRUE UNICODE_FALSE UNICODE_TRUE MINGW_FALSE MINGW_TRUE +HAVE_CXX11 WITH_TESTS_FALSE WITH_TESTS_TRUE WITH_EXAMPLES_FALSE @@ -666,7 +717,6 @@ CXX LIBAGE LIBREVISION LIBCURRENT -CPP LT_SYS_LIBRARY_PATH OTOOL64 OTOOL @@ -675,6 +725,7 @@ NMEDIT DSYMUTIL MANIFEST_TOOL RANLIB +FILECMD NM ac_ct_DUMPBIN DUMPBIN @@ -706,10 +757,16 @@ CFLAGS CC ac_ct_AR AR +MAINT +MAINTAINER_MODE_FALSE +MAINTAINER_MODE_TRUE AM_BACKSLASH AM_DEFAULT_VERBOSITY AM_DEFAULT_V AM_V +CSCOPE +ETAGS +CTAGS am__untar am__tar AMTAR @@ -781,15 +838,18 @@ PACKAGE_NAME PATH_SEPARATOR SHELL am__quote' -ac_subst_files='' +ac_subst_files='PACKAGE_INIT' ac_user_opts=' enable_option_checking enable_silent_rules +enable_maintainer_mode enable_dependency_tracking enable_shared enable_static +enable_pic with_pic enable_fast_install +enable_aix_soname with_aix_soname with_gnu_ld with_sysroot @@ -813,7 +873,6 @@ LDFLAGS LIBS CPPFLAGS LT_SYS_LIBRARY_PATH -CPP CXX CXXFLAGS CCC @@ -887,8 +946,6 @@ do *) ac_optarg=yes ;; esac - # Accept the important Cygnus configure options, so we can diagnose typos. - case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; @@ -929,9 +986,9 @@ do ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid feature name: $ac_useropt" + as_fn_error $? "invalid feature name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" @@ -955,9 +1012,9 @@ do ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid feature name: $ac_useropt" + as_fn_error $? "invalid feature name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" @@ -1168,9 +1225,9 @@ do ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid package name: $ac_useropt" + as_fn_error $? "invalid package name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" @@ -1184,9 +1241,9 @@ do ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid package name: $ac_useropt" + as_fn_error $? "invalid package name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" @@ -1230,9 +1287,9 @@ Try \`$0 --help' for more information" *) # FIXME: should be removed in autoconf 3.0. - $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + printf "%s\n" "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && - $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + printf "%s\n" "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; @@ -1248,7 +1305,7 @@ if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; - *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + *) printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi @@ -1312,7 +1369,7 @@ $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_myself" | +printf "%s\n" X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -1369,7 +1426,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures expat 2.2.10 to adapt to many kinds of systems. +\`configure' configures expat 2.6.4 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1440,7 +1497,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of expat 2.2.10:";; + short | recursive ) echo "Configuration of expat 2.6.4:";; esac cat <<\_ACEOF @@ -1450,14 +1507,22 @@ Optional Features: --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-silent-rules less verbose build output (undo: "make V=1") --disable-silent-rules verbose build output (undo: "make V=0") + --disable-maintainer-mode + disable make rules and dependencies not useful (and + sometimes confusing) to the casual installer --enable-dependency-tracking do not reject slow dependency extractors --disable-dependency-tracking speeds up one-time build --enable-shared[=PKGS] build shared libraries [default=yes] --enable-static[=PKGS] build static libraries [default=yes] + --enable-pic[=PKGS] try to use only PIC/non-PIC objects [default=use + both] --enable-fast-install[=PKGS] optimize for fast installation [default=yes] + --enable-aix-soname=aix|svr4|both + shared library versioning (aka "SONAME") variant to + provide on AIX, [default=aix]. --disable-libtool-lock avoid locking (might break parallel builds) --enable-xml-attr-info Enable retrieving the byte offsets for attribute names and values [default=no] @@ -1469,11 +1534,6 @@ Optional Features: Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use - both] - --with-aix-soname=aix|svr4|both - shared library versioning (aka "SONAME") variant to - provide on AIX, [default=aix]. --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-sysroot[=DIR] Search for dependent libraries within DIR (or the compiler's sysroot if not specified). @@ -1501,7 +1561,6 @@ Some influential environment variables: you have headers in a nonstandard directory LT_SYS_LIBRARY_PATH User-defined run-time library search path. - CPP C preprocessor CXX C++ compiler command CXXFLAGS C++ compiler flags CXXCPP C++ preprocessor @@ -1511,7 +1570,7 @@ Some influential environment variables: Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. -Report bugs to . +Report bugs to . _ACEOF ac_status=$? fi @@ -1527,9 +1586,9 @@ if test "$ac_init_help" = "recursive"; then case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) - ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; @@ -1557,7 +1616,8 @@ esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } - # Check for guested configure. + # Check for configure.gnu first; this name is used for a wrapper for + # Metaconfig's "Configure" on case-insensitive file systems. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive @@ -1565,7 +1625,7 @@ ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix echo && $SHELL "$ac_srcdir/configure" --help=recursive else - $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + printf "%s\n" "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done @@ -1574,10 +1634,10 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -expat configure 2.2.10 -generated by GNU Autoconf 2.69 +expat configure 2.6.4 +generated by GNU Autoconf 2.71 -Copyright (C) 2012 Free Software Foundation, Inc. +Copyright (C) 2021 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF @@ -1594,14 +1654,14 @@ fi ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext + rm -f conftest.$ac_objext conftest.beam if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then @@ -1609,14 +1669,15 @@ $as_echo "$ac_try_echo"; } >&5 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest.$ac_objext; then : + } && test -s conftest.$ac_objext +then : ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 @@ -1632,14 +1693,14 @@ fi ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext conftest$ac_exeext + rm -f conftest.$ac_objext conftest.beam conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then @@ -1647,17 +1708,18 @@ $as_echo "$ac_try_echo"; } >&5 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext - }; then : + } +then : ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 @@ -1679,120 +1741,44 @@ fi ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +printf %s "checking for $2... " >&6; } +if eval test \${$3+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : eval "$3=yes" -else +else $as_nop eval "$3=no" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile -# ac_fn_c_try_cpp LINENO -# ---------------------- -# Try to preprocess conftest.$ac_ext, and return whether this succeeded. -ac_fn_c_try_cpp () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if { { ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } > conftest.i && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_c_try_cpp - -# ac_fn_c_try_run LINENO -# ---------------------- -# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes -# that executables *can* be run. -ac_fn_c_try_run () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' - { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; }; then : - ac_retval=0 -else - $as_echo "$as_me: program exited with status $ac_status" >&5 - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=$ac_status -fi - rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_c_try_run - # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +printf %s "checking for $2... " >&6; } +if eval test \${$3+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. @@ -1800,16 +1786,9 @@ else #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $2 (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif + which can conflict with char $2 (void); below. */ +#include #undef $2 /* Override any GCC internal prototype to avoid an error. @@ -1818,7 +1797,7 @@ else #ifdef __cplusplus extern "C" #endif -char $2 (); +char $2 (void); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ @@ -1827,24 +1806,25 @@ choke me #endif int -main () +main (void) { return $2 (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : eval "$3=yes" -else +else $as_nop eval "$3=no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func @@ -1855,14 +1835,14 @@ $as_echo "$ac_res" >&6; } ac_fn_cxx_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext + rm -f conftest.$ac_objext conftest.beam if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then @@ -1870,14 +1850,15 @@ $as_echo "$ac_try_echo"; } >&5 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err - } && test -s conftest.$ac_objext; then : + } && test -s conftest.$ac_objext +then : ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 @@ -1899,7 +1880,7 @@ case "(($ac_try" in *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then @@ -1907,14 +1888,15 @@ $as_echo "$ac_try_echo"; } >&5 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err - }; then : + } +then : ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 @@ -1930,14 +1912,14 @@ fi ac_fn_cxx_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext conftest$ac_exeext + rm -f conftest.$ac_objext conftest.beam conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then @@ -1945,17 +1927,18 @@ $as_echo "$ac_try_echo"; } >&5 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext - }; then : + } +then : ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 @@ -1970,6 +1953,49 @@ fi } # ac_fn_cxx_try_link +# ac_fn_c_try_run LINENO +# ---------------------- +# Try to run conftest.$ac_ext, and return whether this succeeded. Assumes that +# executables *can* be run. +ac_fn_c_try_run () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; } +then : + ac_retval=0 +else $as_nop + printf "%s\n" "$as_me: program exited with status $ac_status" >&5 + printf "%s\n" "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=$ac_status +fi + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_run + # ac_fn_c_check_type LINENO TYPE VAR INCLUDES # ------------------------------------------- # Tests whether TYPE exists after having included INCLUDES, setting cache @@ -1977,17 +2003,18 @@ fi ac_fn_c_check_type () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +printf %s "checking for $2... " >&6; } +if eval test \${$3+y} +then : + printf %s "(cached) " >&6 +else $as_nop eval "$3=no" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int -main () +main (void) { if (sizeof ($2)) return 0; @@ -1995,12 +2022,13 @@ if (sizeof ($2)) return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int -main () +main (void) { if (sizeof (($2))) return 0; @@ -2008,130 +2036,249 @@ if (sizeof (($2))) return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : -else +else $as_nop eval "$3=yes" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_type -# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES -# ------------------------------------------------------- -# Tests whether HEADER exists, giving a warning if it cannot be compiled using -# the include files in INCLUDES and setting the cache variable VAR -# accordingly. -ac_fn_c_check_header_mongrel () +# ac_fn_c_compute_int LINENO EXPR VAR INCLUDES +# -------------------------------------------- +# Tries to find the compile-time value of EXPR in a program that includes +# INCLUDES, setting VAR accordingly. Returns whether the value could be +# computed +ac_fn_c_compute_int () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if eval \${$3+:} false; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 -$as_echo_n "checking $2 usability... " >&6; } + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 -#include <$2> -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_header_compiler=yes -else - ac_header_compiler=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } +int +main (void) +{ +static int test_array [1 - 2 * !(($2) >= 0)]; +test_array [0] = 0; +return test_array [0]; -# Is the header present? -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 -$as_echo_n "checking $2 presence... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <$2> + ; + return 0; +} _ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - ac_header_preproc=yes -else - ac_header_preproc=no -fi -rm -f conftest.err conftest.i conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( - yes:no: ) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} - ;; - no:yes:* ) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} -( $as_echo "## -------------------------------------- ## -## Report this to expat-bugs@libexpat.org ## -## -------------------------------------- ##" - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - eval "$3=\$ac_header_compiler" -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_c_check_header_mongrel -cat >config.log <<_ACEOF -This file contains any messages produced by compilers while -running configure, to aid debugging if configure makes a mistake. - -It was created by expat $as_me 2.2.10, which was -generated by GNU Autoconf 2.69. Invocation command line was +if ac_fn_c_try_compile "$LINENO" +then : + ac_lo=0 ac_mid=0 + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main (void) +{ +static int test_array [1 - 2 * !(($2) <= $ac_mid)]; +test_array [0] = 0; +return test_array [0]; - $ $0 $@ + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_hi=$ac_mid; break +else $as_nop + as_fn_arith $ac_mid + 1 && ac_lo=$as_val + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + done +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main (void) +{ +static int test_array [1 - 2 * !(($2) < 0)]; +test_array [0] = 0; +return test_array [0]; + ; + return 0; +} _ACEOF -exec 5>>config.log +if ac_fn_c_try_compile "$LINENO" +then : + ac_hi=-1 ac_mid=-1 + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main (void) { -cat <<_ASUNAME -## --------- ## -## Platform. ## -## --------- ## +static int test_array [1 - 2 * !(($2) >= $ac_mid)]; +test_array [0] = 0; +return test_array [0]; -hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_lo=$ac_mid; break +else $as_nop + as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + done +else $as_nop + ac_lo= ac_hi= +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main (void) +{ +static int test_array [1 - 2 * !(($2) <= $ac_mid)]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_hi=$ac_mid +else $as_nop + as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +done +case $ac_lo in #(( +?*) eval "$3=\$ac_lo"; ac_retval=0 ;; +'') ac_retval=1 ;; +esac + else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +static long int longval (void) { return $2; } +static unsigned long int ulongval (void) { return $2; } +#include +#include +int +main (void) +{ + + FILE *f = fopen ("conftest.val", "w"); + if (! f) + return 1; + if (($2) < 0) + { + long int i = longval (); + if (i != ($2)) + return 1; + fprintf (f, "%ld", i); + } + else + { + unsigned long int i = ulongval (); + if (i != ($2)) + return 1; + fprintf (f, "%lu", i); + } + /* Do not output a trailing newline, as this causes \r\n confusion + on some platforms. */ + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + echo >>conftest.val; read $3 config.log <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by expat $as_me 2.6.4, which was +generated by GNU Autoconf 2.71. Invocation command line was + + $ $0$ac_configure_args_raw + +_ACEOF +exec 5>>config.log +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` @@ -2154,8 +2301,12 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - $as_echo "PATH: $as_dir" + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + printf "%s\n" "PATH: $as_dir" done IFS=$as_save_IFS @@ -2190,7 +2341,7 @@ do | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) - ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; @@ -2225,11 +2376,13 @@ done # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? + # Sanitize IFS. + IFS=" "" $as_nl" # Save into config.log some information that might help in debugging. { echo - $as_echo "## ---------------- ## + printf "%s\n" "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo @@ -2240,8 +2393,8 @@ trap 'exit_status=$? case $ac_val in #( *${as_nl}*) case $ac_var in #( - *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 -$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( @@ -2265,7 +2418,7 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; ) echo - $as_echo "## ----------------- ## + printf "%s\n" "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo @@ -2273,14 +2426,14 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; do eval ac_val=\$$ac_var case $ac_val in - *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac - $as_echo "$ac_var='\''$ac_val'\''" + printf "%s\n" "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then - $as_echo "## ------------------- ## + printf "%s\n" "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo @@ -2288,15 +2441,15 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; do eval ac_val=\$$ac_var case $ac_val in - *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac - $as_echo "$ac_var='\''$ac_val'\''" + printf "%s\n" "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then - $as_echo "## ----------- ## + printf "%s\n" "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo @@ -2304,8 +2457,8 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; echo fi test "$ac_signal" != 0 && - $as_echo "$as_me: caught signal $ac_signal" - $as_echo "$as_me: exit $exit_status" + printf "%s\n" "$as_me: caught signal $ac_signal" + printf "%s\n" "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && @@ -2319,63 +2472,48 @@ ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h -$as_echo "/* confdefs.h */" > confdefs.h +printf "%s\n" "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. -cat >>confdefs.h <<_ACEOF -#define PACKAGE_NAME "$PACKAGE_NAME" -_ACEOF +printf "%s\n" "#define PACKAGE_NAME \"$PACKAGE_NAME\"" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define PACKAGE_TARNAME "$PACKAGE_TARNAME" -_ACEOF +printf "%s\n" "#define PACKAGE_TARNAME \"$PACKAGE_TARNAME\"" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define PACKAGE_VERSION "$PACKAGE_VERSION" -_ACEOF +printf "%s\n" "#define PACKAGE_VERSION \"$PACKAGE_VERSION\"" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define PACKAGE_STRING "$PACKAGE_STRING" -_ACEOF +printf "%s\n" "#define PACKAGE_STRING \"$PACKAGE_STRING\"" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" -_ACEOF +printf "%s\n" "#define PACKAGE_BUGREPORT \"$PACKAGE_BUGREPORT\"" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define PACKAGE_URL "$PACKAGE_URL" -_ACEOF +printf "%s\n" "#define PACKAGE_URL \"$PACKAGE_URL\"" >>confdefs.h # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. -ac_site_file1=NONE -ac_site_file2=NONE if test -n "$CONFIG_SITE"; then - # We do not want a PATH search for config.site. - case $CONFIG_SITE in #(( - -*) ac_site_file1=./$CONFIG_SITE;; - */*) ac_site_file1=$CONFIG_SITE;; - *) ac_site_file1=./$CONFIG_SITE;; - esac + ac_site_files="$CONFIG_SITE" elif test "x$prefix" != xNONE; then - ac_site_file1=$prefix/share/config.site - ac_site_file2=$prefix/etc/config.site + ac_site_files="$prefix/share/config.site $prefix/etc/config.site" else - ac_site_file1=$ac_default_prefix/share/config.site - ac_site_file2=$ac_default_prefix/etc/config.site + ac_site_files="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi -for ac_site_file in "$ac_site_file1" "$ac_site_file2" + +for ac_site_file in $ac_site_files do - test "x$ac_site_file" = xNONE && continue - if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 -$as_echo "$as_me: loading site script $ac_site_file" >&6;} + case $ac_site_file in #( + */*) : + ;; #( + *) : + ac_site_file=./$ac_site_file ;; +esac + if test -f "$ac_site_file" && test -r "$ac_site_file"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 +printf "%s\n" "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ - || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + || { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi @@ -2385,189 +2523,796 @@ if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 -$as_echo "$as_me: loading cache $cache_file" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 +printf "%s\n" "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 -$as_echo "$as_me: creating cache $cache_file" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 +printf "%s\n" "$as_me: creating cache $cache_file" >&6;} >$cache_file fi -as_fn_append ac_header_list " stdlib.h" -as_fn_append ac_header_list " unistd.h" -as_fn_append ac_header_list " sys/param.h" -# Check that the precious variables saved in the cache have kept the same -# value. -ac_cache_corrupted=false -for ac_var in $ac_precious_vars; do - eval ac_old_set=\$ac_cv_env_${ac_var}_set - eval ac_new_set=\$ac_env_${ac_var}_set - eval ac_old_val=\$ac_cv_env_${ac_var}_value - eval ac_new_val=\$ac_env_${ac_var}_value - case $ac_old_set,$ac_new_set in - set,) - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 -$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,set) - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 -$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,);; - *) - if test "x$ac_old_val" != "x$ac_new_val"; then - # differences in whitespace do not lead to failure. - ac_old_val_w=`echo x $ac_old_val` - ac_new_val_w=`echo x $ac_new_val` - if test "$ac_old_val_w" != "$ac_new_val_w"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 -$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} - ac_cache_corrupted=: - else - { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 -$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} - eval $ac_var=\$ac_old_val - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 -$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 -$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} - fi;; - esac - # Pass precious variables to config.status. - if test "$ac_new_set" = set; then - case $ac_new_val in - *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; - *) ac_arg=$ac_var=$ac_new_val ;; - esac - case " $ac_configure_args " in - *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. - *) as_fn_append ac_configure_args " '$ac_arg'" ;; - esac - fi -done -if $ac_cache_corrupted; then - { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 -$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} - as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 -fi -## -------------------- ## -## Main body of script. ## -## -------------------- ## +# Test code for whether the C compiler supports C89 (global declarations) +ac_c_conftest_c89_globals=' +/* Does the compiler advertise C89 conformance? + Do not test the value of __STDC__, because some compilers set it to 0 + while being otherwise adequately conformant. */ +#if !defined __STDC__ +# error "Compiler does not advertise C89 conformance" +#endif -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu +#include +#include +struct stat; +/* Most of the following tests are stolen from RCS 5.7 src/conf.sh. */ +struct buf { int x; }; +struct buf * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (char **p, int i) +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not \xHH hex character constants. + These do not provoke an error unfortunately, instead are silently treated + as an "x". The following induces an error, until -std is added to get + proper ANSI mode. Curiously \x00 != x always comes out true, for an + array size at least. It is necessary to write \x00 == 0 to get something + that is true only with -std. */ +int osf4_cc_array ['\''\x00'\'' == 0 ? 1 : -1]; +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) '\''x'\'' +int xlc6_cc_array[FOO(a) == '\''x'\'' ? 1 : -1]; +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, int *(*)(struct buf *, struct stat *, int), + int, int);' +# Test code for whether the C compiler supports C89 (body of main). +ac_c_conftest_c89_main=' +ok |= (argc == 0 || f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]); +' -ac_aux_dir= -for ac_dir in conftools "$srcdir"/conftools; do - if test -f "$ac_dir/install-sh"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install-sh -c" - break - elif test -f "$ac_dir/install.sh"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install.sh -c" - break - elif test -f "$ac_dir/shtool"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/shtool install -c" - break - fi -done -if test -z "$ac_aux_dir"; then - as_fn_error $? "cannot find install-sh, install.sh, or shtool in conftools \"$srcdir\"/conftools" "$LINENO" 5 -fi +# Test code for whether the C compiler supports C99 (global declarations) +ac_c_conftest_c99_globals=' +// Does the compiler advertise C99 conformance? +#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L +# error "Compiler does not advertise C99 conformance" +#endif -# These three variables are undocumented and unsupported, -# and are intended to be withdrawn in a future Autoconf release. -# They can cause serious problems if a builder's source tree is in a directory -# whose full name contains unusual characters. -ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. -ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. -ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. +#include +extern int puts (const char *); +extern int printf (const char *, ...); +extern int dprintf (int, const char *, ...); +extern void *malloc (size_t); +extern void free (void *); +// Check varargs macros. These examples are taken from C99 6.10.3.5. +// dprintf is used instead of fprintf to avoid needing to declare +// FILE and stderr. +#define debug(...) dprintf (2, __VA_ARGS__) +#define showlist(...) puts (#__VA_ARGS__) +#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__)) +static void +test_varargs_macros (void) +{ + int x = 1234; + int y = 5678; + debug ("Flag"); + debug ("X = %d\n", x); + showlist (The first, second, and third items.); + report (x>y, "x is %d but y is %d", x, y); +} +// Check long long types. +#define BIG64 18446744073709551615ull +#define BIG32 4294967295ul +#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0) +#if !BIG_OK + #error "your preprocessor is broken" +#endif +#if BIG_OK +#else + #error "your preprocessor is broken" +#endif +static long long int bignum = -9223372036854775807LL; +static unsigned long long int ubignum = BIG64; -# Make sure we can run config.sub. -$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || - as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 +struct incomplete_array +{ + int datasize; + double data[]; +}; -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 -$as_echo_n "checking build system type... " >&6; } -if ${ac_cv_build+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_build_alias=$build_alias -test "x$ac_build_alias" = x && - ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` -test "x$ac_build_alias" = x && - as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 -ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || - as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 +struct named_init { + int number; + const wchar_t *name; + double average; +}; -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 -$as_echo "$ac_cv_build" >&6; } -case $ac_cv_build in -*-*-*) ;; -*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; -esac -build=$ac_cv_build -ac_save_IFS=$IFS; IFS='-' -set x $ac_cv_build -shift -build_cpu=$1 -build_vendor=$2 -shift; shift -# Remember, the first character of IFS is used to create $*, -# except with old shells: -build_os=$* -IFS=$ac_save_IFS -case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac +typedef const char *ccp; +static inline int +test_restrict (ccp restrict text) +{ + // See if C++-style comments work. + // Iterate through items via the restricted pointer. + // Also check for declarations in for loops. + for (unsigned int i = 0; *(text+i) != '\''\0'\''; ++i) + continue; + return 0; +} -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 -$as_echo_n "checking host system type... " >&6; } -if ${ac_cv_host+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "x$host_alias" = x; then - ac_cv_host=$ac_cv_build -else - ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || - as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 -fi +// Check varargs and va_copy. +static bool +test_varargs (const char *format, ...) +{ + va_list args; + va_start (args, format); + va_list args_copy; + va_copy (args_copy, args); -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 -$as_echo "$ac_cv_host" >&6; } -case $ac_cv_host in -*-*-*) ;; -*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; -esac -host=$ac_cv_host -ac_save_IFS=$IFS; IFS='-' -set x $ac_cv_host -shift -host_cpu=$1 -host_vendor=$2 -shift; shift -# Remember, the first character of IFS is used to create $*, -# except with old shells: + const char *str = ""; + int number = 0; + float fnumber = 0; + + while (*format) + { + switch (*format++) + { + case '\''s'\'': // string + str = va_arg (args_copy, const char *); + break; + case '\''d'\'': // int + number = va_arg (args_copy, int); + break; + case '\''f'\'': // float + fnumber = va_arg (args_copy, double); + break; + default: + break; + } + } + va_end (args_copy); + va_end (args); + + return *str && number && fnumber; +} +' + +# Test code for whether the C compiler supports C99 (body of main). +ac_c_conftest_c99_main=' + // Check bool. + _Bool success = false; + success |= (argc != 0); + + // Check restrict. + if (test_restrict ("String literal") == 0) + success = true; + char *restrict newvar = "Another string"; + + // Check varargs. + success &= test_varargs ("s, d'\'' f .", "string", 65, 34.234); + test_varargs_macros (); + + // Check flexible array members. + struct incomplete_array *ia = + malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10)); + ia->datasize = 10; + for (int i = 0; i < ia->datasize; ++i) + ia->data[i] = i * 1.234; + + // Check named initializers. + struct named_init ni = { + .number = 34, + .name = L"Test wide string", + .average = 543.34343, + }; + + ni.number = 58; + + int dynamic_array[ni.number]; + dynamic_array[0] = argv[0][0]; + dynamic_array[ni.number - 1] = 543; + + // work around unused variable warnings + ok |= (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == '\''x'\'' + || dynamic_array[ni.number - 1] != 543); +' + +# Test code for whether the C compiler supports C11 (global declarations) +ac_c_conftest_c11_globals=' +// Does the compiler advertise C11 conformance? +#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112L +# error "Compiler does not advertise C11 conformance" +#endif + +// Check _Alignas. +char _Alignas (double) aligned_as_double; +char _Alignas (0) no_special_alignment; +extern char aligned_as_int; +char _Alignas (0) _Alignas (int) aligned_as_int; + +// Check _Alignof. +enum +{ + int_alignment = _Alignof (int), + int_array_alignment = _Alignof (int[100]), + char_alignment = _Alignof (char) +}; +_Static_assert (0 < -_Alignof (int), "_Alignof is signed"); + +// Check _Noreturn. +int _Noreturn does_not_return (void) { for (;;) continue; } + +// Check _Static_assert. +struct test_static_assert +{ + int x; + _Static_assert (sizeof (int) <= sizeof (long int), + "_Static_assert does not work in struct"); + long int y; +}; + +// Check UTF-8 literals. +#define u8 syntax error! +char const utf8_literal[] = u8"happens to be ASCII" "another string"; + +// Check duplicate typedefs. +typedef long *long_ptr; +typedef long int *long_ptr; +typedef long_ptr long_ptr; + +// Anonymous structures and unions -- taken from C11 6.7.2.1 Example 1. +struct anonymous +{ + union { + struct { int i; int j; }; + struct { int k; long int l; } w; + }; + int m; +} v1; +' + +# Test code for whether the C compiler supports C11 (body of main). +ac_c_conftest_c11_main=' + _Static_assert ((offsetof (struct anonymous, i) + == offsetof (struct anonymous, w.k)), + "Anonymous union alignment botch"); + v1.i = 2; + v1.w.k = 5; + ok |= v1.i != 5; +' + +# Test code for whether the C compiler supports C11 (complete). +ac_c_conftest_c11_program="${ac_c_conftest_c89_globals} +${ac_c_conftest_c99_globals} +${ac_c_conftest_c11_globals} + +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_c_conftest_c89_main} + ${ac_c_conftest_c99_main} + ${ac_c_conftest_c11_main} + return ok; +} +" + +# Test code for whether the C compiler supports C99 (complete). +ac_c_conftest_c99_program="${ac_c_conftest_c89_globals} +${ac_c_conftest_c99_globals} + +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_c_conftest_c89_main} + ${ac_c_conftest_c99_main} + return ok; +} +" + +# Test code for whether the C compiler supports C89 (complete). +ac_c_conftest_c89_program="${ac_c_conftest_c89_globals} + +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_c_conftest_c89_main} + return ok; +} +" + +as_fn_append ac_header_c_list " stdio.h stdio_h HAVE_STDIO_H" +as_fn_append ac_header_c_list " stdlib.h stdlib_h HAVE_STDLIB_H" +as_fn_append ac_header_c_list " string.h string_h HAVE_STRING_H" +as_fn_append ac_header_c_list " inttypes.h inttypes_h HAVE_INTTYPES_H" +as_fn_append ac_header_c_list " stdint.h stdint_h HAVE_STDINT_H" +as_fn_append ac_header_c_list " strings.h strings_h HAVE_STRINGS_H" +as_fn_append ac_header_c_list " sys/stat.h sys_stat_h HAVE_SYS_STAT_H" +as_fn_append ac_header_c_list " sys/types.h sys_types_h HAVE_SYS_TYPES_H" +as_fn_append ac_header_c_list " unistd.h unistd_h HAVE_UNISTD_H" +# Test code for whether the C++ compiler supports C++98 (global declarations) +ac_cxx_conftest_cxx98_globals=' +// Does the compiler advertise C++98 conformance? +#if !defined __cplusplus || __cplusplus < 199711L +# error "Compiler does not advertise C++98 conformance" +#endif + +// These inclusions are to reject old compilers that +// lack the unsuffixed header files. +#include +#include + +// and are *not* freestanding headers in C++98. +extern void assert (int); +namespace std { + extern int strcmp (const char *, const char *); +} + +// Namespaces, exceptions, and templates were all added after "C++ 2.0". +using std::exception; +using std::strcmp; + +namespace { + +void test_exception_syntax() +{ + try { + throw "test"; + } catch (const char *s) { + // Extra parentheses suppress a warning when building autoconf itself, + // due to lint rules shared with more typical C programs. + assert (!(strcmp) (s, "test")); + } +} + +template struct test_template +{ + T const val; + explicit test_template(T t) : val(t) {} + template T add(U u) { return static_cast(u) + val; } +}; + +} // anonymous namespace +' + +# Test code for whether the C++ compiler supports C++98 (body of main) +ac_cxx_conftest_cxx98_main=' + assert (argc); + assert (! argv[0]); +{ + test_exception_syntax (); + test_template tt (2.0); + assert (tt.add (4) == 6.0); + assert (true && !false); +} +' + +# Test code for whether the C++ compiler supports C++11 (global declarations) +ac_cxx_conftest_cxx11_globals=' +// Does the compiler advertise C++ 2011 conformance? +#if !defined __cplusplus || __cplusplus < 201103L +# error "Compiler does not advertise C++11 conformance" +#endif + +namespace cxx11test +{ + constexpr int get_val() { return 20; } + + struct testinit + { + int i; + double d; + }; + + class delegate + { + public: + delegate(int n) : n(n) {} + delegate(): delegate(2354) {} + + virtual int getval() { return this->n; }; + protected: + int n; + }; + + class overridden : public delegate + { + public: + overridden(int n): delegate(n) {} + virtual int getval() override final { return this->n * 2; } + }; + + class nocopy + { + public: + nocopy(int i): i(i) {} + nocopy() = default; + nocopy(const nocopy&) = delete; + nocopy & operator=(const nocopy&) = delete; + private: + int i; + }; + + // for testing lambda expressions + template Ret eval(Fn f, Ret v) + { + return f(v); + } + + // for testing variadic templates and trailing return types + template auto sum(V first) -> V + { + return first; + } + template auto sum(V first, Args... rest) -> V + { + return first + sum(rest...); + } +} +' + +# Test code for whether the C++ compiler supports C++11 (body of main) +ac_cxx_conftest_cxx11_main=' +{ + // Test auto and decltype + auto a1 = 6538; + auto a2 = 48573953.4; + auto a3 = "String literal"; + + int total = 0; + for (auto i = a3; *i; ++i) { total += *i; } + + decltype(a2) a4 = 34895.034; +} +{ + // Test constexpr + short sa[cxx11test::get_val()] = { 0 }; +} +{ + // Test initializer lists + cxx11test::testinit il = { 4323, 435234.23544 }; +} +{ + // Test range-based for + int array[] = {9, 7, 13, 15, 4, 18, 12, 10, 5, 3, + 14, 19, 17, 8, 6, 20, 16, 2, 11, 1}; + for (auto &x : array) { x += 23; } +} +{ + // Test lambda expressions + using cxx11test::eval; + assert (eval ([](int x) { return x*2; }, 21) == 42); + double d = 2.0; + assert (eval ([&](double x) { return d += x; }, 3.0) == 5.0); + assert (d == 5.0); + assert (eval ([=](double x) mutable { return d += x; }, 4.0) == 9.0); + assert (d == 5.0); +} +{ + // Test use of variadic templates + using cxx11test::sum; + auto a = sum(1); + auto b = sum(1, 2); + auto c = sum(1.0, 2.0, 3.0); +} +{ + // Test constructor delegation + cxx11test::delegate d1; + cxx11test::delegate d2(); + cxx11test::delegate d3(45); +} +{ + // Test override and final + cxx11test::overridden o1(55464); +} +{ + // Test nullptr + char *c = nullptr; +} +{ + // Test template brackets + test_template<::test_template> v(test_template(12)); +} +{ + // Unicode literals + char const *utf8 = u8"UTF-8 string \u2500"; + char16_t const *utf16 = u"UTF-8 string \u2500"; + char32_t const *utf32 = U"UTF-32 string \u2500"; +} +' + +# Test code for whether the C compiler supports C++11 (complete). +ac_cxx_conftest_cxx11_program="${ac_cxx_conftest_cxx98_globals} +${ac_cxx_conftest_cxx11_globals} + +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_cxx_conftest_cxx98_main} + ${ac_cxx_conftest_cxx11_main} + return ok; +} +" + +# Test code for whether the C compiler supports C++98 (complete). +ac_cxx_conftest_cxx98_program="${ac_cxx_conftest_cxx98_globals} +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_cxx_conftest_cxx98_main} + return ok; +} +" + +as_fn_append ac_header_c_list " sys/param.h sys_param_h HAVE_SYS_PARAM_H" +as_fn_append ac_func_c_list " getpagesize HAVE_GETPAGESIZE" + +# Auxiliary files required by this configure script. +ac_aux_files="ltmain.sh compile ar-lib missing install-sh config.guess config.sub" + +# Locations in which to look for auxiliary files. +ac_aux_dir_candidates="${srcdir}/conftools" + +# Search for a directory containing all of the required auxiliary files, +# $ac_aux_files, from the $PATH-style list $ac_aux_dir_candidates. +# If we don't find one directory that contains all the files we need, +# we report the set of missing files from the *first* directory in +# $ac_aux_dir_candidates and give up. +ac_missing_aux_files="" +ac_first_candidate=: +printf "%s\n" "$as_me:${as_lineno-$LINENO}: looking for aux files: $ac_aux_files" >&5 +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in $ac_aux_dir_candidates +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + as_found=: + + printf "%s\n" "$as_me:${as_lineno-$LINENO}: trying $as_dir" >&5 + ac_aux_dir_found=yes + ac_install_sh= + for ac_aux in $ac_aux_files + do + # As a special case, if "install-sh" is required, that requirement + # can be satisfied by any of "install-sh", "install.sh", or "shtool", + # and $ac_install_sh is set appropriately for whichever one is found. + if test x"$ac_aux" = x"install-sh" + then + if test -f "${as_dir}install-sh"; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}install-sh found" >&5 + ac_install_sh="${as_dir}install-sh -c" + elif test -f "${as_dir}install.sh"; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}install.sh found" >&5 + ac_install_sh="${as_dir}install.sh -c" + elif test -f "${as_dir}shtool"; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}shtool found" >&5 + ac_install_sh="${as_dir}shtool install -c" + else + ac_aux_dir_found=no + if $ac_first_candidate; then + ac_missing_aux_files="${ac_missing_aux_files} install-sh" + else + break + fi + fi + else + if test -f "${as_dir}${ac_aux}"; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}${ac_aux} found" >&5 + else + ac_aux_dir_found=no + if $ac_first_candidate; then + ac_missing_aux_files="${ac_missing_aux_files} ${ac_aux}" + else + break + fi + fi + fi + done + if test "$ac_aux_dir_found" = yes; then + ac_aux_dir="$as_dir" + break + fi + ac_first_candidate=false + + as_found=false +done +IFS=$as_save_IFS +if $as_found +then : + +else $as_nop + as_fn_error $? "cannot find required auxiliary files:$ac_missing_aux_files" "$LINENO" 5 +fi + + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +if test -f "${ac_aux_dir}config.guess"; then + ac_config_guess="$SHELL ${ac_aux_dir}config.guess" +fi +if test -f "${ac_aux_dir}config.sub"; then + ac_config_sub="$SHELL ${ac_aux_dir}config.sub" +fi +if test -f "$ac_aux_dir/configure"; then + ac_configure="$SHELL ${ac_aux_dir}configure" +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in $ac_precious_vars; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value + case $ac_old_set,$ac_new_set in + set,) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +printf "%s\n" "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 +printf "%s\n" "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 +printf "%s\n" "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +printf "%s\n" "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 +printf "%s\n" "$as_me: former value: \`$ac_old_val'" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 +printf "%s\n" "$as_me: current value: \`$ac_new_val'" >&2;} + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *\'*) ac_arg=$ac_var=`printf "%s\n" "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) as_fn_append ac_configure_args " '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 +printf "%s\n" "$as_me: error: changes in the environment can compromise the build" >&2;} + as_fn_error $? "run \`${MAKE-make} distclean' and/or \`rm $cache_file' + and start over" "$LINENO" 5 +fi +## -------------------- ## +## Main body of script. ## +## -------------------- ## + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + + + + + + + + + # Make sure we can run config.sub. +$SHELL "${ac_aux_dir}config.sub" sun4 >/dev/null 2>&1 || + as_fn_error $? "cannot run $SHELL ${ac_aux_dir}config.sub" "$LINENO" 5 + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 +printf %s "checking build system type... " >&6; } +if test ${ac_cv_build+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_build_alias=$build_alias +test "x$ac_build_alias" = x && + ac_build_alias=`$SHELL "${ac_aux_dir}config.guess"` +test "x$ac_build_alias" = x && + as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 +ac_cv_build=`$SHELL "${ac_aux_dir}config.sub" $ac_build_alias` || + as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $ac_build_alias failed" "$LINENO" 5 + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 +printf "%s\n" "$ac_cv_build" >&6; } +case $ac_cv_build in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; +esac +build=$ac_cv_build +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_build +shift +build_cpu=$1 +build_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +build_os=$* +IFS=$ac_save_IFS +case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 +printf %s "checking host system type... " >&6; } +if test ${ac_cv_host+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test "x$host_alias" = x; then + ac_cv_host=$ac_cv_build +else + ac_cv_host=`$SHELL "${ac_aux_dir}config.sub" $host_alias` || + as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $host_alias failed" "$LINENO" 5 +fi + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 +printf "%s\n" "$ac_cv_host" >&6; } +case $ac_cv_host in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; +esac +host=$ac_cv_host +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_host +shift +host_cpu=$1 +host_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac @@ -2575,7 +3320,8 @@ case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac am__api_version='1.16' -# Find a good install program. We prefer a C program (faster), + + # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install @@ -2589,20 +3335,25 @@ am__api_version='1.16' # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 -$as_echo_n "checking for a BSD-compatible install... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 +printf %s "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then -if ${ac_cv_path_install+:} false; then : - $as_echo_n "(cached) " >&6 -else +if test ${ac_cv_path_install+y} +then : + printf %s "(cached) " >&6 +else $as_nop as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - # Account for people who put trailing slashes in PATH elements. -case $as_dir/ in #(( - ./ | .// | /[cC]/* | \ + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + # Account for fact that we put trailing slashes in our PATH walk. +case $as_dir in #(( + ./ | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; @@ -2612,13 +3363,13 @@ case $as_dir/ in #(( # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_prog$ac_exec_ext"; then if test $ac_prog = install && - grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + grep dspmsg "$as_dir$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && - grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + grep pwplus "$as_dir$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else @@ -2626,12 +3377,12 @@ case $as_dir/ in #(( echo one > conftest.one echo two > conftest.two mkdir conftest.dir - if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && + if "$as_dir$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir/" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then - ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + ac_cv_path_install="$as_dir$ac_prog$ac_exec_ext -c" break 3 fi fi @@ -2647,7 +3398,7 @@ IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi - if test "${ac_cv_path_install+set}" = set; then + if test ${ac_cv_path_install+y}; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a @@ -2657,8 +3408,8 @@ fi INSTALL=$ac_install_sh fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 -$as_echo "$INSTALL" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 +printf "%s\n" "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. @@ -2668,8 +3419,8 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 -$as_echo_n "checking whether build environment is sane... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 +printf %s "checking whether build environment is sane... " >&6; } # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' @@ -2723,8 +3474,8 @@ else as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= @@ -2743,26 +3494,23 @@ test "$program_suffix" != NONE && # Double any \ or $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' -program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` +program_transform_name=`printf "%s\n" "$program_transform_name" | sed "$ac_script"` + # Expand $ac_aux_dir to an absolute path. am_aux_dir=`cd "$ac_aux_dir" && pwd` -if test x"${MISSING+set}" != xset; then - case $am_aux_dir in - *\ * | *\ *) - MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; - *) - MISSING="\${SHELL} $am_aux_dir/missing" ;; - esac + + if test x"${MISSING+set}" != xset; then + MISSING="\${SHELL} '$am_aux_dir/missing'" fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 -$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 +printf "%s\n" "$as_me: WARNING: 'missing' script is too old or missing" >&2;} fi if test x"${install_sh+set}" != xset; then @@ -2782,11 +3530,12 @@ if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_STRIP+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_STRIP+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else @@ -2794,11 +3543,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2809,11 +3562,11 @@ fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 -$as_echo "$STRIP" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +printf "%s\n" "$STRIP" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -2822,11 +3575,12 @@ if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_STRIP+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_STRIP+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else @@ -2834,11 +3588,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2849,11 +3607,11 @@ fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 -$as_echo "$ac_ct_STRIP" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +printf "%s\n" "$ac_ct_STRIP" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then @@ -2861,8 +3619,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP @@ -2874,25 +3632,31 @@ fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 -$as_echo_n "checking for a thread-safe mkdir -p... " >&6; } + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a race-free mkdir -p" >&5 +printf %s "checking for a race-free mkdir -p... " >&6; } if test -z "$MKDIR_P"; then - if ${ac_cv_path_mkdir+:} false; then : - $as_echo_n "(cached) " >&6 -else + if test ${ac_cv_path_mkdir+y} +then : + printf %s "(cached) " >&6 +else $as_nop as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do - as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue - case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( - 'mkdir (GNU coreutils) '* | \ - 'mkdir (coreutils) '* | \ + as_fn_executable_p "$as_dir$ac_prog$ac_exec_ext" || continue + case `"$as_dir$ac_prog$ac_exec_ext" --version 2>&1` in #( + 'mkdir ('*'coreutils) '* | \ + 'BusyBox '* | \ 'mkdir (fileutils) '4.1*) - ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext + ac_cv_path_mkdir=$as_dir$ac_prog$ac_exec_ext break 3;; esac done @@ -2903,7 +3667,7 @@ IFS=$as_save_IFS fi test -d ./--version && rmdir ./--version - if test "${ac_cv_path_mkdir+set}" = set; then + if test ${ac_cv_path_mkdir+y}; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a @@ -2913,18 +3677,19 @@ fi MKDIR_P="$ac_install_sh -d" fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 -$as_echo "$MKDIR_P" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 +printf "%s\n" "$MKDIR_P" >&6; } for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_AWK+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_AWK+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else @@ -2932,11 +3697,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2947,24 +3716,25 @@ fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 -$as_echo "$AWK" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 +printf "%s\n" "$AWK" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi test -n "$AWK" && break done -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 -$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +printf %s "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} -ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` -if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : - $as_echo_n "(cached) " >&6 -else +ac_make=`printf "%s\n" "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if eval test \${ac_cv_prog_make_${ac_make}_set+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @@ -2980,12 +3750,12 @@ esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } SET_MAKE= else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi @@ -2999,7 +3769,8 @@ fi rmdir .tst 2>/dev/null # Check whether --enable-silent-rules was given. -if test "${enable_silent_rules+set}" = set; then : +if test ${enable_silent_rules+y} +then : enableval=$enable_silent_rules; fi @@ -3009,12 +3780,13 @@ case $enable_silent_rules in # ((( *) AM_DEFAULT_VERBOSITY=1;; esac am_make=${MAKE-make} -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 -$as_echo_n "checking whether $am_make supports nested variables... " >&6; } -if ${am_cv_make_support_nested_variables+:} false; then : - $as_echo_n "(cached) " >&6 -else - if $as_echo 'TRUE=$(BAR$(V)) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 +printf %s "checking whether $am_make supports nested variables... " >&6; } +if test ${am_cv_make_support_nested_variables+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if printf "%s\n" 'TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 @@ -3026,8 +3798,8 @@ else am_cv_make_support_nested_variables=no fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 -$as_echo "$am_cv_make_support_nested_variables" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 +printf "%s\n" "$am_cv_make_support_nested_variables" >&6; } if test $am_cv_make_support_nested_variables = yes; then AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' @@ -3059,17 +3831,13 @@ fi # Define the identity of the package. PACKAGE='expat' - VERSION='2.2.10' + VERSION='2.6.4' -cat >>confdefs.h <<_ACEOF -#define PACKAGE "$PACKAGE" -_ACEOF +printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define VERSION "$VERSION" -_ACEOF +printf "%s\n" "#define VERSION \"$VERSION\"" >>confdefs.h # Some tools Automake needs. @@ -3109,6 +3877,20 @@ am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' +# Variables for tags utilities; see am/tags.am +if test -z "$CTAGS"; then + CTAGS=ctags +fi + +if test -z "$ETAGS"; then + ETAGS=etags +fi + +if test -z "$CSCOPE"; then + CSCOPE=cscope +fi + + # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile @@ -3153,53 +3935,56 @@ END fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5 +printf %s "checking whether to enable maintainer-specific portions of Makefiles... " >&6; } + # Check whether --enable-maintainer-mode was given. +if test ${enable_maintainer_mode+y} +then : + enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval +else $as_nop + USE_MAINTAINER_MODE=yes +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5 +printf "%s\n" "$USE_MAINTAINER_MODE" >&6; } + if test $USE_MAINTAINER_MODE = yes; then + MAINTAINER_MODE_TRUE= + MAINTAINER_MODE_FALSE='#' +else + MAINTAINER_MODE_TRUE='#' + MAINTAINER_MODE_FALSE= +fi + + MAINT=$MAINTAINER_MODE_TRUE + + # to allow argument --disable-maintainer-mode + + + +LIBCURRENT=11 # sync +LIBREVISION=0 # with +LIBAGE=10 # CMakeLists.txt! + +ac_config_headers="$ac_config_headers expat_config.h" + -LIBCURRENT=7 # sync -LIBREVISION=12 # with -LIBAGE=6 # CMakeLists.txt! -if ${AM_CPPFLAGS+:} false; then : - case " $AM_CPPFLAGS " in #( - *" -DHAVE_EXPAT_CONFIG_H "*) : - { { $as_echo "$as_me:${as_lineno-$LINENO}: : AM_CPPFLAGS already contains -DHAVE_EXPAT_CONFIG_H"; } >&5 - (: AM_CPPFLAGS already contains -DHAVE_EXPAT_CONFIG_H) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } ;; #( - *) : - as_fn_append AM_CPPFLAGS " -DHAVE_EXPAT_CONFIG_H" - { { $as_echo "$as_me:${as_lineno-$LINENO}: : AM_CPPFLAGS=\"\$AM_CPPFLAGS\""; } >&5 - (: AM_CPPFLAGS="$AM_CPPFLAGS") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - ;; -esac -else - AM_CPPFLAGS=-DHAVE_EXPAT_CONFIG_H - { { $as_echo "$as_me:${as_lineno-$LINENO}: : AM_CPPFLAGS=\"\$AM_CPPFLAGS\""; } >&5 - (: AM_CPPFLAGS="$AM_CPPFLAGS") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } -fi -ac_config_headers="$ac_config_headers expat_config.h" DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5 -$as_echo_n "checking whether ${MAKE-make} supports the include directive... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5 +printf %s "checking whether ${MAKE-make} supports the include directive... " >&6; } cat > confinc.mk << 'END' am__doit: @echo this is the am__doit target >confinc.out @@ -3235,11 +4020,12 @@ esac fi done rm -f confinc.* confmf.* -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5 -$as_echo "${_am_result}" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5 +printf "%s\n" "${_am_result}" >&6; } # Check whether --enable-dependency-tracking was given. -if test "${enable_dependency_tracking+set}" = set; then : +if test ${enable_dependency_tracking+y} +then : enableval=$enable_dependency_tracking; fi @@ -3265,11 +4051,12 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else @@ -3277,11 +4064,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -3292,11 +4083,11 @@ fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -3305,11 +4096,12 @@ if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else @@ -3317,11 +4109,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -3332,11 +4128,11 @@ fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf "%s\n" "$ac_ct_CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_ct_CC" = x; then @@ -3344,8 +4140,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC @@ -3358,11 +4154,12 @@ if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else @@ -3370,11 +4167,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -3385,11 +4186,11 @@ fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -3398,11 +4199,12 @@ fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else @@ -3411,15 +4213,19 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + if test "$as_dir$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -3435,18 +4241,18 @@ if test $ac_prog_rejected = yes; then # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift - ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + ac_cv_prog_CC="$as_dir$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -3457,11 +4263,12 @@ if test -z "$CC"; then do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else @@ -3469,11 +4276,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -3484,11 +4295,11 @@ fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -3501,11 +4312,12 @@ if test -z "$CC"; then do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else @@ -3513,11 +4325,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -3528,11 +4344,11 @@ fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf "%s\n" "$ac_ct_CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -3544,8 +4360,8 @@ done else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC @@ -3553,25 +4369,129 @@ esac fi fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}clang", so it can be a program name with args. +set dummy ${ac_tool_prefix}clang; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}clang" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi -test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "clang", so it can be a program name with args. +set dummy clang; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="clang" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf "%s\n" "$ac_ct_CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi + +fi + + +test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. -$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 -for ac_option in --version -v -V -qversion; do +for ac_option in --version -v -V -qversion -version; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then @@ -3581,7 +4501,7 @@ $as_echo "$ac_try_echo"; } >&5 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done @@ -3589,7 +4509,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; @@ -3601,9 +4521,9 @@ ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 -$as_echo_n "checking whether the C compiler works... " >&6; } -ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 +printf %s "checking whether the C compiler works... " >&6; } +ac_link_default=`printf "%s\n" "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" @@ -3624,11 +4544,12 @@ case "(($ac_try" in *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, @@ -3645,7 +4566,7 @@ do # certainly right. break;; *.* ) - if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + if test ${ac_cv_exeext+y} && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi @@ -3661,44 +4582,46 @@ do done test "$ac_cv_exeext" = no && ac_cv_exeext= -else +else $as_nop ac_file='' fi -if test -z "$ac_file"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -$as_echo "$as_me: failed program was:" >&5 +if test -z "$ac_file" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 -$as_echo_n "checking for C compiler default output file name... " >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 -$as_echo "$ac_file" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 +printf %s "checking for C compiler default output file name... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 +printf "%s\n" "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 -$as_echo_n "checking for suffix of executables... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 +printf %s "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with @@ -3712,15 +4635,15 @@ for ac_file in conftest.exe conftest conftest.*; do * ) break;; esac done -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +else $as_nop + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 -$as_echo "$ac_cv_exeext" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 +printf "%s\n" "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext @@ -3729,7 +4652,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main () +main (void) { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; @@ -3741,8 +4664,8 @@ _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 -$as_echo_n "checking whether we are cross compiling... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +printf %s "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in @@ -3750,10 +4673,10 @@ case "(($ac_try" in *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in @@ -3761,39 +4684,40 @@ $as_echo "$ac_try_echo"; } >&5 *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot run C compiled programs. + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 -$as_echo "$cross_compiling" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 +printf "%s\n" "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 -$as_echo_n "checking for suffix of object files... " >&6; } -if ${ac_cv_objext+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 +printf %s "checking for suffix of object files... " >&6; } +if test ${ac_cv_objext+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; @@ -3807,11 +4731,12 @@ case "(($ac_try" in *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in @@ -3820,31 +4745,32 @@ $as_echo "$ac_try_echo"; } >&5 break;; esac done -else - $as_echo "$as_me: failed program was:" >&5 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 -$as_echo "$ac_cv_objext" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 +printf "%s\n" "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 -$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } -if ${ac_cv_c_compiler_gnu+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C" >&5 +printf %s "checking whether the compiler supports GNU C... " >&6; } +if test ${ac_cv_c_compiler_gnu+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { #ifndef __GNUC__ choke me @@ -3854,29 +4780,33 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_compiler_gnu=yes -else +else $as_nop ac_compiler_gnu=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 -$as_echo "$ac_cv_c_compiler_gnu" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +printf "%s\n" "$ac_cv_c_compiler_gnu" >&6; } +ac_compiler_gnu=$ac_cv_c_compiler_gnu + if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi -ac_test_CFLAGS=${CFLAGS+set} +ac_test_CFLAGS=${CFLAGS+y} ac_save_CFLAGS=$CFLAGS -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 -$as_echo_n "checking whether $CC accepts -g... " >&6; } -if ${ac_cv_prog_cc_g+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +printf %s "checking whether $CC accepts -g... " >&6; } +if test ${ac_cv_prog_cc_g+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no @@ -3885,57 +4815,60 @@ else /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_prog_cc_g=yes -else +else $as_nop CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : -else +else $as_nop ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_prog_cc_g=yes fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 -$as_echo "$ac_cv_prog_cc_g" >&6; } -if test "$ac_test_CFLAGS" = set; then +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +printf "%s\n" "$ac_cv_prog_cc_g" >&6; } +if test $ac_test_CFLAGS; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then @@ -3950,94 +4883,144 @@ else CFLAGS= fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 -$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } -if ${ac_cv_prog_cc_c89+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_cv_prog_cc_c89=no +ac_prog_cc_stdc=no +if test x$ac_prog_cc_stdc = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C11 features" >&5 +printf %s "checking for $CC option to enable C11 features... " >&6; } +if test ${ac_cv_prog_cc_c11+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cc_c11=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include -#include -struct stat; -/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ -struct buf { int x; }; -FILE * (*rcsopen) (struct buf *, struct stat *, int); -static char *e (p, i) - char **p; - int i; -{ - return p[i]; -} -static char *f (char * (*g) (char **, int), char **p, ...) -{ - char *s; - va_list v; - va_start (v,p); - s = g (p, va_arg (v,int)); - va_end (v); - return s; -} - -/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has - function prototypes and stuff, but not '\xHH' hex character constants. - These don't provoke an error unfortunately, instead are silently treated - as 'x'. The following induces an error, until -std is added to get - proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an - array size at least. It's necessary to write '\x00'==0 to get something - that's true only with -std. */ -int osf4_cc_array ['\x00' == 0 ? 1 : -1]; +$ac_c_conftest_c11_program +_ACEOF +for ac_arg in '' -std=gnu11 +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_c11=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cc_c11" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC +fi -/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters - inside strings and character constants. */ -#define FOO(x) 'x' -int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; +if test "x$ac_cv_prog_cc_c11" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cc_c11" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 +printf "%s\n" "$ac_cv_prog_cc_c11" >&6; } + CC="$CC $ac_cv_prog_cc_c11" +fi + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11 + ac_prog_cc_stdc=c11 +fi +fi +if test x$ac_prog_cc_stdc = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C99 features" >&5 +printf %s "checking for $CC option to enable C99 features... " >&6; } +if test ${ac_cv_prog_cc_c99+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cc_c99=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_c_conftest_c99_program +_ACEOF +for ac_arg in '' -std=gnu99 -std=c99 -c99 -qlanglvl=extc1x -qlanglvl=extc99 -AC99 -D_STDC_C99= +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_c99=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cc_c99" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC +fi -int test (int i, double x); -struct s1 {int (*f) (int a);}; -struct s2 {int (*f) (double a);}; -int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); -int argc; -char **argv; -int -main () -{ -return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; - ; - return 0; -} +if test "x$ac_cv_prog_cc_c99" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cc_c99" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 +printf "%s\n" "$ac_cv_prog_cc_c99" >&6; } + CC="$CC $ac_cv_prog_cc_c99" +fi + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 + ac_prog_cc_stdc=c99 +fi +fi +if test x$ac_prog_cc_stdc = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C89 features" >&5 +printf %s "checking for $CC option to enable C89 features... " >&6; } +if test ${ac_cv_prog_cc_c89+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_c_conftest_c89_program _ACEOF -for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ - -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" - if ac_fn_c_try_compile "$LINENO"; then : + if ac_fn_c_try_compile "$LINENO" +then : ac_cv_prog_cc_c89=$ac_arg fi -rm -f core conftest.err conftest.$ac_objext +rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC - fi -# AC_CACHE_VAL -case "x$ac_cv_prog_cc_c89" in - x) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -$as_echo "none needed" >&6; } ;; - xno) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -$as_echo "unsupported" >&6; } ;; - *) - CC="$CC $ac_cv_prog_cc_c89" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 -$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; -esac -if test "x$ac_cv_prog_cc_c89" != xno; then : +if test "x$ac_cv_prog_cc_c89" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cc_c89" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +printf "%s\n" "$ac_cv_prog_cc_c89" >&6; } + CC="$CC $ac_cv_prog_cc_c89" +fi + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 + ac_prog_cc_stdc=c89 +fi fi ac_ext=c @@ -4046,21 +5029,23 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -ac_ext=c + + ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 -$as_echo_n "checking whether $CC understands -c and -o together... " >&6; } -if ${am_cv_prog_cc_c_o+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 +printf %s "checking whether $CC understands -c and -o together... " >&6; } +if test ${am_cv_prog_cc_c_o+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; @@ -4088,8 +5073,8 @@ _ACEOF rm -f core conftest* unset am_i fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 -$as_echo "$am_cv_prog_cc_c_o" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 +printf "%s\n" "$am_cv_prog_cc_c_o" >&6; } if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. @@ -4107,11 +5092,12 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CC" am_compiler_list= -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 -$as_echo_n "checking dependency style of $depcc... " >&6; } -if ${am_cv_CC_dependencies_compiler_type+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +printf %s "checking dependency style of $depcc... " >&6; } +if test ${am_cv_CC_dependencies_compiler_type+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For @@ -4218,8 +5204,8 @@ else fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 -$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 +printf "%s\n" "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if @@ -4234,16 +5220,18 @@ fi -if test -n "$ac_tool_prefix"; then + + if test -n "$ac_tool_prefix"; then for ac_prog in ar lib "link -lib" do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_AR+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_AR+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else @@ -4251,11 +5239,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_AR="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -4266,11 +5258,11 @@ fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 -$as_echo "$AR" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 +printf "%s\n" "$AR" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -4283,11 +5275,12 @@ if test -z "$AR"; then do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_AR+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_AR+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else @@ -4295,11 +5288,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AR="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -4310,11 +5307,11 @@ fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 -$as_echo "$ac_ct_AR" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 +printf "%s\n" "$ac_ct_AR" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -4326,8 +5323,8 @@ done else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AR=$ac_ct_AR @@ -4336,11 +5333,12 @@ fi : ${AR=ar} -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the archiver ($AR) interface" >&5 -$as_echo_n "checking the archiver ($AR) interface... " >&6; } -if ${am_cv_ar_interface+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking the archiver ($AR) interface" >&5 +printf %s "checking the archiver ($AR) interface... " >&6; } +if test ${am_cv_ar_interface+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -4352,12 +5350,13 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu /* end confdefs.h. */ int some_variable = 0; _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : am_ar_try='$AR cru libconftest.a conftest.$ac_objext >&5' { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$am_ar_try\""; } >&5 (eval $am_ar_try) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test "$ac_status" -eq 0; then am_cv_ar_interface=ar @@ -4366,7 +5365,7 @@ if ac_fn_c_try_compile "$LINENO"; then : { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$am_ar_try\""; } >&5 (eval $am_ar_try) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test "$ac_status" -eq 0; then am_cv_ar_interface=lib @@ -4377,7 +5376,7 @@ if ac_fn_c_try_compile "$LINENO"; then : rm -f conftest.lib libconftest.a fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -4385,8 +5384,8 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_ar_interface" >&5 -$as_echo "$am_cv_ar_interface" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_ar_interface" >&5 +printf "%s\n" "$am_cv_ar_interface" >&6; } case $am_cv_ar_interface in ar) @@ -4406,24 +5405,25 @@ unknown) esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 -$as_echo_n "checking whether ln -s works... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 +printf %s "checking whether ln -s works... " >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 -$as_echo "no, using $LN_S" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 +printf "%s\n" "no, using $LN_S" >&6; } fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 -$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +printf %s "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} -ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` -if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : - $as_echo_n "(cached) " >&6 -else +ac_make=`printf "%s\n" "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if eval test \${ac_cv_prog_make_${ac_make}_set+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @@ -4439,12 +5439,12 @@ esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } SET_MAKE= else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi @@ -4452,14 +5452,15 @@ fi case `pwd` in *\ * | *\ *) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 -$as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 +printf "%s\n" "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; esac -macro_version='2.4.6' -macro_revision='2.4.6' +macro_version='2.5.3' +macro_revision='2.5.3' + @@ -4496,8 +5497,8 @@ ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 -$as_echo_n "checking how to print strings... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 +printf %s "checking how to print strings... " >&6; } # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then @@ -4523,12 +5524,12 @@ func_echo_all () } case $ECHO in - printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5 -$as_echo "printf" >&6; } ;; - print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 -$as_echo "print -r" >&6; } ;; - *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5 -$as_echo "cat" >&6; } ;; + printf*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: printf" >&5 +printf "%s\n" "printf" >&6; } ;; + print*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 +printf "%s\n" "print -r" >&6; } ;; + *) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: cat" >&5 +printf "%s\n" "cat" >&6; } ;; esac @@ -4544,11 +5545,12 @@ esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 -$as_echo_n "checking for a sed that does not truncate output... " >&6; } -if ${ac_cv_path_SED+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 +printf %s "checking for a sed that does not truncate output... " >&6; } +if test ${ac_cv_path_SED+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for ac_i in 1 2 3 4 5 6 7; do ac_script="$ac_script$as_nl$ac_script" @@ -4562,10 +5564,15 @@ else for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in sed gsed; do + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in sed gsed + do for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" + ac_path_SED="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_SED" || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED @@ -4574,13 +5581,13 @@ case `"$ac_path_SED" --version 2>&1` in ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; *) ac_count=0 - $as_echo_n 0123456789 >"conftest.in" + printf %s 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" - $as_echo '' >> "conftest.nl" + printf "%s\n" '' >> "conftest.nl" "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val @@ -4608,8 +5615,8 @@ else fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 -$as_echo "$ac_cv_path_SED" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 +printf "%s\n" "$ac_cv_path_SED" >&6; } SED="$ac_cv_path_SED" rm -f conftest.sed @@ -4626,11 +5633,12 @@ Xsed="$SED -e 1s/^X//" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 -$as_echo_n "checking for grep that handles long lines and -e... " >&6; } -if ${ac_cv_path_GREP+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 +printf %s "checking for grep that handles long lines and -e... " >&6; } +if test ${ac_cv_path_GREP+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST @@ -4638,10 +5646,15 @@ else for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in grep ggrep; do + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in grep ggrep + do for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + ac_path_GREP="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP @@ -4650,13 +5663,13 @@ case `"$ac_path_GREP" --version 2>&1` in ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 - $as_echo_n 0123456789 >"conftest.in" + printf %s 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" - $as_echo 'GREP' >> "conftest.nl" + printf "%s\n" 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val @@ -4684,16 +5697,17 @@ else fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 -$as_echo "$ac_cv_path_GREP" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 +printf "%s\n" "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 -$as_echo_n "checking for egrep... " >&6; } -if ${ac_cv_path_EGREP+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 +printf %s "checking for egrep... " >&6; } +if test ${ac_cv_path_EGREP+y} +then : + printf %s "(cached) " >&6 +else $as_nop if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else @@ -4704,10 +5718,15 @@ else for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in egrep; do + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in egrep + do for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + ac_path_EGREP="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP @@ -4716,13 +5735,13 @@ case `"$ac_path_EGREP" --version 2>&1` in ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 - $as_echo_n 0123456789 >"conftest.in" + printf %s 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" - $as_echo 'EGREP' >> "conftest.nl" + printf "%s\n" 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val @@ -4751,16 +5770,17 @@ fi fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 -$as_echo "$ac_cv_path_EGREP" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 +printf "%s\n" "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 -$as_echo_n "checking for fgrep... " >&6; } -if ${ac_cv_path_FGREP+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 +printf %s "checking for fgrep... " >&6; } +if test ${ac_cv_path_FGREP+y} +then : + printf %s "(cached) " >&6 +else $as_nop if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 then ac_cv_path_FGREP="$GREP -F" else @@ -4771,10 +5791,15 @@ else for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in fgrep; do + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in fgrep + do for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" + ac_path_FGREP="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_FGREP" || continue # Check for GNU ac_path_FGREP and select it if it is found. # Check for GNU $ac_path_FGREP @@ -4783,13 +5808,13 @@ case `"$ac_path_FGREP" --version 2>&1` in ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; *) ac_count=0 - $as_echo_n 0123456789 >"conftest.in" + printf %s 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" - $as_echo 'FGREP' >> "conftest.nl" + printf "%s\n" 'FGREP' >> "conftest.nl" "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val @@ -4818,8 +5843,8 @@ fi fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 -$as_echo "$ac_cv_path_FGREP" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 +printf "%s\n" "$ac_cv_path_FGREP" >&6; } FGREP="$ac_cv_path_FGREP" @@ -4844,19 +5869,20 @@ test -z "$GREP" && GREP=grep # Check whether --with-gnu-ld was given. -if test "${with_gnu_ld+set}" = set; then : +if test ${with_gnu_ld+y} +then : withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes -else +else $as_nop with_gnu_ld=no fi ac_prog=ld if test yes = "$GCC"; then # Check if gcc -print-prog-name=ld gives a path. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 -$as_echo_n "checking for ld used by $CC... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 +printf %s "checking for ld used by $CC... " >&6; } case $host in - *-*-mingw*) + *-*-mingw* | *-*-windows*) # gcc leaves a trailing carriage return, which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) @@ -4883,15 +5909,16 @@ $as_echo_n "checking for ld used by $CC... " >&6; } ;; esac elif test yes = "$with_gnu_ld"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 -$as_echo_n "checking for GNU ld... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 +printf %s "checking for GNU ld... " >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 -$as_echo_n "checking for non-GNU ld... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 +printf %s "checking for non-GNU ld... " >&6; } fi -if ${lt_cv_path_LD+:} false; then : - $as_echo_n "(cached) " >&6 -else +if test ${lt_cv_path_LD+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -z "$LD"; then lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do @@ -4920,18 +5947,19 @@ fi LD=$lt_cv_path_LD if test -n "$LD"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5 -$as_echo "$LD" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LD" >&5 +printf "%s\n" "$LD" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 -$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } -if ${lt_cv_prog_gnu_ld+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 +printf %s "checking if the linker ($LD) is GNU ld... " >&6; } +if test ${lt_cv_prog_gnu_ld+y} +then : + printf %s "(cached) " >&6 +else $as_nop # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &1 &5 -$as_echo "$lt_cv_prog_gnu_ld" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_gnu_ld" >&5 +printf "%s\n" "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld @@ -4954,11 +5982,12 @@ with_gnu_ld=$lt_cv_prog_gnu_ld -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 -$as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } -if ${lt_cv_path_NM+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 +printf %s "checking for BSD- or MS-compatible name lister (nm)... " >&6; } +if test ${lt_cv_path_NM+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM=$NM @@ -4980,16 +6009,16 @@ else # Tru64's nm complains that /dev/null is an invalid object file # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty case $build_os in - mingw*) lt_bad_file=conftest.nm/nofile ;; + mingw* | windows*) lt_bad_file=conftest.nm/nofile ;; *) lt_bad_file=/dev/null ;; esac - case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in + case `"$tmp_nm" -B $lt_bad_file 2>&1 | $SED '1q'` in *$lt_bad_file* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break 2 ;; *) - case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in + case `"$tmp_nm" -p /dev/null 2>&1 | $SED '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break 2 @@ -5008,8 +6037,8 @@ else : ${lt_cv_path_NM=no} fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 -$as_echo "$lt_cv_path_NM" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 +printf "%s\n" "$lt_cv_path_NM" >&6; } if test no != "$lt_cv_path_NM"; then NM=$lt_cv_path_NM else @@ -5022,11 +6051,12 @@ else do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_DUMPBIN+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_DUMPBIN+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$DUMPBIN"; then ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. else @@ -5034,11 +6064,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -5049,11 +6083,11 @@ fi fi DUMPBIN=$ac_cv_prog_DUMPBIN if test -n "$DUMPBIN"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 -$as_echo "$DUMPBIN" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 +printf "%s\n" "$DUMPBIN" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -5066,11 +6100,12 @@ if test -z "$DUMPBIN"; then do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_DUMPBIN+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_DUMPBIN"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. else @@ -5078,11 +6113,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -5093,11 +6132,11 @@ fi fi ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN if test -n "$ac_ct_DUMPBIN"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 -$as_echo "$ac_ct_DUMPBIN" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 +printf "%s\n" "$ac_ct_DUMPBIN" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -5109,15 +6148,15 @@ done else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DUMPBIN=$ac_ct_DUMPBIN fi fi - case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in + case `$DUMPBIN -symbols -headers /dev/null 2>&1 | $SED '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols -headers" ;; @@ -5138,11 +6177,12 @@ test -z "$NM" && NM=nm -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 -$as_echo_n "checking the name lister ($NM) interface... " >&6; } -if ${lt_cv_nm_interface+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 +printf %s "checking the name lister ($NM) interface... " >&6; } +if test ${lt_cv_nm_interface+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) @@ -5158,15 +6198,16 @@ else fi rm -f conftest* fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 -$as_echo "$lt_cv_nm_interface" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 +printf "%s\n" "$lt_cv_nm_interface" >&6; } # find the maximum length of command line arguments -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 -$as_echo_n "checking the maximum length of command line arguments... " >&6; } -if ${lt_cv_sys_max_cmd_len+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 +printf %s "checking the maximum length of command line arguments... " >&6; } +if test ${lt_cv_sys_max_cmd_len+y} +then : + printf %s "(cached) " >&6 +else $as_nop i=0 teststring=ABCD @@ -5186,7 +6227,7 @@ else lt_cv_sys_max_cmd_len=-1; ;; - cygwin* | mingw* | cegcc*) + cygwin* | mingw* | windows* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, @@ -5202,18 +6243,13 @@ else lt_cv_sys_max_cmd_len=8192; ;; - mint*) - # On MiNT this can take a long time and run out of memory. - lt_cv_sys_max_cmd_len=8192; - ;; - amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; - bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*) + darwin* | dragonfly* | freebsd* | midnightbsd* | netbsd* | openbsd*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` @@ -5256,7 +6292,7 @@ else sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then - lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` + lt_cv_sys_max_cmd_len=`echo $kargmax | $SED 's/.*[ ]//'` else lt_cv_sys_max_cmd_len=32768 fi @@ -5298,11 +6334,11 @@ else fi if test -n "$lt_cv_sys_max_cmd_len"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 -$as_echo "$lt_cv_sys_max_cmd_len" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 +printf "%s\n" "$lt_cv_sys_max_cmd_len" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 -$as_echo "none" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none" >&5 +printf "%s\n" "none" >&6; } fi max_cmd_len=$lt_cv_sys_max_cmd_len @@ -5346,15 +6382,16 @@ esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 -$as_echo_n "checking how to convert $build file names to $host format... " >&6; } -if ${lt_cv_to_host_file_cmd+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 +printf %s "checking how to convert $build file names to $host format... " >&6; } +if test ${lt_cv_to_host_file_cmd+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $host in *-*-mingw* ) case $build in - *-*-mingw* ) # actually msys + *-*-mingw* | *-*-windows* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) @@ -5367,7 +6404,7 @@ else ;; *-*-cygwin* ) case $build in - *-*-mingw* ) # actually msys + *-*-mingw* | *-*-windows* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) @@ -5386,24 +6423,25 @@ esac fi to_host_file_cmd=$lt_cv_to_host_file_cmd -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 -$as_echo "$lt_cv_to_host_file_cmd" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 +printf "%s\n" "$lt_cv_to_host_file_cmd" >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 -$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; } -if ${lt_cv_to_tool_file_cmd+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 +printf %s "checking how to convert $build file names to toolchain format... " >&6; } +if test ${lt_cv_to_tool_file_cmd+y} +then : + printf %s "(cached) " >&6 +else $as_nop #assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in - *-*-mingw* ) + *-*-mingw* | *-*-windows* ) case $build in - *-*-mingw* ) # actually msys + *-*-mingw* | *-*-windows* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac @@ -5413,22 +6451,23 @@ esac fi to_tool_file_cmd=$lt_cv_to_tool_file_cmd -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 -$as_echo "$lt_cv_to_tool_file_cmd" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 +printf "%s\n" "$lt_cv_to_tool_file_cmd" >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 -$as_echo_n "checking for $LD option to reload object files... " >&6; } -if ${lt_cv_ld_reload_flag+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 +printf %s "checking for $LD option to reload object files... " >&6; } +if test ${lt_cv_ld_reload_flag+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_ld_reload_flag='-r' fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 -$as_echo "$lt_cv_ld_reload_flag" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 +printf "%s\n" "$lt_cv_ld_reload_flag" >&6; } reload_flag=$lt_cv_ld_reload_flag case $reload_flag in "" | " "*) ;; @@ -5436,7 +6475,7 @@ case $reload_flag in esac reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in - cygwin* | mingw* | pw32* | cegcc*) + cygwin* | mingw* | windows* | pw32* | cegcc*) if test yes != "$GCC"; then reload_cmds=false fi @@ -5458,14 +6497,64 @@ esac +# Extract the first word of "file", so it can be a program name with args. +set dummy file; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_FILECMD+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$FILECMD"; then + ac_cv_prog_FILECMD="$FILECMD" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_FILECMD="file" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_prog_FILECMD" && ac_cv_prog_FILECMD=":" +fi +fi +FILECMD=$ac_cv_prog_FILECMD +if test -n "$FILECMD"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $FILECMD" >&5 +printf "%s\n" "$FILECMD" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + + + + + + if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. set dummy ${ac_tool_prefix}objdump; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_OBJDUMP+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_OBJDUMP+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$OBJDUMP"; then ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. else @@ -5473,11 +6562,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -5488,11 +6581,11 @@ fi fi OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 -$as_echo "$OBJDUMP" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 +printf "%s\n" "$OBJDUMP" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -5501,11 +6594,12 @@ if test -z "$ac_cv_prog_OBJDUMP"; then ac_ct_OBJDUMP=$OBJDUMP # Extract the first word of "objdump", so it can be a program name with args. set dummy objdump; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_OBJDUMP+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_OBJDUMP"; then ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. else @@ -5513,11 +6607,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OBJDUMP="objdump" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -5528,11 +6626,11 @@ fi fi ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP if test -n "$ac_ct_OBJDUMP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 -$as_echo "$ac_ct_OBJDUMP" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 +printf "%s\n" "$ac_ct_OBJDUMP" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_ct_OBJDUMP" = x; then @@ -5540,8 +6638,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OBJDUMP=$ac_ct_OBJDUMP @@ -5557,11 +6655,12 @@ test -z "$OBJDUMP" && OBJDUMP=objdump -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 -$as_echo_n "checking how to recognize dependent libraries... " >&6; } -if ${lt_cv_deplibs_check_method+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 +printf %s "checking how to recognize dependent libraries... " >&6; } +if test ${lt_cv_deplibs_check_method+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' @@ -5570,7 +6669,6 @@ lt_cv_deplibs_check_method='unknown' # 'none' -- dependencies not supported. # 'unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. -# 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path # that responds to the $file_magic_cmd with a given extended regex. # If you have 'file' or equivalent on your system and you're not sure @@ -5587,7 +6685,7 @@ beos*) bsdi[45]*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' - lt_cv_file_magic_cmd='/usr/bin/file -L' + lt_cv_file_magic_cmd='$FILECMD -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; @@ -5597,7 +6695,7 @@ cygwin*) lt_cv_file_magic_cmd='func_win32_libid' ;; -mingw* | pw32*) +mingw* | windows* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. @@ -5606,7 +6704,7 @@ mingw* | pw32*) lt_cv_file_magic_cmd='func_win32_libid' else # Keep this pattern in sync with the one in func_win32_libid. - lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' + lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64|pe-aarch64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; @@ -5621,14 +6719,14 @@ darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; -freebsd* | dragonfly*) +freebsd* | dragonfly* | midnightbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' - lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_cmd=$FILECMD lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac @@ -5642,7 +6740,7 @@ haiku*) ;; hpux10.20* | hpux11*) - lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_cmd=$FILECMD case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' @@ -5689,7 +6787,7 @@ netbsd*) newos6*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' - lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_cmd=$FILECMD lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; @@ -5697,7 +6795,7 @@ newos6*) lt_cv_deplibs_check_method=pass_all ;; -openbsd* | bitrig*) +openbsd*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' else @@ -5757,14 +6855,14 @@ os2*) esac fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 -$as_echo "$lt_cv_deplibs_check_method" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 +printf "%s\n" "$lt_cv_deplibs_check_method" >&6; } file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in - mingw* | pw32*) + mingw* | windows* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else @@ -5802,11 +6900,12 @@ test -z "$deplibs_check_method" && deplibs_check_method=unknown if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. set dummy ${ac_tool_prefix}dlltool; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_DLLTOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_DLLTOOL+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$DLLTOOL"; then ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. else @@ -5814,11 +6913,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -5829,11 +6932,11 @@ fi fi DLLTOOL=$ac_cv_prog_DLLTOOL if test -n "$DLLTOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 -$as_echo "$DLLTOOL" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 +printf "%s\n" "$DLLTOOL" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -5842,11 +6945,12 @@ if test -z "$ac_cv_prog_DLLTOOL"; then ac_ct_DLLTOOL=$DLLTOOL # Extract the first word of "dlltool", so it can be a program name with args. set dummy dlltool; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_DLLTOOL+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_DLLTOOL"; then ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. else @@ -5854,11 +6958,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DLLTOOL="dlltool" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -5869,11 +6977,11 @@ fi fi ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL if test -n "$ac_ct_DLLTOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 -$as_echo "$ac_ct_DLLTOOL" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 +printf "%s\n" "$ac_ct_DLLTOOL" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_ct_DLLTOOL" = x; then @@ -5881,8 +6989,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DLLTOOL=$ac_ct_DLLTOOL @@ -5899,15 +7007,16 @@ test -z "$DLLTOOL" && DLLTOOL=dlltool -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 -$as_echo_n "checking how to associate runtime and link libraries... " >&6; } -if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 +printf %s "checking how to associate runtime and link libraries... " >&6; } +if test ${lt_cv_sharedlib_from_linklib_cmd+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in -cygwin* | mingw* | pw32* | cegcc*) +cygwin* | mingw* | windows* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh; # decide which one to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in @@ -5926,8 +7035,8 @@ cygwin* | mingw* | pw32* | cegcc*) esac fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 -$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 +printf "%s\n" "$lt_cv_sharedlib_from_linklib_cmd" >&6; } sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO @@ -5937,16 +7046,119 @@ test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_RANLIB+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 +printf "%s\n" "$RANLIB" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_RANLIB"; then + ac_ct_RANLIB=$RANLIB + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_RANLIB+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_RANLIB"; then + ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_RANLIB="ranlib" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 +printf "%s\n" "$ac_ct_RANLIB" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_RANLIB" = x; then + RANLIB=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + RANLIB=$ac_ct_RANLIB + fi +else + RANLIB="$ac_cv_prog_RANLIB" +fi + if test -n "$ac_tool_prefix"; then for ac_prog in ar do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_AR+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_AR+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else @@ -5954,11 +7166,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_AR="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -5969,11 +7185,11 @@ fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 -$as_echo "$AR" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 +printf "%s\n" "$AR" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -5986,11 +7202,12 @@ if test -z "$AR"; then do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_AR+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_AR+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else @@ -5998,11 +7215,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AR="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6013,11 +7234,11 @@ fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 -$as_echo "$ac_ct_AR" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 +printf "%s\n" "$ac_ct_AR" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -6029,8 +7250,8 @@ done else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AR=$ac_ct_AR @@ -6038,42 +7259,60 @@ esac fi : ${AR=ar} -: ${AR_FLAGS=cru} +# Use ARFLAGS variable as AR's operation code to sync the variable naming with +# Automake. If both AR_FLAGS and ARFLAGS are specified, AR_FLAGS should have +# higher priority because that's what people were doing historically (setting +# ARFLAGS for automake and AR_FLAGS for libtool). FIXME: Make the AR_FLAGS +# variable obsoleted/removed. +test ${AR_FLAGS+y} || AR_FLAGS=${ARFLAGS-cr} +lt_ar_flags=$AR_FLAGS -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 -$as_echo_n "checking for archiver @FILE support... " >&6; } -if ${lt_cv_ar_at_file+:} false; then : - $as_echo_n "(cached) " >&6 -else + + +# Make AR_FLAGS overridable by 'make ARFLAGS='. Don't try to run-time override +# by AR_FLAGS because that was never working and AR_FLAGS is about to die. + + + + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 +printf %s "checking for archiver @FILE support... " >&6; } +if test ${lt_cv_ar_at_file+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_ar_at_file=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test 0 -eq "$ac_status"; then # Ensure the archiver fails upon bogus file names. @@ -6081,7 +7320,7 @@ if ac_fn_c_try_compile "$LINENO"; then : { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test 0 -ne "$ac_status"; then lt_cv_ar_at_file=@ @@ -6090,117 +7329,18 @@ if ac_fn_c_try_compile "$LINENO"; then : rm -f conftest.* libconftest.a fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 -$as_echo "$lt_cv_ar_at_file" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 +printf "%s\n" "$lt_cv_ar_at_file" >&6; } if test no = "$lt_cv_ar_at_file"; then - archiver_list_spec= -else - archiver_list_spec=$lt_cv_ar_at_file -fi - - - - - - - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. -set dummy ${ac_tool_prefix}strip; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_STRIP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$STRIP"; then - ac_cv_prog_STRIP="$STRIP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_STRIP="${ac_tool_prefix}strip" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -STRIP=$ac_cv_prog_STRIP -if test -n "$STRIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 -$as_echo "$STRIP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_STRIP"; then - ac_ct_STRIP=$STRIP - # Extract the first word of "strip", so it can be a program name with args. -set dummy strip; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_STRIP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_STRIP"; then - ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_STRIP="strip" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP -if test -n "$ac_ct_STRIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 -$as_echo "$ac_ct_STRIP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_STRIP" = x; then - STRIP=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - STRIP=$ac_ct_STRIP - fi + archiver_list_spec= else - STRIP="$ac_cv_prog_STRIP" + archiver_list_spec=$lt_cv_ar_at_file fi -test -z "$STRIP" && STRIP=: @@ -6208,25 +7348,30 @@ test -z "$STRIP" && STRIP=: if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. -set dummy ${ac_tool_prefix}ranlib; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_RANLIB+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$RANLIB"; then - ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_STRIP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6235,38 +7380,43 @@ IFS=$as_save_IFS fi fi -RANLIB=$ac_cv_prog_RANLIB -if test -n "$RANLIB"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 -$as_echo "$RANLIB" >&6; } +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +printf "%s\n" "$STRIP" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi fi -if test -z "$ac_cv_prog_RANLIB"; then - ac_ct_RANLIB=$RANLIB - # Extract the first word of "ranlib", so it can be a program name with args. -set dummy ranlib; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_RANLIB"; then - ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_STRIP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_RANLIB="ranlib" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_STRIP="strip" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6275,30 +7425,38 @@ IFS=$as_save_IFS fi fi -ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB -if test -n "$ac_ct_RANLIB"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 -$as_echo "$ac_ct_RANLIB" >&6; } +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +printf "%s\n" "$ac_ct_STRIP" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi - if test "x$ac_ct_RANLIB" = x; then - RANLIB=":" + if test "x$ac_ct_STRIP" = x; then + STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac - RANLIB=$ac_ct_RANLIB + STRIP=$ac_ct_STRIP fi else - RANLIB="$ac_cv_prog_RANLIB" + STRIP="$ac_cv_prog_STRIP" fi +test -z "$STRIP" && STRIP=: + + + + + + + test -z "$RANLIB" && RANLIB=: @@ -6312,15 +7470,8 @@ old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then - case $host_os in - bitrig* | openbsd*) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" - ;; - *) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" - ;; - esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in @@ -6379,11 +7530,12 @@ compiler=$CC # Check for command to grab the raw symbol name followed by C symbol from nm. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 -$as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } -if ${lt_cv_sys_global_symbol_pipe+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 +printf %s "checking command to parse $NM output from $compiler object... " >&6; } +if test ${lt_cv_sys_global_symbol_pipe+y} +then : + printf %s "(cached) " >&6 +else $as_nop # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] @@ -6399,7 +7551,7 @@ case $host_os in aix*) symcode='[BCDT]' ;; -cygwin* | mingw* | pw32* | cegcc*) +cygwin* | mingw* | windows* | pw32* | cegcc*) symcode='[ABCDGISTW]' ;; hpux*) @@ -6414,7 +7566,7 @@ osf*) symcode='[BCDEGQRST]' ;; solaris*) - symcode='[BDRT]' + symcode='[BCDRT]' ;; sco3.2v5*) symcode='[DT]' @@ -6438,7 +7590,7 @@ esac if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Gets list of data symbols to import. - lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'" + lt_cv_sys_global_symbol_to_import="$SED -n -e 's/^I .* \(.*\)$/\1/p'" # Adjust the below global symbol transforms to fixup imported variables. lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" @@ -6456,20 +7608,20 @@ fi # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. -lt_cv_sys_global_symbol_to_cdecl="sed -n"\ +lt_cv_sys_global_symbol_to_cdecl="$SED -n"\ $lt_cdecl_hook\ " -e 's/^T .* \(.*\)$/extern int \1();/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address -lt_cv_sys_global_symbol_to_c_name_address="sed -n"\ +lt_cv_sys_global_symbol_to_c_name_address="$SED -n"\ $lt_c_name_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" # Transform an extracted symbol line into symbol name with lib prefix and # symbol address. -lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\ +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="$SED -n"\ $lt_c_name_lib_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ @@ -6478,7 +7630,7 @@ $lt_c_name_lib_hook\ # Handle CRLF in mingw tool chain opt_cr= case $build_os in -mingw*) +mingw* | windows*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac @@ -6493,7 +7645,7 @@ for ac_symprfx in "" "_"; do if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function, # D for any global variable and I for any imported variable. - # Also find C++ and __fastcall symbols from MSVC++, + # Also find C++ and __fastcall symbols from MSVC++ or ICC, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK '"\ " {last_section=section; section=\$ 3};"\ @@ -6511,9 +7663,9 @@ for ac_symprfx in "" "_"; do " s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx" else - lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" + lt_cv_sys_global_symbol_pipe="$SED -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi - lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" + lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | $SED '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no @@ -6529,20 +7681,20 @@ void nm_test_func(void){} #ifdef __cplusplus } #endif -int main(){nm_test_var='a';nm_test_func();return(0);} +int main(void){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # Now try to grab the symbols. nlist=conftest.nm if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5 (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then @@ -6611,7 +7763,7 @@ _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest$ac_exeext; then pipe_works=yes fi @@ -6646,11 +7798,11 @@ if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 -$as_echo "failed" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: failed" >&5 +printf "%s\n" "failed" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 -$as_echo "ok" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ok" >&5 +printf "%s\n" "ok" >&6; } fi # Response file support. @@ -6696,13 +7848,14 @@ fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 -$as_echo_n "checking for sysroot... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 +printf %s "checking for sysroot... " >&6; } # Check whether --with-sysroot was given. -if test "${with_sysroot+set}" = set; then : +if test ${with_sysroot+y} +then : withval=$with_sysroot; -else +else $as_nop with_sysroot=no fi @@ -6711,33 +7864,36 @@ lt_sysroot= case $with_sysroot in #( yes) if test yes = "$GCC"; then - lt_sysroot=`$CC --print-sysroot 2>/dev/null` + # Trim trailing / since we'll always append absolute paths and we want + # to avoid //, if only for less confusing output for the user. + lt_sysroot=`$CC --print-sysroot 2>/dev/null | $SED 's:/\+$::'` fi ;; #( /*) - lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` + lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_sysroot" >&5 -$as_echo "$with_sysroot" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_sysroot" >&5 +printf "%s\n" "$with_sysroot" >&6; } as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 ;; esac - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 -$as_echo "${lt_sysroot:-no}" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 +printf "%s\n" "${lt_sysroot:-no}" >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a working dd" >&5 -$as_echo_n "checking for a working dd... " >&6; } -if ${ac_cv_path_lt_DD+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a working dd" >&5 +printf %s "checking for a working dd... " >&6; } +if test ${ac_cv_path_lt_DD+y} +then : + printf %s "(cached) " >&6 +else $as_nop printf 0123456789abcdef0123456789abcdef >conftest.i cat conftest.i conftest.i >conftest2.i : ${lt_DD:=$DD} @@ -6748,10 +7904,15 @@ if test -z "$lt_DD"; then for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in dd; do + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in dd + do for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_lt_DD="$as_dir/$ac_prog$ac_exec_ext" + ac_path_lt_DD="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_lt_DD" || continue if "$ac_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ @@ -6771,15 +7932,16 @@ fi rm -f conftest.i conftest2.i conftest.out fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_lt_DD" >&5 -$as_echo "$ac_cv_path_lt_DD" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_lt_DD" >&5 +printf "%s\n" "$ac_cv_path_lt_DD" >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to truncate binary pipes" >&5 -$as_echo_n "checking how to truncate binary pipes... " >&6; } -if ${lt_cv_truncate_bin+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to truncate binary pipes" >&5 +printf %s "checking how to truncate binary pipes... " >&6; } +if test ${lt_cv_truncate_bin+y} +then : + printf %s "(cached) " >&6 +else $as_nop printf 0123456789abcdef0123456789abcdef >conftest.i cat conftest.i conftest.i >conftest2.i lt_cv_truncate_bin= @@ -6790,8 +7952,8 @@ fi rm -f conftest.i conftest2.i conftest.out test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_truncate_bin" >&5 -$as_echo "$lt_cv_truncate_bin" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_truncate_bin" >&5 +printf "%s\n" "$lt_cv_truncate_bin" >&6; } @@ -6814,7 +7976,8 @@ func_cc_basename () } # Check whether --enable-libtool-lock was given. -if test "${enable_libtool_lock+set}" = set; then : +if test ${enable_libtool_lock+y} +then : enableval=$enable_libtool_lock; fi @@ -6830,9 +7993,9 @@ ia64-*-hpux*) if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE=32 ;; @@ -6850,10 +8013,10 @@ ia64-*-hpux*) if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then if test yes = "$lt_cv_prog_gnu_ld"; then - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; @@ -6865,7 +8028,7 @@ ia64-*-hpux*) ;; esac else - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; @@ -6888,10 +8051,10 @@ mips64*-*linux*) if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then emul=elf - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *32-bit*) emul="${emul}32" ;; @@ -6899,7 +8062,7 @@ mips64*-*linux*) emul="${emul}64" ;; esac - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *MSB*) emul="${emul}btsmip" ;; @@ -6907,7 +8070,7 @@ mips64*-*linux*) emul="${emul}ltsmip" ;; esac - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *N32*) emul="${emul}n32" ;; @@ -6918,7 +8081,7 @@ mips64*-*linux*) ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ -s390*-*linux*|s390*-*tpf*|sparc*-*linux*) +s390*-*linux*|s390*-*tpf*|sparc*-*linux*|x86_64-gnu*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. Note that the listed cases only cover the # situations where additional linker options are needed (such as when @@ -6929,16 +8092,16 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - case `/usr/bin/file conftest.o` in + case `$FILECMD conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; - x86_64-*linux*) - case `/usr/bin/file conftest.o` in + x86_64-*linux*|x86_64-gnu*) + case `$FILECMD conftest.o` in *x86-64*) LD="${LD-ld} -m elf32_x86_64" ;; @@ -6966,7 +8129,7 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; - x86_64-*linux*) + x86_64-*linux*|x86_64-gnu*) LD="${LD-ld} -m elf_x86_64" ;; powerpcle-*linux*|powerpc64le-*linux*) @@ -6992,11 +8155,12 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS=$CFLAGS CFLAGS="$CFLAGS -belf" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 -$as_echo_n "checking whether the C compiler needs -belf... " >&6; } -if ${lt_cv_cc_needs_belf+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 +printf %s "checking whether the C compiler needs -belf... " >&6; } +if test ${lt_cv_cc_needs_belf+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -7007,19 +8171,20 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : lt_cv_cc_needs_belf=yes -else +else $as_nop lt_cv_cc_needs_belf=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' @@ -7028,8 +8193,8 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 -$as_echo "$lt_cv_cc_needs_belf" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 +printf "%s\n" "$lt_cv_cc_needs_belf" >&6; } if test yes != "$lt_cv_cc_needs_belf"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS=$SAVE_CFLAGS @@ -7042,9 +8207,9 @@ $as_echo "$lt_cv_cc_needs_belf" >&6; } if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - case `/usr/bin/file conftest.o` in + case `$FILECMD conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) @@ -7079,11 +8244,12 @@ need_locks=$enable_libtool_lock if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. set dummy ${ac_tool_prefix}mt; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_MANIFEST_TOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_MANIFEST_TOOL+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$MANIFEST_TOOL"; then ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test. else @@ -7091,11 +8257,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -7106,11 +8276,11 @@ fi fi MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL if test -n "$MANIFEST_TOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 -$as_echo "$MANIFEST_TOOL" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 +printf "%s\n" "$MANIFEST_TOOL" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -7119,11 +8289,12 @@ if test -z "$ac_cv_prog_MANIFEST_TOOL"; then ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL # Extract the first word of "mt", so it can be a program name with args. set dummy mt; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_MANIFEST_TOOL+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_MANIFEST_TOOL"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test. else @@ -7131,11 +8302,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -7146,11 +8321,11 @@ fi fi ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL if test -n "$ac_ct_MANIFEST_TOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 -$as_echo "$ac_ct_MANIFEST_TOOL" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 +printf "%s\n" "$ac_ct_MANIFEST_TOOL" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_ct_MANIFEST_TOOL" = x; then @@ -7158,8 +8333,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL @@ -7169,23 +8344,24 @@ else fi test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 -$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } -if ${lt_cv_path_mainfest_tool+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_path_mainfest_tool=no +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 +printf %s "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } +if test ${lt_cv_path_manifest_tool+y} +then : + printf %s "(cached) " >&6 +else $as_nop + lt_cv_path_manifest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&5 if $GREP 'Manifest Tool' conftest.out > /dev/null; then - lt_cv_path_mainfest_tool=yes + lt_cv_path_manifest_tool=yes fi rm -f conftest* fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 -$as_echo "$lt_cv_path_mainfest_tool" >&6; } -if test yes != "$lt_cv_path_mainfest_tool"; then +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_manifest_tool" >&5 +printf "%s\n" "$lt_cv_path_manifest_tool" >&6; } +if test yes != "$lt_cv_path_manifest_tool"; then MANIFEST_TOOL=: fi @@ -7199,11 +8375,12 @@ fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_DSYMUTIL+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_DSYMUTIL+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$DSYMUTIL"; then ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. else @@ -7211,11 +8388,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -7226,11 +8407,11 @@ fi fi DSYMUTIL=$ac_cv_prog_DSYMUTIL if test -n "$DSYMUTIL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 -$as_echo "$DSYMUTIL" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 +printf "%s\n" "$DSYMUTIL" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -7239,11 +8420,12 @@ if test -z "$ac_cv_prog_DSYMUTIL"; then ac_ct_DSYMUTIL=$DSYMUTIL # Extract the first word of "dsymutil", so it can be a program name with args. set dummy dsymutil; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_DSYMUTIL+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_DSYMUTIL"; then ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. else @@ -7251,11 +8433,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -7266,11 +8452,11 @@ fi fi ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL if test -n "$ac_ct_DSYMUTIL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 -$as_echo "$ac_ct_DSYMUTIL" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 +printf "%s\n" "$ac_ct_DSYMUTIL" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_ct_DSYMUTIL" = x; then @@ -7278,8 +8464,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DSYMUTIL=$ac_ct_DSYMUTIL @@ -7291,11 +8477,12 @@ fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. set dummy ${ac_tool_prefix}nmedit; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_NMEDIT+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_NMEDIT+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$NMEDIT"; then ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. else @@ -7303,11 +8490,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -7318,11 +8509,11 @@ fi fi NMEDIT=$ac_cv_prog_NMEDIT if test -n "$NMEDIT"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 -$as_echo "$NMEDIT" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 +printf "%s\n" "$NMEDIT" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -7331,11 +8522,12 @@ if test -z "$ac_cv_prog_NMEDIT"; then ac_ct_NMEDIT=$NMEDIT # Extract the first word of "nmedit", so it can be a program name with args. set dummy nmedit; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_NMEDIT+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_NMEDIT"; then ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. else @@ -7343,11 +8535,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_NMEDIT="nmedit" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -7358,11 +8554,11 @@ fi fi ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT if test -n "$ac_ct_NMEDIT"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 -$as_echo "$ac_ct_NMEDIT" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 +printf "%s\n" "$ac_ct_NMEDIT" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_ct_NMEDIT" = x; then @@ -7370,8 +8566,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac NMEDIT=$ac_ct_NMEDIT @@ -7383,11 +8579,12 @@ fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. set dummy ${ac_tool_prefix}lipo; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_LIPO+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_LIPO+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$LIPO"; then ac_cv_prog_LIPO="$LIPO" # Let the user override the test. else @@ -7395,11 +8592,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_LIPO="${ac_tool_prefix}lipo" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -7410,11 +8611,11 @@ fi fi LIPO=$ac_cv_prog_LIPO if test -n "$LIPO"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 -$as_echo "$LIPO" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 +printf "%s\n" "$LIPO" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -7423,11 +8624,12 @@ if test -z "$ac_cv_prog_LIPO"; then ac_ct_LIPO=$LIPO # Extract the first word of "lipo", so it can be a program name with args. set dummy lipo; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_LIPO+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_LIPO+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_LIPO"; then ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test. else @@ -7435,11 +8637,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_LIPO="lipo" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -7450,11 +8656,11 @@ fi fi ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO if test -n "$ac_ct_LIPO"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 -$as_echo "$ac_ct_LIPO" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 +printf "%s\n" "$ac_ct_LIPO" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_ct_LIPO" = x; then @@ -7462,8 +8668,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac LIPO=$ac_ct_LIPO @@ -7475,11 +8681,12 @@ fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. set dummy ${ac_tool_prefix}otool; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_OTOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_OTOOL+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$OTOOL"; then ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. else @@ -7487,11 +8694,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL="${ac_tool_prefix}otool" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -7502,11 +8713,11 @@ fi fi OTOOL=$ac_cv_prog_OTOOL if test -n "$OTOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 -$as_echo "$OTOOL" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 +printf "%s\n" "$OTOOL" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -7515,11 +8726,12 @@ if test -z "$ac_cv_prog_OTOOL"; then ac_ct_OTOOL=$OTOOL # Extract the first word of "otool", so it can be a program name with args. set dummy otool; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_OTOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_OTOOL+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_OTOOL"; then ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. else @@ -7527,11 +8739,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL="otool" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -7542,11 +8758,11 @@ fi fi ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL if test -n "$ac_ct_OTOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 -$as_echo "$ac_ct_OTOOL" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 +printf "%s\n" "$ac_ct_OTOOL" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_ct_OTOOL" = x; then @@ -7554,8 +8770,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL=$ac_ct_OTOOL @@ -7567,11 +8783,12 @@ fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. set dummy ${ac_tool_prefix}otool64; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_OTOOL64+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_OTOOL64+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$OTOOL64"; then ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test. else @@ -7579,11 +8796,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -7594,11 +8815,11 @@ fi fi OTOOL64=$ac_cv_prog_OTOOL64 if test -n "$OTOOL64"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 -$as_echo "$OTOOL64" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 +printf "%s\n" "$OTOOL64" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -7607,11 +8828,12 @@ if test -z "$ac_cv_prog_OTOOL64"; then ac_ct_OTOOL64=$OTOOL64 # Extract the first word of "otool64", so it can be a program name with args. set dummy otool64; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_OTOOL64+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_OTOOL64"; then ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test. else @@ -7619,11 +8841,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL64="otool64" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -7634,11 +8860,11 @@ fi fi ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 if test -n "$ac_ct_OTOOL64"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 -$as_echo "$ac_ct_OTOOL64" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 +printf "%s\n" "$ac_ct_OTOOL64" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_ct_OTOOL64" = x; then @@ -7646,8 +8872,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL64=$ac_ct_OTOOL64 @@ -7682,11 +8908,12 @@ fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 -$as_echo_n "checking for -single_module linker flag... " >&6; } -if ${lt_cv_apple_cc_single_mod+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 +printf %s "checking for -single_module linker flag... " >&6; } +if test ${lt_cv_apple_cc_single_mod+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_apple_cc_single_mod=no if test -z "$LT_MULTI_MODULE"; then # By default we will add the -single_module flag. You can override @@ -7715,14 +8942,52 @@ else rm -f conftest.* fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 -$as_echo "$lt_cv_apple_cc_single_mod" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 +printf "%s\n" "$lt_cv_apple_cc_single_mod" >&6; } + + # Feature test to disable chained fixups since it is not + # compatible with '-undefined dynamic_lookup' + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -no_fixup_chains linker flag" >&5 +printf %s "checking for -no_fixup_chains linker flag... " >&6; } +if test ${lt_cv_support_no_fixup_chains+y} +then : + printf %s "(cached) " >&6 +else $as_nop + save_LDFLAGS=$LDFLAGS + LDFLAGS="$LDFLAGS -Wl,-no_fixup_chains" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + lt_cv_support_no_fixup_chains=yes +else $as_nop + lt_cv_support_no_fixup_chains=no + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$save_LDFLAGS - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 -$as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } -if ${lt_cv_ld_exported_symbols_list+:} false; then : - $as_echo_n "(cached) " >&6 -else + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_support_no_fixup_chains" >&5 +printf "%s\n" "$lt_cv_support_no_fixup_chains" >&6; } + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 +printf %s "checking for -exported_symbols_list linker flag... " >&6; } +if test ${lt_cv_ld_exported_symbols_list+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym @@ -7731,43 +8996,45 @@ else /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : lt_cv_ld_exported_symbols_list=yes -else +else $as_nop lt_cv_ld_exported_symbols_list=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 -$as_echo "$lt_cv_ld_exported_symbols_list" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 +printf "%s\n" "$lt_cv_ld_exported_symbols_list" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 -$as_echo_n "checking for -force_load linker flag... " >&6; } -if ${lt_cv_ld_force_load+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 +printf %s "checking for -force_load linker flag... " >&6; } +if test ${lt_cv_ld_force_load+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 - echo "$AR cru libconftest.a conftest.o" >&5 - $AR cru libconftest.a conftest.o 2>&5 + echo "$AR $AR_FLAGS libconftest.a conftest.o" >&5 + $AR $AR_FLAGS libconftest.a conftest.o 2>&5 echo "$RANLIB libconftest.a" >&5 $RANLIB libconftest.a 2>&5 cat > conftest.c << _LT_EOF -int main() { return 0;} +int main(void) { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err @@ -7783,24 +9050,23 @@ _LT_EOF rm -rf conftest.dSYM fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 -$as_echo "$lt_cv_ld_force_load" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 +printf "%s\n" "$lt_cv_ld_force_load" >&6; } case $host_os in rhapsody* | darwin1.[012]) _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; - darwin*) # darwin 5.x on - # if running on 10.5 or later, the deployment target defaults - # to the OS version, if on x86, and 10.4, the deployment - # target defaults to 10.4. Don't you love it? - case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in - 10.0,*86*-darwin8*|10.0,*-darwin[91]*) - _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; - 10.[012][,.]*) - _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; - 10.*) - _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; + darwin*) + case $MACOSX_DEPLOYMENT_TARGET,$host in + 10.[012],*|,*powerpc*-darwin[5-8]*) + _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; + *) + _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' + if test yes = "$lt_cv_support_no_fixup_chains"; then + as_fn_append _lt_dar_allow_undefined ' $wl-no_fixup_chains' + fi + ;; esac ;; esac @@ -7852,289 +9118,46 @@ func_munge_path_list () *) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\" ;; - esac -} - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 -$as_echo_n "checking how to run the C preprocessor... " >&6; } -# On Suns, sometimes $CPP names a directory. -if test -n "$CPP" && test -d "$CPP"; then - CPP= -fi -if test -z "$CPP"; then - if ${ac_cv_prog_CPP+:} false; then : - $as_echo_n "(cached) " >&6 -else - # Double quotes because CPP needs to be expanded - for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" - do - ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - -else - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.i conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - # Broken: success on invalid input. -continue -else - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.i conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : - break -fi - - done - ac_cv_prog_CPP=$CPP - -fi - CPP=$ac_cv_prog_CPP -else - ac_cv_prog_CPP=$CPP -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 -$as_echo "$CPP" >&6; } -ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - -else - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.i conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - # Broken: success on invalid input. -continue -else - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.i conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : - -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details" "$LINENO" 5; } -fi - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 -$as_echo_n "checking for ANSI C header files... " >&6; } -if ${ac_cv_header_stdc+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#include -#include - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_header_stdc=yes -else - ac_cv_header_stdc=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then : - -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then : - -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi + esac +} -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then : - : -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#if ((' ' & 0x0FF) == 0x020) -# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#else -# define ISLOWER(c) \ - (('a' <= (c) && (c) <= 'i') \ - || ('j' <= (c) && (c) <= 'r') \ - || ('s' <= (c) && (c) <= 'z')) -# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) -#endif +ac_header= ac_cache= +for ac_item in $ac_header_c_list +do + if test $ac_cache; then + ac_fn_c_check_header_compile "$LINENO" $ac_header ac_cv_header_$ac_cache "$ac_includes_default" + if eval test \"x\$ac_cv_header_$ac_cache\" = xyes; then + printf "%s\n" "#define $ac_item 1" >> confdefs.h + fi + ac_header= ac_cache= + elif test $ac_header; then + ac_cache=$ac_item + else + ac_header=$ac_item + fi +done -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) -int -main () -{ - int i; - for (i = 0; i < 256; i++) - if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) - return 2; - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : -else - ac_cv_header_stdc=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi -fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 -$as_echo "$ac_cv_header_stdc" >&6; } -if test $ac_cv_header_stdc = yes; then -$as_echo "#define STDC_HEADERS 1" >>confdefs.h -fi -# On IRIX 5.3, sys/types and inttypes.h are conflicting. -for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ - inttypes.h stdint.h unistd.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default -" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF -fi -done +if test $ac_cv_header_stdlib_h = yes && test $ac_cv_header_string_h = yes +then : +printf "%s\n" "#define STDC_HEADERS 1" >>confdefs.h -for ac_header in dlfcn.h -do : - ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default +fi +ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default " -if test "x$ac_cv_header_dlfcn_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_DLFCN_H 1 -_ACEOF +if test "x$ac_cv_header_dlfcn_h" = xyes +then : + printf "%s\n" "#define HAVE_DLFCN_H 1" >>confdefs.h fi -done - @@ -8143,15 +9166,16 @@ done enable_win32_dll=yes case $host in -*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) +*-*-cygwin* | *-*-mingw* | *-*-windows* | *-*-pw32* | *-*-cegcc*) if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. set dummy ${ac_tool_prefix}as; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_AS+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_AS+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$AS"; then ac_cv_prog_AS="$AS" # Let the user override the test. else @@ -8159,11 +9183,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_AS="${ac_tool_prefix}as" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -8174,11 +9202,11 @@ fi fi AS=$ac_cv_prog_AS if test -n "$AS"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AS" >&5 -$as_echo "$AS" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AS" >&5 +printf "%s\n" "$AS" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -8187,11 +9215,12 @@ if test -z "$ac_cv_prog_AS"; then ac_ct_AS=$AS # Extract the first word of "as", so it can be a program name with args. set dummy as; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_AS+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_AS+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_AS"; then ac_cv_prog_ac_ct_AS="$ac_ct_AS" # Let the user override the test. else @@ -8199,11 +9228,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AS="as" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -8214,11 +9247,11 @@ fi fi ac_ct_AS=$ac_cv_prog_ac_ct_AS if test -n "$ac_ct_AS"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AS" >&5 -$as_echo "$ac_ct_AS" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AS" >&5 +printf "%s\n" "$ac_ct_AS" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_ct_AS" = x; then @@ -8226,8 +9259,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AS=$ac_ct_AS @@ -8239,11 +9272,12 @@ fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. set dummy ${ac_tool_prefix}dlltool; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_DLLTOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_DLLTOOL+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$DLLTOOL"; then ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. else @@ -8251,11 +9285,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -8266,11 +9304,11 @@ fi fi DLLTOOL=$ac_cv_prog_DLLTOOL if test -n "$DLLTOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 -$as_echo "$DLLTOOL" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 +printf "%s\n" "$DLLTOOL" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -8279,11 +9317,12 @@ if test -z "$ac_cv_prog_DLLTOOL"; then ac_ct_DLLTOOL=$DLLTOOL # Extract the first word of "dlltool", so it can be a program name with args. set dummy dlltool; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_DLLTOOL+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_DLLTOOL"; then ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. else @@ -8291,11 +9330,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DLLTOOL="dlltool" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -8306,11 +9349,11 @@ fi fi ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL if test -n "$ac_ct_DLLTOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 -$as_echo "$ac_ct_DLLTOOL" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 +printf "%s\n" "$ac_ct_DLLTOOL" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_ct_DLLTOOL" = x; then @@ -8318,8 +9361,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DLLTOOL=$ac_ct_DLLTOOL @@ -8331,11 +9374,12 @@ fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. set dummy ${ac_tool_prefix}objdump; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_OBJDUMP+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_OBJDUMP+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$OBJDUMP"; then ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. else @@ -8343,11 +9387,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -8358,11 +9406,11 @@ fi fi OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 -$as_echo "$OBJDUMP" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 +printf "%s\n" "$OBJDUMP" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -8371,11 +9419,12 @@ if test -z "$ac_cv_prog_OBJDUMP"; then ac_ct_OBJDUMP=$OBJDUMP # Extract the first word of "objdump", so it can be a program name with args. set dummy objdump; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_OBJDUMP+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_OBJDUMP"; then ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. else @@ -8383,11 +9432,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OBJDUMP="objdump" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -8398,11 +9451,11 @@ fi fi ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP if test -n "$ac_ct_OBJDUMP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 -$as_echo "$ac_ct_OBJDUMP" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 +printf "%s\n" "$ac_ct_OBJDUMP" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_ct_OBJDUMP" = x; then @@ -8410,8 +9463,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OBJDUMP=$ac_ct_OBJDUMP @@ -8448,7 +9501,8 @@ test -z "$OBJDUMP" && OBJDUMP=objdump # Check whether --enable-shared was given. -if test "${enable_shared+set}" = set; then : +if test ${enable_shared+y} +then : enableval=$enable_shared; p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; @@ -8466,7 +9520,7 @@ if test "${enable_shared+set}" = set; then : IFS=$lt_save_ifs ;; esac -else +else $as_nop enable_shared=yes fi @@ -8479,7 +9533,8 @@ fi # Check whether --enable-static was given. -if test "${enable_static+set}" = set; then : +if test ${enable_static+y} +then : enableval=$enable_static; p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; @@ -8497,7 +9552,7 @@ if test "${enable_static+set}" = set; then : IFS=$lt_save_ifs ;; esac -else +else $as_nop enable_static=yes fi @@ -8509,30 +9564,53 @@ fi - -# Check whether --with-pic was given. -if test "${with_pic+set}" = set; then : + # Check whether --enable-pic was given. +if test ${enable_pic+y} +then : + enableval=$enable_pic; lt_p=${PACKAGE-default} + case $enableval in + yes|no) pic_mode=$enableval ;; + *) + pic_mode=default + # Look at the argument we got. We use all the common list separators. + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, + for lt_pkg in $enableval; do + IFS=$lt_save_ifs + if test "X$lt_pkg" = "X$lt_p"; then + pic_mode=yes + fi + done + IFS=$lt_save_ifs + ;; + esac +else $as_nop + # Check whether --with-pic was given. +if test ${with_pic+y} +then : withval=$with_pic; lt_p=${PACKAGE-default} - case $withval in - yes|no) pic_mode=$withval ;; - *) - pic_mode=default - # Look at the argument we got. We use all the common list separators. - lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, - for lt_pkg in $withval; do - IFS=$lt_save_ifs - if test "X$lt_pkg" = "X$lt_p"; then - pic_mode=yes - fi - done - IFS=$lt_save_ifs - ;; - esac -else + case $withval in + yes|no) pic_mode=$withval ;; + *) + pic_mode=default + # Look at the argument we got. We use all the common list separators. + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, + for lt_pkg in $withval; do + IFS=$lt_save_ifs + if test "X$lt_pkg" = "X$lt_p"; then + pic_mode=yes + fi + done + IFS=$lt_save_ifs + ;; + esac +else $as_nop pic_mode=default fi +fi + + @@ -8540,7 +9618,8 @@ fi # Check whether --enable-fast-install was given. -if test "${enable_fast_install+set}" = set; then : +if test ${enable_fast_install+y} +then : enableval=$enable_fast_install; p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; @@ -8558,7 +9637,7 @@ if test "${enable_fast_install+set}" = set; then : IFS=$lt_save_ifs ;; esac -else +else $as_nop enable_fast_install=yes fi @@ -8572,31 +9651,47 @@ fi shared_archive_member_spec= case $host,$enable_shared in power*-*-aix[5-9]*,yes) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking which variant of shared library versioning to provide" >&5 -$as_echo_n "checking which variant of shared library versioning to provide... " >&6; } - -# Check whether --with-aix-soname was given. -if test "${with_aix_soname+set}" = set; then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking which variant of shared library versioning to provide" >&5 +printf %s "checking which variant of shared library versioning to provide... " >&6; } + # Check whether --enable-aix-soname was given. +if test ${enable_aix_soname+y} +then : + enableval=$enable_aix_soname; case $enableval in + aix|svr4|both) + ;; + *) + as_fn_error $? "Unknown argument to --enable-aix-soname" "$LINENO" 5 + ;; + esac + lt_cv_with_aix_soname=$enable_aix_soname +else $as_nop + # Check whether --with-aix-soname was given. +if test ${with_aix_soname+y} +then : withval=$with_aix_soname; case $withval in - aix|svr4|both) - ;; - *) - as_fn_error $? "Unknown argument to --with-aix-soname" "$LINENO" 5 - ;; - esac - lt_cv_with_aix_soname=$with_aix_soname -else - if ${lt_cv_with_aix_soname+:} false; then : - $as_echo_n "(cached) " >&6 -else + aix|svr4|both) + ;; + *) + as_fn_error $? "Unknown argument to --with-aix-soname" "$LINENO" 5 + ;; + esac + lt_cv_with_aix_soname=$with_aix_soname +else $as_nop + if test ${lt_cv_with_aix_soname+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_with_aix_soname=aix fi - with_aix_soname=$lt_cv_with_aix_soname fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_aix_soname" >&5 -$as_echo "$with_aix_soname" >&6; } + enable_aix_soname=$lt_cv_with_aix_soname +fi + + with_aix_soname=$enable_aix_soname + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_aix_soname" >&5 +printf "%s\n" "$with_aix_soname" >&6; } if test aix != "$with_aix_soname"; then # For the AIX way of multilib, we name the shared archive member # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o', @@ -8678,11 +9773,12 @@ if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 -$as_echo_n "checking for objdir... " >&6; } -if ${lt_cv_objdir+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 +printf %s "checking for objdir... " >&6; } +if test ${lt_cv_objdir+y} +then : + printf %s "(cached) " >&6 +else $as_nop rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then @@ -8693,17 +9789,15 @@ else fi rmdir .libs 2>/dev/null fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 -$as_echo "$lt_cv_objdir" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 +printf "%s\n" "$lt_cv_objdir" >&6; } objdir=$lt_cv_objdir -cat >>confdefs.h <<_ACEOF -#define LT_OBJDIR "$lt_cv_objdir/" -_ACEOF +printf "%s\n" "#define LT_OBJDIR \"$lt_cv_objdir/\"" >>confdefs.h @@ -8724,8 +9818,8 @@ esac ofile=libtool can_build_shared=yes -# All known linkers require a '.a' archive for static linking (except MSVC, -# which needs '.lib'). +# All known linkers require a '.a' archive for static linking (except MSVC and +# ICC, which need '.lib'). libext=a with_gnu_ld=$lt_cv_prog_gnu_ld @@ -8749,11 +9843,12 @@ test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 -$as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } -if ${lt_cv_path_MAGIC_CMD+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 +printf %s "checking for ${ac_tool_prefix}file... " >&6; } +if test ${lt_cv_path_MAGIC_CMD+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. @@ -8802,11 +9897,11 @@ fi MAGIC_CMD=$lt_cv_path_MAGIC_CMD if test -n "$MAGIC_CMD"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 -$as_echo "$MAGIC_CMD" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 +printf "%s\n" "$MAGIC_CMD" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -8815,11 +9910,12 @@ fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 -$as_echo_n "checking for file... " >&6; } -if ${lt_cv_path_MAGIC_CMD+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for file" >&5 +printf %s "checking for file... " >&6; } +if test ${lt_cv_path_MAGIC_CMD+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. @@ -8868,11 +9964,11 @@ fi MAGIC_CMD=$lt_cv_path_MAGIC_CMD if test -n "$MAGIC_CMD"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 -$as_echo "$MAGIC_CMD" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 +printf "%s\n" "$MAGIC_CMD" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -8906,7 +10002,7 @@ objext=$objext lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests -lt_simple_link_test_code='int main(){return(0);}' +lt_simple_link_test_code='int main(void){return(0);}' @@ -8957,11 +10053,12 @@ if test yes = "$GCC"; then lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; esac - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 -$as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } -if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 +printf %s "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } +if test ${lt_cv_prog_compiler_rtti_exceptions+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext @@ -8992,8 +10089,8 @@ else $RM conftest* fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 -$as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 +printf "%s\n" "$lt_cv_prog_compiler_rtti_exceptions" >&6; } if test yes = "$lt_cv_prog_compiler_rtti_exceptions"; then lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" @@ -9046,7 +10143,7 @@ lt_prog_compiler_static= # PIC is the default for these OSes. ;; - mingw* | cygwin* | pw32* | os2* | cegcc*) + mingw* | windows* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style @@ -9149,7 +10246,7 @@ lt_prog_compiler_static= esac ;; - mingw* | cygwin* | pw32* | os2* | cegcc*) + mingw* | windows* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' @@ -9190,6 +10287,12 @@ lt_prog_compiler_static= lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-static' ;; + *flang* | ftn) + # Flang compiler. + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fPIC' + lt_prog_compiler_static='-static' + ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) @@ -9234,7 +10337,7 @@ lt_prog_compiler_static= lt_prog_compiler_static='-qstaticlink' ;; *) - case `$CC -V 2>&1 | sed 5q` in + case `$CC -V 2>&1 | $SED 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker lt_prog_compiler_pic='-KPIC' @@ -9350,26 +10453,28 @@ case $host_os in ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 -$as_echo_n "checking for $compiler option to produce PIC... " >&6; } -if ${lt_cv_prog_compiler_pic+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 +printf %s "checking for $compiler option to produce PIC... " >&6; } +if test ${lt_cv_prog_compiler_pic+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_prog_compiler_pic=$lt_prog_compiler_pic fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 -$as_echo "$lt_cv_prog_compiler_pic" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 +printf "%s\n" "$lt_cv_prog_compiler_pic" >&6; } lt_prog_compiler_pic=$lt_cv_prog_compiler_pic # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 -$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } -if ${lt_cv_prog_compiler_pic_works+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 +printf %s "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } +if test ${lt_cv_prog_compiler_pic_works+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_prog_compiler_pic_works=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext @@ -9400,8 +10505,8 @@ else $RM conftest* fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 -$as_echo "$lt_cv_prog_compiler_pic_works" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 +printf "%s\n" "$lt_cv_prog_compiler_pic_works" >&6; } if test yes = "$lt_cv_prog_compiler_pic_works"; then case $lt_prog_compiler_pic in @@ -9429,11 +10534,12 @@ fi # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 -$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } -if ${lt_cv_prog_compiler_static_works+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +printf %s "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } +if test ${lt_cv_prog_compiler_static_works+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_prog_compiler_static_works=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS $lt_tmp_static_flag" @@ -9457,8 +10563,8 @@ else LDFLAGS=$save_LDFLAGS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 -$as_echo "$lt_cv_prog_compiler_static_works" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 +printf "%s\n" "$lt_cv_prog_compiler_static_works" >&6; } if test yes = "$lt_cv_prog_compiler_static_works"; then : @@ -9472,11 +10578,12 @@ fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 -$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } -if ${lt_cv_prog_compiler_c_o+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +printf %s "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if test ${lt_cv_prog_compiler_c_o+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest @@ -9519,19 +10626,20 @@ else $RM conftest* fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 -$as_echo "$lt_cv_prog_compiler_c_o" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 +printf "%s\n" "$lt_cv_prog_compiler_c_o" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 -$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } -if ${lt_cv_prog_compiler_c_o+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +printf %s "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if test ${lt_cv_prog_compiler_c_o+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest @@ -9574,8 +10682,8 @@ else $RM conftest* fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 -$as_echo "$lt_cv_prog_compiler_c_o" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 +printf "%s\n" "$lt_cv_prog_compiler_c_o" >&6; } @@ -9583,19 +10691,19 @@ $as_echo "$lt_cv_prog_compiler_c_o" >&6; } hard_links=nottested if test no = "$lt_cv_prog_compiler_c_o" && test no != "$need_locks"; then # do not overwrite the value of need_locks provided by the user - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 -$as_echo_n "checking if we can lock with hard links... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 +printf %s "checking if we can lock with hard links... " >&6; } hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 -$as_echo "$hard_links" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 +printf "%s\n" "$hard_links" >&6; } if test no = "$hard_links"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5 -$as_echo "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5 +printf "%s\n" "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;} need_locks=warn fi else @@ -9607,8 +10715,8 @@ fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 -$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +printf %s "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } runpath_var= allow_undefined_flag= @@ -9651,19 +10759,19 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie extract_expsyms_cmds= case $host_os in - cygwin* | mingw* | pw32* | cegcc*) - # FIXME: the MSVC++ port hasn't been tested in a loooong time + cygwin* | mingw* | windows* | pw32* | cegcc*) + # FIXME: the MSVC++ and ICC port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. + # Microsoft Visual C++ or Intel C++ Compiler. if test yes != "$GCC"; then with_gnu_ld=no fi ;; interix*) - # we just hope/assume this is gcc and not c89 (= MSVC++) + # we just hope/assume this is gcc and not c89 (= MSVC++ or ICC) with_gnu_ld=yes ;; - openbsd* | bitrig*) + openbsd*) with_gnu_ld=no ;; esac @@ -9712,7 +10820,7 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie whole_archive_flag_spec= fi supports_anon_versioning=no - case `$LD -v | $SED -e 's/(^)\+)\s\+//' 2>&1` in + case `$LD -v | $SED -e 's/([^)]\+)\s\+//' 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... @@ -9766,7 +10874,7 @@ _LT_EOF fi ;; - cygwin* | mingw* | pw32* | cegcc*) + cygwin* | mingw* | windows* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' @@ -9822,8 +10930,9 @@ _LT_EOF cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' - old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' + old_archive_from_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes=yes + file_list_spec='@' ;; interix[3-9]*) @@ -9838,7 +10947,7 @@ _LT_EOF # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - archive_expsym_cmds='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds='$SED "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) @@ -9881,7 +10990,7 @@ _LT_EOF compiler_needs_object=yes ;; esac - case `$CC -V 2>&1 | sed 5q` in + case `$CC -V 2>&1 | $SED 5q` in *Sun\ C*) # Sun C 5.9 whole_archive_flag_spec='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' compiler_needs_object=yes @@ -9893,7 +11002,7 @@ _LT_EOF if test yes = "$supports_anon_versioning"; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi @@ -9909,7 +11018,7 @@ _LT_EOF archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test yes = "$supports_anon_versioning"; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi @@ -10041,7 +11150,7 @@ _LT_EOF if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else - export_symbols_cmds='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' + export_symbols_cmds='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no @@ -10163,21 +11272,23 @@ _LT_EOF if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else - if ${lt_cv_aix_libpath_+:} false; then : - $as_echo_n "(cached) " >&6 -else + if test ${lt_cv_aix_libpath_+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { @@ -10192,7 +11303,7 @@ if ac_fn_c_try_link "$LINENO"; then : lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=/usr/lib:/lib @@ -10216,21 +11327,23 @@ fi if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else - if ${lt_cv_aix_libpath_+:} false; then : - $as_echo_n "(cached) " >&6 -else + if test ${lt_cv_aix_libpath_+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { @@ -10245,7 +11358,7 @@ if ac_fn_c_try_link "$LINENO"; then : lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=/usr/lib:/lib @@ -10306,14 +11419,14 @@ fi export_dynamic_flag_spec=-rdynamic ;; - cygwin* | mingw* | pw32* | cegcc*) + cygwin* | mingw* | windows* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. + # Microsoft Visual C++ or Intel C++ Compiler. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in - cl*) - # Native MSVC + cl* | icl*) + # Native MSVC or ICC hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported always_export_symbols=yes @@ -10323,14 +11436,14 @@ fi # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. - archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' + archive_cmds='$CC -Fe $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then cp "$export_symbols" "$output_objdir/$soname.def"; echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; else $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; fi~ - $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + $CC -Fe $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, )='true' @@ -10354,7 +11467,7 @@ fi fi' ;; *) - # Assume MSVC wrapper + # Assume MSVC and ICC wrapper hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported # Tell ltmain to make .lib files, not .a files. @@ -10395,8 +11508,8 @@ fi output_verbose_link_cmd=func_echo_all archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" - archive_expsym_cmds="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" - module_expsym_cmds="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" + archive_expsym_cmds="$SED 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" + module_expsym_cmds="$SED -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" else ld_shlibs=no @@ -10430,7 +11543,7 @@ fi ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. - freebsd* | dragonfly*) + freebsd* | dragonfly* | midnightbsd*) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes @@ -10496,11 +11609,12 @@ fi # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 -$as_echo_n "checking if $CC understands -b... " >&6; } -if ${lt_cv_prog_compiler__b+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 +printf %s "checking if $CC understands -b... " >&6; } +if test ${lt_cv_prog_compiler__b+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_prog_compiler__b=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -b" @@ -10524,8 +11638,8 @@ else LDFLAGS=$save_LDFLAGS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 -$as_echo "$lt_cv_prog_compiler__b" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 +printf "%s\n" "$lt_cv_prog_compiler__b" >&6; } if test yes = "$lt_cv_prog_compiler__b"; then archive_cmds='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' @@ -10565,28 +11679,30 @@ fi # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 -$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } -if ${lt_cv_irix_exported_symbol+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 +printf %s "checking whether the $host_os linker accepts -exported_symbol... " >&6; } +if test ${lt_cv_irix_exported_symbol+y} +then : + printf %s "(cached) " >&6 +else $as_nop save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int foo (void) { return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : lt_cv_irix_exported_symbol=yes -else +else $as_nop lt_cv_irix_exported_symbol=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 -$as_echo "$lt_cv_irix_exported_symbol" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 +printf "%s\n" "$lt_cv_irix_exported_symbol" >&6; } if test yes = "$lt_cv_irix_exported_symbol"; then archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib' fi @@ -10633,7 +11749,7 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; } *nto* | *qnx*) ;; - openbsd* | bitrig*) + openbsd*) if test -f /usr/libexec/ld.so; then hardcode_direct=yes hardcode_shlibpath_var=no @@ -10676,8 +11792,9 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; } cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' - old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' + old_archive_from_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes=yes + file_list_spec='@' ;; osf3*) @@ -10866,8 +11983,8 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; } fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 -$as_echo "$ld_shlibs" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 +printf "%s\n" "$ld_shlibs" >&6; } test no = "$ld_shlibs" && can_build_shared=no with_gnu_ld=$with_gnu_ld @@ -10903,18 +12020,19 @@ x|xyes) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 -$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } -if ${lt_cv_archive_cmds_need_lc+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 +printf %s "checking whether -lc should be explicitly linked in... " >&6; } +if test ${lt_cv_archive_cmds_need_lc+y} +then : + printf %s "(cached) " >&6 +else $as_nop $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then soname=conftest lib=conftest @@ -10932,7 +12050,7 @@ else if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then lt_cv_archive_cmds_need_lc=no @@ -10946,8 +12064,8 @@ else $RM conftest* fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 -$as_echo "$lt_cv_archive_cmds_need_lc" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 +printf "%s\n" "$lt_cv_archive_cmds_need_lc" >&6; } archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc ;; esac @@ -11106,8 +12224,8 @@ esac - { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 -$as_echo_n "checking dynamic linker characteristics... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 +printf %s "checking dynamic linker characteristics... " >&6; } if test yes = "$GCC"; then case $host_os in @@ -11115,7 +12233,7 @@ if test yes = "$GCC"; then *) lt_awk_arg='/^libraries:/' ;; esac case $host_os in - mingw* | cegcc*) lt_sed_strip_eq='s|=\([A-Za-z]:\)|\1|g' ;; + mingw* | windows* | cegcc*) lt_sed_strip_eq='s|=\([A-Za-z]:\)|\1|g' ;; *) lt_sed_strip_eq='s|=/|/|g' ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` @@ -11173,7 +12291,7 @@ BEGIN {RS = " "; FS = "/|\n";} { # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in - mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ + mingw* | windows* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's|/\([A-Za-z]:\)|\1|g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` @@ -11247,7 +12365,7 @@ aix[4-9]*) # Unfortunately, runtime linking may impact performance, so we do # not want this to be the default eventually. Also, we use the # versioned .so libs for executables only if there is the -brtl - # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. + # linker flag in LDFLAGS as well, or --enable-aix-soname=svr4 only. # To allow for filename-based versioning support, we need to create # libNAME.so.V as an archive file, containing: # *) an Import File, referring to the versioned filename of the @@ -11341,7 +12459,7 @@ bsdi[45]*) # libtool to hard-code these into programs ;; -cygwin* | mingw* | pw32* | cegcc*) +cygwin* | mingw* | windows* | pw32* | cegcc*) version_type=windows shrext_cmds=.dll need_version=no @@ -11352,6 +12470,19 @@ cygwin* | mingw* | pw32* | cegcc*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds + # If user builds GCC with mulitlibs enabled, + # it should just install on $(libdir) + # not on $(libdir)/../bin or 32 bits dlls would override 64 bit ones. + if test yes = $multilib; then + postinstall_cmds='base_file=`basename \$file`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + $install_prog $dir/$dlname $destdir/$dlname~ + chmod a+x $destdir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib $destdir/$dlname'\'' || exit \$?; + fi' + else postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ @@ -11361,6 +12492,7 @@ cygwin* | mingw* | pw32* | cegcc*) if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' + fi postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' @@ -11369,30 +12501,30 @@ cygwin* | mingw* | pw32* | cegcc*) case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' - soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' + soname_spec='`echo $libname | $SED -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" ;; - mingw* | cegcc*) + mingw* | windows* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' - library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' + library_names_spec='`echo $libname | $SED -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; esac dynamic_linker='Win32 ld.exe' ;; - *,cl*) - # Native MSVC + *,cl* | *,icl*) + # Native MSVC or ICC libname_spec='$name' soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' library_names_spec='$libname.dll.lib' case $build_os in - mingw*) + mingw* | windows*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' @@ -11405,7 +12537,7 @@ cygwin* | mingw* | pw32* | cegcc*) done IFS=$lt_save_ifs # Convert to MSYS style. - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form @@ -11442,7 +12574,7 @@ cygwin* | mingw* | pw32* | cegcc*) ;; *) - # Assume MSVC wrapper + # Assume MSVC and ICC wrapper library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib' dynamic_linker='Win32 ld.exe' ;; @@ -11475,7 +12607,7 @@ dgux*) shlibpath_var=LD_LIBRARY_PATH ;; -freebsd* | dragonfly*) +freebsd* | dragonfly* | midnightbsd*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then @@ -11512,7 +12644,27 @@ freebsd* | dragonfly*) need_version=no ;; esac + case $host_cpu in + powerpc64) + # On FreeBSD bi-arch platforms, a different variable is used for 32-bit + # binaries. See . + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int test_pointer_size[sizeof (void *) - 5]; + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : shlibpath_var=LD_LIBRARY_PATH +else $as_nop + shlibpath_var=LD_32_LIBRARY_PATH +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; + *) + shlibpath_var=LD_LIBRARY_PATH + ;; + esac case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes @@ -11653,7 +12805,7 @@ linux*android*) version_type=none # Android doesn't support versioned libraries. need_lib_prefix=no need_version=no - library_names_spec='$libname$release$shared_ext' + library_names_spec='$libname$release$shared_ext $libname$shared_ext' soname_spec='$libname$release$shared_ext' finish_cmds= shlibpath_var=LD_LIBRARY_PATH @@ -11665,8 +12817,9 @@ linux*android*) hardcode_into_libs=yes dynamic_linker='Android linker' - # Don't embed -rpath directories since the linker doesn't support them. - hardcode_libdir_flag_spec='-L$libdir' + # -rpath works at least for libraries that are not overridden by + # libraries installed in system locations. + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' ;; # This must be glibc/ELF. @@ -11681,9 +12834,10 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH - if ${lt_cv_shlibpath_overrides_runpath+:} false; then : - $as_echo_n "(cached) " >&6 -else + if test ${lt_cv_shlibpath_overrides_runpath+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir @@ -11693,19 +12847,21 @@ else /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : +if ac_fn_c_try_link "$LINENO" +then : + if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null +then : lt_cv_shlibpath_overrides_runpath=yes fi fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir @@ -11719,7 +12875,7 @@ fi # before this can be enabled. hardcode_into_libs=yes - # Ideally, we could use ldconfig to report *all* directores which are + # Ideally, we could use ldconfig to report *all* directories which are # searched for libraries, however this is still not possible. Aside from not # being certain /sbin/ldconfig is available, command # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, @@ -11776,7 +12932,7 @@ newsos6) dynamic_linker='ldqnx.so' ;; -openbsd* | bitrig*) +openbsd*) version_type=sunos sys_lib_dlsearch_path_spec=/usr/lib need_lib_prefix=no @@ -11937,8 +13093,8 @@ uts4*) dynamic_linker=no ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 -$as_echo "$dynamic_linker" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 +printf "%s\n" "$dynamic_linker" >&6; } test no = "$dynamic_linker" && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" @@ -12059,8 +13215,8 @@ configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH - { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 -$as_echo_n "checking how to hardcode library paths into programs... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 +printf %s "checking how to hardcode library paths into programs... " >&6; } hardcode_action= if test -n "$hardcode_libdir_flag_spec" || test -n "$runpath_var" || @@ -12084,8 +13240,8 @@ else # directories. hardcode_action=unsupported fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 -$as_echo "$hardcode_action" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 +printf "%s\n" "$hardcode_action" >&6; } if test relink = "$hardcode_action" || test yes = "$inherit_rpath"; then @@ -12117,7 +13273,7 @@ else lt_cv_dlopen_self=yes ;; - mingw* | pw32* | cegcc*) + mingw* | windows* | pw32* | cegcc*) lt_cv_dlopen=LoadLibrary lt_cv_dlopen_libs= ;; @@ -12129,11 +13285,12 @@ else darwin*) # if libdl is installed we need to link against it - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 -$as_echo_n "checking for dlopen in -ldl... " >&6; } -if ${ac_cv_lib_dl_dlopen+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +printf %s "checking for dlopen in -ldl... " >&6; } +if test ${ac_cv_lib_dl_dlopen+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -12141,33 +13298,38 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif -char dlopen (); +char dlopen (void); int -main () +main (void) { return dlopen (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_dl_dlopen=yes -else +else $as_nop ac_cv_lib_dl_dlopen=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 -$as_echo "$ac_cv_lib_dl_dlopen" >&6; } -if test "x$ac_cv_lib_dl_dlopen" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +printf "%s\n" "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = xyes +then : lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl -else +else $as_nop lt_cv_dlopen=dyld lt_cv_dlopen_libs= @@ -12187,14 +13349,16 @@ fi *) ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" -if test "x$ac_cv_func_shl_load" = xyes; then : +if test "x$ac_cv_func_shl_load" = xyes +then : lt_cv_dlopen=shl_load -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 -$as_echo_n "checking for shl_load in -ldld... " >&6; } -if ${ac_cv_lib_dld_shl_load+:} false; then : - $as_echo_n "(cached) " >&6 -else +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 +printf %s "checking for shl_load in -ldld... " >&6; } +if test ${ac_cv_lib_dld_shl_load+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -12202,42 +13366,49 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif -char shl_load (); +char shl_load (void); int -main () +main (void) { return shl_load (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_dld_shl_load=yes -else +else $as_nop ac_cv_lib_dld_shl_load=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 -$as_echo "$ac_cv_lib_dld_shl_load" >&6; } -if test "x$ac_cv_lib_dld_shl_load" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 +printf "%s\n" "$ac_cv_lib_dld_shl_load" >&6; } +if test "x$ac_cv_lib_dld_shl_load" = xyes +then : lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld -else +else $as_nop ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" -if test "x$ac_cv_func_dlopen" = xyes; then : +if test "x$ac_cv_func_dlopen" = xyes +then : lt_cv_dlopen=dlopen -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 -$as_echo_n "checking for dlopen in -ldl... " >&6; } -if ${ac_cv_lib_dl_dlopen+:} false; then : - $as_echo_n "(cached) " >&6 -else +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +printf %s "checking for dlopen in -ldl... " >&6; } +if test ${ac_cv_lib_dl_dlopen+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -12245,38 +13416,44 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif -char dlopen (); +char dlopen (void); int -main () +main (void) { return dlopen (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_dl_dlopen=yes -else +else $as_nop ac_cv_lib_dl_dlopen=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 -$as_echo "$ac_cv_lib_dl_dlopen" >&6; } -if test "x$ac_cv_lib_dl_dlopen" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +printf "%s\n" "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = xyes +then : lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 -$as_echo_n "checking for dlopen in -lsvld... " >&6; } -if ${ac_cv_lib_svld_dlopen+:} false; then : - $as_echo_n "(cached) " >&6 -else +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 +printf %s "checking for dlopen in -lsvld... " >&6; } +if test ${ac_cv_lib_svld_dlopen+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -12284,38 +13461,44 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif -char dlopen (); +char dlopen (void); int -main () +main (void) { return dlopen (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_svld_dlopen=yes -else +else $as_nop ac_cv_lib_svld_dlopen=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 -$as_echo "$ac_cv_lib_svld_dlopen" >&6; } -if test "x$ac_cv_lib_svld_dlopen" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 +printf "%s\n" "$ac_cv_lib_svld_dlopen" >&6; } +if test "x$ac_cv_lib_svld_dlopen" = xyes +then : lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 -$as_echo_n "checking for dld_link in -ldld... " >&6; } -if ${ac_cv_lib_dld_dld_link+:} false; then : - $as_echo_n "(cached) " >&6 -else +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 +printf %s "checking for dld_link in -ldld... " >&6; } +if test ${ac_cv_lib_dld_dld_link+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -12323,31 +13506,36 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif -char dld_link (); +char dld_link (void); int -main () +main (void) { return dld_link (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_dld_dld_link=yes -else +else $as_nop ac_cv_lib_dld_dld_link=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 -$as_echo "$ac_cv_lib_dld_dld_link" >&6; } -if test "x$ac_cv_lib_dld_dld_link" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 +printf "%s\n" "$ac_cv_lib_dld_dld_link" >&6; } +if test "x$ac_cv_lib_dld_dld_link" = xyes +then : lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld fi @@ -12386,11 +13574,12 @@ fi save_LIBS=$LIBS LIBS="$lt_cv_dlopen_libs $LIBS" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 -$as_echo_n "checking whether a program can dlopen itself... " >&6; } -if ${lt_cv_dlopen_self+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 +printf %s "checking whether a program can dlopen itself... " >&6; } +if test ${lt_cv_dlopen_self+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test yes = "$cross_compiling"; then : lt_cv_dlopen_self=cross else @@ -12441,11 +13630,11 @@ else /* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) -int fnord () __attribute__((visibility("default"))); +int fnord (void) __attribute__((visibility("default"))); #endif -int fnord () { return 42; } -int main () +int fnord (void) { return 42; } +int main (void) { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; @@ -12469,7 +13658,7 @@ _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? @@ -12487,16 +13676,17 @@ rm -fr conftest* fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 -$as_echo "$lt_cv_dlopen_self" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 +printf "%s\n" "$lt_cv_dlopen_self" >&6; } if test yes = "$lt_cv_dlopen_self"; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 -$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } -if ${lt_cv_dlopen_self_static+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 +printf %s "checking whether a statically linked program can dlopen itself... " >&6; } +if test ${lt_cv_dlopen_self_static+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test yes = "$cross_compiling"; then : lt_cv_dlopen_self_static=cross else @@ -12547,11 +13737,11 @@ else /* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) -int fnord () __attribute__((visibility("default"))); +int fnord (void) __attribute__((visibility("default"))); #endif -int fnord () { return 42; } -int main () +int fnord (void) { return 42; } +int main (void) { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; @@ -12575,7 +13765,7 @@ _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? @@ -12593,8 +13783,8 @@ rm -fr conftest* fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 -$as_echo "$lt_cv_dlopen_self_static" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 +printf "%s\n" "$lt_cv_dlopen_self_static" >&6; } fi CPPFLAGS=$save_CPPFLAGS @@ -12632,32 +13822,43 @@ fi striplib= old_striplib= -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 -$as_echo_n "checking whether stripping libraries is possible... " >&6; } -if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then - test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" - test -z "$striplib" && striplib="$STRIP --strip-unneeded" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else -# FIXME - insert some real tests, host_os isn't really good enough - case $host_os in - darwin*) - if test -n "$STRIP"; then +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 +printf %s "checking whether stripping libraries is possible... " >&6; } +if test -z "$STRIP"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +else + if $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then + old_striplib="$STRIP --strip-debug" + striplib="$STRIP --strip-unneeded" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + else + case $host_os in + darwin*) + # FIXME - insert some real tests, host_os isn't really good enough striplib="$STRIP -x" old_striplib="$STRIP -S" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - fi - ;; - *) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - ;; - esac + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + ;; + freebsd*) + if $STRIP -V 2>&1 | $GREP "elftoolchain" >/dev/null; then + old_striplib="$STRIP --strip-debug" + striplib="$STRIP --strip-unneeded" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + fi + ;; + *) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ;; + esac + fi fi @@ -12672,13 +13873,13 @@ fi # Report what library types will actually be built - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 -$as_echo_n "checking if libtool supports shared libraries... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 -$as_echo "$can_build_shared" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 +printf %s "checking if libtool supports shared libraries... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 +printf "%s\n" "$can_build_shared" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 -$as_echo_n "checking whether to build shared libraries... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 +printf %s "checking whether to build shared libraries... " >&6; } test no = "$can_build_shared" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and @@ -12702,15 +13903,15 @@ $as_echo_n "checking whether to build shared libraries... " >&6; } fi ;; esac - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 -$as_echo "$enable_shared" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 +printf "%s\n" "$enable_shared" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 -$as_echo_n "checking whether to build static libraries... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 +printf %s "checking whether to build static libraries... " >&6; } # Make sure either enable_shared or enable_static is yes. test yes = "$enable_shared" || enable_static=yes - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 -$as_echo "$enable_static" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 +printf "%s\n" "$enable_static" >&6; } @@ -12738,215 +13939,46 @@ CC=$lt_save_CC - ac_config_commands="$ac_config_commands libtool" - - - - -# Only expand once: - - - - - - - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C99" >&5 -$as_echo_n "checking for $CC option to accept ISO C99... " >&6; } -if ${ac_cv_prog_cc_c99+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_cv_prog_cc_c99=no -ac_save_CC=$CC -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#include -#include -#include - -// Check varargs macros. These examples are taken from C99 6.10.3.5. -#define debug(...) fprintf (stderr, __VA_ARGS__) -#define showlist(...) puts (#__VA_ARGS__) -#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__)) -static void -test_varargs_macros (void) -{ - int x = 1234; - int y = 5678; - debug ("Flag"); - debug ("X = %d\n", x); - showlist (The first, second, and third items.); - report (x>y, "x is %d but y is %d", x, y); -} - -// Check long long types. -#define BIG64 18446744073709551615ull -#define BIG32 4294967295ul -#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0) -#if !BIG_OK - your preprocessor is broken; -#endif -#if BIG_OK -#else - your preprocessor is broken; -#endif -static long long int bignum = -9223372036854775807LL; -static unsigned long long int ubignum = BIG64; - -struct incomplete_array -{ - int datasize; - double data[]; -}; - -struct named_init { - int number; - const wchar_t *name; - double average; -}; - -typedef const char *ccp; - -static inline int -test_restrict (ccp restrict text) -{ - // See if C++-style comments work. - // Iterate through items via the restricted pointer. - // Also check for declarations in for loops. - for (unsigned int i = 0; *(text+i) != '\0'; ++i) - continue; - return 0; -} - -// Check varargs and va_copy. -static void -test_varargs (const char *format, ...) -{ - va_list args; - va_start (args, format); - va_list args_copy; - va_copy (args_copy, args); - - const char *str; - int number; - float fnumber; - - while (*format) - { - switch (*format++) - { - case 's': // string - str = va_arg (args_copy, const char *); - break; - case 'd': // int - number = va_arg (args_copy, int); - break; - case 'f': // float - fnumber = va_arg (args_copy, double); - break; - default: - break; - } - } - va_end (args_copy); - va_end (args); -} - -int -main () -{ - - // Check bool. - _Bool success = false; - - // Check restrict. - if (test_restrict ("String literal") == 0) - success = true; - char *restrict newvar = "Another string"; - - // Check varargs. - test_varargs ("s, d' f .", "string", 65, 34.234); - test_varargs_macros (); + ac_config_commands="$ac_config_commands libtool" - // Check flexible array members. - struct incomplete_array *ia = - malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10)); - ia->datasize = 10; - for (int i = 0; i < ia->datasize; ++i) - ia->data[i] = i * 1.234; - // Check named initializers. - struct named_init ni = { - .number = 34, - .name = L"Test wide string", - .average = 543.34343, - }; - ni.number = 58; - int dynamic_array[ni.number]; - dynamic_array[ni.number - 1] = 543; +# Only expand once: + + - // work around unused variable warnings - return (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x' - || dynamic_array[ni.number - 1] != 543); - ; - return 0; -} -_ACEOF -for ac_arg in '' -std=gnu99 -std=c99 -c99 -AC99 -D_STDC_C99= -qlanglvl=extc99 -do - CC="$ac_save_CC $ac_arg" - if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_c99=$ac_arg -fi -rm -f core conftest.err conftest.$ac_objext - test "x$ac_cv_prog_cc_c99" != "xno" && break -done -rm -f conftest.$ac_ext -CC=$ac_save_CC -fi -# AC_CACHE_VAL -case "x$ac_cv_prog_cc_c99" in - x) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -$as_echo "none needed" >&6; } ;; - xno) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -$as_echo "unsupported" >&6; } ;; - *) - CC="$CC $ac_cv_prog_cc_c99" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 -$as_echo "$ac_cv_prog_cc_c99" >&6; } ;; -esac -if test "x$ac_cv_prog_cc_c99" != xno; then : -fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu -if test "$GCC" = yes; then : +if test "${ac_cv_prog_cc_c99}" = no +then : + as_fn_error $? "Expat requires a C99 compiler." "$LINENO" 5 +fi + +if test "$GCC" = yes +then : for flag in -Wall -Wextra; do - as_CACHEVAR=`$as_echo "ax_cv_check_cflags__$flag" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $flag" >&5 -$as_echo_n "checking whether C compiler accepts $flag... " >&6; } -if eval \${$as_CACHEVAR+:} false; then : - $as_echo_n "(cached) " >&6 -else + as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$flag" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $flag" >&5 +printf %s "checking whether C compiler accepts $flag... " >&6; } +if eval test \${$as_CACHEVAR+y} +then : + printf %s "(cached) " >&6 +else $as_nop ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS -Werror $flag" @@ -12954,51 +13986,54 @@ else /* end confdefs.h. */ int main(void) { return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : eval "$as_CACHEVAR=yes" -else +else $as_nop eval "$as_CACHEVAR=no" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CFLAGS=$ax_check_save_flags fi eval ac_res=\$$as_CACHEVAR - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_CACHEVAR"\" = x"yes"; then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_CACHEVAR"\" = x"yes" +then : -if ${AM_CFLAGS+:} false; then : +if test ${AM_CFLAGS+y} +then : case " $AM_CFLAGS " in #( *" $flag "*) : - { { $as_echo "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS already contains \$flag"; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS already contains \$flag"; } >&5 (: AM_CFLAGS already contains $flag) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } ;; #( *) : as_fn_append AM_CFLAGS " $flag" - { { $as_echo "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS=\"\$AM_CFLAGS\""; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS=\"\$AM_CFLAGS\""; } >&5 (: AM_CFLAGS="$AM_CFLAGS") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } ;; esac -else +else $as_nop AM_CFLAGS=$flag - { { $as_echo "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS=\"\$AM_CFLAGS\""; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS=\"\$AM_CFLAGS\""; } >&5 (: AM_CFLAGS="$AM_CFLAGS") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } fi -else +else $as_nop : fi @@ -13009,12 +14044,13 @@ done for flag in -fexceptions; do - as_CACHEVAR=`$as_echo "ax_cv_check_cflags__$flag" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $flag" >&5 -$as_echo_n "checking whether C compiler accepts $flag... " >&6; } -if eval \${$as_CACHEVAR+:} false; then : - $as_echo_n "(cached) " >&6 -else + as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$flag" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $flag" >&5 +printf %s "checking whether C compiler accepts $flag... " >&6; } +if eval test \${$as_CACHEVAR+y} +then : + printf %s "(cached) " >&6 +else $as_nop ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS -Werror $flag" @@ -13022,51 +14058,54 @@ else /* end confdefs.h. */ int main(void) { return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : eval "$as_CACHEVAR=yes" -else +else $as_nop eval "$as_CACHEVAR=no" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CFLAGS=$ax_check_save_flags fi eval ac_res=\$$as_CACHEVAR - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_CACHEVAR"\" = x"yes"; then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_CACHEVAR"\" = x"yes" +then : -if ${AM_CFLAGS+:} false; then : +if test ${AM_CFLAGS+y} +then : case " $AM_CFLAGS " in #( *" $flag "*) : - { { $as_echo "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS already contains \$flag"; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS already contains \$flag"; } >&5 (: AM_CFLAGS already contains $flag) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } ;; #( *) : as_fn_append AM_CFLAGS " $flag" - { { $as_echo "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS=\"\$AM_CFLAGS\""; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS=\"\$AM_CFLAGS\""; } >&5 (: AM_CFLAGS="$AM_CFLAGS") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } ;; esac -else +else $as_nop AM_CFLAGS=$flag - { { $as_echo "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS=\"\$AM_CFLAGS\""; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS=\"\$AM_CFLAGS\""; } >&5 (: AM_CFLAGS="$AM_CFLAGS") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } fi -else +else $as_nop : fi @@ -13077,12 +14116,13 @@ done for flag in -fno-strict-aliasing -Wmissing-prototypes -Wstrict-prototypes; do - as_CACHEVAR=`$as_echo "ax_cv_check_cflags__$flag" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $flag" >&5 -$as_echo_n "checking whether C compiler accepts $flag... " >&6; } -if eval \${$as_CACHEVAR+:} false; then : - $as_echo_n "(cached) " >&6 -else + as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$flag" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $flag" >&5 +printf %s "checking whether C compiler accepts $flag... " >&6; } +if eval test \${$as_CACHEVAR+y} +then : + printf %s "(cached) " >&6 +else $as_nop ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS -Werror $flag" @@ -13090,51 +14130,54 @@ else /* end confdefs.h. */ int main(void) { return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : eval "$as_CACHEVAR=yes" -else +else $as_nop eval "$as_CACHEVAR=no" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CFLAGS=$ax_check_save_flags fi eval ac_res=\$$as_CACHEVAR - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_CACHEVAR"\" = x"yes"; then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_CACHEVAR"\" = x"yes" +then : -if ${AM_CFLAGS+:} false; then : +if test ${AM_CFLAGS+y} +then : case " $AM_CFLAGS " in #( *" $flag "*) : - { { $as_echo "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS already contains \$flag"; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS already contains \$flag"; } >&5 (: AM_CFLAGS already contains $flag) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } ;; #( *) : as_fn_append AM_CFLAGS " $flag" - { { $as_echo "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS=\"\$AM_CFLAGS\""; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS=\"\$AM_CFLAGS\""; } >&5 (: AM_CFLAGS="$AM_CFLAGS") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } ;; esac -else +else $as_nop AM_CFLAGS=$flag - { { $as_echo "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS=\"\$AM_CFLAGS\""; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS=\"\$AM_CFLAGS\""; } >&5 (: AM_CFLAGS="$AM_CFLAGS") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } fi -else +else $as_nop : fi @@ -13145,12 +14188,13 @@ done for flag in -pedantic -Wduplicated-cond -Wduplicated-branches -Wlogical-op; do - as_CACHEVAR=`$as_echo "ax_cv_check_cflags__$flag" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $flag" >&5 -$as_echo_n "checking whether C compiler accepts $flag... " >&6; } -if eval \${$as_CACHEVAR+:} false; then : - $as_echo_n "(cached) " >&6 -else + as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$flag" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $flag" >&5 +printf %s "checking whether C compiler accepts $flag... " >&6; } +if eval test \${$as_CACHEVAR+y} +then : + printf %s "(cached) " >&6 +else $as_nop ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS -Werror $flag" @@ -13158,51 +14202,54 @@ else /* end confdefs.h. */ int main(void) { return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : eval "$as_CACHEVAR=yes" -else +else $as_nop eval "$as_CACHEVAR=no" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CFLAGS=$ax_check_save_flags fi eval ac_res=\$$as_CACHEVAR - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_CACHEVAR"\" = x"yes"; then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_CACHEVAR"\" = x"yes" +then : -if ${AM_CFLAGS+:} false; then : +if test ${AM_CFLAGS+y} +then : case " $AM_CFLAGS " in #( *" $flag "*) : - { { $as_echo "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS already contains \$flag"; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS already contains \$flag"; } >&5 (: AM_CFLAGS already contains $flag) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } ;; #( *) : as_fn_append AM_CFLAGS " $flag" - { { $as_echo "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS=\"\$AM_CFLAGS\""; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS=\"\$AM_CFLAGS\""; } >&5 (: AM_CFLAGS="$AM_CFLAGS") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } ;; esac -else +else $as_nop AM_CFLAGS=$flag - { { $as_echo "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS=\"\$AM_CFLAGS\""; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS=\"\$AM_CFLAGS\""; } >&5 (: AM_CFLAGS="$AM_CFLAGS") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } fi -else +else $as_nop : fi @@ -13213,12 +14260,13 @@ done for flag in -Wrestrict -Wnull-dereference -Wjump-misses-init -Wdouble-promotion; do - as_CACHEVAR=`$as_echo "ax_cv_check_cflags__$flag" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $flag" >&5 -$as_echo_n "checking whether C compiler accepts $flag... " >&6; } -if eval \${$as_CACHEVAR+:} false; then : - $as_echo_n "(cached) " >&6 -else + as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$flag" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $flag" >&5 +printf %s "checking whether C compiler accepts $flag... " >&6; } +if eval test \${$as_CACHEVAR+y} +then : + printf %s "(cached) " >&6 +else $as_nop ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS -Werror $flag" @@ -13226,51 +14274,54 @@ else /* end confdefs.h. */ int main(void) { return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : eval "$as_CACHEVAR=yes" -else +else $as_nop eval "$as_CACHEVAR=no" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CFLAGS=$ax_check_save_flags fi eval ac_res=\$$as_CACHEVAR - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_CACHEVAR"\" = x"yes"; then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_CACHEVAR"\" = x"yes" +then : -if ${AM_CFLAGS+:} false; then : +if test ${AM_CFLAGS+y} +then : case " $AM_CFLAGS " in #( *" $flag "*) : - { { $as_echo "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS already contains \$flag"; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS already contains \$flag"; } >&5 (: AM_CFLAGS already contains $flag) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } ;; #( *) : as_fn_append AM_CFLAGS " $flag" - { { $as_echo "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS=\"\$AM_CFLAGS\""; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS=\"\$AM_CFLAGS\""; } >&5 (: AM_CFLAGS="$AM_CFLAGS") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } ;; esac -else +else $as_nop AM_CFLAGS=$flag - { { $as_echo "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS=\"\$AM_CFLAGS\""; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS=\"\$AM_CFLAGS\""; } >&5 (: AM_CFLAGS="$AM_CFLAGS") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } fi -else +else $as_nop : fi @@ -13280,13 +14331,14 @@ done -for flag in -Wshadow -Wformat=2 -Wmisleading-indentation; do - as_CACHEVAR=`$as_echo "ax_cv_check_cflags__$flag" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $flag" >&5 -$as_echo_n "checking whether C compiler accepts $flag... " >&6; } -if eval \${$as_CACHEVAR+:} false; then : - $as_echo_n "(cached) " >&6 -else +for flag in -Wshadow -Wformat=2 -Wno-pedantic-ms-format -Wmisleading-indentation; do + as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$flag" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $flag" >&5 +printf %s "checking whether C compiler accepts $flag... " >&6; } +if eval test \${$as_CACHEVAR+y} +then : + printf %s "(cached) " >&6 +else $as_nop ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS -Werror $flag" @@ -13294,51 +14346,54 @@ else /* end confdefs.h. */ int main(void) { return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : eval "$as_CACHEVAR=yes" -else +else $as_nop eval "$as_CACHEVAR=no" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CFLAGS=$ax_check_save_flags fi eval ac_res=\$$as_CACHEVAR - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_CACHEVAR"\" = x"yes"; then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_CACHEVAR"\" = x"yes" +then : -if ${AM_CFLAGS+:} false; then : +if test ${AM_CFLAGS+y} +then : case " $AM_CFLAGS " in #( *" $flag "*) : - { { $as_echo "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS already contains \$flag"; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS already contains \$flag"; } >&5 (: AM_CFLAGS already contains $flag) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } ;; #( *) : as_fn_append AM_CFLAGS " $flag" - { { $as_echo "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS=\"\$AM_CFLAGS\""; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS=\"\$AM_CFLAGS\""; } >&5 (: AM_CFLAGS="$AM_CFLAGS") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } ;; esac -else +else $as_nop AM_CFLAGS=$flag - { { $as_echo "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS=\"\$AM_CFLAGS\""; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS=\"\$AM_CFLAGS\""; } >&5 (: AM_CFLAGS="$AM_CFLAGS") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } fi -else +else $as_nop : fi @@ -13352,6 +14407,12 @@ ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + + + + + ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -13362,15 +14423,16 @@ if test -z "$CXX"; then CXX=$CCC else if test -n "$ac_tool_prefix"; then - for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC clang++ do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CXX+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CXX+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. else @@ -13378,11 +14440,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -13393,11 +14459,11 @@ fi fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 -$as_echo "$CXX" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 +printf "%s\n" "$CXX" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -13406,15 +14472,16 @@ fi fi if test -z "$CXX"; then ac_ct_CXX=$CXX - for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC clang++ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CXX+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CXX+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_CXX"; then ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. else @@ -13422,11 +14489,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CXX="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -13437,11 +14508,11 @@ fi fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 -$as_echo "$ac_ct_CXX" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 +printf "%s\n" "$ac_ct_CXX" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -13453,8 +14524,8 @@ done else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CXX=$ac_ct_CXX @@ -13464,7 +14535,7 @@ fi fi fi # Provide some information about the compiler. -$as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 +printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do @@ -13474,7 +14545,7 @@ case "(($ac_try" in *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then @@ -13484,20 +14555,21 @@ $as_echo "$ac_try_echo"; } >&5 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5 -$as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } -if ${ac_cv_cxx_compiler_gnu+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C++" >&5 +printf %s "checking whether the compiler supports GNU C++... " >&6; } +if test ${ac_cv_cxx_compiler_gnu+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { #ifndef __GNUC__ choke me @@ -13507,29 +14579,33 @@ main () return 0; } _ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : +if ac_fn_cxx_try_compile "$LINENO" +then : ac_compiler_gnu=yes -else +else $as_nop ac_compiler_gnu=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cv_cxx_compiler_gnu=$ac_compiler_gnu fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 -$as_echo "$ac_cv_cxx_compiler_gnu" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 +printf "%s\n" "$ac_cv_cxx_compiler_gnu" >&6; } +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + if test $ac_compiler_gnu = yes; then GXX=yes else GXX= fi -ac_test_CXXFLAGS=${CXXFLAGS+set} +ac_test_CXXFLAGS=${CXXFLAGS+y} ac_save_CXXFLAGS=$CXXFLAGS -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 -$as_echo_n "checking whether $CXX accepts -g... " >&6; } -if ${ac_cv_prog_cxx_g+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 +printf %s "checking whether $CXX accepts -g... " >&6; } +if test ${ac_cv_prog_cxx_g+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_save_cxx_werror_flag=$ac_cxx_werror_flag ac_cxx_werror_flag=yes ac_cv_prog_cxx_g=no @@ -13538,57 +14614,60 @@ else /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : +if ac_fn_cxx_try_compile "$LINENO" +then : ac_cv_prog_cxx_g=yes -else +else $as_nop CXXFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : +if ac_fn_cxx_try_compile "$LINENO" +then : -else +else $as_nop ac_cxx_werror_flag=$ac_save_cxx_werror_flag CXXFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : +if ac_fn_cxx_try_compile "$LINENO" +then : ac_cv_prog_cxx_g=yes fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cxx_werror_flag=$ac_save_cxx_werror_flag fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 -$as_echo "$ac_cv_prog_cxx_g" >&6; } -if test "$ac_test_CXXFLAGS" = set; then +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 +printf "%s\n" "$ac_cv_prog_cxx_g" >&6; } +if test $ac_test_CXXFLAGS; then CXXFLAGS=$ac_save_CXXFLAGS elif test $ac_cv_prog_cxx_g = yes; then if test "$GXX" = yes; then @@ -13603,6 +14682,100 @@ else CXXFLAGS= fi fi +ac_prog_cxx_stdcxx=no +if test x$ac_prog_cxx_stdcxx = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CXX option to enable C++11 features" >&5 +printf %s "checking for $CXX option to enable C++11 features... " >&6; } +if test ${ac_cv_prog_cxx_cxx11+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cxx_cxx11=no +ac_save_CXX=$CXX +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_cxx_conftest_cxx11_program +_ACEOF +for ac_arg in '' -std=gnu++11 -std=gnu++0x -std=c++11 -std=c++0x -qlanglvl=extended0x -AA +do + CXX="$ac_save_CXX $ac_arg" + if ac_fn_cxx_try_compile "$LINENO" +then : + ac_cv_prog_cxx_cxx11=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cxx_cxx11" != "xno" && break +done +rm -f conftest.$ac_ext +CXX=$ac_save_CXX +fi + +if test "x$ac_cv_prog_cxx_cxx11" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cxx_cxx11" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_cxx11" >&5 +printf "%s\n" "$ac_cv_prog_cxx_cxx11" >&6; } + CXX="$CXX $ac_cv_prog_cxx_cxx11" +fi + ac_cv_prog_cxx_stdcxx=$ac_cv_prog_cxx_cxx11 + ac_prog_cxx_stdcxx=cxx11 +fi +fi +if test x$ac_prog_cxx_stdcxx = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CXX option to enable C++98 features" >&5 +printf %s "checking for $CXX option to enable C++98 features... " >&6; } +if test ${ac_cv_prog_cxx_cxx98+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cxx_cxx98=no +ac_save_CXX=$CXX +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_cxx_conftest_cxx98_program +_ACEOF +for ac_arg in '' -std=gnu++98 -std=c++98 -qlanglvl=extended -AA +do + CXX="$ac_save_CXX $ac_arg" + if ac_fn_cxx_try_compile "$LINENO" +then : + ac_cv_prog_cxx_cxx98=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cxx_cxx98" != "xno" && break +done +rm -f conftest.$ac_ext +CXX=$ac_save_CXX +fi + +if test "x$ac_cv_prog_cxx_cxx98" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cxx_cxx98" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_cxx98" >&5 +printf "%s\n" "$ac_cv_prog_cxx_cxx98" >&6; } + CXX="$CXX $ac_cv_prog_cxx_cxx98" +fi + ac_cv_prog_cxx_stdcxx=$ac_cv_prog_cxx_cxx98 + ac_prog_cxx_stdcxx=cxx98 +fi +fi + ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -13611,11 +14784,12 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu depcc="$CXX" am_compiler_list= -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 -$as_echo_n "checking dependency style of $depcc... " >&6; } -if ${am_cv_CXX_dependencies_compiler_type+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +printf %s "checking dependency style of $depcc... " >&6; } +if test ${am_cv_CXX_dependencies_compiler_type+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For @@ -13722,8 +14896,8 @@ else fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5 -$as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5 +printf "%s\n" "$am_cv_CXX_dependencies_compiler_type" >&6; } CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type if @@ -13755,36 +14929,32 @@ ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5 -$as_echo_n "checking how to run the C++ preprocessor... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5 +printf %s "checking how to run the C++ preprocessor... " >&6; } if test -z "$CXXCPP"; then - if ${ac_cv_prog_CXXCPP+:} false; then : - $as_echo_n "(cached) " >&6 -else - # Double quotes because CXXCPP needs to be expanded - for CXXCPP in "$CXX -E" "/lib/cpp" + if test ${ac_cv_prog_CXXCPP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + # Double quotes because $CXX needs to be expanded + for CXXCPP in "$CXX -E" cpp /lib/cpp do ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif +#include Syntax error _ACEOF -if ac_fn_cxx_try_cpp "$LINENO"; then : +if ac_fn_cxx_try_cpp "$LINENO" +then : -else +else $as_nop # Broken: fails on valid input. continue fi @@ -13796,10 +14966,11 @@ rm -f conftest.err conftest.i conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF -if ac_fn_cxx_try_cpp "$LINENO"; then : +if ac_fn_cxx_try_cpp "$LINENO" +then : # Broken: success on invalid input. continue -else +else $as_nop # Passes both tests. ac_preproc_ok=: break @@ -13809,7 +14980,8 @@ rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : +if $ac_preproc_ok +then : break fi @@ -13821,29 +14993,24 @@ fi else ac_cv_prog_CXXCPP=$CXXCPP fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5 -$as_echo "$CXXCPP" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5 +printf "%s\n" "$CXXCPP" >&6; } ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif +#include Syntax error _ACEOF -if ac_fn_cxx_try_cpp "$LINENO"; then : +if ac_fn_cxx_try_cpp "$LINENO" +then : -else +else $as_nop # Broken: fails on valid input. continue fi @@ -13855,10 +15022,11 @@ rm -f conftest.err conftest.i conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF -if ac_fn_cxx_try_cpp "$LINENO"; then : +if ac_fn_cxx_try_cpp "$LINENO" +then : # Broken: success on invalid input. continue -else +else $as_nop # Passes both tests. ac_preproc_ok=: break @@ -13868,11 +15036,12 @@ rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : +if $ac_preproc_ok +then : -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +else $as_nop + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C++ preprocessor \"$CXXCPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi @@ -14008,19 +15177,20 @@ cc_basename=$func_cc_basename_result # Check whether --with-gnu-ld was given. -if test "${with_gnu_ld+set}" = set; then : +if test ${with_gnu_ld+y} +then : withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes -else +else $as_nop with_gnu_ld=no fi ac_prog=ld if test yes = "$GCC"; then # Check if gcc -print-prog-name=ld gives a path. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 -$as_echo_n "checking for ld used by $CC... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 +printf %s "checking for ld used by $CC... " >&6; } case $host in - *-*-mingw*) + *-*-mingw* | *-*-windows*) # gcc leaves a trailing carriage return, which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) @@ -14047,15 +15217,16 @@ $as_echo_n "checking for ld used by $CC... " >&6; } ;; esac elif test yes = "$with_gnu_ld"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 -$as_echo_n "checking for GNU ld... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 +printf %s "checking for GNU ld... " >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 -$as_echo_n "checking for non-GNU ld... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 +printf %s "checking for non-GNU ld... " >&6; } fi -if ${lt_cv_path_LD+:} false; then : - $as_echo_n "(cached) " >&6 -else +if test ${lt_cv_path_LD+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -z "$LD"; then lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do @@ -14084,18 +15255,19 @@ fi LD=$lt_cv_path_LD if test -n "$LD"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5 -$as_echo "$LD" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LD" >&5 +printf "%s\n" "$LD" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 -$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } -if ${lt_cv_prog_gnu_ld+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 +printf %s "checking if the linker ($LD) is GNU ld... " >&6; } +if test ${lt_cv_prog_gnu_ld+y} +then : + printf %s "(cached) " >&6 +else $as_nop # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &1 &5 -$as_echo "$lt_cv_prog_gnu_ld" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_gnu_ld" >&5 +printf "%s\n" "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld @@ -14131,8 +15303,7 @@ with_gnu_ld=$lt_cv_prog_gnu_ld wlarc='$wl' # ancient GNU ld didn't support --whole-archive et. al. - if eval "`$CC -print-prog-name=ld` --help 2>&1" | - $GREP 'no-whole-archive' > /dev/null; then + if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then whole_archive_flag_spec_CXX=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' else whole_archive_flag_spec_CXX= @@ -14152,7 +15323,7 @@ with_gnu_ld=$lt_cv_prog_gnu_ld # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "[-]L"' else GXX=no @@ -14161,8 +15332,8 @@ with_gnu_ld=$lt_cv_prog_gnu_ld fi # PORTME: fill in a description of your system's C++ link characteristics - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 -$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +printf %s "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } ld_shlibs_CXX=yes case $host_os in aix3*) @@ -14300,21 +15471,23 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else - if ${lt_cv_aix_libpath__CXX+:} false; then : - $as_echo_n "(cached) " >&6 -else + if test ${lt_cv_aix_libpath__CXX+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : +if ac_fn_cxx_try_link "$LINENO" +then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { @@ -14329,7 +15502,7 @@ if ac_fn_cxx_try_link "$LINENO"; then : lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX=/usr/lib:/lib @@ -14354,21 +15527,23 @@ fi if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else - if ${lt_cv_aix_libpath__CXX+:} false; then : - $as_echo_n "(cached) " >&6 -else + if test ${lt_cv_aix_libpath__CXX+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : +if ac_fn_cxx_try_link "$LINENO" +then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { @@ -14383,7 +15558,7 @@ if ac_fn_cxx_try_link "$LINENO"; then : lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX=/usr/lib:/lib @@ -14446,10 +15621,10 @@ fi esac ;; - cygwin* | mingw* | pw32* | cegcc*) + cygwin* | mingw* | windows* | pw32* | cegcc*) case $GXX,$cc_basename in - ,cl* | no,cl*) - # Native MSVC + ,cl* | no,cl* | ,icl* | no,icl*) + # Native MSVC or ICC # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec_CXX=' ' @@ -14540,11 +15715,11 @@ fi output_verbose_link_cmd=func_echo_all archive_cmds_CXX="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" module_cmds_CXX="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" - archive_expsym_cmds_CXX="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" - module_expsym_cmds_CXX="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" + archive_expsym_cmds_CXX="$SED 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" + module_expsym_cmds_CXX="$SED -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" if test yes != "$lt_cv_apple_cc_single_mod"; then archive_cmds_CXX="\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dsymutil" - archive_expsym_cmds_CXX="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil" + archive_expsym_cmds_CXX="$SED 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil" fi else @@ -14577,8 +15752,9 @@ fi cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' - old_archive_From_new_cmds_CXX='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' + old_archive_from_new_cmds_CXX='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes_CXX=yes + file_list_spec_CXX='@' ;; dgux*) @@ -14609,7 +15785,7 @@ fi archive_cmds_need_lc_CXX=no ;; - freebsd* | dragonfly*) + freebsd* | dragonfly* | midnightbsd*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions ld_shlibs_CXX=yes @@ -14644,7 +15820,7 @@ fi # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "[-]L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes = "$GXX"; then @@ -14709,7 +15885,7 @@ fi # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "[-]L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes = "$GXX"; then @@ -14746,7 +15922,7 @@ fi # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - archive_expsym_cmds_CXX='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds_CXX='$SED "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in @@ -14886,13 +16062,13 @@ fi archive_cmds_CXX='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' if test yes = "$supports_anon_versioning"; then archive_expsym_cmds_CXX='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi ;; *) - case `$CC -V 2>&1 | sed 5q` in + case `$CC -V 2>&1 | $SED 5q` in *Sun\ C*) # Sun C++ 5.9 no_undefined_flag_CXX=' -zdefs' @@ -14957,7 +16133,7 @@ fi ld_shlibs_CXX=yes ;; - openbsd* | bitrig*) + openbsd*) if test -f /usr/libexec/ld.so; then hardcode_direct_CXX=yes hardcode_shlibpath_var_CXX=no @@ -15048,7 +16224,7 @@ fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "[-]L"' else # FIXME: insert proper C++ library support @@ -15132,7 +16308,7 @@ fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "[-]L"' else # g++ 2.7 appears to require '-G' NOT '-shared' on this # platform. @@ -15143,7 +16319,7 @@ fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "[-]L"' fi hardcode_libdir_flag_spec_CXX='$wl-R $wl$libdir' @@ -15234,8 +16410,8 @@ fi ;; esac - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 -$as_echo "$ld_shlibs_CXX" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 +printf "%s\n" "$ld_shlibs_CXX" >&6; } test no = "$ld_shlibs_CXX" && can_build_shared=no GCC_CXX=$GXX @@ -15273,7 +16449,7 @@ esac if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # Parse the compiler output and extract the necessary # objects, libraries and library flags. @@ -15286,10 +16462,11 @@ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 case $prev$p in -L* | -R* | -l*) - # Some compilers place space between "-{L,R}" and the path. + # Some compilers place space between "-{L,R,l}" and the path. # Remove the space. - if test x-L = "$p" || - test x-R = "$p"; then + if test x-L = x"$p" || + test x-R = x"$p" || + test x-l = x"$p"; then prev=$p continue fi @@ -15456,7 +16633,7 @@ lt_prog_compiler_static_CXX= beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; - mingw* | cygwin* | os2* | pw32* | cegcc*) + mingw* | windows* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style @@ -15531,7 +16708,7 @@ lt_prog_compiler_static_CXX= ;; esac ;; - mingw* | cygwin* | os2* | pw32* | cegcc*) + mingw* | windows* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic_CXX='-DDLL_EXPORT' @@ -15549,7 +16726,7 @@ lt_prog_compiler_static_CXX= ;; esac ;; - freebsd* | dragonfly*) + freebsd* | dragonfly* | midnightbsd*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) @@ -15632,7 +16809,7 @@ lt_prog_compiler_static_CXX= lt_prog_compiler_static_CXX='-qstaticlink' ;; *) - case `$CC -V 2>&1 | sed 5q` in + case `$CC -V 2>&1 | $SED 5q` in *Sun\ C*) # Sun C++ 5.9 lt_prog_compiler_pic_CXX='-KPIC' @@ -15754,26 +16931,28 @@ case $host_os in ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 -$as_echo_n "checking for $compiler option to produce PIC... " >&6; } -if ${lt_cv_prog_compiler_pic_CXX+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 +printf %s "checking for $compiler option to produce PIC... " >&6; } +if test ${lt_cv_prog_compiler_pic_CXX+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_prog_compiler_pic_CXX=$lt_prog_compiler_pic_CXX fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_CXX" >&5 -$as_echo "$lt_cv_prog_compiler_pic_CXX" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_CXX" >&5 +printf "%s\n" "$lt_cv_prog_compiler_pic_CXX" >&6; } lt_prog_compiler_pic_CXX=$lt_cv_prog_compiler_pic_CXX # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic_CXX"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 -$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... " >&6; } -if ${lt_cv_prog_compiler_pic_works_CXX+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 +printf %s "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... " >&6; } +if test ${lt_cv_prog_compiler_pic_works_CXX+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_prog_compiler_pic_works_CXX=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext @@ -15804,8 +16983,8 @@ else $RM conftest* fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works_CXX" >&5 -$as_echo "$lt_cv_prog_compiler_pic_works_CXX" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works_CXX" >&5 +printf "%s\n" "$lt_cv_prog_compiler_pic_works_CXX" >&6; } if test yes = "$lt_cv_prog_compiler_pic_works_CXX"; then case $lt_prog_compiler_pic_CXX in @@ -15827,11 +17006,12 @@ fi # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 -$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } -if ${lt_cv_prog_compiler_static_works_CXX+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +printf %s "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } +if test ${lt_cv_prog_compiler_static_works_CXX+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_prog_compiler_static_works_CXX=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS $lt_tmp_static_flag" @@ -15855,8 +17035,8 @@ else LDFLAGS=$save_LDFLAGS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works_CXX" >&5 -$as_echo "$lt_cv_prog_compiler_static_works_CXX" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works_CXX" >&5 +printf "%s\n" "$lt_cv_prog_compiler_static_works_CXX" >&6; } if test yes = "$lt_cv_prog_compiler_static_works_CXX"; then : @@ -15867,11 +17047,12 @@ fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 -$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } -if ${lt_cv_prog_compiler_c_o_CXX+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +printf %s "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if test ${lt_cv_prog_compiler_c_o_CXX+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_prog_compiler_c_o_CXX=no $RM -r conftest 2>/dev/null mkdir conftest @@ -15914,16 +17095,17 @@ else $RM conftest* fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5 -$as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5 +printf "%s\n" "$lt_cv_prog_compiler_c_o_CXX" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 -$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } -if ${lt_cv_prog_compiler_c_o_CXX+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +printf %s "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if test ${lt_cv_prog_compiler_c_o_CXX+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_prog_compiler_c_o_CXX=no $RM -r conftest 2>/dev/null mkdir conftest @@ -15966,8 +17148,8 @@ else $RM conftest* fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5 -$as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5 +printf "%s\n" "$lt_cv_prog_compiler_c_o_CXX" >&6; } @@ -15975,19 +17157,19 @@ $as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; } hard_links=nottested if test no = "$lt_cv_prog_compiler_c_o_CXX" && test no != "$need_locks"; then # do not overwrite the value of need_locks provided by the user - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 -$as_echo_n "checking if we can lock with hard links... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 +printf %s "checking if we can lock with hard links... " >&6; } hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 -$as_echo "$hard_links" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 +printf "%s\n" "$hard_links" >&6; } if test no = "$hard_links"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5 -$as_echo "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5 +printf "%s\n" "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;} need_locks=warn fi else @@ -15996,8 +17178,8 @@ fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 -$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +printf %s "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' @@ -16014,15 +17196,15 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else - export_symbols_cmds_CXX='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' + export_symbols_cmds_CXX='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi ;; pw32*) export_symbols_cmds_CXX=$ltdll_cmds ;; - cygwin* | mingw* | cegcc*) + cygwin* | mingw* | windows* | cegcc*) case $cc_basename in - cl*) + cl* | icl*) exclude_expsyms_CXX='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' ;; *) @@ -16036,8 +17218,8 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 -$as_echo "$ld_shlibs_CXX" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 +printf "%s\n" "$ld_shlibs_CXX" >&6; } test no = "$ld_shlibs_CXX" && can_build_shared=no with_gnu_ld_CXX=$with_gnu_ld @@ -16064,18 +17246,19 @@ x|xyes) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 -$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } -if ${lt_cv_archive_cmds_need_lc_CXX+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 +printf %s "checking whether -lc should be explicitly linked in... " >&6; } +if test ${lt_cv_archive_cmds_need_lc_CXX+y} +then : + printf %s "(cached) " >&6 +else $as_nop $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then soname=conftest lib=conftest @@ -16093,7 +17276,7 @@ else if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then lt_cv_archive_cmds_need_lc_CXX=no @@ -16107,8 +17290,8 @@ else $RM conftest* fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc_CXX" >&5 -$as_echo "$lt_cv_archive_cmds_need_lc_CXX" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc_CXX" >&5 +printf "%s\n" "$lt_cv_archive_cmds_need_lc_CXX" >&6; } archive_cmds_need_lc_CXX=$lt_cv_archive_cmds_need_lc_CXX ;; esac @@ -16177,8 +17360,8 @@ esac - { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 -$as_echo_n "checking dynamic linker characteristics... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 +printf %s "checking dynamic linker characteristics... " >&6; } library_names_spec= libname_spec='lib$name' @@ -16247,7 +17430,7 @@ aix[4-9]*) # Unfortunately, runtime linking may impact performance, so we do # not want this to be the default eventually. Also, we use the # versioned .so libs for executables only if there is the -brtl - # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. + # linker flag in LDFLAGS as well, or --enable-aix-soname=svr4 only. # To allow for filename-based versioning support, we need to create # libNAME.so.V as an archive file, containing: # *) an Import File, referring to the versioned filename of the @@ -16341,7 +17524,7 @@ bsdi[45]*) # libtool to hard-code these into programs ;; -cygwin* | mingw* | pw32* | cegcc*) +cygwin* | mingw* | windows* | pw32* | cegcc*) version_type=windows shrext_cmds=.dll need_version=no @@ -16352,6 +17535,19 @@ cygwin* | mingw* | pw32* | cegcc*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds + # If user builds GCC with mulitlibs enabled, + # it should just install on $(libdir) + # not on $(libdir)/../bin or 32 bits dlls would override 64 bit ones. + if test yes = $multilib; then + postinstall_cmds='base_file=`basename \$file`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + $install_prog $dir/$dlname $destdir/$dlname~ + chmod a+x $destdir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib $destdir/$dlname'\'' || exit \$?; + fi' + else postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ @@ -16361,6 +17557,7 @@ cygwin* | mingw* | pw32* | cegcc*) if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' + fi postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' @@ -16369,29 +17566,29 @@ cygwin* | mingw* | pw32* | cegcc*) case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' - soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' + soname_spec='`echo $libname | $SED -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; - mingw* | cegcc*) + mingw* | windows* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' - library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' + library_names_spec='`echo $libname | $SED -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; esac dynamic_linker='Win32 ld.exe' ;; - *,cl*) - # Native MSVC + *,cl* | *,icl*) + # Native MSVC or ICC libname_spec='$name' soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' library_names_spec='$libname.dll.lib' case $build_os in - mingw*) + mingw* | windows*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' @@ -16404,7 +17601,7 @@ cygwin* | mingw* | pw32* | cegcc*) done IFS=$lt_save_ifs # Convert to MSYS style. - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form @@ -16441,7 +17638,7 @@ cygwin* | mingw* | pw32* | cegcc*) ;; *) - # Assume MSVC wrapper + # Assume MSVC and ICC wrapper library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib' dynamic_linker='Win32 ld.exe' ;; @@ -16473,7 +17670,7 @@ dgux*) shlibpath_var=LD_LIBRARY_PATH ;; -freebsd* | dragonfly*) +freebsd* | dragonfly* | midnightbsd*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then @@ -16510,7 +17707,27 @@ freebsd* | dragonfly*) need_version=no ;; esac + case $host_cpu in + powerpc64) + # On FreeBSD bi-arch platforms, a different variable is used for 32-bit + # binaries. See . + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int test_pointer_size[sizeof (void *) - 5]; + +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : shlibpath_var=LD_LIBRARY_PATH +else $as_nop + shlibpath_var=LD_32_LIBRARY_PATH +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; + *) + shlibpath_var=LD_LIBRARY_PATH + ;; + esac case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes @@ -16651,7 +17868,7 @@ linux*android*) version_type=none # Android doesn't support versioned libraries. need_lib_prefix=no need_version=no - library_names_spec='$libname$release$shared_ext' + library_names_spec='$libname$release$shared_ext $libname$shared_ext' soname_spec='$libname$release$shared_ext' finish_cmds= shlibpath_var=LD_LIBRARY_PATH @@ -16663,8 +17880,9 @@ linux*android*) hardcode_into_libs=yes dynamic_linker='Android linker' - # Don't embed -rpath directories since the linker doesn't support them. - hardcode_libdir_flag_spec_CXX='-L$libdir' + # -rpath works at least for libraries that are not overridden by + # libraries installed in system locations. + hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' ;; # This must be glibc/ELF. @@ -16679,9 +17897,10 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH - if ${lt_cv_shlibpath_overrides_runpath+:} false; then : - $as_echo_n "(cached) " >&6 -else + if test ${lt_cv_shlibpath_overrides_runpath+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir @@ -16691,19 +17910,21 @@ else /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : - if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : +if ac_fn_cxx_try_link "$LINENO" +then : + if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null +then : lt_cv_shlibpath_overrides_runpath=yes fi fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir @@ -16717,7 +17938,7 @@ fi # before this can be enabled. hardcode_into_libs=yes - # Ideally, we could use ldconfig to report *all* directores which are + # Ideally, we could use ldconfig to report *all* directories which are # searched for libraries, however this is still not possible. Aside from not # being certain /sbin/ldconfig is available, command # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, @@ -16774,7 +17995,7 @@ newsos6) dynamic_linker='ldqnx.so' ;; -openbsd* | bitrig*) +openbsd*) version_type=sunos sys_lib_dlsearch_path_spec=/usr/lib need_lib_prefix=no @@ -16935,8 +18156,8 @@ uts4*) dynamic_linker=no ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 -$as_echo "$dynamic_linker" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 +printf "%s\n" "$dynamic_linker" >&6; } test no = "$dynamic_linker" && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" @@ -17000,8 +18221,8 @@ configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH - { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 -$as_echo_n "checking how to hardcode library paths into programs... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 +printf %s "checking how to hardcode library paths into programs... " >&6; } hardcode_action_CXX= if test -n "$hardcode_libdir_flag_spec_CXX" || test -n "$runpath_var_CXX" || @@ -17025,8 +18246,8 @@ else # directories. hardcode_action_CXX=unsupported fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action_CXX" >&5 -$as_echo "$hardcode_action_CXX" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $hardcode_action_CXX" >&5 +printf "%s\n" "$hardcode_action_CXX" >&6; } if test relink = "$hardcode_action_CXX" || test yes = "$inherit_rpath_CXX"; then @@ -17066,18 +18287,20 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu -if test "$GCC" = yes; then : +if test "$GCC" = yes +then : for flag in -Wall -Wextra; do - as_CACHEVAR=`$as_echo "ax_cv_check_cxxflags__$flag" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C++ compiler accepts $flag" >&5 -$as_echo_n "checking whether C++ compiler accepts $flag... " >&6; } -if eval \${$as_CACHEVAR+:} false; then : - $as_echo_n "(cached) " >&6 -else + as_CACHEVAR=`printf "%s\n" "ax_cv_check_cxxflags__$flag" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C++ compiler accepts $flag" >&5 +printf %s "checking whether C++ compiler accepts $flag... " >&6; } +if eval test \${$as_CACHEVAR+y} +then : + printf %s "(cached) " >&6 +else $as_nop ax_check_save_flags=$CXXFLAGS CXXFLAGS="$CXXFLAGS -Werror $flag" @@ -17085,51 +18308,54 @@ else /* end confdefs.h. */ int main(void) { return 0; } _ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : +if ac_fn_cxx_try_compile "$LINENO" +then : eval "$as_CACHEVAR=yes" -else +else $as_nop eval "$as_CACHEVAR=no" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CXXFLAGS=$ax_check_save_flags fi eval ac_res=\$$as_CACHEVAR - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_CACHEVAR"\" = x"yes"; then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_CACHEVAR"\" = x"yes" +then : -if ${AM_CXXFLAGS+:} false; then : +if test ${AM_CXXFLAGS+y} +then : case " $AM_CXXFLAGS " in #( *" $flag "*) : - { { $as_echo "$as_me:${as_lineno-$LINENO}: : AM_CXXFLAGS already contains \$flag"; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CXXFLAGS already contains \$flag"; } >&5 (: AM_CXXFLAGS already contains $flag) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } ;; #( *) : as_fn_append AM_CXXFLAGS " $flag" - { { $as_echo "$as_me:${as_lineno-$LINENO}: : AM_CXXFLAGS=\"\$AM_CXXFLAGS\""; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CXXFLAGS=\"\$AM_CXXFLAGS\""; } >&5 (: AM_CXXFLAGS="$AM_CXXFLAGS") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } ;; esac -else +else $as_nop AM_CXXFLAGS=$flag - { { $as_echo "$as_me:${as_lineno-$LINENO}: : AM_CXXFLAGS=\"\$AM_CXXFLAGS\""; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CXXFLAGS=\"\$AM_CXXFLAGS\""; } >&5 (: AM_CXXFLAGS="$AM_CXXFLAGS") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } fi -else +else $as_nop : fi @@ -17140,12 +18366,13 @@ done for flag in -fexceptions; do - as_CACHEVAR=`$as_echo "ax_cv_check_cxxflags__$flag" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C++ compiler accepts $flag" >&5 -$as_echo_n "checking whether C++ compiler accepts $flag... " >&6; } -if eval \${$as_CACHEVAR+:} false; then : - $as_echo_n "(cached) " >&6 -else + as_CACHEVAR=`printf "%s\n" "ax_cv_check_cxxflags__$flag" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C++ compiler accepts $flag" >&5 +printf %s "checking whether C++ compiler accepts $flag... " >&6; } +if eval test \${$as_CACHEVAR+y} +then : + printf %s "(cached) " >&6 +else $as_nop ax_check_save_flags=$CXXFLAGS CXXFLAGS="$CXXFLAGS -Werror $flag" @@ -17153,51 +18380,54 @@ else /* end confdefs.h. */ int main(void) { return 0; } _ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : +if ac_fn_cxx_try_compile "$LINENO" +then : eval "$as_CACHEVAR=yes" -else +else $as_nop eval "$as_CACHEVAR=no" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CXXFLAGS=$ax_check_save_flags fi eval ac_res=\$$as_CACHEVAR - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_CACHEVAR"\" = x"yes"; then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_CACHEVAR"\" = x"yes" +then : -if ${AM_CXXFLAGS+:} false; then : +if test ${AM_CXXFLAGS+y} +then : case " $AM_CXXFLAGS " in #( *" $flag "*) : - { { $as_echo "$as_me:${as_lineno-$LINENO}: : AM_CXXFLAGS already contains \$flag"; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CXXFLAGS already contains \$flag"; } >&5 (: AM_CXXFLAGS already contains $flag) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } ;; #( *) : as_fn_append AM_CXXFLAGS " $flag" - { { $as_echo "$as_me:${as_lineno-$LINENO}: : AM_CXXFLAGS=\"\$AM_CXXFLAGS\""; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CXXFLAGS=\"\$AM_CXXFLAGS\""; } >&5 (: AM_CXXFLAGS="$AM_CXXFLAGS") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } ;; esac -else +else $as_nop AM_CXXFLAGS=$flag - { { $as_echo "$as_me:${as_lineno-$LINENO}: : AM_CXXFLAGS=\"\$AM_CXXFLAGS\""; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CXXFLAGS=\"\$AM_CXXFLAGS\""; } >&5 (: AM_CXXFLAGS="$AM_CXXFLAGS") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } fi -else +else $as_nop : fi @@ -17208,12 +18438,13 @@ done for flag in -fno-strict-aliasing; do - as_CACHEVAR=`$as_echo "ax_cv_check_cxxflags__$flag" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C++ compiler accepts $flag" >&5 -$as_echo_n "checking whether C++ compiler accepts $flag... " >&6; } -if eval \${$as_CACHEVAR+:} false; then : - $as_echo_n "(cached) " >&6 -else + as_CACHEVAR=`printf "%s\n" "ax_cv_check_cxxflags__$flag" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C++ compiler accepts $flag" >&5 +printf %s "checking whether C++ compiler accepts $flag... " >&6; } +if eval test \${$as_CACHEVAR+y} +then : + printf %s "(cached) " >&6 +else $as_nop ax_check_save_flags=$CXXFLAGS CXXFLAGS="$CXXFLAGS -Werror $flag" @@ -17221,51 +18452,54 @@ else /* end confdefs.h. */ int main(void) { return 0; } _ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : +if ac_fn_cxx_try_compile "$LINENO" +then : eval "$as_CACHEVAR=yes" -else +else $as_nop eval "$as_CACHEVAR=no" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CXXFLAGS=$ax_check_save_flags fi eval ac_res=\$$as_CACHEVAR - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_CACHEVAR"\" = x"yes"; then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_CACHEVAR"\" = x"yes" +then : -if ${AM_CXXFLAGS+:} false; then : +if test ${AM_CXXFLAGS+y} +then : case " $AM_CXXFLAGS " in #( *" $flag "*) : - { { $as_echo "$as_me:${as_lineno-$LINENO}: : AM_CXXFLAGS already contains \$flag"; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CXXFLAGS already contains \$flag"; } >&5 (: AM_CXXFLAGS already contains $flag) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } ;; #( *) : as_fn_append AM_CXXFLAGS " $flag" - { { $as_echo "$as_me:${as_lineno-$LINENO}: : AM_CXXFLAGS=\"\$AM_CXXFLAGS\""; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CXXFLAGS=\"\$AM_CXXFLAGS\""; } >&5 (: AM_CXXFLAGS="$AM_CXXFLAGS") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } ;; esac -else +else $as_nop AM_CXXFLAGS=$flag - { { $as_echo "$as_me:${as_lineno-$LINENO}: : AM_CXXFLAGS=\"\$AM_CXXFLAGS\""; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CXXFLAGS=\"\$AM_CXXFLAGS\""; } >&5 (: AM_CXXFLAGS="$AM_CXXFLAGS") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } fi -else +else $as_nop : fi @@ -17279,18 +18513,20 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu -if test "$GCC" = yes; then : +if test "$GCC" = yes +then : for flag in -fno-strict-aliasing; do - as_CACHEVAR=`$as_echo "ax_cv_check_ldflags__$flag" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the linker accepts $flag" >&5 -$as_echo_n "checking whether the linker accepts $flag... " >&6; } -if eval \${$as_CACHEVAR+:} false; then : - $as_echo_n "(cached) " >&6 -else + as_CACHEVAR=`printf "%s\n" "ax_cv_check_ldflags__$flag" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the linker accepts $flag" >&5 +printf %s "checking whether the linker accepts $flag... " >&6; } +if eval test \${$as_CACHEVAR+y} +then : + printf %s "(cached) " >&6 +else $as_nop ax_check_save_flags=$LDFLAGS LDFLAGS="$LDFLAGS $flag" @@ -17298,59 +18534,62 @@ else /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : eval "$as_CACHEVAR=yes" -else +else $as_nop eval "$as_CACHEVAR=no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$ax_check_save_flags fi eval ac_res=\$$as_CACHEVAR - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_CACHEVAR"\" = x"yes"; then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_CACHEVAR"\" = x"yes" +then : -if ${AM_LDFLAGS+:} false; then : +if test ${AM_LDFLAGS+y} +then : case " $AM_LDFLAGS " in #( *" $flag "*) : - { { $as_echo "$as_me:${as_lineno-$LINENO}: : AM_LDFLAGS already contains \$flag"; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_LDFLAGS already contains \$flag"; } >&5 (: AM_LDFLAGS already contains $flag) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } ;; #( *) : as_fn_append AM_LDFLAGS " $flag" - { { $as_echo "$as_me:${as_lineno-$LINENO}: : AM_LDFLAGS=\"\$AM_LDFLAGS\""; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_LDFLAGS=\"\$AM_LDFLAGS\""; } >&5 (: AM_LDFLAGS="$AM_LDFLAGS") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } ;; esac -else +else $as_nop AM_LDFLAGS=$flag - { { $as_echo "$as_me:${as_lineno-$LINENO}: : AM_LDFLAGS=\"\$AM_LDFLAGS\""; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_LDFLAGS=\"\$AM_LDFLAGS\""; } >&5 (: AM_LDFLAGS="$AM_LDFLAGS") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } fi -else +else $as_nop : fi @@ -17370,11 +18609,12 @@ esac ;; #( ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether compiler supports visibility" >&5 -$as_echo_n "checking whether compiler supports visibility... " >&6; } -if ${expatcfg_cv_compiler_supports_visibility+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether compiler supports visibility" >&5 +printf %s "checking whether compiler supports visibility... " >&6; } +if test ${expatcfg_cv_compiler_supports_visibility+y} +then : + printf %s "(cached) " >&6 +else $as_nop expatcfg_cv_compiler_supports_visibility=no OLDFLAGS=$CFLAGS as_fn_append CFLAGS " -fvisibility=hidden -Wall -Werror -Wno-unknown-warning-option" @@ -17385,201 +18625,96 @@ else void foo(void) {} _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : expatcfg_cv_compiler_supports_visibility=yes fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CFLAGS=$OLDFLAGS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $expatcfg_cv_compiler_supports_visibility" >&5 -$as_echo "$expatcfg_cv_compiler_supports_visibility" >&6; } - if test "$expatcfg_cv_compiler_supports_visibility" = yes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $expatcfg_cv_compiler_supports_visibility" >&5 +printf "%s\n" "$expatcfg_cv_compiler_supports_visibility" >&6; } + if test "$expatcfg_cv_compiler_supports_visibility" = yes +then : -if ${AM_CFLAGS+:} false; then : +if test ${AM_CFLAGS+y} +then : case " $AM_CFLAGS " in #( *" -fvisibility=hidden "*) : - { { $as_echo "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS already contains -fvisibility=hidden"; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS already contains -fvisibility=hidden"; } >&5 (: AM_CFLAGS already contains -fvisibility=hidden) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } ;; #( *) : as_fn_append AM_CFLAGS " -fvisibility=hidden" - { { $as_echo "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS=\"\$AM_CFLAGS\""; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS=\"\$AM_CFLAGS\""; } >&5 (: AM_CFLAGS="$AM_CFLAGS") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } ;; esac -else +else $as_nop AM_CFLAGS=-fvisibility=hidden - { { $as_echo "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS=\"\$AM_CFLAGS\""; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS=\"\$AM_CFLAGS\""; } >&5 (: AM_CFLAGS="$AM_CFLAGS") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - -fi - - -if ${AM_CPPFLAGS+:} false; then : - - case " $AM_CPPFLAGS " in #( - *" -DXML_ENABLE_VISIBILITY=1 "*) : - { { $as_echo "$as_me:${as_lineno-$LINENO}: : AM_CPPFLAGS already contains -DXML_ENABLE_VISIBILITY=1"; } >&5 - (: AM_CPPFLAGS already contains -DXML_ENABLE_VISIBILITY=1) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } ;; #( - *) : - - as_fn_append AM_CPPFLAGS " -DXML_ENABLE_VISIBILITY=1" - { { $as_echo "$as_me:${as_lineno-$LINENO}: : AM_CPPFLAGS=\"\$AM_CPPFLAGS\""; } >&5 - (: AM_CPPFLAGS="$AM_CPPFLAGS") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - ;; -esac - -else - - AM_CPPFLAGS=-DXML_ENABLE_VISIBILITY=1 - { { $as_echo "$as_me:${as_lineno-$LINENO}: : AM_CPPFLAGS=\"\$AM_CPPFLAGS\""; } >&5 - (: AM_CPPFLAGS="$AM_CPPFLAGS") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - -fi - -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 -$as_echo_n "checking for ANSI C header files... " >&6; } -if ${ac_cv_header_stdc+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#include -#include - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_header_stdc=yes -else - ac_cv_header_stdc=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then : - -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then : + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } -else - ac_cv_header_stdc=no fi -rm -f conftest* -fi + if test "${enable_shared}" = yes +then : -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then : - : -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#if ((' ' & 0x0FF) == 0x020) -# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#else -# define ISLOWER(c) \ - (('a' <= (c) && (c) <= 'i') \ - || ('j' <= (c) && (c) <= 'r') \ - || ('s' <= (c) && (c) <= 'z')) -# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) -#endif +if test ${AM_CPPFLAGS+y} +then : -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) -int -main () -{ - int i; - for (i = 0; i < 256; i++) - if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) - return 2; - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : + case " $AM_CPPFLAGS " in #( + *" -DXML_ENABLE_VISIBILITY=1 "*) : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CPPFLAGS already contains -DXML_ENABLE_VISIBILITY=1"; } >&5 + (: AM_CPPFLAGS already contains -DXML_ENABLE_VISIBILITY=1) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } ;; #( + *) : -else - ac_cv_header_stdc=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi + as_fn_append AM_CPPFLAGS " -DXML_ENABLE_VISIBILITY=1" + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CPPFLAGS=\"\$AM_CPPFLAGS\""; } >&5 + (: AM_CPPFLAGS="$AM_CPPFLAGS") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + ;; +esac -fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 -$as_echo "$ac_cv_header_stdc" >&6; } -if test $ac_cv_header_stdc = yes; then +else $as_nop -$as_echo "#define STDC_HEADERS 1" >>confdefs.h + AM_CPPFLAGS=-DXML_ENABLE_VISIBILITY=1 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CPPFLAGS=\"\$AM_CPPFLAGS\""; } >&5 + (: AM_CPPFLAGS="$AM_CPPFLAGS") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } fi +fi +fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 -$as_echo_n "checking whether byte ordering is bigendian... " >&6; } -if ${ac_cv_c_bigendian+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 +printf %s "checking whether byte ordering is bigendian... " >&6; } +if test ${ac_cv_c_bigendian+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_cv_c_bigendian=unknown # See if we're dealing with a universal compiler. cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -17590,7 +18725,8 @@ else typedef int dummy; _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : # Check for potential -arch flags. It is not universal unless # there are at least two -arch flags with different values. @@ -17614,7 +18750,7 @@ if ac_fn_c_try_compile "$LINENO"; then : fi done fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext if test $ac_cv_c_bigendian = unknown; then # See if sys/param.h defines the BYTE_ORDER macro. cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -17623,7 +18759,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext #include int -main () +main (void) { #if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ @@ -17635,7 +18771,8 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : # It does; now see whether it defined to BIG_ENDIAN or not. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -17643,7 +18780,7 @@ if ac_fn_c_try_compile "$LINENO"; then : #include int -main () +main (void) { #if BYTE_ORDER != BIG_ENDIAN not big endian @@ -17653,14 +18790,15 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_c_bigendian=yes -else +else $as_nop ac_cv_c_bigendian=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi if test $ac_cv_c_bigendian = unknown; then # See if defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). @@ -17669,7 +18807,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext #include int -main () +main (void) { #if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) bogus endian macros @@ -17679,14 +18817,15 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : # It does; now see whether it defined to _BIG_ENDIAN or not. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main () +main (void) { #ifndef _BIG_ENDIAN not big endian @@ -17696,50 +18835,54 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_c_bigendian=yes -else +else $as_nop ac_cv_c_bigendian=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi if test $ac_cv_c_bigendian = unknown; then # Compile a test program. - if test "$cross_compiling" = yes; then : + if test "$cross_compiling" = yes +then : # Try to guess by grepping values from an object file. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -short int ascii_mm[] = +unsigned short int ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; - short int ascii_ii[] = + unsigned short int ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; int use_ascii (int i) { return ascii_mm[i] + ascii_ii[i]; } - short int ebcdic_ii[] = + unsigned short int ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; - short int ebcdic_mm[] = + unsigned short int ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; int use_ebcdic (int i) { return ebcdic_mm[i] + ebcdic_ii[i]; } - extern int foo; - -int -main () -{ -return use_ascii (foo) == use_ebcdic (foo); - ; - return 0; -} + int + main (int argc, char **argv) + { + /* Intimidate the compiler so that it does not + optimize the arrays away. */ + char *p = argv[0]; + ascii_mm[1] = *p++; ebcdic_mm[1] = *p++; + ascii_ii[1] = *p++; ebcdic_ii[1] = *p++; + return use_ascii (argc) == use_ebcdic (*p); + } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then +if ac_fn_c_try_link "$LINENO" +then : + if grep BIGenDianSyS conftest$ac_exeext >/dev/null; then ac_cv_c_bigendian=yes fi - if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then + if grep LiTTleEnDian conftest$ac_exeext >/dev/null ; then if test "$ac_cv_c_bigendian" = unknown; then ac_cv_c_bigendian=no else @@ -17748,251 +18891,798 @@ if ac_fn_c_try_compile "$LINENO"; then : fi fi fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -else +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int -main () +main (void) +{ + + /* Are we little or big endian? From Harbison&Steele. */ + union + { + long int l; + char c[sizeof (long int)]; + } u; + u.l = 1; + return u.c[sizeof (long int) - 1] == 1; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + ac_cv_c_bigendian=no +else $as_nop + ac_cv_c_bigendian=yes +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + fi +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5 +printf "%s\n" "$ac_cv_c_bigendian" >&6; } + case $ac_cv_c_bigendian in #( + yes) + printf "%s\n" "#define WORDS_BIGENDIAN 1" >>confdefs.h + + BYTEORDER=4321;; #( + no) + BYTEORDER=1234 ;; #( + universal) + +printf "%s\n" "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h + + ;; #( + *) + as_fn_error $? "unknown endianness + presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;; + esac + + +printf "%s\n" "#define BYTEORDER $BYTEORDER" >>confdefs.h + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 +printf %s "checking for an ANSI C-conforming const... " >&6; } +if test ${ac_cv_c_const+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + +#ifndef __cplusplus + /* Ultrix mips cc rejects this sort of thing. */ + typedef int charset[2]; + const charset cs = { 0, 0 }; + /* SunOS 4.1.1 cc rejects this. */ + char const *const *pcpcc; + char **ppc; + /* NEC SVR4.0.2 mips cc rejects this. */ + struct point {int x, y;}; + static struct point const zero = {0,0}; + /* IBM XL C 1.02.0.0 rejects this. + It does not let you subtract one const X* pointer from another in + an arm of an if-expression whose if-part is not a constant + expression */ + const char *g = "string"; + pcpcc = &g + (g ? g-g : 0); + /* HPUX 7.0 cc rejects these. */ + ++pcpcc; + ppc = (char**) pcpcc; + pcpcc = (char const *const *) ppc; + { /* SCO 3.2v4 cc rejects this sort of thing. */ + char tx; + char *t = &tx; + char const *s = 0 ? (char *) 0 : (char const *) 0; + + *t++ = 0; + if (s) return 0; + } + { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ + int x[] = {25, 17}; + const int *foo = &x[0]; + ++foo; + } + { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ + typedef const int *iptr; + iptr p = 0; + ++p; + } + { /* IBM XL C 1.02.0.0 rejects this sort of thing, saying + "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ + struct s { int j; const int *ap[3]; } bx; + struct s *b = &bx; b->j = 5; + } + { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ + const int foo = 10; + if (!foo) return 0; + } + return !cs[0] && !zero.x; +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_c_const=yes +else $as_nop + ac_cv_c_const=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 +printf "%s\n" "$ac_cv_c_const" >&6; } +if test $ac_cv_c_const = no; then + +printf "%s\n" "#define const /**/" >>confdefs.h + +fi + + + +# Check whether --with-xmlwf was given. +if test ${with_xmlwf+y} +then : + withval=$with_xmlwf; +else $as_nop + with_xmlwf=yes +fi + + if test x${with_xmlwf} = xyes; then + WITH_XMLWF_TRUE= + WITH_XMLWF_FALSE='#' +else + WITH_XMLWF_TRUE='#' + WITH_XMLWF_FALSE= +fi + + + +# Check whether --with-examples was given. +if test ${with_examples+y} +then : + withval=$with_examples; +else $as_nop + with_examples=yes +fi + + if test x${with_examples} = xyes; then + WITH_EXAMPLES_TRUE= + WITH_EXAMPLES_FALSE='#' +else + WITH_EXAMPLES_TRUE='#' + WITH_EXAMPLES_FALSE= +fi + + + +# Check whether --with-tests was given. +if test ${with_tests+y} +then : + withval=$with_tests; +else $as_nop + with_tests=yes +fi + + if test x${with_tests} = xyes; then + WITH_TESTS_TRUE= + WITH_TESTS_FALSE='#' +else + WITH_TESTS_TRUE='#' + WITH_TESTS_FALSE= +fi + + +if test x${with_tests} = xyes +then : + ax_cxx_compile_alternatives="11 0x" ax_cxx_compile_cxx11_required=true + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + ac_success=no + + + + + + if test x$ac_success = xno; then + for alternative in ${ax_cxx_compile_alternatives}; do + for switch in -std=c++${alternative} +std=c++${alternative} "-h std=c++${alternative}" MSVC; do + if test x"$switch" = xMSVC; then + switch=-std:c++${alternative} + cachevar=`printf "%s\n" "ax_cv_cxx_compile_cxx11_${switch}_MSVC" | $as_tr_sh` + else + cachevar=`printf "%s\n" "ax_cv_cxx_compile_cxx11_$switch" | $as_tr_sh` + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++11 features with $switch" >&5 +printf %s "checking whether $CXX supports C++11 features with $switch... " >&6; } +if eval test \${$cachevar+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_save_CXX="$CXX" + CXX="$CXX $switch" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +// If the compiler admits that it is not ready for C++11, why torture it? +// Hopefully, this will speed up the test. + +#ifndef __cplusplus + +#error "This is not a C++ compiler" + +// MSVC always sets __cplusplus to 199711L in older versions; newer versions +// only set it correctly if /Zc:__cplusplus is specified as well as a +// /std:c++NN switch: +// https://devblogs.microsoft.com/cppblog/msvc-now-correctly-reports-__cplusplus/ +#elif __cplusplus < 201103L && !defined _MSC_VER + +#error "This is not a C++11 compiler" + +#else + +namespace cxx11 { - /* Are we little or big endian? From Harbison&Steele. */ - union - { - long int l; - char c[sizeof (long int)]; - } u; - u.l = 1; - return u.c[sizeof (long int) - 1] == 1; + namespace test_static_assert + { + + template + struct check + { + static_assert(sizeof(int) <= sizeof(T), "not big enough"); + }; + + } + + namespace test_final_override + { + + struct Base + { + virtual ~Base() {} + virtual void f() {} + }; + + struct Derived : public Base + { + virtual ~Derived() override {} + virtual void f() override {} + }; + + } + + namespace test_double_right_angle_brackets + { + + template < typename T > + struct check {}; + + typedef check single_type; + typedef check> double_type; + typedef check>> triple_type; + typedef check>>> quadruple_type; + + } + + namespace test_decltype + { + + int + f() + { + int a = 1; + decltype(a) b = 2; + return a + b; + } + + } - ; - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - ac_cv_c_bigendian=no -else - ac_cv_c_bigendian=yes -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi + namespace test_type_deduction + { - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5 -$as_echo "$ac_cv_c_bigendian" >&6; } - case $ac_cv_c_bigendian in #( - yes) - $as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h + template < typename T1, typename T2 > + struct is_same + { + static const bool value = false; + }; - BYTEORDER=4321;; #( - no) - BYTEORDER=1234 ;; #( - universal) + template < typename T > + struct is_same + { + static const bool value = true; + }; -$as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h + template < typename T1, typename T2 > + auto + add(T1 a1, T2 a2) -> decltype(a1 + a2) + { + return a1 + a2; + } - ;; #( - *) - as_fn_error $? "unknown endianness - presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;; - esac + int + test(const int c, volatile int v) + { + static_assert(is_same::value == true, ""); + static_assert(is_same::value == false, ""); + static_assert(is_same::value == false, ""); + auto ac = c; + auto av = v; + auto sumi = ac + av + 'x'; + auto sumf = ac + av + 1.0; + static_assert(is_same::value == true, ""); + static_assert(is_same::value == true, ""); + static_assert(is_same::value == true, ""); + static_assert(is_same::value == false, ""); + static_assert(is_same::value == true, ""); + return (sumf > 0.0) ? sumi : add(c, v); + } + } -cat >>confdefs.h <<_ACEOF -#define BYTEORDER $BYTEORDER -_ACEOF + namespace test_noexcept + { + int f() { return 0; } + int g() noexcept { return 0; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 -$as_echo_n "checking for an ANSI C-conforming const... " >&6; } -if ${ac_cv_c_const+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + static_assert(noexcept(f()) == false, ""); + static_assert(noexcept(g()) == true, ""); -int -main () -{ + } -#ifndef __cplusplus - /* Ultrix mips cc rejects this sort of thing. */ - typedef int charset[2]; - const charset cs = { 0, 0 }; - /* SunOS 4.1.1 cc rejects this. */ - char const *const *pcpcc; - char **ppc; - /* NEC SVR4.0.2 mips cc rejects this. */ - struct point {int x, y;}; - static struct point const zero = {0,0}; - /* AIX XL C 1.02.0.0 rejects this. - It does not let you subtract one const X* pointer from another in - an arm of an if-expression whose if-part is not a constant - expression */ - const char *g = "string"; - pcpcc = &g + (g ? g-g : 0); - /* HPUX 7.0 cc rejects these. */ - ++pcpcc; - ppc = (char**) pcpcc; - pcpcc = (char const *const *) ppc; - { /* SCO 3.2v4 cc rejects this sort of thing. */ - char tx; - char *t = &tx; - char const *s = 0 ? (char *) 0 : (char const *) 0; + namespace test_constexpr + { + + template < typename CharT > + unsigned long constexpr + strlen_c_r(const CharT *const s, const unsigned long acc) noexcept + { + return *s ? strlen_c_r(s + 1, acc + 1) : acc; + } + + template < typename CharT > + unsigned long constexpr + strlen_c(const CharT *const s) noexcept + { + return strlen_c_r(s, 0UL); + } + + static_assert(strlen_c("") == 0UL, ""); + static_assert(strlen_c("1") == 1UL, ""); + static_assert(strlen_c("example") == 7UL, ""); + static_assert(strlen_c("another\0example") == 7UL, ""); - *t++ = 0; - if (s) return 0; } - { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ - int x[] = {25, 17}; - const int *foo = &x[0]; - ++foo; + + namespace test_rvalue_references + { + + template < int N > + struct answer + { + static constexpr int value = N; + }; + + answer<1> f(int&) { return answer<1>(); } + answer<2> f(const int&) { return answer<2>(); } + answer<3> f(int&&) { return answer<3>(); } + + void + test() + { + int i = 0; + const int c = 0; + static_assert(decltype(f(i))::value == 1, ""); + static_assert(decltype(f(c))::value == 2, ""); + static_assert(decltype(f(0))::value == 3, ""); + } + } - { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ - typedef const int *iptr; - iptr p = 0; - ++p; + + namespace test_uniform_initialization + { + + struct test + { + static const int zero {}; + static const int one {1}; + }; + + static_assert(test::zero == 0, ""); + static_assert(test::one == 1, ""); + } - { /* AIX XL C 1.02.0.0 rejects this sort of thing, saying - "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ - struct s { int j; const int *ap[3]; } bx; - struct s *b = &bx; b->j = 5; + + namespace test_lambdas + { + + void + test1() + { + auto lambda1 = [](){}; + auto lambda2 = lambda1; + lambda1(); + lambda2(); + } + + int + test2() + { + auto a = [](int i, int j){ return i + j; }(1, 2); + auto b = []() -> int { return '0'; }(); + auto c = [=](){ return a + b; }(); + auto d = [&](){ return c; }(); + auto e = [a, &b](int x) mutable { + const auto identity = [](int y){ return y; }; + for (auto i = 0; i < a; ++i) + a += b--; + return x + identity(a + b); + }(0); + return a + b + c + d + e; + } + + int + test3() + { + const auto nullary = [](){ return 0; }; + const auto unary = [](int x){ return x; }; + using nullary_t = decltype(nullary); + using unary_t = decltype(unary); + const auto higher1st = [](nullary_t f){ return f(); }; + const auto higher2nd = [unary](nullary_t f1){ + return [unary, f1](unary_t f2){ return f2(unary(f1())); }; + }; + return higher1st(nullary) + higher2nd(nullary)(unary); + } + } - { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ - const int foo = 10; - if (!foo) return 0; + + namespace test_variadic_templates + { + + template + struct sum; + + template + struct sum + { + static constexpr auto value = N0 + sum::value; + }; + + template <> + struct sum<> + { + static constexpr auto value = 0; + }; + + static_assert(sum<>::value == 0, ""); + static_assert(sum<1>::value == 1, ""); + static_assert(sum<23>::value == 23, ""); + static_assert(sum<1, 2>::value == 3, ""); + static_assert(sum<5, 5, 11>::value == 21, ""); + static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, ""); + } - return !cs[0] && !zero.x; -#endif - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_c_const=yes -else - ac_cv_c_const=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 -$as_echo "$ac_cv_c_const" >&6; } -if test $ac_cv_c_const = no; then + // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae + // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function + // because of this. + namespace test_template_alias_sfinae + { -$as_echo "#define const /**/" >>confdefs.h + struct foo {}; -fi + template + using member = typename T::member_type; + + template + void func(...) {} + + template + void func(member*) {} + + void test(); + + void test() { func(0); } + + } + +} // namespace cxx11 + +#endif // __cplusplus >= 201103L -ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" -if test "x$ac_cv_type_size_t" = xyes; then : -else -cat >>confdefs.h <<_ACEOF -#define size_t unsigned int _ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + eval $cachevar=yes +else $as_nop + eval $cachevar=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + CXX="$ac_save_CXX" +fi +eval ac_res=\$$cachevar + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test x\$$cachevar = xyes; then + CXX="$CXX $switch" + if test -n "$CXXCPP" ; then + CXXCPP="$CXXCPP $switch" + fi + ac_success=yes + break + fi + done + if test x$ac_success = xyes; then + break + fi + done + fi + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu -fi + if test x$ax_cxx_compile_cxx11_required = xtrue; then + if test x$ac_success = xno; then + as_fn_error $? "*** A compiler with support for C++11 language features is required." "$LINENO" 5 + fi + fi + if test x$ac_success = xno; then + HAVE_CXX11=0 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: No compiler with C++11 support was found" >&5 +printf "%s\n" "$as_me: No compiler with C++11 support was found" >&6;} + else + HAVE_CXX11=1 +printf "%s\n" "#define HAVE_CXX11 1" >>confdefs.h + + fi -# Check whether --with-xmlwf was given. -if test "${with_xmlwf+set}" = set; then : - withval=$with_xmlwf; -else - with_xmlwf=yes fi - if test x${with_xmlwf} = xyes; then - WITH_XMLWF_TRUE= - WITH_XMLWF_FALSE='#' +EXPATCFG_ON_MINGW=no +case "${host_os}" in #( + mingw*) : + EXPATCFG_ON_MINGW=yes + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: detected OS: MinGW" >&5 +printf "%s\n" "$as_me: detected OS: MinGW" >&6;} ;; #( + *) : + ;; +esac + if test x${EXPATCFG_ON_MINGW} = xyes; then + MINGW_TRUE= + MINGW_FALSE='#' else - WITH_XMLWF_TRUE='#' - WITH_XMLWF_FALSE= + MINGW_TRUE='#' + MINGW_FALSE= fi + if echo -- "${CPPFLAGS}${CFLAGS}" | ${FGREP} XML_UNICODE >/dev/null; then + UNICODE_TRUE= + UNICODE_FALSE='#' +else + UNICODE_TRUE='#' + UNICODE_FALSE= +fi -# Check whether --with-examples was given. -if test "${with_examples+set}" = set; then : - withval=$with_examples; + if echo -- "${CPPFLAGS}${CFLAGS}" | ${FGREP} XML_UNICODE_WCHAR_T >/dev/null; then + _INTERNAL_UNICODE_WCHAR_T_TRUE= + _INTERNAL_UNICODE_WCHAR_T_FALSE='#' else - with_examples=yes + _INTERNAL_UNICODE_WCHAR_T_TRUE='#' + _INTERNAL_UNICODE_WCHAR_T_FALSE= fi - if test x${with_examples} = xyes; then - WITH_EXAMPLES_TRUE= - WITH_EXAMPLES_FALSE='#' + if echo -- "${CPPFLAGS}${CFLAGS}" | ${FGREP} XML_MIN_SIZE >/dev/null; then + _INTERNAL_MIN_SIZE_TRUE= + _INTERNAL_MIN_SIZE_FALSE='#' else - WITH_EXAMPLES_TRUE='#' - WITH_EXAMPLES_FALSE= + _INTERNAL_MIN_SIZE_TRUE='#' + _INTERNAL_MIN_SIZE_FALSE= fi + if echo -- "${CPPFLAGS}${CFLAGS}" | ${FGREP} XML_LARGE_SIZE >/dev/null; then + _INTERNAL_LARGE_SIZE_TRUE= + _INTERNAL_LARGE_SIZE_FALSE='#' +else + _INTERNAL_LARGE_SIZE_TRUE='#' + _INTERNAL_LARGE_SIZE_FALSE= +fi -# Check whether --with-tests was given. -if test "${with_tests+set}" = set; then : - withval=$with_tests; -else - with_tests=yes +LIBM= +case $host in +*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-mingw* | *-*-pw32* | *-*-darwin*) + # These system don't have libm, or don't need it + ;; +*-ncr-sysv4.3*) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for _mwvalidcheckl in -lmw" >&5 +printf %s "checking for _mwvalidcheckl in -lmw... " >&6; } +if test ${ac_cv_lib_mw__mwvalidcheckl+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-lmw $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char _mwvalidcheckl (void); +int +main (void) +{ +return _mwvalidcheckl (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_mw__mwvalidcheckl=yes +else $as_nop + ac_cv_lib_mw__mwvalidcheckl=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mw__mwvalidcheckl" >&5 +printf "%s\n" "$ac_cv_lib_mw__mwvalidcheckl" >&6; } +if test "x$ac_cv_lib_mw__mwvalidcheckl" = xyes +then : + LIBM=-lmw +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for cos in -lm" >&5 +printf %s "checking for cos in -lm... " >&6; } +if test ${ac_cv_lib_m_cos+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-lm $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char cos (void); +int +main (void) +{ +return cos (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_m_cos=yes +else $as_nop + ac_cv_lib_m_cos=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS fi - - if test x${with_tests} = xyes; then - WITH_TESTS_TRUE= - WITH_TESTS_FALSE='#' -else - WITH_TESTS_TRUE='#' - WITH_TESTS_FALSE= +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_cos" >&5 +printf "%s\n" "$ac_cv_lib_m_cos" >&6; } +if test "x$ac_cv_lib_m_cos" = xyes +then : + LIBM="$LIBM -lm" fi + ;; +*) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for cos in -lm" >&5 +printf %s "checking for cos in -lm... " >&6; } +if test ${ac_cv_lib_m_cos+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-lm $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ - -EXPATCFG_ON_MINGW=no -case "${host_os}" in #( - mingw*) : - EXPATCFG_ON_MINGW=yes - { $as_echo "$as_me:${as_lineno-$LINENO}: detected OS: MinGW" >&5 -$as_echo "$as_me: detected OS: MinGW" >&6;} ;; #( - *) : - ;; -esac - if test x${EXPATCFG_ON_MINGW} = xyes; then - MINGW_TRUE= - MINGW_FALSE='#' -else - MINGW_TRUE='#' - MINGW_FALSE= +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char cos (void); +int +main (void) +{ +return cos (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_m_cos=yes +else $as_nop + ac_cv_lib_m_cos=no fi - - - if echo -- "${CPPFLAGS}${CFLAGS}" | ${FGREP} XML_UNICODE >/dev/null; then - UNICODE_TRUE= - UNICODE_FALSE='#' -else - UNICODE_TRUE='#' - UNICODE_FALSE= +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_cos" >&5 +printf "%s\n" "$ac_cv_lib_m_cos" >&6; } +if test "x$ac_cv_lib_m_cos" = xyes +then : + LIBM=-lm fi + ;; +esac + # Check whether --with-libbsd was given. -if test "${with_libbsd+set}" = set; then : +if test ${with_libbsd+y} +then : withval=$with_libbsd; -else +else $as_nop with_libbsd=no fi -if test "x${with_libbsd}" != xno; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for arc4random_buf in -lbsd" >&5 -$as_echo_n "checking for arc4random_buf in -lbsd... " >&6; } -if ${ac_cv_lib_bsd_arc4random_buf+:} false; then : - $as_echo_n "(cached) " >&6 -else +if test "x${with_libbsd}" != xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for arc4random_buf in -lbsd" >&5 +printf %s "checking for arc4random_buf in -lbsd... " >&6; } +if test ${ac_cv_lib_bsd_arc4random_buf+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lbsd $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -18000,71 +19690,78 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif -char arc4random_buf (); +char arc4random_buf (void); int -main () +main (void) { return arc4random_buf (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_bsd_arc4random_buf=yes -else +else $as_nop ac_cv_lib_bsd_arc4random_buf=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bsd_arc4random_buf" >&5 -$as_echo "$ac_cv_lib_bsd_arc4random_buf" >&6; } -if test "x$ac_cv_lib_bsd_arc4random_buf" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBBSD 1 -_ACEOF +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bsd_arc4random_buf" >&5 +printf "%s\n" "$ac_cv_lib_bsd_arc4random_buf" >&6; } +if test "x$ac_cv_lib_bsd_arc4random_buf" = xyes +then : + printf "%s\n" "#define HAVE_LIBBSD 1" >>confdefs.h LIBS="-lbsd $LIBS" -else - if test "x${with_libbsd}" = xyes; then : +else $as_nop + if test "x${with_libbsd}" = xyes +then : as_fn_error $? "Enforced use of libbsd cannot be satisfied." "$LINENO" 5 fi fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for arc4random_buf (BSD or libbsd)" >&5 -$as_echo_n "checking for arc4random_buf (BSD or libbsd)... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for arc4random_buf (BSD, libbsd or glibc 2.36+)" >&5 +printf %s "checking for arc4random_buf (BSD, libbsd or glibc 2.36+)... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - #include /* for arc4random_buf on BSD, for NULL */ #if defined(HAVE_LIBBSD) # include + #else + # include /* for arc4random_buf on BSD */ #endif - int main() { - arc4random_buf(NULL, 0U); + int main(void) { + char dummy[123]; // double brackets for m4 + arc4random_buf(dummy, 0U); return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : -$as_echo "#define HAVE_ARC4RANDOM_BUF 1" >>confdefs.h +printf "%s\n" "#define HAVE_ARC4RANDOM_BUF 1" >>confdefs.h - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for arc4random (BSD, macOS or libbsd)" >&5 -$as_echo_n "checking for arc4random (BSD, macOS or libbsd)... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for arc4random (BSD, macOS, libbsd or glibc 2.36+)" >&5 +printf %s "checking for arc4random (BSD, macOS, libbsd or glibc 2.36+)... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -18073,175 +19770,172 @@ $as_echo_n "checking for arc4random (BSD, macOS or libbsd)... " >&6; } #else # include #endif - int main() { + int main(void) { arc4random(); return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : -$as_echo "#define HAVE_ARC4RANDOM 1" >>confdefs.h +printf "%s\n" "#define HAVE_ARC4RANDOM 1" >>confdefs.h - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext # Check whether --with-getrandom was given. -if test "${with_getrandom+set}" = set; then : +if test ${with_getrandom+y} +then : withval=$with_getrandom; -else +else $as_nop with_getrandom=check fi -if test "x$with_getrandom" != xno; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getrandom (Linux 3.17+, glibc 2.25+)" >&5 -$as_echo_n "checking for getrandom (Linux 3.17+, glibc 2.25+)... " >&6; } +if test "x$with_getrandom" != xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for getrandom (Linux 3.17+, glibc 2.25+)" >&5 +printf %s "checking for getrandom (Linux 3.17+, glibc 2.25+)... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include /* for NULL */ #include - int main() { + int main(void) { return getrandom(NULL, 0U, 0U); } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - -$as_echo "#define HAVE_GETRANDOM 1" >>confdefs.h - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - if test "x$with_getrandom" = xyes; then : +if ac_fn_c_try_link "$LINENO" +then : + +printf "%s\n" "#define HAVE_GETRANDOM 1" >>confdefs.h + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + if test "x$with_getrandom" = xyes +then : as_fn_error $? "enforced the use of getrandom --with-getrandom, but not detected" "$LINENO" 5 fi fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext fi # Check whether --with-sys_getrandom was given. -if test "${with_sys_getrandom+set}" = set; then : +if test ${with_sys_getrandom+y} +then : withval=$with_sys_getrandom; -else +else $as_nop with_sys_getrandom=check fi -if test "x$with_sys_getrandom" != xno; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for syscall SYS_getrandom (Linux 3.17+)" >&5 -$as_echo_n "checking for syscall SYS_getrandom (Linux 3.17+)... " >&6; } +if test "x$with_sys_getrandom" != xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for syscall SYS_getrandom (Linux 3.17+)" >&5 +printf %s "checking for syscall SYS_getrandom (Linux 3.17+)... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ + #define _GNU_SOURCE #include /* for NULL */ #include /* for syscall */ #include /* for SYS_getrandom */ - int main() { + int main(void) { syscall(SYS_getrandom, NULL, 0, 0); return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - -$as_echo "#define HAVE_SYSCALL_GETRANDOM 1" >>confdefs.h - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - if test "x$with_sys_getrandom" = xyes; then : +if ac_fn_c_try_link "$LINENO" +then : + +printf "%s\n" "#define HAVE_SYSCALL_GETRANDOM 1" >>confdefs.h + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + if test "x$with_sys_getrandom" = xyes +then : as_fn_error $? "enforced the use of syscall SYS_getrandom --with-sys-getrandom, but not detected" "$LINENO" 5 fi fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext fi -for ac_header in fcntl.h unistd.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF +ac_fn_c_check_header_compile "$LINENO" "fcntl.h" "ac_cv_header_fcntl_h" "$ac_includes_default" +if test "x$ac_cv_header_fcntl_h" = xyes +then : + printf "%s\n" "#define HAVE_FCNTL_H 1" >>confdefs.h fi +ac_fn_c_check_header_compile "$LINENO" "unistd.h" "ac_cv_header_unistd_h" "$ac_includes_default" +if test "x$ac_cv_header_unistd_h" = xyes +then : + printf "%s\n" "#define HAVE_UNISTD_H 1" >>confdefs.h -done +fi ac_fn_c_check_type "$LINENO" "off_t" "ac_cv_type_off_t" "$ac_includes_default" -if test "x$ac_cv_type_off_t" = xyes; then : +if test "x$ac_cv_type_off_t" = xyes +then : -else +else $as_nop -cat >>confdefs.h <<_ACEOF -#define off_t long int -_ACEOF +printf "%s\n" "#define off_t long int" >>confdefs.h fi - - - for ac_header in $ac_header_list -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default -" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - +ac_func= +for ac_item in $ac_func_c_list +do + if test $ac_func; then + ac_fn_c_check_func "$LINENO" $ac_func ac_cv_func_$ac_func + if eval test \"x\$ac_cv_func_$ac_func\" = xyes; then + echo "#define $ac_item 1" >> confdefs.h + fi + ac_func= + else + ac_func=$ac_item + fi done - - - - - - -for ac_func in getpagesize -do : - ac_fn_c_check_func "$LINENO" "getpagesize" "ac_cv_func_getpagesize" -if test "x$ac_cv_func_getpagesize" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_GETPAGESIZE 1 -_ACEOF - -fi -done - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working mmap" >&5 -$as_echo_n "checking for working mmap... " >&6; } -if ${ac_cv_func_mmap_fixed_mapped+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : - ac_cv_func_mmap_fixed_mapped=no -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working mmap" >&5 +printf %s "checking for working mmap... " >&6; } +if test ${ac_cv_func_mmap_fixed_mapped+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test "$cross_compiling" = yes +then : + case "$host_os" in # (( + # Guess yes on platforms where we know the result. + linux*) ac_cv_func_mmap_fixed_mapped=yes ;; + # If we don't know, assume the worst. + *) ac_cv_func_mmap_fixed_mapped=no ;; + esac +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default @@ -18273,10 +19967,6 @@ $ac_includes_default #include #include -#if !defined STDC_HEADERS && !defined HAVE_STDLIB_H -char *malloc (); -#endif - /* This mess was copied from the GNU getpagesize.h. */ #ifndef HAVE_GETPAGESIZE # ifdef _SC_PAGESIZE @@ -18310,7 +20000,7 @@ char *malloc (); #endif /* no HAVE_GETPAGESIZE */ int -main () +main (void) { char *data, *data2, *data3; const char *cdata2; @@ -18378,12 +20068,15 @@ main () if (*(data + i) != *(data3 + i)) return 14; close (fd); + free (data); + free (data3); return 0; } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +if ac_fn_c_try_run "$LINENO" +then : ac_cv_func_mmap_fixed_mapped=yes -else +else $as_nop ac_cv_func_mmap_fixed_mapped=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ @@ -18391,84 +20084,96 @@ rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_mmap_fixed_mapped" >&5 -$as_echo "$ac_cv_func_mmap_fixed_mapped" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_mmap_fixed_mapped" >&5 +printf "%s\n" "$ac_cv_func_mmap_fixed_mapped" >&6; } if test $ac_cv_func_mmap_fixed_mapped = yes; then -$as_echo "#define HAVE_MMAP 1" >>confdefs.h +printf "%s\n" "#define HAVE_MMAP 1" >>confdefs.h fi rm -f conftest.mmap conftest.txt -if test "$ac_cv_func_mmap_fixed_mapped" = "yes"; then : +if test "$ac_cv_func_mmap_fixed_mapped" = "yes" +then : FILEMAP=unixfilemap -else +else $as_nop FILEMAP=readfilemap fi -$as_echo "#define XML_NS 1" >>confdefs.h +printf "%s\n" "#define XML_NS 1" >>confdefs.h + + +printf "%s\n" "#define XML_GE 1" >>confdefs.h -$as_echo "#define XML_DTD 1" >>confdefs.h +printf "%s\n" "#define XML_DTD 1" >>confdefs.h -$as_echo "#define XML_DEV_URANDOM 1" >>confdefs.h +printf "%s\n" "#define XML_DEV_URANDOM 1" >>confdefs.h # Check whether --enable-xml-attr-info was given. -if test "${enable_xml_attr_info+set}" = set; then : +if test ${enable_xml_attr_info+y} +then : enableval=$enable_xml_attr_info; -else +else $as_nop enable_xml_attr_info=no fi -if test "x${enable_xml_attr_info}" = "xyes"; then : +if test "x${enable_xml_attr_info}" = "xyes" +then : -$as_echo "#define XML_ATTR_INFO 1" >>confdefs.h +printf "%s\n" "#define XML_ATTR_INFO 1" >>confdefs.h fi # Check whether --enable-xml-context was given. -if test "${enable_xml_context+set}" = set; then : +if test ${enable_xml_context+y} +then : enableval=$enable_xml_context; enable_xml_context=${enableval} fi -if test "x${enable_xml_context}" != "xno"; then : +if test "x${enable_xml_context}" != "xno" +then : if test "x${enable_xml_context}" = "xyes" \ - -o "x${enable_xml_context}" = "x"; then : + -o "x${enable_xml_context}" = "x" +then : enable_xml_context=1024 fi +else $as_nop + enable_xml_context=0 +fi -cat >>confdefs.h <<_ACEOF -#define XML_CONTEXT_BYTES ${enable_xml_context} -_ACEOF +printf "%s\n" "#define XML_CONTEXT_BYTES ${enable_xml_context}" >>confdefs.h -fi # Check whether --with-docbook was given. -if test "${with_docbook+set}" = set; then : +if test ${with_docbook+y} +then : withval=$with_docbook; -else +else $as_nop with_docbook=check fi -if test "x$with_docbook" != xno; then : +if test "x$with_docbook" != xno +then : for ac_prog in docbook2x-man db2x_docbook2man docbook2man docbook-to-man do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_DOCBOOK_TO_MAN+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_DOCBOOK_TO_MAN+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$DOCBOOK_TO_MAN"; then ac_cv_prog_DOCBOOK_TO_MAN="$DOCBOOK_TO_MAN" # Let the user override the test. else @@ -18476,11 +20181,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_DOCBOOK_TO_MAN="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -18491,11 +20200,11 @@ fi fi DOCBOOK_TO_MAN=$ac_cv_prog_DOCBOOK_TO_MAN if test -n "$DOCBOOK_TO_MAN"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DOCBOOK_TO_MAN" >&5 -$as_echo "$DOCBOOK_TO_MAN" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DOCBOOK_TO_MAN" >&5 +printf "%s\n" "$DOCBOOK_TO_MAN" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -18503,11 +20212,14 @@ fi done fi -if test "x${DOCBOOK_TO_MAN}" = x -a "x$with_docbook" = xyes; then : +if test "x${DOCBOOK_TO_MAN}" = x -a "x$with_docbook" = xyes +then : as_fn_error $? "Required program 'docbook2x-man' not found." "$LINENO" 5 fi -if test "x${DOCBOOK_TO_MAN}" != x -a "x$with_docbook" != xno; then : - if ${DOCBOOK_TO_MAN} --help | grep -i -q -F sgmlbase; then : +if test "x${DOCBOOK_TO_MAN}" != x -a "x$with_docbook" != xno +then : + if ${DOCBOOK_TO_MAN} --help | grep -i -q -F sgmlbase +then : as_fn_error $? "Your local ${DOCBOOK_TO_MAN} was found to work with SGML rather than XML. Please install docbook2X and use variable DOCBOOK_TO_MAN to point configure to command docbook2x-man of docbook2X. @@ -18517,12 +20229,158 @@ if test "x${DOCBOOK_TO_MAN}" != x -a "x$with_docbook" != xno; then : fi fi - if test "x${DOCBOOK_TO_MAN}" != x; then - WITH_DOCBOOK_TRUE= - WITH_DOCBOOK_FALSE='#' +if test -f "${srcdir}"/doc/xmlwf.1 +then : + if true; then + WITH_MANPAGE_TRUE= + WITH_MANPAGE_FALSE='#' +else + WITH_MANPAGE_TRUE='#' + WITH_MANPAGE_FALSE= +fi + + if test "x$with_docbook" = xno -o "x${DOCBOOK_TO_MAN}" = x +then : + if true; then + WITH_PREBUILT_MANPAGE_TRUE= + WITH_PREBUILT_MANPAGE_FALSE='#' +else + WITH_PREBUILT_MANPAGE_TRUE='#' + WITH_PREBUILT_MANPAGE_FALSE= +fi + + if false; then + WITH_DISTRIBUTABLE_MANPAGE_TRUE= + WITH_DISTRIBUTABLE_MANPAGE_FALSE='#' +else + WITH_DISTRIBUTABLE_MANPAGE_TRUE='#' + WITH_DISTRIBUTABLE_MANPAGE_FALSE= +fi + +else $as_nop + if false; then + WITH_PREBUILT_MANPAGE_TRUE= + WITH_PREBUILT_MANPAGE_FALSE='#' +else + WITH_PREBUILT_MANPAGE_TRUE='#' + WITH_PREBUILT_MANPAGE_FALSE= +fi + + if true; then + WITH_DISTRIBUTABLE_MANPAGE_TRUE= + WITH_DISTRIBUTABLE_MANPAGE_FALSE='#' +else + WITH_DISTRIBUTABLE_MANPAGE_TRUE='#' + WITH_DISTRIBUTABLE_MANPAGE_FALSE= +fi + +fi + +else $as_nop + if test "x$with_docbook" != xno -a "x${DOCBOOK_TO_MAN}" != x +then : + if true; then + WITH_MANPAGE_TRUE= + WITH_MANPAGE_FALSE='#' +else + WITH_MANPAGE_TRUE='#' + WITH_MANPAGE_FALSE= +fi + + if true; then + WITH_DISTRIBUTABLE_MANPAGE_TRUE= + WITH_DISTRIBUTABLE_MANPAGE_FALSE='#' +else + WITH_DISTRIBUTABLE_MANPAGE_TRUE='#' + WITH_DISTRIBUTABLE_MANPAGE_FALSE= +fi + +else $as_nop + if false; then + WITH_MANPAGE_TRUE= + WITH_MANPAGE_FALSE='#' +else + WITH_MANPAGE_TRUE='#' + WITH_MANPAGE_FALSE= +fi + + if false; then + WITH_DISTRIBUTABLE_MANPAGE_TRUE= + WITH_DISTRIBUTABLE_MANPAGE_FALSE='#' +else + WITH_DISTRIBUTABLE_MANPAGE_TRUE='#' + WITH_DISTRIBUTABLE_MANPAGE_FALSE= +fi + +fi + if false; then + WITH_PREBUILT_MANPAGE_TRUE= + WITH_PREBUILT_MANPAGE_FALSE='#' else - WITH_DOCBOOK_TRUE='#' - WITH_DOCBOOK_FALSE= + WITH_PREBUILT_MANPAGE_TRUE='#' + WITH_PREBUILT_MANPAGE_FALSE= +fi + +fi + +if test "x${enable_xml_attr_info}" = xyes +then : + EXPAT_ATTR_INFO=ON +else $as_nop + EXPAT_ATTR_INFO=OFF +fi +EXPAT_DTD=ON +if test "x${_INTERNAL_LARGE_SIZE_TRUE}" = x +then : + EXPAT_LARGE_SIZE=ON +else $as_nop + EXPAT_LARGE_SIZE=OFF +fi +if test "x${_INTERNAL_MIN_SIZE_TRUE}" = x +then : + EXPAT_MIN_SIZE=ON +else $as_nop + EXPAT_MIN_SIZE=OFF +fi +EXPAT_NS=ON +if test "x${enable_xml_context}" != xno +then : + EXPAT_CONTEXT_BYTES=${enable_xml_context} +else $as_nop + EXPAT_CONTEXT_BYTES=OFF +fi +if test "x${UNICODE_TRUE}" = x +then : + if test "x${_INTERNAL_UNICODE_WCHAR_T_TRUE}" = x +then : + EXPAT_CHAR_TYPE=wchar_t +else $as_nop + EXPAT_CHAR_TYPE=ushort +fi +else $as_nop + EXPAT_CHAR_TYPE=char +fi +PACKAGE_INIT="${srcdir}"/cmake/autotools/expat-package-init.cmake +LIBDIR_BASENAME="$(basename "${libdir}")" +SO_MAJOR="$(expr "${LIBCURRENT}" - "${LIBAGE}")" +SO_MINOR="${LIBAGE}" +SO_PATCH="${LIBREVISION}" + + + + + + + + + + + + + +if ac_fn_c_compute_int "$LINENO" "sizeof(void *)" "SIZEOF_VOID_P" "" +then : + fi @@ -18531,10 +20389,28 @@ fi -_EXPAT_OUTPUT_NAME="$PACKAGE_NAME" + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for shared library name prefix" >&5 +printf %s "checking for shared library name prefix... " >&6; } +case "${host_os}" in #( + cygwin*) : + CMAKE_SHARED_LIBRARY_PREFIX=cyg ;; #( + *) : + CMAKE_SHARED_LIBRARY_PREFIX=lib ;; +esac +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${CMAKE_SHARED_LIBRARY_PREFIX}" >&5 +printf "%s\n" "${CMAKE_SHARED_LIBRARY_PREFIX}" >&6; } -ac_config_files="$ac_config_files Makefile expat.pc doc/Makefile examples/Makefile lib/Makefile tests/Makefile tests/benchmark/Makefile xmlwf/Makefile" +case "${host_os}" in #( + darwin*) : + CMAKE_NOCONFIG_SOURCE=cmake/autotools/expat-noconfig__macos.cmake.in ;; #( + mingw*|cygwin*) : + CMAKE_NOCONFIG_SOURCE=cmake/autotools/expat-noconfig__windows.cmake.in ;; #( + *) : + CMAKE_NOCONFIG_SOURCE=cmake/autotools/expat-noconfig__linux.cmake.in ;; +esac +ac_config_files="$ac_config_files Makefile expat.pc cmake/expat-config.cmake cmake/autotools/expat-config-version.cmake cmake/autotools/expat-noconfig.cmake:${CMAKE_NOCONFIG_SOURCE} doc/Makefile examples/Makefile lib/Makefile tests/Makefile tests/benchmark/Makefile xmlwf/Makefile" ac_config_files="$ac_config_files run.sh" @@ -18565,8 +20441,8 @@ _ACEOF case $ac_val in #( *${as_nl}*) case $ac_var in #( - *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 -$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( @@ -18596,15 +20472,15 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; /^ac_cv_env_/b end t clear :clear - s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + s/^\([^=]*\)=\(.*[{}].*\)$/test ${\1+y} || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 -$as_echo "$as_me: updating cache $cache_file" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 +printf "%s\n" "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else @@ -18618,8 +20494,8 @@ $as_echo "$as_me: updating cache $cache_file" >&6;} fi fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 -$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 +printf "%s\n" "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache @@ -18636,7 +20512,7 @@ U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' - ac_i=`$as_echo "$ac_i" | sed "$ac_script"` + ac_i=`printf "%s\n" "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" @@ -18647,14 +20523,14 @@ LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 -$as_echo_n "checking that generated files are newer than configure... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 +printf %s "checking that generated files are newer than configure... " >&6; } if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 -$as_echo "done" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: done" >&5 +printf "%s\n" "done" >&6; } if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' @@ -18663,6 +20539,10 @@ else am__EXEEXT_FALSE= fi +if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then + as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 @@ -18696,8 +20576,56 @@ if test -z "${UNICODE_TRUE}" && test -z "${UNICODE_FALSE}"; then as_fn_error $? "conditional \"UNICODE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -if test -z "${WITH_DOCBOOK_TRUE}" && test -z "${WITH_DOCBOOK_FALSE}"; then - as_fn_error $? "conditional \"WITH_DOCBOOK\" was never defined. +if test -z "${_INTERNAL_UNICODE_WCHAR_T_TRUE}" && test -z "${_INTERNAL_UNICODE_WCHAR_T_FALSE}"; then + as_fn_error $? "conditional \"_INTERNAL_UNICODE_WCHAR_T\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${_INTERNAL_MIN_SIZE_TRUE}" && test -z "${_INTERNAL_MIN_SIZE_FALSE}"; then + as_fn_error $? "conditional \"_INTERNAL_MIN_SIZE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${_INTERNAL_LARGE_SIZE_TRUE}" && test -z "${_INTERNAL_LARGE_SIZE_FALSE}"; then + as_fn_error $? "conditional \"_INTERNAL_LARGE_SIZE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${WITH_MANPAGE_TRUE}" && test -z "${WITH_MANPAGE_FALSE}"; then + as_fn_error $? "conditional \"WITH_MANPAGE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${WITH_PREBUILT_MANPAGE_TRUE}" && test -z "${WITH_PREBUILT_MANPAGE_FALSE}"; then + as_fn_error $? "conditional \"WITH_PREBUILT_MANPAGE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${WITH_DISTRIBUTABLE_MANPAGE_TRUE}" && test -z "${WITH_DISTRIBUTABLE_MANPAGE_FALSE}"; then + as_fn_error $? "conditional \"WITH_DISTRIBUTABLE_MANPAGE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${WITH_PREBUILT_MANPAGE_TRUE}" && test -z "${WITH_PREBUILT_MANPAGE_FALSE}"; then + as_fn_error $? "conditional \"WITH_PREBUILT_MANPAGE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${WITH_DISTRIBUTABLE_MANPAGE_TRUE}" && test -z "${WITH_DISTRIBUTABLE_MANPAGE_FALSE}"; then + as_fn_error $? "conditional \"WITH_DISTRIBUTABLE_MANPAGE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${WITH_MANPAGE_TRUE}" && test -z "${WITH_MANPAGE_FALSE}"; then + as_fn_error $? "conditional \"WITH_MANPAGE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${WITH_DISTRIBUTABLE_MANPAGE_TRUE}" && test -z "${WITH_DISTRIBUTABLE_MANPAGE_FALSE}"; then + as_fn_error $? "conditional \"WITH_DISTRIBUTABLE_MANPAGE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${WITH_MANPAGE_TRUE}" && test -z "${WITH_MANPAGE_FALSE}"; then + as_fn_error $? "conditional \"WITH_MANPAGE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${WITH_DISTRIBUTABLE_MANPAGE_TRUE}" && test -z "${WITH_DISTRIBUTABLE_MANPAGE_FALSE}"; then + as_fn_error $? "conditional \"WITH_DISTRIBUTABLE_MANPAGE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${WITH_PREBUILT_MANPAGE_TRUE}" && test -z "${WITH_PREBUILT_MANPAGE_FALSE}"; then + as_fn_error $? "conditional \"WITH_PREBUILT_MANPAGE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi @@ -18705,8 +20633,8 @@ fi ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 -$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 +printf "%s\n" "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL @@ -18729,14 +20657,16 @@ cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : +as_nop=: +if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 +then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST -else +else $as_nop case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( @@ -18746,46 +20676,46 @@ esac fi + +# Reset variables that may have inherited troublesome values from +# the environment. + +# IFS needs to be set, to space, tab, and newline, in precisely that order. +# (If _AS_PATH_WALK were called with IFS unset, it would have the +# side effect of setting IFS to empty, thus disabling word splitting.) +# Quoting is to prevent editors from complaining about space-tab. as_nl=' ' export as_nl -# Printing a long string crashes Solaris 7 /usr/bin/printf. -as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -# Prefer a ksh shell builtin over an external printf program on Solaris, -# but without wasting forks for bash or zsh. -if test -z "$BASH_VERSION$ZSH_VERSION" \ - && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='print -r --' - as_echo_n='print -rn --' -elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='printf %s\n' - as_echo_n='printf %s' -else - if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then - as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' - as_echo_n='/usr/ucb/echo -n' - else - as_echo_body='eval expr "X$1" : "X\\(.*\\)"' - as_echo_n_body='eval - arg=$1; - case $arg in #( - *"$as_nl"*) - expr "X$arg" : "X\\(.*\\)$as_nl"; - arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; - esac; - expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" - ' - export as_echo_n_body - as_echo_n='sh -c $as_echo_n_body as_echo' - fi - export as_echo_body - as_echo='sh -c $as_echo_body as_echo' -fi +IFS=" "" $as_nl" + +PS1='$ ' +PS2='> ' +PS4='+ ' + +# Ensure predictable behavior from utilities with locale-dependent output. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# We cannot yet rely on "unset" to work, but we need these variables +# to be unset--not just set to an empty or harmless value--now, to +# avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct +# also avoids known problems related to "unset" and subshell syntax +# in other old shells (e.g. bash 2.01 and pdksh 5.2.14). +for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH +do eval test \${$as_var+y} \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done + +# Ensure that fds 0, 1, and 2 are open. +if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi +if (exec 3>&2) ; then :; else exec 2>/dev/null; fi # The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then +if ${PATH_SEPARATOR+false} :; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || @@ -18794,13 +20724,6 @@ if test "${PATH_SEPARATOR+set}" != set; then fi -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) -IFS=" "" $as_nl" - # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( @@ -18809,8 +20732,12 @@ case $0 in #(( for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + test -r "$as_dir$0" && as_myself=$as_dir$0 && break done IFS=$as_save_IFS @@ -18822,30 +20749,10 @@ if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then - $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi -# Unset variables that we do not need and which cause bugs (e.g. in -# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" -# suppresses any "Segmentation fault" message there. '((' could -# trigger a bug in pdksh 5.2.14. -for as_var in BASH_ENV ENV MAIL MAILPATH -do eval test x\${$as_var+set} = xset \ - && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : -done -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE - -# CDPATH. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] @@ -18858,13 +20765,14 @@ as_fn_error () as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi - $as_echo "$as_me: error: $2" >&2 + printf "%s\n" "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error + # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. @@ -18891,18 +20799,20 @@ as_fn_unset () { eval $1=; unset $1;} } as_unset=as_fn_unset + # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. -if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null +then : eval 'as_fn_append () { eval $1+=\$2 }' -else +else $as_nop as_fn_append () { eval $1=\$$1\$2 @@ -18914,12 +20824,13 @@ fi # as_fn_append # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. -if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null +then : eval 'as_fn_arith () { as_val=$(( $* )) }' -else +else $as_nop as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` @@ -18950,7 +20861,7 @@ as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$0" | +printf "%s\n" X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q @@ -18972,6 +20883,10 @@ as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits + +# Determine whether it's possible to make 'echo' print without a newline. +# These variables are no longer used directly by Autoconf, but are AC_SUBSTed +# for compatibility with existing Makefiles. ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) @@ -18985,6 +20900,12 @@ case `echo -n x` in #((((( ECHO_N='-n';; esac +# For backward compatibility with old third-party macros, we provide +# the shell variables $as_echo and $as_echo_n. New code should use +# AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. +as_echo='printf %s\n' +as_echo_n='printf %s' + rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file @@ -19026,7 +20947,7 @@ as_fn_mkdir_p () as_dirs= while :; do case $as_dir in #( - *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" @@ -19035,7 +20956,7 @@ $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_dir" | +printf "%s\n" X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -19097,8 +21018,8 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by expat $as_me 2.2.10, which was -generated by GNU Autoconf 2.69. Invocation command line was +This file was extended by expat $as_me 2.6.4, which was +generated by GNU Autoconf 2.71. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -19157,17 +21078,19 @@ $config_headers Configuration commands: $config_commands -Report bugs to ." +Report bugs to ." _ACEOF +ac_cs_config=`printf "%s\n" "$ac_configure_args" | sed "$ac_safe_unquote"` +ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\''/g"` cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" +ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ -expat config.status 2.2.10 -configured by $0, generated by GNU Autoconf 2.69, +expat config.status 2.6.4 +configured by $0, generated by GNU Autoconf 2.71, with options \\"\$ac_cs_config\\" -Copyright (C) 2012 Free Software Foundation, Inc. +Copyright (C) 2021 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." @@ -19207,15 +21130,15 @@ do -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) - $as_echo "$ac_cs_version"; exit ;; + printf "%s\n" "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) - $as_echo "$ac_cs_config"; exit ;; + printf "%s\n" "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in - *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" @@ -19223,7 +21146,7 @@ do --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in - *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; @@ -19232,7 +21155,7 @@ do as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) - $as_echo "$ac_cs_usage"; exit ;; + printf "%s\n" "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; @@ -19260,7 +21183,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift - \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 + \printf "%s\n" "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" @@ -19274,7 +21197,7 @@ exec 5>>config.log sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX - $as_echo "$ac_log" + printf "%s\n" "$ac_log" } >&5 _ACEOF @@ -19329,12 +21252,14 @@ lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_q lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' +FILECMD='`$ECHO "$FILECMD" | $SED "$delay_single_quote_subst"`' deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' +lt_ar_flags='`$ECHO "$lt_ar_flags" | $SED "$delay_single_quote_subst"`' AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' @@ -19512,13 +21437,13 @@ LN_S \ lt_SP2NL \ lt_NL2SP \ reload_flag \ +FILECMD \ deplibs_check_method \ file_magic_cmd \ file_magic_glob \ want_nocaseglob \ sharedlib_from_linklib_cmd \ AR \ -AR_FLAGS \ archiver_list_spec \ STRIP \ RANLIB \ @@ -19680,6 +21605,9 @@ do "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "expat.pc") CONFIG_FILES="$CONFIG_FILES expat.pc" ;; + "cmake/expat-config.cmake") CONFIG_FILES="$CONFIG_FILES cmake/expat-config.cmake" ;; + "cmake/autotools/expat-config-version.cmake") CONFIG_FILES="$CONFIG_FILES cmake/autotools/expat-config-version.cmake" ;; + "cmake/autotools/expat-noconfig.cmake") CONFIG_FILES="$CONFIG_FILES cmake/autotools/expat-noconfig.cmake:${CMAKE_NOCONFIG_SOURCE}" ;; "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; "examples/Makefile") CONFIG_FILES="$CONFIG_FILES examples/Makefile" ;; "lib/Makefile") CONFIG_FILES="$CONFIG_FILES lib/Makefile" ;; @@ -19698,9 +21626,9 @@ done # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then - test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files - test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers - test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands + test ${CONFIG_FILES+y} || CONFIG_FILES=$config_files + test ${CONFIG_HEADERS+y} || CONFIG_HEADERS=$config_headers + test ${CONFIG_COMMANDS+y} || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree @@ -19735,7 +21663,24 @@ ac_tmp=$tmp # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then - +if $AWK 'BEGIN { getline <"/dev/null" }' /dev/null; then + ac_cs_awk_getline=: + ac_cs_awk_pipe_init= + ac_cs_awk_read_file=' + while ((getline aline < (F[key])) > 0) + print(aline) + close(F[key])' + ac_cs_awk_pipe_fini= +else + ac_cs_awk_getline=false + ac_cs_awk_pipe_init="print \"cat <<'|#_!!_#|' &&\"" + ac_cs_awk_read_file=' + print "|#_!!_#|" + print "cat " F[key] " &&" + '$ac_cs_awk_pipe_init + # The final `:' finishes the AND list. + ac_cs_awk_pipe_fini='END { print "|#_!!_#|"; print ":" }' +fi ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this @@ -19753,6 +21698,17 @@ fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF +# Create commands to substitute file output variables. +{ + echo "cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1" && + echo 'cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&' && + echo "$ac_subst_files" | sed 's/.*/F["&"]="$&"/' && + echo "_ACAWK" && + echo "_ACEOF" +} >conf$$files.sh && +. ./conf$$files.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 +rm -f conf$$files.sh { echo "cat >conf$$subs.awk <<_ACEOF" && @@ -19829,7 +21785,7 @@ _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" - + \$ac_cs_awk_pipe_init } { line = $ 0 @@ -19847,10 +21803,16 @@ cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && } else len += 1 + keylen } - + if (nfields == 3 && !substed) { + key = field[2] + if (F[key] != "" && line ~ /^[ ]*@.*@[ ]*$/) { + \$ac_cs_awk_read_file + next + } + } print line } - +\$ac_cs_awk_pipe_fini _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 @@ -20036,7 +21998,7 @@ do esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac - case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + case $ac_f in *\'*) ac_f=`printf "%s\n" "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done @@ -20044,17 +22006,17 @@ do # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` - $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + printf "%s\n" "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" - { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 -$as_echo "$as_me: creating $ac_file" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +printf "%s\n" "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) - ac_sed_conf_input=`$as_echo "$configure_input" | + ac_sed_conf_input=`printf "%s\n" "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac @@ -20071,7 +22033,7 @@ $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$ac_file" | +printf "%s\n" X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -20095,9 +22057,9 @@ $as_echo X"$ac_file" | case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) - ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; @@ -20159,8 +22121,8 @@ ac_sed_dataroot=' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 -$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +printf "%s\n" "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' @@ -20197,16 +22159,21 @@ s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " -eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | +if $ac_cs_awk_getline; then + $AWK -f "$ac_tmp/subs.awk" +else + $AWK -f "$ac_tmp/subs.awk" | $SHELL +fi \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 -$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +printf "%s\n" "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" @@ -20222,20 +22189,20 @@ which seems to be undefined. Please make sure it is defined" >&2;} # if test x"$ac_file" != x-; then { - $as_echo "/* $configure_input */" \ + printf "%s\n" "/* $configure_input */" >&1 \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then - { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 -$as_echo "$as_me: $ac_file is unchanged" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 +printf "%s\n" "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else - $as_echo "/* $configure_input */" \ + printf "%s\n" "/* $configure_input */" >&1 \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi @@ -20255,7 +22222,7 @@ $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$_am_arg" : 'X\(//\)[^/]' \| \ X"$_am_arg" : 'X\(//\)$' \| \ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$_am_arg" | +printf "%s\n" X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -20275,8 +22242,8 @@ $as_echo X"$_am_arg" | s/.*/./; q'`/stamp-h$_am_stamp_count ;; - :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 -$as_echo "$as_me: executing $ac_file commands" >&6;} + :C) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 +printf "%s\n" "$as_me: executing $ac_file commands" >&6;} ;; esac @@ -20302,7 +22269,7 @@ esac for am_mf do # Strip MF so we end up with the name of the file. - am_mf=`$as_echo "$am_mf" | sed -e 's/:.*$//'` + am_mf=`printf "%s\n" "$am_mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile which includes # dependency-tracking related rules and includes. # Grep'ing the whole file directly is not great: AIX grep has a line @@ -20314,7 +22281,7 @@ $as_expr X"$am_mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$am_mf" : 'X\(//\)[^/]' \| \ X"$am_mf" : 'X\(//\)$' \| \ X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$am_mf" | +printf "%s\n" X"$am_mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -20336,7 +22303,7 @@ $as_echo X"$am_mf" | $as_expr X/"$am_mf" : '.*/\([^/][^/]*\)/*$' \| \ X"$am_mf" : 'X\(//\)$' \| \ X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$am_mf" | +printf "%s\n" X/"$am_mf" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q @@ -20361,8 +22328,8 @@ $as_echo X/"$am_mf" | (exit $ac_status); } || am_rc=$? done if test $am_rc -ne 0; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "Something went wrong bootstrapping makefile fragments for automatic dependency tracking. If GNU make was not used, consider re-running the configure script with MAKE=\"gmake\" (or whatever is @@ -20393,19 +22360,18 @@ See \`config.log' for more details" "$LINENO" 5; } cat <<_LT_EOF >> "$cfgfile" #! $SHELL # Generated automatically by $as_me ($PACKAGE) $VERSION -# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # Provide generalized library-building support services. # Written by Gordon Matzigkeit, 1996 -# Copyright (C) 2014 Free Software Foundation, Inc. +# Copyright (C) 2024 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # GNU Libtool is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of of the License, or +# the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # As a special exception to the GNU General Public License, if you @@ -20522,6 +22488,9 @@ to_host_file_cmd=$lt_cv_to_host_file_cmd # convert \$build files to toolchain format. to_tool_file_cmd=$lt_cv_to_tool_file_cmd +# A file(cmd) program that detects file types. +FILECMD=$lt_FILECMD + # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method @@ -20540,8 +22509,11 @@ sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd # The archiver. AR=$lt_AR +# Flags to create an archive (by configure). +lt_ar_flags=$lt_ar_flags + # Flags to create an archive. -AR_FLAGS=$lt_AR_FLAGS +AR_FLAGS=\${ARFLAGS-"\$lt_ar_flags"} # How to feed a file listing to the archiver. archiver_list_spec=$lt_archiver_list_spec @@ -20783,7 +22755,7 @@ hardcode_direct=$hardcode_direct # Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes # DIR into the resulting binary and the resulting library dependency is -# "absolute",i.e impossible to change by setting \$shlibpath_var if the +# "absolute",i.e. impossible to change by setting \$shlibpath_var if the # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute @@ -20923,6 +22895,7 @@ _LT_EOF esac + ltmain=$ac_aux_dir/ltmain.sh @@ -20930,7 +22903,7 @@ ltmain=$ac_aux_dir/ltmain.sh # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? - sed '$q' "$ltmain" >> "$cfgfile" \ + $SED '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || @@ -21025,7 +22998,7 @@ hardcode_direct=$hardcode_direct_CXX # Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes # DIR into the resulting binary and the resulting library dependency is -# "absolute",i.e impossible to change by setting \$shlibpath_var if the +# "absolute",i.e. impossible to change by setting \$shlibpath_var if the # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute_CXX @@ -21126,13 +23099,13 @@ if test "$no_create" != yes; then $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 -$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: Automake flags (can be overridden by user flags): AM_CPPFLAGS: ${AM_CPPFLAGS} @@ -21145,7 +23118,7 @@ User flags (override Automake flags on conflict): CFLAGS: ${CFLAGS} CXXFLAGS: ${CXXFLAGS} LDFLAGS: ${LDFLAGS}" >&5 -$as_echo "$as_me: +printf "%s\n" "$as_me: Automake flags (can be overridden by user flags): AM_CPPFLAGS: ${AM_CPPFLAGS} @@ -21158,3 +23131,4 @@ User flags (override Automake flags on conflict): CFLAGS: ${CFLAGS} CXXFLAGS: ${CXXFLAGS} LDFLAGS: ${LDFLAGS}" >&6;} + diff --git a/3rdparty/expat/configure.ac b/3rdparty/expat/configure.ac index 82ec1fdd178a1..5685f73bd64d4 100644 --- a/3rdparty/expat/configure.ac +++ b/3rdparty/expat/configure.ac @@ -1,21 +1,56 @@ dnl configuration script for expat dnl Process this file with autoconf to produce a configure script. +dnl __ __ _ +dnl ___\ \/ /_ __ __ _| |_ +dnl / _ \\ /| '_ \ / _` | __| +dnl | __// \| |_) | (_| | |_ +dnl \___/_/\_\ .__/ \__,_|\__| +dnl |_| XML parser dnl -dnl Copyright 2000 Clark Cooper +dnl Copyright (c) 2000 Clark Cooper +dnl Copyright (c) 2000-2005 Fred L. Drake, Jr. +dnl Copyright (c) 2001-2003 Greg Stein +dnl Copyright (c) 2006-2012 Karl Waclawek +dnl Copyright (c) 2016-2024 Sebastian Pipping +dnl Copyright (c) 2017 S. P. Zeidler +dnl Copyright (c) 2017 Stephen Groat +dnl Copyright (c) 2017-2020 Joe Orton +dnl Copyright (c) 2018 Yury Gribov +dnl Copyright (c) 2018 Benjamin Peterson +dnl Copyright (c) 2018 Marco Maggi +dnl Copyright (c) 2018 KangLin +dnl Copyright (c) 2019 Mohammed Khajapasha +dnl Copyright (c) 2019 Kishore Kunche +dnl Copyright (c) 2020 Jeffrey Walton +dnl Copyright (c) 2024 Ferenc Gczi +dnl Copyright (c) 2024 Dag-Erling Smrgrav +dnl Licensed under the MIT license: dnl -dnl This file is part of EXPAT. +dnl Permission is hereby granted, free of charge, to any person obtaining +dnl a copy of this software and associated documentation files (the +dnl "Software"), to deal in the Software without restriction, including +dnl without limitation the rights to use, copy, modify, merge, publish, +dnl distribute, sublicense, and/or sell copies of the Software, and to permit +dnl persons to whom the Software is furnished to do so, subject to the +dnl following conditions: dnl -dnl EXPAT is free software; you can redistribute it and/or modify it -dnl under the terms of the License (based on the MIT/X license) contained -dnl in the file COPYING that comes with this distribution. +dnl The above copyright notice and this permission notice shall be included +dnl in all copies or substantial portions of the Software. dnl +dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +dnl EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +dnl NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +dnl DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +dnl OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +dnl USE OR OTHER DEALINGS IN THE SOFTWARE. dnl Ensure that Expat is configured with autoconf 2.69 or newer. -AC_PREREQ(2.69) +AC_PREREQ([2.69]) dnl Get the version number of Expat, using m4's esyscmd() command to run dnl the command at m4-generation time. This allows us to create an m4 -dnl symbol holding the correct version number. AC_INIT() requires the +dnl symbol holding the correct version number. AC_INIT requires the dnl version number at m4-time, rather than when ./configure is run, so dnl all this must happen as part of m4, not as part of the shell code dnl contained in ./configure. @@ -27,7 +62,7 @@ m4_define([expat_version], m4_ifdef([__gnu__], [esyscmd(conftools/get-version.sh lib/expat.h)], [2.2.x])) -AC_INIT(expat, expat_version, expat-bugs@libexpat.org) +AC_INIT([expat], expat_version, [https://github.com/libexpat/libexpat/issues]) m4_undefine([expat_version]) AC_CONFIG_SRCDIR([Makefile.in]) @@ -35,6 +70,7 @@ AC_CONFIG_AUX_DIR([conftools]) AC_CONFIG_MACRO_DIR([m4]) AC_CANONICAL_HOST AM_INIT_AUTOMAKE +AM_MAINTAINER_MODE([enable]) # to allow argument --disable-maintainer-mode dnl @@ -48,12 +84,14 @@ dnl dnl If the API changes incompatibly set LIBAGE back to 0 dnl -LIBCURRENT=7 # sync -LIBREVISION=12 # with -LIBAGE=6 # CMakeLists.txt! +LIBCURRENT=11 # sync +LIBREVISION=0 # with +LIBAGE=10 # CMakeLists.txt! -AX_APPEND_FLAG([-DHAVE_EXPAT_CONFIG_H], [AM_CPPFLAGS]) -AC_CONFIG_HEADER([expat_config.h]) +AC_CONFIG_HEADERS([expat_config.h]) +AH_TOP([#ifndef EXPAT_CONFIG_H +#define EXPAT_CONFIG_H 1]) +AH_BOTTOM([#endif // ndef EXPAT_CONFIG_H]) AM_PROG_AR AC_PROG_INSTALL @@ -70,6 +108,9 @@ AC_SUBST(LIBAGE) AC_LANG([C]) AC_PROG_CC_C99 +AS_IF([test "${ac_cv_prog_cc_c99}" = no], + [AC_MSG_ERROR([Expat requires a C99 compiler.])]) + AS_IF([test "$GCC" = yes], [AX_APPEND_COMPILE_FLAGS([-Wall -Wextra], [AM_CFLAGS]) dnl Be careful about adding the -fexceptions option; some versions of @@ -79,7 +120,7 @@ AS_IF([test "$GCC" = yes], AX_APPEND_COMPILE_FLAGS([-fno-strict-aliasing -Wmissing-prototypes -Wstrict-prototypes], [AM_CFLAGS]) AX_APPEND_COMPILE_FLAGS([-pedantic -Wduplicated-cond -Wduplicated-branches -Wlogical-op], [AM_CFLAGS]) AX_APPEND_COMPILE_FLAGS([-Wrestrict -Wnull-dereference -Wjump-misses-init -Wdouble-promotion], [AM_CFLAGS]) - AX_APPEND_COMPILE_FLAGS([-Wshadow -Wformat=2 -Wmisleading-indentation], [AM_CFLAGS])]) + AX_APPEND_COMPILE_FLAGS([-Wshadow -Wformat=2 -Wno-pedantic-ms-format -Wmisleading-indentation], [AM_CFLAGS])]) AC_LANG_PUSH([C++]) AC_PROG_CXX @@ -102,11 +143,9 @@ AS_CASE(["$LD"],[*clang*], [*linux*],[archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'])]) EXPATCFG_COMPILER_SUPPORTS_VISIBILITY([ - AX_APPEND_FLAG([-fvisibility=hidden], [AM_CFLAGS]) - AX_APPEND_FLAG([-DXML_ENABLE_VISIBILITY=1], [AM_CPPFLAGS])]) - -dnl Checks for header files. -AC_HEADER_STDC + AX_APPEND_FLAG([-fvisibility=hidden], [AM_CFLAGS]) + AS_IF([test "${enable_shared}" = yes], + [AX_APPEND_FLAG([-DXML_ENABLE_VISIBILITY=1], [AM_CPPFLAGS])])]) dnl Checks for typedefs, structures, and compiler characteristics. @@ -123,7 +162,6 @@ AC_C_BIGENDIAN([AC_DEFINE([WORDS_BIGENDIAN], 1) AC_DEFINE_UNQUOTED([BYTEORDER], $BYTEORDER, [1234 = LILENDIAN, 4321 = BIGENDIAN]) AC_C_CONST -AC_TYPE_SIZE_T AC_ARG_WITH([xmlwf], [AS_HELP_STRING([--without-xmlwf], [do not build xmlwf])], @@ -143,6 +181,8 @@ AC_ARG_WITH([tests], [with_tests=yes]) AM_CONDITIONAL([WITH_TESTS], [test x${with_tests} = xyes]) +AS_IF([test x${with_tests} = xyes], + [AX_CXX_COMPILE_STDCXX_11([noext], [mandatory])]) AS_VAR_SET([EXPATCFG_ON_MINGW],[no]) AS_CASE("${host_os}", @@ -151,8 +191,13 @@ AS_CASE("${host_os}", AC_MSG_NOTICE([detected OS: MinGW])]) AM_CONDITIONAL([MINGW], [test x${EXPATCFG_ON_MINGW} = xyes]) +dnl Note: Prefix "_INTERNAL_" here means exclusive use inside of file configure.ac AM_CONDITIONAL([UNICODE], [echo -- "${CPPFLAGS}${CFLAGS}" | ${FGREP} XML_UNICODE >/dev/null]) +AM_CONDITIONAL([_INTERNAL_UNICODE_WCHAR_T], [echo -- "${CPPFLAGS}${CFLAGS}" | ${FGREP} XML_UNICODE_WCHAR_T >/dev/null]) +AM_CONDITIONAL([_INTERNAL_MIN_SIZE], [echo -- "${CPPFLAGS}${CFLAGS}" | ${FGREP} XML_MIN_SIZE >/dev/null]) +AM_CONDITIONAL([_INTERNAL_LARGE_SIZE], [echo -- "${CPPFLAGS}${CFLAGS}" | ${FGREP} XML_LARGE_SIZE >/dev/null]) +LT_LIB_M AC_ARG_WITH([libbsd], [AS_HELP_STRING([--with-libbsd], [utilize libbsd (for arc4random_buf)])], @@ -164,14 +209,16 @@ AS_IF([test "x${with_libbsd}" != xno], [], [AS_IF([test "x${with_libbsd}" = xyes], [AC_MSG_ERROR([Enforced use of libbsd cannot be satisfied.])])])]) -AC_MSG_CHECKING([for arc4random_buf (BSD or libbsd)]) +AC_MSG_CHECKING([for arc4random_buf (BSD, libbsd or glibc 2.36+)]) AC_LINK_IFELSE([AC_LANG_SOURCE([ - #include /* for arc4random_buf on BSD, for NULL */ #if defined(HAVE_LIBBSD) # include + #else + # include /* for arc4random_buf on BSD */ #endif - int main() { - arc4random_buf(NULL, 0U); + int main(void) { + char dummy[[123]]; // double brackets for m4 + arc4random_buf(dummy, 0U); return 0; } ])], @@ -179,14 +226,14 @@ AC_LINK_IFELSE([AC_LANG_SOURCE([ AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]) - AC_MSG_CHECKING([for arc4random (BSD, macOS or libbsd)]) + AC_MSG_CHECKING([for arc4random (BSD, macOS, libbsd or glibc 2.36+)]) AC_LINK_IFELSE([AC_LANG_SOURCE([ #if defined(HAVE_LIBBSD) # include #else # include #endif - int main() { + int main(void) { arc4random(); return 0; } @@ -208,7 +255,7 @@ AS_IF([test "x$with_getrandom" != xno], AC_LINK_IFELSE([AC_LANG_SOURCE([ #include /* for NULL */ #include - int main() { + int main(void) { return getrandom(NULL, 0U, 0U); } ])], @@ -229,10 +276,11 @@ AS_HELP_STRING([--without-sys-getrandom], AS_IF([test "x$with_sys_getrandom" != xno], [AC_MSG_CHECKING([for syscall SYS_getrandom (Linux 3.17+)]) AC_LINK_IFELSE([AC_LANG_SOURCE([ + #define _GNU_SOURCE #include /* for NULL */ #include /* for syscall */ #include /* for SYS_getrandom */ - int main() { + int main(void) { syscall(SYS_getrandom, NULL, 0, 0); return 0; } @@ -257,6 +305,8 @@ AC_SUBST(FILEMAP) dnl Some basic configuration: AC_DEFINE([XML_NS], 1, [Define to make XML Namespaces functionality available.]) +AC_DEFINE([XML_GE], 1, + [Define as 1/0 to enable/disable support for general entities.]) AC_DEFINE([XML_DTD], 1, [Define to make parameter entity parsing functionality available.]) AC_DEFINE([XML_DEV_URANDOM], 1, @@ -281,9 +331,10 @@ AS_HELP_STRING([--disable-xml-context], AS_IF([test "x${enable_xml_context}" != "xno"], [AS_IF([test "x${enable_xml_context}" = "xyes" \ -o "x${enable_xml_context}" = "x"], - [AS_VAR_SET(enable_xml_context,1024)]) - AC_DEFINE_UNQUOTED([XML_CONTEXT_BYTES], [${enable_xml_context}], - [Define to specify how much context to retain around the current parse point.])]) + [AS_VAR_SET(enable_xml_context,1024)])], + [AS_VAR_SET(enable_xml_context,0)]) +AC_DEFINE_UNQUOTED([XML_CONTEXT_BYTES], [${enable_xml_context}], + [Define to specify how much context to retain around the current parse point, 0 to disable.]) AC_ARG_WITH([docbook], [AS_HELP_STRING([--with-docbook], @@ -307,7 +358,72 @@ AS_IF([test "x${DOCBOOK_TO_MAN}" != x -a "x$with_docbook" != xno], You can also configure using --without-docbook if you can do without a man page for xmlwf.])])]) -AM_CONDITIONAL(WITH_DOCBOOK, [test "x${DOCBOOK_TO_MAN}" != x]) +dnl This will make sure that a release tarball shipping a pre-rendered xmlwf man page will +dnl get it installed, when no working flavor of docbook2man is available (or wanted). +dnl This relies on file xmlwf.1 being at least as recent as its source file xmlwf.xml. +AS_IF([test -f "${srcdir}"/doc/xmlwf.1], + [AM_CONDITIONAL(WITH_MANPAGE, [true]) + AS_IF([test "x$with_docbook" = xno -o "x${DOCBOOK_TO_MAN}" = x], + [AM_CONDITIONAL(WITH_PREBUILT_MANPAGE, [true]) + AM_CONDITIONAL(WITH_DISTRIBUTABLE_MANPAGE, [false])], + [AM_CONDITIONAL(WITH_PREBUILT_MANPAGE, [false]) + AM_CONDITIONAL(WITH_DISTRIBUTABLE_MANPAGE, [true])]) + ], + [AS_IF([test "x$with_docbook" != xno -a "x${DOCBOOK_TO_MAN}" != x], + [AM_CONDITIONAL(WITH_MANPAGE, [true]) + AM_CONDITIONAL(WITH_DISTRIBUTABLE_MANPAGE, [true])], + [AM_CONDITIONAL(WITH_MANPAGE, [false]) + AM_CONDITIONAL(WITH_DISTRIBUTABLE_MANPAGE, [false])]) + AM_CONDITIONAL(WITH_PREBUILT_MANPAGE, [false])]) + +dnl Configure CMake file templates +dnl NOTE: The *_TRUE variables read here are Automake conditionals +dnl that are either set to "" when enabled or to "#" when disabled +dnl (because they are used to dynamically comment out certain things) +AS_IF([test "x${enable_xml_attr_info}" = xyes], + [EXPAT_ATTR_INFO=ON], + [EXPAT_ATTR_INFO=OFF]) +EXPAT_DTD=ON +AS_IF([test "x${_INTERNAL_LARGE_SIZE_TRUE}" = x], + [EXPAT_LARGE_SIZE=ON], + [EXPAT_LARGE_SIZE=OFF]) +AS_IF([test "x${_INTERNAL_MIN_SIZE_TRUE}" = x], + [EXPAT_MIN_SIZE=ON], + [EXPAT_MIN_SIZE=OFF]) +EXPAT_NS=ON +AS_IF([test "x${enable_xml_context}" != xno], + [EXPAT_CONTEXT_BYTES=${enable_xml_context}], + [EXPAT_CONTEXT_BYTES=OFF]) +AS_IF([test "x${UNICODE_TRUE}" = x], + [AS_IF( + [test "x${_INTERNAL_UNICODE_WCHAR_T_TRUE}" = x], + [EXPAT_CHAR_TYPE=wchar_t], + [EXPAT_CHAR_TYPE=ushort])], + [EXPAT_CHAR_TYPE=char]) +PACKAGE_INIT="${srcdir}"/cmake/autotools/expat-package-init.cmake +LIBDIR_BASENAME="$(basename "${libdir}")" +SO_MAJOR="$(expr "${LIBCURRENT}" - "${LIBAGE}")" +SO_MINOR="${LIBAGE}" +SO_PATCH="${LIBREVISION}" +AC_SUBST([EXPAT_ATTR_INFO]) +AC_SUBST([EXPAT_DTD]) +AC_SUBST([EXPAT_LARGE_SIZE]) +AC_SUBST([EXPAT_MIN_SIZE]) +AC_SUBST([EXPAT_NS]) +AC_SUBST([EXPAT_CONTEXT_BYTES]) +AC_SUBST([EXPAT_CHAR_TYPE]) +AC_SUBST_FILE([PACKAGE_INIT]) +AC_SUBST([LIBDIR_BASENAME]) +AC_SUBST([SO_MAJOR]) +AC_SUBST([SO_MINOR]) +AC_SUBST([SO_PATCH]) + +dnl The canonical way of doing this is AC_CHECK_SIZEOF(void *), but +dnl that adds SIZEOF_VOID_P to expat_config.h.in, making it difficult +dnl to have 32-bit and 64-bit versions of libexpat installed on the +dnl same system with a single, shared copy of the header. +AC_COMPUTE_INT(SIZEOF_VOID_P, [sizeof(void *)]) +AC_SUBST([SIZEOF_VOID_P]) dnl write the Automake flags we set AC_SUBST([AM_CPPFLAGS]) @@ -315,11 +431,23 @@ AC_SUBST([AM_CFLAGS]) AC_SUBST([AM_CXXFLAGS]) AC_SUBST([AM_LDFLAGS]) -dnl updating _EXPAT_OUTPUT_NAME variable to effect the package name in expat.pc file (issue #361) -AC_SUBST(_EXPAT_OUTPUT_NAME, ["$PACKAGE_NAME"]) +dnl Emulate the use of CMAKE_SHARED_LIBRARY_PREFIX under CMake +AC_MSG_CHECKING([for shared library name prefix]) +AS_CASE("${host_os}", + [cygwin*], [CMAKE_SHARED_LIBRARY_PREFIX=cyg], + [CMAKE_SHARED_LIBRARY_PREFIX=lib]) +AC_MSG_RESULT([${CMAKE_SHARED_LIBRARY_PREFIX}]) +AC_SUBST([CMAKE_SHARED_LIBRARY_PREFIX]) +AS_CASE("${host_os}", + [darwin*], [CMAKE_NOCONFIG_SOURCE=cmake/autotools/expat-noconfig__macos.cmake.in], + [mingw*|cygwin*], [CMAKE_NOCONFIG_SOURCE=cmake/autotools/expat-noconfig__windows.cmake.in], + [CMAKE_NOCONFIG_SOURCE=cmake/autotools/expat-noconfig__linux.cmake.in]) AC_CONFIG_FILES([Makefile] [expat.pc] + [cmake/expat-config.cmake] + [cmake/autotools/expat-config-version.cmake] + [cmake/autotools/expat-noconfig.cmake:${CMAKE_NOCONFIG_SOURCE}] [doc/Makefile] [examples/Makefile] [lib/Makefile] diff --git a/3rdparty/expat/conftools/PrintPath b/3rdparty/expat/conftools/PrintPath deleted file mode 100755 index e8559a3d643e5..0000000000000 --- a/3rdparty/expat/conftools/PrintPath +++ /dev/null @@ -1,116 +0,0 @@ -#!/bin/sh -# Look for program[s] somewhere in $PATH. -# -# Options: -# -s -# Do not print out full pathname. (silent) -# -pPATHNAME -# Look in PATHNAME instead of $PATH -# -# Usage: -# PrintPath [-s] [-pPATHNAME] program [program ...] -# -# Initially written by Jim Jagielski for the Apache configuration mechanism -# (with kudos to Kernighan/Pike) -# -# This script falls under the Apache License. -# See http://www.apache.org/licenses/LICENSE - -## -# Some "constants" -## -pathname=$PATH -echo="yes" - -## -# Find out what OS we are running for later on -## -os=`(uname) 2>/dev/null` - -## -# Parse command line -## -for args in $* -do - case $args in - -s ) echo="no" ;; - -p* ) pathname="`echo $args | sed 's/^..//'`" ;; - * ) programs="$programs $args" ;; - esac -done - -## -# Now we make the adjustments required for OS/2 and everyone -# else :) -# -# First of all, all OS/2 programs have the '.exe' extension. -# Next, we adjust PATH (or what was given to us as PATH) to -# be whitespace separated directories. -# Finally, we try to determine the best flag to use for -# test/[] to look for an executable file. OS/2 just has '-r' -# but with other OSs, we do some funny stuff to check to see -# if test/[] knows about -x, which is the preferred flag. -## - -if [ "x$os" = "xOS/2" ] -then - ext=".exe" - pathname=`echo -E $pathname | - sed 's/^;/.;/ - s/;;/;.;/g - s/;$/;./ - s/;/ /g - s/\\\\/\\//g' ` - test_exec_flag="-r" -else - ext="" # No default extensions - pathname=`echo $pathname | - sed 's/^:/.:/ - s/::/:.:/g - s/:$/:./ - s/:/ /g' ` - # Here is how we test to see if test/[] can handle -x - testfile="pp.t.$$" - - cat > $testfile </dev/null`; then - test_exec_flag="-x" - else - test_exec_flag="-r" - fi - rm -f $testfile -fi - -for program in $programs -do - for path in $pathname - do - if [ $test_exec_flag $path/${program}${ext} ] && \ - [ ! -d $path/${program}${ext} ]; then - if [ "x$echo" = "xyes" ]; then - echo $path/${program}${ext} - fi - exit 0 - fi - -# Next try without extension (if one was used above) - if [ "x$ext" != "x" ]; then - if [ $test_exec_flag $path/${program} ] && \ - [ ! -d $path/${program} ]; then - if [ "x$echo" = "xyes" ]; then - echo $path/${program} - fi - exit 0 - fi - fi - done -done -exit 1 - diff --git a/3rdparty/expat/conftools/ar-lib b/3rdparty/expat/conftools/ar-lib index 1e9388e2ae3ae..c349042c3facd 100755 --- a/3rdparty/expat/conftools/ar-lib +++ b/3rdparty/expat/conftools/ar-lib @@ -4,7 +4,7 @@ me=ar-lib scriptversion=2019-07-04.01; # UTC -# Copyright (C) 2010-2020 Free Software Foundation, Inc. +# Copyright (C) 2010-2021 Free Software Foundation, Inc. # Written by Peter Rosin . # # This program is free software; you can redistribute it and/or modify diff --git a/3rdparty/expat/conftools/ax-cxx-compile-stdcxx-11.m4 b/3rdparty/expat/conftools/ax-cxx-compile-stdcxx-11.m4 new file mode 100644 index 0000000000000..1733fd85f9595 --- /dev/null +++ b/3rdparty/expat/conftools/ax-cxx-compile-stdcxx-11.m4 @@ -0,0 +1,39 @@ +# ============================================================================= +# https://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx_11.html +# ============================================================================= +# +# SYNOPSIS +# +# AX_CXX_COMPILE_STDCXX_11([ext|noext], [mandatory|optional]) +# +# DESCRIPTION +# +# Check for baseline language coverage in the compiler for the C++11 +# standard; if necessary, add switches to CXX and CXXCPP to enable +# support. +# +# This macro is a convenience alias for calling the AX_CXX_COMPILE_STDCXX +# macro with the version set to C++11. The two optional arguments are +# forwarded literally as the second and third argument respectively. +# Please see the documentation for the AX_CXX_COMPILE_STDCXX macro for +# more information. If you want to use this macro, you also need to +# download the ax_cxx_compile_stdcxx.m4 file. +# +# LICENSE +# +# Copyright (c) 2008 Benjamin Kosnik +# Copyright (c) 2012 Zack Weinberg +# Copyright (c) 2013 Roy Stogner +# Copyright (c) 2014, 2015 Google Inc.; contributed by Alexey Sokolov +# Copyright (c) 2015 Paul Norman +# Copyright (c) 2015 Moritz Klammler +# +# Copying and distribution of this file, with or without modification, are +# permitted in any medium without royalty provided the copyright notice +# and this notice are preserved. This file is offered as-is, without any +# warranty. + +#serial 18 + +AX_REQUIRE_DEFINED([AX_CXX_COMPILE_STDCXX]) +AC_DEFUN([AX_CXX_COMPILE_STDCXX_11], [AX_CXX_COMPILE_STDCXX([11], [$1], [$2])]) diff --git a/3rdparty/expat/conftools/ax-cxx-compile-stdcxx.m4 b/3rdparty/expat/conftools/ax-cxx-compile-stdcxx.m4 new file mode 100644 index 0000000000000..8edf5152ec7a9 --- /dev/null +++ b/3rdparty/expat/conftools/ax-cxx-compile-stdcxx.m4 @@ -0,0 +1,1018 @@ +# =========================================================================== +# https://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_CXX_COMPILE_STDCXX(VERSION, [ext|noext], [mandatory|optional]) +# +# DESCRIPTION +# +# Check for baseline language coverage in the compiler for the specified +# version of the C++ standard. If necessary, add switches to CXX and +# CXXCPP to enable support. VERSION may be '11', '14', '17', or '20' for +# the respective C++ standard version. +# +# The second argument, if specified, indicates whether you insist on an +# extended mode (e.g. -std=gnu++11) or a strict conformance mode (e.g. +# -std=c++11). If neither is specified, you get whatever works, with +# preference for no added switch, and then for an extended mode. +# +# The third argument, if specified 'mandatory' or if left unspecified, +# indicates that baseline support for the specified C++ standard is +# required and that the macro should error out if no mode with that +# support is found. If specified 'optional', then configuration proceeds +# regardless, after defining HAVE_CXX${VERSION} if and only if a +# supporting mode is found. +# +# LICENSE +# +# Copyright (c) 2008 Benjamin Kosnik +# Copyright (c) 2012 Zack Weinberg +# Copyright (c) 2013 Roy Stogner +# Copyright (c) 2014, 2015 Google Inc.; contributed by Alexey Sokolov +# Copyright (c) 2015 Paul Norman +# Copyright (c) 2015 Moritz Klammler +# Copyright (c) 2016, 2018 Krzesimir Nowak +# Copyright (c) 2019 Enji Cooper +# Copyright (c) 2020 Jason Merrill +# Copyright (c) 2021 Jörn Heusipp +# +# Copying and distribution of this file, with or without modification, are +# permitted in any medium without royalty provided the copyright notice +# and this notice are preserved. This file is offered as-is, without any +# warranty. + +#serial 18 + +dnl This macro is based on the code from the AX_CXX_COMPILE_STDCXX_11 macro +dnl (serial version number 13). + +AC_DEFUN([AX_CXX_COMPILE_STDCXX], [dnl + m4_if([$1], [11], [ax_cxx_compile_alternatives="11 0x"], + [$1], [14], [ax_cxx_compile_alternatives="14 1y"], + [$1], [17], [ax_cxx_compile_alternatives="17 1z"], + [$1], [20], [ax_cxx_compile_alternatives="20"], + [m4_fatal([invalid first argument `$1' to AX_CXX_COMPILE_STDCXX])])dnl + m4_if([$2], [], [], + [$2], [ext], [], + [$2], [noext], [], + [m4_fatal([invalid second argument `$2' to AX_CXX_COMPILE_STDCXX])])dnl + m4_if([$3], [], [ax_cxx_compile_cxx$1_required=true], + [$3], [mandatory], [ax_cxx_compile_cxx$1_required=true], + [$3], [optional], [ax_cxx_compile_cxx$1_required=false], + [m4_fatal([invalid third argument `$3' to AX_CXX_COMPILE_STDCXX])]) + AC_LANG_PUSH([C++])dnl + ac_success=no + + m4_if([$2], [], [dnl + AC_CACHE_CHECK(whether $CXX supports C++$1 features by default, + ax_cv_cxx_compile_cxx$1, + [AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])], + [ax_cv_cxx_compile_cxx$1=yes], + [ax_cv_cxx_compile_cxx$1=no])]) + if test x$ax_cv_cxx_compile_cxx$1 = xyes; then + ac_success=yes + fi]) + + m4_if([$2], [noext], [], [dnl + if test x$ac_success = xno; then + for alternative in ${ax_cxx_compile_alternatives}; do + switch="-std=gnu++${alternative}" + cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx$1_$switch]) + AC_CACHE_CHECK(whether $CXX supports C++$1 features with $switch, + $cachevar, + [ac_save_CXX="$CXX" + CXX="$CXX $switch" + AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])], + [eval $cachevar=yes], + [eval $cachevar=no]) + CXX="$ac_save_CXX"]) + if eval test x\$$cachevar = xyes; then + CXX="$CXX $switch" + if test -n "$CXXCPP" ; then + CXXCPP="$CXXCPP $switch" + fi + ac_success=yes + break + fi + done + fi]) + + m4_if([$2], [ext], [], [dnl + if test x$ac_success = xno; then + dnl HP's aCC needs +std=c++11 according to: + dnl http://h21007.www2.hp.com/portal/download/files/unprot/aCxx/PDF_Release_Notes/769149-001.pdf + dnl Cray's crayCC needs "-h std=c++11" + dnl MSVC needs -std:c++NN for C++17 and later (default is C++14) + for alternative in ${ax_cxx_compile_alternatives}; do + for switch in -std=c++${alternative} +std=c++${alternative} "-h std=c++${alternative}" MSVC; do + if test x"$switch" = xMSVC; then + dnl AS_TR_SH maps both `:` and `=` to `_` so -std:c++17 would collide + dnl with -std=c++17. We suffix the cache variable name with _MSVC to + dnl avoid this. + switch=-std:c++${alternative} + cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx$1_${switch}_MSVC]) + else + cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx$1_$switch]) + fi + AC_CACHE_CHECK(whether $CXX supports C++$1 features with $switch, + $cachevar, + [ac_save_CXX="$CXX" + CXX="$CXX $switch" + AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])], + [eval $cachevar=yes], + [eval $cachevar=no]) + CXX="$ac_save_CXX"]) + if eval test x\$$cachevar = xyes; then + CXX="$CXX $switch" + if test -n "$CXXCPP" ; then + CXXCPP="$CXXCPP $switch" + fi + ac_success=yes + break + fi + done + if test x$ac_success = xyes; then + break + fi + done + fi]) + AC_LANG_POP([C++]) + if test x$ax_cxx_compile_cxx$1_required = xtrue; then + if test x$ac_success = xno; then + AC_MSG_ERROR([*** A compiler with support for C++$1 language features is required.]) + fi + fi + if test x$ac_success = xno; then + HAVE_CXX$1=0 + AC_MSG_NOTICE([No compiler with C++$1 support was found]) + else + HAVE_CXX$1=1 + AC_DEFINE(HAVE_CXX$1,1, + [define if the compiler supports basic C++$1 syntax]) + fi + AC_SUBST(HAVE_CXX$1) +]) + + +dnl Test body for checking C++11 support + +m4_define([_AX_CXX_COMPILE_STDCXX_testbody_11], + _AX_CXX_COMPILE_STDCXX_testbody_new_in_11 +) + +dnl Test body for checking C++14 support + +m4_define([_AX_CXX_COMPILE_STDCXX_testbody_14], + _AX_CXX_COMPILE_STDCXX_testbody_new_in_11 + _AX_CXX_COMPILE_STDCXX_testbody_new_in_14 +) + +dnl Test body for checking C++17 support + +m4_define([_AX_CXX_COMPILE_STDCXX_testbody_17], + _AX_CXX_COMPILE_STDCXX_testbody_new_in_11 + _AX_CXX_COMPILE_STDCXX_testbody_new_in_14 + _AX_CXX_COMPILE_STDCXX_testbody_new_in_17 +) + +dnl Test body for checking C++20 support + +m4_define([_AX_CXX_COMPILE_STDCXX_testbody_20], + _AX_CXX_COMPILE_STDCXX_testbody_new_in_11 + _AX_CXX_COMPILE_STDCXX_testbody_new_in_14 + _AX_CXX_COMPILE_STDCXX_testbody_new_in_17 + _AX_CXX_COMPILE_STDCXX_testbody_new_in_20 +) + + +dnl Tests for new features in C++11 + +m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_11], [[ + +// If the compiler admits that it is not ready for C++11, why torture it? +// Hopefully, this will speed up the test. + +#ifndef __cplusplus + +#error "This is not a C++ compiler" + +// MSVC always sets __cplusplus to 199711L in older versions; newer versions +// only set it correctly if /Zc:__cplusplus is specified as well as a +// /std:c++NN switch: +// https://devblogs.microsoft.com/cppblog/msvc-now-correctly-reports-__cplusplus/ +#elif __cplusplus < 201103L && !defined _MSC_VER + +#error "This is not a C++11 compiler" + +#else + +namespace cxx11 +{ + + namespace test_static_assert + { + + template + struct check + { + static_assert(sizeof(int) <= sizeof(T), "not big enough"); + }; + + } + + namespace test_final_override + { + + struct Base + { + virtual ~Base() {} + virtual void f() {} + }; + + struct Derived : public Base + { + virtual ~Derived() override {} + virtual void f() override {} + }; + + } + + namespace test_double_right_angle_brackets + { + + template < typename T > + struct check {}; + + typedef check single_type; + typedef check> double_type; + typedef check>> triple_type; + typedef check>>> quadruple_type; + + } + + namespace test_decltype + { + + int + f() + { + int a = 1; + decltype(a) b = 2; + return a + b; + } + + } + + namespace test_type_deduction + { + + template < typename T1, typename T2 > + struct is_same + { + static const bool value = false; + }; + + template < typename T > + struct is_same + { + static const bool value = true; + }; + + template < typename T1, typename T2 > + auto + add(T1 a1, T2 a2) -> decltype(a1 + a2) + { + return a1 + a2; + } + + int + test(const int c, volatile int v) + { + static_assert(is_same::value == true, ""); + static_assert(is_same::value == false, ""); + static_assert(is_same::value == false, ""); + auto ac = c; + auto av = v; + auto sumi = ac + av + 'x'; + auto sumf = ac + av + 1.0; + static_assert(is_same::value == true, ""); + static_assert(is_same::value == true, ""); + static_assert(is_same::value == true, ""); + static_assert(is_same::value == false, ""); + static_assert(is_same::value == true, ""); + return (sumf > 0.0) ? sumi : add(c, v); + } + + } + + namespace test_noexcept + { + + int f() { return 0; } + int g() noexcept { return 0; } + + static_assert(noexcept(f()) == false, ""); + static_assert(noexcept(g()) == true, ""); + + } + + namespace test_constexpr + { + + template < typename CharT > + unsigned long constexpr + strlen_c_r(const CharT *const s, const unsigned long acc) noexcept + { + return *s ? strlen_c_r(s + 1, acc + 1) : acc; + } + + template < typename CharT > + unsigned long constexpr + strlen_c(const CharT *const s) noexcept + { + return strlen_c_r(s, 0UL); + } + + static_assert(strlen_c("") == 0UL, ""); + static_assert(strlen_c("1") == 1UL, ""); + static_assert(strlen_c("example") == 7UL, ""); + static_assert(strlen_c("another\0example") == 7UL, ""); + + } + + namespace test_rvalue_references + { + + template < int N > + struct answer + { + static constexpr int value = N; + }; + + answer<1> f(int&) { return answer<1>(); } + answer<2> f(const int&) { return answer<2>(); } + answer<3> f(int&&) { return answer<3>(); } + + void + test() + { + int i = 0; + const int c = 0; + static_assert(decltype(f(i))::value == 1, ""); + static_assert(decltype(f(c))::value == 2, ""); + static_assert(decltype(f(0))::value == 3, ""); + } + + } + + namespace test_uniform_initialization + { + + struct test + { + static const int zero {}; + static const int one {1}; + }; + + static_assert(test::zero == 0, ""); + static_assert(test::one == 1, ""); + + } + + namespace test_lambdas + { + + void + test1() + { + auto lambda1 = [](){}; + auto lambda2 = lambda1; + lambda1(); + lambda2(); + } + + int + test2() + { + auto a = [](int i, int j){ return i + j; }(1, 2); + auto b = []() -> int { return '0'; }(); + auto c = [=](){ return a + b; }(); + auto d = [&](){ return c; }(); + auto e = [a, &b](int x) mutable { + const auto identity = [](int y){ return y; }; + for (auto i = 0; i < a; ++i) + a += b--; + return x + identity(a + b); + }(0); + return a + b + c + d + e; + } + + int + test3() + { + const auto nullary = [](){ return 0; }; + const auto unary = [](int x){ return x; }; + using nullary_t = decltype(nullary); + using unary_t = decltype(unary); + const auto higher1st = [](nullary_t f){ return f(); }; + const auto higher2nd = [unary](nullary_t f1){ + return [unary, f1](unary_t f2){ return f2(unary(f1())); }; + }; + return higher1st(nullary) + higher2nd(nullary)(unary); + } + + } + + namespace test_variadic_templates + { + + template + struct sum; + + template + struct sum + { + static constexpr auto value = N0 + sum::value; + }; + + template <> + struct sum<> + { + static constexpr auto value = 0; + }; + + static_assert(sum<>::value == 0, ""); + static_assert(sum<1>::value == 1, ""); + static_assert(sum<23>::value == 23, ""); + static_assert(sum<1, 2>::value == 3, ""); + static_assert(sum<5, 5, 11>::value == 21, ""); + static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, ""); + + } + + // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae + // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function + // because of this. + namespace test_template_alias_sfinae + { + + struct foo {}; + + template + using member = typename T::member_type; + + template + void func(...) {} + + template + void func(member*) {} + + void test(); + + void test() { func(0); } + + } + +} // namespace cxx11 + +#endif // __cplusplus >= 201103L + +]]) + + +dnl Tests for new features in C++14 + +m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_14], [[ + +// If the compiler admits that it is not ready for C++14, why torture it? +// Hopefully, this will speed up the test. + +#ifndef __cplusplus + +#error "This is not a C++ compiler" + +#elif __cplusplus < 201402L && !defined _MSC_VER + +#error "This is not a C++14 compiler" + +#else + +namespace cxx14 +{ + + namespace test_polymorphic_lambdas + { + + int + test() + { + const auto lambda = [](auto&&... args){ + const auto istiny = [](auto x){ + return (sizeof(x) == 1UL) ? 1 : 0; + }; + const int aretiny[] = { istiny(args)... }; + return aretiny[0]; + }; + return lambda(1, 1L, 1.0f, '1'); + } + + } + + namespace test_binary_literals + { + + constexpr auto ivii = 0b0000000000101010; + static_assert(ivii == 42, "wrong value"); + + } + + namespace test_generalized_constexpr + { + + template < typename CharT > + constexpr unsigned long + strlen_c(const CharT *const s) noexcept + { + auto length = 0UL; + for (auto p = s; *p; ++p) + ++length; + return length; + } + + static_assert(strlen_c("") == 0UL, ""); + static_assert(strlen_c("x") == 1UL, ""); + static_assert(strlen_c("test") == 4UL, ""); + static_assert(strlen_c("another\0test") == 7UL, ""); + + } + + namespace test_lambda_init_capture + { + + int + test() + { + auto x = 0; + const auto lambda1 = [a = x](int b){ return a + b; }; + const auto lambda2 = [a = lambda1(x)](){ return a; }; + return lambda2(); + } + + } + + namespace test_digit_separators + { + + constexpr auto ten_million = 100'000'000; + static_assert(ten_million == 100000000, ""); + + } + + namespace test_return_type_deduction + { + + auto f(int& x) { return x; } + decltype(auto) g(int& x) { return x; } + + template < typename T1, typename T2 > + struct is_same + { + static constexpr auto value = false; + }; + + template < typename T > + struct is_same + { + static constexpr auto value = true; + }; + + int + test() + { + auto x = 0; + static_assert(is_same::value, ""); + static_assert(is_same::value, ""); + return x; + } + + } + +} // namespace cxx14 + +#endif // __cplusplus >= 201402L + +]]) + + +dnl Tests for new features in C++17 + +m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_17], [[ + +// If the compiler admits that it is not ready for C++17, why torture it? +// Hopefully, this will speed up the test. + +#ifndef __cplusplus + +#error "This is not a C++ compiler" + +#elif __cplusplus < 201703L && !defined _MSC_VER + +#error "This is not a C++17 compiler" + +#else + +#include +#include +#include + +namespace cxx17 +{ + + namespace test_constexpr_lambdas + { + + constexpr int foo = [](){return 42;}(); + + } + + namespace test::nested_namespace::definitions + { + + } + + namespace test_fold_expression + { + + template + int multiply(Args... args) + { + return (args * ... * 1); + } + + template + bool all(Args... args) + { + return (args && ...); + } + + } + + namespace test_extended_static_assert + { + + static_assert (true); + + } + + namespace test_auto_brace_init_list + { + + auto foo = {5}; + auto bar {5}; + + static_assert(std::is_same, decltype(foo)>::value); + static_assert(std::is_same::value); + } + + namespace test_typename_in_template_template_parameter + { + + template typename X> struct D; + + } + + namespace test_fallthrough_nodiscard_maybe_unused_attributes + { + + int f1() + { + return 42; + } + + [[nodiscard]] int f2() + { + [[maybe_unused]] auto unused = f1(); + + switch (f1()) + { + case 17: + f1(); + [[fallthrough]]; + case 42: + f1(); + } + return f1(); + } + + } + + namespace test_extended_aggregate_initialization + { + + struct base1 + { + int b1, b2 = 42; + }; + + struct base2 + { + base2() { + b3 = 42; + } + int b3; + }; + + struct derived : base1, base2 + { + int d; + }; + + derived d1 {{1, 2}, {}, 4}; // full initialization + derived d2 {{}, {}, 4}; // value-initialized bases + + } + + namespace test_general_range_based_for_loop + { + + struct iter + { + int i; + + int& operator* () + { + return i; + } + + const int& operator* () const + { + return i; + } + + iter& operator++() + { + ++i; + return *this; + } + }; + + struct sentinel + { + int i; + }; + + bool operator== (const iter& i, const sentinel& s) + { + return i.i == s.i; + } + + bool operator!= (const iter& i, const sentinel& s) + { + return !(i == s); + } + + struct range + { + iter begin() const + { + return {0}; + } + + sentinel end() const + { + return {5}; + } + }; + + void f() + { + range r {}; + + for (auto i : r) + { + [[maybe_unused]] auto v = i; + } + } + + } + + namespace test_lambda_capture_asterisk_this_by_value + { + + struct t + { + int i; + int foo() + { + return [*this]() + { + return i; + }(); + } + }; + + } + + namespace test_enum_class_construction + { + + enum class byte : unsigned char + {}; + + byte foo {42}; + + } + + namespace test_constexpr_if + { + + template + int f () + { + if constexpr(cond) + { + return 13; + } + else + { + return 42; + } + } + + } + + namespace test_selection_statement_with_initializer + { + + int f() + { + return 13; + } + + int f2() + { + if (auto i = f(); i > 0) + { + return 3; + } + + switch (auto i = f(); i + 4) + { + case 17: + return 2; + + default: + return 1; + } + } + + } + + namespace test_template_argument_deduction_for_class_templates + { + + template + struct pair + { + pair (T1 p1, T2 p2) + : m1 {p1}, + m2 {p2} + {} + + T1 m1; + T2 m2; + }; + + void f() + { + [[maybe_unused]] auto p = pair{13, 42u}; + } + + } + + namespace test_non_type_auto_template_parameters + { + + template + struct B + {}; + + B<5> b1; + B<'a'> b2; + + } + + namespace test_structured_bindings + { + + int arr[2] = { 1, 2 }; + std::pair pr = { 1, 2 }; + + auto f1() -> int(&)[2] + { + return arr; + } + + auto f2() -> std::pair& + { + return pr; + } + + struct S + { + int x1 : 2; + volatile double y1; + }; + + S f3() + { + return {}; + } + + auto [ x1, y1 ] = f1(); + auto& [ xr1, yr1 ] = f1(); + auto [ x2, y2 ] = f2(); + auto& [ xr2, yr2 ] = f2(); + const auto [ x3, y3 ] = f3(); + + } + + namespace test_exception_spec_type_system + { + + struct Good {}; + struct Bad {}; + + void g1() noexcept; + void g2(); + + template + Bad + f(T*, T*); + + template + Good + f(T1*, T2*); + + static_assert (std::is_same_v); + + } + + namespace test_inline_variables + { + + template void f(T) + {} + + template inline T g(T) + { + return T{}; + } + + template<> inline void f<>(int) + {} + + template<> int g<>(int) + { + return 5; + } + + } + +} // namespace cxx17 + +#endif // __cplusplus < 201703L && !defined _MSC_VER + +]]) + + +dnl Tests for new features in C++20 + +m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_20], [[ + +#ifndef __cplusplus + +#error "This is not a C++ compiler" + +#elif __cplusplus < 202002L && !defined _MSC_VER + +#error "This is not a C++20 compiler" + +#else + +#include + +namespace cxx20 +{ + +// As C++20 supports feature test macros in the standard, there is no +// immediate need to actually test for feature availability on the +// Autoconf side. + +} // namespace cxx20 + +#endif // __cplusplus < 202002L && !defined _MSC_VER + +]]) diff --git a/3rdparty/expat/conftools/compile b/3rdparty/expat/conftools/compile index 23fcba011321a..df363c8fbfbcb 100755 --- a/3rdparty/expat/conftools/compile +++ b/3rdparty/expat/conftools/compile @@ -3,7 +3,7 @@ scriptversion=2018-03-07.03; # UTC -# Copyright (C) 1999-2020 Free Software Foundation, Inc. +# Copyright (C) 1999-2021 Free Software Foundation, Inc. # Written by Tom Tromey . # # This program is free software; you can redistribute it and/or modify diff --git a/3rdparty/expat/conftools/config.guess b/3rdparty/expat/conftools/config.guess index df895493ef7ca..160ecf0951b98 100755 --- a/3rdparty/expat/conftools/config.guess +++ b/3rdparty/expat/conftools/config.guess @@ -1,12 +1,14 @@ #! /bin/sh # Attempt to guess a canonical system name. -# Copyright 1992-2019 Free Software Foundation, Inc. +# Copyright 1992-2022 Free Software Foundation, Inc. -timestamp='2019-09-10' +# shellcheck disable=SC2006,SC2268 # see below for rationale + +timestamp='2022-05-08' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or +# the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but @@ -27,11 +29,19 @@ timestamp='2019-09-10' # Originally written by Per Bothner; maintained since 2000 by Ben Elliston. # # You can get the latest version of this script from: -# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess +# https://git.savannah.gnu.org/cgit/config.git/plain/config.guess # # Please send patches to . +# The "shellcheck disable" line above the timestamp inhibits complaints +# about features and limitations of the classic Bourne shell that were +# superseded or lifted in POSIX. However, this script identifies a wide +# variety of pre-POSIX systems that do not have POSIX shells at all, and +# even some reasonably current systems (Solaris 10 as case-in-point) still +# have a pre-POSIX /bin/sh. + + me=`echo "$0" | sed -e 's,.*/,,'` usage="\ @@ -50,7 +60,7 @@ version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright 1992-2019 Free Software Foundation, Inc. +Copyright 1992-2022 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -84,6 +94,9 @@ if test $# != 0; then exit 1 fi +# Just in case it came from the environment. +GUESS= + # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a @@ -99,8 +112,10 @@ tmp= trap 'test -z "$tmp" || rm -fr "$tmp"' 0 1 2 13 15 set_cc_for_build() { + # prevent multiple calls if $tmp is already set + test "$tmp" && return 0 : "${TMPDIR=/tmp}" - # shellcheck disable=SC2039 + # shellcheck disable=SC2039,SC3028 { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir "$tmp" 2>/dev/null) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir "$tmp" 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } || @@ -110,7 +125,7 @@ set_cc_for_build() { ,,) echo "int x;" > "$dummy.c" for driver in cc gcc c89 c99 ; do if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then - CC_FOR_BUILD="$driver" + CC_FOR_BUILD=$driver break fi done @@ -131,14 +146,12 @@ fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown -UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown +UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown -case "$UNAME_SYSTEM" in +case $UNAME_SYSTEM in Linux|GNU|GNU/*) - # If the system lacks a compiler, then just pick glibc. - # We could probably try harder. - LIBC=gnu + LIBC=unknown set_cc_for_build cat <<-EOF > "$dummy.c" @@ -147,24 +160,37 @@ Linux|GNU|GNU/*) LIBC=uclibc #elif defined(__dietlibc__) LIBC=dietlibc - #else + #elif defined(__GLIBC__) LIBC=gnu + #else + #include + /* First heuristic to detect musl libc. */ + #ifdef __DEFINED_va_list + LIBC=musl + #endif #endif EOF - eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`" + cc_set_libc=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` + eval "$cc_set_libc" - # If ldd exists, use it to detect musl libc. - if command -v ldd >/dev/null && \ - ldd --version 2>&1 | grep -q ^musl - then - LIBC=musl + # Second heuristic to detect musl libc. + if [ "$LIBC" = unknown ] && + command -v ldd >/dev/null && + ldd --version 2>&1 | grep -q ^musl; then + LIBC=musl + fi + + # If the system lacks a compiler, then just pick glibc. + # We could probably try harder. + if [ "$LIBC" = unknown ]; then + LIBC=gnu fi ;; esac # Note: order is significant - the case branches are not exclusive. -case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in +case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, @@ -176,12 +202,12 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". - sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ - "/sbin/$sysctl" 2>/dev/null || \ - "/usr/sbin/$sysctl" 2>/dev/null || \ + /sbin/sysctl -n hw.machine_arch 2>/dev/null || \ + /usr/sbin/sysctl -n hw.machine_arch 2>/dev/null || \ echo unknown)` - case "$UNAME_MACHINE_ARCH" in + case $UNAME_MACHINE_ARCH in + aarch64eb) machine=aarch64_be-unknown ;; armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; @@ -190,13 +216,13 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in earmv*) arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'` endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'` - machine="${arch}${endian}"-unknown + machine=${arch}${endian}-unknown ;; - *) machine="$UNAME_MACHINE_ARCH"-unknown ;; + *) machine=$UNAME_MACHINE_ARCH-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently (or will in the future) and ABI. - case "$UNAME_MACHINE_ARCH" in + case $UNAME_MACHINE_ARCH in earm*) os=netbsdelf ;; @@ -217,7 +243,7 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in ;; esac # Determine ABI tags. - case "$UNAME_MACHINE_ARCH" in + case $UNAME_MACHINE_ARCH in earm*) expr='s/^earmv[0-9]/-eabi/;s/eb$//' abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"` @@ -228,7 +254,7 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. - case "$UNAME_VERSION" in + case $UNAME_VERSION in Debian*) release='-gnu' ;; @@ -239,51 +265,57 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. - echo "$machine-${os}${release}${abi-}" - exit ;; + GUESS=$machine-${os}${release}${abi-} + ;; *:Bitrig:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` - echo "$UNAME_MACHINE_ARCH"-unknown-bitrig"$UNAME_RELEASE" - exit ;; + GUESS=$UNAME_MACHINE_ARCH-unknown-bitrig$UNAME_RELEASE + ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` - echo "$UNAME_MACHINE_ARCH"-unknown-openbsd"$UNAME_RELEASE" - exit ;; + GUESS=$UNAME_MACHINE_ARCH-unknown-openbsd$UNAME_RELEASE + ;; + *:SecBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/SecBSD.//'` + GUESS=$UNAME_MACHINE_ARCH-unknown-secbsd$UNAME_RELEASE + ;; *:LibertyBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` - echo "$UNAME_MACHINE_ARCH"-unknown-libertybsd"$UNAME_RELEASE" - exit ;; + GUESS=$UNAME_MACHINE_ARCH-unknown-libertybsd$UNAME_RELEASE + ;; *:MidnightBSD:*:*) - echo "$UNAME_MACHINE"-unknown-midnightbsd"$UNAME_RELEASE" - exit ;; + GUESS=$UNAME_MACHINE-unknown-midnightbsd$UNAME_RELEASE + ;; *:ekkoBSD:*:*) - echo "$UNAME_MACHINE"-unknown-ekkobsd"$UNAME_RELEASE" - exit ;; + GUESS=$UNAME_MACHINE-unknown-ekkobsd$UNAME_RELEASE + ;; *:SolidBSD:*:*) - echo "$UNAME_MACHINE"-unknown-solidbsd"$UNAME_RELEASE" - exit ;; + GUESS=$UNAME_MACHINE-unknown-solidbsd$UNAME_RELEASE + ;; *:OS108:*:*) - echo "$UNAME_MACHINE"-unknown-os108_"$UNAME_RELEASE" - exit ;; + GUESS=$UNAME_MACHINE-unknown-os108_$UNAME_RELEASE + ;; macppc:MirBSD:*:*) - echo powerpc-unknown-mirbsd"$UNAME_RELEASE" - exit ;; + GUESS=powerpc-unknown-mirbsd$UNAME_RELEASE + ;; *:MirBSD:*:*) - echo "$UNAME_MACHINE"-unknown-mirbsd"$UNAME_RELEASE" - exit ;; + GUESS=$UNAME_MACHINE-unknown-mirbsd$UNAME_RELEASE + ;; *:Sortix:*:*) - echo "$UNAME_MACHINE"-unknown-sortix - exit ;; + GUESS=$UNAME_MACHINE-unknown-sortix + ;; *:Twizzler:*:*) - echo "$UNAME_MACHINE"-unknown-twizzler - exit ;; + GUESS=$UNAME_MACHINE-unknown-twizzler + ;; *:Redox:*:*) - echo "$UNAME_MACHINE"-unknown-redox - exit ;; + GUESS=$UNAME_MACHINE-unknown-redox + ;; mips:OSF1:*.*) - echo mips-dec-osf1 - exit ;; + GUESS=mips-dec-osf1 + ;; alpha:OSF1:*:*) + # Reset EXIT trap before exiting to avoid spurious non-zero exit code. + trap '' 0 case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` @@ -297,7 +329,7 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` - case "$ALPHA_CPU_TYPE" in + case $ALPHA_CPU_TYPE in "EV4 (21064)") UNAME_MACHINE=alpha ;; "EV4.5 (21064)") @@ -334,117 +366,121 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. - echo "$UNAME_MACHINE"-dec-osf"`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`" - # Reset EXIT trap before exiting to avoid spurious non-zero exit code. - exitcode=$? - trap '' 0 - exit $exitcode ;; + OSF_REL=`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` + GUESS=$UNAME_MACHINE-dec-osf$OSF_REL + ;; Amiga*:UNIX_System_V:4.0:*) - echo m68k-unknown-sysv4 - exit ;; + GUESS=m68k-unknown-sysv4 + ;; *:[Aa]miga[Oo][Ss]:*:*) - echo "$UNAME_MACHINE"-unknown-amigaos - exit ;; + GUESS=$UNAME_MACHINE-unknown-amigaos + ;; *:[Mm]orph[Oo][Ss]:*:*) - echo "$UNAME_MACHINE"-unknown-morphos - exit ;; + GUESS=$UNAME_MACHINE-unknown-morphos + ;; *:OS/390:*:*) - echo i370-ibm-openedition - exit ;; + GUESS=i370-ibm-openedition + ;; *:z/VM:*:*) - echo s390-ibm-zvmoe - exit ;; + GUESS=s390-ibm-zvmoe + ;; *:OS400:*:*) - echo powerpc-ibm-os400 - exit ;; + GUESS=powerpc-ibm-os400 + ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) - echo arm-acorn-riscix"$UNAME_RELEASE" - exit ;; + GUESS=arm-acorn-riscix$UNAME_RELEASE + ;; arm*:riscos:*:*|arm*:RISCOS:*:*) - echo arm-unknown-riscos - exit ;; + GUESS=arm-unknown-riscos + ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) - echo hppa1.1-hitachi-hiuxmpp - exit ;; + GUESS=hppa1.1-hitachi-hiuxmpp + ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. - if test "`(/bin/universe) 2>/dev/null`" = att ; then - echo pyramid-pyramid-sysv3 - else - echo pyramid-pyramid-bsd - fi - exit ;; + case `(/bin/universe) 2>/dev/null` in + att) GUESS=pyramid-pyramid-sysv3 ;; + *) GUESS=pyramid-pyramid-bsd ;; + esac + ;; NILE*:*:*:dcosx) - echo pyramid-pyramid-svr4 - exit ;; + GUESS=pyramid-pyramid-svr4 + ;; DRS?6000:unix:4.0:6*) - echo sparc-icl-nx6 - exit ;; + GUESS=sparc-icl-nx6 + ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in - sparc) echo sparc-icl-nx7; exit ;; - esac ;; + sparc) GUESS=sparc-icl-nx7 ;; + esac + ;; s390x:SunOS:*:*) - echo "$UNAME_MACHINE"-ibm-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`" - exit ;; + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` + GUESS=$UNAME_MACHINE-ibm-solaris2$SUN_REL + ;; sun4H:SunOS:5.*:*) - echo sparc-hal-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" - exit ;; + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` + GUESS=sparc-hal-solaris2$SUN_REL + ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) - echo sparc-sun-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`" - exit ;; + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` + GUESS=sparc-sun-solaris2$SUN_REL + ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) - echo i386-pc-auroraux"$UNAME_RELEASE" - exit ;; + GUESS=i386-pc-auroraux$UNAME_RELEASE + ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) set_cc_for_build SUN_ARCH=i386 # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. - if [ "$CC_FOR_BUILD" != no_compiler_found ]; then + if test "$CC_FOR_BUILD" != no_compiler_found; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + (CCOPTS="" $CC_FOR_BUILD -m64 -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then SUN_ARCH=x86_64 fi fi - echo "$SUN_ARCH"-pc-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" - exit ;; + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` + GUESS=$SUN_ARCH-pc-solaris2$SUN_REL + ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. - echo sparc-sun-solaris3"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" - exit ;; + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` + GUESS=sparc-sun-solaris3$SUN_REL + ;; sun4*:SunOS:*:*) - case "`/usr/bin/arch -k`" in + case `/usr/bin/arch -k` in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. - echo sparc-sun-sunos"`echo "$UNAME_RELEASE"|sed -e 's/-/_/'`" - exit ;; + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/'` + GUESS=sparc-sun-sunos$SUN_REL + ;; sun3*:SunOS:*:*) - echo m68k-sun-sunos"$UNAME_RELEASE" - exit ;; + GUESS=m68k-sun-sunos$UNAME_RELEASE + ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3 - case "`/bin/arch`" in + case `/bin/arch` in sun3) - echo m68k-sun-sunos"$UNAME_RELEASE" + GUESS=m68k-sun-sunos$UNAME_RELEASE ;; sun4) - echo sparc-sun-sunos"$UNAME_RELEASE" + GUESS=sparc-sun-sunos$UNAME_RELEASE ;; esac - exit ;; + ;; aushp:SunOS:*:*) - echo sparc-auspex-sunos"$UNAME_RELEASE" - exit ;; + GUESS=sparc-auspex-sunos$UNAME_RELEASE + ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor @@ -454,41 +490,41 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint"$UNAME_RELEASE" - exit ;; + GUESS=m68k-atari-mint$UNAME_RELEASE + ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint"$UNAME_RELEASE" - exit ;; + GUESS=m68k-atari-mint$UNAME_RELEASE + ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) - echo m68k-atari-mint"$UNAME_RELEASE" - exit ;; + GUESS=m68k-atari-mint$UNAME_RELEASE + ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) - echo m68k-milan-mint"$UNAME_RELEASE" - exit ;; + GUESS=m68k-milan-mint$UNAME_RELEASE + ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) - echo m68k-hades-mint"$UNAME_RELEASE" - exit ;; + GUESS=m68k-hades-mint$UNAME_RELEASE + ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) - echo m68k-unknown-mint"$UNAME_RELEASE" - exit ;; + GUESS=m68k-unknown-mint$UNAME_RELEASE + ;; m68k:machten:*:*) - echo m68k-apple-machten"$UNAME_RELEASE" - exit ;; + GUESS=m68k-apple-machten$UNAME_RELEASE + ;; powerpc:machten:*:*) - echo powerpc-apple-machten"$UNAME_RELEASE" - exit ;; + GUESS=powerpc-apple-machten$UNAME_RELEASE + ;; RISC*:Mach:*:*) - echo mips-dec-mach_bsd4.3 - exit ;; + GUESS=mips-dec-mach_bsd4.3 + ;; RISC*:ULTRIX:*:*) - echo mips-dec-ultrix"$UNAME_RELEASE" - exit ;; + GUESS=mips-dec-ultrix$UNAME_RELEASE + ;; VAX*:ULTRIX*:*:*) - echo vax-dec-ultrix"$UNAME_RELEASE" - exit ;; + GUESS=vax-dec-ultrix$UNAME_RELEASE + ;; 2020:CLIX:*:* | 2430:CLIX:*:*) - echo clipper-intergraph-clix"$UNAME_RELEASE" - exit ;; + GUESS=clipper-intergraph-clix$UNAME_RELEASE + ;; mips:*:*:UMIPS | mips:*:*:RISCos) set_cc_for_build sed 's/^ //' << EOF > "$dummy.c" @@ -516,75 +552,76 @@ EOF dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`"$dummy" "$dummyarg"` && { echo "$SYSTEM_NAME"; exit; } - echo mips-mips-riscos"$UNAME_RELEASE" - exit ;; + GUESS=mips-mips-riscos$UNAME_RELEASE + ;; Motorola:PowerMAX_OS:*:*) - echo powerpc-motorola-powermax - exit ;; + GUESS=powerpc-motorola-powermax + ;; Motorola:*:4.3:PL8-*) - echo powerpc-harris-powermax - exit ;; + GUESS=powerpc-harris-powermax + ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) - echo powerpc-harris-powermax - exit ;; + GUESS=powerpc-harris-powermax + ;; Night_Hawk:Power_UNIX:*:*) - echo powerpc-harris-powerunix - exit ;; + GUESS=powerpc-harris-powerunix + ;; m88k:CX/UX:7*:*) - echo m88k-harris-cxux7 - exit ;; + GUESS=m88k-harris-cxux7 + ;; m88k:*:4*:R4*) - echo m88k-motorola-sysv4 - exit ;; + GUESS=m88k-motorola-sysv4 + ;; m88k:*:3*:R3*) - echo m88k-motorola-sysv3 - exit ;; + GUESS=m88k-motorola-sysv3 + ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` - if [ "$UNAME_PROCESSOR" = mc88100 ] || [ "$UNAME_PROCESSOR" = mc88110 ] + if test "$UNAME_PROCESSOR" = mc88100 || test "$UNAME_PROCESSOR" = mc88110 then - if [ "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx ] || \ - [ "$TARGET_BINARY_INTERFACE"x = x ] + if test "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx || \ + test "$TARGET_BINARY_INTERFACE"x = x then - echo m88k-dg-dgux"$UNAME_RELEASE" + GUESS=m88k-dg-dgux$UNAME_RELEASE else - echo m88k-dg-dguxbcs"$UNAME_RELEASE" + GUESS=m88k-dg-dguxbcs$UNAME_RELEASE fi else - echo i586-dg-dgux"$UNAME_RELEASE" + GUESS=i586-dg-dgux$UNAME_RELEASE fi - exit ;; + ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) - echo m88k-dolphin-sysv3 - exit ;; + GUESS=m88k-dolphin-sysv3 + ;; M88*:*:R3*:*) # Delta 88k system running SVR3 - echo m88k-motorola-sysv3 - exit ;; + GUESS=m88k-motorola-sysv3 + ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) - echo m88k-tektronix-sysv3 - exit ;; + GUESS=m88k-tektronix-sysv3 + ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) - echo m68k-tektronix-bsd - exit ;; + GUESS=m68k-tektronix-bsd + ;; *:IRIX*:*:*) - echo mips-sgi-irix"`echo "$UNAME_RELEASE"|sed -e 's/-/_/g'`" - exit ;; + IRIX_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/g'` + GUESS=mips-sgi-irix$IRIX_REL + ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. - echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id - exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' + GUESS=romp-ibm-aix # uname -m gives an 8 hex-code CPU id + ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) - echo i386-ibm-aix - exit ;; + GUESS=i386-ibm-aix + ;; ia64:AIX:*:*) - if [ -x /usr/bin/oslevel ] ; then + if test -x /usr/bin/oslevel ; then IBM_REV=`/usr/bin/oslevel` else - IBM_REV="$UNAME_VERSION.$UNAME_RELEASE" + IBM_REV=$UNAME_VERSION.$UNAME_RELEASE fi - echo "$UNAME_MACHINE"-ibm-aix"$IBM_REV" - exit ;; + GUESS=$UNAME_MACHINE-ibm-aix$IBM_REV + ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then set_cc_for_build @@ -601,16 +638,16 @@ EOF EOF if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` then - echo "$SYSTEM_NAME" + GUESS=$SYSTEM_NAME else - echo rs6000-ibm-aix3.2.5 + GUESS=rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then - echo rs6000-ibm-aix3.2.4 + GUESS=rs6000-ibm-aix3.2.4 else - echo rs6000-ibm-aix3.2 + GUESS=rs6000-ibm-aix3.2 fi - exit ;; + ;; *:AIX:*:[4567]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then @@ -618,56 +655,56 @@ EOF else IBM_ARCH=powerpc fi - if [ -x /usr/bin/lslpp ] ; then - IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | + if test -x /usr/bin/lslpp ; then + IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | \ awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` else - IBM_REV="$UNAME_VERSION.$UNAME_RELEASE" + IBM_REV=$UNAME_VERSION.$UNAME_RELEASE fi - echo "$IBM_ARCH"-ibm-aix"$IBM_REV" - exit ;; + GUESS=$IBM_ARCH-ibm-aix$IBM_REV + ;; *:AIX:*:*) - echo rs6000-ibm-aix - exit ;; + GUESS=rs6000-ibm-aix + ;; ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*) - echo romp-ibm-bsd4.4 - exit ;; + GUESS=romp-ibm-bsd4.4 + ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and - echo romp-ibm-bsd"$UNAME_RELEASE" # 4.3 with uname added to - exit ;; # report: romp-ibm BSD 4.3 + GUESS=romp-ibm-bsd$UNAME_RELEASE # 4.3 with uname added to + ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) - echo rs6000-bull-bosx - exit ;; + GUESS=rs6000-bull-bosx + ;; DPX/2?00:B.O.S.:*:*) - echo m68k-bull-sysv3 - exit ;; + GUESS=m68k-bull-sysv3 + ;; 9000/[34]??:4.3bsd:1.*:*) - echo m68k-hp-bsd - exit ;; + GUESS=m68k-hp-bsd + ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) - echo m68k-hp-bsd4.4 - exit ;; + GUESS=m68k-hp-bsd4.4 + ;; 9000/[34678]??:HP-UX:*:*) - HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'` - case "$UNAME_MACHINE" in + HPUX_REV=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*.[0B]*//'` + case $UNAME_MACHINE in 9000/31?) HP_ARCH=m68000 ;; 9000/[34]??) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) - if [ -x /usr/bin/getconf ]; then + if test -x /usr/bin/getconf; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` - case "$sc_cpu_version" in + case $sc_cpu_version in 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 - case "$sc_kernel_bits" in + case $sc_kernel_bits in 32) HP_ARCH=hppa2.0n ;; 64) HP_ARCH=hppa2.0w ;; '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20 esac ;; esac fi - if [ "$HP_ARCH" = "" ]; then + if test "$HP_ARCH" = ""; then set_cc_for_build sed 's/^ //' << EOF > "$dummy.c" @@ -706,7 +743,7 @@ EOF test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac - if [ "$HP_ARCH" = hppa2.0w ] + if test "$HP_ARCH" = hppa2.0w then set_cc_for_build @@ -727,12 +764,12 @@ EOF HP_ARCH=hppa64 fi fi - echo "$HP_ARCH"-hp-hpux"$HPUX_REV" - exit ;; + GUESS=$HP_ARCH-hp-hpux$HPUX_REV + ;; ia64:HP-UX:*:*) - HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'` - echo ia64-hp-hpux"$HPUX_REV" - exit ;; + HPUX_REV=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*.[0B]*//'` + GUESS=ia64-hp-hpux$HPUX_REV + ;; 3050*:HI-UX:*:*) set_cc_for_build sed 's/^ //' << EOF > "$dummy.c" @@ -762,36 +799,36 @@ EOF EOF $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` && { echo "$SYSTEM_NAME"; exit; } - echo unknown-hitachi-hiuxwe2 - exit ;; + GUESS=unknown-hitachi-hiuxwe2 + ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*) - echo hppa1.1-hp-bsd - exit ;; + GUESS=hppa1.1-hp-bsd + ;; 9000/8??:4.3bsd:*:*) - echo hppa1.0-hp-bsd - exit ;; + GUESS=hppa1.0-hp-bsd + ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) - echo hppa1.0-hp-mpeix - exit ;; + GUESS=hppa1.0-hp-mpeix + ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*) - echo hppa1.1-hp-osf - exit ;; + GUESS=hppa1.1-hp-osf + ;; hp8??:OSF1:*:*) - echo hppa1.0-hp-osf - exit ;; + GUESS=hppa1.0-hp-osf + ;; i*86:OSF1:*:*) - if [ -x /usr/sbin/sysversion ] ; then - echo "$UNAME_MACHINE"-unknown-osf1mk + if test -x /usr/sbin/sysversion ; then + GUESS=$UNAME_MACHINE-unknown-osf1mk else - echo "$UNAME_MACHINE"-unknown-osf1 + GUESS=$UNAME_MACHINE-unknown-osf1 fi - exit ;; + ;; parisc*:Lites*:*:*) - echo hppa1.1-hp-lites - exit ;; + GUESS=hppa1.1-hp-lites + ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) - echo c1-convex-bsd - exit ;; + GUESS=c1-convex-bsd + ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd @@ -799,17 +836,18 @@ EOF fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) - echo c34-convex-bsd - exit ;; + GUESS=c34-convex-bsd + ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) - echo c38-convex-bsd - exit ;; + GUESS=c38-convex-bsd + ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) - echo c4-convex-bsd - exit ;; + GUESS=c4-convex-bsd + ;; CRAY*Y-MP:*:*:*) - echo ymp-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' - exit ;; + CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` + GUESS=ymp-cray-unicos$CRAY_REL + ;; CRAY*[A-Z]90:*:*:*) echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ @@ -817,114 +855,129 @@ EOF -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) - echo t90-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' - exit ;; + CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` + GUESS=t90-cray-unicos$CRAY_REL + ;; CRAY*T3E:*:*:*) - echo alphaev5-cray-unicosmk"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' - exit ;; + CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` + GUESS=alphaev5-cray-unicosmk$CRAY_REL + ;; CRAY*SV1:*:*:*) - echo sv1-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' - exit ;; + CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` + GUESS=sv1-cray-unicos$CRAY_REL + ;; *:UNICOS/mp:*:*) - echo craynv-cray-unicosmp"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' - exit ;; + CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` + GUESS=craynv-cray-unicosmp$CRAY_REL + ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'` - echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit ;; + GUESS=${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL} + ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'` - echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit ;; + GUESS=sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL} + ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) - echo "$UNAME_MACHINE"-pc-bsdi"$UNAME_RELEASE" - exit ;; + GUESS=$UNAME_MACHINE-pc-bsdi$UNAME_RELEASE + ;; sparc*:BSD/OS:*:*) - echo sparc-unknown-bsdi"$UNAME_RELEASE" - exit ;; + GUESS=sparc-unknown-bsdi$UNAME_RELEASE + ;; *:BSD/OS:*:*) - echo "$UNAME_MACHINE"-unknown-bsdi"$UNAME_RELEASE" - exit ;; + GUESS=$UNAME_MACHINE-unknown-bsdi$UNAME_RELEASE + ;; arm:FreeBSD:*:*) UNAME_PROCESSOR=`uname -p` set_cc_for_build if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then - echo "${UNAME_PROCESSOR}"-unknown-freebsd"`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`"-gnueabi + FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` + GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabi else - echo "${UNAME_PROCESSOR}"-unknown-freebsd"`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`"-gnueabihf + FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` + GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabihf fi - exit ;; + ;; *:FreeBSD:*:*) UNAME_PROCESSOR=`/usr/bin/uname -p` - case "$UNAME_PROCESSOR" in + case $UNAME_PROCESSOR in amd64) UNAME_PROCESSOR=x86_64 ;; i386) UNAME_PROCESSOR=i586 ;; esac - echo "$UNAME_PROCESSOR"-unknown-freebsd"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`" - exit ;; + FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` + GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL + ;; i*:CYGWIN*:*) - echo "$UNAME_MACHINE"-pc-cygwin - exit ;; + GUESS=$UNAME_MACHINE-pc-cygwin + ;; *:MINGW64*:*) - echo "$UNAME_MACHINE"-pc-mingw64 - exit ;; + GUESS=$UNAME_MACHINE-pc-mingw64 + ;; *:MINGW*:*) - echo "$UNAME_MACHINE"-pc-mingw32 - exit ;; + GUESS=$UNAME_MACHINE-pc-mingw32 + ;; *:MSYS*:*) - echo "$UNAME_MACHINE"-pc-msys - exit ;; + GUESS=$UNAME_MACHINE-pc-msys + ;; i*:PW*:*) - echo "$UNAME_MACHINE"-pc-pw32 - exit ;; + GUESS=$UNAME_MACHINE-pc-pw32 + ;; + *:SerenityOS:*:*) + GUESS=$UNAME_MACHINE-pc-serenity + ;; *:Interix*:*) - case "$UNAME_MACHINE" in + case $UNAME_MACHINE in x86) - echo i586-pc-interix"$UNAME_RELEASE" - exit ;; + GUESS=i586-pc-interix$UNAME_RELEASE + ;; authenticamd | genuineintel | EM64T) - echo x86_64-unknown-interix"$UNAME_RELEASE" - exit ;; + GUESS=x86_64-unknown-interix$UNAME_RELEASE + ;; IA64) - echo ia64-unknown-interix"$UNAME_RELEASE" - exit ;; + GUESS=ia64-unknown-interix$UNAME_RELEASE + ;; esac ;; i*:UWIN*:*) - echo "$UNAME_MACHINE"-pc-uwin - exit ;; + GUESS=$UNAME_MACHINE-pc-uwin + ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) - echo x86_64-pc-cygwin - exit ;; + GUESS=x86_64-pc-cygwin + ;; prep*:SunOS:5.*:*) - echo powerpcle-unknown-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" - exit ;; + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` + GUESS=powerpcle-unknown-solaris2$SUN_REL + ;; *:GNU:*:*) # the GNU system - echo "`echo "$UNAME_MACHINE"|sed -e 's,[-/].*$,,'`-unknown-$LIBC`echo "$UNAME_RELEASE"|sed -e 's,/.*$,,'`" - exit ;; + GNU_ARCH=`echo "$UNAME_MACHINE" | sed -e 's,[-/].*$,,'` + GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's,/.*$,,'` + GUESS=$GNU_ARCH-unknown-$LIBC$GNU_REL + ;; *:GNU/*:*:*) # other systems with GNU libc and userland - echo "$UNAME_MACHINE-unknown-`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`-$LIBC" - exit ;; + GNU_SYS=`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"` + GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` + GUESS=$UNAME_MACHINE-unknown-$GNU_SYS$GNU_REL-$LIBC + ;; *:Minix:*:*) - echo "$UNAME_MACHINE"-unknown-minix - exit ;; + GUESS=$UNAME_MACHINE-unknown-minix + ;; aarch64:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; alpha:Linux:*:*) - case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 2>/dev/null` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; @@ -935,60 +988,63 @@ EOF esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC=gnulibc1 ; fi - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; - arc:Linux:*:* | arceb:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + arc:Linux:*:* | arceb:Linux:*:* | arc32:Linux:*:* | arc64:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; arm*:Linux:*:*) set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabi + GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabi else - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabihf + GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabihf fi fi - exit ;; + ;; avr32*:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; cris:Linux:*:*) - echo "$UNAME_MACHINE"-axis-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-axis-linux-$LIBC + ;; crisv32:Linux:*:*) - echo "$UNAME_MACHINE"-axis-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-axis-linux-$LIBC + ;; e2k:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; frv:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; hexagon:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; i*86:Linux:*:*) - echo "$UNAME_MACHINE"-pc-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-pc-linux-$LIBC + ;; ia64:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; k1om:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + loongarch32:Linux:*:* | loongarch64:Linux:*:* | loongarchx32:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; m32r*:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; m68*:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; mips:Linux:*:* | mips64:Linux:*:*) set_cc_for_build IS_GLIBC=0 @@ -1033,124 +1089,135 @@ EOF #endif #endif EOF - eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU\|^MIPS_ENDIAN\|^LIBCABI'`" + cc_set_vars=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU\|^MIPS_ENDIAN\|^LIBCABI'` + eval "$cc_set_vars" test "x$CPU" != x && { echo "$CPU${MIPS_ENDIAN}-unknown-linux-$LIBCABI"; exit; } ;; mips64el:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; openrisc*:Linux:*:*) - echo or1k-unknown-linux-"$LIBC" - exit ;; + GUESS=or1k-unknown-linux-$LIBC + ;; or32:Linux:*:* | or1k*:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; padre:Linux:*:*) - echo sparc-unknown-linux-"$LIBC" - exit ;; + GUESS=sparc-unknown-linux-$LIBC + ;; parisc64:Linux:*:* | hppa64:Linux:*:*) - echo hppa64-unknown-linux-"$LIBC" - exit ;; + GUESS=hppa64-unknown-linux-$LIBC + ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in - PA7*) echo hppa1.1-unknown-linux-"$LIBC" ;; - PA8*) echo hppa2.0-unknown-linux-"$LIBC" ;; - *) echo hppa-unknown-linux-"$LIBC" ;; + PA7*) GUESS=hppa1.1-unknown-linux-$LIBC ;; + PA8*) GUESS=hppa2.0-unknown-linux-$LIBC ;; + *) GUESS=hppa-unknown-linux-$LIBC ;; esac - exit ;; + ;; ppc64:Linux:*:*) - echo powerpc64-unknown-linux-"$LIBC" - exit ;; + GUESS=powerpc64-unknown-linux-$LIBC + ;; ppc:Linux:*:*) - echo powerpc-unknown-linux-"$LIBC" - exit ;; + GUESS=powerpc-unknown-linux-$LIBC + ;; ppc64le:Linux:*:*) - echo powerpc64le-unknown-linux-"$LIBC" - exit ;; + GUESS=powerpc64le-unknown-linux-$LIBC + ;; ppcle:Linux:*:*) - echo powerpcle-unknown-linux-"$LIBC" - exit ;; - riscv32:Linux:*:* | riscv64:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS=powerpcle-unknown-linux-$LIBC + ;; + riscv32:Linux:*:* | riscv32be:Linux:*:* | riscv64:Linux:*:* | riscv64be:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; s390:Linux:*:* | s390x:Linux:*:*) - echo "$UNAME_MACHINE"-ibm-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-ibm-linux-$LIBC + ;; sh64*:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; sh*:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; sparc:Linux:*:* | sparc64:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; tile*:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; vax:Linux:*:*) - echo "$UNAME_MACHINE"-dec-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-dec-linux-$LIBC + ;; x86_64:Linux:*:*) set_cc_for_build - X86_64_ABI= - # If there is a compiler, see if it is configured for 32-bit objects. - if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then - if (echo '#ifdef __ILP32__'; echo IS_X32; echo '#endif') | \ - (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ - grep IS_X32 >/dev/null - then - X86_64_ABI=x32 - fi + CPU=$UNAME_MACHINE + LIBCABI=$LIBC + if test "$CC_FOR_BUILD" != no_compiler_found; then + ABI=64 + sed 's/^ //' << EOF > "$dummy.c" + #ifdef __i386__ + ABI=x86 + #else + #ifdef __ILP32__ + ABI=x32 + #endif + #endif +EOF + cc_set_abi=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^ABI' | sed 's, ,,g'` + eval "$cc_set_abi" + case $ABI in + x86) CPU=i686 ;; + x32) LIBCABI=${LIBC}x32 ;; + esac fi - echo "$UNAME_MACHINE"-pc-linux-"$LIBC$X86_64_ABI" - exit ;; + GUESS=$CPU-pc-linux-$LIBCABI + ;; xtensa*:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. - echo i386-sequent-sysv4 - exit ;; + GUESS=i386-sequent-sysv4 + ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. - echo "$UNAME_MACHINE"-pc-sysv4.2uw"$UNAME_VERSION" - exit ;; + GUESS=$UNAME_MACHINE-pc-sysv4.2uw$UNAME_VERSION + ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. - echo "$UNAME_MACHINE"-pc-os2-emx - exit ;; + GUESS=$UNAME_MACHINE-pc-os2-emx + ;; i*86:XTS-300:*:STOP) - echo "$UNAME_MACHINE"-unknown-stop - exit ;; + GUESS=$UNAME_MACHINE-unknown-stop + ;; i*86:atheos:*:*) - echo "$UNAME_MACHINE"-unknown-atheos - exit ;; + GUESS=$UNAME_MACHINE-unknown-atheos + ;; i*86:syllable:*:*) - echo "$UNAME_MACHINE"-pc-syllable - exit ;; + GUESS=$UNAME_MACHINE-pc-syllable + ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) - echo i386-unknown-lynxos"$UNAME_RELEASE" - exit ;; + GUESS=i386-unknown-lynxos$UNAME_RELEASE + ;; i*86:*DOS:*:*) - echo "$UNAME_MACHINE"-pc-msdosdjgpp - exit ;; + GUESS=$UNAME_MACHINE-pc-msdosdjgpp + ;; i*86:*:4.*:*) UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then - echo "$UNAME_MACHINE"-univel-sysv"$UNAME_REL" + GUESS=$UNAME_MACHINE-univel-sysv$UNAME_REL else - echo "$UNAME_MACHINE"-pc-sysv"$UNAME_REL" + GUESS=$UNAME_MACHINE-pc-sysv$UNAME_REL fi - exit ;; + ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in @@ -1158,12 +1225,12 @@ EOF *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac - echo "$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}" - exit ;; + GUESS=$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} + ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 @@ -1173,11 +1240,11 @@ EOF && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 - echo "$UNAME_MACHINE"-pc-sco"$UNAME_REL" + GUESS=$UNAME_MACHINE-pc-sco$UNAME_REL else - echo "$UNAME_MACHINE"-pc-sysv32 + GUESS=$UNAME_MACHINE-pc-sysv32 fi - exit ;; + ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about @@ -1185,31 +1252,31 @@ EOF # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configure will decide that # this is a cross-build. - echo i586-pc-msdosdjgpp - exit ;; + GUESS=i586-pc-msdosdjgpp + ;; Intel:Mach:3*:*) - echo i386-pc-mach3 - exit ;; + GUESS=i386-pc-mach3 + ;; paragon:*:*:*) - echo i860-intel-osf1 - exit ;; + GUESS=i860-intel-osf1 + ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then - echo i860-stardent-sysv"$UNAME_RELEASE" # Stardent Vistra i860-SVR4 + GUESS=i860-stardent-sysv$UNAME_RELEASE # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. - echo i860-unknown-sysv"$UNAME_RELEASE" # Unknown i860-SVR4 + GUESS=i860-unknown-sysv$UNAME_RELEASE # Unknown i860-SVR4 fi - exit ;; + ;; mini*:CTIX:SYS*5:*) # "miniframe" - echo m68010-convergent-sysv - exit ;; + GUESS=m68010-convergent-sysv + ;; mc68k:UNIX:SYSTEM5:3.51m) - echo m68k-convergent-sysv - exit ;; + GUESS=m68k-convergent-sysv + ;; M680?0:D-NIX:5.3:*) - echo m68k-diab-dnix - exit ;; + GUESS=m68k-diab-dnix + ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) @@ -1234,113 +1301,116 @@ EOF /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) - echo m68k-unknown-lynxos"$UNAME_RELEASE" - exit ;; + GUESS=m68k-unknown-lynxos$UNAME_RELEASE + ;; mc68030:UNIX_System_V:4.*:*) - echo m68k-atari-sysv4 - exit ;; + GUESS=m68k-atari-sysv4 + ;; TSUNAMI:LynxOS:2.*:*) - echo sparc-unknown-lynxos"$UNAME_RELEASE" - exit ;; + GUESS=sparc-unknown-lynxos$UNAME_RELEASE + ;; rs6000:LynxOS:2.*:*) - echo rs6000-unknown-lynxos"$UNAME_RELEASE" - exit ;; + GUESS=rs6000-unknown-lynxos$UNAME_RELEASE + ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) - echo powerpc-unknown-lynxos"$UNAME_RELEASE" - exit ;; + GUESS=powerpc-unknown-lynxos$UNAME_RELEASE + ;; SM[BE]S:UNIX_SV:*:*) - echo mips-dde-sysv"$UNAME_RELEASE" - exit ;; + GUESS=mips-dde-sysv$UNAME_RELEASE + ;; RM*:ReliantUNIX-*:*:*) - echo mips-sni-sysv4 - exit ;; + GUESS=mips-sni-sysv4 + ;; RM*:SINIX-*:*:*) - echo mips-sni-sysv4 - exit ;; + GUESS=mips-sni-sysv4 + ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` - echo "$UNAME_MACHINE"-sni-sysv4 + GUESS=$UNAME_MACHINE-sni-sysv4 else - echo ns32k-sni-sysv + GUESS=ns32k-sni-sysv fi - exit ;; + ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says - echo i586-unisys-sysv4 - exit ;; + GUESS=i586-unisys-sysv4 + ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm - echo hppa1.1-stratus-sysv4 - exit ;; + GUESS=hppa1.1-stratus-sysv4 + ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. - echo i860-stratus-sysv4 - exit ;; + GUESS=i860-stratus-sysv4 + ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. - echo "$UNAME_MACHINE"-stratus-vos - exit ;; + GUESS=$UNAME_MACHINE-stratus-vos + ;; *:VOS:*:*) # From Paul.Green@stratus.com. - echo hppa1.1-stratus-vos - exit ;; + GUESS=hppa1.1-stratus-vos + ;; mc68*:A/UX:*:*) - echo m68k-apple-aux"$UNAME_RELEASE" - exit ;; + GUESS=m68k-apple-aux$UNAME_RELEASE + ;; news*:NEWS-OS:6*:*) - echo mips-sony-newsos6 - exit ;; + GUESS=mips-sony-newsos6 + ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) - if [ -d /usr/nec ]; then - echo mips-nec-sysv"$UNAME_RELEASE" + if test -d /usr/nec; then + GUESS=mips-nec-sysv$UNAME_RELEASE else - echo mips-unknown-sysv"$UNAME_RELEASE" + GUESS=mips-unknown-sysv$UNAME_RELEASE fi - exit ;; + ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. - echo powerpc-be-beos - exit ;; + GUESS=powerpc-be-beos + ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. - echo powerpc-apple-beos - exit ;; + GUESS=powerpc-apple-beos + ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. - echo i586-pc-beos - exit ;; + GUESS=i586-pc-beos + ;; BePC:Haiku:*:*) # Haiku running on Intel PC compatible. - echo i586-pc-haiku - exit ;; + GUESS=i586-pc-haiku + ;; x86_64:Haiku:*:*) - echo x86_64-unknown-haiku - exit ;; + GUESS=x86_64-unknown-haiku + ;; SX-4:SUPER-UX:*:*) - echo sx4-nec-superux"$UNAME_RELEASE" - exit ;; + GUESS=sx4-nec-superux$UNAME_RELEASE + ;; SX-5:SUPER-UX:*:*) - echo sx5-nec-superux"$UNAME_RELEASE" - exit ;; + GUESS=sx5-nec-superux$UNAME_RELEASE + ;; SX-6:SUPER-UX:*:*) - echo sx6-nec-superux"$UNAME_RELEASE" - exit ;; + GUESS=sx6-nec-superux$UNAME_RELEASE + ;; SX-7:SUPER-UX:*:*) - echo sx7-nec-superux"$UNAME_RELEASE" - exit ;; + GUESS=sx7-nec-superux$UNAME_RELEASE + ;; SX-8:SUPER-UX:*:*) - echo sx8-nec-superux"$UNAME_RELEASE" - exit ;; + GUESS=sx8-nec-superux$UNAME_RELEASE + ;; SX-8R:SUPER-UX:*:*) - echo sx8r-nec-superux"$UNAME_RELEASE" - exit ;; + GUESS=sx8r-nec-superux$UNAME_RELEASE + ;; SX-ACE:SUPER-UX:*:*) - echo sxace-nec-superux"$UNAME_RELEASE" - exit ;; + GUESS=sxace-nec-superux$UNAME_RELEASE + ;; Power*:Rhapsody:*:*) - echo powerpc-apple-rhapsody"$UNAME_RELEASE" - exit ;; + GUESS=powerpc-apple-rhapsody$UNAME_RELEASE + ;; *:Rhapsody:*:*) - echo "$UNAME_MACHINE"-apple-rhapsody"$UNAME_RELEASE" - exit ;; + GUESS=$UNAME_MACHINE-apple-rhapsody$UNAME_RELEASE + ;; + arm64:Darwin:*:*) + GUESS=aarch64-apple-darwin$UNAME_RELEASE + ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` case $UNAME_PROCESSOR in @@ -1355,7 +1425,7 @@ EOF else set_cc_for_build fi - if [ "$CC_FOR_BUILD" != no_compiler_found ]; then + if test "$CC_FOR_BUILD" != no_compiler_found; then if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null @@ -1376,109 +1446,119 @@ EOF # uname -m returns i386 or x86_64 UNAME_PROCESSOR=$UNAME_MACHINE fi - echo "$UNAME_PROCESSOR"-apple-darwin"$UNAME_RELEASE" - exit ;; + GUESS=$UNAME_PROCESSOR-apple-darwin$UNAME_RELEASE + ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = x86; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi - echo "$UNAME_PROCESSOR"-"$UNAME_MACHINE"-nto-qnx"$UNAME_RELEASE" - exit ;; + GUESS=$UNAME_PROCESSOR-$UNAME_MACHINE-nto-qnx$UNAME_RELEASE + ;; *:QNX:*:4*) - echo i386-pc-qnx - exit ;; + GUESS=i386-pc-qnx + ;; NEO-*:NONSTOP_KERNEL:*:*) - echo neo-tandem-nsk"$UNAME_RELEASE" - exit ;; + GUESS=neo-tandem-nsk$UNAME_RELEASE + ;; NSE-*:NONSTOP_KERNEL:*:*) - echo nse-tandem-nsk"$UNAME_RELEASE" - exit ;; + GUESS=nse-tandem-nsk$UNAME_RELEASE + ;; NSR-*:NONSTOP_KERNEL:*:*) - echo nsr-tandem-nsk"$UNAME_RELEASE" - exit ;; + GUESS=nsr-tandem-nsk$UNAME_RELEASE + ;; NSV-*:NONSTOP_KERNEL:*:*) - echo nsv-tandem-nsk"$UNAME_RELEASE" - exit ;; + GUESS=nsv-tandem-nsk$UNAME_RELEASE + ;; NSX-*:NONSTOP_KERNEL:*:*) - echo nsx-tandem-nsk"$UNAME_RELEASE" - exit ;; + GUESS=nsx-tandem-nsk$UNAME_RELEASE + ;; *:NonStop-UX:*:*) - echo mips-compaq-nonstopux - exit ;; + GUESS=mips-compaq-nonstopux + ;; BS2000:POSIX*:*:*) - echo bs2000-siemens-sysv - exit ;; + GUESS=bs2000-siemens-sysv + ;; DS/*:UNIX_System_V:*:*) - echo "$UNAME_MACHINE"-"$UNAME_SYSTEM"-"$UNAME_RELEASE" - exit ;; + GUESS=$UNAME_MACHINE-$UNAME_SYSTEM-$UNAME_RELEASE + ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. - # shellcheck disable=SC2154 - if test "$cputype" = 386; then + if test "${cputype-}" = 386; then UNAME_MACHINE=i386 - else - UNAME_MACHINE="$cputype" + elif test "x${cputype-}" != x; then + UNAME_MACHINE=$cputype fi - echo "$UNAME_MACHINE"-unknown-plan9 - exit ;; + GUESS=$UNAME_MACHINE-unknown-plan9 + ;; *:TOPS-10:*:*) - echo pdp10-unknown-tops10 - exit ;; + GUESS=pdp10-unknown-tops10 + ;; *:TENEX:*:*) - echo pdp10-unknown-tenex - exit ;; + GUESS=pdp10-unknown-tenex + ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) - echo pdp10-dec-tops20 - exit ;; + GUESS=pdp10-dec-tops20 + ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) - echo pdp10-xkl-tops20 - exit ;; + GUESS=pdp10-xkl-tops20 + ;; *:TOPS-20:*:*) - echo pdp10-unknown-tops20 - exit ;; + GUESS=pdp10-unknown-tops20 + ;; *:ITS:*:*) - echo pdp10-unknown-its - exit ;; + GUESS=pdp10-unknown-its + ;; SEI:*:*:SEIUX) - echo mips-sei-seiux"$UNAME_RELEASE" - exit ;; + GUESS=mips-sei-seiux$UNAME_RELEASE + ;; *:DragonFly:*:*) - echo "$UNAME_MACHINE"-unknown-dragonfly"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`" - exit ;; + DRAGONFLY_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` + GUESS=$UNAME_MACHINE-unknown-dragonfly$DRAGONFLY_REL + ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` - case "$UNAME_MACHINE" in - A*) echo alpha-dec-vms ; exit ;; - I*) echo ia64-dec-vms ; exit ;; - V*) echo vax-dec-vms ; exit ;; + case $UNAME_MACHINE in + A*) GUESS=alpha-dec-vms ;; + I*) GUESS=ia64-dec-vms ;; + V*) GUESS=vax-dec-vms ;; esac ;; *:XENIX:*:SysV) - echo i386-pc-xenix - exit ;; + GUESS=i386-pc-xenix + ;; i*86:skyos:*:*) - echo "$UNAME_MACHINE"-pc-skyos"`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'`" - exit ;; + SKYOS_REL=`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'` + GUESS=$UNAME_MACHINE-pc-skyos$SKYOS_REL + ;; i*86:rdos:*:*) - echo "$UNAME_MACHINE"-pc-rdos - exit ;; - i*86:AROS:*:*) - echo "$UNAME_MACHINE"-pc-aros - exit ;; + GUESS=$UNAME_MACHINE-pc-rdos + ;; + i*86:Fiwix:*:*) + GUESS=$UNAME_MACHINE-pc-fiwix + ;; + *:AROS:*:*) + GUESS=$UNAME_MACHINE-unknown-aros + ;; x86_64:VMkernel:*:*) - echo "$UNAME_MACHINE"-unknown-esx - exit ;; + GUESS=$UNAME_MACHINE-unknown-esx + ;; amd64:Isilon\ OneFS:*:*) - echo x86_64-unknown-onefs - exit ;; + GUESS=x86_64-unknown-onefs + ;; *:Unleashed:*:*) - echo "$UNAME_MACHINE"-unknown-unleashed"$UNAME_RELEASE" - exit ;; + GUESS=$UNAME_MACHINE-unknown-unleashed$UNAME_RELEASE + ;; esac +# Do we have a guess based on uname results? +if test "x$GUESS" != x; then + echo "$GUESS" + exit +fi + # No uname command or uname output not recognized. set_cc_for_build cat > "$dummy.c" </dev/null && SYSTEM_NAME=`$dummy` && +$CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null && SYSTEM_NAME=`"$dummy"` && { echo "$SYSTEM_NAME"; exit; } # Apollos put the system type in the environment. @@ -1618,7 +1698,7 @@ test -d /usr/apollo && { echo "$ISP-apollo-$SYSTYPE"; exit; } echo "$0: unable to guess system type" >&2 -case "$UNAME_MACHINE:$UNAME_SYSTEM" in +case $UNAME_MACHINE:$UNAME_SYSTEM in mips:Linux | mips64:Linux) # If we got here on MIPS GNU/Linux, output extra information. cat >&2 <&2 <&2 - exit 1 + # No normalization, but not necessarily accepted, that comes below. ;; esac + else # Here we handle the default operating systems that come with various machines. @@ -1549,6 +1548,7 @@ else # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. +kernel= case $cpu-$vendor in score-*) os=elf @@ -1560,7 +1560,8 @@ case $cpu-$vendor in os=riscix1.2 ;; arm*-rebel) - os=linux + kernel=linux + os=gnu ;; arm*-semi) os=aout @@ -1726,84 +1727,180 @@ case $cpu-$vendor in os=none ;; esac + fi +# Now, validate our (potentially fixed-up) OS. +case $os in + # Sometimes we do "kernel-libc", so those need to count as OSes. + musl* | newlib* | relibc* | uclibc*) + ;; + # Likewise for "kernel-abi" + eabi* | gnueabi*) + ;; + # VxWorks passes extra cpu info in the 4th filed. + simlinux | simwindows | spe) + ;; + # Now accept the basic system types. + # The portable systems comes first. + # Each alternative MUST end in a * to match a version number. + gnu* | android* | bsd* | mach* | minix* | genix* | ultrix* | irix* \ + | *vms* | esix* | aix* | cnk* | sunos | sunos[34]* \ + | hpux* | unos* | osf* | luna* | dgux* | auroraux* | solaris* \ + | sym* | plan9* | psp* | sim* | xray* | os68k* | v88r* \ + | hiux* | abug | nacl* | netware* | windows* \ + | os9* | macos* | osx* | ios* \ + | mpw* | magic* | mmixware* | mon960* | lnews* \ + | amigaos* | amigados* | msdos* | newsos* | unicos* | aof* \ + | aos* | aros* | cloudabi* | sortix* | twizzler* \ + | nindy* | vxsim* | vxworks* | ebmon* | hms* | mvs* \ + | clix* | riscos* | uniplus* | iris* | isc* | rtu* | xenix* \ + | mirbsd* | netbsd* | dicos* | openedition* | ose* \ + | bitrig* | openbsd* | secbsd* | solidbsd* | libertybsd* | os108* \ + | ekkobsd* | freebsd* | riscix* | lynxos* | os400* \ + | bosx* | nextstep* | cxux* | aout* | elf* | oabi* \ + | ptx* | coff* | ecoff* | winnt* | domain* | vsta* \ + | udi* | lites* | ieee* | go32* | aux* | hcos* \ + | chorusrdb* | cegcc* | glidix* | serenity* \ + | cygwin* | msys* | pe* | moss* | proelf* | rtems* \ + | midipix* | mingw32* | mingw64* | mint* \ + | uxpv* | beos* | mpeix* | udk* | moxiebox* \ + | interix* | uwin* | mks* | rhapsody* | darwin* \ + | openstep* | oskit* | conix* | pw32* | nonstopux* \ + | storm-chaos* | tops10* | tenex* | tops20* | its* | irx* \ + | os2* | vos* | palmos* | uclinux* | nucleus* | morphos* \ + | scout* | superux* | sysv* | rtmk* | tpf* | windiss* \ + | powermax* | dnix* | nx6 | nx7 | sei* | dragonfly* \ + | skyos* | haiku* | rdos* | toppers* | drops* | es* \ + | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \ + | midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \ + | nsk* | powerunix* | genode* | zvmoe* | qnx* | emx* | zephyr* \ + | fiwix* ) + ;; + # This one is extra strict with allowed versions + sco3.2v2 | sco3.2v[4-9]* | sco5v6*) + # Don't forget version if it is 3.2v4 or newer. + ;; + none) + ;; + *) + echo Invalid configuration \`"$1"\': OS \`"$os"\' not recognized 1>&2 + exit 1 + ;; +esac + +# As a final step for OS-related things, validate the OS-kernel combination +# (given a valid OS), if there is a kernel. +case $kernel-$os in + linux-gnu* | linux-dietlibc* | linux-android* | linux-newlib* \ + | linux-musl* | linux-relibc* | linux-uclibc* ) + ;; + uclinux-uclibc* ) + ;; + -dietlibc* | -newlib* | -musl* | -relibc* | -uclibc* ) + # These are just libc implementations, not actual OSes, and thus + # require a kernel. + echo "Invalid configuration \`$1': libc \`$os' needs explicit kernel." 1>&2 + exit 1 + ;; + kfreebsd*-gnu* | kopensolaris*-gnu*) + ;; + vxworks-simlinux | vxworks-simwindows | vxworks-spe) + ;; + nto-qnx*) + ;; + os2-emx) + ;; + *-eabi* | *-gnueabi*) + ;; + -*) + # Blank kernel with real OS is always fine. + ;; + *-*) + echo "Invalid configuration \`$1': Kernel \`$kernel' not known to work with OS \`$os'." 1>&2 + exit 1 + ;; +esac + # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. case $vendor in unknown) - case $os in - riscix*) + case $cpu-$os in + *-riscix*) vendor=acorn ;; - sunos*) + *-sunos*) vendor=sun ;; - cnk*|-aix*) + *-cnk* | *-aix*) vendor=ibm ;; - beos*) + *-beos*) vendor=be ;; - hpux*) + *-hpux*) vendor=hp ;; - mpeix*) + *-mpeix*) vendor=hp ;; - hiux*) + *-hiux*) vendor=hitachi ;; - unos*) + *-unos*) vendor=crds ;; - dgux*) + *-dgux*) vendor=dg ;; - luna*) + *-luna*) vendor=omron ;; - genix*) + *-genix*) vendor=ns ;; - clix*) + *-clix*) vendor=intergraph ;; - mvs* | opened*) + *-mvs* | *-opened*) + vendor=ibm + ;; + *-os400*) vendor=ibm ;; - os400*) + s390-* | s390x-*) vendor=ibm ;; - ptx*) + *-ptx*) vendor=sequent ;; - tpf*) + *-tpf*) vendor=ibm ;; - vxsim* | vxworks* | windiss*) + *-vxsim* | *-vxworks* | *-windiss*) vendor=wrs ;; - aux*) + *-aux*) vendor=apple ;; - hms*) + *-hms*) vendor=hitachi ;; - mpw* | macos*) + *-mpw* | *-macos*) vendor=apple ;; - *mint | mint[0-9]* | *MiNT | MiNT[0-9]*) + *-*mint | *-mint[0-9]* | *-*MiNT | *-MiNT[0-9]*) vendor=atari ;; - vos*) + *-vos*) vendor=stratus ;; esac ;; esac -echo "$cpu-$vendor-$os" +echo "$cpu-$vendor-${kernel:+$kernel-}$os" exit # Local variables: diff --git a/3rdparty/expat/conftools/depcomp b/3rdparty/expat/conftools/depcomp index 6b391623c4bf0..715e34311ed2d 100755 --- a/3rdparty/expat/conftools/depcomp +++ b/3rdparty/expat/conftools/depcomp @@ -3,7 +3,7 @@ scriptversion=2018-03-07.03; # UTC -# Copyright (C) 1999-2020 Free Software Foundation, Inc. +# Copyright (C) 1999-2021 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/3rdparty/expat/conftools/get-version.sh b/3rdparty/expat/conftools/get-version.sh index 2592f10328893..273ed3a3154e0 100755 --- a/3rdparty/expat/conftools/get-version.sh +++ b/3rdparty/expat/conftools/get-version.sh @@ -1,13 +1,39 @@ #!/bin/sh -# # USAGE: get-version.sh path/to/expat.h # # This script will print Expat's version number on stdout. For example: # # $ ./conftools/get-version.sh ./lib/expat.h # 1.95.3 -# $ +# __ __ _ +# ___\ \/ /_ __ __ _| |_ +# / _ \\ /| '_ \ / _` | __| +# | __// \| |_) | (_| | |_ +# \___/_/\_\ .__/ \__,_|\__| +# |_| XML parser +# +# Copyright (c) 2002 Greg Stein +# Copyright (c) 2017 Kerin Millar +# Licensed under the MIT license: +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to permit +# persons to whom the Software is furnished to do so, subject to the +# following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. # +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +# NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +# OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +# USE OR OTHER DEALINGS IN THE SOFTWARE. if test $# = 0; then echo "ERROR: pathname for expat.h was not provided." diff --git a/3rdparty/expat/conftools/install-sh b/3rdparty/expat/conftools/install-sh index 20d8b2eaea9c7..ec298b5374027 100755 --- a/3rdparty/expat/conftools/install-sh +++ b/3rdparty/expat/conftools/install-sh @@ -1,7 +1,7 @@ #!/bin/sh # install - install a program, script, or datafile -scriptversion=2018-03-11.20; # UTC +scriptversion=2020-11-14.01; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the @@ -69,6 +69,11 @@ posix_mkdir= # Desired mode of installed file. mode=0755 +# Create dirs (including intermediate dirs) using mode 755. +# This is like GNU 'install' as of coreutils 8.32 (2020). +mkdir_umask=22 + +backupsuffix= chgrpcmd= chmodcmd=$chmodprog chowncmd= @@ -99,18 +104,28 @@ Options: --version display version info and exit. -c (ignored) - -C install only if different (preserve the last data modification time) + -C install only if different (preserve data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. + -p pass -p to $cpprog. -s $stripprog installed files. + -S SUFFIX attempt to back up existing files, with suffix SUFFIX. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG + +By default, rm is invoked with -f; when overridden with RMPROG, +it's up to you to specify -f if you want it. + +If -S is not specified, no backups are attempted. + +Email bug reports to bug-automake@gnu.org. +Automake home page: https://www.gnu.org/software/automake/ " while test $# -ne 0; do @@ -137,8 +152,13 @@ while test $# -ne 0; do -o) chowncmd="$chownprog $2" shift;; + -p) cpprog="$cpprog -p";; + -s) stripcmd=$stripprog;; + -S) backupsuffix="$2" + shift;; + -t) is_target_a_directory=always dst_arg=$2 @@ -255,6 +275,10 @@ do dstdir=$dst test -d "$dstdir" dstdir_status=$? + # Don't chown directories that already exist. + if test $dstdir_status = 0; then + chowncmd="" + fi else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command @@ -301,22 +325,6 @@ do if test $dstdir_status != 0; then case $posix_mkdir in '') - # Create intermediate dirs using mode 755 as modified by the umask. - # This is like FreeBSD 'install' as of 1997-10-28. - umask=`umask` - case $stripcmd.$umask in - # Optimize common cases. - *[2367][2367]) mkdir_umask=$umask;; - .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; - - *[0-7]) - mkdir_umask=`expr $umask + 22 \ - - $umask % 100 % 40 + $umask % 20 \ - - $umask % 10 % 4 + $umask % 2 - `;; - *) mkdir_umask=$umask,go-w;; - esac - # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then @@ -326,52 +334,49 @@ do fi posix_mkdir=false - case $umask in - *[123567][0-7][0-7]) - # POSIX mkdir -p sets u+wx bits regardless of umask, which - # is incompatible with FreeBSD 'install' when (umask & 300) != 0. - ;; - *) - # Note that $RANDOM variable is not portable (e.g. dash); Use it - # here however when possible just to lower collision chance. - tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ - - trap 'ret=$?; rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null; exit $ret' 0 - - # Because "mkdir -p" follows existing symlinks and we likely work - # directly in world-writeable /tmp, make sure that the '$tmpdir' - # directory is successfully created first before we actually test - # 'mkdir -p' feature. - if (umask $mkdir_umask && - $mkdirprog $mkdir_mode "$tmpdir" && - exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1 - then - if test -z "$dir_arg" || { - # Check for POSIX incompatibilities with -m. - # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or - # other-writable bit of parent directory when it shouldn't. - # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. - test_tmpdir="$tmpdir/a" - ls_ld_tmpdir=`ls -ld "$test_tmpdir"` - case $ls_ld_tmpdir in - d????-?r-*) different_mode=700;; - d????-?--*) different_mode=755;; - *) false;; - esac && - $mkdirprog -m$different_mode -p -- "$test_tmpdir" && { - ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"` - test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" - } - } - then posix_mkdir=: - fi - rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" - else - # Remove any dirs left behind by ancient mkdir implementations. - rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null - fi - trap '' 0;; - esac;; + # The $RANDOM variable is not portable (e.g., dash). Use it + # here however when possible just to lower collision chance. + tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ + + trap ' + ret=$? + rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null + exit $ret + ' 0 + + # Because "mkdir -p" follows existing symlinks and we likely work + # directly in world-writeable /tmp, make sure that the '$tmpdir' + # directory is successfully created first before we actually test + # 'mkdir -p'. + if (umask $mkdir_umask && + $mkdirprog $mkdir_mode "$tmpdir" && + exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1 + then + if test -z "$dir_arg" || { + # Check for POSIX incompatibilities with -m. + # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or + # other-writable bit of parent directory when it shouldn't. + # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. + test_tmpdir="$tmpdir/a" + ls_ld_tmpdir=`ls -ld "$test_tmpdir"` + case $ls_ld_tmpdir in + d????-?r-*) different_mode=700;; + d????-?--*) different_mode=755;; + *) false;; + esac && + $mkdirprog -m$different_mode -p -- "$test_tmpdir" && { + ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"` + test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" + } + } + then posix_mkdir=: + fi + rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" + else + # Remove any dirs left behind by ancient mkdir implementations. + rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null + fi + trap '' 0;; esac if @@ -382,7 +387,7 @@ do then : else - # The umask is ridiculous, or mkdir does not conform to POSIX, + # mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. @@ -411,7 +416,7 @@ do prefixes= else if $posix_mkdir; then - (umask=$mkdir_umask && + (umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 @@ -488,6 +493,13 @@ do then rm -f "$dsttmp" else + # If $backupsuffix is set, and the file being installed + # already exists, attempt a backup. Don't worry if it fails, + # e.g., if mv doesn't support -f. + if test -n "$backupsuffix" && test -f "$dst"; then + $doit $mvcmd -f "$dst" "$dst$backupsuffix" 2>/dev/null + fi + # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || @@ -502,9 +514,9 @@ do # file should still install successfully. { test ! -f "$dst" || - $doit $rmcmd -f "$dst" 2>/dev/null || + $doit $rmcmd "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && - { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } + { $doit $rmcmd "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 diff --git a/3rdparty/expat/conftools/ltmain.sh b/3rdparty/expat/conftools/ltmain.sh old mode 100644 new mode 100755 index e774ddfe649ed..ff225947570d4 --- a/3rdparty/expat/conftools/ltmain.sh +++ b/3rdparty/expat/conftools/ltmain.sh @@ -1,12 +1,12 @@ -#! /bin/sh +#! /usr/bin/env sh ## DO NOT EDIT - This file generated from ./build-aux/ltmain.in -## by inline-source v2014-01-03.01 +## by inline-source v2019-02-19.15 -# libtool (GNU libtool) 2.4.6 +# libtool (GNU libtool) 2.5.3 # Provide generalized library-building support services. # Written by Gordon Matzigkeit , 1996 -# Copyright (C) 1996-2015 Free Software Foundation, Inc. +# Copyright (C) 1996-2019, 2021-2024 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. @@ -31,8 +31,8 @@ PROGRAM=libtool PACKAGE=libtool -VERSION=2.4.6 -package_revision=2.4.6 +VERSION=2.5.3 +package_revision=2.5.3 ## ------ ## @@ -64,34 +64,25 @@ package_revision=2.4.6 # libraries, which are installed to $pkgauxdir. # Set a version string for this script. -scriptversion=2015-10-04.22; # UTC +scriptversion=2019-02-19.15; # UTC # General shell script boiler plate, and helper functions. # Written by Gary V. Vaughan, 2004 -# Copyright (C) 2004-2015 Free Software Foundation, Inc. -# This is free software; see the source for copying conditions. There is NO -# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or -# (at your option) any later version. - -# As a special exception to the GNU General Public License, if you distribute -# this file as part of a program or library that is built using GNU Libtool, -# you may include this file under the same distribution terms that you use -# for the rest of that program. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNES FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . +# This is free software. There is NO warranty; not even for +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# +# Copyright (C) 2004-2019, 2021, 2023-2024 Bootstrap Authors +# +# This file is dual licensed under the terms of the MIT license +# , and GPL version 2 or later +# . You must apply one of +# these licenses when using or redistributing this software or any of +# the files within it. See the URLs above, or the file `LICENSE` +# included in the Bootstrap distribution for the full license texts. -# Please report bugs or propose patches to gary@gnu.org. +# Please report bugs or propose patches to: +# ## ------ ## @@ -139,9 +130,12 @@ do _G_safe_locale=\"$_G_var=C; \$_G_safe_locale\" fi" done - -# CDPATH. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH +# These NLS vars are set unconditionally (bootstrap issue #24). Unset those +# in case the environment reset is needed later and the $save_* variant is not +# defined (see the code above). +LC_ALL=C +LANGUAGE=C +export LANGUAGE LC_ALL # Make sure IFS has a sensible default sp=' ' @@ -149,7 +143,7 @@ nl=' ' IFS="$sp $nl" -# There are apparently some retarded systems that use ';' as a PATH separator! +# There are apparently some systems that use ';' as a PATH separator! if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { @@ -159,6 +153,26 @@ if test "${PATH_SEPARATOR+set}" != set; then fi +# func_unset VAR +# -------------- +# Portably unset VAR. +# In some shells, an 'unset VAR' statement leaves a non-zero return +# status if VAR is already unset, which might be problematic if the +# statement is used at the end of a function (thus poisoning its return +# value) or when 'set -e' is active (causing even a spurious abort of +# the script in this case). +func_unset () +{ + { eval $1=; (eval unset $1) >/dev/null 2>&1 && eval unset $1 || : ; } +} + + +# Make sure CDPATH doesn't cause `cd` commands to output the target dir. +func_unset CDPATH + +# Make sure ${,E,F}GREP behave sanely. +func_unset GREP_OPTIONS + ## ------------------------- ## ## Locate command utilities. ## @@ -259,7 +273,7 @@ test -z "$SED" && { rm -f conftest.in conftest.tmp conftest.nl conftest.out } - func_path_progs "sed gsed" func_check_prog_sed $PATH:/usr/xpg4/bin + func_path_progs "sed gsed" func_check_prog_sed "$PATH:/usr/xpg4/bin" rm -f conftest.sed SED=$func_path_progs_result } @@ -295,7 +309,7 @@ test -z "$GREP" && { rm -f conftest.in conftest.tmp conftest.nl conftest.out } - func_path_progs "grep ggrep" func_check_prog_grep $PATH:/usr/xpg4/bin + func_path_progs "grep ggrep" func_check_prog_grep "$PATH:/usr/xpg4/bin" GREP=$func_path_progs_result } @@ -360,6 +374,35 @@ sed_double_backslash="\ s/\\([^$_G_bs]\\)$_G_bs2$_G_dollar/\\1$_G_bs2$_G_bs$_G_dollar/g s/\n//g" +# require_check_ifs_backslash +# --------------------------- +# Check if we can use backslash as IFS='\' separator, and set +# $check_ifs_backshlash_broken to ':' or 'false'. +require_check_ifs_backslash=func_require_check_ifs_backslash +func_require_check_ifs_backslash () +{ + _G_save_IFS=$IFS + IFS='\' + _G_check_ifs_backshlash='a\\b' + for _G_i in $_G_check_ifs_backshlash + do + case $_G_i in + a) + check_ifs_backshlash_broken=false + ;; + '') + break + ;; + *) + check_ifs_backshlash_broken=: + break + ;; + esac + done + IFS=$_G_save_IFS + require_check_ifs_backslash=: +} + ## ----------------- ## ## Global variables. ## @@ -580,16 +623,16 @@ if test yes = "$_G_HAVE_PLUSEQ_OP"; then { $debug_cmd - func_quote_for_eval "$2" - eval "$1+=\\ \$func_quote_for_eval_result" + func_quote_arg pretty "$2" + eval "$1+=\\ \$func_quote_arg_result" }' else func_append_quoted () { $debug_cmd - func_quote_for_eval "$2" - eval "$1=\$$1\\ \$func_quote_for_eval_result" + func_quote_arg pretty "$2" + eval "$1=\$$1\\ \$func_quote_arg_result" } fi @@ -1091,132 +1134,203 @@ func_relative_path () } -# func_quote ARG -# -------------- -# Aesthetically quote one ARG, store the result into $func_quote_result. Note -# that we keep attention to performance here (so far O(N) complexity as long as -# func_append is O(1)). -func_quote () +# func_quote_portable EVAL ARG +# ---------------------------- +# Internal function to portably implement func_quote_arg. Note that we still +# keep attention to performance here so we as much as possible try to avoid +# calling sed binary (so far O(N) complexity as long as func_append is O(1)). +func_quote_portable () { $debug_cmd - func_quote_result=$1 + $require_check_ifs_backslash - case $func_quote_result in - *[\\\`\"\$]*) - case $func_quote_result in - *[\[\*\?]*) - func_quote_result=`$ECHO "$func_quote_result" | $SED "$sed_quote_subst"` - return 0 - ;; - esac + func_quote_portable_result=$2 - func_quote_old_IFS=$IFS - for _G_char in '\' '`' '"' '$' - do - # STATE($1) PREV($2) SEPARATOR($3) - set start "" "" - func_quote_result=dummy"$_G_char$func_quote_result$_G_char"dummy - IFS=$_G_char - for _G_part in $func_quote_result - do - case $1 in - quote) - func_append func_quote_result "$3$2" - set quote "$_G_part" "\\$_G_char" - ;; - start) - set first "" "" - func_quote_result= - ;; - first) - set quote "$_G_part" "" + # one-time-loop (easy break) + while true + do + if $1; then + func_quote_portable_result=`$ECHO "$2" | $SED \ + -e "$sed_double_quote_subst" -e "$sed_double_backslash"` + break + fi + + # Quote for eval. + case $func_quote_portable_result in + *[\\\`\"\$]*) + # Fallback to sed for $func_check_bs_ifs_broken=:, or when the string + # contains the shell wildcard characters. + case $check_ifs_backshlash_broken$func_quote_portable_result in + :*|*[\[\*\?]*) + func_quote_portable_result=`$ECHO "$func_quote_portable_result" \ + | $SED "$sed_quote_subst"` + break ;; - esac + esac + + func_quote_portable_old_IFS=$IFS + for _G_char in '\' '`' '"' '$' + do + # STATE($1) PREV($2) SEPARATOR($3) + set start "" "" + func_quote_portable_result=dummy"$_G_char$func_quote_portable_result$_G_char"dummy + IFS=$_G_char + for _G_part in $func_quote_portable_result + do + case $1 in + quote) + func_append func_quote_portable_result "$3$2" + set quote "$_G_part" "\\$_G_char" + ;; + start) + set first "" "" + func_quote_portable_result= + ;; + first) + set quote "$_G_part" "" + ;; + esac + done done - IFS=$func_quote_old_IFS - done + IFS=$func_quote_portable_old_IFS + ;; + *) ;; + esac + break + done + + func_quote_portable_unquoted_result=$func_quote_portable_result + case $func_quote_portable_result in + # double-quote args containing shell metacharacters to delay + # word splitting, command substitution and variable expansion + # for a subsequent eval. + # many bourne shells cannot handle close brackets correctly + # in scan sets, so we specify it separately. + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + func_quote_portable_result=\"$func_quote_portable_result\" ;; - *) ;; esac } -# func_quote_for_eval ARG... -# -------------------------- -# Aesthetically quote ARGs to be evaled later. -# This function returns two values: -# i) func_quote_for_eval_result -# double-quoted, suitable for a subsequent eval -# ii) func_quote_for_eval_unquoted_result -# has all characters that are still active within double -# quotes backslashified. -func_quote_for_eval () -{ - $debug_cmd - - func_quote_for_eval_unquoted_result= - func_quote_for_eval_result= - while test 0 -lt $#; do - func_quote "$1" - _G_unquoted_arg=$func_quote_result - if test -n "$func_quote_for_eval_unquoted_result"; then - func_append func_quote_for_eval_unquoted_result " $_G_unquoted_arg" - else - func_append func_quote_for_eval_unquoted_result "$_G_unquoted_arg" - fi - - case $_G_unquoted_arg in - # Double-quote args containing shell metacharacters to delay - # word splitting, command substitution and variable expansion - # for a subsequent eval. - # Many Bourne shells cannot handle close brackets correctly - # in scan sets, so we specify it separately. - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - _G_quoted_arg=\"$_G_unquoted_arg\" +# func_quotefast_eval ARG +# ----------------------- +# Quote one ARG (internal). This is equivalent to 'func_quote_arg eval ARG', +# but optimized for speed. Result is stored in $func_quotefast_eval. +if test xyes = `(x=; printf -v x %q yes; echo x"$x") 2>/dev/null`; then + printf -v _GL_test_printf_tilde %q '~' + if test '\~' = "$_GL_test_printf_tilde"; then + func_quotefast_eval () + { + printf -v func_quotefast_eval_result %q "$1" + } + else + # Broken older Bash implementations. Make those faster too if possible. + func_quotefast_eval () + { + case $1 in + '~'*) + func_quote_portable false "$1" + func_quotefast_eval_result=$func_quote_portable_result ;; *) - _G_quoted_arg=$_G_unquoted_arg - ;; + printf -v func_quotefast_eval_result %q "$1" + ;; esac + } + fi +else + func_quotefast_eval () + { + func_quote_portable false "$1" + func_quotefast_eval_result=$func_quote_portable_result + } +fi - if test -n "$func_quote_for_eval_result"; then - func_append func_quote_for_eval_result " $_G_quoted_arg" - else - func_append func_quote_for_eval_result "$_G_quoted_arg" - fi - shift - done -} - - -# func_quote_for_expand ARG -# ------------------------- -# Aesthetically quote ARG to be evaled later; same as above, -# but do not quote variable references. -func_quote_for_expand () -{ - $debug_cmd - case $1 in - *[\\\`\"]*) - _G_arg=`$ECHO "$1" | $SED \ - -e "$sed_double_quote_subst" -e "$sed_double_backslash"` ;; - *) - _G_arg=$1 ;; +# func_quote_arg MODEs ARG +# ------------------------ +# Quote one ARG to be evaled later. MODEs argument may contain zero or more +# specifiers listed below separated by ',' character. This function returns two +# values: +# i) func_quote_arg_result +# double-quoted (when needed), suitable for a subsequent eval +# ii) func_quote_arg_unquoted_result +# has all characters that are still active within double +# quotes backslashified. Available only if 'unquoted' is specified. +# +# Available modes: +# ---------------- +# 'eval' (default) +# - escape shell special characters +# 'expand' +# - the same as 'eval'; but do not quote variable references +# 'pretty' +# - request aesthetic output, i.e. '"a b"' instead of 'a\ b'. This might +# be used later in func_quote to get output like: 'echo "a b"' instead +# of 'echo a\ b'. This is slower than default on some shells. +# 'unquoted' +# - produce also $func_quote_arg_unquoted_result which does not contain +# wrapping double-quotes. +# +# Examples for 'func_quote_arg pretty,unquoted string': +# +# string | *_result | *_unquoted_result +# ------------+-----------------------+------------------- +# " | \" | \" +# a b | "a b" | a b +# "a b" | "\"a b\"" | \"a b\" +# * | "*" | * +# z="${x-$y}" | "z=\"\${x-\$y}\"" | z=\"\${x-\$y}\" +# +# Examples for 'func_quote_arg pretty,unquoted,expand string': +# +# string | *_result | *_unquoted_result +# --------------+---------------------+-------------------- +# z="${x-$y}" | "z=\"${x-$y}\"" | z=\"${x-$y}\" +func_quote_arg () +{ + _G_quote_expand=false + case ,$1, in + *,expand,*) + _G_quote_expand=: + ;; esac - case $_G_arg in - # Double-quote args containing shell metacharacters to delay - # word splitting and command substitution for a subsequent eval. - # Many Bourne shells cannot handle close brackets correctly - # in scan sets, so we specify it separately. - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - _G_arg=\"$_G_arg\" + case ,$1, in + *,pretty,*|*,expand,*|*,unquoted,*) + func_quote_portable $_G_quote_expand "$2" + func_quote_arg_result=$func_quote_portable_result + func_quote_arg_unquoted_result=$func_quote_portable_unquoted_result + ;; + *) + # Faster quote-for-eval for some shells. + func_quotefast_eval "$2" + func_quote_arg_result=$func_quotefast_eval_result ;; esac +} + - func_quote_for_expand_result=$_G_arg +# func_quote MODEs ARGs... +# ------------------------ +# Quote all ARGs to be evaled later and join them into single command. See +# func_quote_arg's description for more info. +func_quote () +{ + $debug_cmd + _G_func_quote_mode=$1 ; shift + func_quote_result= + while test 0 -lt $#; do + func_quote_arg "$_G_func_quote_mode" "$1" + if test -n "$func_quote_result"; then + func_append func_quote_result " $func_quote_arg_result" + else + func_append func_quote_result "$func_quote_arg_result" + fi + shift + done } @@ -1262,8 +1376,8 @@ func_show_eval () _G_cmd=$1 _G_fail_exp=${2-':'} - func_quote_for_expand "$_G_cmd" - eval "func_notquiet $func_quote_for_expand_result" + func_quote_arg pretty,expand "$_G_cmd" + eval "func_notquiet $func_quote_arg_result" $opt_dry_run || { eval "$_G_cmd" @@ -1288,8 +1402,8 @@ func_show_eval_locale () _G_fail_exp=${2-':'} $opt_quiet || { - func_quote_for_expand "$_G_cmd" - eval "func_echo $func_quote_for_expand_result" + func_quote_arg expand,pretty "$_G_cmd" + eval "func_echo $func_quote_arg_result" } $opt_dry_run || { @@ -1416,30 +1530,26 @@ func_lt_ver () # End: #! /bin/sh -# Set a version string for this script. -scriptversion=2014-01-07.03; # UTC - # A portable, pluggable option parser for Bourne shell. # Written by Gary V. Vaughan, 2010 -# Copyright (C) 2010-2015 Free Software Foundation, Inc. -# This is free software; see the source for copying conditions. There is NO -# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. +# This is free software. There is NO warranty; not even for +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# +# Copyright (C) 2010-2019, 2021, 2023-2024 Bootstrap Authors +# +# This file is dual licensed under the terms of the MIT license +# , and GPL version 2 or later +# . You must apply one of +# these licenses when using or redistributing this software or any of +# the files within it. See the URLs above, or the file `LICENSE` +# included in the Bootstrap distribution for the full license texts. -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. +# Please report bugs or propose patches to: +# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -# Please report bugs or propose patches to gary@gnu.org. +# Set a version string for this script. +scriptversion=2019-02-19.15; # UTC ## ------ ## @@ -1462,7 +1572,7 @@ scriptversion=2014-01-07.03; # UTC # # In order for the '--version' option to work, you will need to have a # suitably formatted comment like the one at the top of this file -# starting with '# Written by ' and ending with '# warranty; '. +# starting with '# Written by ' and ending with '# Copyright'. # # For '-h' and '--help' to work, you will also need a one line # description of your script's purpose in a comment directly above the @@ -1474,7 +1584,7 @@ scriptversion=2014-01-07.03; # UTC # to display verbose messages only when your user has specified # '--verbose'. # -# After sourcing this file, you can plug processing for additional +# After sourcing this file, you can plug in processing for additional # options by amending the variables from the 'Configuration' section # below, and following the instructions in the 'Option parsing' # section further down. @@ -1523,8 +1633,8 @@ fatal_help="Try '\$progname --help' for more information." ## ------------------------- ## # This section contains functions for adding, removing, and running hooks -# to the main code. A hook is just a named list of of function, that can -# be run in order later on. +# in the main code. A hook is just a list of function names that can be +# run in order later on. # func_hookable FUNC_NAME # ----------------------- @@ -1557,7 +1667,8 @@ func_add_hook () # func_remove_hook FUNC_NAME HOOK_FUNC # ------------------------------------ -# Remove HOOK_FUNC from the list of functions called by FUNC_NAME. +# Remove HOOK_FUNC from the list of hook functions to be called by +# FUNC_NAME. func_remove_hook () { $debug_cmd @@ -1566,10 +1677,28 @@ func_remove_hook () } +# func_propagate_result FUNC_NAME_A FUNC_NAME_B +# --------------------------------------------- +# If the *_result variable of FUNC_NAME_A _is set_, assign its value to +# *_result variable of FUNC_NAME_B. +func_propagate_result () +{ + $debug_cmd + + func_propagate_result_result=: + if eval "test \"\${${1}_result+set}\" = set" + then + eval "${2}_result=\$${1}_result" + else + func_propagate_result_result=false + fi +} + + # func_run_hooks FUNC_NAME [ARG]... # --------------------------------- # Run all hook functions registered to FUNC_NAME. -# It is assumed that the list of hook functions contains nothing more +# It's assumed that the list of hook functions contains nothing more # than a whitespace-delimited list of legal shell function names, and # no effort is wasted trying to catch shell meta-characters or preserve # whitespace. @@ -1579,22 +1708,19 @@ func_run_hooks () case " $hookable_fns " in *" $1 "*) ;; - *) func_fatal_error "'$1' does not support hook funcions.n" ;; + *) func_fatal_error "'$1' does not support hook functions." ;; esac eval _G_hook_fns=\$$1_hooks; shift for _G_hook in $_G_hook_fns; do - eval $_G_hook '"$@"' - - # store returned options list back into positional - # parameters for next 'cmd' execution. - eval _G_hook_result=\$${_G_hook}_result - eval set dummy "$_G_hook_result"; shift + func_unset "${_G_hook}_result" + eval $_G_hook '${1+"$@"}' + func_propagate_result $_G_hook func_run_hooks + if $func_propagate_result_result; then + eval set dummy "$func_run_hooks_result"; shift + fi done - - func_quote_for_eval ${1+"$@"} - func_run_hooks_result=$func_quote_for_eval_result } @@ -1604,10 +1730,18 @@ func_run_hooks () ## --------------- ## # In order to add your own option parsing hooks, you must accept the -# full positional parameter list in your hook function, remove any -# options that you action, and then pass back the remaining unprocessed -# options in '_result', escaped suitably for -# 'eval'. Like this: +# full positional parameter list from your hook function. You may remove +# or edit any options that you action, and then pass back the remaining +# unprocessed options in '_result', escaped +# suitably for 'eval'. +# +# The '_result' variable is automatically unset +# before your hook gets called; for best performance, only set the +# *_result variable when necessary (i.e. don't call the 'func_quote' +# function unnecessarily because it can be an expensive operation on some +# machines). +# +# Like this: # # my_options_prep () # { @@ -1617,9 +1751,8 @@ func_run_hooks () # usage_message=$usage_message' # -s, --silent don'\''t print informational messages # ' -# -# func_quote_for_eval ${1+"$@"} -# my_options_prep_result=$func_quote_for_eval_result +# # No change in '$@' (ignored completely by this hook). Leave +# # my_options_prep_result variable intact. # } # func_add_hook func_options_prep my_options_prep # @@ -1628,25 +1761,36 @@ func_run_hooks () # { # $debug_cmd # -# # Note that for efficiency, we parse as many options as we can +# args_changed=false +# +# # Note that, for efficiency, we parse as many options as we can # # recognise in a loop before passing the remainder back to the # # caller on the first unrecognised argument we encounter. # while test $# -gt 0; do # opt=$1; shift # case $opt in -# --silent|-s) opt_silent=: ;; +# --silent|-s) opt_silent=: +# args_changed=: +# ;; # # Separate non-argument short options: # -s*) func_split_short_opt "$_G_opt" # set dummy "$func_split_short_opt_name" \ # "-$func_split_short_opt_arg" ${1+"$@"} # shift +# args_changed=: # ;; -# *) set dummy "$_G_opt" "$*"; shift; break ;; +# *) # Make sure the first unrecognised option "$_G_opt" +# # is added back to "$@" in case we need it later, +# # if $args_changed was set to 'true'. +# set dummy "$_G_opt" ${1+"$@"}; shift; break ;; # esac # done # -# func_quote_for_eval ${1+"$@"} -# my_silent_option_result=$func_quote_for_eval_result +# # Only call 'func_quote' here if we processed at least one argument. +# if $args_changed; then +# func_quote eval ${1+"$@"} +# my_silent_option_result=$func_quote_result +# fi # } # func_add_hook func_parse_options my_silent_option # @@ -1657,17 +1801,26 @@ func_run_hooks () # # $opt_silent && $opt_verbose && func_fatal_help "\ # '--silent' and '--verbose' options are mutually exclusive." -# -# func_quote_for_eval ${1+"$@"} -# my_option_validation_result=$func_quote_for_eval_result # } # func_add_hook func_validate_options my_option_validation # -# You'll alse need to manually amend $usage_message to reflect the extra +# You'll also need to manually amend $usage_message to reflect the extra # options you parse. It's preferable to append if you can, so that # multiple option parsing hooks can be added safely. +# func_options_finish [ARG]... +# ---------------------------- +# Finishing the option parse loop (call 'func_options' hooks ATM). +func_options_finish () +{ + $debug_cmd + + func_run_hooks func_options ${1+"$@"} + func_propagate_result func_run_hooks func_options_finish +} + + # func_options [ARG]... # --------------------- # All the functions called inside func_options are hookable. See the @@ -1677,17 +1830,27 @@ func_options () { $debug_cmd - func_options_prep ${1+"$@"} - eval func_parse_options \ - ${func_options_prep_result+"$func_options_prep_result"} - eval func_validate_options \ - ${func_parse_options_result+"$func_parse_options_result"} + _G_options_quoted=false - eval func_run_hooks func_options \ - ${func_validate_options_result+"$func_validate_options_result"} + for my_func in options_prep parse_options validate_options options_finish + do + func_unset func_${my_func}_result + func_unset func_run_hooks_result + eval func_$my_func '${1+"$@"}' + func_propagate_result func_$my_func func_options + if $func_propagate_result_result; then + eval set dummy "$func_options_result"; shift + _G_options_quoted=: + fi + done - # save modified positional parameters for caller - func_options_result=$func_run_hooks_result + $_G_options_quoted || { + # As we (func_options) are top-level options-parser function and + # nobody quoted "$@" for us yet, we need to do it explicitly for + # caller. + func_quote eval ${1+"$@"} + func_options_result=$func_quote_result + } } @@ -1696,9 +1859,8 @@ func_options () # All initialisations required before starting the option parse loop. # Note that when calling hook functions, we pass through the list of # positional parameters. If a hook function modifies that list, and -# needs to propogate that back to rest of this script, then the complete -# modified list must be put in 'func_run_hooks_result' before -# returning. +# needs to propagate that back to rest of this script, then the complete +# modified list must be put in 'func_run_hooks_result' before returning. func_hookable func_options_prep func_options_prep () { @@ -1709,9 +1871,7 @@ func_options_prep () opt_warning_types= func_run_hooks func_options_prep ${1+"$@"} - - # save modified positional parameters for caller - func_options_prep_result=$func_run_hooks_result + func_propagate_result func_run_hooks func_options_prep } @@ -1723,25 +1883,32 @@ func_parse_options () { $debug_cmd - func_parse_options_result= - + _G_parse_options_requote=false # this just eases exit handling while test $# -gt 0; do # Defer to hook functions for initial option parsing, so they # get priority in the event of reusing an option name. func_run_hooks func_parse_options ${1+"$@"} - - # Adjust func_parse_options positional parameters to match - eval set dummy "$func_run_hooks_result"; shift + func_propagate_result func_run_hooks func_parse_options + if $func_propagate_result_result; then + eval set dummy "$func_parse_options_result"; shift + # Even though we may have changed "$@", we passed the "$@" array + # down into the hook and it quoted it for us (because we are in + # this if-branch). No need to quote it again. + _G_parse_options_requote=false + fi # Break out of the loop if we already parsed every option. test $# -gt 0 || break + # We expect that one of the options parsed in this function matches + # and thus we remove _G_opt from "$@" and need to re-quote. + _G_match_parse_options=: _G_opt=$1 shift case $_G_opt in --debug|-x) debug_cmd='set -x' - func_echo "enabling shell trace mode" + func_echo "enabling shell trace mode" >&2 $debug_cmd ;; @@ -1751,7 +1918,10 @@ func_parse_options () ;; --warnings|--warning|-W) - test $# = 0 && func_missing_arg $_G_opt && break + if test $# = 0 && func_missing_arg $_G_opt; then + _G_parse_options_requote=: + break + fi case " $warning_categories $1" in *" $1 "*) # trailing space prevents matching last $1 above @@ -1804,15 +1974,24 @@ func_parse_options () shift ;; - --) break ;; + --) _G_parse_options_requote=: ; break ;; -*) func_fatal_help "unrecognised option: '$_G_opt'" ;; - *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;; + *) set dummy "$_G_opt" ${1+"$@"}; shift + _G_match_parse_options=false + break + ;; esac + + if $_G_match_parse_options; then + _G_parse_options_requote=: + fi done - # save modified positional parameters for caller - func_quote_for_eval ${1+"$@"} - func_parse_options_result=$func_quote_for_eval_result + if $_G_parse_options_requote; then + # save modified positional parameters for caller + func_quote eval ${1+"$@"} + func_parse_options_result=$func_quote_result + fi } @@ -1829,12 +2008,10 @@ func_validate_options () test -n "$opt_warning_types" || opt_warning_types=" $warning_categories" func_run_hooks func_validate_options ${1+"$@"} + func_propagate_result func_run_hooks func_validate_options # Bail if the options were screwed! $exit_cmd $EXIT_FAILURE - - # save modified positional parameters for caller - func_validate_options_result=$func_run_hooks_result } @@ -1890,8 +2067,8 @@ func_missing_arg () # func_split_equals STRING # ------------------------ -# Set func_split_equals_lhs and func_split_equals_rhs shell variables after -# splitting STRING at the '=' sign. +# Set func_split_equals_lhs and func_split_equals_rhs shell variables +# after splitting STRING at the '=' sign. test -z "$_G_HAVE_XSI_OPS" \ && (eval 'x=a/b/c; test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \ @@ -1906,8 +2083,9 @@ then func_split_equals_lhs=${1%%=*} func_split_equals_rhs=${1#*=} - test "x$func_split_equals_lhs" = "x$1" \ - && func_split_equals_rhs= + if test "x$func_split_equals_lhs" = "x$1"; then + func_split_equals_rhs= + fi }' else # ...otherwise fall back to using expr, which is often a shell builtin. @@ -1917,7 +2095,7 @@ else func_split_equals_lhs=`expr "x$1" : 'x\([^=]*\)'` func_split_equals_rhs= - test "x$func_split_equals_lhs" = "x$1" \ + test "x$func_split_equals_lhs=" = "x$1" \ || func_split_equals_rhs=`expr "x$1" : 'x[^=]*=\(.*\)$'` } fi #func_split_equals @@ -1943,7 +2121,7 @@ else { $debug_cmd - func_split_short_opt_name=`expr "x$1" : 'x-\(.\)'` + func_split_short_opt_name=`expr "x$1" : 'x\(-.\)'` func_split_short_opt_arg=`expr "x$1" : 'x-.\(.*\)$'` } fi #func_split_short_opt @@ -1985,31 +2163,44 @@ func_usage_message () # func_version # ------------ # Echo version message to standard output and exit. +# The version message is extracted from the calling file's header +# comments, with leading '# ' stripped: +# 1. First display the progname and version +# 2. Followed by the header comment line matching /^# Written by / +# 3. Then a blank line followed by the first following line matching +# /^# Copyright / +# 4. Immediately followed by any lines between the previous matches, +# except lines preceding the intervening completely blank line. +# For example, see the header comments of this file. func_version () { $debug_cmd printf '%s\n' "$progname $scriptversion" $SED -n ' - /(C)/!b go - :more - /\./!{ - N - s|\n# | | - b more - } - :go - /^# Written by /,/# warranty; / { - s|^# || - s|^# *$|| - s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2| - p + /^# Written by /!b + s|^# ||; p; n + + :fwd2blnk + /./ { + n + b fwd2blnk } - /^# Written by / { - s|^# || - p + p; n + + :holdwrnt + s|^# || + s|^# *$|| + /^Copyright /!{ + /./H + n + b holdwrnt } - /^warranty; /q' < "$progpath" + + s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2| + G + s|\(\n\)\n*|\1|g + p; q' < "$progpath" exit $? } @@ -2019,12 +2210,12 @@ func_version () # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) -# time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC" +# time-stamp-pattern: "30/scriptversion=%:y-%02m-%02d.%02H; # UTC" # time-stamp-time-zone: "UTC" # End: # Set a version string. -scriptversion='(GNU libtool) 2.4.6' +scriptversion='(GNU libtool) 2.5.3' # func_echo ARG... @@ -2115,13 +2306,13 @@ include the following information: compiler: $LTCC compiler flags: $LTCFLAGS linker: $LD (gnu? $with_gnu_ld) - version: $progname (GNU libtool) 2.4.6 + version: $progname (GNU libtool) 2.5.3 automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q` autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q` Report bugs to . -GNU libtool home page: . -General help using GNU software: ." +GNU libtool home page: . +General help using GNU software: ." exit 0 } @@ -2171,7 +2362,7 @@ fi # a configuration failure hint, and exit. func_fatal_configuration () { - func__fatal_error ${1+"$@"} \ + func_fatal_error ${1+"$@"} \ "See the $PACKAGE documentation for more information." \ "Fatal configuration error." } @@ -2317,6 +2508,8 @@ libtool_options_prep () nonopt= preserve_args= + _G_rc_lt_options_prep=: + # Shorthand for --mode=foo, only valid as the first argument case $1 in clean|clea|cle|cl) @@ -2340,11 +2533,16 @@ libtool_options_prep () uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) shift; set dummy --mode uninstall ${1+"$@"}; shift ;; + *) + _G_rc_lt_options_prep=false + ;; esac - # Pass back the list of options. - func_quote_for_eval ${1+"$@"} - libtool_options_prep_result=$func_quote_for_eval_result + if $_G_rc_lt_options_prep; then + # Pass back the list of options. + func_quote eval ${1+"$@"} + libtool_options_prep_result=$func_quote_result + fi } func_add_hook func_options_prep libtool_options_prep @@ -2356,9 +2554,12 @@ libtool_parse_options () { $debug_cmd + _G_rc_lt_parse_options=false + # Perform our own loop to consume as many options as possible in # each iteration. while test $# -gt 0; do + _G_match_lt_parse_options=: _G_opt=$1 shift case $_G_opt in @@ -2433,15 +2634,20 @@ libtool_parse_options () func_append preserve_args " $_G_opt" ;; - # An option not handled by this hook function: - *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;; + # An option not handled by this hook function: + *) set dummy "$_G_opt" ${1+"$@"} ; shift + _G_match_lt_parse_options=false + break + ;; esac + $_G_match_lt_parse_options && _G_rc_lt_parse_options=: done - - # save modified positional parameters for caller - func_quote_for_eval ${1+"$@"} - libtool_parse_options_result=$func_quote_for_eval_result + if $_G_rc_lt_parse_options; then + # save modified positional parameters for caller + func_quote eval ${1+"$@"} + libtool_parse_options_result=$func_quote_result + fi } func_add_hook func_parse_options libtool_parse_options @@ -2462,10 +2668,10 @@ libtool_validate_options () # preserve --debug test : = "$debug_cmd" || func_append preserve_args " --debug" - case $host in + case $host_os in # Solaris2 added to fix http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16452 # see also: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59788 - *cygwin* | *mingw* | *pw32* | *cegcc* | *solaris2* | *os2*) + cygwin* | mingw* | windows* | pw32* | cegcc* | solaris2* | os2*) # don't eliminate duplications in $postdeps and $predeps opt_duplicate_compiler_generated_deps=: ;; @@ -2498,8 +2704,8 @@ libtool_validate_options () } # Pass back the unparsed argument list - func_quote_for_eval ${1+"$@"} - libtool_validate_options_result=$func_quote_for_eval_result + func_quote eval ${1+"$@"} + libtool_validate_options_result=$func_quote_result } func_add_hook func_validate_options libtool_validate_options @@ -2797,7 +3003,7 @@ EOF # func_convert_core_file_wine_to_w32 ARG # Helper function used by file name conversion functions when $build is *nix, -# and $host is mingw, cygwin, or some other w32 environment. Relies on a +# and $host is mingw, windows, cygwin, or some other w32 environment. Relies on a # correctly configured wine environment available, with the winepath program # in $build's $PATH. # @@ -2829,9 +3035,10 @@ func_convert_core_file_wine_to_w32 () # func_convert_core_path_wine_to_w32 ARG # Helper function used by path conversion functions when $build is *nix, and -# $host is mingw, cygwin, or some other w32 environment. Relies on a correctly -# configured wine environment available, with the winepath program in $build's -# $PATH. Assumes ARG has no leading or trailing path separator characters. +# $host is mingw, windows, cygwin, or some other w32 environment. Relies on a +# correctly configured wine environment available, with the winepath program +# in $build's $PATH. Assumes ARG has no leading or trailing path separator +# characters. # # ARG is path to be converted from $build format to win32. # Result is available in $func_convert_core_path_wine_to_w32_result. @@ -3465,8 +3672,8 @@ func_mode_compile () esac done - func_quote_for_eval "$libobj" - test "X$libobj" != "X$func_quote_for_eval_result" \ + func_quote_arg pretty "$libobj" + test "X$libobj" != "X$func_quote_arg_result" \ && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \ && func_warning "libobj name '$libobj' may not contain shell special characters." func_dirname_and_basename "$obj" "/" "" @@ -3486,7 +3693,7 @@ func_mode_compile () # On Cygwin there's no "real" PIC flag so we must build both object types case $host_os in - cygwin* | mingw* | pw32* | os2* | cegcc*) + cygwin* | mingw* | windows* | pw32* | os2* | cegcc*) pic_mode=default ;; esac @@ -3539,8 +3746,8 @@ compiler." func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 srcfile=$func_to_tool_file_result - func_quote_for_eval "$srcfile" - qsrcfile=$func_quote_for_eval_result + func_quote_arg pretty "$srcfile" + qsrcfile=$func_quote_arg_result # Only build a PIC object if we are building libtool libraries. if test yes = "$build_libtool_libs"; then @@ -3695,7 +3902,8 @@ This mode accepts the following additional options: -prefer-non-pic try to build non-PIC objects only -shared do not build a '.o' file suitable for static linking -static only build a '.o' file suitable for static linking - -Wc,FLAG pass FLAG directly to the compiler + -Wc,FLAG + -Xcompiler FLAG pass FLAG directly to the compiler COMPILE-COMMAND is a command to be used in creating a 'standard' object file from the given SOURCEFILE. @@ -3801,6 +4009,8 @@ The following components of LINK-COMMAND are treated specially: -weak LIBNAME declare that the target provides the LIBNAME interface -Wc,FLAG -Xcompiler FLAG pass linker-specific FLAG directly to the compiler + -Wa,FLAG + -Xassembler FLAG pass linker-specific FLAG directly to the assembler -Wl,FLAG -Xlinker FLAG pass linker-specific FLAG directly to the linker -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) @@ -4143,8 +4353,8 @@ func_mode_install () case $nonopt in *shtool*) :;; *) false;; esac then # Aesthetically quote it. - func_quote_for_eval "$nonopt" - install_prog="$func_quote_for_eval_result " + func_quote_arg pretty "$nonopt" + install_prog="$func_quote_arg_result " arg=$1 shift else @@ -4154,8 +4364,8 @@ func_mode_install () # The real first argument should be the name of the installation program. # Aesthetically quote it. - func_quote_for_eval "$arg" - func_append install_prog "$func_quote_for_eval_result" + func_quote_arg pretty "$arg" + func_append install_prog "$func_quote_arg_result" install_shared_prog=$install_prog case " $install_prog " in *[\\\ /]cp\ *) install_cp=: ;; @@ -4212,12 +4422,12 @@ func_mode_install () esac # Aesthetically quote the argument. - func_quote_for_eval "$arg" - func_append install_prog " $func_quote_for_eval_result" + func_quote_arg pretty "$arg" + func_append install_prog " $func_quote_arg_result" if test -n "$arg2"; then - func_quote_for_eval "$arg2" + func_quote_arg pretty "$arg2" fi - func_append install_shared_prog " $func_quote_for_eval_result" + func_append install_shared_prog " $func_quote_arg_result" done test -z "$install_prog" && \ @@ -4228,8 +4438,8 @@ func_mode_install () if test -n "$install_override_mode" && $no_mode; then if $install_cp; then :; else - func_quote_for_eval "$install_override_mode" - func_append install_shared_prog " -m $func_quote_for_eval_result" + func_quote_arg pretty "$install_override_mode" + func_append install_shared_prog " -m $func_quote_arg_result" fi fi @@ -4360,7 +4570,7 @@ func_mode_install () 'exit $?' tstripme=$stripme case $host_os in - cygwin* | mingw* | pw32* | cegcc*) + cygwin* | mingw* | windows* | pw32* | cegcc*) case $realname in *.dll.a) tstripme= @@ -4473,7 +4683,7 @@ func_mode_install () # Do a test to see if this is really a libtool program. case $host in - *cygwin* | *mingw*) + *cygwin* | *mingw* | *windows*) if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" wrapper=$func_ltwrapper_scriptname_result @@ -4525,8 +4735,8 @@ func_mode_install () relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` $opt_quiet || { - func_quote_for_expand "$relink_command" - eval "func_echo $func_quote_for_expand_result" + func_quote_arg expand,pretty "$relink_command" + eval "func_echo $func_quote_arg_result" } if eval "$relink_command"; then : else @@ -4701,7 +4911,7 @@ extern \"C\" { $RM $export_symbols eval "$SED -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' case $host in - *cygwin* | *mingw* | *cegcc* ) + *cygwin* | *mingw* | *windows* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' ;; @@ -4713,7 +4923,7 @@ extern \"C\" { eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' case $host in - *cygwin* | *mingw* | *cegcc* ) + *cygwin* | *mingw* | *windows* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' ;; @@ -4727,7 +4937,7 @@ extern \"C\" { func_basename "$dlprefile" name=$func_basename_result case $host in - *cygwin* | *mingw* | *cegcc* ) + *cygwin* | *mingw* | *windows* | *cegcc* ) # if an import library, we need to obtain dlname if func_win32_import_lib_p "$dlprefile"; then func_tr_sh "$dlprefile" @@ -4753,8 +4963,16 @@ extern \"C\" { eval '$ECHO ": $name " >> "$nlist"' fi func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 - eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | - $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'" + case $host in + i[3456]86-*-mingw32*) + eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | + $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'" + ;; + *) + eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | + $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/__nm_//' >> '$nlist'" + ;; + esac } else # not an import lib $opt_dry_run || { @@ -4902,7 +5120,7 @@ static const void *lt_preloaded_setup() { # Transform the symbol file into the correct name. symfileobj=$output_objdir/${my_outputname}S.$objext case $host in - *cygwin* | *mingw* | *cegcc* ) + *cygwin* | *mingw* | *windows* | *cegcc* ) if test -f "$output_objdir/$my_outputname.def"; then compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` @@ -4978,7 +5196,7 @@ func_win32_libid () *ar\ archive*) # could be an import, or static # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | - $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then + $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64|pe-aarch64)' >/dev/null; then case $nm_interface in "MS dumpbin") if func_cygming_ms_implib_p "$1" || @@ -5245,7 +5463,7 @@ func_extract_archives () # # Emit a libtool wrapper script on stdout. # Don't directly open a file because we may want to -# incorporate the script contents within a cygwin/mingw +# incorporate the script contents within a cygwin/mingw/windows # wrapper executable. Must ONLY be called from within # func_mode_link because it depends on a number of variables # set therein. @@ -5253,7 +5471,7 @@ func_extract_archives () # ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR # variable will take. If 'yes', then the emitted script # will assume that the directory where it is stored is -# the $objdir directory. This is a cygwin/mingw-specific +# the $objdir directory. This is a cygwin/mingw/windows-specific # behavior. func_emit_wrapper () { @@ -5305,8 +5523,8 @@ else if test \"\$libtool_execute_magic\" != \"$magic\"; then file=\"\$0\"" - func_quote "$ECHO" - qECHO=$func_quote_result + func_quote_arg pretty "$ECHO" + qECHO=$func_quote_arg_result $ECHO "\ # A function that is used when there is no print builtin or printf. @@ -5316,7 +5534,7 @@ func_fallback_echo () \$1 _LTECHO_EOF' } - ECHO=\"$qECHO\" + ECHO=$qECHO fi # Very basic option parsing. These options are (a) specific to @@ -5378,7 +5596,7 @@ func_exec_program_core () " case $host in # Backslashes separate directories on plain windows - *-*-mingw | *-*-os2* | *-cegcc*) + *-*-mingw* | *-*-windows* | *-*-os2* | *-cegcc*) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir\\\\\$program\" 1>&2 @@ -5446,7 +5664,7 @@ func_exec_program () file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\` done - # Usually 'no', except on cygwin/mingw when embedded into + # Usually 'no', except on cygwin/mingw/windows when embedded into # the cwrapper. WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1 if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then @@ -5578,7 +5796,7 @@ EOF #endif #include #include -#ifdef _MSC_VER +#if defined _WIN32 && !defined __GNUC__ # include # include # include @@ -5603,7 +5821,7 @@ EOF /* declarations of non-ANSI functions */ #if defined __MINGW32__ # ifdef __STRICT_ANSI__ -int _putenv (const char *); +_CRTIMP int __cdecl _putenv (const char *); # endif #elif defined __CYGWIN__ # ifdef __STRICT_ANSI__ @@ -5801,7 +6019,7 @@ main (int argc, char *argv[]) { EOF case $host in - *mingw* | *cygwin* ) + *mingw* | *windows* | *cygwin* ) # make stdout use "unix" line endings echo " setmode(1,_O_BINARY);" ;; @@ -5820,7 +6038,7 @@ EOF { /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX namespace, but it is not one of the ones we know about and - have already dealt with, above (inluding dump-script), then + have already dealt with, above (including dump-script), then report an error. Otherwise, targets might begin to believe they are allowed to use options in the LTWRAPPER_OPTION_PREFIX namespace. The first time any user complains about this, we'll @@ -5904,7 +6122,7 @@ EOF EOF case $host_os in - mingw*) + mingw* | windows*) cat <<"EOF" { char* p; @@ -5946,7 +6164,7 @@ EOF EOF case $host_os in - mingw*) + mingw* | windows*) cat <<"EOF" /* execv doesn't actually work on mingw as expected on unix */ newargz = prepare_spawn (newargz); @@ -6365,7 +6583,7 @@ lt_update_lib_path (const char *name, const char *value) EOF case $host_os in - mingw*) + mingw* | windows*) cat <<"EOF" /* Prepares an argument vector before calling spawn(). @@ -6540,7 +6758,7 @@ func_mode_link () $debug_cmd case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) + *-*-cygwin* | *-*-mingw* | *-*-windows* | *-*-pw32* | *-*-os2* | *-cegcc*) # It is impossible to link a dll without this setting, and # we shouldn't force the makefile maintainer to figure out # what system we are compiling for in order to pass an extra @@ -6604,10 +6822,12 @@ func_mode_link () xrpath= perm_rpath= temp_rpath= + temp_rpath_tail= thread_safe=no vinfo= vinfo_number=no weak_libs= + rpath_arg= single_module=$wl-single_module func_infer_tag $base_compile @@ -6659,9 +6879,9 @@ func_mode_link () while test "$#" -gt 0; do arg=$1 shift - func_quote_for_eval "$arg" - qarg=$func_quote_for_eval_unquoted_result - func_append libtool_args " $func_quote_for_eval_result" + func_quote_arg pretty,unquoted "$arg" + qarg=$func_quote_arg_unquoted_result + func_append libtool_args " $func_quote_arg_result" # If the previous option needs an argument, assign it. if test -n "$prev"; then @@ -6870,7 +7090,7 @@ func_mode_link () case $arg in [\\/]* | [A-Za-z]:[\\/]*) ;; *) - func_fatal_error "only absolute run-paths are allowed" + func_fatal_error "argument to -rpath is not absolute: $arg" ;; esac if test rpath = "$prev"; then @@ -6897,6 +7117,13 @@ func_mode_link () prev= continue ;; + xassembler) + func_append compiler_flags " -Xassembler $qarg" + prev= + func_append compile_command " -Xassembler $qarg" + func_append finalize_command " -Xassembler $qarg" + continue + ;; xcclinker) func_append linker_flags " $qarg" func_append compiler_flags " $qarg" @@ -7039,7 +7266,7 @@ func_mode_link () ;; esac case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) + *-*-cygwin* | *-*-mingw* | *-*-windows* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'` case :$dllsearchpath: in *":$dir:"*) ;; @@ -7059,7 +7286,7 @@ func_mode_link () -l*) if test X-lc = "X$arg" || test X-lm = "X$arg"; then case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) + *-*-cygwin* | *-*-mingw* | *-*-windows* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) # These systems don't actually have a C or math library (as such) continue ;; @@ -7067,7 +7294,7 @@ func_mode_link () # These systems don't actually have a C library (as such) test X-lc = "X$arg" && continue ;; - *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*) + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-midnightbsd*) # Do not include libc due to us having libc/libc_r. test X-lc = "X$arg" && continue ;; @@ -7087,7 +7314,7 @@ func_mode_link () esac elif test X-lc_r = "X$arg"; then case $host in - *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*) + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-midnightbsd*) # Do not include libc_r directly, use -pthread flag. continue ;; @@ -7117,9 +7344,21 @@ func_mode_link () prev=xcompiler continue ;; - - -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ - |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) + # Solaris ld rejects as of 11.4. Refer to Oracle bug 22985199. + -pthread) + case $host in + *solaris2*) ;; + *) + case "$new_inherited_linker_flags " in + *" $arg "*) ;; + * ) func_append new_inherited_linker_flags " $arg" ;; + esac + ;; + esac + continue + ;; + -mt|-mthreads|-kthread|-Kthread|-pthreads|--thread-safe \ + |-threads|-fopenmp|-fopenmp=*|-openmp|-mp|-xopenmp|-omp|-qsmp=*) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" @@ -7152,7 +7391,7 @@ func_mode_link () -no-install) case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) + *-*-cygwin* | *-*-mingw* | *-*-windows* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) # The PATH hackery in wrapper scripts is required on Windows # and Darwin in order for the loader to find any dlls it needs. func_warning "'-no-install' is ignored for $host" @@ -7212,7 +7451,7 @@ func_mode_link () dir=$lt_sysroot$func_stripname_result ;; *) - func_fatal_error "only absolute run-paths are allowed" + func_fatal_error "argument ($arg) to '-R' is not an absolute path: $dir" ;; esac case "$xrpath " in @@ -7269,9 +7508,9 @@ func_mode_link () save_ifs=$IFS; IFS=, for flag in $args; do IFS=$save_ifs - func_quote_for_eval "$flag" - func_append arg " $func_quote_for_eval_result" - func_append compiler_flags " $func_quote_for_eval_result" + func_quote_arg pretty "$flag" + func_append arg " $func_quote_arg_result" + func_append compiler_flags " $func_quote_arg_result" done IFS=$save_ifs func_stripname ' ' '' "$arg" @@ -7285,16 +7524,21 @@ func_mode_link () save_ifs=$IFS; IFS=, for flag in $args; do IFS=$save_ifs - func_quote_for_eval "$flag" - func_append arg " $wl$func_quote_for_eval_result" - func_append compiler_flags " $wl$func_quote_for_eval_result" - func_append linker_flags " $func_quote_for_eval_result" + func_quote_arg pretty "$flag" + func_append arg " $wl$func_quote_arg_result" + func_append compiler_flags " $wl$func_quote_arg_result" + func_append linker_flags " $func_quote_arg_result" done IFS=$save_ifs func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; + -Xassembler) + prev=xassembler + continue + ;; + -Xcompiler) prev=xcompiler continue @@ -7312,8 +7556,8 @@ func_mode_link () # -msg_* for osf cc -msg_*) - func_quote_for_eval "$arg" - arg=$func_quote_for_eval_result + func_quote_arg pretty "$arg" + arg=$func_quote_arg_result ;; # Flags to be passed through unchanged, with rationale: @@ -7332,14 +7576,31 @@ func_mode_link () # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization # -specs=* GCC specs files # -stdlib=* select c++ std lib with clang + # -fdiagnostics-color* simply affects output + # -frecord-gcc-switches used to verify flags were respected # -fsanitize=* Clang/GCC memory and address sanitizer + # -fno-sanitize* Clang/GCC memory and address sanitizer + # -shared-libsan Link with shared sanitizer runtimes (Clang) + # -static-libsan Link with static sanitizer runtimes (Clang) + # -no-canonical-prefixes Do not expand any symbolic links # -fuse-ld=* Linker select flags for GCC + # -static-* direct GCC to link specific libraries statically + # -fcilkplus Cilk Plus language extension features for C/C++ + # -rtlib=* select c runtime lib with clang + # --unwindlib=* select unwinder library with clang + # -f{file|debug|macro|profile}-prefix-map=* needed for lto linking + # -Wa,* Pass flags directly to the assembler + # -Werror, -Werror=* Report (specified) warnings as errors -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ - -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \ - -specs=*|-fsanitize=*|-fuse-ld=*) - func_quote_for_eval "$arg" - arg=$func_quote_for_eval_result + -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-no-canonical-prefixes| \ + -stdlib=*|-rtlib=*|--unwindlib=*| \ + -specs=*|-fsanitize=*|-fno-sanitize*|-shared-libsan|-static-libsan| \ + -ffile-prefix-map=*|-fdebug-prefix-map=*|-fmacro-prefix-map=*|-fprofile-prefix-map=*| \ + -fdiagnostics-color*|-frecord-gcc-switches| \ + -fuse-ld=*|-static-*|-fcilkplus|-Wa,*|-Werror|-Werror=*) + func_quote_arg pretty "$arg" + arg=$func_quote_arg_result func_append compile_command " $arg" func_append finalize_command " $arg" func_append compiler_flags " $arg" @@ -7360,15 +7621,15 @@ func_mode_link () continue else # Otherwise treat like 'Some other compiler flag' below - func_quote_for_eval "$arg" - arg=$func_quote_for_eval_result + func_quote_arg pretty "$arg" + arg=$func_quote_arg_result fi ;; # Some other compiler flag. -* | +*) - func_quote_for_eval "$arg" - arg=$func_quote_for_eval_result + func_quote_arg pretty "$arg" + arg=$func_quote_arg_result ;; *.$objext) @@ -7488,15 +7749,27 @@ func_mode_link () *) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. - func_quote_for_eval "$arg" - arg=$func_quote_for_eval_result + func_quote_arg pretty "$arg" + arg=$func_quote_arg_result ;; esac # arg # Now actually substitute the argument into the commands. if test -n "$arg"; then - func_append compile_command " $arg" - func_append finalize_command " $arg" + if test -n "$rpath_arg"; then + func_append finalize_rpath " ${arg##*,}" + unset rpath_arg + else + case $arg in + -Wl,-rpath,*) + func_append finalize_rpath " ${arg##*,}";; + -Wl,-rpath) + rpath_arg=1;; + *) + func_append compile_command " $arg" + func_append finalize_command " $arg" + esac + fi fi done # argument parsing loop @@ -7667,7 +7940,7 @@ func_mode_link () found=false case $deplib in -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ - |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) + |-threads|-fopenmp|-fopenmp=*|-openmp|-mp|-xopenmp|-omp|-qsmp=*) if test prog,link = "$linkmode,$pass"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" @@ -7844,18 +8117,15 @@ func_mode_link () ;; esac if $valid_a_lib; then - echo - $ECHO "*** Warning: Linking the shared library $output against the" - $ECHO "*** static library $deplib is not portable!" + func_warning "Linking the shared library $output against the static library $deplib is not portable!" deplibs="$deplib $deplibs" else - echo - $ECHO "*** Warning: Trying to link with static lib archive $deplib." - echo "*** I have the capability to make that library automatically link in when" - echo "*** you link to this library. But I can only do this if you have a" - echo "*** shared version of the library, which you do not appear to have" - echo "*** because the file extensions .$libext of this argument makes me believe" - echo "*** that it is just a static archive that I should not use here." + func_warning "Trying to link with static lib archive $deplib." + func_warning "I have the capability to make that library automatically link in when" + func_warning "you link to this library. But I can only do this if you have a" + func_warning "shared version of the library, which you do not appear to have" + func_warning "because the file extensions .$libext of this argument makes me believe" + func_warning "that it is just a static archive that I should not use here." fi ;; esac @@ -8050,7 +8320,7 @@ func_mode_link () fi case $host in # special handling for platforms with PE-DLLs. - *cygwin* | *mingw* | *cegcc* ) + *cygwin* | *mingw* | *windows* | *cegcc* ) # Linker will automatically link against shared library if both # static and shared are present. Therefore, ensure we extract # symbols from the import library if a shared library is present @@ -8150,7 +8420,10 @@ func_mode_link () # Make sure the rpath contains only unique directories. case $temp_rpath: in *"$absdir:"*) ;; - *) func_append temp_rpath "$absdir:" ;; + *) case $absdir in + "$progdir/"*) func_append temp_rpath "$absdir:" ;; + *) func_append temp_rpath_tail "$absdir:" ;; + esac esac fi @@ -8162,7 +8435,9 @@ func_mode_link () *) case "$compile_rpath " in *" $absdir "*) ;; - *) func_append compile_rpath " $absdir" ;; + *) case $absdir in + "$progdir/"*) func_append compile_rpath " $absdir" ;; + esac esac ;; esac @@ -8193,8 +8468,8 @@ func_mode_link () fi if test -n "$library_names" && { test no = "$use_static_libs" || test -z "$old_library"; }; then - case $host in - *cygwin* | *mingw* | *cegcc* | *os2*) + case $host_os in + cygwin* | mingw* | windows* | cegcc* | os2*) # No point in relinking DLLs because paths are not encoded func_append notinst_deplibs " $lib" need_relink=no @@ -8220,11 +8495,11 @@ func_mode_link () if test -z "$dlopenmodule" && test yes = "$shouldnotlink" && test link = "$pass"; then echo if test prog = "$linkmode"; then - $ECHO "*** Warning: Linking the executable $output against the loadable module" + func_warning "Linking the executable $output against the loadable module" else - $ECHO "*** Warning: Linking the shared library $output against the loadable module" + func_warning "Linking the shared library $output against the loadable module" fi - $ECHO "*** $linklib is not portable!" + func_warning "$linklib is not portable!" fi if test lib = "$linkmode" && test yes = "$hardcode_into_libs"; then @@ -8236,7 +8511,9 @@ func_mode_link () *) case "$compile_rpath " in *" $absdir "*) ;; - *) func_append compile_rpath " $absdir" ;; + *) case $absdir in + "$progdir/"*) func_append compile_rpath " $absdir" ;; + esac esac ;; esac @@ -8263,8 +8540,8 @@ func_mode_link () soname=$dlname elif test -n "$soname_spec"; then # bleh windows - case $host in - *cygwin* | mingw* | *cegcc* | *os2*) + case $host_os in + cygwin* | mingw* | windows* | cegcc* | os2*) func_arith $current - $age major=$func_arith_result versuffix=-$major @@ -8319,11 +8596,10 @@ func_mode_link () if /usr/bin/file -L $add 2> /dev/null | $GREP ": [^:]* bundle" >/dev/null; then if test "X$dlopenmodule" != "X$lib"; then - $ECHO "*** Warning: lib $linklib is a module, not a shared library" + func_warning "lib $linklib is a module, not a shared library" if test -z "$old_library"; then - echo - echo "*** And there doesn't seem to be a static archive available" - echo "*** The link will probably fail, sorry" + func_warning "And there doesn't seem to be a static archive available" + func_warning "The link will probably fail, sorry" else add=$dir/$old_library fi @@ -8406,7 +8682,7 @@ func_mode_link () test no = "$hardcode_direct_absolute"; then add=$libdir/$linklib elif test yes = "$hardcode_minus_L"; then - add_dir=-L$libdir + add_dir=-L$lt_sysroot$libdir add=-l$name elif test yes = "$hardcode_shlibpath_var"; then case :$finalize_shlibpath: in @@ -8423,7 +8699,7 @@ func_mode_link () fi else # We cannot seem to hardcode it, guess we'll fake it. - add_dir=-L$libdir + add_dir=-L$lt_sysroot$libdir # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in @@ -8463,21 +8739,19 @@ func_mode_link () # Just print a warning and add the library to dependency_libs so # that the program can be linked against the static library. - echo - $ECHO "*** Warning: This system cannot link to static lib archive $lib." - echo "*** I have the capability to make that library automatically link in when" - echo "*** you link to this library. But I can only do this if you have a" - echo "*** shared version of the library, which you do not appear to have." + func_warning "This system cannot link to static lib archive $lib." + func_warning "I have the capability to make that library automatically link in when" + func_warning "you link to this library. But I can only do this if you have a" + func_warning "shared version of the library, which you do not appear to have." if test yes = "$module"; then - echo "*** But as you try to build a module library, libtool will still create " - echo "*** a static module, that should work as long as the dlopening application" - echo "*** is linked with the -dlopen flag to resolve symbols at runtime." + func_warning "But as you try to build a module library, libtool will still create " + func_warning "a static module, that should work as long as the dlopening application" + func_warning "is linked with the -dlopen flag to resolve symbols at runtime." if test -z "$global_symbol_pipe"; then - echo - echo "*** However, this would only work if libtool was able to extract symbol" - echo "*** lists from a program, using 'nm' or equivalent, but libtool could" - echo "*** not find such a program. So, this module is probably useless." - echo "*** 'nm' from GNU binutils and a full rebuild may help." + func_warning "However, this would only work if libtool was able to extract symbol" + func_warning "lists from a program, using 'nm' or equivalent, but libtool could" + func_warning "not find such a program. So, this module is probably useless." + func_warning "'nm' from GNU binutils and a full rebuild may help." fi if test no = "$build_old_libs"; then build_libtool_libs=module @@ -8600,6 +8874,8 @@ func_mode_link () fi # link_all_deplibs != no fi # linkmode = lib done # for deplib in $libs + + func_append temp_rpath "$temp_rpath_tail" if test link = "$pass"; then if test prog = "$linkmode"; then compile_deplibs="$new_inherited_linker_flags $compile_deplibs" @@ -8637,42 +8913,46 @@ func_mode_link () # Add libraries to $var in reverse order eval tmp_libs=\"\$$var\" new_libs= + # FIXME: Pedantically, this is the right thing to do, so + # that some nasty dependency loop isn't accidentally + # broken: new_libs="$deplib $new_libs" for deplib in $tmp_libs; do - # FIXME: Pedantically, this is the right thing to do, so - # that some nasty dependency loop isn't accidentally - # broken: - #new_libs="$deplib $new_libs" - # Pragmatically, this seems to cause very few problems in - # practice: - case $deplib in - -L*) new_libs="$deplib $new_libs" ;; - -R*) ;; - *) - # And here is the reason: when a library appears more - # than once as an explicit dependence of a library, or - # is implicitly linked in more than once by the - # compiler, it is considered special, and multiple - # occurrences thereof are not removed. Compare this - # with having the same library being listed as a - # dependency of multiple other libraries: in this case, - # we know (pedantically, we assume) the library does not - # need to be listed more than once, so we keep only the - # last copy. This is not always right, but it is rare - # enough that we require users that really mean to play - # such unportable linking tricks to link the library - # using -Wl,-lname, so that libtool does not consider it - # for duplicate removal. - case " $specialdeplibs " in - *" $deplib "*) new_libs="$deplib $new_libs" ;; + if $opt_preserve_dup_deps; then + new_libs="$deplib $new_libs" + else + # Pragmatically, this seems to cause very few problems in + # practice: + case $deplib in + -L*) new_libs="$deplib $new_libs" ;; + -R*) ;; *) - case " $new_libs " in - *" $deplib "*) ;; - *) new_libs="$deplib $new_libs" ;; - esac - ;; + # And here is the reason: when a library appears more + # than once as an explicit dependence of a library, or + # is implicitly linked in more than once by the + # compiler, it is considered special, and multiple + # occurrences thereof are not removed. Compare this + # with having the same library being listed as a + # dependency of multiple other libraries: in this case, + # we know (pedantically, we assume) the library does not + # need to be listed more than once, so we keep only the + # last copy. This is not always right, but it is rare + # enough that we require users that really mean to play + # such unportable linking tricks to link the library + # using -Wl,-lname, so that libtool does not consider it + # for duplicate removal. And if not possible for portability + # reasons, then --preserve-dup-deps should be used. + case " $specialdeplibs " in + *" $deplib "*) new_libs="$deplib $new_libs" ;; + *) + case " $new_libs " in + *" $deplib "*) ;; + *) new_libs="$deplib $new_libs" ;; + esac + ;; + esac + ;; esac - ;; - esac + fi done tmp_libs= for deplib in $new_libs; do @@ -8694,7 +8974,7 @@ func_mode_link () test CXX = "$tagname" && { case $host_os in linux*) - case `$CC -V 2>&1 | sed 5q` in + case `$CC -V 2>&1 | $SED 5q` in *Sun\ C*) # Sun C++ 5.9 func_suncc_cstd_abi @@ -8804,9 +9084,7 @@ func_mode_link () if test pass_all != "$deplibs_check_method"; then func_fatal_error "cannot build libtool library '$output' from non-libtool objects on this host:$objs" else - echo - $ECHO "*** Warning: Linking the shared library $output against the non-libtool" - $ECHO "*** objects $objs is not portable!" + func_warning "Linking the shared library $output against the non-libtool objects $objs is not portable!" func_append libobjs " $objs" fi fi @@ -8867,13 +9145,13 @@ func_mode_link () # case $version_type in # correct linux to gnu/linux during the next big refactor - darwin|freebsd-elf|linux|osf|windows|none) + darwin|freebsd-elf|linux|midnightbsd-elf|osf|qnx|windows|none) func_arith $number_major + $number_minor current=$func_arith_result age=$number_minor revision=$number_revision ;; - freebsd-aout|qnx|sunos) + freebsd-aout|sco|sunos) current=$number_major revision=$number_minor age=0 @@ -8958,7 +9236,7 @@ func_mode_link () versuffix=.$current.$revision ;; - freebsd-elf) + freebsd-elf | midnightbsd-elf) func_arith $current - $age major=.$func_arith_result versuffix=$major.$age.$revision @@ -9020,8 +9298,9 @@ func_mode_link () ;; qnx) - major=.$current - versuffix=.$current + func_arith $current - $age + major=.$func_arith_result + versuffix=$major.$age.$revision ;; sco) @@ -9174,7 +9453,7 @@ func_mode_link () if test yes = "$build_libtool_libs"; then if test -n "$rpath"; then case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) + *-*-cygwin* | *-*-mingw* | *-*-windows* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) # these systems don't actually have a c library (as such)! ;; *-*-rhapsody* | *-*-darwin1.[012]) @@ -9184,7 +9463,7 @@ func_mode_link () *-*-netbsd*) # Don't link with libc until the a.out ld.so is fixed. ;; - *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-midnightbsd*) # Do not include libc due to us having libc/libc_r. ;; *-*-sco3.2v5* | *-*-sco5v6*) @@ -9225,108 +9504,6 @@ func_mode_link () # implementing what was already the behavior. newdeplibs=$deplibs ;; - test_compile) - # This code stresses the "libraries are programs" paradigm to its - # limits. Maybe even breaks it. We compile a program, linking it - # against the deplibs as a proxy for the library. Then we can check - # whether they linked in statically or dynamically with ldd. - $opt_dry_run || $RM conftest.c - cat > conftest.c <, 1996. # This program is free software; you can redistribute it and/or modify diff --git a/3rdparty/expat/conftools/test-driver b/3rdparty/expat/conftools/test-driver index 89dba1e075cd3..be73b80adf955 100755 --- a/3rdparty/expat/conftools/test-driver +++ b/3rdparty/expat/conftools/test-driver @@ -3,7 +3,7 @@ scriptversion=2018-03-07.03; # UTC -# Copyright (C) 2011-2020 Free Software Foundation, Inc. +# Copyright (C) 2011-2021 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -42,11 +42,13 @@ print_usage () { cat <$log_file 2>&1 +# Test script is run here. We create the file first, then append to it, +# to ameliorate tests themselves also writing to the log file. Our tests +# don't, but others can (automake bug#35762). +: >"$log_file" +"$@" >>"$log_file" 2>&1 estatus=$? if test $enable_hard_errors = no && test $estatus -eq 99; then @@ -126,7 +131,7 @@ esac # know whether the test passed or failed simply by looking at the '.log' # file, without the need of also peaking into the corresponding '.trs' # file (automake bug#11814). -echo "$res $test_name (exit status: $estatus)" >>$log_file +echo "$res $test_name (exit status: $estatus)" >>"$log_file" # Report outcome to console. echo "${col}${res}${std}: $test_name" diff --git a/3rdparty/expat/doc/Makefile.am b/3rdparty/expat/doc/Makefile.am index e2f029837a410..3bea96e9aa6f6 100644 --- a/3rdparty/expat/doc/Makefile.am +++ b/3rdparty/expat/doc/Makefile.am @@ -6,7 +6,10 @@ # \___/_/\_\ .__/ \__,_|\__| # |_| XML parser # -# Copyright (c) 2017 Expat development team +# Copyright (c) 2017-2024 Sebastian Pipping +# Copyright (c) 2017 Stephen Groat +# Copyright (c) 2017 Joe Orton +# Copyright (c) 2024 Tomas Korbar # Licensed under the MIT license: # # Permission is hereby granted, free of charge, to any person obtaining @@ -30,30 +33,27 @@ .PHONY: dist-hook # not inside conditional to avoid automake warning -if WITH_DOCBOOK +if WITH_MANPAGE dist_man_MANS = xmlwf.1 xmlwf.1: xmlwf.xml -rm -f $@ - $(DOCBOOK_TO_MAN) $< + test "x$(DOCBOOK_TO_MAN)" != x && $(DOCBOOK_TO_MAN) $< test -f $@ || mv XMLWF.1 $@ -else +endif + +if !WITH_DISTRIBUTABLE_MANPAGE dist-hook: @echo 'ERROR: Configure with --with-docbook for "make dist".' 1>&2 @false endif -# https://www.gnu.org/software/automake/manual/automake.html#What-Gets-Cleaned -.PHONY: clean-local -clean-local: clean-local-check - -.PHONY: clean-local-check -clean-local-check: - $(RM) xmlwf.1 +if !WITH_PREBUILT_MANPAGE +CLEANFILES = xmlwf.1 +endif EXTRA_DIST = \ - expat.png \ + ok.min.css \ reference.html \ style.css \ - valid-xhtml10.png \ xmlwf.xml diff --git a/3rdparty/expat/doc/Makefile.in b/3rdparty/expat/doc/Makefile.in index 94550becf3948..72deb0565d947 100644 --- a/3rdparty/expat/doc/Makefile.in +++ b/3rdparty/expat/doc/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.16.2 from Makefile.am. +# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2020 Free Software Foundation, Inc. +# Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -22,7 +22,10 @@ # \___/_/\_\ .__/ \__,_|\__| # |_| XML parser # -# Copyright (c) 2017 Expat development team +# Copyright (c) 2017-2024 Sebastian Pipping +# Copyright (c) 2017 Stephen Groat +# Copyright (c) 2017 Joe Orton +# Copyright (c) 2024 Tomas Korbar # Licensed under the MIT license: # # Permission is hereby granted, free of charge, to any person obtaining @@ -130,6 +133,8 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/conftools/ax-append-compile-flags.m4 \ $(top_srcdir)/conftools/ax-append-link-flags.m4 \ $(top_srcdir)/conftools/expatcfg-compiler-supports-visibility.m4 \ + $(top_srcdir)/conftools/ax-cxx-compile-stdcxx.m4 \ + $(top_srcdir)/conftools/ax-cxx-compile-stdcxx-11.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) @@ -207,8 +212,10 @@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ -CPP = @CPP@ +CMAKE_SHARED_LIBRARY_PREFIX = @CMAKE_SHARED_LIBRARY_PREFIX@ CPPFLAGS = @CPPFLAGS@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ @@ -224,10 +231,20 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ +ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ +EXPAT_ATTR_INFO = @EXPAT_ATTR_INFO@ +EXPAT_CHAR_TYPE = @EXPAT_CHAR_TYPE@ +EXPAT_CONTEXT_BYTES = @EXPAT_CONTEXT_BYTES@ +EXPAT_DTD = @EXPAT_DTD@ +EXPAT_LARGE_SIZE = @EXPAT_LARGE_SIZE@ +EXPAT_MIN_SIZE = @EXPAT_MIN_SIZE@ +EXPAT_NS = @EXPAT_NS@ FGREP = @FGREP@ +FILECMD = @FILECMD@ FILEMAP = @FILEMAP@ GREP = @GREP@ +HAVE_CXX11 = @HAVE_CXX11@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -237,6 +254,8 @@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBAGE = @LIBAGE@ LIBCURRENT = @LIBCURRENT@ +LIBDIR_BASENAME = @LIBDIR_BASENAME@ +LIBM = @LIBM@ LIBOBJS = @LIBOBJS@ LIBREVISION = @LIBREVISION@ LIBS = @LIBS@ @@ -245,6 +264,7 @@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ +MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ @@ -266,9 +286,12 @@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ +SIZEOF_VOID_P = @SIZEOF_VOID_P@ +SO_MAJOR = @SO_MAJOR@ +SO_MINOR = @SO_MINOR@ +SO_PATCH = @SO_PATCH@ STRIP = @STRIP@ VERSION = @VERSION@ -_EXPAT_OUTPUT_NAME = @_EXPAT_OUTPUT_NAME@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ @@ -323,18 +346,18 @@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -@WITH_DOCBOOK_TRUE@dist_man_MANS = xmlwf.1 +@WITH_MANPAGE_TRUE@dist_man_MANS = xmlwf.1 +@WITH_PREBUILT_MANPAGE_FALSE@CLEANFILES = xmlwf.1 EXTRA_DIST = \ - expat.png \ + ok.min.css \ reference.html \ style.css \ - valid-xhtml10.png \ xmlwf.xml all: all-am .SUFFIXES: -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -358,9 +381,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: $(am__configure_deps) +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): @@ -418,8 +441,7 @@ ctags CTAGS: cscope cscopelist: -@WITH_DOCBOOK_TRUE@dist-hook: - +@WITH_DISTRIBUTABLE_MANPAGE_TRUE@dist-hook: distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am @@ -485,6 +507,7 @@ install-strip: mostlyclean-generic: clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) @@ -495,7 +518,7 @@ maintainer-clean-generic: @echo "it deletes files that may require special tools to rebuild." clean: clean-am -clean-am: clean-generic clean-libtool clean-local mostlyclean-am +clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile @@ -564,38 +587,31 @@ uninstall-man: uninstall-man1 .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ - clean-local cscopelist-am ctags-am dist-hook distclean \ - distclean-generic distclean-libtool distdir dvi dvi-am html \ - html-am info info-am install install-am install-data \ - install-data-am install-dvi install-dvi-am install-exec \ - install-exec-am install-html install-html-am install-info \ - install-info-am install-man install-man1 install-pdf \ - install-pdf-am install-ps install-ps-am install-strip \ - installcheck installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-generic \ - mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \ - uninstall-am uninstall-man uninstall-man1 + cscopelist-am ctags-am dist-hook distclean distclean-generic \ + distclean-libtool distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-man1 install-pdf install-pdf-am install-ps \ + install-ps-am install-strip installcheck installcheck-am \ + installdirs maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ + ps ps-am tags-am uninstall uninstall-am uninstall-man \ + uninstall-man1 .PRECIOUS: Makefile .PHONY: dist-hook # not inside conditional to avoid automake warning -@WITH_DOCBOOK_TRUE@xmlwf.1: xmlwf.xml -@WITH_DOCBOOK_TRUE@ -rm -f $@ -@WITH_DOCBOOK_TRUE@ $(DOCBOOK_TO_MAN) $< -@WITH_DOCBOOK_TRUE@ test -f $@ || mv XMLWF.1 $@ -@WITH_DOCBOOK_FALSE@dist-hook: -@WITH_DOCBOOK_FALSE@ @echo 'ERROR: Configure with --with-docbook for "make dist".' 1>&2 -@WITH_DOCBOOK_FALSE@ @false - -# https://www.gnu.org/software/automake/manual/automake.html#What-Gets-Cleaned -.PHONY: clean-local -clean-local: clean-local-check - -.PHONY: clean-local-check -clean-local-check: - $(RM) xmlwf.1 +@WITH_MANPAGE_TRUE@xmlwf.1: xmlwf.xml +@WITH_MANPAGE_TRUE@ -rm -f $@ +@WITH_MANPAGE_TRUE@ test "x$(DOCBOOK_TO_MAN)" != x && $(DOCBOOK_TO_MAN) $< +@WITH_MANPAGE_TRUE@ test -f $@ || mv XMLWF.1 $@ + +@WITH_DISTRIBUTABLE_MANPAGE_FALSE@dist-hook: +@WITH_DISTRIBUTABLE_MANPAGE_FALSE@ @echo 'ERROR: Configure with --with-docbook for "make dist".' 1>&2 +@WITH_DISTRIBUTABLE_MANPAGE_FALSE@ @false # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff --git a/3rdparty/expat/doc/expat.png b/3rdparty/expat/doc/expat.png deleted file mode 100644 index 7d7c3dbaebcba..0000000000000 Binary files a/3rdparty/expat/doc/expat.png and /dev/null differ diff --git a/3rdparty/expat/doc/ok.min.css b/3rdparty/expat/doc/ok.min.css new file mode 100644 index 0000000000000..d324fabb28738 --- /dev/null +++ b/3rdparty/expat/doc/ok.min.css @@ -0,0 +1,2 @@ +/*! OK.css v1.2.0 | MIT License | github.com/andrewh0/okcss */@import url("https://rsms.me/inter/inter.css"); +/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15}body{margin:0}main{display:block}h1{font-size:2em;margin:.67em 0}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}img{border-style:none}button,input,optgroup,select,textarea{font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring,button:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details{display:block}summary{display:list-item}[hidden],template{display:none}:root{--ok-sans:"Inter",system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen,Ubuntu,Cantarell,"Open Sans","Helvetica Neue","Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--ok-mono:SFMono-Regular,Menlo,Monaco,Consolas,"Ubuntu Mono","Liberation Mono","Courier New",Courier,monospace;--ok-fw-0:400;--ok-fw-1:600;--ok-fw-2:700;--ok-fw-3:700;--ok-fs-0:2.5rem;--ok-fs-1:2rem;--ok-fs-2:1.5rem;--ok-fs-3:1.25rem;--ok-fs-4:1rem;--ok-fs-5:0.75rem;--ok-br:0.25rem;--ok-s-0:0;--ok-s-1:0.25rem;--ok-s-2:0.5rem;--ok-s-3:1rem;--ok-s-4:1.5rem;--ok-s-5:2rem;--ok-s-6:2.5rem;--ok-lh-body:1.5;--ok-lh-heading:1.25;--ok-t-hl:#ffcf30;--ok-accent-0:#3e67fa;--ok-accent-1:#4788ff;--ok-tc-accent:#3173de;--ok-tc-code:#c23a30;--ok-tc-0:#000;--ok-tc-1:#747474;--ok-tc-2:#848484;--ok-bg-0:#fff;--ok-bg-1:#f0f0f0;--ok-bg-2:#ccc;--ok-b-0:1px solid #cbcbcb;--ok-b-1:1px solid #848484;--ok-down-0:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' height='8' viewBox='0 0 12 8' width='24' fill='none'%3E%3Cpath d='M6 6l4-4h1v1-1L6 7 1 2h1l4 4z' fill='%23747474'/%3E%3C/svg%3E");--ok-down-1:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' height='8' viewBox='0 0 12 8' width='24' fill='none'%3E%3Cpath d='M6 6l4-4h1v1-1L6 7 1 2h1l4 4z' fill='%23848484'/%3E%3C/svg%3E")}@media (prefers-color-scheme:dark){:root{--ok-tc-accent:#5c9aff;--ok-tc-code:#ed5853;--ok-tc-0:#fff;--ok-tc-1:#ababab;--ok-tc-2:#929292;--ok-bg-0:#000;--ok-bg-1:#212121;--ok-bg-2:#3e3e3e;--ok-b-0:1px solid #747474;--ok-b-1:1px solid #929292;--ok-down-0:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' height='8' viewBox='0 0 12 8' width='24' fill='none'%3E%3Cpath d='M6 6l4-4h1v1-1L6 7 1 2h1l4 4z' fill='%23ababab'/%3E%3C/svg%3E");--ok-down-1:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' height='8' viewBox='0 0 12 8' width='24' fill='none'%3E%3Cpath d='M6 6l4-4h1v1-1L6 7 1 2h1l4 4z' fill='%23929292'/%3E%3C/svg%3E")}}*,:after,:before{box-sizing:border-box}*{margin:0;padding:0}html{font-family:var(--ok-sans);line-sizing:normal;line-height:var(--ok-lh-body);font-weight:var(--ok-fw-0);color:var(--ok-tc-0);background-color:var(--ok-bg-0);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-text-size-adjust:100%;-moz-text-size-adjust:100%;-ms-text-size-adjust:100%;text-size-adjust:100%;text-rendering:optimizeLegibility;scroll-behavior:smooth}@supports (font-variation-settings:normal){html{font-family:Inter var,var(--ok-sans)}}button,input,optgroup,select,textarea{font-family:inherit;line-height:var(--ok-lh-body)}[role=button],button{cursor:pointer}audio,canvas,embed,iframe,img,input,object,select,svg,textarea,video{display:block}img,video{max-width:100%;height:auto}body{padding:var(--ok-s-3);max-width:80ch;margin:auto}article{padding-bottom:var(--ok-s-6)}h1{font-size:var(--ok-fs-0);margin:0}h2{font-size:var(--ok-fs-1)}h3{font-size:var(--ok-fs-2)}h4{font-size:var(--ok-fs-3)}h5{font-size:var(--ok-fs-4)}h6{font-size:var(--ok-fs-5);text-transform:uppercase;font-weight:var(--ok-fw-1)}h1,h2,h3,h4,h5,h6{line-height:var(--ok-lh-heading);font-weight:var(--ok-fw-3);margin-top:var(--ok-s-6);margin-bottom:var(--ok-s-3)}h1+*,h2+*,h3+*,h4+*,h5+*,h6+*,hr+*{margin-top:0}p{font-size:var(--ok-fs-4)}small{font-size:var(--ok-fs-5)}b,dt,strong{font-weight:var(--ok-fw-2)}address,article,aside,audio,blockquote,button,canvas,dd,details,dialog,div,dl,embed,fieldset,figcaption,figure,footer,form,header,hgroup,hr,iframe,img,input,main,nav,object,ol,p,pre,section,select,summary,svg,table,textarea,ul,video{margin-bottom:var(--ok-s-4)}address:last-child,article:last-child,aside:last-child,blockquote:last-child,dd:last-child,details:last-child,dialog:last-child,div:last-child,dl:last-child,dt:last-child,fieldset:last-child,figcaption:last-child,figure:last-child,footer:last-child,form:last-child,h1:last-child,h2:last-child,h3:last-child,h4:last-child,h5:last-child,h6:last-child,header:last-child,hgroup:last-child,hr:last-child,input[type=checkbox],input[type=radio],main:last-child,nav:last-child,ol:last-child,p:last-child,pre:last-child,section:last-child,table:last-child,ul:last-child{margin-bottom:0}fieldset{padding:var(--ok-s-3);border:var(--ok-b-0);border-radius:var(--ok-br)}legend{font-weight:var(--ok-fw-1);text-transform:uppercase;font-size:var(--ok-fs-5)}input,select{padding:var(--ok-s-2);background:var(--ok-bg-0);border:var(--ok-b-0);border-radius:var(--ok-br);color:var(--ok-tc-0);min-width:25ch}input:disabled,select:disabled,textarea:disabled{color:var(--ok-tc-2)}input::placeholder,textarea::placeholder{color:var(--ok-tc-2)}input::-webkit-input-placeholder,textarea::-webkit-input-placeholder{color:var(--ok-tc-2)}input::-moz-placeholder,textarea::-moz-placeholder{color:var(--ok-tc-2)}input:-ms-input-placeholder,textarea:-ms-input-placeholder{color:var(--ok-tc-2)}input::-ms-input-placeholder,textarea::-ms-input-placeholder{color:var(--ok-tc-2)}input::-webkit-clear-button,input::-webkit-inner-spin-button,input::-webkit-search-cancel-button,input::-webkit-search-results-button{display:none}input::-ms-clear,input::-ms-reveal{display:none}input:disabled,textarea:disabled{background-color:var(--ok-bg-1)}input[type=search]{-webkit-appearance:none;-moz-appearance:none;appearance:none}input[type=file]{max-width:300px}input[type=number]{-moz-appearance:textfield}input[type=checkbox],input[type=radio]{display:inline;min-width:auto}input[type=color]{height:2.5rem}input[type=date],input[type=datetime-local],input[type=month],input[type=time],input[type=week]{height:2.5rem;-webkit-appearance:none;-moz-appearance:none;appearance:none;position:relative}input[type=date]:before,input[type=datetime-local]:before,input[type=month]:before,input[type=time]:before,input[type=week]:before{position:absolute;right:0;top:0;background-image:var(--ok-down-0);background-repeat:no-repeat;background-position:right .2em top 50%;background-size:2em auto;width:2.5rem;height:calc(2.5rem - 2px);content:""}input[type=date]:disabled:before,input[type=datetime-local]:disabled:before,input[type=month]:disabled:before,input[type=time]:disabled:before,input[type=week]:disabled:before{background-image:var(--ok-down-1)}input::-webkit-calendar-picker-indicator{position:absolute;top:0;right:0;background-color:transparent;cursor:pointer;padding:0;width:2.5rem;height:calc(2.5rem - 2px);content:"";opacity:0}input[type=range]{overflow:visible;line-height:inherit;font-family:inherit;-webkit-appearance:none;-moz-appearance:none;appearance:none;margin:0;outline:none;cursor:pointer;padding:0;vertical-align:middle;border:none;min-height:2rem;background-color:transparent}input[type=range]::-webkit-slider-runnable-track{cursor:pointer;-webkit-appearance:none;border-radius:var(--ok-br);border:var(--ok-b-0);background-color:var(--ok-bg-1);background-image:linear-gradient(var(--ok-bg-1),var(--ok-bg-1));width:100%;height:.5rem;color:transparent;box-sizing:border-box;position:relative}input[type=range]::-moz-range-track{cursor:pointer;-moz-appearance:none;border-radius:var(--ok-br);border:var(--ok-b-0);background-color:var(--ok-bg-1);background-image:linear-gradient(var(--ok-bg-1),var(--ok-bg-1));width:100%;height:.5rem;color:transparent;box-sizing:border-box}input[type=range]::-ms-track{cursor:pointer;-ms-appearance:none;border-radius:var(--ok-br);border:var(--ok-b-0);background-color:var(--ok-bg-1);background-image:linear-gradient(var(--ok-bg-1),var(--ok-bg-1));width:100%;height:.5rem;color:transparent;box-sizing:border-box}input[type=range]::-ms-fill-lower{background:transparent}input[type=range]::-webkit-slider-thumb{cursor:pointer;-webkit-appearance:none;border-radius:50%;background-color:var(--ok-accent-0);width:1.5rem;height:1.5rem;margin-top:calc(-.5rem - 1px)}input[type=range]::-moz-range-thumb{cursor:pointer;-moz-appearance:none;border:none;border-radius:50%;background-color:var(--ok-accent-0);width:1.5rem;height:1.5rem}input[type=range]::-ms-thumb{cursor:pointer;-ms-appearance:none;border-radius:50%;background-color:var(--ok-accent-0);width:1.5rem;height:1.5rem;transform:translateY(.25rem)}input[type=range]:focus:not(:disabled)::-webkit-slider-thumb{background-color:var(--ok-accent-1)}input[type=range]:focus:not(:disabled)::-moz-range-thumb{background-color:var(--ok-accent-1)}input[type=range]:focus:not(:disabled)::-ms-thumb{background-color:var(--ok-accent-1)}input[type=range]:disabled{cursor:default}input[type=range]:disabled::-webkit-slider-runnable-track{cursor:default}input[type=range]:disabled::-moz-range-track{cursor:default}input[type=range]:disabled::-ms-track{cursor:default}input[type=range]:disabled::-webkit-slider-thumb{background-color:var(--ok-bg-2);cursor:default}input[type=range]:disabled::-moz-range-thumb{background-color:var(--ok-bg-2);cursor:default}input[type=range]:disabled::-ms-thumb{background-color:var(--ok-bg-2);cursor:default}select{-webkit-appearance:none;-moz-appearance:none;appearance:none;border:var(--ok-b-0);border-radius:var(--ok-br);background-color:var(--ok-bg-0);min-height:2.5rem;color:var(--ok-tc-0)}select:not([multiple]){background-image:var(--ok-down-0);background-repeat:no-repeat,repeat;background-position:right .2em top 50%;background-size:2em auto;padding-right:2.5em;height:2.5rem}select::-ms-expand{display:none}select:not([multiple]):disabled{background-image:var(--ok-down-1);background-color:var(--ok-bg-1);cursor:default}select[multiple]{border-radius:var(--ok-br)}select[multiple]:disabled{background-color:var(--ok-bg-1)}select[multiple] option{color:var(--ok-t-)}select[multiple]:disabled option{color:var(--ok-tc-2)}textarea{padding:var(--ok-s-2);resize:vertical;background:var(--ok-bg-0);border:var(--ok-b-0);border-radius:var(--ok-br);color:var(--ok-tc-0);min-height:calc(2.5rem - 2px);min-width:25ch}button,input[type=button],input[type=reset],input[type=submit]{display:inline-block;background-color:var(--ok-accent-0);border-radius:var(--ok-br);color:#fff;font-weight:var(--ok-fw-1);height:2.5rem;border:none;padding:var(--ok-s-2) var(--ok-s-3);white-space:nowrap;min-width:auto}input::-webkit-file-upload-button{display:inline-block;background-color:var(--ok-accent-0);border-radius:var(--ok-br);color:#fff;font-weight:var(--ok-fw-1);height:2.5rem;border:none;padding:var(--ok-s-2) var(--ok-s-3);white-space:nowrap}input:disabled::-webkit-file-upload-button{cursor:default;opacity:.5}button,input[type=button],input[type=reset],input[type=submit]{cursor:pointer}input:not(:disabled)::-webkit-file-upload-button{cursor:pointer}button:disabled,input[type=button]:disabled,input[type=reset]:disabled,input[type=submit]:disabled{cursor:default;opacity:.5;background-color:var(--ok-accent-0)}button:focus:not(:disabled),input[type=button]:focus:not(:disabled),input[type=reset]:focus:not(:disabled),input[type=submit]:focus:not(:disabled){background-color:var(--ok-accent-1)}input:not(:disabled):focus::-webkit-file-upload-button{background-color:var(--ok-accent-1)}table{border-collapse:collapse;display:table;margin-left:auto;margin-right:auto;white-space:nowrap}tfoot,thead{border:var(--ok-b-0)}thead{position:-webkit-sticky;position:sticky;top:0}tfoot tr,thead tr{background-color:var(--ok-bg-1);font-size:var(--ok-fs-5);text-transform:uppercase;color:var(--ok-tc-0)}td,th{border:var(--ok-b-0) 0;text-align:left;padding:.5rem}td{white-space:normal;max-width:20ch}tr{border:var(--ok-b-0)}table caption{font-size:var(--ok-fs-4);font-weight:var(--ok-fw-3);padding:.5rem}code,samp{padding:.2em .4em;color:var(--ok-tc-code)}code,pre,samp{font-family:var(--ok-mono);font-size:87.5%;line-height:var(--ok-lh-body);background-color:var(--ok-bg-1);border-radius:var(--ok-br);text-transform:none}pre{padding:var(--ok-s-3);white-space:pre;overflow-x:auto}pre,var{color:var(--ok-tc-0)}var{font-family:var(--ok-mono);font-style:normal}code pre,pre code{background:inherit;font-size:inherit;color:inherit;border:0;padding:0;margin:0}code pre{display:inline}kbd{background-color:var(--ok-bg-1);border:var(--ok-b-0);border-radius:var(--ok-br);border-bottom:2px solid var(--ok-bg-2);padding:var(--ok-s-1);font-family:var(--ok-sans);color:var(--ok-tc-0)}a{text-decoration:none;font-weight:var(--ok-fw-1)}a,a:visited,a code,a mark,a samp{color:var(--ok-tc-accent)}ol,ul{padding-left:var(--ok-s-5)}nav ul{text-decoration:none;padding-left:0}nav ul li{display:inline;margin-right:1em}li p{margin-bottom:0}li,li p+p{margin-top:.5em}audio,img,video{margin-left:auto;margin-right:auto}img{border-radius:var(--ok-br)}figure>img:not(:last-child){margin-bottom:var(--ok-s-1)}figure>figcaption{text-align:center}figcaption,time{font-size:var(--ok-fs-5);color:var(--ok-tc-1)}mark{padding:.2em .4em;background:var(--ok-t-hl);color:#000;border-radius:var(--ok-br)}iframe{border:var(--ok-b-0);border-radius:var(--ok-br);width:100%}hr{border:none;border-bottom:var(--ok-b-0)}footer{font-size:var(--ok-fs-5)}blockquote,footer{color:var(--ok-tc-1)}blockquote{position:relative;margin-left:0;margin-right:0;padding-left:var(--ok-s-5)}blockquote:before{position:absolute;height:100%;content:"";width:4px;left:0;border-radius:var(--ok-br);background-color:var(--ok-bg-1)}dd{padding-left:var(--ok-s-5)}abbr{cursor:help}@media (hover:hover){a:hover{text-decoration:underline}input:hover:not(:disabled):not(:focus):not([type=submit]):not([type=button]):not([type=reset]):not([type=range]),select:hover:not(:disabled):not(:focus),textarea:hover:not(:disabled):not(:focus){border:var(--ok-b-1)}input[type=range]:hover:not(:disabled)::-webkit-slider-runnable-track{border:var(--ok-b-1)}input[type=range]:hover:not(:disabled)::-moz-range-track{border:var(--ok-b-1)}input[type=range]:hover:not(:disabled)::-ms-track{border:var(--ok-b-1)}select:not([multiple]):not(:disabled):hover{cursor:pointer}button:hover:not(:disabled),input[type=button]:hover:not(:disabled),input[type=reset]:hover:not(:disabled),input[type=submit]:hover:not(:disabled){background-color:var(--ok-accent-1)}input:not(:disabled):hover::-webkit-file-upload-button{background-color:var(--ok-accent-1)}} \ No newline at end of file diff --git a/3rdparty/expat/doc/reference.html b/3rdparty/expat/doc/reference.html index 1e4780ed70c63..450fea84c29f5 100644 --- a/3rdparty/expat/doc/reference.html +++ b/3rdparty/expat/doc/reference.html @@ -3,26 +3,58 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + Expat XML Parser + - - - - - - - - - -
(Expat logo)
Release 2.0.1
+
+

+ The Expat XML Parser + Release 2.6.4 +

+

Expat is a library, written in C, for parsing XML documents. It's @@ -38,11 +70,11 @@

This is free software, licensed under the MIT/X Consortium license. You may download it -from the Expat home page. +from the Expat home page.

The bulk of this document was originally commissioned as an article -by XML.com. They graciously allowed +by XML.com. They graciously allowed Clark Cooper to retain copyright and to distribute it with Expat. This version has been substantially extended to include documentation on features which have been added since the original article was @@ -120,6 +152,14 @@

Table of Contents

  • XML_GetInputContext
  • +
  • + Attack Protection + +
  • Miscellaneous Functions
    • XML_SetUserData
    • @@ -268,7 +308,7 @@

      Building and Installing Expat

      The Expat distribution comes as a compressed (with GNU gzip) tar file. You may download the latest version from Source Forge. After +"https://sourceforge.net/projects/expat/" >Source Forge. After unpacking this, cd into the directory. Then follow either the Win32 directions or Unix directions below.

      @@ -279,7 +319,7 @@

      Building under Win32

      Developer Studio installed, you can use CMake to generate a .sln file, e.g. -cmake -G"Visual Studio 15 2017" -DCMAKE_BUILD_TYPE=RelWithDebInfo . +cmake -G"Visual Studio 16 2019" -DCMAKE_BUILD_TYPE=RelWithDebInfo . , and build Expat using msbuild /m expat.sln after.

      Alternatively, you may download the Win32 binary package that @@ -316,39 +356,67 @@

      Building under Unix (or GNU)

      Configuring Expat Using the Pre-Processor

      Expat's feature set can be configured using a small number of -pre-processor definitions. The definition of this symbols does not -affect the set of entry points for Expat, only the behavior of the API -and the definition of character types in the case of -XML_UNICODE_WCHAR_T. The symbols are:

      +pre-processor definitions. The symbols are:

      -
      XML_DTD
      +
      XML_GE
      +
      +Added in Expat 2.6.0. +Include support for +general entities +(syntax &e1; to reference and +syntax <!ENTITY e1 'value1'> (an internal general entity) or +<!ENTITY e2 SYSTEM 'file2'> (an external general entity) to declare). +With XML_GE enabled, general entities will be replaced by their declared replacement text; +for this to work for external general entities, in addition an +XML_ExternalEntityRefHandler must be set using +XML_SetExternalEntityRefHandler. +Also, enabling XML_GE makes +the functions +XML_SetBillionLaughsAttackProtectionMaximumAmplification and + +XML_SetBillionLaughsAttackProtectionActivationThreshold available. +
      +With XML_GE disabled, Expat has a smaller memory footprint and can be faster, but will +not load external general entities and will replace all general entities +(except the predefined five: +amp, apos, gt, lt, quot) +with a self-reference: +for example, referencing an entity e1 via &e1; will be replaced +by text &e1;. +
      + +
      XML_DTD
      Include support for using and reporting DTD-based content. If this is defined, default attribute values from an external DTD subset are reported and attribute value normalization occurs based on the type of attributes defined in the external subset. Without this, Expat has a smaller memory footprint and can be faster, but will -not load external entities or process conditional sections. This does -not affect the set of functions available in the API.
      - -
      XML_NS
      +not load external parameter entities or process conditional sections. If defined, makes +the functions +XML_SetBillionLaughsAttackProtectionMaximumAmplification and + +XML_SetBillionLaughsAttackProtectionActivationThreshold available. + +
      XML_NS
      When defined, support for the Namespaces in XML +"https://www.w3.org/TR/REC-xml-names/" >Namespaces in XML specification is included.
      -
      XML_UNICODE
      +
      XML_UNICODE
      When defined, character data reported to the application is encoded in UTF-16 using wide characters of the type XML_Char. This is implied if XML_UNICODE_WCHAR_T is defined.
      -
      XML_UNICODE_WCHAR_T
      +
      XML_UNICODE_WCHAR_T
      If defined, causes the XML_Char character type to be defined using the wchar_t type; otherwise, unsigned short is used. Defining this implies XML_UNICODE.
      -
      XML_LARGE_SIZE
      +
      XML_LARGE_SIZE
      If defined, causes the XML_Size and XML_Index integer types to be at least 64 bits in size. This is intended to support processing of very large input streams, where the return values of @@ -358,23 +426,23 @@

      Configuring Expat Using the Pre-Processor

      could overflow. It may not be supported by all compilers, and is turned off by default.
      -
      XML_CONTEXT_BYTES
      +
      XML_CONTEXT_BYTES
      The number of input bytes of markup context which the parser will ensure are available for reporting via XML_GetInputContext. This is -normally set to 1024, and must be set to a positive integer. If this -is not defined, the input context will not be available and XML_GetInputContext will -always report NULL. Without this, Expat has a smaller memory +always report NULL. Without this, Expat has a smaller memory footprint and can be faster.
      -
      XML_STATIC
      +
      XML_STATIC
      On Windows, this should be set if Expat is going to be linked statically with the code that calls it; this is required to get all the right MSVC magic annotations correct. This is ignored on other platforms.
      -
      XML_ATTR_INFO
      +
      XML_ATTR_INFO
      If defined, makes the additional function XML_GetAttributeInfo available for reporting attribute byte offsets.
      @@ -628,8 +696,9 @@

      Namespace Processing

      tag handler and the EndNamespaceDeclHandler is called after the corresponding end tag that ends the namespace's scope. The namespace start handler gets passed the prefix and URI for the namespace. For a -default namespace declaration (xmlns='...'), the prefix will be null. -The URI will be null for the case where the default namespace is being +default namespace declaration (xmlns='...'), the prefix will be +NULL. +The URI will be NULL for the case where the default namespace is being unset. The namespace end handler just gets the prefix for the closing scope.

      @@ -758,7 +827,7 @@

      Temporarily Stopping Parsing

      include

        -
      • Supporting the Supporting the XInclude specification.
      • Delaying further processing until additional information is @@ -900,24 +969,30 @@

        Expat Reference

        Parser Creation

        -
        +

        XML_ParserCreate

        +
         XML_Parser XMLCALL
         XML_ParserCreate(const XML_Char *encoding);
         
        -Construct a new parser. If encoding is non-null, it specifies a +

        +Construct a new parser. If encoding is non-NULL, it specifies a character encoding to use for the document. This overrides the document encoding declaration. There are four built-in encodings: +

        • US-ASCII
        • UTF-8
        • UTF-16
        • ISO-8859-1
        +

        Any other value will invoke a call to the UnknownEncodingHandler. +

        -
        +

        XML_ParserCreateNS

        +
         XML_Parser XMLCALL
         XML_ParserCreateNS(const XML_Char *encoding,
                            XML_Char sep);
        @@ -936,7 +1011,16 @@ 

        Parser Creation

        to support RDF processors. It is a programming error to use the null separator with namespace triplets.
  • -
    +

    Note: +Expat does not validate namespace URIs (beyond encoding) +against RFC 3986 today (and is not required to do so with regard to +the XML 1.0 namespaces specification) but it may start doing that +in future releases. Before that, an application using Expat must +be ready to receive namespace URIs containing non-URI characters. +

    + +

    XML_ParserCreate_MM

    +
     XML_Parser XMLCALL
     XML_ParserCreate_MM(const XML_Char *encoding,
                         const XML_Memory_Handling_Suite *ms,
    @@ -951,14 +1035,15 @@ 

    Parser Creation

    Construct a new parser using the suite of memory handling functions -specified in ms. If ms is NULL, then use the +specified in ms. If ms is NULL, then use the standard set of memory management functions. If sep is -non NULL, then namespace processing is enabled in the created parser +non-NULL, then namespace processing is enabled in the created parser and the character pointed at by sep is used as the separator between the namespace URI and the local part of the name.

    -
    +

    XML_ExternalEntityParserCreate

    +
     XML_Parser XMLCALL
     XML_ExternalEntityParserCreate(XML_Parser p,
                                    const XML_Char *context,
    @@ -974,7 +1059,8 @@ 

    Parser Creation

    differently than the parent parser). -
    +

    XML_ParserFree

    +
     void XMLCALL
     XML_ParserFree(XML_Parser p);
     
    @@ -983,7 +1069,8 @@

    Parser Creation

    freeing any memory associated with user data. -
    +

    XML_ParserReset

    +
     XML_Bool XMLCALL
     XML_ParserReset(XML_Parser p,
                     const XML_Char *encoding);
    @@ -1014,7 +1101,7 @@ 

    Parsing

    XML_ExternalEntityParserCreate.

    -

    Note: the len argument passed to these functions +

    Note: The len argument passed to these functions should be considerably less than the maximum value for an integer, as it could create an integer overflow situation if the added lengths of a buffer and the unprocessed portion of the previous buffer @@ -1022,7 +1109,13 @@

    Parsing

    will remain unprocessed if it is part of an XML token for which the end is not part of that buffer.

    -
    +

    The application must make a concluding +XML_Parse or +XML_ParseBuffer call +with isFinal set to XML_TRUE.

    + +

    XML_Parse

    +
     enum XML_Status XMLCALL
     XML_Parse(XML_Parser p,
               const char *s,
    @@ -1036,42 +1129,86 @@ 

    Parsing

    };
    +

    Parse some more of the document. The string s is a buffer containing part (or perhaps all) of the document. The number of bytes of s that are part of the document is indicated by len. This means -that s doesn't have to be null terminated. It also means that +that s doesn't have to be null-terminated. It also means that if len is larger than the number of bytes in the block of -memory that s points at, then a memory fault is likely. The +memory that s points at, then a memory fault is likely. +Negative values for len are rejected since Expat 2.2.1. +The isFinal parameter informs the parser that this is the last piece of the document. Frequently, the last piece is empty (i.e. len is zero.) +

    + +

    If a parse error occurred, it returns XML_STATUS_ERROR. Otherwise it returns XML_STATUS_OK value. +Note that regardless of the return value, there is no guarantee that all +provided input has been parsed; only after the +concluding call will all handler callbacks and parsing errors have +happened. +

    + +

    +Simplified, XML_Parse can be considered a convenience wrapper +that is pairing calls +to XML_GetBuffer +and XML_ParseBuffer +(when Expat is built with macro XML_CONTEXT_BYTES +defined to a positive value, which is both common and default). +XML_Parse is then functionally equivalent to calling +XML_GetBuffer, +memcpy, and +XML_ParseBuffer. +

    + +

    +To avoid double copying of the input, direct use of functions +XML_GetBuffer and +XML_ParseBuffer is advised +for most production use, e.g. +if you're using read or similar functionality to fill your +buffers, fill directly into the buffer from +XML_GetBuffer, +then parse with XML_ParseBuffer. +

    -
    +

    XML_ParseBuffer

    +
     enum XML_Status XMLCALL
     XML_ParseBuffer(XML_Parser p,
                     int len,
                     int isFinal);
     
    +

    This is just like XML_Parse, except in this case Expat provides the buffer. By obtaining the buffer from Expat with the XML_GetBuffer function, the application can avoid double copying of the input. +

    + +

    +Negative values for len are rejected since Expat 2.6.3. +

    -
    +

    XML_GetBuffer

    +
     void * XMLCALL
     XML_GetBuffer(XML_Parser p,
                   int len);
     
    Obtain a buffer of size len to read a piece of the document -into. A NULL value is returned if Expat can't allocate enough memory for -this buffer. This has to be called prior to every call to +into. A NULL value is returned if Expat can't allocate enough memory for +this buffer. A NULL value may also be returned if len is zero. +This has to be called prior to every call to XML_ParseBuffer. A typical use would look like this: @@ -1098,7 +1235,8 @@

    Parsing

    -
    +

    XML_StopParser

    +
     enum XML_Status XMLCALL
     XML_StopParser(XML_Parser p,
                    XML_Bool resumable);
    @@ -1111,7 +1249,7 @@ 

    Parsing

    call-back handler, except when aborting (when resumable is XML_FALSE) an already suspended parser. Some call-backs may still follow because they would otherwise get -lost, including +lost, including

    • the end element handler for empty elements when stopped in the start element handler,
    • @@ -1120,7 +1258,7 @@

      Parsing

    • the character data handler when stopped in the character data handler while making multiple call-backs on a contiguous chunk of characters,
    -and possibly others.

    +

    and possibly others.

    This can be called from most handlers, including DTD related call-backs, except when parsing an external parameter entity and @@ -1166,7 +1304,8 @@

    Parsing

    New in Expat 1.95.8.

    -
    +

    XML_ResumeParser

    +
     enum XML_Status XMLCALL
     XML_ResumeParser(XML_Parser p);
     
    @@ -1191,7 +1330,8 @@

    Parsing

    New in Expat 1.95.8.

    -
    +

    XML_GetParsingStatus

    +
     void XMLCALL
     XML_GetParsingStatus(XML_Parser p,
                          XML_ParsingStatus *status);
    @@ -1213,7 +1353,7 @@ 

    Parsing

    Returns status of parser with respect to being initialized, parsing, finished, or suspended, and whether the final buffer is being processed. The status parameter must not be -NULL.

    +NULL.

    New in Expat 1.95.8.

    @@ -1228,7 +1368,7 @@

    Handler Setting

    way it could do this is to set the character handler when a para start tag is seen, and unset it for the corresponding end tag.

    -

    A handler may be unset by providing a NULL pointer to the +

    A handler may be unset by providing a NULL pointer to the appropriate handler setter. None of the handler setting functions have a return value.

    @@ -1240,7 +1380,8 @@

    Handler Setting

    encoding of the document.

    -
    +

    XML_SetStartElementHandler

    +
     void XMLCALL
     XML_SetStartElementHandler(XML_Parser p,
                                XML_StartElementHandler start);
    @@ -1255,13 +1396,14 @@ 

    Handler Setting

    handler as a pointer to a vector of char pointers. Each attribute seen in a start (or empty) tag occupies 2 consecutive places in this vector: the attribute name followed by the attribute value. These pairs are terminated -by a null pointer.

    +by a NULL pointer.

    Note that an empty tag generates a call to both start and end handlers (in that order).

    -
    +

    XML_SetEndElementHandler

    +
     void XMLCALL
     XML_SetEndElementHandler(XML_Parser p,
                              XML_EndElementHandler);
    @@ -1276,7 +1418,8 @@ 

    Handler Setting

    -
    +

    XML_SetElementHandler

    +
     void XMLCALL
     XML_SetElementHandler(XML_Parser p,
                           XML_StartElementHandler start,
    @@ -1286,7 +1429,8 @@ 

    Handler Setting

    -
    +

    XML_SetCharacterDataHandler

    +
     void XMLCALL
     XML_SetCharacterDataHandler(XML_Parser p,
                                 XML_CharacterDataHandler charhndl)
    @@ -1302,14 +1446,15 @@ 

    Handler Setting

    to deal with the end of the string. A single block of contiguous text free of markup may still result in a sequence of calls to this handler. In other words, if you're searching for a pattern in the text, it may -be split across calls to this handler. Note: Setting this handler to NULL +be split across calls to this handler. Note: Setting this handler to NULL may NOT immediately terminate call-backs if the parser is currently processing such a single block of contiguous markup-free text, as the parser will continue calling back until the end of the block is reached.

    -
    +

    XML_SetProcessingInstructionHandler

    +
     void XMLCALL
     XML_SetProcessingInstructionHandler(XML_Parser p,
                                         XML_ProcessingInstructionHandler proc)
    @@ -1327,7 +1472,8 @@ 

    Handler Setting

    -
    +

    XML_SetCommentHandler

    +
     void XMLCALL
     XML_SetCommentHandler(XML_Parser p,
                           XML_CommentHandler cmnt)
    @@ -1342,7 +1488,8 @@ 

    Handler Setting

    -
    +

    XML_SetStartCdataSectionHandler

    +
     void XMLCALL
     XML_SetStartCdataSectionHandler(XML_Parser p,
                                     XML_StartCdataSectionHandler start);
    @@ -1355,7 +1502,8 @@ 

    Handler Setting

    -
    +

    XML_SetEndCdataSectionHandler

    +
     void XMLCALL
     XML_SetEndCdataSectionHandler(XML_Parser p,
                                   XML_EndCdataSectionHandler end);
    @@ -1368,7 +1516,8 @@ 

    Handler Setting

    -
    +

    XML_SetCdataSectionHandler

    +
     void XMLCALL
     XML_SetCdataSectionHandler(XML_Parser p,
                                XML_StartCdataSectionHandler start,
    @@ -1378,7 +1527,8 @@ 

    Handler Setting

    -
    +

    XML_SetDefaultHandler

    +
     void XMLCALL
     XML_SetDefaultHandler(XML_Parser p,
                           XML_DefaultHandler hndl)
    @@ -1409,7 +1559,8 @@ 

    Handler Setting

    -
    +

    XML_SetDefaultHandlerExpand

    +
     void XMLCALL
     XML_SetDefaultHandlerExpand(XML_Parser p,
                                 XML_DefaultHandler hndl)
    @@ -1429,7 +1580,8 @@ 

    Handler Setting

    -
    +

    XML_SetExternalEntityRefHandler

    +
     void XMLCALL
     XML_SetExternalEntityRefHandler(XML_Parser p,
                                     XML_ExternalEntityRefHandler hndl)
    @@ -1452,16 +1604,16 @@ 

    Handler Setting

    href="#XML_ExternalEntityParserCreate" >XML_ExternalEntityParserCreate. code is valid only until the handler returns, so if the referenced entity is -to be parsed later, it must be copied. context is NULL +to be parsed later, it must be copied. context is NULL only when the entity is a parameter entity, which is how one can differentiate between general and parameter entities.

    The base parameter is the base to use for relative system identifiers. It is set by XML_SetBase and may be NULL. The +href="#XML_SetBase">XML_SetBase and may be NULL. The publicId parameter is the public id given in the entity -declaration and may be NULL. systemId is the system -identifier specified in the entity declaration and is never NULL.

    +declaration and may be NULL. systemId is the system +identifier specified in the entity declaration and is never NULL.

    There are a couple of ways in which this handler differs from others. First, this handler returns a status indicator (an @@ -1482,17 +1634,18 @@

    Handler Setting

    information into global or static variables.

    -
    +

    XML_SetExternalEntityRefHandlerArg

    +
     void XMLCALL
     XML_SetExternalEntityRefHandlerArg(XML_Parser p,
                                        void *arg)
     

    Set the argument passed to the ExternalEntityRefHandler. If -arg is not NULL, it is the new value passed to the +arg is not NULL, it is the new value passed to the handler set using XML_SetExternalEntityRefHandler; if arg is -NULL, the argument passed to the handler function will be the parser +NULL, the argument passed to the handler function will be the parser object itself.

    Note: @@ -1508,7 +1661,8 @@

    Handler Setting

    -
    +

    XML_SetSkippedEntityHandler

    +
     void XMLCALL
     XML_SetSkippedEntityHandler(XML_Parser p,
                                 XML_SkippedEntityHandler handler)
    @@ -1528,14 +1682,15 @@ 

    Handler Setting

    has been called.

    The is_parameter_entity argument will be non-zero for -a parameter entity and zero for a general entity.

    Note: skipped +a parameter entity and zero for a general entity.

    Note: Skipped parameter entities in declarations and skipped general entities in attribute values cannot be reported, because the event would be out of sync with the reporting of the declarations or attribute values

    -
    +

    XML_SetUnknownEncodingHandler

    +
     void XMLCALL
     XML_SetUnknownEncodingHandler(XML_Parser p,
                                   XML_UnknownEncodingHandler enchandler,
    @@ -1573,18 +1728,19 @@ 

    Handler Setting

    If the value is -n, where n is an integer > 1, then n is the number of bytes in the sequence and the actual conversion is accomplished by a call to the function pointed at by convert. This function may return -1 -if the sequence itself is invalid. The convert pointer may be null if +if the sequence itself is invalid. The convert pointer may be NULL if there are only single byte codes. The data parameter passed to the convert function is the data pointer from XML_Encoding. The string s is NOT null-terminated and points at the sequence of bytes to be converted.

    The function pointed at by release is called by the -parser when it is finished with the encoding. It may be NULL.

    +parser when it is finished with the encoding. It may be NULL.

    -
    +

    XML_SetStartNamespaceDeclHandler

    +
     void XMLCALL
     XML_SetStartNamespaceDeclHandler(XML_Parser p,
     			         XML_StartNamespaceDeclHandler start);
    @@ -1602,7 +1758,8 @@ 

    Handler Setting

    -
    +

    XML_SetEndNamespaceDeclHandler

    +
     void XMLCALL
     XML_SetEndNamespaceDeclHandler(XML_Parser p,
     			       XML_EndNamespaceDeclHandler end);
    @@ -1619,7 +1776,8 @@ 

    Handler Setting

    -
    +

    XML_SetNamespaceDeclHandler

    +
     void XMLCALL
     XML_SetNamespaceDeclHandler(XML_Parser p,
                                 XML_StartNamespaceDeclHandler start,
    @@ -1629,7 +1787,8 @@ 

    Handler Setting

    -
    +

    XML_SetXmlDeclHandler

    +
     void XMLCALL
     XML_SetXmlDeclHandler(XML_Parser p,
     		      XML_XmlDeclHandler xmldecl);
    @@ -1643,8 +1802,8 @@ 

    Handler Setting

    Sets a handler that is called for XML declarations and also for text declarations discovered in external entities. The way to -distinguish is that the version parameter will be NULL -for text declarations. The encoding parameter may be NULL +distinguish is that the version parameter will be NULL +for text declarations. The encoding parameter may be NULL for an XML declaration. The standalone argument will contain -1, 0, or 1 indicating respectively that there was no standalone parameter in the declaration, that it was given as no, or @@ -1652,7 +1811,8 @@

    Handler Setting

    -
    +

    XML_SetStartDoctypeDeclHandler

    +
     void XMLCALL
     XML_SetStartDoctypeDeclHandler(XML_Parser p,
     			       XML_StartDoctypeDeclHandler start);
    @@ -1667,12 +1827,13 @@ 

    Handler Setting

    Set a handler that is called at the start of a DOCTYPE declaration, before any external or internal subset is parsed. Both sysid -and pubid may be NULL. The has_internal_subset +and pubid may be NULL. The has_internal_subset will be non-zero if the DOCTYPE declaration has an internal subset.

    -
    +

    XML_SetEndDoctypeDeclHandler

    +
     void XMLCALL
     XML_SetEndDoctypeDeclHandler(XML_Parser p,
     			     XML_EndDoctypeDeclHandler end);
    @@ -1686,7 +1847,8 @@ 

    Handler Setting

    -
    +

    XML_SetDoctypeDeclHandler

    +
     void XMLCALL
     XML_SetDoctypeDeclHandler(XML_Parser p,
     			  XML_StartDoctypeDeclHandler start,
    @@ -1696,7 +1858,8 @@ 

    Handler Setting

    -
    +

    XML_SetElementDeclHandler

    +
     void XMLCALL
     XML_SetElementDeclHandler(XML_Parser p,
     			  XML_ElementDeclHandler eldecl);
    @@ -1736,16 +1899,17 @@ 

    Handler Setting

    Sets a handler for element declarations in a DTD. The handler gets called with the name of the element in the declaration and a pointer -to a structure that contains the element model. It is the -application's responsibility to free this data structure using -XML_FreeContentModel.

    +to a structure that contains the element model. It's the user code's +responsibility to free model when finished with it. See +XML_FreeContentModel. +There is no need to free the model from the handler, it can be kept +around and freed at a later stage.

    The model argument is the root of a tree of XML_Content nodes. If type equals XML_CTYPE_EMPTY or XML_CTYPE_ANY, then quant will be XML_CQUANT_NONE, and the other -fields will be zero or NULL. If type is +fields will be zero or NULL. If type is XML_CTYPE_MIXED, then quant will be XML_CQUANT_NONE or XML_CQUANT_REP and numchildren will contain the number of elements that are @@ -1757,7 +1921,7 @@

    Handler Setting

    For type XML_CTYPE_NAME, the name field points to the name and the numchildren and -children fields will be zero and NULL. The +children fields will be zero and NULL. The quant field will indicate any quantifiers placed on the name.

    @@ -1768,7 +1932,8 @@

    Handler Setting

    -
    +

    XML_SetAttlistDeclHandler

    +
     void XMLCALL
     XML_SetAttlistDeclHandler(XML_Parser p,
                               XML_AttlistDeclHandler attdecl);
    @@ -1792,16 +1957,17 @@ 

    Handler Setting

    type in the declaration with whitespace removed.

    The dflt parameter holds the default value. It will be -NULL in the case of "#IMPLIED" or "#REQUIRED" attributes. You can +NULL in the case of "#IMPLIED" or "#REQUIRED" attributes. You can distinguish these two cases by checking the isrequired parameter, which will be true in the case of "#REQUIRED" attributes. Attributes which are "#FIXED" will have also have a true -isrequired, but they will have the non-NULL fixed value +isrequired, but they will have the non-NULL fixed value in the dflt parameter.

    -
    +

    XML_SetEntityDeclHandler

    +
     void XMLCALL
     XML_SetEntityDeclHandler(XML_Parser p,
     			 XML_EntityDeclHandler handler);
    @@ -1823,19 +1989,20 @@ 

    Handler Setting

    case of parameter entities and zero otherwise.

    For internal entities (<!ENTITY foo "bar">), -value will be non-NULL and systemId, -publicId, and notationName will all be NULL. -The value string is not NULL terminated; the length is +value will be non-NULL and systemId, +publicId, and notationName will all be NULL. +The value string is not null-terminated; the length is provided in the value_length parameter. Do not use value_length to test for internal entities, since it is legal to have zero-length values. Instead check for whether or not -value is NULL.

    The notationName -argument will have a non-NULL value only for unparsed entity +value is NULL.

    The notationName +argument will have a non-NULL value only for unparsed entity declarations.

    -
    +

    XML_SetUnparsedEntityDeclHandler

    +
     void XMLCALL
     XML_SetUnparsedEntityDeclHandler(XML_Parser p,
                                      XML_UnparsedEntityDeclHandler h)
    @@ -1861,7 +2028,8 @@ 

    Handler Setting

    -
    +

    XML_SetNotationDeclHandler

    +
     void XMLCALL
     XML_SetNotationDeclHandler(XML_Parser p,
                                XML_NotationDeclHandler h)
    @@ -1878,7 +2046,8 @@ 

    Handler Setting

    -
    +

    XML_SetNotStandaloneHandler

    +
     void XMLCALL
     XML_SetNotStandaloneHandler(XML_Parser p,
                                 XML_NotStandaloneHandler h)
    @@ -1913,7 +2082,8 @@ 

    Parse position and error reporting functions

    DTD. In other words, they usually return bogus information when called from within a DTD declaration handler.

    -
    +

    XML_GetErrorCode

    +
     enum XML_Error XMLCALL
     XML_GetErrorCode(XML_Parser p);
     
    @@ -1921,7 +2091,8 @@

    Parse position and error reporting functions

    Return what type of error has occurred.
    -
    +

    XML_ErrorString

    +
     const XML_LChar * XMLCALL
     XML_ErrorString(enum XML_Error code);
     
    @@ -1931,7 +2102,8 @@

    Parse position and error reporting functions

    XML_GetErrorCode. -
    +

    XML_GetCurrentByteIndex

    +
     XML_Index XMLCALL
     XML_GetCurrentByteIndex(XML_Parser p);
     
    @@ -1942,7 +2114,8 @@

    Parse position and error reporting functions

    "#XML_GetCurrentColumnNumber" >XML_GetCurrentColumnNumber. -
    +

    XML_GetCurrentLineNumber

    +
     XML_Size XMLCALL
     XML_GetCurrentLineNumber(XML_Parser p);
     
    @@ -1951,7 +2124,8 @@

    Parse position and error reporting functions

    1. -
    +

    XML_GetCurrentColumnNumber

    +
     XML_Size XMLCALL
     XML_GetCurrentColumnNumber(XML_Parser p);
     
    @@ -1960,7 +2134,8 @@

    Parse position and error reporting functions

    the position. -
    +

    XML_GetCurrentByteCount

    +
     int XMLCALL
     XML_GetCurrentByteCount(XML_Parser p);
     
    @@ -1972,7 +2147,8 @@

    Parse position and error reporting functions

    separate start and end tags). -
    +

    XML_GetInputContext

    +
     const char * XMLCALL
     XML_GetInputContext(XML_Parser p,
                         int *offset,
    @@ -1994,8 +2170,117 @@ 

    Parse position and error reporting functions

    triggering a call spans over a very large amount of input, the actual parse position may be before the beginning of the buffer.

    -

    If XML_CONTEXT_BYTES is not defined, this will always -return NULL.

    +

    If XML_CONTEXT_BYTES is zero, this will always +return NULL.

    + + +

    Attack Protection

    + +

    XML_SetBillionLaughsAttackProtectionMaximumAmplification

    +
    +/* Added in Expat 2.4.0. */
    +XML_Bool XMLCALL
    +XML_SetBillionLaughsAttackProtectionMaximumAmplification(XML_Parser p,
    +                                                         float maximumAmplificationFactor);
    +
    +
    +

    + Sets the maximum tolerated amplification factor + for protection against + billion laughs attacks + (default: 100.0) + of parser p to maximumAmplificationFactor, and + returns XML_TRUE upon success and XML_FALSE upon error. +

    + + The amplification factor is calculated as .. +
    +    amplification := (direct + indirect) / direct
    +  
    + .. while parsing, whereas + direct is the number of bytes read from the primary document in parsing and + indirect is the number of bytes added by expanding entities and reading of external DTD files, combined. + +

    For a call to XML_SetBillionLaughsAttackProtectionMaximumAmplification to succeed:

    +
      +
    • parser p must be a non-NULL root parser (without any parent parsers) and
    • +
    • maximumAmplificationFactor must be non-NaN and greater than or equal to 1.0.
    • +
    + +

    + Note: + If you ever need to increase this value for non-attack payload, + please file a bug report. +

    + +

    + Note: + Peak amplifications + of factor 15,000 for the entire payload and + of factor 30,000 in the middle of parsing + have been observed with small benign files in practice. + + So if you do reduce the maximum allowed amplification, + please make sure that the activation threshold is still big enough + to not end up with undesired false positives (i.e. benign files being rejected). +

    +
    + +

    XML_SetBillionLaughsAttackProtectionActivationThreshold

    +
    +/* Added in Expat 2.4.0. */
    +XML_Bool XMLCALL
    +XML_SetBillionLaughsAttackProtectionActivationThreshold(XML_Parser p,
    +                                                        unsigned long long activationThresholdBytes);
    +
    +
    +

    + Sets number of output bytes (including amplification from entity expansion and reading DTD files) + needed to activate protection against + billion laughs attacks + (default: 8 MiB) + of parser p to activationThresholdBytes, and + returns XML_TRUE upon success and XML_FALSE upon error. +

    + +

    For a call to XML_SetBillionLaughsAttackProtectionActivationThreshold to succeed:

    +
      +
    • parser p must be a non-NULL root parser (without any parent parsers).
    • +
    + +

    + Note: + If you ever need to increase this value for non-attack payload, + please file a bug report. +

    + +

    + Note: + Activation thresholds below 4 MiB are known to break support for + DITA 1.3 payload + and are hence not recommended. +

    +
    + +

    XML_SetReparseDeferralEnabled

    +
    +/* Added in Expat 2.6.0. */
    +XML_Bool XMLCALL
    +XML_SetReparseDeferralEnabled(XML_Parser parser, XML_Bool enabled);
    +
    +
    +

    + Large tokens may require many parse calls before enough data is available for Expat to parse it in full. + If Expat retried parsing the token on every parse call, parsing could take quadratic time. + To avoid this, Expat only retries once a significant amount of new data is available. + This function allows disabling this behavior. +

    +

    + The enabled argument should be XML_TRUE or XML_FALSE. +

    +

    + Returns XML_TRUE on success, and XML_FALSE on error. +

    Miscellaneous functions

    @@ -2003,7 +2288,8 @@

    Miscellaneous functions

    The functions in this section either obtain state information from the parser or can be used to dynamically set parser options.

    -
    +

    XML_SetUserData

    +
     void XMLCALL
     XML_SetUserData(XML_Parser p,
                     void *userData);
    @@ -2018,7 +2304,8 @@ 

    Miscellaneous functions

    memory. -
    +

    XML_GetUserData

    +
     void * XMLCALL
     XML_GetUserData(XML_Parser p);
     
    @@ -2027,7 +2314,8 @@

    Miscellaneous functions

    It is actually implemented as a macro. -
    +

    XML_UseParserAsHandlerArg

    +
     void XMLCALL
     XML_UseParserAsHandlerArg(XML_Parser p);
     
    @@ -2038,7 +2326,8 @@

    Miscellaneous functions

    >XML_GetUserData function. -
    +

    XML_SetBase

    +
     enum XML_Status XMLCALL
     XML_SetBase(XML_Parser p,
                 const XML_Char *base);
    @@ -2050,7 +2339,8 @@ 

    Miscellaneous functions

    XML_STATUS_OK. -
    +

    XML_GetBase

    +
     const XML_Char * XMLCALL
     XML_GetBase(XML_Parser p);
     
    @@ -2058,7 +2348,8 @@

    Miscellaneous functions

    Return the base for resolving relative URIs. -
    +

    XML_GetSpecifiedAttributeCount

    +
     int XMLCALL
     XML_GetSpecifiedAttributeCount(XML_Parser p);
     
    @@ -2074,7 +2365,8 @@

    Miscellaneous functions

    means the current call. -
    +

    XML_GetIdAttributeIndex

    +
     int XMLCALL
     XML_GetIdAttributeIndex(XML_Parser p);
     
    @@ -2086,7 +2378,8 @@

    Miscellaneous functions

    current call. -
    +

    XML_GetAttributeInfo

    +
     const XML_AttrInfo * XMLCALL
     XML_GetAttributeInfo(XML_Parser parser);
     
    @@ -2107,14 +2400,15 @@

    Miscellaneous functions

    XML_GetSpecifiedAttributeCount(parser) / 2. -
    +

    XML_SetEncoding

    +
     enum XML_Status XMLCALL
     XML_SetEncoding(XML_Parser p,
                     const XML_Char *encoding);
     
    Set the encoding to be used by the parser. It is equivalent to -passing a non-null encoding argument to the parser creation functions. +passing a non-NULL encoding argument to the parser creation functions. It must not be called after XML_Parse or XML_ParseBuffer have been called on the given parser. @@ -2122,7 +2416,8 @@

    Miscellaneous functions

    XML_STATUS_ERROR on error.
    -
    +

    XML_SetParamEntityParsing

    +
     int XMLCALL
     XML_SetParamEntityParsing(XML_Parser p,
                               enum XML_ParamEntityParsing code);
    @@ -2142,7 +2437,8 @@ 

    Miscellaneous functions

    no effect and will always return 0. -
    +

    XML_SetHashSalt

    +
     int XMLCALL
     XML_SetHashSalt(XML_Parser p,
                     unsigned long hash_salt);
    @@ -2153,15 +2449,16 @@ 

    Miscellaneous functions

    function behavior. In order to have an effect this must be called before parsing has started. Returns 1 if successful, 0 when called after XML_Parse or XML_ParseBuffer. -

    Note:This call is optional, as the parser will auto-generate +

    Note: This call is optional, as the parser will auto-generate a new random salt value if no value has been set at the start of parsing.

    -

    Note:One should not call XML_SetHashSalt with a +

    Note: One should not call XML_SetHashSalt with a hash salt value of 0, as this value is used as sentinel value to indicate that XML_SetHashSalt has not been called. Consequently such a call will have no effect, even if it returns 1.

    -
    +

    XML_UseForeignDTD

    +
     enum XML_Error XMLCALL
     XML_UseForeignDTD(XML_Parser parser, XML_Bool useDTD);
     
    @@ -2183,7 +2480,7 @@

    Miscellaneous functions

    external entity reference handler set via XML_SetExternalEntityRefHandler with both -publicId and systemId set to NULL.

    +publicId and systemId set to NULL.

    If this function is called after parsing has begun, it returns XML_ERROR_CANT_CHANGE_FEATURE_ONCE_PARSING and ignores @@ -2198,7 +2495,8 @@

    Miscellaneous functions

    the external entity reference handler returns without action.

    -
    +

    XML_SetReturnNSTriplet

    +
     void XMLCALL
     XML_SetReturnNSTriplet(XML_Parser parser,
                            int        do_nst);
    @@ -2220,7 +2518,8 @@ 

    Miscellaneous functions

    separator.

    -
    +

    XML_DefaultCurrent

    +
     void XMLCALL
     XML_DefaultCurrent(XML_Parser parser);
     
    @@ -2234,7 +2533,8 @@

    Miscellaneous functions

    not a default handler. -
    +

    XML_ExpatVersion

    +
     XML_LChar * XMLCALL
     XML_ExpatVersion();
     
    @@ -2242,7 +2542,8 @@

    Miscellaneous functions

    Return the library version as a string (e.g. "expat_1.95.1"). -
    +

    XML_ExpatVersionInfo

    +
     struct XML_Expat_Version XMLCALL
     XML_ExpatVersionInfo();
     
    @@ -2266,7 +2567,8 @@

    Miscellaneous functions

    particular parts of the Expat API are available. -
    +

    XML_GetFeatureList

    +
     const XML_Feature * XMLCALL
     XML_GetFeatureList();
     
    @@ -2299,7 +2601,7 @@

    Miscellaneous functions

    The return value is an array of XML_Feature, terminated by a record with a feature of -XML_FEATURE_END and name of NULL, +XML_FEATURE_END and name of NULL, identifying the feature-test macros Expat was compiled with. Since an application that requires this kind of information needs to determine the type of character the name points to, records for the @@ -2327,7 +2629,8 @@

    Miscellaneous functions

    -
    +

    XML_FreeContentModel

    +
     void XMLCALL
     XML_FreeContentModel(XML_Parser parser, XML_Content *model);
     
    @@ -2346,19 +2649,21 @@

    Miscellaneous functions

    libraries which use different C standard libraries (this can happen on Windows, at least).

    -
    +

    XML_MemMalloc

    +
     void * XMLCALL
     XML_MemMalloc(XML_Parser parser, size_t size);
     
    Allocate size bytes of memory using the allocator the parser object has been configured to use. Returns a -pointer to the memory or NULL on failure. Memory allocated in this +pointer to the memory or NULL on failure. Memory allocated in this way must be freed using XML_MemFree.
    -
    +

    XML_MemRealloc

    +
     void * XMLCALL
     XML_MemRealloc(XML_Parser parser, void *ptr, size_t size);
     
    @@ -2367,9 +2672,9 @@

    Miscellaneous functions

    parser object has been configured to use. ptr must point to a block of memory allocated by XML_MemMalloc or -XML_MemRealloc, or be NULL. This function tries to +XML_MemRealloc, or be NULL. This function tries to expand the block pointed to by ptr if possible. Returns -a pointer to the memory or NULL on failure. On success, the original +a pointer to the memory or NULL on failure. On success, the original block has either been expanded or freed. On failure, the original block has not been freed; the caller is responsible for freeing the original block. Memory allocated in this way must be freed using @@ -2377,20 +2682,24 @@

    Miscellaneous functions

    >XML_MemFree. -
    +

    XML_MemFree

    +
     void XMLCALL
     XML_MemFree(XML_Parser parser, void *ptr);
     
    Free a block of memory pointed to by ptr. The block must have been allocated by XML_MemMalloc or XML_MemRealloc, or be NULL. +>XML_MemMalloc or XML_MemRealloc, or be NULL.

    -

    Valid XHTML 1.0!

    + + + diff --git a/3rdparty/expat/doc/style.css b/3rdparty/expat/doc/style.css index 69df30bcecb29..1b8cd10dffa4f 100644 --- a/3rdparty/expat/doc/style.css +++ b/3rdparty/expat/doc/style.css @@ -1,101 +1,47 @@ +/* + __ __ _ + ___\ \/ /_ __ __ _| |_ + / _ \\ /| '_ \ / _` | __| + | __// \| |_) | (_| | |_ + \___/_/\_\ .__/ \__,_|\__| + |_| XML parser + + Copyright (c) 2000 Clark Cooper + Copyright (c) 2000-2004 Fred L. Drake, Jr. + Copyright (c) 2021 Sebastian Pipping + Licensed under the MIT license: + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to permit + persons to whom the Software is furnished to do so, subject to the + following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN + NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +/* Stop not using half the screen */ body { - background-color: white; - border: 0px; - margin: 0px; - padding: 0px; -} - -.corner { - width: 200px; - height: 80px; - text-align: center; -} - -.banner { - background-color: rgb(110,139,61); - color: rgb(255,236,176); - padding-left: 2em; -} - -.banner h1 { - font-size: 200%; -} - -.content { - padding: 0em 2em 1em 2em; -} - -.releaseno { - background-color: rgb(110,139,61); - color: rgb(255,236,176); - padding-bottom: 0.3em; - padding-top: 0.5em; - text-align: center; - font-weight: bold; -} - -.noborder { - border-width: 0px; -} - -.eg { - padding-left: 1em; - padding-top: .5em; - padding-bottom: .5em; - border: solid thin; - margin: 1em 0; - background-color: tan; - margin-left: 2em; - margin-right: 10%; -} - -.pseudocode { - padding-left: 1em; - padding-top: .5em; - padding-bottom: .5em; - border: solid thin; - margin: 1em 0; - background-color: rgb(250,220,180); - margin-left: 2em; - margin-right: 10%; -} - -.handler { - width: 100%; - border-top-width: thin; - margin-bottom: 1em; -} - -.handler p { - margin-left: 2em; -} - -.setter { - font-weight: bold; -} - -.signature { - color: navy; -} - -.fcndec { - width: 100%; - border-top-width: thin; - font-weight: bold; -} - -.fcndef { - margin-left: 2em; - margin-bottom: 2em; -} - -dd { - margin-bottom: 2em; + max-width: none; /* was: 80ch */ } .cpp-symbols dt { font-family: monospace; } -.cpp-symbols dd { - margin-bottom: 1em; + +/* Resemble style of

    When a Lua function is called, it adjusts its list of arguments to -the length of its list of parameters, -unless the function is a vararg function, +the length of its list of parameters (see §3.4.12), +unless the function is a variadic function, which is indicated by three dots ('...') at the end of its parameter list. -A vararg function does not adjust its argument list; +A variadic function does not adjust its argument list; instead, it collects all extra arguments and supplies them to the function through a vararg expression, which is also written as three dots. The value of this expression is a list of all actual extra arguments, -similar to a function with multiple results. -If a vararg expression is used inside another expression -or in the middle of a list of expressions, -then its return list is adjusted to one element. -If the expression is used as the last element of a list of expressions, -then no adjustment is made -(unless that last expression is enclosed in parentheses). +similar to a function with multiple results (see §3.4.12).

    @@ -2803,6 +2741,122 @@

    3.4.11 – Function Definitions

    +

    3.4.12 – Lists of expressions, multiple results, +and adjustment

    + +

    +Both function calls and vararg expressions can result in multiple values. +These expressions are called multires expressions. + + +

    +When a multires expression is used as the last element +of a list of expressions, +all results from the expression are added to the +list of values produced by the list of expressions. +Note that a single expression +in a place that expects a list of expressions +is the last expression in that (singleton) list. + + +

    +These are the places where Lua expects a list of expressions: + +

      + +
    • A return statement, +for instance return e1, e2, e3 (see §3.3.4).
    • + +
    • A table constructor, +for instance {e1, e2, e3} (see §3.4.9).
    • + +
    • The arguments of a function call, +for instance foo(e1, e2, e3) (see §3.4.10).
    • + +
    • A multiple assignment, +for instance a , b, c = e1, e2, e3 (see §3.3.3).
    • + +
    • A local declaration, +for instance local a , b, c = e1, e2, e3 (see §3.3.7).
    • + +
    • The initial values in a generic for loop, +for instance for k in e1, e2, e3 do ... end (see §3.3.5).
    • + +

    +In the last four cases, +the list of values from the list of expressions +must be adjusted to a specific length: +the number of parameters in a call to a non-variadic function +(see §3.4.11), +the number of variables in a multiple assignment or +a local declaration, +and exactly four values for a generic for loop. +The adjustment follows these rules: +If there are more values than needed, +the extra values are thrown away; +if there are fewer values than needed, +the list is extended with nil's. +When the list of expressions ends with a multires expression, +all results from that expression enter the list of values +before the adjustment. + + +

    +When a multires expression is used +in a list of expressions without being the last element, +or in a place where the syntax expects a single expression, +Lua adjusts the result list of that expression to one element. +As a particular case, +the syntax expects a single expression inside a parenthesized expression; +therefore, adding parentheses around a multires expression +forces it to produce exactly one result. + + +

    +We seldom need to use a vararg expression in a place +where the syntax expects a single expression. +(Usually it is simpler to add a regular parameter before +the variadic part and use that parameter.) +When there is such a need, +we recommend assigning the vararg expression +to a single variable and using that variable +in its place. + + +

    +Here are some examples of uses of mutlres expressions. +In all cases, when the construction needs +"the n-th result" and there is no such result, +it uses a nil. + +

    +     print(x, f())      -- prints x and all results from f().
    +     print(x, (f()))    -- prints x and the first result from f().
    +     print(f(), x)      -- prints the first result from f() and x.
    +     print(1 + f())     -- prints 1 added to the first result from f().
    +     local x = ...      -- x gets the first vararg argument.
    +     x,y = ...          -- x gets the first vararg argument,
    +                        -- y gets the second vararg argument.
    +     x,y,z = w, f()     -- x gets w, y gets the first result from f(),
    +                        -- z gets the second result from f().
    +     x,y,z = f()        -- x gets the first result from f(),
    +                        -- y gets the second result from f(),
    +                        -- z gets the third result from f().
    +     x,y,z = f(), g()   -- x gets the first result from f(),
    +                        -- y gets the first result from g(),
    +                        -- z gets the second result from g().
    +     x,y,z = (f())      -- x gets the first result from f(), y and z get nil.
    +     return f()         -- returns all results from f().
    +     return x, ...      -- returns x and all received vararg arguments.
    +     return x,y,f()     -- returns x, y, and all results from f().
    +     {f()}              -- creates a list with all results from f().
    +     {...}              -- creates a list with all vararg arguments.
    +     {f(), 5}           -- creates a list with the first result from f() and 5.
    +
    + + + +

    3.5 – Visibility Rules

    @@ -2813,6 +2867,7 @@

    3.5 – Visibility Rules

    The scope of a local variable begins at the first statement after its declaration and lasts until the last non-void statement of the innermost block that includes the declaration. +(Void statements are labels and empty statements.) Consider the following example:
    @@ -3071,7 +3126,7 @@ 

    4.1.3 – Pointers to strings

    Lua's garbage collection can free or move internal memory and then invalidate pointers to internal strings. To allow a safe use of these pointers, -The API guarantees that any pointer to a string in a stack index +the API guarantees that any pointer to a string in a stack index is valid while the string value at that index is not removed from the stack. (It can be moved to another index, though.) When the index is a pseudo-index (referring to an upvalue), @@ -3537,7 +3592,7 @@

    4.6 – Functions and Types

    return realloc(ptr, nsize); }

    -Note that Standard C ensures +Note that ISO C ensures that free(NULL) has no effect and that realloc(NULL,size) is equivalent to malloc(size). @@ -3785,8 +3840,36 @@

    4.6 – Functions and Types

    -(Exceptionally, this function was introduced in release 5.4.3. -It is not present in previous 5.4 releases.) +(This function was introduced in release 5.4.3.) + + + + + +


    lua_closethread

    +[-0, +?, –] +

    int lua_closethread (lua_State *L, lua_State *from);
    + +

    +Resets a thread, cleaning its call stack and closing all pending +to-be-closed variables. +Returns a status code: +LUA_OK for no errors in the thread +(either the original error that stopped the thread or +errors in closing methods), +or an error status otherwise. +In case of error, +leaves the error object on the top of the stack. + + +

    +The parameter from represents the coroutine that is resetting L. +If there is no such coroutine, +this parameter can be NULL. + + +

    +(This function was introduced in release 5.4.6.) @@ -4542,7 +4625,7 @@

    4.6 – Functions and Types

    and pushes a key–value pair from the table at the given index, the "next" pair after the given key. If there are no more elements in the table, -then lua_next returns 0 and pushes nothing. +then lua_next returns 0 and pushes nothing.

    @@ -4985,6 +5068,7 @@

    4.6 – Functions and Types

    Similar to lua_gettable, but does a raw access (i.e., without metamethods). +The value at index must be a table. @@ -5051,6 +5135,7 @@

    4.6 – Functions and Types

    Similar to lua_settable, but does a raw assignment (i.e., without metamethods). +The value at index must be a table. @@ -5166,15 +5251,9 @@

    4.6 – Functions and Types

    int lua_resetthread (lua_State *L);

    -Resets a thread, cleaning its call stack and closing all pending -to-be-closed variables. -Returns a status code: -LUA_OK for no errors in the thread -(either the original error that stopped the thread or -errors in closing methods), -or an error status otherwise. -In case of error, -leaves the error object on the top of the stack. +This function is deprecated; +it is equivalent to lua_closethread with +from being NULL. @@ -5492,7 +5571,7 @@

    4.6 – Functions and Types


    lua_toclose

    -[-0, +0, m] +[-0, +0, v]

    void lua_toclose (lua_State *L, int index);

    @@ -5512,6 +5591,11 @@

    4.6 – Functions and Types

    unless previously deactivated by lua_closeslot. +

    +This function raises an error if the value at the given slot +neither has a __close metamethod nor is a false value. + +

    This function should not be called for an index that is equal to or below an active to-be-closed slot. @@ -5585,6 +5669,12 @@

    4.6 – Functions and Types

    but can contain other zeros in its body. +

    +This function can raise memory errors only +when converting a number to a string +(as then it may create a new string). + + @@ -6033,7 +6123,7 @@

    4.7 – The Debug Interface

  • isvararg: -true if the function is a vararg function +true if the function is a variadic function (always true for C functions).
  • @@ -6773,7 +6863,7 @@

    5.1 – Functions and Types

    void luaL_buffsub (luaL_Buffer *B, int n);

    -Removes n bytes from the the buffer B +Removes n bytes from the buffer B (see luaL_Buffer). The buffer must have at least that many bytes. @@ -6968,8 +7058,8 @@

    5.1 – Functions and Types

          (luaL_loadfile(L, filename) || lua_pcall(L, 0, LUA_MULTRET, 0))
     

    -It returns LUA_OK if there are no errors, -or an error code in case of errors (see §4.4.1). +It returns 0 (LUA_OK) if there are no errors, +or 1 in case of errors. @@ -6986,8 +7076,8 @@

    5.1 – Functions and Types

          (luaL_loadstring(L, str) || lua_pcall(L, 0, LUA_MULTRET, 0))
     

    -It returns LUA_OK if there are no errors, -or an error code in case of errors (see §4.4.1). +It returns 0 (LUA_OK) if there are no errors, +or 1 in case of errors. @@ -7294,7 +7384,7 @@

    5.1 – Functions and Types

    Creates a new Lua state. It calls lua_newstate with an -allocator based on the standard C allocation functions +allocator based on the ISO C allocation functions and then sets a warning function and a panic function (see §4.4) that print messages to the standard error output. @@ -7685,9 +7775,7 @@

    5.1 – Functions and Types


    luaL_typeerror

    [-0, +0, v] -

    const char *luaL_typeerror (lua_State *L,
    -                                      int arg,
    -                                      const char *tname);
    +
    int luaL_typeerror (lua_State *L, int arg, const char *tname);

    Raises a type error for the argument arg @@ -8708,6 +8796,8 @@

    6.3 – Modules

    This variable is only a reference to the real table; assignments to this variable do not change the table used by require. +The real table is stored in the C registry (see §4.3), +indexed by the key LUA_LOADED_TABLE, a string. @@ -8745,7 +8835,7 @@

    6.3 – Modules

    -This function is not supported by Standard C. +This functionality is not supported by ISO C. As such, it is only available on some platforms (Windows, Linux, Mac OS X, Solaris, BSD, plus other Unix systems that support the dlfcn standard). @@ -8799,6 +8889,8 @@

    6.3 – Modules

    This variable is only a reference to the real table; assignments to this variable do not change the table used by require. +The real table is stored in the C registry (see §4.3), +indexed by the key LUA_PRELOAD_TABLE, a string. @@ -9311,7 +9403,7 @@

    6.4 – String Manipulation

    -Returns the size of a string resulting from string.pack +Returns the length of a string resulting from string.pack with the given format. The format string cannot have the variable-length options 's' or 'z' (see §6.4.2). @@ -10091,9 +10183,9 @@

    6.7 – Mathematical Functions

    - + Returns the arc tangent of y/x (in radians), -but uses the signs of both arguments to find the +using the signs of both arguments to find the quadrant of the result. It also handles correctly the case of x being zero. @@ -10953,7 +11045,7 @@

    6.9 – Operating System Facilities

    If the optional second argument close is true, -closes the Lua state before exiting. +the function closes the Lua state before exiting (see lua_close). @@ -11195,13 +11287,13 @@

    6.10 – The Debug Library

    with the string what describing which fields to fill in. The default for what is to get all information available, except the table of valid lines. -If present, -the option 'f' +The option 'f' adds a field named func with the function itself. -If present, -the option 'L' -adds a field named activelines with the table of -valid lines. +The option 'L' adds a field named activelines +with the table of valid lines, +provided the function is a Lua function. +If the function has no debug information, +the table is empty.

    @@ -11503,12 +11595,18 @@

    7 – Lua Standalone

  • -i: enter interactive mode after running script;
  • -l mod: "require" mod and assign the result to global mod;
  • +
  • -l g=mod: "require" mod and assign the + result to global g;
  • -v: print version information;
  • -E: ignore environment variables;
  • -W: turn warnings on;
  • --: stop handling options;
  • -: execute stdin as a file and stop handling options.
  • +(The form -l g=mod was introduced in release 5.4.4.) + + +

    After handling its options, lua runs the given script. When called without arguments, lua behaves as lua -v -i @@ -11532,6 +11630,10 @@

    7 – Lua Standalone

    In particular, the values of package.path and package.cpath are set with the default paths defined in luaconf.h. +To signal to the libraries that this option is on, +the stand-alone interpreter sets the field +"LUA_NOENV" in the registry to a true value. +Other libraries may consult this field for the same purpose.

    @@ -11582,7 +11684,7 @@

    7 – Lua Standalone

    the script is called with arguments arg[1], ···, arg[#arg]. Like all chunks in Lua, -the script is compiled as a vararg function. +the script is compiled as a variadic function.

    @@ -11946,13 +12048,12 @@

    9 – The Complete Syntax of Lua

    - diff --git a/3rdparty/lua/doc/osi-certified-72x60.png b/3rdparty/lua/doc/osi-certified-72x60.png deleted file mode 100644 index 07df5f6ee7a7a..0000000000000 Binary files a/3rdparty/lua/doc/osi-certified-72x60.png and /dev/null differ diff --git a/3rdparty/lua/doc/readme.html b/3rdparty/lua/doc/readme.html index 8afe38de923bb..3bcefadfe9aa7 100644 --- a/3rdparty/lua/doc/readme.html +++ b/3rdparty/lua/doc/readme.html @@ -29,7 +29,7 @@

    -Lua +Lua Welcome to Lua 5.4

    @@ -49,29 +49,31 @@

    About Lua

    Lua is a powerful, efficient, lightweight, embeddable scripting language developed by a -team +team at -PUC-Rio, +PUC-Rio, the Pontifical Catholic University of Rio de Janeiro in Brazil. Lua is free software used in -many products and projects +many products and projects around the world.

    Lua's -official web site +official website provides complete information about Lua, including an -executive summary +executive summary, +tips on +getting started, and updated -documentation, +documentation, especially the -reference manual, +reference manual, which may differ slightly from the local copy distributed in this package. @@ -79,7 +81,7 @@

    About Lua

    Installing Lua

    Lua is distributed in -source +source form. You need to build it before using it. Building Lua should be straightforward @@ -88,7 +90,7 @@

    Installing Lua

    platforms that have an ANSI C compiler. Lua also compiles unmodified as C++. The instructions given below for building Lua are for Unix-like platforms, -such as Linux and Mac OS X. +such as Linux and macOS. See also instructions for other systems and @@ -97,10 +99,7 @@

    Installing Lua

    If you don't have the time or the inclination to compile Lua yourself, get a binary from -LuaBinaries. -Try also -LuaDist, -a multi-platform distribution of Lua that includes batteries. +LuaBinaries.

    Building Lua

    @@ -110,7 +109,7 @@

    Building Lua

    1. Open a terminal window and move to -the top-level directory, which is named lua-5.4.4. +the top-level directory, which is named lua-5.4.7. The Makefile there controls both the build process and the installation process.

    2. @@ -121,7 +120,7 @@

      Building Lua

      The platforms currently supported are:

      - guess aix bsd c89 freebsd generic linux linux-readline macosx mingw posix solaris + guess aix bsd c89 freebsd generic ios linux linux-readline macosx mingw posix solaris

      If your platform is listed, just do "make xxx", where xxx @@ -214,8 +213,8 @@

      Customization

      record the changes you've made.

      - On the other hand, if you need to customize some Lua features, you'll need - to edit src/luaconf.h before building and installing Lua. + On the other hand, if you need to customize some Lua features, + edit src/luaconf.h before building and installing Lua. The edited file will be the one installed, and it will be used by any Lua clients that you build, to ensure consistency. Further customization is available to experts by editing the Lua sources. @@ -244,7 +243,7 @@

      Building Lua on other systems

      - To use Lua as a library in your own programs, you'll need to know how to + To use Lua as a library in your own programs, you need to know how to create and use libraries with your compiler. Moreover, to dynamically load C libraries for Lua, you'll need to know how to create dynamic libraries and you'll need to make sure that the Lua API functions are accessible to @@ -287,11 +286,11 @@

      Main changes

      License

      - -[osi certified] + +[Open Source Initiative Approved License] Lua is free software distributed under the terms of the -MIT license +MIT license reproduced below; it may be used for any purpose, including commercial purposes, at absolutely no cost without having to ask us. @@ -299,11 +298,11 @@

      License

      The only requirement is that if you do use Lua, then you should give us credit by including the appropriate copyright notice somewhere in your product or its documentation. -For details, see -this. +For details, see the +license page.
      -Copyright © 1994–2022 Lua.org, PUC-Rio. +Copyright © 1994–2024 Lua.org, PUC-Rio.

      Permission is hereby granted, free of charge, to any person obtaining a copy @@ -330,10 +329,10 @@

      License

      diff --git a/3rdparty/lua/src/Makefile b/3rdparty/lua/src/Makefile index 1907381fef0a7..b7711963bccdb 100644 --- a/3rdparty/lua/src/Makefile +++ b/3rdparty/lua/src/Makefile @@ -30,7 +30,7 @@ CMCFLAGS= # == END OF USER SETTINGS -- NO NEED TO CHANGE ANYTHING BELOW THIS LINE ======= -PLATS= guess aix bsd c89 freebsd generic linux linux-readline macosx mingw posix solaris +PLATS= guess aix bsd c89 freebsd generic ios linux linux-readline macosx mingw posix solaris LUA_A= liblua.a CORE_O= lapi.o lcode.o lctype.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o lmem.o lobject.o lopcodes.o lparser.o lstate.o lstring.o ltable.o ltm.o lundump.o lvm.o lzio.o @@ -117,6 +117,9 @@ FreeBSD NetBSD OpenBSD freebsd: generic: $(ALL) +ios: + $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_IOS" + Linux linux: linux-noreadline linux-noreadline: diff --git a/3rdparty/lua/src/lapi.c b/3rdparty/lua/src/lapi.c index 5ee65792d2770..332e97d169574 100644 --- a/3rdparty/lua/src/lapi.c +++ b/3rdparty/lua/src/lapi.c @@ -60,27 +60,28 @@ const char lua_ident[] = static TValue *index2value (lua_State *L, int idx) { CallInfo *ci = L->ci; if (idx > 0) { - StkId o = ci->func + idx; - api_check(L, idx <= L->ci->top - (ci->func + 1), "unacceptable index"); - if (o >= L->top) return &G(L)->nilvalue; + StkId o = ci->func.p + idx; + api_check(L, idx <= ci->top.p - (ci->func.p + 1), "unacceptable index"); + if (o >= L->top.p) return &G(L)->nilvalue; else return s2v(o); } else if (!ispseudo(idx)) { /* negative index */ - api_check(L, idx != 0 && -idx <= L->top - (ci->func + 1), "invalid index"); - return s2v(L->top + idx); + api_check(L, idx != 0 && -idx <= L->top.p - (ci->func.p + 1), + "invalid index"); + return s2v(L->top.p + idx); } else if (idx == LUA_REGISTRYINDEX) return &G(L)->l_registry; else { /* upvalues */ idx = LUA_REGISTRYINDEX - idx; api_check(L, idx <= MAXUPVAL + 1, "upvalue index too large"); - if (ttisCclosure(s2v(ci->func))) { /* C closure? */ - CClosure *func = clCvalue(s2v(ci->func)); + if (ttisCclosure(s2v(ci->func.p))) { /* C closure? */ + CClosure *func = clCvalue(s2v(ci->func.p)); return (idx <= func->nupvalues) ? &func->upvalue[idx-1] : &G(L)->nilvalue; } else { /* light C function or Lua function (through a hook)?) */ - api_check(L, ttislcf(s2v(ci->func)), "caller not a C function"); + api_check(L, ttislcf(s2v(ci->func.p)), "caller not a C function"); return &G(L)->nilvalue; /* no upvalues */ } } @@ -94,14 +95,15 @@ static TValue *index2value (lua_State *L, int idx) { l_sinline StkId index2stack (lua_State *L, int idx) { CallInfo *ci = L->ci; if (idx > 0) { - StkId o = ci->func + idx; - api_check(L, o < L->top, "invalid index"); + StkId o = ci->func.p + idx; + api_check(L, o < L->top.p, "invalid index"); return o; } else { /* non-positive index */ - api_check(L, idx != 0 && -idx <= L->top - (ci->func + 1), "invalid index"); + api_check(L, idx != 0 && -idx <= L->top.p - (ci->func.p + 1), + "invalid index"); api_check(L, !ispseudo(idx), "invalid index"); - return L->top + idx; + return L->top.p + idx; } } @@ -112,17 +114,12 @@ LUA_API int lua_checkstack (lua_State *L, int n) { lua_lock(L); ci = L->ci; api_check(L, n >= 0, "negative 'n'"); - if (L->stack_last - L->top > n) /* stack large enough? */ + if (L->stack_last.p - L->top.p > n) /* stack large enough? */ res = 1; /* yes; check is OK */ - else { /* no; need to grow stack */ - int inuse = cast_int(L->top - L->stack) + EXTRA_STACK; - if (inuse > LUAI_MAXSTACK - n) /* can grow without overflow? */ - res = 0; /* no */ - else /* try to grow stack */ - res = luaD_growstack(L, n, 0); - } - if (res && ci->top < L->top + n) - ci->top = L->top + n; /* adjust frame top */ + else /* need to grow stack */ + res = luaD_growstack(L, n, 0); + if (res && ci->top.p < L->top.p + n) + ci->top.p = L->top.p + n; /* adjust frame top */ lua_unlock(L); return res; } @@ -134,11 +131,11 @@ LUA_API void lua_xmove (lua_State *from, lua_State *to, int n) { lua_lock(to); api_checknelems(from, n); api_check(from, G(from) == G(to), "moving among independent states"); - api_check(from, to->ci->top - to->top >= n, "stack overflow"); - from->top -= n; + api_check(from, to->ci->top.p - to->top.p >= n, "stack overflow"); + from->top.p -= n; for (i = 0; i < n; i++) { - setobjs2s(to, to->top, from->top + i); - to->top++; /* stack already checked by previous 'api_check' */ + setobjs2s(to, to->top.p, from->top.p + i); + to->top.p++; /* stack already checked by previous 'api_check' */ } lua_unlock(to); } @@ -172,12 +169,12 @@ LUA_API lua_Number lua_version (lua_State *L) { LUA_API int lua_absindex (lua_State *L, int idx) { return (idx > 0 || ispseudo(idx)) ? idx - : cast_int(L->top - L->ci->func) + idx; + : cast_int(L->top.p - L->ci->func.p) + idx; } LUA_API int lua_gettop (lua_State *L) { - return cast_int(L->top - (L->ci->func + 1)); + return cast_int(L->top.p - (L->ci->func.p + 1)); } @@ -187,24 +184,24 @@ LUA_API void lua_settop (lua_State *L, int idx) { ptrdiff_t diff; /* difference for new top */ lua_lock(L); ci = L->ci; - func = ci->func; + func = ci->func.p; if (idx >= 0) { - api_check(L, idx <= ci->top - (func + 1), "new top too large"); - diff = ((func + 1) + idx) - L->top; + api_check(L, idx <= ci->top.p - (func + 1), "new top too large"); + diff = ((func + 1) + idx) - L->top.p; for (; diff > 0; diff--) - setnilvalue(s2v(L->top++)); /* clear new slots */ + setnilvalue(s2v(L->top.p++)); /* clear new slots */ } else { - api_check(L, -(idx+1) <= (L->top - (func + 1)), "invalid new top"); + api_check(L, -(idx+1) <= (L->top.p - (func + 1)), "invalid new top"); diff = idx + 1; /* will "subtract" index (as it is negative) */ } - api_check(L, L->tbclist < L->top, "previous pop of an unclosed slot"); - newtop = L->top + diff; - if (diff < 0 && L->tbclist >= newtop) { + api_check(L, L->tbclist.p < L->top.p, "previous pop of an unclosed slot"); + newtop = L->top.p + diff; + if (diff < 0 && L->tbclist.p >= newtop) { lua_assert(hastocloseCfunc(ci->nresults)); - luaF_close(L, newtop, CLOSEKTOP, 0); + newtop = luaF_close(L, newtop, CLOSEKTOP, 0); } - L->top = newtop; /* correct top only after closing any upvalue */ + L->top.p = newtop; /* correct top only after closing any upvalue */ lua_unlock(L); } @@ -213,10 +210,9 @@ LUA_API void lua_closeslot (lua_State *L, int idx) { StkId level; lua_lock(L); level = index2stack(L, idx); - api_check(L, hastocloseCfunc(L->ci->nresults) && L->tbclist == level, + api_check(L, hastocloseCfunc(L->ci->nresults) && L->tbclist.p == level, "no variable to close at given level"); - luaF_close(L, level, CLOSEKTOP, 0); - level = index2stack(L, idx); /* stack may be moved */ + level = luaF_close(L, level, CLOSEKTOP, 0); setnilvalue(s2v(level)); lua_unlock(L); } @@ -245,7 +241,7 @@ l_sinline void reverse (lua_State *L, StkId from, StkId to) { LUA_API void lua_rotate (lua_State *L, int idx, int n) { StkId p, t, m; lua_lock(L); - t = L->top - 1; /* end of stack segment being rotated */ + t = L->top.p - 1; /* end of stack segment being rotated */ p = index2stack(L, idx); /* start of segment */ api_check(L, (n >= 0 ? n : -n) <= (t - p + 1), "invalid 'n'"); m = (n >= 0 ? t - n : p - n - 1); /* end of prefix */ @@ -264,7 +260,7 @@ LUA_API void lua_copy (lua_State *L, int fromidx, int toidx) { api_check(L, isvalid(L, to), "invalid index"); setobj(L, to, fr); if (isupvalue(toidx)) /* function upvalue? */ - luaC_barrier(L, clCvalue(s2v(L->ci->func)), fr); + luaC_barrier(L, clCvalue(s2v(L->ci->func.p)), fr); /* LUA_REGISTRYINDEX does not need gc barrier (collector revisits it before finishing collection) */ lua_unlock(L); @@ -273,7 +269,7 @@ LUA_API void lua_copy (lua_State *L, int fromidx, int toidx) { LUA_API void lua_pushvalue (lua_State *L, int idx) { lua_lock(L); - setobj2s(L, L->top, index2value(L, idx)); + setobj2s(L, L->top.p, index2value(L, idx)); api_incr_top(L); lua_unlock(L); } @@ -342,12 +338,12 @@ LUA_API void lua_arith (lua_State *L, int op) { api_checknelems(L, 2); /* all other operations expect two operands */ else { /* for unary operations, add fake 2nd operand */ api_checknelems(L, 1); - setobjs2s(L, L->top, L->top - 1); + setobjs2s(L, L->top.p, L->top.p - 1); api_incr_top(L); } /* first operand at top - 2, second at top - 1; result go to top - 2 */ - luaO_arith(L, op, s2v(L->top - 2), s2v(L->top - 1), L->top - 2); - L->top--; /* remove second operand */ + luaO_arith(L, op, s2v(L->top.p - 2), s2v(L->top.p - 1), L->top.p - 2); + L->top.p--; /* remove second operand */ lua_unlock(L); } @@ -373,7 +369,7 @@ LUA_API int lua_compare (lua_State *L, int index1, int index2, int op) { LUA_API size_t lua_stringtonumber (lua_State *L, const char *s) { - size_t sz = luaO_str2num(s, s2v(L->top)); + size_t sz = luaO_str2num(s, s2v(L->top.p)); if (sz != 0) api_incr_top(L); return sz; @@ -421,9 +417,9 @@ LUA_API const char *lua_tolstring (lua_State *L, int idx, size_t *len) { o = index2value(L, idx); /* previous call may reallocate the stack */ } if (len != NULL) - *len = vslen(o); + *len = tsslen(tsvalue(o)); lua_unlock(L); - return svalue(o); + return getstr(tsvalue(o)); } @@ -500,7 +496,7 @@ LUA_API const void *lua_topointer (lua_State *L, int idx) { LUA_API void lua_pushnil (lua_State *L) { lua_lock(L); - setnilvalue(s2v(L->top)); + setnilvalue(s2v(L->top.p)); api_incr_top(L); lua_unlock(L); } @@ -508,7 +504,7 @@ LUA_API void lua_pushnil (lua_State *L) { LUA_API void lua_pushnumber (lua_State *L, lua_Number n) { lua_lock(L); - setfltvalue(s2v(L->top), n); + setfltvalue(s2v(L->top.p), n); api_incr_top(L); lua_unlock(L); } @@ -516,7 +512,7 @@ LUA_API void lua_pushnumber (lua_State *L, lua_Number n) { LUA_API void lua_pushinteger (lua_State *L, lua_Integer n) { lua_lock(L); - setivalue(s2v(L->top), n); + setivalue(s2v(L->top.p), n); api_incr_top(L); lua_unlock(L); } @@ -531,7 +527,7 @@ LUA_API const char *lua_pushlstring (lua_State *L, const char *s, size_t len) { TString *ts; lua_lock(L); ts = (len == 0) ? luaS_new(L, "") : luaS_newlstr(L, s, len); - setsvalue2s(L, L->top, ts); + setsvalue2s(L, L->top.p, ts); api_incr_top(L); luaC_checkGC(L); lua_unlock(L); @@ -542,11 +538,11 @@ LUA_API const char *lua_pushlstring (lua_State *L, const char *s, size_t len) { LUA_API const char *lua_pushstring (lua_State *L, const char *s) { lua_lock(L); if (s == NULL) - setnilvalue(s2v(L->top)); + setnilvalue(s2v(L->top.p)); else { TString *ts; ts = luaS_new(L, s); - setsvalue2s(L, L->top, ts); + setsvalue2s(L, L->top.p, ts); s = getstr(ts); /* internal copy's address */ } api_incr_top(L); @@ -583,7 +579,7 @@ LUA_API const char *lua_pushfstring (lua_State *L, const char *fmt, ...) { LUA_API void lua_pushcclosure (lua_State *L, lua_CFunction fn, int n) { lua_lock(L); if (n == 0) { - setfvalue(s2v(L->top), fn); + setfvalue(s2v(L->top.p), fn); api_incr_top(L); } else { @@ -592,13 +588,13 @@ LUA_API void lua_pushcclosure (lua_State *L, lua_CFunction fn, int n) { api_check(L, n <= MAXUPVAL, "upvalue index too large"); cl = luaF_newCclosure(L, n); cl->f = fn; - L->top -= n; + L->top.p -= n; while (n--) { - setobj2n(L, &cl->upvalue[n], s2v(L->top + n)); + setobj2n(L, &cl->upvalue[n], s2v(L->top.p + n)); /* does not need barrier because closure is white */ lua_assert(iswhite(cl)); } - setclCvalue(L, s2v(L->top), cl); + setclCvalue(L, s2v(L->top.p), cl); api_incr_top(L); luaC_checkGC(L); } @@ -609,9 +605,9 @@ LUA_API void lua_pushcclosure (lua_State *L, lua_CFunction fn, int n) { LUA_API void lua_pushboolean (lua_State *L, int b) { lua_lock(L); if (b) - setbtvalue(s2v(L->top)); + setbtvalue(s2v(L->top.p)); else - setbfvalue(s2v(L->top)); + setbfvalue(s2v(L->top.p)); api_incr_top(L); lua_unlock(L); } @@ -619,7 +615,7 @@ LUA_API void lua_pushboolean (lua_State *L, int b) { LUA_API void lua_pushlightuserdata (lua_State *L, void *p) { lua_lock(L); - setpvalue(s2v(L->top), p); + setpvalue(s2v(L->top.p), p); api_incr_top(L); lua_unlock(L); } @@ -627,7 +623,7 @@ LUA_API void lua_pushlightuserdata (lua_State *L, void *p) { LUA_API int lua_pushthread (lua_State *L) { lua_lock(L); - setthvalue(L, s2v(L->top), L); + setthvalue(L, s2v(L->top.p), L); api_incr_top(L); lua_unlock(L); return (G(L)->mainthread == L); @@ -644,16 +640,16 @@ l_sinline int auxgetstr (lua_State *L, const TValue *t, const char *k) { const TValue *slot; TString *str = luaS_new(L, k); if (luaV_fastget(L, t, str, slot, luaH_getstr)) { - setobj2s(L, L->top, slot); + setobj2s(L, L->top.p, slot); api_incr_top(L); } else { - setsvalue2s(L, L->top, str); + setsvalue2s(L, L->top.p, str); api_incr_top(L); - luaV_finishget(L, t, s2v(L->top - 1), L->top - 1, slot); + luaV_finishget(L, t, s2v(L->top.p - 1), L->top.p - 1, slot); } lua_unlock(L); - return ttype(s2v(L->top - 1)); + return ttype(s2v(L->top.p - 1)); } @@ -680,13 +676,13 @@ LUA_API int lua_gettable (lua_State *L, int idx) { TValue *t; lua_lock(L); t = index2value(L, idx); - if (luaV_fastget(L, t, s2v(L->top - 1), slot, luaH_get)) { - setobj2s(L, L->top - 1, slot); + if (luaV_fastget(L, t, s2v(L->top.p - 1), slot, luaH_get)) { + setobj2s(L, L->top.p - 1, slot); } else - luaV_finishget(L, t, s2v(L->top - 1), L->top - 1, slot); + luaV_finishget(L, t, s2v(L->top.p - 1), L->top.p - 1, slot); lua_unlock(L); - return ttype(s2v(L->top - 1)); + return ttype(s2v(L->top.p - 1)); } @@ -702,27 +698,27 @@ LUA_API int lua_geti (lua_State *L, int idx, lua_Integer n) { lua_lock(L); t = index2value(L, idx); if (luaV_fastgeti(L, t, n, slot)) { - setobj2s(L, L->top, slot); + setobj2s(L, L->top.p, slot); } else { TValue aux; setivalue(&aux, n); - luaV_finishget(L, t, &aux, L->top, slot); + luaV_finishget(L, t, &aux, L->top.p, slot); } api_incr_top(L); lua_unlock(L); - return ttype(s2v(L->top - 1)); + return ttype(s2v(L->top.p - 1)); } l_sinline int finishrawget (lua_State *L, const TValue *val) { if (isempty(val)) /* avoid copying empty items to the stack */ - setnilvalue(s2v(L->top)); + setnilvalue(s2v(L->top.p)); else - setobj2s(L, L->top, val); + setobj2s(L, L->top.p, val); api_incr_top(L); lua_unlock(L); - return ttype(s2v(L->top - 1)); + return ttype(s2v(L->top.p - 1)); } @@ -739,8 +735,8 @@ LUA_API int lua_rawget (lua_State *L, int idx) { lua_lock(L); api_checknelems(L, 1); t = gettable(L, idx); - val = luaH_get(t, s2v(L->top - 1)); - L->top--; /* remove key */ + val = luaH_get(t, s2v(L->top.p - 1)); + L->top.p--; /* remove key */ return finishrawget(L, val); } @@ -767,7 +763,7 @@ LUA_API void lua_createtable (lua_State *L, int narray, int nrec) { Table *t; lua_lock(L); t = luaH_new(L); - sethvalue2s(L, L->top, t); + sethvalue2s(L, L->top.p, t); api_incr_top(L); if (narray > 0 || nrec > 0) luaH_resize(L, t, narray, nrec); @@ -794,7 +790,7 @@ LUA_API int lua_getmetatable (lua_State *L, int objindex) { break; } if (mt != NULL) { - sethvalue2s(L, L->top, mt); + sethvalue2s(L, L->top.p, mt); api_incr_top(L); res = 1; } @@ -810,12 +806,12 @@ LUA_API int lua_getiuservalue (lua_State *L, int idx, int n) { o = index2value(L, idx); api_check(L, ttisfulluserdata(o), "full userdata expected"); if (n <= 0 || n > uvalue(o)->nuvalue) { - setnilvalue(s2v(L->top)); + setnilvalue(s2v(L->top.p)); t = LUA_TNONE; } else { - setobj2s(L, L->top, &uvalue(o)->uv[n - 1].uv); - t = ttype(s2v(L->top)); + setobj2s(L, L->top.p, &uvalue(o)->uv[n - 1].uv); + t = ttype(s2v(L->top.p)); } api_incr_top(L); lua_unlock(L); @@ -835,14 +831,14 @@ static void auxsetstr (lua_State *L, const TValue *t, const char *k) { TString *str = luaS_new(L, k); api_checknelems(L, 1); if (luaV_fastget(L, t, str, slot, luaH_getstr)) { - luaV_finishfastset(L, t, slot, s2v(L->top - 1)); - L->top--; /* pop value */ + luaV_finishfastset(L, t, slot, s2v(L->top.p - 1)); + L->top.p--; /* pop value */ } else { - setsvalue2s(L, L->top, str); /* push 'str' (to make it a TValue) */ + setsvalue2s(L, L->top.p, str); /* push 'str' (to make it a TValue) */ api_incr_top(L); - luaV_finishset(L, t, s2v(L->top - 1), s2v(L->top - 2), slot); - L->top -= 2; /* pop value and key */ + luaV_finishset(L, t, s2v(L->top.p - 1), s2v(L->top.p - 2), slot); + L->top.p -= 2; /* pop value and key */ } lua_unlock(L); /* lock done by caller */ } @@ -862,12 +858,12 @@ LUA_API void lua_settable (lua_State *L, int idx) { lua_lock(L); api_checknelems(L, 2); t = index2value(L, idx); - if (luaV_fastget(L, t, s2v(L->top - 2), slot, luaH_get)) { - luaV_finishfastset(L, t, slot, s2v(L->top - 1)); + if (luaV_fastget(L, t, s2v(L->top.p - 2), slot, luaH_get)) { + luaV_finishfastset(L, t, slot, s2v(L->top.p - 1)); } else - luaV_finishset(L, t, s2v(L->top - 2), s2v(L->top - 1), slot); - L->top -= 2; /* pop index and value */ + luaV_finishset(L, t, s2v(L->top.p - 2), s2v(L->top.p - 1), slot); + L->top.p -= 2; /* pop index and value */ lua_unlock(L); } @@ -885,14 +881,14 @@ LUA_API void lua_seti (lua_State *L, int idx, lua_Integer n) { api_checknelems(L, 1); t = index2value(L, idx); if (luaV_fastgeti(L, t, n, slot)) { - luaV_finishfastset(L, t, slot, s2v(L->top - 1)); + luaV_finishfastset(L, t, slot, s2v(L->top.p - 1)); } else { TValue aux; setivalue(&aux, n); - luaV_finishset(L, t, &aux, s2v(L->top - 1), slot); + luaV_finishset(L, t, &aux, s2v(L->top.p - 1), slot); } - L->top--; /* pop value */ + L->top.p--; /* pop value */ lua_unlock(L); } @@ -902,16 +898,16 @@ static void aux_rawset (lua_State *L, int idx, TValue *key, int n) { lua_lock(L); api_checknelems(L, n); t = gettable(L, idx); - luaH_set(L, t, key, s2v(L->top - 1)); + luaH_set(L, t, key, s2v(L->top.p - 1)); invalidateTMcache(t); - luaC_barrierback(L, obj2gco(t), s2v(L->top - 1)); - L->top -= n; + luaC_barrierback(L, obj2gco(t), s2v(L->top.p - 1)); + L->top.p -= n; lua_unlock(L); } LUA_API void lua_rawset (lua_State *L, int idx) { - aux_rawset(L, idx, s2v(L->top - 2), 2); + aux_rawset(L, idx, s2v(L->top.p - 2), 2); } @@ -927,9 +923,9 @@ LUA_API void lua_rawseti (lua_State *L, int idx, lua_Integer n) { lua_lock(L); api_checknelems(L, 1); t = gettable(L, idx); - luaH_setint(L, t, n, s2v(L->top - 1)); - luaC_barrierback(L, obj2gco(t), s2v(L->top - 1)); - L->top--; + luaH_setint(L, t, n, s2v(L->top.p - 1)); + luaC_barrierback(L, obj2gco(t), s2v(L->top.p - 1)); + L->top.p--; lua_unlock(L); } @@ -940,11 +936,11 @@ LUA_API int lua_setmetatable (lua_State *L, int objindex) { lua_lock(L); api_checknelems(L, 1); obj = index2value(L, objindex); - if (ttisnil(s2v(L->top - 1))) + if (ttisnil(s2v(L->top.p - 1))) mt = NULL; else { - api_check(L, ttistable(s2v(L->top - 1)), "table expected"); - mt = hvalue(s2v(L->top - 1)); + api_check(L, ttistable(s2v(L->top.p - 1)), "table expected"); + mt = hvalue(s2v(L->top.p - 1)); } switch (ttype(obj)) { case LUA_TTABLE: { @@ -968,7 +964,7 @@ LUA_API int lua_setmetatable (lua_State *L, int objindex) { break; } } - L->top--; + L->top.p--; lua_unlock(L); return 1; } @@ -984,11 +980,11 @@ LUA_API int lua_setiuservalue (lua_State *L, int idx, int n) { if (!(cast_uint(n) - 1u < cast_uint(uvalue(o)->nuvalue))) res = 0; /* 'n' not in [1, uvalue(o)->nuvalue] */ else { - setobj(L, &uvalue(o)->uv[n - 1].uv, s2v(L->top - 1)); - luaC_barrierback(L, gcvalue(o), s2v(L->top - 1)); + setobj(L, &uvalue(o)->uv[n - 1].uv, s2v(L->top.p - 1)); + luaC_barrierback(L, gcvalue(o), s2v(L->top.p - 1)); res = 1; } - L->top--; + L->top.p--; lua_unlock(L); return res; } @@ -1000,7 +996,8 @@ LUA_API int lua_setiuservalue (lua_State *L, int idx, int n) { #define checkresults(L,na,nr) \ - api_check(L, (nr) == LUA_MULTRET || (L->ci->top - L->top >= (nr) - (na)), \ + api_check(L, (nr) == LUA_MULTRET \ + || (L->ci->top.p - L->top.p >= (nr) - (na)), \ "results from function overflow current stack size") @@ -1013,7 +1010,7 @@ LUA_API void lua_callk (lua_State *L, int nargs, int nresults, api_checknelems(L, nargs+1); api_check(L, L->status == LUA_OK, "cannot do calls on non-normal thread"); checkresults(L, nargs, nresults); - func = L->top - (nargs+1); + func = L->top.p - (nargs+1); if (k != NULL && yieldable(L)) { /* need to prepare continuation? */ L->ci->u.c.k = k; /* save continuation */ L->ci->u.c.ctx = ctx; /* save context */ @@ -1061,7 +1058,7 @@ LUA_API int lua_pcallk (lua_State *L, int nargs, int nresults, int errfunc, api_check(L, ttisfunction(s2v(o)), "error handler must be a function"); func = savestack(L, o); } - c.func = L->top - (nargs+1); /* function to be called */ + c.func = L->top.p - (nargs+1); /* function to be called */ if (k == NULL || !yieldable(L)) { /* no continuation or no yieldable? */ c.nresults = nresults; /* do a 'conventional' protected call */ status = luaD_pcall(L, f_call, &c, savestack(L, c.func), func); @@ -1096,12 +1093,12 @@ LUA_API int lua_load (lua_State *L, lua_Reader reader, void *data, luaZ_init(L, &z, reader, data); status = luaD_protectedparser(L, &z, chunkname, mode); if (status == LUA_OK) { /* no errors? */ - LClosure *f = clLvalue(s2v(L->top - 1)); /* get newly created function */ + LClosure *f = clLvalue(s2v(L->top.p - 1)); /* get new function */ if (f->nupvalues >= 1) { /* does it have an upvalue? */ /* get global table from registry */ const TValue *gt = getGtable(L); /* set global table as 1st upvalue of 'f' (may be LUA_ENV) */ - setobj(L, f->upvals[0]->v, gt); + setobj(L, f->upvals[0]->v.p, gt); luaC_barrier(L, f->upvals[0], gt); } } @@ -1115,7 +1112,7 @@ LUA_API int lua_dump (lua_State *L, lua_Writer writer, void *data, int strip) { TValue *o; lua_lock(L); api_checknelems(L, 1); - o = s2v(L->top - 1); + o = s2v(L->top.p - 1); if (isLfunction(o)) status = luaU_dump(L, getproto(o), writer, data, strip); else @@ -1241,7 +1238,7 @@ LUA_API int lua_gc (lua_State *L, int what, ...) { LUA_API int lua_error (lua_State *L) { TValue *errobj; lua_lock(L); - errobj = s2v(L->top - 1); + errobj = s2v(L->top.p - 1); api_checknelems(L, 1); /* error object is the memory error message? */ if (ttisshrstring(errobj) && eqshrstr(tsvalue(errobj), G(L)->memerrmsg)) @@ -1259,12 +1256,12 @@ LUA_API int lua_next (lua_State *L, int idx) { lua_lock(L); api_checknelems(L, 1); t = gettable(L, idx); - more = luaH_next(L, t, L->top - 1); + more = luaH_next(L, t, L->top.p - 1); if (more) { api_incr_top(L); } else /* no more elements */ - L->top -= 1; /* remove key */ + L->top.p -= 1; /* remove key */ lua_unlock(L); return more; } @@ -1276,7 +1273,7 @@ LUA_API void lua_toclose (lua_State *L, int idx) { lua_lock(L); o = index2stack(L, idx); nresults = L->ci->nresults; - api_check(L, L->tbclist < o, "given index below or equal a marked one"); + api_check(L, L->tbclist.p < o, "given index below or equal a marked one"); luaF_newtbcupval(L, o); /* create new to-be-closed upvalue */ if (!hastocloseCfunc(nresults)) /* function not marked yet? */ L->ci->nresults = codeNresults(nresults); /* mark it */ @@ -1291,7 +1288,7 @@ LUA_API void lua_concat (lua_State *L, int n) { if (n > 0) luaV_concat(L, n); else { /* nothing to concatenate */ - setsvalue2s(L, L->top, luaS_newlstr(L, "", 0)); /* push empty string */ + setsvalue2s(L, L->top.p, luaS_newlstr(L, "", 0)); /* push empty string */ api_incr_top(L); } luaC_checkGC(L); @@ -1303,7 +1300,7 @@ LUA_API void lua_len (lua_State *L, int idx) { TValue *t; lua_lock(L); t = index2value(L, idx); - luaV_objlen(L, L->top, t); + luaV_objlen(L, L->top.p, t); api_incr_top(L); lua_unlock(L); } @@ -1348,7 +1345,7 @@ LUA_API void *lua_newuserdatauv (lua_State *L, size_t size, int nuvalue) { lua_lock(L); api_check(L, 0 <= nuvalue && nuvalue < USHRT_MAX, "invalid value"); u = luaS_newudata(L, size, nuvalue); - setuvalue(L, s2v(L->top), u); + setuvalue(L, s2v(L->top.p), u); api_incr_top(L); luaC_checkGC(L); lua_unlock(L); @@ -1374,7 +1371,7 @@ static const char *aux_upvalue (TValue *fi, int n, TValue **val, Proto *p = f->p; if (!(cast_uint(n) - 1u < cast_uint(p->sizeupvalues))) return NULL; /* 'n' not in [1, p->sizeupvalues] */ - *val = f->upvals[n-1]->v; + *val = f->upvals[n-1]->v.p; if (owner) *owner = obj2gco(f->upvals[n - 1]); name = p->upvalues[n-1].name; return (name == NULL) ? "(no name)" : getstr(name); @@ -1390,7 +1387,7 @@ LUA_API const char *lua_getupvalue (lua_State *L, int funcindex, int n) { lua_lock(L); name = aux_upvalue(index2value(L, funcindex), n, &val, NULL); if (name) { - setobj2s(L, L->top, val); + setobj2s(L, L->top.p, val); api_incr_top(L); } lua_unlock(L); @@ -1408,8 +1405,8 @@ LUA_API const char *lua_setupvalue (lua_State *L, int funcindex, int n) { api_checknelems(L, 1); name = aux_upvalue(fi, n, &val, &owner); if (name) { - L->top--; - setobj(L, val, s2v(L->top)); + L->top.p--; + setobj(L, val, s2v(L->top.p)); luaC_barrier(L, owner, val); } lua_unlock(L); diff --git a/3rdparty/lua/src/lapi.h b/3rdparty/lua/src/lapi.h index 9e99cc44824df..a742427cdc796 100644 --- a/3rdparty/lua/src/lapi.h +++ b/3rdparty/lua/src/lapi.h @@ -12,23 +12,26 @@ #include "lstate.h" -/* Increments 'L->top', checking for stack overflows */ -#define api_incr_top(L) {L->top++; api_check(L, L->top <= L->ci->top, \ - "stack overflow");} +/* Increments 'L->top.p', checking for stack overflows */ +#define api_incr_top(L) {L->top.p++; \ + api_check(L, L->top.p <= L->ci->top.p, \ + "stack overflow");} /* ** If a call returns too many multiple returns, the callee may not have ** stack space to accommodate all results. In this case, this macro -** increases its stack space ('L->ci->top'). +** increases its stack space ('L->ci->top.p'). */ #define adjustresults(L,nres) \ - { if ((nres) <= LUA_MULTRET && L->ci->top < L->top) L->ci->top = L->top; } + { if ((nres) <= LUA_MULTRET && L->ci->top.p < L->top.p) \ + L->ci->top.p = L->top.p; } /* Ensure the stack has at least 'n' elements */ -#define api_checknelems(L,n) api_check(L, (n) < (L->top - L->ci->func), \ - "not enough elements in the stack") +#define api_checknelems(L,n) \ + api_check(L, (n) < (L->top.p - L->ci->func.p), \ + "not enough elements in the stack") /* diff --git a/3rdparty/lua/src/lauxlib.c b/3rdparty/lua/src/lauxlib.c index 8ed1da1122fc9..923105ed31769 100644 --- a/3rdparty/lua/src/lauxlib.c +++ b/3rdparty/lua/src/lauxlib.c @@ -80,6 +80,7 @@ static int pushglobalfuncname (lua_State *L, lua_Debug *ar) { int top = lua_gettop(L); lua_getinfo(L, "f", ar); /* push function */ lua_getfield(L, LUA_REGISTRYINDEX, LUA_LOADED_TABLE); + luaL_checkstack(L, 6, "not enough stack"); /* slots for 'findfield' */ if (findfield(L, top + 1, 2)) { const char *name = lua_tostring(L, -1); if (strncmp(name, LUA_GNAME ".", 3) == 0) { /* name start with '_G.'? */ @@ -249,11 +250,13 @@ LUALIB_API int luaL_fileresult (lua_State *L, int stat, const char *fname) { return 1; } else { + const char *msg; luaL_pushfail(L); + msg = (en != 0) ? strerror(en) : "(no extra info)"; if (fname) - lua_pushfstring(L, "%s: %s", fname, strerror(en)); + lua_pushfstring(L, "%s: %s", fname, msg); else - lua_pushstring(L, strerror(en)); + lua_pushstring(L, msg); lua_pushinteger(L, en); return 3; } @@ -526,13 +529,14 @@ static void newbox (lua_State *L) { /* ** Compute new size for buffer 'B', enough to accommodate extra 'sz' -** bytes. +** bytes. (The test for "not big enough" also gets the case when the +** computation of 'newsize' overflows.) */ static size_t newbuffsize (luaL_Buffer *B, size_t sz) { - size_t newsize = B->size * 2; /* double buffer size */ + size_t newsize = (B->size / 2) * 3; /* buffer size * 1.5 */ if (l_unlikely(MAX_SIZET - sz < B->n)) /* overflow in (B->n + sz)? */ return luaL_error(B->L, "buffer too large"); - if (newsize < B->n + sz) /* double is not big enough? */ + if (newsize < B->n + sz) /* not big enough? */ newsize = B->n + sz; return newsize; } @@ -611,7 +615,7 @@ LUALIB_API void luaL_pushresultsize (luaL_Buffer *B, size_t sz) { ** box (if existent) is not on the top of the stack. So, instead of ** calling 'luaL_addlstring', it replicates the code using -2 as the ** last argument to 'prepbuffsize', signaling that the box is (or will -** be) bellow the string being added to the buffer. (Box creation can +** be) below the string being added to the buffer. (Box creation can ** trigger an emergency GC, so we should not remove the string from the ** stack before we have the space guaranteed.) */ @@ -731,25 +735,29 @@ static const char *getF (lua_State *L, void *ud, size_t *size) { static int errfile (lua_State *L, const char *what, int fnameindex) { - const char *serr = strerror(errno); + int err = errno; const char *filename = lua_tostring(L, fnameindex) + 1; - lua_pushfstring(L, "cannot %s %s: %s", what, filename, serr); + if (err != 0) + lua_pushfstring(L, "cannot %s %s: %s", what, filename, strerror(err)); + else + lua_pushfstring(L, "cannot %s %s", what, filename); lua_remove(L, fnameindex); return LUA_ERRFILE; } -static int skipBOM (LoadF *lf) { - const char *p = "\xEF\xBB\xBF"; /* UTF-8 BOM mark */ - int c; - lf->n = 0; - do { - c = getc(lf->f); - if (c == EOF || c != *(const unsigned char *)p++) return c; - lf->buff[lf->n++] = c; /* to be read by the parser */ - } while (*p != '\0'); - lf->n = 0; /* prefix matched; discard it */ - return getc(lf->f); /* return next character */ +/* +** Skip an optional BOM at the start of a stream. If there is an +** incomplete BOM (the first character is correct but the rest is +** not), returns the first character anyway to force an error +** (as no chunk can start with 0xEF). +*/ +static int skipBOM (FILE *f) { + int c = getc(f); /* read first character */ + if (c == 0xEF && getc(f) == 0xBB && getc(f) == 0xBF) /* correct BOM? */ + return getc(f); /* ignore BOM and return next char */ + else /* no (valid) BOM */ + return c; /* return first character */ } @@ -760,13 +768,13 @@ static int skipBOM (LoadF *lf) { ** first "valid" character of the file (after the optional BOM and ** a first-line comment). */ -static int skipcomment (LoadF *lf, int *cp) { - int c = *cp = skipBOM(lf); +static int skipcomment (FILE *f, int *cp) { + int c = *cp = skipBOM(f); if (c == '#') { /* first line is a comment (Unix exec. file)? */ do { /* skip first line */ - c = getc(lf->f); + c = getc(f); } while (c != EOF && c != '\n'); - *cp = getc(lf->f); /* skip end-of-line, if present */ + *cp = getc(f); /* next character after comment, if present */ return 1; /* there was a comment */ } else return 0; /* no comment */ @@ -785,18 +793,25 @@ LUALIB_API int luaL_loadfilex (lua_State *L, const char *filename, } else { lua_pushfstring(L, "@%s", filename); + errno = 0; lf.f = fopen(filename, "r"); if (lf.f == NULL) return errfile(L, "open", fnameindex); } - if (skipcomment(&lf, &c)) /* read initial portion */ - lf.buff[lf.n++] = '\n'; /* add line to correct line numbers */ - if (c == LUA_SIGNATURE[0] && filename) { /* binary file? */ - lf.f = freopen(filename, "rb", lf.f); /* reopen in binary mode */ - if (lf.f == NULL) return errfile(L, "reopen", fnameindex); - skipcomment(&lf, &c); /* re-read initial portion */ + lf.n = 0; + if (skipcomment(lf.f, &c)) /* read initial portion */ + lf.buff[lf.n++] = '\n'; /* add newline to correct line numbers */ + if (c == LUA_SIGNATURE[0]) { /* binary file? */ + lf.n = 0; /* remove possible newline */ + if (filename) { /* "real" file? */ + errno = 0; + lf.f = freopen(filename, "rb", lf.f); /* reopen in binary mode */ + if (lf.f == NULL) return errfile(L, "reopen", fnameindex); + skipcomment(lf.f, &c); /* re-read initial portion */ + } } if (c != EOF) lf.buff[lf.n++] = c; /* 'c' is the first character of the stream */ + errno = 0; status = lua_load(L, getF, &lf, lua_tostring(L, -1), mode); readstatus = ferror(lf.f); if (filename) fclose(lf.f); /* close file (even in case of errors) */ @@ -927,7 +942,7 @@ LUALIB_API const char *luaL_tolstring (lua_State *L, int idx, size_t *len) { LUALIB_API void luaL_setfuncs (lua_State *L, const luaL_Reg *l, int nup) { luaL_checkstack(L, nup, "too many upvalues"); for (; l->name != NULL; l++) { /* fill the table with given functions */ - if (l->func == NULL) /* place holder? */ + if (l->func == NULL) /* placeholder? */ lua_pushboolean(L, 0); else { int i; @@ -1019,9 +1034,14 @@ static void *l_alloc (void *ud, void *ptr, size_t osize, size_t nsize) { } +/* +** Standard panic funcion just prints an error message. The test +** with 'lua_type' avoids possible memory errors in 'lua_tostring'. +*/ static int panic (lua_State *L) { - const char *msg = lua_tostring(L, -1); - if (msg == NULL) msg = "error object is not a string"; + const char *msg = (lua_type(L, -1) == LUA_TSTRING) + ? lua_tostring(L, -1) + : "error object is not a string"; lua_writestringerror("PANIC: unprotected error in call to Lua API (%s)\n", msg); return 0; /* return to Lua to abort */ diff --git a/3rdparty/lua/src/lcode.c b/3rdparty/lua/src/lcode.c index 06425a1db8006..87616140ebe1c 100644 --- a/3rdparty/lua/src/lcode.c +++ b/3rdparty/lua/src/lcode.c @@ -415,7 +415,7 @@ int luaK_codeABx (FuncState *fs, OpCode o, int a, unsigned int bc) { /* ** Format and emit an 'iAsBx' instruction. */ -int luaK_codeAsBx (FuncState *fs, OpCode o, int a, int bc) { +static int codeAsBx (FuncState *fs, OpCode o, int a, int bc) { unsigned int b = bc + OFFSET_sBx; lua_assert(getOpMode(o) == iAsBx); lua_assert(a <= MAXARG_A && b <= MAXARG_Bx); @@ -671,7 +671,7 @@ static int fitsBx (lua_Integer i) { void luaK_int (FuncState *fs, int reg, lua_Integer i) { if (fitsBx(i)) - luaK_codeAsBx(fs, OP_LOADI, reg, cast_int(i)); + codeAsBx(fs, OP_LOADI, reg, cast_int(i)); else luaK_codek(fs, reg, luaK_intK(fs, i)); } @@ -680,7 +680,7 @@ void luaK_int (FuncState *fs, int reg, lua_Integer i) { static void luaK_float (FuncState *fs, int reg, lua_Number f) { lua_Integer fi; if (luaV_flttointeger(f, &fi, F2Ieq) && fitsBx(fi)) - luaK_codeAsBx(fs, OP_LOADF, reg, cast_int(fi)); + codeAsBx(fs, OP_LOADF, reg, cast_int(fi)); else luaK_codek(fs, reg, luaK_numberK(fs, f)); } @@ -776,7 +776,8 @@ void luaK_dischargevars (FuncState *fs, expdesc *e) { break; } case VLOCAL: { /* already in a register */ - e->u.info = e->u.var.ridx; + int temp = e->u.var.ridx; + e->u.info = temp; /* (can't do a direct assignment; values overlap) */ e->k = VNONRELOC; /* becomes a non-relocatable value */ break; } @@ -1025,7 +1026,7 @@ static int luaK_exp2K (FuncState *fs, expdesc *e) { ** in the range of R/K indices). ** Returns 1 iff expression is K. */ -int luaK_exp2RK (FuncState *fs, expdesc *e) { +static int exp2RK (FuncState *fs, expdesc *e) { if (luaK_exp2K(fs, e)) return 1; else { /* not a constant in the right range: put it in a register */ @@ -1037,7 +1038,7 @@ int luaK_exp2RK (FuncState *fs, expdesc *e) { static void codeABRK (FuncState *fs, OpCode o, int a, int b, expdesc *ec) { - int k = luaK_exp2RK(fs, ec); + int k = exp2RK(fs, ec); luaK_codeABCk(fs, o, a, b, ec->u.info, k); } @@ -1215,7 +1216,7 @@ static void codenot (FuncState *fs, expdesc *e) { /* -** Check whether expression 'e' is a small literal string +** Check whether expression 'e' is a short literal string */ static int isKstr (FuncState *fs, expdesc *e) { return (e->k == VK && !hasjumps(e) && e->u.info <= MAXARG_B && @@ -1225,7 +1226,7 @@ static int isKstr (FuncState *fs, expdesc *e) { /* ** Check whether expression 'e' is a literal integer. */ -int luaK_isKint (expdesc *e) { +static int isKint (expdesc *e) { return (e->k == VKINT && !hasjumps(e)); } @@ -1235,7 +1236,7 @@ int luaK_isKint (expdesc *e) { ** proper range to fit in register C */ static int isCint (expdesc *e) { - return luaK_isKint(e) && (l_castS2U(e->u.ival) <= l_castS2U(MAXARG_C)); + return isKint(e) && (l_castS2U(e->u.ival) <= l_castS2U(MAXARG_C)); } @@ -1244,7 +1245,7 @@ static int isCint (expdesc *e) { ** proper range to fit in register sC */ static int isSCint (expdesc *e) { - return luaK_isKint(e) && fitsC(e->u.ival); + return isKint(e) && fitsC(e->u.ival); } @@ -1283,15 +1284,17 @@ void luaK_indexed (FuncState *fs, expdesc *t, expdesc *k) { if (t->k == VUPVAL && !isKstr(fs, k)) /* upvalue indexed by non 'Kstr'? */ luaK_exp2anyreg(fs, t); /* put it in a register */ if (t->k == VUPVAL) { - t->u.ind.t = t->u.info; /* upvalue index */ - t->u.ind.idx = k->u.info; /* literal string */ + int temp = t->u.info; /* upvalue index */ + lua_assert(isKstr(fs, k)); + t->u.ind.t = temp; /* (can't do a direct assignment; values overlap) */ + t->u.ind.idx = k->u.info; /* literal short string */ t->k = VINDEXUP; } else { /* register index of the table */ t->u.ind.t = (t->k == VLOCAL) ? t->u.var.ridx: t->u.info; if (isKstr(fs, k)) { - t->u.ind.idx = k->u.info; /* literal string */ + t->u.ind.idx = k->u.info; /* literal short string */ t->k = VINDEXSTR; } else if (isCint(k)) { @@ -1351,6 +1354,35 @@ static int constfolding (FuncState *fs, int op, expdesc *e1, } +/* +** Convert a BinOpr to an OpCode (ORDER OPR - ORDER OP) +*/ +l_sinline OpCode binopr2op (BinOpr opr, BinOpr baser, OpCode base) { + lua_assert(baser <= opr && + ((baser == OPR_ADD && opr <= OPR_SHR) || + (baser == OPR_LT && opr <= OPR_LE))); + return cast(OpCode, (cast_int(opr) - cast_int(baser)) + cast_int(base)); +} + + +/* +** Convert a UnOpr to an OpCode (ORDER OPR - ORDER OP) +*/ +l_sinline OpCode unopr2op (UnOpr opr) { + return cast(OpCode, (cast_int(opr) - cast_int(OPR_MINUS)) + + cast_int(OP_UNM)); +} + + +/* +** Convert a BinOpr to a tag method (ORDER OPR - ORDER TM) +*/ +l_sinline TMS binopr2TM (BinOpr opr) { + lua_assert(OPR_ADD <= opr && opr <= OPR_SHR); + return cast(TMS, (cast_int(opr) - cast_int(OPR_ADD)) + cast_int(TM_ADD)); +} + + /* ** Emit code for unary expressions that "produce values" ** (everything but 'not'). @@ -1389,12 +1421,15 @@ static void finishbinexpval (FuncState *fs, expdesc *e1, expdesc *e2, ** Emit code for binary expressions that "produce values" over ** two registers. */ -static void codebinexpval (FuncState *fs, OpCode op, +static void codebinexpval (FuncState *fs, BinOpr opr, expdesc *e1, expdesc *e2, int line) { - int v2 = luaK_exp2anyreg(fs, e2); /* both operands are in registers */ + OpCode op = binopr2op(opr, OPR_ADD, OP_ADD); + int v2 = luaK_exp2anyreg(fs, e2); /* make sure 'e2' is in a register */ + /* 'e1' must be already in a register or it is a constant */ + lua_assert((VNIL <= e1->k && e1->k <= VKSTR) || + e1->k == VNONRELOC || e1->k == VRELOC); lua_assert(OP_ADD <= op && op <= OP_SHR); - finishbinexpval(fs, e1, e2, op, v2, 0, line, OP_MMBIN, - cast(TMS, (op - OP_ADD) + TM_ADD)); + finishbinexpval(fs, e1, e2, op, v2, 0, line, OP_MMBIN, binopr2TM(opr)); } @@ -1410,12 +1445,24 @@ static void codebini (FuncState *fs, OpCode op, } +/* +** Code binary operators with K operand. +*/ +static void codebinK (FuncState *fs, BinOpr opr, + expdesc *e1, expdesc *e2, int flip, int line) { + TMS event = binopr2TM(opr); + int v2 = e2->u.info; /* K index */ + OpCode op = binopr2op(opr, OPR_ADD, OP_ADDK); + finishbinexpval(fs, e1, e2, op, v2, flip, line, OP_MMBINK, event); +} + + /* Try to code a binary operator negating its second operand. ** For the metamethod, 2nd operand must keep its original value. */ static int finishbinexpneg (FuncState *fs, expdesc *e1, expdesc *e2, OpCode op, int line, TMS event) { - if (!luaK_isKint(e2)) + if (!isKint(e2)) return 0; /* not an integer constant */ else { lua_Integer i2 = e2->u.ival; @@ -1437,24 +1484,27 @@ static void swapexps (expdesc *e1, expdesc *e2) { } +/* +** Code binary operators with no constant operand. +*/ +static void codebinNoK (FuncState *fs, BinOpr opr, + expdesc *e1, expdesc *e2, int flip, int line) { + if (flip) + swapexps(e1, e2); /* back to original order */ + codebinexpval(fs, opr, e1, e2, line); /* use standard operators */ +} + + /* ** Code arithmetic operators ('+', '-', ...). If second operand is a ** constant in the proper range, use variant opcodes with K operands. */ static void codearith (FuncState *fs, BinOpr opr, expdesc *e1, expdesc *e2, int flip, int line) { - TMS event = cast(TMS, opr + TM_ADD); - if (tonumeral(e2, NULL) && luaK_exp2K(fs, e2)) { /* K operand? */ - int v2 = e2->u.info; /* K index */ - OpCode op = cast(OpCode, opr + OP_ADDK); - finishbinexpval(fs, e1, e2, op, v2, flip, line, OP_MMBINK, event); - } - else { /* 'e2' is neither an immediate nor a K operand */ - OpCode op = cast(OpCode, opr + OP_ADD); - if (flip) - swapexps(e1, e2); /* back to original order */ - codebinexpval(fs, op, e1, e2, line); /* use standard operators */ - } + if (tonumeral(e2, NULL) && luaK_exp2K(fs, e2)) /* K operand? */ + codebinK(fs, opr, e1, e2, flip, line); + else /* 'e2' is neither an immediate nor a K operand */ + codebinNoK(fs, opr, e1, e2, flip, line); } @@ -1471,35 +1521,27 @@ static void codecommutative (FuncState *fs, BinOpr op, flip = 1; } if (op == OPR_ADD && isSCint(e2)) /* immediate operand? */ - codebini(fs, cast(OpCode, OP_ADDI), e1, e2, flip, line, TM_ADD); + codebini(fs, OP_ADDI, e1, e2, flip, line, TM_ADD); else codearith(fs, op, e1, e2, flip, line); } /* -** Code bitwise operations; they are all associative, so the function +** Code bitwise operations; they are all commutative, so the function ** tries to put an integer constant as the 2nd operand (a K operand). */ static void codebitwise (FuncState *fs, BinOpr opr, expdesc *e1, expdesc *e2, int line) { int flip = 0; - int v2; - OpCode op; - if (e1->k == VKINT && luaK_exp2RK(fs, e1)) { + if (e1->k == VKINT) { swapexps(e1, e2); /* 'e2' will be the constant operand */ flip = 1; } - else if (!(e2->k == VKINT && luaK_exp2RK(fs, e2))) { /* no constants? */ - op = cast(OpCode, opr + OP_ADD); - codebinexpval(fs, op, e1, e2, line); /* all-register opcodes */ - return; - } - v2 = e2->u.info; /* index in K array */ - op = cast(OpCode, opr + OP_ADDK); - lua_assert(ttisinteger(&fs->f->k[v2])); - finishbinexpval(fs, e1, e2, op, v2, flip, line, OP_MMBINK, - cast(TMS, opr + TM_ADD)); + if (e2->k == VKINT && luaK_exp2K(fs, e2)) /* K operand? */ + codebinK(fs, opr, e1, e2, flip, line); + else /* no constants */ + codebinNoK(fs, opr, e1, e2, flip, line); } @@ -1507,25 +1549,27 @@ static void codebitwise (FuncState *fs, BinOpr opr, ** Emit code for order comparisons. When using an immediate operand, ** 'isfloat' tells whether the original value was a float. */ -static void codeorder (FuncState *fs, OpCode op, expdesc *e1, expdesc *e2) { +static void codeorder (FuncState *fs, BinOpr opr, expdesc *e1, expdesc *e2) { int r1, r2; int im; int isfloat = 0; + OpCode op; if (isSCnumber(e2, &im, &isfloat)) { /* use immediate operand */ r1 = luaK_exp2anyreg(fs, e1); r2 = im; - op = cast(OpCode, (op - OP_LT) + OP_LTI); + op = binopr2op(opr, OPR_LT, OP_LTI); } else if (isSCnumber(e1, &im, &isfloat)) { /* transform (A < B) to (B > A) and (A <= B) to (B >= A) */ r1 = luaK_exp2anyreg(fs, e2); r2 = im; - op = (op == OP_LT) ? OP_GTI : OP_GEI; + op = binopr2op(opr, OPR_LT, OP_GTI); } else { /* regular case, compare two registers */ r1 = luaK_exp2anyreg(fs, e1); r2 = luaK_exp2anyreg(fs, e2); + op = binopr2op(opr, OPR_LT, OP_LT); } freeexps(fs, e1, e2); e1->u.info = condjump(fs, op, r1, r2, isfloat, 1); @@ -1551,7 +1595,7 @@ static void codeeq (FuncState *fs, BinOpr opr, expdesc *e1, expdesc *e2) { op = OP_EQI; r2 = im; /* immediate operand */ } - else if (luaK_exp2RK(fs, e2)) { /* 1st expression is constant? */ + else if (exp2RK(fs, e2)) { /* 2nd expression is constant? */ op = OP_EQK; r2 = e2->u.info; /* constant index */ } @@ -1568,16 +1612,16 @@ static void codeeq (FuncState *fs, BinOpr opr, expdesc *e1, expdesc *e2) { /* ** Apply prefix operation 'op' to expression 'e'. */ -void luaK_prefix (FuncState *fs, UnOpr op, expdesc *e, int line) { +void luaK_prefix (FuncState *fs, UnOpr opr, expdesc *e, int line) { static const expdesc ef = {VKINT, {0}, NO_JUMP, NO_JUMP}; luaK_dischargevars(fs, e); - switch (op) { + switch (opr) { case OPR_MINUS: case OPR_BNOT: /* use 'ef' as fake 2nd operand */ - if (constfolding(fs, op + LUA_OPUNM, e, &ef)) + if (constfolding(fs, opr + LUA_OPUNM, e, &ef)) break; /* else */ /* FALLTHROUGH */ case OPR_LEN: - codeunexpval(fs, cast(OpCode, op + OP_UNM), e, line); + codeunexpval(fs, unopr2op(opr), e, line); break; case OPR_NOT: codenot(fs, e); break; default: lua_assert(0); @@ -1611,12 +1655,13 @@ void luaK_infix (FuncState *fs, BinOpr op, expdesc *v) { case OPR_SHL: case OPR_SHR: { if (!tonumeral(v, NULL)) luaK_exp2anyreg(fs, v); - /* else keep numeral, which may be folded with 2nd operand */ + /* else keep numeral, which may be folded or used as an immediate + operand */ break; } case OPR_EQ: case OPR_NE: { if (!tonumeral(v, NULL)) - luaK_exp2RK(fs, v); + exp2RK(fs, v); /* else keep numeral, which may be an immediate operand */ break; } @@ -1706,30 +1751,27 @@ void luaK_posfix (FuncState *fs, BinOpr opr, /* coded as (r1 >> -I) */; } else /* regular case (two registers) */ - codebinexpval(fs, OP_SHL, e1, e2, line); + codebinexpval(fs, opr, e1, e2, line); break; } case OPR_SHR: { if (isSCint(e2)) codebini(fs, OP_SHRI, e1, e2, 0, line, TM_SHR); /* r1 >> I */ else /* regular case (two registers) */ - codebinexpval(fs, OP_SHR, e1, e2, line); + codebinexpval(fs, opr, e1, e2, line); break; } case OPR_EQ: case OPR_NE: { codeeq(fs, opr, e1, e2); break; } - case OPR_LT: case OPR_LE: { - OpCode op = cast(OpCode, (opr - OPR_EQ) + OP_EQ); - codeorder(fs, op, e1, e2); - break; - } case OPR_GT: case OPR_GE: { /* '(a > b)' <=> '(b < a)'; '(a >= b)' <=> '(b <= a)' */ - OpCode op = cast(OpCode, (opr - OPR_NE) + OP_EQ); swapexps(e1, e2); - codeorder(fs, op, e1, e2); + opr = cast(BinOpr, (opr - OPR_GT) + OPR_LT); + } /* FALLTHROUGH */ + case OPR_LT: case OPR_LE: { + codeorder(fs, opr, e1, e2); break; } default: lua_assert(0); diff --git a/3rdparty/lua/src/lcode.h b/3rdparty/lua/src/lcode.h index 3265824452639..0b971fc4359b9 100644 --- a/3rdparty/lua/src/lcode.h +++ b/3rdparty/lua/src/lcode.h @@ -61,10 +61,8 @@ typedef enum UnOpr { OPR_MINUS, OPR_BNOT, OPR_NOT, OPR_LEN, OPR_NOUNOPR } UnOpr; LUAI_FUNC int luaK_code (FuncState *fs, Instruction i); LUAI_FUNC int luaK_codeABx (FuncState *fs, OpCode o, int A, unsigned int Bx); -LUAI_FUNC int luaK_codeAsBx (FuncState *fs, OpCode o, int A, int Bx); LUAI_FUNC int luaK_codeABCk (FuncState *fs, OpCode o, int A, int B, int C, int k); -LUAI_FUNC int luaK_isKint (expdesc *e); LUAI_FUNC int luaK_exp2const (FuncState *fs, const expdesc *e, TValue *v); LUAI_FUNC void luaK_fixline (FuncState *fs, int line); LUAI_FUNC void luaK_nil (FuncState *fs, int from, int n); @@ -76,7 +74,6 @@ LUAI_FUNC int luaK_exp2anyreg (FuncState *fs, expdesc *e); LUAI_FUNC void luaK_exp2anyregup (FuncState *fs, expdesc *e); LUAI_FUNC void luaK_exp2nextreg (FuncState *fs, expdesc *e); LUAI_FUNC void luaK_exp2val (FuncState *fs, expdesc *e); -LUAI_FUNC int luaK_exp2RK (FuncState *fs, expdesc *e); LUAI_FUNC void luaK_self (FuncState *fs, expdesc *e, expdesc *key); LUAI_FUNC void luaK_indexed (FuncState *fs, expdesc *t, expdesc *k); LUAI_FUNC void luaK_goiftrue (FuncState *fs, expdesc *e); diff --git a/3rdparty/lua/src/lcorolib.c b/3rdparty/lua/src/lcorolib.c index 785a1e81aa0ad..c64adf08a8e1a 100644 --- a/3rdparty/lua/src/lcorolib.c +++ b/3rdparty/lua/src/lcorolib.c @@ -76,7 +76,7 @@ static int luaB_auxwrap (lua_State *L) { if (l_unlikely(r < 0)) { /* error? */ int stat = lua_status(co); if (stat != LUA_OK && stat != LUA_YIELD) { /* error in the coroutine? */ - stat = lua_resetthread(co); /* close its tbc variables */ + stat = lua_closethread(co, L); /* close its tbc variables */ lua_assert(stat != LUA_OK); lua_xmove(co, L, 1); /* move error message to the caller */ } @@ -172,7 +172,7 @@ static int luaB_close (lua_State *L) { int status = auxstatus(L, co); switch (status) { case COS_DEAD: case COS_YIELD: { - status = lua_resetthread(co); + status = lua_closethread(co, L); if (status == LUA_OK) { lua_pushboolean(L, 1); return 1; diff --git a/3rdparty/lua/src/ldebug.c b/3rdparty/lua/src/ldebug.c index a716d95e22f61..591b3528a778f 100644 --- a/3rdparty/lua/src/ldebug.c +++ b/3rdparty/lua/src/ldebug.c @@ -31,7 +31,7 @@ -#define noLuaClosure(f) ((f) == NULL || (f)->c.tt == LUA_VCCL) +#define LuaClosure(f) ((f) != NULL && (f)->c.tt == LUA_VLCL) static const char *funcnamefromcall (lua_State *L, CallInfo *ci, @@ -182,10 +182,10 @@ static const char *upvalname (const Proto *p, int uv) { static const char *findvararg (CallInfo *ci, int n, StkId *pos) { - if (clLvalue(s2v(ci->func))->p->is_vararg) { + if (clLvalue(s2v(ci->func.p))->p->is_vararg) { int nextra = ci->u.l.nextraargs; if (n >= -nextra) { /* 'n' is negative */ - *pos = ci->func - nextra - (n + 1); + *pos = ci->func.p - nextra - (n + 1); return "(vararg)"; /* generic name for any vararg */ } } @@ -194,7 +194,7 @@ static const char *findvararg (CallInfo *ci, int n, StkId *pos) { const char *luaG_findlocal (lua_State *L, CallInfo *ci, int n, StkId *pos) { - StkId base = ci->func + 1; + StkId base = ci->func.p + 1; const char *name = NULL; if (isLua(ci)) { if (n < 0) /* access to vararg values? */ @@ -203,7 +203,7 @@ const char *luaG_findlocal (lua_State *L, CallInfo *ci, int n, StkId *pos) { name = luaF_getlocalname(ci_func(ci)->p, n, currentpc(ci)); } if (name == NULL) { /* no 'standard' name? */ - StkId limit = (ci == L->ci) ? L->top : ci->next->func; + StkId limit = (ci == L->ci) ? L->top.p : ci->next->func.p; if (limit - base >= n && n > 0) { /* is 'n' inside 'ci' stack? */ /* generic name for any valid slot */ name = isLua(ci) ? "(temporary)" : "(C temporary)"; @@ -221,16 +221,16 @@ LUA_API const char *lua_getlocal (lua_State *L, const lua_Debug *ar, int n) { const char *name; lua_lock(L); if (ar == NULL) { /* information about non-active function? */ - if (!isLfunction(s2v(L->top - 1))) /* not a Lua function? */ + if (!isLfunction(s2v(L->top.p - 1))) /* not a Lua function? */ name = NULL; else /* consider live variables at function start (parameters) */ - name = luaF_getlocalname(clLvalue(s2v(L->top - 1))->p, n, 0); + name = luaF_getlocalname(clLvalue(s2v(L->top.p - 1))->p, n, 0); } else { /* active function; get information through 'ar' */ StkId pos = NULL; /* to avoid warnings */ name = luaG_findlocal(L, ar->i_ci, n, &pos); if (name) { - setobjs2s(L, L->top, pos); + setobjs2s(L, L->top.p, pos); api_incr_top(L); } } @@ -245,8 +245,8 @@ LUA_API const char *lua_setlocal (lua_State *L, const lua_Debug *ar, int n) { lua_lock(L); name = luaG_findlocal(L, ar->i_ci, n, &pos); if (name) { - setobjs2s(L, pos, L->top - 1); - L->top--; /* pop value */ + setobjs2s(L, pos, L->top.p - 1); + L->top.p--; /* pop value */ } lua_unlock(L); return name; @@ -254,7 +254,7 @@ LUA_API const char *lua_setlocal (lua_State *L, const lua_Debug *ar, int n) { static void funcinfo (lua_Debug *ar, Closure *cl) { - if (noLuaClosure(cl)) { + if (!LuaClosure(cl)) { ar->source = "=[C]"; ar->srclen = LL("=[C]"); ar->linedefined = -1; @@ -288,29 +288,31 @@ static int nextline (const Proto *p, int currentline, int pc) { static void collectvalidlines (lua_State *L, Closure *f) { - if (noLuaClosure(f)) { - setnilvalue(s2v(L->top)); + if (!LuaClosure(f)) { + setnilvalue(s2v(L->top.p)); api_incr_top(L); } else { - int i; - TValue v; const Proto *p = f->l.p; int currentline = p->linedefined; Table *t = luaH_new(L); /* new table to store active lines */ - sethvalue2s(L, L->top, t); /* push it on stack */ + sethvalue2s(L, L->top.p, t); /* push it on stack */ api_incr_top(L); - setbtvalue(&v); /* boolean 'true' to be the value of all indices */ - if (!p->is_vararg) /* regular function? */ - i = 0; /* consider all instructions */ - else { /* vararg function */ - lua_assert(GET_OPCODE(p->code[0]) == OP_VARARGPREP); - currentline = nextline(p, currentline, 0); - i = 1; /* skip first instruction (OP_VARARGPREP) */ - } - for (; i < p->sizelineinfo; i++) { /* for each instruction */ - currentline = nextline(p, currentline, i); /* get its line */ - luaH_setint(L, t, currentline, &v); /* table[line] = true */ + if (p->lineinfo != NULL) { /* proto with debug information? */ + int i; + TValue v; + setbtvalue(&v); /* boolean 'true' to be the value of all indices */ + if (!p->is_vararg) /* regular function? */ + i = 0; /* consider all instructions */ + else { /* vararg function */ + lua_assert(GET_OPCODE(p->code[0]) == OP_VARARGPREP); + currentline = nextline(p, currentline, 0); + i = 1; /* skip first instruction (OP_VARARGPREP) */ + } + for (; i < p->sizelineinfo; i++) { /* for each instruction */ + currentline = nextline(p, currentline, i); /* get its line */ + luaH_setint(L, t, currentline, &v); /* table[line] = true */ + } } } } @@ -339,7 +341,7 @@ static int auxgetinfo (lua_State *L, const char *what, lua_Debug *ar, } case 'u': { ar->nups = (f == NULL) ? 0 : f->c.nupvalues; - if (noLuaClosure(f)) { + if (!LuaClosure(f)) { ar->isvararg = 1; ar->nparams = 0; } @@ -388,20 +390,20 @@ LUA_API int lua_getinfo (lua_State *L, const char *what, lua_Debug *ar) { lua_lock(L); if (*what == '>') { ci = NULL; - func = s2v(L->top - 1); + func = s2v(L->top.p - 1); api_check(L, ttisfunction(func), "function expected"); what++; /* skip the '>' */ - L->top--; /* pop function */ + L->top.p--; /* pop function */ } else { ci = ar->i_ci; - func = s2v(ci->func); + func = s2v(ci->func.p); lua_assert(ttisfunction(func)); } cl = ttisclosure(func) ? clvalue(func) : NULL; status = auxgetinfo(L, what, ar, cl, ci); if (strchr(what, 'f')) { - setobj2s(L, L->top, func); + setobj2s(L, L->top.p, func); api_incr_top(L); } if (strchr(what, 'L')) @@ -417,40 +419,6 @@ LUA_API int lua_getinfo (lua_State *L, const char *what, lua_Debug *ar) { ** ======================================================= */ -static const char *getobjname (const Proto *p, int lastpc, int reg, - const char **name); - - -/* -** Find a "name" for the constant 'c'. -*/ -static void kname (const Proto *p, int c, const char **name) { - TValue *kvalue = &p->k[c]; - *name = (ttisstring(kvalue)) ? svalue(kvalue) : "?"; -} - - -/* -** Find a "name" for the register 'c'. -*/ -static void rname (const Proto *p, int pc, int c, const char **name) { - const char *what = getobjname(p, pc, c, name); /* search for 'c' */ - if (!(what && *what == 'c')) /* did not find a constant name? */ - *name = "?"; -} - - -/* -** Find a "name" for a 'C' value in an RK instruction. -*/ -static void rkname (const Proto *p, int pc, Instruction i, const char **name) { - int c = GETARG_C(i); /* key index */ - if (GETARG_k(i)) /* is 'c' a constant? */ - kname(p, c, name); - else /* 'c' is a register */ - rname(p, pc, c, name); -} - static int filterpc (int pc, int jmptarget) { if (pc < jmptarget) /* is code conditional (inside a jump)? */ @@ -509,28 +477,29 @@ static int findsetreg (const Proto *p, int lastpc, int reg) { /* -** Check whether table being indexed by instruction 'i' is the -** environment '_ENV' +** Find a "name" for the constant 'c'. */ -static const char *gxf (const Proto *p, int pc, Instruction i, int isup) { - int t = GETARG_B(i); /* table index */ - const char *name; /* name of indexed variable */ - if (isup) /* is an upvalue? */ - name = upvalname(p, t); - else - getobjname(p, pc, t, &name); - return (name && strcmp(name, LUA_ENV) == 0) ? "global" : "field"; +static const char *kname (const Proto *p, int index, const char **name) { + TValue *kvalue = &p->k[index]; + if (ttisstring(kvalue)) { + *name = getstr(tsvalue(kvalue)); + return "constant"; + } + else { + *name = "?"; + return NULL; + } } -static const char *getobjname (const Proto *p, int lastpc, int reg, - const char **name) { - int pc; - *name = luaF_getlocalname(p, reg + 1, lastpc); +static const char *basicgetobjname (const Proto *p, int *ppc, int reg, + const char **name) { + int pc = *ppc; + *name = luaF_getlocalname(p, reg + 1, pc); if (*name) /* is a local? */ return "local"; /* else try symbolic execution */ - pc = findsetreg(p, lastpc, reg); + *ppc = pc = findsetreg(p, pc, reg); if (pc != -1) { /* could find instruction? */ Instruction i = p->code[pc]; OpCode op = GET_OPCODE(i); @@ -538,18 +507,80 @@ static const char *getobjname (const Proto *p, int lastpc, int reg, case OP_MOVE: { int b = GETARG_B(i); /* move from 'b' to 'a' */ if (b < GETARG_A(i)) - return getobjname(p, pc, b, name); /* get name for 'b' */ + return basicgetobjname(p, ppc, b, name); /* get name for 'b' */ break; } + case OP_GETUPVAL: { + *name = upvalname(p, GETARG_B(i)); + return "upvalue"; + } + case OP_LOADK: return kname(p, GETARG_Bx(i), name); + case OP_LOADKX: return kname(p, GETARG_Ax(p->code[pc + 1]), name); + default: break; + } + } + return NULL; /* could not find reasonable name */ +} + + +/* +** Find a "name" for the register 'c'. +*/ +static void rname (const Proto *p, int pc, int c, const char **name) { + const char *what = basicgetobjname(p, &pc, c, name); /* search for 'c' */ + if (!(what && *what == 'c')) /* did not find a constant name? */ + *name = "?"; +} + + +/* +** Find a "name" for a 'C' value in an RK instruction. +*/ +static void rkname (const Proto *p, int pc, Instruction i, const char **name) { + int c = GETARG_C(i); /* key index */ + if (GETARG_k(i)) /* is 'c' a constant? */ + kname(p, c, name); + else /* 'c' is a register */ + rname(p, pc, c, name); +} + + +/* +** Check whether table being indexed by instruction 'i' is the +** environment '_ENV' +*/ +static const char *isEnv (const Proto *p, int pc, Instruction i, int isup) { + int t = GETARG_B(i); /* table index */ + const char *name; /* name of indexed variable */ + if (isup) /* is 't' an upvalue? */ + name = upvalname(p, t); + else /* 't' is a register */ + basicgetobjname(p, &pc, t, &name); + return (name && strcmp(name, LUA_ENV) == 0) ? "global" : "field"; +} + + +/* +** Extend 'basicgetobjname' to handle table accesses +*/ +static const char *getobjname (const Proto *p, int lastpc, int reg, + const char **name) { + const char *kind = basicgetobjname(p, &lastpc, reg, name); + if (kind != NULL) + return kind; + else if (lastpc != -1) { /* could find instruction? */ + Instruction i = p->code[lastpc]; + OpCode op = GET_OPCODE(i); + switch (op) { case OP_GETTABUP: { int k = GETARG_C(i); /* key index */ kname(p, k, name); - return gxf(p, pc, i, 1); + return isEnv(p, lastpc, i, 1); } case OP_GETTABLE: { int k = GETARG_C(i); /* key index */ - rname(p, pc, k, name); - return gxf(p, pc, i, 0); + rname(p, lastpc, k, name); + return isEnv(p, lastpc, i, 0); } case OP_GETI: { *name = "integer index"; @@ -558,24 +589,10 @@ static const char *getobjname (const Proto *p, int lastpc, int reg, case OP_GETFIELD: { int k = GETARG_C(i); /* key index */ kname(p, k, name); - return gxf(p, pc, i, 0); - } - case OP_GETUPVAL: { - *name = upvalname(p, GETARG_B(i)); - return "upvalue"; - } - case OP_LOADK: - case OP_LOADKX: { - int b = (op == OP_LOADK) ? GETARG_Bx(i) - : GETARG_Ax(p->code[pc + 1]); - if (ttisstring(&p->k[b])) { - *name = svalue(&p->k[b]); - return "constant"; - } - break; + return isEnv(p, lastpc, i, 0); } case OP_SELF: { - rkname(p, pc, i, name); + rkname(p, lastpc, i, name); return "method"; } default: break; /* go through to return NULL */ @@ -627,7 +644,7 @@ static const char *funcnamefromcode (lua_State *L, const Proto *p, default: return NULL; /* cannot find a reasonable name */ } - *name = getstr(G(L)->tmname[tm]) + 2; + *name = getshrstr(G(L)->tmname[tm]) + 2; return "metamethod"; } @@ -656,18 +673,19 @@ static const char *funcnamefromcall (lua_State *L, CallInfo *ci, /* -** Check whether pointer 'o' points to some value in the stack -** frame of the current function. Because 'o' may not point to a -** value in this stack, we cannot compare it with the region -** boundaries (undefined behaviour in ISO C). +** Check whether pointer 'o' points to some value in the stack frame of +** the current function and, if so, returns its index. Because 'o' may +** not point to a value in this stack, we cannot compare it with the +** region boundaries (undefined behavior in ISO C). */ -static int isinstack (CallInfo *ci, const TValue *o) { - StkId pos; - for (pos = ci->func + 1; pos < ci->top; pos++) { - if (o == s2v(pos)) - return 1; +static int instack (CallInfo *ci, const TValue *o) { + int pos; + StkId base = ci->func.p + 1; + for (pos = 0; base + pos < ci->top.p; pos++) { + if (o == s2v(base + pos)) + return pos; } - return 0; /* not found */ + return -1; /* not found */ } @@ -681,7 +699,7 @@ static const char *getupvalname (CallInfo *ci, const TValue *o, LClosure *c = ci_func(ci); int i; for (i = 0; i < c->nupvalues; i++) { - if (c->upvals[i]->v == o) { + if (c->upvals[i]->v.p == o) { *name = upvalname(c->p, i); return "upvalue"; } @@ -708,9 +726,11 @@ static const char *varinfo (lua_State *L, const TValue *o) { const char *kind = NULL; if (isLua(ci)) { kind = getupvalname(ci, o, &name); /* check whether 'o' is an upvalue */ - if (!kind && isinstack(ci, o)) /* no? try a register */ - kind = getobjname(ci_func(ci)->p, currentpc(ci), - cast_int(cast(StkId, o) - (ci->func + 1)), &name); + if (!kind) { /* not an upvalue? */ + int reg = instack(ci, o); /* try a register */ + if (reg >= 0) /* is 'o' a register? */ + kind = getobjname(ci_func(ci)->p, currentpc(ci), reg, &name); + } } return formatvarinfo(L, kind, name); } @@ -807,10 +827,10 @@ l_noret luaG_errormsg (lua_State *L) { if (L->errfunc != 0) { /* is there an error handling function? */ StkId errfunc = restorestack(L, L->errfunc); lua_assert(ttisfunction(s2v(errfunc))); - setobjs2s(L, L->top, L->top - 1); /* move argument */ - setobjs2s(L, L->top - 1, errfunc); /* push function */ - L->top++; /* assume EXTRA_STACK */ - luaD_callnoyield(L, L->top - 2, 1); /* call it */ + setobjs2s(L, L->top.p, L->top.p - 1); /* move argument */ + setobjs2s(L, L->top.p - 1, errfunc); /* push function */ + L->top.p++; /* assume EXTRA_STACK */ + luaD_callnoyield(L, L->top.p - 2, 1); /* call it */ } luaD_throw(L, LUA_ERRRUN); } @@ -824,8 +844,11 @@ l_noret luaG_runerror (lua_State *L, const char *fmt, ...) { va_start(argp, fmt); msg = luaO_pushvfstring(L, fmt, argp); /* format message */ va_end(argp); - if (isLua(ci)) /* if Lua function, add source:line information */ + if (isLua(ci)) { /* if Lua function, add source:line information */ luaG_addinfo(L, msg, ci_func(ci)->p->source, getcurrentline(ci)); + setobjs2s(L, L->top.p - 2, L->top.p - 1); /* remove 'msg' */ + L->top.p--; + } luaG_errormsg(L); } @@ -842,7 +865,7 @@ static int changedline (const Proto *p, int oldpc, int newpc) { if (p->lineinfo == NULL) /* no debug information? */ return 0; if (newpc - oldpc < MAXIWTHABS / 2) { /* not too far apart? */ - int delta = 0; /* line diference */ + int delta = 0; /* line difference */ int pc = oldpc; for (;;) { int lineinfo = p->lineinfo[++pc]; @@ -859,6 +882,28 @@ static int changedline (const Proto *p, int oldpc, int newpc) { } +/* +** Traces Lua calls. If code is running the first instruction of a function, +** and function is not vararg, and it is not coming from an yield, +** calls 'luaD_hookcall'. (Vararg functions will call 'luaD_hookcall' +** after adjusting its variable arguments; otherwise, they could call +** a line/count hook before the call hook. Functions coming from +** an yield already called 'luaD_hookcall' before yielding.) +*/ +int luaG_tracecall (lua_State *L) { + CallInfo *ci = L->ci; + Proto *p = ci_func(ci)->p; + ci->u.l.trap = 1; /* ensure hooks will be checked */ + if (ci->u.l.savedpc == p->code) { /* first instruction (not resuming)? */ + if (p->is_vararg) + return 0; /* hooks will start at VARARGPREP instruction */ + else if (!(ci->callstatus & CIST_HOOKYIELD)) /* not yieded? */ + luaD_hookcall(L, ci); /* check 'call' hook */ + } + return 1; /* keep 'trap' on */ +} + + /* ** Traces the execution of a Lua function. Called before the execution ** of each opcode, when debug is on. 'L->oldpc' stores the last @@ -869,7 +914,7 @@ static int changedline (const Proto *p, int oldpc, int newpc) { ** invalid; if so, use zero as a valid value. (A wrong but valid 'oldpc' ** at most causes an extra call to a line hook.) ** This function is not "Protected" when called, so it should correct -** 'L->top' before calling anything that can run the GC. +** 'L->top.p' before calling anything that can run the GC. */ int luaG_traceexec (lua_State *L, const Instruction *pc) { CallInfo *ci = L->ci; @@ -882,17 +927,17 @@ int luaG_traceexec (lua_State *L, const Instruction *pc) { } pc++; /* reference is always next instruction */ ci->u.l.savedpc = pc; /* save 'pc' */ - counthook = (--L->hookcount == 0 && (mask & LUA_MASKCOUNT)); + counthook = (mask & LUA_MASKCOUNT) && (--L->hookcount == 0); if (counthook) resethookcount(L); /* reset count */ else if (!(mask & LUA_MASKLINE)) return 1; /* no line hook and count != 0; nothing to be done now */ - if (ci->callstatus & CIST_HOOKYIELD) { /* called hook last time? */ + if (ci->callstatus & CIST_HOOKYIELD) { /* hook yielded last time? */ ci->callstatus &= ~CIST_HOOKYIELD; /* erase mark */ return 1; /* do not call hook again (VM yielded, so it did not move) */ } if (!isIT(*(ci->u.l.savedpc - 1))) /* top not being used? */ - L->top = ci->top; /* correct top */ + L->top.p = ci->top.p; /* correct top */ if (counthook) luaD_hook(L, LUA_HOOKCOUNT, -1, 0, 0); /* call count hook */ if (mask & LUA_MASKLINE) { @@ -909,7 +954,6 @@ int luaG_traceexec (lua_State *L, const Instruction *pc) { if (L->status == LUA_YIELD) { /* did hook yield? */ if (counthook) L->hookcount = 1; /* undo decrement to zero */ - ci->u.l.savedpc--; /* undo increment (resume will increment it again) */ ci->callstatus |= CIST_HOOKYIELD; /* mark that it yielded */ luaD_throw(L, LUA_YIELD); } diff --git a/3rdparty/lua/src/ldebug.h b/3rdparty/lua/src/ldebug.h index 974960e99da07..2bfce3cb5e77b 100644 --- a/3rdparty/lua/src/ldebug.h +++ b/3rdparty/lua/src/ldebug.h @@ -15,7 +15,7 @@ /* Active Lua function (given call info) */ -#define ci_func(ci) (clLvalue(s2v((ci)->func))) +#define ci_func(ci) (clLvalue(s2v((ci)->func.p))) #define resethookcount(L) (L->hookcount = L->basehookcount) @@ -58,6 +58,7 @@ LUAI_FUNC const char *luaG_addinfo (lua_State *L, const char *msg, TString *src, int line); LUAI_FUNC l_noret luaG_errormsg (lua_State *L); LUAI_FUNC int luaG_traceexec (lua_State *L, const Instruction *pc); +LUAI_FUNC int luaG_tracecall (lua_State *L); #endif diff --git a/3rdparty/lua/src/ldo.c b/3rdparty/lua/src/ldo.c index a48e35f9dba9f..ea0529507e02e 100644 --- a/3rdparty/lua/src/ldo.c +++ b/3rdparty/lua/src/ldo.c @@ -104,11 +104,11 @@ void luaD_seterrorobj (lua_State *L, int errcode, StkId oldtop) { } default: { lua_assert(errorstatus(errcode)); /* real error */ - setobjs2s(L, oldtop, L->top - 1); /* error message on current top */ + setobjs2s(L, oldtop, L->top.p - 1); /* error message on current top */ break; } } - L->top = oldtop + 1; + L->top.p = oldtop + 1; } @@ -121,7 +121,7 @@ l_noret luaD_throw (lua_State *L, int errcode) { global_State *g = G(L); errcode = luaE_resetthread(L, errcode); /* close all upvalues */ if (g->mainthread->errorJmp) { /* main thread has a handler? */ - setobjs2s(L, g->mainthread->top++, L->top - 1); /* copy error obj. */ + setobjs2s(L, g->mainthread->top.p++, L->top.p - 1); /* copy error obj. */ luaD_throw(g->mainthread, errcode); /* re-throw in main thread */ } else { /* no handler at all; abort */ @@ -157,16 +157,38 @@ int luaD_rawrunprotected (lua_State *L, Pfunc f, void *ud) { ** Stack reallocation ** =================================================================== */ -static void correctstack (lua_State *L, StkId oldstack, StkId newstack) { + + +/* +** Change all pointers to the stack into offsets. +*/ +static void relstack (lua_State *L) { + CallInfo *ci; + UpVal *up; + L->top.offset = savestack(L, L->top.p); + L->tbclist.offset = savestack(L, L->tbclist.p); + for (up = L->openupval; up != NULL; up = up->u.open.next) + up->v.offset = savestack(L, uplevel(up)); + for (ci = L->ci; ci != NULL; ci = ci->previous) { + ci->top.offset = savestack(L, ci->top.p); + ci->func.offset = savestack(L, ci->func.p); + } +} + + +/* +** Change back all offsets into pointers. +*/ +static void correctstack (lua_State *L) { CallInfo *ci; UpVal *up; - L->top = (L->top - oldstack) + newstack; - L->tbclist = (L->tbclist - oldstack) + newstack; + L->top.p = restorestack(L, L->top.offset); + L->tbclist.p = restorestack(L, L->tbclist.offset); for (up = L->openupval; up != NULL; up = up->u.open.next) - up->v = s2v((uplevel(up) - oldstack) + newstack); + up->v.p = s2v(restorestack(L, up->v.offset)); for (ci = L->ci; ci != NULL; ci = ci->previous) { - ci->top = (ci->top - oldstack) + newstack; - ci->func = (ci->func - oldstack) + newstack; + ci->top.p = restorestack(L, ci->top.offset); + ci->func.p = restorestack(L, ci->func.offset); if (isLua(ci)) ci->u.l.trap = 1; /* signal to update 'trap' in 'luaV_execute' */ } @@ -176,44 +198,45 @@ static void correctstack (lua_State *L, StkId oldstack, StkId newstack) { /* some space for error handling */ #define ERRORSTACKSIZE (LUAI_MAXSTACK + 200) - /* -** Reallocate the stack to a new size, correcting all pointers into -** it. (There are pointers to a stack from its upvalues, from its list -** of call infos, plus a few individual pointers.) The reallocation is -** done in two steps (allocation + free) because the correction must be -** done while both addresses (the old stack and the new one) are valid. -** (In ISO C, any pointer use after the pointer has been deallocated is -** undefined behavior.) +** Reallocate the stack to a new size, correcting all pointers into it. +** In ISO C, any pointer use after the pointer has been deallocated is +** undefined behavior. So, before the reallocation, all pointers are +** changed to offsets, and after the reallocation they are changed back +** to pointers. As during the reallocation the pointers are invalid, the +** reallocation cannot run emergency collections. +** ** In case of allocation error, raise an error or return false according ** to 'raiseerror'. */ int luaD_reallocstack (lua_State *L, int newsize, int raiseerror) { int oldsize = stacksize(L); int i; - StkId newstack = luaM_reallocvector(L, NULL, 0, - newsize + EXTRA_STACK, StackValue); + StkId newstack; + int oldgcstop = G(L)->gcstopem; lua_assert(newsize <= LUAI_MAXSTACK || newsize == ERRORSTACKSIZE); + relstack(L); /* change pointers to offsets */ + G(L)->gcstopem = 1; /* stop emergency collection */ + newstack = luaM_reallocvector(L, L->stack.p, oldsize + EXTRA_STACK, + newsize + EXTRA_STACK, StackValue); + G(L)->gcstopem = oldgcstop; /* restore emergency collection */ if (l_unlikely(newstack == NULL)) { /* reallocation failed? */ + correctstack(L); /* change offsets back to pointers */ if (raiseerror) luaM_error(L); else return 0; /* do not raise an error */ } - /* number of elements to be copied to the new stack */ - i = ((oldsize <= newsize) ? oldsize : newsize) + EXTRA_STACK; - memcpy(newstack, L->stack, i * sizeof(StackValue)); - for (; i < newsize + EXTRA_STACK; i++) + L->stack.p = newstack; + correctstack(L); /* change offsets back to pointers */ + L->stack_last.p = L->stack.p + newsize; + for (i = oldsize + EXTRA_STACK; i < newsize + EXTRA_STACK; i++) setnilvalue(s2v(newstack + i)); /* erase new segment */ - correctstack(L, L->stack, newstack); - luaM_freearray(L, L->stack, oldsize + EXTRA_STACK); - L->stack = newstack; - L->stack_last = L->stack + newsize; return 1; } /* -** Try to grow the stack by at least 'n' elements. when 'raiseerror' +** Try to grow the stack by at least 'n' elements. When 'raiseerror' ** is true, raises any error; otherwise, return 0 in case of errors. */ int luaD_growstack (lua_State *L, int n, int raiseerror) { @@ -227,35 +250,38 @@ int luaD_growstack (lua_State *L, int n, int raiseerror) { luaD_throw(L, LUA_ERRERR); /* error inside message handler */ return 0; /* if not 'raiseerror', just signal it */ } - else { + else if (n < LUAI_MAXSTACK) { /* avoids arithmetic overflows */ int newsize = 2 * size; /* tentative new size */ - int needed = cast_int(L->top - L->stack) + n; + int needed = cast_int(L->top.p - L->stack.p) + n; if (newsize > LUAI_MAXSTACK) /* cannot cross the limit */ newsize = LUAI_MAXSTACK; if (newsize < needed) /* but must respect what was asked for */ newsize = needed; if (l_likely(newsize <= LUAI_MAXSTACK)) return luaD_reallocstack(L, newsize, raiseerror); - else { /* stack overflow */ - /* add extra size to be able to handle the error message */ - luaD_reallocstack(L, ERRORSTACKSIZE, raiseerror); - if (raiseerror) - luaG_runerror(L, "stack overflow"); - return 0; - } } + /* else stack overflow */ + /* add extra size to be able to handle the error message */ + luaD_reallocstack(L, ERRORSTACKSIZE, raiseerror); + if (raiseerror) + luaG_runerror(L, "stack overflow"); + return 0; } +/* +** Compute how much of the stack is being used, by computing the +** maximum top of all call frames in the stack and the current top. +*/ static int stackinuse (lua_State *L) { CallInfo *ci; int res; - StkId lim = L->top; + StkId lim = L->top.p; for (ci = L->ci; ci != NULL; ci = ci->previous) { - if (lim < ci->top) lim = ci->top; + if (lim < ci->top.p) lim = ci->top.p; } - lua_assert(lim <= L->stack_last); - res = cast_int(lim - L->stack) + 1; /* part of stack in use */ + lua_assert(lim <= L->stack_last.p + EXTRA_STACK); + res = cast_int(lim - L->stack.p) + 1; /* part of stack in use */ if (res < LUA_MINSTACK) res = LUA_MINSTACK; /* ensure a minimum size */ return res; @@ -273,17 +299,13 @@ static int stackinuse (lua_State *L) { */ void luaD_shrinkstack (lua_State *L) { int inuse = stackinuse(L); - int nsize = inuse * 2; /* proposed new size */ - int max = inuse * 3; /* maximum "reasonable" size */ - if (max > LUAI_MAXSTACK) { - max = LUAI_MAXSTACK; /* respect stack limit */ - if (nsize > LUAI_MAXSTACK) - nsize = LUAI_MAXSTACK; - } + int max = (inuse > LUAI_MAXSTACK / 3) ? LUAI_MAXSTACK : inuse * 3; /* if thread is currently not handling a stack overflow and its size is larger than maximum "reasonable" size, shrink it */ - if (inuse <= LUAI_MAXSTACK && stacksize(L) > max) + if (inuse <= LUAI_MAXSTACK && stacksize(L) > max) { + int nsize = (inuse > LUAI_MAXSTACK / 2) ? LUAI_MAXSTACK : inuse * 2; luaD_reallocstack(L, nsize, 0); /* ok if that fails */ + } else /* don't change stack */ condmovestack(L,{},{}); /* (change only for debugging) */ luaE_shrinkCI(L); /* shrink CI list */ @@ -292,7 +314,7 @@ void luaD_shrinkstack (lua_State *L) { void luaD_inctop (lua_State *L) { luaD_checkstack(L, 1); - L->top++; + L->top.p++; } /* }================================================================== */ @@ -309,8 +331,8 @@ void luaD_hook (lua_State *L, int event, int line, if (hook && L->allowhook) { /* make sure there is a hook */ int mask = CIST_HOOKED; CallInfo *ci = L->ci; - ptrdiff_t top = savestack(L, L->top); /* preserve original 'top' */ - ptrdiff_t ci_top = savestack(L, ci->top); /* idem for 'ci->top' */ + ptrdiff_t top = savestack(L, L->top.p); /* preserve original 'top' */ + ptrdiff_t ci_top = savestack(L, ci->top.p); /* idem for 'ci->top' */ lua_Debug ar; ar.event = event; ar.currentline = line; @@ -320,11 +342,11 @@ void luaD_hook (lua_State *L, int event, int line, ci->u2.transferinfo.ftransfer = ftransfer; ci->u2.transferinfo.ntransfer = ntransfer; } - if (isLua(ci) && L->top < ci->top) - L->top = ci->top; /* protect entire activation register */ + if (isLua(ci) && L->top.p < ci->top.p) + L->top.p = ci->top.p; /* protect entire activation register */ luaD_checkstack(L, LUA_MINSTACK); /* ensure minimum stack size */ - if (ci->top < L->top + LUA_MINSTACK) - ci->top = L->top + LUA_MINSTACK; + if (ci->top.p < L->top.p + LUA_MINSTACK) + ci->top.p = L->top.p + LUA_MINSTACK; L->allowhook = 0; /* cannot call hooks inside a hook */ ci->callstatus |= mask; lua_unlock(L); @@ -332,8 +354,8 @@ void luaD_hook (lua_State *L, int event, int line, lua_lock(L); lua_assert(!L->allowhook); L->allowhook = 1; - ci->top = restorestack(L, ci_top); - L->top = restorestack(L, top); + ci->top.p = restorestack(L, ci_top); + L->top.p = restorestack(L, top); ci->callstatus &= ~mask; } } @@ -364,7 +386,7 @@ void luaD_hookcall (lua_State *L, CallInfo *ci) { */ static void rethook (lua_State *L, CallInfo *ci, int nres) { if (L->hookmask & LUA_MASKRET) { /* is return hook on? */ - StkId firstres = L->top - nres; /* index of first result */ + StkId firstres = L->top.p - nres; /* index of first result */ int delta = 0; /* correction for vararg functions */ int ftransfer; if (isLua(ci)) { @@ -372,10 +394,10 @@ static void rethook (lua_State *L, CallInfo *ci, int nres) { if (p->is_vararg) delta = ci->u.l.nextraargs + p->numparams + 1; } - ci->func += delta; /* if vararg, back to virtual 'func' */ - ftransfer = cast(unsigned short, firstres - ci->func); + ci->func.p += delta; /* if vararg, back to virtual 'func' */ + ftransfer = cast(unsigned short, firstres - ci->func.p); luaD_hook(L, LUA_HOOKRET, -1, ftransfer, nres); /* call it */ - ci->func -= delta; + ci->func.p -= delta; } if (isLua(ci = ci->previous)) L->oldpc = pcRel(ci->u.l.savedpc, ci_func(ci)->p); /* set 'oldpc' */ @@ -387,16 +409,16 @@ static void rethook (lua_State *L, CallInfo *ci, int nres) { ** stack, below original 'func', so that 'luaD_precall' can call it. Raise ** an error if there is no '__call' metafield. */ -StkId luaD_tryfuncTM (lua_State *L, StkId func) { +static StkId tryfuncTM (lua_State *L, StkId func) { const TValue *tm; StkId p; checkstackGCp(L, 1, func); /* space for metamethod */ tm = luaT_gettmbyobj(L, s2v(func), TM_CALL); /* (after previous GC) */ if (l_unlikely(ttisnil(tm))) luaG_callerror(L, s2v(func)); /* nothing to call */ - for (p = L->top; p > func; p--) /* open space for metamethod */ + for (p = L->top.p; p > func; p--) /* open space for metamethod */ setobjs2s(L, p, p-1); - L->top++; /* stack space pre-allocated by the caller */ + L->top.p++; /* stack space pre-allocated by the caller */ setobj2s(L, func, tm); /* metamethod is the new function to be called */ return func; } @@ -413,28 +435,29 @@ l_sinline void moveresults (lua_State *L, StkId res, int nres, int wanted) { int i; switch (wanted) { /* handle typical cases separately */ case 0: /* no values needed */ - L->top = res; + L->top.p = res; return; case 1: /* one value needed */ if (nres == 0) /* no results? */ setnilvalue(s2v(res)); /* adjust with nil */ else /* at least one result */ - setobjs2s(L, res, L->top - nres); /* move it to proper place */ - L->top = res + 1; + setobjs2s(L, res, L->top.p - nres); /* move it to proper place */ + L->top.p = res + 1; return; case LUA_MULTRET: wanted = nres; /* we want all results */ break; default: /* two/more results and/or to-be-closed variables */ if (hastocloseCfunc(wanted)) { /* to-be-closed variables? */ - ptrdiff_t savedres = savestack(L, res); L->ci->callstatus |= CIST_CLSRET; /* in case of yields */ L->ci->u2.nres = nres; - luaF_close(L, res, CLOSEKTOP, 1); + res = luaF_close(L, res, CLOSEKTOP, 1); L->ci->callstatus &= ~CIST_CLSRET; - if (L->hookmask) /* if needed, call hook after '__close's */ + if (L->hookmask) { /* if needed, call hook after '__close's */ + ptrdiff_t savedres = savestack(L, res); rethook(L, L->ci, nres); - res = restorestack(L, savedres); /* close and hook can move stack */ + res = restorestack(L, savedres); /* hook can move stack */ + } wanted = decodeNresults(wanted); if (wanted == LUA_MULTRET) wanted = nres; /* we want all results */ @@ -442,14 +465,14 @@ l_sinline void moveresults (lua_State *L, StkId res, int nres, int wanted) { break; } /* generic case */ - firstresult = L->top - nres; /* index of first result */ + firstresult = L->top.p - nres; /* index of first result */ if (nres > wanted) /* extra results? */ nres = wanted; /* don't need them */ for (i = 0; i < nres; i++) /* move all results to correct place */ setobjs2s(L, res + i, firstresult + i); for (; i < wanted; i++) /* complete wanted number of results */ setnilvalue(s2v(res + i)); - L->top = res + wanted; /* top points after the last result */ + L->top.p = res + wanted; /* top points after the last result */ } @@ -464,7 +487,7 @@ void luaD_poscall (lua_State *L, CallInfo *ci, int nres) { if (l_unlikely(L->hookmask && !hastocloseCfunc(wanted))) rethook(L, ci, nres); /* move results to proper place */ - moveresults(L, ci->func, nres, wanted); + moveresults(L, ci->func.p, nres, wanted); /* function cannot be in any of these cases when returning */ lua_assert(!(ci->callstatus & (CIST_HOOKED | CIST_YPCALL | CIST_FIN | CIST_TRAN | CIST_CLSRET))); @@ -479,10 +502,10 @@ void luaD_poscall (lua_State *L, CallInfo *ci, int nres) { l_sinline CallInfo *prepCallInfo (lua_State *L, StkId func, int nret, int mask, StkId top) { CallInfo *ci = L->ci = next_ci(L); /* new frame */ - ci->func = func; + ci->func.p = func; ci->nresults = nret; ci->callstatus = mask; - ci->top = top; + ci->top.p = top; return ci; } @@ -496,10 +519,10 @@ l_sinline int precallC (lua_State *L, StkId func, int nresults, CallInfo *ci; checkstackGCp(L, LUA_MINSTACK, func); /* ensure minimum stack size */ L->ci = ci = prepCallInfo(L, func, nresults, CIST_C, - L->top + LUA_MINSTACK); - lua_assert(ci->top <= L->stack_last); + L->top.p + LUA_MINSTACK); + lua_assert(ci->top.p <= L->stack_last.p); if (l_unlikely(L->hookmask & LUA_MASKCALL)) { - int narg = cast_int(L->top - func) - 1; + int narg = cast_int(L->top.p - func) - 1; luaD_hook(L, LUA_HOOKCALL, -1, 1, narg); } lua_unlock(L); @@ -531,21 +554,21 @@ int luaD_pretailcall (lua_State *L, CallInfo *ci, StkId func, int nfixparams = p->numparams; int i; checkstackGCp(L, fsize - delta, func); - ci->func -= delta; /* restore 'func' (if vararg) */ + ci->func.p -= delta; /* restore 'func' (if vararg) */ for (i = 0; i < narg1; i++) /* move down function and arguments */ - setobjs2s(L, ci->func + i, func + i); - func = ci->func; /* moved-down function */ + setobjs2s(L, ci->func.p + i, func + i); + func = ci->func.p; /* moved-down function */ for (; narg1 <= nfixparams; narg1++) setnilvalue(s2v(func + narg1)); /* complete missing arguments */ - ci->top = func + 1 + fsize; /* top for new function */ - lua_assert(ci->top <= L->stack_last); + ci->top.p = func + 1 + fsize; /* top for new function */ + lua_assert(ci->top.p <= L->stack_last.p); ci->u.l.savedpc = p->code; /* starting point */ ci->callstatus |= CIST_TAIL; - L->top = func + narg1; /* set top */ + L->top.p = func + narg1; /* set top */ return -1; } default: { /* not a function */ - func = luaD_tryfuncTM(L, func); /* try to get '__call' metamethod */ + func = tryfuncTM(L, func); /* try to get '__call' metamethod */ /* return luaD_pretailcall(L, ci, func, narg1 + 1, delta); */ narg1++; goto retry; /* try again */ @@ -574,19 +597,19 @@ CallInfo *luaD_precall (lua_State *L, StkId func, int nresults) { case LUA_VLCL: { /* Lua function */ CallInfo *ci; Proto *p = clLvalue(s2v(func))->p; - int narg = cast_int(L->top - func) - 1; /* number of real arguments */ + int narg = cast_int(L->top.p - func) - 1; /* number of real arguments */ int nfixparams = p->numparams; int fsize = p->maxstacksize; /* frame size */ checkstackGCp(L, fsize, func); L->ci = ci = prepCallInfo(L, func, nresults, 0, func + 1 + fsize); ci->u.l.savedpc = p->code; /* starting point */ for (; narg < nfixparams; narg++) - setnilvalue(s2v(L->top++)); /* complete missing arguments */ - lua_assert(ci->top <= L->stack_last); + setnilvalue(s2v(L->top.p++)); /* complete missing arguments */ + lua_assert(ci->top.p <= L->stack_last.p); return ci; } default: { /* not a function */ - func = luaD_tryfuncTM(L, func); /* try to get '__call' metamethod */ + func = tryfuncTM(L, func); /* try to get '__call' metamethod */ /* return luaD_precall(L, func, nresults); */ goto retry; /* try again with metamethod */ } @@ -598,12 +621,17 @@ CallInfo *luaD_precall (lua_State *L, StkId func, int nresults) { ** Call a function (C or Lua) through C. 'inc' can be 1 (increment ** number of recursive invocations in the C stack) or nyci (the same ** plus increment number of non-yieldable calls). +** This function can be called with some use of EXTRA_STACK, so it should +** check the stack before doing anything else. 'luaD_precall' already +** does that. */ -l_sinline void ccall (lua_State *L, StkId func, int nResults, int inc) { +l_sinline void ccall (lua_State *L, StkId func, int nResults, l_uint32 inc) { CallInfo *ci; L->nCcalls += inc; - if (l_unlikely(getCcalls(L) >= LUAI_MAXCCALLS)) + if (l_unlikely(getCcalls(L) >= LUAI_MAXCCALLS)) { + checkstackp(L, 0, func); /* free any use of EXTRA_STACK */ luaE_checkcstack(L); + } if ((ci = luaD_precall(L, func, nResults)) != NULL) { /* Lua function? */ ci->callstatus = CIST_FRESH; /* mark that it is a "fresh" execute */ luaV_execute(L, ci); /* call it */ @@ -651,8 +679,7 @@ static int finishpcallk (lua_State *L, CallInfo *ci) { else { /* error */ StkId func = restorestack(L, ci->u2.funcidx); L->allowhook = getoah(ci->callstatus); /* restore 'allowhook' */ - luaF_close(L, func, status, 1); /* can yield or raise an error */ - func = restorestack(L, ci->u2.funcidx); /* stack may be moved */ + func = luaF_close(L, func, status, 1); /* can yield or raise an error */ luaD_seterrorobj(L, status, func); luaD_shrinkstack(L); /* restore stack size in case of overflow */ setcistrecst(ci, LUA_OK); /* clear original status */ @@ -740,8 +767,8 @@ static CallInfo *findpcall (lua_State *L) { ** coroutine error handler and should not kill the coroutine.) */ static int resume_error (lua_State *L, const char *msg, int narg) { - L->top -= narg; /* remove args from the stack */ - setsvalue2s(L, L->top, luaS_new(L, msg)); /* push error message */ + L->top.p -= narg; /* remove args from the stack */ + setsvalue2s(L, L->top.p, luaS_new(L, msg)); /* push error message */ api_incr_top(L); lua_unlock(L); return LUA_ERRRUN; @@ -757,7 +784,7 @@ static int resume_error (lua_State *L, const char *msg, int narg) { */ static void resume (lua_State *L, void *ud) { int n = *(cast(int*, ud)); /* number of arguments */ - StkId firstArg = L->top - n; /* first argument */ + StkId firstArg = L->top.p - n; /* first argument */ CallInfo *ci = L->ci; if (L->status == LUA_OK) /* starting a coroutine? */ ccall(L, firstArg - 1, LUA_MULTRET, 0); /* just call its body */ @@ -765,7 +792,11 @@ static void resume (lua_State *L, void *ud) { lua_assert(L->status == LUA_YIELD); L->status = LUA_OK; /* mark that it is running (again) */ if (isLua(ci)) { /* yielded inside a hook? */ - L->top = firstArg; /* discard arguments */ + /* undo increment made by 'luaG_traceexec': instruction was not + executed yet */ + lua_assert(ci->callstatus & CIST_HOOKYIELD); + ci->u.l.savedpc--; + L->top.p = firstArg; /* discard arguments */ luaV_execute(L, ci); /* just continue running Lua code */ } else { /* 'common' yield */ @@ -808,7 +839,7 @@ LUA_API int lua_resume (lua_State *L, lua_State *from, int nargs, if (L->status == LUA_OK) { /* may be starting a coroutine */ if (L->ci != &L->base_ci) /* not in base level? */ return resume_error(L, "cannot resume non-suspended coroutine", nargs); - else if (L->top - (L->ci->func + 1) == nargs) /* no function? */ + else if (L->top.p - (L->ci->func.p + 1) == nargs) /* no function? */ return resume_error(L, "cannot resume dead coroutine", nargs); } else if (L->status != LUA_YIELD) /* ended with errors? */ @@ -826,11 +857,11 @@ LUA_API int lua_resume (lua_State *L, lua_State *from, int nargs, lua_assert(status == L->status); /* normal end or yield */ else { /* unrecoverable error */ L->status = cast_byte(status); /* mark thread as 'dead' */ - luaD_seterrorobj(L, status, L->top); /* push error message */ - L->ci->top = L->top; + luaD_seterrorobj(L, status, L->top.p); /* push error message */ + L->ci->top.p = L->top.p; } *nresults = (status == LUA_YIELD) ? L->ci->u2.nyield - : cast_int(L->top - (L->ci->func + 1)); + : cast_int(L->top.p - (L->ci->func.p + 1)); lua_unlock(L); return status; } @@ -985,7 +1016,7 @@ int luaD_protectedparser (lua_State *L, ZIO *z, const char *name, p.dyd.gt.arr = NULL; p.dyd.gt.size = 0; p.dyd.label.arr = NULL; p.dyd.label.size = 0; luaZ_initbuffer(L, &p.buff); - status = luaD_pcall(L, f_parser, &p, savestack(L, L->top), L->errfunc); + status = luaD_pcall(L, f_parser, &p, savestack(L, L->top.p), L->errfunc); luaZ_freebuffer(L, &p.buff); luaM_freearray(L, p.dyd.actvar.arr, p.dyd.actvar.size); luaM_freearray(L, p.dyd.gt.arr, p.dyd.gt.size); diff --git a/3rdparty/lua/src/ldo.h b/3rdparty/lua/src/ldo.h index 911e67f660a16..56008ab30f0af 100644 --- a/3rdparty/lua/src/ldo.h +++ b/3rdparty/lua/src/ldo.h @@ -8,6 +8,7 @@ #define ldo_h +#include "llimits.h" #include "lobject.h" #include "lstate.h" #include "lzio.h" @@ -23,7 +24,7 @@ ** at every check. */ #define luaD_checkstackaux(L,n,pre,pos) \ - if (l_unlikely(L->stack_last - L->top <= (n))) \ + if (l_unlikely(L->stack_last.p - L->top.p <= (n))) \ { pre; luaD_growstack(L, n, 1); pos; } \ else { condmovestack(L,pre,pos); } @@ -32,11 +33,18 @@ -#define savestack(L,p) ((char *)(p) - (char *)L->stack) -#define restorestack(L,n) ((StkId)((char *)L->stack + (n))) +#define savestack(L,pt) (cast_charp(pt) - cast_charp(L->stack.p)) +#define restorestack(L,n) cast(StkId, cast_charp(L->stack.p) + (n)) /* macro to check stack size, preserving 'p' */ +#define checkstackp(L,n,p) \ + luaD_checkstackaux(L, n, \ + ptrdiff_t t__ = savestack(L, p), /* save 'p' */ \ + p = restorestack(L, t__)) /* 'pos' part: restore 'p' */ + + +/* macro to check stack size and GC, preserving 'p' */ #define checkstackGCp(L,n,p) \ luaD_checkstackaux(L, n, \ ptrdiff_t t__ = savestack(L, p); /* save 'p' */ \ @@ -58,11 +66,11 @@ LUAI_FUNC int luaD_protectedparser (lua_State *L, ZIO *z, const char *name, LUAI_FUNC void luaD_hook (lua_State *L, int event, int line, int fTransfer, int nTransfer); LUAI_FUNC void luaD_hookcall (lua_State *L, CallInfo *ci); -LUAI_FUNC int luaD_pretailcall (lua_State *L, CallInfo *ci, StkId func, int narg1, int delta); +LUAI_FUNC int luaD_pretailcall (lua_State *L, CallInfo *ci, StkId func, + int narg1, int delta); LUAI_FUNC CallInfo *luaD_precall (lua_State *L, StkId func, int nResults); LUAI_FUNC void luaD_call (lua_State *L, StkId func, int nResults); LUAI_FUNC void luaD_callnoyield (lua_State *L, StkId func, int nResults); -LUAI_FUNC StkId luaD_tryfuncTM (lua_State *L, StkId func); LUAI_FUNC int luaD_closeprotected (lua_State *L, ptrdiff_t level, int status); LUAI_FUNC int luaD_pcall (lua_State *L, Pfunc func, void *u, ptrdiff_t oldtop, ptrdiff_t ef); diff --git a/3rdparty/lua/src/ldump.c b/3rdparty/lua/src/ldump.c index f848b669cbdd3..f231691b77955 100644 --- a/3rdparty/lua/src/ldump.c +++ b/3rdparty/lua/src/ldump.c @@ -10,6 +10,7 @@ #include "lprefix.h" +#include #include #include "lua.h" @@ -55,8 +56,11 @@ static void dumpByte (DumpState *D, int y) { } -/* dumpInt Buff Size */ -#define DIBS ((sizeof(size_t) * 8 / 7) + 1) +/* +** 'dumpSize' buffer size: each byte can store up to 7 bits. (The "+6" +** rounds up the division.) +*/ +#define DIBS ((sizeof(size_t) * CHAR_BIT + 6) / 7) static void dumpSize (DumpState *D, size_t x) { lu_byte buff[DIBS]; diff --git a/3rdparty/lua/src/lfunc.c b/3rdparty/lua/src/lfunc.c index f5889a21d12ea..0945f241de2d5 100644 --- a/3rdparty/lua/src/lfunc.c +++ b/3rdparty/lua/src/lfunc.c @@ -50,8 +50,8 @@ void luaF_initupvals (lua_State *L, LClosure *cl) { for (i = 0; i < cl->nupvalues; i++) { GCObject *o = luaC_newobj(L, LUA_VUPVAL, sizeof(UpVal)); UpVal *uv = gco2upv(o); - uv->v = &uv->u.value; /* make it closed */ - setnilvalue(uv->v); + uv->v.p = &uv->u.value; /* make it closed */ + setnilvalue(uv->v.p); cl->upvals[i] = uv; luaC_objbarrier(L, cl, uv); } @@ -62,12 +62,11 @@ void luaF_initupvals (lua_State *L, LClosure *cl) { ** Create a new upvalue at the given level, and link it to the list of ** open upvalues of 'L' after entry 'prev'. **/ -static UpVal *newupval (lua_State *L, int tbc, StkId level, UpVal **prev) { +static UpVal *newupval (lua_State *L, StkId level, UpVal **prev) { GCObject *o = luaC_newobj(L, LUA_VUPVAL, sizeof(UpVal)); UpVal *uv = gco2upv(o); UpVal *next = *prev; - uv->v = s2v(level); /* current value lives in the stack */ - uv->tbc = tbc; + uv->v.p = s2v(level); /* current value lives in the stack */ uv->u.open.next = next; /* link it to list of open upvalues */ uv->u.open.previous = prev; if (next) @@ -96,7 +95,7 @@ UpVal *luaF_findupval (lua_State *L, StkId level) { pp = &p->u.open.next; } /* not found: create a new upvalue after 'pp' */ - return newupval(L, 0, level, pp); + return newupval(L, level, pp); } @@ -106,12 +105,12 @@ UpVal *luaF_findupval (lua_State *L, StkId level) { ** (This function assumes EXTRA_STACK.) */ static void callclosemethod (lua_State *L, TValue *obj, TValue *err, int yy) { - StkId top = L->top; + StkId top = L->top.p; const TValue *tm = luaT_gettmbyobj(L, obj, TM_CLOSE); setobj2s(L, top, tm); /* will call metamethod... */ setobj2s(L, top + 1, obj); /* with 'self' as the 1st argument */ setobj2s(L, top + 2, err); /* and error msg. as 2nd argument */ - L->top = top + 3; /* add function and arguments */ + L->top.p = top + 3; /* add function and arguments */ if (yy) luaD_call(L, top, 0); else @@ -126,7 +125,7 @@ static void callclosemethod (lua_State *L, TValue *obj, TValue *err, int yy) { static void checkclosemth (lua_State *L, StkId level) { const TValue *tm = luaT_gettmbyobj(L, s2v(level), TM_CLOSE); if (ttisnil(tm)) { /* no metamethod? */ - int idx = cast_int(level - L->ci->func); /* variable index */ + int idx = cast_int(level - L->ci->func.p); /* variable index */ const char *vname = luaG_findlocal(L, L->ci, idx, NULL); if (vname == NULL) vname = "?"; luaG_runerror(L, "variable '%s' got a non-closable value", vname); @@ -160,23 +159,23 @@ static void prepcallclosemth (lua_State *L, StkId level, int status, int yy) { ** is used.) */ #define MAXDELTA \ - ((256ul << ((sizeof(L->stack->tbclist.delta) - 1) * 8)) - 1) + ((256ul << ((sizeof(L->stack.p->tbclist.delta) - 1) * 8)) - 1) /* ** Insert a variable in the list of to-be-closed variables. */ void luaF_newtbcupval (lua_State *L, StkId level) { - lua_assert(level > L->tbclist); + lua_assert(level > L->tbclist.p); if (l_isfalse(s2v(level))) return; /* false doesn't need to be closed */ checkclosemth(L, level); /* value must have a close method */ - while (cast_uint(level - L->tbclist) > MAXDELTA) { - L->tbclist += MAXDELTA; /* create a dummy node at maximum delta */ - L->tbclist->tbclist.delta = 0; + while (cast_uint(level - L->tbclist.p) > MAXDELTA) { + L->tbclist.p += MAXDELTA; /* create a dummy node at maximum delta */ + L->tbclist.p->tbclist.delta = 0; } - level->tbclist.delta = cast(unsigned short, level - L->tbclist); - L->tbclist = level; + level->tbclist.delta = cast(unsigned short, level - L->tbclist.p); + L->tbclist.p = level; } @@ -196,10 +195,10 @@ void luaF_closeupval (lua_State *L, StkId level) { StkId upl; /* stack index pointed by 'uv' */ while ((uv = L->openupval) != NULL && (upl = uplevel(uv)) >= level) { TValue *slot = &uv->u.value; /* new position for value */ - lua_assert(uplevel(uv) < L->top); + lua_assert(uplevel(uv) < L->top.p); luaF_unlinkupval(uv); /* remove upvalue from 'openupval' list */ - setobj(L, slot, uv->v); /* move value to upvalue slot */ - uv->v = slot; /* now current value lives here */ + setobj(L, slot, uv->v.p); /* move value to upvalue slot */ + uv->v.p = slot; /* now current value lives here */ if (!iswhite(uv)) { /* neither white nor dead? */ nw2black(uv); /* closed upvalues cannot be gray */ luaC_barrier(L, uv, slot); @@ -209,31 +208,32 @@ void luaF_closeupval (lua_State *L, StkId level) { /* -** Remove firt element from the tbclist plus its dummy nodes. +** Remove first element from the tbclist plus its dummy nodes. */ static void poptbclist (lua_State *L) { - StkId tbc = L->tbclist; + StkId tbc = L->tbclist.p; lua_assert(tbc->tbclist.delta > 0); /* first element cannot be dummy */ tbc -= tbc->tbclist.delta; - while (tbc > L->stack && tbc->tbclist.delta == 0) + while (tbc > L->stack.p && tbc->tbclist.delta == 0) tbc -= MAXDELTA; /* remove dummy nodes */ - L->tbclist = tbc; + L->tbclist.p = tbc; } /* ** Close all upvalues and to-be-closed variables up to the given stack -** level. +** level. Return restored 'level'. */ -void luaF_close (lua_State *L, StkId level, int status, int yy) { +StkId luaF_close (lua_State *L, StkId level, int status, int yy) { ptrdiff_t levelrel = savestack(L, level); luaF_closeupval(L, level); /* first, close the upvalues */ - while (L->tbclist >= level) { /* traverse tbc's down to that level */ - StkId tbc = L->tbclist; /* get variable index */ + while (L->tbclist.p >= level) { /* traverse tbc's down to that level */ + StkId tbc = L->tbclist.p; /* get variable index */ poptbclist(L); /* remove it from list */ prepcallclosemth(L, tbc, status, yy); /* close variable */ level = restorestack(L, levelrel); } + return level; } diff --git a/3rdparty/lua/src/lfunc.h b/3rdparty/lua/src/lfunc.h index dc1cebccd1bcb..3be265efb5848 100644 --- a/3rdparty/lua/src/lfunc.h +++ b/3rdparty/lua/src/lfunc.h @@ -29,10 +29,10 @@ #define MAXUPVAL 255 -#define upisopen(up) ((up)->v != &(up)->u.value) +#define upisopen(up) ((up)->v.p != &(up)->u.value) -#define uplevel(up) check_exp(upisopen(up), cast(StkId, (up)->v)) +#define uplevel(up) check_exp(upisopen(up), cast(StkId, (up)->v.p)) /* @@ -54,7 +54,7 @@ LUAI_FUNC void luaF_initupvals (lua_State *L, LClosure *cl); LUAI_FUNC UpVal *luaF_findupval (lua_State *L, StkId level); LUAI_FUNC void luaF_newtbcupval (lua_State *L, StkId level); LUAI_FUNC void luaF_closeupval (lua_State *L, StkId level); -LUAI_FUNC void luaF_close (lua_State *L, StkId level, int status, int yy); +LUAI_FUNC StkId luaF_close (lua_State *L, StkId level, int status, int yy); LUAI_FUNC void luaF_unlinkupval (UpVal *uv); LUAI_FUNC void luaF_freeproto (lua_State *L, Proto *f); LUAI_FUNC const char *luaF_getlocalname (const Proto *func, int local_number, diff --git a/3rdparty/lua/src/lgc.c b/3rdparty/lua/src/lgc.c index 42a73d813acca..5817f9eec35a4 100644 --- a/3rdparty/lua/src/lgc.c +++ b/3rdparty/lua/src/lgc.c @@ -252,12 +252,13 @@ void luaC_fix (lua_State *L, GCObject *o) { /* -** create a new collectable object (with given type and size) and link -** it to 'allgc' list. +** create a new collectable object (with given type, size, and offset) +** and link it to 'allgc' list. */ -GCObject *luaC_newobj (lua_State *L, int tt, size_t sz) { +GCObject *luaC_newobjdt (lua_State *L, int tt, size_t sz, size_t offset) { global_State *g = G(L); - GCObject *o = cast(GCObject *, luaM_newobject(L, novariant(tt), sz)); + char *p = cast_charp(luaM_newobject(L, novariant(tt), sz)); + GCObject *o = cast(GCObject *, p + offset); o->marked = luaC_white(g); o->tt = tt; o->next = g->allgc; @@ -265,6 +266,11 @@ GCObject *luaC_newobj (lua_State *L, int tt, size_t sz) { return o; } + +GCObject *luaC_newobj (lua_State *L, int tt, size_t sz) { + return luaC_newobjdt(L, tt, sz, 0); +} + /* }====================================================== */ @@ -301,7 +307,7 @@ static void reallymarkobject (global_State *g, GCObject *o) { set2gray(uv); /* open upvalues are kept gray */ else set2black(uv); /* closed upvalues are visited here */ - markvalue(g, uv->v); /* mark its content */ + markvalue(g, uv->v.p); /* mark its content */ break; } case LUA_VUSERDATA: { @@ -376,7 +382,7 @@ static int remarkupvals (global_State *g) { work++; if (!iswhite(uv)) { /* upvalue already visited? */ lua_assert(upisopen(uv) && isgray(uv)); - markvalue(g, uv->v); /* mark its value */ + markvalue(g, uv->v.p); /* mark its value */ } } } @@ -536,10 +542,12 @@ static void traversestrongtable (global_State *g, Table *h) { static lu_mem traversetable (global_State *g, Table *h) { const char *weakkey, *weakvalue; const TValue *mode = gfasttm(g, h->metatable, TM_MODE); + TString *smode; markobjectN(g, h->metatable); - if (mode && ttisstring(mode) && /* is there a weak mode? */ - (cast_void(weakkey = strchr(svalue(mode), 'k')), - cast_void(weakvalue = strchr(svalue(mode), 'v')), + if (mode && ttisshrstring(mode) && /* is there a weak mode? */ + (cast_void(smode = tsvalue(mode)), + cast_void(weakkey = strchr(getshrstr(smode), 'k')), + cast_void(weakvalue = strchr(getshrstr(smode), 'v')), (weakkey || weakvalue))) { /* is really weak? */ if (!weakkey) /* strong keys? */ traverseweakvalue(g, h); @@ -620,19 +628,21 @@ static int traverseLclosure (global_State *g, LClosure *cl) { */ static int traversethread (global_State *g, lua_State *th) { UpVal *uv; - StkId o = th->stack; + StkId o = th->stack.p; if (isold(th) || g->gcstate == GCSpropagate) linkgclist(th, g->grayagain); /* insert into 'grayagain' list */ if (o == NULL) return 1; /* stack not completely built yet */ lua_assert(g->gcstate == GCSatomic || th->openupval == NULL || isintwups(th)); - for (; o < th->top; o++) /* mark live elements in the stack */ + for (; o < th->top.p; o++) /* mark live elements in the stack */ markvalue(g, s2v(o)); for (uv = th->openupval; uv != NULL; uv = uv->u.open.next) markobject(g, uv); /* open upvalues cannot be collected */ if (g->gcstate == GCSatomic) { /* final traversal? */ - for (; o < th->stack_last + EXTRA_STACK; o++) + if (!g->gcemergency) + luaD_shrinkstack(th); /* do not change stack in emergency cycle */ + for (o = th->top.p; o < th->stack_last.p + EXTRA_STACK; o++) setnilvalue(s2v(o)); /* clear dead stack slice */ /* 'remarkupvals' may have removed thread from 'twups' list */ if (!isintwups(th) && th->openupval != NULL) { @@ -640,8 +650,6 @@ static int traversethread (global_State *g, lua_State *th) { g->twups = th; } } - else if (!g->gcemergency) - luaD_shrinkstack(th); /* do not change stack in emergency cycle */ return 1 + stacksize(th); } @@ -892,7 +900,7 @@ static GCObject *udata2finalize (global_State *g) { static void dothecall (lua_State *L, void *ud) { UNUSED(ud); - luaD_callnoyield(L, L->top - 2, 0); + luaD_callnoyield(L, L->top.p - 2, 0); } @@ -909,16 +917,16 @@ static void GCTM (lua_State *L) { int oldgcstp = g->gcstp; g->gcstp |= GCSTPGC; /* avoid GC steps */ L->allowhook = 0; /* stop debug hooks during GC metamethod */ - setobj2s(L, L->top++, tm); /* push finalizer... */ - setobj2s(L, L->top++, &v); /* ... and its argument */ + setobj2s(L, L->top.p++, tm); /* push finalizer... */ + setobj2s(L, L->top.p++, &v); /* ... and its argument */ L->ci->callstatus |= CIST_FIN; /* will run a finalizer */ - status = luaD_pcall(L, dothecall, NULL, savestack(L, L->top - 2), 0); + status = luaD_pcall(L, dothecall, NULL, savestack(L, L->top.p - 2), 0); L->ci->callstatus &= ~CIST_FIN; /* not running a finalizer anymore */ L->allowhook = oldah; /* restore hooks */ g->gcstp = oldgcstp; /* restore state */ if (l_unlikely(status != LUA_OK)) { /* error while running __gc? */ luaE_warnerror(L, "__gc"); - L->top--; /* pops error object */ + L->top.p--; /* pops error object */ } } } @@ -1041,7 +1049,25 @@ void luaC_checkfinalizer (lua_State *L, GCObject *o, Table *mt) { ** ======================================================= */ -static void setpause (global_State *g); + +/* +** Set the "time" to wait before starting a new GC cycle; cycle will +** start when memory use hits the threshold of ('estimate' * pause / +** PAUSEADJ). (Division by 'estimate' should be OK: it cannot be zero, +** because Lua cannot even start with less than PAUSEADJ bytes). +*/ +static void setpause (global_State *g) { + l_mem threshold, debt; + int pause = getgcparam(g->gcpause); + l_mem estimate = g->GCestimate / PAUSEADJ; /* adjust 'estimate' */ + lua_assert(estimate > 0); + threshold = (pause < MAX_LMEM / estimate) /* overflow? */ + ? estimate * pause /* no overflow */ + : MAX_LMEM; /* overflow; truncate to maximum */ + debt = gettotalbytes(g) - threshold; + if (debt > 0) debt = 0; + luaE_setdebt(g, debt); +} /* @@ -1285,6 +1311,15 @@ static void atomic2gen (lua_State *L, global_State *g) { } +/* +** Set debt for the next minor collection, which will happen when +** memory grows 'genminormul'%. +*/ +static void setminordebt (global_State *g) { + luaE_setdebt(g, -(cast(l_mem, (gettotalbytes(g) / 100)) * g->genminormul)); +} + + /* ** Enter generational mode. Must go until the end of an atomic cycle ** to ensure that all objects are correctly marked and weak tables @@ -1297,6 +1332,7 @@ static lu_mem entergen (lua_State *L, global_State *g) { luaC_runtilstate(L, bitmask(GCSpropagate)); /* start new cycle */ numobjs = atomic(L); /* propagates all and then do the atomic stuff */ atomic2gen(L, g); + setminordebt(g); /* set debt assuming next cycle will be minor */ return numobjs; } @@ -1342,15 +1378,6 @@ static lu_mem fullgen (lua_State *L, global_State *g) { } -/* -** Set debt for the next minor collection, which will happen when -** memory grows 'genminormul'%. -*/ -static void setminordebt (global_State *g) { - luaE_setdebt(g, -(cast(l_mem, (gettotalbytes(g) / 100)) * g->genminormul)); -} - - /* ** Does a major collection after last collection was a "bad collection". ** @@ -1384,7 +1411,7 @@ static void stepgenfull (lua_State *L, global_State *g) { setminordebt(g); } else { /* another bad collection; stay in incremental mode */ - g->GCestimate = gettotalbytes(g); /* first estimate */; + g->GCestimate = gettotalbytes(g); /* first estimate */ entersweep(L); luaC_runtilstate(L, bitmask(GCSpause)); /* finish collection */ setpause(g); @@ -1422,8 +1449,8 @@ static void genstep (lua_State *L, global_State *g) { lu_mem numobjs = fullgen(L, g); /* do a major collection */ if (gettotalbytes(g) < majorbase + (majorinc / 2)) { /* collected at least half of memory growth since last major - collection; keep doing minor collections */ - setminordebt(g); + collection; keep doing minor collections. */ + lua_assert(g->lastatomic == 0); } else { /* bad collection */ g->lastatomic = numobjs; /* signal that last collection was bad */ @@ -1449,26 +1476,6 @@ static void genstep (lua_State *L, global_State *g) { */ -/* -** Set the "time" to wait before starting a new GC cycle; cycle will -** start when memory use hits the threshold of ('estimate' * pause / -** PAUSEADJ). (Division by 'estimate' should be OK: it cannot be zero, -** because Lua cannot even start with less than PAUSEADJ bytes). -*/ -static void setpause (global_State *g) { - l_mem threshold, debt; - int pause = getgcparam(g->gcpause); - l_mem estimate = g->GCestimate / PAUSEADJ; /* adjust 'estimate' */ - lua_assert(estimate > 0); - threshold = (pause < MAX_LMEM / estimate) /* overflow? */ - ? estimate * pause /* no overflow */ - : MAX_LMEM; /* overflow; truncate to maximum */ - debt = gettotalbytes(g) - threshold; - if (debt > 0) debt = 0; - luaE_setdebt(g, debt); -} - - /* ** Enter first sweep phase. ** The call to 'sweeptolive' makes the pointer point to an object @@ -1599,7 +1606,7 @@ static lu_mem singlestep (lua_State *L) { case GCSenteratomic: { work = atomic(L); /* work is what was traversed by 'atomic' */ entersweep(L); - g->GCestimate = gettotalbytes(g); /* first estimate */; + g->GCestimate = gettotalbytes(g); /* first estimate */ break; } case GCSswpallgc: { /* sweep "regular" objects */ @@ -1676,12 +1683,15 @@ static void incstep (lua_State *L, global_State *g) { } /* -** performs a basic GC step if collector is running +** Performs a basic GC step if collector is running. (If collector is +** not running, set a reasonable debt to avoid it being called at +** every single check.) */ void luaC_step (lua_State *L) { global_State *g = G(L); - lua_assert(!g->gcemergency); - if (gcrunning(g)) { /* running? */ + if (!gcrunning(g)) /* not running? */ + luaE_setdebt(g, -2000); + else { if(isdecGCmodegen(g)) genstep(L, g); else @@ -1702,6 +1712,8 @@ static void fullinc (lua_State *L, global_State *g) { entersweep(L); /* sweep everything to turn them back to white */ /* finish any pending sweep phase to start a new cycle */ luaC_runtilstate(L, bitmask(GCSpause)); + luaC_runtilstate(L, bitmask(GCSpropagate)); /* start new cycle */ + g->gcstate = GCSenteratomic; /* go straight to atomic phase */ luaC_runtilstate(L, bitmask(GCScallfin)); /* run up to finalizers */ /* estimate must be correct after a full GC cycle */ lua_assert(g->GCestimate == gettotalbytes(g)); diff --git a/3rdparty/lua/src/lgc.h b/3rdparty/lua/src/lgc.h index 4a125634b9eac..538f6edcccf2a 100644 --- a/3rdparty/lua/src/lgc.h +++ b/3rdparty/lua/src/lgc.h @@ -172,24 +172,27 @@ #define luaC_checkGC(L) luaC_condGC(L,(void)0,(void)0) -#define luaC_barrier(L,p,v) ( \ - (iscollectable(v) && isblack(p) && iswhite(gcvalue(v))) ? \ - luaC_barrier_(L,obj2gco(p),gcvalue(v)) : cast_void(0)) - -#define luaC_barrierback(L,p,v) ( \ - (iscollectable(v) && isblack(p) && iswhite(gcvalue(v))) ? \ - luaC_barrierback_(L,p) : cast_void(0)) - #define luaC_objbarrier(L,p,o) ( \ (isblack(p) && iswhite(o)) ? \ luaC_barrier_(L,obj2gco(p),obj2gco(o)) : cast_void(0)) +#define luaC_barrier(L,p,v) ( \ + iscollectable(v) ? luaC_objbarrier(L,p,gcvalue(v)) : cast_void(0)) + +#define luaC_objbarrierback(L,p,o) ( \ + (isblack(p) && iswhite(o)) ? luaC_barrierback_(L,p) : cast_void(0)) + +#define luaC_barrierback(L,p,v) ( \ + iscollectable(v) ? luaC_objbarrierback(L, p, gcvalue(v)) : cast_void(0)) + LUAI_FUNC void luaC_fix (lua_State *L, GCObject *o); LUAI_FUNC void luaC_freeallobjects (lua_State *L); LUAI_FUNC void luaC_step (lua_State *L); LUAI_FUNC void luaC_runtilstate (lua_State *L, int statesmask); LUAI_FUNC void luaC_fullgc (lua_State *L, int isemergency); LUAI_FUNC GCObject *luaC_newobj (lua_State *L, int tt, size_t sz); +LUAI_FUNC GCObject *luaC_newobjdt (lua_State *L, int tt, size_t sz, + size_t offset); LUAI_FUNC void luaC_barrier_ (lua_State *L, GCObject *o, GCObject *v); LUAI_FUNC void luaC_barrierback_ (lua_State *L, GCObject *o); LUAI_FUNC void luaC_checkfinalizer (lua_State *L, GCObject *o, Table *mt); diff --git a/3rdparty/lua/src/liolib.c b/3rdparty/lua/src/liolib.c index b08397da45da6..c5075f3e78a98 100644 --- a/3rdparty/lua/src/liolib.c +++ b/3rdparty/lua/src/liolib.c @@ -245,8 +245,8 @@ static int f_gc (lua_State *L) { */ static int io_fclose (lua_State *L) { LStream *p = tolstream(L); - int res = fclose(p->f); - return luaL_fileresult(L, (res == 0), NULL); + errno = 0; + return luaL_fileresult(L, (fclose(p->f) == 0), NULL); } @@ -272,6 +272,7 @@ static int io_open (lua_State *L) { LStream *p = newfile(L); const char *md = mode; /* to traverse/check mode */ luaL_argcheck(L, l_checkmode(md), 2, "invalid mode"); + errno = 0; p->f = fopen(filename, mode); return (p->f == NULL) ? luaL_fileresult(L, 0, filename) : 1; } @@ -292,6 +293,7 @@ static int io_popen (lua_State *L) { const char *mode = luaL_optstring(L, 2, "r"); LStream *p = newprefile(L); luaL_argcheck(L, l_checkmodep(mode), 2, "invalid mode"); + errno = 0; p->f = l_popen(L, filename, mode); p->closef = &io_pclose; return (p->f == NULL) ? luaL_fileresult(L, 0, filename) : 1; @@ -300,6 +302,7 @@ static int io_popen (lua_State *L) { static int io_tmpfile (lua_State *L) { LStream *p = newfile(L); + errno = 0; p->f = tmpfile(); return (p->f == NULL) ? luaL_fileresult(L, 0, NULL) : 1; } @@ -567,6 +570,7 @@ static int g_read (lua_State *L, FILE *f, int first) { int nargs = lua_gettop(L) - 1; int n, success; clearerr(f); + errno = 0; if (nargs == 0) { /* no arguments? */ success = read_line(L, f, 1); n = first + 1; /* to return 1 result */ @@ -660,6 +664,7 @@ static int io_readline (lua_State *L) { static int g_write (lua_State *L, FILE *f, int arg) { int nargs = lua_gettop(L) - arg; int status = 1; + errno = 0; for (; nargs--; arg++) { if (lua_type(L, arg) == LUA_TNUMBER) { /* optimization: could be done exactly as for strings */ @@ -678,7 +683,8 @@ static int g_write (lua_State *L, FILE *f, int arg) { } if (l_likely(status)) return 1; /* file handle already on stack top */ - else return luaL_fileresult(L, status, NULL); + else + return luaL_fileresult(L, status, NULL); } @@ -703,6 +709,7 @@ static int f_seek (lua_State *L) { l_seeknum offset = (l_seeknum)p3; luaL_argcheck(L, (lua_Integer)offset == p3, 3, "not an integer in proper range"); + errno = 0; op = l_fseek(f, offset, mode[op]); if (l_unlikely(op)) return luaL_fileresult(L, 0, NULL); /* error */ @@ -719,19 +726,25 @@ static int f_setvbuf (lua_State *L) { FILE *f = tofile(L); int op = luaL_checkoption(L, 2, NULL, modenames); lua_Integer sz = luaL_optinteger(L, 3, LUAL_BUFFERSIZE); - int res = setvbuf(f, NULL, mode[op], (size_t)sz); + int res; + errno = 0; + res = setvbuf(f, NULL, mode[op], (size_t)sz); return luaL_fileresult(L, res == 0, NULL); } static int io_flush (lua_State *L) { - return luaL_fileresult(L, fflush(getiofile(L, IO_OUTPUT)) == 0, NULL); + FILE *f = getiofile(L, IO_OUTPUT); + errno = 0; + return luaL_fileresult(L, fflush(f) == 0, NULL); } static int f_flush (lua_State *L) { - return luaL_fileresult(L, fflush(tofile(L)) == 0, NULL); + FILE *f = tofile(L); + errno = 0; + return luaL_fileresult(L, fflush(f) == 0, NULL); } @@ -773,7 +786,7 @@ static const luaL_Reg meth[] = { ** metamethods for file handles */ static const luaL_Reg metameth[] = { - {"__index", NULL}, /* place holder */ + {"__index", NULL}, /* placeholder */ {"__gc", f_gc}, {"__close", f_gc}, {"__tostring", f_tostring}, diff --git a/3rdparty/lua/src/llex.c b/3rdparty/lua/src/llex.c index e99151787a63c..5fc39a5cdec17 100644 --- a/3rdparty/lua/src/llex.c +++ b/3rdparty/lua/src/llex.c @@ -128,7 +128,7 @@ l_noret luaX_syntaxerror (LexState *ls, const char *msg) { ** ensuring there is only one copy of each unique string. The table ** here is used as a set: the string enters as the key, while its value ** is irrelevant. We use the string itself as the value only because it -** is a TValue readly available. Later, the code generation can change +** is a TValue readily available. Later, the code generation can change ** this value. */ TString *luaX_newstring (LexState *ls, const char *str, size_t l) { @@ -138,12 +138,12 @@ TString *luaX_newstring (LexState *ls, const char *str, size_t l) { if (!ttisnil(o)) /* string already present? */ ts = keystrval(nodefromval(o)); /* get saved copy */ else { /* not in use yet */ - TValue *stv = s2v(L->top++); /* reserve stack space for string */ + TValue *stv = s2v(L->top.p++); /* reserve stack space for string */ setsvalue(L, stv, ts); /* temporarily anchor the string */ luaH_finishset(L, ls->h, stv, o, stv); /* t[string] = string */ /* table is not a metatable, so it does not need to invalidate cache */ luaC_checkGC(L); - L->top--; /* remove string from stack */ + L->top.p--; /* remove string from stack */ } return ts; } diff --git a/3rdparty/lua/src/llimits.h b/3rdparty/lua/src/llimits.h index 52a32f92e302e..1c826f7be205b 100644 --- a/3rdparty/lua/src/llimits.h +++ b/3rdparty/lua/src/llimits.h @@ -71,11 +71,24 @@ typedef signed char ls_byte; /* -** conversion of pointer to unsigned integer: -** this is for hashing only; there is no problem if the integer -** cannot hold the whole pointer value +** conversion of pointer to unsigned integer: this is for hashing only; +** there is no problem if the integer cannot hold the whole pointer +** value. (In strict ISO C this may cause undefined behavior, but no +** actual machine seems to bother.) */ -#define point2uint(p) ((unsigned int)((size_t)(p) & UINT_MAX)) +#if !defined(LUA_USE_C89) && defined(__STDC_VERSION__) && \ + __STDC_VERSION__ >= 199901L +#include +#if defined(UINTPTR_MAX) /* even in C99 this type is optional */ +#define L_P2I uintptr_t +#else /* no 'intptr'? */ +#define L_P2I uintmax_t /* use the largest available integer */ +#endif +#else /* C89 option */ +#define L_P2I size_t +#endif + +#define point2uint(p) ((unsigned int)((L_P2I)(p) & UINT_MAX)) diff --git a/3rdparty/lua/src/lmathlib.c b/3rdparty/lua/src/lmathlib.c index e0c61a168d986..4381063480840 100644 --- a/3rdparty/lua/src/lmathlib.c +++ b/3rdparty/lua/src/lmathlib.c @@ -249,6 +249,15 @@ static int math_type (lua_State *L) { ** =================================================================== */ +/* +** This code uses lots of shifts. ANSI C does not allow shifts greater +** than or equal to the width of the type being shifted, so some shifts +** are written in convoluted ways to match that restriction. For +** preprocessor tests, it assumes a width of 32 bits, so the maximum +** shift there is 31 bits. +*/ + + /* number of binary digits in the mantissa of a float */ #define FIGS l_floatatt(MANT_DIG) @@ -267,20 +276,23 @@ static int math_type (lua_State *L) { /* try to find an integer type with at least 64 bits */ -#if (ULONG_MAX >> 31 >> 31) >= 3 +#if ((ULONG_MAX >> 31) >> 31) >= 3 /* 'long' has at least 64 bits */ #define Rand64 unsigned long +#define SRand64 long #elif !defined(LUA_USE_C89) && defined(LLONG_MAX) /* there is a 'long long' type (which must have at least 64 bits) */ #define Rand64 unsigned long long +#define SRand64 long long -#elif (LUA_MAXUNSIGNED >> 31 >> 31) >= 3 +#elif ((LUA_MAXUNSIGNED >> 31) >> 31) >= 3 -/* 'lua_Integer' has at least 64 bits */ +/* 'lua_Unsigned' has at least 64 bits */ #define Rand64 lua_Unsigned +#define SRand64 lua_Integer #endif @@ -319,23 +331,30 @@ static Rand64 nextrand (Rand64 *state) { } -/* must take care to not shift stuff by more than 63 slots */ - - /* ** Convert bits from a random integer into a float in the ** interval [0,1), getting the higher FIG bits from the ** random unsigned integer and converting that to a float. +** Some old Microsoft compilers cannot cast an unsigned long +** to a floating-point number, so we use a signed long as an +** intermediary. When lua_Number is float or double, the shift ensures +** that 'sx' is non negative; in that case, a good compiler will remove +** the correction. */ /* must throw out the extra (64 - FIGS) bits */ #define shift64_FIG (64 - FIGS) -/* to scale to [0, 1), multiply by scaleFIG = 2^(-FIGS) */ +/* 2^(-FIGS) == 2^-1 / 2^(FIGS-1) */ #define scaleFIG (l_mathop(0.5) / ((Rand64)1 << (FIGS - 1))) static lua_Number I2d (Rand64 x) { - return (lua_Number)(trim64(x) >> shift64_FIG) * scaleFIG; + SRand64 sx = (SRand64)(trim64(x) >> shift64_FIG); + lua_Number res = (lua_Number)(sx) * scaleFIG; + if (sx < 0) + res += l_mathop(1.0); /* correct the two's complement if negative */ + lua_assert(0 <= res && res < 1); + return res; } /* convert a 'Rand64' to a 'lua_Unsigned' */ @@ -471,8 +490,6 @@ static lua_Number I2d (Rand64 x) { #else /* 32 < FIGS <= 64 */ -/* must take care to not shift stuff by more than 31 slots */ - /* 2^(-FIGS) = 1.0 / 2^30 / 2^3 / 2^(FIGS-33) */ #define scaleFIG \ (l_mathop(1.0) / (UONE << 30) / l_mathop(8.0) / (UONE << (FIGS - 33))) @@ -500,12 +517,12 @@ static lua_Number I2d (Rand64 x) { /* convert a 'Rand64' to a 'lua_Unsigned' */ static lua_Unsigned I2UInt (Rand64 x) { - return ((lua_Unsigned)trim32(x.h) << 31 << 1) | (lua_Unsigned)trim32(x.l); + return (((lua_Unsigned)trim32(x.h) << 31) << 1) | (lua_Unsigned)trim32(x.l); } /* convert a 'lua_Unsigned' to a 'Rand64' */ static Rand64 Int2I (lua_Unsigned n) { - return packI((lu_int32)(n >> 31 >> 1), (lu_int32)n); + return packI((lu_int32)((n >> 31) >> 1), (lu_int32)n); } #endif /* } */ diff --git a/3rdparty/lua/src/lmem.c b/3rdparty/lua/src/lmem.c index 9029d588c12e5..9800a86fc024f 100644 --- a/3rdparty/lua/src/lmem.c +++ b/3rdparty/lua/src/lmem.c @@ -22,25 +22,6 @@ #include "lstate.h" -#if defined(EMERGENCYGCTESTS) -/* -** First allocation will fail whenever not building initial state. -** (This fail will trigger 'tryagain' and a full GC cycle at every -** allocation.) -*/ -static void *firsttry (global_State *g, void *block, size_t os, size_t ns) { - if (completestate(g) && ns > 0) /* frees never fail */ - return NULL; /* fail */ - else /* normal allocation */ - return (*g->frealloc)(g->ud, block, os, ns); -} -#else -#define firsttry(g,block,os,ns) ((*g->frealloc)(g->ud, block, os, ns)) -#endif - - - - /* ** About the realloc function: @@ -60,6 +41,43 @@ static void *firsttry (global_State *g, void *block, size_t os, size_t ns) { */ +/* +** Macro to call the allocation function. +*/ +#define callfrealloc(g,block,os,ns) ((*g->frealloc)(g->ud, block, os, ns)) + + +/* +** When an allocation fails, it will try again after an emergency +** collection, except when it cannot run a collection. The GC should +** not be called while the state is not fully built, as the collector +** is not yet fully initialized. Also, it should not be called when +** 'gcstopem' is true, because then the interpreter is in the middle of +** a collection step. +*/ +#define cantryagain(g) (completestate(g) && !g->gcstopem) + + + + +#if defined(EMERGENCYGCTESTS) +/* +** First allocation will fail except when freeing a block (frees never +** fail) and when it cannot try again; this fail will trigger 'tryagain' +** and a full GC cycle at every allocation. +*/ +static void *firsttry (global_State *g, void *block, size_t os, size_t ns) { + if (ns > 0 && cantryagain(g)) + return NULL; /* fail */ + else /* normal allocation */ + return callfrealloc(g, block, os, ns); +} +#else +#define firsttry(g,block,os,ns) callfrealloc(g, block, os, ns) +#endif + + + /* @@ -132,7 +150,7 @@ l_noret luaM_toobig (lua_State *L) { void luaM_free_ (lua_State *L, void *block, size_t osize) { global_State *g = G(L); lua_assert((osize == 0) == (block == NULL)); - (*g->frealloc)(g->ud, block, osize, 0); + callfrealloc(g, block, osize, 0); g->GCdebt -= osize; } @@ -140,19 +158,15 @@ void luaM_free_ (lua_State *L, void *block, size_t osize) { /* ** In case of allocation fail, this function will do an emergency ** collection to free some memory and then try the allocation again. -** The GC should not be called while state is not fully built, as the -** collector is not yet fully initialized. Also, it should not be called -** when 'gcstopem' is true, because then the interpreter is in the -** middle of a collection step. */ static void *tryagain (lua_State *L, void *block, size_t osize, size_t nsize) { global_State *g = G(L); - if (completestate(g) && !g->gcstopem) { + if (cantryagain(g)) { luaC_fullgc(L, 1); /* try to free some memory... */ - return (*g->frealloc)(g->ud, block, osize, nsize); /* try again */ + return callfrealloc(g, block, osize, nsize); /* try again */ } - else return NULL; /* cannot free any memory without a full state */ + else return NULL; /* cannot run an emergency collection */ } diff --git a/3rdparty/lua/src/loadlib.c b/3rdparty/lua/src/loadlib.c index 6f9fa37366e46..6d289fcebb8ce 100644 --- a/3rdparty/lua/src/loadlib.c +++ b/3rdparty/lua/src/loadlib.c @@ -24,15 +24,6 @@ #include "lualib.h" -/* -** LUA_IGMARK is a mark to ignore all before it when building the -** luaopen_ function name. -*/ -#if !defined (LUA_IGMARK) -#define LUA_IGMARK "-" -#endif - - /* ** LUA_CSUBSEP is the character that replaces dots in submodule names ** when searching for a C loader. @@ -708,8 +699,13 @@ static const luaL_Reg ll_funcs[] = { static void createsearcherstable (lua_State *L) { - static const lua_CFunction searchers[] = - {searcher_preload, searcher_Lua, searcher_C, searcher_Croot, NULL}; + static const lua_CFunction searchers[] = { + searcher_preload, + searcher_Lua, + searcher_C, + searcher_Croot, + NULL + }; int i; /* create 'searchers' table */ lua_createtable(L, sizeof(searchers)/sizeof(searchers[0]) - 1, 0); diff --git a/3rdparty/lua/src/lobject.c b/3rdparty/lua/src/lobject.c index 301aa900be0ad..9cfa5227eb467 100644 --- a/3rdparty/lua/src/lobject.c +++ b/3rdparty/lua/src/lobject.c @@ -62,7 +62,7 @@ static lua_Integer intarith (lua_State *L, int op, lua_Integer v1, case LUA_OPBOR: return intop(|, v1, v2); case LUA_OPBXOR: return intop(^, v1, v2); case LUA_OPSHL: return luaV_shiftl(v1, v2); - case LUA_OPSHR: return luaV_shiftl(v1, -v2); + case LUA_OPSHR: return luaV_shiftr(v1, v2); case LUA_OPUNM: return intop(-, 0, v1); case LUA_OPBNOT: return intop(^, ~l_castS2U(0), v1); default: lua_assert(0); return 0; @@ -386,29 +386,39 @@ void luaO_tostring (lua_State *L, TValue *obj) { ** =================================================================== */ -/* size for buffer space used by 'luaO_pushvfstring' */ -#define BUFVFS 200 +/* +** Size for buffer space used by 'luaO_pushvfstring'. It should be +** (LUA_IDSIZE + MAXNUMBER2STR) + a minimal space for basic messages, +** so that 'luaG_addinfo' can work directly on the buffer. +*/ +#define BUFVFS (LUA_IDSIZE + MAXNUMBER2STR + 95) /* buffer used by 'luaO_pushvfstring' */ typedef struct BuffFS { lua_State *L; - int pushed; /* number of string pieces already on the stack */ + int pushed; /* true if there is a part of the result on the stack */ int blen; /* length of partial string in 'space' */ char space[BUFVFS]; /* holds last part of the result */ } BuffFS; /* -** Push given string to the stack, as part of the buffer, and -** join the partial strings in the stack into one. +** Push given string to the stack, as part of the result, and +** join it to previous partial result if there is one. +** It may call 'luaV_concat' while using one slot from EXTRA_STACK. +** This call cannot invoke metamethods, as both operands must be +** strings. It can, however, raise an error if the result is too +** long. In that case, 'luaV_concat' frees the extra slot before +** raising the error. */ -static void pushstr (BuffFS *buff, const char *str, size_t l) { +static void pushstr (BuffFS *buff, const char *str, size_t lstr) { lua_State *L = buff->L; - setsvalue2s(L, L->top, luaS_newlstr(L, str, l)); - L->top++; /* may use one extra slot */ - buff->pushed++; - luaV_concat(L, buff->pushed); /* join partial results into one */ - buff->pushed = 1; + setsvalue2s(L, L->top.p, luaS_newlstr(L, str, lstr)); + L->top.p++; /* may use one slot from EXTRA_STACK */ + if (!buff->pushed) /* no previous string on the stack? */ + buff->pushed = 1; /* now there is one */ + else /* join previous string with new one */ + luaV_concat(L, 2); } @@ -454,7 +464,7 @@ static void addstr2buff (BuffFS *buff, const char *str, size_t slen) { /* -** Add a number to the buffer. +** Add a numeral to the buffer. */ static void addnum2buff (BuffFS *buff, TValue *num) { char *numbuff = getbuff(buff, MAXNUMBER2STR); @@ -532,7 +542,7 @@ const char *luaO_pushvfstring (lua_State *L, const char *fmt, va_list argp) { addstr2buff(&buff, fmt, strlen(fmt)); /* rest of 'fmt' */ clearbuff(&buff); /* empty buffer into the stack */ lua_assert(buff.pushed == 1); - return svalue(s2v(L->top - 1)); + return getstr(tsvalue(s2v(L->top.p - 1))); } diff --git a/3rdparty/lua/src/lobject.h b/3rdparty/lua/src/lobject.h index 0e05b3e42ea92..980e42f8c27ac 100644 --- a/3rdparty/lua/src/lobject.h +++ b/3rdparty/lua/src/lobject.h @@ -52,6 +52,8 @@ typedef union Value { lua_CFunction f; /* light C functions */ lua_Integer i; /* integer numbers */ lua_Number n; /* float numbers */ + /* not used, but may avoid warnings for uninitialized value */ + lu_byte ub; } Value; @@ -155,6 +157,17 @@ typedef union StackValue { /* index to stack elements */ typedef StackValue *StkId; + +/* +** When reallocating the stack, change all pointers to the stack into +** proper offsets. +*/ +typedef union { + StkId p; /* actual pointer */ + ptrdiff_t offset; /* used while the stack is being reallocated */ +} StkIdRel; + + /* convert a 'StackValue' to a 'TValue' */ #define s2v(o) (&(o)->val) @@ -373,7 +386,7 @@ typedef struct GCObject { typedef struct TString { CommonHeader; lu_byte extra; /* reserved words for short strings; "has hash" for longs */ - lu_byte shrlen; /* length for short strings */ + lu_byte shrlen; /* length for short strings, 0xFF for long strings */ unsigned int hash; union { size_t lnglen; /* length for long strings */ @@ -385,19 +398,17 @@ typedef struct TString { /* -** Get the actual string (array of bytes) from a 'TString'. +** Get the actual string (array of bytes) from a 'TString'. (Generic +** version and specialized versions for long and short strings.) */ -#define getstr(ts) ((ts)->contents) - +#define getstr(ts) ((ts)->contents) +#define getlngstr(ts) check_exp((ts)->shrlen == 0xFF, (ts)->contents) +#define getshrstr(ts) check_exp((ts)->shrlen != 0xFF, (ts)->contents) -/* get the actual string (array of bytes) from a Lua value */ -#define svalue(o) getstr(tsvalue(o)) /* get string length from 'TString *s' */ -#define tsslen(s) ((s)->tt == LUA_VSHRSTR ? (s)->shrlen : (s)->u.lnglen) - -/* get string length from 'TValue *o' */ -#define vslen(o) tsslen(tsvalue(o)) +#define tsslen(s) \ + ((s)->shrlen != 0xFF ? (s)->shrlen : (s)->u.lnglen) /* }================================================================== */ @@ -615,8 +626,10 @@ typedef struct Proto { */ typedef struct UpVal { CommonHeader; - lu_byte tbc; /* true if it represents a to-be-closed variable */ - TValue *v; /* points to stack or to its own value */ + union { + TValue *p; /* points to stack or to its own value */ + ptrdiff_t offset; /* used while the stack is being reallocated */ + } v; union { struct { /* (when open) */ struct UpVal *next; /* linked list */ diff --git a/3rdparty/lua/src/lopcodes.h b/3rdparty/lua/src/lopcodes.h index 7c27451596065..46911cac14e09 100644 --- a/3rdparty/lua/src/lopcodes.h +++ b/3rdparty/lua/src/lopcodes.h @@ -21,7 +21,7 @@ iABC C(8) | B(8) |k| A(8) | Op(7) | iABx Bx(17) | A(8) | Op(7) | iAsBx sBx (signed)(17) | A(8) | Op(7) | iAx Ax(25) | Op(7) | -isJ sJ(25) | Op(7) | +isJ sJ (signed)(25) | Op(7) | A signed argument is represented in excess K: the represented value is the written unsigned value minus K, where K is half the maximum for the @@ -210,15 +210,15 @@ OP_LOADNIL,/* A B R[A], R[A+1], ..., R[A+B] := nil */ OP_GETUPVAL,/* A B R[A] := UpValue[B] */ OP_SETUPVAL,/* A B UpValue[B] := R[A] */ -OP_GETTABUP,/* A B C R[A] := UpValue[B][K[C]:string] */ +OP_GETTABUP,/* A B C R[A] := UpValue[B][K[C]:shortstring] */ OP_GETTABLE,/* A B C R[A] := R[B][R[C]] */ OP_GETI,/* A B C R[A] := R[B][C] */ -OP_GETFIELD,/* A B C R[A] := R[B][K[C]:string] */ +OP_GETFIELD,/* A B C R[A] := R[B][K[C]:shortstring] */ -OP_SETTABUP,/* A B C UpValue[A][K[B]:string] := RK(C) */ +OP_SETTABUP,/* A B C UpValue[A][K[B]:shortstring] := RK(C) */ OP_SETTABLE,/* A B C R[A][R[B]] := RK(C) */ OP_SETI,/* A B C R[A][B] := RK(C) */ -OP_SETFIELD,/* A B C R[A][K[B]:string] := RK(C) */ +OP_SETFIELD,/* A B C R[A][K[B]:shortstring] := RK(C) */ OP_NEWTABLE,/* A B C k R[A] := {} */ diff --git a/3rdparty/lua/src/loslib.c b/3rdparty/lua/src/loslib.c index 9fd22920fb5e3..f0c503b2751d2 100644 --- a/3rdparty/lua/src/loslib.c +++ b/3rdparty/lua/src/loslib.c @@ -34,23 +34,14 @@ */ #if !defined(LUA_STRFTIMEOPTIONS) /* { */ -/* options for ANSI C 89 (only 1-char options) */ -#define L_STRFTIMEC89 "aAbBcdHIjmMpSUwWxXyYZ%" - -/* options for ISO C 99 and POSIX */ -#define L_STRFTIMEC99 "aAbBcCdDeFgGhHIjmMnprRStTuUVwWxXyYzZ%" \ - "||" "EcECExEXEyEY" "OdOeOHOIOmOMOSOuOUOVOwOWOy" /* two-char options */ - -/* options for Windows */ -#define L_STRFTIMEWIN "aAbBcdHIjmMpSUwWxXyYzZ%" \ - "||" "#c#x#d#H#I#j#m#M#S#U#w#W#y#Y" /* two-char options */ - #if defined(LUA_USE_WINDOWS) -#define LUA_STRFTIMEOPTIONS L_STRFTIMEWIN -#elif defined(LUA_USE_C89) -#define LUA_STRFTIMEOPTIONS L_STRFTIMEC89 +#define LUA_STRFTIMEOPTIONS "aAbBcdHIjmMpSUwWxXyYzZ%" \ + "||" "#c#x#d#H#I#j#m#M#S#U#w#W#y#Y" /* two-char options */ +#elif defined(LUA_USE_C89) /* ANSI C 89 (only 1-char options) */ +#define LUA_STRFTIMEOPTIONS "aAbBcdHIjmMpSUwWxXyYZ%" #else /* C99 specification */ -#define LUA_STRFTIMEOPTIONS L_STRFTIMEC99 +#define LUA_STRFTIMEOPTIONS "aAbBcCdDeFgGhHIjmMnprRStTuUVwWxXyYzZ%" \ + "||" "EcECExEXEyEY" "OdOeOHOIOmOMOSOuOUOVOwOWOy" /* two-char options */ #endif #endif /* } */ @@ -142,6 +133,15 @@ /* }================================================================== */ +#if !defined(l_system) +#if defined(LUA_USE_IOS) +/* Despite claiming to be ISO C, iOS does not implement 'system'. */ +#define l_system(cmd) ((cmd) == NULL ? 0 : -1) +#else +#define l_system(cmd) system(cmd) /* default definition */ +#endif +#endif + static int os_execute (lua_State *L) { #if defined(__APPLE__) && (TARGET_OS_IOS || TARGET_OS_WATCH || TARGET_OS_TV) @@ -151,7 +151,7 @@ static int os_execute (lua_State *L) { const char *cmd = luaL_optstring(L, 1, NULL); int stat; errno = 0; - stat = system(cmd); + stat = l_system(cmd); if (cmd != NULL) return luaL_execresult(L, stat); else { @@ -164,6 +164,7 @@ static int os_execute (lua_State *L) { static int os_remove (lua_State *L) { const char *filename = luaL_checkstring(L, 1); + errno = 0; return luaL_fileresult(L, remove(filename) == 0, filename); } @@ -171,6 +172,7 @@ static int os_remove (lua_State *L) { static int os_rename (lua_State *L) { const char *fromname = luaL_checkstring(L, 1); const char *toname = luaL_checkstring(L, 2); + errno = 0; return luaL_fileresult(L, rename(fromname, toname) == 0, NULL); } @@ -269,9 +271,7 @@ static int getfield (lua_State *L, const char *key, int d, int delta) { res = d; } else { - /* unsigned avoids overflow when lua_Integer has 32 bits */ - if (!(res >= 0 ? (lua_Unsigned)res <= (lua_Unsigned)INT_MAX + delta - : (lua_Integer)INT_MIN + delta <= res)) + if (!(res >= 0 ? res - delta <= INT_MAX : INT_MIN + delta <= res)) return luaL_error(L, "field '%s' is out-of-bound", key); res -= delta; } diff --git a/3rdparty/lua/src/lparser.c b/3rdparty/lua/src/lparser.c index 3abe3d75187b7..2b888c7cff177 100644 --- a/3rdparty/lua/src/lparser.c +++ b/3rdparty/lua/src/lparser.c @@ -468,6 +468,7 @@ static void singlevar (LexState *ls, expdesc *var) { expdesc key; singlevaraux(fs, ls->envn, var, 1); /* get environment variable */ lua_assert(var->k != VVOID); /* this one must exist */ + luaK_exp2anyregup(fs, var); /* but could be a constant */ codestring(&key, varname); /* key is variable name */ luaK_indexed(fs, var, &key); /* env[varname] */ } @@ -520,12 +521,12 @@ static l_noret jumpscopeerror (LexState *ls, Labeldesc *gt) { /* ** Solves the goto at index 'g' to given 'label' and removes it -** from the list of pending goto's. +** from the list of pending gotos. ** If it jumps into the scope of some variable, raises an error. */ static void solvegoto (LexState *ls, int g, Labeldesc *label) { int i; - Labellist *gl = &ls->dyd->gt; /* list of goto's */ + Labellist *gl = &ls->dyd->gt; /* list of gotos */ Labeldesc *gt = &gl->arr[g]; /* goto to be resolved */ lua_assert(eqstr(gt->name, label->name)); if (l_unlikely(gt->nactvar < label->nactvar)) /* enter some scope? */ @@ -579,7 +580,7 @@ static int newgotoentry (LexState *ls, TString *name, int line, int pc) { /* ** Solves forward jumps. Check whether new label 'lb' matches any ** pending gotos in current block and solves them. Return true -** if any of the goto's need to close upvalues. +** if any of the gotos need to close upvalues. */ static int solvegotos (LexState *ls, Labeldesc *lb) { Labellist *gl = &ls->dyd->gt; @@ -600,7 +601,7 @@ static int solvegotos (LexState *ls, Labeldesc *lb) { /* ** Create a new label with the given 'name' at the given 'line'. ** 'last' tells whether label is the last non-op statement in its -** block. Solves all pending goto's to this new label and adds +** block. Solves all pending gotos to this new label and adds ** a close instruction if necessary. ** Returns true iff it added a close instruction. */ @@ -673,19 +674,19 @@ static void leaveblock (FuncState *fs) { LexState *ls = fs->ls; int hasclose = 0; int stklevel = reglevel(fs, bl->nactvar); /* level outside the block */ - if (bl->isloop) /* fix pending breaks? */ + removevars(fs, bl->nactvar); /* remove block locals */ + lua_assert(bl->nactvar == fs->nactvar); /* back to level on entry */ + if (bl->isloop) /* has to fix pending breaks? */ hasclose = createlabel(ls, luaS_newliteral(ls->L, "break"), 0, 0); - if (!hasclose && bl->previous && bl->upval) + if (!hasclose && bl->previous && bl->upval) /* still need a 'close'? */ luaK_codeABC(fs, OP_CLOSE, stklevel, 0, 0); - fs->bl = bl->previous; - removevars(fs, bl->nactvar); - lua_assert(bl->nactvar == fs->nactvar); fs->freereg = stklevel; /* free registers */ ls->dyd->label.n = bl->firstlabel; /* remove local labels */ - if (bl->previous) /* inner block? */ - movegotosout(fs, bl); /* update pending gotos to outer block */ + fs->bl = bl->previous; /* current block now is previous one */ + if (bl->previous) /* was it a nested block? */ + movegotosout(fs, bl); /* update pending gotos to enclosing block */ else { - if (bl->firstgoto < ls->dyd->gt.n) /* pending gotos in outer block? */ + if (bl->firstgoto < ls->dyd->gt.n) /* still pending gotos? */ undefgoto(ls, &ls->dyd->gt.arr[bl->firstgoto]); /* error */ } } @@ -1021,10 +1022,11 @@ static int explist (LexState *ls, expdesc *v) { } -static void funcargs (LexState *ls, expdesc *f, int line) { +static void funcargs (LexState *ls, expdesc *f) { FuncState *fs = ls->fs; expdesc args; int base, nparams; + int line = ls->linenumber; switch (ls->t.token) { case '(': { /* funcargs -> '(' [ explist ] ')' */ luaX_next(ls); @@ -1062,8 +1064,8 @@ static void funcargs (LexState *ls, expdesc *f, int line) { } init_exp(f, VCALL, luaK_codeABC(fs, OP_CALL, base, nparams+1, 2)); luaK_fixline(fs, line); - fs->freereg = base+1; /* call remove function and arguments and leaves - (unless changed) one result */ + fs->freereg = base+1; /* call removes function and arguments and leaves + one result (unless changed later) */ } @@ -1102,7 +1104,6 @@ static void suffixedexp (LexState *ls, expdesc *v) { /* suffixedexp -> primaryexp { '.' NAME | '[' exp ']' | ':' NAME funcargs | funcargs } */ FuncState *fs = ls->fs; - int line = ls->linenumber; primaryexp(ls, v); for (;;) { switch (ls->t.token) { @@ -1122,12 +1123,12 @@ static void suffixedexp (LexState *ls, expdesc *v) { luaX_next(ls); codename(ls, &key); luaK_self(fs, v, &key); - funcargs(ls, v, line); + funcargs(ls, v); break; } case '(': case TK_STRING: case '{': { /* funcargs */ luaK_exp2nextreg(fs, v); - funcargs(ls, v, line); + funcargs(ls, v); break; } default: return; @@ -1943,10 +1944,10 @@ LClosure *luaY_parser (lua_State *L, ZIO *z, Mbuffer *buff, LexState lexstate; FuncState funcstate; LClosure *cl = luaF_newLclosure(L, 1); /* create main closure */ - setclLvalue2s(L, L->top, cl); /* anchor it (to avoid being collected) */ + setclLvalue2s(L, L->top.p, cl); /* anchor it (to avoid being collected) */ luaD_inctop(L); lexstate.h = luaH_new(L); /* create table for scanner */ - sethvalue2s(L, L->top, lexstate.h); /* anchor it */ + sethvalue2s(L, L->top.p, lexstate.h); /* anchor it */ luaD_inctop(L); funcstate.f = cl->p = luaF_newproto(L); luaC_objbarrier(L, cl, cl->p); @@ -1960,7 +1961,7 @@ LClosure *luaY_parser (lua_State *L, ZIO *z, Mbuffer *buff, lua_assert(!funcstate.prev && funcstate.nups == 1 && !lexstate.fs); /* all scopes should be correctly finished */ lua_assert(dyd->actvar.n == 0 && dyd->gt.n == 0 && dyd->label.n == 0); - L->top--; /* remove scanner's table */ + L->top.p--; /* remove scanner's table */ return cl; /* closure is on the stack, too */ } diff --git a/3rdparty/lua/src/lstate.c b/3rdparty/lua/src/lstate.c index 1ffe1a0f71cde..7fefacba2c17c 100644 --- a/3rdparty/lua/src/lstate.c +++ b/3rdparty/lua/src/lstate.c @@ -119,7 +119,7 @@ CallInfo *luaE_extendCI (lua_State *L) { /* ** free all CallInfo structures not in use by a thread */ -void luaE_freeCI (lua_State *L) { +static void freeCI (lua_State *L) { CallInfo *ci = L->ci; CallInfo *next = ci->next; ci->next = NULL; @@ -180,33 +180,33 @@ LUAI_FUNC void luaE_incCstack (lua_State *L) { static void stack_init (lua_State *L1, lua_State *L) { int i; CallInfo *ci; /* initialize stack array */ - L1->stack = luaM_newvector(L, BASIC_STACK_SIZE + EXTRA_STACK, StackValue); - L1->tbclist = L1->stack; + L1->stack.p = luaM_newvector(L, BASIC_STACK_SIZE + EXTRA_STACK, StackValue); + L1->tbclist.p = L1->stack.p; for (i = 0; i < BASIC_STACK_SIZE + EXTRA_STACK; i++) - setnilvalue(s2v(L1->stack + i)); /* erase new stack */ - L1->top = L1->stack; - L1->stack_last = L1->stack + BASIC_STACK_SIZE; + setnilvalue(s2v(L1->stack.p + i)); /* erase new stack */ + L1->top.p = L1->stack.p; + L1->stack_last.p = L1->stack.p + BASIC_STACK_SIZE; /* initialize first ci */ ci = &L1->base_ci; ci->next = ci->previous = NULL; ci->callstatus = CIST_C; - ci->func = L1->top; + ci->func.p = L1->top.p; ci->u.c.k = NULL; ci->nresults = 0; - setnilvalue(s2v(L1->top)); /* 'function' entry for this 'ci' */ - L1->top++; - ci->top = L1->top + LUA_MINSTACK; + setnilvalue(s2v(L1->top.p)); /* 'function' entry for this 'ci' */ + L1->top.p++; + ci->top.p = L1->top.p + LUA_MINSTACK; L1->ci = ci; } static void freestack (lua_State *L) { - if (L->stack == NULL) + if (L->stack.p == NULL) return; /* stack not completely built yet */ L->ci = &L->base_ci; /* free the entire 'ci' list */ - luaE_freeCI(L); + freeCI(L); lua_assert(L->nci == 0); - luaM_freearray(L, L->stack, stacksize(L) + EXTRA_STACK); /* free stack */ + luaM_freearray(L, L->stack.p, stacksize(L) + EXTRA_STACK); /* free stack */ } @@ -248,7 +248,7 @@ static void f_luaopen (lua_State *L, void *ud) { */ static void preinit_thread (lua_State *L, global_State *g) { G(L) = g; - L->stack = NULL; + L->stack.p = NULL; L->ci = NULL; L->nci = 0; L->twups = L; /* thread has no upvalues */ @@ -284,20 +284,16 @@ static void close_state (lua_State *L) { LUA_API lua_State *lua_newthread (lua_State *L) { - global_State *g; + global_State *g = G(L); + GCObject *o; lua_State *L1; lua_lock(L); - g = G(L); luaC_checkGC(L); /* create new thread */ - L1 = &cast(LX *, luaM_newobject(L, LUA_TTHREAD, sizeof(LX)))->l; - L1->marked = luaC_white(g); - L1->tt = LUA_VTHREAD; - /* link it on list 'allgc' */ - L1->next = g->allgc; - g->allgc = obj2gco(L1); + o = luaC_newobjdt(L, LUA_TTHREAD, sizeof(LX), offsetof(LX, l)); + L1 = gco2th(o); /* anchor it on L stack */ - setthvalue2s(L, L->top, L1); + setthvalue2s(L, L->top.p, L1); api_incr_top(L); preinit_thread(L1, g); L1->hookmask = L->hookmask; @@ -316,7 +312,7 @@ LUA_API lua_State *lua_newthread (lua_State *L) { void luaE_freethread (lua_State *L, lua_State *L1) { LX *l = fromstate(L1); - luaF_closeupval(L1, L1->stack); /* close all upvalues */ + luaF_closeupval(L1, L1->stack.p); /* close all upvalues */ lua_assert(L1->openupval == NULL); luai_userstatefree(L, L1); freestack(L1); @@ -326,32 +322,41 @@ void luaE_freethread (lua_State *L, lua_State *L1) { int luaE_resetthread (lua_State *L, int status) { CallInfo *ci = L->ci = &L->base_ci; /* unwind CallInfo list */ - setnilvalue(s2v(L->stack)); /* 'function' entry for basic 'ci' */ - ci->func = L->stack; + setnilvalue(s2v(L->stack.p)); /* 'function' entry for basic 'ci' */ + ci->func.p = L->stack.p; ci->callstatus = CIST_C; if (status == LUA_YIELD) status = LUA_OK; L->status = LUA_OK; /* so it can run __close metamethods */ status = luaD_closeprotected(L, 1, status); if (status != LUA_OK) /* errors? */ - luaD_seterrorobj(L, status, L->stack + 1); + luaD_seterrorobj(L, status, L->stack.p + 1); else - L->top = L->stack + 1; - ci->top = L->top + LUA_MINSTACK; - luaD_reallocstack(L, cast_int(ci->top - L->stack), 0); + L->top.p = L->stack.p + 1; + ci->top.p = L->top.p + LUA_MINSTACK; + luaD_reallocstack(L, cast_int(ci->top.p - L->stack.p), 0); return status; } -LUA_API int lua_resetthread (lua_State *L) { +LUA_API int lua_closethread (lua_State *L, lua_State *from) { int status; lua_lock(L); + L->nCcalls = (from) ? getCcalls(from) : 0; status = luaE_resetthread(L, L->status); lua_unlock(L); return status; } +/* +** Deprecated! Use 'lua_closethread' instead. +*/ +LUA_API int lua_resetthread (lua_State *L) { + return lua_closethread(L, NULL); +} + + LUA_API lua_State *lua_newstate (lua_Alloc f, void *ud) { int i; lua_State *L; @@ -426,9 +431,9 @@ void luaE_warning (lua_State *L, const char *msg, int tocont) { ** Generate a warning from an error message */ void luaE_warnerror (lua_State *L, const char *where) { - TValue *errobj = s2v(L->top - 1); /* error object */ + TValue *errobj = s2v(L->top.p - 1); /* error object */ const char *msg = (ttisstring(errobj)) - ? svalue(errobj) + ? getstr(tsvalue(errobj)) : "error object is not a string"; /* produce warning "error in %s (%s)" (where, msg) */ luaE_warning(L, "error in ", 1); diff --git a/3rdparty/lua/src/lstate.h b/3rdparty/lua/src/lstate.h index 61e82cde72530..007704c826be2 100644 --- a/3rdparty/lua/src/lstate.h +++ b/3rdparty/lua/src/lstate.h @@ -9,6 +9,11 @@ #include "lua.h" + +/* Some header files included here need this definition */ +typedef struct CallInfo CallInfo; + + #include "lobject.h" #include "ltm.h" #include "lzio.h" @@ -139,7 +144,7 @@ struct lua_longjmp; /* defined in ldo.c */ #define BASIC_STACK_SIZE (2*LUA_MINSTACK) -#define stacksize(th) cast_int((th)->stack_last - (th)->stack) +#define stacksize(th) cast_int((th)->stack_last.p - (th)->stack.p) /* kinds of Garbage Collection */ @@ -169,14 +174,14 @@ typedef struct stringtable { ** - field 'transferinfo' is used only during call/returnhooks, ** before the function starts or after it ends. */ -typedef struct CallInfo { - StkId func; /* function index in the stack */ - StkId top; /* top for this function */ +struct CallInfo { + StkIdRel func; /* function index in the stack */ + StkIdRel top; /* top for this function */ struct CallInfo *previous, *next; /* dynamic call link */ union { struct { /* only for Lua functions */ const Instruction *savedpc; - volatile l_signalT trap; + volatile l_signalT trap; /* function is tracing lines/counts */ int nextraargs; /* # of extra arguments in vararg functions */ } l; struct { /* only for C functions */ @@ -196,7 +201,7 @@ typedef struct CallInfo { } u2; short nresults; /* expected number of results from this function */ unsigned short callstatus; -} CallInfo; +}; /* @@ -291,7 +296,7 @@ typedef struct global_State { struct lua_State *mainthread; TString *memerrmsg; /* message for memory-allocation errors */ TString *tmname[TM_N]; /* array with tag-method names */ - struct Table *mt[LUA_NUMTAGS]; /* metatables for basic types */ + struct Table *mt[LUA_NUMTYPES]; /* metatables for basic types */ TString *strcache[STRCACHE_N][STRCACHE_M]; /* cache for strings in API */ lua_WarnFunction warnf; /* warning function */ void *ud_warn; /* auxiliary data to 'warnf' */ @@ -306,13 +311,13 @@ struct lua_State { lu_byte status; lu_byte allowhook; unsigned short nci; /* number of items in 'ci' list */ - StkId top; /* first free slot in the stack */ + StkIdRel top; /* first free slot in the stack */ global_State *l_G; CallInfo *ci; /* call info for current function */ - StkId stack_last; /* end of stack (last element + 1) */ - StkId stack; /* stack base */ + StkIdRel stack_last; /* end of stack (last element + 1) */ + StkIdRel stack; /* stack base */ UpVal *openupval; /* list of open upvalues in this stack */ - StkId tbclist; /* list of to-be-closed variables */ + StkIdRel tbclist; /* list of to-be-closed variables */ GCObject *gclist; struct lua_State *twups; /* list of threads with open upvalues */ struct lua_longjmp *errorJmp; /* current error recover point */ @@ -391,7 +396,6 @@ union GCUnion { LUAI_FUNC void luaE_setdebt (global_State *g, l_mem debt); LUAI_FUNC void luaE_freethread (lua_State *L, lua_State *L1); LUAI_FUNC CallInfo *luaE_extendCI (lua_State *L); -LUAI_FUNC void luaE_freeCI (lua_State *L); LUAI_FUNC void luaE_shrinkCI (lua_State *L); LUAI_FUNC void luaE_checkcstack (lua_State *L); LUAI_FUNC void luaE_incCstack (lua_State *L); diff --git a/3rdparty/lua/src/lstring.c b/3rdparty/lua/src/lstring.c index 13dcaf4259bc0..97757355c0b65 100644 --- a/3rdparty/lua/src/lstring.c +++ b/3rdparty/lua/src/lstring.c @@ -36,7 +36,7 @@ int luaS_eqlngstr (TString *a, TString *b) { lua_assert(a->tt == LUA_VLNGSTR && b->tt == LUA_VLNGSTR); return (a == b) || /* same instance or... */ ((len == b->u.lnglen) && /* equal length and ... */ - (memcmp(getstr(a), getstr(b), len) == 0)); /* equal contents */ + (memcmp(getlngstr(a), getlngstr(b), len) == 0)); /* equal contents */ } @@ -52,7 +52,7 @@ unsigned int luaS_hashlongstr (TString *ts) { lua_assert(ts->tt == LUA_VLNGSTR); if (ts->extra == 0) { /* no hash? */ size_t len = ts->u.lnglen; - ts->hash = luaS_hash(getstr(ts), len, ts->hash); + ts->hash = luaS_hash(getlngstr(ts), len, ts->hash); ts->extra = 1; /* now it has its hash */ } return ts->hash; @@ -157,6 +157,7 @@ static TString *createstrobj (lua_State *L, size_t l, int tag, unsigned int h) { TString *luaS_createlngstrobj (lua_State *L, size_t l) { TString *ts = createstrobj(L, l, LUA_VLNGSTR, G(L)->seed); ts->u.lnglen = l; + ts->shrlen = 0xFF; /* signals that it is a long string */ return ts; } @@ -193,7 +194,7 @@ static TString *internshrstr (lua_State *L, const char *str, size_t l) { TString **list = &tb->hash[lmod(h, tb->size)]; lua_assert(str != NULL); /* otherwise 'memcmp'/'memcpy' are undefined */ for (ts = *list; ts != NULL; ts = ts->u.hnext) { - if (l == ts->shrlen && (memcmp(str, getstr(ts), l * sizeof(char)) == 0)) { + if (l == ts->shrlen && (memcmp(str, getshrstr(ts), l * sizeof(char)) == 0)) { /* found! */ if (isdead(g, ts)) /* dead (but not collected yet)? */ changewhite(ts); /* resurrect it */ @@ -206,8 +207,8 @@ static TString *internshrstr (lua_State *L, const char *str, size_t l) { list = &tb->hash[lmod(h, tb->size)]; /* rehash with new size */ } ts = createstrobj(L, l, LUA_VSHRSTR, h); - memcpy(getstr(ts), str, l * sizeof(char)); ts->shrlen = cast_byte(l); + memcpy(getshrstr(ts), str, l * sizeof(char)); ts->u.hnext = *list; *list = ts; tb->nuse++; @@ -223,10 +224,10 @@ TString *luaS_newlstr (lua_State *L, const char *str, size_t l) { return internshrstr(L, str, l); else { TString *ts; - if (l_unlikely(l >= (MAX_SIZE - sizeof(TString))/sizeof(char))) + if (l_unlikely(l * sizeof(char) >= (MAX_SIZE - sizeof(TString)))) luaM_toobig(L); ts = luaS_createlngstrobj(L, l); - memcpy(getstr(ts), str, l * sizeof(char)); + memcpy(getlngstr(ts), str, l * sizeof(char)); return ts; } } diff --git a/3rdparty/lua/src/lstrlib.c b/3rdparty/lua/src/lstrlib.c index 0b4fdbb7b5bf5..03167161df188 100644 --- a/3rdparty/lua/src/lstrlib.c +++ b/3rdparty/lua/src/lstrlib.c @@ -570,7 +570,7 @@ static const char *match_capture (MatchState *ms, const char *s, int l) { static const char *match (MatchState *ms, const char *s, const char *p) { if (l_unlikely(ms->matchdepth-- == 0)) luaL_error(ms->L, "pattern too complex"); - init: /* using goto's to optimize tail recursion */ + init: /* using goto to optimize tail recursion */ if (p != ms->p_end) { /* end of pattern? */ switch (*p) { case '(': { /* start capture */ diff --git a/3rdparty/lua/src/ltable.c b/3rdparty/lua/src/ltable.c index 1b1cd2415b60c..3353c047939a8 100644 --- a/3rdparty/lua/src/ltable.c +++ b/3rdparty/lua/src/ltable.c @@ -107,7 +107,7 @@ static const TValue absentkey = {ABSTKEYCONSTANT}; */ static Node *hashint (const Table *t, lua_Integer i) { lua_Unsigned ui = l_castS2U(i); - if (ui <= (unsigned int)INT_MAX) + if (ui <= cast_uint(INT_MAX)) return hashmod(t, cast_int(ui)); else return hashmod(t, ui); @@ -252,14 +252,16 @@ LUAI_FUNC unsigned int luaH_realasize (const Table *t) { return t->alimit; /* this is the size */ else { unsigned int size = t->alimit; - /* compute the smallest power of 2 not smaller than 'n' */ + /* compute the smallest power of 2 not smaller than 'size' */ size |= (size >> 1); size |= (size >> 2); size |= (size >> 4); size |= (size >> 8); +#if (UINT_MAX >> 14) > 3 /* unsigned int has more than 16 bits */ size |= (size >> 16); #if (UINT_MAX >> 30) > 3 size |= (size >> 32); /* unsigned int has more than 32 bits */ +#endif #endif size++; lua_assert(ispow2(size) && size/2 < t->alimit && t->alimit < size); @@ -488,7 +490,7 @@ static void setnodevector (lua_State *L, Table *t, unsigned int size) { luaG_runerror(L, "table overflow"); size = twoto(lsize); t->node = luaM_newvector(L, size, Node); - for (i = 0; i < (int)size; i++) { + for (i = 0; i < cast_int(size); i++) { Node *n = gnode(t, i); gnext(n) = 0; setnilkey(n); @@ -660,7 +662,8 @@ static Node *getfreepos (Table *t) { ** put new key in its main position; otherwise (colliding node is in its main ** position), new key goes to an empty position. */ -void luaH_newkey (lua_State *L, Table *t, const TValue *key, TValue *value) { +static void luaH_newkey (lua_State *L, Table *t, const TValue *key, + TValue *value) { Node *mp; TValue aux; if (l_unlikely(ttisnil(key))) @@ -719,22 +722,36 @@ void luaH_newkey (lua_State *L, Table *t, const TValue *key, TValue *value) { /* ** Search function for integers. If integer is inside 'alimit', get it -** directly from the array part. Otherwise, if 'alimit' is not equal to -** the real size of the array, key still can be in the array part. In -** this case, try to avoid a call to 'luaH_realasize' when key is just -** one more than the limit (so that it can be incremented without -** changing the real size of the array). +** directly from the array part. Otherwise, if 'alimit' is not +** the real size of the array, the key still can be in the array part. +** In this case, do the "Xmilia trick" to check whether 'key-1' is +** smaller than the real size. +** The trick works as follow: let 'p' be an integer such that +** '2^(p+1) >= alimit > 2^p', or '2^(p+1) > alimit-1 >= 2^p'. +** That is, 2^(p+1) is the real size of the array, and 'p' is the highest +** bit on in 'alimit-1'. What we have to check becomes 'key-1 < 2^(p+1)'. +** We compute '(key-1) & ~(alimit-1)', which we call 'res'; it will +** have the 'p' bit cleared. If the key is outside the array, that is, +** 'key-1 >= 2^(p+1)', then 'res' will have some bit on higher than 'p', +** therefore it will be larger or equal to 'alimit', and the check +** will fail. If 'key-1 < 2^(p+1)', then 'res' has no bit on higher than +** 'p', and as the bit 'p' itself was cleared, 'res' will be smaller +** than 2^p, therefore smaller than 'alimit', and the check succeeds. +** As special cases, when 'alimit' is 0 the condition is trivially false, +** and when 'alimit' is 1 the condition simplifies to 'key-1 < alimit'. +** If key is 0 or negative, 'res' will have its higher bit on, so that +** if cannot be smaller than alimit. */ const TValue *luaH_getint (Table *t, lua_Integer key) { - if (l_castS2U(key) - 1u < t->alimit) /* 'key' in [1, t->alimit]? */ + lua_Unsigned alimit = t->alimit; + if (l_castS2U(key) - 1u < alimit) /* 'key' in [1, t->alimit]? */ return &t->array[key - 1]; - else if (!limitequalsasize(t) && /* key still may be in the array part? */ - (l_castS2U(key) == t->alimit + 1 || - l_castS2U(key) - 1u < luaH_realasize(t))) { + else if (!isrealasize(t) && /* key still may be in the array part? */ + (((l_castS2U(key) - 1u) & ~(alimit - 1u)) < alimit)) { t->alimit = cast_uint(key); /* probably '#t' is here now */ return &t->array[key - 1]; } - else { + else { /* key is not in the array part; check the hash */ Node *n = hashint(t, key); for (;;) { /* check whether 'key' is somewhere in the chain */ if (keyisinteger(n) && keyival(n) == key) @@ -975,6 +992,4 @@ Node *luaH_mainposition (const Table *t, const TValue *key) { return mainpositionTV(t, key); } -int luaH_isdummy (const Table *t) { return isdummy(t); } - #endif diff --git a/3rdparty/lua/src/ltable.h b/3rdparty/lua/src/ltable.h index 7bbbcb213f8b7..8e68903423483 100644 --- a/3rdparty/lua/src/ltable.h +++ b/3rdparty/lua/src/ltable.h @@ -41,8 +41,6 @@ LUAI_FUNC void luaH_setint (lua_State *L, Table *t, lua_Integer key, LUAI_FUNC const TValue *luaH_getshortstr (Table *t, TString *key); LUAI_FUNC const TValue *luaH_getstr (Table *t, TString *key); LUAI_FUNC const TValue *luaH_get (Table *t, const TValue *key); -LUAI_FUNC void luaH_newkey (lua_State *L, Table *t, const TValue *key, - TValue *value); LUAI_FUNC void luaH_set (lua_State *L, Table *t, const TValue *key, TValue *value); LUAI_FUNC void luaH_finishset (lua_State *L, Table *t, const TValue *key, @@ -59,7 +57,6 @@ LUAI_FUNC unsigned int luaH_realasize (const Table *t); #if defined(LUA_DEBUG) LUAI_FUNC Node *luaH_mainposition (const Table *t, const TValue *key); -LUAI_FUNC int luaH_isdummy (const Table *t); #endif diff --git a/3rdparty/lua/src/ltablib.c b/3rdparty/lua/src/ltablib.c index 868d78fd83ec6..e6bc4d04af47e 100644 --- a/3rdparty/lua/src/ltablib.c +++ b/3rdparty/lua/src/ltablib.c @@ -93,7 +93,7 @@ static int tremove (lua_State *L) { lua_Integer pos = luaL_optinteger(L, 2, size); if (pos != size) /* validate 'pos' if given */ /* check whether 'pos' is in [1, size + 1] */ - luaL_argcheck(L, (lua_Unsigned)pos - 1u <= (lua_Unsigned)size, 1, + luaL_argcheck(L, (lua_Unsigned)pos - 1u <= (lua_Unsigned)size, 2, "position out of bounds"); lua_geti(L, 1, pos); /* result = t[pos] */ for ( ; pos < size; pos++) { diff --git a/3rdparty/lua/src/ltm.c b/3rdparty/lua/src/ltm.c index b657b783a801d..07a060811d5c3 100644 --- a/3rdparty/lua/src/ltm.c +++ b/3rdparty/lua/src/ltm.c @@ -102,12 +102,12 @@ const char *luaT_objtypename (lua_State *L, const TValue *o) { void luaT_callTM (lua_State *L, const TValue *f, const TValue *p1, const TValue *p2, const TValue *p3) { - StkId func = L->top; + StkId func = L->top.p; setobj2s(L, func, f); /* push function (assume EXTRA_STACK) */ setobj2s(L, func + 1, p1); /* 1st argument */ setobj2s(L, func + 2, p2); /* 2nd argument */ setobj2s(L, func + 3, p3); /* 3rd argument */ - L->top = func + 4; + L->top.p = func + 4; /* metamethod may yield only when called from Lua code */ if (isLuacode(L->ci)) luaD_call(L, func, 0); @@ -119,18 +119,18 @@ void luaT_callTM (lua_State *L, const TValue *f, const TValue *p1, void luaT_callTMres (lua_State *L, const TValue *f, const TValue *p1, const TValue *p2, StkId res) { ptrdiff_t result = savestack(L, res); - StkId func = L->top; + StkId func = L->top.p; setobj2s(L, func, f); /* push function (assume EXTRA_STACK) */ setobj2s(L, func + 1, p1); /* 1st argument */ setobj2s(L, func + 2, p2); /* 2nd argument */ - L->top += 3; + L->top.p += 3; /* metamethod may yield only when called from Lua code */ if (isLuacode(L->ci)) luaD_call(L, func, 1); else luaD_callnoyield(L, func, 1); res = restorestack(L, result); - setobjs2s(L, res, --L->top); /* move result to its place */ + setobjs2s(L, res, --L->top.p); /* move result to its place */ } @@ -165,7 +165,7 @@ void luaT_trybinTM (lua_State *L, const TValue *p1, const TValue *p2, void luaT_tryconcatTM (lua_State *L) { - StkId top = L->top; + StkId top = L->top.p; if (l_unlikely(!callbinTM(L, s2v(top - 2), s2v(top - 1), top - 2, TM_CONCAT))) luaG_concaterror(L, s2v(top - 2), s2v(top - 1)); @@ -200,15 +200,15 @@ void luaT_trybiniTM (lua_State *L, const TValue *p1, lua_Integer i2, */ int luaT_callorderTM (lua_State *L, const TValue *p1, const TValue *p2, TMS event) { - if (callbinTM(L, p1, p2, L->top, event)) /* try original event */ - return !l_isfalse(s2v(L->top)); + if (callbinTM(L, p1, p2, L->top.p, event)) /* try original event */ + return !l_isfalse(s2v(L->top.p)); #if defined(LUA_COMPAT_LT_LE) else if (event == TM_LE) { /* try '!(p2 < p1)' for '(p1 <= p2)' */ L->ci->callstatus |= CIST_LEQ; /* mark it is doing 'lt' for 'le' */ - if (callbinTM(L, p2, p1, L->top, TM_LT)) { + if (callbinTM(L, p2, p1, L->top.p, TM_LT)) { L->ci->callstatus ^= CIST_LEQ; /* clear mark */ - return l_isfalse(s2v(L->top)); + return l_isfalse(s2v(L->top.p)); } /* else error will remove this 'ci'; no need to clear mark */ } @@ -238,20 +238,20 @@ int luaT_callorderiTM (lua_State *L, const TValue *p1, int v2, void luaT_adjustvarargs (lua_State *L, int nfixparams, CallInfo *ci, const Proto *p) { int i; - int actual = cast_int(L->top - ci->func) - 1; /* number of arguments */ + int actual = cast_int(L->top.p - ci->func.p) - 1; /* number of arguments */ int nextra = actual - nfixparams; /* number of extra arguments */ ci->u.l.nextraargs = nextra; luaD_checkstack(L, p->maxstacksize + 1); /* copy function to the top of the stack */ - setobjs2s(L, L->top++, ci->func); + setobjs2s(L, L->top.p++, ci->func.p); /* move fixed parameters to the top of the stack */ for (i = 1; i <= nfixparams; i++) { - setobjs2s(L, L->top++, ci->func + i); - setnilvalue(s2v(ci->func + i)); /* erase original parameter (for GC) */ + setobjs2s(L, L->top.p++, ci->func.p + i); + setnilvalue(s2v(ci->func.p + i)); /* erase original parameter (for GC) */ } - ci->func += actual + 1; - ci->top += actual + 1; - lua_assert(L->top <= ci->top && ci->top <= L->stack_last); + ci->func.p += actual + 1; + ci->top.p += actual + 1; + lua_assert(L->top.p <= ci->top.p && ci->top.p <= L->stack_last.p); } @@ -261,10 +261,10 @@ void luaT_getvarargs (lua_State *L, CallInfo *ci, StkId where, int wanted) { if (wanted < 0) { wanted = nextra; /* get all extra arguments available */ checkstackGCp(L, nextra, where); /* ensure stack space */ - L->top = where + nextra; /* next instruction will need top */ + L->top.p = where + nextra; /* next instruction will need top */ } for (i = 0; i < wanted && i < nextra; i++) - setobjs2s(L, where + i, ci->func - nextra + i); + setobjs2s(L, where + i, ci->func.p - nextra + i); for (; i < wanted; i++) /* complete required results with nil */ setnilvalue(s2v(where + i)); } diff --git a/3rdparty/lua/src/lua.c b/3rdparty/lua/src/lua.c index 0f19004444993..6da331f11867a 100644 --- a/3rdparty/lua/src/lua.c +++ b/3rdparty/lua/src/lua.c @@ -115,12 +115,13 @@ static void l_message (const char *pname, const char *msg) { /* ** Check whether 'status' is not OK and, if so, prints the error -** message on the top of the stack. It assumes that the error object -** is a string, as it was either generated by Lua or by 'msghandler'. +** message on the top of the stack. */ static int report (lua_State *L, int status) { if (status != LUA_OK) { const char *msg = lua_tostring(L, -1); + if (msg == NULL) + msg = "(error message not a string)"; l_message(progname, msg); lua_pop(L, 1); /* remove message */ } @@ -177,10 +178,11 @@ static void print_version (void) { ** to the script (everything after 'script') go to positive indices; ** other arguments (before the script name) go to negative indices. ** If there is no script name, assume interpreter's name as base. +** (If there is no interpreter's name either, 'script' is -1, so +** table sizes are zero.) */ static void createargtable (lua_State *L, char **argv, int argc, int script) { int i, narg; - if (script == argc) script = 0; /* no script name? */ narg = argc - (script + 1); /* number of positive indices */ lua_createtable(L, narg, script + 1); for (i = 0; i < argc; i++) { @@ -209,12 +211,17 @@ static int dostring (lua_State *L, const char *s, const char *name) { /* ** Receives 'globname[=modname]' and runs 'globname = require(modname)'. +** If there is no explicit modname and globname contains a '-', cut +** the suffix after '-' (the "version") to make the global name. */ static int dolibrary (lua_State *L, char *globname) { int status; + char *suffix = NULL; char *modname = strchr(globname, '='); - if (modname == NULL) /* no explicit name? */ + if (modname == NULL) { /* no explicit name? */ modname = globname; /* module name is equal to global name */ + suffix = strchr(modname, *LUA_IGMARK); /* look for a suffix mark */ + } else { *modname = '\0'; /* global name ends here */ modname++; /* module name starts after the '=' */ @@ -222,8 +229,11 @@ static int dolibrary (lua_State *L, char *globname) { lua_getglobal(L, "require"); lua_pushstring(L, modname); status = docall(L, 1, 1); /* call 'require(modname)' */ - if (status == LUA_OK) + if (status == LUA_OK) { + if (suffix != NULL) /* is there a suffix mark? */ + *suffix = '\0'; /* remove suffix from global name */ lua_setglobal(L, globname); /* globname = require(modname) */ + } return report(L, status); } @@ -268,14 +278,23 @@ static int handle_script (lua_State *L, char **argv) { /* ** Traverses all arguments from 'argv', returning a mask with those -** needed before running any Lua code (or an error code if it finds -** any invalid argument). 'first' returns the first not-handled argument -** (either the script name or a bad argument in case of error). +** needed before running any Lua code or an error code if it finds any +** invalid argument. In case of error, 'first' is the index of the bad +** argument. Otherwise, 'first' is -1 if there is no program name, +** 0 if there is no script name, or the index of the script name. */ static int collectargs (char **argv, int *first) { int args = 0; int i; - for (i = 1; argv[i] != NULL; i++) { + if (argv[0] != NULL) { /* is there a program name? */ + if (argv[0][0]) /* not empty? */ + progname = argv[0]; /* save it */ + } + else { /* no program name */ + *first = -1; + return 0; + } + for (i = 1; argv[i] != NULL; i++) { /* handle arguments */ *first = i; if (argv[i][0] != '-') /* not an option? */ return args; /* stop handling options */ @@ -316,7 +335,7 @@ static int collectargs (char **argv, int *first) { return has_error; } } - *first = i; /* no script name */ + *first = 0; /* no script name */ return args; } @@ -609,8 +628,8 @@ static int pmain (lua_State *L) { char **argv = (char **)lua_touserdata(L, 2); int script; int args = collectargs(argv, &script); + int optlim = (script > 0) ? script : argc; /* first argv not an option */ luaL_checkversion(L); /* check that interpreter has correct version */ - if (argv[0] && argv[0][0]) progname = argv[0]; if (args == has_error) { /* bad arg? */ print_usage(argv[script]); /* 'script' has index of bad arg. */ return 0; @@ -623,19 +642,21 @@ static int pmain (lua_State *L) { } luaL_openlibs(L); /* open standard libraries */ createargtable(L, argv, argc, script); /* create table 'arg' */ - lua_gc(L, LUA_GCGEN, 0, 0); /* GC in generational mode */ + lua_gc(L, LUA_GCRESTART); /* start GC... */ + lua_gc(L, LUA_GCGEN, 0, 0); /* ...in generational mode */ if (!(args & has_E)) { /* no option '-E'? */ if (handle_luainit(L) != LUA_OK) /* run LUA_INIT */ return 0; /* error running LUA_INIT */ } - if (!runargs(L, argv, script)) /* execute arguments -e and -l */ + if (!runargs(L, argv, optlim)) /* execute arguments -e and -l */ return 0; /* something failed */ - if (script < argc && /* execute main script (if there is one) */ - handle_script(L, argv + script) != LUA_OK) - return 0; + if (script > 0) { /* execute main script (if there is one) */ + if (handle_script(L, argv + script) != LUA_OK) + return 0; /* interrupt in case of error */ + } if (args & has_i) /* -i option? */ doREPL(L); /* do read-eval-print loop */ - else if (script == argc && !(args & (has_e | has_v))) { /* no arguments? */ + else if (script < 1 && !(args & (has_e | has_v))) { /* no active option? */ if (lua_stdin_is_tty()) { /* running in interactive mode? */ print_version(); doREPL(L); /* do read-eval-print loop */ @@ -654,6 +675,7 @@ int main (int argc, char **argv) { l_message(argv[0], "cannot create state: not enough memory"); return EXIT_FAILURE; } + lua_gc(L, LUA_GCSTOP); /* stop GC while building state */ lua_pushcfunction(L, &pmain); /* to call 'pmain' in protected mode */ lua_pushinteger(L, argc); /* 1st argument */ lua_pushlightuserdata(L, argv); /* 2nd argument */ diff --git a/3rdparty/lua/src/lua.h b/3rdparty/lua/src/lua.h index e6618392cc7e3..f050dac091317 100644 --- a/3rdparty/lua/src/lua.h +++ b/3rdparty/lua/src/lua.h @@ -18,14 +18,14 @@ #define LUA_VERSION_MAJOR "5" #define LUA_VERSION_MINOR "4" -#define LUA_VERSION_RELEASE "4" +#define LUA_VERSION_RELEASE "7" #define LUA_VERSION_NUM 504 -#define LUA_VERSION_RELEASE_NUM (LUA_VERSION_NUM * 100 + 4) +#define LUA_VERSION_RELEASE_NUM (LUA_VERSION_NUM * 100 + 7) #define LUA_VERSION "Lua " LUA_VERSION_MAJOR "." LUA_VERSION_MINOR #define LUA_RELEASE LUA_VERSION "." LUA_VERSION_RELEASE -#define LUA_COPYRIGHT LUA_RELEASE " Copyright (C) 1994-2022 Lua.org, PUC-Rio" +#define LUA_COPYRIGHT LUA_RELEASE " Copyright (C) 1994-2024 Lua.org, PUC-Rio" #define LUA_AUTHORS "R. Ierusalimschy, L. H. de Figueiredo, W. Celes" @@ -131,6 +131,16 @@ typedef void * (*lua_Alloc) (void *ud, void *ptr, size_t osize, size_t nsize); typedef void (*lua_WarnFunction) (void *ud, const char *msg, int tocont); +/* +** Type used by the debug API to collect debug information +*/ +typedef struct lua_Debug lua_Debug; + + +/* +** Functions to be called by the debugger in specific events +*/ +typedef void (*lua_Hook) (lua_State *L, lua_Debug *ar); /* @@ -153,7 +163,8 @@ extern const char lua_ident[]; LUA_API lua_State *(lua_newstate) (lua_Alloc f, void *ud); LUA_API void (lua_close) (lua_State *L); LUA_API lua_State *(lua_newthread) (lua_State *L); -LUA_API int (lua_resetthread) (lua_State *L); +LUA_API int (lua_closethread) (lua_State *L, lua_State *from); +LUA_API int (lua_resetthread) (lua_State *L); /* Deprecated! */ LUA_API lua_CFunction (lua_atpanic) (lua_State *L, lua_CFunction panicf); @@ -442,12 +453,6 @@ LUA_API void (lua_closeslot) (lua_State *L, int idx); #define LUA_MASKLINE (1 << LUA_HOOKLINE) #define LUA_MASKCOUNT (1 << LUA_HOOKCOUNT) -typedef struct lua_Debug lua_Debug; /* activation record */ - - -/* Functions to be called by the debugger in specific events */ -typedef void (*lua_Hook) (lua_State *L, lua_Debug *ar); - LUA_API int (lua_getstack) (lua_State *L, int level, lua_Debug *ar); LUA_API int (lua_getinfo) (lua_State *L, const char *what, lua_Debug *ar); @@ -492,7 +497,7 @@ struct lua_Debug { /****************************************************************************** -* Copyright (C) 1994-2022 Lua.org, PUC-Rio. +* Copyright (C) 1994-2024 Lua.org, PUC-Rio. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the diff --git a/3rdparty/lua/src/luac.c b/3rdparty/lua/src/luac.c index f6db9cf656bb7..5f4a141bddd99 100644 --- a/3rdparty/lua/src/luac.c +++ b/3rdparty/lua/src/luac.c @@ -121,7 +121,7 @@ static int doargs(int argc, char* argv[]) return i; } -#define FUNCTION "(function()end)();" +#define FUNCTION "(function()end)();\n" static const char* reader(lua_State* L, void* ud, size_t* size) { @@ -138,7 +138,7 @@ static const char* reader(lua_State* L, void* ud, size_t* size) } } -#define toproto(L,i) getproto(s2v(L->top+(i))) +#define toproto(L,i) getproto(s2v(L->top.p+(i))) static const Proto* combine(lua_State* L, int n) { @@ -155,8 +155,6 @@ static const Proto* combine(lua_State* L, int n) f->p[i]=toproto(L,i-n-1); if (f->p[i]->sizeupvalues>0) f->p[i]->upvalues[0].instack=0; } - luaM_freearray(L,f->lineinfo,f->sizelineinfo); - f->sizelineinfo=0; return f; } } diff --git a/3rdparty/lua/src/luaconf.h b/3rdparty/lua/src/luaconf.h index d42d14b7d5f1a..33bb580d17c5b 100644 --- a/3rdparty/lua/src/luaconf.h +++ b/3rdparty/lua/src/luaconf.h @@ -70,6 +70,12 @@ #endif +#if defined(LUA_USE_IOS) +#define LUA_USE_POSIX +#define LUA_USE_DLOPEN +#endif + + /* @@ LUAI_IS32INT is true iff 'int' has (at least) 32 bits. */ @@ -251,6 +257,15 @@ #endif + +/* +** LUA_IGMARK is a mark to ignore all after it when building the +** module name (e.g., used to build the luaopen_ function name). +** Typically, the suffix after the mark is the module version, +** as in "mod-v1.2.so". +*/ +#define LUA_IGMARK "-" + /* }================================================================== */ @@ -728,7 +743,7 @@ ** CHANGE it if you need a different limit. This limit is arbitrary; ** its only purpose is to stop Lua from consuming unlimited stack ** space (and to reserve some numbers for pseudo-indices). -** (It must fit into max(size_t)/32.) +** (It must fit into max(size_t)/32 and max(int)/2.) */ #if LUAI_IS32INT #define LUAI_MAXSTACK 1000000 @@ -747,14 +762,15 @@ /* @@ LUA_IDSIZE gives the maximum size for the description of the source -@@ of a function in debug information. +** of a function in debug information. ** CHANGE it if you want a different size. */ #define LUA_IDSIZE 60 /* -@@ LUAL_BUFFERSIZE is the buffer size used by the lauxlib buffer system. +@@ LUAL_BUFFERSIZE is the initial buffer size used by the lauxlib +** buffer system. */ #define LUAL_BUFFERSIZE ((int)(16 * sizeof(void*) * sizeof(lua_Number))) diff --git a/3rdparty/lua/src/lundump.c b/3rdparty/lua/src/lundump.c index 5aa55c4457897..e8d92a8534ff6 100644 --- a/3rdparty/lua/src/lundump.c +++ b/3rdparty/lua/src/lundump.c @@ -81,7 +81,7 @@ static size_t loadUnsigned (LoadState *S, size_t limit) { static size_t loadSize (LoadState *S) { - return loadUnsigned(S, ~(size_t)0); + return loadUnsigned(S, MAX_SIZET); } @@ -120,10 +120,10 @@ static TString *loadStringN (LoadState *S, Proto *p) { } else { /* long string */ ts = luaS_createlngstrobj(L, size); /* create string */ - setsvalue2s(L, L->top, ts); /* anchor it ('loadVector' can GC) */ + setsvalue2s(L, L->top.p, ts); /* anchor it ('loadVector' can GC) */ luaD_inctop(L); - loadVector(S, getstr(ts), size); /* load directly in final place */ - L->top--; /* pop string */ + loadVector(S, getlngstr(ts), size); /* load directly in final place */ + L->top.p--; /* pop string */ } luaC_objbarrier(L, p, ts); return ts; @@ -248,6 +248,8 @@ static void loadDebug (LoadState *S, Proto *f) { f->locvars[i].endpc = loadInt(S); } n = loadInt(S); + if (n != 0) /* does it have debug information? */ + n = f->sizeupvalues; /* must be this many */ for (i = 0; i < n; i++) f->upvalues[i].name = loadStringN(S, f); } @@ -321,7 +323,7 @@ LClosure *luaU_undump(lua_State *L, ZIO *Z, const char *name) { S.Z = Z; checkHeader(&S); cl = luaF_newLclosure(L, loadByte(&S)); - setclLvalue2s(L, L->top, cl); + setclLvalue2s(L, L->top.p, cl); luaD_inctop(L); cl->p = luaF_newproto(L); luaC_objbarrier(L, cl, cl->p); diff --git a/3rdparty/lua/src/lundump.h b/3rdparty/lua/src/lundump.h index f3748a9980754..a97676ca18527 100644 --- a/3rdparty/lua/src/lundump.h +++ b/3rdparty/lua/src/lundump.h @@ -21,8 +21,7 @@ /* ** Encode major-minor version in one byte, one nibble for each */ -#define MYINT(s) (s[0]-'0') /* assume one-digit numerals */ -#define LUAC_VERSION (MYINT(LUA_VERSION_MAJOR)*16+MYINT(LUA_VERSION_MINOR)) +#define LUAC_VERSION (((LUA_VERSION_NUM / 100) * 16) + LUA_VERSION_NUM % 100) #define LUAC_FORMAT 0 /* this is the official format */ diff --git a/3rdparty/lua/src/lutf8lib.c b/3rdparty/lua/src/lutf8lib.c index e7bf098f6d049..3a5b9bc38a5bb 100644 --- a/3rdparty/lua/src/lutf8lib.c +++ b/3rdparty/lua/src/lutf8lib.c @@ -25,6 +25,9 @@ #define MAXUTF 0x7FFFFFFFu + +#define MSGInvalid "invalid UTF-8 code" + /* ** Integer type for decoded UTF-8 values; MAXUTF needs 31 bits. */ @@ -35,7 +38,8 @@ typedef unsigned long utfint; #endif -#define iscont(p) ((*(p) & 0xC0) == 0x80) +#define iscont(c) (((c) & 0xC0) == 0x80) +#define iscontp(p) iscont(*(p)) /* from strlib */ @@ -65,7 +69,7 @@ static const char *utf8_decode (const char *s, utfint *val, int strict) { int count = 0; /* to count number of continuation bytes */ for (; c & 0x40; c <<= 1) { /* while it needs continuation bytes... */ unsigned int cc = (unsigned char)s[++count]; /* read next byte */ - if ((cc & 0xC0) != 0x80) /* not a continuation byte? */ + if (!iscont(cc)) /* not a continuation byte? */ return NULL; /* invalid byte sequence */ res = (res << 6) | (cc & 0x3F); /* add lower 6 bits from cont. byte */ } @@ -140,7 +144,7 @@ static int codepoint (lua_State *L) { utfint code; s = utf8_decode(s, &code, !lax); if (s == NULL) - return luaL_error(L, "invalid UTF-8 code"); + return luaL_error(L, MSGInvalid); lua_pushinteger(L, code); n++; } @@ -190,16 +194,16 @@ static int byteoffset (lua_State *L) { "position out of bounds"); if (n == 0) { /* find beginning of current byte sequence */ - while (posi > 0 && iscont(s + posi)) posi--; + while (posi > 0 && iscontp(s + posi)) posi--; } else { - if (iscont(s + posi)) + if (iscontp(s + posi)) return luaL_error(L, "initial position is a continuation byte"); if (n < 0) { while (n < 0 && posi > 0) { /* move back */ do { /* find beginning of previous character */ posi--; - } while (posi > 0 && iscont(s + posi)); + } while (posi > 0 && iscontp(s + posi)); n++; } } @@ -208,7 +212,7 @@ static int byteoffset (lua_State *L) { while (n > 0 && posi < (lua_Integer)len) { do { /* find beginning of next character */ posi++; - } while (iscont(s + posi)); /* (cannot pass final '\0') */ + } while (iscontp(s + posi)); /* (cannot pass final '\0') */ n--; } } @@ -226,15 +230,15 @@ static int iter_aux (lua_State *L, int strict) { const char *s = luaL_checklstring(L, 1, &len); lua_Unsigned n = (lua_Unsigned)lua_tointeger(L, 2); if (n < len) { - while (iscont(s + n)) n++; /* skip continuation bytes */ + while (iscontp(s + n)) n++; /* go to next character */ } if (n >= len) /* (also handles original 'n' being negative) */ return 0; /* no more codepoints */ else { utfint code; const char *next = utf8_decode(s + n, &code, strict); - if (next == NULL) - return luaL_error(L, "invalid UTF-8 code"); + if (next == NULL || iscontp(next)) + return luaL_error(L, MSGInvalid); lua_pushinteger(L, n + 1); lua_pushinteger(L, code); return 2; @@ -253,7 +257,8 @@ static int iter_auxlax (lua_State *L) { static int iter_codes (lua_State *L) { int lax = lua_toboolean(L, 2); - luaL_checkstring(L, 1); + const char *s = luaL_checkstring(L, 1); + luaL_argcheck(L, !iscontp(s), 1, MSGInvalid); lua_pushcfunction(L, lax ? iter_auxlax : iter_auxstrict); lua_pushvalue(L, 1); lua_pushinteger(L, 0); diff --git a/3rdparty/lua/src/lvm.c b/3rdparty/lua/src/lvm.c index 2ec3440031948..fcd24e11dc87d 100644 --- a/3rdparty/lua/src/lvm.c +++ b/3rdparty/lua/src/lvm.c @@ -91,8 +91,10 @@ static int l_strton (const TValue *obj, TValue *result) { lua_assert(obj != result); if (!cvt2num(obj)) /* is object not a string? */ return 0; - else - return (luaO_str2num(svalue(obj), result) == vslen(obj) + 1); + else { + TString *st = tsvalue(obj); + return (luaO_str2num(getstr(st), result) == tsslen(st) + 1); + } } @@ -366,30 +368,32 @@ void luaV_finishset (lua_State *L, const TValue *t, TValue *key, /* -** Compare two strings 'ls' x 'rs', returning an integer less-equal- -** -greater than zero if 'ls' is less-equal-greater than 'rs'. +** Compare two strings 'ts1' x 'ts2', returning an integer less-equal- +** -greater than zero if 'ts1' is less-equal-greater than 'ts2'. ** The code is a little tricky because it allows '\0' in the strings -** and it uses 'strcoll' (to respect locales) for each segments -** of the strings. +** and it uses 'strcoll' (to respect locales) for each segment +** of the strings. Note that segments can compare equal but still +** have different lengths. */ -static int l_strcmp (const TString *ls, const TString *rs) { - const char *l = getstr(ls); - size_t ll = tsslen(ls); - const char *r = getstr(rs); - size_t lr = tsslen(rs); +static int l_strcmp (const TString *ts1, const TString *ts2) { + const char *s1 = getstr(ts1); + size_t rl1 = tsslen(ts1); /* real length */ + const char *s2 = getstr(ts2); + size_t rl2 = tsslen(ts2); for (;;) { /* for each segment */ - int temp = strcoll(l, r); + int temp = strcoll(s1, s2); if (temp != 0) /* not equal? */ return temp; /* done */ else { /* strings are equal up to a '\0' */ - size_t len = strlen(l); /* index of first '\0' in both strings */ - if (len == lr) /* 'rs' is finished? */ - return (len == ll) ? 0 : 1; /* check 'ls' */ - else if (len == ll) /* 'ls' is finished? */ - return -1; /* 'ls' is less than 'rs' ('rs' is not finished) */ - /* both strings longer than 'len'; go on comparing after the '\0' */ - len++; - l += len; ll -= len; r += len; lr -= len; + size_t zl1 = strlen(s1); /* index of first '\0' in 's1' */ + size_t zl2 = strlen(s2); /* index of first '\0' in 's2' */ + if (zl2 == rl2) /* 's2' is finished? */ + return (zl1 == rl1) ? 0 : 1; /* check 's1' */ + else if (zl1 == rl1) /* 's1' is finished? */ + return -1; /* 's1' is less than 's2' ('s2' is not finished) */ + /* both strings longer than 'zl'; go on comparing after the '\0' */ + zl1++; zl2++; + s1 += zl1; rl1 -= zl1; s2 += zl2; rl2 -= zl2; } } } @@ -608,8 +612,8 @@ int luaV_equalobj (lua_State *L, const TValue *t1, const TValue *t2) { if (tm == NULL) /* no TM? */ return 0; /* objects are different */ else { - luaT_callTMres(L, tm, t1, t2, L->top); /* call TM */ - return !l_isfalse(s2v(L->top)); + luaT_callTMres(L, tm, t1, t2, L->top.p); /* call TM */ + return !l_isfalse(s2v(L->top.p)); } } @@ -624,8 +628,9 @@ int luaV_equalobj (lua_State *L, const TValue *t1, const TValue *t2) { static void copy2buff (StkId top, int n, char *buff) { size_t tl = 0; /* size already copied */ do { - size_t l = vslen(s2v(top - n)); /* length of string being copied */ - memcpy(buff + tl, svalue(s2v(top - n)), l * sizeof(char)); + TString *st = tsvalue(s2v(top - n)); + size_t l = tsslen(st); /* length of string being copied */ + memcpy(buff + tl, getstr(st), l * sizeof(char)); tl += l; } while (--n > 0); } @@ -633,17 +638,17 @@ static void copy2buff (StkId top, int n, char *buff) { /* ** Main operation for concatenation: concat 'total' values in the stack, -** from 'L->top - total' up to 'L->top - 1'. +** from 'L->top.p - total' up to 'L->top.p - 1'. */ void luaV_concat (lua_State *L, int total) { if (total == 1) return; /* "all" values already concatenated */ do { - StkId top = L->top; + StkId top = L->top.p; int n = 2; /* number of elements handled in this pass (at least 2) */ if (!(ttisstring(s2v(top - 2)) || cvt2str(s2v(top - 2))) || !tostring(L, s2v(top - 1))) - luaT_tryconcatTM(L); + luaT_tryconcatTM(L); /* may invalidate 'top' */ else if (isemptystr(s2v(top - 1))) /* second operand is empty? */ cast_void(tostring(L, s2v(top - 2))); /* result is first operand */ else if (isemptystr(s2v(top - 2))) { /* first operand is empty string? */ @@ -651,13 +656,15 @@ void luaV_concat (lua_State *L, int total) { } else { /* at least two non-empty string values; get as many as possible */ - size_t tl = vslen(s2v(top - 1)); + size_t tl = tsslen(tsvalue(s2v(top - 1))); TString *ts; /* collect total length and number of strings */ for (n = 1; n < total && tostring(L, s2v(top - n - 1)); n++) { - size_t l = vslen(s2v(top - n - 1)); - if (l_unlikely(l >= (MAX_SIZE/sizeof(char)) - tl)) + size_t l = tsslen(tsvalue(s2v(top - n - 1))); + if (l_unlikely(l >= MAX_SIZE - sizeof(TString) - tl)) { + L->top.p = top - total; /* pop strings to avoid wasting stack */ luaG_runerror(L, "string length overflow"); + } tl += l; } if (tl <= LUAI_MAXSHORTLEN) { /* is result a short string? */ @@ -667,12 +674,12 @@ void luaV_concat (lua_State *L, int total) { } else { /* long string; copy strings directly to final result */ ts = luaS_createlngstrobj(L, tl); - copy2buff(top, n, getstr(ts)); + copy2buff(top, n, getlngstr(ts)); } setsvalue2s(L, top - n, ts); /* create result */ } - total -= n-1; /* got 'n' strings to create 1 new */ - L->top -= n-1; /* popped 'n' strings and pushed one */ + total -= n - 1; /* got 'n' strings to create one new */ + L->top.p -= n - 1; /* popped 'n' strings and pushed one */ } while (total > 1); /* repeat until only 1 result left */ } @@ -763,12 +770,10 @@ lua_Number luaV_modf (lua_State *L, lua_Number m, lua_Number n) { /* number of bits in an integer */ #define NBITS cast_int(sizeof(lua_Integer) * CHAR_BIT) + /* ** Shift left operation. (Shift right just negates 'y'.) */ -#define luaV_shiftr(x,y) luaV_shiftl(x,intop(-, 0, y)) - - lua_Integer luaV_shiftl (lua_Integer x, lua_Integer y) { if (y < 0) { /* shift right? */ if (y <= -NBITS) return 0; @@ -808,26 +813,26 @@ static void pushclosure (lua_State *L, Proto *p, UpVal **encup, StkId base, */ void luaV_finishOp (lua_State *L) { CallInfo *ci = L->ci; - StkId base = ci->func + 1; + StkId base = ci->func.p + 1; Instruction inst = *(ci->u.l.savedpc - 1); /* interrupted instruction */ OpCode op = GET_OPCODE(inst); switch (op) { /* finish its execution */ case OP_MMBIN: case OP_MMBINI: case OP_MMBINK: { - setobjs2s(L, base + GETARG_A(*(ci->u.l.savedpc - 2)), --L->top); + setobjs2s(L, base + GETARG_A(*(ci->u.l.savedpc - 2)), --L->top.p); break; } case OP_UNM: case OP_BNOT: case OP_LEN: case OP_GETTABUP: case OP_GETTABLE: case OP_GETI: case OP_GETFIELD: case OP_SELF: { - setobjs2s(L, base + GETARG_A(inst), --L->top); + setobjs2s(L, base + GETARG_A(inst), --L->top.p); break; } case OP_LT: case OP_LE: case OP_LTI: case OP_LEI: case OP_GTI: case OP_GEI: case OP_EQ: { /* note that 'OP_EQI'/'OP_EQK' cannot yield */ - int res = !l_isfalse(s2v(L->top - 1)); - L->top--; + int res = !l_isfalse(s2v(L->top.p - 1)); + L->top.p--; #if defined(LUA_COMPAT_LT_LE) if (ci->callstatus & CIST_LEQ) { /* "<=" using "<" instead? */ ci->callstatus ^= CIST_LEQ; /* clear mark */ @@ -840,11 +845,11 @@ void luaV_finishOp (lua_State *L) { break; } case OP_CONCAT: { - StkId top = L->top - 1; /* top when 'luaT_tryconcatTM' was called */ + StkId top = L->top.p - 1; /* top when 'luaT_tryconcatTM' was called */ int a = GETARG_A(inst); /* first element to concatenate */ int total = cast_int(top - 1 - (base + a)); /* yet to concatenate */ setobjs2s(L, top - 2, top); /* put TM result in proper position */ - L->top = top - 1; /* top is one after last element (at top-2) */ + L->top.p = top - 1; /* top is one after last element (at top-2) */ luaV_concat(L, total); /* concat them (may yield again) */ break; } @@ -856,7 +861,7 @@ void luaV_finishOp (lua_State *L) { StkId ra = base + GETARG_A(inst); /* adjust top to signal correct number of returns, in case the return is "up to top" ('isIT') */ - L->top = ra + ci->u2.nres; + L->top.p = ra + ci->u2.nres; /* repeat instruction to close other vars. and complete the return */ ci->u.l.savedpc--; break; @@ -898,6 +903,7 @@ void luaV_finishOp (lua_State *L) { ** operation, 'fop' is the float operation. */ #define op_arithI(L,iop,fop) { \ + StkId ra = RA(i); \ TValue *v1 = vRB(i); \ int imm = GETARG_sC(i); \ if (ttisinteger(v1)) { \ @@ -926,6 +932,7 @@ void luaV_finishOp (lua_State *L) { ** Arithmetic operations over floats and others with register operands. */ #define op_arithf(L,fop) { \ + StkId ra = RA(i); \ TValue *v1 = vRB(i); \ TValue *v2 = vRC(i); \ op_arithf_aux(L, v1, v2, fop); } @@ -935,6 +942,7 @@ void luaV_finishOp (lua_State *L) { ** Arithmetic operations with K operands for floats. */ #define op_arithfK(L,fop) { \ + StkId ra = RA(i); \ TValue *v1 = vRB(i); \ TValue *v2 = KC(i); lua_assert(ttisnumber(v2)); \ op_arithf_aux(L, v1, v2, fop); } @@ -944,6 +952,7 @@ void luaV_finishOp (lua_State *L) { ** Arithmetic operations over integers and floats. */ #define op_arith_aux(L,v1,v2,iop,fop) { \ + StkId ra = RA(i); \ if (ttisinteger(v1) && ttisinteger(v2)) { \ lua_Integer i1 = ivalue(v1); lua_Integer i2 = ivalue(v2); \ pc++; setivalue(s2v(ra), iop(L, i1, i2)); \ @@ -973,6 +982,7 @@ void luaV_finishOp (lua_State *L) { ** Bitwise operations with constant operand. */ #define op_bitwiseK(L,op) { \ + StkId ra = RA(i); \ TValue *v1 = vRB(i); \ TValue *v2 = KC(i); \ lua_Integer i1; \ @@ -986,6 +996,7 @@ void luaV_finishOp (lua_State *L) { ** Bitwise operations with register operands. */ #define op_bitwise(L,op) { \ + StkId ra = RA(i); \ TValue *v1 = vRB(i); \ TValue *v2 = vRC(i); \ lua_Integer i1; lua_Integer i2; \ @@ -1000,18 +1011,19 @@ void luaV_finishOp (lua_State *L) { ** integers. */ #define op_order(L,opi,opn,other) { \ - int cond; \ - TValue *rb = vRB(i); \ - if (ttisinteger(s2v(ra)) && ttisinteger(rb)) { \ - lua_Integer ia = ivalue(s2v(ra)); \ - lua_Integer ib = ivalue(rb); \ - cond = opi(ia, ib); \ - } \ - else if (ttisnumber(s2v(ra)) && ttisnumber(rb)) \ - cond = opn(s2v(ra), rb); \ - else \ - Protect(cond = other(L, s2v(ra), rb)); \ - docondjump(); } + StkId ra = RA(i); \ + int cond; \ + TValue *rb = vRB(i); \ + if (ttisinteger(s2v(ra)) && ttisinteger(rb)) { \ + lua_Integer ia = ivalue(s2v(ra)); \ + lua_Integer ib = ivalue(rb); \ + cond = opi(ia, ib); \ + } \ + else if (ttisnumber(s2v(ra)) && ttisnumber(rb)) \ + cond = opn(s2v(ra), rb); \ + else \ + Protect(cond = other(L, s2v(ra), rb)); \ + docondjump(); } /* @@ -1019,20 +1031,21 @@ void luaV_finishOp (lua_State *L) { ** always small enough to have an exact representation as a float.) */ #define op_orderI(L,opi,opf,inv,tm) { \ - int cond; \ - int im = GETARG_sB(i); \ - if (ttisinteger(s2v(ra))) \ - cond = opi(ivalue(s2v(ra)), im); \ - else if (ttisfloat(s2v(ra))) { \ - lua_Number fa = fltvalue(s2v(ra)); \ - lua_Number fim = cast_num(im); \ - cond = opf(fa, fim); \ - } \ - else { \ - int isf = GETARG_C(i); \ - Protect(cond = luaT_callorderiTM(L, s2v(ra), im, inv, isf, tm)); \ - } \ - docondjump(); } + StkId ra = RA(i); \ + int cond; \ + int im = GETARG_sB(i); \ + if (ttisinteger(s2v(ra))) \ + cond = opi(ivalue(s2v(ra)), im); \ + else if (ttisfloat(s2v(ra))) { \ + lua_Number fa = fltvalue(s2v(ra)); \ + lua_Number fim = cast_num(im); \ + cond = opf(fa, fim); \ + } \ + else { \ + int isf = GETARG_C(i); \ + Protect(cond = luaT_callorderiTM(L, s2v(ra), im, inv, isf, tm)); \ + } \ + docondjump(); } /* }================================================================== */ @@ -1061,7 +1074,7 @@ void luaV_finishOp (lua_State *L) { #define updatetrap(ci) (trap = ci->u.l.trap) -#define updatebase(ci) (base = ci->func + 1) +#define updatebase(ci) (base = ci->func.p + 1) #define updatestack(ci) \ @@ -1096,7 +1109,7 @@ void luaV_finishOp (lua_State *L) { ** Whenever code can raise errors, the global 'pc' and the global ** 'top' must be correct to report occasional errors. */ -#define savestate(L,ci) (savepc(L), L->top = ci->top) +#define savestate(L,ci) (savepc(L), L->top.p = ci->top.p) /* @@ -1116,7 +1129,7 @@ void luaV_finishOp (lua_State *L) { /* 'c' is the limit of live values in the stack */ #define checkGC(L,c) \ - { luaC_condGC(L, (savepc(L), L->top = (c)), \ + { luaC_condGC(L, (savepc(L), L->top.p = (c)), \ updatetrap(ci)); \ luai_threadyield(L); } @@ -1128,7 +1141,6 @@ void luaV_finishOp (lua_State *L) { updatebase(ci); /* correct stack */ \ } \ i = *(pc++); \ - ra = RA(i); /* WARNING: any stack reallocation invalidates 'ra' */ \ } #define vmdispatch(o) switch(o) @@ -1148,72 +1160,73 @@ void luaV_execute (lua_State *L, CallInfo *ci) { startfunc: trap = L->hookmask; returning: /* trap already set */ - cl = clLvalue(s2v(ci->func)); + cl = ci_func(ci); k = cl->p->k; pc = ci->u.l.savedpc; - if (l_unlikely(trap)) { - if (pc == cl->p->code) { /* first instruction (not resuming)? */ - if (cl->p->is_vararg) - trap = 0; /* hooks will start after VARARGPREP instruction */ - else /* check 'call' hook */ - luaD_hookcall(L, ci); - } - ci->u.l.trap = 1; /* assume trap is on, for now */ - } - base = ci->func + 1; + if (l_unlikely(trap)) + trap = luaG_tracecall(L); + base = ci->func.p + 1; /* main loop of interpreter */ for (;;) { Instruction i; /* instruction being executed */ - StkId ra; /* instruction's A register */ vmfetch(); #if 0 /* low-level line tracing for debugging Lua */ printf("line: %d\n", luaG_getfuncline(cl->p, pcRel(pc, cl->p))); #endif - lua_assert(base == ci->func + 1); - lua_assert(base <= L->top && L->top < L->stack_last); + lua_assert(base == ci->func.p + 1); + lua_assert(base <= L->top.p && L->top.p <= L->stack_last.p); /* invalidate top for instructions not expecting it */ - lua_assert(isIT(i) || (cast_void(L->top = base), 1)); + lua_assert(isIT(i) || (cast_void(L->top.p = base), 1)); vmdispatch (GET_OPCODE(i)) { vmcase(OP_MOVE) { + StkId ra = RA(i); setobjs2s(L, ra, RB(i)); vmbreak; } vmcase(OP_LOADI) { + StkId ra = RA(i); lua_Integer b = GETARG_sBx(i); setivalue(s2v(ra), b); vmbreak; } vmcase(OP_LOADF) { + StkId ra = RA(i); int b = GETARG_sBx(i); setfltvalue(s2v(ra), cast_num(b)); vmbreak; } vmcase(OP_LOADK) { + StkId ra = RA(i); TValue *rb = k + GETARG_Bx(i); setobj2s(L, ra, rb); vmbreak; } vmcase(OP_LOADKX) { + StkId ra = RA(i); TValue *rb; rb = k + GETARG_Ax(*pc); pc++; setobj2s(L, ra, rb); vmbreak; } vmcase(OP_LOADFALSE) { + StkId ra = RA(i); setbfvalue(s2v(ra)); vmbreak; } vmcase(OP_LFALSESKIP) { + StkId ra = RA(i); setbfvalue(s2v(ra)); pc++; /* skip next instruction */ vmbreak; } vmcase(OP_LOADTRUE) { + StkId ra = RA(i); setbtvalue(s2v(ra)); vmbreak; } vmcase(OP_LOADNIL) { + StkId ra = RA(i); int b = GETARG_B(i); do { setnilvalue(s2v(ra++)); @@ -1221,21 +1234,24 @@ void luaV_execute (lua_State *L, CallInfo *ci) { vmbreak; } vmcase(OP_GETUPVAL) { + StkId ra = RA(i); int b = GETARG_B(i); - setobj2s(L, ra, cl->upvals[b]->v); + setobj2s(L, ra, cl->upvals[b]->v.p); vmbreak; } vmcase(OP_SETUPVAL) { + StkId ra = RA(i); UpVal *uv = cl->upvals[GETARG_B(i)]; - setobj(L, uv->v, s2v(ra)); + setobj(L, uv->v.p, s2v(ra)); luaC_barrier(L, uv, s2v(ra)); vmbreak; } vmcase(OP_GETTABUP) { + StkId ra = RA(i); const TValue *slot; - TValue *upval = cl->upvals[GETARG_B(i)]->v; + TValue *upval = cl->upvals[GETARG_B(i)]->v.p; TValue *rc = KC(i); - TString *key = tsvalue(rc); /* key must be a string */ + TString *key = tsvalue(rc); /* key must be a short string */ if (luaV_fastget(L, upval, key, slot, luaH_getshortstr)) { setobj2s(L, ra, slot); } @@ -1244,6 +1260,7 @@ void luaV_execute (lua_State *L, CallInfo *ci) { vmbreak; } vmcase(OP_GETTABLE) { + StkId ra = RA(i); const TValue *slot; TValue *rb = vRB(i); TValue *rc = vRC(i); @@ -1258,6 +1275,7 @@ void luaV_execute (lua_State *L, CallInfo *ci) { vmbreak; } vmcase(OP_GETI) { + StkId ra = RA(i); const TValue *slot; TValue *rb = vRB(i); int c = GETARG_C(i); @@ -1272,10 +1290,11 @@ void luaV_execute (lua_State *L, CallInfo *ci) { vmbreak; } vmcase(OP_GETFIELD) { + StkId ra = RA(i); const TValue *slot; TValue *rb = vRB(i); TValue *rc = KC(i); - TString *key = tsvalue(rc); /* key must be a string */ + TString *key = tsvalue(rc); /* key must be a short string */ if (luaV_fastget(L, rb, key, slot, luaH_getshortstr)) { setobj2s(L, ra, slot); } @@ -1285,10 +1304,10 @@ void luaV_execute (lua_State *L, CallInfo *ci) { } vmcase(OP_SETTABUP) { const TValue *slot; - TValue *upval = cl->upvals[GETARG_A(i)]->v; + TValue *upval = cl->upvals[GETARG_A(i)]->v.p; TValue *rb = KB(i); TValue *rc = RKC(i); - TString *key = tsvalue(rb); /* key must be a string */ + TString *key = tsvalue(rb); /* key must be a short string */ if (luaV_fastget(L, upval, key, slot, luaH_getshortstr)) { luaV_finishfastset(L, upval, slot, rc); } @@ -1297,6 +1316,7 @@ void luaV_execute (lua_State *L, CallInfo *ci) { vmbreak; } vmcase(OP_SETTABLE) { + StkId ra = RA(i); const TValue *slot; TValue *rb = vRB(i); /* key (table is in 'ra') */ TValue *rc = RKC(i); /* value */ @@ -1311,6 +1331,7 @@ void luaV_execute (lua_State *L, CallInfo *ci) { vmbreak; } vmcase(OP_SETI) { + StkId ra = RA(i); const TValue *slot; int c = GETARG_B(i); TValue *rc = RKC(i); @@ -1325,10 +1346,11 @@ void luaV_execute (lua_State *L, CallInfo *ci) { vmbreak; } vmcase(OP_SETFIELD) { + StkId ra = RA(i); const TValue *slot; TValue *rb = KB(i); TValue *rc = RKC(i); - TString *key = tsvalue(rb); /* key must be a string */ + TString *key = tsvalue(rb); /* key must be a short string */ if (luaV_fastget(L, s2v(ra), key, slot, luaH_getshortstr)) { luaV_finishfastset(L, s2v(ra), slot, rc); } @@ -1337,6 +1359,7 @@ void luaV_execute (lua_State *L, CallInfo *ci) { vmbreak; } vmcase(OP_NEWTABLE) { + StkId ra = RA(i); int b = GETARG_B(i); /* log2(hash size) + 1 */ int c = GETARG_C(i); /* array size */ Table *t; @@ -1346,7 +1369,7 @@ void luaV_execute (lua_State *L, CallInfo *ci) { if (TESTARG_k(i)) /* non-zero extra argument? */ c += GETARG_Ax(*pc) * (MAXARG_C + 1); /* add it to size */ pc++; /* skip extra argument */ - L->top = ra + 1; /* correct top in case of emergency GC */ + L->top.p = ra + 1; /* correct top in case of emergency GC */ t = luaH_new(L); /* memory allocation */ sethvalue2s(L, ra, t); if (b != 0 || c != 0) @@ -1355,6 +1378,7 @@ void luaV_execute (lua_State *L, CallInfo *ci) { vmbreak; } vmcase(OP_SELF) { + StkId ra = RA(i); const TValue *slot; TValue *rb = vRB(i); TValue *rc = RKC(i); @@ -1384,6 +1408,7 @@ void luaV_execute (lua_State *L, CallInfo *ci) { vmbreak; } vmcase(OP_MODK) { + savestate(L, ci); /* in case of division by 0 */ op_arithK(L, luaV_mod, luaV_modf); vmbreak; } @@ -1396,6 +1421,7 @@ void luaV_execute (lua_State *L, CallInfo *ci) { vmbreak; } vmcase(OP_IDIVK) { + savestate(L, ci); /* in case of division by 0 */ op_arithK(L, luaV_idiv, luai_numidiv); vmbreak; } @@ -1412,6 +1438,7 @@ void luaV_execute (lua_State *L, CallInfo *ci) { vmbreak; } vmcase(OP_SHRI) { + StkId ra = RA(i); TValue *rb = vRB(i); int ic = GETARG_sC(i); lua_Integer ib; @@ -1421,6 +1448,7 @@ void luaV_execute (lua_State *L, CallInfo *ci) { vmbreak; } vmcase(OP_SHLI) { + StkId ra = RA(i); TValue *rb = vRB(i); int ic = GETARG_sC(i); lua_Integer ib; @@ -1442,6 +1470,7 @@ void luaV_execute (lua_State *L, CallInfo *ci) { vmbreak; } vmcase(OP_MOD) { + savestate(L, ci); /* in case of division by 0 */ op_arith(L, luaV_mod, luaV_modf); vmbreak; } @@ -1454,6 +1483,7 @@ void luaV_execute (lua_State *L, CallInfo *ci) { vmbreak; } vmcase(OP_IDIV) { /* floor division */ + savestate(L, ci); /* in case of division by 0 */ op_arith(L, luaV_idiv, luai_numidiv); vmbreak; } @@ -1478,6 +1508,7 @@ void luaV_execute (lua_State *L, CallInfo *ci) { vmbreak; } vmcase(OP_MMBIN) { + StkId ra = RA(i); Instruction pi = *(pc - 2); /* original arith. expression */ TValue *rb = vRB(i); TMS tm = (TMS)GETARG_C(i); @@ -1487,6 +1518,7 @@ void luaV_execute (lua_State *L, CallInfo *ci) { vmbreak; } vmcase(OP_MMBINI) { + StkId ra = RA(i); Instruction pi = *(pc - 2); /* original arith. expression */ int imm = GETARG_sB(i); TMS tm = (TMS)GETARG_C(i); @@ -1496,6 +1528,7 @@ void luaV_execute (lua_State *L, CallInfo *ci) { vmbreak; } vmcase(OP_MMBINK) { + StkId ra = RA(i); Instruction pi = *(pc - 2); /* original arith. expression */ TValue *imm = KB(i); TMS tm = (TMS)GETARG_C(i); @@ -1505,6 +1538,7 @@ void luaV_execute (lua_State *L, CallInfo *ci) { vmbreak; } vmcase(OP_UNM) { + StkId ra = RA(i); TValue *rb = vRB(i); lua_Number nb; if (ttisinteger(rb)) { @@ -1519,6 +1553,7 @@ void luaV_execute (lua_State *L, CallInfo *ci) { vmbreak; } vmcase(OP_BNOT) { + StkId ra = RA(i); TValue *rb = vRB(i); lua_Integer ib; if (tointegerns(rb, &ib)) { @@ -1529,6 +1564,7 @@ void luaV_execute (lua_State *L, CallInfo *ci) { vmbreak; } vmcase(OP_NOT) { + StkId ra = RA(i); TValue *rb = vRB(i); if (l_isfalse(rb)) setbtvalue(s2v(ra)); @@ -1537,21 +1573,25 @@ void luaV_execute (lua_State *L, CallInfo *ci) { vmbreak; } vmcase(OP_LEN) { + StkId ra = RA(i); Protect(luaV_objlen(L, ra, vRB(i))); vmbreak; } vmcase(OP_CONCAT) { + StkId ra = RA(i); int n = GETARG_B(i); /* number of elements to concatenate */ - L->top = ra + n; /* mark the end of concat operands */ + L->top.p = ra + n; /* mark the end of concat operands */ ProtectNT(luaV_concat(L, n)); - checkGC(L, L->top); /* 'luaV_concat' ensures correct top */ + checkGC(L, L->top.p); /* 'luaV_concat' ensures correct top */ vmbreak; } vmcase(OP_CLOSE) { + StkId ra = RA(i); Protect(luaF_close(L, ra, LUA_OK, 1)); vmbreak; } vmcase(OP_TBC) { + StkId ra = RA(i); /* create new to-be-closed upvalue */ halfProtect(luaF_newtbcupval(L, ra)); vmbreak; @@ -1561,6 +1601,7 @@ void luaV_execute (lua_State *L, CallInfo *ci) { vmbreak; } vmcase(OP_EQ) { + StkId ra = RA(i); int cond; TValue *rb = vRB(i); Protect(cond = luaV_equalobj(L, s2v(ra), rb)); @@ -1576,6 +1617,7 @@ void luaV_execute (lua_State *L, CallInfo *ci) { vmbreak; } vmcase(OP_EQK) { + StkId ra = RA(i); TValue *rb = KB(i); /* basic types do not use '__eq'; we can use raw equality */ int cond = luaV_rawequalobj(s2v(ra), rb); @@ -1583,6 +1625,7 @@ void luaV_execute (lua_State *L, CallInfo *ci) { vmbreak; } vmcase(OP_EQI) { + StkId ra = RA(i); int cond; int im = GETARG_sB(i); if (ttisinteger(s2v(ra))) @@ -1611,11 +1654,13 @@ void luaV_execute (lua_State *L, CallInfo *ci) { vmbreak; } vmcase(OP_TEST) { + StkId ra = RA(i); int cond = !l_isfalse(s2v(ra)); docondjump(); vmbreak; } vmcase(OP_TESTSET) { + StkId ra = RA(i); TValue *rb = vRB(i); if (l_isfalse(rb) == GETARG_k(i)) pc++; @@ -1626,11 +1671,12 @@ void luaV_execute (lua_State *L, CallInfo *ci) { vmbreak; } vmcase(OP_CALL) { + StkId ra = RA(i); CallInfo *newci; int b = GETARG_B(i); int nresults = GETARG_C(i) - 1; if (b != 0) /* fixed number of arguments? */ - L->top = ra + b; /* top signals number of arguments */ + L->top.p = ra + b; /* top signals number of arguments */ /* else previous instruction set top */ savepc(L); /* in case of errors */ if ((newci = luaD_precall(L, ra, nresults)) == NULL) @@ -1642,54 +1688,57 @@ void luaV_execute (lua_State *L, CallInfo *ci) { vmbreak; } vmcase(OP_TAILCALL) { + StkId ra = RA(i); int b = GETARG_B(i); /* number of arguments + 1 (function) */ int n; /* number of results when calling a C function */ int nparams1 = GETARG_C(i); /* delta is virtual 'func' - real 'func' (vararg functions) */ int delta = (nparams1) ? ci->u.l.nextraargs + nparams1 : 0; if (b != 0) - L->top = ra + b; + L->top.p = ra + b; else /* previous instruction set top */ - b = cast_int(L->top - ra); + b = cast_int(L->top.p - ra); savepc(ci); /* several calls here can raise errors */ if (TESTARG_k(i)) { luaF_closeupval(L, base); /* close upvalues from current call */ - lua_assert(L->tbclist < base); /* no pending tbc variables */ - lua_assert(base == ci->func + 1); + lua_assert(L->tbclist.p < base); /* no pending tbc variables */ + lua_assert(base == ci->func.p + 1); } if ((n = luaD_pretailcall(L, ci, ra, b, delta)) < 0) /* Lua function? */ goto startfunc; /* execute the callee */ else { /* C function? */ - ci->func -= delta; /* restore 'func' (if vararg) */ + ci->func.p -= delta; /* restore 'func' (if vararg) */ luaD_poscall(L, ci, n); /* finish caller */ updatetrap(ci); /* 'luaD_poscall' can change hooks */ goto ret; /* caller returns after the tail call */ } } vmcase(OP_RETURN) { + StkId ra = RA(i); int n = GETARG_B(i) - 1; /* number of results */ int nparams1 = GETARG_C(i); if (n < 0) /* not fixed? */ - n = cast_int(L->top - ra); /* get what is available */ + n = cast_int(L->top.p - ra); /* get what is available */ savepc(ci); if (TESTARG_k(i)) { /* may there be open upvalues? */ ci->u2.nres = n; /* save number of returns */ - if (L->top < ci->top) - L->top = ci->top; + if (L->top.p < ci->top.p) + L->top.p = ci->top.p; luaF_close(L, base, CLOSEKTOP, 1); updatetrap(ci); updatestack(ci); } if (nparams1) /* vararg function? */ - ci->func -= ci->u.l.nextraargs + nparams1; - L->top = ra + n; /* set call for 'luaD_poscall' */ + ci->func.p -= ci->u.l.nextraargs + nparams1; + L->top.p = ra + n; /* set call for 'luaD_poscall' */ luaD_poscall(L, ci, n); updatetrap(ci); /* 'luaD_poscall' can change hooks */ goto ret; } vmcase(OP_RETURN0) { if (l_unlikely(L->hookmask)) { - L->top = ra; + StkId ra = RA(i); + L->top.p = ra; savepc(ci); luaD_poscall(L, ci, 0); /* no hurry... */ trap = 1; @@ -1697,15 +1746,16 @@ void luaV_execute (lua_State *L, CallInfo *ci) { else { /* do the 'poscall' here */ int nres; L->ci = ci->previous; /* back to caller */ - L->top = base - 1; + L->top.p = base - 1; for (nres = ci->nresults; l_unlikely(nres > 0); nres--) - setnilvalue(s2v(L->top++)); /* all results are nil */ + setnilvalue(s2v(L->top.p++)); /* all results are nil */ } goto ret; } vmcase(OP_RETURN1) { if (l_unlikely(L->hookmask)) { - L->top = ra + 1; + StkId ra = RA(i); + L->top.p = ra + 1; savepc(ci); luaD_poscall(L, ci, 1); /* no hurry... */ trap = 1; @@ -1714,12 +1764,13 @@ void luaV_execute (lua_State *L, CallInfo *ci) { int nres = ci->nresults; L->ci = ci->previous; /* back to caller */ if (nres == 0) - L->top = base - 1; /* asked for no results */ + L->top.p = base - 1; /* asked for no results */ else { + StkId ra = RA(i); setobjs2s(L, base - 1, ra); /* at least this result */ - L->top = base; + L->top.p = base; for (; l_unlikely(nres > 1); nres--) - setnilvalue(s2v(L->top++)); /* complete missing results */ + setnilvalue(s2v(L->top.p++)); /* complete missing results */ } } ret: /* return from a Lua function */ @@ -1731,6 +1782,7 @@ void luaV_execute (lua_State *L, CallInfo *ci) { } } vmcase(OP_FORLOOP) { + StkId ra = RA(i); if (ttisinteger(s2v(ra + 2))) { /* integer loop? */ lua_Unsigned count = l_castS2U(ivalue(s2v(ra + 1))); if (count > 0) { /* still more iterations? */ @@ -1749,12 +1801,14 @@ void luaV_execute (lua_State *L, CallInfo *ci) { vmbreak; } vmcase(OP_FORPREP) { + StkId ra = RA(i); savestate(L, ci); /* in case of errors */ if (forprep(L, ra)) pc += GETARG_Bx(i) + 1; /* skip the loop */ vmbreak; } vmcase(OP_TFORPREP) { + StkId ra = RA(i); /* create to-be-closed upvalue (if needed) */ halfProtect(luaF_newtbcupval(L, ra + 3)); pc += GETARG_Bx(i); @@ -1763,7 +1817,8 @@ void luaV_execute (lua_State *L, CallInfo *ci) { goto l_tforcall; } vmcase(OP_TFORCALL) { - l_tforcall: + l_tforcall: { + StkId ra = RA(i); /* 'ra' has the iterator function, 'ra + 1' has the state, 'ra + 2' has the control variable, and 'ra + 3' has the to-be-closed variable. The call will use the stack after @@ -1771,29 +1826,31 @@ void luaV_execute (lua_State *L, CallInfo *ci) { */ /* push function, state, and control variable */ memcpy(ra + 4, ra, 3 * sizeof(*ra)); - L->top = ra + 4 + 3; + L->top.p = ra + 4 + 3; ProtectNT(luaD_call(L, ra + 4, GETARG_C(i))); /* do the call */ updatestack(ci); /* stack may have changed */ i = *(pc++); /* go to next instruction */ lua_assert(GET_OPCODE(i) == OP_TFORLOOP && ra == RA(i)); goto l_tforloop; - } + }} vmcase(OP_TFORLOOP) { - l_tforloop: + l_tforloop: { + StkId ra = RA(i); if (!ttisnil(s2v(ra + 4))) { /* continue loop? */ setobjs2s(L, ra + 2, ra + 4); /* save control variable */ pc -= GETARG_Bx(i); /* jump back */ } vmbreak; - } + }} vmcase(OP_SETLIST) { + StkId ra = RA(i); int n = GETARG_B(i); unsigned int last = GETARG_C(i); Table *h = hvalue(s2v(ra)); if (n == 0) - n = cast_int(L->top - ra) - 1; /* get up to the top */ + n = cast_int(L->top.p - ra) - 1; /* get up to the top */ else - L->top = ci->top; /* correct top in case of emergency GC */ + L->top.p = ci->top.p; /* correct top in case of emergency GC */ last += n; if (TESTARG_k(i)) { last += GETARG_Ax(*pc) * (MAXARG_C + 1); @@ -1810,12 +1867,14 @@ void luaV_execute (lua_State *L, CallInfo *ci) { vmbreak; } vmcase(OP_CLOSURE) { + StkId ra = RA(i); Proto *p = cl->p->p[GETARG_Bx(i)]; halfProtect(pushclosure(L, p, cl->upvals, base, ra)); checkGC(L, ra + 1); vmbreak; } vmcase(OP_VARARG) { + StkId ra = RA(i); int n = GETARG_C(i) - 1; /* required results */ Protect(luaT_getvarargs(L, ci, ra, n)); vmbreak; diff --git a/3rdparty/lua/src/lvm.h b/3rdparty/lua/src/lvm.h index 1bc16f3a50ba4..dba1ad277025e 100644 --- a/3rdparty/lua/src/lvm.h +++ b/3rdparty/lua/src/lvm.h @@ -110,6 +110,11 @@ typedef enum { luaC_barrierback(L, gcvalue(t), v); } +/* +** Shift right is the same as shift left with a negative 'y' +*/ +#define luaV_shiftr(x,y) luaV_shiftl(x,intop(-, 0, y)) + LUAI_FUNC int luaV_equalobj (lua_State *L, const TValue *t1, const TValue *t2); diff --git a/3rdparty/softfloat/mamesf.h b/3rdparty/softfloat/mamesf.h index 437f54834e369..08b03d55d7514 100644 --- a/3rdparty/softfloat/mamesf.h +++ b/3rdparty/softfloat/mamesf.h @@ -1,12 +1,3 @@ -/*---------------------------------------------------------------------------- -| One of the macros `BIGENDIAN' or `LITTLEENDIAN' must be defined. -*----------------------------------------------------------------------------*/ -#ifdef LSB_FIRST -#define LITTLEENDIAN -#else -#define BIGENDIAN -#endif - /*---------------------------------------------------------------------------- | The macro `BITS64' can be defined to indicate that 64-bit integer types are | supported by the compiler. diff --git a/3rdparty/softfloat/milieu.h b/3rdparty/softfloat/milieu.h index 10687b755d0de..523710d27f1db 100644 --- a/3rdparty/softfloat/milieu.h +++ b/3rdparty/softfloat/milieu.h @@ -34,9 +34,3 @@ these four paragraphs for those parts of this code that are retained. | Include common integer types and flags. *----------------------------------------------------------------------------*/ #include "mamesf.h" - -/*---------------------------------------------------------------------------- -| Symbolic Boolean literals. -*----------------------------------------------------------------------------*/ -#define FALSE 0 -#define TRUE 1 diff --git a/COPYING b/COPYING index 373663ecab22f..746f93136bf53 100644 --- a/COPYING +++ b/COPYING @@ -161,10 +161,10 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Expat Copyright (c) 1998-2000 Thai Open Source Software Center Ltd and Clark Cooper -Copyright (c) 2001-2019 Expat maintainers +Copyright (c) 2001-2022 Expat maintainers Lua - a powerful, fast, lightweight, embeddable scripting language -Copyright (c) 1994-2017 Lua.org, PUC-Rio +Copyright (c) 1994-2024 Lua.org, PUC-Rio LuaFileSystem - File System Library for Lua Copyright (c) 2003-2015 Kepler Project diff --git a/android-project/app/src/main/AndroidManifest.xml b/android-project/app/src/main/AndroidManifest.xml index ca6e4384c10d9..c55e3218a60d9 100644 --- a/android-project/app/src/main/AndroidManifest.xml +++ b/android-project/app/src/main/AndroidManifest.xml @@ -4,8 +4,8 @@ --> diff --git a/dist.mak b/dist.mak index edbb4cd67cbb8..d046914734b3e 100644 --- a/dist.mak +++ b/dist.mak @@ -128,6 +128,6 @@ $(STAGEDIR)/docs/MAME.pdf: docs/build/latex/MAME.pdf | $(GEN_FOLDERS) $(call COPY,$<,$@) docs/build/latex/MAME.pdf: - $(MAKE) -C docs latexpdf + $(MAKE) -C docs PAPER=a4 latexpdf .PHONY: all clean diff --git a/docs/Makefile b/docs/Makefile index b5c45c82ca795..48b674871a7b3 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -8,8 +8,8 @@ PAPER = BUILDDIR = build # Internal variables. -PAPEROPT_a4 = -D latex_paper_size=a4 -PAPEROPT_letter = -D latex_paper_size=letter +PAPEROPT_a4 = -D latex_elements.papersize=a4paper +PAPEROPT_letter = -D latex_elements.papersize=letterpaper ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source # the i18n builder cannot share the environment and doctrees with the others I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source diff --git a/docs/source/conf.py b/docs/source/conf.py index 6d405ec8f20c9..ec88e24fcd98a 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -63,9 +63,9 @@ # built documents. # # The short X.Y version. -version = '0.275' +version = '0.276' # The full version, including alpha/beta/rc tags. -release = '0.275' +release = '0.276' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/docs/source/debugger/exceptionpoint.rst b/docs/source/debugger/exceptionpoint.rst index 52a8ee67a19cd..46ce7b8d41ad5 100644 --- a/docs/source/debugger/exceptionpoint.rst +++ b/docs/source/debugger/exceptionpoint.rst @@ -1,21 +1,21 @@ .. _debugger-exceptionpoint-list: -Exception Point Debugger Commands -================================= +Exceptionpoint Debugger Commands +================================ :ref:`debugger-command-epset` - sets a new exception point + sets a new exceptionpoint :ref:`debugger-command-epclear` - clears a specific exception point or all exception points + clears a specific exceptionpoint or all exceptionpoints :ref:`debugger-command-epdisable` - disables a specific exception point or all exception points + disables a specific exceptionpoint or all exceptionpoints :ref:`debugger-command-epenable` - enables a specific exception point or all exception points + enables a specific exceptionpoint or all exceptionpoints :ref:`debugger-command-eplist` - lists exception points + lists exceptionpoints -Exception points halt execution and activate the debugger when -a CPU raises a particular exception number. +Exceptionpoints halt execution and activate the debugger when a CPU +raises a particular exception number. .. _debugger-command-epset: @@ -25,24 +25,24 @@ epset **ep[set] [,[,]]** -Sets a new exception point for exceptions of type ****. The +Sets a new exceptionpoint for exceptions of type ****. The optional **** parameter lets you specify an expression that -will be evaluated each time the exception point is hit. If the result -of the expression is true (non-zero), the exception point will actually +will be evaluated each time the exceptionpoint is hit. If the result +of the expression is true (non-zero), the exceptionpoint will actually halt execution at the start of the exception handler; otherwise, execution will continue with no notification. The optional **** -parameter provides a command that is executed whenever the exception -point is hit and the **** is true. Note that you may need to -embed the action within braces ``{ }`` in order to prevent commas and -semicolons from being interpreted as applying to the ``epset`` command -itself. +parameter provides a command that is executed whenever the +exceptionpoint is hit and the **** is true. Note that you +may need to embed the action within braces ``{ }`` in order to prevent +commas and semicolons from being interpreted as applying to the +``epset`` command itself. The numbering of exceptions depends upon the CPU type. Causes of exceptions may include internally or externally vectored interrupts, errors occurring within instructions and system calls. -Each exception point that is set is assigned an index which can be used -in other exception point commands to reference this exception point. +Each exceptionpoint that is set is assigned an index which can be used +in other exceptionpoint commands to reference this exceptionpoint. Examples: @@ -60,17 +60,17 @@ epclear **epclear [[,…]]** -The epclear command clears exception points. If **** is -specified, only the requested exception points are cleared, otherwise -all exception points are cleared. +The epclear command clears exceptionpoints. If **** is +specified, only the requested exceptionpoints are cleared, otherwise +all exceptionpoints are cleared. Examples: ``epclear 3`` - Clear exception point index 3. + Clear exceptionpoint index 3. ``epclear`` - Clear all exception points. + Clear all exceptionpoints. Back to :ref:`debugger-exceptionpoint-list` @@ -82,19 +82,19 @@ epdisable **epdisable [[,…]]** -The epdisable command disables exception points. If **** is -specified, only the requested exception points are disabled, otherwise -all exception points are disabled. Note that disabling an exception -point does not delete it, it just temporarily marks the exception -point as inactive. +The epdisable command disables exceptionpoints. If **** is +specified, only the requested exceptionpoints are disabled, otherwise +all exceptionpoints are disabled. Note that disabling an +exceptionpoint does not delete it, it just temporarily marks the +exceptionpoint as inactive. Examples: ``epdisable 3`` - Disable exception point index 3. + Disable exceptionpoint index 3. ``epdisable`` - Disable all exception points. + Disable all exceptionpoints. Back to :ref:`debugger-exceptionpoint-list` @@ -106,17 +106,17 @@ epenable **epenable [[,…]]** -The epenable command enables exception points. If **** is -specified, only the requested exception points are enabled, otherwise -all exception points are enabled. +The epenable command enables exceptionpoints. If **** is +specified, only the requested exceptionpoints are enabled, otherwise +all exceptionpoints are enabled. Examples: ``epenable 3`` - Enable exception point index 3. + Enable exceptionpoint index 3. ``epenable`` - Enable all exception points. + Enable all exceptionpoints. Back to :ref:`debugger-exceptionpoint-list` @@ -128,7 +128,7 @@ eplist **eplist** -The eplist command lists all the current exception points, along with +The eplist command lists all the current exceptionpoints, along with their index and any conditions or actions attached to them. Back to :ref:`debugger-exceptionpoint-list` diff --git a/hash/a800.xml b/hash/a800.xml index 0b942cb695614..203d68aeb18ae 100644 --- a/hash/a800.xml +++ b/hash/a800.xml @@ -3565,7 +3565,7 @@ Hangs on green screen, looping on [PIO porta] read/writes, expects tablet comms - + Letter Perfect (80 column version) 1981 LJK diff --git a/hash/amiga_apps.xml b/hash/amiga_apps.xml index 700bd513a8417..d4ab603cacc84 100644 --- a/hash/amiga_apps.xml +++ b/hash/amiga_apps.xml @@ -116,7 +116,7 @@ license:CC0-1.0 - + SuperDuper 2.02 19?? Amitech Denmark diff --git a/hash/coco_flop.xml b/hash/coco_flop.xml index a895665547224..292f63cf5d531 100644 --- a/hash/coco_flop.xml +++ b/hash/coco_flop.xml @@ -22,7 +22,7 @@ license:CC0-1.0 - + Donkey Kong (Sock Master's Donkey Kong Emulator for CoCo 3) (512Kb) 2007 Sock Master @@ -37,7 +37,7 @@ license:CC0-1.0 - + Donkey Kong Remix (Sock Master's Donkey Kong Remix Emulator for CoCo 3) (512Kb) 2015 Sock Master @@ -52,7 +52,7 @@ license:CC0-1.0 - + Pacman (z80 to 6809 Transcoded - v1.01) (512kb) 2017 Glen Hewlett @@ -67,7 +67,7 @@ license:CC0-1.0 - + Joust (6809 Transcoded - v1.10) (512kb) 2021 Glen Hewlett diff --git a/hash/database.xml b/hash/database.xml index c48628672a959..423688d260d86 100644 --- a/hash/database.xml +++ b/hash/database.xml @@ -254,7 +254,7 @@ license:CC0-1.0 - + Leapfrog 1982 Voltmace diff --git a/hash/fidel_scc.xml b/hash/fidel_scc.xml index 6d57596cd272e..615ffeb1f658c 100644 --- a/hash/fidel_scc.xml +++ b/hash/fidel_scc.xml @@ -9,9 +9,10 @@ license:CC0-1.0 - Challenger Book Openings 1 + Book Openings 1 1982 Fidelity Electronics + @@ -20,9 +21,10 @@ license:CC0-1.0 - Challenger Book Openings 2 (set 1) + Book Openings 2 (set 1) 1982 Fidelity Electronics + @@ -32,9 +34,10 @@ license:CC0-1.0 - Challenger Book Openings 2 (set 2) + Book Openings 2 (set 2) 1982 Fidelity Electronics + @@ -43,4 +46,60 @@ license:CC0-1.0 + + Chess Encyclopedia + 1984 + Fidelity Electronics + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Sicilian Variation + 1983 + Fidelity Electronics + + + + + + + + + diff --git a/hash/ibm5170.xml b/hash/ibm5170.xml index 33644ea286af7..82fb376f29096 100644 --- a/hash/ibm5170.xml +++ b/hash/ibm5170.xml @@ -8919,6 +8919,101 @@ Missing [modem] features, assume requiring a connection to a Reuters device such + + PartitionMagic 8.05 (English) + 2004 + Symantec + + + + + + + + + + + + + + + + + PartitionMagic 8.05 (French) + 2004 + Symantec + + + + + + + + + + + + + + + + + PartitionMagic 8.05 (German) + 2004 + Symantec + + + + + + + + + + + + + + + + + PartitionMagic 8.05 (Italian) + 2004 + Symantec + + + + + + + + + + + + + + + + + PartitionMagic 8.05 (Spanish) + 2004 + Symantec + + + + + + + + + + + + + + + RobotC2 Demo 1989 diff --git a/hash/ibm5170_cdrom.xml b/hash/ibm5170_cdrom.xml index 3cf79d255d949..40cdbbb19ac5c 100644 --- a/hash/ibm5170_cdrom.xml +++ b/hash/ibm5170_cdrom.xml @@ -7468,6 +7468,23 @@ Other stuff untested + + + PartitionMagic 8.05 + 2004 + Symantec + + + + + + + + + + + diff --git a/hash/megacd.xml b/hash/megacd.xml index 1fe13f5f075df..90d8941b65337 100644 --- a/hash/megacd.xml +++ b/hash/megacd.xml @@ -1736,7 +1736,7 @@ Black screen, requires sub CPU to be overclocked by 1.5x - + - Cadillacs and Dinosaurs - The Second Cataclysm (Bra) + Cadillacs and Dinosaurs - The Second Cataclysm (Brazil) 1994 Tec Toy @@ -10199,7 +10199,7 @@ Requires [disc swap] --> - Night Trap (USA, Re-Release) + Night Trap (USA, re-release) 1995 Sega --> - Silpheed Hibaihin (Japan) (fixed) + Silpheed Hibaihin (Japan, fixed) 1993 Game Arts diff --git a/hash/neogeo.xml b/hash/neogeo.xml index 8f92545e11d10..c7ce55a6d74bd 100644 --- a/hash/neogeo.xml +++ b/hash/neogeo.xml @@ -365,7 +365,7 @@ license:CC0-1.0 - + @@ -408,7 +408,7 @@ license:CC0-1.0 - + @@ -1123,7 +1123,7 @@ license:CC0-1.0 - + @@ -2107,7 +2107,7 @@ license:CC0-1.0 - + diff --git a/hash/pc88va.xml b/hash/pc88va.xml index 1b99f9a208cea..804900386e93b 100644 --- a/hash/pc88va.xml +++ b/hash/pc88va.xml @@ -82,7 +82,7 @@ Operating Systems --> - + @@ -90,8 +90,8 @@ Operating Systems 19?? NEC @@ -110,10 +110,7 @@ Transition between 3rd and 4th sequences don't look right, [IDP] 19?? NEC @@ -128,10 +125,7 @@ Transition between 3rd and 4th sequences don't look right, [IDP] 19?? NEC @@ -140,6 +134,8 @@ Transition between 3rd and 4th sequences don't look right, [IDP] + + Anime Framer (v1.0) @@ -149,6 +145,8 @@ Transition between 3rd and 4th sequences don't look right, [IDP] [gfx] status bar has wrong colors [OFX/OFY] ]]> + + @@ -173,6 +171,7 @@ Transition between 3rd and 4th sequences don't look right, [IDP] + @@ -194,8 +193,8 @@ Transition between 3rd and 4th sequences don't look right, [IDP] 1989 Music Network @@ -204,16 +203,22 @@ Has unsupported MIF-201 [MIDI] interface cfr. http://www.pc88.gr.jp/vafaq/view.p + + PC-Engine (VA2 Tenpu-ban) 1988 NEC + + @@ -226,11 +231,11 @@ Untested directory NEC_SAMP (cannot type [keyboard] underscore char) 1988 NEC - + + + @@ -239,14 +244,14 @@ Untested directory NEC_SAMP (cannot type [keyboard] underscore char) - + Family Stadium 19?? ゲームアーツ (Game Arts) 19?? ゲームアーツ (Game Arts) - @@ -312,9 +313,8 @@ How to exit from attract mode once you enter it? 19?? ゲームアーツ (Game Arts) @@ -345,7 +345,7 @@ Winning newspaper screen has [OFX/OFY] bug 198? スタークラフト (Starcraft) @@ -380,6 +380,8 @@ Main menu clearing artifacts [ROP] Burps on [FDC] access after disk swap with program and player disks, trying to scan chrn=(4, 0, 1, 256) ]]> + + @@ -414,10 +416,12 @@ Burps on [FDC] access after disk swap with program and player disks, trying to s 1987 ウインキーソフト (Winky Soft) @@ -456,10 +460,7 @@ Gameplay start with [cliprect] mask effect 1987 ウインキーソフト (Winky Soft) @@ -498,9 +499,9 @@ Gameplay start with [cliprect] mask effect 1988 NEC @@ -523,6 +524,7 @@ Needs graphic [OFX/OFY] scroll Burps on [FDC] access after disk swap with program and player disks, trying to scan chrn=(38, 0, 1, 256) ]]> + @@ -539,7 +541,7 @@ Burps on [FDC] access after disk swap with program and player disks, trying to s - + @@ -552,12 +554,13 @@ Burps on [FDC] access after disk swap with program and player disks, trying to s システムソフト (System Soft) + + @@ -570,12 +573,15 @@ Winning animation is glitchy [OFX/OFY]?, uses [IDP] text transpen with upper bit 1987 日本テレネット (Nihon Telenet) + + @@ -586,7 +592,7 @@ Omake: if sound irqs don't run then needs to press key 0 pad to move on - + @@ -785,7 +791,6 @@ Enables [FDC] PIO mode, black screen 1988 B·P·S (Bullet-Proof Software) @@ -805,8 +810,9 @@ Fails [floppy] copy protection, draws "TETRIS IS ONLY 6,800 YEN" on title screen 1992 マイクロキャビン (Micro Cabin) @@ -867,27 +873,30 @@ Has unemulated [MIDI] options 1990 マイクロキャビン (Micro Cabin) - + + + + @@ -899,34 +908,37 @@ Optionally wants kana lock enabled for entering a name for new game [keyboard] i 1991 マイクロキャビン (Micro Cabin) + + + + @@ -935,29 +947,26 @@ Ugly pitch for [OPNA] voice samples on intro - + - + Abunai Tengu Densetsu 1989 アリスソフト (Alicesoft) - - + - + - + - + @@ -969,27 +978,25 @@ Loads N88 BASIC then jumps to lalaland [FDC] - + Crescent Moon Girl 1989 アリスソフト (Alicesoft) - + - + - + - + - + @@ -1001,27 +1008,24 @@ Loads N88 BASIC then jumps to lalaland [FDC] - + D.P.S - Dream Program System 1989 アリスソフト (Alicesoft) - - + - + - + - + @@ -1142,22 +1146,22 @@ Loads N88 BASIC then jumps to lalaland [FDC] 1989 アリスソフト (Alicesoft) - + - + - + - + @@ -1229,17 +1233,17 @@ All disks fail initial bootstrap [FDC] - + Balloon Breaker 1996 <doujin> @@ -1255,8 +1259,7 @@ Has unemulated [SGP] operand for shot 1 1996 <doujin> @@ -1272,8 +1275,9 @@ Needs graphic [OFX/OFY] scroll on gameplay 2006 <doujin> @@ -1296,8 +1300,10 @@ Broken graphics [SGP] or [cliprect] 1994 <doujin> @@ -1308,14 +1314,42 @@ Needs [OFX/OFY] on gameplay + + + Pac-Man + 2006? + <doujin> + + + + + + + + + + + + Pac-Man (auto-bootable) + 2011? + <doujin> + + + + + + + + Saishuu Heiki UPO (Pre-Release) 1992 <doujin> @@ -1326,40 +1360,241 @@ Gameplay don't mask bullets on right side, [cliprect] - - Pac-Man - 19?? - <doujin> + + + + Aerial + 2023 + Inufuto - - - - + + - - - Pac-Man (auto-bootable) - 19?? - <doujin> + + AntiAir + 2024 + Inufuto - - - + + + + Ascend + 2023 + Inufuto + + + + + + + + + + Battlot + 2023 + Inufuto + + + + + + + + + + Bootskell + 2023 + Inufuto + + + + + + + + + + Cacorm + 2023 + Inufuto + + + + + + + + + + Cavit + 2023 + Inufuto + + + + + + + + + + Cracky + 2023 + Inufuto + + + + + + + + + + Guntus + 2023 + Inufuto + + + + + + + + + + Hopman + 2023 + Inufuto + + + + + + + + + + Impetus + 2023 + Inufuto + + + + + + + + + + Lift + 2023 + Inufuto + + + + + + + + + + Neuras + 2023 + Inufuto + + + + + + + + + + Osotos + 2024 + Inufuto + + + + + + + + + + Ruptus + 2023 + Inufuto + + + + + + + + + + Yewdow + 2023 + Inufuto + + + + + + + - + diff --git a/hash/pc98_cd.xml b/hash/pc98_cd.xml index c39c86b8d8ca7..d2891eec43749 100644 --- a/hash/pc98_cd.xml +++ b/hash/pc98_cd.xml @@ -16,7 +16,33 @@ license:CC0-1.0 --> - + + + + + + + + FreeBSD(98) Nyuumon Kit (2.1.0R) + 1996 + Shuwa System + + + + + + + + + + + - - Arkos - 1988 - Zigurat Software - - - - - - - - - - - - Advanced Pinball Simulator @@ -260,13 +244,26 @@ license:CC0-1.0 - - Arcade Flight Simulator - 1989 - Code Masters + + African Trail Simulator + 1990 + Positive + - - + + + + + + + + Ajedrez + 1986 + Indescomp + + + + @@ -350,6 +347,33 @@ license:CC0-1.0 + + Arcade Flight Simulator + 1989 + Code Masters + + + + + + + + + Arkos + 1988 + Zigurat Software + + + + + + + + + + + + Astor Gamão 1985 @@ -2691,24 +2715,18 @@ no loading screen, no custom loader - - BMX Simulator 2 - Dirt Biking + BMX Simulator 2 1989 Code Masters - + + - - - - - BMX Simulator 2 - Quarry Racing - 1989 - Code Masters - + + @@ -4222,8 +4240,8 @@ no loading screen, no custom loader Batman - The Movie (alt) - 19?? - <unknown> + 1989 + Ocean @@ -4445,8 +4463,8 @@ no loading screen, no custom loader Bobsleigh (set 2, Byte-Back) - 19?? - <unknown> + 1987 + Byte-Back @@ -4456,8 +4474,8 @@ no loading screen, no custom loader Bobsleigh (set 3) - 19?? - <unknown> + 1987 + Digital Integration @@ -8985,7 +9003,7 @@ no loading screen, no custom loader Daley Thompson's Decathlon (set 3, The Hit Squad) - 1984 + 1989 The Hit Squad @@ -13483,7 +13501,7 @@ Expects you to press a key after the title screen appears, or it will miss the n Head Over Heels (The Hit Squad) - 1987 + 1990 The Hit Squad @@ -24324,8 +24342,8 @@ Side B: Laser Shoot (original release) R-Type (The Hit Squad) - 1988 - Electric Dreams Software / The Hit Squad + 1990 + The Hit Squad @@ -24340,7 +24358,7 @@ Side B: Laser Shoot (original release) R-Type (MCM) - 1988 + 1989 MCM Software @@ -24868,8 +24886,8 @@ Side B: Laser Shoot (original release) Revolution (set 2) - 19?? - <unknown> + 1986 + U.S. Gold @@ -31928,7 +31946,7 @@ Side B: Laser Shoot (original release) - Yie Ar Kung Fu (set 1) + Yie Ar Kung-Fu (set 1) 1985 Imagine Software @@ -31939,8 +31957,8 @@ Side B: Laser Shoot (original release) - Yie Ar Kung Fu (set 2, The Hit Squad) - 1985 + Yie Ar Kung-Fu (set 2, The Hit Squad) + 1989 The Hit Squad @@ -31950,7 +31968,7 @@ Side B: Laser Shoot (original release) - Yie Ar Kung Fu (set 3, Erbe, medium case) + Yie Ar Kung-Fu (set 3, Erbe, medium case) 1985 Erbe Software @@ -31972,7 +31990,7 @@ Side B: Laser Shoot (original release) - Yie Ar Kung Fu (set 5, The Hit Squad) + Yie Ar Kung-Fu (set 5, The Hit Squad) 1985 The Hit Squad @@ -31983,7 +32001,7 @@ Side B: Laser Shoot (original release) - Yie Ar Kung Fu (set 6) + Yie Ar Kung-Fu (set 6) 1985 Imagine Software @@ -31994,7 +32012,7 @@ Side B: Laser Shoot (original release) - Yie Ar Kung Fu 2 (set 1) + Yie Ar Kung-Fu 2 (set 1) 1986 Imagine Software @@ -32005,7 +32023,7 @@ Side B: Laser Shoot (original release) - Yie Ar Kung Fu 2 (set 2) + Yie Ar Kung-Fu 2 (set 2) 1986 Imagine Software @@ -48597,17 +48615,6 @@ Side B: Once Upon a Lily Pad - - Astronomy (Skysoft) - 19?? - <unknown> - - - - - - - Astronomy 19?? @@ -48624,6 +48631,17 @@ Side B: Once Upon a Lily Pad + + Astronomy Compilation (Skysoft) + 1985 + Skysoft + + + + + + + Astronut 1984 @@ -50772,9 +50790,10 @@ Side B: Once Upon a Lily Pad - Base De Datos (set 2) (Gem 01) (ABC Soft) + Base de Datos (set 2) (Gem 01) (ABC Soft) 1982 ABC Soft + @@ -50782,10 +50801,11 @@ Side B: Once Upon a Lily Pad - - Base De Datos - 19?? - <unknown> + + Base de Datos + 1986 + Inverstronica + @@ -53402,20 +53422,20 @@ Side B: Once Upon a Lily Pad - Bog of Brit (Zenobi) + Bog of Brit 1990 - Zenobi Software + Stormbringer Software - - + + - Bog of Brit (set 2) - 19?? - <unknown> + Bog of Brit (alt) + 1990 + Stormbringer Software @@ -53424,12 +53444,12 @@ Side B: Once Upon a Lily Pad - Bog of Brit - 19?? - <unknown> + Bog of Brit (Zenobi) + 1990 + Zenobi Software - - + + @@ -53446,9 +53466,9 @@ Side B: Once Upon a Lily Pad - Boiler House - 19?? - <unknown> + Boilerhouse + 1984 + Andromeda Software @@ -67753,6 +67773,19 @@ Side B: Once Upon a Lily Pad + + Destronado + 1988 + Conrado Badenas Mengod + + + + + + + + + Destroyer (release 1) 1983 @@ -102365,7 +102398,6 @@ Lacks game introduction, bad dump or alternate version? - Mad Martha II (release 2) 1983 @@ -102377,7 +102409,6 @@ Lacks game introduction, bad dump or alternate version? - Mad Martha II (release 1) 1983 @@ -106844,10 +106875,11 @@ Nothing happens after loading the cassette - + Microchess (Investronica) 1984 Investronica + @@ -107195,6 +107227,18 @@ Nothing happens after loading the cassette + + Mieyen + 2025 + Inufuto + + + + + + + + Mig Busters 1990 @@ -125252,20 +125296,9 @@ Game 4 - Char-Wallah - Rigel's Revenge (Bulldog) - 1987 - Bulldog - - - - - - - - Rigel's Revenge - 19?? - <unknown> + 1987 + Bulldog Software @@ -125278,6 +125311,17 @@ Game 4 - Char-Wallah + + Rigel's Revenge (merged sides) + 1987 + Bulldog Software + + + + + + + Rik The Roadie 1988 @@ -125290,23 +125334,23 @@ Game 4 - Char-Wallah - Ring Quest (set 2) + Ring Quest 19?? - <unknown> + Uburrg Software - - + + - Ring Quest + Ring Quest (set 2) 19?? - <unknown> + Uburrg Software - - + + @@ -125514,23 +125558,23 @@ Game 4 - Char-Wallah - Road Frog (set 2) + Road Frog 1983 Spectrum Games - - + + - Road Frog - 19?? - <unknown> + Road Frog (alt) + 1983 + Spectrum Games - - + + @@ -127307,8 +127351,8 @@ Game 4 - Char-Wallah Run Baby Run (release 1) - 19?? - <unknown> + 1984 + Firebird Software @@ -127338,8 +127382,19 @@ Game 4 - Char-Wallah - - Run For Gold (Alternative) + + Run for Gold + 1985 + Hill MacGibbon + + + + + + + + + Run for Gold (Alternative) 1985 Alternative Software @@ -127349,13 +127404,13 @@ Game 4 - Char-Wallah - - Run For Gold - 19?? - <unknown> + + Run for Gold (System 4) + 1987 + System 4 - - + + @@ -128103,33 +128158,37 @@ Game 4 - Char-Wallah - S.T.U.N. Runner (The Hit Squad) + S.T.U.N. Runner 1990 - The Hit Squad + Domark - - + + + - - + + + - S.T.U.N. Runner - 19?? - <unknown> + S.T.U.N. Runner (The Hit Squad) + 1990 + The Hit Squad - - + + + - - + + + @@ -132392,7 +132451,7 @@ Game 4 - Char-Wallah Slap Fight (The Hit Squad) - 1987 + 1990 The Hit Squad @@ -159601,7 +159660,7 @@ Version without loading screen, maybe a pre-release - The Sports Pack (compilation) + The Sports Pack 1987 Gamestar @@ -162632,10 +162691,10 @@ Tape 1 - Side B - Game 3: Bullseye - + Balrog's Big Four 19?? - <unknown> + Zenobi Software @@ -162648,16 +162707,18 @@ Tape 1 - Side B - Game 3: Bullseye - + Balrog's Box of Delights - 19?? - <unknown> + 1996 + Zenobi Software + + @@ -165800,6 +165861,18 @@ Side B - Game 3: Strike Force Harrier (Mirrorsoft) + Four Smash Hits + 1987 + Hewson Consultants + + + + + + + + + Four Smash Hits (set 2) 1987 Hewson Consultants @@ -165817,18 +165890,6 @@ Side B - Game 3: Strike Force Harrier (Mirrorsoft) - - Four Smash Hits - 1987 - Hewson Consultants - - - - - - - - Fourmost Adventures 1986 @@ -174523,26 +174584,30 @@ Tape 2 - Side A: Spy vs Spy III: Arctic Antics (Databyte) - - Stars On The 128 + + Stars on the 128K 1986 Ocean + + + + diff --git a/makefile b/makefile index 100316a7af1d6..aac3bd90a9127 100644 --- a/makefile +++ b/makefile @@ -1656,7 +1656,7 @@ endif ifeq (posix,$(SHELLTYPE)) $(GENDIR)/version.cpp: makefile $(GENDIR)/git_desc | $(GEN_FOLDERS) - @echo '#define BARE_BUILD_VERSION "0.275"' > $@ + @echo '#define BARE_BUILD_VERSION "0.276"' > $@ @echo '#define BARE_VCS_REVISION "$(NEW_GIT_VERSION)"' >> $@ @echo 'extern const char bare_build_version[];' >> $@ @echo 'extern const char bare_vcs_revision[];' >> $@ @@ -1666,7 +1666,7 @@ $(GENDIR)/version.cpp: makefile $(GENDIR)/git_desc | $(GEN_FOLDERS) @echo 'const char build_version[] = BARE_BUILD_VERSION " (" BARE_VCS_REVISION ")";' >> $@ else $(GENDIR)/version.cpp: makefile $(GENDIR)/git_desc | $(GEN_FOLDERS) - @echo #define BARE_BUILD_VERSION "0.275" > $@ + @echo #define BARE_BUILD_VERSION "0.276" > $@ @echo #define BARE_VCS_REVISION "$(NEW_GIT_VERSION)" >> $@ @echo extern const char bare_build_version[]; >> $@ @echo extern const char bare_vcs_revision[]; >> $@ diff --git a/scripts/build/check_include_guards.py b/scripts/build/check_include_guards.py index f294cc6412fd6..bcc1bd889e91f 100755 --- a/scripts/build/check_include_guards.py +++ b/scripts/build/check_include_guards.py @@ -28,6 +28,10 @@ def pathsplit(p): substpat = re.compile('[-.]') guardpat = re.compile('^ *# *ifndef +([^\s]+)(\s+.*)?') bad = False + if len(sys.argv) < 2: + sys.stderr.write("Error: requires at least one path defined\n") + sys.exit(2) + for root in sys.argv[1:]: for path, subdirs, files in os.walk(root): prefix = 'MAME_' + '_'.join([n.upper() for n in pathsplit(os.path.relpath(path, root))]) + '_' diff --git a/scripts/minimaws/lib/assets/common.js b/scripts/minimaws/lib/assets/common.js index 7439aaa5a2116..3b10b785fddef 100644 --- a/scripts/minimaws/lib/assets/common.js +++ b/scripts/minimaws/lib/assets/common.js @@ -1,5 +1,6 @@ // license:BSD-3-Clause // copyright-holders:Vas Crabb +'use strict'; function make_collapsible(heading, section) { diff --git a/scripts/minimaws/lib/assets/digest.js b/scripts/minimaws/lib/assets/digest.js index 6739d1440d9ba..91285ff529fa2 100644 --- a/scripts/minimaws/lib/assets/digest.js +++ b/scripts/minimaws/lib/assets/digest.js @@ -1,5 +1,6 @@ // license:BSD-3-Clause // copyright-holders:Vas Crabb +'use strict'; function Crc32Digester() { diff --git a/scripts/minimaws/lib/assets/machine.js b/scripts/minimaws/lib/assets/machine.js index b7f600f04d640..b488ae9e9a459 100644 --- a/scripts/minimaws/lib/assets/machine.js +++ b/scripts/minimaws/lib/assets/machine.js @@ -1,5 +1,6 @@ // license:BSD-3-Clause // copyright-holders:Vas Crabb +'use strict'; var slot_info = Object.create(null); var bios_sets = Object.create(null); diff --git a/scripts/minimaws/lib/assets/romident.js b/scripts/minimaws/lib/assets/romident.js index 599b067400716..892894ced569a 100644 --- a/scripts/minimaws/lib/assets/romident.js +++ b/scripts/minimaws/lib/assets/romident.js @@ -1,5 +1,6 @@ // license:BSD-3-Clause // copyright-holders:Vas Crabb +'use strict'; var matched_names = new Array(); var unmatched_names = new Array(); diff --git a/scripts/src/3rdparty.lua b/scripts/src/3rdparty.lua index 11ba937ca0ef2..40f4938bbadb9 100755 --- a/scripts/src/3rdparty.lua +++ b/scripts/src/3rdparty.lua @@ -22,8 +22,10 @@ project "expat" -- fake out the enough of expat_config.h to get by -- could possibly add more defines here for specific targets defines { + "HAVE_CXX11", "HAVE_MEMMOVE", "HAVE_STDINT_H", + "HAVE_STDIO_H", "HAVE_STDLIB_H", "HAVE_STRING_H", "PACKAGE=\"expat\"", @@ -37,6 +39,7 @@ project "expat" "VERSION=\"2.2.10\"", "XML_CONTEXT_BYTES=1024", "XML_DTD", + "XML_GE=1", "XML_NS", } if _OPTIONS["BIGENDIAN"]=="1" then @@ -49,6 +52,11 @@ else "BYTEORDER=1234", } end +if _OPTIONS["targetos"]=="windows" then + defines { + "__USE_MINGW_ANSI_STDIO=0", + } +end if _OPTIONS["targetos"]=="macosx" or _OPTIONS["targetos"]=="freebsd" then defines { "HAVE_ARC4RANDOM", @@ -88,7 +96,7 @@ if _OPTIONS["gcc"]~=nil then else buildoptions_c { - "-Wno-maybe-uninitialized", -- expat in GCC 11.1 + "-Wno-error=maybe-uninitialized", -- expat in GCC 11.1 } end end diff --git a/scripts/src/bus.lua b/scripts/src/bus.lua index 5c4273ea5932b..9c4c6e72f9715 100644 --- a/scripts/src/bus.lua +++ b/scripts/src/bus.lua @@ -3300,6 +3300,8 @@ if (BUSES["CENTRONICS"]~=null) then MAME_DIR .. "src/devices/bus/centronics/dsjoy.h", MAME_DIR .. "src/devices/bus/centronics/epson_ex800.cpp", MAME_DIR .. "src/devices/bus/centronics/epson_ex800.h", + MAME_DIR .. "src/devices/bus/centronics/epson_fx80.cpp", + MAME_DIR .. "src/devices/bus/centronics/epson_fx80.h", MAME_DIR .. "src/devices/bus/centronics/epson_lx800.cpp", MAME_DIR .. "src/devices/bus/centronics/epson_lx800.h", MAME_DIR .. "src/devices/bus/centronics/epson_lx810l.cpp", @@ -3928,16 +3930,18 @@ end if (BUSES["SG1000_EXP"]~=null) then files { - MAME_DIR .. "src/devices/bus/sg1000_exp/sg1000exp.cpp", - MAME_DIR .. "src/devices/bus/sg1000_exp/sg1000exp.h", MAME_DIR .. "src/devices/bus/sg1000_exp/fm_unit.cpp", MAME_DIR .. "src/devices/bus/sg1000_exp/fm_unit.h", + MAME_DIR .. "src/devices/bus/sg1000_exp/kblink.cpp", + MAME_DIR .. "src/devices/bus/sg1000_exp/kblink.h", + MAME_DIR .. "src/devices/bus/sg1000_exp/sg1000exp.cpp", + MAME_DIR .. "src/devices/bus/sg1000_exp/sg1000exp.h", MAME_DIR .. "src/devices/bus/sg1000_exp/sk1100.cpp", MAME_DIR .. "src/devices/bus/sg1000_exp/sk1100.h", MAME_DIR .. "src/devices/bus/sg1000_exp/sk1100prn.cpp", MAME_DIR .. "src/devices/bus/sg1000_exp/sk1100prn.h", - MAME_DIR .. "src/devices/bus/sg1000_exp/kblink.cpp", - MAME_DIR .. "src/devices/bus/sg1000_exp/kblink.h", + MAME_DIR .. "src/devices/bus/sg1000_exp/sp400.cpp", + MAME_DIR .. "src/devices/bus/sg1000_exp/sp400.h", } end @@ -4118,6 +4122,8 @@ if (BUSES["TI99"]~=null) then MAME_DIR .. "src/devices/bus/ti99/internal/genkbd.h", MAME_DIR .. "src/devices/bus/ti99/internal/ioport.cpp", MAME_DIR .. "src/devices/bus/ti99/internal/ioport.h", + MAME_DIR .. "src/devices/bus/ti99/internal/splitter.cpp", + MAME_DIR .. "src/devices/bus/ti99/internal/splitter.h", MAME_DIR .. "src/devices/bus/ti99/colorbus/busmouse.cpp", MAME_DIR .. "src/devices/bus/ti99/colorbus/busmouse.h", MAME_DIR .. "src/devices/bus/ti99/colorbus/colorbus.cpp", @@ -4170,8 +4176,8 @@ if (BUSES["TI99"]~=null) then MAME_DIR .. "src/devices/bus/ti99/peb/scsicard.h", MAME_DIR .. "src/devices/bus/ti99/peb/sidmaster.cpp", MAME_DIR .. "src/devices/bus/ti99/peb/sidmaster.h", - MAME_DIR .. "src/devices/bus/ti99/peb/spchsyn.cpp", - MAME_DIR .. "src/devices/bus/ti99/peb/spchsyn.h", + MAME_DIR .. "src/devices/bus/ti99/peb/speechadapter.cpp", + MAME_DIR .. "src/devices/bus/ti99/peb/speechadapter.h", MAME_DIR .. "src/devices/bus/ti99/peb/ti_32kmem.cpp", MAME_DIR .. "src/devices/bus/ti99/peb/ti_32kmem.h", MAME_DIR .. "src/devices/bus/ti99/peb/ti_fdc.cpp", @@ -4184,6 +4190,10 @@ if (BUSES["TI99"]~=null) then MAME_DIR .. "src/devices/bus/ti99/peb/tn_ide.h", MAME_DIR .. "src/devices/bus/ti99/peb/tn_usbsm.cpp", MAME_DIR .. "src/devices/bus/ti99/peb/tn_usbsm.h", + MAME_DIR .. "src/devices/bus/ti99/sidecar/arcturus.cpp", + MAME_DIR .. "src/devices/bus/ti99/sidecar/arcturus.h", + MAME_DIR .. "src/devices/bus/ti99/sidecar/speechsyn.cpp", + MAME_DIR .. "src/devices/bus/ti99/sidecar/speechsyn.h", } end @@ -5282,6 +5292,8 @@ if (BUSES["CBUS"]~=null) then files { MAME_DIR .. "src/devices/bus/cbus/amd98.cpp", MAME_DIR .. "src/devices/bus/cbus/amd98.h", + MAME_DIR .. "src/devices/bus/cbus/mif201.cpp", + MAME_DIR .. "src/devices/bus/cbus/mif201.h", MAME_DIR .. "src/devices/bus/cbus/mpu_pc98.cpp", MAME_DIR .. "src/devices/bus/cbus/mpu_pc98.h", MAME_DIR .. "src/devices/bus/cbus/pc9801_26.cpp", @@ -5806,13 +5818,13 @@ end --------------------------------------------------- -- ---@src/devices/bus/heathzenith/h89/intr_cntrl.h,BUSES["HEATH_INTR_SOCKET"] = true +--@src/devices/bus/heathzenith/intr_cntrl/intr_cntrl.h,BUSES["HEATH_INTR_SOCKET"] = true --------------------------------------------------- if (BUSES["HEATH_INTR_SOCKET"]~=null) then files { - MAME_DIR .. "src/devices/bus/heathzenith/h89/intr_cntrl.cpp", - MAME_DIR .. "src/devices/bus/heathzenith/h89/intr_cntrl.h", + MAME_DIR .. "src/devices/bus/heathzenith/intr_cntrl/intr_cntrl.cpp", + MAME_DIR .. "src/devices/bus/heathzenith/intr_cntrl/intr_cntrl.h", } end diff --git a/scripts/src/cpu.lua b/scripts/src/cpu.lua index 51d8e1b17b576..e6132846646b4 100644 --- a/scripts/src/cpu.lua +++ b/scripts/src/cpu.lua @@ -3521,6 +3521,16 @@ if opt_tool(CPUS, "SIGMA2") then table.insert(disasm_files , MAME_DIR .. "src/devices/cpu/sigma2/sigma2d.h") end +-------------------------------------------------- +-- Control Data Corporation 160 (disassembler only) +--@src/devices/cpu/cdc160/cdc160.h,CPUS["CDC160"] = true +-------------------------------------------------- + +if opt_tool(CPUS, "CDC160") then + table.insert(disasm_files , MAME_DIR .. "src/devices/cpu/cdc160/cdc160d.cpp") + table.insert(disasm_files , MAME_DIR .. "src/devices/cpu/cdc160/cdc160d.h") +end + -------------------------------------------------- -- Control Data Corporation 1700 (disassembler only) --@src/devices/cpu/cdc1700/cdc1700.h,CPUS["CDC1700"] = true @@ -3732,10 +3742,17 @@ if opt_tool(CPUS, "DSP56000") then end -------------------------------------------------- --- DEC VAX, disassembler only +-- DEC VAX --@src/devices/cpu/vax/vax.h,CPUS["VAX"] = true -------------------------------------------------- +if CPUS["VAX"] then + files { + MAME_DIR .. "src/devices/cpu/vax/vax.cpp", + MAME_DIR .. "src/devices/cpu/vax/vax.h", + } +end + if opt_tool(CPUS, "VAX") then table.insert(disasm_files , MAME_DIR .. "src/devices/cpu/vax/vaxdasm.cpp") table.insert(disasm_files , MAME_DIR .. "src/devices/cpu/vax/vaxdasm.h") diff --git a/scripts/src/sound.lua b/scripts/src/sound.lua index 3746cc64bd6d3..fe2322a5bccb8 100644 --- a/scripts/src/sound.lua +++ b/scripts/src/sound.lua @@ -1123,8 +1123,6 @@ if (SOUNDS["TMS5220"]~=null) then MAME_DIR .. "src/devices/sound/tms5220.cpp", MAME_DIR .. "src/devices/sound/tms5220.h", MAME_DIR .. "src/devices/sound/tms5110r.hxx", - MAME_DIR .. "src/devices/machine/spchrom.cpp", - MAME_DIR .. "src/devices/machine/spchrom.h", } end diff --git a/scripts/src/video.lua b/scripts/src/video.lua index 83ec32216be00..46611be015677 100644 --- a/scripts/src/video.lua +++ b/scripts/src/video.lua @@ -1721,6 +1721,21 @@ if (VIDEOS["ZR36110"]~=null) then } end +-------------------------------------------------- +-- +--@src/devices/video/bt450.h,VIDEOS["BT450"] = true +-------------------------------------------------- + +if (VIDEOS["BT450"]~=null) then + files { + MAME_DIR .. "src/devices/video/bt450.cpp", + MAME_DIR .. "src/devices/video/bt450.h", + } +end + + + + -- cv1k/ep1c12 subtarget hack if _OPTIONS["subtarget"]=="arcade" then files { diff --git a/scripts/target/mame/mame.lua b/scripts/target/mame/mame.lua index 457429507e65f..06df39602a62d 100644 --- a/scripts/target/mame/mame.lua +++ b/scripts/target/mame/mame.lua @@ -52,6 +52,7 @@ function linkProjects_mame_mame(_target, _subtarget) end end end + table.sort(projects) table.insert(projects, "shared") -- must stay at the end links(projects) end @@ -105,6 +106,7 @@ function createProjects_mame_mame(_target, _subtarget) if 0 < #sources then createMAMEProjects(_target, _subtarget, name) + table.sort(sources) files(sources) end end diff --git a/src/devices/bus/amiga/cpuslot/a570.cpp b/src/devices/bus/amiga/cpuslot/a570.cpp index 7689125ee9c3b..4e13400458096 100644 --- a/src/devices/bus/amiga/cpuslot/a570.cpp +++ b/src/devices/bus/amiga/cpuslot/a570.cpp @@ -12,14 +12,17 @@ - ROM label for the A690: "391298-01 V1.0 Copyright ©1991 CBM C480" - The ROM P/N 391298-01 seems to have been used for multiple versions - There are expansion slots for a 2 MB RAM expansion and a SCSI module + - Uses the CR-512-B drive from MKE (Matsushita Kotobuki Electronics) + - An FPGA is used in place of many discrete logic chips of the CDTV TODO: - - DMAC/CD-ROM drive hookup (needs DMAC rev 2) + - Volume control (LC7883M) ***************************************************************************/ #include "emu.h" #include "a570.h" +#include "speaker.h" #define VERBOSE (LOG_GENERAL) @@ -37,7 +40,10 @@ namespace bus::amiga::cpuslot { a570_device::a570_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, AMIGA_CPUSLOT_A570, tag, owner, clock), device_amiga_cpuslot_interface(mconfig, *this), + m_irq(*this, "irq"), m_dmac(*this, "dmac"), + m_tpi(*this, "tpi"), + m_drive(*this, "drive"), m_config(*this, "config") { } @@ -94,12 +100,39 @@ const tiny_rom_entry *a570_device::device_rom_region() const void a570_device::device_add_mconfig(machine_config &config) { + INPUT_MERGER_ANY_HIGH(config, m_irq); + m_irq->output_handler().set([this] (int state) { m_host->int2_w(state); }); + AMIGA_DMAC_REV2(config, m_dmac, 28.37516_MHz_XTAL / 4); // 7M m_dmac->cfgout_cb().set([this] (int state) { m_host->cfgout_w(state); }); - m_dmac->int_cb().set([this] (int state) { m_host->int2_w(state); }); + m_dmac->int_cb().set(m_irq, FUNC(input_merger_any_high_device::in_w<0>)); + m_dmac->csx0_read_cb().set(m_drive, FUNC(cr511b_device::read)); + m_dmac->csx0_write_cb().set(m_drive, FUNC(cr511b_device::write)); + m_dmac->csx0_a4_read_cb().set(m_tpi, FUNC(tpi6525_device::read)); + m_dmac->csx0_a4_write_cb().set(m_tpi, FUNC(tpi6525_device::write)); + m_dmac->xdack_read_cb().set(m_drive, FUNC(cr511b_device::read)); AT28C16(config, "nvram0", 0); AT28C16(config, "nvram1", 0); + + TPI6525(config, m_tpi, 0); + m_tpi->out_irq_cb().set(m_irq, FUNC(input_merger_any_high_device::in_w<1>)); + m_tpi->out_pb_cb().set(FUNC(a570_device::tpi_portb_w)); + + CR511B(config, m_drive, 0); + m_drive->add_route(0, "lspeaker", 1.0); + m_drive->add_route(1, "rspeaker", 1.0); + m_drive->scor_cb().set(m_tpi, FUNC(tpi6525_device::i1_w)).invert(); + m_drive->stch_cb().set(m_tpi, FUNC(tpi6525_device::i2_w)).invert(); + m_drive->sten_cb().set(m_tpi, FUNC(tpi6525_device::i3_w)); + m_drive->sten_cb().append(FUNC(a570_device::sten_w)); + m_drive->drq_cb().set(m_tpi, FUNC(tpi6525_device::i4_w)); + m_drive->drq_cb().append(FUNC(a570_device::drq_w)); + + SPEAKER(config, "lspeaker").front_left(); + SPEAKER(config, "rspeaker").front_right(); + + // TODO: Add stereo input for Amiga sound } @@ -118,6 +151,33 @@ void a570_device::device_start() // register for save states save_pointer(NAME(m_ram), 0x200000/2); + save_item(NAME(m_sten)); +} + +void a570_device::sten_w(int state) +{ + m_sten = bool(state); +} + +void a570_device::drq_w(int state) +{ + if (m_sten) + m_dmac->xdreq_w(state); +} + +void a570_device::tpi_portb_w(uint8_t data) +{ + // 7------- daclch (lc7883m) + // -6------ dacst (lc7883m) + // --5----- dacatt (lc7883m) + // ---4---- weprom + // ----3--- dten (drive) + // -----2-- xaen (drive) + // ------1- enable (drive) + // -------0 cmd (drive) + + m_drive->enable_w(BIT(data, 1)); + m_drive->cmd_w(BIT(data, 0)); } // the dmac handles this diff --git a/src/devices/bus/amiga/cpuslot/a570.h b/src/devices/bus/amiga/cpuslot/a570.h index 09ce1a188449c..63d97b7703f08 100644 --- a/src/devices/bus/amiga/cpuslot/a570.h +++ b/src/devices/bus/amiga/cpuslot/a570.h @@ -14,8 +14,12 @@ #pragma once #include "cpuslot.h" +#include "machine/6525tpi.h" #include "machine/at28c16.h" +#include "machine/cr511b.h" #include "machine/dmac.h" +#include "machine/input_merger.h" + namespace bus::amiga::cpuslot { @@ -38,9 +42,19 @@ class a570_device : public device_t, public device_amiga_cpuslot_interface private: void map(address_map &map) ATTR_COLD; + void sten_w(int state); + void drq_w(int state); + + void tpi_portb_w(uint8_t data); + + required_device m_irq; required_device m_dmac; + required_device m_tpi; + required_device m_drive; required_ioport m_config; + bool m_sten; + std::unique_ptr m_ram; }; diff --git a/src/devices/bus/archimedes/podule/scsi_cumana.cpp b/src/devices/bus/archimedes/podule/scsi_cumana.cpp index 900f7ffa16ab4..226ffe2bdfd8e 100644 --- a/src/devices/bus/archimedes/podule/scsi_cumana.cpp +++ b/src/devices/bus/archimedes/podule/scsi_cumana.cpp @@ -44,7 +44,7 @@ class arc_scsi_cumana_device : virtual void memc_map(address_map &map) override ATTR_COLD; private: - required_device m_ncr5380; + required_device m_dp8490; required_device m_eeprom; required_memory_region m_podule_rom; @@ -56,10 +56,10 @@ void arc_scsi_cumana_device::ioc_map(address_map &map) { map(0x0000, 0x1fff).lr8(NAME([this](offs_t offset) { return m_podule_rom->base()[offset | ((m_rom_page << 11) & 0xf800)]; })).umask32(0x000000ff); map(0x0000, 0x1fff).lw8(NAME([this](u8 data) { m_rom_page = data; })); - //map(0x2000, 0x201f).mirror(0x0100).rw(m_ncr5380, FUNC(ncr5380_device::read), FUNC(ncr5380_device::write)).umask32(0x000000ff); - map(0x2100, 0x211f).m(m_ncr5380, FUNC(ncr5380_device::map)).umask32(0x000000ff); - //map(0x2100, 0x2100).r(m_ncr5380, FUNC(ncr5380_device::dma_r)); - //map(0x2100, 0x2100).w(m_ncr5380, FUNC(ncr5380_device::dma_w)); + //map(0x2000, 0x201f).mirror(0x0100).rw(m_dp8490, FUNC(dp8490_device::read), FUNC(dp8490_device::write)).umask32(0x000000ff); + map(0x2100, 0x211f).m(m_dp8490, FUNC(dp8490_device::map)).umask32(0x000000ff); + //map(0x2100, 0x2100).r(m_dp8490, FUNC(dp8490_device::dma_r)); + //map(0x2100, 0x2100).w(m_dp8490, FUNC(dp8490_device::dma_w)); } void arc_scsi_cumana_device::memc_map(address_map &map) @@ -96,10 +96,10 @@ void arc_scsi_cumana_device::device_add_mconfig(machine_config &config) NSCSI_CONNECTOR(config, "scsi:4", default_scsi_devices, nullptr, false); NSCSI_CONNECTOR(config, "scsi:5", default_scsi_devices, nullptr, false); NSCSI_CONNECTOR(config, "scsi:6", default_scsi_devices, nullptr, false); - NSCSI_CONNECTOR(config, "scsi:7").option_set("ncr5380", NCR5380) // DP8490 + NSCSI_CONNECTOR(config, "scsi:7").option_set("dp8490", DP8490) // DP8490N .machine_config([this](device_t *device) { - downcast(*device).irq_handler().set([this](int state) { set_pirq(state); }); + downcast(*device).irq_handler().set([this](int state) { set_pirq(state); }); }); EEPROM_93C06_16BIT(config, m_eeprom); @@ -117,7 +117,7 @@ void arc_scsi_cumana_device::device_add_mconfig(machine_config &config) arc_scsi_cumana_device::arc_scsi_cumana_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : device_t(mconfig, ARC_SCSI_CUMANA, tag, owner, clock) , device_archimedes_podule_interface(mconfig, *this) - , m_ncr5380(*this, "scsi:7:ncr5380") + , m_dp8490(*this, "scsi:7:dp8490") , m_eeprom(*this, "eeprom") , m_podule_rom(*this, "podule_rom") , m_rom_page(0) diff --git a/src/devices/bus/cbus/mif201.cpp b/src/devices/bus/cbus/mif201.cpp new file mode 100644 index 0000000000000..012928f5db46d --- /dev/null +++ b/src/devices/bus/cbus/mif201.cpp @@ -0,0 +1,70 @@ +// license:BSD-3-Clause +// copyright-holders: Angelo Salese +/************************************************************************************************** + +MIF-201 MIDI interface + +Bundled with Micro Musician VA + +References: +- https://mamedev.emulab.it/kale/fast/files/micromusician_va.jpg + +TODO: +- evasive, needs manual, dip-switch sheet and PCB pictures; + +**************************************************************************************************/ + +#include "emu.h" +#include "mif201.h" + +DEFINE_DEVICE_TYPE(MIF201, mif201_device, "mif201", "Micro Musician VA MIF-201 MIDI Interface") + +mif201_device::mif201_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : device_t(mconfig, MIF201, tag, owner, clock) + , m_bus(*this, DEVICE_SELF_OWNER) + , m_uart(*this, "uart%u", 1U) + , m_pit(*this, "pit") +{ +} + +//void mif201_device::irq_out(int state) +//{ +// m_bus->int_w<2>(state); +//} + + +void mif201_device::device_add_mconfig(machine_config &config) +{ + // TODO: unknown clocks + I8251(config, m_uart[0], 1021800); + + I8251(config, m_uart[1], 1021800); + + PIT8253(config, m_pit, 1021800); +} + +void mif201_device::device_start() +{ + // sheet claims i8251-1 having swapped ports compared to i8251-2 but micromus just uses + // $e2d2 for control, assume typo. + m_bus->install_io(0xe2d0, 0xe2d3, + read8sm_delegate(*this, [this](offs_t offset) { return m_uart[0]->read(offset); }, "uart1_r"), + write8sm_delegate(*this, [this](offs_t offset, u8 data) { m_uart[0]->write(offset, data); }, "uart1_w") + ); + m_bus->install_io(0xe4d0, 0xe4d3, + read8sm_delegate(*this, [this](offs_t offset) { return m_uart[1]->read(offset); }, "uart2_r"), + write8sm_delegate(*this, [this](offs_t offset, u8 data) { m_uart[1]->write(offset, data); }, "uart2_w") + ); + m_bus->install_io(0xe6d0, 0xe6d3, + read8sm_delegate(*this, [this](offs_t offset) { return m_pit->read(offset); }, "pit_low_r"), + write8sm_delegate(*this, [this](offs_t offset, u8 data) { m_pit->write(offset, data); }, "pit_low_w") + ); + m_bus->install_io(0xe7d0, 0xe7d3, + read8sm_delegate(*this, [this](offs_t offset) { return m_pit->read(offset | 2); }, "pit_high_r"), + write8sm_delegate(*this, [this](offs_t offset, u8 data) { m_pit->write(offset | 2, data); }, "pit_high_w") + ); +} + +void mif201_device::device_reset() +{ +} diff --git a/src/devices/bus/cbus/mif201.h b/src/devices/bus/cbus/mif201.h new file mode 100644 index 0000000000000..1ef33e647d266 --- /dev/null +++ b/src/devices/bus/cbus/mif201.h @@ -0,0 +1,46 @@ +// license:BSD-3-Clause +// copyright-holders: Angelo Salese +#ifndef MAME_BUS_CBUS_MIF201_H +#define MAME_BUS_CBUS_MIF201_H + +#pragma once + +#include "bus/cbus/pc9801_cbus.h" +#include "machine/i8251.h" +#include "machine/pit8253.h" + +//************************************************************************** +// TYPE DEFINITIONS +//************************************************************************** + +// ======================> mpu_pc98_device + +class mif201_device : public device_t +{ +public: + // construction/destruction + mif201_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + + static constexpr feature_type unemulated_features() { return feature::SOUND; } + +protected: + // device-level overrides + virtual void device_start() override ATTR_COLD; + virtual void device_reset() override ATTR_COLD; + + // optional information overrides + virtual void device_add_mconfig(machine_config &config) override ATTR_COLD; + +private: + required_device m_bus; + required_device_array m_uart; + required_device m_pit; + +// void map(address_map &map); +}; + + +// device type definition +DECLARE_DEVICE_TYPE(MIF201, mif201_device) + +#endif // MAME_BUS_CBUS_MIF201_H diff --git a/src/devices/bus/cbus/pc9801_cbus.cpp b/src/devices/bus/cbus/pc9801_cbus.cpp index 0471674aa6811..33e1833d7e80b 100644 --- a/src/devices/bus/cbus/pc9801_cbus.cpp +++ b/src/devices/bus/cbus/pc9801_cbus.cpp @@ -2,20 +2,24 @@ // copyright-holders:Angelo Salese /************************************************************************************************** - C-bus slot interface for PC-98xx family - - a.k.a. NEC version of the ISA bus. - C-bus -> Card Bus - - TODO: - - stub interface, checkout what actually belongs here. - Speculation is that C-bus has ROM / RAM slots always in the 0xc0000-0xdffff region, - and some opacity can be added if true. - - move pc9801_cbus_devices declaration from pc9801 driver in here; - - 8-bit I/O smearing should be handled here; - - INT# should be handled here too; - - Best way to inform user when it tries to install incompatible boards? - - Support for PCI bridging on later machines (cfr. pc9801cx3); +C-bus slot interface for PC-98xx family + +a.k.a. NEC version of the ISA bus. +C-bus -> Compatible Bus + +References: +- https://98epjunk.shakunage.net/sw/ext_card/ext_card.html +- https://ja.wikipedia.org/wiki/C%E3%83%90%E3%82%B9 +- https://www.pc-9800.net/db2/db2_ga_index.htm +- http://ookumaneko.s1005.xrea.com/pcibios.htm (PCI era mapping) + +TODO: +- stub interface, checkout what actually belongs here +- move pc9801_cbus_devices declaration from pc9801 driver in here; +- 8-bit I/O smearing should be handled here; +- INT# should be handled here too; +- Best way to inform user when it tries to install incompatible boards? +- Support for PCI bridging on later machines (cfr. pc9821cx3); **************************************************************************************************/ diff --git a/src/devices/bus/centronics/ctronics.cpp b/src/devices/bus/centronics/ctronics.cpp index 953ff945728c4..3556cb0d756ff 100644 --- a/src/devices/bus/centronics/ctronics.cpp +++ b/src/devices/bus/centronics/ctronics.cpp @@ -120,6 +120,7 @@ device_centronics_peripheral_interface::~device_centronics_peripheral_interface( #include "adaptator.h" #include "comxpl80.h" #include "epson_ex800.h" +#include "epson_fx80.h" #include "epson_lx800.h" #include "epson_lx810l.h" #include "epson_rx80.h" @@ -137,6 +138,8 @@ void centronics_devices(device_slot_interface &device) device.option_add("adaptator", ADAPTATOR_MULTITAP); device.option_add("pl80", COMX_PL80); device.option_add("ex800", EPSON_EX800); + device.option_add("fx80", EPSON_FX80); + device.option_add("jx80", EPSON_JX80); device.option_add("lx800", EPSON_LX800); device.option_add("lx810l", EPSON_LX810L); device.option_add("ap2000", EPSON_AP2000); diff --git a/src/devices/bus/centronics/epson_fx80.cpp b/src/devices/bus/centronics/epson_fx80.cpp new file mode 100644 index 0000000000000..7d64c2eb0c48a --- /dev/null +++ b/src/devices/bus/centronics/epson_fx80.cpp @@ -0,0 +1,320 @@ +// license:BSD-3-Clause +// copyright-holders:Golden Child +/*************************************************************************** + + Epson FX-80 Dot Matrix Printer (skeleton) + + Main CPU is a UPD7810H6 running at 10 MHz. + Slave CPU is an 8042AH running at 11 Mhz. + + Epson JX-80 Dot Matrix Printer (skeleton) + + based on same hardware, adds an expansion board VX0B + that provides ram expansion and ribbon motor control + +*****************************************************************************/ + +#include "emu.h" +#include "epson_fx80.h" + +#include "cpu/mcs48/mcs48.h" +#include "cpu/upd7810/upd7810.h" + + +namespace { + +//************************************************************************** +// TYPE DEFINITIONS +//************************************************************************** + +class epson_fx80_device : public device_t, public device_centronics_peripheral_interface +{ +public: + static constexpr feature_type unemulated_features() { return feature::PRINTER; } + + // construction/destruction + epson_fx80_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + + /* Centronics stuff */ + virtual void input_init(int state) override; + virtual void input_strobe(int state) override; + virtual void input_data0(int state) override { if (state) m_centronics_data |= 0x01; else m_centronics_data &= ~0x01; } + virtual void input_data1(int state) override { if (state) m_centronics_data |= 0x02; else m_centronics_data &= ~0x02; } + virtual void input_data2(int state) override { if (state) m_centronics_data |= 0x04; else m_centronics_data &= ~0x04; } + virtual void input_data3(int state) override { if (state) m_centronics_data |= 0x08; else m_centronics_data &= ~0x08; } + virtual void input_data4(int state) override { if (state) m_centronics_data |= 0x10; else m_centronics_data &= ~0x10; } + virtual void input_data5(int state) override { if (state) m_centronics_data |= 0x20; else m_centronics_data &= ~0x20; } + virtual void input_data6(int state) override { if (state) m_centronics_data |= 0x40; else m_centronics_data &= ~0x40; } + virtual void input_data7(int state) override { if (state) m_centronics_data |= 0x80; else m_centronics_data &= ~0x80; } + +protected: + epson_fx80_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); + + virtual void device_start() override ATTR_COLD; + virtual void device_reset() override ATTR_COLD; + + virtual const tiny_rom_entry *device_rom_region() const override ATTR_COLD; + virtual void device_add_mconfig(machine_config &config) override ATTR_COLD; + virtual ioport_constructor device_input_ports() const override ATTR_COLD; + + virtual bool supports_pin35_5v() override { return true; } + + void epson_fx80_mem(address_map &map) ATTR_COLD; + + uint8_t slave_r(offs_t offset); + void slave_w(offs_t offset, uint8_t data); + uint8_t slave_p1_r(); + void slave_p2_w(uint8_t data); + uint8_t centronics_data_r(offs_t offset); + + TIMER_CALLBACK_MEMBER(slave_write_sync); + + uint8_t pts_sensor() { return 0; } + uint8_t home_sensor() { return 0; } + + required_device m_maincpu; + required_device m_slavecpu; + + uint8_t m_centronics_data; +}; + + +class epson_jx80_device : public epson_fx80_device +{ +public: + // construction/destruction + epson_jx80_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + +protected: + virtual void device_add_mconfig(machine_config &config) override ATTR_COLD; + virtual const tiny_rom_entry *device_rom_region() const override ATTR_COLD; + + void epson_jx80_mem(address_map &map) ATTR_COLD; + uint8_t vxob_r(offs_t offset); + void vxob_w(offs_t offset, uint8_t data); +}; + + + +//------------------------------------------------- +// ROM( epson_fx80 ) +//------------------------------------------------- + +ROM_START( epson_fx80 ) + ROM_REGION(0x4000, "maincpu", 0) // 16K rom for upd7810 FX-80 + // this is from an fx80+ (found with a M20214GA which according to the tech manual goes with an fx80+) + ROM_LOAD("epson_8426k9_m1206ba029_read_as_27c128.bin", 0x0000, 0x4000, CRC(ff5c2b1e) SHA1(e1e38c3e4864e60f701939e23331360b76603a24)) + + ROM_REGION(0x800, "slavecpu", 0) // 2K rom for 8042 + ROM_LOAD("epson_fx_c42040kb_8042ah.bin", 0x0000, 0x800, CRC(3e9d08c1) SHA1(d5074f60497cc75d40996e6cef63231d3a3697f1)) +ROM_END + +ROM_START( epson_jx80 ) + ROM_REGION(0x4000, "maincpu", 0) // JX-80 rom + ROM_LOAD("jx80_a4_fs5_27128.bin", 0x0000, 0x4000, CRC(2925a47b) SHA1(1864d3561491d7dca78ac2cd13a023460f551184)) + + ROM_REGION(0x800, "slavecpu", 0) // 2K rom for 8042 + ROM_LOAD("epson_fx_c42040kb_8042ah.bin", 0x0000, 0x800, CRC(3e9d08c1) SHA1(d5074f60497cc75d40996e6cef63231d3a3697f1)) +ROM_END + + +//------------------------------------------------- +// rom_region - device-specific ROM region +//------------------------------------------------- + +const tiny_rom_entry *epson_fx80_device::device_rom_region() const +{ + return ROM_NAME(epson_fx80); +} + +const tiny_rom_entry *epson_jx80_device::device_rom_region() const +{ + return ROM_NAME(epson_jx80); +} + +//------------------------------------------------- +// ADDRESS_MAP( epson_fx80_mem ) +//------------------------------------------------- + +void epson_fx80_device::epson_fx80_mem(address_map &map) +{ + map(0x0000, 0x3fff).rom().region("maincpu", 0); + map(0x8000, 0x97ff).ram(); // external RAM 4K + 2K = 0x1800 + map(0xd000, 0xd001).mirror(0x08fe).rw(FUNC(epson_fx80_device::slave_r), FUNC(epson_fx80_device::slave_w)); + map(0xd800, 0xd800).r(FUNC(epson_fx80_device::centronics_data_r)); +} + +void epson_jx80_device::epson_jx80_mem(address_map &map) +{ + map(0x0000, 0x3fff).rom().region("maincpu", 0); + map(0x6000, 0x7fff).ram(); // external RAM VXOB board + map(0x8000, 0x97ff).ram(); // external RAM 4K + 2K = 0x1800 + map(0xc800, 0xc801).rw(FUNC(epson_jx80_device::vxob_r), FUNC(epson_jx80_device::vxob_w)); + map(0xd000, 0xd001).mirror(0x08fe).rw(FUNC(epson_jx80_device::slave_r), FUNC(epson_jx80_device::slave_w)); + map(0xd800, 0xd800).r(FUNC(epson_jx80_device::centronics_data_r)); +} + + +//------------------------------------------------- +// device_add_mconfig - add device configuration +//------------------------------------------------- + +void epson_fx80_device::device_add_mconfig(machine_config &config) +{ + /* basic machine hardware */ + upd7810_device &upd(UPD7810(config, m_maincpu, 10000000)); // 10 Mhz + upd.set_addrmap(AS_PROGRAM, &epson_fx80_device::epson_fx80_mem); + + /* upi41 i8042 slave cpu */ + i8042ah_device &sla(I8042AH(config, m_slavecpu, 11000000)); // 11 Mhz + sla.p1_in_cb().set(FUNC(epson_fx80_device::slave_p1_r)); + sla.p2_out_cb().set(FUNC(epson_fx80_device::slave_p2_w)); + sla.t0_in_cb().set(FUNC(epson_fx80_device::home_sensor)); + sla.t1_in_cb().set(FUNC(epson_fx80_device::pts_sensor)); +} + +void epson_jx80_device::device_add_mconfig(machine_config &config) +{ + epson_fx80_device::device_add_mconfig(config); + m_maincpu->set_addrmap(AS_PROGRAM, &epson_jx80_device::epson_jx80_mem); +} + + +//------------------------------------------------- +// INPUT_PORTS( epson_fx80 ) +//------------------------------------------------- + +INPUT_PORTS_START( epson_fx80 ) +INPUT_PORTS_END + +//------------------------------------------------- +// input_ports - device-specific input ports +//------------------------------------------------- + +ioport_constructor epson_fx80_device::device_input_ports() const +{ + return INPUT_PORTS_NAME(epson_fx80); +} + +//------------------------------------------------- +// epson_fx80_device - constructor +//------------------------------------------------- + +// constructor that passes device type +epson_fx80_device::epson_fx80_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : + epson_fx80_device(mconfig, EPSON_FX80, tag, owner, clock) +{ +} + +// constructor to pass through the device type to device_t +epson_fx80_device::epson_fx80_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) : + device_t(mconfig, type, tag, owner, clock), + device_centronics_peripheral_interface(mconfig, *this), + m_maincpu(*this, "maincpu"), + m_slavecpu(*this, "slavecpu") +{ +} + +// constructor that pass device type +epson_jx80_device::epson_jx80_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : + epson_fx80_device(mconfig, EPSON_JX80, tag, owner, clock) +{ +} + + +//------------------------------------------------- +// device_start - device-specific startup +//------------------------------------------------- + +void epson_fx80_device::device_start() +{ + save_item(NAME(m_centronics_data)); +} + +//------------------------------------------------- +// device_reset - device-specific reset +//------------------------------------------------- + +void epson_fx80_device::device_reset() +{ +} + +//------------------------------------------------- +// Slave CPU functions +//------------------------------------------------- + +uint8_t epson_fx80_device::slave_r(offs_t offset) +{ + return m_slavecpu->upi41_master_r(offset); +} + +void epson_fx80_device::slave_w(offs_t offset, uint8_t data) +{ + // pass offset and data packed into param + machine().scheduler().synchronize( + timer_expired_delegate(FUNC(epson_fx80_device::slave_write_sync), this), + (offset << 8) | data); +} + +TIMER_CALLBACK_MEMBER(epson_fx80_device::slave_write_sync) +{ + m_slavecpu->upi41_master_w(u32(param) >> 8, u32(param) & 0xff); +} + +uint8_t epson_fx80_device::slave_p1_r() +{ + // read DIPSW1 + return 0; +} + +void epson_fx80_device::slave_p2_w(uint8_t data) +{ + // p20 - p21 are cr_stepper + // p22, p24 stepper power + // p25 not err + // p26 online lamp + // p27 buzzer +} + + +//------------------------------------------------- +// VX0B expansion board (for JX-80) +//------------------------------------------------- + +uint8_t epson_jx80_device::vxob_r(offs_t offset) +{ + // read color ribbon home position status, MSB is high if in home position zone + return 0; // not hooked up +} + +void epson_jx80_device::vxob_w(offs_t offset, uint8_t data) +{ + // bit 6 and 7 control the color ribbon stepper motor +} + +//------------------------------------------------- +// Centronics data read +//------------------------------------------------- + +uint8_t epson_fx80_device::centronics_data_r(offs_t offset) +{ + return 0; +} + +//------------------------------------------------- +// Centronics device +//------------------------------------------------- + +void epson_fx80_device::input_strobe(int state) +{ +} + +void epson_fx80_device::input_init(int state) +{ +} + +} // anonymous namespace + +// GLOBAL +DEFINE_DEVICE_TYPE_PRIVATE(EPSON_FX80, device_centronics_peripheral_interface, epson_fx80_device, "epson_fx80", "Epson FX-80") +DEFINE_DEVICE_TYPE_PRIVATE(EPSON_JX80, device_centronics_peripheral_interface, epson_jx80_device, "epson_jx80", "Epson JX-80") diff --git a/src/devices/bus/centronics/epson_fx80.h b/src/devices/bus/centronics/epson_fx80.h new file mode 100644 index 0000000000000..0db6a1b62f170 --- /dev/null +++ b/src/devices/bus/centronics/epson_fx80.h @@ -0,0 +1,20 @@ +// license:BSD-3-Clause +// copyright-holders:Golden Child +/********************************************************************** + + Epson FX-80 dot matrix printer emulation (skeleton) + +**********************************************************************/ + +#ifndef MAME_BUS_CENTRONICS_EPSON_FX80_H +#define MAME_BUS_CENTRONICS_EPSON_FX80_H + +#pragma once + +#include "ctronics.h" + +// device type declaration +DECLARE_DEVICE_TYPE(EPSON_FX80, device_centronics_peripheral_interface) +DECLARE_DEVICE_TYPE(EPSON_JX80, device_centronics_peripheral_interface) + +#endif // MAME_BUS_CENTRONICS_EPSON_FX80_H diff --git a/src/devices/bus/electron/m2105.cpp b/src/devices/bus/electron/m2105.cpp index 25f9e60a73f16..d2aa5da9f55db 100644 --- a/src/devices/bus/electron/m2105.cpp +++ b/src/devices/bus/electron/m2105.cpp @@ -114,16 +114,20 @@ void electron_m2105_device::device_add_mconfig(machine_config &config) output_latch_device &latch(OUTPUT_LATCH(config, "cent_data_out")); centronics.set_output_latch(latch); - SPEECHROM(config, "vsm", 0).set_reverse_bit_order(true); - tms5220_device &tms(TMS5220(config, "vsp", 640000)); - tms.set_speechrom_tag("vsm"); tms.ready_cb().set(m_via[0], FUNC(via6522_device::write_ca1)); tms.ready_cb().append(m_via[0], FUNC(via6522_device::write_pb2)); tms.irq_cb().set(m_via[0], FUNC(via6522_device::write_ca2)); tms.irq_cb().append(m_via[0], FUNC(via6522_device::write_pb3)); tms.add_route(ALL_OUTPUTS, "mono", 0.5); + TMS6100(config, "vsm", 0); + tms.m0_cb().set("vsm", FUNC(tms6100_device::m0_w)); + tms.m1_cb().set("vsm", FUNC(tms6100_device::m1_w)); + tms.addr_cb().set("vsm", FUNC(tms6100_device::add_w)); + tms.data_cb().set("vsm", FUNC(tms6100_device::data_line_r)); + tms.romclk_cb().set("vsm", FUNC(tms6100_device::clk_w)); + SPEAKER(config, "mono").front_center(); } diff --git a/src/devices/bus/heathzenith/h89/mms77316_fdc.h b/src/devices/bus/heathzenith/h89/mms77316_fdc.h index 04838c0fff617..52d75b357a79b 100644 --- a/src/devices/bus/heathzenith/h89/mms77316_fdc.h +++ b/src/devices/bus/heathzenith/h89/mms77316_fdc.h @@ -16,7 +16,7 @@ #include "imagedev/floppy.h" #include "machine/wd_fdc.h" -#include "bus/heathzenith/h89/intr_cntrl.h" +#include "bus/heathzenith/intr_cntrl/intr_cntrl.h" class mms77316_fdc_device : public device_t, public device_h89bus_right_card_interface { diff --git a/src/devices/bus/heathzenith/h89/z37_fdc.h b/src/devices/bus/heathzenith/h89/z37_fdc.h index ad2e52027be32..0c8b4d0298353 100644 --- a/src/devices/bus/heathzenith/h89/z37_fdc.h +++ b/src/devices/bus/heathzenith/h89/z37_fdc.h @@ -13,7 +13,7 @@ #include "h89bus.h" -#include "bus/heathzenith/h89/intr_cntrl.h" +#include "bus/heathzenith/intr_cntrl/intr_cntrl.h" class h89bus_z37_device : public device_t, public device_h89bus_right_card_interface { diff --git a/src/devices/bus/heathzenith/h89/intr_cntrl.cpp b/src/devices/bus/heathzenith/intr_cntrl/intr_cntrl.cpp similarity index 100% rename from src/devices/bus/heathzenith/h89/intr_cntrl.cpp rename to src/devices/bus/heathzenith/intr_cntrl/intr_cntrl.cpp diff --git a/src/devices/bus/heathzenith/h89/intr_cntrl.h b/src/devices/bus/heathzenith/intr_cntrl/intr_cntrl.h similarity index 96% rename from src/devices/bus/heathzenith/h89/intr_cntrl.h rename to src/devices/bus/heathzenith/intr_cntrl/intr_cntrl.h index b4f9b76f84014..0eee01945a360 100644 --- a/src/devices/bus/heathzenith/h89/intr_cntrl.h +++ b/src/devices/bus/heathzenith/intr_cntrl/intr_cntrl.h @@ -8,8 +8,8 @@ ****************************************************************************/ -#ifndef MAME_BUS_HEATHZENITH_H89_INTR_CNTRL_H -#define MAME_BUS_HEATHZENITH_H89_INTR_CNTRL_H +#ifndef MAME_BUS_HEATHZENITH_INTR_CNTRL_INTR_CNTRL_H +#define MAME_BUS_HEATHZENITH_INTR_CNTRL_INTR_CNTRL_H #pragma once @@ -165,4 +165,4 @@ class heath_intr_socket : public device_t, DECLARE_DEVICE_TYPE(HEATH_INTR_SOCKET, heath_intr_socket) -#endif // MAME_BUS_HEATHZENITH_H89_INTR_CNTRL_H +#endif // MAME_BUS_HEATHZENITH_INTR_CNTRL_INTR_CNTRL_H diff --git a/src/devices/bus/mpf1/ssb.cpp b/src/devices/bus/mpf1/ssb.cpp index 1c6a00dd3d711..ef3188e6f6428 100644 --- a/src/devices/bus/mpf1/ssb.cpp +++ b/src/devices/bus/mpf1/ssb.cpp @@ -14,7 +14,6 @@ #include "emu.h" #include "ssb.h" -#include "machine/spchrom.h" #include "sound/tms5220.h" #include "bus/generic/carts.h" #include "bus/generic/slot.h" diff --git a/src/devices/bus/nes/disksys.cpp b/src/devices/bus/nes/disksys.cpp index 582f63a3b21b5..9512ef036e8e5 100644 --- a/src/devices/bus/nes/disksys.cpp +++ b/src/devices/bus/nes/disksys.cpp @@ -9,7 +9,7 @@ Here we emulate the RAM expansion + Disk Drive which form the Famicom Disk System. - Based on info from NESDev wiki ( http://wiki.nesdev.com/w/index.php/Family_Computer_Disk_System ) + Based on info from NESDev wiki ( https://www.nesdev.org/wiki/Family_Computer_Disk_System ) TODO: - convert floppy drive + fds format to modern code! @@ -107,7 +107,8 @@ nes_disksys_device::nes_disksys_device(const machine_config &mconfig, const char , m_disk(*this, "floppy0") , m_sound(*this, "rp2c33snd") , irq_timer(nullptr) - , m_irq_count(0), m_irq_count_latch(0), m_irq_enable(0), m_irq_repeat(0), m_irq_transfer(0), m_disk_reg_enable(0), m_fds_motor_on(0), m_fds_door_closed(0), m_fds_current_side(0), m_fds_head_position(0), m_fds_status0(0), m_read_mode(0), m_drive_ready(0) + , m_irq_count(0), m_irq_count_latch(0), m_irq_enable(false), m_irq_repeat(false), m_irq_transfer(false), m_disk_reg_enable(false), m_sound_en(false) + , m_fds_motor_on(0), m_fds_door_closed(0), m_fds_current_side(0), m_fds_head_position(0), m_fds_status0(0), m_read_mode(0), m_drive_ready(0) , m_fds_sides(0), m_fds_last_side(0), m_fds_count(0) { } @@ -136,6 +137,7 @@ void nes_disksys_device::device_start() save_item(NAME(m_irq_count)); save_item(NAME(m_irq_count_latch)); save_item(NAME(m_disk_reg_enable)); + save_item(NAME(m_sound_en)); save_item(NAME(m_fds_last_side)); save_item(NAME(m_fds_count)); @@ -157,10 +159,11 @@ void nes_disksys_device::pcb_reset() m_drive_ready = 0; m_irq_count = 0; m_irq_count_latch = 0; - m_irq_enable = 0; - m_irq_repeat = 0; - m_irq_transfer = 0; - m_disk_reg_enable = 0; + m_irq_enable = false; + m_irq_repeat = false; + m_irq_transfer = false; + m_disk_reg_enable = false; + m_sound_en = false; m_fds_count = 0; m_fds_last_side = 0; @@ -291,7 +294,11 @@ void nes_disksys_device::write_ex(offs_t offset, uint8_t data) m_fds_head_position -= 2; // ??? is this some sort of compensation?? m_read_mode = BIT(data, 2); - set_nt_mirroring(BIT(data, 3) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT); + if (BIT(data, 3)) + m_fds_status0 |= 0x08; + else + m_fds_status0 &= ~0x08; + set_nt_mirroring(BIT(m_fds_status0, 3) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT); m_drive_ready = data & 0x40; m_irq_transfer = BIT(data, 7); break; @@ -334,6 +341,7 @@ uint8_t nes_disksys_device::read_ex(offs_t offset) // bit1 - Byte transfer flag (Set to 1 every time 8 bits have been transferred between // the RAM adaptor & disk drive through $4024/$4031; Reset to 0 when $4024, // $4031, or $4030 has been serviced) + // bit3 = Nametable mirroring flag (0: Vertical, 1: Horizontal) // bit4 - CRC control (0: CRC passed; 1: CRC error) // bit6 - End of Head (1 when disk head is on the most inner track) // bit7 - Disk Data Read/Write Enable (1 when disk is readable/writable) diff --git a/src/devices/bus/nes/disksys.h b/src/devices/bus/nes/disksys.h index 248b3b1d88f02..e8e06f8f326d8 100644 --- a/src/devices/bus/nes/disksys.h +++ b/src/devices/bus/nes/disksys.h @@ -55,8 +55,8 @@ class nes_disksys_device : public nes_nrom_device void unload_disk(device_image_interface &image); uint16_t m_irq_count, m_irq_count_latch; - int m_irq_enable, m_irq_repeat, m_irq_transfer; - int m_disk_reg_enable; + bool m_irq_enable, m_irq_repeat, m_irq_transfer; + bool m_disk_reg_enable; bool m_sound_en; uint8_t m_fds_motor_on; @@ -68,8 +68,8 @@ class nes_disksys_device : public nes_nrom_device uint8_t m_drive_ready; uint8_t m_fds_sides; - int m_fds_last_side; - int m_fds_count; + int32_t m_fds_last_side; + int32_t m_fds_count; }; diff --git a/src/devices/bus/pci/aha2940au.cpp b/src/devices/bus/pci/aha2940au.cpp index 5fd4f4668c811..2eb465d21b438 100644 --- a/src/devices/bus/pci/aha2940au.cpp +++ b/src/devices/bus/pci/aha2940au.cpp @@ -6,9 +6,12 @@ Adaptec AHA-2940AU PCI Based off AIC-7860/7861 +References: +- https://github.com/torvalds/linux/tree/master/drivers/scsi/aic7xxx + TODO: -- Plays with southbridge SMI & APMCAPMS regs soon after entering in its own BIOS (PC=ccfe1), - going off the track blanking the almost entirety of I/O space range. +- Stub, enough to make it surpass initial POST and nothing else; +- Lack specific documentation for AIC-7860, we base on AIC-7890 for now; **************************************************************************************************/ @@ -30,10 +33,12 @@ DEFINE_DEVICE_TYPE(AHA2940AU, aha2940au_scsi_device, "aha2940au", "Adaptec A aha2940au_scsi_device::aha2940au_scsi_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) : pci_card_device(mconfig, type, tag, owner, clock) + , m_eeprom(*this, "eeprom") , m_scsi_rom(*this, "scsi_rom") { - // TODO: unknown revision & class code - set_ids(0x90046178, 0x00, 0x010700, 0x90046178); + // TODO: unknown revision + // class code should be 0x01'0000 as per AIC-7890 manual + set_ids(0x90046178, 0x00, 0x010000, 0x90046178); } aha2940au_scsi_device::aha2940au_scsi_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) @@ -49,7 +54,7 @@ ROM_START( aha2940au ) ROMX_LOAD( "589247-00.u3", 0x0000, 0x8000, CRC(de00492b) SHA1(a6015bcd51e51015a5710d7ac1929e28bf033db4), ROM_BIOS(0) ) // default eeprom contents, to be verified - ROM_REGION( 0x80, "eeprom", ROMREGION_ERASEFF ) + ROM_REGION16_LE( 0x80, "eeprom", ROMREGION_ERASEFF ) ROM_LOAD( "93c46.u1", 0x00, 0x80, CRC(c82242ce) SHA1(93311b8c02e87492a40c1df6ea4eb60628bb2825) ) ROM_END @@ -61,36 +66,84 @@ const tiny_rom_entry *aha2940au_scsi_device::device_rom_region() const void aha2940au_scsi_device::device_add_mconfig(machine_config &config) { // AIC-7860Q - // 93C46 EEPROM + + EEPROM_93C46_16BIT(config, m_eeprom); } void aha2940au_scsi_device::device_start() { pci_card_device::device_start(); - // TODO: unknown BAR setup -// add_map( size, M_MEM, FUNC(aha2940au_scsi_device::map)); + // TODO: BAR setup from AIC-7890, verify + add_map( 256, M_IO, FUNC(aha2940au_scsi_device::io_map)); + // TODO: enables M_64A on demand + add_map( 4096, M_MEM, FUNC(aha2940au_scsi_device::mem_map)); add_rom((u8 *)m_scsi_rom->base(), 0x8000); expansion_rom_base = 0xc8000; - // TODO: unknown irq pin -// intr_pin = 1; + // TODO: BIST capable + + // INTA# + intr_pin = 1; + // TODO: definitely uses PCI regs 0x3e/0x3f + // max_lat = 0x19, min_gnt = 0x27 for AIC-7890 + // others may be different } void aha2940au_scsi_device::device_reset() { pci_card_device::device_reset(); - // TODO: unknown startup state command = 0x0000; - status = 0x0200; + // Can be bus master (bit 2), can use Memory Write and Invalidate (bit 4) + command_mask = 0x17; + // cap list (bit 4), fast back-to-back (bit 7), medium DEVSEL# + status = 0x0290; remap_cb(); } +u8 aha2940au_scsi_device::capptr_r() +{ + return 0xdc; +} + void aha2940au_scsi_device::config_map(address_map &map) { pci_card_device::config_map(map); - // ... +// map(0x40, 0x40) DEVCONFIG +// map(0x41, 0x41) DEVSTATUS0 +// map(0x42, 0x42) DEVSTATUS1 +// map(0x43, 0x43) PCIERRGEN + + // PME 1.0 + map(0xdc, 0xdf).lr32(NAME([] { return 0x0001'0001; })); +// map(0xe0, 0xe1) PM_CSR +// map(0xe2, 0xe2) PMCSR_BSE +// map(0xe3, 0xe3) PM_DATA +// map(0xff, 0xff) IDENREG } + +void aha2940au_scsi_device::io_map(address_map &map) +{ + // SEECTL + map(0x1e, 0x1e).lrw8( + NAME([this] (offs_t offset) { + return 0x10 | m_eeprom->do_read(); + }), + NAME([this] (offs_t offset, u8 data) { + LOG("SEECTL %02x\n", data); + m_eeprom->di_write(BIT(data, 1)); + m_eeprom->clk_write(BIT(data, 2)); + m_eeprom->cs_write(BIT(data, 3)); + }) + ); + // HCNTRL + map(0x87, 0x87).lr8(NAME([] () { return 0xff; })); +} + +void aha2940au_scsi_device::mem_map(address_map &map) +{ +} + diff --git a/src/devices/bus/pci/aha2940au.h b/src/devices/bus/pci/aha2940au.h index 5fb0208365c8d..c7964e672b776 100644 --- a/src/devices/bus/pci/aha2940au.h +++ b/src/devices/bus/pci/aha2940au.h @@ -8,6 +8,8 @@ #include "pci_slot.h" +#include "machine/eepromser.h" + class aha2940au_scsi_device : public pci_card_device { public: @@ -29,10 +31,15 @@ class aha2940au_scsi_device : public pci_card_device virtual void config_map(address_map &map) override ATTR_COLD; - required_memory_region m_scsi_rom; + virtual u8 capptr_r() override; + + required_device m_eeprom; private: - // ... + void io_map(address_map &map); + void mem_map(address_map &map); + + required_memory_region m_scsi_rom; }; DECLARE_DEVICE_TYPE(AHA2940AU, aha2940au_scsi_device) diff --git a/src/devices/bus/pci/pci_slot.cpp b/src/devices/bus/pci/pci_slot.cpp index 238e61be49c9c..ae9d42afc63e0 100644 --- a/src/devices/bus/pci/pci_slot.cpp +++ b/src/devices/bus/pci/pci_slot.cpp @@ -128,6 +128,7 @@ void pci_cards(device_slot_interface &device) device.option_add("vision968", VISION968_PCI); device.option_add("virge", VIRGE_PCI); device.option_add("virgedx", VIRGEDX_PCI); + device.option_add("virgevx", VIRGEVX_PCI); device.option_add("mga2064w", MGA2064W); device.option_add("promotion3210", PROMOTION3210); device.option_add("gd5446", GD5446_PCI); diff --git a/src/devices/bus/pci/virge_pci.cpp b/src/devices/bus/pci/virge_pci.cpp index 26fde9cb6c979..2e746a25ac435 100644 --- a/src/devices/bus/pci/virge_pci.cpp +++ b/src/devices/bus/pci/virge_pci.cpp @@ -7,6 +7,11 @@ #include "screen.h" +DEFINE_DEVICE_TYPE(VIRGE_PCI, virge_pci_device, "virge_pci", "S3 86C325 ViRGE") +DEFINE_DEVICE_TYPE(VIRGEVX_PCI, virgevx_pci_device, "virgevx_pci", "S3 86C988 ViRGE/VX") +DEFINE_DEVICE_TYPE(VIRGEDX_PCI, virgedx_pci_device, "virgedx_pci", "S3 86C375 ViRGE/DX") +//VIRGEGX_PCI, /DX with SGRAM/SDRAM support + virge_pci_device::virge_pci_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : virge_pci_device(mconfig, VIRGE_PCI, tag, owner, clock) { @@ -20,6 +25,11 @@ virge_pci_device::virge_pci_device(const machine_config &mconfig, device_type ty { } +virgevx_pci_device::virgevx_pci_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : virge_pci_device(mconfig, VIRGEVX_PCI, tag, owner, clock) +{ +} + virgedx_pci_device::virgedx_pci_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : virge_pci_device(mconfig, VIRGEDX_PCI, tag, owner, clock) { @@ -54,7 +64,7 @@ void virge_pci_device::mmio_map(address_map& map) //map(0xff00, 0xff5f) LPB Local Peripheral Bus control //map(0xff1c, 0xff1f) LPB GIP/GOP General Input/Output Port (for OEM implementations) - //map(0xff20, 0xff23) Serial Port Register (DDC/I2C, pins 205-206, aliased at I/O ports $e2 or $e8) + map(0xff20, 0xff23).rw(m_vga, FUNC(s3virge_vga_device::serial_port_r), FUNC(s3virge_vga_device::serial_port_w)); //map(0xff24, 0xff27) LPB Video Input Window Size //map(0xff28, 0xff2b) LPB Video Data Offsets //map(0xff2c, 0xff2f) LPB Horizontal Decimation Control Register @@ -173,6 +183,27 @@ void virge_pci_device::device_start() machine().save().register_postload(save_prepost_delegate(FUNC(virge_pci_device::postload), this)); } +void virgevx_pci_device::device_start() +{ + set_ids(0x5333883d, 0x00, 0x030000, 0x000000); + pci_card_device::device_start(); + + add_rom(m_bios->base(),0x8000); + expansion_rom_base = 0xc0000; + + add_map(64 * 1024 * 1024, M_MEM | M_DISABLED, FUNC(virgevx_pci_device::lfb_map)); + set_map_address(0, 0x70000000); + + command = 0x0000; + // DAC SNP / BME / MEM / I/O + command_mask = 0x27; + // medium DEVSELB + status = 0x0200; + + remap_cb(); + machine().save().register_postload(save_prepost_delegate(FUNC(virgevx_pci_device::postload), this)); +} + void virgedx_pci_device::device_start() { set_ids(0x53338a01, 0x00, 0x030000, 0x000000); @@ -184,6 +215,12 @@ void virgedx_pci_device::device_start() add_map(64 * 1024 * 1024, M_MEM | M_DISABLED, FUNC(virge_pci_device::lfb_map)); set_map_address(0, 0x70000000); + command = 0x0000; + // DAC SNP / BME / MEM / I/O + command_mask = 0x27; + // medium DEVSELB + status = 0x0200; + remap_cb(); machine().save().register_postload(save_prepost_delegate(FUNC(virgedx_pci_device::postload), this)); } @@ -207,7 +244,16 @@ void virge_pci_device::map_extra(uint64_t memory_window_start, uint64_t memory_w } if (BIT(command, 0)) + { io_space->install_device(0x03b0, 0x03df, *this, &virge_pci_device::legacy_io_map); + + // Available at MMFF20 only if true + if (m_vga->read_pd26_strapping() == false) + { + const u16 port_offset = m_vga->read_pd25_strapping() ? 0xe2 : 0xe8; + io_space->install_readwrite_handler(port_offset, port_offset, read8sm_delegate(m_vga, FUNC(s3virge_vga_device::serial_port_r)), write8sm_delegate(m_vga, FUNC(s3virge_vga_device::serial_port_w))); + } + } } void virge_pci_device::device_add_mconfig(machine_config &config) @@ -222,6 +268,19 @@ void virge_pci_device::device_add_mconfig(machine_config &config) m_vga->linear_config_changed().set(FUNC(virge_pci_device::linear_config_changed_w)); } +void virgevx_pci_device::device_add_mconfig(machine_config &config) +{ + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); + screen.set_raw(XTAL(25'174'800), 900, 0, 640, 526, 0, 480); + screen.set_screen_update("vga", FUNC(s3virge_vga_device::screen_update)); + + S3VIRGEVX(config, m_vga, 0); + m_vga->set_screen("screen"); + // 2MB, 4MB and 8MB, EDO RAM + m_vga->set_vram_size(0x400000); + m_vga->linear_config_changed().set(FUNC(virgevx_pci_device::linear_config_changed_w)); +} + void virgedx_pci_device::device_add_mconfig(machine_config &config) { screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); @@ -247,6 +306,27 @@ ROM_START( virge_pci ) ROM_IGNORE( 0x8000 ) ROM_END +const tiny_rom_entry *virge_pci_device::device_rom_region() const +{ + return ROM_NAME( virge_pci ); +} + +ROM_START( virgevx_pci ) + ROM_REGION(0x8000,"bios", 0) + ROM_DEFAULT_BIOS("dms3d3k") + + // Vlask dump + // v2.xx BIOSes known to exist + ROM_SYSTEM_BIOS( 0, "dms3d3k", "Diamond Stealth 3D 3000 HQ v1.00" ) + ROMX_LOAD("diamondstealth3000.vbi", 0x0000, 0x8000, CRC(c2423896) SHA1(fdab43f15da1d66bca286583f9da86873f3e22de), ROM_BIOS(0) ) +ROM_END + +const tiny_rom_entry *virgevx_pci_device::device_rom_region() const +{ + return ROM_NAME( virgevx_pci ); +} + + ROM_START( virgedx_pci ) ROM_REGION(0x8000,"bios", 0) ROM_DEFAULT_BIOS("virgedx") @@ -256,18 +336,12 @@ ROM_START( virgedx_pci ) ROM_SYSTEM_BIOS( 1, "dms3d2kp", "Diamond Stealth 3D 2000 Pro v3.04" ) ROMX_LOAD("virgedxdiamond.bin", 0x00000, 0x8000, CRC(58b0dcda) SHA1(b13ae6b04db6fc05a76d924ddf2efe150b823029), ROM_BIOS(1) ) -ROM_END -const tiny_rom_entry *virge_pci_device::device_rom_region() const -{ - return ROM_NAME( virge_pci ); -} + ROM_SYSTEM_BIOS( 2, "s600dx", "Leadtek WinFast 3D S600DX V1.01.03" ) + ROMX_LOAD("winfast_3d_s600dx.bin", 0x00000, 0x8000, CRC(d68db9f4) SHA1(9a7f58fab7811342a00bbc76837b4f9015913ddb), ROM_BIOS(2) ) +ROM_END const tiny_rom_entry *virgedx_pci_device::device_rom_region() const { return ROM_NAME( virgedx_pci ); } - -DEFINE_DEVICE_TYPE(VIRGE_PCI, virge_pci_device, "virge_pci", "S3 86C325 ViRGE") -DEFINE_DEVICE_TYPE(VIRGEDX_PCI, virgedx_pci_device, "virgedx_pci", "S3 86C375 ViRGE/DX") -//VIRGEGX_PCI, /DX with SGRAM/SDRAM support diff --git a/src/devices/bus/pci/virge_pci.h b/src/devices/bus/pci/virge_pci.h index 4ddc836f7079d..30e7c348c7e62 100644 --- a/src/devices/bus/pci/virge_pci.h +++ b/src/devices/bus/pci/virge_pci.h @@ -66,6 +66,27 @@ class virge_pci_device : public pci_card_device u32 get_vga_linear_address(); }; +class virgevx_pci_device : public virge_pci_device +{ +public: + template + virgevx_pci_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock, T &&screen_tag) + : virgevx_pci_device(mconfig, tag, owner, clock) + { + set_screen_tag(std::forward(screen_tag)); + } + virgevx_pci_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + +protected: + virtual void device_start() override ATTR_COLD; + virtual void device_add_mconfig(machine_config &config) override ATTR_COLD; + virtual const tiny_rom_entry *device_rom_region() const override ATTR_COLD; + +// required_device m_vga; +// required_memory_region m_bios; +// optional_device m_screen; +}; + class virgedx_pci_device : public virge_pci_device { public: @@ -88,6 +109,7 @@ class virgedx_pci_device : public virge_pci_device }; DECLARE_DEVICE_TYPE(VIRGE_PCI, virge_pci_device) +DECLARE_DEVICE_TYPE(VIRGEVX_PCI, virgevx_pci_device) DECLARE_DEVICE_TYPE(VIRGEDX_PCI, virgedx_pci_device) #endif diff --git a/src/devices/bus/pci/zr36057.cpp b/src/devices/bus/pci/zr36057.cpp index a286850b64564..f8a0ac98f85c7 100644 --- a/src/devices/bus/pci/zr36057.cpp +++ b/src/devices/bus/pci/zr36057.cpp @@ -14,10 +14,12 @@ iterations. ZR36057 is known to have two HW quirks that are been fixed with ZR36067. TODO: -- Enough to pass board functions in dc10plus HW test, requires VSYNC signal from ZR36060 to continue; +- Enough to pass board functions in dc10plus HW test, requires GIRQ1 signal source to continue +(from SAA7110? On its own it doesn't touch any of the sync registers); - Hookup busmaster; - What are i2c 0x8e >> 1 address device checks for? \- Can't be adv7175 (0xd4 >> 1) nor adv7176 (0x54 >> 1) +- Noisy on undocumented guest ID 7 once VidCap capturing is enabled; ... - Soft Reset & Write lock mechanisms (each register have separate macro-groups); - GuestBus slot mechanism (relevant when multiple devices are hooked); @@ -39,13 +41,17 @@ Known mix-ins: #define LOG_WARN (1U << 1) #define LOG_PO (1U << 2) // PostOffice interactions +#define LOG_VFE (1U << 3) // Log Video Front End +#define LOG_SYNC (1U << 4) // Log Sync signals and Active Area (as SyncMstr) -#define VERBOSE (LOG_GENERAL | LOG_WARN | LOG_PO) +#define VERBOSE (LOG_GENERAL | LOG_WARN | LOG_VFE | LOG_SYNC) //#define LOG_OUTPUT_FUNC osd_printf_info #include "logmacro.h" #define LOGWARN(...) LOGMASKED(LOG_WARN, __VA_ARGS__) #define LOGPO(...) LOGMASKED(LOG_PO, __VA_ARGS__) +#define LOGVFE(...) LOGMASKED(LOG_VFE, __VA_ARGS__) +#define LOGSYNC(...) LOGMASKED(LOG_SYNC, __VA_ARGS__) DEFINE_DEVICE_TYPE(ZR36057_PCI, zr36057_device, "zr36057", "Zoran ZR36057-based Enhanced Multimedia Controller") //DEFINE_DEVICE_TYPE(ZR36067_PCI, zr36067_device, "zr36067", "Zoran ZR36067-based AV Controller") @@ -80,6 +86,7 @@ void zr36057_device::device_add_mconfig(machine_config &config) SAA7110A(config, m_decoder, XTAL(26'800'000)); m_decoder->sda_callback().set([this](int state) { m_decoder_sdao_state = state; }); + //m_decoder->vs_callback().set(FUNC(zr36057_device::girq1_w)); //ADV7176(config, m_encoder, XTAL(27'000'000)); @@ -127,6 +134,60 @@ void zr36057_device::software_reset() m_vfe.horizontal_config = (m_vfe.hspol << 30) | (m_vfe.hstart << 10) | (m_vfe.hend << 0); m_vfe.vertical_config = (m_vfe.vspol << 30) | (m_vfe.vstart << 10) | (m_vfe.vend << 0); + m_vfe.ext_fi = 0; + m_vfe.top_field = 1; + m_vfe.vclk_pol = 0; + m_vfe.hfilter = 0; + m_vfe.dup_fld = 0; + m_vfe.hor_dcm = 0; + m_vfe.ver_dcm = 0; + m_vfe.disp_mod = 0; + m_vfe.yuv2rgb = 2; + m_vfe.err_dif = 0; + m_vfe.pack24 = 0; + m_vfe.little_endian = 1; + m_vfe.format_config = (m_vfe.top_field << 25) | (m_vfe.yuv2rgb << 3) | (m_vfe.little_endian << 0); + m_vfe.vid_bottom_base = m_vfe.vid_top_base = m_vfe.mask_bottom_base = m_vfe.mask_top_base = 0xffff'fffc; + m_vfe.disp_stride = 0xfffc; + m_vfe.vid_ovf = m_vfe.snapshot = m_vfe.frame_grab = false; + m_vfe.vid_en = false; + m_vfe.min_pix = 0xf; + m_vfe.triton = false; + m_vfe.window_height = 0x0f0; + m_vfe.window_width = 0x3ff; + m_vfe.display_config = (m_vfe.vid_en << 31) | (m_vfe.min_pix << 24) | (m_vfe.window_height << 12) | (m_vfe.window_width); + + m_vfe.ovl_enable = false; + m_vfe.mask_stride = 0xff; + + // TODO: these also go in process_reset fn + // defaults in MPEG mode + m_jpeg.mode = false; + m_jpeg.sub_mode = 3; + m_jpeg.rtbsy_fb = m_jpeg.go_en = m_jpeg.sync_mstr = m_jpeg.fld_per_buff = false; + m_jpeg.vfifo_fb = m_jpeg.cfifo_fb = false; + m_jpeg.still_lendian = true; + m_jpeg.p_reset = true; + m_jpeg.cod_trns_en = false; + m_jpeg.active = false; + + m_sync_gen.vsync_size = 6; + m_sync_gen.vtotal = 525; + m_sync_gen.hsync_start = 640; + m_sync_gen.htotal = 780; + + m_active_area.nax = 0; + m_active_area.pax = 640; + m_active_area.nay = 10; + m_active_area.pay = 240; + m_active_area.odd = true; + + m_jpeg.guest_id = 4; + m_jpeg.guest_reg = 0; + + m_irq_status = m_irq_enable = 0; + m_inta_pin_enable = false; + m_pci_waitstate_control = 0; m_gpio_ddr = 0xff; // all inputs // GuestBus ID default @@ -134,9 +195,6 @@ void zr36057_device::software_reset() for (int i = 0; i < 4; i++) m_guestbus.time[i] = 0; - m_jpeg_guest_id = 4; - m_jpeg_guest_reg = 0; - m_po.pending = false; m_po.time_out = false; m_po.dir = true; @@ -157,40 +215,193 @@ void zr36057_device::asr_map(address_map &map) map(0x000, 0x003).lrw32( NAME([this] (offs_t offset) { // NOTE: wants to read-back here, throws "Bus Master ASIC error" otherwise (?) - LOG("Video Front End Horizontal Configuration R\n"); + LOGVFE("Video Front End: Horizontal Configuration R\n"); return m_vfe.horizontal_config; }), NAME([this] (offs_t offset, u32 data, u32 mem_mask) { COMBINE_DATA(&m_vfe.horizontal_config); - LOG("Video Front End Horizontal Configuration W %08x & %08x\n", data, mem_mask); + LOGVFE("Video Front End: Horizontal Configuration W %08x & %08x\n", data, mem_mask); m_vfe.hspol = BIT(m_vfe.horizontal_config, 30); m_vfe.hstart = (m_vfe.horizontal_config >> 10) & 0x3ff; m_vfe.hend = (m_vfe.horizontal_config >> 0) & 0x3ff; - LOG("\tVSPOL %d VSTART %d VEND %d\n", m_vfe.hspol, m_vfe.hstart, m_vfe.hend); + LOGVFE("\tHSPol %d, HStart %d, HEnd %d\n", m_vfe.hspol, m_vfe.hstart, m_vfe.hend); }) ); map(0x004, 0x007).lrw32( NAME([this] (offs_t offset) { - LOG("Video Front End Vertical Configuration R\n"); + LOGVFE("Video Front End: Vertical Configuration R\n"); return m_vfe.vertical_config; }), NAME([this] (offs_t offset, u32 data, u32 mem_mask) { COMBINE_DATA(&m_vfe.vertical_config); - LOG("Video Front End Vertical Configuration %08x & %08\n", data, mem_mask); + LOGVFE("Video Front End: Vertical Configuration W %08x & %08x\n", data, mem_mask); m_vfe.vspol = BIT(m_vfe.vertical_config, 30); m_vfe.vstart = (m_vfe.vertical_config >> 10) & 0x3ff; m_vfe.vend = (m_vfe.vertical_config >> 0) & 0x3ff; - LOG("\tVSPOL %d VSTART %d VEND %d\n", m_vfe.vspol, m_vfe.vstart, m_vfe.vend); + LOGVFE("\tVSPol %d, VStart %d, VEnd %d\n", m_vfe.vspol, m_vfe.vstart, m_vfe.vend); + }) + ); + map(0x008, 0x00b).lrw32( + NAME([this] (offs_t offset) { + LOGVFE("Video Front End: Format Configuration R\n"); + return m_vfe.format_config; + }), + NAME([this] (offs_t offset, u32 data, u32 mem_mask) { + COMBINE_DATA(&m_vfe.format_config); + LOGVFE("Video Front End: Format Configuration W %08x & %08x\n", data, mem_mask); + m_vfe.ext_fi = BIT(m_vfe.format_config, 26); + m_vfe.top_field = BIT(m_vfe.format_config, 25); + m_vfe.vclk_pol = BIT(m_vfe.format_config, 24); + LOGVFE("\tExtFI %d, TopField %d, VCLKPol %d\n" + , m_vfe.ext_fi, m_vfe.top_field, m_vfe.vclk_pol + ); + // Video Scaler + m_vfe.hfilter = (m_vfe.format_config >> 21) & 7; + m_vfe.dup_fld = BIT(m_vfe.format_config, 20); + m_vfe.hor_dcm = (m_vfe.format_config >> 14) & 0x3f; + m_vfe.ver_dcm = (m_vfe.format_config >> 8) & 0x3f; + LOGVFE("\tHFilter %d, DupFld %d, HorDcm %d, VerDcm %d\n" + , m_vfe.hfilter + , m_vfe.dup_fld + , m_vfe.hor_dcm + , m_vfe.ver_dcm + ); + // Pixel Formatter + m_vfe.disp_mod = BIT(m_vfe.format_config, 6); + m_vfe.yuv2rgb = (m_vfe.format_config >> 3) & 3; + m_vfe.err_dif = BIT(m_vfe.format_config, 2); + m_vfe.pack24 = BIT(m_vfe.format_config, 1); + m_vfe.little_endian = BIT(m_vfe.format_config, 0); + LOGVFE("\tDispMod %d, YUV2RGB %d, ErrDif %d, Pack24 %d, LittleEndian %d\n" + , m_vfe.disp_mod + , m_vfe.yuv2rgb + , m_vfe.err_dif + , m_vfe.pack24 + , m_vfe.little_endian + ); + }) + ); + map(0x00c, 0x00f).lrw32( + NAME([this] (offs_t offset) { + LOGVFE("Video Display Top R\n"); + return m_vfe.vid_top_base; + }), + NAME([this] (offs_t offset, u32 data, u32 mem_mask) { + COMBINE_DATA(&m_vfe.vid_top_base); + m_vfe.vid_top_base &= 0xffff'fffc; + LOGVFE("Video Display Top W %08x & %08x\n", data, mem_mask); + }) + ); + map(0x010, 0x013).lrw32( + NAME([this] (offs_t offset) { + LOGVFE("Video Display Top R\n"); + return m_vfe.vid_bottom_base; + }), + NAME([this] (offs_t offset, u32 data, u32 mem_mask) { + COMBINE_DATA(&m_vfe.vid_bottom_base); + m_vfe.vid_bottom_base &= 0xffff'fffc; + LOGVFE("Video Display Bottom W %08x & %08x\n", data, mem_mask); + }) + ); + map(0x014, 0x017).lrw32( + NAME([this] (offs_t offset) { + LOGVFE("Video Stride, Status and Frame Grab R\n"); + return (m_vfe.disp_stride << 16) | (m_vfe.vid_ovf << 8) | (m_vfe.snapshot << 1) | (m_vfe.frame_grab << 0); + }), + NAME([this] (offs_t offset, u32 data, u32 mem_mask) { + LOGVFE("Video Stride, Status and Frame Grab W %08x & %08x\n", data, mem_mask); + if (ACCESSING_BITS_16_31) + { + COMBINE_DATA(&m_vfe.disp_stride); + m_vfe.disp_stride &= 0xfffc; + LOGVFE("\tDispStride %d\n", m_vfe.disp_stride); + } + + if (ACCESSING_BITS_8_15) + { + // bit 8 high clears the overflow flag + if (BIT(data, 8)) + { + m_vfe.vid_ovf = false; + LOGVFE("\tVidOvf clear\n"); + } + } + + if (ACCESSING_BITS_0_7) + { + m_vfe.snapshot = !!(BIT(data, 1)); + m_vfe.frame_grab = !!(BIT(data, 0)); + LOGVFE("\tSnapShot %d, FrameGrab %d\n", m_vfe.snapshot, m_vfe.frame_grab); + // Presumably this will stall the emulation (goes off after two fields) + if (m_vfe.frame_grab) + popmessage("zr36057: FrameGrab enabled"); + } + }) + ); + map(0x018, 0x01b).lrw32( + NAME([this] (offs_t offset) { + LOG("Video Display Configuration R\n"); + return m_vfe.display_config; + }), + NAME([this] (offs_t offset, u32 data, u32 mem_mask) { + COMBINE_DATA(&m_vfe.display_config); + LOGVFE("Video Display Configuration W %08x & %08x\n", data, mem_mask); + m_vfe.vid_en = !!BIT(m_vfe.display_config, 31); + // Not a mistake: min_pix overlaps with the /Triton setting + m_vfe.min_pix = (m_vfe.display_config >> 24) & 0x7f; + m_vfe.triton = !!BIT(~m_vfe.display_config, 24); + LOGVFE("\tVidEn %d, MinPix %d, Triton %s Controller\n" + , m_vfe.vid_en + , m_vfe.min_pix + , m_vfe.triton ? "Intel 'Triton' Bridge" : "Other PCI Bridge" + ); + m_vfe.window_height = (m_vfe.display_config >> 12) & 0x3ff; + m_vfe.window_width = (m_vfe.display_config >> 0) & 0x3ff; + LOGVFE("\tVidWinHt %d, VidWinWid %d\n", m_vfe.window_height, m_vfe.window_width); + }) + ); + map(0x01c, 0x01f).lrw32( + NAME([this] (offs_t offset) { + LOGVFE("Masking Map Top R\n"); + return m_vfe.mask_top_base; + }), + NAME([this] (offs_t offset, u32 data, u32 mem_mask) { + COMBINE_DATA(&m_vfe.mask_top_base); + m_vfe.mask_top_base &= 0xffff'fffc; + LOGVFE("Masking Map Top W %08x & %08x\n", data, mem_mask); + }) + ); + map(0x020, 0x023).lrw32( + NAME([this] (offs_t offset) { + LOGVFE("Masking Map Bottom R\n"); + return m_vfe.mask_bottom_base; + }), + NAME([this] (offs_t offset, u32 data, u32 mem_mask) { + COMBINE_DATA(&m_vfe.mask_bottom_base); + m_vfe.mask_bottom_base &= 0xffff'fffc; + LOGVFE("Masking Map Bottom W %08x & %08x\n", data, mem_mask); + }) + ); + map(0x024, 0x027).lrw32( + NAME([this] (offs_t offset) { + LOGVFE("Overlay Control R\n"); + return (m_vfe.ovl_enable << 15) | (m_vfe.mask_stride << 0); + }), + NAME([this] (offs_t offset, u32 data, u32 mem_mask) { + LOGVFE("Overlay Control W %08x & %08x\n", data, mem_mask); + if (ACCESSING_BITS_8_15) + { + m_vfe.ovl_enable = !!(BIT(data, 15)); + LOGVFE("\tOvlEnable %d\n", m_vfe.ovl_enable); + } + + if (ACCESSING_BITS_0_7) + { + m_vfe.mask_stride = data & 0xff; + LOGVFE("\tMaskStride %d\n", m_vfe.mask_stride); + } }) ); -// map(0x008, 0x00b) VFE Config, Video Scaler and Pixel Format -// map(0x00c, 0x00f) Video Display Top -// map(0x010, 0x013) Video Display Bottom -// map(0x014, 0x017) Video Display Stride, Status and Frame Grab -// map(0x018, 0x01b) Video Display Configuration -// map(0x01c, 0x01f) Masking Map Top -// map(0x020, 0x023) Masking Map Bottom -// map(0x024, 0x027) Overlay Control map(0x028, 0x02b).lrw32( NAME([this] (offs_t offset) { return (m_softreset << 24) | (m_pci_waitstate_control << 16) | m_gpio_ddr; @@ -246,17 +457,50 @@ void zr36057_device::asr_map(address_map &map) // map(0x030, 0x033) MPEG Code Source Address // map(0x034, 0x037) MPEG Code Transfer Control // map(0x038, 0x03b) MPEG Code Memory Pointer -// map(0x03c, 0x03f) Interrupt Status -// map(0x040, 0x043) Interrupt Control + map(0x03c, 0x03f).lrw32( + NAME([this] (offs_t offset) { + return m_irq_status; + }), + NAME([this] (offs_t offset, u32 data, u32 mem_mask) { + if (ACCESSING_BITS_24_31) + { + m_irq_status &= ~data; + m_irq_status &= 0x7800'0000; + update_irq_status(); + } + }) + ); + map(0x040, 0x043).lrw32( + NAME([this] (offs_t offset) { + return m_irq_enable | (m_inta_pin_enable << 24); + }), + NAME([this] (offs_t offset, u32 data, u32 mem_mask) { + if (ACCESSING_BITS_24_31) + { + LOG("IRQ Enable W %08x & %08x\n", data, mem_mask); + m_irq_enable = data; + m_irq_enable &= 0x7800'0000; + m_inta_pin_enable = BIT(data, 24); + LOG("\tINTA enable %d\n", m_inta_pin_enable); + LOG("\tGIRQ1 %d GIRQ0 %d CodRepIRQ %d JPEGRepIRQ\n" + , BIT(data, 30) + , BIT(data, 29) + , BIT(data, 28) + , BIT(data, 27) + ); + update_irq_status(); + } + }) + ); map(0x044, 0x047).lrw32( NAME([this] (offs_t offset) { - LOG("I2C R\n"); + //LOG("I2C R\n"); // avoid win98 stall for now return m_decoder_sdao_state << 1 | 1; //return 3; }), NAME([this] (offs_t offset, u32 data, u32 mem_mask) { - //printf("I2C %02x %08x\n", data, mem_mask); + //LOG("I2C %02x %08x\n", data, mem_mask); if (ACCESSING_BITS_0_7) { m_decoder->sda_write(BIT(data, 1)); @@ -264,23 +508,175 @@ void zr36057_device::asr_map(address_map &map) } }) ); -// map(0x100, 0x103) JPEG Mode and Control -// map(0x104, 0x107) JPEG Process Control -// map(0x108, 0x10b) Vertical Sync Parameters (as sync master) -// map(0x10c, 0x10f) Horizontal Sync Parameters (as sync master) -// map(0x110, 0x113) Field Horizontal Active Portion -// map(0x114, 0x117) Field Vertical Active Portion -// map(0x118, 0x11b) Field Process Parameters + map(0x100, 0x103).lrw32( + NAME([this] (offs_t offset) { + LOG("JPEG Mode and Control R\n"); + return (m_jpeg.mode << 31) | (m_jpeg.sub_mode << 29) + | (m_jpeg.rtbsy_fb << 6) | (m_jpeg.go_en << 5) | (m_jpeg.sync_mstr << 4) + | (m_jpeg.fld_per_buff << 3) | (m_jpeg.vfifo_fb << 2) + | (m_jpeg.cfifo_fb << 1) | (m_jpeg.still_lendian << 0); + }), + NAME([this] (offs_t offset, u32 data, u32 mem_mask) { + LOG("JPEG Mode and Control W %08x & %08x\n", data, mem_mask); + if (ACCESSING_BITS_24_31) + { + m_jpeg.mode = !!BIT(data, 31); + // --x- (0) Still Image (1) Motion Video + // ---x (0) Decompression (1) Compression + m_jpeg.sub_mode = (data >> 29) & 3; + LOG("\tJPG %s Mode, JPGMode %d\n" + , m_jpeg.mode ? "JPEG" : "MPEG" + , m_jpeg.sub_mode + ); + } + + if (ACCESSING_BITS_0_7) + { + m_jpeg.rtbsy_fb = !!BIT(data, 6); + m_jpeg.go_en = !!BIT(data, 5); + m_jpeg.sync_mstr = !!BIT(data, 4); + m_jpeg.fld_per_buff = !!BIT(data, 3); + m_jpeg.vfifo_fb = !!BIT(data, 2); + m_jpeg.cfifo_fb = !!BIT(data, 1); + m_jpeg.still_lendian = !!BIT(data, 0); + LOG("\tRTBSY_FB %d, Go_en %d, SyncMstr %d, Fld_per_buff %s, VFIFO_FB %d, CFIFO_FB %d, Still_LitEndian %s\n" + , m_jpeg.rtbsy_fb + , m_jpeg.go_en + , m_jpeg.sync_mstr + , m_jpeg.fld_per_buff ? "1 (One code field)" : "0 (Two code fields, one code frame)" + , m_jpeg.vfifo_fb + , m_jpeg.cfifo_fb + , m_jpeg.still_lendian ? "Little" : "Gib" + ); + if (m_jpeg.go_en) + popmessage("zr36057.cpp: go_en enabled"); + } + }) + ); + map(0x104, 0x107).lrw32( + NAME([this] (offs_t offset) { + LOG("JPEG Process Control R\n"); + return (m_jpeg.p_reset << 7) | (m_jpeg.cod_trns_en << 5) | (m_jpeg.active << 0); + }), + NAME([this] (offs_t offset, u32 data, u32 mem_mask) { + LOG("JPEG Process Control W %08x & %08x\n", data, mem_mask); + if (ACCESSING_BITS_0_7) + { + m_jpeg.p_reset = !!BIT(data, 7); + m_jpeg.cod_trns_en = !!BIT(data, 5); + m_jpeg.active = !!BIT(data, 0); + LOG("\tP_reset %d, CodTrnsEn %d, Active %d\n" + , m_jpeg.p_reset + , m_jpeg.cod_trns_en + , m_jpeg.active + ); + } + }) + ); + map(0x108, 0x10b).lrw32( + NAME([this] (offs_t offset) { + LOGSYNC("Vertical Sync Parameters R\n"); + return (m_sync_gen.vsync_size << 16) | (m_sync_gen.vtotal); + }), + NAME([this] (offs_t offset, u32 data, u32 mem_mask) { + LOGSYNC("Vertical Sync Parameters W %08x & %08x\n", data, mem_mask); + if (ACCESSING_BITS_16_23) + { + m_sync_gen.vsync_size = (data >> 16) & 0xff; + LOGSYNC("\tVsyncSize %d\n", m_sync_gen.vsync_size); + } + + if (ACCESSING_BITS_0_15) + { + m_sync_gen.vtotal = data & 0xffff; + LOGSYNC("\tFrmTot %d\n", m_sync_gen.vtotal); + } + }) + ); + map(0x10c, 0x10f).lrw32( + NAME([this] (offs_t offset) { + LOGSYNC("Horizontal Sync Parameters R\n"); + return (m_sync_gen.hsync_start << 16) | (m_sync_gen.htotal); + }), + NAME([this] (offs_t offset, u32 data, u32 mem_mask) { + LOGSYNC("Horizontal Sync Parameters W %08x & %08x\n", data, mem_mask); + if (ACCESSING_BITS_16_31) + { + m_sync_gen.hsync_start = (data >> 16) & 0xffff; + LOGSYNC("\tHsyncStart %d\n", m_sync_gen.hsync_start); + } + + if (ACCESSING_BITS_0_15) + { + m_sync_gen.htotal = data & 0xffff; + LOGSYNC("\tLineTot %d\n", m_sync_gen.htotal); + } + }) + ); + map(0x110, 0x113).lrw32( + NAME([this] (offs_t offset) { + LOGSYNC("Field Horizontal Active Portion R\n"); + return (m_active_area.nax << 16) | (m_active_area.pax); + }), + NAME([this] (offs_t offset, u32 data, u32 mem_mask) { + LOGSYNC("Field Horizontal Active Portion W %08x & %08x\n", data, mem_mask); + if (ACCESSING_BITS_16_31) + { + m_active_area.nax = (data >> 16) & 0xffff; + LOGSYNC("\tNAX %d\n", m_active_area.nax); + } + + if (ACCESSING_BITS_0_15) + { + m_active_area.pax = data & 0xffff; + LOGSYNC("\tPAX %d\n", m_active_area.pax); + } + }) + ); + map(0x114, 0x117).lrw32( + NAME([this] (offs_t offset) { + LOGSYNC("Field Vertical Active Portion R\n"); + return (m_active_area.nay << 16) | (m_active_area.pay); + }), + NAME([this] (offs_t offset, u32 data, u32 mem_mask) { + LOGSYNC("Field Vertical Active Portion W %08x & %08x\n", data, mem_mask); + if (ACCESSING_BITS_16_31) + { + m_active_area.nay = (data >> 16) & 0xffff; + LOGSYNC("\tNAY %d\n", m_active_area.nay); + } + + if (ACCESSING_BITS_0_15) + { + m_active_area.pay = data & 0xffff; + LOGSYNC("\tPAY %d\n", m_active_area.pay); + } + }) + ); + map(0x118, 0x11b).lrw32( + NAME([this] (offs_t offset) { + LOGSYNC("Field Process Parameters R\n"); + return m_active_area.odd; + }), + NAME([this] (offs_t offset, u32 data, u32 mem_mask) { + LOGSYNC("Field Process Parameters W %08x & %08x\n", data, mem_mask); + if (ACCESSING_BITS_0_7) + { + m_active_area.odd = !!BIT(data, 0); + LOGSYNC("\tOdd_Even: %s\n", m_active_area.odd ? "Odd" : "Even"); + } + }) + ); // map(0x11c, 0x11f) JPEG Code Base Address // map(0x120, 0x123) JPEG Code FIFO Threshold map(0x124, 0x124).lrw8( NAME([this] (offs_t offset) { LOG("JPEG Codec Guest ID R\n"); - return (m_jpeg_guest_id << 4) | (m_jpeg_guest_reg << 0); + return (m_jpeg.guest_id << 4) | (m_jpeg.guest_reg << 0); }), NAME([this] (offs_t offset, u8 data) { - m_jpeg_guest_id = (data >> 4) & 7; - m_jpeg_guest_reg = (data >> 0) & 7; + m_jpeg.guest_id = (data >> 4) & 7; + m_jpeg.guest_reg = (data >> 0) & 7; LOG("JPEG Codec Guest ID W %02x\n", data); }) ); @@ -373,3 +769,11 @@ void zr36057_device::postoffice_w(offs_t offset, u32 data, u32 mem_mask) LOGWARN("Warning: PO access unmapped POGuestID write %d %02x\n", m_po.guest_id, m_po.guest_reg); } } + +void zr36057_device::update_irq_status() +{ + if (m_inta_pin_enable) + { + irq_pin_w(0, m_irq_status & m_irq_enable); + } +} diff --git a/src/devices/bus/pci/zr36057.h b/src/devices/bus/pci/zr36057.h index 71ced398967b8..727f5bcff5323 100644 --- a/src/devices/bus/pci/zr36057.h +++ b/src/devices/bus/pci/zr36057.h @@ -41,15 +41,68 @@ class zr36057_device : public pci_card_device struct { u32 horizontal_config; u32 vertical_config; + u32 format_config; int hspol, vspol; u16 hstart, hend, vstart, vend; - } m_vfe; - u8 m_jpeg_guest_id, m_jpeg_guest_reg; + int ext_fi, top_field, vclk_pol; + u8 hfilter; + int dup_fld; + u8 hor_dcm, ver_dcm; + int disp_mod; + u8 yuv2rgb; + int err_dif, pack24, little_endian; + + u32 vid_top_base, vid_bottom_base; + + u16 disp_stride; + bool vid_ovf; + bool snapshot, frame_grab; + + u32 display_config; + bool vid_en; + u8 min_pix; + bool triton; + u16 window_height, window_width; + + u32 mask_top_base, mask_bottom_base; + bool ovl_enable; + u8 mask_stride; + } m_vfe; bool m_softreset; u8 m_gpio_ddr, m_pci_waitstate_control; + // NOTE: these are technically external/public pins. + void girq1_w(int state) { m_irq_status |= 1 << 30; update_irq_status(); } + void girq0_w(int state) { m_irq_status |= 1 << 29; update_irq_status(); } + void cod_rep_irq_w(int state) { m_irq_status |= 1 << 28; update_irq_status(); } + void jpeg_rep_irq_w(int state) { m_irq_status |= 1 << 27; update_irq_status(); } + + void update_irq_status(); + u32 m_irq_status, m_irq_enable; + bool m_inta_pin_enable; + int m_decoder_sdao_state; + + struct { + u8 guest_id, guest_reg; + bool mode; + u8 sub_mode; + bool rtbsy_fb, go_en, sync_mstr, fld_per_buff, vfifo_fb, cfifo_fb, still_lendian; + bool p_reset, cod_trns_en, active; + } m_jpeg; + + struct { + u8 vsync_size; + u16 hsync_start; + u16 vtotal, htotal; + } m_sync_gen; + + struct { + u16 nax, pax, nay, pay; + bool odd; + } m_active_area; + struct { u8 time[8]; } m_guestbus; @@ -61,8 +114,6 @@ class zr36057_device : public pci_card_device u8 guest_id; u8 guest_reg; } m_po; /**< PostOffice */ - - int m_decoder_sdao_state; }; DECLARE_DEVICE_TYPE(ZR36057_PCI, zr36057_device) diff --git a/src/devices/bus/sg1000_exp/sk1100prn.cpp b/src/devices/bus/sg1000_exp/sk1100prn.cpp index 2b24864d75ba6..24d5808c229ba 100644 --- a/src/devices/bus/sg1000_exp/sk1100prn.cpp +++ b/src/devices/bus/sg1000_exp/sk1100prn.cpp @@ -9,7 +9,7 @@ #include "emu.h" #include "sk1100prn.h" // slot devices -//#include "sp400.h" +#include "sp400.h" #include "kblink.h" @@ -120,6 +120,6 @@ int sk1100_printer_port_device::busy_r() void sk1100_printer_port_devices(device_slot_interface &device) { - //device.option_add("sp400", SP400_PRINTER); /* serial printer */ + device.option_add("sp400", SP400_PRINTER); /* serial printer */ device.option_add("kblink", SK1100_LINK_CABLE); } diff --git a/src/devices/bus/sg1000_exp/sp400.cpp b/src/devices/bus/sg1000_exp/sp400.cpp new file mode 100644 index 0000000000000..fce22cf7d511b --- /dev/null +++ b/src/devices/bus/sg1000_exp/sp400.cpp @@ -0,0 +1,233 @@ +// license: BSD-3-Clause +// copyright-holders: Fabio Dalla Libera + +/* + Sega SP-400 Plotter + + 6805 dumped using https://github.com/charlesmacd/HD6805_Reader + + Plotter uses ALPS Micrographic Printer DPG 1302 mechanism. + + IC list: + + * M5L8035LP (Mitsubishi clone of I8035) + + P1 is the deserialized output data + P2.4 is the input serial data + P2.5 is busy (output to the computer) + P2.6 is the output strobe + P2.7 is busy (input from the 6805) + + * HD6805V (Hitachi chip, pin compatible with MC6805P2, with 4K of ROM) + + port A connected to the panel buttons + "By analyzing the disassembly I found out that three pins (PA5,6,7 of the 6805) are used to set + different configurations. The resolution can be changed, probably to support different mechanics. + The baud rate is 4800." + port B connected to the motors + port C connected to the pen and misc signals + port D connected to M5L8035LP parallel data +*/ + +// this is currently incomplete: missing paper output and pen sensor, everything else is working + +#include "emu.h" +#include "sp400.h" + +#include "cpu/m6805/m68705.h" +#include "cpu/mcs48/mcs48.h" + + +namespace { + +class sp400_printer_device : public device_t, public device_sk1100_printer_port_interface +{ +public: + static constexpr feature_type unemulated_features() { return feature::PRINTER; } + + sp400_printer_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + + virtual void device_add_mconfig(machine_config &config) override ATTR_COLD; + virtual void device_start() override ATTR_COLD; + + const tiny_rom_entry *device_rom_region() const override ATTR_COLD; + virtual ioport_constructor device_input_ports() const override ATTR_COLD; + + virtual void input_data(int state) override { m_data = state; } + virtual int output_busy() override { return m_busy; } + +private: + void dser_map(address_map &map); + void dser_p1_w(uint8_t data); + uint8_t dser_p2_r(); + void dser_p2_w(uint8_t data); + + uint8_t mot_pa_r(); + void mot_pb_w(uint8_t data); + uint8_t mot_pc_r(); + void mot_pc_w(uint8_t data); + uint8_t mot_pd_r(); + void update_pen_state(uint8_t data); + uint8_t pen_sensor() { return 0; } // not currently hooked up + + required_device m_dsercpu; // "deserializer CPU" + required_device m_motcpu; // "motor CPU" + + uint8_t m_data, m_busy; + uint8_t m_dserdataout, m_dserstrobe; + uint8_t m_motbusy, m_motpenup, m_motpendown; + uint8_t m_pendown; + + required_ioport m_buttons; +}; + +sp400_printer_device::sp400_printer_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : + device_t(mconfig, SP400_PRINTER, tag, owner, clock), + device_sk1100_printer_port_interface(mconfig, *this), + m_dsercpu(*this, "dsercpu"), + m_motcpu(*this, "motcpu"), + m_data(0), + m_busy(1), + m_dserdataout(0xff), + m_dserstrobe(1), + m_motbusy(0), + m_motpenup(1), + m_motpendown(1), + m_pendown(0), + m_buttons(*this, "BUTTONS") +{ +} + +void sp400_printer_device::device_start() +{ + save_item(NAME(m_data)); + save_item(NAME(m_busy)); + save_item(NAME(m_dserdataout)); + save_item(NAME(m_dserstrobe)); + save_item(NAME(m_motbusy)); + save_item(NAME(m_motpenup)); + save_item(NAME(m_motpendown)); + save_item(NAME(m_pendown)); +} + +void sp400_printer_device::dser_map(address_map &map) +{ + map(0x0000, 0x0fff).rom(); +} + +void sp400_printer_device::dser_p1_w(uint8_t data) +{ + m_dserdataout = data; +} + +void sp400_printer_device::dser_p2_w(uint8_t data) +{ + m_busy = BIT(data, 5); + m_dserstrobe = BIT(data, 6); + m_motcpu->set_input_line(M6805_IRQ_LINE, m_dserstrobe); +} + +uint8_t sp400_printer_device::dser_p2_r() +{ + return + (m_motbusy << 7) | + (m_dserstrobe << 6) | + (m_busy << 5) | + (m_data << 4) | + (1 << 3) | + (1 << 2) | + (1 << 1) | + (1 << 0); +} + +uint8_t sp400_printer_device::mot_pa_r() +{ + return + (0 << 0) | + (0 << 1) | + (m_buttons->read() << 2) | // bits 2..4 + (0 << 5) | + (0 << 6) | + (1 << 7); +} + +void sp400_printer_device::mot_pb_w(uint8_t data) +{ + // cr stepper data in 0..3 + // pf stepper data in 4..7 +} + +uint8_t sp400_printer_device::mot_pc_r() +{ + return + (m_motpenup << 0) | + (m_motpendown << 1) | + (1 << 2) | + (pen_sensor() << 3) | + (m_motbusy << 4) | + (1 << 5) | (1 << 6) | (1 << 7); // unconfirmed +} + +void sp400_printer_device::mot_pc_w(uint8_t data) +{ + m_motpenup = BIT(data, 0); + m_motpendown = BIT(data, 1); + m_motbusy = BIT(data, 4); + update_pen_state(data); +} + +uint8_t sp400_printer_device::mot_pd_r() +{ + return sp400_printer_device::m_dserdataout; +} + +void sp400_printer_device::update_pen_state(uint8_t data) +{ + if (!BIT(data, 0)) m_pendown = 0; + if (!BIT(data, 1)) m_pendown = 1; +} + +void sp400_printer_device::device_add_mconfig(machine_config &config) +{ + I8035(config, m_dsercpu, 4_MHz_XTAL); + m_dsercpu->p1_out_cb().set(FUNC(sp400_printer_device::dser_p1_w)); + m_dsercpu->p2_in_cb().set(FUNC(sp400_printer_device::dser_p2_r)); + m_dsercpu->p2_out_cb().set(FUNC(sp400_printer_device::dser_p2_w)); + m_dsercpu->set_addrmap(AS_PROGRAM, &sp400_printer_device::dser_map); + + M6805U3(config, m_motcpu, 4_MHz_XTAL); + m_motcpu->porta_r().set(FUNC(sp400_printer_device::mot_pa_r)); + m_motcpu->portb_w().set(FUNC(sp400_printer_device::mot_pb_w)); + m_motcpu->portc_r().set(FUNC(sp400_printer_device::mot_pc_r)); + m_motcpu->portc_w().set(FUNC(sp400_printer_device::mot_pc_w)); + m_motcpu->portd_r().set(FUNC(sp400_printer_device::mot_pd_r)); +} + +ROM_START( sp400 ) + ROM_REGION( 0x1000, "dsercpu", 0 ) + ROM_LOAD( "sp400_8035.bin", 0x0000, 0x1000, CRC(0eb48272) SHA1(08a2727f1592f5d2ecb2e368126ad7bfc5d3c270) ) + + ROM_REGION(0x1000, "motcpu", 0 ) + ROM_LOAD( "sp400_hd6805v1.bin", 0x0000, 0x1000, CRC(aa073745) SHA1(65016f3b022af30cc6b084af1e43b29168721a60) ) +ROM_END + +const tiny_rom_entry *sp400_printer_device::device_rom_region() const +{ + return ROM_NAME( sp400 ); +} + +INPUT_PORTS_START( sp400 ) + PORT_START("BUTTONS") + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("Color Select") PORT_CODE(KEYCODE_2_PAD) + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("Line Feed") PORT_CODE(KEYCODE_1_PAD) + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("Pen Change") PORT_CODE(KEYCODE_3_PAD) +INPUT_PORTS_END + +ioport_constructor sp400_printer_device::device_input_ports() const +{ + return INPUT_PORTS_NAME(sp400); +} + +} // anonymous namespace + +DEFINE_DEVICE_TYPE_PRIVATE(SP400_PRINTER, device_sk1100_printer_port_interface, sp400_printer_device, "sega_sp400", "Sega SP-400 Plotter") diff --git a/src/devices/bus/sg1000_exp/sp400.h b/src/devices/bus/sg1000_exp/sp400.h new file mode 100644 index 0000000000000..fa1d87c087837 --- /dev/null +++ b/src/devices/bus/sg1000_exp/sp400.h @@ -0,0 +1,13 @@ +// license: BSD-3-Clause +// copyright-holders: Fabio Dalla Libera + +#ifndef MAME_BUS_SG1000_EXP_SP400_H +#define MAME_BUS_SG1000_EXP_SP400_H + +#pragma once + +#include "sk1100prn.h" + +DECLARE_DEVICE_TYPE(SP400_PRINTER, device_sk1100_printer_port_interface) + +#endif // MAME_BUS_SG1000_EXP_SP400_H diff --git a/src/devices/bus/ti99/internal/998board.h b/src/devices/bus/ti99/internal/998board.h index f1a1fa797bb77..cf80377fce79d 100644 --- a/src/devices/bus/ti99/internal/998board.h +++ b/src/devices/bus/ti99/internal/998board.h @@ -25,6 +25,7 @@ #include "machine/ram.h" #include "machine/tmc0430.h" #include "machine/tms9901.h" +#include "machine/tms6100.h" #include "sound/sn76496.h" #include "sound/tms5220.h" #include "video/tms9928a.h" diff --git a/src/devices/bus/ti99/internal/datamux.cpp b/src/devices/bus/ti99/internal/datamux.cpp index d87b2df75e6e3..8359e213d8d38 100644 --- a/src/devices/bus/ti99/internal/datamux.cpp +++ b/src/devices/bus/ti99/internal/datamux.cpp @@ -205,6 +205,9 @@ void datamux_device::setaddress_all(uint16_t addr) // Cartridge ROM bool iscartrom = ((addr & 0xe000)==0x6000); + // Speech (1001 0wxx xxxx xxx0) + bool sbe = ((addr & 0xf801)==0x9000) && validaccess; + // Always deliver to GROM so that the select line may be cleared line_state gsq = isgrom? ASSERT_LINE : CLEAR_LINE; if (isgrom) m_grom_idle = false; @@ -228,6 +231,7 @@ void datamux_device::setaddress_all(uint16_t addr) // I/O port gets all accesses m_memen_state = ASSERT_LINE; m_ioport->memen_in(m_memen_state); + m_ioport->sbe(sbe); m_ioport->setaddress_dbin(addr, m_dbin); } diff --git a/src/devices/bus/ti99/internal/genboard.cpp b/src/devices/bus/ti99/internal/genboard.cpp index f87120d825fe7..7e2ea7e363000 100644 --- a/src/devices/bus/ti99/internal/genboard.cpp +++ b/src/devices/bus/ti99/internal/genboard.cpp @@ -33,6 +33,9 @@ out: CSR*: v9938 read out: RAMENX*: SRAM expansion + out: RAMENU*: Ultimate SRAM expansion. This is actually done by a small + daughterboard, not directly in the Gate Array. + out: RAMEN*: SRAM out: ROMEN*: EPROM out: AB0, AB1, AB2: Mapped address bits (2^15, 2^14, 2^13) @@ -145,9 +148,9 @@ 1 0111 110. .... .... .... address block cxxx 1 0111 111. .... .... .... address block exxx - 1 1... .... .... .... .... on-board bus or external bus (unclear) - 1 10.. .... .... .... .... Future expansion - 1 1100 .... .... .... .... Future expansion + 1 1... .... .... .... .... on-board bus + 1 10.. .... .... .... .... Future expansion (Ultimate SRAM expansion) + 1 1100 .... .... .... .... Future expansion (Ultimate SRAM expansion) 1 1101 0... .... .... .... on-board sram (32K) - Optional 32 KiB expansion, 0 WS 1 1101 1... .... .... .... on-board sram (32K) - stock 32 KiB SRAM, 0 WS @@ -738,8 +741,8 @@ const geneve_gate_array_device::physentry_t geneve_gate_array_device::s_physmap[ { { 0x00, 0x3f, MPDRAM, "DRAM" }, { 0x40, 0x3f, MPEXP, "Future exp (on-board)" }, - { 0xc0, 0x1f, MPSRAMF, "Future SRAM exp" }, - { 0xe0, 0x07, MPSRAMF, "Future SRAM exp" }, + { 0xc0, 0x1f, MPSRAMU, "Ultimate SRAM exp" }, + { 0xe0, 0x07, MPSRAMU, "Ultimate SRAM exp" }, { 0xe8, 0x03, MPSRAMX, "SRAM exp" }, { 0xec, 0x03, MPSRAM, "SRAM" }, { 0xf0, 0x0f, MPEPROM, "Boot ROM/PFM" }, @@ -816,7 +819,7 @@ bool geneve_gate_array_device::accessing_dram_s(int function) bool geneve_gate_array_device::accessing_sram_s(int function) { - return (function == MPSRAM) || (function == MPSRAMX) || (function == MPSRAMF); + return (function == MPSRAM) || (function == MPSRAMX) || (function == MPSRAMU); } bool geneve_gate_array_device::accessing_devs_s(int function) @@ -953,6 +956,12 @@ int geneve_gate_array_device::ramenx_out() return (dec->function == MPSRAMX)? ASSERT_LINE : CLEAR_LINE; } +int geneve_gate_array_device::ramenu_out() +{ + decdata* dec = (m_debug)? &m_decdebug : &m_decoded; + return (dec->function == MPSRAMU)? ASSERT_LINE : CLEAR_LINE; +} + int geneve_gate_array_device::rtcen_out() { decdata* dec = (m_debug)? &m_decdebug : &m_decoded; diff --git a/src/devices/bus/ti99/internal/genboard.h b/src/devices/bus/ti99/internal/genboard.h index 754887b09b203..bf9f3ef4c27bd 100644 --- a/src/devices/bus/ti99/internal/genboard.h +++ b/src/devices/bus/ti99/internal/genboard.h @@ -81,9 +81,12 @@ class geneve_gate_array_device : public device_t int csr_out(); int csw_out(); int rtcen_out(); - int romen_out(); - int ramen_out(); - int ramenx_out(); + + int romen_out(); // Boot EPROM access + int ramen_out(); // Stock SRAM access + int ramenx_out(); // 32K expanded SRAM access + int ramenu_out(); // Full 384K SRAM access + int snden_out(); int dben_out(); int gaready_out(); @@ -154,7 +157,7 @@ class geneve_gate_array_device : public device_t MPEPROM, MPSRAM, MPSRAMX, - MPSRAMF, + MPSRAMU, MBOX, CARTPROT diff --git a/src/devices/bus/ti99/internal/ioport.cpp b/src/devices/bus/ti99/internal/ioport.cpp index 25252569e6d32..43d083c579755 100644 --- a/src/devices/bus/ti99/internal/ioport.cpp +++ b/src/devices/bus/ti99/internal/ioport.cpp @@ -78,7 +78,10 @@ #include "emu.h" #include "ioport.h" +#include "splitter.h" #include "bus/ti99/peb/peribox.h" +#include "bus/ti99/sidecar/arcturus.h" +#include "bus/ti99/sidecar/speechsyn.h" DEFINE_DEVICE_TYPE(TI99_IOPORT, bus::ti99::internal::ioport_device, "ti99_ioport", "TI-99 I/O Port") @@ -147,6 +150,12 @@ void ioport_device::reset_in(int state) m_connected->reset_in(state); } +void ioport_device::sbe(int state) +{ + if (m_connected != nullptr) + m_connected->sbe(state); +} + void ioport_device::device_start() { if (m_connected != nullptr) @@ -174,9 +183,23 @@ void ioport_attached_device::set_ready(int state) void ti99_ioport_options_plain(device_slot_interface &device) { device.option_add("peb", TI99_PERIBOX); + device.option_add("splitter", TI99_IOSPLIT); + device.option_add("arcturus", TI99_ARCTURUS); + device.option_add("speechsyn", TI99_SPEECHSYN); } void ti99_ioport_options_evpc(device_slot_interface &device) { device.option_add("peb", TI99_PERIBOX_EV); + device.option_add("splitter", TI99_IOSPLIT); + device.option_add("arcturus", TI99_ARCTURUS); + device.option_add("speechsyn", TI99_SPEECHSYN); +} + +// Used for the splitter (to avoid getting multiple EVPCs in the system) +void ti99_ioport_options_evpc1(device_slot_interface &device) +{ + device.option_add("peb", TI99_PERIBOX_EV1); + device.option_add("splitter", TI99_IOSPLIT); + device.option_add("arcturus", TI99_ARCTURUS); } diff --git a/src/devices/bus/ti99/internal/ioport.h b/src/devices/bus/ti99/internal/ioport.h index 39dcd95549236..0da1d977621ba 100644 --- a/src/devices/bus/ti99/internal/ioport.h +++ b/src/devices/bus/ti99/internal/ioport.h @@ -38,6 +38,7 @@ class ioport_attached_device : public device_t virtual void msast_in(int state) { } virtual void clock_in(int state) { } virtual void reset_in(int state) { } + virtual void sbe(int state) { } void set_ioport(ioport_device* ioport) { m_ioport = ioport; } @@ -80,6 +81,7 @@ class ioport_device : public device_t, public device_single_card_slot_interface< void msast_in(int state); void clock_in(int state); void reset_in(int state); + void sbe(int state); // Callbacks auto extint_cb() { return m_console_extint.bind(); } @@ -103,5 +105,6 @@ DECLARE_DEVICE_TYPE_NS(TI99_IOPORT, bus::ti99::internal, ioport_device) void ti99_ioport_options_plain(device_slot_interface &device); void ti99_ioport_options_evpc(device_slot_interface &device); +void ti99_ioport_options_evpc1(device_slot_interface &device); #endif /* __TI99IOPORT__ */ diff --git a/src/devices/bus/ti99/internal/splitter.cpp b/src/devices/bus/ti99/internal/splitter.cpp new file mode 100644 index 0000000000000..404bd04d0c6b5 --- /dev/null +++ b/src/devices/bus/ti99/internal/splitter.cpp @@ -0,0 +1,190 @@ +// license:LGPL-2.1+ +// copyright-holders:Michael Zapf +/**************************************************************************** + I/O port splitter + + The I/O port splitter connects to the TI-99/4(A) console at its I/O port + and provides two I/O ports. That way, two Peripheral Expansion boxes or + one PEB and a sidecar chain may be connected. + + | Port 2 + v + +---+ + +----------------+ | | + | TI-99/4(A) |---+ +--+ + +------------+---+ Splitter | <-- Port 1 + | oooooooooo | |----------+ + | oooooooooo | | + +----------------- + + The splitter was designed 2015 by Jim Fetzner (as Tekumel Software) + + March 2025, Michael Zapf + +*****************************************************************************/ + +#include "emu.h" +#include "ioport.h" +#include "splitter.h" +#include "bus/ti99/peb/peribox.h" + +#define LOG_WARN (1U << 1) // Warnings +#define LOG_CONFIG (1U << 2) // Configuration +#define LOG_INT (1U << 3) +#define LOG_READY (1U << 4) + +// #define VERBOSE (LOG_CONFIG | LOG_WARN) + +#include "logmacro.h" + +DEFINE_DEVICE_TYPE(TI99_IOSPLIT, bus::ti99::internal::ioport_splitter_device, "ti99_iosplit", "TI-99 I/O Port Splitter") + +namespace bus::ti99::internal { + +#define PORT1 "port1" +#define PORT2 "port2" + +ioport_splitter_device::ioport_splitter_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) + : ioport_attached_device(mconfig, type, tag, owner, clock), + m_port1(*this, PORT1), + m_port2(*this, PORT2) +{ +} + +ioport_splitter_device::ioport_splitter_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : ioport_splitter_device(mconfig, TI99_IOSPLIT, tag, owner, clock) +{ +} + +void ioport_splitter_device::readz(offs_t offset, uint8_t *value) +{ + // With a proper configuration, only one device on one of the branches + // will respond. + if (m_port1 != nullptr) + m_port1->readz(offset, value); + + if (m_port2 != nullptr) + m_port2->readz(offset, value); +} + +void ioport_splitter_device::write(offs_t offset, uint8_t data) +{ + if (m_port1 != nullptr) + m_port1->write(offset, data); + + if (m_port2 != nullptr) + m_port2->write(offset, data); +} + +void ioport_splitter_device::setaddress_dbin(offs_t offset, int state) +{ + if (m_port1 != nullptr) + m_port1->setaddress_dbin(offset, state); + + if (m_port2 != nullptr) + m_port2->setaddress_dbin(offset, state); +} + +void ioport_splitter_device::crureadz(offs_t offset, uint8_t *value) +{ + if (m_port1 != nullptr) + m_port1->crureadz(offset, value); + + if (m_port2 != nullptr) + m_port2->crureadz(offset, value); +} + +void ioport_splitter_device::cruwrite(offs_t offset, uint8_t data) +{ + if (m_port1 != nullptr) + m_port1->cruwrite(offset, data); + + if (m_port2 != nullptr) + m_port2->cruwrite(offset, data); +} + +void ioport_splitter_device::memen_in(int state) +{ + if (m_port1 != nullptr) + m_port1->memen_in(state); + + if (m_port2 != nullptr) + m_port2->memen_in(state); +} + +void ioport_splitter_device::msast_in(int state) +{ + if (m_port1 != nullptr) + m_port1->msast_in(state); + + if (m_port2 != nullptr) + m_port2->msast_in(state); +} + +void ioport_splitter_device::clock_in(int state) +{ + if (m_port1 != nullptr) + m_port1->clock_in(state); + + if (m_port2 != nullptr) + m_port2->clock_in(state); +} + +void ioport_splitter_device::reset_in(int state) +{ + if (m_port1 != nullptr) + m_port1->reset_in(state); + + if (m_port2 != nullptr) + m_port2->reset_in(state); +} + +template +void ioport_splitter_device::extint(int state) +{ + LOGMASKED(LOG_INT, "propagating INTA from port %d to console: %d\n", port, state); + if (state==ASSERT_LINE) + m_inta_flag |= port; // 1 or 2 + else + m_inta_flag &= ~port; // 1 or 2 + + set_extint((m_inta_flag != 0)? ASSERT_LINE : CLEAR_LINE); +} + +template +void ioport_splitter_device::ready(int state) +{ + LOGMASKED(LOG_READY, "Incoming READY=%d from port %d\n", state, port); + // We store the inverse state + if (state==CLEAR_LINE) + m_ready_flag |= port; // 1 or 2 + else + m_ready_flag &= ~port; // 1 or 2 + + set_ready((m_ready_flag != 0)? CLEAR_LINE : ASSERT_LINE); +} + +void ioport_splitter_device::device_start() +{ + LOG("Starting I/O Port Splitter\n"); +} + + +void ioport_splitter_device::device_config_complete() +{ + m_inta_flag = 0; + m_ready_flag = 0; +} + +void ioport_splitter_device::device_add_mconfig(machine_config &config) +{ + TI99_IOPORT(config, m_port1, 1, ti99_ioport_options_evpc1, nullptr); + TI99_IOPORT(config, m_port2, 2, ti99_ioport_options_evpc1, nullptr); + + m_port1->extint_cb().set(FUNC(ioport_splitter_device::extint<1>)); + m_port2->extint_cb().set(FUNC(ioport_splitter_device::extint<2>)); + m_port1->ready_cb().set(FUNC(ioport_splitter_device::ready<1>)); + m_port2->ready_cb().set(FUNC(ioport_splitter_device::ready<2>)); +} + +} // end namespace bus::ti99::internal diff --git a/src/devices/bus/ti99/internal/splitter.h b/src/devices/bus/ti99/internal/splitter.h new file mode 100644 index 0000000000000..c12fac3648fe2 --- /dev/null +++ b/src/devices/bus/ti99/internal/splitter.h @@ -0,0 +1,65 @@ +// license:LGPL-2.1+ +// copyright-holders:Michael Zapf +/**************************************************************************** + + I/O port splitter + + This plugs into the I/O port of the console as an + ioport_attached_device, and it offers two new I/O ports. + +*****************************************************************************/ + +#ifndef MAME_BUS_TI99_INTERNAL_SPLITTER_H +#define MAME_BUS_TI99_INTERNAL_SPLITTER_H + +#pragma once + +#include "ioport.h" + +namespace bus::ti99::internal { + +class ioport_splitter_device : public ioport_attached_device +{ + +public: + ioport_splitter_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + + // Next methods are called from the console + void readz(offs_t offset, uint8_t *value) override; + void write(offs_t offset, uint8_t data) override; + void setaddress_dbin(offs_t offset, int state) override; + + void crureadz(offs_t offset, uint8_t *value) override; + void cruwrite(offs_t offset, uint8_t data) override; + + void memen_in(int state) override; + void msast_in(int state) override; + + void clock_in(int state) override; + void reset_in(int state) override; + +protected: + ioport_splitter_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); + + virtual void device_start() override ATTR_COLD; + virtual void device_config_complete() override; + + virtual void device_add_mconfig(machine_config &config) override ATTR_COLD; + + // Callbacks from the two ports + template void extint(int state); + template void ready(int state); + + int m_inta_flag; + int m_ready_flag; + +private: + required_device m_port1; + required_device m_port2; +}; + +} // end namespace bus::ti99::internal + +DECLARE_DEVICE_TYPE_NS(TI99_IOSPLIT, bus::ti99::internal, ioport_splitter_device) + +#endif /* MAME_BUS_TI99_INTERNAL_SPLITTER_H */ diff --git a/src/devices/bus/ti99/peb/peribox.cpp b/src/devices/bus/ti99/peb/peribox.cpp index 4df80e153d528..55de5eccc2cc8 100644 --- a/src/devices/bus/ti99/peb/peribox.cpp +++ b/src/devices/bus/ti99/peb/peribox.cpp @@ -192,7 +192,7 @@ CRUCLK* 51||52 DBIN #include "evpc.h" #include "hsgpl.h" #include "ti_rs232.h" -#include "spchsyn.h" +#include "speechadapter.h" #include "memex.h" #include "horizon.h" #include "forti.h" @@ -216,7 +216,10 @@ CRUCLK* 51||52 DBIN DEFINE_DEVICE_TYPE(TI99_PERIBOX, bus::ti99::peb::peribox_device, "peribox", "Peripheral expansion box") // Peripheral box which has a EVPC card in slot 2 (for use with the ti99_4ev) -DEFINE_DEVICE_TYPE(TI99_PERIBOX_EV, bus::ti99::peb::peribox_ev_device, "peribox_ev", "Peripheral expansion box with EVPC") +DEFINE_DEVICE_TYPE(TI99_PERIBOX_EV, bus::ti99::peb::peribox_ev_device, "peribox_ev", "Peripheral expansion box with EVPC inserted") + +// Peripheral box with EVPC (for use with the ti99_4ev with the port splitter) +DEFINE_DEVICE_TYPE(TI99_PERIBOX_EV1, bus::ti99::peb::peribox_ev1_device, "peribox_ev1", "Peripheral expansion box with EVPC") // Peripheral box which hosts the SGCPU card in slot 1 DEFINE_DEVICE_TYPE(TI99_PERIBOX_SG, bus::ti99::peb::peribox_sg_device, "peribox_sg", "Peripheral expansion box SGCPU") @@ -476,31 +479,54 @@ void peribox_device::device_config_complete() m_ready_flag = 0; } -void ti99_peribox_slot_standard(device_slot_interface &device) +// Slot options that work with TI-99/4A (with and without EVPC), SGCPU, Geneve, +// and TI-99/8 (untested) +void peribox_common_slots(device_slot_interface &device) { - device.option_add("32kmem", TI99_32KMEM); - device.option_add("myarcmem", TI99_MYARCMEM); - device.option_add("samsmem", TI99_SAMSMEM); - device.option_add("pcode", TI99_P_CODE); - device.option_add("hsgpl", TI99_HSGPL); device.option_add("tirs232", TI99_RS232); - device.option_add("speech", TI99_SPEECH); + device.option_add("speechadapter", TI99_SPEECHADAPTER); device.option_add("horizon", TI99_HORIZON); - device.option_add("pgram", TI99_PGRAM); device.option_add("ide", TI99_IDE); device.option_add("usbsm", TI99_USBSM); - device.option_add("bwg", TI99_BWG); device.option_add("hfdc", TI99_HFDC); device.option_add("tifdc", TI99_FDC); device.option_add("ccdcc", TI99_CCDCC); device.option_add("ccfdc", TI99_CCFDC); device.option_add("ddcc1", TI99_DDCC1); device.option_add("forti", TI99_FORTI); - device.option_add("sidmaster", TI99_SIDMASTER); device.option_add("whtscsi", TI99_WHTSCSI); device.option_add("tipi", TI99_TIPI); } +// Slot options for TI-99/4A with or without EVPC and SGCPU +// The BwG controller will not run with the Geneve due to its wait state +// logic (see bwg.cpp) +// The SID master card may have trouble with the Geneve because of its CRU +// handling (see sidmaster.cpp) +void peribox_ti99_slots(device_slot_interface &device) +{ + device.option_add("myarcmem", TI99_MYARCMEM); + device.option_add("samsmem", TI99_SAMSMEM); + device.option_add("pcode", TI99_P_CODE); + device.option_add("hsgpl", TI99_HSGPL); + device.option_add("bwg", TI99_BWG); + device.option_add("sidmaster", TI99_SIDMASTER); + peribox_common_slots(device); +} + +// Geneve and SGCPU do not work with these memory expansions +void peribox_std_slots(device_slot_interface &device) +{ + device.option_add("32kmem", TI99_32KMEM); + device.option_add("pgram", TI99_PGRAM); + peribox_ti99_slots(device); +} + +void ti99_peribox_slot_standard(device_slot_interface &device) +{ + peribox_std_slots(device); +} + void peribox_device::device_add_mconfig(machine_config &config) { TI99_PERIBOX_SLOT(config, m_slot2, 2, ti99_peribox_slot_standard, nullptr); @@ -524,28 +550,8 @@ peribox_ev_device::peribox_ev_device(const machine_config &mconfig, const char * void ti99_peribox_slot_evpc(device_slot_interface &device) { - device.option_add("evpc", TI99_EVPC); - device.option_add("32kmem", TI99_32KMEM); - device.option_add("myarcmem", TI99_MYARCMEM); - device.option_add("samsmem", TI99_SAMSMEM); - device.option_add("pcode", TI99_P_CODE); - device.option_add("hsgpl", TI99_HSGPL); - device.option_add("tirs232", TI99_RS232); - device.option_add("speech", TI99_SPEECH); - device.option_add("horizon", TI99_HORIZON); - device.option_add("pgram", TI99_PGRAM); - device.option_add("ide", TI99_IDE); - device.option_add("usbsm", TI99_USBSM); - device.option_add("bwg", TI99_BWG); - device.option_add("hfdc", TI99_HFDC); - device.option_add("tifdc", TI99_FDC); - device.option_add("ccdcc", TI99_CCDCC); - device.option_add("ccfdc", TI99_CCFDC); - device.option_add("ddcc1", TI99_DDCC1); - device.option_add("forti", TI99_FORTI); - device.option_add("sidmaster", TI99_SIDMASTER); - device.option_add("whtscsi", TI99_WHTSCSI); - device.option_add("tipi", TI99_TIPI); + device.option_add("evpc", TI99_EVPC); + peribox_std_slots(device); } void peribox_ev_device::device_add_mconfig(machine_config &config) @@ -559,6 +565,28 @@ void peribox_ev_device::device_add_mconfig(machine_config &config) TI99_PERIBOX_SLOT(config, m_slot8, 8, ti99_peribox_slot_evpc, nullptr); } +/**************************************************************************** + A variant of the box used for the TI-99/4A with EVPC, not inserted +*****************************************************************************/ + +peribox_ev1_device::peribox_ev1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : peribox_device(mconfig, TI99_PERIBOX_EV1, tag, owner, clock) +{ + m_address_prefix = 0x70000; +} + +void peribox_ev1_device::device_add_mconfig(machine_config &config) +{ + TI99_PERIBOX_SLOT(config, m_slot2, 2, ti99_peribox_slot_evpc, nullptr); + TI99_PERIBOX_SLOT(config, m_slot3, 3, ti99_peribox_slot_evpc, nullptr); + TI99_PERIBOX_SLOT(config, m_slot4, 4, ti99_peribox_slot_evpc, nullptr); + TI99_PERIBOX_SLOT(config, m_slot5, 5, ti99_peribox_slot_evpc, nullptr); + TI99_PERIBOX_SLOT(config, m_slot6, 6, ti99_peribox_slot_evpc, nullptr); + TI99_PERIBOX_SLOT(config, m_slot7, 7, ti99_peribox_slot_evpc, nullptr); + TI99_PERIBOX_SLOT(config, m_slot8, 8, ti99_peribox_slot_evpc, nullptr); +} + + /**************************************************************************** A variant of the box used for the Geneve. *****************************************************************************/ @@ -582,28 +610,11 @@ peribox_genmod_device::peribox_genmod_device(const machine_config &mconfig, cons { } -// The BwG controller will not run with the Geneve due to its wait state -// logic (see bwg.cpp) -// The SID master card may have trouble with the Geneve because of its CRU -// handling (see sidmaster.cpp) - +// All common slot options plus Memex. void ti99_peribox_slot_geneve(device_slot_interface &device) { - device.option_add("memex", TI99_MEMEX); - device.option_add("tirs232", TI99_RS232); - device.option_add("speech", TI99_SPEECH); - device.option_add("horizon", TI99_HORIZON); - device.option_add("ide", TI99_IDE); - device.option_add("usbsm", TI99_USBSM); - device.option_add("hfdc", TI99_HFDC); - device.option_add("tifdc", TI99_FDC); - device.option_add("ccdcc", TI99_CCDCC); - device.option_add("ccfdc", TI99_CCFDC); - device.option_add("ddcc1", TI99_DDCC1); - device.option_add("forti", TI99_FORTI); - device.option_add("sidmaster", TI99_SIDMASTER); - device.option_add("whtscsi", TI99_WHTSCSI); - device.option_add("tipi", TI99_TIPI); + device.option_add("memex", TI99_MEMEX); + peribox_common_slots(device); } void peribox_gen_device::device_add_mconfig(machine_config &config) @@ -642,26 +653,8 @@ peribox_sg_device::peribox_sg_device(const machine_config &mconfig, const char * void ti99_peribox_slot_sgcpu(device_slot_interface &device) { - device.option_add("evpc", TI99_EVPC); - device.option_add("myarcmem", TI99_MYARCMEM); - device.option_add("samsmem", TI99_SAMSMEM); - device.option_add("pcode", TI99_P_CODE); - device.option_add("hsgpl", TI99_HSGPL); - device.option_add("tirs232", TI99_RS232); - device.option_add("speech", TI99_SPEECH); - device.option_add("horizon", TI99_HORIZON); - device.option_add("ide", TI99_IDE); - device.option_add("usbsm", TI99_USBSM); - device.option_add("bwg", TI99_BWG); - device.option_add("hfdc", TI99_HFDC); - device.option_add("tifdc", TI99_FDC); - device.option_add("ccdcc", TI99_CCDCC); - device.option_add("ccfdc", TI99_CCFDC); - device.option_add("ddcc1", TI99_DDCC1); - device.option_add("forti", TI99_FORTI); - device.option_add("sidmaster", TI99_SIDMASTER); - device.option_add("whtscsi", TI99_WHTSCSI); - device.option_add("tipi", TI99_TIPI); + device.option_add("evpc", TI99_EVPC); + peribox_ti99_slots(device); } void peribox_sg_device::device_add_mconfig(machine_config &config) diff --git a/src/devices/bus/ti99/peb/peribox.h b/src/devices/bus/ti99/peb/peribox.h index ef33b9e59453e..7d9c0b6f9e91e 100644 --- a/src/devices/bus/ti99/peb/peribox.h +++ b/src/devices/bus/ti99/peb/peribox.h @@ -140,6 +140,18 @@ class peribox_ev_device : public peribox_device virtual void device_add_mconfig(machine_config &config) override ATTR_COLD; }; +/* + Variation for ti99_4ev without EVPC inserted +*/ +class peribox_ev1_device : public peribox_device +{ +public: + peribox_ev1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + +protected: + virtual void device_add_mconfig(machine_config &config) override ATTR_COLD; +}; + /* Variation for Geneve. @@ -266,6 +278,7 @@ class peribox_slot_device : public device_t, public device_single_card_slot_inte DECLARE_DEVICE_TYPE_NS(TI99_PERIBOX, bus::ti99::peb, peribox_device) DECLARE_DEVICE_TYPE_NS(TI99_PERIBOX_EV, bus::ti99::peb, peribox_ev_device) +DECLARE_DEVICE_TYPE_NS(TI99_PERIBOX_EV1, bus::ti99::peb, peribox_ev1_device) DECLARE_DEVICE_TYPE_NS(TI99_PERIBOX_SLOT, bus::ti99::peb, peribox_slot_device) DECLARE_DEVICE_TYPE_NS(TI99_PERIBOX_SG, bus::ti99::peb, peribox_sg_device) DECLARE_DEVICE_TYPE_NS(TI99_PERIBOX_GEN, bus::ti99::peb, peribox_gen_device) diff --git a/src/devices/bus/ti99/peb/spchsyn.cpp b/src/devices/bus/ti99/peb/spchsyn.cpp deleted file mode 100644 index 8639f4ffa43a9..0000000000000 --- a/src/devices/bus/ti99/peb/spchsyn.cpp +++ /dev/null @@ -1,193 +0,0 @@ -// license:LGPL-2.1+ -// copyright-holders:Michael Zapf -/**************************************************************************** - - TI-99 Speech synthesizer - - We emulate the Speech Synthesizer plugged onto a P-Box adapter. The original - Speech Synthesizer device was provided as a box to be plugged into the - right side of the console. In order to be used with Geneve and SGCPU, the - speech synthesizer must be moved into the Peripheral Box. - - The Speech Synthesizer used for the TI was the CD2501E, AKA TMS5200, - (internal name TMC0285), a predecessor of the TMS5220 which was used in - other commercial products. - - Note that this adapter also contains the speech roms. - - Michael Zapf - - February 2012: Rewritten as class - -*****************************************************************************/ - -#include "emu.h" -#include "spchsyn.h" - -#include "machine/spchrom.h" -#include "speaker.h" - -#define LOG_WARN (1U << 1) // Warnings -#define LOG_CONFIG (1U << 2) -#define LOG_MEM (1U << 3) -#define LOG_ADDR (1U << 4) -#define LOG_READY (1U << 5) - -#define VERBOSE (LOG_CONFIG | LOG_WARN) -#include "logmacro.h" - -DEFINE_DEVICE_TYPE(TI99_SPEECH, bus::ti99::peb::ti_speech_synthesizer_device, "ti99_speech", "TI-99 Speech synthesizer (on adapter card)") - -namespace bus::ti99::peb { - -/****************************************************************************/ - -ti_speech_synthesizer_device::ti_speech_synthesizer_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : - device_t(mconfig, TI99_SPEECH, tag, owner, clock), - device_ti99_peribox_card_interface(mconfig, *this), - m_vsp(*this, "vsp"), - m_reading(false), - m_sbe(false), - m_dec_high(false) -{ -} - -/* - Memory read -*/ - -void ti_speech_synthesizer_device::readz(offs_t offset, uint8_t *value) -{ - if (machine().side_effects_disabled()) return; - - if (m_sbe) - { - *value = m_vsp->status_r() & 0xff; - LOGMASKED(LOG_MEM, "read value = %02x\n", *value); - // We should clear the lines at this point. The TI-99/4A clears the - // lines by setting the address bus to a different value, but the - // Geneve may behave differently. This may not 100% reflect the real - // situation, but it ensures a safe processing. - m_vsp->combined_rsq_wsq_w(~0); - } -} - -/* - Memory write -*/ -void ti_speech_synthesizer_device::write(offs_t offset, uint8_t data) -{ - if (machine().side_effects_disabled()) return; - - if (m_sbe) - { - LOGMASKED(LOG_MEM, "write value = %02x\n", data); - m_vsp->data_w(data); - // Note that we must NOT clear the lines here. Find the lines in the - // READY callback below. - } -} - -void ti_speech_synthesizer_device::setaddress_dbin(offs_t offset, int state) -{ - // 1001 00xx xxxx xxx0 DBIN=1 - // 1001 01xx xxxx xxx0 DBIN=0 - // 1111 1000 0000 0001 mask - m_reading = (state==ASSERT_LINE); - - bool valid = (((offset & 0x0400)==0) == m_reading); - - if (m_dec_high) - m_sbe = ((offset & 0x7f801)==0x79000) && valid; - else - m_sbe = ((offset & 0x0f801)==0x09000) && valid; - - if (m_sbe) - { - LOGMASKED(LOG_ADDR, "set address = %04x, dbin = %d\n", offset, state); - - // Caution: In the current tms5220 emulation, care must be taken - // to clear one line before asserting the other line, or otherwise - // both RS* and WS* are active, which is illegal. - // Alternatively, we'll use the combined settings method - - m_vsp->combined_rsq_wsq_w(m_reading ? ~tms5220_device::RS : ~tms5220_device::WS); - } - else - // If other address, turn off RS* and WS* (negative logic!) - m_vsp->combined_rsq_wsq_w(~0); -} - -/****************************************************************************/ - -void ti_speech_synthesizer_device::speech_ready(int state) -{ - // The TMS5200 implementation uses true/false, not ASSERT/CLEAR semantics - // and we have to adapt a /READY to a READY line. - // The real synthesizer board uses a transistor for that purpose. - m_slot->set_ready((state==0)? ASSERT_LINE : CLEAR_LINE); - LOGMASKED(LOG_READY, "READY = %d\n", (state==0)); - - if ((state==0) && !m_reading) - // Clear the lines only when we are done with writing. - m_vsp->combined_rsq_wsq_w(~0); -} - -void ti_speech_synthesizer_device::device_start() -{ - save_item(NAME(m_reading)); - save_item(NAME(m_sbe)); -} - -void ti_speech_synthesizer_device::device_reset() -{ - m_reading = false; - m_sbe = false; - m_dec_high = (ioport("AMADECODE")->read()!=0); -} - -ROM_START( ti99_speech ) - ROM_REGION(0x8000, "vsm", 0) - ROM_LOAD("cd2325a.u2a", 0x0000, 0x4000, CRC(1f58b571) SHA1(0ef4f178716b575a1c0c970c56af8a8d97561ffe)) // at location u2, bottom of stack - ROM_LOAD("cd2326a.u2b", 0x4000, 0x4000, CRC(65d00401) SHA1(a367242c2c96cebf0e2bf21862f3f6734b2b3020)) // at location u2, top of stack -ROM_END - -void ti_speech_synthesizer_device::device_add_mconfig(machine_config& config) -{ - SPEECHROM(config, "vsm", 0).set_reverse_bit_order(true); - SPEAKER(config, "speech_out").front_center(); - CD2501E(config, m_vsp, 640000L); - m_vsp->set_speechrom_tag("vsm"); - m_vsp->ready_cb().set(FUNC(ti_speech_synthesizer_device::speech_ready)); - m_vsp->add_route(ALL_OUTPUTS, "speech_out", 0.50); - -/* - // FIXME: Make it work. Guess we need two VSM circuits @16K. - TMS6100(config, "vsm", 640_kHz_XTAL/4); - m_vsp->m0_cb().set("vsm", FUNC(tms6100_device::m0_w)); - m_vsp->m1_cb().set("vsm", FUNC(tms6100_device::m1_w)); - m_vsp->addr_cb().set("vsm", FUNC(tms6100_device::add_w)); - m_vsp->data_cb().set("vsm", FUNC(tms6100_device::data_line_r)); - m_vsp->romclk_cb().set("vsm", FUNC(tms6100_device::clk_w)); -*/ -} - -INPUT_PORTS_START( ti99_speech ) - PORT_START( "AMADECODE" ) - PORT_CONFNAME( 0x01, 0x01, "Decode AMA/AMB/AMC lines" ) - PORT_CONFSETTING( 0x00, DEF_STR( Off )) - PORT_CONFSETTING( 0x01, DEF_STR( On )) -INPUT_PORTS_END - -ioport_constructor ti_speech_synthesizer_device::device_input_ports() const -{ - return INPUT_PORTS_NAME(ti99_speech); -} - -const tiny_rom_entry *ti_speech_synthesizer_device::device_rom_region() const -{ - return ROM_NAME( ti99_speech ); -} - -} // end namespace bus::ti99::peb - diff --git a/src/devices/bus/ti99/peb/spchsyn.h b/src/devices/bus/ti99/peb/spchsyn.h deleted file mode 100644 index ff9c3f237e65a..0000000000000 --- a/src/devices/bus/ti99/peb/spchsyn.h +++ /dev/null @@ -1,55 +0,0 @@ -// license:LGPL-2.1+ -// copyright-holders:Michael Zapf -/**************************************************************************** - - TI-99 Speech Synthesizer - See spchsyn.c for documentation - - Michael Zapf, October 2010 - February 2012: Rewritten as class - -*****************************************************************************/ - -#ifndef MAME_BUS_TI99_PEB_SPCHSYN_H -#define MAME_BUS_TI99_PEB_SPCHSYN_H - -#pragma once - -#include "peribox.h" -#include "sound/tms5220.h" -#include "machine/tms6100.h" - -namespace bus::ti99::peb { - -class ti_speech_synthesizer_device : public device_t, public device_ti99_peribox_card_interface -{ -public: - ti_speech_synthesizer_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - void readz(offs_t offset, uint8_t *value) override; - void write(offs_t offset, uint8_t data) override; - void setaddress_dbin(offs_t offset, int state) override; - - void crureadz(offs_t offset, uint8_t *value) override { } - void cruwrite(offs_t offset, uint8_t data) override { } - -protected: - virtual void device_start() override; - virtual void device_reset() override; - virtual const tiny_rom_entry *device_rom_region() const override ATTR_COLD; - virtual void device_add_mconfig(machine_config &config) override ATTR_COLD; - virtual ioport_constructor device_input_ports() const override ATTR_COLD; - -private: - void speech_ready(int state); - - required_device m_vsp; - bool m_reading; - bool m_sbe; // Signal "Speech block enable" - bool m_dec_high; // Decode the AMA/AMB/ABC address lines -}; - -} // end namespace bus::ti99::peb - -DECLARE_DEVICE_TYPE_NS(TI99_SPEECH, bus::ti99::peb, ti_speech_synthesizer_device) - -#endif // MAME_BUS_TI99_PEB_SPCHSYN_H diff --git a/src/devices/bus/ti99/peb/speechadapter.cpp b/src/devices/bus/ti99/peb/speechadapter.cpp new file mode 100644 index 0000000000000..2bf237c29781f --- /dev/null +++ b/src/devices/bus/ti99/peb/speechadapter.cpp @@ -0,0 +1,158 @@ +// license:LGPL-2.1+ +// copyright-holders:Michael Zapf +/**************************************************************************** + + TI-99 Speech synthesizer adapter device + + This adapter card made the sidecar Speech Synthesizer unit available to + systems without a TI-99/4A console, like the SGCPU and the Geneve. The + board must be removed from the sidecar unit and plugged on this simple + adapter board, which is then put in a slot of the Peripheral Expansion Box. + + +-------+ + +-----|-------|---+ + | Speech syn | + | board | + | _________ | + +-----+++++++++---+ + +----------------------------+|||||||+------------+ + | ------- | + | Adapter board | + | | + (((o LED PEB slot connector | + +--------------|||||||||||||||||||||||||----------+ + ||||||||||||||||||||||||| + + Technical detail: + + The SBE signal (Speech Block Enable), which is generated in the TI console, + is not forwarded to the PEB. One of the tasks of this board is thus to + decode the mapped addresses once more and to activate the synthesizer + accordingly. + + A second issue for Geneve users is that the address extension bits (AMA, + AMB, AMC) need to be decoded as well to avoid the synthesizer interfering + with other memory access. This can be activated in the configuration. The + default is on. + + Michael Zapf + March 2025 + +*****************************************************************************/ + +#include "emu.h" +#include "speechadapter.h" + +#include "speaker.h" +#include "bus/ti99/sidecar/speechsyn.h" + +#define LOG_WARN (1U << 1) // Warnings +#define LOG_CONFIG (1U << 2) +#define LOG_MEM (1U << 3) +#define LOG_ADDR (1U << 4) +#define LOG_READY (1U << 5) + +#define VERBOSE (LOG_CONFIG | LOG_WARN) +#include "logmacro.h" + +DEFINE_DEVICE_TYPE(TI99_SPEECHADAPTER, bus::ti99::peb::ti_speechsyn_adapter_device, "ti99_speechconn", "TI-99 Speech synthesizer adapter card") + +namespace bus::ti99::peb { + +#define PORT "conn" + +/****************************************************************************/ + +ti_speechsyn_adapter_device::ti_speechsyn_adapter_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : + device_t(mconfig, TI99_SPEECHADAPTER, tag, owner, clock), + device_ti99_peribox_card_interface(mconfig, *this), + m_port(*this, PORT), + m_dec_high(false) +{ +} + +void ti_speechsyn_adapter_device::readz(offs_t offset, uint8_t *value) +{ + if (m_port != nullptr) + { + LOGMASKED(LOG_MEM, "read %06x\n", offset); + m_port->readz(offset, value); + } +} + +void ti_speechsyn_adapter_device::write(offs_t offset, uint8_t data) +{ + if (m_port != nullptr) + { + LOGMASKED(LOG_MEM, "write %06x\n", offset); + m_port->write(offset, data); + } +} + +void ti_speechsyn_adapter_device::setaddress_dbin(offs_t offset, int state) +{ + // Valid access = not(DBIN and A5) + bool reading = (state==ASSERT_LINE); + + // An access is valid when reading from 9000 and writing to 9400. + bool valid = (((offset & 0x0400)==0) == reading); + bool sbe = false; + + // Recreate the SBE signal that is only available at the I/O port of the console + if (m_dec_high) + // We need to decode the AMA/AMB/AMC address extension lines + sbe = ((offset & 0x7f801)==0x79000) && valid; + else + // No need to decode the extension lines + sbe = ((offset & 0x0f801)==0x09000) && valid; + + if (sbe) LOGMASKED(LOG_ADDR, "set address = %04x, dbin = %d\n", offset, state); + + if (m_port != nullptr) + { + m_port->sbe(sbe); + m_port->setaddress_dbin(offset, state); + } +} + +void ti_speechsyn_adapter_device::ready(int state) +{ + LOGMASKED(LOG_READY, "Incoming READY=%d from synthesizer %d\n", state); + m_slot->set_ready(state); +} + +void ti_speechsyn_adapter_device::device_start() +{ +} + +void ti_speechsyn_adapter_device::device_reset() +{ + m_dec_high = (ioport("AMADECODE")->read()!=0); + LOGMASKED(LOG_CONFIG, "Speech adapter%s decoding the AMA/B/C lines.\n", m_dec_high? "" : " not"); +} + +void ti_speechsyn_adapter_options(device_slot_interface &device) +{ + device.option_add("speechsyn", TI99_SPEECHSYN); +} + +void ti_speechsyn_adapter_device::device_add_mconfig(machine_config& config) +{ + TI99_IOPORT(config, m_port, 0, ti_speechsyn_adapter_options, "speechsyn"); + m_port->ready_cb().set(FUNC(ti_speechsyn_adapter_device::ready)); +} + +INPUT_PORTS_START( ti99_speechadapter ) + PORT_START( "AMADECODE" ) + PORT_CONFNAME( 0x01, 0x01, "Decode AMA/AMB/AMC lines" ) + PORT_CONFSETTING( 0x00, DEF_STR( Off )) + PORT_CONFSETTING( 0x01, DEF_STR( On )) +INPUT_PORTS_END + +ioport_constructor ti_speechsyn_adapter_device::device_input_ports() const +{ + return INPUT_PORTS_NAME(ti99_speechadapter); +} + +} // end namespace bus::ti99::peb + diff --git a/src/devices/bus/ti99/peb/speechadapter.h b/src/devices/bus/ti99/peb/speechadapter.h new file mode 100644 index 0000000000000..b77823811ca49 --- /dev/null +++ b/src/devices/bus/ti99/peb/speechadapter.h @@ -0,0 +1,49 @@ +// license:LGPL-2.1+ +// copyright-holders:Michael Zapf +/**************************************************************************** + + TI-99 Speech Synthesizer connector adapter + for the Peripheral Expansion Box + + Michael Zapf, March 2025 + +*****************************************************************************/ + +#ifndef MAME_BUS_TI99_PEB_SPEECHADAPTER_H +#define MAME_BUS_TI99_PEB_SPEECHADAPTER_H + +#pragma once + +#include "peribox.h" +#include "bus/ti99/internal/ioport.h" + +namespace bus::ti99::peb { + +class ti_speechsyn_adapter_device : public device_t, public device_ti99_peribox_card_interface +{ +public: + ti_speechsyn_adapter_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + void readz(offs_t offset, uint8_t *value) override; + void write(offs_t offset, uint8_t data) override; + void setaddress_dbin(offs_t offset, int state) override; + void crureadz(offs_t offset, uint8_t *value) override { } + void cruwrite(offs_t offset, uint8_t data) override { } + +protected: + virtual void device_start() override; + virtual void device_reset() override; + virtual void device_add_mconfig(machine_config &config) override ATTR_COLD; + virtual ioport_constructor device_input_ports() const override ATTR_COLD; + +private: + required_device m_port; + bool m_dec_high; + + void ready(int state); +}; + +} // end namespace bus::ti99::peb + +DECLARE_DEVICE_TYPE_NS(TI99_SPEECHADAPTER, bus::ti99::peb, ti_speechsyn_adapter_device) + +#endif // MAME_BUS_TI99_PEB_SPEECHADAPTER_H diff --git a/src/devices/bus/ti99/sidecar/arcturus.cpp b/src/devices/bus/ti99/sidecar/arcturus.cpp new file mode 100644 index 0000000000000..26f32f395afe7 --- /dev/null +++ b/src/devices/bus/ti99/sidecar/arcturus.cpp @@ -0,0 +1,93 @@ +// license:LGPL-2.1+ +// copyright-holders:Michael Zapf +/**************************************************************************** + + Arcturus sidecar cartridge + Michael Zapf + +*****************************************************************************/ + +#include "emu.h" +#include "arcturus.h" + +#define LOG_WARN (1U << 1) // Warnings + +// #define VERBOSE (LOG_GENERAL | LOG_WARN) + +#include "logmacro.h" + +#define TI99_CARTSC_4000 "mem4000" +#define TI99_CARTSC_A000 "mema000" +#define TI99_CARTSC_C000 "memc000" +#define TI99_CARTSC_RAM "ram" + +DEFINE_DEVICE_TYPE(TI99_ARCTURUS, bus::ti99::sidecar::arcturus_device, "ti99_arcturus", "Arcturus sidecar cartridge") + +namespace bus::ti99::sidecar { + +/* + Constructor called from subclasses. +*/ +arcturus_device::arcturus_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : bus::ti99::internal::ioport_attached_device(mconfig, TI99_ARCTURUS, tag, owner, clock), + m_ram(*this, TI99_CARTSC_RAM) +{ +} + +void arcturus_device::readz(offs_t offset, uint8_t *value) +{ + switch ((offset >> 13)&0x07) + { + case 0: + case 3: + case 4: + case 7: + break; + case 1: + *value = m_ram->pointer()[offset & 0x07ff]; + break; + case 2: + *value = m_rom4[offset & 0x1fff]; + break; + case 5: + *value = m_roma[offset & 0x1fff]; + break; + case 6: + *value = m_romc[offset & 0x1fff]; + break; + } +} + +void arcturus_device::write(offs_t offset, uint8_t data) +{ + if (((offset >> 13)&0x07)==1) + m_ram->pointer()[offset & 0x07ff] = data; +} + +void arcturus_device::device_start() +{ + m_rom4 = memregion(TI99_CARTSC_4000)->base(); + m_roma = memregion(TI99_CARTSC_A000)->base(); + m_romc = memregion(TI99_CARTSC_C000)->base(); +} + +ROM_START( ti99_arcturus ) + ROM_REGION(0x2000, TI99_CARTSC_4000, 0) + ROM_LOAD("arcturus.u1", 0x0000, 0x2000, CRC(28ba65ec) SHA1(63329930c71ef776e8598a8d4c580c41bd52a339)) + ROM_REGION(0x2000, TI99_CARTSC_A000, 0) + ROM_LOAD("arcturus.u2", 0x0000, 0x2000, CRC(91e6910a) SHA1(51c1f75d4e9d74af21c0b43188fc0ffc4a3ad4c0)) + ROM_REGION(0x2000, TI99_CARTSC_C000, 0) + ROM_LOAD("arcturus.u3", 0x0000, 0x2000, CRC(e9ce9f4e) SHA1(65850c57e9480a5d8bdd852692f18d0162ca1406)) +ROM_END + +void arcturus_device::device_add_mconfig(machine_config& config) +{ + RAM(config, TI99_CARTSC_RAM).set_default_size("2K").set_default_value(0); +} + +const tiny_rom_entry *arcturus_device::device_rom_region() const +{ + return ROM_NAME( ti99_arcturus ); +} + +} // end namespace bus::ti99::peb diff --git a/src/devices/bus/ti99/sidecar/arcturus.h b/src/devices/bus/ti99/sidecar/arcturus.h new file mode 100644 index 0000000000000..940bd0e55f57f --- /dev/null +++ b/src/devices/bus/ti99/sidecar/arcturus.h @@ -0,0 +1,49 @@ +// license:LGPL-2.1+ +// copyright-holders:Michael Zapf +/**************************************************************************** + + Arcturus sidecar cartridge + Michael Zapf + +*****************************************************************************/ + +#ifndef MAME_BUS_TI99_SIDECAR_ARCTURUS_H +#define MAME_BUS_TI99_SIDECAR_ARCTURUS_H + +#pragma once + +#include "bus/ti99/internal/ioport.h" +#include "machine/ram.h" + +namespace bus::ti99::sidecar { + +/***************************************************************************** + Arcturus sidecar cartridge +******************************************************************************/ + +class arcturus_device : public bus::ti99::internal::ioport_attached_device +{ +public: + arcturus_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + virtual void readz(offs_t offset, uint8_t *value) override; + virtual void write(offs_t offset, uint8_t data) override; + +protected: + virtual void device_start() override ATTR_COLD; + virtual const tiny_rom_entry *device_rom_region() const override ATTR_COLD; + virtual void device_add_mconfig(machine_config &config) override ATTR_COLD; + +private: + // ROMs + uint8_t* m_rom4; + uint8_t* m_roma; + uint8_t* m_romc; + + required_device m_ram; +}; + +} // end namespace bus::ti99::internal + +DECLARE_DEVICE_TYPE_NS(TI99_ARCTURUS, bus::ti99::sidecar, arcturus_device) + +#endif // MAME_BUS_TI99_SIDECAR_ARCTURUS_H diff --git a/src/devices/bus/ti99/sidecar/speechsyn.cpp b/src/devices/bus/ti99/sidecar/speechsyn.cpp new file mode 100644 index 0000000000000..65e4998da9044 --- /dev/null +++ b/src/devices/bus/ti99/sidecar/speechsyn.cpp @@ -0,0 +1,273 @@ +// license:LGPL-2.1+ +// copyright-holders:Michael Zapf +/**************************************************************************** + + TI-99 Speech synthesizer + + This is the emulation Speech Synthesizer, which plugs into the I/O port of + the TI console. Even though the sidecar expansion concept was largely + abandoned by the introduction of the Peripheral Expansion Box with the 4A, + the Speech Synthesizer was sold as a sidecar expansion until the end. + + Typical setup: + Speech Synthesizer + sidecar + v + +----------------+---+---------- + | TI-99/4(A) | | PEB connection cable + +------------+---+ +---------- + | oooooooooo | |---+ + | oooooooooo | | + +----------------- + + Also as a common modification, users removed the board inside the sidecar + and placed it on an adapter to go into the PEB and thus to become + available for the Geneve or SGCPU. See bus/ti99/peb/speechadapter.cpp. + + The sidecar offers a flippable lid where vocabulary expansion modules were + supposed to be plugged in, but those have never seen daylight. In most of + the units, including mine, no connector can be found under the lid, so the + decision to drop this idea must have come early. + + Technical details: + + The Voice Synthesis Processor (VSP) used for the TI Speech Synthesizer + is the CD2501E, aka TMS5200 (internal name TMC0285), a predecessor of the + TMS5220 which was used in many other commercial products. + Two TMS6100 circuits hold the standard vocabulary, mainly used from Extended + Basic programs. + + The interaction with the TMS5200 relies completely on the READY* + line; the INT* line is not connected. + + The VSP delivers a READY* signal, which needs to be inverted for the rest + of the TI system. The board of the Speech Synthesizer uses a simple + transistor for this purpose. + + Michael Zapf + March 2025 + +*****************************************************************************/ + +#include "emu.h" +#include "speechsyn.h" +#include "speaker.h" + +#define LOG_WARN (1U << 1) // Warnings +#define LOG_CONFIG (1U << 2) +#define LOG_MEM (1U << 3) +#define LOG_ADDR (1U << 4) +#define LOG_READY (1U << 5) + +#define VERBOSE (LOG_GENERAL | LOG_WARN) + +#include "logmacro.h" + +DEFINE_DEVICE_TYPE(TI99_SPEECHSYN, bus::ti99::sidecar::ti_speech_synthesizer_device, "ti99_speech", "TI-99 Speech Synthesizer") + +namespace bus::ti99::sidecar { + +#define VSP "tms5200" +#define PORT "extport" + +/* + Constructor called from subclasses. +*/ +ti_speech_synthesizer_device::ti_speech_synthesizer_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : bus::ti99::internal::ioport_attached_device(mconfig, TI99_SPEECHSYN, tag, owner, clock), + m_vsp(*this, VSP), + m_port(*this, PORT), + m_reading(false), + m_sbe(CLEAR_LINE), + m_ext_ready(ASSERT_LINE), + m_ssyn_ready(ASSERT_LINE) +{ +} + +/* + Memory read +*/ + +void ti_speech_synthesizer_device::readz(offs_t offset, uint8_t *value) +{ + if (m_sbe) + { + if (machine().side_effects_disabled()) return; + + *value = m_vsp->status_r() & 0xff; + LOGMASKED(LOG_MEM, "read value = %02x\n", *value); + // We should clear the lines at this point. The TI-99/4A clears the + // lines by setting the address bus to a different value, but the + // Geneve may behave differently. This may not 100% reflect the real + // situation, but it ensures a safe processing. + m_vsp->combined_rsq_wsq_w(~0); + } + + // Pass through to the external port + if (m_port != nullptr) + m_port->readz(offset, value); +} +/* + Memory write +*/ +void ti_speech_synthesizer_device::write(offs_t offset, uint8_t data) +{ + if (m_sbe) + { + if (machine().side_effects_disabled()) return; + LOGMASKED(LOG_MEM, "write value = %02x\n", data); + m_vsp->data_w(data); + // Note that we must NOT clear the lines here. Find the lines in the + // READY callback below. + } + + // Pass through to the external port + if (m_port != nullptr) + m_port->write(offset, data); +} + +void ti_speech_synthesizer_device::setaddress_dbin(offs_t offset, int state) +{ + if (m_sbe) + { + m_reading = (state==ASSERT_LINE); + LOGMASKED(LOG_ADDR, "set address = %04x, dbin = %d\n", offset, state); + + // Caution: In the current tms5220 emulation, care must be taken + // to clear one line before asserting the other line, or otherwise + // both RS* and WS* are active, which is illegal. + // Alternatively, we'll use the combined settings method + + m_vsp->combined_rsq_wsq_w(m_reading ? ~tms5220_device::RS : ~tms5220_device::WS); + } + else + { + // If other address, turn off RS* and WS* (negative logic!) + m_vsp->combined_rsq_wsq_w(~0); + + // Pass through to the external port + if (m_port != nullptr) + m_port->setaddress_dbin(offset, state); + } +} + +void ti_speech_synthesizer_device::sbe(int state) +{ + m_sbe = (state==ASSERT_LINE); + // Not forwarded to the external port +} + +void ti_speech_synthesizer_device::crureadz(offs_t offset, uint8_t *value) +{ + // Pass through to the external port + if (m_port != nullptr) + m_port->crureadz(offset, value); +} + +void ti_speech_synthesizer_device::cruwrite(offs_t offset, uint8_t data) +{ + // Pass through to the external port + if (m_port != nullptr) + m_port->cruwrite(offset, data); +} + +void ti_speech_synthesizer_device::memen_in(int state) +{ + // Pass through to the external port + if (m_port != nullptr) + m_port->memen_in(state); +} + +void ti_speech_synthesizer_device::msast_in(int state) +{ + // Pass through to the external port + if (m_port != nullptr) + m_port->msast_in(state); +} + +void ti_speech_synthesizer_device::clock_in(int state) +{ + // Pass through to the external port + if (m_port != nullptr) + m_port->clock_in(state); +} + +void ti_speech_synthesizer_device::reset_in(int state) +{ + // Pass through to the external port + if (m_port != nullptr) + m_port->reset_in(state); +} + +/* + Forward the incoming interrupt to the console +*/ +void ti_speech_synthesizer_device::extint(int state) +{ + set_extint(state); +} + +void ti_speech_synthesizer_device::extready(int state) +{ + LOGMASKED(LOG_READY, "Incoming READY=%d from external port\n", state); + m_ext_ready = (line_state)state; + set_ready(m_ext_ready & m_ssyn_ready); +} + +void ti_speech_synthesizer_device::speech_ready(int state) +{ + // Invert the READY* signal + m_ssyn_ready = (state==0)? ASSERT_LINE : CLEAR_LINE; + LOGMASKED(LOG_READY, "SSyn READY = %d\n", (state==0)); + + if ((state==0) && !m_reading) + // Clear the lines only when we are done with writing. + m_vsp->combined_rsq_wsq_w(~0); + + set_ready(m_ext_ready & m_ssyn_ready); +} + +void ti_speech_synthesizer_device::device_start() +{ + save_item(NAME(m_reading)); + save_item(NAME(m_sbe)); +} + +void ti_speech_synthesizer_device::device_reset() +{ + m_reading = false; + m_sbe = CLEAR_LINE; +} + +ROM_START( ti99_speech ) + ROM_REGION(0x8000, "vsm", 0) + ROM_LOAD("cd2325a.u2a", 0x0000, 0x4000, CRC(1f58b571) SHA1(0ef4f178716b575a1c0c970c56af8a8d97561ffe)) // at location u2, bottom of stack + ROM_LOAD("cd2326a.u2b", 0x4000, 0x4000, CRC(65d00401) SHA1(a367242c2c96cebf0e2bf21862f3f6734b2b3020)) // at location u2, top of stack +ROM_END + +void ti_speech_synthesizer_device::device_add_mconfig(machine_config& config) +{ + SPEAKER(config, "speech_out").front_center(); + CD2501E(config, m_vsp, 640000L); + + m_vsp->ready_cb().set(FUNC(ti_speech_synthesizer_device::speech_ready)); + m_vsp->add_route(ALL_OUTPUTS, "speech_out", 0.50); + + TMS6100(config, "vsm", 0); + m_vsp->m0_cb().set("vsm", FUNC(tms6100_device::m0_w)); + m_vsp->m1_cb().set("vsm", FUNC(tms6100_device::m1_w)); + m_vsp->addr_cb().set("vsm", FUNC(tms6100_device::add_w)); + m_vsp->data_cb().set("vsm", FUNC(tms6100_device::data_line_r)); + m_vsp->romclk_cb().set("vsm", FUNC(tms6100_device::clk_w)); + + TI99_IOPORT(config, m_port, 0, ti99_ioport_options_evpc1, nullptr); + m_port->extint_cb().set(FUNC(ti_speech_synthesizer_device::extint)); + m_port->ready_cb().set(FUNC(ti_speech_synthesizer_device::extready)); +} + +const tiny_rom_entry *ti_speech_synthesizer_device::device_rom_region() const +{ + return ROM_NAME( ti99_speech ); +} + +} // end namespace bus::ti99::sidecar diff --git a/src/devices/bus/ti99/sidecar/speechsyn.h b/src/devices/bus/ti99/sidecar/speechsyn.h new file mode 100644 index 0000000000000..b0fc531832fc1 --- /dev/null +++ b/src/devices/bus/ti99/sidecar/speechsyn.h @@ -0,0 +1,65 @@ +// license:LGPL-2.1+ +// copyright-holders:Michael Zapf +/**************************************************************************** + + Speech Synthesizer sidecar device + Michael Zapf + +*****************************************************************************/ + +#ifndef MAME_BUS_TI99_SIDECAR_SPEECHSYN_H +#define MAME_BUS_TI99_SIDECAR_SPEECHSYN_H + +#pragma once + +#include "bus/ti99/internal/ioport.h" +#include "sound/tms5220.h" +#include "machine/tms6100.h" + +namespace bus::ti99::sidecar { + +class ti_speech_synthesizer_device : public bus::ti99::internal::ioport_attached_device +{ +public: + ti_speech_synthesizer_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + void readz(offs_t offset, uint8_t *value) override; + void write(offs_t offset, uint8_t data) override; + void setaddress_dbin(offs_t offset, int state) override; + void sbe(int state) override; + + void crureadz(offs_t offset, uint8_t *value) override; + void cruwrite(offs_t offset, uint8_t data) override; + + void memen_in(int state) override; + void msast_in(int state) override; + + void clock_in(int state) override; + void reset_in(int state) override; + +protected: + virtual void device_start() override ATTR_COLD; + virtual void device_reset() override ATTR_COLD; + virtual const tiny_rom_entry *device_rom_region() const override ATTR_COLD; + virtual void device_add_mconfig(machine_config &config) override ATTR_COLD; + + // Callbacks from the external port + void extint(int state); + void extready(int state); + +private: + required_device m_vsp; + required_device m_port; + + void speech_ready(int state); + + bool m_reading; + bool m_sbe; + line_state m_ext_ready; + line_state m_ssyn_ready; +}; + +} // end namespace bus::ti99::internal + +DECLARE_DEVICE_TYPE_NS(TI99_SPEECHSYN, bus::ti99::sidecar, ti_speech_synthesizer_device) + +#endif // MAME_BUS_TI99_SIDECAR_SPEECHSYN_H diff --git a/src/devices/cpu/alto2/a2disp.cpp b/src/devices/cpu/alto2/a2disp.cpp index 216542cfd6777..5cc9e5cc300d3 100644 --- a/src/devices/cpu/alto2/a2disp.cpp +++ b/src/devices/cpu/alto2/a2disp.cpp @@ -499,7 +499,7 @@ void alto2_cpu_device::f2_late_evenfield() */ void alto2_cpu_device::init_disp() { - memset(&m_dsp, 0, sizeof(m_dsp)); + m_dsp = decltype(m_dsp)(); save_item(NAME(m_dsp.state)); save_item(NAME(m_dsp.hlc)); save_item(NAME(m_dsp.setmode)); diff --git a/src/devices/cpu/alto2/a2disp.h b/src/devices/cpu/alto2/a2disp.h index eee5af359b2ad..02c51435d5ab9 100644 --- a/src/devices/cpu/alto2/a2disp.h +++ b/src/devices/cpu/alto2/a2disp.h @@ -193,24 +193,24 @@ #ifndef MAME_CPU_ALTO2_A2DISP_H #define MAME_CPU_ALTO2_A2DISP_H struct { - uint32_t state; //!< current state of the display_state_machine() - uint32_t hlc; //!< horizontal line counter - uint32_t setmode; //!< value written by last SETMODE<- - uint32_t inverse; //!< set to 0xffff if line is inverse, 0x0000 otherwise - uint32_t scanline; //!< current scanline - bool halfclock; //!< false for normal pixel clock, true for half pixel clock - bool vblank; //!< true during vblank, false otherwise - uint16_t fifo[A2_DISP_FIFO]; //!< display word fifo - uint32_t wa; //!< fifo input pointer (write address; 4-bit) - uint32_t ra; //!< fifo output pointer (read address; 4-bit) - uint32_t a63; //!< most recent value read from the PROM a63 - uint32_t a66; //!< most recent value read from the PROM a66 - bool dht_blocks; //!< set true, if the DHT executed BLOCK - bool dwt_blocks; //!< set true, if the DWT executed BLOCK - bool curt_blocks; //!< set true, if the CURT executed BLOCK - bool curt_wakeup; //!< set true, if CURT wakeups are generated - uint32_t xpreg; //!< cursor cursor x position register (10-bit) - uint32_t csr; //!< cursor shift register (16-bit) + uint32_t state = 0; //!< current state of the display_state_machine() + uint32_t hlc = 0; //!< horizontal line counter + uint32_t setmode = 0; //!< value written by last SETMODE<- + uint32_t inverse = 0; //!< set to 0xffff if line is inverse, 0x0000 otherwise + uint32_t scanline = 0; //!< current scanline + bool halfclock = false; //!< false for normal pixel clock, true for half pixel clock + bool vblank = false; //!< true during vblank, false otherwise + uint16_t fifo[A2_DISP_FIFO] = { }; //!< display word fifo + uint32_t wa = 0; //!< fifo input pointer (write address; 4-bit) + uint32_t ra = 0; //!< fifo output pointer (read address; 4-bit) + uint32_t a63 = 0; //!< most recent value read from the PROM a63 + uint32_t a66 = 0; //!< most recent value read from the PROM a66 + bool dht_blocks = false; //!< set true, if the DHT executed BLOCK + bool dwt_blocks = false; //!< set true, if the DWT executed BLOCK + bool curt_blocks = false; //!< set true, if the CURT executed BLOCK + bool curt_wakeup = false; //!< set true, if CURT wakeups are generated + uint32_t xpreg = 0; //!< cursor cursor x position register (10-bit) + uint32_t csr = 0; //!< cursor shift register (16-bit) std::unique_ptr framebuf; //!< array of words of the raw bitmap that is displayed std::unique_ptr patterns; //!< array of 65536 patterns (16 bytes) with 1 byte per pixel std::unique_ptr bitmap; //!< MAME bitmap with 16 bit indices diff --git a/src/devices/cpu/cdc160/cdc160d.cpp b/src/devices/cpu/cdc160/cdc160d.cpp new file mode 100644 index 0000000000000..898ef277e0ec2 --- /dev/null +++ b/src/devices/cpu/cdc160/cdc160d.cpp @@ -0,0 +1,379 @@ +// license:BSD-3-Clause +// copyright-holders:AJR +/*************************************************************************** + + CDC 160/160-A disassembler + + Some departures from the syntax used by CDC's assemblers: + — Two-word instructions are always written on one line each. This + was not necessarily permitted, especially for INP and OUT. + — For forward and backward addressing modes, the effective address is + given rather than the 6-bit displacement to be added to P. + — For 160-A only, a synthetic two-word instruction JPM (Jump Memory) + represents the common pattern of using JFI with a 1-word displacement + to jump to any address in the 4096-word bank. + +***************************************************************************/ + +#include "emu.h" +#include "cdc160d.h" + +cdc160_disassembler::cdc160_disassembler() + : util::disasm_interface() +{ +} + +u32 cdc160_disassembler::opcode_alignment() const +{ + return 1; +} + +cdc160a_disassembler::cdc160a_disassembler() + : cdc160_disassembler() +{ +} + +u32 cdc160a_disassembler::interface_flags() const +{ + return PAGED; +} + +u32 cdc160a_disassembler::page_address_bits() const +{ + return 12; +} + +namespace { + +const char *const f_160a_bank_ops[7] = +{ + "SRJ", "SIC", "IRJ", "SDC", "DRJ", "SID", "ACJ" +}; + +const char *const f_160_alu_ops[10] = +{ + "LP", "LS", "LD", "LC", "AD", "SB", "ST", "SR", "RA", "AO" +}; + +const char *const f_160a_alu_ops[10] = +{ + "LP", "SC", "LD", "LC", "AD", "SB", "ST", "SR", "RA", "AO" +}; + +const char *const f_cond_jp_ops[6] = +{ + "ZJ", "NZ", "PJ", "NJ" +}; + +// 12-bit ones' complement addition +inline u16 add_relative(uint_fast16_t a, uint_fast16_t b) noexcept +{ + u16 c = (a & 07777) + (b & 07777); + if (c >= 07777) + c -= 07777; + return c; +} + +} // anonymous namespace + +offs_t cdc160_disassembler::disassemble(std::ostream &stream, offs_t pc, const data_buffer &opcodes, const data_buffer ¶ms) +{ + u16 inst = opcodes.r16(pc) & 07777; + if (inst < 0200) + { + util::stream_format(stream, "%s %o", BIT(inst, 6) ? "SHA" : "ERR", inst & 0077); + return 1 | SUPPORTED; + } + else if (inst < 01000) + { + // No address (6-bit immediate) mode + util::stream_format(stream, "%sN %o", f_160_alu_ops[BIT(inst, 6, 3) - 2], inst & 0077); + return 1 | SUPPORTED; + } + else if (inst < 06000) + { + if (BIT(inst, 7)) + { + // Relative forward or backward address mode + util::stream_format(stream, "%s%c %04o", f_160_alu_ops[BIT(inst, 8, 4) - 2], BIT(inst, 6) ? 'B' : 'F', + add_relative(pc, BIT(inst, 6) ? ~(inst & 0077) : inst & 0077)); + return 1 | SUPPORTED; + } + else + { + // Direct or indirect address mode + util::stream_format(stream, "%s%c %02o", f_160_alu_ops[BIT(inst, 8, 4) - 2], BIT(inst, 6) ? 'I' : 'D', inst & 0077); + return 1 | SUPPORTED; + } + } + else if (inst < 07000) + { + // Relative conditional jumps + util::stream_format(stream, "%s%c %04o", f_cond_jp_ops[BIT(inst, 6, 2)], BIT(inst, 8) ? 'B' : 'F', + add_relative(pc, BIT(inst, 8) ? ~(inst & 0077) : inst & 0077)); + return 1 | STEP_COND | SUPPORTED; + } + else switch (BIT(inst, 6, 3)) + { + case 0: + util::stream_format(stream, "JPI %02o", inst & 0077); + return 1 | STEP_OUT | SUPPORTED; + + case 1: + // Jump forward indirect + util::stream_format(stream, "JFI %04o", add_relative(pc, inst & 0077)); + return 1 | SUPPORTED; + + case 2: case 3: + util::stream_format(stream, "%s %04o %04o", BIT(inst, 6) ? "OUT" : "INP", add_relative(pc, inst & 0077), opcodes.r16(pc + 1) & 07777); + return 2 | SUPPORTED; + + case 4: + // Output direct + util::stream_format(stream, "OTN %02o", inst & 0077); + return 1 | SUPPORTED; + + case 5: + // External function + util::stream_format(stream, "EXF %04o", (pc + (inst & 0077)) & 07777); + return 1 | SUPPORTED; + + case 6: + util::stream_format(stream, "INA %o", inst & 0077); + return 1 | SUPPORTED; + + case 7: default: + util::stream_format(stream, "HLT %02o", inst & 0077); + return 1 | SUPPORTED; + } +} + +offs_t cdc160a_disassembler::disassemble(std::ostream &stream, offs_t pc, const data_buffer &opcodes, const data_buffer ¶ms) +{ + u16 inst = opcodes.r16(pc) & 07777; + if (inst < 0200) + { + if (inst >= 0010 && inst < 0100) + { + util::stream_format(stream, "%s %d", f_160a_bank_ops[BIT(inst, 3, 3) - 1], inst & 0007); + return 1 | SUPPORTED; + } + else switch (inst) + { + case 0000: + stream << "ERR"; + return 1 | SUPPORTED; + + case 0001: + stream << "NOP"; + return 1 | SUPPORTED; + + case 0100: + util::stream_format(stream, "BLS %04o", opcodes.r16(pc + 1) & 07777); + return 2 | STEP_COND | SUPPORTED; + + case 0101: + stream << "PTA"; + return 1 | (BIT(opcodes.r16(pc + 1), 6, 3) == 070 ? STEP_OVER | step_over_extra(1) : 0) | SUPPORTED; + + case 0102: + stream << "LS1"; + return 1 | SUPPORTED; + + case 0103: + stream << "LS2"; + return 1 | SUPPORTED; + + case 0104: + stream << "CBC"; + return 1 | SUPPORTED; + + case 0105: + util::stream_format(stream, "ATE %04o", opcodes.r16(pc + 1) & 07777); + return 2 | STEP_COND | SUPPORTED; + + case 0106: + util::stream_format(stream, "ATX %04o", opcodes.r16(pc + 1) & 07777); + return 2 | STEP_COND | SUPPORTED; + + case 0107: + stream << "ETA"; + return 1 | SUPPORTED; + + case 0110: + stream << "LS3"; + return 1 | SUPPORTED; + + case 0111: + stream << "LS6"; + return 1 | SUPPORTED; + + case 0112: + stream << "MUT"; + return 1 | SUPPORTED; + + case 0113: + stream << "MUH"; + return 1 | SUPPORTED; + + case 0114: + stream << "RS1"; + return 1 | SUPPORTED; + + case 0115: + stream << "RS2"; + return 1 | SUPPORTED; + + case 0120: + stream << "CIL"; + return 1 | SUPPORTED; + + case 0130: + stream << "CTA"; + return 1 | SUPPORTED; + + case 0140: case 0141: case 0142: case 0143: case 0144: case 0145: case 0146: case 0147: + util::stream_format(stream, "SBU %d", inst & 0007); + return 1 | SUPPORTED; + + case 0150: case 0151: case 0152: case 0153: case 0154: case 0155: case 0156: case 0157: + util::stream_format(stream, "STP %02o", inst & 0077); + return 1 | SUPPORTED; + + case 0160: case 0161: case 0162: case 0163: case 0164: case 0165: case 0166: case 0167: + util::stream_format(stream, "STE %02o", inst & 0077); + return 1 | SUPPORTED; + + default: + util::stream_format(stream, "%04o", inst); + return 1 | SUPPORTED; + } + } + else if (inst < 01000) + { + // No address (6-bit immediate) mode + util::stream_format(stream, "%sN %o", f_160a_alu_ops[BIT(inst, 6, 3) - 2], inst & 0077); + return 1 | SUPPORTED; + } + else if (inst < 06000) + { + if (BIT(inst, 7)) + { + if ((inst & 0077) != 0) + { + // Relative forward or backward address mode + util::stream_format(stream, "%s%c %04o", f_160a_alu_ops[BIT(inst, 8, 4) - 2], BIT(inst, 6) ? 'B' : 'F', + add_relative(pc, BIT(inst, 6) ? ~(inst & 0077) : inst & 0077)); + return 1 | SUPPORTED; + } + else if (BIT(inst, 6)) + { + // Specific address mode + util::stream_format(stream, "%sS", f_160a_alu_ops[BIT(inst, 8, 4) - 2]); + return 1 | SUPPORTED; + } + else + { + // Constant address (12-bit immediate) mode + util::stream_format(stream, "%sC %04o", f_160a_alu_ops[BIT(inst, 8, 4) - 2], opcodes.r16(pc + 1) & 07777); + return 2 | SUPPORTED; + } + } + else if ((inst & 0177) == 0100) + { + // Memory address mode + util::stream_format(stream, "%sM %04o", f_160a_alu_ops[BIT(inst, 8, 4) - 2], opcodes.r16(pc + 1) & 07777); + return 2 | SUPPORTED; + } + else + { + // Direct or indirect address mode + util::stream_format(stream, "%s%c %02o", f_160a_alu_ops[BIT(inst, 8, 4) - 2], BIT(inst, 6) ? 'I' : 'D', inst & 0077); + return 1 | SUPPORTED; + } + } + else if (inst < 07000) + { + // Relative conditional jumps + util::stream_format(stream, "%s%c %04o", f_cond_jp_ops[BIT(inst, 6, 2)], BIT(inst, 8) ? 'B' : 'F', + add_relative(pc, BIT(inst, 8) ? ~(inst & 0077) : inst & 0077)); + return 1 | STEP_COND | SUPPORTED; + } + else switch (BIT(inst, 6, 3)) + { + case 0: + util::stream_format(stream, "JPI %02o", inst & 0077); + return 1 | STEP_OUT | SUPPORTED; + + case 1: + if ((inst & 0077) <= 1) + { + util::stream_format(stream, "JP%c %04o", BIT(inst, 0) ? 'M' : 'R', opcodes.r16(pc + 1) & 07777); + return 2 | (BIT(inst, 0) ? 0 : STEP_OVER) | SUPPORTED; + } + else + { + util::stream_format(stream, "JFI %04o", add_relative(pc, inst & 0077)); + return 1 | SUPPORTED; + } + + case 2: case 3: + if ((inst & 0077) == 0) + { + // Buffer input/output + util::stream_format(stream, "IB%c %04o", BIT(inst, 6) ? 'O' : 'I', opcodes.r16(pc + 1) & 07777); + return 2 | STEP_COND | SUPPORTED; + } + else + { + // Normal input/output + util::stream_format(stream, "%s %04o %04o", BIT(inst, 6) ? "OUT" : "INP", add_relative(pc, inst & 0077), opcodes.r16(pc + 1) & 07777); + return 2 | SUPPORTED; + } + return 1 | SUPPORTED; + + case 4: + // Output direct + util::stream_format(stream, "OTN %02o", inst & 0077); + return 1 | SUPPORTED; + + case 5: + // External function + if ((inst & 0077) == 0) + { + util::stream_format(stream, "EXC %04o", opcodes.r16(pc + 1) & 07777); + return 2 | SUPPORTED; + } + else + { + util::stream_format(stream, "EXF %04o", (pc + (inst & 0077)) & 07777); + return 1 | SUPPORTED; + } + + case 6: + if ((inst & 0077) == 0) + stream << "INA"; + else if ((inst & 0077) == 0077) + stream << "OTA"; + else + util::stream_format(stream, "HWI %02o", inst & 0077); + return 1 | SUPPORTED; + + case 7: default: + if ((inst & 0077) == 0 || (inst & 0077) == 0077) + { + stream << "HLT"; + return 1 | SUPPORTED; + } + else if ((inst & 070) == 0) + { + util::stream_format(stream, "SLS %d", inst & 0007); + return 1 | SUPPORTED; + } + else + { + util::stream_format(stream, "%s %02o %04o", (inst & 0007) != 0 ? "SJS" : "SLJ", inst & 077, opcodes.r16(pc + 1) & 07777); + return 2 | STEP_COND | SUPPORTED; + } + } +} diff --git a/src/devices/cpu/cdc160/cdc160d.h b/src/devices/cpu/cdc160/cdc160d.h new file mode 100644 index 0000000000000..f564f7c6bf92b --- /dev/null +++ b/src/devices/cpu/cdc160/cdc160d.h @@ -0,0 +1,34 @@ +// license:BSD-3-Clause +// copyright-holders:AJR + +#ifndef MAME_CPU_CDC160_CDC160D_H +#define MAME_CPU_CDC160_CDC160D_H + +#pragma once + +class cdc160_disassembler : public util::disasm_interface +{ +public: + // construction/destruction + cdc160_disassembler(); + +protected: + // util::disasm_interface overrides + virtual u32 opcode_alignment() const override; + virtual offs_t disassemble(std::ostream &stream, offs_t pc, const data_buffer &opcodes, const data_buffer ¶ms) override; +}; + +class cdc160a_disassembler : public cdc160_disassembler +{ +public: + // construction/destruction + cdc160a_disassembler(); + +protected: + // util::disasm_interface overrides + virtual u32 interface_flags() const override; + virtual u32 page_address_bits() const override; + virtual offs_t disassemble(std::ostream &stream, offs_t pc, const data_buffer &opcodes, const data_buffer ¶ms) override; +}; + +#endif // MAME_CPU_CDC160_CDC160D_H diff --git a/src/devices/cpu/drcbearm64.cpp b/src/devices/cpu/drcbearm64.cpp index 5477343ce574c..921c1491b1280 100644 --- a/src/devices/cpu/drcbearm64.cpp +++ b/src/devices/cpu/drcbearm64.cpp @@ -1,5 +1,5 @@ // license:BSD-3-Clause -// copyright-holders:windyfairy +// copyright-holders:windyfairy, Vas Crabb /*************************************************************************** Register use: @@ -81,10 +81,14 @@ the location FP points to. #include "debug/debugcpu.h" #include "emuopts.h" +#include "mfpresolve.h" + #include "asmjit/src/asmjit/asmjit.h" #include "asmjit/src/asmjit/a64.h" #include +#include +#include #include @@ -180,6 +184,13 @@ const a64::CondCode condition_map[uml::COND_MAX - uml::COND_Z] = a64::CondCode::kGE, // COND_GE, requires SV }; +// UML flag bit numbers +constexpr unsigned FLAG_BIT_C = 0; +constexpr unsigned FLAG_BIT_V = 1; +constexpr unsigned FLAG_BIT_Z = 2; +constexpr unsigned FLAG_BIT_S = 3; +constexpr unsigned FLAG_BIT_U = 4; + // masks for immediate values that can be generated with movz instructions constexpr uint64_t LSL0_MASK = 0x00000000'0000ffff; constexpr uint64_t LSL16_MASK = 0x00000000'ffff0000; @@ -187,8 +198,8 @@ constexpr uint64_t LSL32_MASK = 0x0000ffff'00000000; constexpr uint64_t LSL48_MASK = 0xffff0000'00000000; -#define ARM_CONDITION(a, condition) (condition_map[condition - COND_Z]) -#define ARM_NOT_CONDITION(a, condition) (negateCond(condition_map[condition - COND_Z])) +#define ARM_CONDITION(condition) (condition_map[condition - COND_Z]) +#define ARM_NOT_CONDITION(condition) (negateCond(condition_map[condition - COND_Z])) #define assert_no_condition(inst) assert((inst).condition() == uml::COND_ALWAYS) #define assert_any_condition(inst) assert((inst).condition() == uml::COND_ALWAYS || ((inst).condition() >= uml::COND_Z && (inst).condition() < uml::COND_MAX)) @@ -251,6 +262,12 @@ inline bool is_valid_immediate(uint64_t val, size_t bits) return val < (uint64_t(1) << bits); } +constexpr bool is_valid_immediate_addsub(uint64_t val) +{ + // 12-bit unsigned immediate value, optionally left-shifted by 12 bits + return !(val & ~util::make_bitmask(12)) || !(val & ~(util::make_bitmask(12) << 12)); +} + inline constexpr bool is_valid_immediate_signed(int64_t val, size_t bits) { return util::sext(val, bits) == val; @@ -283,7 +300,7 @@ inline bool is_simple_mov_immediate(uint64_t val, size_t bytes) inline bool emit_add_optimized(a64::Assembler &a, const a64::Gp &dst, const a64::Gp &src, int64_t val) { // If the bottom 12 bits are 0s then an optimized form can be used if the remaining bits are <= 12 - if (is_valid_immediate(val, 12) || (!(val & 0xfff) && is_valid_immediate(val, 12 + 12))) + if (is_valid_immediate_addsub(val)) { a.add(dst, src, val); return true; @@ -298,7 +315,7 @@ inline bool emit_sub_optimized(a64::Assembler &a, const a64::Gp &dst, const a64: val = -val; // If the bottom 12 bits are 0s then an optimized form can be used if the remaining bits are <= 12 - if (is_valid_immediate(val, 12) || ((val & 0xfff) == 0 && is_valid_immediate(val >> 12, 12))) + if (is_valid_immediate_addsub(val)) { a.sub(dst, src, val); return true; @@ -349,11 +366,39 @@ void get_imm_absolute(a64::Assembler &a, const a64::Gp ®, const uint64_t val) a.mov(reg, val); } +void store_unordered(a64::Assembler &a) +{ + a.cset(SCRATCH_REG1, a64::CondCode::kPL); + a.cset(SCRATCH_REG2, a64::CondCode::kNE); + a.and_(SCRATCH_REG1, SCRATCH_REG1, SCRATCH_REG2); + a.cset(SCRATCH_REG2, a64::CondCode::kCS); + a.and_(SCRATCH_REG1, SCRATCH_REG1, SCRATCH_REG2); + a.cset(SCRATCH_REG2, a64::CondCode::kVS); + a.and_(SCRATCH_REG1, SCRATCH_REG1, SCRATCH_REG2); + a.bfi(FLAGS_REG, SCRATCH_REG2, FLAG_BIT_U, 1); +} + +inline void get_unordered(a64::Assembler &a, const a64::Gp ®) +{ + a.ubfx(reg.x(), FLAGS_REG, FLAG_BIT_U, 1); +} -class drcbe_arm64 : public drcbe_interface +inline void store_carry_reg(a64::Assembler &a, const a64::Gp ®) { - using arm64_entry_point_func = uint32_t (*)(void *entry); + a.bfi(FLAGS_REG, reg.x(), FLAG_BIT_C, 1); +} + +inline void get_carry(a64::Assembler &a, const a64::Gp ®, bool inverted = false) +{ + a.and_(reg.x(), FLAGS_REG, 1); + + if (inverted) + a.eor(reg.x(), reg.x(), 1); +} + +class drcbe_arm64 : public drcbe_interface +{ public: drcbe_arm64(drcuml_state &drcuml, device_t &device, drc_cache &cache, uint32_t flags, int modes, int addrbits, int ignorebits); virtual ~drcbe_arm64(); @@ -361,15 +406,20 @@ class drcbe_arm64 : public drcbe_interface virtual void reset() override; virtual int execute(uml::code_handle &entry) override; virtual void generate(drcuml_block &block, const uml::instruction *instlist, uint32_t numinst) override; - virtual bool hash_exists(uint32_t mode, uint32_t pc) override; - virtual void get_info(drcbe_info &info) override; - virtual bool logging() const override { return false; } + virtual bool hash_exists(uint32_t mode, uint32_t pc) const noexcept override; + virtual void get_info(drcbe_info &info) const noexcept override; + virtual bool logging() const noexcept override { return false; } private: - class be_parameter + enum class carry_state { - static inline constexpr int REG_MAX = 30; + POISON, // does not correspond to UML carry flag + CANONICAL, // corresponds directly to UML carry flag + LOGICAL // logical borrow state + }; + class be_parameter + { public: // parameter types enum be_parameter_type @@ -384,8 +434,8 @@ class drcbe_arm64 : public drcbe_interface typedef uint64_t be_parameter_value; - be_parameter() : m_type(PTYPE_NONE), m_value(0) { } - be_parameter(uint64_t val) : m_type(PTYPE_IMMEDIATE), m_value(val) { } + be_parameter() : m_type(PTYPE_NONE), m_value(0), m_coldreg(false) { } + be_parameter(uint64_t val) : m_type(PTYPE_IMMEDIATE), m_value(val), m_coldreg(false) { } be_parameter(drcbe_arm64 &drcbe, const uml::parameter ¶m, uint32_t allowed); be_parameter(const be_parameter ¶m) = default; @@ -409,6 +459,7 @@ class drcbe_arm64 : public drcbe_interface bool is_memory() const { return (m_type == PTYPE_MEMORY); } bool is_immediate_value(uint64_t value) const { return (m_type == PTYPE_IMMEDIATE && m_value == value); } + bool is_cold_register() const { return m_coldreg; } asmjit::a64::Vec get_register_float(uint32_t regsize) const; asmjit::a64::Gp get_register_int(uint32_t regsize) const; @@ -416,12 +467,40 @@ class drcbe_arm64 : public drcbe_interface asmjit::a64::Gp select_register(asmjit::a64::Gp const ®, uint32_t regsize) const; private: - be_parameter(be_parameter_type type, be_parameter_value value) : m_type(type), m_value(value) { } + static inline constexpr int REG_MAX = 30; + + be_parameter(be_parameter_type type, be_parameter_value value) : m_type(type), m_value(value), m_coldreg(false) { } be_parameter_type m_type; be_parameter_value m_value; + bool m_coldreg; + }; + + struct near_state + { + uint32_t emulated_flags; }; + using opcode_generate_func = void (drcbe_arm64::*)(asmjit::a64::Assembler &, const uml::instruction &); + struct opcode_table_entry + { + uml::opcode_t opcode; + opcode_generate_func func; + }; + + struct memory_accessors + { + resolved_memory_accessors resolved; + address_space::specific_access_info specific; + offs_t address_mask; + u8 high_bits; + bool no_mask; + bool mask_simple; + bool mask_high_bits; + }; + + using arm64_entry_point_func = uint32_t (*)(void *entry); + void op_handle(asmjit::a64::Assembler &a, const uml::instruction &inst); void op_hash(asmjit::a64::Assembler &a, const uml::instruction &inst); void op_label(asmjit::a64::Assembler &a, const uml::instruction &inst); @@ -461,8 +540,8 @@ class drcbe_arm64 : public drcbe_interface void op_sext(asmjit::a64::Assembler &a, const uml::instruction &inst); void op_roland(asmjit::a64::Assembler &a, const uml::instruction &inst); void op_rolins(asmjit::a64::Assembler &a, const uml::instruction &inst); - template void op_add(asmjit::a64::Assembler &a, const uml::instruction &inst); - template void op_sub(asmjit::a64::Assembler &a, const uml::instruction &inst); + template void op_add(asmjit::a64::Assembler &a, const uml::instruction &inst); + template void op_sub(asmjit::a64::Assembler &a, const uml::instruction &inst); void op_cmp(asmjit::a64::Assembler &a, const uml::instruction &inst); void op_mulu(asmjit::a64::Assembler &a, const uml::instruction &inst); void op_mululw(asmjit::a64::Assembler &a, const uml::instruction &inst); @@ -517,20 +596,20 @@ class drcbe_arm64 : public drcbe_interface void emit_float_ldr_mem(asmjit::a64::Assembler &a, const asmjit::a64::Vec ®, const void *ptr) const; void emit_float_str_mem(asmjit::a64::Assembler &a, const asmjit::a64::Vec ®, const void *ptr) const; - void get_carry(asmjit::a64::Assembler &a, const asmjit::a64::Gp ®, bool inverted = false) const; - void load_carry(asmjit::a64::Assembler &a, bool inverted = false) const; - void store_carry(asmjit::a64::Assembler &a, bool inverted = false) const; - void store_carry_reg(asmjit::a64::Assembler &a, const asmjit::a64::Gp ®) const; + void emit_skip(a64::Assembler &a, uml::condition_t cond, Label &skip); + + void emit_memaccess_setup(asmjit::a64::Assembler &a, const be_parameter &addrp, const memory_accessors &accessors, const address_space::specific_access_info::side &side) const; + void emit_narrow_memwrite(asmjit::a64::Assembler &a, const be_parameter &addrp, const parameter &spacesizep, const memory_accessors &accessors) const; - void store_unordered(asmjit::a64::Assembler &a) const; - void get_unordered(asmjit::a64::Assembler &a, const asmjit::a64::Gp ®) const; - void check_unordered_condition(asmjit::a64::Assembler &a, uml::condition_t cond, asmjit::Label condition_met, bool not_equal) const; + void store_carry(asmjit::a64::Assembler &a, bool inverted = false); + void load_carry(asmjit::a64::Assembler &a, bool inverted = false); + void set_flags(asmjit::a64::Assembler &a); - void calculate_carry_shift_left(asmjit::a64::Assembler &a, const asmjit::a64::Gp ®, const asmjit::a64::Gp &shift, int maxBits) const; - void calculate_carry_shift_left_imm(asmjit::a64::Assembler &a, const asmjit::a64::Gp ®, const int shift, int maxBits) const; + void calculate_carry_shift_left(asmjit::a64::Assembler &a, const asmjit::a64::Gp ®, const asmjit::a64::Gp &shift, int maxBits); + void calculate_carry_shift_left_imm(asmjit::a64::Assembler &a, const asmjit::a64::Gp ®, const int shift, int maxBits); - void calculate_carry_shift_right(asmjit::a64::Assembler &a, const asmjit::a64::Gp ®, const asmjit::a64::Gp &shift) const; - void calculate_carry_shift_right_imm(asmjit::a64::Assembler &a, const asmjit::a64::Gp ®, const int shift) const; + void calculate_carry_shift_right(asmjit::a64::Assembler &a, const asmjit::a64::Gp ®, const asmjit::a64::Gp &shift); + void calculate_carry_shift_right_imm(asmjit::a64::Assembler &a, const asmjit::a64::Gp ®, const int shift); void mov_float_reg_param(asmjit::a64::Assembler &a, uint32_t regsize, asmjit::a64::Vec const &dst, const be_parameter &src) const; void mov_float_param_param(asmjit::a64::Assembler &a, uint32_t regsize, const be_parameter &dst, const be_parameter &src) const; @@ -542,43 +621,31 @@ class drcbe_arm64 : public drcbe_interface void mov_param_imm(asmjit::a64::Assembler &a, uint32_t regsize, const be_parameter &dst, uint64_t src) const; void mov_param_param(asmjit::a64::Assembler &a, uint32_t regsize, const be_parameter &dst, const be_parameter &src) const; void mov_mem_param(asmjit::a64::Assembler &a, uint32_t regsize, void *dst, const be_parameter &src) const; - void mov_r64_imm(asmjit::a64::Assembler &a, const asmjit::a64::Gp &dst, uint64_t const src) const; void call_arm_addr(asmjit::a64::Assembler &a, const void *offs) const; + [[noreturn]] void end_of_block() const; + drc_hash_table m_hash; drc_map_variables m_map; - FILE * m_log_asmjit; + FILE *m_log_asmjit; + carry_state m_carry_state; arm64_entry_point_func m_entry; drccodeptr m_exit; drccodeptr m_nocode; + drccodeptr m_endofblock; uint8_t *m_baseptr; - struct near_state - { - uint32_t emulated_flags; - }; near_state &m_near; - using opcode_generate_func = void (drcbe_arm64::*)(asmjit::a64::Assembler &, const uml::instruction &); - struct opcode_table_entry - { - uml::opcode_t opcode; - opcode_generate_func func; - }; - static const opcode_table_entry s_opcode_table_source[]; - static opcode_generate_func s_opcode_table[uml::OP_MAX]; - - struct memory_accessors - { - resolved_memory_accessors resolved; - address_space::specific_access_info specific; - }; resolved_member_function m_debug_cpu_instruction_hook; resolved_member_function m_drcmap_get_value; std::vector m_memory_accessors; + + static const opcode_table_entry s_opcode_table_source[]; + static opcode_generate_func s_opcode_table[uml::OP_MAX]; }; @@ -629,10 +696,10 @@ const drcbe_arm64::opcode_table_entry drcbe_arm64::s_opcode_table_source[] = { uml::OP_SEXT, &drcbe_arm64::op_sext }, // SEXT dst,src { uml::OP_ROLAND, &drcbe_arm64::op_roland }, // ROLAND dst,src1,src2,src3 { uml::OP_ROLINS, &drcbe_arm64::op_rolins }, // ROLINS dst,src1,src2,src3 - { uml::OP_ADD, &drcbe_arm64::op_add }, // ADD dst,src1,src2[,f] - { uml::OP_ADDC, &drcbe_arm64::op_add }, // ADDC dst,src1,src2[,f] - { uml::OP_SUB, &drcbe_arm64::op_sub }, // SUB dst,src1,src2[,f] - { uml::OP_SUBB, &drcbe_arm64::op_sub }, // SUBB dst,src1,src2[,f] + { uml::OP_ADD, &drcbe_arm64::op_add }, // ADD dst,src1,src2[,f] + { uml::OP_ADDC, &drcbe_arm64::op_add }, // ADDC dst,src1,src2[,f] + { uml::OP_SUB, &drcbe_arm64::op_sub }, // SUB dst,src1,src2[,f] + { uml::OP_SUBB, &drcbe_arm64::op_sub }, // SUBB dst,src1,src2[,f] { uml::OP_CMP, &drcbe_arm64::op_cmp }, // CMP src1,src2[,f] { uml::OP_MULU, &drcbe_arm64::op_mulu }, // MULU dst,edst,src1,src2[,f] { uml::OP_MULULW, &drcbe_arm64::op_mululw }, // MULULW dst,src1,src2[,f] @@ -681,8 +748,6 @@ const drcbe_arm64::opcode_table_entry drcbe_arm64::s_opcode_table_source[] = drcbe_arm64::be_parameter::be_parameter(drcbe_arm64 &drcbe, const parameter ¶m, uint32_t allowed) { - int regnum; - switch (param.type()) { // immediates pass through @@ -701,22 +766,30 @@ drcbe_arm64::be_parameter::be_parameter(drcbe_arm64 &drcbe, const parameter &par case parameter::PTYPE_INT_REGISTER: assert(allowed & PTYPE_R); assert(allowed & PTYPE_M); - regnum = int_register_map[param.ireg() - REG_I0]; - if (regnum != 0) + if (int regnum = int_register_map[param.ireg() - REG_I0]; regnum != 0) + { *this = make_ireg(regnum); + } else + { *this = make_memory(&drcbe.m_state.r[param.ireg() - REG_I0]); + m_coldreg = true; + } break; // if a register maps to a register, keep it as a register; otherwise map it to memory case parameter::PTYPE_FLOAT_REGISTER: assert(allowed & PTYPE_F); assert(allowed & PTYPE_M); - regnum = float_register_map[param.freg() - REG_F0]; - if (regnum != 0) + if (int regnum = float_register_map[param.freg() - REG_F0]; regnum != 0) + { *this = make_freg(regnum); + } else + { *this = make_memory(&drcbe.m_state.f[param.freg() - REG_F0]); + m_coldreg = true; + } break; // everything else is unexpected @@ -741,18 +814,20 @@ a64::Vec drcbe_arm64::be_parameter::select_register(a64::Vec const ®, uint32_ { if (m_type == PTYPE_FLOAT_REGISTER) return get_register_float(regsize); - if (regsize == 4) + else if (regsize == 4) return reg.s(); - return reg.d(); + else + return reg.d(); } a64::Gp drcbe_arm64::be_parameter::select_register(a64::Gp const ®, uint32_t regsize) const { if (m_type == PTYPE_INT_REGISTER) return get_register_int(regsize); - if (regsize == 4) + else if (regsize == 4) return reg.w(); - return reg.x(); + else + return reg.x(); } void drcbe_arm64::get_imm_relative(a64::Assembler &a, const a64::Gp ®, const uint64_t val) const @@ -807,7 +882,7 @@ void drcbe_arm64::get_imm_relative(a64::Assembler &a, const a64::Gp ®, const inline void drcbe_arm64::emit_ldr_str_base_mem(a64::Assembler &a, a64::Inst::Id opcode, const a64::Reg ®, int max_shift, const void *ptr) const { // If it can fit as an immediate offset - const int64_t diff = (int64_t)ptr - (int64_t)m_baseptr; + const int64_t diff = int64_t(ptr) - int64_t(m_baseptr); if (is_valid_offset(diff, max_shift)) { a.emit(opcode, reg, arm::Mem(BASE_REG, diff)); @@ -816,7 +891,7 @@ inline void drcbe_arm64::emit_ldr_str_base_mem(a64::Assembler &a, a64::Inst::Id // If it can fit as an offset relative to PC const uint64_t codeoffs = a.code()->baseAddress() + a.offset(); - const int64_t reloffs = (int64_t)ptr - codeoffs; + const int64_t reloffs = int64_t(ptr) - codeoffs; if (is_valid_immediate_signed(reloffs, 21)) { a.adr(MEM_SCRATCH_REG, ptr); @@ -880,7 +955,7 @@ inline void drcbe_arm64::emit_ldr_str_base_mem(a64::Assembler &a, a64::Inst::Id } } - // Can't optimize it at all, most likely becomes 4 MOV commands + // Can't optimize it at all, most likely becomes 4 MOV instructions a.mov(MEM_SCRATCH_REG, ptr); a.emit(opcode, reg, arm::Mem(MEM_SCRATCH_REG)); } @@ -898,44 +973,194 @@ void drcbe_arm64::emit_strh_mem(a64::Assembler &a, const a64::Gp ®, const voi void drcbe_arm64::emit_float_ldr_mem(a64::Assembler &a, const a64::Vec ®, const void *ptr) const { emit_ldr_str_base_mem(a, a64::Inst::kIdLdr_v, reg, reg.isVecS() ? 2 : 3, ptr); } void drcbe_arm64::emit_float_str_mem(a64::Assembler &a, const a64::Vec ®, const void *ptr) const { emit_ldr_str_base_mem(a, a64::Inst::kIdStr_v, reg, reg.isVecS() ? 2 : 3, ptr); } -void drcbe_arm64::mov_reg_param(a64::Assembler &a, uint32_t regsize, const a64::Gp &dst, const be_parameter &src) const +void drcbe_arm64::emit_skip(a64::Assembler &a, uml::condition_t cond, Label &skip) { - if (src.is_immediate()) - get_imm_relative(a, select_register(dst, regsize), src.immediate()); - else if (src.is_int_register() && dst.id() != src.ireg()) - a.mov(select_register(dst, regsize), src.get_register_int(regsize)); - else if (src.is_memory()) - emit_ldr_mem(a, select_register(dst, regsize), src.memory()); + // Nothing to do if the instruction is unconditional + if (cond == uml::COND_ALWAYS) + return; + + // Branch to the skip point if the condition is not met + skip = a.newLabel(); + switch (cond) + { + case uml::COND_U: + a.tbz(FLAGS_REG, FLAG_BIT_U, skip); + break; + case uml::COND_NU: + a.tbnz(FLAGS_REG, FLAG_BIT_U, skip); + break; + case uml::COND_C: + case uml::COND_NC: + switch (m_carry_state) + { + case carry_state::CANONICAL: + a.b(ARM_CONDITION(cond), skip); + break; + case carry_state::LOGICAL: + a.b(ARM_NOT_CONDITION(cond), skip); + break; + default: + a.emit((cond == uml::COND_C) ? a64::Inst::kIdTbz : a64::Inst::kIdTbnz, FLAGS_REG, FLAG_BIT_C, skip); + } + break; + case uml::COND_A: + case uml::COND_BE: + load_carry(a, true); + [[fallthrough]]; + default: + a.b(ARM_NOT_CONDITION(cond), skip); + } } -void drcbe_arm64::mov_mem_param(a64::Assembler &a, uint32_t regsize, void *dst, const be_parameter &src) const +void drcbe_arm64::emit_memaccess_setup(asmjit::a64::Assembler &a, const be_parameter &addrp, const memory_accessors &accessors, const address_space::specific_access_info::side &side) const { - const a64::Gp scratch = select_register(SCRATCH_REG2, regsize); + auto const addrreg = (accessors.no_mask || accessors.mask_simple) ? REG_PARAM2 : a64::x6; + mov_reg_param(a, 4, addrreg, addrp); + get_imm_relative(a, a64::x8, uintptr_t(side.dispatch)); - if (src.is_immediate()) + // if the high bits aren't affected by the global mask, extract them early + if (accessors.high_bits && !accessors.mask_high_bits) + a.ubfx(a64::w7, addrreg.w(), accessors.specific.low_bits, accessors.high_bits); + + if (accessors.mask_simple) + a.and_(REG_PARAM2.w(), addrreg.w(), accessors.address_mask); + else if (!accessors.no_mask) + a.mov(REG_PARAM2.w(), accessors.address_mask); // 32-bit value, no more than two instructions + + // if the high address bits aren't affected by the global mask, load the dispatch table entry now + if (!accessors.high_bits) + a.ldr(REG_PARAM1, a64::Mem(a64::x8)); + else if (!accessors.mask_high_bits) + a.ldr(REG_PARAM1, a64::Mem(a64::x8, a64::x7, arm::Shift(arm::ShiftOp::kLSL, 3))); + + // apply non-trivial global mask if necessary + if (!accessors.no_mask && !accessors.mask_simple) + a.and_(REG_PARAM2.w(), REG_PARAM2.w(), addrreg.w()); + + // if the high address bits are affected by the global mask, load the dispatch table entry now + if (accessors.mask_high_bits) + { + a.lsr(a64::w7, REG_PARAM2.w(), accessors.specific.low_bits); + a.ldr(REG_PARAM1, a64::Mem(a64::x8, a64::x7, arm::Shift(arm::ShiftOp::kLSL, 3))); + } + + // apply this pointer displacement if necessary + if (side.displacement) + a.add(REG_PARAM1, REG_PARAM1, side.displacement); // assume less than 4K + + // adjusted dispatch table entry pointer in REG_PARAM1 + // masked address in REG_PARAM2 + // x8, x7 and potentially x6 clobbered +} + +void drcbe_arm64::emit_narrow_memwrite(asmjit::a64::Assembler &a, const be_parameter &addrp, const parameter &spacesizep, const memory_accessors &accessors) const +{ + // expects data in REG_PARAM3 and mask in REG_PARAM4 + + address_space &space = *m_space[spacesizep.space()]; + auto const addrreg = (accessors.no_mask || accessors.mask_simple) ? REG_PARAM2 : a64::x5; + mov_reg_param(a, 4, addrreg, addrp); + get_imm_relative(a, a64::x8, uintptr_t(accessors.specific.write.dispatch)); + + // get the shift count for the data and offset in w7 + int const shift = space.addr_shift() - 3; + uint32_t const shiftmask = (accessors.specific.native_bytes - (1 << spacesizep.size())) << 3; + if (space.endianness() != ENDIANNESS_LITTLE) + { + // swizzle for big Endian spaces + bool const smallshift = (shift <= 0) && (shift >= -3); + if (!smallshift) + { + if (shift < 0) + a.lsl(a64::w6, addrreg.w(), -shift); + else + a.lsr(a64::w6, addrreg.w(), shift); + } + a.mov(a64::w7, shiftmask); + if (smallshift) + a.bic(a64::w7, a64::w7, addrreg.w(), -shift); + else + a.bic(a64::w7, a64::w7, a64::w6); + } + else { - if (src.is_immediate_value(0)) + if (!shift) { - emit_str_mem(a, select_register(a64::xzr, regsize), dst); + a.and_(a64::w7, addrreg.w(), shiftmask); } else { - get_imm_relative(a, scratch.x(), src.immediate()); - emit_str_mem(a, scratch, dst); + if (shift < 0) + a.lsl(a64::w7, addrreg.w(), -shift); + else + a.lsr(a64::w7, addrreg.w(), shift); + a.and_(a64::w7, a64::w7, shiftmask); } } - else if (src.is_memory()) + + // if the high bits aren't affected by the global mask, extract them early + if (accessors.high_bits && !accessors.mask_high_bits) + a.ubfx(a64::w6, addrreg.w(), accessors.specific.low_bits, accessors.high_bits); + + if (accessors.mask_simple) + a.and_(REG_PARAM2.w(), addrreg.w(), accessors.address_mask); + else if (!accessors.no_mask) + a.mov(REG_PARAM2.w(), accessors.address_mask); // 32-bit value, no more than two instructions + + // if the high address bits aren't affected by the global mask, load the dispatch table entry now + if (!accessors.high_bits) + a.ldr(REG_PARAM1, a64::Mem(a64::x8)); + else if (!accessors.mask_high_bits) + a.ldr(REG_PARAM1, a64::Mem(a64::x8, a64::x6, arm::Shift(arm::ShiftOp::kLSL, 3))); + + // apply non-trivial global mask if necessary + if (!accessors.no_mask && !accessors.mask_simple) + a.and_(REG_PARAM2.w(), REG_PARAM2.w(), addrreg.w()); + + // if the high address bits are affected by the global mask, load the dispatch table entry now + if (accessors.mask_high_bits) { - if (regsize == 4) - emit_ldrsw_mem(a, scratch.x(), src.memory()); - else - emit_ldr_mem(a, scratch.x(), src.memory()); + a.lsr(a64::w6, REG_PARAM2.w(), accessors.specific.low_bits); + a.ldr(REG_PARAM1, a64::Mem(a64::x8, a64::x6, arm::Shift(arm::ShiftOp::kLSL, 3))); + } - emit_str_mem(a, scratch, dst); + // apply this pointer displacement if necessary + if (accessors.specific.write.displacement) + a.add(REG_PARAM1, REG_PARAM1, accessors.specific.write.displacement); // assume less than 4K + + // shift the data and mask + a.lsl(REG_PARAM3, REG_PARAM3, a64::x7); + a.lsl(REG_PARAM4, REG_PARAM4, a64::x7); + + // call the write function + if (accessors.specific.write.is_virtual) + { + a.ldr(a64::x8, a64::Mem(REG_PARAM1)); + a.ldr(a64::x8, a64::Mem(a64::x8, accessors.specific.write.function)); // assume no more than 4096 vtable entries + a.blr(a64::x8); } - else if (src.is_int_register()) + else { - emit_str_mem(a, src.get_register_int(regsize), dst); + call_arm_addr(a, (const void *)accessors.specific.write.function); + } +} + +void drcbe_arm64::mov_reg_param(a64::Assembler &a, uint32_t regsize, const a64::Gp &dst, const be_parameter &src) const +{ + if (src.is_immediate()) + { + get_imm_relative(a, select_register(dst, regsize), (regsize == 4) ? uint32_t(src.immediate()) : src.immediate()); + } + else if (src.is_int_register() && dst.id() != src.ireg()) + { + a.mov(select_register(dst, regsize), src.get_register_int(regsize)); + } + else if (src.is_memory()) + { + if ((util::endianness::native == util::endianness::big) && (regsize == 4) && src.is_cold_register()) + emit_ldr_mem(a, select_register(dst, regsize), reinterpret_cast(src.memory()) + 4); + else + emit_ldr_mem(a, select_register(dst, regsize), src.memory()); } } @@ -944,13 +1169,48 @@ void drcbe_arm64::mov_param_reg(a64::Assembler &a, uint32_t regsize, const be_pa assert(!dst.is_immediate()); if (dst.is_memory()) - emit_str_mem(a, select_register(src, regsize), dst.memory()); + { + if (dst.is_cold_register()) + emit_str_mem(a, src.x(), dst.memory()); + else + emit_str_mem(a, select_register(src, regsize), dst.memory()); + } else if (dst.is_int_register() && src.id() != dst.ireg()) + { a.mov(dst.get_register_int(regsize), select_register(src, regsize)); + } +} + +void drcbe_arm64::mov_param_imm(a64::Assembler &a, uint32_t regsize, const be_parameter &dst, uint64_t src) const +{ + assert(!dst.is_immediate()); + + if (dst.is_memory()) + { + const uint32_t movsize = dst.is_cold_register() ? 8 : regsize; + + if (src == 0) + { + emit_str_mem(a, select_register(a64::xzr, movsize), dst.memory()); + } + else + { + const a64::Gp scratch = select_register(SCRATCH_REG2, movsize); + + get_imm_relative(a, scratch, (regsize == 4) ? uint32_t(src) : src); + emit_str_mem(a, scratch, dst.memory()); + } + } + else if (dst.is_int_register()) + { + get_imm_relative(a, dst.get_register_int(regsize), src); + } } void drcbe_arm64::mov_param_param(a64::Assembler &a, uint32_t regsize, const be_parameter &dst, const be_parameter &src) const { + // FIXME: this won't clear upper bits of the output for a 4-byte move when the source is a register or immediate + // need to fix affected cases (mov, sext), currently confounded by issues in the simplifier assert(!dst.is_immediate()); if (src.is_memory()) @@ -975,27 +1235,31 @@ void drcbe_arm64::mov_param_param(a64::Assembler &a, uint32_t regsize, const be_ } } -void drcbe_arm64::mov_param_imm(a64::Assembler &a, uint32_t regsize, const be_parameter &dst, uint64_t src) const +void drcbe_arm64::mov_mem_param(a64::Assembler &a, uint32_t regsize, void *dst, const be_parameter &src) const { - assert(!dst.is_immediate()); + const a64::Gp scratch = select_register(SCRATCH_REG2, regsize); - if (dst.is_memory()) + if (src.is_immediate_value(0)) { - if (src == 0) - { - emit_str_mem(a, select_register(a64::xzr, regsize), dst.memory()); - } + emit_str_mem(a, select_register(a64::xzr, regsize), dst); + } + else if (src.is_immediate()) + { + get_imm_relative(a, scratch, (regsize == 4) ? uint32_t(src.immediate()) : src.immediate()); + emit_str_mem(a, scratch, dst); + } + else if (src.is_memory()) + { + if ((util::endianness::native == util::endianness::big) && (regsize == 4) && src.is_cold_register()) + emit_ldr_mem(a, scratch, reinterpret_cast(src.memory()) + 4); else - { - const a64::Gp scratch = select_register(SCRATCH_REG2, regsize); + emit_ldr_mem(a, scratch, src.memory()); - get_imm_relative(a, scratch, src); - emit_str_mem(a, scratch, dst.memory()); - } + emit_str_mem(a, scratch, dst); } - else if (dst.is_int_register()) + else if (src.is_int_register()) { - a.mov(dst.get_register_int(regsize), src); + emit_str_mem(a, src.get_register_int(regsize), dst); } } @@ -1056,7 +1320,7 @@ void drcbe_arm64::mov_float_param_param(a64::Assembler &a, uint32_t regsize, con void drcbe_arm64::call_arm_addr(a64::Assembler &a, const void *offs) const { const uint64_t codeoffs = a.code()->baseAddress() + a.offset(); - const int64_t reloffs = (int64_t)offs - codeoffs; + const int64_t reloffs = int64_t(offs) - codeoffs; if (is_valid_immediate_signed(reloffs, 26 + 2)) { a.bl(offs); @@ -1068,53 +1332,10 @@ void drcbe_arm64::call_arm_addr(a64::Assembler &a, const void *offs) const } } -void drcbe_arm64::check_unordered_condition(a64::Assembler &a, uml::condition_t cond, Label condition_met, bool not_equal) const -{ - if (cond != uml::COND_U && cond != uml::COND_NU) - return; - - get_unordered(a, SCRATCH_REG1); - - if (cond == uml::COND_U) - { - if (not_equal) - a.cbz(SCRATCH_REG1, condition_met); - else - a.cbnz(SCRATCH_REG1, condition_met); - } - else - { - if (not_equal) - a.cbnz(SCRATCH_REG1, condition_met); - else - a.cbz(SCRATCH_REG1, condition_met); - } -} - -void drcbe_arm64::store_unordered(a64::Assembler &a) const -{ - a.cset(SCRATCH_REG1, a64::CondCode::kPL); - a.cset(SCRATCH_REG2, a64::CondCode::kNE); - a.and_(SCRATCH_REG1, SCRATCH_REG1, SCRATCH_REG2); - a.cset(SCRATCH_REG2, a64::CondCode::kCS); - a.and_(SCRATCH_REG1, SCRATCH_REG1, SCRATCH_REG2); - a.cset(SCRATCH_REG2, a64::CondCode::kVS); - a.and_(SCRATCH_REG1, SCRATCH_REG1, SCRATCH_REG2); - a.bfi(FLAGS_REG, SCRATCH_REG2, 4, 1); -} - -void drcbe_arm64::get_unordered(a64::Assembler &a, const a64::Gp ®) const +void drcbe_arm64::store_carry(a64::Assembler &a, bool inverted) { - a.ubfx(reg.x(), FLAGS_REG, 4, 1); -} + m_carry_state = inverted ? carry_state::LOGICAL : carry_state::CANONICAL; -void drcbe_arm64::store_carry_reg(a64::Assembler &a, const a64::Gp ®) const -{ - a.bfi(FLAGS_REG, reg.x(), 0, 1); -} - -void drcbe_arm64::store_carry(a64::Assembler &a, bool inverted) const -{ if (inverted) a.cset(SCRATCH_REG1, a64::CondCode::kCC); else @@ -1123,27 +1344,45 @@ void drcbe_arm64::store_carry(a64::Assembler &a, bool inverted) const store_carry_reg(a, SCRATCH_REG1); } -void drcbe_arm64::get_carry(a64::Assembler &a, const a64::Gp ®, bool inverted) const +void drcbe_arm64::load_carry(a64::Assembler &a, bool inverted) { - a.and_(reg.x(), FLAGS_REG, 1); + const carry_state desired = inverted ? carry_state::LOGICAL : carry_state::CANONICAL; + if (desired != m_carry_state) + { + m_carry_state = desired; - if (inverted) - a.eor(reg.x(), reg.x(), 1); + a.mrs(SCRATCH_REG1, a64::Predicate::SysReg::kNZCV); + a.bfi(SCRATCH_REG1, FLAGS_REG, 29, 1); + + if (inverted) + a.eor(SCRATCH_REG1, SCRATCH_REG1, 1 << 29); + + a.msr(a64::Predicate::SysReg::kNZCV, SCRATCH_REG1); + } } -void drcbe_arm64::load_carry(a64::Assembler &a, bool inverted) const +void drcbe_arm64::set_flags(asmjit::a64::Assembler &a) { - a.mrs(SCRATCH_REG1, a64::Predicate::SysReg::kNZCV); - a.bfi(SCRATCH_REG1, FLAGS_REG, 29, 1); + // Set native condition codes after loading flags register + m_carry_state = carry_state::POISON; // TODO: take a bet they'll try a conditional branch and set the C flag? - if (inverted) - a.eor(SCRATCH_REG1, SCRATCH_REG1, 1 << 29); + a.mrs(TEMP_REG1, a64::Predicate::SysReg::kNZCV); + + a.and_(TEMP_REG2, FLAGS_REG, 0b1100); // zero + sign + a.ubfx(TEMP_REG3, FLAGS_REG, FLAG_BIT_V, 1); // overflow flag + a.orr(TEMP_REG2, TEMP_REG2, TEMP_REG3); + a.bfi(TEMP_REG1, TEMP_REG2, 28, 4); + + a.msr(a64::Predicate::SysReg::kNZCV, TEMP_REG1); - a.msr(a64::Predicate::SysReg::kNZCV, SCRATCH_REG1); + a.mov(TEMP_REG2, FLAG_C | FLAG_U); + a.and_(FLAGS_REG, FLAGS_REG, TEMP_REG2); } -void drcbe_arm64::calculate_carry_shift_left(a64::Assembler &a, const a64::Gp ®, const a64::Gp &shift, int maxBits) const +void drcbe_arm64::calculate_carry_shift_left(a64::Assembler &a, const a64::Gp ®, const a64::Gp &shift, int maxBits) { + m_carry_state = carry_state::POISON; + Label calc = a.newLabel(); Label end = a.newLabel(); @@ -1163,8 +1402,10 @@ void drcbe_arm64::calculate_carry_shift_left(a64::Assembler &a, const a64::Gp &r a.bind(end); } -void drcbe_arm64::calculate_carry_shift_left_imm(a64::Assembler &a, const a64::Gp ®, const int shift, int maxBits) const +void drcbe_arm64::calculate_carry_shift_left_imm(a64::Assembler &a, const a64::Gp ®, const int shift, int maxBits) { + m_carry_state = carry_state::POISON; + if (shift == 0) { store_carry_reg(a, a64::xzr); @@ -1178,8 +1419,10 @@ void drcbe_arm64::calculate_carry_shift_left_imm(a64::Assembler &a, const a64::G store_carry_reg(a, scratch); } -void drcbe_arm64::calculate_carry_shift_right(a64::Assembler &a, const a64::Gp ®, const a64::Gp &shift) const +void drcbe_arm64::calculate_carry_shift_right(a64::Assembler &a, const a64::Gp ®, const a64::Gp &shift) { + m_carry_state = carry_state::POISON; + Label calc = a.newLabel(); Label end = a.newLabel(); @@ -1198,8 +1441,10 @@ void drcbe_arm64::calculate_carry_shift_right(a64::Assembler &a, const a64::Gp & a.bind(end); } -void drcbe_arm64::calculate_carry_shift_right_imm(a64::Assembler &a, const a64::Gp ®, const int shift) const +void drcbe_arm64::calculate_carry_shift_right_imm(a64::Assembler &a, const a64::Gp ®, const int shift) { + m_carry_state = carry_state::POISON; + if (shift == 0) { store_carry_reg(a, a64::xzr); @@ -1218,9 +1463,11 @@ drcbe_arm64::drcbe_arm64(drcuml_state &drcuml, device_t &device, drc_cache &cach , m_hash(cache, modes, addrbits, ignorebits) , m_map(cache, 0xaaaaaaaa5555) , m_log_asmjit(nullptr) + , m_carry_state(carry_state::POISON) , m_entry(nullptr) , m_exit(nullptr) , m_nocode(nullptr) + , m_endofblock(nullptr) , m_baseptr(cache.near() + 0x100) , m_near(*(near_state *)cache.alloc_near(sizeof(m_near))) { @@ -1245,8 +1492,16 @@ drcbe_arm64::drcbe_arm64(drcuml_state &drcuml, device_t &device, drc_cache &cach { if (m_space[space]) { - m_memory_accessors[space].resolved.set(*m_space[space]); - m_memory_accessors[space].specific = m_space[space]->specific_accessors(); + auto &accessors = m_memory_accessors[space]; + accessors.resolved.set(*m_space[space]); + accessors.specific = m_space[space]->specific_accessors(); + accessors.address_mask = m_space[space]->addrmask() & make_bitmask(accessors.specific.address_width) & ~make_bitmask(accessors.specific.native_mask_bits); + offs_t const shiftedmask = accessors.address_mask >> accessors.specific.low_bits; + offs_t const nomask = ~offs_t(0); + accessors.high_bits = 32 - count_leading_zeros_32(shiftedmask); + accessors.no_mask = nomask == accessors.address_mask; + accessors.mask_simple = !accessors.no_mask && is_valid_immediate_mask(accessors.address_mask, 4); + accessors.mask_high_bits = (shiftedmask & (shiftedmask + 1)) != 0; } } } @@ -1264,9 +1519,9 @@ size_t drcbe_arm64::emit(CodeHolder &ch) size_t const alignment = ch.baseAddress() - uint64_t(m_cache.top()); size_t const code_size = ch.codeSize(); - // test if enough room remains in drc cache + // test if enough room remains in the DRC cache drccodeptr *cachetop = m_cache.begin_codegen(alignment + code_size); - if (cachetop == nullptr) + if (!cachetop) return 0; err = ch.copyFlattenedData(drccodeptr(ch.baseAddress()), code_size, CopySectionFlags::kPadTargetBuffer); @@ -1340,13 +1595,21 @@ void drcbe_arm64::reset() a.bind(a.newNamedLabel("nocode_point")); a.br(REG_PARAM1); + // generate an end-of-block handler point + m_endofblock = dst + a.offset(); + a.bind(a.newNamedLabel("end_of_block_point")); + auto const [entrypoint, adjusted] = util::resolve_member_function(&drcbe_arm64::end_of_block, *this); + get_imm_relative(a, REG_PARAM1, adjusted); + call_arm_addr(a, (const void *)entrypoint); + // emit the generated code emit(ch); // reset our hash tables m_hash.reset(); - m_hash.set_default_codeptr(m_nocode); + + m_carry_state = carry_state::POISON; } int drcbe_arm64::execute(code_handle &entry) @@ -1368,6 +1631,7 @@ void drcbe_arm64::generate(drcuml_block &block, const instruction *instlist, uin // tell all of our utility objects that a block is beginning m_hash.block_begin(block, instlist, numinst); m_map.block_begin(block); + m_carry_state = carry_state::POISON; // compute the base by aligning the cache top to a cache line auto [err, linesize] = osd_get_cache_line_size(); @@ -1408,11 +1672,24 @@ void drcbe_arm64::generate(drcuml_block &block, const instruction *instlist, uin const instruction &inst = instlist[inum]; assert(inst.opcode() < std::size(s_opcode_table)); + // must remain in scope until output + std::string dasm; + + // add a comment + if (logger.file()) + { + dasm = inst.disasm(&m_drcuml); + a.setInlineComment(dasm.c_str()); + } + // generate code (this->*s_opcode_table[inst.opcode()])(a, inst); } - emit_str_mem(a, FLAGS_REG.w(), &m_near.emulated_flags); + // catch falling off the end of a block + if (logger.file()) + a.setInlineComment("end of block"); + a.b(m_endofblock); // emit the generated code if (!emit(ch)) @@ -1423,12 +1700,12 @@ void drcbe_arm64::generate(drcuml_block &block, const instruction *instlist, uin m_map.block_end(block); } -bool drcbe_arm64::hash_exists(uint32_t mode, uint32_t pc) +bool drcbe_arm64::hash_exists(uint32_t mode, uint32_t pc) const noexcept { return m_hash.code_exists(mode, pc); } -void drcbe_arm64::get_info(drcbe_info &info) +void drcbe_arm64::get_info(drcbe_info &info) const noexcept { for (info.direct_iregs = 0; info.direct_iregs < REG_I_COUNT; info.direct_iregs++) { @@ -1443,6 +1720,16 @@ void drcbe_arm64::get_info(drcbe_info &info) } } + +[[noreturn]] void drcbe_arm64::end_of_block() const +{ + osd_printf_error("drcbe_arm64(%s): fell off the end of a generated code block!\n", m_device.tag()); + std::fflush(stdout); + std::fflush(stderr); + std::abort(); +} + + void drcbe_arm64::op_handle(a64::Assembler &a, const uml::instruction &inst) { assert_no_condition(inst); @@ -1450,6 +1737,8 @@ void drcbe_arm64::op_handle(a64::Assembler &a, const uml::instruction &inst) assert(inst.numparams() == 1); assert(inst.param(0).is_code_handle()); + m_carry_state = carry_state::POISON; + // make a label for documentation Label handle = a.newNamedLabel(inst.param(0).handle().string()); a.bind(handle); @@ -1474,6 +1763,8 @@ void drcbe_arm64::op_hash(a64::Assembler &a, const uml::instruction &inst) assert(inst.param(0).is_immediate()); assert(inst.param(1).is_immediate()); + m_carry_state = carry_state::POISON; + const uint64_t mode = inst.param(0).immediate(); const uint64_t pc = inst.param(1).immediate(); @@ -1487,6 +1778,8 @@ void drcbe_arm64::op_label(a64::Assembler &a, const uml::instruction &inst) assert(inst.numparams() == 1); assert(inst.param(0).is_code_label()); + m_carry_state = carry_state::POISON; + std::string labelName = util::string_format("PC$%x", inst.param(0).label()); Label label = a.labelByName(labelName.c_str()); if (!label.isValid()) @@ -1519,7 +1812,8 @@ void drcbe_arm64::op_mapvar(a64::Assembler &a, const uml::instruction &inst) void drcbe_arm64::op_nop(a64::Assembler &a, const uml::instruction &inst) { - a.nop(); + // nothing + //a.nop(); } void drcbe_arm64::op_break(a64::Assembler &a, const uml::instruction &inst) @@ -1528,6 +1822,8 @@ void drcbe_arm64::op_break(a64::Assembler &a, const uml::instruction &inst) assert_no_condition(inst); assert_no_flags(inst); + m_carry_state = carry_state::POISON; + static const char *const message = "break from drc"; get_imm_relative(a, REG_PARAM1, (uintptr_t)message); call_arm_addr(a, (const void *)&osd_break_into_debugger); @@ -1539,10 +1835,12 @@ void drcbe_arm64::op_debug(a64::Assembler &a, const uml::instruction &inst) assert_no_condition(inst); assert_no_flags(inst); - const a64::Gp temp = TEMP_REG1.w(); - if (m_device.machine().debug_flags & DEBUG_FLAG_ENABLED) { + m_carry_state = carry_state::POISON; + + const a64::Gp temp = TEMP_REG1.w(); + be_parameter pcp(*this, inst.param(0), PTYPE_MRI); Label skip = a.newLabel(); @@ -1567,23 +1865,14 @@ void drcbe_arm64::op_exit(a64::Assembler &a, const uml::instruction &inst) be_parameter retp(*this, inst.param(0), PTYPE_MRI); + Label skip; + emit_skip(a, inst.condition(), skip); + mov_reg_param(a, 4, REG_PARAM1, retp); + a.b(m_exit); - if (inst.condition() == uml::COND_ALWAYS) - { - a.b(m_exit); - } - else if (inst.condition() == uml::COND_U || inst.condition() == uml::COND_NU) - { - Label skip = a.newLabel(); - check_unordered_condition(a, inst.condition(), skip, false); - a.b(m_exit); + if (inst.condition() != uml::COND_ALWAYS) a.bind(skip); - } - else - { - a.b(ARM_CONDITION(a, inst.condition()), m_exit); - } } void drcbe_arm64::op_hashjmp(a64::Assembler &a, const uml::instruction &inst) @@ -1691,6 +1980,8 @@ void drcbe_arm64::op_hashjmp(a64::Assembler &a, const uml::instruction &inst) emit_ldr_mem(a, SCRATCH_REG1, targetptr); a.blr(SCRATCH_REG1); } + + m_carry_state = carry_state::POISON; } void drcbe_arm64::op_jmp(a64::Assembler &a, const uml::instruction &inst) @@ -1708,16 +1999,62 @@ void drcbe_arm64::op_jmp(a64::Assembler &a, const uml::instruction &inst) jmptarget = a.newNamedLabel(labelName.c_str()); if (inst.condition() == uml::COND_ALWAYS) + { a.b(jmptarget); - else + return; + } + + const bool bound = a.code()->isLabelBound(jmptarget); + const uint64_t targetoffs = a.code()->baseAddress() + a.code()->labelOffset(jmptarget); + const uint64_t codeoffs = a.code()->baseAddress() + a.offset(); + const bool tbnzrange = bound && is_valid_immediate_signed(int64_t(targetoffs) - codeoffs, 14 + 2); + + switch (inst.condition()) { - if (inst.condition() == COND_C || inst.condition() == COND_NC || inst.condition() == COND_A || inst.condition() == COND_BE) + case uml::COND_U: + case uml::COND_NU: + if (tbnzrange) + { + const a64::Inst::Id opcode = (inst.condition() == uml::COND_U) ? a64::Inst::kIdTbnz : a64::Inst::kIdTbz; + a.emit(opcode, FLAGS_REG, FLAG_BIT_U, jmptarget); + } + else + { + const a64::Inst::Id opcode = (inst.condition() == uml::COND_U) ? a64::Inst::kIdCbnz : a64::Inst::kIdCbz; + get_unordered(a, SCRATCH_REG1); + a.emit(opcode, SCRATCH_REG1, jmptarget); + } + break; + case uml::COND_C: + case uml::COND_NC: + switch (m_carry_state) + { + case carry_state::CANONICAL: + a.b(ARM_NOT_CONDITION(inst.condition()), jmptarget); + break; + case carry_state::LOGICAL: + a.b(ARM_CONDITION(inst.condition()), jmptarget); + break; + default: + if (tbnzrange) + { + const a64::Inst::Id opcode = (inst.condition() == uml::COND_C) ? a64::Inst::kIdTbnz : a64::Inst::kIdTbz; + a.emit(opcode, FLAGS_REG, FLAG_BIT_C, jmptarget); + } + else + { + const a64::Inst::Id opcode = (inst.condition() == uml::COND_C) ? a64::Inst::kIdCbnz : a64::Inst::kIdCbz; + get_carry(a, SCRATCH_REG1); + a.emit(opcode, SCRATCH_REG1, jmptarget); + } + } + break; + case uml::COND_A: + case uml::COND_BE: load_carry(a, true); - - if (inst.condition() == uml::COND_U || inst.condition() == uml::COND_NU) - check_unordered_condition(a, inst.condition(), jmptarget, false); - else - a.b(ARM_CONDITION(a, inst.condition()), jmptarget); + [[fallthrough]]; + default: + a.b(ARM_CONDITION(inst.condition()), jmptarget); } } @@ -1732,18 +2069,7 @@ void drcbe_arm64::op_exh(a64::Assembler &a, const uml::instruction &inst) // perform the exception processing Label no_exception; - if (inst.condition() != uml::COND_ALWAYS) - { - no_exception = a.newLabel(); - - if (inst.condition() == COND_C || inst.condition() == COND_NC || inst.condition() == COND_A || inst.condition() == COND_BE) - load_carry(a, true); - - if (inst.condition() == uml::COND_U || inst.condition() == uml::COND_NU) - check_unordered_condition(a, inst.condition(), no_exception, true); - else - a.b(ARM_NOT_CONDITION(a, inst.condition()), no_exception); - } + emit_skip(a, inst.condition(), no_exception); mov_mem_param(a, 4, &m_state.exp, exp); @@ -1760,6 +2086,8 @@ void drcbe_arm64::op_exh(a64::Assembler &a, const uml::instruction &inst) if (inst.condition() != uml::COND_ALWAYS) a.bind(no_exception); + + m_carry_state = carry_state::POISON; } void drcbe_arm64::op_callh(a64::Assembler &a, const uml::instruction &inst) @@ -1772,18 +2100,7 @@ void drcbe_arm64::op_callh(a64::Assembler &a, const uml::instruction &inst) assert(handp.is_code_handle()); Label skip; - if (inst.condition() != uml::COND_ALWAYS) - { - skip = a.newLabel(); - - if (inst.condition() == COND_C || inst.condition() == COND_NC || inst.condition() == COND_A || inst.condition() == COND_BE) - load_carry(a, true); - - if (inst.condition() == uml::COND_U || inst.condition() == uml::COND_NU) - check_unordered_condition(a, inst.condition(), skip, true); - else - a.b(ARM_NOT_CONDITION(a, inst.condition()), skip); - } + emit_skip(a, inst.condition(), skip); drccodeptr *const targetptr = handp.handle().codeptr_addr(); if (*targetptr != nullptr) @@ -1798,6 +2115,8 @@ void drcbe_arm64::op_callh(a64::Assembler &a, const uml::instruction &inst) if (inst.condition() != uml::COND_ALWAYS) a.bind(skip); + + m_carry_state = carry_state::POISON; } void drcbe_arm64::op_ret(a64::Assembler &a, const uml::instruction &inst) @@ -1808,18 +2127,7 @@ void drcbe_arm64::op_ret(a64::Assembler &a, const uml::instruction &inst) assert(inst.numparams() == 0); Label skip; - if (inst.condition() != uml::COND_ALWAYS) - { - skip = a.newLabel(); - - if (inst.condition() == COND_C || inst.condition() == COND_NC || inst.condition() == COND_A || inst.condition() == COND_BE) - load_carry(a, true); - - if (inst.condition() == uml::COND_U || inst.condition() == uml::COND_NU) - check_unordered_condition(a, inst.condition(), skip, true); - else - a.b(ARM_NOT_CONDITION(a, inst.condition()), skip); - } + emit_skip(a, inst.condition(), skip); a.ldp(a64::x29, a64::x30, arm::Mem(a64::sp).post(16)); a.ret(a64::x30); @@ -1839,18 +2147,7 @@ void drcbe_arm64::op_callc(a64::Assembler &a, const uml::instruction &inst) be_parameter paramp(*this, inst.param(1), PTYPE_M); Label skip; - if (inst.condition() != uml::COND_ALWAYS) - { - skip = a.newLabel(); - - if (inst.condition() == COND_C || inst.condition() == COND_NC || inst.condition() == COND_A || inst.condition() == COND_BE) - load_carry(a, true); - - if (inst.condition() == uml::COND_U || inst.condition() == uml::COND_NU) - check_unordered_condition(a, inst.condition(), skip, true); - else - a.b(ARM_NOT_CONDITION(a, inst.condition()), skip); - } + emit_skip(a, inst.condition(), skip); emit_str_mem(a, FLAGS_REG.w(), &m_near.emulated_flags); @@ -1862,6 +2159,8 @@ void drcbe_arm64::op_callc(a64::Assembler &a, const uml::instruction &inst) if (inst.condition() != uml::COND_ALWAYS) a.bind(skip); + + m_carry_state = carry_state::POISON; } void drcbe_arm64::op_recover(a64::Assembler &a, const uml::instruction &inst) @@ -1870,6 +2169,8 @@ void drcbe_arm64::op_recover(a64::Assembler &a, const uml::instruction &inst) assert_no_condition(inst); assert_no_flags(inst); + m_carry_state = carry_state::POISON; + be_parameter dstp(*this, inst.param(0), PTYPE_MR); a.ldr(REG_PARAM2, arm::Mem(a64::x29, -8)); // saved LR (x30) from first level CALLH/EXH or failed hash jump @@ -1889,7 +2190,6 @@ void drcbe_arm64::op_setfmod(a64::Assembler &a, const uml::instruction &inst) assert_no_flags(inst); be_parameter srcp(*this, inst.param(0), PTYPE_MRI); - const a64::Gp src = srcp.select_register(TEMP_REG1, inst.size()); const a64::Gp scratch = select_register(FUNC_SCRATCH_REG, inst.size()); if (srcp.is_immediate()) @@ -1898,6 +2198,8 @@ void drcbe_arm64::op_setfmod(a64::Assembler &a, const uml::instruction &inst) } else { + const a64::Gp src = srcp.select_register(FUNC_SCRATCH_REG, inst.size()); + mov_reg_param(a, inst.size(), src, srcp); a.and_(scratch, src, 3); } @@ -1943,35 +2245,76 @@ void drcbe_arm64::op_getflgs(a64::Assembler &a, const uml::instruction &inst) const a64::Gp dst = dstp.select_register(TEMP_REG1, 8); - a.mov(dst, a64::xzr); + bool first = true; if (maskp.immediate() & FLAG_C) - a.and_(dst, FLAGS_REG, 1); + { + a.and_(dst, FLAGS_REG, FLAG_C); + first = false; + } if (maskp.immediate() & FLAG_V) { - a.cset(SCRATCH_REG1, a64::CondCode::kVS); - a.orr(dst, dst, SCRATCH_REG1, 1); + if (first) + { + a.cset(dst, a64::CondCode::kVS); + a.lsl(dst, dst, FLAG_BIT_V); + first = false; + } + else + { + a.cset(SCRATCH_REG1, a64::CondCode::kVS); + a.orr(dst, dst, SCRATCH_REG1, FLAG_BIT_V); + } } if (maskp.immediate() & FLAG_Z) { - a.cset(SCRATCH_REG1, a64::CondCode::kEQ); - a.orr(dst, dst, SCRATCH_REG1, 2); + if (first) + { + a.cset(dst, a64::CondCode::kEQ); + a.lsl(dst, dst, FLAG_BIT_Z); + first = false; + } + else + { + a.cset(SCRATCH_REG1, a64::CondCode::kEQ); + a.orr(dst, dst, SCRATCH_REG1, FLAG_BIT_Z); + } } if (maskp.immediate() & FLAG_S) { - a.cset(SCRATCH_REG1, a64::CondCode::kMI); - a.orr(dst, dst, SCRATCH_REG1, 3); + if (first) + { + a.cset(dst, a64::CondCode::kMI); + a.lsl(dst, dst, FLAG_BIT_S); + first = false; + } + else + { + a.cset(SCRATCH_REG1, a64::CondCode::kMI); + a.orr(dst, dst, SCRATCH_REG1, FLAG_BIT_S); + } } if (maskp.immediate() & FLAG_U) { - get_unordered(a, SCRATCH_REG1); - a.orr(dst, dst, SCRATCH_REG1, 4); + if (first) + { + a.and_(dst, FLAGS_REG, FLAG_U); + first = false; + } + else + { + a.and_(SCRATCH_REG1, FLAGS_REG, FLAG_U); + a.orr(dst, dst, SCRATCH_REG1); + } } + if (first) + a.mov(dst, a64::xzr); + mov_param_reg(a, inst.size(), dstp, dst); } @@ -1983,15 +2326,7 @@ void drcbe_arm64::op_setflgs(a64::Assembler &a, const uml::instruction &inst) be_parameter flagsp(*this, inst.param(0), PTYPE_MRI); mov_reg_param(a, inst.size(), FLAGS_REG, flagsp); - - a.mrs(TEMP_REG1, a64::Predicate::SysReg::kNZCV); - - a.and_(TEMP_REG2, FLAGS_REG, 0b1100); // zero + sign - a.ubfx(TEMP_REG3, FLAGS_REG, 1, 1); // overflow flag - a.orr(TEMP_REG2, TEMP_REG2, TEMP_REG3); - a.bfi(TEMP_REG1, TEMP_REG2, 28, 4); - - a.msr(a64::Predicate::SysReg::kNZCV, TEMP_REG1); + set_flags(a); } void drcbe_arm64::op_save(a64::Assembler &a, const uml::instruction &inst) @@ -2013,7 +2348,7 @@ void drcbe_arm64::op_save(a64::Assembler &a, const uml::instruction &inst) a.and_(TEMP_REG2, TEMP_REG1, 0b1100); // zero + sign a.orr(TEMP_REG2, TEMP_REG2, FLAGS_REG); // carry + unordered flags - a.bfi(TEMP_REG2, TEMP_REG1, 1, 1); // overflow flag + a.bfi(TEMP_REG2, TEMP_REG1, FLAG_BIT_V, 1); // overflow flag a.strb(TEMP_REG2.w(), arm::Mem(membase, offsetof(drcuml_machine_state, flags))); @@ -2098,15 +2433,7 @@ void drcbe_arm64::op_restore(a64::Assembler &a, const uml::instruction &inst) emit_str_mem(a, TEMP_REG1.w(), &m_state.exp); a.ldrb(FLAGS_REG.w(), arm::Mem(membase, offsetof(drcuml_machine_state, flags))); - - a.mrs(TEMP_REG1, a64::Predicate::SysReg::kNZCV); - - a.and_(TEMP_REG2, FLAGS_REG, 0b1100); // zero + sign - a.ubfx(TEMP_REG3, FLAGS_REG, 1, 1); // overflow flag - a.orr(TEMP_REG2, TEMP_REG2, TEMP_REG3); - a.bfi(TEMP_REG1, TEMP_REG2, 28, 4); - - a.msr(a64::Predicate::SysReg::kNZCV, TEMP_REG1); + set_flags(a); } void drcbe_arm64::op_load(a64::Assembler &a, const uml::instruction &inst) @@ -2191,18 +2518,18 @@ void drcbe_arm64::op_loads(a64::Assembler &a, const uml::instruction &inst) const a64::Gp basereg = TEMP_REG1; const a64::Gp dstreg = dstp.select_register(TEMP_REG2, inst.size()); - const int32_t offset = indp.is_immediate() ? indp.immediate() << scalesizep.scale() : 0; + const int32_t offset = indp.is_immediate() ? (indp.immediate() << scalesizep.scale()) : 0; if (indp.is_immediate() && is_valid_immediate(offset, 15)) { // immediate index if (size == SIZE_BYTE) - emit_ldrsb_mem(a, dstreg.x(), (uint8_t*)basep.memory() + offset); + emit_ldrsb_mem(a, dstreg.x(), (uint8_t *)basep.memory() + offset); else if (size == SIZE_WORD) - emit_ldrsh_mem(a, dstreg.x(), (uint8_t*)basep.memory() + offset); + emit_ldrsh_mem(a, dstreg.x(), (uint8_t *)basep.memory() + offset); else if (size == SIZE_DWORD) - emit_ldrsw_mem(a, dstreg.x(), (uint8_t*)basep.memory() + offset); + emit_ldrsw_mem(a, dstreg.x(), (uint8_t *)basep.memory() + offset); else - emit_ldr_mem(a, dstreg.x(), (uint8_t*)basep.memory() + offset); + emit_ldr_mem(a, dstreg.x(), (uint8_t *)basep.memory() + offset); } else { @@ -2310,34 +2637,54 @@ void drcbe_arm64::op_read(a64::Assembler &a, const uml::instruction &inst) assert_no_condition(inst); assert_no_flags(inst); + m_carry_state = carry_state::POISON; + be_parameter dstp(*this, inst.param(0), PTYPE_MR); be_parameter addrp(*this, inst.param(1), PTYPE_MRI); const parameter &spacesizep = inst.param(2); assert(spacesizep.is_size_space()); auto const &accessors = m_memory_accessors[spacesizep.space()]; + bool const have_specific = (uintptr_t(nullptr) != accessors.specific.read.function) || accessors.specific.read.is_virtual; - mov_reg_param(a, 4, REG_PARAM2, addrp); - - if (spacesizep.size() == SIZE_BYTE) - { - get_imm_relative(a, REG_PARAM1, accessors.resolved.read_byte.obj); - call_arm_addr(a, accessors.resolved.read_byte.func); - } - else if (spacesizep.size() == SIZE_WORD) - { - get_imm_relative(a, REG_PARAM1, accessors.resolved.read_word.obj); - call_arm_addr(a, accessors.resolved.read_word.func); - } - else if (spacesizep.size() == SIZE_DWORD) + if (have_specific && ((1 << spacesizep.size()) == accessors.specific.native_bytes)) { - get_imm_relative(a, REG_PARAM1, accessors.resolved.read_dword.obj); - call_arm_addr(a, accessors.resolved.read_dword.func); + emit_memaccess_setup(a, addrp, accessors, accessors.specific.read); + if (accessors.specific.read.is_virtual) + { + a.ldr(a64::x8, a64::Mem(REG_PARAM1)); + a.ldr(a64::x8, a64::Mem(a64::x8, accessors.specific.read.function)); // assume no more than 4096 vtable entries + } + a.mov(REG_PARAM3, make_bitmask(accessors.specific.native_bytes << 3)); + if (accessors.specific.read.is_virtual) + a.blr(a64::x8); + else + call_arm_addr(a, (const void *)accessors.specific.read.function); } - else if (spacesizep.size() == SIZE_QWORD) + else { - get_imm_relative(a, REG_PARAM1, accessors.resolved.read_qword.obj); - call_arm_addr(a, accessors.resolved.read_qword.func); + mov_reg_param(a, 4, REG_PARAM2, addrp); + + if (spacesizep.size() == SIZE_BYTE) + { + get_imm_relative(a, REG_PARAM1, accessors.resolved.read_byte.obj); + call_arm_addr(a, accessors.resolved.read_byte.func); + } + else if (spacesizep.size() == SIZE_WORD) + { + get_imm_relative(a, REG_PARAM1, accessors.resolved.read_word.obj); + call_arm_addr(a, accessors.resolved.read_word.func); + } + else if (spacesizep.size() == SIZE_DWORD) + { + get_imm_relative(a, REG_PARAM1, accessors.resolved.read_dword.obj); + call_arm_addr(a, accessors.resolved.read_dword.func); + } + else if (spacesizep.size() == SIZE_QWORD) + { + get_imm_relative(a, REG_PARAM1, accessors.resolved.read_qword.obj); + call_arm_addr(a, accessors.resolved.read_qword.func); + } } mov_param_reg(a, inst.size(), dstp, REG_PARAM1); @@ -2349,6 +2696,8 @@ void drcbe_arm64::op_readm(a64::Assembler &a, const uml::instruction &inst) assert_no_condition(inst); assert_no_flags(inst); + m_carry_state = carry_state::POISON; + be_parameter dstp(*this, inst.param(0), PTYPE_MR); be_parameter addrp(*this, inst.param(1), PTYPE_MRI); be_parameter maskp(*this, inst.param(2), PTYPE_MRI); @@ -2356,29 +2705,48 @@ void drcbe_arm64::op_readm(a64::Assembler &a, const uml::instruction &inst) assert(spacesizep.is_size_space()); auto const &accessors = m_memory_accessors[spacesizep.space()]; + bool const have_specific = (uintptr_t(nullptr) != accessors.specific.read.function) || accessors.specific.read.is_virtual; - mov_reg_param(a, 4, REG_PARAM2, addrp); - mov_reg_param(a, inst.size(), REG_PARAM3, maskp); - - if (spacesizep.size() == SIZE_BYTE) - { - get_imm_relative(a, REG_PARAM1, accessors.resolved.read_byte_masked.obj); - call_arm_addr(a, accessors.resolved.read_byte_masked.func); - } - else if (spacesizep.size() == SIZE_WORD) + if (have_specific && ((1 << spacesizep.size()) == accessors.specific.native_bytes)) { - get_imm_relative(a, REG_PARAM1, accessors.resolved.read_word_masked.obj); - call_arm_addr(a, accessors.resolved.read_word_masked.func); - } - else if (spacesizep.size() == SIZE_DWORD) - { - get_imm_relative(a, REG_PARAM1, accessors.resolved.read_dword_masked.obj); - call_arm_addr(a, accessors.resolved.read_dword_masked.func); + emit_memaccess_setup(a, addrp, accessors, accessors.specific.read); + mov_reg_param(a, inst.size(), REG_PARAM3, maskp); + if (accessors.specific.read.is_virtual) + { + a.ldr(a64::x8, a64::Mem(REG_PARAM1)); + a.ldr(a64::x8, a64::Mem(a64::x8, accessors.specific.read.function)); // assume no more than 4096 vtable entries + a.blr(a64::x8); + } + else + { + call_arm_addr(a, (const void *)accessors.specific.read.function); + } } - else if (spacesizep.size() == SIZE_QWORD) + else { - get_imm_relative(a, REG_PARAM1, accessors.resolved.read_qword_masked.obj); - call_arm_addr(a, accessors.resolved.read_qword_masked.func); + mov_reg_param(a, 4, REG_PARAM2, addrp); + mov_reg_param(a, inst.size(), REG_PARAM3, maskp); + + if (spacesizep.size() == SIZE_BYTE) + { + get_imm_relative(a, REG_PARAM1, accessors.resolved.read_byte_masked.obj); + call_arm_addr(a, accessors.resolved.read_byte_masked.func); + } + else if (spacesizep.size() == SIZE_WORD) + { + get_imm_relative(a, REG_PARAM1, accessors.resolved.read_word_masked.obj); + call_arm_addr(a, accessors.resolved.read_word_masked.func); + } + else if (spacesizep.size() == SIZE_DWORD) + { + get_imm_relative(a, REG_PARAM1, accessors.resolved.read_dword_masked.obj); + call_arm_addr(a, accessors.resolved.read_dword_masked.func); + } + else if (spacesizep.size() == SIZE_QWORD) + { + get_imm_relative(a, REG_PARAM1, accessors.resolved.read_qword_masked.obj); + call_arm_addr(a, accessors.resolved.read_qword_masked.func); + } } mov_param_reg(a, inst.size(), dstp, REG_PARAM1); @@ -2390,35 +2758,62 @@ void drcbe_arm64::op_write(a64::Assembler &a, const uml::instruction &inst) assert_no_condition(inst); assert_no_flags(inst); + m_carry_state = carry_state::POISON; + be_parameter addrp(*this, inst.param(0), PTYPE_MRI); be_parameter srcp(*this, inst.param(1), PTYPE_MRI); const parameter &spacesizep = inst.param(2); assert(spacesizep.is_size_space()); auto const &accessors = m_memory_accessors[spacesizep.space()]; + bool const have_specific = (uintptr_t(nullptr) != accessors.specific.write.function) || accessors.specific.write.is_virtual; - mov_reg_param(a, 4, REG_PARAM2, addrp); - mov_reg_param(a, inst.size(), REG_PARAM3, srcp); - - if (spacesizep.size() == SIZE_BYTE) + if (have_specific && ((1 << spacesizep.size()) == accessors.specific.native_bytes)) { - get_imm_relative(a, REG_PARAM1, accessors.resolved.write_byte.obj); - call_arm_addr(a, accessors.resolved.write_byte.func); - } - else if (spacesizep.size() == SIZE_WORD) - { - get_imm_relative(a, REG_PARAM1, accessors.resolved.write_word.obj); - call_arm_addr(a, accessors.resolved.write_word.func); + emit_memaccess_setup(a, addrp, accessors, accessors.specific.write); + mov_reg_param(a, inst.size(), REG_PARAM3, srcp); + if (accessors.specific.write.is_virtual) + { + a.ldr(a64::x8, a64::Mem(REG_PARAM1)); + a.ldr(a64::x8, a64::Mem(a64::x8, accessors.specific.write.function)); // assume no more than 4096 vtable entries + } + a.mov(REG_PARAM4, make_bitmask(accessors.specific.native_bytes << 3)); + if (accessors.specific.write.is_virtual) + a.blr(a64::x8); + else + call_arm_addr(a, (const void *)accessors.specific.write.function); } - else if (spacesizep.size() == SIZE_DWORD) + else if (have_specific && ((1 << spacesizep.size()) < accessors.specific.native_bytes)) { - get_imm_relative(a, REG_PARAM1, accessors.resolved.write_dword.obj); - call_arm_addr(a, accessors.resolved.write_dword.func); + mov_reg_param(a, inst.size(), REG_PARAM3, srcp); + a.mov(REG_PARAM4, make_bitmask(8 << spacesizep.size())); + emit_narrow_memwrite(a, addrp, spacesizep, accessors); } - else if (spacesizep.size() == SIZE_QWORD) + else { - get_imm_relative(a, REG_PARAM1, accessors.resolved.write_qword.obj); - call_arm_addr(a, accessors.resolved.write_qword.func); + mov_reg_param(a, 4, REG_PARAM2, addrp); + mov_reg_param(a, inst.size(), REG_PARAM3, srcp); + + if (spacesizep.size() == SIZE_BYTE) + { + get_imm_relative(a, REG_PARAM1, accessors.resolved.write_byte.obj); + call_arm_addr(a, accessors.resolved.write_byte.func); + } + else if (spacesizep.size() == SIZE_WORD) + { + get_imm_relative(a, REG_PARAM1, accessors.resolved.write_word.obj); + call_arm_addr(a, accessors.resolved.write_word.func); + } + else if (spacesizep.size() == SIZE_DWORD) + { + get_imm_relative(a, REG_PARAM1, accessors.resolved.write_dword.obj); + call_arm_addr(a, accessors.resolved.write_dword.func); + } + else if (spacesizep.size() == SIZE_QWORD) + { + get_imm_relative(a, REG_PARAM1, accessors.resolved.write_qword.obj); + call_arm_addr(a, accessors.resolved.write_qword.func); + } } } @@ -2428,6 +2823,8 @@ void drcbe_arm64::op_writem(a64::Assembler &a, const uml::instruction &inst) assert_no_condition(inst); assert_no_flags(inst); + m_carry_state = carry_state::POISON; + be_parameter addrp(*this, inst.param(0), PTYPE_MRI); be_parameter srcp(*this, inst.param(1), PTYPE_MRI); be_parameter maskp(*this, inst.param(2), PTYPE_MRI); @@ -2436,30 +2833,55 @@ void drcbe_arm64::op_writem(a64::Assembler &a, const uml::instruction &inst) // set up a call to the write handler auto const &accessors = m_memory_accessors[spacesizep.space()]; + bool const have_specific = (uintptr_t(nullptr) != accessors.specific.write.function) || accessors.specific.write.is_virtual; - mov_reg_param(a, 4, REG_PARAM2, addrp); - mov_reg_param(a, inst.size(), REG_PARAM3, srcp); - mov_reg_param(a, inst.size(), REG_PARAM4, maskp); - - if (spacesizep.size() == SIZE_BYTE) - { - get_imm_relative(a, REG_PARAM1, accessors.resolved.write_byte_masked.obj); - call_arm_addr(a, accessors.resolved.write_byte_masked.func); - } - else if (spacesizep.size() == SIZE_WORD) + if (have_specific && ((1 << spacesizep.size()) == accessors.specific.native_bytes)) { - get_imm_relative(a, REG_PARAM1, accessors.resolved.write_word_masked.obj); - call_arm_addr(a, accessors.resolved.write_word_masked.func); + emit_memaccess_setup(a, addrp, accessors, accessors.specific.write); + mov_reg_param(a, inst.size(), REG_PARAM3, srcp); + if (accessors.specific.write.is_virtual) + { + a.ldr(a64::x8, a64::Mem(REG_PARAM1)); + a.ldr(a64::x8, a64::Mem(a64::x8, accessors.specific.write.function)); // assume no more than 4096 vtable entries + } + mov_reg_param(a, inst.size(), REG_PARAM4, maskp); + if (accessors.specific.write.is_virtual) + a.blr(a64::x8); + else + call_arm_addr(a, (const void *)accessors.specific.write.function); } - else if (spacesizep.size() == SIZE_DWORD) + else if (have_specific && ((1 << spacesizep.size()) < accessors.specific.native_bytes)) { - get_imm_relative(a, REG_PARAM1, accessors.resolved.write_dword_masked.obj); - call_arm_addr(a, accessors.resolved.write_dword_masked.func); + mov_reg_param(a, inst.size(), REG_PARAM3, srcp); + mov_reg_param(a, inst.size(), REG_PARAM4, maskp); + emit_narrow_memwrite(a, addrp, spacesizep, accessors); } - else if (spacesizep.size() == SIZE_QWORD) + else { - get_imm_relative(a, REG_PARAM1, accessors.resolved.write_qword_masked.obj); - call_arm_addr(a, accessors.resolved.write_qword_masked.func); + mov_reg_param(a, 4, REG_PARAM2, addrp); + mov_reg_param(a, inst.size(), REG_PARAM3, srcp); + mov_reg_param(a, inst.size(), REG_PARAM4, maskp); + + if (spacesizep.size() == SIZE_BYTE) + { + get_imm_relative(a, REG_PARAM1, accessors.resolved.write_byte_masked.obj); + call_arm_addr(a, accessors.resolved.write_byte_masked.func); + } + else if (spacesizep.size() == SIZE_WORD) + { + get_imm_relative(a, REG_PARAM1, accessors.resolved.write_word_masked.obj); + call_arm_addr(a, accessors.resolved.write_word_masked.func); + } + else if (spacesizep.size() == SIZE_DWORD) + { + get_imm_relative(a, REG_PARAM1, accessors.resolved.write_dword_masked.obj); + call_arm_addr(a, accessors.resolved.write_dword_masked.func); + } + else if (spacesizep.size() == SIZE_QWORD) + { + get_imm_relative(a, REG_PARAM1, accessors.resolved.write_qword_masked.obj); + call_arm_addr(a, accessors.resolved.write_qword_masked.func); + } } } @@ -2469,6 +2891,8 @@ void drcbe_arm64::op_carry(a64::Assembler &a, const uml::instruction &inst) assert_no_condition(inst); assert_flags(inst, FLAG_C); + m_carry_state = carry_state::POISON; + be_parameter srcp(*this, inst.param(0), PTYPE_MRI); be_parameter bitp(*this, inst.param(1), PTYPE_MRI); @@ -2481,7 +2905,7 @@ void drcbe_arm64::op_carry(a64::Assembler &a, const uml::instruction &inst) if (srcp.is_immediate() && bitp.is_immediate()) { a.mov(scratch, BIT(srcp.immediate(), bitp.immediate())); - a.bfi(FLAGS_REG, scratch.x(), 0, 1); + store_carry_reg(a, scratch); } else if (bitp.is_immediate()) { @@ -2528,25 +2952,42 @@ void drcbe_arm64::op_set(a64::Assembler &a, const uml::instruction &inst) mov_param_imm(a, inst.size(), dstp, 1); return; } - else - { - const a64::Gp dst = dstp.select_register(TEMP_REG1, inst.size()); - if (inst.condition() == COND_C || inst.condition() == COND_NC || inst.condition() == COND_A || inst.condition() == COND_BE) - load_carry(a, true); + const a64::Gp dst = dstp.select_register(TEMP_REG1, inst.size()); - if (inst.condition() == uml::COND_U || inst.condition() == uml::COND_NU) - { + switch (inst.condition()) + { + case uml::COND_U: + case uml::COND_NU: get_unordered(a, dst); - if (inst.condition() == uml::COND_NU) a.eor(dst, dst, 1); - } - else - a.cset(dst, ARM_CONDITION(a, inst.condition())); - - mov_param_reg(a, inst.size(), dstp, dst); + break; + case uml::COND_C: + case uml::COND_NC: + switch (m_carry_state) + { + case carry_state::CANONICAL: + a.cset(dst, ARM_NOT_CONDITION(inst.condition())); + break; + case carry_state::LOGICAL: + a.cset(dst, ARM_CONDITION(inst.condition())); + break; + default: + get_carry(a, dst); + if (inst.condition() == uml::COND_NC) + a.eor(dst, dst, 1); + } + break; + case uml::COND_A: + case uml::COND_BE: + load_carry(a, true); + [[fallthrough]]; + default: + a.cset(dst, ARM_CONDITION(inst.condition())); } + + mov_param_reg(a, inst.size(), dstp, dst); } void drcbe_arm64::op_mov(a64::Assembler &a, const uml::instruction &inst) @@ -2558,26 +2999,92 @@ void drcbe_arm64::op_mov(a64::Assembler &a, const uml::instruction &inst) be_parameter dstp(*this, inst.param(0), PTYPE_MR); be_parameter srcp(*this, inst.param(1), PTYPE_MRI); - // add a conditional branch unless a conditional move is possible - Label skip; + // decide whether a conditional select will be efficient + bool usesel = dstp.is_int_register() && (((inst.size() == 8) && srcp.is_int_register()) || (srcp.is_immediate() && is_simple_mov_immediate(srcp.immediate(), inst.size()))); + switch (inst.condition()) + { + case uml::COND_ALWAYS: + case uml::COND_U: + case uml::COND_NU: + usesel = false; + break; + case uml::COND_C: + case uml::COND_NC: + switch (m_carry_state) + { + case carry_state::CANONICAL: + case carry_state::LOGICAL: + break; + default: + usesel = false; + } + break; + default: + break; + } - if (inst.condition() != uml::COND_ALWAYS) + if (usesel) { - skip = a.newLabel(); + const bool srczero = srcp.is_immediate_value(0); + const bool srcone = srcp.is_immediate_value(1); + const bool srcnegone = (inst.size() == 8) && srcp.is_immediate_value(uint64_t(int64_t(-1))); + const bool srcspecial = srczero || srcone || srcnegone; - if (inst.condition() == COND_C || inst.condition() == COND_NC || inst.condition() == COND_A || inst.condition() == COND_BE) - load_carry(a, true); + const a64::Gp dst = dstp.select_register(TEMP_REG1, 8); + const a64::Gp src = srcspecial ? a64::Gp(a64::xzr) : srcp.select_register(TEMP_REG2, inst.size()); - if (inst.condition() == uml::COND_U || inst.condition() == uml::COND_NU) - check_unordered_condition(a, inst.condition(), skip, true); - else - a.b(ARM_NOT_CONDITION(a, inst.condition()), skip); + mov_reg_param(a, inst.size(), dst, dstp); + if (!srcspecial) + mov_reg_param(a, inst.size(), src, srcp); + + switch (inst.condition()) + { + case uml::COND_C: + case uml::COND_NC: + if (m_carry_state == carry_state::CANONICAL) + { + if (srcone) + a.csinc(dst, dst, src.x(), ARM_CONDITION(inst.condition())); + else if (srcnegone) + a.csinv(dst, dst, src.x(), ARM_CONDITION(inst.condition())); + else + a.csel(dst, src.x(), dst, ARM_NOT_CONDITION(inst.condition())); + } + else + { + if (srcone) + a.csinc(dst, dst, src.x(), ARM_NOT_CONDITION(inst.condition())); + else if (srcnegone) + a.csinv(dst, dst, src.x(), ARM_NOT_CONDITION(inst.condition())); + else + a.csel(dst, src.x(), dst, ARM_CONDITION(inst.condition())); + } + break; + case uml::COND_A: + case uml::COND_BE: + load_carry(a, true); + [[fallthrough]]; + default: + if (srcone) + a.csinc(dst, dst, src.x(), ARM_NOT_CONDITION(inst.condition())); + else if (srcnegone) + a.csinv(dst, dst, src.x(), ARM_NOT_CONDITION(inst.condition())); + else + a.csel(dst, src.x(), dst, ARM_CONDITION(inst.condition())); + } + + mov_param_reg(a, inst.size(), dstp, dst); } + else + { + Label skip; + emit_skip(a, inst.condition(), skip); - mov_param_param(a, inst.size(), dstp, srcp); + mov_param_param(a, inst.size(), dstp, srcp); - if (inst.condition() != uml::COND_ALWAYS) - a.bind(skip); + if (inst.condition() != uml::COND_ALWAYS) + a.bind(skip); + } } void drcbe_arm64::op_sext(a64::Assembler &a, const uml::instruction &inst) @@ -2628,7 +3135,10 @@ void drcbe_arm64::op_sext(a64::Assembler &a, const uml::instruction &inst) } if (inst.flags()) + { a.tst(dstreg, dstreg); + m_carry_state = carry_state::POISON; + } } void drcbe_arm64::op_roland(a64::Assembler &a, const uml::instruction &inst) @@ -2655,7 +3165,10 @@ void drcbe_arm64::op_roland(a64::Assembler &a, const uml::instruction &inst) mov_param_reg(a, inst.size(), dstp, zero); if (inst.flags()) + { a.tst(zero, zero); + m_carry_state = carry_state::POISON; + } return; } @@ -2747,23 +3260,33 @@ void drcbe_arm64::op_roland(a64::Assembler &a, const uml::instruction &inst) } // srcp and the results of the rors above are already going to the output register, so if the mask is all 1s this can all be skipped + const a64::Inst::Id maskop = inst.flags() ? a64::Inst::kIdAnds : a64::Inst::kIdAnd; if (maskp.is_immediate() && is_valid_immediate_mask(maskp.immediate(), inst.size())) { - a.ands(output, output, maskp.immediate()); + a.emit(maskop, output, output, maskp.immediate()); } else if (!maskp.is_immediate() || maskp.immediate() != util::make_bitmask(instbits)) { const a64::Gp mask = maskp.select_register(TEMP_REG2, inst.size()); mov_reg_param(a, inst.size(), mask, maskp); - a.ands(output, output, mask); + a.emit(maskop, output, output, mask); + } + else + { + optimized = true; // need explicit tst if flags are requested } } mov_param_reg(a, inst.size(), dstp, output); if (inst.flags()) - a.tst(output, output); + { + if (optimized) + a.tst(output, output); + + m_carry_state = carry_state::POISON; + } } void drcbe_arm64::op_rolins(a64::Assembler &a, const uml::instruction &inst) @@ -2788,6 +3311,7 @@ void drcbe_arm64::op_rolins(a64::Assembler &a, const uml::instruction &inst) dst = dstp.select_register(TEMP_REG2, inst.size()); mov_reg_param(a, inst.size(), dst, dstp); a.tst(dst, dst); + m_carry_state = carry_state::POISON; } return; @@ -2967,44 +3491,123 @@ void drcbe_arm64::op_rolins(a64::Assembler &a, const uml::instruction &inst) mov_param_reg(a, inst.size(), dstp, dst); if (inst.flags()) + { a.tst(dst, dst); + m_carry_state = carry_state::POISON; + } } -template void drcbe_arm64::op_add(a64::Assembler &a, const uml::instruction &inst) +template void drcbe_arm64::op_add(a64::Assembler &a, const uml::instruction &inst) { assert(inst.size() == 4 || inst.size() == 8); assert_no_condition(inst); assert_flags(inst, FLAG_C | FLAG_V | FLAG_Z | FLAG_S); + const a64::Inst::Id opcode = CarryIn + ? (inst.flags() ? a64::Inst::kIdAdcs : a64::Inst::kIdAdc) + : (inst.flags() ? a64::Inst::kIdAdds : a64::Inst::kIdAdd); + be_parameter dstp(*this, inst.param(0), PTYPE_MR); be_parameter src1p(*this, inst.param(1), PTYPE_MRI); be_parameter src2p(*this, inst.param(2), PTYPE_MRI); + const a64::Gp zero = select_register(a64::xzr, inst.size()); const a64::Gp output = dstp.select_register(TEMP_REG3, inst.size()); - if (Opcode == a64::Inst::kIdAdcs) + if (CarryIn) load_carry(a); - if (src1p.is_immediate() && is_valid_immediate(src1p.immediate(), 11)) + if (src1p.is_immediate_value(0)) + { + if (src2p.is_immediate_value(0)) + { + if (CarryIn) + { + a.emit(opcode, output, zero, zero); + mov_param_reg(a, inst.size(), dstp, output); + } + else + { + mov_param_reg(a, inst.size(), dstp, zero); + a.emit(opcode, zero, zero, zero); + } + } + else if (!CarryIn && src2p.is_immediate() && is_valid_immediate_addsub(src2p.immediate())) + { + a.mov(output, zero); + a.emit(opcode, output, output, src2p.immediate()); + mov_param_reg(a, inst.size(), dstp, output); + } + else if (!CarryIn && src2p.is_immediate() && is_valid_immediate(src2p.immediate(), 24)) + { + a.mov(output, src2p.immediate() & util::make_bitmask(12)); + a.emit(opcode, output, output, src2p.immediate() & (util::make_bitmask(12) << 12)); + mov_param_reg(a, inst.size(), dstp, output); + } + else + { + const a64::Gp src = src2p.select_register(output, inst.size()); + + mov_reg_param(a, inst.size(), src, src2p); + a.emit(opcode, output, src, zero); + mov_param_reg(a, inst.size(), dstp, output); + } + } + else if (src2p.is_immediate_value(0)) + { + if (!CarryIn && src1p.is_immediate() && is_valid_immediate_addsub(src1p.immediate())) + { + a.mov(output, zero); + a.emit(opcode, output, output, src1p.immediate()); + mov_param_reg(a, inst.size(), dstp, output); + } + else if (!CarryIn && src1p.is_immediate() && is_valid_immediate(src1p.immediate(), 24)) + { + a.mov(output, src1p.immediate() & util::make_bitmask(12)); + a.emit(opcode, output, output, src1p.immediate() & (util::make_bitmask(12) << 12)); + mov_param_reg(a, inst.size(), dstp, output); + } + else + { + const a64::Gp src = src1p.select_register(output, inst.size()); + + mov_reg_param(a, inst.size(), src, src1p); + a.emit(opcode, output, src, zero); + mov_param_reg(a, inst.size(), dstp, output); + } + } + else if (!CarryIn && src1p.is_immediate() && is_valid_immediate_addsub(src1p.immediate())) { - const a64::Gp src = src2p.select_register(TEMP_REG2, inst.size()); + const a64::Gp src = src2p.select_register(output, inst.size()); mov_reg_param(a, inst.size(), src, src2p); - if (src1p.immediate() == 0) - a.emit(Opcode, output, src, select_register(a64::xzr, inst.size())); - else - a.emit(Opcode, output, src, src1p.immediate()); + a.emit(opcode, output, src, src1p.immediate()); mov_param_reg(a, inst.size(), dstp, output); } - else if (src2p.is_immediate() && is_valid_immediate(src2p.immediate(), 11)) + else if (!CarryIn && src2p.is_immediate() && is_valid_immediate_addsub(src2p.immediate())) { - const a64::Gp src = src1p.select_register(TEMP_REG1, inst.size()); + const a64::Gp src = src1p.select_register(output, inst.size()); mov_reg_param(a, inst.size(), src, src1p); - if (src2p.is_immediate_value(0)) - a.emit(Opcode, output, src, select_register(a64::xzr, inst.size())); - else - a.emit(Opcode, output, src, src2p.immediate()); + a.emit(opcode, output, src, src2p.immediate()); + mov_param_reg(a, inst.size(), dstp, output); + } + else if (!CarryIn && !inst.flags() && src1p.is_immediate() && is_valid_immediate(src1p.immediate(), 24)) + { + const a64::Gp src = src2p.select_register(output, inst.size()); + + mov_reg_param(a, inst.size(), src, src2p); + a.emit(opcode, output, src, src1p.immediate() & util::make_bitmask(12)); + a.emit(opcode, output, output, src1p.immediate() & (util::make_bitmask(12) << 12)); + mov_param_reg(a, inst.size(), dstp, output); + } + else if (!CarryIn && !inst.flags() && src2p.is_immediate() && is_valid_immediate(src2p.immediate(), 24)) + { + const a64::Gp src = src1p.select_register(output, inst.size()); + + mov_reg_param(a, inst.size(), src, src1p); + a.emit(opcode, output, src, src2p.immediate() & util::make_bitmask(12)); + a.emit(opcode, output, output, src2p.immediate() & (util::make_bitmask(12) << 12)); mov_param_reg(a, inst.size(), dstp, output); } else @@ -3014,51 +3617,96 @@ template void drcbe_arm64::op_add(a64::Assembler &a, cons mov_reg_param(a, inst.size(), src1, src1p); mov_reg_param(a, inst.size(), src2, src2p); - a.emit(Opcode, output, src1, src2); + a.emit(opcode, output, src1, src2); mov_param_reg(a, inst.size(), dstp, output); } - store_carry(a); + if (inst.flags()) + store_carry(a); } -template void drcbe_arm64::op_sub(a64::Assembler &a, const uml::instruction &inst) +template void drcbe_arm64::op_sub(a64::Assembler &a, const uml::instruction &inst) { assert(inst.size() == 4 || inst.size() == 8); assert_no_condition(inst); assert_flags(inst, FLAG_C | FLAG_V | FLAG_Z | FLAG_S); + const a64::Inst::Id opcode = CarryIn + ? (inst.flags() ? a64::Inst::kIdSbcs : a64::Inst::kIdSbc) + : (inst.flags() ? a64::Inst::kIdSubs : a64::Inst::kIdSub); + be_parameter dstp(*this, inst.param(0), PTYPE_MR); be_parameter src1p(*this, inst.param(1), PTYPE_MRI); be_parameter src2p(*this, inst.param(2), PTYPE_MRI); - if (Opcode == a64::Inst::kIdSbcs) + if (CarryIn) load_carry(a, true); + const a64::Gp zero = select_register(a64::xzr, inst.size()); const a64::Gp output = dstp.select_register(TEMP_REG3, inst.size()); - if (src2p.is_immediate() && is_valid_immediate(src2p.immediate(), 11)) + if (src2p.is_immediate_value(0)) + { + if (src1p.is_immediate_value(0)) + { + if (CarryIn) + { + a.emit(opcode, output, zero, zero); + mov_param_reg(a, inst.size(), dstp, output); + } + else + { + mov_param_reg(a, inst.size(), dstp, zero); + a.emit(opcode, zero, zero, zero); + } + } + else + { + const a64::Gp src = src1p.select_register(output, inst.size()); + + mov_reg_param(a, inst.size(), src, src1p); + if (CarryIn) + { + a.emit(opcode, output, src, zero); + mov_param_reg(a, inst.size(), dstp, output); + } + else + { + mov_param_reg(a, inst.size(), dstp, src); + a.emit(opcode, zero, src, zero); + } + } + } + else if (!CarryIn && src2p.is_immediate() && is_valid_immediate_addsub(src2p.immediate())) + { + const a64::Gp src = src1p.select_register(output, inst.size()); + + mov_reg_param(a, inst.size(), src, src1p); + a.emit(opcode, output, src, src2p.immediate()); + mov_param_reg(a, inst.size(), dstp, output); + } + else if (!CarryIn && (!inst.flags() || src1p.is_immediate_value(0)) && src2p.is_immediate() && is_valid_immediate(src2p.immediate(), 24)) { - const a64::Gp src = select_register(TEMP_REG1, inst.size()); + const a64::Gp src = src1p.select_register(output, inst.size()); mov_reg_param(a, inst.size(), src, src1p); - if (src2p.is_immediate_value(0)) - a.emit(Opcode, output, src, select_register(a64::xzr, inst.size())); - else - a.emit(Opcode, output, src, src2p.immediate()); + a.emit(opcode, output, src, src2p.immediate() & util::make_bitmask(12)); + a.emit(opcode, output, output, src2p.immediate() & (util::make_bitmask(12) << 12)); mov_param_reg(a, inst.size(), dstp, output); } else { - const a64::Gp src1 = select_register(TEMP_REG1, inst.size()); - const a64::Gp src2 = select_register(TEMP_REG2, inst.size()); + const a64::Gp src1 = src1p.select_register(TEMP_REG1, inst.size()); + const a64::Gp src2 = src2p.select_register(TEMP_REG2, inst.size()); mov_reg_param(a, inst.size(), src1, src1p); mov_reg_param(a, inst.size(), src2, src2p); - a.emit(Opcode, output, src1, src2); + a.emit(opcode, output, src1, src2); mov_param_reg(a, inst.size(), dstp, output); } - store_carry(a, true); + if (inst.flags()) + store_carry(a, true); } void drcbe_arm64::op_cmp(a64::Assembler &a, const uml::instruction &inst) @@ -3070,22 +3718,23 @@ void drcbe_arm64::op_cmp(a64::Assembler &a, const uml::instruction &inst) be_parameter src1p(*this, inst.param(0), PTYPE_MRI); be_parameter src2p(*this, inst.param(1), PTYPE_MRI); - const a64::Gp temp = select_register(TEMP_REG1, inst.size()); - const a64::Gp temp2 = select_register(TEMP_REG2, inst.size()); + const a64::Gp src1 = src1p.select_register(TEMP_REG1, inst.size()); - mov_reg_param(a, inst.size(), temp, src1p); + mov_reg_param(a, inst.size(), src1, src1p); - if (src2p.is_immediate() && is_valid_immediate(src2p.immediate(), 11)) + if (src2p.is_immediate() && is_valid_immediate_addsub(src2p.immediate())) { if (src2p.is_immediate_value(0)) - a.cmp(temp, select_register(a64::xzr, inst.size())); + a.cmp(src1, select_register(a64::xzr, inst.size())); else - a.cmp(temp, src2p.immediate()); + a.cmp(src1, src2p.immediate()); } else { - mov_reg_param(a, inst.size(), temp2, src2p); - a.cmp(temp, temp2); + const a64::Gp src2 = src2p.select_register(TEMP_REG2, inst.size()); + + mov_reg_param(a, inst.size(), src2, src2p); + a.cmp(src1, src2); } store_carry(a, true); @@ -3153,6 +3802,8 @@ void drcbe_arm64::op_mulu(a64::Assembler &a, const uml::instruction &inst) a.bfi(SCRATCH_REG1, TEMP_REG3, 31, 1); // sign flag a.msr(a64::Predicate::SysReg::kNZCV, SCRATCH_REG1); + + m_carry_state = carry_state::POISON; } } @@ -3211,6 +3862,8 @@ void drcbe_arm64::op_mululw(a64::Assembler &a, const uml::instruction &inst) a.bfi(TEMP_REG1, SCRATCH_REG1, 31, 1); // sign flag a.msr(a64::Predicate::SysReg::kNZCV, TEMP_REG1); + + m_carry_state = carry_state::POISON; } } @@ -3286,6 +3939,8 @@ void drcbe_arm64::op_muls(a64::Assembler &a, const uml::instruction &inst) a.bfi(SCRATCH_REG1, TEMP_REG1, 31, 1); // sign flag a.msr(a64::Predicate::SysReg::kNZCV, SCRATCH_REG1); + + m_carry_state = carry_state::POISON; } } @@ -3357,6 +4012,8 @@ void drcbe_arm64::op_mulslw(a64::Assembler &a, const uml::instruction &inst) a.bfi(SCRATCH_REG1, TEMP_REG1, 31, 1); // sign flag a.msr(a64::Predicate::SysReg::kNZCV, SCRATCH_REG1); + + m_carry_state = carry_state::POISON; } } @@ -3412,6 +4069,7 @@ template void drcbe_arm64::op_div(a64::Assembler &a, cons a.mov(SCRATCH_REG1, 1 << 28); // set overflow flag a.msr(a64::Predicate::SysReg::kNZCV, SCRATCH_REG1); } + m_carry_state = carry_state::POISON; } void drcbe_arm64::op_and(a64::Assembler &a, const uml::instruction &inst) @@ -3420,6 +4078,8 @@ void drcbe_arm64::op_and(a64::Assembler &a, const uml::instruction &inst) assert_no_condition(inst); assert_flags(inst, FLAG_Z | FLAG_S); + const a64::Inst::Id opcode = inst.flags() ? a64::Inst::kIdAnds : a64::Inst::kIdAnd; + be_parameter dstp(*this, inst.param(0), PTYPE_MR); be_parameter src1p(*this, inst.param(1), PTYPE_MRI); be_parameter src2p(*this, inst.param(2), PTYPE_MRI); @@ -3440,31 +4100,48 @@ void drcbe_arm64::op_and(a64::Assembler &a, const uml::instruction &inst) if (inst.flags()) a.tst(dst, dst); } + else if (src1p.is_immediate() && is_valid_immediate_mask(src1p.immediate(), inst.size())) + { + const a64::Gp src2 = src2p.select_register(dst, inst.size()); + mov_reg_param(a, inst.size(), src2, src2p); + + a.emit(opcode, dst, src2, src1p.immediate()); + } else if (src2p.is_immediate() && is_valid_immediate_mask(src2p.immediate(), inst.size())) { - const a64::Gp src1 = src1p.select_register(TEMP_REG1, inst.size()); + const a64::Gp src1 = src1p.select_register(dst, inst.size()); mov_reg_param(a, inst.size(), src1, src1p); - a.ands(dst, src1, src2p.immediate()); + a.emit(opcode, dst, src1, src2p.immediate()); } - else if (!inst.flags() && (inst.size() == 8) && src2p.is_immediate() && is_valid_immediate_mask(src2p.immediate(), 4)) + else if ((inst.size() == 8) && src1p.is_immediate() && is_valid_immediate_mask(src1p.immediate(), 4) && (!inst.flags() || !BIT(src1p.immediate(), 31))) { - const a64::Gp src1 = src1p.select_register(TEMP_REG1, inst.size()); + const a64::Gp src2 = src2p.select_register(dst, inst.size()); + mov_reg_param(a, inst.size(), src2, src2p); + + a.emit(opcode, dst.w(), src2.w(), src1p.immediate()); + } + else if ((inst.size() == 8) && src2p.is_immediate() && is_valid_immediate_mask(src2p.immediate(), 4) && (!inst.flags() || !BIT(src2p.immediate(), 31))) + { + const a64::Gp src1 = src1p.select_register(dst, inst.size()); mov_reg_param(a, inst.size(), src1, src1p); - a.and_(dst.w(), src1.w(), src2p.immediate()); + a.emit(opcode, dst.w(), src1.w(), src2p.immediate()); } else { - const a64::Gp src1 = src1p.select_register(TEMP_REG1, inst.size()); - const a64::Gp src2 = src2p.select_register(TEMP_REG2, inst.size()); + const a64::Gp src1 = src1p.select_register(dst, inst.size()); + const a64::Gp src2 = src2p.select_register(TEMP_REG1, inst.size()); mov_reg_param(a, inst.size(), src1, src1p); mov_reg_param(a, inst.size(), src2, src2p); - a.ands(dst, src1, src2); + a.emit(opcode, dst, src1, src2); } mov_param_reg(a, inst.size(), dstp, dst); + + if (inst.flags()) + m_carry_state = carry_state::POISON; } void drcbe_arm64::op_test(a64::Assembler &a, const uml::instruction &inst) @@ -3479,20 +4156,40 @@ void drcbe_arm64::op_test(a64::Assembler &a, const uml::instruction &inst) const a64::Gp src1 = src1p.select_register(TEMP_REG1, inst.size()); const a64::Gp src2 = src2p.select_register(TEMP_REG2, inst.size()); - mov_reg_param(a, inst.size(), src1, src1p); + if (src1p.is_immediate_value(0) || src2p.is_immediate_value(0)) + { + const a64::Gp zero = select_register(a64::xzr, inst.size()); - if (src2p.is_immediate() && is_valid_immediate_mask(src2p.immediate(), inst.size())) + a.tst(zero, zero); + } + else if (src2p.is_immediate_value(util::make_bitmask(inst.size() * 8))) { - if (src2p.is_immediate_value(0)) - a.tst(src1, select_register(a64::xzr, inst.size())); - else - a.tst(src1, src2p.immediate()); + mov_reg_param(a, inst.size(), src1, src1p); + a.tst(src1, src1); + } + else if (src1p.is_immediate_value(util::make_bitmask(inst.size() * 8))) + { + mov_reg_param(a, inst.size(), src2, src2p); + a.tst(src2, src2); + } + else if (src2p.is_immediate() && is_valid_immediate_mask(src2p.immediate(), inst.size())) + { + mov_reg_param(a, inst.size(), src1, src1p); + a.tst(src1, src2p.immediate()); + } + else if (src1p.is_immediate() && is_valid_immediate_mask(src1p.immediate(), inst.size())) + { + mov_reg_param(a, inst.size(), src2, src2p); + a.tst(src2, src1p.immediate()); } else { + mov_reg_param(a, inst.size(), src1, src1p); mov_reg_param(a, inst.size(), src2, src2p); a.tst(src1, src2); } + + m_carry_state = carry_state::POISON; } void drcbe_arm64::op_or(a64::Assembler &a, const uml::instruction &inst) @@ -3543,7 +4240,10 @@ void drcbe_arm64::op_or(a64::Assembler &a, const uml::instruction &inst) mov_param_reg(a, inst.size(), dstp, dst); if (inst.flags()) + { a.tst(dst, dst); + m_carry_state = carry_state::POISON; + } } void drcbe_arm64::op_xor(a64::Assembler &a, const uml::instruction &inst) @@ -3589,7 +4289,10 @@ void drcbe_arm64::op_xor(a64::Assembler &a, const uml::instruction &inst) mov_param_reg(a, inst.size(), dstp, dst); if (inst.flags()) + { a.tst(dst, dst); + m_carry_state = carry_state::POISON; + } } void drcbe_arm64::op_lzcnt(a64::Assembler &a, const uml::instruction &inst) @@ -3611,7 +4314,10 @@ void drcbe_arm64::op_lzcnt(a64::Assembler &a, const uml::instruction &inst) mov_param_reg(a, inst.size(), dstp, dst); if (inst.flags()) + { a.tst(dst, dst); + m_carry_state = carry_state::POISON; + } } void drcbe_arm64::op_tzcnt(a64::Assembler &a, const uml::instruction &inst) @@ -3638,6 +4344,7 @@ void drcbe_arm64::op_tzcnt(a64::Assembler &a, const uml::instruction &inst) { a.eor(temp, dst, inst.size() * 8); a.tst(temp, temp); + m_carry_state = carry_state::POISON; } } @@ -3663,7 +4370,10 @@ void drcbe_arm64::op_bswap(a64::Assembler &a, const uml::instruction &inst) mov_param_reg(a, inst.size(), dstp, dst); if (inst.flags()) + { a.tst(dst, dst); + m_carry_state = carry_state::POISON; + } } @@ -3720,7 +4430,10 @@ template void drcbe_arm64::op_shift(a64::Assembler &a, co } if (inst.flags()) + { a.tst(dst, dst); + m_carry_state = carry_state::POISON; + } // save dst after using inputs for calculations so the registers have no chance of being overwritten mov_param_reg(a, inst.size(), dstp, dst); @@ -3782,7 +4495,10 @@ void drcbe_arm64::op_rol(a64::Assembler &a, const uml::instruction &inst) } if (inst.flags()) + { a.tst(output, output); + m_carry_state = carry_state::POISON; + } mov_param_reg(a, inst.size(), dstp, output); } @@ -3876,6 +4592,8 @@ void drcbe_arm64::op_rolc(a64::Assembler &a, const uml::instruction &inst) a.tst(output, output); mov_param_reg(a, inst.size(), dstp, output); + + m_carry_state = carry_state::POISON; } void drcbe_arm64::op_rorc(a64::Assembler &a, const uml::instruction &inst) @@ -3970,6 +4688,8 @@ void drcbe_arm64::op_rorc(a64::Assembler &a, const uml::instruction &inst) a.tst(output, output); mov_param_reg(a, inst.size(), dstp, output); + + m_carry_state = carry_state::POISON; } void drcbe_arm64::op_fload(a64::Assembler &a, const uml::instruction &inst) @@ -4040,6 +4760,8 @@ void drcbe_arm64::op_fread(a64::Assembler &a, const uml::instruction &inst) assert_no_condition(inst); assert_no_flags(inst); + m_carry_state = carry_state::POISON; + be_parameter dstp(*this, inst.param(0), PTYPE_MR); be_parameter addrp(*this, inst.param(1), PTYPE_MRI); const parameter &spacesizep = inst.param(2); @@ -4072,6 +4794,8 @@ void drcbe_arm64::op_fwrite(a64::Assembler &a, const uml::instruction &inst) assert_no_condition(inst); assert_no_flags(inst); + m_carry_state = carry_state::POISON; + be_parameter addrp(*this, inst.param(0), PTYPE_MRI); be_parameter srcp(*this, inst.param(1), PTYPE_MF); const parameter &spacesizep = inst.param(2); @@ -4106,24 +4830,67 @@ void drcbe_arm64::op_fmov(a64::Assembler &a, const uml::instruction &inst) be_parameter dstp(*this, inst.param(0), PTYPE_MF); be_parameter srcp(*this, inst.param(1), PTYPE_MF); - Label skip; - if (inst.condition() != uml::COND_ALWAYS) + // decide whether a conditional select will be efficient + bool usesel = dstp.is_float_register() && srcp.is_float_register(); + switch (inst.condition()) + { + case uml::COND_ALWAYS: + case uml::COND_U: + case uml::COND_NU: + usesel = false; + break; + case uml::COND_C: + case uml::COND_NC: + switch (m_carry_state) + { + case carry_state::CANONICAL: + case carry_state::LOGICAL: + break; + default: + usesel = false; + } + break; + default: + break; + } + + if (usesel) { - skip = a.newLabel(); + const a64::Vec dstreg = dstp.select_register(TEMPF_REG1, inst.size()); + const a64::Vec srcreg = srcp.select_register(TEMPF_REG2, inst.size()); - if (inst.condition() == COND_C || inst.condition() == COND_NC || inst.condition() == COND_A || inst.condition() == COND_BE) - load_carry(a, true); + mov_float_reg_param(a, inst.size(), dstreg, dstp); + mov_float_reg_param(a, inst.size(), srcreg, srcp); - if (inst.condition() == uml::COND_U || inst.condition() == uml::COND_NU) - check_unordered_condition(a, inst.condition(), skip, true); - else - a.b(ARM_NOT_CONDITION(a, inst.condition()), skip); + switch (inst.condition()) + { + case uml::COND_C: + case uml::COND_NC: + if (m_carry_state == carry_state::CANONICAL) + a.fcsel(dstreg, srcreg, dstreg, ARM_NOT_CONDITION(inst.condition())); + else + a.fcsel(dstreg, srcreg, dstreg, ARM_CONDITION(inst.condition())); + break; + case uml::COND_A: + case uml::COND_BE: + load_carry(a, true); + [[fallthrough]]; + default: + a.fcsel(dstreg, srcreg, dstreg, ARM_CONDITION(inst.condition())); + } + + mov_float_param_reg(a, inst.size(), dstp, dstreg); } + else + { + Label skip; + emit_skip(a, inst.condition(), skip); - mov_float_param_param(a, inst.size(), dstp, srcp); + mov_float_param_param(a, inst.size(), dstp, srcp); - if (inst.condition() != uml::COND_ALWAYS) - a.bind(skip); + if (inst.condition() != uml::COND_ALWAYS) + a.bind(skip); + } } void drcbe_arm64::op_ftoint(a64::Assembler &a, const uml::instruction &inst) diff --git a/src/devices/cpu/drcbearm64.h b/src/devices/cpu/drcbearm64.h index 2006b4a14abda..d21798bb9b3d4 100644 --- a/src/devices/cpu/drcbearm64.h +++ b/src/devices/cpu/drcbearm64.h @@ -1,5 +1,5 @@ // license:BSD-3-Clause -// copyright-holders:windyfairy +// copyright-holders:windyfairy, Vas Crabb #ifndef MAME_CPU_DRCBEARM64_H #define MAME_CPU_DRCBEARM64_H diff --git a/src/devices/cpu/drcbec.cpp b/src/devices/cpu/drcbec.cpp index f6f1e1a924265..f23cf6c787e8c 100644 --- a/src/devices/cpu/drcbec.cpp +++ b/src/devices/cpu/drcbec.cpp @@ -368,8 +368,8 @@ class drcbe_c : public drcbe_interface virtual void reset() override; virtual int execute(uml::code_handle &entry) override; virtual void generate(drcuml_block &block, const uml::instruction *instlist, uint32_t numinst) override; - virtual bool hash_exists(uint32_t mode, uint32_t pc) override; - virtual void get_info(drcbe_info &info) override; + virtual bool hash_exists(uint32_t mode, uint32_t pc) const noexcept override; + virtual void get_info(drcbe_info &info) const noexcept override; private: // helpers @@ -681,7 +681,7 @@ void drcbe_c::generate(drcuml_block &block, const instruction *instlist, uint32_ // exists in the hash table //------------------------------------------------- -bool drcbe_c::hash_exists(uint32_t mode, uint32_t pc) +bool drcbe_c::hash_exists(uint32_t mode, uint32_t pc) const noexcept { return m_hash.code_exists(mode, pc); } @@ -692,7 +692,7 @@ bool drcbe_c::hash_exists(uint32_t mode, uint32_t pc) // back-end implementation //------------------------------------------------- -void drcbe_c::get_info(drcbe_info &info) +void drcbe_c::get_info(drcbe_info &info) const noexcept { info.direct_iregs = 0; info.direct_fregs = 0; diff --git a/src/devices/cpu/drcbeut.h b/src/devices/cpu/drcbeut.h index 5a8c309e7b864..8894591342928 100644 --- a/src/devices/cpu/drcbeut.h +++ b/src/devices/cpu/drcbeut.h @@ -15,6 +15,7 @@ #include "mfpresolve.h" +#include #include #include #include @@ -36,14 +37,14 @@ class drc_hash_table drc_hash_table(drc_cache &cache, uint32_t modes, uint8_t addrbits, uint8_t ignorebits); // getters - drccodeptr ***base() const { return m_base; } - uint8_t l1bits() const { return m_l1bits; } - uint8_t l2bits() const { return m_l2bits; } - uint8_t l1shift() const { return m_l1shift; } - uint8_t l2shift() const { return m_l2shift; } - offs_t l1mask() const { return m_l1mask; } - offs_t l2mask() const { return m_l2mask; } - bool is_mode_populated(uint32_t mode) const { return m_base[mode] != m_emptyl1; } + drccodeptr ***base() const noexcept { return m_base; } + uint8_t l1bits() const noexcept { return m_l1bits; } + uint8_t l2bits() const noexcept { return m_l2bits; } + uint8_t l1shift() const noexcept { return m_l1shift; } + uint8_t l2shift() const noexcept { return m_l2shift; } + offs_t l1mask() const noexcept { return m_l1mask; } + offs_t l2mask() const noexcept { return m_l2mask; } + bool is_mode_populated(uint32_t mode) const noexcept { return m_base[mode] != m_emptyl1; } // set up and configuration bool reset(); @@ -55,8 +56,8 @@ class drc_hash_table // code pointer access bool set_codeptr(uint32_t mode, uint32_t pc, drccodeptr code); - drccodeptr get_codeptr(uint32_t mode, uint32_t pc) { assert(mode < m_modes); return m_base[mode][(pc >> m_l1shift) & m_l1mask][(pc >> m_l2shift) & m_l2mask]; } - bool code_exists(uint32_t mode, uint32_t pc) { return get_codeptr(mode, pc) != m_nocodeptr; } + drccodeptr get_codeptr(uint32_t mode, uint32_t pc) const noexcept { assert(mode < m_modes); return m_base[mode][(pc >> m_l1shift) & m_l1mask][(pc >> m_l2shift) & m_l2mask]; } + bool code_exists(uint32_t mode, uint32_t pc) const noexcept { return get_codeptr(mode, pc) != m_nocodeptr; } private: // internal state diff --git a/src/devices/cpu/drcbex64.cpp b/src/devices/cpu/drcbex64.cpp index d6dab04f58d9a..af602c0dc5038 100644 --- a/src/devices/cpu/drcbex64.cpp +++ b/src/devices/cpu/drcbex64.cpp @@ -122,7 +122,7 @@ R14 - maps to I5 R15 - maps to I6 - Registers (Linux/MacOS): + Registers (SysV) RAX - scratch register RBX - maps to I0 RCX - scratch register @@ -146,7 +146,7 @@ Exit point: Assumes exit value is in RAX. - Top-level generated code frame: + Top-level generated code frame (Windows): [rsp+0x00] - rcx home/scratch [rsp+0x08] - rdx home/scratch [rsp+0x10] - r8 home/scratch @@ -162,6 +162,20 @@ [rsp+0x60] - saved rbx [rsp+0x68] - ret + Top-level generated code frame (SysV): + [rsp+0x00] - scratch + [rsp+0x08] - scratch + [rsp+0x10] - scratch + [rsp+0x18] - scratch + [rsp+0x20] - scratch + [rsp+0x28] - saved r15 + [rsp+0x30] - saved r14 + [rsp+0x38] - saved r13 + [rsp+0x40] - saved r12 + [rsp+0x48] - saved rbp + [rsp+0x50] - saved rbx + [rsp+0x58] - ret + Generated code subroutine call frame: [rsp+0x00] - rcx home/scratch [rsp+0x08] - rdx home/scratch @@ -179,11 +193,7 @@ - saved r14 - saved r13 - saved r12 - - saved rdi - - saved rsi - - saved rbp - - saved rbx - - ret + ... ***************************************************************************/ @@ -196,9 +206,13 @@ #include "debug/debugcpu.h" #include "emuopts.h" +#include "mfpresolve.h" + #include "asmjit/src/asmjit/asmjit.h" #include +#include +#include #include @@ -368,18 +382,15 @@ class drcbe_x64 : public drcbe_interface virtual void reset() override; virtual int execute(uml::code_handle &entry) override; virtual void generate(drcuml_block &block, const uml::instruction *instlist, uint32_t numinst) override; - virtual bool hash_exists(uint32_t mode, uint32_t pc) override; - virtual void get_info(drcbe_info &info) override; - virtual bool logging() const override { return m_log != nullptr; } + virtual bool hash_exists(uint32_t mode, uint32_t pc) const noexcept override; + virtual void get_info(drcbe_info &info) const noexcept override; + virtual bool logging() const noexcept override { return m_log != nullptr; } private: // a be_parameter is similar to a uml::parameter but maps to native registers/memory class be_parameter { public: - // HACK: leftover from x86emit - static inline constexpr int REG_MAX = 16; - // parameter types enum be_parameter_type { @@ -395,8 +406,8 @@ class drcbe_x64 : public drcbe_interface typedef uint64_t be_parameter_value; // construction - be_parameter() : m_type(PTYPE_NONE), m_value(0) { } - be_parameter(uint64_t val) : m_type(PTYPE_IMMEDIATE), m_value(val) { } + be_parameter() : m_type(PTYPE_NONE), m_value(0), m_coldreg(false) { } + be_parameter(uint64_t val) : m_type(PTYPE_IMMEDIATE), m_value(val), m_coldreg(false) { } be_parameter(drcbe_x64 &drcbe, const uml::parameter ¶m, uint32_t allowed); be_parameter(const be_parameter ¶m) = default; @@ -407,8 +418,8 @@ class drcbe_x64 : public drcbe_interface static be_parameter make_memory(const void *base) { return be_parameter(PTYPE_MEMORY, reinterpret_cast(const_cast(base))); } // operators - bool operator==(be_parameter const &rhs) const { return (m_type == rhs.m_type && m_value == rhs.m_value); } - bool operator!=(be_parameter const &rhs) const { return (m_type != rhs.m_type || m_value != rhs.m_value); } + bool operator==(be_parameter const &rhs) const { return (m_type == rhs.m_type) && (m_value == rhs.m_value); } + bool operator!=(be_parameter const &rhs) const { return (m_type != rhs.m_type) || (m_value != rhs.m_value); } // getters be_parameter_type type() const { return m_type; } @@ -425,6 +436,7 @@ class drcbe_x64 : public drcbe_interface // other queries bool is_immediate_value(uint64_t value) const { return (m_type == PTYPE_IMMEDIATE && m_value == value); } + bool is_cold_register() const { return m_coldreg; } // helpers asmjit::x86::Gp select_register(asmjit::x86::Gp defreg) const; @@ -434,23 +446,67 @@ class drcbe_x64 : public drcbe_interface asmjit::x86::Xmm select_register(asmjit::x86::Xmm defreg, be_parameter const &checkparam) const; private: + // HACK: leftover from x86emit + static inline constexpr int REG_MAX = 16; + // private constructor - be_parameter(be_parameter_type type, be_parameter_value value) : m_type(type), m_value(value) { } + be_parameter(be_parameter_type type, be_parameter_value value) : m_type(type), m_value(value), m_coldreg(false) { } // internals be_parameter_type m_type; // parameter type be_parameter_value m_value; // parameter value + bool m_coldreg; // true for a UML register held in memory + }; + + // state to live in the near cache + struct near_state + { + x86code * debug_log_hashjmp; // hashjmp debugging + x86code * debug_log_hashjmp_fail; // hashjmp debugging + + uint32_t ssemode; // saved SSE mode + uint32_t ssemodesave; // temporary location for saving + uint32_t ssecontrol[4]; // copy of the sse_control array + float single1; // 1.0 in single-precision + double double1; // 1.0 in double-precision + + void * stacksave; // saved stack pointer + + uint8_t flagsmap[0x1000]; // flags map + uint64_t flagsunmap[0x20]; // flags unmapper + }; + + // resolved memory handler functions + struct memory_accessors + { + resolved_memory_accessors resolved; + address_space::specific_access_info specific; + offs_t address_mask; + bool no_mask; + bool has_high_bits; + bool mask_high_bits; + }; + + using opcode_generate_func = void (drcbe_x64::*)(asmjit::x86::Assembler &, const uml::instruction &); + + struct opcode_table_entry + { + uml::opcode_t opcode; // opcode in question + opcode_generate_func func; // function pointer to the work }; // helpers asmjit::x86::Mem MABS(const void *ptr, const uint32_t size = 0) const { return asmjit::x86::Mem(asmjit::x86::rbp, offset_from_rbp(ptr), size); } bool short_immediate(int64_t immediate) const { return (int32_t)immediate == immediate; } void normalize_commutative(be_parameter &inner, be_parameter &outer); + void normalize_commutative(const be_parameter &dst, be_parameter &inner, be_parameter &outer); int32_t offset_from_rbp(const void *ptr) const; asmjit::x86::Gp get_base_register_and_offset(asmjit::x86::Assembler &a, void *target, asmjit::x86::Gp const ®, int32_t &offset); - void smart_call_r64(asmjit::x86::Assembler &a, x86code *target, asmjit::x86::Gp const ®); - void smart_call_m64(asmjit::x86::Assembler &a, x86code **target); + void smart_call_r64(asmjit::x86::Assembler &a, x86code *target, asmjit::x86::Gp const ®) const; + void smart_call_m64(asmjit::x86::Assembler &a, x86code **target) const; + void emit_memaccess_setup(asmjit::x86::Assembler &a, const memory_accessors &accessors, const address_space::specific_access_info::side &side) const; + [[noreturn]] void end_of_block() const; static void debug_log_hashjmp(offs_t pc, int mode); static void debug_log_hashjmp_fail(); @@ -539,7 +595,7 @@ class drcbe_x64 : public drcbe_interface // alu and shift operation helpers static bool ones(u64 const value, unsigned const size) noexcept { return (size == 4) ? u32(value) == 0xffffffffU : value == 0xffffffff'ffffffffULL; } void alu_op_param(asmjit::x86::Assembler &a, asmjit::x86::Inst::Id const opcode, asmjit::Operand const &dst, be_parameter const ¶m, std::function optimize = [](asmjit::x86::Assembler &a, asmjit::Operand dst, be_parameter const &src) { return false; }); - void shift_op_param(asmjit::x86::Assembler &a, asmjit::x86::Inst::Id const opcode, size_t opsize, asmjit::Operand const &dst, be_parameter const ¶m, bool update_flags); + void shift_op_param(asmjit::x86::Assembler &a, asmjit::x86::Inst::Id const opcode, size_t opsize, asmjit::Operand const &dst, be_parameter const ¶m, u8 update_flags); // parameter helpers void mov_reg_param(asmjit::x86::Assembler &a, asmjit::x86::Gp const ®, be_parameter const ¶m, bool const keepflags = false); @@ -548,7 +604,7 @@ class drcbe_x64 : public drcbe_interface // special-case move helpers void movsx_r64_p32(asmjit::x86::Assembler &a, asmjit::x86::Gp const ®, be_parameter const ¶m); - void mov_r64_imm(asmjit::x86::Assembler &a, asmjit::x86::Gp const ®, uint64_t const imm); + void mov_r64_imm(asmjit::x86::Assembler &a, asmjit::x86::Gp const ®, uint64_t const imm) const; // floating-point helpers void movss_r128_p32(asmjit::x86::Assembler &a, asmjit::x86::Xmm const ®, be_parameter const ¶m); @@ -575,47 +631,15 @@ class drcbe_x64 : public drcbe_interface x86_entry_point_func m_entry; // entry point x86code * m_exit; // exit point x86code * m_nocode; // nocode handler + x86code * m_endofblock; // end of block handler - // state to live in the near cache - struct near_state - { - x86code * debug_log_hashjmp; // hashjmp debugging - x86code * debug_log_hashjmp_fail; // hashjmp debugging - - uint32_t ssemode; // saved SSE mode - uint32_t ssemodesave; // temporary location for saving - uint32_t ssecontrol[4]; // copy of the sse_control array - float single1; // 1.0 in single-precision - double double1; // 1.0 in double-precision - - void * stacksave; // saved stack pointer - - uint8_t flagsmap[0x1000]; // flags map - uint64_t flagsunmap[0x20]; // flags unmapper - }; near_state & m_near; - // resolved memory handler functions - struct memory_accessors - { - resolved_memory_accessors resolved; - address_space::specific_access_info specific; - offs_t address_mask; - bool no_mask; - bool has_high_bits; - bool mask_high_bits; - }; resolved_member_function m_debug_cpu_instruction_hook; resolved_member_function m_drcmap_get_value; std::vector m_memory_accessors; // globals - using opcode_generate_func = void (drcbe_x64::*)(asmjit::x86::Assembler &, const uml::instruction &); - struct opcode_table_entry - { - uml::opcode_t opcode; // opcode in question - opcode_generate_func func; // function pointer to the work - }; static const opcode_table_entry s_opcode_table_source[]; static opcode_generate_func s_opcode_table[uml::OP_MAX]; }; @@ -763,9 +787,14 @@ drcbe_x64::be_parameter::be_parameter(drcbe_x64 &drcbe, const parameter ¶m, assert(allowed & PTYPE_M); regnum = int_register_map[param.ireg() - REG_I0]; if (regnum != 0) + { *this = make_ireg(regnum); + } else + { *this = make_memory(&drcbe.m_state.r[param.ireg() - REG_I0]); + m_coldreg = true; + } break; // if a register maps to a register, keep it as a register; otherwise map it to memory @@ -774,9 +803,14 @@ drcbe_x64::be_parameter::be_parameter(drcbe_x64 &drcbe, const parameter ¶m, assert(allowed & PTYPE_M); regnum = float_register_map[param.freg() - REG_F0]; if (regnum != 0) + { *this = make_freg(regnum); + } else + { *this = make_memory(&drcbe.m_state.f[param.freg() - REG_F0]); + m_coldreg = true; + } break; // everything else is unexpected @@ -827,28 +861,30 @@ Xmm drcbe_x64::be_parameter::select_register(Xmm defreg, be_parameter const &che return select_register(defreg); } -//------------------------------------------------- -// select_register - select a register to use, -// avoiding conflicts with the optional -// checkparam -//------------------------------------------------- - inline void drcbe_x64::normalize_commutative(be_parameter &inner, be_parameter &outer) { + using std::swap; + // if the inner parameter is a memory operand, push it to the outer - if (inner.is_memory()) - { - be_parameter temp = inner; - inner = outer; - outer = temp; - } + if (inner.is_memory() && !outer.is_memory() && !outer.is_immediate()) + swap(inner, outer); // if the inner parameter is an immediate, push it to the outer - if (inner.is_immediate()) + if (inner.is_immediate() && !outer.is_immediate()) + swap(inner, outer); +} + +inline void drcbe_x64::normalize_commutative(const be_parameter &dst, be_parameter &inner, be_parameter &outer) +{ + // if the destination is the same as the outer parameter, swap the inner and outer parameters + if (dst == outer) + { + using std::swap; + swap(inner, outer); + } + else { - be_parameter temp = inner; - inner = outer; - outer = temp; + normalize_commutative(inner, outer); } } @@ -895,7 +931,7 @@ inline Gp drcbe_x64::get_base_register_and_offset(Assembler &a, void *target, Gp // directly or via a call through pointer //------------------------------------------------- -inline void drcbe_x64::smart_call_r64(Assembler &a, x86code *target, Gp const ®) +inline void drcbe_x64::smart_call_r64(Assembler &a, x86code *target, Gp const ®) const { const int64_t delta = target - (x86code *)(a.code()->baseAddress() + a.offset() + 5); if (short_immediate(delta)) @@ -913,7 +949,7 @@ inline void drcbe_x64::smart_call_r64(Assembler &a, x86code *target, Gp const &r // directly or via a call through pointer //------------------------------------------------- -inline void drcbe_x64::smart_call_m64(Assembler &a, x86code **target) +inline void drcbe_x64::smart_call_m64(Assembler &a, x86code **target) const { const int64_t delta = *target - (x86code *)(a.code()->baseAddress() + a.offset() + 5); if (short_immediate(delta)) @@ -923,6 +959,54 @@ inline void drcbe_x64::smart_call_m64(Assembler &a, x86code **target) } +//------------------------------------------------- +// emit_memaccess_setup - set up for call to a +// memory access handler +//------------------------------------------------- + +void drcbe_x64::emit_memaccess_setup(Assembler &a, const memory_accessors &accessors, const address_space::specific_access_info::side &side) const +{ + if (accessors.has_high_bits && !accessors.mask_high_bits) + a.mov(r10d, Gpd(REG_PARAM2)); // copy address for dispatch index + if (!accessors.no_mask) + a.and_(Gpd(REG_PARAM2), imm(accessors.address_mask)); // apply address mask + if (accessors.has_high_bits && !accessors.mask_high_bits) + a.shr(r10d, accessors.specific.low_bits); // shift off low bits + mov_r64_imm(a, rax, uintptr_t(side.dispatch)); // load dispatch table pointer + if (accessors.has_high_bits) + { + if (accessors.mask_high_bits) + { + if (accessors.specific.low_bits) + { + a.mov(r10d, Gpd(REG_PARAM2)); // save masked address + a.shr(Gpd(REG_PARAM2), accessors.specific.low_bits); // shift off low bits + } + a.mov(Gpq(REG_PARAM1), ptr(rax, Gpq(REG_PARAM2), 3)); // load dispatch table entry + if (accessors.specific.low_bits) + a.mov(Gpd(REG_PARAM2), r10d); // restore masked address + } + else + { + a.mov(Gpq(REG_PARAM1), ptr(rax, r10, 3)); // load dispatch table entry + } + } + else + { + a.mov(Gpq(REG_PARAM1), ptr(rax)); // load dispatch table entry + } + + if (side.is_virtual) + a.mov(rax, ptr(Gpq(REG_PARAM1), side.displacement)); // load vtable pointer + if (side.displacement) + a.add(Gpq(REG_PARAM1), side.displacement); // apply this pointer offset + if (side.is_virtual) + a.call(ptr(rax, side.function)); // call virtual member function + else + smart_call_r64(a, (x86code *)side.function, rax); // call non-virtual member function +} + + //************************************************************************** // BACKEND CALLBACKS @@ -944,6 +1028,7 @@ drcbe_x64::drcbe_x64(drcuml_state &drcuml, device_t &device, drc_cache &cache, u , m_entry(nullptr) , m_exit(nullptr) , m_nocode(nullptr) + , m_endofblock(nullptr) , m_near(*(near_state *)cache.alloc_near(sizeof(m_near))) { // build up necessary arrays @@ -1146,14 +1231,22 @@ void drcbe_x64::reset() a.bind(a.newNamedLabel("nocode_point")); a.jmp(Gpq(REG_PARAM1)); + // generate an end-of-block handler point + m_endofblock = dst + a.offset(); + a.bind(a.newNamedLabel("end_of_block_point")); + auto const [entrypoint, adjusted] = util::resolve_member_function(&drcbe_x64::end_of_block, *this); + mov_r64_imm(a, Gpq(REG_PARAM1), adjusted); + smart_call_r64(a, (x86code *)entrypoint, rax); + // emit the generated code - size_t bytes = emit(ch); + const size_t bytes = emit(ch); - if (m_log != nullptr) + if (m_log) { x86log_disasm_code_range(m_log, "entry_point", dst, m_exit); x86log_disasm_code_range(m_log, "exit_point", m_exit, m_nocode); - x86log_disasm_code_range(m_log, "nocode_point", m_nocode, dst + bytes); + x86log_disasm_code_range(m_log, "nocode_point", m_nocode, m_endofblock); + x86log_disasm_code_range(m_log, "end_of_block", m_endofblock, dst + bytes); } // reset our hash tables @@ -1223,6 +1316,7 @@ void drcbe_x64::generate(drcuml_block &block, const instruction *instlist, uint3 } Assembler a(&ch); + a.addEncodingOptions(EncodingOptions::kOptimizedAlign); if (logger.file()) a.addDiagnosticOptions(DiagnosticOptions::kValidateIntermediate); @@ -1237,7 +1331,7 @@ void drcbe_x64::generate(drcuml_block &block, const instruction *instlist, uint3 std::string dasm; // add a comment - if (m_log != nullptr) + if (m_log) { dasm = inst.disasm(&m_drcuml); @@ -1258,13 +1352,21 @@ void drcbe_x64::generate(drcuml_block &block, const instruction *instlist, uint3 (this->*s_opcode_table[inst.opcode()])(a, inst); } + // catch falling off the end of a block + if (m_log) + { + x86log_add_comment(m_log, dst + a.offset(), "%s", "end of block"); + a.setInlineComment("end of block"); + } + a.jmp(imm(m_endofblock)); + // emit the generated code size_t const bytes = emit(ch); if (!bytes) block.abort(); // log it - if (m_log != nullptr) + if (m_log) x86log_disasm_code_range(m_log, (blockname.empty()) ? "Unknown block" : blockname.c_str(), dst, dst + bytes); // tell all of our utility objects that the block is finished @@ -1278,7 +1380,7 @@ void drcbe_x64::generate(drcuml_block &block, const instruction *instlist, uint3 // exists in the hash table //------------------------------------------------- -bool drcbe_x64::hash_exists(uint32_t mode, uint32_t pc) +bool drcbe_x64::hash_exists(uint32_t mode, uint32_t pc) const noexcept { return m_hash.code_exists(mode, pc); } @@ -1289,7 +1391,7 @@ bool drcbe_x64::hash_exists(uint32_t mode, uint32_t pc) // back-end implementation //------------------------------------------------- -void drcbe_x64::get_info(drcbe_info &info) +void drcbe_x64::get_info(drcbe_info &info) const noexcept { for (info.direct_iregs = 0; info.direct_iregs < REG_I_COUNT; info.direct_iregs++) if (int_register_map[info.direct_iregs] == 0) @@ -1455,78 +1557,98 @@ void drcbe_x64::calculate_status_flags_mul_low(Assembler &a, uint32_t instsize, a.sahf(); } -void drcbe_x64::shift_op_param(Assembler &a, Inst::Id const opcode, size_t opsize, Operand const &dst, be_parameter const ¶m, bool update_flags) +void drcbe_x64::shift_op_param(Assembler &a, Inst::Id const opcode, size_t opsize, Operand const &dst, be_parameter const ¶m, u8 update_flags) { + // FIXME: upper bits may not be cleared for 32-bit form when shift count is zero + const bool carryin = (opcode == Inst::kIdRcl) || (opcode == Inst::kIdRcr); + if (param.is_immediate()) { const uint32_t bitshift = param.immediate() & (opsize * 8 - 1); - if (bitshift != 0) + if (bitshift) a.emit(opcode, dst, imm(param.immediate())); + else if (update_flags & FLAG_C) + a.clc(); // throw away carry since it'll never be used - if (update_flags) - { - if (bitshift == 0) - a.clc(); // throw away carry since it'll never be used - + if (update_flags & (FLAG_S | FLAG_Z)) calculate_status_flags(a, opsize, dst, FLAG_S | FLAG_Z); - } } - else + else if (update_flags || carryin) { - Label calc = a.newLabel(); - Label end = a.newLabel(); + // TODO: flag update could be optimised + Label end; - Gp shift = cl; + const Gp shift = ecx; - a.mov(r10, rax); - a.lahf(); + if (carryin) + { + a.mov(r10, rax); + a.lahf(); + } mov_reg_param(a, shift, param); a.and_(shift, opsize * 8 - 1); - a.test(shift, shift); - a.short_().jnz(calc); + if ((update_flags & FLAG_C) || carryin) + { + const Label calc = a.newLabel(); + end = a.newLabel(); - a.mov(rax, r10); + a.short_().jnz(calc); - if (update_flags) - a.clc(); // throw away carry since it'll never be used + if (carryin) + a.mov(rax, r10); + + if (update_flags & FLAG_C) + a.clc(); // throw away carry since it'll never be used - a.short_().jmp(end); + a.short_().jmp(end); - a.bind(calc); + a.bind(calc); + } - a.sahf(); // restore flags to keep carry for rolc/rorc - a.mov(rax, r10); + if (carryin) + { + a.sahf(); // restore flags to keep carry in for rolc/rorc + a.mov(rax, r10); + } - a.emit(opcode, dst, shift); + a.emit(opcode, dst, cl); - a.bind(end); + if ((update_flags & FLAG_C) || carryin) + a.bind(end); - if (update_flags) + if (update_flags & (FLAG_S | FLAG_Z)) calculate_status_flags(a, opsize, dst, FLAG_S | FLAG_Z); // calculate status flags but preserve carry } + else + { + mov_reg_param(a, ecx, param); + a.emit(opcode, dst, cl); + } } void drcbe_x64::mov_reg_param(Assembler &a, Gp const ®, be_parameter const ¶m, bool const keepflags) { if (param.is_immediate()) { - if (param.immediate() == 0 && !keepflags) - a.xor_(reg.r32(), reg.r32()); // xor reg,reg + if (!param.immediate() && !keepflags) + a.xor_(reg.r32(), reg.r32()); else if (reg.isGpq()) mov_r64_imm(a, reg, param.immediate()); else - a.mov(reg, param.immediate()); // mov reg,param + a.mov(reg, param.immediate()); } else if (param.is_memory()) - a.mov(reg, MABS(param.memory())); // mov reg,[param] + { + a.mov(reg, MABS(param.memory())); + } else if (param.is_int_register()) { if (reg.id() != param.ireg()) - a.mov(reg, Gp(reg, param.ireg())); // mov reg,param + a.mov(reg, Gp(reg, param.ireg())); } } @@ -1535,11 +1657,13 @@ void drcbe_x64::mov_param_reg(Assembler &a, be_parameter const ¶m, Gp const assert(!param.is_immediate()); if (param.is_memory()) - a.mov(MABS(param.memory()), reg); // mov [param],reg + { + a.mov(MABS(param.memory()), param.is_cold_register() ? reg.r64() : reg); + } else if (param.is_int_register()) { if (reg.id() != param.ireg()) - a.mov(Gp(reg, param.ireg()), reg); // mov param,reg + a.mov(Gp(reg, param.ireg()), reg); } } @@ -1589,12 +1713,16 @@ void drcbe_x64::movsx_r64_p32(Assembler &a, Gp const ®, be_parameter const &p a.movsxd(reg, Gpd(param.ireg())); // movsxd reg,param } -void drcbe_x64::mov_r64_imm(Assembler &a, Gp const ®, uint64_t const imm) +void drcbe_x64::mov_r64_imm(Assembler &a, Gp const ®, uint64_t const imm) const { - if (u32(imm) == imm) + if (s32(u32(imm)) == s64(imm)) + { + a.mov(reg.r64(), imm); + } + else if (u32(imm) == imm) + { a.mov(reg.r32(), imm); - else if (s32(imm) == imm) - a.mov(reg.r64(), s32(imm)); + } else { const int64_t delta = imm - (a.code()->baseAddress() + a.offset() + 7); @@ -1673,11 +1801,11 @@ void drcbe_x64::movsd_p64_r128(Assembler &a, be_parameter const ¶m, Xmm cons { assert(!param.is_immediate()); if (param.is_memory()) - a.movsd(MABS(param.memory(), 8), reg); // movsd [param],reg + a.movsd(MABS(param.memory(), 8), reg); else if (param.is_float_register()) { if (reg.id() != param.freg()) - a.movsd(Xmm(param.freg()), reg); // movsd param,reg + a.movsd(Xmm(param.freg()), reg); } } @@ -1686,6 +1814,20 @@ void drcbe_x64::movsd_p64_r128(Assembler &a, be_parameter const ¶m, Xmm cons // DEBUG HELPERS //************************************************************************** +//------------------------------------------------- +// end_of_block - function to catch falling off +// the end of a generated code block +//------------------------------------------------- + +[[noreturn]] void drcbe_x64::end_of_block() const +{ + osd_printf_error("drcbe_x64(%s): fell off the end of a generated code block!\n", m_device.tag()); + std::fflush(stdout); + std::fflush(stderr); + std::abort(); +} + + //------------------------------------------------- // debug_log_hashjmp - callback to handle // logging of hashjmps @@ -1693,7 +1835,7 @@ void drcbe_x64::movsd_p64_r128(Assembler &a, be_parameter const ¶m, Xmm cons void drcbe_x64::debug_log_hashjmp(offs_t pc, int mode) { - printf("mode=%d PC=%08X\n", mode, pc); + std::printf("mode=%d PC=%08X\n", mode, pc); } @@ -1704,7 +1846,7 @@ void drcbe_x64::debug_log_hashjmp(offs_t pc, int mode) void drcbe_x64::debug_log_hashjmp_fail() { - printf(" (FAIL)\n"); + std::printf(" (FAIL)\n"); } @@ -1730,6 +1872,7 @@ void drcbe_x64::op_handle(Assembler &a, const instruction &inst) // emit a jump around the stack adjust in case code falls through here Label skip = a.newLabel(); a.short_().jmp(skip); + a.align(AlignMode::kCode, 16); // register the current pointer for the handle inst.param(0).handle().set_codeptr(drccodeptr(a.code()->baseAddress() + a.offset())); @@ -2586,14 +2729,14 @@ void drcbe_x64::op_load(Assembler &a, const instruction &inst) // determine the pointer base int32_t baseoffs; - Gp basereg = get_base_register_and_offset(a, basep.memory(), rdx, baseoffs); + const Gp basereg = get_base_register_and_offset(a, basep.memory(), rdx, baseoffs); // pick a target register for the general case - Gp dstreg = (inst.size() == 4) ? dstp.select_register(eax) : dstp.select_register(rax); + const Gp dstreg = dstp.select_register((inst.size() == 4) ? Gp(eax) : Gp(rax)); - // immediate index if (indp.is_immediate()) { + // immediate index s32 const offset = baseoffs + (s32(indp.immediate()) << scalesizep.scale()); if (size == SIZE_BYTE) @@ -2605,11 +2748,10 @@ void drcbe_x64::op_load(Assembler &a, const instruction &inst) else if (size == SIZE_QWORD) a.mov(dstreg, ptr(basereg, offset)); } - - // other index else { - Gp indreg = indp.select_register(rcx); + // other index + const Gp indreg = rcx; movsx_r64_p32(a, indreg, indp); if (size == SIZE_BYTE) a.movzx(dstreg, byte_ptr(basereg, indreg, scalesizep.scale(), baseoffs)); @@ -2647,14 +2789,14 @@ void drcbe_x64::op_loads(Assembler &a, const instruction &inst) // determine the pointer base int32_t baseoffs; - Gp basereg = get_base_register_and_offset(a, basep.memory(), rdx, baseoffs); + const Gp basereg = get_base_register_and_offset(a, basep.memory(), rdx, baseoffs); // pick a target register for the general case - Gp dstreg = (inst.size() == 4) ? dstp.select_register(eax) : dstp.select_register(rax); + const Gp dstreg = dstp.select_register((inst.size() == 4) ? Gp(eax) : Gp(rax)); - // immediate index if (indp.is_immediate()) { + // immediate index s32 const offset = baseoffs + (s32(indp.immediate()) << scalesizep.scale()); if (size == SIZE_BYTE) @@ -2668,11 +2810,10 @@ void drcbe_x64::op_loads(Assembler &a, const instruction &inst) else if (size == SIZE_QWORD) a.mov(dstreg, ptr(basereg, offset)); // mov dstreg,[basep + scale*indp] } - - // other index else { - Gp indreg = indp.select_register(rcx); + // other index + const Gp indreg = rcx; movsx_r64_p32(a, indreg, indp); if (size == SIZE_BYTE) a.movsx(dstreg, byte_ptr(basereg, indreg, scalesizep.scale(), baseoffs)); // movsx dstreg,[basep + scale*indp] @@ -2711,14 +2852,14 @@ void drcbe_x64::op_store(Assembler &a, const instruction &inst) // determine the pointer base int32_t baseoffs; - Gp basereg = get_base_register_and_offset(a, basep.memory(), rdx, baseoffs); + const Gp basereg = get_base_register_and_offset(a, basep.memory(), rdx, baseoffs); // pick a source register for the general case - Gp srcreg = srcp.select_register(rax); + const Gp srcreg = srcp.select_register(rax); - // degenerate case: constant index if (indp.is_immediate()) { + // degenerate case: constant index s32 const offset = baseoffs + (s32(indp.immediate()) << scalesizep.scale()); // immediate source @@ -2727,7 +2868,9 @@ void drcbe_x64::op_store(Assembler &a, const instruction &inst) if (size == SIZE_QWORD) { if (short_immediate(srcp.immediate())) + { a.mov(qword_ptr(basereg, offset), s32(srcp.immediate())); // mov [basep + scale*indp],srcp + } else { a.mov(ptr(basereg, offset + 0), u32(srcp.immediate() >> 0)); // mov [basep + scale*indp],srcp @@ -2735,16 +2878,18 @@ void drcbe_x64::op_store(Assembler &a, const instruction &inst) } } else + { a.mov(ptr(basereg, offset, 1 << size), srcp.immediate()); // mov [basep + scale*indp],srcp + } } - - // variable source else { + // variable source if (size != SIZE_QWORD) mov_reg_param(a, srcreg.r32(), srcp); // mov srcreg,srcp else mov_reg_param(a, srcreg.r64(), srcp); // mov srcreg,srcp + if (size == SIZE_BYTE) a.mov(ptr(basereg, offset), srcreg.r8()); // mov [basep + scale*indp],srcreg else if (size == SIZE_WORD) @@ -2755,20 +2900,21 @@ void drcbe_x64::op_store(Assembler &a, const instruction &inst) a.mov(ptr(basereg, offset), srcreg.r64()); // mov [basep + scale*indp],srcreg } } - - // normal case: variable index else { - Gp indreg = indp.select_register(rcx); + // normal case: variable index + const Gp indreg = rcx; movsx_r64_p32(a, indreg, indp); // mov indreg,indp - // immediate source if (srcp.is_immediate()) { + // immediate source if (size == SIZE_QWORD) { if (short_immediate(srcp.immediate())) + { a.mov(qword_ptr(basereg, indreg, scalesizep.scale(), baseoffs), s32(srcp.immediate())); // mov [basep + scale*indp],srcp + } else { a.mov(ptr(basereg, indreg, scalesizep.scale(), baseoffs + 0), u32(srcp.immediate() >> 0)); // mov [basep + scale*ecx],srcp @@ -2776,16 +2922,18 @@ void drcbe_x64::op_store(Assembler &a, const instruction &inst) } } else + { a.mov(ptr(basereg, indreg, scalesizep.scale(), baseoffs, 1 << size), srcp.immediate()); // mov [basep + scale*ecx],srcp + } } - - // variable source else { + // variable source if (size != SIZE_QWORD) mov_reg_param(a, srcreg.r32(), srcp); // mov srcreg,srcp else mov_reg_param(a, srcreg.r64(), srcp); // mov edx:srcreg,srcp + if (size == SIZE_BYTE) a.mov(ptr(basereg, indreg, scalesizep.scale(), baseoffs), srcreg.r8()); // mov [basep + scale*ecx],srcreg else if (size == SIZE_WORD) @@ -2831,45 +2979,7 @@ void drcbe_x64::op_read(Assembler &a, const instruction &inst) else a.mov(Gpq(REG_PARAM3), make_bitmask(accessors.specific.native_bytes << 3)); - if (accessors.has_high_bits && !accessors.mask_high_bits) - a.mov(r10d, Gpd(REG_PARAM2)); // copy address for dispatch index - if (!accessors.no_mask) - a.and_(Gpd(REG_PARAM2), imm(accessors.address_mask)); // apply address mask - if (accessors.has_high_bits && !accessors.mask_high_bits) - a.shr(r10d, accessors.specific.low_bits); // shift off low bits - mov_r64_imm(a, rax, uintptr_t(accessors.specific.read.dispatch)); // load dispatch table pointer - if (accessors.has_high_bits) - { - if (accessors.mask_high_bits) - { - if (accessors.specific.low_bits) - { - a.mov(r10d, Gpd(REG_PARAM2)); // save masked address - a.shr(Gpd(REG_PARAM2), accessors.specific.low_bits); // shift off low bits - } - a.mov(Gpq(REG_PARAM1), ptr(rax, Gpd(REG_PARAM2), 3)); // load dispatch table entry - if (accessors.specific.low_bits) - a.mov(Gpd(REG_PARAM2), r10d); // restore masked address - - } - else - { - a.mov(Gpq(REG_PARAM1), ptr(rax, r10d, 3)); // load dispatch table entry - } - } - else - { - a.mov(Gpq(REG_PARAM1), ptr(rax)); // load dispatch table entry - } - - if (accessors.specific.read.is_virtual) - a.mov(rax, ptr(Gpq(REG_PARAM1), accessors.specific.read.displacement)); // load vtable pointer - if (accessors.specific.read.displacement) - a.add(Gpq(REG_PARAM1), accessors.specific.read.displacement); // apply this pointer offset - if (accessors.specific.read.is_virtual) - a.call(ptr(rax, accessors.specific.read.function)); // call virtual member function - else - smart_call_r64(a, (x86code *)accessors.specific.read.function, rax); // call non-virtual member function + emit_memaccess_setup(a, accessors, accessors.specific.read); // get dispatch table entry } else if (have_specific && ((1 << spacesizep.size()) < accessors.specific.native_bytes)) { @@ -2891,7 +3001,7 @@ void drcbe_x64::op_read(Assembler &a, const instruction &inst) int const shift = m_space[spacesizep.space()]->addr_shift() - 3; if (m_space[spacesizep.space()]->endianness() != ENDIANNESS_LITTLE) - a.not_(ecx); // swizzle address for bit Endian spaces + a.not_(ecx); // swizzle address for big Endian spaces if (accessors.has_high_bits && !accessors.mask_high_bits) a.shr(r10d, accessors.specific.low_bits); // shift off low bits mov_r64_imm(a, rax, uintptr_t(accessors.specific.read.dispatch)); // load dispatch table pointer @@ -2908,11 +3018,11 @@ void drcbe_x64::op_read(Assembler &a, const instruction &inst) a.mov(r10d, Gpd(REG_PARAM2)); // copy masked address a.shr(Gpd(REG_PARAM2), accessors.specific.low_bits); // shift off low bits } - a.mov(rax, ptr(rax, Gpd(REG_PARAM2), 3)); // load dispatch table entry + a.mov(rax, ptr(rax, Gpq(REG_PARAM2), 3)); // load dispatch table entry } else { - a.mov(rax, ptr(rax, r10d, 3)); // load dispatch table entry + a.mov(rax, ptr(rax, r10, 3)); // load dispatch table entry } } else @@ -3036,44 +3146,7 @@ void drcbe_x64::op_readm(Assembler &a, const instruction &inst) mov_reg_param(a, Gpq(REG_PARAM3), maskp); if (have_specific && ((1 << spacesizep.size()) == accessors.specific.native_bytes)) { - if (accessors.has_high_bits && !accessors.mask_high_bits) - a.mov(r10d, Gpd(REG_PARAM2)); // copy address for dispatch index - if (!accessors.no_mask) - a.and_(Gpd(REG_PARAM2), imm(accessors.address_mask)); // apply address mask - if (accessors.has_high_bits && !accessors.mask_high_bits) - a.shr(r10d, accessors.specific.low_bits); // shift off low bits - mov_r64_imm(a, rax, uintptr_t(accessors.specific.read.dispatch)); // load dispatch table pointer - if (accessors.has_high_bits) - { - if (accessors.mask_high_bits) - { - if (accessors.specific.low_bits) - { - a.mov(r10d, Gpd(REG_PARAM2)); // save masked address - a.shr(Gpd(REG_PARAM2), accessors.specific.low_bits); // shift off low bits - } - a.mov(Gpq(REG_PARAM1), ptr(rax, Gpd(REG_PARAM2), 3)); // load dispatch table entry - if (accessors.specific.low_bits) - a.mov(Gpd(REG_PARAM2), r10d); // restore masked address - } - else - { - a.mov(Gpq(REG_PARAM1), ptr(rax, r10d, 3)); // load dispatch table entry - } - } - else - { - a.mov(Gpq(REG_PARAM1), ptr(rax)); // load dispatch table entry - } - - if (accessors.specific.read.is_virtual) - a.mov(rax, ptr(Gpq(REG_PARAM1), accessors.specific.read.displacement)); // load vtable pointer - if (accessors.specific.read.displacement) - a.add(Gpq(REG_PARAM1), accessors.specific.read.displacement); // apply this pointer offset - if (accessors.specific.read.is_virtual) - a.call(ptr(rax, accessors.specific.read.function)); // call virtual member function - else - smart_call_r64(a, (x86code *)accessors.specific.read.function, rax); // call non-virtual member function + emit_memaccess_setup(a, accessors, accessors.specific.read); // get dispatch table entry } else if (have_specific && ((1 << spacesizep.size()) < accessors.specific.native_bytes)) { @@ -3090,7 +3163,7 @@ void drcbe_x64::op_readm(Assembler &a, const instruction &inst) int const shift = m_space[spacesizep.space()]->addr_shift() - 3; if (m_space[spacesizep.space()]->endianness() != ENDIANNESS_LITTLE) - a.not_(ecx); // swizzle address for bit Endian spaces + a.not_(ecx); // swizzle address for big Endian spaces if (accessors.has_high_bits && !accessors.mask_high_bits) a.shr(r10d, accessors.specific.low_bits); // shift off low bits mov_r64_imm(a, rax, uintptr_t(accessors.specific.read.dispatch)); // load dispatch table pointer @@ -3107,11 +3180,11 @@ void drcbe_x64::op_readm(Assembler &a, const instruction &inst) a.mov(r10d, Gpd(REG_PARAM2)); // copy masked address a.shr(Gpd(REG_PARAM2), accessors.specific.low_bits); // shift off low bits } - a.mov(rax, ptr(rax, Gpd(REG_PARAM2), 3)); // load dispatch table entry + a.mov(rax, ptr(rax, Gpq(REG_PARAM2), 3)); // load dispatch table entry } else { - a.mov(rax, ptr(rax, r10d, 3)); // load dispatch table entry + a.mov(rax, ptr(rax, r10, 3)); // load dispatch table entry } } else @@ -3237,44 +3310,7 @@ void drcbe_x64::op_write(Assembler &a, const instruction &inst) else a.mov(Gpq(REG_PARAM4), make_bitmask(accessors.specific.native_bytes << 3)); - if (accessors.has_high_bits && !accessors.mask_high_bits) - a.mov(r10d, Gpd(REG_PARAM2)); // copy address for dispatch index - if (!accessors.no_mask) - a.and_(Gpd(REG_PARAM2), imm(accessors.address_mask)); // apply address mask - if (accessors.has_high_bits && !accessors.mask_high_bits) - a.shr(r10d, accessors.specific.low_bits); // shift off low bits - mov_r64_imm(a, rax, uintptr_t(accessors.specific.write.dispatch)); // load dispatch table pointer - if (accessors.has_high_bits) - { - if (accessors.mask_high_bits) - { - if (accessors.specific.low_bits) - { - a.mov(r10d, Gpd(REG_PARAM2)); // save masked address - a.shr(Gpd(REG_PARAM2), accessors.specific.low_bits); // shift off low bits - } - a.mov(Gpq(REG_PARAM1), ptr(rax, Gpd(REG_PARAM2), 3)); // load dispatch table entry - if (accessors.specific.low_bits) - a.mov(Gpd(REG_PARAM2), r10d); // restore masked address - } - else - { - a.mov(Gpq(REG_PARAM1), ptr(rax, r10d, 3)); // load dispatch table entry - } - } - else - { - a.mov(Gpq(REG_PARAM1), ptr(rax)); // load dispatch table entry - } - - if (accessors.specific.write.is_virtual) - a.mov(rax, ptr(Gpq(REG_PARAM1), accessors.specific.write.displacement)); // load vtable pointer - if (accessors.specific.write.displacement) - a.add(Gpq(REG_PARAM1), accessors.specific.write.displacement); // apply this pointer offset - if (accessors.specific.write.is_virtual) - a.call(ptr(rax, accessors.specific.write.function)); // call virtual member function - else - smart_call_r64(a, (x86code *)accessors.specific.write.function, rax); // call non-virtual member function + emit_memaccess_setup(a, accessors, accessors.specific.write); } else if (have_specific && ((1 << spacesizep.size()) < accessors.specific.native_bytes)) { @@ -3286,7 +3322,7 @@ void drcbe_x64::op_write(Assembler &a, const instruction &inst) int const shift = m_space[spacesizep.space()]->addr_shift() - 3; if (m_space[spacesizep.space()]->endianness() != ENDIANNESS_LITTLE) - a.not_(ecx); // swizzle address for bit Endian spaces + a.not_(ecx); // swizzle address for big Endian spaces if (accessors.has_high_bits && !accessors.mask_high_bits) a.shr(r10d, accessors.specific.low_bits); // shift off low bits mov_r64_imm(a, rax, uintptr_t(accessors.specific.write.dispatch)); // load dispatch table pointer @@ -3303,11 +3339,11 @@ void drcbe_x64::op_write(Assembler &a, const instruction &inst) a.mov(r10d, Gpd(REG_PARAM2)); // copy masked address a.shr(Gpd(REG_PARAM2), accessors.specific.low_bits); // shift off low bits } - a.mov(rax, ptr(rax, Gpd(REG_PARAM2), 3)); // load dispatch table entry + a.mov(rax, ptr(rax, Gpq(REG_PARAM2), 3)); // load dispatch table entry } else { - a.mov(rax, ptr(rax, r10d, 3)); // load dispatch table entry + a.mov(rax, ptr(rax, r10, 3)); // load dispatch table entry } } else @@ -3403,44 +3439,7 @@ void drcbe_x64::op_writem(Assembler &a, const instruction &inst) else mov_reg_param(a, Gpq(REG_PARAM4), maskp); // get mem_mask - if (accessors.has_high_bits && !accessors.mask_high_bits) - a.mov(r10d, Gpd(REG_PARAM2)); // copy address for dispatch index - if (!accessors.no_mask) - a.and_(Gpd(REG_PARAM2), imm(accessors.address_mask)); // apply address mask - if (accessors.has_high_bits && !accessors.mask_high_bits) - a.shr(r10d, accessors.specific.low_bits); // shift off low bits - mov_r64_imm(a, rax, uintptr_t(accessors.specific.write.dispatch)); // load dispatch table pointer - if (accessors.has_high_bits) - { - if (accessors.mask_high_bits) - { - if (accessors.specific.low_bits) - { - a.mov(r10d, Gpd(REG_PARAM2)); // save masked address - a.shr(Gpd(REG_PARAM2), accessors.specific.low_bits); // shift off low bits - } - a.mov(Gpq(REG_PARAM1), ptr(rax, Gpd(REG_PARAM2), 3)); // load dispatch table entry - if (accessors.specific.low_bits) - a.mov(Gpd(REG_PARAM2), r10d); // restore masked address - } - else - { - a.mov(Gpq(REG_PARAM1), ptr(rax, r10d, 3)); // load dispatch table entry - } - } - else - { - a.mov(Gpq(REG_PARAM1), ptr(rax)); // load dispatch table entry - } - - if (accessors.specific.write.is_virtual) - a.mov(rax, ptr(Gpq(REG_PARAM1), accessors.specific.write.displacement)); // load vtable pointer - if (accessors.specific.write.displacement) - a.add(Gpq(REG_PARAM1), accessors.specific.write.displacement); // apply this pointer offset - if (accessors.specific.write.is_virtual) - a.call(ptr(rax, accessors.specific.write.function)); // call virtual member function - else - smart_call_r64(a, (x86code *)accessors.specific.write.function, rax); // call non-virtual member function + emit_memaccess_setup(a, accessors, accessors.specific.write); } else if (have_specific && ((1 << spacesizep.size()) < accessors.specific.native_bytes)) { @@ -3456,7 +3455,7 @@ void drcbe_x64::op_writem(Assembler &a, const instruction &inst) int const shift = m_space[spacesizep.space()]->addr_shift() - 3; if (m_space[spacesizep.space()]->endianness() != ENDIANNESS_LITTLE) - a.not_(ecx); // swizzle address for bit Endian spaces + a.not_(ecx); // swizzle address for big Endian spaces if (accessors.has_high_bits && !accessors.mask_high_bits) a.shr(r10d, accessors.specific.low_bits); // shift off low bits mov_r64_imm(a, rax, uintptr_t(accessors.specific.write.dispatch)); // load dispatch table pointer @@ -3473,11 +3472,11 @@ void drcbe_x64::op_writem(Assembler &a, const instruction &inst) a.mov(r10d, Gpd(REG_PARAM2)); // copy masked address a.shr(Gpd(REG_PARAM2), accessors.specific.low_bits); // shift off low bits } - a.mov(rax, ptr(rax, Gpd(REG_PARAM2), 3)); // load dispatch table entry + a.mov(rax, ptr(rax, Gpq(REG_PARAM2), 3)); // load dispatch table entry } else { - a.mov(rax, ptr(rax, r10d, 3)); // load dispatch table entry + a.mov(rax, ptr(rax, r10, 3)); // load dispatch table entry } } else @@ -3816,25 +3815,124 @@ void drcbe_x64::op_roland(Assembler &a, const instruction &inst) be_parameter maskp(*this, inst.param(3), PTYPE_MRI); // pick a target register - Gp dstreg = (inst.size() == 4) ? dstp.select_register(eax, shiftp, maskp) : dstp.select_register(rax, shiftp, maskp); + Gp dstreg = dstp.select_register((inst.size() == 4) ? Gp(eax) : Gp(rax), shiftp, maskp); - mov_reg_param(a, dstreg, srcp); - shift_op_param(a, Inst::kIdRol, inst.size(), dstreg, shiftp, false); - alu_op_param(a, Inst::kIdAnd, dstreg, maskp, - [inst](Assembler &a, Operand const &dst, be_parameter const &src) + if (maskp.is_immediate_value(0)) + { + a.xor_(dstreg, dstreg); + } + else if (shiftp.is_immediate() && (srcp.is_immediate() || maskp.is_immediate())) + { + const unsigned bits = inst.size() * 8; + const unsigned shift = shiftp.immediate() & (bits - 1); + const uint64_t sizemask = util::make_bitmask(bits); + if (srcp.is_immediate()) { - // optimize all-zero and all-one cases - if (!inst.flags() && !src.immediate()) + uint64_t src = srcp.immediate() & sizemask; + src = ((src << shift) | (src >> (bits - shift))) & sizemask; + if (maskp.is_immediate()) { - a.xor_(dst.as(), dst.as()); - return true; + src &= maskp.immediate(); + a.mov(dstreg, src); + if (inst.flags()) + a.test(dstreg, dstreg); + } + else + { + mov_reg_param(a, dstreg, maskp); + if ((bits == 32) || (util::sext(src, 32) == src)) + { + a.and_(dstreg, src); + } + else if (uint32_t(src) == src) + { + a.and_(dstreg, src); + if (inst.flags()) + a.test(dstreg, dstreg); + } + else + { + a.mov(rdx, src); + a.and_(dstreg, rdx); + } + } + } + else + { + const uint64_t mask = maskp.immediate() & sizemask; + mov_reg_param(a, dstreg, srcp); + if (mask == sizemask) + { + if (shift) + a.rol(dstreg, shift); + if (inst.flags()) + a.test(dstreg, dstreg); + } + else if (mask == (util::make_bitmask(shift) & sizemask)) + { + a.shr(dstreg, bits - shift); + if (inst.flags()) + a.test(dstreg, dstreg); + } + else if (mask == (~util::make_bitmask(shift) & sizemask)) + { + a.shl(dstreg, shift); + if (inst.flags()) + a.test(dstreg, dstreg); + } + else + { + a.rol(dstreg, shift); + if (!inst.flags() && (mask == 0x000000ff)) + { + a.movzx(dstreg, dstreg.r8()); + } + else if (!inst.flags() && (mask == 0x0000ffff)) + { + a.movzx(dstreg, dstreg.r16()); + } + else if (!inst.flags() && (mask == 0xffffffff)) + { + a.mov(dstreg.r32(), dstreg.r32()); + } + else if ((bits == 32) || (util::sext(mask, 32) == mask)) + { + a.and_(dstreg, mask); + } + else if (uint32_t(mask) == mask) + { + a.and_(dstreg, mask); + if (inst.flags()) + a.test(dstreg, dstreg); + } + else + { + a.mov(rdx, mask); + a.and_(dstreg, rdx); + } } - else if (!inst.flags() && ones(src.immediate(), inst.size())) - return true; + } + } + else + { + mov_reg_param(a, dstreg, srcp); + shift_op_param(a, Inst::kIdRol, inst.size(), dstreg, shiftp, 0); + alu_op_param(a, Inst::kIdAnd, dstreg, maskp, + [inst](Assembler &a, Operand const &dst, be_parameter const &src) + { + // all-one cases + if (ones(src.immediate(), inst.size())) + { + if (inst.flags()) + a.test(dst.as(), dst.as()); + return true; + } - return false; - }); - mov_param_reg(a, dstp, dstreg); // mov dstp,dstreg + return false; + }); + } + + mov_param_reg(a, dstp, dstreg); } @@ -3855,45 +3953,277 @@ void drcbe_x64::op_rolins(Assembler &a, const instruction &inst) be_parameter shiftp(*this, inst.param(2), PTYPE_MRI); be_parameter maskp(*this, inst.param(3), PTYPE_MRI); - // 32-bit form - if (inst.size() == 4) - { - // pick a target register - Gp dstreg = dstp.select_register(ecx, shiftp, maskp); + // pick registers + Gp dstreg = dstp.select_register((inst.size() == 4) ? Gp(ecx) : Gp(rcx), shiftp, maskp); + Gp srcreg = (inst.size() == 4) ? Gp(eax) : Gp(rax); + Gp maskreg = (inst.size() == 4) ? Gp(edx) : Gp(rdx); - mov_reg_param(a, eax, srcp); - shift_op_param(a, Inst::kIdRol, inst.size(), eax, shiftp, false); - mov_reg_param(a, dstreg, dstp); - if (maskp.is_immediate()) + const unsigned bits = inst.size() * 8; + const uint64_t sizemask = util::make_bitmask(bits); + + if (maskp.is_immediate_value(0)) + { + if (inst.flags()) { - a.and_(eax, maskp.immediate()); - a.and_(dstreg, ~maskp.immediate()); + mov_reg_param(a, dstreg, dstp); + a.test(dstreg, dstreg); + } + } + else if (shiftp.is_immediate() && (srcp.is_immediate() || maskp.is_immediate())) + { + const unsigned shift = shiftp.immediate() & (bits - 1); + if (srcp.is_immediate()) + { + // immediate source + + uint64_t src = srcp.immediate() & sizemask; + src = ((src << shift) | (src >> (bits - shift))) & sizemask; + + if (maskp.is_immediate()) + { + const uint64_t mask = maskp.immediate() & sizemask; + src &= mask; + if (mask == sizemask) + { + if (src) + { + a.mov(dstreg, src); + if (inst.flags()) + a.test(dstreg, dstreg); + } + else + { + a.xor_(dstreg, dstreg); + } + } + else + { + bool flags = false; + mov_reg_param(a, dstreg, dstp); + if (mask == 0xffffffff'00000000) + { + a.mov(dstreg.r32(), dstreg.r32()); + } + else if (mask == (0xffffffff'ffff0000 & sizemask)) + { + a.movzx(dstreg, dstreg.r16()); + } + else if (mask == (0xffffffff'ffffff00 & sizemask)) + { + a.movzx(dstreg, dstreg.r8()); + } + else if ((bits == 32) || (util::sext(~mask, 32) == ~mask)) + { + a.and_(dstreg, ~mask); + flags = true; + } + else if (uint32_t(~mask) == ~mask) + { + a.and_(dstreg, ~mask); + } + else + { + a.mov(maskreg, ~mask); + a.and_(dstreg, maskreg); + flags = true; + } + + if (src) + { + if ((bits == 32) || (util::sext(src, 32) == src)) + { + a.or_(dstreg, src); + } + else + { + a.mov(srcreg, src); + a.or_(dstreg, srcreg); + } + } + else if (!flags && inst.flags()) + { + a.test(dstreg, dstreg); + } + } + } + else + { + mov_reg_param(a, dstreg, dstp); + mov_reg_param(a, maskreg, maskp); + if (src) + { + if ((bits == 32) || (util::sext(src, 32) == src)) + { + a.mov(srcreg, maskreg); + a.not_(maskreg); + a.and_(srcreg, src); + } + else + { + a.mov(srcreg, src); + a.and_(srcreg, maskreg); + a.not_(maskreg); + } + a.and_(dstreg, maskreg); + a.or_(dstreg, srcreg); + } + else + { + a.not_(maskreg); + a.and_(dstreg, maskreg); + } + } } else { - mov_reg_param(a, edx, maskp); - a.and_(eax, edx); - a.not_(edx); - a.and_(dstreg, edx); + // variables source, immediate mask + const uint64_t mask = maskp.immediate() & sizemask; + if (mask == sizemask) + { + mov_reg_param(a, dstreg, srcp); + if (shift) + a.rol(dstreg, shift); + if (inst.flags()) + a.test(dstreg, dstreg); + } + else + { + mov_reg_param(a, dstreg, dstp); + + bool maskloaded = false; + if (!shift) + { + if (mask == 0x00000000'000000ff) + { + if (srcp.is_int_register()) + a.movzx(srcreg, GpbLo(srcp.ireg())); + else if (srcp.is_memory()) + a.movzx(srcreg, MABS(srcp.memory(), 1)); + } + else if (mask == 0x00000000'0000ffff) + { + if (srcp.is_int_register()) + a.movzx(srcreg, Gpw(srcp.ireg())); + else if (srcp.is_memory()) + a.movzx(srcreg, MABS(srcp.memory(), 2)); + } + else if (mask == 0x00000000'ffffffff) + { + mov_reg_param(a, srcreg.r32(), srcp); + } + else + { + mov_reg_param(a, srcreg, srcp); + a.and_(srcreg, mask); + } + } + else if (mask == (util::make_bitmask(shift) & sizemask)) + { + mov_reg_param(a, srcreg, srcp); + a.shr(srcreg, bits - shift); + } + else if (mask == (~util::make_bitmask(shift) & sizemask)) + { + mov_reg_param(a, srcreg, srcp); + a.shl(srcreg, shift); + } + else + { + mov_reg_param(a, srcreg, srcp); + a.rol(srcreg, shift); + if (mask == 0x00000000'000000ff) + { + a.movzx(srcreg, srcreg.r8()); + } + else if (mask == 0x00000000'0000ffff) + { + a.movzx(srcreg, srcreg.r16()); + } + else if (mask == 0x00000000'ffffffff) + { + a.mov(srcreg.r32(), srcreg.r32()); + } + else if ((bits == 32) || (util::sext(mask, 32) == mask) || (uint32_t(mask) == mask)) + { + a.and_(srcreg, mask); + } + else + { + a.mov(maskreg, mask); + a.and_(srcreg, maskreg); + maskloaded = true; + } + } + + if (mask == 0xffffffff'00000000) + { + a.mov(dstreg.r32(), dstreg.r32()); + } + else if (mask == (0xffffffff'ffff0000 & sizemask)) + { + a.movzx(dstreg, dstreg.r16()); + } + else if (mask == (0xffffffff'ffffff00 & sizemask)) + { + a.movzx(dstreg, dstreg.r8()); + } + else if ((bits == 32) || (util::sext(~mask, 32) == ~mask) || (uint32_t(~mask) == ~mask)) + { + a.and_(dstreg, ~mask & sizemask); + } + else + { + if (maskloaded) + a.not_(maskreg); + else + a.mov(maskreg, ~mask); + a.and_(dstreg, maskreg); + } + + a.or_(dstreg, srcreg); + } } - a.or_(dstreg, eax); + mov_param_reg(a, dstp, dstreg); } - - // 64-bit form - else if (inst.size() == 8) + else { - // pick a target register - Gp dstreg = dstp.select_register(rcx, shiftp, maskp); + // generic case - mov_reg_param(a, rax, srcp); - mov_reg_param(a, rdx, maskp); - shift_op_param(a, Inst::kIdRol, inst.size(), rax, shiftp, false); + bool maskimm = maskp.is_immediate(); + uint64_t mask = 0; + if (maskimm) + { + mask = maskp.immediate() & sizemask; + if (bits != 32) + { + maskimm = + ((util::sext(mask, 32) == mask) && (uint32_t(~mask) == ~mask)) | + ((util::sext(~mask, 32) == ~mask) && (uint32_t(mask) == mask)); + } + } + + mov_reg_param(a, srcreg, srcp); + if (!maskimm) + mov_reg_param(a, maskreg, maskp); + + shift_op_param(a, Inst::kIdRol, inst.size(), srcreg, shiftp, 0); mov_reg_param(a, dstreg, dstp); - a.and_(rax, rdx); - a.not_(rdx); - a.and_(dstreg, rdx); - a.or_(dstreg, rax); + + if (!maskimm) + { + a.and_(srcreg, maskreg); + a.not_(maskreg); + a.and_(dstreg, maskreg); + } + else + { + a.and_(srcreg, mask); + a.and_(dstreg, ~mask & sizemask); + } + + a.or_(dstreg, srcreg); + mov_param_reg(a, dstp, dstreg); } } @@ -3914,57 +4244,48 @@ void drcbe_x64::op_add(Assembler &a, const instruction &inst) be_parameter dstp(*this, inst.param(0), PTYPE_MR); be_parameter src1p(*this, inst.param(1), PTYPE_MRI); be_parameter src2p(*this, inst.param(2), PTYPE_MRI); - normalize_commutative(src1p, src2p); + normalize_commutative(dstp, src1p, src2p); - // dstp == src1p in memory - if (dstp.is_memory() && dstp == src1p) + if (dstp.is_memory() && ((inst.size() == 8) || !dstp.is_cold_register()) && (dstp == src1p)) + { + // dstp == src1p in memory alu_op_param(a, Inst::kIdAdd, MABS(dstp.memory(), inst.size()), src2p, // add [dstp],src2p [inst](Assembler &a, Operand const &dst, be_parameter const &src) { // optimize zero case return (!inst.flags() && !src.immediate()); }); - - // dstp == src2p in memory - else if (dstp.is_memory() && dstp == src2p) - alu_op_param(a, Inst::kIdAdd, MABS(dstp.memory(), inst.size()), src1p, // add [dstp],src1p - [inst](Assembler &a, Operand const &dst, be_parameter const &src) - { - // optimize zero case - return (!inst.flags() && !src.immediate()); - }); - - // reg = reg + imm + } else if (dstp.is_int_register() && src1p.is_int_register() && src2p.is_immediate() && short_immediate(src2p.immediate()) && !inst.flags()) { + // reg = reg + imm Gp const dst = Gp::fromTypeAndId((inst.size() == 4) ? RegType::kX86_Gpd : RegType::kX86_Gpq, dstp.ireg()); Gp const src1 = Gp::fromTypeAndId((inst.size() == 4) ? RegType::kX86_Gpd : RegType::kX86_Gpq, src1p.ireg()); a.lea(dst, ptr(src1, src2p.immediate())); // lea dstp,[src1p+src2p] } - - // reg = reg + reg else if (dstp.is_int_register() && src1p.is_int_register() && src2p.is_int_register() && !inst.flags()) { + // reg = reg + reg Gp const dst = Gp::fromTypeAndId((inst.size() == 4) ? RegType::kX86_Gpd : RegType::kX86_Gpq, dstp.ireg()); Gp const src1 = Gp::fromTypeAndId((inst.size() == 4) ? RegType::kX86_Gpd : RegType::kX86_Gpq, src1p.ireg()); Gp const src2 = Gp::fromTypeAndId((inst.size() == 4) ? RegType::kX86_Gpd : RegType::kX86_Gpq, src2p.ireg()); a.lea(dst, ptr(src1, src2)); // lea dstp,[src1p+src2p] } - - // general case else { + // general case + // pick a target register for the general case - Gp dstreg = (inst.size() == 4) ? dstp.select_register(eax, src2p) : dstp.select_register(rax, src2p); + Gp dstreg = dstp.select_register((inst.size() == 4) ? Gp(eax) : Gp(rax), src2p); mov_reg_param(a, dstreg, src1p); // mov dstreg,src1p alu_op_param(a, Inst::kIdAdd, dstreg, src2p, // add dstreg,src2p [inst](Assembler &a, Operand const &dst, be_parameter const &src) { // optimize zero case - return (!inst.flags() && !src.immediate()); + return (!inst.flags() && !src.immediate() && (inst.size() != 4)); }); mov_param_reg(a, dstp, dstreg); // mov dstp,dstreg } @@ -3986,15 +4307,17 @@ void drcbe_x64::op_addc(Assembler &a, const instruction &inst) be_parameter dstp(*this, inst.param(0), PTYPE_MR); be_parameter src1p(*this, inst.param(1), PTYPE_MRI); be_parameter src2p(*this, inst.param(2), PTYPE_MRI); - normalize_commutative(src1p, src2p); + normalize_commutative(dstp, src1p, src2p); - // dstp == src1p in memory - if (dstp.is_memory() && dstp == src1p) + if (dstp.is_memory() && ((inst.size() == 8) || !dstp.is_cold_register()) && (dstp == src1p)) + { + // dstp == src1p in memory alu_op_param(a, Inst::kIdAdc, MABS(dstp.memory(), inst.size()), src2p); // adc [dstp],src2p - - // general case + } else { + // general case + // pick a target register for the general case Gp dstreg = (inst.size() == 4) ? dstp.select_register(eax, src2p) : dstp.select_register(rax, src2p); @@ -4021,27 +4344,28 @@ void drcbe_x64::op_sub(Assembler &a, const instruction &inst) be_parameter src1p(*this, inst.param(1), PTYPE_MRI); be_parameter src2p(*this, inst.param(2), PTYPE_MRI); - // dstp == src1p in memory - if (dstp.is_memory() && dstp == src1p) + if (dstp.is_memory() && ((inst.size() == 8) || !dstp.is_cold_register()) && (dstp == src1p)) + { + // dstp == src1p in memory alu_op_param(a, Inst::kIdSub, MABS(dstp.memory(), inst.size()), src2p, // sub [dstp],src2p [inst](Assembler &a, Operand const &dst, be_parameter const &src) { // optimize zero case return (!inst.flags() && !src.immediate()); }); - - // reg = reg - imm + } else if (dstp.is_int_register() && src1p.is_int_register() && src2p.is_immediate() && short_immediate(src2p.immediate()) && !inst.flags()) { + // reg = reg - imm Gp const dst = Gp::fromTypeAndId((inst.size() == 4) ? RegType::kX86_Gpd : RegType::kX86_Gpq, dstp.ireg()); Gp const src1 = Gp::fromTypeAndId((inst.size() == 4) ? RegType::kX86_Gpd : RegType::kX86_Gpq, src1p.ireg()); a.lea(dst, ptr(src1, -src2p.immediate())); // lea dstp,[src1p-src2p] } - - // general case else { + // general case + // pick a target register for the general case Gp dstreg = (inst.size() == 4) ? dstp.select_register(eax, src2p) : dstp.select_register(rax, src2p); @@ -4050,7 +4374,7 @@ void drcbe_x64::op_sub(Assembler &a, const instruction &inst) [inst](Assembler &a, Operand const &dst, be_parameter const &src) { // optimize zero case - return (!inst.flags() && !src.immediate()); + return (!inst.flags() && !src.immediate() && (inst.size() != 4)); }); mov_param_reg(a, dstp, dstreg); // mov dstp,dstreg } @@ -4073,13 +4397,15 @@ void drcbe_x64::op_subc(Assembler &a, const instruction &inst) be_parameter src1p(*this, inst.param(1), PTYPE_MRI); be_parameter src2p(*this, inst.param(2), PTYPE_MRI); - // dstp == src1p in memory - if (dstp.is_memory() && dstp == src1p) + if (dstp.is_memory() && ((inst.size() == 8) || !dstp.is_cold_register()) && (dstp == src1p)) + { + // dstp == src1p in memory alu_op_param(a, Inst::kIdSbb, MABS(dstp.memory(), inst.size()), src2p); // sbb [dstp],src2p - - // general case + } else { + // general case + // pick a target register for the general case Gp dstreg = (inst.size() == 4) ? dstp.select_register(eax, src2p) : dstp.select_register(rax, src2p); @@ -4530,14 +4856,15 @@ void drcbe_x64::op_and(Assembler &a, const instruction &inst) be_parameter dstp(*this, inst.param(0), PTYPE_MR); be_parameter src1p(*this, inst.param(1), PTYPE_MRI); be_parameter src2p(*this, inst.param(2), PTYPE_MRI); - normalize_commutative(src1p, src2p); + normalize_commutative(dstp, src1p, src2p); // pick a target register Gp dstreg = (inst.size() == 4) ? dstp.select_register(eax, src2p) : dstp.select_register(rax, src2p); - // dstp == src1p in memory - if (dstp.is_memory() && dstp == src1p) - alu_op_param(a, Inst::kIdAnd, MABS(dstp.memory(), inst.size()), src2p, // and [dstp],src2p + if (dstp.is_memory() && ((inst.size() == 8) || !dstp.is_cold_register()) && (dstp == src1p)) + { + // dstp == src1p in memory + alu_op_param(a, Inst::kIdAnd, MABS(dstp.memory(), inst.size()), src2p, [inst](Assembler &a, Operand const &dst, be_parameter const &src) { // optimize all-zero and all-one cases @@ -4547,79 +4874,77 @@ void drcbe_x64::op_and(Assembler &a, const instruction &inst) return true; } else if (!inst.flags() && ones(src.immediate(), inst.size())) - return true; - - return false; - }); - - // dstp == src2p in memory - else if (dstp.is_memory() && dstp == src2p) - alu_op_param(a, Inst::kIdAnd, MABS(dstp.memory(), inst.size()), src1p, // and [dstp],src1p - [inst](Assembler &a, Operand const &dst, be_parameter const &src) - { - // optimize all-zero and all-one cases - if (!inst.flags() && !src.immediate()) { - a.mov(dst.as(), imm(0)); return true; } - else if (!inst.flags() && ones(src.immediate(), inst.size())) - return true; - return false; }); - - // immediate 0xff + } else if (src2p.is_immediate_value(0xff) && !inst.flags()) { + // immediate 0xff if (src1p.is_int_register()) - a.movzx(dstreg, GpbLo(src1p.ireg())); // movzx dstreg,src1p + a.movzx(dstreg, GpbLo(src1p.ireg())); else if (src1p.is_memory()) - a.movzx(dstreg, MABS(src1p.memory(), 1)); // movzx dstreg,[src1p] - mov_param_reg(a, dstp, dstreg); // mov dstp,dstreg + a.movzx(dstreg, MABS(src1p.memory(), 1)); + mov_param_reg(a, dstp, dstreg); } - - // immediate 0xffff else if (src2p.is_immediate_value(0xffff) && !inst.flags()) { + // immediate 0xffff if (src1p.is_int_register()) - a.movzx(dstreg, Gpw(src1p.ireg())); // movzx dstreg,src1p + a.movzx(dstreg, Gpw(src1p.ireg())); else if (src1p.is_memory()) - a.movzx(dstreg, MABS(src1p.memory(), 2)); // movzx dstreg,[src1p] - mov_param_reg(a, dstp, dstreg); // mov dstp,dstreg + a.movzx(dstreg, MABS(src1p.memory(), 2)); + mov_param_reg(a, dstp, dstreg); } - - // immediate 0xffffffff - else if (src2p.is_immediate_value(0xffffffff) && !inst.flags() && inst.size() == 8) + else if (src2p.is_immediate_value(0xffffffff) && !inst.flags()) { + // immediate 0xffffffff if (dstp.is_int_register() && src1p == dstp) - a.mov(dstreg.r32(), dstreg.r32()); // mov dstreg,dstreg + { + a.mov(dstreg.r32(), dstreg.r32()); + } else { - mov_reg_param(a, dstreg.r32(), src1p); // mov dstreg,src1p - mov_param_reg(a, dstp, dstreg); // mov dstp,dstreg + mov_reg_param(a, dstreg.r32(), src1p); + mov_param_reg(a, dstp, dstreg); } } - - // general case else { - mov_reg_param(a, dstreg, src1p); // mov dstreg,src1p - alu_op_param(a, Inst::kIdAnd, dstreg, src2p, // and dstreg,src2p + // general case + mov_reg_param(a, dstreg, src1p); + alu_op_param(a, Inst::kIdAnd, dstreg, src2p, [inst](Assembler &a, Operand const &dst, be_parameter const &src) { // optimize all-zero and all-one cases - if (!inst.flags() && !src.immediate()) + if (!src.immediate()) { - a.xor_(dst.as(), dst.as()); + a.xor_(dst.as(), dst.as()); return true; } - else if (!inst.flags() && ones(src.immediate(), inst.size())) + else if (ones(src.immediate(), inst.size())) + { + if (inst.size() == 4) + { + if (inst.flags()) + a.and_(dst.as(), dst.as()); + else + a.mov(dst.as(), dst.as()); + } + else if (inst.flags()) + { + a.test(dst.as(), dst.as()); + } return true; + } return false; }); - mov_param_reg(a, dstp, dstreg); // mov dstp,dstreg + + if ((inst.size() == 4) || !src2p.is_immediate_value(util::make_bitmask(inst.size() * 8))) + mov_param_reg(a, dstp, dstreg); } } @@ -4640,18 +4965,31 @@ void drcbe_x64::op_test(Assembler &a, const instruction &inst) be_parameter src2p(*this, inst.param(1), PTYPE_MRI); normalize_commutative(src1p, src2p); - // src1p in memory if (src1p.is_memory()) - alu_op_param(a, Inst::kIdTest, MABS(src1p.memory(), inst.size()), src2p); // test [src1p],src2p - - // general case + { + // src1p in memory + alu_op_param(a, Inst::kIdTest, MABS(src1p.memory(), inst.size()), src2p); + } else { + // general case + // pick a target register for the general case Gp src1reg = (inst.size() == 4) ? src1p.select_register(eax) : src1p.select_register(rax); - mov_reg_param(a, src1reg, src1p); // mov src1reg,src1p - alu_op_param(a, Inst::kIdTest, src1reg, src2p); // test src1reg,src2p + mov_reg_param(a, src1reg, src1p); + alu_op_param(a, Inst::kIdTest, src1reg, src2p, + [inst](Assembler &a, Operand const &dst, be_parameter const &src) + { + // optimize all-one cases + if (ones(src.immediate(), inst.size())) + { + a.test(dst.as(), dst.as()); + return true; + } + + return false; + }); } } @@ -4671,10 +5009,11 @@ void drcbe_x64::op_or(Assembler &a, const instruction &inst) be_parameter dstp(*this, inst.param(0), PTYPE_MR); be_parameter src1p(*this, inst.param(1), PTYPE_MRI); be_parameter src2p(*this, inst.param(2), PTYPE_MRI); - normalize_commutative(src1p, src2p); + normalize_commutative(dstp, src1p, src2p); - // dstp == src1p in memory - if (dstp.is_memory() && dstp == src1p) + if (dstp.is_memory() && ((inst.size() == 8) || !dstp.is_cold_register()) && (dstp == src1p)) + { + // dstp == src1p in memory alu_op_param(a, Inst::kIdOr, MABS(dstp.memory(), inst.size()), src2p, // or [dstp],src2p [inst](Assembler &a, Operand const &dst, be_parameter const &src) { @@ -4685,31 +5024,16 @@ void drcbe_x64::op_or(Assembler &a, const instruction &inst) return true; } else if (!inst.flags() && !src.immediate()) - return true; - - return false; - }); - - // dstp == src2p in memory - else if (dstp.is_memory() && dstp == src2p) - alu_op_param(a, Inst::kIdOr, MABS(dstp.memory(), inst.size()), src1p, // or [dstp],src1p - [inst](Assembler &a, Operand const &dst, be_parameter const &src) - { - // optimize all-zero and all-one cases - if (!inst.flags() && ones(src.immediate(), inst.size())) { - a.mov(dst.as(), imm(-1)); return true; } - else if (!inst.flags() && !src.immediate()) - return true; - return false; }); - - // general case + } else { + // general case + // pick a target register for the general case Gp dstreg = (inst.size() == 4) ? dstp.select_register(eax, src2p) : dstp.select_register(rax, src2p); @@ -4723,12 +5047,27 @@ void drcbe_x64::op_or(Assembler &a, const instruction &inst) a.mov(dst.as(), imm(-1)); return true; } - else if (!inst.flags() && !src.immediate()) + else if (!src.immediate()) + { + if (inst.size() == 4) + { + if (inst.flags()) + a.or_(dst.as(), dst.as()); + else + a.mov(dst.as(), dst.as()); + } + else if (inst.flags()) + { + a.test(dst.as(), dst.as()); + } return true; + } return false; }); - mov_param_reg(a, dstp, dstreg); // mov dstp,dstreg + + if ((inst.size() == 4) || !src2p.is_immediate_value(0)) + mov_param_reg(a, dstp, dstreg); // mov dstp,dstreg } } @@ -4748,10 +5087,11 @@ void drcbe_x64::op_xor(Assembler &a, const instruction &inst) be_parameter dstp(*this, inst.param(0), PTYPE_MR); be_parameter src1p(*this, inst.param(1), PTYPE_MRI); be_parameter src2p(*this, inst.param(2), PTYPE_MRI); - normalize_commutative(src1p, src2p); + normalize_commutative(dstp, src1p, src2p); - // dstp == src1p in memory - if (dstp.is_memory() && dstp == src1p) + if (dstp.is_memory() && ((inst.size() == 8) || !dstp.is_cold_register()) && (dstp == src1p)) + { + // dstp == src1p in memory alu_op_param(a, Inst::kIdXor, MABS(dstp.memory(), inst.size()), src2p, // xor [dstp],src2p [inst](Assembler &a, Operand const &dst, be_parameter const &src) { @@ -4766,30 +5106,13 @@ void drcbe_x64::op_xor(Assembler &a, const instruction &inst) return false; }); - - // dstp == src2p in memory - else if (dstp.is_memory() && dstp == src2p) - alu_op_param(a, Inst::kIdXor, MABS(dstp.memory(), inst.size()), src1p, // xor [dstp],src1p - [inst](Assembler &a, Operand const &dst, be_parameter const &src) - { - // optimize all-zero and all-one cases - if (!inst.flags() && ones(src.immediate(), inst.size())) - { - a.not_(dst.as()); - return true; - } - else if (!inst.flags() && !src.immediate()) - return true; - - return false; - }); - - // dstp == src1p register - else if (dstp.is_int_register() && dstp == src1p) + } + else if (dstp.is_int_register() && (dstp == src1p)) { + // dstp == src1p register Gp const dst = Gp::fromTypeAndId((inst.size() == 4) ? RegType::kX86_Gpd : RegType::kX86_Gpq, dstp.ireg()); - alu_op_param(a, Inst::kIdXor, dst, src2p, // xor dstp,src2p + alu_op_param(a, Inst::kIdXor, dst, src2p, [inst](Assembler &a, Operand const &dst, be_parameter const &src) { // optimize all-zero and all-one cases @@ -4798,20 +5121,31 @@ void drcbe_x64::op_xor(Assembler &a, const instruction &inst) a.not_(dst.as()); return true; } - else if (!inst.flags() && !src.immediate()) + else if (!src.immediate()) + { + if (inst.size() == 4) + { + if (inst.flags()) + a.or_(dst.as(), dst.as()); + else + a.mov(dst.as(), dst.as()); + } + else if (inst.flags()) + { + a.test(dst.as(), dst.as()); + } return true; - + } return false; }); } - // general case else { - // pick a target register for the general case - Gp dstreg = (inst.size() == 4) ? dstp.select_register(eax, src2p) : dstp.select_register(rax, src2p); + // general case + Gp dstreg = dstp.select_register((inst.size() == 4) ? Gp(eax) : Gp(rax), src2p); - mov_reg_param(a, dstreg, src1p); // mov dstreg,src1p - alu_op_param(a, Inst::kIdXor, dstreg, src2p, // xor dstreg,src2p + mov_reg_param(a, dstreg, src1p); + alu_op_param(a, Inst::kIdXor, dstreg, src2p, [inst](Assembler &a, Operand const &dst, be_parameter const &src) { // optimize all-zero and all-one cases @@ -4820,12 +5154,27 @@ void drcbe_x64::op_xor(Assembler &a, const instruction &inst) a.not_(dst.as()); return true; } - else if (!inst.flags() && !src.immediate()) + else if (!src.immediate()) + { + if (inst.size() == 4) + { + if (inst.flags()) + a.or_(dst.as(), dst.as()); + else + a.mov(dst.as(), dst.as()); + } + else if (inst.flags()) + { + a.test(dst.as(), dst.as()); + } return true; + } return false; }); - mov_param_reg(a, dstp, dstreg); // mov dstp,dstreg + + if ((inst.size() == 4) || !src2p.is_immediate_value(0)) + mov_param_reg(a, dstp, dstreg); } } @@ -4959,7 +5308,8 @@ void drcbe_x64::op_bswap(Assembler &a, const instruction &inst) mov_param_reg(a, dstp, dstreg); // mov dstp,dstreg } -template void drcbe_x64::op_shift(Assembler &a, const uml::instruction &inst) +template +void drcbe_x64::op_shift(Assembler &a, const uml::instruction &inst) { // validate instruction assert(inst.size() == 4 || inst.size() == 8); @@ -4974,16 +5324,18 @@ template void drcbe_x64::op_shift(Assembler &a, const uml::ins const bool carry = (Opcode == Inst::kIdRcl) || (Opcode == Inst::kIdRcr); // optimize immediate zero case - if (!carry && !inst.flags() && src2p.is_immediate() && (src2p.immediate() & (inst.size() * 8 - 1)) == 0) - return; + if (!carry && !inst.flags() && src2p.is_immediate() && !(src2p.immediate() & (inst.size() * 8 - 1))) + return; // FIXME: needs to clear upper bits for 32-bit form - // dstp == src1p in memory - if (dstp.is_memory() && dstp == src1p) - shift_op_param(a, Opcode, inst.size(), MABS(dstp.memory(), inst.size()), src2p, true); - - // general case + if (dstp.is_memory() && ((inst.size() == 8) || !dstp.is_cold_register()) && (dstp == src1p)) + { + // dstp == src1p in memory + shift_op_param(a, Opcode, inst.size(), MABS(dstp.memory(), inst.size()), src2p, inst.flags()); + } else { + // general case + // pick a target register Gp dstreg = (inst.size() == 4) ? dstp.select_register(eax, src2p) : dstp.select_register(rax, src2p); @@ -4991,7 +5343,7 @@ template void drcbe_x64::op_shift(Assembler &a, const uml::ins mov_reg_param(a, dstreg, src1p, true); else mov_reg_param(a, dstreg, src1p); - shift_op_param(a, Opcode, inst.size(), dstreg, src2p, true); + shift_op_param(a, Opcode, inst.size(), dstreg, src2p, inst.flags()); mov_param_reg(a, dstp, dstreg); } } @@ -5498,7 +5850,6 @@ void drcbe_x64::op_fadd(Assembler &a, const instruction &inst) be_parameter dstp(*this, inst.param(0), PTYPE_MF); be_parameter src1p(*this, inst.param(1), PTYPE_MF); be_parameter src2p(*this, inst.param(2), PTYPE_MF); - normalize_commutative(src1p, src2p); // pick a target register for the general case Xmm dstreg = dstp.select_register(xmm0, src2p); @@ -5625,7 +5976,6 @@ void drcbe_x64::op_fmul(Assembler &a, const instruction &inst) be_parameter dstp(*this, inst.param(0), PTYPE_MF); be_parameter src1p(*this, inst.param(1), PTYPE_MF); be_parameter src2p(*this, inst.param(2), PTYPE_MF); - normalize_commutative(src1p, src2p); // pick a target register for the general case Xmm dstreg = dstp.select_register(xmm0, src2p); @@ -6036,9 +6386,9 @@ void drcbe_x64::op_icopyf(Assembler &a, const instruction &inst) be_parameter dstp(*this, inst.param(0), PTYPE_MR); be_parameter srcp(*this, inst.param(1), PTYPE_MF); - // 32-bit form if (inst.size() == 4) { + // 32-bit form if (srcp.is_memory()) { Gp dstreg = dstp.select_register(eax); @@ -6054,10 +6404,9 @@ void drcbe_x64::op_icopyf(Assembler &a, const instruction &inst) a.movd(Gpd(dstp.ireg()), Xmm(srcp.freg())); } } - - // 64-bit form else if (inst.size() == 8) { + // 64-bit form if (srcp.is_memory()) { Gp dstreg = dstp.select_register(rax); diff --git a/src/devices/cpu/drcbex86.cpp b/src/devices/cpu/drcbex86.cpp index af3cf56a839bd..724da1cd12532 100644 --- a/src/devices/cpu/drcbex86.cpp +++ b/src/devices/cpu/drcbex86.cpp @@ -91,9 +91,13 @@ #include "debug/debugcpu.h" #include "emuopts.h" +#include "mfpresolve.h" + #include "asmjit/src/asmjit/asmjit.h" #include +#include +#include namespace drc { @@ -413,9 +417,9 @@ class drcbe_x86 : public drcbe_interface virtual void reset() override; virtual int execute(uml::code_handle &entry) override; virtual void generate(drcuml_block &block, const uml::instruction *instlist, uint32_t numinst) override; - virtual bool hash_exists(uint32_t mode, uint32_t pc) override; - virtual void get_info(drcbe_info &info) override; - virtual bool logging() const override { return m_log != nullptr; } + virtual bool hash_exists(uint32_t mode, uint32_t pc) const noexcept override; + virtual void get_info(drcbe_info &info) const noexcept override; + virtual bool logging() const noexcept override { return m_log != nullptr; } private: // HACK: leftover from x86emit @@ -498,6 +502,7 @@ class drcbe_x86 : public drcbe_interface bool can_skip_lower_load(asmjit::x86::Assembler &a, uint32_t *memref, asmjit::x86::Gp const ®lo); bool can_skip_upper_load(asmjit::x86::Assembler &a, uint32_t *memref, asmjit::x86::Gp const ®hi); + [[noreturn]] void end_of_block() const; static void debug_log_hashjmp(int mode, offs_t pc); // code generators @@ -636,6 +641,7 @@ class drcbe_x86 : public drcbe_interface x86_entry_point_func m_entry; // entry point x86code * m_exit; // exit point x86code * m_nocode; // nocode handler + x86code * m_endofblock; // end of block handler x86code * m_save; // save handler x86code * m_restore; // restore handler @@ -1027,6 +1033,7 @@ drcbe_x86::drcbe_x86(drcuml_state &drcuml, device_t &device, drc_cache &cache, u , m_entry(nullptr) , m_exit(nullptr) , m_nocode(nullptr) + , m_endofblock(nullptr) , m_save(nullptr) , m_restore(nullptr) , m_last_lower_reg(Gp()) @@ -1217,6 +1224,18 @@ void drcbe_x86::reset() a.bind(a.newNamedLabel("nocode_point")); a.ret(); // ret + // generate an end-of-block handler point + m_endofblock = dst + a.offset(); + a.bind(a.newNamedLabel("end_of_block_point")); + auto const [entrypoint, adjusted] = util::resolve_member_function(&drcbe_x86::end_of_block, *this); + if (USE_THISCALL) + a.mov(ecx, imm(adjusted)); + else + a.mov(dword_ptr(esp, 0), imm(adjusted)); + a.call(imm(entrypoint)); + if (USE_THISCALL) + a.sub(esp, 4); + // generate a save subroutine m_save = dst + a.offset(); a.bind(a.newNamedLabel("save")); @@ -1299,7 +1318,8 @@ void drcbe_x86::reset() { x86log_disasm_code_range(m_log, "entry_point", dst, m_exit); x86log_disasm_code_range(m_log, "exit_point", m_exit, m_nocode); - x86log_disasm_code_range(m_log, "nocode_point", m_nocode, m_save); + x86log_disasm_code_range(m_log, "nocode_point", m_nocode, m_endofblock); + x86log_disasm_code_range(m_log, "end_of_block", m_endofblock, m_save); x86log_disasm_code_range(m_log, "save", m_save, m_restore); x86log_disasm_code_range(m_log, "restore", m_restore, dst + bytes); @@ -1387,7 +1407,7 @@ void drcbe_x86::generate(drcuml_block &block, const instruction *instlist, uint3 std::string dasm; // add a comment - if (m_log != nullptr) + if (m_log) { dasm = inst.disasm(&m_drcuml); x86log_add_comment(m_log, dst + a.offset(), "%s", dasm.c_str()); @@ -1407,13 +1427,21 @@ void drcbe_x86::generate(drcuml_block &block, const instruction *instlist, uint3 (this->*s_opcode_table[inst.opcode()])(a, inst); } + // catch falling off the end of a block + if (m_log) + { + x86log_add_comment(m_log, dst + a.offset(), "%s", "end of block"); + a.setInlineComment("end of block"); + } + a.jmp(imm(m_endofblock)); + // emit the generated code size_t const bytes = emit(ch); if (!bytes) block.abort(); // log it - if (m_log != nullptr) + if (m_log) x86log_disasm_code_range(m_log, (blockname.empty()) ? "Unknown block" : blockname.c_str(), dst, dst + bytes); // tell all of our utility objects that the block is finished @@ -1427,7 +1455,7 @@ void drcbe_x86::generate(drcuml_block &block, const instruction *instlist, uint3 // given mode/pc exists in the hash table //------------------------------------------------- -bool drcbe_x86::hash_exists(uint32_t mode, uint32_t pc) +bool drcbe_x86::hash_exists(uint32_t mode, uint32_t pc) const noexcept { return m_hash.code_exists(mode, pc); } @@ -1438,7 +1466,7 @@ bool drcbe_x86::hash_exists(uint32_t mode, uint32_t pc) // the back-end implementation //------------------------------------------------- -void drcbe_x86::get_info(drcbe_info &info) +void drcbe_x86::get_info(drcbe_info &info) const noexcept { for (info.direct_iregs = 0; info.direct_iregs < REG_I_COUNT; info.direct_iregs++) if (int_register_map[info.direct_iregs] == 0) @@ -1467,7 +1495,9 @@ void drcbe_x86::emit_mov_r32_p32(Assembler &a, Gp const ®, be_parameter const a.mov(reg, param.immediate()); // mov reg,param } else if (param.is_memory()) + { a.mov(reg, MABS(param.memory())); // mov reg,[param] + } else if (param.is_int_register()) { if (reg.id() != param.ireg()) @@ -2816,6 +2846,20 @@ void drcbe_x86::emit_fstp_p(Assembler &a, int size, be_parameter const ¶m) // DEBUG HELPERS //************************************************************************** +//------------------------------------------------- +// end_of_block - function to catch falling off +// the end of a generated code block +//------------------------------------------------- + +[[noreturn]] void drcbe_x86::end_of_block() const +{ + osd_printf_error("drcbe_x86(%s): fell off the end of a generated code block!\n", m_device.tag()); + std::fflush(stdout); + std::fflush(stderr); + std::abort(); +} + + //------------------------------------------------- // debug_log_hashjmp - callback to handle // logging of hashjmps @@ -2823,7 +2867,7 @@ void drcbe_x86::emit_fstp_p(Assembler &a, int size, be_parameter const ¶m) void drcbe_x86::debug_log_hashjmp(int mode, offs_t pc) { - printf("mode=%d PC=%08X\n", mode, pc); + std::printf("mode=%d PC=%08X\n", mode, pc); } @@ -3797,14 +3841,14 @@ void drcbe_x86::op_store(Assembler &a, const instruction &inst) if (size == SIZE_BYTE && (srcreg.id() & 4)) // FIXME: &4? srcreg = eax; - // degenerate case: constant index if (indp.is_immediate()) { + // degenerate case: constant index int const scale = 1 << (scalesizep.scale()); - // immediate source if (srcp.is_immediate()) { + // immediate source if (size == SIZE_BYTE) a.mov(MABS(basep.memory(scale*indp.immediate()), 1), srcp.immediate()); // mov [basep + scale*indp],srcp else if (size == SIZE_WORD) @@ -3818,14 +3862,14 @@ void drcbe_x86::op_store(Assembler &a, const instruction &inst) // mov [basep + scale*indp + 4],srcp >> 32 } } - - // variable source else { + // variable source if (size != SIZE_QWORD) emit_mov_r32_p32(a, srcreg, srcp); // mov srcreg,srcp else emit_mov_r64_p64(a, srcreg, edx, srcp); // mov edx:srcreg,srcp + if (size == SIZE_BYTE) a.mov(MABS(basep.memory(scale*indp.immediate())), srcreg.r8()); // mov [basep + scale*indp],srcreg else if (size == SIZE_WORD) @@ -3839,16 +3883,15 @@ void drcbe_x86::op_store(Assembler &a, const instruction &inst) } } } - - // normal case: variable index else { + // normal case: variable index Gp const indreg = indp.select_register(ecx); emit_mov_r32_p32(a, indreg, indp); // mov indreg,indp - // immediate source if (srcp.is_immediate()) { + // immediate source if (size == SIZE_BYTE) a.mov(ptr(u64(basep.memory()), indreg, scalesizep.scale(), 1), srcp.immediate()); // mov [basep + 1*ecx],srcp else if (size == SIZE_WORD) @@ -3862,10 +3905,9 @@ void drcbe_x86::op_store(Assembler &a, const instruction &inst) // mov [basep + 8*ecx + 4],srcp >> 32 } } - - // variable source else { + // variable source if (size != SIZE_QWORD) emit_mov_r32_p32(a, srcreg, srcp); // mov srcreg,srcp else diff --git a/src/devices/cpu/drcuml.h b/src/devices/cpu/drcuml.h index b146a6b700d7b..acc864a520176 100644 --- a/src/devices/cpu/drcuml.h +++ b/src/devices/cpu/drcuml.h @@ -136,9 +136,9 @@ class drcbe_interface virtual void reset() = 0; virtual int execute(uml::code_handle &entry) = 0; virtual void generate(drcuml_block &block, uml::instruction const *instlist, u32 numinst) = 0; - virtual bool hash_exists(u32 mode, u32 pc) = 0; - virtual void get_info(drcbe_info &info) = 0; - virtual bool logging() const { return false; } + virtual bool hash_exists(u32 mode, u32 pc) const noexcept = 0; + virtual void get_info(drcbe_info &info) const noexcept = 0; + virtual bool logging() const noexcept { return false; } protected: // base constructor @@ -173,8 +173,8 @@ class drcuml_state drcuml_block &begin_block(u32 maxinst); // back-end interface - void get_backend_info(drcbe_info &info) { m_beintf->get_info(info); } - bool hash_exists(u32 mode, u32 pc) { return m_beintf->hash_exists(mode, pc); } + void get_backend_info(drcbe_info &info) const { m_beintf->get_info(info); } + bool hash_exists(u32 mode, u32 pc) const { return m_beintf->hash_exists(mode, pc); } void generate(drcuml_block &block, uml::instruction *instructions, u32 count) { m_beintf->generate(block, instructions, count); } // handle management diff --git a/src/devices/cpu/dsp56156/dsp56156.cpp b/src/devices/cpu/dsp56156/dsp56156.cpp index 55ac2225c4b11..42b5e3c0a6925 100644 --- a/src/devices/cpu/dsp56156/dsp56156.cpp +++ b/src/devices/cpu/dsp56156/dsp56156.cpp @@ -250,8 +250,6 @@ void dsp56156_device::alu_init() void dsp56156_device::device_start() { - memset(&m_core, 0, sizeof(m_core)); - m_core.device = this; m_core.program_ram = m_program_ram; @@ -263,7 +261,7 @@ void dsp56156_device::device_start() /* HACK - You're not in bootstrap mode upon bootup */ m_core.bootstrap_mode = BOOTSTRAP_OFF; - /* Clear the irq states */ + /* Clear the IRQ states */ m_core.modA_state = false; m_core.modB_state = false; m_core.modC_state = false; diff --git a/src/devices/cpu/dsp56156/dsp56156.h b/src/devices/cpu/dsp56156/dsp56156.h index 9a4fae9b768fb..d85d019bd4841 100644 --- a/src/devices/cpu/dsp56156/dsp56156.h +++ b/src/devices/cpu/dsp56156/dsp56156.h @@ -14,6 +14,7 @@ #pragma once +#include // IRQ Lines @@ -33,15 +34,22 @@ class dsp56156_device; // 5-4 Host Interface struct dsp56156_host_interface { + dsp56156_host_interface() + : hcr(nullptr), hsr(nullptr), htrx(nullptr) + , icr(0), cvr(0), isr(0), ivr(0), trxh(0), trxl(0) + , bootstrap_offset(0) + { + } + // **** DSP56156 side **** // // Host Control Register - uint16_t* hcr; + uint16_t *hcr; // Host Status Register - uint16_t* hsr; + uint16_t *hsr; // Host Transmit/Receive Data - uint16_t* htrx; + uint16_t *htrx; // **** Host CPU side **** // // Interrupt Control Register @@ -62,12 +70,19 @@ struct dsp56156_host_interface // HACK - Host interface bootstrap write offset uint16_t bootstrap_offset; - }; // 1-9 ALU struct dsp56156_data_alu { + dsp56156_data_alu() + { + x.d = 0; + y.d = 0; + a.q = 0; + b.q = 0; + } + // Four 16-bit input registers (can be accessed as 2 32-bit registers) PAIR x; PAIR y; @@ -85,6 +100,14 @@ struct dsp56156_data_alu // 1-10 Address Generation Unit (AGU) struct dsp56156_agu { + dsp56156_agu() + : r0(0), r1(0), r2(0), r3(0) + , n0(0), n1(0), n2(0), n3(0) + , m0(0), m1(0), m2(0), m3(0) + , temp(0) + { + } + // Four address registers uint16_t r0; uint16_t r1; @@ -115,26 +138,24 @@ struct dsp56156_agu // 1-11 Program Control Unit (PCU) struct dsp56156_pcu { - // Program Counter - uint16_t pc; - - // Loop Address - uint16_t la; - - // Loop Counter - uint16_t lc; - - // Status Register - uint16_t sr; - - // Operating Mode Register - uint16_t omr; - - // Stack Pointer - uint16_t sp; - - // Stack (TODO: 15-level?) - PAIR ss[16]; + dsp56156_pcu() + : pc(0), la(0), lc(0), sr(0), omr(0), sp(0) + , service_interrupts(nullptr) + , reset_vector(0) + , ipc(0) + { + for (auto &s : ss) + s.d = 0; + std::fill(std::begin(pending_interrupts), std::end(pending_interrupts), 0); + } + + uint16_t pc; // Program Counter + uint16_t la; // Loop Address + uint16_t lc; // Loop Counter + uint16_t sr; // Status Register + uint16_t omr; // Operating Mode Register + uint16_t sp; // Stack Pointer + PAIR ss[16]; // Stack (TODO: 15-level?) // Controls IRQ processing void (*service_interrupts)(void); @@ -152,6 +173,21 @@ struct dsp56156_pcu // 1-8 The dsp56156 CORE struct dsp56156_core { + dsp56156_core() + : modA_state(false), modB_state(false), modC_state(false), reset_state(false) + , bootstrap_mode(0) + , repFlag(0), repAddr(0) + , icount(0) + , ppc(0) + , op(0) + , interrupt_cycles(0) + , output_pins_changed(nullptr) + , device(nullptr) + , program_ram(nullptr) + { + std::fill(std::begin(peripheral_ram), std::end(peripheral_ram), 0); + } + // PROGRAM CONTROLLER dsp56156_pcu PCU; diff --git a/src/devices/cpu/dsp56156/dsp56pcu.cpp b/src/devices/cpu/dsp56156/dsp56pcu.cpp index fed41a5d26732..7617cf8d56e5e 100644 --- a/src/devices/cpu/dsp56156/dsp56pcu.cpp +++ b/src/devices/cpu/dsp56156/dsp56pcu.cpp @@ -100,7 +100,7 @@ uint8_t SE_bit(const dsp56156_core* cpustate) { return ((SP & 0x0010) != 0); } ***************************************************************************/ void pcu_init(dsp56156_core* cpustate, device_t *device) { - /* Init the irq table */ + /* Init the IRQ table */ dsp56156_irq_table_init(); /* save states - dsp56156_pcu members */ @@ -322,7 +322,7 @@ void dsp56156_set_irq_source(uint8_t irq_num, uint16_t iv, const char* source) } /* Construct a table containing pertient IRQ information */ -void dsp56156_irq_table_init(void) +void dsp56156_irq_table_init() { /* 1-14 + 1-18 */ /* TODO: Cull host command stuff appropriately */ diff --git a/src/devices/cpu/e132xs/e132xs.h b/src/devices/cpu/e132xs/e132xs.h index 5b245afe43f44..670cba5ac54e6 100644 --- a/src/devices/cpu/e132xs/e132xs.h +++ b/src/devices/cpu/e132xs/e132xs.h @@ -6,10 +6,12 @@ #pragma once #include "32xsdasm.h" + #include "cpu/drcfe.h" #include "cpu/drcuml.h" #include "cpu/drcumlsh.h" + /* A note about clock multipliers and dividers: @@ -488,8 +490,7 @@ class hyperstone_device : public cpu_device, public hyperstone_disassembler::con void static_generate_exception(uint32_t exception, const char *name); void static_generate_memory_accessor(int size, int iswrite, bool isio, const char *name, uml::code_handle *&handleptr); void static_generate_interrupt_checks(); - void generate_interrupt_checks_no_timer(drcuml_block &block, uml::code_label &labelnum); - void generate_interrupt_checks_with_timer(drcuml_block &block, uml::code_label &labelnum); + void generate_interrupt_checks(drcuml_block &block, uml::code_label &labelnum, bool with_timer, int take_int, int take_timer); void generate_branch(drcuml_block &block, uml::parameter targetpc, const opcode_desc *desc, bool update_cycles = true); void generate_update_cycles(drcuml_block &block, bool check_interrupts = true); void generate_checksum_block(drcuml_block &block, compiler_state &compiler, const opcode_desc *seqhead, const opcode_desc *seqlast); @@ -497,22 +498,35 @@ class hyperstone_device : public cpu_device, public hyperstone_disassembler::con void log_add_disasm_comment(drcuml_block &block, uint32_t pc, uint32_t op); bool generate_opcode(drcuml_block &block, compiler_state &compiler, const opcode_desc *desc); - void generate_get_trap_addr(drcuml_block &block, uml::code_label &label, uint32_t trapno); + void generate_get_trap_addr(drcuml_block &block, uml::code_label &label, uml::parameter trapno); void generate_check_delay_pc(drcuml_block &block, compiler_state &compiler, const opcode_desc *desc); - void generate_decode_const(drcuml_block &block, compiler_state &compiler, const opcode_desc *desc); - void generate_decode_immediate_s(drcuml_block &block, compiler_state &compiler, const opcode_desc *desc); + uint32_t generate_get_const(drcuml_block &block, compiler_state &compiler, const opcode_desc *desc); + uint32_t generate_get_immediate_s(drcuml_block &block, compiler_state &compiler, const opcode_desc *desc); void generate_ignore_immediate_s(drcuml_block &block, const opcode_desc *desc); - void generate_decode_pcrel(drcuml_block &block, const opcode_desc *desc); + uint32_t generate_get_pcrel(drcuml_block &block, const opcode_desc *desc); void generate_ignore_pcrel(drcuml_block &block, const opcode_desc *desc); void generate_get_global_register(drcuml_block &block, compiler_state &compiler, const opcode_desc *desc); void generate_set_global_register(drcuml_block &block, compiler_state &compiler, const opcode_desc *desc); + void generate_set_global_register_low(drcuml_block &block, compiler_state &compiler, uint32_t dst_code, uml::parameter src); + void generate_set_global_register_high(drcuml_block &block, compiler_state &compiler, uint32_t dst_code, uml::parameter src); - template void generate_trap_exception_or_int(drcuml_block &block); + void generate_load_operand(drcuml_block &block, compiler_state &compiler, reg_bank global, uint32_t code, uml::parameter dst, uml::parameter localidx); + void generate_load_src_addsub(drcuml_block &block, compiler_state &compiler, reg_bank global, uint32_t code, uml::parameter dst, uml::parameter localidx, uml::parameter sr); + void generate_set_dst(drcuml_block &block, compiler_state &compiler, const opcode_desc *desc, reg_bank global, uint32_t code, uml::parameter src, uml::parameter localidx, bool calcidx); + void generate_update_flags_addsub(drcuml_block &block, compiler_state &compiler, uml::parameter sr); + void generate_update_flags_addsubc(drcuml_block &block, compiler_state &compiler, uml::parameter sr); + void generate_update_flags_addsubs(drcuml_block &block, compiler_state &compiler, uml::parameter sr); + + template void generate_trap_exception_or_int(drcuml_block &block, uml::code_label &label, uml::parameter trapno); void generate_int(drcuml_block &block, compiler_state &compiler, const opcode_desc *desc, uint32_t addr); void generate_exception(drcuml_block &block, compiler_state &compiler, const opcode_desc *desc, uint32_t addr); void generate_software(drcuml_block &block, compiler_state &compiler, const opcode_desc *desc); + void generate_trap_on_overflow(drcuml_block &block, compiler_state &compiler, const opcode_desc *desc); + template void generate_logic_op(drcuml_block &block, compiler_state &compiler, const opcode_desc *desc, T &&body); + template void generate_logic_op_imm(drcuml_block &block, compiler_state &compiler, const opcode_desc *desc, uint32_t dst_code, T &&body); + template void generate_chk(drcuml_block &block, compiler_state &compiler, const opcode_desc *desc); template void generate_movd(drcuml_block &block, compiler_state &compiler, const opcode_desc *desc); template void generate_divsu(drcuml_block &block, compiler_state &compiler, const opcode_desc *desc); diff --git a/src/devices/cpu/e132xs/e132xsdrc.cpp b/src/devices/cpu/e132xs/e132xsdrc.cpp index a07b719b8fbe3..64fb22173938d 100644 --- a/src/devices/cpu/e132xs/e132xsdrc.cpp +++ b/src/devices/cpu/e132xs/e132xsdrc.cpp @@ -183,7 +183,6 @@ void hyperstone_device::code_flush_cache() static_generate_memory_accessor(4, false, true, "ioread32", m_io_read32); static_generate_memory_accessor(4, true, true, "iowrite32", m_io_write32); } - catch (drcuml_block::abort_compilation &) { fatalerror("Unable to generate static E132XS code\n"); fflush(stdout); @@ -191,17 +190,32 @@ void hyperstone_device::code_flush_cache() } /* Return the entry point for a determinated trap */ -void hyperstone_device::generate_get_trap_addr(drcuml_block &block, uml::code_label &label, uint32_t trapno) +void hyperstone_device::generate_get_trap_addr(drcuml_block &block, uml::code_label &label, uml::parameter trapno) { - int no_subtract; - UML_MOV(block, I0, trapno); - UML_CMP(block, mem(&m_core->trap_entry), 0xffffff00); - UML_JMPc(block, uml::COND_E, no_subtract = label++); - UML_SUB(block, I0, 63, I0); - - UML_LABEL(block, no_subtract); - UML_SHL(block, I0, I0, 2); - UML_OR(block, I0, I0, mem(&m_core->trap_entry)); + // sets I0 to target address + // clobbers I1 + // updates label + + UML_MOV(block, I1, mem(&m_core->trap_entry)); + UML_CMP(block, I1, 0xffffff00); + + if (trapno.is_immediate()) + { + UML_MOV(block, I0, trapno.immediate() * 4); + UML_MOVc(block, uml::COND_NE, I0, (63 - trapno.immediate()) * 4); + } + else + { + const int no_subtract = label++; + if (trapno != uml::I0) + UML_MOV(block, I0, trapno); + UML_JMPc(block, uml::COND_E, no_subtract); + UML_SUB(block, I0, 63, I0); + UML_LABEL(block, no_subtract); + UML_SHL(block, I0, I0, 2); + } + + UML_OR(block, I0, I0, I1); } /*------------------------------------------------- @@ -348,30 +362,32 @@ void hyperstone_device::static_generate_exception(uint32_t exception, const char UML_HANDLE(block, *exception_handle); uml::code_label label = 1; - generate_get_trap_addr(block, label, exception); - UML_ROLAND(block, I1, DRC_SR, 7, 0x7f); - UML_ROLAND(block, I2, DRC_SR, 11, 0xf); - UML_TEST(block, I2, 0xf); - UML_MOVc(block, uml::COND_Z, I2, 16); - UML_ADD(block, I1, I1, I2); - - UML_MOV(block, I4, DRC_SR); - UML_ROLINS(block, DRC_SR, 2, 21, 0x01e00000); - UML_ROLINS(block, DRC_SR, I1, 25, 0xfe000000); - - UML_AND(block, I3, I1, 0x3f); - UML_AND(block, I1, DRC_PC, ~1); - UML_ROLAND(block, I2, DRC_SR, 14, 1); - UML_OR(block, I1, I1, I2); - UML_STORE(block, (void *)m_core->local_regs, I3, I1, SIZE_DWORD, SCALE_x4); - UML_ADD(block, I3, I3, 1); + generate_get_trap_addr(block, label, exception); // I0 = target PC + + UML_MOV(block, I4, DRC_SR); // I4 = old SR + + UML_MOV(block, I1, I4); // I1 = SR to be updated + UML_ROLAND(block, I3, I4, 7, 0x7f); // I3 = old FP + UML_ROLAND(block, I2, I4, 11, 0xf); // I2 = old FL + UML_MOVc(block, uml::COND_Z, I2, 16); // convert FL == 0 to 16 + UML_ADD(block, I3, I3, I2); // I3 = updated FP + + UML_SHL(block, I2, I3, 25); // I2 = updated FP:... + UML_OR(block, I2, I2, 2 << 21); // I2 = updated FP:FL:... + UML_ROLINS(block, I1, I2, 0, 0xffe00000); // update FP and FL in I1 + UML_AND(block, I1, I1, ~(M_MASK | T_MASK)); // clear M and T, set S and L + UML_OR(block, I1, I1, (L_MASK | S_MASK)); + UML_MOV(block, DRC_SR, I1); // store updated SR + + UML_AND(block, I3, I3, 0x3f); // save old PC at updated (FP)^ + UML_AND(block, I2, DRC_PC, ~uint32_t(1)); + UML_ROLINS(block, I2, I4, 32 - S_SHIFT, 1); + UML_STORE(block, (void *)m_core->local_regs, I3, I2, SIZE_DWORD, SCALE_x4); + UML_ADD(block, I3, I3, 1); // save old SR at updated (FP + 1)^ UML_AND(block, I3, I3, 0x3f); UML_STORE(block, (void *)m_core->local_regs, I3, I4, SIZE_DWORD, SCALE_x4); - UML_AND(block, DRC_SR, DRC_SR, ~(M_MASK | T_MASK)); - UML_OR(block, DRC_SR, DRC_SR, (L_MASK | S_MASK)); - - UML_MOV(block, DRC_PC, I0); + UML_MOV(block, DRC_PC, I0); // branch to exception handler UML_SUB(block, mem(&m_core->icount), mem(&m_core->icount), 2); UML_EXHc(block, uml::COND_S, *m_out_of_cycles, 0); @@ -391,30 +407,42 @@ void hyperstone_device::static_generate_interrupt_checks() UML_HANDLE(block, *m_interrupt_checks); uml::code_label labelnum = 1; - int done_int = labelnum++; - int int_pending = labelnum++; - int timer_int_pending = labelnum++; + const int timer_int_pending = labelnum++; + const int take_int = labelnum++; + const int take_timer = labelnum++; + const int dispatch_int = labelnum++; + const int done_int = labelnum++; + UML_CMP(block, mem(&m_core->intblock), 0); UML_JMPc(block, uml::COND_G, done_int); UML_TEST(block, DRC_SR, L_MASK); UML_JMPc(block, uml::COND_NZ, done_int); + + UML_MOV(block, I0, mem(&ISR)); + UML_TEST(block, mem(&m_core->timer_int_pending), 1); UML_JMPc(block, uml::COND_NZ, timer_int_pending); - UML_TEST(block, mem(&ISR), 0x7f); - UML_JMPc(block, uml::COND_NZ, int_pending); - UML_JMP(block, done_int); - UML_LABEL(block, int_pending); - UML_MOV(block, I0, mem(&ISR)); - UML_MOV(block, I1, mem(&FCR)); - generate_interrupt_checks_no_timer(block, labelnum); + UML_TEST(block, I0, 0x7f); + UML_JMPc(block, uml::COND_Z, done_int); + + generate_interrupt_checks(block, labelnum, false, take_int, take_timer); UML_JMP(block, done_int); UML_LABEL(block, timer_int_pending); - UML_MOV(block, I0, mem(&ISR)); - UML_MOV(block, I1, mem(&FCR)); - UML_ROLAND(block, I2, I1, 12, 0xb); - generate_interrupt_checks_with_timer(block, labelnum); + generate_interrupt_checks(block, labelnum, true, take_int, take_timer); + UML_JMP(block, done_int); + + UML_LABEL(block, take_int); + UML_CALLC(block, cfunc_standard_irq_callback, this); + UML_JMP(block, dispatch_int); + + UML_LABEL(block, take_timer); + UML_MOV(block, mem(&m_core->timer_int_pending), 0); + UML_MOV(block, I0, TRAPNO_TIMER); + + UML_LABEL(block, dispatch_int); + generate_trap_exception_or_int(block, labelnum, uml::I0); UML_LABEL(block, done_int); UML_RET(block); @@ -541,201 +569,106 @@ void hyperstone_device::static_generate_memory_accessor(int size, int iswrite, b CODE GENERATION ***************************************************************************/ -void hyperstone_device::generate_interrupt_checks_no_timer(drcuml_block &block, uml::code_label &labelnum) +void hyperstone_device::generate_interrupt_checks(drcuml_block &block, uml::code_label &labelnum, bool with_timer, int take_int, int take_timer) { - int skip_io3 = labelnum++; - UML_TEST(block, I0, 0x40); - UML_JMPc(block, uml::COND_Z, skip_io3); - UML_AND(block, I3, I1, 0x500); - UML_CMP(block, I3, 0x400); - UML_JMPc(block, uml::COND_NE, skip_io3); - generate_get_trap_addr(block, labelnum, TRAPNO_IO3); - UML_MOV(block, mem(&m_core->arg0), IRQ_IO3); - UML_CALLC(block, cfunc_standard_irq_callback, this); - generate_trap_exception_or_int(block); - UML_LABEL(block, skip_io3); - - int skip_int1 = labelnum++; - UML_TEST(block, I0, 0x01); - UML_JMPc(block, uml::COND_Z, skip_int1); - UML_TEST(block, I1, 0x10000000); - UML_JMPc(block, uml::COND_NZ, skip_int1); - generate_get_trap_addr(block, labelnum, TRAPNO_INT1); - UML_MOV(block, mem(&m_core->arg0), IRQ_INT1); - UML_CALLC(block, cfunc_standard_irq_callback, this); - generate_trap_exception_or_int(block); - UML_LABEL(block, skip_int1); - - int skip_int2 = labelnum++; - UML_TEST(block, I0, 0x02); - UML_JMPc(block, uml::COND_Z, skip_int2); - UML_TEST(block, I1, 0x20000000); - UML_JMPc(block, uml::COND_NZ, skip_int2); - generate_get_trap_addr(block, labelnum, TRAPNO_INT2); - UML_MOV(block, mem(&m_core->arg0), IRQ_INT2); - UML_CALLC(block, cfunc_standard_irq_callback, this); - generate_trap_exception_or_int(block); - UML_LABEL(block, skip_int2); - - int skip_int3 = labelnum++; - UML_TEST(block, I0, 0x04); - UML_JMPc(block, uml::COND_Z, skip_int3); - UML_TEST(block, I1, 0x40000000); - UML_JMPc(block, uml::COND_NZ, skip_int3); - generate_get_trap_addr(block, labelnum, TRAPNO_INT3); - UML_MOV(block, mem(&m_core->arg0), IRQ_INT3); - UML_CALLC(block, cfunc_standard_irq_callback, this); - generate_trap_exception_or_int(block); - UML_LABEL(block, skip_int3); - - int skip_int4 = labelnum++; - UML_TEST(block, I0, 0x08); - UML_JMPc(block, uml::COND_Z, skip_int4); - UML_TEST(block, I1, 0x80000000); - UML_JMPc(block, uml::COND_NZ, skip_int4); - generate_get_trap_addr(block, labelnum, TRAPNO_INT4); - UML_MOV(block, mem(&m_core->arg0), IRQ_INT4); - UML_CALLC(block, cfunc_standard_irq_callback, this); - generate_trap_exception_or_int(block); - UML_LABEL(block, skip_int4); - - int skip_io1 = labelnum++; - UML_TEST(block, I0, 0x10); - UML_JMPc(block, uml::COND_Z, skip_io1); - UML_AND(block, I2, I1, 0x5); - UML_CMP(block, I2, 0x4); - UML_JMPc(block, uml::COND_NE, skip_io1); - generate_get_trap_addr(block, labelnum, TRAPNO_IO1); - UML_MOV(block, mem(&m_core->arg0), IRQ_IO1); - UML_CALLC(block, cfunc_standard_irq_callback, this); - generate_trap_exception_or_int(block); - UML_LABEL(block, skip_io1); + UML_MOV(block, I1, mem(&FCR)); - int skip_io2 = labelnum++; - UML_TEST(block, I0, 0x10); - UML_JMPc(block, uml::COND_Z, skip_io2); - UML_AND(block, I2, I1, 0x50); - UML_CMP(block, I2, 0x40); - UML_JMPc(block, uml::COND_NE, skip_io2); - generate_get_trap_addr(block, labelnum, TRAPNO_IO2); - UML_MOV(block, mem(&m_core->arg0), IRQ_IO2); - UML_CALLC(block, cfunc_standard_irq_callback, this); - generate_trap_exception_or_int(block); - UML_LABEL(block, skip_io2); -} + // combine I/O mask and direction in I4 bits 0/4/8 + UML_SHR(block, I2, I1, 2); + UML_XOR(block, I4, I1, 0xffffffff); + UML_AND(block, I4, I4, I2); -void hyperstone_device::generate_interrupt_checks_with_timer(drcuml_block &block, uml::code_label &labelnum) -{ - int skip_io3 = labelnum++; + const int skip_io3 = labelnum++; UML_TEST(block, I0, 0x40); UML_JMPc(block, uml::COND_Z, skip_io3); - UML_AND(block, I3, I1, 0x500); - UML_CMP(block, I3, 0x400); - UML_JMPc(block, uml::COND_NE, skip_io3); - generate_get_trap_addr(block, labelnum, TRAPNO_IO3); + UML_TEST(block, I4, 0x100); + UML_JMPc(block, uml::COND_Z, skip_io3); UML_MOV(block, mem(&m_core->arg0), IRQ_IO3); - UML_CALLC(block, cfunc_standard_irq_callback, this); - generate_trap_exception_or_int(block); + UML_MOV(block, I0, TRAPNO_IO3); + UML_JMP(block, take_int); UML_LABEL(block, skip_io3); - int skip_timer_pri6 = labelnum++; - UML_CMP(block, I2, 0x3); - UML_JMPc(block, uml::COND_NE, skip_timer_pri6); - UML_MOV(block, mem(&m_core->timer_int_pending), 0); - generate_get_trap_addr(block, labelnum, TRAPNO_TIMER); - generate_trap_exception_or_int(block); - UML_LABEL(block, skip_timer_pri6); + if (with_timer) + { + UML_ROLAND(block, I2, I1, 12, 0xb); + + UML_CMP(block, I2, 0x3); + UML_JMPc(block, uml::COND_E, take_timer); + } + + // get masked INT state in I3 bits 0-3 + UML_SHR(block, I3, I1, 28); + UML_XOR(block, I3, I3, 0xffffffff); + UML_AND(block, I3, I3, I0); - int skip_int1 = labelnum++; - UML_TEST(block, I0, 0x01); + const int skip_int1 = labelnum++; + UML_TEST(block, I3, 0x01); UML_JMPc(block, uml::COND_Z, skip_int1); - UML_TEST(block, I1, 0x10000000); - UML_JMPc(block, uml::COND_NZ, skip_int1); - generate_get_trap_addr(block, labelnum, TRAPNO_INT1); UML_MOV(block, mem(&m_core->arg0), IRQ_INT1); - UML_CALLC(block, cfunc_standard_irq_callback, this); - generate_trap_exception_or_int(block); + UML_MOV(block, I0, TRAPNO_INT1); + UML_JMP(block, take_int); UML_LABEL(block, skip_int1); - int skip_timer_pri8 = labelnum++; - UML_CMP(block, I2, 0x2); - UML_JMPc(block, uml::COND_NE, skip_timer_pri8); - UML_MOV(block, mem(&m_core->timer_int_pending), 0); - generate_get_trap_addr(block, labelnum, TRAPNO_TIMER); - generate_trap_exception_or_int(block); - UML_LABEL(block, skip_timer_pri8); + if (with_timer) + { + UML_CMP(block, I2, 0x2); + UML_JMPc(block, uml::COND_E, take_timer); + } - int skip_int2 = labelnum++; - UML_TEST(block, I0, 0x02); + const int skip_int2 = labelnum++; + UML_TEST(block, I3, 0x02); UML_JMPc(block, uml::COND_Z, skip_int2); - UML_TEST(block, I1, 0x20000000); - UML_JMPc(block, uml::COND_NZ, skip_int2); - generate_get_trap_addr(block, labelnum, TRAPNO_INT2); UML_MOV(block, mem(&m_core->arg0), IRQ_INT2); - UML_CALLC(block, cfunc_standard_irq_callback, this); - generate_trap_exception_or_int(block); + UML_MOV(block, I0, TRAPNO_INT2); + UML_JMP(block, take_int); UML_LABEL(block, skip_int2); - int skip_timer_pri10 = labelnum++; - UML_CMP(block, I2, 0x1); - UML_JMPc(block, uml::COND_NE, skip_timer_pri10); - UML_MOV(block, mem(&m_core->timer_int_pending), 0); - generate_get_trap_addr(block, labelnum, TRAPNO_TIMER); - generate_trap_exception_or_int(block); - UML_LABEL(block, skip_timer_pri10); + if (with_timer) + { + UML_CMP(block, I2, 0x1); + UML_JMPc(block, uml::COND_E, take_timer); + } - int skip_int3 = labelnum++; - UML_TEST(block, I0, 0x04); + const int skip_int3 = labelnum++; + UML_TEST(block, I3, 0x04); UML_JMPc(block, uml::COND_Z, skip_int3); - UML_TEST(block, I1, 0x40000000); - UML_JMPc(block, uml::COND_NZ, skip_int3); - generate_get_trap_addr(block, labelnum, TRAPNO_INT3); UML_MOV(block, mem(&m_core->arg0), IRQ_INT3); - UML_CALLC(block, cfunc_standard_irq_callback, this); - generate_trap_exception_or_int(block); + UML_MOV(block, I0, TRAPNO_INT3); + UML_JMP(block, take_int); UML_LABEL(block, skip_int3); - int skip_timer_pri12 = labelnum++; - UML_CMP(block, I2, 0x0); - UML_JMPc(block, uml::COND_NE, skip_timer_pri12); - UML_MOV(block, mem(&m_core->timer_int_pending), 0); - generate_get_trap_addr(block, labelnum, TRAPNO_TIMER); - generate_trap_exception_or_int(block); - UML_LABEL(block, skip_timer_pri12); + if (with_timer) + { + UML_CMP(block, I2, 0x0); + UML_JMPc(block, uml::COND_E, take_timer); + } - int skip_int4 = labelnum++; - UML_TEST(block, I0, 0x08); + const int skip_int4 = labelnum++; + UML_TEST(block, I3, 0x08); UML_JMPc(block, uml::COND_Z, skip_int4); - UML_TEST(block, I1, 0x80000000); - UML_JMPc(block, uml::COND_NZ, skip_int4); - generate_get_trap_addr(block, labelnum, TRAPNO_INT4); UML_MOV(block, mem(&m_core->arg0), IRQ_INT4); - UML_CALLC(block, cfunc_standard_irq_callback, this); - generate_trap_exception_or_int(block); + UML_MOV(block, I0, TRAPNO_INT4); + UML_JMP(block, take_int); UML_LABEL(block, skip_int4); - int skip_io1 = labelnum++; + const int skip_io1 = labelnum++; UML_TEST(block, I0, 0x10); UML_JMPc(block, uml::COND_Z, skip_io1); - UML_AND(block, I2, I1, 0x5); - UML_CMP(block, I2, 0x4); - UML_JMPc(block, uml::COND_NE, skip_io1); - generate_get_trap_addr(block, labelnum, TRAPNO_IO1); + UML_TEST(block, I4, 0x1); + UML_JMPc(block, uml::COND_Z, skip_io1); UML_MOV(block, mem(&m_core->arg0), IRQ_IO1); - UML_CALLC(block, cfunc_standard_irq_callback, this); - generate_trap_exception_or_int(block); + UML_MOV(block, I0, TRAPNO_IO1); + UML_JMP(block, take_int); UML_LABEL(block, skip_io1); - int skip_io2 = labelnum++; - UML_TEST(block, I0, 0x10); + const int skip_io2 = labelnum++; + UML_TEST(block, I0, 0x20); UML_JMPc(block, uml::COND_Z, skip_io2); - UML_AND(block, I2, I1, 0x50); - UML_CMP(block, I2, 0x40); - UML_JMPc(block, uml::COND_NE, skip_io2); - generate_get_trap_addr(block, labelnum, TRAPNO_IO2); + UML_TEST(block, I4, 0x10); + UML_JMPc(block, uml::COND_Z, skip_io1); UML_MOV(block, mem(&m_core->arg0), IRQ_IO2); - UML_CALLC(block, cfunc_standard_irq_callback, this); - generate_trap_exception_or_int(block); + UML_MOV(block, I0, TRAPNO_IO2); + UML_JMP(block, take_int); UML_LABEL(block, skip_io2); } @@ -747,22 +680,15 @@ void hyperstone_device::generate_interrupt_checks_with_timer(drcuml_block &block void hyperstone_device::generate_update_cycles(drcuml_block &block, bool check_interrupts) { - if (check_interrupts) - { - UML_SUB(block, mem(&m_core->intblock), mem(&m_core->intblock), 1); - UML_MOVc(block, uml::COND_S, mem(&m_core->intblock), 0); + UML_SUB(block, I0, mem(&m_core->intblock), 1); + UML_MOVc(block, uml::COND_S, I0, 0); + UML_MOV(block, mem(&m_core->intblock), I0); + if (check_interrupts) UML_CALLH(block, *m_interrupt_checks); - } - else - { - UML_SUB(block, mem(&m_core->intblock), mem(&m_core->intblock), 1); - UML_MOVc(block, uml::COND_S, mem(&m_core->intblock), 0); - } UML_SUB(block, mem(&m_core->icount), mem(&m_core->icount), I7); - UML_EXHc(block, uml::COND_S, *m_out_of_cycles, DRC_PC); - UML_EXHc(block, uml::COND_Z, *m_out_of_cycles, DRC_PC); + UML_EXHc(block, uml::COND_LE, *m_out_of_cycles, DRC_PC); UML_MOV(block, I7, 0); } diff --git a/src/devices/cpu/e132xs/e132xsdrc_ops.hxx b/src/devices/cpu/e132xs/e132xsdrc_ops.hxx index 22f049d89231c..d5c39b3a59c87 100644 --- a/src/devices/cpu/e132xs/e132xsdrc_ops.hxx +++ b/src/devices/cpu/e132xs/e132xsdrc_ops.hxx @@ -18,7 +18,7 @@ void hyperstone_device::generate_check_delay_pc(drcuml_block &block, compiler_st UML_SETc(block, uml::COND_NZ, mem(&m_core->delay_slot_taken)); } -void hyperstone_device::generate_decode_const(drcuml_block &block, compiler_state &compiler, const opcode_desc *desc) +uint32_t hyperstone_device::generate_get_const(drcuml_block &block, compiler_state &compiler, const opcode_desc *desc) { const uint16_t imm_1 = m_pr16(desc->pc + 2); @@ -26,14 +26,13 @@ void hyperstone_device::generate_decode_const(drcuml_block &block, compiler_stat { const uint16_t imm_2 = m_pr16(desc->pc + 4); - uint32_t imm = imm_2; - imm |= ((imm_1 & 0x3fff) << 16); + uint32_t imm = imm_2 | (uint32_t(imm_1 & 0x3fff) << 16); if (imm_1 & 0x4000) imm |= 0xc0000000; UML_ADD(block, DRC_PC, DRC_PC, 4); - UML_MOV(block, I1, imm); + return imm; } else { @@ -43,49 +42,35 @@ void hyperstone_device::generate_decode_const(drcuml_block &block, compiler_stat imm |= 0xffffc000; UML_ADD(block, DRC_PC, DRC_PC, 2); - UML_MOV(block, I1, imm); + return imm; } } -void hyperstone_device::generate_decode_immediate_s(drcuml_block &block, compiler_state &compiler, const opcode_desc *desc) +uint32_t hyperstone_device::generate_get_immediate_s(drcuml_block &block, compiler_state &compiler, const opcode_desc *desc) { - uint16_t op = desc->opptr.w[0]; + const uint16_t op = desc->opptr.w[0]; switch (op & 0xf) { case 0: - UML_MOV(block, I1, 16); - return; + return 16; case 1: - { - uint32_t extra_u = (m_pr16(desc->pc + 2) << 16) | m_pr16(desc->pc + 4); UML_ADD(block, DRC_PC, DRC_PC, 4); - UML_MOV(block, I1, extra_u); - return; - } + return (uint32_t(m_pr16(desc->pc + 2)) << 16) | m_pr16(desc->pc + 4); case 2: - { - uint32_t extra_u = m_pr16(desc->pc + 2); UML_ADD(block, DRC_PC, DRC_PC, 2); - UML_MOV(block, I1, extra_u); - return; - } + return m_pr16(desc->pc + 2); case 3: - { - uint32_t extra_u = 0xffff0000 | m_pr16(desc->pc + 2); UML_ADD(block, DRC_PC, DRC_PC, 2); - UML_MOV(block, I1, extra_u); - return; - } + return 0xffff0000 | m_pr16(desc->pc + 2); default: - UML_MOV(block, I1, s_immediate_values[op & 0xf]); - return; + return s_immediate_values[op & 0xf]; } } void hyperstone_device::generate_ignore_immediate_s(drcuml_block &block, const opcode_desc *desc) { - uint16_t op = desc->opptr.w[0]; + const uint16_t op = desc->opptr.w[0]; static const uint32_t offsets[16] = { 0, 4, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; const uint8_t nybble = op & 0x0f; @@ -93,37 +78,34 @@ void hyperstone_device::generate_ignore_immediate_s(drcuml_block &block, const o UML_ADD(block, DRC_PC, DRC_PC, offsets[nybble]); } -void hyperstone_device::generate_decode_pcrel(drcuml_block &block, const opcode_desc *desc) +uint32_t hyperstone_device::generate_get_pcrel(drcuml_block &block, const opcode_desc *desc) { - uint16_t op = desc->opptr.w[0]; + const uint16_t op = desc->opptr.w[0]; - int32_t offset; if (op & 0x80) { - uint16_t next = m_pr16(desc->pc + 2); - - offset = (op & 0x7f) << 16; - offset |= (next & 0xfffe); - + const uint16_t next = m_pr16(desc->pc + 2); + uint32_t offset = (uint32_t(op & 0x7f) << 16) | (next & 0xfffe); if (next & 1) offset |= 0xff800000; UML_ADD(block, DRC_PC, DRC_PC, 2); + + return offset; } else { - offset = op & 0x7e; - + uint32_t offset = op & 0x7e; if (op & 1) offset |= 0xffffff80; - } - UML_MOV(block, I1, offset); + return offset; + } } void hyperstone_device::generate_ignore_pcrel(drcuml_block &block, const opcode_desc *desc) { - uint16_t op = desc->opptr.w[0]; + const uint16_t op = desc->opptr.w[0]; if (op & 0x80) { @@ -236,53 +218,270 @@ void hyperstone_device::generate_set_global_register(drcuml_block &block, compil UML_LABEL(block, done); } -template -void hyperstone_device::generate_trap_exception_or_int(drcuml_block &block) +void hyperstone_device::generate_set_global_register_low(drcuml_block &block, compiler_state &compiler, uint32_t dst_code, uml::parameter src) { - UML_ADD(block, I7, I7, mem(&m_core->clock_cycles_2)); + if (dst_code == PC_REGISTER) + { + UML_AND(block, DRC_PC, src, ~uint32_t(1)); + } + else if (dst_code == SR_REGISTER) + { + UML_ROLINS(block, DRC_SR, src, 0, 0x0000ffff); + UML_AND(block, DRC_SR, DRC_SR, ~0x40); + UML_TEST(block, mem(&m_core->intblock), ~uint32_t(0)); + UML_MOVc(block, uml::COND_Z, mem(&m_core->intblock), 1); + } + else + { + UML_STORE(block, (void *)m_core->global_regs, dst_code, src, SIZE_DWORD, SCALE_x4); + } +} - UML_MOV(block, I4, DRC_SR); +void hyperstone_device::generate_set_global_register_high(drcuml_block &block, compiler_state &compiler, uint32_t dst_code, uml::parameter src) +{ + // Expects cycles in I7 (cleared after use), clobbers I6 + dst_code |= 0x10; - UML_ROLAND(block, I1, DRC_SR, 7, 0x7f); - UML_ROLAND(block, I2, DRC_SR, 11, 0xf); - UML_TEST(block, I2, 0xf); - UML_MOVc(block, uml::COND_Z, I2, 16); - UML_ADD(block, I3, I1, I2); + UML_SUB(block, mem(&m_core->icount), mem(&m_core->icount), I7); + UML_MOV(block, I7, 0); + switch (dst_code) + { + case 16: // G16 reserved + case 17: // G17 reserved + case BCR_REGISTER: // G20 Bus Control Register + case WCR_REGISTER: // G24 Watchdog Compare Register + case 28: // G28 reserved + case 29: // G29 reserved + case 30: // G30 reserved + case 31: // G31 reserved + UML_STORE(block, (void *)m_core->global_regs, dst_code, src, SIZE_DWORD, SCALE_x4); + break; + case SP_REGISTER: // G18 Stack Pointer + case UB_REGISTER: // G19 Upper Stack Bound + UML_AND(block, I6, src, ~uint32_t(3)); + UML_STORE(block, (void *)m_core->global_regs, dst_code, I6, SIZE_DWORD, SCALE_x4); + break; + case TPR_REGISTER: // G21 Timer Prescaler Register + { + const int skip_compute_tr = compiler.m_labelnum++; + UML_STORE(block, (void *)m_core->global_regs, dst_code, src, SIZE_DWORD, SCALE_x4); + UML_TEST(block, src, 0x80000000); + UML_JMPc(block, uml::COND_NZ, skip_compute_tr); + UML_CALLC(block, cfunc_compute_tr, this); + UML_CALLC(block, cfunc_update_timer_prescale, this); + UML_LABEL(block, skip_compute_tr); + UML_CALLC(block, cfunc_adjust_timer_interrupt, this); + } + break; + case TCR_REGISTER: // G22 Timer Compare Register + { + const int done = compiler.m_labelnum++; + UML_LOAD(block, I6, (void *)m_core->global_regs, dst_code, SIZE_DWORD, SCALE_x4); + UML_CMP(block, I6, src); + UML_JMPc(block, uml::COND_E, done); + UML_STORE(block, (void *)m_core->global_regs, dst_code, src, SIZE_DWORD, SCALE_x4); + UML_CALLC(block, cfunc_adjust_timer_interrupt, this); + UML_CMP(block, mem(&m_core->intblock), 1); + UML_MOVc(block, uml::COND_L, mem(&m_core->intblock), 1); + UML_LABEL(block, done); + } + break; + case TR_REGISTER: // G23 Timer Register + UML_STORE(block, (void *)m_core->global_regs, dst_code, src, SIZE_DWORD, SCALE_x4); + UML_MOV(block, mem(&m_core->tr_base_value), src); + UML_CALLC(block, cfunc_total_cycles, this); + UML_DMOV(block, mem(&m_core->tr_base_cycles), mem(&m_core->numcycles)); + UML_CALLC(block, cfunc_adjust_timer_interrupt, this); + break; + case ISR_REGISTER: // G25 Input Status Register (read-only) + break; + case FCR_REGISTER: // G26 Function Control Register + { + const int skip_adjust_timer = compiler.m_labelnum++; + UML_LOAD(block, I6, (void *)m_core->global_regs, dst_code, SIZE_DWORD, SCALE_x4); + UML_XOR(block, I6, I6, src); + UML_TEST(block, I6, 0x80000000); + UML_JMPc(block, uml::COND_Z, skip_adjust_timer); + UML_CALLC(block, cfunc_adjust_timer_interrupt, this); + UML_LABEL(block, skip_adjust_timer); + UML_STORE(block, (void *)m_core->global_regs, dst_code, src, SIZE_DWORD, SCALE_x4); + UML_CMP(block, mem(&m_core->intblock), 1); + UML_MOVc(block, uml::COND_L, mem(&m_core->intblock), 1); + } + break; + case MCR_REGISTER: // G27 Memory Control Register + UML_ROLAND(block, I6, src, 20, 0x7); + UML_LOAD(block, I6, (void *)s_trap_entries, I6, SIZE_DWORD, SCALE_x4); + UML_MOV(block, mem(&m_core->trap_entry), I6); + UML_STORE(block, (void *)m_core->global_regs, dst_code, src, SIZE_DWORD, SCALE_x4); + break; + default: + throw emu_fatalerror("%s: invalid high global register G%u\n", dst_code); + } +} + +void hyperstone_device::generate_load_operand(drcuml_block &block, compiler_state &compiler, reg_bank global, uint32_t code, uml::parameter dst, uml::parameter localidx) +{ + // expects frame pointer in I3 if local + // sets localidx if local before setting dst + if (global) + { + UML_LOAD(block, dst, (void *)m_core->global_regs, code, SIZE_DWORD, SCALE_x4); + } + else + { + UML_ADD(block, localidx, I3, code); + UML_AND(block, localidx, localidx, 0x3f); + UML_LOAD(block, dst, (void *)m_core->local_regs, localidx, SIZE_DWORD, SCALE_x4); + } +} - if (TYPE != IS_TRAP) - UML_ROLINS(block, DRC_SR, 2, 21, 0x01e00000); +void hyperstone_device::generate_load_src_addsub(drcuml_block &block, compiler_state &compiler, reg_bank global, uint32_t code, uml::parameter dst, uml::parameter localidx, uml::parameter sr) +{ + // expects frame pointer in I3 if local + // sets localidx if local before setting dst + if (global) + { + if (code == SR_REGISTER) + UML_AND(block, dst, sr, C_MASK); + else + UML_LOAD(block, dst, (void *)m_core->global_regs, code, SIZE_DWORD, SCALE_x4); + } else - UML_ROLINS(block, DRC_SR, 6, 21, 0x01e00000); - UML_ROLINS(block, DRC_SR, I3, 25, 0xfe000000); - - UML_AND(block, I1, I3, 0x3f); - UML_AND(block, I2, DRC_PC, ~1); - UML_ROLINS(block, I2, DRC_SR, 32-S_SHIFT, 1); - UML_STORE(block, (void *)m_core->local_regs, I1, I2, SIZE_DWORD, SCALE_x4); - UML_ADD(block, I2, I1, 1); - UML_AND(block, I3, I2, 0x3f); - UML_STORE(block, (void *)m_core->local_regs, I3, I4, SIZE_DWORD, SCALE_x4); + { + UML_ADD(block, localidx, I3, code); + UML_AND(block, localidx, localidx, 0x3f); + UML_LOAD(block, dst, (void *)m_core->local_regs, localidx, SIZE_DWORD, SCALE_x4); + } +} - UML_AND(block, DRC_SR, DRC_SR, ~(M_MASK | T_MASK)); - if (TYPE == IS_INT) - UML_OR(block, DRC_SR, DRC_SR, (L_MASK | S_MASK | I_MASK)); +void hyperstone_device::generate_set_dst(drcuml_block &block, compiler_state &compiler, const opcode_desc *desc, reg_bank global, uint32_t code, uml::parameter src, uml::parameter localidx, bool calcidx) +{ + // expects frame pointer in I3 if local and calcidx is true + // sets localidx if local and calcidx is true before storing src + // localidx is input if local and calcidx is false + if (global) + { + generate_set_global_register_low(block, compiler, code, src); + if (code == PC_REGISTER) + { + UML_AND(block, DRC_SR, DRC_SR, ~M_MASK); + generate_branch(block, desc->targetpc, desc); + } + } else - UML_OR(block, DRC_SR, DRC_SR, (L_MASK | S_MASK)); + { + if (calcidx) + { + UML_ADD(block, localidx, I3, code); + UML_AND(block, localidx, localidx, 0x3f); + } + UML_STORE(block, (void *)m_core->local_regs, localidx, src, SIZE_DWORD, SCALE_x4); + } +} + +void hyperstone_device::generate_update_flags_addsub(drcuml_block &block, compiler_state &compiler, uml::parameter sr) +{ + // expects result in I0 and UML flags set by ADD/SUB + // clobbers I1, I4 and I5 + + UML_SETc(block, uml::COND_V, I4); // I4 = ...V + UML_SETc(block, uml::COND_Z, I5); // I5 = ...Z + UML_SETc(block, uml::COND_C, I1); // I1 = ...C + UML_SHL(block, I4, I4, V_SHIFT); // I4 = V... + UML_OR(block, I1, I1, I4); // I1 = V..C + UML_SHL(block, I4, I5, Z_SHIFT); // I4 = ..Z. + UML_OR(block, I1, I1, I4); // I1 = V.ZC + UML_ROLAND(block, I4, I0, 3, N_MASK); // I4 = .N.. + UML_OR(block, I1, I1, I4); // I1 = VNZC + + UML_ROLINS(block, sr, I1, 0, (V_MASK | N_MASK | Z_MASK | C_MASK)); +} + +void hyperstone_device::generate_update_flags_addsubc(drcuml_block &block, compiler_state &compiler, uml::parameter sr) +{ + // expects result in I0 and UML flags set by ADD/SUB + // clobbers I1, I4 and I5 + + UML_SETc(block, uml::COND_V, I4); // I4 = ...V + UML_SETc(block, uml::COND_Z, I5); // I5 = ...Z + UML_SETc(block, uml::COND_C, I1); // I1 = ...C + UML_SHL(block, I4, I4, V_SHIFT); // I4 = V... + UML_OR(block, I1, I1, I4); // I1 = V..C + UML_SHL(block, I4, I5, Z_SHIFT); // I4 = ..Z. + UML_OR(block, I1, I1, I4); // I1 = V.ZC + UML_ROLAND(block, I4, I0, 3, N_MASK); // I4 = .N.. + UML_OR(block, I1, I1, I4); // I1 = VNZC + UML_OR(block, I4, I2, ~(Z_MASK)); // combine with old Z flag + UML_AND(block, I1, I1, I4); + + UML_ROLINS(block, sr, I1, 0, (V_MASK | N_MASK | Z_MASK | C_MASK)); +} - UML_MOV(block, DRC_PC, I0); +void hyperstone_device::generate_update_flags_addsubs(drcuml_block &block, compiler_state &compiler, uml::parameter sr) +{ + // expects UML flags set by ADD/SUB + // clobbers I1, I4 and I5 + + UML_SETc(block, uml::COND_V, I4); // I4 = ...V + UML_SETc(block, uml::COND_S, I1); // I1 = ...S + UML_SETc(block, uml::COND_Z, I5); // I5 = ...Z + UML_SHL(block, I4, I4, V_SHIFT); // I4 = V... + UML_SHL(block, I1, I1, N_SHIFT); // I1 = .N.. + UML_OR(block, I1, I1, I4); // I1 = VN.. + UML_SHL(block, I4, I5, Z_SHIFT); // I4 = ..Z. + UML_OR(block, I1, I1, I4); // I1 = VNZ. + + UML_ROLINS(block, sr, I1, 0, (V_MASK | N_MASK | Z_MASK)); +} + +template +void hyperstone_device::generate_trap_exception_or_int(drcuml_block &block, uml::code_label &label, uml::parameter trapno) +{ + // expects exception handler address in I0 and cycles in I7 (updated) + // clobbers I0, I1, I2, I3 and I4 + + UML_ADD(block, I7, I7, mem(&m_core->clock_cycles_2)); + + generate_get_trap_addr(block, label, trapno); // I0 = target PC + + UML_MOV(block, I4, DRC_SR); // I4 = old SR + + UML_MOV(block, I1, I4); // I1 = SR to be updated + UML_ROLAND(block, I3, I4, 7, 0x7f); // I3 = old FP + UML_ROLAND(block, I2, I4, 11, 0xf); // I2 = old FL + UML_MOVc(block, uml::COND_Z, I2, 16); // convert FL == 0 to 16 + UML_ADD(block, I3, I3, I2); // I3 = updated FP + + UML_SHL(block, I2, I3, 25); // I2 = updated FP:... + UML_OR(block, I2, I2, ((TYPE != IS_TRAP) ? 2 : 6) << 21); // I2 = updated FP:FL:... + UML_ROLINS(block, I1, I2, 0, 0xffe00000); // update FP and FL in I1 + UML_AND(block, I1, I1, ~(M_MASK | T_MASK)); // clear M and T, set S and L, set I for INT + UML_OR(block, I1, I1, (TYPE == IS_INT) ? (L_MASK | S_MASK | I_MASK) : (L_MASK | S_MASK)); + UML_MOV(block, DRC_SR, I1); // store updated SR + + UML_AND(block, I3, I3, 0x3f); // save old PC at updated (FP)^ + UML_AND(block, I2, DRC_PC, ~uint32_t(1)); + UML_ROLINS(block, I2, I4, 32 - S_SHIFT, 1); + UML_STORE(block, (void *)m_core->local_regs, I3, I2, SIZE_DWORD, SCALE_x4); + UML_ADD(block, I3, I3, 1); // save old SR at updated (FP + 1)^ + UML_AND(block, I3, I3, 0x3f); + UML_STORE(block, (void *)m_core->local_regs, I3, I4, SIZE_DWORD, SCALE_x4); + + UML_MOV(block, DRC_PC, I0); // branch to exception handler generate_branch(block, DRC_PC, nullptr, true); } void hyperstone_device::generate_int(drcuml_block &block, compiler_state &compiler, const opcode_desc *desc, uint32_t addr) { - printf("Unimplemented: generate_int (%08x)\n", desc->pc); + osd_printf_error("Unimplemented: generate_int (%08x)\n", desc->pc); fflush(stdout); fatalerror(" "); } void hyperstone_device::generate_exception(drcuml_block &block, compiler_state &compiler, const opcode_desc *desc, uint32_t addr) { - printf("Unimplemented: generate_exception (%08x)\n", desc->pc); + osd_printf_error("Unimplemented: generate_exception (%08x)\n", desc->pc); fflush(stdout); fatalerror(" "); } @@ -291,7 +490,7 @@ void hyperstone_device::generate_software(drcuml_block &block, compiler_state &c { UML_MOV(block, I7, mem(&m_core->clock_cycles_6)); - uint16_t op = desc->opptr.w[0]; + const uint16_t op = desc->opptr.w[0]; const uint32_t src_code = op & 0xf; const uint32_t srcf_code = src_code + 1; @@ -367,12 +566,82 @@ void hyperstone_device::generate_software(drcuml_block &block, compiler_state &c } + +void hyperstone_device::generate_trap_on_overflow(drcuml_block &block, compiler_state &compiler, const opcode_desc *desc) +{ + const int no_exception = compiler.m_labelnum++; + UML_TEST(block, DRC_SR, V_MASK); + UML_JMPc(block, uml::COND_Z, no_exception); + UML_ROLINS(block, DRC_SR, ((desc->length >> 1) << ILC_SHIFT), 0, ILC_MASK); + generate_trap_exception_or_int(block, compiler.m_labelnum, TRAPNO_RANGE_ERROR); + UML_LABEL(block, no_exception); +} + + +template +inline void hyperstone_device::generate_logic_op(drcuml_block &block, compiler_state &compiler, const opcode_desc *desc, T &&body) +{ + // body takes operands in I0 and I0 and should update I0 and set Z flag + // body must not clobber I2 or I3 + + UML_MOV(block, I7, mem(&m_core->clock_cycles_1)); + + const uint16_t op = desc->opptr.w[0]; + + generate_check_delay_pc(block, compiler, desc); + + const uint32_t dst_code = (op & 0xf0) >> 4; + const uint32_t src_code = op & 0xf; + + UML_MOV(block, I2, DRC_SR); + if (!SRC_GLOBAL || !DST_GLOBAL) + UML_ROLAND(block, I3, I2, 7, 0x7f); + + generate_load_operand(block, compiler, SRC_GLOBAL, src_code, uml::I1, uml::I1); + generate_load_operand(block, compiler, DST_GLOBAL, dst_code, uml::I0, uml::I3); + + body(); + + UML_SETc(block, uml::COND_Z, I1); + UML_ROLINS(block, I2, I1, Z_SHIFT, Z_MASK); + UML_MOV(block, DRC_SR, I2); + + generate_set_dst(block, compiler, desc, DST_GLOBAL, dst_code, uml::I0, uml::I3, false); +} + + +template +inline void hyperstone_device::generate_logic_op_imm(drcuml_block &block, compiler_state &compiler, const opcode_desc *desc, uint32_t dst_code, T &&body) +{ + // clobbers I0, I1 and I3 + // body should update I0 and set Z flag + // body must not clobber I2 or I3 + + generate_check_delay_pc(block, compiler, desc); + + UML_MOV(block, I2, DRC_SR); + if (!DST_GLOBAL) + UML_ROLAND(block, I3, I2, 7, 0x7f); + + generate_load_operand(block, compiler, DST_GLOBAL, dst_code, uml::I0, uml::I3); + + body(); + + UML_SETc(block, uml::COND_Z, I1); + UML_ROLINS(block, I2, I1, Z_SHIFT, Z_MASK); + UML_MOV(block, DRC_SR, I2); + + generate_set_dst(block, compiler, desc, DST_GLOBAL, dst_code, uml::I0, uml::I3, false); +} + + + template void hyperstone_device::generate_chk(drcuml_block &block, compiler_state &compiler, const opcode_desc *desc) { UML_MOV(block, I7, mem(&m_core->clock_cycles_1)); - uint16_t op = desc->opptr.w[0]; + const uint16_t op = desc->opptr.w[0]; generate_check_delay_pc(block, compiler, desc); @@ -427,7 +696,7 @@ void hyperstone_device::generate_movd(drcuml_block &block, compiler_state &compi { UML_MOV(block, I7, mem(&m_core->clock_cycles_2)); - uint16_t op = desc->opptr.w[0]; + const uint16_t op = desc->opptr.w[0]; generate_check_delay_pc(block, compiler, desc); @@ -440,7 +709,7 @@ void hyperstone_device::generate_movd(drcuml_block &block, compiler_state &compi { if (SRC_GLOBAL && src_code < 2) { - printf("Denoted PC or SR in RET instruction. PC = %08X\n", desc->pc); + osd_printf_error("Denoted PC or SR in RET instruction. PC = %08X\n", desc->pc); return; } @@ -525,9 +794,7 @@ void hyperstone_device::generate_movd(drcuml_block &block, compiler_state &compi UML_AND(block, DRC_SR, DRC_SR, ~N_MASK); if (DST_GLOBAL) { - UML_MOV(block, I4, dst_code); - UML_MOV(block, I5, 0); - generate_set_global_register(block, compiler, desc); + generate_set_global_register_low(block, compiler, dst_code, 0); UML_MOV(block, I4, dstf_code); UML_MOV(block, I5, 0); generate_set_global_register(block, compiler, desc); @@ -580,9 +847,7 @@ void hyperstone_device::generate_movd(drcuml_block &block, compiler_state &compi if (DST_GLOBAL) { - UML_MOV(block, I4, dst_code); - UML_MOV(block, I5, I0); - generate_set_global_register(block, compiler, desc); + generate_set_global_register_low(block, compiler, dst_code, uml::I0); UML_MOV(block, I4, dstf_code); UML_MOV(block, I5, I1); generate_set_global_register(block, compiler, desc); @@ -607,7 +872,7 @@ void hyperstone_device::generate_divsu(drcuml_block &block, compiler_state &comp { UML_MOV(block, I7, mem(&m_core->clock_cycles_36)); - uint16_t op = desc->opptr.w[0]; + const uint16_t op = desc->opptr.w[0]; const uint32_t dst_code = (op & 0xf0) >> 4; const uint32_t dstf_code = dst_code + 1; @@ -615,7 +880,7 @@ void hyperstone_device::generate_divsu(drcuml_block &block, compiler_state &comp if ((SRC_GLOBAL == DST_GLOBAL && (src_code == dst_code || src_code == dstf_code)) || (SRC_GLOBAL && src_code < 2)) { - printf("Denoted the same register code or PC/SR as source in generate_divsu. PC = %08X\n", desc->pc); + osd_printf_error("Denoted the same register code or PC/SR as source in generate_divsu. PC = %08X\n", desc->pc); return; } @@ -666,9 +931,9 @@ void hyperstone_device::generate_divsu(drcuml_block &block, compiler_state &comp UML_DDIVU(block, I2, I4, I1, I0); UML_AND(block, I3, DRC_SR, ~(V_MASK | Z_MASK | N_MASK)); - UML_TEST(block, I2, ~0); - UML_MOVc(block, uml::COND_Z, I0, Z_MASK); - UML_MOVc(block, uml::COND_NZ, I0, 0); + UML_TEST(block, I2, ~uint32_t(0)); + UML_SETc(block, uml::COND_Z, I0); + UML_SHL(block, I0, I0, Z_SHIFT); UML_ROLINS(block, I0, I2, 3, N_MASK); UML_OR(block, DRC_SR, I3, I0); @@ -698,7 +963,7 @@ void hyperstone_device::generate_xm(drcuml_block &block, compiler_state &compile { UML_MOV(block, I7, mem(&m_core->clock_cycles_1)); - uint16_t op = desc->opptr.w[0]; + const uint16_t op = desc->opptr.w[0]; const uint32_t dst_code = (op & 0xf0) >> 4; const uint32_t src_code = op & 0xf; @@ -787,57 +1052,26 @@ void hyperstone_device::generate_mask(drcuml_block &block, compiler_state &compi { UML_MOV(block, I7, mem(&m_core->clock_cycles_1)); - uint16_t op = desc->opptr.w[0]; + const uint16_t op = desc->opptr.w[0]; const uint32_t src_code = op & 0xf; const uint32_t dst_code = (op & 0xf0) >> 4; - generate_decode_const(block, compiler, desc); + const uint32_t src = generate_get_const(block, compiler, desc); + generate_check_delay_pc(block, compiler, desc); + UML_MOV(block, I2, DRC_SR); if (!SRC_GLOBAL || !DST_GLOBAL) - UML_ROLAND(block, I3, DRC_SR, 7, 0x7f); - - if (SRC_GLOBAL) - { - UML_LOAD(block, I2, (void *)m_core->global_regs, src_code, SIZE_DWORD, SCALE_x4); - } - else - { - UML_ADD(block, I2, I3, src_code); - UML_AND(block, I2, I2, 0x3f); - UML_LOAD(block, I2, (void *)m_core->local_regs, I2, SIZE_DWORD, SCALE_x4); - } + UML_ROLAND(block, I3, I2, 7, 0x7f); - UML_AND(block, I1, I1, I2); + generate_load_operand(block, compiler, SRC_GLOBAL, src_code, uml::I0, uml::I0); - int skip_mask; - UML_AND(block, DRC_SR, DRC_SR, ~Z_MASK); - UML_TEST(block, I1, ~0); - UML_JMPc(block, uml::COND_NZ, skip_mask = compiler.m_labelnum++); - UML_OR(block, DRC_SR, DRC_SR, Z_MASK); - UML_LABEL(block, skip_mask); + UML_AND(block, I0, I0, src); + UML_SETc(block, uml::COND_Z, I1); + UML_ROLINS(block, I2, I1, Z_SHIFT, Z_MASK); + UML_MOV(block, DRC_SR, I2); - if (DST_GLOBAL) - { - if (dst_code < 2) - { - UML_MOV(block, I4, dst_code); - UML_MOV(block, I5, I1); - generate_set_global_register(block, compiler, desc); - if (dst_code == PC_REGISTER) - generate_branch(block, desc->targetpc, desc); - } - else - { - UML_STORE(block, (void *)m_core->global_regs, dst_code, I1, SIZE_DWORD, SCALE_x4); - } - } - else - { - UML_ADD(block, I0, I3, dst_code); - UML_AND(block, I0, I0, 0x3f); - UML_STORE(block, (void *)m_core->local_regs, I0, I1, SIZE_DWORD, SCALE_x4); - } + generate_set_dst(block, compiler, desc, DST_GLOBAL, dst_code, uml::I0, uml::I3, true); } @@ -846,79 +1080,33 @@ void hyperstone_device::generate_sum(drcuml_block &block, compiler_state &compil { UML_MOV(block, I7, mem(&m_core->clock_cycles_1)); - uint16_t op = desc->opptr.w[0]; + const uint16_t op = desc->opptr.w[0]; const uint32_t src_code = op & 0xf; const uint32_t dst_code = (op & 0xf0) >> 4; - generate_decode_const(block, compiler, desc); + const uint32_t src = generate_get_const(block, compiler, desc); + generate_check_delay_pc(block, compiler, desc); + UML_MOV(block, I2, DRC_SR); if (!SRC_GLOBAL || !DST_GLOBAL) - { - UML_ROLAND(block, I3, DRC_SR, 7, 0x7f); - } - - if (SRC_GLOBAL) - { - UML_LOAD(block, I2, (void *)m_core->global_regs, src_code, SIZE_DWORD, SCALE_x4); - } - else - { - UML_ADD(block, I2, I3, src_code); - UML_AND(block, I2, I2, 0x3f); - UML_LOAD(block, I2, (void *)m_core->local_regs, I2, SIZE_DWORD, SCALE_x4); - } + UML_ROLAND(block, I3, I2, 7, 0x7f); -#ifndef PTR64 - UML_DAND(block, I1, I1, 0x00000000ffffffffULL); -#endif - - UML_DADD(block, I5, I1, I2); - - UML_AND(block, DRC_SR, DRC_SR, ~(C_MASK | V_MASK | Z_MASK | N_MASK)); - UML_DTEST(block, I5, 0x100000000ULL); - UML_SETc(block, uml::COND_NZ, I6); - UML_ROLINS(block, DRC_SR, I6, C_SHIFT, C_MASK); - - UML_XOR(block, I6, I5, I1); - UML_XOR(block, I1, I5, I2); - UML_AND(block, I1, I1, I6); - UML_AND(block, I1, I1, 0x80000000); - UML_ROLINS(block, DRC_SR, I1, 4, V_MASK); + generate_load_operand(block, compiler, SRC_GLOBAL, src_code, uml::I0, uml::I0); - UML_TEST(block, I5, ~0); - UML_SETc(block, uml::COND_Z, I6); - UML_ROLINS(block, DRC_SR, I6, Z_SHIFT, Z_MASK); + UML_ADD(block, I0, I0, src); - UML_ROLINS(block, DRC_SR, I5, 3, N_MASK); + generate_update_flags_addsub(block, compiler, uml::I2); + UML_MOV(block, DRC_SR, I2); - if (DST_GLOBAL) - { - if (dst_code < 2) - { - UML_MOV(block, I4, dst_code); - generate_set_global_register(block, compiler, desc); - if (dst_code == PC_REGISTER) - generate_branch(block, desc->targetpc, desc); - } - else - { - UML_STORE(block, (void *)m_core->global_regs, dst_code, I5, SIZE_DWORD, SCALE_x4); - } - } - else - { - UML_ADD(block, I0, I3, dst_code); - UML_AND(block, I0, I0, 0x3f); - UML_STORE(block, (void *)m_core->local_regs, I0, I5, SIZE_DWORD, SCALE_x4); - } + generate_set_dst(block, compiler, desc, DST_GLOBAL, dst_code, uml::I0, uml::I3, true); } template void hyperstone_device::generate_sums(drcuml_block &block, compiler_state &compiler, const opcode_desc *desc) { - printf("Unimplemented: generate_sums (%08x)\n", desc->pc); + osd_printf_error("Unimplemented: generate_sums (%08x)\n", desc->pc); fflush(stdout); fatalerror(" "); } @@ -929,69 +1117,28 @@ void hyperstone_device::generate_cmp(drcuml_block &block, compiler_state &compil { UML_MOV(block, I7, mem(&m_core->clock_cycles_1)); - uint16_t op = desc->opptr.w[0]; + const uint16_t op = desc->opptr.w[0]; const uint32_t src_code = op & 0xf; const uint32_t dst_code = (op & 0xf0) >> 4; generate_check_delay_pc(block, compiler, desc); + UML_MOV(block, I2, DRC_SR); if (!SRC_GLOBAL || !DST_GLOBAL) - UML_ROLAND(block, I2, DRC_SR, 7, 0x7f); - - if (SRC_GLOBAL) - { - if (src_code == SR_REGISTER) - UML_AND(block, I0, DRC_SR, C_MASK); - else - UML_LOAD(block, I0, (void *)m_core->global_regs, src_code, SIZE_DWORD, SCALE_x4); - } - else - { - UML_ADD(block, I1, I2, src_code); - UML_AND(block, I1, I1, 0x3f); - UML_LOAD(block, I0, (void *)m_core->local_regs, I1, SIZE_DWORD, SCALE_x4); - } - - if (DST_GLOBAL) - { - UML_LOAD(block, I1, (void *)m_core->global_regs, dst_code, SIZE_DWORD, SCALE_x4); - } - else - { - UML_ADD(block, I2, I2, dst_code); - UML_AND(block, I2, I2, 0x3f); - UML_LOAD(block, I1, (void *)m_core->local_regs, I2, SIZE_DWORD, SCALE_x4); - } - -#ifndef PTR64 - UML_DAND(block, I0, I0, 0x00000000ffffffffULL); -#endif - - UML_DSUB(block, I2, I1, I0); // tmp + UML_ROLAND(block, I3, I2, 7, 0x7f); - UML_XOR(block, I2, I2, I1); - UML_XOR(block, I3, I1, I0); - UML_AND(block, I3, I3, I2); - UML_ROLINS(block, I3, I3, 4, V_MASK); + generate_load_src_addsub(block, compiler, SRC_GLOBAL, src_code, uml::I1, uml::I1, uml::I2); + generate_load_operand(block, compiler, DST_GLOBAL, dst_code, uml::I0, uml::I3); - UML_CMP(block, I1, I0); - UML_SETc(block, uml::COND_B, I2); - UML_ROLINS(block, I3, I2, C_SHIFT, C_MASK); + UML_SUB(block, I0, I0, I1); - UML_CMP(block, I1, I0); - UML_SETc(block, uml::COND_E, I2); - UML_ROLINS(block, I3, I2, Z_SHIFT, Z_MASK); - - UML_CMP(block, I1, I0); - UML_SETc(block, uml::COND_L, I2); - UML_ROLINS(block, I3, I2, N_SHIFT, N_MASK); - - UML_ROLINS(block, DRC_SR, I3, 0, (V_MASK | N_MASK | Z_MASK | C_MASK)); + generate_update_flags_addsub(block, compiler, uml::I2); + UML_MOV(block, DRC_SR, I2); } void hyperstone_device::generate_get_global_register(drcuml_block &block, compiler_state &compiler, const opcode_desc *desc) { - uint16_t op = desc->opptr.w[0]; + const uint16_t op = desc->opptr.w[0]; const uint32_t src_code = op & 0xf; int regular_load = compiler.m_labelnum++; @@ -1026,20 +1173,22 @@ void hyperstone_device::generate_mov(drcuml_block &block, compiler_state &compil { UML_MOV(block, I7, mem(&m_core->clock_cycles_1)); - uint16_t op = desc->opptr.w[0]; + const uint16_t op = desc->opptr.w[0]; const uint32_t src_code = op & 0xf; const uint32_t dst_code = (op & 0xf0) >> 4; generate_check_delay_pc(block, compiler, desc); + int done; if (DST_GLOBAL) { - int no_exception; + const int no_exception = compiler.m_labelnum++; UML_TEST(block, DRC_SR, H_MASK); - UML_JMPc(block, uml::COND_Z, no_exception = compiler.m_labelnum++); + UML_JMPc(block, uml::COND_Z, no_exception); UML_TEST(block, DRC_SR, S_MASK); UML_JMPc(block, uml::COND_NZ, no_exception); UML_EXH(block, *m_exception[EXCEPTION_PRIVILEGE_ERROR], 0); + UML_JMP(block, done = compiler.m_labelnum++); UML_LABEL(block, no_exception); } @@ -1063,18 +1212,25 @@ void hyperstone_device::generate_mov(drcuml_block &block, compiler_state &compil UML_ROLINS(block, DRC_SR, I2, Z_SHIFT, Z_MASK); UML_ROLINS(block, DRC_SR, I5, 3, N_MASK); - int done = compiler.m_labelnum++; if (DST_GLOBAL) { + const int highglobal = compiler.m_labelnum++; + UML_TEST(block, DRC_SR, H_MASK); - UML_MOVc(block, uml::COND_NZ, I4, 16 + dst_code); - UML_MOVc(block, uml::COND_Z, I4, dst_code); + UML_JMPc(block, uml::COND_NZ, highglobal); + generate_set_global_register_low(block, compiler, dst_code, uml::I5); + if (dst_code == PC_REGISTER) + { + UML_AND(block, DRC_SR, DRC_SR, ~M_MASK); + generate_branch(block, desc->targetpc, desc); + } + UML_JMP(block, done); + + UML_LABEL(block, highglobal); UML_AND(block, DRC_SR, DRC_SR, ~H_MASK); - UML_MOV(block, I3, I4); - generate_set_global_register(block, compiler, desc); - UML_CMP(block, I3, 0); - UML_JMPc(block, uml::COND_NE, done); - generate_branch(block, desc->targetpc, desc); + generate_set_global_register_high(block, compiler, dst_code, uml::I5); + + UML_LABEL(block, done); } else { @@ -1083,8 +1239,6 @@ void hyperstone_device::generate_mov(drcuml_block &block, compiler_state &compil UML_AND(block, I2, I2, 0x3f); UML_STORE(block, (void *)m_core->local_regs, I2, I5, SIZE_DWORD, SCALE_x4); } - - UML_LABEL(block, done); } @@ -1093,138 +1247,62 @@ void hyperstone_device::generate_add(drcuml_block &block, compiler_state &compil { UML_MOV(block, I7, mem(&m_core->clock_cycles_1)); - uint16_t op = desc->opptr.w[0]; + const uint16_t op = desc->opptr.w[0]; const uint32_t src_code = op & 0xf; const uint32_t dst_code = (op & 0xf0) >> 4; generate_check_delay_pc(block, compiler, desc); + UML_MOV(block, I2, DRC_SR); if (!SRC_GLOBAL || !DST_GLOBAL) - UML_ROLAND(block, I3, DRC_SR, 7, 0x7f); + UML_ROLAND(block, I3, I2, 7, 0x7f); - if (SRC_GLOBAL) - { - if (src_code == SR_REGISTER) - UML_AND(block, I0, DRC_SR, C_MASK); - else - UML_LOAD(block, I0, (void *)m_core->global_regs, src_code, SIZE_DWORD, SCALE_x4); - } - else - { - UML_ADD(block, I2, I3, src_code); - UML_AND(block, I2, I2, 0x3f); - UML_LOAD(block, I0, (void *)m_core->local_regs, I2, SIZE_DWORD, SCALE_x4); - } + generate_load_src_addsub(block, compiler, SRC_GLOBAL, src_code, uml::I1, uml::I1, uml::I2); + generate_load_operand(block, compiler, DST_GLOBAL, dst_code, uml::I0, uml::I3); - if (DST_GLOBAL) - { - UML_LOAD(block, I1, (void *)m_core->global_regs, dst_code, SIZE_DWORD, SCALE_x4); - } - else - { - UML_ADD(block, I3, I3, dst_code); - UML_AND(block, I3, I3, 0x3f); - UML_LOAD(block, I1, (void *)m_core->local_regs, I3, SIZE_DWORD, SCALE_x4); - } - - UML_ADD(block, I2, I0, I1); - - UML_SETc(block, uml::COND_C, I6); - - UML_XOR(block, I4, I0, I2); - UML_XOR(block, I5, I1, I2); - UML_AND(block, I4, I4, I5); - UML_ROLINS(block, I6, I4, 4, V_MASK); + UML_ADD(block, I0, I0, I1); - UML_TEST(block, I2, ~0); - UML_SETc(block, uml::COND_Z, I4); - UML_ROLINS(block, I6, I4, Z_SHIFT, Z_MASK); - UML_ROLINS(block, I6, I2, 3, N_MASK); - UML_ROLINS(block, DRC_SR, I6, 0, (V_MASK | N_MASK | Z_MASK | C_MASK)); + generate_update_flags_addsub(block, compiler, uml::I2); + UML_MOV(block, DRC_SR, I2); - if (DST_GLOBAL) - { - if (dst_code < 2) - { - UML_MOV(block, I4, dst_code); - UML_MOV(block, I5, I2); - generate_set_global_register(block, compiler, desc); - - if (dst_code == PC_REGISTER) - { - UML_AND(block, DRC_SR, DRC_SR, ~M_MASK); - generate_branch(block, desc->targetpc, desc); - } - } - else - { - UML_STORE(block, (void *)m_core->global_regs, dst_code, I2, SIZE_DWORD, SCALE_x4); - } - } - else - { - UML_STORE(block, (void *)m_core->local_regs, I3, I2, SIZE_DWORD, SCALE_x4); - } + generate_set_dst(block, compiler, desc, DST_GLOBAL, dst_code, uml::I0, uml::I3, false); } template void hyperstone_device::generate_adds(drcuml_block &block, compiler_state &compiler, const opcode_desc *desc) -{ - printf("Unimplemented: generate_adds (%08x)\n", desc->pc); - fflush(stdout); - fatalerror(" "); -} - - -template -void hyperstone_device::generate_cmpb(drcuml_block &block, compiler_state &compiler, const opcode_desc *desc) { UML_MOV(block, I7, mem(&m_core->clock_cycles_1)); - uint16_t op = desc->opptr.w[0]; + const uint16_t op = desc->opptr.w[0]; const uint32_t src_code = op & 0xf; const uint32_t dst_code = (op & 0xf0) >> 4; generate_check_delay_pc(block, compiler, desc); + UML_MOV(block, I2, DRC_SR); if (!SRC_GLOBAL || !DST_GLOBAL) - UML_ROLAND(block, I2, DRC_SR, 7, 0x7f); + UML_ROLAND(block, I3, I2, 7, 0x7f); - if (SRC_GLOBAL) - { - UML_LOAD(block, I0, (void *)m_core->global_regs, src_code, SIZE_DWORD, SCALE_x4); - } - else - { - UML_ADD(block, I1, I2, src_code); - UML_AND(block, I1, I1, 0x3f); - UML_LOAD(block, I0, (void *)m_core->local_regs, I1, SIZE_DWORD, SCALE_x4); - } + generate_load_src_addsub(block, compiler, SRC_GLOBAL, src_code, uml::I1, uml::I1, uml::I2); + generate_load_operand(block, compiler, DST_GLOBAL, dst_code, uml::I0, uml::I3); - if (DST_GLOBAL) - { - UML_LOAD(block, I1, (void *)m_core->global_regs, dst_code, SIZE_DWORD, SCALE_x4); - } - else - { - UML_ADD(block, I2, I2, dst_code); - UML_AND(block, I2, I2, 0x3f); - UML_LOAD(block, I1, (void *)m_core->local_regs, I2, SIZE_DWORD, SCALE_x4); - } + UML_ADD(block, I0, I0, I1); - UML_TEST(block, I1, I0); - UML_SETc(block, uml::COND_Z, I0); - UML_ROLINS(block, DRC_SR, I0, Z_SHIFT, Z_MASK); + generate_update_flags_addsubs(block, compiler, uml::I2); + UML_MOV(block, DRC_SR, I2); + + generate_set_dst(block, compiler, desc, DST_GLOBAL, dst_code, uml::I0, uml::I3, false); + generate_trap_on_overflow(block, compiler, desc); } template -void hyperstone_device::generate_subc(drcuml_block &block, compiler_state &compiler, const opcode_desc *desc) +void hyperstone_device::generate_cmpb(drcuml_block &block, compiler_state &compiler, const opcode_desc *desc) { UML_MOV(block, I7, mem(&m_core->clock_cycles_1)); - uint16_t op = desc->opptr.w[0]; + const uint16_t op = desc->opptr.w[0]; const uint32_t src_code = op & 0xf; const uint32_t dst_code = (op & 0xf0) >> 4; @@ -1233,674 +1311,238 @@ void hyperstone_device::generate_subc(drcuml_block &block, compiler_state &compi if (!SRC_GLOBAL || !DST_GLOBAL) UML_ROLAND(block, I3, DRC_SR, 7, 0x7f); - UML_AND(block, I0, DRC_SR, C_MASK); -#ifndef PTR64 - UML_DAND(block, I0, I0, 0x00000000ffffffffULL); -#endif - - if (SRC_GLOBAL) - { - if (src_code != SR_REGISTER) - { - UML_LOAD(block, I2, (void *)m_core->global_regs, src_code, SIZE_DWORD, SCALE_x4); - UML_DADD(block, I0, I2, I0); - } - } - else - { - UML_ADD(block, I2, I3, src_code); - UML_AND(block, I2, I2, 0x3f); - UML_LOAD(block, I2, (void *)m_core->local_regs, I2, SIZE_DWORD, SCALE_x4); - UML_DADD(block, I0, I2, I0); - } + generate_load_operand(block, compiler, SRC_GLOBAL, src_code, uml::I1, uml::I1); + generate_load_operand(block, compiler, DST_GLOBAL, dst_code, uml::I0, uml::I3); - if (DST_GLOBAL) - { - UML_LOAD(block, I1, (void *)m_core->global_regs, dst_code, SIZE_DWORD, SCALE_x4); - } - else - { - UML_ADD(block, I2, I3, dst_code); - UML_AND(block, I4, I2, 0x3f); - UML_LOAD(block, I1, (void *)m_core->local_regs, I4, SIZE_DWORD, SCALE_x4); - } - - UML_AND(block, I6, DRC_SR, Z_MASK); - UML_AND(block, I5, DRC_SR, ~(C_MASK | V_MASK | Z_MASK | N_MASK)); - - UML_DSUB(block, I2, I1, I0); - UML_DROLINS(block, I5, I2, 32, C_MASK); - UML_XOR(block, I2, I2, I1); // tmp ^ dreg - UML_XOR(block, I3, I1, I0); // dreg ^ sreg_c - UML_AND(block, I3, I2, I3); // (tmp ^ dreg) ^ (dreg ^ sreg_c) - UML_ROLINS(block, I5, I3, 4, V_MASK); - - UML_SUB(block, I1, I1, I0); - UML_TEST(block, I1, ~0); - UML_MOVc(block, uml::COND_Z, I2, Z_MASK); - UML_MOVc(block, uml::COND_NZ, I2, 0); - UML_AND(block, I2, I2, I6); // old_z && dreg == 0 - UML_OR(block, I5, I5, I2); - UML_ROLINS(block, I5, I1, 3, N_MASK); - UML_ROLINS(block, DRC_SR, I5, 0, (C_MASK | V_MASK | Z_MASK | N_MASK)); - - if (DST_GLOBAL) - { - if (dst_code < 2) - { - UML_MOV(block, I4, dst_code); - UML_MOV(block, I5, I1); - generate_set_global_register(block, compiler, desc); - - if (dst_code == PC_REGISTER) - generate_branch(block, desc->targetpc, desc); - } - else - { - UML_STORE(block, (void *)m_core->global_regs, dst_code, I1, SIZE_DWORD, SCALE_x4); - } - } - else - { - UML_STORE(block, (void *)m_core->local_regs, I4, I1, SIZE_DWORD, SCALE_x4); - } + UML_TEST(block, I0, I1); + UML_SETc(block, uml::COND_Z, I0); + UML_ROLINS(block, DRC_SR, I0, Z_SHIFT, Z_MASK); } template -void hyperstone_device::generate_sub(drcuml_block &block, compiler_state &compiler, const opcode_desc *desc) +void hyperstone_device::generate_subc(drcuml_block &block, compiler_state &compiler, const opcode_desc *desc) { UML_MOV(block, I7, mem(&m_core->clock_cycles_1)); - uint16_t op = desc->opptr.w[0]; + const uint16_t op = desc->opptr.w[0]; const uint32_t src_code = op & 0xf; const uint32_t dst_code = (op & 0xf0) >> 4; generate_check_delay_pc(block, compiler, desc); + UML_MOV(block, I2, DRC_SR); if (!SRC_GLOBAL || !DST_GLOBAL) - UML_ROLAND(block, I3, DRC_SR, 7, 0x7f); + UML_ROLAND(block, I3, I2, 7, 0x7f); - if (SRC_GLOBAL) - { - if (src_code == SR_REGISTER) - UML_AND(block, I0, DRC_SR, C_MASK); - else - UML_LOAD(block, I0, (void *)m_core->global_regs, src_code, SIZE_DWORD, SCALE_x4); - } - else - { - UML_ADD(block, I2, I3, src_code); - UML_AND(block, I4, I2, 0x3f); - UML_LOAD(block, I0, (void *)m_core->local_regs, I4, SIZE_DWORD, SCALE_x4); - } + generate_load_src_addsub(block, compiler, SRC_GLOBAL,src_code, uml::I1, uml::I1, uml::I2); + generate_load_operand(block, compiler, DST_GLOBAL, dst_code, uml::I0, uml::I3); - if (DST_GLOBAL) + if (!SRC_GLOBAL || (src_code != SR_REGISTER)) { - UML_LOAD(block, I1, (void *)m_core->global_regs, dst_code, SIZE_DWORD, SCALE_x4); + UML_SHR(block, I4, I2, 1); // set up carry in, result unused + UML_SUBB(block, I0, I0, I1); } else { - UML_ADD(block, I2, I3, dst_code); - UML_AND(block, I4, I2, 0x3f); - UML_LOAD(block, I1, (void *)m_core->local_regs, I4, SIZE_DWORD, SCALE_x4); + UML_SUB(block, I0, I0, I1); } -#ifndef PTR64 - UML_DAND(block, I0, I0, 0x00000000ffffffffULL); -#endif - - UML_DSUB(block, I2, I1, I0); - - UML_AND(block, DRC_SR, DRC_SR, ~(C_MASK | V_MASK | Z_MASK | N_MASK)); - - UML_DTEST(block, I2, 0x100000000ULL); - UML_SETc(block, uml::COND_NZ, I4); - UML_ROLINS(block, DRC_SR, I4, 0, C_MASK); - - UML_XOR(block, I4, I1, I2); - UML_XOR(block, I5, I0, I1); - UML_AND(block, I6, I4, I5); - UML_ROLINS(block, DRC_SR, I6, 4, V_MASK); - - UML_SUB(block, I2, I1, I0); - - UML_TEST(block, I2, ~0); - UML_SETc(block, uml::COND_Z, I4); - UML_ROLINS(block, DRC_SR, I4, Z_SHIFT, Z_MASK); - UML_ROLINS(block, DRC_SR, I2, 3, N_MASK); + generate_update_flags_addsubc(block, compiler, uml::I2); + UML_MOV(block, DRC_SR, I2); - if (DST_GLOBAL) - { - if (dst_code < 2) - { - UML_MOV(block, I4, dst_code); - UML_MOV(block, I5, I2); - generate_set_global_register(block, compiler, desc); - - if (dst_code == PC_REGISTER) - { - UML_AND(block, DRC_SR, DRC_SR, ~M_MASK); - generate_branch(block, desc->targetpc, desc); - } - } - else - { - UML_STORE(block, (void *)m_core->global_regs, dst_code, I2, SIZE_DWORD, SCALE_x4); - } - } - else - { - UML_ADD(block, I4, I3, dst_code); - UML_AND(block, I5, I4, 0x3f); - UML_STORE(block, (void *)m_core->local_regs, I5, I2, SIZE_DWORD, SCALE_x4); - } + generate_set_dst(block, compiler, desc, DST_GLOBAL, dst_code, uml::I0, uml::I3, false); } template -void hyperstone_device::generate_subs(drcuml_block &block, compiler_state &compiler, const opcode_desc *desc) +void hyperstone_device::generate_sub(drcuml_block &block, compiler_state &compiler, const opcode_desc *desc) { UML_MOV(block, I7, mem(&m_core->clock_cycles_1)); - uint16_t op = desc->opptr.w[0]; + const uint16_t op = desc->opptr.w[0]; const uint32_t src_code = op & 0xf; const uint32_t dst_code = (op & 0xf0) >> 4; generate_check_delay_pc(block, compiler, desc); + UML_MOV(block, I2, DRC_SR); if (!SRC_GLOBAL || !DST_GLOBAL) - UML_ROLAND(block, I3, DRC_SR, 7, 0x7f); - - if (SRC_GLOBAL) - { - if (src_code == SR_REGISTER) - UML_AND(block, I0, DRC_SR, C_MASK); - else - UML_LOAD(block, I0, (void *)m_core->global_regs, src_code, SIZE_DWORD, SCALE_x4); - } - else - { - UML_ADD(block, I2, I3, src_code); - UML_AND(block, I2, I2, 0x3f); - UML_LOAD(block, I0, (void *)m_core->local_regs, I2, SIZE_DWORD, SCALE_x4); - } + UML_ROLAND(block, I3, I2, 7, 0x7f); - if (DST_GLOBAL) - { - UML_LOAD(block, I1, (void *)m_core->global_regs, dst_code, SIZE_DWORD, SCALE_x4); - } - else - { - UML_ADD(block, I2, I3, dst_code); - UML_AND(block, I2, I2, 0x3f); - UML_LOAD(block, I1, (void *)m_core->local_regs, I2, SIZE_DWORD, SCALE_x4); - } + generate_load_src_addsub(block, compiler, SRC_GLOBAL, src_code, uml::I1, uml::I1, uml::I2); + generate_load_operand(block, compiler, DST_GLOBAL, dst_code, uml::I0, uml::I3); - UML_DSEXT(block, I0, I0, SIZE_DWORD); - UML_DSEXT(block, I1, I1, SIZE_DWORD); - UML_DSUB(block, I2, I1, I0); + UML_SUB(block, I0, I0, I1); - UML_AND(block, DRC_SR, DRC_SR, ~(V_MASK | Z_MASK | N_MASK)); + generate_update_flags_addsub(block, compiler, uml::I2); + UML_MOV(block, DRC_SR, I2); - UML_XOR(block, I4, I1, I2); - UML_XOR(block, I5, I0, I1); - UML_AND(block, I4, I4, I5); - UML_ROLINS(block, DRC_SR, I4, 4, V_MASK); - - UML_TEST(block, I2, ~0); - UML_SETc(block, uml::COND_Z, I4); - UML_ROLINS(block, DRC_SR, I4, Z_SHIFT, Z_MASK); - UML_ROLINS(block, DRC_SR, I2, 3, N_MASK); - - if (DST_GLOBAL) - { - if (dst_code < 2) - { - UML_MOV(block, I4, dst_code); - UML_MOV(block, I5, I2); - generate_set_global_register(block, compiler, desc); - - if (dst_code == PC_REGISTER) - { - generate_branch(block, desc->targetpc, desc); - } - } - else - { - UML_STORE(block, (void *)m_core->global_regs, dst_code, I2, SIZE_DWORD, SCALE_x4); - } - } - else - { - UML_ADD(block, I4, I3, dst_code); - UML_AND(block, I5, I4, 0x3f); - UML_STORE(block, (void *)m_core->local_regs, I5, I2, SIZE_DWORD, SCALE_x4); - } - - int no_exception = compiler.m_labelnum++; - UML_TEST(block, DRC_SR, V_MASK); - UML_JMPc(block, uml::COND_Z, no_exception); - UML_ROLINS(block, DRC_SR, ((desc->length >> 1) << ILC_SHIFT), 0, ILC_MASK); - generate_trap_exception_or_int(block); - UML_LABEL(block, no_exception); + generate_set_dst(block, compiler, desc, DST_GLOBAL, dst_code, uml::I0, uml::I3, false); } template -void hyperstone_device::generate_addc(drcuml_block &block, compiler_state &compiler, const opcode_desc *desc) +void hyperstone_device::generate_subs(drcuml_block &block, compiler_state &compiler, const opcode_desc *desc) { UML_MOV(block, I7, mem(&m_core->clock_cycles_1)); - uint16_t op = desc->opptr.w[0]; + const uint16_t op = desc->opptr.w[0]; const uint32_t src_code = op & 0xf; const uint32_t dst_code = (op & 0xf0) >> 4; generate_check_delay_pc(block, compiler, desc); + UML_MOV(block, I2, DRC_SR); if (!SRC_GLOBAL || !DST_GLOBAL) - UML_ROLAND(block, I3, DRC_SR, 7, 0x7f); - - if (SRC_GLOBAL) - { - if (src_code == SR_REGISTER) - { - UML_AND(block, I0, DRC_SR, C_MASK); - } - else - { - UML_LOAD(block, I0, (void *)m_core->global_regs, src_code, SIZE_DWORD, SCALE_x4); - UML_AND(block, I1, DRC_SR, C_MASK); -#ifndef PTR64 - UML_DAND(block, I1, I1, 0x00000000ffffffffULL); -#endif - UML_DADD(block, I0, I0, I1); - } - } - else - { - UML_ADD(block, I1, I3, src_code); - UML_AND(block, I1, I1, 0x3f); - UML_LOAD(block, I0, (void *)m_core->local_regs, I1, SIZE_DWORD, SCALE_x4); - UML_AND(block, I1, DRC_SR, C_MASK); -#ifndef PTR64 - UML_DAND(block, I1, I1, 0x00000000ffffffffULL); -#endif - UML_DADD(block, I0, I0, I1); - } + UML_ROLAND(block, I3, I2, 7, 0x7f); - if (DST_GLOBAL) - { - UML_LOAD(block, I1, (void *)m_core->global_regs, dst_code, SIZE_DWORD, SCALE_x4); - } - else - { - UML_ADD(block, I3, I3, dst_code); - UML_AND(block, I3, I3, 0x3f); - UML_LOAD(block, I1, (void *)m_core->local_regs, I3, SIZE_DWORD, SCALE_x4); - } + generate_load_src_addsub(block, compiler, SRC_GLOBAL, src_code, uml::I1, uml::I1, uml::I2); + generate_load_operand(block, compiler, DST_GLOBAL, dst_code, uml::I0, uml::I3); - UML_DADD(block, I2, I0, I1); + UML_SUB(block, I0, I0, I1); - UML_XOR(block, I4, I0, I2); - UML_XOR(block, I5, I1, I2); - UML_AND(block, I4, I4, I5); - UML_AND(block, I4, I4, I2); - UML_ROLAND(block, I4, I4, 4, V_MASK); - UML_DROLINS(block, I4, I2, 32, C_MASK); + generate_update_flags_addsubs(block, compiler, uml::I2); + UML_MOV(block, DRC_SR, I2); - UML_ADD(block, I0, I0, I1); - UML_SHR(block, I1, DRC_SR, Z_SHIFT); - UML_AND(block, I1, I1, 1); - UML_TEST(block, I0, ~0); - UML_SETc(block, uml::COND_Z, I2); - UML_AND(block, I1, I1, I2); - UML_ROLINS(block, I4, I1, Z_SHIFT, Z_MASK); - UML_ROLINS(block, I4, I0, 3, N_MASK); - - UML_ROLINS(block, DRC_SR, I4, 0, (C_MASK | V_MASK | Z_MASK | N_MASK)); - - if (DST_GLOBAL) - { - if (dst_code < 2) - { - UML_MOV(block, I4, dst_code); - UML_MOV(block, I5, I0); - generate_set_global_register(block, compiler, desc); - } - else - { - UML_STORE(block, (void *)m_core->global_regs, dst_code, I0, SIZE_DWORD, SCALE_x4); - } - } - else - { - UML_STORE(block, (void *)m_core->local_regs, I3, I0, SIZE_DWORD, SCALE_x4); - } + generate_set_dst(block, compiler, desc, DST_GLOBAL, dst_code, uml::I0, uml::I3, false); + generate_trap_on_overflow(block, compiler, desc); } template -void hyperstone_device::generate_neg(drcuml_block &block, compiler_state &compiler, const opcode_desc *desc) +void hyperstone_device::generate_addc(drcuml_block &block, compiler_state &compiler, const opcode_desc *desc) { UML_MOV(block, I7, mem(&m_core->clock_cycles_1)); - uint16_t op = desc->opptr.w[0]; - - generate_check_delay_pc(block, compiler, desc); - - const uint32_t dst_code = (op & 0xf0) >> 4; + const uint16_t op = desc->opptr.w[0]; const uint32_t src_code = op & 0xf; - - if (!SRC_GLOBAL || !DST_GLOBAL) - UML_ROLAND(block, I3, DRC_SR, 7, 0x7f); - - if (SRC_GLOBAL) - { - UML_LOAD(block, I0, (void *)m_core->global_regs, src_code, SIZE_DWORD, SCALE_x4); - } - else - { - UML_ADD(block, I2, I3, src_code); - UML_AND(block, I1, I2, 0x3f); - UML_LOAD(block, I0, (void *)m_core->local_regs, I1, SIZE_DWORD, SCALE_x4); - } - - UML_DSUB(block, I4, 0, I0); - UML_SUB(block, I2, 0, I0); - - UML_TEST(block, I2, ~0); - UML_MOVc(block, uml::COND_Z, I6, Z_MASK); - UML_MOVc(block, uml::COND_NZ, I6, 0); - - UML_AND(block, I5, DRC_SR, ~(C_MASK | V_MASK | Z_MASK | N_MASK)); - UML_DROLINS(block, I6, I4, 32, C_MASK); - UML_AND(block, I1, I4, I0); - UML_ROLINS(block, I6, I1, 4, V_MASK); - UML_ROLINS(block, I6, I2, 3, N_MASK); - UML_OR(block, DRC_SR, I5, I6); - - if (DST_GLOBAL) - { - if (dst_code < 2) - { - UML_MOV(block, I4, dst_code); - UML_MOV(block, I5, I2); - generate_set_global_register(block, compiler, desc); - } - else - { - UML_STORE(block, (void *)m_core->global_regs, dst_code, I2, SIZE_DWORD, SCALE_x4); - } - } - else - { - UML_ADD(block, I1, I3, dst_code); - UML_AND(block, I4, I1, 0x3f); - UML_STORE(block, (void *)m_core->local_regs, I4, I2, SIZE_DWORD, SCALE_x4); - } -} - - -template -void hyperstone_device::generate_negs(drcuml_block &block, compiler_state &compiler, const opcode_desc *desc) -{ - printf("Unimplemented: generate_negs (%08x)\n", desc->pc); - fflush(stdout); - fatalerror(" "); -} - - -template -void hyperstone_device::generate_and(drcuml_block &block, compiler_state &compiler, const opcode_desc *desc) -{ - UML_MOV(block, I7, mem(&m_core->clock_cycles_1)); - - uint16_t op = desc->opptr.w[0]; + const uint32_t dst_code = (op & 0xf0) >> 4; generate_check_delay_pc(block, compiler, desc); - const uint32_t dst_code = (op & 0xf0) >> 4; - const uint32_t src_code = op & 0xf; - + UML_MOV(block, I2, DRC_SR); if (!SRC_GLOBAL || !DST_GLOBAL) - UML_ROLAND(block, I3, DRC_SR, 7, 0x7f); - - if (SRC_GLOBAL) - { - UML_LOAD(block, I0, (void *)m_core->global_regs, src_code, SIZE_DWORD, SCALE_x4); - } - else - { - UML_ADD(block, I2, I3, src_code); - UML_AND(block, I1, I2, 0x3f); - UML_LOAD(block, I0, (void *)m_core->local_regs, I1, SIZE_DWORD, SCALE_x4); - } - - if (DST_GLOBAL) - { - UML_LOAD(block, I1, (void *)m_core->global_regs, dst_code, SIZE_DWORD, SCALE_x4); - } - else - { - UML_ADD(block, I2, I3, dst_code); - UML_AND(block, I4, I2, 0x3f); - UML_LOAD(block, I1, (void *)m_core->local_regs, I4, SIZE_DWORD, SCALE_x4); - } - - UML_AND(block, I5, I1, I0); + UML_ROLAND(block, I3, I2, 7, 0x7f); - UML_TEST(block, I5, ~0); - UML_MOVc(block, uml::COND_Z, I1, Z_MASK); - UML_MOVc(block, uml::COND_NZ, I1, 0); - UML_ROLINS(block, DRC_SR, I1, 0, Z_MASK); + generate_load_src_addsub(block, compiler, SRC_GLOBAL,src_code, uml::I1, uml::I1, uml::I2); + generate_load_operand(block, compiler, DST_GLOBAL, dst_code, uml::I0, uml::I3); - if (DST_GLOBAL) + if (!SRC_GLOBAL || (src_code != SR_REGISTER)) { - if (dst_code < 2) - { - UML_MOV(block, I4, dst_code); - generate_set_global_register(block, compiler, desc); - } - else - { - UML_STORE(block, (void *)m_core->global_regs, dst_code, I5, SIZE_DWORD, SCALE_x4); - } + UML_SHR(block, I4, I2, 1); // set up carry in, result unused + UML_ADDC(block, I0, I0, I1); } else { - UML_STORE(block, (void *)m_core->local_regs, I4, I5, SIZE_DWORD, SCALE_x4); + UML_ADD(block, I0, I0, I1); } + + generate_update_flags_addsubc(block, compiler, uml::I2); + UML_MOV(block, DRC_SR, I2); + + generate_set_dst(block, compiler, desc, DST_GLOBAL, dst_code, uml::I0, uml::I3, false); } template -void hyperstone_device::generate_andn(drcuml_block &block, compiler_state &compiler, const opcode_desc *desc) +void hyperstone_device::generate_neg(drcuml_block &block, compiler_state &compiler, const opcode_desc *desc) { UML_MOV(block, I7, mem(&m_core->clock_cycles_1)); - uint16_t op = desc->opptr.w[0]; + const uint16_t op = desc->opptr.w[0]; generate_check_delay_pc(block, compiler, desc); const uint32_t dst_code = (op & 0xf0) >> 4; const uint32_t src_code = op & 0xf; + UML_MOV(block, I2, DRC_SR); if (!SRC_GLOBAL || !DST_GLOBAL) - UML_ROLAND(block, I3, DRC_SR, 7, 0x7f); - - if (SRC_GLOBAL) - { - UML_LOAD(block, I0, (void *)m_core->global_regs, src_code, SIZE_DWORD, SCALE_x4); - } - else - { - UML_ADD(block, I2, I3, src_code); - UML_AND(block, I1, I2, 0x3f); - UML_LOAD(block, I0, (void *)m_core->local_regs, I1, SIZE_DWORD, SCALE_x4); - } + UML_ROLAND(block, I3, I2, 7, 0x7f); - if (DST_GLOBAL) - { - UML_LOAD(block, I1, (void *)m_core->global_regs, dst_code, SIZE_DWORD, SCALE_x4); - } - else - { - UML_ADD(block, I2, I3, dst_code); - UML_AND(block, I4, I2, 0x3f); - UML_LOAD(block, I1, (void *)m_core->local_regs, I4, SIZE_DWORD, SCALE_x4); - } + generate_load_src_addsub(block, compiler, SRC_GLOBAL, src_code, uml::I0, uml::I0, uml::I2); - UML_XOR(block, I2, I0, ~0); - UML_AND(block, I5, I1, I2); + UML_SUB(block, I0, 0, I0); - UML_TEST(block, I5, ~0); - UML_MOVc(block, uml::COND_Z, I1, Z_MASK); - UML_MOVc(block, uml::COND_NZ, I1, 0); - UML_ROLINS(block, DRC_SR, I1, 0, Z_MASK); + generate_update_flags_addsub(block, compiler, uml::I2); + UML_MOV(block, DRC_SR, I2); - if (DST_GLOBAL) - { - if (dst_code < 2) - { - UML_MOV(block, I4, dst_code); - generate_set_global_register(block, compiler, desc); - } - else - { - UML_STORE(block, (void *)m_core->global_regs, dst_code, I5, SIZE_DWORD, SCALE_x4); - } - } - else - { - UML_STORE(block, (void *)m_core->local_regs, I4, I5, SIZE_DWORD, SCALE_x4); - } + generate_set_dst(block, compiler, desc, DST_GLOBAL, dst_code, uml::I0, uml::I3, true); } template -void hyperstone_device::generate_or(drcuml_block &block, compiler_state &compiler, const opcode_desc *desc) +void hyperstone_device::generate_negs(drcuml_block &block, compiler_state &compiler, const opcode_desc *desc) { UML_MOV(block, I7, mem(&m_core->clock_cycles_1)); - uint16_t op = desc->opptr.w[0]; + const uint16_t op = desc->opptr.w[0]; generate_check_delay_pc(block, compiler, desc); const uint32_t dst_code = (op & 0xf0) >> 4; const uint32_t src_code = op & 0xf; + UML_MOV(block, I2, DRC_SR); if (!SRC_GLOBAL || !DST_GLOBAL) - UML_ROLAND(block, I3, DRC_SR, 7, 0x7f); + UML_ROLAND(block, I3, I2, 7, 0x7f); - if (SRC_GLOBAL) - { - UML_LOAD(block, I0, (void *)m_core->global_regs, src_code, SIZE_DWORD, SCALE_x4); - } - else - { - UML_ADD(block, I2, I3, src_code); - UML_AND(block, I1, I2, 0x3f); - UML_LOAD(block, I0, (void *)m_core->local_regs, I1, SIZE_DWORD, SCALE_x4); - } + generate_load_src_addsub(block, compiler, SRC_GLOBAL, src_code, uml::I0, uml::I0, uml::I2); - if (DST_GLOBAL) - { - UML_LOAD(block, I1, (void *)m_core->global_regs, dst_code, SIZE_DWORD, SCALE_x4); - } - else - { - UML_ADD(block, I2, I3, dst_code); - UML_AND(block, I4, I2, 0x3f); - UML_LOAD(block, I1, (void *)m_core->local_regs, I4, SIZE_DWORD, SCALE_x4); - } + UML_SUB(block, I0, 0, I0); - UML_OR(block, I5, I1, I0); + generate_update_flags_addsubs(block, compiler, uml::I2); + UML_MOV(block, DRC_SR, I2); - UML_TEST(block, I5, ~0); - UML_MOVc(block, uml::COND_Z, I1, Z_MASK); - UML_MOVc(block, uml::COND_NZ, I1, 0); - UML_ROLINS(block, DRC_SR, I1, 0, Z_MASK); + generate_set_dst(block, compiler, desc, DST_GLOBAL, dst_code, uml::I0, uml::I3, true); - if (DST_GLOBAL) - { - if (dst_code < 2) - { - UML_MOV(block, I4, dst_code); - generate_set_global_register(block, compiler, desc); - } - else - { - UML_STORE(block, (void *)m_core->global_regs, dst_code, I5, SIZE_DWORD, SCALE_x4); - } - } - else - { - UML_STORE(block, (void *)m_core->local_regs, I4, I5, SIZE_DWORD, SCALE_x4); - } + if (!SRC_GLOBAL || (src_code != SR_REGISTER)) // negating carry cannot result in overflow + generate_trap_on_overflow(block, compiler, desc); } template -void hyperstone_device::generate_xor(drcuml_block &block, compiler_state &compiler, const opcode_desc *desc) +void hyperstone_device::generate_and(drcuml_block &block, compiler_state &compiler, const opcode_desc *desc) { - UML_MOV(block, I7, mem(&m_core->clock_cycles_1)); - - uint16_t op = desc->opptr.w[0]; - - generate_check_delay_pc(block, compiler, desc); - - const uint32_t dst_code = (op & 0xf0) >> 4; - const uint32_t src_code = op & 0xf; + generate_logic_op( + block, + compiler, + desc, + [&block] () { UML_AND(block, I0, I0, I1); }); +} - if (!SRC_GLOBAL || !DST_GLOBAL) - UML_ROLAND(block, I3, DRC_SR, 7, 0x7f); - if (SRC_GLOBAL) - { - UML_LOAD(block, I0, (void *)m_core->global_regs, src_code, SIZE_DWORD, SCALE_x4); - } - else - { - UML_ADD(block, I2, I3, src_code); - UML_AND(block, I1, I2, 0x3f); - UML_LOAD(block, I0, (void *)m_core->local_regs, I1, SIZE_DWORD, SCALE_x4); - } +template +void hyperstone_device::generate_andn(drcuml_block &block, compiler_state &compiler, const opcode_desc *desc) +{ + generate_logic_op( + block, + compiler, + desc, + [&block] () { UML_XOR(block, I1, I1, ~uint32_t(0)); UML_AND(block, I0, I0, I1); }); +} - if (DST_GLOBAL) - { - UML_LOAD(block, I1, (void *)m_core->global_regs, dst_code, SIZE_DWORD, SCALE_x4); - } - else - { - UML_ADD(block, I2, I3, dst_code); - UML_AND(block, I4, I2, 0x3f); - UML_LOAD(block, I1, (void *)m_core->local_regs, I4, SIZE_DWORD, SCALE_x4); - } - UML_XOR(block, I5, I1, I0); +template +void hyperstone_device::generate_or(drcuml_block &block, compiler_state &compiler, const opcode_desc *desc) +{ + generate_logic_op( + block, + compiler, + desc, + [&block] () { UML_OR(block, I0, I0, I1); }); +} - UML_TEST(block, I5, ~0); - UML_MOVc(block, uml::COND_Z, I1, Z_MASK); - UML_MOVc(block, uml::COND_NZ, I1, 0); - UML_ROLINS(block, DRC_SR, I1, 0, Z_MASK); - if (DST_GLOBAL) - { - if (dst_code < 2) - { - UML_MOV(block, I4, dst_code); - generate_set_global_register(block, compiler, desc); - } - else - { - UML_STORE(block, (void *)m_core->global_regs, dst_code, I5, SIZE_DWORD, SCALE_x4); - } - } - else - { - UML_STORE(block, (void *)m_core->local_regs, I4, I5, SIZE_DWORD, SCALE_x4); - } +template +void hyperstone_device::generate_xor(drcuml_block &block, compiler_state &compiler, const opcode_desc *desc) +{ + generate_logic_op( + block, + compiler, + desc, + [&block] () { UML_XOR(block, I0, I0, I1); }); } @@ -1909,50 +1551,25 @@ void hyperstone_device::generate_not(drcuml_block &block, compiler_state &compil { UML_MOV(block, I7, mem(&m_core->clock_cycles_1)); - uint16_t op = desc->opptr.w[0]; + const uint16_t op = desc->opptr.w[0]; generate_check_delay_pc(block, compiler, desc); const uint32_t dst_code = (op & 0xf0) >> 4; const uint32_t src_code = op & 0xf; + UML_MOV(block, I2, DRC_SR); if (!SRC_GLOBAL || !DST_GLOBAL) - UML_ROLAND(block, I3, DRC_SR, 7, 0x7f); - - if (SRC_GLOBAL) - UML_LOAD(block, I0, (void *)m_core->global_regs, src_code, SIZE_DWORD, SCALE_x4); - else - { - UML_ADD(block, I2, I3, src_code); - UML_AND(block, I1, I2, 0x3f); - UML_LOAD(block, I0, (void *)m_core->local_regs, I1, SIZE_DWORD, SCALE_x4); - } + UML_ROLAND(block, I3, I2, 7, 0x7f); - UML_XOR(block, I5, I0, ~0); + generate_load_operand(block, compiler, SRC_GLOBAL, src_code, uml::I0, uml::I0); - UML_TEST(block, I5, ~0); - UML_MOVc(block, uml::COND_Z, I1, Z_MASK); - UML_MOVc(block, uml::COND_NZ, I1, 0); - UML_ROLINS(block, DRC_SR, I1, 0, Z_MASK); + UML_XOR(block, I0, I0, ~uint32_t(0)); + UML_SETc(block, uml::COND_Z, I1); + UML_ROLINS(block, I2, I1, Z_SHIFT, Z_MASK); + UML_MOV(block, DRC_SR, I2); - if (DST_GLOBAL) - { - if (dst_code < 2) - { - UML_MOV(block, I4, dst_code); - generate_set_global_register(block, compiler, desc); - } - else - { - UML_STORE(block, (void *)m_core->global_regs, dst_code, I5, SIZE_DWORD, SCALE_x4); - } - } - else - { - UML_ADD(block, I2, I3, dst_code); - UML_AND(block, I4, I2, 0x3f); - UML_STORE(block, (void *)m_core->local_regs, I4, I5, SIZE_DWORD, SCALE_x4); - } + generate_set_dst(block, compiler, desc, DST_GLOBAL, dst_code, uml::I0, uml::I3, true); } @@ -1961,55 +1578,27 @@ void hyperstone_device::generate_cmpi(drcuml_block &block, compiler_state &compi { UML_MOV(block, I7, mem(&m_core->clock_cycles_1)); - uint16_t op = desc->opptr.w[0]; + const uint16_t op = desc->opptr.w[0]; const uint32_t dst_code = (op & 0xf0) >> 4; + uint32_t src; if (IMM_LONG) - { - generate_decode_immediate_s(block, compiler, desc); // I1 <-- imm32 - } + src = generate_get_immediate_s(block, compiler, desc); else - { - UML_MOV(block, I1, op & 0xf); - } + src = op & 0x0f; generate_check_delay_pc(block, compiler, desc); - if (DST_GLOBAL) - { - UML_LOAD(block, I2, (void *)m_core->global_regs, dst_code, SIZE_DWORD, SCALE_x4); - } - else - { - UML_ROLAND(block, I3, DRC_SR, 7, 0x7f); - UML_ADD(block, I2, I3, dst_code); - UML_AND(block, I4, I2, 0x3f); - UML_LOAD(block, I2, (void *)m_core->local_regs, I4, SIZE_DWORD, SCALE_x4); - } - - UML_AND(block, DRC_SR, DRC_SR, ~(V_MASK | Z_MASK | N_MASK | C_MASK)); + UML_MOV(block, I2, DRC_SR); + if (!DST_GLOBAL) + UML_ROLAND(block, I3, I2, 7, 0x7f); - UML_DSUB(block, I0, I2, I1); + generate_load_operand(block, compiler, DST_GLOBAL, dst_code, uml::I0, uml::I0); - int no_v; - UML_XOR(block, I0, I0, I2); - UML_XOR(block, I3, I1, I2); - UML_AND(block, I0, I0, I3); - UML_TEST(block, I0, 0x80000000); - UML_JMPc(block, uml::COND_Z, no_v = compiler.m_labelnum++); - UML_OR(block, DRC_SR, DRC_SR, V_MASK); - UML_LABEL(block, no_v); - - int no_n; - UML_MOV(block, I3, 0); - UML_CMP(block, I2, I1); - UML_MOVc(block, uml::COND_E, I3, Z_MASK); - UML_MOVc(block, uml::COND_B, I3, C_MASK); - UML_JMPc(block, uml::COND_GE, no_n = compiler.m_labelnum++); - UML_OR(block, I3, I3, N_MASK); - UML_LABEL(block, no_n); + UML_SUB(block, I0, I0, src); - UML_OR(block, DRC_SR, DRC_SR, I3); + generate_update_flags_addsub(block, compiler, uml::I2); + UML_MOV(block, DRC_SR, I2); } @@ -2018,22 +1607,23 @@ void hyperstone_device::generate_movi(drcuml_block &block, compiler_state &compi { UML_MOV(block, I7, mem(&m_core->clock_cycles_1)); - uint16_t op = desc->opptr.w[0]; + const uint16_t op = desc->opptr.w[0]; const uint32_t dst_code = (op & 0xf0) >> 4; - const uint32_t src_code = op & 0xf; + uint32_t src; if (IMM_LONG) - generate_decode_immediate_s(block, compiler, desc); + src = generate_get_immediate_s(block, compiler, desc); else - UML_MOV(block, I1, src_code); + src = op & 0x0f; generate_check_delay_pc(block, compiler, desc); - int done, no_exception; + int done; if (DST_GLOBAL) { + const int no_exception = compiler.m_labelnum++; UML_TEST(block, DRC_SR, H_MASK); - UML_JMPc(block, uml::COND_Z, no_exception = compiler.m_labelnum++); + UML_JMPc(block, uml::COND_Z, no_exception); UML_TEST(block, DRC_SR, S_MASK); UML_JMPc(block, uml::COND_NZ, no_exception); UML_EXH(block, *m_exception[EXCEPTION_PRIVILEGE_ERROR], 0); @@ -2043,17 +1633,10 @@ void hyperstone_device::generate_movi(drcuml_block &block, compiler_state &compi UML_AND(block, DRC_SR, DRC_SR, ~(Z_MASK | N_MASK)); - int no_z; - UML_TEST(block, I1, ~0); - UML_JMPc(block, uml::COND_NZ, no_z = compiler.m_labelnum++); - UML_OR(block, DRC_SR, DRC_SR, Z_MASK); - UML_LABEL(block, no_z); - - int no_n; - UML_TEST(block, I1, 0x80000000); - UML_JMPc(block, uml::COND_Z, no_n = compiler.m_labelnum++); - UML_OR(block, DRC_SR, DRC_SR, N_MASK); - UML_LABEL(block, no_n); + if (!src) + UML_OR(block, DRC_SR, DRC_SR, Z_MASK); + else if (src & 0x80000000) + UML_OR(block, DRC_SR, DRC_SR, N_MASK); #if MISSIONCRAFT_FLAGS UML_AND(block, DRC_SR, DRC_SR, ~V_MASK); @@ -2061,17 +1644,21 @@ void hyperstone_device::generate_movi(drcuml_block &block, compiler_state &compi if (DST_GLOBAL) { + const int highglobal = compiler.m_labelnum++; + UML_TEST(block, DRC_SR, H_MASK); - UML_MOVc(block, uml::COND_NZ, I4, dst_code + 16); - UML_MOVc(block, uml::COND_Z, I4, dst_code); - UML_AND(block, DRC_SR, DRC_SR, ~H_MASK); - UML_MOV(block, I5, I1); - generate_set_global_register(block, compiler, desc); + UML_JMPc(block, uml::COND_NZ, highglobal); + generate_set_global_register_low(block, compiler, dst_code, src); + if (dst_code == PC_REGISTER) + { + UML_AND(block, DRC_SR, DRC_SR, ~M_MASK); + generate_branch(block, desc->targetpc, desc); + } + UML_JMP(block, done); - UML_TEST(block, op, 0xf0); - UML_JMPc(block, uml::COND_NZ, done); - UML_AND(block, DRC_SR, DRC_SR, ~M_MASK); - generate_branch(block, desc->targetpc, desc); + UML_LABEL(block, highglobal); + UML_AND(block, DRC_SR, DRC_SR, ~H_MASK); + generate_set_global_register_high(block, compiler, dst_code, src); UML_LABEL(block, done); } @@ -2081,7 +1668,7 @@ void hyperstone_device::generate_movi(drcuml_block &block, compiler_state &compi UML_ROLAND(block, I2, DRC_SR, 7, 0x7f); UML_ADD(block, I0, I2, dst_code); UML_AND(block, I0, I0, 0x3f); - UML_STORE(block, (void *)m_core->local_regs, I0, I1, SIZE_DWORD, SCALE_x4); + UML_STORE(block, (void *)m_core->local_regs, I0, src, SIZE_DWORD, SCALE_x4); } } @@ -2091,87 +1678,47 @@ void hyperstone_device::generate_addi(drcuml_block &block, compiler_state &compi { UML_MOV(block, I7, mem(&m_core->clock_cycles_1)); - uint16_t op = desc->opptr.w[0]; + const uint16_t op = desc->opptr.w[0]; const uint32_t dst_code = (op & 0xf0) >> 4; - const uint32_t src_code = op & 0xf; + uint32_t src; if (IMM_LONG) - { - generate_decode_immediate_s(block, compiler, desc); // I1 <-- imm32 - } + src = generate_get_immediate_s(block, compiler, desc); else - { - UML_MOV(block, I1, src_code); - } + src = op & 0x0f; generate_check_delay_pc(block, compiler, desc); - if (DST_GLOBAL) - { - UML_LOAD(block, I0, (void *)m_core->global_regs, dst_code, SIZE_DWORD, SCALE_x4); - } - else - { - UML_ROLAND(block, I2, DRC_SR, 7, 0x7f); - UML_ADD(block, I2, I2, dst_code); - UML_AND(block, I2, I2, 0x3f); - UML_LOAD(block, I0, (void *)m_core->local_regs, I2, SIZE_DWORD, SCALE_x4); - } + UML_MOV(block, I2, DRC_SR); + if (!DST_GLOBAL) + UML_ROLAND(block, I3, I2, 7, 0x7f); - if (!(op & 0x10f)) + generate_load_operand(block, compiler, DST_GLOBAL, dst_code, uml::I0, uml::I3); + + const bool roundeven = !(op & 0x10f); + uml::parameter srcp = roundeven ? uml::I1 : src; + if (roundeven) { - UML_ROLAND(block, I3, DRC_SR, 32-Z_SHIFT, 1); - UML_XOR(block, I3, I3, 1); - UML_AND(block, I4, I0, 1); - UML_OR(block, I3, I3, I4); - UML_AND(block, I1, DRC_SR, I3); + UML_MOV(block, I4, DRC_SR); + UML_AND(block, I1, I0, 1); // Rd(0) + UML_AND(block, I1, I1, I4); // & C + UML_TEST(block, I4, Z_MASK); + UML_MOVc(block, uml::COND_NZ, I1, 0); // & ~Z } - UML_DADD(block, I3, I0, I1); - - UML_DROLAND(block, I6, I3, 32, C_MASK); + UML_ADD(block, I0, I0, srcp); - UML_XOR(block, I4, I0, I3); - UML_XOR(block, I5, I1, I3); - UML_AND(block, I4, I4, I5); - UML_ROLINS(block, I6, I4, 4, V_MASK); + generate_update_flags_addsub(block, compiler, uml::I2); + UML_MOV(block, DRC_SR, I2); - UML_TEST(block, I3, ~0); - UML_SETc(block, uml::COND_Z, I4); - UML_ROLINS(block, I6, I4, Z_SHIFT, Z_MASK); - UML_ROLINS(block, I6, I3, 3, N_MASK); - UML_ROLINS(block, DRC_SR, I6, 0, (V_MASK | N_MASK | Z_MASK | C_MASK)); - - if (DST_GLOBAL) - { - if (dst_code < 2) - { - UML_MOV(block, I4, dst_code); - UML_MOV(block, I5, I3); - generate_set_global_register(block, compiler, desc); - - if (dst_code == PC_REGISTER) - { - UML_AND(block, DRC_SR, DRC_SR, ~M_MASK); - generate_branch(block, desc->targetpc, desc); - } - } - else - { - UML_STORE(block, (void *)m_core->global_regs, dst_code, I3, SIZE_DWORD, SCALE_x4); - } - } - else - { - UML_STORE(block, (void *)m_core->local_regs, I2, I3, SIZE_DWORD, SCALE_x4); - } + generate_set_dst(block, compiler, desc, DST_GLOBAL, dst_code, uml::I0, uml::I3, false); } template void hyperstone_device::generate_addsi(drcuml_block &block, compiler_state &compiler, const opcode_desc *desc) { - printf("Unimplemented: generate_addsi (%08x)\n", desc->pc); + osd_printf_error("Unimplemented: generate_addsi (%08x)\n", desc->pc); fflush(stdout); fatalerror(" "); } @@ -2182,27 +1729,21 @@ void hyperstone_device::generate_cmpbi(drcuml_block &block, compiler_state &comp { UML_MOV(block, I7, mem(&m_core->clock_cycles_1)); - uint16_t op = desc->opptr.w[0]; + const uint16_t op = desc->opptr.w[0]; const uint32_t dst_code = (op & 0xf0) >> 4; if (!IMM_LONG) generate_check_delay_pc(block, compiler, desc); - if (DST_GLOBAL) - { - UML_LOAD(block, I2, (void *)m_core->global_regs, dst_code, SIZE_DWORD, SCALE_x4); - } - else - { + if (!DST_GLOBAL) UML_ROLAND(block, I3, DRC_SR, 7, 0x7f); - UML_ADD(block, I4, I3, dst_code); - UML_AND(block, I5, I4, 0x3f); - UML_LOAD(block, I2, (void *)m_core->local_regs, I5, SIZE_DWORD, SCALE_x4); - } + + generate_load_operand(block, compiler, DST_GLOBAL, dst_code, uml::I0, uml::I3); const uint32_t n = ((op & 0x100) >> 4) | (op & 0x0f); if (n) { + uint32_t src; if (n == 31) { if (IMM_LONG) @@ -2210,25 +1751,21 @@ void hyperstone_device::generate_cmpbi(drcuml_block &block, compiler_state &comp generate_ignore_immediate_s(block, desc); generate_check_delay_pc(block, compiler, desc); } - UML_MOV(block, I1, 0x7fffffff); + src = 0x7fffffff; + } + else if (IMM_LONG) + { + src = generate_get_immediate_s(block, compiler, desc); + generate_check_delay_pc(block, compiler, desc); } else { - if (IMM_LONG) - { - generate_decode_immediate_s(block, compiler, desc); - generate_check_delay_pc(block, compiler, desc); - } - else - { - UML_MOV(block, I1, op & 0xf); - } + src = op & 0xf; } - UML_AND(block, DRC_SR, DRC_SR, ~Z_MASK); - UML_TEST(block, I2, I1); - UML_SETc(block, uml::COND_Z, I3); - UML_ROLINS(block, DRC_SR, I3, Z_SHIFT, Z_MASK); + UML_TEST(block, I0, src); + UML_SETc(block, uml::COND_Z, I1); + UML_ROLINS(block, DRC_SR, I1, Z_SHIFT, Z_MASK); } else { @@ -2238,17 +1775,18 @@ void hyperstone_device::generate_cmpbi(drcuml_block &block, compiler_state &comp generate_check_delay_pc(block, compiler, desc); } - int or_mask, done; - UML_TEST(block, I2, 0xff000000); - UML_JMPc(block, uml::COND_Z, or_mask = compiler.m_labelnum++); - UML_TEST(block, I2, 0x00ff0000); + const int or_mask = compiler.m_labelnum++; + const int done = compiler.m_labelnum++; + UML_TEST(block, I0, 0xff000000); UML_JMPc(block, uml::COND_Z, or_mask); - UML_TEST(block, I2, 0x0000ff00); + UML_TEST(block, I0, 0x00ff0000); UML_JMPc(block, uml::COND_Z, or_mask); - UML_TEST(block, I2, 0x000000ff); + UML_TEST(block, I0, 0x0000ff00); + UML_JMPc(block, uml::COND_Z, or_mask); + UML_TEST(block, I0, 0x000000ff); UML_JMPc(block, uml::COND_Z, or_mask); UML_AND(block, DRC_SR, DRC_SR, ~Z_MASK); - UML_JMP(block, done = compiler.m_labelnum++); + UML_JMP(block, done); UML_LABEL(block, or_mask); UML_OR(block, DRC_SR, DRC_SR, Z_MASK); @@ -2263,60 +1801,23 @@ void hyperstone_device::generate_andni(drcuml_block &block, compiler_state &comp { UML_MOV(block, I7, mem(&m_core->clock_cycles_1)); - uint16_t op = desc->opptr.w[0]; - const uint32_t dst_code = (op & 0xf0) >> 4; + const uint16_t op = desc->opptr.w[0]; + uint32_t src; if (DRC_N_OP_MASK == 0x10f) - UML_MOV(block, I1, 0x7fffffff); + src = 0x7fffffff; else if (IMM_LONG) - generate_decode_immediate_s(block, compiler, desc); // I1 <-- imm32 - else - UML_MOV(block, I1, op & 0xf); - - generate_check_delay_pc(block, compiler, desc); - - if (DST_GLOBAL) - { - UML_LOAD(block, I2, (void *)m_core->global_regs, dst_code, SIZE_DWORD, SCALE_x4); - } - else - { - UML_ROLAND(block, I3, DRC_SR, 7, 0x7f); - UML_ADD(block, I2, I3, dst_code); - UML_AND(block, I4, I2, 0x3f); - UML_LOAD(block, I2, (void *)m_core->local_regs, I4, SIZE_DWORD, SCALE_x4); - } - - UML_XOR(block, I1, I1, ~0); - UML_AND(block, I5, I2, I1); - - UML_TEST(block, I5, ~0); - UML_MOVc(block, uml::COND_Z, I2, Z_MASK); - UML_MOVc(block, uml::COND_NZ, I2, 0); - UML_ROLINS(block, DRC_SR, I2, 0, Z_MASK); - - if (DST_GLOBAL) - { - if (dst_code < 2) - { - UML_MOV(block, I4, dst_code); - generate_set_global_register(block, compiler, desc); - if (dst_code == PC_REGISTER) - { - generate_branch(block, desc->targetpc, desc); - } - } - else - { - UML_STORE(block, (void *)m_core->global_regs, dst_code, I5, SIZE_DWORD, SCALE_x4); - } - } + src = generate_get_immediate_s(block, compiler, desc); else - { - UML_ADD(block, I4, I3, dst_code); - UML_AND(block, I4, I4, 0x3f); - UML_STORE(block, (void *)m_core->local_regs, I4, I5, SIZE_DWORD, SCALE_x4); - } + src = op & 0x0f; + src = ~src; + + generate_logic_op_imm( + block, + compiler, + desc, + (op & 0xf0) >> 4, + [&block, src] () { UML_AND(block, I0, I0, src); }); } @@ -2325,61 +1826,20 @@ void hyperstone_device::generate_ori(drcuml_block &block, compiler_state &compil { UML_MOV(block, I7, mem(&m_core->clock_cycles_1)); - uint16_t op = desc->opptr.w[0]; - const uint32_t dst_code = (op & 0xf0) >> 4; + const uint16_t op = desc->opptr.w[0]; + uint32_t src; if (IMM_LONG) - { - generate_decode_immediate_s(block, compiler, desc); // I1 <-- imm32 - } - else - { - UML_MOV(block, I1, op & 0xf); - } - - generate_check_delay_pc(block, compiler, desc); - - if (DST_GLOBAL) - { - UML_LOAD(block, I2, (void *)m_core->global_regs, dst_code, SIZE_DWORD, SCALE_x4); - } - else - { - UML_ROLAND(block, I3, DRC_SR, 7, 0x7f); - UML_ADD(block, I2, I3, dst_code); - UML_AND(block, I4, I2, 0x3f); - UML_LOAD(block, I2, (void *)m_core->local_regs, I4, SIZE_DWORD, SCALE_x4); - } - - UML_OR(block, I5, I2, I1); - - UML_TEST(block, I5, ~0); - UML_MOVc(block, uml::COND_Z, I2, Z_MASK); - UML_MOVc(block, uml::COND_NZ, I2, 0); - UML_ROLINS(block, DRC_SR, I2, 0, Z_MASK); - - if (DST_GLOBAL) - { - if (dst_code < 2) - { - UML_MOV(block, I4, dst_code); - generate_set_global_register(block, compiler, desc); - if (dst_code == PC_REGISTER) - { - generate_branch(block, desc->targetpc, desc); - } - } - else - { - UML_STORE(block, (void *)m_core->global_regs, dst_code, I5, SIZE_DWORD, SCALE_x4); - } - } + src = generate_get_immediate_s(block, compiler, desc); else - { - UML_ADD(block, I4, I3, dst_code); - UML_AND(block, I4, I4, 0x3f); - UML_STORE(block, (void *)m_core->local_regs, I4, I5, SIZE_DWORD, SCALE_x4); - } + src = op & 0x0f; + + generate_logic_op_imm( + block, + compiler, + desc, + (op & 0xf0) >> 4, + [&block, src] () { UML_OR(block, I0, I0, src); }); } @@ -2388,61 +1848,20 @@ void hyperstone_device::generate_xori(drcuml_block &block, compiler_state &compi { UML_MOV(block, I7, mem(&m_core->clock_cycles_1)); - uint16_t op = desc->opptr.w[0]; - const uint32_t dst_code = (op & 0xf0) >> 4; + const uint16_t op = desc->opptr.w[0]; + uint32_t src; if (IMM_LONG) - { - generate_decode_immediate_s(block, compiler, desc); // I1 <-- imm32 - } - else - { - UML_MOV(block, I1, op & 0xf); - } - - generate_check_delay_pc(block, compiler, desc); - - if (DST_GLOBAL) - { - UML_LOAD(block, I2, (void *)m_core->global_regs, dst_code, SIZE_DWORD, SCALE_x4); - } - else - { - UML_ROLAND(block, I3, DRC_SR, 7, 0x7f); - UML_ADD(block, I2, I3, dst_code); - UML_AND(block, I4, I2, 0x3f); - UML_LOAD(block, I2, (void *)m_core->local_regs, I4, SIZE_DWORD, SCALE_x4); - } - - UML_XOR(block, I5, I2, I1); - - UML_TEST(block, I5, ~0); - UML_MOVc(block, uml::COND_Z, I2, Z_MASK); - UML_MOVc(block, uml::COND_NZ, I2, 0); - UML_ROLINS(block, DRC_SR, I2, 0, Z_MASK); - - if (DST_GLOBAL) - { - if (dst_code < 2) - { - UML_MOV(block, I4, dst_code); - generate_set_global_register(block, compiler, desc); - if (dst_code == PC_REGISTER) - { - generate_branch(block, desc->targetpc, desc); - } - } - else - { - UML_STORE(block, (void *)m_core->global_regs, dst_code, I5, SIZE_DWORD, SCALE_x4); - } - } + src = generate_get_immediate_s(block, compiler, desc); else - { - UML_ADD(block, I4, I3, dst_code); - UML_AND(block, I4, I4, 0x3f); - UML_STORE(block, (void *)m_core->local_regs, I4, I5, SIZE_DWORD, SCALE_x4); - } + src = op & 0x0f; + + generate_logic_op_imm( + block, + compiler, + desc, + (op & 0xf0) >> 4, + [&block, src] () { UML_XOR(block, I0, I0, src); }); } @@ -2451,7 +1870,7 @@ void hyperstone_device::generate_shrdi(drcuml_block &block, compiler_state &comp { UML_MOV(block, I7, mem(&m_core->clock_cycles_2)); - uint16_t op = desc->opptr.w[0]; + const uint16_t op = desc->opptr.w[0]; const uint32_t dst_code = (op & 0xf0) >> 4; @@ -2484,9 +1903,9 @@ void hyperstone_device::generate_shrdi(drcuml_block &block, compiler_state &comp UML_DSHR(block, I2, I2, n); } - UML_DTEST(block, I2, ~0ULL); - UML_MOVc(block, uml::COND_Z, I5, Z_MASK); - UML_MOVc(block, uml::COND_NZ, I5, 0); + UML_DTEST(block, I2, ~uint64_t(0)); + UML_SETc(block, uml::COND_Z, I5); + UML_SHL(block, I5, I5, Z_SHIFT); UML_DROLINS(block, I5, I2, 3, N_MASK); UML_OR(block, DRC_SR, I4, I5); @@ -2500,7 +1919,7 @@ void hyperstone_device::generate_shrd(drcuml_block &block, compiler_state &compi { UML_MOV(block, I7, mem(&m_core->clock_cycles_2)); - uint16_t op = desc->opptr.w[0]; + const uint16_t op = desc->opptr.w[0]; const uint32_t src_code = op & 0xf; const uint32_t dst_code = (op & 0xf0) >> 4; @@ -2558,7 +1977,7 @@ void hyperstone_device::generate_shr(drcuml_block &block, compiler_state &compil { UML_MOV(block, I7, mem(&m_core->clock_cycles_1)); - uint16_t op = desc->opptr.w[0]; + const uint16_t op = desc->opptr.w[0]; const uint32_t dst_code = (op & 0xf0) >> 4; const uint32_t src_code = op & 0xf; @@ -2567,16 +1986,16 @@ void hyperstone_device::generate_shr(drcuml_block &block, compiler_state &compil UML_ROLAND(block, I3, DRC_SR, 7, 0x7f); - UML_ADD(block, I2, I3, dst_code); - UML_AND(block, I4, I2, 0x3f); + UML_ADD(block, I4, I3, dst_code); + UML_AND(block, I4, I4, 0x3f); UML_LOAD(block, I0, (void *)m_core->local_regs, I4, SIZE_DWORD, SCALE_x4); // I0 = dreg - UML_ADD(block, I2, I3, src_code); - UML_AND(block, I1, I2, 0x3f); - UML_LOAD(block, I5, (void *)m_core->local_regs, I1, SIZE_DWORD, SCALE_x4); - UML_AND(block, I1, I5, 0x1f); // I1 = sreg & 0x1f + UML_ADD(block, I3, I3, src_code); + UML_AND(block, I3, I3, 0x3f); + UML_LOAD(block, I1, (void *)m_core->local_regs, I3, SIZE_DWORD, SCALE_x4); + UML_AND(block, I1, I1, 0x1f); // I1 = sreg & 0x1f - UML_AND(block, I6, DRC_SR, ~(C_MASK | Z_MASK | N_MASK)); + UML_AND(block, I3, DRC_SR, ~(C_MASK | Z_MASK | N_MASK)); int no_shift = compiler.m_labelnum++; int no_carry = compiler.m_labelnum++; @@ -2586,18 +2005,18 @@ void hyperstone_device::generate_shr(drcuml_block &block, compiler_state &compil UML_SHL(block, I2, 1, I2); UML_TEST(block, I0, I2); UML_JMPc(block, uml::COND_Z, no_carry); - UML_OR(block, I6, I6, C_MASK); + UML_OR(block, I3, I3, C_MASK); UML_LABEL(block, no_carry); UML_SHR(block, I0, I0, I1); UML_LABEL(block, no_shift); - UML_TEST(block, I0, ~0); - UML_MOVc(block, uml::COND_Z, I5, Z_MASK); - UML_MOVc(block, uml::COND_NZ, I5, 0); - UML_ROLINS(block, I5, I0, 3, N_MASK); + UML_TEST(block, I0, ~uint32_t(0)); + UML_SETc(block, uml::COND_Z, I2); + UML_SHL(block, I2, I2, Z_SHIFT); + UML_ROLINS(block, I2, I0, 3, N_MASK); - UML_OR(block, DRC_SR, I5, I6); + UML_OR(block, DRC_SR, I2, I3); UML_STORE(block, (void *)m_core->local_regs, I4, I0, SIZE_DWORD, SCALE_x4); } @@ -2607,53 +2026,32 @@ void hyperstone_device::generate_shri(drcuml_block &block, compiler_state &compi { UML_MOV(block, I7, mem(&m_core->clock_cycles_1)); - uint16_t op = desc->opptr.w[0]; + const uint16_t op = desc->opptr.w[0]; const uint32_t dst_code = (op & 0xf0) >> 4; generate_check_delay_pc(block, compiler, desc); - if (DST_GLOBAL) - { - UML_LOAD(block, I4, (void *)m_core->global_regs, dst_code, SIZE_DWORD, SCALE_x4); - } - else - { + if (!DST_GLOBAL) UML_ROLAND(block, I3, DRC_SR, 7, 0x7f); - UML_ADD(block, I2, I3, dst_code); - UML_AND(block, I6, I2, 0x3f); - UML_LOAD(block, I4, (void *)m_core->local_regs, I6, SIZE_DWORD, SCALE_x4); - } + + generate_load_operand(block, compiler, DST_GLOBAL, dst_code, uml::I0, uml::I3); UML_AND(block, I1, DRC_SR, ~(C_MASK | Z_MASK | N_MASK)); const uint32_t n = HI_N ? (0x10 | (op & 0xf)) : (op & 0xf); if (HI_N || n) - UML_ROLINS(block, I1, I4, 32 - (n - 1), 1); + UML_ROLINS(block, I1, I0, 32 - (n - 1), 1); - UML_SHR(block, I5, I4, n); - - UML_TEST(block, I5, ~0); - UML_MOVc(block, uml::COND_Z, I2, Z_MASK); - UML_MOVc(block, uml::COND_NZ, I2, 0); - UML_ROLINS(block, I2, I5, 3, N_MASK); + UML_SHR(block, I0, I0, n); + UML_SETc(block, uml::COND_Z, I2); + UML_SHL(block, I2, I2, Z_SHIFT); + UML_ROLINS(block, I2, I0, 3, N_MASK); UML_OR(block, DRC_SR, I1, I2); if (DST_GLOBAL) - { - if (dst_code < 2) - { - UML_MOV(block, I4, dst_code); - generate_set_global_register(block, compiler, desc); - } - else - { - UML_STORE(block, (void *)m_core->global_regs, dst_code, I5, SIZE_DWORD, SCALE_x4); - } - } + generate_set_global_register_low(block, compiler, dst_code, uml::I0); else - { - UML_STORE(block, (void *)m_core->local_regs, I6, I5, SIZE_DWORD, SCALE_x4); - } + UML_STORE(block, (void *)m_core->local_regs, I3, I0, SIZE_DWORD, SCALE_x4); } @@ -2662,7 +2060,7 @@ void hyperstone_device::generate_sardi(drcuml_block &block, compiler_state &comp { UML_MOV(block, I7, mem(&m_core->clock_cycles_2)); - uint16_t op = desc->opptr.w[0]; + const uint16_t op = desc->opptr.w[0]; const uint32_t dst_code = (op & 0xf0) >> 4; const uint32_t dstf_code = dst_code + 1; @@ -2696,9 +2094,9 @@ void hyperstone_device::generate_sardi(drcuml_block &block, compiler_state &comp UML_DSAR(block, I2, I2, n); } - UML_DTEST(block, I2, ~0ULL); - UML_MOVc(block, uml::COND_Z, I5, Z_MASK); - UML_MOVc(block, uml::COND_NZ, I5, 0); + UML_DTEST(block, I2, ~uint64_t(0)); + UML_SETc(block, uml::COND_Z, I5); + UML_SHL(block, I5, I5, Z_SHIFT); UML_DROLINS(block, I5, I2, 3, N_MASK); UML_OR(block, DRC_SR, I4, I5); @@ -2712,7 +2110,7 @@ void hyperstone_device::generate_sard(drcuml_block &block, compiler_state &compi { UML_MOV(block, I7, mem(&m_core->clock_cycles_2)); - uint16_t op = desc->opptr.w[0]; + const uint16_t op = desc->opptr.w[0]; const uint32_t src_code = op & 0xf; const uint32_t dst_code = (op & 0xf0) >> 4; @@ -2770,7 +2168,7 @@ void hyperstone_device::generate_sar(drcuml_block &block, compiler_state &compil { UML_MOV(block, I7, mem(&m_core->clock_cycles_1)); - uint16_t op = desc->opptr.w[0]; + const uint16_t op = desc->opptr.w[0]; const uint32_t dst_code = (op & 0xf0) >> 4; const uint32_t src_code = op & 0xf; @@ -2812,7 +2210,7 @@ void hyperstone_device::generate_sari(drcuml_block &block, compiler_state &compi { UML_MOV(block, I7, mem(&m_core->clock_cycles_1)); - uint16_t op = desc->opptr.w[0]; + const uint16_t op = desc->opptr.w[0]; const uint32_t dst_code = (op & 0xf0) >> 4; @@ -2840,30 +2238,17 @@ void hyperstone_device::generate_sari(drcuml_block &block, compiler_state &compi UML_SAR(block, I0, I0, n); } - UML_TEST(block, I0, ~0); - UML_MOVc(block, uml::COND_Z, I3, Z_MASK); - UML_MOVc(block, uml::COND_NZ, I3, 0); + UML_TEST(block, I0, ~uint32_t(0)); + UML_SETc(block, uml::COND_Z, I3); + UML_SHL(block, I3, I3, Z_SHIFT); UML_OR(block, I2, I2, I3); UML_ROLINS(block, I2, I0, 3, N_MASK); UML_ROLINS(block, DRC_SR, I2, 0, (C_MASK | Z_MASK | N_MASK)); if (DST_GLOBAL) - { - if (dst_code < 2) - { - UML_MOV(block, I4, dst_code); - UML_MOV(block, I5, I0); - generate_set_global_register(block, compiler, desc); - } - else - { - UML_STORE(block, (void *)m_core->global_regs, dst_code, I0, SIZE_DWORD, SCALE_x4); - } - } + generate_set_global_register_low(block, compiler, dst_code, uml::I0); else - { UML_STORE(block, (void *)m_core->local_regs, I1, I0, SIZE_DWORD, SCALE_x4); - } } @@ -2872,7 +2257,7 @@ void hyperstone_device::generate_shldi(drcuml_block &block, compiler_state &comp { UML_MOV(block, I7, mem(&m_core->clock_cycles_2)); - uint16_t op = desc->opptr.w[0]; + const uint16_t op = desc->opptr.w[0]; const uint32_t dst_code = (op & 0xf0) >> 4; const uint32_t dstf_code = dst_code + 1; @@ -2919,9 +2304,9 @@ void hyperstone_device::generate_shldi(drcuml_block &block, compiler_state &comp UML_OR(block, I4, I4, V_MASK); UML_LABEL(block, no_overflow); - UML_DTEST(block, I0, ~0ULL); - UML_MOVc(block, uml::COND_Z, I1, Z_MASK); - UML_MOVc(block, uml::COND_NZ, I1, 0); + UML_DTEST(block, I0, ~uint64_t(0)); + UML_SETc(block, uml::COND_Z, I1); + UML_SHL(block, I1, I1, Z_SHIFT); UML_DROLINS(block, I1, I0, 3, N_MASK); UML_OR(block, I1, I1, I4); UML_ROLINS(block, DRC_SR, I1, 0, (N_MASK | Z_MASK | V_MASK)); @@ -2936,7 +2321,7 @@ void hyperstone_device::generate_shld(drcuml_block &block, compiler_state &compi { UML_MOV(block, I7, mem(&m_core->clock_cycles_2)); - uint16_t op = desc->opptr.w[0]; + const uint16_t op = desc->opptr.w[0]; const uint32_t src_code = op & 0xf; const uint32_t dst_code = (op & 0xf0) >> 4; @@ -2992,9 +2377,9 @@ void hyperstone_device::generate_shld(drcuml_block &block, compiler_state &compi UML_OR(block, I4, I4, V_MASK); UML_LABEL(block, no_overflow); - UML_DTEST(block, I0, ~0ULL); - UML_MOVc(block, uml::COND_Z, I1, Z_MASK); - UML_MOVc(block, uml::COND_NZ, I1, 0); + UML_DTEST(block, I0, ~uint64_t(0)); + UML_SETc(block, uml::COND_Z, I1); + UML_SHL(block, I1, I1, Z_SHIFT); UML_DROLINS(block, I1, I0, 3, N_MASK); UML_OR(block, I1, I1, I4); UML_ROLINS(block, DRC_SR, I1, 0, (N_MASK | Z_MASK | V_MASK)); @@ -3009,7 +2394,7 @@ void hyperstone_device::generate_shl(drcuml_block &block, compiler_state &compil { UML_MOV(block, I7, mem(&m_core->clock_cycles_1)); - uint16_t op = desc->opptr.w[0]; + const uint16_t op = desc->opptr.w[0]; const uint32_t dst_code = (op & 0xf0) >> 4; const uint32_t src_code = op & 0xf; @@ -3057,9 +2442,9 @@ void hyperstone_device::generate_shl(drcuml_block &block, compiler_state &compil UML_OR(block, I6, I6, V_MASK); UML_LABEL(block, done_shift); - UML_TEST(block, I0, ~0); - UML_MOVc(block, uml::COND_Z, I5, Z_MASK); - UML_MOVc(block, uml::COND_NZ, I5, 0); + UML_TEST(block, I0, ~uint32_t(0)); + UML_SETc(block, uml::COND_Z, I5); + UML_SHL(block, I5, I5, Z_SHIFT); UML_ROLINS(block, I5, I0, 3, N_MASK); UML_OR(block, DRC_SR, I5, I6); @@ -3072,7 +2457,7 @@ void hyperstone_device::generate_shli(drcuml_block &block, compiler_state &compi { UML_MOV(block, I7, mem(&m_core->clock_cycles_1)); - uint16_t op = desc->opptr.w[0]; + const uint16_t op = desc->opptr.w[0]; const uint32_t dst_code = (op & 0xf0) >> 4; @@ -3124,28 +2509,16 @@ void hyperstone_device::generate_shli(drcuml_block &block, compiler_state &compi UML_OR(block, I1, I1, V_MASK); UML_LABEL(block, done_v); - UML_TEST(block, I5, ~0); - UML_MOVc(block, uml::COND_Z, I2, Z_MASK); - UML_MOVc(block, uml::COND_NZ, I2, 0); + UML_TEST(block, I5, ~uint32_t(0)); + UML_SETc(block, uml::COND_Z, I2); + UML_SHL(block, I2, I2, Z_SHIFT); UML_ROLINS(block, I2, I5, 3, N_MASK); UML_OR(block, DRC_SR, I1, I2); if (DST_GLOBAL) - { - if (dst_code < 2) - { - UML_MOV(block, I4, dst_code); - generate_set_global_register(block, compiler, desc); - } - else - { - UML_STORE(block, (void *)m_core->global_regs, dst_code, I5, SIZE_DWORD, SCALE_x4); - } - } + generate_set_global_register_low(block, compiler, dst_code, uml::I5); else - { UML_STORE(block, (void *)m_core->local_regs, I6, I5, SIZE_DWORD, SCALE_x4); - } } @@ -3153,7 +2526,7 @@ void hyperstone_device::generate_testlz(drcuml_block &block, compiler_state &com { UML_MOV(block, I7, mem(&m_core->clock_cycles_2)); - uint16_t op = desc->opptr.w[0]; + const uint16_t op = desc->opptr.w[0]; const uint32_t dst_code = (op & 0xf0) >> 4; const uint32_t src_code = op & 0xf; @@ -3177,7 +2550,7 @@ void hyperstone_device::generate_rol(drcuml_block &block, compiler_state &compil { UML_MOV(block, I7, mem(&m_core->clock_cycles_1)); - uint16_t op = desc->opptr.w[0]; + const uint16_t op = desc->opptr.w[0]; const uint32_t dst_code = (op & 0xf0) >> 4; const uint32_t src_code = op & 0xf; @@ -3219,9 +2592,9 @@ void hyperstone_device::generate_rol(drcuml_block &block, compiler_state &compil UML_OR(block, I6, I6, V_MASK); UML_LABEL(block, done_shift); - UML_TEST(block, I2, ~0); - UML_MOVc(block, uml::COND_Z, I5, Z_MASK); - UML_MOVc(block, uml::COND_NZ, I5, 0); + UML_TEST(block, I2, ~uint32_t(0)); + UML_SETc(block, uml::COND_Z, I5); + UML_SHL(block, I5, I5, Z_SHIFT); UML_ROLINS(block, I5, I2, 3, N_MASK); UML_OR(block, I5, I5, I6); @@ -3289,12 +2662,11 @@ void hyperstone_device::generate_ldxx1(drcuml_block &block, compiler_state &comp UML_MOV(block, I7, mem(&m_core->clock_cycles_1)); UML_ADD(block, I0, I4, extra_s); UML_CALLH(block, *m_mem_read8); - UML_SEXT(block, I5, I1, SIZE_BYTE); + UML_SEXT(block, I1, I1, SIZE_BYTE); if (SRC_GLOBAL) { - UML_MOV(block, I4, src_code); - generate_set_global_register(block, compiler, desc); + generate_set_global_register_low(block, compiler, src_code, uml::I1); if (src_code == PC_REGISTER) generate_branch(block, desc->targetpc, desc); } @@ -3302,7 +2674,7 @@ void hyperstone_device::generate_ldxx1(drcuml_block &block, compiler_state &comp { UML_ADD(block, I2, I3, src_code); UML_AND(block, I2, I2, 0x3f); - UML_STORE(block, (void *)m_core->local_regs, I2, I5, SIZE_DWORD, SCALE_x4); + UML_STORE(block, (void *)m_core->local_regs, I2, I1, SIZE_DWORD, SCALE_x4); } break; @@ -3313,9 +2685,7 @@ void hyperstone_device::generate_ldxx1(drcuml_block &block, compiler_state &comp if (SRC_GLOBAL) { - UML_MOV(block, I4, src_code); - UML_MOV(block, I5, I1); - generate_set_global_register(block, compiler, desc); + generate_set_global_register_low(block, compiler, src_code, uml::I1); if (src_code == PC_REGISTER) generate_branch(block, desc->targetpc, desc); } @@ -3332,17 +2702,12 @@ void hyperstone_device::generate_ldxx1(drcuml_block &block, compiler_state &comp UML_ADD(block, I0, I4, extra_s & ~1); UML_AND(block, I0, I0, ~1); UML_CALLH(block, *m_mem_read16); + if (extra_s & 1) // LDHS.A + UML_SEXT(block, I1, I1, SIZE_WORD); if (SRC_GLOBAL) { - UML_MOV(block, I4, src_code); - if (extra_s & 1) // LDHS.A - UML_SEXT(block, I5, I1, SIZE_WORD); - else // LDHU.A - UML_MOV(block, I5, I1); - - generate_set_global_register(block, compiler, desc); - + generate_set_global_register_low(block, compiler, src_code, uml::I1); if (src_code == 0) generate_branch(block, desc->targetpc, desc); } @@ -3350,15 +2715,7 @@ void hyperstone_device::generate_ldxx1(drcuml_block &block, compiler_state &comp { UML_ADD(block, I2, I3, src_code); UML_AND(block, I2, I2, 0x3f); - if (extra_s & 1) - { - UML_SEXT(block, I5, I1, SIZE_WORD); - UML_STORE(block, (void *)m_core->local_regs, I2, I5, SIZE_DWORD, SCALE_x4); - } - else - { - UML_STORE(block, (void *)m_core->local_regs, I2, I1, SIZE_DWORD, SCALE_x4); - } + UML_STORE(block, (void *)m_core->local_regs, I2, I1, SIZE_DWORD, SCALE_x4); } break; @@ -3376,9 +2733,7 @@ void hyperstone_device::generate_ldxx1(drcuml_block &block, compiler_state &comp if (SRC_GLOBAL) { - UML_MOV(block, I5, I1); - UML_MOV(block, I4, src_code); - generate_set_global_register(block, compiler, desc); + generate_set_global_register_low(block, compiler, src_code, uml::I1); if (src_code == PC_REGISTER) generate_branch(block, desc->targetpc, desc); } @@ -3395,9 +2750,7 @@ void hyperstone_device::generate_ldxx1(drcuml_block &block, compiler_state &comp if (SRC_GLOBAL) { - UML_MOV(block, I5, I1); - UML_MOV(block, I4, src_code); - generate_set_global_register(block, compiler, desc); + generate_set_global_register_low(block, compiler, src_code, uml::I1); if (src_code == PC_REGISTER) generate_branch(block, desc->targetpc, desc); } @@ -3431,9 +2784,7 @@ void hyperstone_device::generate_ldxx1(drcuml_block &block, compiler_state &comp if (SRC_GLOBAL) { - UML_MOV(block, I5, I1); - UML_MOV(block, I4, src_code); - generate_set_global_register(block, compiler, desc); + generate_set_global_register_low(block, compiler, src_code, uml::I1); if (src_code == 0) generate_branch(block, desc->targetpc, desc); } @@ -3452,9 +2803,7 @@ void hyperstone_device::generate_ldxx1(drcuml_block &block, compiler_state &comp if (SRC_GLOBAL) { - UML_MOV(block, I5, I1); - UML_MOV(block, I4, src_code); - generate_set_global_register(block, compiler, desc); + generate_set_global_register_low(block, compiler, src_code, uml::I1); if (src_code == PC_REGISTER) generate_branch(block, desc->targetpc, desc); } @@ -3526,7 +2875,7 @@ void hyperstone_device::generate_ldxx2(drcuml_block &block, compiler_state &comp if (DST_GLOBAL && dst_code < 2) { - printf("Denoted PC or SR in hyperstone_ldxx2. PC = %08X\n", desc->pc); + osd_printf_error("Denoted PC or SR in hyperstone_ldxx2. PC = %08X\n", desc->pc); return; } @@ -3555,34 +2904,30 @@ void hyperstone_device::generate_ldxx2(drcuml_block &block, compiler_state &comp { UML_MOV(block, I0, I6); UML_CALLH(block, *m_mem_read8); - UML_SEXT(block, I5, I1, SIZE_BYTE); + UML_SEXT(block, I1, I1, SIZE_BYTE); } else if (sub_type == 2) { UML_AND(block, I0, I6, ~1); UML_CALLH(block, *m_mem_read16); if (extra_s & 1) - UML_SEXT(block, I5, I1, SIZE_WORD); - else - UML_MOV(block, I5, I1); + UML_SEXT(block, I1, I1, SIZE_WORD); } else { UML_MOV(block, I0, I6); UML_CALLH(block, *m_mem_read8); - UML_MOV(block, I5, I1); } if (SRC_GLOBAL) { - UML_MOV(block, I4, src_code); - generate_set_global_register(block, compiler, desc); + generate_set_global_register_low(block, compiler, src_code, uml::I1); } else { UML_ADD(block, I2, I3, src_code); - UML_AND(block, I4, I2, 0x3f); - UML_STORE(block, (void *)m_core->local_regs, I4, I5, SIZE_DWORD, SCALE_x4); + UML_AND(block, I2, I2, 0x3f); + UML_STORE(block, (void *)m_core->local_regs, I2, I1, SIZE_DWORD, SCALE_x4); } if (DST_GLOBAL != SRC_GLOBAL || src_code != dst_code) @@ -3599,8 +2944,8 @@ void hyperstone_device::generate_ldxx2(drcuml_block &block, compiler_state &comp else { UML_ADD(block, I2, I3, dst_code); - UML_AND(block, I5, I2, 0x3f); - UML_STORE(block, (void *)m_core->local_regs, I5, I4, SIZE_DWORD, SCALE_x4); + UML_AND(block, I2, I2, 0x3f); + UML_STORE(block, (void *)m_core->local_regs, I2, I4, SIZE_DWORD, SCALE_x4); } } break; @@ -3616,9 +2961,7 @@ void hyperstone_device::generate_ldxx2(drcuml_block &block, compiler_state &comp if (SRC_GLOBAL) { - UML_MOV(block, I4, src_code); - UML_MOV(block, I5, I1); - generate_set_global_register(block, compiler, desc); + generate_set_global_register_low(block, compiler, src_code, uml::I1); } else { @@ -3652,14 +2995,12 @@ void hyperstone_device::generate_ldxx2(drcuml_block &block, compiler_state &comp if (SRC_GLOBAL) { - UML_MOV(block, I4, src_code); - UML_MOV(block, I5, I1); - generate_set_global_register(block, compiler, desc); + generate_set_global_register_low(block, compiler, src_code, uml::I1); UML_ADD(block, I0, I0, 4); UML_CALLH(block, *m_mem_read32); - UML_MOV(block, I4, src_code); + UML_MOV(block, I4, srcf_code); UML_MOV(block, I5, I1); generate_set_global_register(block, compiler, desc); } @@ -3695,7 +3036,7 @@ void hyperstone_device::generate_ldxx2(drcuml_block &block, compiler_state &comp break; } case 2: // Reserved - printf("Reserved instruction in generate_ldxx2. PC = %08X\n", desc->pc); + osd_printf_error("Reserved instruction in generate_ldxx2. PC = %08X\n", desc->pc); break; case 3: // LDW.S { @@ -3720,9 +3061,7 @@ void hyperstone_device::generate_ldxx2(drcuml_block &block, compiler_state &comp if (SRC_GLOBAL) { - UML_MOV(block, I4, src_code); - UML_MOV(block, I5, I1); - generate_set_global_register(block, compiler, desc); + generate_set_global_register_low(block, compiler, src_code, uml::I1); } else { @@ -3947,7 +3286,7 @@ void hyperstone_device::generate_stxx2(drcuml_block &block, compiler_state &comp if (DST_GLOBAL && dst_code < 2) { - printf("Denoted PC or SR in hyperstone_ldxx2. PC = %08X\n", desc->pc); + osd_printf_error("Denoted PC or SR in hyperstone_ldxx2. PC = %08X\n", desc->pc); UML_MOV(block, I7, mem(&m_core->clock_cycles_1)); return; } @@ -4049,7 +3388,7 @@ void hyperstone_device::generate_stxx2(drcuml_block &block, compiler_state &comp UML_CALLH(block, *m_mem_write32); break; case 2: // Reserved - printf("Executed Reserved instruction in hyperstone_stxx2. PC = %08X\n", desc->pc); + osd_printf_error("Executed Reserved instruction in hyperstone_stxx2. PC = %08X\n", desc->pc); break; case 3: // STW.S { @@ -4089,7 +3428,7 @@ void hyperstone_device::generate_mulsu(drcuml_block &block, compiler_state &comp { UML_MOV(block, I7, mem(&m_core->clock_cycles_36)); - uint16_t op = desc->opptr.w[0]; + const uint16_t op = desc->opptr.w[0]; const uint32_t dst_code = (op & 0xf0) >> 4; const uint32_t dstf_code = dst_code + 1; @@ -4097,7 +3436,7 @@ void hyperstone_device::generate_mulsu(drcuml_block &block, compiler_state &comp if ((SRC_GLOBAL && src_code < 2) || (DST_GLOBAL && dst_code < 2)) { - printf("Denoted PC or SR in hyperstone_muls/u instruction. PC = %08X\n", desc->pc); + osd_printf_error("Denoted PC or SR in hyperstone_muls/u instruction. PC = %08X\n", desc->pc); return; } @@ -4130,9 +3469,9 @@ void hyperstone_device::generate_mulsu(drcuml_block &block, compiler_state &comp UML_MULU(block, I4, I5, I0, I1); UML_OR(block, I2, I4, I5); - UML_TEST(block, I2, ~0); - UML_MOVc(block, uml::COND_NZ, I2, 0); - UML_MOVc(block, uml::COND_Z, I2, Z_MASK); + UML_TEST(block, I2, ~uint32_t(0)); + UML_SETc(block, uml::COND_Z, I2); + UML_SHL(block, I2, I2, Z_SHIFT); UML_ROLINS(block, I2, I5, 3, N_MASK); UML_ROLINS(block, DRC_SR, I2, 0, (N_MASK | Z_MASK)); @@ -4187,7 +3526,7 @@ void hyperstone_device::generate_mul(drcuml_block &block, compiler_state &compil if ((SRC_GLOBAL && src_code < 2) || (DST_GLOBAL && dst_code < 2)) { - printf("Denoted PC or SR in hyperstone_mul instruction. PC = %08X\n", desc->pc); + osd_printf_error("Denoted PC or SR in hyperstone_mul instruction. PC = %08X\n", desc->pc); return; } @@ -4215,9 +3554,9 @@ void hyperstone_device::generate_mul(drcuml_block &block, compiler_state &compil UML_MULU(block, I2, I3, I0, I1); UML_AND(block, I4, DRC_SR, ~(Z_MASK | N_MASK)); - UML_TEST(block, I2, ~0); - UML_MOVc(block, uml::COND_Z, I5, Z_MASK); - UML_MOVc(block, uml::COND_NZ, I5, 0); + UML_TEST(block, I2, ~uint32_t(0)); + UML_SETc(block, uml::COND_Z, I5); + UML_SHL(block, I5, I5, Z_SHIFT); UML_ROLINS(block, I5, I2, 3, N_MASK); UML_ROLINS(block, DRC_SR, I5, 0, (Z_MASK | N_MASK)); @@ -4279,7 +3618,7 @@ void hyperstone_device::generate_set(drcuml_block &block, compiler_state &compil } else { - printf("Used reserved N value (%d) in hyperstone_set. PC = %08X\n", n, desc->pc); + osd_printf_error("Used reserved N value (%d) in hyperstone_set. PC = %08X\n", n, desc->pc); return; } } @@ -4311,7 +3650,7 @@ void hyperstone_device::generate_set(drcuml_block &block, compiler_state &compil } else { - printf("Used reserved N value (%d) in hyperstone_set. PC = %08X\n", n, desc->pc); + osd_printf_error("Used reserved N value (%d) in hyperstone_set. PC = %08X\n", n, desc->pc); return; } } @@ -4351,20 +3690,9 @@ void hyperstone_device::generate_ldwr(drcuml_block &block, compiler_state &compi if (SRC_GLOBAL) { - if (src_code < 2) - { - UML_MOV(block, I4, src_code); - UML_MOV(block, I5, I1); - generate_set_global_register(block, compiler, desc); - if (src_code == PC_REGISTER) - { - generate_branch(block, desc->targetpc, desc); - } - } - else - { - UML_STORE(block, (void *)m_core->global_regs, src_code, I1, SIZE_DWORD, SCALE_x4); - } + generate_set_global_register_low(block, compiler, src_code, uml::I1); + if (src_code == PC_REGISTER) + generate_branch(block, desc->targetpc, desc); } else { @@ -4380,7 +3708,7 @@ void hyperstone_device::generate_lddr(drcuml_block &block, compiler_state &compi { UML_MOV(block, I7, mem(&m_core->clock_cycles_2)); - uint16_t op = desc->opptr.w[0]; + const uint16_t op = desc->opptr.w[0]; generate_check_delay_pc(block, compiler, desc); @@ -4396,9 +3724,7 @@ void hyperstone_device::generate_lddr(drcuml_block &block, compiler_state &compi if (SRC_GLOBAL) { - UML_MOV(block, I4, src_code); - UML_MOV(block, I5, I1); - generate_set_global_register(block, compiler, desc); + generate_set_global_register_low(block, compiler, src_code, uml::I1); UML_ADD(block, I0, I0, 4); UML_CALLH(block, *m_mem_read32); @@ -4446,9 +3772,7 @@ void hyperstone_device::generate_ldwp(drcuml_block &block, compiler_state &compi if (SRC_GLOBAL) { - UML_MOV(block, I4, src_code); - UML_MOV(block, I5, I1); - generate_set_global_register(block, compiler, desc); + generate_set_global_register_low(block, compiler, src_code, uml::I1); UML_ROLAND(block, I0, DRC_SR, 7, 0x7f); UML_ADD(block, I1, I0, dst_code); @@ -4501,9 +3825,7 @@ void hyperstone_device::generate_lddp(drcuml_block &block, compiler_state &compi if (SRC_GLOBAL) { - UML_MOV(block, I4, src_code); - UML_MOV(block, I5, I2); - generate_set_global_register(block, compiler, desc); + generate_set_global_register_low(block, compiler, src_code, uml::I2); UML_MOV(block, I4, src_code + 1); UML_MOV(block, I5, I1); generate_set_global_register(block, compiler, desc); @@ -4755,10 +4077,11 @@ void hyperstone_device::generate_br(drcuml_block &block, compiler_state &compile { UML_MOV(block, I7, mem(&m_core->clock_cycles_2)); - generate_decode_pcrel(block, desc); + const uint32_t target = generate_get_pcrel(block, desc); + generate_check_delay_pc(block, compiler, desc); - UML_ADD(block, DRC_PC, DRC_PC, I1); + UML_ADD(block, DRC_PC, DRC_PC, target); UML_AND(block, DRC_SR, DRC_SR, ~M_MASK); generate_branch(block, desc->targetpc, desc); @@ -4795,11 +4118,12 @@ void hyperstone_device::generate_dbr(drcuml_block &block, compiler_state &compil { UML_MOV(block, I7, mem(&m_core->clock_cycles_2)); - generate_decode_pcrel(block, desc); + const uint32_t target = generate_get_pcrel(block, desc); + generate_check_delay_pc(block, compiler, desc); UML_MOV(block, mem(&m_core->delay_slot), 1); - UML_ADD(block, mem(&m_core->delay_pc), DRC_PC, I1); + UML_ADD(block, mem(&m_core->delay_pc), DRC_PC, target); UML_MOV(block, mem(&m_core->intblock), 3); } @@ -4867,7 +4191,7 @@ void hyperstone_device::generate_call(drcuml_block &block, compiler_state &compi UML_MOV(block, I7, mem(&m_core->clock_cycles_1)); UML_ROLINS(block, DRC_SR, ((desc->length >> 1) << ILC_SHIFT), 0, ILC_MASK); - uint16_t op = desc->opptr.w[0]; + const uint16_t op = desc->opptr.w[0]; uint16_t imm_1 = m_pr16(desc->pc + 2); int32_t extra_s = 0; @@ -4956,7 +4280,7 @@ void hyperstone_device::generate_trap_op(drcuml_block &block, compiler_state &co false, false, false, false, true, false, true, false, true, false, true, false, true, false, true, false }; - uint16_t op = desc->opptr.w[0]; + const uint16_t op = desc->opptr.w[0]; generate_check_delay_pc(block, compiler, desc); @@ -4972,8 +4296,7 @@ void hyperstone_device::generate_trap_op(drcuml_block &block, compiler_state &co UML_JMPc(block, uml::COND_NZ, skip_trap); UML_ROLINS(block, DRC_SR, ((desc->length >> 1) << ILC_SHIFT), 0, ILC_MASK); - generate_get_trap_addr(block, compiler.m_labelnum, trapno); - generate_trap_exception_or_int(block); + generate_trap_exception_or_int(block, compiler.m_labelnum, trapno); UML_LABEL(block, skip_trap); } @@ -4982,7 +4305,7 @@ void hyperstone_device::generate_extend(drcuml_block &block, compiler_state &com { UML_MOV(block, I7, mem(&m_core->clock_cycles_1)); - uint16_t op = desc->opptr.w[0]; + const uint16_t op = desc->opptr.w[0]; uint16_t func = m_pr16(desc->pc + 2); UML_ADD(block, DRC_PC, DRC_PC, 2); @@ -5077,7 +4400,7 @@ void hyperstone_device::generate_extend(drcuml_block &block, compiler_state &com // signed half-word multiply/add, double word product sum case EHMACD: { - printf("Unimplemented extended opcode, EHMACD, PC = %08x\n", desc->pc); + osd_printf_error("Unimplemented extended opcode, EHMACD, PC = %08x\n", desc->pc); fatalerror(" "); break; } @@ -5085,7 +4408,7 @@ void hyperstone_device::generate_extend(drcuml_block &block, compiler_state &com // half-word complex multiply case EHCMULD: { - printf("Unimplemented extended opcode, EHCMULD, PC = %08x\n", desc->pc); + osd_printf_error("Unimplemented extended opcode, EHCMULD, PC = %08x\n", desc->pc); fatalerror(" "); break; } @@ -5093,7 +4416,7 @@ void hyperstone_device::generate_extend(drcuml_block &block, compiler_state &com // half-word complex multiply/add case EHCMACD: { - printf("Unimplemented extended opcode, EHCMACD, PC = %08x\n", desc->pc); + osd_printf_error("Unimplemented extended opcode, EHCMACD, PC = %08x\n", desc->pc); fatalerror(" "); break; } @@ -5102,7 +4425,7 @@ void hyperstone_device::generate_extend(drcuml_block &block, compiler_state &com // Ls is not used and should denote the same register as Ld case EHCSUMD: { - printf("Unimplemented extended opcode, EHCSUMD, PC = %08x\n", desc->pc); + osd_printf_error("Unimplemented extended opcode, EHCSUMD, PC = %08x\n", desc->pc); fatalerror(" "); break; } @@ -5111,7 +4434,7 @@ void hyperstone_device::generate_extend(drcuml_block &block, compiler_state &com // Ls is not used and should denote the same register as Ld case EHCFFTD: { - printf("Unimplemented extended opcode, EHCFFTD, PC = %08x\n", desc->pc); + osd_printf_error("Unimplemented extended opcode, EHCFFTD, PC = %08x\n", desc->pc); fatalerror(" "); break; } @@ -5120,13 +4443,13 @@ void hyperstone_device::generate_extend(drcuml_block &block, compiler_state &com // Ls is not used and should denote the same register as Ld case EHCFFTSD: { - printf("Unimplemented extended opcode, EHCFFTSD, PC = %08x\n", desc->pc); + osd_printf_error("Unimplemented extended opcode, EHCFFTSD, PC = %08x\n", desc->pc); fatalerror(" "); break; } default: - printf("Unknown extended opcode (%04x), PC = %08x\n", func, desc->pc); + osd_printf_error("Unknown extended opcode (%04x), PC = %08x\n", func, desc->pc); fatalerror(" "); break; } @@ -5135,14 +4458,14 @@ void hyperstone_device::generate_extend(drcuml_block &block, compiler_state &com void hyperstone_device::generate_reserved(drcuml_block &block, compiler_state &compiler, const opcode_desc *desc) { - printf("Unimplemented: generate_reserved (%08x)\n", desc->pc); + osd_printf_error("Unimplemented: generate_reserved (%08x)\n", desc->pc); fflush(stdout); fatalerror(" "); } void hyperstone_device::generate_do(drcuml_block &block, compiler_state &compiler, const opcode_desc *desc) { - printf("Unimplemented: generate_do (%08x)\n", desc->pc); + osd_printf_error("Unimplemented: generate_do (%08x)\n", desc->pc); fflush(stdout); fatalerror(" "); } diff --git a/src/devices/cpu/m16c/m16cdasm.cpp b/src/devices/cpu/m16c/m16cdasm.cpp index 00972ca24fce8..6af0d0abf80f3 100644 --- a/src/devices/cpu/m16c/m16cdasm.cpp +++ b/src/devices/cpu/m16c/m16cdasm.cpp @@ -1189,6 +1189,7 @@ offs_t m16c_disassembler::disassemble(std::ostream &stream, offs_t pc, const m16 else util::stream_format(stream, "%-8s#%d, ", BIT(op1, 0) ? "sbjnz.w" : "sbjnz.b", op2 & 0x07); dasm_ea(stream, pc, opcodes, op2 & 0x0f, BIT(op1, 0)); + stream << ", "; format_label(stream, pc0 + 2 + s8(opcodes.r8(pc))); ++pc; flags |= STEP_COND; diff --git a/src/devices/cpu/m68000/m68kfpu.cpp b/src/devices/cpu/m68000/m68kfpu.cpp index 75839bba69e03..1d16077091c90 100644 --- a/src/devices/cpu/m68000/m68kfpu.cpp +++ b/src/devices/cpu/m68000/m68kfpu.cpp @@ -727,7 +727,7 @@ u64 m68000_musashi_device::READ_EA_64(int ea) return 0; } -extFloat80_t m68000_musashi_device::READ_EA_FPE(int mode, int reg, uint32_t di_mode_ea) +extFloat80_t m68000_musashi_device::READ_EA_FPE(int mode, int reg, uint32_t offset) { extFloat80_t fpr; @@ -736,7 +736,7 @@ extFloat80_t m68000_musashi_device::READ_EA_FPE(int mode, int reg, uint32_t di_m case 2: // (An) { u32 ea = REG_A()[reg]; - fpr = load_extended_float80(ea); + fpr = load_extended_float80(ea + offset); break; } @@ -756,14 +756,20 @@ extFloat80_t m68000_musashi_device::READ_EA_FPE(int mode, int reg, uint32_t di_m } case 5: // (d16, An) { - fpr = load_extended_float80(di_mode_ea); + u32 ea = REG_A()[reg]; + fpr = load_extended_float80(ea + offset); break; } +#if 0 + // FIXME: this addressing mode is broken, and fixing it so it works properly + // for FMOVEM is quite challenging; disabling it for now. case 6: // (An) + (Xn) + d8 { - fpr = load_extended_float80(di_mode_ea); + u32 ea = REG_A()[reg]; + fpr = load_extended_float80(ea + offset); break; } +#endif case 7: // extended modes { @@ -1147,22 +1153,20 @@ void m68000_musashi_device::WRITE_EA_64(int ea, u64 data) } } -void m68000_musashi_device::WRITE_EA_FPE(int mode, int reg, extFloat80_t fpr, uint32_t di_mode_ea) +void m68000_musashi_device::WRITE_EA_FPE(int mode, int reg, extFloat80_t fpr, uint32_t offset) { switch (mode) { case 2: // (An) { - u32 ea; - ea = REG_A()[reg]; - store_extended_float80(ea, fpr); + u32 ea = REG_A()[reg]; + store_extended_float80(ea + offset, fpr); break; } case 3: // (An)+ { - u32 ea; - ea = REG_A()[reg]; + u32 ea = REG_A()[reg]; store_extended_float80(ea, fpr); REG_A()[reg] += 12; break; @@ -1170,18 +1174,16 @@ void m68000_musashi_device::WRITE_EA_FPE(int mode, int reg, extFloat80_t fpr, ui case 4: // -(An) { - u32 ea; REG_A()[reg] -= 12; - ea = REG_A()[reg]; + u32 ea = REG_A()[reg]; store_extended_float80(ea, fpr); break; } case 5: // (d16,An) { - // EA_AY_DI_32() should not be done here because fmovem would increase - // PC each time, reading incorrect displacement & advancing PC too much. - store_extended_float80(di_mode_ea, fpr); + u32 ea = REG_A()[reg]; + store_extended_float80(ea + offset, fpr); break; } @@ -1272,8 +1274,8 @@ void m68000_musashi_device::fpgen_rm_reg(u16 w2) { int imode = (ea >> 3) & 0x7; int reg = (ea & 0x7); - uint32_t di_mode_ea = imode == 5 ? (REG_A()[reg] + MAKE_INT_16(m68ki_read_imm_16())) : 0; - source = READ_EA_FPE(imode, reg, di_mode_ea); + uint32_t offset = (imode == 5) ? MAKE_INT_16(m68ki_read_imm_16()) : 0; + source = READ_EA_FPE(imode, reg, offset); break; } case 3: // Packed-decimal Real @@ -1810,9 +1812,9 @@ void m68000_musashi_device::fmove_reg_mem(u16 w2) { int mode = (ea >> 3) & 0x7; int reg = (ea & 0x7); - uint32_t di_mode_ea = mode == 5 ? (REG_A()[reg] + MAKE_INT_16(m68ki_read_imm_16())) : 0; + uint32_t offset = (mode == 5) ? MAKE_INT_16(m68ki_read_imm_16()) : 0; - WRITE_EA_FPE(mode, reg, m_fpr[src], di_mode_ea); + WRITE_EA_FPE(mode, reg, m_fpr[src], offset); break; } case 3: // Packed-decimal Real with Static K-factor @@ -2052,11 +2054,10 @@ void m68000_musashi_device::fmovem(u16 w2) { switch (mode) { - case 1: // Dynamic register list, postincrement or control addressing mode. - // FIXME: not really tested, but seems to work + case 1: // dynamic register list, predecrement addressing mode reglist = REG_D()[(reglist >> 4) & 7]; [[fallthrough]]; - case 0: // Static register list, predecrement or control addressing mode + case 0: // static register list, predecrement addressing mode { // the "di_mode_ea" parameter kludge is required here else WRITE_EA_FPE would have // to call EA_AY_DI_32() (that advances PC & reads displacement) each time @@ -2064,18 +2065,14 @@ void m68000_musashi_device::fmovem(u16 w2) // this forces to pre-read the mode (named "imode") so we can decide to read displacement, only once int imode = (ea >> 3) & 0x7; int reg = (ea & 0x7); - int di_mode = imode == 5; - uint32_t di_mode_ea = di_mode ? (REG_A()[reg] + MAKE_INT_16(m68ki_read_imm_16())) : 0; + uint32_t offset = (imode == 5) ? MAKE_INT_16(m68ki_read_imm_16()) : 0; for (i=0; i < 8; i++) { if (reglist & (1 << i)) { - WRITE_EA_FPE(imode, reg, m_fpr[i], di_mode_ea); - if (di_mode) - { - di_mode_ea += 12; - } + WRITE_EA_FPE(imode, reg, m_fpr[i], offset); + offset += 12; m_icount -= 2; } @@ -2083,27 +2080,21 @@ void m68000_musashi_device::fmovem(u16 w2) break; } - case 3: // Dynamic register list, postincrement or control addressing mode. - // FIXME: not really tested, but seems to work + case 3: // dynamic register list, postincrement or control addressing mode reglist = REG_D()[(reglist >> 4) & 7]; [[fallthrough]]; - case 2: // Static register list, postdecrement or control addressing mode + case 2: // static register list, postincrement or control addressing mode { int imode = (ea >> 3) & 0x7; int reg = (ea & 0x7); - int di_mode = imode == 5; - - uint32_t di_mode_ea = di_mode ? (REG_A()[reg] + MAKE_INT_16(m68ki_read_imm_16())) : 0; + uint32_t offset = (imode == 5) ? MAKE_INT_16(m68ki_read_imm_16()) : 0; for (i=0; i < 8; i++) { if (reglist & (1 << i)) { - WRITE_EA_FPE(imode, reg, m_fpr[7 - i], di_mode_ea); - if (di_mode) - { - di_mode_ea += 12; - } + WRITE_EA_FPE(imode, reg, m_fpr[7 - i], offset); + offset += 12; m_icount -= 2; } @@ -2118,26 +2109,22 @@ void m68000_musashi_device::fmovem(u16 w2) { switch (mode) { - case 3: // Dynamic register list, predecrement addressing mode. + case 3: // dynamic register list, postincrement or control addressing mode // FIXME: not really tested, but seems to work reglist = REG_D()[(reglist >> 4) & 7]; [[fallthrough]]; - case 2: // Static register list, postincrement or control addressing mode + case 2: // static register list, postincrement or control addressing mode { int imode = (ea >> 3) & 0x7; int reg = (ea & 0x7); - int di_mode = imode == 5; - uint32_t di_mode_ea = di_mode ? (REG_A()[reg] + MAKE_INT_16(m68ki_read_imm_16())) : 0; + uint32_t offset = (imode == 5) ? MAKE_INT_16(m68ki_read_imm_16()) : 0; for (i=0; i < 8; i++) { if (reglist & (1 << i)) { - m_fpr[7 - i] = READ_EA_FPE(imode, reg, di_mode_ea); - if (di_mode) - { - di_mode_ea += 12; - } + m_fpr[7 - i] = READ_EA_FPE(imode, reg, offset); + offset += 12; m_icount -= 2; } diff --git a/src/devices/cpu/m68000/m68kmusashi.h b/src/devices/cpu/m68000/m68kmusashi.h index 9ec2bea312ee5..dba8555ae53c6 100644 --- a/src/devices/cpu/m68000/m68kmusashi.h +++ b/src/devices/cpu/m68000/m68kmusashi.h @@ -356,13 +356,13 @@ class m68000_musashi_device : public m68000_base_device u16 READ_EA_16(int ea); u32 READ_EA_32(int ea); u64 READ_EA_64(int ea); - extFloat80_t READ_EA_FPE(int mode, int reg, uint32_t di_mode_ea); + extFloat80_t READ_EA_FPE(int mode, int reg, uint32_t offset); extFloat80_t READ_EA_PACK(int ea); void WRITE_EA_8(int ea, u8 data); void WRITE_EA_16(int ea, u16 data); void WRITE_EA_32(int ea, u32 data); void WRITE_EA_64(int ea, u64 data); - void WRITE_EA_FPE(int mode, int reg, extFloat80_t fpr, uint32_t di_mode_ea); + void WRITE_EA_FPE(int mode, int reg, extFloat80_t fpr, uint32_t offset); void WRITE_EA_PACK(int ea, int k, extFloat80_t fpr); void fpgen_rm_reg(u16 w2); void fmove_reg_mem(u16 w2); diff --git a/src/devices/cpu/mb86233/mb86233.cpp b/src/devices/cpu/mb86233/mb86233.cpp index 6a5451c0095db..28fba63498ece 100644 --- a/src/devices/cpu/mb86233/mb86233.cpp +++ b/src/devices/cpu/mb86233/mb86233.cpp @@ -256,18 +256,6 @@ void mb86233_device::pcs_pop() m_pcs[i] = m_pcs[i+1]; } -void mb86233_device::testdz() -{ - if(m_d) - m_st &= ~F_ZRD; - else - m_st |= F_ZRD; - if(m_d & 0x80000000) - m_st |= F_SGD; - else - m_st &= ~F_SGD; -} - void mb86233_device::stset_set_sz_int(u32 val) { m_alu_stset = val ? (val & 0x80000000 ? F_SGD : 0) : F_ZRD; @@ -324,7 +312,7 @@ void mb86233_device::alu_pre(u32 alu) } case 0x06: { - // fmad + // fadd m_alu_stmask = F_ZRD|F_SGD|F_CPD|F_OVD|F_DVZD; m_alu_r1 = f2u(u2f(m_d) + u2f(m_a)); stset_set_sz_fp(m_alu_r1); @@ -676,9 +664,9 @@ void mb86233_device::write_reg(u32 r, u32 v) case 0x14: m_b = set_exp(m_b, v); break; case 0x15: m_b = set_mant(m_b, v); break; /* c */ - case 0x19: m_d = v; testdz(); break; - case 0x1a: m_d = set_exp(m_d, v); testdz(); break; - case 0x1b: m_d = set_mant(m_d, v); testdz(); break; + case 0x19: m_d = v; break; + case 0x1a: m_d = set_exp(m_d, v); break; + case 0x1b: m_d = set_mant(m_d, v); break; case 0x1c: m_p = v; break; case 0x1d: m_p = set_exp(m_p, v); break; case 0x1e: m_p = set_mant(m_p, v); break; @@ -812,6 +800,7 @@ void mb86233_device::execute_run() u32 v = m_data.read_dword(ea); if(m_stall) goto do_stall; ea_post_0(r1); + alu_post(alu); write_mem_io_1(r2, v); break; } @@ -822,6 +811,7 @@ void mb86233_device::execute_run() u32 v = m_data.read_dword(ea); if(m_stall) goto do_stall; ea_post_0(r1); + alu_post(alu); write_mem_io_1(r2, v); break; } @@ -832,6 +822,7 @@ void mb86233_device::execute_run() u32 v = m_io.read_dword(ea); if(m_stall) goto do_stall; ea_post_0(r1); + alu_post(alu); write_mem_internal_1(r2, v, false); break; } @@ -842,6 +833,7 @@ void mb86233_device::execute_run() u32 v = m_data.read_dword(ea); if(m_stall) goto do_stall; ea_post_0(r1); + alu_post(alu); write_mem_internal_1(r2, v, true); break; } @@ -852,6 +844,7 @@ void mb86233_device::execute_run() u32 v = m_data.read_dword(ea); if(m_stall) goto do_stall; ea_post_0(r1); + alu_post(alu); write_mem_internal_1(r2, v, false); break; } @@ -862,6 +855,7 @@ void mb86233_device::execute_run() u32 v = m_program.read_dword(ea); if(m_stall) goto do_stall; ea_post_0(r1); + alu_post(alu); write_mem_internal_1(r2, v, false); break; } @@ -872,6 +866,7 @@ void mb86233_device::execute_run() // mov reg, mem u32 v = read_reg(r2); if(m_stall) goto do_stall; + alu_post(alu); write_mem_internal_1(r1, v, false); break; } @@ -880,6 +875,7 @@ void mb86233_device::execute_run() // mov reg, mem (e) u32 v = read_reg(r2); if(m_stall) goto do_stall; + alu_post(alu); write_mem_io_1(r1, v); break; } @@ -890,6 +886,7 @@ void mb86233_device::execute_run() u32 v = m_data.read_dword(ea); if(m_stall) goto do_stall; ea_post_1(r1); + alu_post(alu); write_reg(r2, v); break; } @@ -900,6 +897,7 @@ void mb86233_device::execute_run() u32 v = m_data.read_dword(ea); if(m_stall) goto do_stall; ea_post_1(r1); + alu_post(alu); write_reg(r2, v); break; } @@ -910,6 +908,7 @@ void mb86233_device::execute_run() u32 v = m_io.read_dword(ea); if(m_stall) goto do_stall; ea_post_1(r1); + alu_post(alu); write_reg(r2, v); break; } @@ -920,6 +919,7 @@ void mb86233_device::execute_run() u32 v = m_program.read_dword(ea); if(m_stall) goto do_stall; ea_post_0(r1); + alu_post(alu); write_reg(r2, v); break; } @@ -928,11 +928,13 @@ void mb86233_device::execute_run() // mov reg, reg u32 v = read_reg(r1); if(m_stall) goto do_stall; + alu_post(alu); write_reg(r2, v); break; } default: + alu_post(alu); logerror("unhandled ld/mov subop 7/%x (%x)\n", r2 >> 6, m_ppc); break; } @@ -940,11 +942,11 @@ void mb86233_device::execute_run() } default: + alu_post(alu); logerror("unhandled ld/mov subop %x (%x)\n", op, m_ppc); break; } - alu_post(alu); break; } @@ -983,7 +985,6 @@ void mb86233_device::execute_run() break; case 3: m_d = util::sext(opcode, 24); - testdz(); break; } break; diff --git a/src/devices/cpu/mb86233/mb86233.h b/src/devices/cpu/mb86233/mb86233.h index 97f98bced449a..4a72a13720181 100644 --- a/src/devices/cpu/mb86233/mb86233.h +++ b/src/devices/cpu/mb86233/mb86233.h @@ -109,7 +109,6 @@ class mb86233_device : public cpu_device static u32 get_exp(u32 val); static u32 get_mant(u32 val); - void testdz(); void alu_update_st(); void alu_pre(u32 alu); void alu_post(u32 alu); diff --git a/src/devices/cpu/mips/mips1.cpp b/src/devices/cpu/mips/mips1.cpp index 8ba1509b9d317..2316da4b25db6 100644 --- a/src/devices/cpu/mips/mips1.cpp +++ b/src/devices/cpu/mips/mips1.cpp @@ -17,8 +17,6 @@ #include "softfloat3/source/include/softfloat.h" #define LOG_TLB (1U << 1) -#define LOG_IOP (1U << 2) -#define LOG_RISCOS (1U << 3) //#define VERBOSE (LOG_GENERAL|LOG_TLB) @@ -385,24 +383,6 @@ void mips1core_device_base::execute_run() // debugging debugger_instruction_hook(m_pc); - if (VERBOSE & LOG_IOP) - { - if ((m_pc & 0x1fffffff) == 0x00012C48 || (m_pc & 0x1fffffff) == 0x0001420C || (m_pc & 0x1fffffff) == 0x0001430C) - { - u32 ptr = m_r[5]; - u32 length = m_r[6]; - if (length >= 4096) - length = 4095; - while (length) - { - load(ptr, [](char c) { printf("%c", c); }); - ptr++; - length--; - } - fflush(stdout); - } - } - // fetch instruction fetch(m_pc, [this](u32 const op) { @@ -847,154 +827,6 @@ std::unique_ptr mips1core_device_base::create_disassembl void mips1core_device_base::generate_exception(u32 exception, bool refill) { - if ((VERBOSE & LOG_RISCOS) && (exception == EXCEPTION_SYSCALL)) - { - static char const *const sysv_syscalls[] = - { - "syscall", "exit", "fork", "read", "write", "open", "close", "wait", "creat", "link", - "unlink", "execv", "chdir", "time", "mknod", "chmod", "chown", "brk", "stat", "lseek", - "getpid", "mount", "umount", "setuid", "getuid", "stime", "ptrace", "alarm", "fstat", "pause", - "utime", "stty", "gtty", "access", "nice", "statfs", "sync", "kill", "fstatfs", "setpgrp", - nullptr, "dup", "pipe", "times", "profil", "plock", "setgid", "getgid", "signal", "msgsys", - "sysmips", "acct", "shmsys", "semsys", "ioctl", "uadmin", nullptr, "utssys", nullptr, "execve", - "umask", "chroot", "ofcntl", "ulimit", nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, - "advfs", "unadvfs", "rmount", "rumount", "rfstart", nullptr, "rdebug", "rfstop", "rfsys", "rmdir", - "mkdir", "getdents", nullptr, nullptr, "sysfs", "getmsg", "putmsg", "poll", "sigreturn", "accept", - "bind", "connect", "gethostid", "getpeername", "getsockname", "getsockopt", "listen", "recv", "recvfrom", "recvmsg", - "select", "send", "sendmsg", "sendto", "sethostid", "setsockopt", "shutdown", "socket", "gethostname", "sethostname", - "getdomainname","setdomainname","truncate", "ftruncate", "rename", "symlink", "readlink", "lstat", "nfsmount", "nfssvc", - "getfh", "async_daemon", "old_exportfs", "mmap", "munmap", "getitimer", "setitimer", nullptr, nullptr, nullptr, - nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, - nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, - "cacheflush", "cachectl", "fchown", "fchmod", "wait3", "mmap", "munmap", "madvise", "getpagesize", "setreuid", - "setregid", "setpgid", "getgroups", "setgroups", "gettimeofday", "getrusage", "getrlimit", "setrlimit", "exportfs", "fcntl" - }; - - static char const *const bsd_syscalls[] = - { - "syscall", "exit", "fork", "read", "write", "open", "close", nullptr, "creat", "link", - "unlink", "execv", "chdir", nullptr, "mknod", "chmod", "chown", "brk", nullptr, "lseek", - "getpid", "omount", "oumount", nullptr, "getuid", nullptr, "ptrace", nullptr, nullptr, nullptr, - nullptr, nullptr, nullptr, "access", nullptr, nullptr, "sync", "kill", "stat", nullptr, - "lstat", "dup", "pipe", nullptr, "profil", nullptr, nullptr, "getgid", nullptr, nullptr, - nullptr, "acct", nullptr, nullptr, "ioctl", "reboot", nullptr, "symlink", "readlink", "execve", - "umask", "chroot", "fstat", nullptr, "getpagesize", "mremap", "vfork", nullptr, nullptr, "sbrk", - "sstk", "mmap", "vadvise", "munmap", "mprotec", "madvise", "vhangup", nullptr, "mincore", "getgroups", - "setgroups", "getpgrp", "setpgrp", "setitimer", "wait3", "swapon", "getitimer", "gethostname", "sethostname", "getdtablesize", - "dup2", "getdopt", "fcntl", "select", "setdopt", "fsync", "setpriority", "socket", "connect", "accept", - "getpriority", "send", "recv", "sigreturn", "bind", "setsockopt", "listen", nullptr, "sigvec", "sigblock", - "sigsetmask", "sigpause", "sigstack", "recvmsg", "sendmsg", nullptr, "gettimeofday", "getrusage", "getsockopt", nullptr, - "readv", "writev", "settimeofday", "fchown", "fchmod", "recvfrom", "setreuid", "setregid", "rename", "truncate", - "ftruncate", "flock", nullptr, "sendto", "shutdown", "socketpair", "mkdir", "rmdir", "utimes", "sigcleanup", - "adjtime", "getpeername", "gethostid", "sethostid", "getrlimit", "setrlimit", "killpg", nullptr, "setquota", "quota", - "getsockname", "sysmips", "cacheflush", "cachectl", "debug", nullptr, nullptr, nullptr, "nfssvc", "getdirentries", - "statfs", "fstatfs", "unmount", "async_daemon", "getfh", "getdomainname","setdomainname",nullptr, "quotactl", "old_exportfs", - "mount", "hdwconf", "exportfs", "nfsfh_open", "libattach", "libdetach" - }; - - static char const *const msg_syscalls[] = { "msgget", "msgctl", "msgrcv", "msgsnd" }; - static char const *const shm_syscalls[] = { "shmat", "shmctl", "shmdt", "shmget" }; - static char const *const sem_syscalls[] = { "semctl", "semget", "semop" }; - static char const *const mips_syscalls[] = { "mipskopt", "mipshwconf", "mipsgetrusage", "mipswait", "mipscacheflush", "mipscachectl" }; - - unsigned const asid = (m_cop0[COP0_EntryHi] & EH_ASID) >> 6; - switch (m_r[2]) - { - case 1000: // indirect - switch (m_r[4]) - { - case 1049: // msgsys - LOGMASKED(LOG_RISCOS, "asid %d syscall msgsys:%s() (%s)\n", - asid, (m_r[5] < std::size(msg_syscalls)) ? msg_syscalls[m_r[5]] : "unknown", machine().describe_context()); - break; - - case 1052: // shmsys - LOGMASKED(LOG_RISCOS, "asid %d syscall shmsys:%s() (%s)\n", - asid, (m_r[5] < std::size(shm_syscalls)) ? shm_syscalls[m_r[5]] : "unknown", machine().describe_context()); - break; - - case 1053: // semsys - LOGMASKED(LOG_RISCOS, "asid %d syscall semsys:%s() (%s)\n", - asid, (m_r[5] < std::size(sem_syscalls)) ? sem_syscalls[m_r[5]] : "unknown", machine().describe_context()); - break; - - case 2151: // bsd_sysmips - switch (m_r[5]) - { - case 0x100: // mipskopt - LOGMASKED(LOG_RISCOS, "asid %d syscall bsd_sysmips:mipskopt(\"%s\") (%s)\n", - asid, debug_string(m_r[6]), machine().describe_context()); - break; - - default: - if ((m_r[5] > 0x100) && (m_r[5] - 0x100) < std::size(mips_syscalls)) - LOGMASKED(LOG_RISCOS, "asid %d syscall bsd_sysmips:%s() (%s)\n", - asid, mips_syscalls[m_r[5] - 0x100], machine().describe_context()); - else - LOGMASKED(LOG_RISCOS, "asid %d syscall bsd_sysmips:unknown %d (%s)\n", - asid, m_r[5], machine().describe_context()); - break; - } - break; - - default: - if ((m_r[4] > 2000) && (m_r[4] - 2000 < std::size(bsd_syscalls)) && bsd_syscalls[m_r[4] - 2000]) - LOGMASKED(LOG_RISCOS, "asid %d syscall bsd_%s() (%s)\n", - asid, bsd_syscalls[m_r[4] - 2000], machine().describe_context()); - else - LOGMASKED(LOG_RISCOS, "asid %d syscall indirect:unknown %d (%s)\n", - asid, m_r[4], machine().describe_context()); - break; - } - break; - - case 1003: // read - case 1006: // close - case 1054: // ioctl - case 1169: // fcntl - LOGMASKED(LOG_RISCOS, "asid %d syscall %s(%d) (%s)\n", - asid, sysv_syscalls[m_r[2] - 1000], m_r[4], machine().describe_context()); - break; - - case 1004: // write - if (m_r[4] == 1 || m_r[4] == 2) - LOGMASKED(LOG_RISCOS, "asid %d syscall %s(%d, \"%s\") (%s)\n", - asid, sysv_syscalls[m_r[2] - 1000], m_r[4], debug_string(m_r[5], m_r[6]), machine().describe_context()); - else - LOGMASKED(LOG_RISCOS, "asid %d syscall %s(%d) (%s)\n", - asid, sysv_syscalls[m_r[2] - 1000], m_r[4], machine().describe_context()); - break; - - case 1005: // open - case 1008: // creat - case 1009: // link - case 1010: // unlink - case 1012: // chdir - case 1018: // stat - case 1033: // access - LOGMASKED(LOG_RISCOS, "asid %d syscall %s(\"%s\") (%s)\n", - asid, sysv_syscalls[m_r[2] - 1000], debug_string(m_r[4]), machine().describe_context()); - break; - - case 1059: // execve - LOGMASKED(LOG_RISCOS, "asid %d syscall execve(\"%s\", [ %s ], [ %s ]) (%s)\n", - asid, debug_string(m_r[4]), debug_string_array(m_r[5]), debug_string_array(m_r[6]), machine().describe_context()); - break; - - case 1060: // umask - LOGMASKED(LOG_RISCOS, "asid %d syscall umask(%#o) (%s)\n", - asid, m_r[4] & 0777, machine().describe_context()); - break; - - default: - if ((m_r[2] > 1000) && (m_r[2] - 1000 < std::size(sysv_syscalls)) && sysv_syscalls[m_r[2] - 1000]) - LOGMASKED(LOG_RISCOS, "asid %d syscall %s() (%s)\n", asid, sysv_syscalls[m_r[2] - 1000], machine().describe_context()); - else - LOGMASKED(LOG_RISCOS, "asid %d syscall unknown %d (%s)\n", asid, m_r[2], machine().describe_context()); - break; - } - } - // set the exception PC m_cop0[COP0_EPC] = m_pc; @@ -1009,16 +841,17 @@ void mips1core_device_base::generate_exception(u32 exception, bool refill) } m_branch_state = EXCEPTION; - // shift the exception bits - SR = (SR & ~SR_KUIE) | ((SR << 2) & SR_KUIEop); - if (refill) m_pc = (SR & SR_BEV) ? 0xbfc00100 : 0x80000000; else m_pc = (SR & SR_BEV) ? 0xbfc00180 : 0x80000080; + // hook exception in caller context enabling debugger access to memory parameters debugger_exception_hook(exception); + // shift the exception bits + SR = (SR & ~SR_KUIE) | ((SR << 2) & SR_KUIEop); + if (SR & SR_KUp) debugger_privilege_hook(); } @@ -1490,64 +1323,6 @@ void mips1core_device_base::fetch(u32 address, std::function &&apply) apply(data); } -std::string mips1core_device_base::debug_string(u32 string_pointer, unsigned const limit) -{ - auto const suppressor(machine().disable_side_effects()); - - bool done = false; - bool mapped = false; - std::string result(""); - - while (!done) - { - done = true; - load(string_pointer++, [limit, &done, &mapped, &result](u8 byte) - { - mapped = true; - if (byte != 0) - { - result += byte; - - done = result.length() == limit; - } - }); - } - - if (!mapped) - result.assign("[unmapped]"); - - return result; -} - -std::string mips1core_device_base::debug_string_array(u32 array_pointer) -{ - auto const suppressor(machine().disable_side_effects()); - - bool done = false; - std::string result(""); - - while (!done) - { - done = true; - load(array_pointer, [this, &done, &result](u32 string_pointer) - { - if (string_pointer != 0) - { - if (!result.empty()) - result += ", "; - - result += '\"' + debug_string(string_pointer) + '\"'; - - done = false; - } - }); - - array_pointer += 4; - } - - return result; -} - void mips1_device_base::device_start() { mips1core_device_base::device_start(); diff --git a/src/devices/cpu/mips/mips1.h b/src/devices/cpu/mips/mips1.h index 618f36cbcc01d..5de7238281c0f 100644 --- a/src/devices/cpu/mips/mips1.h +++ b/src/devices/cpu/mips/mips1.h @@ -98,10 +98,6 @@ class mips1core_device_base : public cpu_device }; std::tuple cache_lookup(u32 address, bool invalidate, bool icache = false); - // debug helpers - std::string debug_string(u32 string_pointer, unsigned const limit = 0); - std::string debug_string_array(u32 array_pointer); - // address spaces address_space_config const m_program_config_be; address_space_config const m_program_config_le; diff --git a/src/devices/cpu/mips/mips3.h b/src/devices/cpu/mips/mips3.h index 0643cff28fe9d..73105cb0ad368 100644 --- a/src/devices/cpu/mips/mips3.h +++ b/src/devices/cpu/mips/mips3.h @@ -522,7 +522,7 @@ class mips3_device : public cpu_device, public device_vtlb_interface { void static_generate_memory_mode_checks(drcuml_block &block, uml::code_handle &exception_addrerr, int &label, int mode); void static_generate_fastram_accessor(drcuml_block &block, int &label, int size, bool iswrite, bool ismasked); void static_generate_memory_rw(drcuml_block &block, int size, bool iswrite, bool ismasked); - virtual void static_generate_memory_accessor(int mode, int size, bool iswrite, bool ismasked, const char *name, uml::code_handle *&handleptr); + virtual void static_generate_memory_accessor(drcuml_block &block, int &label, int mode, int size, bool iswrite, bool ismasked, const char *name, uml::code_handle *&handleptr); virtual void check_irqs(); virtual void handle_mult(uint32_t op); @@ -620,11 +620,11 @@ class mips3_device : public cpu_device, public device_vtlb_interface { uml::code_label labelnum; /* index for local labels */ }; - void static_generate_entry_point(); - void static_generate_nocode_handler(); - void static_generate_out_of_cycles(); - void static_generate_tlb_mismatch(); - void static_generate_exception(uint8_t exception, int recover, const char *name); + void static_generate_entry_point(drcuml_block &block, int &label); + void static_generate_nocode_handler(drcuml_block &block, int &label); + void static_generate_out_of_cycles(drcuml_block &block, int &label); + void static_generate_tlb_mismatch(drcuml_block &block, int &label); + void static_generate_exception(drcuml_block &block, int &label, uint8_t exception, int recover, const char *name); void generate_update_mode(drcuml_block &block); void generate_update_cycles(drcuml_block &block, compiler_state &compiler, uml::parameter param, bool allow_exception); @@ -758,7 +758,7 @@ class r4650_device : public mips3_device { protected: virtual bool memory_translate(int spacenum, int intention, offs_t &address, address_space *&target_space) override; - virtual void static_generate_memory_accessor(int mode, int size, bool iswrite, bool ismasked, const char *name, uml::code_handle *&handleptr) override; + virtual void static_generate_memory_accessor(drcuml_block &block, int &label, int mode, int size, bool iswrite, bool ismasked, const char *name, uml::code_handle *&handleptr) override; virtual bool RBYTE(offs_t address, uint32_t *result) override; virtual bool RHALF(offs_t address, uint32_t *result) override; diff --git a/src/devices/cpu/mips/mips3drc.cpp b/src/devices/cpu/mips/mips3drc.cpp index 6597b6fd20f04..6800f6fa11b0f 100644 --- a/src/devices/cpu/mips/mips3drc.cpp +++ b/src/devices/cpu/mips/mips3drc.cpp @@ -239,45 +239,55 @@ void mips3_device::code_flush_cache() try { - /* generate the entry point and out-of-cycles handlers */ - static_generate_entry_point(); - static_generate_nocode_handler(); - static_generate_out_of_cycles(); - static_generate_tlb_mismatch(); - - /* append exception handlers for various types */ - static_generate_exception(EXCEPTION_INTERRUPT, true, "exception_interrupt"); - static_generate_exception(EXCEPTION_INTERRUPT, false, "exception_interrupt_norecover"); - static_generate_exception(EXCEPTION_TLBMOD, true, "exception_tlbmod"); - static_generate_exception(EXCEPTION_TLBLOAD, true, "exception_tlbload"); - static_generate_exception(EXCEPTION_TLBSTORE, true, "exception_tlbstore"); - static_generate_exception(EXCEPTION_TLBLOAD_FILL, true, "exception_tlbload_fill"); - static_generate_exception(EXCEPTION_TLBSTORE_FILL, true, "exception_tlbstore_fill"); - static_generate_exception(EXCEPTION_ADDRLOAD, true, "exception_addrload"); - static_generate_exception(EXCEPTION_ADDRSTORE, true, "exception_addrstore"); - static_generate_exception(EXCEPTION_SYSCALL, true, "exception_syscall"); - static_generate_exception(EXCEPTION_BREAK, true, "exception_break"); - static_generate_exception(EXCEPTION_INVALIDOP, true, "exception_invalidop"); - static_generate_exception(EXCEPTION_BADCOP, true, "exception_badcop"); - static_generate_exception(EXCEPTION_OVERFLOW, true, "exception_overflow"); - static_generate_exception(EXCEPTION_TRAP, true, "exception_trap"); - static_generate_exception(EXCEPTION_FPE, true, "exception_fpe"); + { + drcuml_block &block(m_drcuml->begin_block(1024)); + int label = 1; + + /* generate the entry point and out-of-cycles handlers */ + static_generate_entry_point(block, label); + static_generate_nocode_handler(block, label); + static_generate_out_of_cycles(block, label); + static_generate_tlb_mismatch(block, label); + + /* append exception handlers for various types */ + static_generate_exception(block, label, EXCEPTION_INTERRUPT, true, "exception_interrupt"); + static_generate_exception(block, label, EXCEPTION_INTERRUPT, false, "exception_interrupt_norecover"); + static_generate_exception(block, label, EXCEPTION_TLBMOD, true, "exception_tlbmod"); + static_generate_exception(block, label, EXCEPTION_TLBLOAD, true, "exception_tlbload"); + static_generate_exception(block, label, EXCEPTION_TLBSTORE, true, "exception_tlbstore"); + static_generate_exception(block, label, EXCEPTION_TLBLOAD_FILL, true, "exception_tlbload_fill"); + static_generate_exception(block, label, EXCEPTION_TLBSTORE_FILL, true, "exception_tlbstore_fill"); + static_generate_exception(block, label, EXCEPTION_ADDRLOAD, true, "exception_addrload"); + static_generate_exception(block, label, EXCEPTION_ADDRSTORE, true, "exception_addrstore"); + static_generate_exception(block, label, EXCEPTION_SYSCALL, true, "exception_syscall"); + static_generate_exception(block, label, EXCEPTION_BREAK, true, "exception_break"); + static_generate_exception(block, label, EXCEPTION_INVALIDOP, true, "exception_invalidop"); + static_generate_exception(block, label, EXCEPTION_BADCOP, true, "exception_badcop"); + static_generate_exception(block, label, EXCEPTION_OVERFLOW, true, "exception_overflow"); + static_generate_exception(block, label, EXCEPTION_TRAP, true, "exception_trap"); + static_generate_exception(block, label, EXCEPTION_FPE, true, "exception_fpe"); + + block.end(); + } /* add subroutines for memory accesses */ for (mode = 0; mode < 3; mode++) { - static_generate_memory_accessor(mode, 1, false, false, "read8", m_read8[mode]); - static_generate_memory_accessor(mode, 1, true, false, "write8", m_write8[mode]); - static_generate_memory_accessor(mode, 2, false, false, "read16", m_read16[mode]); - static_generate_memory_accessor(mode, 2, true, false, "write16", m_write16[mode]); - static_generate_memory_accessor(mode, 4, false, false, "read32", m_read32[mode]); - static_generate_memory_accessor(mode, 4, false, true, "read32mask", m_read32mask[mode]); - static_generate_memory_accessor(mode, 4, true, false, "write32", m_write32[mode]); - static_generate_memory_accessor(mode, 4, true, true, "write32mask", m_write32mask[mode]); - static_generate_memory_accessor(mode, 8, false, false, "read64", m_read64[mode]); - static_generate_memory_accessor(mode, 8, false, true, "read64mask", m_read64mask[mode]); - static_generate_memory_accessor(mode, 8, true, false, "write64", m_write64[mode]); - static_generate_memory_accessor(mode, 8, true, true, "write64mask", m_write64mask[mode]); + drcuml_block &block(m_drcuml->begin_block(1024)); + int label = 1; + static_generate_memory_accessor(block, label, mode, 1, false, false, "read8", m_read8[mode]); + static_generate_memory_accessor(block, label, mode, 1, true, false, "write8", m_write8[mode]); + static_generate_memory_accessor(block, label, mode, 2, false, false, "read16", m_read16[mode]); + static_generate_memory_accessor(block, label, mode, 2, true, false, "write16", m_write16[mode]); + static_generate_memory_accessor(block, label, mode, 4, false, false, "read32", m_read32[mode]); + static_generate_memory_accessor(block, label, mode, 4, false, true, "read32mask", m_read32mask[mode]); + static_generate_memory_accessor(block, label, mode, 4, true, false, "write32", m_write32[mode]); + static_generate_memory_accessor(block, label, mode, 4, true, true, "write32mask", m_write32mask[mode]); + static_generate_memory_accessor(block, label, mode, 8, false, false, "read64", m_read64[mode]); + static_generate_memory_accessor(block, label, mode, 8, false, true, "read64mask", m_read64mask[mode]); + static_generate_memory_accessor(block, label, mode, 8, true, false, "write64", m_write64[mode]); + static_generate_memory_accessor(block, label, mode, 8, true, true, "write64mask", m_write64mask[mode]); + block.end(); } } catch (drcuml_block::abort_compilation &) @@ -585,44 +595,40 @@ static void cfunc_unimplemented(void *param) static entry point -------------------------------------------------*/ -void mips3_device::static_generate_entry_point() +void mips3_device::static_generate_entry_point(drcuml_block &block, int &label) { - uml::code_label const skip = 1; - - drcuml_block &block(m_drcuml->begin_block(20)); + uml::code_label const skip = label++; /* forward references */ alloc_handle(*m_drcuml, m_exception_norecover[EXCEPTION_INTERRUPT], "interrupt_norecover"); alloc_handle(*m_drcuml, m_nocode, "nocode"); alloc_handle(*m_drcuml, m_entry, "entry"); - UML_HANDLE(block, *m_entry); // handle entry + UML_HANDLE(block, *m_entry); // handle entry /* reset the FPU mode */ - UML_AND(block, I0, CCR132(31), 3); // and i0,ccr1[31],3 - UML_LOAD(block, I0, &m_fpmode[0], I0, SIZE_BYTE, SCALE_x1);// load i0,fpmode,i0,byte - UML_SETFMOD(block, I0); // setfmod i0 + UML_AND(block, I0, CCR132(31), 3); // and i0,ccr1[31],3 + UML_LOAD(block, I0, &m_fpmode[0], I0, SIZE_BYTE, SCALE_x1); // load i0,fpmode,i0,byte + UML_SETFMOD(block, I0); // setfmod i0 /* load fast integer registers */ load_fast_iregs(block); /* check for interrupts */ UML_AND(block, I0, CPR032(COP0_Cause), CPR032(COP0_Status)); // and i0,[Cause],[Status] - UML_AND(block, I0, I0, 0xfc00); // and i0,i0,0xfc00,Z - UML_JMPc(block, COND_Z, skip); // jmp skip,Z + UML_AND(block, I0, I0, 0xfc00); // and i0,i0,0xfc00,Z + UML_JMPc(block, COND_Z, skip); // jmp skip,Z UML_TEST(block, CPR032(COP0_Status), SR_IE); // test [Status],SR_IE - UML_JMPc(block, COND_Z, skip); // jmp skip,Z + UML_JMPc(block, COND_Z, skip); // jmp skip,Z UML_TEST(block, CPR032(COP0_Status), SR_EXL | SR_ERL); // test [Status],SR_EXL | SR_ERL - UML_JMPc(block, COND_NZ, skip); // jmp skip,NZ - UML_MOV(block, I0, mem(&m_core->pc)); // mov i0,pc - UML_MOV(block, I1, 0); // mov i1,0 - UML_CALLH(block, *m_exception_norecover[EXCEPTION_INTERRUPT]); // callh exception_norecover + UML_JMPc(block, COND_NZ, skip); // jmp skip,NZ + UML_MOV(block, I0, mem(&m_core->pc)); // mov i0,pc + UML_MOV(block, I1, 0); // mov i1,0 + UML_CALLH(block, *m_exception_norecover[EXCEPTION_INTERRUPT]); // callh exception_norecover UML_LABEL(block, skip); // skip: /* generate a hash jump via the current mode and PC */ - UML_HASHJMP(block, mem(&m_core->mode), mem(&m_core->pc), *m_nocode); - // hashjmp ,,nocode - block.end(); + UML_HASHJMP(block, mem(&m_core->mode), mem(&m_core->pc), *m_nocode); // hashjmp ,,nocode } @@ -631,11 +637,8 @@ void mips3_device::static_generate_entry_point() exception handler for "out of code" -------------------------------------------------*/ -void mips3_device::static_generate_nocode_handler() +void mips3_device::static_generate_nocode_handler(drcuml_block &block, int &label) { - /* begin generating */ - drcuml_block &block(m_drcuml->begin_block(10)); - /* generate a hash jump via the current mode and PC */ alloc_handle(*m_drcuml, m_nocode, "nocode"); UML_HANDLE(block, *m_nocode); // handle nocode @@ -643,8 +646,6 @@ void mips3_device::static_generate_nocode_handler() UML_MOV(block, mem(&m_core->pc), I0); // mov [pc],i0 save_fast_iregs(block); UML_EXIT(block, EXECUTE_MISSING_CODE); // exit EXECUTE_MISSING_CODE - - block.end(); } @@ -653,11 +654,8 @@ void mips3_device::static_generate_nocode_handler() out of cycles exception handler -------------------------------------------------*/ -void mips3_device::static_generate_out_of_cycles() +void mips3_device::static_generate_out_of_cycles(drcuml_block &block, int &label) { - /* begin generating */ - drcuml_block &block(m_drcuml->begin_block(10)); - /* generate a hash jump via the current mode and PC */ alloc_handle(*m_drcuml, m_out_of_cycles, "out_of_cycles"); UML_HANDLE(block, *m_out_of_cycles); // handle out_of_cycles @@ -665,8 +663,6 @@ void mips3_device::static_generate_out_of_cycles() UML_MOV(block, mem(&m_core->pc), I0); // mov ,i0 save_fast_iregs(block); UML_EXIT(block, EXECUTE_OUT_OF_CYCLES); // exit EXECUTE_OUT_OF_CYCLES - - block.end(); } @@ -675,15 +671,14 @@ void mips3_device::static_generate_out_of_cycles() TLB mismatch handler -------------------------------------------------*/ -void mips3_device::static_generate_tlb_mismatch() +void mips3_device::static_generate_tlb_mismatch(drcuml_block &block, int &label) { + uml::code_label const skip = label++; + /* forward references */ alloc_handle(*m_drcuml, m_exception[EXCEPTION_TLBLOAD], "exception_tlbload"); alloc_handle(*m_drcuml, m_exception[EXCEPTION_TLBLOAD_FILL], "exception_tlbload_fill"); - /* begin generating */ - drcuml_block &block(m_drcuml->begin_block(20)); - /* generate a hash jump via the current mode and PC */ alloc_handle(*m_drcuml, m_tlb_mismatch, "tlb_mismatch"); UML_HANDLE(block, *m_tlb_mismatch); // handle tlb_mismatch @@ -702,12 +697,12 @@ void mips3_device::static_generate_tlb_mismatch() UML_MOV(block, mem(&m_core->arg1), I1); // mov [arg1],i1 UML_CALLC(block, cfunc_printf_debug, this); // callc printf_debug } - UML_TEST(block, I1, FETCH_ALLOWED); // test i1,FETCH_ALLOWED - UML_JMPc(block, COND_NZ, 1); // jmp 1,nz - UML_TEST(block, I1, FLAG_FIXED); // test i1,FLAG_FIXED + UML_TEST(block, I1, FETCH_ALLOWED); // test i1,FETCH_ALLOWED + UML_JMPc(block, COND_NZ, skip); // jmp skip,nz + UML_TEST(block, I1, FLAG_FIXED); // test i1,FLAG_FIXED UML_EXHc(block, COND_NZ, *m_exception[EXCEPTION_TLBLOAD], I0); // exh exception[TLBLOAD],i0,nz UML_EXH(block, *m_exception[EXCEPTION_TLBLOAD_FILL], I0); // exh exception[TLBLOAD_FILL],i0 - UML_LABEL(block, 1); // 1: + UML_LABEL(block, skip); // skip: save_fast_iregs(block); // the saved PC may be set 1 instruction back with the low bit set to indicate @@ -717,8 +712,6 @@ void mips3_device::static_generate_tlb_mismatch() UML_MOV(block, mem(&m_core->pc), I0); // mov i0,[pc] UML_EXIT(block, EXECUTE_MISSING_CODE); // exit EXECUTE_MISSING_CODE - - block.end(); } @@ -727,12 +720,12 @@ void mips3_device::static_generate_tlb_mismatch() exception handler -------------------------------------------------*/ -void mips3_device::static_generate_exception(uint8_t exception, int recover, const char *name) +void mips3_device::static_generate_exception(drcuml_block &block, int &label, uint8_t exception, int recover, const char *name) { uml::code_handle *&exception_handle = recover ? m_exception[exception] : m_exception_norecover[exception]; uint32_t offset = 0x180; - uml::code_label const next = 1; - uml::code_label const skip = 2; + uml::code_label const next = label++; + uml::code_label const skip = label++; /* translate our fake fill exceptions into real exceptions */ if (exception == EXCEPTION_TLBLOAD_FILL || exception == EXCEPTION_TLBSTORE_FILL) @@ -741,9 +734,6 @@ void mips3_device::static_generate_exception(uint8_t exception, int recover, con exception = (exception - EXCEPTION_TLBLOAD_FILL) + EXCEPTION_TLBLOAD; } - /* begin generating */ - drcuml_block &block(m_drcuml->begin_block(1024)); - /* add a global entry for this */ alloc_handle(*m_drcuml, exception_handle, name); UML_HANDLE(block, *exception_handle); // handle name @@ -798,7 +788,7 @@ void mips3_device::static_generate_exception(uint8_t exception, int recover, con } /* set EXL in the SR */ - UML_OR(block, I0, CPR032(COP0_Status), SR_EXL); // or i0,[Status],SR_EXL + UML_OR(block, I0, CPR032(COP0_Status), SR_EXL); // or i0,[Status],SR_EXL UML_MOV(block, CPR032(COP0_Status), I0); // mov [Status],i0 generate_update_mode(block); @@ -806,24 +796,22 @@ void mips3_device::static_generate_exception(uint8_t exception, int recover, con if ((PRINTF_EXCEPTIONS && exception != EXCEPTION_INTERRUPT && exception != EXCEPTION_SYSCALL) || (PRINTF_MMU && (exception == EXCEPTION_TLBLOAD || exception == EXCEPTION_TLBSTORE))) { - UML_CALLC(block, cfunc_printf_exception, this); // callc cfunc_printf_exception,nullptr + UML_CALLC(block, cfunc_printf_exception, this); // callc cfunc_printf_exception,nullptr //UML_CALLC(block, cfunc_debug_break, this); // callc cfunc_debug_break,nullptr } /* choose our target PC */ - UML_ADD(block, I0, I3, 0xbfc00200); // add i0,i3,0xbfc00200 - UML_TEST(block, CPR032(COP0_Status), SR_BEV); // test CPR032(COP0_Status),SR_BEV - UML_JMPc(block, COND_NZ, skip); // jnz - UML_ADD(block, I0, I3, 0x80000000); // add i0,i3,0x80000000,z + UML_ADD(block, I0, I3, 0xbfc00200); // add i0,i3,0xbfc00200 + UML_TEST(block, CPR032(COP0_Status), SR_BEV); // test CPR032(COP0_Status),SR_BEV + UML_JMPc(block, COND_NZ, skip); // jnz + UML_ADD(block, I0, I3, 0x80000000); // add i0,i3,0x80000000,z UML_LABEL(block, skip); // : /* adjust cycles */ - UML_SUB(block, mem(&m_core->icount), mem(&m_core->icount), I1); // sub icount,icount,cycles,S - UML_EXHc(block, COND_S, *m_out_of_cycles, I0); // exh out_of_cycles,i0 - - UML_HASHJMP(block, mem(&m_core->mode), I0, *m_nocode);// hashjmp ,i0,nocode + UML_SUB(block, mem(&m_core->icount), mem(&m_core->icount), I1); // sub icount,icount,cycles,S + UML_EXHc(block, COND_S, *m_out_of_cycles, I0); // exh out_of_cycles,i0 - block.end(); + UML_HASHJMP(block, mem(&m_core->mode), I0, *m_nocode); // hashjmp ,i0,nocode } @@ -1018,7 +1006,7 @@ void mips3_device::static_generate_memory_rw(drcuml_block &block, int size, bool static_generate_memory_accessor ------------------------------------------------------------------*/ -void mips3_device::static_generate_memory_accessor(int mode, int size, bool iswrite, bool ismasked, const char *name, uml::code_handle *&handleptr) +void mips3_device::static_generate_memory_accessor(drcuml_block &block, int &label, int mode, int size, bool iswrite, bool ismasked, const char *name, uml::code_handle *&handleptr) { /* on entry, address is in I0; data for writes is in I1; mask for accesses is in I2 */ /* on exit, read result is in I0 */ @@ -1027,10 +1015,6 @@ void mips3_device::static_generate_memory_accessor(int mode, int size, bool iswr uml::code_handle &exception_tlbfill = *m_exception[iswrite ? EXCEPTION_TLBSTORE_FILL : EXCEPTION_TLBLOAD_FILL]; uml::code_handle &exception_addrerr = *m_exception[iswrite ? EXCEPTION_ADDRSTORE : EXCEPTION_ADDRLOAD]; int tlbmiss = 0; - int label = 1; - - /* begin generating */ - drcuml_block &block(m_drcuml->begin_block(1024)); /* add a global entry for this */ alloc_handle(*m_drcuml, handleptr, name); @@ -1048,32 +1032,23 @@ void mips3_device::static_generate_memory_accessor(int mode, int size, bool iswr static_generate_fastram_accessor(block, label, size, iswrite, ismasked); static_generate_memory_rw(block, size, iswrite, ismasked); - if (tlbmiss != 0) + UML_LABEL(block, tlbmiss); // tlbmiss: + if (iswrite) { - UML_LABEL(block, tlbmiss); // tlbmiss: - if (iswrite) - { - UML_TEST(block, I3, READ_ALLOWED); // test i3,READ_ALLOWED - UML_EXHc(block, COND_NZ, *m_exception[EXCEPTION_TLBMOD], I0); // exh tlbmod,i0,nz - } - UML_TEST(block, I3, FLAG_FIXED); // test i3,FLAG_FIXED - UML_EXHc(block, COND_NZ, exception_tlb, I0); // exh tlb,i0,nz - UML_EXH(block, exception_tlbfill, I0); // exh tlbfill,i0 + UML_TEST(block, I3, READ_ALLOWED); // test i3,READ_ALLOWED + UML_EXHc(block, COND_NZ, *m_exception[EXCEPTION_TLBMOD], I0); // exh tlbmod,i0,nz } - - block.end(); + UML_TEST(block, I3, FLAG_FIXED); // test i3,FLAG_FIXED + UML_EXHc(block, COND_NZ, exception_tlb, I0); // exh tlb,i0,nz + UML_EXH(block, exception_tlbfill, I0); // exh tlbfill,i0 } -void r4650_device::static_generate_memory_accessor(int mode, int size, bool iswrite, bool ismasked, const char *name, uml::code_handle *&handleptr) +void r4650_device::static_generate_memory_accessor(drcuml_block &block, int &label, int mode, int size, bool iswrite, bool ismasked, const char *name, uml::code_handle *&handleptr) { /* on entry, address is in I0; data for writes is in I1; mask for accesses is in I2 */ /* on exit, read result is in I0 */ /* routine trashes I0-I3 */ uml::code_handle &exception_addrerr = *m_exception[iswrite ? EXCEPTION_ADDRSTORE : EXCEPTION_ADDRLOAD]; - int label = 1; - - /* begin generating */ - drcuml_block &block(m_drcuml->begin_block(1024)); /* add a global entry for this */ alloc_handle(*m_drcuml, handleptr, name); @@ -1093,7 +1068,6 @@ void r4650_device::static_generate_memory_accessor(int mode, int size, bool iswr static_generate_fastram_accessor(block, label, size, iswrite, ismasked); static_generate_memory_rw(block, size, iswrite, ismasked); - block.end(); } diff --git a/src/devices/cpu/powerpc/ppcdrc.cpp b/src/devices/cpu/powerpc/ppcdrc.cpp index 06da83445921c..3133529e5c272 100644 --- a/src/devices/cpu/powerpc/ppcdrc.cpp +++ b/src/devices/cpu/powerpc/ppcdrc.cpp @@ -1021,32 +1021,30 @@ void ppc_device::static_generate_memory_accessor(int mode, int size, int iswrite /* check for unaligned accesses and break into two */ if (!ismasked && size != 1) { - /* in little-endian mode, anything misaligned generates an exception */ if ((mode & MODE_LITTLE_ENDIAN) || masked == nullptr || !(m_cap & PPCCAP_MISALIGNED)) { + /* in little-endian mode, anything misaligned generates an exception */ UML_TEST(block, I0, size - 1); // test i0,size-1 - UML_JMPc(block, COND_NZ, alignex = label++); // jmp alignex,nz + UML_JMPc(block, COND_NZ, alignex = label++); // jmp alignex,nz } - - /* in big-endian mode, it's more complicated */ else { - /* 8-byte accesses must be word-aligned */ + /* in big-endian mode, it's more complicated */ if (size == 8) { + /* 8-byte accesses must be word-aligned */ UML_TEST(block, I0, 3); // test i0,3 - UML_JMPc(block, COND_NZ, alignex = label++); // jmp alignex,nz + UML_JMPc(block, COND_NZ, alignex = label++); // jmp alignex,nz /* word aligned accesses need to be broken up */ UML_TEST(block, I0, 4); // test i0,4 UML_JMPc(block, COND_NZ, unaligned = label++); // jmp unaligned, nz } - - /* unaligned 2 and 4 byte accesses need to be broken up */ else { + /* unaligned 2 and 4 byte accesses need to be broken up */ UML_TEST(block, I0, size - 1); // test i0,size-1 - UML_JMPc(block, COND_NZ, unaligned = label++); // jmp unaligned,nz + UML_JMPc(block, COND_NZ, unaligned = label++); // jmp unaligned,nz } } } @@ -1054,12 +1052,12 @@ void ppc_device::static_generate_memory_accessor(int mode, int size, int iswrite /* general case: assume paging and perform a translation */ if (((m_cap & PPCCAP_OEA) && (mode & MODE_DATA_TRANSLATION)) || (iswrite && (m_cap & PPCCAP_4XX) && (mode & MODE_PROTECTION))) { - UML_SHR(block, I3, I0, 12); // shr i3,i0,12 - UML_LOAD(block, I3, (void *)vtlb_table(), I3, SIZE_DWORD, SCALE_x4);// load i3,[vtlb],i3,dword - UML_TEST(block, I3, (uint64_t)1 << translate_type); // test i3,1 << translate_type - UML_JMPc(block, COND_Z, tlbmiss = label++); // jmp tlbmiss,z - UML_LABEL(block, tlbreturn = label++); // tlbreturn: - UML_ROLINS(block, I0, I3, 0, 0xfffff000); // rolins i0,i3,0,0xfffff000 + UML_SHR(block, I3, I0, 12); // shr i3,i0,12 + UML_LOAD(block, I3, (void *)vtlb_table(), I3, SIZE_DWORD, SCALE_x4); // load i3,[vtlb],i3,dword + UML_TEST(block, I3, (uint64_t)1 << translate_type); // test i3,1 << translate_type + UML_JMPc(block, COND_Z, tlbmiss = label++); // jmp tlbmiss,z + UML_LABEL(block, tlbreturn = label++); // tlbreturn: + UML_ROLINS(block, I0, I3, 0, 0xfffff000); // rolins i0,i3,0,0xfffff000 } else if (m_cap & PPCCAP_4XX) UML_AND(block, I0, I0, 0x7fffffff); // and i0,i0,0x7fffffff diff --git a/src/devices/cpu/sc61860/scdasm.cpp b/src/devices/cpu/sc61860/scdasm.cpp index 4335c102aaaac..7ab30cdc44eec 100644 --- a/src/devices/cpu/sc61860/scdasm.cpp +++ b/src/devices/cpu/sc61860/scdasm.cpp @@ -66,40 +66,47 @@ */ const sc61860_disassembler::opcode sc61860_disassembler::table[]={ +// 00-0F / 0-3 4-7 8-B C-F { "LII", Imm }, { "LIJ", Imm }, { "LIA", Imm }, { "LIB", Imm }, { "IX", Imp }, { "DX", Imp }, { "IY", Imp }, { "DY", Imp }, { "MVW", Imp }, { "EXW", Imp }, { "MVB", Imp }, { "EXB", Imp }, { "ADN", Imp }, { "SBN", Imp }, { "ADW", Imp }, { "SBW", Imp }, +// 10-1F / 0-3 4-7 8-B C-F { "LIDP", ImmW}, { "LIDL", Imm }, { "LIP", Imm }, { "LIQ", Imm }, { "ADB", Imp }, { "SBB", Imp }, { "LIDP", ImmW}, { "LIDL", Imm }, { "MVWD", Imp }, { "EXWD", Imp }, { "MVBD", Imp }, { "EXBD", Imp }, { "SRW", Imp }, { "SLW", Imp }, { "FILM", Imp }, { "FILD", Imp }, - { "LDP", Imp }, { "LPQ", Imp }, { "LPR", Imp }, { nullptr, Ill }, +// 20-2F / 0-3 4-7 8-B C-F + { "LDP", Imp }, { "LPQ", Imp }, { "LPR", Imp }, { "CLRA", /* =RA undocumented */ Imp }, { "IXL", Imp }, { "DXL", Imp }, { "IYS", Imp }, { "DYS", Imp }, { "JRNZP", RelP}, { "JRNZM", RelM}, { "JRNCP", RelP}, { "JRNCM", RelM}, { "JRP", RelP}, { "JRM", RelM}, { nullptr, Ill }, { "LOOP", RelM}, +// 30-3F / 0-3 4-7 8-B C-F { "STP", Imp }, { "STQ", Imp }, { "STR", Imp }, { nullptr, Ill }, { "PUSH", Imp }, { "DATA", Imp }, { nullptr, Ill }, { "RTN", Imp }, { "JRZP", RelP}, { "JRZM", RelM}, { "JRCP", RelP}, { "JRCM", RelM}, { nullptr, Ill }, { nullptr, Ill }, { nullptr, Ill }, { nullptr, Ill }, +// 40-4F / 0-3 4-7 8-B C-F { "INCI", Imp }, { "DECI", Imp }, { "INCA", Imp }, { "DECA", Imp }, { "ADM", Imp }, { "SBM", Imp }, { "ANMA", Imp }, { "ORMA", Imp }, { "INCK", Imp }, { "DECK", Imp }, { "INCV", Imp }, { "DECV", Imp }, - { "INA", Imp }, { "NOPW", Imp }, { "WAIT", Imm }, { "IPXL"/*CDN, lxn*/, Imp }, + { "INA", Imp }, { "NOPW", Imp }, { "WAIT", Imm }, { "IPXL"/* =CDN, lxn*/, Imp }, +// 50-5F / 0-3 4-7 8-B C-F { "INCP", Imp }, { "DECP", Imp }, { "STD", Imp }, { "MVDM", Imp }, { "READM",/*mvmp*/ Imp }, { "MVMD", Imp }, { "READ"/*ldpc*/, Imp }, { "LDD", Imp }, { "SWP", Imp }, { "LDM", Imp }, { "SL", Imp }, { "POP", Imp }, { nullptr, Ill }, { "OUTA", Imp }, { nullptr, Ill }, { "OUTF", Imp }, +// 60-5F / 0-3 4-7 8-B C-F { "ANIM", Imm }, { "ORIM", Imm }, { "TSIM", Imm }, { "CPIM", Imm }, { "ANIA", Imm }, { "ORIA", Imm }, { "TSIA", Imm }, { "CPIA", Imm }, { nullptr, Ill }, { "ETC", Etc }, { nullptr, Ill }, { "TEST", Imm }, - { nullptr, Ill }, { nullptr, Ill }, { nullptr, Ill }, { "IPXH"/*CDN,lxp*/, Imp }, + { nullptr, Ill }, { nullptr, Ill }, { nullptr, Ill }, { "IPXH"/* =CUP,lxp*/, Imp }, { "ADIM", Imm }, { "SBIM", Imm }, { nullptr, Ill }, { nullptr, Ill }, { "ADIA", Imm }, { "SBIA", Imm }, { nullptr, Ill }, { nullptr, Ill }, @@ -172,11 +179,11 @@ offs_t sc61860_disassembler::disassemble(std::ostream &stream, offs_t pc, const util::stream_format(stream,"%-6s%04x",table[oper].mnemonic, adr); break; case RelM: - adr=pc-opcodes.r8(pos++); + adr=pc-opcodes.r8(pos++)+1; util::stream_format(stream,"%-6s%04x",table[oper].mnemonic, adr&0xffff); break; case RelP: - adr=pc+opcodes.r8(pos++); + adr=pc+opcodes.r8(pos++)+1; util::stream_format(stream,"%-6s%04x",table[oper].mnemonic, adr&0xffff); break; case Ptc: diff --git a/src/devices/cpu/sc61860/scops.hxx b/src/devices/cpu/sc61860/scops.hxx index 9f668b40cb90c..967d0be6d568b 100644 --- a/src/devices/cpu/sc61860/scops.hxx +++ b/src/devices/cpu/sc61860/scops.hxx @@ -740,9 +740,8 @@ void sc61860_device::sc61860_exchange_ext(int count) } } -// undocumented -// only 1 opcode working in pc1403 -// both opcodes working in pc1350 +// Documented in PC1350_MachineLanguage: IPXL = CDN, IPXH = CUP +// only 1 opcode working in pc1403 (IPXL, or IPXH?) void sc61860_device::sc61860_wait_x(int level) { int c; diff --git a/src/devices/cpu/sc61860/sctable.hxx b/src/devices/cpu/sc61860/sctable.hxx index 822867017fb0b..f8520f99c203c 100644 --- a/src/devices/cpu/sc61860/sctable.hxx +++ b/src/devices/cpu/sc61860/sctable.hxx @@ -42,6 +42,7 @@ void sc61860_device::sc61860_instruction() case 32: sc61860_store_p();m_icount-=2;break; case 33: sc61860_store_q();m_icount-=2;break; case 34: sc61860_store_r();m_icount-=2;break; + case 35: sc61860_load_imm(A, 0);m_icount-=2/*?*/;break; // undocumented case 36: sc61860_inc_load_dp_load();m_icount-=7;break; case 37: sc61860_dec_load_dp_load();m_icount-=7;break; case 38: sc61860_inc_load_dp_store();m_icount-=7;break; @@ -83,9 +84,9 @@ void sc61860_device::sc61860_instruction() case 81: sc61860_dec_p();m_icount-=2;break; case 82: sc61860_store_ext(A);m_icount-=2;break; case 83: sc61860_store_ext(m_p);m_icount-=2;break; - case 84: sc61860_load_imm(m_p, READ_OP());m_icount-=3/*?*/;break; // undocumented + case 84: sc61860_load_imm(m_p, READ_OP());m_icount-=3/*?*/;break; // PC1350: 0x54 READM undocumented case 85: sc61860_load_ext(m_p);m_icount-=3;break; - case 86: sc61860_load_imm(m_p, READ_OP());m_icount-=3/*?*/;break; // undocumented + case 86: sc61860_load_imm(m_p, READ_OP());m_icount-=3/*?*/;break; // PC1350: 0x56 READ undocumented case 87: sc61860_load_ext(A);m_icount-=3;break; case 88: sc61860_swap();m_icount-=2;break; case 89: sc61860_load();m_icount-=2;break; diff --git a/src/devices/cpu/uml.cpp b/src/devices/cpu/uml.cpp index ea77a64afe959..7133cfb6980d3 100644 --- a/src/devices/cpu/uml.cpp +++ b/src/devices/cpu/uml.cpp @@ -441,7 +441,18 @@ void uml::instruction::simplify() else convert_to_mov_immediate(rotl_64(m_param[1].immediate(), m_param[2].immediate()) & m_param[3].immediate()); } - else if (m_param[2].is_immediate_value(0)) + else if (m_param[1].is_immediate() && m_param[2].is_immediate()) + { + assert(m_size == 4 || m_size == 8); + m_opcode = OP_AND; + m_numparams = 3; + if (m_size == 4) + m_param[1] = parameter(rotl_32(m_param[1].immediate(), m_param[2].immediate())); + else + m_param[1] = parameter(rotl_64(m_param[1].immediate(), m_param[2].immediate())); + m_param[2] = m_param[3]; + } + else if (m_param[2].is_immediate_value(0) || m_param[3].is_immediate_value(0)) { m_opcode = OP_AND; m_numparams = 3; diff --git a/src/devices/cpu/v60/op2.hxx b/src/devices/cpu/v60/op2.hxx index c4abd0af06bd4..9714a0340276f 100644 --- a/src/devices/cpu/v60/op2.hxx +++ b/src/devices/cpu/v60/op2.hxx @@ -71,12 +71,17 @@ uint32_t v60_device::opCVTSW() // Convert to uint32_t val = u2f(m_op1); - m_modwritevalw = (uint32_t)val; + switch (TKCW & 7) + { + case 0: m_modwritevalw = (uint32_t)(int64_t)round(val); break; + case 1: m_modwritevalw = (uint32_t)(int64_t)floor(val); break; + case 2: m_modwritevalw = (uint32_t)(int64_t)ceil(val); break; + default: m_modwritevalw = (uint32_t)(int64_t)trunc(val); break; + } - _OV = 0; - _CY =(val < 0.0f); _S = ((m_modwritevalw & 0x80000000) != 0); - _Z = (val == 0.0f); + _OV = (_S && val >= 0.0f) || (!_S && val <= -1.0f); + _Z = (m_modwritevalw == 0); F2WriteSecondOperand(2); F2END(); diff --git a/src/devices/cpu/v60/v60.h b/src/devices/cpu/v60/v60.h index 9e28eff0bbd7a..0f79535a39c42 100644 --- a/src/devices/cpu/v60/v60.h +++ b/src/devices/cpu/v60/v60.h @@ -776,7 +776,6 @@ class v60_device : public cpu_device [[noreturn]] uint32_t opUNHANDLED(); void v60_do_irq(int vector); void v60_try_irq(); - }; diff --git a/src/devices/cpu/vax/vax.cpp b/src/devices/cpu/vax/vax.cpp new file mode 100644 index 0000000000000..b2930a5502152 --- /dev/null +++ b/src/devices/cpu/vax/vax.cpp @@ -0,0 +1,100 @@ +// license:BSD-3-Clause +// copyright-holders:AJR +/*************************************************************************** + + DEC VAX CPUs + + Currently these devices are just stubs with no actual execution core. + +***************************************************************************/ + +#include "emu.h" +#include "vax.h" +#include "vaxdasm.h" + +// device type definitions +DEFINE_DEVICE_TYPE(KD32A, kd32a_device, "kd32a", "DEC KD32-A MicroVAX I CPU") +DEFINE_DEVICE_TYPE(DC333, dc333_device, "dc333", "DEC DC333 MicroVAX II CPU") +DEFINE_DEVICE_TYPE(DC341, dc341_device, "dc341", "DEC DC341 CVAX CPU") + + +vax_cpu_device::vax_cpu_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, int addrwidth) + : cpu_device(mconfig, type, tag, owner, clock) + , m_program_config("program", ENDIANNESS_LITTLE, 32, addrwidth, 0, 32, 9) + , m_psl(0) + , m_icount(0) +{ +} + +kd32a_device::kd32a_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : vax_cpu_device(mconfig, KD32A, tag, owner, clock, 30) +{ +} + +dc333_device::dc333_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : vax_cpu_device(mconfig, DC333, tag, owner, clock, 32) +{ +} + +dc341_device::dc341_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : vax_cpu_device(mconfig, DC341, tag, owner, clock, 32) +{ +} + +std::unique_ptr vax_cpu_device::create_disassembler() +{ + return std::make_unique(); +} + +device_memory_interface::space_config_vector vax_cpu_device::memory_space_config() const +{ + return space_config_vector { + std::make_pair(AS_PROGRAM, &m_program_config), + }; +} + + +void vax_cpu_device::device_start() +{ + address_space &space = this->space(AS_PROGRAM); + space.specific(m_program_space); + space.cache(m_cache); + + std::fill_n(&m_gpr[0], 16, 0); + + set_icountptr(m_icount); + + state_add(STATE_GENPC, "GENPC", m_gpr[15]).noshow(); + state_add(STATE_GENPCBASE, "CURPC", m_gpr[15]).noshow(); + for (int i = 0; i < 12; i++) + state_add(VAX_R0 + i, util::string_format("R%d", i).c_str(), m_gpr[i]); + state_add(VAX_AP, "AP", m_gpr[12]); + state_add(VAX_FP, "FP", m_gpr[13]); + state_add(VAX_SP, "SP", m_gpr[14]); + state_add(VAX_PC, "PC", m_gpr[15]); + state_add(VAX_PSL, "PSL", m_psl); + + save_item(NAME(m_gpr)); + save_item(NAME(m_psl)); +} + +void vax_cpu_device::device_reset() +{ + m_gpr[15] = 0; + m_psl = 0x041f0000; +} + +void dc341_device::device_reset() +{ + vax_cpu_device::device_reset(); + + m_gpr[15] = 0x20040000; // 0x20060000 in run mode +} + + +void vax_cpu_device::execute_run() +{ + debugger_instruction_hook(m_gpr[15]); + + m_icount = 0; +} diff --git a/src/devices/cpu/vax/vax.h b/src/devices/cpu/vax/vax.h new file mode 100644 index 0000000000000..1d2745e97fa75 --- /dev/null +++ b/src/devices/cpu/vax/vax.h @@ -0,0 +1,82 @@ +// license:BSD-3-Clause +// copyright-holders:AJR + +#ifndef MAME_CPU_VAX_VAX_H +#define MAME_CPU_VAX_VAX_H + +#pragma once + + +class vax_cpu_device : public cpu_device +{ +public: + enum + { + VAX_R0, VAX_R1, VAX_R2, VAX_R3, + VAX_R4, VAX_R5, VAX_R6, VAX_R7, + VAX_R8, VAX_R9, VAX_R10, VAX_R11, + VAX_AP, VAX_FP, VAX_SP, VAX_PC, + VAX_PSL + }; + +protected: + // construction/destruction + vax_cpu_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, int addrwidth); + + // device-level overrides + virtual void device_start() override ATTR_COLD; + virtual void device_reset() override ATTR_COLD; + + // device_disasm_interface overrides + virtual std::unique_ptr create_disassembler() override; + + // device_execute_interface overrides + virtual void execute_run() override; + + // device_memory_interface overrides + virtual space_config_vector memory_space_config() const override; + + // address space + address_space_config m_program_config; + memory_access<32, 2, 0, ENDIANNESS_LITTLE>::specific m_program_space; + memory_access<32, 2, 0, ENDIANNESS_LITTLE>::cache m_cache; + + // internal state + u32 m_gpr[16]; + u32 m_psl; + + // execution sequencing + s32 m_icount; +}; + +class kd32a_device : public vax_cpu_device +{ +public: + // construction/destruction + kd32a_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); +}; + +class dc333_device : public vax_cpu_device +{ +public: + // construction/destruction + dc333_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); +}; + +class dc341_device : public vax_cpu_device +{ +public: + // construction/destruction + dc341_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); + + // device-level overrides + virtual void device_reset() override ATTR_COLD; +}; + + +// device type declarations +DECLARE_DEVICE_TYPE(KD32A, kd32a_device) +DECLARE_DEVICE_TYPE(DC333, dc333_device) +DECLARE_DEVICE_TYPE(DC341, dc341_device) + +#endif // MAME_CPU_VAX_VAX_H diff --git a/src/devices/cpu/vax/vaxdasm.cpp b/src/devices/cpu/vax/vaxdasm.cpp index 5faaca67e8d87..7e15cd1b953f9 100644 --- a/src/devices/cpu/vax/vaxdasm.cpp +++ b/src/devices/cpu/vax/vaxdasm.cpp @@ -928,7 +928,6 @@ offs_t vax_disassembler::disassemble_inst(std::ostream &stream, const vax_disass else switch (inst.operand[n]) { case mode::rb: - case mode::ab: // Immediate bytes may be used as MOVCn sources, at least with a length of 0 format_immediate(stream, opcodes.r8(pc++)); break; @@ -938,6 +937,7 @@ offs_t vax_disassembler::disassemble_inst(std::ostream &stream, const vax_disass break; case mode::urb: + case mode::ab: // Immediate bytes may be used as MOVCn sources, at least with a length of 0 util::stream_format(stream, "#^X%02X", opcodes.r8(pc++)); break; @@ -999,7 +999,7 @@ offs_t vax_disassembler::disassemble_inst(std::ostream &stream, const vax_disass break; case mode::ro: case mode::uro: - util::stream_format(stream, "#^X%016X%016X", opcodes.r64(pc), opcodes.r64(pc + 4)); + util::stream_format(stream, "#^X%016X%016X", opcodes.r64(pc + 8), opcodes.r64(pc)); pc += 16; break; diff --git a/src/devices/cpu/z80/z80dasm.cpp b/src/devices/cpu/z80/z80dasm.cpp index b0e8f38245717..fcd358c3c7817 100644 --- a/src/devices/cpu/z80/z80dasm.cpp +++ b/src/devices/cpu/z80/z80dasm.cpp @@ -33,10 +33,10 @@ static const char *const s_mnemonic[] = const u32 z80_disassembler::s_flags[] = { 0 ,0 ,0 ,0 ,STEP_OVER,0 ,0 ,0 , - STEP_COND,0 ,STEP_COND,0 ,0 ,0 ,0 ,0 , + STEP_OVER,0 ,STEP_OVER,0 ,0 ,0 ,0 ,0 , STEP_COND,0 ,0 ,0 ,STEP_OVER,0 ,0 ,0 , - 0 ,STEP_COND,0 ,STEP_COND,0 ,0 ,0 ,0 , - STEP_COND,0 ,STEP_COND,0 ,0 ,0 ,STEP_COND,STEP_COND, + 0 ,STEP_OVER,0 ,STEP_OVER,0 ,0 ,0 ,0 , + STEP_OVER,0 ,STEP_OVER,0 ,0 ,0 ,STEP_OVER,STEP_OVER, 0 ,0 ,0 ,0 ,0 ,0 ,STEP_OUT ,STEP_OUT , STEP_OUT ,0 ,0 ,0 ,0 ,0 ,0 ,0 , 0 ,0 ,0 ,STEP_OVER,0 ,0 ,0 ,0 , diff --git a/src/devices/imagedev/floppy.cpp b/src/devices/imagedev/floppy.cpp index 82e323cd15a9f..8dd70d5fd62a1 100644 --- a/src/devices/imagedev/floppy.cpp +++ b/src/devices/imagedev/floppy.cpp @@ -610,7 +610,10 @@ std::pair floppy_image_devi } } - return{ std::error_condition(), best_format }; + if(best_format) + return{ std::error_condition(), best_format }; + else + return{ image_error::INVALIDIMAGE, nullptr }; } void floppy_image_device::init_floppy_load(bool write_supported) diff --git a/src/devices/machine/6525tpi.cpp b/src/devices/machine/6525tpi.cpp index cffb9ba5f50be..addebf837b1da 100644 --- a/src/devices/machine/6525tpi.cpp +++ b/src/devices/machine/6525tpi.cpp @@ -476,7 +476,18 @@ void tpi6525_device::write(offs_t offset, uint8_t data) m_port_c = data; if (!INTERRUPT_MODE) + { m_out_pc_cb((offs_t)0, (m_port_c & m_ddr_c) | (m_ddr_c ^ 0xff)); + } + else + { + // clear latches + if (BIT(data, 0) == 0) m_irq_level[0] = 1; + if (BIT(data, 1) == 0) m_irq_level[1] = 1; + if (BIT(data, 2) == 0) m_irq_level[2] = 1; + if (BIT(data, 3) == 0) m_irq_level[3] = INTERRUPT3_RISING_EDGE ? 0 : 1; + if (BIT(data, 4) == 0) m_irq_level[4] = INTERRUPT4_RISING_EDGE ? 0 : 1; + } break; case 3: @@ -532,20 +543,3 @@ void tpi6525_device::port_line_w(uint8_t &port, int line, int state) port &= ~(1 << line); port |= state << line; } - -/* this should probably be done better, needed for amigacd.c */ - -uint8_t tpi6525_device::get_ddr_a() -{ - return m_ddr_a; -} - -uint8_t tpi6525_device::get_ddr_b() -{ - return m_ddr_b; -} - -uint8_t tpi6525_device::get_ddr_c() -{ - return m_ddr_c; -} diff --git a/src/devices/machine/6525tpi.h b/src/devices/machine/6525tpi.h index 9aefd8a4a2a1d..c2487bde39b12 100644 --- a/src/devices/machine/6525tpi.h +++ b/src/devices/machine/6525tpi.h @@ -78,10 +78,6 @@ class tpi6525_device : public device_t void pb6_w(int state) { port_line_w(m_in_b, 6, state); } void pb7_w(int state) { port_line_w(m_in_b, 7, state); } - uint8_t get_ddr_a(); - uint8_t get_ddr_b(); - uint8_t get_ddr_c(); - protected: // device-level overrides virtual void device_start() override ATTR_COLD; diff --git a/src/devices/machine/am9513.cpp b/src/devices/machine/am9513.cpp index 4f168c7f23123..5baf568ca3b2b 100644 --- a/src/devices/machine/am9513.cpp +++ b/src/devices/machine/am9513.cpp @@ -448,7 +448,7 @@ void am9513_device::set_counter_mode(int c, u16 data) } if ((data & 0x0018) != (m_counter_mode[c] & 0x0018)) - LOGMASKED(LOG_MODE, "Counter %d: %s %s count\n", c + 1, BIT(data, 4) ? "BCD" : "Binary", BIT(data, 3) ? "up" : "down"); + LOGMASKED(LOG_MODE, "Counter %d: %s %s count %s\n", c + 1, BIT(data, 4) ? "BCD" : "Binary", BIT(data, 3) ? "up" : "down", BIT(data, 5) ? "repetitively" : "once"); if ((data & 0x0007) != (m_counter_mode[c] & 0x0007)) { @@ -620,8 +620,13 @@ void am9513_device::set_tc(int c, bool state) // TC cascading if ((m_counter_mode[d] & 0x1f00) == (state ? 0x0000 : 0x1000)) + { + LOGMASKED(LOG_TC, "Counter %d: TC cascade Next Count %u \n", c + 1, m_count[d]); + count_edge(d); + } + // TC gating if ((m_counter_mode[d] & 0xe000) == 0x2000) gate_count(d, state && (bus_is_16_bit() || m_gate_alt[d])); @@ -1238,7 +1243,10 @@ void am9513_device::command_write(u8 data) if (BIT(data, 6)) step_counter(c, true); if (BIT(data, 5)) + { + LOGMASKED(LOG_MODE, "Arm Counter %d\n", c + 1); arm_counter(c); + } } } break; @@ -1251,9 +1259,15 @@ void am9513_device::command_write(u8 data) if (BIT(data, c)) { if (!BIT(data, 5)) + { + LOGMASKED(LOG_MODE, "Disarm Counter %d\n", c + 1); disarm_counter(c); + } if (!BIT(data, 6)) + { + LOGMASKED(LOG_MODE, "Save Counter %d\n", c + 1); save_counter(c); + } } } break; @@ -1270,6 +1284,7 @@ void am9513_device::command_write(u8 data) case 0xe3: case 0xeb: // Clear/set toggle out for counter 3 case 0xe4: case 0xec: // Clear/set toggle out for counter 4 case 0xe5: case 0xed: // Clear/set toggle out for counter 5 + LOGMASKED(LOG_MODE, "Counter %d: %s output\n", data & 7, BIT(data, 3) ? "Set" : "Clear"); set_toggle((data & 7) - 1, BIT(data, 3)); break; case 0xe6: case 0xee: // Clear/set MM12 (FOUT gate on/FOUT gate off) @@ -1277,6 +1292,7 @@ void am9513_device::command_write(u8 data) m_mmr = ((m_mmr & ~(1 << 12)) | BIT(data, 3) << 12); break; case 0xe7: case 0xef: // Clear/set MM13 (8-bit bus/16-bit bus) + LOGMASKED(LOG_MODE, "Data Bus Width = %d-Bit\n", BIT(data, 3) ? 16 : 8); m_mmr = ((m_mmr & ~(1 << 13)) | BIT(data, 3) << 13); break; case 0xf1: // Step counter 1 @@ -1284,6 +1300,7 @@ void am9513_device::command_write(u8 data) case 0xf3: // Step counter 3 case 0xf4: // Step counter 4 case 0xf5: // Step counter 5 + LOGMASKED(LOG_MODE, "Counter %d: Step\n", data & 7); step_counter((data & 7) - 1, false); break; case 0xff: // Master reset diff --git a/src/devices/machine/cr511b.cpp b/src/devices/machine/cr511b.cpp index 3ac800c1db727..dc3fa967ba528 100644 --- a/src/devices/machine/cr511b.cpp +++ b/src/devices/machine/cr511b.cpp @@ -1,97 +1,764 @@ -// license:BSD-3-Clause -// copyright-holders:Dirk Best +// license: BSD-3-Clause +// copyright-holders: Dirk Best /*************************************************************************** CR-511-B CD-ROM drive CD-ROM drive with a custom MKE/Panasonic interface as used in the - Commodore CDTV and early SoundBlaster cards. + Commodore CDTV. Similar to the interface on early SoundBlaster cards. + + Hardware: + - MN188161REB1 + - M50423FP + - 4464S-08LL + - LC8951 + + TODO: + - Subcode P-W data + - Timing for status data or status change ***************************************************************************/ #include "emu.h" #include "cr511b.h" +#define LOG_CMD (1 << 1) +#define LOG_PARAM (1 << 2) +#define LOG_DATA (1 << 3) +#define LOG_SUBQ (1 << 4) +#define LOG_SUBQ2 (1 << 5) // log subq data to popmessage + +#define VERBOSE (LOG_GENERAL | LOG_CMD | LOG_PARAM) + +#define LOGPARAM LOGMASKED(LOG_PARAM, "-> Param: %02x %02x %02x %02x %02x %02x\n", \ + m_input_fifo[1], m_input_fifo[2], m_input_fifo[3], \ + m_input_fifo[4], m_input_fifo[5], m_input_fifo[6]) + +#include "logmacro.h" + //************************************************************************** -// DEVICE DEFINITIONS +// TYPE DEFINITIONS //************************************************************************** DEFINE_DEVICE_TYPE(CR511B, cr511b_device, "cr511b", "CR-511-B CD-ROM drive") -//------------------------------------------------- -// device_add_mconfig - add device configuration -//------------------------------------------------- +cr511b_device::cr511b_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : + cdrom_image_device(mconfig, CR511B, tag, owner, clock), + device_mixer_interface(mconfig, *this, 2), + m_cdda(*this, "cdda"), + m_stch_cb(*this), + m_sten_cb(*this), + m_drq_cb(*this), + m_dten_cb(*this), + m_scor_cb(*this), + m_input_fifo_pos(0), + m_output_fifo_pos(0), + m_output_fifo_length(0), + m_status(0), + m_enabled(false), + m_cmd(false), + m_status_ready(false), + m_data_ready(false) +{ + set_interface("cdrom"); +} + + +//************************************************************************** +// MACHINE DEFINITIONS +//************************************************************************** void cr511b_device::device_add_mconfig(machine_config &config) { - CDROM(config, m_cdrom).set_interface("cdrom"); CDDA(config, m_cdda); - m_cdda->add_route(0, ":lspeaker", 1.0); - m_cdda->add_route(1, ":rspeaker", 1.0); - m_cdda->set_cdrom_tag("cdrom"); + m_cdda->add_route(0, DEVICE_SELF, 1.0, AUTO_ALLOC_INPUT, 0); + m_cdda->add_route(1, DEVICE_SELF, 1.0, AUTO_ALLOC_INPUT, 1); + m_cdda->set_cdrom_tag(*this); + m_cdda->audio_end_cb().set(FUNC(cr511b_device::audio_end_cb)); } //************************************************************************** -// LIVE DEVICE +// MACHINE EMULATION //************************************************************************** -//------------------------------------------------- -// cr511b_device - constructor -//------------------------------------------------- +void cr511b_device::device_start() +{ + cdrom_image_device::device_start(); -cr511b_device::cr511b_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : - device_t(mconfig, CR511B, tag, owner, clock), - m_cdrom(*this, "cdrom"), - m_cdda(*this, "cdda"), - m_stch_handler(*this), - m_sten_handler(*this), - m_drq_handler(*this), - m_dten_handler(*this), - m_scor_handler(*this), - m_xaen_handler(*this), - //m_motor(false), - m_enabled(-1), - m_cmd(-1) + m_frame_timer = timer_alloc(FUNC(cr511b_device::frame_cb), this); + m_stch_timer = timer_alloc(FUNC(cr511b_device::stch), this); + m_sten_timer = timer_alloc(FUNC(cr511b_device::sten), this); + + std::fill(std::begin(m_input_fifo), std::end(m_input_fifo), 0x00); + std::fill(std::begin(m_output_fifo), std::end(m_output_fifo), 0x00); + + // register for save states + save_item(NAME(m_input_fifo)); + save_item(NAME(m_input_fifo_pos)); + save_item(NAME(m_output_fifo)); + save_item(NAME(m_output_fifo_pos)); + save_item(NAME(m_output_fifo_length)); + save_item(NAME(m_status)); + save_item(NAME(m_sector_size)); + save_item(NAME(m_transfer_lba)); + save_item(NAME(m_transfer_sectors)); + save_item(NAME(m_transfer_length)); + save_item(NAME(m_transfer_buffer)); + save_item(NAME(m_transfer_buffer_pos)); + save_item(NAME(m_enabled)); + save_item(NAME(m_cmd)); + save_item(NAME(m_status_ready)); + save_item(NAME(m_data_ready)); +} + +void cr511b_device::device_reset() { + cdrom_image_device::device_reset(); + + m_input_fifo_pos = 0; + m_output_fifo_pos = 0; + m_output_fifo_length = 0; + + m_status_ready = false; + m_data_ready = false; + + m_status = STATUS_READY; + + if (exists()) + m_status |= STATUS_MEDIA; + + m_sten_cb(1); + m_stch_cb(0); } -//------------------------------------------------- -// device_start - device-specific startup -//------------------------------------------------- +std::pair cr511b_device::call_load() +{ + auto ret = cdrom_image_device::call_load(); -void cr511b_device::device_start() + if (!ret.first) + status_change(m_status | STATUS_MEDIA); + + return ret; +} + +void cr511b_device::call_unload() { + status_change(STATUS_READY); + + cdrom_image_device::call_unload(); } -//------------------------------------------------- -// device_reset - device-specific reset -//------------------------------------------------- +uint32_t cr511b_device::lba_to_msf(int32_t lba) +{ + uint32_t msf = 0; + + lba += 2 * 75; // lba 0 is equivalent to msf 00:02:00 -void cr511b_device::device_reset() + msf |= ((lba / (60 * 75)) & 0xff) << 16; + msf |= (((lba / 75) % 60) & 0xff) << 8; + msf |= ((lba % 75) & 0xff) << 0; + + return msf; +} + +int32_t cr511b_device::msf_to_lba(uint32_t msf) { + uint32_t lba = 0; + + lba += ((msf >> 16) & 0xff) * 60 * 75; + lba += ((msf >> 8) & 0xff) * 75; + lba += ((msf >> 0) & 0xff); + + lba -= 2 * 75; // msf 00:02:00 is equivalent to lba 0 + + return lba; } -//************************************************************************** -// IMPLEMENTATION -//************************************************************************** +int cr511b_device::size_to_track_type() +{ + switch (m_sector_size) + { + case 2048: return cdrom_file::CD_TRACK_MODE1; + } + + // have only seen 2048 so far + fatalerror("Unknown sector mode: %d\n", m_sector_size); +} + +TIMER_CALLBACK_MEMBER(cr511b_device::frame_cb) +{ + if (m_transfer_sectors > 0) + { + // old data hasn't been read completely yet + if (m_data_ready) + return; + + LOGMASKED(LOG_DATA, "Reading sector: %d\n", m_transfer_lba); + + read_data(m_transfer_lba, m_transfer_buffer, size_to_track_type()); + + // prepare for next sector + m_transfer_lba++; + m_transfer_sectors--; + m_transfer_buffer_pos = 0; + + // signal that we have data + m_data_ready = true; + m_drq_cb(1); + } + else if (m_status & STATUS_PLAYING) + { + // TODO: subcode handling + m_scor_cb(0); + m_scor_cb(1); + } +} + +TIMER_CALLBACK_MEMBER(cr511b_device::stch) +{ + m_stch_cb(1); + m_stch_cb(0); +} + +void cr511b_device::status_change(uint8_t status) +{ + if (m_status != status) + { + m_status = status; + + if (m_status & STATUS_MOTOR) + m_frame_timer->adjust(attotime::from_hz(75), 0, attotime::from_hz(75)); + else + m_frame_timer->adjust(attotime::never); + + m_stch_timer->adjust(attotime::from_usec(64 * 3)); // TODO + } +} + +TIMER_CALLBACK_MEMBER(cr511b_device::sten) +{ + m_status_ready = true; + + m_sten_cb(0); + m_sten_cb(1); +} + +void cr511b_device::status_enable(uint8_t output_length) +{ + m_input_fifo_pos = 0; + m_output_fifo_pos = 0; + m_output_fifo_length = output_length; + + // do we have status data to send? + if (m_output_fifo_length > 0) + { + if (m_input_fifo[0] != 0x87 || (VERBOSE & LOG_SUBQ)) + LOGMASKED(LOG_CMD, "-> Output: %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x\n", m_output_fifo[0], m_output_fifo[1], m_output_fifo[2], m_output_fifo[3], m_output_fifo[4], m_output_fifo[5], m_output_fifo[6], m_output_fifo[7], m_output_fifo[8], m_output_fifo[9], m_output_fifo[10], m_output_fifo[11]); + + m_sten_timer->adjust(attotime::from_usec(64 * 4)); // TODO + } +} + +void cr511b_device::audio_end_cb(int state) +{ + if (!state) + return; + + LOGMASKED(LOG_CMD, "Playing audio finished\n", state); + + status_change(m_status & ~STATUS_PLAYING); +} uint8_t cr511b_device::read() { - return 0xff; + uint8_t data = 0xff; + + if (!m_enabled) + { + LOG("Read while not enabled!\n"); + return data; + } + + if (m_cmd) + { + // command mode + if (m_status_ready) + { + data = m_output_fifo[m_output_fifo_pos]; + + // clear old data once read + m_output_fifo[m_output_fifo_pos++] = 0x00; + + LOGMASKED(LOG_DATA, "Data from drive: %02x (%d of %d)\n", data, m_output_fifo_pos, m_output_fifo_length); + + // more data? + if (m_output_fifo_pos < m_output_fifo_length) + { + m_sten_cb(0); + m_sten_cb(1); + } + else + { + m_status_ready = false; + } + } + } + else + { + // data mode + if (m_data_ready) + { + data = m_transfer_buffer[m_transfer_buffer_pos]; + m_transfer_length--; + + LOGMASKED(LOG_DATA, "Data = %02x, pos %d, length %d\n", data, m_transfer_buffer_pos, m_transfer_length); + + // finished transferring this sector? + if (++m_transfer_buffer_pos == m_sector_size) + { + m_data_ready = false; + m_drq_cb(0); + + if (m_transfer_sectors == 0) + { + LOGMASKED(LOG_DATA, "Read done\n"); + status_change(m_status | STATUS_SUCCESS); + } + } + } + } + + return data; } void cr511b_device::write(uint8_t data) { + // verify that we're enabled and are in command mode + if (!m_enabled || !m_cmd) + { + LOG("Invalid write: %02x (enabled: %d, cmd: %d)\n", data, m_enabled, m_cmd); + return; + } + + m_input_fifo[m_input_fifo_pos++] = data; + + switch (m_input_fifo[0]) + { + case 0x01: if (m_input_fifo_pos == 7) cmd_seek(); break; + case 0x02: if (m_input_fifo_pos == 7) cmd_read(); break; + case 0x04: if (m_input_fifo_pos == 7) cmd_motor_on(); break; + case 0x05: if (m_input_fifo_pos == 7) cmd_motor_off(); break; + case 0x09: if (m_input_fifo_pos == 7) cmd_play_lba(); break; + case 0x0a: if (m_input_fifo_pos == 7) cmd_play_msf(); break; + case 0x0b: if (m_input_fifo_pos == 7) cmd_play_track(); break; + case 0x81: if (m_input_fifo_pos == 1) cmd_read_status(); break; + case 0x82: if (m_input_fifo_pos == 7) cmd_read_error(); break; + case 0x84: if (m_input_fifo_pos == 7) cmd_set_mode(); break; + case 0x87: if (m_input_fifo_pos == 7) cmd_read_subq(); break; + case 0x89: if (m_input_fifo_pos == 7) cmd_read_disc_info(); break; + case 0x8a: if (m_input_fifo_pos == 7) cmd_read_toc(); break; + case 0x8b: if (m_input_fifo_pos == 7) cmd_pause(); break; + case 0xa3: if (m_input_fifo_pos == 7) cmd_front_panel(); break; + + default: + LOG("Unknown command: %02x\n", m_input_fifo[0]); + status_enable(0); + break; + } +} + +void cr511b_device::cmd_w(int state) +{ + m_cmd = !bool(state); // active low } void cr511b_device::enable_w(int state) { - m_enabled = state; + m_enabled = !bool(state); // active low } -void cr511b_device::cmd_w(int state) +void cr511b_device::cmd_seek() +{ + LOGMASKED(LOG_CMD, "Command: Seek\n"); + LOGPARAM; + + // TODO: Does this enable STATUS_SUCCESS? + + status_change(m_status | STATUS_MOTOR); + status_enable(0); +} + +void cr511b_device::cmd_read() +{ + LOGMASKED(LOG_CMD, "Command: Read\n"); + LOGPARAM; + + m_transfer_lba = (m_input_fifo[1] << 16) | (m_input_fifo[2] << 8) | (m_input_fifo[3] << 0); + m_transfer_sectors = (m_input_fifo[4] << 8) | (m_input_fifo[5] << 0); + m_transfer_length = m_transfer_sectors * m_sector_size; + + LOGMASKED(LOG_CMD, "-> LBA %d, sectors %d\n", m_transfer_lba, m_transfer_sectors); + + m_cdda->stop_audio(); + + uint8_t status = m_status; + + status &= ~STATUS_PLAYING; + status |= STATUS_MOTOR; + + status_change(status); + status_enable(0); +} + +void cr511b_device::cmd_motor_on() +{ + LOGMASKED(LOG_CMD, "Command: Motor On\n"); + LOGPARAM; + + // TODO: Does this enable STATUS_SUCCESS? + + status_change(m_status | STATUS_MOTOR); + status_enable(0); +} + +void cr511b_device::cmd_motor_off() +{ + LOGMASKED(LOG_CMD, "Command: Motor Off\n"); + LOGPARAM; + + // TODO: Does this enable STATUS_SUCCESS? + + status_change(m_status & ~STATUS_MOTOR); + status_enable(0); +} + +void cr511b_device::cmd_play_lba() { - m_cmd = state; + LOGMASKED(LOG_CMD, "Command: Play LBA\n"); + LOGPARAM; + + // haven't found anything that uses it yet + fatalerror("Play LBA: Not implemented\n"); +} + +void cr511b_device::cmd_play_msf() +{ + LOGMASKED(LOG_CMD, "Command: Play MSF\n"); + LOGPARAM; + + uint32_t start = (m_input_fifo[1] << 16) | (m_input_fifo[2] << 8) | (m_input_fifo[3] << 0); + uint32_t end = (m_input_fifo[4] << 16) | (m_input_fifo[5] << 8) | (m_input_fifo[6] << 0); + + int32_t start_lba = msf_to_lba(start); + int32_t end_lba = msf_to_lba(end); + + // play to the end of the disc? + if (end == 0xffffff) + end_lba = get_track_start(0xaa) - 1; + + if (start == 0 && end == 0) + { + LOGMASKED(LOG_CMD, "Stop audio\n"); + + uint8_t status = m_status; + + if (m_cdda->audio_active()) + status |= STATUS_SUCCESS; + + m_cdda->stop_audio(); + + status &= ~STATUS_PLAYING; + status &= ~STATUS_MOTOR; + + status_change(status); + } + else if (start_lba < end_lba) + { + LOGMASKED(LOG_CMD, "Playing audio %02d:%02d.%02d to %02d:%02d.%02d (LBA %d to %d)\n", + m_input_fifo[1], m_input_fifo[2], m_input_fifo[3], + m_input_fifo[4], m_input_fifo[5], m_input_fifo[6], start_lba, end_lba); + + m_cdda->start_audio(start_lba, end_lba - start_lba); + + uint8_t status = m_status; + + status |= STATUS_PLAYING; + status |= STATUS_MOTOR; + + status_change(status); + } + else + { + LOGMASKED(LOG_CMD, "Invalid range %d to %d!\n", start_lba, end_lba); + status_change(m_status | STATUS_ERROR); + } + + status_enable(0); +} + +void cr511b_device::cmd_play_track() +{ + LOGMASKED(LOG_CMD, "Command: Play Track\n"); + LOGPARAM; + + uint8_t start_track = m_input_fifo[1]; + uint8_t start_index = m_input_fifo[2]; // TODO + uint8_t end_track = m_input_fifo[3]; + uint8_t end_index = m_input_fifo[4]; // TODO + + uint32_t start_lba = get_track_start(start_track - 1); + uint32_t end_lba = get_track_start(end_track - 1) - 1; + + LOGMASKED(LOG_CMD, "Playing audio track %d-%d to %d-%d (LBA %d to %d)\n", start_track, start_index, end_track, end_index, start_lba, end_lba); + + m_cdda->start_audio(start_lba, end_lba - start_lba); + + status_change(m_status | STATUS_PLAYING | STATUS_MOTOR); + status_enable(0); +} + +void cr511b_device::cmd_read_status() +{ + LOGMASKED(LOG_CMD, "Command: Read Status\n"); + + m_status &= ~STATUS_SUCCESS; + + m_output_fifo[0] = m_status; + + status_enable(1); +} + +void cr511b_device::cmd_read_error() +{ + LOGMASKED(LOG_CMD, "Command: Read Error\n"); + LOGPARAM; + + m_status &= ~STATUS_ERROR; + m_status |= STATUS_READY; + m_status |= STATUS_SUCCESS; + + m_output_fifo[2] |= (m_status & 0x10); + + status_enable(6); +} + +void cr511b_device::cmd_version() +{ + LOGMASKED(LOG_CMD, "Command: Version\n"); + LOGPARAM; + + // haven't found anything that uses it yet + fatalerror("Version: Not implemented\n"); +} + +void cr511b_device::cmd_set_mode() +{ + LOGMASKED(LOG_CMD, "Command: Set Mode\n"); + LOGPARAM; + + // 01: unknown (value seen: 02) + // 02: sector size hi + // 03: sector size lo + // 04: unknown (value seen 00) + // 05: unknown (value seen 0f) + // 06: unknown (value seen 00) + + m_sector_size = (m_input_fifo[2] << 8) | m_input_fifo[3]; + + LOGMASKED(LOG_CMD, "Sector size = %d\n", m_sector_size); + + m_status |= STATUS_SUCCESS; // ? + + status_enable(0); +} + +void cr511b_device::cmd_read_subq() +{ + LOGMASKED(LOG_SUBQ, "Command: Read SubQ\n"); + if (VERBOSE & LOG_SUBQ) + LOGPARAM; + + // 01: bit 1 - msf or lba + // 02: unknown + // 03: unknown + // 04: unknown + // 05: unknown + // 06: unknown + + bool msf = bool(BIT(m_input_fifo[1], 1)); + + if (m_cdda->audio_active()) + { + uint32_t lba = m_cdda->get_audio_lba(); + uint8_t track = get_track(lba); + + uint32_t disc_pos = lba; + uint32_t track_pos = lba - get_track_start(track); + + if (msf) + { + disc_pos = lba_to_msf(disc_pos); + track_pos = lba_to_msf(track_pos - 150); + + if (VERBOSE & LOG_SUBQ2) + popmessage("Playing track %d at %02d:%02d.%02d (disc %02d:%02d.%02d)", track + 1, + track_pos >> 16 & 0xff, track_pos >> 8 & 0xff, track_pos & 0xff, + disc_pos >> 16 & 0xff, disc_pos >> 8 & 0xff, disc_pos & 0xff); + } + else + { + if (VERBOSE & LOG_SUBQ2) + popmessage("Playing track %d at %d (disc %d)", track, track_pos, disc_pos); + } + + m_output_fifo[1] = get_adr_control(track); + m_output_fifo[2] = track + 1; + m_output_fifo[3] = 0x01; // TODO: index + + m_output_fifo[4] = disc_pos >> 24; + m_output_fifo[5] = disc_pos >> 16; + m_output_fifo[6] = disc_pos >> 8; + m_output_fifo[7] = disc_pos >> 0; + m_output_fifo[8] = track_pos >> 24; + m_output_fifo[9] = track_pos >> 16; + m_output_fifo[10] = track_pos >> 8; + m_output_fifo[11] = track_pos >> 0; + m_output_fifo[12] = 0; // TODO: upc flag + + if (m_cdda->audio_paused()) + m_output_fifo[0] = AUDIO_STATUS_PAUSED; + else + m_output_fifo[0] = AUDIO_STATUS_PLAY; + } + else if (m_cdda->audio_ended()) + m_output_fifo[0] = AUDIO_STATUS_COMPLETED; + else + m_output_fifo[0] = AUDIO_STATUS_NO_STATUS; + + LOGMASKED(LOG_SUBQ, "-> Audio status = %02x\n", m_output_fifo[0]); + + status_enable(13); +} + +void cr511b_device::cmd_read_disc_info() +{ + LOGMASKED(LOG_CMD, "Command: Read Disc Info\n"); + LOGPARAM; + + uint8_t last_track = get_last_track(); + uint32_t last_lba = get_track_start(0xaa); + uint32_t last_msf = lba_to_msf(last_lba); + + m_output_fifo[0] = 1; // first track + m_output_fifo[1] = last_track; + m_output_fifo[2] = last_msf >> 16; + m_output_fifo[3] = last_msf >> 8; + m_output_fifo[4] = last_msf >> 0; + + status_change(m_status | STATUS_MOTOR | STATUS_SUCCESS); + status_enable(5); +} + +void cr511b_device::cmd_read_toc() +{ + LOGMASKED(LOG_CMD, "Command: Read TOC\n"); + LOGPARAM; + + // 01: bit 1 - msf or lba + // 02: track + // 03: unused? + // 04: unused? + // 05: unused? + // 06: unused? + + bool msf = bool(BIT(m_input_fifo[1], 1)); + uint8_t track = m_input_fifo[2]; + + uint8_t status = m_status; + + status |= STATUS_MOTOR; + + if (track > get_last_track()) + { + LOGMASKED(LOG_CMD, "Invalid track requested: %d\n", track); + + status |= STATUS_ERROR; + status_enable(0); + } + else if (track == 0) + { + uint32_t track_start = get_track_start(0xaa); + + LOGMASKED(LOG_CMD, "Track 0 requested, lead out start %d\n", track_start); + + if (msf) + track_start = lba_to_msf(track_start); + + m_output_fifo[1] = get_adr_control(0xaa); + m_output_fifo[2] = 1; // first track + m_output_fifo[3] = get_last_track(); + m_output_fifo[4] = track_start >> 24; + m_output_fifo[5] = track_start >> 16; + m_output_fifo[6] = track_start >> 8; + m_output_fifo[7] = track_start >> 0; + + status_enable(8); + } + else + { + uint32_t track_start = get_track_start(track - 1); + + LOGMASKED(LOG_CMD, "Track %d requested, start %d\n", track, track_start); + + if (msf) + track_start = lba_to_msf(track_start); + + m_output_fifo[1] = get_adr_control(track - 1); + m_output_fifo[2] = track; + m_output_fifo[3] = 0; + m_output_fifo[4] = track_start >> 24; + m_output_fifo[5] = track_start >> 16; + m_output_fifo[6] = track_start >> 8; + m_output_fifo[7] = track_start >> 0; + + status_enable(8); + } + + status_change(status); +} + +void cr511b_device::cmd_pause() +{ + LOGMASKED(LOG_CMD, "Command: Pause\n"); + LOGPARAM; + + // 01: 00 = pause audio, other values? + // 02: unused? + // 03: unused? + // 04: unused? + // 05: unused? + // 06: unused? + + m_cdda->pause_audio(m_input_fifo[1] == 0x00); + + status_enable(0); +} + +void cr511b_device::cmd_front_panel() +{ + LOGMASKED(LOG_CMD, "Command: Front Panel\n"); + LOGPARAM; + + // enables direct control of the drive by the front panel buttons: stop, play/pause, ff, rew + + // 01: enable/disable + // 02: unused? + // 03: unused? + // 04: unused? + // 05: unused? + // 06: unused? + + status_enable(0); } diff --git a/src/devices/machine/cr511b.h b/src/devices/machine/cr511b.h index 0575562b2d4ed..e773c8b1f82ca 100644 --- a/src/devices/machine/cr511b.h +++ b/src/devices/machine/cr511b.h @@ -1,11 +1,11 @@ -// license:BSD-3-Clause -// copyright-holders:Dirk Best +// license: BSD-3-Clause +// copyright-holders: Dirk Best /*************************************************************************** CR-511-B CD-ROM drive CD-ROM drive with a custom MKE/Panasonic interface as used in the - Commodore CDTV and early SoundBlaster cards. + Commodore CDTV. Similar to the interface on early SoundBlaster cards. 1 _RESET 2 GND 3 EFFK 4 SCCK @@ -38,65 +38,122 @@ #include "imagedev/cdromimg.h" #include "sound/cdda.h" -class cr511b_device : public device_t + +class cr511b_device : public cdrom_image_device, public device_mixer_interface { public: - // construction/destruction cr511b_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // callbacks - auto stch_handler() { return m_stch_handler.bind(); } - auto sten_handler() { return m_sten_handler.bind(); } - auto drq_handler() { return m_drq_handler.bind(); } - auto dten_handler() { return m_dten_handler.bind(); } - auto scor_handler() { return m_scor_handler.bind(); } - auto xaen_handler() { return m_xaen_handler.bind(); } + auto stch_cb() { return m_stch_cb.bind(); } + auto sten_cb() { return m_sten_cb.bind(); } + auto drq_cb() { return m_drq_cb.bind(); } + auto dten_cb() { return m_dten_cb.bind(); } + auto scor_cb() { return m_scor_cb.bind(); } uint8_t read(); void write(uint8_t data); - void enable_w(int state); void cmd_w(int state); + void enable_w(int state); protected: - // device-level overrides + virtual void device_add_mconfig(machine_config &config) override ATTR_COLD; virtual void device_start() override ATTR_COLD; virtual void device_reset() override ATTR_COLD; - virtual void device_add_mconfig(machine_config &config) override ATTR_COLD; + + // device_image_interface implementation + virtual std::pair call_load() override; + virtual void call_unload() override; private: - enum - { - STATUS_DOOR_CLOSED = 0x80, - STATUS_MEDIA = 0x40, - STATUS_MOTOR = 0x20, - STATUS_ERROR = 0x10, - STATUS_SUCCESS = 0x08, - STATUS_PLAYING = 0x04, - STATUS_DOOR_LOCKED = 0x02, - STATUS_READY = 0x01 - }; - - required_device m_cdrom; + uint32_t lba_to_msf(int32_t lba); + int32_t msf_to_lba(uint32_t msf); + int size_to_track_type(); + + TIMER_CALLBACK_MEMBER(frame_cb); + + TIMER_CALLBACK_MEMBER(stch); + void status_change(uint8_t status); + + TIMER_CALLBACK_MEMBER(sten); + void status_enable(uint8_t output_length); + + void audio_end_cb(int state); + + // commands + void cmd_seek(); + void cmd_read(); + void cmd_motor_on(); + void cmd_motor_off(); + void cmd_play_lba(); + void cmd_play_msf(); + void cmd_play_track(); + void cmd_read_status(); + void cmd_read_error(); + void cmd_version(); + void cmd_set_mode(); + void cmd_read_subq(); + void cmd_read_disc_info(); + void cmd_read_toc(); + void cmd_pause(); + void cmd_front_panel(); + + // drive status + static constexpr uint8_t STATUS_DOOR_CLOSED = 0x80; // unverified, not used + static constexpr uint8_t STATUS_MEDIA = 0x40; + static constexpr uint8_t STATUS_MOTOR = 0x20; + static constexpr uint8_t STATUS_ERROR = 0x10; + static constexpr uint8_t STATUS_SUCCESS = 0x08; // last command has successfully executed + static constexpr uint8_t STATUS_PLAYING = 0x04; + static constexpr uint8_t STATUS_DOOR_LOCKED = 0x02; // unverified, not used + static constexpr uint8_t STATUS_READY = 0x01; + + // audio status + static constexpr uint8_t AUDIO_STATUS_INVALID = 0x00; + static constexpr uint8_t AUDIO_STATUS_PLAY = 0x11; + static constexpr uint8_t AUDIO_STATUS_PAUSED = 0x12; + static constexpr uint8_t AUDIO_STATUS_COMPLETED = 0x13; + static constexpr uint8_t AUDIO_STATUS_ERROR = 0x14; + static constexpr uint8_t AUDIO_STATUS_NO_STATUS = 0x15; + required_device m_cdda; - devcb_write_line m_stch_handler; - devcb_write_line m_sten_handler; - devcb_write_line m_drq_handler; - devcb_write_line m_dten_handler; - devcb_write_line m_scor_handler; - devcb_write_line m_xaen_handler; + devcb_write_line m_stch_cb; + devcb_write_line m_sten_cb; + devcb_write_line m_drq_cb; + devcb_write_line m_dten_cb; + devcb_write_line m_scor_cb; + + emu_timer *m_frame_timer; + emu_timer *m_stch_timer; + emu_timer *m_sten_timer; + + uint8_t m_input_fifo[16]; + uint8_t m_input_fifo_pos; + + uint8_t m_output_fifo[16]; + uint8_t m_output_fifo_pos; + uint8_t m_output_fifo_length; + + uint8_t m_status; + uint16_t m_sector_size; - //bool m_motor; + uint32_t m_transfer_lba; + uint16_t m_transfer_sectors; + uint32_t m_transfer_length; + uint8_t m_transfer_buffer[2352]; + uint16_t m_transfer_buffer_pos; - // state of lines - int m_enabled; - int m_cmd; + // external lines + bool m_enabled; + bool m_cmd; - // data transfer - //uint8_t m_sector_buffer[CD_MAX_SECTOR_DATA]; + bool m_status_ready; + bool m_data_ready; }; +// device type declaration DECLARE_DEVICE_TYPE(CR511B, cr511b_device) #endif // MAME_MACHINE_CR511B_H diff --git a/src/devices/machine/dmac.cpp b/src/devices/machine/dmac.cpp index 83c51fd215bb9..c4abb65fb34c4 100644 --- a/src/devices/machine/dmac.cpp +++ b/src/devices/machine/dmac.cpp @@ -14,7 +14,7 @@ - SCSI - Support newer variant - DAWR - - Data corruption when installing WB31 + - Rev 1: Data corruption when installing WB31 - FIFO? ***************************************************************************/ @@ -47,6 +47,8 @@ amiga_dmac_device::amiga_dmac_device(const machine_config &mconfig, device_type m_css_write_cb(*this), m_csx0_read_cb(*this, 0), m_csx0_write_cb(*this), + m_csx0_a4_read_cb(*this, 0), + m_csx0_a4_write_cb(*this), m_csx1_read_cb(*this, 0), m_csx1_write_cb(*this), m_sdack_read_cb(*this, 0), @@ -99,6 +101,7 @@ void amiga_dmac_device::map(address_map &map) map(0x008e, 0x008f).w(FUNC(amiga_dmac_device::dawr_w)); map(0x0090, 0x0093).rw(FUNC(amiga_dmac_device::css_r), FUNC(amiga_dmac_device::css_w)).umask16(0x00ff); map(0x00a0, 0x00a7).rw(FUNC(amiga_dmac_device::csx0_r), FUNC(amiga_dmac_device::csx0_w)).umask16(0x00ff); + map(0x00b0, 0x00bf).rw(FUNC(amiga_dmac_device::csx0_a4_r), FUNC(amiga_dmac_device::csx0_a4_w)).umask16(0x00ff); // a4 + csx0 map(0x00c0, 0x00c7).rw(FUNC(amiga_dmac_device::csx1_r), FUNC(amiga_dmac_device::csx1_w)).umask16(0x00ff); map(0x00e0, 0x00e1).rw(FUNC(amiga_dmac_device::st_dma_r), FUNC(amiga_dmac_device::st_dma_w)); map(0x00e2, 0x00e3).rw(FUNC(amiga_dmac_device::sp_dma_r), FUNC(amiga_dmac_device::sp_dma_w)); @@ -192,7 +195,7 @@ TIMER_CALLBACK_MEMBER(amiga_dmac_device::update_dma) m_acr++; - if (m_rev1 && (m_cntr & CNTR_TCEN)) + if (m_cntr & CNTR_TCEN) { // we count words if ((m_acr & 1) == 0) @@ -201,6 +204,8 @@ TIMER_CALLBACK_MEMBER(amiga_dmac_device::update_dma) { LOGMASKED(LOG_DMA, "Terminal count\n"); + stop_dma(); + m_istr |= ISTR_E_INT; update_interrupts(); } @@ -254,22 +259,16 @@ void amiga_dmac_device::wtc_hi_w(offs_t offset, uint16_t data, uint16_t mem_mask { LOGMASKED(LOG_REGS, "wtc_hi_w: %04x & %04x\n", data, mem_mask); - if (m_rev1) - { - m_wtc &= (~(uint32_t) mem_mask) << 16 | 0x0000ffff; - m_wtc |= ((uint32_t) data & mem_mask) << 16; - } + m_wtc &= (~(uint32_t) mem_mask) << 16 | 0x0000ffff; + m_wtc |= ((uint32_t) data & mem_mask) << 16; } void amiga_dmac_device::wtc_lo_w(offs_t offset, uint16_t data, uint16_t mem_mask) { LOGMASKED(LOG_REGS, "wtc_lo_w: %04x & %04x\n", data, mem_mask); - if (m_rev1) - { - m_wtc &= 0xffff0000 & (~mem_mask); - m_wtc |= data & mem_mask; - } + m_wtc &= 0xffff0000 & (~mem_mask); + m_wtc |= data & mem_mask; } void amiga_dmac_device::acr_hi_w(offs_t offset, uint16_t data, uint16_t mem_mask) @@ -298,6 +297,8 @@ uint8_t amiga_dmac_device::css_r(offs_t offset) { return m_css_read_cb(offset); void amiga_dmac_device::css_w(offs_t offset, uint8_t data) { m_css_write_cb(offset, data); } uint8_t amiga_dmac_device::csx0_r(offs_t offset) { return m_csx0_read_cb(offset); } void amiga_dmac_device::csx0_w(offs_t offset, uint8_t data) { m_csx0_write_cb(offset, data); } +uint8_t amiga_dmac_device::csx0_a4_r(offs_t offset) { return m_csx0_a4_read_cb(offset); } +void amiga_dmac_device::csx0_a4_w(offs_t offset, uint8_t data) { m_csx0_a4_write_cb(offset, data); } uint8_t amiga_dmac_device::csx1_r(offs_t offset) { return m_csx1_read_cb(offset); } void amiga_dmac_device::csx1_w(offs_t offset, uint8_t data) { m_csx1_write_cb(offset, data); } diff --git a/src/devices/machine/dmac.h b/src/devices/machine/dmac.h index 3faa6e4d1f090..0bd2d1f7caa0f 100644 --- a/src/devices/machine/dmac.h +++ b/src/devices/machine/dmac.h @@ -26,6 +26,8 @@ class amiga_dmac_device : public device_t, public amiga_autoconfig auto css_write_cb() { return m_css_write_cb.bind(); } auto csx0_read_cb() { return m_csx0_read_cb.bind(); } auto csx0_write_cb() { return m_csx0_write_cb.bind(); } + auto csx0_a4_read_cb() { return m_csx0_a4_read_cb.bind(); } + auto csx0_a4_write_cb() { return m_csx0_a4_write_cb.bind(); } auto csx1_read_cb() { return m_csx1_read_cb.bind(); } auto csx1_write_cb() { return m_csx1_write_cb.bind(); } auto sdack_read_cb() { return m_sdack_read_cb.bind(); } @@ -77,6 +79,8 @@ class amiga_dmac_device : public device_t, public amiga_autoconfig void css_w(offs_t offset, uint8_t data); uint8_t csx0_r(offs_t offset); void csx0_w(offs_t offset, uint8_t data); + uint8_t csx0_a4_r(offs_t offset); + void csx0_a4_w(offs_t offset, uint8_t data); uint8_t csx1_r(offs_t offset); void csx1_w(offs_t offset, uint8_t data); @@ -120,6 +124,8 @@ class amiga_dmac_device : public device_t, public amiga_autoconfig devcb_write8 m_css_write_cb; devcb_read8 m_csx0_read_cb; devcb_write8 m_csx0_write_cb; + devcb_read8 m_csx0_a4_read_cb; + devcb_write8 m_csx0_a4_write_cb; devcb_read8 m_csx1_read_cb; devcb_write8 m_csx1_write_cb; devcb_read8 m_sdack_read_cb; @@ -165,7 +171,7 @@ class amiga_dmac_rev2_device : public amiga_dmac_device amiga_dmac_rev2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; -// device type definition +// device type declaration DECLARE_DEVICE_TYPE(AMIGA_DMAC_REV1, amiga_dmac_rev1_device) DECLARE_DEVICE_TYPE(AMIGA_DMAC_REV2, amiga_dmac_rev2_device) diff --git a/src/devices/machine/i82371sb.cpp b/src/devices/machine/i82371sb.cpp index a0b8f411534c6..376e3a9da9cc2 100644 --- a/src/devices/machine/i82371sb.cpp +++ b/src/devices/machine/i82371sb.cpp @@ -48,7 +48,7 @@ void i82371sb_isa_device::internal_io_map(address_map &map) map(0x00b2, 0x00b3).rw(FUNC(i82371sb_isa_device::read_apmcapms), FUNC(i82371sb_isa_device::write_apmcapms)); // Up to $de according to TC430HX spec? map(0x00c0, 0x00df).rw(FUNC(i82371sb_isa_device::at_dma8237_2_r), FUNC(i82371sb_isa_device::at_dma8237_2_w)); - map(0x00e0, 0x00ef).noprw(); +// map(0x00e0, 0x00ef) MCA bus (cfr. Bochs) or PnP // map(0x00f0, 0x00f0) Reset Numeric Error // map(0x0270, 0x0273) I/O read port for PnP map(0x04d0, 0x04d1).rw(FUNC(i82371sb_isa_device::eisa_irq_read), FUNC(i82371sb_isa_device::eisa_irq_write)); diff --git a/src/devices/machine/mediagx_cs5530_bridge.cpp b/src/devices/machine/mediagx_cs5530_bridge.cpp index 8521d9451feb4..8336c5aff354a 100644 --- a/src/devices/machine/mediagx_cs5530_bridge.cpp +++ b/src/devices/machine/mediagx_cs5530_bridge.cpp @@ -245,7 +245,7 @@ void mediagx_cs5530_bridge_device::internal_io_map(address_map &map) map(0x00a0, 0x00a1).rw("pic8259_slave", FUNC(pic8259_device::read), FUNC(pic8259_device::write)); map(0x00c0, 0x00df).rw(FUNC(mediagx_cs5530_bridge_device::at_dma8237_2_r), FUNC(mediagx_cs5530_bridge_device::at_dma8237_2_w)); // map(0x04d0, 0x04d1).rw(FUNC(mediagx_cs5530_bridge_device::eisa_irq_read), FUNC(mediagx_cs5530_bridge_device::eisa_irq_write)); - map(0x00e0, 0x00ef).noprw(); + // map(0x00e0, 0x00ef) MCA bus (cfr. Bochs) or PnP // map(0x121c, 0x121f) ACPI Timer count register (on rev 1.3+) } diff --git a/src/devices/machine/ncr5380.cpp b/src/devices/machine/ncr5380.cpp index 5259bf3bb4ffe..f0f5a73aa6cc2 100644 --- a/src/devices/machine/ncr5380.cpp +++ b/src/devices/machine/ncr5380.cpp @@ -2,14 +2,15 @@ // copyright-holders:Patrick Mackinlay /* - * NCR 5380 and 53C80, aka Zilog Z5380, AMD Am5380, Sony CXD1180 and others. + * NCR 5380 and 53C80, aka Zilog Z5380, AMD Am5380, Sony CXD1180, National Semiconductor DP8490, Logic Devices L5380 and others. * * Sources: * - http://bitsavers.org/components/ncr/scsi/SP-1051_NCR_5380-53C80_SCSI_Interface_Chip_Design_Manual_Mar86.pdf * * TODO: * - target mode - * - cxd1180 enhancements + * - CXD1180 enhancements + * - DP8490 enhancements */ #include "emu.h" @@ -27,6 +28,7 @@ DEFINE_DEVICE_TYPE(NCR5380, ncr5380_device, "ncr5380", "NCR 5380 SCSI") DEFINE_DEVICE_TYPE(NCR53C80, ncr53c80_device, "ncr53c80", "NCR 53C80 SCSI") DEFINE_DEVICE_TYPE(CXD1180, cxd1180_device, "cxd1180", "Sony CXD1180") +DEFINE_DEVICE_TYPE(DP8490, dp8490_device, "dp8490", "National Semiconductor DP8490 EASI") ALLOW_SAVE_TYPE(ncr5380_device::state); @@ -54,6 +56,11 @@ cxd1180_device::cxd1180_device(machine_config const &mconfig, char const *tag, d { } +dp8490_device::dp8490_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock) + : ncr5380_device(mconfig, DP8490, tag, owner, clock, true) +{ +} + void ncr5380_device::map(address_map &map) { map(0x0, 0x0).rw(FUNC(ncr5380_device::csdata_r), FUNC(ncr5380_device::odata_w)); diff --git a/src/devices/machine/ncr5380.h b/src/devices/machine/ncr5380.h index ae5b3bd4a8417..beef3c6b2904e 100644 --- a/src/devices/machine/ncr5380.h +++ b/src/devices/machine/ncr5380.h @@ -179,8 +179,15 @@ class cxd1180_device : public ncr5380_device cxd1180_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock = 0); }; +class dp8490_device : public ncr5380_device +{ +public: + dp8490_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock = 0); +}; + DECLARE_DEVICE_TYPE(NCR5380, ncr5380_device) DECLARE_DEVICE_TYPE(NCR53C80, ncr53c80_device) DECLARE_DEVICE_TYPE(CXD1180, cxd1180_device) +DECLARE_DEVICE_TYPE(DP8490, dp8490_device) #endif // MAME_MACHINE_NCR5380_H diff --git a/src/devices/machine/psion_asic9.cpp b/src/devices/machine/psion_asic9.cpp index 6bc54cd8332a6..fc7d677bfabfd 100644 --- a/src/devices/machine/psion_asic9.cpp +++ b/src/devices/machine/psion_asic9.cpp @@ -123,24 +123,7 @@ void psion_asic9_device::device_start() m_ram_space = &space(AS_A9_RAM); m_rom_space = &space(AS_A9_ROM); - switch (m_ram->size()) - { - case 0x010000: case 0x020000: - m_ram_type = 0; - break; - - case 0x040000: case 0x080000: - m_ram_type = 1; - break; - - case 0x100000: case 0x200000: - m_ram_type = 2; - break; - - case 0x400000: case 0x800000: - m_ram_type = 3; - break; - } + m_ram_type = get_ram_type(m_ram->size()); configure_ram(m_ram_type); configure_rom(); @@ -179,6 +162,44 @@ void psion_asic9_device::device_start() save_item(NAME(m_rtc)); } +uint8_t psion_asic9_device::get_ram_type(uint32_t ram_size) +{ + switch (ram_size) + { + case 0x010000: case 0x020000: + return 0; + + case 0x040000: case 0x080000: + return 1; + + case 0x100000: case 0x200000: + return 2; + + case 0x400000: case 0x800000: + return 3; + } + return 0; +} + +uint8_t psion_asic9mx_device::get_ram_type(uint32_t ram_size) +{ + switch (ram_size) + { + case 0x0080000: case 0x0100000: + return 0; + + case 0x0200000: case 0x0400000: + return 1; + + case 0x0800000: case 0x1000000: + return 2; + + case 0x2000000: case 0x4000000: + return 3; + } + return 0; +} + //------------------------------------------------- // device_reset - device-specific reset //------------------------------------------------- @@ -407,6 +428,7 @@ uint32_t psion_asic9_device::ram_device_size(uint8_t device_type) { uint32_t size = 0; + // RAM is installed in pairs, ie. 256KBits = 2 x 32K switch (device_type & 3) { case 0: size = 0x010000; break; // 256KBits @@ -417,6 +439,21 @@ uint32_t psion_asic9_device::ram_device_size(uint8_t device_type) return size; } +uint32_t psion_asic9mx_device::ram_device_size(uint8_t device_type) +{ + uint32_t size = 0; + + // TODO: unknown for A9MX but allow EPOC16 to correctly identify 2MB fitted to all MX machines. + switch (device_type & 3) + { + case 0: size = 0x0040000; break; + case 1: size = 0x0100000; break; + case 2: size = 0x0400000; break; + case 3: size = 0x1000000; break; + } + return size; +} + void psion_asic9_device::configure_ram(uint8_t device_type) { uint32_t device_size_actual = ram_device_size(m_ram_type); diff --git a/src/devices/machine/psion_asic9.h b/src/devices/machine/psion_asic9.h index 9e328a26fccc9..d955f3708377b 100644 --- a/src/devices/machine/psion_asic9.h +++ b/src/devices/machine/psion_asic9.h @@ -68,6 +68,9 @@ class psion_asic9_device : public device_t, virtual space_config_vector memory_space_config() const override; + virtual uint32_t ram_device_size(uint8_t device_type); + virtual uint8_t get_ram_type(uint32_t ram_size); + private: required_device m_v30; required_device m_ram; @@ -104,7 +107,6 @@ class psion_asic9_device : public device_t, offs_t translate_address(offs_t offset); uint8_t m_ram_type; - uint32_t ram_device_size(uint8_t device_type); void configure_ram(uint8_t device_type = 0); void configure_rom(); @@ -169,6 +171,10 @@ class psion_asic9mx_device : public psion_asic9_device public: // construction/destruction psion_asic9mx_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + +protected: + virtual uint32_t ram_device_size(uint8_t device_type) override; + virtual uint8_t get_ram_type(uint32_t ram_size) override; }; diff --git a/src/devices/machine/psion_ssd.cpp b/src/devices/machine/psion_ssd.cpp index 74b223959cca5..670439574775a 100644 --- a/src/devices/machine/psion_ssd.cpp +++ b/src/devices/machine/psion_ssd.cpp @@ -42,8 +42,6 @@ #include "softlist_dev.h" -#include - DEFINE_DEVICE_TYPE(PSION_SSD, psion_ssd_device, "psion_ssd", "Psion Solid State Disk") @@ -108,9 +106,6 @@ void psion_ssd_device::device_start() m_door_timer = timer_alloc(FUNC(psion_ssd_device::close_door), this); m_door_timer->reset(); - - save_pointer(NAME(m_ssd_data), 0x800000); - save_item(NAME(m_info_byte)); } //------------------------------------------------- @@ -165,11 +160,8 @@ std::pair psion_ssd_device::call_load() if (size < 0x10000 || size > 0x800000 || (size & (size - 1)) != 0) return std::make_pair(image_error::INVALIDLENGTH, "Invalid size, must be 64K, 128K, 256K, 512K, 1M, 2M, 4M, 8M"); - std::error_condition err; - size_t actual; - std::tie(err, m_ssd_data, actual) = read(image_core_file(), size); - if (err || (actual != size)) - return std::make_pair(err ? err : std::errc::io_error, std::string()); + fseek(0, SEEK_SET); + fread(m_ssd_data.get(), size); // check for Flash header if ((m_ssd_data[0] | (m_ssd_data[1] << 8)) == 0xf1a5) // Flash diff --git a/src/devices/machine/s3c2400.cpp b/src/devices/machine/s3c2400.cpp index 3ce077d18e62c..bbae1355adafb 100644 --- a/src/devices/machine/s3c2400.cpp +++ b/src/devices/machine/s3c2400.cpp @@ -180,7 +180,7 @@ s3c2400_device::s3c2400_device(const machine_config &mconfig, const char *tag, d memset(&m_irq, 0, sizeof(m_irq)); memset(m_dma, 0, sizeof(m_dma)); memset(&m_clkpow, 0, sizeof(m_clkpow)); - memset(&m_lcd, 0, sizeof(m_lcd)); + m_lcd.clear(); memset(&m_lcdpal, 0, sizeof(m_lcdpal)); memset(m_uart, 0, sizeof(m_uart)); memset(&m_pwm, 0, sizeof(m_pwm)); diff --git a/src/devices/machine/s3c2400.h b/src/devices/machine/s3c2400.h index 9dcf0cbe34912..a2726374b9e99 100644 --- a/src/devices/machine/s3c2400.h +++ b/src/devices/machine/s3c2400.h @@ -14,6 +14,7 @@ #include "s3c24xx.h" #include "emupal.h" +#include enum { @@ -330,6 +331,16 @@ class s3c2400_device : public device_t, protected s3c24xx_peripheral_types struct lcd_regs_t { + void clear() + { + lcdcon1 = lcdcon2 = lcdcon3 = lcdcon4 = lcdcon5 = 0; + lcdsaddr1 = lcdsaddr2 = lcdsaddr3 = 0; + redlut = greenlut = bluelut = 0; + std::fill(std::begin(reserved), std::end(reserved), 0); + dithmode = 0; + tpal = 0; + } + uint32_t lcdcon1; uint32_t lcdcon2; uint32_t lcdcon3; @@ -411,9 +422,25 @@ class s3c2400_device : public device_t, protected s3c24xx_peripheral_types struct lcd_t { + void clear() + { + regs.clear(); + timer = nullptr; + vramaddr_cur = vramaddr_max = 0; + offsize = 0; + pagewidth_cur = pagewidth_max = 0; + bppmode = 0; + bswp = hwswp = 0; + vpos = hpos = 0; + framerate = 0; + tpal = 0; + hpos_min = hpos_max = vpos_min = vpos_max = 0; + dma_data = dma_bits = 0; + } + lcd_regs_t regs; emu_timer *timer; - std::unique_ptr bitmap[2]; + bitmap_rgb32 bitmap[2]; uint32_t vramaddr_cur; uint32_t vramaddr_max; uint32_t offsize; diff --git a/src/devices/machine/s3c2410.cpp b/src/devices/machine/s3c2410.cpp index 56a711532c590..f02f7eb8f5736 100644 --- a/src/devices/machine/s3c2410.cpp +++ b/src/devices/machine/s3c2410.cpp @@ -241,7 +241,7 @@ s3c2410_device::s3c2410_device(const machine_config &mconfig, const char *tag, d memset(&m_irq, 0, sizeof(m_irq)); memset(m_dma, 0, sizeof(m_dma)); memset(&m_clkpow, 0, sizeof(m_clkpow)); - memset(&m_lcd, 0, sizeof(m_lcd)); + m_lcd.clear(); memset(&m_lcdpal, 0, sizeof(m_lcdpal)); memset(&m_nand, 0, sizeof(m_nand)); memset(m_uart, 0, sizeof(m_uart)); diff --git a/src/devices/machine/s3c2410.h b/src/devices/machine/s3c2410.h index 7761fa6d3d412..594200a1f1646 100644 --- a/src/devices/machine/s3c2410.h +++ b/src/devices/machine/s3c2410.h @@ -14,6 +14,7 @@ #include "s3c24xx.h" #include "emupal.h" +#include enum { @@ -388,6 +389,18 @@ class s3c2410_device : public device_t, protected s3c24xx_peripheral_types struct lcd_regs_t { + void clear() + { + lcdcon1 = lcdcon2 = lcdcon3 = lcdcon4 = lcdcon5 = 0; + lcdsaddr1 = lcdsaddr2 = lcdsaddr3 = 0; + redlut = greenlut = bluelut = 0; + std::fill(std::begin(reserved), std::end(reserved), 0); + dithmode = 0; + tpal = 0; + lcdintpnd = lcdsrcpnd = lcdintmsk = 0; + lpcsel = 0; + } + uint32_t lcdcon1; uint32_t lcdcon2; uint32_t lcdcon3; @@ -512,9 +525,25 @@ class s3c2410_device : public device_t, protected s3c24xx_peripheral_types struct lcd_t { + void clear() + { + regs.clear(); + timer = nullptr; + vramaddr_cur = vramaddr_max = 0; + offsize = 0; + pagewidth_cur = pagewidth_max = 0; + bppmode = 0; + bswp = hwswp = 0; + vpos = hpos = 0; + framerate = 0; + tpal = 0; + hpos_min = hpos_max = vpos_min = vpos_max = 0; + dma_data = dma_bits = 0; + } + lcd_regs_t regs; emu_timer *timer; - std::unique_ptr bitmap[2]; + bitmap_rgb32 bitmap[2]; uint32_t vramaddr_cur; uint32_t vramaddr_max; uint32_t offsize; diff --git a/src/devices/machine/s3c2440.cpp b/src/devices/machine/s3c2440.cpp index c49c06b873882..200508edb95f9 100644 --- a/src/devices/machine/s3c2440.cpp +++ b/src/devices/machine/s3c2440.cpp @@ -256,7 +256,7 @@ s3c2440_device::s3c2440_device(const machine_config &mconfig, const char *tag, d memset(&m_irq, 0, sizeof(m_irq)); memset(m_dma, 0, sizeof(m_dma)); memset(&m_clkpow, 0, sizeof(m_clkpow)); - memset(&m_lcd, 0, sizeof(m_lcd)); + m_lcd.clear(); memset(&m_lcdpal, 0, sizeof(m_lcdpal)); memset(&m_nand, 0, sizeof(m_nand)); memset(&m_cam, 0, sizeof(m_cam)); diff --git a/src/devices/machine/s3c2440.h b/src/devices/machine/s3c2440.h index b3f2849439fa2..64f614bc20812 100644 --- a/src/devices/machine/s3c2440.h +++ b/src/devices/machine/s3c2440.h @@ -14,6 +14,7 @@ #include "s3c24xx.h" #include "emupal.h" +#include #define S3C2440_TAG "s3c2440" @@ -414,6 +415,18 @@ class s3c2440_device : public device_t, protected s3c24xx_peripheral_types struct lcd_regs_t { + void clear() + { + lcdcon1 = lcdcon2 = lcdcon3 = lcdcon4 = lcdcon5 = 0; + lcdsaddr1 = lcdsaddr2 = lcdsaddr3 = 0; + redlut = greenlut = bluelut = 0; + std::fill(std::begin(reserved), std::end(reserved), 0); + dithmode = 0; + tpal = 0; + lcdintpnd = lcdsrcpnd = lcdintmsk = 0; + tconsel = 0; + } + uint32_t lcdcon1; uint32_t lcdcon2; uint32_t lcdcon3; @@ -556,9 +569,25 @@ class s3c2440_device : public device_t, protected s3c24xx_peripheral_types struct lcd_t { + void clear() + { + regs.clear(); + timer = nullptr; + vramaddr_cur = vramaddr_max = 0; + offsize = 0; + pagewidth_cur = pagewidth_max = 0; + bppmode = 0; + bswp = hwswp = 0; + vpos = hpos = 0; + framerate = 0; + tpal = 0; + hpos_min = hpos_max = vpos_min = vpos_max = 0; + dma_data = dma_bits = 0; + } + lcd_regs_t regs; emu_timer *timer; - std::unique_ptr bitmap[2]; + bitmap_rgb32 bitmap[2]; uint32_t vramaddr_cur; uint32_t vramaddr_max; uint32_t offsize; diff --git a/src/devices/machine/s3c24xx.hxx b/src/devices/machine/s3c24xx.hxx index 15835cb612245..fd467104fbd4b 100644 --- a/src/devices/machine/s3c24xx.hxx +++ b/src/devices/machine/s3c24xx.hxx @@ -422,7 +422,7 @@ uint32_t S3C24_CLASS_NAME::s3c24xx_lcd_dma_read_bits(int count) void S3C24_CLASS_NAME::s3c24xx_lcd_render_tpal() { - bitmap_rgb32 &bitmap = *m_lcd.bitmap[0]; + bitmap_rgb32 &bitmap = m_lcd.bitmap[0]; uint32_t color = s3c24xx_get_color_tpal(); for (int y = m_lcd.vpos_min; y <= m_lcd.vpos_max; y++) { @@ -436,7 +436,7 @@ void S3C24_CLASS_NAME::s3c24xx_lcd_render_tpal() void S3C24_CLASS_NAME::s3c24xx_lcd_render_stn_01() { - bitmap_rgb32 &bitmap = *m_lcd.bitmap[0]; + bitmap_rgb32 &bitmap = m_lcd.bitmap[0]; uint32_t *scanline = &bitmap.pix(m_lcd.vpos, m_lcd.hpos); for (int i = 0; i < 4; i++) { @@ -467,7 +467,7 @@ void S3C24_CLASS_NAME::s3c24xx_lcd_render_stn_01() void S3C24_CLASS_NAME::s3c24xx_lcd_render_stn_02() { - bitmap_rgb32 &bitmap = *m_lcd.bitmap[0]; + bitmap_rgb32 &bitmap = m_lcd.bitmap[0]; uint32_t *scanline = &bitmap.pix(m_lcd.vpos, m_lcd.hpos); for (int i = 0; i < 4; i++) { @@ -490,7 +490,7 @@ void S3C24_CLASS_NAME::s3c24xx_lcd_render_stn_02() void S3C24_CLASS_NAME::s3c24xx_lcd_render_stn_04() { - bitmap_rgb32 &bitmap = *m_lcd.bitmap[0]; + bitmap_rgb32 &bitmap = m_lcd.bitmap[0]; uint32_t *scanline = &bitmap.pix(m_lcd.vpos, m_lcd.hpos); for (int i = 0; i < 4; i++) { @@ -513,7 +513,7 @@ void S3C24_CLASS_NAME::s3c24xx_lcd_render_stn_04() void S3C24_CLASS_NAME::s3c24xx_lcd_render_stn_08() { - bitmap_rgb32 &bitmap = *m_lcd.bitmap[0]; + bitmap_rgb32 &bitmap = m_lcd.bitmap[0]; uint32_t *scanline = &bitmap.pix(m_lcd.vpos, m_lcd.hpos); for (int i = 0; i < 4; i++) { @@ -536,7 +536,7 @@ void S3C24_CLASS_NAME::s3c24xx_lcd_render_stn_08() void S3C24_CLASS_NAME::s3c24xx_lcd_render_stn_12_p() { - bitmap_rgb32 &bitmap = *m_lcd.bitmap[0]; + bitmap_rgb32 &bitmap = m_lcd.bitmap[0]; uint32_t *scanline = &bitmap.pix(m_lcd.vpos, m_lcd.hpos); for (int i = 0; i < 16; i++) { @@ -554,7 +554,7 @@ void S3C24_CLASS_NAME::s3c24xx_lcd_render_stn_12_p() void S3C24_CLASS_NAME::s3c24xx_lcd_render_stn_12_u() // not tested { - bitmap_rgb32 &bitmap = *m_lcd.bitmap[0]; + bitmap_rgb32 &bitmap = m_lcd.bitmap[0]; uint32_t *scanline = &bitmap.pix(m_lcd.vpos, m_lcd.hpos); for (int i = 0; i < 4; i++) { @@ -577,7 +577,7 @@ void S3C24_CLASS_NAME::s3c24xx_lcd_render_stn_12_u() // not tested void S3C24_CLASS_NAME::s3c24xx_lcd_render_tft_01() { - bitmap_rgb32 &bitmap = *m_lcd.bitmap[0]; + bitmap_rgb32 &bitmap = m_lcd.bitmap[0]; uint32_t *scanline = &bitmap.pix(m_lcd.vpos, m_lcd.hpos); for (int i = 0; i < 4; i++) { @@ -600,7 +600,7 @@ void S3C24_CLASS_NAME::s3c24xx_lcd_render_tft_01() void S3C24_CLASS_NAME::s3c24xx_lcd_render_tft_02() { - bitmap_rgb32 &bitmap = *m_lcd.bitmap[0]; + bitmap_rgb32 &bitmap = m_lcd.bitmap[0]; uint32_t *scanline = &bitmap.pix(m_lcd.vpos, m_lcd.hpos); for (int i = 0; i < 4; i++) { @@ -623,7 +623,7 @@ void S3C24_CLASS_NAME::s3c24xx_lcd_render_tft_02() void S3C24_CLASS_NAME::s3c24xx_lcd_render_tft_04() { - bitmap_rgb32 &bitmap = *m_lcd.bitmap[0]; + bitmap_rgb32 &bitmap = m_lcd.bitmap[0]; uint32_t *scanline = &bitmap.pix(m_lcd.vpos, m_lcd.hpos); for (int i = 0; i < 4; i++) { @@ -646,7 +646,7 @@ void S3C24_CLASS_NAME::s3c24xx_lcd_render_tft_04() void S3C24_CLASS_NAME::s3c24xx_lcd_render_tft_08() { - bitmap_rgb32 &bitmap = *m_lcd.bitmap[0]; + bitmap_rgb32 &bitmap = m_lcd.bitmap[0]; uint32_t *scanline = &bitmap.pix(m_lcd.vpos, m_lcd.hpos); for (int i = 0; i < 4; i++) { @@ -669,7 +669,7 @@ void S3C24_CLASS_NAME::s3c24xx_lcd_render_tft_08() void S3C24_CLASS_NAME::s3c24xx_lcd_render_tft_16() { - bitmap_rgb32 &bitmap = *m_lcd.bitmap[0]; + bitmap_rgb32 &bitmap = m_lcd.bitmap[0]; uint32_t *scanline = &bitmap.pix(m_lcd.vpos, m_lcd.hpos); for (int i = 0; i < 4; i++) { @@ -733,8 +733,8 @@ TIMER_CALLBACK_MEMBER( S3C24_CLASS_NAME::s3c24xx_lcd_timer_exp ) void S3C24_CLASS_NAME::s3c24xx_video_start() { - m_lcd.bitmap[0] = std::make_unique(m_screen->width(), m_screen->height()); - m_lcd.bitmap[1] = std::make_unique(m_screen->width(), m_screen->height()); + m_lcd.bitmap[0].allocate(m_screen->width(), m_screen->height()); + m_lcd.bitmap[1].allocate(m_screen->width(), m_screen->height()); m_cpu->space(AS_PROGRAM).cache(m_cache); } @@ -770,12 +770,12 @@ uint32_t S3C24_CLASS_NAME::s3c24xx_video_update(screen_device &screen, bitmap_rg { if (m_lcd.framerate >= 1195) { - bitmap_blend( bitmap, *m_lcd.bitmap[0], *m_lcd.bitmap[1]); - copybitmap( *m_lcd.bitmap[1], *m_lcd.bitmap[0], 0, 0, 0, 0, cliprect); + bitmap_blend(bitmap, m_lcd.bitmap[0], m_lcd.bitmap[1]); + copybitmap(m_lcd.bitmap[1], m_lcd.bitmap[0], 0, 0, 0, 0, cliprect); } else { - copybitmap( bitmap, *m_lcd.bitmap[0], 0, 0, 0, 0, cliprect); + copybitmap(bitmap, m_lcd.bitmap[0], 0, 0, 0, 0, cliprect); } s3c24xx_lcd_dma_init(); } diff --git a/src/devices/machine/s3c44b0.cpp b/src/devices/machine/s3c44b0.cpp index 6182c47cddb85..4321f9acdecfb 100644 --- a/src/devices/machine/s3c44b0.cpp +++ b/src/devices/machine/s3c44b0.cpp @@ -14,7 +14,6 @@ #include "cpu/arm7/arm7.h" #include "screen.h" -#include #include @@ -238,7 +237,7 @@ s3c44b0_device::s3c44b0_device(const machine_config &mconfig, const char *tag, d memset(m_zdma, 0, sizeof(s3c44b0_dma_t)*2); memset(m_bdma, 0, sizeof(s3c44b0_dma_t)*2); memset(&m_clkpow, 0, sizeof(s3c44b0_clkpow_t)); - memset(&m_lcd, 0, sizeof(s3c44b0_lcd_t)); + m_lcd.clear(); memset(m_uart, 0, sizeof(s3c44b0_uart_t)*2); memset(&m_sio, 0, sizeof(s3c44b0_sio_t)); memset(&m_pwm, 0, sizeof(s3c44b0_pwm_t)); diff --git a/src/devices/machine/s3c44b0.h b/src/devices/machine/s3c44b0.h index 5cd8ea567b2ed..b78dc2e20d678 100644 --- a/src/devices/machine/s3c44b0.h +++ b/src/devices/machine/s3c44b0.h @@ -13,6 +13,7 @@ #pragma once +#include /******************************************************************************* MACROS & CONSTANTS @@ -214,6 +215,16 @@ class s3c44b0_device : public device_t, public device_video_interface struct s3c44b0_lcd_regs_t { + void clear() + { + lcdcon1 = lcdcon2 = 0; + lcdsaddr1 = lcdsaddr2 = lcdsaddr3 = 0; + redlut = greenlut = bluelut = 0; + std::fill(std::begin(reserved), std::end(reserved), 0); + lcdcon3 = 0; + dithmode = 0; + } + uint32_t lcdcon1; uint32_t lcdcon2; uint32_t lcdsaddr1; @@ -390,6 +401,22 @@ class s3c44b0_device : public device_t, public device_video_interface struct s3c44b0_lcd_t { + void clear() + { + regs.clear(); + timer = nullptr; + vramaddr_cur = vramaddr_max = 0; + offsize = 0; + pagewidth_cur = pagewidth_max = 0; + modesel = 0; + bswp = 0; + vpos = hpos = 0; + framerate = 0; + hpos_min = hpos_max = hpos_end = vpos_min = vpos_max = vpos_end = 0; + frame_time = attotime::zero; + frame_period = pixeltime = scantime = 0; + } + s3c44b0_lcd_regs_t regs; emu_timer *timer; std::unique_ptr bitmap; diff --git a/src/devices/machine/sis85c496.cpp b/src/devices/machine/sis85c496.cpp index 4fc946475e4fe..6504a982e445e 100644 --- a/src/devices/machine/sis85c496.cpp +++ b/src/devices/machine/sis85c496.cpp @@ -54,7 +54,7 @@ void sis85c496_host_device::internal_io_map(address_map &map) map(0x0080, 0x009f).rw(FUNC(sis85c496_host_device::at_page8_r), FUNC(sis85c496_host_device::at_page8_w)); map(0x00a0, 0x00a1).rw("pic8259_slave", FUNC(pic8259_device::read), FUNC(pic8259_device::write)); map(0x00c0, 0x00df).rw(FUNC(sis85c496_host_device::at_dma8237_2_r), FUNC(sis85c496_host_device::at_dma8237_2_w)); - map(0x00e0, 0x00ef).noprw(); + // map(0x00e0, 0x00ef) MCA bus (cfr. Bochs) or PnP } void sis85c496_host_device::device_add_mconfig(machine_config &config) diff --git a/src/devices/machine/sis950_lpc.cpp b/src/devices/machine/sis950_lpc.cpp index 12980d995fb00..81d94ae94ca36 100644 --- a/src/devices/machine/sis950_lpc.cpp +++ b/src/devices/machine/sis950_lpc.cpp @@ -447,7 +447,8 @@ void sis950_lpc_device::io_map(address_map &map) NAME([this] (offs_t offset, u8 data) { m_dmac_slave->write( offset / 2, data ); }) ); - map(0x00e0, 0x00ef).noprw(); + // map(0x00e0, 0x00ef) MCA bus (cfr. Bochs) or PnP + // map(0x00f0, 0x00f0) COPRO error // map(0x0480, 0x048f) DMA high page registers // map(0x04d0, 0x04d1) IRQ edge/level control registers diff --git a/src/devices/machine/spchrom.cpp b/src/devices/machine/spchrom.cpp deleted file mode 100644 index 3cd95b87c2ebb..0000000000000 --- a/src/devices/machine/spchrom.cpp +++ /dev/null @@ -1,139 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Frank Palazzolo, Aaron Giles, Jonathan Gevaryahu, Raphael Nabet, Couriersud, Michael Zapf -/* - spchroms.c - This is an emulator for "typical" speech ROMs from TI, as used by TI99/4(a). - - In order to support its speech processor, TI designed some ROMs with a 1-bit data bus - and 4-bit address bus (multiplexed 5 times to provide a 18-bit address). - A fairly complete description of such a ROM (tms6100) is found in the tms5220 datasheet. - - One notable thing is that the address is a byte address (*NOT* a bit address). - - This file is designed to be interfaced with the tms5220 core. - Interfacing it with the tms5110 would make sense, too. - - TODO: - Create separate devices for TMS6100 & TMS6125 - Implement the serial protocol -*/ - -#include "emu.h" -#include "spchrom.h" - -#define TMS5220_ADDRESS_MASK 0x3FFFFUL /* 18-bit mask for tms5220 address */ - -// device type definition -DEFINE_DEVICE_TYPE(SPEECHROM, speechrom_device, "speechrom", "TI Speech ROM") - -speechrom_device::speechrom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : device_t(mconfig, SPEECHROM, tag, owner, clock), m_speechrom_data(nullptr), m_speechROMlen(0), - m_speechROMaddr(0), - m_load_pointer(0), - m_ROM_bits_count(0), - m_reverse(false) -{ -} - -/* - Read 'count' bits serially from speech ROM - - Actually, the ROM is expected to have reversed bit order, but there are - many dumps with normal bit order. - - compatibility mode: 01234567 01234567 01234567 ... - correct mode: 76543210 76543210 76543210 ... -*/ -int speechrom_device::read(int count) -{ - int val; - int spchbyte; - int pos; - - if (m_load_pointer) - { /* first read after load address is ignored */ - m_load_pointer = 0; - count--; - } - - if (m_speechROMaddr < m_speechROMlen) - { - val = 0; - pos = 8 - m_ROM_bits_count; - - spchbyte = (m_reverse? (m_speechrom_data[m_speechROMaddr] >> pos) : (m_speechrom_data[m_speechROMaddr] << pos)) & 0xff; - - while (count > 0) - { - val = val << 1; - if ((spchbyte & (m_reverse? 0x01:0x80))!=0) val |= 1; - spchbyte = m_reverse? (spchbyte >> 1) : (spchbyte << 1); - count--; - if (pos == 7) - { - pos = 0; - m_speechROMaddr = (m_speechROMaddr + 1) & TMS5220_ADDRESS_MASK; - if (m_speechROMaddr >= m_speechROMlen) - count = 0; - else - spchbyte = m_speechrom_data[m_speechROMaddr]; - } - else pos++; - } - m_ROM_bits_count = 8 - pos; - } - else - { - val = 0; - } - - return val; -} - -/* - Write an address nibble to speech ROM -*/ -void speechrom_device::load_address(int data) -{ - /* tms5220 data sheet says that if we load only one 4-bit nibble, it won't work. - This code does not care about this. */ - m_speechROMaddr = ( (m_speechROMaddr & ~(0xf << m_load_pointer)) - | (((unsigned long) (data & 0xf)) << m_load_pointer) ) & TMS5220_ADDRESS_MASK; - m_load_pointer += 4; - m_ROM_bits_count = 8; -} - -/* - Perform a read and branch command -*/ -void speechrom_device::read_and_branch() -{ - /* tms5220 data sheet says that if more than one speech ROM (tms6100) is present, - there is a bus contention. This code does not care about this. */ - if (m_speechROMaddr < m_speechROMlen-1) - m_speechROMaddr = (m_speechROMaddr & 0x3c000UL) - | (((((unsigned long) m_speechrom_data[m_speechROMaddr]) << 8) - | m_speechrom_data[m_speechROMaddr+1]) & 0x3fffUL); - else if (m_speechROMaddr == m_speechROMlen-1) - m_speechROMaddr = (m_speechROMaddr & 0x3c000UL) - | ((((unsigned long) m_speechrom_data[m_speechROMaddr]) << 8) & 0x3fffUL); - else - m_speechROMaddr = (m_speechROMaddr & 0x3c000UL); - - m_ROM_bits_count = 8; -} - -void speechrom_device::device_start() -{ - memory_region *region = memregion(tag()); - if (region == nullptr) - { - throw emu_fatalerror("No region for device '%s'\n", tag()); - } - - m_speechrom_data = region->base(); - m_speechROMlen = region->bytes(); - - save_item(NAME(m_speechROMaddr)); - save_item(NAME(m_load_pointer)); - save_item(NAME(m_ROM_bits_count)); -} diff --git a/src/devices/machine/spchrom.h b/src/devices/machine/spchrom.h deleted file mode 100644 index c070fa31eac66..0000000000000 --- a/src/devices/machine/spchrom.h +++ /dev/null @@ -1,43 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Frank Palazzolo, Aaron Giles, Jonathan Gevaryahu, Raphael Nabet, Couriersud, Michael Zapf -/* - * Voice Synthesis Memory - * - */ - -#ifndef MAME_MACHINE_SPCHROM_H -#define MAME_MACHINE_SPCHROM_H - -#pragma once - - -class speechrom_device : public device_t -{ -public: - // construction/destruction - speechrom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - - /// TODO: implement bus behaviour - int read(int count); - void load_address(int data); - void read_and_branch(); - void set_reverse_bit_order(bool reverse) { m_reverse = reverse; } - -protected: - // device-level overrides - virtual void device_start() override ATTR_COLD; - -private: - uint8_t *m_speechrom_data; /* pointer to speech ROM data */ - unsigned int m_speechROMlen; /* length of data pointed by speechrom_data, from 0 to 2^18 */ - unsigned int m_speechROMaddr; /* 18 bit pointer in ROM */ - int m_load_pointer; /* which 4-bit nibble will be affected by load address */ - int m_ROM_bits_count; /* current bit position in ROM */ - bool m_reverse; -}; - - -// device type definition -DECLARE_DEVICE_TYPE(SPEECHROM, speechrom_device) - -#endif // MAME_MACHINE_SPCHROM_H diff --git a/src/devices/machine/z80scc.cpp b/src/devices/machine/z80scc.cpp index 3af007c997205..7c999df4ac93f 100644 --- a/src/devices/machine/z80scc.cpp +++ b/src/devices/machine/z80scc.cpp @@ -1796,6 +1796,8 @@ void z80scc_channel::do_sccreg_wr0(uint8_t data) break; } } + // re-assert interrupt if conditions are still present + check_receive_interrupt(); break; case WR0_ERROR_RESET: /*Error Reset Command (110). This command resets the error bits in RR1. If interrupt on first Rx @@ -2584,22 +2586,7 @@ void z80scc_channel::receive_data(uint8_t data) m_rr0 |= RR0_RX_CHAR_AVAILABLE; check_dma_request(); - // receive interrupt on FIRST and ALL character - switch (m_wr1 & WR1_RX_INT_MODE_MASK) - { - case WR1_RX_INT_FIRST: - if (m_rx_first) - { - m_uart->trigger_interrupt(m_index, INT_RECEIVE); - - m_rx_first = 0; - } - break; - - case WR1_RX_INT_ALL: - m_uart->trigger_interrupt(m_index, INT_RECEIVE); - break; - } + check_receive_interrupt(); } @@ -3005,3 +2992,24 @@ void z80scc_channel::check_dma_request() } } } + +void z80scc_channel::check_receive_interrupt() +{ + if (m_rr0 & RR0_RX_CHAR_AVAILABLE) + { + switch (m_wr1 & WR1_RX_INT_MODE_MASK) + { + case WR1_RX_INT_FIRST: + if (m_rx_first) + { + m_uart->trigger_interrupt(m_index, INT_RECEIVE); + m_rx_first = 0; + } + break; + + case WR1_RX_INT_ALL: + m_uart->trigger_interrupt(m_index, INT_RECEIVE); + break; + } + } +} diff --git a/src/devices/machine/z80scc.h b/src/devices/machine/z80scc.h index 40b7984718a12..1e80b89f95f6f 100644 --- a/src/devices/machine/z80scc.h +++ b/src/devices/machine/z80scc.h @@ -249,6 +249,7 @@ class z80scc_channel : public device_t, int get_tx_word_length(); void safe_transmit_register_reset(); void check_dma_request(); + void check_receive_interrupt(); emu_timer *m_baudtimer; uint16_t m_brg_counter; diff --git a/src/devices/sound/gt155.cpp b/src/devices/sound/gt155.cpp index f613a568183e7..61faf1ac1e6cc 100644 --- a/src/devices/sound/gt155.cpp +++ b/src/devices/sound/gt155.cpp @@ -129,10 +129,9 @@ void gt155_device::mix_sample(voice_t &voice, s64 &left, s64 &right) // interpolate, apply envelope + channel gain and lowpass, and mix into output s64 sample = voice.m_sample_last + (s64(voice.m_sample - voice.m_sample_last) * voice.m_addr_frac >> 15); - // TODO: does this produce accurate filter output? sample = sample * voice.m_filter_gain; - sample += s32(voice.m_filter_out) * (voice.m_filter ^ 0xffff); + sample += s64(voice.m_filter_out) * (voice.m_filter ^ 0xffff); sample >>= 16; voice.m_filter_out = sample; diff --git a/src/devices/sound/gt155.h b/src/devices/sound/gt155.h index fe1d4d96691b7..69dbe91121e54 100644 --- a/src/devices/sound/gt155.h +++ b/src/devices/sound/gt155.h @@ -60,7 +60,7 @@ class gt155_device : public device_t, u32 m_filter_gain = 0; u16 m_filter = 0; - s16 m_filter_out = 0; + s32 m_filter_out = 0; u16 m_filter_unk = 0; s16 m_sample_last = 0; diff --git a/src/devices/sound/namco.cpp b/src/devices/sound/namco.cpp index 0b3f310270a22..5842c7ada83ab 100644 --- a/src/devices/sound/namco.cpp +++ b/src/devices/sound/namco.cpp @@ -108,7 +108,6 @@ void namco_audio_device::device_start() if (m_wave_ptr == nullptr) save_pointer(NAME(m_wavedata), 0x400); - save_item(NAME(m_voices)); save_item(NAME(m_sound_enable)); for (int v = 0; v < MAX_VOLUME; v++) save_pointer(NAME(m_waveform[v]), 32 * 8 * (1+m_wave_size), v); diff --git a/src/devices/sound/rp2c33_snd.cpp b/src/devices/sound/rp2c33_snd.cpp index d0701041a6ba2..e50ce857f8913 100644 --- a/src/devices/sound/rp2c33_snd.cpp +++ b/src/devices/sound/rp2c33_snd.cpp @@ -7,7 +7,7 @@ Based on: - NSFplay github code by Brad Smith/Brezza - Information from NESDev wiki - (https://wiki.nesdev.com/w/index.php/FDS_audio) + (https://www.nesdev.org/wiki/FDS_audio) TODO: - verify register behaviors diff --git a/src/devices/sound/tms5220.cpp b/src/devices/sound/tms5220.cpp index dd02cf8d71455..f472e9aa86efd 100644 --- a/src/devices/sound/tms5220.cpp +++ b/src/devices/sound/tms5220.cpp @@ -366,39 +366,69 @@ emulating the tms5220 in MCU code). Look for a 16-pin chip at U6 labeled one B cycle per interpolation step) */ #define FORCE_SUBC_RELOAD 1 - /* *****debugging defines***** */ /* 5220 only; above dumps the data written to the tms52xx to the error log, useful for making logged data dumps for real hardware tests */ #define LOG_DUMP_INPUT_DATA (1U << 1) + // 5220 only; above debugs FIFO stuff: writes, reads and flag updates #define LOG_FIFO (1U << 2) + +// Show parsing events +#define LOG_PARSE (1U << 3) + // dumps each speech frame as binary -#define LOG_PARSE_FRAME_DUMP_BIN (1U << 3) +#define LOG_PARSE_FRAME_DUMP_BIN (1U << 4) + // dumps each speech frame as hex -#define LOG_PARSE_FRAME_DUMP_HEX (1U << 4) +#define LOG_PARSE_FRAME_DUMP_HEX (1U << 5) + // dumps info if a frame ran out of data #define LOG_FRAME_ERRORS (1U << 6) + // dumps all non-speech-data command writes -#define LOG_COMMAND_DUMP (1U << 7) -// dumps decoded info about command writes +#define LOG_COMMAND (1U << 7) + +// Additional information about command processing #define LOG_COMMAND_VERBOSE (1U << 8) -// spams the error log with i/o ready messages whenever the ready or irq pin is read -#define LOG_PIN_READS (1U << 9) + +// Show NOP command (tends to be noisy) +#define LOG_COMMAND_NOP (1U << 9) + +// spams the error log with I/O ready messages whenever the ready or IRQ pin is read +#define LOG_PIN_READS (1U << 10) + // dumps debug information related to the sample generation loop, i.e. whether interpolation is inhibited or not, and what the current and target values for each frame are. -#define LOG_GENERATION (1U << 10) +#define LOG_GENERATION (1U << 11) + // dumps MUCH MORE debug information related to the sample generation loop, namely the excitation, energy, pitch, k*, and output values for EVERY SINGLE SAMPLE during a frame. -#define LOG_GENERATION_VERBOSE (1U << 11) +#define LOG_GENERATION_VERBOSE (1U << 12) + // dumps the lattice filter state data each sample. -#define LOG_LATTICE (1U << 12) +#define LOG_LATTICE (1U << 13) + +// Show errors in matrix multiplication +#define LOG_MULTIPLY (1U << 14) + // dumps info to the error log whenever the analog clip hardware is (or would be) clipping the signal. -#define LOG_CLIP (1U << 13) +#define LOG_CLIP (1U << 15) + // debugs the io ready callback timer -#define LOG_IO_READY (1U << 14) +#define LOG_IO_READY (1U << 16) + // debugs the tms5220_data_r and data_w access methods which actually respect rs and ws -#define LOG_RS_WS (1U << 15) +#define LOG_RS_WS (1U << 17) + +// Show the byte being written by the CPU to the VSP +#define LOG_DATA_W (1U << 18) -//#define VERBOSE (LOG_GENERAL | LOG_DUMP_INPUT_DATA | LOG_FIFO | LOG_PARSE_FRAME_DUMP_HEX | LOG_FRAME_ERRORS | LOG_COMMAND_DUMP | LOG_COMMAND_VERBOSE | LOG_PIN_READS | LOG_GENERATION | LOG_GENERATION_VERBOSE | LOG_LATTICE | LOG_CLIP | LOG_IO_READY | LOG_RS_WS) +// Show interactions with speech rom +#define LOG_VSM (1U << 19) + +// Show state changes +#define LOG_STATE (1U << 20) + +//#define VERBOSE (LOG_FIFO | LOG_PARSE | LOG_FRAME_ERRORS | LOG_COMMAND | LOG_GENERATION | LOG_DATA_W | LOG_STATE) #include "logmacro.h" #define MAX_SAMPLE_CHUNK 512 @@ -438,6 +468,8 @@ emulating the tms5220 in MCU code). Look for a 16-pin chip at U6 labeled static const uint8_t reload_table[4] = { 0, 2, 4, 6 }; //sample count reload for 5220c and cd2501ecd only; 5200 and 5220 always reload with 0; keep in mind this is loaded on IP=0 PC=12 subcycle=1 so it immediately will increment after one sample, effectively being 1,3,5,7 as in the comments above. +#define NOCOMMAND 0xff + // Pull in the ROM tables #include "tms5110r.hxx" @@ -480,6 +512,9 @@ void tms5220_device::register_for_save_states() save_item(NAME(m_irq_pin)); save_item(NAME(m_ready_pin)); + save_item(NAME(m_command_register)); + save_item(NAME(m_data_latched)); + // current and previous frames save_item(NAME(m_OLDE)); save_item(NAME(m_OLDP)); @@ -563,10 +598,10 @@ void tms5220_device::printbits(long data, int num) /********************************************************************************************** - tms5220_device::new_int_write -- wrap a write to the VSM + tms5220_device::vsm_write -- wrap a write sent to the VSM ***********************************************************************************************/ -void tms5220_device::new_int_write(uint8_t rc, uint8_t m0, uint8_t m1, uint8_t addr) +void tms5220_device::vsm_write(uint8_t rc, uint8_t m0, uint8_t m1, uint8_t addr) { m_m0_cb(m0); m_m1_cb(m1); @@ -580,32 +615,52 @@ void tms5220_device::new_int_write(uint8_t rc, uint8_t m0, uint8_t m1, uint8_t a /********************************************************************************************** - tms5220_device::new_int_write_addr -- wrap a 'load address' set of writes to the VSM + tms5220_device::vsm_write_addr -- wrap a 'load address' set of writes sent to the VSM ***********************************************************************************************/ -void tms5220_device::new_int_write_addr(uint8_t addr) +void tms5220_device::vsm_write_addr(uint8_t addr) { - new_int_write(1, 0, 1, addr); // romclk 1, m0 0, m1 1, addr bus nybble = xxxx - new_int_write(0, 0, 1, addr); // romclk 0, m0 0, m1 1, addr bus nybble = xxxx - new_int_write(1, 0, 0, addr); // romclk 1, m0 0, m1 0, addr bus nybble = xxxx - new_int_write(0, 0, 0, addr); // romclk 0, m0 0, m1 0, addr bus nybble = xxxx + vsm_write(1, 0, 1, addr); // romclk 1, m0 0, m1 1, addr bus nybble = xxxx + vsm_write(0, 0, 1, addr); // romclk 0, m0 0, m1 1, addr bus nybble = xxxx + vsm_write(1, 0, 0, addr); // romclk 1, m0 0, m1 0, addr bus nybble = xxxx + vsm_write(0, 0, 0, addr); // romclk 0, m0 0, m1 0, addr bus nybble = xxxx } /********************************************************************************************** - tms5220_device::new_int_write_addr -- wrap a 'read bit' set of writes to the VSM + tms5220_device::vsm_read -- wrap a 'read bit' set of writes sent to the VSM ***********************************************************************************************/ -uint8_t tms5220_device::new_int_read() +uint8_t tms5220_device::vsm_read() { - new_int_write(1, 1, 0, 0); // romclk 1, m0 1, m1 0, addr bus nybble = 0/open bus - new_int_write(0, 1, 0, 0); // romclk 0, m0 1, m1 0, addr bus nybble = 0/open bus - new_int_write(1, 0, 0, 0); // romclk 1, m0 0, m1 0, addr bus nybble = 0/open bus - new_int_write(0, 0, 0, 0); // romclk 0, m0 0, m1 0, addr bus nybble = 0/open bus + vsm_write(1, 1, 0, 0); // romclk 1, m0 1, m1 0, addr bus nybble = 0/open bus + vsm_write(0, 1, 0, 0); // romclk 0, m0 1, m1 0, addr bus nybble = 0/open bus + vsm_write(1, 0, 0, 0); // romclk 1, m0 0, m1 0, addr bus nybble = 0/open bus + vsm_write(0, 0, 0, 0); // romclk 0, m0 0, m1 0, addr bus nybble = 0/open bus + + uint8_t val = 0; + if (!m_data_cb.isunset()) - return m_data_cb(); - LOG("WARNING: CALLBACK MISSING, RETURNING 0!\n"); - return 0; + val = m_data_cb(); + else + LOGMASKED(LOG_VSM, "Warning: No speech memory attached, returning 0.\n"); + + return val; +} + +/********************************************************************************************** + + tms5220_device::vsm_read_and_branch -- wrap a 'read-and-branch' set of writes sent to the VSM + +***********************************************************************************************/ +void tms5220_device::vsm_read_and_branch() +{ + vsm_write(0, 1, 1, 0); // see tms5110.cpp + vsm_write(1, 1, 1, 0); // romclk 1, m0 1, m1 1, addr bus nybble = 0/open bus + vsm_write(0, 1, 1, 0); // romclk 0, m0 1, m1 1, addr bus nybble = 0/open bus + vsm_write(0, 0, 0, 0); // see tms5110.cpp + vsm_write(1, 0, 0, 0); // romclk 1, m0 0, m1 0, addr bus nybble = 0/open bus + vsm_write(0, 0, 0, 0); // romclk 0, m0 0, m1 0, addr bus nybble = 0/open bus } /********************************************************************************************** @@ -663,12 +718,14 @@ void tms5220_device::data_write(int data) LOGMASKED(LOG_FIFO, "data_write: Ran out of room in the tms52xx FIFO! this should never happen!\n"); // at this point, /READY should remain HIGH/inactive until the FIFO has at least one byte open in it. } - - + m_data_latched = false; } else //(! m_DDIS) // R Nabet : we parse commands at once. It is necessary for such commands as read. process_command(data); + + if (!m_data_latched) + m_io_ready = true; } /********************************************************************************************** @@ -736,9 +793,30 @@ void tms5220_device::update_fifo_status_and_ints() // also, in this case, regardless if DDIS was set, unset it. if (m_previous_talk_status && !talk_status()) { - LOG("Talk status WAS 1, is now 0, unsetting DDIS and firing an interrupt!\n"); + LOGMASKED(LOG_STATE, "Talk status 1 -> 0, unsetting DDIS and firing an interrupt.\n"); set_interrupt_state(1); m_DDIS = false; + + m_previous_talk_status = false; + + // Is there a command stuck in the command register due to speech output? + // Then resume it. + if (m_command_register != NOCOMMAND) + { + LOGMASKED(LOG_STATE, "Resume command execution: %02X\n", m_command_register); + process_command(m_command_register); + + // Is there another data transfer pending? Resume it as well. + if (m_data_latched) + { + LOGMASKED(LOG_STATE, "Pending byte write: %02X\n", m_write_latch); + m_timer_io_ready->adjust(clocks_to_attotime(16), 1); + } + else + m_io_ready = true; + + update_ready_state(); + } } m_previous_talk_status = talk_status(); @@ -776,32 +854,33 @@ int tms5220_device::read_bits(int count) } else { -#ifndef USE_NEW_TMS6100_CODE -/** TODO: get rid of this old code */ - // extract from VSM (speech ROM) - if (m_speechrom) - val = m_speechrom->read(count); + if (!m_m0_cb.isunset()) + { + while (count--) + { + val = (val << 1) | vsm_read(); + LOGMASKED(LOG_VSM, "bit read: %d\n", val&1); + } + } else - val = (1<16383) { b-=32768; } while (b<-16384) { b+=32768; } result = ((a*b)>>9); /** TODO: this isn't technically right to the chip, which truncates the lowest result bit, but it causes glitches otherwise. **/ - if (result>16383) LOG("matrix multiplier overflowed! a: %x, b: %x, result: %x", a, b, result); - if (result<-16384) LOG("matrix multiplier underflowed! a: %x, b: %x, result: %x", a, b, result); + if (result>16383) LOGMASKED(LOG_MULTIPLY, "matrix multiplier overflowed! a: %x, b: %x, result: %x", a, b, result); + if (result<-16384) LOGMASKED(LOG_MULTIPLY, "matrix multiplier underflowed! a: %x, b: %x, result: %x", a, b, result); return result; } @@ -1296,77 +1375,110 @@ int32_t tms5220_device::lattice_filter() /********************************************************************************************** - process_command -- extract a byte from the FIFO and interpret it as a command + process_command -- decode byte and run the command + + During SPEAK, the address counter is locked against modification by + LOAD_ADDRESS. In that time, a LOAD_ADDRESS command does not terminate but + remains in the command register. + When another command is fed into the speech processor, the READY line is + lowered until the command register is cleared, then the new command is + loaded into the command register. + + Note that the running SPEAK command does not block the command register; + it is a command that attempts to change the address during the SPEAK + process. [mz] ***********************************************************************************************/ -void tms5220_device::process_command(unsigned char cmd) +void tms5220_device::process_command(uint8_t cmd) { - LOGMASKED(LOG_COMMAND_DUMP, "process_command called with parameter %02X\n", cmd); + m_command_register = cmd; /* parse the command */ switch (cmd & 0x70) { case 0x10 : /* read byte */ - LOGMASKED(LOG_COMMAND_VERBOSE, "Read Byte command received\n"); + LOGMASKED(LOG_COMMAND, "Read Byte command received (%02X)\n", cmd); if (!talk_status()) /* TALKST must be clear for RDBY */ { if (m_schedule_dummy_read) { m_schedule_dummy_read = false; - if (m_speechrom) - m_speechrom->read(1); + perform_dummy_read(); } - if (m_speechrom) - m_read_byte_register = m_speechrom->read(8); /* read one byte from speech ROM... */ + + m_read_byte_register = read_bits(8); m_RDB_flag = true; + m_command_register = NOCOMMAND; } else - LOGMASKED(LOG_COMMAND_VERBOSE, "Read Byte command received during TALK state, ignoring!\n"); + LOGMASKED(LOG_COMMAND_VERBOSE, "Read Byte command received during TALK state, suspended.\n"); break; - case 0x00: case 0x20: /* set rate (tms5220c and cd2501ecd only), otherwise NOP */ + case 0x00: + case 0x20: /* set rate (tms5220c and cd2501ecd only), otherwise NOP */ if (TMS5220_HAS_RATE_CONTROL) { - LOGMASKED(LOG_COMMAND_VERBOSE, "Set Rate (or NOP) command received\n"); + LOGMASKED(LOG_COMMAND_NOP, "Set Rate (or NOP) command received (%02X)\n", cmd); m_c_variant_rate = cmd&0x0F; } else - LOGMASKED(LOG_COMMAND_VERBOSE, "NOP command received\n"); + LOGMASKED(LOG_COMMAND_NOP, "NOP command received (%02X)\n", cmd); + + m_command_register = NOCOMMAND; break; case 0x30 : /* read and branch */ if (!talk_status()) /* TALKST must be clear for RB */ { - LOGMASKED(LOG_COMMAND_VERBOSE, "Read and Branch command received\n"); + LOGMASKED(LOG_COMMAND, "Read and Branch command received (%02X)\n", cmd); m_RDB_flag = false; - if (m_speechrom) - m_speechrom->read_and_branch(); + + if (m_schedule_dummy_read) + { + m_schedule_dummy_read = false; + perform_dummy_read(); + } + + if (!m_m0_cb.isunset()) + vsm_read_and_branch(); + else + LOGMASKED(LOG_VSM, "WARNING: Read-and-branch: No memory attached to VSP\n"); + + m_command_register = NOCOMMAND; } break; case 0x40 : /* load address */ - LOGMASKED(LOG_COMMAND_VERBOSE, "Load Address command received\n"); if (!talk_status()) /* TALKST must be clear for LA */ { - /* tms5220 data sheet says that if we load only one 4-bit nibble, it won't work. - This code does not care about this. */ - if (m_speechrom) - m_speechrom->load_address(cmd & 0x0f); + LOGMASKED(LOG_COMMAND, "Load Address command received (%02X)\n", cmd); + + // tms5220 data sheet says that if we load only one 4-bit nibble, + // it won't work. This code does not care about this. + if (!m_m0_cb.isunset()) + vsm_write_addr(cmd & 0x0f); + m_schedule_dummy_read = true; + m_command_register = NOCOMMAND; } else - LOGMASKED(LOG_COMMAND_VERBOSE, "Load Address command received during TALK state, ignoring!\n"); + { + // The Load Address command is not ignored during speech output, + // as tests show. In fact, it is normally executed when the speech + // terminates. + LOGMASKED(LOG_COMMAND_VERBOSE, "Load Address command received during TALK state, suspended.\n"); + } break; case 0x50 : /* speak */ - LOGMASKED(LOG_COMMAND_VERBOSE, "Speak (VSM) command received\n"); + LOGMASKED(LOG_COMMAND, "Speak (VSM) command received (%02X)\n", cmd); if (m_schedule_dummy_read) { m_schedule_dummy_read = false; - if (m_speechrom) - m_speechrom->read(1); + perform_dummy_read(); } + m_SPEN = 1; #ifdef FAST_START_HACK m_TALK = 1; @@ -1389,10 +1501,12 @@ void tms5220_device::process_command(unsigned char cmd) m_new_frame_k_idx[i] = 0xF; for (int i = 7; i < m_coeff->num_k; i++) m_new_frame_k_idx[i] = 0x7; + + m_command_register = NOCOMMAND; break; case 0x60 : /* speak external */ - LOGMASKED(LOG_COMMAND_VERBOSE, "Speak External command received\n"); + LOGMASKED(LOG_COMMAND, "Speak External command received (%02X)\n", cmd); // SPKEXT going active asserts /SPKEE for 2 clocks, which clears the FIFO and its counters std::fill(std::begin(m_fifo), std::end(m_fifo), 0); @@ -1417,17 +1531,20 @@ void tms5220_device::process_command(unsigned char cmd) for (int i = 7; i < m_coeff->num_k; i++) m_new_frame_k_idx[i] = 0x7; m_RDB_flag = false; + + m_command_register = NOCOMMAND; break; case 0x70 : /* reset */ - LOGMASKED(LOG_COMMAND_VERBOSE, "Reset command received\n"); + LOGMASKED(LOG_COMMAND, "Reset command received (%02X)\n", cmd); if (m_schedule_dummy_read) { m_schedule_dummy_read = false; - if (m_speechrom) - m_speechrom->read(1); + perform_dummy_read(); } + reset(); + m_command_register = NOCOMMAND; break; } @@ -1536,9 +1653,9 @@ void tms5220_device::parse_frame() LOGMASKED(LOG_PARSE_FRAME_DUMP_BIN | LOG_PARSE_FRAME_DUMP_HEX, "\n"); if (m_DDIS) - LOG("Parsed a frame successfully in FIFO - %d bits remaining\n", (m_fifo_count*8)-(m_fifo_bits_taken)); + LOGMASKED(LOG_PARSE, "Parsed a frame successfully in FIFO - %d bits remaining\n", (m_fifo_count*8)-(m_fifo_bits_taken)); else - LOG("Parsed a frame successfully in ROM\n"); + LOGMASKED(LOG_PARSE, "Parsed a frame successfully in ROM\n"); return; ranout: @@ -1589,19 +1706,6 @@ void tms5220_device::update_ready_state() void tms5220_device::device_start() { - if (m_speechrom_tag) - { - m_speechrom = siblingdevice( m_speechrom_tag ); - if( !m_speechrom ) - { - throw new emu_fatalerror("Error: %s '%s' can't find speechrom '%s'\n", shortname(), tag(), m_speechrom_tag ); - } - } - else - { - m_speechrom = nullptr; - } - switch (m_variant) { case TMS5220_IS_TMC0281: @@ -1666,6 +1770,9 @@ void tms5220_device::device_reset() update_ready_state(); m_buffer_empty = m_buffer_low = true; + m_command_register = NOCOMMAND; + m_data_latched = false; + m_RDB_flag = false; /* initialize the energy/pitch/k states */ @@ -1689,18 +1796,8 @@ void tms5220_device::device_reset() m_RNG = 0x1FFF; std::fill(std::begin(m_u), std::end(m_u), 0); std::fill(std::begin(m_x), std::end(m_x), 0); - m_schedule_dummy_read = false; - if (m_speechrom) - { - m_speechrom->load_address(0); - // MZ: Do the dummy read immediately. The previous line will cause a - // shift in the address pointer in the VSM. When the next command is a - // load_address, no dummy read will occur, hence the address will be - // incorrectly shifted. - m_speechrom->read(1); - m_schedule_dummy_read = false; - } + perform_dummy_read(); // 5110 specific stuff m_PDC = 0; @@ -1716,6 +1813,7 @@ TIMER_CALLBACK_MEMBER(tms5220_device::set_io_ready) { /* bring up to date first */ m_stream->update(); + LOGMASKED(LOG_IO_READY, "m_timer_io_ready timer fired, param = %02x, m_rs_ws = %02x\n", param, m_rs_ws); if (param) // low->high ready state { @@ -1732,24 +1830,34 @@ TIMER_CALLBACK_MEMBER(tms5220_device::set_io_ready) } else { - LOGMASKED(LOG_IO_READY, "m_timer_io_ready: Serviced write: %02x\n", m_write_latch); - data_write(m_write_latch); - m_io_ready = param; + if (m_command_register != NOCOMMAND) + { + // The command register is still busy; do not activate /READY + // and keep the data latch + LOGMASKED(LOG_IO_READY, "m_timer_io_ready: Command register not ready\n"); + } + else + { + LOGMASKED(LOG_IO_READY, "m_timer_io_ready: Serviced write: %02X\n", m_write_latch); + m_data_latched = false; + data_write(m_write_latch); + } + break; } case 0x01: /* Read */ m_read_latch = status_read(true); - LOGMASKED(LOG_IO_READY, "m_timer_io_ready: Serviced read, returning %02x\n", m_read_latch); - m_io_ready = param; + LOGMASKED(LOG_IO_READY, "m_timer_io_ready: Serviced read, returning %02X\n", m_read_latch); + m_io_ready = true; break; case 0x03: /* High Impedance */ - m_io_ready = param; + m_io_ready = true; break; case 0x00: /* illegal */ - m_io_ready = param; + m_io_ready = true; break; } } @@ -1940,10 +2048,12 @@ void tms5220_device::combined_rsq_wsq_w(u8 data) void tms5220_device::data_w(uint8_t data) { - LOGMASKED(LOG_RS_WS, "tms5220_write_data: data %02x\n", data); + LOGMASKED(LOG_DATA_W, "tms5220_write_data: data %02X\n", data); /* bring up to date first */ m_stream->update(); m_write_latch = data; + m_data_latched = true; + if (!m_true_timing) // if we're in the default hacky mode where we don't bother with rsq_w and wsq_w... data_write(m_write_latch); // ...force the write through instantly. else @@ -2085,7 +2195,6 @@ tms5220_device::tms5220_device(const machine_config &mconfig, device_type type, , m_variant(variant) , m_irq_handler(*this) , m_readyq_handler(*this) - , m_speechrom_tag(nullptr) , m_m0_cb(*this) , m_m1_cb(*this) , m_addr_cb(*this) diff --git a/src/devices/sound/tms5220.h b/src/devices/sound/tms5220.h index 33747f5d56197..6aa0494164bd4 100644 --- a/src/devices/sound/tms5220.h +++ b/src/devices/sound/tms5220.h @@ -5,8 +5,6 @@ #pragma once -#include "machine/spchrom.h" - /* HACK: if defined, uses impossibly perfect 'straight line' interpolation */ #undef TMS5220_PERFECT_INTERPOLATION_HACK @@ -31,9 +29,6 @@ class tms5220_device : public device_t, public device_sound_interface // Ready callback function, active low, i.e. state=0 auto ready_cb() { return m_readyq_handler.bind(); } - // old VSM support, remove me! - void set_speechrom_tag(const char *_tag) { m_speechrom_tag = _tag; } - // new VSM support auto m0_cb() { return m_m0_cb.bind(); } auto m1_cb() { return m_m1_cb.bind(); } @@ -80,10 +75,11 @@ class tms5220_device : public device_t, public device_sound_interface private: static constexpr unsigned FIFO_SIZE = 16; - // 51xx and VSM related - void new_int_write(uint8_t rc, uint8_t m0, uint8_t m1, uint8_t addr); - void new_int_write_addr(uint8_t addr); - uint8_t new_int_read(); + void vsm_write(uint8_t rc, uint8_t m0, uint8_t m1, uint8_t addr); + void vsm_write_addr(uint8_t addr); + uint8_t vsm_read(); + void vsm_read_and_branch(); + void perform_dummy_read(); // 52xx or common void register_for_save_states(); @@ -97,7 +93,7 @@ class tms5220_device : public device_t, public device_sound_interface int16_t clip_analog(int16_t cliptemp) const; int32_t matrix_multiply(int32_t a, int32_t b) const; int32_t lattice_filter(); - void process_command(unsigned char cmd); + void process_command(uint8_t cmd); void parse_frame(); void set_interrupt_state(int state); void update_ready_state(); @@ -157,6 +153,12 @@ class tms5220_device : public device_t, public device_sound_interface bool m_irq_pin; /* state of the IRQ pin (output) */ bool m_ready_pin; /* state of the READY pin (output) */ + /* Currently processed command */ + uint8_t m_command_register; + + /* Indicates a value latched from the data lines and not yet processed */ + bool m_data_latched; + /* these contain data describing the current and previous voice frames */ bool m_OLDE; bool m_OLDP; @@ -231,10 +233,8 @@ class tms5220_device : public device_t, public device_sound_interface /* callbacks */ devcb_write_line m_irq_handler; devcb_write_line m_readyq_handler; - // next 2 lines are old speechrom handler, remove me! - const char *m_speechrom_tag; - speechrom_device *m_speechrom; - // next lines are new speechrom handler + + // Speech ROM handler devcb_write_line m_m0_cb; // the M0 line devcb_write_line m_m1_cb; // the M1 line devcb_write8 m_addr_cb; // Write to ADD1,2,4,8 - 4 address bits diff --git a/src/devices/video/bt431.h b/src/devices/video/bt431.h index 793ac4cb24fdc..400a9b0445b68 100644 --- a/src/devices/video/bt431.h +++ b/src/devices/video/bt431.h @@ -54,15 +54,6 @@ class bt431_device : public device_t }; void map(address_map &map) ATTR_COLD; - bool cur_r(unsigned x, unsigned y) const; - -protected: - static constexpr u16 ADDRESS_MASK = 0x01ff; - - // device_t overrides - virtual void device_start() override ATTR_COLD; - virtual void device_reset() override ATTR_COLD; - template u8 addr_r() { return m_address >> S; } template void addr_w(u8 data) { m_address = ((m_address & (0xff00 >> S)) | (u16(data) << S)) & ADDRESS_MASK; } @@ -72,6 +63,15 @@ class bt431_device : public device_t u8 reg_r(); void reg_w(u8 data); + bool cur_r(unsigned x, unsigned y) const; + +protected: + static constexpr u16 ADDRESS_MASK = 0x01ff; + + // device_t overrides + virtual void device_start() override ATTR_COLD; + virtual void device_reset() override ATTR_COLD; + private: void update(); diff --git a/src/devices/video/bt450.cpp b/src/devices/video/bt450.cpp new file mode 100644 index 0000000000000..5cb922de92389 --- /dev/null +++ b/src/devices/video/bt450.cpp @@ -0,0 +1,99 @@ +// license:BSD-3-Clause +// copyright-holders:Patrick Mackinlay + +/* + * Brooktree Bt450 66MHz Monolithic CMOS 16x12 Color Palette RAMDAC + * + * Sources: + * - Product Databook 1991, Brooktree Corporation + * + */ + +#include "emu.h" +#include "bt450.h" + +#define LOG_READS (1U << 1) +#define LOG_WRITES (1U << 2) + +#define VERBOSE (LOG_WRITES) + +#include "logmacro.h" + +DEFINE_DEVICE_TYPE(BT450, bt450_device, "bt450", "Brooktree Bt450 16x12 Color RAMDAC") + +bt450_device::bt450_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock) + : device_t(mconfig, BT450, tag, owner, clock) + , device_palette_interface(mconfig, *this) + , m_address(0) + , m_address_rgb(0) + , m_color_ram(nullptr) +{ +} + +void bt450_device::device_start() +{ + m_color_ram = std::make_unique[]>(palette_entries()); + + save_item(NAME(m_address)); + save_item(NAME(m_address_rgb)); + + save_pointer(NAME(m_color_ram), palette_entries()); +} + +u8 bt450_device::address_r() +{ + LOGMASKED(LOG_READS, "address_r 0x%02x (%s)\n", m_address, machine().describe_context()); + + if (!machine().side_effects_disabled()) + m_address_rgb = 0; + + return m_address; + +} + +void bt450_device::address_w(u8 data) +{ + LOGMASKED(LOG_WRITES, "address_w 0x%02x (%s)\n", data, machine().describe_context()); + + m_address_rgb = 0; + m_address = data; +} + +u8 bt450_device::palette_r(address_space &space) +{ + u8 const data = (m_address < palette_entries()) ? m_color_ram[m_address][m_address_rgb] : space.unmap(); + + LOGMASKED(LOG_READS, "palette_r 0x%02x (%s)\n", data, machine().describe_context()); + + if (!machine().side_effects_disabled()) + { + // increment component index and address register + m_address_rgb = (m_address_rgb + 1) % 3; + if (m_address_rgb == 0) + m_address++; + } + + return data; +} + +void bt450_device::palette_w(u8 data) +{ + LOGMASKED(LOG_WRITES, "palette_w 0x%02x (%s)\n", data, machine().describe_context()); + + if (m_address < palette_entries()) + { + m_color_ram[m_address][m_address_rgb] = data & 0x0f; + + // update the mame palette to match the device + if (m_address_rgb == 2) + set_pen_color(m_address, rgb_t( + m_color_ram[m_address][0] << 4, + m_color_ram[m_address][1] << 4, + m_color_ram[m_address][2] << 4)); + } + + // increment component index and address register + m_address_rgb = (m_address_rgb + 1) % 3; + if (m_address_rgb == 0) + m_address++; +} diff --git a/src/devices/video/bt450.h b/src/devices/video/bt450.h new file mode 100644 index 0000000000000..7118ce61c689e --- /dev/null +++ b/src/devices/video/bt450.h @@ -0,0 +1,37 @@ +// license:BSD-3-Clause +// copyright-holders:Patrick Mackinlay + +#ifndef MAME_VIDEO_BT450_H +#define MAME_VIDEO_BT450_H + +#pragma once + +class bt450_device + : public device_t + , public device_palette_interface +{ +public: + bt450_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock); + + u8 address_r(); + void address_w(u8 data); + u8 palette_r(address_space &space); + void palette_w(u8 data); + +protected: + // device_palette_interface implementation + virtual void device_start() override ATTR_COLD; + + // device_palette_interface implementation + virtual u32 palette_entries() const noexcept override { return 16 + 3; } + +private: + u8 m_address; + u8 m_address_rgb; + + std::unique_ptr[]> m_color_ram; +}; + +DECLARE_DEVICE_TYPE(BT450, bt450_device) + +#endif // MAME_VIDEO_BT450_H diff --git a/src/devices/video/bt45x.h b/src/devices/video/bt45x.h index 845eb3991b367..b3f640f572b3e 100644 --- a/src/devices/video/bt45x.h +++ b/src/devices/video/bt45x.h @@ -44,12 +44,6 @@ class bt45x_device_base : public device_t virtual void map(address_map &map) ATTR_COLD; -protected: - bt45x_device_base(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, const u32 palette_colors, const u32 overlay_colors); - - virtual void device_start() override ATTR_COLD; - virtual void device_reset() override ATTR_COLD; - u8 address_r(); void address_w(u8 data); virtual u8 palette_r(address_space &space) = 0; @@ -59,6 +53,12 @@ class bt45x_device_base : public device_t virtual u8 overlay_r(address_space &space) = 0; virtual void overlay_w(u8 data) = 0; +protected: + bt45x_device_base(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, const u32 palette_colors, const u32 overlay_colors); + + virtual void device_start() override ATTR_COLD; + virtual void device_reset() override ATTR_COLD; + // helpers virtual void increment_address(const bool side_effects = false); virtual u8 get_mask() const { return m_palette_colors - 1; } @@ -79,6 +79,12 @@ class bt45x_device_base : public device_t class bt45x_rgb_device_base : public bt45x_device_base, public device_palette_interface { +public: + virtual u8 palette_r(address_space &space) override; + virtual void palette_w(u8 data) override; + virtual u8 overlay_r(address_space &space) override; + virtual void overlay_w(u8 data) override; + protected: bt45x_rgb_device_base(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, const u32 palette_colors, const u32 overlay_colors); @@ -86,17 +92,17 @@ class bt45x_rgb_device_base : public bt45x_device_base, public device_palette_in virtual u32 palette_entries() const noexcept override { return m_palette_colors + m_overlay_colors; } - virtual u8 palette_r(address_space &space) override; - virtual void palette_w(u8 data) override; - virtual u8 overlay_r(address_space &space) override; - virtual void overlay_w(u8 data) override; - std::unique_ptr[]> m_color_ram; }; class bt45x_mono_device_base : public bt45x_device_base { public: + virtual u8 palette_r(address_space &space) override; + virtual void palette_w(u8 data) override; + virtual u8 overlay_r(address_space &space) override; + virtual void overlay_w(u8 data) override; + // helper instead of device_palette_interface u8 lookup(u8 pixel, u8 overlay = 0) const { @@ -111,11 +117,6 @@ class bt45x_mono_device_base : public bt45x_device_base virtual void device_start() override ATTR_COLD; - virtual u8 palette_r(address_space &space) override; - virtual void palette_w(u8 data) override; - virtual u8 overlay_r(address_space &space) override; - virtual void overlay_w(u8 data) override; - std::unique_ptr m_color_ram; }; @@ -161,12 +162,12 @@ class bt457_device : public bt45x_mono_device_base public: bt457_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); -protected: virtual u8 palette_r(address_space &space) override; virtual void palette_w(u8 data) override; virtual u8 overlay_r(address_space &space) override; virtual void overlay_w(u8 data) override; +protected: virtual void increment_address(const bool side_effects = false) override; }; diff --git a/src/devices/video/pc_vga_nvidia.cpp b/src/devices/video/pc_vga_nvidia.cpp index 31d5c23c6a450..3fa14260a3d8e 100644 --- a/src/devices/video/pc_vga_nvidia.cpp +++ b/src/devices/video/pc_vga_nvidia.cpp @@ -25,9 +25,11 @@ nVidia NV3:G80 VGA core Notes: - NV1 looks very different, not worth to subclass here; +- According to starfrost013 this is really a Weitek core ... References: - https://envytools.readthedocs.io/en/latest/hw/display/nv3/index.html +- https://86box.net/2025/02/25/riva128-part-1.html **************************************************************************************************/ diff --git a/src/devices/video/s3virge.cpp b/src/devices/video/s3virge.cpp index f6c98153c0a0d..fea65831550fb 100644 --- a/src/devices/video/s3virge.cpp +++ b/src/devices/video/s3virge.cpp @@ -21,6 +21,8 @@ * - Fix PLL calculation for 1k+ width VESA modes (tends to either be too fast or too slow); * - 1600x1200x4 needs line compare fix in downstream pc_vga (cuts too early); * - 1280x1024x16 draws 256 H and stupid high refresh rate; + * - make PD pin strapping configurable from host card rather than here and pc_vga_s3; + * - virgevx: stub, uses a beefier RAMDAC (can do up to 1600x1200x16 / 1280x1024x24) * * Notes: * - Most Windows s3dsdk demos starts in software render (at least with win98se base S3 drivers, @@ -58,8 +60,8 @@ #define CRTC_PORT_ADDR ((vga.miscellaneous_output & 1) ? 0x3d0 : 0x3b0) DEFINE_DEVICE_TYPE(S3VIRGE, s3virge_vga_device, "virge_vga", "S3 86C325 VGA core") +DEFINE_DEVICE_TYPE(S3VIRGEVX, s3virgevx_vga_device, "virgevx_vga", "S3 86C988 VGA core") DEFINE_DEVICE_TYPE(S3VIRGEDX, s3virgedx_vga_device, "virgedx_vga", "S3 86C375 VGA core") -DEFINE_DEVICE_TYPE(S3VIRGEDX1, s3virgedx_rev1_vga_device, "virgedx_vga_r1", "S3 86C375 (rev 1) VGA core") s3virge_vga_device::s3virge_vga_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : s3virge_vga_device(mconfig, S3VIRGE, tag, owner, clock) @@ -74,6 +76,13 @@ s3virge_vga_device::s3virge_vga_device(const machine_config &mconfig, device_typ { } +s3virgevx_vga_device::s3virgevx_vga_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : s3virge_vga_device(mconfig, S3VIRGEVX, tag, owner, clock) +{ + m_crtc_space_config = address_space_config("crtc_regs", ENDIANNESS_LITTLE, 8, 8, 0, address_map_constructor(FUNC(s3virgevx_vga_device::crtc_map), this)); + m_seq_space_config = address_space_config("sequencer_regs", ENDIANNESS_LITTLE, 8, 8, 0, address_map_constructor(FUNC(s3virgevx_vga_device::sequencer_map), this)); +} + s3virgedx_vga_device::s3virgedx_vga_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : s3virgedx_vga_device(mconfig, S3VIRGEDX, tag, owner, clock) { @@ -86,13 +95,6 @@ s3virgedx_vga_device::s3virgedx_vga_device(const machine_config &mconfig, device { } -s3virgedx_rev1_vga_device::s3virgedx_rev1_vga_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : s3virgedx_vga_device(mconfig, S3VIRGEDX1, tag, owner, clock) -{ - m_crtc_space_config = address_space_config("crtc_regs", ENDIANNESS_LITTLE, 8, 8, 0, address_map_constructor(FUNC(s3virgedx_rev1_vga_device::crtc_map), this)); - m_seq_space_config = address_space_config("sequencer_regs", ENDIANNESS_LITTLE, 8, 8, 0, address_map_constructor(FUNC(s3virgedx_rev1_vga_device::sequencer_map), this)); -} - void s3virge_vga_device::device_start() { zero(); @@ -137,27 +139,29 @@ void s3virge_vga_device::device_start() s3.id_low = 0x31; // CR2E s3.revision = 0x00; // CR2F (value unknown) s3.id_cr30 = 0xe1; // CR30 + + m_serial_enable = false; } -void s3virgedx_vga_device::device_start() +void s3virgevx_vga_device::device_start() { s3virge_vga_device::device_start(); // set device ID - s3.id_high = 0x8a; // CR2D - s3.id_low = 0x01; // CR2E + s3.id_high = 0x88; // CR2D + s3.id_low = 0x3d; // CR2E s3.revision = 0x00; // CR2F (value unknown) s3.id_cr30 = 0xe1; // CR30 } -void s3virgedx_rev1_vga_device::device_start() +void s3virgedx_vga_device::device_start() { s3virge_vga_device::device_start(); // set device ID s3.id_high = 0x8a; // CR2D s3.id_low = 0x01; // CR2E - s3.revision = 0x01; // CR2F + s3.revision = 0x01; // CR2F, rev 1 from Diamond Stealth 3D 2000 Pro s3.id_cr30 = 0xe1; // CR30 } @@ -190,20 +194,20 @@ void s3virge_vga_device::device_reset() s3d_reset(); } -void s3virgedx_vga_device::device_reset() +void s3virgevx_vga_device::device_reset() { s3virge_vga_device::device_reset(); - // Power-on strapping bits. Sampled at reset, but can be modified later. - // These are just assumed defaults. + // TODO: unverified s3.strapping = 0x000f0912; } -void s3virgedx_rev1_vga_device::device_reset() +void s3virgedx_vga_device::device_reset() { - s3virgedx_vga_device::device_reset(); + s3virge_vga_device::device_reset(); // Power-on strapping bits. Sampled at reset, but can be modified later. // These are based on results from a Diamond Stealth 3D 2000 Pro (Virge/DX based) // bits 8-15 are still unknown, S3ID doesn't show config register 2 (CR37) + // NOTE: S600DX wants PD25 high, PD26 low, hardwires serial port calls to $e2 s3.strapping = 0x0aff0912; } @@ -430,6 +434,8 @@ void s3virge_vga_device::s3_define_video_mode() svga.rgb16_en = 0; svga.rgb24_en = 0; svga.rgb32_en = 0; + // TODO: virgevx has upgraded RAMDAC + // (overhauls color modes for accomodating 1600x1200 resolutions) switch((s3.ext_misc_ctrl_2) >> 4) { case 0x01: svga.rgb8_en = 1; break; @@ -1415,3 +1421,30 @@ void s3virge_vga_device::s3d_register_map(address_map &map) }) ); } + +// Serial Port Register (DDC/I2C, pins 205-206, aliased at I/O ports $e2 or $e8) +u8 s3virge_vga_device::serial_port_r(offs_t offset) +{ + // bits 8-12 are mirrored, 16-31 aren't + if (BIT(offset, 2)) + { + if (!machine().side_effects_disabled()) + LOG("MMFF20: access area %d read\n", offset + 0xff20); + return 0; + } + // TODO: S600DX enables DDC at POST, this is enough to not make it go off the rails + return (m_serial_enable << 4) | 0x04; +} + +void s3virge_vga_device::serial_port_w(offs_t offset, u8 data) +{ + if (BIT(offset, 2)) + { + if (!machine().side_effects_disabled()) + LOG("MMFF20: access area %d write %02x\n", offset + 0xff20, data); + return; + } + // TODO: bit 0-2 to SPCLK, 1-3 to SPD + + m_serial_enable = !!BIT(data, 4); +} diff --git a/src/devices/video/s3virge.h b/src/devices/video/s3virge.h index aafc74a11b8f5..36a7f8490581b 100644 --- a/src/devices/video/s3virge.h +++ b/src/devices/video/s3virge.h @@ -24,9 +24,16 @@ class s3virge_vga_device : public s3trio64_vga_device auto linear_config_changed() { return m_linear_config_changed_cb.bind(); } + bool read_pd25_strapping() { return !!BIT(s3.strapping, 25); } + bool read_pd26_strapping() { return !!BIT(s3.strapping, 26); } + virtual uint8_t mem_r(offs_t offset) override; virtual void mem_w(offs_t offset, uint8_t data) override; + // port $e2 / $e8 / MMFF20 + u8 serial_port_r(offs_t offset); + void serial_port_w(offs_t offset, u8 data); + uint8_t fb_r(offs_t offset); void fb_w(offs_t offset, uint8_t data); uint32_t s3d_sub_status_r(); @@ -192,34 +199,37 @@ class s3virge_vga_device : public s3trio64_vga_device void command_finish(); void s3d_reset(); + + bool m_serial_enable; }; -// ======================> s3virgedx_vga_device +// ======================> s3virgevx_vga_device -class s3virgedx_vga_device : public s3virge_vga_device +class s3virgevx_vga_device : public s3virge_vga_device { public: - // construction/destruction - s3virgedx_vga_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + s3virgevx_vga_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: - s3virgedx_vga_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); +// s3virgevx_vga_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); - // device-level overrides virtual void device_start() override ATTR_COLD; virtual void device_reset() override ATTR_COLD; }; + // ======================> s3virgedx_vga_device -class s3virgedx_rev1_vga_device : public s3virgedx_vga_device +class s3virgedx_vga_device : public s3virge_vga_device { public: // construction/destruction - s3virgedx_rev1_vga_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + s3virgedx_vga_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: + s3virgedx_vga_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); + // device-level overrides virtual void device_start() override ATTR_COLD; virtual void device_reset() override ATTR_COLD; @@ -227,7 +237,7 @@ class s3virgedx_rev1_vga_device : public s3virgedx_vga_device // device type definition DECLARE_DEVICE_TYPE(S3VIRGE, s3virge_vga_device) +DECLARE_DEVICE_TYPE(S3VIRGEVX, s3virgevx_vga_device) DECLARE_DEVICE_TYPE(S3VIRGEDX, s3virgedx_vga_device) -DECLARE_DEVICE_TYPE(S3VIRGEDX1, s3virgedx_rev1_vga_device) #endif // MAME_VIDEO_S3VIRGE_H diff --git a/src/devices/video/saa7110.cpp b/src/devices/video/saa7110.cpp index e4e0e9425ddf0..f2fa5fed0e7cf 100644 --- a/src/devices/video/saa7110.cpp +++ b/src/devices/video/saa7110.cpp @@ -30,12 +30,14 @@ saa7110a_device::saa7110a_device(const machine_config &mconfig, const char *tag, : device_t(mconfig, SAA7110A, tag, owner, clock) , i2c_hle_interface(mconfig, *this, 0x9c >> 1) , device_memory_interface(mconfig, *this) + //, m_out_vs_cb(*this) { m_space_config = address_space_config("regs", ENDIANNESS_LITTLE, 8, 8, 0, address_map_constructor(FUNC(saa7110a_device::regs_map), this)); } void saa7110a_device::device_start() { + //m_href_timer = timer_alloc(FUNC(saa7110a_device::href_cb), this); save_item(NAME(m_secs)); save_item(NAME(m_sstb)); save_item(NAME(m_hrmv)); @@ -46,6 +48,8 @@ void saa7110a_device::device_start() void saa7110a_device::device_reset() { m_secs = m_sstb = m_hrmv = m_rtse = m_vtrc = false; + //m_current_href = 0; + //m_href_timer->adjust(attotime::from_hz(15734), 0, attotime::from_hz(15734)); } device_memory_interface::space_config_vector saa7110a_device::memory_space_config() const @@ -140,8 +144,14 @@ void saa7110a_device::regs_map(address_map &map) map(0x2b, 0x2b).lw8(NAME([this] (offs_t offset, u8 data) { LOG("SU2B: Gain control analog #3 %02x\n", data); })); map(0x2c, 0x2c).lw8(NAME([this] (offs_t offset, u8 data) { LOG("SU2C: Mixer control #2 %02x\n", data); })); map(0x2d, 0x2d).lw8(NAME([this] (offs_t offset, u8 data) { LOG("SU2D: Integration value gain %02x\n", data); })); - map(0x2e, 0x2e).lw8(NAME([this] (offs_t offset, u8 data) { LOG("SU2E: Vertical blanking pulse set %02x\n", data); })); - map(0x2f, 0x2f).lw8(NAME([this] (offs_t offset, u8 data) { LOG("SU2F: Vertical blanking pulse reset %02x\n", data); })); + map(0x2e, 0x2e).lw8(NAME([this] (offs_t offset, u8 data) { + m_vbps = data; + LOG("SU2E: Vertical blanking pulse set %02x\n", data); + })); + map(0x2f, 0x2f).lw8(NAME([this] (offs_t offset, u8 data) { + m_vbpr = data; + LOG("SU2F: Vertical blanking pulse reset %02x\n", data); + })); map(0x30, 0x30).lw8(NAME([this] (offs_t offset, u8 data) { LOG("SU30: ADCs gain control %02x\n", data); })); map(0x31, 0x31).lw8(NAME([this] (offs_t offset, u8 data) { LOG("SU31: Mixer control #3 %02x\n", data); })); map(0x32, 0x32).lw8(NAME([this] (offs_t offset, u8 data) { LOG("SU32: Integration value white peak %02x\n", data); })); @@ -149,3 +159,19 @@ void saa7110a_device::regs_map(address_map &map) map(0x34, 0x34).lw8(NAME([this] (offs_t offset, u8 data) { LOG("SU34: Gain update level %02x\n", data); })); } +//TIMER_CALLBACK_MEMBER(saa7110a_device::href_cb) +//{ +// if (m_vbpr == m_vbps) +// return; +// m_current_href ++; +// if (m_current_href == m_vbps * 2) +// { +// m_out_vs_cb(1); +// } +// if (m_current_href == m_vbpr * 2) +// { +// m_out_vs_cb(0); +// } +// m_current_href %= 262; +//} +// diff --git a/src/devices/video/saa7110.h b/src/devices/video/saa7110.h index a4c5b741c9b3a..fff482744b56e 100644 --- a/src/devices/video/saa7110.h +++ b/src/devices/video/saa7110.h @@ -16,6 +16,8 @@ class saa7110a_device : public: saa7110a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + //auto vs_callback() { return m_out_vs_cb.bind(); } + protected: // saa7110a_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); virtual void device_start() override ATTR_COLD; @@ -28,8 +30,14 @@ class saa7110a_device : virtual void write_data(u16 offset, u8 data) override; address_space_config m_space_config; +// devcb_write_line m_out_vs_cb; bool m_secs, m_sstb, m_hrmv, m_rtse, m_vtrc; + u8 m_vbps, m_vbpr; +// int m_current_href; + +// TIMER_CALLBACK_MEMBER(href_cb); +// emu_timer *m_href_timer; }; DECLARE_DEVICE_TYPE(SAA7110A, saa7110a_device) diff --git a/src/devices/video/tea1002.cpp b/src/devices/video/tea1002.cpp index af80f9908a31f..174cb85a36429 100644 --- a/src/devices/video/tea1002.cpp +++ b/src/devices/video/tea1002.cpp @@ -12,28 +12,34 @@ #include "tea1002.h" +namespace { + //************************************************************************** // CONSTANTS //************************************************************************** -const float tea1002_device::m_luminance[] = +const int s_tint = -6; // what is this based on? + +const float s_luminance[] = { - 0, 22.5, 44, 66.5, 8.5, 31, 52.5, 100, // INV = 0 + 0, 22.5, 44, 66.5, 8.5, 31, 52.5, 100, // INV = 0 75, 52.5, 31, 8.5, 66.5, 44, 22.5, 0 // INV = 1 }; -const int tea1002_device::m_phase[] = +const int s_phase[] = { 0, 103, 241, 167, 347, 61, 283, 0, // INV = 0 0, 283, 61, 347, 167, 241, 103, 0 // INV = 1 }; -const int tea1002_device::m_amplitute[] = +const int s_amplitude[] = { 0, 48, 44, 33, 33, 44, 48, 0, // INV = 0 0, 24, 22, 17, 17, 22, 24, 0 // INV = 1 }; +} // anonymous namespace + //************************************************************************** // DEVICE DEFINITIONS @@ -47,7 +53,7 @@ DEFINE_DEVICE_TYPE(TEA1002, tea1002_device, "tea1002", "Mullard TEA1002 PAL colo //************************************************************************** //------------------------------------------------- -// paula_device - constructor +// tea1002_device - constructor //------------------------------------------------- tea1002_device::tea1002_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : @@ -73,9 +79,9 @@ void tea1002_device::device_start() rgb_t tea1002_device::color(int index) { // calculate yuv - double y = m_luminance[index] / 100; - double u = cos((m_phase[index] + m_tint) * M_PI / 180) * m_amplitute[index] / 100; - double v = sin((m_phase[index] + m_tint) * M_PI / 180) * m_amplitute[index] / 100; + double y = s_luminance[index] / 100; + double u = cos((s_phase[index] + s_tint) * M_PI / 180) * s_amplitude[index] / 100; + double v = sin((s_phase[index] + s_tint) * M_PI / 180) * s_amplitude[index] / 100; // and convert to rgb double r = y + v * 1.14; diff --git a/src/devices/video/tea1002.h b/src/devices/video/tea1002.h index db60b9c943a08..12a446d9ba811 100644 --- a/src/devices/video/tea1002.h +++ b/src/devices/video/tea1002.h @@ -29,8 +29,6 @@ // TYPE DEFINITIONS //************************************************************************** -// ======================> tea1002_device - class tea1002_device : public device_t { public: @@ -42,15 +40,10 @@ class tea1002_device : public device_t protected: // device_t overrides virtual void device_start() override ATTR_COLD; - -private: - static const int m_tint = -6; // what is this based on? - static const float m_luminance[16]; - static const int m_phase[16]; - static const int m_amplitute[16]; }; -// device type definition + +// device type declaration DECLARE_DEVICE_TYPE(TEA1002, tea1002_device) #endif // MAME_VIDEO_TEA1002_H diff --git a/src/devices/video/zr36060.cpp b/src/devices/video/zr36060.cpp index 29c19dfdaadc6..ff5adc52d8a4e 100644 --- a/src/devices/video/zr36060.cpp +++ b/src/devices/video/zr36060.cpp @@ -5,6 +5,8 @@ #include "zr36060.h" #define VERBOSE (LOG_GENERAL) +//#define LOG_OUTPUT_FUNC osd_printf_info + #include "logmacro.h" DEFINE_DEVICE_TYPE(ZR36060, zr36060_device, "zr36060", "Zoran ZR36060 Integrated JPEG codec") @@ -31,39 +33,605 @@ void zr36060_device::device_start() void zr36060_device::device_reset() { + m_load = false; + m_syncrst = false; + m_code_mstr = true; + m_codec_mode = 0x80; } void zr36060_device::regs_map(address_map &map) { -// map(0x000, 0x000) LOAD Parameters -// map(0x001, 0x001) Code FIFO Status (r/o) -// map(0x002, 0x002) Code Interface -// map(0x003, 0x003) Codec Mode - -// map(0x005, 0x005) Maximum Block Code -// map(0x006, 0x006) Markers Enable -// map(0x007, 0x007) Interrupt Mask -// map(0x008, 0x008) Interrupt Status (r/o) -// map(0x009, 0x00c) Target Net Code Volume -// map(0x00d, 0x010) Target Data Code Volume -// map(0x011, 0x012) Scale Factor -// map(0x013, 0x015) Allocation Factor -// map(0x016, 0x019) Accumulated Code Volume -// map(0x01a, 0x01d) Accumulated Total Activity -// map(0x01e, 0x021) Accumulated Truncated Bits + // Codec Control Registers + map(0x000, 0x000).rw(FUNC(zr36060_device::load_r), FUNC(zr36060_device::load_w)); + map(0x001, 0x001).r(FUNC(zr36060_device::code_fifo_status_r)); + map(0x002, 0x002).rw(FUNC(zr36060_device::code_if_r), FUNC(zr36060_device::code_if_w)); + map(0x003, 0x003).rw(FUNC(zr36060_device::codec_mode_r), FUNC(zr36060_device::codec_mode_w)); + + map(0x005, 0x005).rw(FUNC(zr36060_device::mbcv_r), FUNC(zr36060_device::mbcv_w)); + map(0x006, 0x006).rw(FUNC(zr36060_device::markers_enable_r), FUNC(zr36060_device::markers_enable_w)); + map(0x007, 0x007).rw(FUNC(zr36060_device::irq_mask_r), FUNC(zr36060_device::irq_mask_w)); + map(0x008, 0x008).r(FUNC(zr36060_device::irq_status_r)); + map(0x009, 0x00c).rw(FUNC(zr36060_device::tcv_net_r), FUNC(zr36060_device::tcv_net_w)); + map(0x00d, 0x010).rw(FUNC(zr36060_device::tcv_data_r), FUNC(zr36060_device::tcv_data_w)); + map(0x011, 0x012).rw(FUNC(zr36060_device::sf_r), FUNC(zr36060_device::sf_w)); + map(0x013, 0x015).rw(FUNC(zr36060_device::af_r), FUNC(zr36060_device::af_w)); + map(0x016, 0x019).rw(FUNC(zr36060_device::acv_r), FUNC(zr36060_device::acv_w)); + map(0x01a, 0x01d).rw(FUNC(zr36060_device::act_r), FUNC(zr36060_device::act_w)); + map(0x01e, 0x021).rw(FUNC(zr36060_device::acv_trun_r), FUNC(zr36060_device::acv_trun_w)); map(0x022, 0x022).lr8(NAME([this] (offs_t offset) { LOG("Read Device ID\n"); return 0x33; })); map(0x023, 0x023).lr8(NAME([this] (offs_t offset) { LOG("Read Revision ID\n"); return 0x01; })); // map(0x024, 0x025) Test Control -// map(0x030, 0x030) Video Control -// map(0x031, 0x031) Video Polarity -// map(0x032, 0x032) Scaling -// map(0x033, 0x035) Background Color -// map(0x036, 0x041) Sync Generator -// map(0x042, 0x049) Active Area -// map(0x04a, 0x051) SUBIMG Window + // Video Registers + map(0x030, 0x030).rw(FUNC(zr36060_device::video_control_r), FUNC(zr36060_device::video_control_w)); + map(0x031, 0x031).rw(FUNC(zr36060_device::video_polarity_r), FUNC(zr36060_device::video_polarity_w)); + map(0x032, 0x032).rw(FUNC(zr36060_device::video_scaling_r), FUNC(zr36060_device::video_scaling_w)); + // Background Color + map(0x033, 0x033).lrw8( + NAME([this] (offs_t offset) { return m_bg_color.y; }), + NAME([this] (offs_t offset, u8 data) { m_bg_color.y = data; LOG("Background Color Y %02x\n", data); }) + ); + map(0x034, 0x034).lrw8( + NAME([this] (offs_t offset) { return m_bg_color.u; }), + NAME([this] (offs_t offset, u8 data) { m_bg_color.u = data; LOG("Background Color U %02x\n", data); }) + ); + map(0x035, 0x035).lrw8( + NAME([this] (offs_t offset) { return m_bg_color.v; }), + NAME([this] (offs_t offset, u8 data) { m_bg_color.v = data; LOG("Background Color V %02x\n", data); }) + ); + // Sync Generator + map(0x036, 0x037).lrw8( + NAME([this] (offs_t offset) { + return (m_sync_gen.vtotal >> (offset ? 0 : 8)) & 0xff; } + ), + NAME([this] (offs_t offset, u8 data) { + const u8 shift = offset ? 0 : 8; + m_sync_gen.vtotal &= offset ? 0xff00 : 0x00ff; + m_sync_gen.vtotal |= (data << shift); + LOG("Sync Generator: Vtotal [%01x] %02x -> %04x %d\n" + , offset, data + , m_sync_gen.vtotal, m_sync_gen.vtotal + 1 + ); + }) + ); + map(0x038, 0x039).lrw8( + NAME([this] (offs_t offset) { + return (m_sync_gen.htotal >> (offset ? 0 : 8)) & 0xff; } + ), + NAME([this] (offs_t offset, u8 data) { + const u8 shift = offset ? 0 : 8; + m_sync_gen.htotal &= offset ? 0x0300 : 0x00ff; + m_sync_gen.htotal |= (data << shift); + LOG("Sync Generator: Htotal [%01x] %02x -> %04x %d\n" + , offset, data + , m_sync_gen.htotal, m_sync_gen.htotal + 1 + ); + }) + ); + map(0x03a, 0x03a).lrw8( + NAME([this] (offs_t offset) { return m_sync_gen.vsync_size; }), + NAME([this] (offs_t offset, u8 data) { + m_sync_gen.vsync_size = data; + LOG("Sync Generator: VsyncSize %02x -> %d\n" + , data + , m_sync_gen.vsync_size + 1 + ); + }) + ); + map(0x03b, 0x03b).lrw8( + NAME([this] (offs_t offset) { return m_sync_gen.hsync_size; }), + NAME([this] (offs_t offset, u8 data) { + m_sync_gen.hsync_size = data; + LOG("Sync Generator: HsyncSize %02x -> %d\n" + , data + , m_sync_gen.hsync_size + 1 + ); + }) + ); + map(0x03c, 0x03c).lrw8( + NAME([this] (offs_t offset) { return m_sync_gen.bvstart; }), + NAME([this] (offs_t offset, u8 data) { + m_sync_gen.bvstart = data; + LOG("Sync Generator: BVstart %02x -> %d\n" + , data + , m_sync_gen.bvstart + 1 + ); + }) + ); + map(0x03d, 0x03d).lrw8( + NAME([this] (offs_t offset) { return m_sync_gen.bhstart; }), + NAME([this] (offs_t offset, u8 data) { + m_sync_gen.bhstart = data; + LOG("Sync Generator: BHstart %02x -> %d\n" + , data + , m_sync_gen.bhstart + 1 + ); + }) + ); + map(0x03e, 0x03f).lrw8( + NAME([this] (offs_t offset) { + return (m_sync_gen.bvend >> (offset ? 0 : 8)) & 0xff; } + ), + NAME([this] (offs_t offset, u8 data) { + const u8 shift = offset ? 0 : 8; + m_sync_gen.bvend &= offset ? 0xff00 : 0x00ff; + m_sync_gen.bvend |= (data << shift); + LOG("Sync Generator: BVend [%01x] %02x -> %04x %d\n" + , offset, data + , m_sync_gen.bvend, m_sync_gen.bvend + ); + }) + ); + map(0x040, 0x041).lrw8( + NAME([this] (offs_t offset) { + return (m_sync_gen.bhend >> (offset ? 0 : 8)) & 0xff; } + ), + NAME([this] (offs_t offset, u8 data) { + const u8 shift = offset ? 0 : 8; + m_sync_gen.bhend &= offset ? 0x0300 : 0x00ff; + m_sync_gen.bhend |= (data << shift); + LOG("Sync Generator: BHend [%01x] %02x -> %04x %d\n" + , offset, data + , m_sync_gen.bhend, m_sync_gen.bhend + ); + }) + ); + + // Active Area + map(0x042, 0x043).lrw8( + NAME([this] (offs_t offset) { + return (m_active_area.vstart >> (offset ? 0 : 8)) & 0xff; } + ), + NAME([this] (offs_t offset, u8 data) { + const u8 shift = offset ? 0 : 8; + m_active_area.vstart &= offset ? 0xff00 : 0x00ff; + m_active_area.vstart |= (data << shift); + LOG("Active Area: Vstart [%01x] %02x -> %04x %d\n" + , offset, data + , m_active_area.vstart, m_active_area.vstart + 1 + ); + }) + ); + map(0x044, 0x045).lrw8( + NAME([this] (offs_t offset) { + return (m_active_area.vend >> (offset ? 0 : 8)) & 0xff; } + ), + NAME([this] (offs_t offset, u8 data) { + const u8 shift = offset ? 0 : 8; + m_active_area.vend &= offset ? 0xff00 : 0x00ff; + m_active_area.vend |= (data << shift); + LOG("Active Area: Vend [%01x] %02x -> %04x %d\n" + , offset, data + , m_active_area.vend, m_active_area.vend + ); + }) + ); + map(0x046, 0x047).lrw8( + NAME([this] (offs_t offset) { + return (m_active_area.hstart >> (offset ? 0 : 8)) & 0xff; } + ), + NAME([this] (offs_t offset, u8 data) { + const u8 shift = offset ? 0 : 8; + m_active_area.hstart &= offset ? 0x0300 : 0x00ff; + m_active_area.hstart |= (data << shift); + LOG("Active Area: Hstart [%01x] %02x -> %04x %d\n" + , offset, data + , m_active_area.hstart, m_active_area.hstart + 1 + ); + }) + ); + map(0x048, 0x049).lrw8( + NAME([this] (offs_t offset) { + return (m_active_area.hend >> (offset ? 0 : 8)) & 0xff; } + ), + NAME([this] (offs_t offset, u8 data) { + const u8 shift = offset ? 0 : 8; + m_active_area.hend &= offset ? 0x0300 : 0x00ff; + m_active_area.hend |= (data << shift); + LOG("Active Area: Hend [%01x] %02x -> %04x %d\n" + , offset, data + , m_active_area.hend, m_active_area.hend + 1 + ); + }) + ); + + // SUBIMG Window + map(0x04a, 0x04b).lrw8( + NAME([this] (offs_t offset) { + return (m_subimg_window.svstart >> (offset ? 0 : 8)) & 0xff; } + ), + NAME([this] (offs_t offset, u8 data) { + const u8 shift = offset ? 0 : 8; + m_subimg_window.svstart &= offset ? 0xff00 : 0x00ff; + m_subimg_window.svstart |= (data << shift); + LOG("SUBIMG Window: SVstart [%01x] %02x -> %04x %d\n" + , offset, data + , m_subimg_window.svstart, m_subimg_window.svstart + 1 + ); + }) + ); + map(0x04c, 0x04d).lrw8( + NAME([this] (offs_t offset) { + return (m_subimg_window.svend >> (offset ? 0 : 8)) & 0xff; } + ), + NAME([this] (offs_t offset, u8 data) { + const u8 shift = offset ? 0 : 8; + m_subimg_window.svend &= offset ? 0xff00 : 0x00ff; + m_subimg_window.svend |= (data << shift); + LOG("SUBIMG Window: SVend [%01x] %02x -> %04x %d\n" + , offset, data + , m_subimg_window.svend, m_subimg_window.svend + ); + }) + ); + map(0x04e, 0x04f).lrw8( + NAME([this] (offs_t offset) { + return (m_subimg_window.shstart >> (offset ? 0 : 8)) & 0xff; } + ), + NAME([this] (offs_t offset, u8 data) { + const u8 shift = offset ? 0 : 8; + m_subimg_window.shstart &= offset ? 0x0300 : 0x00ff; + m_subimg_window.shstart |= (data << shift); + LOG("SUBIMG Window: SHstart [%01x] %02x -> %04x %d\n" + , offset, data + , m_subimg_window.shstart, m_subimg_window.shstart + 1 + ); + }) + ); + map(0x050, 0x051).lrw8( + NAME([this] (offs_t offset) { + return (m_subimg_window.shend >> (offset ? 0 : 8)) & 0xff; } + ), + NAME([this] (offs_t offset, u8 data) { + const u8 shift = offset ? 0 : 8; + m_subimg_window.shend &= offset ? 0x0300 : 0x00ff; + m_subimg_window.shend |= (data << shift); + LOG("SUBIMG Window: SHend [%01x] %02x -> %04x %d\n" + , offset, data + , m_subimg_window.shend, m_subimg_window.shend + 1 + ); + }) + ); + + // JPEG Markers Array + map(0x060, 0x3ff).ram(); +} + +/************************************** + * + * Codec Control Registers + * + *************************************/ + +/* + * [0x000] LOAD Parameters + * x--- ---- LOAD parameters if 1 + * ---- ---x SyncRst resets video sync generator if 1 (keeps h/vpos to 0,0 until goes off) + */ +u8 zr36060_device::load_r(offs_t offset) +{ + return (m_load << 7) | (m_syncrst << 0); +} + +void zr36060_device::load_w(offs_t offset, u8 data) +{ + m_load = !!(BIT(data, 7)); + m_syncrst = !!(BIT(data, 0)); + LOG("LOAD Parameters %02x: LOAD %d SYNCRST %d\n", data, m_load, m_syncrst); +} + +/* + * [0x001] Code FIFO status (r/o) + * x--- ---- Busy Status for LOAD operation (takes ~100ms to complete) + * ---- -x-- CBUSY Code FIFO empty/full condition (same as /CBUSY pin) + * ---- -0-- Code FIFO not full/not empty + * ---- -1-- Code FIFO full/empty + * ---- --xx CFIFO Code FIFO fullness state + * ---- --00 < 1/4 + * ---- --01 >= 1/4 && < 1/2 + * ---- --10 >= 1/2 && < 3/4 + * ---- --11 >= 3/4 + */ +u8 zr36060_device::code_fifo_status_r(offs_t offset) +{ + return 0; +} + +/* + * [0x002] Code Interface + * x--- ---- Code16 code bus width, slave mode only + * 0--- ---- 8-bit code bus + * 1--- ---- 16-bit code bus + * -x-- ---- Endian, must be 0 in Master mode or 8-bit Slave + * ---- -x-- CFIS number of clocks in Master mode, must be 0 in Code Slave + * ---- ---x CodeMstr ZR36060 is Master or Slave of the Code bus + * ---- ---0 Code Slave mode + * ---- ---1 Code Master mode + */ +u8 zr36060_device::code_if_r(offs_t offset) +{ + return (m_code16 << 7) | (m_endian << 6) | (m_cfis << 2) | (m_code_mstr); +} + +void zr36060_device::code_if_w(offs_t offset, u8 data) +{ + m_code16 = !!(BIT(data, 7)); + m_endian = !!(BIT(data, 6)); + m_cfis = !!(BIT(data, 2)); + m_code_mstr = !!(BIT(data, 0)); + LOG("Code Interface %02x:\n", data); + LOG("\tCODE16 %d-bit, Endian %d, CFIS %d VCLKx2, CodeMstr %s\n" + , m_code16 ? 16 : 8 + , m_endian + , m_cfis + 1 + , m_code_mstr ? "Code Master" : "Code Slave" + ); +} + +/* + * [0x003] Codec Mode + * x--- ---- COMP + * -x-- ---- ATP + * --x- ---- PASS2 + * ---x ---- TLM + * ---- -x-- BRC + * ---- --x- FSF + * 1100 0100 Auto Two-Pass Compression + * 1000 0100 Statistical Compression Pass + * 1010 0100 Compression Pass with Variable Scale Factor + * 1010 0110 Compression Pass with Fixed Scale Factor + * 1011 0000 Tables-Only Compression Pass + * 0000 0000 Decompression Pass + * ???? ???? + */ +u8 zr36060_device::codec_mode_r(offs_t offset) +{ + return m_codec_mode; +} + +void zr36060_device::codec_mode_w(offs_t offset, u8 data) +{ + m_codec_mode = data; + LOG("Codec Mode %02x\n", data); + LOG("\tCOMP %d, ATP %d, PASS2 %d, TLM %d, BRC %d, FSF %d\n" + , BIT(data, 7) + , BIT(data, 6) + , BIT(data, 5) + , BIT(data, 4) + , BIT(data, 2) + , BIT(data, 1) + ); +} + +/* + * [0x005] Maxiumum Block Code Volume + * xxxx xxxx value * 2 + */ +u8 zr36060_device::mbcv_r(offs_t offset) +{ + return m_mbcv; +} - map(0x060, 0x3ff).ram(); // JPEG Markers Array +void zr36060_device::mbcv_w(offs_t offset, u8 data) +{ + m_mbcv = data; + LOG("Maximum Block Code Volume %02x -> %d\n", m_mbcv, m_mbcv * 2); +} + +/* + * [0x006] Markers Enable [for Compression modes only] + * x--- ---- APP + * -x-- ---- COM + * --x- ---- DRI + * ---x ---- DQT + * ---- x--- DHT + * ---- ---? + */ +u8 zr36060_device::markers_enable_r(offs_t offset) +{ + return m_markers_enable; +} + +void zr36060_device::markers_enable_w(offs_t offset, u8 data) +{ + m_markers_enable = data; + LOG("Markers Enable %02x\n", data); + LOG("\tAPP %d COM %d DRI %d DQT %d DHT %d\n" + , BIT(data, 7) + , BIT(data, 6) + , BIT(data, 5) + , BIT(data, 4) + , BIT(data, 3) + ); +} + +/* + * [0x007] Interrupt Mask + * ---- x--- EOAV End-Of-Active-Video + * ---- -x-- EOI + * ---- --x- END + * ---- ---x DATERR + */ +u8 zr36060_device::irq_mask_r(offs_t offset) +{ + return m_irq_mask; +} + +void zr36060_device::irq_mask_w(offs_t offset, u8 data) +{ + m_irq_mask = data; + LOG("IRQ Mask %02x\n", data); +} + +/* + * [0x008] Interrupt Status + * same as above plus + * xx-- ---- ProCnt 2-bit cyclic Process counter + */ +u8 zr36060_device::irq_status_r(offs_t offset) +{ + return m_irq_status; +} + +/* + * [0x009 - 0x00c] Target Net Code Volume + */ +u8 zr36060_device::tcv_net_r(offs_t offset) +{ + return m_tcv_net[offset]; +} + +void zr36060_device::tcv_net_w(offs_t offset, u8 data) +{ + m_tcv_net[offset] = data; + LOG("Target Net Code Volume [%01x] %02x\n", offset, data); +} + +/* + * [0x00d - 0x010] Target Data Code Volume + */ +u8 zr36060_device::tcv_data_r(offs_t offset) +{ + return m_tcv_data[offset]; +} + +void zr36060_device::tcv_data_w(offs_t offset, u8 data) +{ + m_tcv_data[offset] = data; + LOG("Target Data Code Volume [%01x] %02x\n", offset, data); +} + +/* + * [0x011 - 0x012] Scale Factor + */ + u8 zr36060_device::sf_r(offs_t offset) + { + return m_sf[offset]; + } + +void zr36060_device::sf_w(offs_t offset, u8 data) +{ + m_sf[offset] = data; + LOG("Scale Factor [%01x] %02x\n", offset, data); +} + +/* + * [0x013 - 0x015] Allocation Factor + */ +u8 zr36060_device::af_r(offs_t offset) +{ + return m_af[offset]; +} + +void zr36060_device::af_w(offs_t offset, u8 data) +{ + m_af[offset] = data; + LOG("Allocation Factor [%01x] %02x\n", offset, data); +} + +/* + * [0x016 - 0x019] Accumulated Code Volume + */ +u8 zr36060_device::acv_r(offs_t offset) +{ + return m_acv[offset]; +} + +void zr36060_device::acv_w(offs_t offset, u8 data) +{ + m_acv[offset] = data; + LOG("Accumulated Code Volume [%01x] %02x\n", offset, data); +} + +/* + * [0x01a - 0x01d] Accumulated Total Activity + */ +u8 zr36060_device::act_r(offs_t offset) +{ + return m_act[offset]; +} + +void zr36060_device::act_w(offs_t offset, u8 data) +{ + m_act[offset] = data; + LOG("Accumulated Total Activity [%01x] %02x\n", offset, data); +} + +/* + * [0x01e - 0x021] Accumulated Truncated Bits + */ +u8 zr36060_device::acv_trun_r(offs_t offset) +{ + return m_acv_trun[offset]; +} + +void zr36060_device::acv_trun_w(offs_t offset, u8 data) +{ + m_acv_trun[offset] = data; + LOG("Accumulated Truncated Bits [%01x] %02x\n", offset, data); +} + +/************************************** + * + * Video Registers + * + *************************************/ + +u8 zr36060_device::video_control_r(offs_t offset) +{ + return m_video_control; +} + +void zr36060_device::video_control_w(offs_t offset, u8 data) +{ + m_video_control = data; + LOG("Video Control %02x\n", data); + LOG("\tVideo8 %d, Range %s, FIDet %s, FIVedge %s, FIExt %d SyncMstr %s\n" + , BIT(data, 7) ? 8 : 16 + , BIT(data, 6) ? "CCIR-601" : "Full scale" + , BIT(data, 3) ? "FI high/VSYNC latch middle of line" : "FI low/VSYNC latch HSYNC pulse" + , BIT(data, 2) ? "Trailing edge VSYNC" : "Leading edge VSYNC" + , BIT(data, 1) // uses FI pin if high + , BIT(data, 0) ? "Master" : "Slave" + ); +} + +u8 zr36060_device::video_polarity_r(offs_t offset) +{ + return m_video_polarity; +} + +void zr36060_device::video_polarity_w(offs_t offset, u8 data) +{ + m_video_polarity = data; + LOG("Video Polarity %02x\n", data); + LOG("\tVCLKPol %d, PValPol %d, PoePol %d, SImgPol %d, BLPol %d, FIPol %d, HSPol %d, VSPol %d\n" + , BIT(data, 7) + , BIT(data, 6) + , BIT(data, 5) + , BIT(data, 4) + , BIT(data, 3) + , BIT(data, 2) + , BIT(data, 1) + , BIT(data, 0) + ); +} + +u8 zr36060_device::video_scaling_r(offs_t offset) +{ + return (m_vscale << 2) | (m_hscale); +} + +void zr36060_device::video_scaling_w(offs_t offset, u8 data) +{ + m_vscale = BIT(data, 2); + m_hscale = data & 3; + LOG("Scaling %02x\n", data); + LOG("\tVScale %d:1 ratio, HScale %d:1 ratio\n" + , m_vscale + 1 + // NOTE: 8:1 is illegal + , 1 << m_hscale + ); } /************************************** diff --git a/src/devices/video/zr36060.h b/src/devices/video/zr36060.h index 86e3877b9159c..58267460c7465 100644 --- a/src/devices/video/zr36060.h +++ b/src/devices/video/zr36060.h @@ -24,6 +24,83 @@ class zr36060_device : public device_t, public device_memory_interface u16 m_address; address_space_config m_space_config; + + // Codec Control + u8 load_r(offs_t offset); + void load_w(offs_t offset, u8 data); + u8 code_fifo_status_r(offs_t offset); + u8 code_if_r(offs_t offset); + void code_if_w(offs_t offset, u8 data); + u8 codec_mode_r(offs_t offset); + void codec_mode_w(offs_t offset, u8 data); + u8 mbcv_r(offs_t offset); + void mbcv_w(offs_t offset, u8 data); + u8 markers_enable_r(offs_t offset); + void markers_enable_w(offs_t offset, u8 data); + u8 irq_mask_r(offs_t offset); + void irq_mask_w(offs_t offset, u8 data); + u8 irq_status_r(offs_t offset); + u8 tcv_net_r(offs_t offset); + void tcv_net_w(offs_t offset, u8 data); + u8 tcv_data_r(offs_t offset); + void tcv_data_w(offs_t offset, u8 data); + u8 sf_r(offs_t offset); + void sf_w(offs_t offset, u8 data); + u8 af_r(offs_t offset); + void af_w(offs_t offset, u8 data); + u8 acv_r(offs_t offset); + void acv_w(offs_t offset, u8 data); + u8 act_r(offs_t offset); + void act_w(offs_t offset, u8 data); + u8 acv_trun_r(offs_t offset); + void acv_trun_w(offs_t offset, u8 data); + + bool m_syncrst; + bool m_load; + bool m_code16; + bool m_endian; + bool m_cfis; + bool m_code_mstr; + u8 m_codec_mode; + u8 m_mbcv; + u8 m_markers_enable; + u8 m_irq_mask, m_irq_status; + // these are all forms of floating-point registers + u8 m_tcv_net[4], m_tcv_data[4]; + u8 m_sf[2]; + u8 m_af[3]; // 24-bits + u8 m_acv[4], m_act[4], m_acv_trun[4]; + + // Video Registers + u8 video_control_r(offs_t offset); + void video_control_w(offs_t offset, u8 data); + u8 video_polarity_r(offs_t offset); + void video_polarity_w(offs_t offset, u8 data); + u8 video_scaling_r(offs_t offset); + void video_scaling_w(offs_t offset, u8 data); + + u8 m_video_control; + u8 m_video_polarity; + u8 m_hscale, m_vscale; + + struct { + u8 y, u, v; + } m_bg_color; + + struct { + u16 vtotal, htotal; + u8 vsync_size, hsync_size; + u8 bvstart, bhstart; + u16 bvend, bhend; + } m_sync_gen; + + struct { + u16 vstart, vend, hstart, hend; + } m_active_area; + + struct { + u16 svstart, svend, shstart, shend; + } m_subimg_window; }; DECLARE_DEVICE_TYPE(ZR36060, zr36060_device) diff --git a/src/emu/debug/debughlp.cpp b/src/emu/debug/debughlp.cpp index 76102402bcbef..8e5fa1b9c64f2 100644 --- a/src/emu/debug/debughlp.cpp +++ b/src/emu/debug/debughlp.cpp @@ -46,7 +46,7 @@ const help_item f_static_help_list[] = " Breakpoints\n" " Watchpoints\n" " Registerpoints\n" - " Exception Points\n" + " Exceptionpoints\n" " Expressions\n" " Comments\n" " Cheats\n" @@ -195,14 +195,14 @@ const help_item f_static_help_list[] = { "exceptionpoints", "\n" - "Exception Point Commands\n" + "Exceptionpoint Commands\n" "Type help for further details on each command\n" "\n" - " ep[set] [,[,]] -- sets exception point on \n" - " epclear [] -- clears a given exception point or all if no specified\n" - " epdisable [] -- disabled a given exception point or all if no specified\n" - " epenable [] -- enables a given exception point or all if no specified\n" - " eplist -- lists all the exception points\n" + " ep[set] [,[,]] -- sets exceptionpoint on \n" + " epclear [] -- clears a given exceptionpoint or all if no specified\n" + " epdisable [] -- disabled a given exceptionpoint or all if no specified\n" + " epenable [] -- enables a given exceptionpoint or all if no specified\n" + " eplist -- lists all the exceptionpoints\n" }, { "expressions", @@ -1592,12 +1592,12 @@ const help_item f_static_help_list[] = "\n" " ep[set] [,[,]]\n" "\n" - "Sets a new exception point for exceptions of type on the currently visible CPU. " + "Sets a new exceptionpoint for exceptions of type on the currently visible CPU. " "The optional parameter lets you specify an expression that will be evaluated " - "each time the exception point is hit. If the result of the expression is true (non-zero), " - "the exception point will actually halt execution at the start of the exception handler; " + "each time the exceptionpoint is hit. If the result of the expression is true (non-zero), " + "the exceptionpoint will actually halt execution at the start of the exception handler; " "otherwise, execution will continue with no notification. The optional parameter " - "provides a command that is executed whenever the exception point is hit and the " + "provides a command that is executed whenever the exceptionpoint is hit and the " " is true. Note that you may need to embed the action within braces { } in order " "to prevent commas and semicolons from being interpreted as applying to the epset command " "itself.\n" @@ -1606,8 +1606,8 @@ const help_item f_static_help_list[] = "internally or externally vectored interrupts, errors occurring within instructions and " "system calls.\n" "\n" - "Each exception point that is set is assigned an index which can be used in other " - "exception point commands to reference this exception point.\n" + "Each exceptionpoint that is set is assigned an index which can be used in other " + "exceptionpoint commands to reference this exceptionpoint.\n" "\n" "Examples:\n" "\n" @@ -1620,57 +1620,57 @@ const help_item f_static_help_list[] = "\n" " epclear [[,...]]\n" "\n" - "The epclear command clears exception points. If is specified, only the requested " - "exception points are cleared, otherwise all exception points are cleared.\n" + "The epclear command clears exceptionpoints. If is specified, only the requested " + "exceptionpoints are cleared, otherwise all exceptionpoints are cleared.\n" "\n" "Examples:\n" "\n" "epclear 3\n" - " Clear exception point index 3.\n" + " Clear exceptionpoint index 3.\n" "\n" "epclear\n" - " Clear all exception points.\n" + " Clear all exceptionpoints.\n" }, { "epdisable", "\n" " epdisable [[,...]]\n" "\n" - "The epdisable command disables exception points. If is specified, only the requested " - "exception points are disabled, otherwise all exception points are disabled. Note that " - "disabling an exception point does not delete it, it just temporarily marks the exception " - "point as inactive.\n" + "The epdisable command disables exceptionpoints. If is specified, only the requested " + "exceptionpoints are disabled, otherwise all exceptionpoints are disabled. Note that " + "disabling an exceptionpoint does not delete it, it just temporarily marks the " + "exceptionpoint as inactive.\n" "\n" "Examples:\n" "\n" "epdisable 3\n" - " Disable exception point index 3.\n" + " Disable exceptionpoint index 3.\n" "\n" "epdisable\n" - " Disable all exception points.\n" + " Disable all exceptionpoints.\n" }, { "epenable", "\n" " epenable [[,...]]\n" "\n" - "The epenable command enables exception points. If is specified, only the " - "requested exception points are enabled, otherwise all exception points are enabled.\n" + "The epenable command enables exceptionpoints. If is specified, only the " + "requested exceptionpoints are enabled, otherwise all exceptionpoints are enabled.\n" "\n" "Examples:\n" "\n" "epenable 3\n" - " Enable exception point index 3.\n" + " Enable exceptionpoint index 3.\n" "\n" "epenable\n" - " Enable all exception points.\n" + " Enable all exceptionpoints.\n" }, { "eplist", "\n" " eplist\n" "\n" - "The eplist command lists all the current exception points, along with their index and " + "The eplist command lists all the current exceptionpoints, along with their index and " "any conditions or actions attached to them.\n" }, { diff --git a/src/emu/emupal.cpp b/src/emu/emupal.cpp index 0a6e92b604dd2..d8eb5a3e77416 100644 --- a/src/emu/emupal.cpp +++ b/src/emu/emupal.cpp @@ -459,6 +459,12 @@ void palette_device::write16_ext(offs_t offset, u16 data, u16 mem_mask) update_for_write(offset * 2, 2); } +void palette_device::write32_ext(offs_t offset, u32 data, u32 mem_mask) +{ + m_paletteram_ext.write32(offset, data, mem_mask); + update_for_write(offset * 4, 4); +} + u8 palette_device::read8_ext(offs_t offset) { return m_paletteram_ext.read8(offset); @@ -469,6 +475,10 @@ u16 palette_device::read16_ext(offs_t offset) return m_paletteram_ext.read16(offset); } +u32 palette_device::read32_ext(offs_t offset) +{ + return m_paletteram_ext.read32(offset); +} //------------------------------------------------- // write_indirect - write a byte to the base diff --git a/src/emu/emupal.h b/src/emu/emupal.h index 05d5d68ed232b..17deb2b09037d 100644 --- a/src/emu/emupal.h +++ b/src/emu/emupal.h @@ -367,7 +367,9 @@ class palette_device : public device_t, public device_palette_interface void write16(offs_t offset, u16 data, u16 mem_mask = u16(~0)); void write16_ext(offs_t offset, u16 data, u16 mem_mask = u16(~0)); u32 read32(offs_t offset); + u32 read32_ext(offs_t offset); void write32(offs_t offset, u32 data, u32 mem_mask = u32(~0)); + void write32_ext(offs_t offset, u32 data, u32 mem_mask = u32(~0)); // helper to update palette when data changed void update() { if (!m_init.isnull()) m_init(*this); } diff --git a/src/emu/save.cpp b/src/emu/save.cpp index 8c3329e7b38b7..6b3d4bbdeb606 100644 --- a/src/emu/save.cpp +++ b/src/emu/save.cpp @@ -505,7 +505,7 @@ u32 save_manager::signature() const temp[0] = little_endianize_int32(entry->m_typesize); temp[1] = little_endianize_int32(entry->m_typecount); temp[2] = little_endianize_int32(entry->m_blockcount); - temp[3] = little_endianize_int32(entry->m_stride); + temp[3] = 0; crc.append(&temp[0], sizeof(temp)); } return crc.finish(); diff --git a/src/emu/screen.cpp b/src/emu/screen.cpp index 7b38181a2c6e1..99175c3b47d47 100644 --- a/src/emu/screen.cpp +++ b/src/emu/screen.cpp @@ -558,6 +558,7 @@ screen_device::screen_device(const machine_config &mconfig, const char *tag, dev , m_curbitmap(0) , m_curtexture(0) , m_changed(true) + , m_last_partial_reset(attotime::zero) , m_last_partial_scan(0) , m_partial_scan_hpos(0) , m_color(rgb_t(0xff, 0xff, 0xff, 0xff)) @@ -884,6 +885,7 @@ void screen_device::device_start() save_item(NAME(m_visarea.min_y)); save_item(NAME(m_visarea.max_x)); save_item(NAME(m_visarea.max_y)); + save_item(NAME(m_last_partial_reset)); save_item(NAME(m_last_partial_scan)); save_item(NAME(m_frame_period)); save_item(NAME(m_brightness)); @@ -1067,19 +1069,19 @@ void screen_device::reset_origin(int beamy, int beamx) m_vblank_end_time = curtime - attotime(0, beamy * m_scantime + beamx * m_pixeltime); m_vblank_start_time = m_vblank_end_time - attotime(0, m_vblank_period); - // if we are resetting relative to (0,0) == VBLANK end, call the - // scanline 0 timer by hand now; otherwise, adjust it for the future - if (beamy == 0 && beamx == 0) - reset_partial_updates(); - else - m_scanline0_timer->adjust(time_until_pos(0)); - // if we are resetting relative to (visarea.bottom() + 1, 0) == VBLANK start, // call the VBLANK start timer now; otherwise, adjust it for the future if (beamy == ((m_visarea.bottom() + 1) % m_height) && beamx == 0) vblank_begin(0); else m_vblank_begin_timer->adjust(time_until_vblank_start()); + + // if we are resetting relative to (0,0) == VBLANK end, call the + // scanline 0 timer by hand now; otherwise, adjust it for the future + if (beamy == 0 && beamx == 0) + reset_partial_updates(); + else + m_scanline0_timer->adjust(time_until_pos(0)); } @@ -1196,6 +1198,14 @@ bool screen_device::update_partial(int scanline) return false; } + // skip if we already rendered this frame + // this can happen if a cpu timeslice that called update_partial is in the previous frame while scanline 0 already started + if (m_last_partial_scan == 0 && m_last_partial_reset > machine().time()) + { + LOG_PARTIAL_UPDATES(("skipped because frame was already rendered\n")); + return false; + } + // set the range of scanlines to render rectangle clip(m_visarea); clip.sety((std::max)(clip.top(), m_last_partial_scan), (std::min)(clip.bottom(), scanline)); @@ -1306,6 +1316,14 @@ void screen_device::update_now() return; } + // skip if we already rendered this frame + // this can happen if a cpu timeslice that called update_now is in the previous frame while scanline 0 already started + if (m_last_partial_scan == 0 && m_partial_scan_hpos == 0 && m_last_partial_reset > machine().time()) + { + LOG_PARTIAL_UPDATES(("skipped because frame was already rendered\n")); + return; + } + LOG_PARTIAL_UPDATES(("update_now(): Y=%d, X=%d, last partial %d, partial hpos %d (vis %d %d)\n", current_vpos, current_hpos, m_last_partial_scan, m_partial_scan_hpos, m_visarea.right(), m_visarea.bottom())); // start off by doing a partial update up to the line before us, in case that was necessary @@ -1421,6 +1439,7 @@ void screen_device::update_now() void screen_device::reset_partial_updates() { + m_last_partial_reset = machine().time(); m_last_partial_scan = 0; m_partial_scan_hpos = 0; m_partial_updates_this_frame = 0; diff --git a/src/emu/screen.h b/src/emu/screen.h index 5eb88f08f27f9..9100ae5bacc55 100644 --- a/src/emu/screen.h +++ b/src/emu/screen.h @@ -461,7 +461,7 @@ class screen_device : public device_t screen_update_rgb32_delegate m_screen_update_rgb32; // screen update callback (32-bit RGB) devcb_write_line m_screen_vblank; // screen vblank line callback devcb_write32 m_scanline_cb; // screen scanline callback - optional_device m_palette; // our palette + optional_device m_palette; // our palette u32 m_video_attributes; // flags describing the video system optional_memory_region m_svg_region; // the region in which the svg data is in @@ -485,6 +485,7 @@ class screen_device : public device_t u8 m_curbitmap; // current bitmap index u8 m_curtexture; // current texture index bool m_changed; // has this bitmap changed? + attotime m_last_partial_reset; // last time partial updates were reset s32 m_last_partial_scan; // scanline of last partial update s32 m_partial_scan_hpos; // horizontal pixel last rendered on this partial scanline bitmap_argb32 m_screen_overlay_bitmap; // screen overlay bitmap @@ -504,7 +505,7 @@ class screen_device : public device_t emu_timer * m_scanline0_timer; // scanline 0 timer emu_timer * m_scanline_timer; // scanline timer u64 m_frame_number; // the current frame number - u32 m_partial_updates_this_frame;// partial update counter this frame + u32 m_partial_updates_this_frame; // partial update counter this frame bool m_is_primary_screen; @@ -517,7 +518,7 @@ class screen_device : public device_t vblank_state_delegate m_callback; }; - std::vector> m_callback_list; // list of VBLANK callbacks + std::vector> m_callback_list; // list of VBLANK callbacks // auto-sizing bitmaps class auto_bitmap_item diff --git a/src/emu/xtal.cpp b/src/emu/xtal.cpp index 271a4fcc4c5ec..f4541c4055200 100644 --- a/src/emu/xtal.cpp +++ b/src/emu/xtal.cpp @@ -476,6 +476,7 @@ const double XTAL::known_xtals[] = { 48'556'800, // 48.5568_MHz_XTAL Wyse WY-85 48'654'000, // 48.654_MHz_XTAL Qume QVT-201 48'660'000, // 48.66_MHz_XTAL Zaxxon + 48'940'000, // 48.94_MHz_XTAL Queen Bee New 49'152'000, // 49.152_MHz_XTAL Used on some Namco PCBs, Baraduke h/w, System 21, Super System 22 49'423'500, // 49.4235_MHz_XTAL Wyse WY-185 50'000'000, // 50_MHz_XTAL Williams/Midway T/W/V-unit system @@ -504,6 +505,7 @@ const double XTAL::known_xtals[] = { 66'666'700, // 66.6667_MHz_XTAL Later Midway games 67'737'600, // 67.7376_MHz_XTAL PSX-based h/w, Sony ZN1-2-based 68'850'000, // 68.85_MHz_XTAL Wyse WY-50 + 69'196'800, // 69.1968_MHz_XTAL DEC VCB0x/VAXstation dot clock 69'551'990, // 69.55199_MHz_XTAL Sharp X68000 31.5kHz video 72'000'000, // 72_MHz_XTAL Aristocrat MKV 72'576'000, // 72.576_MHz_XTAL Centipede, Millipede, Missile Command, Let's Go Bowling "Multipede" diff --git a/src/frontend/mame/clifront.cpp b/src/frontend/mame/clifront.cpp index 104eec9bc9b4e..46d82a7e22c0e 100644 --- a/src/frontend/mame/clifront.cpp +++ b/src/frontend/mame/clifront.cpp @@ -1569,7 +1569,7 @@ void cli_frontend::verifysoftlist(const std::vector &args) void cli_frontend::version(const std::vector &args) { - osd_printf_info("%s", emulator_info::get_build_version()); + osd_printf_info("%s\n", emulator_info::get_build_version()); } diff --git a/src/frontend/mame/infoxml.cpp b/src/frontend/mame/infoxml.cpp index 95ca0826edef5..ee5c51d3a216e 100644 --- a/src/frontend/mame/infoxml.cpp +++ b/src/frontend/mame/infoxml.cpp @@ -106,6 +106,25 @@ class filtered_driver_enumerator using device_type_set = std::set, device_type_compare>; using device_type_vector = std::vector >; + +struct prepared_info +{ + prepared_info() = default; + prepared_info(const prepared_info &) = delete; + prepared_info(prepared_info &&) = default; +#if defined(_CPPLIB_VER) && defined(_MSVC_STL_VERSION) + // MSVCPRT currently requires default-constructible std::future promise types to be assignable + // remove this workaround when that's fixed + prepared_info &operator=(const prepared_info &) = default; +#else + prepared_info &operator=(const prepared_info &) = delete; +#endif + + std::string m_xml_snippet; + device_type_set m_dev_set; +}; + + // internal helper void output_header(std::ostream &out, bool dtd); void output_footer(std::ostream &out); @@ -131,8 +150,8 @@ void output_slots(std::ostream &out, machine_config &config, device_t &device, c void output_software_lists(std::ostream &out, device_t &root, const char *root_tag); void output_ramoptions(std::ostream &out, device_t &root); -void output_one_device(std::ostream &out, machine_config &config, device_t &device, const char *devtag); -void output_devices(std::ostream &out, emu_options &lookup_options, device_type_set const *filter); +void output_one_device(std::ostream &out, machine_config &config, device_t &device, const char *devtag, device_type_set *devtypes); +void output_devices(std::ostream &out, emu_options &lookup_options, device_type_set *filter); char const *get_merge_name(driver_list const &drivlist, game_driver const &driver, util::hash_collection const &romhashes); char const *get_merge_name(machine_config &config, device_t const &device, util::hash_collection const &romhashes); @@ -459,25 +478,8 @@ void info_xml_creator::output(std::ostream &out, const std::vector // known (and filtered) machines //------------------------------------------------- -void info_xml_creator::output(std::ostream &out, const std::function &filter, bool include_devices) +void info_xml_creator::output(std::ostream &out, const std::function &filter, bool include_devices) { - struct prepared_info - { - prepared_info() = default; - prepared_info(const prepared_info &) = delete; - prepared_info(prepared_info &&) = default; -#if defined(_CPPLIB_VER) && defined(_MSVC_STL_VERSION) - // MSVCPRT currently requires default-constructible std::future promise types to be assignable - // remove this workaround when that's fixed - prepared_info &operator=(const prepared_info &) = default; -#else - prepared_info &operator=(const prepared_info &) = delete; -#endif - - std::string m_xml_snippet; - device_type_set m_dev_set; - }; - // prepare a driver enumerator and the queue driver_enumerator drivlist(m_lookup_options); device_filter devfilter(filter); @@ -525,7 +527,7 @@ void info_xml_creator::output(std::ostream &out, const std::functionempty())) { output_header_if_necessary(out); @@ -806,7 +808,7 @@ void output_one(std::ostream &out, driver_enumerator &drivlist, const game_drive // a single device //------------------------------------------------- -void output_one_device(std::ostream &out, machine_config &config, device_t &device, const char *devtag) +void output_one_device(std::ostream &out, machine_config &config, device_t &device, const char *devtag, device_type_set *devtypes) { using util::xml::normalize_string; @@ -827,6 +829,9 @@ void output_one_device(std::ostream &out, machine_config &config, device_t &devi portlist.append(dev, errors); overall_unemulated |= dev.type().unemulated_features(); overall_imperfect |= dev.type().imperfect_features(); + + if (devtypes) + devtypes->insert(&device.type()); } } @@ -871,7 +876,7 @@ void output_one_device(std::ostream &out, machine_config &config, device_t &devi output_adjusters(out, portlist); output_features(out, device.type(), overall_unemulated, overall_imperfect); output_images(out, device, devtag); - output_slots(out, config, device, devtag, nullptr); + output_slots(out, config, device, devtag, devtypes); output_software_lists(out, device, devtag); util::stream_format(out, "\t\n", XML_TOP); } @@ -882,12 +887,13 @@ void output_one_device(std::ostream &out, machine_config &config, device_t &devi // registered device types //------------------------------------------------- -void output_devices(std::ostream &out, emu_options &lookup_options, device_type_set const *filter) +void output_devices(std::ostream &out, emu_options &lookup_options, device_type_set *filter) { - auto const action = [&lookup_options, &out] (auto &types, auto deref) + device_type_set catchup; + auto const action = [&lookup_options, &out, filter, &catchup] (auto &types, auto deref) { // machinery for making output order deterministic and capping outstanding tasks - std::queue > tasks; + std::queue > tasks; std::atomic active_task_count = 0; unsigned int const maximum_active_task_count = std::thread::hardware_concurrency() + 10; unsigned int const maximum_outstanding_task_count = maximum_active_task_count + 20; @@ -909,10 +915,11 @@ void output_devices(std::ostream &out, emu_options &lookup_options, device_type_ break; // do the dirty work asynchronously - auto task_proc = [&active_task_count, &lookup_options, batch = std::move(batch)] + auto task_proc = [&active_task_count, &lookup_options, batch = std::move(batch), collect_devices = bool(filter)] { // use a single machine configuration and stream for a batch of devices machine_config config(GAME_NAME(___empty), lookup_options); + prepared_info result; std::ostringstream stream; stream.imbue(std::locale::classic()); for (auto type : batch) @@ -930,14 +937,17 @@ void output_devices(std::ostream &out, emu_options &lookup_options, device_type_ device.config_complete(); // print details and remove it - output_one_device(stream, config, *dev, dev->tag()); + output_one_device(stream, config, *dev, dev->tag(), collect_devices ? &result.m_dev_set : nullptr); machine_config::token const tok(config.begin_configuration(config.root_device())); config.device_remove("_tmp"); } + // capture the XML snippet + result.m_xml_snippet = std::move(stream).str(); + // we're done with the task; decrement the counter and return active_task_count--; - return std::move(stream).str(); + return result; }; // add this task to the queue @@ -949,20 +959,44 @@ void output_devices(std::ostream &out, emu_options &lookup_options, device_type_ if (!tasks.empty()) { // wait for the oldest task to complete and get the info, in the spirit of determinism - std::string snippet = tasks.front().get(); + prepared_info pi = tasks.front().get(); tasks.pop(); // emit whatever XML we accumulated in the task - out << snippet; + out << pi.m_xml_snippet; + + // recursively collect device types if necessary + if (filter) + { + for (const auto &x : pi.m_dev_set) + { + if (filter->find(x) == filter->end()) + catchup.insert(x); + } + } } } }; // run through devices if (filter) + { action(*filter, [] (auto &x) { return x; }); + + // repeat until no more device types are discovered + while (!catchup.empty()) + { + for (const auto &x : catchup) + filter->insert(x); + device_type_set more = std::move(catchup); + catchup = device_type_set(); + action(more, [] (auto &x) { return x; }); + } + } else + { action(registered_device_types, [] (auto &x) { return &x; }); + } } diff --git a/src/lib/formats/fs_cbmdos.cpp b/src/lib/formats/fs_cbmdos.cpp index 7a567b19f95db..44c810a04a615 100644 --- a/src/lib/formats/fs_cbmdos.cpp +++ b/src/lib/formats/fs_cbmdos.cpp @@ -73,7 +73,7 @@ class impl : public filesystem_t { private: const impl & m_fs; - fsblk_t::block_t m_block; + fsblk_t::block_t::ptr m_block; std::set> m_visited_set; u8 m_track; u8 m_sector; @@ -124,7 +124,7 @@ class impl : public filesystem_t { static const u8 s_data_track_order[MAX_TRACKS - 1]; u8 m_max_track; - fsblk_t::block_t read_sector(int track, int sector) const; + fsblk_t::block_t::ptr read_sector(int track, int sector) const; std::optional dirent_from_path(const std::vector &path) const; void iterate_directory_entries(const std::function &callback) const; void iterate_all_directory_entries(const std::function &callback) const; @@ -305,7 +305,7 @@ impl::impl(fsblk_t &blockdev) meta_data impl::volume_metadata() { auto bam_block = read_sector(DIRECTORY_TRACK, BAM_SECTOR); - std::string_view disk_name = std::string_view((const char *) bam_block.rodata() + 0x90, 16); + std::string_view disk_name = bam_block->rstr(0x90, 16); meta_data results; results.set(meta_name::name, strtrimright_cbm(disk_name)); @@ -397,7 +397,7 @@ std::error_condition impl::file_create(const std::vector &path, con return err; auto new_block = read_sector(DIRECTORY_TRACK, new_sector); for (int i = 2; i < BLOCK_SIZE; i++) - new_block.w8(i, 0); + new_block->w8(i, 0); // Find last directory sector u8 last_sector = 0; block_iterator iter(*this, DIRECTORY_TRACK, FIRST_DIRECTORY_SECTOR); @@ -405,8 +405,8 @@ std::error_condition impl::file_create(const std::vector &path, con last_sector = iter.sector(); // Update chain on last directory sector auto last_dir_block = read_sector(DIRECTORY_TRACK, last_sector); - last_dir_block.w8(OFFSET_CHAIN_TRACK, DIRECTORY_TRACK); - last_dir_block.w8(OFFSET_CHAIN_SECTOR, new_sector); + last_dir_block->w8(OFFSET_CHAIN_TRACK, DIRECTORY_TRACK); + last_dir_block->w8(OFFSET_CHAIN_SECTOR, new_sector); track = DIRECTORY_TRACK; sector = new_sector; } @@ -419,11 +419,11 @@ std::error_condition impl::file_create(const std::vector &path, con auto dirblk = read_sector(track, sector); u32 offset = file_index * DIRECTORY_ENTRY_SIZE; for (int i = 0; i < DIRECTORY_ENTRY_SIZE; i++) - dirblk.w8(offset + i, (i >= 5 && i < 5 + 16) ? 0xa0 : 0x00); - dirblk.w8(offset + OFFSET_FILE_TYPE, FILE_TYPE_PRG); - dirblk.w8(offset + OFFSET_FILE_FIRST_TRACK, file_track); - dirblk.w8(offset + OFFSET_FILE_FIRST_SECTOR, file_sector); - dirblk.wstr(offset + OFFSET_FILE_NAME, filename); + dirblk->w8(offset + i, (i >= 5 && i < 5 + 16) ? 0xa0 : 0x00); + dirblk->w8(offset + OFFSET_FILE_TYPE, FILE_TYPE_PRG); + dirblk->w8(offset + OFFSET_FILE_FIRST_TRACK, file_track); + dirblk->w8(offset + OFFSET_FILE_FIRST_SECTOR, file_sector); + dirblk->wstr(offset + OFFSET_FILE_NAME, filename); // TODO set first side sector block track (rel file) // TODO set first side sector block sector (rel file) // TODO set rel file record length @@ -470,18 +470,18 @@ std::error_condition impl::file_write(const std::vector &path, cons { auto datablk = read_sector(data_track, data_sector); u8 bytes = (data_length - offset) > SECTOR_DATA_BYTES ? SECTOR_DATA_BYTES : data_length - offset; - memcpy(datablk.data() + 2, data.data() + offset, bytes); + datablk->write(2, data.data() + offset, bytes); offset += SECTOR_DATA_BYTES; sector_count++; - if (datablk.r8(OFFSET_CHAIN_TRACK) == CHAIN_END) + if (datablk->r8(OFFSET_CHAIN_TRACK) == CHAIN_END) { if (offset < data_length) { auto [err, next_track, next_sector] = claim_sector(); if (err) return err; - datablk.w8(OFFSET_CHAIN_TRACK, next_track); - datablk.w8(OFFSET_CHAIN_SECTOR, next_sector); + datablk->w8(OFFSET_CHAIN_TRACK, next_track); + datablk->w8(OFFSET_CHAIN_SECTOR, next_sector); data_track = next_track; data_sector = next_sector; } @@ -490,14 +490,14 @@ std::error_condition impl::file_write(const std::vector &path, cons { if (offset < data_length) { - data_track = datablk.r8(OFFSET_CHAIN_TRACK); - data_sector = datablk.r8(OFFSET_CHAIN_SECTOR); + data_track = datablk->r8(OFFSET_CHAIN_TRACK); + data_sector = datablk->r8(OFFSET_CHAIN_SECTOR); } else { // Free the rest of the chain - u8 track_to_free = datablk.r8(OFFSET_CHAIN_TRACK); - u8 sector_to_free = datablk.r8(OFFSET_CHAIN_SECTOR); + u8 track_to_free = datablk->r8(OFFSET_CHAIN_TRACK); + u8 sector_to_free = datablk->r8(OFFSET_CHAIN_SECTOR); while (track_to_free != CHAIN_END) { @@ -505,15 +505,15 @@ std::error_condition impl::file_write(const std::vector &path, cons if (err) return err; datablk = read_sector(track_to_free, sector_to_free); - track_to_free = datablk.r8(OFFSET_CHAIN_TRACK); - sector_to_free = datablk.r8(OFFSET_CHAIN_SECTOR); + track_to_free = datablk->r8(OFFSET_CHAIN_TRACK); + sector_to_free = datablk->r8(OFFSET_CHAIN_SECTOR); } } } if (offset >= data_length) { - datablk.w8(OFFSET_CHAIN_TRACK, CHAIN_END); - datablk.w8(OFFSET_CHAIN_SECTOR, bytes + 1); + datablk->w8(OFFSET_CHAIN_TRACK, CHAIN_END); + datablk->w8(OFFSET_CHAIN_SECTOR, bytes + 1); } } @@ -523,17 +523,17 @@ std::error_condition impl::file_write(const std::vector &path, cons if (file_type == FILE_TYPE_DEL) { // Free sector, update first file sector to 00 - u8 file_track = dirblk.r8(DIRECTORY_ENTRY_SIZE * dir_file_index + OFFSET_FILE_FIRST_TRACK); - u8 file_sector = dirblk.r8(DIRECTORY_ENTRY_SIZE * dir_file_index + OFFSET_FILE_FIRST_SECTOR); + u8 file_track = dirblk->r8(DIRECTORY_ENTRY_SIZE * dir_file_index + OFFSET_FILE_FIRST_TRACK); + u8 file_sector = dirblk->r8(DIRECTORY_ENTRY_SIZE * dir_file_index + OFFSET_FILE_FIRST_SECTOR); std::error_condition err = free_sector(file_track, file_sector); if (err) return err; - dirblk.w8(DIRECTORY_ENTRY_SIZE * dir_file_index + OFFSET_FILE_FIRST_TRACK, 0); - dirblk.w8(DIRECTORY_ENTRY_SIZE * dir_file_index + OFFSET_FILE_FIRST_SECTOR, 0); + dirblk->w8(DIRECTORY_ENTRY_SIZE * dir_file_index + OFFSET_FILE_FIRST_TRACK, 0); + dirblk->w8(DIRECTORY_ENTRY_SIZE * dir_file_index + OFFSET_FILE_FIRST_SECTOR, 0); sector_count = 0; } - dirblk.w8(DIRECTORY_ENTRY_SIZE * dir_file_index + OFFSET_FILE_TYPE, file_type); - dirblk.w16l(DIRECTORY_ENTRY_SIZE * dir_file_index + OFFSET_SECTOR_COUNT, sector_count); + dirblk->w8(DIRECTORY_ENTRY_SIZE * dir_file_index + OFFSET_FILE_TYPE, file_type); + dirblk->w16l(DIRECTORY_ENTRY_SIZE * dir_file_index + OFFSET_SECTOR_COUNT, sector_count); return std::error_condition(); } @@ -568,8 +568,8 @@ std::pair impl::claim_track_sector(u8 track) const return std::make_pair(error::invalid_block, 0); auto bamblk = read_sector(DIRECTORY_TRACK, BAM_SECTOR); - u8 free_count = bamblk.r8(4 * track); - u32 free_bitmap = bamblk.r24l(4 * track + 1); + u8 free_count = bamblk->r8(4 * track); + u32 free_bitmap = bamblk->r24l(4 * track + 1); for (int s = 0; s < MAX_SECTORS; s++) { @@ -578,12 +578,12 @@ std::pair impl::claim_track_sector(u8 track) const { free_bitmap &= ~(1 << sector); free_count--; - bamblk.w8(4 * track, free_count); - bamblk.w24l(4 * track + 1, free_bitmap); + bamblk->w8(4 * track, free_count); + bamblk->w24l(4 * track + 1, free_bitmap); // Write chain end marker in new sector auto claimedlk = read_sector(track, sector); - claimedlk.w8(OFFSET_CHAIN_TRACK, CHAIN_END); - claimedlk.w8(OFFSET_CHAIN_SECTOR, 0xff); + claimedlk->w8(OFFSET_CHAIN_TRACK, CHAIN_END); + claimedlk->w8(OFFSET_CHAIN_SECTOR, 0xff); return std::make_pair(std::error_condition(), sector); } } @@ -611,12 +611,12 @@ std::error_condition impl::free_sector(u8 track, u8 sector) const return error::invalid_block; auto bamblk = read_sector(DIRECTORY_TRACK, BAM_SECTOR); - u8 free_count = bamblk.r8(4 * track); - u32 free_bitmap = bamblk.r24l(4 * track + 1); + u8 free_count = bamblk->r8(4 * track); + u32 free_bitmap = bamblk->r24l(4 * track + 1); free_bitmap |= (1 << sector); free_count++; - bamblk.w8(4 * track, free_count); - bamblk.w24l(4 * track + 1, free_bitmap); + bamblk->w8(4 * track, free_count); + bamblk->w24l(4 * track + 1, free_bitmap); return std::error_condition(); } @@ -625,7 +625,7 @@ std::error_condition impl::free_sector(u8 track, u8 sector) const // impl::read_sector //------------------------------------------------- -fsblk_t::block_t impl::read_sector(int track, int sector) const +fsblk_t::block_t::ptr impl::read_sector(int track, int sector) const { // CBM thinks in terms of tracks/sectors, but we have a block device abstraction u32 block = 0; @@ -776,8 +776,8 @@ bool impl::block_iterator::next() // with that out of the way, proceed m_block = m_fs.read_sector(m_next_track, m_next_sector); - m_next_track = m_block.r8(OFFSET_CHAIN_TRACK); - m_next_sector = m_block.r8(OFFSET_CHAIN_SECTOR); + m_next_track = m_block->r8(OFFSET_CHAIN_TRACK); + m_next_sector = m_block->r8(OFFSET_CHAIN_SECTOR); result = true; } else @@ -795,7 +795,7 @@ bool impl::block_iterator::next() const void *impl::block_iterator::data() const { - return m_block.rodata() + 2; + return m_block->rodata() + 2; } @@ -805,7 +805,7 @@ const void *impl::block_iterator::data() const const std::array &impl::block_iterator::dirent_data() const { - return *reinterpret_cast *>(m_block.rodata()); + return *reinterpret_cast *>(m_block->rodata()); } diff --git a/src/lib/formats/fs_coco_os9.cpp b/src/lib/formats/fs_coco_os9.cpp index e261968f69a11..8e9d9e8c8d0e5 100644 --- a/src/lib/formats/fs_coco_os9.cpp +++ b/src/lib/formats/fs_coco_os9.cpp @@ -39,23 +39,23 @@ class coco_os9_impl : public filesystem_t class volume_header { public: - volume_header(fsblk_t::block_t &&block); + volume_header(fsblk_t::block_t::ptr &&block); volume_header(const volume_header &) = delete; volume_header(volume_header &&) = default; - u32 total_sectors() const { return m_block.r24b(0); } - u8 track_size_in_sectors() const { return m_block.r8(3); } - u16 allocation_bitmap_bytes() const { return m_block.r16b(4); } - u16 cluster_size() const { return m_block.r16b(6); } - u32 root_dir_lsn() const { return m_block.r24b(8); } - u16 owner_id() const { return m_block.r16b(11); } - u16 disk_id() const { return m_block.r16b(14); } - u8 format_flags() const { return m_block.r8(16); } - u16 sectors_per_track() const { return m_block.r16b(17); } - u32 bootstrap_lsn() const { return m_block.r24b(21); } - u16 bootstrap_size() const { return m_block.r16b(24); } - util::arbitrary_datetime creation_date() const { return from_os9_date(m_block.r24b(26), m_block.r16b(29)); } - u16 sector_size() const { u16 result = m_block.r16b(104); return result != 0 ? result : 256; } + u32 total_sectors() const { return m_block->r24b(0); } + u8 track_size_in_sectors() const { return m_block->r8(3); } + u16 allocation_bitmap_bytes() const { return m_block->r16b(4); } + u16 cluster_size() const { return m_block->r16b(6); } + u32 root_dir_lsn() const { return m_block->r24b(8); } + u16 owner_id() const { return m_block->r16b(11); } + u16 disk_id() const { return m_block->r16b(14); } + u8 format_flags() const { return m_block->r8(16); } + u16 sectors_per_track() const { return m_block->r16b(17); } + u32 bootstrap_lsn() const { return m_block->r24b(21); } + u16 bootstrap_size() const { return m_block->r16b(24); } + util::arbitrary_datetime creation_date() const { return from_os9_date(m_block->r24b(26), m_block->r16b(29)); } + u16 sector_size() const { u16 result = m_block->r16b(104); return result != 0 ? result : 256; } u8 sides() const { return (format_flags() & 0x01) ? 2 : 1; } bool double_density() const { return (format_flags() & 0x02) != 0; } bool double_track() const { return (format_flags() & 0x04) != 0; } @@ -65,7 +65,7 @@ class coco_os9_impl : public filesystem_t std::string name() const; private: - fsblk_t::block_t m_block; + fsblk_t::block_t::ptr m_block; }; @@ -74,17 +74,17 @@ class coco_os9_impl : public filesystem_t class file_header { public: - file_header(fsblk_t::block_t &&block, std::string &&filename); + file_header(fsblk_t::block_t::ptr &&block, std::string &&filename); file_header(const file_header &) = delete; file_header(file_header &&) = default; file_header &operator=(const file_header &) = delete; file_header &operator=(file_header &&) = default; - u8 attributes() const { return m_block.r8(0); } - u16 owner_id() const { return m_block.r16b(1); } - u8 link_count() const { return m_block.r8(8); } - u32 file_size() const { return m_block.r32b(9); } + u8 attributes() const { return m_block->r8(0); } + u16 owner_id() const { return m_block->r16b(1); } + u8 link_count() const { return m_block->r8(8); } + u32 file_size() const { return m_block->r32b(9); } util::arbitrary_datetime creation_date() const; bool is_directory() const { return (attributes() & 0x80) != 0; } bool is_non_sharable() const { return (attributes() & 0x40) != 0; } @@ -100,8 +100,8 @@ class coco_os9_impl : public filesystem_t void get_sector_map_entry(int entry_number, u32 &start_lsn, u16 &count) const; private: - fsblk_t::block_t m_block; - std::string m_filename; + fsblk_t::block_t::ptr m_block; + std::string m_filename; }; // ctor/dtor @@ -364,7 +364,7 @@ std::pair> coco_os9_impl::file_read(const std::error_condition coco_os9_impl::format(const meta_data &meta) { // for some reason, the OS-9 world favored filling with 0xE5 - m_blockdev.fill(0xe5); + m_blockdev.fill_all(0xe5); // identify geometry info u8 sectors = 18; // TODO - we need a definitive technique to get the floppy geometry @@ -390,33 +390,33 @@ std::error_condition coco_os9_impl::format(const meta_data &meta) // volume header auto volume_header = m_blockdev.get(0); - volume_header.fill(0x00); - volume_header.w24b(0, lsn_count); // DD.TOT - total secctors - volume_header.w8(3, sectors); // DD.TKS - track size in sectors - volume_header.w16b(4, (allocation_bitmap_bits + 7) / 8); // DD.MAP - allocation bitmap in bytes - volume_header.w16b(6, cluster_size); // DD.BIT - cluster size - volume_header.w24b(8, 1 + allocation_bitmap_lsns); // DD.DIR - root directory LSN - volume_header.w16b(11, owner_id); // DD.OWN - owner ID - volume_header.w8(13, attributes); // DD.ATT - Dattributes - volume_header.w16b(14, disk_id); // DD.DSK - disk ID - volume_header.w8(16, format_flags); // DD.FMT - format flags - volume_header.w16b(17, sectors); // DD.SPT - sectors per track - volume_header.w24b(26, creation_os9date); // DD.DAT - date of creation - volume_header.w16b(29, creation_os9time); // DD.DAT - time of creation - volume_header.wstr(31, to_os9_string(volume_title, 32)); // DD.NAM - title - volume_header.w16b(103, sector_bytes / 256); // sector bytes + volume_header->fill(0x00); + volume_header->w24b(0, lsn_count); // DD.TOT - total secctors + volume_header->w8(3, sectors); // DD.TKS - track size in sectors + volume_header->w16b(4, (allocation_bitmap_bits + 7) / 8); // DD.MAP - allocation bitmap in bytes + volume_header->w16b(6, cluster_size); // DD.BIT - cluster size + volume_header->w24b(8, 1 + allocation_bitmap_lsns); // DD.DIR - root directory LSN + volume_header->w16b(11, owner_id); // DD.OWN - owner ID + volume_header->w8(13, attributes); // DD.ATT - Dattributes + volume_header->w16b(14, disk_id); // DD.DSK - disk ID + volume_header->w8(16, format_flags); // DD.FMT - format flags + volume_header->w16b(17, sectors); // DD.SPT - sectors per track + volume_header->w24b(26, creation_os9date); // DD.DAT - date of creation + volume_header->w16b(29, creation_os9time); // DD.DAT - time of creation + volume_header->wstr(31, to_os9_string(volume_title, 32)); // DD.NAM - title + volume_header->w16b(103, sector_bytes / 256); // sector bytes // path descriptor options - volume_header.w8(0x3f + 0x00, 1); // device class - volume_header.w8(0x3f + 0x01, 1); // drive number - volume_header.w8(0x3f + 0x03, 0x20); // device type - volume_header.w8(0x3f + 0x04, 1); // density capability - volume_header.w16b(0x3f + 0x05, tracks); // number of tracks - volume_header.w8(0x3f + 0x07, heads); // number of sides - volume_header.w16b(0x3f + 0x09, sectors); // sectors per track - volume_header.w16b(0x3f + 0x0b, sectors); // sectors on track zero - volume_header.w8(0x3f + 0x0d, 3); // sector interleave factor - volume_header.w8(0x3f + 0x0e, 8); // default sectors per allocation + volume_header->w8(0x3f + 0x00, 1); // device class + volume_header->w8(0x3f + 0x01, 1); // drive number + volume_header->w8(0x3f + 0x03, 0x20); // device type + volume_header->w8(0x3f + 0x04, 1); // density capability + volume_header->w16b(0x3f + 0x05, tracks); // number of tracks + volume_header->w8(0x3f + 0x07, heads); // number of sides + volume_header->w16b(0x3f + 0x09, sectors); // sectors per track + volume_header->w16b(0x3f + 0x0b, sectors); // sectors on track zero + volume_header->w8(0x3f + 0x0d, 3); // sector interleave factor + volume_header->w8(0x3f + 0x0e, 8); // default sectors per allocation // allocation bitmap u32 total_allocated_sectors = 1 + allocation_bitmap_lsns + 1 + 8; @@ -436,34 +436,34 @@ std::error_condition coco_os9_impl::format(const meta_data &meta) } auto abblk = m_blockdev.get(1 + i); - abblk.copy(0, abblk_bytes.data(), sector_bytes); + abblk->write(0, abblk_bytes.data(), sector_bytes); } // root directory header auto roothdr_blk = m_blockdev.get(1 + allocation_bitmap_lsns); - roothdr_blk.fill(0x00); - roothdr_blk.w8(0x00, 0xbf); - roothdr_blk.w8(0x01, 0x00); - roothdr_blk.w8(0x02, 0x00); - roothdr_blk.w24b(0x03, creation_os9date); - roothdr_blk.w16b(0x06, creation_os9time); - roothdr_blk.w8(0x08, 0x01); - roothdr_blk.w8(0x09, 0x00); - roothdr_blk.w8(0x0a, 0x00); - roothdr_blk.w8(0x0b, 0x00); - roothdr_blk.w8(0x0c, 0x40); - roothdr_blk.w24b(0x0d, creation_os9date); - roothdr_blk.w24b(0x10, 1 + allocation_bitmap_lsns + 1); - roothdr_blk.w16b(0x13, 8); + roothdr_blk->fill(0x00); + roothdr_blk->w8(0x00, 0xbf); + roothdr_blk->w8(0x01, 0x00); + roothdr_blk->w8(0x02, 0x00); + roothdr_blk->w24b(0x03, creation_os9date); + roothdr_blk->w16b(0x06, creation_os9time); + roothdr_blk->w8(0x08, 0x01); + roothdr_blk->w8(0x09, 0x00); + roothdr_blk->w8(0x0a, 0x00); + roothdr_blk->w8(0x0b, 0x00); + roothdr_blk->w8(0x0c, 0x40); + roothdr_blk->w24b(0x0d, creation_os9date); + roothdr_blk->w24b(0x10, 1 + allocation_bitmap_lsns + 1); + roothdr_blk->w16b(0x13, 8); // root directory data auto rootdata_blk = m_blockdev.get(1 + allocation_bitmap_lsns + 1); - rootdata_blk.fill(0x00); - rootdata_blk.w8(0x00, 0x2e); - rootdata_blk.w8(0x01, 0xae); - rootdata_blk.w8(0x1f, 1 + allocation_bitmap_lsns); - rootdata_blk.w8(0x20, 0xae); - rootdata_blk.w8(0x3f, 1 + allocation_bitmap_lsns); + rootdata_blk->fill(0x00); + rootdata_blk->w8(0x00, 0x2e); + rootdata_blk->w8(0x01, 0xae); + rootdata_blk->w8(0x1f, 1 + allocation_bitmap_lsns); + rootdata_blk->w8(0x20, 0xae); + rootdata_blk->w8(0x3f, 1 + allocation_bitmap_lsns); return std::error_condition(); } @@ -554,9 +554,9 @@ std::vector coco_os9_impl::read_file_data(const file_header &header) const for (u32 lsn = start_lsn; lsn < start_lsn + count; lsn++) { auto block = m_blockdev.get(lsn); - size_t block_size = std::min(std::min(u32(m_volume_header.sector_size()), block.size()), header.file_size() - u32(data.size())); + size_t block_size = std::min(std::min(u32(m_volume_header.sector_size()), block->size()), header.file_size() - u32(data.size())); for (auto i = 0; i < block_size; i++) - data.push_back(block.rodata()[i]); + data.push_back(block->rodata()[i]); } } return data; @@ -664,7 +664,7 @@ bool coco_os9_impl::is_ignored_filename(std::string_view name) // volume_header ctor //------------------------------------------------- -coco_os9_impl::volume_header::volume_header(fsblk_t::block_t &&block) +coco_os9_impl::volume_header::volume_header(fsblk_t::block_t::ptr &&block) : m_block(std::move(block)) { } @@ -676,7 +676,7 @@ coco_os9_impl::volume_header::volume_header(fsblk_t::block_t &&block) std::string coco_os9_impl::volume_header::name() const { - std::string_view raw_name((const char *)&m_block.rodata()[31], 32); + std::string_view raw_name(m_block->rstr(31, 32)); return pick_os9_string(raw_name); } @@ -685,7 +685,7 @@ std::string coco_os9_impl::volume_header::name() const // file_header ctor //------------------------------------------------- -coco_os9_impl::file_header::file_header(fsblk_t::block_t &&block, std::string &&filename) +coco_os9_impl::file_header::file_header(fsblk_t::block_t::ptr &&block, std::string &&filename) : m_block(std::move(block)) , m_filename(std::move(filename)) { @@ -698,7 +698,7 @@ coco_os9_impl::file_header::file_header(fsblk_t::block_t &&block, std::string && util::arbitrary_datetime coco_os9_impl::file_header::creation_date() const { - return from_os9_date(m_block.r24b(13)); + return from_os9_date(m_block->r24b(13)); } @@ -735,7 +735,7 @@ meta_data coco_os9_impl::file_header::metadata() const int coco_os9_impl::file_header::get_sector_map_entry_count() const { - return (m_block.size() - 16) / 5; + return (m_block->size() - 16) / 5; } @@ -745,6 +745,6 @@ int coco_os9_impl::file_header::get_sector_map_entry_count() const void coco_os9_impl::file_header::get_sector_map_entry(int entry_number, u32 &start_lsn, u16 &count) const { - start_lsn = m_block.r24b(16 + (entry_number * 5) + 0); - count = m_block.r16b(16 + (entry_number * 5) + 3); + start_lsn = m_block->r24b(16 + (entry_number * 5) + 0); + count = m_block->r16b(16 + (entry_number * 5) + 3); } diff --git a/src/lib/formats/fs_coco_rsdos.cpp b/src/lib/formats/fs_coco_rsdos.cpp index c616c8babc6f5..0ce88cf01df60 100644 --- a/src/lib/formats/fs_coco_rsdos.cpp +++ b/src/lib/formats/fs_coco_rsdos.cpp @@ -62,11 +62,11 @@ class coco_rsdos_impl : public filesystem_t bool next(u8 &granule, u16 &byte_count); private: - fsblk_t::block_t m_granule_map; - std::optional m_current_granule; - u8 m_maximum_granules; - u16 m_last_sector_bytes; - std::bitset<256> m_visited_granules; + fsblk_t::block_t::ptr m_granule_map; + std::optional m_current_granule; + u8 m_maximum_granules; + u16 m_last_sector_bytes; + std::bitset<256> m_visited_granules; }; virtual std::pair metadata(const std::vector &path) override; @@ -96,8 +96,8 @@ class coco_rsdos_impl : public filesystem_t static constexpr u8 FILE_TYPE_TEXT_EDITOR = 0x03; static constexpr u8 FILE_LAST_GRANULE_INDICATOR = 0xc0; - fsblk_t::block_t read_sector(int track, int sector) const; - fsblk_t::block_t read_granule_sector(u8 granule, u8 sector) const; + fsblk_t::block_t::ptr read_sector(int track, int sector) const; + fsblk_t::block_t::ptr read_granule_sector(u8 granule, u8 sector) const; u8 maximum_granules() const; std::optional dirent_from_path(const std::vector &path); template @@ -297,11 +297,10 @@ std::pair> coco_rsdos_impl::file_read(cons { // read this sector auto block = read_sector(track, sector); - const u8 *data = block.rodata(); u16 data_length = std::min(byte_count, u16(SECTOR_SIZE)); // and append it to the results - memcpy(result.data() + current_size, data, data_length); + block->read(0, result.data() + current_size, data_length); // and advance current_size += data_length; @@ -320,7 +319,7 @@ std::pair> coco_rsdos_impl::file_read(cons std::error_condition coco_rsdos_impl::format(const meta_data &meta) { // formatting RS-DOS is easy - just fill everything with 0xFF - m_blockdev.fill(0xFF); + m_blockdev.fill_all(0xFF); return std::error_condition(); } @@ -367,20 +366,20 @@ std::error_condition coco_rsdos_impl::file_create(const std::vector for (file_index = 0; !found_entry && file_index < SECTOR_DIRECTORY_ENTRY_COUNT; file_index++) { - const u8 first_byte = dir_block.r8(file_index * DIRECTORY_ENTRY_SIZE); + const u8 first_byte = dir_block->r8(file_index * DIRECTORY_ENTRY_SIZE); // 0xff marks the end of the directory, 0x00 marks a deleted file found_entry = (first_byte == 0xff || first_byte == 0x00); if (found_entry) { for (int i = 0; i < DIRECTORY_ENTRY_SIZE; i++) - dir_block.w8(file_index * DIRECTORY_ENTRY_SIZE + i, 0); + dir_block->w8(file_index * DIRECTORY_ENTRY_SIZE + i, 0); auto [cerr, granule] = claim_granule(); if (cerr != std::error_condition()) return cerr; - dir_block.wstr(file_index * DIRECTORY_ENTRY_SIZE + 0, fname); - dir_block.w8(file_index * DIRECTORY_ENTRY_SIZE + OFFSET_FIRST_GRANULE, granule); + dir_block->wstr(file_index * DIRECTORY_ENTRY_SIZE + 0, fname); + dir_block->w8(file_index * DIRECTORY_ENTRY_SIZE + OFFSET_FIRST_GRANULE, granule); // The file type, ASCII flag, and number of bytes in last sector of file will be set during writing. } } @@ -429,7 +428,7 @@ std::error_condition coco_rsdos_impl::file_write(const std::vector { auto data_block = read_granule_sector(granule, granule_sector); bytes_in_last_sector = (data_length - offset) > SECTOR_SIZE ? SECTOR_SIZE : data_length - offset; - memcpy(data_block.data(), data.data() + offset, bytes_in_last_sector); + data_block->write(0, data.data() + offset, bytes_in_last_sector); offset += SECTOR_SIZE; write_granule_map(granule, FILE_LAST_GRANULE_INDICATOR + granule_sector); if (offset < data_length) @@ -466,9 +465,9 @@ std::error_condition coco_rsdos_impl::file_write(const std::vector // Update directory entry auto dir_block = read_sector(DIRECTORY_TRACK, dir_sector); - dir_block.w8(dir_file_index * DIRECTORY_ENTRY_SIZE + OFFSET_FILE_TYPE, determine_file_type(data)); - dir_block.w8(dir_file_index * DIRECTORY_ENTRY_SIZE + OFFSET_ASCII_FLAG, is_ascii(data) ? 0xff : 0x00); - dir_block.w16b(dir_file_index * DIRECTORY_ENTRY_SIZE + OFFSET_LAST_SECTOR_BYTES, bytes_in_last_sector); + dir_block->w8(dir_file_index * DIRECTORY_ENTRY_SIZE + OFFSET_FILE_TYPE, determine_file_type(data)); + dir_block->w8(dir_file_index * DIRECTORY_ENTRY_SIZE + OFFSET_ASCII_FLAG, is_ascii(data) ? 0xff : 0x00); + dir_block->w16b(dir_file_index * DIRECTORY_ENTRY_SIZE + OFFSET_LAST_SECTOR_BYTES, bytes_in_last_sector); return std::error_condition(); } @@ -516,9 +515,9 @@ std::pair coco_rsdos_impl::claim_granule() auto granule_block = read_sector(DIRECTORY_TRACK, 2); for (int g = 0; g < maximum_granules(); g++) { - if (granule_block.r8(g) == 0xff) + if (granule_block->r8(g) == 0xff) { - granule_block.w8(g, FILE_LAST_GRANULE_INDICATOR); + granule_block->w8(g, FILE_LAST_GRANULE_INDICATOR); return std::make_pair(std::error_condition(), g); } } @@ -529,22 +528,22 @@ std::pair coco_rsdos_impl::claim_granule() void coco_rsdos_impl::write_granule_map(u8 granule, u8 map_data) { auto granule_block = read_sector(DIRECTORY_TRACK, 2); - granule_block.w8(granule, map_data); + granule_block->w8(granule, map_data); } u8 coco_rsdos_impl::read_granule_map(u8 granule) const { auto granule_block = read_sector(DIRECTORY_TRACK, 2); - return granule_block.r8(granule); + return granule_block->r8(granule); } //------------------------------------------------- -// fsblk_t::block_t coco_rsdos_impl::read_sector +// coco_rsdos_impl::read_sector //------------------------------------------------- -fsblk_t::block_t coco_rsdos_impl::read_sector(int track, int sector) const +fsblk_t::block_t::ptr coco_rsdos_impl::read_sector(int track, int sector) const { // the CoCo RS-DOS world thinks in terms of tracks/sectors, but we have a block device // abstraction @@ -552,7 +551,7 @@ fsblk_t::block_t coco_rsdos_impl::read_sector(int track, int sector) const } -fsblk_t::block_t coco_rsdos_impl::read_granule_sector(u8 granule, u8 sector) const +fsblk_t::block_t::ptr coco_rsdos_impl::read_granule_sector(u8 granule, u8 sector) const { // Track 17 does not hold granules if (granule < (DIRECTORY_TRACK * TRACK_GRANULE_COUNT)) @@ -609,7 +608,7 @@ void coco_rsdos_impl::iterate_directory_entries(T &&callback) { // read this directory sector auto dir_block = read_sector(DIRECTORY_TRACK, dir_sector); - const rsdos_dirent_sector §or = *reinterpret_cast(dir_block.rodata()); + const rsdos_dirent_sector §or = *reinterpret_cast(dir_block->rodata()); // and loop through all entries for (int file_index = 0; file_index < 8; file_index++) @@ -709,7 +708,7 @@ bool coco_rsdos_impl::granule_iterator::next(u8 &granule, u16 &byte_count) if (m_current_granule) { std::optional next_granule; - const u8 *granule_map_data = m_granule_map.rodata(); + const u8 *granule_map_data = m_granule_map->rodata(); if (granule_map_data[*m_current_granule] < m_maximum_granules) { // this entry points to the next granule diff --git a/src/lib/formats/fs_fat.cpp b/src/lib/formats/fs_fat.cpp index 3b2911710353a..8e47bbc5abecc 100644 --- a/src/lib/formats/fs_fat.cpp +++ b/src/lib/formats/fs_fat.cpp @@ -185,19 +185,19 @@ class directory_entry static constexpr u8 ATTR_DIRECTORY = 0x10; static constexpr u8 ATTR_ARCHIVE = 0x20; - directory_entry(const fsblk_t::block_t &block, u32 offset) + directory_entry(fsblk_t::block_t::ptr block, u32 offset) : m_block(block) , m_offset(offset) { } - std::string_view raw_stem() const { return std::string_view((const char *) &m_block.rodata()[m_offset + OFFSET_FNAME], 8); } - std::string_view raw_ext() const { return std::string_view((const char *) &m_block.rodata()[m_offset + OFFSET_FNAME + 8], 3); } - u8 attributes() const { return m_block.r8(m_offset + OFFSET_ATTRIBUTES); } - u32 raw_create_datetime() const { return m_block.r32l(m_offset + OFFSET_CREATE_DATETIME); } - u32 raw_modified_datetime() const { return m_block.r32l(m_offset + OFFSET_MODIFIED_DATETIME); } - u32 start_cluster() const { return ((u32)m_block.r16l(m_offset + OFFSET_START_CLUSTER_HI)) << 16 | m_block.r16l(m_offset + OFFSET_START_CLUSTER); } - u32 file_size() const { return m_block.r32l(m_offset + OFFSET_FILE_SIZE); } + std::string_view raw_stem() const { return m_block->rstr(m_offset + OFFSET_FNAME, 8); } + std::string_view raw_ext() const { return m_block->rstr(m_offset + OFFSET_FNAME + 8, 3); } + u8 attributes() const { return m_block->r8(m_offset + OFFSET_ATTRIBUTES); } + u32 raw_create_datetime() const { return m_block->r32l(m_offset + OFFSET_CREATE_DATETIME); } + u32 raw_modified_datetime() const { return m_block->r32l(m_offset + OFFSET_MODIFIED_DATETIME); } + u32 start_cluster() const { return ((u32)m_block->r16l(m_offset + OFFSET_START_CLUSTER_HI)) << 16 | m_block->r16l(m_offset + OFFSET_START_CLUSTER); } + u32 file_size() const { return m_block->r32l(m_offset + OFFSET_FILE_SIZE); } bool is_read_only() const { return (attributes() & 0x01) != 0x00; } bool is_hidden() const { return (attributes() & 0x02) != 0x00; } @@ -206,18 +206,18 @@ class directory_entry bool is_long_file_name() const { return attributes() == 0x0f; } bool is_subdirectory() const { return (attributes() & 0x10) != 0x00; } bool is_archive() const { return (attributes() & 0x20) != 0x00; } - bool is_deleted() const { return m_block.r8(m_offset) == DELETED_FILE_MARKER; } + bool is_deleted() const { return m_block->r8(m_offset) == DELETED_FILE_MARKER; } std::string name() const; meta_data metadata() const; - void set_file_size(u32 file_size) { m_block.w32l(m_offset + OFFSET_FILE_SIZE, file_size); } - void set_raw_modified_datetime(u32 datetime) { m_block.w32l(m_offset + OFFSET_MODIFIED_DATETIME, datetime); } - void mark_deleted() { m_block.w8(m_offset + OFFSET_FNAME, DELETED_FILE_MARKER); } + void set_file_size(u32 file_size) { m_block->w32l(m_offset + OFFSET_FILE_SIZE, file_size); } + void set_raw_modified_datetime(u32 datetime) { m_block->w32l(m_offset + OFFSET_MODIFIED_DATETIME, datetime); } + void mark_deleted() { m_block->w8(m_offset + OFFSET_FNAME, DELETED_FILE_MARKER); } private: - fsblk_t::block_t m_block; - u32 m_offset; + fsblk_t::block_t::ptr m_block; + u32 m_offset; }; // ======================> directory_span @@ -240,7 +240,7 @@ class impl : public filesystem_t { public: // ctor/dtor - impl(fsblk_t &blockdev, fsblk_t::block_t &&boot_sector_block, std::vector &&file_allocation_table, u32 starting_sector, u32 sector_count, u16 reserved_sector_count, u8 bits_per_fat_entry); + impl(fsblk_t &blockdev, fsblk_t::block_t::ptr &&boot_sector_block, std::vector &&file_allocation_table, u32 starting_sector, u32 sector_count, u16 reserved_sector_count, u8 bits_per_fat_entry); virtual ~impl() = default; // accessors @@ -271,7 +271,7 @@ class impl : public filesystem_t private: static constexpr u32 FIRST_VALID_CLUSTER = 2; - fsblk_t::block_t m_boot_sector_block; + fsblk_t::block_t::ptr m_boot_sector_block; std::vector m_file_allocation_table; u32 m_starting_sector; u32 m_sector_count; @@ -494,19 +494,19 @@ std::vector fs::fat_image::directory_meta_description() const std::unique_ptr fs::fat_image::mount_partition(fsblk_t &blockdev, u32 starting_sector, u32 sector_count, u8 bits_per_fat_entry) { // load the boot sector block and get some basic info - fsblk_t::block_t boot_sector_block = blockdev.get(starting_sector); - u16 reserved_sector_count = boot_sector_block.r16l(impl::OFFSET_RESERVED_SECTOR_COUNT); + fsblk_t::block_t::ptr boot_sector_block = blockdev.get(starting_sector); + u16 reserved_sector_count = boot_sector_block->r16l(impl::OFFSET_RESERVED_SECTOR_COUNT); // load all file allocation table sectors - u32 fat_count = boot_sector_block.r8(impl::OFFSET_FAT_COUNT); - u32 sectors_per_fat = boot_sector_block.r16l(impl::OFFSET_FAT_SECTOR_COUNT); - u16 bytes_per_sector = boot_sector_block.r16l(impl::OFFSET_BYTES_PER_SECTOR); + u32 fat_count = boot_sector_block->r8(impl::OFFSET_FAT_COUNT); + u32 sectors_per_fat = boot_sector_block->r16l(impl::OFFSET_FAT_SECTOR_COUNT); + u16 bytes_per_sector = boot_sector_block->r16l(impl::OFFSET_BYTES_PER_SECTOR); std::vector file_allocation_table; file_allocation_table.reserve(fat_count * sectors_per_fat * bytes_per_sector); for (auto i = 0; i < fat_count * sectors_per_fat; i++) { - fsblk_t::block_t fatblk = blockdev.get(starting_sector + reserved_sector_count + i); - file_allocation_table.insert(file_allocation_table.end(), fatblk.rodata(), fatblk.rodata() + bytes_per_sector); + fsblk_t::block_t::ptr fatblk = blockdev.get(starting_sector + reserved_sector_count + i); + file_allocation_table.insert(file_allocation_table.end(), fatblk->rodata(), fatblk->rodata() + bytes_per_sector); } // and return the implementation @@ -548,18 +548,18 @@ meta_data directory_entry::metadata() const // impl ctor //------------------------------------------------- -impl::impl(fsblk_t &blockdev, fsblk_t::block_t &&boot_sector_block, std::vector &&file_allocation_table, u32 starting_sector, u32 sector_count, u16 reserved_sector_count, u8 bits_per_fat_entry) +impl::impl(fsblk_t &blockdev, fsblk_t::block_t::ptr &&boot_sector_block, std::vector &&file_allocation_table, u32 starting_sector, u32 sector_count, u16 reserved_sector_count, u8 bits_per_fat_entry) : filesystem_t(blockdev, 512) , m_boot_sector_block(std::move(boot_sector_block)) , m_file_allocation_table(std::move(file_allocation_table)) , m_starting_sector(starting_sector) , m_sector_count(sector_count) , m_reserved_sector_count(reserved_sector_count) - , m_bytes_per_sector(m_boot_sector_block.r16l(OFFSET_BYTES_PER_SECTOR)) - , m_root_directory_size(m_boot_sector_block.r16l(OFFSET_DIRECTORY_ENTRY_COUNT)) - , m_sectors_per_cluster(m_boot_sector_block.r8(OFFSET_CLUSTER_SECTOR_COUNT)) - , m_fat_count(m_boot_sector_block.r8(OFFSET_FAT_COUNT)) - , m_fat_sector_count(m_boot_sector_block.r16l(OFFSET_FAT_SECTOR_COUNT)) + , m_bytes_per_sector(m_boot_sector_block->r16l(OFFSET_BYTES_PER_SECTOR)) + , m_root_directory_size(m_boot_sector_block->r16l(OFFSET_DIRECTORY_ENTRY_COUNT)) + , m_sectors_per_cluster(m_boot_sector_block->r8(OFFSET_CLUSTER_SECTOR_COUNT)) + , m_fat_count(m_boot_sector_block->r8(OFFSET_FAT_COUNT)) + , m_fat_sector_count(m_boot_sector_block->r16l(OFFSET_FAT_SECTOR_COUNT)) , m_bits_per_fat_entry(bits_per_fat_entry) , m_last_cluster_indicator(((u64)1 << bits_per_fat_entry) - 1) , m_last_valid_cluster(m_last_cluster_indicator - 0x10) @@ -594,7 +594,7 @@ meta_data impl::volume_metadata() if (!results.has(meta_name::name)) results.set(meta_name::name, "UNTITLED"); - results.set(meta_name::oem_name, m_boot_sector_block.rstr(3, 8)); + results.set(meta_name::oem_name, m_boot_sector_block->rstr(3, 8)); return results; } @@ -661,9 +661,9 @@ std::pair> impl::file_read(const std::vect // and add data from all sectors for (u32 sector : sectors) { - fsblk_t::block_t block = m_blockdev.get(sector); - const u8 *data = block.rodata(); - size_t length = std::min((size_t)dirent->file_size() - result.size(), (size_t)block.size()); + fsblk_t::block_t::ptr block = m_blockdev.get(sector); + const u8 *data = block->rodata(); + size_t length = std::min((size_t)dirent->file_size() - result.size(), (size_t)block->size()); result.insert(result.end(), data, data + length); } return std::make_pair(std::error_condition(), std::move(result)); @@ -782,12 +782,12 @@ std::error_condition impl::initialize_directory(u32 directory_cluster, u32 paren std::string dir_fname; dir_fname.resize(directory_entry::FNAME_LENGTH, ' '); dir_fname[0] = '.'; - std::error_condition err = initialize_directory_entry(dirblk, 0, dir_fname, directory_entry::ATTR_DIRECTORY, directory_cluster); + std::error_condition err = initialize_directory_entry(*dirblk, 0, dir_fname, directory_entry::ATTR_DIRECTORY, directory_cluster); if (err) return err; dir_fname[1] = '.'; - err = initialize_directory_entry(dirblk, directory_entry::SIZE, dir_fname, directory_entry::ATTR_DIRECTORY, parent_cluster); + err = initialize_directory_entry(*dirblk, directory_entry::SIZE, dir_fname, directory_entry::ATTR_DIRECTORY, parent_cluster); if (err) return err; @@ -875,7 +875,7 @@ void impl::clear_cluster_sectors(u32 cluster, u8 fill_byte) { auto dirblk = m_blockdev.get(sector + i); for (int offset = 0; offset < m_bytes_per_sector; offset++) - dirblk.w8(offset, fill_byte); + dirblk->w8(offset, fill_byte); } } @@ -886,7 +886,7 @@ std::error_condition impl::file_create_sector(u32 sector, std::string &fname, u8 auto dirblk = m_blockdev.get(sector); for (u32 blkoffset = 0; blkoffset < m_bytes_per_sector; blkoffset += directory_entry::SIZE) { - u8 first_byte = dirblk.r8(blkoffset); + u8 first_byte = dirblk->r8(blkoffset); if (first_byte == 0x00 || first_byte == directory_entry::DELETED_FILE_MARKER) { u32 start_cluster = find_free_cluster(); @@ -894,7 +894,7 @@ std::error_condition impl::file_create_sector(u32 sector, std::string &fname, u8 return error::no_space; set_next_cluster(start_cluster, m_last_cluster_indicator); - std::error_condition err = initialize_directory_entry(dirblk, blkoffset, fname, attributes, start_cluster); + std::error_condition err = initialize_directory_entry(*dirblk, blkoffset, fname, attributes, start_cluster); if (err) return err; @@ -963,7 +963,7 @@ std::error_condition impl::file_write(const std::vector &path, cons { auto datablk = m_blockdev.get(sector); u32 bytes = (data_length - offset > m_bytes_per_sector) ? m_bytes_per_sector : data_length - offset; - memcpy(datablk.data(), data.data() + offset, bytes); + datablk->write(0, data.data() + offset, bytes); offset += m_bytes_per_sector; } } @@ -1110,7 +1110,7 @@ void impl::set_next_cluster(u32 cluster, u32 next_cluster) { u32 fat_sector = m_fat_start_sector + (i * m_fat_sector_count) + (byte_pos / m_bytes_per_sector); auto fatblk = m_blockdev.get(fat_sector); - fatblk.w8(byte_pos % m_bytes_per_sector, m_file_allocation_table[byte_pos]); + fatblk->w8(byte_pos % m_bytes_per_sector, m_file_allocation_table[byte_pos]); } } } @@ -1227,7 +1227,7 @@ void impl::iterate_directory_entries(const directory_span &dir, T &&callback) co for (u32 sector : sectors) { bool done = false; - fsblk_t::block_t block = m_blockdev.get(sector); + fsblk_t::block_t::ptr block = m_blockdev.get(sector); for (u32 index = 0; !done && (index < dirents_per_sector()); index++) { directory_entry dirent(block, index * 32); diff --git a/src/lib/formats/fs_hp98x5.cpp b/src/lib/formats/fs_hp98x5.cpp index 1b47fbbb459e4..f070d01b30fcc 100644 --- a/src/lib/formats/fs_hp98x5.cpp +++ b/src/lib/formats/fs_hp98x5.cpp @@ -544,11 +544,11 @@ std::error_condition hp98x5_impl::format(const meta_data &meta) // Interleave factor w16b(out_ins, m_fmt_interleave[ m_fs_type ]); - m_blockdev.get(0).copy(0, sys_rec.data(), sys_rec.size()); + m_blockdev.get(0)->write(0, sys_rec.data(), sys_rec.size()); // 9825 & 9831 have a backup copy of system record in spare track but 9845 hasn't, go figure if (m_fs_type != FS_TYPE_9845) { - m_blockdev.get(m_spare_start).copy(0, sys_rec.data(), sys_rec.size()); + m_blockdev.get(m_spare_start)->write(0, sys_rec.data(), sys_rec.size()); } m_dir.clear(); @@ -663,14 +663,14 @@ void hp98x5_impl::ensure_dir_loaded() // 8 Count of data tracks // 9 Interleave factor // 10..127 N/U - u16 sects_per_track = sys_rec.r16b(2); - u16 tot_tracks = sys_rec.r16b(4); - u16 spare_track = sys_rec.r16b(6); - u16 dir_start = sys_rec.r16b(8); - u16 av_start = sys_rec.r16b(10); - u16 av_end = sys_rec.r16b(12); - u16 sys_tracks = sys_rec.r16b(14); - u16 data_tracks = sys_rec.r16b(16); + u16 sects_per_track = sys_rec->r16b(2); + u16 tot_tracks = sys_rec->r16b(4); + u16 spare_track = sys_rec->r16b(6); + u16 dir_start = sys_rec->r16b(8); + u16 av_start = sys_rec->r16b(10); + u16 av_end = sys_rec->r16b(12); + u16 sys_tracks = sys_rec->r16b(14); + u16 data_tracks = sys_rec->r16b(16); m_img_tracks = m_blockdev.block_count() / SECTORS; @@ -1159,7 +1159,7 @@ std::vector hp98x5_impl::get_sector_range(lba_t first, unsigned size) const for (lba_t idx = first; idx < first + size; idx++) { auto data_sect = m_blockdev.get(u32(idx)); - memcpy(ptr, data_sect.rodata(), SECTOR_SIZE); + data_sect->read(0, ptr, SECTOR_SIZE); ptr += SECTOR_SIZE; } return res; @@ -1173,7 +1173,7 @@ void hp98x5_impl::store_sector_range(lba_t first, const std::vector& data) for (lba_t idx = first; idx < first + sects; idx++) { u32 count = std::min(to_go, SECTOR_SIZE); auto blk = m_blockdev.get(u32(idx)); - blk.copy(0, ptr, count); + blk->write(0, ptr, count); ptr += count; to_go -= count; } diff --git a/src/lib/formats/fs_hplif.cpp b/src/lib/formats/fs_hplif.cpp index e910ca3cb364d..8a3d2c52da4df 100644 --- a/src/lib/formats/fs_hplif.cpp +++ b/src/lib/formats/fs_hplif.cpp @@ -64,10 +64,10 @@ class impl : public filesystem_t { u8 size() const; private: - const impl & m_fs; - fsblk_t::block_t m_block; - u8 m_sector; - u32 m_sector_count; + const impl & m_fs; + fsblk_t::block_t::ptr m_block; + u8 m_sector; + u32 m_sector_count; }; impl(fsblk_t &blockdev); @@ -79,7 +79,7 @@ class impl : public filesystem_t { virtual std::pair> file_read(const std::vector &path) override; private: - fsblk_t::block_t read_sector(u32 starting_sector) const; + fsblk_t::block_t::ptr read_sector(u32 starting_sector) const; std::optional dirent_from_path(const std::vector &path) const; void iterate_directory_entries(const std::function &callback) const; util::arbitrary_datetime decode_datetime(const hplif_time *time) const; @@ -252,11 +252,11 @@ impl::impl(fsblk_t &blockdev) meta_data impl::volume_metadata() { auto block = read_sector(0); - std::string_view disk_name = std::string_view((const char *) block.rodata() + 2, 6); + std::string_view disk_name = block->rstr(2, 6); meta_data results; results.set(meta_name::name, strtrimright_hplif(disk_name)); - results.set(meta_name::creation_date, decode_datetime(reinterpret_cast(block.rodata() + 36))); + results.set(meta_name::creation_date, decode_datetime(reinterpret_cast(block->rodata() + 36))); return results; } @@ -324,7 +324,7 @@ std::pair> impl::file_read(const std::vect // impl::read_sector //------------------------------------------------- -fsblk_t::block_t impl::read_sector(u32 sector) const +fsblk_t::block_t::ptr impl::read_sector(u32 sector) const { return m_blockdev.get(sector); } @@ -359,10 +359,10 @@ std::optional impl::dirent_from_path(const std::vector &callback) const { - fsblk_t::block_t block = m_blockdev.get(0); - block_iterator iter(*this, block.r32b(8), block.r32b(16)); + fsblk_t::block_t::ptr block = m_blockdev.get(0); + block_iterator iter(*this, block->r32b(8), block->r32b(16)); - if (block.r16b(0) != 0x8000) + if (block->r16b(0) != 0x8000) { return; } @@ -461,7 +461,7 @@ bool impl::block_iterator::next() const void *impl::block_iterator::data() const { - return m_block.rodata(); + return m_block->rodata(); } //------------------------------------------------- @@ -471,19 +471,19 @@ const void *impl::block_iterator::data() const std::error_condition impl::format(const meta_data &meta) { std::string volume_name = meta.get_string(meta_name::name, "B9826 "); - fsblk_t::block_t block = m_blockdev.get(0); + fsblk_t::block_t::ptr block = m_blockdev.get(0); if (volume_name.size() < 6) volume_name.insert(volume_name.end(), 6 - volume_name.size(), ' '); if (volume_name.size() > 6) volume_name.resize(6); - block.w16b(0, 0x8000); // LIF magic - block.wstr(2, volume_name); - block.w32b(8, 2); // directory start - block.w16b(12, 0x1000); // LIF identifier - block.w32b(16, 14); // directory size - block.w16b(20, 1); // LIF version + block->w16b(0, 0x8000); // LIF magic + block->wstr(2, volume_name); + block->w32b(8, 2); // directory start + block->w16b(12, 0x1000); // LIF identifier + block->w32b(16, 14); // directory size + block->w16b(20, 1); // LIF version return std::error_condition(); } @@ -493,7 +493,7 @@ std::error_condition impl::format(const meta_data &meta) const std::array &impl::block_iterator::dirent_data() const { - return *reinterpret_cast *>(m_block.rodata()); + return *reinterpret_cast *>(m_block->rodata()); } } // anonymous namespace diff --git a/src/lib/formats/fs_isis.cpp b/src/lib/formats/fs_isis.cpp index e26ab9a529be9..fb79314a36085 100644 --- a/src/lib/formats/fs_isis.cpp +++ b/src/lib/formats/fs_isis.cpp @@ -786,14 +786,14 @@ isis_impl::lba_list isis_impl::get_file_allocation(lba_t first_link, unsigned si res.push_back(curr_map); // Get a linkage block auto map_sect = m_blockdev.get(curr_map); - auto prev_ptr = lba_from_2b(map_sect , 0); - auto next_ptr = lba_from_2b(map_sect , 2); + auto prev_ptr = lba_from_2b(*map_sect , 0); + auto next_ptr = lba_from_2b(*map_sect , 2); if (prev_lba != prev_ptr) { throw std::runtime_error(util::string_format("Incorrect backward linking in sector %d", curr_map)); } // Scan all pointers in linkage block for (u32 i = 4; i < SECTOR_SIZE; i += 2) { - auto ptr = lba_from_2b(map_sect , i); + auto ptr = lba_from_2b(*map_sect , i); if (size > 0) { if (ptr < 0) { throw std::runtime_error(util::string_format("Unexpected end of pointer list in sector %d", curr_map)); @@ -839,7 +839,7 @@ std::vector isis_impl::get_file_content(const lba_list& sects, unsigned size if ((idx % (PTRS_PER_BLOCK + 1)) != 0) { unsigned to_copy = std::min(size, SECTOR_SIZE); auto data_sect = m_blockdev.get(sects[ idx ]); - memcpy(res.data() + pos, data_sect.rodata(), to_copy); + data_sect->read(0, res.data() + pos, to_copy); size -= to_copy; pos += to_copy; } @@ -856,7 +856,7 @@ void isis_impl::store_file_content(const lba_list& sects, const std::vector& lba_t link_lba = sects[ idx ]; auto blk = m_blockdev.get(link_lba); // Pointer to previous block - lba_to_2b(prev_ptr, blk, 0); + lba_to_2b(prev_ptr, *blk, 0); prev_ptr = link_lba; lba_t next_ptr; if (sects.size() - idx > (PTRS_PER_BLOCK + 1)) { @@ -867,10 +867,10 @@ void isis_impl::store_file_content(const lba_list& sects, const std::vector& next_ptr = -1; } // Pointer to next block - lba_to_2b(next_ptr, blk, 2); + lba_to_2b(next_ptr, *blk, 2); // Pointers to data blocks for (unsigned j = 0; j < PTRS_PER_BLOCK; j++) { - lba_to_2b((j + idx + 1 < sects.size()) ? sects[ j + idx + 1 ] : -1, blk, 4 + 2 * j); + lba_to_2b((j + idx + 1 < sects.size()) ? sects[ j + idx + 1 ] : -1, *blk, 4 + 2 * j); } } // Write data blocks @@ -883,7 +883,7 @@ void isis_impl::store_file_content(const lba_list& sects, const std::vector& } u32 count = std::min(to_go, SECTOR_SIZE); auto blk = m_blockdev.get(sects[ idx ]); - blk.copy(0, ptr, count); + blk->write(0, ptr, count); ptr += count; to_go -= count; } diff --git a/src/lib/formats/fs_oric_jasmin.cpp b/src/lib/formats/fs_oric_jasmin.cpp index 2e25d5e00708d..db24a4a93f828 100644 --- a/src/lib/formats/fs_oric_jasmin.cpp +++ b/src/lib/formats/fs_oric_jasmin.cpp @@ -88,7 +88,7 @@ class oric_jasmin_impl : public filesystem_t { static std::string file_name_prepare(std::string name); static bool file_is_system(const u8 *entry); meta_data file_metadata(const u8 *entry); - std::tuple file_find(std::string name); + std::tuple file_find(std::string name); }; } @@ -201,33 +201,33 @@ std::error_condition oric_jasmin_impl::format(const meta_data &meta) std::string volume_name = meta.get_string(meta_name::name, "UNTITLED"); u32 blocks = m_blockdev.block_count(); - m_blockdev.fill(0x6c); + m_blockdev.fill_all(0x6c); u32 bblk = 20*17; auto fmap = m_blockdev.get(bblk); u32 off = 0; for(u32 blk = 0; blk != blocks; blk += 17) { if(blk == bblk) - fmap.w24l(off, 0x07fff); + fmap->w24l(off, 0x07fff); else - fmap.w24l(off, 0x1ffff); + fmap->w24l(off, 0x1ffff); off += 3; } for(u32 blk = blocks; blk != 17*42*2; blk += 17) { - fmap.w24l(off, 0x800000); + fmap->w24l(off, 0x800000); off += 3; } - fmap.w8(0xf6, 0x80); - fmap.w8(0xf7, 0x80); + fmap->w8(0xf6, 0x80); + fmap->w8(0xf7, 0x80); volume_name.resize(8, ' '); - fmap.wstr(0xf8, volume_name); + fmap->wstr(0xf8, volume_name); auto bdir = m_blockdev.get(20*17+1); - bdir.fill(0xff); - bdir.w16l(0, 0x0000); - bdir.w16l(2, 0x0000); + bdir->fill(0xff); + bdir->w16l(0, 0x0000); + bdir->w16l(2, 0x0000); return std::error_condition(); } @@ -237,10 +237,10 @@ meta_data oric_jasmin_impl::volume_metadata() meta_data res; auto bdir = m_blockdev.get(20*17); int len = 8; - while(len > 0 && bdir.rodata()[0xf8 + len - 1] == ' ') + while(len > 0 && bdir->rodata()[0xf8 + len - 1] == ' ') len--; - res.set(meta_name::name, bdir.rstr(0xf8, len)); + res.set(meta_name::name, bdir->rstr(0xf8, len)); return res; } @@ -249,7 +249,7 @@ std::error_condition oric_jasmin_impl::volume_metadata_change(const meta_data &m if(meta.has(meta_name::name)) { std::string volume_name = meta.get_string(meta_name::name); volume_name.resize(8, ' '); - m_blockdev.get(20*17).wstr(0xf8, volume_name); + m_blockdev.get(20*17)->wstr(0xf8, volume_name); } return std::error_condition(); } @@ -315,28 +315,28 @@ meta_data oric_jasmin_impl::file_metadata(const u8 *entry) else { u16 ref = get_u16be(entry); auto dblk = m_blockdev.get(cs_to_block(ref)); - res.set(meta_name::loading_address, dblk.r16l(2)); - res.set(meta_name::length, dblk.r16l(4)); + res.set(meta_name::loading_address, dblk->r16l(2)); + res.set(meta_name::length, dblk->r16l(4)); } return res; } -std::tuple oric_jasmin_impl::file_find(std::string name) +std::tuple oric_jasmin_impl::file_find(std::string name) { name = file_name_prepare(name); auto bdir = m_blockdev.get(20*17+1); for(;;) { for(u32 i = 0; i != 14; i ++) { u32 off = 4 + i*18; - u16 fref = bdir.r16b(off); - if(ref_valid(fref) || file_is_system(bdir.rodata()+off)) { - if(memcmp(bdir.rodata() + off + 3, name.data(), 12)) { - bool sys = file_is_system(bdir.rodata() + off); + u16 fref = bdir->r16b(off); + if(ref_valid(fref) || file_is_system(bdir->rodata()+off)) { + if(memcmp(bdir->rodata() + off + 3, name.data(), 12)) { + bool sys = file_is_system(bdir->rodata() + off); return std::make_tuple(bdir, off, sys); } } } - u16 ref = bdir.r16b(2); + u16 ref = bdir->r16b(2); if(!ref || !ref_valid(ref)) return std::make_tuple(bdir, 0U, false); @@ -354,7 +354,7 @@ std::pair oric_jasmin_impl::metadata(const std: if(!off) return std::make_pair(error::not_found, meta_data()); - return std::make_pair(std::error_condition(), file_metadata(bdir.rodata() + off)); + return std::make_pair(std::error_condition(), file_metadata(bdir->rodata() + off)); } std::error_condition oric_jasmin_impl::metadata_change(const std::vector &path, const meta_data &meta) @@ -366,7 +366,7 @@ std::error_condition oric_jasmin_impl::metadata_change(const std::vectordata() + off; if(meta.has(meta_name::locked)) entry[0x02] = meta.get_flag(meta_name::locked) ? 'L' : 'U'; if(meta.has(meta_name::name)) @@ -374,7 +374,7 @@ std::error_condition oric_jasmin_impl::metadata_change(const std::vectorw16l(2, meta.get_number(meta_name::loading_address)); return std::error_condition(); } @@ -394,13 +394,13 @@ std::pair> oric_jasmin_impl::direct for(;;) { for(u32 i = 0; i != 14; i ++) { u32 off = 4 + i*18; - u16 fref = bdir.r16b(off); - if(ref_valid(fref) || file_is_system(bdir.rodata()+off)) { - meta_data meta = file_metadata(bdir.rodata()+off); + u16 fref = bdir->r16b(off); + if(ref_valid(fref) || file_is_system(bdir->rodata()+off)) { + meta_data meta = file_metadata(bdir->rodata()+off); res.second.emplace_back(dir_entry(dir_entry_type::file, meta)); } } - u16 ref = bdir.r16b(2); + u16 ref = bdir->r16b(2); if(!ref || !ref_valid(ref)) break; bdir = m_blockdev.get(cs_to_block(ref)); @@ -418,7 +418,7 @@ std::error_condition oric_jasmin_impl::rename(const std::vector &op if(!off) return error::not_found; - wstr(bdir.data() + off + 0x03, file_name_prepare(npath[0])); + wstr(bdir->data() + off + 0x03, file_name_prepare(npath[0])); return std::error_condition(); } @@ -442,12 +442,12 @@ std::error_condition oric_jasmin_impl::file_create(const std::vectorr16b(off); if(!ref_valid(ref)) goto found; id++; } - u16 ref = bdir.r16b(2); + u16 ref = bdir->r16b(2); if(!ref || !ref_valid(ref)) { nb ++; break; @@ -460,25 +460,25 @@ std::error_condition oric_jasmin_impl::file_create(const std::vectorw16b(0, 0xff00); // Next sector + sblk->w16l(2, meta.get_number(meta_name::loading_address, 0x500)); + sblk->w16l(4, 0); // Length + sblk->w16b(6, block[1]); // Data block if(nb == 3) { - bdir.w16l(0, block[2]); // Link to the next directory sector + bdir->w16l(0, block[2]); // Link to the next directory sector bdir = m_blockdev.get(cs_to_block(block[2])); - bdir.fill(0xff); - bdir.w16l(0, block[2]); // Reference to itself - bdir.w16l(2, 0xff00); // No next directory sector + bdir->fill(0xff); + bdir->w16l(0, block[2]); // Reference to itself + bdir->w16l(2, 0xff00); // No next directory sector } u32 off = 4 + (id % 14) * 18; - bdir.w16b(off+0x00, block[0]); // First (and only) sector in the sector list - bdir.w8 (off+0x02, meta.get_flag(meta_name::locked, false) ? 'L' : 'U'); - bdir.wstr(off+0x03, file_name_prepare(meta.get_string(meta_name::name, ""))); - bdir.w8 (off+0x0f, meta.get_flag(meta_name::sequential, true) ? 'S' : 'D'); - bdir.w16l(off+0x10, 2); // 2 sectors for an empty file + bdir->w16b(off+0x00, block[0]); // First (and only) sector in the sector list + bdir->w8 (off+0x02, meta.get_flag(meta_name::locked, false) ? 'L' : 'U'); + bdir->wstr(off+0x03, file_name_prepare(meta.get_string(meta_name::name, ""))); + bdir->w8 (off+0x0f, meta.get_flag(meta_name::sequential, true) ? 'S' : 'D'); + bdir->w16l(off+0x10, 2); // 2 sectors for an empty file return std::error_condition(); } @@ -498,27 +498,27 @@ std::pair> oric_jasmin_impl::file_read(con data.resize(0x3e00); for(u32 i = 0; i != 62; i++) { auto dblk = m_blockdev.get(i); - memcpy(data.data() + 256 * i, dblk.rodata(), 256); + dblk->read(0, data.data() + 256 * i, 256); } } else { - const u8 *entry = bdir.rodata() + off; + const u8 *entry = bdir->rodata() + off; u16 ref = get_u16be(entry); auto iblk = m_blockdev.get(cs_to_block(ref)); - u32 length = iblk.r16l(4); + u32 length = iblk->r16l(4); while(ref_valid(ref)) { for(u32 pos = 6; pos != 256 && data.size() < length; pos += 2) { - u16 dref = iblk.r16b(pos); + u16 dref = iblk->r16b(pos); if(!ref_valid(dref)) goto done; auto dblk = m_blockdev.get(cs_to_block(dref)); u32 dpos = data.size(); data.resize(dpos + 256); - memcpy(data.data() + dpos, dblk.rodata(), 256); + dblk->read(0, data.data() + dpos, 256); if(data.size() >= length) goto done; } - ref = iblk.r16b(2); + ref = iblk->r16b(2); if(!ref_valid(ref)) break; iblk = m_blockdev.get(cs_to_block(ref)); @@ -544,10 +544,10 @@ std::error_condition oric_jasmin_impl::file_write(const std::vector return error::incorrect_size; for(u32 i=0; i != 0x3e; i++) - m_blockdev.get(i).copy(0, data.data() + i * 256, 256); + m_blockdev.get(i)->write(0, data.data() + i * 256, 256); } else { - u8 *entry = bdir.data() + off; + u8 *entry = bdir->data() + off; u32 cur_ns = get_u16le(entry + 0x10); // Data sectors first u32 need_ns = (data.size() + 255) / 256; @@ -566,37 +566,37 @@ std::error_condition oric_jasmin_impl::file_write(const std::vector for(u32 i=0; i < cur_ns; i += 125+1) { auto iblk = m_blockdev.get(cs_to_block(iref)); if(!i) - load_address = iblk.r16l(2); + load_address = iblk->r16l(2); tofree.push_back(iref); for(u32 j=0; j != 125 && i+j+1 != cur_ns; j++) - tofree.push_back(iblk.r16b(6+2*j)); - iref = iblk.r16b(2); + tofree.push_back(iblk->r16b(6+2*j)); + iref = iblk->r16b(2); } free_blocks(tofree); std::vector blocks = allocate_blocks(need_ns); for(u32 i=0; i < need_ns; i += 125+1) { auto iblk = m_blockdev.get(cs_to_block(blocks[i])); - iblk.fill(0xff); + iblk->fill(0xff); if(!i) { - iblk.w16l(2, load_address); - iblk.w16l(4, data.size()); + iblk->w16l(2, load_address); + iblk->w16l(4, data.size()); } if(i + 126 < need_ns) - iblk.w16b(0, blocks[i+126]); + iblk->w16b(0, blocks[i+126]); else - iblk.w16b(0, 0xff00); + iblk->w16b(0, 0xff00); for(u32 j=0; j != 125 && i+j+1 != need_ns; j++) { u32 dpos = 256 * (j + i/126*125); u32 size = data.size() - dpos; - iblk.w16b(6+j*2, blocks[i+j+1]); + iblk->w16b(6+j*2, blocks[i+j+1]); auto dblk = m_blockdev.get(cs_to_block(blocks[i+j+1])); if(size >= 256) - dblk.copy(0, data.data() + dpos, 256); + dblk->write(0, data.data() + dpos, 256); else { - dblk.copy(0, data.data() + dpos, size); - dblk.fill(size, 0x55, 256-size); + dblk->write(0, data.data() + dpos, size); + dblk->fill(size, 0x55, 256-size); } } } @@ -615,7 +615,7 @@ std::vector oric_jasmin_impl::allocate_blocks(u32 count) auto fmap = m_blockdev.get(20*17); u32 nf = 0; for(u32 track = 0; track != 2*41 && nf != count; track++) { - u32 map = fmap.r24l(track*3); + u32 map = fmap->r24l(track*3); if(map != 0x800000) { for(u32 sect = 1; sect <= 17 && nf != count; sect++) if(map & (0x20000 >> sect)) { @@ -625,7 +625,7 @@ std::vector oric_jasmin_impl::allocate_blocks(u32 count) } if(!map) map = 0x800000; - fmap.w24l(track*3, map); + fmap->w24l(track*3, map); } } return blocks; @@ -637,11 +637,11 @@ void oric_jasmin_impl::free_blocks(const std::vector &blocks) for(u16 ref : blocks) { u32 track = ref >> 8; u32 sect = ref & 0xff; - u32 map = fmap.r24l(track*3); + u32 map = fmap->r24l(track*3); if(map == 0x800000) map = 0; map |= 0x20000 >> sect; - fmap.w24l(track*3, map); + fmap->w24l(track*3, map); } } @@ -650,7 +650,7 @@ u32 oric_jasmin_impl::free_block_count() auto fmap = m_blockdev.get(20*17); u32 nf = 0; for(u32 track = 0; track != 2*41; track++) { - u32 map = fmap.r24l(track*3); + u32 map = fmap->r24l(track*3); if(map != 0x800000) { for(u32 sect = 1; sect <= 17; sect++) if(map & (0x20000 >> sect)) diff --git a/src/lib/formats/fs_prodos.cpp b/src/lib/formats/fs_prodos.cpp index 9b7a91f16154e..f7c77d47ff823 100644 --- a/src/lib/formats/fs_prodos.cpp +++ b/src/lib/formats/fs_prodos.cpp @@ -39,8 +39,8 @@ class prodos_impl : public filesystem_t { static const u8 boot[512]; static util::arbitrary_datetime prodos_to_dt(u32 date); - std::tuple path_find_step(const std::string &name, u16 block); - std::tuple path_find(const std::vector &path); + std::tuple path_find_step(const std::string &name, u16 block); + std::tuple path_find(const std::vector &path); std::pair> any_read(u8 type, u16 block, u32 length); }; } @@ -219,36 +219,36 @@ std::error_condition prodos_impl::format(const meta_data &meta) if(blocks >= 0x10000) blocks = 0xffff; - m_blockdev.get(0).copy(0x000, boot, 0x200); // Standard ProDOS boot sector as written by a 2gs - m_blockdev.get(1).fill(0x00); // No SOS boot sector + m_blockdev.get(0)->write(0x000, boot, 0x200); // Standard ProDOS boot sector as written by a 2gs + m_blockdev.get(1)->fill(0x00); // No SOS boot sector auto kblk1 = m_blockdev.get(2); // key block first block auto kblk2 = m_blockdev.get(3); // key block second block auto kblk3 = m_blockdev.get(4); // key block third block auto kblk4 = m_blockdev.get(5); // key block fourth block - kblk1.w16l(0x00, 0x0000); // Backwards key block pointer (null) - kblk1.w16l(0x02, 0x0003); // Forwards key block pointer - kblk1.w8 (0x04, 0xf0 | volume_name.size()); // Block type (f, key block) and name size - kblk1.wstr(0x05, volume_name); // Volume name, up to 15 characters - kblk1.w32b(0x16, 0x642a250d); // ??? date & time - kblk1.w16b(0x1a, 0x80ff); // ??? - kblk1.w32b(0x1c, 0x642a250d); // Creation date & time - kblk1.w8 (0x20, 0x05); // ProDOS version (2gs) - kblk1.w8 (0x21, 0x00); // ProDOS minimum version - kblk1.w8 (0x22, 0xc3); // Allowed access (destroy, rename, !backup, 3x0, write read) - kblk1.w8 (0x23, 0x27); // Directory entry length (fixed) - kblk1.w8 (0x24, 0x0d); // Entries per block (fixed) - kblk1.w16l(0x25, 0x0000); // Number of file entries in the directory - kblk1.w16l(0x27, 0x0006); // Bitmap block pointer - kblk1.w16l(0x29, blocks); // Number of blocks - - kblk2.w16l(0x00, 0x0002); // Backwards block pointer of the second volume block - kblk2.w16l(0x02, 0x0004); // Forwards block pointer of the second volume block - kblk3.w16l(0x00, 0x0003); // Backwards block pointer of the third volume block - kblk3.w16l(0x02, 0x0005); // Forwards block pointer of the third volume block - kblk4.w16l(0x00, 0x0004); // Backwards block pointer of the fourth volume block - kblk4.w16l(0x02, 0x0000); // Forwards block pointer of the fourth volume block (null) + kblk1->w16l(0x00, 0x0000); // Backwards key block pointer (null) + kblk1->w16l(0x02, 0x0003); // Forwards key block pointer + kblk1->w8 (0x04, 0xf0 | volume_name.size()); // Block type (f, key block) and name size + kblk1->wstr(0x05, volume_name); // Volume name, up to 15 characters + kblk1->w32b(0x16, 0x642a250d); // ??? date & time + kblk1->w16b(0x1a, 0x80ff); // ??? + kblk1->w32b(0x1c, 0x642a250d); // Creation date & time + kblk1->w8 (0x20, 0x05); // ProDOS version (2gs) + kblk1->w8 (0x21, 0x00); // ProDOS minimum version + kblk1->w8 (0x22, 0xc3); // Allowed access (destroy, rename, !backup, 3x0, write read) + kblk1->w8 (0x23, 0x27); // Directory entry length (fixed) + kblk1->w8 (0x24, 0x0d); // Entries per block (fixed) + kblk1->w16l(0x25, 0x0000); // Number of file entries in the directory + kblk1->w16l(0x27, 0x0006); // Bitmap block pointer + kblk1->w16l(0x29, blocks); // Number of blocks + + kblk2->w16l(0x00, 0x0002); // Backwards block pointer of the second volume block + kblk2->w16l(0x02, 0x0004); // Forwards block pointer of the second volume block + kblk3->w16l(0x00, 0x0003); // Backwards block pointer of the third volume block + kblk3->w16l(0x02, 0x0005); // Forwards block pointer of the third volume block + kblk4->w16l(0x00, 0x0004); // Backwards block pointer of the fourth volume block + kblk4->w16l(0x02, 0x0000); // Forwards block pointer of the fourth volume block (null) u32 fmap_block_count = (blocks + 4095) / 4096; u32 first_free_block = 6 + fmap_block_count; @@ -256,7 +256,7 @@ std::error_condition prodos_impl::format(const meta_data &meta) // Mark blocks from first_free_block to blocks-1 (the last one) as free for(u32 i = 0; i != fmap_block_count; i++) { auto fmap = m_blockdev.get(6 + i); - u8 *fdata = fmap.data(); + u8 *fdata = fmap->data(); u32 start = i ? 0 : first_free_block; u32 end = i != fmap_block_count - 1 ? 4095 : (blocks - 1) & 4095; end += 1; @@ -300,12 +300,12 @@ meta_data prodos_impl::volume_metadata() { meta_data res; auto bdir = m_blockdev.get(2); - int len = bdir.r8(0x04) & 0xf; - res.set(meta_name::name, bdir.rstr(0x05, len)); - res.set(meta_name::os_version, bdir.r8(0x20)); - res.set(meta_name::os_minimum_version, bdir.r8(0x21)); - res.set(meta_name::creation_date, prodos_to_dt(bdir.r32l(0x1c))); - res.set(meta_name::modification_date, prodos_to_dt(bdir.r32l(0x16))); + int len = bdir->r8(0x04) & 0xf; + res.set(meta_name::name, bdir->rstr(0x05, len)); + res.set(meta_name::os_version, bdir->r8(0x20)); + res.set(meta_name::os_minimum_version, bdir->r8(0x21)); + res.set(meta_name::creation_date, prodos_to_dt(bdir->r32l(0x1c))); + res.set(meta_name::modification_date, prodos_to_dt(bdir->r32l(0x16))); return res; } @@ -319,7 +319,7 @@ std::pair> prodos_impl::directory_c auto [blk, off, dir] = path_find(path); if(!off || !dir) return std::make_pair(error::not_found, std::vector()); - block = blk.r16l(off+0x11); + block = blk->r16l(off+0x11); } std::vector res; @@ -327,57 +327,57 @@ std::pair> prodos_impl::directory_c do { auto blk = m_blockdev.get(block); for(u32 off = 4; off < 511; off += 39) { - u8 type = blk.r8(off); + u8 type = blk->r8(off); // skip inactive entries and subroutine/volume headers if(type != 0 && type < 0xe0) { meta_data meta; - meta.set(meta_name::name, blk.rstr(off+1, type & 0xf)); + meta.set(meta_name::name, blk->rstr(off+1, type & 0xf)); type >>= 4; if(type == 5) { - auto rootblk = m_blockdev.get(blk.r16l(off+0x11)); - meta.set(meta_name::length, rootblk.r24l(0x005)); - meta.set(meta_name::rsrc_length, rootblk.r24l(0x105)); + auto rootblk = m_blockdev.get(blk->r16l(off+0x11)); + meta.set(meta_name::length, rootblk->r24l(0x005)); + meta.set(meta_name::rsrc_length, rootblk->r24l(0x105)); } else if(type >= 1 && type <= 3) { - meta.set(meta_name::length, blk.r24l(off + 0x15)); - meta.set(meta_name::file_type, file_type_to_string(blk.r8(off + 0x10))); + meta.set(meta_name::length, blk->r24l(off + 0x15)); + meta.set(meta_name::file_type, file_type_to_string(blk->r8(off + 0x10))); } - meta.set(meta_name::os_version, blk.r8(off + 0x1c)); - meta.set(meta_name::os_minimum_version, blk.r8(off + 0x1d)); - meta.set(meta_name::creation_date, prodos_to_dt(blk.r32l(off + 0x18))); - meta.set(meta_name::modification_date, prodos_to_dt(blk.r32l(off + 0x21))); + meta.set(meta_name::os_version, blk->r8(off + 0x1c)); + meta.set(meta_name::os_minimum_version, blk->r8(off + 0x1d)); + meta.set(meta_name::creation_date, prodos_to_dt(blk->r32l(off + 0x18))); + meta.set(meta_name::modification_date, prodos_to_dt(blk->r32l(off + 0x21))); res.emplace_back(dir_entry(type == 0xd ? dir_entry_type::dir : dir_entry_type::file, meta)); } } - block = blk.r16l(2); + block = blk->r16l(2); if(block >= m_blockdev.block_count()) break; } while(block); return std::make_pair(std::error_condition(), res); } -std::tuple prodos_impl::path_find_step(const std::string &name, u16 block) +std::tuple prodos_impl::path_find_step(const std::string &name, u16 block) { for(;;) { auto blk = m_blockdev.get(block); for(u32 off = 4; off < 511; off += 39) { - u8 type = blk.r8(off); - if(type != 0 && type < 0xe0 && name == blk.rstr(off+1, type & 0xf)) + u8 type = blk->r8(off); + if(type != 0 && type < 0xe0 && name == blk->rstr(off+1, type & 0xf)) return std::make_tuple(blk, off); } - block = blk.r16l(2); + block = blk->r16l(2); if(!block || block >= m_blockdev.block_count()) return std::make_tuple(blk, 0U); } } -std::tuple prodos_impl::path_find(const std::vector &path) +std::tuple prodos_impl::path_find(const std::vector &path) { if(path.size() == 0) - return std::tuple(fsblk_t::block_t(), 0, false); + return std::tuple(fsblk_t::block_t::ptr(), 0, false); u16 block = 2; for(u32 pathc = 0;; pathc++) { @@ -386,12 +386,12 @@ std::tuple prodos_impl::path_find(const std::vector return std::make_tuple(blk, off, false); if(pathc + 1 == path.size()) - return std::make_tuple(blk, off, (blk.r8(off) & 0xf0) == 0xd0); + return std::make_tuple(blk, off, (blk->r8(off) & 0xf0) == 0xd0); - if((blk.r8(off) & 0xf0) != 0xd0) + if((blk->r8(off) & 0xf0) != 0xd0) return std::make_tuple(blk, 0U, false); - block = blk.r16l(off + 0x11); + block = blk->r16l(off + 0x11); } } @@ -406,7 +406,7 @@ std::pair prodos_impl::metadata(const std::vect if(!off) return std::make_pair(error::not_found, meta_data()); - const u8 *entry = blk.rodata() + off; + const u8 *entry = blk->rodata() + off; meta_data res; if(dir) { @@ -420,8 +420,8 @@ std::pair prodos_impl::metadata(const std::vect res.set(meta_name::name, name); if(type == 5) { auto rootblk = m_blockdev.get(get_u16le(entry+0x11)); - res.set(meta_name::length, rootblk.r24l(0x005)); - res.set(meta_name::rsrc_length, rootblk.r24l(0x105)); + res.set(meta_name::length, rootblk->r24l(0x005)); + res.set(meta_name::rsrc_length, rootblk->r24l(0x105)); } else if(type >= 1 && type <= 3) res.set(meta_name::length, get_u24le(entry + 0x15)); @@ -446,15 +446,15 @@ std::pair> prodos_impl::any_read(u8 type, u8 *end = dst + data.second.size(); switch(type) { case 1: - memcpy(dst, m_blockdev.get(block).rodata(), 512); + m_blockdev.get(block)->read(0, dst, 512); dst += 512; break; case 2: { auto iblk = m_blockdev.get(block); for(u32 i=0; i != 256 && dst != end; i++) { - u16 blk = iblk.r8(i) | (iblk.r8(i | 0x100) << 8); - memcpy(dst, m_blockdev.get(blk).rodata(), 512); + u16 blk = iblk->r8(i) | (iblk->r8(i | 0x100) << 8); + m_blockdev.get(blk)->read(0, dst, 512); dst += 512; } break; @@ -464,10 +464,10 @@ std::pair> prodos_impl::any_read(u8 type, auto mblk = m_blockdev.get(block); for(u32 j=0; dst != end; j += 256) { u32 idx = j/256; - auto iblk = m_blockdev.get(mblk.r8(idx) | (mblk.r8(idx | 0x100) << 8)); + auto iblk = m_blockdev.get(mblk->r8(idx) | (mblk->r8(idx | 0x100) << 8)); for(u32 i=0; i != 256 && dst != end; i++) { - u16 blk = iblk.r8(i) | (iblk.r8(i | 0x100) << 8); - memcpy(dst, m_blockdev.get(blk).rodata(), 512); + u16 blk = iblk->r8(i) | (iblk->r8(i | 0x100) << 8); + m_blockdev.get(blk)->read(0, dst, 512); dst += 512; } } @@ -490,7 +490,7 @@ std::pair> prodos_impl::file_read(const st if(!off || dir) return std::make_pair(error::not_found, std::vector()); - const u8 *entry = blk.rodata() + off; + const u8 *entry = blk->rodata() + off; u8 type = entry[0] >> 4; if(type >= 1 && type <= 3) @@ -498,7 +498,7 @@ std::pair> prodos_impl::file_read(const st else if(type == 5) { auto kblk = m_blockdev.get(get_u16le(entry+0x11)); - return any_read(kblk.r8(0x000), kblk.r16l(0x001), kblk.r24l(0x005)); + return any_read(kblk->r8(0x000), kblk->r16l(0x001), kblk->r24l(0x005)); } else return std::make_pair(error::unsupported, std::vector()); @@ -510,12 +510,12 @@ std::pair> prodos_impl::file_rsrc_read(con if(!off || dir) return std::make_pair(error::not_found, std::vector()); - const u8 *entry = blk.rodata() + off; + const u8 *entry = blk->rodata() + off; u8 type = entry[0] >> 4; if(type == 5) { auto kblk = m_blockdev.get(get_u16le(entry+0x11)); - return any_read(kblk.r8(0x100), kblk.r16l(0x101), kblk.r24l(0x105)); + return any_read(kblk->r8(0x100), kblk->r16l(0x101), kblk->r24l(0x105)); } else return std::make_pair(error::unsupported, std::vector()); diff --git a/src/lib/formats/fs_vtech.cpp b/src/lib/formats/fs_vtech.cpp index 39e116a7ed852..163b2ae6d5351 100644 --- a/src/lib/formats/fs_vtech.cpp +++ b/src/lib/formats/fs_vtech.cpp @@ -55,7 +55,7 @@ class vtech_impl : public filesystem_t { private: meta_data file_metadata(const u8 *entry); - std::tuple file_find(std::string_view name); + std::tuple file_find(std::string_view name); std::vector> allocate_blocks(u32 count); void free_blocks(const std::vector> &blocks); u32 free_block_count(); @@ -126,7 +126,7 @@ vtech_impl::vtech_impl(fsblk_t &blockdev) : filesystem_t(blockdev, 128) std::error_condition vtech_impl::format(const meta_data &meta) { - m_blockdev.fill(0); + m_blockdev.fill_all(0); return std::error_condition(); } @@ -152,23 +152,23 @@ meta_data vtech_impl::file_metadata(const u8 *entry) return res; } -std::tuple vtech_impl::file_find(std::string_view name) +std::tuple vtech_impl::file_find(std::string_view name) { for(int sect = 0; sect != 14; sect++) { auto bdir = m_blockdev.get(sect); for(u32 i = 0; i != 8; i ++) { u32 off = i*16; - u8 type = bdir.r8(off); + u8 type = bdir->r8(off); if(type < 'A' || type > 'Z') continue; - if(bdir.r8(off+1) != ':') + if(bdir->r8(off+1) != ':') continue; - if(trim_end_spaces(bdir.rstr(off+2, 8)) == name) { + if(trim_end_spaces(bdir->rstr(off+2, 8)) == name) { return std::make_tuple(bdir, off); } } } - return std::make_tuple(fsblk_t::block_t(), 0xffffffff); + return std::make_tuple(fsblk_t::block_t::ptr(), 0xffffffff); } std::pair vtech_impl::metadata(const std::vector &path) @@ -180,7 +180,7 @@ std::pair vtech_impl::metadata(const std::vecto if(off == 0xffffffff) return std::make_pair(error::not_found, meta_data()); - return std::make_pair(std::error_condition(), file_metadata(bdir.rodata() + off)); + return std::make_pair(std::error_condition(), file_metadata(bdir->rodata() + off)); } std::error_condition vtech_impl::metadata_change(const std::vector &path, const meta_data &meta) @@ -192,7 +192,7 @@ std::error_condition vtech_impl::metadata_change(const std::vector if(off == 0xffffffff) return error::not_found; - u8 *entry = bdir.data() + off; + u8 *entry = bdir->data() + off; if(meta.has(meta_name::file_type)) entry[0x0] = meta.get_string(meta_name::file_type)[0]; if(meta.has(meta_name::name)) { @@ -225,12 +225,12 @@ std::pair> vtech_impl::directory_co auto bdir = m_blockdev.get(sect); for(u32 i = 0; i != 8; i ++) { u32 off = i*16; - u8 type = bdir.r8(off); + u8 type = bdir->r8(off); if(type < 'A' || type > 'Z') continue; - if(bdir.r8(off+1) != ':') + if(bdir->r8(off+1) != ':') continue; - meta_data meta = file_metadata(bdir.rodata()+off); + meta_data meta = file_metadata(bdir->rodata()+off); res.second.emplace_back(dir_entry(dir_entry_type::file, meta)); } } @@ -248,7 +248,7 @@ std::error_condition vtech_impl::rename(const std::vector &opath, c std::string name = npath[0]; name.resize(8, ' '); - wstr(bdir.data() + off + 2, name); + wstr(bdir->data() + off + 2, name); return std::error_condition(); } @@ -269,18 +269,18 @@ std::error_condition vtech_impl::file_create(const std::vector &pat auto bdir = m_blockdev.get(sect); for(u32 i = 0; i != 16; i ++) { u32 off = i*16; - u8 type = bdir.r8(off); + u8 type = bdir->r8(off); if(type != 'T' && type != 'B') { std::string fname = meta.get_string(meta_name::name, ""); fname.resize(8, ' '); - bdir.w8 (off+0x0, meta.get_string(meta_name::file_type, "T")[0]); - bdir.w8 (off+0x1, ':'); - bdir.wstr(off+0x2, fname); - bdir.w8 (off+0xa, 0x00); - bdir.w8 (off+0xb, 0x00); - bdir.w16l(off+0xc, meta.get_number(meta_name::loading_address, 0x7ae9)); - bdir.w16l(off+0xe, bdir.r16l(off+0xc)); // Size 0 initially + bdir->w8 (off+0x0, meta.get_string(meta_name::file_type, "T")[0]); + bdir->w8 (off+0x1, ':'); + bdir->wstr(off+0x2, fname); + bdir->w8 (off+0xa, 0x00); + bdir->w8 (off+0xb, 0x00); + bdir->w16l(off+0xc, meta.get_number(meta_name::loading_address, 0x7ae9)); + bdir->w16l(off+0xe, bdir->r16l(off+0xc)); // Size 0 initially return std::error_condition(); } } @@ -299,7 +299,7 @@ std::pair> vtech_impl::file_read(const std if(off == 0xffffffff) return std::make_pair(error::not_found, data); - const u8 *entry = bdir.rodata() + off; + const u8 *entry = bdir->rodata() + off; u8 track = entry[0xa]; u8 sector = entry[0xb]; @@ -314,10 +314,10 @@ std::pair> vtech_impl::file_read(const std int size = len - pos; if(size > 126) size = 126; - memcpy(data.data() + pos, dblk.data(), size); + dblk->read(0, data.data() + pos, size); pos += size; - track = dblk.r8(126); - sector = dblk.r8(127); + track = dblk->r8(126); + sector = dblk->r8(127); } return std::make_pair(std::error_condition(), data); } @@ -331,7 +331,7 @@ std::error_condition vtech_impl::file_write(const std::vector &path if(off == 0xffffffff) return error::not_found; - u8 *entry = bdir.data() + off; + u8 *entry = bdir->data() + off; u32 cur_len = (get_u16le(entry + 0xe) - get_u16le(entry + 0xc)) & 0xffff; u32 new_len = data.size(); @@ -350,8 +350,8 @@ std::error_condition vtech_impl::file_write(const std::vector &path for(u32 i = 0; i != cur_ns; i++) { tofree.emplace_back(std::make_pair(track, sector)); auto dblk = m_blockdev.get(track*16 + sector); - track = dblk.r8(126); - sector = dblk.r8(127); + track = dblk->r8(126); + sector = dblk->r8(127); } free_blocks(tofree); @@ -363,13 +363,13 @@ std::error_condition vtech_impl::file_write(const std::vector &path if(len > 126) len = 126; else if(len < 126) - dblk.fill(0x00); - memcpy(dblk.data(), data.data() + 126*i, len); + dblk->fill(0x00); + dblk->write(0, data.data() + 126*i, len); if(i < need_ns) { - dblk.w8(126, blocks[i+1].first); - dblk.w8(127, blocks[i+1].second); + dblk->w8(126, blocks[i+1].first); + dblk->w8(127, blocks[i+1].second); } else - dblk.w16l(126, 0); + dblk->w16l(126, 0); } u16 end_address = (get_u16le(entry + 0xc) + data.size()) & 0xffff; @@ -394,8 +394,8 @@ std::vector> vtech_impl::allocate_blocks(u32 count) for(u8 sector = 0; sector != 16; sector++) { u32 off = (track-1)*2 + (sector / 8); u32 bit = 1 << (sector & 7); - if(!(fmap.r8(off) & bit)) { - fmap.w8(off, fmap.r8(off) | bit); + if(!(fmap->r8(off) & bit)) { + fmap->w8(off, fmap->r8(off) | bit); blocks.emplace_back(std::make_pair(track, sector)); if(blocks.size() == count) return blocks; @@ -412,7 +412,7 @@ void vtech_impl::free_blocks(const std::vector> &blocks) u8 sector = ref.second; u32 off = (track-1)*2 + (sector / 8); u32 bit = 1 << (sector & 7); - fmap.w8(off, fmap.r8(off) & ~bit); + fmap->w8(off, fmap->r8(off) & ~bit); } } @@ -421,7 +421,7 @@ u32 vtech_impl::free_block_count() auto fmap = m_blockdev.get(15); u32 nf = 0; for(u32 off = 0; off != (40-1)*2; off++) { - u8 m = fmap.r8(off); + u8 m = fmap->r8(off); // Count 1 bits; m = ((m & 0xaa) >> 1) | (m & 0x55); m = ((m & 0xcc) >> 2) | (m & 0x33); diff --git a/src/lib/formats/fsblk.cpp b/src/lib/formats/fsblk.cpp index 8dfedcc4941bf..5e8198d0ce84b 100644 --- a/src/lib/formats/fsblk.cpp +++ b/src/lib/formats/fsblk.cpp @@ -13,154 +13,124 @@ namespace fs { -void refcounted_inner::ref() -{ - m_ref ++; -} - -void refcounted_inner::ref_weak() -{ - m_weak_ref ++; -} - -bool refcounted_inner::unref() -{ - m_ref --; - if(m_ref == 0) { - if(m_weak_ref) - drop_weak_references(); - else - delete this; - return true; - } - return false; -} - -bool refcounted_inner::unref_weak() -{ - m_weak_ref --; - if(m_weak_ref == 0 && m_ref == 0) { - delete this; - return true; - } - return false; -} - - - void fsblk_t::set_block_size(u32 block_size) { m_block_size = block_size; } -u8 *fsblk_t::iblock_t::offset(const char *function, u32 off, u32 size) +const u8 *fsblk_t::block_t::roffs(const char *function, u32 off, u32 size) const { if(off + size > m_size) - throw std::out_of_range(util::string_format("block_t::%s out-of-block access, offset=%d, size=%d, block size=%d", function, off, size, m_size)); - return data() + off; + throw std::out_of_range(util::string_format("block_t::%s out-of-block read access, offset=%d, size=%d, block size=%d", function, off, size, m_size)); + return rodata() + off; } -const u8 *fsblk_t::iblock_t::rooffset(const char *function, u32 off, u32 size) +u8 *fsblk_t::block_t::woffs(const char *function, u32 off, u32 size) { if(off + size > m_size) - throw std::out_of_range(util::string_format("block_t::%s out-of-block read access, offset=%d, size=%d, block size=%d", function, off, size, m_size)); - return rodata() + off; + throw std::out_of_range(util::string_format("block_t::%s out-of-block access, offset=%d, size=%d, block size=%d", function, off, size, m_size)); + return data() + off; } -void fsblk_t::block_t::copy(u32 offset, const u8 *src, u32 size) +void fsblk_t::block_t::write(u32 offset, const u8 *src, u32 size) { - memcpy(m_object->offset("copy", offset, size), src, size); + memcpy(woffs("write", offset, size), src, size); } void fsblk_t::block_t::fill(u32 offset, u8 data, u32 size) { - memset(m_object->offset("fill", offset, size), data, size); + memset(woffs("fill", offset, size), data, size); } void fsblk_t::block_t::fill(u8 data) { - memset(m_object->data(), data, m_object->size()); + memset(this->data(), data, size()); } void fsblk_t::block_t::wstr(u32 offset, std::string_view str) { - memcpy(m_object->offset("wstr", offset, str.size()), str.data(), str.size()); + memcpy(woffs("wstr", offset, str.size()), str.data(), str.size()); } void fsblk_t::block_t::w8(u32 offset, u8 data) { - m_object->offset("w8", offset, 1)[0] = data; + woffs("w8", offset, 1)[0] = data; } void fsblk_t::block_t::w16b(u32 offset, u16 data) { - put_u16be(m_object->offset("w16b", offset, 2), data); + put_u16be(woffs("w16b", offset, 2), data); } void fsblk_t::block_t::w24b(u32 offset, u32 data) { - put_u24be(m_object->offset("w24b", offset, 3), data); + put_u24be(woffs("w24b", offset, 3), data); } void fsblk_t::block_t::w32b(u32 offset, u32 data) { - put_u32be(m_object->offset("w32b", offset, 4), data); + put_u32be(woffs("w32b", offset, 4), data); } void fsblk_t::block_t::w16l(u32 offset, u16 data) { - put_u16le(m_object->offset("w16l", offset, 2), data); + put_u16le(woffs("w16l", offset, 2), data); } void fsblk_t::block_t::w24l(u32 offset, u32 data) { - put_u24le(m_object->offset("w24l", offset, 3), data); + put_u24le(woffs("w24l", offset, 3), data); } void fsblk_t::block_t::w32l(u32 offset, u32 data) { - put_u32le(m_object->offset("w32l", offset, 4), data); + put_u32le(woffs("w32l", offset, 4), data); +} + +void fsblk_t::block_t::read(u32 offset, u8 *dst, u32 size) const +{ + memcpy(dst, roffs("read", offset, size), size); } std::string_view fsblk_t::block_t::rstr(u32 offset, u32 size) const { - const u8 *d = m_object->rooffset("rstr", offset, size); + const u8 *d = roffs("rstr", offset, size); return std::string_view(reinterpret_cast(d), size); } u8 fsblk_t::block_t::r8(u32 offset) const { - return m_object->offset("r8", offset, 1)[0]; + return roffs("r8", offset, 1)[0]; } u16 fsblk_t::block_t::r16b(u32 offset) const { - return get_u16be(m_object->offset("r16b", offset, 2)); + return get_u16be(roffs("r16b", offset, 2)); } u32 fsblk_t::block_t::r24b(u32 offset) const { - return get_u24be(m_object->offset("r24b", offset, 3)); + return get_u24be(roffs("r24b", offset, 3)); } u32 fsblk_t::block_t::r32b(u32 offset) const { - return get_u32be(m_object->offset("r32b", offset, 4)); + return get_u32be(roffs("r32b", offset, 4)); } u16 fsblk_t::block_t::r16l(u32 offset) const { - return get_u16le(m_object->offset("r16l", offset, 2)); + return get_u16le(roffs("r16l", offset, 2)); } u32 fsblk_t::block_t::r24l(u32 offset) const { - return get_u24le(m_object->offset("r24l", offset, 3)); + return get_u24le(roffs("r24l", offset, 3)); } u32 fsblk_t::block_t::r32l(u32 offset) const { - return get_u32le(m_object->offset("r32l", offset, 4)); + return get_u32le(roffs("r32l", offset, 4)); } diff --git a/src/lib/formats/fsblk.h b/src/lib/formats/fsblk.h index 619ff832a953a..7f368a7307ce5 100644 --- a/src/lib/formats/fsblk.h +++ b/src/lib/formats/fsblk.h @@ -10,6 +10,7 @@ #include "fsmeta.h" +#include #include #include #include @@ -33,103 +34,6 @@ enum class error : int { already_exists, }; -template class refcounted_outer { -public: - refcounted_outer(bool weak) : m_object(nullptr), m_is_weak_ref(weak) {} - refcounted_outer(T *object, bool weak) : m_object(object), m_is_weak_ref(weak) { - ref(); - } - - refcounted_outer(const refcounted_outer &cref) { - m_object = cref.m_object; - m_is_weak_ref = cref.m_is_weak_ref; - ref(); - } - - refcounted_outer(refcounted_outer &&cref) { - m_object = cref.m_object; - m_is_weak_ref = cref.m_is_weak_ref; - cref.m_object = nullptr; - } - - ~refcounted_outer() { - unref(); - } - - refcounted_outer &operator =(T *dir) { - if(m_object != dir) { - unref(); - m_object = dir; - ref(); - } - return *this; - } - - refcounted_outer &operator =(const refcounted_outer &cref) { - if(m_object != cref.m_object) { - unref(); - m_object = cref.m_object; - ref(); - } - return *this; - } - - refcounted_outer &operator =(refcounted_outer &&cref) { - if(m_object != cref.m_object) { - unref(); - m_object = cref.m_object; - ref(); - } else if(m_is_weak_ref != cref.m_is_weak_ref) { - ref(); - cref.unref(); - m_object = cref.m_object; // In case the object got deleted (when going from strong ref to weak on the last strong) - } - cref.m_object = nullptr; - return *this; - } - - operator bool() const { return m_object != nullptr; } - -protected: - T *m_object; - bool m_is_weak_ref; - -private: - void ref() { - if(m_object) { - if(m_is_weak_ref) - m_object->ref_weak(); - else - m_object->ref(); - } - } - - void unref() { - if(m_object) { - bool del = m_is_weak_ref ? m_object->unref_weak() : m_object->unref(); - if(del) - m_object = nullptr; - } - } -}; - - -class refcounted_inner { -public: - refcounted_inner() : m_ref(0), m_weak_ref(0) {} - virtual ~refcounted_inner() = default; - - void ref(); - void ref_weak(); - bool unref(); - bool unref_weak(); - - virtual void drop_weak_references() = 0; - -public: - u32 m_ref, m_weak_ref; -}; - enum class dir_entry_type { dir, file, @@ -144,51 +48,32 @@ struct dir_entry { }; class fsblk_t { -protected: - class iblock_t : public refcounted_inner { - public: - iblock_t(u32 size) : refcounted_inner(), m_size(size) {} - virtual ~iblock_t() = default; - - u32 size() const { return m_size; } - - virtual const u8 *rodata() = 0; - virtual u8 *data() = 0; - u8 *offset(const char *function, u32 off, u32 size); - const u8 *rooffset(const char *function, u32 off, u32 size); - - protected: - u32 m_size; - }; - - public: - class block_t : public refcounted_outer { + class block_t { public: - block_t(bool weak = false) : refcounted_outer(weak) {} - block_t(iblock_t *block, bool weak = true) : refcounted_outer(block, weak) {} - virtual ~block_t() = default; - - block_t strong() { return block_t(m_object, false); } - block_t weak() { return block_t(m_object, true); } + using ptr = std::shared_ptr; - u32 size() const { return m_object->size(); } + block_t(u32 size) : m_size(size) {} + virtual ~block_t() = default; - const u8 *rodata() const { return m_object->rodata(); } - u8 *data() { return m_object->data(); } + u32 size() const { return m_size; } - void copy(u32 offset, const u8 *src, u32 size); - void fill( u8 data); - void fill(u32 offset, u8 data, u32 size); - void wstr(u32 offset, std::string_view str); - void w8( u32 offset, u8 data); - void w16b(u32 offset, u16 data); - void w24b(u32 offset, u32 data); - void w32b(u32 offset, u32 data); - void w16l(u32 offset, u16 data); - void w24l(u32 offset, u32 data); - void w32l(u32 offset, u32 data); + virtual const u8 *rodata() const = 0; + virtual u8 *data() = 0; + void write(u32 offset, const u8 *src, u32 size); + void fill( u8 data); + void fill( u32 offset, u8 data, u32 size); + void wstr( u32 offset, std::string_view str); + void w8( u32 offset, u8 data); + void w16b( u32 offset, u16 data); + void w24b( u32 offset, u32 data); + void w32b( u32 offset, u32 data); + void w16l( u32 offset, u16 data); + void w24l( u32 offset, u32 data); + void w32l( u32 offset, u32 data); + + void read(u32 offset, u8 *dst, u32 size) const; std::string_view rstr(u32 offset, u32 size) const; u8 r8( u32 offset) const; u16 r16b(u32 offset) const; @@ -197,6 +82,13 @@ class fsblk_t { u16 r16l(u32 offset) const; u32 r24l(u32 offset) const; u32 r32l(u32 offset) const; + + protected: + u32 m_size; + + private: + const u8 *roffs(const char *function, u32 off, u32 size) const; + u8 *woffs(const char *function, u32 off, u32 size); }; fsblk_t() : m_block_size(0) {} @@ -204,8 +96,8 @@ class fsblk_t { virtual void set_block_size(u32 block_size); virtual u32 block_count() const = 0; - virtual block_t get(u32 id) = 0; - virtual void fill(u8 data) = 0; + virtual block_t::ptr get(u32 id) = 0; + virtual void fill_all(u8 data) = 0; protected: u32 m_block_size; diff --git a/src/lib/formats/fsblk_vec.cpp b/src/lib/formats/fsblk_vec.cpp index e80cad8c51cc5..a04d60c263c4e 100644 --- a/src/lib/formats/fsblk_vec.cpp +++ b/src/lib/formats/fsblk_vec.cpp @@ -12,7 +12,7 @@ namespace fs { -const u8 *fsblk_vec_t::blk_t::rodata() +const u8 *fsblk_vec_t::blk_t::rodata() const { return m_data; } @@ -22,23 +22,19 @@ u8 *fsblk_vec_t::blk_t::data() return m_data; } -void fsblk_vec_t::blk_t::drop_weak_references() -{ -} - u32 fsblk_vec_t::block_count() const { return m_data.size() / m_block_size; } -fsblk_t::block_t fsblk_vec_t::get(u32 id) +fsblk_vec_t::block_t::ptr fsblk_vec_t::get(u32 id) { if(id >= block_count()) throw std::out_of_range(util::string_format("Block number overflow: requiring block %d on device of size %d (%d bytes, block size %d)", id, block_count(), m_data.size(), m_block_size)); - return block_t(new blk_t(m_data.data() + m_block_size*id, m_block_size)); + return std::make_shared(m_data.data() + m_block_size*id, m_block_size); } -void fsblk_vec_t::fill(u8 data) +void fsblk_vec_t::fill_all(u8 data) { std::fill(m_data.begin(), m_data.end(), data); } diff --git a/src/lib/formats/fsblk_vec.h b/src/lib/formats/fsblk_vec.h index 49f7ed3013e0d..b029bc55c5ec6 100644 --- a/src/lib/formats/fsblk_vec.h +++ b/src/lib/formats/fsblk_vec.h @@ -9,14 +9,13 @@ namespace fs { class fsblk_vec_t : public fsblk_t { private: - class blk_t : public iblock_t { + class blk_t : public block_t { public: - blk_t(u8 *data, u32 size) : iblock_t(size), m_data(data) {} + blk_t(u8 *data, u32 size) : block_t(size), m_data(data) {} virtual ~blk_t() = default; - virtual const u8 *rodata() override; + virtual const u8 *rodata() const override; virtual u8 *data() override; - virtual void drop_weak_references() override; private: u8 *m_data; @@ -27,8 +26,8 @@ class fsblk_vec_t : public fsblk_t { virtual ~fsblk_vec_t() = default; virtual u32 block_count() const override; - virtual block_t get(u32 id) override; - virtual void fill(u8 data) override; + virtual block_t::ptr get(u32 id) override; + virtual void fill_all(u8 data) override; private: std::vector &m_data; diff --git a/src/lib/util/chd.cpp b/src/lib/util/chd.cpp index 08dcd43f9f155..c05977a84eb83 100644 --- a/src/lib/util/chd.cpp +++ b/src/lib/util/chd.cpp @@ -3047,12 +3047,11 @@ std::error_condition chd_file_compressor::compress_continue(double &progress, do while (m_read_queue_offset < m_logicalbytes && osd_work_queue_items(m_read_queue) < 2) { // see if we have enough free work items to read the next half of a buffer - uint32_t startitem = m_read_queue_offset / hunk_bytes(); - uint32_t enditem = startitem + WORK_BUFFER_HUNKS / 2; - uint32_t curitem; - for (curitem = startitem; curitem < enditem; curitem++) - if (m_work_item[curitem % WORK_BUFFER_HUNKS].m_status != WS_READY) - break; + uint32_t const startitem = m_read_queue_offset / hunk_bytes(); + uint32_t const enditem = startitem + WORK_BUFFER_HUNKS / 2; + uint32_t curitem = startitem; + while ((curitem < enditem) && (m_work_item[curitem % WORK_BUFFER_HUNKS].m_status == WS_READY)) + ++curitem; // if it's not all clear, defer if (curitem != enditem) @@ -3076,20 +3075,24 @@ std::error_condition chd_file_compressor::compress_continue(double &progress, do work_item &item = m_work_item[m_write_hunk % WORK_BUFFER_HUNKS]; // free any OSD work item - if (item.m_osd != nullptr) + if (item.m_osd) + { osd_work_item_release(item.m_osd); - item.m_osd = nullptr; + item.m_osd = nullptr; + } if (m_walking_parent) { // for parent walking, just add to the hashmap - uint32_t uph = hunk_bytes() / unit_bytes(); + uint32_t const uph = hunk_bytes() / unit_bytes(); uint32_t units = uph; if (item.m_hunknum == hunk_count() - 1 || !compressed()) units = 1; for (uint32_t unit = 0; unit < units; unit++) + { if (m_parent_map.find(item.m_hash[unit].m_crc16, item.m_hash[unit].m_sha1) == hashmap::NOT_FOUND) m_parent_map.add(item.m_hunknum * uph + unit, item.m_hash[unit].m_crc16, item.m_hash[unit].m_sha1); + } } else if (!compressed()) { @@ -3105,34 +3108,27 @@ std::error_condition chd_file_compressor::compress_continue(double &progress, do if (!err && codec == CHD_CODEC_NONE) // TODO: report error? m_total_out += m_hunkbytes; } - else do + else if (uint64_t const selfhunk = m_current_map.find(item.m_hash[0].m_crc16, item.m_hash[0].m_sha1); selfhunk != hashmap::NOT_FOUND) { - // for compressing, process the result - - // first see if the hunk is in the parent or self maps - uint64_t selfhunk = m_current_map.find(item.m_hash[0].m_crc16, item.m_hash[0].m_sha1); - if (selfhunk != hashmap::NOT_FOUND) + // the hunk is in the self map + hunk_copy_from_self(item.m_hunknum, selfhunk); + } + else + { + // if not, see if it's in the parent map + uint64_t const parentunit = m_parent ? m_parent_map.find(item.m_hash[0].m_crc16, item.m_hash[0].m_sha1) : hashmap::NOT_FOUND; + if (parentunit != hashmap::NOT_FOUND) { - hunk_copy_from_self(item.m_hunknum, selfhunk); - break; + hunk_copy_from_parent(item.m_hunknum, parentunit); } - - // if not, see if it's in the parent map - if (m_parent) + else { - uint64_t parentunit = m_parent_map.find(item.m_hash[0].m_crc16, item.m_hash[0].m_sha1); - if (parentunit != hashmap::NOT_FOUND) - { - hunk_copy_from_parent(item.m_hunknum, parentunit); - break; - } + // otherwise, append it compressed and add to the self map + hunk_write_compressed(item.m_hunknum, item.m_compression, item.m_compressed, item.m_complen, item.m_hash[0].m_crc16); + m_total_out += item.m_complen; + m_current_map.add(item.m_hunknum, item.m_hash[0].m_crc16, item.m_hash[0].m_sha1); } - - // otherwise, append it compressed and add to the self map - hunk_write_compressed(item.m_hunknum, item.m_compression, item.m_compressed, item.m_complen, item.m_hash[0].m_crc16); - m_total_out += item.m_complen; - m_current_map.add(item.m_hunknum, item.m_hash[0].m_crc16, item.m_hash[0].m_sha1); - } while (false); + } // reset the item and advance item.m_status = WS_READY; @@ -3141,19 +3137,18 @@ std::error_condition chd_file_compressor::compress_continue(double &progress, do // if we hit the end, finalize if (m_write_hunk == m_hunkcount) { - // if this is just walking the parent, reset and get ready for compression if (m_walking_parent) { + // if this is just walking the parent, reset and get ready for compression m_walking_parent = false; m_read_queue_offset = m_read_done_offset = 0; m_write_hunk = 0; - for (auto & elem : m_work_item) + for (auto &elem : m_work_item) elem.m_status = WS_READY; } - - // wait for all reads to finish and if we're compressed, write the final SHA1 and map else { + // wait for all reads to finish and if we're compressed, write the final SHA1 and map osd_work_queue_wait(m_read_queue, 30 * osd_ticks_per_second()); if (!compressed()) return std::error_condition(); @@ -3306,29 +3301,34 @@ void chd_file_compressor::async_read() return; // determine parameters for the read - uint32_t work_buffer_bytes = WORK_BUFFER_HUNKS * hunk_bytes(); + uint32_t const work_buffer_bytes = WORK_BUFFER_HUNKS * hunk_bytes(); uint32_t numbytes = work_buffer_bytes / 2; - if (m_read_done_offset + numbytes > logical_bytes()) + if ((m_read_done_offset + numbytes) > logical_bytes()) numbytes = logical_bytes() - m_read_done_offset; + uint8_t *const dest = &m_work_buffer[0] + (m_read_done_offset % work_buffer_bytes); + assert((&m_work_buffer[0] == dest) || (&m_work_buffer[work_buffer_bytes / 2] == dest)); + assert(!(m_read_done_offset % hunk_bytes())); + uint64_t const end_offset = m_read_done_offset + numbytes; + // catch any exceptions coming out of here try { // do the read - uint8_t *dest = &m_work_buffer[0] + (m_read_done_offset % work_buffer_bytes); - assert(dest == &m_work_buffer[0] || dest == &m_work_buffer[work_buffer_bytes / 2]); - uint64_t end_offset = m_read_done_offset + numbytes; - if (m_walking_parent) { // if walking the parent, read in hunks from the parent CHD + uint64_t curoffs = m_read_done_offset; uint8_t *curdest = dest; - for (uint64_t curoffs = m_read_done_offset; curoffs < end_offset + 1; curoffs += hunk_bytes()) + uint32_t curhunk = m_read_done_offset / hunk_bytes(); + while (curoffs < end_offset + 1) { - std::error_condition err = m_parent->read_hunk(curoffs / hunk_bytes(), curdest); - if (err) + std::error_condition err = m_parent->read_hunk(curhunk, curdest); + if (err && (error::HUNK_OUT_OF_RANGE != err)) // FIXME: fix the code so it doesn't depend on trying to read past the end of the parent CHD throw err; + curoffs += hunk_bytes(); curdest += hunk_bytes(); + ++curhunk; } } else diff --git a/src/lib/util/mfpresolve.h b/src/lib/util/mfpresolve.h index 3c67cd543ff6c..eb3fba2b85da4 100644 --- a/src/lib/util/mfpresolve.h +++ b/src/lib/util/mfpresolve.h @@ -75,7 +75,9 @@ inline std::pair resolve_member_function(Ret (T: } else { - return std::make_pair(std::uintptr_t(static_cast(nullptr)), std::uintptr_t(nullptr)); + return std::make_pair( + std::uintptr_t(static_cast(nullptr)), + std::uintptr_t(static_cast(nullptr))); } } @@ -96,7 +98,9 @@ inline std::pair resolve_member_function(Ret (T: } else { - return std::make_pair(std::uintptr_t(static_cast(nullptr)), std::uintptr_t(nullptr)); + return std::make_pair( + std::uintptr_t(static_cast(nullptr)), + std::uintptr_t(static_cast(nullptr))); } } diff --git a/src/mame/acorn/bbc.cpp b/src/mame/acorn/bbc.cpp index 55e3dd153c288..75d53da3aec99 100644 --- a/src/mame/acorn/bbc.cpp +++ b/src/mame/acorn/bbc.cpp @@ -45,15 +45,18 @@ #include "emu.h" #include "bbc.h" + +#include "imagedev/cassette.h" +#include "machine/tms6100.h" + #include "softlist_dev.h" #include "speaker.h" #include "formats/acorn_dsk.h" +#include "formats/csw_cas.h" #include "formats/fsd_dsk.h" #include "formats/pc_dsk.h" -#include "imagedev/cassette.h" #include "formats/uef_cas.h" -#include "formats/csw_cas.h" #include "utf8.h" @@ -1201,11 +1204,16 @@ void bbc_state::bbcb(machine_config &config) m_ram->set_default_size("32K"); /* speech hardware */ - SPEECHROM(config, "vsm", 0); TMS5220(config, m_tms, 640000); - m_tms->set_speechrom_tag("vsm"); m_tms->add_route(ALL_OUTPUTS, "mono", 1.0); + TMS6100(config, "vsm", 0); + m_tms->m0_cb().set("vsm", FUNC(tms6100_device::m0_w)); + m_tms->m1_cb().set("vsm", FUNC(tms6100_device::m1_w)); + m_tms->addr_cb().set("vsm", FUNC(tms6100_device::add_w)); + m_tms->data_cb().set("vsm", FUNC(tms6100_device::data_line_r)); + m_tms->romclk_cb().set("vsm", FUNC(tms6100_device::clk_w)); + /* user via */ MOS6522(config, m_via6522_1, 16_MHz_XTAL / 16); m_via6522_1->writepa_handler().set("cent_data_out", FUNC(output_latch_device::write)); diff --git a/src/mame/acorn/electron.cpp b/src/mame/acorn/electron.cpp index d958b814411df..222d3c0ea5219 100644 --- a/src/mame/acorn/electron.cpp +++ b/src/mame/acorn/electron.cpp @@ -9,8 +9,8 @@ Basic specs are: 6502 CPU @ 2MHz or 1MHz 32k RAM and 32k ROM Text modes: 20x32, 40x25, 40x32, 80x25, 80x32 -Graphics modes: 160x256 (4 or 16 colors), 320x256 (2 or 4 colors), 640x256 (2 colors), 320x200 (2 colors), 640x200 (2 colors) -Colors: 8 colors (either solid or flashing) +Graphics modes: 160x256 (4 or 16 colours), 320x256 (2 or 4 colours), 640x256 (2 colours), 320x200 (2 colors), 640x200 (2 colors) +Colours: 8 colours (either solid or flashing) Sound: 1 channel, 7 octaves; built-in speaker Internal ports for cassette storage, RGB/CVBS monitors and TV output Various expansions can be added via the rear expansion port @@ -37,7 +37,7 @@ Notes: (all IC's shown. Only 16 ICs are used) ROM - Hitachi HN613256 32k x8-bit mask ROM containing OS & BASIC LM324 - Texas Instruments LM324 Operational Amplifier MOD - UHF TV modulator UM1233-E36 - CVBS - Composite color video output socket + CVBS - Composite colour video output socket RGB - RGB monitor video output socket CASS - Cassette port PWR - 3-pin power input from internal power supply @@ -79,18 +79,126 @@ Other internal boards to emulate: ******************************************************************************/ #include "emu.h" -#include "electron.h" +#include "electron_ula.h" +#include "bus/bbc/userport/userport.h" +#include "bus/electron/exp.h" +#include "bus/generic/slot.h" +#include "bus/generic/carts.h" #include "cpu/m6502/m6502.h" #include "formats/uef_cas.h" #include "formats/csw_cas.h" #include "imagedev/cassette.h" +#include "machine/6522via.h" +#include "machine/input_merger.h" +#include "machine/ram.h" #include "screen.h" #include "softlist_dev.h" #include "speaker.h" +namespace { + +class electron_state : public driver_device +{ +public: + electron_state(const machine_config &mconfig, device_type type, const char *tag) + : driver_device(mconfig, type, tag) + , m_maincpu(*this, "maincpu") + , m_irqs(*this, "irqs") + , m_screen(*this, "screen") + , m_cassette(*this, "cassette") + , m_ula(*this, "ula") + , m_region_mos(*this, "mos") + , m_keybd(*this, "LINE.%u", 0) + , m_exp(*this, "exp") + , m_ram(*this, RAM_TAG) + , m_mrb(*this, "MRB") + , m_capslock_led(*this, "capslock_led") + { } + + void electron(machine_config &config); + void btm2105(machine_config &config); + + void electron64(machine_config &config); + + static void plus3_default(device_t* device); + + DECLARE_INPUT_CHANGED_MEMBER( trigger_reset ); + +protected: + virtual void machine_start() override ATTR_COLD; + virtual void machine_reset() override ATTR_COLD; + + uint8_t fetch_r(offs_t offset); + uint8_t ram_r(offs_t offset); + void ram_w(offs_t offset, uint8_t data); + virtual uint8_t rom_r(offs_t offset); + virtual void rom_w(offs_t offset, uint8_t data); + virtual uint8_t io_r(offs_t offset); + virtual void io_w(offs_t offset, uint8_t data); + uint8_t keyboard_r(offs_t offset); + + void mem_map(address_map &map) ATTR_COLD; + void opcodes_map(address_map &map) ATTR_COLD; + + required_device m_maincpu; + required_device m_irqs; + required_device m_screen; + required_device m_cassette; + required_device m_ula; + required_memory_region m_region_mos; + required_ioport_array<14> m_keybd; + required_device m_exp; + required_device m_ram; + optional_ioport m_mrb; + output_finder<> m_capslock_led; + + bool m_mrb_mapped = false; + bool m_vdu_drivers = false; +}; + + +class electronsp_state : public electron_state +{ +public: + electronsp_state(const machine_config &mconfig, device_type type, const char *tag) + : electron_state(mconfig, type, tag) + , m_region_sp64(*this, "sp64") + , m_via(*this, "via6522") + , m_userport(*this, "userport") + , m_romi(*this, "romi%u", 1) + , m_rompages(*this, "ROMPAGES") + { } + + void electronsp(machine_config &config); + +protected: + virtual void machine_start() override ATTR_COLD; + + virtual uint8_t rom_r(offs_t offset) override; + virtual void rom_w(offs_t offset, uint8_t data) override; + virtual uint8_t io_r(offs_t offset) override; + virtual void io_w(offs_t offset, uint8_t data) override; + +private: + required_memory_region m_region_sp64; + required_device m_via; + required_device m_userport; + required_device_array m_romi; + required_ioport m_rompages; + + uint8_t m_rompage = 0; + uint8_t m_sp64_bank = 0; + std::unique_ptr m_sp64_ram; + + std::pair load_rom(device_image_interface &image, generic_slot_device *slot); + DECLARE_DEVICE_IMAGE_LOAD_MEMBER(rom1_load) { return load_rom(image, m_romi[0]); } + DECLARE_DEVICE_IMAGE_LOAD_MEMBER(rom2_load) { return load_rom(image, m_romi[1]); } +}; + + void electron_state::mem_map(address_map &map) { map(0x0000, 0x7fff).rw(FUNC(electron_state::ram_r), FUNC(electron_state::ram_w)); /* 32KB of RAM */ @@ -103,6 +211,290 @@ void electron_state::opcodes_map(address_map &map) map(0x0000, 0xffff).r(FUNC(electron_state::fetch_r)); } + +uint8_t electron_state::keyboard_r(offs_t offset) +{ + uint8_t data = 0; + + for (int i = 0; i < 14; i++) + { + if (!BIT(offset, i)) + data |= m_keybd[i]->read() & 0x0f; + } + + return data; +} + + +uint8_t electron_state::fetch_r(offs_t offset) +{ + m_vdu_drivers = (offset & 0xe000) == 0xc000 ? true : false; + + return m_maincpu->space(AS_PROGRAM).read_byte(offset); +} + + +uint8_t electron_state::ram_r(offs_t offset) +{ + uint8_t data = 0xff; + + data &= m_exp->expbus_r(offset); + + switch (m_mrb.read_safe(0)) + { + case 0x00: /* Normal */ + data &= m_ula->read(offset); + break; + + case 0x01: /* Turbo */ + if (m_mrb_mapped && offset < 0x3000) offset += 0x8000; + data &= m_ram->read(offset); + break; + + case 0x02: /* Shadow */ + if (m_mrb_mapped && (offset < 0x3000 || !m_vdu_drivers)) offset += 0x8000; + data &= m_ram->read(offset); + break; + } + + return data; +} + +void electron_state::ram_w(offs_t offset, uint8_t data) +{ + m_exp->expbus_w(offset, data); + + switch (m_mrb.read_safe(0)) + { + case 0x00: /* Normal */ + m_ula->write(offset, data); + break; + + case 0x01: /* Turbo */ + if (m_mrb_mapped && offset < 0x3000) offset += 0x8000; + m_ram->write(offset, data); + break; + + case 0x02: /* Shadow */ + if (m_mrb_mapped && (offset < 0x3000 || !m_vdu_drivers)) offset += 0x8000; + m_ram->write(offset, data); + break; + } +} + + +uint8_t electron_state::rom_r(offs_t offset) +{ + /* 0,1 Second external socket on the expansion module (SK2) */ + /* 2,3 First external socket on the expansion module (SK1) */ + /* 4 Disc */ + /* 5,6 USER applications */ + /* 7 Modem interface ROM */ + /* 8,9 Keyboard */ + /* 10,11 BASIC */ + /* 12 Expansion module operating system */ + /* 13 High priority slot in expansion module */ + /* 14 ECONET */ + /* 15 Reserved */ + + uint8_t data = 0xff; + + offset += 0x8000; + + data &= m_ula->read(offset); + data &= m_exp->expbus_r(offset); + + return data; +} + +void electron_state::rom_w(offs_t offset, uint8_t data) +{ + offset += 0x8000; + + m_ula->write(offset, data); + m_exp->expbus_w(offset, data); +} + +uint8_t electronsp_state::rom_r(offs_t offset) +{ + uint8_t data = electron_state::rom_r(offset); + + switch (offset & 0x4000) + { + case 0x0000: + if ((m_rompage & 0x0e) == m_rompages->read()) + { + data = m_romi[m_rompage & 0x01]->read_rom(offset); + } + else + { + switch (m_rompage) + { + case 10: + /* SP64 ROM utilises the spare BASIC ROM page */ + if (BIT(m_sp64_bank, 7) && (offset & 0x2000)) + { + data = m_sp64_ram[offset & 0x1fff]; + } + else + { + data = m_region_sp64->base()[(!BIT(m_sp64_bank, 0) << 14) | offset]; + } + break; + } + } + break; + } + + return data; +} + +void electronsp_state::rom_w(offs_t offset, uint8_t data) +{ + electron_state::rom_w(offset, data); + + switch (offset & 0x4000) + { + case 0x0000: + if ((m_rompage & 0x0e) == m_rompages->read()) + { + /* TODO: sockets are writeable if RAM */ + } + else + { + switch (m_rompage) + { + case 10: + /* SP64 ROM utilises the spare BASIC ROM page */ + if (BIT(m_sp64_bank, 7) && (offset & 0x2000)) + { + m_sp64_ram[offset & 0x1fff] = data; + } + break; + } + } + break; + } +} + + +uint8_t electron_state::io_r(offs_t offset) +{ + uint8_t data = 0xff; + + offset += 0xfc00; + + data &= m_ula->read(offset); + data &= m_exp->expbus_r(offset); + + return data; +} + +void electron_state::io_w(offs_t offset, uint8_t data) +{ + m_ula->write(0xfc00 + offset, data); + + offset += 0xfc00; + + /* Master RAM Board */ + if (offset == 0xfc7f) + { + m_mrb_mapped = !BIT(data, 7); + } + + m_exp->expbus_w(offset, data); +} + + +uint8_t electronsp_state::io_r(offs_t offset) +{ + uint8_t data = electron_state::io_r(offset); + + offset += 0xfc00; + + if ((offset & 0xfff0) == 0xfcb0) + { + data = m_via->read(offset & 0x0f); + } + + return data; +} + +void electronsp_state::io_w(offs_t offset, uint8_t data) +{ + electron_state::io_w(offset, data); + + offset += 0xfc00; + + if ((offset & 0xfff0) == 0xfcb0) + { + m_via->write(offset & 0x0f, data); + } + else if (offset == 0xfcfa) + { + m_sp64_bank = data; + } + else if ((offset == 0xfe05) && !(data & 0xf0)) + { + m_rompage = data & 0x0f; + } +} + + +/************************************** + Machine Initialisation functions +***************************************/ + +void electron_state::machine_start() +{ + m_capslock_led.resolve(); + + /* set ULA RAM/ROM pointers */ + m_ula->set_ram(m_ram->pointer()); + m_ula->set_rom(m_region_mos->base()); + + /* register save states */ + save_item(NAME(m_mrb_mapped)); + save_item(NAME(m_vdu_drivers)); +} + +void electron_state::machine_reset() +{ + m_mrb_mapped = true; + m_vdu_drivers = false; +} + +void electronsp_state::machine_start() +{ + electron_state::machine_start(); + + m_sp64_ram = std::make_unique(0x2000); + + /* register save states */ + save_item(NAME(m_sp64_bank)); + save_pointer(NAME(m_sp64_ram), 0x2000); +} + + +std::pair electronsp_state::load_rom(device_image_interface &image, generic_slot_device *slot) +{ + uint32_t size = slot->common_get_size("rom"); + + // socket accepts 8K and 16K ROM only + if (size != 0x2000 && size != 0x4000) + return std::make_pair(image_error::INVALIDLENGTH, "Invalid size: Only 8K/16K is supported"); + + slot->rom_alloc(0x4000, GENERIC_ROM8_WIDTH, ENDIANNESS_LITTLE); + slot->common_load_rom(slot->get_rom_base(), size, "rom"); + + // mirror 8K ROMs + uint8_t *crt = slot->get_rom_base(); + if (size <= 0x2000) memcpy(crt + 0x2000, crt, 0x2000); + + return std::make_pair(std::error_condition(), std::string()); +} + + INPUT_CHANGED_MEMBER(electron_state::trigger_reset) { m_maincpu->set_input_line(INPUT_LINE_RESET, newval ? ASSERT_LINE : CLEAR_LINE); @@ -371,6 +763,8 @@ ROM_END #define rom_btm2105 rom_electron +} // anonymous namespace + /* YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS */ COMP ( 1983, electron, 0, 0, electron, electron, electron_state, empty_init, "Acorn Computers", "Acorn Electron", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/acorn/electron.h b/src/mame/acorn/electron.h deleted file mode 100644 index 26fe78cb86107..0000000000000 --- a/src/mame/acorn/electron.h +++ /dev/null @@ -1,127 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Wilbert Pol, Nigel Barnes -/***************************************************************************** - * - * Acorn Electron - * - * Driver by Wilbert Pol - * - ****************************************************************************/ -#ifndef MAME_ACORN_ELECTRON_H -#define MAME_ACORN_ELECTRON_H - -#pragma once - -#include "electron_ula.h" - -#include "bus/bbc/userport/userport.h" -#include "bus/electron/exp.h" -#include "bus/generic/slot.h" -#include "bus/generic/carts.h" -#include "imagedev/cassette.h" -#include "machine/6522via.h" -#include "machine/input_merger.h" -#include "machine/ram.h" - -#include "screen.h" - - -class electron_state : public driver_device -{ -public: - electron_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag) - , m_maincpu(*this, "maincpu") - , m_irqs(*this, "irqs") - , m_screen(*this, "screen") - , m_cassette(*this, "cassette") - , m_ula(*this, "ula") - , m_region_mos(*this, "mos") - , m_keybd(*this, "LINE.%u", 0) - , m_exp(*this, "exp") - , m_ram(*this, RAM_TAG) - , m_mrb(*this, "MRB") - , m_capslock_led(*this, "capslock_led") - { } - - void electron(machine_config &config); - void btm2105(machine_config &config); - - void electron64(machine_config &config); - - static void plus3_default(device_t* device); - - DECLARE_INPUT_CHANGED_MEMBER( trigger_reset ); - -protected: - virtual void machine_start() override ATTR_COLD; - virtual void machine_reset() override ATTR_COLD; - - uint8_t fetch_r(offs_t offset); - uint8_t ram_r(offs_t offset); - void ram_w(offs_t offset, uint8_t data); - virtual uint8_t rom_r(offs_t offset); - virtual void rom_w(offs_t offset, uint8_t data); - virtual uint8_t io_r(offs_t offset); - virtual void io_w(offs_t offset, uint8_t data); - uint8_t keyboard_r(offs_t offset); - - void mem_map(address_map &map) ATTR_COLD; - void opcodes_map(address_map &map) ATTR_COLD; - - required_device m_maincpu; - required_device m_irqs; - required_device m_screen; - required_device m_cassette; - required_device m_ula; - required_memory_region m_region_mos; - required_ioport_array<14> m_keybd; - required_device m_exp; - required_device m_ram; - optional_ioport m_mrb; - output_finder<> m_capslock_led; - - bool m_mrb_mapped = false; - bool m_vdu_drivers = false; -}; - - -class electronsp_state : public electron_state -{ -public: - electronsp_state(const machine_config &mconfig, device_type type, const char *tag) - : electron_state(mconfig, type, tag) - , m_region_sp64(*this, "sp64") - , m_via(*this, "via6522") - , m_userport(*this, "userport") - , m_romi(*this, "romi%u", 1) - , m_rompages(*this, "ROMPAGES") - { } - - void electronsp(machine_config &config); - -protected: - virtual void machine_start() override ATTR_COLD; - - virtual uint8_t rom_r(offs_t offset) override; - virtual void rom_w(offs_t offset, uint8_t data) override; - virtual uint8_t io_r(offs_t offset) override; - virtual void io_w(offs_t offset, uint8_t data) override; - -private: - required_memory_region m_region_sp64; - required_device m_via; - required_device m_userport; - required_device_array m_romi; - required_ioport m_rompages; - - uint8_t m_rompage = 0; - uint8_t m_sp64_bank = 0; - std::unique_ptr m_sp64_ram; - - std::pair load_rom(device_image_interface &image, generic_slot_device *slot); - DECLARE_DEVICE_IMAGE_LOAD_MEMBER(rom1_load) { return load_rom(image, m_romi[0]); } - DECLARE_DEVICE_IMAGE_LOAD_MEMBER(rom2_load) { return load_rom(image, m_romi[1]); } -}; - -#endif // MAME_ACORN_ELECTRON_H diff --git a/src/mame/acorn/electron_m.cpp b/src/mame/acorn/electron_m.cpp deleted file mode 100644 index d98301a91e6ee..0000000000000 --- a/src/mame/acorn/electron_m.cpp +++ /dev/null @@ -1,293 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Wilbert Pol, Nigel Barnes -/****************************************************************************** - - Acorn Electron driver - -******************************************************************************/ - -#include "emu.h" -#include "electron.h" - - -uint8_t electron_state::keyboard_r(offs_t offset) -{ - uint8_t data = 0; - - for (int i = 0; i < 14; i++) - { - if (!BIT(offset, i)) - data |= m_keybd[i]->read() & 0x0f; - } - - return data; -} - - -uint8_t electron_state::fetch_r(offs_t offset) -{ - m_vdu_drivers = (offset & 0xe000) == 0xc000 ? true : false; - - return m_maincpu->space(AS_PROGRAM).read_byte(offset); -} - - -uint8_t electron_state::ram_r(offs_t offset) -{ - uint8_t data = 0xff; - - data &= m_exp->expbus_r(offset); - - switch (m_mrb.read_safe(0)) - { - case 0x00: /* Normal */ - data &= m_ula->read(offset); - break; - - case 0x01: /* Turbo */ - if (m_mrb_mapped && offset < 0x3000) offset += 0x8000; - data &= m_ram->read(offset); - break; - - case 0x02: /* Shadow */ - if (m_mrb_mapped && (offset < 0x3000 || !m_vdu_drivers)) offset += 0x8000; - data &= m_ram->read(offset); - break; - } - - return data; -} - -void electron_state::ram_w(offs_t offset, uint8_t data) -{ - m_exp->expbus_w(offset, data); - - switch (m_mrb.read_safe(0)) - { - case 0x00: /* Normal */ - m_ula->write(offset, data); - break; - - case 0x01: /* Turbo */ - if (m_mrb_mapped && offset < 0x3000) offset += 0x8000; - m_ram->write(offset, data); - break; - - case 0x02: /* Shadow */ - if (m_mrb_mapped && (offset < 0x3000 || !m_vdu_drivers)) offset += 0x8000; - m_ram->write(offset, data); - break; - } -} - - -uint8_t electron_state::rom_r(offs_t offset) -{ - /* 0,1 Second external socket on the expansion module (SK2) */ - /* 2,3 First external socket on the expansion module (SK1) */ - /* 4 Disc */ - /* 5,6 USER applications */ - /* 7 Modem interface ROM */ - /* 8,9 Keyboard */ - /* 10,11 BASIC */ - /* 12 Expansion module operating system */ - /* 13 High priority slot in expansion module */ - /* 14 ECONET */ - /* 15 Reserved */ - - uint8_t data = 0xff; - - offset += 0x8000; - - data &= m_ula->read(offset); - data &= m_exp->expbus_r(offset); - - return data; -} - -void electron_state::rom_w(offs_t offset, uint8_t data) -{ - offset += 0x8000; - - m_ula->write(offset, data); - m_exp->expbus_w(offset, data); -} - -uint8_t electronsp_state::rom_r(offs_t offset) -{ - uint8_t data = electron_state::rom_r(offset); - - switch (offset & 0x4000) - { - case 0x0000: - if ((m_rompage & 0x0e) == m_rompages->read()) - { - data = m_romi[m_rompage & 0x01]->read_rom(offset); - } - else - { - switch (m_rompage) - { - case 10: - /* SP64 ROM utilises the spare BASIC ROM page */ - if (BIT(m_sp64_bank, 7) && (offset & 0x2000)) - { - data = m_sp64_ram[offset & 0x1fff]; - } - else - { - data = m_region_sp64->base()[(!BIT(m_sp64_bank, 0) << 14) | offset]; - } - break; - } - } - break; - } - - return data; -} - -void electronsp_state::rom_w(offs_t offset, uint8_t data) -{ - electron_state::rom_w(offset, data); - - switch (offset & 0x4000) - { - case 0x0000: - if ((m_rompage & 0x0e) == m_rompages->read()) - { - /* TODO: sockets are writeable if RAM */ - } - else - { - switch (m_rompage) - { - case 10: - /* SP64 ROM utilises the spare BASIC ROM page */ - if (BIT(m_sp64_bank, 7) && (offset & 0x2000)) - { - m_sp64_ram[offset & 0x1fff] = data; - } - break; - } - } - break; - } -} - - -uint8_t electron_state::io_r(offs_t offset) -{ - uint8_t data = 0xff; - - offset += 0xfc00; - - data &= m_ula->read(offset); - data &= m_exp->expbus_r(offset); - - return data; -} - -void electron_state::io_w(offs_t offset, uint8_t data) -{ - m_ula->write(0xfc00 + offset, data); - - offset += 0xfc00; - - /* Master RAM Board */ - if (offset == 0xfc7f) - { - m_mrb_mapped = !BIT(data, 7); - } - - m_exp->expbus_w(offset, data); -} - - -uint8_t electronsp_state::io_r(offs_t offset) -{ - uint8_t data = electron_state::io_r(offset); - - offset += 0xfc00; - - if ((offset & 0xfff0) == 0xfcb0) - { - data = m_via->read(offset & 0x0f); - } - - return data; -} - -void electronsp_state::io_w(offs_t offset, uint8_t data) -{ - electron_state::io_w(offset, data); - - offset += 0xfc00; - - if ((offset & 0xfff0) == 0xfcb0) - { - m_via->write(offset & 0x0f, data); - } - else if (offset == 0xfcfa) - { - m_sp64_bank = data; - } - else if ((offset == 0xfe05) && !(data & 0xf0)) - { - m_rompage = data & 0x0f; - } -} - - -/************************************** - Machine Initialisation functions -***************************************/ - -void electron_state::machine_start() -{ - m_capslock_led.resolve(); - - /* set ULA RAM/ROM pointers */ - m_ula->set_ram(m_ram->pointer()); - m_ula->set_rom(m_region_mos->base()); - - /* register save states */ - save_item(NAME(m_mrb_mapped)); - save_item(NAME(m_vdu_drivers)); -} - -void electron_state::machine_reset() -{ - m_mrb_mapped = true; - m_vdu_drivers = false; -} - -void electronsp_state::machine_start() -{ - electron_state::machine_start(); - - m_sp64_ram = std::make_unique(0x2000); - - /* register save states */ - save_item(NAME(m_sp64_bank)); - save_pointer(NAME(m_sp64_ram), 0x2000); -} - - -std::pair electronsp_state::load_rom(device_image_interface &image, generic_slot_device *slot) -{ - uint32_t size = slot->common_get_size("rom"); - - // socket accepts 8K and 16K ROM only - if (size != 0x2000 && size != 0x4000) - return std::make_pair(image_error::INVALIDLENGTH, "Invalid size: Only 8K/16K is supported"); - - slot->rom_alloc(0x4000, GENERIC_ROM8_WIDTH, ENDIANNESS_LITTLE); - slot->common_load_rom(slot->get_rom_base(), size, "rom"); - - // mirror 8K ROMs - uint8_t *crt = slot->get_rom_base(); - if (size <= 0x2000) memcpy(crt + 0x2000, crt, 0x2000); - - return std::make_pair(std::error_condition(), std::string()); -} diff --git a/src/mame/alesis/midiverb.cpp b/src/mame/alesis/midiverb.cpp index 9efb96887d1cf..00bf021c65177 100644 --- a/src/mame/alesis/midiverb.cpp +++ b/src/mame/alesis/midiverb.cpp @@ -141,10 +141,11 @@ void midiverb_dsp_device::device_start() save_item(NAME(m_ram)); } -#define LOG_DSP(...) do { \ - if (sample_i < DEBUG_SAMPLES) \ - LOGMASKED(LOG_DSP_EXECUTION, __VA_ARGS__); \ -} while(0) +#define LOG_DSP(...) \ + do { \ + if (sample_i < DEBUG_SAMPLES) \ + LOGMASKED(LOG_DSP_EXECUTION, __VA_ARGS__); \ + } while(0) void midiverb_dsp_device::sound_stream_update(sound_stream &stream, const std::vector &inputs, std::vector &outputs) { diff --git a/src/mame/amiga/amiga.cpp b/src/mame/amiga/amiga.cpp index b6e757b916870..ac82186d1bfbd 100644 --- a/src/mame/amiga/amiga.cpp +++ b/src/mame/amiga/amiga.cpp @@ -354,13 +354,6 @@ class cdtv_state : public amiga_state u16 clock_r(offs_t offset); void clock_w(offs_t offset, u16 data); - uint8_t dmac_scsi_data_read(offs_t offset); - void dmac_scsi_data_write(offs_t offset, uint8_t data); - void dmac_int_w(int state); - - void tpi_port_b_write(uint8_t data); - void tpi_int_w(int state); - void cdtv(machine_config &config); void cdtvn(machine_config &config); void cdtv_mem(address_map &map) ATTR_COLD; @@ -369,21 +362,30 @@ class cdtv_state : public amiga_state protected: // driver_device overrides virtual void machine_start() override ATTR_COLD; + virtual void machine_reset() override ATTR_COLD; // amiga_state overrides virtual bool int2_pending() override; virtual bool int6_pending() override; private: - // devices + void dmac_int_w(int state); + + void tpi_portb_w(uint8_t data); + void tpi_int_w(int state); + + void sten_w(int state); + void drq_w(int state); + required_device m_rtc; - required_device m_dmac; + required_device m_dmac; required_device m_tpi; required_device m_cdrom; // internal state int m_dmac_irq; int m_tpi_irq; + bool m_sten; }; class a3000_state : public amiga_state @@ -643,43 +645,6 @@ void a500p_state::clock_w(offs_t offset, u16 data) } -//************************************************************************** -// CD-ROM CONTROLLER -//************************************************************************** - -uint8_t cdtv_state::dmac_scsi_data_read(offs_t offset) -{ - if (offset >= 0xb0 && offset <= 0xbf) - return m_tpi->read(offset); - - return 0xff; -} - -void cdtv_state::dmac_scsi_data_write(offs_t offset, uint8_t data) -{ - if (offset >= 0xb0 && offset <= 0xbf) - m_tpi->write(offset, data); -} - -void cdtv_state::dmac_int_w(int state) -{ - m_dmac_irq = state; - update_int2(); -} - -void cdtv_state::tpi_port_b_write(uint8_t data) -{ - m_cdrom->cmd_w(BIT(data, 0)); - m_cdrom->enable_w(BIT(data, 1)); -} - -void cdtv_state::tpi_int_w(int state) -{ - m_tpi_irq = state; - update_int2(); -} - - //************************************************************************** // DRIVER INIT //************************************************************************** @@ -949,6 +914,15 @@ void cdtv_state::machine_start() m_dmac->ramsz_w(0); } +void cdtv_state::machine_reset() +{ + amiga_state::machine_reset(); + + // start autoconfig + m_dmac->configin_w(0); + m_dmac->configin_w(1); +} + bool cdtv_state::int2_pending() { return m_cia_0_irq || m_dmac_irq || m_tpi_irq; @@ -959,6 +933,35 @@ bool cdtv_state::int6_pending() return m_cia_1_irq; } +void cdtv_state::dmac_int_w(int state) +{ + m_dmac_irq = state; + update_int2(); +} + +void cdtv_state::tpi_portb_w(uint8_t data) +{ + m_cdrom->enable_w(BIT(data, 1)); + m_cdrom->cmd_w(BIT(data, 0)); +} + +void cdtv_state::tpi_int_w(int state) +{ + m_tpi_irq = state; + update_int2(); +} + +void cdtv_state::sten_w(int state) +{ + m_sten = bool(state); +} + +void cdtv_state::drq_w(int state) +{ + if (m_sten) + m_dmac->xdreq_w(state); +} + u32 a3000_state::scsi_r(offs_t offset, u32 mem_mask) { u32 data = 0xffffffff; @@ -1961,31 +1964,30 @@ void cdtv_state::cdtv(machine_config &config) // 256kb memory card NVRAM(config, "memcard", nvram_device::DEFAULT_ALL_0); - // real-time clock MSM6242(config, m_rtc, XTAL(32'768)); - // cd-rom controller - AMIGA_DMAC_REV1(config, m_dmac, amiga_state::CLK_7M_PAL); - m_dmac->css_read_cb().set(FUNC(cdtv_state::dmac_scsi_data_read)); - m_dmac->css_write_cb().set(FUNC(cdtv_state::dmac_scsi_data_write)); + AMIGA_DMAC_REV2(config, m_dmac, amiga_state::CLK_7M_PAL); + m_dmac->int_cb().set(FUNC(cdtv_state::dmac_int_w)); m_dmac->csx0_read_cb().set(m_cdrom, FUNC(cr511b_device::read)); m_dmac->csx0_write_cb().set(m_cdrom, FUNC(cr511b_device::write)); - m_dmac->int_cb().set(FUNC(cdtv_state::dmac_int_w)); + m_dmac->csx0_a4_read_cb().set(m_tpi, FUNC(tpi6525_device::read)); + m_dmac->csx0_a4_write_cb().set(m_tpi, FUNC(tpi6525_device::write)); + m_dmac->xdack_read_cb().set(m_cdrom, FUNC(cr511b_device::read)); TPI6525(config, m_tpi, 0); m_tpi->out_irq_cb().set(FUNC(cdtv_state::tpi_int_w)); - m_tpi->out_pb_cb().set(FUNC(cdtv_state::tpi_port_b_write)); + m_tpi->out_pb_cb().set(FUNC(cdtv_state::tpi_portb_w)); - // cd-rom CR511B(config, m_cdrom, 0); - m_cdrom->scor_handler().set(m_tpi, FUNC(tpi6525_device::i1_w)).invert(); - m_cdrom->stch_handler().set(m_tpi, FUNC(tpi6525_device::i2_w)).invert(); - m_cdrom->sten_handler().set(m_tpi, FUNC(tpi6525_device::i3_w)); - m_cdrom->xaen_handler().set(m_tpi, FUNC(tpi6525_device::pb2_w)); - m_cdrom->drq_handler().set(m_dmac, FUNC(amiga_dmac_device::xdreq_w)); - m_cdrom->dten_handler().set(m_dmac, FUNC(amiga_dmac_device::xdreq_w)); + m_cdrom->add_route(0, "lspeaker", 1.0); + m_cdrom->add_route(1, "rspeaker", 1.0); + m_cdrom->scor_cb().set(m_tpi, FUNC(tpi6525_device::i1_w)).invert(); + m_cdrom->stch_cb().set(m_tpi, FUNC(tpi6525_device::i2_w)).invert(); + m_cdrom->sten_cb().set(m_tpi, FUNC(tpi6525_device::i3_w)); + m_cdrom->sten_cb().append(FUNC(cdtv_state::sten_w)); + m_cdrom->drq_cb().set(m_tpi, FUNC(tpi6525_device::i4_w)); + m_cdrom->drq_cb().append(FUNC(cdtv_state::drq_w)); - // software SOFTWARE_LIST(config, "cd_list").set_original("cdtv"); } diff --git a/src/mame/apple/apple2gs.cpp b/src/mame/apple/apple2gs.cpp index e9f4b85c73bf1..5ebfceda441cb 100644 --- a/src/mame/apple/apple2gs.cpp +++ b/src/mame/apple/apple2gs.cpp @@ -473,6 +473,7 @@ class apple2gs_state : public driver_device u8 m_clkdata = 0, m_clock_control = 0; u8 m_clock_frame = 0; + void lcrom_update(); void do_io(int offset); u8 read_floatingbus(); void update_slotrom_banks(); @@ -1266,20 +1267,7 @@ void apple2gs_state::lc_update(int offset, bool writing) if (m_lcram != old_lcram) { - if (m_lcram) - { - m_lcbank.select(1); - m_lcaux.select(1); - m_lc00.select(1 + (m_romswitch ? 2 : 0)); - m_lc01.select(1); - } - else - { - m_lcbank.select(0); - m_lcaux.select(0); - m_lc00.select(0 + (m_romswitch ? 2 : 0)); - m_lc01.select(0); - } + lcrom_update(); } #if 0 @@ -1291,6 +1279,24 @@ void apple2gs_state::lc_update(int offset, bool writing) #endif } +void apple2gs_state::lcrom_update() +{ + if (m_lcram) + { + m_lcbank.select(1); + m_lcaux.select(1); + m_lc00.select(1 + (m_romswitch ? 2 : 0)); + m_lc01.select(1); + } + else + { + m_lcbank.select(0); + m_lcaux.select(0); + m_lc00.select(0 + (m_romswitch ? 2 : 0)); + m_lc01.select(0); + } +} + // most softswitches don't care about read vs write, so handle them here void apple2gs_state::do_io(int offset) { @@ -3412,6 +3418,7 @@ void apple2gs_state::adbmicro_p2_out(u8 data) m_video->page2_w(false); m_video->res_w(0); + lcrom_update(); auxbank_update(); update_slotrom_banks(); } diff --git a/src/mame/apple/macpwrbkmsc.cpp b/src/mame/apple/macpwrbkmsc.cpp index dfc23ab452e73..6c0a4d104e93c 100644 --- a/src/mame/apple/macpwrbkmsc.cpp +++ b/src/mame/apple/macpwrbkmsc.cpp @@ -587,7 +587,7 @@ void macpbmsc_state::macpd2xx_base_map(address_map &map) map(0x50f04000, 0x50f05fff).rw(FUNC(macpbmsc_state::scc_r), FUNC(macpbmsc_state::scc_w)); map(0x50f06000, 0x50f07fff).rw(FUNC(macpbmsc_state::scsi_drq_r), FUNC(macpbmsc_state::scsi_drq_w)); map(0x50f10000, 0x50f11fff).rw(FUNC(macpbmsc_state::scsi_r), FUNC(macpbmsc_state::scsi_w)); - map(0x50f12060, 0x50f12063).r(FUNC(macpbmsc_state::scsi_drq_r)); + map(0x50f12000, 0x50f13fff).rw(FUNC(macpbmsc_state::scsi_drq_r), FUNC(macpbmsc_state::scsi_drq_w)); } void macpbmsc_state::macpd210_map(address_map &map) diff --git a/src/mame/arcade.flt b/src/mame/arcade.flt index 26db7833bd473..ab2a87af78f43 100644 --- a/src/mame/arcade.flt +++ b/src/mame/arcade.flt @@ -384,6 +384,24 @@ bmc/popobear.cpp -magkengou -qiwang +bordun/att.cpp + +bordun/skylncr.cpp +-blshark +-miaction +-olymp +-score5 +-seadevil +-sonikfig +-spcliner +-speedway +-speedwaya +-sstar97a +-sstar97jb +-superb2k +-tigerslt +-rolla + capcom/1942.cpp capcom/1943.cpp @@ -657,6 +675,7 @@ dynax/ddenlovr.cpp -momotaro dynax/dynax.cpp // 99% mahjong +-mjelct3bl -ougonhaib3 -tenkai2b @@ -676,6 +695,7 @@ dynax/royalmah.cpp // mahjong -janohb edevices/diverboy.cpp +-tumblebed edevices/fantland.cpp @@ -1053,6 +1073,7 @@ igs/goldstar.cpp // fruit -magoddsd -mbs2euro -megaline +-mtonic2 -nd8lines -nfm -nfma @@ -1077,21 +1098,23 @@ igs/goldstar.cpp // fruit -wcat3a -wcherry -igs/igs009.cpp +//igs/igs009.cpp igs/igs011.cpp -igs/igs017.cpp --jking302us --slqz2a --tarzan --tarzana +//igs/igs017.cpp +//-jking302us +//-slqz2a +//-tarzan +//-tarzana igs/igspoker.cpp // poker -cpoker210ks -kungfua -stellecu +//igs/igs_68k_023vid.cpp // no inputs + igs/igs_fear.cpp -icescape @@ -1099,6 +1122,7 @@ igs/igs_m027.cpp -amazoni2 -amazonia -amazonkp +-cjddz213cn -extradrw -gonefsh2 -klxyj @@ -1110,6 +1134,9 @@ igs/igs_m027.cpp igs/igs_m027_023vid.cpp +igs/igs_m027_033vid.cpp +-huahuas5 + //igs/igs_m027_link.cpp // white screen or no screen igs/igs_m027xa.cpp @@ -1130,6 +1157,7 @@ igs/lordgun.cpp igs/pgm.cpp -dmnfrntpcb -martmasttw +-kovgsyx -kovlsjb -kovlsjba -kovlsqh @@ -1142,13 +1170,17 @@ igs/pgm2.cpp //igs/pgm3.cpp // chd, mnw -igs/spoker.cpp // poker, some mnw --jinhulu2 --spk102ua --spk200ua --spk201ua --spk203us --spk205us +//igs/spoker.cpp // poker, some mnw +//-cjdh6 +//-jinhulu2 +//-jinhulu2100gi +//-jinhulu2120gi +//-jinhulu2101is +//-spk102ua +//-spk200ua +//-spk201ua +//-spk203us +//-spk205us //igt/drw80pkr.cpp // poker, need setup @@ -1429,6 +1461,7 @@ konami/konamigv.cpp // chd untested -btchamp konami/konamigx.cpp +-sexyparoebl konami/konamim2.cpp // chd -totlvica @@ -2425,20 +2458,6 @@ misc/skimaxx.cpp misc/skyarmy.cpp -misc/skylncr.cpp --blshark --miaction --olymp --score5 --seadevil --sonikfig --spcliner --speedway --speedwaya --superb2k --tigerslt --rolla - misc/sliver.cpp // adult //misc/smd2144c.cpp // black screen @@ -3819,6 +3838,7 @@ seta/seta2.cpp -staraudi seta/simple_st0016.cpp +-crownpkr seta/speedatk.cpp -hanaren2 @@ -3880,7 +3900,7 @@ sigma/spiders.cpp //skeleton/extrema_m27sv.cpp // black screen -//skeleton/falconun.cpp // black screen +//skeleton/falconun.cpp // black screen //skeleton/flashvga2.cpp // black screen @@ -3888,6 +3908,8 @@ sigma/spiders.cpp //skeleton/happyvideo.cpp // no screen +//skeleton/huangyeh_m68k.cpp // black screen + //skeleton/kkcount.cpp // no screen //skeleton/lgtz80.cpp // black screen @@ -3904,15 +3926,19 @@ sigma/spiders.cpp //skeleton/seoul88.cpp // bad gfx&inputs +//skeleton/sgm.cpp // black screen + //skeleton/sterz80.cpp // black screen //skeleton/syvg.cpp // black screen //skeleton/ticz80.cpp // black screen +//skeleton/turnierdart.cpp // no screen + //skeleton/tvcobrasd.cpp // no screen -//skeleton/venteta.cpp // black screen +//skeleton/venteta.cpp // black screen //skeleton/vgame.cpp // black screen @@ -4207,12 +4233,16 @@ taito/wgp.cpp // bad text colours taito/wyvernf0.cpp +tatsumi/apache3.cpp + +tatsumi/cyclwarr.cpp + tatsumi/kingdrby.cpp // gambling -cowrace tatsumi/lockon.cpp -tatsumi/tatsumi.cpp +tatsumi/roundup5.cpp tatsumi/tx1.cpp @@ -4374,9 +4404,6 @@ universal/cosmic.cpp universal/cosmicg.cpp universal/docastle.cpp --asoccer --idsoccera --idsoccert universal/getaway.cpp diff --git a/src/mame/aristocrat/aristmk6.cpp b/src/mame/aristocrat/aristmk6.cpp index c3333ef88a077..70434e44e9a57 100644 --- a/src/mame/aristocrat/aristmk6.cpp +++ b/src/mame/aristocrat/aristmk6.cpp @@ -16,7 +16,7 @@ - Identify irq sources; - Irq acknowledge doesn't work as intended; - Emulate PLX 9054 controller & PCI root; -- PMX1 likely runs under PCI bus too; +- PMX1 likely runs under PCI bus too, as per src/devices/bus/pci/neon250.cpp (x86 AGP card); - Eventually gets to "flyback" errors, pings $12000130-$3f for strobe and/or irq enable. Flyback is an alias for vblank, cfr. Acorn Archimedes. @@ -588,10 +588,10 @@ typically at around 0x3100-0x3200, 0x3600-0x3700 for Left/Right BIOS dumps (2 fi ROM_LOAD32_WORD_BIOS( 1, "21012901_right.u83", 0x0000000, 0x0200000, CRC(757618f2) SHA1(43f9a3e7d544979f8c6974945914d9e099b02abd) ) /* From lucky88 & redbara6 */ \ ROM_LOAD32_WORD_BIOS( 1, "21012901_left.u70", 0x0000002, 0x0200000, CRC(0d271470) SHA1(5cd4b604bfe2fd7e9a8d08e1c7c97f17ae068479) ) \ ROM_SYSTEM_BIOS( 2, "au-nsw3", "Aristocrat MK6 Base (19012801, NSW/ACT)" ) \ - ROM_LOAD32_WORD_BIOS( 2, "19012801_right.u83", 0x0000000, 0x0200000, CRC(5b20a96c) SHA1(5fd916b7cc2cdd51bf7dd212c1114f94dc9c7926) ) /* From cactusco & cmtonig & heartveg & moonwalt */ \ + ROM_LOAD32_WORD_BIOS( 2, "19012801_right.u83", 0x0000000, 0x0200000, CRC(5b20a96c) SHA1(5fd916b7cc2cdd51bf7dd212c1114f94dc9c7926) ) /* From cactusco, cmtonig, heartveg & moonwalt */ \ ROM_LOAD32_WORD_BIOS( 2, "19012801_left.u70", 0x0000002, 0x0200000, CRC(b03bd17c) SHA1(f281e80f6dda5b727ed71d2deebe3b0ff548773f) ) \ ROM_SYSTEM_BIOS( 3, "au-nsw4", "Aristocrat MK6 Base (13012001, NSW/ACT)" ) \ - ROM_LOAD32_WORD_BIOS( 3, "13012001_right.u83", 0x0000000, 0x0200000, CRC(e627dbfa) SHA1(4fedbe0975ceb7dc0ebebf18a7708d78984db9b7) ) /* From grizzly & qnilea6 */ \ + ROM_LOAD32_WORD_BIOS( 3, "13012001_right.u83", 0x0000000, 0x0200000, CRC(e627dbfa) SHA1(4fedbe0975ceb7dc0ebebf18a7708d78984db9b7) ) /* From grizzly, mrwoo & qnilea6 */ \ ROM_LOAD32_WORD_BIOS( 3, "13012001_left.u70", 0x0000002, 0x0200000, CRC(38e8f659) SHA1(88c6acba99b0aca023c6f4d27c061c231490e9e0) ) \ ROM_SYSTEM_BIOS( 4, "au-nsw5", "Aristocrat MK6 Base (11011901, NSW/ACT)" ) \ ROM_LOAD32_WORD_BIOS( 4, "11011901_right.u83", 0x0000000, 0x0200000, CRC(73dcb11c) SHA1(69ae4f32a0c9141b2a82ff3935b0cd20333d2964) ) \ @@ -674,7 +674,7 @@ typically at around 0x3100-0x3200, 0x3600-0x3700 for Left/Right BIOS dumps (2 fi ROM_LOAD32_WORD_BIOS( 27, "01.04.11_right.u83", 0x0000000, 0x0200000, CRC(2dae8ca0) SHA1(7a0fb38b4c1ac7195d15bdab6f0cfb16c78430f0) ) /* From centrion */ \ ROM_LOAD32_WORD_BIOS( 27, "01.04.11_left.u70", 0x0000002, 0x0200000, CRC(787f2b07) SHA1(2548289e44f4b935346b759afb5383bdbac04c3e) ) \ ROM_SYSTEM_BIOS( 28, "us2", "Aristocrat MK6 Base (01.04.10, US)" ) \ - ROM_LOAD32_WORD_BIOS( 28, "01.04.10_right.u83", 0x0000000, 0x0200000, CRC(82ce2fcc) SHA1(4c8fb3db084a67e99d1420b3f895a06ce9ef5ec2) ) \ + ROM_LOAD32_WORD_BIOS( 28, "01.04.10_right.u83", 0x0000000, 0x0200000, CRC(82ce2fcc) SHA1(4c8fb3db084a67e99d1420b3f895a06ce9ef5ec2) ) /* From hrtantny */ \ ROM_LOAD32_WORD_BIOS( 28, "01.04.10_left.u70", 0x0000002, 0x0200000, CRC(9d9d52c1) SHA1(b957220cdbedd516c219d1bfc28807ce466df93f) ) \ ROM_SYSTEM_BIOS( 29, "us3", "Aristocrat MK6 Base (01.04.08, US)" ) \ ROM_LOAD32_WORD_BIOS( 29, "01.04.08_right.u83", 0x0000000, 0x0200000, CRC(95333304) SHA1(7afe49d6c5e4d6820f349778557daa88c5366a51) ) /* From bobdolly, also u10 on EPROM expansion board */ \ @@ -2998,6 +2998,30 @@ ROM_START( grizzly ) ROM_END +// 0252526 / MV4237 +// Heart Of Antony / Local / C - 05/23/05 +// Variations (% and NO): +// 87.920% 99 +// 90.128% 01 +// 91.921% 02 +// 94.916% 03 +// 97.058% 04 +ROM_START( hrtantny ) + ARISTMK6_BIOS + ROM_REGION64_LE( 0x4000000, "game_rom", ROMREGION_ERASEFF) + /* + 0252526-U86 Series:01 M27V322 Mk6USA Heart of Antony A79H1P14 1F62-BCA6 / 1EDB1DAE / 989A156E Copyright © 2004-2005 Aristocrat Technologies, Inc. + 0252526-U73 Series:01 M27V322 Mk6USA Heart of Antony B26H6UAC D1B6-27A4 / 1EBB0279 / 8A72A1A7 Copyright © 2004-2005 Aristocrat Technologies, Inc. + 0252526-U85 Series:01 M27V322 Mk6USA Heart of Antony 0PF54346 7A98-D033 / 067E3EC3 / 2F2F160F Copyright © 2004-2005 Aristocrat Technologies, Inc. + 0252526-U72 Series:01 M27V322 Mk6USA Heart of Antony D5AC1C2H 36D3-50DD / 064B641C / 210FC3DA Copyright © 2004-2005 Aristocrat Technologies, Inc. + */ + ROM_LOAD32_WORD("0252526.u86", 0x0000000, 0x0400000, CRC(88cfa3fc) SHA1(852a9db95246f9e39c29c231894d27c4f8bbc9ab) ) + ROM_LOAD32_WORD("0252526.u73", 0x0000002, 0x0400000, CRC(24e233af) SHA1(63e9886478e9d5790e7babe868a31071f81ef17f) ) + ROM_LOAD32_WORD("0252526.u85", 0x0800000, 0x0400000, CRC(3deb3b1c) SHA1(f5b80193bda500edb1049b1decacfaa43a391862) ) + ROM_LOAD32_WORD("0252526.u72", 0x0800002, 0x0400000, CRC(78c92f0e) SHA1(93690fcb6983876022a180ea633b7bea4519da1d) ) +ROM_END + + // 20169511 / 717/2 // Heart of Gold / Local / A - 15/09/03 // Variations (% and NO): @@ -3892,11 +3916,37 @@ ROM_START( mchilliq ) ROM_END +// 30215311 / 810 +// MR WOO / Local / K - 12/07/06 +// Variations (% and NO): +// 87.83% 99 +// 85.08% 01 +// 89.38% 02 +ROM_START( mrwoo ) + ARISTMK6_BIOS + ROM_REGION64_LE( 0x4000000, "game_rom", ROMREGION_ERASEFF) + /* + 30215311 NSW MR WOO 810 4MB 6 eproms Aristocrat © 2006 P U86 + 30215311 NSW MR WOO 810 4MB 6 eproms Aristocrat © 2006 P U73 + 30215311 NSW MR WOO 810 4MB 6 eproms Aristocrat © 2006 P U85 + 30215311 NSW MR WOO 810 4MB 6 eproms Aristocrat © 2006 P U72 + 30215311 NSW MR WOO 810 4MB 6 eproms Aristocrat © 2006 P U84 + 30215311 NSW MR WOO 810 4MB 6 eproms Aristocrat © 2006 P U71 + */ + ROM_LOAD32_WORD("30215311.u86", 0x0000000, 0x0400000, CRC(674a187d) SHA1(d4c38fff6c3ba43284b51ec13f98c2b1badc7b98) ) + ROM_LOAD32_WORD("30215311.u73", 0x0000002, 0x0400000, CRC(be90b4d1) SHA1(b49002389abbcc5db625d8eaffd2b4616cd4cdc2) ) + ROM_LOAD32_WORD("30215311.u85", 0x0800000, 0x0400000, CRC(7e9ed3eb) SHA1(b74aff123187c61c59195770b4cd70d9d691d666) ) + ROM_LOAD32_WORD("30215311.u72", 0x0800002, 0x0400000, CRC(20097531) SHA1(af733cbd85a0da8fccd7d1063f4be53086a4aa4a) ) + ROM_LOAD32_WORD("30215311.u84", 0x1000000, 0x0400000, CRC(6d306fc4) SHA1(06688a14c4094f0638543c29683f5c51f877d310) ) + ROM_LOAD32_WORD("30215311.u71", 0x1000002, 0x0400000, CRC(21373aeb) SHA1(34eec46f8912ace47cce7f856b07d7a7900aa125) ) +ROM_END + + // 0252599 / MV4276 // MR WOO / Local / N/A // Variations (% and NO): // 80.314% 99 -ROM_START( mrwoo ) +ROM_START( mrwoou ) ARISTMK6_BIOS ROM_REGION64_LE( 0x4000000, "game_rom", ROMREGION_ERASEFF) /* @@ -6713,6 +6763,7 @@ GAME( 2002, goldpym, qnilese, aristmk6, aristmk6, aristmk6_state, empty_init GAME( 2007, goldsam, aristmk6, aristmk6, aristmk6, aristmk6_state, empty_init, ROT0, "Aristocrat", "Golden Samurai (10247811, NSW/ACT)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND ) // 832, A - 31/07/07 GAME( 2002, gbmoney, aristmk6, aristmk6, aristmk6, aristmk6_state, empty_init, ROT0, "Aristocrat", "The Good, The Bad & The Money (0351016, US)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND ) // US023, B - 09/11/02 GAME( 2006, grizzly, aristmk6, aristmk6, aristmk6, aristmk6_state, empty_init, ROT0, "Aristocrat", "Grizzly (10214711, NSW/ACT)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND ) // 780, C - 12/04/06 +GAME( 2005, hrtantny, antcleo, aristmk6, aristmk6, aristmk6_state, empty_init, ROT0, "Aristocrat", "Heart of Antony (0252526, US)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND ) // MV4237, C - 05/23/05 GAME( 2003, heartgld, aristmk6, aristmk6, aristmk6, aristmk6_state, empty_init, ROT0, "Aristocrat", "Heart of Gold (20169511, NSW/ACT)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND ) // 717/2, A - 15/09/03 GAME( 2004, heartglda, heartgld, aristmk6, aristmk6, aristmk6_state, empty_init, ROT0, "Aristocrat", "Heart of Gold (10184211, ASP)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND ) // 717/2, B - 10/03/04 GAME( 2006, heartveg, aristmk6, aristmk6, aristmk6, aristmk6_state, empty_init, ROT0, "Aristocrat", "Heart of Vegas (10232911, NSW/ACT)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND ) // 717/4, C - 27/06/06 @@ -6763,7 +6814,8 @@ GAME( 2000, mnytree, aristmk6, aristmk6, aristmk6, aristmk6_state, empty_init GAME( 2001, mnytreea, mnytree, aristmk6, aristmk6, aristmk6_state, empty_init, ROT0, "Aristocrat", "Money Tree (10122211, ASP)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND ) // 657, F - 14/03/01 GAME( 2004, moonfire, indream, aristmk6, aristmk6, aristmk6_state, empty_init, ROT0, "Aristocrat", "Moon Fire - Jackpot Carnival (30164211, Queensland)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND ) // 628/3, E - 27/01/04 GAME( 2007, moonwalt, aristmk6, aristmk6, aristmk6, aristmk6_state, empty_init, ROT0, "Aristocrat", "Moonlight Waltz (10227611, NSW/ACT)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND ) // 814/1, B - 11/01/07 -GAME( 200?, mrwoo, aristmk6, aristmk6, aristmk6, aristmk6_state, empty_init, ROT0, "Aristocrat", "Mr Woo (0252599, US)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND ) // MV4276, (no data) +GAME( 2006, mrwoo, aristmk6, aristmk6, aristmk6, aristmk6_state, empty_init, ROT0, "Aristocrat", "Mr Woo (30215311, NSW/ACT)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND ) // 810, K - 12/07/06 +GAME( 200?, mrwoou, mrwoo, aristmk6, aristmk6, aristmk6_state, empty_init, ROT0, "Aristocrat", "Mr Woo (0252599, US)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND ) // MV4276, (no data) GAME( 2005, mskitty, aristmk6, aristmk6, aristmk6, aristmk6_state, empty_init, ROT0, "Aristocrat", "Miss Kitty (10216611, NSW/ACT)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND ) // 778, C - 18/04/05 GAME( 2002, mystarr, aristmk6, aristmk6, aristmk6, aristmk6_state, empty_init, ROT0, "Aristocrat", "Mystic Arrow (0151009, US)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND ) // US005, A - 01/07/02 GAME( 2001, mysteycm, aristmk6, aristmk6, aristmk6, aristmk6_state, empty_init, ROT0, "Aristocrat", "Mystic Eyes - Mr. Cashman (10008111, NSW/ACT)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND ) // 675, A- 09/05/01 diff --git a/src/mame/atari/hitparade.cpp b/src/mame/atari/hitparade.cpp index 5aca3be7c758a..e06823ee139b9 100644 --- a/src/mame/atari/hitparade.cpp +++ b/src/mame/atari/hitparade.cpp @@ -7,8 +7,8 @@ Atari Europe Hit Parade series jukeboxes Atari Europe is unrelated to the modern Atari Europe, or Infogrames. It was a French jukebox company that was partially owned by Atari for a while -in the mid-1970s. It gets a bit confusing, for more information, Google for -Socodimex, Electro-Kicker, Europe Electronique. +in the mid-1970s. It gets a bit confusing, for more information, search online +for Socodimex, Electro-Kicker, Europe Electronique. There are probably more jukeboxes on similar hardware. diff --git a/src/mame/atari/jaguar.cpp b/src/mame/atari/jaguar.cpp index 299b14ef90ac3..6ef3347778bd0 100644 --- a/src/mame/atari/jaguar.cpp +++ b/src/mame/atari/jaguar.cpp @@ -2612,11 +2612,11 @@ void jaguar_state::init_vcircle() * *************************************/ -/* YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME */ -CONS( 1993, jaguar, 0, 0, jaguar, jaguar, jaguar_state, init_jaguar, "Atari", "Jaguar (NTSC)", MACHINE_UNEMULATED_PROTECTION | MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND | MACHINE_NOT_WORKING ) -CONS( 1995, jaguarcd, jaguar, 0, jaguarcd, jaguar, jaguarcd_state, init_jaguarcd, "Atari", "Jaguar CD (NTSC)", MACHINE_UNEMULATED_PROTECTION | MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND | MACHINE_NOT_WORKING ) +/* YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME */ +CONS( 1993, jaguar, 0, 0, jaguar, jaguar, jaguar_state, init_jaguar, "Atari", "Jaguar (NTSC)", MACHINE_UNEMULATED_PROTECTION | MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND | MACHINE_NOT_WORKING ) +CONS( 1995, jaguarcd, jaguar, 0, jaguarcd, jaguar, jaguarcd_state, init_jaguarcd, "Atari", "Jaguar CD (NTSC)", MACHINE_UNEMULATED_PROTECTION | MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND | MACHINE_NOT_WORKING ) -/* YEAR NAME PARENT MACHINE INPUT CLASS INIT ROT COMPANY FULLNAME */ +/* YEAR NAME PARENT MACHINE INPUT CLASS INIT ROT COMPANY FULLNAME */ GAME( 1996, area51, 0, cojagr3k, area51, jaguar_state, init_area51, ROT0, "Atari Games", "Area 51 (R3000)", 0 ) GAME( 1995, area51t, area51, cojag68k, area51, jaguar_state, init_area51a, ROT0, "Atari Games (Time Warner license)", "Area 51 (Time Warner license, Oct 17, 1996)", 0 ) GAME( 1995, area51ta, area51, cojag68k, area51, jaguar_state, init_area51a, ROT0, "Atari Games (Time Warner license)", "Area 51 (Time Warner license, Nov 27, 1995)", 0 ) diff --git a/src/mame/bmc/bmcpokr.cpp b/src/mame/bmc/bmcpokr.cpp index 511d059b7548e..428343eef50a8 100644 --- a/src/mame/bmc/bmcpokr.cpp +++ b/src/mame/bmc/bmcpokr.cpp @@ -17,6 +17,8 @@ Other: BMC B816140 (CPLD) * Hopper hookup doesn't work properly. MAME counts far more "tickets dispensed" than the number of coins/tickets the games are supposed to pay out. + * xyddzhh: Hook up mahjong-style inputs and improve DSW definitions + * xyddzhh: Add Oki banking ***************************************************************************/ @@ -60,13 +62,14 @@ class bmcpokr_state : public driver_device int hopper_r(); - void bmcpokr(machine_config &config); - void fengyunh(machine_config &config); - void mjmaglmp(machine_config &config); - void shendeng(machine_config &config); + void bmcpokr(machine_config &config) ATTR_COLD; + void fengyunh(machine_config &config) ATTR_COLD; + void mjmaglmp(machine_config &config) ATTR_COLD; + void shendeng(machine_config &config) ATTR_COLD; + void xyddzhh(machine_config &config) ATTR_COLD; protected: - virtual void device_post_load() override; + virtual void device_post_load() override ATTR_COLD; virtual void machine_start() override ATTR_COLD; virtual void video_start() override ATTR_COLD; @@ -88,6 +91,7 @@ class bmcpokr_state : public driver_device uint16_t bmcpokr_prot_r(); uint16_t fengyunh_prot_r(); uint16_t shendeng_prot_r(); + uint16_t xyddzhh_prot_r(); void prot_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); uint16_t unk_r(); @@ -100,6 +104,7 @@ class bmcpokr_state : public driver_device uint16_t dsw_r(); uint16_t mjmaglmp_dsw_r(); uint16_t mjmaglmp_key_r(); + uint16_t xyddzhh_dsw_r(); // Interrupts uint8_t m_irq_enable = 0; @@ -126,6 +131,7 @@ class bmcpokr_state : public driver_device void mjmaglmp_map(address_map &map) ATTR_COLD; void ramdac_map(address_map &map) ATTR_COLD; void shendeng_map(address_map &map) ATTR_COLD; + void xyddzhh_map(address_map &map) ATTR_COLD; }; /*************************************************************************** @@ -352,6 +358,17 @@ uint16_t bmcpokr_state::shendeng_prot_r() return 0x00 << 8; } +uint16_t bmcpokr_state::xyddzhh_prot_r() +{ + switch (m_prot_val >> 8) + { + case 0x00: return 0x56 << 8; + // TODO: other cases, if they exist + } + logerror("unk prot r %x %x\n", m_prot_val, m_maincpu->pcbase()); + return 0x00 << 8; +} + void bmcpokr_state::prot_w(offs_t offset, uint16_t data, uint16_t mem_mask) { COMBINE_DATA(&m_prot_val); @@ -446,6 +463,21 @@ void bmcpokr_state::bmcpokr_mem(address_map &map) map(0x3b0000, 0x3b0001).portr("INPUTS2"); } +uint16_t bmcpokr_state::xyddzhh_dsw_r() +{ + return m_dsw[(~m_mux >> 4) & 0x03]->read() << 8; +} + +void bmcpokr_state::xyddzhh_map(address_map &map) +{ + bmcpokr_mem(map); + + map(0x00eec6, 0x00eec9).nopw(); // bug in the code? + map(0x330000, 0x330001).r(FUNC(bmcpokr_state::xyddzhh_prot_r)); + map(0x340009, 0x340009).lr8(NAME([] () -> uint8_t { return 0xff; })); // andi.b #$7f, so returning 0x00 stops it from working + map(0x360000, 0x360001).r(FUNC(bmcpokr_state::xyddzhh_dsw_r)); +} + uint16_t bmcpokr_state::mjmaglmp_dsw_r() { @@ -1090,6 +1122,136 @@ static INPUT_PORTS_START( shendeng ) // Coin Cash Out | Cash Out Coin INPUT_PORTS_END +static INPUT_PORTS_START( xyddzhh ) + PORT_START("INPUTS") + // Entertainment controls: + PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_START1 ) // PORT_CONDITION("DSW2",0x01,EQUALS,0x00) + PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) // PORT_CONDITION("DSW2",0x01,EQUALS,0x00) + PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) // PORT_CONDITION("DSW2",0x01,EQUALS,0x00) + PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) // PORT_CONDITION("DSW2",0x01,EQUALS,0x00) + PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) // PORT_CONDITION("DSW2",0x01,EQUALS,0x00) + PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON1 ) // PORT_CONDITION("DSW2",0x01,EQUALS,0x00) // choose + PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_GAMBLE_KEYIN ) // PORT_CONDITION("DSW2",0x01,EQUALS,0x00) + PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_GAMBLE_KEYOUT ) // PORT_CONDITION("DSW2",0x01,EQUALS,0x00) + PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Pay Out") PORT_CODE(KEYCODE_O) // PAY // PORT_CONDITION("DSW2",0x01,EQUALS,0x00) + PORT_BIT( 0x0200, IP_ACTIVE_HIGH,IPT_CUSTOM ) PORT_READ_LINE_MEMBER(FUNC(bmcpokr_state::hopper_r)) // TODO: verify? + PORT_SERVICE_NO_TOGGLE( 0x0400, IP_ACTIVE_LOW ) // PORT_CONDITION("DSW2",0x01,EQUALS,0x00) + PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_SERVICE1 ) // PORT_CONDITION("DSW2",0x01,EQUALS,0x00) + PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNUSED ) // PORT_CONDITION("DSW2",0x01,EQUALS,0x00) // no effect in test mode + PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_GAMBLE_BET ) // PORT_CONDITION("DSW2",0x01,EQUALS,0x00) + PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON2 ) // PORT_CONDITION("DSW2",0x01,EQUALS,0x00) // pass + PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_COIN1 ) // PORT_CONDITION("DSW2",0x01,EQUALS,0x00) PORT_IMPULSE(5) + + // TODO: Mahjong controls: + + PORT_START("INPUTS2") + PORT_BIT( 0xffff, IP_ACTIVE_LOW, IPT_UNUSED ) + + // Maximum Bet is fixed to 40 according to test mode (no DIP determines it) + PORT_START("DSW1") + PORT_DIPNAME( 0x01, 0x00, DEF_STR(Demo_Sounds) ) PORT_DIPLOCATION("DIP1:1") + PORT_DIPSETTING( 0x01, DEF_STR(Off) ) + PORT_DIPSETTING( 0x00, DEF_STR(On) ) + PORT_DIPNAME( 0x02, 0x02, "Key-Out Rate" ) PORT_DIPLOCATION("DIP1:2") + PORT_DIPSETTING( 0x02, "Key-In Rate" ) + PORT_DIPSETTING( 0x00, DEF_STR(Coinage) ) + PORT_DIPNAME( 0x04, 0x04, "Return Coins" ) PORT_DIPLOCATION("DIP1:3") + PORT_DIPSETTING( 0x04, DEF_STR(No) ) + PORT_DIPSETTING( 0x00, DEF_STR(Yes) ) + PORT_DIPNAME( 0x08, 0x08, "Siren Sound" ) PORT_DIPLOCATION("DIP1:4") + PORT_DIPSETTING( 0x00, DEF_STR(Off) ) + PORT_DIPSETTING( 0x08, DEF_STR(On) ) + PORT_DIPNAME( 0x10, 0x10, "Auto Pass" ) PORT_DIPLOCATION("DIP1:5") + PORT_DIPSETTING( 0x00, DEF_STR(Off) ) + PORT_DIPSETTING( 0x10, DEF_STR(On) ) + PORT_DIPNAME( 0xe0, 0xe0, "Double-Up Game Jackpot" ) PORT_DIPLOCATION("DIP1:6,7,8") + PORT_DIPSETTING( 0xc0, "5,000" ) + PORT_DIPSETTING( 0xe0, "10,000" ) + PORT_DIPSETTING( 0xa0, "15,000" ) + PORT_DIPSETTING( 0x80, "20,000" ) + PORT_DIPSETTING( 0x60, "25,000" ) + PORT_DIPSETTING( 0x40, "30,000" ) + PORT_DIPSETTING( 0x20, "40,000" ) + PORT_DIPSETTING( 0x00, "50,000" ) + + PORT_START("DSW2") + PORT_DIPNAME( 0x01, 0x00, "Controls" ) PORT_DIPLOCATION("DIP2:1") + PORT_DIPSETTING( 0x01, "Mahjong" ) + PORT_DIPSETTING( 0x00, "Entertainment" ) + PORT_DIPNAME( 0x06, 0x06, "Double-Up Game Threshold" ) PORT_DIPLOCATION("DIP2:2,3") + PORT_DIPSETTING( 0x06, "3000" ) + PORT_DIPSETTING( 0x04, "4000" ) + PORT_DIPSETTING( 0x02, "5000" ) + PORT_DIPSETTING( 0x01, "6000" ) + PORT_DIPNAME( 0x08, 0x08, "Accumulated Bonus" ) PORT_DIPLOCATION("DIP2:4") + PORT_DIPSETTING( 0x08, "300" ) + PORT_DIPSETTING( 0x00, "400" ) + PORT_DIPNAME( 0x70, 0x70, "Double-Up Game Payout Rate" ) PORT_DIPLOCATION("DIP2:5,6,7") + PORT_DIPSETTING( 0x60, "92%" ) + PORT_DIPSETTING( 0x50, "93%" ) + PORT_DIPSETTING( 0x40, "94%" ) + PORT_DIPSETTING( 0x70, "95%" ) + PORT_DIPSETTING( 0x30, "96%" ) + PORT_DIPSETTING( 0x20, "97%" ) + PORT_DIPSETTING( 0x10, "98%" ) + PORT_DIPSETTING( 0x00, "99%" ) + PORT_DIPNAME( 0x80, 0x80, "Double-Up Game" ) PORT_DIPLOCATION("DIP2:8") + PORT_DIPSETTING( 0x00, DEF_STR(Off) ) + PORT_DIPSETTING( 0x80, DEF_STR(On) ) + + PORT_START("DSW3") + PORT_DIPNAME( 0x07, 0x07, DEF_STR(Coinage) ) PORT_DIPLOCATION("DIP3:1,2,3") + PORT_DIPSETTING( 0x06, DEF_STR(1C_1C) ) + PORT_DIPSETTING( 0x05, DEF_STR(1C_2C) ) + PORT_DIPSETTING( 0x04, DEF_STR(1C_5C) ) + PORT_DIPSETTING( 0x03, "1 Coin/10 Credits" ) + PORT_DIPSETTING( 0x02, "1 Coin/20 Credits" ) + PORT_DIPSETTING( 0x01, "1 Coin/50 Credits" ) + PORT_DIPSETTING( 0x07, "1 Coin/100 Credits" ) + PORT_DIPSETTING( 0x00, "1 Coin/200 Credits" ) + PORT_DIPNAME( 0x38, 0x38, "Key-In Rate" ) PORT_DIPLOCATION("DIP3:4,5,6") + PORT_DIPSETTING( 0x30, "40" ) + PORT_DIPSETTING( 0x28, "50" ) + PORT_DIPSETTING( 0x38, "100" ) + PORT_DIPSETTING( 0x20, "200" ) + PORT_DIPSETTING( 0x18, "300" ) + PORT_DIPSETTING( 0x10, "500" ) + PORT_DIPSETTING( 0x08, "1000" ) + PORT_DIPSETTING( 0x00, "2000" ) + PORT_DIPNAME( 0x40, 0x40, "Credit Limit" ) PORT_DIPLOCATION("DIP3:7") + PORT_DIPSETTING( 0x00, "10,000" ) + PORT_DIPSETTING( 0x40, "99,000" ) + PORT_DIPNAME( 0x80, 0x80, "Card Type" ) PORT_DIPLOCATION("DIP3:8") + PORT_DIPSETTING( 0x80, DEF_STR ( Normal ) ) + PORT_DIPSETTING( 0x00, "Graphics" ) + + PORT_START("DSW4") + PORT_DIPNAME( 0x07, 0x07, "Minimum Bet" ) PORT_DIPLOCATION("DIP4:1,2,3") + PORT_DIPSETTING( 0x06, "1" ) + PORT_DIPSETTING( 0x05, "2" ) + PORT_DIPSETTING( 0x04, "3" ) + PORT_DIPSETTING( 0x07, "5" ) + PORT_DIPSETTING( 0x03, "10" ) + PORT_DIPSETTING( 0x02, "15" ) + PORT_DIPSETTING( 0x01, "20" ) + PORT_DIPSETTING( 0x00, "40" ) + PORT_DIPNAME( 0x38, 0x38, "Payout Rate" ) PORT_DIPLOCATION("DIP4:4,5,6") + PORT_DIPSETTING( 0x30, "90%" ) + PORT_DIPSETTING( 0x28, "91%" ) + PORT_DIPSETTING( 0x20, "92%" ) + PORT_DIPSETTING( 0x18, "93%" ) + PORT_DIPSETTING( 0x38, "94%" ) + PORT_DIPSETTING( 0x10, "95%" ) + PORT_DIPSETTING( 0x08, "96%" ) + PORT_DIPSETTING( 0x00, "97%" ) + PORT_DIPNAME( 0x40, 0x40, "Market Setting" ) PORT_DIPLOCATION("DIP4:7") + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x40, DEF_STR( On ) ) + PORT_DIPNAME( 0x80, 0x80, "Jackpot" ) PORT_DIPLOCATION("DIP4:8") + PORT_DIPSETTING( 0x00, "50,000" ) + PORT_DIPSETTING( 0x80, "100,000" ) +INPUT_PORTS_END + /*************************************************************************** Graphics Layout @@ -1189,6 +1351,12 @@ void bmcpokr_state::shendeng(machine_config &config) m_maincpu->set_addrmap(AS_PROGRAM, &bmcpokr_state::shendeng_map); } +void bmcpokr_state::xyddzhh(machine_config &config) +{ + bmcpokr(config); + m_maincpu->set_addrmap(AS_PROGRAM, &bmcpokr_state::xyddzhh_map); +} + /*************************************************************************** ROMs Loading ***************************************************************************/ @@ -1386,6 +1554,27 @@ ROM_START( bmcpokr ) ROM_LOAD( "ch-m-701.u10", 0x00000, 0x40000, CRC(e01be644) SHA1(b68682786d5b40cb5672cfd7f717adcfb8fac7d3) ) ROM_END +/* +幸运斗地主 (Xìngyùn Dòu Dìzhǔ - Lucky Dou Dizhu), Herb Home, 2006 +PCB Number: BMC-A81210 +PCB is identical to BMC-A81212 (documented) +*/ + +ROM_START( xyddzhh ) + ROM_REGION( 0x40000, "maincpu", 0 ) // 68000 Code + ROM_LOAD16_BYTE( "c1-a-601.u13", 0x000000, 0x20000, CRC(7f06ba9f) SHA1(747110ebc674867f858348d41f3e5b8b8167a816) ) + ROM_LOAD16_BYTE( "c1-a-501.u12", 0x000001, 0x20000, CRC(1522fe48) SHA1(7636c00f8735ec031b0218a2ed348c7d4fa3f66d) ) + + ROM_REGION( 0x200000, "gfx1", 0 ) + ROM_LOAD16_BYTE( "c4-a-101.u39", 0x000000, 0x80000, CRC(28e945b6) SHA1(cee74fa35234d7b2d19ca4354b17a4223f28a153) ) + ROM_LOAD16_BYTE( "c4-a-201.u40", 0x000001, 0x80000, CRC(b2730f93) SHA1(f002cf6e632ce46ce3a5a2293748dfc2f5b47563) ) + ROM_LOAD16_BYTE( "c4-a-301.u45", 0x100000, 0x80000, CRC(02dd38d5) SHA1(bc563b6f556c790667efef6e6af09fb76cae50e6) ) + ROM_LOAD16_BYTE( "c4-a-401.u29", 0x100001, 0x80000, CRC(24c2f883) SHA1(275fb3d47447d524994ca5ee26be8c8a2b69608c) ) + + ROM_REGION( 0x80000, "oki", 0 ) // Samples + ROM_LOAD( "c4-a-701.u10", 0x00000, 0x80000, CRC(f22dacfe) SHA1(0a085419b04a6eba0d30064fae4678e1523e4e15) ) +ROM_END + /*************************************************************************** Mahou no Lamp (BMC, 2000) @@ -1442,7 +1631,8 @@ ROM_END } // anonymous namespace -GAME( 1998, fengyunh, 0, fengyunh, fengyunh, bmcpokr_state, empty_init, ROT0, "BMC", "Fengyun Hui", MACHINE_SUPPORTS_SAVE ) -GAME( 1998, shendeng, mjmaglmp, shendeng, shendeng, bmcpokr_state, empty_init, ROT0, "BMC", "Pili Shen Deng", MACHINE_SUPPORTS_SAVE ) -GAME( 1999, bmcpokr, 0, bmcpokr, bmcpokr, bmcpokr_state, empty_init, ROT0, "BMC", "Dongfang Shenlong", MACHINE_SUPPORTS_SAVE ) -GAME( 2000, mjmaglmp, 0, mjmaglmp, mjmaglmp, bmcpokr_state, empty_init, ROT0, "BMC", "Mahou no Lamp (v. JAA02)", MACHINE_SUPPORTS_SAVE ) +GAME( 1998, fengyunh, 0, fengyunh, fengyunh, bmcpokr_state, empty_init, ROT0, "BMC", "Fengyun Hui", MACHINE_SUPPORTS_SAVE ) +GAME( 1998, shendeng, mjmaglmp, shendeng, shendeng, bmcpokr_state, empty_init, ROT0, "BMC", "Pili Shen Deng", MACHINE_SUPPORTS_SAVE ) +GAME( 1999, bmcpokr, 0, bmcpokr, bmcpokr, bmcpokr_state, empty_init, ROT0, "BMC", "Dongfang Shenlong", MACHINE_SUPPORTS_SAVE ) +GAME( 2000, mjmaglmp, 0, mjmaglmp, mjmaglmp, bmcpokr_state, empty_init, ROT0, "BMC", "Mahou no Lamp (v. JAA02)", MACHINE_SUPPORTS_SAVE ) +GAME( 2006, xyddzhh, 0, xyddzhh, xyddzhh, bmcpokr_state, empty_init, ROT0, "Herb Home", "Xingyun Dou Dizhu", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/bmc/popobear.cpp b/src/mame/bmc/popobear.cpp index 1d29d2fdc2c2d..b69cee41ac181 100644 --- a/src/mame/bmc/popobear.cpp +++ b/src/mame/bmc/popobear.cpp @@ -17,31 +17,55 @@ Popo Bear (c) 2000 BMC =================================================================================================== -Popo Bear - BMC-A00211 -(c) 2000 - Bao Ma Technology Co., LTD - -|-----------------------------------------| -| DIP2 DIP4 UM3567(YM2413) |J -| DIP1 DIP3 |A -| TA-A-901 |M -| EN-A-701 EN-A-801 U6295(OKI) |M -| EN-A-501 EN-A-601 |A -| EN-A-301 EN-A-401 | -| |C -| AIA90610 |O -| BMC-68pin AIA90423 |N -| plcc (68k) BMC-160pin |N -| |E -| OSC |C -| 42.000 |T -|-----------------------------------------| - -1 - BMC AIA90423 - 160-Pin ASIC, FPGA, Video? -1 - BMC AIA90610 - 68 Pin CPU (Likely 16 MHz, 68-lead plastic LCC 68000) -1 - UM3567 (YM2413) Sound -1 - U6295 (OKI6295) Sound -1 - 42.000MHz XTAL -4 - 8 Position DIP switches +Qi Wang (2010, Herb Home). English title is 'Chess King' +Popo Bear (2000, Bao Ma Technology Co., LTD) +Hardware Info by Guru +--------------------- + +BMC-A00211 +|---------------------------------------------| +| 42MHz TR5116258 241024 241024 T518 556 SC | +| TR5116258 241024 241024 SW | +| U10 | +| |--------| |-------| 6264 6264 | +| | BMC | | BMC | | +| |AIA90423| |AIA90610 | +|J | | | | 2 1 | +|A | | |-------| | +|M |--------| MJ-04.U4 A-3.U3 | +|M PLCC44 | +|A MJ-68.U6 MJ-57.U5 | +| | +| 8 7 | +| ULN2003 | +| MJ-09.U9 DIP3 DIP1| +| 7805 6295 | +| TDA2003 VOL LM324 UM3567 DIP4 DIP2| +|---------------------------------------------| +Notes: + AIA90610 - Rebadged 68000 CPU. Clock 10.500MHz [42/4] + AIA90423 - BMC Custom Graphics Chip + UM3567 - Yamaha YM2413-compatible Sound Chip. Clock 3.500MHz [42/12] + 6295 - Oki M6295 ADPCM Sample Player. Clock 1.000MHz [42/42]. Pin 7 HIGH. + TR5116258 - 256kB x16-bit DRAM, equivalent to HM514260 \ + 241024 - Winbond W241024 128kB x8-bit SRAM / connected to graphics chip + 6264 - 8kB x8-bit SRAM (68000 RAM). Both RAMs are tied to the Super Cap. + PLCC44 - 44 pin CPLD (surface scratched) + 1,2,7,8 - Empty Sockets + T518 - Mitsumi PST518A Master Reset IC + 556 - NE556 Dual Timer + SC - 5.5V 0.1F Super Capacitor + SW - Reset Switch / NVRAM Memory Clear + U10 - Unpopulated position for a 32Mbit/64Mbit TSOP48 Flash ROM (jumper-selectable) + ROMs - U5/U6 are 27C801 EPROM, other ROMs are 27C010. + ROM U5 is unique to this set (only ROM fill change), other ROMs match existing qiwang dump. + DIP1-4 - 8-position DIP Switch + TDA2003 - ST TDA2003 10W Audio Amplifier + LM324 - LM324 Quad Op-Amp + 7805 - LM7805 5V Linear Regulator + ULN2003 - 7-Channel Darlington Transistor Array + V-Sync 59.6377Hz + H-Sync 15.6248kHz JAMMA CONNECTOR Component Side A B Solder Side @@ -594,12 +618,12 @@ TIMER_DEVICE_CALLBACK_MEMBER(popobear_state::scanline_cb) void popobear_state::popobear(machine_config &config) { - M68000(config, m_maincpu, XTAL(42'000'000) / 4); // divisor guessed + M68000(config, m_maincpu, 42_MHz_XTAL / 4); m_maincpu->set_addrmap(AS_PROGRAM, &popobear_state::main_map); TIMER(config, "scantimer").configure_scanline(FUNC(popobear_state::scanline_cb), "screen", 0, 1); SCREEN(config, m_screen, SCREEN_TYPE_RASTER); - m_screen->set_refresh_hz(60); + m_screen->set_refresh_hz(59.64); m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(2500)); // not accurate m_screen->set_screen_update(FUNC(popobear_state::screen_update)); m_screen->set_palette(m_palette); @@ -612,9 +636,9 @@ void popobear_state::popobear(machine_config &config) GFXDECODE(config, m_gfxdecode, m_palette, gfx_popobear); - YM2413(config, "ymsnd", XTAL(42'000'000) / 16).add_route(ALL_OUTPUTS, "mono", 1.0); // divisor guessed + YM2413(config, "ymsnd", 42_MHz_XTAL / 12).add_route(ALL_OUTPUTS, "mono", 1.0); - OKIM6295(config, "oki", XTAL(42'000'000) / 32, okim6295_device::PIN7_LOW).add_route(ALL_OUTPUTS, "mono", 1.0); // divisor guessed + OKIM6295(config, "oki", 42_MHz_XTAL / 42, okim6295_device::PIN7_HIGH).add_route(ALL_OUTPUTS, "mono", 1.0); } void popobear_state::qiwang(machine_config &config) @@ -626,14 +650,14 @@ void popobear_state::qiwang(machine_config &config) ROM_START( popobear ) ROM_REGION( 0x040000, "maincpu", 0 ) - ROM_LOAD16_BYTE( "popobear_en-a-301_1.6.u3", 0x000001, 0x020000, CRC(b934adf6) SHA1(93431c7a19af812b549aad35cc1176a81805ffab) ) ROM_LOAD16_BYTE( "popobear_en-a-401_1.6.u4", 0x000000, 0x020000, CRC(0568af9c) SHA1(920531dbc4bbde2d1db062bd5c48b97dd50b7185) ) + ROM_LOAD16_BYTE( "popobear_en-a-301_1.6.u3", 0x000001, 0x020000, CRC(b934adf6) SHA1(93431c7a19af812b549aad35cc1176a81805ffab) ) ROM_REGION16_BE( 0x400000, "gfx_data", 0 ) - ROM_LOAD16_BYTE( "popobear_en-a-501.u5", 0x000001, 0x100000, CRC(185901a9) SHA1(7ff82b5751645df53435eaa66edce589684cc5c7) ) ROM_LOAD16_BYTE( "popobear_en-a-601.u6", 0x000000, 0x100000, CRC(84fa9f3f) SHA1(34dd7873f88b0dae5fb81fe84e82d2b6b49f7332) ) - ROM_LOAD16_BYTE( "popobear_en-a-701.u7", 0x200001, 0x100000, CRC(45eba6d0) SHA1(0278602ed57ac45040619d590e6cc85e2cfeed31) ) + ROM_LOAD16_BYTE( "popobear_en-a-501.u5", 0x000001, 0x100000, CRC(185901a9) SHA1(7ff82b5751645df53435eaa66edce589684cc5c7) ) ROM_LOAD16_BYTE( "popobear_en-a-801.u8", 0x200000, 0x100000, CRC(2760f2e6) SHA1(58af59f486c9df930f7c124f89154f8f389a5bd7) ) + ROM_LOAD16_BYTE( "popobear_en-a-701.u7", 0x200001, 0x100000, CRC(45eba6d0) SHA1(0278602ed57ac45040619d590e6cc85e2cfeed31) ) ROM_REGION( 0x040000, "oki", 0 ) ROM_LOAD( "popobear_ta-a-901.u9", 0x00000, 0x40000, CRC(f1e94926) SHA1(f4d6f5b5811d90d0069f6efbb44d725ff0d07e1c) ) @@ -643,13 +667,13 @@ ROM_END // All labels have 棋王 prepended to what's below, with the exception of mj-57 which has a sticker 'BMC 棋王' on the upper part of the label ROM_START( qiwang ) ROM_REGION( 0x040000, "maincpu", 0 ) - ROM_LOAD16_BYTE( "mj-03.u3", 0x000001, 0x020000, CRC(3cf3ff12) SHA1(dd4347b44a45822e7bfddffb0afadd65d398bea6) ) ROM_LOAD16_BYTE( "mj-04.u4", 0x000000, 0x020000, CRC(03a0d290) SHA1(d8fb1e6780d31ebf8cdc6ae14301d1f8c25380c6) ) + ROM_LOAD16_BYTE( "mj-03.u3", 0x000001, 0x020000, CRC(3cf3ff12) SHA1(dd4347b44a45822e7bfddffb0afadd65d398bea6) ) // u1 and u2 not populated ROM_REGION16_BE( 0x400000, "gfx_data", ROMREGION_ERASE00 ) - ROM_LOAD16_BYTE( "mj-57.u5", 0x000001, 0x100000, CRC(50871b0c) SHA1(01279d844cae699eb76a90b8c4b3915ae538c12e) ) ROM_LOAD16_BYTE( "mj-68.u6", 0x000000, 0x100000, CRC(9692bb92) SHA1(6282054a41eda1b1fc1de5096bc2440a386d9f99) ) + ROM_LOAD16_BYTE( "mj-57.u5", 0x000001, 0x100000, CRC(d442e579) SHA1(86d840ce9cd2623f13658f75336847f5df306531) ) // u7 and u8 not populated ROM_REGION( 0x040000, "oki", 0 ) diff --git a/src/mame/bordun/att.cpp b/src/mame/bordun/att.cpp new file mode 100644 index 0000000000000..99bdf83f5e9b9 --- /dev/null +++ b/src/mame/bordun/att.cpp @@ -0,0 +1,669 @@ +// license:BSD-3-Clause +// copyright-holders: + +/* +Bordun poker games on ATT / ATT III PCBs + + +TODO: +* this is basically bordun/skylncr.cpp without reels and PPIs and with more advanced sound. Merge? +* outputs +* lianhp3: title screen says 2003TM but PCB is from 2010? Was this really released in 2003? + +BTANB: +* sound test for lianhp3 doesn't work. It's still coded to send sound commands to 0xd0, but this game + doesn't have an audio CPU. +*/ + + +#include "emu.h" + +#include "cpu/z80/z80.h" +#include "machine/gen_latch.h" +#include "machine/nvram.h" +#include "sound/okim6295.h" +#include "sound/ymopl.h" +#include "video/ramdac.h" + +#include "emupal.h" +#include "screen.h" +#include "speaker.h" +#include "tilemap.h" + + +namespace { + +class att_state : public driver_device +{ +public: + att_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_videoram(*this, "videoram"), + m_colorram(*this, "colorram") + { } + + void att(machine_config &config) ATTR_COLD; + void att3(machine_config &config) ATTR_COLD; + +protected: + virtual void video_start() override ATTR_COLD; + +private: + required_device m_maincpu; + required_device m_gfxdecode; + + required_shared_ptr m_videoram; + required_shared_ptr m_colorram; + + tilemap_t *m_tilemap = nullptr; + + void videoram_w(offs_t offset, uint8_t data); + void colorram_w(offs_t offset, uint8_t data); + TILE_GET_INFO_MEMBER(get_tile_info); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + + void program_map(address_map &map) ATTR_COLD; + void att_io_map(address_map &map) ATTR_COLD; + void att3_io_map(address_map &map) ATTR_COLD; + void att_audio_program_map(address_map &map) ATTR_COLD; + void att_audio_io_map(address_map &map) ATTR_COLD; + void ramdac_map(address_map &map) ATTR_COLD; +}; + + +void att_state::videoram_w(offs_t offset, uint8_t data) +{ + m_videoram[offset] = data; + m_tilemap->mark_tile_dirty(offset); +} + +void att_state::colorram_w(offs_t offset, uint8_t data) +{ + m_colorram[offset] = data; + m_tilemap->mark_tile_dirty(offset); +} + + +TILE_GET_INFO_MEMBER(att_state::get_tile_info) +{ + uint16_t const code = m_videoram[tile_index] + (m_colorram[tile_index] << 8); + int const pal = (code & 0x8000) >> 15; + tileinfo.set(0, code, pal ^ 1, TILE_FLIPYX( 0 )); +} + +uint32_t att_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +{ + bitmap.fill(rgb_t::black(), cliprect); + + m_tilemap->draw(screen, bitmap, cliprect, 0, 0); + + return 0; +} + +void att_state::video_start() +{ + m_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(att_state::get_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); +} + + +void att_state::program_map(address_map &map) +{ + map(0x0000, 0x7fff).rom(); + map(0x8000, 0x87ff).ram().share("nvram"); + map(0x8800, 0x8fff).ram().w(FUNC(att_state::videoram_w)).share(m_videoram); + map(0x9000, 0x97ff).ram().w(FUNC(att_state::colorram_w)).share(m_colorram); +} + +void att_state::att_io_map(address_map &map) +{ + map.global_mask(0xff); + map.unmap_value_high(); + + map(0x00, 0x00).portr("IN0"); + map(0x01, 0x01).portr("IN1"); + map(0x02, 0x02).portr("DSW3"); + map(0x03, 0x03).portr("DSW2"); + map(0x10, 0x10).portr("DSW4"); + map(0x11, 0x11).portr("IN2"); + map(0x12, 0x12).portr("DSW1"); + // map(0x20, 0x20) // TODO: coin counter / outputs? + map(0x40, 0x40).w("ramdac", FUNC(ramdac_device::index_w)); + map(0x41, 0x41).w("ramdac", FUNC(ramdac_device::pal_w)); + map(0x42, 0x42).w("ramdac", FUNC(ramdac_device::mask_w)); + map(0x70, 0x70).nopw(); // TODO: NMI clear? NOPed for now as it spams the log + map(0xd0, 0xd0).w("soundlatch", FUNC(generic_latch_8_device::write)); +} + +void att_state::att3_io_map(address_map &map) +{ + map.global_mask(0xff); + map.unmap_value_high(); + + map(0x00, 0x00).portr("IN0"); + map(0x01, 0x01).portr("IN1"); + map(0x02, 0x02).portr("DSW3"); + map(0x03, 0x03).portr("DSW2"); + map(0x10, 0x10).portr("DSW4"); + map(0x11, 0x11).portr("IN2"); + map(0x12, 0x12).portr("DSW1"); + // map(0x20, 0x20) // TODO: coin counter / outputs? + map(0x40, 0x40).w("ramdac", FUNC(ramdac_device::index_w)); + map(0x41, 0x41).w("ramdac", FUNC(ramdac_device::pal_w)); + map(0x42, 0x42).w("ramdac", FUNC(ramdac_device::mask_w)); + map(0x70, 0x70).nopw(); // TODO: NMI clear? NOPed for now as it spams the log + map(0xf6, 0xf6).lw8(NAME([this] (uint8_t data) { if (data != 0x00) logerror("Oki bank: %02x\n", data); })); // TODO: Oki bank select? + map(0xf7, 0xf7).rw("oki", FUNC(okim6295_device::read), FUNC(okim6295_device::write)); +} + +void att_state::att_audio_program_map(address_map &map) +{ + map(0x0000, 0x3fff).rom(); + map(0x4000, 0x41ff).ram(); + map(0xf800, 0xffff).ram(); +} + +void att_state::att_audio_io_map(address_map &map) +{ + // TODO: lots of reads / writes + map.global_mask(0xff); + + map(0x84, 0x84).r("soundlatch", FUNC(generic_latch_8_device::read)); + map(0x90, 0x91).w("ym2413", FUNC(ym2413_device::write)); +} + + +void att_state::ramdac_map(address_map &map) +{ + map(0x000, 0x3ff).rw("ramdac", FUNC(ramdac_device::ramdac_pal_r), FUNC(ramdac_device::ramdac_rgb666_w)); +} + + +static INPUT_PORTS_START( lianhp2 ) + PORT_START("IN0") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_GAMBLE_BET ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_POKER_HOLD1 ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_GAMBLE_DEAL ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_POKER_HOLD2 ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_GAMBLE_TAKE ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_POKER_HOLD3 ) + PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // active high or it stops after RAM check + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_POKER_HOLD4 ) + + PORT_START("IN1") + PORT_SERVICE_NO_TOGGLE( 0x01, IP_ACTIVE_LOW ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_POKER_HOLD5 ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_POKER_CANCEL ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) // no evident effect + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_GAMBLE_HIGH ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_GAMBLE_D_UP ) + + PORT_START("IN2") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) // no evident effect + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_GAMBLE_LOW ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) // no evident effect + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) // no evident effect + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) // no evident effect + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) // no evident effect + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) // no evident effect + + // SW1 on PCB is the reset button and SW2-5 are the DIP switches + // test mode shows SW1-4 for the DIPs + // thus to avoid user confusion let's follow the test mode + + PORT_START("DSW1") + PORT_DIPNAME( 0x03, 0x03, "Max Bet" ) PORT_DIPLOCATION("SW1:8,7") // hard-coded to 100? + PORT_DIPSETTING( 0x03, "100" ) + PORT_DIPSETTING( 0x02, "100 (duplicate)" ) + PORT_DIPSETTING( 0x01, "100 (duplicate)" ) + PORT_DIPSETTING( 0x00, "100 (duplicate)" ) + PORT_DIPNAME( 0x04, 0x04, "Clear Point As" ) PORT_DIPLOCATION("SW1:6") + PORT_DIPSETTING( 0x04, "Create Point" ) + PORT_DIPSETTING( 0x00, "Coin" ) + PORT_DIPNAME( 0x08, 0x08, "Bonus Rate" ) PORT_DIPLOCATION("SW1:5") + PORT_DIPSETTING( 0x00, "32" ) + PORT_DIPSETTING( 0x08, "48" ) + PORT_DIPNAME( 0x10, 0x10, "Straight Double Up" ) PORT_DIPLOCATION("SW1:4") + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x10, DEF_STR( On ) ) + PORT_DIPNAME( 0x20, 0x20, "Double Up" ) PORT_DIPLOCATION("SW1:3") + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x20, DEF_STR( On ) ) + PORT_DIPNAME( 0x40, 0x40, "Card Type" ) PORT_DIPLOCATION("SW1:2") + PORT_DIPSETTING( 0x40, "Poker" ) + PORT_DIPSETTING( 0x00, "Animals" ) + PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:1") // not shown in test mode + PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + + PORT_START("DSW2") + PORT_DIPNAME( 0x03, 0x03, "Begin Bonus" ) PORT_DIPLOCATION("SW2:8,7") + PORT_DIPSETTING( 0x03, "2000" ) + PORT_DIPSETTING( 0x02, "4000" ) + PORT_DIPSETTING( 0x01, "6000" ) + PORT_DIPSETTING( 0x00, "8000" ) + PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:6") // not shown in test mode + PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:5") // not shown in test mode + PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:4") // not shown in test mode + PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0xe0, 0xe0, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW2:3,2,1") + PORT_DIPSETTING( 0xe0, "1" ) + PORT_DIPSETTING( 0xc0, "5" ) + PORT_DIPSETTING( 0xa0, "10" ) + PORT_DIPSETTING( 0x80, "25" ) + PORT_DIPSETTING( 0x60, "50" ) + PORT_DIPSETTING( 0x40, "100" ) + PORT_DIPSETTING( 0x20, "250" ) + PORT_DIPSETTING( 0x00, "500" ) + + PORT_START("DSW3") + PORT_DIPNAME( 0x03, 0x03, "Min Bet" ) PORT_DIPLOCATION("SW3:8,7") + PORT_DIPSETTING( 0x03, "1" ) + PORT_DIPSETTING( 0x02, "2" ) + PORT_DIPSETTING( 0x01, "4" ) + PORT_DIPSETTING( 0x00, "10" ) + PORT_DIPNAME( 0x1c, 0x1c, "Double Up Rate" ) PORT_DIPLOCATION("SW3:6,5,4") + PORT_DIPSETTING( 0x00, "86" ) + PORT_DIPSETTING( 0x04, "87" ) + PORT_DIPSETTING( 0x08, "88" ) + PORT_DIPSETTING( 0x0c, "89" ) + PORT_DIPSETTING( 0x10, "90" ) + PORT_DIPSETTING( 0x14, "91" ) + PORT_DIPSETTING( 0x18, "92" ) + PORT_DIPSETTING( 0x1c, "93" ) + PORT_DIPNAME( 0xe0, 0xe0, "Play Rate" ) PORT_DIPLOCATION("SW3:3,2,1") // hard-coded to 100? + PORT_DIPSETTING( 0xe0, "100" ) + PORT_DIPSETTING( 0xc0, "100 (duplicate)" ) + PORT_DIPSETTING( 0xa0, "100 (duplicate)" ) + PORT_DIPSETTING( 0x80, "100 (duplicate)" ) + PORT_DIPSETTING( 0x60, "100 (duplicate)" ) + PORT_DIPSETTING( 0x40, "100 (duplicate)" ) + PORT_DIPSETTING( 0x20, "100 (duplicate)" ) + PORT_DIPSETTING( 0x00, "100 (duplicate)" ) + + PORT_START("DSW4") + PORT_DIPNAME( 0x03, 0x03, "4 K Rate" ) PORT_DIPLOCATION("SW4:8,7") + PORT_DIPSETTING( 0x00, "70 (duplicate)" ) + PORT_DIPSETTING( 0x01, "70" ) + PORT_DIPSETTING( 0x02, "80" ) + PORT_DIPSETTING( 0x03, "90" ) + PORT_DIPNAME( 0x0c, 0x0c, "S F Rate" ) PORT_DIPLOCATION("SW4:6,5") + PORT_DIPSETTING( 0x00, "70 (duplicate)" ) + PORT_DIPSETTING( 0x04, "70" ) + PORT_DIPSETTING( 0x08, "80" ) + PORT_DIPSETTING( 0x0c, "90" ) + PORT_DIPNAME( 0x30, 0x30, "R S Rate" ) PORT_DIPLOCATION("SW4:4,3") + PORT_DIPSETTING( 0x00, "70 (duplicate)" ) + PORT_DIPSETTING( 0x10, "70" ) + PORT_DIPSETTING( 0x20, "80" ) + PORT_DIPSETTING( 0x30, "90" ) + PORT_DIPNAME( 0xc0, 0xc0, "5 K Rate" ) PORT_DIPLOCATION("SW4:2,1") + PORT_DIPSETTING( 0x00, "70 (duplicate)" ) + PORT_DIPSETTING( 0x40, "70" ) + PORT_DIPSETTING( 0x80, "80" ) + PORT_DIPSETTING( 0xc0, "90" ) +INPUT_PORTS_END + +static INPUT_PORTS_START( lianhp3 ) + PORT_START("IN0") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_GAMBLE_BET ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_POKER_HOLD1 ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_GAMBLE_DEAL ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_POKER_HOLD2 ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_GAMBLE_TAKE ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_POKER_HOLD3 ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_POKER_HOLD4 ) + + PORT_START("IN1") + PORT_SERVICE_NO_TOGGLE( 0x01, IP_ACTIVE_LOW ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_POKER_HOLD5 ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_POKER_CANCEL ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(4) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_GAMBLE_HIGH ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_GAMBLE_D_UP ) + + PORT_START("IN2") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(4) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_GAMBLE_LOW ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(4) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(4) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(4) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_PLAYER(4) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON7 ) PORT_PLAYER(4) + + // SW1 on PCB is the reset button and SW2-5 are the DIP switches + // test mode shows SW1-4 for the DIPs + // thus to avoid user confusion let's follow the test mode + + PORT_START("DSW1") + PORT_DIPNAME( 0x03, 0x03, "Max Bet" ) PORT_DIPLOCATION("SW1:8,7") + PORT_DIPSETTING( 0x03, "100" ) + PORT_DIPSETTING( 0x02, "500" ) + PORT_DIPSETTING( 0x01, "1000" ) + PORT_DIPSETTING( 0x00, "1500" ) + PORT_DIPNAME( 0x04, 0x04, "Clear Point As" ) PORT_DIPLOCATION("SW1:6") + PORT_DIPSETTING( 0x04, "Coin" ) + PORT_DIPSETTING( 0x00, "Create Point" ) + PORT_DIPNAME( 0x08, 0x08, "Bonus Rate" ) PORT_DIPLOCATION("SW1:5") + PORT_DIPSETTING( 0x00, "32" ) + PORT_DIPSETTING( 0x08, "48" ) + PORT_DIPNAME( 0x10, 0x10, "Straight Double Up" ) PORT_DIPLOCATION("SW1:4") + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x10, DEF_STR( On ) ) + PORT_DIPNAME( 0x20, 0x20, "Double Up" ) PORT_DIPLOCATION("SW1:3") + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x20, DEF_STR( On ) ) + PORT_DIPNAME( 0x40, 0x40, "Card Type" ) PORT_DIPLOCATION("SW1:2") + PORT_DIPSETTING( 0x40, "Poker" ) + PORT_DIPSETTING( 0x00, "Animals" ) + PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:1") // not shown in test mode + PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + + PORT_START("DSW2") + PORT_DIPNAME( 0x03, 0x03, "Begin Bonus" ) PORT_DIPLOCATION("SW2:8,7") + PORT_DIPSETTING( 0x03, "2000" ) + PORT_DIPSETTING( 0x02, "4000" ) + PORT_DIPSETTING( 0x01, "6000" ) + PORT_DIPSETTING( 0x00, "8000" ) + PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:6") // not shown in test mode + PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:5") // not shown in test mode + PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:4") // not shown in test mode + PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0xe0, 0xe0, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW2:3,2,1") + PORT_DIPSETTING( 0xe0, "10" ) + PORT_DIPSETTING( 0xc0, "50" ) + PORT_DIPSETTING( 0xa0, "100" ) + PORT_DIPSETTING( 0x80, "250" ) + PORT_DIPSETTING( 0x60, "500" ) + PORT_DIPSETTING( 0x40, "1000" ) + PORT_DIPSETTING( 0x20, "2500" ) + PORT_DIPSETTING( 0x00, "5000" ) + + PORT_START("DSW3") + PORT_DIPNAME( 0x03, 0x03, "Min Bet" ) PORT_DIPLOCATION("SW3:8,7") + PORT_DIPSETTING( 0x03, "10" ) + PORT_DIPSETTING( 0x02, "20" ) + PORT_DIPSETTING( 0x01, "40" ) + PORT_DIPSETTING( 0x00, "50" ) + PORT_DIPNAME( 0x1c, 0x1c, "Double Up Rate" ) PORT_DIPLOCATION("SW3:6,5,4") + PORT_DIPSETTING( 0x00, "86" ) + PORT_DIPSETTING( 0x04, "87" ) + PORT_DIPSETTING( 0x08, "88" ) + PORT_DIPSETTING( 0x0c, "89" ) + PORT_DIPSETTING( 0x10, "90" ) + PORT_DIPSETTING( 0x14, "91" ) + PORT_DIPSETTING( 0x18, "92" ) + PORT_DIPSETTING( 0x1c, "93" ) + PORT_DIPNAME( 0xe0, 0xe0, "Play Rate" ) PORT_DIPLOCATION("SW3:3,2,1") + PORT_DIPSETTING( 0xe0, "0" ) + PORT_DIPSETTING( 0xc0, "1" ) + PORT_DIPSETTING( 0xa0, "10" ) + PORT_DIPSETTING( 0x80, "11" ) + PORT_DIPSETTING( 0x60, "100" ) + PORT_DIPSETTING( 0x40, "101" ) + PORT_DIPSETTING( 0x20, "110" ) + PORT_DIPSETTING( 0x00, "111" ) + + PORT_START("DSW4") + PORT_DIPNAME( 0x03, 0x03, "4 K Rate" ) PORT_DIPLOCATION("SW4:8,7") + PORT_DIPSETTING( 0x00, "70 (duplicate)" ) + PORT_DIPSETTING( 0x01, "70" ) + PORT_DIPSETTING( 0x02, "80" ) + PORT_DIPSETTING( 0x03, "90" ) + PORT_DIPNAME( 0x0c, 0x0c, "S F Rate" ) PORT_DIPLOCATION("SW4:6,5") + PORT_DIPSETTING( 0x00, "70 (duplicate)" ) + PORT_DIPSETTING( 0x04, "70" ) + PORT_DIPSETTING( 0x08, "80" ) + PORT_DIPSETTING( 0x0c, "90" ) + PORT_DIPNAME( 0x30, 0x30, "R S Rate" ) PORT_DIPLOCATION("SW4:4,3") + PORT_DIPSETTING( 0x00, "70 (duplicate)" ) + PORT_DIPSETTING( 0x10, "70" ) + PORT_DIPSETTING( 0x20, "80" ) + PORT_DIPSETTING( 0x30, "90" ) + PORT_DIPNAME( 0xc0, 0xc0, "5 K Rate" ) PORT_DIPLOCATION("SW4:2,1") + PORT_DIPSETTING( 0x00, "70 (duplicate)" ) + PORT_DIPSETTING( 0x40, "70" ) + PORT_DIPSETTING( 0x80, "80" ) + PORT_DIPSETTING( 0xc0, "90" ) +INPUT_PORTS_END + + +static const gfx_layout layout8x8x8 = +{ + 8,8, + RGN_FRAC(1,2), + 8, + { STEP8(0,1) }, + { + 8*0,8*1, + RGN_FRAC(1,2)+8*0,RGN_FRAC(1,2)+8*1, + 8*2,8*3, + RGN_FRAC(1,2)+8*2,RGN_FRAC(1,2)+8*3 + }, + { STEP8(0,8*4) }, + 8*8*4 +}; + + +static GFXDECODE_START( gfx_att ) + GFXDECODE_ENTRY( "tiles", 0, layout8x8x8, 0, 1 ) +GFXDECODE_END + +static GFXDECODE_START( gfx_att3 ) + GFXDECODE_ENTRY( "tiles", 0, gfx_8x8x8_raw, 0, 1 ) +GFXDECODE_END + + +void att_state::att(machine_config &config) +{ + Z80(config, m_maincpu, 12_MHz_XTAL / 4); + m_maincpu->set_addrmap(AS_PROGRAM, &att_state::program_map); + m_maincpu->set_addrmap(AS_IO, &att_state::att_io_map); + m_maincpu->set_vblank_int("screen", FUNC(att_state::nmi_line_pulse)); + + z80_device &audiocpu(Z80(config, "audiocpu", 12_MHz_XTAL / 4)); + audiocpu.set_addrmap(AS_PROGRAM, &att_state::att_audio_program_map); + audiocpu.set_addrmap(AS_IO, &att_state::att_audio_io_map); + audiocpu.set_periodic_int(FUNC(att_state::irq0_line_hold), attotime::from_hz(4 * 60)); // TODO: find IRQ source + + NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); + + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); + screen.set_refresh_hz(60); + screen.set_vblank_time(ATTOSECONDS_IN_USEC(0)); + screen.set_size(512, 256); + screen.set_visarea(0, 512-1, 0, 256-1); + screen.set_screen_update(FUNC(att_state::screen_update)); + + GFXDECODE(config, "gfxdecode", "palette", gfx_att); + + PALETTE(config, "palette").set_entries(0x100); + + ramdac_device &ramdac(RAMDAC(config, "ramdac", 0, "palette")); + ramdac.set_addrmap(0, &att_state::ramdac_map); + + GENERIC_LATCH_8(config, "soundlatch").data_pending_callback().set_inputline("audiocpu", INPUT_LINE_NMI); + + SPEAKER(config, "mono").front_center(); + + YM2413(config, "ym2413", 3.579545_MHz_XTAL).add_route(ALL_OUTPUTS, "mono", 1.0); +} + +void att_state::att3(machine_config &config) +{ + Z80(config, m_maincpu, 12_MHz_XTAL / 2); + m_maincpu->set_addrmap(AS_PROGRAM, &att_state::program_map); + m_maincpu->set_addrmap(AS_IO, &att_state::att3_io_map); + m_maincpu->set_vblank_int("screen", FUNC(att_state::nmi_line_pulse)); + + NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); + + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); + screen.set_refresh_hz(60); + screen.set_vblank_time(ATTOSECONDS_IN_USEC(0)); + screen.set_size(512, 256); + screen.set_visarea(0, 512-1, 0, 256-1); + screen.set_screen_update(FUNC(att_state::screen_update)); + + GFXDECODE(config, "gfxdecode", "palette", gfx_att3); + + PALETTE(config, "palette").set_entries(0x100); + + ramdac_device &ramdac(RAMDAC(config, "ramdac", 0, "palette")); + ramdac.set_addrmap(0, &att_state::ramdac_map); + + SPEAKER(config, "mono").front_center(); + + OKIM6295(config, "oki", 12_MHz_XTAL / 12, okim6295_device::PIN7_HIGH).add_route(ALL_OUTPUTS, "mono", 1.0); +} + + +/* +Lian Huan Pao, ATT III, 2010 +Hardware Info By Guru +--------------------- + +ATT + |--------------------------------| +|-| LM386 VOL 61256 Z80A| +|1 78L05 | +|0 GAL GAL | +|W SW4 D32-06 | +|A SW3 UM70C171-08 +|Y SW2 3.579545MHz | +|-| SW1 | + | YM2413 D32-05 | + | ULN2003S | + | D32-04 | +|-| | +|2 D32-03 | +|2 | +|W D32-02 | +|A T518B | +|Y 61256| +| 12MHz EPM7128 | +|-| D32-01 61256| + | BATT | + |BUTTON 6116 Z80B| + |--------------------------------| +Notes: + Z80A - Sharp LH0080A Z80A CPU. Clock Input 3.000MHz [12/4] + Z80B - Sharp LH0080B Z80B CPU. Clock Input 3.000MHz [12/4] + YM2413 - Yamaha YM2413 OPLL FM Sound Chip. Clock Input 3.579545MHz + LM386 - LM386 0.5W Audio Power Amplifier + 61256 - 32kB x8-bit SRAM + 6116 - 6116 2kB x8-bit SRAM (Battery-Backed) + 78L05 - 5V Linear Regulator (TO92) + T518B - Mitsumi T518B Reset Chip + BUTTON - Push Button Reset and Clear NVRAM + D32* - ROMs + ULN2003S - 7-Channel Darlington Transistor Array (SOIC16) + UM70C171 - UMC UM70C171-80 Color Palette With Triple 6-Bit DAC + SW1-4 - 8-Position DIP Switch + EPM7128 - Altera MAX EPM7128 CPLD + BATT - CR2032 Coin Cell +*/ + +ROM_START( lianhp2 ) + ROM_REGION( 0x8000, "maincpu", 0 ) + ROM_LOAD( "d32-01-.u32", 0x0000, 0x8000, CRC(7f6f1b84) SHA1(daee04a8f77580e8aad99498bbbed14d7b0cde22) ) + + ROM_REGION( 0x8000, "audiocpu", 0 ) + ROM_LOAD( "d32-06-.u12", 0x0000, 0x8000, CRC(988515b1) SHA1(e833077885784c420c96903e46217a4292c9e783) ) // 1xxxxxxxxxxxxxx = 0xFF + + ROM_REGION( 0x80000, "tiles", 0 ) + ROM_LOAD16_BYTE( "d32-02-.u4", 0x00000, 0x20000, CRC(867258ad) SHA1(f4047d3c921263d0df34d4357203b3e15c8c8de2) ) // 1xxxxxxxxxxxxxxxxx = 0xFF + ROM_IGNORE( 0x20000 ) + ROM_LOAD16_BYTE( "d32-03-.u5", 0x00001, 0x20000, CRC(93574235) SHA1(0e82b52f4169e146d1b4386a68a1a023d31da6fd) ) // 1xxxxxxxxxxxxxxxxx = 0xFF + ROM_IGNORE( 0x20000 ) + ROM_LOAD16_BYTE( "d32-04-.u6", 0x40000, 0x20000, CRC(72915ae7) SHA1(8dedcb4f7c57896bf27743f96afbdcc298e06a47) ) // 1xxxxxxxxxxxxxxxxx = 0xFF + ROM_IGNORE( 0x20000 ) + ROM_LOAD16_BYTE( "d32-05-.u7", 0x40001, 0x20000, CRC(aab2bd04) SHA1(18dcb9a2d7338bb98b5399c30cfd6ad8ed750cce) ) // 1xxxxxxxxxxxxxxxxx = 0xFF + ROM_IGNORE( 0x20000 ) +ROM_END + +/* +Lian Huan Pao 3, Bordun, 2003? +Hardware Info By Guru +--------------------- + +TAIWAN ATT III +2010.12.18 +030514 + |--------------------------------| +|-| UPC1241H VOL ATT_III_1| +|1 C1815 78L05 | +|0 6295 | +|W 86171 | +|A ATT_III_2| +|Y A1117_3.3 | +|-| | + | | + | | + | 12MHz |---------| | +|-| | | | +|2 | ACTEL | | +|2 ULN2003 |A54SX16A | | +|W JC817 |-F QFP208| | +|A JC817 |---------| | +|Y JC817 SW2 | +| JC817 SW3 | +|-|JC817 Z80 24257 SW4 | + | SW1 6116 SW5 | + | BATT ATT_III_3 T518B | + |--------------------------------| +Notes: + Z80 - Toshiba TMPZ84C000AP-6 Z80B CPU. Clock Input 6.000MHz [12/2] + 6295 - Oki M6295 ADPCM Sample Player. Clock Input 1.000MHz [12/12]. Pin 7 HIGH + UPC1241H - NEC uPC1241H 7W Audio Power Amplifier + 24257 - Winbond W24257ak-15 32kB x8-bit SRAM + 6116 - 6116 2kB x8-bit SRAM (Battery-Backed) + 78L05 - 5V Linear Regulator (TO92) + T518B - Mitsumi T518B Reset Chip + ATT_III* - ROMs; 3=Z80 Program, 2=Graphics, 1=Oki Samples + ULN2003 - 7-Channel Darlington Transistor Array + 86171 - HMC HM86171-80 Color Palette With Triple 6-Bit DAC + SW1 - Push Button Reset and Clear NVRAM + SW2-5 - 8-Position DIP Switch + ACTEL - Actel A54SX16A-F QFP208 FPGA + BATT - 3.6V Nicad Barrel Battery + C1815 - 2SC1815 General-Purpose NPN Transistor + A1117_3.3 - 3.3V Linear Regulator for powering FPGA + JC817 - Kento JC817 Photo-Coupler (equivalent to Sharp PC817X) +*/ + +ROM_START( lianhp3 ) + ROM_REGION( 0x8000, "maincpu", 0 ) + ROM_LOAD( "att-iii_3.bin", 0x0000, 0x8000, CRC(9041bfa9) SHA1(047046f8c533ed00a06e2d3cb6328a517ba1e6c2) ) + + ROM_REGION( 0x80000, "tiles", 0 ) + ROM_LOAD( "att-iii_2.bin", 0x00000, 0x80000, CRC(53baa37b) SHA1(548a9d6e01d31d65bd2c35be16778cbc5a315b54) ) + + ROM_REGION( 0x80000, "oki", 0 ) + ROM_LOAD( "att-iii_1.bin", 0x00000, 0x80000, CRC(05b3974c) SHA1(70feb9c9fc8d7619838319696e10d65ef55dadfc) ) +ROM_END + +} // anonymous namespace + + +GAME( 200?, lianhp2, 0, att, lianhp2, att_state, empty_init, ROT0, "Bordun", "Lian Huan Pao - ATT II", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) // audio IRQ timing +GAME( 2003, lianhp3, 0, att3, lianhp3, att_state, empty_init, ROT0, "Bordun", "Lian Huan Pao - ATT III", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/misc/skylncr.cpp b/src/mame/bordun/skylncr.cpp similarity index 94% rename from src/mame/misc/skylncr.cpp rename to src/mame/bordun/skylncr.cpp index 2a044cd44c8db..d891b215bb954 100644 --- a/src/mame/misc/skylncr.cpp +++ b/src/mame/bordun/skylncr.cpp @@ -152,23 +152,24 @@ class skylncr_state : public driver_device m_decrypted_opcodes(*this, "decrypted_opcodes") { } - void neraidou(machine_config &config); - void sstar97(machine_config &config); - void bdream97(machine_config &config); - void skylncr(machine_config &config); - void mbutrfly(machine_config &config); - void olymp(machine_config &config); - - void init_blshark(); - void init_butrfly(); - void init_leadera(); - void init_mbutrfly() { save_item(NAME(m_mbutrfly_prot)); } - void init_miaction(); - void init_olymp(); - void init_sonikfig(); - void init_speedway(); - void init_speedwaya(); - void init_superb2k(); + void neraidou(machine_config &config) ATTR_COLD; + void sstar97(machine_config &config) ATTR_COLD; + void bdream97(machine_config &config) ATTR_COLD; + void skylncr(machine_config &config) ATTR_COLD; + void mbutrfly(machine_config &config) ATTR_COLD; + void olymp(machine_config &config) ATTR_COLD; + + void init_blshark() ATTR_COLD; + void init_butrfly() ATTR_COLD; + void init_leadera() ATTR_COLD; + void init_mbutrfly() ATTR_COLD { save_item(NAME(m_mbutrfly_prot)); } + void init_miaction() ATTR_COLD; + void init_olymp() ATTR_COLD; + void init_sonikfig() ATTR_COLD; + void init_speedway() ATTR_COLD; + void init_speedwaya() ATTR_COLD; + void init_sstar97a() ATTR_COLD; + void init_superb2k() ATTR_COLD; int mbutrfly_prot_r(); @@ -2053,9 +2054,9 @@ ROM_END */ ROM_START( sstar97 ) - ROM_REGION( 0x80000, "maincpu", 0 ) + ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASE00 ) ROM_LOAD( "27256.u15", 0x0000, 0x8000, CRC(a5da4f92) SHA1(82ac70bd379649f130db017aa226d0247db0f3cd) ) - ROM_LOAD( "unknown.u48", 0x8000, 0x8000, BAD_DUMP CRC(9f4c02e3) SHA1(05975184130ea7dd3bb5d32eff77b585bd53e6b5) ) // palette borrowed from other game + ROM_LOAD( "unknown.u48", 0xc000, 0x4000, CRC(39df04c6) SHA1(1056b1ecb60f69fa1d4bcf1629913d21f5ce6f50) ) ROM_REGION( 0x80000, "gfx1", 0 ) // All ROMs are 28-pins mask ROMs dumped as Fujitsu MB831000 or TC531000 (mask ROM). ROM_LOAD16_BYTE( "bor_dun_4.u23", 0x00000, 0x20000, CRC(d0d0ead1) SHA1(00bfe691cb9020c5d7e21d80a1e059ea2155aad8) ) @@ -2070,6 +2071,85 @@ ROM_START( sstar97 ) ROM_LOAD16_BYTE( "bor_dun_5.u22", 0x40001, 0x20000, CRC(ca17a632) SHA1(d491310ccdbe9b59a1e607f9254646f20700d79d) ) ROM_END +/* +明星 97 (Ming Xing 97) /Super Star 97, Bordun, 1997 +Hardware Info by Guru +--------------------- + +PCB#: BORDUN SUPER STAR 97 + |--------------------------------------------| + | 6116 101.U26 | +|-|TA8201 VOL | +|1 6116 102.U25 | +|0 | +|W KC89C72 6116 103.U24 | +|A | +|Y 6116 104.U23 | +|-| SW4 6116 | + | |------| 105.U22 | +|-| SW3 |XILINX| | +|M |XC2064| 106.U21 | +|A SW2 | | | +|H M5M82C255 |------| 107.U20 | +|J SW1 PAL16V8H | +|O 108.U19 | +|N 110.U48 6116 | +|G T518B GAL20V8B KDA0476 12MHz| +|-| BATT KDA0476 | + |SW5 Z80 109.U15* | + |--------------------------------------------| +Notes: + Z80 - NEC D780C-2 Z80B CPU. Clock 3.0000MHz [12/4] + KC89C72 - Clone of AY-3-8910. Clock 1.500MHz [12/8] + M5M82C255 - Mitsubishi M5M82C255 CMOS Programmable Peripheral Interface. Equivalent to 2x 82C55. + XC2064 - Xilinx XC2064 FPGA + 6116 - 2kB x8-bit SRAM. Note 6116 near U48 is battery-backed. + KDA0476 - Samsung KDA0476BCN-66 Color Palette With Triple 6-Bit DAC (same as HMC HM86171-80) + Note there are 2 chips on this PCB. + TA8201 - Toshiba TA8201 17W BTL Audio Power Amplifier + T518B - Mitsumi T518B Reset Chip (TO92) + BATT - 3.6V Nicad Barrel Battery. Provides power to 6116 near U48. + SW1-4 - 8-Position DIP Switch + SW5 - Push button for Reset and NVRAM Clear + 101-108 - Macronix MX28F1000 128kB x8-bit EEPROM (Graphics) + 109 - 27C512 on plug-in daughterboard with two PALs (Main Program) + 110 - 27C128 16kB x8-bit EPROM (Palette) +*/ + +ROM_START( sstar97a ) + ROM_REGION( 0x14000, "maincpu", ROMREGION_ERASE00 ) + ROM_LOAD( "109.u15", 0x04000, 0x04000, CRC(ed3a645a) SHA1(daffc12574491ee6aacc144e633792d9eab6eb6e) ) // TODO: decrambling not correct, seems two contain two programs + ROM_CONTINUE( 0x00000, 0x04000 ) + ROM_CONTINUE( 0x0c000, 0x04000 ) + ROM_CONTINUE( 0x08000, 0x04000 ) + ROM_LOAD( "110.u48", 0x10000, 0x04000, CRC(39df04c6) SHA1(1056b1ecb60f69fa1d4bcf1629913d21f5ce6f50) ) // TODO: load this correctly once descrambling of the first ROM is figured out + + ROM_REGION( 0x80000, "gfx1", 0 ) + ROM_LOAD16_BYTE( "104.u23", 0x00000, 0x20000, CRC(d0d0ead1) SHA1(00bfe691cb9020c5d7e21d80a1e059ea2155aad8) ) + ROM_LOAD16_BYTE( "102.u25", 0x00001, 0x20000, CRC(2b0f07b5) SHA1(9bcde623e53697c4b68d2f083f6254596aee64eb) ) + ROM_LOAD16_BYTE( "103.u24", 0x40000, 0x20000, CRC(3c7da3f1) SHA1(8098b33a779fb697984b97f2d7edb9874e6e19d9) ) + ROM_LOAD16_BYTE( "101.u26", 0x40001, 0x20000, CRC(36efdca6) SHA1(e614fbba77e5c7a1e7a1d2970b4f945ee0468196) ) + + ROM_REGION( 0x80000, "gfx2", 0 ) + ROM_LOAD16_BYTE( "108.u19", 0x00000, 0x20000, CRC(adf0b7ce) SHA1(41d9fb16eb20e1fd2960117b7e4ea23a97b88961) ) + ROM_LOAD16_BYTE( "106.u21", 0x00001, 0x20000, CRC(37be2cbe) SHA1(78acda58aab605cb992c3b9fbaf18d38f768ed1a) ) + ROM_LOAD16_BYTE( "107.u20", 0x40000, 0x20000, CRC(43908665) SHA1(41b9cee0723d9da6934ab7934012fb1625a8f080) ) + ROM_LOAD16_BYTE( "105.u22", 0x40001, 0x20000, CRC(ca17a632) SHA1(d491310ccdbe9b59a1e607f9254646f20700d79d) ) +ROM_END + + +// PCB has a Z84C0008PEC, 2x 82C55AC-2, AT89C2051 MCU, ATF1508AS EEPLD, 24C04AN, JFC 95101 (AY-8910 clone), Altera EPM7032LC44-15 +ROM_START( sstar97jb ) + ROM_REGION( 0x20000, "maincpu", ROMREGION_ERASE00 ) + ROM_LOAD( "star97jianan.u6", 0x00000, 0x20000, CRC(23904300) SHA1(8d4c9478250aaa1f7abdc2fd84a1e83be61723a0) ) // encrypted, address line based + + ROM_REGION( 0x80000, "gfx1", 0 ) + ROM_LOAD( "star97jianan.u8", 0x00000, 0x80000, CRC(644f6ca8) SHA1(7d0b8c2c488f4169018e5bf861dc73eaeef9d9df) ) + + ROM_REGION( 0x80000, "gfx2", 0 ) + ROM_LOAD( "star97jianan.u9", 0x00000, 0x80000, CRC(31289532) SHA1(27243de8e79c552ba71aa8ea0ee7197228b55528) ) +ROM_END + /* 蝴蝶梦 97 (Húdié Mèng 97) Game is encrypted and needs better decoded graphics. @@ -2319,6 +2399,17 @@ void skylncr_state::init_sonikfig() } } +void skylncr_state::init_sstar97a() +{ + uint8_t *const ROM = memregion("maincpu")->base(); + for (unsigned x = 0; x < 0x10000; x += 4) + { + std::swap(ROM[x + 0], ROM[x + 2]); + std::swap(ROM[x + 1], ROM[x + 3]); + } +} + + void skylncr_state::init_miaction() /* Encryption: @@ -2508,6 +2599,8 @@ GAME( 199?, neraidou, 0, neraidou, neraidou, skylncr_state, empty_init, GAME( 199?, miaction, 0, skylncr, skylncr, skylncr_state, init_miaction, ROT0, "Vegas", "Missing In Action", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) GAME( 199?, tigerslt, 0, skylncr, skylncr, skylncr_state, init_miaction, ROT0, "bootleg", "Tiger (slot)", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) GAME( 199?, sstar97, 0, sstar97, sstar97, skylncr_state, empty_init, ROT0, "Bordun International", "Super Star 97 / Ming Xing 97 (version V153B)", MACHINE_SUPPORTS_SAVE ) +GAME( 199?, sstar97a, sstar97, sstar97, sstar97, skylncr_state, init_sstar97a, ROT0, "Bordun International", "Super Star 97 / Ming Xing 97 (version V168A)", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) +GAME( 199?, sstar97jb, sstar97, sstar97, sstar97, skylncr_state, empty_init, ROT0, "Bordun International", "Super Star 97 / Ming Xing 97 Jianan Ban", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) // needs decryption GAME( 1995, bdream97, 0, bdream97, skylncr, skylncr_state, empty_init, ROT0, "bootleg (KKK)", "Hudie Meng 97", MACHINE_IMPERFECT_GRAPHICS | MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) GAME( 2000?,olymp, 0, olymp, skylncr, skylncr_state, init_olymp, ROT0, "Z Games", "Olympus (Z Games, version 10)", MACHINE_WRONG_COLORS | MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) // Still has Bordun International 1992 strings GAME( 2000, sonikfig, 0, skylncr, sonikfig, skylncr_state, init_sonikfig, ROT0, "Z Games", "Sonik Fighter (version 02, encrypted)", MACHINE_WRONG_COLORS | MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/capcom/alien.cpp b/src/mame/capcom/alien.cpp index 1b9d14001c4ba..129e5ba58f963 100644 --- a/src/mame/capcom/alien.cpp +++ b/src/mame/capcom/alien.cpp @@ -567,6 +567,21 @@ ROM_START( dkjfever ) ROM_COPY( "ymz770_flash1", 0, 0, 0x800000 ) ROM_END +ROM_START( katochan ) + ROM_REGION32_LE( 0x1000000, "maincpu", 0 ) // BIOS and game code/data + ROM_LOAD32_WORD( "spk_04.ic30", 0x000000, 0x400000, CRC(46f46ad6) SHA1(131d12a7903ca3d6ee69cb9f1e8fe067302a31c5) ) + ROM_LOAD32_WORD( "spk_05.ic33", 0x000002, 0x400000, CRC(10a6bd39) SHA1(0a0d0f35408733dc77b0e7e06abde35247d4bd75) ) + ROM_LOAD32_WORD( "spk_06.ic39", 0x800000, 0x400000, CRC(f3e08f70) SHA1(fc50dad40e29edcb4bac544064529196e4e46065) ) + ROM_LOAD32_WORD( "spk_07.ic42", 0x800002, 0x400000, CRC(54ce0143) SHA1(8e8cc80f31f3ebe4a1a51aee554ab012a2bc6a66) ) + + ROM_REGION( 0x800100, "ymz770_flash1", ROMREGION_ERASEFF ) + ROM_LOAD16_WORD_SWAP( "spk_01.ic31", 0x000000, 0x400000, CRC(96e2d8d0) SHA1(3437b4dd7f1a7901cb764b9690931bfee1ceee25) ) + ROM_LOAD16_WORD_SWAP( "spk_02.ic38", 0x400000, 0x400000, CRC(3660a0d1) SHA1(0877eaca4665797c1c70cdf9a7ffafbcab754a89) ) + + ROM_REGION( 0x800000, "ymz770", 0 ) + ROM_COPY( "ymz770_flash1", 0, 0, 0x800000 ) +ROM_END + ROM_START( mariojjl ) ROM_REGION32_LE( 0x1000000, "maincpu", 0 ) ROM_LOAD32_WORD( "spm_04c.ic30", 0x000000, 0x400000, CRC(159e912d) SHA1(5db1434d34e52f9c35d71e05675dd035765d2e6f) ) @@ -711,6 +726,7 @@ GAME( 2004, masmarios, 0, alien, alien, alien_state, empty_init, GAME( 2005, masmario2, 0, masmario2, alien, alien_state, empty_init, ROT0, "Nintendo / Capcom", "Super Mario Fushigi no Korokoro Party 2", MACHINE_NO_SOUND | MACHINE_NOT_WORKING ) // Medalusion 1 GAME( 2005, dkjfever, 0, alien, alien, alien_state, empty_init, ROT0, "Nintendo / Capcom", "Donkey Kong Jungle Fever (Ver.1.000, 2005/08/03)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING ) // ドンキーコングジャングルフィーバー +GAME( 2004, katochan, 0, alien, alien, alien_state, empty_init, ROT0, "Capcom", "Nihonzenkoku-katochan-no-kurukuru-ressya-de-Pe! (Ver.1.00, 2004/10/24)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING ) // 日本全国加トちゃんのくるくる列車でペ GAME( 2006, mariojjl, 0, alien, alien, alien_state, empty_init, ROT0, "Nintendo / Capcom", "Super Mario Fushigi no JanJanLand (Ver.1.00C, 2006/08/29)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING ) GAME( 2005, mmaruchan, 0, alien, alien, alien_state, empty_init, ROT0, "Capcom", "Chibi Maruko-chan ~Minna de Sugoroku Asobi~ no Maki (Ver.1.00B, 2005/06/22)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING ) // ちびまる子ちゃん「みんなですごろく遊び」の巻 GAME( 2004, mmaruchana,mmaruchan,alien, alien, alien_state, empty_init, ROT0, "Capcom", "Chibi Maruko-chan ~Minna de Sugoroku Asobi~ no Maki (Ver.1.00A, 2004/04/20)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING ) // ちびまる子ちゃん「みんなですごろく遊び」の巻 diff --git a/src/mame/capcom/cps1.cpp b/src/mame/capcom/cps1.cpp index 2f5d18934a177..1a77f2ac80b5a 100644 --- a/src/mame/capcom/cps1.cpp +++ b/src/mame/capcom/cps1.cpp @@ -15024,7 +15024,7 @@ GAME( 1991, 3wondersr1, 3wonders, cps1_10MHz, 3wonders, cps_state, init_cps1, GAME( 1991, 3wondersu, 3wonders, cps1_10MHz, 3wonders, cps_state, init_cps1, ROT0, "Capcom", "Three Wonders (USA 910520)", MACHINE_SUPPORTS_SAVE ) GAME( 1991, wonder3, 3wonders, cps1_10MHz, 3wonders, cps_state, init_cps1, ROT0, "Capcom", "Wonder 3 (Japan 910520)", MACHINE_SUPPORTS_SAVE ) GAME( 1991, 3wondersb, 3wonders, cps1_10MHz, 3wonders, cps_state, init_cps1, ROT0, "bootleg", "Three Wonders (bootleg)", MACHINE_SUPPORTS_SAVE ) // 910520 - based on World version -GAME( 1991, 3wondersbi, 3wonders, cps1_10MHz, 3wonders, cps_state, init_cps1, ROT0, "bootleg (Impeuropex)", "Three Wonders (Italian bootleg)", MACHINE_NOT_WORKING |MACHINE_SUPPORTS_SAVE ) // 910520 - based on World version +GAME( 1991, 3wondersbi, 3wonders, cps1_10MHz, 3wonders, cps_state, init_cps1, ROT0, "bootleg (Electronic Devices)", "Three Wonders (Italian bootleg)", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) // 910520 - based on World version GAME( 1991, 3wondersh, 3wonders, cps1_10MHz, 3wonders, cps_state, init_cps1, ROT0, "bootleg", "Three Wonders (hack)", MACHINE_SUPPORTS_SAVE ) // 910520 - based on World version GAME( 1991, kod, 0, cps1_10MHz, kod, cps_state, init_cps1, ROT0, "Capcom", "The King of Dragons (World 910805)", MACHINE_SUPPORTS_SAVE ) // "ETC" GAME( 1991, kodr1, kod, cps1_10MHz, kodr1, cps_state, init_cps1, ROT0, "Capcom", "The King of Dragons (World 910711)", MACHINE_SUPPORTS_SAVE ) // "ETC" diff --git a/src/mame/capcom/cps1_v.cpp b/src/mame/capcom/cps1_v.cpp index c9f9158fc8b2a..d9be8c40d338f 100644 --- a/src/mame/capcom/cps1_v.cpp +++ b/src/mame/capcom/cps1_v.cpp @@ -411,8 +411,8 @@ maps for every game. Known Bug List ============== CPS2: -* CPS2 can do raster effects, certainly used by ssf2 (Cammy, DeeJay, T.Hawk levels), - msh (lava level, early in attract mode) and maybe others (xmcotaj, vsavj). +* CPS2 can do raster effects, certainly used by ssf2 (Cammy, DeeJay, T.Hawk stages), + msh (Blackheart lava stage) and maybe others (xmcotaj, vsavj). IRQ4 is some sort of scanline interrupt used for that purpose. * Its unknown what CPS2_OBJ_BASE register (0x400000) does but it is not a object base diff --git a/src/mame/capcom/gng.cpp b/src/mame/capcom/gng.cpp index 2b063bb2e8baf..6fbbaacc9da1f 100644 --- a/src/mame/capcom/gng.cpp +++ b/src/mame/capcom/gng.cpp @@ -738,6 +738,37 @@ ROM_START( gngbl ) ROM_LOAD( "14.84490.1l", 0x18000, 0x4000, CRC(7780a925) SHA1(3f129ca6d695548b659955fe538584bd9ac2ff17) ) // sprites 2 Plane 3-4 ROM_END +ROM_START( gngbla ) + ROM_REGION( 0x18000, "maincpu", 0 ) + ROM_LOAD( "3.10n", 0x04000, 0x4000, CRC(4f94130f) SHA1(6863fee3c97c76ba314ccbada7efacb6783e7d32) ) + ROM_LOAD( "4.9n", 0x08000, 0x4000, CRC(08322bef) SHA1(7107ed1f9eae2618b0d420d53af04df680bd4b99) ) + ROM_LOAD( "5.8n", 0x0c000, 0x4000, CRC(b6582167) SHA1(47be2b9d6a23fefcc131e10456c5ba71df5461c5) ) + ROM_LOAD( "1.13n", 0x10000, 0x4000, CRC(fd9a8dda) SHA1(222c3c759c6b60f82351b9e6bf748fb4872e82b4) ) + ROM_LOAD( "2.12n", 0x14000, 0x4000, CRC(f32c2e55) SHA1(0eab4b4e567f4b87233a5f259654c4dde4f8cad2) ) + + ROM_REGION( 0x10000, "audiocpu", 0 ) + ROM_LOAD( "6.13h", 0x00000, 0x8000, CRC(615f5b6f) SHA1(7ef9ec5c2072e21c787a6bbf700033f50c759c1d) ) + + ROM_REGION( 0x04000, "chars", 0 ) + ROM_LOAD( "7.10e", 0x00000, 0x4000, CRC(ecfccf07) SHA1(0a1518e19a2e0a4cc3dde4b9568202ea911b5ece) ) + + ROM_REGION( 0x18000, "tiles", 0 ) + ROM_LOAD( "19.e3", 0x00000, 0x4000, CRC(ddd56fa9) SHA1(f9d77eee5e2738b7e83ba02fcc55dd480391479f) ) // 0-1 Plane 1 + ROM_LOAD( "12.e1", 0x04000, 0x4000, CRC(7302529d) SHA1(8434c994cc55d2586641f3b90b6b15fd65dfb67c) ) // 2-3 Plane 1 + ROM_LOAD( "11.c3", 0x08000, 0x4000, CRC(20035bda) SHA1(bbb1fba0eb19471f66d29526fa8423ccb047bd63) ) // 0-1 Plane 2 + ROM_LOAD( "10.c1", 0x0c000, 0x4000, CRC(f12ba271) SHA1(1c42fa02cb27b35d10c3f7f036005e747f9f6b79) ) // 2-3 Plane 2 + ROM_LOAD( "9.b3", 0x10000, 0x4000, CRC(e525207d) SHA1(1947f159189b3a53f1251d8653b6e7c65c91fc3c) ) // 0-1 Plane 3 + ROM_LOAD( "8.1b", 0x14000, 0x4000, CRC(2d77e9b2) SHA1(944da1ce29a18bf0fc8deff78bceacba0bf23a07) ) // 2-3 Plane 3 + + ROM_REGION( 0x20000, "sprites", ROMREGION_ERASEFF ) + ROM_LOAD( "13.n4", 0x00000, 0x4000, CRC(4613afdc) SHA1(13e5a38a134bd7cfa16c63a18fa332c6d66b9345) ) // sprites 0 Plane 1-2 + ROM_LOAD( "14.n3", 0x04000, 0x4000, CRC(06d7e5ca) SHA1(9e06012bcd82f98fad43de666ef9a75979d940ab) ) // sprites 1 Plane 1-2 + ROM_LOAD( "15.n1", 0x08000, 0x4000, CRC(bc1fe02d) SHA1(e3a1421d465b87148ffa94f5673b2307f0246afe) ) // sprites 2 Plane 1-2 + ROM_LOAD( "16.l4", 0x10000, 0x4000, CRC(608d68d5) SHA1(af207f9ee2f93a0cf9cf25cfe72b0fdfe55481b8) ) // sprites 0 Plane 3-4 + ROM_LOAD( "17.l3", 0x14000, 0x4000, CRC(e80c3fca) SHA1(cb641c25bb04b970b2cbeca41adb792bbe142fb5) ) // sprites 1 Plane 3-4 + ROM_LOAD( "18.l1", 0x18000, 0x4000, CRC(7780a925) SHA1(3f129ca6d695548b659955fe538584bd9ac2ff17) ) // sprites 2 Plane 3-4 +ROM_END + ROM_START( gngprot ) ROM_REGION( 0x18000, "maincpu", 0 ) ROM_LOAD( "gg10n.bin", 0x04000, 0x4000, CRC(5d2a2c90) SHA1(39db20ebf95deb61d887bd88e3cb66c7bbd11f15) ) @@ -1088,6 +1119,7 @@ ROM_END GAME( 1985, gng, 0, gng, gng, gng_state, empty_init, ROT0, "Capcom", "Ghosts'n Goblins (World? set 1)", MACHINE_SUPPORTS_SAVE ) GAME( 1985, gnga, gng, gng, gng, gng_state, empty_init, ROT0, "Capcom", "Ghosts'n Goblins (World? set 2)", MACHINE_SUPPORTS_SAVE ) GAME( 1985, gngbl, gng, gng, gng, gng_state, empty_init, ROT0, "bootleg", "Ghosts'n Goblins (bootleg with Cross)", MACHINE_SUPPORTS_SAVE ) +GAME( 1985, gngbla, gng, gng, gng, gng_state, empty_init, ROT0, "bootleg", "Ghosts'n Goblins (bootleg)", MACHINE_SUPPORTS_SAVE ) GAME( 1985, gngprot, gng, gng, gng, gng_state, empty_init, ROT0, "Capcom", "Ghosts'n Goblins (prototype)", MACHINE_SUPPORTS_SAVE ) GAME( 1985, gngblita, gng, gng, gng, gng_state, empty_init, ROT0, "bootleg", "Ghosts'n Goblins (Italian bootleg, harder)", MACHINE_SUPPORTS_SAVE ) GAME( 1985, gngc, gng, gng, gng, gng_state, empty_init, ROT0, "Capcom", "Ghosts'n Goblins (World? set 3)", MACHINE_SUPPORTS_SAVE ) // rev c? diff --git a/src/mame/capcom/srumbler.cpp b/src/mame/capcom/srumbler.cpp index 584ab6cc12198..f5c270777814f 100644 --- a/src/mame/capcom/srumbler.cpp +++ b/src/mame/capcom/srumbler.cpp @@ -39,14 +39,14 @@ class srumbler_state : public driver_device public: srumbler_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_maincpu(*this, "maincpu"), + m_spriteram(*this, "spriteram"), m_gfxdecode(*this, "gfxdecode"), m_palette(*this, "palette"), m_backgroundram(*this, "backgroundram"), m_foregroundram(*this, "foregroundram"), m_proms(*this, "proms"), - m_rombank(*this, "%01x000", 5U) + m_rombank(*this, "bank%01x000", 5U) { } void srumbler(machine_config &config); diff --git a/src/mame/cinematronics/jack.cpp b/src/mame/cinematronics/jack.cpp index a67a74bcec6e2..45741f2be29b2 100644 --- a/src/mame/cinematronics/jack.cpp +++ b/src/mame/cinematronics/jack.cpp @@ -44,6 +44,7 @@ The 2 ay-8910 read ports are responsible for reading the sound commands. Todo: - fix striv hanging notes + - verify zzyzzyxx port b sound timer - fix tripool palette problems (see attract) The tripool driver used to have a hack making the vblank interrupt go off twice per frame, this made the game run way too fast, but no palette bug. @@ -84,8 +85,7 @@ Stephh's Notes: #include "jack.h" #include "cpu/z80/z80.h" -#include "sound/ay8910.h" -#include "screen.h" + #include "speaker.h" @@ -96,11 +96,29 @@ Stephh's Notes: * *************************************/ -uint8_t jack_state::timer_r() +uint8_t jack_state::jack_timer_r() +{ + // jack, tripool, sucasino: checks bit 3 + // zzyzzyxx, joinem, unclepoo: adds 0x0a and expects 0 (0xf6 + 0x0a) + // loverboy: checks bit 6 + // freeze, striv: unused + + // 74LS74 and 74LS393 to divide audiocpu clock + uint64_t input = m_audiocpu->total_cycles() >> 9; + + // 74LS393 2QD: 74LS90 in bi-quinary count mode + static const int lut_74ls90[10] = { 0, 2, 4, 6, 8, 1, 3, 5, 7, 9 }; + uint8_t output = lut_74ls90[(input >> 1) % 10]; + + // B3,B6,B7: 74LS90 QC,QD,QA + // B4: 74LS393 2QD + return (BIT(output, 0) << 7) | (BIT(output, 3) << 6) | ((input & 1) << 4) | (BIT(output, 2) << 3); +} + +uint8_t jack_state::zzyzzyxx_timer_r() { - /* wrong! there should be no need for timer_rate, the same function */ - /* should work for both games */ - return m_audiocpu->total_cycles() / m_timer_rate; + // zzyzzyxx sound driver doesn't work with how it's described in jack schematics, so let's use the old method + return m_audiocpu->total_cycles() / 32; } IRQ_CALLBACK_MEMBER(jack_state::jack_sh_irq_ack) @@ -244,8 +262,8 @@ void jack_state::sound_map(address_map &map) void jack_state::sound_io_map(address_map &map) { map.global_mask(0xff); - map(0x40, 0x40).rw("aysnd", FUNC(ay8910_device::data_r), FUNC(ay8910_device::data_w)); - map(0x80, 0x80).w("aysnd", FUNC(ay8910_device::address_w)); + map(0x40, 0x40).rw(m_aysnd, FUNC(ay8910_device::data_r), FUNC(ay8910_device::data_w)); + map(0x80, 0x80).w(m_aysnd, FUNC(ay8910_device::address_w)); } @@ -929,7 +947,7 @@ MACHINE_RESET_MEMBER(jack_state,joinem) void jack_state::jack(machine_config &config) { - constexpr XTAL MASTER_XTAL = 18_MHz_XTAL; // labeled "18MHz" in the schematics, but might this really be 18.432 (like Galaxian, etc.)? + constexpr XTAL MASTER_XTAL = 18_MHz_XTAL; // 18MHz in the schematics, should be correct /* basic machine hardware */ Z80(config, m_maincpu, MASTER_XTAL / 6); @@ -942,10 +960,10 @@ void jack_state::jack(machine_config &config) m_audiocpu->set_irq_acknowledge_callback(FUNC(jack_state::jack_sh_irq_ack)); /* video hardware */ - screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); - screen.set_raw(MASTER_XTAL / 3, 384, 0, 256, 264, 16, 240); - screen.set_screen_update(FUNC(jack_state::screen_update_jack)); - screen.set_palette(m_palette); + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_raw(MASTER_XTAL / 3, 384, 0, 256, 264, 16, 240); + m_screen->set_screen_update(FUNC(jack_state::screen_update_jack)); + m_screen->set_palette(m_palette); GFXDECODE(config, m_gfxdecode, m_palette, gfx_jack); PALETTE(config, m_palette).set_format(palette_device::BGR_233_inverted, 32); @@ -956,10 +974,10 @@ void jack_state::jack(machine_config &config) GENERIC_LATCH_8(config, m_soundlatch); m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, 0, ASSERT_LINE); - ay8910_device &aysnd(AY8910(config, "aysnd", MASTER_XTAL / 12)); - aysnd.port_a_read_callback().set(m_soundlatch, FUNC(generic_latch_8_device::read)); - aysnd.port_b_read_callback().set(FUNC(jack_state::timer_r)); - aysnd.add_route(ALL_OUTPUTS, "mono", 1.0); + AY8910(config, m_aysnd, MASTER_XTAL / 12); + m_aysnd->port_a_read_callback().set(m_soundlatch, FUNC(generic_latch_8_device::read)); + m_aysnd->port_b_read_callback().set(FUNC(jack_state::jack_timer_r)); + m_aysnd->add_route(ALL_OUTPUTS, "mono", 1.0); } void jack_state::treahunt(machine_config &config) @@ -968,6 +986,12 @@ void jack_state::treahunt(machine_config &config) m_maincpu->set_addrmap(AS_OPCODES, &jack_state::decrypted_opcodes_map); } +void jack_state::zzyzzyxx(machine_config &config) +{ + jack(config); + m_aysnd->port_b_read_callback().set(FUNC(jack_state::zzyzzyxx_timer_r)); +} + void jack_state::striv(machine_config &config) { @@ -980,7 +1004,7 @@ void jack_state::striv(machine_config &config) MCFG_MACHINE_RESET_OVERRIDE(jack_state,striv) /* video hardware */ - subdevice("screen")->set_screen_update(FUNC(jack_state::screen_update_striv)); + m_screen->set_screen_update(FUNC(jack_state::screen_update_striv)); } @@ -992,7 +1016,7 @@ INTERRUPT_GEN_MEMBER(jack_state::joinem_vblank_irq) device.execute().pulse_input_line(INPUT_LINE_NMI, attotime::zero); } -void jack_state::joinem(machine_config &config) +void jack_state::loverboy(machine_config &config) { jack(config); @@ -1005,7 +1029,7 @@ void jack_state::joinem(machine_config &config) MCFG_MACHINE_RESET_OVERRIDE(jack_state,joinem) /* video hardware */ - subdevice("screen")->set_screen_update(FUNC(jack_state::screen_update_joinem)); + m_screen->set_screen_update(FUNC(jack_state::screen_update_joinem)); m_gfxdecode->set_info(gfx_joinem); @@ -1014,6 +1038,11 @@ void jack_state::joinem(machine_config &config) MCFG_VIDEO_START_OVERRIDE(jack_state,joinem) } +void jack_state::joinem(machine_config &config) +{ + loverboy(config); + m_aysnd->port_b_read_callback().set(FUNC(jack_state::zzyzzyxx_timer_r)); +} void jack_state::unclepoo(machine_config &config) { @@ -1023,8 +1052,7 @@ void jack_state::unclepoo(machine_config &config) m_maincpu->set_addrmap(AS_PROGRAM, &jack_state::unclepoo_map); /* video hardware */ - subdevice("screen")->set_visarea(0*8, 32*8-1, 1*8, 31*8-1); - + m_screen->set_visarea(0*8, 32*8-1, 1*8, 31*8-1); m_palette->set_entries(256); } @@ -1515,19 +1543,7 @@ ROM_END * *************************************/ -void jack_state::init_jack() -{ - m_timer_rate = 256; -} - - -void jack_state::init_zzyzzyxx() -{ - m_timer_rate = 32; -} - - -void jack_state::treahunt_decode( ) +void jack_state::init_treahunt() { uint8_t *rom = memregion("maincpu")->base(); @@ -1559,19 +1575,13 @@ void jack_state::treahunt_decode( ) (~data & 0x81) | ((data & 0x02) << 3) | ((data & 0x04) << 4) | - (data & 0x28) | + (data & 0x28) | ((data & 0x10) >> 3) | ((data & 0x40) >> 4); } } } -void jack_state::init_treahunt() -{ - m_timer_rate = 256; - treahunt_decode(); -} - void jack_state::init_loverboy() { @@ -1589,8 +1599,6 @@ void jack_state::init_loverboy() uint8_t *ROM = memregion("maincpu")->base(); ROM[0x13] = 0x01; ROM[0x12] = 0x9d; - - m_timer_rate = 32; } @@ -1619,8 +1627,6 @@ void jack_state::init_striv() ROM[A] = bitswap<8>(data,0,2,5,1,3,6,4,7); } } - - m_timer_rate = 256; } @@ -1632,20 +1638,20 @@ void jack_state::init_striv() *************************************/ // YEAR NAME PARENT MACHINE INPUT CLASS INIT SCREEN COMPANY, FULLNAME, FLAGS -GAME( 1982, jack, 0, jack, jack, jack_state, init_jack, ROT90, "Hara Industries (Cinematronics license)", "Jack the Giantkiller (set 1)", MACHINE_SUPPORTS_SAVE ) -GAME( 1982, jack2, jack, jack, jack2, jack_state, init_jack, ROT90, "Hara Industries (Cinematronics license)", "Jack the Giantkiller (set 2)", MACHINE_SUPPORTS_SAVE ) -GAME( 1982, jack3, jack, jack, jack3, jack_state, init_jack, ROT90, "Hara Industries (Cinematronics license)", "Jack the Giantkiller (set 3)", MACHINE_SUPPORTS_SAVE ) +GAME( 1982, jack, 0, jack, jack, jack_state, empty_init, ROT90, "Hara Industries (Cinematronics license)", "Jack the Giantkiller (set 1)", MACHINE_SUPPORTS_SAVE ) +GAME( 1982, jack2, jack, jack, jack2, jack_state, empty_init, ROT90, "Hara Industries (Cinematronics license)", "Jack the Giantkiller (set 2)", MACHINE_SUPPORTS_SAVE ) +GAME( 1982, jack3, jack, jack, jack3, jack_state, empty_init, ROT90, "Hara Industries (Cinematronics license)", "Jack the Giantkiller (set 3)", MACHINE_SUPPORTS_SAVE ) GAME( 1982, treahunt, jack, treahunt, treahunt, jack_state, init_treahunt, ROT90, "Hara Industries", "Treasure Hunt", MACHINE_SUPPORTS_SAVE ) -GAME( 1982, zzyzzyxx, 0, jack, zzyzzyxx, jack_state, init_zzyzzyxx, ROT90, "Cinematronics / Advanced Microcomputer Systems", "Zzyzzyxx (set 1)", MACHINE_SUPPORTS_SAVE ) -GAME( 1982, zzyzzyxx2, zzyzzyxx, jack, zzyzzyxx, jack_state, init_zzyzzyxx, ROT90, "Cinematronics / Advanced Microcomputer Systems", "Zzyzzyxx (set 2)", MACHINE_SUPPORTS_SAVE ) -GAME( 1982, brix, zzyzzyxx, jack, zzyzzyxx, jack_state, init_zzyzzyxx, ROT90, "Cinematronics / Advanced Microcomputer Systems", "Brix", MACHINE_SUPPORTS_SAVE ) -GAME( 1984, freeze, 0, jack, freeze, jack_state, init_jack, ROT90, "Cinematronics", "Freeze", MACHINE_SUPPORTS_SAVE | MACHINE_NO_COCKTAIL ) -GAME( 1981, tripool, 0, jack, tripool, jack_state, init_jack, ROT90, "Noma (Casino Tech license)", "Tri-Pool: 3-In-One (Casino Tech)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) -GAME( 1981, tripoola, tripool, jack, tripool, jack_state, init_jack, ROT90, "Noma (Coastal Games license)", "Tri-Pool: 3-In-One (Coastal Games)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) -GAME( 1984, sucasino, 0, jack, sucasino, jack_state, init_jack, ROT90, "Data Amusement", "Super Casino", MACHINE_SUPPORTS_SAVE ) +GAME( 1982, zzyzzyxx, 0, zzyzzyxx, zzyzzyxx, jack_state, empty_init, ROT90, "Cinematronics / Advanced Microcomputer Systems", "Zzyzzyxx (set 1)", MACHINE_SUPPORTS_SAVE ) +GAME( 1982, zzyzzyxx2, zzyzzyxx, zzyzzyxx, zzyzzyxx, jack_state, empty_init, ROT90, "Cinematronics / Advanced Microcomputer Systems", "Zzyzzyxx (set 2)", MACHINE_SUPPORTS_SAVE ) +GAME( 1982, brix, zzyzzyxx, zzyzzyxx, zzyzzyxx, jack_state, empty_init, ROT90, "Cinematronics / Advanced Microcomputer Systems", "Brix", MACHINE_SUPPORTS_SAVE ) +GAME( 1984, freeze, 0, jack, freeze, jack_state, empty_init, ROT90, "Cinematronics", "Freeze", MACHINE_SUPPORTS_SAVE | MACHINE_NO_COCKTAIL ) +GAME( 1981, tripool, 0, jack, tripool, jack_state, empty_init, ROT90, "Noma (Casino Tech license)", "Tri-Pool: 3-In-One (Casino Tech)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) +GAME( 1981, tripoola, tripool, jack, tripool, jack_state, empty_init, ROT90, "Noma (Coastal Games license)", "Tri-Pool: 3-In-One (Coastal Games)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) +GAME( 1984, sucasino, 0, jack, sucasino, jack_state, empty_init, ROT90, "Data Amusement", "Super Casino", MACHINE_SUPPORTS_SAVE ) GAME( 1985, striv, 0, striv, striv, jack_state, init_striv, ROT270, "Nova du Canada", "Super Triv (English questions)", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) GAME( 1985, strivf, striv, striv, striv, jack_state, init_striv, ROT270, "Nova du Canada", "Super Triv (French questions)", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) // Hara Industries PCB -GAME( 1983, joinem, 0, joinem, joinem, jack_state, init_zzyzzyxx, ROT90, "Global Corporation", "Joinem", MACHINE_SUPPORTS_SAVE ) -GAME( 1983, unclepoo, 0, unclepoo, unclepoo, jack_state, init_zzyzzyxx, ROT90, "Diatec", "Uncle Poo", MACHINE_SUPPORTS_SAVE ) // based on Joinem? -GAME( 1983, loverboy, 0, joinem, loverboy, jack_state, init_loverboy, ROT90, "G.T Enterprise Inc", "Lover Boy", MACHINE_SUPPORTS_SAVE ) -GAME( 1993, trikitri, loverboy, joinem, loverboy, jack_state, init_loverboy, ROT90, "bootleg (DDT Enterprise Inc)", "Triki Triki (bootleg of Lover Boy)", MACHINE_SUPPORTS_SAVE ) +GAME( 1983, joinem, 0, joinem, joinem, jack_state, empty_init, ROT90, "Global Corporation", "Joinem", MACHINE_SUPPORTS_SAVE ) +GAME( 1983, unclepoo, 0, unclepoo, unclepoo, jack_state, empty_init, ROT90, "Diatec", "Uncle Poo", MACHINE_SUPPORTS_SAVE ) // based on Joinem? +GAME( 1983, loverboy, 0, loverboy, loverboy, jack_state, init_loverboy, ROT90, "G.T Enterprise Inc", "Lover Boy", MACHINE_SUPPORTS_SAVE ) +GAME( 1993, trikitri, loverboy, loverboy, loverboy, jack_state, init_loverboy, ROT90, "bootleg (DDT Enterprise Inc)", "Triki Triki (bootleg of Lover Boy)", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/cinematronics/jack.h b/src/mame/cinematronics/jack.h index 883c387ed3908..a7de37b3d8af0 100644 --- a/src/mame/cinematronics/jack.h +++ b/src/mame/cinematronics/jack.h @@ -12,7 +12,10 @@ #pragma once #include "machine/gen_latch.h" +#include "sound/ay8910.h" + #include "emupal.h" +#include "screen.h" #include "tilemap.h" class jack_state : public driver_device @@ -28,21 +31,23 @@ class jack_state : public driver_device m_colorram(*this, "colorram"), m_gfxdecode(*this, "gfxdecode"), m_palette(*this, "palette"), + m_screen(*this, "screen"), + m_aysnd(*this, "aysnd"), m_soundlatch(*this, "soundlatch"), m_decrypted_opcodes(*this, "decrypted_opcodes") { } - void joinem(machine_config &config); + void jack(machine_config &config); void treahunt(machine_config &config); - void unclepoo(machine_config &config); + void zzyzzyxx(machine_config &config); void striv(machine_config &config); - void jack(machine_config &config); + void joinem(machine_config &config); + void unclepoo(machine_config &config); + void loverboy(machine_config &config); - void init_zzyzzyxx(); - void init_striv(); void init_treahunt(); + void init_striv(); void init_loverboy(); - void init_jack(); private: /* device- and memory pointers */ @@ -54,14 +59,15 @@ class jack_state : public driver_device required_shared_ptr m_colorram; required_device m_gfxdecode; required_device m_palette; + required_device m_screen; + required_device m_aysnd; required_device m_soundlatch; optional_shared_ptr m_decrypted_opcodes; /* video-related */ - tilemap_t *m_bg_tilemap = nullptr; + tilemap_t *m_bg_tilemap = nullptr; /* misc */ - int m_timer_rate = 0; uint8_t m_joinem_nmi_enable = 0U; uint8_t m_joinem_palette_bank = 0U; int m_question_address = 0; @@ -76,7 +82,8 @@ class jack_state : public driver_device void jack_colorram_w(offs_t offset, uint8_t data); uint8_t jack_flipscreen_r(offs_t offset); void jack_flipscreen_w(offs_t offset, uint8_t data); - uint8_t timer_r(); + uint8_t jack_timer_r(); + uint8_t zzyzzyxx_timer_r(); TILE_GET_INFO_MEMBER(get_bg_tile_info); TILEMAP_MAPPER_MEMBER(tilemap_scan_cols_flipy); @@ -99,7 +106,6 @@ class jack_state : public driver_device INTERRUPT_GEN_MEMBER(joinem_vblank_irq); void jack_draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ); void joinem_draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ); - void treahunt_decode( ); void decrypted_opcodes_map(address_map &map) ATTR_COLD; void jack_map(address_map &map) ATTR_COLD; void joinem_map(address_map &map) ATTR_COLD; diff --git a/src/mame/cinematronics/jack_v.cpp b/src/mame/cinematronics/jack_v.cpp index 96e160ebc18a5..379d2517bc7e0 100644 --- a/src/mame/cinematronics/jack_v.cpp +++ b/src/mame/cinematronics/jack_v.cpp @@ -111,9 +111,6 @@ uint32_t jack_state::screen_update_striv(screen_device &screen, bitmap_ind16 &bi - - - /*************************************************************************** Joinem has a bit different video hardware with proms based palette, diff --git a/src/mame/cinematronics/leland.cpp b/src/mame/cinematronics/leland.cpp index f0cacf938407b..9dcc1b8e6e042 100644 --- a/src/mame/cinematronics/leland.cpp +++ b/src/mame/cinematronics/leland.cpp @@ -2,7 +2,7 @@ // copyright-holders:Aaron Giles,Paul Leaman /*************************************************************************** - Cinematronics/Leland driver + Cinematronics / Leland Cinemat System driver driver by Aaron Giles and Paul Leaman Games supported: diff --git a/src/mame/cinematronics/leland.h b/src/mame/cinematronics/leland.h index 7ac22c79d1c8d..5a65a19f453bf 100644 --- a/src/mame/cinematronics/leland.h +++ b/src/mame/cinematronics/leland.h @@ -2,7 +2,7 @@ // copyright-holders:Aaron Giles /************************************************************************* - Cinemat/Leland driver + Cinematronics / Leland Cinemat System driver *************************************************************************/ #ifndef MAME_CINEMATRONICS_LELAND_H @@ -164,7 +164,6 @@ class leland_state : public driver_device u8 m_sound_port_bank = 0U; u8 m_alternate_bank = 0U; u8 m_gfxbank = 0U; - u16 m_last_scanline = 0U; emu_timer *m_scanline_timer = nullptr; u8 cerberus_dial_1_r(); diff --git a/src/mame/cinematronics/leland_a.cpp b/src/mame/cinematronics/leland_a.cpp index 3fcbfab7302fc..e574747934eaf 100644 --- a/src/mame/cinematronics/leland_a.cpp +++ b/src/mame/cinematronics/leland_a.cpp @@ -2,7 +2,7 @@ // copyright-holders:Aaron Giles,Paul Leaman /*************************************************************************** - Cinemat/Leland driver + Cinematronics / Leland Cinemat System driver Leland sound hardware driver by Aaron Giles and Paul Leaman diff --git a/src/mame/cinematronics/leland_a.h b/src/mame/cinematronics/leland_a.h index a1653536b0f20..86387886a72a0 100644 --- a/src/mame/cinematronics/leland_a.h +++ b/src/mame/cinematronics/leland_a.h @@ -2,7 +2,9 @@ // copyright-holders:Aaron Giles /************************************************************************* - Cinemat/Leland driver + Cinematronics / Leland Cinemat System driver + + Leland sound hardware *************************************************************************/ #ifndef MAME_CINEMATRONICS_LELAND_A_H diff --git a/src/mame/cinematronics/leland_m.cpp b/src/mame/cinematronics/leland_m.cpp index 3cdd5eb2fff32..bd64cd6814f3c 100644 --- a/src/mame/cinematronics/leland_m.cpp +++ b/src/mame/cinematronics/leland_m.cpp @@ -2,9 +2,9 @@ // copyright-holders:Aaron Giles, Paul Leaman /*************************************************************************** - Cinemat/Leland driver + Cinematronics / Leland Cinemat System driver - driver by Aaron Giles and Paul Leaman + Leland machine hardware ***************************************************************************/ @@ -34,11 +34,9 @@ #define VERBOSE LOG_WARN #include "logmacro.h" -/* Internal routines */ - - +/* Internal routines */ /************************************* * @@ -105,7 +103,6 @@ u8 leland_state::cerberus_dial_2_r() * *************************************/ - void leland_state::alleymas_joystick_kludge(u8 data) { /* catch the case where they clear this memory location at PC $1827 and change */ @@ -416,7 +413,7 @@ void ataxx_state::machine_reset() TIMER_CALLBACK_MEMBER(leland_state::leland_interrupt_callback) { - int scanline = param; + u8 scanline = param; /* interrupts generated on the VA10 line, which is every */ /* 16 scanlines starting with scanline #8 */ @@ -424,15 +421,13 @@ TIMER_CALLBACK_MEMBER(leland_state::leland_interrupt_callback) /* set a timer for the next one */ scanline += 16; - if (scanline > 248) - scanline = 8; m_master_int_timer->adjust(m_screen->time_until_pos(scanline), scanline); } TIMER_CALLBACK_MEMBER(leland_state::ataxx_interrupt_callback) { - int scanline = param; + u8 scanline = param; /* interrupts generated according to the interrupt control register */ m_master->set_input_line(0, HOLD_LINE); @@ -859,6 +854,7 @@ void ataxx_state::ataxx_battery_ram_w(offs_t offset, u8 data) } else if ((m_master_bank & 0x30) == 0x20) { + m_screen->update_partial(m_screen->vpos() - 1); m_ataxx_qram[((m_master_bank & 0xc0) << 8) | offset] = data; m_tilemap->mark_tile_dirty(((m_master_bank & 0x80) << 8) | offset); } @@ -1208,8 +1204,11 @@ void ataxx_state::ataxx_master_output_w(offs_t offset, u8 data) break; case 0x08: /* */ - m_master_int_timer->adjust(m_screen->time_until_pos(data + 1), data + 1); + { + u8 scanline = data + 1; + m_master_int_timer->adjust(m_screen->time_until_pos(scanline), scanline); break; + } default: LOGMASKED(LOG_WARN, "Master I/O write offset %02X=%02X\n", offset, data); @@ -1410,9 +1409,8 @@ void leland_state::rotate_memory(const char *cpuname) int banks = (memregion(cpuname)->bytes() - startaddr) / 0x8000; u8 *ram = memregion(cpuname)->base(); u8 temp[0x2000]; - int i; - for (i = 0; i < banks; i++) + for (int i = 0; i < banks; i++) { memmove(temp, &ram[startaddr + 0x0000], 0x2000); memmove(&ram[startaddr + 0x0000], &ram[startaddr + 0x2000], 0x6000); diff --git a/src/mame/cinematronics/leland_v.cpp b/src/mame/cinematronics/leland_v.cpp index d9938e7141eb9..f25870e864be1 100644 --- a/src/mame/cinematronics/leland_v.cpp +++ b/src/mame/cinematronics/leland_v.cpp @@ -2,7 +2,7 @@ // copyright-holders:Aaron Giles /*************************************************************************** - Cinemat/Leland driver + Cinematronics / Leland Cinemat System driver Leland video hardware @@ -33,18 +33,17 @@ static constexpr int QRAM_SIZE = 0x10000; TIMER_CALLBACK_MEMBER(leland_state::scanline_callback) { - int scanline = param; + u8 scanline = param; + u8 last_scanline = scanline - 1; /* update the DACs */ if (!(m_dac_control & 0x01)) - m_dac[0]->write(m_video_ram[(m_last_scanline) * 256 + 160]); + m_dac[0]->write(m_video_ram[last_scanline << 8 | 0xa0]); if (!(m_dac_control & 0x02)) - m_dac[1]->write(m_video_ram[(m_last_scanline) * 256 + 161]); + m_dac[1]->write(m_video_ram[last_scanline << 8 | 0xa1]); - m_last_scanline = scanline; - - scanline = (scanline+1) % 256; + scanline++; /* come back at the next appropriate scanline */ m_scanline_timer->adjust(m_screen->time_until_pos(scanline), scanline); @@ -114,7 +113,6 @@ void leland_state::video_start() save_item(NAME(m_xscroll)); save_item(NAME(m_yscroll)); save_item(NAME(m_gfxbank)); - save_item(NAME(m_last_scanline)); for (u8 i = 0; i < 2; i++) { save_item(NAME(m_vram_state[i].m_addr), i); @@ -154,9 +152,7 @@ void ataxx_state::video_start() void leland_state::scroll_w(offs_t offset, u8 data) { - int scanline = m_screen->vpos(); - if (scanline > 0) - m_screen->update_partial(scanline - 1); + m_screen->update_partial(m_screen->vpos() - 1); /* adjust the proper scroll value */ switch (offset) @@ -185,12 +181,10 @@ void leland_state::scroll_w(offs_t offset, u8 data) void leland_state::gfx_port_w(u8 data) { - int scanline = m_screen->vpos(); - if (scanline > 0) - m_screen->update_partial(scanline - 1); - if (m_gfxbank != data) { + m_screen->update_partial(m_screen->vpos() - 1); + m_gfxbank = data; m_tilemap->mark_all_dirty(); } @@ -246,15 +240,20 @@ int leland_state::vram_port_r(offs_t offset, int num) break; default: - LOGMASKED(LOG_WARN, "%s: Warning: Unknown video port %02x read (address=%04x)\n", - machine().describe_context(), offset, addr); + if (!machine().side_effects_disabled()) + LOGMASKED(LOG_WARN, "%s: Warning: Unknown video port %02x read (address=%04x)\n", + machine().describe_context(), offset, addr); ret = 0; break; } - state->m_addr = addr; - if (addr >= 0xf000) - LOGMASKED(LOG_COMM, "%s:%s comm read %04X = %02X\n", machine().describe_context(), num ? "slave" : "master", addr, ret); + if (!machine().side_effects_disabled()) + { + state->m_addr = addr; + + if (addr >= 0xf000) + LOGMASKED(LOG_COMM, "%s:%s comm read %04X = %02X\n", machine().describe_context(), num ? "slave" : "master", addr, ret); + } return ret; } @@ -274,11 +273,7 @@ void leland_state::vram_port_w(offs_t offset, u8 data, int num) int inc = (offset >> 2) & 2; int trans = (offset >> 4) & num; - /* don't fully understand why this is needed. Isn't the - video RAM just one big RAM? */ - int scanline = m_screen->vpos(); - if (scanline > 0) - m_screen->update_partial(scanline - 1); + m_screen->update_partial(m_screen->vpos() - 1); if (addr >= 0xf000) LOGMASKED(LOG_COMM, "%s:%s comm write %04X = %02X\n", machine().describe_context(), num ? "slave" : "master", addr, data); @@ -508,7 +503,6 @@ void leland_state::leland_video(machine_config &config) PALETTE(config, m_palette).set_format(palette_device::BGR_233, 1024); SCREEN(config, m_screen, SCREEN_TYPE_RASTER); - m_screen->set_video_attributes(VIDEO_ALWAYS_UPDATE); m_screen->set_raw(14.318181_MHz_XTAL / 2, 424, 0, 320, 256, 0, 240); m_screen->set_screen_update(FUNC(leland_state::screen_update)); m_screen->set_palette(m_palette); diff --git a/src/mame/dataeast/btime.cpp b/src/mame/dataeast/btime.cpp index ea3cc298f1f07..ad7770fbd469c 100644 --- a/src/mame/dataeast/btime.cpp +++ b/src/mame/dataeast/btime.cpp @@ -2183,7 +2183,7 @@ GAME( 1982, btime2, btime, btime, btime, btime_state, init_btime, R GAME( 1982, btime3, btime, btime, btime3, btime_state, init_btime, ROT270, "Data East USA Inc.", "Burger Time (Data East USA)", MACHINE_SUPPORTS_SAVE ) GAME( 1982, btimem, btime, btime, btime3, btime_state, init_btime, ROT270, "Data East (Bally Midway license)", "Burger Time (Midway)", MACHINE_SUPPORTS_SAVE ) GAME( 1982, cookrace, btime, cookrace, cookrace, btime_state, init_cookrace, ROT270, "bootleg", "Cook Race", MACHINE_SUPPORTS_SAVE ) -GAME( 1981, tisland, 0, tisland, btime, btime_state, init_tisland, ROT270, "Data East Corporation", "Treasure Island", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) +GAME( 1981, tisland, 0, tisland, btime, btime_state, init_tisland, ROT270, "Data East Corporation", "Treasure Island (Data East)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) GAME( 1981, lnc, 0, lnc, lnc, btime_state, init_lnc, ROT270, "Data East Corporation", "Lock'n'Chase", MACHINE_SUPPORTS_SAVE ) GAME( 1982, protenn, 0, protenn, protenn, btime_state, init_protennb, ROT270, "Data East Corporation", "Pro Tennis (Japan)", MACHINE_SUPPORTS_SAVE ) GAME( 1982, protennb, protenn, protenn, protenn, btime_state, init_protennb, ROT270, "bootleg", "Tennis (bootleg of Pro Tennis)", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/dataeast/rohga.cpp b/src/mame/dataeast/rohga.cpp index 3f159d832db5c..a0f930863e62c 100644 --- a/src/mame/dataeast/rohga.cpp +++ b/src/mame/dataeast/rohga.cpp @@ -1,5 +1,5 @@ // license:BSD-3-Clause -// copyright-holders:Bryan McPhail +// copyright-holders: Bryan McPhail /*************************************************************************** Data East 'Rohga' era hardware: @@ -170,16 +170,16 @@ void rohga_state::rohga_map(address_map &map) map(0x200000, 0x20000f).w(m_deco_tilegen[0], FUNC(deco16ic_device::pf_control_w)); map(0x240000, 0x24000f).w(m_deco_tilegen[1], FUNC(deco16ic_device::pf_control_w)); - map(0x280000, 0x283fff).rw(FUNC(rohga_state::ioprot_r), FUNC(rohga_state::ioprot_w)).share("prot16ram"); /* Protection device */ + map(0x280000, 0x283fff).rw(FUNC(rohga_state::ioprot_r), FUNC(rohga_state::ioprot_w)).share("prot16ram"); // Protection device map(0x2c0000, 0x2c0001).portr("DSW3"); - map(0x300000, 0x300001).w(FUNC(rohga_state::rohga_buffer_spriteram16_w)); /* write 1 for sprite dma */ - map(0x310000, 0x310009).nopw(); /* Palette control? */ - map(0x31000a, 0x31000b).w(m_decocomn, FUNC(decocomn_device::palette_dma_w)); /* Write 1111 for dma? (Or any value?) */ - map(0x320000, 0x320001).nopw(); /* ? */ + map(0x300000, 0x300001).w(FUNC(rohga_state::rohga_buffer_spriteram16_w)); // write 1 for sprite DMA + map(0x310000, 0x310009).nopw(); // Palette control? + map(0x31000a, 0x31000b).w(m_decocomn, FUNC(decocomn_device::palette_dma_w)); // Write 1111 for DMA? (Or any value?) + map(0x320000, 0x320001).nopw(); // ? map(0x322000, 0x322001).w(m_decocomn, FUNC(decocomn_device::priority_w)); - map(0x321100, 0x321101).r(FUNC(rohga_state::irq_ack_r)); /* Irq ack? Value not used */ + map(0x321100, 0x321101).r(FUNC(rohga_state::irq_ack_r)); // IRQ ack? Value not used map(0x3c0000, 0x3c1fff).rw(m_deco_tilegen[0], FUNC(deco16ic_device::pf1_data_r), FUNC(deco16ic_device::pf1_data_w)); map(0x3c2000, 0x3c2fff).rw(m_deco_tilegen[0], FUNC(deco16ic_device::pf2_data_r), FUNC(deco16ic_device::pf2_data_w)); @@ -193,7 +193,7 @@ void rohga_state::rohga_map(address_map &map) map(0x3d0000, 0x3d07ff).ram().share("spriteram1"); map(0x3e0000, 0x3e1fff).ram().w(m_decocomn, FUNC(decocomn_device::buffered_palette_w)).share("paletteram"); - map(0x3f0000, 0x3f3fff).ram(); /* Main ram */ + map(0x3f0000, 0x3f3fff).ram(); // Main RAM } @@ -206,27 +206,27 @@ void rohga_state::wizdfire_map(address_map &map) map(0x208000, 0x208fff).rw(m_deco_tilegen[1], FUNC(deco16ic_device::pf1_data_r), FUNC(deco16ic_device::pf1_data_w)); map(0x20a000, 0x20afff).rw(m_deco_tilegen[1], FUNC(deco16ic_device::pf2_data_r), FUNC(deco16ic_device::pf2_data_w)); - map(0x20b000, 0x20b3ff).nopw(); /* ? Always 0 written */ + map(0x20b000, 0x20b3ff).nopw(); // ? Always 0 written map(0x20c000, 0x20c7ff).ram().share(m_pf_rowscroll[2]); map(0x20e000, 0x20e7ff).ram().share(m_pf_rowscroll[3]); map(0x300000, 0x30000f).w(m_deco_tilegen[0], FUNC(deco16ic_device::pf_control_w)); map(0x310000, 0x31000f).w(m_deco_tilegen[1], FUNC(deco16ic_device::pf_control_w)); - map(0x320000, 0x320001).w(m_decocomn, FUNC(decocomn_device::priority_w)); /* Priority */ - map(0x320002, 0x320003).nopw(); /* ? */ - map(0x320004, 0x320005).w(FUNC(rohga_state::irq_ack_w)); /* VBL IRQ ack */ + map(0x320000, 0x320001).w(m_decocomn, FUNC(decocomn_device::priority_w)); // Priority + map(0x320002, 0x320003).nopw(); // ? + map(0x320004, 0x320005).w(FUNC(rohga_state::irq_ack_w)); // VBL IRQ ack map(0x340000, 0x3407ff).ram().share("spriteram1"); - map(0x350000, 0x350001).w("spriteram1", FUNC(buffered_spriteram16_device::write)); /* Triggers DMA for spriteram */ + map(0x350000, 0x350001).w("spriteram1", FUNC(buffered_spriteram16_device::write)); // Triggers DMA for spriteram map(0x360000, 0x3607ff).ram().share("spriteram2"); - map(0x370000, 0x370001).w("spriteram2", FUNC(buffered_spriteram16_device::write)); /* Triggers DMA for spriteram */ + map(0x370000, 0x370001).w("spriteram2", FUNC(buffered_spriteram16_device::write)); // Triggers DMA for spriteram map(0x380000, 0x381fff).ram().w(m_decocomn, FUNC(decocomn_device::buffered_palette_w)).share("paletteram"); map(0x390008, 0x390009).w(m_decocomn, FUNC(decocomn_device::palette_dma_w)); map(0xfdc000, 0xfe3fff).ram(); - map(0xfe4000, 0xfe7fff).rw(FUNC(rohga_state::ioprot_r), FUNC(rohga_state::ioprot_w)).share("prot16ram"); /* Protection device */ + map(0xfe4000, 0xfe7fff).rw(FUNC(rohga_state::ioprot_r), FUNC(rohga_state::ioprot_w)).share("prot16ram"); // Protection device map(0xfe8000, 0xffffff).ram(); } @@ -248,20 +248,20 @@ void rohga_state::nitrobal_map(address_map &map) map(0x300000, 0x30000f).w(m_deco_tilegen[0], FUNC(deco16ic_device::pf_control_w)); map(0x310000, 0x31000f).w(m_deco_tilegen[1], FUNC(deco16ic_device::pf_control_w)); - map(0x320000, 0x320001).portr("DSW3").w(m_decocomn, FUNC(decocomn_device::priority_w)); /* Priority */ - map(0x320002, 0x320003).nopw(); /* ? */ - map(0x320004, 0x320005).w(FUNC(rohga_state::irq_ack_w)); /* VBL IRQ ack */ + map(0x320000, 0x320001).portr("DSW3").w(m_decocomn, FUNC(decocomn_device::priority_w)); // Priority + map(0x320002, 0x320003).nopw(); // ? + map(0x320004, 0x320005).w(FUNC(rohga_state::irq_ack_w)); // VBL IRQ ack map(0x340000, 0x3407ff).ram().share("spriteram1"); - map(0x350000, 0x350001).w("spriteram1", FUNC(buffered_spriteram16_device::write)); /* Triggers DMA for spriteram */ + map(0x350000, 0x350001).w("spriteram1", FUNC(buffered_spriteram16_device::write)); // Triggers DMA for spriteram map(0x360000, 0x3607ff).ram().share("spriteram2"); - map(0x370000, 0x370001).w("spriteram2", FUNC(buffered_spriteram16_device::write)); /* Triggers DMA for spriteram */ + map(0x370000, 0x370001).w("spriteram2", FUNC(buffered_spriteram16_device::write)); // Triggers DMA for spriteram map(0x380000, 0x381fff).ram().w(m_decocomn, FUNC(decocomn_device::buffered_palette_w)).share("paletteram"); map(0x390008, 0x390009).w(m_decocomn, FUNC(decocomn_device::palette_dma_w)); map(0xfec000, 0xff3fff).ram(); - map(0xff4000, 0xff7fff).rw(FUNC(rohga_state::ioprot_r), FUNC(rohga_state::ioprot_w)).share("prot16ram"); /* Protection device */ + map(0xff4000, 0xff7fff).rw(FUNC(rohga_state::ioprot_r), FUNC(rohga_state::ioprot_w)).share("prot16ram"); // Protection device map(0xff8000, 0xffffff).ram(); } @@ -272,16 +272,16 @@ void rohga_state::hotb_base_map(address_map &map) map(0x000000, 0x0fffff).rom(); map(0x200000, 0x20000f).w(m_deco_tilegen[0], FUNC(deco16ic_device::pf_control_w)); map(0x240000, 0x24000f).w(m_deco_tilegen[1], FUNC(deco16ic_device::pf_control_w)); - map(0x280000, 0x283fff).rw(FUNC(rohga_state::ioprot_r), FUNC(rohga_state::ioprot_w)).share("prot16ram"); /* Protection device */ + map(0x280000, 0x283fff).rw(FUNC(rohga_state::ioprot_r), FUNC(rohga_state::ioprot_w)).share("prot16ram"); // Protection device map(0x2c0000, 0x2c0001).portr("DSW3"); - map(0x300000, 0x300001).portr("DSW3").w(FUNC(rohga_state::rohga_buffer_spriteram16_w)); /* write 1 for sprite dma */ + map(0x300000, 0x300001).portr("DSW3").w(FUNC(rohga_state::rohga_buffer_spriteram16_w)); // write 1 for sprite DMA map(0x310002, 0x310003).portr("SYSTEM"); - map(0x310000, 0x310009).nopw(); /* Palette control? */ - map(0x31000a, 0x31000b).w(m_decocomn, FUNC(decocomn_device::palette_dma_w)); /* Write 1111 for dma? (Or any value?) */ - map(0x320000, 0x320001).nopw(); /* bit 4: cleared on irq routine start, set on end */ + map(0x310000, 0x310009).nopw(); // Palette control? + map(0x31000a, 0x31000b).w(m_decocomn, FUNC(decocomn_device::palette_dma_w)); // Write 1111 for DMA? (Or any value?) + map(0x320000, 0x320001).nopw(); // bit 4: cleared on IRQ routine start, set on end map(0x322000, 0x322001).w(m_decocomn, FUNC(decocomn_device::priority_w)); - map(0x321100, 0x321101).w(FUNC(rohga_state::irq_ack_w)); /* Irq ack? Value not used */ + map(0x321100, 0x321101).w(FUNC(rohga_state::irq_ack_w)); // IRQ ack? Value not used map(0x3c0000, 0x3c1fff).rw(m_deco_tilegen[0], FUNC(deco16ic_device::pf1_data_r), FUNC(deco16ic_device::pf1_data_w)); map(0x3c2000, 0x3c2fff).rw(m_deco_tilegen[0], FUNC(deco16ic_device::pf2_data_r), FUNC(deco16ic_device::pf2_data_w)); @@ -300,14 +300,14 @@ void rohga_state::schmeisr_map(address_map &map) { hotb_base_map(map); - map(0xff0000, 0xff7fff).ram(); /* Main ram */ + map(0xff0000, 0xff7fff).ram(); // Main RAM } void rohga_state::hangzo_map(address_map &map) { hotb_base_map(map); - map(0x3f0000, 0x3f3fff).ram(); /* Main ram */ + map(0x3f0000, 0x3f3fff).ram(); // Main RAM } /******************************************************************************/ @@ -376,10 +376,10 @@ static INPUT_PORTS_START( rohga ) PORT_DIPNAME( 0x0080, 0x0080, "2 Credits to Start, 1 to Continue" ) PORT_DIPLOCATION("SW1:8") PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPUNUSED_DIPLOC( 0x0100, 0x0100, "SW2:1" ) /* Listed as "Unused" */ - PORT_DIPUNUSED_DIPLOC( 0x0200, 0x0200, "SW2:2" ) /* Listed as "Unused" */ - PORT_DIPUNUSED_DIPLOC( 0x0400, 0x0400, "SW2:3" ) /* Listed as "Unused" */ - PORT_DIPUNUSED_DIPLOC( 0x0800, 0x0800, "SW2:4" ) /* Listed as "Unused" */ + PORT_DIPUNUSED_DIPLOC( 0x0100, 0x0100, "SW2:1" ) // Listed as "Unused" + PORT_DIPUNUSED_DIPLOC( 0x0200, 0x0200, "SW2:2" ) // Listed as "Unused" + PORT_DIPUNUSED_DIPLOC( 0x0400, 0x0400, "SW2:3" ) // Listed as "Unused" + PORT_DIPUNUSED_DIPLOC( 0x0800, 0x0800, "SW2:4" ) // Listed as "Unused" PORT_DIPNAME( 0x3000, 0x3000, "Player's Vitality" ) PORT_DIPLOCATION("SW2:5,6") PORT_DIPSETTING( 0x3000, DEF_STR( Normal ) ) PORT_DIPSETTING( 0x2000, DEF_STR( Low ) ) @@ -392,8 +392,8 @@ static INPUT_PORTS_START( rohga ) PORT_DIPSETTING( 0x8000, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_START("DSW3") /* Dip switch bank 3 */ - PORT_DIPNAME( 0x0001, 0x0001, "Stage Clear Bonus" ) PORT_DIPLOCATION("SW3:1") /* Life Recovery At stage clear */ + PORT_START("DSW3") // DIP switch bank 3 + PORT_DIPNAME( 0x0001, 0x0001, "Stage Clear Bonus" ) PORT_DIPLOCATION("SW3:1") // Life Recovery At stage clear PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW3:2") @@ -562,7 +562,7 @@ static INPUT_PORTS_START( nitrobal ) PORT_DIPSETTING( 0x8000, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_START("DSW3") /* Not really a DSW, but this way it's easier to read by tag */ + PORT_START("DSW3") // Not really a DSW, but this way it's easier to read by tag PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(3) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(3) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(3) @@ -629,13 +629,13 @@ static INPUT_PORTS_START( schmeisr ) PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:3") PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0400, DEF_STR( On ) ) - PORT_DIPUNUSED_DIPLOC( 0x0800, 0x0800, "SW2:4" ) /* Listed as "Unused" */ - PORT_DIPUNUSED_DIPLOC( 0x1000, 0x1000, "SW2:5" ) /* Listed as "Unused" */ - PORT_DIPUNUSED_DIPLOC( 0x2000, 0x2000, "SW2:6" ) /* Listed as "Unused" */ - PORT_DIPUNUSED_DIPLOC( 0x4000, 0x4000, "SW2:7" ) /* Listed as "Unused" */ - PORT_DIPUNUSED_DIPLOC( 0x8000, 0x8000, "SW2:8" ) /* Listed as "Unused" */ + PORT_DIPUNUSED_DIPLOC( 0x0800, 0x0800, "SW2:4" ) // Listed as "Unused" + PORT_DIPUNUSED_DIPLOC( 0x1000, 0x1000, "SW2:5" ) // Listed as "Unused" + PORT_DIPUNUSED_DIPLOC( 0x2000, 0x2000, "SW2:6" ) // Listed as "Unused" + PORT_DIPUNUSED_DIPLOC( 0x4000, 0x4000, "SW2:7" ) // Listed as "Unused" + PORT_DIPUNUSED_DIPLOC( 0x8000, 0x8000, "SW2:8" ) // Listed as "Unused" - PORT_START("DSW3") /* Dip switch bank 3 - This bank of switches are _NOT_ shown in the test mode screen */ + PORT_START("DSW3") // DIP switch bank 3 - This bank of switches are _NOT_ shown in the test mode screen PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW3:1") PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) @@ -720,13 +720,13 @@ static INPUT_PORTS_START( hangzo ) PORT_DIPSETTING( 0x0000, "2" ) PORT_DIPSETTING( 0x0300, "3" ) PORT_DIPSETTING( 0x0200, "4" ) - PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:3") /* Either 3 & 4 are Difficulty */ + PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:3") // Either 3 & 4 are Difficulty PORT_DIPSETTING( 0x0400, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:4") PORT_DIPSETTING( 0x0800, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:5") /* or more likely 5 & 6 are Player's Vitality like Rohga (all other dips seem to match Rohga) */ + PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:5") // or more likely 5 & 6 are Player's Vitality like Rohga (all other dips seem to match Rohga) PORT_DIPSETTING( 0x1000, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:6") @@ -743,10 +743,10 @@ static INPUT_PORTS_START( hangzo ) PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW3:1") PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0002, 0x0002, "Freeze Player" ) PORT_DIPLOCATION("SW3:2") /* With on, player will not fall down to playing field and be stuck floating at the top of the screen */ + PORT_DIPNAME( 0x0002, 0x0002, "Freeze Player" ) PORT_DIPLOCATION("SW3:2") // With on, player will not fall down to playing field and be stuck floating at the top of the screen PORT_DIPSETTING( 0x0002, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0004, 0x0004, "Freeze Frame" ) PORT_DIPLOCATION("SW3:3") /* P1 starts & stops freeze, when frozen P2 is single step frame */ + PORT_DIPNAME( 0x0004, 0x0004, "Freeze Frame" ) PORT_DIPLOCATION("SW3:3") // P1 starts & stops freeze, when frozen P2 is single step frame PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW3:4") @@ -778,7 +778,7 @@ static const gfx_layout charlayout = { RGN_FRAC(1,2)+8, RGN_FRAC(1,2), 8, 0 }, { STEP8(0,1) }, { STEP8(0,8*2) }, - 8*8*2 /* every char takes 16 consecutive bytes */ + 8*8*2 // every char takes 16 consecutive bytes }; static const gfx_layout tilelayout_6bpp = @@ -804,17 +804,17 @@ static const gfx_layout tilelayout = }; static GFXDECODE_START( gfx_rohga ) - GFXDECODE_ENTRY( "chars", 0, charlayout, 0, 32 ) /* Characters 8x8 */ - GFXDECODE_ENTRY( "tiles1", 0, tilelayout, 0, 32 ) /* Tiles 16x16 */ - GFXDECODE_ENTRY( "tiles2", 0, tilelayout, 512, 32 ) /* Tiles 16x16 */ + GFXDECODE_ENTRY( "chars", 0, charlayout, 0, 32 ) // Characters 8x8 + GFXDECODE_ENTRY( "tiles1", 0, tilelayout, 0, 32 ) // Tiles 16x16 + GFXDECODE_ENTRY( "tiles2", 0, tilelayout, 512, 32 ) // Tiles 16x16 GFXDECODE_END static GFXDECODE_START( gfx_rohga_spr ) - GFXDECODE_ENTRY( "sprites1", 0, tilelayout_6bpp, 1024, 16 ) /* Sprites 16x16 */ + GFXDECODE_ENTRY( "sprites1", 0, tilelayout_6bpp, 1024, 16 ) // Sprites 16x16 GFXDECODE_END static GFXDECODE_START( gfx_wizdfire_spr1 ) - GFXDECODE_ENTRY( "sprites1", 0, tilelayout, 0/*1024*/, 128 ) /* Sprites 16x16 */ + GFXDECODE_ENTRY( "sprites1", 0, tilelayout, 0/*1024*/, 128 ) // Sprites 16x16 GFXDECODE_END static GFXDECODE_START( gfx_wizdfire_spr2 ) @@ -822,7 +822,7 @@ static GFXDECODE_START( gfx_wizdfire_spr2 ) GFXDECODE_END static GFXDECODE_START( gfx_schmeisr_spr ) - GFXDECODE_ENTRY( "sprites1", 0, tilelayout, 1024, 64 ) /* Sprites 16x16 */ + GFXDECODE_ENTRY( "sprites1", 0, tilelayout, 1024, 64 ) // Sprites 16x16 GFXDECODE_END /**********************************************************************************/ @@ -847,7 +847,7 @@ DECOSPR_PRIORITY_CB_MEMBER(rohga_state::rohga_pri_callback) case 0x0000: return 0; case 0x4000: return 0xf0; case 0x6000: return 0xf0 | 0xcc; - case 0x2000: return 0;//0xf0|0xcc; /* Perhaps 0xf0|0xcc|0xaa (Sprite under bottom layer) */ + case 0x2000: return 0;//0xf0|0xcc; // Perhaps 0xf0|0xcc|0xaa (Sprite under bottom layer) } return 0; @@ -869,16 +869,16 @@ DECOSPR_COLOUR_CB_MEMBER(rohga_state::schmeisr_col_callback) void rohga_state::rohga_base(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware M68000(config, m_maincpu, 14'000'000); m_maincpu->set_vblank_int("screen", FUNC(rohga_state::irq6_line_assert)); - H6280(config, m_audiocpu, 32'220'000/4/3); /* verified on pcb (8.050Mhz is XIN on pin 10 of H6280 */ + H6280(config, m_audiocpu, 32'220'000/4/3); // verified on PCB (8.050Mhz is XIN on pin 10 of H6280 m_audiocpu->set_addrmap(AS_PROGRAM, &rohga_state::sound_map); m_audiocpu->add_route(ALL_OUTPUTS, "lspeaker", 0); // internal sound unused m_audiocpu->add_route(ALL_OUTPUTS, "rspeaker", 0); - /* video hardware */ + // video hardware BUFFERED_SPRITERAM16(config, m_spriteram[0]); screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); @@ -926,12 +926,12 @@ void rohga_state::rohga_base(machine_config &config) m_ioprot->port_c_cb().set_ioport("DSW"); m_ioprot->soundlatch_irq_cb().set_inputline("audiocpu", 0); - /* sound hardware */ + // sound hardware SPEAKER(config, "lspeaker").front_left(); SPEAKER(config, "rspeaker").front_right(); ym2151_device &ymsnd(YM2151(config, "ymsnd", 32'220'000/9)); - ymsnd.irq_handler().set_inputline(m_audiocpu, 1); /* IRQ2 */ + ymsnd.irq_handler().set_inputline(m_audiocpu, 1); // IRQ2 ymsnd.port_write_handler().set(FUNC(rohga_state::sound_bankswitch_w)); ymsnd.add_route(0, "lspeaker", 0.36); ymsnd.add_route(1, "rspeaker", 0.36); @@ -949,10 +949,10 @@ void rohga_state::rohga(machine_config &config) { rohga_base(config); - /* basic machine hardware */ + // basic machine hardware m_maincpu->set_addrmap(AS_PROGRAM, &rohga_state::rohga_map); - /* video hardware */ + // video hardware subdevice("screen")->set_screen_update(FUNC(rohga_state::screen_update_rohga)); subdevice("screen")->set_palette(m_palette); @@ -965,10 +965,10 @@ void rohga_state::wizdfire(machine_config &config) { rohga_base(config); - /* basic machine hardware */ + // basic machine hardware m_maincpu->set_addrmap(AS_PROGRAM, &rohga_state::wizdfire_map); - /* video hardware */ + // video hardware BUFFERED_SPRITERAM16(config, m_spriteram[1]); subdevice("screen")->set_screen_update(FUNC(rohga_state::screen_update_wizdfire)); @@ -987,10 +987,10 @@ void rohga_state::nitrobal(machine_config &config) { rohga_base(config); - /* basic machine hardware */ + // basic machine hardware m_maincpu->set_addrmap(AS_PROGRAM, &rohga_state::nitrobal_map); - /* video hardware */ + // video hardware BUFFERED_SPRITERAM16(config, m_spriteram[1]); subdevice("screen")->set_screen_update(FUNC(rohga_state::screen_update_nitrobal)); @@ -1023,10 +1023,10 @@ void rohga_state::schmeisr(machine_config &config) { rohga_base(config); - /* basic machine hardware */ + // basic machine hardware m_maincpu->set_addrmap(AS_PROGRAM, &rohga_state::schmeisr_map); - /* video hardware */ + // video hardware subdevice("screen")->set_screen_update(FUNC(rohga_state::screen_update_rohga)); subdevice("screen")->set_palette(m_palette); @@ -1039,131 +1039,131 @@ void rohga_state::hangzo(machine_config &config) { schmeisr(config); - /* basic machine hardware */ + // basic machine hardware m_maincpu->set_addrmap(AS_PROGRAM, &rohga_state::hangzo_map); } /**********************************************************************************/ -ROM_START( rohga ) /* Asia/Europe v5.0 */ - ROM_REGION(0x200000, "maincpu", 0 ) /* 68000 code */ +ROM_START( rohga ) // Asia/Europe v5.0 + ROM_REGION(0x200000, "maincpu", 0 ) // 68000 code ROM_LOAD16_BYTE( "ht-00-1.2a", 0x000000, 0x40000, CRC(1ed84a67) SHA1(4778e3878aa20c12ab8d3dffeb732b90e2de7cfe) ) ROM_LOAD16_BYTE( "ht-03-1.2d", 0x000001, 0x40000, CRC(84e7ebf6) SHA1(e51884431c7d66d9795d9939aa1e928f662171be) ) ROM_LOAD16_BYTE( "mam00.8a", 0x100000, 0x80000, CRC(0fa440a6) SHA1(f0f84c630fc30ec164acc21de871c857d391c398) ) ROM_LOAD16_BYTE( "mam07.8d", 0x100001, 0x80000, CRC(f8bc7f20) SHA1(909324248bd207f3b01d9f694975b629d8ccaa08) ) - ROM_REGION(0x10000, "audiocpu", 0 ) /* Sound CPU */ + ROM_REGION(0x10000, "audiocpu", 0 ) // Sound CPU ROM_LOAD( "ha04.18p", 0x00000, 0x10000, CRC(eb6608eb) SHA1(0233677970aba12783dd4d6d58d70568ef641115) ) ROM_REGION( 0x020000, "chars", 0 ) - ROM_LOAD16_BYTE( "ha01.13a", 0x00000, 0x10000, CRC(fb8f8519) SHA1(0a237426561e5fef6a062e1ad5ae02204f72d5f9) ) /* Encrypted tiles */ + ROM_LOAD16_BYTE( "ha01.13a", 0x00000, 0x10000, CRC(fb8f8519) SHA1(0a237426561e5fef6a062e1ad5ae02204f72d5f9) ) // Encrypted tiles ROM_LOAD16_BYTE( "ha02.14a", 0x00001, 0x10000, CRC(aa47c17f) SHA1(830dfcbfaef90133d93b0fbf3cf2067498fa658b) ) ROM_REGION( 0x100000, "tiles1", 0 ) - ROM_LOAD( "mam01.10a", 0x000000, 0x080000, CRC(dbf4fbcc) SHA1(2f289556fd25beb7d30501cba17ac35ad28c5b91) ) /* Encrypted tiles */ + ROM_LOAD( "mam01.10a", 0x000000, 0x080000, CRC(dbf4fbcc) SHA1(2f289556fd25beb7d30501cba17ac35ad28c5b91) ) // Encrypted tiles ROM_LOAD( "mam02.11a", 0x080000, 0x080000, CRC(b1fac481) SHA1(da370499ea8ff7b3dd338b31f3799b760fd0d981) ) ROM_REGION( 0x200000, "tiles2", 0 ) - ROM_LOAD( "mam08.17d", 0x000000, 0x100000, CRC(ca97a83f) SHA1(2e097840ae56cf19ad2651d59c31182f47239d60) ) /* tiles 1 & 2 */ + ROM_LOAD( "mam08.17d", 0x000000, 0x100000, CRC(ca97a83f) SHA1(2e097840ae56cf19ad2651d59c31182f47239d60) ) // tiles 1 & 2 ROM_LOAD( "mam09.18d", 0x100000, 0x100000, CRC(3f57d56f) SHA1(0d4537da6ab62762179215deae72fe2e6a7869e1) ) ROM_REGION( 0x600000, "sprites1", 0 ) - ROM_LOAD( "mam05.19a", 0x000000, 0x100000, CRC(307a2cd1) SHA1(d7a795e47cf1533f0bb5a96162c8025282abe09f) ) /* 6bpp sprites */ + ROM_LOAD( "mam05.19a", 0x000000, 0x100000, CRC(307a2cd1) SHA1(d7a795e47cf1533f0bb5a96162c8025282abe09f) ) // 6bpp sprites ROM_LOAD( "mam06.20a", 0x100000, 0x100000, CRC(a1119a2d) SHA1(876f9295c2032ce491b45a103ffafc750d8c78e1) ) ROM_LOAD( "mam10.19d", 0x200000, 0x100000, CRC(99f48f9f) SHA1(685787de54e9158ced80f3821996c3a63f2a72a2) ) ROM_LOAD( "mam11.20d", 0x300000, 0x100000, CRC(c3f12859) SHA1(45fdfd55f606316c936f0a9e6b4940740138d344) ) ROM_LOAD( "mam03.17a", 0x400000, 0x100000, CRC(fc4dfd48) SHA1(0c5f5a09833ebeb3018e65edd6f7ce06d4ba84ed) ) ROM_LOAD( "mam04.18a", 0x500000, 0x100000, CRC(7d3b38bf) SHA1(9f83ad7497ed57405ad648f403eb69f776567a50) ) - ROM_REGION(0x80000, "oki2", 0 ) /* Oki samples */ + ROM_REGION(0x80000, "oki2", 0 ) // Oki samples ROM_LOAD( "mam12.14p", 0x00000, 0x80000, CRC(6f00b791) SHA1(c9fbc9ab5ce84fec79efa0a23373be97a27bf898) ) - ROM_REGION(0x80000, "oki1", 0 ) /* Oki samples */ + ROM_REGION(0x80000, "oki1", 0 ) // Oki samples ROM_LOAD( "mam13.15p", 0x00000, 0x80000, CRC(525b9461) SHA1(1d9bb3725dfe601b05a779b84b4191455087b969) ) ROM_REGION( 512, "proms", 0 ) - ROM_LOAD( "hb-00.11p", 0x00000, 0x200, CRC(b7a7baad) SHA1(39781c3412493b985d3616ac31142fc00bbcddf4) ) /* ? */ + ROM_LOAD( "hb-00.11p", 0x00000, 0x200, CRC(b7a7baad) SHA1(39781c3412493b985d3616ac31142fc00bbcddf4) ) // ? ROM_END -ROM_START( rohga1 ) /* Asia/Europe v3.0 */ - ROM_REGION(0x200000, "maincpu", 0 ) /* 68000 code */ +ROM_START( rohga1 ) // Asia/Europe v3.0 + ROM_REGION(0x200000, "maincpu", 0 ) // 68000 code ROM_LOAD16_BYTE( "jd00.bin", 0x000000, 0x40000, CRC(e046c77a) SHA1(bb4d987a579a1a1524bc150ebda9cd24ed77a733) ) ROM_LOAD16_BYTE( "jd03.bin", 0x000001, 0x40000, CRC(2c5120b8) SHA1(41b6618f0f086efd48486f72ada2fb6f184ad85b) ) ROM_LOAD16_BYTE( "mam00.8a", 0x100000, 0x80000, CRC(0fa440a6) SHA1(f0f84c630fc30ec164acc21de871c857d391c398) ) ROM_LOAD16_BYTE( "mam07.8d", 0x100001, 0x80000, CRC(f8bc7f20) SHA1(909324248bd207f3b01d9f694975b629d8ccaa08) ) - ROM_REGION(0x10000, "audiocpu", 0 ) /* Sound CPU */ + ROM_REGION(0x10000, "audiocpu", 0 ) // Sound CPU ROM_LOAD( "ha04.18p", 0x00000, 0x10000, CRC(eb6608eb) SHA1(0233677970aba12783dd4d6d58d70568ef641115) ) ROM_REGION( 0x020000, "chars", 0 ) - ROM_LOAD16_BYTE( "ha01.13a", 0x00000, 0x10000, CRC(fb8f8519) SHA1(0a237426561e5fef6a062e1ad5ae02204f72d5f9) ) /* Encrypted tiles */ + ROM_LOAD16_BYTE( "ha01.13a", 0x00000, 0x10000, CRC(fb8f8519) SHA1(0a237426561e5fef6a062e1ad5ae02204f72d5f9) ) // Encrypted tiles ROM_LOAD16_BYTE( "ha02.14a", 0x00001, 0x10000, CRC(aa47c17f) SHA1(830dfcbfaef90133d93b0fbf3cf2067498fa658b) ) ROM_REGION( 0x100000, "tiles1", 0 ) - ROM_LOAD( "mam01.10a", 0x000000, 0x080000, CRC(dbf4fbcc) SHA1(2f289556fd25beb7d30501cba17ac35ad28c5b91) ) /* Encrypted tiles */ + ROM_LOAD( "mam01.10a", 0x000000, 0x080000, CRC(dbf4fbcc) SHA1(2f289556fd25beb7d30501cba17ac35ad28c5b91) ) // Encrypted tiles ROM_LOAD( "mam02.11a", 0x080000, 0x080000, CRC(b1fac481) SHA1(da370499ea8ff7b3dd338b31f3799b760fd0d981) ) ROM_REGION( 0x200000, "tiles2", 0 ) - ROM_LOAD( "mam08.17d", 0x000000, 0x100000, CRC(ca97a83f) SHA1(2e097840ae56cf19ad2651d59c31182f47239d60) ) /* tiles 1 & 2 */ + ROM_LOAD( "mam08.17d", 0x000000, 0x100000, CRC(ca97a83f) SHA1(2e097840ae56cf19ad2651d59c31182f47239d60) ) // tiles 1 & 2 ROM_LOAD( "mam09.18d", 0x100000, 0x100000, CRC(3f57d56f) SHA1(0d4537da6ab62762179215deae72fe2e6a7869e1) ) ROM_REGION( 0x600000, "sprites1", 0 ) - ROM_LOAD( "mam05.19a", 0x000000, 0x100000, CRC(307a2cd1) SHA1(d7a795e47cf1533f0bb5a96162c8025282abe09f) ) /* 6bpp sprites */ + ROM_LOAD( "mam05.19a", 0x000000, 0x100000, CRC(307a2cd1) SHA1(d7a795e47cf1533f0bb5a96162c8025282abe09f) ) // 6bpp sprites ROM_LOAD( "mam06.20a", 0x100000, 0x100000, CRC(a1119a2d) SHA1(876f9295c2032ce491b45a103ffafc750d8c78e1) ) ROM_LOAD( "mam10.19d", 0x200000, 0x100000, CRC(99f48f9f) SHA1(685787de54e9158ced80f3821996c3a63f2a72a2) ) ROM_LOAD( "mam11.20d", 0x300000, 0x100000, CRC(c3f12859) SHA1(45fdfd55f606316c936f0a9e6b4940740138d344) ) ROM_LOAD( "mam03.17a", 0x400000, 0x100000, CRC(fc4dfd48) SHA1(0c5f5a09833ebeb3018e65edd6f7ce06d4ba84ed) ) ROM_LOAD( "mam04.18a", 0x500000, 0x100000, CRC(7d3b38bf) SHA1(9f83ad7497ed57405ad648f403eb69f776567a50) ) - ROM_REGION(0x80000, "oki2", 0 ) /* Oki samples */ + ROM_REGION(0x80000, "oki2", 0 ) // Oki samples ROM_LOAD( "mam12.14p", 0x00000, 0x80000, CRC(6f00b791) SHA1(c9fbc9ab5ce84fec79efa0a23373be97a27bf898) ) - ROM_REGION(0x80000, "oki1", 0 ) /* Oki samples */ + ROM_REGION(0x80000, "oki1", 0 ) // Oki samples ROM_LOAD( "mam13.15p", 0x00000, 0x80000, CRC(525b9461) SHA1(1d9bb3725dfe601b05a779b84b4191455087b969) ) ROM_REGION( 512, "proms", 0 ) - ROM_LOAD( "hb-00.11p", 0x00000, 0x200, CRC(b7a7baad) SHA1(39781c3412493b985d3616ac31142fc00bbcddf4) ) /* ? */ + ROM_LOAD( "hb-00.11p", 0x00000, 0x200, CRC(b7a7baad) SHA1(39781c3412493b985d3616ac31142fc00bbcddf4) ) // ? ROM_END -ROM_START( rohga2 ) /* Asia/Europe v3.0 Alternate Set */ - ROM_REGION(0x200000, "maincpu", 0 ) /* 68000 code */ +ROM_START( rohga2 ) // Asia/Europe v3.0 Alternate Set + ROM_REGION(0x200000, "maincpu", 0 ) // 68000 code ROM_LOAD16_BYTE( "hts-00-3.2a", 0x000000, 0x40000, CRC(154f02ec) SHA1(677975cfc542e5a00091330a8096b85465261a4c) ) ROM_LOAD16_BYTE( "hts-03-3.2d", 0x000001, 0x40000, CRC(5e69d3d8) SHA1(832cad250b42f269786b128b98b05ab2cdb238bb) ) ROM_LOAD16_BYTE( "mam00.8a", 0x100000, 0x80000, CRC(0fa440a6) SHA1(f0f84c630fc30ec164acc21de871c857d391c398) ) ROM_LOAD16_BYTE( "mam07.8d", 0x100001, 0x80000, CRC(f8bc7f20) SHA1(909324248bd207f3b01d9f694975b629d8ccaa08) ) - ROM_REGION(0x10000, "audiocpu", 0 ) /* Sound CPU */ + ROM_REGION(0x10000, "audiocpu", 0 ) // Sound CPU ROM_LOAD( "ha04.18p", 0x00000, 0x10000, CRC(eb6608eb) SHA1(0233677970aba12783dd4d6d58d70568ef641115) ) ROM_REGION( 0x020000, "chars", 0 ) - ROM_LOAD16_BYTE( "ha01.13a", 0x00000, 0x10000, CRC(fb8f8519) SHA1(0a237426561e5fef6a062e1ad5ae02204f72d5f9) ) /* Encrypted tiles */ + ROM_LOAD16_BYTE( "ha01.13a", 0x00000, 0x10000, CRC(fb8f8519) SHA1(0a237426561e5fef6a062e1ad5ae02204f72d5f9) ) // Encrypted tiles ROM_LOAD16_BYTE( "ha02.14a", 0x00001, 0x10000, CRC(aa47c17f) SHA1(830dfcbfaef90133d93b0fbf3cf2067498fa658b) ) ROM_REGION( 0x100000, "tiles1", 0 ) - ROM_LOAD( "mam01.10a", 0x000000, 0x080000, CRC(dbf4fbcc) SHA1(2f289556fd25beb7d30501cba17ac35ad28c5b91) ) /* Encrypted tiles */ + ROM_LOAD( "mam01.10a", 0x000000, 0x080000, CRC(dbf4fbcc) SHA1(2f289556fd25beb7d30501cba17ac35ad28c5b91) ) // Encrypted tiles ROM_LOAD( "mam02.11a", 0x080000, 0x080000, CRC(b1fac481) SHA1(da370499ea8ff7b3dd338b31f3799b760fd0d981) ) ROM_REGION( 0x200000, "tiles2", 0 ) - ROM_LOAD( "mam08.17d", 0x000000, 0x100000, CRC(ca97a83f) SHA1(2e097840ae56cf19ad2651d59c31182f47239d60) ) /* tiles 1 & 2 */ + ROM_LOAD( "mam08.17d", 0x000000, 0x100000, CRC(ca97a83f) SHA1(2e097840ae56cf19ad2651d59c31182f47239d60) ) // tiles 1 & 2 ROM_LOAD( "mam09.18d", 0x100000, 0x100000, CRC(3f57d56f) SHA1(0d4537da6ab62762179215deae72fe2e6a7869e1) ) ROM_REGION( 0x600000, "sprites1", 0 ) - ROM_LOAD( "mam05.19a", 0x000000, 0x100000, CRC(307a2cd1) SHA1(d7a795e47cf1533f0bb5a96162c8025282abe09f) ) /* 6bpp sprites */ + ROM_LOAD( "mam05.19a", 0x000000, 0x100000, CRC(307a2cd1) SHA1(d7a795e47cf1533f0bb5a96162c8025282abe09f) ) // 6bpp sprites ROM_LOAD( "mam06.20a", 0x100000, 0x100000, CRC(a1119a2d) SHA1(876f9295c2032ce491b45a103ffafc750d8c78e1) ) ROM_LOAD( "mam10.19d", 0x200000, 0x100000, CRC(99f48f9f) SHA1(685787de54e9158ced80f3821996c3a63f2a72a2) ) ROM_LOAD( "mam11.20d", 0x300000, 0x100000, CRC(c3f12859) SHA1(45fdfd55f606316c936f0a9e6b4940740138d344) ) ROM_LOAD( "mam03.17a", 0x400000, 0x100000, CRC(fc4dfd48) SHA1(0c5f5a09833ebeb3018e65edd6f7ce06d4ba84ed) ) ROM_LOAD( "mam04.18a", 0x500000, 0x100000, CRC(7d3b38bf) SHA1(9f83ad7497ed57405ad648f403eb69f776567a50) ) - ROM_REGION(0x80000, "oki2", 0 ) /* Oki samples */ + ROM_REGION(0x80000, "oki2", 0 ) // Oki samples ROM_LOAD( "mam12.14p", 0x00000, 0x80000, CRC(6f00b791) SHA1(c9fbc9ab5ce84fec79efa0a23373be97a27bf898) ) - ROM_REGION(0x80000, "oki1", 0 ) /* Oki samples */ + ROM_REGION(0x80000, "oki1", 0 ) // Oki samples ROM_LOAD( "mam13.15p", 0x00000, 0x80000, CRC(525b9461) SHA1(1d9bb3725dfe601b05a779b84b4191455087b969) ) ROM_REGION( 512, "proms", 0 ) - ROM_LOAD( "hb-00.11p", 0x00000, 0x200, CRC(b7a7baad) SHA1(39781c3412493b985d3616ac31142fc00bbcddf4) ) /* ? */ + ROM_LOAD( "hb-00.11p", 0x00000, 0x200, CRC(b7a7baad) SHA1(39781c3412493b985d3616ac31142fc00bbcddf4) ) // ? ROM_END @@ -1192,145 +1192,145 @@ MAM-13.15P - Oki Samples, this was missing from existing archive Sound out is stereo, there is a jumper to select Mono or Stereo output. */ -ROM_START( rohgah ) /* Hong Kong v3.0 */ - ROM_REGION(0x200000, "maincpu", 0 ) /* 68000 code */ +ROM_START( rohgah ) // Hong Kong v3.0 + ROM_REGION(0x200000, "maincpu", 0 ) // 68000 code ROM_LOAD16_BYTE( "jd00-2.2a", 0x000000, 0x40000, CRC(ec70646a) SHA1(5e25fe8ce0dfebf8f5903ebe9aa5ef01ca7aa2f0) ) ROM_LOAD16_BYTE( "jd03-2.2d", 0x000001, 0x40000, CRC(11d4c9a2) SHA1(9afe684d749665f65e44a3665d5a1dc61458faa0) ) ROM_LOAD16_BYTE( "mam00.8a", 0x100000, 0x80000, CRC(0fa440a6) SHA1(f0f84c630fc30ec164acc21de871c857d391c398) ) ROM_LOAD16_BYTE( "mam07.8d", 0x100001, 0x80000, CRC(f8bc7f20) SHA1(909324248bd207f3b01d9f694975b629d8ccaa08) ) - ROM_REGION(0x10000, "audiocpu", 0 ) /* Sound CPU */ + ROM_REGION(0x10000, "audiocpu", 0 ) // Sound CPU ROM_LOAD( "ha04.18p", 0x00000, 0x10000, CRC(eb6608eb) SHA1(0233677970aba12783dd4d6d58d70568ef641115) ) ROM_REGION( 0x020000, "chars", 0 ) - ROM_LOAD16_BYTE( "ha01.13a", 0x00000, 0x10000, CRC(fb8f8519) SHA1(0a237426561e5fef6a062e1ad5ae02204f72d5f9) ) /* Encrypted tiles */ + ROM_LOAD16_BYTE( "ha01.13a", 0x00000, 0x10000, CRC(fb8f8519) SHA1(0a237426561e5fef6a062e1ad5ae02204f72d5f9) ) // Encrypted tiles ROM_LOAD16_BYTE( "ha02.14a", 0x00001, 0x10000, CRC(aa47c17f) SHA1(830dfcbfaef90133d93b0fbf3cf2067498fa658b) ) ROM_REGION( 0x100000, "tiles1", 0 ) - ROM_LOAD( "mam01.10a", 0x000000, 0x080000, CRC(dbf4fbcc) SHA1(2f289556fd25beb7d30501cba17ac35ad28c5b91) ) /* Encrypted tiles */ + ROM_LOAD( "mam01.10a", 0x000000, 0x080000, CRC(dbf4fbcc) SHA1(2f289556fd25beb7d30501cba17ac35ad28c5b91) ) // Encrypted tiles ROM_LOAD( "mam02.11a", 0x080000, 0x080000, CRC(b1fac481) SHA1(da370499ea8ff7b3dd338b31f3799b760fd0d981) ) ROM_REGION( 0x200000, "tiles2", 0 ) - ROM_LOAD( "mam08.17d", 0x000000, 0x100000, CRC(ca97a83f) SHA1(2e097840ae56cf19ad2651d59c31182f47239d60) ) /* tiles 1 & 2 */ + ROM_LOAD( "mam08.17d", 0x000000, 0x100000, CRC(ca97a83f) SHA1(2e097840ae56cf19ad2651d59c31182f47239d60) ) // tiles 1 & 2 ROM_LOAD( "mam09.18d", 0x100000, 0x100000, CRC(3f57d56f) SHA1(0d4537da6ab62762179215deae72fe2e6a7869e1) ) ROM_REGION( 0x600000, "sprites1", 0 ) - ROM_LOAD( "mam05.19a", 0x000000, 0x100000, CRC(307a2cd1) SHA1(d7a795e47cf1533f0bb5a96162c8025282abe09f) ) /* 6bpp sprites */ + ROM_LOAD( "mam05.19a", 0x000000, 0x100000, CRC(307a2cd1) SHA1(d7a795e47cf1533f0bb5a96162c8025282abe09f) ) // 6bpp sprites ROM_LOAD( "mam06.20a", 0x100000, 0x100000, CRC(a1119a2d) SHA1(876f9295c2032ce491b45a103ffafc750d8c78e1) ) ROM_LOAD( "mam10.19d", 0x200000, 0x100000, CRC(99f48f9f) SHA1(685787de54e9158ced80f3821996c3a63f2a72a2) ) ROM_LOAD( "mam11.20d", 0x300000, 0x100000, CRC(c3f12859) SHA1(45fdfd55f606316c936f0a9e6b4940740138d344) ) ROM_LOAD( "mam03.17a", 0x400000, 0x100000, CRC(fc4dfd48) SHA1(0c5f5a09833ebeb3018e65edd6f7ce06d4ba84ed) ) ROM_LOAD( "mam04.18a", 0x500000, 0x100000, CRC(7d3b38bf) SHA1(9f83ad7497ed57405ad648f403eb69f776567a50) ) - ROM_REGION(0x80000, "oki2", 0 ) /* Oki samples */ + ROM_REGION(0x80000, "oki2", 0 ) // Oki samples ROM_LOAD( "mam12.14p", 0x00000, 0x80000, CRC(6f00b791) SHA1(c9fbc9ab5ce84fec79efa0a23373be97a27bf898) ) - ROM_REGION(0x80000, "oki1", 0 ) /* Oki samples */ + ROM_REGION(0x80000, "oki1", 0 ) // Oki samples ROM_LOAD( "mam13.15p", 0x00000, 0x80000, CRC(525b9461) SHA1(1d9bb3725dfe601b05a779b84b4191455087b969) ) - ROM_REGION( 512, "proms", 0 ) - ROM_LOAD( "hb-00.11p", 0x00000, 0x200, CRC(b7a7baad) SHA1(39781c3412493b985d3616ac31142fc00bbcddf4) ) /* ? */ + ROM_REGION( 0x200, "proms", 0 ) + ROM_LOAD( "hb-00.11p", 0x00000, 0x200, CRC(b7a7baad) SHA1(39781c3412493b985d3616ac31142fc00bbcddf4) ) // ? ROM_END -ROM_START( rohgau ) /* US v1.0 */ - ROM_REGION(0x200000, "maincpu", 0 ) /* 68000 code */ +ROM_START( rohgau ) // US v1.0 + ROM_REGION(0x200000, "maincpu", 0 ) // 68000 code ROM_LOAD16_BYTE( "ha00.2a", 0x000000, 0x40000, CRC(d8d13052) SHA1(24113244200f15a16fed82c64de3e9e4e87d1257) ) ROM_LOAD16_BYTE( "ha03.2d", 0x000001, 0x40000, CRC(5f683bbf) SHA1(a367b833fd1f64bff9618ce06be22aed218d4225) ) ROM_LOAD16_BYTE( "mam00.8a", 0x100000, 0x80000, CRC(0fa440a6) SHA1(f0f84c630fc30ec164acc21de871c857d391c398) ) ROM_LOAD16_BYTE( "mam07.8d", 0x100001, 0x80000, CRC(f8bc7f20) SHA1(909324248bd207f3b01d9f694975b629d8ccaa08) ) - ROM_REGION(0x10000, "audiocpu", 0 ) /* Sound CPU */ + ROM_REGION(0x10000, "audiocpu", 0 ) // Sound CPU ROM_LOAD( "ha04.18p", 0x00000, 0x10000, CRC(eb6608eb) SHA1(0233677970aba12783dd4d6d58d70568ef641115) ) ROM_REGION( 0x020000, "chars", 0 ) - ROM_LOAD16_BYTE( "ha01.13a", 0x00000, 0x10000, CRC(fb8f8519) SHA1(0a237426561e5fef6a062e1ad5ae02204f72d5f9) ) /* Encrypted tiles */ + ROM_LOAD16_BYTE( "ha01.13a", 0x00000, 0x10000, CRC(fb8f8519) SHA1(0a237426561e5fef6a062e1ad5ae02204f72d5f9) ) // Encrypted tiles ROM_LOAD16_BYTE( "ha02.14a", 0x00001, 0x10000, CRC(aa47c17f) SHA1(830dfcbfaef90133d93b0fbf3cf2067498fa658b) ) ROM_REGION( 0x100000, "tiles1", 0 ) - ROM_LOAD( "mam01.10a", 0x000000, 0x080000, CRC(dbf4fbcc) SHA1(2f289556fd25beb7d30501cba17ac35ad28c5b91) ) /* Encrypted tiles */ + ROM_LOAD( "mam01.10a", 0x000000, 0x080000, CRC(dbf4fbcc) SHA1(2f289556fd25beb7d30501cba17ac35ad28c5b91) ) // Encrypted tiles ROM_LOAD( "mam02.11a", 0x080000, 0x080000, CRC(b1fac481) SHA1(da370499ea8ff7b3dd338b31f3799b760fd0d981) ) ROM_REGION( 0x200000, "tiles2", 0 ) - ROM_LOAD( "mam08.17d", 0x000000, 0x100000, CRC(ca97a83f) SHA1(2e097840ae56cf19ad2651d59c31182f47239d60) ) /* tiles 1 & 2 */ + ROM_LOAD( "mam08.17d", 0x000000, 0x100000, CRC(ca97a83f) SHA1(2e097840ae56cf19ad2651d59c31182f47239d60) ) // tiles 1 & 2 ROM_LOAD( "mam09.18d", 0x100000, 0x100000, CRC(3f57d56f) SHA1(0d4537da6ab62762179215deae72fe2e6a7869e1) ) ROM_REGION( 0x600000, "sprites1", 0 ) - ROM_LOAD( "mam05.19a", 0x000000, 0x100000, CRC(307a2cd1) SHA1(d7a795e47cf1533f0bb5a96162c8025282abe09f) ) /* 6bpp sprites */ + ROM_LOAD( "mam05.19a", 0x000000, 0x100000, CRC(307a2cd1) SHA1(d7a795e47cf1533f0bb5a96162c8025282abe09f) ) // 6bpp sprites ROM_LOAD( "mam06.20a", 0x100000, 0x100000, CRC(a1119a2d) SHA1(876f9295c2032ce491b45a103ffafc750d8c78e1) ) ROM_LOAD( "mam10.19d", 0x200000, 0x100000, CRC(99f48f9f) SHA1(685787de54e9158ced80f3821996c3a63f2a72a2) ) ROM_LOAD( "mam11.20d", 0x300000, 0x100000, CRC(c3f12859) SHA1(45fdfd55f606316c936f0a9e6b4940740138d344) ) ROM_LOAD( "mam03.17a", 0x400000, 0x100000, CRC(fc4dfd48) SHA1(0c5f5a09833ebeb3018e65edd6f7ce06d4ba84ed) ) ROM_LOAD( "mam04.18a", 0x500000, 0x100000, CRC(7d3b38bf) SHA1(9f83ad7497ed57405ad648f403eb69f776567a50) ) - ROM_REGION(0x80000, "oki2", 0 ) /* Oki samples */ + ROM_REGION(0x80000, "oki2", 0 ) // Oki samples ROM_LOAD( "mam12.14p", 0x00000, 0x80000, CRC(6f00b791) SHA1(c9fbc9ab5ce84fec79efa0a23373be97a27bf898) ) - ROM_REGION(0x80000, "oki1", 0 ) /* Oki samples */ + ROM_REGION(0x80000, "oki1", 0 ) // Oki samples ROM_LOAD( "mam13.15p", 0x00000, 0x80000, CRC(525b9461) SHA1(1d9bb3725dfe601b05a779b84b4191455087b969) ) - ROM_REGION( 512, "proms", 0 ) - ROM_LOAD( "hb-00.11p", 0x00000, 0x200, CRC(b7a7baad) SHA1(39781c3412493b985d3616ac31142fc00bbcddf4) ) /* ? */ + ROM_REGION( 0x200, "proms", 0 ) + ROM_LOAD( "hb-00.11p", 0x00000, 0x200, CRC(b7a7baad) SHA1(39781c3412493b985d3616ac31142fc00bbcddf4) ) // ? ROM_END -ROM_START( wolffang ) /* Japan */ - ROM_REGION(0x200000, "maincpu", 0 ) /* 68000 code */ +ROM_START( wolffang ) // Japan + ROM_REGION(0x200000, "maincpu", 0 ) // 68000 code ROM_LOAD16_BYTE( "hw_00-1.2a", 0x000000, 0x40000, CRC(69dc611e) SHA1(37fc54df32cc8e0502b59d33d94a805dbd7018c5) ) ROM_LOAD16_BYTE( "hw_03-1.2d", 0x000001, 0x40000, CRC(b66d9680) SHA1(6bb97a720cc8a5df4051d8ae55586baf03cdc6bc) ) ROM_LOAD16_BYTE( "mam00.8a", 0x100000, 0x80000, CRC(0fa440a6) SHA1(f0f84c630fc30ec164acc21de871c857d391c398) ) ROM_LOAD16_BYTE( "mam07.8d", 0x100001, 0x80000, CRC(f8bc7f20) SHA1(909324248bd207f3b01d9f694975b629d8ccaa08) ) - ROM_REGION(0x10000, "audiocpu", 0 ) /* Sound CPU */ + ROM_REGION(0x10000, "audiocpu", 0 ) // Sound CPU ROM_LOAD( "hw_04-.18p", 0x00000, 0x10000, CRC(eb6608eb) SHA1(0233677970aba12783dd4d6d58d70568ef641115) ) ROM_REGION( 0x020000, "chars", 0 ) - ROM_LOAD16_BYTE( "hw_01-.13a", 0x00000, 0x10000, CRC(d9810ca4) SHA1(f8d85c93eaf8e26f115afff6193617caa864a6b7) ) /* Encrypted tiles */ + ROM_LOAD16_BYTE( "hw_01-.13a", 0x00000, 0x10000, CRC(d9810ca4) SHA1(f8d85c93eaf8e26f115afff6193617caa864a6b7) ) // Encrypted tiles ROM_LOAD16_BYTE( "hw_02-.14a", 0x00001, 0x10000, CRC(2a27ac8e) SHA1(9ed752cc212d29a621226deee79e62585232c923) ) ROM_REGION( 0x100000, "tiles1", 0 ) - ROM_LOAD( "mam01.10a", 0x000000, 0x080000, CRC(dbf4fbcc) SHA1(2f289556fd25beb7d30501cba17ac35ad28c5b91) ) /* Encrypted tiles */ + ROM_LOAD( "mam01.10a", 0x000000, 0x080000, CRC(dbf4fbcc) SHA1(2f289556fd25beb7d30501cba17ac35ad28c5b91) ) // Encrypted tiles ROM_LOAD( "mam02.11a", 0x080000, 0x080000, CRC(b1fac481) SHA1(da370499ea8ff7b3dd338b31f3799b760fd0d981) ) ROM_REGION( 0x200000, "tiles2", 0 ) - ROM_LOAD( "mam08.17d", 0x000000, 0x100000, CRC(ca97a83f) SHA1(2e097840ae56cf19ad2651d59c31182f47239d60) ) /* tiles 1 & 2 */ + ROM_LOAD( "mam08.17d", 0x000000, 0x100000, CRC(ca97a83f) SHA1(2e097840ae56cf19ad2651d59c31182f47239d60) ) // tiles 1 & 2 ROM_LOAD( "mam09.18d", 0x100000, 0x100000, CRC(3f57d56f) SHA1(0d4537da6ab62762179215deae72fe2e6a7869e1) ) ROM_REGION( 0x600000, "sprites1", 0 ) - ROM_LOAD( "mam05.19a", 0x000000, 0x100000, CRC(307a2cd1) SHA1(d7a795e47cf1533f0bb5a96162c8025282abe09f) ) /* 6bpp sprites */ + ROM_LOAD( "mam05.19a", 0x000000, 0x100000, CRC(307a2cd1) SHA1(d7a795e47cf1533f0bb5a96162c8025282abe09f) ) // 6bpp sprites ROM_LOAD( "mam06.20a", 0x100000, 0x100000, CRC(a1119a2d) SHA1(876f9295c2032ce491b45a103ffafc750d8c78e1) ) ROM_LOAD( "mam10.19d", 0x200000, 0x100000, CRC(99f48f9f) SHA1(685787de54e9158ced80f3821996c3a63f2a72a2) ) ROM_LOAD( "mam11.20d", 0x300000, 0x100000, CRC(c3f12859) SHA1(45fdfd55f606316c936f0a9e6b4940740138d344) ) ROM_LOAD( "mam03.17a", 0x400000, 0x100000, CRC(fc4dfd48) SHA1(0c5f5a09833ebeb3018e65edd6f7ce06d4ba84ed) ) ROM_LOAD( "mam04.18a", 0x500000, 0x100000, CRC(7d3b38bf) SHA1(9f83ad7497ed57405ad648f403eb69f776567a50) ) - ROM_REGION(0x80000, "oki2", 0 ) /* Oki samples */ + ROM_REGION(0x80000, "oki2", 0 ) // Oki samples ROM_LOAD( "mam12.14p", 0x00000, 0x80000, CRC(6f00b791) SHA1(c9fbc9ab5ce84fec79efa0a23373be97a27bf898) ) - ROM_REGION(0x80000, "oki1", 0 ) /* Oki samples */ + ROM_REGION(0x80000, "oki1", 0 ) // Oki samples ROM_LOAD( "mam13.15p", 0x00000, 0x80000, CRC(525b9461) SHA1(1d9bb3725dfe601b05a779b84b4191455087b969) ) - ROM_REGION( 512, "proms", 0 ) - ROM_LOAD( "hb-00.11p", 0x00000, 0x200, CRC(b7a7baad) SHA1(39781c3412493b985d3616ac31142fc00bbcddf4) ) /* ? */ + ROM_REGION( 0x200, "proms", 0 ) + ROM_LOAD( "hb-00.11p", 0x00000, 0x200, CRC(b7a7baad) SHA1(39781c3412493b985d3616ac31142fc00bbcddf4) ) // ? ROM_END ROM_START( wizdfire ) - ROM_REGION(0x200000, "maincpu", 0 ) /* 68000 code */ - ROM_LOAD16_BYTE( "je-01.3d", 0x000000, 0x20000, CRC(b6d62367) SHA1(e9521b28660f62b70e6e33c3e9cf345fc106eff6) ) /* Version 2.1 Over Sea */ + ROM_REGION(0x200000, "maincpu", 0 ) // 68000 code + ROM_LOAD16_BYTE( "je-01.3d", 0x000000, 0x20000, CRC(b6d62367) SHA1(e9521b28660f62b70e6e33c3e9cf345fc106eff6) ) // Version 2.1 Over Sea ROM_LOAD16_BYTE( "je-00.3a", 0x000001, 0x20000, CRC(f33de278) SHA1(9407a73f578ec312944fc69f247e83704d713174) ) ROM_LOAD16_BYTE( "je-03.5d", 0x040000, 0x20000, CRC(5217d404) SHA1(7cfcdb9e2c812bf0d4ac8306834242876ac47844) ) ROM_LOAD16_BYTE( "je-02.5a", 0x040001, 0x20000, CRC(36a1ce28) SHA1(62d52d720c89022de97759777230c45c460d8fb6) ) ROM_LOAD16_BYTE( "mas13", 0x080000, 0x80000, CRC(7e5256ce) SHA1(431d78ad185ba0216097f131fb2583a1a067e4f0) ) ROM_LOAD16_BYTE( "mas12", 0x080001, 0x80000, CRC(005bd499) SHA1(862079022f97bd11f2f33677dce55bd3b144a81b) ) - ROM_REGION(0x10000, "audiocpu", 0 ) /* Sound CPU */ + ROM_REGION(0x10000, "audiocpu", 0 ) // Sound CPU ROM_LOAD( "je-06.20r", 0x00000, 0x10000, CRC(79042546) SHA1(231561df9415a289756a533709f610894fb9176e) ) ROM_REGION( 0x020000, "chars", 0 ) - ROM_LOAD16_BYTE( "je-04.10d", 0x00000, 0x10000, CRC(73cba800) SHA1(dd7612fe1482713fcee5960b7db158be872d7fda) ) /* Chars */ + ROM_LOAD16_BYTE( "je-04.10d", 0x00000, 0x10000, CRC(73cba800) SHA1(dd7612fe1482713fcee5960b7db158be872d7fda) ) // Chars ROM_LOAD16_BYTE( "je-05.12d", 0x00001, 0x10000, CRC(22e2c49d) SHA1(06cc2d0476156d1f521c4c57621ce3922a23aa04) ) ROM_REGION( 0x200000, "tiles1", 0 ) - ROM_LOAD( "mas00", 0x000000, 0x100000, CRC(3d011034) SHA1(167d6d088d51a41f196be104d795ffe24297c96a) ) /* Tiles */ + ROM_LOAD( "mas00", 0x000000, 0x100000, CRC(3d011034) SHA1(167d6d088d51a41f196be104d795ffe24297c96a) ) // Tiles ROM_LOAD( "mas01", 0x100000, 0x100000, CRC(6d0c9d0b) SHA1(63e19dfd6451810637664b08e880aef139ca6ed5) ) ROM_REGION( 0x100000, "tiles2", 0 ) @@ -1338,44 +1338,89 @@ ROM_START( wizdfire ) ROM_LOAD( "mas03", 0x080000, 0x080000, CRC(2fe61ea2) SHA1(0909e6c689c3e10225d7c074bd654ff2ada96983) ) ROM_REGION( 0x400000, "sprites1", 0 ) - ROM_LOAD( "mas04", 0x000000, 0x100000, CRC(1e56953b) SHA1(0655ac7f3c5030a80c2d6bad5c3a79b2cb1ae4a2) ) /* Sprites #1 */ + ROM_LOAD( "mas04", 0x000000, 0x100000, CRC(1e56953b) SHA1(0655ac7f3c5030a80c2d6bad5c3a79b2cb1ae4a2) ) // Sprites #1 ROM_LOAD( "mas05", 0x200000, 0x100000, CRC(3826b8f8) SHA1(d59197b4e0525b86876f9cce6fbf80caba976851) ) ROM_LOAD( "mas06", 0x100000, 0x100000, CRC(3b8bbd45) SHA1(c9f9d4daf9c0cba5385af26f3762b29c291ff62b) ) ROM_LOAD( "mas07", 0x300000, 0x100000, CRC(31303769) SHA1(509604be06ec8e0c1b56a81a8ffccdf0f79e9fd7) ) ROM_REGION( 0x100000, "sprites2", 0 ) - ROM_LOAD( "mas08", 0x000000, 0x080000, CRC(e224fb7a) SHA1(9aa92fb98bddff313db2077c4db102e94c7af09b) ) /* Sprites #2 */ + ROM_LOAD( "mas08", 0x000000, 0x080000, CRC(e224fb7a) SHA1(9aa92fb98bddff313db2077c4db102e94c7af09b) ) // Sprites #2 ROM_LOAD( "mas09", 0x080000, 0x080000, CRC(5f6deb41) SHA1(850d0e157b4355e866ec770a2012293b2c55648f) ) - ROM_REGION(0x100000, "oki1", 0 ) /* Oki samples */ + ROM_REGION(0x100000, "oki1", 0 ) // Oki samples ROM_LOAD( "mas10", 0x80000, 0x80000, CRC(f4b4c8a1) SHA1(c9e80c55e42a78e358b6b14dadc3be7b28bd5d62) ) ROM_CONTINUE(0x00000, 0x80000) - ROM_REGION(0x080000, "oki2", 0 ) /* Oki samples */ + ROM_REGION(0x080000, "oki2", 0 ) // Oki samples ROM_LOAD( "mas11", 0x00000, 0x080000, CRC(c2f0a4f2) SHA1(af71d649aea273c17d7fbcf8693e8a1d4b31f7f8) ) - ROM_REGION( 1024, "proms", 0 ) - ROM_LOAD( "mb7122h.16l", 0x00000, 0x400, CRC(2bee57cc) SHA1(bc48670aa7c39f6ff7fae4c819eab22ed2db875b) ) /* Priority (unused) */ + ROM_REGION( 0x400, "proms", 0 ) + ROM_LOAD( "mb7122h.16l", 0x00000, 0x400, CRC(2bee57cc) SHA1(bc48670aa7c39f6ff7fae4c819eab22ed2db875b) ) // Priority (unused) +ROM_END + +ROM_START( wizdfirea ) + ROM_REGION(0x200000, "maincpu", 0 ) // 68000 code + ROM_LOAD16_BYTE( "mm-01.3d", 0x000000, 0x20000, CRC(ebaecff7) SHA1(965bc57e530e4143932ce7c2fd1e338feee1bbcd) ) // Version 1.0 Over Sea + ROM_LOAD16_BYTE( "mm-00.3a", 0x000001, 0x20000, CRC(56e05ec0) SHA1(d18cca32a6ebc20aeb3d6aa5d183766491302fcf) ) + ROM_LOAD16_BYTE( "je-03.5d", 0x040000, 0x20000, CRC(5217d404) SHA1(7cfcdb9e2c812bf0d4ac8306834242876ac47844) ) + ROM_LOAD16_BYTE( "je-02.5a", 0x040001, 0x20000, CRC(36a1ce28) SHA1(62d52d720c89022de97759777230c45c460d8fb6) ) + ROM_LOAD16_BYTE( "mas13", 0x080000, 0x80000, CRC(7e5256ce) SHA1(431d78ad185ba0216097f131fb2583a1a067e4f0) ) + ROM_LOAD16_BYTE( "mas12", 0x080001, 0x80000, CRC(005bd499) SHA1(862079022f97bd11f2f33677dce55bd3b144a81b) ) + + ROM_REGION(0x10000, "audiocpu", 0 ) // Sound CPU + ROM_LOAD( "je-06.20r", 0x00000, 0x10000, CRC(79042546) SHA1(231561df9415a289756a533709f610894fb9176e) ) + + ROM_REGION( 0x020000, "chars", 0 ) + ROM_LOAD16_BYTE( "je-04.10d", 0x00000, 0x10000, CRC(73cba800) SHA1(dd7612fe1482713fcee5960b7db158be872d7fda) ) // Chars + ROM_LOAD16_BYTE( "je-05.12d", 0x00001, 0x10000, CRC(22e2c49d) SHA1(06cc2d0476156d1f521c4c57621ce3922a23aa04) ) + + ROM_REGION( 0x200000, "tiles1", 0 ) + ROM_LOAD( "mas00", 0x000000, 0x100000, CRC(3d011034) SHA1(167d6d088d51a41f196be104d795ffe24297c96a) ) // Tiles + ROM_LOAD( "mas01", 0x100000, 0x100000, CRC(6d0c9d0b) SHA1(63e19dfd6451810637664b08e880aef139ca6ed5) ) + + ROM_REGION( 0x100000, "tiles2", 0 ) + ROM_LOAD( "mas02", 0x000000, 0x080000, CRC(af00e620) SHA1(43f4680b22ac6baf840274462c07fee68a2fbdfb) ) + ROM_LOAD( "mas03", 0x080000, 0x080000, CRC(2fe61ea2) SHA1(0909e6c689c3e10225d7c074bd654ff2ada96983) ) + + ROM_REGION( 0x400000, "sprites1", 0 ) + ROM_LOAD( "mas04", 0x000000, 0x100000, CRC(1e56953b) SHA1(0655ac7f3c5030a80c2d6bad5c3a79b2cb1ae4a2) ) // Sprites #1 + ROM_LOAD( "mas05", 0x200000, 0x100000, CRC(3826b8f8) SHA1(d59197b4e0525b86876f9cce6fbf80caba976851) ) + ROM_LOAD( "mas06", 0x100000, 0x100000, CRC(3b8bbd45) SHA1(c9f9d4daf9c0cba5385af26f3762b29c291ff62b) ) + ROM_LOAD( "mas07", 0x300000, 0x100000, CRC(31303769) SHA1(509604be06ec8e0c1b56a81a8ffccdf0f79e9fd7) ) + + ROM_REGION( 0x100000, "sprites2", 0 ) + ROM_LOAD( "mas08", 0x000000, 0x080000, CRC(e224fb7a) SHA1(9aa92fb98bddff313db2077c4db102e94c7af09b) ) // Sprites #2 + ROM_LOAD( "mas09", 0x080000, 0x080000, CRC(5f6deb41) SHA1(850d0e157b4355e866ec770a2012293b2c55648f) ) + + ROM_REGION(0x100000, "oki1", 0 ) // Oki samples + ROM_LOAD( "mas10", 0x80000, 0x80000, CRC(f4b4c8a1) SHA1(c9e80c55e42a78e358b6b14dadc3be7b28bd5d62) ) + ROM_CONTINUE(0x00000, 0x80000) + + ROM_REGION(0x080000, "oki2", 0 ) // Oki samples + ROM_LOAD( "mas11", 0x00000, 0x080000, CRC(c2f0a4f2) SHA1(af71d649aea273c17d7fbcf8693e8a1d4b31f7f8) ) + + ROM_REGION( 0x400, "proms", 0 ) + ROM_LOAD( "mb7122h.16l", 0x000, 0x400, CRC(2bee57cc) SHA1(bc48670aa7c39f6ff7fae4c819eab22ed2db875b) ) // Priority (unused) ROM_END ROM_START( wizdfireu ) - ROM_REGION(0x200000, "maincpu", 0 ) /* 68000 code */ - ROM_LOAD16_BYTE( "jf-01.3d", 0x000000, 0x20000, CRC(bde42a41) SHA1(0379de9c4cdcce35554b5dc15241ed2c4f0d7611) ) /* Version 1.1 US */ + ROM_REGION(0x200000, "maincpu", 0 ) // 68000 code + ROM_LOAD16_BYTE( "jf-01.3d", 0x000000, 0x20000, CRC(bde42a41) SHA1(0379de9c4cdcce35554b5dc15241ed2c4f0d7611) ) // Version 1.1 US ROM_LOAD16_BYTE( "jf-00.3a", 0x000001, 0x20000, CRC(bca3c995) SHA1(dbebc9e301c04ee82ca4b658d3ab870790d1605b) ) ROM_LOAD16_BYTE( "jf-03.5d", 0x040000, 0x20000, CRC(5217d404) SHA1(7cfcdb9e2c812bf0d4ac8306834242876ac47844) ) ROM_LOAD16_BYTE( "jf-02.5a", 0x040001, 0x20000, CRC(36a1ce28) SHA1(62d52d720c89022de97759777230c45c460d8fb6) ) ROM_LOAD16_BYTE( "mas13", 0x080000, 0x80000, CRC(7e5256ce) SHA1(431d78ad185ba0216097f131fb2583a1a067e4f0) ) ROM_LOAD16_BYTE( "mas12", 0x080001, 0x80000, CRC(005bd499) SHA1(862079022f97bd11f2f33677dce55bd3b144a81b) ) - ROM_REGION(0x10000, "audiocpu", 0 ) /* Sound CPU */ + ROM_REGION(0x10000, "audiocpu", 0 ) // Sound CPU ROM_LOAD( "jf-06.20r", 0x00000, 0x10000, CRC(79042546) SHA1(231561df9415a289756a533709f610894fb9176e) ) ROM_REGION( 0x020000, "chars", 0 ) - ROM_LOAD16_BYTE( "jf-04.10d", 0x00000, 0x10000, CRC(73cba800) SHA1(dd7612fe1482713fcee5960b7db158be872d7fda) ) /* Chars */ + ROM_LOAD16_BYTE( "jf-04.10d", 0x00000, 0x10000, CRC(73cba800) SHA1(dd7612fe1482713fcee5960b7db158be872d7fda) ) // Chars ROM_LOAD16_BYTE( "jf-05.12d", 0x00001, 0x10000, CRC(22e2c49d) SHA1(06cc2d0476156d1f521c4c57621ce3922a23aa04) ) ROM_REGION( 0x200000, "tiles1", 0 ) - ROM_LOAD( "mas00", 0x000000, 0x100000, CRC(3d011034) SHA1(167d6d088d51a41f196be104d795ffe24297c96a) ) /* Tiles */ + ROM_LOAD( "mas00", 0x000000, 0x100000, CRC(3d011034) SHA1(167d6d088d51a41f196be104d795ffe24297c96a) ) // Tiles ROM_LOAD( "mas01", 0x100000, 0x100000, CRC(6d0c9d0b) SHA1(63e19dfd6451810637664b08e880aef139ca6ed5) ) ROM_REGION( 0x100000, "tiles2", 0 ) @@ -1383,44 +1428,44 @@ ROM_START( wizdfireu ) ROM_LOAD( "mas03", 0x080000, 0x080000, CRC(2fe61ea2) SHA1(0909e6c689c3e10225d7c074bd654ff2ada96983) ) ROM_REGION( 0x400000, "sprites1", 0 ) - ROM_LOAD( "mas04", 0x000000, 0x100000, CRC(1e56953b) SHA1(0655ac7f3c5030a80c2d6bad5c3a79b2cb1ae4a2) ) /* Sprites #1 */ + ROM_LOAD( "mas04", 0x000000, 0x100000, CRC(1e56953b) SHA1(0655ac7f3c5030a80c2d6bad5c3a79b2cb1ae4a2) ) // Sprites #1 ROM_LOAD( "mas05", 0x200000, 0x100000, CRC(3826b8f8) SHA1(d59197b4e0525b86876f9cce6fbf80caba976851) ) ROM_LOAD( "mas06", 0x100000, 0x100000, CRC(3b8bbd45) SHA1(c9f9d4daf9c0cba5385af26f3762b29c291ff62b) ) ROM_LOAD( "mas07", 0x300000, 0x100000, CRC(31303769) SHA1(509604be06ec8e0c1b56a81a8ffccdf0f79e9fd7) ) ROM_REGION( 0x100000, "sprites2", 0 ) - ROM_LOAD( "mas08", 0x000000, 0x080000, CRC(e224fb7a) SHA1(9aa92fb98bddff313db2077c4db102e94c7af09b) ) /* Sprites #2 */ + ROM_LOAD( "mas08", 0x000000, 0x080000, CRC(e224fb7a) SHA1(9aa92fb98bddff313db2077c4db102e94c7af09b) ) // Sprites #2 ROM_LOAD( "mas09", 0x080000, 0x080000, CRC(5f6deb41) SHA1(850d0e157b4355e866ec770a2012293b2c55648f) ) - ROM_REGION(0x100000, "oki1", 0 ) /* Oki samples */ + ROM_REGION(0x100000, "oki1", 0 ) // Oki samples ROM_LOAD( "mas10", 0x80000, 0x80000, CRC(f4b4c8a1) SHA1(c9e80c55e42a78e358b6b14dadc3be7b28bd5d62) ) ROM_CONTINUE(0x00000, 0x80000) - ROM_REGION(0x080000, "oki2", 0 ) /* Oki samples */ + ROM_REGION(0x080000, "oki2", 0 ) // Oki samples ROM_LOAD( "mas11", 0x00000, 0x080000, CRC(c2f0a4f2) SHA1(af71d649aea273c17d7fbcf8693e8a1d4b31f7f8) ) - ROM_REGION( 1024, "proms", 0 ) - ROM_LOAD( "mb7122h.16l", 0x00000, 0x400, CRC(2bee57cc) SHA1(bc48670aa7c39f6ff7fae4c819eab22ed2db875b) ) /* Priority (unused) */ + ROM_REGION( 0x400, "proms", 0 ) + ROM_LOAD( "mb7122h.16l", 0x00000, 0x400, CRC(2bee57cc) SHA1(bc48670aa7c39f6ff7fae4c819eab22ed2db875b) ) // Priority (unused) ROM_END ROM_START( darkseal2 ) - ROM_REGION(0x200000, "maincpu", 0 ) /* 68000 code */ - ROM_LOAD16_BYTE( "jb-01-3.3d", 0x000000, 0x20000, CRC(82308c01) SHA1(aa0733e244f14f2c84b6929236771cbc99532bb2) ) /* Version 2.1 Japan */ + ROM_REGION(0x200000, "maincpu", 0 ) // 68000 code + ROM_LOAD16_BYTE( "jb-01-3.3d", 0x000000, 0x20000, CRC(82308c01) SHA1(aa0733e244f14f2c84b6929236771cbc99532bb2) ) // Version 2.1 Japan ROM_LOAD16_BYTE( "jb-00-3.3a", 0x000001, 0x20000, CRC(1d38113a) SHA1(69dc5a4dbe9d9737df198240f3db6f2115e311a5) ) ROM_LOAD16_BYTE( "jb-03.5d", 0x040000, 0x20000, CRC(5217d404) SHA1(7cfcdb9e2c812bf0d4ac8306834242876ac47844) ) ROM_LOAD16_BYTE( "jb-02.5a", 0x040001, 0x20000, CRC(36a1ce28) SHA1(62d52d720c89022de97759777230c45c460d8fb6) ) ROM_LOAD16_BYTE( "mas13", 0x080000, 0x80000, CRC(7e5256ce) SHA1(431d78ad185ba0216097f131fb2583a1a067e4f0) ) ROM_LOAD16_BYTE( "mas12", 0x080001, 0x80000, CRC(005bd499) SHA1(862079022f97bd11f2f33677dce55bd3b144a81b) ) - ROM_REGION(0x10000, "audiocpu", 0 ) /* Sound CPU */ + ROM_REGION(0x10000, "audiocpu", 0 ) // Sound CPU ROM_LOAD( "jb-06.20r", 0x00000, 0x10000, CRC(2066a1dd) SHA1(a0d136e90825fa9c089894a6852c634676d64579) ) ROM_REGION( 0x020000, "chars", 0 ) - ROM_LOAD16_BYTE( "jb-04.10d", 0x00000, 0x10000, CRC(73cba800) SHA1(dd7612fe1482713fcee5960b7db158be872d7fda) ) /* Chars */ + ROM_LOAD16_BYTE( "jb-04.10d", 0x00000, 0x10000, CRC(73cba800) SHA1(dd7612fe1482713fcee5960b7db158be872d7fda) ) // Chars ROM_LOAD16_BYTE( "jb-05.12d", 0x00001, 0x10000, CRC(22e2c49d) SHA1(06cc2d0476156d1f521c4c57621ce3922a23aa04) ) ROM_REGION( 0x200000, "tiles1", 0 ) - ROM_LOAD( "mas00", 0x000000, 0x100000, CRC(3d011034) SHA1(167d6d088d51a41f196be104d795ffe24297c96a) ) /* Tiles */ + ROM_LOAD( "mas00", 0x000000, 0x100000, CRC(3d011034) SHA1(167d6d088d51a41f196be104d795ffe24297c96a) ) // Tiles ROM_LOAD( "mas01", 0x100000, 0x100000, CRC(6d0c9d0b) SHA1(63e19dfd6451810637664b08e880aef139ca6ed5) ) ROM_REGION( 0x100000, "tiles2", 0 ) @@ -1428,223 +1473,223 @@ ROM_START( darkseal2 ) ROM_LOAD( "mas03", 0x080000, 0x080000, CRC(2fe61ea2) SHA1(0909e6c689c3e10225d7c074bd654ff2ada96983) ) ROM_REGION( 0x400000, "sprites1", 0 ) - ROM_LOAD( "mas04", 0x000000, 0x100000, CRC(1e56953b) SHA1(0655ac7f3c5030a80c2d6bad5c3a79b2cb1ae4a2) ) /* Sprites #1 */ + ROM_LOAD( "mas04", 0x000000, 0x100000, CRC(1e56953b) SHA1(0655ac7f3c5030a80c2d6bad5c3a79b2cb1ae4a2) ) // Sprites #1 ROM_LOAD( "mas05", 0x200000, 0x100000, CRC(3826b8f8) SHA1(d59197b4e0525b86876f9cce6fbf80caba976851) ) ROM_LOAD( "mas06", 0x100000, 0x100000, CRC(3b8bbd45) SHA1(c9f9d4daf9c0cba5385af26f3762b29c291ff62b) ) ROM_LOAD( "mas07", 0x300000, 0x100000, CRC(31303769) SHA1(509604be06ec8e0c1b56a81a8ffccdf0f79e9fd7) ) ROM_REGION( 0x100000, "sprites2", 0 ) - ROM_LOAD( "mas08", 0x000000, 0x080000, CRC(e224fb7a) SHA1(9aa92fb98bddff313db2077c4db102e94c7af09b) ) /* Sprites #2 */ + ROM_LOAD( "mas08", 0x000000, 0x080000, CRC(e224fb7a) SHA1(9aa92fb98bddff313db2077c4db102e94c7af09b) ) // Sprites #2 ROM_LOAD( "mas09", 0x080000, 0x080000, CRC(5f6deb41) SHA1(850d0e157b4355e866ec770a2012293b2c55648f) ) - ROM_REGION(0x100000, "oki1", 0 ) /* Oki samples */ + ROM_REGION(0x100000, "oki1", 0 ) // Oki samples ROM_LOAD( "mas10", 0x00000, 0x100000, CRC(f4b4c8a1) SHA1(c9e80c55e42a78e358b6b14dadc3be7b28bd5d62) ) - ROM_REGION(0x080000, "oki2", 0 ) /* Oki samples */ + ROM_REGION(0x080000, "oki2", 0 ) // Oki samples ROM_LOAD( "mas11", 0x00000, 0x080000, CRC(c2f0a4f2) SHA1(af71d649aea273c17d7fbcf8693e8a1d4b31f7f8) ) - ROM_REGION( 1024, "proms", 0 ) - ROM_LOAD( "mb7122h.16l", 0x00000, 0x400, CRC(2bee57cc) SHA1(bc48670aa7c39f6ff7fae4c819eab22ed2db875b) ) /* Priority (unused) */ + ROM_REGION( 0x400, "proms", 0 ) + ROM_LOAD( "mb7122h.16l", 0x00000, 0x400, CRC(2bee57cc) SHA1(bc48670aa7c39f6ff7fae4c819eab22ed2db875b) ) // Priority (unused) ROM_END ROM_START( nitrobal ) - ROM_REGION(0x200000, "maincpu", 0 ) /* 68000 code */ + ROM_REGION(0x200000, "maincpu", 0 ) // 68000 code ROM_LOAD16_BYTE( "jl01-4.d3", 0x000000, 0x20000, CRC(0414e409) SHA1(bc19e7d2d9e768ce4052511043867c0ef9b0b61b) ) ROM_LOAD16_BYTE( "jl00-4.b3", 0x000001, 0x20000, CRC(dd9e2bcc) SHA1(dede49a4fafcfa03f38ba6c1149c9f8b115fb306) ) ROM_LOAD16_BYTE( "jl03-4.d5", 0x040000, 0x20000, CRC(ea264ac5) SHA1(ccdb87bbdd9e38537dd290d237d76ec32559efa3) ) ROM_LOAD16_BYTE( "jl02-4.b5", 0x040001, 0x20000, CRC(74047997) SHA1(bfd2f24889250e06945bb4798b40a56f832a9b19) ) ROM_LOAD16_BYTE( "jl05-2.d6", 0x080000, 0x40000, CRC(b820fa20) SHA1(8509567cf988fe27552d37241b25b66a6e1a9c39) ) ROM_LOAD16_BYTE( "jl04-2.b6", 0x080001, 0x40000, CRC(1fd8995b) SHA1(75d77835500e4b7caca92ba634859d7a2ad9b84c) ) - /* Two empty rom slots at d7, b7 */ + // Two empty ROM slots at d7, b7 - ROM_REGION(0x10000, "audiocpu", 0 ) /* Sound CPU */ + ROM_REGION(0x10000, "audiocpu", 0 ) // Sound CPU ROM_LOAD( "jl08.r20", 0x00000, 0x10000, CRC(93d93fe1) SHA1(efc618724251d23a23b3019d475f7739a7e88751) ) ROM_REGION( 0x020000, "chars", 0 ) - ROM_LOAD16_BYTE( "jl06.d10", 0x00000, 0x10000, CRC(91cf668e) SHA1(fc153eaa09777f79369037a139470ad1118e8d7e) ) /* Chars */ + ROM_LOAD16_BYTE( "jl06.d10", 0x00000, 0x10000, CRC(91cf668e) SHA1(fc153eaa09777f79369037a139470ad1118e8d7e) ) // Chars ROM_LOAD16_BYTE( "jl07.d12", 0x00001, 0x10000, CRC(e61d0e42) SHA1(80d6ada356c721b0be826554ec6731dbbc19e0ab) ) ROM_REGION( 0x100000, "tiles1", 0 ) - ROM_LOAD( "mav00.b10", 0x00000, 0x80000, CRC(34785d97) SHA1(094f881cd699d1b9fd079778f20f8c9d83283e6e) ) /* Tiles */ + ROM_LOAD( "mav00.b10", 0x00000, 0x80000, CRC(34785d97) SHA1(094f881cd699d1b9fd079778f20f8c9d83283e6e) ) // Tiles ROM_LOAD( "mav01.b12", 0x80000, 0x80000, CRC(8b531b16) SHA1(f734286f4510b2c09dc2d6d2b8c8da9dc4424287) ) ROM_REGION( 0x200000, "tiles2", 0 ) - ROM_LOAD( "mav02.b16", 0x000000, 0x100000, CRC(20723bf7) SHA1(b3491d98ff415701fec2b58d85f99c743d71b013) ) /* Tiles */ + ROM_LOAD( "mav02.b16", 0x000000, 0x100000, CRC(20723bf7) SHA1(b3491d98ff415701fec2b58d85f99c743d71b013) ) // Tiles ROM_LOAD( "mav03.e16", 0x100000, 0x100000, CRC(ef6195f0) SHA1(491bc030519c78b84396f7f8a21df9daf8acc140) ) ROM_REGION( 0x300000, "sprites1", 0 ) - ROM_LOAD( "mav04.b19", 0x000000, 0x100000, CRC(8ba48385) SHA1(926ae1e0e99b8e022b6798ceb29dd080cfc1bada) ) /* Sprites #1 */ + ROM_LOAD( "mav04.b19", 0x000000, 0x100000, CRC(8ba48385) SHA1(926ae1e0e99b8e022b6798ceb29dd080cfc1bada) ) // Sprites #1 ROM_LOAD( "mav05.e19", 0x180000, 0x100000, CRC(d92d769c) SHA1(8012e7f2b9a7cbccde8da90025647443beb6c47c) ) ROM_LOAD( "mav06.b20", 0x100000, 0x080000, CRC(ae6201a5) SHA1(c0ae87fa96d12377c5522cb8adfed03373ab3757) ) ROM_LOAD( "mav07.e20", 0x280000, 0x080000, CRC(5fc10ccd) SHA1(7debcf223802d5c2ea3d29d39850c8756c863b31) ) ROM_REGION( 0x80000, "sprites2", 0 ) - ROM_LOAD( "mav08.b23", 0x000000, 0x040000, CRC(64966576) SHA1(40c14c0f62eef0317abfb7192505e0337fb5cde5) ) /* Sprites #2 */ + ROM_LOAD( "mav08.b23", 0x000000, 0x040000, CRC(64966576) SHA1(40c14c0f62eef0317abfb7192505e0337fb5cde5) ) // Sprites #2 ROM_LOAD( "mav09.e23", 0x040000, 0x040000, CRC(1ce7b51a) SHA1(17ed8f34bf6d057e0504e72e95f448d5923aa82e) ) - ROM_REGION(0x80000, "oki1", 0 ) /* Oki samples */ + ROM_REGION(0x80000, "oki1", 0 ) // Oki samples ROM_LOAD( "mav10.r17", 0x00000, 0x80000, CRC(8ad734b0) SHA1(768b9f54bbf4b54591cafecb7a27960da919ce84) ) - ROM_REGION(0x80000, "oki2", 0 ) /* Oki samples */ + ROM_REGION(0x80000, "oki2", 0 ) // Oki samples ROM_LOAD( "mav11.r19", 0x00000, 0x80000, CRC(ef513908) SHA1(72db6c704071d7a784b3768c256fc51087e9e93c) ) - ROM_REGION( 1024, "proms", 0 ) - ROM_LOAD( "jn-00.17l", 0x00000, 0x400, CRC(6ac77b84) SHA1(9e1e2cabdb20b819e592a0f07d15658062227fa4) ) /* Priority (unused) */ + ROM_REGION( 0x400, "proms", 0 ) + ROM_LOAD( "jn-00.17l", 0x00000, 0x400, CRC(6ac77b84) SHA1(9e1e2cabdb20b819e592a0f07d15658062227fa4) ) // Priority (unused) ROM_END ROM_START( nitrobala ) - ROM_REGION(0x200000, "maincpu", 0 ) /* 68000 code */ // roms had no labels + ROM_REGION(0x200000, "maincpu", 0 ) // 68000 code // roms had no labels ROM_LOAD16_BYTE( "3d", 0x000000, 0x20000, CRC(48f77c19) SHA1(d6d4f10246c6f098503a0c126c1d8e3155063c32) ) ROM_LOAD16_BYTE( "3b", 0x000001, 0x20000, CRC(fb1284e9) SHA1(13e9852011965b1cf12d8568d043aec92f6df2cd) ) ROM_LOAD16_BYTE( "5d", 0x040000, 0x20000, CRC(ac47367a) SHA1(f0efe6860ca83e7506491b62bc0ad62fa4c2ed1c) ) ROM_LOAD16_BYTE( "5b", 0x040001, 0x20000, CRC(a8e9d7dd) SHA1(19b4ed6501c44c9ac0fdbbfe4dec65efec4b700f) ) ROM_LOAD16_BYTE( "6d", 0x080000, 0x40000, CRC(59e620cc) SHA1(60d4e9622008a32c2addf12a266817cc723635ab) ) // 7ee3 - 7f06 are 0xff instead of 0x00 in the nitrobal set, why? ROM_LOAD16_BYTE( "6b", 0x080001, 0x40000, CRC(1fd8995b) SHA1(75d77835500e4b7caca92ba634859d7a2ad9b84c) ) // this half of the pair matches - /* Two empty rom slots at d7, b7 */ + // Two empty ROM slots at d7, b7 - ROM_REGION(0x10000, "audiocpu", 0 ) /* Sound CPU */ + ROM_REGION(0x10000, "audiocpu", 0 ) // Sound CPU ROM_LOAD( "jl08.r20", 0x00000, 0x10000, CRC(93d93fe1) SHA1(efc618724251d23a23b3019d475f7739a7e88751) ) ROM_REGION( 0x020000, "chars", 0 ) - ROM_LOAD16_BYTE( "jl06.d10", 0x00000, 0x10000, CRC(91cf668e) SHA1(fc153eaa09777f79369037a139470ad1118e8d7e) ) /* Chars */ + ROM_LOAD16_BYTE( "jl06.d10", 0x00000, 0x10000, CRC(91cf668e) SHA1(fc153eaa09777f79369037a139470ad1118e8d7e) ) // Chars ROM_LOAD16_BYTE( "jl07.d12", 0x00001, 0x10000, CRC(e61d0e42) SHA1(80d6ada356c721b0be826554ec6731dbbc19e0ab) ) ROM_REGION( 0x100000, "tiles1", 0 ) - ROM_LOAD( "mav00.b10", 0x00000, 0x80000, CRC(34785d97) SHA1(094f881cd699d1b9fd079778f20f8c9d83283e6e) ) /* Tiles */ + ROM_LOAD( "mav00.b10", 0x00000, 0x80000, CRC(34785d97) SHA1(094f881cd699d1b9fd079778f20f8c9d83283e6e) ) // Tiles ROM_LOAD( "mav01.b12", 0x80000, 0x80000, CRC(8b531b16) SHA1(f734286f4510b2c09dc2d6d2b8c8da9dc4424287) ) ROM_REGION( 0x200000, "tiles2", 0 ) - ROM_LOAD( "mav02.b16", 0x000000, 0x100000, CRC(20723bf7) SHA1(b3491d98ff415701fec2b58d85f99c743d71b013) ) /* Tiles */ + ROM_LOAD( "mav02.b16", 0x000000, 0x100000, CRC(20723bf7) SHA1(b3491d98ff415701fec2b58d85f99c743d71b013) ) // Tiles ROM_LOAD( "mav03.e16", 0x100000, 0x100000, CRC(ef6195f0) SHA1(491bc030519c78b84396f7f8a21df9daf8acc140) ) ROM_REGION( 0x300000, "sprites1", 0 ) - ROM_LOAD( "mav04.b19", 0x000000, 0x100000, CRC(8ba48385) SHA1(926ae1e0e99b8e022b6798ceb29dd080cfc1bada) ) /* Sprites #1 */ + ROM_LOAD( "mav04.b19", 0x000000, 0x100000, CRC(8ba48385) SHA1(926ae1e0e99b8e022b6798ceb29dd080cfc1bada) ) // Sprites #1 ROM_LOAD( "mav05.e19", 0x180000, 0x100000, CRC(d92d769c) SHA1(8012e7f2b9a7cbccde8da90025647443beb6c47c) ) ROM_LOAD( "mav06.b20", 0x100000, 0x080000, CRC(ae6201a5) SHA1(c0ae87fa96d12377c5522cb8adfed03373ab3757) ) ROM_LOAD( "mav07.e20", 0x280000, 0x080000, CRC(5fc10ccd) SHA1(7debcf223802d5c2ea3d29d39850c8756c863b31) ) ROM_REGION( 0x80000, "sprites2", 0 ) - ROM_LOAD( "mav08.b23", 0x000000, 0x040000, CRC(64966576) SHA1(40c14c0f62eef0317abfb7192505e0337fb5cde5) ) /* Sprites #2 */ + ROM_LOAD( "mav08.b23", 0x000000, 0x040000, CRC(64966576) SHA1(40c14c0f62eef0317abfb7192505e0337fb5cde5) ) // Sprites #2 ROM_LOAD( "mav09.e23", 0x040000, 0x040000, CRC(1ce7b51a) SHA1(17ed8f34bf6d057e0504e72e95f448d5923aa82e) ) - ROM_REGION(0x80000, "oki1", 0 ) /* Oki samples */ + ROM_REGION(0x80000, "oki1", 0 ) // Oki samples ROM_LOAD( "mav10.r17", 0x00000, 0x80000, CRC(8ad734b0) SHA1(768b9f54bbf4b54591cafecb7a27960da919ce84) ) - ROM_REGION(0x80000, "oki2", 0 ) /* Oki samples */ + ROM_REGION(0x80000, "oki2", 0 ) // Oki samples ROM_LOAD( "mav11.r19", 0x00000, 0x80000, CRC(ef513908) SHA1(72db6c704071d7a784b3768c256fc51087e9e93c) ) - ROM_REGION( 1024, "proms", 0 ) - ROM_LOAD( "jn-00.17l", 0x00000, 0x400, CRC(6ac77b84) SHA1(9e1e2cabdb20b819e592a0f07d15658062227fa4) ) /* Priority (unused) */ + ROM_REGION( 0x400, "proms", 0 ) + ROM_LOAD( "jn-00.17l", 0x00000, 0x400, CRC(6ac77b84) SHA1(9e1e2cabdb20b819e592a0f07d15658062227fa4) ) // Priority (unused) ROM_END ROM_START( nitrobalb ) - ROM_REGION(0x200000, "maincpu", 0 ) /* 68000 code */ + ROM_REGION(0x200000, "maincpu", 0 ) // 68000 code ROM_LOAD16_BYTE( "mm-01.d3", 0x000000, 0x20000, CRC(81ca7ef0) SHA1(7090dc77eaee57805f723ef1c21e245d8c9e5c20) ) ROM_LOAD16_BYTE( "mm-00.b3", 0x000001, 0x20000, CRC(e3416c4f) SHA1(8cbe6e1d5248c85112d7059aeecc1e185fdd77d7) ) ROM_LOAD16_BYTE( "mm-03.d5", 0x040000, 0x20000, CRC(ed9792aa) SHA1(b540a828b5d7f4859e2b927b8ca843f0462d0b0b) ) ROM_LOAD16_BYTE( "mm-02.b5", 0x040001, 0x20000, CRC(9a568ed3) SHA1(acc254af3c9079eb91af52fcfda18c1cfadfd1ce) ) ROM_LOAD16_BYTE( "mm-05.d6", 0x080000, 0x40000, CRC(b820fa20) SHA1(8509567cf988fe27552d37241b25b66a6e1a9c39) ) ROM_LOAD16_BYTE( "mm-04.b6", 0x080001, 0x40000, CRC(1fd8995b) SHA1(75d77835500e4b7caca92ba634859d7a2ad9b84c) ) - /* Two empty rom slots at d7, b7 */ + // Two empty ROM slots at d7, b7 - ROM_REGION(0x10000, "audiocpu", 0 ) /* Sound CPU */ + ROM_REGION(0x10000, "audiocpu", 0 ) // Sound CPU ROM_LOAD( "mm-08.r20", 0x00000, 0x10000, CRC(93d93fe1) SHA1(efc618724251d23a23b3019d475f7739a7e88751) ) ROM_REGION( 0x020000, "chars", 0 ) - ROM_LOAD16_BYTE( "mm-06.d10", 0x00000, 0x10000, CRC(91cf668e) SHA1(fc153eaa09777f79369037a139470ad1118e8d7e) ) /* Chars */ + ROM_LOAD16_BYTE( "mm-06.d10", 0x00000, 0x10000, CRC(91cf668e) SHA1(fc153eaa09777f79369037a139470ad1118e8d7e) ) // Chars ROM_LOAD16_BYTE( "mm-07.d12", 0x00001, 0x10000, CRC(e61d0e42) SHA1(80d6ada356c721b0be826554ec6731dbbc19e0ab) ) ROM_REGION( 0x100000, "tiles1", 0 ) - ROM_LOAD( "mav00.b10", 0x00000, 0x80000, CRC(34785d97) SHA1(094f881cd699d1b9fd079778f20f8c9d83283e6e) ) /* Tiles */ + ROM_LOAD( "mav00.b10", 0x00000, 0x80000, CRC(34785d97) SHA1(094f881cd699d1b9fd079778f20f8c9d83283e6e) ) // Tiles ROM_LOAD( "mav01.b12", 0x80000, 0x80000, CRC(8b531b16) SHA1(f734286f4510b2c09dc2d6d2b8c8da9dc4424287) ) ROM_REGION( 0x200000, "tiles2", 0 ) - ROM_LOAD( "mav02.b16", 0x000000, 0x100000, CRC(20723bf7) SHA1(b3491d98ff415701fec2b58d85f99c743d71b013) ) /* Tiles */ + ROM_LOAD( "mav02.b16", 0x000000, 0x100000, CRC(20723bf7) SHA1(b3491d98ff415701fec2b58d85f99c743d71b013) ) // Tiles ROM_LOAD( "mav03.e16", 0x100000, 0x100000, CRC(ef6195f0) SHA1(491bc030519c78b84396f7f8a21df9daf8acc140) ) ROM_REGION( 0x300000, "sprites1", 0 ) - ROM_LOAD( "mav04.b19", 0x000000, 0x100000, CRC(8ba48385) SHA1(926ae1e0e99b8e022b6798ceb29dd080cfc1bada) ) /* Sprites #1 */ + ROM_LOAD( "mav04.b19", 0x000000, 0x100000, CRC(8ba48385) SHA1(926ae1e0e99b8e022b6798ceb29dd080cfc1bada) ) // Sprites #1 ROM_LOAD( "mav05.e19", 0x180000, 0x100000, CRC(d92d769c) SHA1(8012e7f2b9a7cbccde8da90025647443beb6c47c) ) ROM_LOAD( "mav06.b20", 0x100000, 0x080000, CRC(ae6201a5) SHA1(c0ae87fa96d12377c5522cb8adfed03373ab3757) ) ROM_LOAD( "mav07.e20", 0x280000, 0x080000, CRC(5fc10ccd) SHA1(7debcf223802d5c2ea3d29d39850c8756c863b31) ) ROM_REGION( 0x80000, "sprites2", 0 ) - ROM_LOAD( "mav08.b23", 0x000000, 0x040000, CRC(64966576) SHA1(40c14c0f62eef0317abfb7192505e0337fb5cde5) ) /* Sprites #2 */ + ROM_LOAD( "mav08.b23", 0x000000, 0x040000, CRC(64966576) SHA1(40c14c0f62eef0317abfb7192505e0337fb5cde5) ) // Sprites #2 ROM_LOAD( "mav09.e23", 0x040000, 0x040000, CRC(1ce7b51a) SHA1(17ed8f34bf6d057e0504e72e95f448d5923aa82e) ) - ROM_REGION(0x80000, "oki1", 0 ) /* Oki samples */ + ROM_REGION(0x80000, "oki1", 0 ) // Oki samples ROM_LOAD( "mav10.r17", 0x00000, 0x80000, CRC(8ad734b0) SHA1(768b9f54bbf4b54591cafecb7a27960da919ce84) ) - ROM_REGION(0x80000, "oki2", 0 ) /* Oki samples */ + ROM_REGION(0x80000, "oki2", 0 ) // Oki samples ROM_LOAD( "mav11.r19", 0x00000, 0x80000, CRC(ef513908) SHA1(72db6c704071d7a784b3768c256fc51087e9e93c) ) - ROM_REGION( 1024, "proms", 0 ) - ROM_LOAD( "jn-00.17l", 0x00000, 0x400, CRC(6ac77b84) SHA1(9e1e2cabdb20b819e592a0f07d15658062227fa4) ) /* Priority (unused) */ + ROM_REGION( 0x400, "proms", 0 ) + ROM_LOAD( "jn-00.17l", 0x00000, 0x400, CRC(6ac77b84) SHA1(9e1e2cabdb20b819e592a0f07d15658062227fa4) ) // Priority (unused) ROM_END ROM_START( gunball ) - ROM_REGION(0x200000, "maincpu", 0 ) /* 68000 code */ + ROM_REGION(0x200000, "maincpu", 0 ) // 68000 code ROM_LOAD16_BYTE( "jc01.3d", 0x000000, 0x20000, CRC(61bfa998) SHA1(bee57cf5f1759d68948d27a2aaa817c4fc1e5e5a) ) ROM_LOAD16_BYTE( "jc00.3b", 0x000001, 0x20000, CRC(73ba8f74) SHA1(7bb27e6f81c6ff79fe391faf6e05114a6cd85a5b) ) ROM_LOAD16_BYTE( "jc03.5d", 0x040000, 0x20000, CRC(19231612) SHA1(fc9e4a2fd09d4a27631260261bb138bc134e0882) ) ROM_LOAD16_BYTE( "jc02.5b", 0x040001, 0x20000, CRC(a254f34c) SHA1(25ff595eccd6fc2734fefdcda5d35c65112506c4) ) ROM_LOAD16_BYTE( "jc05-3.6d", 0x080000, 0x40000, CRC(f750a709) SHA1(d339bbac2be95e2947f1195816e4d147e1d38a8f) ) ROM_LOAD16_BYTE( "jc04-3.6b", 0x080001, 0x40000, CRC(ad711767) SHA1(b5df0fa521ff08ddf5b6203b73a7cb8c6d3121b8) ) - /* Two empty rom slots at d7, b7 */ + // Two empty ROM slots at d7, b7 - ROM_REGION(0x10000, "audiocpu", 0 ) /* Sound CPU */ + ROM_REGION(0x10000, "audiocpu", 0 ) // Sound CPU ROM_LOAD( "jl08.r20", 0x00000, 0x10000, CRC(93d93fe1) SHA1(efc618724251d23a23b3019d475f7739a7e88751) ) ROM_REGION( 0x020000, "chars", 0 ) - ROM_LOAD16_BYTE( "jl06.d10", 0x00000, 0x10000, CRC(91cf668e) SHA1(fc153eaa09777f79369037a139470ad1118e8d7e) ) /* Chars */ + ROM_LOAD16_BYTE( "jl06.d10", 0x00000, 0x10000, CRC(91cf668e) SHA1(fc153eaa09777f79369037a139470ad1118e8d7e) ) // Chars ROM_LOAD16_BYTE( "jl07.d12", 0x00001, 0x10000, CRC(e61d0e42) SHA1(80d6ada356c721b0be826554ec6731dbbc19e0ab) ) ROM_REGION( 0x100000, "tiles1", 0 ) - ROM_LOAD( "mav00.b10", 0x00000, 0x80000, CRC(34785d97) SHA1(094f881cd699d1b9fd079778f20f8c9d83283e6e) ) /* Tiles */ + ROM_LOAD( "mav00.b10", 0x00000, 0x80000, CRC(34785d97) SHA1(094f881cd699d1b9fd079778f20f8c9d83283e6e) ) // Tiles ROM_LOAD( "mav01.b12", 0x80000, 0x80000, CRC(8b531b16) SHA1(f734286f4510b2c09dc2d6d2b8c8da9dc4424287) ) ROM_REGION( 0x200000, "tiles2", 0 ) - ROM_LOAD( "mav02.b16", 0x000000, 0x100000, CRC(20723bf7) SHA1(b3491d98ff415701fec2b58d85f99c743d71b013) ) /* Tiles */ + ROM_LOAD( "mav02.b16", 0x000000, 0x100000, CRC(20723bf7) SHA1(b3491d98ff415701fec2b58d85f99c743d71b013) ) // Tiles ROM_LOAD( "mav03.e16", 0x100000, 0x100000, CRC(ef6195f0) SHA1(491bc030519c78b84396f7f8a21df9daf8acc140) ) ROM_REGION( 0x300000, "sprites1", 0 ) - ROM_LOAD( "mav04.b19", 0x000000, 0x100000, CRC(8ba48385) SHA1(926ae1e0e99b8e022b6798ceb29dd080cfc1bada) ) /* Sprites #1 */ + ROM_LOAD( "mav04.b19", 0x000000, 0x100000, CRC(8ba48385) SHA1(926ae1e0e99b8e022b6798ceb29dd080cfc1bada) ) // Sprites #1 ROM_LOAD( "mav05.e19", 0x180000, 0x100000, CRC(d92d769c) SHA1(8012e7f2b9a7cbccde8da90025647443beb6c47c) ) ROM_LOAD( "mav06.b20", 0x100000, 0x080000, CRC(ae6201a5) SHA1(c0ae87fa96d12377c5522cb8adfed03373ab3757) ) ROM_LOAD( "mav07.e20", 0x280000, 0x080000, CRC(5fc10ccd) SHA1(7debcf223802d5c2ea3d29d39850c8756c863b31) ) ROM_REGION( 0x80000, "sprites2", 0 ) - ROM_LOAD( "mav08.b23", 0x000000, 0x040000, CRC(64966576) SHA1(40c14c0f62eef0317abfb7192505e0337fb5cde5) ) /* Sprites #2 */ + ROM_LOAD( "mav08.b23", 0x000000, 0x040000, CRC(64966576) SHA1(40c14c0f62eef0317abfb7192505e0337fb5cde5) ) // Sprites #2 ROM_LOAD( "mav09.e23", 0x040000, 0x040000, CRC(1ce7b51a) SHA1(17ed8f34bf6d057e0504e72e95f448d5923aa82e) ) - ROM_REGION(0x80000, "oki1", 0 ) /* Oki samples */ + ROM_REGION(0x80000, "oki1", 0 ) // Oki samples ROM_LOAD( "mav10.r17", 0x00000, 0x80000, CRC(8ad734b0) SHA1(768b9f54bbf4b54591cafecb7a27960da919ce84) ) - ROM_REGION(0x80000, "oki2", 0 ) /* Oki samples */ + ROM_REGION(0x80000, "oki2", 0 ) // Oki samples ROM_LOAD( "mav11.r19", 0x00000, 0x80000, CRC(ef513908) SHA1(72db6c704071d7a784b3768c256fc51087e9e93c) ) - ROM_REGION( 1024, "proms", 0 ) - ROM_LOAD( "jn-00.17l", 0x00000, 0x400, CRC(6ac77b84) SHA1(9e1e2cabdb20b819e592a0f07d15658062227fa4) ) /* Priority (unused) */ + ROM_REGION( 0x400, "proms", 0 ) + ROM_LOAD( "jn-00.17l", 0x00000, 0x400, CRC(6ac77b84) SHA1(9e1e2cabdb20b819e592a0f07d15658062227fa4) ) // Priority (unused) ROM_END ROM_START( schmeisr ) - ROM_REGION(0x100000, "maincpu", 0 ) /* 68000 code */ + ROM_REGION(0x100000, "maincpu", 0 ) // 68000 code ROM_LOAD16_BYTE( "sr001j.8a", 0x000000, 0x80000, CRC(ed31f3ff) SHA1(3e0ae92a07ef94f377730c19069560bda864a64b) ) ROM_LOAD16_BYTE( "sr006j.8d", 0x000001, 0x80000, CRC(9e9cfa5d) SHA1(10421198739f76e5a5b7ec85b57ead83ae4572d4) ) - ROM_REGION(0x10000, "audiocpu", 0 ) /* Sound CPU */ + ROM_REGION(0x10000, "audiocpu", 0 ) // Sound CPU ROM_LOAD( "sr013.18p", 0x00000, 0x10000, CRC(4ac00cbb) SHA1(cbc21e13978ae5e8940c8c22932dc424605c0ba4) ) ROM_REGION( 0x040000, "chars", ROMREGION_ERASE00 ) - /* Filled in later */ + // Filled in later - ROM_REGION( 0x100000, "tiles1", 0 ) /* Encrypted tiles */ + ROM_REGION( 0x100000, "tiles1", 0 ) // Encrypted tiles ROM_LOAD( "sr002-74.9a", 0x000000, 0x080000, CRC(97e15c7b) SHA1(8697115d4b5ed94a1392034060821d3e354bceb0) ) ROM_LOAD( "sr003-74.11a", 0x080000, 0x080000, CRC(ea367971) SHA1(365c27bdef4daa01e926fbcf11ce622186133106) ) - ROM_REGION( 0x200000, "tiles2", 0 ) /* Encrypted tiles */ + ROM_REGION( 0x200000, "tiles2", 0 ) // Encrypted tiles ROM_LOAD( "sr007.17d", 0x000000, 0x100000, CRC(886f80c7) SHA1(c06efc1ce7f51d4e503267e63dc9f762d55ad528) ) ROM_LOAD( "sr008.18d", 0x100000, 0x100000, CRC(a74cbc90) SHA1(1aabfec7cd64e7097aa55f0ddc5a2c9e1e25618a) ) @@ -1654,19 +1699,19 @@ ROM_START( schmeisr ) ROM_LOAD( "sr009.19d", 0x200000, 0x100000, CRC(7b9d982f) SHA1(55d89ee68ceaf3ca8059177721b6c9a16103b1b4) ) ROM_LOAD( "sr010.20d", 0x300000, 0x100000, CRC(6e9e5352) SHA1(357659ff5ab9ce94df3313e9a60125769c7fe10a) ) - ROM_REGION(0x80000, "oki2", 0 ) /* Oki samples */ + ROM_REGION(0x80000, "oki2", 0 ) // Oki samples ROM_LOAD( "sr011.14p", 0x00000, 0x80000, CRC(81805616) SHA1(cdca2eb6d12924b9b578b4ce95d5816c7d82f345) ) - ROM_REGION(0x80000, "oki1", 0 ) /* Oki samples */ + ROM_REGION(0x80000, "oki1", 0 ) // Oki samples ROM_LOAD( "sr012.15p", 0x00000, 0x80000, CRC(38843d4d) SHA1(0eda60a4d2caa1e57582c354b8be926905d7fb0c) ) - ROM_REGION( 512, "proms", 0 ) + ROM_REGION( 0x200, "proms", 0 ) ROM_LOAD( "hb-00.11p", 0x00000, 0x200, CRC(b7a7baad) SHA1(39781c3412493b985d3616ac31142fc00bbcddf4) ) ROM_END -ROM_START( hangzo ) /* Found on a Data East DE-0353-3 PCB */ - ROM_REGION(0x200000, "maincpu", 0 ) /* 68000 code */ +ROM_START( hangzo ) // Found on a Data East DE-0353-3 PCB + ROM_REGION(0x200000, "maincpu", 0 ) // 68000 code ROM_LOAD16_BYTE( "pro0h 12.18.2a.27c1001", 0x000000, 0x20000, CRC(ac8087db) SHA1(518193372cde6024fda96c6ed1862245e0bfb465) ) ROM_LOAD16_BYTE( "pro0h 12.18.2d.27c1001", 0x000001, 0x20000, CRC(a6b7f4f4) SHA1(1b3a00ef124d130317171d9042018fbb30662fec) ) ROM_LOAD16_BYTE( "pro1h 12.10.4a.27c010", 0x040000, 0x20000, CRC(0d04f43d) SHA1(167b595450f6f9b842dc909f6c61a96fa34b7991) ) @@ -1674,34 +1719,34 @@ ROM_START( hangzo ) /* Found on a Data East DE-0353-3 PCB */ ROM_LOAD16_BYTE( "pro2h 12.10.6a.27c010", 0x080000, 0x20000, CRC(bb3185a6) SHA1(fa4ba7b4b53a5b3486c36441463a290b12c2acbe) ) ROM_LOAD16_BYTE( "pro2l 12.10.6d.27c010", 0x080001, 0x20000, CRC(11ce97bb) SHA1(d9c1872762f9acaeed1ebc640a71fa7a4b9d013c) ) - ROM_REGION(0x10000, "audiocpu", 0 ) /* Sound CPU */ + ROM_REGION(0x10000, "audiocpu", 0 ) // Sound CPU ROM_LOAD( "snd 12.18.18p.27c512", 0x00000, 0x10000, CRC(97c592dc) SHA1(7a0e08f3ffd42d07d1d0a9db52c7fd85dba28bd8) ) ROM_REGION( 0x040000, "chars", ROMREGION_ERASEFF ) - /* filled in later */ + // Filled in later ROM_REGION( 0x100000, "tiles1", 0 ) - ROM_LOAD( "bk1l 12.10.9a.574200", 0x000000, 0x080000, CRC(5199729b) SHA1(1cb8e7b91e5d0b3a699e47b6bbb3e6e9c53c8590) ) /* tiles */ + ROM_LOAD( "bk1l 12.10.9a.574200", 0x000000, 0x080000, CRC(5199729b) SHA1(1cb8e7b91e5d0b3a699e47b6bbb3e6e9c53c8590) ) // Tiles ROM_LOAD( "bk1h 12.10.11a.574200", 0x080000, 0x080000, CRC(85887bd8) SHA1(6cb6f9c9e6e5824c6b8006ab195f27014031907e) ) ROM_REGION( 0x200000, "tiles2", 0 ) - ROM_LOAD( "bk23l 12.10.17d.574200", 0x000000, 0x080000, CRC(ed4e47c6) SHA1(b09ed1a6bf1b42139c7817bae18cd5580c42cf91) ) /* tiles 1 & 2 */ + ROM_LOAD( "bk23l 12.10.17d.574200", 0x000000, 0x080000, CRC(ed4e47c6) SHA1(b09ed1a6bf1b42139c7817bae18cd5580c42cf91) ) // tiles 1 & 2 ROM_LOAD( "bk23h 12.10.18d.574200", 0x100000, 0x080000, CRC(6a725fb2) SHA1(f4da4da62eb7e3ec2f1a54b57eaf94dc748dec68) ) ROM_REGION( 0x400000, "sprites1", 0 ) - ROM_LOAD( "obj01l 12.10.19a.27c4000", 0x000000, 0x080000, CRC(c141e310) SHA1(81eb0b977aaf44a110a663416e385ca617de8f28) ) /* 4bpp sprites */ + ROM_LOAD( "obj01l 12.10.19a.27c4000", 0x000000, 0x080000, CRC(c141e310) SHA1(81eb0b977aaf44a110a663416e385ca617de8f28) ) // 4bpp sprites ROM_LOAD( "obj01h 12.10.20a.27c4000", 0x100000, 0x080000, CRC(6a7b4252) SHA1(4bd588bc96c07cc9367afdeab4976af6f8dcc823) ) ROM_LOAD( "obj23l 12.10.19d.27c4000", 0x200000, 0x080000, CRC(0db6df6c) SHA1(fe7ef7b5a279656d9e46334c4833ab8911caa5db) ) ROM_LOAD( "obj23h 12.10.20d.27c4000", 0x300000, 0x080000, CRC(165031a1) SHA1(0e88fe45fd78d352fdbd398c1d98feefe1b43917) ) - ROM_REGION(0x80000, "oki2", 0 ) /* Oki samples */ + ROM_REGION(0x80000, "oki2", 0 ) // Oki samples ROM_LOAD( "pcm16k 11.5.14p.574000", 0x00000, 0x80000, CRC(5b95c6c7) SHA1(587e7f87d085af3a5d24f317fffc1716c8027e43) ) - ROM_REGION(0x80000, "oki1", 0 ) /* Oki samples */ + ROM_REGION(0x80000, "oki1", 0 ) // Oki samples ROM_LOAD( "pcm8k 11.5.15p.27c020", 0x00000, 0x40000, CRC(02682a9a) SHA1(914ffc7c16e90c1ac28a228df415a956684f8192) ) - ROM_REGION( 512, "proms", ROMREGION_ERASEFF ) - ROM_LOAD( "hb-00.11p", 0x00000, 0x200, CRC(b7a7baad) SHA1(39781c3412493b985d3616ac31142fc00bbcddf4) ) /* ? */ + ROM_REGION( 0x200, "proms", ROMREGION_ERASEFF ) + ROM_LOAD( "hb-00.11p", 0x00000, 0x200, CRC(b7a7baad) SHA1(39781c3412493b985d3616ac31142fc00bbcddf4) ) // ? ROM_END @@ -1746,21 +1791,22 @@ void rohga_state::init_schmeisr() deco74_decrypt_gfx(machine(), "tiles1"); } -GAME( 1991, rohga, 0, rohga, rohga, rohga_state, init_rohga, ROT0, "Data East Corporation", "Rohga Armor Force (Asia/Europe v5.0)", MACHINE_SUPPORTS_SAVE ) +GAME( 1991, rohga, 0, rohga, rohga, rohga_state, init_rohga, ROT0, "Data East Corporation", "Rohga Armor Force (Asia/Europe v5.0)", MACHINE_SUPPORTS_SAVE ) GAME( 1991, rohga1, rohga, rohga, rohga, rohga_state, init_rohga, ROT0, "Data East Corporation", "Rohga Armor Force (Asia/Europe v3.0 set 1)", MACHINE_SUPPORTS_SAVE ) GAME( 1991, rohga2, rohga, rohga, rohga, rohga_state, init_rohga, ROT0, "Data East Corporation", "Rohga Armor Force (Asia/Europe v3.0 set 2)", MACHINE_SUPPORTS_SAVE ) -GAME( 1991, rohgah, rohga, rohga, rohga, rohga_state, init_rohga, ROT0, "Data East Corporation", "Rohga Armor Force (Hong Kong v3.0)", MACHINE_SUPPORTS_SAVE ) -GAME( 1991, rohgau, rohga, rohga, rohga, rohga_state, init_rohga, ROT0, "Data East Corporation", "Rohga Armor Force (US v1.0)", MACHINE_SUPPORTS_SAVE ) -GAME( 1991, wolffang, rohga, rohga, rohga, rohga_state, init_rohga, ROT0, "Data East Corporation", "Wolf Fang -Kuhga 2001- (Japan)", MACHINE_SUPPORTS_SAVE ) +GAME( 1991, rohgah, rohga, rohga, rohga, rohga_state, init_rohga, ROT0, "Data East Corporation", "Rohga Armor Force (Hong Kong v3.0)", MACHINE_SUPPORTS_SAVE ) +GAME( 1991, rohgau, rohga, rohga, rohga, rohga_state, init_rohga, ROT0, "Data East Corporation", "Rohga Armor Force (US v1.0)", MACHINE_SUPPORTS_SAVE ) +GAME( 1991, wolffang, rohga, rohga, rohga, rohga_state, init_rohga, ROT0, "Data East Corporation", "Wolf Fang -Kuhga 2001- (Japan)", MACHINE_SUPPORTS_SAVE ) GAME( 1992, wizdfire, 0, wizdfire, wizdfire, rohga_state, init_wizdfire, ROT0, "Data East Corporation", "Wizard Fire (Over Sea v2.1)", MACHINE_SUPPORTS_SAVE ) -GAME( 1992, wizdfireu, wizdfire, wizdfire, wizdfire, rohga_state, init_wizdfire, ROT0, "Data East Corporation", "Wizard Fire (US v1.1)", MACHINE_SUPPORTS_SAVE ) -GAME( 1992, darkseal2, wizdfire, wizdfire, wizdfire, rohga_state, init_wizdfire, ROT0, "Data East Corporation", "Dark Seal 2 (Japan v2.1)", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) +GAME( 1992, wizdfirea, wizdfire, wizdfire, wizdfire, rohga_state, init_wizdfire, ROT0, "Data East Corporation", "Wizard Fire (Over Sea v1.0)", MACHINE_SUPPORTS_SAVE ) +GAME( 1992, wizdfireu, wizdfire, wizdfire, wizdfire, rohga_state, init_wizdfire, ROT0, "Data East Corporation", "Wizard Fire (US v1.1)", MACHINE_SUPPORTS_SAVE ) +GAME( 1992, darkseal2, wizdfire, wizdfire, wizdfire, rohga_state, init_wizdfire, ROT0, "Data East Corporation", "Dark Seal 2 (Japan v2.1)", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) GAME( 1992, nitrobal, 0, nitrobal, nitrobal, rohga_state, init_nitrobal, ROT270, "Data East Corporation", "Nitro Ball (World, set 1)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) GAME( 1992, nitrobala, nitrobal, nitrobal, nitrobal, rohga_state, init_nitrobal, ROT270, "Data East Corporation", "Nitro Ball (World, set 2)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) // was marked 'US' but doesn't seem to have a 'Winners Don't Use Drugs' screen, so unlikely GAME( 1992, nitrobalb, nitrobal, nitrobal, nitrobal, rohga_state, init_nitrobal, ROT270, "Data East Corporation", "Nitro Ball (World, set 3)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) GAME( 1992, gunball, nitrobal, nitrobal, nitrobal, rohga_state, init_nitrobal, ROT270, "Data East Corporation", "Gun Ball (Japan)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) -GAME( 1993, schmeisr, 0, schmeisr, schmeisr, rohga_state, init_schmeisr, ROT0, "Hot-B", "Schmeiser Robo (Japan)", MACHINE_SUPPORTS_SAVE | MACHINE_NO_COCKTAIL ) +GAME( 1993, schmeisr, 0, schmeisr, schmeisr, rohga_state, init_schmeisr, ROT0, "Hot-B", "Schmeiser Robo (Japan)", MACHINE_SUPPORTS_SAVE | MACHINE_NO_COCKTAIL ) GAME( 1992, hangzo, 0, hangzo, hangzo, rohga_state, init_hangzo, ROT0, "Hot-B", "Hangzo (Japan, prototype)", MACHINE_SUPPORTS_SAVE ) // ROM contains a '(c)1992 Data East Corporation' string, but other sources indicate the game is by Hot-B diff --git a/src/mame/dataeast/simpl156.cpp b/src/mame/dataeast/simpl156.cpp index 41e519ad7c9bd..6288a8d06c454 100644 --- a/src/mame/dataeast/simpl156.cpp +++ b/src/mame/dataeast/simpl156.cpp @@ -93,16 +93,99 @@ even be configurable. */ #include "emu.h" -#include "simpl156.h" -#include "decocrpt.h" #include "deco156_m.h" +#include "deco16ic.h" +#include "decocrpt.h" +#include "decospr.h" + #include "cpu/arm/arm.h" #include "machine/eepromser.h" #include "sound/okim6295.h" +#include "emupal.h" #include "screen.h" #include "speaker.h" +#include + + +namespace { + +class simpl156_state : public driver_device +{ +public: + simpl156_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), + m_maincpu(*this, "maincpu"), + m_deco_tilegen(*this, "tilegen"), + m_eeprom(*this, "eeprom"), + m_okimusic(*this, "okimusic"), + m_sprgen(*this, "spritegen"), + m_palette(*this, "palette"), + m_rowscroll(*this, "rowscroll_%u", 1U, 0x1000U, ENDIANNESS_LITTLE), + m_mainram(*this, "mainram", 0x4000U, ENDIANNESS_LITTLE), + m_systemram(*this, "systemram"), + m_spriteram(*this, "spriteram", 0x1000U, ENDIANNESS_LITTLE) + { } + + void joemacr(machine_config &config) ATTR_COLD; + void magdrop(machine_config &config) ATTR_COLD; + void chainrec(machine_config &config) ATTR_COLD; + void mitchell156(machine_config &config) ATTR_COLD; + void magdropp(machine_config &config) ATTR_COLD; + + void init_simpl156() ATTR_COLD; + void init_joemacr() ATTR_COLD; + void init_charlien() ATTR_COLD; + void init_prtytime() ATTR_COLD; + void init_osman() ATTR_COLD; + void init_chainrec() ATTR_COLD; + +protected: + virtual void video_start() override ATTR_COLD; + +private: + DECO16IC_BANK_CB_MEMBER(bank_callback); + DECOSPR_PRIORITY_CB_MEMBER(pri_callback); + + void eeprom_w(u32 data); + u32 spriteram_r(offs_t offset); + void spriteram_w(offs_t offset, u32 data, u32 mem_mask); + u32 mainram_r(offs_t offset); + void mainram_w(offs_t offset, u32 data, u32 mem_mask); + template u32 rowscroll_r(offs_t offset); + template void rowscroll_w(offs_t offset, u32 data, u32 mem_mask); + u32 joemacr_speedup_r(); + u32 chainrec_speedup_r(); + u32 prtytime_speedup_r(); + u32 charlien_speedup_r(); + u32 osman_speedup_r(); + + u32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + void vblank_interrupt(int state); + + void base_map(address_map &map) ATTR_COLD; + void chainrec_map(address_map &map) ATTR_COLD; + void joemacr_map(address_map &map) ATTR_COLD; + void magdrop_map(address_map &map) ATTR_COLD; + void magdropp_map(address_map &map) ATTR_COLD; + void mitchell156_map(address_map &map) ATTR_COLD; + + /* devices */ + required_device m_maincpu; + required_device m_deco_tilegen; + required_device m_eeprom; + required_device m_okimusic; + required_device m_sprgen; + required_device m_palette; + + /* memory pointers */ + memory_share_array_creator m_rowscroll; + memory_share_creator m_mainram; + required_shared_ptr m_systemram; + memory_share_creator m_spriteram; +}; + static INPUT_PORTS_START( simpl156 ) PORT_START("IN0") @@ -368,6 +451,30 @@ DECOSPR_PRIORITY_CB_MEMBER(simpl156_state::pri_callback) } +void simpl156_state::video_start() +{ + std::fill_n(&m_spriteram[0], m_spriteram.length(), 0xffff); +} + +u32 simpl156_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + screen.priority().fill(0); + + m_deco_tilegen->pf_update(m_rowscroll[0], m_rowscroll[1]); + + bitmap.fill(256, cliprect); + + m_deco_tilegen->tilemap_2_draw(screen, bitmap, cliprect, 0, 2); + m_deco_tilegen->tilemap_1_draw(screen, bitmap, cliprect, 0, 4); + + // sprites are flipped relative to tilemaps + m_sprgen->set_flip_screen(true); + + m_sprgen->draw_sprites(bitmap, cliprect, m_spriteram, 0x1400/4); // 0x1400/4 seems right for charlien (doesn't initialize any more RAM, so will draw a garbage 0 with more) + return 0; +} + + void simpl156_state::chainrec(machine_config &config) { /* basic machine hardware */ @@ -1110,9 +1217,10 @@ void simpl156_state::init_osman() { m_maincpu->space(AS_PROGRAM).install_read_handler(0x0201010, 0x0201013, 0, 0x2000, 0, emu::rw_delegate(*this, FUNC(simpl156_state::osman_speedup_r))); init_simpl156(); - } +} // anonymous namespace + /* Data East games running on the DE-0409-1 or DE-0491-1 PCB */ GAME( 1994, joemacr, 0, joemacr, simpl156, simpl156_state, init_joemacr, ROT0, "Data East Corporation", "Joe & Mac Returns (World, Version 1.1, 1994.05.27)", MACHINE_SUPPORTS_SAVE ) /* bootleg board with genuine DECO parts */ GAME( 1994, joemacra, joemacr, joemacr, simpl156, simpl156_state, init_joemacr, ROT0, "Data East Corporation", "Joe & Mac Returns (World, Version 1.0, 1994.05.19)", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/dataeast/simpl156.h b/src/mame/dataeast/simpl156.h deleted file mode 100644 index 8ac4e25dc46a7..0000000000000 --- a/src/mame/dataeast/simpl156.h +++ /dev/null @@ -1,90 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:David Haywood -/************************************************************************* - - Simple 156 based board - -*************************************************************************/ - -#include "machine/eepromser.h" -#include "sound/okim6295.h" -#include "deco16ic.h" -#include "decospr.h" -#include "emupal.h" - -class simpl156_state : public driver_device -{ -public: - simpl156_state(const machine_config &mconfig, device_type type, const char *tag) : - driver_device(mconfig, type, tag), - m_maincpu(*this, "maincpu"), - m_deco_tilegen(*this, "tilegen"), - m_eeprom(*this, "eeprom"), - m_okimusic(*this, "okimusic"), - m_sprgen(*this, "spritegen"), - m_palette(*this, "palette"), - m_rowscroll(*this, "rowscroll_%u", 1U, 0x1000U, ENDIANNESS_LITTLE), - m_mainram(*this, "mainram", 0x4000U, ENDIANNESS_LITTLE), - m_systemram(*this, "systemram"), - m_spriteram(*this, "spriteram", 0x1000U, ENDIANNESS_LITTLE) - { } - - void joemacr(machine_config &config); - void magdrop(machine_config &config); - void chainrec(machine_config &config); - void mitchell156(machine_config &config); - void magdropp(machine_config &config); - - void init_simpl156(); - void init_joemacr(); - void init_charlien(); - void init_prtytime(); - void init_osman(); - void init_chainrec(); - -protected: - virtual void video_start() override ATTR_COLD; - -private: - DECO16IC_BANK_CB_MEMBER(bank_callback); - DECOSPR_PRIORITY_CB_MEMBER(pri_callback); - - void eeprom_w(u32 data); - u32 spriteram_r(offs_t offset); - void spriteram_w(offs_t offset, u32 data, u32 mem_mask); - u32 mainram_r(offs_t offset); - void mainram_w(offs_t offset, u32 data, u32 mem_mask); - template u32 rowscroll_r(offs_t offset); - template void rowscroll_w(offs_t offset, u32 data, u32 mem_mask); - u32 joemacr_speedup_r(); - u32 chainrec_speedup_r(); - u32 prtytime_speedup_r(); - u32 charlien_speedup_r(); - u32 osman_speedup_r(); - - u32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - void vblank_interrupt(int state); - - void base_map(address_map &map) ATTR_COLD; - void chainrec_map(address_map &map) ATTR_COLD; - void joemacr_map(address_map &map) ATTR_COLD; - void magdrop_map(address_map &map) ATTR_COLD; - void magdropp_map(address_map &map) ATTR_COLD; - void mitchell156_map(address_map &map) ATTR_COLD; - - /* devices */ - required_device m_maincpu; - required_device m_deco_tilegen; - required_device m_eeprom; - required_device m_okimusic; - required_device m_sprgen; - required_device m_palette; - - /* memory pointers */ - memory_share_array_creator m_rowscroll; - memory_share_creator m_mainram; - required_shared_ptr m_systemram; - memory_share_creator m_spriteram; - - size_t m_spriteram_size = 0; -}; diff --git a/src/mame/dataeast/simpl156_v.cpp b/src/mame/dataeast/simpl156_v.cpp deleted file mode 100644 index 41413524d8180..0000000000000 --- a/src/mame/dataeast/simpl156_v.cpp +++ /dev/null @@ -1,37 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:David Haywood -/* Simple 156 based board - -*/ - -#include "emu.h" - -#include "simpl156.h" - -#include "screen.h" - -#include - - -void simpl156_state::video_start() -{ - std::fill_n(&m_spriteram[0], m_spriteram.length(), 0xffff); -} - -u32 simpl156_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) -{ - screen.priority().fill(0); - - m_deco_tilegen->pf_update(m_rowscroll[0], m_rowscroll[1]); - - bitmap.fill(256, cliprect); - - m_deco_tilegen->tilemap_2_draw(screen, bitmap, cliprect, 0, 2); - m_deco_tilegen->tilemap_1_draw(screen, bitmap, cliprect, 0, 4); - - // sprites are flipped relative to tilemaps - m_sprgen->set_flip_screen(true); - - m_sprgen->draw_sprites(bitmap, cliprect, m_spriteram, 0x1400/4); // 0x1400/4 seems right for charlien (doesn't initialize any more RAM, so will draw a garbage 0 with more) - return 0; -} diff --git a/src/mame/dataeast/supbtime.cpp b/src/mame/dataeast/supbtime.cpp index 7972f2f601cfa..6b3deb6b015a6 100644 --- a/src/mame/dataeast/supbtime.cpp +++ b/src/mame/dataeast/supbtime.cpp @@ -9,10 +9,12 @@ These games all run on the DE-0343 board. - Sound: YM2151, Oki ADPCM - NOTE! The sound program writes to the address -of a YM2203 and a 2nd Oki chip but the board does _not_ have them. The sound -program is simply the 'generic' Data East sound program unmodified for this cut -down hardware (it doesn't write any good sound data btw, mostly zeros). + CPU: Custom 68000 Data East 59 clocked at 21.422 MHz / 2. + + Sound: Data East 45, YM2151, Oki ADPCM - NOTE! The sound program writes to the + address of a YM2203 and a 2nd Oki chip but the board does _not_ have them. The + sound program is simply the 'generic' Data East sound program unmodified for + this cut down hardware (it doesn't write any good sound data btw, mostly zeros). Super Burgertime has a few bugs: @@ -119,6 +121,8 @@ class supbtime_state : public driver_device void tumblep_map(address_map &map) ATTR_COLD; }; +#define TUMBLEP_HACK 0 + /*************************************************************************** @@ -186,9 +190,6 @@ uint32_t supbtime_state::screen_update_tumblep(screen_device &screen, bitmap_ind } -#define TUMBLEP_HACK 0 - - //************************************************************************** // ADDRESS MAPS //************************************************************************** @@ -281,7 +282,9 @@ void supbtime_state::vblank_w(int state) uint16_t supbtime_state::vblank_ack_r() { - m_maincpu->set_input_line(M68K_IRQ_6, CLEAR_LINE); + if (!machine().side_effects_disabled()) + m_maincpu->set_input_line(M68K_IRQ_6, CLEAR_LINE); + return 0xffff; } @@ -453,16 +456,16 @@ GFXDECODE_END void supbtime_state::supbtime(machine_config &config) { - M68000(config, m_maincpu, XTAL(21'477'272) / 2); + M68000(config, m_maincpu, 21.477272_MHz_XTAL / 2); m_maincpu->set_addrmap(AS_PROGRAM, &supbtime_state::supbtime_map); - H6280(config, m_audiocpu, XTAL(32'220'000) / 4); + H6280(config, m_audiocpu, 32.22_MHz_XTAL / 4); m_audiocpu->set_addrmap(AS_PROGRAM, &supbtime_state::sound_map); m_audiocpu->add_route(ALL_OUTPUTS, "mono", 0); // internal sound unused // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); - screen.set_raw(XTAL(28'000'000) / 4, 442, 0, 320, 274, 8, 248); + screen.set_raw(28_MHz_XTAL / 4, 442, 0, 320, 274, 8, 248); screen.screen_vblank().set(FUNC(supbtime_state::vblank_w)); screen.set_screen_update(FUNC(supbtime_state::screen_update_supbtime)); screen.set_palette("palette"); @@ -488,12 +491,13 @@ void supbtime_state::supbtime(machine_config &config) GENERIC_LATCH_8(config, "soundlatch").data_pending_callback().set_inputline(m_audiocpu, 0); - ym2151_device &ymsnd(YM2151(config, "ymsnd", XTAL(32'220'000) / 9)); - ymsnd.irq_handler().set_inputline(m_audiocpu, 1); /* IRQ2 */ - ymsnd.add_route(0, "mono", 0.45); - ymsnd.add_route(1, "mono", 0.45); + ym2151_device &ymsnd(YM2151(config, "ymsnd", 32.22_MHz_XTAL / 9)); + ymsnd.irq_handler().set_inputline(m_audiocpu, 1); // IRQ2 + ymsnd.add_route(0, "mono", 0.25); + ymsnd.add_route(1, "mono", 0.25); - OKIM6295(config, "oki", XTAL(21'477'272) / 20, okim6295_device::PIN7_HIGH).add_route(ALL_OUTPUTS, "mono", 0.50); // clock frequency & pin 7 not verified + okim6295_device &oki(OKIM6295(config, "oki", 32.22_MHz_XTAL / 32, okim6295_device::PIN7_HIGH)); // clock frequency & pin 7 not verified + oki.add_route(ALL_OUTPUTS, "mono", 0.50); } void supbtime_state::chinatwn(machine_config &config) @@ -510,6 +514,9 @@ void supbtime_state::tumblep(machine_config &config) m_maincpu->set_addrmap(AS_PROGRAM, &supbtime_state::tumblep_map); subdevice("screen")->set_screen_update(FUNC(supbtime_state::screen_update_tumblep)); + + // tumblep oki is a bit higher pitched, clock frequency & pin 7 not verified + subdevice("oki")->set_clock(21.477272_MHz_XTAL / 20); } diff --git a/src/mame/dec/uvax1.cpp b/src/mame/dec/uvax1.cpp new file mode 100644 index 0000000000000..a801e27e83a76 --- /dev/null +++ b/src/mame/dec/uvax1.cpp @@ -0,0 +1,88 @@ +// license:BSD-3-Clause +// copyright-holders:AJR +/******************************************************************************* + + Skeleton driver for DEC MicroVAX I ("Seahorse"). + + The MicroVAX I processor occupies two interconnected PCBs: the M7135 data + path module (DAP) and the M7136 memory controller (MCT). The LSI data path + chip, developed by DEC in conjunction with Silicon Compilers, Inc., is not + really a single-chip VAX CPU, since it relies on a PROM microcode store and + numerous PLDs and support logic ICs. Though the memory controller module + contains TLB/cache SRAMs and a few register files, main memory is provided + separately on the 16-bit Q22 bus in the form of MSV11-P modules. + + There were two versions of the processor: one supporting only F_floating + and D_floating types, the other supporting only F_floating and G_floating. + + Q-bus I/O options used in the MicroVAX I include DLVJ1, DZV11, DEQNA and + RQDX1. + +*******************************************************************************/ + +#include "emu.h" + +//#include "bus/qbus/qbus.h" +#include "cpu/vax/vax.h" +#include "machine/scn_pci.h" + +namespace { + +class uvax1_state : public driver_device +{ +public: + uvax1_state(const machine_config &mconfig, device_type type, const char *tag) + : driver_device(mconfig, type, tag) + , m_maincpu(*this, "maincpu") + { + } + + void uvax1(machine_config &config) ATTR_COLD; + +private: + void mem_map(address_map &map) ATTR_COLD; + + required_device m_maincpu; +}; + +void uvax1_state::mem_map(address_map &map) +{ + map(0x00000000, 0x00001fff).rom().region("bootrom", 0); +} + +static INPUT_PORTS_START(uvax1) +INPUT_PORTS_END + +void uvax1_state::uvax1(machine_config &config) +{ + KD32A(config, m_maincpu, 64_MHz_XTAL / 16); // cycle time is 250 ns + m_maincpu->set_addrmap(AS_PROGRAM, &uvax1_state::mem_map); + + SCN2661C(config, "conuart", 5.0688_MHz_XTAL); +} + +ROM_START(uvax1) + ROM_REGION32_LE(0x2000, "bootrom", 0) + ROM_LOAD("m7135_microvax_i_e78_2764.bin", 0x0000, 0x2000, CRC(8c6f01f0) SHA1(c3effa180faa7767b267b047d724871592466788)) + + ROM_REGION64_LE(0x10000, "dap_proms", ROMREGION_ERASE00) // MB7144H or equivalent + ROM_LOAD64_BYTE("dap0.bin", 0x0000, 0x2000, NO_DUMP) + ROM_LOAD64_BYTE("dap1.bin", 0x0001, 0x2000, NO_DUMP) + ROM_LOAD64_BYTE("dap2.bin", 0x0002, 0x2000, NO_DUMP) + ROM_LOAD64_BYTE("dap3.bin", 0x0003, 0x2000, NO_DUMP) + ROM_LOAD64_BYTE("dap4.bin", 0x0004, 0x2000, NO_DUMP) + + ROM_REGION64_LE(0x2000, "mct_proms", 0) // Am27S35DC + ROM_LOAD64_BYTE("mct0.bin", 0x0000, 0x0400, NO_DUMP) + ROM_LOAD64_BYTE("mct1.bin", 0x0001, 0x0400, NO_DUMP) + ROM_LOAD64_BYTE("mct2.bin", 0x0002, 0x0400, NO_DUMP) + ROM_LOAD64_BYTE("mct3.bin", 0x0003, 0x0400, NO_DUMP) + ROM_LOAD64_BYTE("mct4.bin", 0x0004, 0x0400, NO_DUMP) + ROM_LOAD64_BYTE("mct5.bin", 0x0005, 0x0400, NO_DUMP) + ROM_LOAD64_BYTE("mct6.bin", 0x0006, 0x0400, NO_DUMP) + ROM_LOAD64_BYTE("mct7.bin", 0x0007, 0x0400, NO_DUMP) +ROM_END + +} // anonymous namespace + +COMP(1984, uvax1, 0, 0, uvax1, uvax1, uvax1_state, empty_init, "Digital Equipment Corporation", "MicroVAX I", MACHINE_NOT_WORKING | MACHINE_NO_SOUND_HW) diff --git a/src/mame/dec/uvax2.cpp b/src/mame/dec/uvax2.cpp new file mode 100644 index 0000000000000..1714f59b3ac68 --- /dev/null +++ b/src/mame/dec/uvax2.cpp @@ -0,0 +1,65 @@ +// license:BSD-3-Clause +// copyright-holders:AJR +/******************************************************************************* + + Skeleton driver for DEC MicroVAX II ("Mayflower"). + +*******************************************************************************/ + +#include "emu.h" + +//#include "bus/qbus/qbus.h" +#include "cpu/vax/vax.h" +//#include "machine/dc319.h" +#include "machine/mc146818.h" + +namespace { + +class uvax2_state : public driver_device +{ +public: + uvax2_state(const machine_config &mconfig, device_type type, const char *tag) + : driver_device(mconfig, type, tag) + , m_maincpu(*this, "maincpu") + { + } + + void uvax2(machine_config &config) ATTR_COLD; + +private: + void mem_map(address_map &map) ATTR_COLD; + + required_device m_maincpu; +}; + +void uvax2_state::mem_map(address_map &map) +{ + map(0x00000000, 0x0000ffff).rom().region("bootrom", 0); +} + +static INPUT_PORTS_START(uvax2) +INPUT_PORTS_END + +void uvax2_state::uvax2(machine_config &config) +{ + DC333(config, m_maincpu, 40_MHz_XTAL); + m_maincpu->set_addrmap(AS_PROGRAM, &uvax2_state::mem_map); + + //DC319(config, "dlart", 614.4_MHz_XTAL); + + MC146818(config, "toyclock", 32.768_kHz_XTAL); +} + +ROM_START(uvax2) + ROM_REGION32_LE(0x10000, "bootrom", 0) + ROM_SYSTEM_BIOS(0, "ef", "Rev. EF") // Rev. AF is identical? + ROMX_LOAD("m7606_a1_rev_ef_lm8725_110e6_am27256.bin", 0x0000, 0x8000, CRC(b44e8cab) SHA1(8b74031231248241109b78baa4819659533e1312), ROM_SKIP(1) | ROM_BIOS(0)) + ROMX_LOAD("m7606_a1_rev_ef_lm8729_111e6_am27256.bin", 0x0001, 0x8000, CRC(44ebb04d) SHA1(031c271ead78cae4c3dfc1125b0ab515843e1911), ROM_SKIP(1) | ROM_BIOS(0)) + ROM_SYSTEM_BIOS(1, "ah", "Rev. AH") + ROMX_LOAD("m7606_ah_062_110e6_d27256.bin", 0x0000, 0x8000, CRC(653646fa) SHA1(1f900fe5e998d0f8ed4ae63557f1e63c839991c0), ROM_SKIP(1) | ROM_BIOS(1)) + ROMX_LOAD("m7606_ah_062_111e6_d27256.bin", 0x0001, 0x8000, CRC(725dc43e) SHA1(630a908f7d630a33099ae9c3c3c08df478de941c), ROM_SKIP(1) | ROM_BIOS(1)) +ROM_END + +} // anonymous namespace + +COMP(1984, uvax2, 0, 0, uvax2, uvax2, uvax2_state, empty_init, "Digital Equipment Corporation", "MicroVAX II", MACHINE_NOT_WORKING | MACHINE_NO_SOUND_HW) diff --git a/src/mame/dec/uvax3.cpp b/src/mame/dec/uvax3.cpp new file mode 100644 index 0000000000000..d296a4b093c49 --- /dev/null +++ b/src/mame/dec/uvax3.cpp @@ -0,0 +1,66 @@ +// license:BSD-3-Clause +// copyright-holders:AJR +/******************************************************************************* + + Skeleton driver for DEC third-generation MicroVAX models ("Mayfair"). + +*******************************************************************************/ + +#include "emu.h" + +//#include "bus/dssi/dssi.h" +//#include "bus/qbus/qbus.h" +#include "cpu/vax/vax.h" +//#include "machine/am79c90.h" + +namespace { + +class uvax3_state : public driver_device +{ +public: + uvax3_state(const machine_config &mconfig, device_type type, const char *tag) + : driver_device(mconfig, type, tag) + , m_maincpu(*this, "maincpu") + { + } + + void mv3400(machine_config &config) ATTR_COLD; + +private: + void mem_map(address_map &map) ATTR_COLD; + + required_device m_maincpu; +}; + +void uvax3_state::mem_map(address_map &map) +{ + map(0x20040000, 0x2005ffff).mirror(0x20000).rom().region("firmware", 0); +} + +static INPUT_PORTS_START(mv3400) +INPUT_PORTS_END + +void uvax3_state::mv3400(machine_config &config) +{ + DC341(config, m_maincpu, 40_MHz_XTAL / 2); + m_maincpu->set_addrmap(AS_PROGRAM, &uvax3_state::mem_map); + + //AM7990(config, "lance", ?); +} + +ROM_START(mv3400) + ROM_REGION32_LE(0x20000, "firmware", 0) + ROM_LOAD16_BYTE("m7624_dec88_lm8914_152e7_d27512.bin", 0x00000, 0x10000, CRC(eb61f8d0) SHA1(17d56f59120881df2b6522097998b4a9e4bac77e)) + ROM_LOAD16_BYTE("m7624_dec88_lm8914_153e7_d27512.bin", 0x00001, 0x10000, CRC(6727bff2) SHA1(4f566e82a8fa8490056d62b3e44c070ba5ab1754)) +ROM_END + +ROM_START(mv3500) + ROM_REGION32_LE(0x20000, "firmware", 0) + ROM_LOAD16_BYTE("ka650-a-v5.3-vmb2.7_192e7.bin", 0x00000, 0x10000, CRC(a3ec59a6) SHA1(6d0121d7e232c841484a328340c828a4f0fdf903)) + ROM_LOAD16_BYTE("ka650-a-v5.3-vmb2.7_193e7.bin", 0x00001, 0x10000, CRC(873ee8bd) SHA1(b0abfebda60e9394e1045644634a8845b5573d04)) +ROM_END + +} // anonymous namespace + +COMP(1988, mv3400, 0, 0, mv3400, mv3400, uvax3_state, empty_init, "Digital Equipment Corporation", "MicroVAX 3400", MACHINE_NOT_WORKING | MACHINE_NO_SOUND_HW) +COMP(1988, mv3500, 0, 0, mv3400, mv3400, uvax3_state, empty_init, "Digital Equipment Corporation", "MicroVAX 3500", MACHINE_NOT_WORKING | MACHINE_NO_SOUND_HW) diff --git a/src/mame/dec/uvax3100.cpp b/src/mame/dec/uvax3100.cpp new file mode 100644 index 0000000000000..0aa147971de51 --- /dev/null +++ b/src/mame/dec/uvax3100.cpp @@ -0,0 +1,182 @@ +// license:BSD-3-Clause +// copyright-holders: +/*********************************************************************************************************************** + + Skeleton driver for first-generation (CVAX-based) DEC MicroVAX 3100 models. + + + Hardhare for MicroVAX 3100 Model 10: + ____ + Main PCB: _________________ _____ _____ _____ _ | | ___ ___________ + ________________| |___| |___| |___| |___| |___| |___________| |__| |_____ + | |________________| |____| |____| |____| |_| |___| | | |__________| | + | ____ ______ __________ __________ __________ | | __________ | + | |o o| | | __________ |_ITA27B4_| |_ITA27B4_| |DP8392BN_| | | 16-25072-01 | + | |o o| |_____| |_ITA27B4_| :::::::::::::::::::::::::: | | | + | |o o| ______ ___________ ___________ ___________ |__| ____________ | + | |o o| |L5170D PE-64685-001 PE-64685-001 PE-64685-001 _______ __________ |_AM7992BDC_| | + | |o o| |_____| |_________| |_________| |_________| |74F244| 16-25072-01 | + | |___| ____________ Xtal | + | __________ __________ ::::::::::::::::::::::: ::::::::::::::::::::::: |74LS244NQST| 20MHz | + | |74LS273N_| |74LS240N_| ____ __________ ___________ __________________ | + | Xtal Xtal ___________ |___| |_7416PC__| | MC146818P| |AMD AM7990DC/80 | | + |: 3.6864MHz .. 5.0688MHz | | |__________| |21-21672-09______| | + | __________ |LSIL5A0065| __________________ _________________ _________________ | + | |_74LS92N_| |21-22769-01 |NCR 5380 | |NCR 5380 | | EPROM (E25) | | + | ________________ | | |CP07972__________| |CP07972__________| |________________| | + | | SIEMENS | |__________| __________ _________________ | + | | SC21C1002 | |_PROM____| | EPROM (E24) | | + | | 21-30367-03 | Xtal _____ __________ __________ |________________| | + | | | 69.1968MHz |____| 18-18800-02 |74LS125AN| | + | | | __________ | + | |_______________| |_74F244N_| | + | __________________ _________________ | + | | EPROM (E98) | | | __________ ____ ____ | + | |_________________| | LSI LOGIC | |74F74NQST| |___| |___| | + | _________________ | L1A5029 | __________ | + | | D43256AC-10L | | 21-28651-03 | |_74F11PC_| ____ ____ | + | |________________| | | 1920441Q 1920441Q |___| |___| | + | _________________ | | Xtal 02MP130T 02MP130T | + | | D43256AC-10L | __________ |________________| 66.667MHz ____ | + | |________________| |_74F00PC_| _____________ 1920441Q 1920441Q |___| | + | _________________ __________ ____________ |21-24674-17 | 02MP130T 02MP130T | + | | D43256AC-10L | |74F04NQST| |21-26604-07| | G889-41 | | + | |________________| __________ | H752-28 | | 9134 | 1920441Q 1920441Q | + | _________________ |_74F00PC_| | 9133 | | | 02MP130T 02MP130T __________ | + | | D43256AC-10L | __________ | | |____________| |_74F32PC_| | + | |________________| |_74F32PC_| |___________| 1920441Q 1920441Q | + | 02MP130T 02MP130T | + | __________ __________ | + | |74LS240N_| |SN74AS804| | + | ::::::::::::::: ::::::::::::::: __________ __________ | + | |SN74AS804| |_74F32N__| | + |____________________________________________________________________________________________________________| + + + Communications PCB: + ___________________________________________________________________________________ ___________________________ + | | | | + | _______________________ ___________ ___________ |____| ___________ | + | | SCN68562C4N48 | |74HCT245N_| |74HCT245N_| |_PAL20L10_| | + | |______________________| ___________ ___________ _______________ ___________ | + | |74HCT245N_| |74HCT245N_| | HM6264AP-10 | |74F32NQST_| | + | _______________________ ___________ |______________| ___________ | + | | SCN68562C4N48 | |74HCT245N_| _______________ |74F08NQST_| | + | |______________________| ___________ | HM6264AP-10 | ___________ | + | ___________ . __________ _______________ |74HCT245N_| |______________| |_74F74PC__| | + ||_74F453N__| : |SN74LS244N | | ___________ _______________ ___________ | + | __________ ________ | 21-26907-02 | |_74LS373N_| | HM6264AP-10 | |74F02NQST_| | + ||SN74LS20N| |74F10PC| | DC7045D | _____________ ___________ |______________| ___________ | + | | TAC 8944 | | DEC 358EA | |74HCT245N_| _______________ |_74F74PC__| | + | __________ ____________ | | | 78532-GA | ___________ | HM6264AP-10 | ___________ | + | |74F191PC_| | | |______________| | 21-24329-01| |_74LS373N_| |______________| |74F00NQST_| | + | __________ | | ______________ |P467-17 8949| ___________ ___________ | + | |_74F74PC_| | | |CY7C128-45PC_| |____________| |PAL16L8NC_| |74F08NQST_| | + | Xtal | | ______________ ___________ ______________ | + | 14.7456 MHz |___________| |PAL20L10ACNS_| |MC74F521N_| | PLS105ANJ | | + | ____________ ____________ ____________ __________ __________ __________ ___________ |_____________| | + ||SN74LS244N_| |SN74LS244N_| |SN74LS166AN| |74F245PC_| |SN74LS139| |_74F74PC_| |74HCT245N_| ______________ | + | ____________ ____________ ____________ __________ __________ ___________ | PLS105ANJ | | + ||SN74LS244N_| |SN74LS244N_| |SN74LS166AN| |74HCT245N| |22738-01_| 40MHz Xtal |_74F543N__| |_____________| | + | _____ __________ __________ __________ ___________ ______________ | + | | | ____ |74HCT245N| |SN74LS375N |74F32NQST| |74HCT245N_| | PLS105ANJ | | + | | C | | | __________ __________ __________ ___________ |_____________| | + | | O | | C | |74F245PC_| |74F32NQST| |74F32NQST| |_74F543N__| ______________ | + | | N | | O | __________ __________ __________ ___________ | EPROM | | + | | N | | N | |_74F244N_| |SN74LS09N| |74F00NQST| |74HCT245N_| |_____________| | + | | | | N | __________ __________ __________ ___________ ___________ | + | | | | | |MC74F240N| |74F32NQST| |_________| |_74F543N__| |_74LS244N_| | + | | | | | ___________ ___________ | + | | | |___| ______________________ ______________________ |74HCT245N_| |_74F374N__| | + | |____| | :::::::::::::::::::: | | ::::::::::::::::::: | ___________ | + | |_74F543N__| | + |__________________________________________________________________________________________________________________| + +***********************************************************************************************************************/ + +#include "emu.h" +#include "cpu/vax/vax.h" + +#include "machine/am79c90.h" +//#include "machine/ncr5380.h" +//#include "machine/scnxx562.h" +#include "machine/terminal.h" + + +namespace { + +class uvax3100_state : public driver_device +{ +public: + uvax3100_state(const machine_config &mconfig, device_type type, const char *tag) + : driver_device(mconfig, type, tag) + , m_maincpu(*this, "maincpu") + , m_terminal(*this, "terminal") + { } + + void uvax3100(machine_config &config) ATTR_COLD; + +private: + void mem_map(address_map &map) ATTR_COLD; + + required_device m_maincpu; + required_device m_terminal; +}; + + +void uvax3100_state::mem_map(address_map &map) +{ + map(0x20040000, 0x2007ffff).rom().region("maincpu", 0); +} + + +// Input ports +static INPUT_PORTS_START( uvax3100 ) +INPUT_PORTS_END + + +// Model 10 +void uvax3100_state::uvax3100(machine_config &config) +{ + // Basic machine hardware + DC341(config, m_maincpu, 66.6667_MHz_XTAL / 6); // CPU CVAX 21-24674-17 11.11 MHz + m_maincpu->set_addrmap(AS_PROGRAM, &uvax3100_state::mem_map); + + AM7990(config, "lance1", 0); // AMD AM7990PC/80 + + // NCR5380(...) + + // DUSCC68562(...) // Signetics SCN68562C4N48 + + // Video hardware + GENERIC_TERMINAL(config, m_terminal, 0); +} + +ROM_START( mv3100m10 ) + ROM_REGION( 0x40000, "maincpu", ROMREGION_ERASEFF ) + ROM_LOAD32_WORD( "dec89_23-116e8-00_system_rom_lo_word.e24", 0x00000, 0x20000, CRC(69ef8cf5) SHA1(a59a500921278dc356a519cb435641426c844779) ) + ROM_LOAD32_WORD( "dec89_23-117e8-00_system_rom_hi_word.e25", 0x00002, 0x20000, CRC(df572ac3) SHA1(5e91d0f4fc8442e3ebc2424d9f85078ba00d2de5) ) + + ROM_REGION( 0x20000, "scsi", ROMREGION_ERASEFF ) + ROM_LOAD( "dec89_23-061e8-00_scsi_rom.e98", 0x00000, 0x20000, CRC(51fb8268) SHA1(a930869dce955b9b7a2b0fb68840e863c74e6512) ) + + ROM_REGION( 0x10000, "comms", ROMREGION_ERASEFF ) + ROM_LOAD( "dec90_fx9123_248e7.bin", 0x00000, 0x10000, CRC(d50801e6) SHA1(e67b1d732ce775381eb8f41684a3366db7a435d7) ) + + ROM_REGION( 0x00117, "plds", ROMREGION_ERASEFF ) // All of them on the comms PCB + ROM_LOAD( "dec90_lm9019_032j7_pal20l10acns.bin", 0x00000, 0x00117, NO_DUMP ) + ROM_LOAD( "dec90_lm9027_111l1_pls105anj.bin", 0x00000, 0x00100, NO_DUMP ) + ROM_LOAD( "dec90_lm9028_519j5_pal16l8nc.bin", 0x00000, 0x00117, NO_DUMP ) + ROM_LOAD( "dec90_lm9029_124l1_pls105anj.bin", 0x00000, 0x00100, NO_DUMP ) + ROM_LOAD( "dec90_lm9030_031j7_pal20l10acns.bin", 0x00000, 0x00117, NO_DUMP ) + ROM_LOAD( "dec90_lm9031_112l1_pls105anj.bin", 0x00000, 0x00100, NO_DUMP ) + + ROM_REGION( 0x00100, "prom", ROMREGION_ERASEFF ) // On the main PCB + ROM_LOAD( "dec84_fx9206_365a1.bin", 0x00000, 0x00100, NO_DUMP ) +ROM_END + +} // anonymous namespace + + +// YEAR NAME PARENT COMPAT MACHINE INPUT STATE INIT COMPANY FULLNAME FLAGS +COMP( 1989, mv3100m10, 0, 0, uvax3100, uvax3100, uvax3100_state, empty_init, "Digital Equipment Corporation", "MicroVAX 3100 Model 10", MACHINE_NOT_WORKING | MACHINE_NO_SOUND) diff --git a/src/mame/dynax/ddenlovr.cpp b/src/mame/dynax/ddenlovr.cpp index 05b65166da919..349fdd3a7e6a0 100644 --- a/src/mame/dynax/ddenlovr.cpp +++ b/src/mame/dynax/ddenlovr.cpp @@ -198,6 +198,7 @@ class ddenlovr_state : public dynax_state void ddenlovrk(machine_config &config) ATTR_COLD; void quizchq(machine_config &config) ATTR_COLD; void mjmyuniv(machine_config &config) ATTR_COLD; + void mjmyunivbl2(machine_config &config) ATTR_COLD; void dtoyoken(machine_config &config) ATTR_COLD; void hgokou(machine_config &config) ATTR_COLD; void seljan2(machine_config &config) ATTR_COLD; @@ -301,7 +302,6 @@ class ddenlovr_state : public dynax_state protected: void mjmyster_rambank_w(uint8_t data); private: - void mjmyster_rombank_w(uint8_t data); void mjmyster_select2_w(uint8_t data); uint8_t mjmyster_coins_r(); uint8_t mjmyster_keyb_r(); @@ -396,6 +396,7 @@ class ddenlovr_state : public dynax_state void mjflove_portmap(address_map &map) ATTR_COLD; void mjmyorntr_portmap(address_map &map) ATTR_COLD; void mjmyster_map(address_map &map) ATTR_COLD; + void mjmyunivbl2_map(address_map &map) ATTR_COLD; void mjmyster_portmap(address_map &map) ATTR_COLD; void mjmywrld_portmap(address_map &map) ATTR_COLD; void mjschuka_portmap(address_map &map) ATTR_COLD; @@ -3210,9 +3211,14 @@ void ddenlovr_state::mjmyster_map(address_map &map) map(0xf200, 0xffff).nopw(); // "" } -void ddenlovr_state::mjmyster_rombank_w(uint8_t data) +void ddenlovr_state::mjmyunivbl2_map(address_map &map) { - membank("bank1")->set_entry(data & 0x7); + map(0x0000, 0x5fff).rom(); // ROM + map(0x6000, 0x6fff).ram(); // RAM + map(0x7000, 0x7fff).bankrw("bank2"); // RAM (Banked) + map(0x8000, 0xffff).bankr("bank1"); // ROM/RAM (Banked) + map(0xe000, 0xe1ff).w(FUNC(ddenlovr_state::ddenlovr_palette_w)); // RAM enabled by bit 4 of rombank + map(0xe200, 0xefff).nopw(); // "" } void ddenlovr_state::mjmyster_rambank_w(uint8_t data) @@ -7114,6 +7120,16 @@ static INPUT_PORTS_START( mjmyster ) PORT_DIPSETTING( 0x00, DEF_STR(2C_3C) ) PORT_CONDITION("FAKE", 0x01, EQUALS, 0x00) INPUT_PORTS_END +static INPUT_PORTS_START( mjmyunivbl ) + // default to Hong Kong/Taiwan + PORT_INCLUDE(mjmyster) + + PORT_MODIFY("DSW4") + PORT_DIPNAME( 0x80, 0x00, DEF_STR(Region) ) PORT_DIPLOCATION("SW4:8") + PORT_DIPSETTING( 0x80, DEF_STR(Japan) ) + PORT_DIPSETTING( 0x00, "Hong Kong/Taiwan" ) +INPUT_PORTS_END + static INPUT_PORTS_START( hginga ) // The manual provides three sets of standard settings: // 標準設定 コインプールタイプ 標準設定 メダルコーナータイプ 標準設定 アミューズコーナータイプ @@ -9576,7 +9592,7 @@ void ddenlovr_state::mjmyorntr(machine_config &config) tmpz84c015_device &tmpz(*subdevice("maincpu")); tmpz.set_addrmap(AS_IO, &ddenlovr_state::mjmyorntr_portmap); tmpz.out_pa_callback().set(FUNC(ddenlovr_state::mjmyster_rambank_w)); - tmpz.out_pb_callback().set(FUNC(ddenlovr_state::mjmyster_rombank_w)); + tmpz.out_pb_callback().set_membank("bank1").mask(0x07); MCFG_MACHINE_START_OVERRIDE(ddenlovr_state,hparadis) MCFG_VIDEO_START_OVERRIDE(ddenlovr_state,ddenlovr) @@ -9603,7 +9619,7 @@ void ddenlovr_state::mjmyster(machine_config &config) maincpu.set_addrmap(AS_IO, &ddenlovr_state::mjmyster_portmap); maincpu.in_pa_callback().set_constant(0); maincpu.out_pa_callback().set(FUNC(ddenlovr_state::mjmyster_rambank_w)); - maincpu.out_pb_callback().set(FUNC(ddenlovr_state::mjmyster_rombank_w)); + maincpu.out_pb_callback().set_membank("bank1").mask(0x07); m_screen->screen_vblank().set(m_maincpu, FUNC(tmpz84c015_device::trg0)).invert(); @@ -9716,7 +9732,7 @@ void ddenlovr_state::mjmyuniv(machine_config &config) maincpu.set_addrmap(AS_IO, &ddenlovr_state::mjmyster_portmap); maincpu.in_pa_callback().set_constant(0); maincpu.out_pa_callback().set(FUNC(ddenlovr_state::mjmyster_rambank_w)); - maincpu.out_pb_callback().set(FUNC(ddenlovr_state::mjmyster_rombank_w)); + maincpu.out_pb_callback().set_membank("bank1").mask(0x07); m_screen->screen_vblank().set(m_maincpu, FUNC(tmpz84c015_device::trg0)).invert(); @@ -9732,6 +9748,13 @@ void ddenlovr_state::mjmyuniv(machine_config &config) aysnd.add_route(ALL_OUTPUTS, "mono", 0.30); } +void ddenlovr_state::mjmyunivbl2(machine_config &config) +{ + mjmyuniv(config); + + subdevice("maincpu")->set_addrmap(AS_PROGRAM, &ddenlovr_state::mjmyunivbl2_map); +} + void ddenlovr_state::mjmyornt(machine_config &config) { quizchq(config); @@ -9742,7 +9765,7 @@ void ddenlovr_state::mjmyornt(machine_config &config) maincpu.set_addrmap(AS_IO, &ddenlovr_state::mjmyster_portmap); maincpu.in_pa_callback().set_constant(0); maincpu.out_pa_callback().set(FUNC(ddenlovr_state::mjmyster_rambank_w)); - maincpu.out_pb_callback().set(FUNC(ddenlovr_state::mjmyster_rombank_w)); + maincpu.out_pb_callback().set_membank("bank1").mask(0x07); m_screen->screen_vblank().set(m_maincpu, FUNC(tmpz84c015_device::trg0)).invert(); m_screen->set_visarea(0, 336-1, 4, 256-16+4-1); @@ -11769,6 +11792,42 @@ ROM_START( mjmyuniv ) ROM_LOAD( "1.1e", 0x00000, 0x20000, CRC(09b7a9b2) SHA1(64d9ccbb726bb6c5b362afc92bca2e3db87fd454) ) ROM_END +// 麻雀 龍兄虎弟 +// CS166P001 PCB (very similar to mjmyuniv's one). Dump was presented as a bootleg but the PCB has all Dynax / Nakanihon original customs. +ROM_START( mjmyunivbl ) + ROM_REGION( 0x90000 + 0x1000*8, "maincpu", 0 ) // Z80 Code + space for banked RAM + ROM_LOAD( "rom.u42", 0x00000, 0x40000, CRC(8000eec3) SHA1(e2a4a46ebb8e152956f469382bde73b983090c01) ) + ROM_RELOAD( 0x10000, 0x40000 ) + + ROM_REGION( 0xc00000, "blitter", ROMREGION_ERASE00 ) + // gap + ROM_LOAD( "rom.u59", 0x800000, 0x080000, CRC(a287589a) SHA1(58659dd7e019d1d32efeaec548c84a7ded637c50) ) + ROM_LOAD( "rom.u60", 0x880000, 0x080000, CRC(33dc6d59) SHA1(68440591ff194b444336a6d6abe599eee56d91c7) ) + ROM_LOAD( "rom.u57", 0x900000, 0x080000, BAD_DUMP CRC(f45c24d6) SHA1(0eca68f2ca5722717f27ac0839359966daa2715b) ) // damaged ROM, using the one from mjmyuniv for now + ROM_LOAD( "rom.u58", 0x980000, 0x080000, CRC(9af9a939) SHA1(3ce67bb71b6dcf8535b6eba03622eaf53cdd3363) ) + + ROM_REGION( 0x40000, "oki", 0 ) // samples + ROM_LOAD( "rom.u30", 0x000000, 0x040000, CRC(30e496a6) SHA1(c7ea23079bd4acb6e06af954fafe8462d5576b0e) ) +ROM_END + +// 麻雀 財会贏 +// also CS166P001 PCB +ROM_START( mjmyunivbl2 ) + ROM_REGION( 0x90000 + 0x1000*8, "maincpu", 0 ) // Z80 Code + space for banked RAM + ROM_LOAD( "romb.u47", 0x00000, 0x40000, CRC(eb447ce4) SHA1(8b38cedd83dbc3dd1dff7f4a60658c1a9ef50428) ) + ROM_RELOAD( 0x10000, 0x40000 ) + + ROM_REGION( 0x400000, "blitter", ROMREGION_ERASE00 ) + // gap + ROM_LOAD( "romf.u60", 0x200000, 0x080000, CRC(a287589a) SHA1(58659dd7e019d1d32efeaec548c84a7ded637c50) ) + ROM_LOAD( "rome.u59", 0x280000, 0x080000, CRC(a3475059) SHA1(ec86dcea3314b65d391a970680c021899c16449e) ) + ROM_LOAD( "romd.u58", 0x300000, 0x080000, CRC(f45c24d6) SHA1(0eca68f2ca5722717f27ac0839359966daa2715b) ) + ROM_LOAD( "romc.u57", 0x380000, 0x080000, CRC(d9e4a01e) SHA1(0a0320cea0581c4278d120752997f67537c46531) ) + + ROM_REGION( 0x40000, "oki", 0 ) // samples + ROM_LOAD( "roma.u30", 0x000000, 0x040000, CRC(f9bf11fa) SHA1(3e781db107d24f456b48a99987c45727454d0a69) ) +ROM_END + /*************************************************************************** Panel & Variety Akamaru Q Joushou Dont-R @@ -12650,6 +12709,8 @@ GAME( 1994, mjmywrld, mjmyster, mjmywrld, mjmyster, ddenlovr_state, empty_ GAME( 1994, hginga, 0, hginga, hginga, ddenlovr_state, empty_init, ROT0, "Dynax", "Hanafuda Hana Ginga (Japan)", MACHINE_NO_COCKTAIL ) GAME( 1994, mjmyuniv, 0, mjmyuniv, mjmyster, ddenlovr_state, empty_init, ROT0, "Dynax", "Mahjong The Mysterious Universe (Japan, D85)", MACHINE_NO_COCKTAIL ) +GAME( 1995, mjmyunivbl, mjmyuniv, mjmyuniv, mjmyunivbl, ddenlovr_state, empty_init, ROT0, "bootleg", "Maa Zoek Lung Hing Fu Dai (Hong Kong, D106T)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_NO_COCKTAIL ) // One GFX ROM isn't dumped +GAME( 1996, mjmyunivbl2, mjmyuniv, mjmyunivbl2,mjmyunivbl,ddenlovr_state, empty_init, ROT0, "bootleg", "Maque Caihui Ying (Taiwan, ver 2.20)", MACHINE_NO_COCKTAIL ) GAME( 1994, quiz365, 0, quiz365, quiz365, ddenlovr_state, empty_init, ROT0, "Nakanihon", "Quiz 365 (Japan)", MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_GRAPHICS | MACHINE_UNEMULATED_PROTECTION ) GAME( 1994, quiz365t, quiz365, quiz365, quiz365, ddenlovr_state, empty_init, ROT0, "Nakanihon / Taito", "Quiz 365 (Hong Kong & Taiwan)", MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_GRAPHICS | MACHINE_UNEMULATED_PROTECTION ) diff --git a/src/mame/dynax/dynax.cpp b/src/mame/dynax/dynax.cpp index 598cb3278b1ce..8d780abb93faf 100644 --- a/src/mame/dynax/dynax.cpp +++ b/src/mame/dynax/dynax.cpp @@ -253,7 +253,7 @@ void jantouki_state::jantouki_sound_rombank_w(uint8_t data) } -void dynax_adpcm_state::hnoridur_rombank_w(uint8_t data) +void dynax_state::hnoridur_rombank_w(uint8_t data) { m_bankdev->set_bank(data & 0x1f); } @@ -281,19 +281,19 @@ void dynax_adpcm_state::hnoridur_palette_update(offs_t offset) m_palette->set_pen_color(256 * m_palbank + offset, pal5bit(r), pal5bit(g), pal5bit(b)); } -void dynax_adpcm_state::nanajign_palette_lo_w(offs_t offset, uint8_t data) +void dynax_state::nanajign_palette_lo_w(offs_t offset, uint8_t data) { m_palette_ram[256 * m_palbank + offset + 16 * 256] = data; nanajign_palette_update(offset); } -void dynax_adpcm_state::nanajign_palette_hi_w(offs_t offset, uint8_t data) +void dynax_state::nanajign_palette_hi_w(offs_t offset, uint8_t data) { m_palette_ram[256 * m_palbank + offset] = data; nanajign_palette_update(offset); } -void dynax_adpcm_state::nanajign_palette_update(offs_t offset) +void dynax_state::nanajign_palette_update(offs_t offset) { int bg = m_palette_ram[256 * m_palbank + offset]; int br = m_palette_ram[256 * m_palbank + offset + 16 * 256]; @@ -368,15 +368,7 @@ void dynax_adpcm_state::hnoridur_mem_map(address_map &map) map(0x8000, 0xffff).m(m_bankdev, FUNC(address_map_bank_device::amap8)); } -void dynax_adpcm_state::mcnpshnt_mem_map(address_map &map) -{ - map(0x0000, 0x5fff).rom(); - map(0x6000, 0x6fff).ram(); - map(0x7000, 0x7fff).ram().share("nvram"); - map(0x8000, 0xffff).m(m_bankdev, FUNC(address_map_bank_device::amap8)); -} - -void dynax_adpcm_state::nanajign_mem_map(address_map &map) +void dynax_state::nanajign_mem_map(address_map &map) { map(0x0000, 0x5fff).rom(); map(0x6000, 0x6fff).ram(); @@ -392,14 +384,6 @@ void dynax_state::mjdialq2_mem_map(address_map &map) map(0x8000, 0xffff).bankr("bank1"); } -void dynax_adpcm_state::yarunara_mem_map(address_map &map) -{ - map(0x0000, 0x5fff).rom(); - map(0x6000, 0x6fff).ram(); - map(0x7000, 0x7fff).ram().share("nvram"); - map(0x8000, 0xffff).m(m_bankdev, FUNC(address_map_bank_device::amap8)); -} - //identical to yarunara, but nvram is in the 0x6000 - 0x6fff range void dynax_adpcm_state::quiztvqq_mem_map(address_map &map) { @@ -434,11 +418,11 @@ void dynax_adpcm_state::hnoridur_banked_map(address_map &map) map(0xc0000, 0xc7fff).ram(); // hnoridur: R/W RAM } -void dynax_adpcm_state::mjelctrn_banked_map(address_map &map) +void dynax_state::mjelctrn_banked_map(address_map &map) { map(0x00000, 0x3ffff).rom().region("maincpu", 0x10000); - map(0x80000, 0x800ff).w(FUNC(dynax_adpcm_state::nanajign_palette_lo_w)); - map(0xa0000, 0xa00ff).w(FUNC(dynax_adpcm_state::nanajign_palette_hi_w)); + map(0x80000, 0x800ff).w(FUNC(dynax_state::nanajign_palette_lo_w)); + map(0xa0000, 0xa00ff).w(FUNC(dynax_state::nanajign_palette_hi_w)); } void dynax_adpcm_state::nanajign_banked_map(address_map &map) @@ -543,7 +527,7 @@ void dynax_adpcm_state::hjingi_lockout_w(int state) machine().bookkeeping().coin_lockout_w(0, !state); } -uint8_t dynax_adpcm_state::hjingi_keyboard_0_r() +uint8_t dynax_state::hjingi_keyboard_0_r() { return hanamai_keyboard_r<0>() | (m_hopper->line_r() ? 0 : (1 << 6)); } @@ -687,8 +671,9 @@ void dynax_adpcm_state::yarunara_rombank_w(uint8_t data) m_bankdev->set_bank(data & 0x3f); } -void dynax_adpcm_state::yarunara_blit_romregion_w(uint8_t data) +void dynax_state::yarunara_blit_romregion_w(uint8_t data) { + logerror("%s: unmapped romregion=%02X\n", machine().describe_context(), data); switch(data) { case 0x00: dynax_blit_romregion_w(0); return; @@ -697,7 +682,6 @@ void dynax_adpcm_state::yarunara_blit_romregion_w(uint8_t data) case 0x81: dynax_blit_romregion_w(3); return; case 0x82: dynax_blit_romregion_w(4); return; // mjcomv1 } - logerror("%s: unmapped romregion=%02X\n", machine().describe_context(), data); } void dynax_adpcm_state::yarunara_io_map(address_map &map) @@ -926,12 +910,12 @@ void jantouki_state::jantouki_sound_io_map(address_map &map) Mahjong Electron Base ***************************************************************************/ -uint8_t dynax_adpcm_state::mjelctrn_keyboard_1_r() +uint8_t dynax_state::mjelctrn_keyboard_1_r() { return (hanamai_keyboard_r<1>() & 0x3f) | (ioport("FAKE")->read() ? 0x40 : 0); } -uint8_t dynax_adpcm_state::mjelctrn_dsw_r() +uint8_t dynax_state::mjelctrn_dsw_r() { int dsw = (m_keyb & 0xc0) >> 6; static const char *const dswnames[] = { "DSW0", "DSW1", "DSW2", "DSW3" }; @@ -973,6 +957,39 @@ void dynax_adpcm_state::mjelctrn_io_map(address_map &map) map(0xe7, 0xe7).w(FUNC(dynax_adpcm_state::hnoridur_palbank_w)); } +void dynax_state::qyjdzjp_io_map(address_map &map) +{ + map.global_mask(0xff); + map(0x04, 0x05).w("ym2413", FUNC(ym2413_device::write)); // + map(0x08, 0x08).w("aysnd", FUNC(ay8912_device::data_w)); // AY8912 + map(0x0a, 0x0a).w("aysnd", FUNC(ay8912_device::address_w)); // + map(0x0c, 0x0c).w("oki", FUNC(okim6295_device::write)); // +// map(0x20, 0x20).nopw(); // CRT Controller +// map(0x21, 0x21).nopw(); // CRT Controller + map(0x40, 0x47).w("outlatch", FUNC(ls259_device::write_d0)); + map(0x60, 0x60).w(FUNC(dynax_state::dynax_extra_scrollx_w)); // screen scroll X + map(0x62, 0x62).w(FUNC(dynax_state::dynax_extra_scrolly_w)); // screen scroll Y +// map(0x64, 0x64).w(FUNC(dynax_state::dynax_extra_scrollx_w)); // screen scroll X +// map(0x66, 0x66).w(FUNC(dynax_state::dynax_extra_scrolly_w)); // screen scroll Y + map(0x6a, 0x6a).w(FUNC(dynax_state::hnoridur_rombank_w)); // BANK ROM Select + map(0x80, 0x80).w(FUNC(dynax_state::hanamai_keyboard_w)); // keyboard row select + map(0x81, 0x81).portr("COINS"); // Coins + map(0x82, 0x82).r(FUNC(dynax_state::mjelctrn_keyboard_1_r)); // P2 + map(0x83, 0x83).r(FUNC(dynax_state::hjingi_keyboard_0_r)); // P1 + map(0x84, 0x84).r(FUNC(dynax_state::mjelctrn_dsw_r)); // DSW8 x 4 + map(0x85, 0x85).portr("SW1"); // DSW2 + map(0xa1, 0xa7).w(m_blitter, FUNC(dynax_blitter_rev2_device::regs_w)); // Blitter + map(0xc0, 0xc7).w(m_mainlatch, FUNC(ls259_device::write_d0)); + map(0xe0, 0xe0).w(m_blitter, FUNC(dynax_blitter_rev2_device::pen_w)); // Destination Pen + map(0xe1, 0xe1).w(FUNC(dynax_state::dynax_blit_dest_w)); // Destination Layer + map(0xe2, 0xe2).w(FUNC(dynax_state::dynax_blit_palette01_w)); // Layers Palettes + map(0xe3, 0xe3).w(FUNC(dynax_state::dynax_blit_palette23_w)); // + map(0xe4, 0xe4).w(FUNC(dynax_state::hanamai_priority_w)); // layer priority and enable + map(0xe5, 0xe5).w(FUNC(dynax_state::dynax_blit_backpen_w)); // Background Color + map(0xe6, 0xe6).w(FUNC(dynax_state::yarunara_blit_romregion_w)); // Blitter ROM bank + map(0xe7, 0xe7).w(FUNC(dynax_state::hnoridur_palbank_w)); +} + void dynax_adpcm_state::mjembase_io_map(address_map &map) { map.global_mask(0xff); @@ -4254,7 +4271,7 @@ void dynax_adpcm_state::yarunara(machine_config &config) hnoridur(config); // basic machine hardware - m_maincpu->set_addrmap(AS_PROGRAM, &dynax_adpcm_state::yarunara_mem_map); + m_maincpu->set_addrmap(AS_PROGRAM, &dynax_adpcm_state::nanajign_mem_map); m_maincpu->set_addrmap(AS_IO, &dynax_adpcm_state::yarunara_io_map); m_bankdev->set_addrmap(AS_PROGRAM, &dynax_adpcm_state::yarunara_banked_map); @@ -4291,7 +4308,7 @@ void dynax_adpcm_state::mcnpshnt(machine_config &config) { hnoridur(config); - m_maincpu->set_addrmap(AS_PROGRAM, &dynax_adpcm_state::mcnpshnt_mem_map); + m_maincpu->set_addrmap(AS_PROGRAM, &dynax_adpcm_state::nanajign_mem_map); m_maincpu->set_addrmap(AS_IO, &dynax_adpcm_state::mcnpshnt_io_map); MCFG_VIDEO_START_OVERRIDE(dynax_adpcm_state, mcnpshnt) // different priorities @@ -4495,6 +4512,63 @@ void dynax_adpcm_state::mjembase(machine_config &config) MCFG_VIDEO_START_OVERRIDE(dynax_adpcm_state, mjembase) } +void dynax_state::qyjdzjp(machine_config &config) +{ + /* basic machine hardware */ + TMPZ84C015(config, m_maincpu, 21.477272_MHz_XTAL / 2); + m_maincpu->set_addrmap(AS_PROGRAM, &dynax_state::nanajign_mem_map); + m_maincpu->set_addrmap(AS_IO, &dynax_state::qyjdzjp_io_map); + + ADDRESS_MAP_BANK(config, m_bankdev).set_map(&dynax_state::mjelctrn_banked_map).set_data_width(8).set_addr_width(20).set_stride(0x8000); + + NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); + + LS259(config, m_mainlatch); // IC25 + m_mainlatch->q_out_cb<0>().set(FUNC(dynax_state::flipscreen_w)); + m_mainlatch->q_out_cb<1>().set(FUNC(dynax_state::layer_half_w)); + m_mainlatch->q_out_cb<2>().set(FUNC(dynax_state::layer_half2_w)); + // Q3, Q4 seem to be related to wrap around enable + + ls259_device &outlatch(LS259(config, "outlatch")); // IC61 + outlatch.q_out_cb<0>().set(FUNC(dynax_state::coincounter_0_w)); + outlatch.q_out_cb<1>().set(FUNC(dynax_state::coincounter_1_w)); + outlatch.q_out_cb<2>().set(m_hopper, FUNC(hopper_device::motor_w)); + + HOPPER(config, m_hopper, attotime::from_msec(50)); + + /* video hardware */ + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_refresh_hz(60); + m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(0)); + m_screen->set_size(512, 256+22); + m_screen->set_visarea(0, 512-1-4, 16, 256-1); + m_screen->set_screen_update(FUNC(dynax_state::screen_update_hnoridur)); + m_screen->set_palette(m_palette); + m_screen->screen_vblank().set(m_maincpu, FUNC(tmpz84c015_device::trg0)).invert(); + + DYNAX_BLITTER_REV2(config, m_blitter, 0); + m_blitter->vram_out_cb().set(FUNC(dynax_state::hnoridur_blit_pixel_w)); + m_blitter->scrollx_cb().set(FUNC(dynax_state::dynax_blit_scrollx_w)); + m_blitter->scrolly_cb().set(FUNC(dynax_state::dynax_blit_scrolly_w)); + m_blitter->ready_cb().set(m_maincpu, FUNC(tmpz84c015_device::trg1)); + m_blitter->ready_cb().append(m_maincpu, FUNC(tmpz84c015_device::trg2)); + + PALETTE(config, m_palette).set_entries(16*256); + + MCFG_VIDEO_START_OVERRIDE(dynax_state, mjelctrn) + + /* sound hardware */ + SPEAKER(config, "mono").front_center(); + + ay8912_device &ay8912(AY8912(config, "aysnd", 12_MHz_XTAL / 8)); + ay8912.port_a_read_callback().set_ioport("DSW0"); + ay8912.add_route(ALL_OUTPUTS, "mono", 0.20); + + YM2413(config, "ym2413", 3.579545_MHz_XTAL).add_route(ALL_OUTPUTS, "mono", 1.0); + + OKIM6295(config, "oki", 12_MHz_XTAL / 12, okim6295_device::PIN7_HIGH).add_route(ALL_OUTPUTS, "mono", 0.8); +} + /*************************************************************************** Neruton ***************************************************************************/ @@ -5927,14 +6001,112 @@ Z84C015 - Toshiba TMPZ84C015BF-6 Z80 compatible CPU ROM_START( mjelctrb ) ROM_REGION( 0x50000, "maincpu", 0 ) // Z80 Code ROM_LOAD( "prog.u27", 0x00000, 0x20000, CRC(688990ca) SHA1(34825cee8f76de93f12ccf2a1021f9c5369da46a) ) + ROM_RELOAD( 0x28000, 0x08000 ) + ROM_CONTINUE( 0x20000, 0x08000 ) + ROM_CONTINUE( 0x18000, 0x08000 ) + ROM_CONTINUE( 0x10000, 0x08000 ) + + ROM_REGION( 0x200000, "blitter", 0 ) // blitter data + ROM_LOAD( "eb-01.rom", 0x000000, 0x100000, CRC(e5c41448) SHA1(b8322e32b0cb3d771316c9c4f7be91de6e422a24) ) + ROM_LOAD( "eb-02.rom", 0x100000, 0x080000, CRC(e1f1b431) SHA1(04a612aff4c30cb8ea741f228bfa7e4289acfee8) ) +ROM_END + +// bootleg PCB with TMPZ84C015 with flying wire to the program ROM, AL9106 custom, GM68B45S, YM2149F, CCX413-2, 4 banks of 8 DIP switches +ROM_START( mjelct3bl ) + ROM_REGION( 0x50000, "maincpu", 0 ) // Z80 Code + ROM_LOAD( "rom.u3", 0x00000, 0x20000, CRC(2cc0bbd8) SHA1(0653de340d470d209649b82b1844c3c3da5c545a) ) + ROM_CONTINUE( 0x00000, 0x20000 ) + ROM_RELOAD( 0x10000, 0x08000 ) + ROM_CONTINUE( 0x28000, 0x08000 ) + ROM_CONTINUE( 0x20000, 0x08000 ) + ROM_CONTINUE( 0x18000, 0x08000 ) + + ROM_REGION( 0x200000, "blitter", 0 ) // blitter data, not dumped for this set + ROM_LOAD( "e1.u82", 0x000000, 0x100000, BAD_DUMP CRC(e5c41448) SHA1(b8322e32b0cb3d771316c9c4f7be91de6e422a24) ) + ROM_LOAD( "e2.u83", 0x100000, 0x080000, BAD_DUMP CRC(e1f1b431) SHA1(04a612aff4c30cb8ea741f228bfa7e4289acfee8) ) +ROM_END + +/*************************************************************************** +Que You Ji - Dian Zi Ji Pan Jiaqiang Ban (Mahjong Electron Base bootleg) +Hom Inn, 1997 +Hardware Info By Guru +--------------------- + +2J-255 +|--------------------------------------------| +| VOL SOCKET2 |-------| | +|uPC1241H | | 41264 41264 | +| S-1.U8 |AL9106A| | +| | | 41264 41264 | +|M3567 |-------| | +| 3.579545MHz 6116 41264 | +| | +|WF19054 6116 41264 | +| | +| | +|6845 |-------| | +| |-------| |TAICOM | | +| | ZILOG | |AL9301 | DSW2| +| |Z80EIPC| | | | +| |-------| |-------| DSW3| +| DSW1 | +| SOCKET1 21.477272MHz DSW4| +| 6264 C1815 T518A C1815 | +|SC DSW5| +| |-| 10-WAY |----| 18-WAY |--| | +|--| |--------| |-----------------| |----| +Notes: + AL9106 - TAICOM Custom Chip + AL9301 - TAICOM AL9301 Graphics Generator (QFP160) + Z84EIPC - Zilog Z84C1510FEC Z80 EIPC (Enhanced Intelligent Peripheral Controller). + Compatible with Toshiba TMPZ84C015BF-6. Clock Input 10.7375MHz [21.477272/2] + M3567 - Clone of Yamaha YM2413 OPLL FM Sound Chip. Clock Input 3.579545MHz + WF19054 - Winbond WF19054 clone of AY-3-8910. Clock 1.500MHz [12/8] + UPC1241H - NEC uPC1241H 7W Audio Power Amplifier + 6116 - 6116 2kB x8-bit SRAM + 6264 - 6264 8kB x8-bit SRAM (battery-backed) + 41264 - NEC D41264C-15 Dual-Port RAM with 64kB x4-bit DRAM Port and 256 x4-bit Serial Port + 6845 - Goldstar GM68B45S CRT Controller + T518A - Mitsumi T518A Reset Chip + DSW1 - 2-Position DIP Switch + DSW2-5 - 8-Position DIP Switch + SC - 0.047F 5.5V Super Cap + C1815 - 2SC1815 General-Purpose NPN Transistor + 358 - LM358 Dual Operational Amplifier + S-1.U8 - 27C4000 mask ROM + SOCKET1 - Plugged in here is a sub-board marked 'HOM INN MJXB-1' containing.... + 12MHz Crystal + EPROM 27C020 (Oki Samples) + EPROM 27C010 (Z80 Program) + Oki M6295 ADPCM Sample Player. Clock Input 1.000MHz [12/12]. Pin 7 HIGH + ALTERA EPM7032 PLCC44 CPLD + 7404 Logic Chip + 74161 Logic Chip + 78L05 5V Linear Regulator (TO92) + 2SC945 Transistor + 10-Pin Connector with cable joined to parts on main board with 7 wires. + SOCKET2 - Plugged in here is a sub-board marked 'HOM INN MJXB-2' containing.... + 2x 27C4000 mask ROMs + 74LS00 Logic Chip + Socket on main board is wired for 8Mbit ROM so when highest address line + A19 is low or high the logic chip enables OE on one of the 4Mbit ROMs. +***************************************************************************/ + +ROM_START( qyjdzjp ) + ROM_REGION( 0x50000, "maincpu", 0 ) // Z80 Code + ROM_LOAD( "prg.u24", 0x00000, 0x20000, CRC(86d53500) SHA1(61f9aed3da2b49bf9c45ee8d7416cd2ea0300453) ) ROM_RELOAD( 0x28000, 0x08000 ) ROM_CONTINUE( 0x20000, 0x08000 ) ROM_CONTINUE( 0x18000, 0x08000 ) ROM_CONTINUE( 0x10000, 0x08000 ) ROM_REGION( 0x200000, "blitter", 0 ) // blitter data - ROM_LOAD( "eb-01.rom", 0x000000, 0x100000, CRC(e5c41448) SHA1(b8322e32b0cb3d771316c9c4f7be91de6e422a24) ) - ROM_LOAD( "eb-02.rom", 0x100000, 0x080000, CRC(e1f1b431) SHA1(04a612aff4c30cb8ea741f228bfa7e4289acfee8) ) + ROM_LOAD( "s-1.u8", 0x000000, 0x100000, CRC(e5c41448) SHA1(b8322e32b0cb3d771316c9c4f7be91de6e422a24) ) + ROM_LOAD( "4m-l.bin", 0x100000, 0x080000, CRC(140738f6) SHA1(996c92ec33b8a3b819a2be7795248c9e214562df) ) + ROM_LOAD( "4m-h.bin", 0x180000, 0x080000, CRC(865987c2) SHA1(0711e309e8c48af7d92b59dbd1407636ce0455ac) ) + + ROM_REGION( 0x40000, "oki", 0 ) + ROM_LOAD( "oki.u22", 0x00000, 0x40000, CRC(a6340587) SHA1(91f55776fc4f20720f3e3ca965ba9388d3668881) ) ROM_END /*************************************************************************** @@ -6332,6 +6504,20 @@ ROM_START( mjreach ) ROM_RELOAD( 0x180000, 0x80000 ) ROM_END +ROM_START( mjreacha ) + ROM_REGION( 0x50000, "maincpu", 0 ) + ROM_LOAD( "cs16-1.u15", 0x00000, 0x40000, CRC(d557ddf2) SHA1(504a8184270524a22be7767cc17cc33465e42d21) ) // SLDH + ROM_RELOAD( 0x10000, 0x40000 ) + ROM_LOAD( "mjreach-mcu.u3", 0x00000, 0x02000, CRC(091a85dc) SHA1(964ccbc13466464c2feee10f807078ec517bed5c) ) + + ROM_REGION( 0x200000, "blitter", 0 ) // blitter data + ROM_LOAD( "cs16-3.u13", 0x000000, 0x80000, CRC(90f6036f) SHA1(f92aafd0316dc235e58d615825f3110806bc2cf9) ) + ROM_LOAD( "cs16-2.u12", 0x080000, 0x40000, CRC(5558428d) SHA1(b5e30673695b6e56a8c513b484f4f9c225c682cc) ) + ROM_RELOAD( 0x0c0000, 0x40000 ) + ROM_LOAD( "cs16-3.u13", 0x100000, 0x80000, CRC(90f6036f) SHA1(f92aafd0316dc235e58d615825f3110806bc2cf9) ) + ROM_RELOAD( 0x180000, 0x80000 ) +ROM_END + /*************************************************************************** Mahjong Reach (bootleg) @@ -7067,9 +7253,11 @@ GAME( 1989, mjembase, mjelctrn, mjembase, mjembase, dynax_adpcm_state, init_ GAME( 1990, mjelct3, mjelctrn, mjelctrn, mjelct3, dynax_adpcm_state, init_mjelct3, ROT180, "Dynax", "Mahjong Electron Base (parts 2 & 3, Japan set 1)", MACHINE_SUPPORTS_SAVE ) GAME( 1990, mjelct3a, mjelctrn, mjelctrn, mjelct3, dynax_adpcm_state, init_mjelct3a, ROT180, "Dynax", "Mahjong Electron Base (parts 2 & 3, Japan set 2)", MACHINE_SUPPORTS_SAVE ) GAME( 1993, mjelctrb, mjelctrn, mjelctrn, mjelct3, dynax_adpcm_state, init_mjelct3, ROT180, "bootleg", "Mahjong Electron Base (parts 2 & 4, Japan bootleg)", MACHINE_SUPPORTS_SAVE ) +GAME( 1993, mjelct3bl, mjelctrn, mjelctrn, mjelct3, dynax_adpcm_state, init_mjelct3, ROT180, "bootleg", "Mahjong Electron Base (parts 2 & 3, Japan bootleg)", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) GAME( 1990, majxtal7, 7jigen, neruton, majxtal7, dynax_adpcm_state, init_mjelct3, ROT180, "Dynax", "Mahjong X-Tal 7 - Crystal Mahjong / Mahjong Diamond 7 (Japan)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) // reuses a subset of 7jigen assets GAME( 1990, neruton, 0, neruton, neruton, dynax_adpcm_state, init_mjelct3, ROT180, "Dynax / Yukiyoshi Tokoro", "Mahjong Neruton Haikujiradan (Japan, Rev. B?)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) GAME( 1990, nerutona, neruton, neruton, nerutona, dynax_adpcm_state, init_mjelct3, ROT180, "Dynax / Yukiyoshi Tokoro", "Mahjong Neruton Haikujiradan (Japan, Rev. A?)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) +GAME( 1997, qyjdzjp, mjelctrn, qyjdzjp, mjelct3, dynax_state, empty_init, ROT180, "bootleg (Hom Inn)", "Que You Ji - Dian Zi Ji Pan Jiaqiang Ban (v201)", MACHINE_SUPPORTS_SAVE ) GAME( 1991, hanayara, 0, yarunara, hanayara, dynax_adpcm_state, empty_init, ROT180, "Dynax", "Hana wo Yaraneba! (Japan)", MACHINE_SUPPORTS_SAVE ) GAME( 1991, mjcomv1, 0, mjangels, mjcomv1, dynax_adpcm_state, empty_init, ROT180, "Dynax", "Mahjong Comic Gekijou Vol.1 (Japan)", MACHINE_SUPPORTS_SAVE ) GAME( 1991, tenkai, 0, tenkai, tenkai, dynax_state, empty_init, ROT0, "Dynax", "Mahjong Tenkaigen (Japan)", MACHINE_SUPPORTS_SAVE ) @@ -7081,7 +7269,8 @@ GAME( 1991, ougonhai, 0, ougonhai, ougonhai, dynax_state, empty GAME( 1991, ougonhaib1, ougonhai, ougonhaib1, ougonhai, dynax_state, empty_init, ROT0, "bootleg", "Mahjong Ougon no Pai (Japan bootleg set 1, medal)", MACHINE_SUPPORTS_SAVE ) GAME( 1991, ougonhaib2, ougonhai, ougonhaib1, ougonhai, dynax_state, empty_init, ROT0, "bootleg", "Mahjong Ougon no Pai (Japan bootleg set 2, medal)", MACHINE_SUPPORTS_SAVE ) GAME( 1991, ougonhaib3, ougonhai, ougonhaib1, ougonhai, dynax_state, empty_init, ROT0, "bootleg", "Mahjong Ougon no Pai (Japan bootleg set 3, medal)", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) -GAME( 1994, mjreach, 0, mjreach, mjreach, dynax_state, empty_init, ROT0, "Dynax", "Mahjong Reach (Ver. 1.00)", MACHINE_SUPPORTS_SAVE ) +GAME( 1994, mjreach, 0, mjreach, mjreach, dynax_state, empty_init, ROT0, "Dynax", "Mahjong Reach (Ver. 1.00, set 1)", MACHINE_SUPPORTS_SAVE ) +GAME( 1994, mjreacha, mjreach, mjreach, mjreach, dynax_state, empty_init, ROT0, "Dynax", "Mahjong Reach (Ver. 1.00, set 2)", MACHINE_SUPPORTS_SAVE ) GAME( 1994, mjreachbl, mjreach, mjreach, mjreach, dynax_state, empty_init, ROT0, "bootleg", "Mahjong Reach (Ver. 1.00, bootleg)", MACHINE_SUPPORTS_SAVE ) GAME( 1994, mjreachp2, mjreach, mjreachp2, mjreach, dynax_state, empty_init, ROT0, "Dynax", "Mahjong Reach Part II (Ver. D88)", MACHINE_SUPPORTS_SAVE ) GAME( 1994, cdracula, 0, cdracula, cdracula, cdracula_state, empty_init, ROT0, "Yun Sung (Escape license)", "Castle Of Dracula", MACHINE_SUPPORTS_SAVE ) // not a Dynax board diff --git a/src/mame/dynax/dynax.h b/src/mame/dynax/dynax.h index 061a660a6b338..c9838e0df6316 100644 --- a/src/mame/dynax/dynax.h +++ b/src/mame/dynax/dynax.h @@ -41,16 +41,17 @@ class dynax_state : public driver_device { } - void mjfriday(machine_config &config); - void gekisha(machine_config &config); - void majrjhdx(machine_config &config); - void tenkai(machine_config &config); - void ougonhai(machine_config &config); - void ougonhaib1(machine_config &config); - void mjreach(machine_config &config); - void mjreachp2(machine_config &config); - void mjdialq2(machine_config &config); - void sprtmtch(machine_config &config); + void mjfriday(machine_config &config) ATTR_COLD; + void gekisha(machine_config &config) ATTR_COLD; + void majrjhdx(machine_config &config) ATTR_COLD; + void tenkai(machine_config &config) ATTR_COLD; + void ougonhai(machine_config &config) ATTR_COLD; + void ougonhaib1(machine_config &config) ATTR_COLD; + void mjreach(machine_config &config) ATTR_COLD; + void mjreachp2(machine_config &config) ATTR_COLD; + void mjdialq2(machine_config &config) ATTR_COLD; + void sprtmtch(machine_config &config) ATTR_COLD; + void qyjdzjp(machine_config &config) ATTR_COLD; void blitter_ack_w(int state); void sprtmtch_blitter_irq_w(int state); @@ -99,13 +100,23 @@ class dynax_state : public driver_device void coincounter_1_w(int state); uint8_t ret_ff(); template uint8_t hanamai_keyboard_r(); + uint8_t hjingi_keyboard_0_r(); + uint8_t mjelctrn_keyboard_1_r(); + uint8_t mjelctrn_dsw_r(); void hanamai_keyboard_w(uint8_t data); void dynax_rombank_w(uint8_t data); + void hnoridur_rombank_w(uint8_t data); void dynax_blit_palette23_w(uint8_t data); void blit_palbank_w(int state); void dynax_blit_backpen_w(uint8_t data); void dynax_blit_palette01_w(uint8_t data); void dynax_layer_enable_w(uint8_t data); + void hanamai_priority_w(uint8_t data); + void yarunara_blit_romregion_w(uint8_t data); + void hnoridur_palbank_w(uint8_t data); + void nanajign_palette_lo_w(offs_t offset, uint8_t data); + void nanajign_palette_hi_w(offs_t offset, uint8_t data); + void nanajign_palette_update(offs_t offset); uint32_t screen_update_hanamai(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); uint32_t screen_update_hnoridur(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); @@ -120,6 +131,8 @@ class dynax_state : public driver_device void dynax_common_reset(); void sprtmtch_mem_map(address_map &map) ATTR_COLD; + void nanajign_mem_map(address_map &map) ATTR_COLD; + void mjelctrn_banked_map(address_map &map) ATTR_COLD; // up to 8 layers, 2 images per layer (interleaved on screen) std::unique_ptr m_pixmap[8][2]{}; @@ -221,6 +234,8 @@ class dynax_state : public driver_device void mjreachp2_map(address_map &map) ATTR_COLD; + void qyjdzjp_io_map(address_map &map) ATTR_COLD; + // misc int m_rombank = 0; uint8_t m_tenkai_p5_val = 0U; @@ -271,27 +286,17 @@ class dynax_adpcm_state : public dynax_state // misc int m_toggle = 0; - void hnoridur_rombank_w(uint8_t data); - void hnoridur_palbank_w(uint8_t data); void hnoridur_palette_lo_w(offs_t offset, uint8_t data); void hnoridur_palette_hi_w(offs_t offset, uint8_t data); void hnoridur_palette_update(offs_t offset); - void nanajign_palette_lo_w(offs_t offset, uint8_t data); - void nanajign_palette_hi_w(offs_t offset, uint8_t data); - void nanajign_palette_update(offs_t offset); void hjingi_lockout_w(int state); - uint8_t hjingi_keyboard_0_r(); uint8_t hjingi_keyboard_1_r(); void yarunara_input_w(offs_t offset, uint8_t data); uint8_t yarunara_input_r(offs_t offset); void yarunara_rombank_w(uint8_t data); - void yarunara_blit_romregion_w(uint8_t data); - uint8_t mjelctrn_keyboard_1_r(); - uint8_t mjelctrn_dsw_r(); void mjembase_blit_dest_w(uint8_t data); void mjembase_blit_palette23_w(uint8_t data); void hanamai_blit_pixel_w(offs_t offset, uint8_t data); - void hanamai_priority_w(uint8_t data); void mjembase_priority_w(uint8_t data); void adpcm_int(int state); @@ -304,13 +309,9 @@ class dynax_adpcm_state : public dynax_state DECLARE_VIDEO_START(neruton); void hnoridur_mem_map(address_map &map) ATTR_COLD; - void mcnpshnt_mem_map(address_map &map) ATTR_COLD; - void nanajign_mem_map(address_map &map) ATTR_COLD; - void yarunara_mem_map(address_map &map) ATTR_COLD; void quiztvqq_mem_map(address_map &map) ATTR_COLD; void hnoridur_banked_map(address_map &map) ATTR_COLD; - void mjelctrn_banked_map(address_map &map) ATTR_COLD; void nanajign_banked_map(address_map &map) ATTR_COLD; void yarunara_banked_map(address_map &map) ATTR_COLD; void mjangels_banked_map(address_map &map) ATTR_COLD; diff --git a/src/mame/dynax/dynax_v.cpp b/src/mame/dynax/dynax_v.cpp index e870f691a8f1a..6e132be0bbca8 100644 --- a/src/mame/dynax/dynax_v.cpp +++ b/src/mame/dynax/dynax_v.cpp @@ -201,7 +201,7 @@ void jantouki_state::blit2_palbank_w(int state) LOG("PB'=%d ", state); } -void dynax_adpcm_state::hnoridur_palbank_w(uint8_t data) +void dynax_state::hnoridur_palbank_w(uint8_t data) { m_palbank = data & 0x0f; m_blit_palbank = data; // ??? @@ -832,7 +832,7 @@ void dynax_state::mjdialq2_copylayer( bitmap_ind16 &bitmap, const rectangle &cli } } -void dynax_adpcm_state::hanamai_priority_w(uint8_t data) +void dynax_state::hanamai_priority_w(uint8_t data) { m_hanamai_priority = data; } diff --git a/src/mame/edevices/diverboy.cpp b/src/mame/edevices/diverboy.cpp index d8d30917c7e38..2537cf4f36c39 100644 --- a/src/mame/edevices/diverboy.cpp +++ b/src/mame/edevices/diverboy.cpp @@ -1,5 +1,6 @@ // license:BSD-3-Clause -// copyright-holders:David Haywood +// copyright-holders: David Haywood + /* Diver Boy (c)1992 Device Electronics @@ -46,13 +47,16 @@ * 5th coin : adds 1 credit * 6th coin : adds 1 credit ... +TODO: tumblebed uses more GFX features, which need implementing */ #include "emu.h" -#include "cpu/z80/z80.h" + #include "cpu/m68000/m68000.h" +#include "cpu/z80/z80.h" #include "machine/gen_latch.h" #include "sound/okim6295.h" + #include "emupal.h" #include "screen.h" #include "speaker.h" @@ -71,68 +75,57 @@ class diverboy_state : public driver_device m_oki(*this, "oki"), m_gfxdecode(*this, "gfxdecode"), m_screen(*this, "screen"), - m_palette(*this, "palette"), - m_soundlatch(*this, "soundlatch") + m_palette(*this, "palette") { } - void diverboy(machine_config &config); + void diverboy(machine_config &config) ATTR_COLD; + void tumblebed(machine_config &config) ATTR_COLD; private: - /* memory pointers */ required_shared_ptr m_spriteram; - /* devices */ required_device m_maincpu; required_device m_audiocpu; required_device m_oki; required_device m_gfxdecode; required_device m_screen; required_device m_palette; - required_device m_soundlatch; - void soundcmd_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); void okibank_w(uint8_t data); - virtual void machine_start() override ATTR_COLD; - virtual void video_start() override ATTR_COLD; - uint32_t screen_update_diverboy(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ); + uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); void diverboy_map(address_map &map) ATTR_COLD; + void tumblebed_map(address_map &map) ATTR_COLD; void snd_map(address_map &map) ATTR_COLD; }; -void diverboy_state::video_start() -{ -} - -void diverboy_state::draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ) +void diverboy_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect) { uint16_t *source = m_spriteram; - uint16_t *finish = source + (m_spriteram.bytes() / 2); + uint16_t const *finish = source + (m_spriteram.bytes() / 2); while (source < finish) { - int16_t xpos, ypos, number, colr, bank, flash; - - ypos = source[4]; - xpos = source[0]; - colr = (source[1] & 0x00f0) >> 4; - number = source[3]; - flash = source[1] & 0x1000; + int16_t ypos = source[4]; + int16_t const xpos = source[0]; + int16_t colr = (source[1] & 0x00f0) >> 4; + int16_t const number = source[3]; + int16_t const flash = source[1] & 0x1000; colr |= ((source[1] & 0x000c) << 2); ypos = 0x100 - ypos; - bank = (source[1] & 0x0002) >> 1; + int16_t const bank = (source[1] & 0x0002) >> 1; if (!flash || (m_screen->frame_number() & 1)) { - m_gfxdecode->gfx(bank)->transpen(bitmap,cliprect, + m_gfxdecode->gfx(bank)->transpen(bitmap, cliprect, number, colr, - 0,0, - xpos,ypos, + 0, 0, + xpos, ypos, (source[1] & 0x0008) ? -1 : 0); } @@ -140,7 +133,7 @@ void diverboy_state::draw_sprites( bitmap_ind16 &bitmap, const rectangle &clipr } } -uint32_t diverboy_state::screen_update_diverboy(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t diverboy_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { // bitmap.fill(m_palette->black_pen(), cliprect); draw_sprites(bitmap, cliprect); @@ -148,19 +141,10 @@ uint32_t diverboy_state::screen_update_diverboy(screen_device &screen, bitmap_in } -void diverboy_state::soundcmd_w(offs_t offset, uint16_t data, uint16_t mem_mask) -{ - if (ACCESSING_BITS_0_7) - { - m_soundlatch->write(data & 0xff); - m_audiocpu->set_input_line(0, HOLD_LINE); - } -} - void diverboy_state::okibank_w(uint8_t data) { - /* bit 2 might be reset */ -// popmessage("%02x",data); + // bit 2 might be reset +// popmessage("%02x", data); m_oki->set_rom_bank(data & 3); } @@ -171,7 +155,7 @@ void diverboy_state::diverboy_map(address_map &map) map(0x000000, 0x03ffff).rom(); map(0x040000, 0x04ffff).ram(); map(0x080000, 0x083fff).ram().share("spriteram"); - map(0x100000, 0x100001).w(FUNC(diverboy_state::soundcmd_w)); + map(0x100001, 0x100001).w("soundlatch", FUNC(generic_latch_8_device::write)); map(0x140000, 0x1407ff).w(m_palette, FUNC(palette_device::write16)).share("palette"); map(0x180000, 0x180001).portr("P1_P2"); map(0x180002, 0x180003).portr("DSW"); @@ -184,13 +168,32 @@ void diverboy_state::diverboy_map(address_map &map) // map(0x340002, 0x340003).nopw(); } +void diverboy_state::tumblebed_map(address_map &map) +{ + map(0x000000, 0x07ffff).rom(); + map(0x080000, 0x083fff).ram().share("spriteram"); + map(0x100001, 0x100001).w("soundlatch", FUNC(generic_latch_8_device::write)); + map(0x120000, 0x123fff).ram(); + map(0x140000, 0x1407ff).w(m_palette, FUNC(palette_device::write16)).share("palette"); + map(0x1a0000, 0x1a07ff).ram(); + map(0x180000, 0x180001).portr("P1_P2"); + map(0x180002, 0x180003).portr("DSW"); + map(0x180008, 0x180009).portr("COINS"); +// map(0x18000a, 0x18000b).nopr(); +// map(0x18000c, 0x18000d).nopw(); + map(0x320000, 0x3207ff).nopw(); /* ?? */ + map(0x322000, 0x3227ff).nopw(); /* ?? */ +// map(0x340000, 0x340001).nopw(); +// map(0x340002, 0x340003).nopw(); +} + void diverboy_state::snd_map(address_map &map) { map(0x0000, 0x7fff).rom(); map(0x8000, 0x87ff).ram(); map(0x9000, 0x9000).w(FUNC(diverboy_state::okibank_w)); map(0x9800, 0x9800).rw(m_oki, FUNC(okim6295_device::read), FUNC(okim6295_device::write)); - map(0xa000, 0xa000).r(m_soundlatch, FUNC(generic_latch_8_device::read)); + map(0xa000, 0xa000).r("soundlatch", FUNC(generic_latch_8_device::read)); } @@ -258,13 +261,9 @@ static GFXDECODE_START( gfx_diverboy ) GFXDECODE_END -void diverboy_state::machine_start() -{ -} - void diverboy_state::diverboy(machine_config &config) { - M68000(config, m_maincpu, 12000000); /* guess */ + M68000(config, m_maincpu, 12000000); // guess m_maincpu->set_addrmap(AS_PROGRAM, &diverboy_state::diverboy_map); m_maincpu->set_vblank_int("screen", FUNC(diverboy_state::irq6_line_hold)); @@ -279,7 +278,7 @@ void diverboy_state::diverboy(machine_config &config) m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(0)); m_screen->set_size(64*8, 32*8); m_screen->set_visarea(0*8+4, 40*8+1, 2*8, 32*8-1); - m_screen->set_screen_update(FUNC(diverboy_state::screen_update_diverboy)); + m_screen->set_screen_update(FUNC(diverboy_state::screen_update)); m_screen->set_palette(m_palette); PALETTE(config, m_palette).set_format(palette_device::xBGR_444, 0x400); @@ -287,14 +286,21 @@ void diverboy_state::diverboy(machine_config &config) SPEAKER(config, "mono").front_center(); - GENERIC_LATCH_8(config, m_soundlatch); + GENERIC_LATCH_8(config, "soundlatch").data_pending_callback().set_inputline(m_audiocpu, 0); OKIM6295(config, m_oki, 1320000, okim6295_device::PIN7_HIGH).add_route(ALL_OUTPUTS, "mono", 0.50); // clock frequency & pin 7 not verified } +void diverboy_state::tumblebed(machine_config &config) +{ + diverboy(config); + + m_maincpu->set_addrmap(AS_PROGRAM, &diverboy_state::tumblebed_map); +} + /* -both program roms contain the following string (at the same location) +both program ROMs contain the following string (at the same location) This Game is programmed by the freelance group GAMART. ADRESS: C\SAnt Ramon,11 08130-STA PERPETUA DE MOGODA - BARCELONA (SPAIN) @@ -304,36 +310,69 @@ Fax (93) 574 18 34 */ ROM_START( diverboy ) - ROM_REGION( 0x40000, "maincpu", 0 ) /* 68000 Code */ + ROM_REGION( 0x40000, "maincpu", 0 ) // 68000 Code ROM_LOAD16_BYTE( "db_01.bin", 0x00000, 0x20000, CRC(6aa11366) SHA1(714c8a4a64c18632825a734a76a2d1b031106d76) ) ROM_LOAD16_BYTE( "db_02.bin", 0x00001, 0x20000, CRC(45f8a673) SHA1(4eea1374cafacb4a2e0b623fcb802deb5fca1b3a) ) - ROM_REGION( 0x10000, "audiocpu", 0 ) /* z80 */ - ROM_LOAD( "db_05.bin", 0x00000, 0x8000, CRC(ffeb49ec) SHA1(911b13897ff4ace3940bfff4ab88584a93796c24) ) /* this part is empty */ - ROM_CONTINUE( 0x0000, 0x8000 ) /* this part contains the code */ + ROM_REGION( 0x10000, "audiocpu", 0 ) // z80 + ROM_LOAD( "db_05.bin", 0x00000, 0x8000, CRC(ffeb49ec) SHA1(911b13897ff4ace3940bfff4ab88584a93796c24) ) // this part is empty + ROM_CONTINUE( 0x0000, 0x8000 ) // this part contains the code - ROM_REGION( 0x100000, "gfx1", 0 ) /* GFX */ + ROM_REGION( 0x100000, "gfx1", 0 ) ROM_LOAD16_BYTE( "db_08.bin", 0x000000, 0x80000, CRC(7bb96220) SHA1(671b3f218106e594b13ae5f2e680cf2e2cfc5501) ) ROM_LOAD16_BYTE( "db_09.bin", 0x000001, 0x80000, CRC(12b15476) SHA1(400a5b846f70567de137e0b95586dd9cfc27becb) ) - ROM_REGION( 0x180000, "gfx2", 0 ) /* GFX */ + ROM_REGION( 0x180000, "gfx2", 0 ) ROM_LOAD16_BYTE( "db_07.bin", 0x000000, 0x20000, CRC(18485741) SHA1(a8edceaf34a98f2aa2bfada9d6e06fb82639a4e0) ) ROM_LOAD16_BYTE( "db_10.bin", 0x000001, 0x20000, CRC(c381d1cc) SHA1(88b97d8893c500951cfe8e7e7f0b547b36bbe2c0) ) ROM_LOAD16_BYTE( "db_06.bin", 0x040000, 0x20000, CRC(21b4e352) SHA1(a553de67e5dc751ea81ec4739724e0e46e8c5fab) ) ROM_LOAD16_BYTE( "db_11.bin", 0x040001, 0x20000, CRC(41d29c81) SHA1(448fd5c1b16159d03436b8bd71ffe871c8daf7fa) ) - ROM_REGION( 0x100000, "oki", 0 ) /* Sound */ + ROM_REGION( 0x100000, "oki", 0 ) ROM_LOAD( "db_03.bin", 0x00000, 0x20000, CRC(50457505) SHA1(faf1c055ec56d2ed7f5e6993cc04d3317bf1c3cc) ) ROM_CONTINUE( 0x40000, 0x20000 ) ROM_CONTINUE( 0x80000, 0x20000 ) ROM_CONTINUE( 0xc0000, 0x20000 ) - ROM_LOAD( "db_04.bin", 0x20000, 0x20000, CRC(01b81da0) SHA1(914802f3206dc59a720af9d57eb2285bc8ba822b) ) /* same as tumble pop?, is this used? */ + ROM_LOAD( "db_04.bin", 0x20000, 0x20000, CRC(01b81da0) SHA1(914802f3206dc59a720af9d57eb2285bc8ba822b) ) // same as Tumble Pop?, is this used? ROM_RELOAD( 0x60000, 0x20000 ) ROM_RELOAD( 0xa0000, 0x20000 ) ROM_RELOAD( 0xe0000, 0x20000 ) ROM_END +ROM_START( tumblebed ) + ROM_REGION( 0x80000, "maincpu", 0 ) + ROM_LOAD16_BYTE ("3.ep1", 0x00000, 0x20000, CRC(8b6950ec) SHA1(b55a84df208822084304109bf85a17ccee210e25) ) + ROM_LOAD16_BYTE( "4.ep0", 0x00001, 0x20000, CRC(8199c74d) SHA1(7436a4bebc85ff5e47eae93353ab8fcb98c2fd30) ) + ROM_LOAD16_BYTE ("2.ep3", 0x40000, 0x20000, CRC(cb27d9ca) SHA1(d105e6397efa4d5d31faad7d7e574f21d3bc14b5) ) + ROM_LOAD16_BYTE( "5.ep2", 0x40001, 0x20000, CRC(3a9ad326) SHA1(7d2078e8e98fa4ae6d251ff100792b36c0506e86) ) + + ROM_REGION( 0x8000, "audiocpu", 0 ) + ROM_LOAD( "1.u4", 0x0000, 0x8000, CRC(ffeb49ec) SHA1(911b13897ff4ace3940bfff4ab88584a93796c24) ) // 011xxxxxxxxxxxxx = 0xFF + ROM_CONTINUE( 0x0000, 0x8000 ) + + ROM_REGION( 0x100000, "gfx1", 0 ) + ROM_LOAD16_BYTE( "10.u33", 0x00000, 0x80000, CRC(631b8d08) SHA1(4cb9b314209d863361d04683a881c92614640344) ) + ROM_LOAD16_BYTE( "11.u34", 0x00001, 0x80000, CRC(b686cf86) SHA1(9fe83abc5bd687056d814bce36d93564fb99256f) ) + + ROM_REGION( 0x180000, "gfx2", 0 ) + ROM_LOAD16_BYTE( "9.u35", 0x00000, 0x20000, CRC(d3227e05) SHA1(2d11b5feae84545c3d3e48c55f7d9f4feac7a481) ) + ROM_LOAD16_BYTE( "12.u36", 0x00001, 0x20000, CRC(0c468815) SHA1(9cc086e252851c6e461a85549019fb3113912ce0) ) + ROM_LOAD16_BYTE( "8.u37", 0x40000, 0x20000, CRC(9a7f7866) SHA1(0f275d6f5696b064fbee1ce93bf7623d9d3d3738) ) + ROM_LOAD16_BYTE( "13.u38", 0x40001, 0x20000, CRC(effa3b5d) SHA1(e33b221f77f05ac7808d4b056f7a46efa4957837) ) + + ROM_REGION( 0x100000, "oki", 0 ) + ROM_LOAD( "7.u11", 0x00000, 0x20000, CRC(50457505) SHA1(faf1c055ec56d2ed7f5e6993cc04d3317bf1c3cc) ) + ROM_CONTINUE( 0x40000, 0x20000 ) + ROM_CONTINUE( 0x80000, 0x20000 ) + ROM_CONTINUE( 0xc0000, 0x20000 ) + ROM_LOAD( "6.u22", 0x20000, 0x20000, CRC(01b81da0) SHA1(914802f3206dc59a720af9d57eb2285bc8ba822b) ) + ROM_RELOAD( 0x60000, 0x20000 ) + ROM_RELOAD( 0xa0000, 0x20000 ) + ROM_RELOAD( 0xe0000, 0x20000 ) +ROM_END + } // anonymous namespace -GAME( 1992, diverboy, 0, diverboy, diverboy, diverboy_state, empty_init, ORIENTATION_FLIP_X, "Gamart (Electronic Devices Italy license)", "Diver Boy", MACHINE_SUPPORTS_SAVE ) +GAME( 1992, diverboy, 0, diverboy, diverboy, diverboy_state, empty_init, ORIENTATION_FLIP_X, "Gamart (Electronic Devices Italy license)", "Diver Boy", MACHINE_SUPPORTS_SAVE ) +GAME( 1991, tumblebed, tumblep, tumblebed, diverboy, diverboy_state, empty_init, ORIENTATION_FLIP_X, "bootleg (Electronic Devices)", "Tumble Pop (Electronic Devices bootleg)", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/fidelity/elite.cpp b/src/mame/fidelity/elite.cpp index 6c57bca896af3..e9a40adf9d1e2 100644 --- a/src/mame/fidelity/elite.cpp +++ b/src/mame/fidelity/elite.cpp @@ -9,6 +9,15 @@ see eag68k.cpp for 68000-based EAG hardware NOTE: To start a new game in EAS/PC, press Game Control (aka Reset), activate the D6 square, and then press CL. See below for more info. +TODO: +- Chess Encyclopedia modules don't work properly on fpres. Prestige doesn't + have nvram, it has a load/play switch for swapping modules without having to + turn off the chesscomputer. This won't work on MAME, since it forces a hard + reset when inserting a new ROM cartridge. +- Likewise, these modules don't work properly on feasx. It doesn't correctly + announce when a new module needs to be inserted. Probably unsupported and + therefore BTANB? + BTANB: - feasglab locks up at boot if it was powered off in the middle of the game. To resolve this, hold the Game Control button while booting to clear nvram. @@ -75,6 +84,14 @@ separate from a (ledless) magnetic chessboard. The EAS conversion has unmodified ROMs, most commonly seen with the feasgla romset. In MAME, it's available as an alternate view (see video options). The EAG conversion is a cloneset of feag. +PC/EAS/EAG are the only Fidelity chesscomputers that officially support the EOA-EOE +Chess Encyclopedia modules. When it's time to swap modules to a different volume, +the 7seg display will announce it like "GS 0C", where the last digit indicates +which module to insert (in this case: Volume C). On EAS/EAG, the user is supposed +to turn off the chesscomputer before inserting a new module (a hard reset on MAME +is sufficient). On Prestige, modules need to be swapped on the fly. For the 1st +version of Prestige, it only works on level A3 or higher. + *******************************************************************************/ #include "emu.h" diff --git a/src/mame/fidelity/sc9.cpp b/src/mame/fidelity/sc9.cpp index eeae27faa0fd7..f949e769e91a9 100644 --- a/src/mame/fidelity/sc9.cpp +++ b/src/mame/fidelity/sc9.cpp @@ -23,24 +23,25 @@ suggest 3 versions of SC9(C01) total: 1.5MHz, 1.6MHz, and 1.9MHz. I/O is via TTL, not further documented here -3 versions were available, the newest "B" version was 2MHz and included the Budapest program. -The Playmatic S was only released in Germany, it's basically a 'deluxe' version of SC9 -with magnet sensors and came with CB9 and CB16. +3 versions were available, the newest "B" version was 2MHz and included the Budapest +program. The Playmatic S was only released in Germany, it's basically a 'deluxe' +version of SC9 with magnet sensors and came with CB9 and CB16. ================================================================================ -Starting with SC9, Fidelity added a cartridge slot to their chess computers, meant for -extra book opening databases and recorded games. +Starting with SC9, Fidelity added a cartridge slot to their chess computers, meant +for extra book opening databases and recorded games. Known modules (*denotes undumped): -- CB9: Challenger Book Openings 1 -- CB16: Challenger Book Openings 2 +- CB9: Book Openings 1 +- CB16: Book Openings 2 - *CG64: 64 Greatest Games -- *EOA-EOE: Challenger Book Openings: Chess Encyclopedia Volume A-E (5 modules) -- *TDF: Challenger Book Openings: Tarrasch Defense to the Queen's Gambit +- DVC: Sicilan Varation (prototype) +- EOA-EOE: Chess Encyclopedia Volume A-E (5 modules, needs 7seg display) +- *TDF: Tarrasch Defence to the Queen's Gambit -The edge connector has D0-D7, A0-A13, 2 chip select lines, read/write lines, IRQ line. -IRQ and write strobe are unused. Maximum known size is 16KB. +The edge connector has D0-D7, A0-A13, 2 chip select lines, read/write lines, IRQ +line. IRQ and write strobe are unused. Maximum known size is 16KB. *******************************************************************************/ diff --git a/src/mame/fujitsu/secoinsa20.cpp b/src/mame/fujitsu/secoinsa20.cpp new file mode 100644 index 0000000000000..d858efb5845d7 --- /dev/null +++ b/src/mame/fujitsu/secoinsa20.cpp @@ -0,0 +1,626 @@ +// license:BSD-3-Clause +// copyright-holders: + +/*********************************************************************************************************************************** + +Skeleton driver for Secoinsa Serie 20 minicomputer. + +Secoinsa (Sociedad Española de Comunicaciones e Informática, S.A.) was a company founded in 1975 by Fujitsu, the Spanish +National Institute for Industry (Instituto Nacional de Industria, INI), Telefónica, and other investors (mainly banks). +It primarily manufactured and sold FACOM clones for the Spanish market. + +In 1986, the company was split and sold. Telefónica acquired the professional services division, while Fujitsu España +took the hardware and software areas. + +Key features for Secoinsa Serie 20: + -CPU: Z80B. + -RAM: 80 Kbytes, expandable to 272 Kbytes. + -Peripherals: Terminal interface, RS-232 serial port for printer, two sync/async communication channels. + -Screen: Green phosphor with 24 lines of 80 characters, with an option for NSP terminal with 12/25 lines of 69/80/132 characters. + -Keyboard: QWERTY, 102 keys. + -Mass storage: One or two 8" floppy disk drives of 640 Kbytes or 1.2 Mbytes. Winchester hard drives of 10 or 20 Mbytes. + -Operating System: OASIS. + -Programming languages: BASIC (interpreter and compiler), Spanish EXEC. + +The dumped Secoinsa Serie 20 was found with the following PCBs: + +PCB SECOINSA SM16B-0200-0170 + _______________________________________________________________ + | __________ __________ __________ __________ | + | |SN74LS30N| |SN74LS112AN |_PAL_3U__| :: |SN74LS125AN | + | __________ __________ __________ :: __________ | + | |SN74LS240N |SN74LS74AN |SN74LS125AN :: |MC 1489AL| _|_ + | __________ | | + | __________ __________ |_SN7417N_| :: __________ | | + __| |SN74LS374N |SN74LS112AN __________ :: |MC 1489AL| | | + |__ |_SN7416N_| :: | | + |__ __________ __________ __________ __________ | | + |__ ·· |SN74LS374N |_74F138__| |SN74LS74AN :: |SN75188J_| | | + |__ ·· __________ __________ __________ :: __________ | | + |__ ·· |SN74LS374N |_74F138__| |SN74LS08N| :: |_DS3486N_| | | + |__ ·· __________ __________ __________ __________ | | + |__ ·· |SN74LS374N |_PAL_2P__| |SN74LS74AN ·· : |SN75188J_| | | + |__ ·········· : | | + |__ __________ ____________________ __________ | | + |__ |SN74LS240N | AMD Z8530PC | |MC_1489AL| |___| + |__ |___________________| __________ | + |__ __________ ·· :::::::::: |_MC3487L_| | + |__ |SN74LS244N ____________________ __________ | + |__ | AMD P8237A-5 | |SN74LS112AN | + |__ __________ |___________________| __________ | + |__ |SN74LS244N :::::::::: |SN74LS112AN | + |__ ____________________ __________ | + |__ __________ | AMD P8237A-5 | |_DS3486N_| | + |__ |SN74LS245N |___________________| __________ | + |__ :::..::::: |MC_1489AL| | + |__ __________ ____________________ __________ _|_ + |__ |SN74LS373N | AMD Z8530PC | |_MC3487L_| | | + |__ __________ |___________________| __________ | | + |__ |SN74LS245N : |MC 1489AL| | | + |__ __________ __________ __________ : __________ | | + |__ |SN74LS244N SM25LS2521PC |SN74LS74AN : |SN75188J_| | | + |__ __________ __________ __________ :: __________ | | + |__ |SN74LS74AN |SN74LS112AN |SN74LS112AN : |_MC3486P_| | | + | __________ __________ __________ : __________ | | + | |_PAL_1D__| ..|SN74LS74AN |SN74LS09N| |SN75188J_| | | + | __________ .. __________ .. | | + | |_PAL_1C__| ..|SN74LS74AN : __________ .. __________ | | + | __________ .. __________ |_SN7416N_| .. |MC_1489AL| | | + | |_PAL_1B__| ..|SN74LS08N| |___| + | __________ __________ __________ __________ | + | |_SN7417N_| |SN74LS125AN |_SN7417N_| |MC_1489AL| | + | __________ __________ __________ __________ | + | |SN74LS165N |SN74LS165N |SN74LS74AN |MC14040BCP | + |______________________________________________________________| + + + +PCB SECOINSA SM16B-0200-0140: + -Floppy controller with FDC9229BT, NEC D765AC. + -Serial communications with Z8530DC, Signetics 2651. + -RTC with MM58167AN. + _______________________________________________________________ + | __________ __________ __________ __________ | + |__ |SN74LS165AN |MC14538BCP |SN74LS74AN |_PAL_1A__| | + |__| __________ __________ __________ __________ | + |__|| DIPS x 8| .. |SN74LS139AN |SN74LS74AN |_DM7416N_| | + | __________ ·· __________ __________ __________ | + |__ |_DM7416N_| ·· |_SN7417N_| |SN74LS74AN : AM25LS252IPC | + |__| ________________________ | + |__|| NEC D765AC | __________ __________ |___ + |__|| | |SN74LS04N| |DM74LS244N __| + |__||_______________________| __| + |__| __________ __________ __________ __________ __| + |__||DM74LS244N |SN74LS139AN |SN74LS240N |SN74LS245N __| + |__| .. : __| + |__| __________ __________ __________ __| + |__||SN74LS240N :::::: |SN74LS245N |SN74LS46INS __| + |__| __________ __________ __________ __________ __| + | |_SN7417N_| |FDC9229BT| |_PAL_2G__| |SN74LS46INS __| + |__ ________________ __________ __________ __| + |__||S 8212 2651 N | |74SC374P_| |_PAL_1H__| __| + |__||_______________| __________ __________ __| + |__| ________________________ |_SN7417N_| |DM74LS244N __| + |__||AMD Z8530DC | __________ __________ __| + |__|| | |SN74LS240N |_PAL_1K__| __| + |__||_______________________| __________ __| + |__| __________ __________ __________ |SN74LS46INS __| + |__||SN75189AJ| | DIPS x 8| |SN74LS148N ::::::::: __| + |__| __________ .. __________ __________ ___________ __| + |__||_SN7417N_| ·· |_DM7416N_| |_PAL_2M__| | P8254 | __| + | __________ .. __________ __________ |__________| __| + |__ |_DM7416N_| .. |SN74LS74AN |SN74LS125AN __________ __| + |__| .. Xtal Xtal |_PAL_1N__| | + |__| 16 MHz 4.9152 MHz ___________ | + | __________ __________ __________ |MM58167AN | | + | |SN74LS74AN |SN74LS74AN |SN74LS374N |__________| | + | __________ __________ __________ | + | |SN74S74N_| |SN74LS165AN |SN75188J_| | + |______________________________________________________________| + + + +CPU PCB + _______________________________________________________________ + | ___ __________ _________ | + | | | |SN74LS74AN |74LS08N_| | + | |EMPTY __________ __________ | + | |__| |_74LS04N_| |SN74LS373N | + | | + | __________ ______________________ __________ | + | |SN74LS21N| | ZILOG Z8400B PS | |SN74LS373N | + | | Z80B CPU | | + | __________ |_____________________| __________ | + | |DIPS x8 | |DM81LS95N| |___ + | __________ __________ __________ __________ __| + | |SN74LS00N| |SN74LS373N |_74LS04N_| |SN74LS244N __| + | __________ _____________ __________ __________ __| + | |SL74LS11N| | EPROM | |DIPS x 8 | |SN74LS244N __| + | __________ |____________| __________ __________ __| + | |SN74LS74AN _____________ |DM74LS266N |SN74LS244N __| + | __________ | EMPTY | __________ __________ __| + | |SN74LS165AN |____________| |_PAL_2H__| |SN74244N_| __| + | __________ __________ __________ __________ __| + | |SN74LS00N| |_74LS04N_| |_74LS02N_| Xtal |_74LS08N_| __| + | __________ __________ __________ 4MHz __________ __| + _|_ |SN74LS10N| |_74LS02N_| |_74LS04N_| |SN74LS367AN __| + | | __________ __________ __________ __________ __| + | ||DM74LS161AN |_74LS04N_| |SN74LS125AN |SN74LS367AN __| + | | __________ __________ __________ __________ __| + | ||74LS157N_| |_74LS33N_| |SN74LS273N |SN74LS244N __| + | | __________ __________ __________ __________ __| + | ||74LS74AN_| |SN74LS10N| |SN74LS273N |_74LS32N_| __| + | | __________ __________ __________ __________ __| + | ||_74LS04N_| |DM74LS245N |SN74LS148N |_74LS32N_| __| + |___| __________ | + | Xtal |SN74LS244N | + | 20 MHz | + |______________________________________________________________| + + + +PCB SECOINSA SM16B-0200-0010 + _______________________________________________________________ + | __________ | + | __________ SN74LS165AN | + | |SN74LS157N __________ | + | __________ |SN74LS04N| | + | ·· |SN74LS393N __________ | + _|_ ·· __________ |SN74LS32N| | + | | |SN74LS393N __________ | + | | __________ |SN74LS74N| | + | | |74LS138N_| __________ | + | | |LS74LS74AN |___ + | | __________ __________ __| + | | |DM74LS374N |SN74LS240N __| + | | __________ __________ __| + |___| |SN74LS245N |SN74LS240N __| + | __________ __| + | AM25LS2521PC __| + | __________ __________ __| + | |SN74LS74AN |SN74LS273N __| + | __________ __________ __| + | |SN74LS155N |SN74LS244N __| + | ·· __________ __________ __| + | _____________ ··· |PAL16L8 2K AM25LS2521PC __| + | |AM9128-15PC | . __________ __________ .. __| + _|_ |____________| : |PAL16L8 2L |_DIPSx8__| .. __| + | | _____________ __________ __________ .. __| + | | |AM9128-15PC | |PAL16L8 2M AM25LS2521PC .. __| + | | |____________| __________ __________ .. __| + | | __________ |SN74LS273N |_DIPSx8__| .. __| + | | |NS74LS374N __________ __________ __| + | | __________ |SN74LS280N |SN74LS139AN __| + | | |SN74LS245N __________ __________ __| + |___| __________ |SN74LS273N |SN74LS74AN | + | |SN74LS240N ·· | + | __________ __________ ·· __________ | + | |SN74LS393N |SN74LS374N ·· |SN74LS74AN | + | ·· | + | ·· | + |______________________________________________________________| + + +Six RAM PCBs: + +RAM PCB 1 (8 x HM6116P-3) + _______________________________________________________________ + | _______ _______ _______ _______ _______ | + | | | | | | | | | | | ___ ___ | + | | | | | | | | | | | | | | | | + | |HM | |HM | |HM | |EMPTY | |EMPTY | | <-74LS138N| + | |6116P | |6116P | |6116P | | | | | | | | <-74LS138N + | |3 | |3 | |3 | | | | | | | | | | + | |______| |______| |______| |______| |______| |__| |__| | + | _______ _______ _______ _______ _______ | + | | | | | | | | | | | | + | | | | | | | | | | | _________ |___ + | |HM | |HM | |HM | |EMPTY | |EMPTY | |SN74LS10N __| + | |6116P | |6116P | |6116P | | | | | __| + | |3 | |3 | |3 | | | | | __________ __| + | |______| |______| |______| |______| |______| |SN74LS244N __| + | _______ _______ _______ _______ _______ __| + | | | | | | | | | | | __________ __| + | | | | | | | | | | | |SN74LS244N __| + | |HM | |HM | |EMPTY | |EMPTY | |EMPTY | __| + | |6116P | |6116P | | | | | | | __________ __| + | |3 | |3 | | | | | | | |SN74LS244N __| + | |______| |______| |______| |______| |______| __| + | _______ _______ _______ _______ _______ __________ __| + | | | | | | | | | | | |SN74LS244N __| + | | | | | | | | | | | __| + | |EMPTY | |EMPTY | |EMPTY | |EMPTY | |EMPTY | _________ __| + | | | | | | | | | | | |74LS138N| __| + | | | | | | | | | | | __| + | |______| |______| |______| |______| |______| _________ __| + | _______ _______ _______ _______ _______ |SN74LS08N __| + | | | | | | | | | | | ::: __| + | | | | | | | | | | | __________ __| + | |EMPTY | |EMPTY | |EMPTY | |EMPTY | |EMPTY | AM25LS252IPC __| + | | | | | | | | | | | __| + | | | | | | | | | | | _________ __| + | |______| |______| |______| |______| |______| SN74ALS133N __| + | _______ _______ _______ _______ _______ __| + | | | | | | | | | | | __| + | | | | | | | | | | | __________ __| + | |EMPTY | |EMPTY | |EMPTY | |EMPTY | |EMPTY | |DIPS x 8 | __| + | | | | | | | | | | | __| + | | | | | | | | | | | | + | |______| |______| |______| |______| |______| ___ ___ | + | _______ _______ | | | | | + | | | | | | <-74LS138N| + | | | | | | | | <-74LS138N + | |EMPTY | |EMPTY | | | | | | + | | | | | |__| |__| | + | | | | | | + | |______| |______| | + |______________________________________________________________| + +RAM PCB 2 (24 x HM6116P-3) + _______________________________________________________________ + | _______ _______ _______ _______ _______ | + | | | | | | | | | | | ___ ___ | + | | | | | | | | | | | | | | | | + | |HM | |HM | |HM | |EMPTY | |EMPTY | | <-74LS138N| + | |6116P | |6116P | |6116P | | | | | | | | <-74LS138N + | |3 | |3 | |3 | | | | | | | | | | + | |______| |______| |______| |______| |______| |__| |__| | + | _______ _______ _______ _______ _______ | + | | | | | | | | | | | | + | | | | | | | | | | | _________ |___ + | |HM | |HM | |HM | |EMPTY | |EMPTY | |SN74LS10N __| + | |6116P | |6116P | |6116P | | | | | __| + | |3 | |3 | |3 | | | | | __________ __| + | |______| |______| |______| |______| |______| |SN74LS244N __| + | _______ _______ _______ _______ _______ __| + | | | | | | | | | | | __________ __| + | | | | | | | | | | | |SN74LS244N __| + | |HM | |HM | |EMPTY | |EMPTY | |EMPTY | __| + | |6116P | |6116P | | | | | | | __________ __| + | |3 | |3 | | | | | | | |SN74LS244N __| + | |______| |______| |______| |______| |______| __| + | _______ _______ _______ _______ _______ __________ __| + | | | | | | | | | | | |SN74LS244N __| + | | | | | | | | | | | __| + | |HM | |HM | |HM | |HM | |EMPTY | _________ __| + | |6116P | |6116P | |6116P | |6116P | | | |74LS138N| __| + | |3 | |3 | |3 | |3 | | | __| + | |______| |______| |______| |______| |______| _________ __| + | _______ _______ _______ _______ _______ |SN74LS08N __| + | | | | | | | | | | | ::: __| + | | | | | | | | | | | __________ __| + | |HM | |HM | |HM | |HM | |HM | AM25LS252IPC __| + | |6116P | |6116P | |6116P | |6116P | |6116P | __| + | |3 | |3 | |3 | |3 | |3 | _________ __| + | |______| |______| |______| |______| |______| SN74ALS133N __| + | _______ _______ _______ _______ _______ __| + | | | | | | | | | | | __| + | | | | | | | | | | | __________ __| + | |HM | |HM | |HM | |HM | |HM | |DIPS x 8 | __| + | |6116P | |6116P | |6116P | |6116P | |6116P | __| + | |3 | |3 | |3 | |3 | |3 | | + | |______| |______| |______| |______| |______| ___ ___ | + | _______ _______ | | | | | + | | | | | | <-74LS138N| + | | | | | | | | <-74LS138N + | |HM | |HM | | | | | | + | |6116P | |6116P | |__| |__| | + | |3 | |3 | | + | |______| |______| | + |______________________________________________________________| + +RAM PCB 3 (24 x HM6116P-3) + _______________________________________________________________ + | _______ _______ _______ _______ _______ | + | | | | | | | | | | | ___ ___ | + | | | | | | | | | | | | | | | | + | |HM | |HM | |HM | |EMPTY | |EMPTY | | <-74LS138N| + | |6116P | |6116P | |6116P | | | | | | | | <-74LS138N + | |3 | |3 | |3 | | | | | | | | | | + | |______| |______| |______| |______| |______| |__| |__| | + | _______ _______ _______ _______ _______ | + | | | | | | | | | | | | + | | | | | | | | | | | _________ |___ + | |HM | |HM | |HM | |EMPTY | |EMPTY | |SN74LS10N __| + | |6116P | |6116P | |6116P | | | | | __| + | |3 | |3 | |3 | | | | | __________ __| + | |______| |______| |______| |______| |______| |SN74LS244N __| + | _______ _______ _______ _______ _______ __| + | | | | | | | | | | | __________ __| + | | | | | | | | | | | |SN74LS244N __| + | |HM | |HM | |EMPTY | |EMPTY | |EMPTY | __| + | |6116P | |6116P | | | | | | | __________ __| + | |3 | |3 | | | | | | | |SN74LS244N __| + | |______| |______| |______| |______| |______| __| + | _______ _______ _______ _______ _______ __________ __| + | | | | | | | | | | | |SN74LS244N __| + | | | | | | | | | | | __| + | |HM | |HM | |HM | |HM | |EMPTY | _________ __| + | |6116P | |6116P | |6116P | |6116P | | | |74LS138N| __| + | |3 | |3 | |3 | |3 | | | __| + | |______| |______| |______| |______| |______| _________ __| + | _______ _______ _______ _______ _______ |SN74LS08N __| + | | | | | | | | | | | ::: __| + | | | | | | | | | | | __________ __| + | |HM | |HM | |HM | |HM | |HM | AM25LS252IPC __| + | |6116P | |6116P | |6116P | |6116P | |6116P | __| + | |3 | |3 | |3 | |3 | |3 | _________ __| + | |______| |______| |______| |______| |______| SN74ALS133N __| + | _______ _______ _______ _______ _______ __| + | | | | | | | | | | | __| + | | | | | | | | | | | __________ __| + | |HM | |HM | |HM | |HM | |HM | |DIPS x 8 | __| + | |6116P | |6116P | |6116P | |6116P | |6116P | __| + | |3 | |3 | |3 | |3 | |3 | | + | |______| |______| |______| |______| |______| ___ ___ | + | _______ _______ | | | | | + | | | | | | <-74LS138N| + | | | | | | | | <-74LS138N + | |HM | |HM | | | | | | + | |6116P | |6116P | |__| |__| | + | |3 | |3 | | + | |______| |______| | + |______________________________________________________________| + +RAM PCB 4 (24 x HM6116P-3) + _______________________________________________________________ + | _______ _______ _______ _______ _______ | + | | | | | | | | | | | ___ ___ | + | | | | | | | | | | | | | | | | + | |HM | |HM | |HM | |EMPTY | |EMPTY | | <-74LS138N| + | |6116P | |6116P | |6116P | | | | | | | | <-74LS138N + | |3 | |3 | |3 | | | | | | | | | | + | |______| |______| |______| |______| |______| |__| |__| | + | _______ _______ _______ _______ _______ | + | | | | | | | | | | | | + | | | | | | | | | | | _________ |___ + | |HM | |HM | |HM | |EMPTY | |EMPTY | |SN74LS10N __| + | |6116P | |6116P | |6116P | | | | | __| + | |3 | |3 | |3 | | | | | __________ __| + | |______| |______| |______| |______| |______| |SN74LS244N __| + | _______ _______ _______ _______ _______ __| + | | | | | | | | | | | __________ __| + | | | | | | | | | | | |SN74LS244N __| + | |HM | |HM | |EMPTY | |EMPTY | |EMPTY | __| + | |6116P | |6116P | | | | | | | __________ __| + | |3 | |3 | | | | | | | |SN74LS244N __| + | |______| |______| |______| |______| |______| __| + | _______ _______ _______ _______ _______ __________ __| + | | | | | | | | | | | |SN74LS244N __| + | | | | | | | | | | | __| + | |HM | |HM | |HM | |HM | |EMPTY | _________ __| + | |6116P | |6116P | |6116P | |6116P | | | |74LS138N| __| + | |3 | |3 | |3 | |3 | | | __| + | |______| |______| |______| |______| |______| _________ __| + | _______ _______ _______ _______ _______ |SN74LS08N __| + | | | | | | | | | | | ::: __| + | | | | | | | | | | | __________ __| + | |HM | |HM | |HM | |HM | |HM | AM25LS252IPC __| + | |6116P | |6116P | |6116P | |6116P | |6116P | __| + | |3 | |3 | |3 | |3 | |3 | _________ __| + | |______| |______| |______| |______| |______| SN74ALS133N __| + | _______ _______ _______ _______ _______ __| + | | | | | | | | | | | __| + | | | | | | | | | | | __________ __| + | |HM | |HM | |HM | |HM | |HM | |DIPS x 8 | __| + | |6116P | |6116P | |6116P | |6116P | |6116P | __| + | |3 | |3 | |3 | |3 | |3 | | + | |______| |______| |______| |______| |______| ___ ___ | + | _______ _______ | | | | | + | | | | | | <-74LS138N| + | | | | | | | | <-74LS138N + | |HM | |HM | | | | | | + | |6116P | |6116P | |__| |__| | + | |3 | |3 | | + | |______| |______| | + |______________________________________________________________| + +RAM PCB 5 (32 x HM6116P-3) + _______________________________________________________________ + | _______ _______ _______ _______ _______ | + | | | | | | | | | | | ___ ___ | + | | | | | | | | | | | | | | | | + | |HM | |HM | |HM | |HM | |HM | | <-74LS138N| + | |6116P | |6116P | |6116P | |6116P | |6116P | | | | <-74LS138N + | |3 | |3 | |3 | |3 | |3 | | | | | | + | |______| |______| |______| |______| |______| |__| |__| | + | _______ _______ _______ _______ _______ | + | | | | | | | | | | | | + | | | | | | | | | | | _________ |___ + | |HM | |HM | |HM | |HM | |HM | |SN74LS10N __| + | |6116P | |6116P | |6116P | |6116P | |6116P | __| + | |3 | |3 | |3 | |3 | |3 | __________ __| + | |______| |______| |______| |______| |______| |SN74LS244N __| + | _______ _______ _______ _______ _______ __| + | | | | | | | | | | | __________ __| + | | | | | | | | | | | |SN74LS244N __| + | |HM | |HM | |EMPTY | |EMPTY | |EMPTY | __| + | |6116P | |6116P | |6116P | |6116P | |6116P | __________ __| + | |3 | |3 | |3 | |3 | |3 | |SN74LS244N __| + | |______| |______| |______| |______| |______| __| + | _______ _______ _______ _______ _______ __________ __| + | | | | | | | | | | | |SN74LS244N __| + | | | | | | | | | | | __| + | |HM | |HM | |HM | |HM | |EMPTY | _________ __| + | |6116P | |6116P | |6116P | |6116P | |6116P | |74LS138N| __| + | |3 | |3 | |3 | |3 | |3 | __| + | |______| |______| |______| |______| |______| _________ __| + | _______ _______ _______ _______ _______ |SN74LS08N __| + | | | | | | | | | | | ::: __| + | | | | | | | | | | | __________ __| + | |HM | |HM | |HM | |HM | |HM | AM25LS252IPC __| + | |6116P | |6116P | |6116P | |6116P | |6116P | __| + | |3 | |3 | |3 | |3 | |3 | _________ __| + | |______| |______| |______| |______| |______| SN74ALS133N __| + | _______ _______ _______ _______ _______ __| + | | | | | | | | | | | __| + | | | | | | | | | | | __________ __| + | |HM | |HM | |HM | |HM | |HM | |DIPS x 8 | __| + | |6116P | |6116P | |6116P | |6116P | |6116P | __| + | |3 | |3 | |3 | |3 | |3 | | + | |______| |______| |______| |______| |______| ___ ___ | + | _______ _______ | | | | | + | | | | | | <-74LS138N| + | | | | | | | | <-74LS138N + | |HM | |HM | | | | | | + | |6116P | |6116P | |__| |__| | + | |3 | |3 | | + | |______| |______| | + |______________________________________________________________| + +RAM PCB 5 (24 x HM6116P-3) + _______________________________________________________________ + | _______ _______ _______ _______ _______ | + | | | | | | | | | | | ___ ___ | + | | | | | | | | | | | | | | | | + | |HM | |HM | |HM | |EMPTY | |EMPTY | | <-74LS138N| + | |6116P | |6116P | |6116P | | | | | | | | <-74LS138N + | |3 | |3 | |3 | | | | | | | | | | + | |______| |______| |______| |______| |______| |__| |__| | + | _______ _______ _______ _______ _______ | + | | | | | | | | | | | | + | | | | | | | | | | | _________ |___ + | |HM | |HM | |HM | |EMPTY | |EMPTY | |SN74LS10N __| + | |6116P | |6116P | |6116P | | | | | __| + | |3 | |3 | |3 | | | | | __________ __| + | |______| |______| |______| |______| |______| |SN74LS244N __| + | _______ _______ _______ _______ _______ __| + | | | | | | | | | | | __________ __| + | | | | | | | | | | | |SN74LS244N __| + | |HM | |HM | |EMPTY | |EMPTY | |EMPTY | __| + | |6116P | |6116P | | | | | | | __________ __| + | |3 | |3 | | | | | | | |SN74LS244N __| + | |______| |______| |______| |______| |______| __| + | _______ _______ _______ _______ _______ __________ __| + | | | | | | | | | | | |SN74LS244N __| + | | | | | | | | | | | __| + | |HM | |HM | |HM | |HM | |EMPTY | _________ __| + | |6116P | |6116P | |6116P | |6116P | | | |74LS138N| __| + | |3 | |3 | |3 | |3 | | | __| + | |______| |______| |______| |______| |______| _________ __| + | _______ _______ _______ _______ _______ |SN74LS08N __| + | | | | | | | | | | | ::: __| + | | | | | | | | | | | __________ __| + | |HM | |HM | |HM | |HM | |HM | AM25LS252IPC __| + | |6116P | |6116P | |6116P | |6116P | |6116P | __| + | |3 | |3 | |3 | |3 | |3 | _________ __| + | |______| |______| |______| |______| |______| SN74ALS133N __| + | _______ _______ _______ _______ _______ __| + | | | | | | | | | | | __| + | | | | | | | | | | | __________ __| + | |HM | |HM | |HM | |HM | |HM | |DIPS x 8 | __| + | |6116P | |6116P | |6116P | |6116P | |6116P | __| + | |3 | |3 | |3 | |3 | |3 | | + | |______| |______| |______| |______| |______| ___ ___ | + | _______ _______ | | | | | + | | | | | | <-74LS138N| + | | | | | | | | <-74LS138N + | |HM | |HM | | | | | | + | |6116P | |6116P | |__| |__| | + | |3 | |3 | | + | |______| |______| | + |______________________________________________________________| + + +WESTERN DIGITAL MFM HDD CONTROLLER WD 100,1-05 + + _____________________________________ __________________________ ___________________ + | _____________ |__| |__| | + | ·· |N8T31N 8324 | __________ __________ __________ __________________ | + | ·· |____________| |_74LS08N_| |74LS191N_| |TMS2149-5NL | N8X305N 8328 | | + | ·· __________ __________ __________ __________ | | | + |·· ·· |SN74LS244N |74LS191N_| |74LS191N_| |TMS2149-5NL |_________________| | + |·· ·· __________ __________ __________ __________ _____ _____ _____ | + |·· ·· |_74LS32N_| |_74S00PC_| |SN74LS244N |WD1100PE-01 | | | | | <-N82S181N + |·· ·· __________ __________ __________ __________ | <-N82S181N | | | | + |·· ·· |SN74LS14N| |74LS374N_| |WD1100PE-05 |_74S138N_| |____| |__<-N82S181N| | + |·· ·· __________ __________ __________ __________ __________ | + |·· |_74S06PC_| |74LS273PC| |WD11C0PE-12 |_74S138N_| |74LS175PC| Xtal 8 MHz | + |·· __________ _________ __________ __________ __________ __________ __________ | + |·· |_74S06PC_| |74LS259PC |WD1100V-07 |DM74S04N_| |SN74LS137N WD1100PE-03 |SN74S74N_| | + | o _________ __________ __________ __________ __________ __________ | + | o .. .. .. .. |DM74S64N| WD1100PE-09 |DTZM1-60_| |WD11CE-08| |DM74S74N_| |SN74S74N_| | + | o .. .. .. .. _________ __________ __________ __________ __________ | + | o .. .. .. .. |AM26LS32P |AM26S02PC| |_T74LS54_| |SN74S74N_| |SN74S124N| | + | ·· ·· ·· ·· _________ | + | ·· ·· ·· ·· |AM26LS31CN Xtal 20 MHz | + | ___ ___ | + |____________________________________| |_________________________| |__________________| + +***********************************************************************************************************************************/ + +#include "emu.h" +#include "cpu/z80/z80.h" + +namespace { + +class secoinsa20_state : public driver_device +{ +public: + secoinsa20_state(const machine_config &mconfig, device_type type, const char *tag) + : driver_device(mconfig, type, tag) + , m_maincpu(*this, "maincpu") + { } + + void secoinsa20(machine_config &config); + +private: + virtual void machine_start() override ATTR_COLD; + virtual void machine_reset() override ATTR_COLD; + + required_device m_maincpu; +}; + + +// Input ports +static INPUT_PORTS_START( secoinsa20 ) +INPUT_PORTS_END + + +void secoinsa20_state::machine_reset() +{ +} + +void secoinsa20_state::machine_start() +{ +} + +void secoinsa20_state::secoinsa20(machine_config &config) +{ + // basic machine hardware + Z80(config, m_maincpu, XTAL(4'000'000)); +} + + + +ROM_START( secoinsa20 ) + ROM_REGION(0x20000, "maincpu", 0) + ROM_LOAD( "secoinsa_iras_3f_vo2.2_2732a.bin", 0x0000, 0x1000, CRC(50b09416) SHA1(9a799e2e6ebad484226778f41b292a66ebe45849) ) + + ROM_REGION(0x10000, "wd_mfm_controller", 0) + ROM_LOAD( "62-000019-00-a0_n82s181n.u16", 0x0000, 0x0400, CRC(d7819b5d) SHA1(c74dc7cbe05796ec787db482f4ccc92d93df2fa4) ) + ROM_LOAD( "62-000019-01-a0_n82s181n.u15", 0x0400, 0x0400, CRC(bb775759) SHA1(dae3fc65e072c5ebec6c545cef4e58ba0dc44ae7) ) + ROM_LOAD( "62-000019-02-a0_n82s181n.u14", 0x0800, 0x0400, CRC(94f9ed35) SHA1(2a14134849213a733b05b9e216b45909c36bd859) ) + + ROM_REGION(0x00117, "plds", 0) + ROM_LOAD( "asp1_2m_v00.1_pal16l8.2m", 0x0000, 0x0117, BAD_DUMP CRC(c20eae34) SHA1(9a879350be345ea757ba7b6636a9c789932b75b4) ) // On PCB SM16B-0200-0010, bruteforced + ROM_LOAD( "asp2_2l_v00.1_pal16l8.2l", 0x0000, 0x0117, NO_DUMP ) // On PCB SM16B-0200-0010 + ROM_LOAD( "asp_p3_2k_v00.1_pal16l8.2k", 0x0000, 0x0117, BAD_DUMP CRC(4838b218) SHA1(312a2cca2a403776f6d861763258edee17a040b8) ) // On PCB SM16B-0200-0010, bruteforced + ROM_LOAD( "palp1_1d_v00.1_pal16l8.1d", 0x0000, 0x0117, NO_DUMP ) // On PCB SM16B-0200-0170 + ROM_LOAD( "palp2_1c_v00.1_pal16r4.1c", 0x0000, 0x0117, NO_DUMP ) // On PCB SM16B-0200-0170 + ROM_LOAD( "palp3_3u_v00.1_pal16l8.3u", 0x0000, 0x0117, NO_DUMP ) // On PCB SM16B-0200-0170 + ROM_LOAD( "palp4_1b_v00.1_pal16r8.1b", 0x0000, 0x0117, NO_DUMP ) // On PCB SM16B-0200-0170 + ROM_LOAD( "palp5_2p_v00.2_pal16l8.2p", 0x0000, 0x0117, BAD_DUMP CRC(0a8d42ef) SHA1(5f3af633742fd4859458237bc576671be8f5a898) ) // On PCB SM16B-0200-0170, bruteforced + ROM_LOAD( "pcpu_2h_v00.1_pal16l8.2h", 0x0000, 0x0117, NO_DUMP ) // On CPU PCB + ROM_LOAD( "pss1_1h_v00.1_pal16l8.1h", 0x0000, 0x0117, NO_DUMP ) // On PCB SM16B-0200-0140 + ROM_LOAD( "pss2_1k_v00.1_pal16l8.1k", 0x0000, 0x0117, BAD_DUMP CRC(069664b1) SHA1(c5d32b20a3e9985dd1cb23acfe73f1f8be2e270d) ) // On PCB SM16B-0200-0140, bruteforced + ROM_LOAD( "pss3_1a_v00.2_pal16r4.1a", 0x0000, 0x0117, NO_DUMP ) // On PCB SM16B-0200-0140 + ROM_LOAD( "pss4_2g_v00.1_pal16l8.2g", 0x0000, 0x0117, BAD_DUMP CRC(34f23cf6) SHA1(c67f0c1878e1a93787bcd09647162e174218fd6f) ) // On PCB SM16B-0200-0140, bruteforced + ROM_LOAD( "pss5_1n_v00.2_pal16r4.1n", 0x0000, 0x0117, NO_DUMP ) // On PCB SM16B-0200-0140 + ROM_LOAD( "pss6_2m_v00.1_pal16l8.2m", 0x0000, 0x0117, NO_DUMP ) // On PCB SM16B-0200-0140 +ROM_END + +} // Anonymous namespace + +// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS +COMP( 1981, secoinsa20, 0, 0, secoinsa20, secoinsa20, secoinsa20_state, empty_init, "Secoinsa", "Serie 20", MACHINE_NO_SOUND_HW | MACHINE_NOT_WORKING ) diff --git a/src/mame/heathzenith/h8.cpp b/src/mame/heathzenith/h8.cpp index 4b42b7f964c18..f5673e16d64ad 100644 --- a/src/mame/heathzenith/h8.cpp +++ b/src/mame/heathzenith/h8.cpp @@ -57,6 +57,7 @@ Official test program from pages 4 to 8 of the operator's manual: #include "sound/beep.h" #include "speaker.h" +#include "bus/heathzenith/intr_cntrl/intr_cntrl.h" #include "formats/h8_cas.h" #include "h8.lh" @@ -68,6 +69,7 @@ class h8_state : public driver_device h8_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag) , m_maincpu(*this, "maincpu") + , m_intr_socket(*this, "intr_socket") , m_uart(*this, "uart") , m_console(*this, "console") , m_cass(*this, "cassette") @@ -116,6 +118,7 @@ class h8_state : public driver_device static constexpr XTAL H8_IRQ_PULSE = H8_BEEP_FRQ / 2; required_device m_maincpu; + required_device m_intr_socket; required_device m_uart; required_device m_console; required_device m_cass; @@ -142,7 +145,9 @@ DEVICE_INPUT_DEFAULTS_END TIMER_DEVICE_CALLBACK_MEMBER(h8_state::h8_irq_pulse) { if (BIT(m_irq_ctl, 0)) - m_maincpu->set_input_line_and_vector(INPUT_LINE_IRQ0, ASSERT_LINE, 0xcf); // I8080 + { + m_intr_socket->set_irq_level(1, ASSERT_LINE); + } } u8 h8_state::portf0_r() @@ -190,7 +195,8 @@ void h8_state::portf0_w(u8 data) m_mon_led = !BIT(data, 5); m_beep->set_state(!BIT(data, 7)); - m_maincpu->set_input_line(INPUT_LINE_IRQ0, CLEAR_LINE); + m_intr_socket->set_irq_level(1, CLEAR_LINE); + m_irq_ctl &= 0xf0; if (BIT(data, 6)) m_irq_ctl |= 1; if (!BIT(data, 4)) m_irq_ctl |= 2; @@ -260,10 +266,13 @@ INPUT_CHANGED_MEMBER(h8_state::button_0) { u8 data = m_io_keyboard[1]->read() ^ 0xff; if (BIT(data, 5)) + { m_maincpu->reset(); - else - if (BIT(data, 6)) - m_maincpu->set_input_line_and_vector(INPUT_LINE_IRQ0, ASSERT_LINE, 0xcf); // INT 10 // I8080 + } + else if (BIT(data, 6)) + { + m_intr_socket->set_irq_level(1, ASSERT_LINE); + } } } @@ -322,7 +331,9 @@ But, all of this can only occur if bit 4 of port F0 is low. */ c = !m_ff_b; // from /Q of 2nd flipflop m_ff_b = a; // from Q of 1st flipflop if (c) - m_maincpu->set_input_line_and_vector(INPUT_LINE_IRQ0, ASSERT_LINE, 0xd7); // I8080 + { + m_intr_socket->set_irq_level(2, ASSERT_LINE); + } } } else @@ -338,9 +349,7 @@ But, all of this can only occur if bit 4 of port F0 is low. */ void h8_state::h8_level3_irq_callback(int state) { - if (state) { - m_maincpu->set_input_line_and_vector(INPUT_LINE_IRQ0, ASSERT_LINE, 0xdf); // RST3 - } + m_intr_socket->set_irq_level(3, state); } TIMER_DEVICE_CALLBACK_MEMBER(h8_state::kansas_w) @@ -373,6 +382,11 @@ TIMER_DEVICE_CALLBACK_MEMBER(h8_state::kansas_r) } } +static void intr_ctrl_options(device_slot_interface &device) +{ + device.option_add("original", HEATH_INTR_CNTRL); +} + void h8_state::h8(machine_config &config) { /* basic machine hardware */ @@ -381,10 +395,16 @@ void h8_state::h8(machine_config &config) m_maincpu->set_addrmap(AS_IO, &h8_state::io_map); m_maincpu->out_status_func().set(FUNC(h8_state::h8_status_callback)); m_maincpu->out_inte_func().set(FUNC(h8_state::h8_inte_callback)); + m_maincpu->set_irq_acknowledge_callback("intr_socket", FUNC(heath_intr_socket::irq_callback)); /* video hardware */ config.set_default_layout(layout_h8); + HEATH_INTR_SOCKET(config, m_intr_socket, intr_ctrl_options, nullptr); + m_intr_socket->irq_line_cb().set_inputline(m_maincpu, INPUT_LINE_IRQ0); + m_intr_socket->set_default_option("original"); + m_intr_socket->set_fixed(true); + /* sound hardware */ SPEAKER(config, "mono").front_center(); BEEP(config, m_beep, H8_BEEP_FRQ).add_route(ALL_OUTPUTS, "mono", 1.00); diff --git a/src/mame/heathzenith/h89.cpp b/src/mame/heathzenith/h89.cpp index c03507b2d6cc5..48bd30a59b5e2 100644 --- a/src/mame/heathzenith/h89.cpp +++ b/src/mame/heathzenith/h89.cpp @@ -45,7 +45,6 @@ #include "bus/heathzenith/h19/tlb.h" #include "bus/heathzenith/h89/h89bus.h" -#include "bus/heathzenith/h89/intr_cntrl.h" #include "bus/heathzenith/h89/cdr_fdc_880h.h" #include "bus/heathzenith/h89/h_88_3.h" #include "bus/heathzenith/h89/h_88_5.h" @@ -55,6 +54,7 @@ #include "bus/heathzenith/h89/we_pullup.h" #include "bus/heathzenith/h89/z_89_11.h" #include "bus/heathzenith/h89/z37_fdc.h" +#include "bus/heathzenith/intr_cntrl/intr_cntrl.h" #include "cpu/z80/z80.h" #include "machine/ins8250.h" diff --git a/src/mame/homebrew/pc532.cpp b/src/mame/homebrew/pc532.cpp index 19c169b7cb142..dbeba6f82aa0b 100644 --- a/src/mame/homebrew/pc532.cpp +++ b/src/mame/homebrew/pc532.cpp @@ -49,7 +49,7 @@ class pc532_state : public driver_device , m_fpu(*this, "fpu") , m_icu(*this, "icu") , m_rtc(*this, "rtc") - , m_ncr5380(*this, "slot:7:ncr5380") + , m_dp8490(*this, "slot:7:dp8490") , m_aic6250(*this, "scsi:0:aic6250") , m_duart(*this, "duart%u", 0U) , m_serial(*this, "serial%u", 0U) @@ -74,7 +74,7 @@ class pc532_state : public driver_device required_device m_rtc; - required_device m_ncr5380; + required_device m_dp8490; required_device m_aic6250; required_device_array m_duart; @@ -154,13 +154,13 @@ void pc532_state::drq_w(int state) { switch (m_state) { - case RD1: m_dma |= u32(m_ncr5380->dma_r()) << 8; m_state = RD2; break; - case RD2: m_dma |= u32(m_ncr5380->dma_r()) << 16; m_state = RD3; break; - case RD3: m_dma |= u32(m_ncr5380->dma_r()) << 24; m_state = RD4; break; + case RD1: m_dma |= u32(m_dp8490->dma_r()) << 8; m_state = RD2; break; + case RD2: m_dma |= u32(m_dp8490->dma_r()) << 16; m_state = RD3; break; + case RD3: m_dma |= u32(m_dp8490->dma_r()) << 24; m_state = RD4; break; - case WR3: m_ncr5380->dma_w(m_dma >> 8); m_state = WR2; break; - case WR2: m_ncr5380->dma_w(m_dma >> 16); m_state = WR1; break; - case WR1: m_ncr5380->dma_w(m_dma >> 24); m_state = IDLE; break; + case WR3: m_dp8490->dma_w(m_dma >> 8); m_state = WR2; break; + case WR2: m_dp8490->dma_w(m_dma >> 16); m_state = WR1; break; + case WR1: m_dp8490->dma_w(m_dma >> 24); m_state = IDLE; break; default: break; @@ -212,7 +212,7 @@ u32 pc532_state::dma_r(offs_t offset, u32 mem_mask) if (m_drq && !m_irq) { // buffer empty and SCSI ready to transfer; read SCSI data, enter the read state, and signal the CPU to wait - m_dma = m_ncr5380->dma_r(); + m_dma = m_dp8490->dma_r(); m_state = RD1; m_cpu->rdy_w(1); @@ -249,7 +249,7 @@ void pc532_state::dma_w(offs_t offset, u32 data, u32 mem_mask) if (m_drq) { m_dma = data; - m_ncr5380->dma_w(m_dma >> 0); + m_dp8490->dma_w(m_dma >> 0); m_state = WR3; } } @@ -280,7 +280,7 @@ template void pc532_state::cpu_map(address_map &map) if (ST == ns32000::ST_ODT) { map(0x3000'0000, 0x3fff'ffff).view(m_select); - m_select[0](0x3000'0000, 0x3000'0007).m(m_ncr5380, FUNC(ncr5380_device::map)); + m_select[0](0x3000'0000, 0x3000'0007).m(m_dp8490, FUNC(dp8490_device::map)); m_select[0](0x3800'0000, 0x3fff'ffff).rw(FUNC(pc532_state::dma_r), FUNC(pc532_state::dma_w)); m_select[1](0x3000'0000, 0x3000'0001).rw(m_aic6250, FUNC(aic6250_device::read), FUNC(aic6250_device::write)); } @@ -316,14 +316,14 @@ void pc532_state::pc532(machine_config &config) NSCSI_CONNECTOR(config, "slot:1", scsi_devices, nullptr, false); NSCSI_CONNECTOR(config, "slot:2", scsi_devices, nullptr, false); NSCSI_CONNECTOR(config, "slot:3", scsi_devices, nullptr, false); - NSCSI_CONNECTOR(config, "slot:7").option_set("ncr5380", NCR5380).machine_config( // DP8490 + NSCSI_CONNECTOR(config, "slot:7").option_set("dp8490", DP8490).machine_config( // DP8490V [this](device_t *device) { - ncr5380_device &ncr5380(downcast(*device)); + dp8490_device &dp8490(downcast(*device)); - ncr5380.drq_handler().set(*this, FUNC(pc532_state::drq_w)); - ncr5380.irq_handler().append(m_icu, FUNC(ns32202_device::ir_w<4>)); - ncr5380.irq_handler().append(*this, FUNC(pc532_state::irq_w)); + dp8490.drq_handler().set(*this, FUNC(pc532_state::drq_w)); + dp8490.irq_handler().append(m_icu, FUNC(ns32202_device::ir_w<4>)); + dp8490.irq_handler().append(*this, FUNC(pc532_state::irq_w)); }); NSCSI_BUS(config, "scsi"); diff --git a/src/mame/ibm/ibm3477.cpp b/src/mame/ibm/ibm3477.cpp index f6b50ae0998f5..990df0cf4f5ce 100644 --- a/src/mame/ibm/ibm3477.cpp +++ b/src/mame/ibm/ibm3477.cpp @@ -49,7 +49,7 @@ class ibm3477_state : public driver_device ibm3477_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag) , m_maincpu(*this, "maincpu") - { } + { } void ibm3477(machine_config &config); @@ -109,5 +109,5 @@ ROM_END } // anonymous namespace -// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS +// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS COMP( 1998, ibm3477, 0, 0, ibm3477, ibm3477, ibm3477_state, empty_init, "IBM", "InfoWindow 3477", MACHINE_NO_SOUND | MACHINE_NOT_WORKING) // Spanish ROMs? diff --git a/src/mame/igs/goldstar.cpp b/src/mame/igs/goldstar.cpp index 158e914f4fa77..e159b272c9eb1 100644 --- a/src/mame/igs/goldstar.cpp +++ b/src/mame/igs/goldstar.cpp @@ -12289,7 +12289,7 @@ RAMs 1x D4016C-1 u23 PLDs -1x unknowun Cl-001 (QFP144) CY144A read protected +1x unknown Cl-001 (QFP144) CY144A read protected 4x GAL20V8A-15LNC pl1, pl4, pl5, pl6 read protected 2x PALCE20V8H-25PC/4 u2,u? read protected 1x PALCE22V10H-25PC/4 u? read protected @@ -16438,6 +16438,42 @@ ROM_START( magoddsd ) ROM_LOAD( "dm74s288.12k",0x40, 0x20, CRC(03231e84) SHA1(92abdf6f8ef705b260378e90e6d591da056c2cee) ) ROM_END +// custom CPU block +ROM_START( mtonic2 ) + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "8_tonic.7e", 0x0000, 0x8000, CRC(71df6972) SHA1(281c93184b611a0227a409a0bfe2d8c72d5da878) ) + ROM_LOAD( "9_tonic.8e", 0x8000, 0x8000, CRC(547af84a) SHA1(cf6282e72454c5a18b2a5b1ede6a787b5e75c8d1) ) + + ROM_REGION( 0x30000, "gfx1", 0 ) + ROM_LOAD( "5_tonic.10j", 0x00000, 0x10000, CRC(f1386106) SHA1(0fa5eb8a3e23b46893ff58edac109991b2621ad4) ) + ROM_LOAD( "6_tonic.11j", 0x10000, 0x10000, CRC(737ac1e8) SHA1(582169aad4d7738eb5e747ba174aa4239aeb868e) ) + ROM_LOAD( "7_tonic.13j", 0x20000, 0x10000, CRC(83b3996a) SHA1(809539c82735acc42b27223db8835c3511510763) ) + + ROM_REGION( 0x10000, "gfx2", 0 ) + ROM_LOAD( "1_tonic.10l", 0x0000, 0x4000, CRC(746588db) SHA1(2a0af552011246d4cc0cd0b670907cf8685ce8ef) ) + ROM_LOAD( "2_tonic.11l", 0x4000, 0x4000, CRC(8b7dd248) SHA1(a3ebde9fd0b6b1e42aa9b6d8e30c225abf2f80ce) ) + ROM_LOAD( "3_tonic.13l", 0x8000, 0x4000, CRC(de05e678) SHA1(8b9fcb9f912075a20a9ae38100006b57d508e0e7) ) + ROM_LOAD( "4_tonic.14l", 0xc000, 0x4000, CRC(8c542eee) SHA1(cb424e2a67c6d39302beca7cd5244bcad4a91189) ) + + // TODO: PROMs loading to be verified + ROM_REGION( 0xc00, "proms", 0 ) + ROM_LOAD( "dm74s573n.14d", 0x000, 0x400, CRC(9cc0d144) SHA1(ce5de17a3f6da6d14657a4322c57891fa9804874) ) + ROM_LOAD( "dm74s573n.12d", 0x400, 0x400, CRC(b6ba79ac) SHA1(c6415d80301346712c58730ab03079b7dc15e12e) ) + ROM_LOAD( "dm74s573n.13d", 0x800, 0x400, CRC(ae27855a) SHA1(9b822c85d88f8ef8a503818cbf870aa9b0ff7c40) ) + + ROM_REGION( 0x100, "proms2", 0 ) + ROM_LOAD( "n82s129an.2n", 0x000, 0x100, CRC(fc0652fd) SHA1(4326550edb3023017b564a84f94daff532608891) ) + + ROM_REGION( 0x240, "proms3", 0 ) + ROM_LOAD( "n82s123an.14c", 0x000, 0x020, CRC(6a13320b) SHA1(6d7c663477f3fbc22fb716e15bfdd9c452eb686a) ) + ROM_LOAD( "n82s123an.4f", 0x020, 0x020, CRC(1aa176f3) SHA1(fe777cba829046f850ab612b927bde4fe0d37811) ) // same as magoddsb + ROM_LOAD( "n82s147an.13b", 0x040, 0x200, CRC(d01f10b3) SHA1(36b97831b26c899b8c5a1596bbbf54f58a32fae3) ) + + ROM_REGION( 0x400, "plds", ROMREGION_ERASE00 ) + ROM_LOAD( "palce16v8h-25.9f", 0x000, 0x117, NO_DUMP ) + ROM_LOAD( "palce16v8h-25.9h", 0x200, 0x117, NO_DUMP ) +ROM_END + /* LADY LINER - TAB Austria @@ -23562,6 +23598,7 @@ GAME( 1992, magoddsa, magodds, magodds, magodds, wingco_state, empty_ini GAME( 1992, magoddsb, magodds, magodds, magodds, wingco_state, empty_init, ROT0, "Pal Company / Micro Manufacturing Inc.", "Magical Odds (set 3)", MACHINE_WRONG_COLORS | MACHINE_IMPERFECT_GRAPHICS ) GAME( 1991, magoddsc, magodds, magodds, magoddsc, wingco_state, init_magoddsc, ROT0, "Pal Company", "Magical Odds (set 4, custom encrypted CPU block)", MACHINE_WRONG_COLORS | MACHINE_NOT_WORKING | MACHINE_NO_SOUND ) GAME( 1991, magoddsd, magodds, magodds, magoddsc, wingco_state, init_magoddsc, ROT0, "Pal Company", "Magical Odds (set 5, custom encrypted CPU block)", MACHINE_WRONG_COLORS | MACHINE_NOT_WORKING | MACHINE_NO_SOUND ) +GAME( 199?, mtonic2, 0, magodds, magoddsc, wingco_state, init_magoddsc, ROT0, "Pal Company", "Magical Tonic Part 2", MACHINE_WRONG_COLORS | MACHINE_NOT_WORKING | MACHINE_NO_SOUND ) // --- Amcoe games --- diff --git a/src/mame/igs/igs011.cpp b/src/mame/igs/igs011.cpp index 477510e593106..9db3adee45c2e 100644 --- a/src/mame/igs/igs011.cpp +++ b/src/mame/igs/igs011.cpp @@ -126,6 +126,7 @@ class igs011_state : public driver_device void init_drgnwrldv11h() ATTR_COLD; void init_lhb2() ATTR_COLD; void init_xymg() ATTR_COLD; + void init_xymga() ATTR_COLD; void init_drgnwrldv10c() ATTR_COLD; void init_drgnwrldv20j() ATTR_COLD; void init_drgnwrldv40k() ATTR_COLD; @@ -137,6 +138,7 @@ class igs011_state : public driver_device void tygn(machine_config &config) ATTR_COLD; void wlcc(machine_config &config) ATTR_COLD; void xymg(machine_config &config) ATTR_COLD; + void xymga(machine_config &config) ATTR_COLD; void lhb2(machine_config &config) ATTR_COLD; void lhb(machine_config &config) ATTR_COLD; void drgnwrld_igs012(machine_config &config) ATTR_COLD; @@ -283,7 +285,9 @@ class igs011_state : public driver_device void nkishusp_mem(address_map &map) ATTR_COLD; void tygn_mem(address_map &map) ATTR_COLD; void wlcc_mem(address_map &map) ATTR_COLD; + void xymg_base_mem(address_map &map) ATTR_COLD; void xymg_mem(address_map &map) ATTR_COLD; + void xymga_mem(address_map &map) ATTR_COLD; }; // With trackball inputs @@ -2451,6 +2455,28 @@ void igs011_state::init_xymg() */ } +void igs011_state::init_xymga() +{ + u16 *src = (u16 *) m_maincpu_region->base(); + const int rom_size = 0x80000; + + for (int i = 0; i < rom_size / 2; i++) + { + u16 x = src[i]; + + if ((i & 0x2300) == 0x2100 || ((i & 0x2000) == 0x0000 && ((i & 0x0300) != 0x0200) && ((i & 0x0300) != 0x0100))) + x ^= 0x0200; + + if (!(i & 0x0004) || !(i & 0x2000) || (!(i & 0x0080) && !(i & 0x0010))) + x ^= 0x0020; + + if ((i & 0x0100) || (i & 0x0040) || ((i & 0x0010) && (i & 0x0002))) + x ^= 0x0004; + + src[i] = x; + } +} + void igs011_state::init_wlcc() { // u16 *rom = (u16 *) m_maincpu_region->base(); @@ -2732,7 +2758,7 @@ void igs011_state::lhb_mem(address_map &map) map(0x888000, 0x888001).r(FUNC(igs011_state::dips_r<5>)); } -void igs011_state::xymg_mem(address_map &map) +void igs011_state::xymg_base_mem(address_map &map) { map(0x000000, 0x07ffff).rom(); @@ -2754,8 +2780,6 @@ void igs011_state::xymg_mem(address_map &map) map(0x400000, 0x400fff).rw(m_palette, FUNC(palette_device::read8), FUNC(palette_device::write8)).umask16(0x00ff).share("palette"); map(0x401000, 0x401fff).rw(m_palette, FUNC(palette_device::read8_ext), FUNC(palette_device::write8_ext)).umask16(0x00ff).share("palette_ext"); map(0x600001, 0x600001).rw(m_oki, FUNC(okim6295_device::read), FUNC(okim6295_device::write)); - map(0x700000, 0x700001).w(FUNC(igs011_state::igs003_w)); - map(0x700002, 0x700003).rw(FUNC(igs011_state::xymg_igs003_r), FUNC(igs011_state::xymg_igs003_w)); map(0x820000, 0x820001).w(FUNC(igs011_state::igs011_priority_w)); map(0x840000, 0x840001).w(FUNC(igs011_state::dips_w)); @@ -2774,6 +2798,23 @@ void igs011_state::xymg_mem(address_map &map) map(0x888000, 0x888001).r(FUNC(igs011_state::dips_r<3>)); } +void igs011_state::xymg_mem(address_map &map) +{ + xymg_base_mem(map); + + map(0x700000, 0x700001).w(FUNC(igs011_state::igs003_w)); + map(0x700002, 0x700003).rw(FUNC(igs011_state::xymg_igs003_r), FUNC(igs011_state::xymg_igs003_w)); +} + +void igs011_state::xymga_mem(address_map &map) +{ + xymg_base_mem(map); + + map(0x700000, 0x700001).portr("COIN"); + map(0x700002, 0x700005).r(FUNC(igs011_state::lhb_inputs_r)); + map(0x700002, 0x700003).w(FUNC(igs011_state::lhb_inputs_w)); +} + void igs011_state::wlcc_mem(address_map &map) { // wlcc: IGS011 protection dynamically mapped at 834x @@ -4129,6 +4170,13 @@ void igs011_state::xymg(machine_config &config) } +void igs011_state::xymga(machine_config &config) +{ + xymg(config); + m_maincpu->set_addrmap(AS_PROGRAM, &igs011_state::xymga_mem); +} + + void igs011_state::lhb2(machine_config &config) { igs011_base(config); @@ -4963,6 +5011,20 @@ ROM_START( xymg ) ROM_CONTINUE( 0x00000, 0x80000 ) // 1ST+2ND IDENTICAL ROM_END +// this is very similar to the ryukobou PCB type. Below the Oki there's an empty space for an IGS003. Only SW1 and SW2 are populated. +ROM_START( xymga ) + ROM_REGION( 0x80000, "maincpu", 0 ) + ROM_LOAD16_WORD_SWAP( "rom.u30", 0x000000, 0x80000, CRC(ecc871fb) SHA1(b5a0e5ef9e6097548c5b26a4638b8618900a37ff) ) + + ROM_REGION( 0x280000, "blitter", 0 ) + ROM_LOAD( "rom.u15", 0x000000, 0x200000, CRC(ec54452c) SHA1(0ee7ffa3d4845af083944e64faf5a1c78247aaa2) ) + ROM_LOAD( "igs_0203.u8", 0x200000, 0x080000, CRC(56a2706f) SHA1(98bf4b3153eef53dd449e2538b4b7ff2cc2fe6fa) ) + + ROM_REGION( 0x80000, "oki", 0 ) + ROM_LOAD( "igs_s0202.u39", 0x000000, 0x80000, CRC(106ac5f7) SHA1(5796a880c3424e3d2251b2223a0e594957afecaf) ) // same as xymg, only without 1st and 2nd half identical +ROM_END + + } // anonymous namespace @@ -4987,7 +5049,8 @@ GAME( 1995, dbc, lhb, lhb, lhb, igs011_state, i GAME( 1995, ryukobou, lhb, lhb, lhb, igs011_state, init_ryukobou, ROT0, "IGS / Alta", "Mahjong Ryukobou (Japan, V030J)", MACHINE_SUPPORTS_SAVE ) GAME( 1996, lhb2, 0, lhb2, lhb2, igs011_state, init_lhb2, ROT0, "IGS", "Lung Fu Bong II (Hong Kong, V185H)", MACHINE_SUPPORTS_SAVE ) GAME( 1996, tygn, lhb2, tygn, tygn, igs011_state, init_tygn, ROT0, "IGS", "Te Yi Gong Neng (China, V632C)", MACHINE_SUPPORTS_SAVE | MACHINE_NOT_WORKING ) // needs correct IGS003 routines -GAME( 1996, xymg, 0, xymg, xymg, igs011_state, init_xymg, ROT0, "IGS", "Xingyun Man Guan (China, V651C)", MACHINE_SUPPORTS_SAVE ) +GAME( 1996, xymg, 0, xymg, xymg, igs011_state, init_xymg, ROT0, "IGS", "Xingyun Manguan (China, V651C, set 1)", MACHINE_SUPPORTS_SAVE ) +GAME( 1996, xymga, xymg, xymga, xymg, igs011_state, init_xymga, ROT0, "IGS", "Xingyun Manguan (China, V651C, set 2)", MACHINE_SUPPORTS_SAVE ) // different encryption and without IGS003 GAME( 1996, wlcc, xymg, wlcc, wlcc, igs011_state, init_wlcc, ROT0, "IGS", "Wanli Changcheng (China, V638C)", MACHINE_SUPPORTS_SAVE ) GAME( 1996, vbowl, 0, vbowl, vbowl, vbowl_state, init_vbowl, ROT0, "IGS", "Virtua Bowling (World, V101XCM)", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_SOUND ) GAME( 1996, vbowlj, vbowl, vbowl, vbowlj, vbowl_state, init_vbowlj, ROT0, "IGS / Alta", "Virtua Bowling (Japan, V100JCM)", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_SOUND ) diff --git a/src/mame/igs/igs_68k_023vid.cpp b/src/mame/igs/igs_68k_023vid.cpp new file mode 100644 index 0000000000000..e38bc9fd97c48 --- /dev/null +++ b/src/mame/igs/igs_68k_023vid.cpp @@ -0,0 +1,390 @@ +// license:BSD-3-Clause +// copyright-holders: David Haywood + +/* +IGS games based on M68000 + IGS023 for video. +PGM-like but with different sound hardware. + +TODO: +* identify sound hardware +* identify where the M6502 core is contained +* complete inputs for xypmd +* add inputs for xypmda +*/ + + +#include "emu.h" + +#include "igs023_video.h" + +#include "cpu/m6502/m6502.h" +#include "cpu/m68000/m68000.h" +#include "machine/timer.h" + +#include "emupal.h" +#include "screen.h" +#include "speaker.h" +#include "tilemap.h" + +namespace { + +class igs_68k_023vid_state : public driver_device +{ +public: + igs_68k_023vid_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), + m_maincpu(*this, "maincpu"), + m_screen(*this, "screen"), + m_video(*this, "igs023"), + m_mainram(*this, "sram"), + m_in0(*this, "IN0"), + m_dsw(*this, "DSW%u", 1U) + { } + + void xypmd(machine_config &config) ATTR_COLD; + void xypmda(machine_config &config) ATTR_COLD; + +protected: + virtual void machine_start() override ATTR_COLD; + +private: + u16 unknown_r() { return (machine().rand() & 0x0010) | 0xffcf; } // 0x0010 seems to be sound CPU status + u16 unknown2_r() { return 0xffff; } + u16 input_r(); + + void screen_vblank(int state); + void screen_vblank_xypmda(int state); + + void main_program_base_map(address_map &map) ATTR_COLD; + void main_program_xypmd_map(address_map &map) ATTR_COLD; + void main_program_xypmda_map(address_map &map) ATTR_COLD; + + void sub_program_map(address_map &map) ATTR_COLD; + + required_device m_maincpu; + required_device m_screen; + required_device m_video; + required_shared_ptr m_mainram; + + required_ioport m_in0; + required_ioport_array<2> m_dsw; + + u8 m_input_sel = 0; +}; + + +void igs_68k_023vid_state::machine_start() +{ + save_item(NAME(m_input_sel)); +} + + +void igs_68k_023vid_state::screen_vblank(int state) +{ + // Apart from IRQ1 and IRQ2 all other IRQs point to exceptions + + // rising edge + if (state) + { + m_video->get_sprites(); + m_maincpu->set_input_line(M68K_IRQ_1, HOLD_LINE); // only IRQ with useful code + } + else + { + // m_maincpu->set_input_line(M68K_IRQ_2, HOLD_LINE); // does nothing + } +} + +void igs_68k_023vid_state::screen_vblank_xypmda(int state) +{ + // Apart from IRQ2 all other IRQs point to exceptions + + // rising edge + if (state) + { + m_video->get_sprites(); + m_maincpu->set_input_line(M68K_IRQ_2, HOLD_LINE); + } + else + { + // no other possible IRQ vectors + } +} + + +u16 igs_68k_023vid_state::input_r() // TODO: not totally correct +{ + u16 ret = m_in0->read(); + + if (!BIT(m_input_sel, 2)) + ret &= m_dsw[0]->read(); + if (!BIT(m_input_sel, 3)) + ret &= m_dsw[1]->read(); + + return ret; +} + + +void igs_68k_023vid_state::main_program_base_map(address_map &map) +{ + map(0x000000, 0x07ffff).rom(); + + map(0x800000, 0x81ffff).ram().share(m_mainram); // RAM test tests the full 0x20000, while in game it only seems to use 0x10000 + map(0x900000, 0x907fff).mirror(0x0f8000).rw(m_video, FUNC(igs023_video_device::videoram_r), FUNC(igs023_video_device::videoram_w)); + map(0xa00000, 0xa011ff).ram().w("palette", FUNC(palette_device::write16)).share("palette"); + map(0xa01200, 0xa023ff).ram(); // palette RAM test fails otherwise + map(0xb00000, 0xb0ffff).rw(m_video, FUNC(igs023_video_device::videoregs_r), FUNC(igs023_video_device::videoregs_w)); +} + +void igs_68k_023vid_state::main_program_xypmd_map(address_map &map) +{ + main_program_base_map(map); + + map(0x080000, 0x08ffff).ram(); // why is this tested like it was mainram / spriteram? bug in code? + + map(0x090000, 0x090001).r(FUNC(igs_68k_023vid_state::unknown_r)); + map(0x090018, 0x090019).portr("IN1"); + + // 025 or just I/O? + map(0x0c0000, 0x0c0001).nopr().nopw(); + map(0x0c0002, 0x0c0003).r(FUNC(igs_68k_023vid_state::input_r)).lw16(NAME([this] (uint16_t data) { m_input_sel = data & 0xff; })); +} + +void igs_68k_023vid_state::main_program_xypmda_map(address_map &map) +{ + main_program_base_map(map); + + // I/O / IGS025 etc. is different here + map(0x080100, 0x080101).r(FUNC(igs_68k_023vid_state::unknown_r)); + map(0x080120, 0x080121).portr("IN1"); + map(0x080200, 0x080201).nopw(); + + map(0x0a0000, 0x0a0001).r(FUNC(igs_68k_023vid_state::unknown2_r)); + map(0x0a0002, 0x0a0003).r(FUNC(igs_68k_023vid_state::unknown2_r)); + + // definitely the same as 0x0c0000 on the parent + map(0x0e0000, 0x0e0001).nopr().nopw(); + map(0x0e0002, 0x0e0003).nopw().portr("IN0"); +} + +void igs_68k_023vid_state::sub_program_map(address_map &map) +{ + map(0x0000, 0x03ff).ram(); + + map(0x4200, 0x46ff).ram(); + + map(0xc000, 0xc000).noprw(); + map(0xc001, 0xc001).nopw(); + + map(0xe000, 0xffff).rom().region("subcpu", 0x0000); +} + + +static INPUT_PORTS_START( xypmd ) + 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_UNKNOWN ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN1 ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN2 ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT ) + PORT_SERVICE_NO_TOGGLE( 0x80, IP_ACTIVE_LOW ) + PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN ) + + PORT_START("IN1") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_GAMBLE_BET ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_GAMBLE_D_UP ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_POKER_CANCEL ) + PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN ) + + PORT_START("DSW1") + PORT_DIPUNKNOWN_DIPLOC(0x01, 0x01, "SW1:1") + PORT_DIPUNKNOWN_DIPLOC(0x02, 0x02, "SW1:2") + PORT_DIPUNKNOWN_DIPLOC(0x04, 0x04, "SW1:3") + PORT_DIPUNKNOWN_DIPLOC(0x08, 0x08, "SW1:4") + PORT_DIPUNKNOWN_DIPLOC(0x10, 0x10, "SW1:5") + PORT_DIPUNKNOWN_DIPLOC(0x20, 0x20, "SW1:6") + PORT_DIPUNKNOWN_DIPLOC(0x40, 0x40, "SW1:7") + PORT_DIPUNKNOWN_DIPLOC(0x80, 0x80, "SW1:8") + PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN ) + + PORT_START("DSW2") + PORT_DIPUNKNOWN_DIPLOC(0x01, 0x01, "SW2:1") + PORT_DIPUNKNOWN_DIPLOC(0x02, 0x02, "SW2:2") + PORT_DIPUNKNOWN_DIPLOC(0x04, 0x04, "SW2:3") + PORT_DIPUNKNOWN_DIPLOC(0x08, 0x08, "SW2:4") + PORT_DIPUNKNOWN_DIPLOC(0x10, 0x10, "SW2:5") + PORT_DIPUNKNOWN_DIPLOC(0x20, 0x20, "SW2:6") + PORT_DIPUNKNOWN_DIPLOC(0x40, 0x40, "SW2:7") + PORT_DIPUNKNOWN_DIPLOC(0x80, 0x80, "SW2:8") + PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN ) +INPUT_PORTS_END + + +void igs_68k_023vid_state::xypmd(machine_config &config) +{ + // basic machine hardware + M68000(config, m_maincpu, 20_MHz_XTAL); + m_maincpu->set_addrmap(AS_PROGRAM, &igs_68k_023vid_state::main_program_xypmd_map); + + m6502_device &subcpu(M6502(config, "subcpu", 8_MHz_XTAL)); // TODO: something M6502 derived (data.u13 is M6502 derived code) + subcpu.set_addrmap(AS_PROGRAM, &igs_68k_023vid_state::sub_program_map); + + // video hardware + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); // TODO: verify everything once emulation works + m_screen->set_refresh_hz(60); + m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(1000)); + m_screen->set_size(512, 256); + m_screen->set_visarea(0, 448-1, 0, 224-1); + m_screen->set_screen_update("igs023", FUNC(igs023_video_device::screen_update)); + m_screen->screen_vblank().set(FUNC(igs_68k_023vid_state::screen_vblank)); + m_screen->set_palette("palette"); + + PALETTE(config, "palette").set_format(palette_device::xRGB_555, 0x1200 / 2); + + IGS023_VIDEO(config, m_video, 0); + m_video->set_palette("palette"); + m_video->read_spriteram_callback().set([this](offs_t offset) { return m_mainram[offset]; }); + + // sound hardware + SPEAKER(config, "mono").front_center(); + + // TODO: is sound provided by the two Novatek chips? +} + +void igs_68k_023vid_state::xypmda(machine_config &config) +{ + xypmd(config); + + m_maincpu->set_addrmap(AS_PROGRAM, &igs_68k_023vid_state::main_program_xypmda_map); + + m_screen->screen_vblank().set(FUNC(igs_68k_023vid_state::screen_vblank_xypmda)); +} +/* +Xingyun Paomadi Super, IGS, 2003 +Hardware Info By Guru +--------------------- + +IGS PCB NO-0255-1 + |----------------------------------------------| + | IDC34 SOCKET.U11 |------| TL082 VOL | +|-| |NOVATEK OM8383S| +|1 TLP521(x23) 8MHz |NT3570F TL082 | +|8 DATA.U13 |------| | +|W | +|A |------| 7805 | +|Y 24257 |NOVATEK | +|-| |NT3580F | + | 24257 24257 |------| T518B| + | TEXT.U5 |---------| | +|-| | IGS023 | PAL V-401CN.U26 | +|1 CG.U6 | | PAL 68000 24258 | +|0 | | PAL | +|W CG.U7 | | |-----| 24258 | +|A |---------| |IGS025 20MHz BATT| +|Y DSW1 50MHz| S8 | SW3 | +|-|ULN2004 DSW2 |-----| TLP521(x17) | + | TLP521(x6) |--| JAMMA |--| | + |-------------| |----------------------| |---| +Notes: + 68000 - Motorola MC68000FN20 CPU. Clock Input 20MHz + Note: This is a 20MHz part without clock divider and runs at 20MHz. + 24257 - Winbond W24257AJ-8N 32kB x8-bit SRAM (VRAM) + 24258 - Winbond W24258S-55LL 32kB x8-bit SRAM (Work RAM) + IGS023 - Custom IGS023 Graphics Chip (also used on IGS PGM) + IGS025 - Custom IGS025 Chip with Sticker 'S8' + V-401CN - 27C4096 EPROM (main program) + TEXT.U5 - 27C160 EPROM + CG.U6 - 27C4096 EPROM + CG.U7 - 27C160 EPROM + DATA - 27512 Mask ROM + SOCKET.U11 - Empty Socket. ROM is likely to be missing as the socket is clean. PCB printed 'MUSIC1' and '27C080'. + There is space for another unpopulated ROM below this one marked 'MUSIC2' and '27C080'. + IDC34 - IDC34 34-Pin Flat Cable Connector for I/O and Control Expansion (same connector seen on PGM) + NT3580F - Novatek NT3580F-AM019 QFP100 Sound CPU with 6502 Core. Clock Input 8.000MHz. DATA ROM connects to this chip. + NT3570F - Novatek NT3570F QFP80 Sound Chip. Clock Input 8.000MHz. This chip connects to the opamps so this is the sound chip. + ROM U11 connects to this chip. Both Novatek chips are dated 1999. + T518B - Mitsumi T518B Reset Chip + 7805 - LM7805 5V Linear Voltage Regulator + TLP521 - Toshiba TLP521 Opto-Coupler + BATT - 3.6V Ni-Cad Battery (both W24258 RAMs are battery-backed) + SW3 - Toggle Switch for NVRAM Clear and Reset + DSW1/2 - 8-Position DIP Switch + ULN2003 - ULN2003 7-Channel Darlington Transistor Array + TL082 - Texas Instruments TL082 JFET Input Dual Operational Amplifier + OM8383S - Philips OM8383S Audio Power Amplifier +*/ + +ROM_START( xypmd ) + ROM_REGION( 0x80000, "maincpu", 0 ) + ROM_LOAD16_WORD_SWAP( "v-401cn.u26", 0x00000, 0x80000, CRC(84f4f46c) SHA1(c04d3aaf531caba6cdf8296570ce24964bd7a077) ) // version string at 0x360dc + + ROM_REGION( 0x10000, "subcpu", 0 ) // TODO: sound related? almost empty + ROM_LOAD( "data.u13", 0x00000, 0x10000, CRC(7c0d8c8f) SHA1(d36ae4749fd248c399741f2024f2f44cf22536b8) ) // 111xxxxxxxxxxxxx = 0x00 + + ROM_REGION( 0x200000, "igs023", 0 ) + ROM_LOAD( "text.u5", 0x000000, 0x200000, CRC(253b8517) SHA1(3f583410ab7083d5f45a5e23f73bddd18b000260) ) + + ROM_REGION16_LE( 0x200000, "igs023:sprcol", 0 ) + ROM_LOAD( "cg.u7", 0x000000, 0x200000, CRC(1c6764f2) SHA1(ed1efcab927bdc439247d422df5dedc72fce5682) ) // 1xxxxxxxxxxxxxxxxxxxx = 0xFF + + ROM_REGION16_LE( 0x80000, "igs023:sprmask", 0 ) + ROM_LOAD( "cg.u6", 0x00000, 0x80000, CRC(20ff0cb3) SHA1(4562996675fe62563f393817f40395c8bce37c5f) ) + + ROM_REGION( 0x100000, "samples", 0 ) + ROM_LOAD( "u11", 0x000000, 0x100000, NO_DUMP ) // probably removed from this PCB, possibly or even probably the same as xypmda +ROM_END + +/* +Unknown IGS +Hardware Info By Guru +--------------------- + +IGS PCB NO-0198-2 +Basically the same PCB as IGS PCB No-0255-1 with parts shuffled. +IGS did **MANY** board re-designs with no additional functionality. + +Notes: + 68000 - Clock 20MHz + 2x 61256 - 32kB x8-bit SRAM (Main Work RAM) + 3x 61256 - 32kB x8-bit SRAM (VRAM) + IGS023 - Custom IGS023 Graphics Chip (also used on IGS PGM) + IGS025 - Custom IGS025 Chip with Sticker 'T2' + CG/TEXT - vs 0255-1 PCB, this board has EPROMs replaced with SOP40 and SOP44 mask ROMs +*/ + +ROM_START( xypmda ) + ROM_REGION( 0x80000, "maincpu", 0 ) + ROM_LOAD16_WORD_SWAP( "prg.u36", 0x00000, 0x80000, CRC(99d6c58c) SHA1(c8db8689c18ef05ad52ef0476033b62f778e6abf) ) // no version string + + ROM_REGION( 0x10000, "subcpu", 0 ) // TODO: sound related? almost empty + ROM_LOAD( "data.u33", 0x00000, 0x10000, CRC(5e3e3558) SHA1(ca9cdb4e8d124b4a7341ef6597c7ccdbbe124138) ) // 111xxxxxxxxxxxxx = 0x00 + + ROM_REGION( 0x200000, "igs023", 0 ) + ROM_LOAD( "igs_t1801.u30", 0x000000, 0x200000, CRC(253b8517) SHA1(3f583410ab7083d5f45a5e23f73bddd18b000260) ) + + ROM_REGION16_LE( 0x100000, "igs023:sprcol", 0 ) + // Data is NOT identical to cg.u7 (size difference is irrelevant, cg.u7 just has blank data in 2nd half) + // Unusual however, as the sprcol and sprmask ROMs are essentially a pair. Check if one is bad or if + // some colours have been changed intentionally + ROM_LOAD( "igs_a1802.u40", 0x000000, 0x100000, CRC(5bf791cc) SHA1(df23c8a25a26410ec4021948403bb4111810d7af) ) + + ROM_REGION16_LE( 0x80000, "igs023:sprmask", 0 ) + ROM_LOAD( "igs_a1803.u39", 0x00000, 0x80000, CRC(20ff0cb3) SHA1(4562996675fe62563f393817f40395c8bce37c5f) ) + + ROM_REGION( 0x100000, "samples", 0 ) + ROM_LOAD( "igs_s1804_speech_v100.u32", 0x000000, 0x100000, CRC(d95220ee) SHA1(72259856bc2a12059ff481f7aab5ecc3118edd18) ) +ROM_END + +} // anonymous namespace + + + +GAME( 2003, xypmd, 0, xypmd, xypmd, igs_68k_023vid_state, empty_init, ROT0, "IGS", "Xingyun Paomadi Super (V401CN)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING ) +GAME( 1999, xypmda, xypmd, xypmda, xypmd, igs_68k_023vid_state, empty_init, ROT0, "IGS", "Xingyun Paomadi (unknown ver)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING ) diff --git a/src/mame/igs/igs_m027.cpp b/src/mame/igs/igs_m027.cpp index fd60ca0cafe24..d4a089d048232 100644 --- a/src/mame/igs/igs_m027.cpp +++ b/src/mame/igs/igs_m027.cpp @@ -142,13 +142,14 @@ class igs_m027_state : public driver_device template void m027_2ppis(machine_config &config) ATTR_COLD; void slqz3(machine_config &config) ATTR_COLD; void jking02(machine_config &config) ATTR_COLD; + void tct2p(machine_config &config) ATTR_COLD; void qlgs(machine_config &config) ATTR_COLD; void lhdmg(machine_config &config) ATTR_COLD; void lhzb3106c5m(machine_config &config) ATTR_COLD; void lhzb3sjb(machine_config &config) ATTR_COLD; void cjddz(machine_config &config) ATTR_COLD; void lhzb4(machine_config &config) ATTR_COLD; - void cjtljp(machine_config &config) ATTR_COLD; + void xypdk(machine_config &config) ATTR_COLD; void lthyp(machine_config &config) ATTR_COLD; void zhongguo(machine_config &config) ATTR_COLD; void mgzz(machine_config &config) ATTR_COLD; @@ -162,6 +163,8 @@ class igs_m027_state : public driver_device void init_gonefsh2() ATTR_COLD; void init_cjddz() ATTR_COLD; void init_cjddzp() ATTR_COLD; + void init_cjddzs() ATTR_COLD; + void init_cjddzps() ATTR_COLD; void init_cjddzlf() ATTR_COLD; void init_cjtljp() ATTR_COLD; void init_zhongguo() ATTR_COLD; @@ -181,6 +184,8 @@ class igs_m027_state : public driver_device void init_tripslot() ATTR_COLD; void init_extradrw() ATTR_COLD; void init_chessc2() ATTR_COLD; + void init_tct2p() ATTR_COLD; + void init_xypdk() ATTR_COLD; protected: virtual void machine_start() override ATTR_COLD; @@ -745,6 +750,100 @@ INPUT_PORTS_START( jking02 ) PORT_DIPUNKNOWN_DIPLOC( 0x80, 0x80, "SW3:8" ) INPUT_PORTS_END +INPUT_PORTS_START( tct2p ) + // uses the kan/pon/chi/reach/ron buttons as the main controls in mahjong panel mode + IGS_MAHJONG_MATRIX_CONDITIONAL("DSW2", 0x01, 0x00) + + PORT_START("PORTB") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SLOT_STOP2 ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) + PORT_BIT( 0x03, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00) + PORT_SERVICE_NO_TOGGLE( 0x04, IP_ACTIVE_LOW ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SLOT_STOP1 ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SLOT_STOP3 ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) + PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00) + + PORT_START("PORTC") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SLOT_STOP_ALL ) PORT_NAME("Show Odds") PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_GAMBLE_BET ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) PORT_READ_LINE_DEVICE_MEMBER("hopper", FUNC(hopper_device::line_r)) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SLOT_STOP4 ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) + PORT_BIT( 0x3f, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00) + + PORT_START("PLAYER") + PORT_BIT( 0x000ff, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) + PORT_BIT( 0x00100, IP_ACTIVE_LOW, IPT_GAMBLE_KEYIN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) + PORT_BIT( 0x1fe00, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) + PORT_BIT( 0x20000, IP_ACTIVE_LOW, IPT_GAMBLE_KEYOUT ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) + PORT_BIT( 0xc0000, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) + PORT_BIT( 0x0003f, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00) PORT_CUSTOM_MEMBER(FUNC(igs_m027_state::kbd_ioport_r)) + PORT_BIT( 0x00040, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00) PORT_READ_LINE_DEVICE_MEMBER("hopper", FUNC(hopper_device::line_r)) + PORT_BIT( 0x00f80, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00) + PORT_BIT( 0x01000, IP_ACTIVE_LOW, IPT_GAMBLE_KEYIN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00) + PORT_BIT( 0x02000, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00) + PORT_BIT( 0x1c000, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00) + PORT_BIT( 0x20000, IP_ACTIVE_LOW, IPT_GAMBLE_KEYOUT ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00) + PORT_BIT( 0xc0000, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00) + + PORT_START("PPIB") + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00) PORT_WRITE_LINE_DEVICE_MEMBER("hopper", FUNC(hopper_device::motor_w)) + PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) PORT_WRITE_LINE_MEMBER(FUNC(igs_m027_state::counter_w<0>)) // payout/keyout + + PORT_START("PPIC") + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) PORT_WRITE_LINE_DEVICE_MEMBER("hopper", FUNC(hopper_device::motor_w)) + + PORT_START("CLEARMEM") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) PORT_TOGGLE + + PORT_START("DSW1") + PORT_DIPNAME( 0x1f, 0x1f, "Satellite Machine No.") PORT_DIPLOCATION("SW1:1,2,3,4,5") // 副机編号 + SATELLITE_NO_SETTINGS + PORT_DIPUNKNOWN_DIPLOC( 0x20, 0x20, "SW1:6" ) + PORT_DIPUNKNOWN_DIPLOC( 0x40, 0x40, "SW1:7" ) + PORT_DIPNAME( 0x80, 0x80, "Link Mode" ) PORT_DIPLOCATION("SW1:8") // 连线模式 + PORT_DIPSETTING( 0x80, DEF_STR(Off) ) // 无 + PORT_DIPSETTING( 0x00, DEF_STR(On) ) // 有 + + PORT_START("DSW2") + PORT_DIPNAME( 0x01, 0x01, DEF_STR(Controls) ) PORT_DIPLOCATION("SW2:1") // 操作界面 + PORT_DIPSETTING( 0x01, DEF_STR(Joystick) ) // 揺杆 + PORT_DIPSETTING( 0x00, "Mahjong" ) // 麻雀键盘 + PORT_DIPNAME( 0x02, 0x02, "Number Type" ) PORT_DIPLOCATION("SW2:2") // 数字型态 + PORT_DIPSETTING( 0x02, "Numbers" ) // 数字 + PORT_DIPSETTING( 0x00, "Circle Tiles" ) // 筒子 + PORT_DIPNAME( 0x04, 0x00, DEF_STR(Demo_Sounds) ) PORT_DIPLOCATION("SW2:3") // 示范音乐 + PORT_DIPSETTING( 0x04, DEF_STR(Off) ) // 无 + PORT_DIPSETTING( 0x00, DEF_STR(On) ) // 有 + PORT_DIPNAME( 0x08, 0x08, "Background Color Mode" ) PORT_DIPLOCATION("SW2:4") // 底色模式 + PORT_DIPSETTING( 0x08, "Monochrome" ) // 黑白 + PORT_DIPSETTING( 0x00, "Color" ) // 彩色 + PORT_DIPNAME( 0x10, 0x10, "Bet Limit" ) PORT_DIPLOCATION("SW2:5") // 限制押分 + PORT_DIPSETTING( 0x10, DEF_STR(Off) ) // 无 + PORT_DIPSETTING( 0x00, DEF_STR(On) ) // 有 + PORT_DIPUNKNOWN_DIPLOC( 0x20, 0x20, "SW2:6" ) + PORT_DIPUNKNOWN_DIPLOC( 0x40, 0x40, "SW2:7" ) + PORT_DIPUNKNOWN_DIPLOC( 0x80, 0x80, "SW2:8" ) + + PORT_START("DSW3") + PORT_DIPUNKNOWN_DIPLOC( 0x01, 0x01, "SW3:1" ) + PORT_DIPUNKNOWN_DIPLOC( 0x02, 0x02, "SW3:2" ) + PORT_DIPUNKNOWN_DIPLOC( 0x04, 0x04, "SW3:3" ) + PORT_DIPUNKNOWN_DIPLOC( 0x08, 0x08, "SW3:4" ) + PORT_DIPUNKNOWN_DIPLOC( 0x10, 0x10, "SW3:5" ) + PORT_DIPUNKNOWN_DIPLOC( 0x20, 0x20, "SW3:6" ) + PORT_DIPUNKNOWN_DIPLOC( 0x40, 0x40, "SW3:7" ) + PORT_DIPUNKNOWN_DIPLOC( 0x80, 0x80, "SW3:8" ) +INPUT_PORTS_END + INPUT_PORTS_START( slqz3 ) PORT_INCLUDE(mahjong_test) PORT_INCLUDE(slqz3_dip_switches) @@ -1823,12 +1922,13 @@ void igs_m027_state::lhzb4(machine_config &config) m_oki->set_clock(2'000'000); } -void igs_m027_state::cjtljp(machine_config &config) +void igs_m027_state::xypdk(machine_config &config) { cjddz(config); - // Found on a board with 2 MHz clock frequency (22 MHz/11, divided using a - // PAL) and pin 7 high. This makes the voices too high-pitched. + // xypdk was found on a board with this configuration. + // cjtljp was found on a board with 2 MHz clock frequency (22 MHz/11, divided + // using a PAL) and pin 7 high. This makes the voices too high-pitched. // Possibly supposed to be 2 MHz with pin 7 low, or 1.375 MHz (22 MHz/16) // with pin 7 high. m_oki->set_clock(2'000'000); @@ -1866,6 +1966,20 @@ void igs_m027_state::jking02(machine_config &config) m_ppi[0]->out_pc_callback().set(FUNC(igs_m027_state::lamps_w<0>)); } +void igs_m027_state::tct2p(machine_config &config) +{ + m027_1ppi(config); + + m_maincpu->in_port().set_ioport("PLAYER"); + m_maincpu->out_port().append([this] (int state) { m_out_lamps[0] = state; }).bit(3); // seems to be an "insert coin" lamp - high when no credits + + m_ppi[0]->out_pb_callback().set_ioport("PPIB"); + m_ppi[0]->out_pc_callback().set_ioport("PPIC"); + m_ppi[0]->out_pc_callback().append(FUNC(igs_m027_state::io_select_w<0>)); + + HOPPER(config, m_hopper, attotime::from_msec(50)); +} + void igs_m027_state::mgzz(machine_config &config) { m027_1ppi(config); @@ -2828,7 +2942,7 @@ ROM_START( cjddz ) // PCB-0489-05-FM-1 ROM_LOAD16_WORD_SWAP( "m3.u27", 0x000000, 0x80000, CRC(520dc392) SHA1(0ab2620f20af8253806b6ff4e1d9d77a694da17c) ) ROM_REGION( 0x400000, "igs017_igs031:sprites", 0 ) - ROM_LOAD( "m4.u28", 0x000000, 0x400000, CRC(72487508) SHA1(9f4bbc858960ddaae403e4a3330b2345f6fd6cb3)) + ROM_LOAD( "m4.u28", 0x000000, 0x400000, CRC(72487508) SHA1(9f4bbc858960ddaae403e4a3330b2345f6fd6cb3) ) // OKI, sample tables are every 0x20000 starting at 0x40000 // 00000-1ffff and 20000-3ffff are likely music, always mapped at 20000 for any of the above banks @@ -2848,7 +2962,7 @@ ROM_START( cjddz217cn ) // PCB-0489-05-FM-1 ROM_LOAD16_WORD_SWAP( "text.u27", 0x000000, 0x80000, CRC(520dc392) SHA1(0ab2620f20af8253806b6ff4e1d9d77a694da17c) ) ROM_REGION( 0x400000, "igs017_igs031:sprites", 0 ) - ROM_LOAD( "igs_w05005w32m_f9ce_1d10.u28", 0x000000, 0x400000, CRC(72487508) SHA1(9f4bbc858960ddaae403e4a3330b2345f6fd6cb3)) + ROM_LOAD( "igs_w05005w32m_f9ce_1d10.u28", 0x000000, 0x400000, CRC(72487508) SHA1(9f4bbc858960ddaae403e4a3330b2345f6fd6cb3) ) // OKI, sample tables are every 0x20000 starting at 0x40000 // 00000-1ffff and 20000-3ffff are likely music, always mapped at 20000 for any of the above banks @@ -2868,7 +2982,7 @@ ROM_START( cjddz215cn ) ROM_LOAD16_WORD_SWAP( "ddz_text.u27", 0x000000, 0x80000, CRC(520dc392) SHA1(0ab2620f20af8253806b6ff4e1d9d77a694da17c) ) ROM_REGION( 0x400000, "igs017_igs031:sprites", 0 ) - ROM_LOAD( "ddz_ani.u28", 0x000000, 0x400000, CRC(72487508) SHA1(9f4bbc858960ddaae403e4a3330b2345f6fd6cb3)) + ROM_LOAD( "ddz_ani.u28", 0x000000, 0x400000, CRC(72487508) SHA1(9f4bbc858960ddaae403e4a3330b2345f6fd6cb3) ) // OKI, sample tables are every 0x20000 starting at 0x40000 // 00000-1ffff and 20000-3ffff are likely music, always mapped at 20000 for any of the above banks @@ -2876,6 +2990,45 @@ ROM_START( cjddz215cn ) ROM_LOAD( "ddz_sp.u4", 0x00000, 0x200000, CRC(7ef65d95) SHA1(345c587cd449d6d06908e9687480be76b2cb2d28) ) ROM_END +/* +Chaoji Dou Dizhu (V213CN) +IGS, 2004 + +PCB: IGS PCB-0489-07-FM-1 + +Main program ROM is missing. +SP-1 same as cjddz215cn and several others +TEXT same as cjddz215cn and several others +CG unique to this set +Main program ROM from cjddz215cn was put onto this board and works fine. + +IGS027 Sticker: Q1 +ROM String: WED NOV 3 17:21:49 2004 + FIGHT_213CN + +Oki Clock (from PAL): 1.000MHz [22/22] +Oki Pin 7: High +*/ +ROM_START( cjddz213cn ) + ROM_REGION( 0x04000, "maincpu", 0 ) + // Internal ROM of IGS027A ARM based MCU + ROM_LOAD( "q1_igs027a", 0x00000, 0x4000, CRC(124f4bee) SHA1(bf9785516ef36290c2a7bac307bb2d849f2045ae) ) + + ROM_REGION32_LE( 0x80000, "user1", 0 ) // external ARM data / prg + ROM_LOAD( "213cn.u17", 0x000000, 0x80000, NO_DUMP ) + + ROM_REGION( 0x80000, "igs017_igs031:tilemaps", 0 ) + ROM_LOAD16_WORD_SWAP( "text.u27", 0x000000, 0x80000, CRC(520dc392) SHA1(0ab2620f20af8253806b6ff4e1d9d77a694da17c) ) + + ROM_REGION( 0x400000, "igs017_igs031:sprites", 0 ) + ROM_LOAD( "cg.u28", 0x000000, 0x400000, CRC(168720a0) SHA1(edcd727e25386469c32d6fd117dd76eeb48ce0a6) ) + + // OKI, sample tables are every 0x20000 starting at 0x40000 + // 00000-1ffff and 20000-3ffff are likely music, always mapped at 20000 for any of the above banks + ROM_REGION( 0x200000, "oki", 0 ) + ROM_LOAD( "sp-1.u5", 0x00000, 0x200000, CRC(7ef65d95) SHA1(345c587cd449d6d06908e9687480be76b2cb2d28) ) +ROM_END + // 超级斗地主 加强版 (Chāojí Dòu Dìzhǔ Jiāqiáng Bǎn) ROM_START( cjddzp ) ROM_REGION( 0x04000, "maincpu", 0 ) @@ -2896,6 +3049,127 @@ ROM_START( cjddzp ) ROM_LOAD( "cjddzp_sp-1.u4", 0x00000, 0x200000, CRC(7ef65d95) SHA1(345c587cd449d6d06908e9687480be76b2cb2d28) ) ROM_END +/* +Chaoji Dou Dizhu (V302CN) (hard version) +IGS, 2007 + +PCB: IGS PCB-0489-07-FM-1 + +Main program is on a plug-in daughterboard containing one 27C322 EPROM, Lattice LC4128V CPLD, +3.3V regulator and a 2-position DIP switch. +DIP#1 off sets V219CN. DIP#1 on sets V302CN + +IGS027 Sticker: B1 +ROM String: WED NOV 3 17:21:49 2004 + FIGHT_213CN + +Oki Clock (from PAL): 1.000MHz [22/22] +Oki Pin 7: High +*/ + +ROM_START( cjddzs ) + ROM_REGION( 0x04000, "maincpu", 0 ) + // Internal ROM of IGS027A ARM based MCU + ROM_LOAD( "b1_igs027a", 0x00000, 0x4000, CRC(124f4bee) SHA1(bf9785516ef36290c2a7bac307bb2d849f2045ae) ) + + ROM_REGION32_LE( 0x100000, "user1", 0 ) // external ARM data / prg + // this has 2 programs, each repeated 4 times (cjddz at 0x000000, 0x080000, 0x200000, 0x280000, cjddzp at the remaining offsets). + // cjddz works correctly with the internal ROM, once a small address line swap is applied. cjddzp doesn't work. + // it is tested on PCB that regardless of DIP setting the same internal ROM string appears, when the external ROM is removed, so there + // must be some kind of additional work done by the CPLD to make cjddzp work. + ROM_LOAD( "v-302cn.u1", 0x000000, 0x080000, CRC(fc525368) SHA1(293a0b30b384b2f294ab7d9dbaafc899002c7a32) ) // BADADDR -x-xxxxxxxxxxxxxxxxxxx + ROM_IGNORE( 0x080000 ) + ROM_CONTINUE( 0x080000, 0x080000 ) + ROM_IGNORE( 0x280000 ) + + ROM_REGION( 0x80000, "igs017_igs031:tilemaps", 0 ) + ROM_LOAD16_WORD_SWAP( "text.u27", 0x000000, 0x80000, CRC(520dc392) SHA1(0ab2620f20af8253806b6ff4e1d9d77a694da17c) ) + + ROM_REGION( 0x400000, "igs017_igs031:sprites", 0 ) + ROM_LOAD( "ani_cg.u28", 0x000000, 0x400000, CRC(72487508) SHA1(9f4bbc858960ddaae403e4a3330b2345f6fd6cb3) ) + + // OKI, sample tables are every 0x20000 starting at 0x40000 + // 00000-1ffff and 20000-3ffff are likely music, always mapped at 20000 for any of the above banks + ROM_REGION( 0x200000, "oki", 0 ) + ROM_LOAD( "sp-1.u5", 0x00000, 0x200000, CRC(7ef65d95) SHA1(345c587cd449d6d06908e9687480be76b2cb2d28) ) +ROM_END + +/* +Chaoji Dou Dizhu (V219GN) (hard version) +IGS, 2009 + +PCB: IGS PCB-0489-03-FM-1 + +Main program is on a plug-in daughterboard containing one 27C322 EPROM, Lattice LC4128V CPLD, +3.3V regulator and a 2-position DIP switch. +DIP#1 off sets V219CN. DIP#1 on sets V405CN + +IGS027 Sticker: not present +ROM String: WED NOV 3 17:21:49 2004 + FIGHT_213CN + +Oki Clock (from PAL): 1.000MHz [22/22] +Oki Pin 7: High +*/ + +ROM_START( cjddzsa ) + ROM_REGION( 0x04000, "maincpu", 0 ) + // Internal ROM of IGS027A ARM based MCU + ROM_LOAD( "igs027a", 0x00000, 0x4000, CRC(124f4bee) SHA1(bf9785516ef36290c2a7bac307bb2d849f2045ae) ) + + ROM_REGION32_LE( 0x100000, "user1", 0 ) // external ARM data / prg + // this has 2 programs, each repeated 2 times (cjddz at 0x200000, 0x300000, cjddzp at 0x280000, 0x380000). First 0x200000 are 0xff filled. + // cjddz works correctly with the internal ROM, once a small address line swap is applied. cjddzp doesn't work. + // it is tested on PCB that regardless of DIP setting the same internal ROM string appears, when the external ROM is removed, so there + // must be some kind of additional work done by the CPLD to make cjddzp work. + ROM_LOAD( "v-219gn.u1", 0x000000, 0x080000, CRC(33ded435) SHA1(ed9911b4d3ab4a0924faf02e0090c24ff83a0d45) ) // 0xxxxxxxxxxxxxxxxxxxxx = 0xFF + ROM_CONTINUE( 0x000000, 0x080000 ) + ROM_CONTINUE( 0x000000, 0x080000 ) + ROM_CONTINUE( 0x000000, 0x080000 ) + ROM_CONTINUE( 0x000000, 0x100000 ) + ROM_IGNORE( 0x100000 ) + + ROM_REGION( 0x80000, "igs017_igs031:tilemaps", 0 ) + ROM_LOAD16_WORD_SWAP( "text.u27", 0x000000, 0x80000, CRC(520dc392) SHA1(0ab2620f20af8253806b6ff4e1d9d77a694da17c) ) + + ROM_REGION( 0x400000, "igs017_igs031:sprites", 0 ) + ROM_LOAD( "ani_cg.u28", 0x000000, 0x400000, CRC(72487508) SHA1(9f4bbc858960ddaae403e4a3330b2345f6fd6cb3) ) + + // OKI, sample tables are every 0x20000 starting at 0x40000 + // 00000-1ffff and 20000-3ffff are likely music, always mapped at 20000 for any of the above banks + ROM_REGION( 0x200000, "oki", 0 ) + ROM_LOAD( "sp-1.u5", 0x00000, 0x200000, CRC(64fbba95) SHA1(1aecb1b8426939262688e4dbed09d6a56e71b8d5) ) +ROM_END + +ROM_START( cjddzps ) + ROM_REGION( 0x04000, "maincpu", 0 ) + // Internal ROM of IGS027A ARM based MCU + ROM_LOAD( "igs027a", 0x00000, 0x4000, CRC(6cf26c3d) SHA1(c74d4ff71ff07c38449242e7e067e956a5c441be) ) + + ROM_REGION32_LE( 0x100000, "user1", 0 ) // external ARM data / prg + // this has 2 programs, (cjddzp at 0x200000, an unknown one at 0x280000). First 0x200000 and last 0x100000 are 0xff filled. + // cjddzp works correctly with the internal ROM, once a small address line swap is applied. the other game doesn't work. + // it's unknown which game it is, since the PCB doesn't work, but given the GFX and sound ROMs match, it should be some variation of cjddz/cjddzp + ROM_LOAD( "rom.u1", 0x000000, 0x080000, CRC(969f7d09) SHA1(6e5eab99d0ab7913d6838e5c357813960640cc14) ) // 01xxxxxxxxxxxxxxxxxxxx = 0xFF + ROM_CONTINUE( 0x000000, 0x080000 ) + ROM_CONTINUE( 0x000000, 0x080000 ) + ROM_CONTINUE( 0x000000, 0x080000 ) + ROM_CONTINUE( 0x000000, 0x100000 ) + ROM_IGNORE( 0x100000 ) + + ROM_REGION( 0x200000, "igs017_igs031:tilemaps", 0 ) + ROM_LOAD16_WORD_SWAP( "rom.u27", 0x000000, 0x200000, CRC(c4daedd6) SHA1(1c06e9b8f8c9849d808e12d81588f8d5603941d1) ) // 1xxxxxxxxxxxxxxxxxxxx = 0x00 + + ROM_REGION( 0x600000, "igs017_igs031:sprites", 0 ) + ROM_LOAD( "rom.u26", 0x000000, 0x400000, CRC(72487508) SHA1(9f4bbc858960ddaae403e4a3330b2345f6fd6cb3) ) + ROM_LOAD( "rom.u29", 0x400000, 0x200000, CRC(b0447269) SHA1(bf639abc135b52781340a24820e402db497d8d09) ) + + // OKI, sample tables are every 0x20000 starting at 0x40000 + // 00000-1ffff and 20000-3ffff are likely music, always mapped at 20000 for any of the above banks + ROM_REGION( 0x200000, "oki", 0 ) + ROM_LOAD( "rom.u11", 0x00000, 0x200000, CRC(7ef65d95) SHA1(345c587cd449d6d06908e9687480be76b2cb2d28) ) +ROM_END + // 超级斗地主 两副牌 (Chāojí Dòu Dìzhǔ Liǎng Fù Pái) ROM_START( cjddzlf ) ROM_REGION( 0x04000, "maincpu", 0 ) @@ -3018,6 +3292,71 @@ ROM_START( mgcs3 ) ROM_LOAD( "sp.u5", 0x00000, 0x200000, CRC(eb27b166) SHA1(eb9641516245d9094861d6ba6e902eac62019968) ) ROM_END +/* +Tarzan Chuǎng Tiānguān 2 Jiāqiáng Bǎn +泰山闯天关 2 加强版 +IGS, 2003 + +PCB: IGS PCB-0489-07-FM-1 +IGS027 Sticker: T8 +ROM String: TARZAN_CHINA_V300CN + THU JUN 19 14:13:23 2003 + +Oki Clock (from PAL): 1.000MHz [22/22] +Oki Pin 7: High +*/ + +ROM_START( tct2p ) + ROM_REGION( 0x04000, "maincpu", 0 ) + // Internal ROM of IGS027A type G ARM based MCU + ROM_LOAD( "t8_027a.bin", 0x0000, 0x4000, CRC(a5f0be90) SHA1(f2318cf324749831d8e1b766ae5646dcfdd955c6) ) + + ROM_REGION32_LE( 0x80000, "user1", 0 ) // external ARM data / prg + ROM_LOAD( "v-306cn.u17", 0x00000, 0x80000, CRC(c479e5ac) SHA1(4d8273f7425cdc3293c5b43219e021303c53cbad) ) + + ROM_REGION( 0x80000, "igs017_igs031:tilemaps", 0 ) + ROM_LOAD16_WORD_SWAP( "text.u27", 0x00000, 0x80000, CRC(d0e20214) SHA1(90f9b2d7ab0f2c0f99277df7c9ff24ea54b65709) ) + + ROM_REGION( 0x480000, "igs017_igs031:sprites", 0 ) + ROM_LOAD( "a4202.u28", 0x000000, 0x400000, CRC(97a68f85) SHA1(177c8c23fd0d585b24a71359ede005ac9a2e4d4d) ) // FIXED BITS (xxxxxxx0xxxxxxxx) + ROM_LOAD( "cg.u31", 0x400000, 0x080000, CRC(808b38d1) SHA1(60cc441d863d26c44c0353770367f2b2ef7c8de7) ) // FIXED BITS (xxxxxxxx0xxxxxxx) 1xxxxxxxxxxxxxxxxxx = 0x00 + + ROM_REGION( 0x200000, "oki", 0 ) + ROM_LOAD( "sp.u5", 0x000000, 0x200000, CRC(4b04e89e) SHA1(4c29381cd272daaa3a3fb627024d25609f8b5f8a) ) // BADADDR --xxxxxxxxxxxxxxxxxxx +ROM_END + +/* +Xìngyùn Pǎo de Kuài +幸运跑的快 +IGS, 2005 + +PCB: IGS PCB-0489-07-FM-1 +IGS027 Sticker: I8 +ROM String: FRI OCT 7 17:22:46 2005 + LUCKY_FASTER + +Oki Clock (from PAL): 2.000MHz [22/11] +Oki Pin 7: Low +*/ + +ROM_START( xypdk ) + ROM_REGION( 0x04000, "maincpu", 0 ) + // Internal ROM of IGS027A type G ARM based MCU + ROM_LOAD( "i8_027a.bin", 0x0000, 0x4000, CRC(af7889a5) SHA1(cd38b79a3e47deb32be779d2d860216d37ee9916) ) + + ROM_REGION32_LE( 0x80000, "user1", 0 ) // external ARM data / prg + ROM_LOAD( "v-306cn.u17", 0x00000, 0x80000, CRC(f78d2a7c) SHA1(84fce4424edb2bd7ccc02f7c937686016ddce21b) ) + + ROM_REGION( 0x80000, "igs017_igs031:tilemaps", 0 ) + ROM_LOAD16_WORD_SWAP( "text.u27", 0x00000, 0x80000, CRC(b2b20a55) SHA1(1e5e883ee588805d68ad9d312f0884a428eff31c) ) + + ROM_REGION( 0x400000, "igs017_igs031:sprites", 0 ) + ROM_LOAD( "cg.u28", 0x000000, 0x400000, CRC(b0835036) SHA1(bae50688ea20572c0d71ff50066b79b6654d9b93) ) // FIXED BITS (xxxxxxx0xxxxxxxx) + + ROM_REGION( 0x200000, "oki", 0 ) + ROM_LOAD( "sp.u5", 0x000000, 0x200000, CRC(e5ba3abe) SHA1(e5d191bcfd8180dde4576523cee3f502b03013c2) ) +ROM_END + ROM_START( extradrw ) // IGS PCB 0326-05-DV-1 ROM_REGION( 0x04000, "maincpu", 0 ) // Internal rom of IGS027A ARM based MCU @@ -3099,6 +3438,40 @@ void igs_m027_state::init_cjddzp() m_igs017_igs031->tarzan_decrypt_sprites(0x400000, 0x400000); } +void igs_m027_state::init_cjddzs() +{ + // extra scrambling applied by CPLD? + uint8_t *rom = memregion("user1")->base(); + std::vector buffer(0x100000); + + memcpy(&buffer[0], rom, 0x100000); + + for (int i = 0; i < 0x100000; i++) + rom[i] = buffer[bitswap<24>(i, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 11, 12, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0)]; + + // the second program seems to also have additional address based XORs + // TODO + + init_cjddz(); +} + +void igs_m027_state::init_cjddzps() +{ + // extra scrambling applied by CPLD? + uint8_t *rom = memregion("user1")->base(); + std::vector buffer(0x100000); + + memcpy(&buffer[0], rom, 0x100000); + + for (int i = 0; i < 0x100000; i++) + rom[i] = buffer[bitswap<24>(i, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 11, 12, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0)]; + + // the second program seems to also have additional address based XORs + // TODO + + init_cjddzp(); +} + void igs_m027_state::init_cjddzlf() { cjddzlf_decrypt(machine()); @@ -3236,6 +3609,21 @@ void igs_m027_state::init_chessc2() ROM2[(0x168/4)] ^= 0x10000000; } +void igs_m027_state::init_tct2p() +{ + tct2p_decrypt(machine()); + m_igs017_igs031->sdwx_gfx_decrypt(); + m_igs017_igs031->tarzan_decrypt_sprites(0x400000, 0x400000); + // the sprite ROM at 0x400000 doesn't require decryption +} + +void igs_m027_state::init_xypdk() +{ + xypdk_decrypt(machine()); + m_igs017_igs031->sdwx_gfx_decrypt(); + m_igs017_igs031->tarzan_decrypt_sprites(0, 0); +} + } // anonymous namespace @@ -3259,6 +3647,7 @@ GAME( 2004, lhzb4dhb, 0, lhzb4, lhzb4, igs_m027_stat GAME( 1999, lthyp, 0, lthyp, lthyp, igs_m027_state, init_lthyp, ROT0, "IGS", "Long Teng Hu Yao Duizhan Jiaqiang Ban (S104CN)", MACHINE_NODEVICE_LAN ) GAME( 2000, zhongguo, 0, zhongguo, zhongguo, igs_m027_state, init_zhongguo, ROT0, "IGS", "Zhongguo Chu Da D (V102C)", 0 ) GAMEL( 2001, jking02, 0, jking02, jking02, igs_m027_state, init_jking02, ROT0, "IGS", "Jungle King 2002 (V209US)", MACHINE_NODEVICE_LAN, layout_jking02 ) // shows V212US in bookkeeping menu +GAME( 2003, tct2p, 0, tct2p, tct2p, igs_m027_state, init_tct2p, ROT0, "IGS", "Tarzan Chuang Tianguan 2 Jiaqiang Ban (V306CN)", 0 ) GAME( 2003, mgzz, 0, mgzz, mgzz101cn, igs_m027_state, init_mgzz, ROT0, "IGS", "Manguan Zhizun (V101CN)", 0 ) GAME( 2003, mgzz100cn, mgzz, mgzz, mgzz100cn, igs_m027_state, init_mgzz, ROT0, "IGS", "Manguan Zhizun (V100CN)", 0 ) GAME( 2007, mgcs3, 0, lhzb4, mgcs3, igs_m027_state, init_mgcs3, ROT0, "IGS", "Manguan Caishen 3 (V101CN)", 0 ) @@ -3269,15 +3658,22 @@ GAMEL( 1999, fruitpar206us, fruitpar, oceanpar, fruitpar206us, igs_m027_stat GAME( 2004, cjddz, 0, cjddz, cjddz, igs_m027_state, init_cjddz, ROT0, "IGS", "Chaoji Dou Dizhu (V219CN)", 0 ) // 2004 date in internal ROM GAME( 2004, cjddz217cn, cjddz, cjddz, cjddz, igs_m027_state, init_cjddz, ROT0, "IGS", "Chaoji Dou Dizhu (V217CN)", 0 ) // 2004 date in internal ROM GAME( 2004, cjddz215cn, cjddz, cjddz, cjddz, igs_m027_state, init_cjddz, ROT0, "IGS", "Chaoji Dou Dizhu (V215CN)", 0 ) // 2004 date in internal ROM +GAME( 2004, cjddz213cn, cjddz, cjddz, cjddz, igs_m027_state, init_cjddz, ROT0, "IGS", "Chaoji Dou Dizhu (V213CN)", MACHINE_NOT_WORKING ) // missing external program ROM. 2004 date in internal ROM GAME( 2004, cjddzp, 0, cjddz, cjddzp, igs_m027_state, init_cjddzp, ROT0, "IGS", "Chaoji Dou Dizhu Jiaqiang Ban (S300CN)", MACHINE_NODEVICE_LAN ) // 2004 date in internal ROM GAME( 2005, cjddzlf, 0, cjddz, cjddz, igs_m027_state, init_cjddzlf, ROT0, "IGS", "Chaoji Dou Dizhu Liang Fu Pai (V109CN)", 0 ) // 2005 date in internal ROM -GAME( 2005, cjtljp, 0, cjtljp, lhzb4, igs_m027_state, init_cjtljp, ROT0, "IGS", "Chaoji Tuolaji Jiaqiang Ban (V206CN)", 0 ) // 2005 date in internal ROM +GAME( 2005, cjtljp, 0, xypdk, lhzb4, igs_m027_state, init_cjtljp, ROT0, "IGS", "Chaoji Tuolaji Jiaqiang Ban (V206CN)", 0 ) // 2005 date in internal ROM +GAME( 2005, xypdk, 0, xypdk, lhzb4, igs_m027_state, init_xypdk, ROT0, "IGS", "Xingyun Pao De Kuai (V106CN)", 0 ) GAMEL( 2007, tripslot, 0, tripslot, tripslot, igs_m027_state, init_tripslot, ROT0, "IGS", "Triple Slot (V200VE)", 0, layout_tripslot ) // 2007 date in internal ROM at least, could be later, default settings password is all 'start 1' // this has a 2nd 8255 GAME( 2001, extradrw, 0, extradrw, base, igs_m027_state, init_extradrw, ROT0, "IGS", "Extra Draw (V100VE)", MACHINE_NOT_WORKING ) // these have an IGS025 protection device instead of the 8255 GAME( 2002, chessc2, 0, chessc2, chessc2, igs_m027_state, init_chessc2, ROT0, "IGS", "Chess Challenge II (ver. 1445A)", MACHINE_NOT_WORKING | MACHINE_UNEMULATED_PROTECTION ) +// these can select between two different games via DIP switch (currently unemulated feature) +GAME( 2007, cjddzs, 0, cjddz, cjddz, igs_m027_state, init_cjddzs, ROT0, "bootleg (WDF)", "Chaoji Dou Dizhu (V219CN) / Chaoji Dou Dizhu Jianan Ban (V302CN)", MACHINE_NOT_WORKING ) +GAME( 2009, cjddzsa, cjddzs, cjddz, cjddz, igs_m027_state, init_cjddzs, ROT0, "bootleg (WDF)", "Chaoji Dou Dizhu (V219CN) / Chaoji Dou Dizhu Jianan Ban (V405CN)", MACHINE_NOT_WORKING ) +GAME( 200?, cjddzps, 0, cjddz, cjddzp, igs_m027_state, init_cjddzps, ROT0, "bootleg (WDF)", "Chaoji Dou Dizhu Jiaqiang Ban (S300CN) / unknown second set", MACHINE_NOT_WORKING ) + // Incomplete dumps GAME( 1999, amazonia, 0, m027_1ppi, amazonia, igs_m027_state, init_amazonia, ROT0, "IGS", "Amazonia King (V104BR)", MACHINE_NOT_WORKING ) GAME( 1999, amazonkp, amazonia, m027_1ppi, amazonia, igs_m027_state, init_amazonia, ROT0, "IGS", "Amazonia King Plus (V204BR)", MACHINE_NOT_WORKING ) diff --git a/src/mame/igs/igs_m027_033vid.cpp b/src/mame/igs/igs_m027_033vid.cpp new file mode 100644 index 0000000000000..e85f8f4266708 --- /dev/null +++ b/src/mame/igs/igs_m027_033vid.cpp @@ -0,0 +1,480 @@ +// license:BSD-3-Clause +// copyright-holders: David Haywood + +/* +IGS ARM7 (IGS027A) based mahjong / gambling platform(s), +with IGS 033 custom video chip. + +Main components for the IGS PCB-0405-02-FZ are: +- IGS 027A (ARM7-based MCU) +- 24 MHz XTAL +- IGS 033 graphics chip +- 82C55 2K15 PPI +- K668 ADPCM chip (M6295 clone) +- 3 banks of 8 DIP switches + +TODO: + - IGS 033 appears to encapsulate the behavior of the video/interface chip found in igspoker.cpp + so could be turned into a device, possibly shared + - complete inputs / outputs / hopper + - huahuas5 needs correct Oki banking +*/ + +#include "emu.h" + +#include "igs027a.h" +#include "pgmcrypt.h" + +#include "machine/i8255.h" +#include "machine/nvram.h" +#include "machine/ticket.h" +#include "machine/timer.h" +#include "sound/okim6295.h" + +#include "emupal.h" +#include "screen.h" +#include "speaker.h" +#include "tilemap.h" + +#include "endianness.h" + +#include + + +// configurable logging +#define LOG_PORTS (1U << 1) + +// #define VERBOSE (LOG_GENERAL | LOG_PORTS) + +#include "logmacro.h" + +#define LOGPORTS(...) LOGMASKED(LOG_PORTS, __VA_ARGS__) + + +namespace { + +class igs_m027_033vid_state : public driver_device +{ +public: + igs_m027_033vid_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), + m_external_rom(*this, "user1"), + m_nvram(*this, "nvram"), + m_maincpu(*this, "maincpu"), + m_screen(*this, "screen"), + m_palette(*this, "palette"), + m_gfxdecode(*this, "gfxdecode"), + m_oki(*this, "oki"), + m_bg_videoram(*this, "bg_videoram"), + m_bg_attr_videoram(*this, "bg_attr_videoram") + { } + + void m027_033vid(machine_config &config) ATTR_COLD; + + void init_huahuas5() ATTR_COLD; + void init_qiji6() ATTR_COLD; + +protected: + virtual void machine_start() override ATTR_COLD; + virtual void video_start() override ATTR_COLD; + +private: + required_region_ptr m_external_rom; + required_shared_ptr m_nvram; + + required_device m_maincpu; + required_device m_screen; + required_device m_palette; + required_device m_gfxdecode; + required_device m_oki; + required_shared_ptr m_bg_videoram; + required_shared_ptr m_bg_attr_videoram; + + u32 m_xor_table[0x100]; + tilemap_t *m_bg_tilemap = nullptr; + u8 m_tilebank = 0; + u8 m_video_enable = 0; + + TIMER_DEVICE_CALLBACK_MEMBER(interrupt); + + TILE_GET_INFO_MEMBER(get_bg_tile_info); + + void bg_videoram_w(offs_t offset, u32 data, u32 mem_mask); + void bg_attr_videoram_w(offs_t offset, u32 data, u32 mem_mask); + + u32 external_rom_r(offs_t offset); + void xor_table_w(offs_t offset, u8 data); + + void out_port_w(u8 data); + u32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + + void m027_map(address_map &map) ATTR_COLD; +}; + + +void igs_m027_033vid_state::machine_start() +{ + std::fill(std::begin(m_xor_table), std::end(m_xor_table), 0); + + save_item(NAME(m_xor_table)); + save_item(NAME(m_tilebank)); + save_item(NAME(m_video_enable)); +} + +void igs_m027_033vid_state::video_start() +{ + m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(igs_m027_033vid_state::get_bg_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); +} + +u32 igs_m027_033vid_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + if (m_video_enable) + m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); + + return 0; +} + +TILE_GET_INFO_MEMBER(igs_m027_033vid_state::get_bg_tile_info) +{ + int tileno = m_bg_videoram[tile_index / 4]; + tileno = tileno >> (8 * (tile_index & 3)) & 0xff; + int attr = m_bg_attr_videoram[tile_index / 4]; + attr = attr >> (8 * (tile_index & 3)) & 0xff; + + tileno |= ((attr & 0x1f) << 8); + + int col = (attr & 0xe0) >> 5; + col <<= 1; // gfx are 4bpp, every other set of colours is unused + + tileno |= (m_tilebank << 13); + + tileinfo.set(0, tileno, col, 0); +} + +// TODO: convert to 8-bit handlers and 8-bit RAM? +void igs_m027_033vid_state::bg_videoram_w(offs_t offset, u32 data, u32 mem_mask) +{ + COMBINE_DATA(&m_bg_videoram[offset]); + m_bg_tilemap->mark_tile_dirty((offset * 4) + 0); + m_bg_tilemap->mark_tile_dirty((offset * 4) + 1); + m_bg_tilemap->mark_tile_dirty((offset * 4) + 2); + m_bg_tilemap->mark_tile_dirty((offset * 4) + 3); +} + +void igs_m027_033vid_state::bg_attr_videoram_w(offs_t offset, u32 data, u32 mem_mask) +{ + COMBINE_DATA(&m_bg_attr_videoram[offset]); + m_bg_tilemap->mark_tile_dirty((offset * 4) + 0); + m_bg_tilemap->mark_tile_dirty((offset * 4) + 1); + m_bg_tilemap->mark_tile_dirty((offset * 4) + 2); + m_bg_tilemap->mark_tile_dirty((offset * 4) + 3); +} + +void igs_m027_033vid_state::out_port_w(u8 data) +{ + if (data & 0xea) + logerror("%s IGS027A out port w: %02X\n", machine().describe_context(), data); + + m_video_enable = BIT(data, 0); + + // TODO: bit 1 seems to be always set by huahuas5 + + m_oki->set_rom_bank(BIT(data, 2)); + + m_tilebank = BIT(data, 4); + + m_bg_tilemap->mark_all_dirty(); +} + + +/*************************************************************************** + + Memory Maps + +***************************************************************************/ + +void igs_m027_033vid_state::m027_map(address_map &map) // TODO: some unknown writes +{ + map(0x0800'0000, 0x0807'ffff).r(FUNC(igs_m027_033vid_state::external_rom_r)); // Game ROM + + map(0x1800'0000, 0x1800'7fff).ram().share(m_nvram); + + map(0x3800'2000, 0x3800'20ff).ram().w(m_palette, FUNC(palette_device::write32)).share("palette"); + map(0x3800'3000, 0x3800'30ff).ram().w(m_palette, FUNC(palette_device::write32_ext)).share("palette_ext"); + + map(0x3800'4000, 0x3800'4003).portr("DSW"); + map(0x3800'5010, 0x3800'5013).umask32(0x0000'00ff).rw("oki", FUNC(okim6295_device::read), FUNC(okim6295_device::write)); + map(0x3800'5030, 0x3800'5033).rw("ppi", FUNC(i8255_device::read), FUNC(i8255_device::write)); + + map(0x3800'7000, 0x3800'77ff).ram().w(FUNC(igs_m027_033vid_state::bg_videoram_w)).share(m_bg_videoram); + map(0x3800'7800, 0x3800'7fff).ram().w(FUNC(igs_m027_033vid_state::bg_attr_videoram_w)).share(m_bg_attr_videoram); + + map(0x4000'0008, 0x4000'000b).nopw(); + map(0x4800'0000, 0x4800'0003).nopw(); + + map(0x5000'0000, 0x5000'03ff).umask32(0x0000'00ff).w(FUNC(igs_m027_033vid_state::xor_table_w)); // uploads XOR table to external ROM here + + map(0x7000'0000, 0x7000'01ff).nopw(); +} + + +/*************************************************************************** + + Input Ports + +***************************************************************************/ + +INPUT_PORTS_START( qiji6 ) // TODO: complete + PORT_START("IN0") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_GAMBLE_D_UP ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_GAMBLE_TAKE ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_GAMBLE_HIGH ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_GAMBLE_LOW ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_GAMBLE_KEYOUT ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) + + PORT_START("IN1") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_POKER_HOLD2 ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_POKER_HOLD1 ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 ) + PORT_SERVICE_NO_TOGGLE( 0x20, IP_ACTIVE_LOW ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_GAMBLE_BET ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) + + PORT_START("IN2") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_POKER_HOLD4 ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_POKER_HOLD3 ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_POKER_HOLD5 ) + 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 ) + + // most settings are done on the software side. Password is all Start + PORT_START("DSW") + PORT_DIPNAME( 0x0000001f, 0x0000001f, "Satellite Machine Number" ) PORT_DIPLOCATION("SW1:1,2,3,4,5") + PORT_DIPSETTING( 0x0000001f, "1" ) + PORT_DIPSETTING( 0x0000001e, "2" ) + PORT_DIPSETTING( 0x0000001d, "3" ) + PORT_DIPSETTING( 0x0000001c, "4" ) + PORT_DIPSETTING( 0x0000001b, "5" ) + PORT_DIPSETTING( 0x0000001a, "6" ) + PORT_DIPSETTING( 0x00000019, "7" ) + PORT_DIPSETTING( 0x00000018, "8" ) + PORT_DIPSETTING( 0x00000017, "9" ) + PORT_DIPSETTING( 0x00000016, "10" ) + PORT_DIPSETTING( 0x00000015, "11" ) + PORT_DIPSETTING( 0x00000014, "12" ) + PORT_DIPSETTING( 0x00000013, "13" ) + PORT_DIPSETTING( 0x00000012, "14" ) + PORT_DIPSETTING( 0x00000011, "15" ) + PORT_DIPSETTING( 0x00000010, "16" ) + PORT_DIPSETTING( 0x0000000f, "17" ) + PORT_DIPSETTING( 0x0000000e, "18" ) + PORT_DIPSETTING( 0x0000000d, "19" ) + PORT_DIPSETTING( 0x0000000c, "20" ) + PORT_DIPSETTING( 0x0000000b, "20 (duplicate)" ) + PORT_DIPSETTING( 0x0000000a, "20 (duplicate)" ) + PORT_DIPSETTING( 0x00000009, "20 (duplicate)" ) + PORT_DIPSETTING( 0x00000008, "20 (duplicate)" ) + PORT_DIPSETTING( 0x00000007, "20 (duplicate)" ) + PORT_DIPSETTING( 0x00000006, "20 (duplicate)" ) + PORT_DIPSETTING( 0x00000005, "20 (duplicate)" ) + PORT_DIPSETTING( 0x00000004, "20 (duplicate)" ) + PORT_DIPSETTING( 0x00000003, "20 (duplicate)" ) + PORT_DIPSETTING( 0x00000002, "20 (duplicate)" ) + PORT_DIPSETTING( 0x00000001, "20 (duplicate)" ) + PORT_DIPSETTING( 0x00000000, "20 (duplicate)" ) + PORT_DIPUNKNOWN_DIPLOC(0x00000020, 0x00000020, "SW1:6") + PORT_DIPUNKNOWN_DIPLOC(0x00000040, 0x00000040, "SW1:7") + PORT_DIPNAME( 0x00000080, 0x00000080, "Link Mode" ) PORT_DIPLOCATION("SW1:8") // Hard-coded? + PORT_DIPSETTING( 0x00000080, "Single Machine" ) + PORT_DIPSETTING( 0x00000000, "Single Machine (duplicate)" ) + PORT_DIPUNKNOWN_DIPLOC(0x00000100, 0x00000100, "SW3:1") + PORT_DIPUNKNOWN_DIPLOC(0x00000200, 0x00000200, "SW3:2") + PORT_DIPUNKNOWN_DIPLOC(0x00000400, 0x00000400, "SW3:3") + PORT_DIPUNKNOWN_DIPLOC(0x00000800, 0x00000800, "SW3:4") + PORT_DIPUNKNOWN_DIPLOC(0x00001000, 0x00001000, "SW3:5") + PORT_DIPUNKNOWN_DIPLOC(0x00002000, 0x00002000, "SW3:6") + PORT_DIPUNKNOWN_DIPLOC(0x00004000, 0x00004000, "SW3:7") + PORT_DIPUNKNOWN_DIPLOC(0x00008000, 0x00008000, "SW3:8") + PORT_DIPNAME( 0x00010000, 0x00000000, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:1") + PORT_DIPSETTING( 0x00010000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00000000, DEF_STR( On ) ) + PORT_DIPUNKNOWN_DIPLOC(0x00020000, 0x00020000, "SW2:2") + PORT_DIPUNKNOWN_DIPLOC(0x00040000, 0x00040000, "SW2:3") + PORT_DIPUNKNOWN_DIPLOC(0x00080000, 0x00080000, "SW2:4") + PORT_DIPUNKNOWN_DIPLOC(0x00100000, 0x00100000, "SW2:5") + PORT_DIPUNKNOWN_DIPLOC(0x00200000, 0x00200000, "SW2:6") + PORT_DIPUNKNOWN_DIPLOC(0x00400000, 0x00400000, "SW2:7") + PORT_DIPUNKNOWN_DIPLOC(0x00800000, 0x00800000, "SW2:8") + PORT_BIT( 0xff000000, IP_ACTIVE_LOW, IPT_UNUSED ) +INPUT_PORTS_END + +INPUT_PORTS_START( huahuas5 ) + PORT_INCLUDE( qiji6 ) + + PORT_MODIFY("DSW") + PORT_DIPNAME( 0x00010000, 0x00010000, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:1") + PORT_DIPSETTING( 0x00000000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00010000, DEF_STR( On ) ) +INPUT_PORTS_END + + +static const gfx_layout tiles8x8x4_layout = +{ + 8, 8, + RGN_FRAC(1,1), + 4, + { 24, 8, 16, 0 }, + { 0, 1, 2, 3, 4, 5, 6, 7 }, + { 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32 }, + 32*8 +}; + +static GFXDECODE_START( igs033 ) + GFXDECODE_ENTRY( "igs033", 0, tiles8x8x4_layout, 0, 16 ) +GFXDECODE_END + +TIMER_DEVICE_CALLBACK_MEMBER(igs_m027_033vid_state::interrupt) +{ + // TODO: which of these are needed, are they always enabled, when do they fire? + int scanline = param; + + if (scanline == 240) + m_maincpu->pulse_input_line(arm7_cpu_device::ARM7_IRQ_LINE, m_maincpu->minimum_quantum_time()); + + if (scanline == 0) + m_maincpu->pulse_input_line(arm7_cpu_device::ARM7_FIRQ_LINE, m_maincpu->minimum_quantum_time()); +} + +/*************************************************************************** + + Machine Drivers + +***************************************************************************/ + +u32 igs_m027_033vid_state::external_rom_r(offs_t offset) +{ + return m_external_rom[offset] ^ m_xor_table[offset & 0x00ff]; +} + +void igs_m027_033vid_state::xor_table_w(offs_t offset, u8 data) +{ + m_xor_table[offset] = (u32(data) << 24) | (u32(data) << 8); +} + +void igs_m027_033vid_state::m027_033vid(machine_config &config) +{ + IGS027A(config, m_maincpu, 24_MHz_XTAL); + m_maincpu->set_addrmap(AS_PROGRAM, &igs_m027_033vid_state::m027_map); + m_maincpu->in_port().set([this] () { LOGPORTS("%s IGS027A in port r\n", machine().describe_context()); return 0xffffffff; }); // TODO: read continuously, what's here? + m_maincpu->out_port().set(FUNC(igs_m027_033vid_state::out_port_w)); + + NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); + + i8255_device &ppi(I8255A(config, "ppi")); + ppi.tri_pa_callback().set_constant(0x00); + ppi.tri_pb_callback().set_constant(0x00); + ppi.tri_pc_callback().set_constant(0x00); + ppi.in_pa_callback().set_ioport("IN0"); + ppi.in_pb_callback().set_ioport("IN1"); + ppi.in_pc_callback().set_ioport("IN2"); + // the out ports seem unused + ppi.out_pa_callback().set([this] (u8 data) { LOGPORTS("%s: PPI port A write %02x\n", machine().describe_context(), data); }); + ppi.out_pb_callback().set([this] (u8 data) { LOGPORTS("%s: PPI port B write %02x\n", machine().describe_context(), data); }); + ppi.out_pc_callback().set([this] (u8 data) { LOGPORTS("%s: PPI port C write %02x\n", machine().describe_context(), data); }); + + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_refresh_hz(60); + m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(1000)); + m_screen->set_size(512, 256); + m_screen->set_visarea(0, 512-1, 0, 256-1); + m_screen->set_screen_update(FUNC(igs_m027_033vid_state::screen_update)); + m_screen->set_palette(m_palette); + + PALETTE(config, m_palette).set_format(palette_device::xBGR_555, 0x100); + m_palette->set_membits(8); + + GFXDECODE(config, m_gfxdecode, "palette", igs033); + + TIMER(config, "scantimer").configure_scanline(FUNC(igs_m027_033vid_state::interrupt), "screen", 0, 1); + + // sound hardware + SPEAKER(config, "mono").front_center(); + + OKIM6295(config, m_oki, 24_MHz_XTAL / 24, okim6295_device::PIN7_HIGH).add_route(ALL_OUTPUTS, "mono", 0.5); // divider and pin 7 not verified +} + + +/*************************************************************************** + + ROMs Loading + +***************************************************************************/ + + +// IGS PCB-0405-02-FZ +// SP and IGS027A ROMs have original labels with '花花世界3', but it seems the external program ROM and GFX ROM got changed +ROM_START( qiji6 ) + ROM_REGION( 0x4000, "maincpu", 0 ) + // Internal rom of IGS027A ARM based MCU + ROM_LOAD( "f8_027a.bin", 0x0000, 0x4000, CRC(4662f015) SHA1(c10889964b675f5c11ea1571332f3eec418c9a28) ) + + ROM_REGION32_LE( 0x80000, "user1", 0 ) // external ARM data / prg + ROM_LOAD( "v118.u12", 0x00000, 0x80000, CRC(c2729fbe) SHA1(2153675a1161bd6aea6367c55fcf801c7fb0dd3a) ) + + ROM_REGION( 0x80000, "igs033", 0 ) + ROM_LOAD( "7e.u20", 0x000000, 0x080000, CRC(8362eeff) SHA1(1babebe872d253d9131131658e701fbf270d42e2) ) + + ROM_REGION( 0x80000, "oki", 0 ) + ROM_LOAD( "sp.3", 0x00000, 0x80000, CRC(06b70fe9) SHA1(5df34f870d32893b5c3095fb9653954209712cdb) ) +ROM_END + +// 花花世界 5 (Huāhuā Shìjiè 5) +// IGS PCB-0405-02-FZ + IGS PCB-0492-00 riser board +ROM_START( huahuas5 ) + ROM_REGION( 0x4000, "maincpu", 0 ) + // Internal rom of IGS027A ARM based MCU + ROM_LOAD( "f11_027a.bin", 0x0000, 0x4000, CRC(f4cacbcf) SHA1(e09f554c1539f37f56d235134754b2a371ea6ad5) ) + + ROM_REGION32_LE( 0x80000, "user1", 0 ) // external ARM data / prg + ROM_LOAD( "v107.u12", 0x00000, 0x80000, CRC(f7b2265a) SHA1(87a5987c39888b18b71675ddfc014a49dab60839) ) + + ROM_REGION( 0x80000, "igs033", 0 ) + ROM_LOAD( "full.u20", 0x000000, 0x080000, CRC(26c30dd7) SHA1(ae53a5986262ce587e414a37e6b3bcb3acec83a5) ) + + ROM_REGION( 0x100000, "oki", 0 ) // on the riser board with a PAL, probably for banking + ROM_LOAD( "fullsp.u3", 0x000000, 0x100000, CRC(25c7a2a8) SHA1(01133bf0b7ef140e3d1608d49d041fd86c90ac94) ) // 1xxxxxxxxxxxxxxxxxxxx = 0x00 + ROM_IGNORE( 0x100000 ) +ROM_END + + +void igs_m027_033vid_state::init_qiji6() +{ + qiji6_decrypt(machine()); +} + +void igs_m027_033vid_state::init_huahuas5() +{ + cjddzlf_decrypt(machine()); +} + +} // anonymous namespace + + +/*************************************************************************** + + Game Drivers + +***************************************************************************/ + +// internal ROM date is 2002, external software revision could be later +GAME( 2002, qiji6, 0, m027_033vid, qiji6, igs_m027_033vid_state, init_qiji6, ROT0, "IGS", "Qiji 6 (V118CN)", MACHINE_NOT_WORKING ) // lacks hopper support +// internal ROM date is 2004, external software revision could be later +GAME( 2004, huahuas5, 0, m027_033vid, huahuas5, igs_m027_033vid_state, init_huahuas5, ROT0, "IGS", "Huahua Shijie 5 (V107CN)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND ) // lacks hopper support, Oki banking diff --git a/src/mame/igs/jackie.cpp b/src/mame/igs/jackie.cpp index 295220390bb1c..cca7af4efcb97 100644 --- a/src/mame/igs/jackie.cpp +++ b/src/mame/igs/jackie.cpp @@ -765,12 +765,12 @@ ROM_START( kungfu ) // IGS PCB N0- 0139 ROM_LOAD( "kungfu-4.u4", 0x40000, 0x20000, CRC(df4afedb) SHA1(56ab18c46a199653c284417a8e9edc9f32374318) ) ROM_REGION( 0x30000, "reels", 0 ) - ROM_LOAD( "kungfu-3.u3", 0x00000, 0x4000, CRC(bbf78e03) SHA1(06fee093e75e2611d00c076c2e0a681938fa8b74) ) - ROM_LOAD( "kungfu-2.u2", 0x10000, 0x4000, CRC(927b3060) SHA1(a780ea5aaee04287cc9533c2d258dc18f8426530) ) + ROM_LOAD( "kungfu-2.u2", 0x00000, 0x4000, CRC(927b3060) SHA1(a780ea5aaee04287cc9533c2d258dc18f8426530) ) + ROM_LOAD( "kungfu-3.u3", 0x10000, 0x4000, CRC(bbf78e03) SHA1(06fee093e75e2611d00c076c2e0a681938fa8b74) ) ROM_LOAD( "kungfu-1.u1", 0x20000, 0x4000, CRC(abaada6b) SHA1(a6b910db7451e8ca737f43f32dfc8fc5ecf865f4) ) ROM_REGION( 0x10000, "gfx3", 0 ) - ROM_LOAD( "kungfu-7.u22", 0x00000, 0x10000, CRC(0568f20b) SHA1(a51a10deee0d581b79d0fee354cedceaa660f55c) ) // 1ST AND 2ND HALF IDENTICAL, but confirmed same data as the kungfua set in igs/igspoker.cpp + ROM_LOAD( "kungfu-7.u22", 0x00000, 0x10000, CRC(0568f20b) SHA1(a51a10deee0d581b79d0fee354cedceaa660f55c) ) // 1ST AND 2ND HALF IDENTICAL, but confirmed same data as the kungfua set in igs/cabaret.cpp ROM_REGION( 0x155, "misc", 0 ) // all labels unreadable ROM_LOAD( "16l8.u31", 0x0000, 0x104, NO_DUMP ) @@ -783,4 +783,4 @@ ROM_END GAME( 1993, jackie, 0, jackie, jackie, jackie_state, init_jackie, ROT0, "IGS", "Happy Jackie (v110U)", MACHINE_SUPPORTS_SAVE ) -GAME( 1992, kungfu, 0, jackie, kungfu, jackie_state, init_kungfu, ROT0, "IGS", "Kung Fu Fighters (IGS, v202N)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) // inputs for the fighting part, incorrect decoding +GAME( 1992, kungfu, 0, jackie, kungfu, jackie_state, init_kungfu, ROT0, "IGS", "Kung Fu Fighters (IGS, v202N)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) // inputs for the fighting part diff --git a/src/mame/igs/pgm.cpp b/src/mame/igs/pgm.cpp index 8e0f543aab8fa..9be1d26923c3d 100644 --- a/src/mame/igs/pgm.cpp +++ b/src/mame/igs/pgm.cpp @@ -1983,7 +1983,7 @@ ROM_START( kovqhsgs ) ROM_IGNORE( 0x400000 ) // c00000-ffffff empty ROM_END -ROM_START( kovqhsgs302 ) // cart with 2010--04--16 main PCB and 2009-09-01 ROM PCB +ROM_START( kovgsyx ) // cart with 2010--04--16 main PCB and 2009-09-01 ROM PCB ROM_REGION( 0x600000, "maincpu", 0 ) /* 68000 Code, on main PCB */ PGM_68K_BIOS ROM_LOAD16_WORD_SWAP( "27c322.u3", 0x100000, 0x400000, CRC(4018559f) SHA1(e7e97ce89e1f563e8e08501ec3c2be6d81107253) ) // V300CN V302CN Dec 29 2010 16:31:32 @@ -5495,8 +5495,7 @@ GAME( 1999, kovsh101, kovsh, pgm_arm_type1, kovsh, pgm_arm_ GAME( 1999, kovsh100, kovsh, pgm_arm_type1, kovsh, pgm_arm_type1_state, init_kovsh, ROT0, "IGS", "Knights of Valour Super Heroes / Sanguo Zhan Ji Fengyun Zaiqi / Sangoku Senki Super Heroes (ver. 100, CN)", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) // 68k: SANGO EX V100 12/06/99 13:36:04, ARM: China internal ROM // 拳皇三国特別版/Quánhuáng sānguó Tèbié bǎn // nasty modern asian bootleg of Knights of Valour Super Heroes with characters ripped from SNK's The King of Fighters series! -GAME( 2008, kovqhsgs, kovsh, pgm_arm_type1, kovsh, pgm_arm_type1_state, init_kovqhsgs, ROT0, "bootleg", "Quanhuang Sanguo Tebie Ban (bootleg of Knights of Valour Super Heroes, V303CN, Nov 21 2008 19:03:49)", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) -GAME( 2010, kovqhsgs302, kovsh, pgm_arm_type1, kovsh, pgm_arm_type1_state, init_kovqhsgs, ROT0, "bootleg", "Quanhuang Sanguo Tebie Ban (bootleg of Knights of Valour Super Heroes, V302CN, Dec 29 2010 16:31:32)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) // needs decryption, actual title is probably different +GAME( 2008, kovqhsgs, kovsh, pgm_arm_type1, kovsh, pgm_arm_type1_state, init_kovqhsgs, ROT0, "bootleg (WDF)", "Quanhuang Sanguo Tebie Ban (bootleg of Knights of Valour Super Heroes, V303CN, Nov 21 2008 19:03:49)", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) //三國戰紀2/Sānguó zhàn jì 2 (Traditional Chinese only in title screen) // region provided by internal ARM rom @@ -5730,3 +5729,5 @@ GAME( 200?, kovlsqh2, kovshp, pgm_arm_type1, kovsh, pgm_arm_ //乱世街霸/Luànshì jiē bà GAME( 200?, kovlsjb, kovshp, pgm_arm_type1, kovsh, pgm_arm_type1_state, init_kovlsqh2, ROT0, "bootleg", "Luanshi Jie Ba (bootleg of Knights of Valour Super Heroes Plus, ver. 200CN, set 1)", MACHINE_IMPERFECT_SOUND | MACHINE_UNEMULATED_PROTECTION | MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) /* need internal rom of IGS027A */ GAME( 200?, kovlsjba, kovshp, pgm_arm_type1, kovsh, pgm_arm_type1_state, init_kovlsqh2, ROT0, "bootleg", "Luanshi Jie Ba (bootleg of Knights of Valour Super Heroes Plus, ver. 200CN, set 2)", MACHINE_IMPERFECT_SOUND | MACHINE_UNEMULATED_PROTECTION | MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) /* need internal rom of IGS027A */ + +GAME( 2010, kovgsyx, kovshp, pgm_arm_type1, kovsh, pgm_arm_type1_state, init_kovqhsgs, ROT0, "bootleg (WDF)", "Gaishi Xingxiong Tebie Ban (bootleg of Knights of Valour Super Heroes Plus, V302CN, Dec 29 2010 16:31:32)", MACHINE_IMPERFECT_SOUND | MACHINE_UNEMULATED_PROTECTION | MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) // needs decryption and IGS027A simulation adaptation diff --git a/src/mame/igs/pgmcrypt.cpp b/src/mame/igs/pgmcrypt.cpp index 5d2d870f26529..63bf3ec1236da 100644 --- a/src/mame/igs/pgmcrypt.cpp +++ b/src/mame/igs/pgmcrypt.cpp @@ -1572,6 +1572,54 @@ void jking02_decrypt(running_machine &machine) } } +// JUN 19 14:13:22 2003 TARZAN_CHINA_V300CN +void tct2p_decrypt(running_machine &machine) +{ + memory_region *const region = machine.root_device().memregion("user1"); + auto const src = util::little_endian_cast(reinterpret_cast(region->base())); + auto const rom_size = region->bytes(); + + for (int i = 0; i < rom_size / 2; i++) + { + uint16_t x = 0; + + IGS27_CRYPT1 + IGS27_CRYPT2 + IGS27_CRYPT3 + IGS27_CRYPT4 + IGS27_CRYPT5_ALT + IGS27_CRYPT6 + IGS27_CRYPT7 + IGS27_CRYPT8 + + src[i] ^= x; + } +} + +// FRI OCT 07 17:22:46 2005 LUCKY_FASTER +void xypdk_decrypt(running_machine &machine) +{ + memory_region *const region = machine.root_device().memregion("user1"); + auto const src = util::little_endian_cast(reinterpret_cast(region->base())); + auto const rom_size = region->bytes(); + + for (int i = 0; i < rom_size / 2; i++) + { + uint16_t x = 0; + + IGS27_CRYPT1_ALT + IGS27_CRYPT2_ALT + IGS27_CRYPT3 + IGS27_CRYPT4 + IGS27_CRYPT5_ALT + IGS27_CRYPT6_ALT + IGS27_CRYPT7_ALT + IGS27_CRYPT8 + + src[i] ^= x; + } +} + static const uint8_t luckycrs_tab[0x100] = { 0x4b, 0x99, 0xa3, 0xa6, 0x69, 0xad, 0xb2, 0x1e, 0x42, 0x9a, 0x02, 0x91, 0x04, 0x90, 0x64, 0xcf, 0x68, 0xe0, 0xa3, 0x8e, 0x1b, 0x53, 0x8d, 0xe6, 0x6f, 0xcd, 0x40, 0x09, 0x42, 0x23, 0xb7, 0x47, @@ -1921,3 +1969,26 @@ void mxsqy_decrypt(running_machine &machine) src[i] ^= x; } } + +void qiji6_decrypt(running_machine &machine) +{ + memory_region *const region = machine.root_device().memregion("user1"); + auto const src = util::little_endian_cast(reinterpret_cast(region->base())); + auto const rom_size = region->bytes(); + + for (int i = 0; i < rom_size / 2; i++) + { + uint16_t x = 0; + + IGS27_CRYPT1_ALT + IGS27_CRYPT2_ALT + IGS27_CRYPT3 + IGS27_CRYPT4 + IGS27_CRYPT5_ALT + IGS27_CRYPT6 + IGS27_CRYPT7 + IGS27_CRYPT8 + + src[i] ^= x; + } +} diff --git a/src/mame/igs/pgmcrypt.h b/src/mame/igs/pgmcrypt.h index a15f3b5ce18ad..4a53249055cd6 100644 --- a/src/mame/igs/pgmcrypt.h +++ b/src/mame/igs/pgmcrypt.h @@ -7,60 +7,63 @@ #pragma once -void pgm_kov_decrypt(running_machine &machine); -void pgm_kovsh_decrypt(running_machine &machine); -void pgm_kov2_decrypt(running_machine &machine); -void pgm_kov2p_decrypt(running_machine &machine); -void pgm_mm_decrypt(running_machine &machine); -void pgm_photoy2k_decrypt(running_machine &machine); -void pgm_py2k2_decrypt(running_machine &machine); -void pgm_pstar_decrypt(running_machine &machine); -void pgm_puzzli2_decrypt(running_machine &machine); -void pgm_theglad_decrypt(running_machine &machine); -void pgm_ddp2_decrypt(running_machine &machine); -void pgm_dfront_decrypt(running_machine &machine); -void pgm_oldsplus_decrypt(running_machine &machine); -void pgm_kovshp_decrypt(running_machine &machine); -void pgm_killbldp_decrypt(running_machine &machine); -void pgm_svg_decrypt(running_machine &machine); -void pgm_svgpcb_decrypt(running_machine &machine); -void pgm_ket_decrypt(running_machine &machine); -void pgm_espgal_decrypt(running_machine &machine); -void pgm_happy6_decrypt(running_machine &machine); -void pgm_dwpc_decrypt(running_machine &machine); -void sdwx_decrypt(running_machine &machine); -void hauntedh_decrypt(running_machine &machine); -void chessc2_decrypt(running_machine &machine); -void klxyj_decrypt(running_machine &machine); -void zhongguo_decrypt(running_machine &machine); -void gonefsh2_decrypt(running_machine &machine); -void cjddz_decrypt(running_machine &machine); -void cjddzp_decrypt(running_machine &machine); -void lhzb4_decrypt(running_machine &machine); -void fearless_decrypt(running_machine &machine); -void superkds_decrypt(running_machine &machine); -void pgm_decrypt_pgm3in1(running_machine &machine); -void slqz3_decrypt(running_machine &machine); -void fruitpar_decrypt(running_machine &machine); -void oceanpar_decrypt(running_machine &machine); -void amazonia_decrypt(running_machine &machine); -void amazoni2_decrypt(running_machine &machine); -void mgzz_decrypt(running_machine &machine); -void mgcs3_decrypt(running_machine &machine); -void crzybugs_decrypt(running_machine &machine); -void crzybugsj_decrypt(running_machine &machine); -void qlgs_decrypt(running_machine &machine); -void jking02_decrypt(running_machine &machine); -void luckycrs_decrypt(running_machine &machine); -void olympic5_decrypt(running_machine &machine); -void icescape_decrypt(running_machine &machine); -void tripfev_decrypt(running_machine &machine); -void wldfruit_decrypt(running_machine &machine); -void lthyp_decrypt(running_machine &machine); -void tripslot_decrypt(running_machine &machine); -void extradrw_decrypt(running_machine &machine); -void cjddzlf_decrypt(running_machine &machine); -void cjtljp_decrypt(running_machine& machine); -void mxsqy_decrypt(running_machine& machine); +void pgm_kov_decrypt(running_machine &machine) ATTR_COLD; +void pgm_kovsh_decrypt(running_machine &machine) ATTR_COLD; +void pgm_kov2_decrypt(running_machine &machine) ATTR_COLD; +void pgm_kov2p_decrypt(running_machine &machine) ATTR_COLD; +void pgm_mm_decrypt(running_machine &machine) ATTR_COLD; +void pgm_photoy2k_decrypt(running_machine &machine) ATTR_COLD; +void pgm_py2k2_decrypt(running_machine &machine) ATTR_COLD; +void pgm_pstar_decrypt(running_machine &machine) ATTR_COLD; +void pgm_puzzli2_decrypt(running_machine &machine) ATTR_COLD; +void pgm_theglad_decrypt(running_machine &machine) ATTR_COLD; +void pgm_ddp2_decrypt(running_machine &machine) ATTR_COLD; +void pgm_dfront_decrypt(running_machine &machine) ATTR_COLD; +void pgm_oldsplus_decrypt(running_machine &machine) ATTR_COLD; +void pgm_kovshp_decrypt(running_machine &machine) ATTR_COLD; +void pgm_killbldp_decrypt(running_machine &machine) ATTR_COLD; +void pgm_svg_decrypt(running_machine &machine) ATTR_COLD; +void pgm_svgpcb_decrypt(running_machine &machine) ATTR_COLD; +void pgm_ket_decrypt(running_machine &machine) ATTR_COLD; +void pgm_espgal_decrypt(running_machine &machine) ATTR_COLD; +void pgm_happy6_decrypt(running_machine &machine) ATTR_COLD; +void pgm_dwpc_decrypt(running_machine &machine) ATTR_COLD; +void sdwx_decrypt(running_machine &machine) ATTR_COLD; +void hauntedh_decrypt(running_machine &machine) ATTR_COLD; +void chessc2_decrypt(running_machine &machine) ATTR_COLD; +void klxyj_decrypt(running_machine &machine) ATTR_COLD; +void zhongguo_decrypt(running_machine &machine) ATTR_COLD; +void gonefsh2_decrypt(running_machine &machine) ATTR_COLD; +void cjddz_decrypt(running_machine &machine) ATTR_COLD; +void cjddzp_decrypt(running_machine &machine) ATTR_COLD; +void lhzb4_decrypt(running_machine &machine) ATTR_COLD; +void fearless_decrypt(running_machine &machine) ATTR_COLD; +void superkds_decrypt(running_machine &machine) ATTR_COLD; +void pgm_decrypt_pgm3in1(running_machine &machine) ATTR_COLD; +void slqz3_decrypt(running_machine &machine) ATTR_COLD; +void fruitpar_decrypt(running_machine &machine) ATTR_COLD; +void oceanpar_decrypt(running_machine &machine) ATTR_COLD; +void amazonia_decrypt(running_machine &machine) ATTR_COLD; +void amazoni2_decrypt(running_machine &machine) ATTR_COLD; +void mgzz_decrypt(running_machine &machine) ATTR_COLD; +void mgcs3_decrypt(running_machine &machine) ATTR_COLD; +void crzybugs_decrypt(running_machine &machine) ATTR_COLD; +void crzybugsj_decrypt(running_machine &machine) ATTR_COLD; +void qlgs_decrypt(running_machine &machine) ATTR_COLD; +void jking02_decrypt(running_machine &machine) ATTR_COLD; +void tct2p_decrypt(running_machine &machine) ATTR_COLD; +void xypdk_decrypt(running_machine &machine) ATTR_COLD; +void luckycrs_decrypt(running_machine &machine) ATTR_COLD; +void olympic5_decrypt(running_machine &machine) ATTR_COLD; +void icescape_decrypt(running_machine &machine) ATTR_COLD; +void tripfev_decrypt(running_machine &machine) ATTR_COLD; +void wldfruit_decrypt(running_machine &machine) ATTR_COLD; +void lthyp_decrypt(running_machine &machine) ATTR_COLD; +void tripslot_decrypt(running_machine &machine) ATTR_COLD; +void extradrw_decrypt(running_machine &machine) ATTR_COLD; +void cjddzlf_decrypt(running_machine &machine) ATTR_COLD; +void cjtljp_decrypt(running_machine& machine) ATTR_COLD; +void mxsqy_decrypt(running_machine& machine) ATTR_COLD; +void qiji6_decrypt(running_machine& machine) ATTR_COLD; #endif // MAME_IGS_PGMCRYPT_H diff --git a/src/mame/igs/spoker.cpp b/src/mame/igs/spoker.cpp index f0a27e7f702db..b6fc10dffb087 100644 --- a/src/mame/igs/spoker.cpp +++ b/src/mame/igs/spoker.cpp @@ -29,7 +29,11 @@ - Verify LEDs and coin counters (should be ok) - 3super8 randomly crashes - 3super8 doesn't have the 8x32 tilemap, change the video emulation accordingly - - jinhulu2 stops at "system is connecting". Some type of link feature? + - jinhulu2 and jinhulu2101is stop at "system is connecting". + Some type of link feature? + - Other games in jinhulu2_state have machine translated DIP definitions which + could use improving and hopper isn't implemented yet. + - Find out password for jinhuang and correct inputs / DIPs. ***************************************************************************/ @@ -39,6 +43,7 @@ #include "cpu/z80/z80.h" #include "machine/i8255.h" #include "machine/nvram.h" +#include "sound/ay8910.h" #include "sound/okim6295.h" #include "sound/ymopl.h" @@ -48,6 +53,16 @@ #include "tilemap.h" +// configurable logging +#define LOG_IGS003 (1U << 1) + +// #define VERBOSE (LOG_GENERAL | LOG_IGS003) + +#include "logmacro.h" + +#define LOGIGS003(...) LOGMASKED(LOG_IGS003, __VA_ARGS__) + + namespace { class spoker_state : public driver_device @@ -66,14 +81,14 @@ class spoker_state : public driver_device m_leds(*this, "led%u", 0U) { } - void spoker(machine_config &config); - void _3super8(machine_config &config); + void spoker(machine_config &config) ATTR_COLD; + void _3super8(machine_config &config) ATTR_COLD; - void init_spk100(); - void init_spk114it(); - void init_spk116it(); - void init_spk120in(); - void init_3super8(); + void init_spk100() ATTR_COLD; + void init_spk114it() ATTR_COLD; + void init_spk116it() ATTR_COLD; + void init_spk120in() ATTR_COLD; + void init_3super8() ATTR_COLD; int hopper_r(); @@ -94,7 +109,7 @@ class spoker_state : public driver_device required_shared_ptr m_fg_color_ram; tilemap_t *m_fg_tilemap = nullptr; - required_ioport_array<5> m_dsw; + optional_ioport_array<5> m_dsw; output_finder<7> m_leds; // common @@ -132,9 +147,9 @@ class spokeru_state : public spoker_state public: using spoker_state::spoker_state; - void spokeru(machine_config &config); + void spokeru(machine_config &config) ATTR_COLD; - void init_spokeru(); + void init_spokeru() ATTR_COLD; protected: virtual void video_start() override ATTR_COLD; @@ -152,16 +167,46 @@ class jinhulu2_state : public spokeru_state { public: jinhulu2_state(const machine_config &mconfig, device_type type, const char *tag) : - spokeru_state(mconfig, type, tag) + spokeru_state(mconfig, type, tag), + m_ymsnd(*this, "ymsnd"), + m_service(*this, "SERVICE"), + m_in1(*this, "IN1") { } - void jinhulu2(machine_config &config); + void jinhuang(machine_config &config)ATTR_COLD; + void jinhulu2(machine_config &config)ATTR_COLD; - void init_jinhulu2(); + void init_dafuwng3() ATTR_COLD; + void init_hsheng2() ATTR_COLD; + void init_huahuas2() ATTR_COLD; + void init_huluw2() ATTR_COLD; + void init_jinhuang() ATTR_COLD; + void init_jinhulu2() ATTR_COLD; + void init_jinhulu2120gi() ATTR_COLD; + void init_jinhulu2101is() ATTR_COLD; + void init_jinhulu2100gi() ATTR_COLD; + void init_sleyuan() ATTR_COLD; + +protected: + virtual void machine_start() override ATTR_COLD; + virtual void video_start() override ATTR_COLD; private: + required_device m_ymsnd; + + required_ioport m_service; + required_ioport m_in1; + + uint8_t m_protection_res = 0; + uint8_t m_input_sel = 0; + void nmi_w(uint8_t data); + uint8_t igs003c_r(); + void igs003c_w(uint8_t data); + + TILE_GET_INFO_MEMBER(get_fg_tile_info); + void jinhuang_portmap(address_map &map) ATTR_COLD; void portmap(address_map &map) ATTR_COLD; }; @@ -215,6 +260,13 @@ TILE_GET_INFO_MEMBER(spoker_state::get_fg_tile_info) tileinfo.set(0, code, (4 * (code >> 14) + 3), 0); } +TILE_GET_INFO_MEMBER(jinhulu2_state::get_fg_tile_info) +{ + int const code = m_fg_tile_ram[tile_index] | ((m_fg_color_ram[tile_index] & 0x1f) << 8); + int const col = ((m_fg_color_ram[tile_index] & 0xe0) >> 5) << 1; + tileinfo.set(0, code, col, 0); +} + void spoker_state::fg_tile_w(offs_t offset, uint8_t data) { m_fg_tile_ram[offset] = data; @@ -257,6 +309,11 @@ void spokeru_state::video_start() m_fg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(spokeru_state::get_fg_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); } +void jinhulu2_state::video_start() +{ + m_fg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(jinhulu2_state::get_fg_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); +} + void jb_state::video_start() { m_fg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(jb_state::get_fg_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); @@ -473,6 +530,33 @@ uint8_t spoker_state::magic_r() return 0; } +uint8_t jinhulu2_state::igs003c_r() +{ + LOGIGS003("PC %06X: Protection read %02x\n", m_maincpu->pc(), m_protection_res); + + return m_protection_res; +} + +void jinhulu2_state::igs003c_w(uint8_t data) +{ + switch (data) + { + // case 0x01: break; // TODO: what does this do? + case 0x02: m_protection_res = ioport("IN0")->read(); break; + case 0x20: m_protection_res = 0x49; break; + case 0x21: m_protection_res = 0x47; break; + case 0x22: m_protection_res = 0x53; break; + case 0x24: m_protection_res = 0x41; break; + case 0x25: m_protection_res = 0x41; break; + case 0x26: m_protection_res = 0x7f; break; + case 0x27: m_protection_res = 0x41; break; + case 0x28: m_protection_res = 0x41; break; + case 0x2a: m_protection_res = 0x3e; break; + case 0x2b: m_protection_res = 0x41; break; + default: LOGIGS003("PC %06X: Protection write %02x\n", m_maincpu->pc(), data); m_protection_res = data; + } +} + /*************************************************************************** Memory Maps @@ -534,19 +618,28 @@ void jinhulu2_state::portmap(address_map &map) map(0x0000, 0x003f).ram(); // Z180 internal regs map(0x2000, 0x20ff).ram().w(m_palette, FUNC(palette_device::write8)).share("palette"); map(0x3000, 0x30ff).ram().w(m_palette, FUNC(palette_device::write8_ext)).share("palette_ext"); - // TODO: the following reads may be hooked to the wrong inputs - map(0x4000, 0x4000).portr("DSW1"); + map(0x4000, 0x4000).portr("DSW3"); map(0x4001, 0x4001).portr("DSW2"); - map(0x4002, 0x4002).portr("DSW3"); - map(0x5001, 0x5001).portr("SERVICE"); + map(0x4002, 0x4002).portr("DSW1"); + map(0x5001, 0x5001).lr8(NAME([this] () -> uint8_t { return m_input_sel ? m_service->read() : m_in1->read(); })); + map(0x5002, 0x5002).w("ymsnd", FUNC(ym2149_device::data_w)); + map(0x5003, 0x5003).lw8(NAME([this] (uint8_t data) { m_input_sel = BIT(data, 0); m_ymsnd->address_w(data); })); map(0x5010, 0x5010).rw("oki", FUNC(okim6295_device::read), FUNC(okim6295_device::write)); - //map(0x5030, 0x5030).w(FUNC()); // TODO: almost surely same protections as seen in igspoker.cpp and igs011.cpp. Probably the IGS003 - //map(0x5031, 0x5031).r(FUNC()); // TODO: " - map(0x5031, 0x5031).w(FUNC(jinhulu2_state::nmi_w)); + map(0x5030, 0x5030).w(FUNC(jinhulu2_state::igs003c_w)); + map(0x5031, 0x5031).r(FUNC(jinhulu2_state::igs003c_r)).w(FUNC(jinhulu2_state::nmi_w)); map(0x7000, 0x77ff).ram().w(FUNC(jinhulu2_state::fg_tile_w)).share(m_fg_tile_ram); map(0x7800, 0x7fff).ram().w(FUNC(jinhulu2_state::fg_color_w)).share(m_fg_color_ram); } +void jinhulu2_state::jinhuang_portmap(address_map &map) +{ + portmap(map); + + map(0x5030, 0x5030).unmapw(); + map(0x5031, 0x5031).unmapr(); + map(0x5032, 0x5032).portr("IN0"); +} + void jb_state::portmap(address_map &map) { spokeru_state::portmap(map); @@ -1240,7 +1333,173 @@ static INPUT_PORTS_START( jb ) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) INPUT_PORTS_END +static INPUT_PORTS_START( jinhulu2 ) // these are verified for v120GI + PORT_START("DSW1") + PORT_DIPNAME( 0x01, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:1") + PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x06, 0x06, "Auto Hold" ) PORT_DIPLOCATION("SW1:2,3") + PORT_DIPSETTING( 0x06, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x04, DEF_STR( On ) ) + PORT_DIPSETTING( 0x02, "Only When Winning" ) + PORT_DIPSETTING( 0x00, "Only When Winning (duplicate)" ) + PORT_DIPNAME( 0x08, 0x08, "Credit Limit" ) PORT_DIPLOCATION("SW1:4") + PORT_DIPSETTING( 0x08, "4000" ) + PORT_DIPSETTING( 0x00, "Unlimited" ) + PORT_DIPNAME( 0x70, 0x70, "Minimum Bet For Bonus" ) PORT_DIPLOCATION("SW1:5,6,7") + PORT_DIPSETTING( 0x70, "1" ) + PORT_DIPSETTING( 0x60, "10" ) + PORT_DIPSETTING( 0x50, "20" ) + PORT_DIPSETTING( 0x40, "50" ) + PORT_DIPSETTING( 0x30, "80" ) + PORT_DIPSETTING( 0x20, "100" ) + PORT_DIPSETTING( 0x10, "120" ) + PORT_DIPSETTING( 0x00, "150" ) + PORT_DIPNAME( 0x80, 0x80, "Card Opening And Scoring Speed" ) PORT_DIPLOCATION("SW1:8") + PORT_DIPSETTING( 0x80, "Slow" ) + PORT_DIPSETTING( 0x00, "Fast" ) + + PORT_START("DSW2") + PORT_DIPNAME( 0x03, 0x03, "Minimum Bet" ) PORT_DIPLOCATION("SW2:1,2") + PORT_DIPSETTING( 0x03, "1" ) + PORT_DIPSETTING( 0x02, "5" ) + PORT_DIPSETTING( 0x01, "10" ) + PORT_DIPSETTING( 0x00, "20" ) + PORT_DIPNAME( 0x1c, 0x1c, "Start Points" ) PORT_DIPLOCATION("SW2:3,4,5") + PORT_DIPSETTING( 0x1c, "10" ) + PORT_DIPSETTING( 0x18, "20" ) + PORT_DIPSETTING( 0x14, "40" ) + PORT_DIPSETTING( 0x10, "50" ) + PORT_DIPSETTING( 0x0c, "100" ) + PORT_DIPSETTING( 0x08, "200" ) + PORT_DIPSETTING( 0x04, "250" ) + PORT_DIPSETTING( 0x00, "500" ) + PORT_DIPNAME( 0x20, 0x20, "Light Points" ) PORT_DIPLOCATION("SW2:6") + PORT_DIPSETTING( 0x20, "10" ) + PORT_DIPSETTING( 0x00, "100" ) + PORT_DIPNAME( 0x40, 0x40, "Double-Up Limit" ) PORT_DIPLOCATION("SW2:7") + PORT_DIPSETTING( 0x40, "5000" ) + PORT_DIPSETTING( 0x00, "7500" ) + PORT_DIPNAME( 0x80, 0x80, "Four Plum Multiplier" ) PORT_DIPLOCATION("SW2:8") + PORT_DIPSETTING( 0x80, "40" ) + PORT_DIPSETTING( 0x00, "60" ) + + PORT_START("DSW3") + PORT_DIPNAME( 0x03, 0x03, "Double-Up Limit Base Number" ) PORT_DIPLOCATION("SW3:1,2") + PORT_DIPSETTING( 0x03, "100" ) + PORT_DIPSETTING( 0x02, "200" ) + PORT_DIPSETTING( 0x01, "300" ) + PORT_DIPSETTING( 0x00, "400" ) + PORT_DIPNAME( 0x0c, 0x0c, "Double-Up Accumulated Jackpot" ) PORT_DIPLOCATION("SW3:3,4") + PORT_DIPSETTING( 0x0c, "300" ) + PORT_DIPSETTING( 0x08, "500" ) + PORT_DIPSETTING( 0x04, "800" ) + PORT_DIPSETTING( 0x00, "1000" ) + PORT_DIPNAME( 0x30, 0x30, "Payout Rate" ) PORT_DIPLOCATION("SW3:5,6") + PORT_DIPSETTING( 0x30, "20000" ) + PORT_DIPSETTING( 0x20, "30000" ) + PORT_DIPSETTING( 0x10, "40000" ) + PORT_DIPSETTING( 0x00, "50000" ) + PORT_DIPNAME( 0x40, 0x40, "Double-Up Card Opening Speed" ) PORT_DIPLOCATION("SW3:7") + PORT_DIPSETTING( 0x40, "Slow" ) + PORT_DIPSETTING( 0x00, "Fast" ) + PORT_DIPNAME( 0x80, 0x80, "Continuous Card Opening" ) PORT_DIPLOCATION("SW3:8") + PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + + PORT_START("IN0") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_POKER_HOLD4 ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN1 ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_POKER_HOLD3 ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_POKER_HOLD5 ) + 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("IN1") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_GAMBLE_KEYOUT ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_GAMBLE_LOW ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_GAMBLE_HIGH ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_GAMBLE_TAKE ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_GAMBLE_D_UP ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) + + PORT_START("SERVICE") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_GAMBLE_BET ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 ) + PORT_SERVICE_NO_TOGGLE( 0x10, IP_ACTIVE_LOW ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_POKER_HOLD1 ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_POKER_HOLD2 ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) +INPUT_PORTS_END + +static INPUT_PORTS_START( huahuas2 ) + PORT_INCLUDE( jinhulu2 ) + + PORT_MODIFY("DSW3") + PORT_DIPNAME( 0x30, 0x30, "Payout Rate" ) PORT_DIPLOCATION("SW3:5,6") + PORT_DIPSETTING( 0x30, "10000" ) + PORT_DIPSETTING( 0x20, "15000" ) + PORT_DIPSETTING( 0x10, "20000" ) + PORT_DIPSETTING( 0x00, "50000" ) +INPUT_PORTS_END + +static INPUT_PORTS_START( huluw2 ) + PORT_INCLUDE( jinhulu2 ) + + PORT_MODIFY("DSW3") + PORT_DIPNAME( 0x30, 0x30, "Payout Rate" ) PORT_DIPLOCATION("SW3:5,6") + PORT_DIPSETTING( 0x30, "10000" ) + PORT_DIPSETTING( 0x20, "15000" ) + PORT_DIPSETTING( 0x10, "20000" ) + PORT_DIPSETTING( 0x00, "30000" ) +INPUT_PORTS_END + +static INPUT_PORTS_START( zuanshiw ) + PORT_INCLUDE( jinhulu2 ) + PORT_MODIFY("DSW1") + PORT_DIPNAME( 0x30, 0x30, "Minimum Bet For Bonus" ) PORT_DIPLOCATION("SW1:5,6") + PORT_DIPSETTING( 0x30, "1" ) + PORT_DIPSETTING( 0x20, "50" ) + PORT_DIPSETTING( 0x10, "100" ) + PORT_DIPSETTING( 0x00, "150" ) + PORT_DIPNAME( 0x40, 0x40, "Card Opening And Scoring Speed" ) PORT_DIPLOCATION("SW1:7") + PORT_DIPSETTING( 0x40, "Slow" ) + PORT_DIPSETTING( 0x00, "Fast" ) + PORT_DIPNAME( 0x80, 0x80, "Take Score Model" ) PORT_DIPLOCATION("SW1:8") + PORT_DIPSETTING( 0x80, "Accumulated Score" ) + PORT_DIPSETTING( 0x00, "Take Score Immediately" ) +INPUT_PORTS_END + +static INPUT_PORTS_START( jinhuang ) + PORT_INCLUDE( jinhulu2 ) + + PORT_MODIFY("IN1") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_GAMBLE_BET ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_GAMBLE_KEYOUT ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_GAMBLE_LOW ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_GAMBLE_HIGH ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_GAMBLE_TAKE ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_GAMBLE_D_UP ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) + + PORT_MODIFY("SERVICE") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN2 ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_GAMBLE_BET ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_POKER_HOLD1 ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_POKER_HOLD2 ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) +INPUT_PORTS_END /*************************************************************************** Graphics Layout & Graphics Decode ***************************************************************************/ @@ -1298,13 +1557,13 @@ static GFXDECODE_START( gfx_3super8 ) GFXDECODE_ENTRY( "gfx2", 0x00000, layout_8x32x6, 0, 16 ) GFXDECODE_END -// TODO: probably correct but to be verified once it passes the connection check +// TODO: bitplane order probably wrong static const gfx_layout layout_8x8x4 = { 8, 8, RGN_FRAC(1, 1), 4, - { STEP4(24, -8) }, + { 24, 8, 16, 0 }, { STEP8(0, 1) }, { STEP8(0, 8*4) }, 8*8*4 @@ -1334,6 +1593,14 @@ void spoker_state::machine_start() save_item(NAME(m_igs_magic)); } +void jinhulu2_state::machine_start() +{ + spoker_state::machine_start(); + + save_item(NAME(m_protection_res)); + save_item(NAME(m_input_sel)); +} + void spoker_state::machine_reset() { m_nmi_ack = 0; @@ -1404,8 +1671,19 @@ void jinhulu2_state::jinhulu2(machine_config &config) spokeru(config); m_maincpu->set_addrmap(AS_IO, &jinhulu2_state::portmap); + m_maincpu->set_clock(12_MHz_XTAL); m_gfxdecode->set_info(gfx_jinhulu2); + + YM2149(config.replace(), "ymsnd", 12_MHz_XTAL / 12).add_route(ALL_OUTPUTS, "mono", 1.0); +} + + +void jinhulu2_state::jinhuang(machine_config &config) +{ + jinhulu2(config); + + m_maincpu->set_addrmap(AS_IO, &jinhulu2_state::jinhuang_portmap); } @@ -1795,45 +2073,53 @@ ROM_END /********************************************************************************* -Jin Hu Lu 2, IGS (year unknown, board dead/rotten, battery leaked EXTENSIVELY and killed it) -This is a Poker game. -Board is a mix of through-hole and surface mounted parts (lots of logic is SMD). -Some chips have year 1999 so this is 1999 or later. - -PCB Layout ----------- - -IGS PCB No- 0202 - : -|--------------------------------------------| -|SW4 BATTERY 12MHz Z180 | -| | -|1 | -|8 T518B PRG.U40| -|W PAL | -|A PAL 6264 | +金葫蘆 II - Jin Hu Lu II, IGS, 1995 (v412GS, Link Version) +金葫蘆 II - Jin Hu Lu II, IGS, 1995 (v120GI, Stand-Alone Version) +These are Poker / Card games. +Board is a mix of through-hole and surface mounted parts (lots of SMD logic). +Hardware Info By Guru +--------------------- + +IGS PCB NO-0202- (for v412GS) +IGS PCB NO-0202-2 (for v120GI) + |------------------------------------------| + | BATT 12MHz P1 | +|-| SW4 Z180 | +|2 | +|2 T518B PRG.U40| +|W TLP521(x20) PAL | +|A PAL 6264*| |Y 2149C PAL | -| PAL SKT | -| IGS-003C | -| | -|1 | -|0 IGS002 | -|W | -|A IGS001A | -|Y VOL 6264 6264 | -| UPC1242 M6295 27C4002.U39| -|7805 SP_U12.U12 SW1 SW2 SW3 | -|--------------------------------------------| +|-| PAL PALx | + | IGS-003C | +|-| ULN2004 | +|1 |------| | +|0 |IGS002| | +|W |-------| |------| | +|A |IGS001A| | +|Y VOL 6264 |-------| 6264 | +|-|UPC1242 M6295 GFX.U39| + | 7805 SP.U12 SW1 SW2 SW3 | + |------------------------------------------| Notes: - 2149C - Might be an 8255 PPI. Definitely not a YM2149 ;-) - Z180 - Zilog Z8018008PSC Z180 MPU. Chip rated at 8MHz so clock input likely to be 6MHz [12/2] - IGS003C - In a socket but marked on PCB as 'ASIC3' (which is unusual) so could be a custom chip and not a ROM? - IGS001/2 - Custom IGS Chip (QFP80) - 6264 - 8kBx8-bit SRAM - SKT - Empty socket, missing PAL maybe? - M6295 - Oki Sound Chip. Clock input possibly 1.000MHz [12/12] - T518B - Reset Chip + 2149C - 2149C - Marked '2149C 9913'. This is a clone YM2149. Clock Input 1.000MHz [12/12] + Z180 - Zilog Z8018008PSC or HD64B180ROP Z180 MPU. Chip rated at 8MHz but crystal input on pin 2 is 12MHz + Clock Out on pin 64 is 6.000MHz + IGS003C - In a socket but marked on PCB as 'ASIC3' (which is unusual). It's an IGS custom chip. + IGS001/002 - Custom IGS Chip (QFP80) + 6264 - 8kB x8-bit SRAM. *=This RAM is battery-backed. + M6295 - OKI M6295 4-Channel ADPCM Voice Synthesis LSI. Clock Input 1.000MHz [12/12]. Pin 7 HIGH. + T518B - Mitsumi T518B Reset Chip + ULN2004 - ULN2004 7-Channel Darlington Transistor Array SW1/2/3 - 8-Position DIP Switch - SP_U12.U12 - OKI Samples. Board printed '27C020' but actual chip is Intel FLASH P28F001 + SW4 - Toggle Switch for NVRAM Clear and Reset + PAL - These PALs match on both boards. + PALx - This PAL is different on both boards (i.e. game-specific) + P1 - 4-Pin Link Connector + BATT - 3.6V Ni-Cad Battery + PRG.U40 - 27C512 EPROM (main program) + GFX.U39 - 27C4002 or 27C4096 EPROM (Graphics/Tiles) + SP.U12 - OKI Samples. Board printed '27C020' but actual chip is Intel FLASH P28F001 *********************************************************************************/ @@ -1849,6 +2135,131 @@ ROM_START( jinhulu2 ) ROM_LOAD( "sp_u12.u12", 0x00000, 0x20000, CRC(1aeb078c) SHA1(9b8a256f51e66733c4ec30b451ca0711ed02318e) ) ROM_END +ROM_START( jinhulu2120gi ) + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "prg.u40", 0x00000, 0x10000, CRC(379a2965) SHA1(fbff8a6a3b378cac116d8c630082fc866f85ac6b) ) + + ROM_REGION( 0x40000, "tiles", 0 ) + ROM_LOAD( "gfx.u39", 0x00000, 0x40000, CRC(d5bc6a5d) SHA1(26b83229e4a2b2502f1e9af31c71872d7d12bf93) ) // 1xxxxxxxxxxxxxxxxxx = 0xFF + ROM_IGNORE( 0x40000 ) + + ROM_REGION( 0x40000, "oki", 0 ) + ROM_LOAD( "sp.u12", 0x00000, 0x20000, CRC(1aeb078c) SHA1(9b8a256f51e66733c4ec30b451ca0711ed02318e) ) // same as jinhulu2 +ROM_END + +ROM_START( jinhulu2101is ) // this sports an IGS033 instead of the IGS001/002 combo + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "rom.u15", 0x00000, 0x10000, CRC(5fccf97f) SHA1(71f4c58baf1461b4c1a24d718ad372cb5dcdf970) ) + + ROM_REGION( 0x200000, "tiles", 0 ) + ROM_LOAD( "t3101.u9", 0x000000, 0x200000, CRC(9057ebf9) SHA1(afd2cebdac572689c01a5bfe5e16a26d2366f922) ) + + ROM_REGION( 0x40000, "oki", 0 ) + ROM_LOAD( "rom.u16", 0x00000, 0x20000, CRC(1aeb078c) SHA1(9b8a256f51e66733c4ec30b451ca0711ed02318e) ) // same as jinhulu2 +ROM_END + +ROM_START( jinhulu2100gi ) + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "rom.u40", 0x00000, 0x10000, CRC(d145f44c) SHA1(431d8be7e213d2995474867a9d42ea09763a6725) ) + + ROM_REGION( 0x40000, "tiles", 0 ) + ROM_LOAD( "rom.u39", 0x00000, 0x40000, CRC(147d790f) SHA1(c9c7a2788630fcc67e14b40934d118a57f67812e) ) + + ROM_REGION( 0x40000, "oki", 0 ) + ROM_LOAD( "rom.u12", 0x00000, 0x20000, CRC(1aeb078c) SHA1(9b8a256f51e66733c4ec30b451ca0711ed02318e) ) +ROM_END + +ROM_START( huahuas2a ) // this, too, sports an IGS033 instead of the IGS001/002 combo + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "rom.u15", 0x00000, 0x10000, CRC(318489c3) SHA1(c00f5f16308da5a813045c319bec8e275155642d) ) + + ROM_REGION( 0x200000, "tiles", 0 ) + ROM_LOAD( "t3101.u9", 0x000000, 0x200000, CRC(9057ebf9) SHA1(afd2cebdac572689c01a5bfe5e16a26d2366f922 ) ) + + ROM_REGION( 0x40000, "oki", 0 ) + ROM_LOAD( "rom.u16", 0x00000, 0x20000, CRC(1aeb078c) SHA1(9b8a256f51e66733c4ec30b451ca0711ed02318e) ) // same as jinhulu2 +ROM_END + +ROM_START( huahuas2 ) + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "rom.u40", 0x00000, 0x10000, CRC(d014eb7a) SHA1(7433c96e847015c7abe6a47683f9fad5f224b9fe) ) + + ROM_REGION( 0x40000, "tiles", 0 ) + ROM_LOAD( "rom.u39", 0x00000, 0x40000, CRC(a5dcd575) SHA1(e11e8b699253060c6c70df5c6b0e3e9573ec8b1e) ) // 1ST AND 2ND HALF IDENTICAL + ROM_IGNORE( 0x40000 ) + + ROM_REGION( 0x40000, "oki", 0 ) + ROM_LOAD( "rom.u12", 0x00000, 0x20000, CRC(1aeb078c) SHA1(9b8a256f51e66733c4ec30b451ca0711ed02318e) ) +ROM_END + +// 葫蘆王 II +ROM_START( huluw2 ) + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "rom.u40", 0x00000, 0x10000, CRC(1e1081be) SHA1(05fd128aa6090ab8591be7917b0c631348e0f8dd) ) + + ROM_REGION( 0x40000, "tiles", 0 ) + ROM_LOAD( "rom.u39", 0x00000, 0x40000, CRC(147d790f) SHA1(c9c7a2788630fcc67e14b40934d118a57f67812e) ) + + ROM_REGION( 0x40000, "oki", 0 ) + ROM_LOAD( "rom.u12", 0x00000, 0x20000, CRC(1aeb078c) SHA1(9b8a256f51e66733c4ec30b451ca0711ed02318e) ) +ROM_END + +ROM_START( hsheng2 ) + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "rom.u40", 0x00000, 0x10000, CRC(12e7afb9) SHA1(207ea29627d4fa4b8a1b0eb515a024a38a549f5f) ) + + ROM_REGION( 0x40000, "tiles", 0 ) + ROM_LOAD( "rom.u39", 0x00000, 0x40000, CRC(ad81652e) SHA1(a6f452288bba34320c1c7ad87c6f9ebfb0a75f0c) ) // 1xxxxxxxxxxxxxxxxxx = 0xFF + ROM_IGNORE( 0x40000 ) + + ROM_REGION( 0x40000, "oki", 0 ) + ROM_LOAD( "rom.u12", 0x00000, 0x20000, CRC(1aeb078c) SHA1(9b8a256f51e66733c4ec30b451ca0711ed02318e) ) +ROM_END + +ROM_START( dafuwng3 ) + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "rom.u40", 0x00000, 0x10000, CRC(09867af9) SHA1(c8e194af698d2c6a63e6a95b5f1585af57c96d47) ) + + ROM_REGION( 0x40000, "tiles", 0 ) + ROM_LOAD( "rom.u39", 0x00000, 0x40000, CRC(92255c58) SHA1(b010f854fb06f0ef312cf62fdb1333a9fd777f45) ) + + ROM_REGION( 0x40000, "oki", 0 ) + ROM_LOAD( "rom.u12", 0x00000, 0x20000, CRC(1aeb078c) SHA1(9b8a256f51e66733c4ec30b451ca0711ed02318e) ) +ROM_END + +ROM_START( zuanshiw ) + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "rom.u40", 0x00000, 0x10000, CRC(7178bdae) SHA1(ec8c31bf0f26b3806442d1620b02571e114b5563) ) + + ROM_REGION( 0x40000, "tiles", 0 ) + ROM_LOAD( "rom.u39", 0x00000, 0x40000, CRC(4df9e869) SHA1(bb659a32d94d7e848e70679603129fa894631f4b) ) + + ROM_REGION( 0x40000, "oki", 0 ) + ROM_LOAD( "rom.u12", 0x00000, 0x20000, CRC(1aeb078c) SHA1(9b8a256f51e66733c4ec30b451ca0711ed02318e) ) +ROM_END + +ROM_START( jinhuang ) // IGS PCB NO-0202-4. Has seemingly unused IGS 003e chip and P8255A-5 instead of the 2149C + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "rom.u40", 0x00000, 0x10000, CRC(a453d1c8) SHA1(2acc96c3d0ad6d09fffc9be40ef0790beebcbac9) ) + + ROM_REGION( 0x40000, "tiles", 0 ) + ROM_LOAD( "rom.u39", 0x00000, 0x40000, CRC(7046b731) SHA1(763bb556e37f60d37894119bfa3bfddde0366f71) ) + + ROM_REGION( 0x40000, "oki", 0 ) + ROM_LOAD( "rom.u12", 0x00000, 0x20000, CRC(27caf888) SHA1(be57ce7f6b32a51656f8f16b894f58278544201a) ) // 1ST AND 2ND HALF IDENTICAL +ROM_END + +ROM_START( sleyuan ) + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "rom.u40", 0x00000, 0x10000, CRC(869a2ff7) SHA1(beb110eecf6c8c2f5d5272e0669391f73766d463) ) + + ROM_REGION( 0x40000, "tiles", 0 ) + ROM_LOAD( "rom.u39", 0x00000, 0x40000, CRC(d7e7ba5a) SHA1(0c5b5e6e2b48a2affef4c9e36a14d1fbd829116d) ) + + ROM_REGION( 0x40000, "oki", 0 ) + ROM_LOAD( "rom.u12", 0x00000, 0x20000, CRC(1aeb078c) SHA1(9b8a256f51e66733c4ec30b451ca0711ed02318e) ) +ROM_END + /*************************************************************************** Driver Init ***************************************************************************/ @@ -1892,6 +2303,106 @@ void jinhulu2_state::init_jinhulu2() } +void jinhulu2_state::init_jinhulu2120gi() +{ + init_jinhulu2(); + + uint8_t *rom = memregion("maincpu")->base(); + + // extra layer + for (int a = 0; a < 0xf000; a++) + if ((a & 0x0280) == 0x0200) rom[a] ^= 0x40; +} + +void jinhulu2_state::init_jinhulu2101is() +{ + init_jinhulu2(); + + uint8_t *rom = memregion("maincpu")->base(); + + // extra layer + for (int a = 0; a < 0xf000; a++) + if ((a & 0x0220) == 0x0200) rom[a] ^= 0x40; +} + +void jinhulu2_state::init_jinhulu2100gi() +{ + init_jinhulu2120gi(); + + // TODO: hack! Investigate what's going on. + uint8_t *rom = memregion("maincpu")->base(); + + rom[0x00] = rom[0x0f]; + rom[0x01] = rom[0x10]; + rom[0x02] = rom[0x11]; +} + +void jinhulu2_state::init_huahuas2() +{ + init_jinhulu2(); + + uint8_t *rom = memregion("maincpu")->base(); + + // extra layer + for (int a = 0; a < 0xf000; a++) + if ((a & 0x0210) == 0x0210) rom[a] ^= 0x40; +} + +void jinhulu2_state::init_huluw2() +{ + init_jinhulu2(); + + uint8_t *rom = memregion("maincpu")->base(); + + // extra layer + for (int a = 0; a < 0xf000; a++) + if ((a & 0x0140) == 0x0000) rom[a] ^= 0x40; +} + +void jinhulu2_state::init_hsheng2() +{ + init_jinhulu2(); + + uint8_t *rom = memregion("maincpu")->base(); + + // extra layer + for (int a = 0; a < 0xf000; a++) + if ((a & 0x0220) == 0x0020) rom[a] ^= 0x40; +} + +void jinhulu2_state::init_dafuwng3() +{ + init_jinhulu2(); + + uint8_t *rom = memregion("maincpu")->base(); + + // extra layer + for (int a = 0; a < 0xf000; a++) + if ((a & 0x0060) == 0x0060) rom[a] ^= 0x40; +} + +void jinhulu2_state::init_sleyuan() +{ + init_jinhulu2(); + + uint8_t *rom = memregion("maincpu")->base(); + + // extra layer + for (int a = 0; a < 0xf000; a++) + if ((a & 0x00a0) == 0x0020) rom[a] ^= 0x40; +} + +void jinhulu2_state::init_jinhuang() +{ + init_jinhulu2(); + + uint8_t *rom = memregion("maincpu")->base(); + + // extra layer + for (int a = 0; a < 0xf000; a++) + if ((a & 0x0300) != 0x0100) rom[a] ^= 0x40; +} + void spoker_state::init_spk116it() { uint8_t *rom = memregion("maincpu")->base(); @@ -1987,22 +2498,33 @@ void spoker_state::init_3super8() Game Drivers ***************************************************************************/ -// YEAR NAME PARENT MACHINE INPUT STATE INIT ROT COMPANY FULLNAME FLAGS -GAME( 1996, spk306us, 0, spokeru, spoker, spokeru_state, init_spokeru, ROT0, "IGS", "Super Poker (v306US)", MACHINE_SUPPORTS_SAVE ) -GAME( 1996, spk205us, spk306us, spokeru, spoker, spokeru_state, init_spokeru, ROT0, "IGS", "Super Poker (v205US)", MACHINE_SUPPORTS_SAVE ) -GAME( 1996, spk203us, spk306us, spokeru, spk203us, spokeru_state, init_spokeru, ROT0, "IGS", "Super Poker (v203US)", MACHINE_SUPPORTS_SAVE ) // LS1. 8 203US in test mode -GAME( 1996, spk201ua, spk306us, spokeru, spk201ua, spokeru_state, init_spokeru, ROT0, "IGS", "Super Poker (v201UA)", MACHINE_SUPPORTS_SAVE ) // still shows 200UA in test mode -GAME( 1996, spk200ua, spk306us, spokeru, spk200ua, spokeru_state, init_spokeru, ROT0, "IGS", "Super Poker (v200UA)", MACHINE_SUPPORTS_SAVE ) -GAME( 1996, spk200, spk306us, spoker, spk100, spoker_state, init_spk100, ROT0, "IGS", "Super Poker (v200)", MACHINE_SUPPORTS_SAVE ) -GAME( 1996, spk130, spk306us, spoker, spk130, spoker_state, init_spk100, ROT0, "IGS", "Super Poker (v130)", MACHINE_SUPPORTS_SAVE ) -GAME( 1996, spk120in, spk306us, spoker, spoker, spoker_state, init_spk120in, ROT0, "IGS", "Super Poker (v120IN)", MACHINE_SUPPORTS_SAVE ) -GAME( 1996, spk116it, spk306us, spoker, spoker, spoker_state, init_spk116it, ROT0, "IGS", "Super Poker (v116IT)", MACHINE_SUPPORTS_SAVE ) -GAME( 1996, spk116itmx, spk306us, spoker, spoker, spoker_state, init_spk114it, ROT0, "IGS", "Super Poker (v116IT-MX)", MACHINE_SUPPORTS_SAVE ) -GAME( 1996, spk115it, spk306us, spoker, spoker, spoker_state, init_spk116it, ROT0, "IGS", "Super Poker (v115IT)", MACHINE_SUPPORTS_SAVE ) -GAME( 1996, spk114it, spk306us, spoker, spk114it, spoker_state, init_spk114it, ROT0, "IGS", "Super Poker (v114IT)", MACHINE_SUPPORTS_SAVE ) -GAME( 1996, spk102ua, spk306us, spokeru, spk102ua, spokeru_state, init_spokeru, ROT0, "IGS", "Super Poker (v102UA)", MACHINE_SUPPORTS_SAVE ) -GAME( 1996, spk102u, spk306us, spoker, spk102ua, spoker_state, init_spk100, ROT0, "IGS", "Super Poker (v102U)", MACHINE_SUPPORTS_SAVE ) -GAME( 1996, spk100, spk306us, spoker, spk100, spoker_state, init_spk100, ROT0, "IGS", "Super Poker (v100)", MACHINE_SUPPORTS_SAVE ) -GAME( 1993?, 3super8, 0, _3super8, 3super8, spoker_state, init_3super8, ROT0, "", "3 Super 8 (Italy)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) // ROMs are badly dumped -GAME( 1997, jbell, 0, jb, jb, jb_state, init_spokeru, ROT0, "IGS", "Jingle Bell (v200US)", MACHINE_SUPPORTS_SAVE ) -GAME( 1995, jinhulu2, 0, jinhulu2, spoker, jinhulu2_state, init_jinhulu2, ROT0, "IGS", "Jin Hu Lu 2 (v412GS)", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) // tries to link to something? +// YEAR NAME PARENT MACHINE INPUT STATE INIT ROT COMPANY FULLNAME FLAGS +GAME( 1996, spk306us, 0, spokeru, spoker, spokeru_state, init_spokeru, ROT0, "IGS", "Super Poker (v306US)", MACHINE_SUPPORTS_SAVE ) +GAME( 1996, spk205us, spk306us, spokeru, spoker, spokeru_state, init_spokeru, ROT0, "IGS", "Super Poker (v205US)", MACHINE_SUPPORTS_SAVE ) +GAME( 1996, spk203us, spk306us, spokeru, spk203us, spokeru_state, init_spokeru, ROT0, "IGS", "Super Poker (v203US)", MACHINE_SUPPORTS_SAVE ) // LS1. 8 203US in test mode +GAME( 1996, spk201ua, spk306us, spokeru, spk201ua, spokeru_state, init_spokeru, ROT0, "IGS", "Super Poker (v201UA)", MACHINE_SUPPORTS_SAVE ) // still shows 200UA in test mode +GAME( 1996, spk200ua, spk306us, spokeru, spk200ua, spokeru_state, init_spokeru, ROT0, "IGS", "Super Poker (v200UA)", MACHINE_SUPPORTS_SAVE ) +GAME( 1996, spk200, spk306us, spoker, spk100, spoker_state, init_spk100, ROT0, "IGS", "Super Poker (v200)", MACHINE_SUPPORTS_SAVE ) +GAME( 1996, spk130, spk306us, spoker, spk130, spoker_state, init_spk100, ROT0, "IGS", "Super Poker (v130)", MACHINE_SUPPORTS_SAVE ) +GAME( 1996, spk120in, spk306us, spoker, spoker, spoker_state, init_spk120in, ROT0, "IGS", "Super Poker (v120IN)", MACHINE_SUPPORTS_SAVE ) +GAME( 1996, spk116it, spk306us, spoker, spoker, spoker_state, init_spk116it, ROT0, "IGS", "Super Poker (v116IT)", MACHINE_SUPPORTS_SAVE ) +GAME( 1996, spk116itmx, spk306us, spoker, spoker, spoker_state, init_spk114it, ROT0, "IGS", "Super Poker (v116IT-MX)", MACHINE_SUPPORTS_SAVE ) +GAME( 1996, spk115it, spk306us, spoker, spoker, spoker_state, init_spk116it, ROT0, "IGS", "Super Poker (v115IT)", MACHINE_SUPPORTS_SAVE ) +GAME( 1996, spk114it, spk306us, spoker, spk114it, spoker_state, init_spk114it, ROT0, "IGS", "Super Poker (v114IT)", MACHINE_SUPPORTS_SAVE ) +GAME( 1996, spk102ua, spk306us, spokeru, spk102ua, spokeru_state, init_spokeru, ROT0, "IGS", "Super Poker (v102UA)", MACHINE_SUPPORTS_SAVE ) +GAME( 1996, spk102u, spk306us, spoker, spk102ua, spoker_state, init_spk100, ROT0, "IGS", "Super Poker (v102U)", MACHINE_SUPPORTS_SAVE ) +GAME( 1996, spk100, spk306us, spoker, spk100, spoker_state, init_spk100, ROT0, "IGS", "Super Poker (v100)", MACHINE_SUPPORTS_SAVE ) +GAME( 1993?, 3super8, 0, _3super8, 3super8, spoker_state, init_3super8, ROT0, "", "3 Super 8 (Italy)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) // ROMs are badly dumped +GAME( 1997, jbell, 0, jb, jb, jb_state, init_spokeru, ROT0, "IGS", "Jingle Bell (v200US)", MACHINE_SUPPORTS_SAVE ) +GAME( 1995, jinhulu2, 0, jinhulu2, jinhulu2, jinhulu2_state, init_jinhulu2, ROT0, "IGS", "Jin Hu Lu II (v412GS)", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) // tries to link to something? +GAME( 1995, jinhulu2120gi, jinhulu2, jinhulu2, jinhulu2, jinhulu2_state, init_jinhulu2120gi, ROT0, "IGS", "Jin Hu Lu II (v120GI)", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) // hopper +GAME( 1996, jinhulu2101is, jinhulu2, jinhulu2, jinhulu2, jinhulu2_state, init_jinhulu2101is, ROT0, "IGS", "Jin Hu Lu II (v101IS)", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) // tries to link to something? +GAME( 1995, jinhulu2100gi, jinhulu2, jinhulu2, jinhulu2, jinhulu2_state, init_jinhulu2100gi, ROT0, "IGS", "Jin Hu Lu II (v100GI)", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) // hopper, ROM patch +GAME( 1995, huahuas2, 0, jinhulu2, huahuas2, jinhulu2_state, init_huahuas2, ROT0, "IGS", "Huahua Shijie II (v100FI, set 1)", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) // hopper +GAME( 1995, huahuas2a, huahuas2, jinhulu2, jinhulu2, jinhulu2_state, init_jinhulu2120gi, ROT0, "IGS", "Huahua Shijie II (v100FI, set 2)", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) // no GFX ROM dump, hopper +GAME( 1995, huluw2, 0, jinhulu2, huluw2, jinhulu2_state, init_huluw2, ROT0, "IGS", "Hu Lu Wang II (v100KI)", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) // hopper +GAME( 1995, hsheng2, 0, jinhulu2, jinhulu2, jinhulu2_state, init_hsheng2, ROT0, "IGS", "Hua Shen II (v120DI)", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) // hopper +GAME( 1995, dafuwng3, 0, jinhulu2, jinhulu2, jinhulu2_state, init_dafuwng3, ROT0, "IGS", "Da Fu Weng III (V130LI)", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) // hopper +GAME( 1996, zuanshiw, 0, jinhulu2, zuanshiw, jinhulu2_state, init_jinhulu2120gi, ROT0, "IGS", "Zuanshi Wutai (V110II)", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) // hopper +GAME( 2002, jinhuang, 0, jinhuang, jinhuang, jinhulu2_state, init_jinhuang, ROT0, "IGS", "Jin Huang Guan", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) // different memory map +GAME( 1998, sleyuan, 0, jinhulu2, jinhulu2, jinhulu2_state, init_sleyuan, ROT0, "IGS", "Shuiguo Leyuan (V150UI)", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) // hopper diff --git a/src/mame/igt/drw80pkr.cpp b/src/mame/igt/drw80pkr.cpp index 08c3e347e4e0a..a7adaac37ec22 100644 --- a/src/mame/igt/drw80pkr.cpp +++ b/src/mame/igt/drw80pkr.cpp @@ -1,36 +1,133 @@ // license:BSD-3-Clause -// copyright-holders:Jim Stolis -/********************************************************************************** +// copyright-holders: Jim Stolis, Roberto Fresca, Grull Osgo +/******************************************************************************************************* + DRAW 80 POKER + Sircoma / IGT - DRAW 80 POKER + Driver by Jim Stolis, Roberto Fresca & Grull Osgo. - Driver by Jim Stolis. + --- Technical Notes --- - --- Technical Notes --- + Name: Draw 80 Poker + Company: IGT - International Game Technology + Year: 1982 - Name: Draw 80 Poker - Company: IGT - International Game Technology - Year: 1982 + Hardware: - Hardware: + CPU = INTEL 8039 ; Intel MCS-48 family of 8-bit microcontrollers + VIDEO = SYS 6545 ; CRTC M6845 compatible + SND = AY-3-8912 ; AY8910 compatible - CPU = INTEL 8039 ; I8039 compatible - VIDEO = SYS 6545 ; CRTC6845 compatible - SND = AY-3-8912 ; AY8910 compatible + History: - History: + This is one of the first video machines produced by IGT. Originally, the + company was called SIRCOMA and was founded in 1979. It became a public + company in 1981 and changed its name to IGT. - This is one of the first video machines produced by IGT. Originally, the - company was called SIRCOMA and was founded in 1979. It became a public - company in 1981 and changed its name to IGT. -***********************************************************************************/ + Coinage: + + DSW#3 OFF ON OFF ON + DSW#4 OFF OFF ON ON + + Coin1 1 3 5 10 + A/S/H 4+4 12+12 20+20 40+40 + G 20+4 60+12 100+20 200+40 + + +******************************************************************************************************** + + Notes by game: + ------------- + + * Draw 80 Poker: + + Draw 80 Poker challenges even the most skilled players with a computerized dealer. Each hand + offers players the choice to stand pat, discard, and draw from a reshuffled deck. Players can + wager one to eight coins or skill points per hand. + + Draw 80 Poker where excitement, reliability, and the potential for earnings come together + in a thrilling experience. + + Please note: The operation of these games and their features may be subject to state and local + laws or regulations. This content is not intended to solicit the sale or operation of these + games in jurisdictions where such activities are not legally permitted. + + + Features: + + - Available in 13" color screen or 19" b/w screen. + - Microprocessor based circuitry with back-up battery for memory. + - High security cash box system (optional). + - Multiply coin entry, single coin option. + - Keyed reset for anti-cheat override. + - Ticket or token dispenser (optional, check local law). + - Credit register. + - Cashbox door. + - Dual coin entry. + - Star-point button switches. + + + * Wild 1 (Quick Change Kit): + + The IGT Drop In Amusement is a compact, versatile video unit designed for easy installation + on bar tops, cocktail tables, or virtually any flat horizontal surface. It offers the exciting + benefit of having all the Quick Change games in a single unit. + + Servicing and game conversions can be done without removing the Drop In Amusement from its location, + making it incredibly convenient. Turn unused space into a profitable opportunity with this innovative + solution. + + +******************************************************************************************************** + + Updates [2025-02-24] + + - Added the DIP switch via AY8910. + - Battery sensor through T1 line. + - Rewrite the input system for players. + - Improved coin inputs. + - Added and documented the DIP switches fuctionalities. + - Lamps support. + - Mech Counters support. + - Added hopper device. + - Added default init for video memory. + - Fixed a bug in read NVRAM decode. + - Added AY-8910 callback for the DIP switch. + - Added support for Wild 1 cocktail mode. + - Added button-lamps clickable layout for both games. + - System is playable with almost complete functionality. + + Updates [2025-02-27] + + - Fixed inputs polarity: No more credits triggered at reset. + - Found the "Pair of Aces" DIP switch. + - Fixed hopper DIP switch polarity. + - Fixed hopper coin out signal. + - Reverse-engineered the whole DIP switches bank. + - Rewrote I/O handlers to simplify the if/then nested scheme toward switch statements. + - Reworked coin inputs per game. + - Promoted Draw 80 Poker (Minn) to working. + - Promoted Wild 1 (Quick Change Kit) to working. + + + TODO: + + - Support for the IGT ABC type coin acceptor. + - Reverse and find the unknown port access via P1.5 and P1.2. + - Find the coin lock line for documentation. + - Find if there is a diverter or weight sensor line. + - Reverse the behaviour of the port line access called "attract mode". + + +*******************************************************************************************************/ #include "emu.h" #include "cpu/mcs48/mcs48.h" #include "machine/nvram.h" +#include "machine/ticket.h" #include "video/mc6845.h" #include "sound/ay8910.h" #include "emupal.h" @@ -38,6 +135,8 @@ #include "speaker.h" #include "tilemap.h" +#include "drw80pkr.lh" + namespace { @@ -50,7 +149,10 @@ class drw80pkr_state : public driver_device m_gfxdecode(*this, "gfxdecode"), m_crtc(*this, "crtc"), m_aysnd(*this, "aysnd"), - m_mainbank(*this, "mainbank") + m_mainbank(*this, "mainbank"), + m_hopper(*this, "hopper"), + m_lamps(*this, "lamp%u", 0U) + { } void init_drw80pkr(); @@ -71,14 +173,16 @@ class drw80pkr_state : public driver_device uint8_t m_attract_mode; uint8_t m_active_bank; uint8_t m_pkr_io_ram[0x100]; - uint16_t m_video_ram[0x0400]; - uint8_t m_color_ram[0x0400]; + uint16_t m_video_ram[0x0400] = {}; + uint8_t m_color_ram[0x0400] = {}; required_device m_maincpu; required_device m_gfxdecode; required_device m_crtc; required_device m_aysnd; required_memory_bank m_mainbank; + required_device m_hopper; + output_finder<8> m_lamps; void p1_w(uint8_t data); void p2_w(uint8_t data); @@ -98,22 +202,29 @@ class drw80pkr_state : public driver_device void io_map(address_map &map) ATTR_COLD; void map(address_map &map) ATTR_COLD; -}; +}; #define DATA_NVRAM_SIZE 0x100 +/*********************************** +* Machine Start * +***********************************/ + void drw80pkr_state::machine_start() { subdevice("nvram")->set_base(m_pkr_io_ram, sizeof(m_pkr_io_ram)); m_active_bank = 0; + m_lamps.resolve(); + m_t1 = 1; // battery level sensor (1 = battery ok) } -/***************** -* Write Handlers * -******************/ + +/*********************************** +* Write Handlers * +***********************************/ void drw80pkr_state::p1_w(uint8_t data) { @@ -133,7 +244,6 @@ void drw80pkr_state::prog_w(int state) if (m_prog == 0x01) { m_active_bank = m_active_bank ^ 0x01; - m_mainbank->set_entry(m_active_bank); } } @@ -147,56 +257,67 @@ void drw80pkr_state::io_w(offs_t offset, uint8_t data) { uint16_t n_offs; - if (m_p2 == 0x3f || m_p2 == 0x7f) + switch (m_p2) { - n_offs = ((m_p1 & 0xc0) << 2 ) + offset; - - if (m_p2 == 0x3f) + case 0x3f: { - m_video_ram[n_offs] = data; // low address - } else { - m_color_ram[n_offs] = data & 0x0f; // color palette - m_video_ram[n_offs] += ((data & 0xf0) << 4 ); // high address + n_offs = ((m_p1 & 0xc0) << 2 ) + offset; + m_video_ram[n_offs] = data; // low address + m_bg_tilemap->mark_tile_dirty(n_offs); + break; } - - m_bg_tilemap->mark_tile_dirty(n_offs); - } - - if (m_p2 == 0xc7) - m_crtc->address_w(data); - - if (m_p2 == 0xd7) - m_crtc->register_w(data); - - if (m_p2 == 0xfb) { - m_pkr_io_ram[offset] = data; - } - - if (m_p2 == 0xff) - { - if (m_p1 == 0xdf) + case 0x7f: { - m_attract_mode = data; // Latch this for use in input reads (0x01 = attract mode, 0x00 = game in progress) + n_offs = ((m_p1 & 0xc0) << 2 ) + offset; + m_color_ram[n_offs] = data & 0x0f; // color palette + m_video_ram[n_offs] += ((data & 0xf0) << 4 ); // high address + m_bg_tilemap->mark_tile_dirty(n_offs); + break; } - - if (m_p1 == 0xdb || m_p1 == 0xef || m_p1 == 0xf7 || m_p1 == 0xfb) + case 0xc7: m_crtc->address_w(data); break; + case 0xd7: m_crtc->register_w(data); break; + case 0xfb: m_pkr_io_ram[offset] = data; break; + case 0xff: { - // unknown, most likely lamps, meters, hopper etc. + switch (m_p1) + { + case 0xf7: + { + machine().bookkeeping().coin_counter_w(0, data & 0x01); // coin in counter + machine().bookkeeping().coin_counter_w(1, data & 0x02); // credits paid + machine().bookkeeping().coin_counter_w(2, data & 0x04); // credits bet + machine().bookkeeping().coin_counter_w(3, data & 0x08); // coin out counter + m_hopper->motor_w(BIT(data, 4) && BIT(data, 5)); + m_lamps[7] = BIT(data, 4) && BIT(data, 5); // for testing purpose + break; + } + case 0xef: + { + m_lamps[0] = BIT(data, 0); // bet lamp + m_lamps[1] = BIT(data, 1); // start (deal/draw) + m_lamps[2] = BIT(data, 2); // hold + m_lamps[3] = BIT(data, 3); // hold + m_lamps[4] = BIT(data, 4); // hold + m_lamps[5] = BIT(data, 5); // hold + m_lamps[6] = BIT(data, 6); // hold + break; + } + case 0xdf: m_attract_mode = data; break; // unknown port access via P1.5 + case 0xfc: m_aysnd->address_w(data); break; + case 0xfe: m_aysnd->data_w(data); break; + case 0xfb: break; // unknown port access via P1.2 + case 0xdb: break; // unknown port access via P1.5 and P1.2 + //default: logerror("%s - Unknown I8039 - IO_W with Port 1:%02x access - data:%02x\n", machine().describe_context(), m_p1, data); + } break; } - - // ay8910 control port - if (m_p1 == 0xfc) - m_aysnd->address_w(data); - - // ay8910_write_port_0_w - if (m_p1 == 0xfe) - m_aysnd->data_w(data); + //default: logerror("%s - Unknown I8039 - IO_W with Port 2:%02x access - data:%02x\n", machine().describe_context(), m_p2, data); } } -/**************** -* Read Handlers * -****************/ + +/*********************************** +* Read Handlers * +***********************************/ int drw80pkr_state::t0_r() { @@ -225,91 +346,83 @@ uint8_t drw80pkr_state::bus_r() uint8_t drw80pkr_state::io_r(offs_t offset) { - uint8_t ret; - uint16_t kbdin; - - ret = 0x00; - - if (m_p2 == 0x3b) - { - // unknown - } - - if (m_p2 == 0x7b) - { - ret = m_pkr_io_ram[offset]; - } - - if (m_p2 == 0xf7) - { - // unknown - } + uint8_t ret = 0; - if (m_p2 == 0xfb) + switch (m_p2) { - ret = m_pkr_io_ram[offset]; - } - - if (m_p2 == 0xff) - { - if (m_p1 == 0x5f || m_p1 == 0x9f || m_p1 == 0xdb) - { - // unknown - } - - if (m_p1 == 0xfe) + case 0x3b: break; // dummy read done by "orl p2,#$FF" instruction. + case 0xf7: break; // dummy read done by "orl p2,#$FF" instruction. + case 0x7b: // some program bug, but ignored by real hardware. + case 0xfb: ret = m_pkr_io_ram[offset]; break; + case 0xff: { - // Dip switches tied to sound chip - // - // TODO: Unknown switch positions, but found the following flipping bits: - // SW.? = Double Up Option - // SW.? = Coin Denomination - // SW.4 = Payout Type (0=cash, 1=credit) - // SW.? = Use Joker in Deck - // - ret = 0x77; // double-up with credit payout - } - - if ((m_attract_mode == 0x01 && m_p1 == 0xef) || m_p1 == 0xf7) - { - // TODO: Get Input Port Values - kbdin = ((ioport("IN1")->read() & 0xaf ) << 8) + ioport("IN0")->read(); - - switch (kbdin) + switch (m_p1) { - // The following is very incorrect, but does allow you to - // play slightly with very messed up hold buttons etc. - // - // Open/Close the door with 'O' - // Press '5' (twice) with door open to play credit - // Press '1' to draw/deal - // - case 0x0000: ret = 0x00; break; - case 0x0001: ret = 0x01; break; /* Door */ - case 0x4000: ret = 0x00; break; - case 0x8000: ret = 0x00; break; /* Hand Pay */ - case 0x0002: ret = 0x00; break; /* Books */ - case 0x0004: ret = 0x0e; break; /* Coin In */ - case 0x0008: ret = 0x0d; break; /* Start */ - case 0x0010: ret = 0x00; break; /* Discard */ - case 0x0020: ret = 0x00; break; /* Cancel */ - case 0x0040: ret = 0x01; break; /* Hold 1 */ - case 0x0080: ret = 0x02; break; /* Hold 2 */ - case 0x0100: ret = 0x03; break; /* Hold 3 */ - case 0x0200: ret = 0x04; break; /* Hold 4 */ - case 0x0400: ret = 0x05; break; /* Hold 5 */ - case 0x0800: ret = 0x00; break; /* Bet */ + case 0xdb: + case 0x5f: + case 0x9f: break; // dummy reads done by "orl p1,#$FF" instruction. + case 0xfe: ret = m_aysnd->data_r(); break; + case 0xef: + { + switch (ioport("IN1")->read()) + { + // Encoded bits 0, 1, 2 + case 0x00: ret = 0xc0; break; // A Default port value 11-000-000 + case 0x01: ret = 0xc4; break; // Keyout 11-000-100 + case 0x02: ret = 0xc6; break; // A KeyIn A (Coinage x 1 ) No timeout 11-000-110 + // Direct bits 3, 4, 5 + case 0x04: ret = 0xc8; break; // 5 Coin (Timeout) (Coin_A Sequencer) 11-001-000 - Coin option only for drw80wld + case 0x08: ret = 0xd0; break; // 6 x (Coin_B Sequencer) 11-010-000 + case 0x10: ret = 0xe0; break; // 7 x (Coin_C Sequencer) 11-100-000 + // Direct Bits 6, 7 + case 0x20: ret = 0x80; break; // S Key In B (Coinage x 4) No Timeout 10-000-000 + case 0x40: ret = 0x40; break; // D Key In C (Coinage x 20) No Timeout 01-000-000 + } + break; + } + case 0xf7: + { + switch (ioport("IN2")->read()) + { + case 0x0000: ret = 0x80; break; + case 0x0001: ret = 0x81; break; // HOLD 4 P1 + case 0x0002: ret = 0x82; break; // HOLD 3 P1 + case 0x0004: ret = 0x83; break; // HOLD 2 P1 + case 0x0008: ret = 0x84; break; // HOLD 1 P1 + case 0x0010: ret = 0x85; break; // START P1 + case 0x0020: ret = 0x86; break; // BET P1 + case 0x0040: ret = 0x87; break; // HOLD 5 P1 + case 0x0080: ret = 0x88; break; // HOLD 4 P2 + case 0x0100: ret = 0x90; break; // HOLD 3 P2 + case 0x0200: ret = 0x98; break; // HOLD 2 P2 + case 0x0400: ret = 0xa0; break; // HOLD 1 P2 + case 0x0800: ret = 0xa8; break; // START P2 + case 0x1000: ret = 0xb0; break; // BET P2 + case 0x2000: ret = 0xb8; break; // HOLD P2 + case 0x4000: ret = 0xc0; break; // Hopper coin out + case 0x8000: ret = 0x00; break; // Books/Door + } break; + } + default: + { + //logerror("%s - Unknown I8039 - I/O with Port 1:%02x access\n", machine().describe_context(), m_p1); + ret = 0; + } } + } break; + default: + { + //logerror("%s - Unknown I8039 - I/O with Port 2:%02x access\n", machine().describe_context(), m_p2); + ret = 0; } } - return ret; } -/**************************** -* Video/Character functions * -****************************/ +/*********************************** +* Video Hardware * +***********************************/ TILE_GET_INFO_MEMBER(drw80pkr_state::get_bg_tile_info) { @@ -355,15 +468,15 @@ void drw80pkr_state::drw80pkr_palette(palette_device &palette) const } -/************************* -* Graphics Layouts * -*************************/ +/***************************************** +* Graphics Layouts * +*****************************************/ static const gfx_layout charlayout = { - 8,8, /* 8x8 characters */ - RGN_FRAC(1,2), /* 512 characters */ - 2, /* 2 bitplanes */ + 8,8, // 8x8 characters + RGN_FRAC(1,2), // 512 characters + 2, // 2 bitplanes { 0, RGN_FRAC(1,2) }, { STEP8(0,1) }, { STEP8(0,8) }, @@ -371,18 +484,18 @@ static const gfx_layout charlayout = }; -/****************************** -* Graphics Decode Information * -******************************/ +/***************************************** +* Graphics Decode Information * +*****************************************/ static GFXDECODE_START( gfx_drw80pkr ) GFXDECODE_ENTRY( "gfx1", 0x00000, charlayout, 0, 16 ) GFXDECODE_END -/************** -* Driver Init * -***************/ +/***************************************** +* Driver Init * +*****************************************/ void drw80pkr_state::init_drw80pkr() { @@ -390,9 +503,9 @@ void drw80pkr_state::init_drw80pkr() } -/************************* -* Memory map information * -*************************/ +/***************************************** +* Memory Map Information * +*****************************************/ void drw80pkr_state::map(address_map &map) { @@ -404,37 +517,93 @@ void drw80pkr_state::io_map(address_map &map) map(0x00, 0xff).rw(FUNC(drw80pkr_state::io_r), FUNC(drw80pkr_state::io_w)); } -/************************* -* Input ports * -*************************/ + +/***************************************** +* Input Ports * +*****************************************/ static INPUT_PORTS_START( drw80pkr ) - // Unknown at this time - // These are temporary buttons for testing only - PORT_START("IN0") - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_GAMBLE_DOOR ) PORT_TOGGLE - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_GAMBLE_BOOK ) PORT_NAME("Books") - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_IMPULSE(2) - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_START1 ) PORT_NAME("Start") - PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Discard") PORT_CODE(KEYCODE_2) - PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_POKER_CANCEL ) - PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_POKER_HOLD1 ) - PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_POKER_HOLD2 ) - - PORT_START("IN1") - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_POKER_HOLD3 ) - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_POKER_HOLD4 ) - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_POKER_HOLD5 ) + + PORT_START("IN1") //$EF + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_GAMBLE_KEYOUT ) + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_NAME("KeyIn x01") // KeyIn A (Coinage x 1 ) No timeout + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED ) - PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Hopper") PORT_TOGGLE PORT_CODE(KEYCODE_H) - PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_GAMBLE_PAYOUT) - PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED ) - PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_COIN2 ) PORT_NAME("KeyIn x04") // Key In B (Coinage x 4) No Timeout + PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_COIN3 ) PORT_NAME("KeyIn x20") // Key In C (Coinage x 20) No Timeout + + PORT_START("IN2") //$F7 + PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_POKER_HOLD4 ) PORT_IMPULSE(2) + PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_POKER_HOLD3 ) PORT_IMPULSE(2) + PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_POKER_HOLD2 ) PORT_IMPULSE(2) + PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_POKER_HOLD1 ) PORT_IMPULSE(2) // Double -> YES / HIGH + PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_GAMBLE_DEAL ) PORT_IMPULSE(2) PORT_CODE(KEYCODE_1) + PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_GAMBLE_BET ) PORT_IMPULSE(2) PORT_NAME("Bet") // switch the control for cocktail mode. + PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_POKER_HOLD5 ) PORT_IMPULSE(2) // Double -> NO / LOW + + PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_UNUSED ) // unsupported cocktail mode hold 4 + PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_UNUSED ) // unsupported cocktail mode hold 3 + PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_UNUSED ) // unsupported cocktail mode hold 2 + PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_UNUSED ) // unsupported cocktail mode hold 1 + PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_UNUSED ) // unsupported cocktail mode deal/draw + PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_UNUSED ) // unsupported cocktail mode bet + PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_UNUSED ) // unsupported cocktail mode hold 5 + PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_READ_LINE_DEVICE_MEMBER("hopper", FUNC(ticket_dispenser_device::line_r)) + PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_GAMBLE_BOOK ) + + PORT_START("DSW1") + PORT_DIPNAME( 0x01, 0x01, "Pair of Aces" ) PORT_DIPLOCATION("SW1:8") + PORT_DIPSETTING( 0x01, DEF_STR( No ) ) + PORT_DIPSETTING( 0x00, DEF_STR( Yes ) ) + PORT_DIPNAME( 0x02, 0x02, "Joker Enable" ) PORT_DIPLOCATION("SW1:7") + PORT_DIPSETTING( 0x02, DEF_STR( No ) ) + PORT_DIPSETTING( 0x00, DEF_STR( Yes ) ) + PORT_DIPNAME( 0x04, 0x04, "Double-Up" ) PORT_DIPLOCATION("SW1:6") + PORT_DIPSETTING( 0x04, "Enabled" ) + PORT_DIPSETTING( 0x00, "Disabled" ) + PORT_DIPNAME( 0x18, 0x00, "Payout Type" ) PORT_DIPLOCATION("SW1:4,5") + PORT_DIPSETTING( 0x00, "Cash" ) + PORT_DIPSETTING( 0x08, "Credits" ) + PORT_DIPSETTING( 0x10, "Credits" ) + PORT_DIPSETTING( 0x18, "Credits" ) + PORT_DIPNAME( 0x60, 0x60, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:3,2") + PORT_DIPSETTING( 0x60, DEF_STR( 1C_1C ) ) + PORT_DIPSETTING( 0x40, DEF_STR( 1C_3C ) ) + PORT_DIPSETTING( 0x20, DEF_STR( 1C_5C ) ) + PORT_DIPSETTING( 0x00, "1 Coin/10 Credits" ) + PORT_DIPNAME( 0x80, 0x00, "Coin Acceptor Type" ) PORT_DIPLOCATION("SW1:1") + PORT_DIPSETTING( 0x80, "Type ABC" ) + PORT_DIPSETTING( 0x00, "Single Pulse" ) +INPUT_PORTS_END + + +static INPUT_PORTS_START( drw80wld ) + PORT_INCLUDE( drw80pkr ) + + PORT_MODIFY("IN1") //$EF + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_GAMBLE_KEYOUT ) + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("KeyIn x01") PORT_CODE(KEYCODE_A) // KeyIn A (Coinage x 1 ) No timeout + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_COIN1 ) // coin sequencer A Or Coin Switch (DSW_1 Selector) + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_COIN2 ) // coin sequencer B + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_COIN3 ) // coin sequencer C + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("KeyIn x04") PORT_CODE(KEYCODE_S) // Key In B (Coinage x 4) No Timeout + PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("KeyIn x20") PORT_CODE(KEYCODE_D) // Key In C (Coinage x 20) No Timeout + + PORT_MODIFY("IN2") + PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_CODE(KEYCODE_R) PORT_NAME("Hold 4 (cocktail mode)") PORT_IMPULSE(2) // cocktail mode hold 4 + PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_CODE(KEYCODE_E) PORT_NAME("Hold 3 (cocktail mode)") PORT_IMPULSE(2) // cocktail mode hold 3 + PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_CODE(KEYCODE_W) PORT_NAME("Hold 2 (cocktail mode)") PORT_IMPULSE(2) // cocktail mode hold 2 + PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_CODE(KEYCODE_Q) PORT_NAME("Hold 1 (cocktail mode)") PORT_IMPULSE(2) // cocktail mode hold 1 + PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_CODE(KEYCODE_2) PORT_NAME("Deal (cocktail mode)") PORT_IMPULSE(2) // cocktail mode deal/draw + PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_CODE(KEYCODE_Y) PORT_NAME("Bet") PORT_IMPULSE(2) // cocktail mode bet (switch the control for cocktail mode) + PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_CODE(KEYCODE_T) PORT_NAME("Hold 5 (cocktail mode)") PORT_IMPULSE(2) // cocktail mode hold 5 INPUT_PORTS_END -/************************* -* Machine Driver * -*************************/ + +/***************************************** +* Machine Driver * +*****************************************/ void drw80pkr_state::drw80pkr(machine_config &config) { @@ -456,7 +625,7 @@ void drw80pkr_state::drw80pkr(machine_config &config) // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); - screen.set_raw(8_MHz_XTAL / 2, 256, 0, 192, 257, 0, 216); // 4 MHz? + screen.set_raw(8_MHz_XTAL / 2, 256, 0, 192, 257, 0, 216); // 4 MHz? screen.set_screen_update(FUNC(drw80pkr_state::screen_update)); screen.set_palette("palette"); @@ -464,7 +633,7 @@ void drw80pkr_state::drw80pkr(machine_config &config) PALETTE(config, "palette", FUNC(drw80pkr_state::drw80pkr_palette), 16 * 16); - MC6845(config, m_crtc, 8_MHz_XTAL / 16); // 0.5 MHz? + MC6845(config, m_crtc, 8_MHz_XTAL / 16); // 0.5 MHz? m_crtc->set_screen("screen"); m_crtc->set_show_border_area(false); m_crtc->set_char_width(8); @@ -474,33 +643,37 @@ void drw80pkr_state::drw80pkr(machine_config &config) SPEAKER(config, "mono").front_center(); AY8912(config, m_aysnd, 20000000/12).add_route(ALL_OUTPUTS, "mono", 0.75); + m_aysnd->port_a_read_callback().set_ioport("DSW1"); + + HOPPER(config, m_hopper, attotime::from_msec(150)); } -/************************* -* Rom Load * -*************************/ + +/***************************************** +* Rom Load * +*****************************************/ ROM_START( drw80pkr ) ROM_REGION( 0x2000, "maincpu", 0 ) - ROM_LOAD( "pm0.u81", 0x0000, 0x1000, CRC(73223555) SHA1(229999ec00a1353f0d4928c65c8975079060c5af) ) - ROM_LOAD( "pm1.u82", 0x1000, 0x1000, CRC(f8158f2b) SHA1(da3b30cfd49cd0e8a48d78fd3f82b2b4ab33670c) ) + ROM_LOAD( "pm0.u81", 0x0000, 0x1000, CRC(0f3e97d2) SHA1(aa9e4015246284f32435d7320de667e075412e5b) ) + ROM_LOAD( "pm1.u82", 0x1000, 0x1000, CRC(5a6ad467) SHA1(0128bd70b65244a0f68031d5f451bf115eeb7609) ) ROM_REGION( 0x002000, "gfx1", 0 ) - ROM_LOAD( "cg0-a.u74", 0x0000, 0x1000, CRC(0eefe598) SHA1(ed10aac345b10e35fb15babdd3ac30ebe2b8fc0f) ) - ROM_LOAD( "cg1-a.u76", 0x1000, 0x1000, CRC(522a96d0) SHA1(48f855a132413493353fbf6a44a1feb34ae6726d) ) + ROM_LOAD( "cg0-a.u74", 0x0000, 0x1000, CRC(97f5eb92) SHA1(f6c7bb42ccef8a78e8d56104ad942ae5b8e5b0df) ) + ROM_LOAD( "cg1-a.u76", 0x1000, 0x1000, CRC(2a3a750d) SHA1(db6183d11b2865b011c3748dc472cf5858dde78f) ) ROM_REGION( 0x100, "proms", 0 ) ROM_LOAD( "cap13.u92", 0x0000, 0x0100, CRC(be67a8d9) SHA1(24b8cd19a5ec09779a737f6fc8c07b44f1226c8f) ) ROM_END -ROM_START( drw80pk2 ) +ROM_START( drw80wld ) ROM_REGION( 0x2000, "maincpu", 0 ) - ROM_LOAD( "pm0.u81", 0x0000, 0x1000, CRC(0f3e97d2) SHA1(aa9e4015246284f32435d7320de667e075412e5b) ) - ROM_LOAD( "pm1.u82", 0x1000, 0x1000, CRC(5a6ad467) SHA1(0128bd70b65244a0f68031d5f451bf115eeb7609) ) + ROM_LOAD( "pm0.u81", 0x0000, 0x1000, CRC(73223555) SHA1(229999ec00a1353f0d4928c65c8975079060c5af) ) + ROM_LOAD( "pm1.u82", 0x1000, 0x1000, CRC(f8158f2b) SHA1(da3b30cfd49cd0e8a48d78fd3f82b2b4ab33670c) ) ROM_REGION( 0x002000, "gfx1", 0 ) - ROM_LOAD( "cg0-a.u74", 0x0000, 0x1000, CRC(97f5eb92) SHA1(f6c7bb42ccef8a78e8d56104ad942ae5b8e5b0df) ) - ROM_LOAD( "cg1-a.u76", 0x1000, 0x1000, CRC(2a3a750d) SHA1(db6183d11b2865b011c3748dc472cf5858dde78f) ) + ROM_LOAD( "cg0-a.u74", 0x0000, 0x1000, CRC(0eefe598) SHA1(ed10aac345b10e35fb15babdd3ac30ebe2b8fc0f) ) + ROM_LOAD( "cg1-a.u76", 0x1000, 0x1000, CRC(57d39a16) SHA1(c3d826c2d427bcaabed6a71c1c34d5411afdace8) ) ROM_REGION( 0x100, "proms", 0 ) ROM_LOAD( "cap13.u92", 0x0000, 0x0100, CRC(be67a8d9) SHA1(24b8cd19a5ec09779a737f6fc8c07b44f1226c8f) ) @@ -508,10 +681,11 @@ ROM_END } // Anonymous namespace -/************************* -* Game Drivers * -*************************/ -// YEAR NAME PARENT MACHINE INPUT STATE INIT ROT COMPANY FULLNAME FLAGS -GAME( 1982, drw80pkr, 0, drw80pkr, drw80pkr, drw80pkr_state, init_drw80pkr, ROT0, "IGT - International Game Technology", "Draw 80 Poker", MACHINE_NOT_WORKING ) -GAME( 1983, drw80pk2, 0, drw80pkr, drw80pkr, drw80pkr_state, init_drw80pkr, ROT0, "IGT - International Game Technology", "Draw 80 Poker - Minn", MACHINE_NOT_WORKING ) +/***************************************** +* Game Drivers * +*****************************************/ + +// YEAR NAME PARENT MACHINE INPUT STATE INIT ROT COMPANY FULLNAME FLAGS LAYOUT +GAMEL( 1983, drw80pkr, 0, drw80pkr, drw80pkr, drw80pkr_state, init_drw80pkr, ROT0, "IGT - International Game Technology", "Draw 80 Poker (Minn)", 0, layout_drw80pkr) +GAMEL( 1982, drw80wld, 0, drw80pkr, drw80wld, drw80pkr_state, init_drw80pkr, ROT0, "IGT - International Game Technology", "Wild 1 (Quick Change Kit)", 0, layout_drw80pkr) diff --git a/src/mame/jaleco/ms32.cpp b/src/mame/jaleco/ms32.cpp index 559412056a175..c6d91b712c83f 100644 --- a/src/mame/jaleco/ms32.cpp +++ b/src/mame/jaleco/ms32.cpp @@ -2703,4 +2703,4 @@ GAME( 1997, bnstars, bnstars1, ms32, suchie2, ms32_state, GAME( 1996, wpksocv2, 0, ms32_invert_lines, wpksocv2, ms32_state, init_ss92046_01, ROT0, "Jaleco", "World PK Soccer V2 (ver 1.1)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) /* these boot and show something */ -GAMEL( 1994, f1superb, 0, f1superb, f1superb, ms32_f1superbattle_state, init_f1superb, ROT0, "Jaleco", "F-1 Super Battle", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS | MACHINE_NODEVICE_LAN | MACHINE_SUPPORTS_SAVE, layout_f1superb ) +GAMEL(1994, f1superb, 0, f1superb, f1superb, ms32_f1superbattle_state, init_f1superb, ROT0, "Jaleco", "F-1 Super Battle", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS | MACHINE_NODEVICE_LAN | MACHINE_SUPPORTS_SAVE, layout_f1superb ) diff --git a/src/mame/jpm/guab.cpp b/src/mame/jpm/guab.cpp index b1e3fe5f739c1..d43894398862c 100644 --- a/src/mame/jpm/guab.cpp +++ b/src/mame/jpm/guab.cpp @@ -10,12 +10,12 @@ * Give us a Break [8 sets] * Criss Cross (Sweden) [non-working - need disk image] * Ten Up [2 sets] + * Treasure Trail [non-working - need disk image] Looking for: * Numbers Game * Pac Quiz * Suit Pursuit - * Treasure Trail? Known issues: * Coin data has to go through the datalogger to be counted @@ -559,6 +559,14 @@ ROM_START( tenup ) ROM_LOAD16_BYTE( "tu-14.bin", 0x10001, 0x8000, CRC(fd8a0c3c) SHA1(f87289ce6f0d2bc9b7d3a0b6deff38ba3aadf391) ) ROM_END +ROM_START( ttrail ) + ROM_REGION( 0x20000, "maincpu", 0 ) + ROM_LOAD16_BYTE( "ic49.bin", 0x00000, 0x8000, CRC(01395ff1) SHA1(69e0f0d9893c2b4edf7f2c4547bf7674ddeb10ef) ) + ROM_LOAD16_BYTE( "ic48.bin", 0x00001, 0x8000, CRC(8dfd2165) SHA1(a239258b2b9e9773f97937506e04680422c6c396) ) + ROM_LOAD16_BYTE( "ic57.bin", 0x10000, 0x8000, CRC(82775064) SHA1(17437022f76bd8faebdbcc94be8ace482a145382) ) + ROM_LOAD16_BYTE( "ic56.bin", 0x10001, 0x8000, CRC(70264d8a) SHA1(107b9eb72fd587deb1ba9821645f3ab86e6040c8) ) +ROM_END + } // anonymous namespace @@ -570,3 +578,4 @@ ROM_END GAME( 1986, guab, 0, guab, guab, guab_state, empty_init, ROT0, "JPM", "Give us a Break", 0 ) GAME( 1986, crisscrs, 0, guab, guab, guab_state, empty_init, ROT0, "JPM", "Criss Cross (Sweden)", MACHINE_NOT_WORKING ) GAME( 1988, tenup, 0, guab, tenup, guab_state, empty_init, ROT0, "JPM", "Ten Up", 0 ) +GAME( 198?, ttrail, 0, guab, guab, guab_state, empty_init, ROT0, "JPM", "Treasure Trail (JPM)", MACHINE_NOT_WORKING ) diff --git a/src/mame/kaneko/kaneko16.cpp b/src/mame/kaneko/kaneko16.cpp index 4fc47e578659e..2b30c396dab2d 100644 --- a/src/mame/kaneko/kaneko16.cpp +++ b/src/mame/kaneko/kaneko16.cpp @@ -276,7 +276,7 @@ void kaneko16_berlwall_state::berlwall_map(address_map &map) map(0x200000, 0x20ffff).ram(); // Work RAM map(0x30e000, 0x30ffff).rw(FUNC(kaneko16_berlwall_state::berlwall_spriteram_r), FUNC(kaneko16_berlwall_state::berlwall_spriteram_w)).share("spriteram"); // Sprites (scrambled RAM) map(0x400000, 0x400fff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); // Palette - map(0x480000, 0x480001).ram().share("bg15_scroll"); // High Color Background + map(0x480000, 0x480001).ram().share(m_bg15_scroll); // High Color Background map(0x500001, 0x500001).rw(FUNC(kaneko16_berlwall_state::bg15_bright_r), FUNC(kaneko16_berlwall_state::bg15_bright_w)); // "" map(0x580001, 0x580001).rw(FUNC(kaneko16_berlwall_state::bg15_select_r), FUNC(kaneko16_berlwall_state::bg15_select_w)); // "" map(0x600000, 0x60003f).rw(FUNC(kaneko16_berlwall_state::berlwall_spriteregs_r), FUNC(kaneko16_berlwall_state::berlwall_spriteregs_w)); // Sprite Regs (scrambled RAM) @@ -316,7 +316,7 @@ void kaneko16_state::bakubrkr_map(address_map &map) map(0x700000, 0x700fff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); // Palette map(0x800000, 0x80001f).rw(m_view2[0], FUNC(kaneko_view2_tilemap_device::regs_r), FUNC(kaneko_view2_tilemap_device::regs_w)); map(0x900000, 0x90001f).rw(m_kaneko_spr, FUNC(kaneko16_sprite_device::regs_r), FUNC(kaneko16_sprite_device::regs_w)); - map(0xa80000, 0xa80001).r("watchdog", FUNC(watchdog_timer_device::reset16_r)); + map(0xa80000, 0xa80001).r(m_watchdog, FUNC(watchdog_timer_device::reset16_r)); map(0xb00000, 0xb0001f).rw(m_view2[1], FUNC(kaneko_view2_tilemap_device::regs_r), FUNC(kaneko_view2_tilemap_device::regs_w)); map(0xd00000, 0xd00000).w(FUNC(kaneko16_state::bloodwar_coin_lockout_w)); // Coin Lockout map(0xd00001, 0xd00001).w(FUNC(kaneko16_state::eeprom_w)); // EEPROM @@ -331,7 +331,7 @@ void kaneko16_state::bakubrkr_map(address_map &map) Blaze On ***************************************************************************/ -void kaneko16_state::blazeon_map(address_map &map) +void kaneko16_blazeon_state::blazeon_map(address_map &map) { map(0x000000, 0x0fffff).rom(); // ROM map(0x300000, 0x30ffff).ram(); // Work RAM @@ -345,7 +345,7 @@ void kaneko16_state::blazeon_map(address_map &map) map(0xc00002, 0xc00003).portr("DSW1_P2"); map(0xc00004, 0xc00005).portr("UNK"); map(0xc00006, 0xc00007).portr("SYSTEM"); - map(0xd00000, 0xd00000).w(FUNC(kaneko16_state::coin_lockout_w)); // Coin Lockout + map(0xd00000, 0xd00000).w(FUNC(kaneko16_blazeon_state::coin_lockout_w)); // Coin Lockout map(0xe00000, 0xe00001).nopr(); // Read = IRQ Ack ? map(0xe00000, 0xe00000).w(m_soundlatch, FUNC(generic_latch_8_device::write)); map(0xe40000, 0xe40001).nopr(); // IRQ Ack ? @@ -362,7 +362,7 @@ void kaneko16_gtmr_state::bloodwar_map(address_map &map) { map(0x000000, 0x0fffff).rom(); // ROM map(0x100000, 0x10ffff).ram(); // Work RAM - map(0x200000, 0x20ffff).ram().share("mcuram"); + map(0x200000, 0x20ffff).ram().share(m_mcuram); map(0x2a0000, 0x2a0001).w(m_toybox, FUNC(kaneko_toybox_device::mcu_com0_w)); // To MCU ? map(0x2b0000, 0x2b0001).w(m_toybox, FUNC(kaneko_toybox_device::mcu_com1_w)); map(0x2c0000, 0x2c0001).w(m_toybox, FUNC(kaneko_toybox_device::mcu_com2_w)); @@ -398,7 +398,7 @@ void kaneko16_gtmr_state::bonkadv_map(address_map &map) { map(0x000000, 0x0fffff).rom(); // ROM map(0x100000, 0x10ffff).ram(); // Work RAM - map(0x200000, 0x20ffff).ram().share("mcuram"); // Shared With MCU + map(0x200000, 0x20ffff).ram().share(m_mcuram); // Shared With MCU map(0x2a0000, 0x2a0001).w(m_toybox, FUNC(kaneko_toybox_device::mcu_com0_w)); // To MCU ? map(0x2b0000, 0x2b0001).w(m_toybox, FUNC(kaneko_toybox_device::mcu_com1_w)); map(0x2c0000, 0x2c0001).w(m_toybox, FUNC(kaneko_toybox_device::mcu_com2_w)); @@ -635,7 +635,7 @@ void kaneko16_shogwarr_state::shogwarr_map(address_map &map) Blaze On ***************************************************************************/ -void kaneko16_state::blazeon_soundmem(address_map &map) +void kaneko16_blazeon_state::blazeon_soundmem(address_map &map) { map(0x0000, 0x7fff).rom(); // ROM map(0x8000, 0xbfff).rom(); // ROM (supposed to be banked?) @@ -643,7 +643,7 @@ void kaneko16_state::blazeon_soundmem(address_map &map) //map(0xe000, 0xe001).noprw(); // Unknown read / writes in boot } -void kaneko16_state::blazeon_soundport(address_map &map) +void kaneko16_blazeon_state::blazeon_soundport(address_map &map) { map.global_mask(0xff); map(0x02, 0x03).rw(m_ymsnd, FUNC(ym2151_device::read), FUNC(ym2151_device::write)); @@ -654,14 +654,14 @@ void kaneko16_state::blazeon_soundport(address_map &map) Wing Force ***************************************************************************/ -void kaneko16_state::wingforc_soundport(address_map &map) +void kaneko16_blazeon_state::wingforc_soundport(address_map &map) { map.global_mask(0xff); // map(0x00, 0x00) // 02 written at boot map(0x02, 0x03).rw(m_ymsnd, FUNC(ym2151_device::read), FUNC(ym2151_device::write)); map(0x06, 0x06).r(m_soundlatch, FUNC(generic_latch_8_device::read)); map(0x0a, 0x0a).rw(m_oki[0], FUNC(okim6295_device::read), FUNC(okim6295_device::write)); - map(0x0c, 0x0c).w(FUNC(kaneko16_state::oki_bank0_w<0x3>)); + map(0x0c, 0x0c).w(FUNC(kaneko16_blazeon_state::oki_bank0_w<0x3>)); } @@ -1744,7 +1744,7 @@ void kaneko16_berlwall_state::berlwall(machine_config &config) void kaneko16_state::bakubrkr_oki1_map(address_map &map) { map(0x00000, 0x1ffff).rom(); - map(0x20000, 0x3ffff).bankr("okibank1"); + map(0x20000, 0x3ffff).bankr(m_okibank[0]); } void kaneko16_state::bakubrkr(machine_config &config) @@ -1819,16 +1819,16 @@ void kaneko16_state::bakubrkr(machine_config &config) 6-7] busy loop */ -void kaneko16_state::blazeon(machine_config &config) +void kaneko16_blazeon_state::blazeon(machine_config &config) { /* basic machine hardware */ M68000(config, m_maincpu, 12000000); /* TMP68HC000-12 */ - m_maincpu->set_addrmap(AS_PROGRAM, &kaneko16_state::blazeon_map); - TIMER(config, "scantimer").configure_scanline(FUNC(kaneko16_state::interrupt), "screen", 0, 1); + m_maincpu->set_addrmap(AS_PROGRAM, &kaneko16_blazeon_state::blazeon_map); + TIMER(config, "scantimer").configure_scanline(FUNC(kaneko16_blazeon_state::interrupt), "screen", 0, 1); Z80(config, m_audiocpu, 4000000); /* D780C-2 (6 MHz) */ - m_audiocpu->set_addrmap(AS_PROGRAM, &kaneko16_state::blazeon_soundmem); - m_audiocpu->set_addrmap(AS_IO, &kaneko16_state::blazeon_soundport); + m_audiocpu->set_addrmap(AS_PROGRAM, &kaneko16_blazeon_state::blazeon_soundmem); + m_audiocpu->set_addrmap(AS_IO, &kaneko16_blazeon_state::blazeon_soundport); /* video hardware */ BUFFERED_SPRITERAM16(config, m_spriteram); @@ -1838,7 +1838,7 @@ void kaneko16_state::blazeon(machine_config &config) m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(2500) /* not accurate */); m_screen->set_size(320, 240); m_screen->set_visarea(0, 320-1, 0, 240-1 -8); - m_screen->set_screen_update(FUNC(kaneko16_state::screen_update)); + m_screen->set_screen_update(FUNC(kaneko16_blazeon_state::screen_update)); m_screen->set_palette(m_palette); PALETTE(config, m_palette).set_format(palette_device::xGRB_555, 2048); @@ -1873,16 +1873,16 @@ void kaneko16_state::blazeon(machine_config &config) Wing Force ***************************************************************************/ -void kaneko16_state::wingforc(machine_config &config) +void kaneko16_blazeon_state::wingforc(machine_config &config) { /* basic machine hardware */ M68000(config, m_maincpu, XTAL(16'000'000)); /* TMP68HC000N-16 */ - m_maincpu->set_addrmap(AS_PROGRAM, &kaneko16_state::blazeon_map); - TIMER(config, "scantimer").configure_scanline(FUNC(kaneko16_state::interrupt), "screen", 0, 1); + m_maincpu->set_addrmap(AS_PROGRAM, &kaneko16_blazeon_state::blazeon_map); + TIMER(config, "scantimer").configure_scanline(FUNC(kaneko16_blazeon_state::interrupt), "screen", 0, 1); Z80(config, m_audiocpu, XTAL(16'000'000)/4); /* D780C-2 (6 MHz) */ - m_audiocpu->set_addrmap(AS_PROGRAM, &kaneko16_state::blazeon_soundmem); - m_audiocpu->set_addrmap(AS_IO, &kaneko16_state::wingforc_soundport); + m_audiocpu->set_addrmap(AS_PROGRAM, &kaneko16_blazeon_state::blazeon_soundmem); + m_audiocpu->set_addrmap(AS_IO, &kaneko16_blazeon_state::wingforc_soundport); /* video hardware */ BUFFERED_SPRITERAM16(config, m_spriteram); @@ -1892,7 +1892,7 @@ void kaneko16_state::wingforc(machine_config &config) m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(2500) /* not accurate */); m_screen->set_size(320, 240); m_screen->set_visarea(0, 320-1, 0, 240-1 -16); - m_screen->set_screen_update(FUNC(kaneko16_state::screen_update)); + m_screen->set_screen_update(FUNC(kaneko16_blazeon_state::screen_update)); m_screen->set_palette(m_palette); PALETTE(config, m_palette).set_format(palette_device::xGRB_555, 2048); @@ -1921,7 +1921,7 @@ void kaneko16_state::wingforc(machine_config &config) OKIM6295(config, m_oki[0], XTAL(16'000'000)/16, okim6295_device::PIN7_HIGH); m_oki[0]->add_route(ALL_OUTPUTS, "mono", 0.5); - m_oki[0]->set_addrmap(0, &kaneko16_state::bakubrkr_oki1_map); + m_oki[0]->set_addrmap(0, &kaneko16_blazeon_state::bakubrkr_oki1_map); } @@ -1942,12 +1942,12 @@ void kaneko16_state::wingforc(machine_config &config) void kaneko16_state::gtmr_oki1_map(address_map &map) { map(0x00000, 0x2ffff).rom(); - map(0x30000, 0x3ffff).bankr("okibank1"); + map(0x30000, 0x3ffff).bankr(m_okibank[0]); } void kaneko16_state::gtmr_oki2_map(address_map &map) { - map(0x00000, 0x3ffff).bankr("okibank2"); + map(0x00000, 0x3ffff).bankr(m_okibank[1]); } void kaneko16_gtmr_state::gtmr(machine_config &config) @@ -2221,7 +2221,7 @@ void kaneko16_shogwarr_state::shogwarr(machine_config &config) KANEKO_HIT(config, m_kaneko_hit); m_kaneko_hit->set_type(1); - KANEKO_CALC3(config, m_calc3_prot, m_maincpu, m_eeprom, "calc3_rom"); + KANEKO_CALC3(config, m_calc3_prot, m_maincpu, m_eeprom, m_mcuram, m_dsw_port, "calc3_rom"); /* sound hardware */ SPEAKER(config, "mono").front_center(); @@ -2251,7 +2251,7 @@ static const u16 brapboys_default_eeprom[64] = { void kaneko16_shogwarr_state::brapboys_oki2_map(address_map &map) { map(0x00000, 0x1ffff).rom(); - map(0x20000, 0x3ffff).bankr("okibank2"); + map(0x20000, 0x3ffff).bankr(m_okibank[1]); } void kaneko16_shogwarr_state::brapboys(machine_config &config) @@ -2578,7 +2578,7 @@ ROM_START( berlwall ) ROM_REGION( 0x080000, "view2_0", 0 ) /* Tiles */ ROM_LOAD( "bw003.u77", 0x000000, 0x080000, CRC(fbb4b72d) SHA1(07a0590f18b3bba1843ef6a89a5c214e8e605cc3) ) - ROM_REGION( 0x400000, "gfx3", 0 ) /* High Color Background */ + ROM_REGION( 0x400000, "bitmap", 0 ) /* High Color Background */ ROM_LOAD16_BYTE( "bw004.u73", 0x000000, 0x080000, CRC(5300c34d) SHA1(ccb12ea05f89ef68bcfe003faced2ffea24c4bf0) ) ROM_LOAD16_BYTE( "bw008.u65", 0x000001, 0x080000, CRC(9aaf2f2f) SHA1(1352856159e19f07e8e30f9c44b21347103ce024) ) // FIXED BITS (xxxxxxx0) ROM_LOAD16_BYTE( "bw005.u74", 0x100000, 0x080000, CRC(16db6d43) SHA1(0158d0278d085487400ad4384b8cc9618503319e) ) @@ -2610,7 +2610,7 @@ ROM_START( berlwallt ) ROM_REGION( 0x080000, "view2_0", 0 ) /* Tiles */ ROM_LOAD( "bw003.u77", 0x000000, 0x080000, CRC(fbb4b72d) SHA1(07a0590f18b3bba1843ef6a89a5c214e8e605cc3) ) - ROM_REGION( 0x400000, "gfx3", 0 ) /* High Color Background */ + ROM_REGION( 0x400000, "bitmap", 0 ) /* High Color Background */ ROM_LOAD16_BYTE( "bw004.u73", 0x000000, 0x080000, CRC(5300c34d) SHA1(ccb12ea05f89ef68bcfe003faced2ffea24c4bf0) ) ROM_LOAD16_BYTE( "bw008.u65", 0x000001, 0x080000, CRC(9aaf2f2f) SHA1(1352856159e19f07e8e30f9c44b21347103ce024) ) // FIXED BITS (xxxxxxx0) ROM_LOAD16_BYTE( "bw005.u74", 0x100000, 0x080000, CRC(16db6d43) SHA1(0158d0278d085487400ad4384b8cc9618503319e) ) @@ -2644,7 +2644,7 @@ ROM_START( berlwallk ) ROM_REGION( 0x080000, "view2_0", 0 ) /* Tiles */ ROM_LOAD( "bw003.u77", 0x000000, 0x080000, CRC(fbb4b72d) SHA1(07a0590f18b3bba1843ef6a89a5c214e8e605cc3) ) - ROM_REGION( 0x400000, "gfx3", 0 ) /* High Color Background */ + ROM_REGION( 0x400000, "bitmap", 0 ) /* High Color Background */ ROM_LOAD16_BYTE( "bw004.u73", 0x000000, 0x080000, CRC(5300c34d) SHA1(ccb12ea05f89ef68bcfe003faced2ffea24c4bf0) ) ROM_LOAD16_BYTE( "bw008.u65", 0x000001, 0x080000, CRC(9aaf2f2f) SHA1(1352856159e19f07e8e30f9c44b21347103ce024) ) // FIXED BITS (xxxxxxx0) ROM_LOAD16_BYTE( "bw005.u74", 0x100000, 0x080000, CRC(16db6d43) SHA1(0158d0278d085487400ad4384b8cc9618503319e) ) @@ -2693,7 +2693,7 @@ ROM_START( packbang ) /* Final/retail version */ ROM_REGION( 0x080000, "view2_0", 0 ) /* Tiles */ ROM_LOAD( "bbb0x1_u77.u77", 0x000000, 0x080000, CRC(b2ffd081) SHA1(e4b8b60ed0c5f2e0709477cc840864e1c0a351ea) ) // labeled BBB0X1/U77 - 1ST AND 2ND HALF IDENTICAL - ROM_REGION( 0x400000, "gfx3", 0 ) /* High Color Background */ + ROM_REGION( 0x400000, "bitmap", 0 ) /* High Color Background */ ROM_LOAD16_BYTE( "bb-u73-004__w19.u73", 0x000000, 0x080000, CRC(896d88cb) SHA1(7546e64149d8d8e3425d9112a7a63b2d2e59b8bb) ) // These are all mask ROMs ROM_LOAD16_BYTE( "bb-u65-001__w16.u65", 0x000001, 0x080000, CRC(fe17c5b5) SHA1(daea65bd87d2137526250d521f36f122f733fd9d) ) // FIXED BITS (xxxxxxx0) ROM_LOAD16_BYTE( "bb-u74-005__w20.u74", 0x100000, 0x080000, CRC(b01e77b9) SHA1(73f3adaf6468f4e9c54bff63268af1765cfc5f67) ) @@ -2717,7 +2717,7 @@ ROM_START( packbangp ) /* prototype version */ ROM_REGION( 0x080000, "view2_0", 0 ) /* Tiles */ ROM_LOAD( "bbb0x1.u77", 0x000000, 0x080000, CRC(b2ffd081) SHA1(e4b8b60ed0c5f2e0709477cc840864e1c0a351ea) ) // 1ST AND 2ND HALF IDENTICAL - ROM_REGION( 0x400000, "gfx3", 0 ) /* High Color Background */ + ROM_REGION( 0x400000, "bitmap", 0 ) /* High Color Background */ ROM_LOAD16_BYTE( "bb.u73", 0x000000, 0x080000, CRC(896d88cb) SHA1(7546e64149d8d8e3425d9112a7a63b2d2e59b8bb) ) ROM_LOAD16_BYTE( "bb.u65", 0x000001, 0x080000, CRC(fe17c5b5) SHA1(daea65bd87d2137526250d521f36f122f733fd9d) ) // FIXED BITS (xxxxxxx0) ROM_LOAD16_BYTE( "bb.u74", 0x100000, 0x080000, CRC(b01e77b9) SHA1(73f3adaf6468f4e9c54bff63268af1765cfc5f67) ) @@ -4476,12 +4476,12 @@ GAME( 1994, packbangp, packbang, berlwall, packbang, kaneko16_berlwall_state, GAME( 1991, mgcrystl, 0, mgcrystl, mgcrystl, kaneko16_state, empty_init, ROT0, "Kaneko", "Magical Crystals (World, 92/01/10)", MACHINE_SUPPORTS_SAVE ) GAME( 1991, mgcrystlo, mgcrystl, mgcrystl, mgcrystl, kaneko16_state, empty_init, ROT0, "Kaneko", "Magical Crystals (World, 91/12/10)", MACHINE_SUPPORTS_SAVE ) GAME( 1991, mgcrystlj, mgcrystl, mgcrystl, mgcrystl, kaneko16_state, empty_init, ROT0, "Kaneko (Atlus license)", "Magical Crystals (Japan, 92/01/13)", MACHINE_SUPPORTS_SAVE ) -GAME( 1992, blazeon, 0, blazeon, blazeon, kaneko16_state, empty_init, ROT0, "A.I (Atlus license)", "Blaze On (World)", MACHINE_SUPPORTS_SAVE ) -GAME( 1992, blazeonj, blazeon, blazeon, blazeon, kaneko16_state, empty_init, ROT0, "A.I (Atlus license)", "Blaze On (Japan)", MACHINE_SUPPORTS_SAVE ) +GAME( 1992, blazeon, 0, blazeon, blazeon, kaneko16_blazeon_state, empty_init, ROT0, "A.I (Atlus license)", "Blaze On (World)", MACHINE_SUPPORTS_SAVE ) +GAME( 1992, blazeonj, blazeon, blazeon, blazeon, kaneko16_blazeon_state, empty_init, ROT0, "A.I (Atlus license)", "Blaze On (Japan)", MACHINE_SUPPORTS_SAVE ) GAME( 1992, explbrkr, 0, bakubrkr, bakubrkr, kaneko16_state, init_bakubrkr, ROT90, "Kaneko", "Explosive Breaker (World)", MACHINE_SUPPORTS_SAVE ) GAME( 1992, explbrkrk, explbrkr, bakubrkr, bakubrkr, kaneko16_state, init_bakubrkr, ROT90, "Kaneko", "Explosive Breaker (Korea)", MACHINE_SUPPORTS_SAVE ) GAME( 1992, bakubrkr, explbrkr, bakubrkr, bakubrkr, kaneko16_state, init_bakubrkr, ROT90, "Kaneko", "Bakuretsu Breaker (Japan)", MACHINE_SUPPORTS_SAVE ) -GAME( 1993, wingforc, 0, wingforc, wingforc, kaneko16_state, init_bakubrkr, ROT270,"A.I (Atlus license)", "Wing Force (Japan, prototype)", MACHINE_SUPPORTS_SAVE ) +GAME( 1993, wingforc, 0, wingforc, wingforc, kaneko16_blazeon_state, init_bakubrkr, ROT270,"A.I (Atlus license)", "Wing Force (Japan, prototype)", MACHINE_SUPPORTS_SAVE ) GAME( 1994, bonkadv, 0, bonkadv, bonkadv, kaneko16_gtmr_state, init_gtmr, ROT0, "Kaneko", "B.C. Kid / Bonk's Adventure / Kyukyoku!! PC Genjin", MACHINE_SUPPORTS_SAVE ) GAME( 1994, bonkadva, bonkadv, bonkadv, bonkadv, kaneko16_gtmr_state, init_gtmr, ROT0, "Kaneko", "Bonk's Adventure (prototype)", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) // shows an upside down KO! sprite, probably cause of check failing. Playable apart from that diff --git a/src/mame/kaneko/kaneko16.h b/src/mame/kaneko/kaneko16.h index fa38b935688d6..40ca5e46818af 100644 --- a/src/mame/kaneko/kaneko16.h +++ b/src/mame/kaneko/kaneko16.h @@ -43,13 +43,9 @@ class kaneko16_state : public driver_device m_view2(*this, "view2_%u", 0), m_kaneko_hit(*this, "kan_hit"), m_kaneko_spr(*this, "kan_spr"), - m_kaneko_calc3(*this, "calc3_prot"), - m_toybox(*this, "toybox"), m_screen(*this, "screen"), m_palette(*this, "palette"), - m_bgpalette(*this, "bgpalette"), m_eeprom(*this, "eeprom"), - m_soundlatch(*this, "soundlatch"), m_watchdog(*this, "watchdog"), m_spriteram(*this, "spriteram"), m_mainregion(*this, "maincpu"), @@ -57,37 +53,28 @@ class kaneko16_state : public driver_device m_mcuram(*this, "mcuram"), m_okiregion(*this, "oki%u", 1), m_okibank(*this, "okibank%u", 1), - m_p2_port(*this, "P2"), - m_fake_port(*this, "FAKE"), m_dsw_port(*this, "DSW1"), - m_eepromout_port(*this, "EEPROMOUT"), - m_wheel_port(*this, "WHEEL%u", 0U), - m_audiocpu(*this, "audiocpu"), - m_ymsnd(*this, "ymsnd") + m_eepromout_port(*this, "EEPROMOUT") { } - void init_bakubrkr(); + void init_bakubrkr() ATTR_COLD; - void bakubrkr(machine_config &config); - void wingforc(machine_config &config); - void blazeon(machine_config &config); - void mgcrystl(machine_config &config); + void bakubrkr(machine_config &config) ATTR_COLD; + void mgcrystl(machine_config &config) ATTR_COLD; protected: + virtual void video_start() override ATTR_COLD; + required_device m_maincpu; optional_device_array m_ym2149; optional_device_array m_oki; optional_device_array m_view2; optional_device m_kaneko_hit; required_device m_kaneko_spr; - optional_device m_kaneko_calc3; - optional_device m_toybox; required_device m_screen; required_device m_palette; - optional_device m_bgpalette; optional_device m_eeprom; - optional_device m_soundlatch; optional_device m_watchdog; optional_device m_spriteram; @@ -98,33 +85,29 @@ class kaneko16_state : public driver_device optional_memory_region_array<2> m_okiregion; optional_memory_bank_array<2> m_okibank; - optional_ioport m_p2_port; - optional_ioport m_fake_port; optional_ioport m_dsw_port; optional_ioport m_eepromout_port; - optional_ioport_array<3> m_wheel_port; u16 m_disp_enable = 0U; int m_VIEW2_2_pri = 0; - virtual void common_oki_bank_install(int bankno, size_t fixedsize, size_t bankedsize); + virtual void common_oki_bank_install(int bankno, size_t fixedsize, size_t bankedsize) ATTR_COLD; void coin_lockout_w(u8 data); void bloodwar_coin_lockout_w(u8 data); void display_enable_w(offs_t offset, u16 data, u16 mem_mask = ~0); // (u16 data, u16 mem_mask = ~0); - template u16 ym2149_r(offs_t offset); - template void ym2149_w(offs_t offset, u16 data, u16 mem_mask = ~0); - template void oki_bank0_w(u8 data); - template void oki_bank1_w(u8 data); + template u16 ym2149_r(offs_t offset); + template void ym2149_w(offs_t offset, u16 data, u16 mem_mask = ~0); + template void oki_bank0_w(u8 data); + template void oki_bank1_w(u8 data); DECLARE_MACHINE_RESET(gtmr); DECLARE_MACHINE_RESET(mgcrystl); - virtual void video_start() override ATTR_COLD; u32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - template + template u32 screen_update_common(screen_device &screen, BitmapClass &bitmap, const rectangle &cliprect); TIMER_DEVICE_CALLBACK_MEMBER(interrupt); @@ -132,45 +115,75 @@ class kaneko16_state : public driver_device template void fill_bitmap(BitmapClass &bitmap, const rectangle &cliprect); + void bakubrkr_oki1_map(address_map &map) ATTR_COLD; void gtmr_oki1_map(address_map &map) ATTR_COLD; void gtmr_oki2_map(address_map &map) ATTR_COLD; private: - optional_device m_audiocpu; - optional_device m_ymsnd; - u8 eeprom_r(); void eeprom_w(u8 data); void eeprom_cs_w(u8 data); void bakubrkr_map(address_map &map) ATTR_COLD; - void bakubrkr_oki1_map(address_map &map) ATTR_COLD; + void mgcrystl_map(address_map &map) ATTR_COLD; +}; + +// with 2 Sprite chips, Z80 based sound subsystem +class kaneko16_blazeon_state : public kaneko16_state +{ +public: + kaneko16_blazeon_state(const machine_config &mconfig, device_type type, const char *tag) : + kaneko16_state(mconfig, type, tag), + m_audiocpu(*this, "audiocpu"), + m_ymsnd(*this, "ymsnd"), + m_soundlatch(*this, "soundlatch") + { + } + + void wingforc(machine_config &config) ATTR_COLD; + void blazeon(machine_config &config) ATTR_COLD; + +private: + required_device m_audiocpu; + required_device m_ymsnd; + required_device m_soundlatch; + void blazeon_map(address_map &map) ATTR_COLD; void blazeon_soundmem(address_map &map) ATTR_COLD; void blazeon_soundport(address_map &map) ATTR_COLD; - void mgcrystl_map(address_map &map) ATTR_COLD; void wingforc_soundport(address_map &map) ATTR_COLD; }; +// with Toybox MCU class kaneko16_gtmr_state : public kaneko16_state { public: kaneko16_gtmr_state(const machine_config &mconfig, device_type type, const char *tag) : - kaneko16_state(mconfig, type, tag) + kaneko16_state(mconfig, type, tag), + m_toybox(*this, "toybox"), + m_p2_port(*this, "P2"), + m_fake_port(*this, "FAKE"), + m_wheel_port(*this, "WHEEL%u", 0U) { } - void init_gtmr(); - void bonkadv(machine_config &config); - void gtmr(machine_config &config); - void gtmr2(machine_config &config); - void gtmre(machine_config &config); - void bloodwar(machine_config &config); + void init_gtmr() ATTR_COLD; + + void bonkadv(machine_config &config) ATTR_COLD; + void gtmr(machine_config &config) ATTR_COLD; + void gtmr2(machine_config &config) ATTR_COLD; + void gtmre(machine_config &config) ATTR_COLD; + void bloodwar(machine_config &config) ATTR_COLD; protected: - virtual void common_oki_bank_install(int bankno, size_t fixedsize, size_t bankedsize) override; + virtual void common_oki_bank_install(int bankno, size_t fixedsize, size_t bankedsize) override ATTR_COLD; private: + required_device m_toybox; + optional_ioport m_p2_port; + optional_ioport m_fake_port; + optional_ioport_array<3> m_wheel_port; + u16 gtmr_wheel_r(); u16 gtmr2_wheel_r(); u16 gtmr2_IN1_r(); @@ -181,6 +194,7 @@ class kaneko16_gtmr_state : public kaneko16_state void gtmr_map(address_map &map) ATTR_COLD; }; +// with hi-color background layer class kaneko16_berlwall_state : public kaneko16_state { public: @@ -191,21 +205,25 @@ class kaneko16_berlwall_state : public kaneko16_state { } - void init_berlwall(); - void init_berlwallk(); - void init_berlwallt(); - void init_berlwall_common(); - void berlwall(machine_config &config); + void init_berlwall() ATTR_COLD; + void init_berlwallk() ATTR_COLD; + void init_berlwallt() ATTR_COLD; + void init_berlwall_common() ATTR_COLD; + + void berlwall(machine_config &config) ATTR_COLD; protected: virtual void video_start() override ATTR_COLD; private: - optional_shared_ptr m_bg15_scroll; + required_shared_ptr m_bg15_scroll; required_device m_bgpalette; bitmap_ind16 m_bg15_bitmap[32]; + u8 m_bg15_select = 0U; + u8 m_bg15_bright = 0U; + u8 bg15_select_r(); void bg15_select_w(u8 data); u8 bg15_bright_r(); @@ -218,16 +236,14 @@ class kaneko16_berlwall_state : public kaneko16_state u16 berlwall_spriteregs_r(offs_t offset); void berlwall_spriteregs_w(offs_t offset, u16 data, u16 mem_mask = ~0); - u8 m_bg15_select = 0U; - u8 m_bg15_bright = 0U; - u32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); void render_15bpp_bitmap(bitmap_rgb32 &bitmap, const rectangle &cliprect); - void patch_protection(u32 bra_offset,u16 bra_value,u16 checksum); + void patch_protection(u32 bra_offset,u16 bra_value,u16 checksum) ATTR_COLD; void berlwall_map(address_map &map) ATTR_COLD; }; +// with CALC3 MCU class kaneko16_shogwarr_state : public kaneko16_state { public: @@ -236,14 +252,15 @@ class kaneko16_shogwarr_state : public kaneko16_state m_calc3_prot(*this, "calc3_prot") { } - void init_shogwarr(); - void init_brapboys(); - void shogwarr(machine_config &config); - void brapboys(machine_config &config); + void init_shogwarr() ATTR_COLD; + void init_brapboys() ATTR_COLD; + + void shogwarr(machine_config &config) ATTR_COLD; + void brapboys(machine_config &config) ATTR_COLD; private: - optional_device m_calc3_prot; + required_device m_calc3_prot; TIMER_DEVICE_CALLBACK_MEMBER(shogwarr_interrupt); diff --git a/src/mame/kaneko/kaneko16_v.cpp b/src/mame/kaneko/kaneko16_v.cpp index eb057b8677e99..a87090bb7832f 100644 --- a/src/mame/kaneko/kaneko16_v.cpp +++ b/src/mame/kaneko/kaneko16_v.cpp @@ -78,7 +78,7 @@ u32 kaneko16_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, c void kaneko16_berlwall_state::video_start() { m_bg15_bright = 0xff; - u8 *RAM = memregion("gfx3")->base(); + u8 *RAM = memregion("bitmap")->base(); /* Render the hi-color static backgrounds held in the ROMs */ @@ -96,8 +96,8 @@ void kaneko16_berlwall_state::video_start() { for (int y = 0; y < 256; y++) { - int addr = screen * (256 * 256) + x + y * 256; - int data = RAM[addr * 2 + 0] * 256 + RAM[addr * 2 + 1]; + const int addr = screen * (256 * 256) + x + y * 256; + const int data = RAM[addr * 2 + 0] * 256 + RAM[addr * 2 + 1]; int r = (data & 0x07c0) >> 6; int g = (data & 0xf800) >> 11; @@ -162,14 +162,11 @@ void kaneko16_berlwall_state::render_15bpp_bitmap(bitmap_rgb32 &bitmap, const re if (!m_bg15_bitmap[0].valid()) return; - int select = m_bg15_select; - int scroll = m_bg15_scroll[ 0 ]; + const int screen = m_bg15_select & 0x1f; + const bool flip = BIT(m_bg15_select, 5); - int screen = select & 0x1f; - int flip = select & 0x20; - - int scrollx = (scroll >> 0) & 0xff; - int scrolly = (scroll >> 8) & 0xff; + int scrollx = (m_bg15_scroll[0] >> 0) & 0xff; + int scrolly = (m_bg15_scroll[0] >> 8) & 0xff; if (!flip) { @@ -186,19 +183,12 @@ void kaneko16_berlwall_state::render_15bpp_bitmap(bitmap_rgb32 &bitmap, const re for (int y = cliprect.min_y; y <= cliprect.max_y; y++) { - u16 const *srcbitmap; - if (!flip) srcbitmap = &m_bg15_bitmap[screen].pix( (y - scrolly) & 0xff ); - else srcbitmap = &m_bg15_bitmap[screen].pix( 255 - ((y - scrolly) & 0xff) ); - + u16 const *const srcbitmap = &m_bg15_bitmap[screen].pix((flip ? ~(y - scrolly) : (y - scrolly)) & 0xff); u32 *const dstbitmap = &bitmap.pix(y); for (int x = cliprect.min_x; x <= cliprect.max_x; x++) { - u16 pix; - - if (!flip) pix = srcbitmap[ (x - scrollx) & 0xff ]; - else pix = srcbitmap[ 255 - ((x - scrollx) & 0xff) ]; - + const u16 pix = srcbitmap[(flip ? ~(x - scrollx) : (x - scrollx)) & 0xff]; dstbitmap[x] = pal[pix]; } } diff --git a/src/mame/kaneko/kaneko_calc3.cpp b/src/mame/kaneko/kaneko_calc3.cpp index c9da9b772bebf..f8e5747904fcb 100644 --- a/src/mame/kaneko/kaneko_calc3.cpp +++ b/src/mame/kaneko/kaneko_calc3.cpp @@ -19,14 +19,18 @@ - Supply code / data snippets to the 68000 by decrypting them from ROM - may also be responsible for the hit detection (kaneko_hit.c) + may also be responsible for the hit detection (kaneko/kaneko_hit.cpp) */ #include "emu.h" #include "kaneko_calc3.h" -#define VERBOSE_OUTPUT 0 +//#define VERBOSE 1 +#include "logmacro.h" + + +#define DUMP_TABLES 0 DEFINE_DEVICE_TYPE(KANEKO_CALC3, kaneko_calc3_device, "kaneko_calc3", "Kaneko CALC3 MCU") @@ -36,7 +40,8 @@ kaneko_calc3_device::kaneko_calc3_device(const machine_config &mconfig, const ch , m_maincpu(*this, finder_base::DUMMY_TAG) , m_eeprom(*this, finder_base::DUMMY_TAG) , m_calc3_region(*this, finder_base::DUMMY_TAG) - , m_mcuram(*this, ":mcuram") + , m_mcuram(*this, finder_base::DUMMY_TAG) + , m_dsw_port(*this, finder_base::DUMMY_TAG) , m_mcu_status(0) , m_mcu_command_offset(0) , m_mcu_crc(0) @@ -180,7 +185,7 @@ where games specify the same decryption key the table used is the same, I don't /* decryption tables */ /* this should probably be derived from the final block at the end of the MCU rom somehow ... - (see 'finalblock' debug output when verbose = 1) + (see 'finalblock' debug output when DUMP_TABLES = 1) for now just putting it in a bit table, only used keys are filled in as nothing else was extracted when getting the tables, unknown values are filled in as -1 @@ -188,1034 +193,1033 @@ where games specify the same decryption key the table used is the same, I don't part of the table to be 0 */ -const int16_t kaneko_calc3_device::s_keydata[] = { -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0xce,0x55,0xa1,0x56,0x20,0xe0,0xcb,0xa9,0x5b,0x9b,0xd6,0x9b,0x5e,0x6e,0x6c,0xf6, -0xf8,0x16,0xb6,0x03,0x76,0xcb,0x47,0x51,0xed,0x20,0xcc,0xb3,0x4c,0x2a,0x74,0x88, -0x20,0xe4,0x1f,0x3f,0x25,0xd2,0x49,0x19,0x90,0xe5,0xb4,0x31,0x1e,0x9f,0xd7,0xba, -0xda,0x77,0x08,0x89,0xb1,0x7f,0x6b,0xd3,0xb6,0x44,0x99,0x37,0x35,0xf6,0x0f,0xff, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -0x01,0x4a,0x9e,0xa3,0x0c,0xb4,0x74,0x2d,0x7c,0xbd,0x79,0x3a,0x62,0xe9,0x29,0x12, -0x01,0x50,0xc0,0x39,0x5a,0x47,0x27,0x38,0x77,0x3c,0x9e,0xa0,0x7a,0xe2,0x29,0x4d, -0x64,0x8e,0xbb,0xe8,0xa5,0xe1,0x23,0xaf,0x67,0xa8,0xb9,0x79,0x99,0x00,0xc8,0xf4, -0xbd,0xbe,0xb9,0x32,0x71,0x0e,0x03,0x64,0xbe,0x59,0xd5,0xe5,0x22,0x6d,0x80,0x7a, -0x5e,0xd8,0xa6,0xd7,0x00,0x94,0x23,0x66,0xaf,0xea,0xbe,0x45,0x38,0x90,0x8e,0x8d, -0x5b,0x14,0x2c,0xda,0x55,0x7e,0x9d,0x08,0x2d,0x31,0xfd,0x3a,0xbe,0x13,0xeb,0x21, -0x87,0xee,0xb7,0x7b,0x34,0x15,0x4d,0xd9,0xeb,0x4a,0xde,0xa6,0x57,0xdf,0x53,0x65, -0x75,0x1c,0x72,0x3a,0x20,0xe1,0xcd,0xac,0x5d,0x8c,0x6d,0xa9,0x66,0x1d,0x41,0xca, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -0xca,0x23,0x9e,0x00,0x37,0x72,0x61,0x0d,0x71,0x99,0x02,0xb1,0x5b,0x8f,0x50,0x22, -0x06,0xdb,0xd6,0xd5,0x44,0x42,0xcd,0x44,0xf0,0xa2,0xc4,0xef,0xfa,0x1e,0x11,0xa1, -0x34,0x7b,0xf6,0xf4,0xdf,0xca,0x92,0x17,0xf3,0x48,0x8d,0xcf,0x30,0x82,0x81,0xbc, -0xe8,0xbd,0x29,0xde,0x89,0x94,0x4b,0x57,0xed,0xe3,0x66,0x73,0x60,0xe4,0x1b,0xe5, -0x75,0x98,0x5b,0x53,0x88,0x69,0x54,0x16,0x11,0x0d,0x1c,0x3b,0xae,0xad,0x1a,0xcd, -0xed,0x47,0x37,0x56,0xdd,0x51,0xc8,0xa3,0x52,0x9f,0x38,0xc8,0xfb,0x86,0x78,0x64, -0x25,0x42,0x27,0x26,0x4b,0x95,0x80,0x90,0x64,0xb1,0x07,0xfb,0xeb,0x58,0xf2,0xdc, -0xad,0x42,0x57,0x45,0x56,0xbf,0x19,0xaf,0xb9,0x9d,0x93,0xf6,0xe1,0x4c,0x01,0xa5, -0xdb,0x40,0xb2,0x74,0x40,0x97,0xee,0x0f,0x84,0xfc,0xa7,0x19,0x01,0xcb,0xe1,0x71, -0xc1,0x75,0xe2,0xb4,0x0d,0x26,0x19,0x03,0xb9,0xa6,0xce,0x06,0x2c,0x7d,0x8d,0x30, -0x31,0x5b,0x52,0x45,0x7f,0xb7,0x75,0x1a,0x09,0xb5,0x53,0x9c,0x06,0x4d,0xc0,0x14, -0xbf,0xaa,0x2f,0xa9,0x1a,0xd0,0x9d,0x27,0xe9,0x82,0x41,0xff,0xf2,0x63,0xf5,0x8e, -0xbd,0x5b,0x62,0xa2,0x20,0x3c,0xed,0x3a,0x8b,0xa6,0x64,0x8d,0x13,0x27,0x67,0x4e, -0x40,0xa7,0x96,0x2f,0x95,0x04,0x7f,0xa4,0xe3,0xf9,0x45,0xe9,0x4c,0x44,0x10,0x46, -0x19,0x08,0x38,0x91,0x3b,0x70,0x2f,0xf5,0xa2,0x95,0x31,0xf3,0x40,0xa2,0xad,0xa6, -0xdb,0x35,0x70,0x4b,0x96,0x09,0x97,0x00,0x3d,0xd2,0x32,0xcc,0x52,0x69,0xb7,0xe0, -0xdb,0x29,0x2c,0x1d,0xe8,0x99,0x12,0xd6,0xe6,0x4b,0x12,0xd6,0xa6,0x04,0x6a,0xa5, -0x2a,0x1c,0x15,0x07,0x35,0x28,0xbc,0xc6,0x90,0xd7,0x5e,0xb1,0x1d,0x1a,0xc1,0xe5, -0x9c,0x88,0x96,0x4b,0x3f,0x00,0x6f,0x62,0xef,0x90,0x60,0x3f,0x5b,0x95,0x77,0xd1, -0xc4,0x24,0xdc,0x6a,0x8a,0xa9,0xc6,0x7b,0x74,0xce,0x24,0x9f,0xc3,0x9f,0x06,0xdc, -0xf4,0xeb,0xd0,0x25,0x58,0xed,0x1d,0x23,0x54,0x2b,0x73,0x34,0x78,0x9f,0xab,0xb5, -0x41,0x15,0x1d,0x7c,0xac,0xd4,0x8e,0xa9,0x82,0x80,0xd9,0x9f,0x5d,0x3f,0x5f,0x4d, -0x7c,0x1b,0x2f,0xb2,0x4b,0xa7,0xf4,0xa0,0xaf,0xe6,0xa2,0xc0,0x15,0x68,0xde,0xd6, -0x38,0xb6,0x31,0x46,0xb5,0xf0,0xeb,0xd7,0x50,0xb5,0xd7,0xb8,0x03,0x43,0xa4,0xc0, -0xca,0xe0,0x0d,0xfa,0x2f,0x78,0xcd,0x61,0x97,0x87,0x45,0xe8,0x4a,0x39,0xe9,0xbe, -0x43,0xd0,0x6f,0xcf,0xbc,0x47,0xb6,0x8e,0x77,0x35,0x76,0xf2,0xcc,0xf3,0xab,0xbe, -0x77,0x01,0xc1,0x06,0x1e,0xa6,0x80,0xef,0xa3,0xd7,0xb5,0xb6,0x2e,0x5a,0xa4,0xf4, -0xf8,0x2b,0x30,0x20,0xd8,0x1f,0xc6,0x55,0x8f,0xc7,0x0d,0x55,0xd2,0x97,0x4f,0xce, -0x1b,0x48,0xa4,0xdd,0x2e,0x7a,0xe3,0xd1,0x6d,0x9e,0x49,0x31,0xdb,0x13,0xe6,0x00, -0xf1,0x8f,0xcb,0x3f,0x23,0xc1,0xf3,0xb4,0x30,0x35,0xf4,0xea,0x2c,0x77,0x65,0x79, -0x4e,0x7b,0x0e,0x87,0x79,0x3c,0xd1,0x8f,0x8b,0xa4,0x5a,0x61,0x68,0xac,0x87,0x6b, -0xc4,0xc4,0x98,0x36,0xb3,0x75,0x16,0x33,0xf2,0x45,0x84,0xb8,0xf2,0xdb,0xc7,0x46, -0xa8,0x63,0x55,0x0d,0x15,0x34,0x1f,0xb2,0x96,0xb0,0x3f,0x4f,0xec,0x6c,0x60,0xbb, -0x0b,0x91,0xf0,0x0d,0xa2,0x83,0x07,0x5b,0x6c,0xc0,0x14,0xc7,0x3b,0x0a,0x4d,0xbd, -0xc0,0xc8,0xd3,0x76,0x1c,0xaa,0xa8,0xc1,0x27,0x8c,0x50,0x02,0x81,0x9d,0x48,0x7b, -0x5c,0xc0,0x2a,0xca,0x06,0x32,0x9d,0xb3,0x38,0x6d,0xfd,0x20,0x21,0x4d,0xce,0x66, -0x30,0x72,0xe0,0xca,0xa4,0xe5,0x41,0x44,0xd4,0xfe,0xe6,0x82,0x3e,0x85,0x18,0x30, -0x50,0x17,0x9f,0x77,0xf8,0xcb,0xb0,0xc4,0xed,0x16,0x96,0xca,0xba,0xec,0x22,0xca, -0x8f,0x28,0xd3,0x12,0xc6,0x2e,0xc4,0xc3,0x36,0xcf,0x59,0xd8,0x3a,0x6c,0xa7,0x64, -0x7f,0x5f,0xa6,0x1b,0x90,0x96,0x19,0x14,0x22,0x81,0x38,0xcd,0x20,0x2f,0x22,0x70, -0x74,0xb4,0x04,0x55,0x9a,0xcd,0x09,0xc7,0xe5,0xc7,0xff,0x0b,0x8e,0x9c,0xce,0x9e, -0x81,0x5f,0x98,0xbf,0xe7,0xdb,0xaf,0x2d,0x71,0x77,0x3a,0x32,0x69,0x5d,0xa5,0xe0, -0x79,0xdc,0xcc,0x9b,0x38,0x0a,0xe6,0xd7,0x79,0xad,0x33,0x23,0x53,0x5c,0x64,0x67, -0xee,0xe1,0xcc,0x6a,0x13,0xe2,0x4a,0x97,0x71,0xc0,0xf4,0x00,0xae,0xc0,0x84,0xa3, -0x34,0x69,0x83,0xec,0xb8,0x2c,0x36,0x7c,0x8a,0x4b,0x4a,0x29,0x9f,0xf3,0x41,0x46, -0x5e,0xab,0x9b,0x24,0x2d,0xf2,0xc4,0xd8,0xb9,0x24,0xbf,0x3f,0x08,0x9e,0x96,0x40, -0x3f,0x22,0x7f,0x51,0x32,0x7d,0xcf,0x3d,0xb0,0x67,0x9f,0x24,0x8b,0xaa,0x3e,0xc3, -0x69,0x87,0x5c,0xf5,0x4d,0x55,0xf2,0x7a,0xe2,0x6b,0xf3,0xf8,0x8d,0x40,0xb4,0x3f, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -0xfe,0xf7,0xc7,0x85,0xe4,0xd3,0x93,0xd0,0x36,0x61,0xc8,0x4d,0x0c,0x3e,0x2a,0x1c, -0x32,0x1a,0xbf,0x1a,0xb0,0x60,0xb5,0xa8,0x1a,0x19,0x16,0xaf,0x96,0x0d,0x2d,0xe0, -0xb1,0x2c,0xb6,0x41,0xe1,0x2d,0xc8,0xe5,0xd9,0x75,0x82,0xfa,0x90,0x3a,0x77,0x09, -0x0e,0xe8,0xda,0x7a,0xfb,0xc4,0x68,0x57,0xe8,0xcf,0x18,0x51,0x5b,0xed,0x83,0x08, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -0x75,0x49,0x7a,0xd6,0x84,0xbd,0x70,0xbe,0x10,0x19,0x6c,0xb2,0xa9,0x5f,0x6b,0x78, -0x14,0x29,0x2a,0x15,0xd0,0x4a,0x10,0x93,0x69,0xb2,0xdf,0x02,0x7f,0x92,0x19,0xbd, -0x95,0xc1,0x32,0xee,0x99,0x5e,0x7a,0x55,0x37,0xb7,0xc8,0x45,0xdc,0x6a,0xe6,0xef, -0x8b,0xca,0xbe,0xe2,0x63,0x85,0x49,0xd3,0xeb,0x83,0x32,0x9a,0x23,0x11,0x4c,0x7e, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -0x02,0xdf,0x0f,0x0e,0x98,0x3a,0xa7,0xaf,0xbd,0xb0,0xe6,0x3a,0x8d,0xeb,0xb4,0x3b, -0x18,0x67,0x78,0xbb,0xeb,0x1c,0x09,0x06,0x5c,0x5c,0x51,0xb1,0x98,0xfe,0xc0,0xdc, -0x6d,0xbc,0x77,0xb5,0xd7,0xda,0x2f,0x3d,0x4c,0x08,0xee,0x4f,0xc7,0x8a,0x68,0xde, -0x94,0x96,0x35,0x7e,0xe0,0xfe,0xb7,0x26,0xff,0x0e,0xc7,0x34,0x7b,0xb8,0x25,0xb1, -0xe0,0xee,0x9d,0xd7,0x49,0x50,0xf9,0xd0,0xa8,0x07,0xa9,0xc1,0xd8,0xf1,0x33,0x07, -0x63,0xfe,0x5b,0xc0,0x13,0xda,0x12,0x8e,0x3a,0xcc,0x1e,0x97,0xc1,0xdd,0x8d,0xd1, -0xf2,0x3e,0xda,0x7c,0x04,0xe4,0xdc,0xef,0x69,0x75,0x72,0x98,0xd9,0x67,0xee,0x3f, -0x1d,0x66,0x44,0x8a,0x9c,0xf7,0xf2,0xc6,0xa7,0x5c,0xae,0xe4,0x83,0xb7,0xd1,0xc2, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -0xd0,0xa8,0x87,0xcf,0xe1,0x22,0x8d,0xe7,0xfa,0x26,0x85,0xce,0x6d,0xfa,0x2c,0x8b, -0xbd,0x75,0xfe,0x64,0x2b,0xab,0x25,0xa1,0x02,0xcc,0x1f,0x93,0xa2,0x4a,0x31,0xd5, -0x4d,0x3a,0x8e,0xd2,0xb3,0xfd,0x46,0x87,0x3f,0x1f,0xef,0x8a,0x1e,0x7f,0x15,0x4c, -0x13,0xb1,0x61,0x9b,0xfc,0xa0,0x8b,0x6b,0x22,0x78,0x00,0xd5,0x44,0xc3,0x52,0x60, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -0xaf,0x2e,0xd9,0xfd,0x18,0xd1,0xb8,0xc2,0x9b,0x33,0x28,0x30,0x01,0xff,0x1c,0xf4, -0xc6,0xf9,0xc9,0x7c,0xa2,0x9a,0x8f,0xb9,0xd9,0xfa,0xa7,0x24,0x42,0xf3,0x8b,0xff, -0x18,0x84,0x29,0xdd,0x82,0x73,0xc7,0x64,0xe3,0x37,0xb3,0x52,0xe2,0x14,0xb2,0xbe, -0x37,0x88,0x25,0xa0,0x3b,0xe6,0xfb,0x94,0x2d,0x41,0x59,0xdb,0x44,0x8b,0x0b,0xa3, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -0x7c,0x82,0x91,0x60,0xee,0x5d,0x7a,0x63,0x8a,0x2c,0x91,0xe7,0x94,0x02,0x02,0x42, -0x7d,0x8a,0xba,0x09,0x78,0xa6,0x50,0xd6,0xbe,0x55,0xb5,0x49,0xa1,0xda,0x9d,0x4d, -0x51,0x1b,0xab,0x9d,0x70,0x47,0x5f,0x86,0x57,0xbb,0xbf,0xee,0x24,0x27,0xc6,0x95, -0x8b,0xec,0x90,0x9b,0x58,0xc9,0x42,0x43,0xc6,0xb7,0xba,0xf6,0x82,0x11,0xfa,0x8b, -0x7d,0xf8,0x54,0xc5,0x74,0xf6,0x54,0x1d,0x40,0xe1,0x71,0xc2,0xdd,0x03,0x72,0xdf, -0x3b,0x77,0xa1,0x1c,0xc7,0xd6,0xb1,0x67,0xb7,0x13,0x6f,0xf4,0x18,0xa4,0x2a,0x82, -0x98,0xe3,0xe3,0xe1,0x12,0xb3,0x33,0xb1,0xde,0x66,0xff,0x6c,0xd5,0xde,0xdd,0xa6, -0x26,0xf3,0x44,0x94,0xdb,0x15,0x76,0xcc,0x28,0x33,0x2d,0x4b,0x79,0xdb,0x06,0xbc, -0x39,0xa2,0xb0,0xf7,0x63,0xc6,0xd4,0xc9,0xc9,0x12,0xc2,0xf3,0x26,0x02,0xe0,0x75, -0xe4,0x28,0xd2,0x0c,0xad,0xce,0x68,0xf9,0xb3,0xdd,0x4b,0x04,0xbe,0xfd,0x65,0xc1, -0xfa,0xfe,0x14,0x12,0x7d,0x77,0x0e,0xed,0x99,0xad,0x11,0x5f,0xe6,0xb6,0x52,0xd1, -0x0d,0xde,0xa2,0x8a,0x55,0x49,0x60,0x76,0xee,0xda,0x21,0x26,0x00,0x54,0x20,0x17, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -0x27,0xb4,0xc1,0xba,0x5f,0xd4,0x47,0x04,0x1f,0xfe,0x42,0xa5,0xce,0xb5,0x23,0xbe, -0x42,0xcc,0x59,0x71,0x51,0x13,0x41,0xa4,0x18,0x35,0xcf,0x02,0x0d,0xe1,0xfb,0x43, -0xc5,0x28,0xed,0xae,0x84,0x27,0xe8,0xdc,0x89,0xe5,0xf6,0xbe,0x16,0x7e,0x57,0xe1, -0x41,0x82,0xa9,0xf1,0x7c,0x98,0xd7,0x7c,0xe5,0x67,0xc2,0xf9,0x4d,0xb6,0xb0,0x09, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -0x33,0x8e,0x6f,0x22,0xac,0x01,0x9f,0x7a,0xc7,0xca,0x23,0xc4,0xa4,0x9c,0x07,0xf8, -0x98,0xc1,0x17,0x4a,0xb2,0xbc,0xcc,0xf4,0x0e,0x2e,0xf6,0x35,0xdd,0xf6,0x29,0x9a, -0x2f,0x9c,0xe8,0x7c,0x86,0xf0,0x93,0xca,0x1a,0xee,0x10,0x08,0xec,0xe5,0x3a,0x98, -0x8c,0xd8,0x0d,0x39,0xaa,0x25,0x8d,0xcd,0x5d,0x64,0x7a,0x5f,0x35,0x92,0xb5,0x64, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -0xdd,0xa9,0x15,0x18,0x9d,0x01,0x24,0x9c,0xed,0x7a,0xeb,0x42,0x8b,0x9e,0xf3,0x72, -0x26,0xc9,0x45,0x18,0xea,0xd2,0x54,0x5f,0xcf,0xed,0xac,0xbc,0xa1,0xd0,0x5f,0x2f, -0xce,0x15,0x2a,0xc6,0xf1,0xe0,0x69,0x62,0x22,0xc1,0xc0,0xbd,0xfa,0xdc,0x85,0xac, -0x67,0x47,0xee,0xa2,0x35,0xb3,0xff,0x76,0x57,0x4f,0x30,0x66,0xf8,0xe9,0xe0,0x5b, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -0x0f,0x35,0xa3,0x7c,0xf1,0x75,0xea,0x27,0x36,0x4d,0x4b,0x1a,0x3b,0x24,0xef,0x9d, -0x4e,0x39,0x7e,0x7b,0x3d,0x42,0x0d,0xc2,0x9f,0x53,0xc7,0xc4,0xdf,0x02,0x5d,0x61, -0x0c,0xc9,0x2d,0x89,0x63,0xab,0x34,0xfc,0x97,0x1b,0xb5,0x54,0xe6,0x19,0xa5,0x46, -0xdc,0x9e,0xdc,0x25,0xe4,0x3a,0xfc,0xa7,0x93,0xfc,0x1f,0xec,0xb3,0x92,0x43,0xbc, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -0x5d,0xdd,0xd4,0xbe,0xc0,0xff,0xe1,0x1b,0x3a,0xd6,0x61,0xc8,0x90,0x02,0x23,0x08, -0xfa,0x7a,0xfa,0x1d,0xab,0x2b,0xa0,0x0b,0x24,0xe1,0x6b,0x9e,0x38,0x6b,0xb2,0xae, -0xdd,0xfa,0xfc,0xa2,0xb8,0xcb,0xed,0x33,0x66,0x06,0xef,0x72,0x8b,0xe5,0xa3,0x0d, -0x9b,0x18,0x05,0xce,0x6a,0x69,0x61,0x64,0x74,0x9c,0xf9,0x66,0xec,0x99,0x72,0x95, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -0x2c,0xf3,0x0d,0x50,0x30,0x77,0xc2,0x25,0x91,0x83,0x5f,0xac,0xf4,0x56,0x96,0xc8, -0x70,0x86,0x16,0x5a,0x1b,0xa1,0x7d,0x08,0x53,0x15,0xfd,0x3c,0xcb,0x4d,0xd0,0x70, -0x5c,0x1d,0x5c,0xaa,0x87,0x60,0x24,0x42,0xcc,0xe0,0x75,0xeb,0xae,0x75,0xcc,0xf1, -0x81,0x71,0x09,0xc0,0xf8,0x3c,0x55,0xa6,0x71,0x3c,0xd2,0xda,0xfe,0xf8,0x07,0xbc, -0x33,0x7c,0x08,0x5e,0xb1,0xff,0x68,0x44,0x75,0xc3,0xdf,0x68,0xdf,0x3d,0xba,0x81, -0x84,0x76,0x06,0x85,0xb4,0xb1,0x7a,0x6d,0xc9,0x4e,0x27,0x38,0x35,0xee,0xe1,0x32, -0x48,0xd8,0x6b,0x76,0xc4,0x9b,0x65,0xb2,0x22,0xf5,0xf6,0x2a,0xa1,0xf4,0x37,0x00, -0x12,0x5b,0x65,0xb2,0x65,0x47,0xc5,0xe4,0xf2,0x13,0x55,0x60,0x87,0x78,0x37,0x5b, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -0xeb,0xd8,0xb6,0x33,0x90,0xbf,0x13,0x7f,0xd8,0x00,0xce,0xe0,0x48,0x79,0x78,0xd7, -0xd7,0x62,0xa3,0xe7,0x7b,0xe8,0xc9,0x54,0x71,0x18,0xff,0x2b,0x4f,0xff,0x5e,0x82, -0xca,0x10,0x2c,0x01,0x47,0xc5,0xcc,0xa2,0x22,0x89,0x6b,0xb4,0xc1,0xd6,0x66,0x26, -0x56,0x9b,0x7c,0x02,0x77,0xe0,0xb8,0x38,0x5f,0xac,0x1b,0x9d,0x00,0x27,0x0c,0x33, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -0x65,0x19,0xf5,0x62,0x7a,0x92,0xc5,0x4a,0x55,0xcc,0x2f,0xf8,0x6c,0x79,0x34,0x3d, -0xa4,0x9e,0xd3,0xec,0xe4,0x3a,0xf9,0x99,0x5a,0x28,0x2a,0xa0,0x8a,0x46,0xef,0x69, -0x1b,0xd7,0xfd,0xeb,0x60,0x26,0x2a,0x6f,0xa7,0x6c,0x0f,0x97,0x44,0xf4,0x7d,0x9e, -0x5b,0x7d,0xa0,0xe1,0x70,0xe0,0xf3,0x9f,0xb0,0xf3,0xea,0xfd,0xfc,0xac,0x58,0x4d, -0xb8,0x8a,0xa5,0x8f,0x58,0x30,0xb0,0x38,0xa6,0x53,0x84,0x33,0xd4,0xd7,0xbd,0x26, -0x45,0x35,0xb7,0xf6,0x1a,0x20,0x7b,0x8d,0x7e,0x68,0x69,0xdb,0xb1,0x1e,0xa5,0x1a, -0xd5,0xf9,0x42,0x57,0x7a,0xf8,0x30,0x2e,0xea,0x49,0xe5,0xd5,0x34,0x6a,0xcd,0x5b, -0xfa,0x8e,0x71,0x32,0xfa,0x42,0x69,0xec,0x5d,0x50,0x02,0x42,0xc2,0xe4,0xae,0x5a, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -0x9a,0x8e,0xcf,0x66,0xe0,0xd8,0xd4,0x2a,0x0f,0x4d,0xad,0x64,0x8c,0x6d,0xcb,0x37, -0x2e,0x0e,0x9f,0xc4,0xca,0xff,0x85,0xf1,0x7f,0xec,0x71,0x69,0xc2,0x81,0x5c,0xe4, -0x28,0xd2,0x6b,0xa9,0xf6,0xfb,0xe4,0x51,0x68,0x03,0xd0,0xcd,0xc3,0x07,0x6f,0xab, -0x1c,0x94,0x5f,0x94,0xe6,0x54,0x8b,0x1a,0x3c,0xed,0xd4,0xb0,0xf3,0x26,0x81,0xfa, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -}; - -uint8_t kaneko_calc3_device::shift_bits(uint8_t dat, int bits) +static const int16_t f_calc3_keydata[0x100][0x40] = { + { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, + { 0xce,0x55,0xa1,0x56,0x20,0xe0,0xcb,0xa9,0x5b,0x9b,0xd6,0x9b,0x5e,0x6e,0x6c,0xf6, + 0xf8,0x16,0xb6,0x03,0x76,0xcb,0x47,0x51,0xed,0x20,0xcc,0xb3,0x4c,0x2a,0x74,0x88, + 0x20,0xe4,0x1f,0x3f,0x25,0xd2,0x49,0x19,0x90,0xe5,0xb4,0x31,0x1e,0x9f,0xd7,0xba, + 0xda,0x77,0x08,0x89,0xb1,0x7f,0x6b,0xd3,0xb6,0x44,0x99,0x37,0x35,0xf6,0x0f,0xff }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { 0x01,0x4a,0x9e,0xa3,0x0c,0xb4,0x74,0x2d,0x7c,0xbd,0x79,0x3a,0x62,0xe9,0x29,0x12, + 0x01,0x50,0xc0,0x39,0x5a,0x47,0x27,0x38,0x77,0x3c,0x9e,0xa0,0x7a,0xe2,0x29,0x4d, + 0x64,0x8e,0xbb,0xe8,0xa5,0xe1,0x23,0xaf,0x67,0xa8,0xb9,0x79,0x99,0x00,0xc8,0xf4, + 0xbd,0xbe,0xb9,0x32,0x71,0x0e,0x03,0x64,0xbe,0x59,0xd5,0xe5,0x22,0x6d,0x80,0x7a }, + { 0x5e,0xd8,0xa6,0xd7,0x00,0x94,0x23,0x66,0xaf,0xea,0xbe,0x45,0x38,0x90,0x8e,0x8d, + 0x5b,0x14,0x2c,0xda,0x55,0x7e,0x9d,0x08,0x2d,0x31,0xfd,0x3a,0xbe,0x13,0xeb,0x21, + 0x87,0xee,0xb7,0x7b,0x34,0x15,0x4d,0xd9,0xeb,0x4a,0xde,0xa6,0x57,0xdf,0x53,0x65, + 0x75,0x1c,0x72,0x3a,0x20,0xe1,0xcd,0xac,0x5d,0x8c,0x6d,0xa9,0x66,0x1d,0x41,0xca }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { 0xca,0x23,0x9e,0x00,0x37,0x72,0x61,0x0d,0x71,0x99,0x02,0xb1,0x5b,0x8f,0x50,0x22, + 0x06,0xdb,0xd6,0xd5,0x44,0x42,0xcd,0x44,0xf0,0xa2,0xc4,0xef,0xfa,0x1e,0x11,0xa1, + 0x34,0x7b,0xf6,0xf4,0xdf,0xca,0x92,0x17,0xf3,0x48,0x8d,0xcf,0x30,0x82,0x81,0xbc, + 0xe8,0xbd,0x29,0xde,0x89,0x94,0x4b,0x57,0xed,0xe3,0x66,0x73,0x60,0xe4,0x1b,0xe5 }, + { 0x75,0x98,0x5b,0x53,0x88,0x69,0x54,0x16,0x11,0x0d,0x1c,0x3b,0xae,0xad,0x1a,0xcd, + 0xed,0x47,0x37,0x56,0xdd,0x51,0xc8,0xa3,0x52,0x9f,0x38,0xc8,0xfb,0x86,0x78,0x64, + 0x25,0x42,0x27,0x26,0x4b,0x95,0x80,0x90,0x64,0xb1,0x07,0xfb,0xeb,0x58,0xf2,0xdc, + 0xad,0x42,0x57,0x45,0x56,0xbf,0x19,0xaf,0xb9,0x9d,0x93,0xf6,0xe1,0x4c,0x01,0xa5 }, + { 0xdb,0x40,0xb2,0x74,0x40,0x97,0xee,0x0f,0x84,0xfc,0xa7,0x19,0x01,0xcb,0xe1,0x71, + 0xc1,0x75,0xe2,0xb4,0x0d,0x26,0x19,0x03,0xb9,0xa6,0xce,0x06,0x2c,0x7d,0x8d,0x30, + 0x31,0x5b,0x52,0x45,0x7f,0xb7,0x75,0x1a,0x09,0xb5,0x53,0x9c,0x06,0x4d,0xc0,0x14, + 0xbf,0xaa,0x2f,0xa9,0x1a,0xd0,0x9d,0x27,0xe9,0x82,0x41,0xff,0xf2,0x63,0xf5,0x8e }, + { 0xbd,0x5b,0x62,0xa2,0x20,0x3c,0xed,0x3a,0x8b,0xa6,0x64,0x8d,0x13,0x27,0x67,0x4e, + 0x40,0xa7,0x96,0x2f,0x95,0x04,0x7f,0xa4,0xe3,0xf9,0x45,0xe9,0x4c,0x44,0x10,0x46, + 0x19,0x08,0x38,0x91,0x3b,0x70,0x2f,0xf5,0xa2,0x95,0x31,0xf3,0x40,0xa2,0xad,0xa6, + 0xdb,0x35,0x70,0x4b,0x96,0x09,0x97,0x00,0x3d,0xd2,0x32,0xcc,0x52,0x69,0xb7,0xe0 }, + { 0xdb,0x29,0x2c,0x1d,0xe8,0x99,0x12,0xd6,0xe6,0x4b,0x12,0xd6,0xa6,0x04,0x6a,0xa5, + 0x2a,0x1c,0x15,0x07,0x35,0x28,0xbc,0xc6,0x90,0xd7,0x5e,0xb1,0x1d,0x1a,0xc1,0xe5, + 0x9c,0x88,0x96,0x4b,0x3f,0x00,0x6f,0x62,0xef,0x90,0x60,0x3f,0x5b,0x95,0x77,0xd1, + 0xc4,0x24,0xdc,0x6a,0x8a,0xa9,0xc6,0x7b,0x74,0xce,0x24,0x9f,0xc3,0x9f,0x06,0xdc }, + { 0xf4,0xeb,0xd0,0x25,0x58,0xed,0x1d,0x23,0x54,0x2b,0x73,0x34,0x78,0x9f,0xab,0xb5, + 0x41,0x15,0x1d,0x7c,0xac,0xd4,0x8e,0xa9,0x82,0x80,0xd9,0x9f,0x5d,0x3f,0x5f,0x4d, + 0x7c,0x1b,0x2f,0xb2,0x4b,0xa7,0xf4,0xa0,0xaf,0xe6,0xa2,0xc0,0x15,0x68,0xde,0xd6, + 0x38,0xb6,0x31,0x46,0xb5,0xf0,0xeb,0xd7,0x50,0xb5,0xd7,0xb8,0x03,0x43,0xa4,0xc0 }, + { 0xca,0xe0,0x0d,0xfa,0x2f,0x78,0xcd,0x61,0x97,0x87,0x45,0xe8,0x4a,0x39,0xe9,0xbe, + 0x43,0xd0,0x6f,0xcf,0xbc,0x47,0xb6,0x8e,0x77,0x35,0x76,0xf2,0xcc,0xf3,0xab,0xbe, + 0x77,0x01,0xc1,0x06,0x1e,0xa6,0x80,0xef,0xa3,0xd7,0xb5,0xb6,0x2e,0x5a,0xa4,0xf4, + 0xf8,0x2b,0x30,0x20,0xd8,0x1f,0xc6,0x55,0x8f,0xc7,0x0d,0x55,0xd2,0x97,0x4f,0xce }, + { 0x1b,0x48,0xa4,0xdd,0x2e,0x7a,0xe3,0xd1,0x6d,0x9e,0x49,0x31,0xdb,0x13,0xe6,0x00, + 0xf1,0x8f,0xcb,0x3f,0x23,0xc1,0xf3,0xb4,0x30,0x35,0xf4,0xea,0x2c,0x77,0x65,0x79, + 0x4e,0x7b,0x0e,0x87,0x79,0x3c,0xd1,0x8f,0x8b,0xa4,0x5a,0x61,0x68,0xac,0x87,0x6b, + 0xc4,0xc4,0x98,0x36,0xb3,0x75,0x16,0x33,0xf2,0x45,0x84,0xb8,0xf2,0xdb,0xc7,0x46 }, + { 0xa8,0x63,0x55,0x0d,0x15,0x34,0x1f,0xb2,0x96,0xb0,0x3f,0x4f,0xec,0x6c,0x60,0xbb, + 0x0b,0x91,0xf0,0x0d,0xa2,0x83,0x07,0x5b,0x6c,0xc0,0x14,0xc7,0x3b,0x0a,0x4d,0xbd, + 0xc0,0xc8,0xd3,0x76,0x1c,0xaa,0xa8,0xc1,0x27,0x8c,0x50,0x02,0x81,0x9d,0x48,0x7b, + 0x5c,0xc0,0x2a,0xca,0x06,0x32,0x9d,0xb3,0x38,0x6d,0xfd,0x20,0x21,0x4d,0xce,0x66 }, + { 0x30,0x72,0xe0,0xca,0xa4,0xe5,0x41,0x44,0xd4,0xfe,0xe6,0x82,0x3e,0x85,0x18,0x30, + 0x50,0x17,0x9f,0x77,0xf8,0xcb,0xb0,0xc4,0xed,0x16,0x96,0xca,0xba,0xec,0x22,0xca, + 0x8f,0x28,0xd3,0x12,0xc6,0x2e,0xc4,0xc3,0x36,0xcf,0x59,0xd8,0x3a,0x6c,0xa7,0x64, + 0x7f,0x5f,0xa6,0x1b,0x90,0x96,0x19,0x14,0x22,0x81,0x38,0xcd,0x20,0x2f,0x22,0x70 }, + { 0x74,0xb4,0x04,0x55,0x9a,0xcd,0x09,0xc7,0xe5,0xc7,0xff,0x0b,0x8e,0x9c,0xce,0x9e, + 0x81,0x5f,0x98,0xbf,0xe7,0xdb,0xaf,0x2d,0x71,0x77,0x3a,0x32,0x69,0x5d,0xa5,0xe0, + 0x79,0xdc,0xcc,0x9b,0x38,0x0a,0xe6,0xd7,0x79,0xad,0x33,0x23,0x53,0x5c,0x64,0x67, + 0xee,0xe1,0xcc,0x6a,0x13,0xe2,0x4a,0x97,0x71,0xc0,0xf4,0x00,0xae,0xc0,0x84,0xa3 }, + { 0x34,0x69,0x83,0xec,0xb8,0x2c,0x36,0x7c,0x8a,0x4b,0x4a,0x29,0x9f,0xf3,0x41,0x46, + 0x5e,0xab,0x9b,0x24,0x2d,0xf2,0xc4,0xd8,0xb9,0x24,0xbf,0x3f,0x08,0x9e,0x96,0x40, + 0x3f,0x22,0x7f,0x51,0x32,0x7d,0xcf,0x3d,0xb0,0x67,0x9f,0x24,0x8b,0xaa,0x3e,0xc3, + 0x69,0x87,0x5c,0xf5,0x4d,0x55,0xf2,0x7a,0xe2,0x6b,0xf3,0xf8,0x8d,0x40,0xb4,0x3f }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { 0xfe,0xf7,0xc7,0x85,0xe4,0xd3,0x93,0xd0,0x36,0x61,0xc8,0x4d,0x0c,0x3e,0x2a,0x1c, + 0x32,0x1a,0xbf,0x1a,0xb0,0x60,0xb5,0xa8,0x1a,0x19,0x16,0xaf,0x96,0x0d,0x2d,0xe0, + 0xb1,0x2c,0xb6,0x41,0xe1,0x2d,0xc8,0xe5,0xd9,0x75,0x82,0xfa,0x90,0x3a,0x77,0x09, + 0x0e,0xe8,0xda,0x7a,0xfb,0xc4,0x68,0x57,0xe8,0xcf,0x18,0x51,0x5b,0xed,0x83,0x08 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { 0x75,0x49,0x7a,0xd6,0x84,0xbd,0x70,0xbe,0x10,0x19,0x6c,0xb2,0xa9,0x5f,0x6b,0x78, + 0x14,0x29,0x2a,0x15,0xd0,0x4a,0x10,0x93,0x69,0xb2,0xdf,0x02,0x7f,0x92,0x19,0xbd, + 0x95,0xc1,0x32,0xee,0x99,0x5e,0x7a,0x55,0x37,0xb7,0xc8,0x45,0xdc,0x6a,0xe6,0xef, + 0x8b,0xca,0xbe,0xe2,0x63,0x85,0x49,0xd3,0xeb,0x83,0x32,0x9a,0x23,0x11,0x4c,0x7e }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { 0x02,0xdf,0x0f,0x0e,0x98,0x3a,0xa7,0xaf,0xbd,0xb0,0xe6,0x3a,0x8d,0xeb,0xb4,0x3b, + 0x18,0x67,0x78,0xbb,0xeb,0x1c,0x09,0x06,0x5c,0x5c,0x51,0xb1,0x98,0xfe,0xc0,0xdc, + 0x6d,0xbc,0x77,0xb5,0xd7,0xda,0x2f,0x3d,0x4c,0x08,0xee,0x4f,0xc7,0x8a,0x68,0xde, + 0x94,0x96,0x35,0x7e,0xe0,0xfe,0xb7,0x26,0xff,0x0e,0xc7,0x34,0x7b,0xb8,0x25,0xb1 }, + { 0xe0,0xee,0x9d,0xd7,0x49,0x50,0xf9,0xd0,0xa8,0x07,0xa9,0xc1,0xd8,0xf1,0x33,0x07, + 0x63,0xfe,0x5b,0xc0,0x13,0xda,0x12,0x8e,0x3a,0xcc,0x1e,0x97,0xc1,0xdd,0x8d,0xd1, + 0xf2,0x3e,0xda,0x7c,0x04,0xe4,0xdc,0xef,0x69,0x75,0x72,0x98,0xd9,0x67,0xee,0x3f, + 0x1d,0x66,0x44,0x8a,0x9c,0xf7,0xf2,0xc6,0xa7,0x5c,0xae,0xe4,0x83,0xb7,0xd1,0xc2 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { 0xd0,0xa8,0x87,0xcf,0xe1,0x22,0x8d,0xe7,0xfa,0x26,0x85,0xce,0x6d,0xfa,0x2c,0x8b, + 0xbd,0x75,0xfe,0x64,0x2b,0xab,0x25,0xa1,0x02,0xcc,0x1f,0x93,0xa2,0x4a,0x31,0xd5, + 0x4d,0x3a,0x8e,0xd2,0xb3,0xfd,0x46,0x87,0x3f,0x1f,0xef,0x8a,0x1e,0x7f,0x15,0x4c, + 0x13,0xb1,0x61,0x9b,0xfc,0xa0,0x8b,0x6b,0x22,0x78,0x00,0xd5,0x44,0xc3,0x52,0x60 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { 0xaf,0x2e,0xd9,0xfd,0x18,0xd1,0xb8,0xc2,0x9b,0x33,0x28,0x30,0x01,0xff,0x1c,0xf4, + 0xc6,0xf9,0xc9,0x7c,0xa2,0x9a,0x8f,0xb9,0xd9,0xfa,0xa7,0x24,0x42,0xf3,0x8b,0xff, + 0x18,0x84,0x29,0xdd,0x82,0x73,0xc7,0x64,0xe3,0x37,0xb3,0x52,0xe2,0x14,0xb2,0xbe, + 0x37,0x88,0x25,0xa0,0x3b,0xe6,0xfb,0x94,0x2d,0x41,0x59,0xdb,0x44,0x8b,0x0b,0xa3 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { 0x7c,0x82,0x91,0x60,0xee,0x5d,0x7a,0x63,0x8a,0x2c,0x91,0xe7,0x94,0x02,0x02,0x42, + 0x7d,0x8a,0xba,0x09,0x78,0xa6,0x50,0xd6,0xbe,0x55,0xb5,0x49,0xa1,0xda,0x9d,0x4d, + 0x51,0x1b,0xab,0x9d,0x70,0x47,0x5f,0x86,0x57,0xbb,0xbf,0xee,0x24,0x27,0xc6,0x95, + 0x8b,0xec,0x90,0x9b,0x58,0xc9,0x42,0x43,0xc6,0xb7,0xba,0xf6,0x82,0x11,0xfa,0x8b }, + { 0x7d,0xf8,0x54,0xc5,0x74,0xf6,0x54,0x1d,0x40,0xe1,0x71,0xc2,0xdd,0x03,0x72,0xdf, + 0x3b,0x77,0xa1,0x1c,0xc7,0xd6,0xb1,0x67,0xb7,0x13,0x6f,0xf4,0x18,0xa4,0x2a,0x82, + 0x98,0xe3,0xe3,0xe1,0x12,0xb3,0x33,0xb1,0xde,0x66,0xff,0x6c,0xd5,0xde,0xdd,0xa6, + 0x26,0xf3,0x44,0x94,0xdb,0x15,0x76,0xcc,0x28,0x33,0x2d,0x4b,0x79,0xdb,0x06,0xbc }, + { 0x39,0xa2,0xb0,0xf7,0x63,0xc6,0xd4,0xc9,0xc9,0x12,0xc2,0xf3,0x26,0x02,0xe0,0x75, + 0xe4,0x28,0xd2,0x0c,0xad,0xce,0x68,0xf9,0xb3,0xdd,0x4b,0x04,0xbe,0xfd,0x65,0xc1, + 0xfa,0xfe,0x14,0x12,0x7d,0x77,0x0e,0xed,0x99,0xad,0x11,0x5f,0xe6,0xb6,0x52,0xd1, + 0x0d,0xde,0xa2,0x8a,0x55,0x49,0x60,0x76,0xee,0xda,0x21,0x26,0x00,0x54,0x20,0x17 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { 0x27,0xb4,0xc1,0xba,0x5f,0xd4,0x47,0x04,0x1f,0xfe,0x42,0xa5,0xce,0xb5,0x23,0xbe, + 0x42,0xcc,0x59,0x71,0x51,0x13,0x41,0xa4,0x18,0x35,0xcf,0x02,0x0d,0xe1,0xfb,0x43, + 0xc5,0x28,0xed,0xae,0x84,0x27,0xe8,0xdc,0x89,0xe5,0xf6,0xbe,0x16,0x7e,0x57,0xe1, + 0x41,0x82,0xa9,0xf1,0x7c,0x98,0xd7,0x7c,0xe5,0x67,0xc2,0xf9,0x4d,0xb6,0xb0,0x09 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { 0x33,0x8e,0x6f,0x22,0xac,0x01,0x9f,0x7a,0xc7,0xca,0x23,0xc4,0xa4,0x9c,0x07,0xf8, + 0x98,0xc1,0x17,0x4a,0xb2,0xbc,0xcc,0xf4,0x0e,0x2e,0xf6,0x35,0xdd,0xf6,0x29,0x9a, + 0x2f,0x9c,0xe8,0x7c,0x86,0xf0,0x93,0xca,0x1a,0xee,0x10,0x08,0xec,0xe5,0x3a,0x98, + 0x8c,0xd8,0x0d,0x39,0xaa,0x25,0x8d,0xcd,0x5d,0x64,0x7a,0x5f,0x35,0x92,0xb5,0x64 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { 0xdd,0xa9,0x15,0x18,0x9d,0x01,0x24,0x9c,0xed,0x7a,0xeb,0x42,0x8b,0x9e,0xf3,0x72, + 0x26,0xc9,0x45,0x18,0xea,0xd2,0x54,0x5f,0xcf,0xed,0xac,0xbc,0xa1,0xd0,0x5f,0x2f, + 0xce,0x15,0x2a,0xc6,0xf1,0xe0,0x69,0x62,0x22,0xc1,0xc0,0xbd,0xfa,0xdc,0x85,0xac, + 0x67,0x47,0xee,0xa2,0x35,0xb3,0xff,0x76,0x57,0x4f,0x30,0x66,0xf8,0xe9,0xe0,0x5b }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { 0x0f,0x35,0xa3,0x7c,0xf1,0x75,0xea,0x27,0x36,0x4d,0x4b,0x1a,0x3b,0x24,0xef,0x9d, + 0x4e,0x39,0x7e,0x7b,0x3d,0x42,0x0d,0xc2,0x9f,0x53,0xc7,0xc4,0xdf,0x02,0x5d,0x61, + 0x0c,0xc9,0x2d,0x89,0x63,0xab,0x34,0xfc,0x97,0x1b,0xb5,0x54,0xe6,0x19,0xa5,0x46, + 0xdc,0x9e,0xdc,0x25,0xe4,0x3a,0xfc,0xa7,0x93,0xfc,0x1f,0xec,0xb3,0x92,0x43,0xbc }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { 0x5d,0xdd,0xd4,0xbe,0xc0,0xff,0xe1,0x1b,0x3a,0xd6,0x61,0xc8,0x90,0x02,0x23,0x08, + 0xfa,0x7a,0xfa,0x1d,0xab,0x2b,0xa0,0x0b,0x24,0xe1,0x6b,0x9e,0x38,0x6b,0xb2,0xae, + 0xdd,0xfa,0xfc,0xa2,0xb8,0xcb,0xed,0x33,0x66,0x06,0xef,0x72,0x8b,0xe5,0xa3,0x0d, + 0x9b,0x18,0x05,0xce,0x6a,0x69,0x61,0x64,0x74,0x9c,0xf9,0x66,0xec,0x99,0x72,0x95 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { 0x2c,0xf3,0x0d,0x50,0x30,0x77,0xc2,0x25,0x91,0x83,0x5f,0xac,0xf4,0x56,0x96,0xc8, + 0x70,0x86,0x16,0x5a,0x1b,0xa1,0x7d,0x08,0x53,0x15,0xfd,0x3c,0xcb,0x4d,0xd0,0x70, + 0x5c,0x1d,0x5c,0xaa,0x87,0x60,0x24,0x42,0xcc,0xe0,0x75,0xeb,0xae,0x75,0xcc,0xf1, + 0x81,0x71,0x09,0xc0,0xf8,0x3c,0x55,0xa6,0x71,0x3c,0xd2,0xda,0xfe,0xf8,0x07,0xbc }, + { 0x33,0x7c,0x08,0x5e,0xb1,0xff,0x68,0x44,0x75,0xc3,0xdf,0x68,0xdf,0x3d,0xba,0x81, + 0x84,0x76,0x06,0x85,0xb4,0xb1,0x7a,0x6d,0xc9,0x4e,0x27,0x38,0x35,0xee,0xe1,0x32, + 0x48,0xd8,0x6b,0x76,0xc4,0x9b,0x65,0xb2,0x22,0xf5,0xf6,0x2a,0xa1,0xf4,0x37,0x00, + 0x12,0x5b,0x65,0xb2,0x65,0x47,0xc5,0xe4,0xf2,0x13,0x55,0x60,0x87,0x78,0x37,0x5b }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { 0xeb,0xd8,0xb6,0x33,0x90,0xbf,0x13,0x7f,0xd8,0x00,0xce,0xe0,0x48,0x79,0x78,0xd7, + 0xd7,0x62,0xa3,0xe7,0x7b,0xe8,0xc9,0x54,0x71,0x18,0xff,0x2b,0x4f,0xff,0x5e,0x82, + 0xca,0x10,0x2c,0x01,0x47,0xc5,0xcc,0xa2,0x22,0x89,0x6b,0xb4,0xc1,0xd6,0x66,0x26, + 0x56,0x9b,0x7c,0x02,0x77,0xe0,0xb8,0x38,0x5f,0xac,0x1b,0x9d,0x00,0x27,0x0c,0x33 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { 0x65,0x19,0xf5,0x62,0x7a,0x92,0xc5,0x4a,0x55,0xcc,0x2f,0xf8,0x6c,0x79,0x34,0x3d, + 0xa4,0x9e,0xd3,0xec,0xe4,0x3a,0xf9,0x99,0x5a,0x28,0x2a,0xa0,0x8a,0x46,0xef,0x69, + 0x1b,0xd7,0xfd,0xeb,0x60,0x26,0x2a,0x6f,0xa7,0x6c,0x0f,0x97,0x44,0xf4,0x7d,0x9e, + 0x5b,0x7d,0xa0,0xe1,0x70,0xe0,0xf3,0x9f,0xb0,0xf3,0xea,0xfd,0xfc,0xac,0x58,0x4d }, + { 0xb8,0x8a,0xa5,0x8f,0x58,0x30,0xb0,0x38,0xa6,0x53,0x84,0x33,0xd4,0xd7,0xbd,0x26, + 0x45,0x35,0xb7,0xf6,0x1a,0x20,0x7b,0x8d,0x7e,0x68,0x69,0xdb,0xb1,0x1e,0xa5,0x1a, + 0xd5,0xf9,0x42,0x57,0x7a,0xf8,0x30,0x2e,0xea,0x49,0xe5,0xd5,0x34,0x6a,0xcd,0x5b, + 0xfa,0x8e,0x71,0x32,0xfa,0x42,0x69,0xec,0x5d,0x50,0x02,0x42,0xc2,0xe4,0xae,0x5a }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { 0x9a,0x8e,0xcf,0x66,0xe0,0xd8,0xd4,0x2a,0x0f,0x4d,0xad,0x64,0x8c,0x6d,0xcb,0x37, + 0x2e,0x0e,0x9f,0xc4,0xca,0xff,0x85,0xf1,0x7f,0xec,0x71,0x69,0xc2,0x81,0x5c,0xe4, + 0x28,0xd2,0x6b,0xa9,0xf6,0xfb,0xe4,0x51,0x68,0x03,0xd0,0xcd,0xc3,0x07,0x6f,0xab, + 0x1c,0x94,0x5f,0x94,0xe6,0x54,0x8b,0x1a,0x3c,0xed,0xd4,0xb0,0xf3,0x26,0x81,0xfa }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 } }; + +constexpr uint8_t calc3_rotate_bits(uint8_t dat, int bits) { return (dat << (bits & 7)) | (dat >> (8 - (bits & 7))); } @@ -1223,17 +1227,17 @@ uint8_t kaneko_calc3_device::shift_bits(uint8_t dat, int bits) int kaneko_calc3_device::decompress_table(int tabnum, uint8_t* dstram, int dstoffset) { address_space &space = m_maincpu->space(AS_PROGRAM); - uint8_t* datarom = m_calc3_region->base(); + uint8_t *datarom = m_calc3_region->base(); uint16_t length; int local_counter=0; int offset = 0; - uint8_t numregions = datarom[offset+0]; + uint8_t numregions = datarom[offset + 0]; if (tabnum > numregions) { - printf("CALC3 error, requested table > num tables!\n"); + osd_printf_error("%s: CALC3 error, requested table > num tables!\n", tag()); return 0; } @@ -1243,9 +1247,9 @@ int kaneko_calc3_device::decompress_table(int tabnum, uint8_t* dstram, int dstof for (int x = 0; x < tabnum; x++) { uint8_t blocksize_offset = datarom[offset+0]; // location of the 'block length' - offset+= blocksize_offset+1; - length = datarom[offset+0] | (datarom[offset+1]<<8); - offset+=length+2; + offset += blocksize_offset + 1; + length = datarom[offset + 0] | (datarom[offset + 1] << 8); + offset += length + 2; } // we're at the start of the block, get the info about it @@ -1255,13 +1259,13 @@ int kaneko_calc3_device::decompress_table(int tabnum, uint8_t* dstram, int dstof m_database = offset; m_blocksize_offset = datarom[offset+0]; // location of the 'block length' m_mode = datarom[offset+1]; - m_alternateswaps = datarom[offset+2]; - m_shift = (m_alternateswaps &0xf0)>>4; - m_subtracttype = (m_alternateswaps &0x03); + m_alternateswaps = datarom[offset+2]; + m_shift = (m_alternateswaps & 0xf0) >> 4; + m_subtracttype = (m_alternateswaps & 0x03); m_alternateswaps &= 0x0c; - m_alternateswaps >>=2; + m_alternateswaps >>= 2; - m_decryption_key_byte = datarom[offset+3]; + m_decryption_key_byte = datarom[offset + 3]; // if blocksize_offset > 3, it appears to specify the encryption table as 'inline' which can be of any size (odd or even) and loops over the bytes to decrypt @@ -1272,20 +1276,20 @@ int kaneko_calc3_device::decompress_table(int tabnum, uint8_t* dstram, int dstof inline_table_size = m_blocksize_offset-3; } - offset+= m_blocksize_offset+1; + offset += m_blocksize_offset+1; length = datarom[offset+0] | (datarom[offset+1]<<8); - offset+=2; + offset +=2; -#if VERBOSE_OUTPUT if (inline_table_size) { - printf("Block %02x Found Base %04x - Inline Encryption (size %02x) - Mode? %02x Shift %01x Subtract Type %01x AltSwaps %01x Key (unused?) %02x Length %04x\n", tabnum, m_database, inline_table_size, m_shift, m_mode, m_subtracttype, m_alternateswaps, m_decryption_key_byte, length); + LOG("Block %02x Found Base %04x - Inline Encryption (size %02x) - Mode? %02x Shift %01x Subtract Type %01x AltSwaps %01x Key (unused?) %02x Length %04x\n", + tabnum, m_database, inline_table_size, m_shift, m_mode, m_subtracttype, m_alternateswaps, m_decryption_key_byte, length); } else { - printf("Block %02x Found Base %04x - Mode? %02x Shift %01x Subtract Type %01x AltSwaps %01x Key %02x Length %04x\n", tabnum, m_database, m_mode, m_shift, m_subtracttype, m_alternateswaps, m_decryption_key_byte, length); + LOG("Block %02x Found Base %04x - Mode? %02x Shift %01x Subtract Type %01x AltSwaps %01x Key %02x Length %04x\n", + tabnum, m_database, m_mode, m_shift, m_subtracttype, m_alternateswaps, m_decryption_key_byte, length); } -#endif // copy + decrypt the table to the specified memory area //if (dstram) { @@ -1304,24 +1308,24 @@ int kaneko_calc3_device::decompress_table(int tabnum, uint8_t* dstram, int dstof // !dstram is used because we don't want to process these during our initial table scan, only when the game asks! - if (m_mode==0x06) + if (m_mode == 0x06) { m_writeaddress_current = 0x202000; // this is reasonable for brapboys, not sure about shogwarr, needs emulating properly! //m_writeaddress_current = 0x20c000; } - else if (m_mode==0x07) + else if (m_mode == 0x07) { // also calls empty table with Mode? 07 // maybe they reset to different points? } - else if (m_mode==0x08 && !dstram) + else if (m_mode == 0x08 && !dstram) { //printf("save to eeprom\n"); { for (int i = 0; i < 0x40; i++) { - m_eeprom->internal_write(i, space.read_word(m_eeprom_addr+0x200000+2*i)); + m_eeprom->internal_write(i, space.read_word(m_eeprom_addr + 0x200000 + 2*i)); } } @@ -1349,58 +1353,58 @@ int kaneko_calc3_device::decompress_table(int tabnum, uint8_t* dstram, int dstof /* special case for Shogun Warriors table 0x40 */ if (m_subtracttype == 3 && m_alternateswaps == 0) { - uint8_t inlinet = datarom[inline_table_base + (i%inline_table_size)]; + uint8_t inlinet = datarom[inline_table_base + (i % inline_table_size)]; dat = datarom[offset+i]; dat -= inlinet; - if (((i%inline_table_size)&1)==0) + if (!((i % inline_table_size) & 1)) { dat -= extra[(i%inline_table_size)>>1]; } } else { - if ( ((i / inline_table_size) & 1) == 0) + if (!((i / inline_table_size) & 1)) { - if (((i % inline_table_size) & 1) == 1) + if ((i % inline_table_size) & 1) { uint8_t inlinet = datarom[inline_table_base + (i % inline_table_size)]; dat = datarom[offset + i]; dat -= inlinet; - dat = shift_bits(dat, m_shift); + dat = calc3_rotate_bits(dat, m_shift); } else { uint8_t inlinet = datarom[inline_table_base + (i % inline_table_size)]; dat = datarom[offset + i]; - if (m_subtracttype!=0x02) + if (m_subtracttype != 0x02) { dat -= inlinet; - dat -= extra[(i%inline_table_size)>>1]; + dat -= extra[(i % inline_table_size) >> 1]; } else { dat += inlinet; - dat += extra[(i%inline_table_size)>>1]; + dat += extra[(i % inline_table_size) >> 1]; } - dat = shift_bits(dat, 8-m_shift); + dat = calc3_rotate_bits(dat, 8 - m_shift); } } else { - if (((i % inline_table_size) & 1) == 0) + if (!((i % inline_table_size) & 1)) { uint8_t inlinet = datarom[inline_table_base + (i % inline_table_size)]; dat = datarom[offset + i]; dat -= inlinet; - dat = shift_bits(dat, m_shift); + dat = calc3_rotate_bits(dat, m_shift); } else { - dat = datarom[offset+i]; + dat = datarom[offset + i]; if (m_subtracttype != 0x02) { @@ -1410,7 +1414,7 @@ int kaneko_calc3_device::decompress_table(int tabnum, uint8_t* dstram, int dstof { dat += extra2[(i % inline_table_size) >> 1]; } - dat = shift_bits(dat, 8 - m_shift); + dat = calc3_rotate_bits(dat, 8 - m_shift); } } } @@ -1426,18 +1430,20 @@ int kaneko_calc3_device::decompress_table(int tabnum, uint8_t* dstram, int dstof } } else + { m_data_header[local_counter] = dat; + } ++local_counter; } } else { - const int16_t* key = s_keydata + (m_decryption_key_byte * 0x40); + const int16_t (&key)[0x40] = f_calc3_keydata[m_decryption_key_byte]; if (key[0] == -1) { - fatalerror("attempting to use invalid decryption data\n"); + fatalerror("%s: attempting to use invalid decryption data\n", tag()); } for (int i = 0; i < length; i++) @@ -1452,12 +1458,12 @@ int kaneko_calc3_device::decompress_table(int tabnum, uint8_t* dstram, int dstof } else if (m_subtracttype == 1) { - if ((i&1)==1) dat += keydat; + if (i & 1) dat += keydat; else dat -= keydat; } else if (m_subtracttype == 2) { - if ((i&1)==0) dat += keydat; + if (!(i & 1)) dat += keydat; else dat -= keydat; } else if (m_subtracttype == 3) @@ -1467,22 +1473,22 @@ int kaneko_calc3_device::decompress_table(int tabnum, uint8_t* dstram, int dstof if (m_alternateswaps == 0) { - if ((i & 1) == 0) dat = shift_bits(dat, 8 - m_shift); - else dat = shift_bits(dat, m_shift); + if (!(i & 1)) dat = calc3_rotate_bits(dat, 8 - m_shift); + else dat = calc3_rotate_bits(dat, m_shift); } else if (m_alternateswaps == 1) { - dat = shift_bits(dat, 8 - m_shift); + dat = calc3_rotate_bits(dat, 8 - m_shift); } else if (m_alternateswaps == 2) { - dat = shift_bits(dat, m_shift); + dat = calc3_rotate_bits(dat, m_shift); } else if (m_alternateswaps == 3) { // same as 0 - if ((i & 1) == 0) dat = shift_bits(dat, 8 - m_shift); - else dat = shift_bits(dat, m_shift); + if (!(i & 1)) dat = calc3_rotate_bits(dat, 8 - m_shift); + else dat = calc3_rotate_bits(dat, m_shift); } } @@ -1511,7 +1517,7 @@ int kaneko_calc3_device::decompress_table(int tabnum, uint8_t* dstram, int dstof m_dataend = offset+length+1; } - //printf("data base %04x data end %04x\n", m_database, m_dataend); + //logerror("data base %04x data end %04x\n", m_database, m_dataend); return length; @@ -1519,16 +1525,16 @@ int kaneko_calc3_device::decompress_table(int tabnum, uint8_t* dstram, int dstof void kaneko_calc3_device::initial_scan_tables() { - uint8_t* datarom = memregion(":calc3_rom")->base(); + uint8_t *datarom = m_calc3_region->base(); m_mcu_crc = 0; for (int x=0;x<0x20000;x++) { m_mcu_crc+=datarom[x]; } - //printf("crc %04x\n",m_mcu_crc); + //logerror("crc %04x\n",m_mcu_crc); -#if VERBOSE_OUTPUT +#if DUMP_TABLES uint8_t numregions = datarom[0]; for (int x=0; xread()) & 0xff); // // DSW // dsw actually updates in realtime - mcu reads+writes it every frame + if (m_dsw_addr) space.write_byte(m_dsw_addr + 0x200000, ~m_dsw_port->read() & 0xff); // // DSW // dsw actually updates in realtime - mcu reads+writes it every frame //m_mcu_status = 0; @@ -1599,12 +1605,12 @@ void kaneko_calc3_device::mcu_run() if (mcu_command == 0) return; logerror("%s : MCU executed command at %04X: %04X\n", - machine().describe_context(),m_mcu_command_offset,mcu_command); + machine().describe_context(), m_mcu_command_offset, mcu_command); if (mcu_command > 0) { - /* 0xff is a special 'init' command */ + // 0xff is a special 'init' command if (mcu_command == 0xff) { // clear old command (handshake to main cpu) @@ -1619,15 +1625,15 @@ void kaneko_calc3_device::mcu_run() // set our current write / stack pointer to the address specified m_writeaddress_current = m_writeaddress; -#if VERBOSE_OUTPUT - printf("Calc 3 Init Command - %04x DSW addr\n", m_dsw_addr); - printf("Calc 3 Init Command - %04x Eeprom Address\n", m_eeprom_addr); - printf("Calc 3 Init Command - %04x Future Commands Base\n", m_mcu_command_offset); - printf("Calc 3 Init Command - %04x Poll / Busy Address\n", m_poll_addr); - printf("Calc 3 Init Command - %04x ROM Checksum Address\n", m_checksumaddress); - printf("Calc 3 Init Command - %08x Data Write Address\n", m_writeaddress); -#endif - // space.write_byte(m_dsw_addr+0x200000, ( ~ioport("DSW1")->read())&0xff); // // DSW // dsw actually updates in realtime - mcu reads+writes it every frame + LOG( + "Calc 3 Init Command - %04x DSW addr\n" + "Calc 3 Init Command - %04x Eeprom Address\n" + "Calc 3 Init Command - %04x Future Commands Base\n" + "Calc 3 Init Command - %04x Poll / Busy Address\n" + "Calc 3 Init Command - %04x ROM Checksum Address\n" + "Calc 3 Init Command - %08x Data Write Address\n", + m_dsw_addr, m_eeprom_addr, m_mcu_command_offset, m_poll_addr, m_checksumaddress, m_writeaddress); + //space.write_byte(m_dsw_addr+0x200000, ~m_dsw_port->read() & 0xff); // // DSW // dsw actually updates in realtime - mcu reads+writes it every frame m_mcuram[m_checksumaddress / 2] = m_mcu_crc; // MCU Rom Checksum! @@ -1637,19 +1643,15 @@ void kaneko_calc3_device::mcu_run() m_mcuram[(m_eeprom_addr / 2) + i] = kaneko16_eeprom_data[i];//((eepromData[i]&0xff00)>>8) | ((eepromData[i]&0x00ff)<<8); } #endif + for (int i = 0; i < 0x40; i++) { - for (int i = 0; i < 0x40; i++) - { - space.write_word(m_eeprom_addr + 0x200000 + 2 * i, m_eeprom->internal_read(i)); - } - + space.write_word(m_eeprom_addr + 0x200000 + 2 * i, m_eeprom->internal_read(i)); } - } - /* otherwise the command number is the number of transfer operations to perform */ else { - int num_transfers = mcu_command; + // otherwise the command number is the number of transfer operations to perform + const int num_transfers = mcu_command; // clear old command (handshake to main cpu) m_mcuram[m_mcu_command_offset>>1] = 0x0000; @@ -1663,27 +1665,21 @@ void kaneko_calc3_device::mcu_run() uint8_t commandtabl = (param1 & 0xff00) >> 8; uint16_t commandaddr = param2;// (param1&0x00ff) | (param2&0xff00); uint8_t commandunk = (param1 & 0x00ff); // brap boys sets.. seems to cause further writebasck address displacement?? (when tested on hw it looked like a simple +, but that doesn't work for brapboys...) -#if VERBOSE_OUTPUT - printf("transfer %d table %02x writeback address %04x unknown %02x\n", i, commandtabl, commandaddr, commandunk); -#endif - { - int length = decompress_table(commandtabl, nullptr, m_writeaddress_current - 2); - if (length) - { - int write = commandaddr; -#if VERBOSE_OUTPUT - printf("writing back address %08x to %08x %08x\n", m_writeaddress_current, commandaddr,write); -#endif - space.write_byte(write + 0x200000, m_data_header[0]); - space.write_byte(write + 0x200001, m_data_header[1]); + LOG("transfer %d table %02x writeback address %04x unknown %02x\n", i, commandtabl, commandaddr, commandunk); - write=commandaddr+(char)commandunk; - space.write_word(write + 0x200000, (m_writeaddress_current >> 16) & 0xffff); - space.write_word(write + 0x200002, (m_writeaddress_current & 0xffff)); + const int length = decompress_table(commandtabl, nullptr, m_writeaddress_current - 2); + if (length) + { + int write = commandaddr; + LOG("writing back address %08x to %08x %08x\n", m_writeaddress_current, commandaddr, write); + space.write_byte(write + 0x200000, m_data_header[0]); + space.write_byte(write + 0x200001, m_data_header[1]); - m_writeaddress_current += ((length + 3) & ~1); - } + write = commandaddr + (char)commandunk; + space.write_word(write + 0x200000, (m_writeaddress_current >> 16) & 0xffff); + space.write_word(write + 0x200002, (m_writeaddress_current & 0xffff)); + m_writeaddress_current += (length + 3) & ~1; } } } diff --git a/src/mame/kaneko/kaneko_calc3.h b/src/mame/kaneko/kaneko_calc3.h index 6112222ffb66b..287c72ade19de 100644 --- a/src/mame/kaneko/kaneko_calc3.h +++ b/src/mame/kaneko/kaneko_calc3.h @@ -11,13 +11,15 @@ class kaneko_calc3_device : public device_t { public: - template - kaneko_calc3_device(const machine_config &mconfig, const char *tag, device_t *owner, T &&cpu_tag, U &&eeprom_tag, V &®ion_tag) + template + kaneko_calc3_device(const machine_config &mconfig, const char *tag, device_t *owner, T &&cpu_tag, U &&eeprom_tag, V &&mcuram_tag, W &&dsw_tag, X &®ion_tag) : kaneko_calc3_device(mconfig, tag, owner, (uint32_t)0) { m_maincpu.set_tag(std::forward(cpu_tag)); m_eeprom.set_tag(std::forward(eeprom_tag)); - m_calc3_region.set_tag(std::forward(region_tag)); + m_mcuram.set_tag(std::forward(mcuram_tag)); + m_dsw_port.set_tag(std::forward(dsw_tag)); + m_calc3_region.set_tag(std::forward(region_tag)); } kaneko_calc3_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); @@ -41,6 +43,7 @@ class kaneko_calc3_device : public device_t required_device m_eeprom; required_memory_region m_calc3_region; required_shared_ptr m_mcuram; + required_ioport m_dsw_port; int m_mcu_status; int m_mcu_command_offset; uint16_t m_mcu_crc; @@ -64,10 +67,7 @@ class kaneko_calc3_device : public device_t void mcu_init(); void initial_scan_tables(); void mcu_com_w(offs_t offset, uint16_t data, uint16_t mem_mask, int _n_); - uint8_t shift_bits(uint8_t dat, int bits); int decompress_table(int tabnum, uint8_t* dstram, int dstoffset); - - static const int16_t s_keydata[0x40*0x100]; }; diff --git a/src/mame/konami/konamigx.cpp b/src/mame/konami/konamigx.cpp index 15c95d15b4e9c..612e04935fe04 100644 --- a/src/mame/konami/konamigx.cpp +++ b/src/mame/konami/konamigx.cpp @@ -107,6 +107,7 @@ #include "sound/k054539.h" //#include "machine/k056230.h" #include "sound/k056800.h" +#include "sound/okim6295.h" #include "speaker.h" #include "layout/generic.h" @@ -1113,6 +1114,34 @@ void konamigx_state::gx_type4_map(address_map &map) // map(0xf00000, 0xf07fff).ram(); } +void konamigx_state::sexyparoebl_map(address_map &map) // TODO: verify everything +{ + map(0x000000, 0x01ffff).rom(); // BIOS ROM + map(0x200000, 0x3fffff).rom(); // main program ROM + map(0x400000, 0x7fffff).rom(); // data ROM + map(0xc00000, 0xc1ffff).ram().share("workram"); + map(0xd00000, 0xd01fff).r(m_k056832, FUNC(k056832_device::k_5bpp_rom_long_r)); + map(0xd20000, 0xd23fff).rw(m_k055673, FUNC(k055673_device::k053247_word_r), FUNC(k055673_device::k053247_word_w)); + map(0xd40000, 0xd4003f).w(m_k056832, FUNC(k056832_device::word_w)); + map(0xd44000, 0xd4400f).w(FUNC(konamigx_state::konamigx_tilebank_w)); + map(0xd48000, 0xd48007).w(m_k055673, FUNC(k055673_device::k053246_w)); + map(0xd4a000, 0xd4a00f).r(m_k055673, FUNC(k055673_device::k055673_rom_word_r)); + map(0xd4a010, 0xd4a01f).w(m_k055673, FUNC(k055673_device::k055673_reg_word_w)); + //map(0xd4c000, 0xd4c01f).rw(m_k053252, FUNC(k053252_device::read), FUNC(k053252_device::write)).umask32(0xff00ff00); + map(0xd4e000, 0xd4e01f).nopw(); // left-over for "secondary" CCU, apparently (used by type 3/4 for slave screen?) + map(0xd50000, 0xd500ff).w(m_k055555, FUNC(k055555_device::K055555_long_w)); + //map(0xd52000, 0xd5201f).rw(m_k056800, FUNC(k056800_device::host_r), FUNC(k056800_device::host_w)).umask32(0xff00ff00); + map(0xd56000, 0xd56003).w(FUNC(konamigx_state::eeprom_w)); + map(0xd58000, 0xd58003).w(FUNC(konamigx_state::control_w)); + map(0xd5a000, 0xd5a003).portr("SYSTEM_DSW"); + map(0xd5c000, 0xd5c003).portr("INPUTS"); + map(0xd5e000, 0xd5e003).portr("SERVICE"); + map(0xd80000, 0xd8001f).w(m_k054338, FUNC(k054338_device::word_w)); + map(0xd90000, 0xd97fff).ram().w(m_palette, FUNC(palette_device::write32)).share("palette"); + map(0xda0000, 0xda1fff).rw(m_k056832, FUNC(k056832_device::ram_word_r), FUNC(k056832_device::ram_word_w)); + map(0xda2000, 0xda3fff).rw(m_k056832, FUNC(k056832_device::ram_word_r), FUNC(k056832_device::ram_word_w)); +} + /**********************************************************************************/ /* Sound handling */ @@ -1991,6 +2020,60 @@ void konamigx_state::winspike(machine_config &config) } +void konamigx_state::sexyparoebl(machine_config &config) +{ + /* basic machine hardware */ + M68EC020(config, m_maincpu, MASTER_CLOCK); // clock not verified + m_maincpu->set_addrmap(AS_PROGRAM, &konamigx_state::sexyparoebl_map); + m_maincpu->set_vblank_int("screen", FUNC(konamigx_state::konamigx_type2_vblank_irq)); + + MCFG_MACHINE_START_OVERRIDE(konamigx_state,konamigx) + MCFG_MACHINE_RESET_OVERRIDE(konamigx_state,konamigx) + + EEPROM_93C46_16BIT(config, "eeprom"); + + /* video hardware */ + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_video_attributes(VIDEO_UPDATE_AFTER_VBLANK); + m_screen->set_raw(8000000, 384+24+64+40, 0, 383, 224+16+8+16, 0, 223); + + //m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(600)); + // TODO: WTF, without these most games crashes? Some legacy call in video code??? + m_screen->set_size(1024, 1024); + m_screen->set_visarea(24, 24+288-1, 16, 16+224-1); + m_screen->set_screen_update(FUNC(konamigx_state::screen_update_konamigx)); + + PALETTE(config, m_palette).set_format(palette_device::xRGB_888, 8192); + m_palette->enable_shadows(); + m_palette->enable_hilights(); + + K056832(config, m_k056832, 0); + m_k056832->set_tile_callback(FUNC(konamigx_state::alpha_tile_callback)); + m_k056832->set_config(K056832_BPP_5, 0, 0); + m_k056832->set_palette(m_palette); + + K055555(config, m_k055555, 0); + + K054338(config, m_k054338, 0, m_k055555); + m_k054338->set_screen(m_screen); + m_k054338->set_alpha_invert(1); + + K055673(config, m_k055673, 0); + m_k055673->set_sprite_callback(FUNC(konamigx_state::type2_sprite_callback)); + m_k055673->set_config(K055673_LAYOUT_GX, -42, -23); + m_k055673->set_screen(m_screen); + m_k055673->set_palette(m_palette); + + MCFG_VIDEO_START_OVERRIDE(konamigx_state, konamigx_5bpp) + + /* sound hardware */ + SPEAKER(config, "mono").front_center(); + + OKIM6295(config, "oki1", 1056000, okim6295_device::PIN7_HIGH).add_route(ALL_OUTPUTS, "mono", 0.5); // clock and pin 7 not verified + OKIM6295(config, "oki2", 1056000, okim6295_device::PIN7_HIGH).add_route(ALL_OUTPUTS, "mono", 0.5); // clock and pin 7 not verified +} + + /**********************************************************************************/ /* BIOS and ROM maps */ @@ -2355,6 +2438,40 @@ ROM_START( sexyparoa ) ROM_LOAD( "533a23.7g", 0x200000, 2*1024*1024, CRC(1bb7552b) SHA1(3c6f96b4ab97737c3634c08b94dd304d5517d88d) ) ROM_END +// this bootleg has 2 OKI M6295 instead of the whole audio section of the original +// GFX ROM loading needs fixing +ROM_START( sexyparoebl ) + /* main program */ + ROM_REGION( 0x800000, "maincpu", 0 ) + // no 'BIOS' ROM on PCB??? + ROM_LOAD32_WORD_SWAP( "03.bin", 0x20002, 0x80000, CRC(daa3a77c) SHA1(6c15001e4213978019143c5e0dc711391d6dec8a) ) + ROM_LOAD32_WORD_SWAP( "04.bin", 0x20000, 0x80000, CRC(b7bf9603) SHA1(c92d6128d39bb7004796f8fafaee799ceb56a42d) ) + + /* tiles */ + ROM_REGION( 0x500000, "k056832", ROMREGION_ERASE00 ) + TILE_WORD_ROM_LOAD( "06.bin", 0x000000, 0x200000, CRC(487af653) SHA1(6aada4386f4284cecc23e7543a452aa955e7baa7) ) + TILE_BYTE_ROM_LOAD( "05.bin", 0x000004, 0x080000, CRC(d3e0d058) SHA1(c50bdb3493501bfbbe092d01f5d4c38bfa3412f8) ) + + /* sprites */ + ROM_REGION( 0x600000, "k055673", ROMREGION_ERASE00 ) + ROM_LOAD32_BYTE( "08.bin", 0x000000, 0x100000, CRC(f7e50aa0) SHA1(41ad775eeac07a455e8d17dad9145056d979ebd7) ) // 1ST AND 2ND HALF IDENTICAL + ROM_IGNORE( 0x100000 ) + ROM_LOAD32_BYTE( "09.bin", 0x000001, 0x100000, CRC(5f0b3593) SHA1(fd30e85e88563318c00126ae063b5b488383b97e) ) // 1ST AND 2ND HALF IDENTICAL + ROM_IGNORE( 0x100000 ) + ROM_LOAD32_BYTE( "07.bin", 0x000002, 0x100000, CRC(fafb2066) SHA1(7b9736024be2d2e8572a8af91f48403abdd9036a) ) // 1ST AND 2ND HALF IDENTICAL + ROM_IGNORE( 0x100000 ) + ROM_LOAD32_BYTE( "10.bin", 0x000003, 0x100000, CRC(60d0d02f) SHA1(a364497787e7e523cd7f94a2eedf3ce2ef01d5fa) ) // 1ST AND 2ND HALF IDENTICAL + ROM_IGNORE( 0x100000 ) + ROM_LOAD( "11.bin", 0x400000, 0x200000, CRC(47a74033) SHA1(4b0c982e53334b10ca213e683879c69f693285e4) ) // 1ST AND 2ND HALF IDENTICAL + + /* sound data */ + ROM_REGION( 0x100000, "oki1", 0 ) + ROM_LOAD( "02.bin", 0x000000, 0x100000, CRC(391b2309) SHA1(70fd885a1dd6ba5c662923b41827d68b8c99d00c) ) + + ROM_REGION( 0x40000, "oki2", 0 ) + ROM_LOAD( "01.bin", 0x00000, 0x40000, CRC(c48ba934) SHA1(905f022b38d0eaeb2ad068499e320fd54550b958) ) +ROM_END + ROM_START( rungun2 ) /* main program */ ROM_REGION( 0x800000, "maincpu", 0 ) @@ -3859,9 +3976,9 @@ MACHINE_RESET_MEMBER(konamigx_state,konamigx) m_prev_pixel_clock = 0xff; // Hold sound CPUs in reset - m_soundcpu->set_input_line(INPUT_LINE_HALT, ASSERT_LINE); - m_soundcpu->set_input_line(INPUT_LINE_RESET, ASSERT_LINE); - m_dasp->set_input_line(INPUT_LINE_RESET, ASSERT_LINE); + if (m_soundcpu) m_soundcpu->set_input_line(INPUT_LINE_HALT, ASSERT_LINE); + if (m_soundcpu) m_soundcpu->set_input_line(INPUT_LINE_RESET, ASSERT_LINE); + if (m_dasp) m_dasp->set_input_line(INPUT_LINE_RESET, ASSERT_LINE); // [HACK] This shouldn't be necessary @@ -3917,46 +4034,47 @@ struct GXGameInfoT static const GXGameInfoT gameDefs[] = { - { "racinfrc", 11, 0, BPP4 }, - { "racinfrcu",11, 0, BPP4 }, - { "opengolf", 11, 0, BPP4 }, - { "opengolf2",11, 0, BPP4 }, - { "ggreats2", 11, 0, BPP4 }, - { "le2", 13, 1, BPP4 }, - { "le2u", 13, 1, BPP4 }, - { "le2j", 13, 1, BPP4 }, - { "fantjour", 7, 9, BPP5 }, - { "fantjoura", 7, 9, BPP5 }, - { "gokuparo", 7, 0, BPP5 }, - { "crzcross", 7, 0, BPP5 }, - { "puzldama", 7, 0, BPP5 }, - { "tbyahhoo", 7, 8, BPP5 }, - { "mtwinbee", 7, 8, BPP5 }, - { "tkmmpzdm", 7, 2, BPP6 }, - { "dragoona", 7, 3, BPP4 }, - { "dragoonj", 7, 3, BPP4 }, - { "sexyparo", 7, 4, BPP5 }, - { "sexyparoa", 7, 4, BPP5 }, - { "daiskiss", 7, 5, BPP5 }, - { "tokkae", 7, 0, BPP5 }, - { "salmndr2", 7, 6, BPP66 }, - { "salmndr2a", 7, 6, BPP66 }, - { "winspike", 8, 7, BPP4 }, - { "winspikea", 8, 7, BPP4 }, - { "winspikej", 8, 7, BPP4 }, - { "soccerss", 7, 0, BPP4 }, - { "soccerssu", 7, 0, BPP4 }, - { "soccerssa", 7, 0, BPP4 }, - { "soccerssj", 7, 0, BPP4 }, - { "soccerssja",7, 0, BPP4 }, - { "vsnetscr", 7, 0, BPP4 }, - { "vsnetscreb",7, 0, BPP4 }, - { "vsnetscru", 7, 0, BPP4 }, - { "vsnetscrj", 7, 0, BPP4 }, - { "vsnetscra", 7, 0, BPP4 }, - { "rungun2", 7, 0, BPP4 }, - { "slamdnk2", 7, 0, BPP4 }, - { "rushhero", 7, 0, BPP4 }, + { "racinfrc", 11, 0, BPP4 }, + { "racinfrcu", 11, 0, BPP4 }, + { "opengolf", 11, 0, BPP4 }, + { "opengolf2", 11, 0, BPP4 }, + { "ggreats2", 11, 0, BPP4 }, + { "le2", 13, 1, BPP4 }, + { "le2u", 13, 1, BPP4 }, + { "le2j", 13, 1, BPP4 }, + { "fantjour", 7, 9, BPP5 }, + { "fantjoura", 7, 9, BPP5 }, + { "gokuparo", 7, 0, BPP5 }, + { "crzcross", 7, 0, BPP5 }, + { "puzldama", 7, 0, BPP5 }, + { "tbyahhoo", 7, 8, BPP5 }, + { "mtwinbee", 7, 8, BPP5 }, + { "tkmmpzdm", 7, 2, BPP6 }, + { "dragoona", 7, 3, BPP4 }, + { "dragoonj", 7, 3, BPP4 }, + { "sexyparo", 7, 4, BPP5 }, + { "sexyparoa", 7, 4, BPP5 }, + { "sexyparoebl", 7, 0, BPP5 }, + { "daiskiss", 7, 5, BPP5 }, + { "tokkae", 7, 0, BPP5 }, + { "salmndr2", 7, 6, BPP66 }, + { "salmndr2a", 7, 6, BPP66 }, + { "winspike", 8, 7, BPP4 }, + { "winspikea", 8, 7, BPP4 }, + { "winspikej", 8, 7, BPP4 }, + { "soccerss", 7, 0, BPP4 }, + { "soccerssu", 7, 0, BPP4 }, + { "soccerssa", 7, 0, BPP4 }, + { "soccerssj", 7, 0, BPP4 }, + { "soccerssja", 7, 0, BPP4 }, + { "vsnetscr", 7, 0, BPP4 }, + { "vsnetscreb", 7, 0, BPP4 }, + { "vsnetscru", 7, 0, BPP4 }, + { "vsnetscrj", 7, 0, BPP4 }, + { "vsnetscra", 7, 0, BPP4 }, + { "rungun2", 7, 0, BPP4 }, + { "slamdnk2", 7, 0, BPP4 }, + { "rushhero", 7, 0, BPP4 }, { "", 0xff,0xff,0xff }, }; @@ -4081,61 +4199,62 @@ GAME( 1994, ggreats2, opengolf, opengolf, ggreats2, konamigx_state, init_p these games work and are playable with minor graphics glitches --------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ -GAME( 1994, le2, konamigx, le2, le2, konamigx_state, init_konamigx, ROT0, "Konami", "Lethal Enforcers II: Gun Fighters (ver EAA)", MACHINE_IMPERFECT_GRAPHICS ) -GAME( 1994, le2u, le2, le2, le2u, konamigx_state, init_konamigx, ORIENTATION_FLIP_Y, "Konami", "Lethal Enforcers II: Gun Fighters (ver UAA)", MACHINE_IMPERFECT_GRAPHICS ) -GAME( 1994, le2j, le2, le2, le2j, konamigx_state, init_konamigx, ORIENTATION_FLIP_Y, "Konami", "Lethal Enforcers II: The Western (ver JAA)", MACHINE_IMPERFECT_GRAPHICS ) +GAME( 1994, le2, konamigx, le2, le2, konamigx_state, init_konamigx, ROT0, "Konami", "Lethal Enforcers II: Gun Fighters (ver EAA)", MACHINE_IMPERFECT_GRAPHICS ) +GAME( 1994, le2u, le2, le2, le2u, konamigx_state, init_konamigx, ORIENTATION_FLIP_Y, "Konami", "Lethal Enforcers II: Gun Fighters (ver UAA)", MACHINE_IMPERFECT_GRAPHICS ) +GAME( 1994, le2j, le2, le2, le2j, konamigx_state, init_konamigx, ORIENTATION_FLIP_Y, "Konami", "Lethal Enforcers II: The Western (ver JAA)", MACHINE_IMPERFECT_GRAPHICS ) -GAME( 1994, fantjour, konamigx, gokuparo, gokuparo, konamigx_state, init_konamigx, ROT0, "Konami", "Fantastic Journey (ver EAA)", MACHINE_IMPERFECT_GRAPHICS ) -GAME( 1994, fantjoura, fantjour, gokuparo, gokuparo, konamigx_state, init_konamigx, ROT0, "Konami", "Fantastic Journey (ver AAA)", MACHINE_IMPERFECT_GRAPHICS ) -GAME( 1994, gokuparo, fantjour, gokuparo, gokuparo, konamigx_state, init_konamigx, ROT0, "Konami", "Gokujou Parodius: Kako no Eikou o Motomete (ver JAD)", MACHINE_IMPERFECT_GRAPHICS ) +GAME( 1994, fantjour, konamigx, gokuparo, gokuparo, konamigx_state, init_konamigx, ROT0, "Konami", "Fantastic Journey (ver EAA)", MACHINE_IMPERFECT_GRAPHICS ) +GAME( 1994, fantjoura, fantjour, gokuparo, gokuparo, konamigx_state, init_konamigx, ROT0, "Konami", "Fantastic Journey (ver AAA)", MACHINE_IMPERFECT_GRAPHICS ) +GAME( 1994, gokuparo, fantjour, gokuparo, gokuparo, konamigx_state, init_konamigx, ROT0, "Konami", "Gokujou Parodius: Kako no Eikou o Motomete (ver JAD)", MACHINE_IMPERFECT_GRAPHICS ) -GAME( 1994, crzcross, konamigx, gokuparo, puzldama, konamigx_state, init_posthack, ROT0, "Konami", "Crazy Cross (ver EAA)", MACHINE_IMPERFECT_GRAPHICS ) -GAME( 1994, puzldama, crzcross, gokuparo, puzldama, konamigx_state, init_posthack, ROT0, "Konami", "Taisen Puzzle-dama (ver JAA)", MACHINE_IMPERFECT_GRAPHICS ) +GAME( 1994, crzcross, konamigx, gokuparo, puzldama, konamigx_state, init_posthack, ROT0, "Konami", "Crazy Cross (ver EAA)", MACHINE_IMPERFECT_GRAPHICS ) +GAME( 1994, puzldama, crzcross, gokuparo, puzldama, konamigx_state, init_posthack, ROT0, "Konami", "Taisen Puzzle-dama (ver JAA)", MACHINE_IMPERFECT_GRAPHICS ) -GAME( 1995, tbyahhoo, konamigx, tbyahhoo, gokuparo, konamigx_state, init_posthack, ROT0, "Konami", "Twin Bee Yahhoo! (ver JAA)", MACHINE_IMPERFECT_GRAPHICS ) -GAME( 1995, mtwinbee, tbyahhoo, tbyahhoo, gokuparo, konamigx_state, init_posthack, ROT0, "Konami", "Magical Twin Bee (ver EAA)", MACHINE_IMPERFECT_GRAPHICS ) +GAME( 1995, tbyahhoo, konamigx, tbyahhoo, gokuparo, konamigx_state, init_posthack, ROT0, "Konami", "Twin Bee Yahhoo! (ver JAA)", MACHINE_IMPERFECT_GRAPHICS ) +GAME( 1995, mtwinbee, tbyahhoo, tbyahhoo, gokuparo, konamigx_state, init_posthack, ROT0, "Konami", "Magical Twin Bee (ver EAA)", MACHINE_IMPERFECT_GRAPHICS ) -GAME( 1995, tkmmpzdm, konamigx, konamigx_6bpp, tokkae, konamigx_state, init_konamigx, ROT0, "Konami", "Tokimeki Memorial Taisen Puzzle-dama (ver JAB)", MACHINE_IMPERFECT_GRAPHICS ) +GAME( 1995, tkmmpzdm, konamigx, konamigx_6bpp, tokkae, konamigx_state, init_konamigx, ROT0, "Konami", "Tokimeki Memorial Taisen Puzzle-dama (ver JAB)", MACHINE_IMPERFECT_GRAPHICS ) -GAME( 1995, dragoona, konamigx, dragoonj, dragoonj, konamigx_state, init_posthack, ROT0, "Konami", "Dragoon Might (ver AAB)", MACHINE_IMPERFECT_GRAPHICS ) -GAME( 1995, dragoonj, dragoona, dragoonj, dragoonj, konamigx_state, init_posthack, ROT0, "Konami", "Dragoon Might (ver JAA)", MACHINE_IMPERFECT_GRAPHICS ) +GAME( 1995, dragoona, konamigx, dragoonj, dragoonj, konamigx_state, init_posthack, ROT0, "Konami", "Dragoon Might (ver AAB)", MACHINE_IMPERFECT_GRAPHICS ) +GAME( 1995, dragoonj, dragoona, dragoonj, dragoonj, konamigx_state, init_posthack, ROT0, "Konami", "Dragoon Might (ver JAA)", MACHINE_IMPERFECT_GRAPHICS ) -GAME( 1996, sexyparo, konamigx, sexyparo, gokuparo, konamigx_state, init_konamigx, ROT0, "Konami", "Sexy Parodius (ver JAA)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND | MACHINE_UNEMULATED_PROTECTION ) -GAME( 1996, sexyparoa, sexyparo, sexyparo, gokuparo, konamigx_state, init_konamigx, ROT0, "Konami", "Sexy Parodius (ver AAA)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND | MACHINE_UNEMULATED_PROTECTION ) +GAME( 1996, sexyparo, konamigx, sexyparo, gokuparo, konamigx_state, init_konamigx, ROT0, "Konami", "Sexy Parodius (ver JAA)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND | MACHINE_UNEMULATED_PROTECTION ) +GAME( 1996, sexyparoa, sexyparo, sexyparo, gokuparo, konamigx_state, init_konamigx, ROT0, "Konami", "Sexy Parodius (ver AAA)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND | MACHINE_UNEMULATED_PROTECTION ) +GAME( 1996, sexyparoebl, sexyparo, sexyparoebl, gokuparo, konamigx_state, init_konamigx, ROT0, "Konami", "Sexy Parodius (ver EAA, bootleg)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND | MACHINE_NOT_WORKING ) -GAME( 1996, daiskiss, konamigx, konamigx, gokuparo, konamigx_state, init_konamigx, ROT0, "Konami", "Daisu-Kiss (ver JAA)", MACHINE_IMPERFECT_GRAPHICS ) +GAME( 1996, daiskiss, konamigx, konamigx, gokuparo, konamigx_state, init_konamigx, ROT0, "Konami", "Daisu-Kiss (ver JAA)", MACHINE_IMPERFECT_GRAPHICS ) -GAME( 1996, tokkae, konamigx, konamigx_6bpp, tokkae, konamigx_state, init_konamigx, ROT0, "Konami", "Taisen Tokkae-dama (ver JAA)", MACHINE_IMPERFECT_GRAPHICS ) +GAME( 1996, tokkae, konamigx, konamigx_6bpp, tokkae, konamigx_state, init_konamigx, ROT0, "Konami", "Taisen Tokkae-dama (ver JAA)", MACHINE_IMPERFECT_GRAPHICS ) -GAME( 1996, salmndr2, konamigx, salmndr2, gokuparo, konamigx_state, init_konamigx, ROT0, "Konami", "Salamander 2 (ver JAA)", MACHINE_IMPERFECT_GRAPHICS ) -GAME( 1996, salmndr2a, salmndr2, salmndr2, gokuparo, konamigx_state, init_konamigx, ROT0, "Konami", "Salamander 2 (ver AAB)", MACHINE_IMPERFECT_GRAPHICS ) +GAME( 1996, salmndr2, konamigx, salmndr2, gokuparo, konamigx_state, init_konamigx, ROT0, "Konami", "Salamander 2 (ver JAA)", MACHINE_IMPERFECT_GRAPHICS ) +GAME( 1996, salmndr2a, salmndr2, salmndr2, gokuparo, konamigx_state, init_konamigx, ROT0, "Konami", "Salamander 2 (ver AAB)", MACHINE_IMPERFECT_GRAPHICS ) // bad sprite colours, part of tilemap gets blanked out when a game starts (might be more protection) -GAME( 1997, winspike, konamigx, winspike, common, konamigx_state, init_konamigx, ROT0, "Konami", "Winning Spike (ver EAA)", MACHINE_UNEMULATED_PROTECTION | MACHINE_IMPERFECT_GRAPHICS ) -GAME( 1997, winspikea, winspike, winspike, common, konamigx_state, init_konamigx, ROT0, "Konami", "Winning Spike (ver AAA)", MACHINE_UNEMULATED_PROTECTION | MACHINE_IMPERFECT_GRAPHICS ) -GAME( 1997, winspikej, winspike, winspike, common, konamigx_state, init_konamigx, ROT0, "Konami", "Winning Spike (ver JAA)", MACHINE_UNEMULATED_PROTECTION | MACHINE_IMPERFECT_GRAPHICS ) +GAME( 1997, winspike, konamigx, winspike, common, konamigx_state, init_konamigx, ROT0, "Konami", "Winning Spike (ver EAA)", MACHINE_UNEMULATED_PROTECTION | MACHINE_IMPERFECT_GRAPHICS ) +GAME( 1997, winspikea, winspike, winspike, common, konamigx_state, init_konamigx, ROT0, "Konami", "Winning Spike (ver AAA)", MACHINE_UNEMULATED_PROTECTION | MACHINE_IMPERFECT_GRAPHICS ) +GAME( 1997, winspikej, winspike, winspike, common, konamigx_state, init_konamigx, ROT0, "Konami", "Winning Spike (ver JAA)", MACHINE_UNEMULATED_PROTECTION | MACHINE_IMPERFECT_GRAPHICS ) /* -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Type 3: dual monitor output and 53936 on the ROM board, external palette RAM --------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ -GAME( 1994, soccerss, konamigx, gxtype3, type3, konamigx_state, init_posthack, ROT0, "Konami", "Soccer Superstars (ver EAC)", MACHINE_IMPERFECT_GRAPHICS ) // writes EAA to EEPROM, but should be version EAC according to labels -GAME( 1994, soccerssu, soccerss, gxtype3, type3, konamigx_state, init_posthack, ROT0, "Konami", "Soccer Superstars (ver UAC)", MACHINE_IMPERFECT_GRAPHICS ) // writes UAA to EEPROM, but should be version UAC according to labels -GAME( 1994, soccerssj, soccerss, gxtype3, type3, konamigx_state, init_posthack, ROT0, "Konami", "Soccer Superstars (ver JAC)", MACHINE_IMPERFECT_GRAPHICS ) // writes JAB to EEPROM, but should be version JAC according to labels -GAME( 1994, soccerssja,soccerss, gxtype3, type3, konamigx_state, init_posthack, ROT0, "Konami", "Soccer Superstars (ver JAA)", MACHINE_IMPERFECT_GRAPHICS ) -GAME( 1994, soccerssa, soccerss, gxtype3, type3, konamigx_state, init_posthack, ROT0, "Konami", "Soccer Superstars (ver AAA)", MACHINE_IMPERFECT_GRAPHICS ) +GAME( 1994, soccerss, konamigx, gxtype3, type3, konamigx_state, init_posthack, ROT0, "Konami", "Soccer Superstars (ver EAC)", MACHINE_IMPERFECT_GRAPHICS ) // writes EAA to EEPROM, but should be version EAC according to labels +GAME( 1994, soccerssu, soccerss, gxtype3, type3, konamigx_state, init_posthack, ROT0, "Konami", "Soccer Superstars (ver UAC)", MACHINE_IMPERFECT_GRAPHICS ) // writes UAA to EEPROM, but should be version UAC according to labels +GAME( 1994, soccerssj, soccerss, gxtype3, type3, konamigx_state, init_posthack, ROT0, "Konami", "Soccer Superstars (ver JAC)", MACHINE_IMPERFECT_GRAPHICS ) // writes JAB to EEPROM, but should be version JAC according to labels +GAME( 1994, soccerssja, soccerss, gxtype3, type3, konamigx_state, init_posthack, ROT0, "Konami", "Soccer Superstars (ver JAA)", MACHINE_IMPERFECT_GRAPHICS ) +GAME( 1994, soccerssa, soccerss, gxtype3, type3, konamigx_state, init_posthack, ROT0, "Konami", "Soccer Superstars (ver AAA)", MACHINE_IMPERFECT_GRAPHICS ) /* -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Type 4: dual monitor output and 53936 on the ROM board, external palette RAM, DMA protection --------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ -GAME( 1996, vsnetscr, konamigx, gxtype4_vsn, type3, konamigx_state, init_konamigx, ROT0, "Konami", "Versus Net Soccer (ver EAD)", MACHINE_IMPERFECT_GRAPHICS|MACHINE_IMPERFECT_SOUND ) -GAME( 1996, vsnetscreb,vsnetscr, gxtype4_vsn, type3, konamigx_state, init_konamigx, ROT0, "Konami", "Versus Net Soccer (ver EAB)", MACHINE_IMPERFECT_GRAPHICS|MACHINE_IMPERFECT_SOUND ) -GAME( 1996, vsnetscru, vsnetscr, gxtype4_vsn, type3, konamigx_state, init_konamigx, ROT0, "Konami", "Versus Net Soccer (ver UAB)", MACHINE_IMPERFECT_GRAPHICS|MACHINE_IMPERFECT_SOUND ) -GAME( 1996, vsnetscra, vsnetscr, gxtype4_vsn, type3, konamigx_state, init_konamigx, ROT0, "Konami", "Versus Net Soccer (ver AAA)", MACHINE_IMPERFECT_GRAPHICS|MACHINE_IMPERFECT_SOUND ) -GAME( 1996, vsnetscrj, vsnetscr, gxtype4_vsn, type3, konamigx_state, init_konamigx, ROT0, "Konami", "Versus Net Soccer (ver JAB)", MACHINE_IMPERFECT_GRAPHICS|MACHINE_IMPERFECT_SOUND ) +GAME( 1996, vsnetscr, konamigx, gxtype4_vsn, type3, konamigx_state, init_konamigx, ROT0, "Konami", "Versus Net Soccer (ver EAD)", MACHINE_IMPERFECT_GRAPHICS|MACHINE_IMPERFECT_SOUND ) +GAME( 1996, vsnetscreb, vsnetscr, gxtype4_vsn, type3, konamigx_state, init_konamigx, ROT0, "Konami", "Versus Net Soccer (ver EAB)", MACHINE_IMPERFECT_GRAPHICS|MACHINE_IMPERFECT_SOUND ) +GAME( 1996, vsnetscru, vsnetscr, gxtype4_vsn, type3, konamigx_state, init_konamigx, ROT0, "Konami", "Versus Net Soccer (ver UAB)", MACHINE_IMPERFECT_GRAPHICS|MACHINE_IMPERFECT_SOUND ) +GAME( 1996, vsnetscra, vsnetscr, gxtype4_vsn, type3, konamigx_state, init_konamigx, ROT0, "Konami", "Versus Net Soccer (ver AAA)", MACHINE_IMPERFECT_GRAPHICS|MACHINE_IMPERFECT_SOUND ) +GAME( 1996, vsnetscrj, vsnetscr, gxtype4_vsn, type3, konamigx_state, init_konamigx, ROT0, "Konami", "Versus Net Soccer (ver JAB)", MACHINE_IMPERFECT_GRAPHICS|MACHINE_IMPERFECT_SOUND ) -GAME( 1996, rungun2, konamigx, gxtype4sd2, type3, konamigx_state, init_konamigx, ROT0, "Konami", "Run and Gun 2 (ver UAA)", MACHINE_IMPERFECT_GRAPHICS ) -GAME( 1996, slamdnk2, rungun2, gxtype4sd2, type3, konamigx_state, init_konamigx, ROT0, "Konami", "Slam Dunk 2 (ver JAA)", MACHINE_IMPERFECT_GRAPHICS ) +GAME( 1996, rungun2, konamigx, gxtype4sd2, type3, konamigx_state, init_konamigx, ROT0, "Konami", "Run and Gun 2 (ver UAA)", MACHINE_IMPERFECT_GRAPHICS ) +GAME( 1996, slamdnk2, rungun2, gxtype4sd2, type3, konamigx_state, init_konamigx, ROT0, "Konami", "Slam Dunk 2 (ver JAA)", MACHINE_IMPERFECT_GRAPHICS ) -GAME( 1996, rushhero, konamigx, gxtype4, type3, konamigx_state, init_konamigx, ROT0, "Konami", "Rushing Heroes (ver UAB)", MACHINE_IMPERFECT_GRAPHICS ) +GAME( 1996, rushhero, konamigx, gxtype4, type3, konamigx_state, init_konamigx, ROT0, "Konami", "Rushing Heroes (ver UAB)", MACHINE_IMPERFECT_GRAPHICS ) diff --git a/src/mame/konami/konamigx.h b/src/mame/konami/konamigx.h index 7336d7ba96320..a36b40631845a 100644 --- a/src/mame/konami/konamigx.h +++ b/src/mame/konami/konamigx.h @@ -144,6 +144,7 @@ class konamigx_state : public driver_device void konamigx_precache_registers(void); void wipezbuf(int noshadow); + void set_brightness(int layer); void dmastart_callback(int data); @@ -170,23 +171,24 @@ class konamigx_state : public driver_device int K055555GX_decode_vmixcolor(int layer, int *color); [[maybe_unused]] int K055555GX_decode_osmixcolor(int layer, int *color); - void init_posthack(); - void konamigx_6bpp(machine_config &config); - void gxtype4(machine_config &config); - void gxtype4_vsn(machine_config &config); - void racinfrc(machine_config &config); - void gxtype4sd2(machine_config &config); - void konamigx_bios(machine_config &config); - void gxtype3(machine_config &config); - void opengolf(machine_config &config); - void winspike(machine_config &config); - void le2(machine_config &config); - void konamigx(machine_config &config); - void dragoonj(machine_config &config); - void salmndr2(machine_config &config); - void tbyahhoo(machine_config &config); - void gokuparo(machine_config &config); - void sexyparo(machine_config &config); + void init_posthack() ATTR_COLD; + void konamigx_6bpp(machine_config &config) ATTR_COLD; + void gxtype4(machine_config &config) ATTR_COLD; + void gxtype4_vsn(machine_config &config) ATTR_COLD; + void racinfrc(machine_config &config) ATTR_COLD; + void gxtype4sd2(machine_config &config) ATTR_COLD; + void konamigx_bios(machine_config &config) ATTR_COLD; + void gxtype3(machine_config &config) ATTR_COLD; + void opengolf(machine_config &config) ATTR_COLD; + void winspike(machine_config &config) ATTR_COLD; + void le2(machine_config &config) ATTR_COLD; + void konamigx(machine_config &config) ATTR_COLD; + void dragoonj(machine_config &config) ATTR_COLD; + void salmndr2(machine_config &config) ATTR_COLD; + void tbyahhoo(machine_config &config) ATTR_COLD; + void gokuparo(machine_config &config) ATTR_COLD; + void sexyparo(machine_config &config) ATTR_COLD; + void sexyparoebl(machine_config &config) ATTR_COLD; void gx_base_memmap(address_map &map) ATTR_COLD; void racinfrc_map(address_map &map) ATTR_COLD; void gx_type1_map(address_map &map) ATTR_COLD; @@ -195,12 +197,13 @@ class konamigx_state : public driver_device void gx_type4_map(address_map &map) ATTR_COLD; void gxsndmap(address_map &map) ATTR_COLD; void gxtmsmap(address_map &map) ATTR_COLD; + void sexyparoebl_map(address_map &map) ATTR_COLD; protected: required_device m_maincpu; optional_device m_soundcpu; optional_device m_dasp; - required_device m_k053252; + optional_device m_k053252; required_device m_k055673; required_device m_k055555; required_device m_k056832; @@ -247,6 +250,9 @@ class konamigx_state : public driver_device uint16_t *m_gx_spriteram = nullptr; std::unique_ptr m_gx_spriteram_alloc; + u8 m_current_brightness = 0xff; + u8 m_brightness[3]{}; + // mirrored K054338 settings int *m_K054338_shdRGB = nullptr; diff --git a/src/mame/konami/konamigx_m.cpp b/src/mame/konami/konamigx_m.cpp index 26bf5f14ab928..0727f446efdb8 100644 --- a/src/mame/konami/konamigx_m.cpp +++ b/src/mame/konami/konamigx_m.cpp @@ -53,8 +53,8 @@ uint16_t konamigx_state::K055550_word_r(offs_t offset) void konamigx_state::K055550_word_w(offs_t offset, uint16_t data, uint16_t mem_mask) { auto &mspace = m_maincpu->space(AS_PROGRAM); - uint32_t adr, bsize, count, i, lim; - int src, tgt, srcend, tgtend, skip, cx1, sx1, wx1, cy1, sy1, wy1, cz1, sz1, wz1, c2, s2, w2; + uint32_t adr, bsize, count, i, lim, src, dst; + int tgt, srcend, tgtend, skip, cx1, sx1, wx1, cy1, sy1, wy1, cz1, sz1, wz1, c2, s2, w2; int dx, dy, angle; COMBINE_DATA(m_prot_data+offset); @@ -71,10 +71,25 @@ void konamigx_state::K055550_word_w(offs_t offset, uint16_t data, uint16_t mem_m count = (m_prot_data[0] & 0xff) + 1; lim = adr+bsize*count; - for(i=adr; i> 2; + + for (int x = 0; x < count; ++x) + { + const u32 src_data = mspace.read_dword(src + x * 8); + mspace.write_dword(dst + x * 4, src_data); + } + break; + // WARNING: The following cases are speculation based with questionable accuracy!(AAT) case 0x87: // unknown memory write (Violent Storm at 0x00b6ea) @@ -101,7 +116,7 @@ void konamigx_state::K055550_word_w(offs_t offset, uint16_t data, uint16_t mem_m tgtend = srcend + bsize; // let's hope GCC will inline the mem24bew calls - for (src=adr; src=wx1+w2) continue; // X rejection + if (abs((cx1 + sx1) - (c2 + s2)) >= wx1 + w2) continue; // X rejection c2 = (short)mspace.read_word(tgt + 6); s2 = (short)mspace.read_word(tgt + 8); w2 = (short)mspace.read_word(tgt +10); - if (abs((cy1+sy1)-(c2+s2))>=wy1+w2) continue; // Y rejection + if (abs((cy1 + sy1) - (c2 + s2)) >= wy1 + w2) continue; // Y rejection c2 = (short)mspace.read_word(tgt +12); s2 = (short)mspace.read_word(tgt +14); w2 = (short)mspace.read_word(tgt +16); - if (abs((cz1+sz1)-(c2+s2))>=wz1+w2) continue; // Z rejection + if (abs((cz1 + sz1) - (c2 + s2)) >= wz1 + w2) continue; // Z rejection mspace.write_byte(i, 0x80); // collision confirmed } @@ -211,13 +226,13 @@ void konamigx_state::K053990_martchmp_word_w(offs_t offset, uint16_t data, uint1 dst_skip += element_size; if (element_size == 1) - for (i=src_count; i; i--) + for (i = src_count; i; i--) { mspace.write_byte(dst_addr, mspace.read_byte(src_addr)); src_addr += src_skip; dst_addr += dst_skip; } - else for (i=src_count; i; i--) + else for (i = src_count; i; i--) { mspace.write_word(dst_addr, mspace.read_word(src_addr)); src_addr += src_skip; @@ -387,7 +402,7 @@ if((data1=obj[0])&0x80000000)\ case 0x11010010: i = 5; vmask = 0x1ff; break; case 0x01111018: i = 4; break; case 0x10010011: i = 3; - if ((srcbase[0x1c75]&0xff)==32) m_k055555->K055555_write_reg(K55_BLEND_ENABLES,36); // (TEMPORARY) + if ((srcbase[0x1c75] & 0xff) == 32) m_k055555->K055555_write_reg(K55_BLEND_ENABLES,36); // (TEMPORARY) break; case 0x11010811: i = 2; break; case 0x10000010: i = 1; break; @@ -424,8 +439,8 @@ if((data1=obj[0])&0x80000000)\ // decode Lord British (the designer must be a Richard Garriot fan too:) if (srcbase[0x0848/4] & 0x0000ffff) { - hoffs = srcbase[0x08b0/4]>>16; - voffs = srcbase[0x08b4/4]>>16; + hoffs = srcbase[0x08b0/4] >> 16; + voffs = srcbase[0x08b4/4] >> 16; hoffs -= hcorr; voffs -= vcorr; obj = &srcbase[0x084c/4]; @@ -445,8 +460,8 @@ if((data1=obj[0])&0x80000000)\ i = src[7] & 0xf; if (!i) continue; // reject retired or zero-element groups i <<= 2; - hoffs = src[5]>>16; - voffs = src[6]>>16; + hoffs = src[5] >> 16; + voffs = src[6] >> 16; hoffs -= hcorr; voffs -= vcorr; obj = src + 8; @@ -456,9 +471,9 @@ if((data1=obj[0])&0x80000000)\ { EXTRACT_EVEN } - while ((obj+=4)space(AS_PROGRAM); COMBINE_DATA(m_fantjour_dma + offset); - if(!offset && ACCESSING_BITS_24_31) { + if (!offset && ACCESSING_BITS_24_31) { uint32_t sa = m_fantjour_dma[1]; // uint16_t ss = (m_fantjour_dma[2] & 0xffff0000) >> 16; // uint32_t sb = ((m_fantjour_dma[2] & 0xffff) << 16) | ((m_fantjour_dma[3] & 0xffff0000) >> 16); @@ -496,16 +511,18 @@ void konamigx_state::fantjour_dma_w(offs_t offset, uint32_t data, uint32_t mem_m uint32_t x = m_fantjour_dma[6]; uint32_t i1, i2; - if(mode == 0x93) - for(i1=0; i1 <= sz2; i1++) - for(i2=0; i2 < db; i2+=4) { + if (mode == 0x93) + for (i1 = 0; i1 <= sz2; i1++) + for (i2 = 0; i2 < db; i2 += 4) + { mspace.write_dword(da, mspace.read_dword(sa) ^ x); da += 4; sa += 4; } - else if(mode == 0x8f) - for(i1=0; i1 <= sz2; i1++) - for(i2=0; i2 < db; i2+=4) { + else if (mode == 0x8f) + for (i1 = 0; i1 <= sz2; i1++) + for (i2 = 0; i2 < db; i2 += 4) + { mspace.write_dword(da, x); da += 4; } diff --git a/src/mame/konami/konamigx_v.cpp b/src/mame/konami/konamigx_v.cpp index 2f1cf7a07c1de..cdde3894abf93 100644 --- a/src/mame/konami/konamigx_v.cpp +++ b/src/mame/konami/konamigx_v.cpp @@ -54,6 +54,10 @@ void konamigx_state::konamigx_precache_registers(void) m_vmixon = m_k055555->K055555_read_register(K55_VINMIX_ON); m_osinmix = m_k055555->K055555_read_register(K55_OSBLEND_ENABLES); m_osmixon = m_k055555->K055555_read_register(K55_OSBLEND_ON); + + m_brightness[0] = u8(m_k054338->register_r(K338_REG_BRI3)); + m_brightness[1] = u8(m_k054338->register_r(K338_REG_BRI3 + 1) >> 8); + m_brightness[2] = u8(m_k054338->register_r(K338_REG_BRI3 + 1)); } inline int konamigx_state::K053247GX_combine_c18(int attrib) // (see p.46) @@ -243,6 +247,22 @@ void konamigx_state::wipezbuf(int noshadow) } } +void konamigx_state::set_brightness(int layer) +{ + const u8 bri_mode = (m_k055555->K055555_read_register(K55_VBRI) >> layer * 2) & 0b11; + + const u8 new_brightness = bri_mode ? m_brightness[bri_mode - 1] : 0xff; + + if (m_current_brightness != new_brightness) + { + m_current_brightness = new_brightness; + for (int x = 0; x < m_palette->entries(); ++x) + { + m_palette->set_pen_contrast(x, m_current_brightness / 255.0); + } + } +} + /* * Sprite Format * ------------------ @@ -664,6 +684,8 @@ void konamigx_state::gx_draw_basic_tilemaps(screen_device &screen, bitmap_rgb32 int disp = m_k055555->K055555_read_register(K55_INPUT_ENABLES); if (disp & (1<>(i+16); temp3 = 3; } else @@ -1135,6 +1157,8 @@ void konamigx_state::common_init() save_item(NAME(m_vmixon)); save_item(NAME(m_osinmix)); save_item(NAME(m_osmixon)); + save_item(NAME(m_current_brightness)); + save_item(NAME(m_brightness)); m_gx_tilemode = 0; diff --git a/src/mame/konami/mystwarr.cpp b/src/mame/konami/mystwarr.cpp index 604ed5dfd1f4a..2445cbca91fe2 100644 --- a/src/mame/konami/mystwarr.cpp +++ b/src/mame/konami/mystwarr.cpp @@ -143,6 +143,7 @@ we have no way of knowing which is the later/corrected version. #include "machine/eepromser.h" #include "sound/k054539.h" #include "sound/okim6295.h" + #include "speaker.h" @@ -154,7 +155,7 @@ uint16_t mystwarr_state::eeprom_r(offs_t offset, uint16_t mem_mask) return ioport("IN1")->read(); } -// logerror("msb access to eeprom port\n"); + //logerror("msb access to eeprom port\n"); return 0; } @@ -166,8 +167,7 @@ void mystwarr_state::mweeprom_w(offs_t offset, uint16_t data, uint16_t mem_mask) ioport("EEPROMOUT")->write(data, 0xffff); } -// logerror("unknown LSB write %x to eeprom\n", data); - + //logerror("unknown LSB write %x to eeprom\n", data); } uint16_t mystwarr_state::dddeeprom_r(offs_t offset, uint16_t mem_mask) @@ -198,14 +198,14 @@ TIMER_DEVICE_CALLBACK_MEMBER(mystwarr_state::mystwarr_interrupt) if (!(m_mw_irq_control & 0x01)) return; - if(scanline == 240) + if (scanline == 240) m_maincpu->set_input_line(M68K_IRQ_2, HOLD_LINE); - if(scanline == 0) + if (scanline == 0) m_maincpu->set_input_line(M68K_IRQ_4, HOLD_LINE); /* writes to LSB of 0x410000 port and clears a work RAM flag, almost likely not really necessary. */ -// m_maincpu->set_input_line(M68K_IRQ_6, HOLD_LINE); + //m_maincpu->set_input_line(M68K_IRQ_6, HOLD_LINE); } TIMER_DEVICE_CALLBACK_MEMBER(mystwarr_state::metamrph_interrupt) @@ -213,12 +213,12 @@ TIMER_DEVICE_CALLBACK_MEMBER(mystwarr_state::metamrph_interrupt) int scanline = param; /* irq 4 has an irq routine in metamrph, but it's not really called */ -// m_maincpu->set_input_line(M68K_IRQ_4, HOLD_LINE); + //m_maincpu->set_input_line(M68K_IRQ_4, HOLD_LINE); - if(scanline == 24) + if (scanline == 24) m_maincpu->set_input_line(M68K_IRQ_6, HOLD_LINE); - if(scanline == 248) + if (scanline == 248) if (m_k055673->k053246_is_irq_enabled()) m_maincpu->set_input_line(M68K_IRQ_5, HOLD_LINE); } @@ -228,12 +228,12 @@ TIMER_DEVICE_CALLBACK_MEMBER(mystwarr_state::mchamp_interrupt) if (!(m_mw_irq_control & 0x40)) return; - if(scanline == 247) + if (scanline == 247) { if (m_k055673->k053246_is_irq_enabled()) m_maincpu->set_input_line(M68K_IRQ_6, HOLD_LINE); } - if(scanline == 23) + if (scanline == 23) m_maincpu->set_input_line(M68K_IRQ_2, HOLD_LINE); } @@ -256,10 +256,9 @@ void mystwarr_state::irq_ack_w(offs_t offset, uint16_t data, uint16_t mem_mask) if (offset == 3 && ACCESSING_BITS_0_7) { - m_mw_irq_control = data&0xff; - -// if ((data &0xf0) != 0xd0) logerror("Unknown write to IRQ reg: %x\n", data); + m_mw_irq_control = data & 0xff; + //if ((data &0xf0) != 0xd0) logerror("Unknown write to IRQ reg: %x\n", data); } } @@ -280,7 +279,7 @@ void mystwarr_state::k053247_scattered_word_w(offs_t offset, uint16_t data, uint { if (offset & 0x0078) { -// osd_printf_debug("spr write %x to %x (PC=%x)\n", data, offset, m_maincpu->pc()); + //osd_printf_debug("spr write %x to %x (PC=%x)\n", data, offset, m_maincpu->pc()); COMBINE_DATA(&m_spriteram[offset]); } else @@ -440,7 +439,6 @@ void mystwarr_state::k053247_martchmp_word_w(offs_t offset, uint16_t data, uint1 else { offset = (offset & 0x0007) | ((offset & 0x1fe0) >> 2); - m_k055673->k053247_word_w(offset,data,mem_mask); } } @@ -461,7 +459,7 @@ void mystwarr_state::mccontrol_w(offs_t offset, uint16_t data, uint16_t mem_mask m_k055673->k053246_set_objcha_line((data&0x04) ? ASSERT_LINE : CLEAR_LINE); } -// else logerror("write %x to LSB of mccontrol\n", data); + //else logerror("write %x to LSB of mccontrol\n", data); } void mystwarr_state::mceeprom_w(offs_t offset, uint16_t data, uint16_t mem_mask) @@ -478,7 +476,7 @@ void mystwarr_state::mceeprom_w(offs_t offset, uint16_t data, uint16_t mem_mask) // bit 6 VINTEN ioport("EEPROMOUT")->write(data, 0xffff); } - // logerror("unknown LSB write %x to eeprom\n", data); + //logerror("unknown LSB write %x to eeprom\n", data); } /* Martial Champion */ @@ -886,25 +884,21 @@ MACHINE_START_MEMBER(mystwarr_state,mystwarr) MACHINE_RESET_MEMBER(mystwarr_state,mystwarr) { - int i; - // soften chorus(chip 0 channel 0-3), boost voice(chip 0 channel 4-7) - for (i=0; i<=3; i++) + for (int i = 0; i <= 3; i++) { m_k054539_1->set_gain(i, 0.8); m_k054539_1->set_gain(i+4, 2.0); } // soften percussions(chip 1 channel 0-7) - for (i=0; i<=7; i++) m_k054539_2->set_gain(i, 0.5); + for (int i = 0; i <= 7; i++) m_k054539_2->set_gain(i, 0.5); } MACHINE_RESET_MEMBER(mystwarr_state,dadandrn) { - int i; - // boost voice(chip 0 channel 4-7) - for (i=4; i<=7; i++) m_k054539_1->set_gain(i, 2.0); + for (int i = 4; i <= 7; i++) m_k054539_1->set_gain(i, 2.0); } MACHINE_START_MEMBER(mystwarr_state,viostormbl) @@ -922,15 +916,13 @@ MACHINE_START_MEMBER(mystwarr_state,viostormbl) MACHINE_RESET_MEMBER(mystwarr_state,viostorm) { if (m_k054539_1.found()) - for (int i=4; i<=7; i++) m_k054539_1->set_gain(i, 2.0); // boost voice(chip 0 channel 4-7) + for (int i = 4; i <= 7; i++) m_k054539_1->set_gain(i, 2.0); // boost voice(chip 0 channel 4-7) } MACHINE_RESET_MEMBER(mystwarr_state,metamrph) { - int i; - // boost voice(chip 0 channel 4-7) and soften other channels - for (i=0; i<=3; i++) + for (int i = 0; i <= 3; i++) { m_k054539_1->set_gain(i, 0.8); m_k054539_1->set_gain(i+4, 1.8); @@ -941,18 +933,14 @@ MACHINE_RESET_MEMBER(mystwarr_state,metamrph) MACHINE_RESET_MEMBER(mystwarr_state,martchmp) { - int i; - // boost voice(chip 0 channel 4-7) - for (i=4; i<=7; i++) m_k054539_1->set_gain(i, 1.4); + for (int i = 4; i <= 7; i++) m_k054539_1->set_gain(i, 1.4); } MACHINE_RESET_MEMBER(mystwarr_state,gaiapols) { - int i; - // boost voice(chip 0 channel 5-7) - for (i=5; i<=7; i++) m_k054539_1->set_gain(i, 2.0); + for (int i = 5; i <= 7; i++) m_k054539_1->set_gain(i, 2.0); } diff --git a/src/mame/konami/mystwarr_v.cpp b/src/mame/konami/mystwarr_v.cpp index 8b8c8b9cae1df..9fc8b894f9372 100644 --- a/src/mame/konami/mystwarr_v.cpp +++ b/src/mame/konami/mystwarr_v.cpp @@ -18,7 +18,7 @@ void mystwarr_state::decode_tiles() { uint8_t *s = memregion("k056832")->base(); int len = memregion("k056832")->bytes(); - uint8_t *pFinish = s+len-3; + uint8_t *pFinish = s + len - 3; uint8_t *d; int gfxnum = m_k056832->get_gfx_num(); @@ -59,7 +59,15 @@ void mystwarr_state::decode_tiles() // Mystic Warriors requires tile based blending. K056832_CB_MEMBER(mystwarr_state::mystwarr_tile_callback) { - if (layer == 1) {if ((*code & 0xff00) + (*color) == 0x4101) m_cbparam++; else m_cbparam--;} //* water hack (TEMPORARY) + if (layer == 1) + { + //* water hack (TEMPORARY) + if ((*code & 0xff00) + (*color) == 0x4101) + m_cbparam++; + else + m_cbparam--; + } + *color = m_layer_colorbase[layer] | (*color >> 1 & 0x1e); } @@ -77,10 +85,10 @@ K056832_CB_MEMBER(mystwarr_state::game4bpp_tile_callback) K055673_CB_MEMBER(mystwarr_state::mystwarr_sprite_callback) { - *priority_mask = *color & 0x00e0; + *priority_mask = *color & 0xe0; - const int effect_attributes = ((*color >> 8) & 0b11) << K055555_MIXSHIFT; // used for blending - *color = m_sprite_colorbase | (*color & 0x001f) | effect_attributes; + const int effect = ((*color >> 8) & 0b11) << K055555_MIXSHIFT; // used for blending + *color = m_sprite_colorbase | (*color & 0x1f) | effect; } K055673_CB_MEMBER(mystwarr_state::metamrph_sprite_callback) @@ -88,16 +96,14 @@ K055673_CB_MEMBER(mystwarr_state::metamrph_sprite_callback) *priority_mask = (*color & 0xe0) >> 2; const int shadow = (*color >> 10) & 0b11; - const int effect_attributes = ((*color >> 8) & 0b11) << K055555_MIXSHIFT; // used for blending - *color = (*color & 0x1f) | m_sprite_colorbase | effect_attributes | ((shadow == 0b11) ? K055555_SKIPSHADOW : 0); + const int effect = ((*color >> 8) & 0b11) << K055555_MIXSHIFT; // used for blending + *color = m_sprite_colorbase | (*color & 0x1f) | effect | ((shadow == 0b11) ? K055555_SKIPSHADOW : 0); } K055673_CB_MEMBER(mystwarr_state::gaiapols_sprite_callback) { - int c = *color; - - *color = m_sprite_colorbase | (c>>4 & 0x20) | (c & 0x001f); - *priority_mask = c & 0x00e0; + *priority_mask = *color & 0xe0; + *color = m_sprite_colorbase | (*color >> 4 & 0x20) | (*color & 0x1f); } K055673_CB_MEMBER(mystwarr_state::martchmp_sprite_callback) @@ -111,7 +117,7 @@ K055673_CB_MEMBER(mystwarr_state::martchmp_sprite_callback) *color = m_sprite_colorbase | (c & 0x1f); if (m_oinprion & 0xf0) - *priority_mask = m_cbparam; // use PCU2 internal priority + *priority_mask = m_cbparam; // use PCU2 internal priority else *priority_mask = c & 0xf0; // use color implied priority } @@ -124,12 +130,12 @@ TILE_GET_INFO_MEMBER(mystwarr_state::get_gai_936_tile_info) uint8_t *ROM = memregion("gfx4")->base(); uint8_t *dat1 = ROM, *dat2 = ROM + 0x20000, *dat3 = ROM + 0x60000; - tileno = dat3[tile_index] | ((dat2[tile_index]&0x3f)<<8); + tileno = dat3[tile_index] | ((dat2[tile_index] & 0x3f) << 8); if (tile_index & 1) - colour = (dat1[tile_index>>1]&0xf); + colour = (dat1[tile_index >> 1] & 0xf); else - colour = ((dat1[tile_index>>1]>>4)&0xf); + colour = ((dat1[tile_index >> 1] >> 4) & 0xf); if (dat2[tile_index] & 0x80) colour |= 0x10; @@ -160,15 +166,13 @@ VIDEO_START_MEMBER(mystwarr_state, gaiapols) TILE_GET_INFO_MEMBER(mystwarr_state::get_ult_936_tile_info) { - int tileno, colour; uint8_t *ROM = memregion("gfx4")->base(); uint8_t *dat1 = ROM, *dat2 = ROM + 0x40000; - tileno = dat2[tile_index] | ((dat1[tile_index]&0x1f)<<8); + int tileno = dat2[tile_index] | ((dat1[tile_index] & 0x1f) << 8); + int colour = m_sub1_colorbase; - colour = m_sub1_colorbase; - - tileinfo.set(0, tileno, colour, (dat1[tile_index]&0x40) ? TILE_FLIPX : 0); + tileinfo.set(0, tileno, colour, (dat1[tile_index] & 0x40) ? TILE_FLIPX : 0); } VIDEO_START_MEMBER(mystwarr_state, dadandrn) @@ -258,18 +262,22 @@ VIDEO_START_MEMBER(mystwarr_state, martchmp) uint32_t mystwarr_state::screen_update_mystwarr(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { - int i, old, blendmode=0; + int blendmode = 0; - if (m_cbparam<0) m_cbparam=0; else if (m_cbparam>=32) blendmode=(1<<16|GXMIX_BLEND_FORCE)<<2; //* water hack (TEMPORARY) + //* water hack (TEMPORARY) + if (m_cbparam < 0) + m_cbparam = 0; + else if (m_cbparam >= 32) + blendmode = (1 << 16 | GXMIX_BLEND_FORCE) << 2; - for (i = 0; i < 4; i++) + for (int i = 0; i < 4; i++) { - old = m_layer_colorbase[i]; - m_layer_colorbase[i] = m_k055555->K055555_get_palette_index(i)<<4; - if( old != m_layer_colorbase[i] ) m_k056832->mark_plane_dirty(i); + int old = m_layer_colorbase[i]; + m_layer_colorbase[i] = m_k055555->K055555_get_palette_index(i) << 4; + if (old != m_layer_colorbase[i]) m_k056832->mark_plane_dirty(i); } - m_sprite_colorbase = m_k055555->K055555_get_palette_index(4)<<5; + m_sprite_colorbase = m_k055555->K055555_get_palette_index(4) << 5; konamigx_mixer(screen, bitmap, cliprect, nullptr, 0, nullptr, 0, blendmode, nullptr, 0); return 0; @@ -277,16 +285,14 @@ uint32_t mystwarr_state::screen_update_mystwarr(screen_device &screen, bitmap_rg uint32_t mystwarr_state::screen_update_metamrph(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { - int i, old; - - for (i = 0; i < 4; i++) + for (int i = 0; i < 4; i++) { - old = m_layer_colorbase[i]; - m_layer_colorbase[i] = m_k055555->K055555_get_palette_index(i)<<4; + int old = m_layer_colorbase[i]; + m_layer_colorbase[i] = m_k055555->K055555_get_palette_index(i) << 4; if (old != m_layer_colorbase[i]) m_k056832->mark_plane_dirty(i); } - m_sprite_colorbase = m_k055555->K055555_get_palette_index(4)<<4; + m_sprite_colorbase = m_k055555->K055555_get_palette_index(4) << 4; konamigx_mixer(screen, bitmap, cliprect, nullptr, GXSUB_K053250 | GXSUB_4BPP, nullptr, 0, 0, nullptr, 0); return 0; @@ -294,12 +300,10 @@ uint32_t mystwarr_state::screen_update_metamrph(screen_device &screen, bitmap_rg uint32_t mystwarr_state::screen_update_martchmp(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { - int i, old, blendmode; - - for (i = 0; i < 4; i++) + for (int i = 0; i < 4; i++) { - old = m_layer_colorbase[i]; - m_layer_colorbase[i] = m_k055555->K055555_get_palette_index(i)<<4; + int old = m_layer_colorbase[i]; + m_layer_colorbase[i] = m_k055555->K055555_get_palette_index(i) << 4; if (old != m_layer_colorbase[i]) m_k056832->mark_plane_dirty(i); } @@ -309,7 +313,7 @@ uint32_t mystwarr_state::screen_update_martchmp(screen_device &screen, bitmap_rg m_oinprion = m_k055555->K055555_read_register(K55_OINPRI_ON); // not quite right - blendmode = (m_oinprion==0xef && m_k054338->register_r(K338_REG_PBLEND)) ? ((1<<16|GXMIX_BLEND_FORCE)<<2) : 0; + int blendmode = (m_oinprion == 0xef && m_k054338->register_r(K338_REG_PBLEND)) ? ((1 << 16 | GXMIX_BLEND_FORCE) << 2) : 0; konamigx_mixer(screen, bitmap, cliprect, nullptr, 0, nullptr, 0, blendmode, nullptr, 0); return 0; @@ -322,7 +326,7 @@ void mystwarr_state::ddd_053936_enable_w(offs_t offset, uint16_t data, uint16_t if (ACCESSING_BITS_8_15) { m_roz_enable = data & 0x0100; - m_roz_rombank = (data & 0xc000)>>14; + m_roz_rombank = (data & 0xc000) >> 14; } } @@ -377,7 +381,7 @@ uint16_t mystwarr_state::gai_053936_tilerom_0_r(offs_t offset) uint8_t *ROM2 = (uint8_t *)memregion("gfx4")->base(); ROM1 += 0x20000; - ROM2 += 0x20000+0x40000; + ROM2 += 0x20000 + 0x40000; return ((ROM1[offset]<<8) | ROM2[offset]); } @@ -407,7 +411,7 @@ uint16_t mystwarr_state::gai_053936_tilerom_2_r(offs_t offset) offset += (m_roz_rombank * 0x100000); - return ROM[offset/2]<<8; + return ROM[offset/2] << 8; } uint16_t mystwarr_state::ddd_053936_tilerom_2_r(offs_t offset) @@ -416,7 +420,7 @@ uint16_t mystwarr_state::ddd_053936_tilerom_2_r(offs_t offset) offset += (m_roz_rombank * 0x100000); - return ROM[offset]<<8; + return ROM[offset] << 8; } uint32_t mystwarr_state::screen_update_dadandrn(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)/* and gaiapols */ @@ -425,20 +429,20 @@ uint32_t mystwarr_state::screen_update_dadandrn(screen_device &screen, bitmap_rg if (m_gametype == 0) { - m_sprite_colorbase = (m_k055555->K055555_get_palette_index(4)<<4)&0x7f; + m_sprite_colorbase = (m_k055555->K055555_get_palette_index(4) << 4) & 0x7f; rozmode = GXSUB_4BPP; } else { - m_sprite_colorbase = (m_k055555->K055555_get_palette_index(4)<<3)&0x7f; + m_sprite_colorbase = (m_k055555->K055555_get_palette_index(4) << 3) & 0x7f; rozmode = GXSUB_8BPP; } if (m_k056832->get_layer_association()) { - for (i=0; i<4; i++) + for (i = 0; i < 4; i++) { - newbase = m_k055555->K055555_get_palette_index(i)<<4; + newbase = m_k055555->K055555_get_palette_index(i) << 4; if (m_layer_colorbase[i] != newbase) { m_layer_colorbase[i] = newbase; @@ -448,9 +452,9 @@ uint32_t mystwarr_state::screen_update_dadandrn(screen_device &screen, bitmap_rg } else { - for (dirty=0, i=0; i<4; i++) + for (dirty = 0, i = 0; i < 4; i++) { - newbase = m_k055555->K055555_get_palette_index(i)<<4; + newbase = m_k055555->K055555_get_palette_index(i) << 4; if (m_layer_colorbase[i] != newbase) { m_layer_colorbase[i] = newbase; diff --git a/src/mame/layout/5acespkr.lay b/src/mame/layout/5acespkr.lay new file mode 100644 index 0000000000000..5e59aa62f914e --- /dev/null +++ b/src/mame/layout/5acespkr.lay @@ -0,0 +1,175 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/mame/layout/drw80pkr.lay b/src/mame/layout/drw80pkr.lay new file mode 100644 index 0000000000000..5b25adf9e51fc --- /dev/null +++ b/src/mame/layout/drw80pkr.lay @@ -0,0 +1,182 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/mame/layout/linn_linndrum.lay b/src/mame/layout/linn_linndrum.lay new file mode 100644 index 0000000000000..ede9314f83e5a --- /dev/null +++ b/src/mame/layout/linn_linndrum.lay @@ -0,0 +1,770 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ]]> + + + + ]]> + + + + ]]> + + + + ]]> + + + + ]]> + + + + ]]> + + + + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + > + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/mame/layout/noraut09_sureshot.lay b/src/mame/layout/noraut09_sureshot.lay new file mode 100644 index 0000000000000..079a83a5bac41 --- /dev/null +++ b/src/mame/layout/noraut09_sureshot.lay @@ -0,0 +1,166 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/mame/layout/noraut10.lay b/src/mame/layout/noraut10.lay new file mode 100644 index 0000000000000..0dc164871692f --- /dev/null +++ b/src/mame/layout/noraut10.lay @@ -0,0 +1,183 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/mame/layout/noraut11.lay b/src/mame/layout/noraut11.lay index 81e186cb3ca9f..0c88ec27c34ac 100644 --- a/src/mame/layout/noraut11.lay +++ b/src/mame/layout/noraut11.lay @@ -1,6 +1,11 @@ @@ -190,41 +195,40 @@ license:CC0-1.0 - - - - - - - - + - + - + - + - + - - + + + + - - + + + + + + - + - + diff --git a/src/mame/layout/noraut12.lay b/src/mame/layout/noraut12.lay index 8a7dbefbb7ec3..2509101eba4f1 100644 --- a/src/mame/layout/noraut12.lay +++ b/src/mame/layout/noraut12.lay @@ -1,6 +1,11 @@ @@ -12,7 +17,7 @@ license:CC0-1.0 - + @@ -25,7 +30,7 @@ license:CC0-1.0 - + @@ -38,7 +43,7 @@ license:CC0-1.0 - + @@ -51,7 +56,7 @@ license:CC0-1.0 - + @@ -64,7 +69,7 @@ license:CC0-1.0 - + @@ -77,7 +82,7 @@ license:CC0-1.0 - + @@ -90,7 +95,7 @@ license:CC0-1.0 - + @@ -103,7 +108,7 @@ license:CC0-1.0 - + @@ -117,7 +122,7 @@ license:CC0-1.0 - + @@ -130,7 +135,7 @@ license:CC0-1.0 - + @@ -167,43 +172,43 @@ license:CC0-1.0 - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + diff --git a/src/mame/layout/oberheim_dmx.lay b/src/mame/layout/oberheim_dmx.lay index f293000cc8daa..95a6f98764f1e 100644 --- a/src/mame/layout/oberheim_dmx.lay +++ b/src/mame/layout/oberheim_dmx.lay @@ -92,13 +92,13 @@ copyright-holders:m1macrophage - + - + @@ -117,13 +117,13 @@ copyright-holders:m1macrophage - + - + @@ -133,6 +133,12 @@ copyright-holders:m1macrophage + + + + + + @@ -355,8 +361,8 @@ copyright-holders:m1macrophage - - + + @@ -368,6 +374,11 @@ copyright-holders:m1macrophage + + + + + @@ -541,121 +552,146 @@ copyright-holders:m1macrophage diff --git a/src/mame/layout/roland_d70.lay b/src/mame/layout/roland_d70.lay index 6f767e75eb4f8..7ec0d5404d832 100644 --- a/src/mame/layout/roland_d70.lay +++ b/src/mame/layout/roland_d70.lay @@ -248,7 +248,7 @@ copyright-holders:Felipe Sanches, m1macrophage - + @@ -256,7 +256,7 @@ copyright-holders:Felipe Sanches, m1macrophage - + @@ -264,7 +264,7 @@ copyright-holders:Felipe Sanches, m1macrophage - + @@ -272,7 +272,7 @@ copyright-holders:Felipe Sanches, m1macrophage - + @@ -550,84 +550,137 @@ copyright-holders:Felipe Sanches, m1macrophage diff --git a/src/mame/layout/vgmplay.lay b/src/mame/layout/vgmplay.lay index 0101a2375cd66..9cc22dd7115af 100644 --- a/src/mame/layout/vgmplay.lay +++ b/src/mame/layout/vgmplay.lay @@ -108,9 +108,10 @@ license:CC0-1.0 + - + ]]> @@ -122,9 +123,11 @@ license:CC0-1.0 + + - + ]]> @@ -136,9 +139,11 @@ license:CC0-1.0 + + - + ]]> @@ -150,9 +155,10 @@ license:CC0-1.0 + - + ]]> @@ -164,9 +170,11 @@ license:CC0-1.0 + + - + ]]> @@ -269,10 +277,10 @@ license:CC0-1.0 - - + + - + diff --git a/src/mame/layout/vpoker.lay b/src/mame/layout/vpoker.lay new file mode 100644 index 0000000000000..bf54d5db3baef --- /dev/null +++ b/src/mame/layout/vpoker.lay @@ -0,0 +1,192 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/mame/linn/linndrum.cpp b/src/mame/linn/linndrum.cpp index 2613e06dc6267..1a3fc345a6220 100644 --- a/src/mame/linn/linndrum.cpp +++ b/src/mame/linn/linndrum.cpp @@ -10,15 +10,63 @@ The firmware runs on a Z80. It controls the UI (reads buttons, drives displays and LEDs), synchronization with other devices, cassette I/O, and voice triggering. -The LinnDrum has 12-voice polyphony, not including the "click" (metronome). -It has a total of 15 voices, along with a "click" sound. Some of the voices have -variations, which brings the total to 24 different sounds. +The LinnDrum has 10 voice cores, not including the "click" (metronome) and +"beep" sounds. Many of the voices have variations (loudness, pitch, sample +selection, decay time), bringing the number of possible sounds to 28. However, +end-users can only trigger 23 sounds, and can control mixing and panning +for 15 of them (some are grouped together). Each voice core can run +independently, for a max polyphony of 10. Only one variation per core can be +active at a time. The "click" and "beep" sounds can be played independently of +each other and the voice cores. + +There are multiple voice architectures: + +* The "mux drums" section consists of 8 voice cores. Bass, cabasa, tambourine, + clap and cowbell (4K samples each), hi-hat (16K) and ride and crash cymbals + (32K each). Voices other than the clap and cowbell can be attenuated, to + create 2 loudness variations. The clap and cowbell always play at full volume. + There is a single, time-multiplexed DAC used for all voices, and each voice + has its own output. All 8 voices can be played simultaneously, but only a + single loudness variation of each. The bass drum is post-processed by a + CEM3320 VCF with a hardcoded envelope, but all other voices lack a + reconstruction filter. The hat is post-processed by a CEM3360 VCA, which can + operate in 2 variations: slow decay (open hat) and faster, user-controlled + decay (closed hat). There's a single clock for all voices, which is tuned by + a trimmer on the circuit board. + +* The "snare / sidestick" section consists of a single voice core (and single + DAC) which can either play the sidestick, or the snare voice (4K samples + each). The two voices have individual outputs, and their volume and pan can be + set independently. There are 4 possible loudness variations for each voice, + though the end-user only has access to 3 for the snare and 1 for the + sidestick. The voice core output is post-processed by a single-pole lowpass RC + filter. The end-user can control the sample rate via a tuning knob. + This section also includes the circuit for the "click" sound (metronome), + which triggers pulses of fixed length, and the circuit for the "beep" sound, + which allows the firmware to generate pulses of arbitrary length. + +* The "tom / conga" section is similar to the "snare / sidestick" one. It + consists of a single voice core (and single DAC) which can either play the tom + or the conga voice (8K samples each). There are 3 pitch variations for the + tom, and 2 pitch variations for the conga. The end-user can set the 5 pitches + using the corresponding tuning knobs. Each of those 5 variations has its own + output, and can be mixed and panned independently, even though only a single + one can be active at a time. All variations are post-processed by a CEM3320 + VCF with a hardcoded envelope. The driver is based on the LinnDrum's service manual and schematics, and is intended as an educational tool. -Most of the digital functionality is emulated, though it is not very usable due -to the lack of a layout. Audio is not yet emulated. +Most of the digital functionality is emulated. Audio is partially emulated. + +Reasons for MACHINE_IMPERFECT_SOUND: +* Missing a few sample checksums. +* Missing bass drum LPF and filter envelope. +* Missing snare / sidestick volume envelope. +* Missing tom / conga LPF and filter envelope. +* Inaccurate filter for "click". +* Linear, instead of audio-taper volume sliders and master volume knob. +* Linear, instead of tanh response for hi-hat VCA. PCBoards: * CPU board. 2 sections in schematics: @@ -34,16 +82,12 @@ to the lack of a layout. Audio is not yet emulated. Usage: -Since there is no layout yet, usability is limited. - -Run the driver with `-log`: -./mame -window linndrum -log - -Tail the log file: -(on linux): tail -f error.log +The driver includes an interactive layout. Make sure to enable plugins so that +sliders and knobs can be manipulated with the mouse. It is recommended to run +with a high sample rate. -Press a few of the assigned buttons (B for bass drum, N for snare, T for toms), -and see the voice triggers in the log. +Example: +./mame -window -samplerate 96000 -plugins -plugin layout linndrum */ #include "emu.h" @@ -52,30 +96,1047 @@ and see the voice triggers in the log. #include "machine/output_latch.h" #include "machine/rescap.h" #include "machine/timer.h" +#include "sound/dac76.h" +#include "sound/flt_rc.h" +#include "sound/flt_vol.h" +#include "sound/mixer.h" +#include "sound/spkrdev.h" +#include "speaker.h" + +#include "linn_linndrum.lh" #define LOG_KEYBOARD (1U << 1) #define LOG_DEBOUNCE (1U << 2) #define LOG_TEMPO (1U << 3) #define LOG_TEMPO_CHANGE (1U << 4) -#define LOG_TRIGGERS (1U << 5) +#define LOG_STROBES (1U << 5) #define LOG_TAPE_SYNC_ENABLE (1U << 6) +#define LOG_MIX (1U << 7) +#define LOG_PITCH (1U << 8) +#define LOG_HAT_VCA (1U << 9) -#define VERBOSE (LOG_GENERAL | LOG_TEMPO_CHANGE | LOG_TAPE_SYNC_ENABLE | LOG_TRIGGERS) +#define VERBOSE (LOG_GENERAL) //#define LOG_OUTPUT_FUNC osd_printf_info #include "logmacro.h" namespace { +enum mux_voices +{ + MV_TAMBOURINE = 0, + MV_CABASA, + MV_CLAP, + MV_COWBELL, + MV_BASS, + MV_HAT, + MV_RIDE, + MV_CRASH, + NUM_MUX_VOICES +}; + +// Names (excluding the TV_ prefix) match those in the schematics. +enum tom_voices +{ + TV_LOW_CONGA = 0, + TV_HI_CONGA, + TV_LOW_TOMS, + TV_MID_TOMS, + TV_HI_TOMS, + NUM_TOM_VOICES +}; + +// Names (excluding the TK_ prefix) match those on the tuning UI. +enum tuning_knobs +{ + TK_SNARE = 0, + TK_HI_TOMS, + TK_MID_TOMS, + TK_LO_TOMS, + TK_HI_CONGAS, + TK_LO_CONGAS, + NUM_TUNING_KNOBS +}; + +// Names (excluding the MIX_ prefix) match those on the mixer UI. +enum mixer_channels +{ + MIX_BASS = 0, + MIX_SNARE, + MIX_SIDESTICK, + MIX_HIHAT, + MIX_HITOMS, + MIX_MIDTOMS, + MIX_LOTOMS, + MIX_RIDE, + MIX_CRASH, + MIX_CABASA, + MIX_TAMB, + MIX_HICONGAS, + MIX_LOCONGAS, + MIX_COWBELL, + MIX_CLAPS, + MIX_CLICK, + NUM_MIXER_CHANNELS +}; + +} // anonymous namespace + +// This device combines the CEM3360 and its envelope generator (EG) that process +// the hi-hat voice. +// TODO: Look into implementing the CEM3360 and a generic EG as devices under +// src/devices/sound. +class linndrum_hat_vca_device : public device_t, public device_sound_interface +{ +public: + linndrum_hat_vca_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0) ATTR_COLD; + + void trigger(); + void set_open(bool open_hat); + +protected: + void device_add_mconfig(machine_config &config) override ATTR_COLD; + void device_start() override ATTR_COLD; + void device_reset() override ATTR_COLD; + void sound_stream_update(sound_stream &stream, std::vector const &inputs, std::vector &outputs) override; + +private: + static float get_cem3360_gain(float cv); + + TIMER_DEVICE_CALLBACK_MEMBER(trigger_timer_tick); + + static constexpr const float C22 = CAP_U(1); + static constexpr const float R33 = RES_M(1); + static constexpr const float R34 = RES_K(10); + static constexpr const float DECAY_POT_R_MAX = RES_K(100); + + sound_stream *m_stream = nullptr; + + required_ioport m_decay_pot; + required_device m_trigger_timer; // U37B (LM556). + + float m_rc_inv = 1.0F / (R33 * C22); + bool m_decaying = true; + bool m_decay_done = true; + attotime m_decay_start_time; +}; + +DEFINE_DEVICE_TYPE(LINNDRUM_HAT_VCA, linndrum_hat_vca_device, "linndrum_hat_vca", "LinnDrum CEM3360 VCA and EG"); + +linndrum_hat_vca_device::linndrum_hat_vca_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : device_t(mconfig, LINNDRUM_HAT_VCA, tag, owner, clock) + , device_sound_interface(mconfig, *this) + , m_decay_pot(*this, ":pot_tuning_7") + , m_trigger_timer(*this, "hat_trigger_timer") +{ +} + +void linndrum_hat_vca_device::trigger() +{ + m_stream->update(); + m_decaying = false; + m_decay_done = false; + m_trigger_timer->adjust(PERIOD_OF_555_MONOSTABLE(RES_K(510), CAP_U(0.01))); // R8, C4. + LOGMASKED(LOG_HAT_VCA, "Hat VCA trigerred.\n"); +} + +void linndrum_hat_vca_device::set_open(bool open_hat) +{ + // The envelope generator can run in two different modes. + // - Open hat: the capacitor is discharged through a 1M resistor. + // - Closed hat: U90 (CD4053 MUX) adds a parallel discharge path through the + // "hihat decay" knob. + m_stream->update(); + float r = R33; + if (!open_hat) + { + const float r_decay = DECAY_POT_R_MAX * m_decay_pot->read() / 100.0F; + r = RES_2_PARALLEL(R33, R34 + r_decay); + } + m_rc_inv = 1.0F / (r * C22); + LOGMASKED(LOG_HAT_VCA, "Hat decay. Open: %d, r: %g\n", open_hat, r); +} + +void linndrum_hat_vca_device::device_add_mconfig(machine_config &config) +{ + TIMER(config, m_trigger_timer).configure_generic(FUNC(linndrum_hat_vca_device::trigger_timer_tick)); +} + +void linndrum_hat_vca_device::device_start() +{ + m_stream = stream_alloc(1, 1, machine().sample_rate()); + save_item(NAME(m_rc_inv)); + save_item(NAME(m_decaying)); + save_item(NAME(m_decay_done)); + save_item(NAME(m_decay_start_time)); +} + +void linndrum_hat_vca_device::device_reset() +{ + set_open(false); +} + +void linndrum_hat_vca_device::sound_stream_update(sound_stream &stream, std::vector const &inputs, std::vector &outputs) +{ + static constexpr const float MIN_GAIN = 0.0001F; // A gain lower than this will be treated as 0. + static constexpr const float MAX_EG_CV = 5; + static constexpr const float CV_SCALE = RES_VOLTAGE_DIVIDER(RES_K(8.2), RES_K(10)); // R67, R66. + + assert(inputs.size() == 1 && outputs.size() == 1); + const read_stream_view &in = inputs[0]; + write_stream_view &out = outputs[0]; + + if (m_decay_done) + { + out.fill(0); + return; + } + + const int n = in.samples(); + if (!m_decaying) + { + const float gain = get_cem3360_gain(MAX_EG_CV * CV_SCALE); + for (int i = 0; i < n; ++i) + out.put(i, gain * in.get(i)); + return; + } + + attotime t = in.start_time() - m_decay_start_time; + assert(t >= attotime::from_double(0)); + float gain = 0; + for (int i = 0; i < n; ++i, t += in.sample_period()) + { + // TODO: The CEM3360 is based on an OTA, which means it likely has a + // tanh, rather than a linear response. But this needs more research. + const float decay = expf(-t.as_double() * m_rc_inv); + gain = get_cem3360_gain(decay * MAX_EG_CV * CV_SCALE); + out.put(i, gain * in.get(i)); + } + + if (gain < MIN_GAIN) + m_decay_done = true; +} + +float linndrum_hat_vca_device::get_cem3360_gain(float cv) +{ + // Typical linear CV for max gain, as reported on the CEM3360 datasheet. + static constexpr const float MAX_GAIN_CV = 1.93F; + return std::clamp(cv / MAX_GAIN_CV, 0, 1); +} + +TIMER_DEVICE_CALLBACK_MEMBER(linndrum_hat_vca_device::trigger_timer_tick) +{ + m_stream->update(); + m_decaying = true; + m_decay_done = false; + m_decay_start_time = machine().time(); + LOGMASKED(LOG_HAT_VCA, "Hat VCA started decay.\n"); +} + +class linndrum_audio_device : public device_t +{ +public: + linndrum_audio_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock = 0) ATTR_COLD; + + void mux_drum_w(int voice, u8 data, bool is_strobe = true); + void snare_w(u8 data); // Snare and sidestick. + void tom_w(u8 data); // Tom and conga. + void strobe_click_w(u8 data); + void beep_w(int state); + + DECLARE_INPUT_CHANGED_MEMBER(mix_changed); + DECLARE_INPUT_CHANGED_MEMBER(master_volume_changed); + DECLARE_INPUT_CHANGED_MEMBER(mux_drum_tuning_changed); + DECLARE_INPUT_CHANGED_MEMBER(snare_tuning_changed); + DECLARE_INPUT_CHANGED_MEMBER(tom_tuning_changed); + +protected: + void device_add_mconfig(machine_config &config) override ATTR_COLD; + void device_start() override ATTR_COLD; + void device_reset() override ATTR_COLD; + +private: + static void write_dac(dac76_device& dac, u8 sample); + static float get_dac_scaler(float iref); + static s32 get_ls267_freq(const std::array& freq_range_hz, float cv); + static float get_snare_tom_pitch_cv(float v); + + TIMER_DEVICE_CALLBACK_MEMBER(mux_timer_tick); + TIMER_DEVICE_CALLBACK_MEMBER(snare_timer_tick); + TIMER_DEVICE_CALLBACK_MEMBER(click_timer_tick); + TIMER_DEVICE_CALLBACK_MEMBER(tom_timer_tick); + + void update_volume_and_pan(int channel); + void update_master_volume(); + void update_mux_drum_pitch(); + void update_snare_pitch(); + void update_tom_pitch(); + + // Mux drums. + required_ioport m_mux_tuning_trimmer; + required_memory_region_array m_mux_samples; + required_device m_mux_timer; // 74LS627 (U77A). + required_device_array m_mux_dac; // AM6070 (U88). + required_device_array m_mux_volume; // CD4053 (U90), R60, R62. + required_device m_hat_vca; + std::array m_mux_counting = { false, false, false, false, false, false, false, false }; + std::array m_mux_counters = { 0, 0, 0, 0, 0, 0, 0, 0 }; + + // Snare / sidestick. + required_memory_region m_snare_samples; // 2732 ROM (U79). + required_memory_region m_sidestick_samples; // 2732 ROMs (U78). + required_device m_snare_timer; // 74L627 (U80A). + required_device m_snare_dac; // AM6070 (U92). + required_device m_snare_volume; // R69, R72, R71, R70. + required_device m_snare_out; // U90A (CD4053) pin 12 (ax). + required_device m_sidestick_out; // U90A (CD4053) pin 13 (ay). + required_device m_click_timer; // 556 (U65A). + required_device m_click; + required_device m_beep; + bool m_snare_counting = false; // /Q1 of U41 (74LS74). + u16 m_snare_counter = 0; // 13-bit counter (2 x 74LS393, U61, U62). + bool m_sidestick_selected = false; // Chooses between snare and sidestick. + + // Tom / conga. + required_ioport_array m_tuning_knobs; + required_memory_region m_tom_samples; // 2 x 2732 ROMs (U68, U69). + required_memory_region m_conga_samples; // 2 x 2732 ROMs (U66, U67). + required_device m_tom_timer; // 74LS627 (U77B). + required_device m_tom_dac; // AM6070 (U82). + required_device_array m_tom_out; // U87 (CD4051) outputs 0, 1, 4, 5, 6. + bool m_tom_counting = false; // /Q1 of U73 (74LS74). + u16 m_tom_counter = 0; // 14-bit counter (2 x 74LS393, U70, U71). + bool m_tom_selected = false; // Selects between tom and conga. + s8 m_tom_selected_pitch = 0; + + // Mixer. + required_ioport_array m_volume; + required_ioport_array m_pan; + required_ioport m_master_volume; + required_device_array m_voice_hpf; + required_device m_left_mixer; // 4558 op-amp (U1A). + required_device m_right_mixer; // 4558 op-amp (U1B). + required_device m_left_out; // 4558 op-amp (U2A). + required_device m_right_out; // 4558 op-amp (U2B). + + static constexpr const float MIXER_R_PRE_FADER[NUM_MIXER_CHANNELS] = + { + RES_R(0), // bass + RES_R(0), // snare + RES_R(0), // sidestick + RES_K(5.1), // hihat + RES_R(0), // hi tom + RES_R(0), // mid tom + RES_R(0), // low tom + RES_K(10), // ride + RES_K(5.1), // crash + RES_K(10), // cabasa + RES_K(10), // tambourine + RES_R(0), // hi conga + RES_R(0), // low conga + RES_K(5.1), // cowbell + RES_K(2.4), // clap + RES_K(0), // click + }; + + static constexpr const float MIXER_R_FEEDBACK = RES_K(33); + static constexpr const float MIXER_R_BEEP = RES_K(510); + static constexpr const float OUTPUT_R_INPUT = RES_K(10); // Input resistor of output stage opamp. + static constexpr const float OUTPUT_R_FEEDBACK = RES_K(10); + static constexpr const float OUTPUT_C_FEEDBACK = CAP_P(1000); + + static constexpr const float VPLUS = 15; // Volts. + static constexpr const float VCC = 5; // Volts. + static constexpr const float MUX_DAC_IREF = VPLUS / (RES_K(15) + RES_K(15)); // R55 + R57. + static constexpr const float TOM_DAC_IREF = MUX_DAC_IREF; // Configured in the same way. + + // The audio pipeline operates on voltage magnitudes. This scaler normalizes + // the final output's range to approximately: -1 - 1. + static constexpr const float VOLTAGE_TO_SOUND_SCALER = 0.2F; + + // These frequency ranges were eyeballed from figure 6 of the 74LS627 + // datasheet: https://www.ti.com/product/SN74LS628 . + static constexpr const std::array MUX_TIMER_HZ_RANGE = { 250'000, 2'330'000 }; // C14: 330pF. + static constexpr const std::array SNARE_TIMER_HZ_RANGE = { 8'000, 80'000 }; // C111: 0.01uF. + static constexpr const std::array TOM_TIMER_HZ_RANGE = { 8'000, 80'000 }; // C?: 0.01uF. + + // CV input impedance. The datasheet provides typical and max currents, + // given for 1V and 5V. These work out to 100K typical, and + // 20K minimum impedances. Using the advertised typical value. + static constexpr const float LS627_CV_INPUT_R = RES_K(100); + + static constexpr const char *MUX_VOICE_NAMES[NUM_MUX_VOICES] = + { + "TAMBOURINE", "CABASA", "CLAP", "COWBELL", "BASS", "HAT", "RIDE", "CRASH" + }; + static constexpr const char *TOM_VOICE_NAMES[NUM_TOM_VOICES] = + { + "LOW CONGA", "HI CONGA", "LOW TOMS", "MID TOMS", "HI TOMS" + }; + static constexpr const char *MIXER_CHANNEL_NAMES[NUM_MIXER_CHANNELS] = + { + "BASS", "SNARE", "SIDESTICK", "HIHAT", "HITOMS", "MIDTOMS", "LOTOMS", + "RIDE", "CRASH", "CABASA", "TAMB", "HICONGAS", "LOCONGAS", + "COWBELL", "CLAP", "CLICK" + }; +}; + +DEFINE_DEVICE_TYPE(LINNDRUM_AUDIO, linndrum_audio_device, "linndrum_audio_device", "LinnDrum audio circuits"); + +linndrum_audio_device::linndrum_audio_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : device_t(mconfig, LINNDRUM_AUDIO, tag, owner, clock) + , m_mux_tuning_trimmer(*this, ":pot_mux_tuning") + , m_mux_samples(*this, ":sample_mux_drum_%u", 0) + , m_mux_timer(*this, "mux_drum_timer") + , m_mux_dac(*this, "mux_drums_virtual_dac_%u", 1) + , m_mux_volume(*this, "mux_drums_volume_control_%u", 1) + , m_hat_vca(*this, "hat_vca") + , m_snare_samples(*this, ":sample_snare") + , m_sidestick_samples(*this, ":sample_sidestick") + , m_snare_timer(*this, "snare_sidestick_timer") + , m_snare_dac(*this, "snare_sidestick_dac") + , m_snare_volume(*this, "snare_sidestick_volume") + , m_snare_out(*this, "snare_output") + , m_sidestick_out(*this, "sidestick_output") + , m_click_timer(*this, "click_timer") + , m_click(*this, "click") + , m_beep(*this, "beep") + , m_tuning_knobs(*this, ":pot_tuning_%u", 1) + , m_tom_samples(*this, ":sample_tom") + , m_conga_samples(*this, ":sample_conga") + , m_tom_timer(*this, "tom_conga_timer") + , m_tom_dac(*this, "tom_conga_dac") + , m_tom_out(*this, "tom_conga_out_%u", 0) + , m_volume(*this, ":pot_gain_%u", 1) + , m_pan(*this, ":pot_pan_%u", 1) + , m_master_volume(*this, ":pot_volume") + , m_voice_hpf(*this, "voice_hpf_%u", 1) + , m_left_mixer(*this, "lmixer") + , m_right_mixer(*this, "rmixer") + , m_left_out(*this, "lspeaker") + , m_right_out(*this, "rspeaker") +{ +} + +void linndrum_audio_device::mux_drum_w(int voice, u8 data, bool is_strobe) +{ + assert(voice >= 0 && voice < NUM_MUX_VOICES); + + m_mux_counting[voice] = BIT(data, 0); + if (!m_mux_counting[voice]) + m_mux_counters[voice] = 0; + + // Volume variations are controlled by a CD4053 MUX (U90B), whose "select" + // input is connected to the active voice's D1 (via a 74LS151 encoder, U35). + // Depending on how the mux is configured, the audio signal will either + // remain unchanged, or it will get attenuated by a voltage divider. + // The MUX is always configured in the "no attenuation" mode for the clap + // and cowbell voices. + static constexpr const float ATTENUATION = RES_VOLTAGE_DIVIDER(RES_K(10), RES_K(3.3)); // R60, R62. + const bool attenuate = !BIT(data, 1) && voice != MV_CLAP && voice != MV_COWBELL; + m_mux_volume[voice]->set_gain(attenuate ? ATTENUATION : 1); + + if (voice == MV_HAT) + { + m_hat_vca->set_open(BIT(data, 2)); + if (is_strobe) + m_hat_vca->trigger(); + } + + LOGMASKED(LOG_STROBES, "Strobed mux drum %s: %02x (gain: %f)\n", + MUX_VOICE_NAMES[voice], data, m_mux_volume[voice]->gain()); +} + +void linndrum_audio_device::snare_w(u8 data) +{ + m_snare_counting = BIT(data, 0); + if (!m_snare_counting) + { + m_snare_counter = 0; + write_dac(*m_snare_dac, 0); // DAC is disabled. Output goes to 0. + } + + m_sidestick_selected = BIT(data, 1); // Play sidestick instead of snare. + if (m_sidestick_selected) + { + m_snare_out->set_gain(0); + m_sidestick_out->set_gain(1); + } + else + { + m_snare_out->set_gain(1); + m_sidestick_out->set_gain(0); + } + + // Snare and sidestick volume is set by controlling the reference current to + // the DAC. Bits D2 and D3 from the voice data bus (latched by U42, 74LS74) + // control the voltage at the end of R72 and R71. + + static constexpr const float R0 = RES_K(3.3); // R70. + static constexpr const float R1 = RES_K(380); // R69. + static constexpr const float R2 = RES_K(22); // R72. + static constexpr const float R3 = RES_K(5.6); // R71. + + static constexpr const float a = R0 * R2 * R3; + static constexpr const float b = R0 * R1 * R3; + static constexpr const float c = R0 * R1 * R2; + static constexpr const float d = R1 * R2 * R3; + + // Compute DAC reference current. + const float v2 = BIT(data, 2) ? VCC : 0; + const float v3 = BIT(data, 3) ? VCC : 0; + const float iref = (a * VPLUS + b * v2 + c * v3) / (R0 * (a + b + c + d)); + + const float gain = get_dac_scaler(iref); + m_snare_volume->set_gain(gain); + + LOGMASKED(LOG_STROBES, "Strobed snare / sidestick: %02x (iref: %f, gain: %f)\n", + data, iref, gain); +} + +void linndrum_audio_device::tom_w(u8 data) +{ + m_tom_counting = BIT(data, 0); + if (!m_tom_counting) + { + m_tom_counter = 0; + write_dac(*m_tom_dac, 0); // DAC is disabled. Output goes to 0. + } + + m_tom_selected = BIT(data, 1); // Play tom instead of conga. + // It is possible for neither the tom nor the conga ROM to be selected. This + // can only happen when the voice is disabled, so it does not affect the + // emulation. + + // Address for the pitch control MUX (U81) and output selection MUX (U87). + // Both are CD4051s. + const u8 variation = bitswap<3>(data, 1, 3, 2); // MUX: C, B, A. + + m_tom_selected_pitch = -1; + switch (variation) + { + case 0: m_tom_selected_pitch = TV_LOW_CONGA; break; + case 1: m_tom_selected_pitch = TV_HI_CONGA; break; + case 4: m_tom_selected_pitch = TV_LOW_TOMS; break; + case 5: m_tom_selected_pitch = TV_MID_TOMS; break; + case 6: m_tom_selected_pitch = TV_HI_TOMS; break; + default: LOG("Firmware bug: invalid pitch variation for tom/conga.\n"); + } + update_tom_pitch(); + + // If the tom/conga voice is disabled, The INH input of the output MUX (U87) + // will be high, and all outputs will be disconnected. That's in contrast to + // the pitch MUX (U81), which is always enabled. + // Disconnected outputs have their voltage pulled to 0 by a 10K resistor. + const s8 selected_output = m_tom_counting ? m_tom_selected_pitch : -1; + for (int i = 0; i < NUM_TOM_VOICES; ++i) + m_tom_out[i]->set_gain((i == selected_output) ? 1 : 0); + + LOGMASKED(LOG_STROBES, "Strobed tom / conga: %02x (is_tom: %d, pitch:%d, output: %d, %s)\n", + data, m_tom_selected, m_tom_selected_pitch, selected_output, + (selected_output >= 0) ? TOM_VOICE_NAMES[selected_output] : "none"); +} + +void linndrum_audio_device::strobe_click_w(u8 /*data*/) +{ + static constexpr const float R10 = RES_K(100); + static constexpr const float C12 = CAP_U(0.01); + m_click_timer->adjust(PERIOD_OF_555_MONOSTABLE(R10, C12)); + m_click->level_w(1); + LOGMASKED(LOG_STROBES, "Strobed click.\n"); +} + +void linndrum_audio_device::beep_w(int state) +{ + // Beep signal is inverted by U76B (74LS00). + m_beep->level_w(state ? 0 : 1); + LOGMASKED(LOG_STROBES, "Beep: %d\n", state); +} + +DECLARE_INPUT_CHANGED_MEMBER(linndrum_audio_device::mix_changed) +{ + update_volume_and_pan(param); +} + +DECLARE_INPUT_CHANGED_MEMBER(linndrum_audio_device::master_volume_changed) +{ + update_master_volume(); +} + +DECLARE_INPUT_CHANGED_MEMBER(linndrum_audio_device::mux_drum_tuning_changed) +{ + update_mux_drum_pitch(); +} + +DECLARE_INPUT_CHANGED_MEMBER(linndrum_audio_device::snare_tuning_changed) +{ + update_snare_pitch(); +} + +DECLARE_INPUT_CHANGED_MEMBER(linndrum_audio_device::tom_tuning_changed) +{ + update_tom_pitch(); +} + +void linndrum_audio_device::device_add_mconfig(machine_config &config) +{ + // *** Mux drums section. + + TIMER(config, m_mux_timer).configure_generic(FUNC(linndrum_audio_device::mux_timer_tick)); // 74LS627 (U77A). + + // The actual "mux drums" hardware has a single AM6070, which is + // time-multiplexed across the 8 voices. Implementing it that way is + // possible, but requires a sample rate of at least 240KHz (8 x ~30K) for + // reasonable results. It also requires emulating audio sample & hold + // functionality. So 8 "virtual" DACs and volume-control MUXes are used + // instead. + for (int voice = 0; voice < NUM_MUX_VOICES; ++voice) + { + DAC76(config, m_mux_dac[voice], 0); // AM6070 (U88). + FILTER_VOLUME(config, m_mux_volume[voice]); // CD4053 (U90), R60, R62 (see mux_drum_w()). + m_mux_dac[voice]->add_route(0, m_mux_volume[voice], get_dac_scaler(MUX_DAC_IREF)); + } + + LINNDRUM_HAT_VCA(config, m_hat_vca); + m_mux_volume[MV_HAT]->add_route(0, m_hat_vca, 1.0); + + // *** Snare / sidestick section. + + TIMER(config, m_snare_timer).configure_generic(FUNC(linndrum_audio_device::snare_timer_tick)); // 74LS627 (U80A). + DAC76(config, m_snare_dac, 0); // AM6070 (U92) + FILTER_VOLUME(config, m_snare_volume); // See snare_w(). + // DAC output scaling is incorporated in m_snare_volume's gain. + m_snare_dac->add_route(0, m_snare_volume, 1.0); + + // The DAC's current outputs are processed by a current-to-voltage converter + // that embeds an RC filter. This consists of an op-amp (U103), R127 and C65 + // (for positive voltages), and R126 and C31 (for negative voltages). The + // two resistors and capacitors have the same value. + auto &snare_dac_filter = FILTER_RC(config, "snare_sidestick_dac_filter"); + snare_dac_filter.set_lowpass(RES_K(2.49), CAP_P(2700)); // R127-C65, R126-C31. Cutoff: ~23.7KHz. + m_snare_volume->add_route(0, snare_dac_filter, 1.0); + + FILTER_VOLUME(config, m_snare_out); + FILTER_VOLUME(config, m_sidestick_out); + snare_dac_filter.add_route(0, m_snare_out, 1.0); + snare_dac_filter.add_route(0, m_sidestick_out, 1.0); + + TIMER(config, m_click_timer).configure_generic(FUNC(linndrum_audio_device::click_timer_tick)); // 556 (U65A). + static const double LEVELS[2] = { 0, VCC }; + SPEAKER_SOUND(config, m_click).set_levels(2, LEVELS); + SPEAKER_SOUND(config, m_beep).set_levels(2, LEVELS); + + // *** Tom / conga section. + + TIMER(config, m_tom_timer).configure_generic(FUNC(linndrum_audio_device::tom_timer_tick)); // 74LS627 (U77B). + DAC76(config, m_tom_dac, 0); // AM6070 (U82). + for (int i = 0; i < NUM_TOM_VOICES; ++i) + { + FILTER_VOLUME(config, m_tom_out[i]); // One of U87'S (CD4051) outputs. + m_tom_dac->add_route(0, m_tom_out[i], get_dac_scaler(TOM_DAC_IREF)); + } + + // *** Mixer. + + const std::array voice_outputs = + { + m_mux_volume[MV_BASS], + m_snare_out, + m_sidestick_out, + m_hat_vca, + m_tom_out[TV_HI_TOMS], + m_tom_out[TV_MID_TOMS], + m_tom_out[TV_LOW_TOMS], + m_mux_volume[MV_RIDE], + m_mux_volume[MV_CRASH], + m_mux_volume[MV_CABASA], + m_mux_volume[MV_TAMBOURINE], + m_tom_out[TV_HI_CONGA], + m_tom_out[TV_LOW_CONGA], + m_mux_volume[MV_COWBELL], + m_mux_volume[MV_CLAP], + m_click, + }; + + MIXER(config, m_left_mixer); // U1A + MIXER(config, m_right_mixer); // U1B + for (int i = 0; i < voice_outputs.size(); ++i) + { + // The filter and gain will be configured in update_volume_and_pan(). + FILTER_RC(config, m_voice_hpf[i]); + voice_outputs[i]->add_route(0, m_voice_hpf[i], 1.0); + m_voice_hpf[i]->add_route(0, m_left_mixer, 1.0); + m_voice_hpf[i]->add_route(0, m_right_mixer, 1.0); + } + + auto &beep_hpf = FILTER_RC(config, "beep_hpf"); + const float rc_r = RES_2_PARALLEL(MIXER_R_BEEP, MIXER_R_BEEP); + beep_hpf.set_rc(filter_rc_device::HIGHPASS, rc_r, 0, 0, CAP_U(0.1)); // C17. Cutoff: ~6.24 Hz. + m_beep->add_route(0, beep_hpf, 1.0); + // The mixers are inverting. + beep_hpf.add_route(0, m_left_mixer, -MIXER_R_FEEDBACK / MIXER_R_BEEP); + beep_hpf.add_route(0, m_right_mixer, -MIXER_R_FEEDBACK / MIXER_R_BEEP); + + // The left/right output op-amps (U2A, U2B) also have a capacitor in their + // feedback loop, which turns them into LPFs. + auto &left_rc = FILTER_RC(config, "left_output_lpf"); + auto &right_rc = FILTER_RC(config, "right_output_lpf"); + left_rc.set_lowpass(OUTPUT_R_FEEDBACK, OUTPUT_C_FEEDBACK); // Cutoff: ~15.9KHz. + right_rc.set_lowpass(OUTPUT_R_FEEDBACK, OUTPUT_C_FEEDBACK); + m_left_mixer->add_route(0, left_rc, 1.0); + m_right_mixer->add_route(0, right_rc, 1.0); + + SPEAKER(config, m_left_out).front_left(); + SPEAKER(config, m_right_out).front_right(); + // Gain will be set in update_master_volume(). + left_rc.add_route(0, m_left_out, 1.0); + right_rc.add_route(0, m_right_out, 1.0); +} + +void linndrum_audio_device::device_start() +{ + save_item(NAME(m_mux_counting)); + save_item(NAME(m_mux_counters)); + save_item(NAME(m_snare_counting)); + save_item(NAME(m_snare_counter)); + save_item(NAME(m_sidestick_selected)); + save_item(NAME(m_tom_counting)); + save_item(NAME(m_tom_counter)); + save_item(NAME(m_tom_selected)); + save_item(NAME(m_tom_selected_pitch)); +} + +void linndrum_audio_device::device_reset() +{ + for (int i = 0; i < NUM_MIXER_CHANNELS; ++i) + update_volume_and_pan(i); + update_master_volume(); + update_mux_drum_pitch(); + update_snare_pitch(); + update_tom_pitch(); +} + +void linndrum_audio_device::write_dac(dac76_device &dac, u8 sample) +{ + dac.update(); + dac.sb_w(BIT(sample, 7)); + dac.b1_w(BIT(sample, 6)); + dac.b2_w(BIT(sample, 5)); + dac.b3_w(BIT(sample, 4)); + dac.b4_w(BIT(sample, 3)); + dac.b5_w(BIT(sample, 2)); + dac.b6_w(BIT(sample, 1)); + dac.b7_w(BIT(sample, 0)); +} + +float linndrum_audio_device::get_dac_scaler(float iref) +{ + // Given the reference current into the DAC, computes the scaler that needs + // to be applied to the dac76_device output, to convert it to a voltage. + + // The maximum output current on each of the "+" and "-" outputs of the + // AM6070 is `3.8 * Iref`, according to the datasheet. + // That current gets converted to a voltage by an op-amp configured as + // a current-to-voltage converter (I2V). All I2Vs on the LinnDrum use + // 2.49K resistors for both the "+" and "-" current outputs of the DAC. + + return 3.8F * iref * float(RES_K(2.49)); +} + +s32 linndrum_audio_device::get_ls267_freq(const std::array& freq_range, float cv) +{ + // The relationship between CV and frequency is approximately linear. The + // frequency range is set by an external capacitor. + static constexpr const float MIN_CV = 0; + static constexpr const float MAX_CV = VCC; + const float alpha = (freq_range[1] - freq_range[0]) / (MAX_CV - MIN_CV); + return s32(roundf(freq_range[0] + alpha * cv)); +} + +float linndrum_audio_device::get_snare_tom_pitch_cv(float v_tune) +{ + // The tom/conga and snare tuning knobs are combined with resistors to + // produce a tuning voltage (v_tune). The tom/conga and snare networks are + // different. But v_tune for both is processed by identical circuits. + // Component designations below are for the snare circuit, but values are + // the same for the tom one. + + static constexpr const float R96 = RES_K(30); + static constexpr const float R97 = RES_K(47); + static constexpr const float R100 = RES_K(10); + static constexpr const float EXTERNAL_CV = 0; // External CV not yet emulated. + + // U95B (4558 opamp) mixes v_tune with external CV. v_tune is applied to + // the + input, while the (inverted and scaled) external CV is applied to + // the - input, via R97. + const float opamp_out = v_tune + (v_tune - EXTERNAL_CV) * R96 / R97; + + // The output is sent to the timer's CV input via a 10K resistor. That CV is + // loaded by the timer input's impedance. + const float cv = opamp_out * RES_VOLTAGE_DIVIDER(R100, LS627_CV_INPUT_R); + + // There are clamping diodes attached to the CV input. + return std::clamp(cv, 0, VCC); +} + +TIMER_DEVICE_CALLBACK_MEMBER(linndrum_audio_device::mux_timer_tick) +{ + // The timer on the actual hardware ticks 4 times per voice. A combination + // of counters, latches, decoders, encoders and analog multiplexers achieves + // the following: + // Tick 0: Selects next voice and enables DAC. + // - ROM address counter is incremented, if voice is enabled. + // If the counter reaches its max, the voice will be disabled and + // the counter will get cleared. + // - ROM is enabled, and outputs are written to the DAC. + // - Volume variation is configured (for voices that support it). + // - If the voice is not enabled, the ROM address will be 0, which + // according to the service manual always stores a 0. + // Tick 1: No-op. Waits for DAC to settle. + // Tick 2: Sample & Hold (S&H) for the selected voice is enabled. + // Tick 3: S&H is disabled. DAC is disabled, driving its output to 0. + + // The emulation here does all of the above, for all voices, in a single + // timer tick. The timer period has been adjusted accordingly. + + for (int voice = 0; voice < NUM_MUX_VOICES; ++voice) + { + if (m_mux_counting[voice]) + { + ++m_mux_counters[voice]; + if (m_mux_counters[voice] >= m_mux_samples[voice]->bytes()) + { + // All outputs in the voice's data latch (74LS74) are cleared. + mux_drum_w(voice, 0, false); + } + } + + const u8 sample = m_mux_samples[voice]->as_u8(m_mux_counters[voice]); + write_dac(*m_mux_dac[voice], sample); + } +} + +TIMER_DEVICE_CALLBACK_MEMBER(linndrum_audio_device::snare_timer_tick) +{ + if (!m_snare_counting) + return; + + ++m_snare_counter; + if (BIT(m_snare_counter, 12)) // Counter reached 0x1000 (4096). + { + // All outputs of U41 and U42 (74LS74 flip-flops) are cleared. + snare_w(0); + return; + } + + u8 sample = 0; + if (m_sidestick_selected) + sample = m_sidestick_samples->as_u8(m_snare_counter); + else + sample = m_snare_samples->as_u8(m_snare_counter); + write_dac(*m_snare_dac, sample); +} + +TIMER_DEVICE_CALLBACK_MEMBER(linndrum_audio_device::click_timer_tick) +{ + m_click->level_w(0); +} + +TIMER_DEVICE_CALLBACK_MEMBER(linndrum_audio_device::tom_timer_tick) +{ + if (!m_tom_counting) + return; + + ++m_tom_counter; + if (BIT(m_tom_counter, 13)) // Counter reached 0x2000 (8192). + { + // All outputs of U42B and U73B (74LS74 flip-flops) are cleared. + tom_w(0); + return; + } + + u8 sample = 0; + if (m_tom_selected) + sample = m_tom_samples->as_u8(m_tom_counter); + else + sample = m_conga_samples->as_u8(m_tom_counter); + write_dac(*m_tom_dac, sample); +} + +void linndrum_audio_device::update_volume_and_pan(int channel) +{ + assert(channel >= 0 && channel < NUM_MIXER_CHANNELS); + + static constexpr const float R_VOL_MAX = RES_K(5); + static constexpr const float R_PAN_MAX = RES_K(10); + static constexpr const float R1 = RES_K(5.6); + static constexpr const float R2 = RES_K(5.6); + static constexpr const float R3 = RES_K(15); + static constexpr const float R4 = RES_K(15); + + // Since we are interested in voltage gain, rather than actual voltage, + // use 1V as the voice's output. + static constexpr const float V_VOICE = 1; + // DC-blocking capacitor. Same value for all voice outputs. + static constexpr const float C_VOICE = CAP_U(10); + + const s32 volume = m_volume[channel]->read(); + const float r_vol_bottom = volume * R_VOL_MAX / 100.0F; + const float r_vol_top = R_VOL_MAX - r_vol_bottom; + const float r_pan_left = m_pan[channel]->read() * R_PAN_MAX / 100.0F; + const float r_pan_right = R_PAN_MAX - r_pan_left; + + const float r0 = MIXER_R_PRE_FADER[channel] + r_vol_top; + const float r_right_gnd = R1 + RES_2_PARALLEL(r_pan_right, R3); + const float r_left_gnd = R2 + RES_2_PARALLEL(r_pan_left, R4); + + // Resistance to ground as seen from the voice's output. + const float r_voice_gnd = r0 + RES_3_PARALLEL(r_vol_bottom, r_left_gnd, r_right_gnd); + + float gain_left = 0; + float gain_right = 0; + if (volume > 0) + { + // Calculate voltage scale factor at the wiper of the volume pot. + const float i0 = V_VOICE / r_voice_gnd; + const float v_pot = V_VOICE - i0 * r0; + + // Calculate voltage at the input resistor (R3) of the U1A summing + // op-amp, and use it to compute amp gain. + const float i1 = v_pot / r_right_gnd; + const float v_input_right = v_pot - i1 * R1; + gain_right = v_input_right * MIXER_R_FEEDBACK / R3; + + // Calculate voltage at the input resistor (R4) of the U1B summing + // op-amp, and use it to compute amp gain. + const float i2 = v_pot / r_left_gnd; + const float v_input_left = v_pot - i2 * R2; + gain_left = v_input_left * MIXER_R_FEEDBACK / R4; + } + + // Using -gain_*, because the summing op-amps are inverting. + m_left_mixer->set_input_gain(channel, -gain_left); + m_right_mixer->set_input_gain(channel, -gain_right); + m_voice_hpf[channel]->filter_rc_set_RC(filter_rc_device::HIGHPASS, r_voice_gnd, 0, 0, C_VOICE); + + LOGMASKED(LOG_MIX, "Gain update for %s - left: %f, right: %f, HPF cutoff: %.2f Hz\n", + MIXER_CHANNEL_NAMES[channel], gain_left, gain_right, + 1.0F / (2 * float(M_PI) * r_voice_gnd * C_VOICE)); +} + +void linndrum_audio_device::update_master_volume() +{ + static constexpr const float R_MASTER_VOLUME_MAX = RES_K(10); + + const float r_pot_bottom = m_master_volume->read() * R_MASTER_VOLUME_MAX / 100.0F; + const float r_pot_top = R_MASTER_VOLUME_MAX - r_pot_bottom; + const float v_input = RES_VOLTAGE_DIVIDER(r_pot_top, RES_2_PARALLEL(r_pot_bottom, OUTPUT_R_INPUT)); + + const float gain = v_input * OUTPUT_R_FEEDBACK / OUTPUT_R_INPUT; + const float final_gain = gain * VOLTAGE_TO_SOUND_SCALER; + + // Using -final_gain, because the output opamps (U2A, U2B) are inverting. + m_left_out->set_input_gain(0, -final_gain); + m_right_out->set_input_gain(0, -final_gain); + + LOGMASKED(LOG_MIX, "Master volume updated. Gain: %f, final gain: %f\n", gain, final_gain); +} + +void linndrum_audio_device::update_mux_drum_pitch() +{ + static constexpr const int TIMER_TICKS_PER_VOICE = 4; + static constexpr const float POT_MAX = RES_K(10); + static constexpr const float R19A = RES_K(18); + + const float pot_bottom = m_mux_tuning_trimmer->read() * POT_MAX / 100.0F; + const float pot_top = POT_MAX - pot_bottom; + const float cv = VPLUS * RES_VOLTAGE_DIVIDER(R19A + pot_top, RES_2_PARALLEL(pot_bottom, LS627_CV_INPUT_R)); + const s32 freq = get_ls267_freq(MUX_TIMER_HZ_RANGE, cv); + + // See comments in mux_timer_tick() for the reason for this adjustment. + const s32 adjusted_freq = float(freq) / (NUM_MUX_VOICES * TIMER_TICKS_PER_VOICE); + const attotime period = attotime::from_hz(s32(roundf(adjusted_freq))); + m_mux_timer->adjust(period, 0, period); + + LOGMASKED(LOG_PITCH, "Updated mux drum pitch. CV: %f, freq: %d, adjusted: %d\n", + cv, freq, adjusted_freq); +} + +void linndrum_audio_device::update_snare_pitch() +{ + static constexpr const float POT_MAX = RES_K(100); + static constexpr const float R101 = RES_K(75); + static constexpr const float R98 = RES_K(22); + + const float pot_bottom = m_tuning_knobs[TK_SNARE]->read() * POT_MAX / 100.0F; + const float pot_top = POT_MAX - pot_bottom; + const float v_pot = VPLUS * RES_VOLTAGE_DIVIDER(pot_top, RES_2_PARALLEL(pot_bottom, R101 + R98)); + const float cv = get_snare_tom_pitch_cv(v_pot * RES_VOLTAGE_DIVIDER(R101, R98)); + + const s32 freq = get_ls267_freq(SNARE_TIMER_HZ_RANGE, cv); + const attotime period = attotime::from_hz(freq); + m_snare_timer->adjust(period, 0, period); + + LOGMASKED(LOG_PITCH, "Updated snare pitch. CV: %f, freq: %d Hz\n", cv, freq); +} + +void linndrum_audio_device::update_tom_pitch() +{ + static constexpr const float R_POT_MAX = RES_K(100); + + // A map from `enum tom_voices` to `enum tuning_knobs`. + static constexpr const int VOICE_TO_KNOB_MAP[NUM_TOM_VOICES] = + { + TK_LO_CONGAS, + TK_HI_CONGAS, + TK_LO_TOMS, + TK_MID_TOMS, + TK_HI_TOMS + }; + + if (m_tom_selected_pitch < 0) + { + LOG("Firmware or driver bug: floating input to pitch CV op-amp.\n"); + return; + } + + // The pitch CV for each variation appears on an input of MUX U81 (CD4051). + // The CV of the currently selected variation is routed to the timer (74LS627, U77B). + // Compute the CV of the selected variation. + const int knob_index = VOICE_TO_KNOB_MAP[m_tom_selected_pitch]; + const s32 knob_value = m_tuning_knobs[knob_index]->read(); + const float r_pot_bottom = knob_value * R_POT_MAX / 100.0F; + const float r_pot_top = R_POT_MAX - r_pot_bottom; + const float v_mux_out = VPLUS * RES_VOLTAGE_DIVIDER(RES_K(390) + r_pot_top, r_pot_bottom); + const float cv = get_snare_tom_pitch_cv(v_mux_out); + + const s32 freq = get_ls267_freq(SNARE_TIMER_HZ_RANGE, cv); + const attotime period = attotime::from_hz(freq); + + // Only restart the timer if there is a change. Many calls to this function + // will not result in a frequency change. + if (m_tom_timer->period() != period) + m_tom_timer->adjust(period, 0, period); + + LOGMASKED(LOG_PITCH, "Updated tom pitch: %d, %d. CV: %f, freq: %d\n", + knob_index, knob_value, cv, freq); +} + +namespace { + constexpr const char MAINCPU_TAG[] = "z80"; constexpr const char NVRAM_TAG[] = "nvram"; +constexpr const char AUDIO_TAG[] = "linndrum_audio"; class linndrum_state : public driver_device { public: + static constexpr feature_type unemulated_features() { return feature::TAPE; } + linndrum_state(const machine_config &mconfig, device_type type, const char *tag) ATTR_COLD : driver_device(mconfig, type, tag) , m_maincpu(*this, MAINCPU_TAG) + , m_audio(*this, AUDIO_TAG) , m_tempo_timer(*this, "tempo_timer_556_u30a") , m_debounce_timer(*this, "debounce_timer_556_u30b") , m_keyboard(*this, "keyboard_col_%d", 0) @@ -99,7 +1160,7 @@ class linndrum_state : public driver_device private: u8 keyboard_r(offs_t offset); u8 inport_r(); - template void display_w(u8 data); + template void display_w(u8 data); u8 start_debounce_r(); void start_debounce_w(u8 data); @@ -108,16 +1169,17 @@ class linndrum_state : public driver_device void update_tempo_timer(); TIMER_DEVICE_CALLBACK_MEMBER(tempo_timer_tick); - void trigger_w(offs_t offset, u8 data); - void trigger_beep_w(int state); - void data_out_enable_w(int state); void tape_sync_enable_w(int state); void update_tape_sync_out(); + void voice_data_enable_w(int state); + u8 get_voice_data(u8 data) const; + void memory_map(address_map &map) ATTR_COLD; void io_map(address_map &map) ATTR_COLD; required_device m_maincpu; + required_device m_audio; required_device m_tempo_timer; // 556, U30A. required_device m_debounce_timer; // 556, U30B. required_ioport_array<6> m_keyboard; @@ -131,14 +1193,7 @@ class linndrum_state : public driver_device bool m_debouncing = false; bool m_tempo_state = false; bool m_tape_sync_enabled = false; - bool m_data_out_enabled = false; - - static constexpr const int NUM_VOICE_TRIGGERS = 11; - static constexpr const char *VOICE_TRIGGER_NAMES[NUM_VOICE_TRIGGERS] = - { - "BASS", "SNARE", "HI-HAT", "TOM / CGA", "RIDE", "CRASH", "CABASA", - "TAMB", "COWBELL", "CLAP", "CLICK" - }; + bool m_voice_data_enabled = false; // Enables/disables U19 (74LS365). static constexpr const int DISPLAY_STEP = 0; static constexpr const int DISPLAY_PATTERN = 1; @@ -190,7 +1245,7 @@ u8 linndrum_state::inport_r() return (triggers << 3) | (d2 << 2) | (d1 << 1) | d0; } -template void linndrum_state::display_w(u8 data) +template void linndrum_state::display_w(u8 data) { static constexpr const u8 PATTERNS[16] = // 4 x 74LS47 (U24-U27). { @@ -201,8 +1256,8 @@ template void linndrum_state::display_w(u8 data) const u8 ms_digit = PATTERNS[(data >> 4) & 0x0f]; const u8 ls_digit = PATTERNS[data & 0x0f]; - static_assert(DISPLAY == DISPLAY_STEP || DISPLAY == DISPLAY_PATTERN); - if (DISPLAY == DISPLAY_STEP) + static_assert(Display == DISPLAY_STEP || Display == DISPLAY_PATTERN); + if (Display == DISPLAY_STEP) { m_step_display[0] = ms_digit; m_step_display[1] = ls_digit; @@ -247,7 +1302,7 @@ void linndrum_state::update_tempo_timer() // Using `100 - pot value` because the higher (the more clockwise) the pot // is turned, the lower the resistance and the fastest the tempo. - const float tempo_r = (100 - m_tempo_pot->read()) * P1_MAX / 100.0f; + const float tempo_r = (100 - m_tempo_pot->read()) * P1_MAX / 100.0F; const attotime period = PERIOD_OF_555_ASTABLE(R1, R2 + tempo_r, C2); m_tempo_timer->adjust(period, 0, period); LOGMASKED(LOG_TEMPO_CHANGE, "Tempo adjusted: %f\n", period.as_double()); @@ -263,30 +1318,6 @@ TIMER_DEVICE_CALLBACK_MEMBER(linndrum_state::tempo_timer_tick) LOGMASKED(LOG_TEMPO, "Tempo timer elapsed: %d\n", m_tempo_state); } -void linndrum_state::trigger_w(offs_t offset, u8 data) -{ - assert(offset >= 0 && offset < NUM_VOICE_TRIGGERS); - LOGMASKED(LOG_TRIGGERS, "Trigger %s (%02x), data: %02x, data enabled: %d\n", - VOICE_TRIGGER_NAMES[offset], offset, data, m_data_out_enabled); - // TODO: Implement. -} - -void linndrum_state::trigger_beep_w(int state) -{ - LOGMASKED(LOG_TRIGGERS, "Trigger BEEP: %d, data enabled: %d\n", - state, m_data_out_enabled); - // TODO: Implement. -} - -void linndrum_state::data_out_enable_w(int state) -{ - // Controls whether data (D0-D3) is transmitted to the voice circuits. This - // is done by U19 (74LS365 hex buffer. Enable inputs are active-low). - // This is usually disabled to prevent interference from the "noisy" data - // bus to the voice circuits. - m_data_out_enabled = !state; -} - void linndrum_state::tape_sync_enable_w(int state) { LOGMASKED(LOG_TAPE_SYNC_ENABLE, "Tape sync enable: %d\n", state); @@ -304,6 +1335,28 @@ void linndrum_state::update_tape_sync_out() m_tape_sync_out = 0; } +void linndrum_state::voice_data_enable_w(int state) +{ + // Controls whether data (D0-D3) is transmitted to the voice circuits. This + // is done by U19 (74LS365 hex buffer. Enable inputs are active-low). + // This is usually disabled to prevent interference from the "noisy" data + // bus to the voice circuits. + m_voice_data_enabled = !state; +} + +u8 linndrum_state::get_voice_data(u8 data) const +{ + if (m_voice_data_enabled) + { + return data & 0x0f; // Voice data bus is 4 bits wide. + } + else + { + LOG("Firmware bug: floating voice data bus when strobing a voice.\n"); + return 0x0f; // Floating TTL inputs. Will likely resolve to 1s. + } +} + void linndrum_state::memory_map(address_map &map) { // Signal names (such as "/READ INPORT") are taken from the schematics. @@ -321,7 +1374,19 @@ void linndrum_state::memory_map(address_map &map) map(0x1f82, 0x1f82).mirror(0x0030).w("latch_u18", FUNC(output_latch_device::write)); // LEDs. map(0x1f83, 0x1f83).mirror(0x0030).w("latch_u17", FUNC(output_latch_device::write)); // LEDs. map(0x1f84, 0x1f84).mirror(0x0030).w("latch_u16", FUNC(output_latch_device::write)); // LEDs & outputs. - map(0x1f85, 0x1f8f).mirror(0x0030).w(FUNC(linndrum_state::trigger_w)); // Data out. + + // Voice strobes. + map(0x1f85, 0x1f85).mirror(0x0030).lw8(NAME([this] (u8 data) { m_audio->mux_drum_w(MV_BASS, get_voice_data(data)); })); + map(0x1f86, 0x1f86).mirror(0x0030).lw8(NAME([this] (u8 data) { m_audio->snare_w(get_voice_data(data)); })); + map(0x1f87, 0x1f87).mirror(0x0030).lw8(NAME([this] (u8 data) { m_audio->mux_drum_w(MV_HAT, get_voice_data(data)); })); + map(0x1f88, 0x1f88).mirror(0x0030).lw8(NAME([this] (u8 data) { m_audio->tom_w(get_voice_data(data)); })); + map(0x1f89, 0x1f89).mirror(0x0030).lw8(NAME([this] (u8 data) { m_audio->mux_drum_w(MV_RIDE, get_voice_data(data)); })); + map(0x1f8a, 0x1f8a).mirror(0x0030).lw8(NAME([this] (u8 data) { m_audio->mux_drum_w(MV_CRASH, get_voice_data(data)); })); + map(0x1f8b, 0x1f8b).mirror(0x0030).lw8(NAME([this] (u8 data) { m_audio->mux_drum_w(MV_CABASA, get_voice_data(data)); })); + map(0x1f8c, 0x1f8c).mirror(0x0030).lw8(NAME([this] (u8 data) { m_audio->mux_drum_w(MV_TAMBOURINE, get_voice_data(data)); })); + map(0x1f8d, 0x1f8d).mirror(0x0030).lw8(NAME([this] (u8 data) { m_audio->mux_drum_w(MV_COWBELL, get_voice_data(data)); })); + map(0x1f8e, 0x1f8e).mirror(0x0030).lw8(NAME([this] (u8 data) { m_audio->mux_drum_w(MV_CLAP, get_voice_data(data)); })); + map(0x1f8f, 0x1f8f).mirror(0x0030).w(m_audio, FUNC(linndrum_audio_device::strobe_click_w)); // No voice data sent. map(0x1fc0, 0x1fff).r(FUNC(linndrum_state::keyboard_r)); // /READ KEYBD. map(0x2000, 0x3fff).ram().share(NVRAM_TAG); // 4 x HM6116LP4. U12-U9. @@ -346,7 +1411,7 @@ void linndrum_state::machine_start() save_item(NAME(m_debouncing)); save_item(NAME(m_tempo_state)); save_item(NAME(m_tape_sync_enabled)); - save_item(NAME(m_data_out_enabled)); + save_item(NAME(m_voice_data_enabled)); } void linndrum_state::machine_reset() @@ -368,6 +1433,10 @@ void linndrum_state::linndrum(machine_config &config) TIMER(config, m_debounce_timer).configure_generic( // 556, U30B. FUNC(linndrum_state::debounce_timer_elapsed)); + LINNDRUM_AUDIO(config, m_audio); + + config.set_default_layout(layout_linn_linndrum); + // Latches connected to cathodes of LEDs (through resistors), so they are // active-low. @@ -396,8 +1465,8 @@ void linndrum_state::linndrum(machine_config &config) u16.bit_handler<1>().set_output("led_ext_sync").invert(); u16.bit_handler<2>().set_output("led_pattern").invert(); u16.bit_handler<2>().append_output("led_song"); // Inverted by U31A. - u16.bit_handler<3>().set(FUNC(linndrum_state::data_out_enable_w)); - u16.bit_handler<4>().set(FUNC(linndrum_state::trigger_beep_w)); + u16.bit_handler<3>().set(FUNC(linndrum_state::voice_data_enable_w)); + u16.bit_handler<4>().set(m_audio, FUNC(linndrum_audio_device::beep_w)); u16.bit_handler<5>().set(FUNC(linndrum_state::tape_sync_enable_w)); // Output voltage divided by R24/R25 to 0V - 2.5V. u16.bit_handler<6>().set_output("output_cassette"); @@ -413,51 +1482,51 @@ DECLARE_INPUT_CHANGED_MEMBER(linndrum_state::tempo_pot_adjusted) // PORT_NAMEs are based on the annotations in the schematic. INPUT_PORTS_START(linndrum) PORT_START("keyboard_col_0") - PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("1") - PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("2") - PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("3") - PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("4") - PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("5") - PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("6") + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("1") PORT_CODE(KEYCODE_1) + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("2") PORT_CODE(KEYCODE_2) + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("3") PORT_CODE(KEYCODE_3) + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("4") PORT_CODE(KEYCODE_4) + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("5") PORT_CODE(KEYCODE_5) + PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("6") PORT_CODE(KEYCODE_6) PORT_START("keyboard_col_1") - PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("7") - PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("SONG/PAT.") - PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("SONG#") - PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("END") - PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("DELETE") - PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("INSERT") + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("7") PORT_CODE(KEYCODE_7) + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("SONG/PAT.") PORT_CODE(KEYCODE_Q) + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("SONG#") PORT_CODE(KEYCODE_W) + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("END") PORT_CODE(KEYCODE_E) + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("DELETE") PORT_CODE(KEYCODE_R) + PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("INSERT") PORT_CODE(KEYCODE_T) PORT_START("keyboard_col_2") - PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("<-") - PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("->") - PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("ENTER") + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("<-") PORT_CODE(KEYCODE_Y) + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("->") PORT_CODE(KEYCODE_U) + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("ENTER") PORT_CODE(KEYCODE_I) PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("STORE") PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("LOAD") - PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("EXT.SYNC") PORT_CODE(KEYCODE_S) + PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("EXT.SYNC") PORT_CODE(KEYCODE_L) PORT_START("keyboard_col_3") - PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("BPM/TRIG.") - PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("SIDESTICK") - PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("SNARE 1") PORT_CODE(KEYCODE_N) - PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("SNARE 2") - PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("SNARE 3") + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("BPM/TRIG.") PORT_CODE(KEYCODE_O) + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("SIDESTICK") PORT_CODE(KEYCODE_Z) + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("SNARE 1") PORT_CODE(KEYCODE_X) + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("SNARE 2") PORT_CODE(KEYCODE_C) + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("SNARE 3") PORT_CODE(KEYCODE_V) PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("BASS 1") PORT_CODE(KEYCODE_B) PORT_START("keyboard_col_4") - PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("BASS 2") - PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("CRASH") - PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("PERC.") PORT_CODE(KEYCODE_P) - PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("CABASA1 / HIHAT1") - PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("CABASA2 / HIHAT2") - PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("TAMP 1 / HIHAT O") + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("BASS 2") PORT_CODE(KEYCODE_N) + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("CRASH") PORT_CODE(KEYCODE_M) + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("PERC.") PORT_CODE(KEYCODE_COMMA) + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("CABASA1 / HIHAT1") PORT_CODE(KEYCODE_A) + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("CABASA2 / HIHAT2") PORT_CODE(KEYCODE_S) + PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("TAMP 1 / HIHAT O") PORT_CODE(KEYCODE_D) PORT_START("keyboard_col_5") - PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("TAMP 2 / HI TOM") - PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("HI CONGA / MID TOM") PORT_CODE(KEYCODE_T) - PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("LO CONGA / LO TOM") - PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("COWBELL / RIDE 1") - PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("CLAPS / RIDE 2") PORT_CODE(KEYCODE_L) + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("TAMP 2 / HI TOM") PORT_CODE(KEYCODE_F) + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("HI CONGA / MID TOM") PORT_CODE(KEYCODE_G) + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("LO CONGA / LO TOM") PORT_CODE(KEYCODE_H) + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("COWBELL / RIDE 1") PORT_CODE(KEYCODE_J) + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("CLAPS / RIDE 2") PORT_CODE(KEYCODE_K) PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_UNUSED) // The play-stop button and footswitch input are both connected together @@ -480,16 +1549,163 @@ INPUT_PORTS_START(linndrum) PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("TRIGGER 1") PORT_START("pot_tempo") - PORT_ADJUSTER(50, "TEMPO") - PORT_CHANGED_MEMBER(DEVICE_SELF, FUNC(linndrum_state::tempo_pot_adjusted), 0) + PORT_ADJUSTER(80, "TEMPO") PORT_CHANGED_MEMBER(DEVICE_SELF, FUNC(linndrum_state::tempo_pot_adjusted), 0) + + PORT_START("pot_volume") + PORT_ADJUSTER(90, "MASTER VOLUME") PORT_CHANGED_MEMBER(AUDIO_TAG, FUNC(linndrum_audio_device::master_volume_changed), 0) + + PORT_START("pot_mux_tuning") // Internal trimmer. Not accessible by the end-user. + PORT_ADJUSTER(25, "TRIMMER: MUX DRUM TUNING") PORT_CHANGED_MEMBER(AUDIO_TAG, FUNC(linndrum_audio_device::mux_drum_tuning_changed), 0) + + PORT_START("pot_tuning_1") + PORT_ADJUSTER(25, "SNARE TUNING") PORT_CHANGED_MEMBER(AUDIO_TAG, FUNC(linndrum_audio_device::snare_tuning_changed), 0) + PORT_START("pot_tuning_2") + PORT_ADJUSTER(60, "HI TOM TUNING") PORT_CHANGED_MEMBER(AUDIO_TAG, FUNC(linndrum_audio_device::tom_tuning_changed), 0) + PORT_START("pot_tuning_3") + PORT_ADJUSTER(50, "MID TOM TUNING") PORT_CHANGED_MEMBER(AUDIO_TAG, FUNC(linndrum_audio_device::tom_tuning_changed), 0) + PORT_START("pot_tuning_4") + PORT_ADJUSTER(40, "LO TOM TUNING") PORT_CHANGED_MEMBER(AUDIO_TAG, FUNC(linndrum_audio_device::tom_tuning_changed), 0) + PORT_START("pot_tuning_5") + PORT_ADJUSTER(52, "HI CONGAS TUNING") PORT_CHANGED_MEMBER(AUDIO_TAG, FUNC(linndrum_audio_device::tom_tuning_changed), 0) + PORT_START("pot_tuning_6") + PORT_ADJUSTER(40, "LO CONGAS TUNING") PORT_CHANGED_MEMBER(AUDIO_TAG, FUNC(linndrum_audio_device::tom_tuning_changed), 0) + PORT_START("pot_tuning_7") + PORT_ADJUSTER(50, "HIHAT DECAY") + + PORT_START("pot_pan_1") + PORT_ADJUSTER(50, "BASS PAN") PORT_CHANGED_MEMBER(AUDIO_TAG, FUNC(linndrum_audio_device::mix_changed), MIX_BASS) + PORT_START("pot_pan_2") + PORT_ADJUSTER(50, "SNARE PAN") PORT_CHANGED_MEMBER(AUDIO_TAG, FUNC(linndrum_audio_device::mix_changed), MIX_SNARE) + PORT_START("pot_pan_3") + PORT_ADJUSTER(50, "SIDESTICK PAN") PORT_CHANGED_MEMBER(AUDIO_TAG, FUNC(linndrum_audio_device::mix_changed), MIX_SIDESTICK) + PORT_START("pot_pan_4") + PORT_ADJUSTER(50, "HIHAT PAN") PORT_CHANGED_MEMBER(AUDIO_TAG, FUNC(linndrum_audio_device::mix_changed), MIX_HIHAT) + PORT_START("pot_pan_5") + PORT_ADJUSTER(50, "HI TOM PAN") PORT_CHANGED_MEMBER(AUDIO_TAG, FUNC(linndrum_audio_device::mix_changed), MIX_HITOMS) + PORT_START("pot_pan_6") + PORT_ADJUSTER(50, "MID TOM PAN") PORT_CHANGED_MEMBER(AUDIO_TAG, FUNC(linndrum_audio_device::mix_changed), MIX_MIDTOMS) + PORT_START("pot_pan_7") + PORT_ADJUSTER(50, "LO TOM PAN") PORT_CHANGED_MEMBER(AUDIO_TAG, FUNC(linndrum_audio_device::mix_changed), MIX_LOTOMS) + PORT_START("pot_pan_8") + PORT_ADJUSTER(50, "RIDE PAN") PORT_CHANGED_MEMBER(AUDIO_TAG, FUNC(linndrum_audio_device::mix_changed), MIX_RIDE) + PORT_START("pot_pan_9") + PORT_ADJUSTER(50, "CRASH PAN") PORT_CHANGED_MEMBER(AUDIO_TAG, FUNC(linndrum_audio_device::mix_changed), MIX_CRASH) + PORT_START("pot_pan_10") + PORT_ADJUSTER(50, "CABASA PAN") PORT_CHANGED_MEMBER(AUDIO_TAG, FUNC(linndrum_audio_device::mix_changed), MIX_CABASA) + PORT_START("pot_pan_11") + PORT_ADJUSTER(50, "TAMB PAN") PORT_CHANGED_MEMBER(AUDIO_TAG, FUNC(linndrum_audio_device::mix_changed), MIX_TAMB) + PORT_START("pot_pan_12") + PORT_ADJUSTER(50, "HI CONGA PAN") PORT_CHANGED_MEMBER(AUDIO_TAG, FUNC(linndrum_audio_device::mix_changed), MIX_HICONGAS) + PORT_START("pot_pan_13") + PORT_ADJUSTER(50, "LO CONGA PAN") PORT_CHANGED_MEMBER(AUDIO_TAG, FUNC(linndrum_audio_device::mix_changed), MIX_LOCONGAS) + PORT_START("pot_pan_14") + PORT_ADJUSTER(50, "COWBELL PAN") PORT_CHANGED_MEMBER(AUDIO_TAG, FUNC(linndrum_audio_device::mix_changed), MIX_COWBELL) + PORT_START("pot_pan_15") + PORT_ADJUSTER(50, "CLAPS PAN") PORT_CHANGED_MEMBER(AUDIO_TAG, FUNC(linndrum_audio_device::mix_changed), MIX_CLAPS) + PORT_START("pot_pan_16") + PORT_ADJUSTER(50, "CLICK PAN") PORT_CHANGED_MEMBER(AUDIO_TAG, FUNC(linndrum_audio_device::mix_changed), MIX_CLICK) + + PORT_START("pot_gain_1") + PORT_ADJUSTER(100, "BASS GAIN") PORT_CHANGED_MEMBER(AUDIO_TAG, FUNC(linndrum_audio_device::mix_changed), MIX_BASS) + PORT_START("pot_gain_2") + PORT_ADJUSTER(100, "SNARE GAIN") PORT_CHANGED_MEMBER(AUDIO_TAG, FUNC(linndrum_audio_device::mix_changed), MIX_SNARE) + PORT_START("pot_gain_3") + PORT_ADJUSTER(100, "SIDESTICK GAIN") PORT_CHANGED_MEMBER(AUDIO_TAG, FUNC(linndrum_audio_device::mix_changed), MIX_SIDESTICK) + PORT_START("pot_gain_4") + PORT_ADJUSTER(100, "HIHAT GAIN") PORT_CHANGED_MEMBER(AUDIO_TAG, FUNC(linndrum_audio_device::mix_changed), MIX_HIHAT) + PORT_START("pot_gain_5") + PORT_ADJUSTER(100, "HI TOM GAIN") PORT_CHANGED_MEMBER(AUDIO_TAG, FUNC(linndrum_audio_device::mix_changed), MIX_HITOMS) + PORT_START("pot_gain_6") + PORT_ADJUSTER(100, "MID TOM GAIN") PORT_CHANGED_MEMBER(AUDIO_TAG, FUNC(linndrum_audio_device::mix_changed), MIX_MIDTOMS) + PORT_START("pot_gain_7") + PORT_ADJUSTER(100, "LO TOM GAIN") PORT_CHANGED_MEMBER(AUDIO_TAG, FUNC(linndrum_audio_device::mix_changed), MIX_LOTOMS) + PORT_START("pot_gain_8") + PORT_ADJUSTER(100, "RIDE GAIN") PORT_CHANGED_MEMBER(AUDIO_TAG, FUNC(linndrum_audio_device::mix_changed), MIX_RIDE) + PORT_START("pot_gain_9") + PORT_ADJUSTER(100, "CRASH GAIN") PORT_CHANGED_MEMBER(AUDIO_TAG, FUNC(linndrum_audio_device::mix_changed), MIX_CRASH) + PORT_START("pot_gain_10") + PORT_ADJUSTER(100, "CABASA GAIN") PORT_CHANGED_MEMBER(AUDIO_TAG, FUNC(linndrum_audio_device::mix_changed), MIX_CABASA) + PORT_START("pot_gain_11") + PORT_ADJUSTER(100, "TAMB GAIN") PORT_CHANGED_MEMBER(AUDIO_TAG, FUNC(linndrum_audio_device::mix_changed), MIX_TAMB) + PORT_START("pot_gain_12") + PORT_ADJUSTER(100, "HI CONGA GAIN") PORT_CHANGED_MEMBER(AUDIO_TAG, FUNC(linndrum_audio_device::mix_changed), MIX_HICONGAS) + PORT_START("pot_gain_13") + PORT_ADJUSTER(100, "LO CONGA GAIN") PORT_CHANGED_MEMBER(AUDIO_TAG, FUNC(linndrum_audio_device::mix_changed), MIX_LOCONGAS) + PORT_START("pot_gain_14") + PORT_ADJUSTER(100, "COWBELL GAIN") PORT_CHANGED_MEMBER(AUDIO_TAG, FUNC(linndrum_audio_device::mix_changed), MIX_COWBELL) + PORT_START("pot_gain_15") + PORT_ADJUSTER(100, "CLAPS GAIN") PORT_CHANGED_MEMBER(AUDIO_TAG, FUNC(linndrum_audio_device::mix_changed), MIX_CLAPS) + PORT_START("pot_gain_16") + PORT_ADJUSTER(100, "CLICK GAIN") PORT_CHANGED_MEMBER(AUDIO_TAG, FUNC(linndrum_audio_device::mix_changed), MIX_CLICK) INPUT_PORTS_END ROM_START(linndrum) ROM_REGION(0x2000, MAINCPU_TAG, 0) ROM_LOAD("ld_2.1_a.u14", 0x000000, 0x001000, CRC(566d720e) SHA1(91b7a515e3d18a28b7f5428765ed79114a5a00fb)) ROM_LOAD("ld_2.1_b.u13", 0x001000, 0x001000, CRC(9c9a5520) SHA1(6e4573051254051c75f9071fd8dfcd5a9184f9cc)) + + // All sample ROMs are 2732. + // ROM file name format: sticker_label.silscreen_label.component_designation + + ROM_REGION(0x1000, "sample_mux_drum_0", 0) // Tambourine. + ROM_LOAD("tamb1.tamb.u25", 0x000000, 0x001000, CRC(0309eba3) SHA1(89a1910b5224a1db91c31100cfe81ebd36610027)) + + ROM_REGION(0x1000, "sample_mux_drum_1", 0) // Cabasa. + ROM_LOAD("cbsa.u26", 0x000000, 0x001000, NO_DUMP) + ROM_FILL(0x000000, 0x001000, 0x00) // Silence. Remove if checksum becomes available. + + ROM_REGION(0x1000, "sample_mux_drum_2", 0) // Claps. + ROM_LOAD("clps.u27", 0x000000, 0x001000, NO_DUMP) + ROM_FILL(0x000000, 0x001000, 0x00) // Silence. Remove if checksum becomes available. + + ROM_REGION(0x1000, "sample_mux_drum_3", 0) // Cowbell. + ROM_LOAD("cwbl1.cwbl.u28", 0x000000, 0x001000, CRC(819d4a2c) SHA1(04d6fb88dd8751336617e50ce840fa63e6002942)) + + ROM_REGION(0x1000, "sample_mux_drum_4", 0) // Bass. + ROM_LOAD("bass.u29", 0x000000, 0x001000, NO_DUMP) + ROM_FILL(0x000000, 0x001000, 0x00) // Silence. Remove if checksum becomes available. + + ROM_REGION(0x4000, "sample_mux_drum_5", 0) // Hi hat. + ROM_LOAD("hat1a.hat1.u30", 0x000000, 0x001000, CRC(20b35416) SHA1(9aed28369b9b3f4a088c3f2ee9c88ed4b029a3ae)) + ROM_LOAD("hat1b.hat2.u31", 0x001000, 0x001000, CRC(fb4b3bac) SHA1(99a6cada1e741a7294b9aa08df36489644253acb)) + ROM_LOAD("hat1c.hat3.u32", 0x002000, 0x001000, CRC(62d1e667) SHA1(516df46a6e1050151f4b1696568a4ffbde0eba7c)) + ROM_LOAD("hat1d.hat4.u33", 0x003000, 0x001000, CRC(01819ab1) SHA1(b0cfece5568375340eab16f8523ddb8599013310)) + + ROM_REGION(0x8000, "sample_mux_drum_6", 0) // Ride cymbal. + ROM_LOAD("ride1a.rid1.u9", 0x000000, 0x001000, CRC(3d0a852f) SHA1(58ea6cda2ad1a8b6506ad89ba3f5c47584013ef0)) + ROM_LOAD("ride1b.rid2.u10", 0x001000, 0x001000, CRC(5bb0e082) SHA1(6f4535d08ac013d804cc2d9fd9fedca2b8515c99)) + ROM_LOAD("ride1c.rid3.u8", 0x002000, 0x001000, CRC(fa48f0e3) SHA1(a455b6d8d8dde9a7903919c87263b392f0510c8a)) + ROM_LOAD("ride1d.rid4.u7", 0x003000, 0x001000, CRC(3a8b4133) SHA1(f0a2f7a0db1024e7e263000f74d127f53bf6df94)) + ROM_LOAD("ride1e.rid5.u6", 0x004000, 0x001000, CRC(e30dc9a2) SHA1(933d2fa23a371831e779315f61e9a8f281ffab7c)) + ROM_LOAD("ride1f.rid6.u5", 0x005000, 0x001000, CRC(ba63cc66) SHA1(ba4f2fd13d89c37eab30301b96338c6a9a69ad9d)) + ROM_LOAD("ride1g.rid7.u4", 0x006000, 0x001000, CRC(d5e24b3e) SHA1(fba0fa24e8afd7686b480ace1838587fe2a6691c)) + ROM_LOAD("ride1h.rid8.u3", 0x007000, 0x001000, CRC(4ac922bb) SHA1(f86b3fbd079ef59b5e260250b95ec75829a1c31d)) + + ROM_REGION(0x8000, "sample_mux_drum_7", 0) // Crash cymbal. + ROM_LOAD("crsh1a.crs1.u14", 0x000000, 0x001000, CRC(85ce8dc5) SHA1(a1fb4064f7d02df21ef898dab1bd4df9754f2420)) + ROM_LOAD("crsh1b.crs2.u13", 0x001000, 0x001000, CRC(3681d6f0) SHA1(1ad7e202eb9a82af03949bcf3ba281932bf83f5b)) + ROM_LOAD("crsh1c.crs3.u12", 0x002000, 0x001000, CRC(ff1a4d87) SHA1(6e10d141f9a8dbbf951d72fbdeda4e8386fd5bc8)) + ROM_LOAD("crsh1d.crs4.u15", 0x003000, 0x001000, CRC(7f623944) SHA1(03c1294df1e057442aacdb004d3ebd8e94628b15)) + ROM_LOAD("crsh1e.crs5.u16", 0x004000, 0x001000, CRC(851c306a) SHA1(4f41a31e2e8273df7664a65c5e5a3528b312627a)) + ROM_LOAD("crsh1f.crs6.u17", 0x005000, 0x001000, CRC(2fee35fe) SHA1(53b68ffe940beee4dcf568af0ed129a02a2948b9)) + ROM_LOAD("crsh1g.crs7.u18", 0x006000, 0x001000, CRC(53f939bb) SHA1(980368e122793d1318e3643b87e06e053690f0de)) + ROM_LOAD("crsh1h.crs8.u11", 0x007000, 0x001000, CRC(7b9f55c2) SHA1(dd0eb89ad89e56a28d8dccb78a979acb954968a1)) + + ROM_REGION(0x1000, "sample_sidestick", 0) + ROM_LOAD("sstk1.sstk.u78", 0x000000, 0x001000, CRC(61af39e3) SHA1(5648674854a8db80656bf729c4f353b75d101d7b)) + + ROM_REGION(0x1000, "sample_snare", 0) + ROM_LOAD("snar9.snar.u79", 0x000000, 0x001000, CRC(83478583) SHA1(bac791208270eff1f2f362511d6418873c47827c)) + + ROM_REGION(0x2000, "sample_conga", 0) + ROM_LOAD("cnga1a.cga1.u66", 0x000000, 0x001000, CRC(1a579539) SHA1(169741786c44026f2b6ef4052cccb2a27ba41e19)) + ROM_LOAD("cnga1b.cga2.u67", 0x001000, 0x001000, CRC(02434d69) SHA1(451398fbf9ac94a1773f4f40ef4ca32d3c857537)) + + ROM_REGION(0x2000, "sample_tom", 0) + ROM_LOAD("tom6a.tom1.u68", 0x000000, 0x001000, CRC(75f83e43) SHA1(386aa53311e6f8cea56e8021b19855a5ba586f52)) + ROM_LOAD("tom6b.tom2.u69", 0x001000, 0x001000, CRC(c7633ca4) SHA1(60ab77bf21897b55cc8d2844ce1cc0c65958c939)) ROM_END } // anonymous namespace -SYST(1982, linndrum, 0, 0, linndrum, linndrum, linndrum_state, empty_init, "Linn Electronics", "LinnDrum", MACHINE_SUPPORTS_SAVE | MACHINE_NOT_WORKING | MACHINE_NO_SOUND) +SYST(1982, linndrum, 0, 0, linndrum, linndrum, linndrum_state, empty_init, "Linn Electronics", "LinnDrum", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_SOUND) diff --git a/src/mame/mame.lst b/src/mame/mame.lst index 0187034605eee..c39790cdaea2a 100644 --- a/src/mame/mame.lst +++ b/src/mame/mame.lst @@ -1251,6 +1251,7 @@ holdrma6 holdrma6a househrt househrta +hrtantny incachf indream indreama @@ -1292,6 +1293,7 @@ mnytreea moonfire moonwalt mrwoo +mrwoou mskitty mystarr mysteycm @@ -15143,6 +15145,7 @@ bmcpokr fengyunh mjmaglmp shendeng +xyddzhh @source:bmc/koftball.cpp jxzh @@ -15165,6 +15168,38 @@ bw2 @source:booth/apexc.cpp apexc +@source:bordun/att.cpp +lianhp2 +lianhp3 + +@source:bordun/skylncr.cpp +bdream97 +blshark +butrfly +butrflybl +gallag50 +leader +leadera +madzoo +mbutrfly +miaction +neraidou +olymp +rolla +score5 +seadevil +skylncr +sonikfig +spcliner +speedway +speedwaya +sstar97 +sstar97a +sstar97jb +superb2k +tigerslt + + @source:brother/ax145.cpp ax145 @@ -15236,6 +15271,7 @@ dkbanans dkjfever dokodemo gekimaka +katochan mariojjl masmario masmarios @@ -15957,6 +15993,7 @@ diamrun gng gnga gngbl +gngbla gngblita gngc gngprot @@ -16220,8 +16257,8 @@ sk10 sx1010 @source:casio/wk1800.cpp -wk1600 // 2000 Casio -wk1800 // 2000 Casio +wk1600 +wk1800 @source:casio/zoomer.cpp zoomer @@ -17238,6 +17275,7 @@ rohgah rohgau schmeisr wizdfire +wizdfirea wizdfireu wolffang hangzo @@ -17454,6 +17492,19 @@ rainbow rainbow100a rainbow190 +@source:dec/uvax1.cpp +uvax1 + +@source:dec/uvax2.cpp +uvax2 + +@source:dec/uvax3.cpp +mv3400 +mv3500 + +@source:dec/uvax3100.cpp +mv3100m10 + @source:dec/vax11.cpp vax785 @@ -17587,6 +17638,8 @@ mjmyornt mjmyorntr mjmyster mjmyuniv +mjmyunivbl +mjmyunivbl2 mjmywrld mjreach1 mjschuka @@ -17622,6 +17675,7 @@ hjingia hnkochou hnoridur inca +intrgirl jantouki janyuki majxtal7 @@ -17636,11 +17690,13 @@ mjdialq2 mjdialq2a mjelct3 mjelct3a +mjelct3bl mjelctrb mjelctrn mjembase mjfriday mjreach +mjreacha mjreachbl mjreachp2 neruton @@ -17650,8 +17706,8 @@ ougonhaib1 ougonhaib2 ougonhaib3 quiztvqq +qyjdzjp shpeng -intrgirl sprtmtch tenkai tenkai2b @@ -17739,6 +17795,7 @@ cgenienz @source:edevices/diverboy.cpp diverboy +tumblebed @source:edevices/fantland.cpp borntofi @@ -18326,6 +18383,9 @@ fmtownsmx fmtownssj fmtownsux +@source:fujitsu/secoinsa20.cpp +secoinsa20 + @source:funtech/supracan.cpp supracan @@ -20330,6 +20390,7 @@ moonlght moonlghta moonlghtb moonlghtc +mtonic2 nc96 nc96a nc96b @@ -20443,6 +20504,7 @@ vbowlhk vbowlj wlcc xymg +xymga @source:igs/igs017.cpp cpoker2 @@ -20478,6 +20540,10 @@ tarzanb tarzanc tjsb +@source:igs/igs_68k_023vid.cpp +xypmd +xypmda + @source:igs/igs_fear.cpp fearless icescape @@ -20489,10 +20555,14 @@ amazonia amazonkp chessc2 cjddz +cjddz213cn cjddz215cn cjddz217cn cjddzlf cjddzp +cjddzps +cjddzs +cjddzsa cjtljp extradrw fruitpar @@ -20517,15 +20587,21 @@ oceanpar oceanpar101us olympic5 olympic5107us -tripslot qlgs sdwx slqz3 +tct2p +tripslot +xypdk zhongguo @source:igs/igs_m027_023vid.cpp mxsqy +@source:igs/igs_m027_033vid.cpp +huahuas5 +qiji6 + @source:igs/igs_m027_link.cpp cjslh cjsll @@ -20691,6 +20767,7 @@ kov2p200 kov2p202 kov2p203 kov2p204 +kovgsyx kovlsjb kovlsjba kovlsqh @@ -20698,7 +20775,6 @@ kovlsqh2 kovplus kovplusa kovqhsgs -kovqhsgs302 kovsgqyz kovsgqyza kovsgqyzb @@ -20787,8 +20863,18 @@ kov3hd101 @source:igs/spoker.cpp 3super8 +dafuwng3 +hsheng2 +huahuas2 +huahuas2a +huluw2 jbell +jinhuang jinhulu2 +jinhulu2100gi +jinhulu2101is +jinhulu2120gi +sleyuan spk100 spk102u spk102ua @@ -20804,10 +20890,11 @@ spk201ua spk203us spk205us spk306us +zuanshiw @source:igt/drw80pkr.cpp -drw80pk2 drw80pkr +drw80wld @source:igt/fortune1.cpp babydad @@ -22228,6 +22315,7 @@ vjslap crisscrs guab tenup +ttrail @source:jpm/jpmimpct.cpp buzzundr @@ -24440,6 +24528,7 @@ salmndr2 salmndr2a sexyparo sexyparoa +sexyparoebl slamdnk2 soccerss soccerssa @@ -29557,6 +29646,7 @@ unkct comebaby @source:misc/compucranes.cpp +crsauruss mastcrane mastcranea mastcraneb @@ -29713,7 +29803,9 @@ fredmesp lottof2 @source:misc/ddz.cpp +baibians btlfront +cjmx crzclass ddz @@ -30307,6 +30399,7 @@ mchampdx mchampdxa mchampdxb multchmp +multchmp25 multchmpa multchmpk swatpolc @@ -30758,7 +30851,9 @@ gluck2 @source:misc/gms.cpp baile ballch +cjdlz cots +hgly jinpaish magslot rbmk @@ -31320,6 +31415,7 @@ yoyospel @source:misc/menghong.cpp crzyddz2 menghong +menghonga @source:misc/meyc8080.cpp casbjack @@ -31826,7 +31922,6 @@ df_djpkr dphl dphla dphljp -dphlunka dphlunkb drhl drhla @@ -31855,6 +31950,7 @@ pkii_dm pma smshilo ssjkrpkr +sureshoto tpoker2 unkljfpk @@ -32412,31 +32508,6 @@ skimaxx @source:misc/skyarmy.cpp skyarmy -@source:misc/skylncr.cpp -bdream97 -blshark -butrfly -butrflybl -gallag50 -leader -leadera -madzoo -mbutrfly -miaction -neraidou -olymp -rolla -score5 -seadevil -skylncr -sonikfig -spcliner -speedway -speedwaya -sstar97 -superb2k -tigerslt - @source:misc/sliver.cpp sliver slivera @@ -39057,9 +39128,11 @@ psionla psionlam psionlz psionlz64 -psionlz64s psionp200 +psionp200a +psionp250 psionp350 +psionp432 psionp464 psionxp @@ -41235,6 +41308,7 @@ vfremix vmahjong wasafari winterht +wwshin yattrmnp znpwfv znpwfvt @@ -41992,6 +42066,7 @@ wschampa wschampb @source:seta/simple_st0016.cpp +crownpkr dcrown dcrowna gostop @@ -42512,6 +42587,9 @@ busicom @source:skeleton/c2color.cpp c2color +@source:skeleton/camirf1.cpp +camirf1 + @source:skeleton/candela.cpp can09t can09 @@ -42570,6 +42648,9 @@ cosmicos @source:skeleton/cp1.cpp cp1 +@source:skeleton/css11501sk9.cpp +css11501sk9 + @source:skeleton/ct909e_segadvd.cpp megatrix @@ -42772,6 +42853,9 @@ hprotr8a @source:skeleton/ht68k.cpp ht68k +@source:skeleton/huangyeh_m68k.cpp +wlzb + @source:skeleton/hudson_poems.cpp marimba poembase @@ -42885,6 +42969,9 @@ mice2_6502 mice2_8085 mice2_6809 +@source:skeleton/mice3s68k.cpp +mice3s68k + @source:skeleton/micral.cpp micral questarm @@ -42970,6 +43057,9 @@ nordle2x c5000 c8002 +@source:skeleton/optomaxv.cpp +optomaxv + @source:skeleton/p8k.cpp p8000 p8000_16 @@ -43013,6 +43103,9 @@ plan80 @source:skeleton/pm68k.cpp pm68k +@source:skeleton/powerpack.cpp +powerpack + @source:skeleton/proteus3.cpp proteus3 @@ -43084,6 +43177,9 @@ semcrossw @source:skeleton/seoul88.cpp seoul88 +@source:skeleton/sgm.cpp +wpddz + @source:skeleton/sh4robot.cpp sh4robot @@ -43199,6 +43295,10 @@ prose2ko @source:skeleton/tulip1.cpp tulip1 +@source:skeleton/turnierdart.cpp +turnierd +turnierda + @source:skeleton/tvcobrasd.cpp cobrasd cobrasda @@ -43228,6 +43328,9 @@ vectrix venteta @source:skeleton/vgame.cpp +cjdn +cjlddz +cjsjh hilice mjxy2 @@ -43746,6 +43849,7 @@ queenbee queenbeeb queenbeei queenbeesa +queenbn saklove squeenb strain @@ -44049,6 +44153,7 @@ cadashj1 cadashjo cadashp cadashs +cadashso cadashu cadashu1 earthjkr @@ -44953,6 +45058,18 @@ prav8d prav8dd telstrat +@source:tatsumi/apache3.cpp +apache3 +apache3a +apache3b + +@source:tatsumi/cyclwarr.cpp +bigfight +bigfightj +cyclwarr +cyclwarra +cyclwarrb + @source:tatsumi/kingdrby.cpp cowrace kingdrbb @@ -44963,15 +45080,7 @@ kingdrby lockon lockonc -@source:tatsumi/tatsumi.cpp -apache3 -apache3a -apache3b -bigfight -bigfightj -cyclwarr -cyclwarra -cyclwarrb +@source:tatsumi/roundup5.cpp roundup5 @source:tatsumi/tx1.cpp @@ -45092,6 +45201,7 @@ ddungeone stoffy stoffyu toffy +toffya tstrike tstrikea diff --git a/src/mame/metro/hyprduel.cpp b/src/mame/metro/hyprduel.cpp index 237a59d0f0254..0c4fd843201e2 100644 --- a/src/mame/metro/hyprduel.cpp +++ b/src/mame/metro/hyprduel.cpp @@ -98,8 +98,8 @@ class hyprduel_state : public driver_device /* misc */ emu_timer *m_vblank_end_timer = nullptr; - int m_subcpu_resetline = 0; - int m_cpu_trigger = 0; + bool m_subcpu_resetline = false; + int32_t m_cpu_trigger = 0; /* devices */ required_device m_maincpu; @@ -157,7 +157,7 @@ void hyprduel_state::subcpu_control_w(uint16_t data) if (!m_subcpu_resetline) { m_subcpu->set_input_line(INPUT_LINE_RESET, ASSERT_LINE); - m_subcpu_resetline = 1; + m_subcpu_resetline = true; } break; @@ -165,7 +165,7 @@ void hyprduel_state::subcpu_control_w(uint16_t data) if (m_subcpu_resetline) { m_subcpu->set_input_line(INPUT_LINE_RESET, CLEAR_LINE); - m_subcpu_resetline = 0; + m_subcpu_resetline = false; } m_maincpu->spin_until_interrupt(); break; @@ -390,7 +390,7 @@ void hyprduel_state::machine_reset() { /* start with cpu2 halted */ m_subcpu->set_input_line(INPUT_LINE_RESET, ASSERT_LINE); - m_subcpu_resetline = 1; + m_subcpu_resetline = true; m_cpu_trigger = 0; } diff --git a/src/mame/misc/39in1.cpp b/src/mame/misc/39in1.cpp index 5cf3a675500bf..c4257741d27cf 100644 --- a/src/mame/misc/39in1.cpp +++ b/src/mame/misc/39in1.cpp @@ -29,6 +29,8 @@ * from the CPLD (probably) * - 19in1, 48in1, 48in1a, 48in1b, 48in1c, 60in1 have more conditional XORs, * encryption isn't completely beaten yet + * - fruitwld, fruitwlda, jumanjia show 'HW_002 ERROR', probably missing CPLD + * emulation * * * 39in1 notes: @@ -64,18 +66,19 @@ class _39in1_state : public driver_device , m_dsw(*this, "DSW") { } - void _39in1(machine_config &config); - void base(machine_config &config); + void _39in1(machine_config &config) ATTR_COLD; + void base(machine_config &config) ATTR_COLD; + void iam(machine_config &config) ATTR_COLD; - void init_4in1a(); - void init_4in1b(); - void init_19in1(); - void init_39in1(); - void init_48in1(); - void init_48in1a(); - void init_48in1c(); - void init_60in1(); - void init_rodent(); + void init_4in1a() ATTR_COLD; + void init_4in1b() ATTR_COLD; + void init_19in1() ATTR_COLD; + void init_39in1() ATTR_COLD; + void init_48in1() ATTR_COLD; + void init_48in1a() ATTR_COLD; + void init_48in1c() ATTR_COLD; + void init_60in1() ATTR_COLD; + void init_rodent() ATTR_COLD; // I.A.M. slots void init_fruitwld(); @@ -110,9 +113,10 @@ class _39in1_state : public driver_device void _39in1_map(address_map &map) ATTR_COLD; void base_map(address_map &map) ATTR_COLD; + void iam_map(address_map &map) ATTR_COLD; - void decrypt(u8 xor00, u8 xor02, u8 xor04, u8 xor08, u8 xor10, u8 xor20, u8 xor40, u8 xor80, u8 bit7, u8 bit6, u8 bit5, u8 bit4, u8 bit3, u8 bit2, u8 bit1, u8 bit0); - void further_decrypt(u8 xor400, u8 xor800, u8 xor1000, u8 xor2000, u8 xor4000, u8 xor8000); + void decrypt(u8 xor00, u8 xor02, u8 xor04, u8 xor08, u8 xor10, u8 xor20, u8 xor40, u8 xor80, u8 bit7, u8 bit6, u8 bit5, u8 bit4, u8 bit3, u8 bit2, u8 bit1, u8 bit0) ATTR_COLD; + void further_decrypt(u8 xor400, u8 xor800, u8 xor1000, u8 xor2000, u8 xor4000, u8 xor8000) ATTR_COLD; }; void _39in1_state::machine_reset() @@ -230,6 +234,15 @@ void _39in1_state::_39in1_map(address_map &map) map(0xa0151648, 0xa015164b).r(FUNC(_39in1_state::prot_cheater_r)); } +void _39in1_state::iam_map(address_map &map) +{ + base_map(map); + + map(0x04800000, 0x04ffffff).ram(); // CPLD here? + map(0xa0800000, 0xa3ffffff).ram(); // TODO: probably not really all RAM +} + + static INPUT_PORTS_START( 39in1 ) PORT_START("MCUIPT") PORT_BIT( 0x00000001, IP_ACTIVE_LOW, IPT_START1 ) @@ -379,6 +392,14 @@ void _39in1_state::_39in1(machine_config &config) m_maincpu->set_addrmap(AS_PROGRAM, &_39in1_state::_39in1_map); } +void _39in1_state::iam(machine_config &config) +{ + base(config); + + m_maincpu->set_addrmap(AS_PROGRAM, &_39in1_state::iam_map); +} + + ROM_START( 39in1 ) // main program, encrypted ROM_REGION( 0x80000, "maincpu", 0 ) @@ -606,9 +627,9 @@ GAME(2004, 60in1, 39in1, base, 39in1, _39in1_state, init_60in1, ROT9 GAME(2005, rodent, 0, base, 39in1, _39in1_state, init_rodent, ROT0, "The Game Room", "Rodent Exterminator", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND) // I.A.M. slots. Versions are taken from program ROM stickers or ROM strings, where available -GAME(2008, fruitwld, 0, base, 39in1, _39in1_state, init_fruitwld, ROT0, "I.A.M.", "Fruit World (V111)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND) // FRUIT_V111.BIN 2008-04-30 15:59:21 -GAME(2007, fruitwlda, fruitwld, base, 39in1, _39in1_state, init_fruitwld, ROT0, "I.A.M.", "Fruit World (V110)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND) // FRUIT_V110.BIN 2007-07-26 13:46:30 -GAME(2007, jumanji, 0, base, 39in1, _39in1_state, init_jumanji, ROT0, "I.A.M.", "Jumanji (V502)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND) // CHZ_V502.BIN 2007-07-26 13:49:35 in clear text at the end of the main CPU ROM -GAME(2007, jumanjia, jumanji, base, 39in1, _39in1_state, init_jumanjia, ROT0, "I.A.M.", "Jumanji (V113)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND) // JUMANJI_V113.BIN 2007-07-25 10:54:33 -GAME(200?, plutus, 0, base, 39in1, _39in1_state, init_plutus, ROT0, "I.A.M.", "Plutus (V100)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND) // no string -GAME(200?, pokrwild, 0, base, 39in1, _39in1_state, init_pokrwild, ROT0, "I.A.M.", "Poker's Wild (V117)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND) // no string +GAME(2008, fruitwld, 0, iam, 39in1, _39in1_state, init_fruitwld, ROT0, "I.A.M.", "Fruit World (V111)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND) // FRUIT_V111.BIN 2008-04-30 15:59:21 +GAME(2007, fruitwlda, fruitwld, iam, 39in1, _39in1_state, init_fruitwld, ROT0, "I.A.M.", "Fruit World (V110)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND) // FRUIT_V110.BIN 2007-07-26 13:46:30 +GAME(2007, jumanji, 0, iam, 39in1, _39in1_state, init_jumanji, ROT0, "I.A.M.", "Jumanji (V502)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND) // CHZ_V502.BIN 2007-07-26 13:49:35 in clear text at the end of the main CPU ROM +GAME(2007, jumanjia, jumanji, iam, 39in1, _39in1_state, init_jumanjia, ROT0, "I.A.M.", "Jumanji (V113)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND) // JUMANJI_V113.BIN 2007-07-25 10:54:33 +GAME(200?, plutus, 0, iam, 39in1, _39in1_state, init_plutus, ROT0, "I.A.M.", "Plutus (V100)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND) // no string +GAME(200?, pokrwild, 0, iam, 39in1, _39in1_state, init_pokrwild, ROT0, "I.A.M.", "Poker's Wild (V117)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND) // no string diff --git a/src/mame/misc/compucranes.cpp b/src/mame/misc/compucranes.cpp index 6ad825a6c4a99..0b85d2469fd78 100644 --- a/src/mame/misc/compucranes.cpp +++ b/src/mame/misc/compucranes.cpp @@ -44,7 +44,23 @@ The MCU on the older PCBs can differ between 80C32 compatible models (found with a Winbond W78C32C-40 and with a TS80C32X2-MCA). - "GANCHONEW" V1 PCB has a different layout. + "GANCHONEW" (V1) PCB has a different layout: + __________ + ___________| |__________________ + | |_________| ||||||||||||| .| + |: ________ _______ :| + |: ____ TD62703AP HD74HC244P | + |: BUZ12 ________ _______ :| + |: TD62083AP 74HCT273N :| + | ____________ ________ _______ | + | | ROM | HD74HC373P HD74HC244P :| + | |___________| ________ _______ | + | PALCE16V8H HD74HC273P :| + | _______________ ____ _______ :| + | | TSC80C31-12CA| 24LC16B TD62083AP | + | |______________| :| + | Xtal 12MHz :| + |_______________________________________| ********************************************************************************/ @@ -65,6 +81,8 @@ class compucranes_state : public driver_device } void ganchonew(machine_config &config); + void ganchonew_v1(machine_config &config); + void toyshop(machine_config &config); protected: required_device m_maincpu; @@ -75,11 +93,34 @@ INPUT_PORTS_END void compucranes_state::ganchonew(machine_config &config) { - I80C32(config, m_maincpu, 12_MHz_XTAL/2); + I80C32(config, m_maincpu, 12_MHz_XTAL); SPEAKER(config, "mono").front_center(); } +void compucranes_state::ganchonew_v1(machine_config &config) +{ + I80C31(config, m_maincpu, 12_MHz_XTAL); + + SPEAKER(config, "mono").front_center(); +} + +void compucranes_state::toyshop(machine_config &config) +{ + AT89S52(config, m_maincpu, 12_MHz_XTAL); + + SPEAKER(config, "mono").front_center(); +} + +// "GANCHONEW" (V1) PCB. TSC80C31-12CA CPU. +ROM_START(crsauruss) + ROM_REGION(0x80000, "maincpu", 0) + ROM_LOAD("30.01.ic3", 0x00000, 0x20000, CRC(c735e024) SHA1(63dd3a71472bde7f9dead49a8dc889365fd024ef)) // 1xxxxxxxxxxxxxxxx = 0xFF + + ROM_REGION(0x00117, "pld", 0) + ROM_LOAD("pal16v8.ic4", 0x00000, 0x00117, NO_DUMP) // AMD PALCE16V8H-25, may be different on V1 +ROM_END + // "GANCHONEW V8" PCB with ATX PSU connector. TS80C32X2-MCA CPU. ROM_START(mastcrane) ROM_REGION(0x80000, "maincpu", 0) @@ -117,8 +158,11 @@ ROM_START(octopussy) ROM_END /* Direct clone of the GANCHONEW PCB by OM Vending, silkcreened as "CPU GRUA V2 O. M. VENDING". - Atmel AT89AS52 as CPU, probably the internal ROM is not used, but should be confirmed. 12 MHz xtal. 24C16 SEEPROM. */ + Atmel AT89S52 as CPU, probably the internal ROM is not used, but should be confirmed. 12 MHz xtal. 24C16 SEEPROM. */ ROM_START(toyshop) + ROM_REGION(0x10000, "internal", 0) + ROM_LOAD("89s52.ic1", 0x00000, 0x10000, NO_DUMP) // 8 KBytes internal ROM + ROM_REGION(0x80000, "maincpu", 0) ROM_LOAD("39sf040.ic3", 0x00000, 0x80000, CRC(0d9d157d) SHA1(e70f095d3524e3a4c8d5d07857bb2692b6260cc1)) @@ -128,9 +172,10 @@ ROM_END } // anonymous namespace -// YEAR NAME PARENT MACHINE INPUT CLASS INIT ROT COMPANY FULLNAME FLAGS -GAME( 199?, mastcrane, 0, ganchonew, ganchonew, compucranes_state, empty_init, ROT0, "Compumatic", "Master Crane (set 1)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING | MACHINE_MECHANICAL | MACHINE_REQUIRES_ARTWORK ) -GAME( 199?, mastcranea, mastcrane, ganchonew, ganchonew, compucranes_state, empty_init, ROT0, "Compumatic", "Master Crane (set 2)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING | MACHINE_MECHANICAL | MACHINE_REQUIRES_ARTWORK ) -GAME( 199?, mastcraneb, mastcrane, ganchonew, ganchonew, compucranes_state, empty_init, ROT0, "Compumatic", "Master Crane (set 3)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING | MACHINE_MECHANICAL | MACHINE_REQUIRES_ARTWORK ) -GAME( 2000, octopussy, mastcrane, ganchonew, ganchonew, compucranes_state, empty_init, ROT0, "Covielsa", "Octopussy", MACHINE_NO_SOUND | MACHINE_NOT_WORKING | MACHINE_MECHANICAL | MACHINE_REQUIRES_ARTWORK ) -GAME( 2012, toyshop, 0, ganchonew, ganchonew, compucranes_state, empty_init, ROT0, "OM Vending", "Toy Shop", MACHINE_NO_SOUND | MACHINE_NOT_WORKING | MACHINE_MECHANICAL | MACHINE_REQUIRES_ARTWORK ) +// YEAR NAME PARENT MACHINE INPUT CLASS INIT ROT COMPANY FULLNAME FLAGS +GAME( 199?, crsauruss, 0, ganchonew_v1, ganchonew, compucranes_state, empty_init, ROT0, "Recreativos Presas", "Cranesaurus Single", MACHINE_NO_SOUND | MACHINE_NOT_WORKING | MACHINE_MECHANICAL | MACHINE_REQUIRES_ARTWORK ) +GAME( 199?, mastcrane, 0, ganchonew, ganchonew, compucranes_state, empty_init, ROT0, "Compumatic", "Master Crane (set 1)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING | MACHINE_MECHANICAL | MACHINE_REQUIRES_ARTWORK ) +GAME( 199?, mastcranea, mastcrane, ganchonew, ganchonew, compucranes_state, empty_init, ROT0, "Compumatic", "Master Crane (set 2)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING | MACHINE_MECHANICAL | MACHINE_REQUIRES_ARTWORK ) +GAME( 199?, mastcraneb, mastcrane, ganchonew, ganchonew, compucranes_state, empty_init, ROT0, "Compumatic", "Master Crane (set 3)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING | MACHINE_MECHANICAL | MACHINE_REQUIRES_ARTWORK ) +GAME( 2000, octopussy, mastcrane, ganchonew, ganchonew, compucranes_state, empty_init, ROT0, "Covielsa", "Octopussy", MACHINE_NO_SOUND | MACHINE_NOT_WORKING | MACHINE_MECHANICAL | MACHINE_REQUIRES_ARTWORK ) +GAME( 2012, toyshop, 0, toyshop, ganchonew, compucranes_state, empty_init, ROT0, "OM Vending", "Toy Shop", MACHINE_NO_SOUND | MACHINE_NOT_WORKING | MACHINE_MECHANICAL | MACHINE_REQUIRES_ARTWORK ) diff --git a/src/mame/misc/ddz.cpp b/src/mame/misc/ddz.cpp index f7002ec562185..d736879d1dfd8 100644 --- a/src/mame/misc/ddz.cpp +++ b/src/mame/misc/ddz.cpp @@ -1,8 +1,9 @@ // license:BSD-3-Clause -// copyright-holders:Angelo Salese +// copyright-holders: Angelo Salese + /**************************************************************************** - 招级疯斗 - "Zhaoji Fengdou" - "Crazy Class" HW + 招级疯斗 - "Chaoji Fengdou" - "Crazy Class" HW driver by Angelo Salese, based off original ddz.cpp by ElSemi @@ -14,7 +15,7 @@ Haze's notes: -fwiw, it's probably same PCB as the non-working 'ddz' in MAME, but different game. +FWIW, it's probably same PCB as the non-working 'ddz' in MAME, but different game. there's some kind of encryption/scrambling going on, at the very least @@ -37,6 +38,7 @@ if you reverse the letters you get 'bug in vfprintf : bad base' so I suspect the data is in reverse order and maybe some blocks scrambled about. +trivia: TJF stands for Tai Ji Feng ****************************************************************************/ #include "emu.h" @@ -47,6 +49,7 @@ so I suspect the data is in reverse order and maybe some blocks scrambled about. #include "machine/vrender0.h" #include "sound/vrender0.h" #include "video/vrender0.h" + #include "emupal.h" #include "screen.h" #include "speaker.h" @@ -68,19 +71,17 @@ class ddz_state : public driver_device { } - void init_ddz(); - void ddz(machine_config &config); + void init_ddz() ATTR_COLD; + void ddz(machine_config &config) ATTR_COLD; protected: virtual void machine_start() override ATTR_COLD; virtual void machine_reset() override ATTR_COLD; private: - // memory pointers required_shared_ptr m_workram; required_region_ptr m_encdata; - // devices required_device m_maincpu; required_device m_vr0soc; @@ -126,11 +127,11 @@ void ddz_state::machine_reset() void ddz_state::ddz(machine_config &config) { - SE3208(config, m_maincpu, 14318180 * 3); // TODO : different between each PCBs + SE3208(config, m_maincpu, 14'318'180 * 3); // TODO : different between each PCBs m_maincpu->set_addrmap(AS_PROGRAM, &ddz_state::ddz_mem); m_maincpu->iackx_cb().set(m_vr0soc, FUNC(vrender0soc_device::irq_callback)); - VRENDER0_SOC(config, m_vr0soc, 14318180 * 3); + VRENDER0_SOC(config, m_vr0soc, 14'318'180 * 3); m_vr0soc->set_host_cpu_tag(m_maincpu); } @@ -143,7 +144,7 @@ ROM_START( ddz ) ROM_LOAD("ddz.003.rom", 0x800000, 0x400000, CRC(61c9b5c9) SHA1(0438417398403456a1c49408881797a94aa86f49) ) ROM_END -/* "Zhaoji Fengdou" PCB +/* "Chaoji Fengdou" PCB ______________________________________________________________ | _________ ____________________ | __| HD74HC245P |ROM1 H28F320BDJ-TTL80 | @@ -170,7 +171,7 @@ ROM_END | _____ ___ JAMMA _____ Switch | |______| |_|_| | |_|_|_|_|_|_|_|_|_|_|_|_| |_________| */ -ROM_START( crzclass ) +ROM_START( crzclass ) // 超级疯斗 ROM_REGION32_LE( 0x1000000, "ipl", ROMREGION_ERASEFF ) ROM_REGION( 0x1000000, "enc_data", ROMREGION_ERASEFF ) @@ -180,6 +181,26 @@ ROM_START( crzclass ) // rom4 not populated ROM_END +ROM_START( baibians ) // 百变双扣, same PCB as crzclass + ROM_REGION32_LE( 0x1000000, "ipl", ROMREGION_ERASEFF ) + + ROM_REGION( 0x1000000, "enc_data", ROMREGION_ERASEFF ) + ROM_LOAD("rom1", 0x000000, 0x400000, CRC(b9a61efe) SHA1(e0114c231bf301779033b357bc65b133f2ab00be) ) // SHARP LH28F320BJD-TTL80 + ROM_LOAD("rom2", 0x400000, 0x400000, CRC(8b17c3a8) SHA1(b7c65fe9c262ec819ecb0d92e885c6b67d1ee938) ) // SHARP LH28F320BJD-TTL80 + ROM_LOAD("rom3", 0x800000, 0x400000, CRC(41b9b943) SHA1(3379ddf851818209cfede641e7bcc4be8b982034) ) // SHARP LH28F320BJD-TTL80 + // rom4 not populated +ROM_END + +ROM_START( cjmx ) // 超级明星, same PCB as crzclass, but this one has an Amazon LF instead of the VRenderZero + ROM_REGION32_LE( 0x1000000, "ipl", ROMREGION_ERASEFF ) + + ROM_REGION( 0x1000000, "enc_data", ROMREGION_ERASEFF ) + ROM_LOAD("rom1", 0x000000, 0x400000, CRC(518ff760) SHA1(68e3fc3269060e0abd8473abfc141f038d63e4e4) ) // SHARP LH28F320BJD-TTL80 + ROM_LOAD("rom2", 0x400000, 0x400000, CRC(9caa6b70) SHA1(9914793ac772b9ae113f820c181a653ab8a9634d) ) // SHARP LH28F320BJD-TTL80 + ROM_LOAD("rom3", 0x800000, 0x400000, CRC(738db095) SHA1(073c92d8d22cbec5e6f5f5e4c25e532d2ab914d5) ) // SHARP LH28F320BJD-TTL80 + // rom4 not populated +ROM_END + ROM_START( btlfront ) ROM_REGION32_LE( 0x1000000, "ipl", ROMREGION_ERASEFF ) @@ -194,18 +215,20 @@ ROM_END void ddz_state::init_ddz() { uint8_t *ipl = reinterpret_cast(memregion("ipl")->base()); - for(uint32_t x=0;x m_vram; + required_shared_ptr_array m_scroll; + required_shared_ptr m_spriteram; + required_shared_ptr m_layersize; + required_shared_ptr m_platform_x; + required_shared_ptr m_platform_y; + + optional_memory_bank m_audiobank; + optional_ioport m_io_eepromout; + + tilemap_t *m_tilemap_16x16[2]{}; + tilemap_t *m_tilemap[2]{}; + u32 m_tilemap_color[2]{}; + + required_device m_maincpu; + optional_device m_audiocpu; + required_device m_gfxdecode; + optional_device m_sprgen; + optional_device m_eeprom; + optional_device m_soundlatch; + + void sound_command_w(u8 data); + void platform_w(u16 data); + u8 eeprom_r(); + void eeprom_w(u8 data); + void sound_rombank_w(u8 data); + template void vram_w(offs_t offset, u16 data, u16 mem_mask = ~0); + void tilemap0_color_w(u16 data); + void tilemap0_color_jumppop_w(u16 data); + template TILE_GET_INFO_MEMBER(get_tile_info); + template TILE_GET_INFO_MEMBER(get_tile_info_16x16); + u32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + DECOSPR_PRIORITY_CB_MEMBER(pri_callback); + void fantstrya_map(address_map &map) ATTR_COLD; + void hedpanic_map(address_map &map) ATTR_COLD; + void jumppop_map(address_map &map) ATTR_COLD; + void mchampdx_map(address_map &map) ATTR_COLD; + void multchmp_map(address_map &map) ATTR_COLD; + void sound_io_map(address_map &map) ATTR_COLD; + void sound_map(address_map &map) ATTR_COLD; + void tangtang_map(address_map &map) ATTR_COLD; + + void io_area_dsw(address_map &map, u32 base) ATTR_COLD; + void io_area_eeprom(address_map &map, u32 base) ATTR_COLD; + void palette_area(address_map &map, u32 base) ATTR_COLD; + void sprite_area(address_map &map, u32 base) ATTR_COLD; + void vid_attr_area(address_map &map, u32 base) ATTR_COLD; + void vram_area(address_map &map, u32 base) ATTR_COLD; +}; + + +/*************************************************************************** + +Note: if MAME_DEBUG is defined, pressing Z with: + + Q / W Shows Layer 0 / 1 + A Shows Sprites + + Keys can be used together! + + + [ 2 Scrolling Layers ] + + Tile Size: 8 x 8 x 8 + Color Codes: 1 per Layer (banked for Layer 0) + Layer Size (tiles) : 128 x 64 + Layer Size (pixels): 1024 x 512 + + [ 256 Sprites ] + + Sprites are made of 16 x 16 x 5 tiles. Size can vary from 1 to + 8 tiles vertically, while their width is always 1 tile. + + [ Priorities ] + + The game only uses this scheme: + + Back -> Front: Layer 0, Layer 1, Sprites + +***************************************************************************/ + + +/*************************************************************************** + + Tilemaps + + Offset: Bits: Value: + + 0.w Code + + Color code: layer 0 (backmost) can bank at every 256 colors, + layer 1 uses the first 256. + +***************************************************************************/ + +template +TILE_GET_INFO_MEMBER(esd16_state::get_tile_info) +{ + const u16 code = m_vram[Layer][tile_index]; + tileinfo.set(0, + code, + m_tilemap_color[Layer], + 0); +} + +template +TILE_GET_INFO_MEMBER(esd16_state::get_tile_info_16x16) +{ + const u16 code = m_vram[Layer][tile_index]; + tileinfo.set(1, + code, + m_tilemap_color[Layer], + 0); +} + + +void esd16_state::tilemap0_color_w(u16 data) +{ + m_tilemap_color[0] = data & 0x03; + m_tilemap[0]->mark_all_dirty(); + m_tilemap_16x16[0]->mark_all_dirty(); + + bool const flip = BIT(data, 7); + flip_screen_set(flip); + m_sprgen->set_flip_screen(flip); +} + +void esd16_state::tilemap0_color_jumppop_w(u16 data) +{ + // TODO + m_tilemap_color[0] = 2; + m_tilemap_color[1] = 1; + + bool const flip = BIT(data, 7); + flip_screen_set(flip); + m_sprgen->set_flip_screen(flip); +} + + +/*************************************************************************** + + + Video Hardware Init + + +***************************************************************************/ + + +void esd16_state::video_start() +{ + m_tilemap[0] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(esd16_state::get_tile_info<0>)), TILEMAP_SCAN_ROWS, 8, 8, 0x80, 0x40); + m_tilemap[1] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(esd16_state::get_tile_info<1>)), TILEMAP_SCAN_ROWS, 8, 8, 0x80, 0x40); + + // swatpolc changes tilemap 0 to 16x16 at various times + m_tilemap_16x16[0] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(esd16_state::get_tile_info_16x16<0>)), TILEMAP_SCAN_ROWS, 16,16, 0x40, 0x40); + + // hedpanic changes tilemap 1 to 16x16 at various times + m_tilemap_16x16[1] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(esd16_state::get_tile_info_16x16<1>)), TILEMAP_SCAN_ROWS, 16,16, 0x40, 0x40); + + m_tilemap[0]->set_scrolldx(-0x60 + 2, -0x60); + m_tilemap[1]->set_scrolldx(-0x60, -0x60 + 2); + m_tilemap_16x16[0]->set_scrolldx(-0x60 + 2, -0x60); + m_tilemap_16x16[1]->set_scrolldx(-0x60, -0x60 + 2); + + m_tilemap[1]->set_transparent_pen(0x00); + m_tilemap_16x16[1]->set_transparent_pen(0x00); +} + + +/*************************************************************************** + + + Screen Drawing + + +***************************************************************************/ + +u32 esd16_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + int layers_ctrl = -1; + + screen.priority().fill(0, cliprect); + +#ifdef MAME_DEBUG +if (machine().input().code_pressed(KEYCODE_Z)) +{ + int msk = 0; + if (machine().input().code_pressed(KEYCODE_Q)) msk |= 1; + if (machine().input().code_pressed(KEYCODE_W)) msk |= 2; + if (machine().input().code_pressed(KEYCODE_A)) msk |= 4; + if (msk != 0) layers_ctrl &= msk; +} +#endif + + if (layers_ctrl & 1) + { + if (m_layersize[0] & 0x0001) + { + m_tilemap_16x16[0]->set_scrollx(0, m_scroll[0][0]); + m_tilemap_16x16[0]->set_scrolly(0, m_scroll[0][1]); + m_tilemap_16x16[0]->draw(screen, bitmap, cliprect, 0, 0); + } + else + { + m_tilemap[0]->set_scrollx(0, m_scroll[0][0]); + m_tilemap[0]->set_scrolly(0, m_scroll[0][1]); + m_tilemap[0]->draw(screen, bitmap, cliprect, 0, 0); + } + } + else + { + bitmap.fill(0, cliprect); + } + + + if (layers_ctrl & 2) + { + if (m_layersize[0] & 0x0002) + { + m_tilemap_16x16[1]->set_scrollx(0, m_scroll[1][0]); + m_tilemap_16x16[1]->set_scrolly(0, m_scroll[1][1]); + m_tilemap_16x16[1]->draw(screen, bitmap, cliprect, 0, 1); + } + else + { + m_tilemap[1]->set_scrollx(0, m_scroll[1][0]); + m_tilemap[1]->set_scrolly(0, m_scroll[1][1]); + m_tilemap[1]->draw(screen, bitmap, cliprect, 0, 1); + } + + } + + if (layers_ctrl & 4) m_sprgen->draw_sprites(bitmap, cliprect, m_spriteram, 0x400); + +// popmessage("%04x %04x %04x %04x %04x",head_unknown1[0],head_layersize[0],head_unknown3[0],head_unknown4[0],head_unknown5[0]); + return 0; +} /*************************************************************************** @@ -687,8 +971,8 @@ void esd16_state::machine_start() { if (m_audiobank) { - u8* AUDIO = memregion("audiocpu")->base(); - m_audiobank->configure_entries(0, 16, &AUDIO[0x0000], 0x4000); + u8 *const audiorom = memregion("audiocpu")->base(); + m_audiobank->configure_entries(0, 16, &audiorom[0x0000], 0x4000); } save_item(NAME(m_tilemap_color)); @@ -730,7 +1014,7 @@ void esd16_state::esd16_nosound(machine_config &config) m_sprgen->set_flipallx(1); GFXDECODE(config, m_gfxdecode, "palette", gfx_esd16); - PALETTE(config, "palette").set_format(palette_device::xRGB_555, 0x1000/2); + PALETTE(config, "palette").set_format(palette_device::xRGB_555, 0x1000 / 2); } void esd16_state::fantstry(machine_config& config) @@ -759,19 +1043,19 @@ void esd16_state::esd16(machine_config& config) { esd16_nosound(config); - Z80(config, m_audiocpu, XTAL(16'000'000)/4); // 4MHz + Z80(config, m_audiocpu, XTAL(16'000'000) / 4); // 4MHz m_audiocpu->set_addrmap(AS_PROGRAM, &esd16_state::sound_map); m_audiocpu->set_addrmap(AS_IO, &esd16_state::sound_io_map); - m_audiocpu->set_periodic_int(FUNC(esd16_state::nmi_line_pulse), attotime::from_hz(32*60)); // IRQ By Main CPU + m_audiocpu->set_periodic_int(FUNC(esd16_state::nmi_line_pulse), attotime::from_hz(32 * 60)); // IRQ By Main CPU // sound hardware SPEAKER(config, "mono").front_center(); GENERIC_LATCH_8(config, m_soundlatch).data_pending_callback().set_inputline(m_audiocpu, 0); - YM3812(config, "ymsnd", XTAL(16'000'000)/4).add_route(ALL_OUTPUTS, "mono", 0.30); // 4MHz + YM3812(config, "ymsnd", XTAL(16'000'000) / 4).add_route(ALL_OUTPUTS, "mono", 0.30); // 4MHz - OKIM6295(config, "oki", XTAL(16'000'000)/16, okim6295_device::PIN7_HIGH).add_route(ALL_OUTPUTS, "mono", 0.60); // 1MHz + OKIM6295(config, "oki", XTAL(16'000'000) / 16, okim6295_device::PIN7_HIGH).add_route(ALL_OUTPUTS, "mono", 0.60); // 1MHz } void esd16_state::jumppop(machine_config &config) @@ -782,14 +1066,14 @@ void esd16_state::jumppop(machine_config &config) m_maincpu->set_addrmap(AS_PROGRAM, &esd16_state::jumppop_map); - m_audiocpu->set_clock(XTAL(14'000'000)/4); // 3.5MHz - Verified + m_audiocpu->set_clock(XTAL(14'000'000) / 4); // 3.5MHz - Verified m_sprgen->set_info(gfx_jumppop_spr); m_gfxdecode->set_info(gfx_jumppop); - subdevice("ymsnd")->set_clock(XTAL(14'000'000)/4); // 3.5MHz - Verified + subdevice("ymsnd")->set_clock(XTAL(14'000'000) / 4); // 3.5MHz - Verified - subdevice("oki")->set_clock(XTAL(14'000'000)/16); // 875kHz - Verified + subdevice("oki")->set_clock(XTAL(14'000'000) / 16); // 875kHz - Verified } // The ESD 05-28-99 PCB adds an EEPROM @@ -891,7 +1175,7 @@ MULTCHMP.U39 -/ MX27C2000 ***************************************************************************/ -ROM_START( multchmp ) +ROM_START( multchmp25 ) ROM_REGION( 0x080000, "maincpu", 0 ) // 68000 Code ROM_LOAD16_BYTE( "esd2.cu02", 0x000000, 0x040000, CRC(2d1b098a) SHA1(c2f3991f02c611c258219da2c61cad22c9a21f7d) ) ROM_LOAD16_BYTE( "esd1.cu03", 0x000001, 0x040000, CRC(10974063) SHA1(854b38b4d4cb529e9928aae4212c86a220615e04) ) @@ -908,12 +1192,12 @@ ROM_START( multchmp ) ROM_REGION( 0x400000, "bgs", 0 ) // Layers, 16x16x8 ROM_LOAD32_BYTE( "esd9.fu28", 0x000000, 0x080000, CRC(6652c04a) SHA1(178e1d42847506d869ef79db2f7e10df05e9ef76) ) - ROM_LOAD32_BYTE( "esd11.fu29", 0x000002, 0x080000, CRC(9bafd8ee) SHA1(db18be05431d4b6d4207e19fa4ed8701621aaa19) ) ROM_LOAD32_BYTE( "esd7.fu26", 0x000001, 0x080000, CRC(a783a003) SHA1(1ff61a049485c5b599c458a8bf7f48027d14f8e0) ) + ROM_LOAD32_BYTE( "esd11.fu29", 0x000002, 0x080000, CRC(9bafd8ee) SHA1(db18be05431d4b6d4207e19fa4ed8701621aaa19) ) ROM_LOAD32_BYTE( "esd5.fu27", 0x000003, 0x080000, CRC(299f32c2) SHA1(274752444f6ddba16eeefc02c3e78525c079b3d8) ) ROM_LOAD32_BYTE( "esd10.fu31", 0x200000, 0x080000, CRC(d815974b) SHA1(3e528a5df79fa7dc0f38b0ee7f2f3a0ebc97a369) ) - ROM_LOAD32_BYTE( "esd12.fu33", 0x200002, 0x080000, CRC(c6b86001) SHA1(11a63b56df30ab7b85ce4568d2a24e96a125735a) ) ROM_LOAD32_BYTE( "esd8.fu30", 0x200001, 0x080000, CRC(22861af2) SHA1(1e74e85517cb8fd5fb4bda6e9d9d54046e31f653) ) + ROM_LOAD32_BYTE( "esd12.fu33", 0x200002, 0x080000, CRC(c6b86001) SHA1(11a63b56df30ab7b85ce4568d2a24e96a125735a) ) ROM_LOAD32_BYTE( "esd6.fu32", 0x200003, 0x080000, CRC(e2689bb2) SHA1(1da9b1f7335d5c2d1c2f8353fccf91c0109d2e9d) ) ROM_REGION( 0x40000, "oki", 0 ) // Samples @@ -937,12 +1221,12 @@ ROM_START( multchmpk ) ROM_REGION( 0x400000, "bgs", 0 ) // Layers, 16x16x8 ROM_LOAD32_BYTE( "multchmp.u31", 0x000000, 0x080000, CRC(b1e4e9e3) SHA1(1a7393e9073b028b4170393b3788ad8cb86c0c78) ) - ROM_LOAD32_BYTE( "multchmp.u33", 0x000002, 0x080000, CRC(e4c0ec96) SHA1(74152108e4d05f4aff9d38919f212fcb8c87cef3) ) ROM_LOAD32_BYTE( "multchmp.u29", 0x000001, 0x080000, CRC(01bd1399) SHA1(b717ccffe0af92a42a0879736d34d3ad71840233) ) + ROM_LOAD32_BYTE( "multchmp.u33", 0x000002, 0x080000, CRC(e4c0ec96) SHA1(74152108e4d05f4aff9d38919f212fcb8c87cef3) ) ROM_LOAD32_BYTE( "multchmp.u27", 0x000003, 0x080000, CRC(dc42704e) SHA1(58a04a47ffc6d6ae0e4d49e466b1c58b37ad741a) ) ROM_LOAD32_BYTE( "multchmp.u32", 0x200000, 0x080000, CRC(f05cb5b4) SHA1(1b33e60942238e39d61ae59e9317b99e83595ab1) ) - ROM_LOAD32_BYTE( "multchmp.u34", 0x200002, 0x080000, CRC(bffaaccc) SHA1(d9ab248e2c7c639666e3717cfc5d8c8468a1bde2) ) ROM_LOAD32_BYTE( "multchmp.u30", 0x200001, 0x080000, CRC(c6b4cc18) SHA1(d9097b85584272cfe4989a40d622ef1feeee6775) ) + ROM_LOAD32_BYTE( "multchmp.u34", 0x200002, 0x080000, CRC(bffaaccc) SHA1(d9ab248e2c7c639666e3717cfc5d8c8468a1bde2) ) ROM_LOAD32_BYTE( "multchmp.u28", 0x200003, 0x080000, CRC(449991fa) SHA1(fd93e420a04cb8bea5421aa9cbe079bd3e7d4924) ) ROM_REGION( 0x40000, "oki", 0 ) // Samples @@ -966,19 +1250,62 @@ ROM_START( multchmpa ) // Also found on a ESD 10-10-98 PCB which looks identical ROM_REGION( 0x400000, "bgs", 0 ) // Layers, 16x16x8 ROM_LOAD32_BYTE( "esd9.fu28", 0x000000, 0x080000, CRC(a3cfe895) SHA1(a8dc0d5d9e64d4c5112177b8f20b5bdb86ca73af) ) - ROM_LOAD32_BYTE( "esd11.fu29", 0x000002, 0x080000, CRC(d3c1855e) SHA1(bb547d4a45a745e9ae4a6727087cdf325105de90) ) ROM_LOAD32_BYTE( "esd7.fu26", 0x000001, 0x080000, CRC(042d59ff) SHA1(8e45a4757e07d8aaf50b151d8849c1a27424e64b) ) + ROM_LOAD32_BYTE( "esd11.fu29", 0x000002, 0x080000, CRC(d3c1855e) SHA1(bb547d4a45a745e9ae4a6727087cdf325105de90) ) ROM_LOAD32_BYTE( "esd5.fu27", 0x000003, 0x080000, CRC(ed5b4e58) SHA1(82c3ee9e2525c0b370a29d5560c21ec6380d1a43) ) ROM_LOAD32_BYTE( "esd10.fu31", 0x200000, 0x080000, CRC(396d77b6) SHA1(f22449a7f9f50e172e36db4f399c14e527409884) ) - ROM_LOAD32_BYTE( "esd12.fu33", 0x200002, 0x080000, CRC(a68848a8) SHA1(915239a961d76af6a1a567eb89b1569f158e714e) ) ROM_LOAD32_BYTE( "esd8.fu30", 0x200001, 0x080000, CRC(fa8cd2d3) SHA1(ddc1b98867e6d2eee458bf35a933e7cdc59f4c7e) ) + ROM_LOAD32_BYTE( "esd12.fu33", 0x200002, 0x080000, CRC(a68848a8) SHA1(915239a961d76af6a1a567eb89b1569f158e714e) ) ROM_LOAD32_BYTE( "esd6.fu32", 0x200003, 0x080000, CRC(97fde7b1) SHA1(b3610f6fcc1367ff079dc01121c86bc1e1f4c7a2) ) ROM_REGION( 0x40000, "oki", 0 ) // Samples ROM_LOAD( "esd4.su08", 0x00000, 0x20000, CRC(6e741fcd) SHA1(742e0952916c00f67dd9f8d01e721a9a538d2fc4) ) ROM_END +// this runs on a slightly newer PCB: ESD 05-17-99 +// there is a string about EEPROM write error but there isn't any on PCB +ROM_START( multchmp ) + ROM_REGION( 0x080000, "maincpu", 0 ) // 68000 Code + ROM_LOAD16_BYTE( "esd7.cu02", 0x000000, 0x040000, CRC(e25cbbfe) SHA1(fa142489a2171fb94b62d2635a1da5944ddde0cb) ) + ROM_LOAD16_BYTE( "esd6.cu03", 0x000001, 0x040000, CRC(e7f837f9) SHA1(f31bf6c99b4f9be7bf9bb7ba04cf354ff070ad7f) ) + + ROM_REGION( 0x40000, "audiocpu", 0 ) // Z80 Code + ROM_LOAD( "esd3.su06", 0x00000, 0x20000, CRC(7c178bd7) SHA1(8754d3c70d9b2bf369a5ce0cce4cc0696ed22750) ) + + ROM_REGION( 0x180000, "spr", 0 ) // Sprites, 16x16x5 + ROM_LOAD16_BYTE( "esd17.ju06", 0x000000, 0x040000, CRC(a69d4399) SHA1(06ae6c07cc6b7313e2e2aa3b994f7532d6994e1b) ) + ROM_LOAD16_BYTE( "esd16.ju05", 0x000001, 0x040000, CRC(e670a6da) SHA1(47cbe45b6d5d0ca70d0c6787d589dde5d14fdba4) ) + ROM_LOAD16_BYTE( "esd15.ju04", 0x080000, 0x040000, CRC(88b7a97c) SHA1(0a57ec8f6a44c8e3aa3ef35499a415d6a2b7eb16) ) + ROM_LOAD16_BYTE( "esd14.ju03", 0x080001, 0x040000, CRC(a6122225) SHA1(cbcf2b31c4c011daba21f0ae5fd3be63c9a87c00) ) + ROM_LOAD16_BYTE( "esd13.ju07", 0x100000, 0x040000, CRC(22071594) SHA1(c79102b250780d1da8c290d065d61fbbfa193366) ) + + ROM_REGION( 0x400000, "bgs", 0 ) // Layers, 16x16x8 + ROM_LOAD( "mx29f1610ml.fu27_fu32", 0x000000, 0x200000, NO_DUMP ) // These 2 ROMs are soldered and weren't dumped. Using the ones from the other sets for now. + ROM_LOAD( "mx29f1610ml.fu28_fu31", 0x000000, 0x200000, NO_DUMP ) + ROM_LOAD32_BYTE( "esd9.fu28", 0x000000, 0x080000, BAD_DUMP CRC(6652c04a) SHA1(178e1d42847506d869ef79db2f7e10df05e9ef76) ) + ROM_LOAD32_BYTE( "esd7.fu26", 0x000001, 0x080000, BAD_DUMP CRC(a783a003) SHA1(1ff61a049485c5b599c458a8bf7f48027d14f8e0) ) + ROM_LOAD32_BYTE( "esd11.fu29", 0x000002, 0x080000, BAD_DUMP CRC(9bafd8ee) SHA1(db18be05431d4b6d4207e19fa4ed8701621aaa19) ) + ROM_LOAD32_BYTE( "esd5.fu27", 0x000003, 0x080000, BAD_DUMP CRC(299f32c2) SHA1(274752444f6ddba16eeefc02c3e78525c079b3d8) ) + ROM_LOAD32_BYTE( "esd10.fu31", 0x200000, 0x080000, BAD_DUMP CRC(d815974b) SHA1(3e528a5df79fa7dc0f38b0ee7f2f3a0ebc97a369) ) + ROM_LOAD32_BYTE( "esd8.fu30", 0x200001, 0x080000, BAD_DUMP CRC(22861af2) SHA1(1e74e85517cb8fd5fb4bda6e9d9d54046e31f653) ) + ROM_LOAD32_BYTE( "esd12.fu33", 0x200002, 0x080000, BAD_DUMP CRC(c6b86001) SHA1(11a63b56df30ab7b85ce4568d2a24e96a125735a) ) + ROM_LOAD32_BYTE( "esd6.fu32", 0x200003, 0x080000, BAD_DUMP CRC(e2689bb2) SHA1(1da9b1f7335d5c2d1c2f8353fccf91c0109d2e9d) ) + + ROM_REGION( 0x40000, "oki", 0 ) // Samples + ROM_LOAD( "esd4.su10", 0x00000, 0x20000, CRC(6e741fcd) SHA1(742e0952916c00f67dd9f8d01e721a9a538d2fc4) ) + ROM_REGION( 0x1800, "plds", ROMREGION_ERASE00 ) // all read-protected + ROM_LOAD( "palce22v10h-25pc-4.cu04", 0x0000, 0x02dd, NO_DUMP ) + ROM_LOAD( "palce22v10h-25pc-4.cu05", 0x0300, 0x02dd, NO_DUMP ) + ROM_LOAD( "palce22v10h-25pc-4.du05", 0x0600, 0x02dd, NO_DUMP ) + ROM_LOAD( "palce22v10h-25pc-4.fu01", 0x0900, 0x02dd, NO_DUMP ) + ROM_LOAD( "palce16v8h-25.du03", 0x0c00, 0x0117, NO_DUMP ) + ROM_LOAD( "palce16v8h-25.ru27", 0x0e00, 0x0117, NO_DUMP ) + ROM_LOAD( "palce16v8h-25.fu01", 0x1000, 0x0117, NO_DUMP ) + ROM_LOAD( "palce16v8h-25.su07", 0x1200, 0x0117, NO_DUMP ) + ROM_LOAD( "a40mx04-f-pl84.bu01", 0x1400, 0x0200, NO_DUMP ) // size wrong + ROM_LOAD( "a40mx04-f-pl84.du16", 0x1600, 0x0200, NO_DUMP ) // size wrong +ROM_END /* @@ -1040,10 +1367,10 @@ ROM_START( mchampdx ) ROM_REGION( 0x40000, "audiocpu", 0 ) // Z80 Code ROM_LOAD( "esd3.su06", 0x00000, 0x40000, CRC(1b22568c) SHA1(5458e1a798357a6785f8ea1fe9da37768cd4761d) ) - // this has additional copyright sprites in the flash roms for the (c)2000 message.. + // this has additional copyright sprites in the flash ROMs for the (c)2000 message.. ROM_REGION( 0x600000, "spr", 0 ) // Sprites, 16x16x5 - ROM_LOAD( "ver0106_ju01.bin", 0x200000, 0x200000, CRC(55841d90) SHA1(52ba3ee9393dcddf28e2d20a50151bc739faaaa4) ) - ROM_LOAD( "ver0106_ju02.bin", 0x000000, 0x200000, CRC(b27a4977) SHA1(b7f94bb04d0046538b3938335e6b0cce330ad79c) ) + ROM_LOAD( "ver0106_ju02.bin", 0x000000, 0x200000, CRC(b27a4977) SHA1(b7f94bb04d0046538b3938335e6b0cce330ad79c) ) + ROM_LOAD( "ver0106_ju01.bin", 0x200000, 0x200000, CRC(55841d90) SHA1(52ba3ee9393dcddf28e2d20a50151bc739faaaa4) ) // expand this to take up 0x200000 bytes too so we can decode it ROM_LOAD16_BYTE( "ver0106_esd5.ju07", 0x400000, 0x040000, CRC(7a3ac887) SHA1(3c759f9bed396bbaf6bd7298a8bd2bd76df3aa6f) ) ROM_FILL( 0x500000, 0x100000, 0x00 ) @@ -1068,8 +1395,8 @@ ROM_START( mchampdxa ) ROM_LOAD( "esd3.su06", 0x00000, 0x40000, CRC(1b22568c) SHA1(5458e1a798357a6785f8ea1fe9da37768cd4761d) ) ROM_REGION( 0x600000, "spr", 0 ) // Sprites, 16x16x5 - ROM_LOAD( "rom.ju01", 0x200000, 0x200000, CRC(1a749fc2) SHA1(feff4b26ee28244b4d092798a176e33e09d5df2c) ) - ROM_LOAD( "rom.ju02", 0x000000, 0x200000, CRC(7e87e332) SHA1(f90aa00a64a940846d99053c7aa023e3fd5d070b) ) + ROM_LOAD( "rom.ju02", 0x000000, 0x200000, CRC(7e87e332) SHA1(f90aa00a64a940846d99053c7aa023e3fd5d070b) ) + ROM_LOAD( "rom.ju01", 0x200000, 0x200000, CRC(1a749fc2) SHA1(feff4b26ee28244b4d092798a176e33e09d5df2c) ) // expand this to take up 0x200000 bytes too so we can decode it ROM_LOAD16_BYTE( "esd5.ju07", 0x400000, 0x080000, CRC(6cc871cc) SHA1(710b9695c864e4234686993b88d24590d60e1cb9) ) ROM_FILL( 0x500000, 0x100000, 0x00 ) @@ -1094,8 +1421,8 @@ ROM_START( mchampdxb ) ROM_LOAD( "ver1114_esd3.su06", 0x00000, 0x40000, CRC(b87a1e85) SHA1(2fcdd7e8b301e3d20e6500a03dc293403b23b471) ) ROM_REGION( 0x600000, "spr", 0 ) // Sprites, 16x16x5 - ROM_LOAD( "ver1114_ju01", 0x200000, 0x200000, CRC(0048e687) SHA1(5cc0a35b5f5f8d69b2dc3728ad6d0d505d9e16c5) ) // SMT Flash MX chips - ROM_LOAD( "ver1114_ju02", 0x000000, 0x200000, CRC(2f9ccff8) SHA1(176240cd247cc5d3efd58fe0630726a8633be2a4) ) + ROM_LOAD( "ver1114_ju02", 0x000000, 0x200000, CRC(2f9ccff8) SHA1(176240cd247cc5d3efd58fe0630726a8633be2a4) ) + ROM_LOAD( "ver1114_ju01", 0x200000, 0x200000, CRC(0048e687) SHA1(5cc0a35b5f5f8d69b2dc3728ad6d0d505d9e16c5) ) // SMT Flash MX chips // expand this to take up 0x200000 bytes too so we can decode it ROM_LOAD16_BYTE( "ver1114_esd5.ju07", 0x400000, 0x040000, CRC(8175939f) SHA1(cd0132ae0d2e35dc656434989b1f0f255ad562ab) ) ROM_FILL( 0x500000, 0x100000, 0x00 ) @@ -1205,11 +1532,11 @@ ROM_START( hedpanic ) // Story line & game instructions in English ROM_LOAD16_BYTE( "esd1.cu02", 0x000001, 0x040000, CRC(42405e9d) SHA1(0fa088b8bd921e42cedcc4083dfe41bc9888dfd1) ) ROM_REGION( 0x40000, "audiocpu", 0 ) // Z80 Code - ROM_LOAD( "esd3.su06", 0x00000, 0x40000, CRC(a88d4424) SHA1(eefb5ac79632931a36f360713c482cd079891f91) ) // AT27C020 mask rom + ROM_LOAD( "esd3.su06", 0x00000, 0x40000, CRC(a88d4424) SHA1(eefb5ac79632931a36f360713c482cd079891f91) ) // AT27C020 mask ROM ROM_REGION( 0x600000, "spr", 0 ) // Sprites, 16x16x5 - ROM_LOAD( "esd6.ju01", 0x200000, 0x200000, CRC(5858372c) SHA1(dc96112587df681d53cf7449bd39477919978325) ) - ROM_LOAD( "esd7.ju02", 0x000000, 0x200000, CRC(055d525f) SHA1(85ad474691f96e47311a1904015d1c92d3b2d607) ) + ROM_LOAD( "esd7.ju02", 0x000000, 0x200000, CRC(055d525f) SHA1(85ad474691f96e47311a1904015d1c92d3b2d607) ) + ROM_LOAD( "esd6.ju01", 0x200000, 0x200000, CRC(5858372c) SHA1(dc96112587df681d53cf7449bd39477919978325) ) // expand this to take up 0x200000 bytes too so we can decode it ROM_LOAD16_BYTE( "esd5.ju07", 0x400000, 0x080000, CRC(bd785921) SHA1(c8bcb38d5aa6f5a27f0dedf7efd1d6737d59b4ca) ) ROM_FILL( 0x500000, 0x100000, 0x00 ) @@ -1219,7 +1546,7 @@ ROM_START( hedpanic ) // Story line & game instructions in English ROM_LOAD32_WORD( "esd9.fu34", 0x000002, 0x200000, CRC(76b46cd2) SHA1(679cbf50ae5935e8848868081ecef4ec66424f6c) ) ROM_REGION( 0x40000, "oki", 0 ) // Samples - ROM_LOAD( "esd4.su10", 0x000000, 0x020000, CRC(3c11c590) SHA1(cb33845c3dc0501fff8055c2d66f412881089df1) ) // AT27010 mask rom + ROM_LOAD( "esd4.su10", 0x000000, 0x020000, CRC(3c11c590) SHA1(cb33845c3dc0501fff8055c2d66f412881089df1) ) // AT27010 mask ROM ROM_REGION16_BE( 0x80, "eeprom", 0 ) ROM_LOAD( "hedpanic.nv", 0x0000, 0x0080, CRC(e91f4038) SHA1(f492de71170900f87912a272ab4f4a3a37ba31fe) ) @@ -1232,11 +1559,11 @@ ROM_START( hedpanicf ) // Story line in Japanese, game instructions in English ROM_LOAD16_BYTE( "esd1", 0x000001, 0x040000, CRC(d8574925) SHA1(bd4990778b90a49aa6b10f8cf6709ce2424f546a) ) // CU02 ROM_REGION( 0x40000, "audiocpu", 0 ) // Z80 Code - ROM_LOAD( "esd3.su06", 0x00000, 0x40000, CRC(a88d4424) SHA1(eefb5ac79632931a36f360713c482cd079891f91) ) // AT27C020 mask rom + ROM_LOAD( "esd3.su06", 0x00000, 0x40000, CRC(a88d4424) SHA1(eefb5ac79632931a36f360713c482cd079891f91) ) // AT27C020 mask ROM ROM_REGION( 0x600000, "spr", 0 ) // Sprites, 16x16x5 - ROM_LOAD( "esd6.ju01", 0x200000, 0x200000, CRC(5858372c) SHA1(dc96112587df681d53cf7449bd39477919978325) ) - ROM_LOAD( "esd7.ju02", 0x000000, 0x200000, CRC(055d525f) SHA1(85ad474691f96e47311a1904015d1c92d3b2d607) ) + ROM_LOAD( "esd7.ju02", 0x000000, 0x200000, CRC(055d525f) SHA1(85ad474691f96e47311a1904015d1c92d3b2d607) ) + ROM_LOAD( "esd6.ju01", 0x200000, 0x200000, CRC(5858372c) SHA1(dc96112587df681d53cf7449bd39477919978325) ) // expand this to take up 0x200000 bytes too so we can decode it ROM_LOAD16_BYTE( "esd5.ju07", 0x400000, 0x080000, CRC(bd785921) SHA1(c8bcb38d5aa6f5a27f0dedf7efd1d6737d59b4ca) ) ROM_FILL( 0x500000, 0x100000, 0x00 ) @@ -1246,7 +1573,7 @@ ROM_START( hedpanicf ) // Story line in Japanese, game instructions in English ROM_LOAD32_WORD( "esd9.fu34", 0x000002, 0x200000, CRC(76b46cd2) SHA1(679cbf50ae5935e8848868081ecef4ec66424f6c) ) ROM_REGION( 0x40000, "oki", 0 ) // Samples - ROM_LOAD( "esd4.su10", 0x000000, 0x020000, CRC(3c11c590) SHA1(cb33845c3dc0501fff8055c2d66f412881089df1) ) // AT27010 mask rom + ROM_LOAD( "esd4.su10", 0x000000, 0x020000, CRC(3c11c590) SHA1(cb33845c3dc0501fff8055c2d66f412881089df1) ) // AT27010 mask ROM ROM_REGION16_BE( 0x80, "eeprom", 0 ) ROM_LOAD( "hedpanic.nv", 0x0000, 0x0080, CRC(e91f4038) SHA1(f492de71170900f87912a272ab4f4a3a37ba31fe) ) @@ -1259,11 +1586,11 @@ ROM_START( hedpanica ) // Story line & game instructions in English, copyright y ROM_LOAD16_BYTE( "esd11.cu02", 0x000001, 0x040000, CRC(e1418f23) SHA1(39f14172d9b1a0d47edfe2456362fddc22f60066) ) // CU02 ROM_REGION( 0x40000, "audiocpu", 0 ) // Z80 Code - ROM_LOAD( "esd3.su06", 0x00000, 0x40000, CRC(a88d4424) SHA1(eefb5ac79632931a36f360713c482cd079891f91) ) // AT27C020 mask rom + ROM_LOAD( "esd3.su06", 0x00000, 0x40000, CRC(a88d4424) SHA1(eefb5ac79632931a36f360713c482cd079891f91) ) // AT27C020 mask ROM ROM_REGION( 0x600000, "spr", 0 ) // Sprites, 16x16x5 - ROM_LOAD( "ju04", 0x200000, 0x200000, CRC(4f3503d7) SHA1(4bed795c7328e0ebfa97688918eb8a908c29deb8) ) - ROM_LOAD( "ju06", 0x000000, 0x200000, CRC(9f6f6193) SHA1(c7c7ae6898ab7177eefb0e525d827666e2af9f7e) ) + ROM_LOAD( "ju06", 0x000000, 0x200000, CRC(9f6f6193) SHA1(c7c7ae6898ab7177eefb0e525d827666e2af9f7e) ) + ROM_LOAD( "ju04", 0x200000, 0x200000, CRC(4f3503d7) SHA1(4bed795c7328e0ebfa97688918eb8a908c29deb8) ) // expand this to take up 0x200000 bytes too so we can decode it ROM_LOAD16_BYTE( "esd5.bin", 0x400000, 0x080000, CRC(6968265a) SHA1(84b4f2d8b3bf6ea4117fa8281c76b58df778261d) ) // JU07 ROM_FILL( 0x500000, 0x100000, 0x00 ) @@ -1286,11 +1613,11 @@ ROM_START( hedpanico ) // Story line & game instructions in English, copyright y ROM_LOAD16_BYTE( "esd1.rom", 0x000001, 0x040000, CRC(4e0682c5) SHA1(f4117f31b6426d7bf126a6c62c489b9347885b42) ) // CU02 ROM_REGION( 0x40000, "audiocpu", 0 ) // Z80 Code - ROM_LOAD( "esd3.su06", 0x00000, 0x40000, CRC(a88d4424) SHA1(eefb5ac79632931a36f360713c482cd079891f91) ) // AT27C020 mask rom + ROM_LOAD( "esd3.su06", 0x00000, 0x40000, CRC(a88d4424) SHA1(eefb5ac79632931a36f360713c482cd079891f91) ) // AT27C020 mask ROM ROM_REGION( 0x600000, "spr", 0 ) // Sprites, 16x16x5 - ROM_LOAD( "sm1.ju01", 0x000000, 0x200000, CRC(8083813f) SHA1(9492e7e844e45d59f0506f69d40c338b27bd3ce3) ) - ROM_LOAD( "sm2.ju02", 0x200000, 0x200000, CRC(7a9610e4) SHA1(21ae3ec3fbddfc66416c109b091bd885d5ba0558) ) + ROM_LOAD( "sm1.ju01", 0x000000, 0x200000, CRC(8083813f) SHA1(9492e7e844e45d59f0506f69d40c338b27bd3ce3) ) + ROM_LOAD( "sm2.ju02", 0x200000, 0x200000, CRC(7a9610e4) SHA1(21ae3ec3fbddfc66416c109b091bd885d5ba0558) ) // expand this to take up 0x200000 bytes too so we can decode it ROM_LOAD16_BYTE( "esd5.rom", 0x400000, 0x080000, CRC(82c5727f) SHA1(017f1d0c94475c51d17f12e24895f47a273a2dbb) ) // JU07 ROM_FILL( 0x500000, 0x100000, 0x00 ) @@ -1316,8 +1643,8 @@ ROM_START( hedpanic830 ) // Story line & game instructions in English ROM_LOAD( "esd3.su06", 0x00000, 0x40000, BAD_DUMP CRC(a88d4424) SHA1(eefb5ac79632931a36f360713c482cd079891f91) ) ROM_REGION( 0x600000, "spr", 0 ) // Sprites, 16x16x5 - ROM_LOAD( "esd6.ju01", 0x200000, 0x200000, CRC(ffa6eb26) SHA1(c2e3371925604db0f46991cbfd39d763518ed89c) ) - ROM_LOAD( "esd7.ju02", 0x000000, 0x200000, CRC(5554ba0f) SHA1(6d02fa6d0712aa820231a24ee7a8396cc575e788) ) + ROM_LOAD( "esd7.ju02", 0x000000, 0x200000, CRC(5554ba0f) SHA1(6d02fa6d0712aa820231a24ee7a8396cc575e788) ) + ROM_LOAD( "esd6.ju01", 0x200000, 0x200000, CRC(ffa6eb26) SHA1(c2e3371925604db0f46991cbfd39d763518ed89c) ) // expand this to take up 0x200000 bytes too so we can decode it ROM_LOAD16_BYTE( "esd5.ju07", 0x400000, 0x080000, CRC(95269b3c) SHA1(df106d9e8d4c1484ff86170adcb1932d4d02f265) ) ROM_FILL( 0x500000, 0x100000, 0x00 ) @@ -1391,21 +1718,21 @@ ROM_START( deluxe5 ) // Deluxe 5 ROM_LOAD16_BYTE( "esd1.cu03", 0x000001, 0x040000, CRC(15d6644f) SHA1(cfb8168167389855f906658511d1dc7460e13100) ) // M27C2001 EPROM ROM_REGION( 0x40000, "audiocpu", 0 ) // Z80 Code - ROM_LOAD( "esd3.su06", 0x00000, 0x40000, CRC(31de379a) SHA1(a0c9a9cec7207cc4ba33abb68bef62d7eb8e75e9) ) // AM27C020 mask rom + ROM_LOAD( "esd3.su06", 0x00000, 0x40000, CRC(31de379a) SHA1(a0c9a9cec7207cc4ba33abb68bef62d7eb8e75e9) ) // AM27C020 mask ROM ROM_REGION( 0x180000, "spr", 0 ) // Sprites, 16x16x5 - ROM_LOAD16_BYTE( "am27c020.ju06", 0x000000, 0x040000, CRC(8b853bce) SHA1(fa6e654fc965d88bb426b76cdce3417f357b25f3) ) // AM27C020 mask roms with no label + ROM_LOAD16_BYTE( "am27c020.ju06", 0x000000, 0x040000, CRC(8b853bce) SHA1(fa6e654fc965d88bb426b76cdce3417f357b25f3) ) // AM27C020 mask ROMs with no label ROM_LOAD16_BYTE( "am27c020.ju05", 0x000001, 0x040000, CRC(bbe81779) SHA1(750387fb4aaa04b7f4f1d3985896f5e11219e3ea) ) ROM_LOAD16_BYTE( "am27c020.ju04", 0x080000, 0x040000, CRC(40fa2c2f) SHA1(b9d9bfdc9343f00bad9749c76472f064c509cfce) ) ROM_LOAD16_BYTE( "am27c020.ju03", 0x080001, 0x040000, CRC(aa130fd3) SHA1(46a55d8ca59a52e610600fdba76d9729528d2871) ) ROM_LOAD16_BYTE( "am27c020.ju07", 0x100000, 0x040000, CRC(d414c3af) SHA1(9299b07a8c7a3e30a1bb6028204a049a7cb510f7) ) ROM_REGION( 0x400000, "bgs", 0 ) // Layers, 16x16x8 - ROM_LOAD32_WORD( "fu35", 0x000000, 0x200000, CRC(ae10242a) SHA1(f3d18c0cb7951b5f7ee47aa2856b7554088328ed) ) // No labels on the flash roms - ROM_LOAD32_WORD( "fu34", 0x000002, 0x200000, CRC(248b8c05) SHA1(fe7bcc05ae0dd0a27c6ba4beb4ac155a8f3d7f7e) ) // No labels on the flash roms + ROM_LOAD32_WORD( "fu35", 0x000000, 0x200000, CRC(ae10242a) SHA1(f3d18c0cb7951b5f7ee47aa2856b7554088328ed) ) // No labels on the flash ROMs + ROM_LOAD32_WORD( "fu34", 0x000002, 0x200000, CRC(248b8c05) SHA1(fe7bcc05ae0dd0a27c6ba4beb4ac155a8f3d7f7e) ) // No labels on the flash ROMs ROM_REGION( 0x40000, "oki", 0 ) // Samples - ROM_LOAD( "esd4.su10", 0x00000, 0x20000, CRC(23f2b7d9) SHA1(328c951d14674760df68486841c933bad0d59fe3) ) // AT27C010 mask rom + ROM_LOAD( "esd4.su10", 0x00000, 0x20000, CRC(23f2b7d9) SHA1(328c951d14674760df68486841c933bad0d59fe3) ) // AT27C010 mask ROM ROM_REGION16_BE( 0x80, "eeprom", ROMREGION_ERASE00 ) // factory default settings because game doesn't init them properly otherwise ROM_LOAD16_WORD_SWAP( "eeprom", 0x0000, 0x0080, CRC(4539a8a0) SHA1(b882110b489e61ac5421fbe3551d9ee323b5d86b) ) @@ -1417,21 +1744,21 @@ ROM_START( deluxe5a ) // Deluxe 5 ROM_LOAD16_BYTE( "esd1.cu03", 0x000001, 0x040000, CRC(24f4d7b9) SHA1(bb0eabdd72a475149d6df768d9d29b545f061e54) ) // sldh ROM_REGION( 0x40000, "audiocpu", 0 ) // Z80 Code - ROM_LOAD( "esd3.su06", 0x00000, 0x40000, CRC(31de379a) SHA1(a0c9a9cec7207cc4ba33abb68bef62d7eb8e75e9) ) // AM27C020 mask rom + ROM_LOAD( "esd3.su06", 0x00000, 0x40000, CRC(31de379a) SHA1(a0c9a9cec7207cc4ba33abb68bef62d7eb8e75e9) ) // AM27C020 mask ROM ROM_REGION( 0x180000, "spr", 0 ) // Sprites, 16x16x5 - ROM_LOAD16_BYTE( "am27c020.ju06", 0x000000, 0x040000, CRC(8b853bce) SHA1(fa6e654fc965d88bb426b76cdce3417f357b25f3) ) // AM27C020 mask roms with no label + ROM_LOAD16_BYTE( "am27c020.ju06", 0x000000, 0x040000, CRC(8b853bce) SHA1(fa6e654fc965d88bb426b76cdce3417f357b25f3) ) // AM27C020 mask ROMs with no label ROM_LOAD16_BYTE( "am27c020.ju05", 0x000001, 0x040000, CRC(bbe81779) SHA1(750387fb4aaa04b7f4f1d3985896f5e11219e3ea) ) ROM_LOAD16_BYTE( "am27c020.ju04", 0x080000, 0x040000, CRC(40fa2c2f) SHA1(b9d9bfdc9343f00bad9749c76472f064c509cfce) ) ROM_LOAD16_BYTE( "am27c020.ju03", 0x080001, 0x040000, CRC(aa130fd3) SHA1(46a55d8ca59a52e610600fdba76d9729528d2871) ) ROM_LOAD16_BYTE( "am27c020.ju07", 0x100000, 0x040000, CRC(d414c3af) SHA1(9299b07a8c7a3e30a1bb6028204a049a7cb510f7) ) ROM_REGION( 0x400000, "bgs", 0 ) // Layers, 16x16x8 - ROM_LOAD32_WORD( "fu35", 0x000000, 0x200000, CRC(ae10242a) SHA1(f3d18c0cb7951b5f7ee47aa2856b7554088328ed) ) // No labels on the flash roms - ROM_LOAD32_WORD( "fu34", 0x000002, 0x200000, CRC(248b8c05) SHA1(fe7bcc05ae0dd0a27c6ba4beb4ac155a8f3d7f7e) ) // No labels on the flash roms + ROM_LOAD32_WORD( "fu35", 0x000000, 0x200000, CRC(ae10242a) SHA1(f3d18c0cb7951b5f7ee47aa2856b7554088328ed) ) // No labels on the flash ROMs + ROM_LOAD32_WORD( "fu34", 0x000002, 0x200000, CRC(248b8c05) SHA1(fe7bcc05ae0dd0a27c6ba4beb4ac155a8f3d7f7e) ) // No labels on the flash ROMs ROM_REGION( 0x40000, "oki", 0 ) // Samples - ROM_LOAD( "esd4.su10", 0x00000, 0x20000, CRC(23f2b7d9) SHA1(328c951d14674760df68486841c933bad0d59fe3) ) // AT27C010 mask rom + ROM_LOAD( "esd4.su10", 0x00000, 0x20000, CRC(23f2b7d9) SHA1(328c951d14674760df68486841c933bad0d59fe3) ) // AT27C010 mask ROM ROM_REGION16_BE( 0x80, "eeprom", ROMREGION_ERASE00 ) // factory default settings because game doesn't init them properly otherwise ROM_LOAD16_WORD_SWAP( "eeprom", 0x0000, 0x0080, CRC(4539a8a0) SHA1(b882110b489e61ac5421fbe3551d9ee323b5d86b) ) @@ -1443,21 +1770,21 @@ ROM_START( deluxe5b ) // Deluxe 5 ROM_LOAD16_BYTE( "esd1.cu03", 0x000001, 0x040000, CRC(7cc119c8) SHA1(4d2d37e815ab3211ff88c2e6584b4eaee1cd202d) ) // sldh ROM_REGION( 0x40000, "audiocpu", 0 ) // Z80 Code - ROM_LOAD( "esd3.su06", 0x00000, 0x40000, CRC(31de379a) SHA1(a0c9a9cec7207cc4ba33abb68bef62d7eb8e75e9) ) // AM27C020 mask rom + ROM_LOAD( "esd3.su06", 0x00000, 0x40000, CRC(31de379a) SHA1(a0c9a9cec7207cc4ba33abb68bef62d7eb8e75e9) ) // AM27C020 mask ROM ROM_REGION( 0x180000, "spr", 0 ) // Sprites, 16x16x5 - ROM_LOAD16_BYTE( "am27c020.ju06", 0x000000, 0x040000, CRC(8b853bce) SHA1(fa6e654fc965d88bb426b76cdce3417f357b25f3) ) // AM27C020 mask roms with no label + ROM_LOAD16_BYTE( "am27c020.ju06", 0x000000, 0x040000, CRC(8b853bce) SHA1(fa6e654fc965d88bb426b76cdce3417f357b25f3) ) // AM27C020 mask ROMs with no label ROM_LOAD16_BYTE( "am27c020.ju05", 0x000001, 0x040000, CRC(bbe81779) SHA1(750387fb4aaa04b7f4f1d3985896f5e11219e3ea) ) ROM_LOAD16_BYTE( "am27c020.ju04", 0x080000, 0x040000, CRC(40fa2c2f) SHA1(b9d9bfdc9343f00bad9749c76472f064c509cfce) ) ROM_LOAD16_BYTE( "am27c020.ju03", 0x080001, 0x040000, CRC(aa130fd3) SHA1(46a55d8ca59a52e610600fdba76d9729528d2871) ) ROM_LOAD16_BYTE( "am27c020.ju07", 0x100000, 0x040000, CRC(d414c3af) SHA1(9299b07a8c7a3e30a1bb6028204a049a7cb510f7) ) ROM_REGION( 0x400000, "bgs", 0 ) // Layers, 16x16x8 - ROM_LOAD32_WORD( "fu35", 0x000000, 0x200000, CRC(ae10242a) SHA1(f3d18c0cb7951b5f7ee47aa2856b7554088328ed) ) // No labels on the flash roms - ROM_LOAD32_WORD( "fu34", 0x000002, 0x200000, CRC(248b8c05) SHA1(fe7bcc05ae0dd0a27c6ba4beb4ac155a8f3d7f7e) ) // No labels on the flash roms + ROM_LOAD32_WORD( "fu35", 0x000000, 0x200000, CRC(ae10242a) SHA1(f3d18c0cb7951b5f7ee47aa2856b7554088328ed) ) // No labels on the flash ROMs + ROM_LOAD32_WORD( "fu34", 0x000002, 0x200000, CRC(248b8c05) SHA1(fe7bcc05ae0dd0a27c6ba4beb4ac155a8f3d7f7e) ) // No labels on the flash ROMs ROM_REGION( 0x40000, "oki", 0 ) // Samples - ROM_LOAD( "esd4.su10", 0x00000, 0x20000, CRC(23f2b7d9) SHA1(328c951d14674760df68486841c933bad0d59fe3) ) // AT27C010 mask rom + ROM_LOAD( "esd4.su10", 0x00000, 0x20000, CRC(23f2b7d9) SHA1(328c951d14674760df68486841c933bad0d59fe3) ) // AT27C010 mask ROM ROM_REGION16_BE( 0x80, "eeprom", ROMREGION_ERASE00 ) // factory default settings because game doesn't init them properly otherwise ROM_LOAD16_WORD_SWAP( "eeprom", 0x0000, 0x0080, CRC(4539a8a0) SHA1(b882110b489e61ac5421fbe3551d9ee323b5d86b) ) @@ -1470,21 +1797,21 @@ ROM_START( deluxe4u ) // Deluxe 4 U - Removes Blackjack game, but otherwise same ROM_LOAD16_BYTE( "1.cu03", 0x000001, 0x040000, CRC(fbf14d74) SHA1(5ff5bf4ff55609452d5b8a49d8658f878541ce60) ) ROM_REGION( 0x40000, "audiocpu", 0 ) // Z80 Code - ROM_LOAD( "esd3.su06", 0x00000, 0x40000, CRC(31de379a) SHA1(a0c9a9cec7207cc4ba33abb68bef62d7eb8e75e9) ) // AM27C020 mask rom + ROM_LOAD( "esd3.su06", 0x00000, 0x40000, CRC(31de379a) SHA1(a0c9a9cec7207cc4ba33abb68bef62d7eb8e75e9) ) // AM27C020 mask ROM ROM_REGION( 0x180000, "spr", 0 ) // Sprites, 16x16x5 - ROM_LOAD16_BYTE( "am27c020.ju06", 0x000000, 0x040000, CRC(8b853bce) SHA1(fa6e654fc965d88bb426b76cdce3417f357b25f3) ) // AM27C020 mask roms with no label + ROM_LOAD16_BYTE( "am27c020.ju06", 0x000000, 0x040000, CRC(8b853bce) SHA1(fa6e654fc965d88bb426b76cdce3417f357b25f3) ) // AM27C020 mask ROMs with no label ROM_LOAD16_BYTE( "am27c020.ju05", 0x000001, 0x040000, CRC(bbe81779) SHA1(750387fb4aaa04b7f4f1d3985896f5e11219e3ea) ) ROM_LOAD16_BYTE( "am27c020.ju04", 0x080000, 0x040000, CRC(40fa2c2f) SHA1(b9d9bfdc9343f00bad9749c76472f064c509cfce) ) ROM_LOAD16_BYTE( "am27c020.ju03", 0x080001, 0x040000, CRC(aa130fd3) SHA1(46a55d8ca59a52e610600fdba76d9729528d2871) ) ROM_LOAD16_BYTE( "am27c020.ju07", 0x100000, 0x040000, CRC(d414c3af) SHA1(9299b07a8c7a3e30a1bb6028204a049a7cb510f7) ) ROM_REGION( 0x400000, "bgs", 0 ) // Layers, 16x16x8 - ROM_LOAD32_WORD( "fu35", 0x000000, 0x200000, CRC(6df14570) SHA1(fa4fc64c984d6a94fe61ec809ec515e840388704) ) // Specific to Deluxe 4 U - No labels on the flash roms - ROM_LOAD32_WORD( "fu34", 0x000002, 0x200000, CRC(93175d6d) SHA1(691832134f43e17bb767dff080b2736288961414) ) // Specific to Deluxe 4 U - No labels on the flash roms + ROM_LOAD32_WORD( "fu35", 0x000000, 0x200000, CRC(6df14570) SHA1(fa4fc64c984d6a94fe61ec809ec515e840388704) ) // Specific to Deluxe 4 U - No labels on the flash ROMs + ROM_LOAD32_WORD( "fu34", 0x000002, 0x200000, CRC(93175d6d) SHA1(691832134f43e17bb767dff080b2736288961414) ) // Specific to Deluxe 4 U - No labels on the flash ROMs ROM_REGION( 0x40000, "oki", 0 ) // Samples - ROM_LOAD( "esd4.su10", 0x00000, 0x20000, CRC(23f2b7d9) SHA1(328c951d14674760df68486841c933bad0d59fe3) ) // AT27C010 mask rom + ROM_LOAD( "esd4.su10", 0x00000, 0x20000, CRC(23f2b7d9) SHA1(328c951d14674760df68486841c933bad0d59fe3) ) // AT27C010 mask ROM ROM_REGION16_BE( 0x80, "eeprom", ROMREGION_ERASE00 ) // factory default settings because game doesn't init them properly otherwise ROM_LOAD16_WORD_SWAP( "eeprom", 0x0000, 0x0080, CRC(4539a8a0) SHA1(b882110b489e61ac5421fbe3551d9ee323b5d86b) ) @@ -1626,7 +1953,7 @@ ROM_START( swatpolc ) // SWAT Police ROM_LOAD16_BYTE( "esd.cu03", 0x000001, 0x040000, CRC(1070208b) SHA1(1e058774c5aee1de15ffcd26d530b23592286db1) ) // ESD labels but not numbered ROM_REGION( 0x40000, "audiocpu", 0 ) // Z80 Code - ROM_LOAD( "esd3.su06", 0x00000, 0x40000, CRC(80e97dbe) SHA1(d6fae689cd3737777f36c980b9a7d9e42b06a467) ) // 2 roms on PCB with an ESD3 label + ROM_LOAD( "esd3.su06", 0x00000, 0x40000, CRC(80e97dbe) SHA1(d6fae689cd3737777f36c980b9a7d9e42b06a467) ) // 2 ROMs on PCB with an ESD3 label ROM_REGION( 0x300000, "spr", 0 ) // Sprites, 16x16x5 ROM_LOAD16_BYTE( "esd4.ju06", 0x000000, 0x080000, CRC(bde1b130) SHA1(e45a2257f8c4d107dfb7401b5ae1b79951052bc6) ) @@ -1636,11 +1963,11 @@ ROM_START( swatpolc ) // SWAT Police ROM_LOAD16_BYTE( "esd5.ju07", 0x200000, 0x080000, CRC(d2c27f03) SHA1(7cbdf7f7ff17df16ca81823f69e82ae1cf96b714) ) ROM_REGION( 0x400000, "bgs", 0 ) // Layers, 16x16x8 - ROM_LOAD32_WORD( "fu35", 0x000000, 0x200000, CRC(c55897c5) SHA1(f6e0ef1c2fcfe6a511fe787a3abeff4da16d1b54) ) // No labels on the flash roms - ROM_LOAD32_WORD( "fu34", 0x000002, 0x200000, CRC(7117a6a2) SHA1(17c0ab02698cffa0582ed2d2b7dbb7fed8cd9393) ) // No labels on the flash roms + ROM_LOAD32_WORD( "fu35", 0x000000, 0x200000, CRC(c55897c5) SHA1(f6e0ef1c2fcfe6a511fe787a3abeff4da16d1b54) ) // No labels on the flash ROMs + ROM_LOAD32_WORD( "fu34", 0x000002, 0x200000, CRC(7117a6a2) SHA1(17c0ab02698cffa0582ed2d2b7dbb7fed8cd9393) ) // No labels on the flash ROMs ROM_REGION( 0x40000, "oki", 0 ) // Samples - ROM_LOAD( "at27c020.su10", 0x00000, 0x40000, CRC(c43efec2) SHA1(4ef328d8703b81328de09ecc4328763aba06e883) ) // AT27C020 mask rom with no label + ROM_LOAD( "at27c020.su10", 0x00000, 0x40000, CRC(c43efec2) SHA1(4ef328d8703b81328de09ecc4328763aba06e883) ) // AT27C020 mask ROM with no label ROM_END @@ -1823,6 +2150,9 @@ ROM_START( fantstrya ) // PCB marked: PNXND-MULTI 2002 01 01 - Only EPROMs dumpe ROM_LOAD16_BYTE( "graphics_rom_1", 0x200000, 0x080000, CRC(c8caa752) SHA1(cecc7a18a0bb59554316ed24ed0dc01d58d6ae53) ) // 1bpp, 27c040 ROM_END +} // anonymous namespace + + /*************************************************************************** @@ -1832,13 +2162,16 @@ ROM_END ***************************************************************************/ // ESD 11-09-98 -GAME( 1999, multchmp, 0, esd16, multchmp, esd16_state, empty_init, ROT0, "ESD", "Multi Champ (World, ver. 2.5)", MACHINE_SUPPORTS_SAVE ) +GAME( 1999, multchmp25, multchmp, esd16, multchmp, esd16_state, empty_init, ROT0, "ESD", "Multi Champ (World, ver. 2.5)", MACHINE_SUPPORTS_SAVE ) GAME( 1998, multchmpk, multchmp, esd16, multchmp, esd16_state, empty_init, ROT0, "ESD", "Multi Champ (Korea, older)", MACHINE_SUPPORTS_SAVE ) GAME( 1998, multchmpa, multchmp, esd16, multchmp, esd16_state, empty_init, ROT0, "ESD", "Multi Champ (World, older)", MACHINE_SUPPORTS_SAVE ) GAME( 2001, jumppop, 0, jumppop, jumppop, esd16_state, empty_init, ROT0, "ESD", "Jumping Pop (set 1)", MACHINE_SUPPORTS_SAVE ) GAME( 2001, jumppope, jumppop, jumppop, jumppop, esd16_state, empty_init, ROT0, "Emag Soft", "Jumping Pop (set 2)", MACHINE_SUPPORTS_SAVE ) +// ESD 05-17-99 +GAME( 1999, multchmp, 0, esd16, multchmp, esd16_state, empty_init, ROT0, "ESD", "Multi Champ (World, ver. 9.6)", MACHINE_SUPPORTS_SAVE ) + // ESD 05-28-99 GAME( 1999, hedpanico, hedpanic, hedpanio, hedpanic, esd16_state, empty_init, ROT0, "ESD", "Head Panic (ver. 0615, 15/06/1999)", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/misc/esd16.h b/src/mame/misc/esd16.h deleted file mode 100644 index b2062d3c1497a..0000000000000 --- a/src/mame/misc/esd16.h +++ /dev/null @@ -1,111 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Luca Elia, David Haywood -/*************************************************************************** - - ESD 16 Bit Games - -***************************************************************************/ -#ifndef MAME_MISC_ESD16_H -#define MAME_MISC_ESD16_H - -#pragma once - -#include "decospr.h" - -#include "machine/eepromser.h" -#include "machine/gen_latch.h" - -#include "tilemap.h" - - -class esd16_state : public driver_device -{ -public: - esd16_state(const machine_config &mconfig, device_type type, const char *tag) : - driver_device(mconfig, type, tag), - m_vram(*this, "vram_%u", 0U), - m_scroll(*this, "scroll_%u", 0U), - m_spriteram(*this, "spriteram"), - m_layersize(*this, "head_layersize"), - m_platform_x(*this, "platform_x"), - m_platform_y(*this, "platform_y"), - m_audiobank(*this, "audiobank"), - m_io_eepromout(*this, "EEPROMOUT"), - m_maincpu(*this, "maincpu"), - m_audiocpu(*this, "audiocpu"), - m_gfxdecode(*this, "gfxdecode"), - m_sprgen(*this, "spritegen"), - m_eeprom(*this, "eeprom"), - m_soundlatch(*this, "soundlatch") - { } - - void jumppop(machine_config &config); - void esd16_nosound(machine_config &config); - void esd16(machine_config &config); - void tangtang(machine_config &config); - void mchampdx(machine_config &config); - void hedpanio(machine_config &config); - void hedpanic(machine_config &config); - void fantstry(machine_config &config); - void fantstrya(machine_config &config); - -protected: - virtual void machine_start() override ATTR_COLD; - virtual void machine_reset() override ATTR_COLD; - virtual void video_start() override ATTR_COLD; - -private: - // memory pointers - required_shared_ptr_array m_vram; - required_shared_ptr_array m_scroll; - required_shared_ptr m_spriteram; - required_shared_ptr m_layersize; - required_shared_ptr m_platform_x; - required_shared_ptr m_platform_y; - - optional_memory_bank m_audiobank; - optional_ioport m_io_eepromout; - - // video-related - tilemap_t *m_tilemap_16x16[2]{}; - tilemap_t *m_tilemap[2]{}; - u32 m_tilemap_color[2]{}; - - // devices - required_device m_maincpu; - optional_device m_audiocpu; - required_device m_gfxdecode; - optional_device m_sprgen; - optional_device m_eeprom; - optional_device m_soundlatch; - - void sound_command_w(u8 data); - void platform_w(u16 data); - u8 eeprom_r(); - void eeprom_w(u8 data); - void sound_rombank_w(u8 data); - template void vram_w(offs_t offset, u16 data, u16 mem_mask = ~0); - void tilemap0_color_w(u16 data); - void tilemap0_color_jumppop_w(u16 data); - template TILE_GET_INFO_MEMBER(get_tile_info); - template TILE_GET_INFO_MEMBER(get_tile_info_16x16); - u32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - DECOSPR_PRIORITY_CB_MEMBER(pri_callback); - void fantstrya_map(address_map &map) ATTR_COLD; - void hedpanic_map(address_map &map) ATTR_COLD; - void jumppop_map(address_map &map) ATTR_COLD; - void mchampdx_map(address_map &map) ATTR_COLD; - void multchmp_map(address_map &map) ATTR_COLD; - void sound_io_map(address_map &map) ATTR_COLD; - void sound_map(address_map &map) ATTR_COLD; - void tangtang_map(address_map &map) ATTR_COLD; - - void io_area_dsw(address_map &map, u32 base) ATTR_COLD; - void io_area_eeprom(address_map &map, u32 base) ATTR_COLD; - void palette_area(address_map &map, u32 base) ATTR_COLD; - void sprite_area(address_map &map, u32 base) ATTR_COLD; - void vid_attr_area(address_map &map, u32 base) ATTR_COLD; - void vram_area(address_map &map, u32 base) ATTR_COLD; -}; - -#endif // MAME_MISC_ESD16_H diff --git a/src/mame/misc/esd16_v.cpp b/src/mame/misc/esd16_v.cpp deleted file mode 100644 index 910e1af686db0..0000000000000 --- a/src/mame/misc/esd16_v.cpp +++ /dev/null @@ -1,197 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Luca Elia, David Haywood -/*************************************************************************** - - -= ESD 16 Bit Games =- - - driver by Luca Elia (l.elia@tin.it) - - -Note: if MAME_DEBUG is defined, pressing Z with: - - Q / W Shows Layer 0 / 1 - A Shows Sprites - - Keys can be used together! - - - [ 2 Scrolling Layers ] - - Tile Size: 8 x 8 x 8 - Color Codes: 1 per Layer (banked for Layer 0) - Layer Size (tiles) : 128 x 64 - Layer Size (pixels): 1024 x 512 - - [ 256 Sprites ] - - Sprites are made of 16 x 16 x 5 tiles. Size can vary from 1 to - 8 tiles vertically, while their width is always 1 tile. - - [ Priorities ] - - The game only uses this scheme: - - Back -> Front: Layer 0, Layer 1, Sprites - -***************************************************************************/ - -#include "emu.h" -#include "esd16.h" -#include "screen.h" - - -/*************************************************************************** - - Tilemaps - - Offset: Bits: Value: - - 0.w Code - - Color code: layer 0 (backmost) can bank at every 256 colors, - layer 1 uses the first 256. - -***************************************************************************/ - -template -TILE_GET_INFO_MEMBER(esd16_state::get_tile_info) -{ - const u16 code = m_vram[Layer][tile_index]; - tileinfo.set(0, - code, - m_tilemap_color[Layer], - 0); -} - -template -TILE_GET_INFO_MEMBER(esd16_state::get_tile_info_16x16) -{ - const u16 code = m_vram[Layer][tile_index]; - tileinfo.set(1, - code, - m_tilemap_color[Layer], - 0); -} - - -void esd16_state::tilemap0_color_w(u16 data) -{ - m_tilemap_color[0] = data & 0x03; - m_tilemap[0]->mark_all_dirty(); - m_tilemap_16x16[0]->mark_all_dirty(); - - bool const flip = BIT(data, 7); - flip_screen_set(flip); - m_sprgen->set_flip_screen(flip); -} - -void esd16_state::tilemap0_color_jumppop_w(u16 data) -{ - // todo - m_tilemap_color[0] = 2; - m_tilemap_color[1] = 1; - - bool const flip = BIT(data, 7); - flip_screen_set(flip); - m_sprgen->set_flip_screen(flip); -} - - -/*************************************************************************** - - - Video Hardware Init - - -***************************************************************************/ - - -void esd16_state::video_start() -{ - m_tilemap[0] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(esd16_state::get_tile_info<0>)), TILEMAP_SCAN_ROWS, 8, 8, 0x80, 0x40); - m_tilemap[1] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(esd16_state::get_tile_info<1>)), TILEMAP_SCAN_ROWS, 8, 8, 0x80, 0x40); - - // swatpolc changes tilemap 0 to 16x16 at various times - m_tilemap_16x16[0] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(esd16_state::get_tile_info_16x16<0>)), TILEMAP_SCAN_ROWS, 16,16, 0x40, 0x40); - - // hedpanic changes tilemap 1 to 16x16 at various times - m_tilemap_16x16[1] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(esd16_state::get_tile_info_16x16<1>)), TILEMAP_SCAN_ROWS, 16,16, 0x40, 0x40); - - m_tilemap[0]->set_scrolldx(-0x60 + 2, -0x60); - m_tilemap[1]->set_scrolldx(-0x60, -0x60 + 2); - m_tilemap_16x16[0]->set_scrolldx(-0x60 + 2, -0x60); - m_tilemap_16x16[1]->set_scrolldx(-0x60, -0x60 + 2); - - m_tilemap[1]->set_transparent_pen(0x00); - m_tilemap_16x16[1]->set_transparent_pen(0x00); -} - - -/*************************************************************************** - - - Screen Drawing - - -***************************************************************************/ - -u32 esd16_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) -{ - int layers_ctrl = -1; - - screen.priority().fill(0, cliprect); - -#ifdef MAME_DEBUG -if (machine().input().code_pressed(KEYCODE_Z)) -{ - int msk = 0; - if (machine().input().code_pressed(KEYCODE_Q)) msk |= 1; - if (machine().input().code_pressed(KEYCODE_W)) msk |= 2; - if (machine().input().code_pressed(KEYCODE_A)) msk |= 4; - if (msk != 0) layers_ctrl &= msk; -} -#endif - - if (layers_ctrl & 1) - { - if (m_layersize[0] & 0x0001) - { - m_tilemap_16x16[0]->set_scrollx(0, m_scroll[0][0]); - m_tilemap_16x16[0]->set_scrolly(0, m_scroll[0][1]); - m_tilemap_16x16[0]->draw(screen, bitmap, cliprect, 0, 0); - } - else - { - m_tilemap[0]->set_scrollx(0, m_scroll[0][0]); - m_tilemap[0]->set_scrolly(0, m_scroll[0][1]); - m_tilemap[0]->draw(screen, bitmap, cliprect, 0, 0); - } - } - else - { - bitmap.fill(0, cliprect); - } - - - if (layers_ctrl & 2) - { - if (m_layersize[0] & 0x0002) - { - m_tilemap_16x16[1]->set_scrollx(0, m_scroll[1][0]); - m_tilemap_16x16[1]->set_scrolly(0, m_scroll[1][1]); - m_tilemap_16x16[1]->draw(screen, bitmap, cliprect, 0, 1); - } - else - { - m_tilemap[1]->set_scrollx(0, m_scroll[1][0]); - m_tilemap[1]->set_scrolly(0, m_scroll[1][1]); - m_tilemap[1]->draw(screen, bitmap, cliprect, 0, 1); - } - - } - - if (layers_ctrl & 4) m_sprgen->draw_sprites(bitmap, cliprect, m_spriteram, 0x400); - -// popmessage("%04x %04x %04x %04x %04x",head_unknown1[0],head_layersize[0],head_unknown3[0],head_unknown4[0],head_unknown5[0]); - return 0; -} diff --git a/src/mame/misc/gms.cpp b/src/mame/misc/gms.cpp index ef821d96b991b..8083bf538275e 100644 --- a/src/mame/misc/gms.cpp +++ b/src/mame/misc/gms.cpp @@ -75,8 +75,8 @@ Hold service credit (9) and reset (F3) to enter service mode. - hookup lamps and do layouts - keyboard inputs for mahjong games - use real values for reel tilemaps offsets instead of hardcoded ones (would fix magslot) -- complete inputs for baile, yyhm, jinpaish (needs someone who understands Chinese and - knows how to play) +- complete inputs for baile, yyhm, jinpaish, ssanguoj, cjdlz (needs someone who understands + Chinese and knows how to play) - game logic in baile seems broken (you always win), maybe due to the patches? - broken title GFX in yyhm (transparent pen problem?) - the newer games seem to use range 0x9e1000-0x9e1fff during gameplay @@ -141,7 +141,9 @@ class gms_2layers_state : public driver_device void super555(machine_config &config) ATTR_COLD; void init_ballch() ATTR_COLD; + void init_cjdlz() ATTR_COLD; void init_cots() ATTR_COLD; + void init_hgly() ATTR_COLD; void init_rbspm() ATTR_COLD; void init_sball2k1() ATTR_COLD; void init_ssanguoj() ATTR_COLD; @@ -253,8 +255,7 @@ void gms_2layers_state::tilebank_w(uint16_t data) // x // unknown (set during most screens in the mahjong games and in sc2in1' title screen) // x // priority between 1st and 2nd tilemaps // x // bank 1st tilemap - // x // 1st tilemap enable (probably) - // xx // bank 2nd tilemap + // xxx // bank 2nd tilemap // x // 2nd tilemap enable (probably) if (m_tilebank & 0xf1c0) @@ -1093,8 +1094,8 @@ static INPUT_PORTS_START( sscs ) PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME( "Open card" ) PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME( "1 key" ) // also used for up in the 'secret' test mode PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON6 ) // used for down in the 'secret' test mode - PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) + PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_GAMBLE_BET ) PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME( "Abandon" ) PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME( "Look at the card" ) @@ -1312,11 +1313,11 @@ static INPUT_PORTS_START( baile ) PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_START1 ) PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME( "Tie Bet" ) - PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_GAMBLE_D_UP ) PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME( "Player Bet" ) PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME( "Banker Bet" ) PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME( "Bet Modifier" ) - PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME( "Flip Card / Show Odds" ) PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_POKER_CANCEL ) PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN ) @@ -1717,6 +1718,384 @@ static INPUT_PORTS_START( sball2k1 ) // default password for accessing game sett PORT_DIPUNKNOWN_DIPLOC( 0x0080, 0x0080, "SW3:8" ) INPUT_PORTS_END +static INPUT_PORTS_START( cjdlz ) // TODO + PORT_START("IN1") // 16bit + PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_SERVICE1 ) + PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_COIN1 ) + PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_START1 ) + PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_MAHJONG_DOUBLE_UP ) + PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) + PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) + PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_BUTTON1 ) + PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_MAHJONG_BET ) + PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_BUTTON2 ) + PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN ) + + PORT_START("IN2") // 16bit + PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) PORT_TOGGLE + PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) PORT_TOGGLE + PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_COIN2 ) + PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", FUNC(eeprom_serial_93cxx_device::do_read)) + + // Only 4 DIP banks are actually populated on PCBs, but test mode reads all 6. + // TODO: dips + PORT_START("DSW1") // 16bit, in test mode first 8 are recognized as dsw1, second 8 as dsw4. + PORT_DIPNAME( 0x0001, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW1:1") + PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0002, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW1:2") + PORT_DIPSETTING( 0x0002, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0004, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW1:3") + PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0008, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW1:4") + PORT_DIPSETTING( 0x0008, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0010, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW1:5") + PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0020, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW1:6") + PORT_DIPSETTING( 0x0020, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0040, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW1:7") + PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0080, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW1:8") + PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0100, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW4:1") + PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0200, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW4:2") + PORT_DIPSETTING( 0x0200, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0400, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW4:3") + PORT_DIPSETTING( 0x0400, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0800, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW4:4") + PORT_DIPSETTING( 0x0800, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x1000, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW4:5") + PORT_DIPSETTING( 0x1000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x2000, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW4:6") + PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x4000, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW4:7") + PORT_DIPSETTING( 0x4000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x8000, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW4:8") + PORT_DIPSETTING( 0x8000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + + + PORT_START("DSW2") // 16bit, in test mode first 8 are recognized as dsw2, second 8 as dsw5 + PORT_DIPNAME( 0x0001, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW2:1") + PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0002, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW2:2") + PORT_DIPSETTING( 0x0002, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0004, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW2:3") + PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0008, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW2:4") + PORT_DIPSETTING( 0x0008, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0010, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW2:5") + PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0020, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW2:6") + PORT_DIPSETTING( 0x0020, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0040, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW2:7") + PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0080, 0x0080, "Controls" ) PORT_DIPLOCATION("DSW2:8") // should default to keyboard, but set on joystick since the former isn't emulated yet + PORT_DIPSETTING( 0x0080, DEF_STR( Joystick ) ) + PORT_DIPSETTING( 0x0000, "Keyboard" ) + PORT_DIPNAME( 0x0100, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW5:1") + PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0200, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW5:2") + PORT_DIPSETTING( 0x0200, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0400, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW5:3") + PORT_DIPSETTING( 0x0400, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0800, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW5:4") + PORT_DIPSETTING( 0x0800, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x1000, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW5:5") + PORT_DIPSETTING( 0x1000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x2000, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW5:6") + PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x4000, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW5:7") + PORT_DIPSETTING( 0x4000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x8000, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW5:8") + PORT_DIPSETTING( 0x8000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + + PORT_START("DSW3") // 16bit, in test mode first 8 are recognized as dsw3, second 8 as dsw6 + PORT_DIPNAME( 0x0001, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW3:1") + PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0002, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW3:2") + PORT_DIPSETTING( 0x0002, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0004, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW3:3") + PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0008, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW3:4") + PORT_DIPSETTING( 0x0008, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0010, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW3:5") + PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0020, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW3:6") + PORT_DIPSETTING( 0x0020, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0040, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW3:7") + PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0080, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW3:8") + PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0100, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW6:1") + PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0200, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW6:2") + PORT_DIPSETTING( 0x0200, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0400, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW6:3") + PORT_DIPSETTING( 0x0400, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0800, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW6:4") + PORT_DIPSETTING( 0x0800, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x1000, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW6:5") + PORT_DIPSETTING( 0x1000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x2000, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW6:6") + PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x4000, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW6:7") + PORT_DIPSETTING( 0x4000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x8000, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW6:8") + PORT_DIPSETTING( 0x8000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) +INPUT_PORTS_END + +static INPUT_PORTS_START( hgly ) + PORT_START("IN1") + PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_SERVICE_NO_TOGGLE(0x02, IP_ACTIVE_LOW) + PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_COIN1 ) + PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_START1 ) // start in test mode + PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_POKER_HOLD2 ) + PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME( "Paytable" ) + PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_POKER_HOLD1 ) + PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_POKER_HOLD3 ) + PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNKNOWN ) // no evident effect + PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME( "Start Slot" ) + PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN ) // no evident effect + PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN ) // no evident effect + PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN ) // no evident effect + PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN ) // no evident effect + PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN ) // no evident effect + PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN ) // no evident effect + + PORT_START("IN2") + PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) + PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) + PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_COIN2 ) + PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN ) + //PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", FUNC(eeprom_serial_93cxx_device::do_read)) // TODO: verify + + // Only 4 DIP banks are actually populated on PCBs but test mode reads all 6. + // TODO: DIPs + PORT_START("DSW1") // 16bit, in test mode first 8 are recognized as dsw1, second 8 as dsw4. + PORT_DIPNAME( 0x0007, 0x0000, "Card Play Rate" ) PORT_DIPLOCATION("DSW1:1,2,3") + PORT_DIPSETTING( 0x0001, "91" ) + PORT_DIPSETTING( 0x0002, "92" ) + PORT_DIPSETTING( 0x0003, "93" ) + PORT_DIPSETTING( 0x0004, "94" ) + PORT_DIPSETTING( 0x0005, "95" ) + PORT_DIPSETTING( 0x0000, "96" ) + PORT_DIPSETTING( 0x0006, "97" ) + PORT_DIPSETTING( 0x0007, "98" ) + PORT_DIPNAME( 0x0008, 0x0000, "Hold Card" ) PORT_DIPLOCATION("DSW1:4") + PORT_DIPSETTING( 0x0008, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0010, 0x0000, "Direct Double Up" ) PORT_DIPLOCATION("DSW1:5") + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0010, DEF_STR( On ) ) + PORT_DIPNAME( 0x0020, 0x0000, "Double Up Option" ) PORT_DIPLOCATION("DSW1:6") + PORT_DIPSETTING( 0x0020, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x00c0, 0x0000, "Double Up Probability" ) PORT_DIPLOCATION("DSW1:7,8") + PORT_DIPSETTING( 0x0040, DEF_STR( Easy ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( Medium ) ) + PORT_DIPSETTING( 0x0080, DEF_STR( Difficult ) ) + PORT_DIPSETTING( 0x00c0, DEF_STR( Very_Difficult ) ) + PORT_DIPNAME( 0x0100, 0x0000, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("DSW4:1") + PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0e00, 0x0000, "Break Taiwan Restrictions" ) PORT_DIPLOCATION("DSW4:2,3,4") // TODO: fishy machine translations + PORT_DIPSETTING( 0x0600, "5000" ) + PORT_DIPSETTING( 0x0800, "10000" ) + PORT_DIPSETTING( 0x0a00, "20000" ) + PORT_DIPSETTING( 0x0000, "30000" ) + PORT_DIPSETTING( 0x0c00, "50000" ) + PORT_DIPSETTING( 0x0e00, "90000" ) + PORT_DIPSETTING( 0x0200, "200000" ) + PORT_DIPSETTING( 0x0400, "500000" ) + PORT_DIPNAME( 0x3000, 0x0000, "Score Limit" ) PORT_DIPLOCATION("DSW4:5,6") + PORT_DIPSETTING( 0x0000, "5000" ) + PORT_DIPSETTING( 0x1000, "10000" ) + PORT_DIPSETTING( 0x2000, "30000" ) + PORT_DIPSETTING( 0x3000, "50000" ) + PORT_DIPNAME( 0x4000, 0x0000, "Double-Up Game Jackpot" ) PORT_DIPLOCATION("DSW4:7") + PORT_DIPSETTING( 0x4000, "10000" ) + PORT_DIPSETTING( 0x0000, "Unlimited" ) + PORT_DIPNAME( 0x8000, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW4:8") // not defined in test mode + PORT_DIPSETTING( 0x8000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + + + PORT_START("DSW2") // 16bit, in test mode first 8 are recognized as dsw2, second 8 as dsw5 + PORT_DIPNAME( 0x0007, 0x0000, "Coin Ratio" ) PORT_DIPLOCATION("DSW2:1,2,3") + PORT_DIPSETTING( 0x0001, "1" ) + PORT_DIPSETTING( 0x0002, "2" ) + PORT_DIPSETTING( 0x0003, "5" ) + PORT_DIPSETTING( 0x0000, "10" ) + PORT_DIPSETTING( 0x0004, "20" ) + PORT_DIPSETTING( 0x0005, "50" ) + PORT_DIPSETTING( 0x0006, "100" ) + PORT_DIPSETTING( 0x0007, "300" ) + PORT_DIPNAME( 0x0018, 0x0000, "Coin x Score Multiplier" ) PORT_DIPLOCATION("DSW2:4,5") + PORT_DIPSETTING( 0x0008, "2" ) + PORT_DIPSETTING( 0x0010, "5" ) + PORT_DIPSETTING( 0x0000, "10" ) + PORT_DIPSETTING( 0x0018, "20" ) + PORT_DIPNAME( 0x0020, 0x0000, "Bonus Minimum Bet" ) PORT_DIPLOCATION("DSW2:6") + PORT_DIPSETTING( 0x0000, "32" ) + PORT_DIPSETTING( 0x0020, "64" ) + PORT_DIPNAME( 0x0040, 0x0000, "Payout Model" ) PORT_DIPLOCATION("DSW2:7") + PORT_DIPSETTING( 0x0040, "Key Out" ) + PORT_DIPSETTING( 0x0000, "Coin" ) + PORT_DIPNAME( 0x0080, 0x0000, "Pool Initial Score" ) PORT_DIPLOCATION("DSW2:8") + PORT_DIPSETTING( 0x0080, "500" ) + PORT_DIPSETTING( 0x0000, "1000" ) + PORT_DIPNAME( 0x0100, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW5:1") + PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0200, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW5:2") + PORT_DIPSETTING( 0x0200, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0400, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW5:3") + PORT_DIPSETTING( 0x0400, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0800, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW5:4") + PORT_DIPSETTING( 0x0800, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x1000, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW5:5") + PORT_DIPSETTING( 0x1000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x2000, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW5:6") + PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x4000, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW5:7") + PORT_DIPSETTING( 0x4000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x8000, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW5:8") + PORT_DIPSETTING( 0x8000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + + PORT_START("DSW3") // 16bit, in test mode first 8 are recognized as dsw3, second 8 as dsw6 + PORT_DIPNAME( 0x0003, 0x0000, "Minimum Bet" ) PORT_DIPLOCATION("DSW3:1,2") // hard-coded + PORT_DIPSETTING( 0x0000, "32" ) + PORT_DIPSETTING( 0x0001, "32 (duplicate)" ) + PORT_DIPSETTING( 0x0002, "32 (duplicate)" ) + PORT_DIPSETTING( 0x0003, "32 (duplicate)" ) + PORT_DIPNAME( 0x000c, 0x0000, "Minimum Bet" ) PORT_DIPLOCATION("DSW3:3,4") // semi hard-coded + PORT_DIPSETTING( 0x0000, "200" ) + PORT_DIPSETTING( 0x0004, "200 (duplicate)" ) + PORT_DIPSETTING( 0x0008, "200 (duplicate)" ) + PORT_DIPSETTING( 0x000c, "360" ) + PORT_DIPNAME( 0x0010, 0x0000, "Bet Every Time" ) PORT_DIPLOCATION("DSW3:5") // hard-coded + PORT_DIPSETTING( 0x0010, "4" ) + PORT_DIPSETTING( 0x0000, "4 (duplicate)" ) + PORT_DIPNAME( 0x0020, 0x0000, "Scoring" ) PORT_DIPLOCATION("DSW3:6") + PORT_DIPSETTING( 0x0020, "Numbers" ) + PORT_DIPSETTING( 0x0000, "Circle Tiles" ) + PORT_DIPNAME( 0x0040, 0x0000, "Controls" ) PORT_DIPLOCATION("DSW3:7") + PORT_DIPSETTING( 0x0000, DEF_STR( Joystick ) ) + PORT_DIPSETTING( 0x0040, "Keyboard" ) + PORT_DIPNAME( 0x0080, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW3:8") // not defined in test mode + PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0100, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW6:1") + PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0200, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW6:2") + PORT_DIPSETTING( 0x0200, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0400, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW6:3") + PORT_DIPSETTING( 0x0400, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0800, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW6:4") + PORT_DIPSETTING( 0x0800, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x1000, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW6:5") + PORT_DIPSETTING( 0x1000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x2000, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW6:6") + PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x4000, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW6:7") + PORT_DIPSETTING( 0x4000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x8000, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW6:8") + PORT_DIPSETTING( 0x8000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) +INPUT_PORTS_END + static const gfx_layout rbmk32_layout = { @@ -1796,7 +2175,7 @@ TILE_GET_INFO_MEMBER(gms_2layers_state::get_reel_tile_info) TILE_GET_INFO_MEMBER(gms_2layers_state::get_tile0_info) { const int tile = m_vidram[0][tile_index]; - tileinfo.set(1, (tile & 0x0fff) + ((m_tilebank >> 1) & 3) * 0x1000, tile >> 12, 0); + tileinfo.set(1, (tile & 0x0fff) + ((m_tilebank >> 1) & 7) * 0x1000, tile >> 12, 0); } TILE_GET_INFO_MEMBER(gms_3layers_state::get_tile1_info) @@ -1820,7 +2199,7 @@ uint32_t gms_2layers_state::screen_update(screen_device &screen, bitmap_ind16 &b for (int j = 0; j < 64; j++) m_reel_tilemap[i]->set_scrolly(j, m_scrolly[i][j]); - if (BIT(m_tilebank, 3) && BIT(m_tilebank, 5)) + if (BIT(m_tilebank, 5)) { for (int i = 3; i >= 0; i--) m_reel_tilemap[i]->set_transparent_pen(0xff); @@ -1833,7 +2212,7 @@ uint32_t gms_2layers_state::screen_update(screen_device &screen, bitmap_ind16 &b if (BIT(m_tilebank, 0)) m_tilemap[0]->draw(screen, bitmap, cliprect); - if (BIT(m_tilebank, 3) && !BIT(m_tilebank, 5)) + if (!BIT(m_tilebank, 5)) { for (int i = 3; i >= 0; i--) m_reel_tilemap[i]->set_transparent_pen(0x00); @@ -1852,7 +2231,7 @@ uint32_t gms_2layers_state::screen_update(screen_device &screen, bitmap_ind16 &b for (int j = 0; j < 64; j++) m_reel_tilemap[3]->set_scrolly(j, m_scrolly[3][j]); - if (BIT(m_tilebank, 3) && BIT(m_tilebank, 5)) + if (BIT(m_tilebank, 5)) { m_reel_tilemap[3]->draw(screen, bitmap, cliprect); m_reel_tilemap[3]->set_transparent_pen(0xff); @@ -1861,7 +2240,7 @@ uint32_t gms_2layers_state::screen_update(screen_device &screen, bitmap_ind16 &b if (BIT(m_tilebank, 0)) m_tilemap[0]->draw(screen, bitmap, cliprect); - if (BIT(m_tilebank, 3) && !BIT(m_tilebank, 5)) + if (!BIT(m_tilebank, 5)) { m_reel_tilemap[3]->draw(screen, bitmap, cliprect); m_reel_tilemap[3]->set_transparent_pen(0x00); @@ -1970,8 +2349,8 @@ ROM_START( rbmk ) ROM_REGION( 0x100000, "gfx1", 0 ) // 8x32 tiles, lots of girls etc. ROM_LOAD( "a1.u41", 0x00000, 0x100000, CRC(1924de6b) SHA1(1a72ee2fd0abca51893f0985a591573bfd429389) ) - ROM_REGION( 0x80000, "gfx2", 0 ) // 8x8 tiles? cards etc - ROM_LOAD( "t1.u39", 0x00000, 0x80000, CRC(adf67429) SHA1(ab03c7f68403545f9e86a069581dc3fc3fa6b9c4) ) + ROM_REGION( 0x100000, "gfx2", ROMREGION_ERASE00 ) // 8x8 tiles? cards etc + ROM_LOAD( "t1.u39", 0x80000, 0x80000, CRC(adf67429) SHA1(ab03c7f68403545f9e86a069581dc3fc3fa6b9c4) ) ROM_REGION16_BE( 0x80, "eeprom", 0 ) ROM_LOAD16_WORD_SWAP( "93c46.u51", 0x00, 0x080, CRC(4ca6ff01) SHA1(66c456eac5b0d1176ef9130baf2e746efdf30152) ) @@ -2004,8 +2383,8 @@ ROM_START( rbspm ) // PCB NO.6899-B ROM_REGION( 0x80000, "gfx1", 0 ) // 8x32 tiles, lots of girls etc. ROM_LOAD( "mj-dfmj-4.2-a1.bin", 0x00000, 0x80000, CRC(b0a3a866) SHA1(cc950532160a066fc6ce427f6df9d58ee4589821) ) - ROM_REGION( 0x80000, "gfx2", 0 ) // 8x8 tiles? cards etc - ROM_LOAD( "mj-dfmj-4.8-t1.bin", 0x00000, 0x80000, CRC(2b8b689d) SHA1(65ab643fac1e734af8b3a86caa06b532baafa0fe) ) + ROM_REGION( 0x100000, "gfx2", ROMREGION_ERASE00 ) // 8x8 tiles? cards etc + ROM_LOAD( "mj-dfmj-4.8-t1.bin", 0x80000, 0x80000, CRC(2b8b689d) SHA1(65ab643fac1e734af8b3a86caa06b532baafa0fe) ) ROM_REGION16_BE( 0x80, "eeprom", 0 ) ROM_LOAD16_WORD_SWAP( "93c46.u51", 0x00, 0x080, NO_DUMP ) @@ -2028,8 +2407,8 @@ ROM_START( ssanguoj ) ROM_REGION( 0x100000, "gfx1", 0 ) ROM_LOAD( "99a-a02_m5042j-a1.u41", 0x000000, 0x100000, CRC(4b0823f4) SHA1(69e5448a9fe06430625c7c407ff4a7fd5b58d445) ) - ROM_REGION( 0x80000, "gfx2", 0 ) - ROM_LOAD( "sgc-t1.u39", 0x00000, 0x80000, CRC(50776a8f) SHA1(141bd23fc237a0e8d31ae0504ea2b9cf39859319) ) + ROM_REGION( 0x100000, "gfx2", ROMREGION_ERASE00 ) + ROM_LOAD( "sgc-t1.u39", 0x80000, 0x80000, CRC(50776a8f) SHA1(141bd23fc237a0e8d31ae0504ea2b9cf39859319) ) ROM_REGION16_BE( 0x80, "eeprom", 0 ) ROM_LOAD16_WORD_SWAP( "93c46.u51", 0x00, 0x080, NO_DUMP ) @@ -2046,8 +2425,8 @@ ROM_START( super555 ) // GMS branded chips: A66, A68, M06 ROM_REGION( 0x80000, "gfx1", 0 ) ROM_LOAD( "pk-a1-a09.u41", 0x00000, 0x80000, CRC(f48e74bd) SHA1(68e2a0384964e04c526e4002ffae5fa4f2835d66) ) - ROM_REGION( 0x80000, "gfx2", 0 ) - ROM_LOAD( "super555-t1-e67d.u39", 0x00000, 0x80000, CRC(ee092a9c) SHA1(4123d45d21ca60b0d38f36f59353c56d4fdfcddf) ) + ROM_REGION( 0x100000, "gfx2", ROMREGION_ERASE00 ) + ROM_LOAD( "super555-t1-e67d.u39", 0x80000, 0x80000, CRC(ee092a9c) SHA1(4123d45d21ca60b0d38f36f59353c56d4fdfcddf) ) ROM_REGION16_BE( 0x80, "eeprom", 0 ) ROM_LOAD16_WORD_SWAP( "93c46.u138", 0x00, 0x080, CRC(60407223) SHA1(10f766b5431709ab11b16bf5ad7adbfdced0e7ac) ) @@ -2064,8 +2443,8 @@ ROM_START( sball2k1 ) // GMS branded chips: A66, A68, no stickers on ROMs ROM_REGION( 0x80000, "gfx1", ROMREGION_ERASE00 ) // not populated - ROM_REGION( 0x20000, "gfx2", 0 ) - ROM_LOAD( "a1.u41", 0x00000, 0x20000, CRC(8567a2f7) SHA1(18f187fb533a23fbb554b941361c9d3b03d1c0ce) ) // D27010 + ROM_REGION( 0x100000, "gfx2", ROMREGION_ERASE00 ) + ROM_LOAD( "a1.u41", 0x80000, 0x20000, CRC(8567a2f7) SHA1(18f187fb533a23fbb554b941361c9d3b03d1c0ce) ) // D27010 ROM_REGION16_BE( 0x80, "eeprom", 0 ) ROM_LOAD16_WORD_SWAP( "93c46.u138", 0x00, 0x080, NO_DUMP ) @@ -2136,8 +2515,7 @@ ROM_START( sscs ) ROM_LOAD( "a1_bj-a1-a06.u41", 0x000000, 0x100000, CRC(f758d95e) SHA1(d1da16f3ef618a8c1118784bdc39dd93acf86aff) ) ROM_REGION( 0x100000, "gfx2", 0 ) - ROM_LOAD( "t1_a11u-t07d.u39", 0x080000, 0x080000, CRC(f0ecbc72) SHA1(536288d21a5720111cb3392c974ee5ccdc4a2c6b) ) - ROM_CONTINUE( 0x000000, 0x080000 ) // TODO: shouldn't be needed but the game doesn't seem to enable tile bank? + ROM_LOAD( "t1_a11u-t07d.u39", 0x000000, 0x100000, CRC(f0ecbc72) SHA1(536288d21a5720111cb3392c974ee5ccdc4a2c6b) ) ROM_REGION16_BE( 0x80, "eeprom", 0 ) ROM_LOAD16_WORD_SWAP( "93c46.u136", 0x00, 0x080, CRC(9ad1b39c) SHA1(2fed7e0918119b2354a9f1944d501dc817ffd5dc) ) @@ -2156,8 +2534,8 @@ ROM_START( sc2in1 ) ROM_REGION( 0x200000, "gfx1", 0 ) ROM_LOAD( "u178", 0x000000, 0x200000, CRC(eaceb446) SHA1(db312f555e060eea6450f506cbbdca8874a05d58) ) - ROM_REGION( 0x40000, "gfx2", 0 ) - ROM_LOAD( "u41", 0x00000, 0x40000, CRC(9ea462f7) SHA1(8cec497691f0121693a482b452ddf7a7dcedaf87) ) + ROM_REGION( 0x100000, "gfx2", ROMREGION_ERASE00 ) + ROM_LOAD( "u41", 0x80000, 0x40000, CRC(9ea462f7) SHA1(8cec497691f0121693a482b452ddf7a7dcedaf87) ) ROM_REGION( 0x80000, "gfx3", 0 ) ROM_LOAD( "u169", 0x00000, 0x80000, CRC(f442fa70) SHA1(d06a84080e0196e1917b6f942adc29f97314be58) ) @@ -2176,8 +2554,8 @@ ROM_START( jinpaish ) // some of the labels were partly unreadable, all labels h ROM_REGION( 0x200000, "gfx1", 0 ) ROM_LOAD( "a1.u178", 0x000000, 0x200000, CRC(eaceb446) SHA1(db312f555e060eea6450f506cbbdca8874a05d58) ) - ROM_REGION( 0x80000, "gfx2", 0 ) - ROM_LOAD( "t1_9269.u39", 0x00000, 0x80000, CRC(b87f62c0) SHA1(108c32271fb4802aec0606ff70d10be4fb0846bd) ) + ROM_REGION( 0x100000, "gfx2", ROMREGION_ERASE00 ) + ROM_LOAD( "t1_9269.u39", 0x80000, 0x80000, CRC(b87f62c0) SHA1(108c32271fb4802aec0606ff70d10be4fb0846bd) ) ROM_REGION( 0x80000, "gfx3", 0 ) ROM_LOAD( "u1_2b6_.u169", 0x00000, 0x80000, CRC(31cdca7c) SHA1(eb60bc85408ecfc40dabac2b11f3d9bfc5467d3e) ) @@ -2193,8 +2571,8 @@ ROM_START( baile ) // all labels have 百乐 before what's reported below ROM_REGION( 0x200000, "gfx1", 0 ) ROM_LOAD( "2005_a1_1a5e.u178", 0x000000, 0x200000, CRC(0e338aeb) SHA1(8c645b0658bbbbd53bab7d769723abe08eee7acd) ) // 1xxxxxxxxxxxxxxxxxxxx = 0xFF - ROM_REGION( 0x80000, "gfx2", 0 ) - ROM_LOAD( "2005_t1_20cb.u39", 0x00000, 0x80000, CRC(bdb9a0d3) SHA1(0e8f675d244e7fe2eada90d02e836afc0e2840ca) ) + ROM_REGION( 0x100000, "gfx2", ROMREGION_ERASE00 ) + ROM_LOAD( "2005_t1_20cb.u39", 0x80000, 0x80000, CRC(bdb9a0d3) SHA1(0e8f675d244e7fe2eada90d02e836afc0e2840ca) ) ROM_REGION( 0x20000, "gfx3", 0 ) ROM_LOAD( "2005_u1_7fe2.u169", 0x00000, 0x20000, CRC(d6216c9d) SHA1(693c6cd44e5d74f372ee3c8e5a0b1bd59f42bf22) ) @@ -2210,8 +2588,8 @@ ROM_START( yyhm ) // some of the labels were partly unreadable, all have 鸳鸯 ROM_REGION( 0x200000, "gfx1", 0 ) ROM_LOAD( "a1_c___.u178", 0x000000, 0x200000, CRC(a8e8aad5) SHA1(7576549fc23d5863d0affc27717492199bda2a6f) ) // 1xxxxxxxxxxxxxxxxxxxx = 0xFF - ROM_REGION( 0x80000, "gfx2", 0 ) - ROM_LOAD( "t1_aabe.u39", 0x00000, 0x80000, CRC(767bc6c3) SHA1(c1ccd6940e00c82278030a2c0875c411f1a0c1af) ) + ROM_REGION( 0x100000, "gfx2", ROMREGION_ERASE00 ) + ROM_LOAD( "t1_aabe.u39", 0x80000, 0x80000, CRC(767bc6c3) SHA1(c1ccd6940e00c82278030a2c0875c411f1a0c1af) ) ROM_REGION( 0x40000, "gfx3", 0 ) ROM_LOAD( "u1_333a.u169", 0x00000, 0x40000, CRC(4ceec182) SHA1(6c43db0ccf8f6c9c4350b072ebe7101cfbb1763f) ) // 1xxxxxxxxxxxxxxxxx = 0xFF @@ -2230,8 +2608,8 @@ ROM_START( magslot ) // All labels have SLOT canceled with a black pen. No sum m ROM_REGION( 0x200000, "gfx1", 0 ) ROM_LOAD( "magic a1.0c _ _ _ _.u178", 0x000000, 0x200000, CRC(11028627) SHA1(80b38acab1cd12462d8fc36a9cdce5e5e76f6403) ) // no sum on label, 1xxxxxxxxxxxxxxxxxx = 0x00 - ROM_REGION( 0x80000, "gfx2", 0 ) - ROM_LOAD( "magic t1.0c ec43.u41", 0x00000, 0x80000, CRC(18df608d) SHA1(753b8090e8fd89e50131a22259ef3280d7e6b282) ) + ROM_REGION( 0x100000, "gfx2", ROMREGION_ERASE00 ) + ROM_LOAD( "magic t1.0c ec43.u41", 0x80000, 0x80000, CRC(18df608d) SHA1(753b8090e8fd89e50131a22259ef3280d7e6b282) ) ROM_REGION( 0x40000, "gfx3", 0 ) ROM_LOAD( "magic u1.0c f7f6.u169", 0x00000, 0x40000, CRC(582631d3) SHA1(92d1b767bc7ef15eed6dad599392c17620210678) ) @@ -2275,8 +2653,8 @@ ROM_START( cots ) ROM_REGION( 0x100000, "gfx1", 0 ) ROM_LOAD( "1_a1_.u41", 0x000000, 0x100000, CRC(0ca98ccd) SHA1(45f4c8a93d387f2790fee46c05597628ff238c2d) ) - ROM_REGION( 0x80000, "gfx2", 0 ) - ROM_LOAD( "2_t1_.u39", 0x00000, 0x80000, CRC(8c85dbc7) SHA1(c860949e5a61a4426b1409cefde9651c1d3a2765) ) + ROM_REGION( 0x100000, "gfx2", ROMREGION_ERASE00 ) + ROM_LOAD( "2_t1_.u39", 0x80000, 0x80000, CRC(8c85dbc7) SHA1(c860949e5a61a4426b1409cefde9651c1d3a2765) ) ROM_END /* @@ -2330,8 +2708,107 @@ ROM_START( ballch ) ROM_REGION( 0x100000, "gfx1", 0 ) ROM_LOAD( "b.challenge_a1_0179.u41", 0x000000, 0x100000, CRC(b3c49a74) SHA1(a828fd007443ee08ece0c4cad80bd4f84471bb49) ) - ROM_REGION( 0x80000, "gfx2", 0 ) - ROM_LOAD( "b.challenge_t1_f4cb.u39", 0x00000, 0x80000, CRC(a401072a) SHA1(f80ed4ef873393c36bb0446445bfb3a45e3efb97) ) + ROM_REGION( 0x100000, "gfx2", ROMREGION_ERASE00 ) + ROM_LOAD( "b.challenge_t1_f4cb.u39", 0x80000, 0x80000, CRC(a401072a) SHA1(f80ed4ef873393c36bb0446445bfb3a45e3efb97) ) +ROM_END + +/* +皇冠樂園 Huáng Guàn Lè Yuán (Crown Amusement Park), GMS, 1999 +超级大连庄 Chāojí Dà Liánzhuāng, GMS, 1999 +Hardware info by Guru +--------------------- + +GMS PCB 98-9-1 for Huang Guan Le Yuan (this layout below) +GMS PCB 98-8-2 for Chao Ji Da Lian Zhuang. 99.9% same board with minor part shuffling. + |---------| |-------------------| +|--| 10WAY |--------| 18WAY |--------------| +|UPC1241H VOL 14.31818MHz| +| S2.U72 |-----| A2.U22 | +| PAL S1.U83 | GMS | A1.U41 | +| M6295 | M06 | | +| |-----| | +| ULN2003 6116 | +|J ULN2003 T518B 6116 | +|A SW1 6116 | +|M 6116 | +|M SW2 6116 | +|A PAL | +| SW3 |-------| | +| |GMS-A69| | +| SW4 |QFP100 | | +| 6116 | | T2.U29 | +| 6116 |-------| | +| T1.U39 | +| 24L257 |-------| | +| 24L257 | GMS | | +| 68000 22MHz |99A-A1 | 93C46 7805 | +| BATT P1.U64 | A66 | | +|-------------------------------|-------|----------------| +Notes: + 68000 - Motorola MC68000FN-10 CPU. Clock 11.0MHz [22/2] + 6116 - 2kB x8-bit SRAM + 24L257 - Winbond W24L257 Low Voltage 32kB x8-bit SRAM (both chips are battery-backed) + M6295 - OKI M6295 4-Channel ADPCM Voice Synthesis LSI. Clock input 1.100MHz [22/20]. Pin 7 HIGH + GMSM06 - 89C51 microcontroller (or some variant of it) rebadged 'GMS M06'. + Clock input 14.31818MHz on pins 20 and 21 (clock pins match 89C51/89C52/8751/8051) + Note game is fully playable without this chip so maybe it's being used for payout or similar functions? + 93C46 - 93C46 EEPROM. The DI / DO pins are connected to custom chip GMS-99A-A1 A66 + ULN2003 - ULN2003 7-Channel Darlington Transistor Array + T518B - Mitsumi PST518B Master Reset IC (TO92) + SW1-4 - 8-position DIP Switch + uPC1241H - NEC uPC1241H Audio Power Amp + 7805 - LM7805 5V Linear Regulator + BATT - 3.6V Ni-Cad Battery. Maintains power to both 24L257 RAMs when main power supply is off. + Note there is a position for a memory reset switch but it's not populated. + P1 - 27C4096 (Main PRG) + A1/A2/T1/T2 - 27C020/27C040 or 2M/4M mask ROM (GFX) + S1 - 27C040 or 4M mask ROM (OKI samples) + S2 - Not populated + A2 - Not populated on Chao Ji Da Lian Zhuang + T2 - Not populated on Huang Guan Le Yuan + GMS-A69 - Custom graphics chip (QFP100) + On Huang Guan Le Yuan this is GMS-A68 (PLCC84) + GMS-99A - PLCC44 custom chip. Seems to be different for each GMS game that uses this chip and is likely + to be a microcontroller with internal ROM. When identically marked chips are swapped between + these two games the POST reports an error with this chip. When the chip is swapped back to + the correct board it works fine. The same chip was also swapped from San Se Caishen and also + shows this chip with a POST error. This has been verified not to be an 8x51 or MX10EXA. +*/ + +ROM_START( hgly ) + ROM_REGION( 0x80000, "maincpu", 0 ) // 68000 code + ROM_LOAD( "p1.u64", 0x00000, 0x80000, CRC(047c59f8) SHA1(f0dd39add2d28e80628e621c8c7053bde312ccd5) ) // 1xxxxxxxxxxxxxxxxxx = 0x00 + + ROM_REGION( 0x080000, "oki", 0 ) + ROM_LOAD( "s1.u83", 0x00000, 0x80000, CRC(980ef3a3) SHA1(bf75e693ed25aa3ff704409491be7a399f7a9e08) ) + + ROM_REGION( 0x100000, "gfx1", 0 ) + ROM_LOAD( "a1.u41", 0x00000, 0x80000, CRC(179e85d6) SHA1(5224aced4769f1c7e43512650e5b67cc26210abe) ) + ROM_LOAD( "a2.u22", 0x80000, 0x80000, CRC(34f4449b) SHA1(797233bb9e8dcda7c07401414a3ed7f8a564e985) ) + + ROM_REGION( 0x100000, "gfx2", ROMREGION_ERASE00 ) + ROM_LOAD( "t1.u39", 0x80000, 0x80000, CRC(272945c8) SHA1(89db8e23c58b185c1b4e44f74bcfef9b8c0baa04) ) + + ROM_REGION16_BE( 0x80, "eeprom", 0 ) + ROM_LOAD16_WORD_SWAP( "93c46.u136", 0x00, 0x080, CRC(7372eba5) SHA1(2ccaa4e4ffb8f3ff38f75f286e0ff8dc595a1541) ) +ROM_END + +ROM_START( cjdlz ) + ROM_REGION( 0x80000, "maincpu", 0 ) // 68000 code + ROM_LOAD( "p1.u64", 0x00000, 0x80000, CRC(e3379fff) SHA1(913bdb0f8bc2545bcd94a5738ec9190d55485961) ) + + ROM_REGION( 0x080000, "oki", 0 ) + ROM_LOAD( "mj-s1-s03.u83", 0x00000, 0x80000, CRC(27cf4e44) SHA1(ee7f3fbc0c9cc777cc4f5ef730c30b952ad61fbf) ) + + ROM_REGION( 0x100000, "gfx1", 0 ) + ROM_LOAD( "mj-a1-a07.u41", 0x000000, 0x100000, CRC(868a9599) SHA1(53fc6d0169ee83e7f911f64b447e4fe7c9fe1f9d) ) + + ROM_REGION( 0x100000, "gfx2", ROMREGION_ERASE00) + ROM_LOAD( "t2.u29", 0x00000, 0x40000, CRC(a7417ce3) SHA1(fb2a789169149f22af62d0c73cd2d652c7005f3e) ) + ROM_LOAD( "rmj-t1-t05.u39", 0x80000, 0x80000, CRC(30638e20) SHA1(8082b7616ef759823be4265e902b503d15916197) ) + + ROM_REGION16_BE( 0x80, "eeprom", 0 ) + ROM_LOAD16_WORD_SWAP( "93c46.u136", 0x00, 0x080, CRC(28d0db8c) SHA1(fb214d10f1c3a1f2e38cb22c620dcc314896ee54) ) ROM_END @@ -2487,6 +2964,29 @@ void gms_2layers_state::init_sscs() rom[0x19c1a / 2] = 0x6000; // U85 ERROR } +void gms_2layers_state::init_cjdlz() +{ + uint16_t *rom = (uint16_t *)memregion("maincpu")->base(); + + + rom[0x00518 / 2] = 0x4e71; // 0xD REPAIR + rom[0x0c628 / 2] = 0x6000; // 0x99 REPAIR + rom[0x0c8e6 / 2] = 0x4e71; // loop + rom[0x0ca00 / 2] = 0x6000; // 0xA REPAIR + rom[0x0ca24 / 2] = 0x4e71; // 0xE REPAIR + rom[0x38664 / 2] = 0x6000; // 0xD REPAIR + rom[0x38980 / 2] = 0x6000; // 0xD REPAIR +} + +void gms_2layers_state::init_hgly() +{ + uint16_t *rom = (uint16_t *)memregion("maincpu")->base(); + + rom[0x0feda / 2] = 0x6004; // U35 ERROR + rom[0x10128 / 2] = 0x6004; // U36 ERROR + rom[0x1393e / 2] = 0x6000; // U64 ERROR +} + } // anonymous namespace @@ -2494,6 +2994,7 @@ void gms_2layers_state::init_sscs() GAME( 1998, rbmk, 0, rbmk, rbmk, gms_2layers_state, empty_init, ROT0, "GMS", "Shizhan Majiang Wang (Version 8.8)", MACHINE_IMPERFECT_SOUND | MACHINE_NOT_WORKING ) // misses YM2151 hookup GAME( 1998, rbspm, 0, rbspm, rbspm, gms_2layers_state, init_rbspm, ROT0, "GMS", "Shizhan Ding Huang Maque (Version 4.1)", MACHINE_UNEMULATED_PROTECTION | MACHINE_IMPERFECT_SOUND | MACHINE_NOT_WORKING ) // stops during boot, patched for now. Misses YM2151 hookup GAME( 1998, ssanguoj, 0, ssanguoj, ssanguoj, gms_2layers_state, init_ssanguoj, ROT0, "GMS", "Shizhan Sanguo Ji Jiaqiang Ban (Version 8.9 980413)", MACHINE_UNEMULATED_PROTECTION | MACHINE_IMPERFECT_SOUND | MACHINE_NOT_WORKING ) // stops during boot, patched for now. YM3812 isn't hooked up (goes through undumped MCU). +GAME( 1999, cjdlz, 0, super555, cjdlz, gms_2layers_state, init_cjdlz, ROT0, "GMS", "Chaoji Da Lianzhuang (Version 1.1)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_UNEMULATED_PROTECTION | MACHINE_NOT_WORKING ) // stops during boot, patched for now. Also needs EEPROM support. GAME( 2005, yyhm, 0, magslot, yyhm, gms_3layers_state, init_yyhm, ROT0, "GMS", "Yuanyang Hudie Meng (Version 8.8A 2005-09-25)", MACHINE_UNEMULATED_PROTECTION | MACHINE_IMPERFECT_SOUND | MACHINE_NOT_WORKING ) // stops during boot, patched for now. Also needs EEPROM support. // card games @@ -2504,9 +3005,10 @@ GAME( 2001, sc2in1, 0, magslot, sc2in1, gms_3layers_state, init_sc2in1, R GAME( 2004, jinpaish, 0, magslot, jinpaish, gms_3layers_state, init_jinpaish, ROT0, "GMS", "Jinpai Suoha - Show Hand (Chinese version 2004-09-22)", MACHINE_UNEMULATED_PROTECTION | MACHINE_NOT_WORKING ) // stops during boot, patched for now. Also needs EEPROM support. Also needs correct controls. GAME( 2005, baile, 0, magslot, baile, gms_3layers_state, init_baile, ROT0, "GMS", "Baile 2005 (V3.2 2005-01-12)", MACHINE_UNEMULATED_PROTECTION | MACHINE_NOT_WORKING ) // stops during boot, patched for now. Also needs EEPROM support. -// slot, on slightly different PCB +// slots GAME( 2003, magslot, 0, magslot, magslot, gms_3layers_state, empty_init, ROT0, "GMS", "Magic Slot (normal 1.0C)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_NOT_WORKING ) // reel / tilemaps priorities are wrong, inputs to be verified. Also needs EEPROM support. // train games +GAME( 1999, hgly, 0, super555, hgly, gms_2layers_state, init_hgly, ROT0, "GMS", "Huang Guan Le Yuan (990726 CRG1.1)", MACHINE_UNEMULATED_PROTECTION | MACHINE_NOT_WORKING ) // stops during boot, patched for now. Also needs EEPROM support. GAME( 2002, ballch, 0, super555, ballch, gms_2layers_state, init_ballch, ROT0, "TVE", "Ball Challenge (20020607 1.0 OVERSEA)", MACHINE_UNEMULATED_PROTECTION | MACHINE_NOT_WORKING ) // stops during boot, patched for now. Also needs EEPROM support. GAME( 2005, cots, 0, super555, cots, gms_2layers_state, init_cots, ROT0, "ECM", "Creatures of the Sea (20050328 USA 6.3)", MACHINE_UNEMULATED_PROTECTION | MACHINE_NOT_WORKING ) // stops during boot, patched for now. Also needs EEPROM support. diff --git a/src/mame/misc/magicfly.cpp b/src/mame/misc/magicfly.cpp index 43f2c14f883c7..3fe4a235eb5a7 100644 --- a/src/mame/misc/magicfly.cpp +++ b/src/mame/misc/magicfly.cpp @@ -1,5 +1,5 @@ // license:BSD-3-Clause -// copyright-holders:Roberto Fresca +// copyright-holders: Roberto Fresca // thanks-to:Iris Falbala, Rob Ragon /****************************************************************************** @@ -429,13 +429,16 @@ - Added proper palette. Now the game seems to get accurate colors. - Added some notes. + [2025-03-10] + - Bonne Chance chars and tiles both 3bpp. + - New TILE_GET_INFO and video start for Bonne Chance. + - Reworked the Bonne Chance and 7mezzo color palette. + TODO: - - Simplify the gfx banks to avoid a custom palette. - - Document the correct pinout. - - Analyze the PLD. Try to reconstruct the original equations. - - Split the driver. + - Figure out how the palette is generated, to avoid a custom palette. + - Find a board to investigate if the chars GFX are 1bpp or 3bpp. *******************************************************************************/ @@ -467,12 +470,14 @@ class magicfly_state : public driver_device m_colorram(*this, "colorram"), m_maincpu(*this, "maincpu"), m_dac(*this, "dac"), - m_gfxdecode(*this, "gfxdecode") + m_gfxdecode(*this, "gfxdecode"), + m_palette(*this, "palette") + { } - void bchance(machine_config &config); void magicfly(machine_config &config); void _7mezzo(machine_config &config); + void bchance(machine_config &config); protected: virtual void video_start() override ATTR_COLD; @@ -485,6 +490,7 @@ class magicfly_state : public driver_device required_device m_maincpu; required_device m_dac; required_device m_gfxdecode; + required_device m_palette; void magicfly_videoram_w(offs_t offset, uint8_t data); void magicfly_colorram_w(offs_t offset, uint8_t data); @@ -492,9 +498,12 @@ class magicfly_state : public driver_device void mux_port_w(uint8_t data); TILE_GET_INFO_MEMBER(get_magicfly_tile_info); TILE_GET_INFO_MEMBER(get_7mezzo_tile_info); + TILE_GET_INFO_MEMBER(get_bchance_tile_info); void magicfly_palette(palette_device &palette) const; + void _7mezzo_palette(palette_device &palette) const; void bchance_palette(palette_device &palette) const; DECLARE_VIDEO_START(7mezzo); + DECLARE_VIDEO_START(bchance); uint32_t screen_update_magicfly(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); void magicfly_map(address_map &map) ATTR_COLD; }; @@ -531,14 +540,14 @@ TILE_GET_INFO_MEMBER(magicfly_state::get_magicfly_tile_info) */ int attr = m_colorram[tile_index]; int code = m_videoram[tile_index]; - int bank = (attr & 0x10) >> 4; /* bit 4 switch the gfx banks */ - int color = attr & 0x07; /* bits 0-2 for color */ + int bank = (attr & 0x10) >> 4; // bit 4 switch the gfx banks + int color = attr & 0x0f; // bits 0-2 for color - /* Seems that bit 7 is mirrored from bit 3 to have a normal boot */ - /* Boot only check the first color RAM offset */ + // Seems that bit 7 is mirrored from bit 3 to have a normal boot + // Boot only check the first color RAM offset - m_colorram[0] = m_colorram[0] | ((m_colorram[0] & 0x08) << 4); /* only for 1st offset */ - //m_colorram[tile_index] = attr | ((attr & 0x08) << 4); /* for the whole color RAM */ + m_colorram[0] = m_colorram[0] | ((m_colorram[0] & 0x08) << 4); // only for 1st offset + //m_colorram[tile_index] = attr | ((attr & 0x08) << 4); // for the whole color RAM tileinfo.set(bank, code, color, 0); } @@ -560,16 +569,16 @@ TILE_GET_INFO_MEMBER(magicfly_state::get_7mezzo_tile_info) x--- ---- Mirrored from bit 2. The code check this one to boot the game. */ - int const attr = m_colorram[tile_index]; - int const code = m_videoram[tile_index]; - int const bank = (attr & 0x10) >> 4; /* bit 4 switch the gfx banks */ - int const color = attr & 0x07; /* bits 0-2 for color */ + int attr = m_colorram[tile_index]; + int code = m_videoram[tile_index]; + int bank = (attr & 0x10) >> 4; // bit 4 switch the gfx banks + int color = attr & 0x07; // bits 0-2 for color - /* Seems that bit 7 is mirrored from bit 2 to have a normal boot */ - /* Boot only check the first color RAM offset */ + // Seems that bit 7 is mirrored from bit 2 to have a normal boot + // Boot only check the first color RAM offset - m_colorram[0] = m_colorram[0] | ((m_colorram[0] & 0x04) << 5); /* only for 1st offset */ - //m_colorram[tile_index] = attr | ((attr & 0x04) << 5); /* for the whole color RAM */ + m_colorram[0] = m_colorram[0] | ((m_colorram[0] & 0x04) << 5); // only for 1st offset + //m_colorram[tile_index] = attr | ((attr & 0x04) << 5); // for the whole color RAM tileinfo.set(bank, code, color, 0); } @@ -580,6 +589,37 @@ VIDEO_START_MEMBER(magicfly_state, 7mezzo) } +TILE_GET_INFO_MEMBER(magicfly_state::get_bchance_tile_info) +{ +/* - bits - + 7654 3210 + ---- xxxx Tiles color. + ---x ---- Tiles bank. + -xx- ---- Apparently not used. + x--- ---- Mirrored from bit 3. The code check this one to boot the game. + +*/ + int attr = m_colorram[tile_index]; + int code = ((attr & 1) << 8) | m_videoram[tile_index]; + + int bank = (attr & 0x10) >> 4; // bit 4 switch the gfx banks + int color = attr & 0x0f; // bits 0-3 for color + + // Seems that bit 7 is mirrored from bit 3 to have a normal boot + // Boot only check the first color RAM offset + + m_colorram[0] = m_colorram[0] | ((m_colorram[0] & 0x08) << 4); // only for 1st offset + //m_colorram[tile_index] = attr | ((attr & 0x08) << 4); // for the whole color RAM + + tileinfo.set(bank, code, color, 0); +} + +VIDEO_START_MEMBER(magicfly_state, bchance) +{ + m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(magicfly_state::get_bchance_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 32, 29); +} + + uint32_t magicfly_state::screen_update_magicfly(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); @@ -589,55 +629,75 @@ uint32_t magicfly_state::screen_update_magicfly(screen_device &screen, bitmap_rg void magicfly_state::magicfly_palette(palette_device &palette) const { - for (int i = 0x00; i < 0x10; i += 0x10) - { - /* 1st gfx bank */ - palette.set_pen_color(i + 0, rgb_t(0x00, 0x00, 0x00)); - palette.set_pen_color(i + 2, rgb_t(0x00, 0x00, 0x00)); - palette.set_pen_color(i + 4, rgb_t(0x00, 0x00, 0x00)); - palette.set_pen_color(i + 6, rgb_t(0x00, 0x00, 0x00)); - palette.set_pen_color(i + 8, rgb_t(0x00, 0x00, 0x00)); - palette.set_pen_color(i + 10, rgb_t(0x00, 0x00, 0x00)); - palette.set_pen_color(i + 12, rgb_t(0x00, 0x00, 0x00)); - palette.set_pen_color(i + 14, rgb_t(0x00, 0x00, 0x00)); - - palette.set_pen_color(i + 1, rgb_t(0x00, 0x00, 0x00)); - palette.set_pen_color(i + 3, rgb_t(0xff, 0x00, 0x00)); - palette.set_pen_color(i + 5, rgb_t(0x00, 0xff, 0x00)); - palette.set_pen_color(i + 7, rgb_t(0xff, 0xff, 0x00)); - palette.set_pen_color(i + 9, rgb_t(0x00, 0x00, 0xff)); - palette.set_pen_color(i + 11, rgb_t(0xff, 0x00, 0xff)); - palette.set_pen_color(i + 13, rgb_t(0x00, 0xff, 0xff)); - palette.set_pen_color(i + 15, rgb_t(0xff, 0xff, 0xff)); - } + // 1st gfx bank + palette.set_pen_color(0, rgb_t(0x00, 0x00, 0x00)); + palette.set_pen_color(2, rgb_t(0x00, 0x00, 0x00)); + palette.set_pen_color(4, rgb_t(0x00, 0x00, 0x00)); + palette.set_pen_color(6, rgb_t(0x00, 0x00, 0x00)); + palette.set_pen_color(8, rgb_t(0x00, 0x00, 0x00)); + palette.set_pen_color(10, rgb_t(0x00, 0x00, 0x00)); + palette.set_pen_color(12, rgb_t(0x00, 0x00, 0x00)); + palette.set_pen_color(14, rgb_t(0x00, 0x00, 0x00)); + + palette.set_pen_color(1, rgb_t(0x00, 0x00, 0x00)); + palette.set_pen_color(3, rgb_t(0xff, 0x00, 0x00)); // yellow in 7mezzo. + palette.set_pen_color(5, rgb_t(0x00, 0xff, 0x00)); + palette.set_pen_color(7, rgb_t(0xff, 0xff, 0x00)); // red in 7mezzo. + palette.set_pen_color(9, rgb_t(0x00, 0x00, 0xff)); + palette.set_pen_color(11, rgb_t(0xff, 0x00, 0xff)); + palette.set_pen_color(13, rgb_t(0x00, 0xff, 0xff)); + palette.set_pen_color(15, rgb_t(0xff, 0xff, 0xff)); +} + +void magicfly_state::_7mezzo_palette(palette_device &palette) const +{ + // 1st gfx bank + palette.set_pen_color(0, rgb_t(0x00, 0x00, 0x00)); + palette.set_pen_color(2, rgb_t(0x00, 0x00, 0x00)); + palette.set_pen_color(4, rgb_t(0x00, 0x00, 0x00)); + palette.set_pen_color(6, rgb_t(0x00, 0x00, 0x00)); + palette.set_pen_color(8, rgb_t(0x00, 0x00, 0x00)); + palette.set_pen_color(10, rgb_t(0x00, 0x00, 0x00)); + palette.set_pen_color(12, rgb_t(0x00, 0x00, 0x00)); + palette.set_pen_color(14, rgb_t(0x00, 0x00, 0x00)); + + palette.set_pen_color(1, rgb_t(0x00, 0x00, 0x00)); + palette.set_pen_color(3, rgb_t(0xff, 0xff, 0x00)); // red in magicfly + palette.set_pen_color(5, rgb_t(0x00, 0xff, 0x00)); + palette.set_pen_color(7, rgb_t(0xff, 0x00, 0x00)); // yellow in magicfly + palette.set_pen_color(9, rgb_t(0x00, 0x00, 0xff)); + palette.set_pen_color(11, rgb_t(0xff, 0x00, 0xff)); + palette.set_pen_color(13, rgb_t(0x00, 0xff, 0xff)); + palette.set_pen_color(15, rgb_t(0xff, 0xff, 0xff)); } void magicfly_state::bchance_palette(palette_device &palette) const { - for (int i = 0x00; i < 0x10; i += 0x10) + palette.set_pen_color(0*8 + 1, rgb_t(0x00, 0x00, 0x00)); + palette.set_pen_color(1*8 + 1, rgb_t(0xff, 0x00, 0x00)); + palette.set_pen_color(3*8 + 1, rgb_t(0xff, 0xff, 0x00)); + palette.set_pen_color(4*8 + 0, rgb_t(0xff, 0xff, 0xff)); //back card bg (white) + palette.set_pen_color(4*8 + 1, rgb_t(0x00, 0x00, 0xff)); //back card fg (blue) + palette.set_pen_color(5*8 + 1, rgb_t(0xff, 0x00, 0xff)); + palette.set_pen_color(6*8 + 1, rgb_t(0x00, 0xff, 0xff)); + palette.set_pen_color(7*8 + 1, rgb_t(0xff, 0xff, 0xff)); + palette.set_pen_color(0xa*8 + 1, rgb_t(0x00, 0xff, 0x00)); // credits (green) + palette.set_pen_color(0xb*8 + 1, rgb_t(0xff, 0xff, 0x00)); // odds + bet (yell) + palette.set_pen_color(0xd*8 + 1, rgb_t(0xff, 0x00, 0xff)); // push deal (mag) + palette.set_pen_color(0xe*8 + 1, rgb_t(0x00, 0xff, 0xff)); // big good luck (cyan) + palette.set_pen_color(0xf*8 + 1, rgb_t(0xff, 0xff, 0xff)); // odds (white) + + // color code 7 all black + for(int i=0; i < 0x8; i++) { - /* 1st gfx bank */ - palette.set_pen_color(i + 0, rgb_t(0x00, 0x00, 0x00)); - palette.set_pen_color(i + 2, rgb_t(0x00, 0x00, 0x00)); - palette.set_pen_color(i + 4, rgb_t(0x00, 0x00, 0x00)); - palette.set_pen_color(i + 6, rgb_t(0x00, 0x00, 0x00)); - palette.set_pen_color(i + 8, rgb_t(0x00, 0x00, 0x00)); - palette.set_pen_color(i + 10, rgb_t(0x00, 0x00, 0x00)); - palette.set_pen_color(i + 12, rgb_t(0x00, 0x00, 0x00)); - palette.set_pen_color(i + 14, rgb_t(0x00, 0x00, 0x00)); - - palette.set_pen_color(i + 1, rgb_t(0x00, 0x00, 0x00)); - palette.set_pen_color(i + 3, rgb_t(0xff, 0x00, 0x00)); - palette.set_pen_color(i + 5, rgb_t(0x00, 0xff, 0x00)); - palette.set_pen_color(i + 7, rgb_t(0xff, 0xff, 0x00)); - palette.set_pen_color(i + 9, rgb_t(0x00, 0x00, 0xff)); - palette.set_pen_color(i + 11, rgb_t(0xff, 0x00, 0xff)); - palette.set_pen_color(i + 13, rgb_t(0x00, 0xff, 0xff)); - palette.set_pen_color(i + 15, rgb_t(0xff, 0xff, 0xff)); + palette.set_pen_color(7*8 + i, rgb_t(0x00, 0x00, 0x00)); } - palette.set_pen_color(0x08 , rgb_t(0xff, 0xff, 0xff)); // white for the cards back logo background. - palette.set_pen_color(0x12 , rgb_t(0x00, 0x00, 0x00)); // black for the cards corners (should be transparent) + // all code+2 colors black (corners) + for(int i=0; i < 0x10; i++) + { + palette.set_pen_color(i*8 + 2, rgb_t(0x00, 0x00, 0x00)); + } } @@ -670,13 +730,13 @@ void magicfly_state::mux_port_w(uint8_t data) x--- ---- Sound DAC. */ - m_input_selector = data & 0x0f; /* Input Selector */ + m_input_selector = data & 0x0f; // Input selector - m_dac->write(BIT(data, 7)); /* Sound DAC */ + m_dac->write(BIT(data, 7)); // Sound DAC - machine().bookkeeping().coin_counter_w(0, data & 0x40); /* Coin1 */ - machine().bookkeeping().coin_counter_w(1, data & 0x10); /* Coin2 */ - machine().bookkeeping().coin_counter_w(2, data & 0x20); /* Payout */ + machine().bookkeeping().coin_counter_w(0, data & 0x40); // Coin1 + machine().bookkeeping().coin_counter_w(1, data & 0x10); // Coin2 + machine().bookkeeping().coin_counter_w(2, data & 0x20); // Payout } @@ -686,14 +746,14 @@ void magicfly_state::mux_port_w(uint8_t data) void magicfly_state::magicfly_map(address_map &map) { - map(0x0000, 0x07ff).ram().share("nvram"); /* MK48Z02B NVRAM */ + map(0x0000, 0x07ff).ram().share("nvram"); // MK48Z02B NVRAM map(0x0800, 0x0800).w("crtc", FUNC(mc6845_device::address_w)); map(0x0801, 0x0801).rw("crtc", FUNC(mc6845_device::register_r), FUNC(mc6845_device::register_w)); - map(0x1000, 0x13ff).ram().w(FUNC(magicfly_state::magicfly_videoram_w)).share("videoram"); /* HM6116LP #1 (2K x 8) RAM (only 1st half used) */ - map(0x1800, 0x1bff).ram().w(FUNC(magicfly_state::magicfly_colorram_w)).share("colorram"); /* HM6116LP #2 (2K x 8) RAM (only 1st half used) */ - map(0x2800, 0x2800).r(FUNC(magicfly_state::mux_port_r)); /* multiplexed input port */ - map(0x3000, 0x3000).w(FUNC(magicfly_state::mux_port_w)); /* output port */ - map(0xc000, 0xffff).rom(); /* ROM space */ + map(0x1000, 0x13ff).ram().w(FUNC(magicfly_state::magicfly_videoram_w)).share("videoram"); // HM6116LP #1 (2K x 8) RAM (only 1st half used) + map(0x1800, 0x1bff).ram().w(FUNC(magicfly_state::magicfly_colorram_w)).share("colorram"); // HM6116LP #2 (2K x 8) RAM (only 1st half used) + map(0x2800, 0x2800).r(FUNC(magicfly_state::mux_port_r)); // multiplexed input port + map(0x3000, 0x3000).w(FUNC(magicfly_state::mux_port_w)); // output port + map(0xc000, 0xffff).rom(); // ROM space } @@ -702,34 +762,34 @@ void magicfly_state::magicfly_map(address_map &map) *********************************************/ static INPUT_PORTS_START( magicfly ) -/* Multiplexed 4 x 5 bits. - Code accept only bits 0, 1, 2, 3 and 5 as valid. -*/ +// Multiplexed 4 x 5 bits. +// Code accept only bits 0, 1, 2, 3 and 5 as valid. + PORT_START("IN0-0") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* present in the input test */ - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* present in the input test */ + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) // present in the input test + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) // present in the input test PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* present in the input test */ + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) // present in the input test PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_START("IN0-1") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* present in the input test */ - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* present in the input test */ + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) // present in the input test + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) // present in the input test PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("Payout") PORT_CODE(KEYCODE_Q) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* present in the input test */ + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) // present in the input test PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* present in the input test */ + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) // present in the input test PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_START("IN0-2") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* present in the input test */ - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* present in the input test */ + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) // present in the input test + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) // present in the input test PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_2WAY - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* present in the input test */ + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) // present in the input test PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) @@ -745,7 +805,7 @@ static INPUT_PORTS_START( magicfly ) PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_START("DSW0") /* Only 4 physical DIP switches (valid bits = 4, 6, 7) */ + PORT_START("DSW0") // Only 4 physical DIP switches (valid bits = 4, 6, 7) PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) @@ -753,7 +813,7 @@ static INPUT_PORTS_START( magicfly ) PORT_DIPNAME( 0x10, 0x10, "Maximum Bet" ) PORT_DIPSETTING( 0x10, "20" ) PORT_DIPSETTING( 0x00, "100" ) - PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) /* invalid - don't change */ + PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) // invalid - don't change PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) @@ -765,16 +825,16 @@ static INPUT_PORTS_START( magicfly ) INPUT_PORTS_END static INPUT_PORTS_START( 7mezzo ) -/* Multiplexed 4 x 5 bits. - Code accept only bits 0, 1, 2, 3 and 5 as valid. -*/ +// Multiplexed 4 x 5 bits. +// Code accept only bits 0, 1, 2, 3 and 5 as valid. + PORT_START("IN0-0") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* present in the input test */ - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* present in the input test */ + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) // present in the input test + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) // present in the input test PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* present in the input test */ + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) // present in the input test PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) @@ -784,17 +844,17 @@ static INPUT_PORTS_START( 7mezzo ) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Payout") PORT_CODE(KEYCODE_Q) PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("Take") PORT_CODE(KEYCODE_V) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* present in the input test */ + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) // present in the input test PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_START("IN0-2") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* present in the input test */ - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* present in the input test */ - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* present in the input test */ - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* present in the input test */ + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) // present in the input test + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) // present in the input test + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) // present in the input test + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) // present in the input test PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* present in the input test */ + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) // present in the input test PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) @@ -808,7 +868,7 @@ static INPUT_PORTS_START( 7mezzo ) PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_START("DSW0") /* Only 4 physical DIP switches (valid bits = 4, 6, 7) */ + PORT_START("DSW0") // Only 4 physical DIP switches (valid bits = 4, 6, 7) PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) @@ -816,7 +876,7 @@ static INPUT_PORTS_START( 7mezzo ) PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) /* invalid - don't change */ + PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) // invalid - don't change PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) @@ -882,10 +942,7 @@ static INPUT_PORTS_START( bchance ) PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_START("DSW0") -/* Only 4 physical DIP switches - (valid bits = 4, 6, 7) -*/ + PORT_START("DSW0") // Only 4 physical DIP switches (valid bits = 4, 6, 7) PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) @@ -918,7 +975,7 @@ static const gfx_layout tilelayout = 8*8 }; -static const gfx_layout charlayout = +static const gfx_layout charlayout_1bpp = { 8, 8, RGN_FRAC(1,1), @@ -929,14 +986,30 @@ static const gfx_layout charlayout = 8*8 }; +static const gfx_layout charlayout_3bpp = +{ + 8, 8, + RGN_FRAC(1,3), + 3, + { 0, RGN_FRAC(1,3), RGN_FRAC(2,3) }, + { 0, 1, 2, 3, 4, 5, 6, 7 }, + { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 }, + 8*8 +}; + /************************************************** * Graphics Decode Information * **************************************************/ static GFXDECODE_START( gfx_magicfly ) - GFXDECODE_ENTRY( "gfxbnk1", 0, tilelayout, 16, 1 ) - GFXDECODE_ENTRY( "gfxbnk0", 0, charlayout, 0, 8 ) + GFXDECODE_ENTRY( "gfxbnk1", 0, tilelayout, 16, 1 ) + GFXDECODE_ENTRY( "gfxbnk0", 0, charlayout_1bpp, 0, 8 ) +GFXDECODE_END + +static GFXDECODE_START( gfx_bchance ) + GFXDECODE_ENTRY( "gfxbnk1", 0, tilelayout, 0, 16 ) + GFXDECODE_ENTRY( "gfxbnk0", 0, charlayout_3bpp, 0, 16 ) GFXDECODE_END @@ -946,30 +1019,30 @@ GFXDECODE_END void magicfly_state::magicfly(machine_config &config) { - /* basic machine hardware */ - M6502(config, m_maincpu, MASTER_CLOCK / 16); /* guess */ + // basic machine hardware + M6502(config, m_maincpu, MASTER_CLOCK / 16); // guess m_maincpu->set_addrmap(AS_PROGRAM, &magicfly_state::magicfly_map); NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); - /* video hardware */ + // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); screen.set_refresh_hz(60); screen.set_vblank_time(ATTOSECONDS_IN_USEC(0)); - screen.set_size((39+1)*8, (31+1)*8); /* Taken from MC6845 init, registers 00 & 04. Normally programmed with (value-1). */ - screen.set_visarea(0*8, 32*8-1, 0*8, 29*8-1); /* Taken from MC6845 init, registers 01 & 06. */ + screen.set_size((39+1)*8, (31+1)*8); // Taken from MC6845 init, registers 00 & 04. Normally programmed with (value-1). + screen.set_visarea(0*8, 32*8-1, 0*8, 29*8-1); // Taken from MC6845 init, registers 01 & 06. screen.set_screen_update(FUNC(magicfly_state::screen_update_magicfly)); GFXDECODE(config, m_gfxdecode, "palette", gfx_magicfly); PALETTE(config, "palette", FUNC(magicfly_state::magicfly_palette), 32); - mc6845_device &crtc(MC6845(config, "crtc", MASTER_CLOCK/16)); /* guess */ + mc6845_device &crtc(MC6845(config, "crtc", MASTER_CLOCK/16)); // guess crtc.set_screen("screen"); crtc.set_show_border_area(false); crtc.set_char_width(8); crtc.out_vsync_callback().set_inputline(m_maincpu, INPUT_LINE_NMI); - /* sound hardware */ + // sound hardware SPEAKER(config, "speaker").front_center(); DAC_1BIT(config, m_dac, 0).add_route(ALL_OUTPUTS, "speaker", 0.25); } @@ -979,8 +1052,9 @@ void magicfly_state::_7mezzo(machine_config &config) { magicfly(config); - /* video hardware */ + // video hardware MCFG_VIDEO_START_OVERRIDE(magicfly_state, 7mezzo) + PALETTE(config.replace(), "palette", FUNC(magicfly_state::_7mezzo_palette), 32); } @@ -988,8 +1062,10 @@ void magicfly_state::bchance(machine_config &config) { magicfly(config); - /* video hardware */ - subdevice("palette")->set_init(FUNC(magicfly_state::bchance_palette)); + MCFG_VIDEO_START_OVERRIDE(magicfly_state, bchance) + + GFXDECODE(config.replace(), m_gfxdecode, "palette", gfx_bchance); + PALETTE(config.replace(), "palette", FUNC(magicfly_state::bchance_palette), 128); } @@ -1007,16 +1083,15 @@ ROM_START( magicfly ) ROM_LOAD( "magicfly0.bin", 0x4000, 0x2000, CRC(44e3c9d6) SHA1(677d25360d261bf2400f399b8015eeb529ad405e) ) ROM_REGION( 0x0800, "gfxbnk0", 0 ) - ROM_COPY( "gfx", 0x1800, 0x0000, 0x0800 ) /* chars */ + ROM_COPY( "gfx", 0x1800, 0x0000, 0x0800 ) // chars ROM_REGION( 0x1800, "gfxbnk1", 0 ) - ROM_COPY( "gfx", 0x1000, 0x0000, 0x0800 ) /* sprites, bitplane 1 */ - ROM_COPY( "gfx", 0x3800, 0x0800, 0x0800 ) /* sprites, bitplane 2 */ - ROM_COPY( "gfx", 0x5800, 0x1000, 0x0800 ) /* sprites, bitplane 3 */ + ROM_COPY( "gfx", 0x1000, 0x0000, 0x0800 ) // sprites, bitplane 1 + ROM_COPY( "gfx", 0x3800, 0x0800, 0x0800 ) // sprites, bitplane 2 + ROM_COPY( "gfx", 0x5800, 0x1000, 0x0800 ) // sprites, bitplane 3 ROM_REGION( 0x0200, "plds", 0 ) - ROM_LOAD( "pal16r4a-magicfly.bin", 0x0000, 0x0104, NO_DUMP ) /* PAL is read protected */ - + ROM_LOAD( "pal16r4a-magicfly.bin", 0x0000, 0x0104, NO_DUMP ) // PAL is read protected ROM_END ROM_START( 7mezzo ) @@ -1024,17 +1099,17 @@ ROM_START( 7mezzo ) ROM_LOAD( "ns3_1.bin", 0xc000, 0x4000, CRC(b1867b76) SHA1(eb76cffb81c865352f4767015edade54801f6155) ) ROM_REGION( 0x6000, "gfx", 0 ) - ROM_LOAD( "ns2.bin", 0x0000, 0x2000, CRC(7983a41c) SHA1(68805ea960c2738d3cd2c7490ffed84f90da029b) ) /* Renamed as ns2.bin regarding pcb location and content */ + ROM_LOAD( "ns2.bin", 0x0000, 0x2000, CRC(7983a41c) SHA1(68805ea960c2738d3cd2c7490ffed84f90da029b) ) // Renamed as ns2.bin regarding pcb location and content ROM_LOAD( "ns1.bin", 0x2000, 0x2000, CRC(a6ada872) SHA1(7f531a76e73d479161e485bdcf816eb8eb9fdc62) ) - ROM_LOAD( "ns0.bin", 0x4000, 0x2000, CRC(e04fb210) SHA1(81e764e296fe387daf8ca67064d5eba2a4fc3c26) ) /* Renamed as ns0.bin regarding pcb location and content */ + ROM_LOAD( "ns0.bin", 0x4000, 0x2000, CRC(e04fb210) SHA1(81e764e296fe387daf8ca67064d5eba2a4fc3c26) ) // Renamed as ns0.bin regarding pcb location and content ROM_REGION( 0x0800, "gfxbnk0", 0 ) - ROM_COPY( "gfx", 0x1800, 0x0000, 0x0800 ) /* chars */ + ROM_COPY( "gfx", 0x1800, 0x0000, 0x0800 ) // chars ROM_REGION( 0x1800, "gfxbnk1", 0 ) - ROM_COPY( "gfx", 0x1000, 0x0000, 0x0800 ) /* 3bpp tiles, bitplane 1 */ - ROM_COPY( "gfx", 0x3800, 0x0800, 0x0800 ) /* 3bpp tiles, bitplane 2 */ - ROM_COPY( "gfx", 0x5800, 0x1000, 0x0800 ) /* 3bpp tiles, bitplane 3 */ + ROM_COPY( "gfx", 0x1000, 0x0000, 0x0800 ) // 3bpp tiles, bitplane 1 + ROM_COPY( "gfx", 0x3800, 0x0800, 0x0800 ) // 3bpp tiles, bitplane 2 + ROM_COPY( "gfx", 0x5800, 0x1000, 0x0800 ) // 3bpp tiles, bitplane 3 ROM_REGION( 0x0200, "plds", 0 ) ROM_LOAD( "pal16r4a-7mezzo.bin", 0x0000, 0x0104, BAD_DUMP CRC(61ac7372) SHA1(7560506468a7409075094787182ded24e2d0c0a3) ) @@ -1044,21 +1119,22 @@ ROM_START( bchance ) ROM_REGION( 0x10000, "maincpu", 0 ) ROM_LOAD( "v-pk-4gag.bin", 0xc000, 0x4000, CRC(7c2dd908) SHA1(97b1390fb4c8c838a0d5b78d6904d597a9abe27f) ) - ROM_REGION( 0x6000, "gfx", 0 ) /* ROM n-pk-2.bin was created from an exhaustive analysis of 25 different bad dumps */ + ROM_REGION( 0x6000, "gfx", 0 ) // ROM n-pk-2.bin was created from an exhaustive analysis of 25 different bad dumps ROM_LOAD( "n-pk-2.bin", 0x0000, 0x2000, BAD_DUMP CRC(462c3dd7) SHA1(fb30d6147e0d607b3fb631d8bdca35e98eccfd2d) ) ROM_LOAD( "n-pk-1.bin", 0x2000, 0x2000, CRC(e35cebd6) SHA1(b0dd86fd4c06f98e486b04e09808985bfa4f0e9c) ) ROM_LOAD( "n-pk-0.bin", 0x4000, 0x2000, CRC(3c64edc4) SHA1(97b677b7c4999b502ab4b4f70c33b40050843796) ) - ROM_REGION( 0x0800, "gfxbnk0", 0 ) - ROM_COPY( "gfx", 0x1800, 0x0000, 0x0800 ) /* chars */ + ROM_REGION( 0x1800, "gfxbnk0", 0 ) + ROM_FILL( 0x0000, 0x1000, 0x00 ) // filling the R-G bitplanes. + ROM_COPY( "gfx", 0x1800, 0x1000, 0x0800 ) // chars ROM_REGION( 0x1800, "gfxbnk1", 0 ) - ROM_COPY( "gfx", 0x1000, 0x0000, 0x0800 ) /* 3bpp tiles, bitplane 1 */ - ROM_COPY( "gfx", 0x3800, 0x0800, 0x0800 ) /* 3bpp tiles, bitplane 2 */ - ROM_COPY( "gfx", 0x5800, 0x1000, 0x0800 ) /* 3bpp tiles, bitplane 3 */ + ROM_COPY( "gfx", 0x1000, 0x0000, 0x0800 ) // 3bpp tiles, bitplane 1 + ROM_COPY( "gfx", 0x3800, 0x0800, 0x0800 ) // 3bpp tiles, bitplane 2 + ROM_COPY( "gfx", 0x5800, 0x1000, 0x0800 ) // 3bpp tiles, bitplane 3 ROM_REGION( 0x0200, "plds", 0 ) - ROM_LOAD( "gal16v8-bchance.bin", 0x0000, 0x0104, NO_DUMP ) /* protected */ + ROM_LOAD( "gal16v8-bchance.bin", 0x0000, 0x0104, NO_DUMP ) // protected ROM_END } // anonymous namespace @@ -1071,4 +1147,4 @@ ROM_END // YEAR NAME PARENT MACHINE INPUT STATE INIT ROT COMPANY FULLNAME FLAGS GAME( 198?, magicfly, 0, magicfly, magicfly, magicfly_state, empty_init, ROT0, "P&A Games", "Magic Fly", 0 ) GAME( 198?, 7mezzo, 0, _7mezzo, 7mezzo, magicfly_state, empty_init, ROT0, "", "7 e Mezzo", 0 ) -GAME( 198?, bchance, 0, bchance, bchance, magicfly_state, empty_init, ROT0, "", "Bonne Chance! (French/English)", MACHINE_IMPERFECT_GRAPHICS ) +GAME( 198?, bchance, 0, bchance, bchance, magicfly_state, empty_init, ROT0, "", "Bonne Chance! (French/English)", 0 ) diff --git a/src/mame/misc/mcatadv.cpp b/src/mame/misc/mcatadv.cpp index d2da47aaaa5e1..704b532d1bd9c 100644 --- a/src/mame/misc/mcatadv.cpp +++ b/src/mame/misc/mcatadv.cpp @@ -68,7 +68,7 @@ NOS-B1-00.U60 / NOS-B1-01.U61- YMF286-K is compatible to YM2610 - see psikyo/psikyo.cpp driver -038 9320EX702 / 038 9330EX705 - see misc/cave.cpp driver +038 9320EX702 / 038 9330EX705 - see atlus/cave.cpp driver Note # = Pin #1 PCB Layout: @@ -186,8 +186,8 @@ class mcatadv_state : public driver_device , m_vidregs(*this, "vidregs") { } - void nost(machine_config &config); - void mcatadv(machine_config &config); + void nost(machine_config &config) ATTR_COLD; + void mcatadv(machine_config &config) ATTR_COLD; protected: virtual void machine_start() override ATTR_COLD; @@ -228,16 +228,13 @@ class mcatadv_state : public driver_device void mcatadv_state::draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - u16 *source = (m_spriteram->buffer() + (m_spriteram->bytes() / 2) /2); + const u16 *source = (m_spriteram->buffer() + (m_spriteram->bytes() / 2) / 2); source -= 4; - u16 *finish = m_spriteram->buffer(); - int const global_x = m_vidregs->live()[0] - 0x184; - int const global_y = m_vidregs->live()[1] - 0x1f1; + const u16 *finish = m_spriteram->buffer(); + const int global_x = m_vidregs->live()[0] - 0x184; + const int global_y = m_vidregs->live()[1] - 0x1f1; - u32 const sprmask = m_sprdata.bytes() - 1; - - int xstart, xend, xinc; - int ystart, yend, yinc; + const u32 sprmask = m_sprdata.bytes() - 1; if (m_vidregs->buffer()[2] == 0x0001) // double buffered { @@ -251,24 +248,19 @@ void mcatadv_state::draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, co while (source >= finish) { - u32 const pen = (source[0] & 0x3f00) >> 8; - u32 const tileno = source[1] & 0xffff; - u8 pri = (source[0] & 0xc000) >> 14; - - pri |= 0x8; + const u32 pen = (source[0] & 0x3f00) >> 8; + const u32 tileno = source[1] & 0xffff; + const u8 pri = 0x8 | ((source[0] & 0xc000) >> 14); - int x = source[2] & 0x3ff; - int y = source[3] & 0x3ff; - int flipy = source[0] & 0x0040; - int flipx = source[0] & 0x0080; + int x = util::sext(source[2] & 0x3ff, 10); + int y = util::sext(source[3] & 0x3ff, 10); + bool flipy = BIT(source[0], 6); + bool flipx = BIT(source[0], 7); - int const height = ((source[3] & 0xf000) >> 12) * 16; - int const width = ((source[2] & 0xf000) >> 12) * 16; + const int height = ((source[3] & 0xf000) >> 12) * 16; + const int width = ((source[2] & 0xf000) >> 12) * 16; u32 offset = tileno * 256; - if (x & 0x200) x -= 0x400; - if (y & 0x200) y -= 0x400; - #if 0 // For Flipscreen/Cocktail if (m_vidregs->live()[0] & 0x8000) { @@ -282,6 +274,9 @@ void mcatadv_state::draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, co if (source[3] != source[0]) // 'hack' don't draw sprites while it's testing the RAM! { + int xstart, xend, xinc; + int ystart, yend, yinc; + if (!flipx) { xstart = 0; xend = width; xinc = 1; } else { xstart = width-1; xend = -1; xinc = -1; } if (!flipy) { ystart = 0; yend = height; yinc = 1; } @@ -306,10 +301,10 @@ void mcatadv_state::draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, co if (!(pridata & 0x10)) // if we haven't already drawn a sprite pixel here (sprite masking) { - u8 pix = m_sprdata[(offset / 2)&sprmask]; + u8 pix = m_sprdata[(offset / 2) & sprmask]; - if (offset & 1) - pix = pix >> 4; + if (BIT(offset, 0)) + pix >>= 4; pix &= 0x0f; if (pix) @@ -368,7 +363,7 @@ void mcatadv_state::draw_tilemap_part(screen_device &screen, int layer, int i, b // global flip if (m_tilemap[layer]->flipx()) scrollx -= 0x19; if (m_tilemap[layer]->flipy()) scrolly -= 0x141; - int flip = (m_tilemap[layer]->flipx() ? TILEMAP_FLIPX : 0) | (m_tilemap[layer]->flipy() ? TILEMAP_FLIPY : 0); + const int flip = (m_tilemap[layer]->flipx() ? TILEMAP_FLIPX : 0) | (m_tilemap[layer]->flipy() ? TILEMAP_FLIPY : 0); m_tilemap[layer]->set_scrollx(0, scrollx); m_tilemap[layer]->set_scrolly(0, scrolly); @@ -763,11 +758,11 @@ void mcatadv_state::nost(machine_config &config) m_soundcpu->set_addrmap(AS_PROGRAM, &mcatadv_state::nost_sound_map); m_soundcpu->set_addrmap(AS_IO, &mcatadv_state::nost_sound_io_map); - ym2610_device &ymsnd(YM2610(config.replace(), "ymsnd", XTAL(16'000'000) / 2)); // verified on PCB - ymsnd.irq_handler().set_inputline(m_soundcpu, 0); - ymsnd.add_route(0, "mono", 0.2); - ymsnd.add_route(1, "mono", 0.5); - ymsnd.add_route(2, "mono", 0.5); + ym2610_device *ymsnd = subdevice("ymsnd"); + ymsnd->reset_routes(); + ymsnd->add_route(0, "mono", 0.2); + ymsnd->add_route(1, "mono", 0.5); + ymsnd->add_route(2, "mono", 0.5); } diff --git a/src/mame/misc/menghong.cpp b/src/mame/misc/menghong.cpp index 7e47feb795727..8115acc929478 100644 --- a/src/mame/misc/menghong.cpp +++ b/src/mame/misc/menghong.cpp @@ -17,63 +17,79 @@ ============================================================================= -Crazy Dou Di Zhu II -Sealy, 2006 - -PCB Layout ----------- +Meng Hong Lou (Dream of the Red Chamber), Sealy, 2008 +Crazy Dou Di Zhu II, Sealy, 2006 +Hardware Info By Guru +--------------------- 070405-fd-VER1.2 -|--------------------------------------| -| PAL 27C322.U36 | -| BATTERY| -| M59PW1282 62256 14.31818MHz | -| W9864G66 | -| | -|J VRENDERZERO+ | -|A W9864G66 | -|M W9864G66 | -|M 8MHz | -|A HY04 0260F8A | -| 28.63636MHz | -| | -| VR1 TLDA1311 | -| TDA1519| -| 18WAY VOL 10WAY | -|--------------------------------------| + |-----------------------------------| +|--| 1086M33 EPROM.U49 SW1 | +| GAL LVC16245 U36 BATTERY| +| 62256 14.31818MHz | +| M59PW1282 T518B W9864G66 | +| LVC16245 |--------| | +|J 817(x26) |VRENDER | | +|A W9864G66 |ZERO+ | | +|M LVC16245 |MAGICEYES | +|M 8MHz |--------| | +|A |------| W9864G66 | +| HY04 |0260F8A 28.63636MHz | +| | | | +| |------| TDA1311A | +| VR1 VOL TDA1519| +|--| 18WAY |-------| 10WAY |--| + |---------------| |--------| Notes: - 0260F8A - unknown TQFP44 - HY04 - rebadged DIP8 PIC - type unknown * - W9864G66 - Winbond 64MBit DRAM - M59PW1282 - ST Microelectronics 128MBit SOP44 FlashROM. - This is two 64MB SOP44 ROMs in one package + VRENDERZERO+ - MagicEyes VRENDERZERO+ EISC System-On-A-Chip. + CPU Clock Input Pins 6 & 7 - 14.31818MHz + Video Clock Input Pin 103 - 28.63636MHz + Another identical PCB has this chip marked "ADC Amazon-LF EISC" so these are 100% compatible. + 0260F8A - unknown TQFP44 (Microcontroller?). Clock Input 8.000MHz + HY04 - rebadged DIP8 PIC - type unknown (*). PCB marked "SAM1" + Some chips are marked "SL01". Chip data is unique to each game but different + versions of the same game work ok with swapped HY04 or swapped main program EPROM. + Clock and data pis are connected to unknown IC 0260F8A. + 62256 - 32kB x8-bit SRAM (battery-backed) + W9864G66 - Winbond 1MB x4-Banks x16-bit (64MBit) SDRAM + TDA1311A - Philips TDA1311A Stereo DAC. VRENDERZERO+ outputs digital audio directly into this + chip on pin 3. + TDA1519 - Philips TDA1519C 22W BTL Stereo Power Amplifier + VR1 - Potentiometer to adjust brightness + VOL - Potentiometer to adjust audio volume + 817 - Sharp PC817 Optocoupler + T518B - Mitsumi T518B System Reset IC + 1086M33 - Toshiba LM1086M33 3.3V Linear Regulator + GAL - Atmel ATF16V8B-15PC GAL + BATTERY - 3.6V Ni-Cad Battery + SW1 = Push Button. Does nothing when pressed. Connected to unknown IC 0260F8A. + LVC16245 - Texas Instruments LVC16245 16-bit Bus Transceiver + EPROM.U49 - 27C160 or 27C322 EPROM (main program) + U36 - Alternative position for a different type of EPROM (not populated) + M59PW1282 - ST Microelectronics 128Mbit SOP44 Flash ROM (= 2x 64Mbit SOP44 ROMs in one chip) * The pins are: - 1 ground - 2 nothing - 3 data (only active for 1/4 second when the playing cards or "PASS" shows in game next to each player) - 4 nothing - 5 nothing - 6 clock - 7 +5V (could be VPP for programming voltage) - 8 +5V - -===== - -Meng Hong Lou (Dream of the Red Chamber) -Sealy, 2004? - -Red PCB, very similar to crzyddz2 + 1 Ground + 2 - + 3 Data (only active for 1/4 second when the playing cards or "PASS" shows in game next to each player) + This pin is connected to 0260F8A. + 4 - + 5 - + 6 Clock. This pin is connected to 0260F8A. + 7 High + 8 VCC ****************************************************************************/ #include "emu.h" + #include "cpu/se3208/se3208.h" #include "machine/ds1302.h" #include "machine/eepromser.h" #include "machine/nvram.h" #include "machine/timer.h" #include "machine/vrender0.h" + #include "emupal.h" #include @@ -99,8 +115,8 @@ class menghong_state : public driver_device { } - void crzyddz2(machine_config &config); - void menghong(machine_config &config); + void crzyddz2(machine_config &config) ATTR_COLD; + void menghong(machine_config &config) ATTR_COLD; protected: virtual void machine_start() override ATTR_COLD; @@ -492,7 +508,7 @@ ROM_START( menghong ) ROM_LOAD( "rom.u48", 0x000000, 0x1000000, CRC(e24257c4) SHA1(569d79a61ff6d35100ba5727069363146df9e0b7) ) ROM_REGION( 0x0400000, "maincpu", 0 ) - ROM_LOAD( "060511_08-01-18.u49", 0x0000000, 0x0200000, CRC(b0c12107) SHA1(b1753757bbdb7d996df563ac6abdc6b46676704b) ) // 27C160 + ROM_LOAD( "060511_08-01-18.u49", 0x0000000, 0x0200000, CRC(b0c12107) SHA1(b1753757bbdb7d996df563ac6abdc6b46676704b) ) // 27C160, also found with mhl_29-4-2008 label and same content ROM_RELOAD( 0x0200000, 0x0200000 ) ROM_REGION( 0x4280, "pic", 0 ) // hy04 @@ -502,6 +518,22 @@ ROM_START( menghong ) ROM_LOAD("hy04_fake_data.bin", 0, 0x100, BAD_DUMP CRC(73cc964b) SHA1(39d223c550e38c97135322e43ccabb70f04964b9) ) ROM_END + +ROM_START( menghonga ) + ROM_REGION32_LE( 0x1000000, "flash", 0 ) // Flash + ROM_LOAD( "rom.u48", 0x000000, 0x1000000, CRC(e24257c4) SHA1(569d79a61ff6d35100ba5727069363146df9e0b7) ) + + ROM_REGION( 0x0400000, "maincpu", 0 ) + ROM_LOAD( "mhl_4-1-2008.u46", 0x0000000, 0x0200000, CRC(68246e07) SHA1(6732b017d274bc47a6b9bae144c54937e24152ee) ) + ROM_RELOAD( 0x0200000, 0x0200000 ) + + ROM_REGION( 0x4280, "pic", 0 ) // hy04 + ROM_LOAD("menghong_hy04", 0x000000, 0x4280, NO_DUMP ) + + ROM_REGION( 0x0100, "pic_data", ROMREGION_ERASEFF ) + ROM_LOAD("hy04_fake_data.bin", 0, 0x100, BAD_DUMP CRC(73cc964b) SHA1(39d223c550e38c97135322e43ccabb70f04964b9) ) +ROM_END + ROM_START( crzyddz2 ) ROM_REGION32_LE( 0x1000000, "flash", 0 ) // Flash ROM_LOAD( "rom.u48", 0x000000, 0x1000000, CRC(0f3a1987) SHA1(6cad943846c79db31226676c7391f32216cfff79) ) @@ -515,8 +547,9 @@ ROM_START( crzyddz2 ) ROM_REGION( 0x0100, "pic_data", ROMREGION_ERASEFF ) ROM_END -} // Anonymous namespace +} // anonymous namespace -GAME( 2004?,menghong, 0, menghong, crzyddz2, menghong_state, empty_init, ROT0, "Sealy", "Meng Hong Lou", MACHINE_NOT_WORKING | MACHINE_UNEMULATED_PROTECTION ) -GAME( 2006, crzyddz2, 0, crzyddz2, crzyddz2, menghong_state, empty_init, ROT0, "Sealy", "Crazy Dou Di Zhu II", MACHINE_NOT_WORKING | MACHINE_UNEMULATED_PROTECTION ) +GAME( 2004?, menghong, 0, menghong, crzyddz2, menghong_state, empty_init, ROT0, "Sealy", "Meng Hong Lou", MACHINE_NOT_WORKING | MACHINE_UNEMULATED_PROTECTION ) +GAME( 2004?, menghonga, menghong, menghong, crzyddz2, menghong_state, empty_init, ROT0, "Sealy", "Meng Hong Lou (earlier)", MACHINE_NOT_WORKING | MACHINE_UNEMULATED_PROTECTION ) +GAME( 2006, crzyddz2, 0, crzyddz2, crzyddz2, menghong_state, empty_init, ROT0, "Sealy", "Crazy Dou Di Zhu II", MACHINE_NOT_WORKING | MACHINE_UNEMULATED_PROTECTION ) diff --git a/src/mame/misc/norautp.cpp b/src/mame/misc/norautp.cpp index 013ee53b642f4..39f80486b4a7a 100644 --- a/src/mame/misc/norautp.cpp +++ b/src/mame/misc/norautp.cpp @@ -1,11 +1,11 @@ // license:BSD-3-Clause -// copyright-holders:Angelo Salese, Roberto Fresca +// copyright-holders:Angelo Salese, Roberto Fresca, Grull Osgo /****************************************************************************** - NORAUT POKER SYSTEM - ------------------------- - Driver by Roberto Fresca & Angelo Salese. + Driver by Roberto Fresca, Angelo Salese & Grull Osgo. Games running on this hardware: @@ -181,7 +181,6 @@ ******************************************************************************* - Narout System Ports Map ----------------------- @@ -302,10 +301,8 @@ ******************************************************************************* - *** Game Notes *** - - norautjp: At the first start-up, the game will give you a very clever @@ -349,10 +346,8 @@ ******************************************************************************* - DRIVER UPDATES: - [2009-01-27] - Initial release. @@ -368,7 +363,6 @@ - Added pinout scheme. - Added technical notes. - [2009-01-28] - Merged GTI Poker (gtipoker.c) with this driver. @@ -379,7 +373,6 @@ to Noraut Poker (bootleg), since the game has payout system. - Some clean-ups. - [2009-08-21] - Switched to pre-defined Xtal clock. @@ -393,7 +386,6 @@ - Added partial DIP switches to norautrh. - Added more technical notes. - [2009-08-23/26] - Added a default NVRAM to Noraut Joker Poker to bypass the 'F U' screen. @@ -406,7 +398,6 @@ - Added Noraut Joker Poker hardware and PCB layouts. - Documented the discrete audio circuitry. Added a full diagram. - [2009-08-29] - Fixed the coin counters. @@ -420,7 +411,6 @@ - Added 2 different control panel layouts to the source. - Updated technical notes. - [2009-08-30] - Corrected CPU clock to Xtal/8. @@ -432,7 +422,6 @@ - Added new handlers to simulate the handshake lines. Still need real support through PPI-2. - Updated technical notes. - [2009-09-03] - Routed the whole video RAM access through PPI-2. @@ -442,13 +431,11 @@ - Added a new machine driver for extended hardware. It has 2 jumpers that cut the a14 and a15 addressing lines. - [2009-09-09] - Added accurate discrete sound system emulation. - Fixed the discrete sound system diagram, based on real sound references. - [2009-10-12] - Added Draw Poker HI-LO hardware support, based on 8080A CPU. @@ -464,7 +451,6 @@ properly emulated. For now, all VRAM access is through direct handlers. This allow to remove the hacks per set needed to boot the games. - [2009-10-13] - Added Draw Poker HI-LO (japanese), based on 8080A CPU. @@ -475,7 +461,6 @@ - Added smshilo hardware details and PCB layout. - Added smshilo discrete sound circuitry scheme/documentation. - [2009-11-26] - A lot of work in memory maps and machine driver stuff. @@ -505,7 +490,6 @@ - Fix the Kimble Double HI-LO CPU type. - Added notes about the code obfuscation and PPI's handling/offsets. - [2009-12-04] - Added new technical notes. @@ -519,7 +503,6 @@ so can be seen/maintained in a cleaner way. - Fixed the default lamps state. - [2009-12-08] - Added Fast Draw (poker conversion kit)?. Seems based on 8080 CPU hardware. @@ -529,25 +512,21 @@ - Added undumped devices as NO_DUMP. - Added some technical notes. - [2009-12-08] - Added Southern Systems Joker Poker. Based on 8080 CPU. - Added some technical notes. - [2011-01-24] - Changed DRHL description to "Drews Revenge (v.2.89, set 1)" - Added Drews Revenge (v.2.89, set 2). Based on 8080 CPU. - [2013-04-09] - Added GTI Poker? (SMS hardware). Based on 8080 CPU. - Added PCB description and sound hardware schematics. - [2013-2023] - Added more sets. @@ -555,32 +534,83 @@ - Decryption of noraut3 sets. - Working inputs, DIP switches, and button-lamps layouts to noraut3 games. - Change game description to noraut3 games, since are dual games selectable - through a DIP switch. + through a DIP switch. + + [2025-03] + + - Consolidate driver in one file. + - New palette for drhl and drhla. + - Added new test functions for drhl, drhla, dphl, and dphla. + - Cleaned all the conditional unused things. + - Rewrote inputs for different sets. + - DIP switches improvements for norautp, norautrh, + - New inputs for norautua, dphla, drhl, ssjkrpkr. + - New portmap for dphl, dphla. + - Added Interrupts through vertical sync for all sets based on i8080. + - Fixed norautua and norautub table for bin to bcd conversion. + - New button-lamps layout with 10 buttons for dphl, dphla, dphljp, + drhl, drhla, and ssjkrpkr. + - Clickable buttons for all former buttons-lamps layouts. + - Promoted drhl, drhla, norautua, norautub, and ssjkrpkr to working. + + - Implemented a custom timer and counter to get correct reads in unknown hardware. + - Added buttons-lamps layout to smshilo. + - Promoted dphl, dphljp, and smshilo to working. + - Added technical notes. + + - Added hopper support. + - Extended palette. + - Identified dphlunka as Sure Shot. + - Custom palette for Sure Shot. + - Buttons-lamps layout for Sure Shot. + - Inputs for Sure Shot. + - Machine config for Sure Shot. + - Promoted dphla set to working. + - Promoted sureshoto set to working. + - Promoted dphlunkb set to working. + + - Added a default NVRAM to fastdrwp. + - Derivated inputs for fasdrwp. + - Added buttons-lamps layout for fastdrwp. + - Promoted fastdrwp set to working. TODO: - - Check the 3rd PPI device at 0xc0-0xc3 (VRAM). - /OBF handshake line (PC7) formerly didn't seems to work properly. - - Interrupts in 8080 based games. - - Emulation of 8228 device for the 8080 based games. - - Find WTH are the reads at EFh. + - Investigate and document what is connected to port EFh. - Find if wide chars are hardcoded or tied to a bit. - - Save support. - Parent/clone relationship. + issues... + + - norautua: overflow drawing cards (possible straight draw). + changing one card, draw a 6th card at the right. + + - dphl type, as dphljp, smshilo, dphlunkb, were flagged as + imperfect graphics due they show part of a paytable as garbage + when you coin/bet the game. After deal, they are not showing + this anymore. + + *******************************************************************************/ #include "emu.h" -#include "norautp.h" #include "cpu/i8085/i8085.h" #include "cpu/z80/z80.h" +#include "machine/i8255.h" #include "machine/nvram.h" +#include "machine/ticket.h" +#include "machine/timer.h" +#include "sound/discrete.h" +#include "emupal.h" +#include "screen.h" #include "speaker.h" +#include "noraut09_sureshot.lh" +#include "noraut10.lh" #include "noraut11.lh" #include "noraut12.lh" @@ -590,6 +620,113 @@ #define NORAUT_CPU_CLOCK NORAUT_MASTER_CLOCK / 8 // 2.30275 MHz - Measured: 2.305 MHz #define DPHL_CPU_CLOCK DPHL_MASTER_CLOCK / 9 // 2 MHz (from 8224) +// Discrete Sound Input Nodes +#define NORAUTP_SND_EN NODE_01 +#define NORAUTP_FREQ_DATA NODE_02 + + +class norautp_state : public driver_device +{ +public: + norautp_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), + m_maincpu(*this, "maincpu"), + m_ppi8255(*this, "ppi8255_%u", 0), + m_discrete(*this, "discrete"), + m_gfxdecode(*this, "gfxdecode"), + m_screen(*this, "screen"), + m_palette(*this, "palette"), + m_hopper(*this, "hopper"), + m_decrypted_opcodes(*this, "decrypted_opcodes"), + m_lamps(*this, "lamp%u", 0U) + { } + + void noraut_base(machine_config &config); + void kimble(machine_config &config); + void kimbldhl(machine_config &config); + void norautp(machine_config &config); + void norautu(machine_config &config); + void norautx4(machine_config &config); + void norautpl(machine_config &config); + void newhilop(machine_config &config); + void dphltest(machine_config &config); + void nortest1(machine_config &config); + void ssjkrpkr(machine_config &config); + void dphl(machine_config &config); + void dphla(machine_config &config); + void sureshoto(machine_config &config); + void drhl(machine_config &config); + void norautxp(machine_config &config); + void noraut3(machine_config &config); + void cgidjp(machine_config &config); + void cdrawpkr(machine_config &config); + + void init_ssa(); + void init_enc(); + void init_deb(); + void init_unka(); + void init_unkb(); + +protected: + virtual void machine_start() override { m_lamps.resolve(); save_item(NAME(m_videoram));} + virtual void video_start() override ATTR_COLD; + +private: + void ppi2_obf_w(int state); + TIMER_CALLBACK_MEMBER(ppi2_ack); + uint8_t test2_r(); + uint8_t test3_r(); + uint8_t test4_r(); + TIMER_DEVICE_CALLBACK_MEMBER(test_timer_cb); + void mainlamps_w(uint8_t data); + void soundlamps_w(uint8_t data); + void counterlamps_w(uint8_t data); + void norautp_palette(palette_device &palette) const; + void drhl_palette(palette_device &palette) const; + void sureshoto_palette(palette_device &palette) const; + uint32_t screen_update_norautp(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + void cgidjp_map(address_map &map) ATTR_COLD; + void cgidjp_opcodes_map(address_map &map) ATTR_COLD; + void decrypted_opcodes_map(address_map &map) ATTR_COLD; + void dphl_map(address_map &map) ATTR_COLD; + void dphl_portmap(address_map &map) ATTR_COLD; + void dphla_portmap(address_map &map) ATTR_COLD; + void dphla_map(address_map &map) ATTR_COLD; + void drhl_portmap(address_map &map) ATTR_COLD; + void dphltest_map(address_map &map) ATTR_COLD; + void drhl_map(address_map &map) ATTR_COLD; + void kimbldhl_map(address_map &map) ATTR_COLD; + void kimble_map(address_map &map) ATTR_COLD; + void newhilop_map(address_map &map) ATTR_COLD; + void noraut3_map(address_map &map) ATTR_COLD; + void noraut3_decrypted_opcodes_map(address_map &map) ATTR_COLD; + void norautp_map(address_map &map) ATTR_COLD; + void norautp_portmap(address_map &map) ATTR_COLD; + void norautx4_map(address_map &map) ATTR_COLD; + void norautx8_map(address_map &map) ATTR_COLD; + void norautxp_map(address_map &map) ATTR_COLD; + void norautxp_portmap(address_map &map) ATTR_COLD; + void nortest1_map(address_map &map) ATTR_COLD; + void ssjkrpkr_map(address_map &map) ATTR_COLD; + + std::unique_ptr m_np_vram; + required_device m_maincpu; + required_device_array m_ppi8255; + required_device m_discrete; + required_device m_gfxdecode; + required_device m_screen; + required_device m_palette; + required_device m_hopper; + optional_shared_ptr m_decrypted_opcodes; + output_finder<12> m_lamps; + + int m_test3 = 1; + int m_test3b = 0; + int m_test_count = 0; + uint8_t m_videoram[0x800] = {}; + +}; + /********************************************* * Video Hardware * @@ -618,6 +755,8 @@ uint32_t norautp_state::screen_update_norautp(screen_device &screen, bitmap_ind1 { int tile = m_np_vram[count] & 0x3f; int colour = (m_np_vram[count] & 0xc0) >> 6; + if((y == 4) | ( y == 5)) + colour = colour + 4; m_gfxdecode->gfx(1)->opaque(bitmap,cliprect, tile, colour, 0, 0, (x * 32) + 8, y * 32); @@ -653,6 +792,60 @@ void norautp_state::norautp_palette(palette_device &palette) const palette.set_pen_color(5, rgb_t(0xff, 0x00, 0x00)); // red palette.set_pen_color(6, rgb_t(0xff, 0xff, 0xff)); // white palette.set_pen_color(7, rgb_t(0x00, 0x00, 0x00)); // black + // 1st gfx bank + palette.set_pen_color(8, rgb_t(0x00, 0x00, 0xff)); // blue + palette.set_pen_color(9, rgb_t(0xff, 0xff, 0x00)); // yellow + palette.set_pen_color(10, rgb_t(0x00, 0x00, 0xff)); // blue + palette.set_pen_color(11, rgb_t(0xff, 0xff, 0xff)); // white + palette.set_pen_color(12, rgb_t(0xff, 0xff, 0xff)); // white + palette.set_pen_color(13, rgb_t(0xff, 0x00, 0x00)); // red + palette.set_pen_color(14, rgb_t(0xff, 0xff, 0xff)); // white + palette.set_pen_color(15, rgb_t(0x00, 0x00, 0x00)); // black + +} + +void norautp_state::drhl_palette(palette_device &palette) const +{ + // 1st gfx bank paleeta para drhl + palette.set_pen_color(0, rgb_t(0x00, 0x00, 0x00)); // black (blue) + palette.set_pen_color(1, rgb_t(0xff, 0xff, 0xff)); // white (yellow) + palette.set_pen_color(2, rgb_t(0xff, 0x00, 0x00)); // red (blue) + palette.set_pen_color(3, rgb_t(0xff, 0xff, 0xff)); // white (white) + palette.set_pen_color(4, rgb_t(0xff, 0xff, 0xff)); // white + palette.set_pen_color(5, rgb_t(0x00, 0x00, 0xff)); // red + palette.set_pen_color(6, rgb_t(0xff, 0xff, 0x00)); // yellow (white) + palette.set_pen_color(7, rgb_t(0x00, 0x00, 0xff)); // blue (black) + palette.set_pen_color(8, rgb_t(0x00, 0x00, 0x00)); // black (blue) + palette.set_pen_color(9, rgb_t(0xff, 0xff, 0xff)); // white (yellow) + palette.set_pen_color(10, rgb_t(0xff, 0x00, 0x00)); // red (blue) + palette.set_pen_color(11, rgb_t(0xff, 0xff, 0xff)); // white (white) + palette.set_pen_color(12, rgb_t(0xff, 0xff, 0xff)); // white + palette.set_pen_color(13, rgb_t(0x00, 0x00, 0xff)); // red + palette.set_pen_color(14, rgb_t(0xff, 0xff, 0x00)); // yellow (white) + palette.set_pen_color(15, rgb_t(0x00, 0x00, 0xff)); // blue (black) +} + +void norautp_state::sureshoto_palette(palette_device &palette) const +{ + // 1st gfx bank + palette.set_pen_color(0, rgb_t(0x00, 0x00, 0x00)); // blue + palette.set_pen_color(1, rgb_t(0xff, 0xff, 0x00)); // yellow + palette.set_pen_color(2, rgb_t(0x00, 0x00, 0x00)); // blue + palette.set_pen_color(3, rgb_t(0xff, 0xff, 0xff)); // white + palette.set_pen_color(4, rgb_t(0xff, 0xff, 0xff)); // white + palette.set_pen_color(5, rgb_t(0xff, 0x00, 0x00)); // red + palette.set_pen_color(6, rgb_t(0xff, 0xff, 0xff)); // white + palette.set_pen_color(7, rgb_t(0x00, 0x00, 0x00)); // black + + // alt palette + palette.set_pen_color(8, rgb_t(0xff, 0xff, 0xff)); // white + palette.set_pen_color(9, rgb_t(0x00, 0x00, 0x00)); // cards bg + palette.set_pen_color(10, rgb_t(0xff, 0xff, 0xff)); // white + palette.set_pen_color(11, rgb_t(0x00, 0x00, 0x00)); + palette.set_pen_color(12, rgb_t(0xff, 0xff, 0xff)); // white + palette.set_pen_color(13, rgb_t(0xff, 0x00, 0x00)); + palette.set_pen_color(14, rgb_t(0xff, 0xff, 0xff)); // white + palette.set_pen_color(15, rgb_t(0xff, 0x00, 0x00)); } @@ -728,28 +921,14 @@ void norautp_state::counterlamps_w(uint8_t data) m_lamps[10] = BIT(data, 0); // HI lamp m_lamps[11] = BIT(data, 1); // LO lamp + m_hopper->motor_w(BIT(data, 2)); + machine().bookkeeping().coin_counter_w(0, data & 0x10); // Coin1/3 counter machine().bookkeeping().coin_counter_w(1, data & 0x20); // Coin2 counter machine().bookkeeping().coin_counter_w(2, data & 0x08); // Payout pulse } -/* Game waits for bit 7 (0x80) to be set. - This should be the /OBF line (PC7) from PPI-2 (handshake). - PC0-PC2 could be set as input or output. -*/ - -//uint8_t norautp_state::ppi2_portc_r() -//{ -// return; -//} - -//void norautp_state::ppi2_portc_w(uint8_t data) -//{ -// // PC0-PC2 don't seems to be connected to any output -//} - - void norautp_state::ppi2_obf_w(int state) { machine().scheduler().synchronize(timer_expired_delegate(FUNC(norautp_state::ppi2_ack), this), state); @@ -763,44 +942,40 @@ TIMER_CALLBACK_MEMBER(norautp_state::ppi2_ack) uint8_t const np_addr = m_ppi8255[2]->pb_r(); uint8_t const vram_data = m_ppi8255[2]->pa_r(); m_np_vram[np_addr] = vram_data; + m_videoram[np_addr] = vram_data; } -} -#ifdef UNUSED_FUNCTION // old implementation -// game waits for /OBF signal (bit 7) to be set. -uint8_t norautp_state::test_r() -{ - return 0xff; } -uint8_t norautp_state::vram_data_r() +// game waits for bit 4 (0x10) to be reset. +uint8_t norautp_state::test2_r() { - return m_np_vram[m_np_addr]; + return 0x00; } -void norautp_state::vram_data_w(uint8_t data) +uint8_t norautp_state::test3_r() { - m_np_vram[m_np_addr] = data & 0xff; - - // trigger 8255-2 port C bit 7 (/OBF) - // m_ppi8255_2->set_pc_bit(7, 0); - // m_ppi8255_2->set_pc_bit(7, 1); + if(m_maincpu->pc() == 0x48) + { + m_test3b = (~m_test3b & 0x01) + (m_test_count & 0x02); + return m_test3b; + } + return (m_test_count &0x0f) + 0x10; } -void norautp_state::vram_addr_w(uint8_t data) +uint8_t norautp_state::test4_r() { - m_np_addr = data; + m_test3 = (~m_test3 & 0x01) + 0x14; + return m_test3; } -#endif -// game waits for bit 4 (0x10) to be reset. -uint8_t norautp_state::test2_r() + +TIMER_DEVICE_CALLBACK_MEMBER(norautp_state::test_timer_cb) { - return 0x00; + m_test_count++; } - /********************************************* * Memory Map Information * *********************************************/ @@ -808,55 +983,55 @@ uint8_t norautp_state::test2_r() CPU & PPI settings by set... - +----------+---------+--------------+--------+--------------+--------+--------------+------------------------+ - | Set | CPU | PPI-0 offset | config | PPI-1 offset | config | PPI-2 offset | config | - +----------+---------+--------------+--------+--------------+--------+--------------+------------------------+ - | norautp | Z80 | 0x60-0x63 | 0x90 | 0xA0-0xA3 | 0x92 | 0xC0-0xC3 | 0xC1 (PC0-2 as input) | - +----------+---------+--------------+--------+--------------+--------+--------------+------------------------+ - | norautdx | Z80 | 0x60-0x63 | 0x90 | 0xA0-0xA3 | 0x92 | 0xC0-0xC3 | 0xC0 | - +----------+---------+--------------+--------+--------------+--------+--------------+------------------------+ - | norautpn | Z80 | 0x60-0x63 | 0x90 | 0xA0-0xA3 | 0x92 | 0xC0-0xC3 | 0xC0 | - +----------+---------+--------------+--------+--------------+--------+--------------+------------------------+ - | norautjp | Z80 | 0x60-0x63 | 0x90 | 0xA0-0xA3 | 0x92 | 0xC0-0xC3 | 0xC1 (PC0-2 as input) | - +----------+---------+--------------+--------+--------------+--------+--------------+------------------------+ - | norautrh | Z80 | 0x60-0x63 | 0x90 | 0xA0-0xA3 | 0x92 | 0xC0-0xC3 | 0xC0 | - +----------+---------+--------------+--------+--------------+--------+--------------+------------------------+ - | norautu | BOXED | 0x60-0x63 | 0x90 | 0xA0-0xA3 | 0x92 | 0xC0-0xC3 | 0xC0 | - +----------+---------+--------------+--------+--------------+--------+--------------+------------------------+ - | norautv3 | Z80 | unknown | | unknown | | unknown | | - +----------+---------+--------------+--------+--------------+--------+--------------+------------------------+ - | pma | Z80 | 0x7C-0x7F | 0x90 | 0xBC-0xBF | 0x92 | 0xDC-0xDF | 0xC0 | - +----------+---------+--------------+--------+--------------+--------+--------------+------------------------+ - | bjpoker | Z80 | 0x7C-0x7F | 0x90 | 0xBC-0xBF | 0x92 | 0xDC-0xDF | 0xC0 | - +----------+---------+--------------+--------+--------------+--------+--------------+------------------------+ - | dphl | 8080 | 0x7C-0x7F | 0x90 | 0xBC-0xBF | 0x92 | 0xDC-0xDF | 0xC0 | - +----------+---------+--------------+--------+--------------+--------+--------------+------------------------+ - | dphla | 8080 | 0x60-0x63 | 0x90 | 0xA0-0xA3 | 0x92 | 0xC0-0xC3 | 0xC0 | - +----------+---------+--------------+--------+--------------+--------+--------------+------------------------+ - | dphljp | 8080 | 0x7C-0x7F | 0x90 | 0xBC-0xBF | 0x92 | 0xDC-0xDF | 0xC0 | - +----------+---------+--------------+--------+--------------+--------+--------------+------------------------+ - | kimbldhl | 8080 | 0x60-0x63 | 0x90 | 0xA0-0xA3 | 0x92 | 0xC0-0xC3 | 0xC0 | - +----------+---------+--------------+--------+--------------+--------+--------------+------------------------+ - | gtipoker | 8080 | 0x7C-0x7F | 0x90 | 0xBC-0xBF | 0x92 | 0xDC-0xDF | 0xC0 | - +----------+---------+--------------+--------+--------------+--------+--------------+------------------------+ - | smshilo | 8080 | 0x7C-0x7F | 0x90 | 0xBC-0xBF | 0x92 | 0xDC-0xDF | 0xC0 | - +----------+---------+--------------+--------+--------------+--------+--------------+------------------------+ - | tpoker2 | 8080 | 0x7C-0x7F | 0x90 | 0xBC-0xBF | 0x92 | 0xDC-0xDF | 0xC0 | - +----------+---------+--------------+--------+--------------+--------+--------------+------------------------+ - | drhl | 8080? | 0x7C-0x7F | 0x90 | 0xBC-0xBF | 0x92 | 0xDC-0xDF | 0xC0 | - +----------+---------+--------------+--------+--------------+--------+--------------+------------------------+ - | ssjkrpkr | 8080 | 0x60-0x63 | 0x90 | 0xA0-0xA3 | 0x92 | 0xC0-0xC3 | 0xC0 | - +----------+---------+--------------+--------+--------------+--------+--------------+------------------------+ - | fastdrwp | 8080? | 0x7C-0x7F | 0x90 | 0xBC-0xBF | 0x92 | 0xDC-0xDF | 0xC0 | - +----------+---------+--------------+--------+--------------+--------+--------------+------------------------+ - | dphlunka | 8080? | 0x7C-0x7F | 0x90 | 0xBC-0xBF | 0x92 | 0xDC-0xDF | 0xC0 | - +----------+---------+--------------+--------+--------------+--------+--------------+------------------------+ - | dphlunkb | 8080? | 0x7C-0x7F | 0x90 | 0xBC-0xBF | 0x92 | 0xDC-0xDF | 0xC0 | - +----------+---------+--------------+--------+--------------+--------+--------------+------------------------+ - | pkii_dm | Z80? | 0x7C-0x7F | 0x90 | 0xBC-0xBF | 0x92 | 0xDC-0xDF | 0xC0 | - +----------+---------+--------------+--------+--------------+--------+--------------+------------------------+ - | cdrawpkr | Z80 | 0x70-0x73 | 0x90 | 0xB0-0xB3 | 0x92 | 0xD0-0xD3 | 0xC0 | - +----------+---------+--------------+--------+--------------+--------+--------------+------------------------+ + +-----------+---------+--------------+--------+--------------+--------+--------------+------------------------+ + | Set | CPU | PPI-0 offset | config | PPI-1 offset | config | PPI-2 offset | config | + +-----------+---------+--------------+--------+--------------+--------+--------------+------------------------+ + | norautp | Z80 | 0x60-0x63 | 0x90 | 0xA0-0xA3 | 0x92 | 0xC0-0xC3 | 0xC1 (PC0-2 as input) | + +-----------+---------+--------------+--------+--------------+--------+--------------+------------------------+ + | norautdx | Z80 | 0x60-0x63 | 0x90 | 0xA0-0xA3 | 0x92 | 0xC0-0xC3 | 0xC0 | + +-----------+---------+--------------+--------+--------------+--------+--------------+------------------------+ + | norautpn | Z80 | 0x60-0x63 | 0x90 | 0xA0-0xA3 | 0x92 | 0xC0-0xC3 | 0xC0 | + +-----------+---------+--------------+--------+--------------+--------+--------------+------------------------+ + | norautjp | Z80 | 0x60-0x63 | 0x90 | 0xA0-0xA3 | 0x92 | 0xC0-0xC3 | 0xC1 (PC0-2 as input) | + +-----------+---------+--------------+--------+--------------+--------+--------------+------------------------+ + | norautrh | Z80 | 0x60-0x63 | 0x90 | 0xA0-0xA3 | 0x92 | 0xC0-0xC3 | 0xC0 | + +-----------+---------+--------------+--------+--------------+--------+--------------+------------------------+ + | norautu | BOXED | 0x60-0x63 | 0x90 | 0xA0-0xA3 | 0x92 | 0xC0-0xC3 | 0xC0 | + +-----------+---------+--------------+--------+--------------+--------+--------------+------------------------+ + | norautv3 | Z80 | unknown | | unknown | | unknown | | + +-----------+---------+--------------+--------+--------------+--------+--------------+------------------------+ + | pma | Z80 | 0x7C-0x7F | 0x90 | 0xBC-0xBF | 0x92 | 0xDC-0xDF | 0xC0 | + +-----------+---------+--------------+--------+--------------+--------+--------------+------------------------+ + | bjpoker | Z80 | 0x7C-0x7F | 0x90 | 0xBC-0xBF | 0x92 | 0xDC-0xDF | 0xC0 | + +-----------+---------+--------------+--------+--------------+--------+--------------+------------------------+ + | dphl | 8080 | 0x7C-0x7F | 0x90 | 0xBC-0xBF | 0x92 | 0xDC-0xDF | 0xC0 | + +-----------+---------+--------------+--------+--------------+--------+--------------+------------------------+ + | dphla | 8080 | 0x60-0x63 | 0x90 | 0xA0-0xA3 | 0x92 | 0xC0-0xC3 | 0xC0 | + +-----------+---------+--------------+--------+--------------+--------+--------------+------------------------+ + | dphljp | 8080 | 0x7C-0x7F | 0x90 | 0xBC-0xBF | 0x92 | 0xDC-0xDF | 0xC0 | + +-----------+---------+--------------+--------+--------------+--------+--------------+------------------------+ + | kimbldhl | 8080 | 0x60-0x63 | 0x90 | 0xA0-0xA3 | 0x92 | 0xC0-0xC3 | 0xC0 | + +-----------+---------+--------------+--------+--------------+--------+--------------+------------------------+ + | gtipoker | 8080 | 0x7C-0x7F | 0x90 | 0xBC-0xBF | 0x92 | 0xDC-0xDF | 0xC0 | + +-----------+---------+--------------+--------+--------------+--------+--------------+------------------------+ + | smshilo | 8080 | 0x7C-0x7F | 0x90 | 0xBC-0xBF | 0x92 | 0xDC-0xDF | 0xC0 | + +-----------+---------+--------------+--------+--------------+--------+--------------+------------------------+ + | tpoker2 | 8080 | 0x7C-0x7F | 0x90 | 0xBC-0xBF | 0x92 | 0xDC-0xDF | 0xC0 | + +-----------+---------+--------------+--------+--------------+--------+--------------+------------------------+ + | drhl | 8080? | 0x7C-0x7F | 0x90 | 0xBC-0xBF | 0x92 | 0xDC-0xDF | 0xC0 | + +-----------+---------+--------------+--------+--------------+--------+--------------+------------------------+ + | ssjkrpkr | 8080 | 0x60-0x63 | 0x90 | 0xA0-0xA3 | 0x92 | 0xC0-0xC3 | 0xC0 | + +-----------+---------+--------------+--------+--------------+--------+--------------+------------------------+ + | fastdrwp | 8080? | 0x7C-0x7F | 0x90 | 0xBC-0xBF | 0x92 | 0xDC-0xDF | 0xC0 | + +-----------+---------+--------------+--------+--------------+--------+--------------+------------------------+ + | sureshoto | 8080? | 0x7C-0x7F | 0x90 | 0xBC-0xBF | 0x92 | 0xDC-0xDF | 0xC0 | + +-----------+---------+--------------+--------+--------------+--------+--------------+------------------------+ + | dphlunkb | 8080? | 0x7C-0x7F | 0x90 | 0xBC-0xBF | 0x92 | 0xDC-0xDF | 0xC0 | + +-----------+---------+--------------+--------+--------------+--------+--------------+------------------------+ + | pkii_dm | Z80? | 0x7C-0x7F | 0x90 | 0xBC-0xBF | 0x92 | 0xDC-0xDF | 0xC0 | + +-----------+---------+--------------+--------+--------------+--------+--------------+------------------------+ + | cdrawpkr | Z80 | 0x70-0x73 | 0x90 | 0xB0-0xB3 | 0x92 | 0xD0-0xD3 | 0xC0 | + +-----------+---------+--------------+--------+--------------+--------+--------------+------------------------+ */ void norautp_state::norautp_map(address_map &map) @@ -872,15 +1047,13 @@ void norautp_state::decrypted_opcodes_map(address_map &map) map(0x0000, 0x1fff).rom().share(m_decrypted_opcodes); } + void norautp_state::norautp_portmap(address_map &map) { map.global_mask(0xff); map(0x60, 0x63).mirror(0x1c).rw("ppi8255_0", FUNC(i8255_device::read), FUNC(i8255_device::write)); map(0xa0, 0xa3).mirror(0x1c).rw("ppi8255_1", FUNC(i8255_device::read), FUNC(i8255_device::write)); map(0xc0, 0xc3).mirror(0x3c).rw("ppi8255_2", FUNC(i8255_device::read), FUNC(i8255_device::write)); - //map(0xc0, 0xc0).mirror(0x3c).rw(FUNC(norautp_state::vram_data_r), FUNC(norautp_state::vram_data_w)); - //map(0xc1, 0xc1).mirror(0x3c).w(FUNC(norautp_state::vram_addr_w)); - //map(0xc2, 0xc2).mirror(0x3c).r(FUNC(norautp_state::test_r)); map(0xef, 0xef).r(FUNC(norautp_state::test2_r)); } @@ -907,7 +1080,6 @@ void norautp_state::nortest1_map(address_map &map) void norautp_state::norautxp_map(address_map &map) { -// map.global_mask(~0x4000); map.global_mask(0x7fff); map(0x0000, 0x3fff).rom(); // need to be checked map(0x6000, 0x67ff).ram().share("nvram"); // HM6116 @@ -919,14 +1091,6 @@ void norautp_state::norautx4_map(address_map &map) map(0x6000, 0x67ff).ram().share("nvram"); // 6116 } -#ifdef UNUSED_CODE -void norautp_state::norautx8_map(address_map &map) -{ - map(0x0000, 0x7fff).rom(); // need to be checked - map(0xc000, 0xc7ff).ram().share("nvram"); // 6116 -} -#endif - void norautp_state::noraut3_map(address_map &map) { map(0x0000, 0x3fff).rom().region("maincpu", 0x4000); @@ -944,15 +1108,8 @@ void norautp_state::kimble_map(address_map &map) { map(0x0000, 0xbfff).rom(); map(0xc000, 0xc7ff).ram().share("nvram"); - map(0xc800, 0xc9ff).ram(); // working RAM? -} - -#ifdef UNUSED_CODE -void norautp_state::norautxp_portmap(address_map &map) -{ - map.global_mask(0xff); + map(0xc800, 0xcfff).ram(); // working RAM? } -#endif void norautp_state::newhilop_map(address_map &map) { @@ -974,7 +1131,7 @@ void norautp_state::cgidjp_opcodes_map(address_map &map) } -/*************** 8080 based **************/ +/*************** i8080 based **************/ void norautp_state::dphl_map(address_map &map) { @@ -1033,6 +1190,35 @@ void norautp_state::drhl_map(address_map &map) } +void norautp_state::dphla_portmap(address_map &map) +{ + map.global_mask(0xff); + map(0x60, 0x63).rw("ppi8255_0", FUNC(i8255_device::read), FUNC(i8255_device::write)); + map(0xa0, 0xa3).rw("ppi8255_1", FUNC(i8255_device::read), FUNC(i8255_device::write)); + map(0xc0, 0xc3).rw("ppi8255_2", FUNC(i8255_device::read), FUNC(i8255_device::write)); + map(0xef, 0xef).r(FUNC(norautp_state::test3_r)); +} + + +void norautp_state::dphl_portmap(address_map &map) +{ + map.global_mask(0xff); + map(0x7c, 0x7f).rw("ppi8255_0", FUNC(i8255_device::read), FUNC(i8255_device::write)); + map(0xbc, 0xbf).rw("ppi8255_1", FUNC(i8255_device::read), FUNC(i8255_device::write)); + map(0xdc, 0xdf).rw("ppi8255_2", FUNC(i8255_device::read), FUNC(i8255_device::write)); + map(0xef, 0xef).r(FUNC(norautp_state::test3_r)); +} + +void norautp_state::drhl_portmap(address_map &map) +{ + map.global_mask(0xff); + map(0x7c, 0x7f).rw("ppi8255_0", FUNC(i8255_device::read), FUNC(i8255_device::write)); + map(0xbc, 0xbf).rw("ppi8255_1", FUNC(i8255_device::read), FUNC(i8255_device::write)); + map(0xdc, 0xdf).rw("ppi8255_2", FUNC(i8255_device::read), FUNC(i8255_device::write)); + map(0xef, 0xef).r(FUNC(norautp_state::test4_r)); +} + + /********************************************* * Input Ports * *********************************************/ @@ -1044,7 +1230,7 @@ static INPUT_PORTS_START( norautp ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_GAMBLE_BET ) PORT_NAME("Bet / Collect") PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(2) // Coin A PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(2) // Coin B - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_K) PORT_NAME("IN0-5") + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) // PORT_CODE(KEYCODE_K) PORT_NAME("IN0-5") PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_GAMBLE_HIGH ) PORT_NAME("Hi") PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_GAMBLE_LOW ) PORT_NAME("Lo") PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT ) @@ -1065,28 +1251,28 @@ static INPUT_PORTS_START( norautp ) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_L) PORT_NAME("Low Level Hopper") PORT_START("DSW1") - PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) ) + PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW1:8") PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) + PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW1:7") PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) + PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW1:6") PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) + PORT_DIPNAME( 0x08, 0x08, "Random Raise Bet" ) PORT_DIPLOCATION("DSW1:5") PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) + PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW1:4") PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x20, 0x20, DEF_STR( Coinage ) ) + PORT_DIPNAME( 0x20, 0x20, DEF_STR( Coinage ) ) PORT_DIPLOCATION("DSW1:3") PORT_DIPSETTING( 0x20, "A=5; B=25; C=1" ) PORT_DIPSETTING( 0x00, "A=50; B=25; C=5" ) - PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) + PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW1:2") PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x80, 0x80, "Set Value" ) + PORT_DIPNAME( 0x80, 0x80, "Set Value" ) PORT_DIPLOCATION("DSW1:1") PORT_DIPSETTING( 0x80, "2 Pence" ) PORT_DIPSETTING( 0x00, "10 Pence" ) INPUT_PORTS_END @@ -1120,15 +1306,19 @@ static INPUT_PORTS_START( norautrh ) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_START("DSW1") + // to find the function... PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW1:8") PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW1:7") PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x04, 0x04, "Bet Max" ) PORT_DIPLOCATION("DSW1:6") - PORT_DIPSETTING( 0x04, "5" ) - PORT_DIPSETTING( 0x00, "25" ) + PORT_DIPSETTING( 0x04, "1" ) PORT_CONDITION("DSW1", 0x80, EQUALS, 0x00) + PORT_DIPSETTING( 0x00, "20" ) PORT_CONDITION("DSW1", 0x80, EQUALS, 0x00) + PORT_DIPSETTING( 0x04, "5 " ) PORT_CONDITION("DSW1", 0x80, EQUALS, 0x80) + PORT_DIPSETTING( 0x00, "25" ) PORT_CONDITION("DSW1", 0x80, EQUALS, 0x80) PORT_DIPNAME( 0x08, 0x08, "Raise Ante" ) PORT_DIPLOCATION("DSW1:5") PORT_DIPSETTING( 0x08, "Random" ) PORT_DIPSETTING( 0x00, "Always" ) @@ -1137,8 +1327,8 @@ static INPUT_PORTS_START( norautrh ) PORT_DIPSETTING( 0x00, "Joker Poker" ) PORT_DIPNAME( 0xa0, 0x20, DEF_STR( Coinage ) ) PORT_DIPLOCATION("DSW1:3,1") PORT_DIPSETTING( 0x00, "A=1; B=5" ) - PORT_DIPSETTING( 0xa0, "A=5; B=25" ) PORT_DIPSETTING( 0x20, "A=10; B=5" ) + PORT_DIPSETTING( 0xa0, "A=5; B=25" ) PORT_DIPSETTING( 0x80, "A=50; B=25" ) PORT_DIPNAME( 0x40, 0x00, "Show Bet") PORT_DIPLOCATION("DSW1:2") PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) @@ -1353,6 +1543,235 @@ static INPUT_PORTS_START( noraut3 ) INPUT_PORTS_END +static INPUT_PORTS_START( norautua ) + + PORT_INCLUDE( norautrh ) + + PORT_MODIFY("DSW1") + // to find the function... + PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW1:8") + PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW1:7") + PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + + PORT_DIPNAME( 0x04, 0x04, "Bet Max" ) PORT_DIPLOCATION("DSW1:6") + PORT_DIPSETTING( 0x04, "1" ) PORT_CONDITION("DSW1", 0x80, EQUALS, 0x00) + PORT_DIPSETTING( 0x00, "20" ) PORT_CONDITION("DSW1", 0x80, EQUALS, 0x00) + PORT_DIPSETTING( 0x04, "5 " ) PORT_CONDITION("DSW1", 0x80, EQUALS, 0x80) + PORT_DIPSETTING( 0x00, "25" ) PORT_CONDITION("DSW1", 0x80, EQUALS, 0x80) + PORT_DIPNAME( 0xa0, 0x20, DEF_STR( Coinage ) ) PORT_DIPLOCATION("DSW1:3,1") + PORT_DIPSETTING( 0x00, "A=1; B=5" ) + PORT_DIPSETTING( 0x20, "A=10; B=5" ) + PORT_DIPSETTING( 0x80, "A=5; B=25" ) + PORT_DIPSETTING( 0xa0, "A=50; B=25" ) +INPUT_PORTS_END + + +static INPUT_PORTS_START( dphl ) + + PORT_START("IN0") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 ) PORT_NAME("Deal") + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_GAMBLE_BET ) PORT_NAME("Bet / Collect") + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(2) // Coin A OK + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(2) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("IN0-5") PORT_CODE(KEYCODE_K) // give "ERROR" in some games + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_GAMBLE_HIGH ) PORT_NAME("Hi") + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_GAMBLE_LOW ) PORT_NAME("Lo") + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT ) + + PORT_START("IN1") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Stand")PORT_CODE(KEYCODE_D) // Stand: keep the hand + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_GAMBLE_DEAL ) PORT_NAME("Draw") + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_POKER_HOLD1 ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_POKER_HOLD2 ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_POKER_HOLD3 ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_POKER_HOLD4 ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_POKER_HOLD5 ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_POKER_CANCEL ) + + PORT_START("IN2") // unused + PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED ) // PPI set for PORT C all outputs + + PORT_START("DSW1") + PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW1:8") + PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW1:7") + PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW1:6") + PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW1:5") + PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x10, 0x10, "Cards to discard" ) PORT_DIPLOCATION("DSW1:4") + PORT_DIPSETTING( 0x10, "All 5 cards" ) + PORT_DIPSETTING( 0x00, "Max 3 cards" ) + PORT_DIPNAME( 0x60, 0x60, "2 Jokers in Deck" ) PORT_DIPLOCATION("DSW1:2,3") + PORT_DIPSETTING( 0x60, "Never" ) + PORT_DIPSETTING( 0x40, "When 8 or more is bet" ) + PORT_DIPSETTING( 0x20, "When 4 or more is bet" ) + PORT_DIPSETTING( 0x00, "Always" ) + PORT_DIPNAME( 0x80, 0x80, "Test Mode" ) PORT_DIPLOCATION("DSW1:1") + PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) +INPUT_PORTS_END + + +static INPUT_PORTS_START( dphla ) + + PORT_INCLUDE( dphl ) + + PORT_MODIFY("IN0") + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_READ_LINE_DEVICE_MEMBER("hopper", FUNC(ticket_dispenser_device::line_r)) // hopper +INPUT_PORTS_END + + +static INPUT_PORTS_START( drhl ) + + PORT_INCLUDE( dphla ) + + PORT_MODIFY("DSW1") + // to find the function... + PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW1:8") + PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW1:7") + PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW1:6") + PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x08, 0x08, "Test Mode" ) PORT_DIPLOCATION("DSW1:5") + PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x30, 0x30, "Max Bet" ) PORT_DIPLOCATION("DSW1:3,4") + PORT_DIPSETTING( 0x10, "10" ) + PORT_DIPSETTING( 0x00, "20" ) + PORT_DIPSETTING( 0x30, "30" ) + PORT_DIPSETTING( 0x20, "30" ) + PORT_DIPNAME( 0x40, 0x40, DEF_STR( Coinage ) ) PORT_DIPLOCATION("DSW1:2") + PORT_DIPSETTING( 0x40, DEF_STR( 1C_1C ) ) + PORT_DIPSETTING( 0x00, DEF_STR( 1C_5C ) ) + PORT_DIPNAME( 0x80, 0x80, "Bonus" ) PORT_DIPLOCATION("DSW1:1") + PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) +INPUT_PORTS_END + + +static INPUT_PORTS_START( ssjkrpkr ) + + PORT_INCLUDE( dphla ) + + PORT_MODIFY("DSW1") + PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW1:8") + PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x02, 0x02, "Cards to Discard" ) PORT_DIPLOCATION("DSW1:7") + PORT_DIPSETTING( 0x02, "All 5 cards" ) + PORT_DIPSETTING( 0x00, "Max 3 cards" ) + PORT_DIPNAME( 0x04, 0x00, "Double-Up" ) PORT_DIPLOCATION("DSW1:6") + PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x18, 0x10, "Max Bet" ) PORT_DIPLOCATION("DSW1:4,5") + PORT_DIPSETTING( 0x18, "1" ) + PORT_DIPSETTING( 0x08, "4" ) + PORT_DIPSETTING( 0x00, "9" ) + PORT_DIPSETTING( 0x10, "25" ) + + PORT_DIPNAME( 0x20, 0x00, "Break Game (set ON)" ) PORT_DIPLOCATION("DSW1:3") + PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + + PORT_DIPNAME( 0x40, 0x40, DEF_STR( Coinage ) ) PORT_DIPLOCATION("DSW1:2") + PORT_DIPSETTING( 0x40, DEF_STR( 1C_1C ) ) + PORT_DIPSETTING( 0x00, DEF_STR( 1C_5C ) ) + + PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW1:1") + PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) +INPUT_PORTS_END + + +static INPUT_PORTS_START( sureshoto ) + + PORT_INCLUDE( dphl ) + + PORT_MODIFY("IN0") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 ) PORT_NAME("Break (Deal)") + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) // unused bet + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) // unused coin 2 + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) // unused hi + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) // unused lo + + PORT_MODIFY("IN1") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Safe (Stand)") PORT_CODE(KEYCODE_D) // Stand: keep the hand + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_GAMBLE_DEAL ) PORT_NAME("Shoot (Draw)") + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_POKER_HOLD1 ) PORT_NAME("Scratch (Hold) 1") + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_POKER_HOLD2 ) PORT_NAME("Scratch (Hold) 2") + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_POKER_HOLD3 ) PORT_NAME("Scratch (Hold) 3") + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_POKER_HOLD4 ) PORT_NAME("Scratch (Hold) 4") + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_POKER_HOLD5 ) PORT_NAME("Scratch (Hold) 5") + + PORT_MODIFY("DSW1") + PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW1:8") + PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW1:7") + PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW1:6") + PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW1:5") + PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW1:4") + PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x60, 0x60, "2 Wild Cues" ) PORT_DIPLOCATION("DSW1:2,3") + PORT_DIPSETTING( 0x60, "Never" ) + PORT_DIPSETTING( 0x40, "When 4 or more is bet" ) + PORT_DIPSETTING( 0x20, "When 4 or more is bet" ) + PORT_DIPSETTING( 0x00, "Always" ) + PORT_DIPNAME( 0x80, 0x80, "Test Mode" ) PORT_DIPLOCATION("DSW1:1") + PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) +INPUT_PORTS_END + + +static INPUT_PORTS_START( fastdrwp ) + + PORT_INCLUDE( dphl ) + + PORT_MODIFY("DSW1") + PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW1:8") + PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW1:7") + PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW1:6") + PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW1:5") + PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + + // number of cards to discard in other games. + PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW1:4") + PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + + PORT_DIPNAME( 0x80, 0x80, "Test Mode" ) PORT_DIPLOCATION("DSW1:1") + PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) +INPUT_PORTS_END + + /********************************************* * Graphics Layouts * *********************************************/ @@ -1392,11 +1811,102 @@ static const gfx_layout charlayout32x32 = // GFX are stored in the 2nd half... Maybe the HW could handle 2 bitplanes? static GFXDECODE_START( gfx_norautp ) - GFXDECODE_ENTRY( "gfx", 0x800, charlayout, 0, 4 ) - GFXDECODE_ENTRY( "gfx", 0x800, charlayout32x32, 0, 4 ) + GFXDECODE_ENTRY( "gfx", 0x800, charlayout, 0, 8 ) + GFXDECODE_ENTRY( "gfx", 0x800, charlayout32x32, 0, 8 ) GFXDECODE_END +/************************************************** +* Discrete Sound Hardware * +**************************************************/ + +static const discrete_555_desc desc_norautp_555 = +{ + DISC_555_OUT_ENERGY | DISC_555_OUT_AC, + 5, // B+ voltage of 555 + DEFAULT_555_VALUES +}; + + +#define NORAUTP_SOUND_CIRCUIT(_name, _r1, _r2, _c1, _c2, _c3, _c4) \ +static const discrete_comp_adder_table desc_##_name##_caps = \ +{ \ + DISC_COMP_P_CAPACITOR, _c4, 3, \ + { \ + _c3, _c2, _c1 \ + } \ +}; \ + \ +DISCRETE_SOUND_START( _name##_discrete ) \ + /************************************************ \ + * Input register mapping \ + ************************************************/ \ + DISCRETE_INPUT_LOGIC(NORAUTP_SND_EN) \ + DISCRETE_INPUT_DATA (NORAUTP_FREQ_DATA) \ + \ + /************************************************ \ + * Tone Generator \ + ************************************************/ \ + DISCRETE_COMP_ADDER(NODE_20, NORAUTP_FREQ_DATA, &desc_##_name##_caps) \ + DISCRETE_555_ASTABLE(NODE_21, \ + NORAUTP_SND_EN, /* RESET */ \ + _r2, _r1, NODE_20, &desc_norautp_555) \ + \ + DISCRETE_OUTPUT(NODE_21, 65000.0/3.8) \ +DISCRETE_SOUND_END + + +/***** Noraut Poker *****/ + +/* Parts List - Resistors */ +#define NORAUTP_R1 RES_K(120) +#define NORAUTP_R2 RES_K(2.2) + +/* Parts List - Capacitors */ +#define NORAUTP_C1 CAP_U(.01) +#define NORAUTP_C2 CAP_U(.022) +#define NORAUTP_C3 CAP_U(.047) +#define NORAUTP_C4 CAP_U(.01) + +NORAUTP_SOUND_CIRCUIT(norautp, + NORAUTP_R1, NORAUTP_R2, + NORAUTP_C1, NORAUTP_C2, NORAUTP_C3, NORAUTP_C4) + + +/***** Draw Poker HI-LO *****/ + +/* Parts List - Resistors */ +#define DPHL_R1 RES_K(120) +#define DPHL_R2 RES_K(1) + +/* Parts List - Capacitors */ +#define DPHL_C1 CAP_U(.01) +#define DPHL_C2 CAP_U(.022) +#define DPHL_C3 CAP_U(.05) +#define DPHL_C4 CAP_U(.01) + +NORAUTP_SOUND_CIRCUIT(dphl, + DPHL_R1, DPHL_R2, + DPHL_C1, DPHL_C2, DPHL_C3, DPHL_C4) + + +/***** Kimble Double HI-LO *****/ + +/* Parts List - Resistors */ +#define KIMBLE_R1 RES_K(100) +#define KIMBLE_R2 RES_K(1) + +/* Parts List - Capacitors */ +#define KIMBLE_C1 CAP_U(.01) +#define KIMBLE_C2 CAP_U(.022) +#define KIMBLE_C3 CAP_U(.047) +#define KIMBLE_C4 CAP_U(.01) + +NORAUTP_SOUND_CIRCUIT(kimble, + KIMBLE_R1, KIMBLE_R2, + KIMBLE_C1, KIMBLE_C2, KIMBLE_C3, KIMBLE_C4) + + /********************************************* * Machine Drivers * *********************************************/ @@ -1441,7 +1951,9 @@ void norautp_state::noraut_base(machine_config &config) m_screen->set_palette(m_palette); GFXDECODE(config, m_gfxdecode, m_palette, gfx_norautp); - PALETTE(config, m_palette, FUNC(norautp_state::norautp_palette), 8); + PALETTE(config, m_palette, FUNC(norautp_state::norautp_palette), 16); + + HOPPER(config, m_hopper, attotime::from_msec(150)); // sound hardware SPEAKER(config, "mono").front_center(); @@ -1502,17 +2014,6 @@ void norautp_state::norautx4(machine_config &config) m_maincpu->set_vblank_int("screen", FUNC(norautp_state::irq0_line_hold)); } -#ifdef UNUSED_CODE -void norautp_state::norautx8(machine_config &config) -{ - noraut_base(config); - - // basic machine hardware - m_maincpu->set_addrmap(AS_PROGRAM, &norautp_state::norautx8_map); - m_maincpu->set_vblank_int("screen", FUNC(norautp_state::irq0_line_hold)); -} -#endif - void norautp_state::noraut3(machine_config &config) { noraut_base(config); @@ -1564,7 +2065,8 @@ void norautp_state::cdrawpkr(machine_config &config) m_screen->set_visarea(5*8, 61*8-1, (0*16) + 8, 16*16-1); } -/************** 8080 based **************/ + +/************** i8080 based **************/ void norautp_state::dphl(machine_config &config) { @@ -1573,7 +2075,10 @@ void norautp_state::dphl(machine_config &config) // basic machine hardware I8080(config.replace(), m_maincpu, DPHL_CPU_CLOCK); m_maincpu->set_addrmap(AS_PROGRAM, &norautp_state::dphl_map); - m_maincpu->set_addrmap(AS_IO, &norautp_state::norautp_portmap); + m_maincpu->set_addrmap(AS_IO, &norautp_state::dphl_portmap); + m_maincpu->set_vblank_int("screen", FUNC(norautp_state::irq0_line_hold)); + + TIMER(config, "test_timer").configure_periodic(FUNC(norautp_state::test_timer_cb), attotime::from_usec(100)); // sound hardware m_discrete->set_intf(dphl_discrete); @@ -1586,7 +2091,25 @@ void norautp_state::dphla(machine_config &config) // basic machine hardware I8080(config.replace(), m_maincpu, DPHL_CPU_CLOCK); m_maincpu->set_addrmap(AS_PROGRAM, &norautp_state::dphla_map); - m_maincpu->set_addrmap(AS_IO, &norautp_state::norautp_portmap); + m_maincpu->set_addrmap(AS_IO, &norautp_state::dphla_portmap); + m_maincpu->set_vblank_int("screen", FUNC(norautp_state::irq0_line_hold)); + + // sound hardware + m_discrete->set_intf(dphl_discrete); +} + +void norautp_state::sureshoto(machine_config &config) +{ + noraut_base(config); + + // basic machine hardware + I8080(config.replace(), m_maincpu, DPHL_CPU_CLOCK); + m_maincpu->set_addrmap(AS_PROGRAM, &norautp_state::dphl_map); + m_maincpu->set_addrmap(AS_IO, &norautp_state::dphl_portmap); + m_maincpu->set_vblank_int("screen", FUNC(norautp_state::irq0_line_hold)); + + TIMER(config, "test_timer").configure_periodic(FUNC(norautp_state::test_timer_cb), attotime::from_usec(100)); + PALETTE(config.replace(), "palette", FUNC(norautp_state::sureshoto_palette), 16); // sound hardware m_discrete->set_intf(dphl_discrete); @@ -1600,6 +2123,7 @@ void norautp_state::kimbldhl(machine_config &config) I8080(config.replace(), m_maincpu, DPHL_CPU_CLOCK); m_maincpu->set_addrmap(AS_PROGRAM, &norautp_state::kimbldhl_map); m_maincpu->set_addrmap(AS_IO, &norautp_state::norautp_portmap); + m_maincpu->set_vblank_int("screen", FUNC(norautp_state::irq0_line_hold)); // sound hardware m_discrete->set_intf(kimble_discrete); @@ -1613,6 +2137,7 @@ void norautp_state::dphltest(machine_config &config) I8080(config.replace(), m_maincpu, DPHL_CPU_CLOCK); m_maincpu->set_addrmap(AS_PROGRAM, &norautp_state::dphltest_map); m_maincpu->set_addrmap(AS_IO, &norautp_state::norautp_portmap); + m_maincpu->set_vblank_int("screen", FUNC(norautp_state::irq0_line_hold)); // sound hardware m_discrete->set_intf(dphl_discrete); @@ -1625,7 +2150,10 @@ void norautp_state::drhl(machine_config &config) // basic machine hardware I8080(config.replace(), m_maincpu, DPHL_CPU_CLOCK); m_maincpu->set_addrmap(AS_PROGRAM, &norautp_state::drhl_map); - m_maincpu->set_addrmap(AS_IO, &norautp_state::norautp_portmap); + m_maincpu->set_addrmap(AS_IO, &norautp_state::drhl_portmap); + m_maincpu->set_vblank_int("screen", FUNC(norautp_state::irq0_line_hold)); + + PALETTE(config.replace(), "palette", FUNC(norautp_state::drhl_palette), 16); // sound hardware m_discrete->set_intf(dphl_discrete); @@ -1639,6 +2167,7 @@ void norautp_state::ssjkrpkr(machine_config &config) I8080(config.replace(), m_maincpu, DPHL_CPU_CLOCK); m_maincpu->set_addrmap(AS_PROGRAM, &norautp_state::ssjkrpkr_map); m_maincpu->set_addrmap(AS_IO, &norautp_state::norautp_portmap); + m_maincpu->set_vblank_int("screen", FUNC(norautp_state::irq0_line_hold)); // sound hardware m_discrete->set_intf(dphl_discrete); @@ -2757,11 +3286,11 @@ ROM_START( newhilop ) ROM_END -//*************************************** 8080 sets ************************************** -//* * -//* The following ones are 'Draw Poker HI-LO' type, running in a 8080 based hardware * -//* * -//**************************************************************************************** +//************************************* i8080 sets ************************************* +//* * +//* The following ones are 'Draw Poker HI-LO' type, running in a 8080 based hardware * +//* * +//************************************************************************************** /* @@ -3597,10 +4126,12 @@ ROM_START( ssjkrpkr ) ROM_LOAD( "oc.u11", 0x0000, 0x1000, CRC(b9072aa5) SHA1(bfa3df090e1030aaebbb784cb5e686f4f84f2263) ) ROM_LOAD( "oc.u10", 0x1000, 0x1000, CRC(8652ebb9) SHA1(e907df4f8da99b42c425ed58da3cda9943c89fb7) ) - // All garbage inside. Replaced with generic GFX ROM from DPHLA set, modified to support the "'" char + // The ROM is broken and can't get a consistent dump. All is garbage inside. + // So, we are using a generic GFX ROM (from DPHLA set), modified to support + // the apostrophe, question mark, and arrow down symbols needed for the game. ROM_REGION( 0x1000, "gfx", 0 ) ROM_FILL( 0x0000, 0x0800, 0xff ) - ROM_LOAD( "oc.u27", 0x0800, 0x0800, BAD_DUMP CRC(ac8e9f2c) SHA1(25ab615de3055e5be78d409194edf7e3c03fe9b9) ) + ROM_LOAD( "oc.u27", 0x0800, 0x0800, BAD_DUMP CRC(6de843f8) SHA1(4403178b491ba3d8115ebb631450d094be730edc) ) ROM_END @@ -3615,7 +4146,7 @@ ROM_END The set was found as 'fastdraw'. No other info. Maybe is the poker conversion kit released by Stern as 'Fast Draw': - http://www.arcadeflyers.com/?page=thumbs&db=videodb&id=4602 + https://flyers.arcade-museum.com/videogames/show/4362 */ @@ -3630,18 +4161,19 @@ ROM_START( fastdrwp ) ROM_REGION( 0x0100, "proms", 0 ) ROM_LOAD( "u51_bpr.bin", 0x0000, 0x0100, CRC(812dc1f1) SHA1(b2af33ff36f2eca2f782bc2239bc9e54c2564f6a) ) + + ROM_REGION( 0x400, "nvram", 0 ) // default NVRAM + ROM_LOAD( "fastdrwp_nvram.bin", 0x000, 0x400, CRC(8b9f0c62) SHA1(b6c53444926811c4d3cd30317533ae8168aae843) ) ROM_END /* - - Unknown DPHL rev 1. + Sure Shot + SMS Manufacturing, 1993. No extra info inside the zip. Just ROM dumps... - Maybe from SMS Manufacturing, since there are GFX tiles with the SMS logo. */ - -ROM_START( dphlunka ) +ROM_START( sureshoto ) ROM_REGION( 0x10000, "maincpu", 0 ) // no stack, call's RET go to PC=0 ROM_LOAD( "u-12_ss.u12", 0x0000, 0x1000, CRC(10ddbc16) SHA1(ab683d836c9223bc67701e092c2cb95afc0f0fa2) ) ROM_LOAD( "u-18_ss.u18", 0x1000, 0x1000, CRC(ffbac2bf) SHA1(219247624e0eb0c0c805f5f9a96c4b6b60c9c5ac) ) @@ -4513,8 +5045,20 @@ void norautp_state::init_enc() case 0x0f: rom[i] = data_sub_table_0f[x]; break; } } + + uint8_t *ROM = memregion("maincpu")->base(); + // fix table for bin to bcd conversion + ROM[0x1da0] = 0x10; // 10.000 + ROM[0x1da1] = 0x27; + ROM[0x1da2] = 0xe8; // 1.000 + ROM[0x1da3] = 0x03; + ROM[0x1da4] = 0x64; // 100 + ROM[0x1da5] = 0x00; + ROM[0x1da6] = 0x0a; // 10 + ROM[0x1da7] = 0x00; } + void norautp_state::init_deb() // Just for debugging purposes // Should be removed soon @@ -4525,6 +5069,7 @@ void norautp_state::init_deb() ROM[0x206c] = 0xff; } + void norautp_state::init_ssa() /* Passing the video PPI handshaking lines */ /* Just for debugging purposes */ @@ -4540,6 +5085,31 @@ void norautp_state::init_ssa() // ROM[0x07b1] = 0x00; } +void norautp_state::init_unka() +{ + uint8_t *ROM = memregion("maincpu")->base(); + ROM[0x0000] = 0x00; + ROM[0x0001] = 0xf3; + ROM[0x0002] = 0x31; + ROM[0x0003] = 0xff; + ROM[0x0004] = 0xd0; + ROM[0x0005] = 0xc3; + ROM[0x0006] = 0x80; + ROM[0x0007] = 0x01; + ROM[0x01d5] = 0xaf; + +} + +void norautp_state::init_unkb() +{ + uint8_t *ROM = memregion("gfx")->base(); + for (int i = 0x0680; i < 0x0740; i++) + { + ROM[i] = ~ROM[i]; + ROM[i + 0x800] = ~ROM[i + 0x800]; + } +} + /********************************************* * Game Drivers * @@ -4549,61 +5119,61 @@ void norautp_state::init_ssa() //* The following ones are 'Draw Poker HI-LO' type, running in a Z80 based hardware * //************************************************************************************** -// YEAR NAME PARENT MACHINE INPUT CLASS INIT ROT COMPANY FULLNAME FLAGS LAYOUT -GAMEL( 1988, norautp, 0, norautp, norautp, norautp_state, empty_init, ROT0, "Noraut Ltd.", "Noraut Poker", 0, layout_noraut11 ) -GAMEL( 198?, norautdx, 0, norautp, norautpn, norautp_state, empty_init, ROT0, "Noraut Ltd.", "Noraut Deluxe Poker (console)", 0, layout_noraut12 ) -GAMEL( 198?, norautpn, norautp, norautp, norautpn, norautp_state, empty_init, ROT0, "bootleg", "Noraut Deluxe Poker (bootleg)", 0, layout_noraut12 ) -GAMEL( 198?, norautjo, 0, norautp, mainline, norautp_state, empty_init, ROT0, "Noraut Ltd.", "Noraut Joker Poker (original)", 0, layout_noraut12 ) -GAMEL( 198?, norautpl, 0, norautpl, mainline, norautp_state, empty_init, ROT0, "Video Fun Games Ltd.", "Noraut Joker Poker (Prologic HW)", 0, layout_noraut12 ) -GAMEL( 1988, norautjp, norautp, norautp, norautp, norautp_state, empty_init, ROT0, "Noraut Ltd.", "Noraut Joker Poker (alt)", 0, layout_noraut11 ) -GAMEL( 1988, norautrh, 0, norautp, norautrh, norautp_state, empty_init, ROT0, "Noraut Ltd.", "Noraut Red Hot Joker Poker", 0, layout_noraut12 ) -GAMEL( 198?, norautra, 0, norautp, norautrh, norautp_state, empty_init, ROT0, "Noraut Ltd.", "Noraut Red Hot Joker Poker (alt HW)", 0, layout_noraut12 ) // 1-bet?? where??... -GAME( 1988, norautu, 0, norautxp, norautp, norautp_state, empty_init, ROT0, "Noraut Ltd.", "Noraut Poker (NTX10A)", MACHINE_NOT_WORKING ) -GAMEL( 2002, noraut3a, 0, noraut3, noraut3, norautp_state, empty_init, ROT0, "Noraut Ltd.", "Noraut Jacks Plus / Joker Poker (V3.010a)", MACHINE_NOT_WORKING, layout_noraut12 ) -GAMEL( 2003, noraut3b, 0, noraut3, noraut3, norautp_state, empty_init, ROT0, "Noraut Ltd.", "Noraut Jacks Plus / Joker Poker (V3.011a)", MACHINE_NOT_WORKING, layout_noraut12 ) -GAMEL( 198?, norautua, 0, norautu, norautp, norautp_state, init_enc, ROT0, "Noraut Ltd.", "Noraut Joker Poker (console, set 1)", MACHINE_NOT_WORKING, layout_noraut12 ) -GAMEL( 198?, norautub, 0, norautu, norautp, norautp_state, init_enc, ROT0, "Noraut Ltd.", "Noraut Joker Poker (console, set 2)", MACHINE_NOT_WORKING, layout_noraut12 ) -GAMEL( 198?, mainline, 0, norautp, mainline, norautp_state, empty_init, ROT0, "Mainline London", "Mainline Double Joker Poker", 0, layout_noraut12 ) -GAMEL( 199?, df_djpkr, 0, norautp, mainline, norautp_state, empty_init, ROT0, "DellFern Ltd.", "Double Joker Poker (45%-75% payout)", 0, layout_noraut12 ) -GAMEL( 2005, ndxron10, 0, norautp, ndxron10, norautp_state, empty_init, ROT0, "", "Royal on Ten (hack of Noraut Deluxe Poker)", 0, layout_noraut12 ) -GAMEL( 1999, cgip30cs, 0, norautx4, norautkl, norautp_state, init_deb, ROT0, "CGI", "Credit Poker (ver.30c, standard)", 0, layout_noraut12 ) // CGI - Credit Poker, VERSION 30C, 21/12/99 -GAMEL( 1999, cgip30b, cgip30cs,norautx4, norautkl, norautp_state, empty_init, ROT0, "CGI", "Credit Poker (ver.30b, 7 & 9 bonus)", 0, layout_noraut12 ) // CGI - Credit Poker, VERSION 30B, 7 &9 BONUS, 21/12/99 BY V.S. for CGI -GAMEL( 1998, cgip23b, cgip30cs,norautx4, norautkl, norautp_state, empty_init, ROT0, "CGI", "Credit Poker (ver.23b, 7 & 9 bonus)", 0, layout_noraut12 ) // CGI - Credit Poker, VERSION 23B, 7 &9 BONUS, 31.03.98. BY V.S. -GAMEL( 19??, cgidjp, 0, cgidjp, mainline, norautp_state, empty_init, ROT0, "CGI", "Double Joker Poker (CGI)", 0, layout_noraut12 ) // very similar to df_djpkr -GAME( 198?, kimblz80, 0, kimble, norautp, norautp_state, empty_init, ROT0, "Kimble Ireland", "Kimble Double HI-LO (z80 version)", MACHINE_NOT_WORKING ) -GAME( 1983, pma, 0, nortest1, norautp, norautp_state, empty_init, ROT0, "PMA", "PMA Poker", MACHINE_NOT_WORKING ) -GAMEL( 198?, bjpoker, 0, norautxp, norautrh, norautp_state, empty_init, ROT0, "M.Kramer Manufacturing.", "Poker / Black Jack (Model 7521)", MACHINE_NOT_WORKING, layout_noraut12 ) -GAME( 19??, newhilop, 0, newhilop, norautp, norautp_state, empty_init, ROT0, "Song Won?", "New Hi-Low Poker", MACHINE_NOT_WORKING ) -GAMEL( 1984, cdrawpkr, 0, cdrawpkr, cdrawpkr, norautp_state, empty_init, ROT0, "Coinmaster", "Draw Poker (Joker Poker V.01)", 0, layout_noraut11 ) - - -//************************************* 8080 sets ************************************** -//* The following ones are 'Draw Poker HI-LO' type, running in a 8080 based hardware * -//************************************************************************************** - -// YEAR NAME PARENT MACHINE INPUT STATE INIT ROT COMPANY FULLNAME FLAGS LAYOUT -GAME( 1983, dphl, 0, dphl, norautp, norautp_state, empty_init, ROT0, "M.Kramer Manufacturing.", "Draw Poker HI-LO (M.Kramer)", MACHINE_NOT_WORKING ) -GAME( 1983, dphla, 0, dphla, norautp, norautp_state, empty_init, ROT0, "", "Draw Poker HI-LO (Alt)", MACHINE_NOT_WORKING ) -GAME( 1983, dphljp, 0, dphl, norautp, norautp_state, empty_init, ROT0, "", "Draw Poker HI-LO (Japanese)", MACHINE_NOT_WORKING ) -GAME( 198?, kimbldhl, 0, kimbldhl, norautp, norautp_state, empty_init, ROT0, "Kimble Ireland", "Kimble Double HI-LO", MACHINE_NOT_WORKING ) -GAME( 1983, gtipoker, 0, dphl, norautp, norautp_state, empty_init, ROT0, "GTI Inc", "GTI Poker", MACHINE_NOT_WORKING ) -GAME( 1983, gtipokra, 0, dphla, norautp, norautp_state, empty_init, ROT0, "GTI Inc", "GTI Poker? (SMS hardware)", MACHINE_NOT_WORKING ) -GAME( 1983, smshilo, 0, dphla, norautp, norautp_state, empty_init, ROT0, "SMS Manufacturing Corp.", "HI-LO Double Up Joker Poker", MACHINE_NOT_WORKING ) -GAME( 1986, drhl, 0, drhl, norautp, norautp_state, empty_init, ROT0, "Drews Inc.", "Drews Revenge (v.2.89, set 1)", MACHINE_NOT_WORKING ) -GAME( 1986, drhla, drhl, drhl, norautp, norautp_state, empty_init, ROT0, "Drews Inc.", "Drews Revenge (v.2.89, set 2)", MACHINE_NOT_WORKING ) -GAME( 1982, ssjkrpkr, 0, ssjkrpkr, norautp, norautp_state, init_ssa, ROT0, "Southern Systems & Assembly", "Southern Systems Joker Poker", MACHINE_NOT_WORKING ) +// YEAR NAME PARENT MACHINE INPUT CLASS INIT ROT COMPANY FULLNAME FLAGS LAYOUT +GAMEL( 1988, norautp, 0, norautp, norautp, norautp_state, empty_init, ROT0, "Noraut Ltd.", "Noraut Poker", 0, layout_noraut11 ) +GAMEL( 198?, norautdx, 0, norautp, norautpn, norautp_state, empty_init, ROT0, "Noraut Ltd.", "Noraut Deluxe Poker (console)", 0, layout_noraut12 ) +GAMEL( 198?, norautpn, norautp, norautp, norautpn, norautp_state, empty_init, ROT0, "bootleg", "Noraut Deluxe Poker (bootleg)", 0, layout_noraut12 ) +GAMEL( 198?, norautjo, 0, norautp, mainline, norautp_state, empty_init, ROT0, "Noraut Ltd.", "Noraut Joker Poker (original)", 0, layout_noraut12 ) +GAMEL( 198?, norautpl, 0, norautpl, mainline, norautp_state, empty_init, ROT0, "Video Fun Games Ltd.", "Noraut Joker Poker (Prologic HW)", 0, layout_noraut12 ) +GAMEL( 1988, norautjp, norautp, norautp, norautp, norautp_state, empty_init, ROT0, "Noraut Ltd.", "Noraut Joker Poker (alt)", 0, layout_noraut11 ) +GAMEL( 1988, norautrh, 0, norautp, norautrh, norautp_state, empty_init, ROT0, "Noraut Ltd.", "Noraut Red Hot Joker Poker", 0, layout_noraut12 ) +GAMEL( 198?, norautra, 0, norautp, norautrh, norautp_state, empty_init, ROT0, "Noraut Ltd.", "Noraut Red Hot Joker Poker (alt HW)", 0, layout_noraut12 ) +GAME( 1988, norautu, 0, norautxp, norautp, norautp_state, empty_init, ROT0, "Noraut Ltd.", "Noraut Poker (NTX10A)", MACHINE_NOT_WORKING ) +GAMEL( 2002, noraut3a, 0, noraut3, noraut3, norautp_state, empty_init, ROT0, "Noraut Ltd.", "Noraut Jacks Plus / Joker Poker (V3.010a)", MACHINE_NOT_WORKING, layout_noraut12 ) +GAMEL( 2003, noraut3b, 0, noraut3, noraut3, norautp_state, empty_init, ROT0, "Noraut Ltd.", "Noraut Jacks Plus / Joker Poker (V3.011a)", MACHINE_NOT_WORKING, layout_noraut12 ) +GAMEL( 198?, norautua, 0, norautu, norautua, norautp_state, init_enc, ROT0, "Noraut Ltd.", "Noraut Joker Poker (console, set 1)", MACHINE_IMPERFECT_GRAPHICS, layout_noraut12 ) // sometimes draw a repeated card +GAMEL( 198?, norautub, norautua, norautu, norautua, norautp_state, init_enc, ROT0, "Noraut Ltd.", "Noraut Joker Poker (console, set 2)", 0, layout_noraut12 ) +GAMEL( 198?, mainline, 0, norautp, mainline, norautp_state, empty_init, ROT0, "Mainline London", "Mainline Double Joker Poker", 0, layout_noraut12 ) +GAMEL( 199?, df_djpkr, 0, norautp, mainline, norautp_state, empty_init, ROT0, "DellFern Ltd.", "Double Joker Poker (45%-75% payout)", 0, layout_noraut12 ) +GAMEL( 2005, ndxron10, 0, norautp, ndxron10, norautp_state, empty_init, ROT0, "", "Royal on Ten (hack of Noraut Deluxe Poker)", 0, layout_noraut12 ) +GAMEL( 1999, cgip30cs, 0, norautx4, norautkl, norautp_state, init_deb, ROT0, "CGI", "Credit Poker (ver.30c, standard)", 0, layout_noraut12 ) // CGI - Credit Poker, VERSION 30C, 21/12/99 +GAMEL( 1999, cgip30b, cgip30cs, norautx4, norautkl, norautp_state, empty_init, ROT0, "CGI", "Credit Poker (ver.30b, 7 & 9 bonus)", 0, layout_noraut12 ) // CGI - Credit Poker, VERSION 30B, 7 &9 BONUS, 21/12/99 BY V.S. for CGI +GAMEL( 1998, cgip23b, cgip30cs, norautx4, norautkl, norautp_state, empty_init, ROT0, "CGI", "Credit Poker (ver.23b, 7 & 9 bonus)", 0, layout_noraut12 ) // CGI - Credit Poker, VERSION 23B, 7 &9 BONUS, 31.03.98. BY V.S. +GAMEL( 19??, cgidjp, 0, cgidjp, mainline, norautp_state, empty_init, ROT0, "CGI", "Double Joker Poker (CGI)", 0, layout_noraut12 ) // very similar to df_djpkr +GAME( 198?, kimblz80, 0, kimble, norautp, norautp_state, empty_init, ROT0, "Kimble Ireland", "Kimble Double HI-LO (z80 version)", MACHINE_NOT_WORKING ) +GAME( 1983, pma, 0, nortest1, norautp, norautp_state, empty_init, ROT0, "PMA", "PMA Poker", MACHINE_NOT_WORKING ) +GAMEL( 198?, bjpoker, 0, norautxp, norautrh, norautp_state, empty_init, ROT0, "M.Kramer Manufacturing.", "Poker / Black Jack (Model 7521)", MACHINE_NOT_WORKING, layout_noraut12 ) +GAME( 19??, newhilop, 0, newhilop, norautp, norautp_state, empty_init, ROT0, "Song Won?", "New Hi-Low Poker", MACHINE_NOT_WORKING ) +GAMEL( 1984, cdrawpkr, 0, cdrawpkr, cdrawpkr, norautp_state, empty_init, ROT0, "Coinmaster", "Draw Poker (Joker Poker V.01)", 0, layout_noraut11 ) + + +//************************************* i8080 sets ************************************** +//* The following ones are 'Draw Poker HI-LO' type, running in a i8080 based hardware * +//*************************************************************************************** + +// YEAR NAME PARENT MACHINE INPUT STATE INIT ROT COMPANY FULLNAME FLAGS LAYOUT +GAMEL( 1982, dphl, 0, dphl, dphl, norautp_state, empty_init, ROT0, "M.Kramer Manufacturing.", "Draw Poker HI-LO (M.Kramer)", MACHINE_IMPERFECT_GRAPHICS, layout_noraut10 ) +GAMEL( 1983, dphla, 0, dphla, dphla, norautp_state, empty_init, ROT0, "", "Joker Poker (Kramer, alt)", 0, layout_noraut10 ) +GAMEL( 1983, dphljp, 0, dphl, dphl, norautp_state, empty_init, ROT0, "", "Draw Poker HI-LO (Japanese)", MACHINE_IMPERFECT_GRAPHICS, layout_noraut10 ) +GAME( 198?, kimbldhl, 0, kimbldhl, norautp, norautp_state, empty_init, ROT0, "Kimble Ireland", "Kimble Double HI-LO", MACHINE_NOT_WORKING ) +GAME( 1983, gtipoker, 0, dphl, norautp, norautp_state, empty_init, ROT0, "GTI Inc", "GTI Poker", MACHINE_NOT_WORKING ) +GAME( 1983, gtipokra, 0, dphla, norautp, norautp_state, empty_init, ROT0, "GTI Inc", "GTI Poker? (SMS hardware)", MACHINE_NOT_WORKING ) +GAMEL( 1983, smshilo, 0, dphl, dphl, norautp_state, empty_init, ROT0, "SMS Manufacturing Corp.", "HI-LO Double Up Joker Poker", MACHINE_IMPERFECT_GRAPHICS, layout_noraut10 ) +GAMEL( 1986, drhl, 0, drhl, drhl, norautp_state, empty_init, ROT0, "Drews Inc.", "Drews Revenge (v.2.89, set 1)", 0, layout_noraut10 ) +GAMEL( 1986, drhla, drhl, drhl, drhl, norautp_state, empty_init, ROT0, "Drews Inc.", "Drews Revenge (v.2.89, set 2)", 0, layout_noraut10 ) +GAMEL( 1982, ssjkrpkr, 0, ssjkrpkr, ssjkrpkr, norautp_state, init_ssa, ROT0, "Southern Systems & Assembly", "Southern Systems Joker Poker", 0, layout_noraut10 ) // The following one also has a custom 68705 MCU -GAME( 1993, tpoker2, 0, dphltest, norautp, norautp_state, empty_init, ROT0, "Micro Manufacturing", "Turbo Poker 2", MACHINE_NOT_WORKING ) +GAME( 1993, tpoker2, 0, dphltest, norautp, norautp_state, empty_init, ROT0, "Micro Manufacturing", "Turbo Poker 2", MACHINE_NOT_WORKING ) //************************************ unknown sets ************************************ //* The following ones are still unknown. No info about name, CPU, manufacturer, or HW * //************************************************************************************** -// YEAR NAME PARENT MACHINE INPUT STATE INIT ROT COMPANY FULLNAME FLAGS LAYOUT -GAME( 198?, fastdrwp, 0, dphl, norautp, norautp_state, empty_init, ROT0, "Stern Electronics?", "Fast Draw (poker conversion kit)?", MACHINE_NOT_WORKING ) -GAME( 198?, dphlunka, 0, dphl, norautp, norautp_state, empty_init, ROT0, "SMS Manufacturing Corp.", "Draw Poker HI-LO (unknown, rev 1)", MACHINE_NOT_WORKING ) -GAME( 198?, dphlunkb, 0, dphl, norautp, norautp_state, empty_init, ROT0, "SMS Manufacturing Corp.", "Draw Poker HI-LO (unknown, rev 2)", MACHINE_NOT_WORKING ) -GAME( 198?, pkii_dm, 0, nortest1, norautp, norautp_state, empty_init, ROT0, "", "unknown poker game PKII/DM", MACHINE_NOT_WORKING ) -GAME( 1989, unkljfpk, 0, nortest1, norautp, norautp_state, empty_init, ROT0, "LJF Corporation", "unknown LJF Corporation poker game", MACHINE_NOT_WORKING ) +// YEAR NAME PARENT MACHINE INPUT STATE INIT ROT COMPANY FULLNAME FLAGS LAYOUT +GAMEL( 198?, fastdrwp, 0, dphl, fastdrwp, norautp_state, empty_init, ROT0, "Stern Electronics", "Fast Draw (poker conversion kit)", 0, layout_noraut10 ) +GAMEL( 1983, sureshoto, 0, sureshoto, sureshoto, norautp_state, init_unka, ROT0, "SMS Manufacturing Corp.", "Sure Shot (older, dphl hardware)", MACHINE_IMPERFECT_GRAPHICS, layout_noraut09_sureshot ) +GAMEL( 198?, dphlunkb, 0, dphl, dphla, norautp_state, init_unkb, ROT0, "SMS Manufacturing Corp.", "Draw Poker HI-LO (alt GFX)", MACHINE_IMPERFECT_GRAPHICS, layout_noraut10 ) +GAME( 198?, pkii_dm, 0, nortest1, norautp, norautp_state, empty_init, ROT0, "", "unknown poker game PKII/DM", MACHINE_NOT_WORKING ) +GAME( 1989, unkljfpk, 0, nortest1, norautp, norautp_state, empty_init, ROT0, "LJF Corporation", "unknown LJF Corporation poker game", MACHINE_NOT_WORKING ) diff --git a/src/mame/misc/norautp.h b/src/mame/misc/norautp.h deleted file mode 100644 index dc2338a0f62d0..0000000000000 --- a/src/mame/misc/norautp.h +++ /dev/null @@ -1,107 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Angelo Salese, Roberto Fresca -#ifndef MAME_MISC_NORAUTP_H -#define MAME_MISC_NORAUTP_H - -#pragma once - -#include "machine/i8255.h" -#include "sound/discrete.h" -#include "emupal.h" -#include "screen.h" - - -/* Discrete Sound Input Nodes */ -#define NORAUTP_SND_EN NODE_01 -#define NORAUTP_FREQ_DATA NODE_02 - - -class norautp_state : public driver_device -{ -public: - norautp_state(const machine_config &mconfig, device_type type, const char *tag) : - driver_device(mconfig, type, tag), - m_maincpu(*this, "maincpu"), - m_ppi8255(*this, "ppi8255_%u", 0), - m_discrete(*this, "discrete"), - m_gfxdecode(*this, "gfxdecode"), - m_screen(*this, "screen"), - m_palette(*this, "palette"), - m_decrypted_opcodes(*this, "decrypted_opcodes"), - m_lamps(*this, "lamp%u", 0U) - { } - - void noraut_base(machine_config &config); - void kimble(machine_config &config); - void kimbldhl(machine_config &config); - void norautp(machine_config &config); - void norautu(machine_config &config); - void norautx4(machine_config &config); - void norautpl(machine_config &config); - void newhilop(machine_config &config); - void dphltest(machine_config &config); - void nortest1(machine_config &config); - void ssjkrpkr(machine_config &config); - void dphl(machine_config &config); - void dphla(machine_config &config); - void drhl(machine_config &config); - void norautxp(machine_config &config); - void noraut3(machine_config &config); - void cgidjp(machine_config &config); - void cdrawpkr(machine_config &config); - - void init_ssa(); - void init_enc(); - void init_deb(); - -protected: - virtual void machine_start() override { m_lamps.resolve(); } - virtual void video_start() override ATTR_COLD; - -private: - void ppi2_obf_w(int state); - TIMER_CALLBACK_MEMBER(ppi2_ack); - uint8_t test2_r(); - void mainlamps_w(uint8_t data); - void soundlamps_w(uint8_t data); - void counterlamps_w(uint8_t data); - void norautp_palette(palette_device &palette) const; - uint32_t screen_update_norautp(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - void cgidjp_map(address_map &map) ATTR_COLD; - void cgidjp_opcodes_map(address_map &map) ATTR_COLD; - void decrypted_opcodes_map(address_map &map) ATTR_COLD; - void dphl_map(address_map &map) ATTR_COLD; - void dphla_map(address_map &map) ATTR_COLD; - void dphltest_map(address_map &map) ATTR_COLD; - void drhl_map(address_map &map) ATTR_COLD; - void kimbldhl_map(address_map &map) ATTR_COLD; - void kimble_map(address_map &map) ATTR_COLD; - void newhilop_map(address_map &map) ATTR_COLD; - void noraut3_map(address_map &map) ATTR_COLD; - void noraut3_decrypted_opcodes_map(address_map &map) ATTR_COLD; - void norautp_map(address_map &map) ATTR_COLD; - void norautp_portmap(address_map &map) ATTR_COLD; - void norautx4_map(address_map &map) ATTR_COLD; - void norautx8_map(address_map &map) ATTR_COLD; - void norautxp_map(address_map &map) ATTR_COLD; - void norautxp_portmap(address_map &map) ATTR_COLD; - void nortest1_map(address_map &map) ATTR_COLD; - void ssjkrpkr_map(address_map &map) ATTR_COLD; - - std::unique_ptr m_np_vram; - required_device m_maincpu; - required_device_array m_ppi8255; - required_device m_discrete; - required_device m_gfxdecode; - required_device m_screen; - required_device m_palette; - optional_shared_ptr m_decrypted_opcodes; - output_finder<12> m_lamps; -}; - -/*----------- defined in audio/norautp.c -----------*/ -DISCRETE_SOUND_EXTERN( norautp_discrete ); -DISCRETE_SOUND_EXTERN( dphl_discrete ); -DISCRETE_SOUND_EXTERN( kimble_discrete ); - -#endif // MAME_MISC_NORAUTP_H diff --git a/src/mame/misc/norautp_a.cpp b/src/mame/misc/norautp_a.cpp deleted file mode 100644 index c614c75c3111c..0000000000000 --- a/src/mame/misc/norautp_a.cpp +++ /dev/null @@ -1,100 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Derrick Renaud, Roberto Fresca -/************************************************************************ - * Noraut/Kimble/Kramer Poker Sound System Analog emulation - * Sept 2009, Derrick Renaud & Roberto Fresca. - ************************************************************************/ - -#include "emu.h" -#include "norautp.h" - - -/* Discrete Sound Input Nodes */ -/* defined in norautp.h */ - - -static const discrete_555_desc desc_norautp_555 = -{ - DISC_555_OUT_ENERGY | DISC_555_OUT_AC, - 5, // B+ voltage of 555 - DEFAULT_555_VALUES -}; - - -#define NORAUTP_SOUND_CIRCUIT(_name, _r1, _r2, _c1, _c2, _c3, _c4) \ -static const discrete_comp_adder_table desc_##_name##_caps = \ -{ \ - DISC_COMP_P_CAPACITOR, _c4, 3, \ - { \ - _c3, _c2, _c1 \ - } \ -}; \ - \ -DISCRETE_SOUND_START( _name##_discrete ) \ - /************************************************ \ - * Input register mapping \ - ************************************************/ \ - DISCRETE_INPUT_LOGIC(NORAUTP_SND_EN) \ - DISCRETE_INPUT_DATA (NORAUTP_FREQ_DATA) \ - \ - /************************************************ \ - * Tone Generator \ - ************************************************/ \ - DISCRETE_COMP_ADDER(NODE_20, NORAUTP_FREQ_DATA, &desc_##_name##_caps) \ - DISCRETE_555_ASTABLE(NODE_21, \ - NORAUTP_SND_EN, /* RESET */ \ - _r2, _r1, NODE_20, &desc_norautp_555) \ - \ - DISCRETE_OUTPUT(NODE_21, 65000.0/3.8) \ -DISCRETE_SOUND_END - - -/***** Noraut Poker *****/ - -/* Parts List - Resistors */ -#define NORAUTP_R1 RES_K(120) -#define NORAUTP_R2 RES_K(2.2) - -/* Parts List - Capacitors */ -#define NORAUTP_C1 CAP_U(.01) -#define NORAUTP_C2 CAP_U(.022) -#define NORAUTP_C3 CAP_U(.047) -#define NORAUTP_C4 CAP_U(.01) - -NORAUTP_SOUND_CIRCUIT(norautp, - NORAUTP_R1, NORAUTP_R2, - NORAUTP_C1, NORAUTP_C2, NORAUTP_C3, NORAUTP_C4) - - -/***** Draw Poker HI-LO *****/ - -/* Parts List - Resistors */ -#define DPHL_R1 RES_K(120) -#define DPHL_R2 RES_K(1) - -/* Parts List - Capacitors */ -#define DPHL_C1 CAP_U(.01) -#define DPHL_C2 CAP_U(.022) -#define DPHL_C3 CAP_U(.05) -#define DPHL_C4 CAP_U(.01) - -NORAUTP_SOUND_CIRCUIT(dphl, - DPHL_R1, DPHL_R2, - DPHL_C1, DPHL_C2, DPHL_C3, DPHL_C4) - - -/***** Kimble Double HI-LO *****/ - -/* Parts List - Resistors */ -#define KIMBLE_R1 RES_K(100) -#define KIMBLE_R2 RES_K(1) - -/* Parts List - Capacitors */ -#define KIMBLE_C1 CAP_U(.01) -#define KIMBLE_C2 CAP_U(.022) -#define KIMBLE_C3 CAP_U(.047) -#define KIMBLE_C4 CAP_U(.01) - -NORAUTP_SOUND_CIRCUIT(kimble, - KIMBLE_R1, KIMBLE_R2, - KIMBLE_C1, KIMBLE_C2, KIMBLE_C3, KIMBLE_C4) diff --git a/src/mame/misc/skyarmy.cpp b/src/mame/misc/skyarmy.cpp index 1be842bb29e80..823405d5e8614 100644 --- a/src/mame/misc/skyarmy.cpp +++ b/src/mame/misc/skyarmy.cpp @@ -25,9 +25,12 @@ */ #include "emu.h" + #include "cpu/z80/z80.h" #include "machine/74259.h" +#include "machine/timer.h" #include "sound/ay8910.h" + #include "emupal.h" #include "screen.h" #include "speaker.h" @@ -80,7 +83,7 @@ class skyarmy_state : public driver_device uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - INTERRUPT_GEN_MEMBER(nmi_source); + TIMER_DEVICE_CALLBACK_MEMBER(scanline); void skyarmy_io_map(address_map &map) ATTR_COLD; void skyarmy_map(address_map &map) ATTR_COLD; }; @@ -180,10 +183,17 @@ uint32_t skyarmy_state::screen_update(screen_device &screen, bitmap_ind16 &bitma return 0; } -INTERRUPT_GEN_MEMBER(skyarmy_state::nmi_source) +TIMER_DEVICE_CALLBACK_MEMBER(skyarmy_state::scanline) { - if (m_nmi) + int scanline = param; + + // 16 NMIs per frame + if ((scanline & 0xf) == 0 && scanline <= 240 && m_nmi) m_maincpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE); + + // vblank interrupt + if (scanline == 248) + m_maincpu->set_input_line(0, HOLD_LINE); } @@ -313,11 +323,11 @@ GFXDECODE_END void skyarmy_state::skyarmy(machine_config &config) { - Z80(config, m_maincpu, 4000000); + Z80(config, m_maincpu, 18.432_MHz_XTAL / 6); m_maincpu->set_addrmap(AS_PROGRAM, &skyarmy_state::skyarmy_map); m_maincpu->set_addrmap(AS_IO, &skyarmy_state::skyarmy_io_map); - m_maincpu->set_vblank_int("screen", FUNC(skyarmy_state::irq0_line_hold)); - m_maincpu->set_periodic_int(FUNC(skyarmy_state::nmi_source), attotime::from_hz(650)); + + TIMER(config, "scanline").configure_scanline(FUNC(skyarmy_state::scanline), "screen", 0, 1); ls259_device &latch(LS259(config, "latch")); // 11C latch.q_out_cb<0>().set(FUNC(skyarmy_state::coin_counter_w)); @@ -328,10 +338,7 @@ void skyarmy_state::skyarmy(machine_config &config) /* video hardware */ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); - screen.set_refresh_hz(60); - screen.set_vblank_time(ATTOSECONDS_IN_USEC(0)); - screen.set_size(32*8,32*8); - screen.set_visarea(0*8,32*8-1,1*8,31*8-1); + screen.set_raw(18.432_MHz_XTAL / 3, 384, 0, 256, 264, 8, 248); screen.set_screen_update(FUNC(skyarmy_state::screen_update)); screen.set_palette(m_palette); @@ -340,8 +347,8 @@ void skyarmy_state::skyarmy(machine_config &config) /* sound hardware */ SPEAKER(config, "mono").front_center(); - AY8910(config, "ay0", 2500000).add_route(ALL_OUTPUTS, "mono", 0.15); - AY8910(config, "ay1", 2500000).add_route(ALL_OUTPUTS, "mono", 0.15); + AY8910(config, "ay0", 18.432_MHz_XTAL / 12).add_route(ALL_OUTPUTS, "mono", 0.5); + AY8910(config, "ay1", 18.432_MHz_XTAL / 12).add_route(ALL_OUTPUTS, "mono", 0.5); } diff --git a/src/mame/misc/vpoker.cpp b/src/mame/misc/vpoker.cpp index 45a26931e14c2..81ba231c8c73e 100644 --- a/src/mame/misc/vpoker.cpp +++ b/src/mame/misc/vpoker.cpp @@ -1,34 +1,42 @@ // license:BSD-3-Clause -// copyright-holders:Angelo Salese, Roberto Fresca +// copyright-holders: Angelo Salese, Roberto Fresca, Grull Osgo /************************************************************************************************************** - Videotronics Poker (c) 198? Videotronics - Preliminary driver by Angelo Salese & Roberto Fresca. + Challenger Draw Poker (c) 198? Videotronics. + Driver by Angelo Salese, Roberto Fresca & Grull Osgo. + + + The Challenger series had three games: + + * Challenger Draw Poker + https://flyers.arcade-museum.com/videogames/show/4296 + https://flyers.arcade-museum.com/videogames/show/4374 + + * Challenger Black Jack 21 + https://flyers.arcade-museum.com/videogames/show/4295 + + * Challenger In Between + https://flyers.arcade-museum.com/videogames/show/4297 + Notes: - - Looks like the 2nd generation of Noraut Poker / Draw Poker Hi-Lo HW. - - I found two companies that sold the same game with different name... + I found two companies that sold the same game with different name: 1) "Challenger Draw Poker", from Bend Electronics Co. Inc. 2) "VHI Draw Poker", from Video Horizons, Inc. - Both companies shared the same address and phone number: - 63353 Nels Anderson Road. Bend, Oregon 97701. - Tel: 503-389-7626. + Both companies shared the same address and phone number: + 63353 Nels Anderson Road. Bend, Oregon 97701. + Tel: 503-389-7626. - Bend Electronics Co. Inc. claims that they are worldwide distributors for Videotronics, Inc. + Bend Electronics Co. Inc. claims that they are worldwide distributors for Videotronics, Inc. - There are some legal issues between all these companies... - https://scholar.google.com/scholar_case?case=7993095852400122011 - http://www.plainsite.org/dockets/201rtodjb/nevada-district-court/videotronics-inc-v-bend-electronics/ + There are some legal issues between all these companies... + https://scholar.google.com/scholar_case?case=7993095852400122011 + http://www.plainsite.org/dockets/201rtodjb/nevada-district-court/videotronics-inc-v-bend-electronics/ - TODO: - - Understand how the 6840PTM hooks up, needed to let it work properly; - - I/Os; - - sound; - =============================================================================================================== Bought as "old poker game by videotronics early 80's" @@ -63,12 +71,14 @@ ROM data showed cards - 6809 CPU + MC6809 CPU 4.000 Mhz crystal MC6840P - mm74c920J/mmc6551j-9 x2 + mm74c920J x2 + mmc6551j-9 x2 + -************************************************************************************************************** +=============================================================================================================== - Added 5-Aces Poker (Roberto Fresca) @@ -86,7 +96,7 @@ .7 2764 handwritten sticker 688C 4 MHz crystal - 6809 + HD68A09P MC6840P nmc6514-9 x2 nm23114 x2 @@ -95,16 +105,131 @@ SA2889-0697 stamped ETC -**************************************************************************************************************/ +=============================================================================================================== + + Driver notes: + + meters offsets: + + Aces: 16a-16b + 2 Pair: 16c-16d + 3 of a Kind: 16e-16f + Straight: 170-171 + Flush: 172-173 + Full House: 173-174 + 4 of a Kind: 175-176 + Straight Flush: 177-178 + + Coins In: 188-189-18a-18b + Credits Played: 18c-18d-18e-18f + Credits Won: 190-191-192-193 + Cleared: 180-181-182-183 + Games Played: 194-195-196-197 + Games Won: 184-185-186-187 + + + registers: + + Credits: da-db + Coins in: dd + + +=============================================================================================================== + + Notes by game: + + + * 5-Aces Poker + + Game Mode Access: Before entering the game mode, a system check must be completed. + Once the check is finished, you can insert coins and start playing. + + Entering Setup Mode: To enter the Setup Mode, press the SETUP key (F2). + + SET UP + TIMER 6... + + In Setup Mode, you can adjust each item using the following controls: + + - BET button (M key) to increase the value or turn the item off. + - DEAL button (1 key) to decrease the value or turn the item on. + - Use the CANCEL button to move to the next item. + + SET UP + TIMER 6 (range: 1 to 12) + MAX BET 8 (range: 5 to 50) + AUTO BET OFF (options: OFF/ON) + AUTO DEAL OFF (options: OFF/ON) + REBET OFF (options: OFF/ON) + + After adjusting the last item, you will return to the game mode. + + Saving NVRAM Data: If you need to power off the machine but want to save the NVRAM data, + press the "Save and Halt" service (key 9), then turn off the machine. Upon reboot, all + previous data will be restored. + + +=============================================================================================================== + + Updates [2025-03-04]: + + - Change vpoker description to Challenger Draw Poker. + - Inputs from the scratch. + - Split machine drivers for each game. + - Hook clocks to the 6840 PTM. + - Reworked interrupts handling. + - Lamps support for both sets. + - Adjusted screen visible area per game. + - Clickable button-lamps layout for vpoker. + - Clickable button-lamps layout for 5acespkr. + - Mech counters support. + - NVRAM support. + - Added sigma-delta DAC sound support. + - Promoted vpoker to working. + - Promoted 5acespkr to working. + - Added technical notes. + + Updates [2025-03-06]: + + - Rewrote the lamps scheme. + - Fixed the button-lamps layouts accordingly. + - Added workaround for the NMI routine (vpoker). + - Fixed vpoker NVRAM issues. + - Fixed mech counters support per game. + + Updates [2025-03-08]: + + - Workaround for NMI to get the Save and Halt function (5-Aces). + - Solved any issues regarding interrupt vectors. + - Documented the 5-Aces Poker SETUP mode. + - Fixed the 5-Aces Poker vertical refresh rate. + - Renamed function according to its own interrupts vector name. + - Unified most of the inputs. + - Rewrote the 5-Aces Poker machine config to use the vpoker one as base config. + - Added links to the Challenger Draw Poker flyers. + - Added technical notes. + + + TODO: + + - Nothing... :) + + +**************************************************************************************************************/ #include "emu.h" #include "cpu/m6809/m6809.h" #include "machine/6840ptm.h" +#include "machine/nvram.h" +#include "sound/dac.h" #include "emupal.h" #include "screen.h" #include "speaker.h" +#include "vpoker.lh" +#include "5acespkr.lh" + namespace { @@ -116,29 +241,50 @@ class vpoker_state : public driver_device m_maincpu(*this, "maincpu"), m_gfxdecode(*this, "gfxdecode"), m_palette(*this, "palette"), - m_in0(*this, "IN0") + m_dac(*this, "dac"), + m_in0(*this, "IN0"), + m_in1(*this, "IN1"), + m_in2(*this, "IN2"), + m_lamps(*this, "lamp%u", 0U) + { } void vpoker(machine_config &config); + void fiveaces(machine_config &config); protected: + virtual void machine_start() override ATTR_COLD; virtual void video_start() override ATTR_COLD; private: + uint8_t nvram_r(offs_t offset); + void nvram_w(offs_t offset, u8 data); std::unique_ptr m_videoram; + std::unique_ptr m_nvram_data; uint8_t m_blit_ram[8]; uint8_t blitter_r(offs_t offset); void blitter_w(offs_t offset, uint8_t data); void ptm_irq(int state); + void ptm_5_irq(int state); + void firq_coin_line(int state); + void five_nmi_line(int state); uint32_t screen_update_vpoker(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); required_device m_maincpu; required_device m_gfxdecode; required_device m_palette; + required_device m_dac; required_ioport m_in0; + required_ioport m_in1; + required_ioport m_in2; + output_finder<9> m_lamps; void main_map(address_map &map) ATTR_COLD; }; +/*********************************** +* Video Hardware * +***********************************/ + void vpoker_state::video_start() { m_videoram = std::make_unique(0x200); @@ -151,13 +297,13 @@ uint32_t vpoker_state::screen_update_vpoker(screen_device &screen, bitmap_ind16 gfx_element *gfx = m_gfxdecode->gfx(0); int count = 0x0000; - for (int y=0;y<0x10;y++) + for (int y = 0; y < 0x10; y++) { - for (int x=0;x<0x20;x++) + for (int x = 0; x < 0x20; x++) { int tile = videoram[count]; - //int colour = tile>>12; - gfx->opaque(bitmap,cliprect,tile,0,0,0,x*16,y*16); + //int colour = tile >> 12; + gfx->opaque(bitmap, cliprect, tile, 0, 0, 0, x*16, y*16); count++; } @@ -168,9 +314,15 @@ uint32_t vpoker_state::screen_update_vpoker(screen_device &screen, bitmap_ind16 uint8_t vpoker_state::blitter_r(offs_t offset) { + if(m_in2->read() == 1 ) // Save and Halt + m_maincpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE); + if(offset == 6) return m_in0->read(); + if(offset == 7) + return m_in1->read(); + return 0; } @@ -180,445 +332,121 @@ void vpoker_state::blitter_w(offs_t offset, uint8_t data) m_blit_ram[offset] = data; + if(offset == 1) + { + machine().bookkeeping().coin_counter_w(0, BIT(data, 5)); // coin_in + machine().bookkeeping().coin_counter_w(1, BIT(data, 4)); // coin_out (5aces) + machine().bookkeeping().coin_counter_w(1, BIT(data, 6)); // coin_out (vpoker) + m_lamps[8] = BIT(data, 7); // bet lamp + } if(offset == 2) { int blit_offs; - blit_offs = (m_blit_ram[1] & 0x01)<<8|(m_blit_ram[2] & 0xff); - + blit_offs = (m_blit_ram[1] & 0x01) << 8 | (m_blit_ram[2] & 0xff); videoram[blit_offs] = m_blit_ram[0]; -// printf("%02x %02x %02x %02x %02x %02x %02x %02x\n",m_blit_ram[0],m_blit_ram[1],m_blit_ram[2],m_blit_ram[3],m_blit_ram[4],m_blit_ram[5],m_blit_ram[6],m_blit_ram[7]); } + if(offset == 3) + { + m_lamps[0] = BIT(data, 0); // hold 1 lamp (5acespkr) + m_lamps[1] = BIT(data, 1); // hold 2 lamp (5acespkr) + m_lamps[2] = BIT(data, 2); // hold 3 lamp (5acespkr) + m_lamps[3] = BIT(data, 3); // hold 4 lamp (5acespkr) + m_lamps[4] = BIT(data, 4); // hold 5 lamp (5acespkr) + m_lamps[5] = BIT(data, 5); // deal lamp (common) + m_lamps[6] = BIT(data, 6); // draw lamp (common) + m_lamps[7] = BIT(data, 7); // holds + cancel (vpoker) + } + else + { + // logerror("blitter_w: offs:%02x - data:%02x\n", offset, data); + } +} + +uint8_t vpoker_state::nvram_r(offs_t offset) +{ + return m_nvram_data[offset]; +} + +void vpoker_state::nvram_w(offs_t offset, u8 data) +{ + m_nvram_data[offset] = data; +} + + +/*********************************** +* Machine Start * +***********************************/ + +void vpoker_state::machine_start() +{ + m_nvram_data = make_unique_clear(0x200); + subdevice("nvram")->set_base(&m_nvram_data[0], 0x200); + save_pointer(NAME(m_nvram_data), 0x200); + m_lamps.resolve(); } + +/***************************************** +* Memory Map Information * +*****************************************/ + void vpoker_state::main_map(address_map &map) { map.global_mask(0x3fff); - map(0x0000, 0x01ff).ram(); /* vpoker has 0x100, 5acespkr has 0x200 */ + map(0x0000, 0x01ff).rw(FUNC(vpoker_state::nvram_r), FUNC(vpoker_state::nvram_w)); map(0x0400, 0x0407).rw("6840ptm", FUNC(ptm6840_device::read), FUNC(ptm6840_device::write)); map(0x0800, 0x0807).r(FUNC(vpoker_state::blitter_r)).w(FUNC(vpoker_state::blitter_w)); map(0x2000, 0x3fff).rom(); } +/***************************************** +* Input Ports * +*****************************************/ + static INPUT_PORTS_START( vpoker ) PORT_START("IN0") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(3) PORT_NAME("Coin In") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_NAME("Coin In") PORT_IMPULSE(3) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_GAMBLE_BET ) - PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x08, 0x00, "Service" ) - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x08, DEF_STR( On ) ) - PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_GAMBLE_KEYOUT ) + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_GAMBLE_BOOK ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("IN0-10") PORT_CODE(KEYCODE_Q) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("IN0-20") PORT_CODE(KEYCODE_E) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("IN0-40") PORT_CODE(KEYCODE_R) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("IN0-80") PORT_CODE(KEYCODE_T) PORT_START("IN1") - PORT_DIPNAME( 0x01, 0x01, "IN1" ) - PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_POKER_HOLD1 ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_POKER_HOLD2 ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_POKER_HOLD3 ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_POKER_HOLD4 ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_POKER_HOLD5 ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1 ) PORT_NAME("Deal") + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_GAMBLE_DEAL ) PORT_NAME("Draw") + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_POKER_CANCEL ) PORT_START("IN2") - PORT_DIPNAME( 0x01, 0x01, "IN2" ) - PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - - PORT_START("IN3") - PORT_DIPNAME( 0x01, 0x01, "IN3" ) - PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - - PORT_START("IN4") - PORT_DIPNAME( 0x01, 0x01, "IN4" ) - PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - - PORT_START("IN5") - PORT_DIPNAME( 0x01, 0x01, "IN5" ) - PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - - PORT_START("IN6") - PORT_DIPNAME( 0x01, 0x01, "IN6" ) - PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - - PORT_START("IN7") - PORT_DIPNAME( 0x01, 0x01, "IN7" ) - PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED ) INPUT_PORTS_END static INPUT_PORTS_START( 5acespkr ) - PORT_START("IN0") - PORT_DIPNAME( 0x01, 0x01, "IN0" ) - PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x08, 0x00, "Service" ) - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x08, DEF_STR( On ) ) - PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_INCLUDE( vpoker ) - PORT_START("IN1") - PORT_DIPNAME( 0x01, 0x01, "IN1" ) - PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_MODIFY("IN0") + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Settings") // setup - PORT_START("IN2") - PORT_DIPNAME( 0x01, 0x01, "IN2" ) - PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - - PORT_START("IN3") - PORT_DIPNAME( 0x01, 0x01, "IN3" ) - PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - - PORT_START("IN4") - PORT_DIPNAME( 0x01, 0x01, "IN4" ) - PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - - PORT_START("IN5") - PORT_DIPNAME( 0x01, 0x01, "IN5" ) - PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - - PORT_START("IN6") - PORT_DIPNAME( 0x01, 0x01, "IN6" ) - PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - - PORT_START("IN7") - PORT_DIPNAME( 0x01, 0x01, "IN7" ) - PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_MODIFY("IN2") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SERVICE1 ) PORT_NAME("Save and Halt") INPUT_PORTS_END +/***************************************** +* Graphics Layouts * +*****************************************/ + static const gfx_layout charlayout = { 16,16, @@ -630,29 +458,68 @@ static const gfx_layout charlayout = 16*16 }; + +/***************************************** +* Graphics Decode Information * +*****************************************/ + static GFXDECODE_START( gfx_vpoker ) - GFXDECODE_ENTRY( "gfx1", 0, charlayout, 0, 1 ) + GFXDECODE_ENTRY( "gfx1", 0, charlayout, 0, 1 ) GFXDECODE_END + +/***************************************** +* PTM 6840 interrupts handling * +*****************************************/ + void vpoker_state::ptm_irq(int state) { m_maincpu->set_input_line(M6809_IRQ_LINE, state ? ASSERT_LINE : CLEAR_LINE); + if(state == 0) + { + // do de job that must be done by NMI. + uint8_t sum = 0; + nvram_w(0x4f, 0x5a); + nvram_w(0x91, 0xa5); + nvram_w(0x9f, 0x00); + + for(int i = 0x40; i < 0xa0; i++) + sum += nvram_r(i); + + sum = ~sum + 1; + nvram_w(0x9f, sum); + } } +void vpoker_state::ptm_5_irq(int state) +{ + m_maincpu->set_input_line(M6809_IRQ_LINE, state ? ASSERT_LINE : CLEAR_LINE); +} + +void vpoker_state::firq_coin_line(int state) +{ + if(m_in0->read() == 0xfe) + m_maincpu->set_input_line(M6809_FIRQ_LINE, state ? ASSERT_LINE : CLEAR_LINE); +} + + +/***************************************** +* Machine Driver * +*****************************************/ + void vpoker_state::vpoker(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware MC6809(config, m_maincpu, XTAL(4'000'000)); m_maincpu->set_addrmap(AS_PROGRAM, &vpoker_state::main_map); - m_maincpu->set_vblank_int("screen", FUNC(vpoker_state::irq0_line_hold)); - /* video hardware */ + NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); + + // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); screen.set_refresh_hz(60); - screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500)); // not accurate screen.set_size(512, 256); - screen.set_visarea(0*8, 480-1, 0*8, 240-1); -// screen.set_visarea(0*8, 512-1, 0*8, 256-1); + screen.set_visarea(0, 464-1, 0, 240-1); // 512x256 total screen.set_screen_update(FUNC(vpoker_state::screen_update_vpoker)); screen.set_palette(m_palette); @@ -660,21 +527,42 @@ void vpoker_state::vpoker(machine_config &config) PALETTE(config, m_palette, palette_device::GBR_3BIT); - /* 6840 PTM */ + // 6840 PTM ptm6840_device &ptm(PTM6840(config, "6840ptm", XTAL(4'000'000) / 4)); - ptm.set_external_clocks(0, 0, 0); + ptm.set_external_clocks(500, 0, 3000); ptm.irq_callback().set(FUNC(vpoker_state::ptm_irq)); + ptm.o2_callback().set("dac", FUNC(dac_1bit_device::data_w)); - /* sound hardware */ - SPEAKER(config, "mono").front_center(); -// AY8910(config, "aysnd", 8000000/4 /* guess */).add_route(ALL_OUTPUTS, "mono", 0.30); + // sound hardware + SPEAKER(config, "speaker").front_center(); + DAC_1BIT(config, m_dac, 0).add_route(ALL_OUTPUTS, "speaker", 0.5); } -/*************************************************************************** - Game driver(s) +void vpoker_state::fiveaces(machine_config &config) +{ + vpoker(config); + + // video hardware + screen_device &screen(SCREEN(config.replace(), "screen", SCREEN_TYPE_RASTER)); + screen.set_refresh_hz(60); + screen.screen_vblank().set(FUNC(vpoker_state::firq_coin_line)); + screen.set_size(512, 256); + screen.set_visarea(48, 448-1, 0, 240-1); // 512x256 total + screen.set_screen_update(FUNC(vpoker_state::screen_update_vpoker)); + screen.set_palette(m_palette); + + // 6840 PTM + ptm6840_device &ptm(PTM6840(config.replace(), "6840ptm", XTAL(4'000'000) / 4)); + ptm.set_external_clocks(500, 0, 1000000); + ptm.irq_callback().set(FUNC(vpoker_state::ptm_5_irq)); + ptm.o2_callback().set("dac", FUNC(dac_1bit_device::data_w)); +} + -***************************************************************************/ +/***************************************** +* Rom Load * +*****************************************/ ROM_START( vpoker ) ROM_REGION( 0x10000, "maincpu", 0 ) @@ -715,6 +603,10 @@ ROM_END } // Anonymous namespace -// YEAR NAME PARENT MACHINE INPUT STATE INIT ROT COMPANY FULLNAME FLAGS -GAME( 198?, vpoker, 0, vpoker, vpoker, vpoker_state, empty_init, ROT0, "Videotronics, Inc.", "Videotronics Draw Poker", MACHINE_NOT_WORKING | MACHINE_NO_SOUND ) -GAME( 198?, 5acespkr, 0, vpoker, 5acespkr, vpoker_state, empty_init, ROT0, "", "5-Aces Poker", MACHINE_NOT_WORKING | MACHINE_NO_SOUND ) +/***************************************** +* Game Drivers * +*****************************************/ + +// YEAR NAME PARENT MACHINE INPUT STATE INIT ROT COMPANY FULLNAME FLAGS LAYOUT +GAMEL( 198?, vpoker, 0, vpoker, vpoker, vpoker_state, empty_init, ROT0, "Videotronics, Inc.", "Challenger Draw Poker", 0, layout_vpoker ) +GAMEL( 198?, 5acespkr, 0, fiveaces, 5acespkr, vpoker_state, empty_init, ROT0, "", "5-Aces Poker", 0, layout_5acespkr ) diff --git a/src/mame/namco/namcos21_de.cpp b/src/mame/namco/namcos21_de.cpp index 6012310ab866d..8bb7565ea8cc6 100644 --- a/src/mame/namco/namcos21_de.cpp +++ b/src/mame/namco/namcos21_de.cpp @@ -540,7 +540,7 @@ static INPUT_PORTS_START( driveyes ) PORT_DIPNAME( 0x10, 0x10, "DSW5") PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x20, 0x00, "PCM ROM") + PORT_DIPNAME( 0x20, 0x20, "PCM ROM") PORT_DIPSETTING( 0x20, "2M" ) PORT_DIPSETTING( 0x00, "4M" ) PORT_DIPNAME( 0x40, 0x40, "DSW7") @@ -645,7 +645,7 @@ static INPUT_PORTS_START( driveyes ) PORT_DIPNAME( 0x10, 0x10, "DSW5") PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x20, 0x00, "PCM ROM") + PORT_DIPNAME( 0x20, 0x20, "PCM ROM") PORT_DIPSETTING( 0x20, "2M" ) PORT_DIPSETTING( 0x00, "4M" ) PORT_DIPNAME( 0x40, 0x40, "DSW7") @@ -824,7 +824,6 @@ ROM_START( driveyes ) ROM_LOAD16_BYTE( "de1-pt2-u.5n", 0x80000, 0x20000, CRC(10e83d81) SHA1(446fedc3b1e258a39fb9467e5327c9f9a9f1ac3f) ) ROM_LOAD16_BYTE( "de1-pt2-l.7n", 0x80001, 0x20000, CRC(3339a976) SHA1(c9eb9c04f7b3f2a85e5ab64ffb2fe4fcfb6c494b) ) - ROM_REGION( 0x2000, "pcb_2:nvram", 0 ) /* default settings, including calibration */ ROM_LOAD( "nvram", 0x0000, 0x2000, CRC(fa6623e9) SHA1(8c313f136724eb6c829261b223a2ac1fc08d00c2) ) ROM_END diff --git a/src/mame/namco/turrett.cpp b/src/mame/namco/turrett.cpp index fb8516fb04b4a..f4221b7e5b3cc 100644 --- a/src/mame/namco/turrett.cpp +++ b/src/mame/namco/turrett.cpp @@ -383,11 +383,11 @@ void turrett_state::turrett(machine_config &config) - /************************************* - * - * ROM definition - * - *************************************/ +/************************************* + * + * ROM definition + * + *************************************/ ROM_START( turrett ) ROM_REGION( 0x200000, "maincpu", 0 ) diff --git a/src/mame/nec/pc80s31k.cpp b/src/mame/nec/pc80s31k.cpp index f4ee91b7718f3..7144407a3580b 100644 --- a/src/mame/nec/pc80s31k.cpp +++ b/src/mame/nec/pc80s31k.cpp @@ -511,7 +511,7 @@ void pc88va2_fd_if_device::device_add_mconfig(machine_config &config) { pc80s31k_device::device_add_mconfig(config); m_fdc->intrq_wr_callback().append([this](int state) { if(m_fdc_mode & 1) { m_write_irq(state); } }); - m_fdc->drq_wr_callback().set([this](int state) { printf("%d %d\n", m_fdc_mode, state); if(m_fdc_mode & 1) { m_write_drq(state); } }); + m_fdc->drq_wr_callback().set([this](int state) { if(m_fdc_mode & 1) { m_write_drq(state); } }); // m_fdc->set_ready_line_connected(false); } @@ -684,10 +684,10 @@ void pc88va2_fd_if_device::host_motor_control_w(u8 data) */ void pc88va2_fd_if_device::host_fdc_control_w(u8 data) { - const bool fdcrst = bool(BIT(data, 7)); - const bool ttrg = bool(BIT(data, 0)); - const bool cur_xtmask = bool(BIT(data, 2)); - const bool cur_dmae = bool(BIT(data, 4)); + const bool fdcrst = !!(BIT(data, 7)); + const bool ttrg = !!(BIT(data, 0)); + const bool cur_xtmask = !!(BIT(data, 2)); + const bool cur_dmae = !!(BIT(data, 4)); LOG("$1b6 FDC control port 2 (%02x) %d FDCRST| %d%d FDCFRY| %d DMAE| %d XTMASK| %d TTRG\n" , data , fdcrst @@ -698,49 +698,19 @@ void pc88va2_fd_if_device::host_fdc_control_w(u8 data) , ttrg ); - if( ttrg ) + if( ttrg && !BIT(m_fdc_ctrl_2, 0) ) m_fdc_timer->adjust(attotime::from_msec(100)); - -// if (cur_dmae && !m_dmae) - { -// m_fdc->set_ready_line_connected(0); -// m_fdc->ready_w(0); - } - - m_dmae = cur_dmae; - - // TODO: confirm condition - // shanghai and famista (at very least) sends a motor off if left idle for a while, - // then any attempt to load/save will fail because there's no explicit motor on - // written back to $1b4. - // Note that this still isn't enough to avoid floppy errors, but makes failures - // to be eventually recoverable for now. - if (!m_xtmask && cur_xtmask && ttrg) - { - floppy_image_device *floppy0, *floppy1; - floppy0 = m_floppy[0]->get_device(); - floppy1 = m_floppy[1]->get_device(); - - // TODO: check me out - if (floppy0) - if (m_floppy[0]->get_device()->mon_r() == 1) - m_motor_start_timer[0]->adjust(attotime::from_msec(505)); - - if (floppy1) - if (m_floppy[1]->get_device()->mon_r() == 1) - m_motor_start_timer[1]->adjust(attotime::from_msec(505)); - } + else if (!ttrg && BIT(m_fdc_ctrl_2, 0) ) + m_fdc_timer->adjust(attotime::never); m_xtmask = cur_xtmask; - //if (!BIT(m_fdc_ctrl_2, 4) && BIT(data, 4)) - // m_maincpu->dreq_w<2>(1); - //m_dmac->dreq2_w(1); - // TODO: 0 -> 1 transition? if( fdcrst ) m_fdc->reset(); + m_dmae = cur_dmae; + m_fdc_ctrl_2 = data; //m_fdd[0]->get_device()->mon_w(!(BIT(data, 5))); diff --git a/src/mame/nec/pc88va.cpp b/src/mame/nec/pc88va.cpp index 4513506a2b91e..22f2e2bc8f077 100644 --- a/src/mame/nec/pc88va.cpp +++ b/src/mame/nec/pc88va.cpp @@ -3,57 +3,55 @@ // thanks-to: Fujix /************************************************************************************************** - PC-88VA (c) 1987 NEC - - Here be dragons, a mostly compatible PC-8801 with extra V3 Mode for superset. - - preliminary driver by Angelo Salese - Special thanks to Fujix for his documentation translation help - - TODO: - - pc88va (stock version) has two bogus opcodes. - One is at 0xf0b15 (0x0f 0xfe), another at 0xf0b31 (br 1000h:0c003h). - Latter will make the program flow to jump to lalaland. - This also happens if you load a regular V1/V2 game assuming you have FDC PIO properly - hooked up, is the first opcode actually a Z80 mode switch? - - pc88va is also known to have a slightly different banking scheme and - regular YM2203 as default sound board. - - video emulation is lacking many features, cfr. pc88va_v.cpp; - - keyboard runs on undumped MCU, we currently stick irqs together on - selected keys in order to have an easier QoL while testing this. - - Backport from PC-8801 main map, apply supersets where applicable; - \- IDP has EMUL for upd3301 - \- In emulation mode HW still relies to a i8214, so it bridges thru - main ICU in cascaded mode via IRQ7; - \- beeper or dac1bit (to be confirmed); - \- (other stuff ...) - - Convert FDC usage to pc88va2_fd_if_device, we also need PIO comms for sorcer anyway; - - irq dispatch needs to be revisited, too many instances of sound irq failing for example. - The current hook-ups aren't legal, V50 core bug? - - Very inconsistent SW boot behaviours, either down to: - \- the current hack in FDC PIO port returning RNG; - \- V50 timings; - \- FDC; - - Every PC Engine OS boot tries to write TVRAM ASCII data on every boot to - $exxxx ROM region, banking bug? - - all N88 BASIC entries tries to do stuff with EMM, more banking? - - Convert SASI from PC-9801 to a shared device, apparently it's same i/f; - - Implement bus slot, which should still be PC-8801 EXPansion bus. - - (old notes, to be reordered) - - fdc "intelligent mode" has 0x7f as irq vector ... 0x7f is ld a,a and it IS NOT correctly - hooked up by the current z80 core - - Fix floppy motor hook-up (floppy believes to be always in even if empty drive); - - Support for PC8801 compatible mode & PC80S31K (floppy interface); - - Notes: - - hold F8 at POST to bring software dip settings menu - - PC-88VA-91 is a ROM upgrade kit for a PC-88VA -> VA2/VA3. - Has four roms, marked by VAEG as VUROM00.ROM, VUROM08.ROM, VUROM1.ROM, VUDIC.ROM. - - References: - - PC-88VAテクニカルマニュアル - - http://www.pc88.gr.jp/vafaq/view.php/articlelist/88va/vafaq +PC-88VA (c) 1987 NEC + +Here be dragons, a mostly compatible PC-8801 with extra V3 Mode for superset. + +TODO: +- pc88va (stock version) has two bogus opcodes. + One is at 0xf0b15 (0x0f 0xfe), another at 0xf0b31 (br 1000h:0c003h). + Latter will make the program flow to jump to lalaland. + This also happens if you load a regular V1/V2 game assuming you have FDC PIO properly + hooked up, is the first opcode actually a Z80 mode switch? +- pc88va is also known to have a slightly different banking scheme and + regular YM2203 as default sound board. +- video emulation is lacking many features, cfr. pc88va_v.cpp; +- keyboard runs on undumped MCU, we currently stick irqs together on + selected keys in order to have an easier QoL while testing this. +- Backport from PC-8801 main map, apply supersets where applicable; + \- IDP has EMUL for upd3301 + \- In emulation mode HW still relies to a i8214, so it bridges thru + main ICU in cascaded mode via IRQ7; + \- beeper or dac1bit (to be confirmed); + \- (other stuff ...) +- Convert FDC usage to pc88va2_fd_if_device, we also need PIO comms for sorcer anyway; +- irq dispatch needs to be revisited, too many instances of sound irq failing for example. + The current hook-ups aren't legal, V50 core bug? +- Very inconsistent SW boot behaviours, either down to: + \- the current hack in FDC PIO port returning RNG; + \- V50 timings; + \- FDC; +- Every PC Engine OS boot tries to write TVRAM ASCII data on every boot to + $exxxx ROM region, banking bug? +- all N88 BASIC entries tries to do stuff with EMM, more banking? +- Convert SASI from PC-9801 to a shared C-Bus device, apparently it's same i/f; +- Is C-Bus I/O space shifted by +$200, as per micromus MIDI access at $e2d2? + +(old notes, to be reordered) +- fdc "intelligent mode" has 0x7f as irq vector ... 0x7f is ld a,a and it IS NOT correctly + hooked up by the current z80 core +- Fix floppy motor hook-up (floppy believes to be always in even if empty drive); +- Support for PC8801 compatible mode & PC80S31K (floppy interface); + +Notes: +- hold F8 at POST to bring software dip settings menu, F5 to cycle between pages; +- PC-88VA-91 is a ROM upgrade kit for a PC-88VA -> VA2/VA3. + Has four roms, marked by VAEG as VUROM00.ROM, VUROM08.ROM, VUROM1.ROM, VUDIC.ROM. + +References: +- PC-88VAテクニカルマニュアル +- http://www.pc88.gr.jp/vafaq/view.php/articlelist/88va/vafaq +- I/O magazine 1987 08 (schematics) =================================================================================================== @@ -62,15 +60,15 @@ ICU irq 0 - 08h - timer 1 irq 1 - 09h - keyboard irq irq 2 - 0Ah - VRTC -irq 3 - 0Bh - UINT0 (B24) +irq 3 - 0Bh - UINT0 (B24) C-Bus IR3 irq 4 - 0Ch - RS-232C -irq 5 - 0Dh - UINT1 (B25) -irq 6 - 0Eh - UINT2 (B26) +irq 5 - 0Dh - UINT1 (B25) C-Bus IR5 +irq 6 - 0Eh - UINT2 (B26) C-Bus IR6 irq 7 - N/A - Slave (either secondary i8259 or i8214) i8259 slave irq 8 - 10H - SGP -irq 9 - 11H - UINT3 (HDD, B27) -irq 10 - 12H - UINT4 (B28) +irq 9 - 11H - UINT3 (HDD, B27) C-Bus IR9 +irq 10 - 12H - UINT4 (B28) C-Bus IR10 irq 11 - 13H - FDC irq 12 - 14H - Sound irq 13 - 15H - General timer 3 (mouse) @@ -91,8 +89,9 @@ brk 8Ch AH=02h read calendar clock -> CH = hour, CL = minutes, DH = seconds, DL #include #include "utf8.h" -#define LOG_FDC (1U << 2) // $1b0-$1b2 accesses -#define LOG_FDC2 (1U << 3) // $1b4-$1b6 accesses (verbose) +#define LOG_FDC (1U << 2) // $1b0-$1b2 accesses +#define LOG_FDC2 (1U << 3) // $1b4-$1b6 accesses (verbose) +#define LOG_GFXCTRL (1U << 4) // $5xx accesses #define VERBOSE (LOG_GENERAL | LOG_FDC) //#define LOG_OUTPUT_STREAM std::cout @@ -101,22 +100,23 @@ brk 8Ch AH=02h read calendar clock -> CH = hour, CL = minutes, DH = seconds, DL #define LOGFDC(...) LOGMASKED(LOG_FDC, __VA_ARGS__) #define LOGFDC2(...) LOGMASKED(LOG_FDC2, __VA_ARGS__) +#define LOGGFXCTRL(...) LOGMASKED(LOG_GFXCTRL, __VA_ARGS__) // TODO: verify clocks -#define MASTER_CLOCK XTAL(8'000'000) // may be XTAL(31'948'800) / 4? (based on PC-8801 and PC-9801) -#define FM_CLOCK (XTAL(31'948'800) / 4) // 3993600 +#define MASTER_CLOCK (XTAL(31'948'800) / 4) // (based on PC-8801 and PC-9801) +#define FM_CLOCK (XTAL(31'948'800) / 4) // 3993600, / 8 for regular pc88va uint8_t pc88va_state::kanji_ram_r(offs_t offset) { - return m_kanjiram[offset]; + return m_kanji_ram[offset]; } // TODO: settings area should be write protected depending on the m_backupram_wp bit, separate from this void pc88va_state::kanji_ram_w(offs_t offset, uint8_t data) { - m_kanjiram[offset] = data; + m_kanji_ram[offset] = data; m_gfxdecode->gfx(2)->mark_dirty(offset / 8); m_gfxdecode->gfx(3)->mark_dirty(offset / 32); } @@ -187,6 +187,7 @@ void pc88va_state::rtc_w(offs_t offset, u8 data) void pc88va_state::bios_bank_w(offs_t offset, uint16_t data, uint16_t mem_mask) { COMBINE_DATA(&m_bank_reg); + m_gmsp_view.select(BIT(m_bank_reg, 12)); /* SMBC */ m_sysbank->set_bank((m_bank_reg & 0xf00) >> 8); @@ -512,9 +513,9 @@ TIMER_CALLBACK_MEMBER(pc88va_state::t3_mouse_callback) uint8_t pc88va_state::backupram_dsw_r(offs_t offset) { if(offset == 0) - return m_kanjiram[0x1fc2 / 2] & 0xff; + return m_kanji_ram[0x1fc2 / 2] & 0xff; - return m_kanjiram[0x1fc6 / 2] & 0xff; + return m_kanji_ram[0x1fc6 / 2] & 0xff; } // TODO: pc8801_state::port31_w @@ -554,13 +555,15 @@ void pc88va_state::main_map(address_map &map) void pc88va_state::sysbank_map(address_map &map) { - // 0 select bus slot + // 0 select C-bus slot // 1 tvram map(0x040000, 0x04ffff).ram().share("tvram"); // FIXME: BASIC and pacmana expects to r/w to 0x60000-0x7ffff on loading, assume mirror if not a core bug. map(0x050000, 0x07ffff).ram(); // 4 gvram - map(0x100000, 0x13ffff).ram().share("gvram"); + map(0x100000, 0x13ffff).view(m_gmsp_view); + m_gmsp_view[0](0x100000, 0x13ffff).rw(FUNC(pc88va_state::gvram_multiplane_r), FUNC(pc88va_state::gvram_multiplane_w)); + m_gmsp_view[1](0x100000, 0x13ffff).rw(FUNC(pc88va_state::gvram_singleplane_r), FUNC(pc88va_state::gvram_singleplane_w)); // 8-9 kanji // Kanji ROM map(0x200000, 0x23ffff).rom().region("kanji", 0x00000); @@ -582,7 +585,11 @@ void pc88va_state::sgp_map(address_map &map) map(0x140000, 0x14ffff).rom().region("kanji", 0x40000); map(0x150000, 0x153fff).rw(FUNC(pc88va_state::kanji_ram_r),FUNC(pc88va_state::kanji_ram_w)); map(0x180000, 0x18ffff).ram().share("tvram"); - map(0x200000, 0x23ffff).ram().share("gvram"); + // Assume just raw writes to GVRAM + map(0x200000, 0x23ffff).lrw8( + NAME([this] (offs_t offset) { return m_gvram[offset]; }), + NAME([this] (offs_t offset, u8 data) { m_gvram[offset] = data; }) + ); } // TODO: I/O 0x00xx is almost same as pc8801 @@ -625,7 +632,7 @@ void pc88va_state::io_map(address_map &map) // map(0x0124, 0x0125) ? (related to Transparent Color of Graphic Screen 0) // map(0x0126, 0x0127) ? (related to Transparent Color of Graphic Screen 1) map(0x012e, 0x012f).w(FUNC(pc88va_state::text_transpen_w)); -// map(0x0130, 0x0137) Picture Mask Parameter (global cliprect, olteus gameplay) + map(0x0130, 0x0137).w(FUNC(pc88va_state::picture_mask_w)); map(0x0142, 0x0142).rw(FUNC(pc88va_state::idp_status_r), FUNC(pc88va_state::idp_command_w)); //Text Controller (IDP) - (R) Status (W) command map(0x0146, 0x0146).w(FUNC(pc88va_state::idp_param_w)); //Text Controller (IDP) - (R/W) Parameter map(0x0148, 0x0148).w(FUNC(pc88va_state::text_control_1_w)); @@ -663,22 +670,155 @@ void pc88va_state::io_map(address_map &map) map(0x0500, 0x0507).m(m_sgp, FUNC(pc88va_sgp_device::sgp_io)); // GVRAM multiplane access regs (ROP section) -// map(0x0510, 0x0510) AACC extend access mode -// map(0x0512, 0x0512) GMAP block switch -// map(0x0514, 0x0514) XRPMn plane readback select -// map(0x0516, 0x0516) XWPMn plane write select -// map(0x0518, 0x0518) multiplane enable -// map(0x0520, 0x0527).umask16(0x00ff) extended access bit comparison + // TODO: register are locked with GMSP = 1 + map(0x0510, 0x0510).lrw8( + NAME([this] (offs_t offset) { + LOGGFXCTRL("AACC extend access mode R\n"); + return m_multiplane.aacc; + }), + NAME([this] (offs_t offset, u8 data) { + m_multiplane.aacc = !!BIT(data, 0); + LOGGFXCTRL("AACC extend access mode W %02x\n", data); + }) + ); + map(0x0512, 0x0512).lrw8( + NAME([this] (offs_t offset) { + LOGGFXCTRL("GMAP block switch R\n"); + return m_multiplane.gmap; + }), + NAME([this] (offs_t offset, u8 data) { + LOGGFXCTRL("GMAP block switch W %02x\n", data); + m_multiplane.gmap = !!BIT(data, 0); + }) + ); + map(0x0514, 0x0514).lrw8( + NAME([this] (offs_t offset) { + LOGGFXCTRL("XRPMn plane readback select R\n"); + return m_multiplane.xrpm | 0xf0; + }), + NAME([this] (offs_t offset, u8 data) { + LOGGFXCTRL("XRPMn plane readback select W %02x\n", data); + m_multiplane.xrpm = data & 0xf; + }) + ); + map(0x0516, 0x0516).lrw8( + NAME([this] (offs_t offset) { + LOGGFXCTRL("XWPMn plane write select R\n"); + return m_multiplane.xwpm | 0xf0; + }), + NAME([this] (offs_t offset, u8 data) { + LOGGFXCTRL("XWPMn plane write select W %02x\n", data); + m_multiplane.xwpm = data & 0xf; + }) + ); + map(0x0518, 0x0518).lrw8( + NAME([this] (offs_t offset) { + // TODO: rbusy reads (bit 7) + return (m_multiplane.cmpen << 5) | (m_multiplane.wss << 3) | (m_multiplane.pmod << 0); + }), + NAME([this] (offs_t offset, u8 data) { + LOGGFXCTRL("Multiplane Mode W %02x\n", data); + // PMOD bit 2 1 -> 0 transitions resets pattern pointers + if (BIT(m_multiplane.pmod, 2) && !BIT(data, 2)) + { + m_multiplane.prrp = 0; + m_multiplane.prwp = 0; + } + + m_multiplane.cmpen = !!BIT(data, 5); + m_multiplane.wss = (data >> 3) & 3; + m_multiplane.pmod = (data >> 0) & 7; + }) + ); + map(0x0520, 0x0527).umask16(0x00ff).lrw8( + NAME([this] (offs_t offset) { + LOGGFXCTRL("CMPR extended access bit comparison R\n"); + return m_multiplane.cmpr[offset]; + }), + NAME([this] (offs_t offset, u8 data) { + LOGGFXCTRL("CMPR extended access bit comparison W %02x\n", data); + m_multiplane.cmpr[offset] = data; + }) + ); // map(0x0528, 0x0528) extended access plane comparison -// map(0x0530, 0x0537).umask16(0x00ff) extended access pattern low byte -// map(0x0540, 0x0547).umask16(0x00ff) extended access pattern high byte -// map(0x0550, 0x0550) PRRPn plane pattern usage start byte on read -// map(0x0552, 0x0552) PRWPn plane pattern usage start byte on write -// map(0x0560, 0x0567).umask16(0x00ff) ROP plane code + map(0x0530, 0x0537).umask16(0x00ff).lrw8( + NAME([this] (offs_t offset) { + LOGGFXCTRL("Multiplane PATRL%d R\n", offset); + return m_multiplane.patr[offset][0]; + }), + NAME([this] (offs_t offset, u8 data) { + LOGGFXCTRL("Multiplane PATRL%d W %02x\n", offset, data); + m_multiplane.patr[offset][0] = data; + }) + ); + map(0x0540, 0x0547).umask16(0x00ff).lrw8( + NAME([this] (offs_t offset) { + LOGGFXCTRL("Multiplane PATRH%d R\n", offset); + return m_multiplane.patr[offset][1]; + }), + NAME([this] (offs_t offset, u8 data) { + LOGGFXCTRL("Multiplane PATRH%d W %02x\n", offset, data); + m_multiplane.patr[offset][1] = data; + }) + ); + map(0x0550, 0x0550).umask16(0x00ff).lrw8( + NAME([this] (offs_t offset) { + return m_multiplane.prrp | 0xf0; + }), + NAME([this] (offs_t offset, u8 data) { + LOGGFXCTRL("PRRPn plane pattern usage start byte on read %02x\n", data); + m_multiplane.prrp = data & 0xf; + }) + ); + map(0x0552, 0x0552).umask16(0x00ff).lrw8( + NAME([this] (offs_t offset) { + return m_multiplane.prwp | 0xf0; + }), + NAME([this] (offs_t offset, u8 data) { + LOGGFXCTRL("PRWPn plane pattern usage start byte on write %02x\n", data); + m_multiplane.prwp = data & 0xf; + }) + ); + map(0x0560, 0x0567).umask16(0x00ff).lrw8( + NAME([this] (offs_t offset) { + return m_multiplane.rop[offset]; + }), + NAME([this] (offs_t offset, u8 data) { + LOGGFXCTRL("Multiplane ROP %d W %02x\n", offset, data); + m_multiplane.rop[offset] = data; + }) + ); // GVRAM single plane access regs -// map(0x0580, 0x0580) single plane enable -// map(0x0590, 0x0593) GVRAM pattern register settings -// map(0x05a0, 0x05a3) ROP plane code + // TODO: register are locked with GMSP = 0 + map(0x0580, 0x0580).lrw8( + NAME([this] (offs_t offset) { + // TODO: rbusy reads (bit 7) + return (m_singleplane.wss << 3); + }), + NAME([this] (offs_t offset, u8 data) { + LOGGFXCTRL("Singleplane Mode W %02x\n", data); + m_singleplane.wss = (data >> 3) & 3; + }) + ); + map(0x0590, 0x0593).umask16(0x00ff).lrw8( + NAME([this] (offs_t offset) { + LOGGFXCTRL("Singleplane PATR%d R\n", offset); + return m_singleplane.patr[offset]; + }), + NAME([this] (offs_t offset, u8 data) { + LOGGFXCTRL("Singleplane PATR%d W %02x\n", offset, data); + m_singleplane.patr[offset] = data; + }) + ); + map(0x05a0, 0x05a3).umask16(0x00ff).lrw8( + NAME([this] (offs_t offset) { + return m_singleplane.rop[offset]; + }), + NAME([this] (offs_t offset, u8 data) { + LOGGFXCTRL("Singleplane ROP %d W %02x\n", offset, data); + m_singleplane.rop[offset] = data; + }) + ); // map(0x1000, 0xfeff) PC-88VA expansion boards // map(0xe2d2, 0xe2d2) MIDI status in micromus @@ -1120,6 +1260,48 @@ void pc88va_state::machine_reset() m_sound_irq_pending = false; } +// TODO: add just a subset for now, all needs to be verified if compatible with C-Bus. +static void pc88va_cbus_devices(device_slot_interface &device) +{ + device.option_add("pc9801_55u", PC9801_55U); + device.option_add("pc9801_55l", PC9801_55L); + device.option_add("mif_201", MIF201); + device.option_add("mpu_pc98", MPU_PC98); +} + +// NOTE: PC-88VA implementation omits some C-Bus lines compared to PC-98. +// - doesn't have ir12 and ir13, i.e. covers INT0 to INT4 only +// - no /CPUKILL pin support +// cfr. schematics pg. 260, "external bus, videoboard connector" +void pc88va_state::pc88va_cbus(machine_config &config) +{ + PC9801CBUS_SLOT(config, m_cbus[0], pc88va_cbus_devices, nullptr); + m_cbus[0]->set_memspace(m_maincpu, AS_PROGRAM); + m_cbus[0]->set_iospace(m_maincpu, AS_IO); + m_cbus[0]->int_cb<0>().set("ir3", FUNC(input_merger_device::in_w<0>)); + m_cbus[0]->int_cb<1>().set("ir5", FUNC(input_merger_device::in_w<0>)); + m_cbus[0]->int_cb<2>().set("ir6", FUNC(input_merger_device::in_w<0>)); + m_cbus[0]->int_cb<3>().set("ir9", FUNC(input_merger_device::in_w<0>)); + m_cbus[0]->int_cb<4>().set("ir10", FUNC(input_merger_device::in_w<0>)); + + PC9801CBUS_SLOT(config, m_cbus[1], pc88va_cbus_devices, nullptr); + m_cbus[1]->set_memspace(m_maincpu, AS_PROGRAM); + m_cbus[1]->set_iospace(m_maincpu, AS_IO); + m_cbus[1]->int_cb<0>().set("ir3", FUNC(input_merger_device::in_w<1>)); + m_cbus[1]->int_cb<1>().set("ir5", FUNC(input_merger_device::in_w<1>)); + m_cbus[1]->int_cb<2>().set("ir6", FUNC(input_merger_device::in_w<1>)); + m_cbus[1]->int_cb<3>().set("ir9", FUNC(input_merger_device::in_w<1>)); + m_cbus[1]->int_cb<4>().set("ir10", FUNC(input_merger_device::in_w<1>)); + + // TODO: check actual number of slots for each VA iteration + + INPUT_MERGER_ANY_HIGH(config, "ir3").output_handler().set_inputline(m_maincpu, INPUT_LINE_IRQ3); + INPUT_MERGER_ANY_HIGH(config, "ir5").output_handler().set_inputline(m_maincpu, INPUT_LINE_IRQ5); + INPUT_MERGER_ANY_HIGH(config, "ir6").output_handler().set_inputline(m_maincpu, INPUT_LINE_IRQ6); + INPUT_MERGER_ANY_HIGH(config, "ir9").output_handler().set("pic8259_slave", FUNC(pic8259_device::ir1_w)); + INPUT_MERGER_ANY_HIGH(config, "ir10").output_handler().set("pic8259_slave", FUNC(pic8259_device::ir2_w)); +} + void pc88va_state::pc88va(machine_config &config) { V50(config, m_maincpu, MASTER_CLOCK); // μPD9002, aka V50 + μPD70008AC (for PC8801 compatibility mode) in place of 8080 @@ -1138,6 +1320,8 @@ void pc88va_state::pc88va(machine_config &config) m_maincpu->in_memr_cb().set([this] (offs_t offset) { return m_maincpu->space(AS_PROGRAM).read_byte(offset); }); m_maincpu->out_memw_cb().set([this] (offs_t offset, u8 data) { m_maincpu->space(AS_PROGRAM).write_byte(offset, data); }); + pc88va_cbus(config); + // TODO: pc80s31k here SCREEN(config, m_screen, SCREEN_TYPE_RASTER); @@ -1182,6 +1366,7 @@ void pc88va_state::pc88va(machine_config &config) SPEAKER(config, m_lspeaker).front_left(); SPEAKER(config, m_rspeaker).front_right(); + // TODO: YM2203 for vanilla pc88va // PC-88VA-12 "Sound Board II", YM2608B YM2608(config, m_opna, FM_CLOCK); m_opna->set_addrmap(0, &pc88va_state::opna_map); diff --git a/src/mame/nec/pc88va.h b/src/mame/nec/pc88va.h index a9214be388c9b..b7fff21a09a0b 100644 --- a/src/mame/nec/pc88va.h +++ b/src/mame/nec/pc88va.h @@ -14,18 +14,30 @@ //#include "pc80s31k.h" #include "pc88va_sgp.h" +#include "bus/cbus/pc9801_cbus.h" #include "bus/msx/ctrl/ctrl.h" #include "cpu/nec/v5x.h" #include "cpu/z80/z80.h" #include "imagedev/floppy.h" #include "machine/bankdev.h" #include "machine/i8255.h" +#include "machine/input_merger.h" #include "machine/pic8259.h" #include "machine/timer.h" #include "machine/upd1990a.h" #include "machine/upd765.h" #include "sound/ymopn.h" +//#include "bus/cbus/amd98.h" +#include "bus/cbus/mif201.h" +#include "bus/cbus/mpu_pc98.h" +//#include "bus/cbus/pc9801_26.h" +#include "bus/cbus/pc9801_55.h" +//#include "bus/cbus/pc9801_86.h" +//#include "bus/cbus/pc9801_118.h" +//#include "bus/cbus/sb16_ct2720.h" + + #include "emupal.h" #include "screen.h" #include "softlist.h" @@ -46,6 +58,7 @@ class pc88va_state : public driver_device , m_fdd(*this, "upd765:%u", 0U) , m_pic2(*this, "pic8259_slave") , m_rtc(*this, "rtc") + , m_cbus(*this, "cbus%d", 0) , m_mouse_port(*this, "mouseport") // labelled "マウス" (mouse) - can't use "mouse" because of core -mouse option , m_opna(*this, "opna") , m_lspeaker(*this, "lspeaker") @@ -54,10 +67,10 @@ class pc88va_state : public driver_device , m_sysbank(*this, "sysbank") , m_workram(*this, "workram") , m_tvram(*this, "tvram") - , m_gvram(*this, "gvram") , m_fb_regs(*this, "fb_regs") - , m_kanji_rom(*this, "kanji") , m_sgp(*this, "sgp") + , m_gmsp_view(*this, "gmsp_view") + , m_kanji_rom(*this, "kanji") , m_gfxdecode(*this, "gfxdecode") , m_palette(*this, "palette") { } @@ -95,8 +108,12 @@ class pc88va_state : public driver_device virtual void machine_start() override ATTR_COLD; virtual void machine_reset() override ATTR_COLD; virtual void video_start() override ATTR_COLD; + virtual void video_reset() override ATTR_COLD; void palette_init(palette_device &palette) const; +protected: + void pc88va_cbus(machine_config &config); + private: required_device m_maincpu; @@ -107,6 +124,7 @@ class pc88va_state : public driver_device // required_device m_pic1; required_device m_pic2; required_device m_rtc; + required_device_array m_cbus; required_device m_mouse_port; required_device m_opna; required_device m_lspeaker; @@ -115,11 +133,12 @@ class pc88va_state : public driver_device required_device m_sysbank; required_shared_ptr m_workram; required_shared_ptr m_tvram; - required_shared_ptr m_gvram; + std::unique_ptr m_gvram; required_shared_ptr m_fb_regs; - required_region_ptr m_kanji_rom; required_device m_sgp; - std::unique_ptr m_kanjiram; + memory_view m_gmsp_view; + required_region_ptr m_kanji_rom; + std::unique_ptr m_kanji_ram; uint16_t m_bank_reg = 0; uint8_t m_timer3_io_reg = 0; @@ -175,20 +194,55 @@ class pc88va_state : public driver_device void r232_ctrl_portc_w(uint8_t data); uint8_t get_slave_ack(offs_t offset); - uint16_t m_video_pri_reg[2]{}; + uint16_t m_video_pri_reg[2]; - u16 m_screen_ctrl_reg = 0; - bool m_dm = false; - bool m_ymmd = false; - u16 m_gfx_ctrl_reg = 0; + u16 m_screen_ctrl_reg; + bool m_gden0; + bool m_dm; + bool m_ymmd; + u8 m_vw; + u16 m_gfx_ctrl_reg; - u16 m_color_mode = 0; - u8 m_pltm, m_pltp = 0; + u16 m_color_mode; + u8 m_pltm, m_pltp; - u16 m_text_transpen = 0; - bool m_td = false; + u16 m_text_transpen; + bool m_td; bitmap_rgb32 m_graphic_bitmap[2]; + struct { + bool aacc; + u8 gmap; + u8 xrpm, xwpm; + //bool rbusy; + bool cmpen; + u8 wss; + u8 pmod; + u8 rop[4]; + + u8 cmpr[4]; + u8 patr[4][2]; + u8 prrp, prwp; + } m_multiplane; + + struct { + //bool rbusy; + u8 wss; + u8 patr[2]; + u8 rop[2]; + } m_singleplane; + + struct { + u16 top, bottom; + u16 left, right; + } m_picture_mask; + + u8 rop_execute(u8 plane_rop, u8 src, u8 dst, u8 pat); + u8 gvram_singleplane_r(offs_t offset); + void gvram_singleplane_w(offs_t offset, u8 data); + u8 gvram_multiplane_r(offs_t offset); + void gvram_multiplane_w(offs_t offset, u8 data); + u16 screen_ctrl_r(); void screen_ctrl_w(offs_t offset, u16 data, u16 mem_mask = ~0); u16 gfx_ctrl_r(); @@ -198,6 +252,7 @@ class pc88va_state : public driver_device void color_mode_w(offs_t offset, u16 data, u16 mem_mask = ~0); void text_transpen_w(offs_t offset, u16 data, u16 mem_mask = ~0); void text_control_1_w(u8 data); + void picture_mask_w(offs_t offset, u16 data, u16 mem_mask = ~0); u8 m_kanji_cg_line = 0; u8 m_kanji_cg_jis[2]{}; @@ -214,12 +269,12 @@ class pc88va_state : public driver_device void draw_graphic_layer(bitmap_rgb32 &bitmap, const rectangle &cliprect, u8 which); void draw_indexed_gfx_1bpp(bitmap_rgb32 &bitmap, const rectangle &cliprect, u32 fb_start_offset, u8 pal_base); - void draw_indexed_gfx_4bpp(bitmap_rgb32 &bitmap, const rectangle &cliprect, u32 fb_start_offset, u32 display_start_offset, u8 pal_base, u16 fb_width, u16 fb_height); - void draw_direct_gfx_8bpp(bitmap_rgb32 &bitmap, const rectangle &cliprect, u32 fb_start_offset, u16 fb_width, u16 fb_height); - void draw_direct_gfx_rgb565(bitmap_rgb32 &bitmap, const rectangle &cliprect, u32 fb_start_offset, u16 fb_width, u16 fb_height); + void draw_indexed_gfx_4bpp(bitmap_rgb32 &bitmap, const rectangle &cliprect, u32 fb_start_offset, u32 display_start_offset, u16 dsp_start_base, u16 scrollx, u8 pal_base, u16 fb_width, u16 fb_height); + void draw_direct_gfx_8bpp(bitmap_rgb32 &bitmap, const rectangle &cliprect, u32 fb_start_offset, u32 display_start_offset, u16 dsp_start_base, u16 scrollx, u16 fb_width, u16 fb_height); + void draw_direct_gfx_rgb565(bitmap_rgb32 &bitmap, const rectangle &cliprect, u32 fb_start_offset, u32 display_start_offset, u16 scrollx, u16 fb_width, u16 fb_height); - void draw_packed_gfx_4bpp(bitmap_rgb32 &bitmap, const rectangle &cliprect, u32 fb_start_offset, u32 display_start_offset, u8 pal_base, u16 fb_width, u16 fb_height); - void draw_packed_gfx_5bpp(bitmap_rgb32 &bitmap, const rectangle &cliprect, u32 fb_start_offset, u32 display_start_offset, u8 pal_base, u16 fb_width, u16 fb_height); + void draw_packed_gfx_4bpp(bitmap_rgb32 &bitmap, const rectangle &cliprect, u32 fb_start_offset, u32 display_start_offset, u16 scrollx, u8 pal_base, u16 fb_width, u16 fb_height); + void draw_packed_gfx_5bpp(bitmap_rgb32 &bitmap, const rectangle &cliprect, u32 fb_start_offset, u32 display_start_offset, u16 dsp_start_base, u16 scrollx, u8 pal_base, u16 fb_width, u16 fb_height); uint32_t calc_kanji_rom_addr(uint8_t jis1,uint8_t jis2,int x,int y); void draw_text(bitmap_rgb32 &bitmap, const rectangle &cliprect); @@ -231,6 +286,7 @@ class pc88va_state : public driver_device uint8_t m_buf_size = 0; uint8_t m_buf_index = 0; uint8_t m_buf_ram[16]{}; + u8 m_crtc_regs[15]{}; u16 m_vrtc_irq_line = 432; uint8_t idp_status_r(); @@ -249,6 +305,8 @@ class pc88va_state : public driver_device void execute_sprsw_cmd(); void execute_spwr_cmd(u8 data); + void recompute_parameters(); + void main_map(address_map &map) ATTR_COLD; void io_map(address_map &map) ATTR_COLD; void sysbank_map(address_map &map) ATTR_COLD; @@ -256,11 +314,11 @@ class pc88va_state : public driver_device void sgp_map(address_map &map) ATTR_COLD; +// TODO: stuff backported from PC8801 as QoL that should really be common protected: required_device m_gfxdecode; required_device m_palette; -// TODO: stuff backported from PC8801 as QoL that should really be common private: uint8_t misc_ctrl_r(); void misc_ctrl_w(uint8_t data); diff --git a/src/mame/nec/pc88va_sgp.cpp b/src/mame/nec/pc88va_sgp.cpp index 9bea62bf93068..16ce72ef6cc32 100644 --- a/src/mame/nec/pc88va_sgp.cpp +++ b/src/mame/nec/pc88va_sgp.cpp @@ -7,10 +7,12 @@ NEC SGP (スーパーグラフィックプロセッサ / Super Graphic Processor Unknown part number, used as GPU for PC88VA TODO: -- timing details -- specifics about what exactly happens in work area when either SGP runs or is idle. +- timing details; +- unemulated CLS, LINE, SCAN; +- Uneven src/dst sizes or color depths (mostly for PATBLT); +- specifics about what exactly happens in work area when either SGP runs or is idle; - famista: during gameplay it BITBLT same source to destination 0x00037076 - with tp_mode = 3 and pitch = 0 (!?); + with tp_mode = 3, uneven color depths (src 1bpp, dst 4bpp) and pitch = 0, assume disabled; - rtype: during gameplay it does transfers with Pitch = 0xfff0, alias for negative draw? - basic fires a VABOT on loading; @@ -19,11 +21,10 @@ Unknown part number, used as GPU for PC88VA #include "emu.h" #include "pc88va_sgp.h" -#include - - #define LOG_COMMAND (1U << 1) +//#include + #define VERBOSE (LOG_GENERAL) //#define LOG_OUTPUT_STREAM std::cout @@ -32,7 +33,7 @@ Unknown part number, used as GPU for PC88VA #define LOGCOMMAND(...) LOGMASKED(LOG_COMMAND, __VA_ARGS__) // device type definition -DEFINE_DEVICE_TYPE(PC88VA_SGP, pc88va_sgp_device, "pc88va_sgp", "NEC PC88VA Super Graphic Processor") +DEFINE_DEVICE_TYPE(PC88VA_SGP, pc88va_sgp_device, "pc88va_sgp", "NEC PC-88VA Super Graphic Processor") pc88va_sgp_device::pc88va_sgp_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : device_t(mconfig, PC88VA_SGP, tag, owner, clock), @@ -88,7 +89,7 @@ void pc88va_sgp_device::vdp_address_w(offs_t offset, u16 data, u16 mem_mask) void pc88va_sgp_device::control_w(u8 data) { if (data) - popmessage("SGP warning write %02x", data); + popmessage("SGP: control_w write %02x", data); } /* @@ -96,6 +97,11 @@ void pc88va_sgp_device::control_w(u8 data) */ u8 pc88va_sgp_device::status_r() { +// crude debug single-stepping +// if (machine().input().code_pressed(KEYCODE_S)) +// return 0; +// if (!machine().input().code_pressed_once(KEYCODE_A)) +// return 1; return 0; } @@ -183,11 +189,12 @@ void pc88va_sgp_device::start_exec() ptr->pixel_mode = (param1 & 0x03); ptr->hsize = m_data->read_word(vdp_pointer + 4) & 0x0fff; ptr->vsize = m_data->read_word(vdp_pointer + 6) & 0x0fff; - ptr->fb_pitch = m_data->read_word(vdp_pointer + 8) & 0xfffc; + // NOTE: & 0xfffc causes pitch issues in boomer intro/title text, shinraba gameplay + ptr->fb_pitch = (s16)(m_data->read_word(vdp_pointer + 8) & 0xfffe); ptr->address = (m_data->read_word(vdp_pointer + 10) & 0xfffe) | (m_data->read_word(vdp_pointer + 12) << 16); - LOGCOMMAND("SGP: (PC=%08x) SET %s %02x|H %4u|V %4u|Pitch %5u| address %08x\n" + LOGCOMMAND("SGP: (PC=%08x) SET %s %02x|H %4u|V %4u|Pitch %5d| address %08x\n" , vdp_pointer , mode ? "DESTINATION" : "SOURCE " , param1 @@ -202,10 +209,10 @@ void pc88va_sgp_device::start_exec() } case 0x0006: { - const u16 color_code = m_data->read_word(vdp_pointer + 2); + m_color_code = m_data->read_word(vdp_pointer + 2); LOGCOMMAND("SGP: (PC=%08x) SET COLOR %04x\n" , vdp_pointer - , color_code + , m_color_code ); next_pc += 2; break; @@ -223,7 +230,7 @@ void pc88va_sgp_device::start_exec() , cmd_mode ? "PATBLT" : "BITBLT" , draw_mode ); - cmd_blit(draw_mode, cmd_mode); + execute_blit(draw_mode, cmd_mode); next_pc += 2; break; @@ -239,7 +246,7 @@ void pc88va_sgp_device::start_exec() // in pixels const u16 h_size = m_data->read_word(vdp_pointer + 6); const u16 v_size = m_data->read_word(vdp_pointer + 8); - const u16 fb_pitch = m_data->read_word(vdp_pointer + 10) & 0xfffc; + const s16 fb_pitch = m_data->read_word(vdp_pointer + 10) & 0xfffe; const u32 src_address = (m_data->read_word(vdp_pointer + 12) & 0xfffe) | (m_data->read_word(vdp_pointer + 14) << 16); @@ -303,9 +310,59 @@ void pc88va_sgp_device::start_exec() } /**************************************** - * Commands + * Blitting ***************************************/ +const pc88va_sgp_device::rop_func pc88va_sgp_device::rop_table[16] = +{ + &pc88va_sgp_device::rop_0_fill_0, + &pc88va_sgp_device::rop_1_s_and_d, + &pc88va_sgp_device::rop_2_ns_and_d, + &pc88va_sgp_device::rop_3_d, + &pc88va_sgp_device::rop_4_s_and_nd, + &pc88va_sgp_device::rop_5_s, + &pc88va_sgp_device::rop_6_s_xor_d, + &pc88va_sgp_device::rop_7_s_or_d, + &pc88va_sgp_device::rop_8_ns_or_d, + &pc88va_sgp_device::rop_9_n_s_xor_d, + &pc88va_sgp_device::rop_A_n_s, + &pc88va_sgp_device::rop_B_n_s_or_d, + &pc88va_sgp_device::rop_C_nd, + &pc88va_sgp_device::rop_D_s_or_nd, + &pc88va_sgp_device::rop_E_n_s_and_d, + &pc88va_sgp_device::rop_F_fill_1, +}; + +u16 pc88va_sgp_device::rop_0_fill_0(u16 src, u16 dst) { return 0; } +u16 pc88va_sgp_device::rop_1_s_and_d(u16 src, u16 dst) { return src & dst; } +u16 pc88va_sgp_device::rop_2_ns_and_d(u16 src, u16 dst) { return (~src) & dst; } +u16 pc88va_sgp_device::rop_3_d(u16 src, u16 dst) { return dst; } +u16 pc88va_sgp_device::rop_4_s_and_nd(u16 src, u16 dst) { return src & (~dst); } +u16 pc88va_sgp_device::rop_5_s(u16 src, u16 dst) { return src; } +u16 pc88va_sgp_device::rop_6_s_xor_d(u16 src, u16 dst) { return src ^ dst; } +u16 pc88va_sgp_device::rop_7_s_or_d(u16 src, u16 dst) { return src | dst; } +u16 pc88va_sgp_device::rop_8_ns_or_d(u16 src, u16 dst) { return ~(src | dst); } +u16 pc88va_sgp_device::rop_9_n_s_xor_d(u16 src, u16 dst) { return ~(src ^ dst); } +u16 pc88va_sgp_device::rop_A_n_s(u16 src, u16 dst) { return ~src; } +u16 pc88va_sgp_device::rop_B_n_s_or_d(u16 src, u16 dst) { return (~src) | dst; } +u16 pc88va_sgp_device::rop_C_nd(u16 src, u16 dst) { return ~dst; } +u16 pc88va_sgp_device::rop_D_s_or_nd(u16 src, u16 dst) { return src | (~dst); } +u16 pc88va_sgp_device::rop_E_n_s_and_d(u16 src, u16 dst) { return ~(src & dst); } +u16 pc88va_sgp_device::rop_F_fill_1(u16 src, u16 dst) { return 0xffff; } + +const pc88va_sgp_device::tpmod_func pc88va_sgp_device::tpmod_table[4] = +{ + &pc88va_sgp_device::tpmod_0_always, + &pc88va_sgp_device::tpmod_1_src, + &pc88va_sgp_device::tpmod_2_dst, + &pc88va_sgp_device::tpmod_3_never +}; + +bool pc88va_sgp_device::tpmod_0_always(u16 src, u16 dst) { return true; } +bool pc88va_sgp_device::tpmod_1_src(u16 src, u16 dst) { return src != 0; } +bool pc88va_sgp_device::tpmod_2_dst(u16 src, u16 dst) { return dst == 0; } +bool pc88va_sgp_device::tpmod_3_never(u16 src, u16 dst) { return false; } + /* * ---x ---- ---- ---- SF (0) shift source according to destination position @@ -315,7 +372,7 @@ void pc88va_sgp_device::start_exec() * ---- --00 ---- ---- transfer source as-is * ---- --01 ---- ---- do not transfer if source is 0 (transparent pen) * ---- --10 ---- ---- transfer only if destination is 0 - * ---- --11 ---- ---- + * ---- --11 ---- ---- * ---- ---- ---- xxxx LOGICAL OP * ---- ---- ---- 0000 0 * ---- ---- ---- 0001 Src AND Dst @@ -323,8 +380,8 @@ void pc88va_sgp_device::start_exec() * ---- ---- ---- 0011 NOP * ---- ---- ---- 0100 Src AND /Dst * ---- ---- ---- 0101 Src - * ---- ---- ---- 0110 Src XOR Dst - * ---- ---- ---- 0111 Src OR Dst + * ---- ---- ---- 0110 Src XOR Dst (ballbrkr) + * ---- ---- ---- 0111 Src OR Dst (boomer) * ---- ---- ---- 1000 /(Src OR Dst) * ---- ---- ---- 1001 /(Src XOR Dst) * ---- ---- ---- 1010 /Src @@ -337,40 +394,38 @@ void pc88va_sgp_device::start_exec() * PATBLT is identical to BITBLT except it repeats source copy * if it exceeds the clipping range. */ -void pc88va_sgp_device::cmd_blit(u16 draw_mode, bool is_patblt) +void pc88va_sgp_device::execute_blit(u16 draw_mode, bool is_patblt) { const u8 logical_op = draw_mode & 0xf; const u8 tp_mod = (draw_mode >> 8) & 0x3; + const bool hd = !!BIT(draw_mode, 10); + // TODO: rtype gameplay enables VD + const bool vd = !!BIT(draw_mode, 11); + const bool sf = !!BIT(draw_mode, 12); - // TODO: boomer title screen - if (is_patblt == true) + if (hd || vd || sf) { - LOG("PATBLT\n"); - // return; + popmessage("SGP: Warning draw_mode = %04x (HD %d VD %d SF %d)", draw_mode, hd, vd, sf); } - // ballbrkr: 6 - if (logical_op != 5) - { - LOG("BITBLT logical_op == %d\n", logical_op); - return; - } - - if (tp_mod > 1) + // boomer title screen just sets the same h/v size, irrelevant + if (is_patblt == true) { - LOG("BITBLT tp_mod == %d\n", tp_mod); - return; + LOG("PATBLT\n"); + // return; } if (m_src.hsize != m_dst.hsize || m_src.vsize != m_dst.vsize) { - LOG("BITBLT non-even sizes (%d x %d) x (%d x %d)\n", m_src.hsize, m_src.vsize, m_dst.hsize, m_dst.vsize); + LOG("SGP: Warning BITBLT non-even sizes (%d x %d) x (%d x %d)\n", m_src.hsize, m_src.vsize, m_dst.hsize, m_dst.vsize); return; } - if (m_src.pixel_mode == 0 || m_src.pixel_mode == 3 || m_src.pixel_mode != m_dst.pixel_mode) + if (m_src.pixel_mode != m_dst.pixel_mode && m_src.pixel_mode != 0 && m_dst.pixel_mode != 1) { - LOG("BITBLT pixel mode %d x %d\n", m_src.pixel_mode, m_dst.pixel_mode); + static const char *const pixel_mode[] = { "1bpp", "4bpp", "8bpp", "rgb565" }; + + LOG("SGP: Warning BITBLT pixel mode src %s against dst %s\n", pixel_mode[m_src.pixel_mode], pixel_mode[m_dst.pixel_mode]); return; } @@ -379,25 +434,115 @@ void pc88va_sgp_device::cmd_blit(u16 draw_mode, bool is_patblt) u32 src_address = m_src.address + (yi * m_src.fb_pitch); u32 dst_address = m_dst.address + (yi * m_dst.fb_pitch); - for (int xi = 0; xi < (m_src.hsize >> 2); xi ++) + // TODO: should fetch on demand, depending on m_dst.pixel_mode etc. + // m_src.start_dot is used by famista (pitcher throws) + for (int xi = 0; xi < m_src.hsize; xi ++) { - // TODO: not very efficient, we need a cleaner per-pixel RMW phase - const u16 src_dot = m_data->read_word(src_address); - const u16 dst_dot = m_data->read_word(dst_address); - u16 result = 0; - - for (int pixi = 0; pixi < 4; pixi ++) + switch(m_src.pixel_mode) { - u8 cur_pixel = (src_dot & 0xf); - if (cur_pixel || tp_mod == 0) - result |= (src_dot & 0xf) << (pixi * 4); - else - result |= (dst_dot & 0xf) << (pixi * 4); + // 1bpp + case 0: + { + const u32 src_offset = src_address + ((xi + m_src.start_dot) >> 3); + const u8 src_nibble = ((xi + m_src.start_dot) ^ 7) & 7; + + // famista, before expanding (1bpp -> 1bpp) + if (m_dst.pixel_mode == 0) + { + const u32 dst_offset = dst_address + ((xi + m_dst.start_dot) >> 3); + const u8 dst_nibble = ((xi + m_dst.start_dot) ^ 7) & 7; + + u8 src = (m_data->read_byte(src_offset) >> src_nibble) & 0x1; + u8 result = m_data->read_byte(dst_offset); + u8 dst = (result >> dst_nibble) & 0x1; + + if ((this->*tpmod_table[tp_mod])(src, dst)) + { + result &= ~(1 << dst_nibble); + result |= ((this->*rop_table[logical_op])(src, dst) & 1) << dst_nibble; + m_data->write_byte(dst_offset, result); + } + } + else if (m_dst.pixel_mode == 1) // famista and pceva2tb:SKYBD.BAT (1bpp -> 4bpp) + { + const u32 dst_offset = dst_address + ((xi + m_dst.start_dot) >> 1); + const u8 dst_nibble = (((xi + m_dst.start_dot) ^ 1) & 1) * 4; + + u8 src = (m_data->read_byte(src_offset) >> src_nibble) & 0x1; + u8 result = m_data->read_byte(dst_offset); + u8 dst = (result >> dst_nibble) & 0xf; + + if ((this->*tpmod_table[tp_mod])(src, dst)) + { + result &= dst_nibble ? 0x0f : 0xf0; + result |= ((this->*rop_table[logical_op])(src, dst) ? m_color_code & 0xf : 0) << dst_nibble; + m_data->write_byte(dst_offset, result); + } + } + + break; + } + // 4bpp (shinraba) + case 1: + { + const u32 src_offset = src_address + ((xi + m_src.start_dot) >> 1); + const u8 src_nibble = (((xi + m_src.start_dot) ^ 1) & 1) * 4; + + const u32 dst_offset = dst_address + ((xi + m_dst.start_dot) >> 1); + const u8 dst_nibble = (((xi + m_dst.start_dot) ^ 1) & 1) * 4; + + u8 src = (m_data->read_byte(src_offset) >> src_nibble) & 0xf; + u8 result = m_data->read_byte(dst_offset); + u8 dst = (result >> dst_nibble) & 0xf; + + if ((this->*tpmod_table[tp_mod])(src, dst)) + { + result &= dst_nibble ? 0x0f : 0xf0; + result |= (this->*rop_table[logical_op])(src, dst) << dst_nibble; + m_data->write_byte(dst_offset, result); + } + + break; + } + + // 8bpp (tetris) + case 2: + { + const u32 src_offset = src_address + (xi + m_src.start_dot); + const u32 dst_offset = dst_address + (xi + m_dst.start_dot); + + u8 src = m_data->read_byte(src_offset) & 0xff; + u8 dst = m_data->read_byte(dst_offset) & 0xff; + u8 result = dst; + + if ((this->*tpmod_table[tp_mod])(src, dst)) + { + result = (this->*rop_table[logical_op])(src, dst); + m_data->write_byte(dst_offset, result); + } + + break; + } + + // RGB565 (ballbrkr title) + case 3: + { + const u32 src_offset = src_address + ((xi + m_src.start_dot) << 1); + const u32 dst_offset = dst_address + ((xi + m_dst.start_dot) << 1); + + u16 src = m_data->read_word(src_offset) & 0xffff; + u16 dst = m_data->read_word(dst_offset) & 0xffff; + u16 result = dst; + + if ((this->*tpmod_table[tp_mod])(src, dst)) + { + result = (this->*rop_table[logical_op])(src, dst); + m_data->write_word(dst_offset, result); + } + + break; + } } - - m_data->write_word(dst_address, result); - src_address += 2; - dst_address += 2; } } } diff --git a/src/mame/nec/pc88va_sgp.h b/src/mame/nec/pc88va_sgp.h index 1ef011f72b03f..f0b6423edf2ec 100644 --- a/src/mame/nec/pc88va_sgp.h +++ b/src/mame/nec/pc88va_sgp.h @@ -30,13 +30,14 @@ class pc88va_sgp_device : u16 m_vdp_address[2]{}; u32 m_work_address = 0; + u16 m_color_code; struct BufferArea { u8 start_dot = 0; u8 pixel_mode = 0; u16 hsize = 0; u16 vsize = 0; - u16 fb_pitch = 0; + s16 fb_pitch = 0; u32 address = 0; }; @@ -49,8 +50,34 @@ class pc88va_sgp_device : void start_exec(); - // commands - void cmd_blit(u16 draw_mode, bool is_patblt); + void execute_blit(u16 draw_mode, bool is_patblt); + + typedef u16 (pc88va_sgp_device::*rop_func)(u16 src, u16 dst); + + static const rop_func rop_table[16]; + u16 rop_0_fill_0(u16 src, u16 dst); + u16 rop_1_s_and_d(u16 src, u16 dst); + u16 rop_2_ns_and_d(u16 src, u16 dst); + u16 rop_3_d(u16 src, u16 dst); + u16 rop_4_s_and_nd(u16 src, u16 dst); + u16 rop_5_s(u16 src, u16 dst); + u16 rop_6_s_xor_d(u16 src, u16 dst); + u16 rop_7_s_or_d(u16 src, u16 dst); + u16 rop_8_ns_or_d(u16 src, u16 dst); + u16 rop_9_n_s_xor_d(u16 src, u16 dst); + u16 rop_A_n_s(u16 src, u16 dst); + u16 rop_B_n_s_or_d(u16 src, u16 dst); + u16 rop_C_nd(u16 src, u16 dst); + u16 rop_D_s_or_nd(u16 src, u16 dst); + u16 rop_E_n_s_and_d(u16 src, u16 dst); + u16 rop_F_fill_1(u16 src, u16 dst); + + typedef bool (pc88va_sgp_device::*tpmod_func)(u16 src, u16 dst); + static const tpmod_func tpmod_table[4]; + bool tpmod_0_always(u16 src, u16 dst); + bool tpmod_1_src(u16 src, u16 dst); + bool tpmod_2_dst(u16 src, u16 dst); + bool tpmod_3_never(u16 src, u16 dst); }; diff --git a/src/mame/nec/pc88va_v.cpp b/src/mame/nec/pc88va_v.cpp index d9d66b5cd9dbc..54b12bf28cf53 100644 --- a/src/mame/nec/pc88va_v.cpp +++ b/src/mame/nec/pc88va_v.cpp @@ -4,8 +4,6 @@ #include "emu.h" #include "pc88va.h" -#include - #define LOG_IDP (1U << 1) // TSP data #define LOG_FB (1U << 2) // framebuffer strips (verbose) @@ -14,6 +12,8 @@ #define LOG_COLOR (1U << 5) // current color mode #define LOG_TEXT (1U << 6) // text strips (verbose) +//#include + #define VERBOSE (LOG_GENERAL | LOG_IDP) //#define LOG_OUTPUT_STREAM std::cout @@ -28,10 +28,14 @@ void pc88va_state::video_start() { + const u32 gvram_size = 0x40000; + m_gvram = make_unique_clear(gvram_size); + std::fill_n(m_gvram.get(), gvram_size, 0); + const u32 kanjiram_size = 0x4000; - m_kanjiram = std::make_unique(kanjiram_size); - m_gfxdecode->gfx(2)->set_source(m_kanjiram.get()); - m_gfxdecode->gfx(3)->set_source(m_kanjiram.get()); + m_kanji_ram = make_unique_clear(kanjiram_size); + m_gfxdecode->gfx(2)->set_source(m_kanji_ram.get()); + m_gfxdecode->gfx(3)->set_source(m_kanji_ram.get()); m_vrtc_irq_line = 432; for (int i = 0; i < 2; i++) @@ -45,14 +49,26 @@ void pc88va_state::video_start() save_item(NAME(m_text_transpen)); save_pointer(NAME(m_video_pri_reg), 2); - save_pointer(NAME(m_kanjiram), kanjiram_size); + save_pointer(NAME(m_gvram), gvram_size); + save_pointer(NAME(m_kanji_ram), kanjiram_size); save_item(NAME(m_vrtc_irq_line)); } +// TODO: all needs to be verified +void pc88va_state::video_reset() +{ + m_gden0 = false; + m_text_transpen = 0; + m_screen_ctrl_reg = 0; + m_color_mode = 0; + m_pltm = 0; + m_pltp = 0; + m_video_pri_reg[0] = m_video_pri_reg[1] = 0; +} + void pc88va_state::palette_init(palette_device &palette) const { - // default palette const u16 default_palette[16] = { 0x0000, 0x001f, 0x03e0, 0x03ff, 0xfc00, 0xfc1f, 0xffe0, 0xffff, 0x7def, 0x0015, 0x02a0, 0x02b5, 0xac00, 0xac15, 0xaea0, 0xaeb5 @@ -69,7 +85,6 @@ void pc88va_state::palette_init(palette_device &palette) const } } - uint32_t pc88va_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { uint8_t pri, cur_pri_lv; @@ -233,6 +248,7 @@ void pc88va_state::draw_sprites(bitmap_rgb32 &bitmap, const rectangle &cliprect) } } + // TODO: std::function if(md) // 1bpp mode { int fg_col = (tvram[(offs + i + 6) / 2] & 0xf0) >> 4; @@ -255,19 +271,22 @@ void pc88va_state::draw_sprites(bitmap_rgb32 &bitmap, const rectangle &cliprect) for(int x_s = 0; x_s < 16; x_s++) { int res_x = xp + x_i + x_s; - // TODO: MG actually doubles Y size int res_y = (yp + y_i) << m_tsp.spr_mg; - if (!cliprect.contains(res_x, res_y)) - continue; - const u32 data_offset = ((spda + spr_count) & 0xffff) / 2; u8 pen = (bitswap<16>(tvram[data_offset],7,6,5,4,3,2,1,0,15,14,13,12,11,10,9,8) >> (15 - x_s)) & 1; pen = pen & 1 ? fg_col : (bc) ? 8 : 0; if(pen != 0) - bitmap.pix(res_y, res_x) = m_palette->pen(pen + layer_pal_bank); + { + for (int mg = 0; mg < m_tsp.spr_mg + 1; mg ++) + { + if (!cliprect.contains(res_x, res_y + mg)) + continue; + bitmap.pix(res_y + mg, res_x) = m_palette->pen(pen + layer_pal_bank); + } + } } spr_count += 2; @@ -291,16 +310,20 @@ void pc88va_state::draw_sprites(bitmap_rgb32 &bitmap, const rectangle &cliprect) int res_x = xp + x_i + x_s; int res_y = (yp + y_i) << m_tsp.spr_mg; - if (!cliprect.contains(res_x, res_y)) - continue; - const u32 data_offset = ((spda + spr_count) & 0xffff) / 2; int pen = (bitswap<16>(tvram[data_offset],7,6,5,4,3,2,1,0,15,14,13,12,11,10,9,8)) >> (12 - (x_s * 4)) & 0xf; //if (pen != 0 && pen != m_text_transpen) if (pen != 0) - bitmap.pix(res_y, res_x) = m_palette->pen(pen + layer_pal_bank); + { + for (int mg = 0; mg < m_tsp.spr_mg + 1; mg ++) + { + if (!cliprect.contains(res_x, res_y + mg)) + continue; + bitmap.pix(res_y + mg, res_x) = m_palette->pen(pen + layer_pal_bank); + } + } } spr_count += 2; @@ -419,20 +442,24 @@ void pc88va_state::draw_text(bitmap_rgb32 &bitmap, const rectangle &cliprect) rectangle split_cliprect(rxp, rxp + rw - 1, ryp, ryp + rh - 1); split_cliprect &= cliprect; + const int line_height = m_tsp.line_height; + + if (line_height < 8) + continue; + for(int y = 0; y < vh; y++) { - int y_base = y * 16 + ryp - raster_offset; + int y_base = y * line_height + ryp - raster_offset; - // TODO: consult with OG if (!split_cliprect.contains(rxp, y_base) && - !split_cliprect.contains(rxp, y_base + 16)) + !split_cliprect.contains(rxp, y_base + line_height)) continue; for(int x = 0; x < vw; x++) { int x_base = x * 8; if (!split_cliprect.contains(x_base, y_base) && - !split_cliprect.contains(x_base, y_base + 16)) + !split_cliprect.contains(x_base, y_base + line_height)) continue; // TODO: understand where VSA comes into equation @@ -607,7 +634,7 @@ void pc88va_state::draw_text(bitmap_rgb32 &bitmap, const rectangle &cliprect) if(!split_cliprect.contains(res_x, res_y)) continue; - int pen = m_kanjiram[(( yi * 2 ) + lr_half_gfx) + tile_num] >> (7 - xi) & 1; + int pen = m_kanji_ram[(( yi * 2 ) + lr_half_gfx) + tile_num] >> (7 - xi) & 1; if(reverse) pen = pen & 1 ? bg_col : fg_col; @@ -679,6 +706,10 @@ void pc88va_state::draw_text(bitmap_rgb32 &bitmap, const rectangle &cliprect) void pc88va_state::draw_graphic_layer(bitmap_rgb32 &bitmap, const rectangle &cliprect, u8 which) { + // Master graphic enable + if (!m_gden0) + return; + // disable graphic B if screen 0 only setting is enabled if (which && !m_ymmd) return; @@ -692,9 +723,13 @@ void pc88va_state::draw_graphic_layer(bitmap_rgb32 &bitmap, const rectangle &cli const u8 gfx_ctrl = (m_gfx_ctrl_reg >> (which * 8)) & 0x13; - // TODO: xak2 wants independent doubled Y axis on setup menu & Micro Cabin logo - // i.e. 200 lines draw on a 400 lines canvas + // H320 setting const u32 pixel_size = 0x10000 >> BIT(gfx_ctrl, 4); + // xak2/fray/boomer all sets independent doubled Y axis + // i.e. 200 lines draw on a 400 lines canvas + const int v_sizes[4] = { 400, 408, 200, 204 }; + const u32 line_size = (0x10000 * v_sizes[m_vw]) / m_screen->visible_area().height(); + //popmessage("%08x %d %d %d", line_size, m_screen->visible_area().height(), m_vw, BIT(m_screen_ctrl_reg, 7)); const u8 layer_pal_bank = get_layer_pal_bank(2 + which); @@ -704,6 +739,7 @@ void pc88va_state::draw_graphic_layer(bitmap_rgb32 &bitmap, const rectangle &cli , layer_pal_bank ); +// m_graphic_bitmap[which].fill(m_palette->pen(layer_pal_bank), cliprect); m_graphic_bitmap[which].fill(0, cliprect); const int layer_inc = (!is_5bpp) + 1; @@ -725,9 +761,13 @@ void pc88va_state::draw_graphic_layer(bitmap_rgb32 &bitmap, const rectangle &cli // (almost likely an HW quirk, described in the docs) // also animefrm swaps this with layer 2 (main canvas) const u32 fsa = (layer_n == layer_fixed) ? 0x20000 - : (fb_strip_regs[0x00 / 2] & 0xfffc) | ((fb_strip_regs[0x02 / 2] & 0x3) << 16) >> 1; + : (fb_strip_regs[0x00 / 2] & 0xfffc) | ((fb_strip_regs[0x02 / 2] & 0x3) << 16); + + u16 fbl = (fb_strip_regs[0x06 / 2] & 0x3ff) + 1; + // shinraba relies on this for Graphic B, assume same behaviour of upd7220 pc98:madoum* + if (fbl == 1) + fbl = 0x400; - const u16 fbl = (fb_strip_regs[0x06 / 2] & 0x3ff) + 1; const u8 x_dot_offs = fb_strip_regs[0x08 / 2]; const u16 ofx = fb_strip_regs[0x0a / 2] & 0x7fc; const u16 ofy = fb_strip_regs[0x0c / 2] & 0x3ff; @@ -737,7 +777,7 @@ void pc88va_state::draw_graphic_layer(bitmap_rgb32 &bitmap, const rectangle &cli LOGFB("%d %08x FSA|\n\t%d FBW | %d FBL |\n\t %d OFX (%d dot)| %d OFY|\n\t %08x DSA|\n\t %04x (%d) DSH | %04x (%d) DSP\n" , layer_n - , fsa << 1 + , fsa , fbw , fbl , ofx @@ -758,11 +798,19 @@ void pc88va_state::draw_graphic_layer(bitmap_rgb32 &bitmap, const rectangle &cli rectangle fb_cliprect(cliprect.min_x, cliprect.max_x, dsp, dsp + fbl - 1); split_cliprect &= fb_cliprect; + if (split_cliprect.empty()) + continue; + + // TODO: picture mask + if (!m_dm) { switch(gfx_ctrl & 3) { - case 1: draw_packed_gfx_4bpp(m_graphic_bitmap[which], split_cliprect, fsa, dsa, layer_pal_bank, fbw, fbl); break; + case 1: draw_packed_gfx_4bpp(m_graphic_bitmap[which], split_cliprect, fsa, dsa, ofx, layer_pal_bank, fbw, fbl); break; + default: + popmessage("pc88va_v.cpp: unhandled %d GFX mode DM = 0 (Multiplane)", which); + break; } } else @@ -770,33 +818,35 @@ void pc88va_state::draw_graphic_layer(bitmap_rgb32 &bitmap, const rectangle &cli switch(gfx_ctrl & 3) { //case 0: draw_indexed_gfx_1bpp(bitmap, cliprect, dsa, layer_pal_bank); break; - case 1: draw_indexed_gfx_4bpp(m_graphic_bitmap[which], split_cliprect, fsa, dsa, layer_pal_bank, fbw, fbl); break; + case 1: draw_indexed_gfx_4bpp(m_graphic_bitmap[which], split_cliprect, fsa, dsa, dsp, ofx, layer_pal_bank, fbw, fbl); break; case 2: - if (m_pltm == 7) + if (is_5bpp) { - draw_packed_gfx_5bpp(m_graphic_bitmap[which], split_cliprect, fsa, dsa, layer_pal_bank, fbw, fbl); + draw_packed_gfx_5bpp(m_graphic_bitmap[which], split_cliprect, fsa, dsa, dsp, ofx, layer_pal_bank, fbw, fbl); } else - draw_direct_gfx_8bpp(m_graphic_bitmap[which], split_cliprect, fsa, fbw, fbl); + draw_direct_gfx_8bpp(m_graphic_bitmap[which], split_cliprect, fsa, dsa, dsp, ofx, fbw, fbl); + break; + case 3: draw_direct_gfx_rgb565(m_graphic_bitmap[which], split_cliprect, fsa, dsa, ofx, fbw, fbl); break; + default: + popmessage("pc88va_v.cpp: unhandled %d GFX mode DM = 1 (Singleplane)", which); break; - case 3: draw_direct_gfx_rgb565(m_graphic_bitmap[which], split_cliprect, fsa, fbw, fbl); break; } } } - // TODO: we eventually need primask_copyrozbitmap_trans here, or a custom copy, depending on what the "transpen" registers really do. + // TODO: primask_copyrozbitmap_trans copyrozbitmap_trans( bitmap, cliprect, m_graphic_bitmap[which], 0, 0, - pixel_size, 0, 0, pixel_size, + pixel_size, 0, 0, line_size, false, 0 ); } +// TODO: incomplete void pc88va_state::draw_indexed_gfx_1bpp(bitmap_rgb32 &bitmap, const rectangle &cliprect, u32 fb_start_offset, u8 pal_base) { - uint8_t *gvram = (uint8_t *)m_gvram.target(); - for(int y = cliprect.min_y; y <= cliprect.max_y; y++) { const u32 line_offset = (((y * 640) / 8) + fb_start_offset) & 0x3ffff; @@ -804,11 +854,11 @@ void pc88va_state::draw_indexed_gfx_1bpp(bitmap_rgb32 &bitmap, const rectangle & for(int x = cliprect.min_x; x <= cliprect.max_x; x += 8) { u16 x_char = (x >> 3); - u32 bitmap_offset = line_offset + x_char; + u32 bitmap_offset = (line_offset + x_char) & 0x3ffff; for (int xi = 0; xi < 8; xi ++) { - uint32_t color = (gvram[bitmap_offset] >> (7 - xi)) & 1; + uint32_t color = (m_gvram[bitmap_offset] >> (7 - xi)) & 1; int res_x = x + xi; if(color && cliprect.contains(res_x, y)) @@ -818,27 +868,27 @@ void pc88va_state::draw_indexed_gfx_1bpp(bitmap_rgb32 &bitmap, const rectangle & } } -void pc88va_state::draw_indexed_gfx_4bpp(bitmap_rgb32 &bitmap, const rectangle &cliprect, u32 fb_start_offset, u32 display_start_offset, u8 pal_base, u16 fb_width, u16 fb_height) +void pc88va_state::draw_indexed_gfx_4bpp(bitmap_rgb32 &bitmap, const rectangle &cliprect, u32 fb_start_offset, u32 display_start_offset, u16 dsp_start_base, u16 scrollx, u8 pal_base, u16 fb_width, u16 fb_height) { - uint8_t *gvram = (uint8_t *)m_gvram.target(); - // const u16 y_min = std::max(cliprect.min_y, y_start); // const u16 y_max = std::min(cliprect.max_y, y_min + fb_height); //printf("%d %d %d %08x %d\n", y_min, y_max, fb_width, start_offset, fb_height); + const u32 base_address = (fb_start_offset & 0x20000) | (display_start_offset & 0x1ffff); + for(int y = cliprect.min_y; y <= cliprect.max_y; y++) { - const u32 line_offset = ((y * fb_width) + fb_start_offset) & 0x3ffff; + const u32 line_offset = (((y - dsp_start_base) * fb_width) + base_address) & 0x3ffff; for(int x = cliprect.min_x; x <= cliprect.max_x; x += 2) { u16 x_char = (x >> 1); - u32 bitmap_offset = line_offset + x_char; + u32 bitmap_offset = (line_offset + x_char - (scrollx >> 6)) & 0x3ffff; for (int xi = 0; xi < 2; xi ++) { - u8 color = (gvram[bitmap_offset] >> (xi ? 0 : 4)) & 0xf; + u8 color = (m_gvram[bitmap_offset] >> (xi ? 0 : 4)) & 0xf; if(color && cliprect.contains(x + xi, y)) bitmap.pix(y, x + xi) = m_palette->pen(color + pal_base); @@ -847,24 +897,23 @@ void pc88va_state::draw_indexed_gfx_4bpp(bitmap_rgb32 &bitmap, const rectangle & } } -void pc88va_state::draw_packed_gfx_5bpp(bitmap_rgb32 &bitmap, const rectangle &cliprect, u32 fb_start_offset, u32 display_start_offset, u8 pal_base, u16 fb_width, u16 fb_height) +void pc88va_state::draw_packed_gfx_5bpp(bitmap_rgb32 &bitmap, const rectangle &cliprect, u32 fb_start_offset, u32 display_start_offset, u16 dsp_start_base, u16 scrollx, u8 pal_base, u16 fb_width, u16 fb_height) { - uint8_t *gvram = (uint8_t *)m_gvram.target(); - // const u16 y_min = std::max(cliprect.min_y, y_start); // const u16 y_max = std::min(cliprect.max_y, y_min + fb_height); //printf("%d %d %d %08x %d\n", y_min, y_max, fb_width, start_offset, fb_height); + const u32 base_address = (fb_start_offset & 0x20000) | (display_start_offset & 0x1ffff); for(int y = cliprect.min_y; y <= cliprect.max_y; y++) { - const u32 line_offset = ((y * fb_width) + fb_start_offset) & 0x3ffff; + const u32 line_offset = (((y - dsp_start_base) * fb_width) + base_address) & 0x3ffff; for(int x = cliprect.min_x; x <= cliprect.max_x; x++) { - u32 bitmap_offset = line_offset + x; + u32 bitmap_offset = (line_offset + x - (scrollx >> 6)) & 0x3ffff; - u8 color = gvram[bitmap_offset] & 0x1f; + u8 color = m_gvram[bitmap_offset] & 0x1f; if(color && cliprect.contains(x, y)) bitmap.pix(y, x) = m_palette->pen(color); @@ -872,22 +921,21 @@ void pc88va_state::draw_packed_gfx_5bpp(bitmap_rgb32 &bitmap, const rectangle &c } } -void pc88va_state::draw_direct_gfx_8bpp(bitmap_rgb32 &bitmap, const rectangle &cliprect, u32 fb_start_offset, u16 fb_width, u16 fb_height) +void pc88va_state::draw_direct_gfx_8bpp(bitmap_rgb32 &bitmap, const rectangle &cliprect, u32 fb_start_offset, u32 display_start_offset, u16 dsp_start_base, u16 scrollx, u16 fb_width, u16 fb_height) { - uint8_t *gvram = (uint8_t *)m_gvram.target(); - // const u16 y_min = std::max(cliprect.min_y, y_start); // const u16 y_max = std::min(cliprect.max_y, y_min + fb_height); + const u32 base_address = (fb_start_offset & 0x20000) | (display_start_offset & 0x1ffff); for(int y = cliprect.min_y; y <= cliprect.max_y; y++) { - const u32 line_offset = ((y * fb_width) + fb_start_offset) & 0x3ffff; + const u32 line_offset = (((y - dsp_start_base) * fb_width) + base_address) & 0x3ffff; for(int x = cliprect.min_x; x <= cliprect.max_x; x++) { - u32 bitmap_offset = line_offset + x; + u32 bitmap_offset = (line_offset + x - (scrollx >> 6)) & 0x3ffff; - uint32_t color = (gvram[bitmap_offset] & 0xff); + uint32_t color = (m_gvram[bitmap_offset] & 0xff); // boomer suggests that transparency is calculated over just color = 0, may be settable? // TODO: may not be clamped to palNbit @@ -902,22 +950,22 @@ void pc88va_state::draw_direct_gfx_8bpp(bitmap_rgb32 &bitmap, const rectangle &c } } -void pc88va_state::draw_direct_gfx_rgb565(bitmap_rgb32 &bitmap, const rectangle &cliprect, u32 fb_start_offset, u16 fb_width, u16 fb_height) +void pc88va_state::draw_direct_gfx_rgb565(bitmap_rgb32 &bitmap, const rectangle &cliprect, u32 fb_start_offset, u32 display_start_offset, u16 scrollx, u16 fb_width, u16 fb_height) { - uint8_t *gvram = (uint8_t *)m_gvram.target(); - // const u16 y_min = std::max(cliprect.min_y, y_start); // const u16 y_max = std::min(cliprect.max_y, y_min + fb_height); + const u32 base_address = (display_start_offset & 0x3ffff); for(int y = cliprect.min_y; y <= cliprect.max_y; y++) { - const u32 line_offset = ((y * fb_width) + fb_start_offset) & 0x3ffff; + // pc88vad requires halved pitch for first screen + const u32 line_offset = ((y * fb_width >> 1) + base_address) & 0x3ffff; for(int x = cliprect.min_x; x <= cliprect.max_x; x++) { - u32 bitmap_offset = (line_offset + x) << 1; + u32 bitmap_offset = ((line_offset + x - (scrollx >> 1)) << 1) & 0x3ffff; - uint16_t color = (gvram[bitmap_offset] & 0xff) | (gvram[bitmap_offset + 1] << 8); + uint16_t color = (m_gvram[bitmap_offset] & 0xff) | (m_gvram[bitmap_offset + 1] << 8); if(cliprect.contains(x, y)) { @@ -930,27 +978,28 @@ void pc88va_state::draw_direct_gfx_rgb565(bitmap_rgb32 &bitmap, const rectangle } } -void pc88va_state::draw_packed_gfx_4bpp(bitmap_rgb32 &bitmap, const rectangle &cliprect, u32 fb_start_offset, u32 display_start_offset, u8 pal_base, u16 fb_width, u16 fb_height) +// famista, all inufuto games +void pc88va_state::draw_packed_gfx_4bpp(bitmap_rgb32 &bitmap, const rectangle &cliprect, u32 fb_start_offset, u32 display_start_offset, u16 scrollx, u8 pal_base, u16 fb_width, u16 fb_height) { - uint8_t *gvram = (uint8_t *)m_gvram.target(); - // const u16 y_min = std::max(cliprect.min_y, y_start); // const u16 y_max = std::min(cliprect.max_y, y_min + fb_height); + const u32 base_offset = display_start_offset >> 2; + for(int y = cliprect.min_y; y <= cliprect.max_y; y++) { - const u32 line_offset = ((y * (fb_width >> 2)) + fb_start_offset) & 0x0ffff; + const u32 line_offset = ((y * (fb_width >> 2)) + base_offset) & 0x0ffff; for(int x = cliprect.min_x; x <= cliprect.max_x; x += 8) { u16 x_char = (x >> 3); - u32 bitmap_offset = line_offset + x_char; + u32 bitmap_offset = (line_offset + x_char - (scrollx >> 2)) & 0x0ffff; for (int xi = 0; xi < 8; xi ++) { u8 color = 0; for (int bank_num = 0; bank_num < 4; bank_num ++) - color |= ((gvram[bitmap_offset + bank_num * 0x10000] >> (7 - xi)) & 1) << bank_num; + color |= ((m_gvram[bitmap_offset + bank_num * 0x10000] >> (7 - xi)) & 1) << bank_num; if(color && cliprect.contains(x + xi, y)) bitmap.pix(y, x + xi) = m_palette->pen(color + pal_base); @@ -1141,21 +1190,29 @@ void pc88va_state::execute_sync_cmd() // olteus will punt loading on PC Engine OS if the vblank bit is completely off // illcity expects the actual IDP vblank bit to work, from setup menu to opening transition PC=0x418f6 // upo wants precise vblank bit readouts plus something else (SGP irq?) - - rectangle visarea; - attoseconds_t refresh; - + // TODO: verify fray LOGCRTC("IDP SYNC: "); for (int i = 0; i < 15; i++) + { LOGCRTC("%02x ", m_buf_ram[i]); + m_crtc_regs[i] = m_buf_ram[i]; + } + + recompute_parameters(); +} + +void pc88va_state::recompute_parameters() +{ + rectangle visarea; + attoseconds_t refresh; - const u8 h_blank_start = (m_buf_ram[0x02] & 0x3f) + 1; - const u8 h_border_start = (m_buf_ram[0x03] & 0x3f) + 1; - const u16 h_vis_area = (m_buf_ram[0x04] + 1) * 4; - const u8 h_border_end = (m_buf_ram[0x05] & 0x3f) + 1; - const u8 h_blank_end = (m_buf_ram[0x06] & 0x3f) + 1; - const u8 h_sync = (m_buf_ram[0x07] & 0x3f) + 1; + const u8 h_blank_start = (m_crtc_regs[0x02] & 0x3f) + 1; + const u8 h_border_start = (m_crtc_regs[0x03] & 0x3f) + 1; + const u16 h_vis_area = (m_crtc_regs[0x04] + 1) * 4; + const u8 h_border_end = (m_crtc_regs[0x05] & 0x3f) + 1; + const u8 h_blank_end = (m_crtc_regs[0x06] & 0x3f) + 1; + const u8 h_sync = (m_crtc_regs[0x07] & 0x3f) + 1; LOGCRTC("\n\t"); LOGCRTC("H blank start %d - end %d|", h_blank_start, h_blank_end); @@ -1170,23 +1227,32 @@ void pc88va_state::execute_sync_cmd() LOGCRTC("H Total calc = %d", h_total); LOGCRTC("\n\t"); - const u8 v_blank_start = m_buf_ram[0x08] & 0x3f; - const u8 v_border_start = m_buf_ram[0x09] & 0x3f; - const u16 v_vis_area = (m_buf_ram[0x0a]) | ((m_buf_ram[0x0b] & 0x40) << 2); - const u8 v_border_end = m_buf_ram[0x0b] & 0x3f; - const u8 v_blank_end = m_buf_ram[0x0c] & 0x3f; - const u8 v_sync = (m_buf_ram[0x0d] & 0x3f); + const u8 v_blank_start = m_crtc_regs[0x08] & 0x3f; + const u8 v_border_start = m_crtc_regs[0x09] & 0x3f; + u16 v_vis_area = (m_crtc_regs[0x0a]) | ((m_crtc_regs[0x0b] & 0x40) << 2); + const u8 v_border_end = m_crtc_regs[0x0b] & 0x3f; + const u8 v_blank_end = m_crtc_regs[0x0c] & 0x3f; + const u8 v_sync = (m_crtc_regs[0x0d] & 0x3f); LOGCRTC("V blank start %d - end %d|", v_blank_start, v_blank_end); LOGCRTC("V visible area: %d|", v_vis_area); - LOGCRTC("V border start: %d - end %d|", v_border_start, v_border_end); + LOGCRTC("V border start %d - end %d|", v_border_start, v_border_end); LOGCRTC("V sync: %d", v_sync); LOGCRTC("\n\t"); m_vrtc_irq_line = v_blank_start + v_blank_end + v_vis_area + v_border_start + v_border_end; - const u16 v_total = m_vrtc_irq_line + v_sync; + u16 v_total = m_vrtc_irq_line + v_sync; + + LOGCRTC("V Total calc = %d (VRTC %d)", v_total, m_vrtc_irq_line); - LOGCRTC("V Total calc = %d (VRTC %d)\n", v_total, m_vrtc_irq_line); + if (BIT(m_screen_ctrl_reg, 7)) + { + m_vrtc_irq_line <<= 1; + v_total <<= 1; + v_vis_area <<= 1; + LOGCRTC(" (Interlace)"); + } + LOGCRTC("\n"); // punt with message if values are off (shouldn't happen) // TODO: more validation: @@ -1205,9 +1271,11 @@ void pc88va_state::execute_sync_cmd() visarea.set(0, h_vis_area - 1, 0, v_vis_area - 1); - // TODO: interlace / vertical magnify, bit 7 - // TODO: actual clock source must be external, assume known PC-88 XTALs, a bit off compared to PC-88 with the values above - const int clock_speed = BIT(m_buf_ram[0x00], 6) ? (31'948'800 / 4) : (28'636'363 / 2); + // TODO: vertical global magnify at bit 7 + // TODO: actual clock source must be external, assume known PC-88 XTALs + // TODO: a bit off compared to PC-88 equivalent with the configured values + // TODO: famista pukes a 31.2 Hz vertical in 24kHz mode + const int clock_speed = !!BIT(m_crtc_regs[0x00], 6) ? (31'948'800 / 4) : (28'636'363 / 2); refresh = HZ_TO_ATTOSECONDS(clock_speed) * h_vis_area * v_vis_area; @@ -1263,7 +1331,7 @@ void pc88va_state::execute_dspdef_cmd() m_tsp.blink = (m_buf_ram[5] & 0xf8); if (m_tsp.blink == 0) m_tsp.blink = 0x100; - LOGIDP("DSPDEF (%02x %02x %02x %02x %02x %02x) %05x ATTR | %02x pitch | %02x line height| %02x hline | %d blink rate\n" + LOGIDP("DSPDEF (%02x %02x %02x %02x %02x %02x) %05x ATTR | %d pitch | %d line height| %d hline | %d blink rate\n" , m_buf_ram[0], m_buf_ram[1], m_buf_ram[2], m_buf_ram[3], m_buf_ram[4], m_buf_ram[5] , m_tsp.attr_offset | 0x40000 , m_tsp.pitch @@ -1462,12 +1530,23 @@ void pc88va_state::idp_param_w(uint8_t data) */ void pc88va_state::screen_ctrl_w(offs_t offset, u16 data, u16 mem_mask) { + // Interlace mode (inufuto games), cheat for now. + if (BIT(data, 7) != BIT(m_screen_ctrl_reg, 7)) + { + recompute_parameters(); + } + COMBINE_DATA(&m_screen_ctrl_reg); - m_ymmd = bool(BIT(m_screen_ctrl_reg, 11)); - m_dm = bool(BIT(m_screen_ctrl_reg, 10)); // YMMD DM // mightmag 0xb060 (0) screen 0 (0) multiplane + m_gden0 = !!(BIT(m_screen_ctrl_reg, 15)); + m_ymmd = !!(BIT(m_screen_ctrl_reg, 11)); + m_dm = !!(BIT(m_screen_ctrl_reg, 10)); + + m_vw = m_screen_ctrl_reg & 3; + if (m_vw & 1) + popmessage("pc88va_v.cpp: VW = %d (408/204 lines mode)", m_vw); } u16 pc88va_state::screen_ctrl_r() @@ -1597,6 +1676,19 @@ void pc88va_state::text_transpen_w(offs_t offset, u16 data, u16 mem_mask) popmessage("text transpen > 15 (%04x)", m_text_transpen); } +void pc88va_state::picture_mask_w(offs_t offset, u16 data, u16 mem_mask) +{ + switch(offset) + { + case 0: COMBINE_DATA(&m_picture_mask.left); m_picture_mask.left &= 0x3ff; break; + case 1: COMBINE_DATA(&m_picture_mask.right); m_picture_mask.right &= 0x3ff; break; + case 2: COMBINE_DATA(&m_picture_mask.top); m_picture_mask.top &= 0xff; break; + case 3: COMBINE_DATA(&m_picture_mask.bottom); m_picture_mask.bottom &= 0xff; break; + } + +// popmessage("x0 %d y0 %d - x1 %d y1 %d", m_picture_mask.left, m_picture_mask.top, m_picture_mask.right, m_picture_mask.bottom); +} + /* * $14c-$14f Kanji CG ports * Alt method for access kanji ROM for drawing to graphic layers @@ -1615,7 +1707,7 @@ u8 pc88va_state::kanji_cg_r() // jis2 = 0x21 / 0x22 "PC" on hovered top status bar for animefrm // NB: software reverts the two chars once it gets upped to bitmap layer. const u32 pcg_addr = ((m_kanji_cg_jis[1] & 0x1f) + ((m_kanji_cg_jis[1] & 0x60) << 1)) * 0x20; - return m_kanjiram[pcg_addr + (m_kanji_cg_line << 1) + (m_kanji_cg_lr ^ 1)]; + return m_kanji_ram[pcg_addr + (m_kanji_cg_line << 1) + (m_kanji_cg_lr ^ 1)]; } const u32 kanji_address = calc_kanji_rom_addr(m_kanji_cg_jis[0] + 0x20, m_kanji_cg_jis[1], 0, 0); @@ -1652,3 +1744,157 @@ void pc88va_state::text_control_1_w(u8 data) if ((data & 0x7d) != 1) LOG("I/O $148 write %02x\n", data); } + + +/**************************************** + * GVRAM + ***************************************/ + +u8 pc88va_state::rop_execute(u8 plane_rop, u8 src, u8 dst, u8 pat) +{ + u8 res = 0; + + for (int i = 0; i < 8; i++) + { + if (BIT(plane_rop, i)) + { + u8 src_data = BIT(i, 0) ? src : ~src; + u8 dst_data = BIT(i, 1) ? dst : ~dst; + u8 pat_data = BIT(i, 2) ? pat : ~pat; + res |= src_data & dst_data & pat_data; + } + } + return res; +} + +u8 pc88va_state::gvram_multiplane_r(offs_t offset) +{ + if (m_multiplane.aacc) + { + u32 address = (offset & 0x7fff) | (m_multiplane.gmap << 15); + u8 res = 0xff; + for (int plane = 0; plane < 4; plane++) + { + if (!BIT(m_multiplane.xrpm, plane)) + { + const u8 src = m_gvram[address | plane * 0x10000]; + // Comparison enable + if (m_multiplane.cmpen) + res &= ~(src ^ m_multiplane.cmpr[plane]); + else + res &= src; + + // update on reads + if (BIT(m_multiplane.pmod, 0) && !machine().side_effects_disabled()) + { + m_multiplane.patr[plane][BIT(m_multiplane.prwp, plane)] = src; + } + } + } + + // flip register write index on 16-bit mode + if ((m_multiplane.pmod & 5) == 5 && !machine().side_effects_disabled()) + { + m_multiplane.prwp ^= 0xf; + } + + return res; + } + + return m_gvram[offset]; +} + +void pc88va_state::gvram_multiplane_w(offs_t offset, u8 data) +{ + if (m_multiplane.aacc) + { + u32 address = (offset & 0x7fff) | (m_multiplane.gmap << 15); + for (int plane = 0; plane < 4; plane++) + { + if (!BIT(m_multiplane.xwpm, plane)) + { + switch(m_multiplane.wss & 3) + { + // ROP + case 0: + { + const u8 src = m_gvram[address | plane * 0x10000]; + m_gvram[address | plane * 0x10000] = rop_execute( + m_multiplane.rop[plane], + src, + data, + m_multiplane.patr[plane][BIT(m_multiplane.prrp, plane)] + ); + + // update pattern on writes + if (BIT(m_multiplane.pmod, 1)) + { + m_multiplane.patr[plane][BIT(m_multiplane.prwp, plane)] = src; + } + break; + } + // Pattern + case 1: + m_gvram[address | plane * 0x10000] = m_multiplane.patr[plane][BIT(m_multiplane.prrp, plane)]; + break; + // Normal writes + case 2: + m_gvram[address | plane * 0x10000] = data; + break; + // NOP + case 3: + break; + } + } + } + + // flip register indices on 16-bit mode + if (BIT(m_multiplane.pmod, 2)) + { + m_multiplane.prrp ^= 0xf; + if (BIT(m_multiplane.pmod, 1)) + m_multiplane.prwp ^= 0xf; + } + return; + } + + m_gvram[offset] = data; +} + +u8 pc88va_state::gvram_singleplane_r(offs_t offset) +{ + // apparently no side effects on reads + return m_gvram[offset]; +} + +void pc88va_state::gvram_singleplane_w(offs_t offset, u8 data) +{ + const u8 page_bank = BIT(offset, 17); + switch(m_singleplane.wss & 3) + { + // ROP + case 0: + { + const u8 src = m_gvram[offset]; + m_gvram[offset] = rop_execute( + m_singleplane.rop[page_bank], + src, + data, + m_singleplane.patr[page_bank] + ); + break; + } + // Pattern + case 1: + m_gvram[offset] = m_singleplane.patr[page_bank]; + break; + // Normal writes + case 2: + m_gvram[offset] = data; + break; + // NOP + case 3: + break; + } +} + diff --git a/src/mame/neogeo/neogeo.cpp b/src/mame/neogeo/neogeo.cpp index 1d48038753318..f3f93ffe06a39 100644 --- a/src/mame/neogeo/neogeo.cpp +++ b/src/mame/neogeo/neogeo.cpp @@ -3294,8 +3294,9 @@ ROM_START( ridhero ) /* MVS AND AES VERSION */ ROM_REGION( 0x100000, "cslot1:maincpu", ROMREGION_BE|ROMREGION_16BIT ) ROM_LOAD16_WORD_SWAP( "006-p1.p1", 0x000000, 0x080000, CRC(d4aaf597) SHA1(34d35b71adb5bd06f4f1b50ffd9c58ab9c440a84) ) /* MB834200 */ + // dumped from a prototype with external ROM, not 100% confirmed as being the same on a final, or other games (lbowling, trally) ROM_REGION( 0x2000, "mcu", 0 ) /* Hitachi HD6301V1 MCU */ - ROM_LOAD( "rhcom.bin", 0x0000, 0x2000, CRC(e5cd6306) SHA1(f6bbb8ae562804d67e137290c765c3589fa334c0) ) // dumped from a prototype with external ROM, not 100% confirmed as being the same on a final, or other games (lbowling, trally) + ROM_LOAD( "hd6301v1p_k78.com", 0x0000, 0x2000, CRC(e5cd6306) SHA1(f6bbb8ae562804d67e137290c765c3589fa334c0) ) NEO_SFIX_128K( "006-s1.s1", CRC(eb5189f0) SHA1(0239c342ea62e73140a2306052f226226461a478) ) /* TC531000 */ @@ -3323,8 +3324,9 @@ ROM_START( ridheroh ) ROM_LOAD16_WORD_SWAP( "006-pg1.p1", 0x000000, 0x080000, BAD_DUMP CRC(52445646) SHA1(647bb31f2f68453c1366cb6e2e867e37d1df7a54) ) /* Chip label p1h does not exist, renamed temporarily to pg1, marked BAD_DUMP. This needs to be verified. */ + // dumped from a prototype with external ROM, not 100% confirmed as being the same on a final, or other games (lbowling, trally) ROM_REGION( 0x2000, "mcu", 0 ) /* Hitachi HD6301V1 MCU */ - ROM_LOAD( "rhcom.bin", 0x0000, 0x2000, CRC(e5cd6306) SHA1(f6bbb8ae562804d67e137290c765c3589fa334c0) ) // dumped from a prototype with external ROM, not 100% confirmed as being the same on a final, or other games (lbowling, trally) + ROM_LOAD( "hd6301v1p_k78.com", 0x0000, 0x2000, CRC(e5cd6306) SHA1(f6bbb8ae562804d67e137290c765c3589fa334c0) ) NEO_SFIX_128K( "006-s1.s1", CRC(eb5189f0) SHA1(0239c342ea62e73140a2306052f226226461a478) ) /* TC531000 */ @@ -3822,7 +3824,7 @@ ROM_START( lbowling ) /* MVS AND AES VERSION */ ROM_LOAD16_WORD_SWAP( "019-p1.p1", 0x000000, 0x080000, CRC(a2de8445) SHA1(893d7ae72b4644123469de143fa35fac1cbcd61e) ) /* TC534200 */ ROM_REGION( 0x1000, "mcu", 0 ) /* Hitachi HD6301V1 MCU */ - ROM_LOAD( "hd6301v1p.com", 0x0000, 0x1000, NO_DUMP ) + ROM_LOAD( "hd6301v1p_k78.com", 0x0000, 0x1000, NO_DUMP ) NEO_SFIX_128K( "019-s1.s1", CRC(5fcdc0ed) SHA1(86415077e7adc3ba6153eeb4fb0c62cf36e903fa) ) /* TC531000 */ @@ -4485,7 +4487,7 @@ ROM_START( trally ) /* MVS AND AES VERSION */ ROM_LOAD16_WORD_SWAP( "038-p2.p2", 0x080000, 0x080000, CRC(a5193e2f) SHA1(96803480439e90da23cdca70d59ff519ee85beeb) ) /* TC534200 */ ROM_REGION( 0x1000, "mcu", 0 ) /* Hitachi HD6301V1 MCU */ - ROM_LOAD( "hd6301v1p.hd6301v1", 0x0000, 0x1000, NO_DUMP ) + ROM_LOAD( "hd6301v1p_m58_neo-coma", 0x0000, 0x1000, NO_DUMP ) NEO_SFIX_128K( "038-s1.s1", CRC(fff62ae3) SHA1(6510a762ea41557a8938cbfc0557cd5921306061) ) /* TC531000 */ @@ -4726,6 +4728,7 @@ ROM_START( aof ) /* MVS AND AES VERSION */ ROM_REGION( 0x400000, "cslot1:ymsnd:adpcma", 0 ) ROM_LOAD( "044-v2.v2", 0x000000, 0x200000, CRC(3ec632ea) SHA1(e3f413f580b57f70d2dae16dbdacb797884d3fce) ) /* TC5316200 */ ROM_LOAD( "044-v4.v4", 0x200000, 0x200000, CRC(4b0f8e23) SHA1(105da0cc5ba19869c7147fba8b177500758c232b) ) /* TC5316200 */ + /* Also found MVS set with different label: 044-v2.v1 and 044-v4.v2 */ ROM_REGION( 0x800000, "cslot1:sprites", 0 ) ROM_LOAD16_BYTE( "044-c1.c1", 0x000000, 0x100000, CRC(ddab98a7) SHA1(f20eb81ec431268798c142c482146c1545af1c24) ) /* Plane 0,1 */ /* TC5316200 */ @@ -4856,6 +4859,7 @@ ROM_END ID-0047 . NGM-047 NEO-MVS PROG-G2 (SNK-9201) / NEO-MVS CHA42G-1 + NEO-MVS PROG-G2 (SNK-9201) / NEO-MVS CHA42G-2 . NGH-047 NEO-AEG PROG-G2 (PRO-CT0) / NEO-AEG CHA42G-2B NEO-AEG PROG-G2 (PRO-CT0) / NEO-AEG CHA42G-2 @@ -4864,7 +4868,7 @@ ROM_END ROM_START( fatfury2 ) /* MVS AND AES VERSION */ ROM_REGION( 0x100000, "cslot1:maincpu", ROMREGION_BE|ROMREGION_16BIT ) ROM_LOAD16_WORD_SWAP( "047-p1.p1", 0x000000, 0x100000, CRC(ecfdbb69) SHA1(59e2f137c6eaf043df4ddae865a9159a10265c60) ) /* TC538200 */ - /* The original P1 is 8mbit; also found sets with P1 / P2 4mbit on eprom. */ + /* The original P1 is 8mbit; also found sets with EP1 / EP2 4mbit on eprom. */ NEO_SFIX_128K( "047-s1.s1", CRC(d7dbbf39) SHA1(29253e596f475ebd41a6e3bb53952e3a0ccd2eed) ) /* TC531000 */ @@ -5284,6 +5288,7 @@ ROM_START( fatfursp ) /* MVS AND AES VERSION */ ROM_REGION( 0x180000, "cslot1:maincpu", ROMREGION_BE|ROMREGION_16BIT ) ROM_LOAD16_WORD_SWAP( "058-p1.p1", 0x000000, 0x100000, CRC(2f585ba2) SHA1(429b4bf43fb9b1082c15d645ca328f9d175b976b) ) /* mask rom TC538200 */ ROM_LOAD16_WORD_SWAP( "058-p2.sp2", 0x100000, 0x080000, CRC(d7c71a6b) SHA1(b3428063031a2e5857da40a5d2ffa87fb550c1bb) ) /* mask rom TC534200 */ + /* also found MVS set with EP1 / EP2 / SP2 on eprom; correct chip label unknown */ NEO_SFIX_128K( "058-s1.s1", CRC(2df03197) SHA1(24083cfc97e720ac9e131c9fe37df57e27c49294) ) /* mask rom TC531000 */ @@ -5414,6 +5419,7 @@ ROM_END ID-0061 . NGM-061 NEO-MVS PROGGSC / NEO-MVS CHA256 + NEO-MVS PROGGSC / NEO-MVS CHA256B NEO-MVS PROGTOP / NEO-MVS CHA256 NEO-MVS PROG 4096 B / NEO-MVS CHA256 . NGH-061 @@ -6071,6 +6077,7 @@ ROM_END NEO-MVS PROGBK1 / NEO-MVS CHA256 NEO-MVS PROGTOP / NEO-MVS CHA256B NEO-MVS PROG 4096 B / NEO-MVS CHA 42G-3 + NEO-MVS PROGGSC / NEO-MVS CHA 42G-3B . NGH-082 NEO-AEG PROGTOP2 / NEO-AEG CHA256 B ****************************************/ @@ -7849,6 +7856,7 @@ ROM_END ID-0233 . NGM-2330 NEO-MVS PROGBK1 / NEO-MVS CHA256 + NEO-MVS PROGBK1 / NEO-MVS CHA256B . NGH-2330 NEO-AEG PROGBK1Y / NEO-AEG CHA256RY ****************************************/ diff --git a/src/mame/nmk/nmk16.cpp b/src/mame/nmk/nmk16.cpp index c21ed311bf7f5..6ffdec810dfc4 100644 --- a/src/mame/nmk/nmk16.cpp +++ b/src/mame/nmk/nmk16.cpp @@ -1795,9 +1795,6 @@ static INPUT_PORTS_START( mustang ) PORT_DIPSETTING( 0xc000, "3" ) PORT_DIPSETTING( 0x8000, "4" ) PORT_DIPSETTING( 0x0000, "5" ) - - PORT_START("COIN") // referenced by Seibu sound board - PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN ) INPUT_PORTS_END static INPUT_PORTS_START( hachamf_prot ) @@ -2092,13 +2089,6 @@ static INPUT_PORTS_START( strahl ) PORT_SERVICE_DIPLOC( 0x80, IP_ACTIVE_LOW, "SW2:8" ) INPUT_PORTS_END -static INPUT_PORTS_START( strahljbl ) - PORT_INCLUDE(strahl) - - PORT_START("COIN") // referenced by Seibu sound board - PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN ) -INPUT_PORTS_END - static INPUT_PORTS_START( acrobatm ) PORT_START("IN0") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) @@ -2205,9 +2195,6 @@ static INPUT_PORTS_START( acrobatmbl ) PORT_DIPSETTING( 0x6000, DEF_STR( 1C_2C ) ) PORT_DIPSETTING( 0xa000, DEF_STR( 1C_3C ) ) PORT_DIPSETTING( 0x2000, DEF_STR( 1C_4C ) ) - - PORT_START("COIN") // referenced by Seibu sound board - PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN ) INPUT_PORTS_END static INPUT_PORTS_START( bioship ) @@ -2471,9 +2458,6 @@ static INPUT_PORTS_START( tdragonb ) PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW2:8") // The manual states this dip is "Unused" PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - - PORT_START("COIN") // referenced by Seibu sound board - PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN ) INPUT_PORTS_END static INPUT_PORTS_START( tdragonb2 ) @@ -4669,8 +4653,9 @@ void nmk16_state::mustangb(machine_config &config) seibu_sound_device &seibu_sound(SEIBU_SOUND(config, "seibu_sound", 0)); seibu_sound.int_callback().set_inputline(m_audiocpu, 0); + seibu_sound.coin_io_callback().set_constant(0xff); // unused seibu_sound.set_rom_tag("audiocpu"); - seibu_sound.set_rombank_tag("seibu_bank1"); + seibu_sound.set_rombank_tag("seibu_bank"); seibu_sound.ym_read_callback().set("ymsnd", FUNC(ym3812_device::read)); seibu_sound.ym_write_callback().set("ymsnd", FUNC(ym3812_device::write)); } @@ -4888,8 +4873,9 @@ void nmk16_state::acrobatmbl(machine_config &config) seibu_sound_device &seibu_sound(SEIBU_SOUND(config, "seibu_sound", 0)); seibu_sound.int_callback().set_inputline(m_audiocpu, 0); + seibu_sound.coin_io_callback().set_constant(0xff); // unused seibu_sound.set_rom_tag("audiocpu"); - seibu_sound.set_rombank_tag("seibu_bank1"); + seibu_sound.set_rombank_tag("seibu_bank"); seibu_sound.ym_read_callback().set("ymsnd", FUNC(ym3812_device::read)); seibu_sound.ym_write_callback().set("ymsnd", FUNC(ym3812_device::write)); } @@ -4925,8 +4911,9 @@ void nmk16_state::tdragonb(machine_config &config) // bootleg using Raiden so seibu_sound_device &seibu_sound(SEIBU_SOUND(config, "seibu_sound", 0)); seibu_sound.int_callback().set_inputline(m_audiocpu, 0); + seibu_sound.coin_io_callback().set_constant(0xff); // unused seibu_sound.set_rom_tag("audiocpu"); - seibu_sound.set_rombank_tag("seibu_bank1"); + seibu_sound.set_rombank_tag("seibu_bank"); seibu_sound.ym_read_callback().set("ymsnd", FUNC(ym3812_device::read)); seibu_sound.ym_write_callback().set("ymsnd", FUNC(ym3812_device::write)); } @@ -5201,8 +5188,9 @@ void nmk16_state::strahljbl(machine_config &config) seibu_sound_device &seibu_sound(SEIBU_SOUND(config, "seibu_sound", 0)); seibu_sound.int_callback().set_inputline(m_audiocpu, 0); + seibu_sound.coin_io_callback().set_constant(0xff); // unused seibu_sound.set_rom_tag("audiocpu"); - seibu_sound.set_rombank_tag("seibu_bank1"); + seibu_sound.set_rombank_tag("seibu_bank"); seibu_sound.ym_read_callback().set("ymsnd", FUNC(ym3812_device::read)); seibu_sound.ym_write_callback().set("ymsnd", FUNC(ym3812_device::write)); } @@ -10616,7 +10604,7 @@ GAME( 1993, powerinspu, powerins, powerins, powerinj, nmk16_state, GAME( 1993, powerinspj, powerins, powerins, powerinj, nmk16_state, empty_init, ROT0, "Atlus", "Gouketsuji Ichizoku (Japan, prototype)", MACHINE_SUPPORTS_SAVE ) // boots as 93.10.20 just like the other sets, but code is different GAME( 1993, powerinsa, powerins, powerinsa, powerins, nmk16_state, init_powerinsa, ROT0, "bootleg", "Power Instinct (USA, bootleg set 1)", MACHINE_SUPPORTS_SAVE ) GAME( 1993, powerinsb, powerins, powerinsb, powerins, nmk16_state, empty_init, ROT0, "bootleg", "Power Instinct (USA, bootleg set 2)", MACHINE_SUPPORTS_SAVE ) -GAME( 1993, powerinsc, powerins, powerinsc, powerins, nmk16_state, empty_init, ROT0, "bootleg", "Power Instinct (USA, bootleg set 3)", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) // different sprites' format not implemented +GAME( 1993, powerinsc, powerins, powerinsc, powerins, nmk16_state, empty_init, ROT0, "bootleg (Electronic Devices)", "Power Instinct (USA, bootleg set 3)", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) // different sprites' format not implemented // Non NMK boards @@ -10632,7 +10620,7 @@ GAME( 1990, mustangb2, mustang, mustangb, mustang, nmk16_state, empty GAME( 1991, acrobatmbl, acrobatm, acrobatmbl, acrobatmbl, nmk16_state, init_acrobatmbl, ROT270, "bootleg", "Acrobat Mission (bootleg with Raiden sounds)", 0 ) GAME( 1991, tdragonb, tdragon, tdragonb, tdragonb, nmk16_state, init_tdragonb, ROT270, "bootleg", "Thunder Dragon (bootleg with Raiden sounds, encrypted)", 0 ) GAME( 1991, tdragonb3, tdragon, tdragonb3, tdragonb, nmk16_state, empty_init, ROT270, "bootleg", "Thunder Dragon (bootleg with Raiden sounds, unencrypted)", 0 ) -GAME( 1992, strahljbl, strahl, strahljbl, strahljbl, nmk16_state, empty_init, ROT0, "bootleg", "Koutetsu Yousai Strahl (Japan, bootleg)", 0 ) +GAME( 1992, strahljbl, strahl, strahljbl, strahl, nmk16_state, empty_init, ROT0, "bootleg", "Koutetsu Yousai Strahl (Japan, bootleg)", 0 ) // these are bootlegs with tharrier like sound hw GAME( 1990, mustangb3, mustang, mustangb3, mustang, nmk16_state, empty_init, ROT0, "bootleg (Lettering)", "US AAF Mustang (Lettering bootleg)", 0 ) diff --git a/src/mame/novag/cnchess.cpp b/src/mame/novag/cnchess.cpp index d4b6ac00ff7e8..80f64c50b1cad 100644 --- a/src/mame/novag/cnchess.cpp +++ b/src/mame/novag/cnchess.cpp @@ -89,15 +89,11 @@ void cnchess_state::machine_start() void cnchess_state::init_board(u8 data) { // 1st row - m_board->write_piece(0, 0, 3); - m_board->write_piece(0, 8, 3); - m_board->write_piece(0, 1, 4); - m_board->write_piece(0, 7, 4); - m_board->write_piece(0, 2, 5); - m_board->write_piece(0, 6, 5); - m_board->write_piece(0, 3, 6); - m_board->write_piece(0, 5, 6); - m_board->write_piece(0, 4, 7); + for (int i = 0; i < 5; i++) + { + m_board->write_piece(0, i, 3 + i); + m_board->write_piece(0, 8 - i, 3 + i); + } // cannons m_board->write_piece(2, 1, 2); diff --git a/src/mame/oberheim/xpander.cpp b/src/mame/oberheim/xpander.cpp index f5b21a97967a0..13c7eca42dbe8 100644 --- a/src/mame/oberheim/xpander.cpp +++ b/src/mame/oberheim/xpander.cpp @@ -57,6 +57,7 @@ intended as an educational tool. There is no attempt to emulate audio. */ #include "emu.h" + #include "bus/midi/midi.h" #include "cpu/m6809/m6809.h" #include "machine/6850acia.h" @@ -69,6 +70,9 @@ intended as an educational tool. There is no attempt to emulate audio. #include "machine/timer.h" #include "video/pwm.h" +#include +#include + #include "oberheim_xpander.lh" #define LOG_CV_IN (1U << 1) @@ -94,7 +98,6 @@ constexpr const char NVRAM_A_TAG[] = "nvram_a"; constexpr const char NVRAM_B_TAG[] = "nvram_b"; constexpr const char VOICERAM_TAG[] = "voiceram"; -constexpr const int NUM_ENCODERS = 6; constexpr const int NUM_ENCODER_POSITIONS = 30; class xpander_state : public driver_device @@ -114,33 +117,26 @@ class xpander_state : public driver_device , m_cv_io(*this, "cv_in_%d", 1U) , m_pedal_io(*this, "pedal_%d", 1U) , m_vfd_devices(*this, "vfd_%d", 0U) - , m_vfd_outputs() + , m_vfd_outputs(*this, "vfd_%u_char_%u", 1U, 1U) , m_cassmute(*this, "cassmute") , m_voicecpu(*this, VOICECPU_TAG) , m_voicepit(*this, "voice_pit_8253") , m_voiceram(*this, VOICERAM_TAG) - , m_fm_mdac(*this, "voice_%d_fm_mdac", 1U) - , m_filter_mode(*this, "voice_%d_filter_mode", 1U) - , m_noise(*this, "voice_%d_noise", 1U) - , m_pan(*this, "voice_%d_pan", 1U) - , m_saw1(*this, "voice_%d_saw1", 1U) - , m_saw2(*this, "voice_%d_saw2", 1U) - , m_tri1(*this, "voice_%d_tri1", 1U) - , m_tri2(*this, "voice_%d_tri2", 1U) - , m_vcofm(*this, "voice_%d_vcofm", 1U) - , m_sync(*this, "voice_%d_sync", 1U) - , m_haltreq(4, false) - , m_encoder_dir(NUM_ENCODERS, false) - , m_encoder_changed(NUM_ENCODERS, false) - , m_vfd_anode_masks(3, 0) - , m_cv(NUM_VOICES, std::vector(NUM_CVS, -1)) - , m_fast(NUM_VOICES, std::vector(NUM_CVS - 1, false)) // `-1` because RES does not support fast updates. + , m_fm_mdac(*this, "voice_%u_fm_mdac", 1U) + , m_filter_mode(*this, "voice_%u_filter_mode", 1U) + , m_noise(*this, "voice_%u_noise", 1U) + , m_pan(*this, "voice_%u_pan", 1U) + , m_saw1(*this, "voice_%u_saw1", 1U) + , m_saw2(*this, "voice_%u_saw2", 1U) + , m_tri1(*this, "voice_%u_tri1", 1U) + , m_tri2(*this, "voice_%u_tri2", 1U) + , m_vcofm(*this, "voice_%u_vcofm", 1U) + , m_sync(*this, "voice_%u_sync", 1U) { - for (int i = 0; i < m_vfd_devices.size(); ++i) - { - std::string format = "vfd_" + std::to_string(i + 1) + "_char_%d"; - m_vfd_outputs.push_back(output_finder<40>(*this, std::move(format), 1U)); - } + for (auto &cv : m_cv) + std::fill(cv.begin(), cv.end(), 0.0F); + for (auto &fast : m_fast) + std::fill(fast.begin(), fast.end(), false); } void xpander(machine_config &config) ATTR_COLD; @@ -214,7 +210,7 @@ class xpander_state : public driver_device required_ioport_array<6> m_cv_io; required_ioport_array<2> m_pedal_io; required_device_array m_vfd_devices; - std::vector> m_vfd_outputs; + output_finder<3, 40> m_vfd_outputs; output_finder<> m_cassmute; // Voice computer. @@ -240,10 +236,10 @@ class xpander_state : public driver_device u8 m_firq_timer_preset = 0xff; // Preset for 40103 timer. Pulled high. u8 m_selected_cv_in = 0x07; // MUX A-C inputs. Pulled high. bool m_inhibit_cv_in = true; // MUX INHibit input. Pulled high. - std::vector m_haltreq; // Halt request to the voice board (HALTREQ). - std::vector m_encoder_dir; - std::vector m_encoder_changed; - std::vector m_vfd_anode_masks; + std::array m_haltreq = { false, false, false, false }; // Halt request to the voice board (HALTREQ). + std::array m_encoder_dir = { false, false, false, false, false, false }; + std::array m_encoder_changed = { false, false, false, false, false, false }; + std::array m_vfd_anode_masks = { 0, 0, 0 }; // Voice computer state. bool m_haltdis = 0; // Halt disable (HALTDS). @@ -253,8 +249,8 @@ class xpander_state : public driver_device float m_dac_fine_v = 0; float m_dac_vref = 4.865F; // Sampled in C806 and buffered and scaled by U815. bool m_allow_fast = false; - std::vector> m_cv; - std::vector> m_fast; + std::array, NUM_VOICES> m_cv; + std::array, NUM_VOICES> m_fast; // `-1` because RES does not support fast updates. }; TIMER_DEVICE_CALLBACK_MEMBER(xpander_state::firq_timer_elapsed) @@ -344,11 +340,10 @@ u8 xpander_state::switch_r(offs_t offset) return data; } -static u8 byte_from_vector(const std::vector &v) +static u8 byte_from_array(const std::array &v) { - assert(v.size() <= 8); u8 data = 0; - for (int i = 0; i < v.size(); ++i) + for (int i = 0; i < 6; ++i) if (v[i]) data |= 1U << i; return data; @@ -358,17 +353,16 @@ u8 xpander_state::encoder_dir_r() { // The DIR* signal also resets encoder change detection flip-flops when // active (low). - for (int i = 0; i < m_encoder_changed.size(); ++i) - m_encoder_changed[i] = false; + std::fill(m_encoder_changed.begin(), m_encoder_changed.end(), false); - const u8 data = byte_from_vector(m_encoder_dir); + const u8 data = byte_from_array(m_encoder_dir); LOGMASKED(LOG_ENCODERS, "Encoder dir_r: %02x\n", data); return data; } u8 xpander_state::encoder_sw_r() { - const u8 data = byte_from_vector(m_encoder_changed); + const u8 data = byte_from_array(m_encoder_changed); if (data != 0) LOGMASKED(LOG_ENCODERS, "Encoder sw_r: %02x\n", data); return data; @@ -624,7 +618,7 @@ void xpander_state::voice_dac_enable_w(offs_t offset, u8 data) // Generated by D805, R856, R857, R854, U815. static constexpr const float V_REF_U815 = 4; static constexpr const float DEFAULT_UNSCALED_VREF = - V_REF_U815 * RES_VOLTAGE_DIVIDER(RES_K(18.2), RES_K(10)); + V_REF_U815 * RES_VOLTAGE_DIVIDER(RES_K(18.2), RES_K(10)); static constexpr const float VREF_SCALER = 1 + RES_K(2.43) / RES_K(1); // U815, R851, R852. static constexpr const float DEFAULT_VREF = DEFAULT_UNSCALED_VREF * VREF_SCALER; static constexpr const float CEM3374_NOMINAL_TEMPCO_V = 2.5; @@ -723,7 +717,7 @@ void xpander_state::voice_dac_clear_w(u8 data) m_dac_data = ((data & LOW7_MASK) << 7) | (m_dac_data & LOW7_MASK); m_allow_fast = BIT(data, 7); LOGMASKED(LOG_DAC_VERBOSE, "DAC clear %02x: %04x - %d\n", - data, m_dac_data, m_allow_fast); + data, m_dac_data, m_allow_fast); } void xpander_state::voice_dac_w(offs_t offset, u8 data) @@ -835,9 +829,7 @@ void xpander_state::machine_start() firq_timer_elapsed(*m_firq_timer, m_firq_timer_preset); // Reset the timer. m_cassmute.resolve(); - for (output_finder<40> &vfd_char_output : m_vfd_outputs) - vfd_char_output.resolve(); - + m_vfd_outputs.resolve(); m_fm_mdac.resolve(); m_filter_mode.resolve(); m_noise.resolve(); @@ -848,6 +840,23 @@ void xpander_state::machine_start() m_tri2.resolve(); m_vcofm.resolve(); m_sync.resolve(); + + save_item(NAME(m_firq_timer_preset)); + save_item(NAME(m_selected_cv_in)); + save_item(NAME(m_inhibit_cv_in)); + save_item(NAME(m_haltreq)); + save_item(NAME(m_encoder_dir)); + save_item(NAME(m_encoder_changed)); + save_item(NAME(m_vfd_anode_masks)); + save_item(NAME(m_haltdis)); + save_item(NAME(m_haltack)); + save_item(NAME(m_autodone)); + save_item(NAME(m_dac_data)); + save_item(NAME(m_dac_fine_v)); + save_item(NAME(m_dac_vref)); + save_item(NAME(m_allow_fast)); + save_item(NAME(m_cv)); + save_item(NAME(m_fast)); } void xpander_state::xpander(machine_config &config) @@ -881,7 +890,7 @@ void xpander_state::xpander(machine_config &config) { PWM_DISPLAY(config, m_vfd_devices[i]).set_size(40, 16); // 40 x 16-segment display. m_vfd_devices[i]->set_segmask(0xffffffffff, 0xffff); - m_vfd_devices[i]->output_digit().set([this, i](offs_t offset, u32 data) { display_output_w(i, offset, data); }); + m_vfd_devices[i]->output_digit().set([this, i] (offs_t offset, u32 data) { display_output_w(i, offset, data); }); } config.set_default_layout(layout_oberheim_xpander); @@ -951,7 +960,7 @@ DECLARE_INPUT_CHANGED_MEMBER(xpander_state::encoder_moved) m_encoder_dir[encoder] = ((newval > oldval) || overflowed) && !underflowed; LOGMASKED(LOG_ENCODERS, "Encoder %d changed from: %d to: %d (o: %d, u: %d), dir: %d\n", - encoder, oldval, newval, overflowed, underflowed, bool(m_encoder_dir[encoder])); + encoder, oldval, newval, overflowed, underflowed, m_encoder_dir[encoder]); } DECLARE_INPUT_CHANGED_MEMBER(xpander_state::memory_protect_changed) @@ -1144,4 +1153,4 @@ ROM_END } // anonymous namespace // In production from 1984 to 1988. -SYST(1984, xpander, 0, 0, xpander, xpander, xpander_state, empty_init, "Oberheim", "Xpander", MACHINE_NOT_WORKING | MACHINE_NO_SOUND) +SYST(1984, xpander, 0, 0, xpander, xpander, xpander_state, empty_init, "Oberheim", "Xpander", MACHINE_SUPPORTS_SAVE | MACHINE_NOT_WORKING | MACHINE_NO_SOUND) diff --git a/src/mame/paia/fatman.cpp b/src/mame/paia/fatman.cpp index c76ea2edbdf7a..91adaa1ef7846 100644 --- a/src/mame/paia/fatman.cpp +++ b/src/mame/paia/fatman.cpp @@ -51,13 +51,15 @@ until a restart or reset (F3). */ #include "emu.h" -#include "attotime.h" + #include "cpu/mcs51/mcs51.h" #include "bus/midi/midiinport.h" #include "bus/midi/midioutport.h" #include "machine/rescap.h" #include "video/pwm.h" +#include "attotime.h" + #include "paia_fatman.lh" #define LOG_EG (1U << 1) diff --git a/src/mame/paia/midi2cv8.cpp b/src/mame/paia/midi2cv8.cpp index 28d459ae698d6..4c049cab9e4fd 100644 --- a/src/mame/paia/midi2cv8.cpp +++ b/src/mame/paia/midi2cv8.cpp @@ -6,7 +6,7 @@ The PAiA midi2cv8 is an 8-channel MIDI-to-CV converter. It is a module for the PAiA 9700 Series modular system, but can be used as a standalone MIDI-to-CV converter. -Dipswitches control the MIDI channel to listen to, and the operating mode. +DIP switches control the MIDI channel to listen to, and the operating mode. Depending on that mode, each of the 8 outputs produces control voltage (CV), trigger, or gate signals in response to MIDI messages. @@ -393,4 +393,3 @@ ROM_END SYST(1997, midi2cv8, 0, 0, midi2cv8, midi2cv8, midi2cv8_state, empty_init, "PAiA Electronics", "midi2cv8", MACHINE_NO_SOUND_HW | MACHINE_SUPPORTS_SAVE) SYST(1997, midi2cv8_vhz, 0, 0, midi2cv8_vhz, midi2cv8, midi2cv8_vhz_state, empty_init, "PAiA Electronics", "midi2cv8 V/Hz", MACHINE_NO_SOUND_HW | MACHINE_SUPPORTS_SAVE) - diff --git a/src/mame/pc/przone.cpp b/src/mame/pc/przone.cpp index dd3ac214fd881..20a8652c5da6e 100644 --- a/src/mame/pc/przone.cpp +++ b/src/mame/pc/przone.cpp @@ -1,11 +1,12 @@ // license:BSD-3-Clause // copyright-holders: Angelo Salese +// thanks-to: vidpro1 /************************************************************************************************** Prize Zone (c) 199? Lazer-Tron TODO: -- identify proper motherboard/BIOS; +- hookup proper motherboard type, MSI MS-5169 with ALADDiN V ATX chipset (ALi M1541 / M1543C); - hookup vibra16 ISA card in place of sblaster_16; - Printer error B0 keeps popping in attract/game select (disable in service mode as workaround); - Trackball in place of PS/2 mouse (doesn't seem to use serial); @@ -247,7 +248,7 @@ void przone_state::smc_superio_config(device_t *device) void przone_state::przone(machine_config &config) { - // unknown CPU, lowered to PCI clock for ViRGE being really the bottleneck here. + // Socket 7 CPU, lowered to PCI clock for ViRGE being really the bottleneck here. pentium_device &maincpu(PENTIUM(config, "maincpu", 33'333'333)); maincpu.set_addrmap(AS_PROGRAM, &przone_state::main_map); maincpu.set_addrmap(AS_IO, &przone_state::main_io); @@ -255,7 +256,7 @@ void przone_state::przone(machine_config &config) maincpu.smiact().set("pci:00.0", FUNC(i82439hx_host_device::smi_act_w)); PCI_ROOT(config, "pci", 0); - // TODO: confirm size + // 256MB on vidpro1's board, may ship with less RAM I82439HX(config, "pci:00.0", 0, "maincpu", 256*1024*1024); i82371sb_isa_device &isa(I82371SB_ISA(config, "pci:07.0", 0, "maincpu")); @@ -272,6 +273,7 @@ void przone_state::przone(machine_config &config) PCI_SLOT(config, "pci:1", pci_cards, 15, 0, 1, 2, 3, nullptr); PCI_SLOT(config, "pci:2", pci_cards, 16, 1, 2, 3, 0, nullptr); PCI_SLOT(config, "pci:3", pci_cards, 17, 2, 3, 0, 1, nullptr); + // TODO: has a stroke with virgevx PCI_SLOT(config, "pci:4", pci_cards, 18, 3, 0, 1, 2, "virge"); ISA16_SLOT(config, "board4", 0, "pci:07.0:isabus", isa_internal_devices, "fdc37c93x", true).set_option_machine_config("fdc37c93x", smc_superio_config); diff --git a/src/mame/pc/sis630.cpp b/src/mame/pc/sis630.cpp index f1b75fe05249c..5977298e454de 100644 --- a/src/mame/pc/sis630.cpp +++ b/src/mame/pc/sis630.cpp @@ -151,6 +151,24 @@ Notes on possible shutms11 BIOS bugs: 80000000 00000000 00000000 B8BA1941 00038881 C0000000 00000000 00000000 B8BA1941 00038881 + + The JAMMA adaptor is a small external PCB from Azkoyen with an MCU (unknown type): + _______________ _______ + ____--__-- _______________| DB-25 |________| DB-9 |_____ + | |__||__| <-Jacks |______________| |______| | + | _________ ___ | + ||o o o o |<-Power ________________ | | | + | | MCU | | <-MAX232N + | |_______________| |__| | + | _________ Xtal | + | |DIPS x 8| 6 MHz | + | | + | Test sw->(o) _________ _________ _________ | + | Service sw->(o) SN74HC245N SN74HC245N SN74HC245N | + |_________ ___________| + |_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_| + JAMMA + **************************************************************************************************/ #include "emu.h" @@ -400,9 +418,8 @@ ROM_START(zidav630e) // ROMX_LOAD( "V630e104.bin", 0x040000, 0x040000, CRC(?) SHA1(?), ROM_BIOS(1) ) ROM_END -/* - * Arcade based GameCristal - */ + +// GameCristal - PC-based multigame arcade (with an unknown emulator). ROM_START(gamecstl) ROM_REGION32_LE(0x80000, "flash", ROMREGION_ERASEFF ) @@ -412,6 +429,9 @@ ROM_START(gamecstl) DISK_REGION( "pci:00.1:ide1:0:hdd" ) DISK_IMAGE( "gamecstl", 0, SHA1(b431af3c42c48ba07972d77a3d24e60ee1e4359e) ) + + ROM_REGION( 0x2000, "mcu", 0 ) + ROM_LOAD( "gamecristal_datasat.bin", 0x0000, 0x2000, NO_DUMP ) // MCU on the JAMMA interface PCB, unknown type and ROM size ROM_END ROM_START(gamecst2) @@ -421,15 +441,18 @@ ROM_START(gamecst2) DISK_REGION( "pci:00.1:ide1:0:hdd" ) DISK_IMAGE( "gamecst2", 0, SHA1(14e1b311cb474801c7bdda3164a0c220fb102159) ) + + ROM_REGION( 0x2000, "mcu", 0 ) + ROM_LOAD( "gamecristal_datasat.bin", 0x0000, 0x2000, NO_DUMP ) // MCU on the JAMMA interface PCB, unknown type and ROM size ROM_END } // anonymous namespace -COMP( 2000, shutms11, 0, 0, sis630, sis630, sis630_state, empty_init, "Shuttle", "MS11 PC (SiS630 chipset)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) -COMP( 2001, asuspolo, 0, 0, asuspolo, sis630, sis630_state, empty_init, "Asus", "Polo \"Genie\" (SiS630 chipset)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // hangs at CMOS check first time, corrupts flash ROM on successive boots -COMP( 2001, asuscusc, 0, 0, asuscusc, sis630, sis630_state, empty_init, "Asus", "Terminator P-3 \"Cusc\" (SiS630 chipset)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // fails CMOS test, does crc with I/O accesses at $c00 -COMP( 2001, zidav630e, 0, 0, zidav630e,sis630, sis630_state, empty_init, "Zida", "V630E Baby AT (SiS630 chipset)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // Flash ROM corrupts often, otherwise same-y as shutms11 +COMP( 2000, shutms11, 0, 0, sis630, sis630, sis630_state, empty_init, "Shuttle", "MS11 PC (SiS630 chipset)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) +COMP( 2001, asuspolo, 0, 0, asuspolo, sis630, sis630_state, empty_init, "Asus", "Polo \"Genie\" (SiS630 chipset)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // hangs at CMOS check first time, corrupts flash ROM on successive boots +COMP( 2001, asuscusc, 0, 0, asuscusc, sis630, sis630_state, empty_init, "Asus", "Terminator P-3 \"Cusc\" (SiS630 chipset)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // fails CMOS test, does crc with I/O accesses at $c00 +COMP( 2001, zidav630e, 0, 0, zidav630e,sis630, sis630_state, empty_init, "Zida", "V630E Baby AT (SiS630 chipset)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // Flash ROM corrupts often, otherwise same-y as shutms11 // Arcade based games diff --git a/src/mame/philips/mcd212.cpp b/src/mame/philips/mcd212.cpp index e5e69f862649b..275e50497dcd4 100644 --- a/src/mame/philips/mcd212.cpp +++ b/src/mame/philips/mcd212.cpp @@ -42,175 +42,101 @@ // device type definition DEFINE_DEVICE_TYPE(MCD212, mcd212_device, "mcd212", "MCD212 VDSC") -inline ATTR_FORCE_INLINE uint8_t mcd212_device::get_weight_factor(const uint32_t region_idx) +inline ATTR_FORCE_INLINE uint8_t mcd212_device::get_weight_factor(const uint32_t matte_idx) { - return (uint8_t)((m_region_control[region_idx] & RC_WF) >> RC_WF_SHIFT); + return (uint8_t)((m_matte_control[matte_idx] & MC_WF) >> MC_WF_SHIFT); } -inline ATTR_FORCE_INLINE uint8_t mcd212_device::get_region_op(const uint32_t region_idx) +inline ATTR_FORCE_INLINE uint8_t mcd212_device::get_matte_op(const uint32_t matte_idx) { - return (m_region_control[region_idx] & RC_OP) >> RC_OP_SHIFT; + return (m_matte_control[matte_idx] & MC_OP) >> MC_OP_SHIFT; } -void mcd212_device::update_region_arrays() +void mcd212_device::update_matte_arrays() { - bool latched_rf[2]{ false, false }; + bool latched_mf[2]{ false, false }; uint8_t latched_wfa = m_weight_factor[0][0]; uint8_t latched_wfb = m_weight_factor[1][0]; const int width = get_screen_width(); - if (BIT(m_image_coding_method, ICM_NR_BIT)) - { - if (get_region_op(0) == 0 && get_region_op(4) == 0) - { - std::fill_n(m_weight_factor[0], std::size(m_weight_factor[0]), latched_wfa); - std::fill_n(m_weight_factor[1], std::size(m_weight_factor[1]), latched_wfb); - std::fill_n(m_region_flag[0], std::size(m_region_flag[0]), false); - std::fill_n(m_region_flag[1], std::size(m_region_flag[1]), false); - return; - } + const int num_mattes = BIT(m_image_coding_method, ICM_NM_BIT) ? 2 : 1; + const bool matte_flag = BIT(m_matte_control[0], MC_MF_BIT); // MF bit must be the same. See 5.10.2 Matte Commands - for (int x = 0; x < width; x++) + int matte_idx[2] = { 0, 4 }; + int x = 0; + for (; x < width; x++) + { + for (int matte = 0; matte < num_mattes; matte++) { - for (int flag = 0; flag < 2; flag++) + const int max_matte_id = ((num_mattes == 2) ? 4 : 8) + (matte ? 4 : 0); + if (matte_idx[matte] >= max_matte_id) { - for (int region = 0; region < 4; region++) - { - const int region_idx = (flag << 2) + region; - const uint32_t region_ctrl = m_region_control[region_idx]; - const uint32_t region_op = get_region_op(region_idx); - if (region_op == 0) - { - break; - } - if (x == (region_ctrl & RC_X)) - { - switch (region_op) - { - case 0: // End of region control for line - break; - case 1: - case 2: - case 3: // Not used - break; - case 4: // Change weight of plane A - latched_wfa = get_weight_factor(region_idx); - break; - case 5: // Not used - break; - case 6: // Change weight of plane B - latched_wfb = get_weight_factor(region_idx); - break; - case 7: // Not used - break; - case 8: // Reset region flag - latched_rf[flag] = false; - break; - case 9: // Set region flag - latched_rf[flag] = true; - break; - case 10: // Not used - case 11: // Not used - break; - case 12: // Reset region flag and change weight of plane A - latched_wfa = get_weight_factor(region_idx); - latched_rf[flag] = false; - break; - case 13: // Set region flag and change weight of plane A - latched_wfa = get_weight_factor(region_idx); - latched_rf[flag] = true; - break; - case 14: // Reset region flag and change weight of plane B - latched_wfb = get_weight_factor(region_idx); - latched_rf[flag] = false; - break; - case 15: // Set region flag and change weight of plane B - latched_wfb = get_weight_factor(region_idx); - latched_rf[flag] = true; - break; - } - } - } + continue; } - m_weight_factor[0][x] = latched_wfa; - m_weight_factor[1][x] = latched_wfb; - m_region_flag[0][x] = latched_rf[0]; - m_region_flag[1][x] = latched_rf[1]; - } - } - else - { - int region_idx = 0; - for (int x = 0; x < width; x++) - { - if (region_idx < 8) + const uint32_t matte_ctrl = m_matte_control[matte_idx[matte]]; + const uint32_t matte_op = get_matte_op(matte_idx[matte]); + const int flag = (num_mattes == 2) ? matte : matte_flag; + + if (x == (matte_ctrl & MC_X)) { - const int flag = BIT(m_region_control[region_idx], RC_RF_BIT); - const uint32_t region_ctrl = m_region_control[region_idx]; - const uint32_t region_op = get_region_op(region_idx); - if (region_op == 0) - { - std::fill_n(m_weight_factor[0] + x, std::size(m_weight_factor[0]) - x, latched_wfa); - std::fill_n(m_weight_factor[1] + x, std::size(m_weight_factor[1]) - x, latched_wfb); - std::fill_n(m_region_flag[0] + x, std::size(m_region_flag[0]) - x, latched_rf[0]); - std::fill_n(m_region_flag[1] + x, std::size(m_region_flag[1]) - x, latched_rf[1]); - return; - } - if (x == (region_ctrl & RC_X)) + switch (matte_op) { - switch (region_op) - { - case 0: // End of region control for line - break; - case 1: - case 2: - case 3: // Not used - break; - case 4: // Change weight of plane A - latched_wfa = get_weight_factor(region_idx); - break; - case 5: // Not used - break; - case 6: // Change weight of plane B - latched_wfb = get_weight_factor(region_idx); - break; - case 7: // Not used - break; - case 8: // Reset region flag - latched_rf[flag] = false; - break; - case 9: // Set region flag - latched_rf[flag] = true; - break; - case 10: // Not used - case 11: // Not used - break; - case 12: // Reset region flag and change weight of plane A - latched_wfa = get_weight_factor(region_idx); - latched_rf[flag] = false; - break; - case 13: // Set region flag and change weight of plane A - latched_wfa = get_weight_factor(region_idx); - latched_rf[flag] = true; - break; - case 14: // Reset region flag and change weight of plane B - latched_wfb = get_weight_factor(region_idx); - latched_rf[flag] = false; - break; - case 15: // Set region flag and change weight of plane B - latched_wfb = get_weight_factor(region_idx); - latched_rf[flag] = true; - break; - } - region_idx++; + case 0: // Disregard all commands in higher registers. See 5.10.2 + matte_idx[matte] = max_matte_id; + break; + case 1: + case 2: + case 3: // Not used + break; + case 4: // Change weight of plane A + latched_wfa = get_weight_factor(matte_idx[matte]); + break; + case 5: // Not used + break; + case 6: // Change weight of plane B + latched_wfb = get_weight_factor(matte_idx[matte]); + break; + case 7: // Not used + break; + case 8: // Reset matte flag + latched_mf[flag] = false; + break; + case 9: // Set matte flag + latched_mf[flag] = true; + break; + case 10: // Not used + case 11: // Not used + break; + case 12: // Reset matte flag and change weight of plane A + latched_wfa = get_weight_factor(matte_idx[matte]); + latched_mf[flag] = false; + break; + case 13: // Set matte flag and change weight of plane A + latched_wfa = get_weight_factor(matte_idx[matte]); + latched_mf[flag] = true; + break; + case 14: // Reset matte flag and change weight of plane B + latched_wfb = get_weight_factor(matte_idx[matte]); + latched_mf[flag] = false; + break; + case 15: // Set matte flag and change weight of plane B + latched_wfb = get_weight_factor(matte_idx[matte]); + latched_mf[flag] = true; + break; } + matte_idx[matte]++; } - m_weight_factor[0][x] = latched_wfa; - m_weight_factor[1][x] = latched_wfb; - m_region_flag[0][x] = latched_rf[0]; - m_region_flag[1][x] = latched_rf[1]; } + m_weight_factor[0][x] = latched_wfa; + m_weight_factor[1][x] = latched_wfb; + m_matte_flag[0][x] = latched_mf[0]; + m_matte_flag[1][x] = latched_mf[1]; } + // Fill the remainder. + std::fill_n(m_weight_factor[0] + x, std::size(m_weight_factor[0]) - x, latched_wfa); + std::fill_n(m_weight_factor[1] + x, std::size(m_weight_factor[1]) - x, latched_wfb); + std::fill_n(m_matte_flag[0] + x, std::size(m_matte_flag[0]) - x, latched_mf[0]); + std::fill_n(m_matte_flag[1] + x, std::size(m_matte_flag[1]) - x, latched_mf[1]); } template @@ -320,7 +246,7 @@ void mcd212_device::set_register(uint8_t reg, uint32_t value) m_cursor_pattern[(value >> 16) & 0x000f] = value & 0x0000ffff; } break; - case 0xd0: // Region Control 0-7 + case 0xd0: // matte Control 0-7 case 0xd1: case 0xd2: case 0xd3: @@ -328,9 +254,9 @@ void mcd212_device::set_register(uint8_t reg, uint32_t value) case 0xd5: case 0xd6: case 0xd7: - LOGMASKED(LOG_REGISTERS, "%s: Scanline %d, Path %d: Region Control %d = %08x\n", machine().describe_context(), screen().vpos(), Path, reg & 7, value); - m_region_control[reg & 7] = value; - update_region_arrays(); + LOGMASKED(LOG_REGISTERS, "%s: Scanline %d, Path %d: matte Control %d = %08x\n", machine().describe_context(), screen().vpos(), Path, reg & 7, value); + m_matte_control[reg & 7] = value; + update_matte_arrays(); break; case 0xd8: // Backdrop Color if (Path == 0) @@ -358,7 +284,7 @@ void mcd212_device::set_register(uint8_t reg, uint32_t value) { LOGMASKED(LOG_REGISTERS, "%s: Scanline %d, Path 0: Weight Factor A = %08x\n", machine().describe_context(), screen().vpos(), value); m_weight_factor[0][0] = (uint8_t)value; - update_region_arrays(); + update_matte_arrays(); } break; case 0xdc: // Weight Factor B @@ -366,7 +292,7 @@ void mcd212_device::set_register(uint8_t reg, uint32_t value) { LOGMASKED(LOG_REGISTERS, "%s: Scanline %d, Path 1: Weight Factor B = %08x\n", machine().describe_context(), screen().vpos(), value); m_weight_factor[1][0] = (uint8_t)value; - update_region_arrays(); + update_matte_arrays(); } break; } @@ -569,14 +495,7 @@ static inline uint8_t BYTE_TO_CLUT(int icm, uint8_t byte) case 1: return byte; case 3: - if (Path == 1) - { - return 0x80 + (byte & 0x7f); - } - else - { - return byte & 0x7f; - } + return (Path ? 0x80 : 0) | (byte & 0x7f); case 4: if (Path == 0) { @@ -584,14 +503,7 @@ static inline uint8_t BYTE_TO_CLUT(int icm, uint8_t byte) } break; case 11: - if (Path == 1) - { - return 0x80 + (byte & 0x0f); - } - else - { - return byte & 0x0f; - } + return (Path ? 0x80 : 0) | (byte & 0x0f); default: break; } @@ -624,16 +536,6 @@ inline ATTR_FORCE_INLINE uint8_t mcd212_device::get_mosaic_factor() return 1 << (((m_ddr[Path] & DDR_MT) >> DDR_MT_SHIFT) + 1); } -template -int mcd212_device::get_plane_width() -{ - const int width = get_screen_width(); - const uint8_t icm = get_icm(); - if (icm == ICM_CLUT4) - return width; - return width >> 1; -} - template void mcd212_device::process_vsr(uint32_t *pixels, bool *transparent) { @@ -670,11 +572,11 @@ void mcd212_device::process_vsr(uint32_t *pixels, bool *transparent) const bool use_rgb_tp_bit = (tp_ctrl_type == TCR_RGB); const bool tp_check_parity = !BIT(tp_ctrl, 3); const bool tp_always = ((tp_ctrl_type == TCR_ALWAYS) && tp_check_parity); - const int region_flag_index = BIT(~tp_ctrl_type, 0); - const bool *const region_flags = m_region_flag[region_flag_index]; - const bool use_region_flag = (tp_ctrl_type >= TCR_RF0 && tp_ctrl_type <= TCR_RF1_KEY1); + const int matte_flag_index = BIT(~tp_ctrl_type, 0); + const bool *const matte_flags = m_matte_flag[matte_flag_index]; + const bool use_matte_flag = (tp_ctrl_type >= TCR_MF0 && tp_ctrl_type <= TCR_MF1_KEY1); const bool is_dyuv_rgb = (icm == ICM_DYUV) || ((icm == ICM_RGB555) && (Path == 1)); // DYUV and RGB do not have access to color key. - const bool use_color_key = !is_dyuv_rgb && ((tp_ctrl_type == TCR_KEY) || (tp_ctrl_type == TCR_RF0_KEY1) || (tp_ctrl_type == TCR_RF1_KEY1)); + const bool use_color_key = !is_dyuv_rgb && ((tp_ctrl_type == TCR_KEY) || (tp_ctrl_type == TCR_MF0_KEY1) || (tp_ctrl_type == TCR_MF1_KEY1)); LOGMASKED(LOG_VSR, "Scanline %d: VSR Path %d, ICM (%02x), VSR (%08x)\n", screen().vpos(), Path, icm, vsr); @@ -708,10 +610,10 @@ void mcd212_device::process_vsr(uint32_t *pixels, bool *transparent) pixels[x + 1] = color0; pixels[x + 2] = color1; pixels[x + 3] = color1; - transparent[x ] = tp_always || (use_region_flag && (region_flags[x ] == tp_check_parity)); - transparent[x + 1] = tp_always || (use_region_flag && (region_flags[x + 1] == tp_check_parity)); - transparent[x + 2] = tp_always || (use_region_flag && (region_flags[x + 2] == tp_check_parity)); - transparent[x + 3] = tp_always || (use_region_flag && (region_flags[x + 3] == tp_check_parity)); + transparent[x ] = tp_always || (use_matte_flag && (matte_flags[x ] == tp_check_parity)); + transparent[x + 1] = tp_always || (use_matte_flag && (matte_flags[x + 1] == tp_check_parity)); + transparent[x + 2] = tp_always || (use_matte_flag && (matte_flags[x + 2] == tp_check_parity)); + transparent[x + 3] = tp_always || (use_matte_flag && (matte_flags[x + 3] == tp_check_parity)); x += 4; } else @@ -750,8 +652,8 @@ void mcd212_device::process_vsr(uint32_t *pixels, bool *transparent) { pixels[rl_index ] = color0; pixels[rl_index + 1] = color1; - transparent[rl_index ] = tp_always || rgb_tp_bit || (use_color_key && color_match0) || (use_region_flag && (region_flags[rl_index ] == tp_check_parity)); - transparent[rl_index + 1] = tp_always || rgb_tp_bit || (use_color_key && color_match1) || (use_region_flag && (region_flags[rl_index + 1] == tp_check_parity)); + transparent[rl_index ] = tp_always || rgb_tp_bit || (use_color_key && color_match0) || (use_matte_flag && (matte_flags[rl_index ] == tp_check_parity)); + transparent[rl_index + 1] = tp_always || rgb_tp_bit || (use_color_key && color_match1) || (use_matte_flag && (matte_flags[rl_index + 1] == tp_check_parity)); } x = end; } @@ -769,7 +671,6 @@ const uint32_t mcd212_device::s_4bpp_color[16] = template void mcd212_device::mix_lines(uint32_t *plane_a, bool *transparent_a, uint32_t *plane_b, bool *transparent_b, uint32_t *out) { - const uint32_t backdrop = s_4bpp_color[m_backdrop_color]; const uint8_t mosaic_count_a = (m_mosaic_hold[0] & 0x0000ff) << 1; const uint8_t mosaic_count_b = (m_mosaic_hold[1] & 0x0000ff) << 1; const int width = get_screen_width(); @@ -778,143 +679,97 @@ void mcd212_device::mix_lines(uint32_t *plane_a, bool *transparent_a, uint32_t * uint8_t *weight_a = &m_weight_factor[0][0]; uint8_t *weight_b = &m_weight_factor[1][0]; - if (!(m_transparency_control & TCR_DISABLE_MX)) + for (int x = 0; x < width; x++) { - for (int x = 0; x < width; x++, weight_a++, transparent_a++, weight_b++, transparent_b++) + if (transparent_a[x] && transparent_b[x]) { - const uint8_t weight_a_cur = *weight_a; - const uint8_t weight_b_cur = *weight_b; - - const uint32_t plane_a_cur = plane_a[x]; - const uint32_t plane_b_cur = plane_b[x]; - - const int32_t plane_a_r = (int32_t)(uint8_t)(plane_a_cur >> 16); - const int32_t plane_b_r = (int32_t)(uint8_t)(plane_b_cur >> 16); - const int32_t plane_a_g = (int32_t)(uint8_t)(plane_a_cur >> 8); - const int32_t plane_b_g = (int32_t)(uint8_t)(plane_b_cur >> 8); - const int32_t plane_a_b = (int32_t)(uint8_t)plane_a_cur; - const int32_t plane_b_b = (int32_t)(uint8_t)plane_b_cur; - const int32_t weighted_a_r = (plane_a_r > 16) ? (((plane_a_r - 16) * weight_a_cur) >> 6) : 0; - const int32_t weighted_a_g = (plane_a_g > 16) ? (((plane_a_g - 16) * weight_a_cur) >> 6) : 0; - const int32_t weighted_a_b = (plane_a_b > 16) ? (((plane_a_b - 16) * weight_a_cur) >> 6) : 0; - const int32_t weighted_b_r = ((plane_b_r > 16) ? (((plane_b_r - 16) * weight_b_cur) >> 6) : 0) + weighted_a_r; - const int32_t weighted_b_g = ((plane_b_g > 16) ? (((plane_b_g - 16) * weight_b_cur) >> 6) : 0) + weighted_a_g; - const int32_t weighted_b_b = ((plane_b_b > 16) ? (((plane_b_b - 16) * weight_b_cur) >> 6) : 0) + weighted_a_b; - const uint8_t out_r = (weighted_b_r > 255) ? 255 : (uint8_t)weighted_b_r; - const uint8_t out_g = (weighted_b_g > 255) ? 255 : (uint8_t)weighted_b_g; - const uint8_t out_b = (weighted_b_b > 255) ? 255 : (uint8_t)weighted_b_b; - *out++ = 0xff000000 | (out_r << 16) | (out_g << 8) | out_b; + out[x] = s_4bpp_color[m_backdrop_color]; + continue; } - } - else - { - for (int x = 0; x < width; x++, weight_a++, transparent_a++, weight_b++, transparent_b++) + uint32_t plane_a_cur = MosaicA ? plane_a[x - (x % mosaic_count_a)] : plane_a[x]; + uint32_t plane_b_cur = MosaicB ? plane_b[x - (x % mosaic_count_b)] : plane_b[x]; + + if (transparent_a[x]) { - if (OrderAB) - { - if (!(*transparent_a)) - { - const uint32_t plane_a_cur = MosaicA ? plane_a[x - (x % mosaic_count_a)] : plane_a[x]; - const uint8_t weight_a_cur = *weight_a; - const int32_t plane_a_r = (int32_t)(uint8_t)(plane_a_cur >> 16); - const int32_t plane_a_g = (int32_t)(uint8_t)(plane_a_cur >> 8); - const int32_t plane_a_b = (int32_t)(uint8_t)plane_a_cur; - const uint8_t weighted_a_r = std::clamp(((plane_a_r > 16) ? (((plane_a_r - 16) * weight_a_cur) >> 6) : 0) + 16, 0, 255); - const uint8_t weighted_a_g = std::clamp(((plane_a_g > 16) ? (((plane_a_g - 16) * weight_a_cur) >> 6) : 0) + 16, 0, 255); - const uint8_t weighted_a_b = std::clamp(((plane_a_b > 16) ? (((plane_a_b - 16) * weight_a_cur) >> 6) : 0) + 16, 0, 255); - *out++ = 0xff000000 | (weighted_a_r << 16) | (weighted_a_g << 8) | weighted_a_b; - } - else if (!(*transparent_b)) - { - const uint32_t plane_b_cur = MosaicB ? plane_b[x - (x % mosaic_count_b)] : plane_b[x]; - const uint8_t weight_b_cur = *weight_b; - const int32_t plane_b_r = (int32_t)(uint8_t)(plane_b_cur >> 16); - const int32_t plane_b_g = (int32_t)(uint8_t)(plane_b_cur >> 8); - const int32_t plane_b_b = (int32_t)(uint8_t)plane_b_cur; - const uint8_t weighted_b_r = std::clamp(((plane_b_r > 16) ? (((plane_b_r - 16) * weight_b_cur) >> 6) : 0) + 16, 0, 255); - const uint8_t weighted_b_g = std::clamp(((plane_b_g > 16) ? (((plane_b_g - 16) * weight_b_cur) >> 6) : 0) + 16, 0, 255); - const uint8_t weighted_b_b = std::clamp(((plane_b_b > 16) ? (((plane_b_b - 16) * weight_b_cur) >> 6) : 0) + 16, 0, 255); - *out++ = 0xff000000 | (weighted_b_r << 16) | (weighted_b_g << 8) | weighted_b_b; - } - else - { - *out++ = backdrop; - } - } - else - { - if (!(*transparent_b)) - { - const uint32_t plane_b_cur = MosaicB ? plane_b[x - (x % mosaic_count_b)] : plane_b[x]; - const uint8_t weight_b_cur = *weight_b; - const int32_t plane_b_r = (int32_t)(uint8_t)(plane_b_cur >> 16); - const int32_t plane_b_g = (int32_t)(uint8_t)(plane_b_cur >> 8); - const int32_t plane_b_b = (int32_t)(uint8_t)plane_b_cur; - const uint8_t weighted_b_r = std::clamp(((plane_b_r > 16) ? (((plane_b_r - 16) * weight_b_cur) >> 6) : 0) + 16, 0, 255); - const uint8_t weighted_b_g = std::clamp(((plane_b_g > 16) ? (((plane_b_g - 16) * weight_b_cur) >> 6) : 0) + 16, 0, 255); - const uint8_t weighted_b_b = std::clamp(((plane_b_b > 16) ? (((plane_b_b - 16) * weight_b_cur) >> 6) : 0) + 16, 0, 255); - *out++ = 0xff000000 | (weighted_b_r << 16) | (weighted_b_g << 8) | weighted_b_b; - } - else if (!(*transparent_a)) - { - const uint32_t plane_a_cur = MosaicA ? plane_a[x - (x % mosaic_count_a)] : plane_a[x]; - const uint8_t weight_a_cur = *weight_a; - const int32_t plane_a_r = (int32_t)(uint8_t)(plane_a_cur >> 16); - const int32_t plane_a_g = (int32_t)(uint8_t)(plane_a_cur >> 8); - const int32_t plane_a_b = (int32_t)(uint8_t)plane_a_cur; - const uint8_t weighted_a_r = std::clamp(((plane_a_r > 16) ? (((plane_a_r - 16) * weight_a_cur) >> 6) : 0) + 16, 0, 255); - const uint8_t weighted_a_g = std::clamp(((plane_a_g > 16) ? (((plane_a_g - 16) * weight_a_cur) >> 6) : 0) + 16, 0, 255); - const uint8_t weighted_a_b = std::clamp(((plane_a_b > 16) ? (((plane_a_b - 16) * weight_a_cur) >> 6) : 0) + 16, 0, 255); - *out++ = 0xff000000 | (weighted_a_r << 16) | (weighted_a_g << 8) | weighted_a_b; - } - else - { - *out++ = backdrop; - } - } + plane_a_cur = 0; + } + else if (OrderAB && (m_transparency_control & TCR_DISABLE_MX)) + { + plane_b_cur = 0; + } + + if (transparent_b[x]) + { + plane_b_cur = 0; + } + else if (!OrderAB && (m_transparency_control & TCR_DISABLE_MX)) + { + plane_a_cur = 0; } + + const int32_t plane_a_r = 0xff & (plane_a_cur >> 16); + const int32_t plane_a_g = 0xff & (plane_a_cur >> 8); + const int32_t plane_a_b = 0xff & plane_a_cur; + const int32_t plane_b_r = 0xff & (plane_b_cur >> 16); + const int32_t plane_b_g = 0xff & (plane_b_cur >> 8); + const int32_t plane_b_b = 0xff & plane_b_cur; + + const int32_t weighted_a_r = std::clamp((std::clamp(plane_a_r - 16, 0, 255) * weight_a[x]) >> 6, 0, 255); + const int32_t weighted_a_g = std::clamp((std::clamp(plane_a_g - 16, 0, 255) * weight_a[x]) >> 6, 0, 255); + const int32_t weighted_a_b = std::clamp((std::clamp(plane_a_b - 16, 0, 255) * weight_a[x]) >> 6, 0, 255); + + const int32_t weighted_b_r = std::clamp((std::clamp(plane_b_r - 16, 0, 255) * weight_b[x]) >> 6, 0, 255); + const int32_t weighted_b_g = std::clamp((std::clamp(plane_b_g - 16, 0, 255) * weight_b[x]) >> 6, 0, 255); + const int32_t weighted_b_b = std::clamp((std::clamp(plane_b_b - 16, 0, 255) * weight_b[x]) >> 6, 0, 255); + + const uint8_t out_r = std::clamp(weighted_a_r + weighted_b_r + 16, 0, 255); + const uint8_t out_g = std::clamp(weighted_a_g + weighted_b_g + 16, 0, 255); + const uint8_t out_b = std::clamp(weighted_a_b + weighted_b_b + 16, 0, 255); + out[x] = 0xff000000 | (out_r << 16) | (out_g << 8) | out_b; } if (border_width) { - std::fill_n(out, border_width, 0xff101010); + std::fill_n(&out[width], border_width, s_4bpp_color[0]); } } void mcd212_device::draw_cursor(uint32_t *scanline) { - if (m_cursor_control & CURCNT_EN) + if (!(m_cursor_control & CURCNT_EN)) + { + return; + } + + uint16_t y = (uint16_t)screen().vpos(); + const uint16_t cursor_x = m_cursor_position & 0x3ff; + const uint16_t cursor_y = ((m_cursor_position >> 12) & 0x3ff) + m_ica_height; + if (y >= cursor_y && y < (cursor_y + 16)) { - uint16_t y = (uint16_t)screen().vpos(); - const uint16_t cursor_x = m_cursor_position & 0x3ff; - const uint16_t cursor_y = ((m_cursor_position >> 12) & 0x3ff) + m_ica_height; - if (y >= cursor_y && y < (cursor_y + 16)) + const int width = get_screen_width(); + uint32_t color = s_4bpp_color[m_cursor_control & CURCNT_COLOR]; + y -= cursor_y; + if (m_cursor_control & CURCNT_CUW) { - const int width = get_screen_width(); - uint32_t color = s_4bpp_color[m_cursor_control & CURCNT_COLOR]; - y -= cursor_y; - if (m_cursor_control & CURCNT_CUW) + for (int x = cursor_x; x < cursor_x + 64 && x < width; x++) { - for (int x = cursor_x; x < cursor_x + 64 && x < width; x++) + if (m_cursor_pattern[y] & (1 << (15 - ((x - cursor_x) >> 2)))) { - if (m_cursor_pattern[y] & (1 << (15 - ((x - cursor_x) >> 2)))) - { - scanline[x++] = color; - scanline[x++] = color; - scanline[x++] = color; - scanline[x] = color; - } + scanline[x++] = color; + scanline[x++] = color; + scanline[x++] = color; + scanline[x] = color; } } - else + } + else + { + for (int x = cursor_x; x < cursor_x + 32 && x < width; x++) { - for (int x = cursor_x; x < cursor_x + 32 && x < width; x++) + if (m_cursor_pattern[y] & (1 << (15 - ((x - cursor_x) >> 1)))) { - if (m_cursor_pattern[y] & (1 << (15 - ((x - cursor_x) >> 1)))) - { - scanline[x++] = color; - scanline[x] = color; - } + scanline[x++] = color; + scanline[x] = color; } } } @@ -1253,13 +1108,13 @@ void mcd212_device::device_reset() m_cursor_position = 0; m_cursor_control = 0; std::fill_n(m_cursor_pattern, std::size(m_cursor_pattern), 0); - std::fill_n(m_region_control, 8, 0); + std::fill_n(m_matte_control, 8, 0); m_backdrop_color = 0; std::fill_n(m_mosaic_hold, 2, 0); std::fill_n(m_weight_factor[0], std::size(m_weight_factor[0]), 0); std::fill_n(m_weight_factor[1], std::size(m_weight_factor[1]), 0); - std::fill_n(m_region_flag[0], std::size(m_region_flag[0]), false); - std::fill_n(m_region_flag[1], std::size(m_region_flag[1]), false); + std::fill_n(m_matte_flag[0], std::size(m_matte_flag[0]), false); + std::fill_n(m_matte_flag[1], std::size(m_matte_flag[1]), false); m_ica_height = 32; m_total_height = 312; @@ -1311,8 +1166,8 @@ void mcd212_device::device_start() m_dyuv_v_to_r[sw] = (351 * (sw - 128)) / 256; } - save_item(NAME(m_region_flag[0])); - save_item(NAME(m_region_flag[1])); + save_item(NAME(m_matte_flag[0])); + save_item(NAME(m_matte_flag[1])); save_item(NAME(m_ica_height)); save_item(NAME(m_total_height)); save_item(NAME(m_csrr)); @@ -1333,7 +1188,7 @@ void mcd212_device::device_start() save_item(NAME(m_cursor_position)); save_item(NAME(m_cursor_control)); save_item(NAME(m_cursor_pattern)); - save_item(NAME(m_region_control)); + save_item(NAME(m_matte_control)); save_item(NAME(m_backdrop_color)); save_item(NAME(m_mosaic_hold)); save_item(NAME(m_weight_factor[0])); diff --git a/src/mame/philips/mcd212.h b/src/mame/philips/mcd212.h index 5106dc7f37249..5fc8e609c7894 100644 --- a/src/mame/philips/mcd212.h +++ b/src/mame/philips/mcd212.h @@ -100,8 +100,8 @@ class mcd212_device : public device_t, ICM_MODE2 = 0x000f00, // Plane 2 ICM_MODE2_SHIFT = 8, ICM_EV = 0x040000, // External video - ICM_NR = 0x080000, // Number of region flags - ICM_NR_BIT = 19, + ICM_NM = 0x080000, // Number of Matte flags + ICM_NM_BIT = 19, ICM_CS = 0x400000, // CLUT select TCR_TA = 0x00000f, // Plane A @@ -110,30 +110,30 @@ class mcd212_device : public device_t, TCR_ALWAYS = 0x0, // Transparent if: Always (Plane Disabled) TCR_KEY = 0x1, // Transparent if: Color Key = True TCR_RGB = 0x2, // Transparent if: Transparency Bit = 1 (RGB Only) - TCR_RF0 = 0x3, // Transparent if: Region Flag 0 = True - TCR_RF1 = 0x4, // Transparent if: Region Flag 1 = True - TCR_RF0_KEY1 = 0x5, // Transparent if: Region Flag 0 = True || Color Key = True - TCR_RF1_KEY1 = 0x6, // Transparent if: Region Flag 1 = True || Color Key = True + TCR_MF0 = 0x3, // Transparent if: Matte Flag 0 = True + TCR_MF1 = 0x4, // Transparent if: Matte Flag 1 = True + TCR_MF0_KEY1 = 0x5, // Transparent if: Matte Flag 0 = True || Color Key = True + TCR_MF1_KEY1 = 0x6, // Transparent if: Matte Flag 1 = True || Color Key = True TCR_COND_UNUSED0 = 0x7, // Unused TCR_NEVER = 0x8, // Transparent if: Never (No Transparent Area) TCR_NOT_KEY = 0x9, // Transparent if: Color Key = False TCR_NOT_RGB = 0xa, // Transparent if: Transparency Bit = 0 (RGB Only) - TCR_NOT_RF0 = 0xb, // Transparent if: Region Flag 0 = False - TCR_NOT_RF1 = 0xc, // Transparent if: Region Flag 1 = False - TCR_NOT_RF0_KEY = 0xd, // Transparent if: Region Flag 0 = False || Color Key = False - TCR_NOT_RF1_KEY = 0xe, // Transparent if: Region Flag 1 = False || Color Key = False + TCR_NOT_MF0 = 0xb, // Transparent if: Matte Flag 0 = False + TCR_NOT_MF1 = 0xc, // Transparent if: Matte Flag 1 = False + TCR_NOT_MF0_KEY = 0xd, // Transparent if: Matte Flag 0 = False || Color Key = False + TCR_NOT_MF1_KEY = 0xe, // Transparent if: Matte Flag 1 = False || Color Key = False TCR_COND_UNUSED1 = 0xf, // Unused TCR_DISABLE_MX = 0x800000, // Mix disable POR_AB = 0, // Plane A in front of Plane B POR_BA = 1, // Plane B in front of Plane A - RC_X = 0x0003ff, // X position - RC_WF = 0x00fc00, // Weight position - RC_WF_SHIFT = 10, - RC_RF_BIT = 16, // Region flag bit - RC_OP = 0xf00000, // Operation - RC_OP_SHIFT = 20, + MC_X = 0x0003ff, // X position + MC_WF = 0x00fc00, // Weight position + MC_WF_SHIFT = 10, + MC_MF_BIT = 16, // Matte flag bit + MC_OP = 0xf00000, // Operation + MC_OP_SHIFT = 20, CSR1R_PA = 0x20, // Parity CSR1R_DA = 0x80, // Display Active @@ -196,7 +196,7 @@ class mcd212_device : public device_t, uint32_t m_cursor_position = 0; uint32_t m_cursor_control = 0; uint32_t m_cursor_pattern[16]{}; - uint32_t m_region_control[8]{}; + uint32_t m_matte_control[8]{}; uint32_t m_backdrop_color = 0; uint32_t m_mosaic_hold[2]{}; uint8_t m_weight_factor[2][768]{}; @@ -229,7 +229,7 @@ class mcd212_device : public device_t, required_shared_ptr m_planeb; // internal state - bool m_region_flag[2][768]{}; + bool m_matte_flag[2][768]{}; int m_ica_height = 0; int m_total_height = 0; emu_timer *m_ica_timer = nullptr; @@ -237,13 +237,12 @@ class mcd212_device : public device_t, static const uint32_t s_4bpp_color[16]; - uint8_t get_weight_factor(const uint32_t region_idx); - uint8_t get_region_op(const uint32_t region_idx); - void update_region_arrays(); + uint8_t get_weight_factor(const uint32_t Matte_idx); + uint8_t get_matte_op(const uint32_t Matte_idx); + void update_matte_arrays(); int get_screen_width(); int get_border_width(); - template int get_plane_width(); template void set_vsr(uint32_t value); template uint32_t get_vsr(); diff --git a/src/mame/psion/psion.cpp b/src/mame/psion/psion.cpp index 3c9f6c1b78a3f..043161f5eee62 100644 --- a/src/mame/psion/psion.cpp +++ b/src/mame/psion/psion.cpp @@ -4,11 +4,9 @@ Psion Organiser II series - Driver by Sandro Ronco - TODO: - dump CGROM of the HD44780 - - emulate other devices in slot C(Comms Link, printer) + - emulate other devices in slot C (Comms Link, Printer, etc.) Note: - 4 lines display has an custom LCD controller derived from an HD66780 @@ -22,16 +20,151 @@ #include "emu.h" -#include "psion.h" +#include "psion_pack.h" +#include "cpu/m6800/m6801.h" +#include "machine/nvram.h" +#include "machine/ram.h" +#include "machine/timer.h" +#include "video/hd44780.h" +#include "sound/beep.h" + +#include "emupal.h" #include "screen.h" #include "softlist_dev.h" #include "speaker.h" +namespace { + +class psion_state : public driver_device +{ +public: + psion_state(const machine_config &mconfig, device_type type, const char *tag) + : driver_device(mconfig, type, tag) + , m_maincpu(*this, "maincpu") + , m_lcdc(*this, "hd44780") + , m_screen(*this, "screen") + , m_beep(*this, "beeper") + , m_pack(*this, "pack%u", 1U) + , m_topslot(*this, "topslot") + , m_nvram(*this, "nvram") + , m_ram(*this, "ram") + , m_kb_lines(*this, "K%u", 1U) + , m_kb_on(*this, "ON") + , m_battery(*this, "BATTERY") + { } + + void psion_base(machine_config &config); + + DECLARE_INPUT_CHANGED_MEMBER(psion_on); + +protected: + virtual void machine_start() override ATTR_COLD; + virtual void machine_reset() override ATTR_COLD; + + required_device m_maincpu; + required_device m_lcdc; + required_device m_screen; + required_device m_beep; + required_device_array m_pack; + optional_device m_topslot; + required_device m_nvram; + required_device m_ram; + required_ioport_array<7> m_kb_lines; + required_ioport m_kb_on; + required_ioport m_battery; + + uint8_t kb_read(); + void port2_w(offs_t offset, uint8_t data, uint8_t ddr); + uint8_t port2_r(); + uint8_t port5_r(); + void port6_w(uint8_t data); + uint8_t port6_r(); + + void psion_palette(palette_device &palette) const; + TIMER_DEVICE_CALLBACK_MEMBER(nmi_timer); + + uint16_t m_kb_counter = 0; + bool m_nmi_enable = false; + uint8_t m_pulse_enable = 0; +}; + + +class psion1_state : public psion_state +{ +public: + psion1_state(const machine_config &mconfig, device_type type, const char *tag) + : psion_state(mconfig, type, tag) + { } + + void psion1(machine_config &config); + +protected: + virtual void machine_reset() override ATTR_COLD; + +private: + HD44780_PIXEL_UPDATE(psion1_pixel_update); + + void psion1_mem(address_map &map) ATTR_COLD; + + uint8_t reset_kb_counter_r(); + uint8_t inc_kb_counter_r(); + uint8_t switchoff_r(); +}; + + +class psion2_state : public psion_state +{ +public: + psion2_state(const machine_config &mconfig, device_type type, const char *tag) + : psion_state(mconfig, type, tag) + , m_rambank1(*this, "rambank1") + , m_rambank2(*this, "rambank2") + , m_rombank1(*this, "rombank1") + , m_rombank2(*this, "rombank2") + { } + + void psion2(machine_config &config); + void psioncm(machine_config &config); + void psionxp(machine_config &config); + void psionla(machine_config &config); + void psionlz(machine_config &config); + void psionlz64(machine_config &config); + void psionp200(machine_config &config); + void psionp350(machine_config &config); + void psionp432(machine_config &config); + void psionp464(machine_config &config); + +protected: + virtual void machine_start() override ATTR_COLD; + virtual void machine_reset() override ATTR_COLD; + +private: + required_memory_bank m_rambank1; + optional_memory_bank m_rambank2; + required_memory_bank m_rombank1; + optional_memory_bank m_rombank2; + + HD44780_PIXEL_UPDATE(lz_pixel_update); + + void io_rw(uint16_t offset); + void io_w(offs_t offset, uint8_t data); + uint8_t io_r(offs_t offset); + + void psioncm_mem(address_map &map) ATTR_COLD; + void psionxp_mem(address_map &map) ATTR_COLD; + void psionla_mem(address_map &map) ATTR_COLD; + + // RAM/ROM banks + uint8_t m_rambank_count = 0; + uint8_t m_rombank_count = 0; +}; + + TIMER_DEVICE_CALLBACK_MEMBER(psion_state::nmi_timer) { - if (m_enable_nmi) + if (m_nmi_enable) m_maincpu->pulse_input_line(INPUT_LINE_NMI, attotime::zero); } @@ -55,26 +188,26 @@ uint8_t psion_state::kb_read() return data & 0x7c; } -void psion_state::update_banks() -{ - if (m_ram_bank < m_ram_bank_count && m_ram_bank_count) - membank("rambank")->set_entry(m_ram_bank); - - if (m_rom_bank < m_rom_bank_count && m_rom_bank_count) - membank("rombank")->set_entry(m_rom_bank); -} void psion_state::port2_w(offs_t offset, uint8_t data, uint8_t ddr) { /* datapack i/o data bus */ - m_pack1->data_w(data & ddr); - m_pack2->data_w(data & ddr); + m_pack[0]->data_w(data & ddr); + m_pack[1]->data_w(data & ddr); + + if (m_topslot) + m_topslot->data_w(data & ddr); } uint8_t psion_state::port2_r() { /* datapack i/o data bus */ - return m_pack1->data_r() | m_pack2->data_r(); + uint8_t data = m_pack[0]->data_r() | m_pack[1]->data_r(); + + if (m_topslot) + data |= m_topslot->data_r(); + + return data; } uint8_t psion_state::port5_r() @@ -85,7 +218,7 @@ uint8_t psion_state::port5_r() ---- --x- pulse ---- ---x battery status */ - return kb_read() | ioport("BATTERY")->read() | ioport("ON")->read() | (m_kb_counter == 0x7ff)<<1 | m_pulse<<1; + return kb_read() | m_battery->read() | m_kb_on->read() | (m_kb_counter == 0x7ff)<<1 | m_pulse_enable<<1; } void psion_state::port6_w(uint8_t data) @@ -101,18 +234,26 @@ void psion_state::port6_w(uint8_t data) ---- --x- reset line ---- ---x clock line */ - m_pack1->control_w((data & 0x8f) | (data & 0x10)); - m_pack2->control_w((data & 0x8f) | ((data & 0x20) >> 1)); + m_pack[0]->control_w((data & 0x8f) | (data & 0x10)); + m_pack[1]->control_w((data & 0x8f) | ((data & 0x20) >> 1)); + + if (m_topslot) + m_topslot->control_w((data & 0x8f) | ((data & 0x40) >> 2)); } uint8_t psion_state::port6_r() { /* datapack control lines */ - return (m_pack1->control_r() | (m_pack2->control_r() & 0x8f)) | ((m_pack2->control_r() & 0x10)<<1); + uint8_t data = (m_pack[0]->control_r() | (m_pack[1]->control_r() & 0x8f)) | ((m_pack[1]->control_r() & 0x10) << 1); + + if (m_topslot) + data |= (m_topslot->control_r() & 0x8f) | ((m_topslot->control_r() & 0x10) << 2); + + return data; } /* Read/Write common */ -void psion_state::io_rw(uint16_t offset) +void psion2_state::io_rw(uint16_t offset) { if (machine().side_effects_disabled()) return; @@ -121,17 +262,14 @@ void psion_state::io_rw(uint16_t offset) { case 0xc0: /* switch off, CPU goes into standby mode */ - m_enable_nmi = false; + m_nmi_enable = false; m_maincpu->set_input_line(M6801_STBY_LINE, ASSERT_LINE); break; case 0x100: - m_pulse = 1; + m_pulse_enable = 1; break; case 0x140: - m_pulse = 0; - break; - case 0x200: - m_kb_counter = 0; + m_pulse_enable = 0; break; case 0x180: m_beep->set_state(1); @@ -139,40 +277,53 @@ void psion_state::io_rw(uint16_t offset) case 0x1c0: m_beep->set_state(0); break; + case 0x200: + m_kb_counter = 0; + break; case 0x240: - if (offset == 0x260 && (m_rom_bank_count || m_ram_bank_count)) + if (offset == 0x260 && (m_rombank_count || m_rambank_count)) { - m_ram_bank=0; - m_rom_bank=0; - update_banks(); + if (m_rambank_count) + m_rambank2->set_entry(0); + + if (m_rombank_count) + m_rombank2->set_entry(0); } else + { m_kb_counter++; + } break; case 0x280: - if (offset == 0x2a0 && m_ram_bank_count) + if (offset == 0x2a0 && m_rambank_count) { - m_ram_bank++; - update_banks(); + int const rambank = m_rambank2->entry() + 1; + if (rambank < m_rambank_count) + m_rambank2->set_entry(rambank); } else - m_enable_nmi = true; + { + m_nmi_enable = true; + } break; case 0x2c0: - if (offset == 0x2e0 && m_rom_bank_count) + if (offset == 0x2e0 && m_rombank_count) { - m_rom_bank++; - update_banks(); + int const rombank = m_rombank2->entry() + 1; + if (rombank < m_rombank_count) + m_rombank2->set_entry(rombank); } else - m_enable_nmi = false; + { + m_nmi_enable = false; + } break; } } -void psion_state::io_w(offs_t offset, uint8_t data) +void psion2_state::io_w(offs_t offset, uint8_t data) { - switch (offset & 0x0ffc0) + switch (offset & 0xffc0) { case 0x80: m_lcdc->write(offset & 0x01, data); @@ -183,15 +334,14 @@ void psion_state::io_w(offs_t offset, uint8_t data) } } -uint8_t psion_state::io_r(offs_t offset) +uint8_t psion2_state::io_r(offs_t offset) { switch (offset & 0xffc0) { case 0x80: return m_lcdc->read(offset & 0x01); default: - if (!machine().side_effects_disabled()) - io_rw(offset); + io_rw(offset); break; } @@ -241,69 +391,112 @@ void psion1_state::psion1_mem(address_map &map) map(0x4000, 0x47ff).ram().share("ram"); } -void psion_state::psioncm_mem(address_map &map) +void psion2_state::psioncm_mem(address_map &map) { map.unmap_value_low(); - map(0x0100, 0x03ff).rw(FUNC(psion_state::io_r), FUNC(psion_state::io_w)); - map(0x2000, 0x3fff).ram().share("ram"); - map(0x8000, 0xffff).rom(); + map(0x0100, 0x03ff).rw(FUNC(psion2_state::io_r), FUNC(psion2_state::io_w)); + map(0x2000, 0x3fff).bankrw("rambank1"); + map(0x8000, 0xbfff).bankr("rombank2"); + map(0xc000, 0xffff).bankr("rombank1"); } -void psion_state::psionla_mem(address_map &map) +void psion2_state::psionxp_mem(address_map &map) { map.unmap_value_low(); - map(0x0100, 0x03ff).rw(FUNC(psion_state::io_r), FUNC(psion_state::io_w)); - map(0x0400, 0x5fff).ram().share("ram"); - map(0x8000, 0xffff).rom(); + map(0x0100, 0x03ff).rw(FUNC(psion2_state::io_r), FUNC(psion2_state::io_w)); + map(0x2000, 0x5fff).bankrw("rambank1"); + map(0x8000, 0xbfff).bankr("rombank2"); + map(0xc000, 0xffff).bankr("rombank1"); } -void psion_state::psionp350_mem(address_map &map) +void psion2_state::psionla_mem(address_map &map) { map.unmap_value_low(); - map(0x0100, 0x03ff).rw(FUNC(psion_state::io_r), FUNC(psion_state::io_w)); - map(0x0400, 0x3fff).ram().share("ram"); - map(0x4000, 0x7fff).bankrw("rambank"); - map(0x8000, 0xffff).rom(); + map(0x0100, 0x03ff).rw(FUNC(psion2_state::io_r), FUNC(psion2_state::io_w)); + map(0x0400, 0x3fff).bankrw("rambank1"); + map(0x4000, 0x7fff).bankrw("rambank2"); + map(0x8000, 0xbfff).bankr("rombank2"); + map(0xc000, 0xffff).bankr("rombank1"); } -void psion_state::psionlam_mem(address_map &map) -{ - map.unmap_value_low(); - map(0x0100, 0x03ff).rw(FUNC(psion_state::io_r), FUNC(psion_state::io_w)); - map(0x0400, 0x7fff).ram().share("ram"); - map(0x8000, 0xbfff).bankr("rombank"); - map(0xc000, 0xffff).rom(); -} - -void psion_state::psionlz_mem(address_map &map) -{ - map.unmap_value_low(); - map(0x0100, 0x03ff).rw(FUNC(psion_state::io_r), FUNC(psion_state::io_w)); - map(0x0400, 0x3fff).ram().share("ram"); - map(0x4000, 0x7fff).bankrw("rambank"); - map(0x8000, 0xbfff).bankr("rombank"); - map(0xc000, 0xffff).rom(); -} /* Input ports */ INPUT_PORTS_START( psion ) PORT_START("BATTERY") - PORT_CONFNAME( 0x01, 0x00, "Battery Status" ) - PORT_CONFSETTING( 0x00, DEF_STR( Normal ) ) - PORT_CONFSETTING( 0x01, "Low Battery" ) + PORT_CONFNAME( 0x01, 0x00, "Battery Status" ) + PORT_CONFSETTING( 0x00, DEF_STR( Normal ) ) + PORT_CONFSETTING( 0x01, "Low Battery" ) PORT_START("ON") - PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("ON/CLEAR") PORT_CODE(KEYCODE_MINUS) PORT_CHANGED_MEMBER(DEVICE_SELF, FUNC(psion_state::psion_on), 0) + PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("ON/CLEAR") PORT_CODE(KEYCODE_ESC) PORT_CHANGED_MEMBER(DEVICE_SELF, FUNC(psion_state::psion_on), 0) +INPUT_PORTS_END + +INPUT_PORTS_START( psion1 ) + PORT_INCLUDE(psion) + PORT_START("K1") + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME(u8"\u2192 [>>]") PORT_CODE(KEYCODE_RIGHT) // U+2192 = → + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME(u8"\u2190 [<<]") PORT_CODE(KEYCODE_LEFT) // U+2190 = ← + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME(u8"\u2193 [FIND]") PORT_CODE(KEYCODE_DOWN) // U+2193 = ↓ + PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME(u8"\u2191 [SAVE]") PORT_CODE(KEYCODE_UP) // U+2191 = ↑ + PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("MODE/HOME") PORT_CODE(KEYCODE_EQUALS) + + PORT_START("K2") + PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("SHIFT") PORT_CODE(KEYCODE_LSHIFT) + PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("S [,]") PORT_CODE(KEYCODE_S) + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("M [%]") PORT_CODE(KEYCODE_M) + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("G [=]") PORT_CODE(KEYCODE_G) + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("A [<]") PORT_CODE(KEYCODE_A) + + PORT_START("K3") + PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Y [(]") PORT_CODE(KEYCODE_Y) + PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("T [:]") PORT_CODE(KEYCODE_T) + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("N [$]") PORT_CODE(KEYCODE_N) + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("H [\"]") PORT_CODE(KEYCODE_H) + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("B [>]") PORT_CODE(KEYCODE_B) + + PORT_START("K4") + PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Z [)]") PORT_CODE(KEYCODE_Z) + PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("U [0]") PORT_CODE(KEYCODE_U) + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("O [1]") PORT_CODE(KEYCODE_O) + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("I [4]") PORT_CODE(KEYCODE_I) + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("C [7]") PORT_CODE(KEYCODE_C) + + PORT_START("K5") + PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("DELETE") PORT_CODE(KEYCODE_DEL) + PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("W [EE]") PORT_CODE(KEYCODE_W) + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Q [3]") PORT_CODE(KEYCODE_Q) + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("K [6]") PORT_CODE(KEYCODE_K) + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("E [9]") PORT_CODE(KEYCODE_E) + + PORT_START("K6") + PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("EXECUTE") PORT_CODE(KEYCODE_ENTER) + PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("X [+]") PORT_CODE(KEYCODE_X) + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("R [-]") PORT_CODE(KEYCODE_R) + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("L [*]") PORT_CODE(KEYCODE_L) + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("F [/]") PORT_CODE(KEYCODE_F) + + PORT_START("K7") + PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("SPACE") PORT_CODE(KEYCODE_SPACE) + PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("V [.]") PORT_CODE(KEYCODE_V) + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("P [2]") PORT_CODE(KEYCODE_P) + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("J [5]") PORT_CODE(KEYCODE_J) + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("D [8]") PORT_CODE(KEYCODE_D) +INPUT_PORTS_END + +INPUT_PORTS_START( psion2 ) + PORT_INCLUDE(psion) + + // Normal keyboard PORT_START("K1") PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("MODE") PORT_CODE(KEYCODE_EQUALS) - PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Up [CAP]") PORT_CODE(KEYCODE_UP) - PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Down [NUM]") PORT_CODE(KEYCODE_DOWN) - PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Left") PORT_CODE(KEYCODE_LEFT) - PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("RIGHT") PORT_CODE(KEYCODE_RIGHT) + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME(u8"\u2191 [CAP]") PORT_CODE(KEYCODE_UP) // U+2191 = ↑ + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME(u8"\u2193 [NUM]") PORT_CODE(KEYCODE_DOWN) // U+2193 = ↓ + PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME(u8"\u2190") PORT_CODE(KEYCODE_LEFT) // U+2190 = ← + PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME(u8"\u2192") PORT_CODE(KEYCODE_RIGHT) // U+2192 = → PORT_START("K2") - PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Shift") PORT_CODE(KEYCODE_LSHIFT) + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("SHIFT") PORT_CODE(KEYCODE_LSHIFT) PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("S [;]") PORT_CODE(KEYCODE_S) PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("M [,]") PORT_CODE(KEYCODE_M) PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("G [=]") PORT_CODE(KEYCODE_G) @@ -324,7 +517,7 @@ INPUT_PORTS_START( psion ) PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("C [(]") PORT_CODE(KEYCODE_C) PORT_START("K5") - PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Space") PORT_CODE(KEYCODE_SPACE) + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("SPACE") PORT_CODE(KEYCODE_SPACE) PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("W [3]") PORT_CODE(KEYCODE_W) PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Q [6]") PORT_CODE(KEYCODE_Q) PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("K [9]") PORT_CODE(KEYCODE_K) @@ -345,142 +538,199 @@ INPUT_PORTS_START( psion ) PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("D [)]") PORT_CODE(KEYCODE_D) INPUT_PORTS_END -INPUT_PORTS_START( psion1 ) - PORT_START("BATTERY") - PORT_CONFNAME( 0x01, 0x00, "Battery Status" ) - PORT_CONFSETTING( 0x00, DEF_STR( Normal ) ) - PORT_CONFSETTING( 0x01, "Low Battery" ) +INPUT_PORTS_START( psion2a ) + PORT_INCLUDE(psion) - PORT_START("ON") - PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("ON/CLEAR") PORT_CODE(KEYCODE_MINUS) PORT_CHANGED_MEMBER(DEVICE_SELF, FUNC(psion_state::psion_on), 0) + // Alpha keyboard + PORT_START("K1") + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("MODE") PORT_CODE(KEYCODE_EQUALS) + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME(u8"\u2191") PORT_CODE(KEYCODE_UP) // U+2191 = ↑ + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME(u8"\u2193") PORT_CODE(KEYCODE_DOWN) // U+2193 = ↓ + PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME(u8"\u2190") PORT_CODE(KEYCODE_LEFT) // U+2190 = ← + PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME(u8"\u2192") PORT_CODE(KEYCODE_RIGHT) // U+2192 = → + + PORT_START("K2") + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Shift") PORT_CODE(KEYCODE_LSHIFT) + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("S") PORT_CODE(KEYCODE_S) + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("M") PORT_CODE(KEYCODE_M) + PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("G") PORT_CODE(KEYCODE_G) + PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("A") PORT_CODE(KEYCODE_A) + + PORT_START("K3") + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("DEL") PORT_CODE(KEYCODE_DEL) + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("T") PORT_CODE(KEYCODE_T) + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("No [N]") PORT_CODE(KEYCODE_N) + PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("H") PORT_CODE(KEYCODE_H) + PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("B") PORT_CODE(KEYCODE_B) + + PORT_START("K4") + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("YES [Y]") PORT_CODE(KEYCODE_Y) + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("U") PORT_CODE(KEYCODE_U) + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("O") PORT_CODE(KEYCODE_O) + PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("I") PORT_CODE(KEYCODE_I) + PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("C") PORT_CODE(KEYCODE_C) + + PORT_START("K5") + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("SPACE") PORT_CODE(KEYCODE_SPACE) + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME(". [W]") PORT_CODE(KEYCODE_W) + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("2 [Q]") PORT_CODE(KEYCODE_Q) + PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("5 [K]") PORT_CODE(KEYCODE_K) + PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("8 [E]") PORT_CODE(KEYCODE_E) + PORT_START("K6") + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("ENTER") PORT_CODE(KEYCODE_ENTER) + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("- [X]") PORT_CODE(KEYCODE_X) + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("3 [R]") PORT_CODE(KEYCODE_R) + PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("6 [L]") PORT_CODE(KEYCODE_L) + PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("9 [F]") PORT_CODE(KEYCODE_F) + + PORT_START("K7") + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Z") PORT_CODE(KEYCODE_Z) + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("0 [V]") PORT_CODE(KEYCODE_V) + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("1 [P]") PORT_CODE(KEYCODE_P) + PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("4 [J]") PORT_CODE(KEYCODE_J) + PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("7 [D]") PORT_CODE(KEYCODE_D) +INPUT_PORTS_END + +INPUT_PORTS_START( psion2n ) + PORT_INCLUDE(psion) + + // Numerical keyboard PORT_START("K1") - PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("RIGHT") PORT_CODE(KEYCODE_RIGHT) - PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Left") PORT_CODE(KEYCODE_LEFT) - PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Down [NUM]") PORT_CODE(KEYCODE_DOWN) - PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Up [CAP]") PORT_CODE(KEYCODE_UP) - PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("MODE") PORT_CODE(KEYCODE_EQUALS) + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("7") PORT_CODE(KEYCODE_7) + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_UNUSED) + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("8") PORT_CODE(KEYCODE_8) + PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_UNUSED) + PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("9") PORT_CODE(KEYCODE_9) PORT_START("K2") - PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Shift") PORT_CODE(KEYCODE_LSHIFT) - PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("S [;]") PORT_CODE(KEYCODE_S) - PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("M [,]") PORT_CODE(KEYCODE_M) - PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("G [=]") PORT_CODE(KEYCODE_G) - PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("A [<]") PORT_CODE(KEYCODE_A) + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("EXE") PORT_CODE(KEYCODE_ENTER) + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("F3") PORT_CODE(KEYCODE_F3) + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("F2") PORT_CODE(KEYCODE_F2) + PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("F1") PORT_CODE(KEYCODE_F1) + PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("MODE") PORT_CODE(KEYCODE_EQUALS) PORT_START("K3") - PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Y [0]") PORT_CODE(KEYCODE_Y) - PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("T [:]") PORT_CODE(KEYCODE_T) - PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("N [$]") PORT_CODE(KEYCODE_N) - PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("H [\"]") PORT_CODE(KEYCODE_H) - PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("B [>]") PORT_CODE(KEYCODE_B) + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_UNUSED) + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("1") PORT_CODE(KEYCODE_1) + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_UNUSED) + PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("4") PORT_CODE(KEYCODE_4) + PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_UNUSED) PORT_START("K4") - PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Z [.]") PORT_CODE(KEYCODE_Z) - PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("U [1]") PORT_CODE(KEYCODE_U) - PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("O [4]") PORT_CODE(KEYCODE_O) - PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("I [7]") PORT_CODE(KEYCODE_I) - PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("C [(]") PORT_CODE(KEYCODE_C) + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("0") PORT_CODE(KEYCODE_0) + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_UNUSED) + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_UNUSED) + PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_UNUSED) + PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_UNUSED) PORT_START("K5") - PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("DEL") PORT_CODE(KEYCODE_DEL) - PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("W [3]") PORT_CODE(KEYCODE_W) - PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Q [6]") PORT_CODE(KEYCODE_Q) - PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("K [9]") PORT_CODE(KEYCODE_K) - PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("E [%]") PORT_CODE(KEYCODE_E) + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME(".") PORT_CODE(KEYCODE_STOP) + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_UNUSED) + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_UNUSED) + PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_UNUSED) + PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_UNUSED) PORT_START("K6") - PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("EXE") PORT_CODE(KEYCODE_ENTER) - PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("X [+]") PORT_CODE(KEYCODE_X) - PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("R [-]") PORT_CODE(KEYCODE_R) - PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("L [*]") PORT_CODE(KEYCODE_L) - PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("F [/]") PORT_CODE(KEYCODE_F) + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_UNUSED) + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("3") PORT_CODE(KEYCODE_3) + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_UNUSED) + PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("6") PORT_CODE(KEYCODE_6) + PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_UNUSED) PORT_START("K7") - PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Space") PORT_CODE(KEYCODE_SPACE) - PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("V [2]") PORT_CODE(KEYCODE_V) - PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("P [5]") PORT_CODE(KEYCODE_P) - PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("J [8]") PORT_CODE(KEYCODE_J) - PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("D [)]") PORT_CODE(KEYCODE_D) + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_UNUSED) + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("2") PORT_CODE(KEYCODE_2) + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_UNUSED) + PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("5") PORT_CODE(KEYCODE_5) + PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_UNUSED) INPUT_PORTS_END void psion_state::machine_start() { - if (!strcmp(machine().system().name, "psionlam")) - { - m_rom_bank_count = 3; - m_ram_bank_count = 0; - } - else if (!strncmp(machine().system().name, "psionlz", 7)) - { - m_rom_bank_count = 3; - m_ram_bank_count = 3; - } - else if (!strcmp(machine().system().name, "psionp464")) - { - m_rom_bank_count = 3; - m_ram_bank_count = 9; - } - else if (!strncmp(machine().system().name, "psionp", 6)) - { - m_rom_bank_count = 0; - m_ram_bank_count = 5; - } - else - { - m_rom_bank_count = 0; - m_ram_bank_count = 0; - } + m_nvram->set_base(m_ram->pointer(), m_ram->size()); + + save_item(NAME(m_kb_counter)); + save_item(NAME(m_nmi_enable)); + save_item(NAME(m_pulse_enable)); +} + +void psion2_state::machine_start() +{ + psion_state::machine_start(); + + uint8_t *rom_base = memregion("maincpu")->base(); + uint32_t rom_size = memregion("maincpu")->bytes(); - if (m_rom_bank_count) + m_rombank_count = 0; + switch (rom_size) { - uint8_t* rom_base = (uint8_t *)memregion("maincpu")->base(); + case 0x8000: // 32K + m_rombank1->set_base(rom_base + 0x4000); + m_rombank2->set_base(rom_base); + break; + + default: // >= 64K + m_rombank_count = (rom_size - 0x4000) / 0x4000; - membank("rombank")->configure_entry(0, rom_base + 0x8000); - membank("rombank")->configure_entries(1, m_rom_bank_count-1, rom_base + 0x10000, 0x4000); - membank("rombank")->set_entry(0); + m_rombank1->set_base(rom_base + 0x4000); + m_rombank2->configure_entry(0, rom_base); + m_rombank2->configure_entries(1, m_rombank_count-1, rom_base + 0x8000, 0x4000); + m_rombank2->set_entry(0); + break; } - if (m_ram_bank_count) + m_rambank_count = 0; + switch (m_ram->size()) { - m_paged_ram = std::make_unique(m_ram_bank_count * 0x4000); - memset(m_paged_ram.get(), 0, sizeof(uint8_t) * (m_ram_bank_count * 0x4000)); - membank("rambank")->configure_entries(0, m_ram_bank_count, m_paged_ram.get(), 0x4000); - membank("rambank")->set_entry(0); - } + case 0x2000: // 8K + case 0x4000: // 16K + m_rambank1->set_base(m_ram->pointer()); + break; - m_nvram1->set_base(m_ram, m_ram.bytes()); - if (m_nvram2) - m_nvram2->set_base(m_paged_ram.get(), m_ram_bank_count * 0x4000); + case 0x8000: // 32K + m_rambank1->set_base(m_ram->pointer() + 0x0400); + m_rambank2->set_base(m_ram->pointer() + 0x4000); + break; - save_item(NAME(m_kb_counter)); - save_item(NAME(m_enable_nmi)); - save_item(NAME(m_pulse)); - save_item(NAME(m_rom_bank)); - save_item(NAME(m_ram_bank)); - save_pointer(NAME(m_paged_ram), m_ram_bank_count * 0x4000); + default: // >= 64K + m_rambank_count = (m_ram->size() - 0x4000) / 0x4000; + + m_rambank1->set_base(m_ram->pointer() + 0x0400); + m_rambank2->configure_entries(0, m_rambank_count, m_ram->pointer() + 0x4000, 0x4000); + m_rambank2->set_entry(0); + break; + } } void psion_state::machine_reset() { - m_enable_nmi = false; + m_nmi_enable = false; m_kb_counter = 0; - m_ram_bank = 0; - m_rom_bank = 0; - m_pulse = 0; - - if (m_rom_bank_count || m_ram_bank_count) - update_banks(); + m_pulse_enable = 0; } void psion1_state::machine_reset() { psion_state::machine_reset(); - m_enable_nmi = true; + + m_nmi_enable = true; +} + +void psion2_state::machine_reset() +{ + psion_state::machine_reset(); + + if (m_rambank_count) + m_rambank2->set_entry(0); + + if (m_rombank_count) + m_rombank2->set_entry(0); } -HD44780_PIXEL_UPDATE(psion_state::lz_pixel_update) + +HD44780_PIXEL_UPDATE(psion2_state::lz_pixel_update) { if (pos < 40) { @@ -524,67 +774,37 @@ static GFXDECODE_START( gfx_psion ) GFXDECODE_ENTRY( "hd44780:cgrom", 0x0000, psion_charlayout, 0, 1 ) GFXDECODE_END -/* basic configuration for 2 lines display */ -void psion_state::psion_2lines(machine_config &config) -{ - /* basic machine hardware */ - HD6303X(config, m_maincpu, 3.6864_MHz_XTAL); // internal operating frequency is 0.9216 MHz - m_maincpu->nvram_enable_backup(true); - m_maincpu->in_p2_cb().set(FUNC(psion_state::port2_r)); - m_maincpu->out_p2_cb().set(FUNC(psion_state::port2_w)); - m_maincpu->in_p5_cb().set(FUNC(psion_state::port5_r)); - m_maincpu->in_p6_cb().set(FUNC(psion_state::port6_r)); - m_maincpu->out_p6_cb().set(FUNC(psion_state::port6_w)); +void psion_state::psion_base(machine_config &config) +{ /* video hardware */ - screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_LCD)); - screen.set_refresh_hz(50); - screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500)); /* not accurate */ - screen.set_screen_update("hd44780", FUNC(hd44780_device::screen_update)); - screen.set_size(6*16, 9*2); - screen.set_visarea_full(); - screen.set_palette("palette"); + SCREEN(config, m_screen, SCREEN_TYPE_LCD); + m_screen->set_refresh_hz(50); + m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(2500)); /* not accurate */ + m_screen->set_screen_update("hd44780", FUNC(hd44780_device::screen_update)); + m_screen->set_palette("palette"); PALETTE(config, "palette", FUNC(psion_state::psion_palette), 2); GFXDECODE(config, "gfxdecode", "palette", gfx_psion); - HD44780(config, m_lcdc, 270'000); // TODO: Wrong device? Custom? clock not measured, datasheet typical clock used - m_lcdc->set_lcd_size(2, 16); + HD44780(config, m_lcdc, 270'000); // TODO: clock not measured, datasheet typical clock used /* sound hardware */ SPEAKER(config, "mono").front_center(); BEEP(config, m_beep, 3250).add_route(ALL_OUTPUTS, "mono", 1.00); - NVRAM(config, "nvram1", nvram_device::DEFAULT_ALL_0); // RAM - - TIMER(config, "nmi_timer").configure_periodic(FUNC(psion_state::nmi_timer), attotime::from_seconds(1)); + NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); // RAM /* Datapack */ - PSION_DATAPACK(config, m_pack1, 0); - PSION_DATAPACK(config, m_pack2, 0); - - /* Software lists */ - SOFTWARE_LIST(config, "pack_list").set_original("psion2"); -} - -/* basic configuration for 4 lines display */ -void psion_state::psion_4lines(machine_config &config) -{ - psion_2lines(config); - - /* video hardware */ - subdevice("screen")->set_size(6*20, 9*4); - subdevice("screen")->set_visarea_full(); - - m_lcdc->set_lcd_size(4, 20); - m_lcdc->set_pixel_update_cb(FUNC(psion_state::lz_pixel_update)); + PSION_DATAPACK(config, m_pack[0]).set_interface("psion_pack"); + PSION_DATAPACK(config, m_pack[1]).set_interface("psion_pack"); } void psion1_state::psion1(machine_config &config) { - psion_2lines(config); + psion_base(config); - HD6301X0(config.replace(), m_maincpu, 3.6864_MHz_XTAL); + HD6301X0(config, m_maincpu, 3.6864_MHz_XTAL); m_maincpu->set_addrmap(AS_PROGRAM, &psion1_state::psion1_mem); m_maincpu->nvram_enable_backup(true); m_maincpu->in_p2_cb().set(FUNC(psion1_state::port2_r)); @@ -593,192 +813,295 @@ void psion1_state::psion1(machine_config &config) m_maincpu->in_p6_cb().set(FUNC(psion1_state::port6_r)); m_maincpu->out_p6_cb().set(FUNC(psion1_state::port6_w)); - timer_device &nmi_timer(TIMER(config.replace(), "nmi_timer")); + RAM(config, m_ram).set_default_size("2K"); + + timer_device &nmi_timer(TIMER(config, "nmi_timer")); nmi_timer.configure_periodic(FUNC(psion1_state::nmi_timer), attotime::from_msec(500)); nmi_timer.set_start_delay(attotime::from_seconds(1)); - subdevice("screen")->set_size(6*16, 1*8); - subdevice("screen")->set_visarea_full(); + m_screen->set_size(6*16, 1*8); + m_screen->set_visarea_full(); m_lcdc->set_lcd_size(1, 16); m_lcdc->set_pixel_update_cb(FUNC(psion1_state::psion1_pixel_update)); - /* Software lists */ - SOFTWARE_LIST(config.replace(), "pack_list").set_original("psion1"); + SOFTWARE_LIST(config, "pack_list").set_original("psion1"); } -void psion_state::psioncm(machine_config &config) +void psion2_state::psion2(machine_config &config) { - psion_2lines(config); + psion_base(config); + + HD6303X(config, m_maincpu, 3.6864_MHz_XTAL); // internal operating frequency is 0.9216 MHz + m_maincpu->nvram_enable_backup(true); + m_maincpu->in_p2_cb().set(FUNC(psion2_state::port2_r)); + m_maincpu->out_p2_cb().set(FUNC(psion2_state::port2_w)); + m_maincpu->in_p5_cb().set(FUNC(psion2_state::port5_r)); + m_maincpu->in_p6_cb().set(FUNC(psion2_state::port6_r)); + m_maincpu->out_p6_cb().set(FUNC(psion2_state::port6_w)); + + RAM(config, m_ram).set_default_size("32K"); + + m_screen->set_size(6*16, 9*2); + m_screen->set_visarea_full(); + + m_lcdc->set_lcd_size(2, 16); + + TIMER(config, "nmi_timer").configure_periodic(FUNC(psion2_state::nmi_timer), attotime::from_seconds(1)); - m_maincpu->set_addrmap(AS_PROGRAM, &psion_state::psioncm_mem); + PSION_DATAPACK(config, m_topslot).set_interface("psion_topslot"); + + SOFTWARE_LIST(config, "pack_list").set_original("psion2"); } -void psion_state::psionla(machine_config &config) +void psion2_state::psioncm(machine_config &config) { - psion_2lines(config); + psion2(config); + + m_maincpu->set_addrmap(AS_PROGRAM, &psion2_state::psioncm_mem); + + m_ram->set_default_size("8K"); - m_maincpu->set_addrmap(AS_PROGRAM, &psion_state::psionla_mem); + subdevice("pack_list")->set_filter("CM"); } -void psion_state::psionlam(machine_config &config) +void psion2_state::psionxp(machine_config &config) { - psion_2lines(config); + psion2(config); - m_maincpu->set_addrmap(AS_PROGRAM, &psion_state::psionlam_mem); + m_maincpu->set_addrmap(AS_PROGRAM, &psion2_state::psionxp_mem); + + m_ram->set_default_size("16K"); + + subdevice("pack_list")->set_filter("XP"); } -void psion_state::psionp350(machine_config &config) +void psion2_state::psionla(machine_config &config) { - psion_2lines(config); + psionxp(config); + + m_maincpu->set_addrmap(AS_PROGRAM, &psion2_state::psionla_mem); - m_maincpu->set_addrmap(AS_PROGRAM, &psion_state::psionp350_mem); + m_ram->set_default_size("32K"); +} + +void psion2_state::psionp200(machine_config &config) +{ + psionla(config); - NVRAM(config, "nvram2", nvram_device::DEFAULT_ALL_0); // paged RAM + subdevice("pack_list")->set_filter("POS"); } -void psion_state::psionlz(machine_config &config) +void psion2_state::psionp350(machine_config &config) { - psion_4lines(config); + psionla(config); + + m_ram->set_default_size("96K"); - m_maincpu->set_addrmap(AS_PROGRAM, &psion_state::psionlz_mem); + subdevice("pack_list")->set_filter("POS"); +} + +void psion2_state::psionlz(machine_config &config) +{ + psionla(config); + + /* video hardware */ + m_screen->set_size(6*20, 9*4); + m_screen->set_visarea_full(); + + m_lcdc->set_lcd_size(4, 20); + m_lcdc->set_pixel_update_cb(FUNC(psion2_state::lz_pixel_update)); + + subdevice("pack_list")->set_filter("LZ"); +} + +void psion2_state::psionlz64(machine_config &config) +{ + psionlz(config); + + m_ram->set_default_size("64K"); + + subdevice("pack_list")->set_filter("LZ,LZ64"); +} + +void psion2_state::psionp432(machine_config &config) +{ + psionlz(config); - NVRAM(config, "nvram2", nvram_device::DEFAULT_ALL_0); // paged RAM + subdevice("pack_list")->set_filter("POS"); +} + +void psion2_state::psionp464(machine_config &config) +{ + psionlz64(config); + + subdevice("pack_list")->set_filter("POS"); } /* ROM definition */ ROM_START( psion1 ) ROM_REGION( 0x1000, "maincpu", ROMREGION_ERASEFF ) - ROM_SYSTEM_BIOS(0, "v1", "Organiser I") - ROMX_LOAD( "psion1.rom", 0x0000, 0x1000, CRC(7e2609c1) SHA1(a3320ea8ac3ab9e0039ee16f7c571731adde5869), ROM_BIOS(0)) + ROM_LOAD("psion1.rom", 0x0000, 0x1000, CRC(7e2609c1) SHA1(a3320ea8ac3ab9e0039ee16f7c571731adde5869)) ROM_END ROM_START( psioncm ) - ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASEFF ) + ROM_REGION( 0x8000, "maincpu", ROMREGION_ERASEFF ) + ROM_DEFAULT_BIOS( "v33" ) ROM_SYSTEM_BIOS(0, "v24", "CM v2.4") - ROMX_LOAD("24-cm.dat", 0x8000, 0x8000, CRC(f6798394) SHA1(736997f0db9a9ee50d6785636bdc3f8ff1c33c66), ROM_BIOS(0)) + ROMX_LOAD("24-cm.rom", 0x0000, 0x8000, CRC(f6798394) SHA1(736997f0db9a9ee50d6785636bdc3f8ff1c33c66), ROM_BIOS(0)) ROM_SYSTEM_BIOS(1, "v26", "CM v2.6") - ROMX_LOAD("26-cm.rom", 0x8000, 0x8000, CRC(21b7c94c) SHA1(e0a3168c96a3f0b37b8698e86574e40597fe3c62), ROM_BIOS(1)) + ROMX_LOAD("26-cm.rom", 0x0000, 0x8000, CRC(21b7c94c) SHA1(e0a3168c96a3f0b37b8698e86574e40597fe3c62), ROM_BIOS(1)) ROM_SYSTEM_BIOS(2, "v33", "CM v3.3") - ROMX_LOAD("33-cm.rom", 0x8000, 0x8000, CRC(5c10b167) SHA1(6deea00fe648bddae1d61a22858023bc80277ea0), ROM_BIOS(2)) - ROM_SYSTEM_BIOS(3, "v33f","CM v3.3 French") - ROMX_LOAD("33-cmf.rom", 0x8000, 0x8000, CRC(4d626ce2) SHA1(82b96f11a0abfc1931b6022b84733d975ad7ab2b), ROM_BIOS(3)) - ROM_SYSTEM_BIOS(4, "v36f","CM v3.6 French") - ROMX_LOAD("36-cmf.rom", 0x8000, 0x8000, CRC(beabe0f5) SHA1(a5ef3bb92190a257cb0e94d58b2c23935436edeb), ROM_BIOS(4)) + ROMX_LOAD("33-cm.rom", 0x0000, 0x8000, CRC(5c10b167) SHA1(6deea00fe648bddae1d61a22858023bc80277ea0), ROM_BIOS(2)) + ROM_SYSTEM_BIOS(3, "v33f", "CM v3.3 French") + ROMX_LOAD("33-cmf.rom", 0x0000, 0x8000, CRC(4d626ce2) SHA1(82b96f11a0abfc1931b6022b84733d975ad7ab2b), ROM_BIOS(3)) + ROM_SYSTEM_BIOS(4, "v36f", "CM v3.6 French") + ROMX_LOAD("36-cmf.rom", 0x0000, 0x8000, CRC(beabe0f5) SHA1(a5ef3bb92190a257cb0e94d58b2c23935436edeb), ROM_BIOS(4)) ROM_END ROM_START( psionxp ) - ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASEFF ) - ROM_SYSTEM_BIOS(0, "v26", "XP v2.6") - ROMX_LOAD( "26-xp.rom", 0x8000, 0x8000, CRC(a81db40f) SHA1(af72d94ccee1fa1dade8776bdbd39920665a68b7), ROM_BIOS(0) ) + ROM_REGION( 0x8000, "maincpu", ROMREGION_ERASEFF ) + ROM_DEFAULT_BIOS( "v31" ) + ROM_SYSTEM_BIOS(0, "v24", "XP v2.4") + ROMX_LOAD("24-xp.rom", 0x0000, 0x8000, CRC(3407062c) SHA1(c3818f3f0865cc235905bd7ef6cba325e44fa076), ROM_BIOS(0)) + ROM_SYSTEM_BIOS(1, "v26", "XP v2.6") + ROMX_LOAD("26-xp.rom", 0x0000, 0x8000, CRC(a81db40f) SHA1(af72d94ccee1fa1dade8776bdbd39920665a68b7), ROM_BIOS(1)) + ROM_SYSTEM_BIOS(2, "v31", "XP v3.1") + ROMX_LOAD("31-xp.rom", 0x0000, 0x8000, CRC(cb10b6bf) SHA1(af5e82f62a149ff0dfa6e60414c928649a2abaaa), ROM_BIOS(2)) ROM_END ROM_START( psionla ) - ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASEFF ) - ROM_SYSTEM_BIOS(0, "v33", "LA v3.3") - ROMX_LOAD("33-la.dat", 0x8000, 0x8000, CRC(02668ed4) SHA1(e5d4ee6b1cde310a2970ffcc6f29a0ce09b08c46), ROM_BIOS(0)) - ROM_SYSTEM_BIOS(1, "v34g", "LA v3.4 German") - ROMX_LOAD("34-lag.rom", 0x8000, 0x8000, CRC(13a92c4b) SHA1(dab8bd6a41a5fd509c5ad4b0b0ab80d14f2c421a), ROM_BIOS(1)) - ROM_SYSTEM_BIOS(2, "v36", "LA v3.6") - ROMX_LOAD("36-la.rom", 0x8000, 0x8000, CRC(7442c7f6) SHA1(94f15bd06bd750be70fa4a4ab588237c5a703f65), ROM_BIOS(2)) - ROM_SYSTEM_BIOS(3, "v30", "LA v3.0") - ROMX_LOAD("30-lahp.rom", 0x8000, 0x8000, CRC(50192528) SHA1(c556d53f70bf5ecae756b2ebfc6d954912316bbe), ROM_BIOS(3)) + ROM_REGION( 0x8000, "maincpu", ROMREGION_ERASEFF ) + ROM_DEFAULT_BIOS( "v36" ) + ROM_SYSTEM_BIOS(0, "v30hp", "LA v3.0 Hand Held Products") + ROMX_LOAD("30-lahp.rom", 0x0000, 0x8000, CRC(50192528) SHA1(c556d53f70bf5ecae756b2ebfc6d954912316bbe), ROM_BIOS(0)) + ROM_SYSTEM_BIOS(1, "v33", "LA v3.3") + ROMX_LOAD("33-la.rom", 0x0000, 0x8000, CRC(02668ed4) SHA1(e5d4ee6b1cde310a2970ffcc6f29a0ce09b08c46), ROM_BIOS(1)) + ROM_SYSTEM_BIOS(2, "v34g", "LA v3.4 German") + ROMX_LOAD("34-lag.rom", 0x0000, 0x8000, CRC(13a92c4b) SHA1(dab8bd6a41a5fd509c5ad4b0b0ab80d14f2c421a), ROM_BIOS(2)) + ROM_SYSTEM_BIOS(3, "v36", "LA v3.6") + ROMX_LOAD("36-la.rom", 0x0000, 0x8000, CRC(7442c7f6) SHA1(94f15bd06bd750be70fa4a4ab588237c5a703f65), ROM_BIOS(3)) ROM_SYSTEM_BIOS(4, "v36f", "LA v3.6 French") - ROMX_LOAD("36-laf.rom", 0x8000, 0x8000, CRC(036ef00e) SHA1(98f303273e570e94a1e25a58cf1ffcec0db32165), ROM_BIOS(4)) + ROMX_LOAD("36-laf.rom", 0x0000, 0x8000, CRC(036ef00e) SHA1(98f303273e570e94a1e25a58cf1ffcec0db32165), ROM_BIOS(4)) + ROM_SYSTEM_BIOS(5, "v36g", "LA v3.6 German") + ROMX_LOAD("36-lag.rom", 0x0000, 0x8000, CRC(33c6b4d4) SHA1(81d665ce0fa325996d52004655349162093d60a6), ROM_BIOS(5)) ROM_END -ROM_START( psionp200 ) +ROM_START( psionlam ) ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASEFF ) - ROM_SYSTEM_BIOS(0, "v33", "POS200a v3.3") - ROMX_LOAD("33-p200a.rom", 0x8000, 0x8000, CRC(91e94998) SHA1(e9e8106eb9283d20452697859894aa407cc07bd1), ROM_BIOS(0)) - ROM_SYSTEM_BIOS(1, "v36", "POS200 v3.6") - ROMX_LOAD("36-p200.rom", 0x8000, 0x8000, CRC(4569ef5b) SHA1(8c275474cc6e3f50156f0b6e32121cadd14ea8be), ROM_BIOS(1)) - ROM_SYSTEM_BIOS(2, "v36a", "POS200a v3.6") - ROMX_LOAD("36-p200a.rom", 0x8000, 0x8000, CRC(36cceeb7) SHA1(57069812c5a16babfff91dc7d7e0842e5dc68652), ROM_BIOS(2)) - ROM_SYSTEM_BIOS(3, "v36b", "POS250 v3.6") - ROMX_LOAD("36-p250.rom", 0x8000, 0x8000, CRC(235cc76a) SHA1(3229cdff4b049a1fbf9a758ce3abf3fdc9b547c9), ROM_BIOS(3)) + ROM_SYSTEM_BIOS(0, "v37", "LA v3.7 Multilingual") + ROMX_LOAD("37-lam.dat", 0x0000, 0x10000, CRC(7ee3a1bc) SHA1(c7fbd6c8e47c9b7d5f636e9f56e911b363d6796b), ROM_BIOS(0)) ROM_END -ROM_START( psionp350 ) - ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASEFF ) - ROM_SYSTEM_BIOS(0, "v36", "POS350 v3.6") - ROMX_LOAD("36-p350.dat", 0x8000, 0x8000, CRC(3a371a74) SHA1(9167210b2c0c3bd196afc08ca44ab23e4e62635e), ROM_BIOS(0)) - ROM_SYSTEM_BIOS(1, "v38", "POS350 v3.8") - ROMX_LOAD("38-p350.dat", 0x8000, 0x8000, CRC(1b8b082f) SHA1(a3e875a59860e344f304a831148a7980f28eaa4a), ROM_BIOS(1)) +ROM_START( psionp200 ) + ROM_REGION( 0x8000, "maincpu", ROMREGION_ERASEFF ) + ROM_SYSTEM_BIOS(0, "v36", "POS 200 v3.6") + ROMX_LOAD("36-p200.rom", 0x0000, 0x8000, CRC(4569ef5b) SHA1(8c275474cc6e3f50156f0b6e32121cadd14ea8be), ROM_BIOS(0)) ROM_END -ROM_START( psionlam ) - ROM_REGION( 0x18000, "maincpu", ROMREGION_ERASEFF ) - ROM_SYSTEM_BIOS(0, "v37", "LA v3.7") - ROMX_LOAD("37-lam.dat", 0x8000, 0x10000, CRC(7ee3a1bc) SHA1(c7fbd6c8e47c9b7d5f636e9f56e911b363d6796b), ROM_BIOS(0)) +ROM_START( psionp200a ) + ROM_REGION( 0x8000, "maincpu", ROMREGION_ERASEFF ) + ROM_DEFAULT_BIOS( "v36" ) + ROM_SYSTEM_BIOS(0, "v33", "Alpha POS 200 v3.3") + ROMX_LOAD("33-p200a.rom", 0x0000, 0x8000, CRC(91e94998) SHA1(e9e8106eb9283d20452697859894aa407cc07bd1), ROM_BIOS(0)) + ROM_SYSTEM_BIOS(1, "v36", "Alpha POS 200 v3.6") + ROMX_LOAD("36-p200a.rom", 0x0000, 0x8000, CRC(36cceeb7) SHA1(57069812c5a16babfff91dc7d7e0842e5dc68652), ROM_BIOS(1)) ROM_END -ROM_START( psionlz64 ) - ROM_REGION( 0x18000, "maincpu", ROMREGION_ERASEFF ) - ROM_SYSTEM_BIOS(0, "v44", "LZ64 v4.4") - ROMX_LOAD("44-lz64.dat", 0x8000, 0x10000, CRC(aa487913) SHA1(5a44390f63fc8c1bc94299ab2eb291bc3a5b989a), ROM_BIOS(0)) - ROM_SYSTEM_BIOS(1, "v46si", "LZ64 v4.6 Spanish / Italian") - ROMX_LOAD("46-lz64i.rom", 0x8000, 0x10000, CRC(c96c7e65) SHA1(1b4af43657bbd3ecd92f370762bde166047b85e2), ROM_BIOS(1)) - ROM_SYSTEM_BIOS(2, "v43", "LZ64 v4.3") - ROMX_LOAD("43-lz64.rom", 0x8000, 0x10000, CRC(57e7a372) SHA1(46c2da1cfe991c0c1f2486e4aa28388767937ddd), ROM_BIOS(2)) - ROM_SYSTEM_BIOS(3, "v46a", "LZ64 v4.6a") - ROMX_LOAD("46a-lz64.rom", 0x8000, 0x10000, CRC(9b0d5a7a) SHA1(f1cdd6ef43cd65ef18e148deca0500f0c1ad2f80), ROM_BIOS(3)) - ROM_SYSTEM_BIOS(4, "v46b", "LZ64 v4.6b") - ROMX_LOAD("46b-lz64.rom", 0x8000, 0x10000, CRC(8d1101e2) SHA1(eddd0c3a2881667a1485b0d66f82f8c7792995c2), ROM_BIOS(4)) - ROM_SYSTEM_BIOS(5, "v45", "LZ64 v4.5") - ROMX_LOAD("45-lz64.rom", 0x8000, 0x10000, CRC(4fbd5d88) SHA1(43f97549d2060840aa6313d526000530f384a08f), ROM_BIOS(5)) +ROM_START( psionp250 ) + ROM_REGION( 0x8000, "maincpu", ROMREGION_ERASEFF ) + ROM_SYSTEM_BIOS(0, "v36b", "POS 250 v3.6") + ROMX_LOAD("36-p250.rom", 0x0000, 0x8000, CRC(235cc76a) SHA1(3229cdff4b049a1fbf9a758ce3abf3fdc9b547c9), ROM_BIOS(0)) +ROM_END + +ROM_START( psionp350 ) + ROM_REGION( 0x8000, "maincpu", ROMREGION_ERASEFF ) + ROM_DEFAULT_BIOS( "v36" ) + ROM_SYSTEM_BIOS(0, "v36", "POS 350 v3.6") + ROMX_LOAD("36-p350.rom", 0x0000, 0x8000, CRC(3a371a74) SHA1(9167210b2c0c3bd196afc08ca44ab23e4e62635e), ROM_BIOS(0)) + ROM_SYSTEM_BIOS(1, "v38", "POS 350 v3.8") + ROMX_LOAD("38-p350.rom", 0x0000, 0x8000, CRC(1b8b082f) SHA1(a3e875a59860e344f304a831148a7980f28eaa4a), ROM_BIOS(1)) +ROM_END + +ROM_START( psionlz ) + ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASEFF ) + ROM_DEFAULT_BIOS( "v46" ) + ROM_SYSTEM_BIOS(0, "v42", "LZ v4.2 English, French, German") + ROMX_LOAD("42-lz.rom", 0x0000, 0x10000, CRC(f2d6ad47) SHA1(ee8315ae872463068d805c6e0b71f62ae8eb65be), ROM_BIOS(0)) + ROM_SYSTEM_BIOS(1, "v44", "LZ v4.4 English, French, German") + ROMX_LOAD("44-lz.rom", 0x0000, 0x10000, CRC(4a0a990b) SHA1(dde0ba69a4a7f02b610ad6bd69a8b8552b060223), ROM_BIOS(1)) + ROM_SYSTEM_BIOS(2, "v45", "LZ v4.5 English, French, German") + ROMX_LOAD("45-lz.rom", 0x0000, 0x10000, CRC(f95d8f39) SHA1(cb64152c2418bf730c89999d1b13c1d1ada1f082), ROM_BIOS(2)) + ROM_SYSTEM_BIOS(3, "v45i", "LZ v4.5 English, Spanish, Italian") + ROMX_LOAD("45-lzi.rom", 0x0000, 0x10000, CRC(202b556d) SHA1(39f061c4b94a1371bfe62484828a8ce424d7315c), ROM_BIOS(3)) + ROM_SYSTEM_BIOS(4, "v45s", "LZ v4.5 English, Swedish, Danish") + ROMX_LOAD("45-lzs.rom", 0x0000, 0x10000, CRC(2d082d7f) SHA1(fcd00864a0cc617e61997240945ea70a8e9fa211), ROM_BIOS(4)) + ROM_SYSTEM_BIOS(5, "v46", "LZ v4.6 English, French, German") + ROMX_LOAD("46-lz.rom", 0x0000, 0x10000, CRC(22715f48) SHA1(cf460c81cadb53eddb7afd8dadecbe8c38ea3fc2), ROM_BIOS(5)) + ROM_SYSTEM_BIOS(6, "v46i", "LZ v4.6 English, Spanish, Italian") + ROMX_LOAD("46-lzi.rom", 0x0000, 0x10000, CRC(ee50b6e9) SHA1(f1821ad179b018d6b22129ef4e8e8b23f452b2f6), ROM_BIOS(6)) ROM_REGION( 0x1000, "hd44780", 0 ) - ROM_LOAD("psion_lz_charset.bin", 0x0000, 0x1000, BAD_DUMP CRC(44bff6f6) SHA1(aef544548b783d608a7d55456f6c46f421a11ed7)) + ROM_LOAD("psion_lz_charset.bin", 0x0000, 0x1000, BAD_DUMP CRC(44bff6f6) SHA1(aef544548b783d608a7d55456f6c46f421a11ed7)) ROM_END -ROM_START( psionlz64s ) - ROM_REGION( 0x18000, "maincpu", ROMREGION_ERASEFF ) - ROM_SYSTEM_BIOS(0, "v46", "LZ64 v4.6") - ROMX_LOAD("46-lz64s.dat", 0x8000, 0x10000, CRC(328d9772) SHA1(7f9e2d591d59ecfb0822d7067c2fe59542ea16dd), ROM_BIOS(0)) +ROM_START( psionlz64 ) + ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASEFF ) + ROM_DEFAULT_BIOS( "v46a" ) + ROM_SYSTEM_BIOS(0, "v42", "LZ64 v4.2 English, French, German") + ROMX_LOAD("42-lz64.rom", 0x0000, 0x10000, CRC(2df76f5a) SHA1(4255bc2abfc6f6cb666c0464a86d4ac98050268e), ROM_BIOS(0)) + ROM_SYSTEM_BIOS(1, "v43", "LZ64 v4.3 English, French, German") + ROMX_LOAD("43-lz64.rom", 0x0000, 0x10000, CRC(57e7a372) SHA1(46c2da1cfe991c0c1f2486e4aa28388767937ddd), ROM_BIOS(1)) + ROM_SYSTEM_BIOS(2, "v44", "LZ64 v4.4 English, French, German") + ROMX_LOAD("44-lz64.rom", 0x0000, 0x10000, CRC(aa487913) SHA1(5a44390f63fc8c1bc94299ab2eb291bc3a5b989a), ROM_BIOS(2)) + ROM_SYSTEM_BIOS(3, "v45", "LZ64 v4.5 English, French, German") + ROMX_LOAD("45-lz64.rom", 0x0000, 0x10000, CRC(4fbd5d88) SHA1(43f97549d2060840aa6313d526000530f384a08f), ROM_BIOS(3)) + ROM_SYSTEM_BIOS(4, "v46a", "LZ64 v4.6a English, French, German") + ROMX_LOAD("46a-lz64.rom", 0x0000, 0x10000, CRC(9b0d5a7a) SHA1(f1cdd6ef43cd65ef18e148deca0500f0c1ad2f80), ROM_BIOS(4)) + ROM_SYSTEM_BIOS(5, "v46b", "LZ64 v4.6b English, French, German") + ROMX_LOAD("46b-lz64.rom", 0x0000, 0x10000, CRC(8d1101e2) SHA1(eddd0c3a2881667a1485b0d66f82f8c7792995c2), ROM_BIOS(5)) + ROM_SYSTEM_BIOS(6, "v46i", "LZ64 v4.6 English, Spanish, Italian") + ROMX_LOAD("46-lz64i.rom", 0x0000, 0x10000, CRC(c96c7e65) SHA1(1b4af43657bbd3ecd92f370762bde166047b85e2), ROM_BIOS(6)) + ROM_SYSTEM_BIOS(7, "v46s", "LZ64 v4.6 English, Swedish, Danish") + ROMX_LOAD("46-lz64s.rom", 0x0000, 0x10000, CRC(328d9772) SHA1(7f9e2d591d59ecfb0822d7067c2fe59542ea16dd), ROM_BIOS(7)) ROM_REGION( 0x1000, "hd44780", 0 ) - ROM_LOAD("psion_lz_charset.bin", 0x0000, 0x1000, BAD_DUMP CRC(44bff6f6) SHA1(aef544548b783d608a7d55456f6c46f421a11ed7)) + ROM_LOAD("psion_lz_charset.bin", 0x0000, 0x1000, BAD_DUMP CRC(44bff6f6) SHA1(aef544548b783d608a7d55456f6c46f421a11ed7)) ROM_END -ROM_START( psionlz ) - ROM_REGION( 0x18000, "maincpu", ROMREGION_ERASEFF ) - ROM_SYSTEM_BIOS(0, "v46", "LZ v4.6") - ROMX_LOAD("46-lz.dat", 0x8000, 0x10000, CRC(22715f48) SHA1(cf460c81cadb53eddb7afd8dadecbe8c38ea3fc2), ROM_BIOS(0)) - ROM_SYSTEM_BIOS(1, "v42", "LZ v4.2") - ROMX_LOAD("42-lz.rom", 0x8000, 0x10000, CRC(f2d6ad47) SHA1(ee8315ae872463068d805c6e0b71f62ae8eb65be), ROM_BIOS(1)) - ROM_SYSTEM_BIOS(2, "v44", "LZ v4.4") - ROMX_LOAD("44-lz.rom", 0x8000, 0x10000, CRC(4a0a990b) SHA1(dde0ba69a4a7f02b610ad6bd69a8b8552b060223), ROM_BIOS(2)) - ROM_SYSTEM_BIOS(3, "v45", "LZ v4.5") - ROMX_LOAD("45-lz.rom", 0x8000, 0x10000, CRC(f95d8f39) SHA1(cb64152c2418bf730c89999d1b13c1d1ada1f082), ROM_BIOS(3)) - ROM_SYSTEM_BIOS(4, "v45s", "LZ v4.5S") - ROMX_LOAD("45-lzs.rom", 0x8000, 0x10000, CRC(2d082d7f) SHA1(fcd00864a0cc617e61997240945ea70a8e9fa211), ROM_BIOS(4)) +ROM_START( psionp432 ) + ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASEFF ) + ROM_SYSTEM_BIOS(0, "v46", "POS432 v4.6") + ROMX_LOAD("46-p432n.rom", 0x0000, 0x10000, CRC(6683737a) SHA1(2c6bd9938f1b1d762adc8d45802c24f007e3445a), ROM_BIOS(0)) ROM_REGION( 0x1000, "hd44780", 0 ) - ROM_LOAD("psion_lz_charset.bin", 0x0000, 0x1000, BAD_DUMP CRC(44bff6f6) SHA1(aef544548b783d608a7d55456f6c46f421a11ed7)) + ROM_LOAD("psion_lz_charset.bin", 0x0000, 0x1000, BAD_DUMP CRC(44bff6f6) SHA1(aef544548b783d608a7d55456f6c46f421a11ed7)) ROM_END ROM_START( psionp464 ) - ROM_REGION( 0x18000, "maincpu", ROMREGION_ERASEFF ) + ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASEFF ) ROM_SYSTEM_BIOS(0, "v46", "POS464 v4.6") - ROMX_LOAD( "46-p464.dat", 0x8000, 0x10000, CRC(672a0945) SHA1(d2a6e3fe1019d1bd7ae4725e33a0b9973f8cd7d8), ROM_BIOS(0)) + ROMX_LOAD("46-p464.rom", 0x0000, 0x10000, CRC(672a0945) SHA1(d2a6e3fe1019d1bd7ae4725e33a0b9973f8cd7d8), ROM_BIOS(0)) ROM_REGION( 0x1000, "hd44780", 0 ) - ROM_LOAD( "psion_lz_charset.bin", 0x0000, 0x1000, BAD_DUMP CRC(44bff6f6) SHA1(aef544548b783d608a7d55456f6c46f421a11ed7)) + ROM_LOAD("psion_lz_charset.bin", 0x0000, 0x1000, BAD_DUMP CRC(44bff6f6) SHA1(aef544548b783d608a7d55456f6c46f421a11ed7)) ROM_END -/* Driver */ - -// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS -COMP( 1984, psion1, 0, 0, psion1, psion1, psion1_state, empty_init, "Psion", "Organiser I", MACHINE_NOT_WORKING ) -COMP( 1986, psioncm, 0, 0, psioncm, psion, psion_state, empty_init, "Psion", "Organiser II CM", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_GRAPHICS ) -COMP( 1986, psionla, psioncm, 0, psionla, psion, psion_state, empty_init, "Psion", "Organiser II LA", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_GRAPHICS ) -COMP( 1986, psionxp, psioncm, 0, psionla, psion, psion_state, empty_init, "Psion", "Organiser II XP", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_GRAPHICS ) -COMP( 1986, psionp200, psioncm, 0, psionp350, psion, psion_state, empty_init, "Psion", "Organiser II P200", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_GRAPHICS ) -COMP( 1986, psionp350, psioncm, 0, psionp350, psion, psion_state, empty_init, "Psion", "Organiser II P350", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_GRAPHICS ) -COMP( 1986, psionlam, psioncm, 0, psionlam, psion, psion_state, empty_init, "Psion", "Organiser II LAM", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_GRAPHICS ) -COMP( 1989, psionlz, 0, 0, psionlz, psion, psion_state, empty_init, "Psion", "Organiser II LZ", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_GRAPHICS ) -COMP( 1989, psionlz64, psionlz, 0, psionlz, psion, psion_state, empty_init, "Psion", "Organiser II LZ64", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_GRAPHICS ) -COMP( 1989, psionlz64s, psionlz, 0, psionlz, psion, psion_state, empty_init, "Psion", "Organiser II LZ64S", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_GRAPHICS ) -COMP( 1989, psionp464, psionlz, 0, psionlz, psion, psion_state, empty_init, "Psion", "Organiser II P464", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_GRAPHICS ) +} // anonymous namespace + + +// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS +COMP( 1984, psion1, 0, 0, psion1, psion1, psion1_state, empty_init, "Psion", "Organiser I", MACHINE_NOT_WORKING ) +COMP( 1986, psioncm, 0, 0, psioncm, psion2, psion2_state, empty_init, "Psion", "Organiser II CM", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_GRAPHICS ) +COMP( 1986, psionxp, psioncm, 0, psionxp, psion2, psion2_state, empty_init, "Psion", "Organiser II XP", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_GRAPHICS ) +COMP( 1986, psionla, psioncm, 0, psionla, psion2, psion2_state, empty_init, "Psion", "Organiser II LA", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_GRAPHICS ) +COMP( 1986, psionlam, psioncm, 0, psionla, psion2, psion2_state, empty_init, "Psion", "Organiser II LA Multilingual", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_GRAPHICS ) +COMP( 1986, psionp200, psioncm, 0, psionp200, psion2n, psion2_state, empty_init, "Psion", "Organiser II POS 200", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_GRAPHICS ) +COMP( 1986, psionp200a, psioncm, 0, psionp200, psion2a, psion2_state, empty_init, "Psion", "Organiser II Alpha POS 200", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_GRAPHICS ) +COMP( 1986, psionp250, psioncm, 0, psionp200, psion2, psion2_state, empty_init, "Psion", "Organiser II P 250", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_GRAPHICS ) +COMP( 1986, psionp350, psioncm, 0, psionp350, psion2, psion2_state, empty_init, "Psion", "Organiser II P 350", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_GRAPHICS ) +COMP( 1989, psionlz, 0, 0, psionlz, psion2, psion2_state, empty_init, "Psion", "Organiser II LZ", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_GRAPHICS ) +COMP( 1989, psionlz64, psionlz, 0, psionlz64, psion2, psion2_state, empty_init, "Psion", "Organiser II LZ64", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_GRAPHICS ) +COMP( 1989, psionp432, psionlz, 0, psionp432, psion2n, psion2_state, empty_init, "Psion", "Organiser II P 432", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_GRAPHICS ) +COMP( 1989, psionp464, psionlz, 0, psionp464, psion2, psion2_state, empty_init, "Psion", "Organiser II P 464", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_GRAPHICS ) diff --git a/src/mame/psion/psion.h b/src/mame/psion/psion.h deleted file mode 100644 index c77f6b134fe7d..0000000000000 --- a/src/mame/psion/psion.h +++ /dev/null @@ -1,120 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Sandro Ronco -/*************************************************************************** - - Psion Organiser II series - -****************************************************************************/ -#ifndef MAME_PSION_PSION_H -#define MAME_PSION_PSION_H - -#pragma once - -#include "cpu/m6800/m6801.h" -#include "machine/nvram.h" -#include "psion_pack.h" -#include "machine/timer.h" -#include "video/hd44780.h" -#include "sound/beep.h" -#include "emupal.h" - - -// ======================> psion_state - -class psion_state : public driver_device -{ -public: - psion_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag) - , m_maincpu(*this, "maincpu") - , m_lcdc(*this, "hd44780") - , m_beep(*this, "beeper") - , m_pack1(*this, "pack1") - , m_pack2(*this, "pack2") - , m_nvram1(*this, "nvram1") - , m_nvram2(*this, "nvram2") - , m_ram(*this, "ram") - , m_kb_lines(*this, "K%u", 1U) - { } - - void psion_2lines(machine_config &config); - void psion_4lines(machine_config &config); - void psionlam(machine_config &config); - void psioncm(machine_config &config); - void psionlz(machine_config &config); - void psionla(machine_config &config); - void psionp350(machine_config &config); - - DECLARE_INPUT_CHANGED_MEMBER(psion_on); - -protected: - required_device m_maincpu; - required_device m_lcdc; - required_device m_beep; - required_device m_pack1; - required_device m_pack2; - required_device m_nvram1; - optional_device m_nvram2; - - uint16_t m_kb_counter = 0; - bool m_enable_nmi = false; - uint8_t m_pulse = 0; - - // RAM/ROM banks - required_shared_ptr m_ram; - std::unique_ptr m_paged_ram; - uint8_t m_rom_bank = 0; - uint8_t m_ram_bank = 0; - uint8_t m_ram_bank_count = 0; - uint8_t m_rom_bank_count = 0; - - required_ioport_array<7> m_kb_lines; - - virtual void machine_start() override ATTR_COLD; - virtual void machine_reset() override ATTR_COLD; - void nvram_init(nvram_device &nvram, void *data, size_t size); - - uint8_t kb_read(); - void update_banks(); - void port2_w(offs_t offset, uint8_t data, uint8_t ddr); - uint8_t port2_r(); - uint8_t port5_r(); - void port6_w(uint8_t data); - uint8_t port6_r(); - void io_rw(uint16_t offset); - void io_w(offs_t offset, uint8_t data); - uint8_t io_r(offs_t offset); - void psion_palette(palette_device &palette) const; - TIMER_DEVICE_CALLBACK_MEMBER(nmi_timer); - - HD44780_PIXEL_UPDATE(lz_pixel_update); - void psion_int_reg(address_map &map) ATTR_COLD; - void psioncm_mem(address_map &map) ATTR_COLD; - void psionla_mem(address_map &map) ATTR_COLD; - void psionlam_mem(address_map &map) ATTR_COLD; - void psionlz_mem(address_map &map) ATTR_COLD; - void psionp350_mem(address_map &map) ATTR_COLD; -}; - - -class psion1_state : public psion_state -{ -public: - psion1_state(const machine_config &mconfig, device_type type, const char *tag) - : psion_state(mconfig, type, tag) - { } - - void psion1(machine_config &config); - -private: - virtual void machine_reset() override ATTR_COLD; - - uint8_t reset_kb_counter_r(); - uint8_t inc_kb_counter_r(); - uint8_t switchoff_r(); - - HD44780_PIXEL_UPDATE(psion1_pixel_update); - void psion1_mem(address_map &map) ATTR_COLD; -}; - -#endif // MAME_PSION_PSION_H diff --git a/src/mame/psion/psion3a.cpp b/src/mame/psion/psion3a.cpp index 356d8711b1947..5092a98cf42ab 100644 --- a/src/mame/psion/psion3a.cpp +++ b/src/mame/psion/psion3a.cpp @@ -119,7 +119,6 @@ class psion3a_base_state : public driver_device required_device m_codec; required_device_array m_ssd; -private: void palette_init(palette_device &palette); uint16_t kbd_r(); @@ -368,7 +367,10 @@ static INPUT_PORTS_START( psion3a_fr ) PORT_BIT(0x040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_3) PORT_CHAR('"') PORT_CHAR('3') PORT_CHAR('\\') PORT_MODIFY("COL6") - PORT_BIT(0x008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_Z) PORT_CHAR('y') PORT_CHAR('Y') + PORT_BIT(0x002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_Q) PORT_CHAR('a') PORT_CHAR('A') + PORT_BIT(0x004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_A) PORT_CHAR('q') PORT_CHAR('Q') + PORT_BIT(0x008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_Z) PORT_CHAR('w') PORT_CHAR('W') + PORT_BIT(0x020, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_W) PORT_CHAR('z') PORT_CHAR('Z') PORT_MODIFY("COL7") PORT_BIT(0x002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_1) PORT_CHAR('&') PORT_CHAR('1') PORT_NAME("& 1 Off") @@ -481,8 +483,14 @@ uint16_t psion3a_base_state::kbd_r() void psion3a_base_state::palette_init(palette_device &palette) { palette.set_pen_color(0, rgb_t(190, 220, 190)); - palette.set_pen_color(1, rgb_t(130, 130, 110)); - palette.set_pen_color(2, rgb_t(190, 210, 180)); + + for (int i = 1; i < 3; i++) + { + const int r = (0x99 * i) / 2; + const int g = (0xaa * i) / 2; + const int b = (0x88 * i) / 2; + m_palette->set_pen_color(i, rgb_t(r, g, b)); + } } @@ -520,6 +528,7 @@ void psion3a_base_state::psion_asic9(machine_config &config) m_ssd[1]->door_cb().set(m_asic9, FUNC(psion_asic9_device::medchng_w)); SOFTWARE_LIST(config, "ssd_list").set_original("psion_ssd").set_filter("S3,S3A"); + //SOFTWARE_LIST(config, "flop_list").set_original("psion_flop").set_filter("S3A"); } void psion3a_state::psion3a(machine_config &config) @@ -554,7 +563,7 @@ void psion3c_state::psion3c(machine_config &config) PSION_S3A_CODEC(config, m_codec).add_route(ALL_OUTPUTS, "mono", 1.00); // TODO: M7702-03 m_asic9->pcm_out().set(m_codec, FUNC(psion3a_codec_device::pcm_in)); - PSION_CONDOR(config, m_condor); + PSION_CONDOR(config, m_condor, 3'686'400); // FIXME: unknown clock source m_condor->txd_handler().set(m_honda, FUNC(psion_honda_slot_device::write_txd)); m_condor->rts_handler().set(m_honda, FUNC(psion_honda_slot_device::write_rts)); m_condor->dtr_handler().set(m_honda, FUNC(psion_honda_slot_device::write_dtr)); @@ -575,7 +584,17 @@ void psion3mx_state::psion3mx(machine_config &config) { psion_asic9(config); - m_asic9->set_clock(3.6864_MHz_XTAL * 15 / 2); // V30MX + PSION_ASIC9MX(config.replace(), m_asic9, 3.6864_MHz_XTAL * 15 / 2); // V30MX + m_asic9->set_screen("screen"); + m_asic9->set_ram_rom("ram", "rom"); + m_asic9->port_ab_r().set(FUNC(psion3mx_state::kbd_r)); + m_asic9->buz_cb().set(m_speaker, FUNC(speaker_sound_device::level_w)); + //m_asic9->buzvol_cb().set([this](int state) { m_speaker->set_output_gain(ALL_OUTPUTS, state ? 1.0 : 0.25); }); + m_asic9->col_cb().set([this](uint8_t data) { m_key_col = data; }); + m_asic9->data_r<0>().set(m_ssd[1], FUNC(psion_ssd_device::data_r)); // SSD Pack 2 + m_asic9->data_w<0>().set(m_ssd[1], FUNC(psion_ssd_device::data_w)); + m_asic9->data_r<1>().set(m_ssd[0], FUNC(psion_ssd_device::data_r)); // SSD Pack 1 + m_asic9->data_w<1>().set(m_ssd[0], FUNC(psion_ssd_device::data_w)); m_ram->set_default_size("2M").set_extra_options(""); diff --git a/src/mame/psion/psion_pack.cpp b/src/mame/psion/psion_pack.cpp index cafb221303aa7..879f8fe335c31 100644 --- a/src/mame/psion/psion_pack.cpp +++ b/src/mame/psion/psion_pack.cpp @@ -2,7 +2,7 @@ // copyright-holders:Sandro Ronco /**************************************************************************** - psion_pack.c + psion_pack.cpp Psion Organiser II Datapack emulation @@ -67,6 +67,7 @@ DEFINE_DEVICE_TYPE(PSION_DATAPACK, datapack_device, "datapack", "Psion Datapack" datapack_device::datapack_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, PSION_DATAPACK, tag, owner, clock) , device_memcard_image_interface(mconfig, *this) + , m_interface(nullptr) { } diff --git a/src/mame/psion/psion_pack.h b/src/mame/psion/psion_pack.h index 27e1400de1af6..dcb5e8ecfa4a3 100644 --- a/src/mame/psion/psion_pack.h +++ b/src/mame/psion/psion_pack.h @@ -23,16 +23,18 @@ class datapack_device : public device_t, { public: // construction/destruction - datapack_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + datapack_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0); virtual ~datapack_device(); + void set_interface(const char *interface) { m_interface = interface; } + // device_image_interface implementation virtual std::pair call_load() override; virtual void call_unload() override; virtual std::pair call_create(int format_type, util::option_resolution *create_args) override; virtual bool is_reset_on_load() const noexcept override { return false; } - virtual const char *image_interface() const noexcept override { return "psion_pack"; } + virtual const char *image_interface() const noexcept override { return m_interface; } virtual const char *file_extensions() const noexcept override { return "opk"; } virtual const char *image_type_name() const noexcept override { return "datapack"; } virtual const char *image_brief_type_name() const noexcept override { return "dpak"; } @@ -64,6 +66,8 @@ class datapack_device : public device_t, uint16_t m_counter = 0; //address counter uint8_t m_page = 0; //active page (only for paged Datapack) uint8_t m_segment = 0; //active segment (only for segmented Datapack) + + const char *m_interface; }; diff --git a/src/mame/psion/siena.cpp b/src/mame/psion/siena.cpp index 3930ee2eb8ad3..971b441bba029 100644 --- a/src/mame/psion/siena.cpp +++ b/src/mame/psion/siena.cpp @@ -197,8 +197,14 @@ uint16_t siena_state::kbd_r() void siena_state::palette_init(palette_device &palette) { palette.set_pen_color(0, rgb_t(190, 220, 190)); - palette.set_pen_color(1, rgb_t(130, 130, 110)); - palette.set_pen_color(2, rgb_t(190, 210, 180)); + + for (int i = 1; i < 3; i++) + { + const int r = (0x99 * i) / 2; + const int g = (0xaa * i) / 2; + const int b = (0x88 * i) / 2; + m_palette->set_pen_color(i, rgb_t(r, g, b)); + } } @@ -225,7 +231,7 @@ void siena_state::siena(machine_config &config) RAM(config, m_ram).set_default_size("512K").set_extra_options("1M"); NVRAM(config, "nvram", nvram_device::DEFAULT_NONE); - PSION_CONDOR(config, m_condor); + PSION_CONDOR(config, m_condor, 3'686'400); // FIXME: unknown clock source m_condor->txd_handler().set(m_honda, FUNC(psion_honda_slot_device::write_txd)); m_condor->rts_handler().set(m_honda, FUNC(psion_honda_slot_device::write_rts)); m_condor->dtr_handler().set(m_honda, FUNC(psion_honda_slot_device::write_dtr)); @@ -242,6 +248,7 @@ void siena_state::siena(machine_config &config) m_asic9->data_w<4>().set(m_honda, FUNC(psion_honda_slot_device::data_w)); SOFTWARE_LIST(config, "ssd_list").set_original("psion_ssd").set_filter("SIENA"); + //SOFTWARE_LIST(config, "flop_list").set_original("psion_flop").set_filter("SIENA"); } diff --git a/src/mame/psion/workabout.cpp b/src/mame/psion/workabout.cpp index d48de11995bfa..34aa3d68b6aad 100644 --- a/src/mame/psion/workabout.cpp +++ b/src/mame/psion/workabout.cpp @@ -186,8 +186,14 @@ uint16_t workabout_state::kbd_r() void workabout_state::palette_init(palette_device &palette) { palette.set_pen_color(0, rgb_t(190, 220, 190)); - palette.set_pen_color(1, rgb_t(130, 130, 110)); - palette.set_pen_color(2, rgb_t(190, 210, 180)); + + for (int i = 1; i < 3; i++) + { + const int r = (0x99 * i) / 2; + const int g = (0xaa * i) / 2; + const int b = (0x88 * i) / 2; + m_palette->set_pen_color(i, rgb_t(r, g, b)); + } } @@ -232,6 +238,7 @@ void workabout_state::workabout(machine_config &config) //PSION_EXP_SLOT(config, m_exp, psion_exp_devices, nullptr); SOFTWARE_LIST(config, "ssd_list").set_original("psion_ssd").set_filter("WA"); + //SOFTWARE_LIST(config, "flop_list").set_original("psion_flop").set_filter("WA"); } @@ -246,7 +253,22 @@ void workabout_state::psionwamx(machine_config &config) { workabout(config); - m_asic9->set_clock(3.6864_MHz_XTAL * 15 / 2); // V30MX + PSION_ASIC9MX(config.replace(), m_asic9, 3.6864_MHz_XTAL * 15 / 2); // V30MX + m_asic9->set_screen("screen"); + m_asic9->set_ram_rom("ram", "rom"); + m_asic9->port_ab_r().set(FUNC(workabout_state::kbd_r)); + m_asic9->buz_cb().set(m_speaker, FUNC(speaker_sound_device::level_w)); + m_asic9->col_cb().set([this](uint8_t data) { m_key_col = data; }); + m_asic9->data_r<0>().set(m_ssd[1], FUNC(psion_ssd_device::data_r)); // SSD Pack 1 + m_asic9->data_w<0>().set(m_ssd[1], FUNC(psion_ssd_device::data_w)); + m_asic9->data_r<1>().set(m_ssd[0], FUNC(psion_ssd_device::data_r)); // SSD Pack 2 + m_asic9->data_w<1>().set(m_ssd[0], FUNC(psion_ssd_device::data_w)); + //m_asic9->data_r<2>().set(m_exp[0], FUNC(psion_exp_slot_device::data_r)); // Expansion port A + //m_asic9->data_w<2>().set(m_exp[0], FUNC(psion_exp_slot_device::data_w)); + //m_asic9->data_r<3>().set(m_exp[1], FUNC(psion_exp_slot_device::data_r)); // Expansion port B + //m_asic9->data_w<3>().set(m_exp[1], FUNC(psion_exp_slot_device::data_w)); + //m_asic9->data_r<4>().set(m_exp[2], FUNC(psion_exp_slot_device::data_r)); // Expansion port C + //m_asic9->data_w<4>().set(m_exp[2], FUNC(psion_exp_slot_device::data_w)); m_ram->set_default_size("2M"); } diff --git a/src/mame/rare/kinst.cpp b/src/mame/rare/kinst.cpp index 488a231448271..a3d8f691bc446 100644 --- a/src/mame/rare/kinst.cpp +++ b/src/mame/rare/kinst.cpp @@ -18,9 +18,8 @@ of the "Ultra 64" arcade games. - The SRAM test fails in diagnostics; this is due to the fact that the test relies on executing out of the cache while it tromps over (and eventually restores) the instructions it is executing; this will likely never be fixed. -- Bootup sequence (the blue color fill) is too fast, which in turn causes - attract mode music not to play. Maybe the main CPU is running at a lower - clockspeed at boot (50MHz/4 seems plausible), but then, what toggles it? +- Verify waitstates on memory access, currently it's only added for EPROMs + during the blue screen boot up sequence. **************************************************************************** @@ -244,6 +243,7 @@ class kinst_state : public driver_device uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); uint32_t ide_extra_r(); void ide_extra_w(uint32_t data); + uint32_t rom_r(offs_t offset); void vram_control_w(offs_t offset, uint32_t data, uint32_t mem_mask); void sound_reset_w(offs_t offset, uint32_t data, uint32_t mem_mask); @@ -300,7 +300,6 @@ void kinst_state::machine_start() // configure fast RAM regions m_maincpu->add_fastram(0x08000000, 0x087fffff, false, m_rambase2); m_maincpu->add_fastram(0x00000000, 0x0007ffff, false, m_rambase); - m_maincpu->add_fastram(0x1fc00000, 0x1fc7ffff, true, m_rombase); // register for savestates save_item(NAME(m_vram_control)); @@ -502,6 +501,17 @@ void kinst_state::coin_control_w(offs_t offset, uint32_t data, uint32_t mem_mask } +uint32_t kinst_state::rom_r(offs_t offset) +{ + // add RdRdy clocks on EPROM access + // bootup sequence takes approx. 6 seconds, and it's not a CPU clock divider + if (!machine().side_effects_disabled()) + m_maincpu->adjust_icount(-128); + + return m_rombase[offset]; +} + + /************************************* * @@ -524,7 +534,7 @@ void kinst_state::kinst_map(address_map &map) map(0x10000100, 0x1000013f).rw(FUNC(kinst_state::ide_r), FUNC(kinst_state::ide_w)); map(0x10000170, 0x10000173).rw(FUNC(kinst_state::ide_extra_r), FUNC(kinst_state::ide_extra_w)); - map(0x1fc00000, 0x1fc7ffff).rom().region("user1", 0); + map(0x1fc00000, 0x1fc7ffff).r(FUNC(kinst_state::rom_r)); } diff --git a/src/mame/saitek/gk2000.cpp b/src/mame/saitek/gk2000.cpp index f7ae7c041515e..7a843baa73b5b 100644 --- a/src/mame/saitek/gk2000.cpp +++ b/src/mame/saitek/gk2000.cpp @@ -9,7 +9,6 @@ These chess computers all have the same I/O and fit in the same driver. The ches engine is by Frans Morsch. TODO: -- is the H8/3212 V04 ROM the same as V03, just a different package? - versions with the A20 ROM that don't officially support the extra options on the 2nd row, can still access them when turning the computer on by simultaneously pressing the Go/Stop button with the Option button. This doesn't work on MAME, @@ -42,6 +41,12 @@ Radio Shack Chess Master: - PCB label: same as Centurion / Cougar (see below) - rest is same as Barracuda +Mephisto Explorer: +- PCB label: 51CT09-01001L +- Hitachi H8/3212 MCU (QFP), 10MHz XTAL, same ROM contents as Barracuda +- LCD layout is slightly different, symbols are on the right side +- no board edge LEDs, LCD backlight via P51 + H8/323 A13 MCU is used in: - Saitek GK 2000 (1992 version, 86071220X12) - Saitek Travel Champion 2080 (86071220X12) @@ -66,6 +71,8 @@ H8/3212 V04 MCU (QFP) is used in: - Saitek Mephisto Diplomat Advanced Travel Chess (suspected) - Saitek Mephisto Explorer +The V04 QFP MCU is confirmed to have the same ROM contents as the V03 DIP MCU. + ================================================================================ Saitek GK 2100 @@ -100,7 +107,7 @@ Centurion / Cougar: Mephisto Explorer Pro: - PCB label: 51CT12-01002, REV1.0 (smaller PCB) - same MCU as Cougar, 16MHz XTAL -- LCD layout is slightly different, symbols are on the right side +- LCD layout is slightly different (same as Mephisto Explorer) For test mode, hold Enter after cold boot during the LCD test. It will say "TST", press Enter again to see the diode configuration setting. diff --git a/src/mame/saitek/stratos.cpp b/src/mame/saitek/stratos.cpp index 8ee440c7c3812..d988c4270cd6f 100644 --- a/src/mame/saitek/stratos.cpp +++ b/src/mame/saitek/stratos.cpp @@ -37,7 +37,7 @@ Hardware notes: - unknown LCDC under epoxy blob, suspected to be an MCU Stratos/Turbo King are identical. -Corona has magnet sensors and two HELIOS chips. +Corona has magnet sensors and two NEC gate arrays. There is no official Saitek program versioning for these. The D/D+ versions are known since they're the same chess engine as later Saitek modules, such as the diff --git a/src/mame/sega/m50dass.cpp b/src/mame/sega/m50dass.cpp new file mode 100644 index 0000000000000..5ed5997252797 --- /dev/null +++ b/src/mame/sega/m50dass.cpp @@ -0,0 +1,52 @@ +// license:BSD-3-Clause +// copyright-holders: + +/******************************************************************************************* + + Skeleton device for Sega DASS (Dual Active Seat System), found on the Megalo 50 cabinet. + Sega PCB 837-8683: + -Z0840004PSC Z80 CPU + -YM-2413 + -Two Sega 315-5296 I/O chips + -3 banks of eight dip switches + There is at least an undumped "A" revision. + +*******************************************************************************************/ + +#include "emu.h" +#include "m50dass.h" +#include "speaker.h" + +DEFINE_DEVICE_TYPE(MEGALO50_DASS, m50dass_device, "m50dass", "Sega DASS") + +m50dass_device::m50dass_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : device_t(mconfig, MEGALO50_DASS, tag, owner, clock) + , m_maincpu(*this, "maincpu") + , m_ym2413(*this, "ym2413") +{ +} + +void m50dass_device::device_start() +{ +} + +void m50dass_device::device_add_mconfig(machine_config &config) +{ + Z80(config, m_maincpu, 8_MHz_XTAL / 2); // Z0840004PSC, divider not verified + + SPEAKER(config, "mono").front_center(); + YM2413(config, m_ym2413, 8_MHz_XTAL / 2).add_route(ALL_OUTPUTS, "mono", 0.8); // divider and configuration unknown +} + +ROM_START(m50dass) + ROM_REGION(0x20000, "maincpu", 0) + ROM_LOAD("epr-14705.ic18", 0x00000, 0x20000, CRC(b863d2c5) SHA1(f6aa309bc8be15c26d91f3cf048ea140a9ca12eb)) // Strings "MEGALO50 910322", "** SHUNICHI **" on ROM + + ROM_REGION(0x117, "pld", 0) + ROM_LOAD("315-5592_gal16v8a.ic19", 0x000, 0x117, NO_DUMP) +ROM_END + +const tiny_rom_entry *m50dass_device::device_rom_region() const +{ + return ROM_NAME(m50dass); +} diff --git a/src/mame/sega/m50dass.h b/src/mame/sega/m50dass.h new file mode 100644 index 0000000000000..b590c8b3a965e --- /dev/null +++ b/src/mame/sega/m50dass.h @@ -0,0 +1,30 @@ +// license:BSD-3-Clause +// copyright-holders: + +#ifndef MAME_SEGA_M50DASS_H +#define MAME_SEGA_M50DASS_H + +#pragma once + +#include "cpu/z80/z80.h" +#include "sound/ymopl.h" + +class m50dass_device : public device_t +{ +public: + m50dass_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock = 0); + void m50dass(machine_config &config) ATTR_COLD; + +protected: + virtual void device_start() override ATTR_COLD; + virtual void device_add_mconfig(machine_config &config) override ATTR_COLD; + virtual const tiny_rom_entry *device_rom_region() const override ATTR_COLD; + +private: + required_device m_maincpu; + required_device m_ym2413; +}; + +DECLARE_DEVICE_TYPE(MEGALO50_DASS, m50dass_device) + +#endif // MAME_SEGA_M50DASS_H diff --git a/src/mame/sega/model3.cpp b/src/mame/sega/model3.cpp index 5547fc3819fad..b4ed68a1dfb90 100644 --- a/src/mame/sega/model3.cpp +++ b/src/mame/sega/model3.cpp @@ -620,24 +620,6 @@ Video Board | M5M4V4169 | | M5M4V4169 | | ADV7120KP30 | -| | -| | -| M5M410092FP M5M410092FP M5M4V4169 | -| SEGA (TQFP128) (TQFP128) M5M4V4169 | -| 315-6061 M5M410092FP | -| (BGA) (TQFP128) M5M4V4169 | -| M5M410092FP M5M4V4169 | -| (TQFP128) M5M410092FP | -| (TQFP128) SEGA SEGA M5M4V4169 | -| SEGA M5M410092FP 315-6059 315-6060 M5M4V4169 | -| 315-5648 (TQFP128) M5M410092FP (BGA) (BGA) | -| (QFP64) (TQFP128) SEGA | -| 315-6060 M5M4V4169 | -| (BGA) M5M4V4169 | -| | -| M5M4V4169 | -| M5M4V4169 | -| ADV7120KP30 | | (PLCC44) | | M5M4V4169 M5M4V4169 M5M4V4169 M5M4V4169 | | M5M4V4169 M5M4V4169 M5M4V4169 M5M4V4169 | diff --git a/src/mame/sega/segac2.cpp b/src/mame/sega/segac2.cpp index 6fcd631f987b5..6e528b7e336d1 100644 --- a/src/mame/sega/segac2.cpp +++ b/src/mame/sega/segac2.cpp @@ -156,11 +156,13 @@ ***********************************************************************************************/ #include "emu.h" + +#include "315_5296.h" +#include "m50dass.h" #include "segaipt.h" #include "cpu/m68000/m68000.h" #include "machine/nvram.h" -#include "315_5296.h" #include "sound/sn76496.h" #include "sound/upd7759.h" #include "sound/ymopn.h" @@ -209,6 +211,7 @@ class segac2_state : public driver_device void tfrceacjpb(machine_config &config); void ribbit(machine_config &config); + void c2m50dass(machine_config &config); void init_noprot(); void init_columns(); @@ -1922,13 +1925,13 @@ void segac2_state::segac2(machine_config &config) UPD7759(config, m_upd7759, XL1_CLOCK).add_route(ALL_OUTPUTS, "mono", 0.50); } -void segac2_state::tfrceacjpb(machine_config& config) +void segac2_state::tfrceacjpb(machine_config &config) { segac2(config); m_io->set_ddr_override(0xf); // game erroneously writes 0x58 to DDR } -void segac2_state::ribbit(machine_config& config) +void segac2_state::ribbit(machine_config &config) { segac2(config); @@ -1937,7 +1940,15 @@ void segac2_state::ribbit(machine_config& config) m_upd7759->set_start_delay(250); } -void pclub_state::pclub(machine_config& config) +// Games supporting Megalo 50 moving seats (DASS) +void segac2_state::c2m50dass(machine_config &config) +{ + segac2(config); + + MEGALO50_DASS(config, "m50dass"); +} + +void pclub_state::pclub(machine_config &config) { segac2(config); // Print Club boards use a different crystal, possibly for better compatibility with the camera timings. @@ -3031,7 +3042,7 @@ GAME( 1990, column2j, columns2, segac, columns2, segac2_state, init_co /* System C-2 Games */ GAME( 1990, tfrceac, 0, segac2, tfrceac, segac2_state, init_tfrceac, ROT0, "Technosoft / Sega", "Thunder Force AC", 0 ) GAME( 1990, tfrceacj, tfrceac, segac2, tfrceac, segac2_state, init_tfrceac, ROT0, "Technosoft / Sega", "Thunder Force AC (Japan)", 0 ) -GAME( 1990, tfrceacb, tfrceac, segac2, tfrceac, segac2_state, init_tfrceacb, ROT0, "bootleg", "Thunder Force AC (bootleg)", 0 ) +GAME( 1990, tfrceacb, tfrceac, segac2, tfrceac, segac2_state, init_tfrceacb, ROT0, "bootleg", "Thunder Force AC (bootleg)", 0 ) GAME( 1990, tfrceacjpb, tfrceac, tfrceacjpb, tfrceac, segac2_state, init_tfrceac, ROT0, "Technosoft / Sega", "Thunder Force AC (Japan, prototype, bootleg)", 0 ) GAME( 1990, borench, 0, segac2, borench, segac2_state, init_borench, ROT0, "Sega", "Borench (set 1)", 0 ) @@ -3041,7 +3052,7 @@ GAME( 1990, borenchj, borench, segac2, borench, segac2_state, init_bo GAME( 1991, ribbit, 0, ribbit, ribbit, segac2_state, init_ribbit, ROT0, "Sega", "Ribbit!", 0 ) GAME( 1991, ribbitj, ribbit, ribbit, ribbitj, segac2_state, init_ribbit, ROT0, "Sega", "Ribbit! (Japan)", 0 ) -GAME( 1991, twinsqua, 0, segac2, twinsqua, segac2_state, init_twinsqua, ROT0, "Sega", "Twin Squash", 0 ) +GAME( 1991, twinsqua, 0, c2m50dass, twinsqua, segac2_state, init_twinsqua, ROT0, "Sega", "Twin Squash", 0 ) GAME( 1991, soniccar, 0, segac2, soniccar, segac2_state, init_noprot, ROT0, "Sega", "Waku Waku Sonic Patrol Car", 0 ) @@ -3049,13 +3060,13 @@ GAME( 1992, ssonicbr, 0, segac2, ssonicbr, segac2_state, init_no GAME( 1992, ooparts, 0, segac2, ooparts, segac2_state, init_noprot, ROT270, "hack", "OOPArts (prototype, joystick hack)", 0 ) -GAME( 1992, puyo, 0, segac2, puyo, segac2_state, init_puyo, ROT0, "Compile / Sega", "Puyo Puyo (World)", 0 ) -GAME( 1992, puyobl, puyo, segac2, puyo, segac2_state, init_puyo, ROT0, "bootleg", "Puyo Puyo (World, bootleg)", 0 ) -GAME( 1992, puyoj, puyo, segac2, puyo, segac2_state, init_puyo, ROT0, "Compile / Sega", "Puyo Puyo (Japan, Rev B)", 0 ) -GAME( 1992, puyoja, puyo, segac2, puyo, segac2_state, init_puyo, ROT0, "Compile / Sega", "Puyo Puyo (Japan, Rev A)", 0 ) +GAME( 1992, puyo, 0, c2m50dass, puyo, segac2_state, init_puyo, ROT0, "Compile / Sega", "Puyo Puyo (World)", 0 ) +GAME( 1992, puyobl, puyo, c2m50dass, puyo, segac2_state, init_puyo, ROT0, "bootleg", "Puyo Puyo (World, bootleg)", 0 ) +GAME( 1992, puyoj, puyo, c2m50dass, puyo, segac2_state, init_puyo, ROT0, "Compile / Sega", "Puyo Puyo (Japan, Rev B)", 0 ) +GAME( 1992, puyoja, puyo, c2m50dass, puyo, segac2_state, init_puyo, ROT0, "Compile / Sega", "Puyo Puyo (Japan, Rev A)", 0 ) -GAME( 1992, tantr, 0, segac2, ichir, segac2_state, init_tantr, ROT0, "Sega", "Puzzle & Action: Tant-R (Japan)", 0 ) -GAME( 1993, tantrkor, tantr, segac2, ichir, segac2_state, init_tantrkor, ROT0, "Sega", "Puzzle & Action: Tant-R (Korea)", 0 ) +GAME( 1992, tantr, 0, segac2, ichir, segac2_state, init_tantr, ROT0, "Sega", "Puzzle & Action: Tant-R (Japan)", 0 ) +GAME( 1993, tantrkor, tantr, segac2, ichir, segac2_state, init_tantrkor, ROT0, "Sega", "Puzzle & Action: Tant-R (Korea)", 0 ) GAME( 1992, tantrbl, tantr, segac2, ichir, segac2_state, init_noprot, ROT0, "bootleg", "Puzzle & Action: Tant-R (Japan) (bootleg set 1)", 0 ) GAME( 1992, tantrbl4, tantr, segac2, ichir, segac2_state, init_noprot, ROT0, "bootleg", "Puzzle & Action: Tant-R (Japan) (bootleg set 4)", 0 ) GAME( 1994, tantrbl2, tantr, segac, ichir, segac2_state, init_tantr, ROT0, "bootleg", "Puzzle & Action: Tant-R (Japan) (bootleg set 2)", 0 ) // Common bootleg in Europe, C board, no samples @@ -3073,15 +3084,15 @@ GAME( 1993, sonicpop, 0, segac2, sonicpop, segac2_state, init_no GAME( 1993, sonicfgt, 0, segac2, sonicfgt, segac2_state, init_noprot, ROT0, "Sega", "SegaSonic Cosmo Fighter (World)", 0 ) GAME( 1993, sonicfgtj, sonicfgt, segac2, sonicfgt, segac2_state, init_noprot, ROT0, "Sega", "SegaSonic Cosmo Fighter (Japan)", 0 ) -GAME( 1994, potopoto, 0, segac2, potopoto, segac2_state, init_potopoto, ROT0, "Sega", "Poto Poto (Japan, Rev A)", 0 ) +GAME( 1994, potopoto, 0, c2m50dass, potopoto, segac2_state, init_potopoto, ROT0, "Sega", "Poto Poto (Japan, Rev A)", 0 ) GAME( 1994, stkclmns, 0, segac2, stkclmns, segac2_state, init_stkclmns, ROT0, "Sega", "Stack Columns (World)", 0 ) GAME( 1994, stkclmnsj, stkclmns, segac2, stkclmns, segac2_state, init_stkclmnj, ROT0, "Sega", "Stack Columns (Japan)", 0 ) -GAME( 1994, ichir, 0, segac2, ichir, segac2_state, init_ichir, ROT0, "Sega", "Puzzle & Action: Ichidant-R (World)", 0 ) +GAME( 1994, ichir, 0, segac2, ichir, segac2_state, init_ichir, ROT0, "Sega", "Puzzle & Action: Ichidant-R (World)", 0 ) GAME( 1994, ichirbl, ichir, segac2, ichir, segac2_state, init_noprot, ROT0, "bootleg", "Puzzle & Action: Ichidant-R (World) (bootleg)", 0 ) -GAME( 1994, ichirk, ichir, segac2, ichir, segac2_state, init_ichirk, ROT0, "Sega", "Puzzle & Action: Ichidant-R (Korea)", 0 ) -GAME( 1994, ichirj, ichir, segac2, ichir, segac2_state, init_ichirj, ROT0, "Sega", "Puzzle & Action: Ichidant-R (Japan)", 0 ) +GAME( 1994, ichirk, ichir, segac2, ichir, segac2_state, init_ichirk, ROT0, "Sega", "Puzzle & Action: Ichidant-R (Korea)", 0 ) +GAME( 1994, ichirj, ichir, segac2, ichir, segac2_state, init_ichirj, ROT0, "Sega", "Puzzle & Action: Ichidant-R (Japan)", 0 ) GAME( 1994, ichirjbl, ichir, segac, ichir, segac2_state, init_ichirjbl, ROT0, "bootleg", "Puzzle & Action: Ichidant-R (Japan) (bootleg)", 0 ) // C board, no samples GAME( 1994, puyopuy2, 0, segac2, puyopuy2, segac2_state, init_puyopuy2, ROT0, "Compile (Sega license)", "Puyo Puyo 2 (Japan)", 0 ) diff --git a/src/mame/sega/segas16b.cpp b/src/mame/sega/segas16b.cpp index b64d5146404f2..c84a358b24d37 100644 --- a/src/mame/sega/segas16b.cpp +++ b/src/mame/sega/segas16b.cpp @@ -5711,11 +5711,12 @@ ROM_START( bayroute1 ) ROM_LOAD16_BYTE( "br.b8", 0x60000, 0x10000, CRC(d8de78ff) SHA1(110661ab8008543b47629722b98d0470f73a48c5) ) ROM_REGION( 0x50000, "soundcpu", 0 ) // sound CPU - ROM_LOAD( "sound.a7", 0x00000, 0x08000, NO_DUMP ) - ROM_LOAD( "sound.a8", 0x10000, 0x10000, NO_DUMP ) - ROM_LOAD( "sound.a9", 0x20000, 0x10000, NO_DUMP ) - ROM_LOAD( "sound.a10", 0x30000, 0x10000, NO_DUMP ) - ROM_LOAD( "sound.a11", 0x40000, 0x10000, NO_DUMP ) + ROM_LOAD( "sound.a7", 0x00000, 0x10000, CRC(e91e55cb) SHA1(857242ab355736d7d77877bcf1d093c15c69992b) ) // 1ST AND 2ND HALF IDENTICAL + ROM_LOAD( "sound.a8", 0x10000, 0x10000, CRC(077e9981) SHA1(877c2ce9757410938e42b9bf512089bd2045d04e) ) // 1ST AND 2ND HALF IDENTICAL + ROM_LOAD( "sound.a9", 0x20000, 0x10000, CRC(3c3f5f41) SHA1(f1b2e01586e65c542514c0a846ffc79767ff2166) ) + // it expects different data from the parent set (copying that to here results in better sound overall, but some cut voices) + ROM_LOAD( "sound.a10", 0x30000, 0x10000, BAD_DUMP CRC(7c251347) SHA1(2b66365b2480e2852f930ddbed23d2ed80f2afaa) ) + ROM_LOAD( "sound.a11", 0x40000, 0x10000, BAD_DUMP CRC(a602ea2d) SHA1(37a4d05c416e8d65c4a2d73096edcfd456a0b70e) ) ROM_END @@ -10114,7 +10115,7 @@ GAME( 1990, aurailj, aurail, system16b_fd1089a, aurail, segas16b_stat GAME( 1989, bayroute, 0, system16b_fd1094, bayroute, segas16b_state, init_generic_5704, ROT0, "Sunsoft / Sega", "Bay Route (set 3, World) (FD1094 317-0116)", 0 ) GAME( 1989, bayroutej, bayroute, system16b_fd1094, bayroute, segas16b_state, init_generic_5704, ROT0, "Sunsoft / Sega", "Bay Route (set 2, Japan) (FD1094 317-0115)", 0 ) -GAME( 1989, bayroute1, bayroute, system16b, bayroute, segas16b_state, init_generic_5358, ROT0, "Sunsoft / Sega", "Bay Route (set 1, US) (unprotected)", MACHINE_NO_SOUND ) +GAME( 1989, bayroute1, bayroute, system16b, bayroute, segas16b_state, init_generic_5358, ROT0, "Sunsoft / Sega", "Bay Route (set 1, US) (unprotected)", MACHINE_IMPERFECT_SOUND ) GAME( 1987, bullet, 0, system16b_fd1094, bullet, segas16b_state, init_generic_5358_small, ROT0, "Sega", "Bullet (FD1094 317-0041)", 0 ) @@ -10221,7 +10222,7 @@ GAME( 1990, atomicp, 0, atomicp, atomicp, segas16b_stat GAME( 1990, snapper, 0, atomicp, snapper, segas16b_state, init_snapper, ROT0, "Philko", "Snapper (Korea)", 0) // korean clone board.. // board marked 'System 4' and has Philko custom chip - various hw changes (4bpp tiles for example) GAME( 1991, lockonph, 0, lockonph, lockonph, segas16b_state, init_lockonph, ROT0, "Philko", "Lock On (Philko)", MACHINE_IMPERFECT_SOUND ) // Copyright not shown in game, but has 'PHILKO' in the startup warning and tiles / PCB. 1991 is the name entry for the lowest high score. Clipping issues on left edge in attract look like original game bugs. -GAME( 1991, dfjail, 0, dfjail, dfjail, dfjail_state, init_generic_korean, ROT0, "Philko", "The Destroyer From Jail (Korea)", MACHINE_NO_COCKTAIL ) // Regulatory approval document dated "1991. 3.28" based on submission of manual and photos +GAME( 1991, dfjail, 0, dfjail, dfjail, dfjail_state, init_generic_korean, ROT0, "Philko", "The Destroyer From Jail (Korea)", MACHINE_NO_COCKTAIL ) // Regulatory approval document dated "1991. 3.28" based on submission of manual and photos // decrypted bootleg / 'suicide repair' sets @@ -10288,13 +10289,13 @@ GAME( 1989, wrestwar2d, wrestwar, system16b, wrestwar, segas16b_stat GAME( 1989, wrestwar1d, wrestwar, system16b, wrestwar, segas16b_state, init_generic_5704, ROT270, "bootleg", "Wrestle War (set 1, Japan) (bootleg of FD1094 317-0090 set)", 0 ) // bootlegs with split code/data, no memory mapper -GAME( 1987, sdibl2, sdi, system16b_split, sdi, segas16b_state, init_sdi_5358_small, ROT0, "bootleg", "SDI - Strategic Defense Initiative (bootleg, set 1)", 0 ) // 0x5230 -GAME( 1987, sdibl3, sdi, system16b_split, sdi, segas16b_state, init_sdi_5358_small, ROT0, "bootleg", "SDI - Strategic Defense Initiative (bootleg, set 2)", 0 ) // ^ -GAME( 1987, sdibl4, sdi, system16b_split, sdi, segas16b_state, init_sdi_5358_small, ROT0, "bootleg", "SDI - Strategic Defense Initiative (bootleg, set 3)", 0 ) // ^ -GAME( 1987, sdibl5, sdi, system16b_split, sdi, segas16b_state, init_sdi_5358_small, ROT0, "bootleg", "SDI - Strategic Defense Initiative (bootleg, set 4)", 0 ) -GAME( 1987, sdibl6, sdi, system16b_split, sdi, segas16b_state, init_sdi_5358_small, ROT0, "bootleg", "SDI - Strategic Defense Initiative (bootleg, set 5)", 0 ) +GAME( 1987, sdibl2, sdi, system16b_split, sdi, segas16b_state, init_sdi_5358_small, ROT0, "bootleg", "SDI - Strategic Defense Initiative (bootleg, set 1)", 0 ) // 0x5230 +GAME( 1987, sdibl3, sdi, system16b_split, sdi, segas16b_state, init_sdi_5358_small, ROT0, "bootleg", "SDI - Strategic Defense Initiative (bootleg, set 2)", 0 ) // ^ +GAME( 1987, sdibl4, sdi, system16b_split, sdi, segas16b_state, init_sdi_5358_small, ROT0, "bootleg", "SDI - Strategic Defense Initiative (bootleg, set 3)", 0 ) // ^ +GAME( 1987, sdibl5, sdi, system16b_split, sdi, segas16b_state, init_sdi_5358_small, ROT0, "bootleg", "SDI - Strategic Defense Initiative (bootleg, set 4)", 0 ) +GAME( 1987, sdibl6, sdi, system16b_split, sdi, segas16b_state, init_sdi_5358_small, ROT0, "bootleg", "SDI - Strategic Defense Initiative (bootleg, set 5)", 0 ) // bootlegs with modified hardware -GAME( 1989, fpointbl, fpoint, fpointbl, fpointbl, segas16b_state, init_generic_bootleg, ROT0, "bootleg (Datsu)", "Flash Point (World, bootleg)", 0 ) -GAME( 1989, fpointbj, fpoint, fpointbl, fpointbl, segas16b_state, init_generic_bootleg, ROT0, "bootleg (Datsu)", "Flash Point (Japan, bootleg set 1)", 0 ) -GAME( 1989, fpointbla, fpoint, fpointbla, fpointbl, segas16b_state, init_fpointbla, ROT0, "bootleg", "Flash Point (Japan, bootleg set 2)", MACHINE_NOT_WORKING ) +GAME( 1989, fpointbl, fpoint, fpointbl, fpointbl, segas16b_state, init_generic_bootleg, ROT0, "bootleg (Datsu)", "Flash Point (World, bootleg)", 0 ) +GAME( 1989, fpointbj, fpoint, fpointbl, fpointbl, segas16b_state, init_generic_bootleg, ROT0, "bootleg (Datsu)", "Flash Point (Japan, bootleg set 1)", 0 ) +GAME( 1989, fpointbla, fpoint, fpointbla, fpointbl, segas16b_state, init_fpointbla, ROT0, "bootleg", "Flash Point (Japan, bootleg set 2)", MACHINE_NOT_WORKING ) diff --git a/src/mame/sega/segasp.cpp b/src/mame/sega/segasp.cpp index 8a4b8dc83f52a..2c4c8d4a65b12 100644 --- a/src/mame/sega/segasp.cpp +++ b/src/mame/sega/segasp.cpp @@ -94,7 +94,7 @@ Thomas: The Tank Engine ???-????? no UNO the Medal (Medalink) 837-14804 F* ROM JP 253-5508-0526J AAFE-01G00225212, Satellite Medal Western Dream Gold (Medalink) 837-14699 F* ROM JP 253-5508-0473J AAFE-xxxxxxxxxxx, Satellite Medal Yataimura Kingyosukui (1-player, Japan) 8340003 D ROM JP 253-5509-5151J AAFE-01C68774814 -Yataimura Kingyosukui (4-player, China) 837-14875 CF EXP 253-5508-0563J AAFE-xxxxxxxxxxx +Yataimura Kingyosukui (4-player, China) 834000101 F ROM/CF EXP 253-5509-5142E AAFE-01D84514911 Yataimura Shateki (1-player, Japan) 834000301 D ROM JP 253-5508-0628J AAFE-01C37464814 Unknown 834-14865 JAP @@ -500,7 +500,7 @@ ROM_START( bingogal ) ROM_PARAMETER( ":rom_board:id", "5502" ) // actually 8x 128Mbit FlashROMs ROM_REGION( 0x800, "pic_readout", 0 ) - ROM_LOAD( "317-0513-jpn.ic15", 0, 0x800, BAD_DUMP CRC(778dc297) SHA1(a920ab31ea670cc5056c40baea3b832b7868bfe7) ) + ROM_LOAD( "317-0513-jpn.ic15", 0, 0x800, CRC(599c5637) SHA1(ca066dd8e8c4277023f5f9753e527009b634119b) ) ROM_END // This is installer of whole game machine. @@ -522,7 +522,7 @@ ROM_START( bingogalo ) ROM_PARAMETER( ":rom_board:id", "5502" ) // actually 8x 128Mbit FlashROMs ROM_REGION( 0x800, "pic_readout", 0 ) - ROM_LOAD( "317-0513-jpn.ic15", 0, 0x800, BAD_DUMP CRC(778dc297) SHA1(a920ab31ea670cc5056c40baea3b832b7868bfe7) ) + ROM_LOAD( "317-0513-jpn.ic15", 0, 0x800, CRC(599c5637) SHA1(ca066dd8e8c4277023f5f9753e527009b634119b) ) ROM_END // Also was dumped 837-14789 PCB, which uses 2x 512Mbit Flash ROMs. Game contents is the same as joined IC 62-64 dumps below. diff --git a/src/mame/sega/stv.cpp b/src/mame/sega/stv.cpp index 67ed10c3d5dae..6384866052128 100644 --- a/src/mame/sega/stv.cpp +++ b/src/mame/sega/stv.cpp @@ -3789,6 +3789,20 @@ ROM_START( wasafari ) ROM_LOAD( "wasafari.nv", 0x0000, 0x0080, CRC(50861c5a) SHA1(c431703d7b56185f20af1aec04cabb5f49e2d4ba) ) ROM_END +ROM_START( wwshin ) // 171-7410A PCB with 14284R sticker + STV_BIOS + + ROM_REGION32_BE( 0x3000000, "cart", ROMREGION_ERASE00 ) // SH2 code + ROM_LOAD16_WORD_SWAP( "ic22", 0x0200000, 0x200000, CRC(43f7cafc) SHA1(ac8f8efb752d6357d48090b3152e77fedea90a6f) ) + ROM_LOAD16_WORD_SWAP( "ic24", 0x0400000, 0x200000, CRC(db560e59) SHA1(edaabef7a165a4c309b4a6bac0f6de6bf8fedb34) ) + ROM_LOAD16_WORD_SWAP( "ic26", 0x0600000, 0x200000, CRC(2f411ff1) SHA1(e7bfb6570c0e5b5b64c4291bdc13fe8a62a69382) ) + ROM_LOAD16_WORD_SWAP( "ic28", 0x0800000, 0x200000, CRC(ca5e0446) SHA1(8e1c5c5c35f617129aaf40a1096f409cf7c96dce) ) + ROM_LOAD16_WORD_SWAP( "ic30", 0x0a00000, 0x200000, CRC(2653f758) SHA1(606dcdfe4e1b0fef495a5f62b2414c80405ebeeb) ) + ROM_LOAD16_WORD_SWAP( "ic32", 0x0c00000, 0x200000, CRC(8ebfd947) SHA1(db12bb43aadeb7ca48434286e7ecf2a7c8680e44) ) + ROM_LOAD16_WORD_SWAP( "ic34", 0x0e00000, 0x200000, CRC(22b7180f) SHA1(56aae3c4a9db9dd7443e2f0aa30052fc50b2ab70) ) + ROM_LOAD16_WORD_SWAP( "ic36", 0x1000000, 0x200000, CRC(5b83914c) SHA1(3d0f96345cdf22116d34eb67d51c1000a417889d) ) +ROM_END + ROM_START( dfeverg ) STV_BIOS @@ -3974,6 +3988,7 @@ GAME( 1998, supgoal, stvbios, hopper, patocar, stv_state, init_stv, GAME( 1997, techbowl, stvbios, hopper, patocar, stv_state, init_stv, ROT0, "Sega", "Technical Bowling (J 971212 V1.000)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) GAME( 1996, vfkids, stvbios, stv, stv, stv_state, init_stv, ROT0, "Sega", "Virtua Fighter Kids (JUET 960319 V0.000)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) GAME( 1997, vmahjong, stvbios, stvmp, vmahjong, stv_state, init_stv, ROT0, "Micronet", "Virtual Mahjong (J 961214 V1.000)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) +GAME( 1997, wwshin, stvbios, stv, wasafari, stv_state, init_stv, ROT0, "Sega", "Waku Waku Shinkansen (J 971031 V0.002)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // needs inputs GAME( 1998, wasafari, stvbios, stv, wasafari, stv_state, init_stv, ROT0, "Sega", "Wanpaku Safari (J 981109 V1.000)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) GAME( 1997, winterht, stvbios, stv, stv, stv_state, init_winterht, ROT0, "Sega", "Winter Heat (JUET 971012 V1.000)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) GAME( 1997, znpwfv, stvbios, stv, stv, stv_state, init_znpwfv, ROT0, "Sega", "Zen Nippon Pro-Wres Featuring Virtua (J 971123 V1.000)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) diff --git a/src/mame/seibu/airraid.cpp b/src/mame/seibu/airraid.cpp index 638a2d8cbd9d8..7550ef5adb7ce 100644 --- a/src/mame/seibu/airraid.cpp +++ b/src/mame/seibu/airraid.cpp @@ -284,7 +284,7 @@ void airraid_state::sound_map(address_map &map) map(0x4008, 0x4009).rw(m_seibu_sound, FUNC(seibu_sound_device::ym_r), FUNC(seibu_sound_device::ym_w)); map(0x4010, 0x4011).r(m_seibu_sound, FUNC(seibu_sound_device::soundlatch_r)); map(0x4012, 0x4012).r(m_seibu_sound, FUNC(seibu_sound_device::main_data_pending_r)); - map(0x4013, 0x4013).portr("COIN"); + map(0x4013, 0x4013).r(m_seibu_sound, FUNC(seibu_sound_device::coin_r)); map(0x4018, 0x4019).w(m_seibu_sound, FUNC(seibu_sound_device::main_data_w)); map(0x401b, 0x401b).w(m_seibu_sound, FUNC(seibu_sound_device::coin_w)); map(0x8000, 0xffff).rom(); @@ -449,6 +449,7 @@ void airraid_state::airraid(machine_config &config) SEIBU_SOUND(config, m_seibu_sound, 0); m_seibu_sound->int_callback().set_inputline(m_audiocpu, 0); + m_seibu_sound->coin_io_callback().set_ioport("COIN"); m_seibu_sound->set_rom_tag("audiocpu"); m_seibu_sound->ym_read_callback().set("ymsnd", FUNC(ym2151_device::read)); m_seibu_sound->ym_write_callback().set("ymsnd", FUNC(ym2151_device::write)); diff --git a/src/mame/seibu/bloodbro.cpp b/src/mame/seibu/bloodbro.cpp index 58688edb1f17a..d982e242facf7 100644 --- a/src/mame/seibu/bloodbro.cpp +++ b/src/mame/seibu/bloodbro.cpp @@ -880,8 +880,9 @@ void bloodbro_state::bloodbro(machine_config &config) SEIBU_SOUND(config, m_seibu_sound, 0); m_seibu_sound->int_callback().set_inputline(m_audiocpu, 0); + m_seibu_sound->coin_io_callback().set_ioport("COIN"); m_seibu_sound->set_rom_tag("audiocpu"); - m_seibu_sound->set_rombank_tag("seibu_bank1"); + m_seibu_sound->set_rombank_tag("seibu_bank"); m_seibu_sound->ym_read_callback().set(m_ymsnd, FUNC(ym3812_device::read)); m_seibu_sound->ym_write_callback().set(m_ymsnd, FUNC(ym3812_device::write)); } diff --git a/src/mame/seibu/cabal.cpp b/src/mame/seibu/cabal.cpp index d78e2f30c880a..1fb4b0da9688f 100644 --- a/src/mame/seibu/cabal.cpp +++ b/src/mame/seibu/cabal.cpp @@ -532,7 +532,7 @@ void cabal_state::sound_map(address_map &map) map(0x4008, 0x4009).rw(m_seibu_sound, FUNC(seibu_sound_device::ym_r), FUNC(seibu_sound_device::ym_w)); map(0x4010, 0x4011).r(m_seibu_sound, FUNC(seibu_sound_device::soundlatch_r)); map(0x4012, 0x4012).r(m_seibu_sound, FUNC(seibu_sound_device::main_data_pending_r)); - map(0x4013, 0x4013).portr("COIN"); + map(0x4013, 0x4013).r(m_seibu_sound, FUNC(seibu_sound_device::coin_r)); map(0x4018, 0x4019).w(m_seibu_sound, FUNC(seibu_sound_device::main_data_w)); map(0x401a, 0x401a).w(m_adpcm[0], FUNC(seibu_adpcm_device::ctl_w)); map(0x401b, 0x401b).w(m_seibu_sound, FUNC(seibu_sound_device::coin_w)); @@ -574,7 +574,7 @@ void cabal_state::cabalbl2_sound_map(address_map &map) map(0x4008, 0x4009).rw(m_seibu_sound, FUNC(seibu_sound_device::ym_r), FUNC(seibu_sound_device::ym_w)); map(0x4010, 0x4011).r(m_seibu_sound, FUNC(seibu_sound_device::soundlatch_r)); map(0x4012, 0x4012).r(m_seibu_sound, FUNC(seibu_sound_device::main_data_pending_r)); - map(0x4013, 0x4013).portr("COIN"); + map(0x4013, 0x4013).r(m_seibu_sound, FUNC(seibu_sound_device::coin_r)); map(0x4018, 0x4019).w(m_seibu_sound, FUNC(seibu_sound_device::main_data_w)); map(0x401a, 0x401a).w(m_adpcm[0], FUNC(seibu_adpcm_device::ctl_w)); map(0x401b, 0x401b).w(m_seibu_sound, FUNC(seibu_sound_device::coin_w)); @@ -870,6 +870,7 @@ void cabal_state::cabal(machine_config &config) // sound hardware SEIBU_SOUND(config, m_seibu_sound, 0); m_seibu_sound->int_callback().set_inputline(m_audiocpu, 0); + m_seibu_sound->coin_io_callback().set_ioport("COIN"); m_seibu_sound->set_rom_tag("audiocpu"); m_seibu_sound->ym_read_callback().set("ymsnd", FUNC(ym2151_device::read)); m_seibu_sound->ym_write_callback().set("ymsnd", FUNC(ym2151_device::write)); diff --git a/src/mame/seibu/dcon.cpp b/src/mame/seibu/dcon.cpp index 1f1a00ebe6730..485cc5e705fba 100644 --- a/src/mame/seibu/dcon.cpp +++ b/src/mame/seibu/dcon.cpp @@ -573,8 +573,9 @@ void dcon_state::dcon(machine_config &config) SEIBU_SOUND(config, m_seibu_sound, 0); m_seibu_sound->int_callback().set_inputline("audiocpu", 0); + m_seibu_sound->coin_io_callback().set_ioport("COIN"); m_seibu_sound->set_rom_tag("audiocpu"); - m_seibu_sound->set_rombank_tag("seibu_bank1"); + m_seibu_sound->set_rombank_tag("seibu_bank"); m_seibu_sound->ym_read_callback().set("ymsnd", FUNC(ym3812_device::read)); m_seibu_sound->ym_write_callback().set("ymsnd", FUNC(ym3812_device::write)); } @@ -622,8 +623,9 @@ void dcon_state::sdgndmps(machine_config &config) // PCB number is PB91008 SEIBU_SOUND(config, m_seibu_sound, 0); m_seibu_sound->int_callback().set_inputline("audiocpu", 0); + m_seibu_sound->coin_io_callback().set_ioport("COIN"); m_seibu_sound->set_rom_tag("audiocpu"); - m_seibu_sound->set_rombank_tag("seibu_bank1"); + m_seibu_sound->set_rombank_tag("seibu_bank"); m_seibu_sound->ym_read_callback().set("ymsnd", FUNC(ym2151_device::read)); m_seibu_sound->ym_write_callback().set("ymsnd", FUNC(ym2151_device::write)); } diff --git a/src/mame/seibu/deadang.cpp b/src/mame/seibu/deadang.cpp index d76157c5d9311..01645fb242b14 100644 --- a/src/mame/seibu/deadang.cpp +++ b/src/mame/seibu/deadang.cpp @@ -562,14 +562,14 @@ void deadang_state::sound_map(address_map &map) map(0x4008, 0x4009).rw(m_seibu_sound, FUNC(seibu_sound_device::ym_r), FUNC(seibu_sound_device::ym_w)); map(0x4010, 0x4011).r(m_seibu_sound, FUNC(seibu_sound_device::soundlatch_r)); map(0x4012, 0x4012).r(m_seibu_sound, FUNC(seibu_sound_device::main_data_pending_r)); - map(0x4013, 0x4013).portr("COIN"); + map(0x4013, 0x4013).r(m_seibu_sound, FUNC(seibu_sound_device::coin_r)); map(0x4018, 0x4019).w(m_seibu_sound, FUNC(seibu_sound_device::main_data_w)); map(0x401a, 0x401a).w(m_adpcm[0], FUNC(seibu_adpcm_device::ctl_w)); map(0x401b, 0x401b).w(m_seibu_sound, FUNC(seibu_sound_device::coin_w)); map(0x6005, 0x6006).w(m_adpcm[1], FUNC(seibu_adpcm_device::adr_w)); map(0x6008, 0x6009).rw("ym2", FUNC(ym2203_device::read), FUNC(ym2203_device::write)); map(0x601a, 0x601a).w(m_adpcm[1], FUNC(seibu_adpcm_device::ctl_w)); - map(0x8000, 0xffff).bankr("seibu_bank1"); + map(0x8000, 0xffff).bankr("seibu_bank"); } // Air Raid sound config with extra ROM bank @@ -585,16 +585,16 @@ void popnrun_state::sound_map(address_map &map) map(0x4008, 0x4009).rw(m_seibu_sound, FUNC(seibu_sound_device::ym_r), FUNC(seibu_sound_device::ym_w)); map(0x4010, 0x4011).r(m_seibu_sound, FUNC(seibu_sound_device::soundlatch_r)); map(0x4012, 0x4012).r(m_seibu_sound, FUNC(seibu_sound_device::main_data_pending_r)); - map(0x4013, 0x4013).portr("COIN"); + map(0x4013, 0x4013).r(m_seibu_sound, FUNC(seibu_sound_device::coin_r)); map(0x4018, 0x4019).w(m_seibu_sound, FUNC(seibu_sound_device::main_data_w)); map(0x401b, 0x401b).w(m_seibu_sound, FUNC(seibu_sound_device::coin_w)); - map(0x8000, 0xffff).bankr("seibu_bank1"); + map(0x8000, 0xffff).bankr("seibu_bank"); } void deadang_state::sound_decrypted_opcodes_map(address_map &map) { map(0x0000, 0x1fff).r("sei80bu", FUNC(sei80bu_device::opcode_r)); - map(0x8000, 0xffff).bankr("seibu_bank1"); + map(0x8000, 0xffff).bankr("seibu_bank"); } @@ -822,8 +822,9 @@ void deadang_state::deadang(machine_config &config) SEIBU_SOUND(config, m_seibu_sound, 0); m_seibu_sound->int_callback().set_inputline(m_audiocpu, 0); + m_seibu_sound->coin_io_callback().set_ioport("COIN"); m_seibu_sound->set_rom_tag("audiocpu"); - m_seibu_sound->set_rombank_tag("seibu_bank1"); + m_seibu_sound->set_rombank_tag("seibu_bank"); m_seibu_sound->ym_read_callback().set("ym1", FUNC(ym2203_device::read)); m_seibu_sound->ym_write_callback().set("ym1", FUNC(ym2203_device::write)); diff --git a/src/mame/seibu/dynduke.cpp b/src/mame/seibu/dynduke.cpp index 767a597c96046..a3f204e338cea 100644 --- a/src/mame/seibu/dynduke.cpp +++ b/src/mame/seibu/dynduke.cpp @@ -437,7 +437,7 @@ void dynduke_state::sound_map(address_map &map) map(0x4008, 0x4009).rw(m_seibu_sound, FUNC(seibu_sound_device::ym_r), FUNC(seibu_sound_device::ym_w)); map(0x4010, 0x4011).r(m_seibu_sound, FUNC(seibu_sound_device::soundlatch_r)); map(0x4012, 0x4012).r(m_seibu_sound, FUNC(seibu_sound_device::main_data_pending_r)); - map(0x4013, 0x4013).portr("COIN"); + map(0x4013, 0x4013).r(m_seibu_sound, FUNC(seibu_sound_device::coin_r)); map(0x4018, 0x4019).w(m_seibu_sound, FUNC(seibu_sound_device::main_data_w)); map(0x401b, 0x401b).w(m_seibu_sound, FUNC(seibu_sound_device::coin_w)); map(0x6000, 0x6000).rw("oki", FUNC(okim6295_device::read), FUNC(okim6295_device::write)); @@ -451,7 +451,7 @@ void dynduke_state::sound_decrypted_opcodes_map(address_map &map) void dynduke_state::sei80bu_encrypted_full_map(address_map &map) { map(0x0000, 0x7fff).rom().region("audiocpu", 0); - map(0x8000, 0xffff).bankr("seibu_bank1"); + map(0x8000, 0xffff).bankr("seibu_bank"); } @@ -671,8 +671,9 @@ void dynduke_state::dynduke(machine_config &config) SEIBU_SOUND(config, m_seibu_sound, 0); m_seibu_sound->int_callback().set_inputline("audiocpu", 0); + m_seibu_sound->coin_io_callback().set_ioport("COIN"); m_seibu_sound->set_rom_tag("audiocpu"); - m_seibu_sound->set_rombank_tag("seibu_bank1"); + m_seibu_sound->set_rombank_tag("seibu_bank"); m_seibu_sound->ym_read_callback().set("ymsnd", FUNC(ym3812_device::read)); m_seibu_sound->ym_write_callback().set("ymsnd", FUNC(ym3812_device::write)); } diff --git a/src/mame/seibu/goal92.cpp b/src/mame/seibu/goal92.cpp index 21742d2a9f165..ff534cd94e08b 100644 --- a/src/mame/seibu/goal92.cpp +++ b/src/mame/seibu/goal92.cpp @@ -620,4 +620,4 @@ ROM_END } // anonymous namespace -GAME( 1992, goal92, cupsoc, goal92, goal92, goal92_state, empty_init, ROT0, "bootleg", "Goal! '92", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) +GAME( 1992, goal92, cupsoc, goal92, goal92, goal92_state, empty_init, ROT0, "bootleg (Electronic Devices)", "Goal! '92", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/seibu/goodejan.cpp b/src/mame/seibu/goodejan.cpp index 77b2d5381b7df..89170d6526f1d 100644 --- a/src/mame/seibu/goodejan.cpp +++ b/src/mame/seibu/goodejan.cpp @@ -614,9 +614,10 @@ void goodejan_state::goodejan(machine_config &config) oki.add_route(ALL_OUTPUTS, "mono", 0.40); seibu_sound_device &seibu_sound(SEIBU_SOUND(config, "seibu_sound", 0)); + seibu_sound.coin_io_callback().set_ioport("COIN"); seibu_sound.int_callback().set_inputline("audiocpu", 0); seibu_sound.set_rom_tag("audiocpu"); - seibu_sound.set_rombank_tag("seibu_bank1"); + seibu_sound.set_rombank_tag("seibu_bank"); seibu_sound.ym_read_callback().set("ymsnd", FUNC(ym3812_device::read)); seibu_sound.ym_write_callback().set("ymsnd", FUNC(ym3812_device::write)); } diff --git a/src/mame/seibu/legionna.cpp b/src/mame/seibu/legionna.cpp index 6ec1981dc1c48..cf4d167270f1f 100644 --- a/src/mame/seibu/legionna.cpp +++ b/src/mame/seibu/legionna.cpp @@ -1228,8 +1228,9 @@ void legionna_state::legionna(machine_config &config) SEIBU_SOUND(config, m_seibu_sound, 0); m_seibu_sound->int_callback().set_inputline(m_audiocpu, 0); + m_seibu_sound->coin_io_callback().set_ioport("COIN"); m_seibu_sound->set_rom_tag("audiocpu"); - m_seibu_sound->set_rombank_tag("seibu_bank1"); + m_seibu_sound->set_rombank_tag("seibu_bank"); m_seibu_sound->ym_read_callback().set("ymsnd", FUNC(ym3812_device::read)); m_seibu_sound->ym_write_callback().set("ymsnd", FUNC(ym3812_device::write)); } @@ -1284,8 +1285,9 @@ void legionna_state::heatbrl(machine_config &config) SEIBU_SOUND(config, m_seibu_sound, 0); m_seibu_sound->int_callback().set_inputline(m_audiocpu, 0); + m_seibu_sound->coin_io_callback().set_ioport("COIN"); m_seibu_sound->set_rom_tag("audiocpu"); - m_seibu_sound->set_rombank_tag("seibu_bank1"); + m_seibu_sound->set_rombank_tag("seibu_bank"); m_seibu_sound->ym_read_callback().set("ymsnd", FUNC(ym3812_device::read)); m_seibu_sound->ym_write_callback().set("ymsnd", FUNC(ym3812_device::write)); } @@ -1345,8 +1347,9 @@ void legionna_state::godzilla(machine_config &config) SEIBU_SOUND(config, m_seibu_sound, 0); m_seibu_sound->int_callback().set_inputline(m_audiocpu, 0); + m_seibu_sound->coin_io_callback().set_ioport("COIN"); m_seibu_sound->set_rom_tag("audiocpu"); - m_seibu_sound->set_rombank_tag("seibu_bank1"); + m_seibu_sound->set_rombank_tag("seibu_bank"); m_seibu_sound->ym_read_callback().set("ymsnd", FUNC(ym2151_device::read)); m_seibu_sound->ym_write_callback().set("ymsnd", FUNC(ym2151_device::write)); } @@ -1403,8 +1406,9 @@ void legionna_state::denjinmk(machine_config &config) SEIBU_SOUND(config, m_seibu_sound, 0); m_seibu_sound->int_callback().set_inputline(m_audiocpu, 0); + m_seibu_sound->coin_io_callback().set_ioport("COIN"); m_seibu_sound->set_rom_tag("audiocpu"); - m_seibu_sound->set_rombank_tag("seibu_bank1"); + m_seibu_sound->set_rombank_tag("seibu_bank"); m_seibu_sound->ym_read_callback().set("ymsnd", FUNC(ym2151_device::read)); m_seibu_sound->ym_write_callback().set("ymsnd", FUNC(ym2151_device::write)); } @@ -1461,8 +1465,9 @@ void legionna_state::grainbow(machine_config &config) SEIBU_SOUND(config, m_seibu_sound, 0); m_seibu_sound->int_callback().set_inputline(m_audiocpu, 0); + m_seibu_sound->coin_io_callback().set_ioport("COIN"); m_seibu_sound->set_rom_tag("audiocpu"); - m_seibu_sound->set_rombank_tag("seibu_bank1"); + m_seibu_sound->set_rombank_tag("seibu_bank"); m_seibu_sound->ym_read_callback().set("ymsnd", FUNC(ym2151_device::read)); m_seibu_sound->ym_write_callback().set("ymsnd", FUNC(ym2151_device::write)); } @@ -1521,8 +1526,9 @@ void legionna_state::cupsoc(machine_config &config) SEIBU_SOUND(config, m_seibu_sound, 0); m_seibu_sound->int_callback().set_inputline(m_audiocpu, 0); + m_seibu_sound->coin_io_callback().set_ioport("COIN"); m_seibu_sound->set_rom_tag("audiocpu"); - m_seibu_sound->set_rombank_tag("seibu_bank1"); + m_seibu_sound->set_rombank_tag("seibu_bank"); m_seibu_sound->ym_read_callback().set("ymsnd", FUNC(ym3812_device::read)); m_seibu_sound->ym_write_callback().set("ymsnd", FUNC(ym3812_device::write)); } diff --git a/src/mame/seibu/r2dx_v33.cpp b/src/mame/seibu/r2dx_v33.cpp index 640f586a96a25..4e046c31bdfd4 100644 --- a/src/mame/seibu/r2dx_v33.cpp +++ b/src/mame/seibu/r2dx_v33.cpp @@ -798,8 +798,9 @@ void r2dx_v33_state::nzerotea(machine_config &config) SEIBU_SOUND(config, m_seibu_sound, 0); m_seibu_sound->int_callback().set_inputline("audiocpu", 0); + m_seibu_sound->coin_io_callback().set_ioport("COIN"); m_seibu_sound->set_rom_tag("audiocpu"); - m_seibu_sound->set_rombank_tag("seibu_bank1"); + m_seibu_sound->set_rombank_tag("seibu_bank"); m_seibu_sound->ym_read_callback().set("ymsnd", FUNC(ym3812_device::read)); m_seibu_sound->ym_write_callback().set("ymsnd", FUNC(ym3812_device::write)); } diff --git a/src/mame/seibu/raiden.cpp b/src/mame/seibu/raiden.cpp index 6167b8a2f9ea2..1c231189be3f8 100644 --- a/src/mame/seibu/raiden.cpp +++ b/src/mame/seibu/raiden.cpp @@ -561,7 +561,7 @@ void raiden_state::raiden_sound_map(address_map &map) map(0x4008, 0x4009).rw(m_seibu_sound, FUNC(seibu_sound_device::ym_r), FUNC(seibu_sound_device::ym_w)); map(0x4010, 0x4011).r(m_seibu_sound, FUNC(seibu_sound_device::soundlatch_r)); map(0x4012, 0x4012).r(m_seibu_sound, FUNC(seibu_sound_device::main_data_pending_r)); - map(0x4013, 0x4013).portr("COIN"); + map(0x4013, 0x4013).r(m_seibu_sound, FUNC(seibu_sound_device::coin_r)); map(0x4018, 0x4019).w(m_seibu_sound, FUNC(seibu_sound_device::main_data_w)); map(0x401b, 0x401b).w(m_seibu_sound, FUNC(seibu_sound_device::coin_w)); map(0x6000, 0x6000).rw("oki", FUNC(okim6295_device::read), FUNC(okim6295_device::write)); @@ -575,7 +575,7 @@ void raiden_state::raiden_sound_decrypted_opcodes_map(address_map &map) void raiden_state::sei80bu_encrypted_full_map(address_map &map) { map(0x0000, 0x7fff).rom().region("audiocpu", 0); - map(0x8000, 0xffff).bankr("seibu_bank1"); + map(0x8000, 0xffff).bankr("seibu_bank"); } @@ -753,8 +753,9 @@ void raiden_state::raiden(machine_config &config) SEIBU_SOUND(config, m_seibu_sound, 0); m_seibu_sound->int_callback().set_inputline("audiocpu", 0); + m_seibu_sound->coin_io_callback().set_ioport("COIN"); m_seibu_sound->set_rom_tag("audiocpu"); - m_seibu_sound->set_rombank_tag("seibu_bank1"); + m_seibu_sound->set_rombank_tag("seibu_bank"); m_seibu_sound->ym_read_callback().set("ymsnd", FUNC(ym3812_device::read)); m_seibu_sound->ym_write_callback().set("ymsnd", FUNC(ym3812_device::write)); } diff --git a/src/mame/seibu/raiden2.cpp b/src/mame/seibu/raiden2.cpp index b70b0b7102d2f..c9f06112e45b8 100644 --- a/src/mame/seibu/raiden2.cpp +++ b/src/mame/seibu/raiden2.cpp @@ -698,13 +698,13 @@ void raiden2_state::raiden2_sound_map(address_map &map) map(0x4008, 0x4009).rw(m_seibu_sound, FUNC(seibu_sound_device::ym_r), FUNC(seibu_sound_device::ym_w)); map(0x4010, 0x4011).r(m_seibu_sound, FUNC(seibu_sound_device::soundlatch_r)); map(0x4012, 0x4012).r(m_seibu_sound, FUNC(seibu_sound_device::main_data_pending_r)); - map(0x4013, 0x4013).portr("COIN"); + map(0x4013, 0x4013).r(m_seibu_sound, FUNC(seibu_sound_device::coin_r)); map(0x4018, 0x4019).w(m_seibu_sound, FUNC(seibu_sound_device::main_data_w)); map(0x401a, 0x401a).w(m_seibu_sound, FUNC(seibu_sound_device::bank_w)); map(0x401b, 0x401b).w(m_seibu_sound, FUNC(seibu_sound_device::coin_w)); map(0x6000, 0x6000).rw("oki1", FUNC(okim6295_device::read), FUNC(okim6295_device::write)); map(0x6002, 0x6002).rw("oki2", FUNC(okim6295_device::read), FUNC(okim6295_device::write)); - map(0x8000, 0xffff).bankr("seibu_bank1"); + map(0x8000, 0xffff).bankr("seibu_bank"); } void raiden2_state::zeroteam_sound_map(address_map &map) @@ -718,12 +718,12 @@ void raiden2_state::zeroteam_sound_map(address_map &map) map(0x4008, 0x4009).rw(m_seibu_sound, FUNC(seibu_sound_device::ym_r), FUNC(seibu_sound_device::ym_w)); map(0x4010, 0x4011).r(m_seibu_sound, FUNC(seibu_sound_device::soundlatch_r)); map(0x4012, 0x4012).r(m_seibu_sound, FUNC(seibu_sound_device::main_data_pending_r)); - map(0x4013, 0x4013).portr("COIN"); + map(0x4013, 0x4013).r(m_seibu_sound, FUNC(seibu_sound_device::coin_r)); map(0x4018, 0x4019).w(m_seibu_sound, FUNC(seibu_sound_device::main_data_w)); map(0x401a, 0x401a).w(m_seibu_sound, FUNC(seibu_sound_device::bank_w)); map(0x401b, 0x401b).w(m_seibu_sound, FUNC(seibu_sound_device::coin_w)); map(0x6000, 0x6000).rw("oki", FUNC(okim6295_device::read), FUNC(okim6295_device::write)); - map(0x8000, 0xffff).bankr("seibu_bank1"); + map(0x8000, 0xffff).bankr("seibu_bank"); } @@ -1083,8 +1083,9 @@ void raiden2_state::raiden2(machine_config &config) SEIBU_SOUND(config, m_seibu_sound, 0); m_seibu_sound->int_callback().set_inputline("audiocpu", 0); + m_seibu_sound->coin_io_callback().set_ioport("COIN"); m_seibu_sound->set_rom_tag("audiocpu"); - m_seibu_sound->set_rombank_tag("seibu_bank1"); + m_seibu_sound->set_rombank_tag("seibu_bank"); m_seibu_sound->ym_read_callback().set("ymsnd", FUNC(ym2151_device::read)); m_seibu_sound->ym_write_callback().set("ymsnd", FUNC(ym2151_device::write)); } @@ -1143,8 +1144,9 @@ void raiden2_state::zeroteam(machine_config &config) SEIBU_SOUND(config, m_seibu_sound, 0); m_seibu_sound->int_callback().set_inputline("audiocpu", 0); + m_seibu_sound->coin_io_callback().set_ioport("COIN"); m_seibu_sound->set_rom_tag("audiocpu"); - m_seibu_sound->set_rombank_tag("seibu_bank1"); + m_seibu_sound->set_rombank_tag("seibu_bank"); m_seibu_sound->ym_read_callback().set("ymsnd", FUNC(ym3812_device::read)); m_seibu_sound->ym_write_callback().set("ymsnd", FUNC(ym3812_device::write)); } diff --git a/src/mame/seibu/sengokmj.cpp b/src/mame/seibu/sengokmj.cpp index 7a4952868d8d4..7fc8ce37b4981 100644 --- a/src/mame/seibu/sengokmj.cpp +++ b/src/mame/seibu/sengokmj.cpp @@ -603,9 +603,10 @@ void sengokmj_state::sengokmj(machine_config &config) oki.add_route(ALL_OUTPUTS, "mono", 0.40); seibu_sound_device &seibu_sound(SEIBU_SOUND(config, "seibu_sound", 0)); + seibu_sound.coin_io_callback().set_ioport("COIN"); seibu_sound.int_callback().set_inputline("audiocpu", 0); seibu_sound.set_rom_tag("audiocpu"); - seibu_sound.set_rombank_tag("seibu_bank1"); + seibu_sound.set_rombank_tag("seibu_bank"); seibu_sound.ym_read_callback().set("ymsnd", FUNC(ym3812_device::read)); seibu_sound.ym_write_callback().set("ymsnd", FUNC(ym3812_device::write)); } diff --git a/src/mame/seibu/toki.cpp b/src/mame/seibu/toki.cpp index 99565d55fcddb..203e006554d06 100644 --- a/src/mame/seibu/toki.cpp +++ b/src/mame/seibu/toki.cpp @@ -584,17 +584,17 @@ void toki_state::toki_audio_map(address_map &map) map(0x4008, 0x4009).rw(m_seibu_sound, FUNC(seibu_sound_device::ym_r), FUNC(seibu_sound_device::ym_w)); map(0x4010, 0x4011).r(m_seibu_sound, FUNC(seibu_sound_device::soundlatch_r)); map(0x4012, 0x4012).r(m_seibu_sound, FUNC(seibu_sound_device::main_data_pending_r)); - map(0x4013, 0x4013).portr("COIN"); + map(0x4013, 0x4013).r(m_seibu_sound, FUNC(seibu_sound_device::coin_r)); map(0x4018, 0x4019).w(m_seibu_sound, FUNC(seibu_sound_device::main_data_w)); map(0x401b, 0x401b).w(m_seibu_sound, FUNC(seibu_sound_device::coin_w)); map(0x6000, 0x6000).rw("oki", FUNC(okim6295_device::read), FUNC(okim6295_device::write)); - map(0x8000, 0xffff).bankr("seibu_bank1"); + map(0x8000, 0xffff).bankr("seibu_bank"); } void toki_state::toki_audio_opcodes_map(address_map &map) { map(0x0000, 0x1fff).r("sei80bu", FUNC(sei80bu_device::opcode_r)); - map(0x8000, 0xffff).bankr("seibu_bank1"); + map(0x8000, 0xffff).bankr("seibu_bank"); } void toki_state::jujuba_audio_map(address_map &map) @@ -609,17 +609,17 @@ void toki_state::jujuba_audio_map(address_map &map) map(0x4008, 0x4009).rw(m_seibu_sound, FUNC(seibu_sound_device::ym_r), FUNC(seibu_sound_device::ym_w)); map(0x4010, 0x4011).r(m_seibu_sound, FUNC(seibu_sound_device::soundlatch_r)); map(0x4012, 0x4012).r(m_seibu_sound, FUNC(seibu_sound_device::main_data_pending_r)); - map(0x4013, 0x4013).portr("COIN"); + map(0x4013, 0x4013).r(m_seibu_sound, FUNC(seibu_sound_device::coin_r)); map(0x4018, 0x4019).w(m_seibu_sound, FUNC(seibu_sound_device::main_data_w)); map(0x401b, 0x401b).w(m_seibu_sound, FUNC(seibu_sound_device::coin_w)); map(0x6000, 0x6000).rw("oki", FUNC(okim6295_device::read), FUNC(okim6295_device::write)); - map(0x8000, 0xffff).bankr("seibu_bank1"); + map(0x8000, 0xffff).bankr("seibu_bank"); } void toki_state::jujuba_audio_opcodes_map(address_map &map) { map(0x0000, 0x1fff).rom().region("audiocpu", 0); - map(0x8000, 0xffff).bankr("seibu_bank1"); + map(0x8000, 0xffff).bankr("seibu_bank"); } uint8_t toki_state::jujuba_z80_data_decrypt(offs_t offset) @@ -919,8 +919,9 @@ void toki_state::toki(machine_config &config) SEIBU_SOUND(config, m_seibu_sound, 0); m_seibu_sound->int_callback().set_inputline(m_audiocpu, 0); + m_seibu_sound->coin_io_callback().set_ioport("COIN"); m_seibu_sound->set_rom_tag(m_audiocpu_rom); - m_seibu_sound->set_rombank_tag("seibu_bank1"); + m_seibu_sound->set_rombank_tag("seibu_bank"); m_seibu_sound->ym_read_callback().set("ymsnd", FUNC(ym3812_device::read)); m_seibu_sound->ym_write_callback().set("ymsnd", FUNC(ym3812_device::write)); } diff --git a/src/mame/seta/rmhaihai.cpp b/src/mame/seta/rmhaihai.cpp index 073be31b4e65f..87920b3198f94 100644 --- a/src/mame/seta/rmhaihai.cpp +++ b/src/mame/seta/rmhaihai.cpp @@ -31,10 +31,12 @@ driver by Nicola Salmoria ***************************************************************************/ #include "emu.h" + #include "cpu/z80/z80.h" #include "machine/nvram.h" #include "sound/ay8910.h" #include "sound/msm5205.h" + #include "emupal.h" #include "screen.h" #include "speaker.h" @@ -56,11 +58,15 @@ class rmhaihai_state : public driver_device m_key(*this, "KEY%u", 0) { } - void init_rmhaihai(); - void rmhaihai(machine_config &config); - void rmhaibl(machine_config &config); + void rmhaihai(machine_config &config) ATTR_COLD; + void rmhaisei(machine_config &config); + void rmhaibl(machine_config &config) ATTR_COLD; + + void init_rmhaihai() ATTR_COLD; protected: + virtual void video_start() override ATTR_COLD; + void videoram_w(offs_t offset, uint8_t data); void colorram_w(offs_t offset, uint8_t data); uint8_t keyboard_r(); @@ -69,8 +75,6 @@ class rmhaihai_state : public driver_device void ctrl_w(uint8_t data); void adpcm_w(uint8_t data); - virtual void video_start() override ATTR_COLD; - uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TILE_GET_INFO_MEMBER(get_bg_tile_info); @@ -94,14 +98,6 @@ class rmhaihai_state : public driver_device }; -class rmhaisei_state : public rmhaihai_state -{ -public: - using rmhaihai_state::rmhaihai_state; - void rmhaisei(machine_config &config); -}; - - class themj_state : public rmhaihai_state { public: @@ -110,18 +106,18 @@ class themj_state : public rmhaihai_state m_cpubank(*this, "cpubank%u", 1) { } - void themj(machine_config &config); + void themj(machine_config &config) ATTR_COLD; protected: virtual void machine_start() override ATTR_COLD; virtual void machine_reset() override ATTR_COLD; private: - required_memory_bank_array<2> m_cpubank; - void themj_io_map(address_map &map) ATTR_COLD; void themj_map(address_map &map) ATTR_COLD; void themj_rombank_w(uint8_t data); + + required_memory_bank_array<2> m_cpubank; }; @@ -179,7 +175,7 @@ uint8_t rmhaihai_state::keyboard_r() { for (int i = 0; i < 31; i++) { - if (m_key[i/16]->read() & (1 << (i & 15))) return i+1; + if (BIT(m_key[i >> 4]->read(), i & 0x0f)) return i+1; } if (m_key[1]->read() & 0x8000) return 0x80; // coin return 0; @@ -190,7 +186,6 @@ uint8_t rmhaihai_state::keyboard_r() case 0x5bf3: // themj, but the test is NOPed out! return 0xcc; // keyboard_cmd = 0xcb - case 0x13a: // additional checks done by rmhaijin if (m_keyboard_cmd == 0x3b) return 0xdd; if (m_keyboard_cmd == 0x85) return 0xdc; @@ -418,41 +413,41 @@ INPUT_PORTS_END static INPUT_PORTS_START( rmhaihai ) PORT_START("DSW2") - PORT_DIPNAME( 0x01, 0x01, "Unknown 2-1" ) - PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0xfe, 0xfe, DEF_STR( Difficulty ) ) - PORT_DIPSETTING( 0xfe, "1 (Easy)" ) - PORT_DIPSETTING( 0x7e, "2" ) - PORT_DIPSETTING( 0xbe, "3" ) - PORT_DIPSETTING( 0xde, "4" ) - PORT_DIPSETTING( 0xee, "5" ) - PORT_DIPSETTING( 0xf6, "6" ) - PORT_DIPSETTING( 0xfa, "7" ) - PORT_DIPSETTING( 0xfc, "8 (Difficult)" ) + PORT_DIPUNKNOWN_DIPLOC( 0x01, 0x01, "D. SW2:8" ) // NOT USED + PORT_DIPNAME( 0xfe, 0xfe, "Computer Win Probability" ) PORT_DIPLOCATION("D. SW2:7,6,5,4,3,2,1") // レベル設定コンピュータのあがる確率 + PORT_DIPSETTING( 0xfe, "20% (Weak)" ) // 弱い + PORT_DIPSETTING( 0x7e, "30%" ) + PORT_DIPSETTING( 0xbe, "40%" ) + PORT_DIPSETTING( 0xde, "50%" ) + PORT_DIPSETTING( 0xee, "60%" ) + PORT_DIPSETTING( 0xf6, "70&%" ) + PORT_DIPSETTING( 0xfa, "80%" ) + PORT_DIPSETTING( 0xfc, "90% (Strong)" ) // 強い PORT_START("DSW1") - PORT_DIPNAME( 0x01, 0x01, DEF_STR( Free_Play ) ) - PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_SERVICE( 0x02, IP_ACTIVE_LOW ) - PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Coinage ) ) - PORT_DIPSETTING( 0x00, "A 2/1 B 1/2" ) - PORT_DIPSETTING( 0x0c, DEF_STR( 1C_1C ) ) - PORT_DIPSETTING( 0x04, "A 1/2 B 2/1" ) - PORT_DIPSETTING( 0x08, "A 1/3 B 3/1" ) - PORT_DIPNAME( 0x10, 0x00, DEF_STR( Demo_Sounds ) ) - PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x20, 0x20, DEF_STR( Flip_Screen ) ) - PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x40, 0x00, DEF_STR( Cabinet ) ) - PORT_DIPSETTING( 0x00, DEF_STR( Upright ) ) - PORT_DIPSETTING( 0x40, DEF_STR( Cocktail ) ) - PORT_DIPNAME( 0x80, 0x80, "Medal" ) - PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x01, 0x01, DEF_STR(Free_Play) ) PORT_DIPLOCATION("D. SW1:8") // フリープレイ + PORT_DIPSETTING( 0x01, DEF_STR(Off) ) // ノーマル + PORT_DIPSETTING( 0x00, DEF_STR(On) ) // フリープレイ + PORT_DIPNAME( 0x02, 0x02, DEF_STR(Service_Mode) ) PORT_DIPLOCATION("D. SW1:7") // テストモード + PORT_DIPSETTING( 0x02, DEF_STR(Off) ) // 無 + PORT_DIPSETTING( 0x00, DEF_STR(On) ) // 有 + PORT_DIPNAME( 0x0c, 0x0c, DEF_STR(Coinage) ) PORT_DIPLOCATION("D. SW1:6,5") // プレイ料金 + PORT_DIPSETTING( 0x00, "A 2/1 B 1/2" ) // 2コイン1クレジット + PORT_DIPSETTING( 0x0c, DEF_STR(1C_1C) ) // 1コイン1クレジット + PORT_DIPSETTING( 0x04, "A 1/2 B 2/1" ) // 1コイン2クレジット + PORT_DIPSETTING( 0x08, "A 1/3 B 3/1" ) // 1コイン3クレジット + PORT_DIPNAME( 0x10, 0x00, DEF_STR(Demo_Sounds) ) PORT_DIPLOCATION("D. SW1:4") // DEMO音楽 + PORT_DIPSETTING( 0x10, DEF_STR(Off) ) // 無 + PORT_DIPSETTING( 0x00, DEF_STR(On) ) // 有 + PORT_DIPNAME( 0x20, 0x20, DEF_STR(Flip_Screen) ) PORT_DIPLOCATION("D. SW1:3") // 画面反転 + PORT_DIPSETTING( 0x20, DEF_STR(Off) ) // ノーマル + PORT_DIPSETTING( 0x00, DEF_STR(On) ) // 反転 + PORT_DIPNAME( 0x40, 0x00, DEF_STR(Cabinet) ) PORT_DIPLOCATION("D. SW1:2") // スタイル + PORT_DIPSETTING( 0x40, DEF_STR(Cocktail) ) // テーブル + PORT_DIPSETTING( 0x00, DEF_STR(Upright) ) // アップライト + PORT_DIPNAME( 0x80, 0x80, "Medal" ) PORT_DIPLOCATION("D. SW1:1") // NOT USED + PORT_DIPSETTING( 0x80, DEF_STR(Off) ) + PORT_DIPSETTING( 0x00, DEF_STR(On) ) PORT_INCLUDE( mjctrl ) INPUT_PORTS_END @@ -601,7 +596,7 @@ void rmhaihai_state::rmhaibl(machine_config &config) m_maincpu->set_addrmap(AS_IO, &rmhaihai_state::rmhaihaibl_io_map); } -void rmhaisei_state::rmhaisei(machine_config &config) +void rmhaihai_state::rmhaisei(machine_config &config) { rmhaihai(config); @@ -876,6 +871,6 @@ GAME( 1985, rmhaihai2, rmhaihai, rmhaihai, rmhaihai, rmhaihai_state, init_rmhai GAME( 1985, rmhaihaibl, rmhaihai, rmhaibl, rmhaibl, rmhaihai_state, init_rmhaihai, ROT0, "bootleg", "Real Mahjong Haihai (Japan, bootleg)", MACHINE_SUPPORTS_SAVE ) GAME( 1985, rmhaihib, rmhaihai, rmhaihai, rmhaihib, rmhaihai_state, init_rmhaihai, ROT0, "Alba", "Real Mahjong Haihai (Japan, medal)", MACHINE_SUPPORTS_SAVE ) GAME( 1986, rmhaijin, 0, rmhaihai, rmhaihai, rmhaihai_state, init_rmhaihai, ROT0, "Alba", "Real Mahjong Haihai Jinji Idou Hen (Japan)", MACHINE_SUPPORTS_SAVE ) -GAME( 1986, rmhaisei, 0, rmhaisei, rmhaihai, rmhaisei_state, init_rmhaihai, ROT0, "Visco", "Real Mahjong Haihai Seichouhen (Japan)", MACHINE_SUPPORTS_SAVE ) +GAME( 1986, rmhaisei, 0, rmhaisei, rmhaihai, rmhaihai_state, init_rmhaihai, ROT0, "Visco", "Real Mahjong Haihai Seichouhen (Japan)", MACHINE_SUPPORTS_SAVE ) GAME( 1987, themj, 0, themj, rmhaihai, themj_state, init_rmhaihai, ROT0, "Visco", "The Mah-jong (Japan, set 1)", MACHINE_SUPPORTS_SAVE ) GAME( 1987, themj2, themj, themj, rmhaihai, themj_state, init_rmhaihai, ROT0, "Visco", "The Mah-jong (Japan, set 2)", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/seta/simple_st0016.cpp b/src/mame/seta/simple_st0016.cpp index 602900071612e..d0a1d8e5d6f21 100644 --- a/src/mame/seta/simple_st0016.cpp +++ b/src/mame/seta/simple_st0016.cpp @@ -19,11 +19,14 @@ Dips verified for Neratte Chu (nratechu) from manual */ #include "emu.h" + +#include "st0016.h" + #include "cpu/v810/v810.h" #include "cpu/z80/z80.h" -#include "st0016.h" #include "machine/timer.h" #include "sound/st0016.h" + #include "screen.h" #include "speaker.h" @@ -43,14 +46,15 @@ class st0016_state : public driver_device m_dsw(*this, "DSW%u", 1U) { } - void st0016(machine_config &config); - void renju(machine_config &config); - void mayjinsn(machine_config &config); + void st0016(machine_config &config) ATTR_COLD; + void renju(machine_config &config) ATTR_COLD; + void mayjinsn(machine_config &config) ATTR_COLD; - void init_nratechu(); - void init_mayjinsn(); - void init_mayjisn2(); - void init_renju(); + void init_crownpkr() ATTR_COLD; + void init_nratechu() ATTR_COLD; + void init_mayjinsn() ATTR_COLD; + void init_mayjisn2() ATTR_COLD; + void init_renju() ATTR_COLD; protected: virtual void machine_start() override ATTR_COLD; @@ -411,6 +415,36 @@ static INPUT_PORTS_START( nratechu ) PORT_SERVICE_DIPLOC( 0x80, IP_ACTIVE_LOW, "SW2:8" ) INPUT_PORTS_END +static INPUT_PORTS_START( crownpkr ) + PORT_INCLUDE( st0016 ) + + PORT_MODIFY("P1") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) // no effect in test mode + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_POKER_HOLD1 ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_POKER_HOLD3 ) PORT_NAME( "Hold 3 / Low" ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_POKER_HOLD5 ) + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_OTHER ) // TODO: hopper + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) // TODO: hopper full + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_GAMBLE_D_UP ) + + PORT_MODIFY("P2") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_GAMBLE_BET ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_GAMBLE_DEAL ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_POKER_HOLD2 ) PORT_NAME( "Hold 2 / High" ) // also Meter Key in test mode + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_POKER_HOLD4 ) // also Reset Key in test mode + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) // Last Game Key in test mode + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) // no effect in test mode + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) // no effect in test mode + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) // no effect in test mode + + PORT_MODIFY("SYSTEM") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(5) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(5) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(10) // TODO: simulate coin drop sensor + PORT_SERVICE( 0x08, IP_ACTIVE_LOW ) // only works if pressed during boot +INPUT_PORTS_END + static INPUT_PORTS_START( mayjisn2 ) PORT_INCLUDE( st0016 ) @@ -613,7 +647,7 @@ ROM_START( renju ) // PCB E51-00001-A ROM_END // ねらってチュー (Neratte Chū) / NERATTE CHU -ROM_START( nratechu ) // PCB E56-00002 (almost identical to above) +ROM_START( nratechu ) // PCB E56-00002 (almost identical to above). "1.10 1996/05/25 21:05 Programming by ITEC" string ROM_REGION( 0x200000, "maincpu", 0 ) ROM_LOAD( "sx012-01.u31", 0x000000, 0x080000, CRC(6ca01d57) SHA1(065848f19ecf2dc1f7bbc7ddd87bca502e4b8b16) ) ROM_LOAD( "sx012-02.u32", 0x100000, 0x100000, CRC(40a4e354) SHA1(8120ce8deee6805050a5b083a334c3743c09566b) ) @@ -621,6 +655,14 @@ ROM_START( nratechu ) // PCB E56-00002 (almost identical to above) // U34 not populated ROM_END +ROM_START( crownpkr ) // PCB E56-00002. "1.20 1997/05/30 19:00 Programming by K&S string" + ROM_REGION( 0x200000, "maincpu", 0 ) + ROM_LOAD( "cpu120.u31", 0x000000, 0x080000, CRC(9c47920b) SHA1(bdc3f16cc7bf84102a24e6f58a1fb329bf90920b) ) // hand written label NEC D27C4000D / AMD 27C400 + // U32 not populated + // U33 not populated + // U34 not populated +ROM_END + ROM_START( dcrown ) // PCB E51-00001 (almost identical to above) ROM_REGION( 0x200000, "maincpu", 0 ) ROM_LOAD( "dc1.u31", 0x000000, 0x80000, CRC(e55200b8) SHA1(20a968dc895bb636b064c29b4b53c6ffa49fea36) ) @@ -778,6 +820,11 @@ void st0016_state::init_nratechu() m_maincpu->set_game_flag(1); } +void st0016_state::init_crownpkr() +{ + m_maincpu->set_game_flag(2); +} + void st0016_state::init_mayjinsn() { m_maincpu->set_game_flag(4 /*| 0x80*/); @@ -788,7 +835,7 @@ void st0016_state::init_mayjisn2() m_maincpu->set_game_flag(4); } -} // Anonymous namespace +} // anonymous namespace /************************************* @@ -797,13 +844,14 @@ void st0016_state::init_mayjisn2() * *************************************/ -GAME( 1994, renju, 0, renju, renju, st0016_state, init_renju, ROT0, "Visco", "Renju Kizoku - Kira Kira Gomoku Narabe", MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE ) -GAME( 1996, nratechu, 0, st0016, nratechu, st0016_state, init_nratechu, ROT0, "Seta", "Neratte Chu", MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE ) -GAME( 1994, mayjisn2, 0, mayjinsn, mayjisn2, st0016_state, init_mayjisn2, ROT0, "Seta", "Mayjinsen 2", MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE ) -GAME( 1995, koikois, 0, st0016, koikois, st0016_state, init_renju, ROT0, "Visco", "Koi Koi Shimasho - Super Real Hanafuda", MACHINE_IMPERFECT_GRAPHICS | MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE ) -GAME( 2001, gostop, 0, st0016, gostop, st0016_state, init_renju, ROT0, "Visco", "Kankoku Hanafuda Go-Stop", MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE ) +GAME( 1994, renju, 0, renju, renju, st0016_state, init_renju, ROT0, "Visco", "Renju Kizoku - Kira Kira Gomoku Narabe (ver. 1.0)", MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE ) +GAME( 1996, nratechu, 0, st0016, nratechu, st0016_state, init_nratechu, ROT0, "Seta", "Neratte Chu (ver. 1.10)", MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE ) +GAME( 1994, mayjisn2, 0, mayjinsn, mayjisn2, st0016_state, init_mayjisn2, ROT0, "Seta", "Mayjinsen 2", MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE ) +GAME( 1995, koikois, 0, st0016, koikois, st0016_state, init_renju, ROT0, "Visco", "Koi Koi Shimasho - Super Real Hanafuda", MACHINE_IMPERFECT_GRAPHICS | MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE ) +GAME( 2001, gostop, 0, st0016, gostop, st0016_state, init_renju, ROT0, "Visco", "Kankoku Hanafuda Go-Stop", MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE ) // Not working -GAME( 1994, mayjinsn, 0, mayjinsn, st0016, st0016_state, init_mayjinsn, ROT0, "Seta", "Mayjinsen", MACHINE_IMPERFECT_GRAPHICS | MACHINE_NOT_WORKING | MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE ) -GAME( 1994, dcrown, 0, st0016, renju, st0016_state, init_renju, ROT0, "Nippon Data Kiki", "Dream Crown (set 1)", MACHINE_NOT_WORKING | MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE ) // (c) 1994 Nippon Data Kiki is uploaded near the Japanese Insert coin text -GAME( 1994, dcrowna, dcrown, st0016, renju, st0016_state, init_renju, ROT0, "Nippon Data Kiki", "Dream Crown (set 2)", MACHINE_NOT_WORKING | MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE ) // the Insert Coin text has been translated to English and no (c) is uploaded +GAME( 1994, mayjinsn, 0, mayjinsn, st0016, st0016_state, init_mayjinsn, ROT0, "Seta", "Mayjinsen", MACHINE_IMPERFECT_GRAPHICS | MACHINE_NOT_WORKING | MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE ) +GAME( 1997, crownpkr, 0, st0016, crownpkr, st0016_state, init_crownpkr, ROT0, "", "Crown Poker (ver. 1.20)", MACHINE_NOT_WORKING | MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE ) // coining in doesn't work +GAME( 1994, dcrown, 0, st0016, crownpkr, st0016_state, init_crownpkr, ROT0, "Nippon Data Kiki", "Dream Crown (set 1)", MACHINE_NOT_WORKING | MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE ) // (c) 1994 Nippon Data Kiki is uploaded near the Japanese Insert coin text +GAME( 1994, dcrowna, dcrown, st0016, crownpkr, st0016_state, init_crownpkr, ROT0, "Nippon Data Kiki", "Dream Crown (set 2)", MACHINE_NOT_WORKING | MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE ) // the Insert Coin text has been translated to English and no (c) is uploaded diff --git a/src/mame/seta/ssv.cpp b/src/mame/seta/ssv.cpp index a60a44c24f2ea..f660ffb30581c 100644 --- a/src/mame/seta/ssv.cpp +++ b/src/mame/seta/ssv.cpp @@ -4681,7 +4681,7 @@ ROM_END ***************************************************************************/ -// year rom clone machine inputs init monitor manufacturer title flags +// year rom clone machine inputs init monitor manufacturer title flags GAME( 1993, dynagear, 0, dynagear, dynagear, ssv_state, init_ssv, ROT0, "Sammy", "Dyna Gear", MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/seta/st0016.cpp b/src/mame/seta/st0016.cpp index fc9bb9d7d6e61..c50e5940e47a0 100644 --- a/src/mame/seta/st0016.cpp +++ b/src/mame/seta/st0016.cpp @@ -122,6 +122,11 @@ void st0016_cpu_device::device_reset() m_spr_dy = 8; break; + case 2: // Crown Poker + screen().set_visible_area(8,42*8-1,0,30*8-1); + m_spr_dx = 4; + break; + case 4: // mayjinsen 1&2 screen().set_visible_area(0,32*8-1,0,28*8-1); break; @@ -319,7 +324,7 @@ void st0016_cpu_device::vregs_w(offs_t offset, u8 data) $74 x--- ---- global flip screen -xx- ---- individual flip screen x/y i.e. Mayjinsen sets 0x80, other ST0016 games 0x60. - TODO: Might also be paired with $70 & $75 (setted up by Mayjinsen). + TODO: Might also be paired with $70 & $75 (set up by Mayjinsen). $a0 \ $a1 - source address >> 1 diff --git a/src/mame/shared/seibusound.cpp b/src/mame/shared/seibusound.cpp index 00b8a1bcd013f..1f3cb8d820dec 100644 --- a/src/mame/shared/seibusound.cpp +++ b/src/mame/shared/seibusound.cpp @@ -74,15 +74,16 @@ DEFINE_DEVICE_TYPE(SEIBU_SOUND, seibu_sound_device, "seibu_sound", "Seibu Sound System") -seibu_sound_device::seibu_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) +seibu_sound_device::seibu_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : device_t(mconfig, SEIBU_SOUND, tag, owner, clock), m_int_cb(*this), + m_coin_io_cb(*this, 0), m_ym_read_cb(*this, 0), m_ym_write_cb(*this), m_sound_rom(*this, finder_base::DUMMY_TAG), m_rom_bank(*this, finder_base::DUMMY_TAG), - m_main2sub_pending(0), - m_sub2main_pending(0), + m_main2sub_pending(false), + m_sub2main_pending(false), m_rst10_irq(false), m_rst18_irq(false), m_rst10_service(false), @@ -181,17 +182,20 @@ IRQ_CALLBACK_MEMBER(seibu_sound_device::im0_vector_cb) { if (m_rst18_irq && !m_rst18_service) { - update_irq_lines(RST18_ACKNOWLEDGE); + if (!machine().side_effects_disabled()) + update_irq_lines(RST18_ACKNOWLEDGE); return 0xdf; } else if (m_rst10_irq && !m_rst10_service) { - update_irq_lines(RST10_ACKNOWLEDGE); + if (!machine().side_effects_disabled()) + update_irq_lines(RST10_ACKNOWLEDGE); return 0xd7; } else { - logerror("Spurious interrupt taken\n"); + if (!machine().side_effects_disabled()) + logerror("Spurious interrupt taken\n"); return 0x00; } } @@ -233,13 +237,18 @@ void seibu_sound_device::ym_w(offs_t offset, u8 data) void seibu_sound_device::bank_w(u8 data) { if (m_rom_bank.found()) - m_rom_bank->set_entry(data & 1); + m_rom_bank->set_entry(BIT(data, 0)); +} + +u8 seibu_sound_device::coin_r(offs_t offset) +{ + return m_coin_io_cb(offset); } void seibu_sound_device::coin_w(u8 data) { - machine().bookkeeping().coin_counter_w(0, data & 1); - machine().bookkeeping().coin_counter_w(1, data & 2); + machine().bookkeeping().coin_counter_w(0, BIT(data, 0)); + machine().bookkeeping().coin_counter_w(1, BIT(data, 1)); } u8 seibu_sound_device::soundlatch_r(offs_t offset) @@ -260,8 +269,8 @@ void seibu_sound_device::main_data_w(offs_t offset, u8 data) void seibu_sound_device::pending_w(u8) { /* just a guess */ - m_main2sub_pending = 0; - m_sub2main_pending = 1; + m_main2sub_pending = false; + m_sub2main_pending = true; } u8 seibu_sound_device::main_r(offs_t offset) @@ -271,7 +280,7 @@ u8 seibu_sound_device::main_r(offs_t offset) { case 2: case 3: - return m_sub2main[offset-2]; + return m_sub2main[offset - 2]; case 5: return m_main2sub_pending ? 1 : 0; default: @@ -294,8 +303,8 @@ void seibu_sound_device::main_w(offs_t offset, u8 data) case 2: //Sengoku Mahjong writes here case 6: /* just a guess */ - m_sub2main_pending = 0; - m_main2sub_pending = 1; + m_sub2main_pending = false; + m_main2sub_pending = true; break; default: //logerror("%s: seibu_main_w(%x,%02x)\n",machine().describe_context(),offset,data); @@ -330,18 +339,18 @@ void seibu_sound_common::seibu_sound_map(address_map &map) map(0x4008, 0x4009).rw("seibu_sound", FUNC(seibu_sound_device::ym_r), FUNC(seibu_sound_device::ym_w)); map(0x4010, 0x4011).r("seibu_sound", FUNC(seibu_sound_device::soundlatch_r)); map(0x4012, 0x4012).r("seibu_sound", FUNC(seibu_sound_device::main_data_pending_r)); - map(0x4013, 0x4013).portr("COIN"); + map(0x4013, 0x4013).r("seibu_sound", FUNC(seibu_sound_device::coin_r)); map(0x4018, 0x4019).w("seibu_sound", FUNC(seibu_sound_device::main_data_w)); map(0x401b, 0x401b).w("seibu_sound", FUNC(seibu_sound_device::coin_w)); map(0x6000, 0x6000).rw("oki", FUNC(okim6295_device::read), FUNC(okim6295_device::write)); - map(0x8000, 0xffff).bankr("seibu_bank1"); + map(0x8000, 0xffff).bankr("seibu_bank"); } /***************************************************************************/ DEFINE_DEVICE_TYPE(SEI80BU, sei80bu_device, "sei80bu", "SEI80BU Encrypted Z80 Interface") -sei80bu_device::sei80bu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) +sei80bu_device::sei80bu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : device_t(mconfig, SEI80BU, tag, owner, clock), device_rom_interface(mconfig, *this) { @@ -349,7 +358,7 @@ sei80bu_device::sei80bu_device(const machine_config &mconfig, const char *tag, d u8 sei80bu_device::data_r(offs_t offset) { - u16 a = offset; + u16 const a = offset; u8 src = read_byte(offset); if ( BIT(a,9) & BIT(a,8)) src ^= 0x80; @@ -366,7 +375,7 @@ u8 sei80bu_device::data_r(offs_t offset) u8 sei80bu_device::opcode_r(offs_t offset) { - u16 a = offset; + u16 const a = offset; u8 src = read_byte(offset); if ( BIT(a,9) & BIT(a,8)) src ^= 0x80; @@ -393,13 +402,13 @@ u8 sei80bu_device::opcode_r(offs_t offset) DEFINE_DEVICE_TYPE(SEIBU_ADPCM, seibu_adpcm_device, "seibu_adpcm", "Seibu ADPCM interface") -seibu_adpcm_device::seibu_adpcm_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) +seibu_adpcm_device::seibu_adpcm_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : device_t(mconfig, SEIBU_ADPCM, tag, owner, clock) , m_msm(*this, finder_base::DUMMY_TAG) , m_current(0) , m_end(0) , m_nibble(0) - , m_playing(0) + , m_playing(false) , m_base(*this, DEVICE_SELF) { } @@ -418,7 +427,7 @@ void seibu_adpcm_device::device_start() void seibu_adpcm_device::device_reset() { - m_playing = 0; + m_playing = false; m_msm->reset_w(1); } @@ -438,11 +447,11 @@ void seibu_adpcm_device::adr_w(offs_t offset, u8 data) { if (offset) { - m_end = data<<8; + m_end = data << 8; } else { - m_current = data<<8; + m_current = data << 8; m_nibble = 4; } } @@ -454,13 +463,13 @@ void seibu_adpcm_device::ctl_w(u8 data) { case 0: m_msm->reset_w(1); - m_playing = 0; + m_playing = false; break; case 2: break; case 1: m_msm->reset_w(0); - m_playing = 1; + m_playing = true; break; } } @@ -470,7 +479,7 @@ void seibu_adpcm_device::msm_int(int state) if (!state || !m_playing) return; - int val = (m_base[m_current] >> m_nibble) & 15; + u8 const val = (m_base[m_current] >> m_nibble) & 15; m_msm->data_w(val); m_nibble ^= 4; @@ -480,7 +489,7 @@ void seibu_adpcm_device::msm_int(int state) if (m_current >= m_end) { m_msm->reset_w(1); - m_playing = 0; + m_playing = false; } } } diff --git a/src/mame/shared/seibusound.h b/src/mame/shared/seibusound.h index 27aab2442c5d8..0a37e77dd20a9 100644 --- a/src/mame/shared/seibusound.h +++ b/src/mame/shared/seibusound.h @@ -46,13 +46,14 @@ class seibu_sound_common { class seibu_sound_device : public device_t { public: - seibu_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + seibu_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); ~seibu_sound_device() { } // configuration template void set_rom_tag(T &&tag) { m_sound_rom.set_tag(std::forward(tag)); } template void set_rombank_tag(T &&tag) { m_rom_bank.set_tag(std::forward(tag)); } auto int_callback() { return m_int_cb.bind(); } + auto coin_io_callback() { return m_coin_io_cb.bind(); } auto ym_read_callback() { return m_ym_read_cb.bind(); } auto ym_write_callback() { return m_ym_write_cb.bind(); } @@ -65,6 +66,7 @@ class seibu_sound_device : public device_t u8 ym_r(offs_t offset); void ym_w(offs_t offset, u8 data); void bank_w(u8 data); + u8 coin_r(offs_t offset); void coin_w(u8 data); void fm_irqhandler(int state); u8 soundlatch_r(offs_t offset); @@ -85,16 +87,17 @@ class seibu_sound_device : public device_t // device callbacks devcb_write_line m_int_cb; + devcb_read8 m_coin_io_cb; devcb_read8 m_ym_read_cb; devcb_write8 m_ym_write_cb; // internal state - optional_region_ptr m_sound_rom; + optional_region_ptr m_sound_rom; optional_memory_bank m_rom_bank; - uint8_t m_main2sub[2]; - uint8_t m_sub2main[2]; - int m_main2sub_pending; - int m_sub2main_pending; + u8 m_main2sub[2]; + u8 m_sub2main[2]; + bool m_main2sub_pending; + bool m_sub2main_pending; bool m_rst10_irq; bool m_rst18_irq; bool m_rst10_service; @@ -121,7 +124,7 @@ DECLARE_DEVICE_TYPE(SEIBU_SOUND, seibu_sound_device) class sei80bu_device : public device_t, public device_rom_interface<16> { public: - sei80bu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + sei80bu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); u8 data_r(offs_t offset); u8 opcode_r(offs_t offset); @@ -138,12 +141,12 @@ DECLARE_DEVICE_TYPE(SEI80BU, sei80bu_device) class seibu_adpcm_device : public device_t { public: - template seibu_adpcm_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock, T &&msm5205_tag) + template seibu_adpcm_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock, T &&msm5205_tag) : seibu_adpcm_device(mconfig, tag, owner, clock) { m_msm.set_tag(std::forward(msm5205_tag)); } - seibu_adpcm_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + seibu_adpcm_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); ~seibu_adpcm_device() { } void decrypt(); @@ -159,11 +162,11 @@ class seibu_adpcm_device : public device_t private: // internal state required_device m_msm; - uint32_t m_current; - uint32_t m_end; - uint8_t m_nibble; - uint8_t m_playing; - required_region_ptr m_base; + u32 m_current; + u32 m_end; + u8 m_nibble; + bool m_playing; + required_region_ptr m_base; }; DECLARE_DEVICE_TYPE(SEIBU_ADPCM, seibu_adpcm_device) diff --git a/src/mame/sharp/x68k.cpp b/src/mame/sharp/x68k.cpp index 3a49c788a9f11..efdb0432da5e0 100644 --- a/src/mame/sharp/x68k.cpp +++ b/src/mame/sharp/x68k.cpp @@ -121,6 +121,7 @@ #include "x68k_kbd.h" #include "x68k_mouse.h" +#include "machine/input_merger.h" #include "machine/nvram.h" #include "bus/x68k/x68k_neptunex.h" @@ -328,21 +329,6 @@ uint16_t x68k_state::fdc_r(offs_t offset) return 0xff; } -void x68k_state::fdc_irq(int state) -{ - if((m_ioc.irqstatus & 0x04) && state) - { - m_ioc.irqstatus |= 0x80; - LOGMASKED(LOG_FDC, "FDC: IRQ triggered\n"); - update_ipl(); - } - else - { - m_ioc.irqstatus &= 0x7f; - update_ipl(); - } -} - void x68k_state::ct_w(uint8_t data) { // CT1 and CT2 bits from YM2151 port 0x1b @@ -361,6 +347,33 @@ void x68k_state::ct_w(uint8_t data) m_okim6258->set_unscaled_clock(adpcm_clock[m_adpcm.clock]); } +enum ioc_irq_number : unsigned +{ + IOC_FDC_INT = 7, + IOC_FDD_INT = 6, + IOC_PRT_INT = 5, + IOC_HDD_INT = 4, + IOC_HDD_IEN = 3, + IOC_FDC_IEN = 2, + IOC_FDD_IEN = 1, + IOC_PRT_IEN = 0, +}; +template void x68k_state::ioc_irq(int state) +{ + if (state) + m_ioc.irqstatus |= 1U << N; + else + m_ioc.irqstatus &= ~(1U << N); + + bool const irq_state = + (BIT(m_ioc.irqstatus, IOC_HDD_INT) && BIT(m_ioc.irqstatus, IOC_HDD_IEN)) || + (BIT(m_ioc.irqstatus, IOC_PRT_INT) && BIT(m_ioc.irqstatus, IOC_PRT_IEN)) || + (BIT(m_ioc.irqstatus, IOC_FDD_INT) && BIT(m_ioc.irqstatus, IOC_FDD_IEN)) || + (BIT(m_ioc.irqstatus, IOC_FDC_INT) && BIT(m_ioc.irqstatus, IOC_FDC_IEN)); + + m_maincpu->set_input_line(INPUT_LINE_IRQ1, irq_state ? ASSERT_LINE : CLEAR_LINE); +} + /* Custom I/O controller at 0xe9c000 0xe9c001 (R) - Interrupt status @@ -377,39 +390,22 @@ void x68k_state::ct_w(uint8_t data) - bits 7-2 = vector - bits 1,0 = device (00 = FDC, 01 = FDD, 10 = HDD, 11 = Printer) */ -void x68k_state::ioc_w(offs_t offset, uint16_t data) +void x68k_state::ioc_w(offs_t offset, uint8_t data) { switch(offset) { case 0x00: - m_ioc.irqstatus = data & 0x0f; + m_ioc.irqstatus = (m_ioc.irqstatus & 0xf0) | (data & 0x0f); LOGMASKED(LOG_SYS, "I/O: Status register write %02x\n",data); break; case 0x01: - switch(data & 0x03) - { - case 0x00: - m_ioc.fdcvector = data & 0xfc; - LOGMASKED(LOG_IRQ, "IOC: FDC IRQ vector = 0x%02x\n",data & 0xfc); - break; - case 0x01: - m_ioc.fddvector = data & 0xfc; - LOGMASKED(LOG_IRQ, "IOC: FDD IRQ vector = 0x%02x\n",data & 0xfc); - break; - case 0x02: - m_ioc.hdcvector = data & 0xfc; - LOGMASKED(LOG_IRQ, "IOC: HDD IRQ vector = 0x%02x\n",data & 0xfc); - break; - case 0x03: - m_ioc.prnvector = data & 0xfc; - LOGMASKED(LOG_IRQ, "IOC: Printer IRQ vector = 0x%02x\n",data & 0xfc); - break; - } + LOGMASKED(LOG_IRQ, "IOC: IRQ vector = 0x%02x\n", data & 0xfc); + m_ioc.vector = data & 0xfc; break; } } -uint16_t x68k_state::ioc_r(offs_t offset) +uint8_t x68k_state::ioc_r(offs_t offset) { switch(offset) { @@ -661,12 +657,6 @@ void x68k_state::exp_w(offs_t offset, uint16_t data, uint16_t mem_mask) set_bus_error((offset << 1) + 0xeafa00, 1, mem_mask); } -void x68k_state::dma_irq(int state) -{ - m_dmac_int = state != CLEAR_LINE; - update_ipl(); -} - void x68k_state::dma_end(offs_t offset, uint8_t data) { if(offset == 0) @@ -700,79 +690,33 @@ void x68k_state::adpcm_w(offs_t offset, uint8_t data) } } -void x68k_state::mfp_irq_callback(int state) -{ - m_mfp_int = state; - update_ipl(); -} - -void x68k_state::update_ipl() -{ - uint8_t new_ipl = 0; - if (m_exp_nmi[0] || m_exp_nmi[1]) - new_ipl = 7; - else if (m_mfp_int) - new_ipl = 6; - else if (m_scc_int) - new_ipl = 5; - else if (m_exp_irq4[0] || m_exp_irq4[1]) - new_ipl = 4; - else if (m_dmac_int) - new_ipl = 3; - else if (m_exp_irq2[0] || m_exp_irq2[1]) - new_ipl = 2; - else if ((m_ioc.irqstatus & 0xf0) != 0) - new_ipl = 1; - - if (m_current_ipl != new_ipl) - { - if (m_current_ipl != 0) - m_maincpu->set_input_line(m_current_ipl, CLEAR_LINE); - LOGMASKED(LOG_IRQ, "Changing interrupt level from %d to %d\n", m_current_ipl, new_ipl); - m_current_ipl = new_ipl; - if (m_current_ipl != 0) - m_maincpu->set_input_line(m_current_ipl, ASSERT_LINE); - } -} - uint8_t x68k_state::iack1() { uint8_t vector = 0x18; - if (BIT(m_ioc.irqstatus, 7)) + if (BIT(m_ioc.irqstatus, IOC_FDC_INT) && BIT(m_ioc.irqstatus, IOC_FDC_IEN)) { - vector = m_ioc.fdcvector; + vector = m_ioc.vector | 0; if (!machine().side_effects_disabled()) - { - m_ioc.irqstatus &= 0x7f; - update_ipl(); - } + ioc_irq(0); } - else if (BIT(m_ioc.irqstatus, 6)) + else if (BIT(m_ioc.irqstatus, IOC_FDD_INT) && BIT(m_ioc.irqstatus, IOC_FDD_IEN)) { - vector = 0x61 /*m_ioc.fddvector*/; + vector = m_ioc.vector | 1; if (!machine().side_effects_disabled()) - { - m_ioc.irqstatus &= 0xbf; - update_ipl(); - } + ioc_irq(0); } - else if (BIT(m_ioc.irqstatus, 5)) + else if (BIT(m_ioc.irqstatus, IOC_PRT_INT) && BIT(m_ioc.irqstatus, IOC_PRT_IEN)) { - vector = m_ioc.prnvector; + vector = m_ioc.vector | 3; if (!machine().side_effects_disabled()) - { - m_ioc.irqstatus &= 0xdf; - update_ipl(); - } + ioc_irq(0); } - else if (BIT(m_ioc.irqstatus, 4)) + else if (BIT(m_ioc.irqstatus, IOC_HDD_INT) && BIT(m_ioc.irqstatus, IOC_HDD_IEN)) { - vector = 0x6c /*m_ioc.hdcvector*/; + // TODO: Internal SCSI IRQ vector 0x6c, External SCSI IRQ vector 0xf6 (really?) + vector = m_ioc.vector | 2; if (!machine().side_effects_disabled()) - { - m_ioc.irqstatus &= 0xef; - update_ipl(); - } + ioc_irq(0); } if (!machine().side_effects_disabled()) @@ -785,7 +729,7 @@ void x68k_state::irq2_line(int state) { m_exp_irq2[N] = (state != CLEAR_LINE); LOGMASKED(LOG_IRQ, "IRQ2-%d %s\n", N + 1, m_exp_irq2[N] ? "asserted" : "cleared"); - update_ipl(); + m_maincpu->set_input_line(INPUT_LINE_IRQ2, (m_exp_irq2[0] || m_exp_irq2[1]) ? ASSERT_LINE : CLEAR_LINE); } template @@ -793,15 +737,7 @@ void x68k_state::irq4_line(int state) { m_exp_irq4[N] = (state != CLEAR_LINE); LOGMASKED(LOG_IRQ, "IRQ4-%d %s\n", N + 1, m_exp_irq4[N] ? "asserted" : "cleared"); - update_ipl(); -} - -template -void x68k_state::nmi_line(int state) -{ - m_exp_nmi[N] = (state != CLEAR_LINE); - LOGMASKED(LOG_IRQ, "EXNMI %s on expansion %d\n", m_exp_nmi[N] ? "asserted" : "cleared", N + 1); - update_ipl(); + m_maincpu->set_input_line(INPUT_LINE_IRQ4, (m_exp_irq4[0] || m_exp_irq4[1]) ? ASSERT_LINE : CLEAR_LINE); } uint8_t x68k_state::iack2() @@ -838,18 +774,6 @@ void x68k_state::cpu_space_map(address_map &map) map(0xffffff, 0xffffff).lr8(NAME([] () { return m68000_base_device::autovector(7); })); } -void x68ksupr_state::scsi_irq(int state) -{ - LOGMASKED(LOG_IRQ, "SCSI IRQ %s\n", state ? "asserted" : "cleared"); - - // TODO : Internal SCSI IRQ vector 0x6c, External SCSI IRQ vector 0xf6, IRQs go through the IOSC (IRQ line 1) - if(state != 0) - { - m_ioc.irqstatus |= 0x10; - update_ipl(); - } -} - void x68ksupr_state::scsi_unknown_w(uint8_t data) { // Documentation claims SSTS register is read-only, but x68030 boot code writes #$05 to this address anyway. @@ -875,7 +799,7 @@ void x68k_state::x68k_base_map(address_map &map) map(0xe94004, 0xe94007).rw(FUNC(x68k_state::fdc_r), FUNC(x68k_state::fdc_w)); map(0xe98000, 0xe99fff).rw(m_scc, FUNC(scc8530_device::ab_dc_r), FUNC(scc8530_device::ab_dc_w)).umask16(0x00ff); map(0xe9a000, 0xe9bfff).rw(FUNC(x68k_state::ppi_r), FUNC(x68k_state::ppi_w)); - map(0xe9c000, 0xe9dfff).rw(FUNC(x68k_state::ioc_r), FUNC(x68k_state::ioc_w)); + map(0xe9c000, 0xe9dfff).rw(FUNC(x68k_state::ioc_r), FUNC(x68k_state::ioc_w)).umask16(0x00ff); map(0xe9e000, 0xe9e3ff).rw(FUNC(x68k_state::exp_r), FUNC(x68k_state::exp_w)); // FPU (Optional) map(0xeafa00, 0xeafa1f).rw(FUNC(x68k_state::exp_r), FUNC(x68k_state::exp_w)); map(0xeb0000, 0xeb7fff).rw(FUNC(x68k_state::spritereg_r), FUNC(x68k_state::spritereg_w)); @@ -941,12 +865,8 @@ INPUT_PORTS_END void x68k_state::floppy_load_unload(bool load, floppy_image_device *dev) { dev->mon_w(!(m_fdc.motor && load)); - if(m_ioc.irqstatus & 0x02) - { - m_ioc.irqstatus |= 0x40; // Disk insert/eject interrupt - LOGMASKED(LOG_FDC, "IOC: Disk image inserted\n"); - update_ipl(); - } + + ioc_irq(1); } void x68k_state::floppy_load(floppy_image_device *dev) @@ -992,9 +912,6 @@ void x68k_state::machine_reset() std::fill(std::begin(m_ctrl_drv_out), std::end(m_ctrl_drv_out), 1); std::fill(std::begin(m_access_drv_out), std::end(m_access_drv_out), 1); m_fdc.select_drive = 0; - - m_ioc.irqstatus &= 0x0f; - update_ipl(); } void x68k_state::machine_start() @@ -1025,14 +942,9 @@ void x68k_state::machine_start() } m_fdc.motor = 0; - m_dmac_int = false; - m_mfp_int = false; - m_scc_int = false; m_exp_irq2[0] = m_exp_irq2[1] = false; m_exp_irq4[0] = m_exp_irq4[1] = false; - m_exp_nmi[0] = m_exp_nmi[1] = false; m_ioc.irqstatus = 0; - m_current_ipl = 0; m_adpcm.rate = 0; m_adpcm.clock = 0; m_sysport.sram_writeprotect = 0; @@ -1114,7 +1026,7 @@ void x68k_state::x68000_base(machine_config &config) /* device hardware */ MC68901(config, m_mfpdev, 16_MHz_XTAL / 4); m_mfpdev->set_timer_clock(16_MHz_XTAL / 4); - m_mfpdev->out_irq_cb().set(FUNC(x68k_state::mfp_irq_callback)); + m_mfpdev->out_irq_cb().set_inputline(m_maincpu, INPUT_LINE_IRQ6); m_mfpdev->out_tbo_cb().set(m_mfpdev, FUNC(mc68901_device::tc_w)); m_mfpdev->out_tbo_cb().append(m_mfpdev, FUNC(mc68901_device::rc_w)); m_mfpdev->out_so_cb().set("keyboard", FUNC(rs232_port_device::write_txd)); @@ -1134,13 +1046,13 @@ void x68k_state::x68000_base(machine_config &config) HD63450(config, m_hd63450, 40_MHz_XTAL / 4, "maincpu"); m_hd63450->set_clocks(attotime::from_usec(2), attotime::from_nsec(450), attotime::from_usec(4), attotime::from_hz(15625/2)); m_hd63450->set_burst_clocks(attotime::from_usec(2), attotime::from_nsec(450), attotime::from_nsec(450), attotime::from_nsec(50)); - m_hd63450->irq_callback().set(FUNC(x68k_state::dma_irq)); + m_hd63450->irq_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ3); m_hd63450->dma_end().set(FUNC(x68k_state::dma_end)); m_hd63450->dma_read<0>().set("upd72065", FUNC(upd72065_device::dma_r)); m_hd63450->dma_write<0>().set("upd72065", FUNC(upd72065_device::dma_w)); SCC8530(config, m_scc, 40_MHz_XTAL / 8); - m_scc->out_int_callback().set([this](int state) { m_scc_int = state; update_ipl(); }); + m_scc->out_int_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ5); rs232_port_device &mouse(RS232_PORT(config, "mouse_port", mouse_devices, "x68k")); mouse.rxd_handler().set(m_scc, FUNC(scc8530_device::rxb_w)); @@ -1182,7 +1094,7 @@ void x68k_state::x68000_base(machine_config &config) FILTER_VOLUME(config, m_adpcm_out[1]).add_route(ALL_OUTPUTS, "rspeaker", 1.0); UPD72065(config, m_upd72065, 16_MHz_XTAL / 2, true, false); // clocked through SED9420CAC - m_upd72065->intrq_wr_callback().set(FUNC(x68k_state::fdc_irq)); + m_upd72065->intrq_wr_callback().set(FUNC(x68k_state::ioc_irq)); m_upd72065->drq_wr_callback().set(m_hd63450, FUNC(hd63450_device::drq0_w)); FLOPPY_CONNECTOR(config, "upd72065:0", x68k_floppies, "525hd", x68k_state::floppy_formats); FLOPPY_CONNECTOR(config, "upd72065:1", x68k_floppies, "525hd", x68k_state::floppy_formats); @@ -1191,17 +1103,20 @@ void x68k_state::x68000_base(machine_config &config) SOFTWARE_LIST(config, "flop_list").set_original("x68k_flop"); + input_merger_any_high_device &nmi(INPUT_MERGER_ANY_HIGH(config, "nmi")); + nmi.output_handler().set_inputline(m_maincpu, INPUT_LINE_IRQ7); + X68K_EXPANSION_SLOT(config, m_expansion[0], x68000_exp_cards, nullptr); m_expansion[0]->set_space(m_maincpu, AS_PROGRAM); m_expansion[0]->out_irq2_callback().set(FUNC(x68k_state::irq2_line<0>)); m_expansion[0]->out_irq4_callback().set(FUNC(x68k_state::irq4_line<0>)); - m_expansion[0]->out_nmi_callback().set(FUNC(x68k_state::nmi_line<0>)); + m_expansion[0]->out_nmi_callback().set(nmi, FUNC(input_merger_any_high_device::in_w<0>)); X68K_EXPANSION_SLOT(config, m_expansion[1], x68000_exp_cards, nullptr); m_expansion[1]->set_space(m_maincpu, AS_PROGRAM); m_expansion[1]->out_irq2_callback().set(FUNC(x68k_state::irq2_line<1>)); m_expansion[1]->out_irq4_callback().set(FUNC(x68k_state::irq4_line<1>)); - m_expansion[1]->out_nmi_callback().set(FUNC(x68k_state::nmi_line<1>)); + m_expansion[1]->out_nmi_callback().set(nmi, FUNC(input_merger_any_high_device::in_w<1>)); /* internal ram */ RAM(config, m_ram).set_default_size("4M").set_extra_options("1M,2M,3M,5M,6M,7M,8M,9M,10M,11M,12M"); @@ -1253,7 +1168,7 @@ void x68ksupr_state::x68ksupr_base(machine_config &config) mb89352_device &spc = downcast(*device); spc.set_clock(40_MHz_XTAL / 8); - spc.out_irq_callback().set(*this, FUNC(x68ksupr_state::scsi_irq)); + spc.out_irq_callback().set(*this, FUNC(x68ksupr_state::ioc_irq)); spc.out_dreq_callback().set(m_hd63450, FUNC(hd63450_device::drq1_w)); }); diff --git a/src/mame/sharp/x68k.h b/src/mame/sharp/x68k.h index 70554ee832825..5d0a24eaca9e6 100644 --- a/src/mame/sharp/x68k.h +++ b/src/mame/sharp/x68k.h @@ -167,22 +167,13 @@ class x68k_state : public driver_device struct { uint8_t irqstatus = 0; - uint8_t fdcvector = 0; - uint8_t fddvector = 0; - uint8_t hdcvector = 0; - uint8_t prnvector = 0; + uint8_t vector = 0; } m_ioc; uint8_t m_ppi_portc = 0; - bool m_dmac_int = false; - bool m_mfp_int = false; - bool m_scc_int = false; bool m_exp_irq2[2]{}; bool m_exp_irq4[2]{}; - bool m_exp_nmi[2]{}; - uint8_t m_current_ipl = 0; int m_led_state = 0; emu_timer* m_led_timer = nullptr; - unsigned char m_scc_prev = 0; emu_timer* m_fdc_tc = nullptr; emu_timer* m_adpcm_timer = nullptr; emu_timer* m_bus_error_timer = nullptr; @@ -209,13 +200,12 @@ class x68k_state : public driver_device uint8_t ppi_port_b_r(); uint8_t ppi_port_c_r(); void ppi_port_c_w(uint8_t data); - void fdc_irq(int state); void ct_w(uint8_t data); void adpcm_w(offs_t offset, uint8_t data); - void mfp_irq_callback(int state); + + template void ioc_irq(int state); //dmac - void dma_irq(int state); void dma_end(offs_t offset, uint8_t data); void set_adpcm(); @@ -223,12 +213,11 @@ class x68k_state : public driver_device void fm_irq(int state); template void irq2_line(int state); template void irq4_line(int state); - template void nmi_line(int state); void fdc_w(offs_t offset, uint16_t data); uint16_t fdc_r(offs_t offset); - void ioc_w(offs_t offset, uint16_t data); - uint16_t ioc_r(offs_t offset); + void ioc_w(offs_t offset, uint8_t data); + uint8_t ioc_r(offs_t offset); void sysport_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); uint16_t sysport_r(offs_t offset); void ppi_w(offs_t offset, uint16_t data); @@ -256,11 +245,9 @@ class x68k_state : public driver_device uint16_t gvram_read(offs_t offset); void gvram_write(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); - void update_ipl(); uint8_t iack1(); uint8_t iack2(); uint8_t iack4(); - uint8_t iack5(); void x68k_base_map(address_map &map) ATTR_COLD; void x68k_map(address_map &map) ATTR_COLD; @@ -300,7 +287,6 @@ class x68ksupr_state : public x68k_state virtual void driver_start() override; protected: - void scsi_irq(int state); void scsi_unknown_w(uint8_t data); required_device m_scsictrl; diff --git a/src/mame/sinclair/spectrum.cpp b/src/mame/sinclair/spectrum.cpp index 25a0b41df8be1..cff35f78a6358 100644 --- a/src/mame/sinclair/spectrum.cpp +++ b/src/mame/sinclair/spectrum.cpp @@ -332,7 +332,7 @@ uint8_t spectrum_state::spectrum_rom_r(offs_t offset) { return m_exp->romcs() ? m_exp->mreq_r(offset) - : memregion("maincpu")->base()[offset]; + : m_rom[offset]; } /* diff --git a/src/mame/sinclair/spectrum.h b/src/mame/sinclair/spectrum.h index f14ed0fe4e93d..980d13be69428 100644 --- a/src/mame/sinclair/spectrum.h +++ b/src/mame/sinclair/spectrum.h @@ -55,6 +55,7 @@ class spectrum_state : public driver_device m_maincpu(*this, "maincpu"), m_screen(*this, "screen"), m_cassette(*this, "cassette"), + m_rom(*this, "maincpu"), m_ram(*this, RAM_TAG), m_specmem(*this, "specmem"), m_speaker(*this, "speaker"), @@ -155,6 +156,7 @@ class spectrum_state : public driver_device void spectrum_data(address_map &map) ATTR_COLD; required_device m_cassette; + required_region_ptr m_rom; required_device m_ram; optional_device m_specmem; required_device m_speaker; diff --git a/src/mame/sinclair/sprinter.cpp b/src/mame/sinclair/sprinter.cpp index 6170cbc7d5f71..edeea31d119ad 100644 --- a/src/mame/sinclair/sprinter.cpp +++ b/src/mame/sinclair/sprinter.cpp @@ -49,6 +49,7 @@ Sprinter Sp2000 (Peters Plus Ltd) #include "bus/spectrum/zxbus.h" #include "cpu/z80/z84c015.h" #include "machine/ds128x.h" +#include "machine/input_merger.h" #include "sound/ay8910.h" #include "sound/dac.h" @@ -80,6 +81,7 @@ class sprinter_state : public spectrum_128_state : spectrum_128_state(mconfig, type, tag) , m_maincpu(*this, "maincpu") , m_isa(*this, "isa%u", 0U) + , m_irqs(*this, "irqs") , m_rtc(*this, "rtc") , m_ata(*this, "ata%u", 1U) , m_beta(*this, BETA_DISK_TAG) @@ -207,6 +209,7 @@ class sprinter_state : public spectrum_128_state u8 kbd_fe_r(offs_t offset); void on_kbd_data(int state); + required_device m_irqs; required_device m_rtc; required_device_array m_ata; required_device m_beta; @@ -220,7 +223,6 @@ class sprinter_state : public spectrum_128_state required_device m_palette; required_device m_gfxdecode; tilemap_t *m_tilemap; - memory_region *m_rom; memory_share_creator m_vram; memory_share_creator m_fastram; memory_bank_creator m_bank0_fastram; @@ -295,7 +297,6 @@ class sprinter_state : public spectrum_128_state bool m_cbl_wae; emu_timer *m_cbl_timer = nullptr; emu_timer *m_acc_timer = nullptr; - bool m_hold_irq; }; void sprinter_state::update_memory() @@ -788,8 +789,7 @@ void sprinter_state::dcp_w(offs_t offset, u8 data) else { rate = attotime::never; - if (m_hold_irq) - m_irq_off_timer->adjust(attotime::zero); + m_irqs->in_clear<2>(); } m_cbl_timer->adjust(rate, 0, rate); break; @@ -1457,13 +1457,12 @@ void sprinter_state::machine_start() save_item(NAME(m_cbl_cnt)); save_item(NAME(m_cbl_wa)); save_item(NAME(m_cbl_wae)); - save_item(NAME(m_hold_irq)); m_beta->enable(); // reconfigure ROMs - m_rom = memregion("maincpu"); - m_bank_rom[0]->configure_entries(0, m_rom->bytes() / 0x4000, m_rom->base(), 0x4000); + memory_region *rom = memregion("maincpu"); + m_bank_rom[0]->configure_entries(0, rom->bytes() / 0x4000, rom->base(), 0x4000); m_bank0_fastram->configure_entries(0, m_fastram.bytes() / 0x4000, m_fastram.target(), 0x4000); for (auto i = 0; i < 4; i++) m_bank_ram[i]->configure_entries(0, m_ram->size() / 0x4000, m_ram->pointer(), 0x4000); @@ -1517,7 +1516,6 @@ void sprinter_state::machine_reset() m_cbl_xx = 0; m_cbl_wa = 0; - m_hold_irq = 0; m_ata_selected = 0; @@ -1644,7 +1642,10 @@ void sprinter_state::on_kbd_data(int state) m_kbd_data_cnt++; m_kbd_data_cnt %= 11; if (!m_kbd_data_cnt) - irq_on(0); + { + m_irqs->in_set<1>(); + m_irq_off_timer->adjust(attotime::from_ticks(32, m_maincpu->unscaled_clock())); + } } } @@ -1660,20 +1661,17 @@ void sprinter_state::do_mem_wait(u8 cpu_taken = 0) TIMER_CALLBACK_MEMBER(sprinter_state::irq_on) { - if (!m_hold_irq) - { - m_joy1_ctrl = m_joy2_ctrl = 0; - m_maincpu->set_input_line(INPUT_LINE_IRQ0, ASSERT_LINE); - m_irq_off_timer->adjust(attotime::from_ticks(32, m_maincpu->unscaled_clock())); - } + m_irqs->in_set<0>(); + m_irq_off_timer->adjust(attotime::from_ticks(32, m_maincpu->unscaled_clock())); + + m_joy1_ctrl = m_joy2_ctrl = 0; update_int(false); } TIMER_CALLBACK_MEMBER(sprinter_state::irq_off) { - m_irq_off_timer->reset(); // in case it's called from INT Ack, not by timer itself - m_hold_irq = 0; - m_maincpu->set_input_line(INPUT_LINE_IRQ0, CLEAR_LINE); + m_irqs->in_clear<0>(); // screen + m_irqs->in_clear<1>(); // keyboard } TIMER_CALLBACK_MEMBER(sprinter_state::cbl_tick) @@ -1691,9 +1689,7 @@ TIMER_CALLBACK_MEMBER(sprinter_state::cbl_tick) if (cbl_int_ena() && !(m_cbl_cnt & 0x7f)) { m_cbl_wa = m_cbl_cnt ^ 0x80; - m_hold_irq = 1; - m_maincpu->set_input_line(INPUT_LINE_IRQ0, ASSERT_LINE); - m_irq_off_timer->reset(); + m_irqs->in_set<2>(); } } @@ -1883,13 +1879,17 @@ void sprinter_state::sprinter(machine_config &config) m_ram->set_default_size("64M"); + INPUT_MERGER_ANY_HIGH(config, m_irqs).output_handler().set_inputline(m_maincpu, INPUT_LINE_IRQ0); + Z84C015(config.replace(), m_maincpu, X_SP / 12); // 3.5MHz default m_maincpu->set_m1_map(&sprinter_state::map_fetch); m_maincpu->set_memory_map(&sprinter_state::map_mem); m_maincpu->set_io_map(&sprinter_state::map_io); m_maincpu->nomreq_cb().set_nop(); m_maincpu->set_irq_acknowledge_callback(NAME([](device_t &, int){ return 0xff; })); - m_maincpu->irqack_cb().set(FUNC(sprinter_state::irq_off)); + m_maincpu->irqack_cb().set(m_irqs, FUNC(input_merger_any_high_device::in_clear<2>)); + m_maincpu->irqack_cb().append(m_irqs, FUNC(input_merger_any_high_device::in_clear<1>)); + m_maincpu->irqack_cb().append(m_irqs, FUNC(input_merger_any_high_device::in_clear<0>)); DS12885(config, m_rtc, XTAL(32'768)); // should be DS12887A ATA_INTERFACE(config, m_ata[0]).options(sprinter_ata_devices, "hdd", "hdd", false); diff --git a/src/mame/sinclair/tsconf.cpp b/src/mame/sinclair/tsconf.cpp index 5df2573f83007..cb8e38fba48c3 100644 --- a/src/mame/sinclair/tsconf.cpp +++ b/src/mame/sinclair/tsconf.cpp @@ -278,6 +278,10 @@ void tsconf_state::tsconf(machine_config &config) m_maincpu->set_vblank_int("screen", FUNC(tsconf_state::tsconf_vblank_interrupt)); + SPI_SDCARD(config, m_sdcard, 0); + m_sdcard->set_prefer_sdhc(); + m_sdcard->spi_miso_callback().set(FUNC(tsconf_state::tsconf_spi_miso_w)); + zxbus_device &zxbus(ZXBUS(config, "zxbus", 0)); zxbus.set_iospace("maincpu", AS_IO); ZXBUS_SLOT(config, "zxbus1", 0, "zxbus", zxbus_cards, nullptr); @@ -296,10 +300,6 @@ void tsconf_state::tsconf(machine_config &config) m_dma->on_ready_callback().set(FUNC(tsconf_state::dma_ready)); BETA_DISK(config, m_beta, 0); - SPI_SDCARD(config, m_sdcard, 0); - m_sdcard->set_prefer_sdhc(); - m_sdcard->spi_miso_callback().set(FUNC(tsconf_state::tsconf_spi_miso_w)); - SPEAKER(config, "lspeaker").front_left(); SPEAKER(config, "rspeaker").front_right(); diff --git a/src/mame/skeleton/camirf1.cpp b/src/mame/skeleton/camirf1.cpp new file mode 100644 index 0000000000000..2268d978ea649 --- /dev/null +++ b/src/mame/skeleton/camirf1.cpp @@ -0,0 +1,81 @@ +// license: BSD-3-Clause +// copyright-holders: + +/************************************************************* + +Skeleton driver for Honeywell CAMIR-F1 wireless passive +infrared motion sensor with built-in colour camera. + +Hardware based on a PIC18LF26K22 as main CPU with a Conexant +CX93610 (DIFT JPEG Encoder with a BT.656 Camera Interface and +Optional Microphone Input) and a IS25LQ040 Serial Flash. + +PCB: + _________ _ _________ + / |__| |__| \ +| | +| _____ _ | +| |CAMERA------| | | +| |SENSOR------| | | +| |_____|------|_| | +| _____ _____ | +| |CX93610 |PIC18LF26K22 +| | | | | | +| |_____| | | | +| |____| | +| _____ | +| |IS25LQ040 | +| Xtal | +| 27 MHz | +| ____ | +| /IR | | +| |SENSOR __ | +| ___ |____/ |__| | +| |___| | +| _________ | +|__________| |________| + +*************************************************************/ + +#include "emu.h" +#include "cpu/pic16x8x/pic16x8x.h" + +namespace { + + +class camirf1_state : public driver_device +{ +public: + camirf1_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag) + , m_maincpu(*this, "maincpu") + { } + + void camirf1(machine_config &config) ATTR_COLD; + +private: + required_device m_maincpu; +}; + +INPUT_PORTS_START( camirf1 ) +INPUT_PORTS_END + +void camirf1_state::camirf1(machine_config &config) +{ + PIC16F84(config, m_maincpu, 16_MHz_XTAL); // Actually a PIC18LF26K22 +} + +ROM_START( camirf1 ) + // ID = 00000000ffffffffh, CONFIG = 28130e003d81000fc00fe00fh + ROM_REGION( 0x04280, "maincpu", 0 ) + ROM_LOAD( "pic18lf26k22_user.bin", 0x00000, 0x01000, CRC(47e4e6c6) SHA1(e0b1d0690cf991803673e9bcf2d244aa15c42feb) ) + ROM_LOAD( "pic18lf26k22_data.bin", 0x00000, 0x00400, CRC(b15001ef) SHA1(6d722abfb433fbf76f2a53b015febc42f4d638c2) ) + + ROM_REGION( 0x80000, "sflash", 0 ) + ROM_LOAD( "is25lq040.bin", 0x00000, 0x80000, CRC(4458e03f) SHA1(52cf7001c90ae946ed00f4452a43523c12c81e9d) ) +ROM_END + +} // anonymous namespace + + +SYST( 2016, camirf1, 0, 0, camirf1, camirf1, camirf1_state, empty_init, "Honeywell", "CAMIR-F1", MACHINE_NO_SOUND_HW | MACHINE_NOT_WORKING ) diff --git a/src/mame/skeleton/css11501sk9.cpp b/src/mame/skeleton/css11501sk9.cpp new file mode 100644 index 0000000000000..7aa11b2dce92e --- /dev/null +++ b/src/mame/skeleton/css11501sk9.cpp @@ -0,0 +1,141 @@ +// license:BSD-3-Clause +// copyright-holders: + +/********************************************************************************************************************** + +Skeleton driver for Cisco CSS11501S-K9 Content Services Switch with SSL. + +The appliance has eight 10/100 Ethernet ports, one 10Base-T port for management, one RJ45 serial port for console, two +PCMCIA slots for storage and one Gigabit Ethernet port (GBIC). + +Hardware components: + +Main board. + -Sipex SP3243ECA Intelligent RS-232 Transceiver. + -Crystal CrystalLAN CS8900A Ethernet ISA LAN Controller. + -Exar ST16C1551 UART. + -Microchip PIC16LF877PT next to a 10 MHz crystal (U35). + -Xilinx Spartan XC2S50 (U23). + -Atmel 24C02N SEEPROM (U11) next to the Xilinx Spartan XC2S50 at U23. + -Two PCMCIA slots for Microdrive or Flash Drive. + -Intel SPD6722QCCE PC-Card/PCMCIA controller. + -Two 24C04R6 SEEPROMs near the two PCMCIA slots (U25 and U32). + -Sipex 3223ECY RS-232 transceiver. + -ST M4T32-BR12SH6 Timekeeper. + -Xilinx Spartan XC2S50 (another one, U33). + -Another 24C02N (U28), near the Xilinx Spartan XC2S50 at U33. + -Vitesse VSC2102-08UQ Network Processor / Intelligent Packet Processor, near a 25 MHz crystal. + -Intel LXT9785EHC 8-port Fast Ethernet PHY Transceiver near a 50 MHz crystal. + -PMC RM7000A 400T 64-Bit MIPS RISC Microprocessor with Integrated L2 cache. + -AMD AM29LV3200B Flash Memory. + -PMC PM2329-BC. + -Vitesse VSC2708-00UR. + -AMCC S2068TB. + -Cypress CY7C1360B-166AC 9-Mbit (256K x 36) Pipelined SRAM. + -Samsung K7N403601B-QC13 128Kx36 Pipelined NtRAM. + -SORIMM slot with a 256MB RAM module (Samsung MS18R1628EH0-CM8CI). + -Cypress CY7C1360B-166AC 9-Mbit (256K x 36) Pipelines SRAM (another one). + -Intel SPD6722QCCE PC-Card/PCMCIA controller. + -Xilinx XC18V02 next to the first Xilinx Spartan XC2S50 (U23). + +Sub-board (SSL acceleration). + -Broadcom BCM5821A1KTB Super E-Commerce Processor (high-performance public-key processor) next to a 100 MHz crystal. + -Martel GT-64120A-BN-3 (System Controller for 7000 CPU) next to another 100 MHz crystal. + -PMC RM7000A 400T 64-Bit MIPS RISC Microprocessor with Integrated L2 cache. + -AMD AM29LV1600B Flash Memory. + -Altera Max EPM3128ATC100-5 + -Broadcom BCM5700C2KPB PCI-X 10/100/1000 Base-T controller, near a 125 MHz crystal. + -Vitesse VSC2102-08UQ Network Processor / Intelligent Packet Processor, near a 25 MHz crystal. + -IDT 71V546S133PF 128K x 36, 3.3V Synchronous SRAM with ZBT Feature, Burst Counter and Pipelined Outputs. + -24C04R SEEPROM between the BCM5700C2KPB, the VSC2102-08UQ, and the 71V546S133PF. + -Microchip PIC16LF872 next to a 10 MHz crystal. + -Xilinx Spartan XC2S50. + -Xilinx 18V01JC In-System Programmable Configuration PROM next to the Xilinx Spartan XC2S50. + -SORIMM slot with a 64MB RAM module (Samsung MS18R1622EH0-CM8). + -SODIMM slot with a 512MB RAM module (Cisco CIS00-21160-111CD). + +**********************************************************************************************************************/ + +#include "emu.h" +#include "cpu/mips/mips3.h" + + +namespace { + +class css11501sk9_state : public driver_device +{ +public: + css11501sk9_state(const machine_config &mconfig, device_type type, const char *tag) + : driver_device(mconfig, type, tag) + , m_maincpu(*this, "maincpu") + , m_sslcpu(*this, "sslcpu") + { } + + void css11501sk9(machine_config &config); + +private: + virtual void machine_start() override ATTR_COLD; + virtual void machine_reset() override ATTR_COLD; + + required_device m_maincpu; + required_device m_sslcpu; +}; + + +// Input ports +static INPUT_PORTS_START( css11501sk9 ) +INPUT_PORTS_END + + +void css11501sk9_state::machine_reset() +{ +} + +void css11501sk9_state::machine_start() +{ +} + +void css11501sk9_state::css11501sk9(machine_config &config) +{ + // basic machine hardware + RM7000BE(config, m_maincpu, 400'000'000); // Main CPU, PMC RM7000A 400T + RM7000BE(config, m_sslcpu, 400'000'000); // SSL CPU, PMC RM7000A 400T +} + + +ROM_START( css11501sk9 ) + ROM_REGION(0x410000, "maincpu", 0) // Main + ROM_LOAD( "css11501s-k9_73-8174-04_17-7009-03_cs-a393_0514_hm_am29lv320db.u46", 0x000000, 0x410000, CRC(fdc00a8f) SHA1(cc89c39462e783d874abebbed2a80bd9ec095047) ) + + ROM_REGION(0x200000, "sslcpu", 0) // SSL + ROM_LOAD( "css11501s-k9_73-6917-06_17-6860-03_cs-7edd_0525_am29lv160db.u36", 0x000000, 0x200000, CRC(6dfe6620) SHA1(06cc9015907c74284a6b85393c0024729146a19b) ) + + ROM_REGION(0x001eb3, "plds", 0) + ROM_LOAD( "css11501s-k9_73-6917-06_17-6858-01_172f5a_2305_i4ps_epm3128atc100-5.u11", 0x000000, 0x001eb3, CRC(a094a0d3) SHA1(a4897096fd7b26b3a3e3c928fa8d1cfd2a2f5641) ) // Altera Max EPM3128ATC100-5 on SSL sub-board + + ROM_REGION(0x040000, "fpga", 0) + ROM_LOAD( "css11501s-k9_73-6917-06_17-6859-02_cs-32cb_0519_xilinx_18v01jc.u2", 0x000000, 0x020000, CRC(bd69fa75) SHA1(9ff93c1f202ad1c178996e7ffd2afd644afd3fe6) ) // Xilinx 18V01JC next to the Xilinx Spartan XC2S50, on SSL sub-board + ROM_LOAD( "css11501s-k9_73-8174-04_17-7008-02_cs-3be7_0524_xc18v02cg44.u43", 0x000000, 0x040000, CRC(a258b636) SHA1(f1cd8409362572cc45fa077179d98a1bb0df383f) ) // Xilinx XC18V02 next to the Xilinx Spartan XC2S50 at U23, on main PCB + + ROM_REGION(0x000200, "seeprom", 0) + ROM_LOAD( "css11501s-k9_73-8174-04_24c02n.u11", 0x000000, 0x000100, CRC(bbe4ba95) SHA1(a56ebd9a98a51d63178da7c93c2b9e557e987a5c) ) // 24C02N SEEPROM near the Xilinx Spartan XC2S50 at U23, on main PCB + ROM_LOAD( "css11501s-k9_73-8174-04_24c02n.u28", 0x000000, 0x000100, CRC(a10ac3ca) SHA1(c68610c51106d2351570c1c77ab1cf1fb210ffb1) ) // 24C02N SEEPROM near the Xilinx Spartan XC2S50 at U33, on main PCB + ROM_LOAD( "css11501s-k9_73-8174-04_24c04r6.u25", 0x000000, 0x000200, CRC(cfe0b9c1) SHA1(2af0645dc5aaab26c0330ef97b97c4958f3ff173) ) // 24C04R6 SEEPROM near the PCMCIA slots, on main PCB + ROM_LOAD( "css11501s-k9_73-8174-04_24c04r6.u32", 0x000000, 0x000200, CRC(d2b2c2d3) SHA1(ea2ec6863749e1020a79710b36d1ac42528c7855) ) // 24C04R6 SEEPROM near the PCMCIA slots, on main PCB + ROM_LOAD( "css11501s-k9_73-6917-06_24c04r6.u33", 0x000000, 0x000200, CRC(bd7bc39f) SHA1(9d0ac37bb3ec8c95990fd37a962a17a95ce97aa0) ) // 24C04R SEEPROM between the BCM5700C2KPB, the VSC2102-08UQ, and the 71V546S133PF, on SSL sub-board + ROM_LOAD( "css11501s-k9_73-6917-06_24c02n.u8", 0x000000, 0x000100, CRC(dcbe3083) SHA1(81934196733a8878cc19ced4f1791dfaa4da494a) ) // 24C02N SEEPROM between the BCM5700C2KPB, the 71V546S133PF, and the XC2S50, on SSL sub-board + + ROM_REGION(0x004400, "pic", 0) + // CONFIG = 3eh, ID = ff3fff3fff3fff3fh + ROM_LOAD( "css11501s-k9_73-8174-04_17-6486-03_2605_27af12_pic16lf877pt_user.u35", 0x000000, 0x004000, CRC(22b03fe9) SHA1(984c14fb013763aa4fb981888480d19a6058843b) ) // PIC16LF877, on main PCB + ROM_LOAD( "css11501s-k9_73-8174-04_17-6486-03_2605_27af12_pic16lf877pt_data.u35", 0x000000, 0x000200, CRC(14bfe63a) SHA1(ebe833da793930303ac57c873a97f8383494a939) ) // PIC16LF877, on main PCB + + // CONFIG = 3eh, ID = 7f007f007f007f00h + ROM_LOAD( "css11501s-k9_73-8174-04_17-6494-02_1605_92817_pic16lf872_user.u7", 0x000000, 0x001000, CRC(6deebf3a) SHA1(c8f030657b7959c6d3aa5b1583786eb84ed199c1) ) // PIC16LF872, on SSL sub-board + ROM_LOAD( "css11501s-k9_73-8174-04_17-6494-02_1605_92817_pic16lf872_data.u7", 0x000000, 0x000080, CRC(903500ff) SHA1(d33277afda835773cfcc9bc137690cbe79943f0f) ) // PIC16LF872, on SSL sub-board +ROM_END + +} // Anonymous namespace + +// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS +SYST( 2002, css11501sk9, 0, 0, css11501sk9, css11501sk9, css11501sk9_state, empty_init, "Cisco", "CSS11501S-K9", MACHINE_NO_SOUND | MACHINE_NOT_WORKING ) diff --git a/src/mame/skeleton/huangyeh_m68k.cpp b/src/mame/skeleton/huangyeh_m68k.cpp new file mode 100644 index 0000000000000..d2dbeb1f35e72 --- /dev/null +++ b/src/mame/skeleton/huangyeh_m68k.cpp @@ -0,0 +1,235 @@ +// license:BSD-3-Clause +// copyright-holders: + +/* +Wu Lin Zhengba, Huang Yeh, 1999? +Hardware Info by Guru +--------------------- + +HY-9802 +|--------------------------------------------------------------| +| SW5 EPM7032 M5M482128 M5M482128 T518B| +| M5M482128 M5M482128 | +| | +|-| BATT | + | EPM7032 | +|-| |---------| | +| |HUANG YEH| | +| 22MHz | | PAL22V10 | +|J 68000 63484 | HY9920 | PAL16V8 | +|A | | | +|M |---------| | +|M 6116 | +|A Z80 U6612 | +| U34 | +| 6264 U9 U8 U41 U45 U42 U46 | +| 6264 M6295 U28 | +|-| 86171 | + | | +|-| 3.579545MHz U6614 | +| 8.448MHz | +| SW1 SW2 SW3* SW4* T518B LM324 TL084| +| ULN2003 1242H | +|----| 22WAY |-----------------| 10WAY |----| + |----------------------| |-----------| +Notes: + 68000 - Motorola MC68000P8 CPU. Clock Input 8.448MHz + 63484 - Hitachi HD63484P8 Advanced CRT Controller (ACRTC). Clock Input Pin 2CLK = 5.5MHz [22/4] + Z80 - Zilog Z84C0004 Z80 CPU. Clock Input 4.224MHz [8.448/2] + U6612 - Clone of YM3812 FM Operator Type-LII (OPLII) Sound Chip. Clock Input 3.579545MHz + U6614 - Clone of YM3014 Serial Input Floating D/A Converter + M6295 - OKI M6295 4-Channel ADPCM Voice Synthesis LSI. Clock Input 2.112MHz [8.448/4]. Pin 7 LOW + M5M482128 - Mitsubishi M5M482128AJ-8 1Mbit Dual Port RAM with 128kB x8-bit DRAM and 256 x8-bit Serial Port + 6116 - 6116 2kB x8-bit SRAM + 6264 - 6264 8kB x8-bit SRAM (both chips battery-backed) + HY9920 - Custom QFP160 Graphics Chip + 86171 - HMC HM86171-80 Color Palette With Triple 6-Bit DAC + TL084 - Texas Instruments TL084 Quad JFET-Input Operational Amplifier + LM324 - Texas Instruments LM324 Quad Operational Amplifier + 1242H - NEC uPC1242H Audio Power Amplifier + SW1-4 - 8-Position DIP Switch. * = SW3 and SW4 Not Populated. + SW5 - Reset Switch and Clear NVRAM + T518B - Mitsumi T518B Reset Chip (TO92) + BATT - 3.6V Ni-Cad Battery. Powers 2x 6264 SRAMs when power is off. + ULN2003 - ULN2003 7-Channel Darlington Transistor Array + EPM7032 - Altera EPM7032 CPLD + U8,U9 - 27C040 EPROM (68000 Program) + U4x - 27C040 EPROM (Graphics) + U34 - 27C256 EPROM (Z80 Program) + U28 - 27C040 EPROM (Oki Samples) +*/ + + +#include "emu.h" + +#include "cpu/m68000/m68000.h" +#include "cpu/z80/z80.h" +#include "sound/okim6295.h" +#include "sound/ymopl.h" +#include "video/hd63484.h" +#include "video/ramdac.h" + +#include "emupal.h" +#include "screen.h" +#include "speaker.h" +#include "tilemap.h" + + +namespace { + +class huangyeh_m68k_state : public driver_device +{ +public: + huangyeh_m68k_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), + m_maincpu(*this, "maincpu") + { } + + void wlzb(machine_config &config) ATTR_COLD; + + +private: + required_device m_maincpu; + + void main_program_map(address_map &map) ATTR_COLD; + void audio_program_map(address_map &map) ATTR_COLD; + void ramdac_map(address_map &map) ATTR_COLD; + void hd63484_map(address_map &map) ATTR_COLD; +}; + + +void huangyeh_m68k_state::main_program_map(address_map &map) +{ + map.unmap_value_high(); + map(0x000000, 0x0fffff).rom(); + //map(0x1d0000, 0x1d0003).rw("acrtc", FUNC(hd63484_device::read16), FUNC(hd63484_device::write16)); + //map(0x1d0009, 0x1d0009).w("ramdac", FUNC(ramdac_device::index_w)); + //map(0x1d000b, 0x1d000b).w("ramdac", FUNC(ramdac_device::pal_w)); + //map(0x1d000d, 0x1d000d).w("ramdac", FUNC(ramdac_device::mask_w)); + map(0x1f0000, 0x1f3fff).ram(); +} + +void huangyeh_m68k_state::audio_program_map(address_map &map) +{ + map(0x0000, 0x7fff).rom(); + map(0xf000, 0xf7ff).ram(); + map(0xf880, 0xf881).w("ymsnd", FUNC(ym3812_device::write)); +} + +void huangyeh_m68k_state::ramdac_map(address_map &map) +{ + map(0x000, 0x3ff).rw("ramdac", FUNC(ramdac_device::ramdac_pal_r), FUNC(ramdac_device::ramdac_rgb666_w)); +} + +void huangyeh_m68k_state::hd63484_map(address_map &map) +{ + //map(0x00000, 0x7ffff).ram(); +} + + +static INPUT_PORTS_START( wlzb ) + 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_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("IN1") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) + 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_DIPUNKNOWN_DIPLOC(0x01, 0x01, "SW1:1") + PORT_DIPUNKNOWN_DIPLOC(0x02, 0x02, "SW1:2") + PORT_DIPUNKNOWN_DIPLOC(0x04, 0x04, "SW1:3") + PORT_DIPUNKNOWN_DIPLOC(0x08, 0x08, "SW1:4") + PORT_DIPUNKNOWN_DIPLOC(0x10, 0x10, "SW1:5") + PORT_DIPUNKNOWN_DIPLOC(0x20, 0x20, "SW1:6") + PORT_DIPUNKNOWN_DIPLOC(0x40, 0x40, "SW1:7") + PORT_DIPUNKNOWN_DIPLOC(0x80, 0x80, "SW1:8") + + PORT_START("DSW2") + PORT_DIPUNKNOWN_DIPLOC(0x01, 0x01, "SW2:1") + PORT_DIPUNKNOWN_DIPLOC(0x02, 0x02, "SW2:2") + PORT_DIPUNKNOWN_DIPLOC(0x04, 0x04, "SW2:3") + PORT_DIPUNKNOWN_DIPLOC(0x08, 0x08, "SW2:4") + PORT_DIPUNKNOWN_DIPLOC(0x10, 0x10, "SW2:5") + PORT_DIPUNKNOWN_DIPLOC(0x20, 0x20, "SW2:6") + PORT_DIPUNKNOWN_DIPLOC(0x40, 0x40, "SW2:7") + PORT_DIPUNKNOWN_DIPLOC(0x80, 0x80, "SW2:8") +INPUT_PORTS_END + + +// TODO +static GFXDECODE_START( gfx ) +GFXDECODE_END + + +void huangyeh_m68k_state::wlzb(machine_config &config) +{ + // basic machine hardware + M68000(config, m_maincpu, 8.448_MHz_XTAL); + m_maincpu->set_addrmap(AS_PROGRAM, &huangyeh_m68k_state::main_program_map); + m_maincpu->set_vblank_int("screen", FUNC(huangyeh_m68k_state::irq0_line_hold)); + + z80_device &audiocpu(Z80(config, "audiocpu", 8.448_MHz_XTAL / 2)); + audiocpu.set_addrmap(AS_PROGRAM, &huangyeh_m68k_state::audio_program_map); + + // video hardware + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); // TODO: verify everything once emulation works + screen.set_refresh_hz(60); + screen.set_vblank_time(ATTOSECONDS_IN_USEC(0)); + screen.set_size(64*8, 32*8); + screen.set_visarea(0*8, 64*8-1, 2*8, 30*8-1); + screen.set_screen_update("acrtc", FUNC(hd63484_device::update_screen)); + screen.set_palette("palette"); + + GFXDECODE(config, "gfxdecode", "palette", gfx); + + PALETTE(config, "palette").set_entries(0x100); // TODO + + RAMDAC(config, "ramdac", 0, "palette").set_addrmap(0, &huangyeh_m68k_state::ramdac_map); + + HD63484(config, "acrtc", 22_MHz_XTAL / 4).set_addrmap(0, &huangyeh_m68k_state::hd63484_map); + + // sound hardware + SPEAKER(config, "mono").front_center(); + + YM3812(config, "ymsnd", 3.579545_MHz_XTAL).add_route(ALL_OUTPUTS, "mono", 1.0); + + OKIM6295(config, "oki", 8.448_MHz_XTAL / 4, okim6295_device::PIN7_LOW).add_route(ALL_OUTPUTS, "mono", 1.0); +} + + +ROM_START( wlzb ) + ROM_REGION( 0x100000, "maincpu", 0 ) + ROM_LOAD16_BYTE( "w1-a.u9", 0x00000, 0x80000, CRC(2b6cd511) SHA1(0abfe24d83964eb45f348c5cbfd2ad50474db3c6) ) + ROM_LOAD16_BYTE( "w2-a.u8", 0x00001, 0x80000, CRC(df068584) SHA1(de051d56b9d64027f1b6dee609272186c3575bef) ) + + ROM_REGION( 0x8000, "audiocpu", 0 ) + ROM_LOAD( "w7.u34", 0x0000, 0x8000, CRC(c00786b3) SHA1(a8b3ddf3dd1b702d8719eace1b65f42c727b9473) ) + + ROM_REGION( 0x200000, "tiles", 0 ) + ROM_LOAD( "w3.u41", 0x000000, 0x080000, CRC(58e57d87) SHA1(f870d0729528b2fda495da059f110e466ea58de5) ) + ROM_LOAD( "w4.u45", 0x080000, 0x080000, CRC(5e993a35) SHA1(ed39dbc89cafebc8348f05a6327efa1ea26ff466) ) + ROM_LOAD( "w5.u42", 0x100000, 0x080000, CRC(e728751d) SHA1(00bc65793a65ede318e5412d06eb85259015a5c1) ) + ROM_LOAD( "w6.u46", 0x180000, 0x080000, CRC(a0ea7f31) SHA1(ef985de34485cb65ac59f7938583a0607213c81a) ) + + ROM_REGION( 0x80000, "oki", 0 ) + ROM_LOAD( "w8.u28", 0x00000, 0x80000, CRC(aad9367b) SHA1(e0b20087a8eab9d16e5cb1ed6415ca5373a43da7) ) +ROM_END + +} // anonymous namespace + + +GAME( 1999, wlzb, 0, wlzb, wlzb, huangyeh_m68k_state, empty_init, ROT0, "Huang Yeh", "Wu Lin Zhengba", MACHINE_NO_SOUND | MACHINE_NOT_WORKING ) diff --git a/src/mame/skeleton/mice.cpp b/src/mame/skeleton/mice.cpp index 9813fcc3c375b..3572ad4068679 100644 --- a/src/mame/skeleton/mice.cpp +++ b/src/mame/skeleton/mice.cpp @@ -1,8 +1,8 @@ // license:BSD-3-Clause -// copyright-holders:Miodrag Milanovic +// copyright-holders: Miodrag Milanovic /*************************************************************************** -Microtek International Inc MICE (Micro-In-Circuit Emulator) +Microtek International Inc. MICE (Micro-In-Circuit Emulator) 2013-08-27 Skeleton driver. @@ -101,7 +101,7 @@ void mice_state::mice2_io(address_map &map) map(0xe8, 0xed).rw("rtt8155", FUNC(i8155_device::io_r), FUNC(i8155_device::io_w)); } -/* Input ports */ +// Input ports static INPUT_PORTS_START( mice ) PORT_START("BAUD") PORT_DIPNAME(0x07, 0x02, "Baud Rate") PORT_DIPLOCATION("DSW7:1,2,3") @@ -163,7 +163,7 @@ DEVICE_INPUT_DEFAULTS_END void mice_state::mice(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware I8085A(config, m_maincpu, 6.144_MHz_XTAL); m_maincpu->set_addrmap(AS_PROGRAM, &mice_state::mice_mem); m_maincpu->set_addrmap(AS_IO, &mice_state::mice_io); @@ -205,7 +205,7 @@ void mice_state::mice2(machine_config &config) I8155(config, "rtt8155", 0); } -/* ROM definitions */ +// ROM definitions ROM_START( mice_6502 ) ROM_REGION( 0x4000, "mcp", 0 ) ROM_LOAD( "6502_u10_v.2.0", 0x2000, 0x1000, CRC(496c53a7) SHA1(f28cddef18ab3e0eca1fea125dd678a54817c9df) ) @@ -243,11 +243,11 @@ ROM_END } // anonymous namespace -/* Driver */ +// Driver -// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS -COMP( 1981, mice_6502, 0, 0, mice, mice, mice_state, empty_init, "Microtek International", "MICE 6502 (Rev-A)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND_HW ) -COMP( 1984, mice2_z80, 0, 0, mice2, micev3, mice_state, empty_init, "Microtek International", "MICE-II Z80 (Rev-F)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND_HW ) -COMP( 1987, mice2_6502, mice2_z80, 0, mice2, micev3, mice_state, empty_init, "Microtek International", "MICE-II 6502 (Rev-F)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND_HW ) -COMP( 1987, mice2_8085, mice2_z80, 0, mice2, micev3, mice_state, empty_init, "Microtek International", "MICE-II 8085 (Rev-M)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND_HW ) -COMP( 1987, mice2_6809, mice2_z80, 0, mice2, micev3, mice_state, empty_init, "Microtek International", "MICE-II 6809(E) (Rev-L)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND_HW ) +// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS +COMP( 1981, mice_6502, 0, 0, mice, mice, mice_state, empty_init, "Microtek", "MICE 6502 (Rev-A)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND_HW ) +COMP( 1984, mice2_z80, 0, 0, mice2, micev3, mice_state, empty_init, "Microtek", "MICE-II Z80 (Rev-F)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND_HW ) +COMP( 1987, mice2_6502, mice2_z80, 0, mice2, micev3, mice_state, empty_init, "Microtek", "MICE-II 6502 (Rev-F)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND_HW ) +COMP( 1987, mice2_8085, mice2_z80, 0, mice2, micev3, mice_state, empty_init, "Microtek", "MICE-II 8085 (Rev-M)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND_HW ) +COMP( 1987, mice2_6809, mice2_z80, 0, mice2, micev3, mice_state, empty_init, "Microtek", "MICE-II 6809(E) (Rev-L)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND_HW ) diff --git a/src/mame/skeleton/mice3s68k.cpp b/src/mame/skeleton/mice3s68k.cpp new file mode 100644 index 0000000000000..fc5e1b1338f08 --- /dev/null +++ b/src/mame/skeleton/mice3s68k.cpp @@ -0,0 +1,116 @@ +// license:BSD-3-Clause +// copyright-holders: + +/********************************************************************************************** + +Skeleton driver for Microtek MICE IIIS 68000 in-circuit emulator. + +Three hardware components. + +1.- Main unit with three PCBs: + +CPM PCB (CPU): + - 4 x EPROM. + - 1 x PROM. + - 1 x Intel R80186 near a 16 MHz crystal. + - 2 x Mitsubishi M5M5256BP-10L (RAM). + - 1 x Zilog Z0853006PSC near a 3.3864 MHz crystal. + - Small suboard with one Serial RS-232C (DCE) port (DB25) and one Parallel port (DB25). + - 1 x Reset switch. + +EPM-6800A PCB: + - 4 x NEC D8255AC-2. + - 2 x GAL16V8. + - 1 x Cypress CY7C166-25PC (RAM). + - 2 x Sony CXK5814P-35 (RAM). + - 2 x BNC connector (start slave out, sync start in). + - 1 LED (EP run). + +HEMM PCB: + - 4 x NEC D8255AC-2. + - 33 x Mitsubishi M5M5256BP-70L (RAM). + +LAM-IIS PCB: + - 8 x NEC 71055L. + - 2 x AMC MACH110-12JC. + - 1 x 40 MHz crystal. + - 11 x GAL16V8. + - 8 x P4C198-15JC (RAM). + - 3 x BNC connector (sync 1 output, sync 2 output, ext trigger input). + - 4 x Cypress CY7C196-25VC (RAM). + - 16 x IDT 71256 (RAM). + - 1 x Trace Bits port (DB9). + - 1 LED (+5V power). + +2.- EPOD-68000, external box for connecting the main unit to the CPU pass-through apapter, +with connectors, one GAL16V8 and some logic. + +3.- CPU pass-through apapter. + +**********************************************************************************************/ + +#include "emu.h" +#include "cpu/i86/i186.h" + + +namespace { + +class mice3s68k_state : public driver_device +{ +public: + mice3s68k_state(const machine_config &mconfig, device_type type, const char *tag) + : driver_device(mconfig, type, tag) + , m_maincpu(*this, "maincpu") + { } + + + void mice3s68k(machine_config &config); + +private: + required_device m_maincpu; +}; + + +static INPUT_PORTS_START(mice3s68k) +INPUT_PORTS_END + +void mice3s68k_state::mice3s68k(machine_config &config) +{ + I80186(config, m_maincpu, 16_MHz_XTAL); // Intel R80186 +} + + +// FW V5.2 +ROM_START(mice3s68k) + ROM_REGION(0x30000, "maincpu", 0) + ROM_LOAD( "iiis_68000_v5.2.u11", 0x00000, 0x08000, CRC(cd94dd5d) SHA1(3a609f2dca9bc22a764188704eaa8ca952d1637c) ) + ROM_LOAD( "iiis_68000_v5.2.u12", 0x00800, 0x08000, CRC(fb9c9185) SHA1(6463274989f5e25cba08dbcac485eda583c7c602) ) + ROM_LOAD( "iiis_68000_v5.2_27c512.u14", 0x01000, 0x10000, CRC(75f8841f) SHA1(3ac20ff642f36145f0310fe96791bae74305e7ec) ) + ROM_LOAD( "iiis_68000_v5.2_27c512.u15", 0x02000, 0x10000, CRC(d2dbf91f) SHA1(90ce54ba3950944bb077e95e96b1388370baec32) ) + + ROM_REGION(0x00100, "prom", 0) + ROM_LOAD( "x2212p.u5", 0x00000, 0x00100, CRC(c4089451) SHA1(4997cd46ddeab498ced5243e84d4f7fbe5c4597e) ) + + ROM_REGION(0x00117, "pld", 0) + ROM_LOAD( "54983012_gal16v8.u24", 0x00000, 0x00117, NO_DUMP ) // EPOD-68000 + ROM_LOAD( "54982021_gal16v8.u58", 0x00000, 0x00117, NO_DUMP ) // EPM-68000A + ROM_LOAD( "54982011_gal16v8.u46", 0x00000, 0x00117, NO_DUMP ) // EPM-68000A + ROM_LOAD( "08309011_gal16v8.u3", 0x00000, 0x00117, NO_DUMP ) // HEMM + ROM_LOAD( "55005121_mach110.u106", 0x00000, 0x00117, NO_DUMP ) // LAM-IIS + ROM_LOAD( "55005131_mach110.u128", 0x00000, 0x00117, NO_DUMP ) // LAM-IIS + ROM_LOAD( "55005062_gal16v8.u55", 0x00000, 0x00117, NO_DUMP ) // LAM-IIS + ROM_LOAD( "55005071_gal16v8.u56", 0x00000, 0x00117, NO_DUMP ) // LAM-IIS + ROM_LOAD( "55005081_gal16v8.u58", 0x00000, 0x00117, NO_DUMP ) // LAM-IIS + ROM_LOAD( "55005091_gal16v8.u59", 0x00000, 0x00117, NO_DUMP ) // LAM-IIS + ROM_LOAD( "55005031_gal16v8.u30", 0x00000, 0x00117, NO_DUMP ) // LAM-IIS + ROM_LOAD( "55005041_gal16v8.u31", 0x00000, 0x00117, NO_DUMP ) // LAM-IIS + ROM_LOAD( "55005051_gal16v8.u44", 0x00000, 0x00117, NO_DUMP ) // LAM-IIS + ROM_LOAD( "55005011_gal16v8.u9", 0x00000, 0x00117, NO_DUMP ) // LAM-IIS + ROM_LOAD( "55005021_gal16v8.u10", 0x00000, 0x00117, NO_DUMP ) // LAM-IIS + ROM_LOAD( "55005101_gal16v8.u78", 0x00000, 0x00117, NO_DUMP ) // LAM-IIS + ROM_LOAD( "55005111_gal16v8.u32", 0x00000, 0x00117, NO_DUMP ) // LAM-IIS +ROM_END + +} // anonymous namespace + +SYST( 1992, mice3s68k, 0, 0, mice3s68k, mice3s68k, mice3s68k_state, empty_init, "Microtek", "MICE-IIIS 68000", MACHINE_NO_SOUND | MACHINE_NOT_WORKING ) diff --git a/src/mame/skeleton/optomaxv.cpp b/src/mame/skeleton/optomaxv.cpp new file mode 100644 index 0000000000000..e29fe3efa4821 --- /dev/null +++ b/src/mame/skeleton/optomaxv.cpp @@ -0,0 +1,469 @@ +// license:BSD-3-Clause +// copyright-holders: +/********************************************************************************************************* + +Optomax V image analyser, from AMS (Analytical Measuring Systems Ltd.). +The machine internally uses a CUBE EuroBEEB Single Board Computer (PCBs B6 and B7). + +Back panel: + - Camera input connector (DIN). + - Camera video connector (3 x BNC). + - VCR connector (BNC). + - TGB monitor connector (DIN) + - Printer connector (DB 26) + - Data transfer serial connector (DB9). + - Data transfer parallel connector (DB25). + - Aux 1 connector (DIN). + - Two sync mode switches (internal/external and interlace/non interlace). + +Front panel: + - Monitor (Philips M24-306GH/ED). + - Control panel with the following layout: + ______________________________________________________________________________________________ +| _____ FIELD/ | +| / \ FRAME TITLE FEATURE V (F1) | +| | DIAL | SET | +| | | DETECTOR CURRENT INITIATE W (F2) | +| \_____/ EDIT CALIBRATE HOLD | +| X (F3) | +| | +| PREVIOUS NEXT A B (7) C (8) D (9) E (PRINT) F (ABORT) Y (F4) | +| (DETECT NULL) | +| UP G (HE) H (4) I (5) J (6) K (SPACE) L Z (F5) | +| (SEND DATA) | +| RIGHT HOME LEFT M (MR) N (1) O (2) P (3) Q (EXP) R / (F6) | +| (LOAD MATRIX) | +| DOWN GREEN S (0) T (·) U (DEL) ENTER GREEN , (F7) | +|_____________________________________________________________________________________________| + + +Six PCBs connected with two backplanes (Motorola VME 9 conns and a custom one with 13 conns): + +OSD PCB (B6) (EURO-BEEB 65, CUBE EuroBEEB Single Board Computer PCB from Control Universal Ltd.) + - Rockwell R6551AP ACIA + - Rockwell R6522AP VIA + - Toshiba TC5565PL SRAM + - Xtal 1.8432 + - Hitachi HN613128PB05 Acorn BASIC Mask ROM (BASIC) + - 2764 EPROM + - M-3002-16PI Real Time Clock (RTC) + - 2 x Signetics 82S147N PROMs + - Rockwell R6502AP CPU + __________________________________________ + _| |_ +| |__________________________________________| | +| Xtal ________________________ | +| ___ ___________ | Rockwell | | +|| | |_82S147N__| | R6502AP | | +|| | ___________ |_______________________| | +|| | |_82S147N__| | +||_<-M-3002-16PI _________________ | +| | EPROM | | +| __________ | M0 | | +| |M74HC132B1 |________________| | +| __________ _________________ | +| |SN74S00N_| | MASK (BASIC) | | +| | M1 | | +| _____ |________________| | +| | | _________________ | +| |BATT| | EMPTY | | +| |2.4V| __________ | M3 | | +| |____| |_74F04N__| |________________| | +| __________ __________ _________________ | +||AM26LS30PC |AM26LS32PC | TC5565PL-15 | | +| .. | | | +| Xtal 1.8432 MHz .. |________________| | +| _________________ ________________________ | +|| Rockwell | | Rockwell | | +|| R6551AP | | R6522AP | | +||________________| |_______________________| | +| _______ ___________________ | +|__| DIN |_____||||||||||||||||||||___________| + |______| + + + TELETEXT PCB (B5) (CUBE TELETEXT Colour Video Interface from Control Universal Ltd.) +(this PCB lacks the buzzer present on other revisions) + - Hitachi HD68B45SP CRT Controller + - Xtal 6.000 + - 2 x NEC uPD2114LC SRAM + - SAA 5050 Teletext Character Generator + - Rockwell R6522-33 VIA + _____________________ + _____| |__________________ +| |_____________________| | +| __________ ____________________ | +| |SN74LS174N | Rockwell | | +| | R6522AP | | +| __________ |___________________| | +| |_74LS86N_| _________________ | +| | | | +| __________ | SAA 5050 | | +| |_74LS04N_| |________________| | +| __________ __________ __________ | +| |_74LS04N_| |_74LS92N_| |uPD2114LC| | +| Xtal __________ __________ | +| 6 MHz |74LS245N_| |uPD2114LC| | +| __________ | +| |_74LS00N_| ____________________ | +| | Hitachi | | +| | HD46505SP-2 | | +| |____________________| | +| __________ __________ __________ | +| |74LS138N_| |74LS157N_| |74LS157N_| | +| __________ __________ __________ | +| |74LS139N_| |74LS136N_| |74LS157N_| | +| __________________________________________ | +|_| |_| + |__________________________________________| + + +PCU PCB (PME 68-1B) (B4) + - Signetics SCN68000 CPU + - 16 x TMM41256P RAM + - 2 x 27256 EPROM + - 2 x 27128 EPROM + - 3 x Hitachi HD46850P ACIA + - AMPAL16L8 (labeled 0545) + - PAL16L6C (labeled 0544) + - 2 x PAL20L10C (labeled 0686 and 0620) + - PAL12L10C (labeled 0546) + - MM58167AN Real Time Clock (RTC) + - MC68230L8 Parallel Interface / Timer 8MHz + - Xtal 1.8432 MHz + - MC14411P Bit Rate Generator + - Xtal 32 MHz + _____________________________________________________________________ + | ________ _______________________________ __________ | + _|_ | | | | |SN74LS645-1N | + RES SW| | | | | __________ _|_ + _|_ | | | 16 x TMM41256P-15 | |SN74LS645-1N | | + ABT SW| | | | | :::::: | | + | |SCN68000 |______________________________| __________ | | +HTL LED | | _______________ _______________ |SN74LS645-1N | | + _|_ | | | EPROM | | EPROM | __________ | | + | | | | | | | | |SN74LS645-1N | | + |P3 | | | |______________| |______________| __________ | | + |DB25 | | _______________ _______________ |SN74LS645-1N | | + | | | | | EPROM | | EPROM | __________ | | + |___| | | | | | | |SN74LS645-1N | | + | |_______| |______________| |______________| __________ | | + _|_ .. :::::::: |SN74LS645-1N | | + | | .. ____________ __________ ::::.. __________ | | + |P4 | .. | HD46850P | |SN74LS641_| __________ |AMPAL16L8| | | + |DB25 .. | | .. ::::::: |_74F74PC_| __________ |___| + | | .. |____________| |_74F241PC| | + |___| .. __________ __________ __________ __________ | + | |_74S240N_| |_PAL16L6_| |PAL20l10_| |SN74LS175N | + _|_ .. __________ __________ __________ __________ ___________ | + | | ..|_74S240N_| |SN74LS260N |SN74LS148N |SN74LS200N |MM58167AN | | + |P5 | .. __________ __________ __________ __________ | | | + |SB25 ..|SN74LS393N |_74F74PC_| |SN74LS688N |_74F37N__| |__________| | + | | .. ________ __________ ::::::::: ..... :: _|_ + |___| ..|SN74LS56P |_74F241PC| __________ . | | + | __________ __________ |PAL20L10_| : | | + | |SN75188N_| |DM74LS01N| ________________________ | | + | ______ ______ __________ | | | | + | | | | | |PAL12L10_| | MC68230L8 | | | + | | 2 x HD46850P| __________ ... |_______________________| | | + | | | | | |SN75189N_| ::: Xtal | | + | | | | | __________ _________1.8432 MHz_________ | | + | .. |_____| |_____| |SN75188N_| |SN74LS556P |SN74LS175N | | + | .. ______ ___ __________ __________ __________ __________ | | + | .. | | | | |_74F74PC_| |_SN74S08N| |_74F74PC_| |SN74LS32N| | | + MC14411P-> | | | __________ __________ __________ __________ | | + | .. SN75189N->_| |_DL6311__| |_74F37N__| |_NE556N__| |_EP8304__| | | + | | | __________ __________ __________ | | + | |_____|Xtal |_74F74PC_| |_74F74PC_| |SN74LS56P| .. |___| + |___________32 MHz___________________________________________________| + + +PCB (B3) (labeled "9000-0025 SS 1-1") + - HM6116LP-3 + - MK48202B-20 NVRAM + - 2 x HM6264LP-15 + - 3 x 27128 EPROM + - Fujitsu MB7124H + _______________________________________ _______________________________________ + __| |____________| |_ + | |_______________________________________| |_______________________________________| | + | ... ::::::: | + | _______ __________ __________ __________ __________ __________ __________ __________ | + | |_P232_| |CD74HCT08E |SN74LS645| |SN74LS682N |SN74LS645N |SN74LS645N |SN74LS645N |SN74LS645N | + | ______ ______ __________ ______ ______ ______ ______ ______ | + | | | | | |PC74HCT157P | <-HM6264LP-15 | | | | | | | | + | HM6116LP-3-> | | | __________ | | | <-HM6264LP-15 | | | | <-EPROM| + | | MK48202B-20-> | |CD74HCT157E | | | | | <-EPROM | | | | | + | | | | | __________ | | | | | | | <-EPROM | | | + | |_____| |_____| |CD74HCT157E |_____| |_____| |____ | |_____| |_____| | + | _________ __________ __________ __________ __________ __________ __________ __________ | + | CD74HCT32E PC74HCT138P PC74HCT157P CD74HCT04E PC74HCT164P CD74HCT273E |_MB7124H_| CD74HCT32E | + | ::::. | + | _________ __________ __________ __________ __________ __________ __________ __________ | + | |__8429__| PC74HCT139P PC74HCT139P CD74HCT174E CD74HCT74E SN74LS645N PC74HCT374P SN74LS645N | + | _________ __________ __________ :::: | + | CD74HCT04E CD74HCT74E CD74HCT08E _____________ | + |_____________________________________________________________________________| |_____| + |_____________| + +PCB MEASUREMENT (B2) (labeled "MEASUREMENT CIRCUIT 9000-0024") + - AM2149-45DC + - 12 x TMS4416-15NL + - 2 x Intel P8254 + - Motorola MC68230P10 + - 3 x AM27S21APC PROM + - Fujitsu MB7124H PROM + + +PCB VIDEO (B1) (labeled "OPTOMAX VIDEO PCB 9000-0022-2/2") + - Xtal (unoknown frequency, labeled "Xtal Hy-O 2562-50 GE01S") + - 2716 EPROM + - 2 x Toshiba TC5565PL-15 + - Motorola MC68230P8 + ___ ___ ___ ___ + | | | | | | | | + _______________| |___| |___| |___| |________________________________ + | |___| |___| |___| |___| | + | 4 x BNC | + _|_ ······ __________ __________ __________ ······ | +| | |_74128N__| |PC74HCT04P |PC74HCT74P | +| | __________ __________ __________ __________ | +| | |HEF4046BP| |SN74LS221N |PC74HCT74P |I1-524-5_| | +| | ________ __________ | +| | |CA3140E| |SN74LS221N | +| | __________ | +| | |PC74HCT32P | +| | _________ __________ | +| | |SN74LS05N |PC74HCT08P | +| | __________ __________ __________ ________ | +| | |MC74HC04_| |SN74LS123N |_LM361N__| |CA3240E| | +| | | +| | __________ __________ | +| | |_LM361N__| |I1-201-5_| | +|___| _______ __________ | + | |CA3240E| |_LM361N__| | + | _________ __________ __________ | + _|_ CD74HCT151E |CD74HCT86E |_LM361N__| __________ | +| | ________ |I1-201-5_| | +| | |CA3240E| ________ | +| | _________ __________ __________ |CA3140E| | +| | PC74HCT08P |AD7528KN_| |PC74HCT04P | +| | ___ __________ __________ __________ | +| | | | .. ________ |_ZN448E__| |__DAC08__| |CD74HCT00E | +| SN74LS682N-> | .. | | __________ __________ | +| | |__| .. | MC68230P8 PC74HCT374P |SN74LS221N | +| | ___ | | | +| | | | | | ____________ __________ __________ | +| DS75451N->_| | | |TC5565PL-15| CD74HCT393E |SN74LS221N | +| | ___ | | |___________| | +| | | | | | __________ __________ | +| SN74LS645N-> | | | ____________ |PC74HCT74P |CD74HCT00E | +|___| |__| |_______| |TC5565PL-15| __________ __________ | + | BATT _____ |___________| CD74HCT4040E SN74LS221N | + | __________ _____________ __________ __________ | + | PC74HCT32P | EPROM | CD74HCT4040E CD74HCT4040E | + | |____________| | + | __________ __________ __________ __________ | + | |PC74HCT74P |PC74HCT74P |CD74HCT00E |SN74LS682N | + | __________ __________ __________ __________ | + | |_ZNA134H_| |SN74LC221N |PC74HCT157P |PC74LS157P | + | | + | Xtal (labeled "Hy-O 2562-50 GE01S") | + |___________________________________________________________________________| + +*********************************************************************************************************/ + +#include "emu.h" + +#include "cpu/m6502/m6502.h" +#include "cpu/m68000/m68000.h" + +#include "machine/6522via.h" +#include "machine/68230pit.h" +#include "machine/6850acia.h" +#include "machine/m3002.h" +#include "machine/mc14411.h" +#include "machine/mm58167.h" +#include "machine/mos6551.h" +//#include "machine/nvram.h" +#include "machine/pit8253.h" + +#include "video/mc6845.h" +#include "video/saa5050.h" + +#include "screen.h" + + +namespace { + +class optomaxv_state : public driver_device +{ +public: + optomaxv_state(const machine_config &mconfig, device_type type, const char *tag) + : driver_device(mconfig, type, tag) + + // CPU PCB (B4) + , m_maincpu(*this, "maincpu") + , m_acia_1(*this, "acia1") + , m_acia_2(*this, "acia2") + , m_acia_3(*this, "acia3") + , m_brg(*this, "brg") + , m_rtc_1(*this, "rtc1") + , m_pit_1(*this, "pit1") + + // OSD PCB (B6) + , m_bbccpu(*this, "bbccpu") + , m_acia_4(*this, "acia4") + , m_rtc_2(*this, "rtc2") + , m_via_1(*this, "via1") + + // Teletext PCB (B5) + , m_trom(*this, "saa5050") + , m_hd6845(*this, "hd6845") + , m_screen(*this, "screen") + , m_via_2(*this, "via2") + + // Measurement PCB (B2) + , m_pit_2(*this, "pit2") + , m_pit_3(*this, "pit3") + , m_pit_4(*this, "pit4") + + // Video PCB (B1) + , m_pit_5(*this, "pit5") + { } + + void optomaxv(machine_config &config); + +private: + // CPU PCB (B4) + required_device m_maincpu; + required_device m_acia_1; + required_device m_acia_2; + required_device m_acia_3; + required_device m_brg; + required_device m_rtc_1; + required_device m_pit_1; + + // OSD PCB (B6) + required_device m_bbccpu; + required_device m_acia_4; + required_device m_rtc_2; + required_device m_via_1; + + // Teletext PCB (B5) + required_device m_trom; + required_device m_hd6845; + required_device m_screen; + required_device m_via_2; + + // Measurement PCB (B2) + required_device m_pit_2; + required_device m_pit_3; + required_device m_pit_4; + + // Video PCB (B1) + required_device m_pit_5; +}; + + +static INPUT_PORTS_START(optomaxv) +INPUT_PORTS_END + +void optomaxv_state::optomaxv(machine_config &config) +{ + // All clocks unverified + + // Main CPU PCB (B4) + + M68000(config, m_maincpu, 32_MHz_XTAL / 2); // Signetics SCN68000 + + ACIA6850(config, m_acia_1, 0); // Hitachi HD46850P + ACIA6850(config, m_acia_2, 0); // Hitachi HD46850P + ACIA6850(config, m_acia_3, 0); // Hitachi HD46850P + + MC14411(config, m_brg, 32_MHz_XTAL / 10); // Motorola MC14411P + + MM58167(config, m_rtc_1, 32_MHz_XTAL / 10); // National Semiconductor MM58167AN + + PIT68230(config, m_pit_1, 1.8432_MHz_XTAL); // Motorola MC68230L8 + + // OSD PCB (B6) (CUBE EuroBEEB System CPU board) + + M6502(config, m_bbccpu, 1.8432_MHz_XTAL); // Rockwell R6502AP + + MOS6522(config, m_via_1, 1.8432_MHz_XTAL); // Rockwell R6551AP + MOS6551(config, m_acia_4, 1.8432_MHz_XTAL); // Rockwell R6551AP + + M3002(config, m_rtc_2, 1.8432_MHz_XTAL); // uEM M-3002-16PI Real Time Clock + + // Teletext PCB (B5) (CUBE EuroBEEB System Teletext Video Card) + + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_raw(16_MHz_XTAL, 1024, 0, 640, 312, 0, 256); + m_screen->set_screen_update("hd6845", FUNC(hd6845s_device::screen_update)); + + SAA5050(config, m_trom, 6_MHz_XTAL); + m_trom->set_screen_size(40, 25, 40); + + HD6845S(config, m_hd6845, 6_MHz_XTAL / 3); // Hitachi HD46505SP-2 + m_hd6845->set_screen("screen"); + m_hd6845->set_show_border_area(false); + m_hd6845->set_char_width(12); + + MOS6522(config, m_via_2, 6_MHz_XTAL / 6); // Rockwell R6551AP + + // PCB (B3) + + //NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); // Mostek MK48Z02B-20 ZeroPower + + // Measurement PCB (B2) + + PIT68230(config, m_pit_2, 2_MHz_XTAL); // Motorola MC68230P8, unknown xtal + PIT8254(config, m_pit_3); // Intel P8254 + PIT8254(config, m_pit_4); // Intel P8254 + + // VIDEO PCB (B1) + + PIT68230(config, m_pit_5, 2_MHz_XTAL); // Motorola MC68230P8, unknown xtal +} + + +ROM_START(optomaxv) + ROM_REGION(0x18000, "maincpu", 0) + ROM_LOAD16_BYTE( "b4_68up-12-01-sd-1-86_27256.j41", 0x00000, 0x08000, CRC(a3196db7) SHA1(06773dea886908673d9def406d4985a6eef71d0c) ) + ROM_LOAD16_BYTE( "b4_68lw-12-01-sd-1-86_27256.j25", 0x00001, 0x08000, CRC(c0a88d38) SHA1(836a616bb6df84e3e6dfb1d42cacd592f6c6b4e6) ) + ROM_LOAD( "b4_hn4827128g.j24", 0x10000, 0x04000, CRC(a6399550) SHA1(602b7152a5a5cbe1f8f598e6622d2bdfccd5d322) ) + ROM_LOAD( "b4_hn4827128g.j40", 0x14000, 0x04000, CRC(b85f37f7) SHA1(dc532ba0af735233c5a7308a5fbc90be746ee08c) ) + + ROM_REGION(0x44000, "bbccpu", 0) + ROM_LOAD( "b6_abmon4-abci-12-12_hn482764g.m0", 0x40000, 0x02000, CRC(8f9ce214) SHA1(37fca4a5184025ed034acd5f20a4614163246779) ) // On OSD PCB + ROM_LOAD( "b6_hn613128pb05.m1", 0x0c000, 0x04000, CRC(79434781) SHA1(4a7393f3a45ea309f744441c16723e2ef447a281) ) // Standard BBC Micro Acorn BASIC, on OSD PCB + + ROM_REGION(0x10000, "unknown", 0) + ROM_LOAD( "b3_6sr03-04-b03f-1-86_hn4827128g.ic22", 0x00000, 0x04000, CRC(705f0f4d) SHA1(5c836694d736b2d2a268e3a8acdfb76fde6698c4) ) // On PCB (B3) + ROM_LOAD( "b3_6sr02-04-8140-1-86_d27128d.ic23", 0x04000, 0x04000, CRC(58c04246) SHA1(7eb0b276206f546b34bc5f32e05d755f1a700294) ) // On PCB (B3) + ROM_LOAD( "b3_6sr01-04-4477-1-86_hn4827128g.ic24", 0x08000, 0x04000, CRC(e9110243) SHA1(c96f6f526b0b1c36971f7a0fc03a6e57d02213e5) ) // On PCB (B3) + + ROM_REGION(0x00800, "video", 0) + ROM_LOAD( "b1_9000-vs-1.1_d2716d.ic46", 0x00000, 0x00800, CRC(ebaefb94) SHA1(ca6d194926a98b846443ce7393e3b44d3e5199f9) ) // On Video PCB (B1) + + ROM_REGION(0x00200, "proms", 0) + ROM_LOAD( "b6_sp007mp_82s147n.ic9", 0x00000, 0x00200, CRC(35aaa7a3) SHA1(ebc977ff748a19cd0e9d0626cf7cf97d07656f80) ) // On OSD PCB (B6), for CPU address decoding + ROM_LOAD( "b6_502_82s147.ic10", 0x00000, 0x00200, CRC(401fa579) SHA1(e6320f70da9dfed0daae47af7b6cf9f3a62313b2) ) // On OSD PCB (B6), for CPU address decoding. Same as the standard EURO-BEEB + ROM_LOAD( "b3_b515c1-1.ic15", 0x00000, 0x00200, CRC(c4b02b5f) SHA1(e7b3363974b8a1b61169f543a672dff37e8e0e11) ) // On PCB (B3) + ROM_LOAD( "b2_cpi-sl-1.3_am27s21a.ic29", 0x00000, 0x00100, CRC(897071f9) SHA1(912154fd24d3601bcfd7fbd61be5c1ade62c12f3) ) // On Measurement PCB (B2) + ROM_LOAD( "b2_hb-11.2_mb7124h.ic6", 0x00000, 0x00200, CRC(78bab798) SHA1(f5b88db41efed9c540801c367047d608fb086094) ) // On Measurement PCB (B2) + ROM_LOAD( "b2_hgb-22.2_am27s21a.ic7", 0x00000, 0x00100, CRC(5c3f4be5) SHA1(1ead926a5c71232c75f20673fe0a7c36ff4480bb) ) // On Measurement PCB (B2) + ROM_LOAD( "b2_hgw-1.2_am27s21a.ic8", 0x00000, 0x00100, CRC(b45f4d48) SHA1(7cfe7b19efc7d034a5795a99dda347ae742c904d) ) // On Measurement PCB (B2) + + ROM_REGION(0x00117, "plds", 0) + ROM_LOAD( "b4_0544_pal16l6.j22", 0x00000, 0x00054, CRC(7d325ea4) SHA1(723a9938b7e3a0edf38261d7b6349efe0443d2e0) ) // On main CPU PCB (B4) + ROM_LOAD( "b4_0545_pal16l8.j66", 0x00000, 0x00104, CRC(f1837b78) SHA1(8eb40c7320bd626ec6037662234c5befba88e116) ) // On main CPU PCB (B4) + ROM_LOAD( "b4_0546_pal12l10c.j17", 0x00000, 0x00040, CRC(b669fd4a) SHA1(f122719c62e797a1c514389d8ea013e86c8b2040) ) // On main CPU PCB (B4) + ROM_LOAD( "b4_0620_pal20l10c.j76", 0x00000, 0x000cc, CRC(51e963ee) SHA1(81f0ad7e2505d31eb00be6742146c80e5631f3f2) ) // On main CPU PCB (B4) + ROM_LOAD( "b4_0686_pal20l10c.j54", 0x00000, 0x000cc, CRC(7cf9018b) SHA1(dcbfb718ab076935eb74452ba97a505d0bd34546) ) // On main CPU PCB (B4) +ROM_END + +} // anonymous namespace + +SYST( 1986, optomaxv, 0, 0, optomaxv, optomaxv, optomaxv_state, empty_init, "AMS", "Optomax V", MACHINE_NO_SOUND_HW | MACHINE_NOT_WORKING ) // Hardware from 1985, software on ROM from 1986. diff --git a/src/mame/skeleton/powerpack.cpp b/src/mame/skeleton/powerpack.cpp new file mode 100644 index 0000000000000..b8c14d57a4bfd --- /dev/null +++ b/src/mame/skeleton/powerpack.cpp @@ -0,0 +1,80 @@ +// license:BSD-3-Clause +// copyright-holders: +/**************************************************************************** + +Skeleton driver for Microtek Powerpack In-Circuit Emulator model PP-SW+ PIII + +Main POD with two PCBs connected with a small backplane (also connects +with the pass-through CPU adapter using a flat cable): + - PCB 1: + * Side A + · 2 x Xilinx XC3190A. + · 5 x OKI M5416283-60. + · 1 x Intel KU80386EX33 i386 CPU 33MHz. + · 1 x AM29F040B. + · 1 x Xilinx XC7336. + · 1 x GAL16V8D. + · 1 x 93C46 SEEPROM. + · 1 x MAX786CAI. + * Side B + · 2 x Xilinx XC3190A + · 5 x OKI M5416283-60. + · 1 x PC-Card slot (with a D-Link JITI DE660 Ethernet PC Card). + · 1 x RS-232 port. + · 1 x Reset button. + - PCB 2: + * 1 x Xilinx XCV100. + * 1 x 16 MHz crystal. + * 4 x LEDs (Power, Selftest, Emulating, Bus Active). + +Pass-through CPU adapter for Pentium III: + - 1 x Xilinx XCV100. + +****************************************************************************/ + +#include "emu.h" +#include "cpu/i386/i386.h" + + +namespace { + +class powerpack_state : public driver_device +{ +public: + powerpack_state(const machine_config &mconfig, device_type type, const char *tag) + : driver_device(mconfig, type, tag) + , m_maincpu(*this, "maincpu") + { } + + + void powerpack(machine_config &config); + +private: + required_device m_maincpu; +}; + + +static INPUT_PORTS_START(powerpack) +INPUT_PORTS_END + +void powerpack_state::powerpack(machine_config &config) +{ + I386(config, m_maincpu, 33'000'000); // Intel KU80386EX33 +} + + +ROM_START(powerpack) + ROM_REGION(0x80000, "maincpu", 0) + ROM_LOAD( "fls-am29f040b.u51", 0x00000, 0x80000, CRC(4bc45cf8) SHA1(429044f0910c92e2afde49639d7caa4c798597e5) ) + + ROM_REGION(0x00080, "eeprom", 0) + ROM_LOAD( "93c46.u52", 0x00000, 0x00080, CRC(cc9821ae) SHA1(88719489f653fb11b059ec59e7c2dcad27539c3d) ) + + ROM_REGION(0x04000, "pld", 0) + ROM_LOAD( "drm_1.5_xilinx_xc7336.u59", 0x00000, 0x04000, CRC(c6bcbf58) SHA1(d6a2922c3af3bd50bd54c3b2b80e34c96aba8e7a) ) + ROM_LOAD( "vck_1.0-gal16v8d.u27", 0x00000, 0x00117, CRC(dac50f29) SHA1(78e607a580b8c3563b5e3868c5fc77a451cfafb7) ) +ROM_END + +} // anonymous namespace + +SYST( 1999, powerpack, 0, 0, powerpack, powerpack, powerpack_state, empty_init, "Microtek", "Powerpack In-Circuit Emulator PP-SW+ PIII", MACHINE_NO_SOUND | MACHINE_NOT_WORKING ) diff --git a/src/mame/skeleton/pv9234.cpp b/src/mame/skeleton/pv9234.cpp index 38f5d978aca17..4f76722f3ff23 100644 --- a/src/mame/skeleton/pv9234.cpp +++ b/src/mame/skeleton/pv9234.cpp @@ -1,27 +1,67 @@ // license:BSD-3-Clause // copyright-holders:Angelo Salese -/*************************************************************************** +/************************************************************************************************** PowerVu D9234 STB (c) 1997 Scientific Atlanta 20-mar-2010 skeleton driver -http://www.vetrun.net/forums/showthread.php?t=395 -http://colibri.net63.net/powervu.htm -http://www.growl.de/d9234/ +References: +- http://www.vetrun.net/forums/showthread.php?t=395 +- https://web.archive.org/web/20080203175218/http://www.growl.de/d9234/ + +TODO: +- everything, including PCB pictures and user manual; +- Probably shared with other PowerVu DVB-S STB models; +- Flash ROM is (2x? 4x?) AT29C256 according to an evasive pic; +- $3f000 area should be bootstrap code, inits UART from there? + +Front Panel: +- On/Standby | Signal/Menu on the left; +- arrow keys with select in the middle, next to DVB logo; +- PowerVu Conditional Access slot, on the right; + +Back Panel: +- CH3 / CH4 dip, HF modulator (US standard); +- Ant In and Tv Out VHF/UHF connectors, near composite audio/video jacks; +- Satellite LNB PWR +13/+19V 250mA; +- LNB PWR ON / OFF dip; +- AC IN, 100V-240V, 50/60Hz; +According to the Quick Setup Guide, can have following optional slots: +- S-Video Out; +- DE-9 Wideband Data and/or DA-25 Expansion Port; + +=================================================================================================== -Google 'powervu 9234' for plenty more info. +This is the serial output to a terminal, used for debugging. +The boot process goes something like this: -Meant for payTV providers to decrypt signals from the satellite and pump -them out on a local cable network. The powervu encryption is very secure. +Start -There is a menu system, and with the right equipment, many secrets can -be found! +Config: 0x00001080 (Max Config: 00003C80) +MV 00000004.00000003 +DL Avail +IOP Com. O.K. 00000004 +Check CRC ... +CRC O.K. +Launch App +************** +* Ver 2.05 * +************** +Compiled by: FURLANO +Date & time: Nov 3 1997, 15:34:29 +All printing enabled. Press space bar to toggle on/off. +Time stamping enabled. Press 't' to turn on/off. +Press 'o' to toggle printing of MPEG Xport error messages. -****************************************************************************/ +**************************************************************************************************/ #include "emu.h" + +#include "bus/rs232/rs232.h" #include "cpu/arm7/arm7.h" +#include "machine/ins8250.h" + #include "emupal.h" #include "screen.h" @@ -41,13 +81,11 @@ class pv9234_state : public driver_device void pv9234(machine_config &config); private: - void debug_w(uint32_t data); void debug1_w(uint32_t data); - void debug2_w(uint32_t data); - uint32_t screen_update_pv9234(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - void pv9234_map(address_map &map) ATTR_COLD; + void main_map(address_map &map) ATTR_COLD; virtual void machine_reset() override ATTR_COLD; virtual void video_start() override ATTR_COLD; @@ -56,38 +94,16 @@ class pv9234_state : public driver_device required_device m_maincpu; }; +void pv9234_state::video_start() +{ +} -/* -This is the serial output to a terminal, used for debugging. -The boot process goes something like this: - -Start - -Config: 0x00001080 (Max Config: 00003C80) -MV 00000004.00000003 -DL Avail -IOP Com. O.K. 00000004 -Check CRC ... -CRC O.K. -Launch App -************** -* Ver 2.05 * -************** -Compiled by: FURLANO -Date & time: Nov 3 1997, 15:34:29 -All printing enabled. Press space bar to toggle on/off. -Time stamping enabled. Press 't' to turn on/off. -Press 'o' to toggle printing of MPEG Xport error messages. -*/ -void pv9234_state::debug_w(uint32_t data) +uint32_t pv9234_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - if (data) - { - printf("%02x %c\n",data,data); // this prints 'Start' to the console. - logerror("debug=%02x %c\n",data,data); - } + return 0; } + void pv9234_state::debug1_w(uint32_t data) { uint8_t i,j; @@ -104,25 +120,30 @@ void pv9234_state::debug1_w(uint32_t data) } } -void pv9234_state::debug2_w(uint32_t data) +void pv9234_state::main_map(address_map &map) { - if (data) - logerror("debug2=%02x\n",data); // ignore the huge amount of zeroes here -} - -void pv9234_state::pv9234_map(address_map &map) -{ - map(0x00000000, 0x0007ffff).rom().region("maincpu", 0); //FLASH ROM! + //map.unmap_value_high(); + // TODO: flash ROM + map(0x00000000, 0x0007ffff).rom().region("maincpu", 0); // map(0x00000000, 0x00000033).w(FUNC(pv9234_state::)); something // map(0x00000044, 0x00000047).w(FUNC(pv9234_state::)); // map(0x00000060, 0x0000006b).w(FUNC(pv9234_state::)); // map(0x00007000, 0x00007003).w(FUNC(pv9234_state::)); // map(0x00008000, 0x00008003).w(FUNC(pv9234_state::)); + map(0x00008000, 0x000080ff).unmaprw(); map(0x00008014, 0x00008017).w(FUNC(pv9234_state::debug1_w)); // map(0x00008020, 0x00008027).w(FUNC(pv9234_state::)); - map(0x000080c0, 0x000080c3).w(FUNC(pv9234_state::debug2_w)); - map(0x000080cc, 0x000080cf).w(FUNC(pv9234_state::debug_w)); - // map(0x000080d0, 0x000080d3).w(FUNC(pv9234_state::)); + map(0x000080c0, 0x000080df).rw("uart", FUNC(ns16550_device::ins8250_r), FUNC(ns16550_device::ins8250_w)).umask32(0x000000ff); + map(0x000080cc, 0x000080cc).lw8( + NAME([this] (offs_t offset, u8 data) { + if (data) + { + //printf("%02x %c\n",data,data); // this prints 'Start' to the console. + logerror("debug=%02x %c\n",data,data); + } + }) + ); + map(0x0003e000, 0x0003efff).ram().share("p_ram"); map(0x00080000, 0x00087fff).mirror(0x78000).ram().share("share1");//mirror is a guess, writes a prg at 0xc0200 then it jumps at b0200 (!) map(0xe0000000, 0xe0007fff).mirror(0x0fff8000).ram().share("share1"); @@ -142,34 +163,38 @@ void pv9234_state::machine_reset() m_p_ram[i] = 0; } -void pv9234_state::video_start() -{ -} - -uint32_t pv9234_state::screen_update_pv9234(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) -{ - return 0; -} - void pv9234_state::pv9234(machine_config &config) { - /* basic machine hardware */ - ARM7(config, m_maincpu, 4915000); //probably a more powerful clone. - m_maincpu->set_addrmap(AS_PROGRAM, &pv9234_state::pv9234_map); + ARM7(config, m_maincpu, 4915000); // TODO: unknown type, VLSI branded? + m_maincpu->set_addrmap(AS_PROGRAM, &pv9234_state::main_map); - /* video hardware */ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); - screen.set_refresh_hz(50); + screen.set_refresh_hz(60); screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500)); /* not accurate */ screen.set_size(640, 480); screen.set_visarea(0, 640-1, 0, 480-1); - screen.set_screen_update(FUNC(pv9234_state::screen_update_pv9234)); + screen.set_screen_update(FUNC(pv9234_state::screen_update)); screen.set_palette("palette"); + // TODO: wideband DE-9 port + + // TODO: actually NS16550A, uses DA-25 port for a non-standard 8P1 125k baud rate + NS16550(config, "uart", 8_MHz_XTAL); +// uart.out_tx_callback().set("serial", FUNC(rs232_port_device::write_txd)); +// uart.out_dtr_callback().set("serial", FUNC(rs232_port_device::write_dtr)); +// uart.out_rts_callback().set("serial", FUNC(rs232_port_device::write_rts)); +// +// rs232_port_device &serial(RS232_PORT(config, "serial", default_rs232_devices, "terminal")); +// serial.rxd_handler().set("uart", FUNC(ns16550_device::rx_w)); +// serial.dcd_handler().set("uart", FUNC(ns16550_device::dcd_w)); +// serial.dsr_handler().set("uart", FUNC(ns16550_device::dsr_w)); +// serial.cts_handler().set("uart", FUNC(ns16550_device::cts_w)); + + // TODO: has a Philips SAA-branded chip on the evasive PCB picture + PALETTE(config, "palette", palette_device::MONOCHROME); } -/* ROM definition */ ROM_START( pv9234 ) ROM_REGION32_LE( 0x80000, "maincpu", ROMREGION_ERASE00 ) ROM_LOAD16_BYTE( "u19.bin", 0x00000, 0x20000, CRC(1e06b0c8) SHA1(f8047f7127919e73675375578bb9fcc0eed2178e)) @@ -180,8 +205,6 @@ ROM_END } // anonymous namespace - -/* Driver */ - -// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS -SYST( 1997, pv9234, 0, 0, pv9234, pv9234, pv9234_state, empty_init, "Scientific Atlanta", "PowerVu D9234", MACHINE_NOT_WORKING | MACHINE_NO_SOUND) +// PowerVu D9223 Commercial Satellite Receiver +// PowerVu D9225 Headend Satellite Receiver +SYST( 1997, pv9234, 0, 0, pv9234, pv9234, pv9234_state, empty_init, "Scientific Atlanta", "PowerVu D9234 Business Satellite Receiver", MACHINE_NOT_WORKING | MACHINE_NO_SOUND) diff --git a/src/mame/skeleton/sgm.cpp b/src/mame/skeleton/sgm.cpp new file mode 100644 index 0000000000000..c095e0e2cca3b --- /dev/null +++ b/src/mame/skeleton/sgm.cpp @@ -0,0 +1,177 @@ +// license:BSD-3-Clause +// copyright-holders: + +/* +Wang Pai Dou Dizhu, S.G.M., 2004? +Hardware Info by Guru +--------------------- + +SGM-0509L-1 +|--------------------------------------| +| S2 JAMMA TA7252 | +| 6295 VOL | +|1 ULN2803 | +|8 | +|W |----| FLASH.U21 | +|A |CPU | 24MHz 6264 | +|Y FLASH.U15 | | | +| |----| 708SEN | +| FLASH.U16 | +| | +| BUTTON 22MHz | +| A3.3 |----------| | +|1 A1.8 | | | +|0 A5.0 | | 62LV12816 | +|W EPCS1N.U39 | ALTERA | | +|A | CYCLONE | | +|Y BATT | | 62LV12816 | +| JTAG |----------| | +|--------------------------------------| +Notes: + CPU - Unknown QFP144 CPU, looks like Hyperstone or ARM? Clock input 24.000MHz + ALTERA - Altera Cyclone (unknown model, surface scratched) QFP240 FPGA (Graphics Chip) + EPCS1N - Altera EPCS1N-9530B 128kB Serial Configuration Device for FPGA + JTAG - 10 pin JTAG Header + BATT - CR2032 Coin Battery + BUTTON - Push button, does nothing when pressed. + A3.3 - AMS1117-3.3 3.3V Linear Regulator + A1.8 - AMS1117-1.8 1.8V Linear Regulator + A5.0 - AMS1117-5.0 5.0V Linear Regulator + S2 - 8-Position DIP Switch + 708SEN - Sipex 708SEN System Reset IC + ULN2803 - ULN2803 8-Channel Darlington Transistor Array + TA7252 - Toshiba TA7252 5.9W Audio Power Amplifier + 6295 - Oki M6295 ADPCM Sample Player. Clock 1.100MHz [22/20]. Pin 7 HIGH. + Note title screen music is ripped off from cjddz! + FLASH.U21 - Macronix MX29F1615 1MB x16-bit DIP42 Flash ROM +FLASH.U15/U16 - Sharp LH28F320BJD-TTL80 2MB x16-bit DIP42 Flash ROM + 6264 - 8kB x8-bit SRAM (battery-backed by CR2032 Coin Cell) + 62LV12816 - ISSI IS62LV12816 128kB x16-bit SRAM + +TODO: +- identify CPU arch. There is no obvious code in external ROMs. Encrypted or does it have + internal ROM? With either of the larger ROMs removed from PCB it doesn't boot. +*/ + + +#include "emu.h" + +#include "cpu/arm7/arm7.h" +#include "sound/okim6295.h" + +#include "emupal.h" +#include "screen.h" +#include "speaker.h" +#include "tilemap.h" + + +namespace { + +class sgm_state : public driver_device +{ +public: + sgm_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), + m_maincpu(*this, "maincpu") + { } + + void wpddz(machine_config &config) ATTR_COLD; + + +private: + required_device m_maincpu; + + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + + void program_map(address_map &map) ATTR_COLD; +}; + + +uint32_t sgm_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +{ + bitmap.fill(rgb_t::black(), cliprect); + + return 0; +} + + +void sgm_state::program_map(address_map &map) +{ + map(0x00000000, 0x0001ffff).rom(); +} + + +static INPUT_PORTS_START( wpddz ) + 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_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("IN1") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) + 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 ) + + // no DIP switches on PCB +INPUT_PORTS_END + + +// TODO +static GFXDECODE_START( gfx ) +GFXDECODE_END + + +void sgm_state::wpddz(machine_config &config) +{ + // basic machine hardware + ARM7(config, m_maincpu, 24_MHz_XTAL); // actual CPU arch unknown + m_maincpu->set_addrmap(AS_PROGRAM, &sgm_state::program_map); + + // video hardware + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); // TODO: verify everything once emulation works + screen.set_refresh_hz(60); + screen.set_vblank_time(ATTOSECONDS_IN_USEC(0)); + screen.set_size(64*8, 32*8); + screen.set_visarea(0*8, 64*8-1, 2*8, 30*8-1); + screen.set_screen_update(FUNC(sgm_state::screen_update)); + + GFXDECODE(config, "gfxdecode", "palette", gfx); + + PALETTE(config, "palette").set_entries(0x100); // TODO + + // sound hardware + SPEAKER(config, "mono").front_center(); + + OKIM6295(config, "oki", 22_MHz_XTAL / 20, okim6295_device::PIN7_HIGH).add_route(ALL_OUTPUTS, "mono", 1.0); +} + + +ROM_START( wpddz ) + ROM_REGION( 0x20000, "maincpu", ROMREGION_ERASE00 ) + ROM_LOAD( "internal_rom", 0x00000, 0x20000, NO_DUMP ) // TODO: verify this theory + + ROM_REGION( 0x20000, "cyclone_config", 0 ) + ROM_LOAD( "epcs1n.u39", 0x000000, 0x20000, CRC(874f9122) SHA1(f9f5f721065cdb91416f611da987f2edece1237c) ) + + ROM_REGION( 0x800000, "gfx", 0 ) + ROM_LOAD( "flash.u15", 0x000000, 0x400000, CRC(60a6bb59) SHA1(3f0e7e650643901ebbafd2ac195ad1a99cc645d9) ) + ROM_LOAD( "flash.u16", 0x400000, 0x400000, CRC(429b4938) SHA1(4497ed85f6cbfb03b420ea68427f6a24d092f6b1) ) + + ROM_REGION( 0x200000, "oki", 0 ) + ROM_LOAD( "flash.u21", 0x000000, 0x200000, CRC(e0813bdb) SHA1(41b487da6bfbfb231a0c7297d5a4955a5d4019ff) ) +ROM_END + +} // anonymous namespace + + +GAME( 2004?, wpddz, 0, wpddz, wpddz, sgm_state, empty_init, ROT0, "SGM", "Wang Pai Dou Dizhou", MACHINE_NO_SOUND | MACHINE_NOT_WORKING ) diff --git a/src/mame/skeleton/turnierdart.cpp b/src/mame/skeleton/turnierdart.cpp new file mode 100644 index 0000000000000..b4093f8df3be6 --- /dev/null +++ b/src/mame/skeleton/turnierdart.cpp @@ -0,0 +1,141 @@ +// license:BSD-3-Clause +// copyright-holders: +/************************************************************************ + +Skeleton driver for "Turnier Dart" darts machine from Löwen S.P.O.R.T. +(NSM-Löwen, now Löwen Entertainment, part of Novomatic Group). + +PCB silkscreened "Valley Recreation Products - Coyright © 1997". + ___________________________________________________________________ + | (o) (o) ...... ... | + | TEST RESET | + |. __________ __________ __________ | + |. |DS14C88N_| |HEF4052BP| |_________| | + |. __________ F F F | + |. |SN74LS123N . . . BATT U U U | + |. : : : 3V S S S | + |. __________________ . E E E | + | | LH5168-10L | : | + | __________ |_________________| _____ _____ . | + | |SN74LS244N ___________________ DS1210 5355ED · | + | | EPROM | · | + |. |__________________| Xtal . | + |. __________ | + | |SN74LS373N __________ . | + | __________ ____________________ |PEEL18CV8P . | + | |JRC_324D_| | Dallas DS80C310 | . | + | |___________________| __________ | + | __________ |SN74LS273N . | + | |_74LS02N_| Xtal · | + | __________ 12 MHz __________ | + | |SN74LS273N |SN74LS244N | + | __________ __________ __________ .. | + |. |_________| |74HC244AP| |TIBPAL16L8 .. | + |. __________ __________ __________ | + |. |74HC30AP_| |74HC244AP| |TIBPAL16L8 . | + |. __________ . | + |. __________ |SN74LS273N __________ . | + |. |74HC30AP_| |SN74LS30N| | + |. __________ . | + |. |74HC244AP| . | + |. __________ __________ . | + | |_SN7406N_| |MIC5821BN| _____ | + |.. __________ LM358N | + |.. |SN74LS273N | + |.. __________ | + | |SN74LS273N | + | .. | + | :::::::::::::::::: :::::::::::: .. : | + |__________________________________________________________________| + +************************************************************************/ + +#include "emu.h" +#include "cpu/mcs51/mcs51.h" +//#include "machine/nvram.h" +#include "speaker.h" + +namespace { + +class turnierdart_state : public driver_device +{ + +public: + turnierdart_state(const machine_config &mconfig, device_type type, const char *tag) + : driver_device(mconfig, type, tag) + , m_maincpu(*this, "maincpu") + { + } + + void turnierdart(machine_config &config); + +private: + required_device m_maincpu; +}; + + +INPUT_PORTS_START(turnierdart) +INPUT_PORTS_END + +void turnierdart_state::turnierdart(machine_config &config) +{ + I80C31(config, m_maincpu, 12_MHz_XTAL); // Dallas DS80C310 + + //NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); // DS1210 + + SPEAKER(config, "mono").front_center(); +} + +/* Newer version, with the following games: + + GAMES OPTION I OPTION II + ---------- ----------- ------------- + 301 WIPE OUT SHORTY + 501 DOUBLE IN TEAM + 701 DOUBLE OUT NDA + 901 MASTERS OUT ADA + CRICKET CHANCE IT TIME HANDICAP + HI SCORE SHUFFLE IT AUTO ADJUST + SHANGHAI YOU PICK IT ERNIE + RAPID FIRE CUT THROAT + STOP WATCH SPLIT SCORE +*/ +ROM_START(turnierd) + ROM_REGION(0x40000, "maincpu", 0) + ROM_LOAD("cu-07b_15-4-10.u18", 0x00000, 0x40000, CRC(17f1dfbb) SHA1(4c93ad3573edd2d9dd2727b10f638cfb7ba14905)) + + ROM_REGION(0x117, "plds", 0) + ROM_LOAD("tibpal16l8.u27", 0x00000, 0x00117, NO_DUMP) + ROM_LOAD("tibpal16l8.u28", 0x00000, 0x00117, NO_DUMP) + ROM_LOAD("peel18cv8p.u30", 0x00000, 0x00117, NO_DUMP) +ROM_END + +/* Older version, with the following games: + + GAMES OPTION I OPTION II + --------------- -------------- ----------------- + 301 DOUBLE IN TEAM: 2 SPIELEN + 501 DOUBLE OUT TEAM: 4 SPIELEN + 701 MASTERS OUT HANDICAP + 901 CHANCE IT TIME OUT HANDICAP + CRICKET YOU PICK IT + HI SCORE CUT THROAT + SHANGHAI MASTERS CRCKET + 301 ELIMINATION CUT THROAT + SPLIT SCORE + RAPID FIRE +*/ +ROM_START(turnierda) + ROM_REGION(0x40000, "maincpu", 0) + ROM_LOAD("hb_8-97_spa_03_82da_30-03-98.u18", 0x00000, 0x40000, CRC(29cf8931) SHA1(35924488ec5508541b02269dfdf055b20057c51c)) + + ROM_REGION(0x00117, "plds", 0) + ROM_LOAD("tibpal16l8.u27", 0x00000, 0x00117, NO_DUMP) + ROM_LOAD("tibpal16l8.u28", 0x00000, 0x00117, NO_DUMP) + ROM_LOAD("peel18cv8p.u30", 0x00000, 0x00117, NO_DUMP) +ROM_END + +} // Anonymous namespace + +GAME(2010, turnierd, 0, turnierdart, turnierdart, turnierdart_state, empty_init, ROT0, u8"Löwen S.P.O.R.T.", "Turnier Dart", MACHINE_NO_SOUND | MACHINE_NOT_WORKING | MACHINE_MECHANICAL | MACHINE_REQUIRES_ARTWORK) +GAME(1998, turnierda, turnierd, turnierdart, turnierdart, turnierdart_state, empty_init, ROT0, u8"Löwen S.P.O.R.T.", "Turnier Dart (HB8-97)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING | MACHINE_MECHANICAL | MACHINE_REQUIRES_ARTWORK) diff --git a/src/mame/skeleton/vgame.cpp b/src/mame/skeleton/vgame.cpp index d264e460e4d8c..5065f7cb1b8af 100644 --- a/src/mame/skeleton/vgame.cpp +++ b/src/mame/skeleton/vgame.cpp @@ -3,23 +3,13 @@ /* Video slots / mahjongs by VGame. - -The main components are: -rectangular 128-pin chip, marked VGAME-007 (probably CPU) -square 208-pin chip, marked VGAME-008 (probably video chip) -44 MHz XTAL -LY62256SL SRAM (near VGAME-007) -2x LY61L256JL SRAM (near VGAME-008) -U6295 sound chip -2 banks of 8 DIP switches - -TODO: everything. CPU core isn't identified and code is encrypted. Possibly internal ROM? */ #include "emu.h" -#include "cpu/m68000/m68000.h" +#include "cpu/arm7/arm7.h" +#include "machine/eepromser.h" #include "sound/okim6295.h" #include "emupal.h" @@ -40,7 +30,7 @@ class vgame_state : public driver_device void vgame(machine_config &config) ATTR_COLD; - void init_hilice() ATTR_COLD; + void init_vgame() ATTR_COLD; protected: virtual void video_start() override ATTR_COLD; @@ -122,7 +112,7 @@ static INPUT_PORTS_START( hilice ) INPUT_PORTS_END -// TODO: wrong, just enough to glimpse some alphanumericals +// TODO: wrong, just enough to glimpse some alphanumerics static GFXDECODE_START( gfx_vgame ) GFXDECODE_ENTRY( "gfx", 0, gfx_16x16x4_packed_lsb, 0, 1 ) GFXDECODE_END @@ -130,10 +120,12 @@ GFXDECODE_END void vgame_state::vgame(machine_config &config) { - M68000(config, m_maincpu, 44_MHz_XTAL); // CPU core and divider unknown + ARM7(config, m_maincpu, 44_MHz_XTAL); // CPU core unknown; ROMs seem to contain at least some ARM or Thumb code m_maincpu->set_addrmap(AS_PROGRAM, &vgame_state::program_map); // m_maincpu->set_vblank_int("screen", FUNC(vgame_state::irq0_line_hold)); + EEPROM_93C66_16BIT(config, "eeprom"); + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); // TODO screen.set_refresh_hz(60); screen.set_vblank_time(ATTOSECONDS_IN_USEC(0)); @@ -147,17 +139,18 @@ void vgame_state::vgame(machine_config &config) SPEAKER(config, "mono").front_center(); - OKIM6295(config, "oki", 44_MHz_XTAL / 44, okim6295_device::PIN7_HIGH).add_route(ALL_OUTPUTS, "mono", 1.0); // pin 7 and clock not verified + OKIM6295(config, "oki", 44_MHz_XTAL / 44, okim6295_device::PIN7_HIGH).add_route(ALL_OUTPUTS, "mono", 1.0); } // VGAME-0030-02-AI PCB ROM_START( hilice ) - ROM_REGION( 0x200000, "maincpu", 0 ) - ROM_LOAD( "hi_lice_v102fa.u13", 0x000000, 0x200000, CRC(4da87481) SHA1(5a20b254cfe8a2f087faa0dd17f682218a2ca1b2) ) + ROM_REGION( 0x200000, "maincpu", ROMREGION_ERASE00 ) + ROM_LOAD( "hi_lice_v102fa.u13", 0x000000, 0x100000, BAD_DUMP CRC(4da87481) SHA1(5a20b254cfe8a2f087faa0dd17f682218a2ca1b2) ) // probably read as wrong ROM type + ROM_CONTINUE( 0x000000, 0x100000 ) ROM_REGION( 0x400000, "gfx", 0 ) - ROM_LOAD16_BYTE( "hi_lice_cg_01fu3.u3", 0x000000, 0x200000, CRC(8ad6b233) SHA1(deaffd391265c885afb2f171089c1b33429470f1) ) - ROM_LOAD16_BYTE( "hi_lice_cg_01fu8.u8", 0x000001, 0x200000, BAD_DUMP CRC(b1070209) SHA1(4568977fca2ff96b756a9600ad9a4730a6f8749a) ) // didn't give consistent reads + ROM_LOAD16_BYTE( "hi_lice_cg_01fu3.u3", 0x000000, 0x200000, BAD_DUMP CRC(8ad6b233) SHA1(deaffd391265c885afb2f171089c1b33429470f1) ) // probably read as wrong ROM type + ROM_LOAD16_BYTE( "hi_lice_cg_01fu8.u8", 0x000001, 0x200000, BAD_DUMP CRC(b1070209) SHA1(4568977fca2ff96b756a9600ad9a4730a6f8749a) ) // probably read as wrong ROM type + didn't give consistent reads ROM_REGION( 0x200000, "oki", 0 ) ROM_LOAD( "hi_lice_sp_100f.u45", 0x000000, 0x200000, CRC(b2588f54) SHA1(0d046e56596611954a9d2a9a30746d8aa370431b) ) // 1xxxxxxxxxxxxxxxxxxxx = 0x00 @@ -175,16 +168,174 @@ ROM_START( mjxy2 ) ROM_REGION( 0x200000, "oki", 0 ) ROM_LOAD( "u43_sp_v105.u43", 0x000000, 0x200000, CRC(5d1ab8f1) SHA1(56473b632dfdb210208ce3b35cb6861f07861cd7) ) + + // EEPROM dump for mjxy2 was 0xff filled +ROM_END + +/* +Chao Ji Sai Jin Hua (201CN), VGAME, 2007 +Chao Ji Dou Niu (V305CN), VGAME, 2008 (book-keeping screen shows V400 .0) +Hardware Info By Guru +--------------------- + +This is a small PCB using a design that looks very similar to some IGS027A PCBs using the same parts and the +same text font but with a simpler modern design using mostly surface-mounted parts. The PCB number also has a +similar format to IGS PCBs. It is possible VGAME is an IGS company or it was run by ex-IGS employees who set +up their own company doing the same thing using knowledge gained from working at IGS. + +The CPU is a QFP128 which is an unusual footprint for a CPU and appears to be similar (but not identical) to +the special IGS027A used by lhzb3sjb. The same pin that was found to be the serial port when trojaning +lhzb3sjb goes to a connector on the edge of the board and appears to be the debug/programming port. When the +program ROM is removed the message that shows on screen from the internal ROM is very similar to the messages +shown by other IGS027A games. +The graphics chip appears to be something similar to IGS023 or IGS031. +The graphics ROM is a 48 pin (DIP48) flash ROM or a TSOP48 flash ROM with the same part number mounted onto a +DIP48 to TSOP48 adapter board and wired 1:1 by signal. These EN29L* chips have (so far) only been seen on IGS PCBs. + +To enter I/O check screen: Boot with test switch on. +To enter H/W check screen: When on I/O check screen, press service credit while test switch is on. +Note this only works with Chao Ji Sai Jin Hua + + +VGAME-0023-00-AE-1 + |----------------------------------------| +|-| U1 HD1 BT1 | +| 44MHz SW3| +|2 U2 62256 | +|2 CS18HS0256 | +|W |-------| CS18HS0256 U36 | +|A | VGAME | 93C66.U11 | +|Y | 003 | |------| | +| | | SW2 | VGAME| JP2| +| |-------| | -00X | | +|-| SW1 |------| | + | 1117(1) | + | | +|-| U24 | +|10 | +|W VOL 6295 1117(3)| +|A TDA1519 | +|Y 1117(2) ULN2004 ULN2004| +|-------| JAMMA |-----| + |----------------------------| +Notes: + VGAME-00x - CPU. Clock Input 44.000MHz on Pin 125. + This seems to be an IGS027A-like chip with internal ROM in a QFP128 package. + Each chip is printed with a game-specific code. + "VGAME-002" - Chao Ji Sai Jin Hua + "VGAME-007" - Chao Ji Dou Niu + 007 also seen on Mahjong School 2 and Chaoji Laizi Dou Dizhu so these might use the same internal ROM. + VGAME-003 - QFP240 Custom Graphics Chip. Possibly similar to IGS023 or IGS031. Chip has additional + logic and other functions such as providing the 1MHz clock for the M6295. + The same type of chip exists on Mahjong School 2 and Chaoji Laizi Dou Dizhu marked "VGAME-008" + 6295 - OKI M6295 4-Channel ADPCM Voice Synthesis LSI. Clock Input 1.000MHz [44/44]. Pin 7 HIGH + 1MHz clock comes from VGAME-003. + 62256 - Lyontek LY62256SL-70LL 32kB x8-bit 3.3V SRAM (main RAM) + CS18HS0256 - Chiplus CS18HS02563JCR10 32kB x8-bit 3.3V SRAM (video RAM) + 93C66.U11 - 93C66 512 x8-bit or 256 x16-bit (4kB) EEPROM. + ORG pin connected to VCC so it's configured as 256 x16-bit. + EEPROM is connected directly to the CPU. + EEPROM was dumped on both games. + Chao Ji Dou Niu EEPROM is 0xFF filled and the game works even without the chip installed. + Chao Ji Sai Jin Hua EEPROM contains data filled to the end and if not populated shows + "V201CN RESET" (V201 is the internal ROM version). + It's possible the EEPROM may be used for protection to stop game-swapping on the same PCB + where the CPU internal ROM is the same. + SW1/SW2 - 8-Position DIP Switch + SW3 - Toggle Switch for NVRAM Clear and System Reset + JP2 - 8-Pin Header. Possibly Debug/Programming Port. Possibly serial port on CPU connects here. + 1117(1) - Unisonic Technologies LD1117A-LADAUJ 1A Adjustable Linear Regulator, set to 1.5V + 1117(2) - Unisonic Technologies LD1117A-LADAUJ 1A Adjustable Linear Regulator, set to 5.0V + 1117(3) - Unisonic Technologies LD1117A-LADAUJ 1A Adjustable Linear Regulator, set to 3.3V + ULN2004 - Toshiba ULN2004 7-Channel Darlington Transistor Array + HD1 - 4-Pin Connector for Network Link (same type used by some IGS Link games) + BT1 - CR2032 3.0V Coin Battery + TDA1519 - Philips TDA1519C 22W BTL Stereo Power Amplifier + U1 - DIP42 Socket (not used) + U2 - DIP48 Socket. An adapter PCB is plugged in containing one EN29LV320AB-70TCP 3.3V 32Mbit Flash + ROM (graphics). + U24 - DIP42 Socket with 27C160 EPROM (OKI samples) + U36 - DIP42 Socket with Macronix MX29L1611GPC-12 3.3V 16Mbit Flash ROM (main program) +*/ + +ROM_START( cjdn ) // Oct 1 2008 15:58:54 string in ROM + ROM_REGION( 0x200000, "maincpu", 0 ) + ROM_LOAD( "v305cn.u8", 0x000000, 0x200000, CRC(bffb20c0) SHA1(bf2293bfc4711d0b930c491f579418d5e7c0800f) ) + + ROM_REGION( 0x400000, "gfx", 0 ) + ROM_LOAD( "gfx_flashrom", 0x000000, 0x400000, CRC(4018790e) SHA1(2b292d4cbfa5d7c3129a7e0c8012bde519e85ef1) ) // FIXED BITS (xxxxxxxx0xxxxxxx) + + ROM_REGION( 0x200000, "oki", 0 ) + ROM_LOAD( "sp_101g.u24", 0x000000, 0x200000, CRC(f361a725) SHA1(9404f955126f16c7f4a2c52e799791f6f2703b5f) ) + + // EEPROM dump for cjdn was 0xff filled +ROM_END + +ROM_START( cjsjh ) // Nov 2 2007 16:05:26 string in ROM + ROM_REGION( 0x200000, "maincpu", 0 ) + ROM_LOAD( "vxxxcn.u8", 0x000000, 0x200000, CRC(911d8dce) SHA1(1d9386c4a9e118d02b5b29f9e9ce90ef1d6f419f) ) // label not readable + + ROM_REGION( 0x400000, "gfx", 0 ) + ROM_LOAD( "gfx.u2", 0x000000, 0x400000, CRC(e2964db3) SHA1(21e021c88136083445b430c618a8eb74e2147d4f) ) // FIXED BITS (xxxxxxxx0xxxxxxx) + + ROM_REGION( 0x200000, "oki", 0 ) + ROM_LOAD( "sp.u24", 0x000000, 0x200000, CRC(ad11c8b9) SHA1(0547a57ff2183e65fa1d51234799a3d521b018c5) ) + + ROM_REGION16_BE( 0x200, "eeprom", 0 ) + ROM_LOAD16_WORD_SWAP( "cjsjh_93c66a.u11", 0x000, 0x200, CRC(cbaeab4f) SHA1(505d91ee1b0d219aa55e3262b3bf712c4d9c2408) ) +ROM_END + +ROM_START( cjlddz ) + ROM_REGION( 0x200000, "maincpu", 0 ) + ROM_LOAD( "u12.u12", 0x000000, 0x200000, CRC(b35ff3cb) SHA1(fe1fa4448153a449f28b776ef452be860d119e7b) ) + + ROM_REGION( 0x800000, "gfx", 0 ) + ROM_LOAD16_BYTE( "u2_cg_v101.u2", 0x000000, 0x400000, CRC(37eec9f9) SHA1(c0fcce6ccf28583920eae2558133a5ba2e1fb68b) ) // FIXED BITS (xxxxxxxx0xxxxxxx) + ROM_LOAD16_BYTE( "u8_cg_v101.u8", 0x000001, 0x400000, CRC(eb3ccdf1) SHA1(f0420f967d4decda3643975205eacdb8c0536bef) ) // FIXED BITS (xxxxxxxx0xxxxxxx) + + ROM_REGION( 0x200000, "oki", 0 ) + ROM_LOAD( "u43_sp_v100.u43", 0x000000, 0x200000, CRC(ec57f98b) SHA1(ada7e8248d6d9fbd3b3b5caaad45ea814f09edd6) ) + + ROM_REGION16_BE( 0x200, "eeprom", 0 ) + ROM_LOAD16_WORD_SWAP( "cjlddz_93c66a.u13", 0x000, 0x200, CRC(3930b2ff) SHA1(69e1e7b8654ff3696ab7f210fa69a5aed9cb59fb) ) ROM_END -void vgame_state::init_hilice() +// TODO: very incomplete, just enough to show some strings +void vgame_state::init_vgame() { - // TODO: decryption + uint8_t *rom = memregion("maincpu")->base(); + + for (int i = 0; i < 0x200000; i += 2) + { + switch (i & 0x6232) + { + case 0x0000: rom[i] ^= 0x00; break; + case 0x0002: rom[i] ^= 0x20; break; + case 0x0010: rom[i] ^= 0x02; break; + case 0x0012: rom[i] ^= 0x22; break; + case 0x0020: rom[i] ^= 0x20; break; + case 0x0022: rom[i] ^= 0x20; break; + case 0x0030: rom[i] ^= 0x22; break; + case 0x0032: rom[i] ^= 0x22; break; + case 0x0200: rom[i] ^= 0x00; break; + case 0x0202: rom[i] ^= 0x00; break; + case 0x0210: rom[i] ^= 0x02; break; + case 0x0212: rom[i] ^= 0x02; break; + case 0x0220: rom[i] ^= 0x20; break; + case 0x0222: rom[i] ^= 0x20; break; + case 0x0230: rom[i] ^= 0x22; break; + case 0x0232: rom[i] ^= 0x22; break; + default: rom[i] ^= 0x22; + } + } } } // anonymous namespace -GAME( 200?, hilice, 0, vgame, hilice, vgame_state, init_hilice, ROT0, "VGame", "Hi Lice (V102FA)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING ) -GAME( 200?, mjxy2, 0, vgame, hilice, vgame_state, init_hilice, ROT0, "VGame", "Majiang Xueyuan 2 - Mahjong School (V108TW)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING ) +GAME( 200?, hilice, 0, vgame, hilice, vgame_state, init_vgame, ROT0, "VGame", "Hi Lice (V102FA)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING ) +GAME( 200?, mjxy2, 0, vgame, hilice, vgame_state, init_vgame, ROT0, "VGame", "Majiang Xueyuan 2 - Mahjong School (V108TW)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING ) +GAME( 2008, cjdn, 0, vgame, hilice, vgame_state, init_vgame, ROT0, "VGame", "Chao Ji Dou Niu (V305CN)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING ) +GAME( 2007, cjsjh, 0, vgame, hilice, vgame_state, init_vgame, ROT0, "VGame", "Chao Ji Sai Jin Hua (V201CN)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING ) +GAME( 200?, cjlddz, 0, vgame, hilice, vgame_state, init_vgame, ROT0, "VGame", "Chao Ji Laizi Dou Dizhu (V109CN)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING ) diff --git a/src/mame/snk/bbusters.cpp b/src/mame/snk/bbusters.cpp index 9d8c0246603c6..52020c6bd93a0 100644 --- a/src/mame/snk/bbusters.cpp +++ b/src/mame/snk/bbusters.cpp @@ -130,14 +130,14 @@ class bbusters_state : public driver_device m_sprites(*this, "sprites%u", 1U), m_spriteram(*this, "spriteram%u", 1U), m_soundlatch(*this, "soundlatch%u", 1U), - m_tx_videoram(*this, "tx_videoram"), - m_pf_data(*this, "pf%u_data", 1U), - m_pf_scroll_data(*this, "pf%u_scroll_data", 1U), + m_tx_vram(*this, "tx_videoram"), + m_pf_vram(*this, "pf%u_vram", 1U), + m_pf_scroll_reg(*this, "pf%u_scroll_reg", 1U), m_gun_recoil(*this, "Player%u_Gun_Recoil", 1U), m_eprom_data(*this, "eeprom") { } - void bbusters(machine_config &config); + void bbusters(machine_config &config) ATTR_COLD; protected: virtual void machine_start() override ATTR_COLD; @@ -152,9 +152,9 @@ class bbusters_state : public driver_device required_device_array m_spriteram; required_device_array m_soundlatch; - required_shared_ptr m_tx_videoram; - required_shared_ptr_array m_pf_data; - required_shared_ptr_array m_pf_scroll_data; + required_shared_ptr m_tx_vram; + required_shared_ptr_array m_pf_vram; + required_shared_ptr_array m_pf_scroll_reg; output_finder<3> m_gun_recoil; required_shared_ptr m_eprom_data; @@ -162,29 +162,27 @@ class bbusters_state : public driver_device tilemap_t *m_fix_tilemap = nullptr; tilemap_t *m_pf_tilemap[2]{}; + bitmap_ind16 m_bitmap_sprites[2]; + TILE_GET_INFO_MEMBER(get_tile_info); template TILE_GET_INFO_MEMBER(get_pf_tile_info); void sound_cpu_w(uint8_t data); - void video_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); - template void pf_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); + void tx_vram_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); + template void pf_vram_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); void coin_counter_w(uint8_t data); - void bbusters_map(address_map &map) ATTR_COLD; - void sound_map(address_map &map) ATTR_COLD; - void sound_portmap(address_map &map) ATTR_COLD; - uint16_t eprom_r(offs_t offset); - void three_gun_output_w(uint16_t data); - - void mixlow(bitmap_ind16 &bitmap, bitmap_ind16 &srcbitmap, const rectangle &cliprect); - void mix(bitmap_ind16 &bitmap, bitmap_ind16 &srcbitmap, const rectangle &cliprect); + void gun_output_w(uint16_t data); template void mix_sprites(bitmap_ind16 &bitmap, bitmap_ind16 &srcbitmap, const rectangle &cliprect, Proc MIX); - bitmap_ind16 m_bitmap_sprites[2]; uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + + void main_map(address_map &map) ATTR_COLD; + void sound_map(address_map &map) ATTR_COLD; + void sound_portmap(address_map &map) ATTR_COLD; }; void bbusters_state::machine_start() @@ -204,16 +202,16 @@ uint16_t bbusters_state::eprom_r(offs_t offset) return (m_eprom_data[offset] & 0xff) | 0xff00; } -void bbusters_state::three_gun_output_w(uint16_t data) +void bbusters_state::gun_output_w(uint16_t data) { for (int i = 0; i < 3; i++) m_gun_recoil[i] = BIT(data, i); } template -void bbusters_state::pf_w(offs_t offset, uint16_t data, uint16_t mem_mask) +void bbusters_state::pf_vram_w(offs_t offset, uint16_t data, uint16_t mem_mask) { - COMBINE_DATA(&m_pf_data[Layer][offset]); + COMBINE_DATA(&m_pf_vram[Layer][offset]); m_pf_tilemap[Layer]->mark_tile_dirty(offset); } @@ -226,22 +224,22 @@ void bbusters_state::coin_counter_w(uint8_t data) TILE_GET_INFO_MEMBER(bbusters_state::get_tile_info) { - uint16_t tile = m_tx_videoram[tile_index]; + uint16_t const tile = m_tx_vram[tile_index]; - tileinfo.set(0, tile&0xfff, tile>>12, 0); + tileinfo.set(0, tile & 0xfff, tile >> 12, 0); } template TILE_GET_INFO_MEMBER(bbusters_state::get_pf_tile_info) { - uint16_t tile = m_pf_data[Layer][tile_index]; + uint16_t const tile = m_pf_vram[Layer][tile_index]; - tileinfo.set(Gfx, tile&0xfff, tile>>12, 0); + tileinfo.set(Gfx, tile & 0xfff, tile >> 12, 0); } -void bbusters_state::video_w(offs_t offset, uint16_t data, uint16_t mem_mask) +void bbusters_state::tx_vram_w(offs_t offset, uint16_t data, uint16_t mem_mask) { - COMBINE_DATA(&m_tx_videoram[offset]); + COMBINE_DATA(&m_tx_vram[offset]); m_fix_tilemap->mark_tile_dirty(offset); } @@ -258,12 +256,11 @@ void bbusters_state::video_start() m_pf_tilemap[0]->set_transparent_pen(15); - for (int i = 0; i < 2; i++) + for (auto &bitmap : m_bitmap_sprites) { - m_screen->register_screen_bitmap(m_bitmap_sprites[i]); - m_bitmap_sprites[i].fill(0xffff); + m_screen->register_screen_bitmap(bitmap); + bitmap.fill(0xffff); } - } /******************************************************************************/ @@ -275,11 +272,11 @@ void bbusters_state::mix_sprites(bitmap_ind16 &bitmap, bitmap_ind16 &srcbitmap, { for (int y = cliprect.min_y; y <= cliprect.max_y; y++) { - uint16_t *srcbuf = &srcbitmap.pix(y); - uint16_t *dstbuf = &bitmap.pix(y); + uint16_t const *const srcbuf = &srcbitmap.pix(y); + uint16_t *const dstbuf = &bitmap.pix(y); for (int x = cliprect.min_x; x <= cliprect.max_x; x++) { - uint16_t srcdat = srcbuf[x]; + uint16_t const srcdat = srcbuf[x]; if ((srcdat & 0xf) != 0xf) MIX(srcdat, x, dstbuf); } @@ -293,10 +290,10 @@ uint32_t bbusters_state::screen_update(screen_device &screen, bitmap_ind16 &bitm m_sprites[1]->draw_sprites(m_bitmap_sprites[1], cliprect); m_sprites[0]->draw_sprites(m_bitmap_sprites[0], cliprect); - m_pf_tilemap[0]->set_scrollx(0, m_pf_scroll_data[0][0]); - m_pf_tilemap[0]->set_scrolly(0, m_pf_scroll_data[0][1]); - m_pf_tilemap[1]->set_scrollx(0, m_pf_scroll_data[1][0]); - m_pf_tilemap[1]->set_scrolly(0, m_pf_scroll_data[1][1]); + m_pf_tilemap[0]->set_scrollx(0, m_pf_scroll_reg[0][0]); + m_pf_tilemap[0]->set_scrolly(0, m_pf_scroll_reg[0][1]); + m_pf_tilemap[1]->set_scrollx(0, m_pf_scroll_reg[1][0]); + m_pf_tilemap[1]->set_scrolly(0, m_pf_scroll_reg[1][1]); m_pf_tilemap[1]->draw(screen, bitmap, cliprect, 0, 0); @@ -313,20 +310,20 @@ uint32_t bbusters_state::screen_update(screen_device &screen, bitmap_ind16 &bitm /*******************************************************************************/ -void bbusters_state::bbusters_map(address_map &map) +void bbusters_state::main_map(address_map &map) { map(0x000000, 0x07ffff).rom(); - map(0x080000, 0x08ffff).ram().share("ram"); - map(0x090000, 0x090fff).ram().w(FUNC(bbusters_state::video_w)).share("tx_videoram"); + map(0x080000, 0x08ffff).ram(); + map(0x090000, 0x090fff).ram().w(FUNC(bbusters_state::tx_vram_w)).share(m_tx_vram); map(0x0a0000, 0x0a0fff).ram().share("spriteram1"); map(0x0a1000, 0x0a7fff).ram(); /* service mode */ map(0x0a8000, 0x0a8fff).ram().share("spriteram2"); map(0x0a9000, 0x0affff).ram(); /* service mode */ - map(0x0b0000, 0x0b1fff).ram().w(FUNC(bbusters_state::pf_w<0>)).share("pf1_data"); - map(0x0b2000, 0x0b3fff).ram().w(FUNC(bbusters_state::pf_w<1>)).share("pf2_data"); + map(0x0b0000, 0x0b1fff).ram().w(FUNC(bbusters_state::pf_vram_w<0>)).share(m_pf_vram[0]); + map(0x0b2000, 0x0b3fff).ram().w(FUNC(bbusters_state::pf_vram_w<1>)).share(m_pf_vram[1]); map(0x0b4000, 0x0b5fff).ram(); /* service mode */ - map(0x0b8000, 0x0b8003).writeonly().share("pf1_scroll_data"); - map(0x0b8008, 0x0b800b).writeonly().share("pf2_scroll_data"); + map(0x0b8000, 0x0b8003).writeonly().share(m_pf_scroll_reg[0]); + map(0x0b8008, 0x0b800b).writeonly().share(m_pf_scroll_reg[1]); map(0x0d0000, 0x0d0fff).ram().w("palette", FUNC(palette_device::write16)).share("palette"); map(0x0e0000, 0x0e0001).portr("COINS"); /* Coins */ map(0x0e0002, 0x0e0003).portr("IN0"); /* Player 1 & 2 */ @@ -336,9 +333,9 @@ void bbusters_state::bbusters_map(address_map &map) map(0x0e0019, 0x0e0019).r(m_soundlatch[1], FUNC(generic_latch_8_device::read)); map(0x0e8000, 0x0e8003).rw("adc", FUNC(upd7004_device::read), FUNC(upd7004_device::write)).umask16(0x00ff); map(0x0f0000, 0x0f0001).w(FUNC(bbusters_state::coin_counter_w)); - map(0x0f0008, 0x0f0009).w(FUNC(bbusters_state::three_gun_output_w)); + map(0x0f0008, 0x0f0009).w(FUNC(bbusters_state::gun_output_w)); map(0x0f0019, 0x0f0019).w(FUNC(bbusters_state::sound_cpu_w)); - map(0x0f8000, 0x0f80ff).r(FUNC(bbusters_state::eprom_r)).writeonly().share("eeprom"); /* Eeprom */ + map(0x0f8000, 0x0f80ff).r(FUNC(bbusters_state::eprom_r)).writeonly().share(m_eprom_data); /* Eeprom */ } /*******************************************************************************/ @@ -464,9 +461,9 @@ INPUT_PORTS_END /******************************************************************************/ static GFXDECODE_START( gfx_bbusters ) - GFXDECODE_ENTRY( "tx_tiles", 0, gfx_8x8x4_packed_msb, 0, 16 ) - GFXDECODE_ENTRY( "gfx4", 0, gfx_8x8x4_col_2x2_group_packed_msb, 768, 16 ) - GFXDECODE_ENTRY( "gfx5", 0, gfx_8x8x4_col_2x2_group_packed_msb, 1024+256, 16 ) + GFXDECODE_ENTRY( "tx_tiles", 0, gfx_8x8x4_packed_msb, 0, 16 ) + GFXDECODE_ENTRY( "bg1_tiles", 0, gfx_8x8x4_col_2x2_group_packed_msb, 768, 16 ) + GFXDECODE_ENTRY( "bg2_tiles", 0, gfx_8x8x4_col_2x2_group_packed_msb, 1024+256, 16 ) GFXDECODE_END /******************************************************************************/ @@ -475,7 +472,7 @@ void bbusters_state::bbusters(machine_config &config) { /* basic machine hardware */ M68000(config, m_maincpu, 12000000); - m_maincpu->set_addrmap(AS_PROGRAM, &bbusters_state::bbusters_map); + m_maincpu->set_addrmap(AS_PROGRAM, &bbusters_state::main_map); m_maincpu->set_vblank_int("screen", FUNC(bbusters_state::irq6_line_hold)); Z80(config, m_audiocpu, 4000000); // Accurate @@ -561,10 +558,10 @@ ROM_START( bbusters ) ROM_LOAD16_WORD_SWAP( "bb-f23.l13", 0x100000, 0x80000, CRC(c89fe0da) SHA1(92be860a7191e7473c42aa2da981eda873219d3d) ) ROM_LOAD16_WORD_SWAP( "bb-f24.l15", 0x180000, 0x80000, CRC(e0d81359) SHA1(2213c17651b6c023a456447f352b0739439f913a) ) - ROM_REGION( 0x80000, "gfx4", 0 ) + ROM_REGION( 0x80000, "bg1_tiles", 0 ) ROM_LOAD( "bb-back1.m4", 0x000000, 0x80000, CRC(b5445313) SHA1(3c99b557b2af30ff0fbc8a7dc6c40448c4f327db) ) - ROM_REGION( 0x80000, "gfx5", 0 ) + ROM_REGION( 0x80000, "bg2_tiles", 0 ) ROM_LOAD( "bb-back2.m6", 0x000000, 0x80000, CRC(8be996f6) SHA1(1e2c56f4c24793f806d7b366b92edc03145ae94c) ) ROM_REGION( 0x10000, "sprites1:scale_table", 0 ) /* Zoom table - same rom exists in 4 different locations on the board */ @@ -607,10 +604,10 @@ ROM_START( bbustersu ) ROM_LOAD16_WORD_SWAP( "bb-f23.l13", 0x100000, 0x80000, CRC(c89fe0da) SHA1(92be860a7191e7473c42aa2da981eda873219d3d) ) ROM_LOAD16_WORD_SWAP( "bb-f24.l15", 0x180000, 0x80000, CRC(e0d81359) SHA1(2213c17651b6c023a456447f352b0739439f913a) ) - ROM_REGION( 0x80000, "gfx4", 0 ) + ROM_REGION( 0x80000, "bg1_tiles", 0 ) ROM_LOAD( "bb-back1.m4", 0x000000, 0x80000, CRC(b5445313) SHA1(3c99b557b2af30ff0fbc8a7dc6c40448c4f327db) ) - ROM_REGION( 0x80000, "gfx5", 0 ) + ROM_REGION( 0x80000, "bg2_tiles", 0 ) ROM_LOAD( "bb-back2.m6", 0x000000, 0x80000, CRC(8be996f6) SHA1(1e2c56f4c24793f806d7b366b92edc03145ae94c) ) ROM_REGION( 0x10000, "sprites1:scale_table", 0 ) /* Zoom table - same rom exists in 4 different locations on the board */ @@ -625,7 +622,7 @@ ROM_START( bbustersu ) ROM_LOAD( "bb-pcma.l5", 0x000000, 0x80000, CRC(44cd5bfe) SHA1(26a612191a0aa614c090203485aba17c99c763ee) ) ROM_REGION( 0x80000, "ymsnd:adpcmb", 0 ) - ROM_LOAD( "bb-pcma.l5", 0x000000, 0x80000, CRC(44cd5bfe) SHA1(26a612191a0aa614c090203485aba17c99c763ee) ) + ROM_LOAD( "bb-pcmb.l3", 0x000000, 0x80000, CRC(c8d5dd53) SHA1(0f7e94532cc14852ca12c1b792e5479667af899e) ) ROM_END ROM_START( bbustersua ) @@ -653,10 +650,10 @@ ROM_START( bbustersua ) ROM_LOAD16_WORD_SWAP( "bb-f23.l13", 0x100000, 0x80000, CRC(c89fe0da) SHA1(92be860a7191e7473c42aa2da981eda873219d3d) ) ROM_LOAD16_WORD_SWAP( "bb-f24.l15", 0x180000, 0x80000, CRC(e0d81359) SHA1(2213c17651b6c023a456447f352b0739439f913a) ) - ROM_REGION( 0x80000, "gfx4", 0 ) + ROM_REGION( 0x80000, "bg1_tiles", 0 ) ROM_LOAD( "bb-back1.m4", 0x000000, 0x80000, CRC(b5445313) SHA1(3c99b557b2af30ff0fbc8a7dc6c40448c4f327db) ) - ROM_REGION( 0x80000, "gfx5", 0 ) + ROM_REGION( 0x80000, "bg2_tiles", 0 ) ROM_LOAD( "bb-back2.m6", 0x000000, 0x80000, CRC(8be996f6) SHA1(1e2c56f4c24793f806d7b366b92edc03145ae94c) ) ROM_REGION( 0x10000, "sprites1:scale_table", 0 ) /* Zoom table - same rom exists in 4 different locations on the board */ @@ -671,7 +668,7 @@ ROM_START( bbustersua ) ROM_LOAD( "bb-pcma.l5", 0x000000, 0x80000, CRC(44cd5bfe) SHA1(26a612191a0aa614c090203485aba17c99c763ee) ) ROM_REGION( 0x80000, "ymsnd:adpcmb", 0 ) - ROM_LOAD( "bb-pcma.l5", 0x000000, 0x80000, CRC(44cd5bfe) SHA1(26a612191a0aa614c090203485aba17c99c763ee) ) + ROM_LOAD( "bb-pcmb.l3", 0x000000, 0x80000, CRC(c8d5dd53) SHA1(0f7e94532cc14852ca12c1b792e5479667af899e) ) ROM_END ROM_START( bbustersj ) @@ -699,10 +696,10 @@ ROM_START( bbustersj ) ROM_LOAD16_WORD_SWAP( "bb-f23.l13", 0x100000, 0x80000, CRC(c89fe0da) SHA1(92be860a7191e7473c42aa2da981eda873219d3d) ) ROM_LOAD16_WORD_SWAP( "bb-f24.l15", 0x180000, 0x80000, CRC(e0d81359) SHA1(2213c17651b6c023a456447f352b0739439f913a) ) - ROM_REGION( 0x80000, "gfx4", 0 ) + ROM_REGION( 0x80000, "bg1_tiles", 0 ) ROM_LOAD( "bb-back1.m4", 0x000000, 0x80000, CRC(b5445313) SHA1(3c99b557b2af30ff0fbc8a7dc6c40448c4f327db) ) - ROM_REGION( 0x80000, "gfx5", 0 ) + ROM_REGION( 0x80000, "bg2_tiles", 0 ) ROM_LOAD( "bb-back2.m6", 0x000000, 0x80000, CRC(8be996f6) SHA1(1e2c56f4c24793f806d7b366b92edc03145ae94c) ) ROM_REGION( 0x10000, "sprites1:scale_table", 0 ) /* Zoom table - same rom exists in 4 different locations on the board */ @@ -745,10 +742,10 @@ ROM_START( bbustersja ) ROM_LOAD16_WORD_SWAP( "bb-f23.l13", 0x100000, 0x80000, CRC(c89fe0da) SHA1(92be860a7191e7473c42aa2da981eda873219d3d) ) ROM_LOAD16_WORD_SWAP( "bb-f24.l15", 0x180000, 0x80000, CRC(e0d81359) SHA1(2213c17651b6c023a456447f352b0739439f913a) ) - ROM_REGION( 0x80000, "gfx4", 0 ) + ROM_REGION( 0x80000, "bg1_tiles", 0 ) ROM_LOAD( "bb-back1.m4", 0x000000, 0x80000, CRC(b5445313) SHA1(3c99b557b2af30ff0fbc8a7dc6c40448c4f327db) ) - ROM_REGION( 0x80000, "gfx5", 0 ) + ROM_REGION( 0x80000, "bg2_tiles", 0 ) ROM_LOAD( "bb-back2.m6", 0x000000, 0x80000, CRC(8be996f6) SHA1(1e2c56f4c24793f806d7b366b92edc03145ae94c) ) ROM_REGION( 0x10000, "sprites1:scale_table", 0 ) /* Zoom table - same rom exists in 4 different locations on the board */ diff --git a/src/mame/snk/mainsnk.cpp b/src/mame/snk/mainsnk.cpp index 28869f35f65d2..bd4d27540b2b2 100644 --- a/src/mame/snk/mainsnk.cpp +++ b/src/mame/snk/mainsnk.cpp @@ -138,7 +138,7 @@ class mainsnk_state : public driver_device m_fgram(*this, "fgram") { } - void mainsnk(machine_config &config); + void mainsnk(machine_config &config) ATTR_COLD; protected: virtual void video_start() override ATTR_COLD; @@ -213,7 +213,7 @@ TILEMAP_MAPPER_MEMBER(mainsnk_state::tx_scan_cols) // tilemap is 36x28, the central part is from the first RAM page and the // extra 4 columns are from the second page col -= 2; - if (col & 0x20) + if (BIT(col, 5)) return 0x400 + row + ((col & 0x1f) << 5); else return row + (col << 5); @@ -221,17 +221,17 @@ TILEMAP_MAPPER_MEMBER(mainsnk_state::tx_scan_cols) TILE_GET_INFO_MEMBER(mainsnk_state::get_tx_tile_info) { - int code = m_fgram[tile_index]; + int const code = m_fgram[tile_index]; tileinfo.set(0, code, 0, - tile_index & 0x400 ? TILE_FORCE_LAYER0 : 0); + BIT(tile_index, 10) ? TILE_FORCE_LAYER0 : 0); } TILE_GET_INFO_MEMBER(mainsnk_state::get_bg_tile_info) { - int code = (m_bgram[tile_index]); + int const code = (m_bgram[tile_index]); tileinfo.set(0, m_bg_tile_offset + code, @@ -257,7 +257,7 @@ void mainsnk_state::video_start() void mainsnk_state::c600_w(uint8_t data) { - int total_elements = m_gfxdecode->gfx(0)->elements(); + int const total_elements = m_gfxdecode->gfx(0)->elements(); flip_screen_set(BIT(data, 7)); @@ -299,13 +299,13 @@ void mainsnk_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect while (source < finish) { - int attributes = source[3]; + int const attributes = source[3]; int tile_number = source[1]; int sy = source[0]; int sx = source[2]; - int color = attributes & 0xf; - int flipx = 0; - int flipy = 0; + int const color = attributes & 0xf; + bool flipx = false; + bool flipy = false; if (sy > 240) sy -= 256; tile_number |= attributes << 4 & 0x300; @@ -344,7 +344,8 @@ uint32_t mainsnk_state::screen_update(screen_device &screen, bitmap_ind16 &bitma uint8_t mainsnk_state::sound_ack_r() { - m_audiocpu->set_input_line(0, CLEAR_LINE); + if (!machine().side_effects_disabled()) + m_audiocpu->set_input_line(0, CLEAR_LINE); return 0xff; } @@ -573,9 +574,8 @@ static const gfx_layout sprite_layout = RGN_FRAC(1,3), 3, { RGN_FRAC(2,3),RGN_FRAC(1,3),RGN_FRAC(0,3) }, - { 7,6,5,4,3,2,1,0, 15,14,13,12,11,10,9,8 }, - { 0*16, 1*16, 2*16, 3*16, 4*16, 5*16, 6*16, 7*16, - 8*16, 9*16, 10*16, 11*16, 12*16, 13*16, 14*16, 15*16 }, + { STEP8(7,-1), STEP8(15,-1) }, + { STEP16(0,16) }, 256 }; diff --git a/src/mame/snk/mechatt.cpp b/src/mame/snk/mechatt.cpp index 1086a95540043..3c41ea4117cc4 100644 --- a/src/mame/snk/mechatt.cpp +++ b/src/mame/snk/mechatt.cpp @@ -156,17 +156,17 @@ class mechatt_state : public driver_device m_audiocpu(*this, "audiocpu"), m_screen(*this, "screen"), m_gfxdecode(*this, "gfxdecode"), - m_sprites(*this, "sprites1"), - m_spriteram(*this, "spriteram1"), + m_sprites(*this, "sprites"), + m_spriteram(*this, "spriteram"), m_soundlatch(*this, "soundlatch%u", 1U), - m_tx_videoram(*this, "tx_videoram"), - m_pf_data(*this, "pf%u_data", 1U), - m_pf_scroll_data(*this, "pf%u_scroll_data", 1U), + m_tx_vram(*this, "tx_videoram"), + m_pf_vram(*this, "pf%u_vram", 1U), + m_pf_scroll_reg(*this, "pf%u_scroll_reg", 1U), m_gun_io(*this, { "GUNX1", "GUNY1", "GUNX2", "GUNY2" }), m_gun_recoil(*this, "Player%u_Gun_Recoil", 1U) { } - void mechatt(machine_config &config); + void mechatt(machine_config &config) ATTR_COLD; protected: virtual void machine_start() override ATTR_COLD; @@ -180,35 +180,36 @@ class mechatt_state : public driver_device required_device m_sprites; required_device m_spriteram; required_device_array m_soundlatch; - required_shared_ptr m_tx_videoram; - required_shared_ptr_array m_pf_data; - required_shared_ptr_array m_pf_scroll_data; + required_shared_ptr m_tx_vram; + required_shared_ptr_array m_pf_vram; + required_shared_ptr_array m_pf_scroll_reg; required_ioport_array<4> m_gun_io; output_finder<2> m_gun_recoil; tilemap_t *m_fix_tilemap = nullptr; tilemap_t *m_pf_tilemap[2]{}; + bitmap_ind16 m_bitmap_sprites; + TILE_GET_INFO_MEMBER(get_tile_info); template TILE_GET_INFO_MEMBER(get_pf_tile_info); void sound_cpu_w(uint8_t data); - void video_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); - template void pf_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); + void tx_vram_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); + template void pf_vram_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); void coin_counter_w(uint8_t data); - void mechatt_map(address_map &map) ATTR_COLD; - void sound_map(address_map &map) ATTR_COLD; - void sounda_portmap(address_map &map) ATTR_COLD; - - void two_gun_output_w(uint16_t data); - uint16_t mechatt_gun_r(offs_t offset); + void gun_output_w(uint16_t data); + uint16_t gun_r(offs_t offset); template void mix_sprites(bitmap_ind16 &bitmap, bitmap_ind16 &srcbitmap, const rectangle &cliprect, Proc MIX); - bitmap_ind16 m_bitmap_sprites; uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + + void main_map(address_map &map) ATTR_COLD; + void sound_map(address_map &map) ATTR_COLD; + void sounda_portmap(address_map &map) ATTR_COLD; }; /******************************************************************************/ @@ -225,9 +226,9 @@ void mechatt_state::sound_cpu_w(uint8_t data) } template -void mechatt_state::pf_w(offs_t offset, uint16_t data, uint16_t mem_mask) +void mechatt_state::pf_vram_w(offs_t offset, uint16_t data, uint16_t mem_mask) { - COMBINE_DATA(&m_pf_data[Layer][offset]); + COMBINE_DATA(&m_pf_vram[Layer][offset]); m_pf_tilemap[Layer]->mark_tile_dirty(offset); } @@ -240,20 +241,20 @@ void mechatt_state::coin_counter_w(uint8_t data) TILE_GET_INFO_MEMBER(mechatt_state::get_tile_info) { - uint16_t tile = m_tx_videoram[tile_index]; - tileinfo.set(0, tile&0xfff, tile>>12, 0); + uint16_t const tile = m_tx_vram[tile_index]; + tileinfo.set(0, tile & 0xfff, tile >> 12, 0); } template TILE_GET_INFO_MEMBER(mechatt_state::get_pf_tile_info) { - uint16_t tile = m_pf_data[Layer][tile_index]; - tileinfo.set(Gfx, tile&0xfff, tile>>12, 0); + uint16_t const tile = m_pf_vram[Layer][tile_index]; + tileinfo.set(Gfx, tile & 0xfff, tile >> 12, 0); } -void mechatt_state::video_w(offs_t offset, uint16_t data, uint16_t mem_mask) +void mechatt_state::tx_vram_w(offs_t offset, uint16_t data, uint16_t mem_mask) { - COMBINE_DATA(&m_tx_videoram[offset]); + COMBINE_DATA(&m_tx_vram[offset]); m_fix_tilemap->mark_tile_dirty(offset); } @@ -278,11 +279,11 @@ void mechatt_state::mix_sprites(bitmap_ind16 &bitmap, bitmap_ind16 &srcbitmap, c { for (int y = cliprect.min_y; y <= cliprect.max_y; y++) { - uint16_t *srcbuf = &srcbitmap.pix(y); - uint16_t *dstbuf = &bitmap.pix(y); + uint16_t const *const srcbuf = &srcbitmap.pix(y); + uint16_t *const dstbuf = &bitmap.pix(y); for (int x = cliprect.min_x; x <= cliprect.max_x; x++) { - uint16_t srcdat = srcbuf[x]; + uint16_t const srcdat = srcbuf[x]; if ((srcdat & 0xf) != 0xf) MIX(srcdat, x, dstbuf); } @@ -294,10 +295,10 @@ uint32_t mechatt_state::screen_update(screen_device &screen, bitmap_ind16 &bitma m_bitmap_sprites.fill(0xffff); m_sprites->draw_sprites(m_bitmap_sprites, cliprect); - m_pf_tilemap[0]->set_scrollx(0, m_pf_scroll_data[0][0]); - m_pf_tilemap[0]->set_scrolly(0, m_pf_scroll_data[0][1]); - m_pf_tilemap[1]->set_scrollx(0, m_pf_scroll_data[1][0]); - m_pf_tilemap[1]->set_scrolly(0, m_pf_scroll_data[1][1]); + m_pf_tilemap[0]->set_scrollx(0, m_pf_scroll_reg[0][0]); + m_pf_tilemap[0]->set_scrolly(0, m_pf_scroll_reg[0][1]); + m_pf_tilemap[1]->set_scrollx(0, m_pf_scroll_reg[1][0]); + m_pf_tilemap[1]->set_scrolly(0, m_pf_scroll_reg[1][1]); m_pf_tilemap[1]->draw(screen, bitmap, cliprect, 0, 0); @@ -312,13 +313,13 @@ uint32_t mechatt_state::screen_update(screen_device &screen, bitmap_ind16 &bitma /*******************************************************************************/ -void mechatt_state::two_gun_output_w(uint16_t data) +void mechatt_state::gun_output_w(uint16_t data) { for (int i = 0; i < 2; i++) m_gun_recoil[i] = BIT(data, i); } -uint16_t mechatt_state::mechatt_gun_r(offs_t offset) +uint16_t mechatt_state::gun_r(offs_t offset) { int x = m_gun_io[offset ? 2 : 0]->read(); int y = m_gun_io[offset ? 3 : 1]->read(); @@ -331,23 +332,23 @@ uint16_t mechatt_state::mechatt_gun_r(offs_t offset) return x | (y << 8); } -void mechatt_state::mechatt_map(address_map &map) +void mechatt_state::main_map(address_map &map) { map(0x000000, 0x06ffff).rom(); - map(0x070000, 0x07ffff).ram().share("ram"); - map(0x090000, 0x090fff).ram().w(FUNC(mechatt_state::video_w)).share("tx_videoram"); - map(0x0a0000, 0x0a0fff).ram().share("spriteram1"); + map(0x070000, 0x07ffff).ram(); + map(0x090000, 0x090fff).ram().w(FUNC(mechatt_state::tx_vram_w)).share(m_tx_vram); + map(0x0a0000, 0x0a0fff).ram().share("spriteram"); map(0x0a1000, 0x0a7fff).nopw(); - map(0x0b0000, 0x0b3fff).ram().w(FUNC(mechatt_state::pf_w<0>)).share("pf1_data"); - map(0x0b8000, 0x0b8003).writeonly().share("pf1_scroll_data"); - map(0x0c0000, 0x0c3fff).ram().w(FUNC(mechatt_state::pf_w<1>)).share("pf2_data"); - map(0x0c8000, 0x0c8003).writeonly().share("pf2_scroll_data"); + map(0x0b0000, 0x0b3fff).ram().w(FUNC(mechatt_state::pf_vram_w<0>)).share(m_pf_vram[0]); + map(0x0b8000, 0x0b8003).writeonly().share(m_pf_scroll_reg[0]); + map(0x0c0000, 0x0c3fff).ram().w(FUNC(mechatt_state::pf_vram_w<1>)).share(m_pf_vram[1]); + map(0x0c8000, 0x0c8003).writeonly().share(m_pf_scroll_reg[1]); map(0x0d0000, 0x0d07ff).ram().w("palette", FUNC(palette_device::write16)).share("palette"); map(0x0e0000, 0x0e0001).portr("IN0"); map(0x0e0002, 0x0e0003).portr("DSW1"); - map(0x0e0004, 0x0e0007).r(FUNC(mechatt_state::mechatt_gun_r)); + map(0x0e0004, 0x0e0007).r(FUNC(mechatt_state::gun_r)); map(0x0e4000, 0x0e4001).w(FUNC(mechatt_state::coin_counter_w)); - map(0x0e4002, 0x0e4003).w(FUNC(mechatt_state::two_gun_output_w)); + map(0x0e4002, 0x0e4003).w(FUNC(mechatt_state::gun_output_w)); map(0x0e8001, 0x0e8001).r(m_soundlatch[1], FUNC(generic_latch_8_device::read)).w(FUNC(mechatt_state::sound_cpu_w)); } @@ -476,9 +477,9 @@ INPUT_PORTS_END /******************************************************************************/ static GFXDECODE_START( gfx_mechatt ) - GFXDECODE_ENTRY( "tx_tiles", 0, gfx_8x8x4_packed_msb, 0, 16 ) - GFXDECODE_ENTRY( "gfx3", 0, gfx_8x8x4_col_2x2_group_packed_msb, 512, 16 ) - GFXDECODE_ENTRY( "gfx4", 0, gfx_8x8x4_col_2x2_group_packed_msb, 768, 16 ) + GFXDECODE_ENTRY( "tx_tiles", 0, gfx_8x8x4_packed_msb, 0, 16 ) + GFXDECODE_ENTRY( "bg1_tiles", 0, gfx_8x8x4_col_2x2_group_packed_msb, 512, 16 ) + GFXDECODE_ENTRY( "bg2_tiles", 0, gfx_8x8x4_col_2x2_group_packed_msb, 768, 16 ) GFXDECODE_END @@ -488,7 +489,7 @@ void mechatt_state::mechatt(machine_config &config) { /* basic machine hardware */ M68000(config, m_maincpu, 12000000); - m_maincpu->set_addrmap(AS_PROGRAM, &mechatt_state::mechatt_map); + m_maincpu->set_addrmap(AS_PROGRAM, &mechatt_state::main_map); m_maincpu->set_vblank_int("screen", FUNC(mechatt_state::irq4_line_hold)); Z80(config, m_audiocpu, 4000000); /* Accurate */ @@ -510,9 +511,9 @@ void mechatt_state::mechatt(machine_config &config) BUFFERED_SPRITERAM16(config, m_spriteram); SNK_BBUSTERS_SPR(config, m_sprites, 0); - m_sprites->set_scaletable_tag("sprites1:scale_table"); + m_sprites->set_scaletable_tag("sprites:scale_table"); m_sprites->set_palette("palette"); - m_sprites->set_spriteram_tag("spriteram1"); + m_sprites->set_spriteram_tag("spriteram"); /* sound hardware */ SPEAKER(config, "lspeaker").front_left(); @@ -544,22 +545,22 @@ ROM_START( mechatt ) ROM_REGION( 0x020000, "tx_tiles", 0 ) // Located on the A8002-2 board ROM_LOAD( "ma_1.l2", 0x000000, 0x10000, CRC(24766917) SHA1(9082a8ae849605ce65b5a0493ae69cfe282f7e7b) ) - ROM_REGION( 0x200000, "sprites1", 0 ) // Located on the A8002-2 board + ROM_REGION( 0x200000, "sprites", 0 ) // Located on the A8002-2 board ROM_LOAD16_WORD_SWAP( "mao89p13.bin", 0x000000, 0x80000, CRC(8bcb16cf) SHA1(409ee1944188d9ce39adce29b1df029b560dd5b0) ) ROM_LOAD16_WORD_SWAP( "ma189p15.bin", 0x080000, 0x80000, CRC(b84d9658) SHA1(448adecb0067d8f5b219ec2f94a8dec84187a554) ) ROM_LOAD16_WORD_SWAP( "ma289p17.bin", 0x100000, 0x80000, CRC(6cbe08ac) SHA1(8f81f6e92b84ab6867452011d52f3e7689c62a1a) ) ROM_LOAD16_WORD_SWAP( "ma389m15.bin", 0x180000, 0x80000, CRC(34d4585e) SHA1(38d9fd5d775e4b3c8b8b487a6ba9b8bdcb3274b0) ) - ROM_REGION( 0x80000, "gfx3", 0 ) // Located on the A8002-2 board + ROM_REGION( 0x80000, "bg1_tiles", 0 ) // Located on the A8002-2 board ROM_LOAD( "mab189a2.bin", 0x000000, 0x80000, CRC(e1c8b4d0) SHA1(2f8a1839cca892f8380c7cffe7a12e615d38fd55) ) - ROM_REGION( 0x80000, "gfx4", 0 ) // Located on the A8002-2 board + ROM_REGION( 0x80000, "bg2_tiles", 0 ) // Located on the A8002-2 board ROM_LOAD( "mab289c2.bin", 0x000000, 0x80000, CRC(14f97ceb) SHA1(a22033532ea616dc3a3db8b66ad6ccc6172ed7cc) ) ROM_REGION( 0x20000, "ymsnd", 0 ) // Located on the A8002-1 main board ROM_LOAD( "ma_2.d10", 0x000000, 0x20000, CRC(ea4cc30d) SHA1(d8f089fc0ce76309411706a8110ad907f93dc97e) ) - ROM_REGION( 0x20000, "sprites1:scale_table", 0 ) // Zoom table - Located on the A8002-2 board + ROM_REGION( 0x20000, "sprites:scale_table", 0 ) // Zoom table - Located on the A8002-2 board ROM_LOAD( "ma_8.f10", 0x000000, 0x10000, CRC(61f3de03) SHA1(736f9634fe054ea68a2aa90a743bd0dc320f23c9) ) ROM_LOAD( "ma_9.f12", 0x000000, 0x10000, CRC(61f3de03) SHA1(736f9634fe054ea68a2aa90a743bd0dc320f23c9) ) // identical to ma_8.f10 ROM_END @@ -577,7 +578,7 @@ ROM_START( mechattj ) // Uses EPROMs on official SNK A8002-5 & A8002-6 sub board ROM_REGION( 0x020000, "tx_tiles", 0 ) // Located on the A8002-2 board ROM_LOAD( "ma_1.l2", 0x000000, 0x10000, CRC(24766917) SHA1(9082a8ae849605ce65b5a0493ae69cfe282f7e7b) ) - ROM_REGION( 0x200000, "sprites1", 0 ) // Located on the A8002-6 sub board + ROM_REGION( 0x200000, "sprites", 0 ) // Located on the A8002-6 sub board ROM_LOAD16_BYTE( "s_9.a1", 0x000001, 0x20000, CRC(6e8e194c) SHA1(02bbd573a322a3f7f8e92ccceebffdd598b5489e) ) // these 4 == mao89p13.bin ROM_LOAD16_BYTE( "s_1.b1", 0x000000, 0x20000, CRC(fd9161ed) SHA1(b3e2434dd9cb1cafe1022774b863b5f1a008a9d2) ) ROM_LOAD16_BYTE( "s_10.a2", 0x040001, 0x20000, CRC(fad6a1ab) SHA1(5347b4493c8004dc8cedc0b37aba494f203142b8) ) @@ -595,13 +596,13 @@ ROM_START( mechattj ) // Uses EPROMs on official SNK A8002-5 & A8002-6 sub board ROM_LOAD16_BYTE( "s_16.a8", 0x1c0001, 0x20000, CRC(70f28040) SHA1(91012728953563fcc576725337e6ba7e1b49d1ba) ) ROM_LOAD16_BYTE( "s_8.b8", 0x1c0000, 0x20000, CRC(a6f8574f) SHA1(87c041669b2eaec495ae10a6f45b6668accb92bf) ) - ROM_REGION( 0x80000, "gfx3", 0 ) // these 4 == mab189a2.bin - Located on the A8002-5 sub board + ROM_REGION( 0x80000, "bg1_tiles", 0 ) // these 4 == mab189a2.bin - Located on the A8002-5 sub board ROM_LOAD( "s_21.b3", 0x000000, 0x20000, CRC(701a0072) SHA1(b03b6fa18e0cfcd5c7c541025fa2d3632d2f8387) ) ROM_LOAD( "s_22.b4", 0x020000, 0x20000, CRC(34e6225c) SHA1(f6335084f4f4c7a4b6528e6ad74962b88f81e3bc) ) ROM_LOAD( "s_23.b5", 0x040000, 0x20000, CRC(9a7399d3) SHA1(04e0327b0da75f621b51e1831cbdc4537082e32b) ) ROM_LOAD( "s_24.b6", 0x060000, 0x20000, CRC(f097459d) SHA1(466364677f048519eb2894ddecf76f5c52f6afe9) ) - ROM_REGION( 0x80000, "gfx4", 0 ) // these 4 == mab289c2.bin - Located on the A8002-5 sub board + ROM_REGION( 0x80000, "bg2_tiles", 0 ) // these 4 == mab289c2.bin - Located on the A8002-5 sub board ROM_LOAD( "s_17.a3", 0x000000, 0x20000, CRC(cc47c4a3) SHA1(140f53b671b4eaed6fcc516c4018f07a6d7c2290) ) ROM_LOAD( "s_18.a4", 0x020000, 0x20000, CRC(a04377e8) SHA1(841c6c3073b137f6a5c875db32039186c014f785) ) ROM_LOAD( "s_19.a5", 0x040000, 0x20000, CRC(b07f5289) SHA1(8817bd225edf9b0fa439b220617f925365e39253) ) @@ -610,7 +611,7 @@ ROM_START( mechattj ) // Uses EPROMs on official SNK A8002-5 & A8002-6 sub board ROM_REGION( 0x20000, "ymsnd", 0 ) // Located on the A8002-1 main board ROM_LOAD( "ma_2.d10", 0x000000, 0x20000, CRC(ea4cc30d) SHA1(d8f089fc0ce76309411706a8110ad907f93dc97e) ) - ROM_REGION( 0x20000, "sprites1:scale_table", 0 ) // Zoom table - Located on the A8002-2 board + ROM_REGION( 0x20000, "sprites:scale_table", 0 ) // Zoom table - Located on the A8002-2 board ROM_LOAD( "ma_8.f10", 0x000000, 0x10000, CRC(61f3de03) SHA1(736f9634fe054ea68a2aa90a743bd0dc320f23c9) ) ROM_LOAD( "ma_9.f12", 0x000000, 0x10000, CRC(61f3de03) SHA1(736f9634fe054ea68a2aa90a743bd0dc320f23c9) ) // identical to ma_8.f10 ROM_END @@ -628,22 +629,22 @@ ROM_START( mechattu ) ROM_REGION( 0x020000, "tx_tiles", 0 ) // Located on the A8002-2 board ROM_LOAD( "ma_1.l2", 0x000000, 0x10000, CRC(24766917) SHA1(9082a8ae849605ce65b5a0493ae69cfe282f7e7b) ) - ROM_REGION( 0x200000, "sprites1", 0 ) // Located on the A8002-2 board + ROM_REGION( 0x200000, "sprites", 0 ) // Located on the A8002-2 board ROM_LOAD16_WORD_SWAP( "mao89p13.bin", 0x000000, 0x80000, CRC(8bcb16cf) SHA1(409ee1944188d9ce39adce29b1df029b560dd5b0) ) ROM_LOAD16_WORD_SWAP( "ma189p15.bin", 0x080000, 0x80000, CRC(b84d9658) SHA1(448adecb0067d8f5b219ec2f94a8dec84187a554) ) ROM_LOAD16_WORD_SWAP( "ma289p17.bin", 0x100000, 0x80000, CRC(6cbe08ac) SHA1(8f81f6e92b84ab6867452011d52f3e7689c62a1a) ) ROM_LOAD16_WORD_SWAP( "ma389m15.bin", 0x180000, 0x80000, CRC(34d4585e) SHA1(38d9fd5d775e4b3c8b8b487a6ba9b8bdcb3274b0) ) - ROM_REGION( 0x80000, "gfx3", 0 ) // Located on the A8002-2 board + ROM_REGION( 0x80000, "bg1_tiles", 0 ) // Located on the A8002-2 board ROM_LOAD( "mab189a2.bin", 0x000000, 0x80000, CRC(e1c8b4d0) SHA1(2f8a1839cca892f8380c7cffe7a12e615d38fd55) ) - ROM_REGION( 0x80000, "gfx4", 0 ) // Located on the A8002-2 board + ROM_REGION( 0x80000, "bg2_tiles", 0 ) // Located on the A8002-2 board ROM_LOAD( "mab289c2.bin", 0x000000, 0x80000, CRC(14f97ceb) SHA1(a22033532ea616dc3a3db8b66ad6ccc6172ed7cc) ) ROM_REGION( 0x20000, "ymsnd", 0 ) // Located on the A8002-1 main board ROM_LOAD( "ma_2.d10", 0x000000, 0x20000, CRC(ea4cc30d) SHA1(d8f089fc0ce76309411706a8110ad907f93dc97e) ) - ROM_REGION( 0x20000, "sprites1:scale_table", 0 ) // Zoom table - Located on the A8002-2 board + ROM_REGION( 0x20000, "sprites:scale_table", 0 ) // Zoom table - Located on the A8002-2 board ROM_LOAD( "ma_8.f10", 0x000000, 0x10000, CRC(61f3de03) SHA1(736f9634fe054ea68a2aa90a743bd0dc320f23c9) ) ROM_LOAD( "ma_9.f12", 0x000000, 0x10000, CRC(61f3de03) SHA1(736f9634fe054ea68a2aa90a743bd0dc320f23c9) ) // identical to ma_8.f10 ROM_END @@ -662,7 +663,7 @@ ROM_START( mechattu1 ) // Uses EPROMs on official SNK A8002-5 & A8002-6 sub boar ROM_REGION( 0x020000, "tx_tiles", 0 ) // Located on the A8002-2 board ROM_LOAD( "ma_1.l2", 0x000000, 0x10000, CRC(24766917) SHA1(9082a8ae849605ce65b5a0493ae69cfe282f7e7b) ) - ROM_REGION( 0x200000, "sprites1", 0 ) // Located on the A8002-6 sub board + ROM_REGION( 0x200000, "sprites", 0 ) // Located on the A8002-6 sub board ROM_LOAD16_BYTE( "s_9.a1", 0x000001, 0x20000, CRC(6e8e194c) SHA1(02bbd573a322a3f7f8e92ccceebffdd598b5489e) ) // these 4 == mao89p13.bin ROM_LOAD16_BYTE( "s_1.b1", 0x000000, 0x20000, CRC(fd9161ed) SHA1(b3e2434dd9cb1cafe1022774b863b5f1a008a9d2) ) ROM_LOAD16_BYTE( "s_10.a2", 0x040001, 0x20000, CRC(fad6a1ab) SHA1(5347b4493c8004dc8cedc0b37aba494f203142b8) ) @@ -680,13 +681,13 @@ ROM_START( mechattu1 ) // Uses EPROMs on official SNK A8002-5 & A8002-6 sub boar ROM_LOAD16_BYTE( "s_16.a8", 0x1c0001, 0x20000, CRC(70f28040) SHA1(91012728953563fcc576725337e6ba7e1b49d1ba) ) ROM_LOAD16_BYTE( "s_8.b8", 0x1c0000, 0x20000, CRC(a6f8574f) SHA1(87c041669b2eaec495ae10a6f45b6668accb92bf) ) - ROM_REGION( 0x80000, "gfx3", 0 ) // these 4 == mab189a2.bin - Located on the A8002-5 sub board + ROM_REGION( 0x80000, "bg1_tiles", 0 ) // these 4 == mab189a2.bin - Located on the A8002-5 sub board ROM_LOAD( "s_21.b3", 0x000000, 0x20000, CRC(701a0072) SHA1(b03b6fa18e0cfcd5c7c541025fa2d3632d2f8387) ) ROM_LOAD( "s_22.b4", 0x020000, 0x20000, CRC(34e6225c) SHA1(f6335084f4f4c7a4b6528e6ad74962b88f81e3bc) ) ROM_LOAD( "s_23.b5", 0x040000, 0x20000, CRC(9a7399d3) SHA1(04e0327b0da75f621b51e1831cbdc4537082e32b) ) ROM_LOAD( "s_24.b6", 0x060000, 0x20000, CRC(f097459d) SHA1(466364677f048519eb2894ddecf76f5c52f6afe9) ) - ROM_REGION( 0x80000, "gfx4", 0 ) // these 4 == mab289c2.bin - Located on the A8002-5 sub board + ROM_REGION( 0x80000, "bg2_tiles", 0 ) // these 4 == mab289c2.bin - Located on the A8002-5 sub board ROM_LOAD( "s_17.a3", 0x000000, 0x20000, CRC(cc47c4a3) SHA1(140f53b671b4eaed6fcc516c4018f07a6d7c2290) ) ROM_LOAD( "s_18.a4", 0x020000, 0x20000, CRC(a04377e8) SHA1(841c6c3073b137f6a5c875db32039186c014f785) ) ROM_LOAD( "s_19.a5", 0x040000, 0x20000, CRC(b07f5289) SHA1(8817bd225edf9b0fa439b220617f925365e39253) ) @@ -695,7 +696,7 @@ ROM_START( mechattu1 ) // Uses EPROMs on official SNK A8002-5 & A8002-6 sub boar ROM_REGION( 0x20000, "ymsnd", 0 ) // Located on the A8002-1 main board ROM_LOAD( "ma_2.d10", 0x000000, 0x20000, CRC(ea4cc30d) SHA1(d8f089fc0ce76309411706a8110ad907f93dc97e) ) - ROM_REGION( 0x20000, "sprites1:scale_table", 0 ) // Zoom table - Located on the A8002-2 board + ROM_REGION( 0x20000, "sprites:scale_table", 0 ) // Zoom table - Located on the A8002-2 board ROM_LOAD( "ma_8.f10", 0x000000, 0x10000, CRC(61f3de03) SHA1(736f9634fe054ea68a2aa90a743bd0dc320f23c9) ) ROM_LOAD( "ma_9.f12", 0x000000, 0x10000, CRC(61f3de03) SHA1(736f9634fe054ea68a2aa90a743bd0dc320f23c9) ) // identical to ma_8.f10 ROM_END diff --git a/src/mame/snk/munchmo.cpp b/src/mame/snk/munchmo.cpp index 8bf632614f52a..01c828b677568 100644 --- a/src/mame/snk/munchmo.cpp +++ b/src/mame/snk/munchmo.cpp @@ -51,7 +51,7 @@ class munchmo_state : public driver_device , m_videoram(*this, "videoram") , m_status_vram(*this, "status_vram") , m_vreg(*this, "vreg") - , m_tiles_rom(*this, "tiles") + , m_tiles_rom(*this, "tilelut") , m_maincpu(*this, "maincpu") , m_audiocpu(*this, "audiocpu") , m_mainlatch(*this, "mainlatch") @@ -82,7 +82,7 @@ class munchmo_state : public driver_device void palette(palette_device &palette) const; void vblank_irq(int state); - IRQ_CALLBACK_MEMBER(generic_irq_ack); + IRQ_CALLBACK_MEMBER(irq_ack); uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_status(bitmap_ind16 &bitmap, const rectangle &cliprect); @@ -102,12 +102,12 @@ class munchmo_state : public driver_device required_region_ptr m_tiles_rom; // video-related - std::unique_ptr m_tmpbitmap; + bitmap_ind16 m_tmpbitmap; u8 m_palette_bank = 0U; - u8 m_flipscreen = 0U; + bool m_flipscreen = false; // misc - u8 m_nmi_enable = 0U; + bool m_nmi_enable = false; // devices required_device m_maincpu; @@ -173,7 +173,11 @@ void munchmo_state::flipscreen_w(int state) void munchmo_state::video_start() { - m_tmpbitmap = std::make_unique(512, 512); + m_tmpbitmap.allocate(512, 512); + + save_item(NAME(m_tmpbitmap)); + save_item(NAME(m_palette_bank)); + save_item(NAME(m_flipscreen)); } void munchmo_state::draw_status(bitmap_ind16 &bitmap, const rectangle &cliprect) @@ -208,15 +212,15 @@ void munchmo_state::draw_background(bitmap_ind16 &bitmap, const rectangle &clipr for (int offs = 0; offs < 0x100; offs++) { - int const sy = (offs % 16) * 32; - int const sx = (offs / 16) * 32; + int const sy = (offs & 0xf) * 32; + int const sx = (offs >> 4) * 32; int const tile_number = m_videoram[offs]; for (int row = 0; row < 4; row++) { for (int col = 0; col < 4; col++) { - gfx->opaque(*m_tmpbitmap, m_tmpbitmap->cliprect(), + gfx->opaque(m_tmpbitmap, m_tmpbitmap.cliprect(), m_tiles_rom[col + tile_number * 4 + row * 0x400], m_palette_bank, 0, 0, // flip @@ -228,15 +232,15 @@ void munchmo_state::draw_background(bitmap_ind16 &bitmap, const rectangle &clipr int const scrollx = -(m_vreg[2] *2 + (m_vreg[3] >> 7)) - 64 - 128 - 16; int const scrolly = 0; - copyscrollbitmap(bitmap, *m_tmpbitmap, 1, &scrollx, 1, &scrolly, cliprect); + copyscrollbitmap(bitmap, m_tmpbitmap, 1, &scrollx, 1, &scrolly, cliprect); } void munchmo_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect) { int const scroll = m_vreg[2]; int const flags = m_vreg[3]; // XB?????? - int const xadjust = - 128 - 16 - ((flags & 0x80) ? 1 : 0); - int const bank = (flags & 0x40) ? 1 : 0; + int const xadjust = - 128 - 16 - BIT(flags, 7); + int const bank = BIT(flags, 6); gfx_element *const gfx = m_gfxdecode->gfx(2 + bank); int const color_base = m_palette_bank * 4 + 3; int const firstsprite = m_vreg[0] & 0x3f; @@ -252,7 +256,7 @@ void munchmo_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect int sy = (offs >> 6) << 5; // Y YY------ sy += (attributes >> 2) & 0x1f; - if (attributes & 0x80) + if (BIT(attributes, 7)) { sx = (sx >> 1) | (tile_number & 0x80); sx = 2 * ((-32 - scroll - sx) & 0xff) + xadjust; @@ -300,7 +304,7 @@ void munchmo_state::vblank_irq(int state) } } -IRQ_CALLBACK_MEMBER(munchmo_state::generic_irq_ack) +IRQ_CALLBACK_MEMBER(munchmo_state::irq_ack) { device.execute().set_input_line(0, CLEAR_LINE); return 0xff; @@ -473,70 +477,52 @@ INPUT_PORTS_END static const gfx_layout char_layout = { 8,8, - 256, + RGN_FRAC(1,2), 4, - { 0, 8, 256*128,256*128+8 }, - { 7,6,5,4,3,2,1,0 }, - { 0*16, 1*16, 2*16, 3*16, 4*16, 5*16, 6*16, 7*16 }, + { 0, 8, RGN_FRAC(1,2), RGN_FRAC(1,2)+8 }, + { STEP8(7,-1) }, + { STEP8(0,8*2) }, 128 }; static const gfx_layout tile_layout = { - 8,8, - 0x100, + 4,8, + RGN_FRAC(1,1), 4, - { 8,12,0,4 }, - { 0,0,1,1,2,2,3,3 }, - { 0*16, 1*16, 2*16, 3*16, 4*16, 5*16, 6*16, 7*16 }, + { STEP4(0,4) }, + { STEP4(0,1) }, + { STEP8(0,4*4) }, 128 }; static const gfx_layout sprite_layout1 = { - 32,32, + 16,32, 128, 3, - { 0x4000*8,0x2000*8,0 }, - { - 7,7,6,6,5,5,4,4,3,3,2,2,1,1,0,0, - 0x8000+7,0x8000+7,0x8000+6,0x8000+6,0x8000+5,0x8000+5,0x8000+4,0x8000+4, - 0x8000+3,0x8000+3,0x8000+2,0x8000+2,0x8000+1,0x8000+1,0x8000+0,0x8000+0 - }, - { - 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8, - 8*8, 9*8, 10*8,11*8,12*8,13*8,14*8,15*8, - 16*8,17*8,18*8,19*8,20*8,21*8,22*8,23*8, - 24*8,25*8,26*8,27*8,28*8,29*8,30*8,31*8 - }, + { 0x4000*8, 0x2000*8, 0 }, + { STEP8(7,-1),STEP8(0x8000+7,-1) }, + { STEP32(0,8) }, 256 }; static const gfx_layout sprite_layout2 = { - 32,32, + 16,32, 128, 3, - { 0,0,0 }, - { - 7,7,6,6,5,5,4,4,3,3,2,2,1,1,0,0, - 0x8000+7,0x8000+7,0x8000+6,0x8000+6,0x8000+5,0x8000+5,0x8000+4,0x8000+4, - 0x8000+3,0x8000+3,0x8000+2,0x8000+2,0x8000+1,0x8000+1,0x8000+0,0x8000+0 - }, - { - 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8, - 8*8, 9*8, 10*8,11*8,12*8,13*8,14*8,15*8, - 16*8,17*8,18*8,19*8,20*8,21*8,22*8,23*8, - 24*8,25*8,26*8,27*8,28*8,29*8,30*8,31*8 - }, + { 0, 0, 0 }, + { STEP8(7,-1),STEP8(0x8000+7,-1) }, + { STEP32(0,8) }, 256 }; static GFXDECODE_START( gfx_mnchmobl ) GFXDECODE_ENTRY( "chars", 0, char_layout, 0, 4 ) // colors 0- 63 - GFXDECODE_ENTRY( "tiles", 0x1000, tile_layout, 64, 4 ) // colors 64-127 - GFXDECODE_ENTRY( "sprites", 0, sprite_layout1, 128, 16 ) // colors 128-255 - GFXDECODE_ENTRY( "monochrome_sprites", 0, sprite_layout2, 128, 16 ) // colors 128-255 + GFXDECODE_SCALE( "tiles", 0, tile_layout, 64, 4, 2, 1 ) // colors 64-127 + GFXDECODE_SCALE( "sprites", 0, sprite_layout1, 128, 16, 2, 1 ) // colors 128-255 + GFXDECODE_SCALE( "monochrome_sprites", 0, sprite_layout2, 128, 16, 2, 1 ) // colors 128-255 GFXDECODE_END @@ -548,8 +534,6 @@ GFXDECODE_END void munchmo_state::machine_start() { - save_item(NAME(m_palette_bank)); - save_item(NAME(m_flipscreen)); save_item(NAME(m_nmi_enable)); } @@ -558,11 +542,11 @@ void munchmo_state::mnchmobl(machine_config &config) // basic machine hardware Z80(config, m_maincpu, XTAL(15'000'000) / 4); // from pin 13 of XTAL-driven 163 m_maincpu->set_addrmap(AS_PROGRAM, &munchmo_state::main_map); - m_maincpu->set_irq_acknowledge_callback(FUNC(munchmo_state::generic_irq_ack)); // IORQ clears flip-flop at 1-2C + m_maincpu->set_irq_acknowledge_callback(FUNC(munchmo_state::irq_ack)); // IORQ clears flip-flop at 1-2C Z80(config, m_audiocpu, XTAL(15'000'000) / 8); // from pin 12 of XTAL-driven 163 m_audiocpu->set_addrmap(AS_PROGRAM, &munchmo_state::sound_map); - m_audiocpu->set_irq_acknowledge_callback(FUNC(munchmo_state::generic_irq_ack)); // IORQ clears flip-flop at 1-7H + m_audiocpu->set_irq_acknowledge_callback(FUNC(munchmo_state::irq_ack)); // IORQ clears flip-flop at 1-7H LS259(config, m_mainlatch, 0); // 12E m_mainlatch->q_out_cb<0>().set(FUNC(munchmo_state::palette_bank_0_w)); // BCL0 2-11E @@ -578,7 +562,7 @@ void munchmo_state::mnchmobl(machine_config &config) screen.set_refresh_hz(57); screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500)); // not accurate screen.set_size(256+32+32, 256); - screen.set_visarea(0, 255+32+32,0, 255-16); + screen.set_visarea(0, 255+32+32, 0, 255-16); screen.set_screen_update(FUNC(munchmo_state::screen_update)); screen.screen_vblank().set(FUNC(munchmo_state::vblank_irq)); screen.set_palette(m_palette); @@ -620,9 +604,11 @@ ROM_START( joyfulr ) ROM_LOAD( "s1.10a", 0x0000, 0x1000, CRC(c0bcc301) SHA1(b8961e7bbced4dfe9c72f839ea9b89d3f2e629b2) ) ROM_LOAD( "s2.10b", 0x1000, 0x1000, CRC(96aa11ca) SHA1(84438d6b27d520e95b8706c91c5c20de1785604c) ) - ROM_REGION( 0x2000, "tiles", 0 ) // 4x8 + ROM_REGION( 0x1000, "tilelut", 0 ) ROM_LOAD( "b1.2c", 0x0000, 0x1000, CRC(8ce3a403) SHA1(eec5813076c31bb8534f7d1f83f2a397e552ed69) ) - ROM_LOAD( "b2.2b", 0x1000, 0x1000, CRC(0df28913) SHA1(485700d3b7f2bfcb970e8f9edb7d18ed9a708bd2) ) + + ROM_REGION( 0x1000, "tiles", 0 ) // 4x8 + ROM_LOAD16_WORD_SWAP( "b2.2b", 0x0000, 0x1000, CRC(0df28913) SHA1(485700d3b7f2bfcb970e8f9edb7d18ed9a708bd2) ) ROM_REGION( 0x6000, "sprites", 0 ) ROM_LOAD( "f1j.1g", 0x0000, 0x2000, CRC(93c3c17e) SHA1(902f458c4efe74187a58a3c1ecd146e343657977) ) @@ -648,9 +634,11 @@ ROM_START( mnchmobl ) ROM_LOAD( "s1.10a", 0x0000, 0x1000, CRC(c0bcc301) SHA1(b8961e7bbced4dfe9c72f839ea9b89d3f2e629b2) ) ROM_LOAD( "s2.10b", 0x1000, 0x1000, CRC(96aa11ca) SHA1(84438d6b27d520e95b8706c91c5c20de1785604c) ) - ROM_REGION( 0x2000, "tiles", 0 ) // 4x8 + ROM_REGION( 0x1000, "tilelut", 0 ) ROM_LOAD( "b1.2c", 0x0000, 0x1000, CRC(8ce3a403) SHA1(eec5813076c31bb8534f7d1f83f2a397e552ed69) ) - ROM_LOAD( "b2.2b", 0x1000, 0x1000, CRC(0df28913) SHA1(485700d3b7f2bfcb970e8f9edb7d18ed9a708bd2) ) + + ROM_REGION( 0x1000, "tiles", 0 ) // 4x8 + ROM_LOAD16_WORD_SWAP( "b2.2b", 0x0000, 0x1000, CRC(0df28913) SHA1(485700d3b7f2bfcb970e8f9edb7d18ed9a708bd2) ) ROM_REGION( 0x6000, "sprites", 0 ) ROM_LOAD( "f1.1g", 0x0000, 0x2000, CRC(b75411d4) SHA1(d058a6c219676f8ba4e498215f5716c630bb1d20) ) diff --git a/src/mame/snk/snk.cpp b/src/mame/snk/snk.cpp index 44afe9481f059..b9ed04fb0dc73 100644 --- a/src/mame/snk/snk.cpp +++ b/src/mame/snk/snk.cpp @@ -689,35 +689,74 @@ Driver notes: #include "sound/ymopl.h" #include "speaker.h" - void snk_state::machine_start() { + save_item(NAME(m_sound_status)); +} + +void countryc_state::machine_start() +{ + snk_state::machine_start(); m_countryc_trackball = 0; + + save_item(NAME(m_countryc_trackball)); +} + +void ikari_state::machine_start() +{ + snk_state::machine_start(); + + save_item(NAME(m_hf_posx)); + save_item(NAME(m_hf_posy)); +} + +void bermudat_state::machine_start() +{ + snk_state::machine_start(); + + save_item(NAME(m_tc16_posx)); + save_item(NAME(m_tc16_posy)); + save_item(NAME(m_tc32_posx)); + save_item(NAME(m_tc32_posy)); +} + +void gwar_state::machine_start() +{ + bermudat_state::machine_start(); + + save_item(NAME(m_last_value)); + save_item(NAME(m_cp_count)); +} + +void snk_state::machine_reset() +{ + m_sound_status = 0; + m_audiocpu->set_input_line(INPUT_LINE_NMI, CLEAR_LINE); } /*********************************************************************/ // Interrupt handlers common to all SNK triple Z80 games -uint8_t snk_state::snk_cpuA_nmi_trigger_r() +uint8_t snk_state::cpuA_nmi_trigger_r() { if (!machine().side_effects_disabled()) m_maincpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE); return 0xff; } -void snk_state::snk_cpuA_nmi_ack_w(uint8_t data) +void snk_state::cpuA_nmi_ack_w(uint8_t data) { m_maincpu->set_input_line(INPUT_LINE_NMI, CLEAR_LINE); } -uint8_t snk_state::snk_cpuB_nmi_trigger_r() +uint8_t snk_state::cpuB_nmi_trigger_r() { if (!machine().side_effects_disabled()) m_subcpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE); return 0xff; } -void snk_state::snk_cpuB_nmi_ack_w(uint8_t data) +void snk_state::cpuB_nmi_ack_w(uint8_t data) { m_subcpu->set_input_line(INPUT_LINE_NMI, CLEAR_LINE); } @@ -737,7 +776,7 @@ enum /*********************************************************************/ -uint8_t snk_state::marvins_sound_nmi_ack_r() +uint8_t marvins_state::marvins_sound_nmi_ack_r() { if (!machine().side_effects_disabled()) m_audiocpu->set_input_line(INPUT_LINE_NMI, CLEAR_LINE); @@ -748,7 +787,7 @@ uint8_t snk_state::marvins_sound_nmi_ack_r() TIMER_CALLBACK_MEMBER(snk_state::sgladiat_sndirq_update_callback) { - switch(param) + switch (param) { case CMDIRQ_BUSY_ASSERT: m_sound_status |= 8|4; @@ -763,7 +802,7 @@ TIMER_CALLBACK_MEMBER(snk_state::sgladiat_sndirq_update_callback) break; } - m_audiocpu->set_input_line(INPUT_LINE_NMI, (m_sound_status & 0x8) ? ASSERT_LINE : CLEAR_LINE); + m_audiocpu->set_input_line(INPUT_LINE_NMI, BIT(m_sound_status, 3) ? ASSERT_LINE : CLEAR_LINE); } @@ -820,7 +859,7 @@ uint8_t snk_state::sgladiat_sound_irq_ack_r() TIMER_CALLBACK_MEMBER(snk_state::sndirq_update_callback) { - switch(param) + switch (param) { case YM1IRQ_ASSERT: m_sound_status |= 1; @@ -868,7 +907,7 @@ void snk_state::ymirq_callback_2(int state) } -void snk_state::snk_soundlatch_w(uint8_t data) +void snk_state::soundlatch_w(uint8_t data) { m_soundlatch->write(data); machine().scheduler().synchronize(timer_expired_delegate(FUNC(snk_state::sndirq_update_callback),this), CMDIRQ_BUSY_ASSERT); @@ -876,27 +915,27 @@ void snk_state::snk_soundlatch_w(uint8_t data) int snk_state::sound_busy_r() { - return (m_sound_status & 4) ? 1 : 0; + return BIT(m_sound_status, 2); } -uint8_t snk_state::snk_sound_status_r() +uint8_t snk_state::sound_status_r() { return m_sound_status; } -void snk_state::snk_sound_status_w(uint8_t data) +void snk_state::sound_status_w(uint8_t data) { - if (~data & 0x10) // ack YM1 irq + if (BIT(~data, 4)) // ack YM1 irq machine().scheduler().synchronize(timer_expired_delegate(FUNC(snk_state::sndirq_update_callback),this), YM1IRQ_CLEAR); - if (~data & 0x20) // ack YM2 irq + if (BIT(~data, 5)) // ack YM2 irq machine().scheduler().synchronize(timer_expired_delegate(FUNC(snk_state::sndirq_update_callback),this), YM2IRQ_CLEAR); - if (~data & 0x40) // clear busy flag + if (BIT(~data, 6)) // clear busy flag machine().scheduler().synchronize(timer_expired_delegate(FUNC(snk_state::sndirq_update_callback),this), BUSY_CLEAR); - if (~data & 0x80) // ack command from main cpu + if (BIT(~data, 7)) // ack command from main cpu machine().scheduler().synchronize(timer_expired_delegate(FUNC(snk_state::sndirq_update_callback),this), CMDIRQ_CLEAR); } @@ -942,17 +981,17 @@ A trojan could be used on the board to verify the exact behaviour. *****************************************************************************/ -void snk_state::hardflags_scrollx_w(uint8_t data) +void ikari_state::hardflags_scrollx_w(uint8_t data) { m_hf_posx = (m_hf_posx & ~0xff) | data; } -void snk_state::hardflags_scrolly_w(uint8_t data) +void ikari_state::hardflags_scrolly_w(uint8_t data) { m_hf_posy = (m_hf_posy & ~0xff) | data; } -void snk_state::hardflags_scroll_msb_w(uint8_t data) +void ikari_state::hardflags_scroll_msb_w(uint8_t data) { m_hf_posx = (m_hf_posx & 0xff) | ((data & 0x80) << 1); m_hf_posy = (m_hf_posy & 0xff) | ((data & 0x40) << 2); @@ -960,14 +999,14 @@ void snk_state::hardflags_scroll_msb_w(uint8_t data) // low 6 bits might indicate radius, but it's not clear } -int snk_state::hardflags_check(int num) +int ikari_state::hardflags_check(int num) { - const uint8_t *sr = &m_spriteram[0x800 + 4*num]; - int x = sr[2] + ((sr[3] & 0x80) << 1); - int y = sr[0] + ((sr[3] & 0x10) << 4); + uint8_t const *const sr = &m_spriteram[0x800 + 4 * num]; + const int x = sr[2] + ((sr[3] & 0x80) << 1); + const int y = sr[0] + ((sr[3] & 0x10) << 4); - int dx = (x - m_hf_posx) & 0x1ff; - int dy = (y - m_hf_posy) & 0x1ff; + const int dx = (x - m_hf_posx) & 0x1ff; + const int dy = (y - m_hf_posy) & 0x1ff; if (dx > 0x20 && dx <= 0x1e0 && dy > 0x20 && dy <= 0x1e0) return 0; @@ -975,26 +1014,21 @@ int snk_state::hardflags_check(int num) return 1; } -int snk_state::hardflags_check8(int num) +template +uint8_t ikari_state::hardflags_check8() { return - (hardflags_check(num + 0) << 0) | - (hardflags_check(num + 1) << 1) | - (hardflags_check(num + 2) << 2) | - (hardflags_check(num + 3) << 3) | - (hardflags_check(num + 4) << 4) | - (hardflags_check(num + 5) << 5) | - (hardflags_check(num + 6) << 6) | - (hardflags_check(num + 7) << 7); + (hardflags_check((Num * 8) + 0) << 0) | + (hardflags_check((Num * 8) + 1) << 1) | + (hardflags_check((Num * 8) + 2) << 2) | + (hardflags_check((Num * 8) + 3) << 3) | + (hardflags_check((Num * 8) + 4) << 4) | + (hardflags_check((Num * 8) + 5) << 5) | + (hardflags_check((Num * 8) + 6) << 6) | + (hardflags_check((Num * 8) + 7) << 7); } -uint8_t snk_state::hardflags1_r() { return hardflags_check8(0*8); } -uint8_t snk_state::hardflags2_r() { return hardflags_check8(1*8); } -uint8_t snk_state::hardflags3_r() { return hardflags_check8(2*8); } -uint8_t snk_state::hardflags4_r() { return hardflags_check8(3*8); } -uint8_t snk_state::hardflags5_r() { return hardflags_check8(4*8); } -uint8_t snk_state::hardflags6_r() { return hardflags_check8(5*8); } -uint8_t snk_state::hardflags7_r() +uint8_t ikari_state::hardflags7_r() { // apparently the startup tests use bits 0&1 while the game uses bits 4&5 return @@ -1021,27 +1055,27 @@ A trojan could be used on the board to verify the exact behaviour. *****************************************************************************/ -void snk_state::turbocheck16_1_w(uint8_t data) +void bermudat_state::turbocheck16_1_w(uint8_t data) { m_tc16_posy = (m_tc16_posy & ~0xff) | data; } -void snk_state::turbocheck16_2_w(uint8_t data) +void bermudat_state::turbocheck16_2_w(uint8_t data) { m_tc16_posx = (m_tc16_posx & ~0xff) | data; } -void snk_state::turbocheck32_1_w(uint8_t data) +void bermudat_state::turbocheck32_1_w(uint8_t data) { m_tc32_posy = (m_tc32_posy & ~0xff) | data; } -void snk_state::turbocheck32_2_w(uint8_t data) +void bermudat_state::turbocheck32_2_w(uint8_t data) { m_tc32_posx = (m_tc32_posx & ~0xff) | data; } -void snk_state::turbocheck_msb_w(uint8_t data) +void bermudat_state::turbocheck_msb_w(uint8_t data) { m_tc16_posx = (m_tc16_posx & 0xff) | ((data & 0x80) << 1); m_tc16_posy = (m_tc16_posy & 0xff) | ((data & 0x40) << 2); @@ -1051,14 +1085,14 @@ void snk_state::turbocheck_msb_w(uint8_t data) // low 6 bits might indicate radius, but it's not clear } -int snk_state::turbofront_check(int small, int num) +int bermudat_state::turbofront_check(bool small, int num) { - const uint8_t *sr = &m_spriteram[0x800*small + 4*num]; - int x = sr[2] + ((sr[3] & 0x80) << 1); - int y = sr[0] + ((sr[3] & 0x10) << 4); + uint8_t const *const sr = &m_spriteram[(small ? 0x800 : 0) + 4 * num]; + const int x = sr[2] + ((sr[3] & 0x80) << 1); + const int y = sr[0] + ((sr[3] & 0x10) << 4); - int dx = (x - (small ? m_tc16_posx : m_tc32_posx)) & 0x1ff; - int dy = (y - (small ? m_tc16_posy : m_tc32_posy)) & 0x1ff; + const int dx = (x - (small ? m_tc16_posx : m_tc32_posx)) & 0x1ff; + const int dy = (y - (small ? m_tc16_posy : m_tc32_posy)) & 0x1ff; if (dx > 0x20 && dx <= 0x1e0 && dy > 0x20 && dy <= 0x1e0) return 0; @@ -1066,32 +1100,20 @@ int snk_state::turbofront_check(int small, int num) return 1; } -int snk_state::turbofront_check8(int small, int num) +template +uint8_t bermudat_state::turbofront_check8() { return - (turbofront_check(small, num + 0) << 0) | - (turbofront_check(small, num + 1) << 1) | - (turbofront_check(small, num + 2) << 2) | - (turbofront_check(small, num + 3) << 3) | - (turbofront_check(small, num + 4) << 4) | - (turbofront_check(small, num + 5) << 5) | - (turbofront_check(small, num + 6) << 6) | - (turbofront_check(small, num + 7) << 7); + (turbofront_check(Small, (Num * 8) + 0) << 0) | + (turbofront_check(Small, (Num * 8) + 1) << 1) | + (turbofront_check(Small, (Num * 8) + 2) << 2) | + (turbofront_check(Small, (Num * 8) + 3) << 3) | + (turbofront_check(Small, (Num * 8) + 4) << 4) | + (turbofront_check(Small, (Num * 8) + 5) << 5) | + (turbofront_check(Small, (Num * 8) + 6) << 6) | + (turbofront_check(Small, (Num * 8) + 7) << 7); } -uint8_t snk_state::turbocheck16_1_r() { return turbofront_check8(1, 0*8); } -uint8_t snk_state::turbocheck16_2_r() { return turbofront_check8(1, 1*8); } -uint8_t snk_state::turbocheck16_3_r() { return turbofront_check8(1, 2*8); } -uint8_t snk_state::turbocheck16_4_r() { return turbofront_check8(1, 3*8); } -uint8_t snk_state::turbocheck16_5_r() { return turbofront_check8(1, 4*8); } -uint8_t snk_state::turbocheck16_6_r() { return turbofront_check8(1, 5*8); } -uint8_t snk_state::turbocheck16_7_r() { return turbofront_check8(1, 6*8); } -uint8_t snk_state::turbocheck16_8_r() { return turbofront_check8(1, 7*8); } -uint8_t snk_state::turbocheck32_1_r() { return turbofront_check8(0, 0*8); } -uint8_t snk_state::turbocheck32_2_r() { return turbofront_check8(0, 1*8); } -uint8_t snk_state::turbocheck32_3_r() { return turbofront_check8(0, 2*8); } -uint8_t snk_state::turbocheck32_4_r() { return turbofront_check8(0, 3*8); } - /***************************************************************************** @@ -1111,7 +1133,7 @@ hand, always returning 0xf inbetween valid values confuses the game. *****************************************************************************/ template -ioport_value snk_state::gwar_rotary() +ioport_value gwar_state::gwar_rotary() { int value = m_rot_io[Which]->read(); @@ -1119,15 +1141,17 @@ ioport_value snk_state::gwar_rotary() { if (!m_cp_count[Which]) value = 0xf; - m_cp_count[Which] = (m_cp_count[Which] + 1) & 0x07; + if (!machine().side_effects_disabled()) + m_cp_count[Which] = (m_cp_count[Which] + 1) & 0x07; } - m_last_value[Which] = value; + if (!machine().side_effects_disabled()) + m_last_value[Which] = value; return value; } template -ioport_value snk_state::gwarb_rotary() +ioport_value gwarb_state::gwarb_rotary() { if (m_joymode_io->read() == 1) { @@ -1144,19 +1168,19 @@ ioport_value snk_state::gwarb_rotary() void snk_state::athena_coin_counter_w(uint8_t data) { - machine().bookkeeping().coin_counter_w(0, ~data & 2); - machine().bookkeeping().coin_counter_w(1, ~data & 1); + machine().bookkeeping().coin_counter_w(0, BIT(~data, 1)); + machine().bookkeeping().coin_counter_w(1, BIT(~data, 0)); } void snk_state::ikari_coin_counter_w(uint8_t data) { - if (~data & 0x80) + if (BIT(~data, 7)) { machine().bookkeeping().coin_counter_w(0, 1); machine().bookkeeping().coin_counter_w(0, 0); } - if (~data & 0x40) + if (BIT(~data, 6)) { machine().bookkeeping().coin_counter_w(1, 1); machine().bookkeeping().coin_counter_w(1, 0); @@ -1165,21 +1189,21 @@ void snk_state::ikari_coin_counter_w(uint8_t data) void snk_state::tdfever_coin_counter_w(uint8_t data) { - machine().bookkeeping().coin_counter_w(0, data & 1); - machine().bookkeeping().coin_counter_w(1, data & 2); + machine().bookkeeping().coin_counter_w(0, BIT(data, 0)); + machine().bookkeeping().coin_counter_w(1, BIT(data, 1)); } -void snk_state::countryc_trackball_w(uint8_t data) +void countryc_state::countryc_trackball_w(uint8_t data) { m_countryc_trackball = data & 1; } -ioport_value snk_state::countryc_trackball_x() +ioport_value countryc_state::countryc_trackball_x() { return m_trackball_x_io[m_countryc_trackball]->read(); } -ioport_value snk_state::countryc_trackball_y() +ioport_value countryc_state::countryc_trackball_y() { return m_trackball_y_io[m_countryc_trackball]->read(); } @@ -1203,64 +1227,57 @@ ioport_value snk_state::snk_bonus_r() return ((m_bonus_io->read() & Mask) >> 4); default: - logerror("snk_bonus_r : invalid %02X bit_mask\n",Mask); + if (!machine().side_effects_disabled()) + logerror("snk_bonus_r : invalid %02X bit_mask\n",Mask); return 0; } } /************************************************************************/ -void snk_state::marvins_cpuA_map(address_map &map) +void marvins_state::marvins_common_map(address_map &map) { + map(0xc000, 0xcfff).ram().share(m_spriteram); // + work RAM + map(0xd000, 0xd7ff).ram().w(FUNC(marvins_state::marvins_fg_videoram_w)).share(m_fg_videoram); + map(0xd800, 0xdfff).ram().share("sharedram"); + map(0xe000, 0xe7ff).ram().w(FUNC(marvins_state::marvins_bg_videoram_w)).share(m_bg_videoram); + map(0xe800, 0xefff).ram().share("sharedram2"); + map(0xf000, 0xf7ff).ram().w(FUNC(marvins_state::tx_videoram_w)).share(m_tx_videoram); // + work RAM + map(0xf800, 0xf800).w(FUNC(marvins_state::sp16_scrolly_w)); + map(0xf900, 0xf900).w(FUNC(marvins_state::sp16_scrollx_w)); + map(0xfa00, 0xfa00).w(FUNC(marvins_state::fg_scrolly_w)); + map(0xfb00, 0xfb00).w(FUNC(marvins_state::fg_scrollx_w)); + map(0xfc00, 0xfc00).w(FUNC(marvins_state::bg_scrolly_w)); + map(0xfd00, 0xfd00).w(FUNC(marvins_state::bg_scrollx_w)); + map(0xfe00, 0xfe00).w(FUNC(marvins_state::sprite_split_point_w)); + map(0xff00, 0xff00).w(FUNC(marvins_state::marvins_scroll_msb_w)); +} + +void marvins_state::marvins_cpuA_map(address_map &map) +{ + marvins_common_map(map); map(0x0000, 0x5fff).rom(); - map(0x6000, 0x6000).w(FUNC(snk_state::marvins_palette_bank_w)); + map(0x6000, 0x6000).w(FUNC(marvins_state::marvins_palette_bank_w)); map(0x8000, 0x8000).portr("IN0"); map(0x8100, 0x8100).portr("IN1"); map(0x8200, 0x8200).portr("IN2"); map(0x8300, 0x8300).w(m_soundlatch, FUNC(generic_latch_8_device::write)); map(0x8400, 0x8400).portr("DSW1"); map(0x8500, 0x8500).portr("DSW2"); - map(0x8600, 0x8600).w(FUNC(snk_state::marvins_flipscreen_w)); - map(0x8700, 0x8700).rw(FUNC(snk_state::snk_cpuB_nmi_trigger_r), FUNC(snk_state::snk_cpuA_nmi_ack_w)); - map(0xc000, 0xcfff).ram().share("spriteram"); // + work ram - map(0xd000, 0xd7ff).ram().w(FUNC(snk_state::marvins_fg_videoram_w)).share("fg_videoram"); - map(0xd800, 0xdfff).ram().share("share3"); - map(0xe000, 0xe7ff).ram().w(FUNC(snk_state::marvins_bg_videoram_w)).share("bg_videoram"); - map(0xe800, 0xefff).ram().share("share5"); - map(0xf000, 0xf7ff).ram().w(FUNC(snk_state::snk_tx_videoram_w)).share("tx_videoram"); // + work RAM - map(0xf800, 0xf800).w(FUNC(snk_state::snk_sp16_scrolly_w)); - map(0xf900, 0xf900).w(FUNC(snk_state::snk_sp16_scrollx_w)); - map(0xfa00, 0xfa00).w(FUNC(snk_state::snk_fg_scrolly_w)); - map(0xfb00, 0xfb00).w(FUNC(snk_state::snk_fg_scrollx_w)); - map(0xfc00, 0xfc00).w(FUNC(snk_state::snk_bg_scrolly_w)); - map(0xfd00, 0xfd00).w(FUNC(snk_state::snk_bg_scrollx_w)); - map(0xfe00, 0xfe00).w(FUNC(snk_state::snk_sprite_split_point_w)); - map(0xff00, 0xff00).w(FUNC(snk_state::marvins_scroll_msb_w)); + map(0x8600, 0x8600).w(FUNC(marvins_state::marvins_flipscreen_w)); + map(0x8700, 0x8700).rw(FUNC(marvins_state::cpuB_nmi_trigger_r), FUNC(marvins_state::cpuA_nmi_ack_w)); } -void snk_state::marvins_cpuB_map(address_map &map) +void marvins_state::marvins_cpuB_map(address_map &map) { + marvins_common_map(map); map(0x0000, 0x5fff).rom(); - map(0x8700, 0x8700).rw(FUNC(snk_state::snk_cpuA_nmi_trigger_r), FUNC(snk_state::snk_cpuB_nmi_ack_w)); - map(0xc000, 0xcfff).ram().share("spriteram"); - map(0xd000, 0xd7ff).ram().w(FUNC(snk_state::marvins_fg_videoram_w)).share("fg_videoram"); - map(0xd800, 0xdfff).ram().share("share3"); - map(0xe000, 0xe7ff).ram().w(FUNC(snk_state::marvins_bg_videoram_w)).share("bg_videoram"); - map(0xe800, 0xefff).ram().share("share5"); - map(0xf000, 0xf7ff).ram().w(FUNC(snk_state::snk_tx_videoram_w)).share("tx_videoram"); - map(0xf800, 0xf800).w(FUNC(snk_state::snk_sp16_scrolly_w)); - map(0xf900, 0xf900).w(FUNC(snk_state::snk_sp16_scrollx_w)); - map(0xfa00, 0xfa00).w(FUNC(snk_state::snk_fg_scrolly_w)); - map(0xfb00, 0xfb00).w(FUNC(snk_state::snk_fg_scrollx_w)); - map(0xfc00, 0xfc00).w(FUNC(snk_state::snk_bg_scrolly_w)); - map(0xfd00, 0xfd00).w(FUNC(snk_state::snk_bg_scrollx_w)); - map(0xfe00, 0xfe00).w(FUNC(snk_state::snk_sprite_split_point_w)); - map(0xff00, 0xff00).w(FUNC(snk_state::marvins_scroll_msb_w)); + map(0x8700, 0x8700).rw(FUNC(marvins_state::cpuA_nmi_trigger_r), FUNC(marvins_state::cpuB_nmi_ack_w)); } // vangrd2 accesses video registers at xxF1 instead of xx00 -void snk_state::madcrash_cpuA_map(address_map &map) +void marvins_state::madcrash_cpuA_map(address_map &map) { map(0x0000, 0x7fff).rom(); map(0x8000, 0x8000).portr("IN0"); @@ -1269,47 +1286,47 @@ void snk_state::madcrash_cpuA_map(address_map &map) map(0x8300, 0x8300).w(m_soundlatch, FUNC(generic_latch_8_device::write)); map(0x8400, 0x8400).portr("DSW1"); map(0x8500, 0x8500).portr("DSW2"); - map(0x8600, 0x8600).mirror(0xff).w(FUNC(snk_state::marvins_flipscreen_w)); - map(0x8700, 0x8700).rw(FUNC(snk_state::snk_cpuB_nmi_trigger_r), FUNC(snk_state::snk_cpuA_nmi_ack_w)); - map(0xc000, 0xc7ff).ram().share("spriteram"); // + work ram - map(0xc800, 0xc800).mirror(0xff).w(FUNC(snk_state::marvins_palette_bank_w)); - map(0xd000, 0xd7ff).ram().w(FUNC(snk_state::marvins_bg_videoram_w)).share("bg_videoram"); - map(0xd800, 0xdfff).ram().share("share3"); - map(0xe000, 0xe7ff).ram().w(FUNC(snk_state::marvins_fg_videoram_w)).share("fg_videoram"); - map(0xe800, 0xefff).ram().share("share5"); - map(0xf000, 0xf7ff).ram().w(FUNC(snk_state::snk_tx_videoram_w)).share("tx_videoram"); // + work RAM - map(0xf800, 0xf800).mirror(0xff).w(FUNC(snk_state::snk_bg_scrolly_w)); - map(0xf900, 0xf900).mirror(0xff).w(FUNC(snk_state::snk_bg_scrollx_w)); - map(0xfa00, 0xfa00).mirror(0xff).w(FUNC(snk_state::snk_sprite_split_point_w)); - map(0xfb00, 0xfb00).mirror(0xff).w(FUNC(snk_state::marvins_scroll_msb_w)); - map(0xfc00, 0xfc00).mirror(0xff).w(FUNC(snk_state::snk_sp16_scrolly_w)); - map(0xfd00, 0xfd00).mirror(0xff).w(FUNC(snk_state::snk_sp16_scrollx_w)); - map(0xfe00, 0xfe00).mirror(0xff).w(FUNC(snk_state::snk_fg_scrolly_w)); - map(0xff00, 0xff00).mirror(0xff).w(FUNC(snk_state::snk_fg_scrollx_w)); + map(0x8600, 0x8600).mirror(0xff).w(FUNC(marvins_state::marvins_flipscreen_w)); + map(0x8700, 0x8700).rw(FUNC(marvins_state::cpuB_nmi_trigger_r), FUNC(marvins_state::cpuA_nmi_ack_w)); + map(0xc000, 0xc7ff).ram().share(m_spriteram); // + work RAM + map(0xc800, 0xc800).mirror(0xff).w(FUNC(marvins_state::marvins_palette_bank_w)); + map(0xd000, 0xd7ff).ram().w(FUNC(marvins_state::marvins_bg_videoram_w)).share(m_bg_videoram); + map(0xd800, 0xdfff).ram().share("sharedram"); + map(0xe000, 0xe7ff).ram().w(FUNC(marvins_state::marvins_fg_videoram_w)).share(m_fg_videoram); + map(0xe800, 0xefff).ram().share("sharedram2"); + map(0xf000, 0xf7ff).ram().w(FUNC(marvins_state::tx_videoram_w)).share(m_tx_videoram); // + work RAM + map(0xf800, 0xf800).mirror(0xff).w(FUNC(marvins_state::bg_scrolly_w)); + map(0xf900, 0xf900).mirror(0xff).w(FUNC(marvins_state::bg_scrollx_w)); + map(0xfa00, 0xfa00).mirror(0xff).w(FUNC(marvins_state::sprite_split_point_w)); + map(0xfb00, 0xfb00).mirror(0xff).w(FUNC(marvins_state::marvins_scroll_msb_w)); + map(0xfc00, 0xfc00).mirror(0xff).w(FUNC(marvins_state::sp16_scrolly_w)); + map(0xfd00, 0xfd00).mirror(0xff).w(FUNC(marvins_state::sp16_scrollx_w)); + map(0xfe00, 0xfe00).mirror(0xff).w(FUNC(marvins_state::fg_scrolly_w)); + map(0xff00, 0xff00).mirror(0xff).w(FUNC(marvins_state::fg_scrollx_w)); } -void snk_state::madcrash_cpuB_map(address_map &map) +void marvins_state::madcrash_cpuB_map(address_map &map) { map(0x0000, 0x9fff).rom(); - map(0x8700, 0x8700).w(FUNC(snk_state::snk_cpuB_nmi_ack_w)); // vangrd2 - map(0xa000, 0xa000).w(FUNC(snk_state::snk_cpuB_nmi_ack_w)); // madcrash - map(0xc000, 0xc7ff).ram().w(FUNC(snk_state::marvins_fg_videoram_w)).share("fg_videoram"); - map(0xc800, 0xcfff).ram().share("share5"); - map(0xd000, 0xd7ff).ram().w(FUNC(snk_state::snk_tx_videoram_w)).share("tx_videoram"); - map(0xd800, 0xd800).w(FUNC(snk_state::snk_bg_scrolly_w)); - map(0xd900, 0xd900).w(FUNC(snk_state::snk_bg_scrollx_w)); - map(0xda00, 0xda00).w(FUNC(snk_state::snk_sprite_split_point_w)); - map(0xdb00, 0xdb00).w(FUNC(snk_state::marvins_scroll_msb_w)); - map(0xdc00, 0xdc00).w(FUNC(snk_state::snk_sp16_scrolly_w)); - map(0xdd00, 0xdd00).w(FUNC(snk_state::snk_sp16_scrollx_w)); - map(0xde00, 0xde00).w(FUNC(snk_state::snk_fg_scrolly_w)); - map(0xdf00, 0xdf00).w(FUNC(snk_state::snk_fg_scrollx_w)); - map(0xe000, 0xe7ff).ram().share("spriteram"); - map(0xf000, 0xf7ff).ram().w(FUNC(snk_state::marvins_bg_videoram_w)).share("bg_videoram"); - map(0xf800, 0xffff).ram().share("share3"); + map(0x8700, 0x8700).w(FUNC(marvins_state::cpuB_nmi_ack_w)); // vangrd2 + map(0xa000, 0xa000).w(FUNC(marvins_state::cpuB_nmi_ack_w)); // madcrash + map(0xc000, 0xc7ff).ram().w(FUNC(marvins_state::marvins_fg_videoram_w)).share(m_fg_videoram); + map(0xc800, 0xcfff).ram().share("sharedram2"); + map(0xd000, 0xd7ff).ram().w(FUNC(marvins_state::tx_videoram_w)).share(m_tx_videoram); + map(0xd800, 0xd800).w(FUNC(marvins_state::bg_scrolly_w)); + map(0xd900, 0xd900).w(FUNC(marvins_state::bg_scrollx_w)); + map(0xda00, 0xda00).w(FUNC(marvins_state::sprite_split_point_w)); + map(0xdb00, 0xdb00).w(FUNC(marvins_state::marvins_scroll_msb_w)); + map(0xdc00, 0xdc00).w(FUNC(marvins_state::sp16_scrolly_w)); + map(0xdd00, 0xdd00).w(FUNC(marvins_state::sp16_scrollx_w)); + map(0xde00, 0xde00).w(FUNC(marvins_state::fg_scrolly_w)); + map(0xdf00, 0xdf00).w(FUNC(marvins_state::fg_scrollx_w)); + map(0xe000, 0xe7ff).ram().share(m_spriteram); + map(0xf000, 0xf7ff).ram().w(FUNC(marvins_state::marvins_bg_videoram_w)).share(m_bg_videoram); + map(0xf800, 0xffff).ram().share("sharedram"); } -void snk_state::madcrush_cpuA_map(address_map &map) +void marvins_state::madcrush_cpuA_map(address_map &map) { map(0x0000, 0x7fff).rom(); map(0x8000, 0x8000).portr("IN0"); @@ -1318,44 +1335,44 @@ void snk_state::madcrush_cpuA_map(address_map &map) map(0x8300, 0x8300).w(m_soundlatch, FUNC(generic_latch_8_device::write)); map(0x8400, 0x8400).portr("DSW1"); map(0x8500, 0x8500).portr("DSW2"); - map(0x8600, 0x8600).mirror(0xff).w(FUNC(snk_state::marvins_flipscreen_w)); - map(0x8700, 0x8700).rw(FUNC(snk_state::snk_cpuB_nmi_trigger_r), FUNC(snk_state::snk_cpuA_nmi_ack_w)); - map(0xc000, 0xc7ff).ram().share("spriteram"); // + work ram - map(0xd000, 0xd7ff).ram().w(FUNC(snk_state::marvins_fg_videoram_w)).share("fg_videoram"); - map(0xc800, 0xc800).mirror(0xff).w(FUNC(snk_state::marvins_palette_bank_w)); - map(0xd800, 0xdfff).ram().share("share5"); - map(0xe000, 0xe7ff).ram().w(FUNC(snk_state::marvins_bg_videoram_w)).share("bg_videoram"); - map(0xe800, 0xefff).ram().share("share3"); - map(0xf000, 0xf7ff).ram().w(FUNC(snk_state::snk_tx_videoram_w)).share("tx_videoram"); - map(0xf800, 0xf800).w(FUNC(snk_state::snk_sp16_scrolly_w)); - map(0xf900, 0xf900).w(FUNC(snk_state::snk_sp16_scrollx_w)); - map(0xfa00, 0xfa00).w(FUNC(snk_state::snk_fg_scrolly_w)); - map(0xfb00, 0xfb00).w(FUNC(snk_state::snk_fg_scrollx_w)); - map(0xfc00, 0xfc00).w(FUNC(snk_state::snk_bg_scrolly_w)); - map(0xfd00, 0xfd00).w(FUNC(snk_state::snk_bg_scrollx_w)); - map(0xfe00, 0xfe00).w(FUNC(snk_state::snk_sprite_split_point_w)); - map(0xff00, 0xff00).w(FUNC(snk_state::marvins_scroll_msb_w)); + map(0x8600, 0x8600).mirror(0xff).w(FUNC(marvins_state::marvins_flipscreen_w)); + map(0x8700, 0x8700).rw(FUNC(marvins_state::cpuB_nmi_trigger_r), FUNC(marvins_state::cpuA_nmi_ack_w)); + map(0xc000, 0xc7ff).ram().share(m_spriteram); // + work RAM + map(0xc800, 0xc800).mirror(0xff).w(FUNC(marvins_state::marvins_palette_bank_w)); + map(0xd000, 0xd7ff).ram().w(FUNC(marvins_state::marvins_fg_videoram_w)).share(m_fg_videoram); + map(0xd800, 0xdfff).ram().share("sharedram2"); + map(0xe000, 0xe7ff).ram().w(FUNC(marvins_state::marvins_bg_videoram_w)).share(m_bg_videoram); + map(0xe800, 0xefff).ram().share("sharedram"); + map(0xf000, 0xf7ff).ram().w(FUNC(marvins_state::tx_videoram_w)).share(m_tx_videoram); + map(0xf800, 0xf800).w(FUNC(marvins_state::sp16_scrolly_w)); + map(0xf900, 0xf900).w(FUNC(marvins_state::sp16_scrollx_w)); + map(0xfa00, 0xfa00).w(FUNC(marvins_state::fg_scrolly_w)); + map(0xfb00, 0xfb00).w(FUNC(marvins_state::fg_scrollx_w)); + map(0xfc00, 0xfc00).w(FUNC(marvins_state::bg_scrolly_w)); + map(0xfd00, 0xfd00).w(FUNC(marvins_state::bg_scrollx_w)); + map(0xfe00, 0xfe00).w(FUNC(marvins_state::sprite_split_point_w)); + map(0xff00, 0xff00).w(FUNC(marvins_state::marvins_scroll_msb_w)); } -void snk_state::madcrush_cpuB_map(address_map &map) +void marvins_state::madcrush_cpuB_map(address_map &map) { map(0x0000, 0x9fff).rom(); - map(0xa000, 0xa000).w(FUNC(snk_state::snk_cpuB_nmi_ack_w)); - map(0xc000, 0xc7ff).ram().share("spriteram"); // + work ram - map(0xc800, 0xcfff).ram().share("share5"); - map(0xc800, 0xc800).mirror(0xff).w(FUNC(snk_state::marvins_palette_bank_w)); - map(0xd000, 0xd7ff).ram().w(FUNC(snk_state::marvins_fg_videoram_w)).share("fg_videoram"); - map(0xe000, 0xe7ff).ram().w(FUNC(snk_state::marvins_bg_videoram_w)).share("bg_videoram"); // ?? - map(0xe800, 0xefff).ram().share("share3"); - map(0xf000, 0xf7ff).ram().w(FUNC(snk_state::snk_tx_videoram_w)).share("tx_videoram"); - map(0xf800, 0xf800).w(FUNC(snk_state::snk_sp16_scrolly_w)); - map(0xf900, 0xf900).w(FUNC(snk_state::snk_sp16_scrollx_w)); - map(0xfa00, 0xfa00).w(FUNC(snk_state::snk_fg_scrolly_w)); - map(0xfb00, 0xfb00).w(FUNC(snk_state::snk_fg_scrollx_w)); - map(0xfc00, 0xfc00).w(FUNC(snk_state::snk_bg_scrolly_w)); - map(0xfd00, 0xfd00).w(FUNC(snk_state::snk_bg_scrollx_w)); - map(0xfe00, 0xfe00).w(FUNC(snk_state::snk_sprite_split_point_w)); - map(0xff00, 0xff00).w(FUNC(snk_state::marvins_scroll_msb_w)); + map(0xa000, 0xa000).w(FUNC(marvins_state::cpuB_nmi_ack_w)); + map(0xc000, 0xc7ff).ram().share(m_spriteram); // + work RAM + map(0xc800, 0xcfff).ram().share("sharedram2"); + map(0xc800, 0xc800).mirror(0xff).w(FUNC(marvins_state::marvins_palette_bank_w)); + map(0xd000, 0xd7ff).ram().w(FUNC(marvins_state::marvins_fg_videoram_w)).share(m_fg_videoram); + map(0xe000, 0xe7ff).ram().w(FUNC(marvins_state::marvins_bg_videoram_w)).share(m_bg_videoram); // ?? + map(0xe800, 0xefff).ram().share("sharedram"); + map(0xf000, 0xf7ff).ram().w(FUNC(marvins_state::tx_videoram_w)).share(m_tx_videoram); + map(0xf800, 0xf800).w(FUNC(marvins_state::sp16_scrolly_w)); + map(0xf900, 0xf900).w(FUNC(marvins_state::sp16_scrollx_w)); + map(0xfa00, 0xfa00).w(FUNC(marvins_state::fg_scrolly_w)); + map(0xfb00, 0xfb00).w(FUNC(marvins_state::fg_scrollx_w)); + map(0xfc00, 0xfc00).w(FUNC(marvins_state::bg_scrolly_w)); + map(0xfd00, 0xfd00).w(FUNC(marvins_state::bg_scrollx_w)); + map(0xfe00, 0xfe00).w(FUNC(marvins_state::sprite_split_point_w)); + map(0xff00, 0xff00).w(FUNC(marvins_state::marvins_scroll_msb_w)); } @@ -1369,25 +1386,25 @@ void snk_state::jcross_cpuA_map(address_map &map) map(0xa400, 0xa400).portr("DSW1"); map(0xa500, 0xa500).portr("DSW2"); map(0xa600, 0xa600).w(FUNC(snk_state::sgladiat_flipscreen_w)); // flip screen, bg palette bank - map(0xa700, 0xa700).rw(FUNC(snk_state::snk_cpuB_nmi_trigger_r), FUNC(snk_state::snk_cpuA_nmi_ack_w)); + map(0xa700, 0xa700).rw(FUNC(snk_state::cpuB_nmi_trigger_r), FUNC(snk_state::cpuA_nmi_ack_w)); map(0xd300, 0xd300).w(FUNC(snk_state::jcross_scroll_msb_w)); - map(0xd400, 0xd400).w(FUNC(snk_state::snk_sp16_scrolly_w)); - map(0xd500, 0xd500).w(FUNC(snk_state::snk_sp16_scrollx_w)); - map(0xd600, 0xd600).w(FUNC(snk_state::snk_bg_scrolly_w)); - map(0xd700, 0xd700).w(FUNC(snk_state::snk_bg_scrollx_w)); - map(0xd800, 0xdfff).ram().share("spriteram"); // + work ram - map(0xe000, 0xefff).ram().w(FUNC(snk_state::marvins_bg_videoram_w)).share("bg_videoram"); - map(0xf000, 0xf7ff).ram().w(FUNC(snk_state::snk_tx_videoram_w)).share("tx_videoram"); // + work RAM + map(0xd400, 0xd400).w(FUNC(snk_state::sp16_scrolly_w)); + map(0xd500, 0xd500).w(FUNC(snk_state::sp16_scrollx_w)); + map(0xd600, 0xd600).w(FUNC(snk_state::bg_scrolly_w)); + map(0xd700, 0xd700).w(FUNC(snk_state::bg_scrollx_w)); + map(0xd800, 0xdfff).ram().share(m_spriteram); // + work RAM + map(0xe000, 0xefff).ram().w(FUNC(snk_state::marvins_bg_videoram_w)).share(m_bg_videoram); + map(0xf000, 0xf7ff).ram().w(FUNC(snk_state::tx_videoram_w)).share(m_tx_videoram); // + work RAM map(0xffff, 0xffff).nopw(); // simply a program patch to not write to two not existing video registers? } void snk_state::jcross_cpuB_map(address_map &map) { map(0x0000, 0x7fff).rom(); - map(0xa700, 0xa700).rw(FUNC(snk_state::snk_cpuA_nmi_trigger_r), FUNC(snk_state::snk_cpuB_nmi_ack_w)); - map(0xc000, 0xc7ff).ram().share("spriteram"); - map(0xc800, 0xd7ff).ram().w(FUNC(snk_state::marvins_bg_videoram_w)).share("bg_videoram"); - map(0xe000, 0xe7ff).ram().w(FUNC(snk_state::snk_tx_videoram_w)).share("tx_videoram"); + map(0xa700, 0xa700).rw(FUNC(snk_state::cpuA_nmi_trigger_r), FUNC(snk_state::cpuB_nmi_ack_w)); + map(0xc000, 0xc7ff).ram().share(m_spriteram); + map(0xc800, 0xd7ff).ram().w(FUNC(snk_state::marvins_bg_videoram_w)).share(m_bg_videoram); + map(0xe000, 0xe7ff).ram().w(FUNC(snk_state::tx_videoram_w)).share(m_tx_videoram); } @@ -1401,33 +1418,33 @@ void snk_state::sgladiat_cpuA_map(address_map &map) map(0xa400, 0xa400).portr("DSW1"); map(0xa500, 0xa500).portr("DSW2"); map(0xa600, 0xa600).w(FUNC(snk_state::sgladiat_flipscreen_w)); // flip screen, bg palette bank - map(0xa700, 0xa700).rw(FUNC(snk_state::snk_cpuB_nmi_trigger_r), FUNC(snk_state::snk_cpuA_nmi_ack_w)); + map(0xa700, 0xa700).rw(FUNC(snk_state::cpuB_nmi_trigger_r), FUNC(snk_state::cpuA_nmi_ack_w)); map(0xd200, 0xd200).nopw(); // unknown map(0xd300, 0xd300).w(FUNC(snk_state::sgladiat_scroll_msb_w)); - map(0xd400, 0xd400).w(FUNC(snk_state::snk_sp16_scrolly_w)); - map(0xd500, 0xd500).w(FUNC(snk_state::snk_sp16_scrollx_w)); - map(0xd600, 0xd600).w(FUNC(snk_state::snk_bg_scrolly_w)); - map(0xd700, 0xd700).w(FUNC(snk_state::snk_bg_scrollx_w)); - map(0xd800, 0xdfff).ram().share("spriteram"); // + work ram - map(0xe000, 0xe7ff).ram().w(FUNC(snk_state::marvins_bg_videoram_w)).share("bg_videoram"); + map(0xd400, 0xd400).w(FUNC(snk_state::sp16_scrolly_w)); + map(0xd500, 0xd500).w(FUNC(snk_state::sp16_scrollx_w)); + map(0xd600, 0xd600).w(FUNC(snk_state::bg_scrolly_w)); + map(0xd700, 0xd700).w(FUNC(snk_state::bg_scrollx_w)); + map(0xd800, 0xdfff).ram().share(m_spriteram); // + work RAM + map(0xe000, 0xe7ff).ram().w(FUNC(snk_state::marvins_bg_videoram_w)).share(m_bg_videoram); map(0xe800, 0xefff).ram(); - map(0xf000, 0xf7ff).ram().w(FUNC(snk_state::snk_tx_videoram_w)).share("tx_videoram"); // + work RAM + map(0xf000, 0xf7ff).ram().w(FUNC(snk_state::tx_videoram_w)).share(m_tx_videoram); // + work RAM } void snk_state::sgladiat_cpuB_map(address_map &map) { map(0x0000, 0x7fff).rom(); - map(0xa000, 0xa000).rw(FUNC(snk_state::snk_cpuA_nmi_trigger_r), FUNC(snk_state::snk_cpuB_nmi_ack_w)); + map(0xa000, 0xa000).rw(FUNC(snk_state::cpuA_nmi_trigger_r), FUNC(snk_state::cpuB_nmi_ack_w)); map(0xa600, 0xa600).w(FUNC(snk_state::sgladiat_flipscreen_w)); // flip screen, bg palette bank - map(0xc000, 0xc7ff).ram().share("spriteram"); - map(0xc800, 0xcfff).ram().w(FUNC(snk_state::marvins_bg_videoram_w)).share("bg_videoram"); + map(0xc000, 0xc7ff).ram().share(m_spriteram); + map(0xc800, 0xcfff).ram().w(FUNC(snk_state::marvins_bg_videoram_w)).share(m_bg_videoram); map(0xda00, 0xda00).nopw(); // unknown map(0xdb00, 0xdb00).w(FUNC(snk_state::sgladiat_scroll_msb_w)); - map(0xdc00, 0xdc00).w(FUNC(snk_state::snk_sp16_scrolly_w)); - map(0xdd00, 0xdd00).w(FUNC(snk_state::snk_sp16_scrollx_w)); - map(0xde00, 0xde00).w(FUNC(snk_state::snk_bg_scrolly_w)); - map(0xdf00, 0xdf00).w(FUNC(snk_state::snk_bg_scrollx_w)); - map(0xe000, 0xe7ff).ram().w(FUNC(snk_state::snk_tx_videoram_w)).share("tx_videoram"); + map(0xdc00, 0xdc00).w(FUNC(snk_state::sp16_scrolly_w)); + map(0xdd00, 0xdd00).w(FUNC(snk_state::sp16_scrollx_w)); + map(0xde00, 0xde00).w(FUNC(snk_state::bg_scrolly_w)); + map(0xdf00, 0xdf00).w(FUNC(snk_state::bg_scrollx_w)); + map(0xe000, 0xe7ff).ram().w(FUNC(snk_state::tx_videoram_w)).share(m_tx_videoram); } @@ -1441,24 +1458,24 @@ void snk_state::hal21_cpuA_map(address_map &map) map(0xc400, 0xc400).portr("DSW1"); map(0xc500, 0xc500).portr("DSW2"); map(0xc600, 0xc600).w(FUNC(snk_state::hal21_flipscreen_w)); // flip screen, bg tile and palette bank - map(0xc700, 0xc700).rw(FUNC(snk_state::snk_cpuB_nmi_trigger_r), FUNC(snk_state::snk_cpuA_nmi_ack_w)); + map(0xc700, 0xc700).rw(FUNC(snk_state::cpuB_nmi_trigger_r), FUNC(snk_state::cpuA_nmi_ack_w)); map(0xd300, 0xd300).w(FUNC(snk_state::jcross_scroll_msb_w)); - map(0xd400, 0xd400).w(FUNC(snk_state::snk_sp16_scrolly_w)); - map(0xd500, 0xd500).w(FUNC(snk_state::snk_sp16_scrollx_w)); - map(0xd600, 0xd600).w(FUNC(snk_state::snk_bg_scrolly_w)); - map(0xd700, 0xd700).w(FUNC(snk_state::snk_bg_scrollx_w)); - map(0xe000, 0xe7ff).ram().share("spriteram"); // + work ram - map(0xe800, 0xf7ff).ram().w(FUNC(snk_state::marvins_bg_videoram_w)).share("bg_videoram"); - map(0xf800, 0xffff).ram().w(FUNC(snk_state::snk_tx_videoram_w)).share("tx_videoram"); // + work RAM + map(0xd400, 0xd400).w(FUNC(snk_state::sp16_scrolly_w)); + map(0xd500, 0xd500).w(FUNC(snk_state::sp16_scrollx_w)); + map(0xd600, 0xd600).w(FUNC(snk_state::bg_scrolly_w)); + map(0xd700, 0xd700).w(FUNC(snk_state::bg_scrollx_w)); + map(0xe000, 0xe7ff).ram().share(m_spriteram); // + work RAM + map(0xe800, 0xf7ff).ram().w(FUNC(snk_state::marvins_bg_videoram_w)).share(m_bg_videoram); + map(0xf800, 0xffff).ram().w(FUNC(snk_state::tx_videoram_w)).share(m_tx_videoram); // + work RAM } void snk_state::hal21_cpuB_map(address_map &map) { map(0x0000, 0x9fff).rom(); - map(0xa000, 0xa000).w(FUNC(snk_state::snk_cpuB_nmi_ack_w)); - map(0xc000, 0xc7ff).ram().share("spriteram"); - map(0xd000, 0xdfff).ram().w(FUNC(snk_state::marvins_bg_videoram_w)).share("bg_videoram"); - map(0xe800, 0xefff).ram().w(FUNC(snk_state::snk_tx_videoram_w)).share("tx_videoram"); + map(0xa000, 0xa000).w(FUNC(snk_state::cpuB_nmi_ack_w)); + map(0xc000, 0xc7ff).ram().share(m_spriteram); + map(0xd000, 0xdfff).ram().w(FUNC(snk_state::marvins_bg_videoram_w)).share(m_bg_videoram); + map(0xe800, 0xefff).ram().w(FUNC(snk_state::tx_videoram_w)).share(m_tx_videoram); } @@ -1468,31 +1485,31 @@ void snk_state::aso_cpuA_map(address_map &map) map(0xc000, 0xc000).portr("IN0"); map(0xc100, 0xc100).portr("IN1"); map(0xc200, 0xc200).portr("IN2"); - map(0xc400, 0xc400).w(FUNC(snk_state::snk_soundlatch_w)); + map(0xc400, 0xc400).w(FUNC(snk_state::soundlatch_w)); map(0xc500, 0xc500).portr("DSW1"); map(0xc600, 0xc600).portr("DSW2"); - map(0xc700, 0xc700).rw(FUNC(snk_state::snk_cpuB_nmi_trigger_r), FUNC(snk_state::snk_cpuA_nmi_ack_w)); + map(0xc700, 0xc700).rw(FUNC(snk_state::cpuB_nmi_trigger_r), FUNC(snk_state::cpuA_nmi_ack_w)); map(0xc800, 0xc800).w(FUNC(snk_state::aso_videoattrs_w)); // flip screen, scroll msb - map(0xc900, 0xc900).w(FUNC(snk_state::snk_sp16_scrolly_w)); - map(0xca00, 0xca00).w(FUNC(snk_state::snk_sp16_scrollx_w)); - map(0xcb00, 0xcb00).w(FUNC(snk_state::snk_bg_scrolly_w)); - map(0xcc00, 0xcc00).w(FUNC(snk_state::snk_bg_scrollx_w)); + map(0xc900, 0xc900).w(FUNC(snk_state::sp16_scrolly_w)); + map(0xca00, 0xca00).w(FUNC(snk_state::sp16_scrollx_w)); + map(0xcb00, 0xcb00).w(FUNC(snk_state::bg_scrolly_w)); + map(0xcc00, 0xcc00).w(FUNC(snk_state::bg_scrollx_w)); map(0xce00, 0xce00).nopw(); // always 05? map(0xcf00, 0xcf00).w(FUNC(snk_state::aso_bg_bank_w)); // tile and palette bank - map(0xd800, 0xdfff).ram().share("share1"); - map(0xe000, 0xe7ff).ram().share("spriteram"); // + work ram - map(0xe800, 0xf7ff).ram().w(FUNC(snk_state::marvins_bg_videoram_w)).share("bg_videoram"); - map(0xf800, 0xffff).ram().w(FUNC(snk_state::snk_tx_videoram_w)).share("tx_videoram"); // + work RAM + map(0xd800, 0xdfff).ram().share("sharedram"); + map(0xe000, 0xe7ff).ram().share(m_spriteram); // + work RAM + map(0xe800, 0xf7ff).ram().w(FUNC(snk_state::marvins_bg_videoram_w)).share(m_bg_videoram); + map(0xf800, 0xffff).ram().w(FUNC(snk_state::tx_videoram_w)).share(m_tx_videoram); // + work RAM } void snk_state::aso_cpuB_map(address_map &map) { map(0x0000, 0xbfff).rom(); - map(0xc000, 0xc000).rw(FUNC(snk_state::snk_cpuA_nmi_trigger_r), FUNC(snk_state::snk_cpuB_nmi_ack_w)); - map(0xc800, 0xcfff).ram().share("share1"); - map(0xd000, 0xd7ff).ram().share("spriteram"); - map(0xd800, 0xe7ff).ram().w(FUNC(snk_state::marvins_bg_videoram_w)).share("bg_videoram"); - map(0xf800, 0xffff).ram().w(FUNC(snk_state::snk_tx_videoram_w)).share("tx_videoram"); + map(0xc000, 0xc000).rw(FUNC(snk_state::cpuA_nmi_trigger_r), FUNC(snk_state::cpuB_nmi_ack_w)); + map(0xc800, 0xcfff).ram().share("sharedram"); + map(0xd000, 0xd7ff).ram().share(m_spriteram); + map(0xd800, 0xe7ff).ram().w(FUNC(snk_state::marvins_bg_videoram_w)).share(m_bg_videoram); + map(0xf800, 0xffff).ram().w(FUNC(snk_state::tx_videoram_w)).share(m_tx_videoram); } @@ -1505,243 +1522,240 @@ void snk_state::tnk3_cpuA_map(address_map &map) // c300 is an input in tnk3, output in athena/fitegolf (coin counter) // and in countryc (trackball select) (see DRIVER_INIT). map(0xc300, 0xc300).portr("IN3").w(FUNC(snk_state::athena_coin_counter_w)); - map(0xc400, 0xc400).w(FUNC(snk_state::snk_soundlatch_w)); + map(0xc400, 0xc400).w(FUNC(snk_state::soundlatch_w)); map(0xc500, 0xc500).portr("DSW1"); map(0xc600, 0xc600).portr("DSW2"); - map(0xc700, 0xc700).rw(FUNC(snk_state::snk_cpuB_nmi_trigger_r), FUNC(snk_state::snk_cpuA_nmi_ack_w)); + map(0xc700, 0xc700).rw(FUNC(snk_state::cpuB_nmi_trigger_r), FUNC(snk_state::cpuA_nmi_ack_w)); map(0xc800, 0xc800).w(FUNC(snk_state::tnk3_videoattrs_w)); // flip screen, char bank, scroll msb - map(0xc900, 0xc900).w(FUNC(snk_state::snk_sp16_scrolly_w)); - map(0xca00, 0xca00).w(FUNC(snk_state::snk_sp16_scrollx_w)); - map(0xcb00, 0xcb00).w(FUNC(snk_state::snk_bg_scrolly_w)); - map(0xcc00, 0xcc00).w(FUNC(snk_state::snk_bg_scrollx_w)); + map(0xc900, 0xc900).w(FUNC(snk_state::sp16_scrolly_w)); + map(0xca00, 0xca00).w(FUNC(snk_state::sp16_scrollx_w)); + map(0xcb00, 0xcb00).w(FUNC(snk_state::bg_scrolly_w)); + map(0xcc00, 0xcc00).w(FUNC(snk_state::bg_scrollx_w)); map(0xcf00, 0xcf00).nopw(); // fitegolf/countryc only. Either 0 or 1. Video related? - map(0xd000, 0xd7ff).ram().share("spriteram"); // + work ram - map(0xd800, 0xf7ff).ram().w(FUNC(snk_state::snk_bg_videoram_w)).share("bg_videoram"); - map(0xf800, 0xffff).ram().w(FUNC(snk_state::snk_tx_videoram_w)).share("tx_videoram"); // + work RAM + map(0xd000, 0xd7ff).ram().share(m_spriteram); // + work RAM + map(0xd800, 0xf7ff).ram().w(FUNC(snk_state::bg_videoram_w)).share(m_bg_videoram); + map(0xf800, 0xffff).ram().w(FUNC(snk_state::tx_videoram_w)).share(m_tx_videoram); // + work RAM } // replace coin counter with trackball select -void snk_state::countryc_cpuA_map(address_map &map) +void countryc_state::countryc_cpuA_map(address_map &map) { tnk3_cpuA_map(map); - map(0xc300, 0xc300).portr("IN3").w(FUNC(snk_state::countryc_trackball_w)); + map(0xc300, 0xc300).portr("IN3").w(FUNC(countryc_state::countryc_trackball_w)); } void snk_state::tnk3_cpuB_map(address_map &map) { map(0x0000, 0xbfff).rom(); - map(0xc000, 0xc000).rw(FUNC(snk_state::snk_cpuA_nmi_trigger_r), FUNC(snk_state::snk_cpuB_nmi_ack_w)); // tnk3, athena - map(0xc700, 0xc700).rw(FUNC(snk_state::snk_cpuA_nmi_trigger_r), FUNC(snk_state::snk_cpuB_nmi_ack_w)); // fitegolf - map(0xc800, 0xcfff).ram().share("spriteram"); - map(0xd000, 0xefff).ram().w(FUNC(snk_state::snk_bg_videoram_w)).share("bg_videoram"); + map(0xc000, 0xc000).rw(FUNC(snk_state::cpuA_nmi_trigger_r), FUNC(snk_state::cpuB_nmi_ack_w)); // tnk3, athena + map(0xc700, 0xc700).rw(FUNC(snk_state::cpuA_nmi_trigger_r), FUNC(snk_state::cpuB_nmi_ack_w)); // fitegolf + map(0xc800, 0xcfff).ram().share(m_spriteram); + map(0xd000, 0xefff).ram().w(FUNC(snk_state::bg_videoram_w)).share(m_bg_videoram); map(0xf000, 0xf7ff).ram(); - map(0xf800, 0xffff).ram().w(FUNC(snk_state::snk_tx_videoram_w)).share("tx_videoram"); + map(0xf800, 0xffff).ram().w(FUNC(snk_state::tx_videoram_w)).share(m_tx_videoram); } -void snk_state::ikari_cpuA_map(address_map &map) +void ikari_state::ikari_common_map(address_map &map) +{ + map(0xc980, 0xc980).w(FUNC(ikari_state::ikari_unknown_video_w)); + map(0xcc00, 0xcc00).w(FUNC(ikari_state::hardflags_scrolly_w)); + map(0xcc80, 0xcc80).w(FUNC(ikari_state::hardflags_scrollx_w)); + map(0xcd80, 0xcd80).w(FUNC(ikari_state::hardflags_scroll_msb_w)); + map(0xce00, 0xce00).r(FUNC(ikari_state::hardflags_check8<0>)); + map(0xce20, 0xce20).r(FUNC(ikari_state::hardflags_check8<1>)); + map(0xce40, 0xce40).r(FUNC(ikari_state::hardflags_check8<2>)); + map(0xce60, 0xce60).r(FUNC(ikari_state::hardflags_check8<3>)); + map(0xce80, 0xce80).r(FUNC(ikari_state::hardflags_check8<4>)); + map(0xcea0, 0xcea0).r(FUNC(ikari_state::hardflags_check8<5>)); + map(0xcee0, 0xcee0).r(FUNC(ikari_state::hardflags7_r)); + // note the mirror. ikari and victroad use d800, ikarijp uses d000 + map(0xd000, 0xd7ff).ram().w(FUNC(ikari_state::bg_videoram_w)).mirror(0x0800).share(m_bg_videoram); + map(0xe000, 0xf7ff).ram().share(m_spriteram); // + work RAM + map(0xf800, 0xffff).ram().w(FUNC(ikari_state::tx_videoram_w)).share(m_tx_videoram); // + work RAM +} + +void ikari_state::ikari_cpuA_map(address_map &map) { + ikari_common_map(map); map(0x0000, 0xbfff).rom(); map(0xc000, 0xc000).portr("IN0"); map(0xc100, 0xc100).portr("IN1"); map(0xc200, 0xc200).portr("IN2"); - map(0xc300, 0xc300).portr("IN3").w(FUNC(snk_state::ikari_coin_counter_w)); // ikarijp doesn't use the coin counter - map(0xc400, 0xc400).w(FUNC(snk_state::snk_soundlatch_w)); + map(0xc300, 0xc300).portr("IN3").w(FUNC(ikari_state::ikari_coin_counter_w)); // ikarijp doesn't use the coin counter + map(0xc400, 0xc400).w(FUNC(ikari_state::soundlatch_w)); map(0xc500, 0xc500).portr("DSW1"); map(0xc600, 0xc600).portr("DSW2"); - map(0xc700, 0xc700).rw(FUNC(snk_state::snk_cpuB_nmi_trigger_r), FUNC(snk_state::snk_cpuA_nmi_ack_w)); - map(0xc800, 0xc800).w(FUNC(snk_state::snk_bg_scrolly_w)); - map(0xc880, 0xc880).w(FUNC(snk_state::snk_bg_scrollx_w)); - map(0xc900, 0xc900).w(FUNC(snk_state::ikari_bg_scroll_msb_w)); - map(0xc980, 0xc980).w(FUNC(snk_state::ikari_unknown_video_w)); - map(0xca00, 0xca00).w(FUNC(snk_state::snk_sp16_scrolly_w)); - map(0xca80, 0xca80).w(FUNC(snk_state::snk_sp16_scrollx_w)); - map(0xcb00, 0xcb00).w(FUNC(snk_state::snk_sp32_scrolly_w)); - map(0xcb80, 0xcb80).w(FUNC(snk_state::snk_sp32_scrollx_w)); - map(0xcc00, 0xcc00).w(FUNC(snk_state::hardflags_scrolly_w)); - map(0xcc80, 0xcc80).w(FUNC(snk_state::hardflags_scrollx_w)); - map(0xcd00, 0xcd00).w(FUNC(snk_state::ikari_sp_scroll_msb_w)); - map(0xcd80, 0xcd80).w(FUNC(snk_state::hardflags_scroll_msb_w)); - map(0xce00, 0xce00).r(FUNC(snk_state::hardflags1_r)); - map(0xce20, 0xce20).r(FUNC(snk_state::hardflags2_r)); - map(0xce40, 0xce40).r(FUNC(snk_state::hardflags3_r)); - map(0xce60, 0xce60).r(FUNC(snk_state::hardflags4_r)); - map(0xce80, 0xce80).r(FUNC(snk_state::hardflags5_r)); - map(0xcea0, 0xcea0).r(FUNC(snk_state::hardflags6_r)); - map(0xcee0, 0xcee0).r(FUNC(snk_state::hardflags7_r)); - // note the mirror. ikari and victroad use d800, ikarijp uses d000 - map(0xd000, 0xd7ff).ram().w(FUNC(snk_state::snk_bg_videoram_w)).mirror(0x0800).share("bg_videoram"); - map(0xe000, 0xf7ff).ram().share("spriteram"); // + work ram - map(0xf800, 0xffff).ram().w(FUNC(snk_state::snk_tx_videoram_w)).share("tx_videoram"); // + work RAM + map(0xc700, 0xc700).rw(FUNC(ikari_state::cpuB_nmi_trigger_r), FUNC(ikari_state::cpuA_nmi_ack_w)); + map(0xc800, 0xc800).w(FUNC(ikari_state::bg_scrolly_w)); + map(0xc880, 0xc880).w(FUNC(ikari_state::bg_scrollx_w)); + map(0xc900, 0xc900).w(FUNC(ikari_state::ikari_bg_scroll_msb_w)); + map(0xca00, 0xca00).w(FUNC(ikari_state::sp16_scrolly_w)); + map(0xca80, 0xca80).w(FUNC(ikari_state::sp16_scrollx_w)); + map(0xcb00, 0xcb00).w(FUNC(ikari_state::sp32_scrolly_w)); + map(0xcb80, 0xcb80).w(FUNC(ikari_state::sp32_scrollx_w)); + map(0xcd00, 0xcd00).w(FUNC(ikari_state::ikari_sp_scroll_msb_w)); } -void snk_state::ikari_cpuB_map(address_map &map) +void ikari_state::ikari_cpuB_map(address_map &map) { + ikari_common_map(map); map(0x0000, 0xbfff).rom(); - map(0xc000, 0xc000).rw(FUNC(snk_state::snk_cpuA_nmi_trigger_r), FUNC(snk_state::snk_cpuB_nmi_ack_w)); - map(0xc980, 0xc980).w(FUNC(snk_state::ikari_unknown_video_w)); - map(0xcc00, 0xcc00).w(FUNC(snk_state::hardflags_scrolly_w)); - map(0xcc80, 0xcc80).w(FUNC(snk_state::hardflags_scrollx_w)); - map(0xcd80, 0xcd80).w(FUNC(snk_state::hardflags_scroll_msb_w)); - map(0xce00, 0xce00).r(FUNC(snk_state::hardflags1_r)); - map(0xce20, 0xce20).r(FUNC(snk_state::hardflags2_r)); - map(0xce40, 0xce40).r(FUNC(snk_state::hardflags3_r)); - map(0xce60, 0xce60).r(FUNC(snk_state::hardflags4_r)); - map(0xce80, 0xce80).r(FUNC(snk_state::hardflags5_r)); - map(0xcea0, 0xcea0).r(FUNC(snk_state::hardflags6_r)); - map(0xcee0, 0xcee0).r(FUNC(snk_state::hardflags7_r)); - map(0xd000, 0xd7ff).ram().w(FUNC(snk_state::snk_bg_videoram_w)).mirror(0x0800).share("bg_videoram"); - map(0xe000, 0xf7ff).ram().share("spriteram"); - map(0xf800, 0xffff).ram().w(FUNC(snk_state::snk_tx_videoram_w)).share("tx_videoram"); + map(0xc000, 0xc000).rw(FUNC(ikari_state::cpuA_nmi_trigger_r), FUNC(ikari_state::cpuB_nmi_ack_w)); } -void snk_state::bermudat_cpuA_map(address_map &map) +void bermudat_state::bermudat_common_map(address_map &map) +{ + map(0xc800, 0xc800).w(FUNC(bermudat_state::bg_scrolly_w)); + map(0xc840, 0xc840).w(FUNC(bermudat_state::bg_scrollx_w)); + map(0xc880, 0xc880).w(FUNC(bermudat_state::gwara_videoattrs_w)); // flip screen, scroll msb + map(0xc8c0, 0xc8c0).w(FUNC(bermudat_state::gwar_tx_bank_w)); // char and palette bank + map(0xc900, 0xc900).w(FUNC(bermudat_state::sp16_scrolly_w)); + map(0xc940, 0xc940).w(FUNC(bermudat_state::sp16_scrollx_w)); + map(0xc980, 0xc980).w(FUNC(bermudat_state::sp32_scrolly_w)); + map(0xc9c0, 0xc9c0).w(FUNC(bermudat_state::sp32_scrollx_w)); + map(0xca80, 0xca80).w(FUNC(bermudat_state::gwara_sp_scroll_msb_w)); + map(0xd000, 0xd7ff).ram().w(FUNC(bermudat_state::bg_videoram_w)).share(m_bg_videoram); + map(0xd800, 0xdfff).ram().share("sharedram"); + map(0xe000, 0xf7ff).ram().share(m_spriteram); // + work RAM + map(0xf800, 0xffff).ram().w(FUNC(bermudat_state::tx_videoram_w)).share(m_tx_videoram); // + work RAM +} + +void bermudat_state::bermudat_cpuA_map(address_map &map) { + bermudat_common_map(map); map(0x0000, 0xbfff).rom(); map(0xc000, 0xc000).portr("IN0"); map(0xc100, 0xc100).portr("IN1"); map(0xc200, 0xc200).portr("IN2"); - map(0xc300, 0xc300).portr("IN3").w(FUNC(snk_state::ikari_coin_counter_w)); - map(0xc400, 0xc400).w(FUNC(snk_state::snk_soundlatch_w)); + map(0xc300, 0xc300).portr("IN3").w(FUNC(bermudat_state::ikari_coin_counter_w)); + map(0xc400, 0xc400).w(FUNC(bermudat_state::soundlatch_w)); map(0xc500, 0xc500).portr("DSW1"); map(0xc600, 0xc600).portr("DSW2"); - map(0xc700, 0xc700).rw(FUNC(snk_state::snk_cpuB_nmi_trigger_r), FUNC(snk_state::snk_cpuA_nmi_ack_w)); - map(0xc800, 0xc800).w(FUNC(snk_state::snk_bg_scrolly_w)); - map(0xc840, 0xc840).w(FUNC(snk_state::snk_bg_scrollx_w)); - map(0xc880, 0xc880).w(FUNC(snk_state::gwara_videoattrs_w)); // flip screen, scroll msb - map(0xc8c0, 0xc8c0).w(FUNC(snk_state::gwar_tx_bank_w)); // char and palette bank - map(0xc900, 0xc900).w(FUNC(snk_state::snk_sp16_scrolly_w)); - map(0xc940, 0xc940).w(FUNC(snk_state::snk_sp16_scrollx_w)); - map(0xc980, 0xc980).w(FUNC(snk_state::snk_sp32_scrolly_w)); - map(0xc9c0, 0xc9c0).w(FUNC(snk_state::snk_sp32_scrollx_w)); - // the "turbo check" addresses are only used by bermudat/bermudaj, not bermudaa/worldwar or the other games - map(0xca00, 0xca00).w(FUNC(snk_state::turbocheck16_1_w)); - map(0xca40, 0xca40).w(FUNC(snk_state::turbocheck16_2_w)); - map(0xca80, 0xca80).w(FUNC(snk_state::gwara_sp_scroll_msb_w)); - map(0xcac0, 0xcac0).w(FUNC(snk_state::snk_sprite_split_point_w)); - map(0xcb00, 0xcb00).r(FUNC(snk_state::turbocheck16_1_r)); - map(0xcb10, 0xcb10).r(FUNC(snk_state::turbocheck16_2_r)); - map(0xcb20, 0xcb20).r(FUNC(snk_state::turbocheck16_3_r)); - map(0xcb30, 0xcb30).r(FUNC(snk_state::turbocheck16_4_r)); - map(0xcb40, 0xcb40).r(FUNC(snk_state::turbocheck16_5_r)); - map(0xcb50, 0xcb50).r(FUNC(snk_state::turbocheck16_6_r)); - map(0xcb60, 0xcb60).r(FUNC(snk_state::turbocheck16_7_r)); - map(0xcb70, 0xcb70).r(FUNC(snk_state::turbocheck16_8_r)); - map(0xcc00, 0xcc00).w(FUNC(snk_state::turbocheck32_1_w)); - map(0xcc40, 0xcc40).w(FUNC(snk_state::turbocheck32_2_w)); - map(0xcc80, 0xcc80).w(FUNC(snk_state::turbocheck_msb_w)); - map(0xccc0, 0xccc0).r(FUNC(snk_state::turbocheck32_1_r)); - map(0xccd0, 0xccd0).r(FUNC(snk_state::turbocheck32_2_r)); - map(0xcce0, 0xcce0).r(FUNC(snk_state::turbocheck32_3_r)); - map(0xccf0, 0xccf0).r(FUNC(snk_state::turbocheck32_4_r)); - map(0xd000, 0xd7ff).ram().w(FUNC(snk_state::snk_bg_videoram_w)).share("bg_videoram"); - map(0xd800, 0xdfff).ram().share("share2"); - map(0xe000, 0xf7ff).ram().share("spriteram"); // + work ram - map(0xf800, 0xffff).ram().w(FUNC(snk_state::snk_tx_videoram_w)).share("tx_videoram"); // + work RAM + map(0xc700, 0xc700).rw(FUNC(bermudat_state::cpuB_nmi_trigger_r), FUNC(bermudat_state::cpuA_nmi_ack_w)); + // the "turbo check" addresses are only used by bermudat/bermudatj, not bermudata/worldwar or the other games + map(0xca00, 0xca00).w(FUNC(bermudat_state::turbocheck16_1_w)); + map(0xca40, 0xca40).w(FUNC(bermudat_state::turbocheck16_2_w)); + map(0xcac0, 0xcac0).w(FUNC(bermudat_state::sprite_split_point_w)); + map(0xcb00, 0xcb00).r(NAME((&bermudat_state::turbofront_check8))); + map(0xcb10, 0xcb10).r(NAME((&bermudat_state::turbofront_check8))); + map(0xcb20, 0xcb20).r(NAME((&bermudat_state::turbofront_check8))); + map(0xcb30, 0xcb30).r(NAME((&bermudat_state::turbofront_check8))); + map(0xcb40, 0xcb40).r(NAME((&bermudat_state::turbofront_check8))); + map(0xcb50, 0xcb50).r(NAME((&bermudat_state::turbofront_check8))); + map(0xcb60, 0xcb60).r(NAME((&bermudat_state::turbofront_check8))); + map(0xcb70, 0xcb70).r(NAME((&bermudat_state::turbofront_check8))); + map(0xcc00, 0xcc00).w(FUNC(bermudat_state::turbocheck32_1_w)); + map(0xcc40, 0xcc40).w(FUNC(bermudat_state::turbocheck32_2_w)); + map(0xcc80, 0xcc80).w(FUNC(bermudat_state::turbocheck_msb_w)); + map(0xccc0, 0xccc0).r(NAME((&bermudat_state::turbofront_check8))); + map(0xccd0, 0xccd0).r(NAME((&bermudat_state::turbofront_check8))); + map(0xcce0, 0xcce0).r(NAME((&bermudat_state::turbofront_check8))); + map(0xccf0, 0xccf0).r(NAME((&bermudat_state::turbofront_check8))); } -void snk_state::bermudat_cpuB_map(address_map &map) +void bermudat_state::bermudat_cpuB_map(address_map &map) { + bermudat_common_map(map); map(0x0000, 0xbfff).rom(); - map(0xc700, 0xc700).rw(FUNC(snk_state::snk_cpuA_nmi_trigger_r), FUNC(snk_state::snk_cpuB_nmi_ack_w)); - map(0xc800, 0xc800).w(FUNC(snk_state::snk_bg_scrolly_w)); - map(0xc840, 0xc840).w(FUNC(snk_state::snk_bg_scrollx_w)); - map(0xc880, 0xc880).w(FUNC(snk_state::gwara_videoattrs_w)); // flip screen, scroll msb - map(0xc8c0, 0xc8c0).w(FUNC(snk_state::gwar_tx_bank_w)); // char and palette bank - map(0xc900, 0xc900).w(FUNC(snk_state::snk_sp16_scrolly_w)); - map(0xc940, 0xc940).w(FUNC(snk_state::snk_sp16_scrollx_w)); - map(0xc980, 0xc980).w(FUNC(snk_state::snk_sp32_scrolly_w)); - map(0xc9c0, 0xc9c0).w(FUNC(snk_state::snk_sp32_scrollx_w)); - map(0xca80, 0xca80).w(FUNC(snk_state::gwara_sp_scroll_msb_w)); - map(0xd000, 0xd7ff).ram().w(FUNC(snk_state::snk_bg_videoram_w)).share("bg_videoram"); - map(0xd800, 0xdfff).ram().share("share2"); - map(0xe000, 0xf7ff).ram().share("spriteram"); - map(0xf800, 0xffff).ram().w(FUNC(snk_state::snk_tx_videoram_w)).share("tx_videoram"); + map(0xc700, 0xc700).rw(FUNC(bermudat_state::cpuA_nmi_trigger_r), FUNC(bermudat_state::cpuB_nmi_ack_w)); } -void snk_state::gwar_cpuA_map(address_map &map) +void bermudat_state::gwar_common_map(address_map &map) +{ + map(0xc8c0, 0xc8c0).w(FUNC(bermudat_state::gwar_tx_bank_w)); // char and palette bank + map(0xd000, 0xd7ff).ram().w(FUNC(bermudat_state::bg_videoram_w)).share(m_bg_videoram); + map(0xd800, 0xdfff).ram().share("sharedram"); + map(0xe000, 0xf7ff).ram().share(m_spriteram); // + work RAM + map(0xf800, 0xffff).ram().w(FUNC(bermudat_state::tx_videoram_w)).share(m_tx_videoram); // + work RAM +} + +void bermudat_state::gwar_cpuA_map(address_map &map) { + gwar_common_map(map); map(0x0000, 0xbfff).rom(); map(0xc000, 0xc000).portr("IN0"); map(0xc100, 0xc100).portr("IN1"); map(0xc200, 0xc200).portr("IN2"); - map(0xc300, 0xc300).portr("IN3").w(FUNC(snk_state::ikari_coin_counter_w)); - map(0xc400, 0xc400).w(FUNC(snk_state::snk_soundlatch_w)); + map(0xc300, 0xc300).portr("IN3").w(FUNC(bermudat_state::ikari_coin_counter_w)); + map(0xc400, 0xc400).w(FUNC(bermudat_state::soundlatch_w)); map(0xc500, 0xc500).portr("DSW1"); map(0xc600, 0xc600).portr("DSW2"); - map(0xc700, 0xc700).rw(FUNC(snk_state::snk_cpuB_nmi_trigger_r), FUNC(snk_state::snk_cpuA_nmi_ack_w)); - map(0xc800, 0xc800).w(FUNC(snk_state::snk_bg_scrolly_w)); - map(0xc840, 0xc840).w(FUNC(snk_state::snk_bg_scrollx_w)); - map(0xc880, 0xc880).w(FUNC(snk_state::gwar_videoattrs_w)); // flip screen, scroll msb - map(0xc8c0, 0xc8c0).w(FUNC(snk_state::gwar_tx_bank_w)); // char and palette bank - map(0xc900, 0xc900).w(FUNC(snk_state::snk_sp16_scrolly_w)); - map(0xc940, 0xc940).w(FUNC(snk_state::snk_sp16_scrollx_w)); - map(0xc980, 0xc980).w(FUNC(snk_state::snk_sp32_scrolly_w)); - map(0xc9c0, 0xc9c0).w(FUNC(snk_state::snk_sp32_scrollx_w)); + map(0xc700, 0xc700).rw(FUNC(bermudat_state::cpuB_nmi_trigger_r), FUNC(bermudat_state::cpuA_nmi_ack_w)); + map(0xc800, 0xc800).w(FUNC(bermudat_state::bg_scrolly_w)); + map(0xc840, 0xc840).w(FUNC(bermudat_state::bg_scrollx_w)); + map(0xc880, 0xc880).w(FUNC(bermudat_state::gwar_videoattrs_w)); // flip screen, scroll msb + map(0xc900, 0xc900).w(FUNC(bermudat_state::sp16_scrolly_w)); + map(0xc940, 0xc940).w(FUNC(bermudat_state::sp16_scrollx_w)); + map(0xc980, 0xc980).w(FUNC(bermudat_state::sp32_scrolly_w)); + map(0xc9c0, 0xc9c0).w(FUNC(bermudat_state::sp32_scrollx_w)); map(0xca00, 0xca00).nopw(); // always 0? map(0xca40, 0xca40).nopw(); // always 0? - map(0xcac0, 0xcac0).w(FUNC(snk_state::snk_sprite_split_point_w)); - map(0xd000, 0xd7ff).ram().w(FUNC(snk_state::snk_bg_videoram_w)).share("bg_videoram"); - map(0xd800, 0xdfff).ram().share("share2"); - map(0xe000, 0xf7ff).ram().share("spriteram"); // + work ram - map(0xf800, 0xffff).ram().w(FUNC(snk_state::snk_tx_videoram_w)).share("tx_videoram"); // + work RAM + map(0xcac0, 0xcac0).w(FUNC(bermudat_state::sprite_split_point_w)); } -void snk_state::gwar_cpuB_map(address_map &map) +void bermudat_state::gwar_cpuB_map(address_map &map) { + gwar_common_map(map); map(0x0000, 0xbfff).rom(); - map(0xc000, 0xc000).rw(FUNC(snk_state::snk_cpuA_nmi_trigger_r), FUNC(snk_state::snk_cpuB_nmi_ack_w)); - map(0xc8c0, 0xc8c0).w(FUNC(snk_state::gwar_tx_bank_w)); // char and palette bank - map(0xd000, 0xd7ff).ram().w(FUNC(snk_state::snk_bg_videoram_w)).share("bg_videoram"); - map(0xd800, 0xdfff).ram().share("share2"); - map(0xe000, 0xf7ff).ram().share("spriteram"); - map(0xf800, 0xffff).ram().w(FUNC(snk_state::snk_tx_videoram_w)).share("tx_videoram"); + map(0xc000, 0xc000).rw(FUNC(bermudat_state::cpuA_nmi_trigger_r), FUNC(bermudat_state::cpuB_nmi_ack_w)); } -void snk_state::gwara_cpuA_map(address_map &map) +void gwar_state::gwara_common_map(address_map &map) { + map(0xc800, 0xcfff).ram().w(FUNC(gwar_state::tx_videoram_w)).share(m_tx_videoram); // + work RAM + map(0xd000, 0xd7ff).ram().w(FUNC(gwar_state::bg_videoram_w)).share(m_bg_videoram); + map(0xd800, 0xdfff).ram().share("sharedram"); + map(0xe000, 0xf7ff).ram().share(m_spriteram); // + work RAM + map(0xf8c0, 0xf8c0).w(FUNC(gwar_state::gwar_tx_bank_w)); // char and palette bank +} + +void gwar_state::gwara_cpuA_map(address_map &map) +{ + gwara_common_map(map); map(0x0000, 0xbfff).rom(); map(0xc000, 0xc000).portr("IN0"); map(0xc100, 0xc100).portr("IN1"); map(0xc200, 0xc200).portr("IN2"); - map(0xc300, 0xc300).portr("IN3").w(FUNC(snk_state::ikari_coin_counter_w)); - map(0xc400, 0xc400).w(FUNC(snk_state::snk_soundlatch_w)); + map(0xc300, 0xc300).portr("IN3").w(FUNC(gwar_state::ikari_coin_counter_w)); + map(0xc400, 0xc400).w(FUNC(gwar_state::soundlatch_w)); map(0xc500, 0xc500).portr("DSW1"); map(0xc600, 0xc600).portr("DSW2"); - map(0xc700, 0xc700).rw(FUNC(snk_state::snk_cpuB_nmi_trigger_r), FUNC(snk_state::snk_cpuA_nmi_ack_w)); - map(0xc800, 0xcfff).ram().w(FUNC(snk_state::snk_tx_videoram_w)).share("tx_videoram"); // + work RAM - map(0xd000, 0xd7ff).ram().w(FUNC(snk_state::snk_bg_videoram_w)).share("bg_videoram"); - map(0xd800, 0xdfff).ram().share("share3"); - map(0xe000, 0xf7ff).ram().share("spriteram"); // + work ram - map(0xf800, 0xf800).w(FUNC(snk_state::snk_bg_scrolly_w)); - map(0xf840, 0xf840).w(FUNC(snk_state::snk_bg_scrollx_w)); - map(0xf880, 0xf880).w(FUNC(snk_state::gwara_videoattrs_w)); // flip screen, scroll msb - map(0xf8c0, 0xf8c0).w(FUNC(snk_state::gwar_tx_bank_w)); // char and palette bank - map(0xf900, 0xf900).w(FUNC(snk_state::snk_sp16_scrolly_w)); - map(0xf940, 0xf940).w(FUNC(snk_state::snk_sp16_scrollx_w)); - map(0xf980, 0xf980).w(FUNC(snk_state::snk_sp32_scrolly_w)); - map(0xf9c0, 0xf9c0).w(FUNC(snk_state::snk_sp32_scrollx_w)); - map(0xfa80, 0xfa80).w(FUNC(snk_state::gwara_sp_scroll_msb_w)); - map(0xfac0, 0xfac0).w(FUNC(snk_state::snk_sprite_split_point_w)); + map(0xc700, 0xc700).rw(FUNC(gwar_state::cpuB_nmi_trigger_r), FUNC(gwar_state::cpuA_nmi_ack_w)); + map(0xf800, 0xf800).w(FUNC(gwar_state::bg_scrolly_w)); + map(0xf840, 0xf840).w(FUNC(gwar_state::bg_scrollx_w)); + map(0xf880, 0xf880).w(FUNC(gwar_state::gwara_videoattrs_w)); // flip screen, scroll msb + map(0xf900, 0xf900).w(FUNC(gwar_state::sp16_scrolly_w)); + map(0xf940, 0xf940).w(FUNC(gwar_state::sp16_scrollx_w)); + map(0xf980, 0xf980).w(FUNC(gwar_state::sp32_scrolly_w)); + map(0xf9c0, 0xf9c0).w(FUNC(gwar_state::sp32_scrollx_w)); + map(0xfa80, 0xfa80).w(FUNC(gwar_state::gwara_sp_scroll_msb_w)); + map(0xfac0, 0xfac0).w(FUNC(gwar_state::sprite_split_point_w)); } -void snk_state::gwara_cpuB_map(address_map &map) +void gwar_state::gwara_cpuB_map(address_map &map) { + gwara_common_map(map); map(0x0000, 0xbfff).rom(); - map(0xc000, 0xc000).rw(FUNC(snk_state::snk_cpuA_nmi_trigger_r), FUNC(snk_state::snk_cpuB_nmi_ack_w)); - map(0xc800, 0xcfff).ram().w(FUNC(snk_state::snk_tx_videoram_w)).share("tx_videoram"); - map(0xd000, 0xd7ff).ram().w(FUNC(snk_state::snk_bg_videoram_w)).share("bg_videoram"); - map(0xd800, 0xdfff).ram().share("share3"); - map(0xe000, 0xf7ff).ram().share("spriteram"); // + work ram - map(0xf8c0, 0xf8c0).w(FUNC(snk_state::gwar_tx_bank_w)); // char and palette bank + map(0xc000, 0xc000).rw(FUNC(gwar_state::cpuA_nmi_trigger_r), FUNC(gwar_state::cpuB_nmi_ack_w)); } -void snk_state::tdfever_cpuA_map(address_map &map) +void bermudat_state::tdfever_common_map(address_map &map) { + map(0xc8c0, 0xc8c0).w(FUNC(bermudat_state::gwar_tx_bank_w)); // char and palette bank + map(0xd000, 0xd7ff).ram().w(FUNC(bermudat_state::bg_videoram_w)).share(m_bg_videoram); + map(0xd800, 0xdfff).ram().share("sharedram"); + map(0xe000, 0xf7ff).ram().w(FUNC(bermudat_state::tdfever_spriteram_w)).share(m_spriteram); // + work RAM + map(0xf800, 0xffff).ram().w(FUNC(bermudat_state::tx_videoram_w)).share(m_tx_videoram); // + work RAM +} + +void bermudat_state::tdfever_cpuA_map(address_map &map) +{ + tdfever_common_map(map); map(0x0000, 0xbfff).rom(); map(0xc000, 0xc000).portr("IN0"); map(0xc080, 0xc080).portr("IN1"); @@ -1753,46 +1767,37 @@ void snk_state::tdfever_cpuA_map(address_map &map) map(0xc380, 0xc380).portr("IN7"); map(0xc400, 0xc400).portr("IN8"); map(0xc480, 0xc480).portr("IN9"); - map(0xc500, 0xc500).w(FUNC(snk_state::snk_soundlatch_w)); + map(0xc500, 0xc500).w(FUNC(bermudat_state::soundlatch_w)); map(0xc580, 0xc580).portr("DSW1"); map(0xc600, 0xc600).portr("DSW2"); - map(0xc680, 0xc680).w(FUNC(snk_state::tdfever_coin_counter_w)); - map(0xc700, 0xc700).rw(FUNC(snk_state::snk_cpuB_nmi_trigger_r), FUNC(snk_state::snk_cpuA_nmi_ack_w)); - map(0xc800, 0xc800).w(FUNC(snk_state::snk_bg_scrolly_w)); - map(0xc840, 0xc840).w(FUNC(snk_state::snk_bg_scrollx_w)); - map(0xc880, 0xc880).w(FUNC(snk_state::gwara_videoattrs_w)); // flip screen, scroll msb - map(0xc8c0, 0xc8c0).w(FUNC(snk_state::gwar_tx_bank_w)); // char and palette bank - map(0xc900, 0xc900).w(FUNC(snk_state::tdfever_sp_scroll_msb_w)); - map(0xc980, 0xc980).w(FUNC(snk_state::snk_sp32_scrolly_w)); - map(0xc9c0, 0xc9c0).w(FUNC(snk_state::snk_sp32_scrollx_w)); - map(0xd000, 0xd7ff).ram().w(FUNC(snk_state::snk_bg_videoram_w)).share("bg_videoram"); - map(0xd800, 0xdfff).ram().share("share2"); - map(0xe000, 0xf7ff).ram().w(FUNC(snk_state::tdfever_spriteram_w)).share("spriteram"); // + work ram - map(0xf800, 0xffff).ram().w(FUNC(snk_state::snk_tx_videoram_w)).share("tx_videoram"); // + work RAM + map(0xc680, 0xc680).w(FUNC(bermudat_state::tdfever_coin_counter_w)); + map(0xc700, 0xc700).rw(FUNC(bermudat_state::cpuB_nmi_trigger_r), FUNC(bermudat_state::cpuA_nmi_ack_w)); + map(0xc800, 0xc800).w(FUNC(bermudat_state::bg_scrolly_w)); + map(0xc840, 0xc840).w(FUNC(bermudat_state::bg_scrollx_w)); + map(0xc880, 0xc880).w(FUNC(bermudat_state::gwara_videoattrs_w)); // flip screen, scroll msb + map(0xc900, 0xc900).w(FUNC(bermudat_state::tdfever_sp_scroll_msb_w)); + map(0xc980, 0xc980).w(FUNC(bermudat_state::sp32_scrolly_w)); + map(0xc9c0, 0xc9c0).w(FUNC(bermudat_state::sp32_scrollx_w)); } -void snk_state::tdfever_cpuB_map(address_map &map) +void bermudat_state::tdfever_cpuB_map(address_map &map) { + tdfever_common_map(map); map(0x0000, 0xbfff).rom(); - map(0xc000, 0xc000).rw(FUNC(snk_state::snk_cpuA_nmi_trigger_r), FUNC(snk_state::snk_cpuB_nmi_ack_w)); // tdfever, tdfever2 - map(0xc700, 0xc700).rw(FUNC(snk_state::snk_cpuA_nmi_trigger_r), FUNC(snk_state::snk_cpuB_nmi_ack_w)); // fsoccer - map(0xc8c0, 0xc8c0).w(FUNC(snk_state::gwar_tx_bank_w)); // char and palette bank - map(0xd000, 0xd7ff).ram().w(FUNC(snk_state::snk_bg_videoram_w)).share("bg_videoram"); - map(0xd800, 0xdfff).ram().share("share2"); - map(0xe000, 0xf7ff).ram().w(FUNC(snk_state::tdfever_spriteram_w)).share("spriteram"); - map(0xf800, 0xffff).ram().w(FUNC(snk_state::snk_tx_videoram_w)).share("tx_videoram"); + map(0xc000, 0xc000).rw(FUNC(bermudat_state::cpuA_nmi_trigger_r), FUNC(bermudat_state::cpuB_nmi_ack_w)); // tdfever, tdfever2 + map(0xc700, 0xc700).rw(FUNC(bermudat_state::cpuA_nmi_trigger_r), FUNC(bermudat_state::cpuB_nmi_ack_w)); // fsoccer } /***********************************************************************/ -void snk_state::marvins_sound_map(address_map &map) +void marvins_state::marvins_sound_map(address_map &map) { map(0x0000, 0x3fff).rom(); map(0x4000, 0x4000).r(m_soundlatch, FUNC(generic_latch_8_device::read)); map(0x8000, 0x8001).w("ay1", FUNC(ay8910_device::address_data_w)); map(0x8002, 0x8007).w("wave", FUNC(snkwave_device::snkwave_w)); map(0x8008, 0x8009).w("ay2", FUNC(ay8910_device::address_data_w)); - map(0xa000, 0xa000).r(FUNC(snk_state::marvins_sound_nmi_ack_r)); + map(0xa000, 0xa000).r(FUNC(marvins_state::marvins_sound_nmi_ack_r)); map(0xe000, 0xe7ff).ram(); } @@ -1832,12 +1837,6 @@ void snk_state::hal21_sound_map(address_map &map) map(0xe008, 0xe009).w("ay2", FUNC(ay8910_device::address_data_w)); } -void snk_state::hal21_sound_portmap(address_map &map) -{ - map.global_mask(0xff); - map(0x00, 0x00).nopr(); // read on startup, then the Z80 automatically pulls down the IORQ pin to ack irq -} - void snk_state::tnk3_YM3526_sound_map(address_map &map) { @@ -1862,60 +1861,53 @@ void snk_state::aso_YM3526_sound_map(address_map &map) map(0xf006, 0xf006).r(FUNC(snk_state::tnk3_ymirq_ack_r)); } -void snk_state::YM3526_YM3526_sound_map(address_map &map) +void snk_state::sound_common_map(address_map &map) { map(0x0000, 0xbfff).rom(); map(0xc000, 0xcfff).ram(); map(0xe000, 0xe000).r(m_soundlatch, FUNC(generic_latch_8_device::read)); + map(0xf800, 0xf800).rw(FUNC(snk_state::sound_status_r), FUNC(snk_state::sound_status_w)); +} + +void snk_state::YM3526_YM3526_sound_map(address_map &map) +{ + sound_common_map(map); map(0xe800, 0xe800).rw("ym1", FUNC(ym3526_device::status_r), FUNC(ym3526_device::address_w)); map(0xec00, 0xec00).w("ym1", FUNC(ym3526_device::data_w)); map(0xf000, 0xf000).rw("ym2", FUNC(ym3526_device::status_r), FUNC(ym3526_device::address_w)); map(0xf400, 0xf400).w("ym2", FUNC(ym3526_device::data_w)); - map(0xf800, 0xf800).rw(FUNC(snk_state::snk_sound_status_r), FUNC(snk_state::snk_sound_status_w)); } void snk_state::YM3812_sound_map(address_map &map) { - map(0x0000, 0xbfff).rom(); - map(0xc000, 0xcfff).ram(); - map(0xe000, 0xe000).r(m_soundlatch, FUNC(generic_latch_8_device::read)); + sound_common_map(map); map(0xe800, 0xe800).rw("ym1", FUNC(ym3812_device::status_r), FUNC(ym3812_device::address_w)); map(0xec00, 0xec00).w("ym1", FUNC(ym3812_device::data_w)); - map(0xf800, 0xf800).rw(FUNC(snk_state::snk_sound_status_r), FUNC(snk_state::snk_sound_status_w)); } void snk_state::YM3526_Y8950_sound_map(address_map &map) { - map(0x0000, 0xbfff).rom(); - map(0xc000, 0xcfff).ram(); - map(0xe000, 0xe000).r(m_soundlatch, FUNC(generic_latch_8_device::read)); + sound_common_map(map); map(0xe800, 0xe800).rw("ym1", FUNC(ym3526_device::status_r), FUNC(ym3526_device::address_w)); map(0xec00, 0xec00).w("ym1", FUNC(ym3526_device::data_w)); map(0xf000, 0xf000).rw("ym2", FUNC(y8950_device::status_r), FUNC(y8950_device::address_w)); map(0xf400, 0xf400).w("ym2", FUNC(y8950_device::data_w)); - map(0xf800, 0xf800).rw(FUNC(snk_state::snk_sound_status_r), FUNC(snk_state::snk_sound_status_w)); } -void snk_state::YM3812_Y8950_sound_map(address_map &map) +void bermudat_state::chopper1_sound_map(address_map &map) { - map(0x0000, 0xbfff).rom(); - map(0xc000, 0xcfff).ram(); - map(0xe000, 0xe000).r(m_soundlatch, FUNC(generic_latch_8_device::read)); + sound_common_map(map); map(0xe800, 0xe800).rw("ym1", FUNC(ym3812_device::status_r), FUNC(ym3812_device::address_w)); map(0xec00, 0xec00).w("ym1", FUNC(ym3812_device::data_w)); map(0xf000, 0xf000).rw("ym2", FUNC(y8950_device::status_r), FUNC(y8950_device::address_w)); map(0xf400, 0xf400).w("ym2", FUNC(y8950_device::data_w)); - map(0xf800, 0xf800).rw(FUNC(snk_state::snk_sound_status_r), FUNC(snk_state::snk_sound_status_w)); } -void snk_state::Y8950_sound_map(address_map &map) +void bermudat_state::tdfever2_sound_map(address_map &map) { - map(0x0000, 0xbfff).rom(); - map(0xc000, 0xcfff).ram(); - map(0xe000, 0xe000).r(m_soundlatch, FUNC(generic_latch_8_device::read)); + sound_common_map(map); map(0xf000, 0xf000).rw("ym2", FUNC(y8950_device::status_r), FUNC(y8950_device::address_w)); map(0xf400, 0xf400).w("ym2", FUNC(y8950_device::data_w)); - map(0xf800, 0xf800).rw(FUNC(snk_state::snk_sound_status_r), FUNC(snk_state::snk_sound_status_w)); } /*********************************************************************/ @@ -2877,7 +2869,7 @@ INPUT_PORTS_END static INPUT_PORTS_START( countryc ) PORT_START("IN0") - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(FUNC(snk_state::sound_busy_r)) + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(FUNC(countryc_state::sound_busy_r)) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE1 ) /* uses "Coin A" settings - code at 0x0450 */ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_TILT ) /* reset */ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE ) /* same as the dip switch */ @@ -2887,10 +2879,10 @@ static INPUT_PORTS_START( countryc ) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 ) PORT_START("IN1") - PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(FUNC(snk_state::countryc_trackball_x)) + PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(FUNC(countryc_state::countryc_trackball_x)) PORT_START("IN2") - PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(FUNC(snk_state::countryc_trackball_y)) + PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(FUNC(countryc_state::countryc_trackball_y)) PORT_START("IN3") PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED ) @@ -2959,7 +2951,7 @@ INPUT_PORTS_END static INPUT_PORTS_START( ikari ) PORT_START("IN0") - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(FUNC(snk_state::sound_busy_r)) + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(FUNC(ikari_state::sound_busy_r)) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE1 ) /* adds 1 credit - code at 0x0a15 */ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) @@ -2999,7 +2991,7 @@ static INPUT_PORTS_START( ikari ) PORT_DIPNAME( 0x02, 0x02, "P1 & P2 Fire Buttons" ) PORT_DIPLOCATION("DIP1:2") PORT_DIPSETTING( 0x02, "Separate" ) PORT_DIPSETTING( 0x00, "Common" ) - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(FUNC(snk_state::snk_bonus_r<0x04>)) + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(FUNC(ikari_state::snk_bonus_r<0x04>)) PORT_DIPNAME( 0x08, 0x08, DEF_STR( Lives ) ) PORT_DIPLOCATION("DIP1:4") PORT_DIPSETTING( 0x08, "3" ) PORT_DIPSETTING( 0x00, "5" ) @@ -3025,7 +3017,7 @@ static INPUT_PORTS_START( ikari ) PORT_DIPSETTING( 0x08, "Demo Sounds On" ) PORT_DIPSETTING( 0x04, "Freeze" ) PORT_DIPSETTING( 0x00, "Infinite Lives (Cheat)") - PORT_BIT( 0x30, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(FUNC(snk_state::snk_bonus_r<0x30>)) + PORT_BIT( 0x30, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(FUNC(ikari_state::snk_bonus_r<0x30>)) PORT_DIPUNUSED_DIPLOC( 0x40, 0x40, "DIP2:7" ) /* read at 0x07c4, but strange test at 0x07cc */ PORT_DIPNAME( 0x80, 0x00, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("DIP2:8") PORT_DIPSETTING( 0x80, DEF_STR( No ) ) @@ -3054,7 +3046,7 @@ static INPUT_PORTS_START( ikaria ) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 ) /* adds 1 credit - code at 0x0a00 */ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 ) - PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(FUNC(snk_state::sound_busy_r)) + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(FUNC(ikari_state::sound_busy_r)) PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_TILT ) /* reset */ INPUT_PORTS_END @@ -3096,7 +3088,7 @@ INPUT_PORTS_END static INPUT_PORTS_START( victroad ) PORT_START("IN0") - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(FUNC(snk_state::sound_busy_r)) + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(FUNC(ikari_state::sound_busy_r)) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE1 ) /* adds 1 credit - code at 0x0a19 */ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_TILT ) /* reset */ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) @@ -3136,7 +3128,7 @@ static INPUT_PORTS_START( victroad ) PORT_DIPNAME( 0x02, 0x02, "P1 & P2 Fire Buttons" ) PORT_DIPLOCATION("DIP1:2") PORT_DIPSETTING( 0x02, "Separate" ) PORT_DIPSETTING( 0x00, "Common" ) - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(FUNC(snk_state::snk_bonus_r<0x04>)) + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(FUNC(ikari_state::snk_bonus_r<0x04>)) PORT_DIPNAME( 0x08, 0x08, DEF_STR( Lives ) ) PORT_DIPLOCATION("DIP1:4") PORT_DIPSETTING( 0x08, "3" ) PORT_DIPSETTING( 0x00, "5" ) @@ -3162,7 +3154,7 @@ static INPUT_PORTS_START( victroad ) PORT_DIPSETTING( 0x08, "Demo Sounds On" ) PORT_DIPSETTING( 0x00, "Freeze" ) PORT_DIPSETTING( 0x04, "Infinite Lives (Cheat)") - PORT_BIT( 0x30, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(FUNC(snk_state::snk_bonus_r<0x30>)) + PORT_BIT( 0x30, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(FUNC(ikari_state::snk_bonus_r<0x30>)) PORT_DIPNAME( 0x40, 0x00, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("DIP2:7") PORT_DIPSETTING( 0x40, DEF_STR( No ) ) PORT_DIPSETTING( 0x00, DEF_STR( Yes ) ) @@ -3200,7 +3192,7 @@ INPUT_PORTS_END static INPUT_PORTS_START( bermudat ) PORT_START("IN0") - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(FUNC(snk_state::sound_busy_r)) + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(FUNC(bermudat_state::sound_busy_r)) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE1 ) /* uses "Coin A" settings - code at 0x0a0a */ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_TILT ) /* reset */ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) @@ -3238,7 +3230,7 @@ static INPUT_PORTS_START( bermudat ) PORT_DIPNAME( 0x02, 0x02, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("DIP1:2") PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(FUNC(snk_state::snk_bonus_r<0x04>)) + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(FUNC(bermudat_state::snk_bonus_r<0x04>)) PORT_DIPNAME( 0x08, 0x08, DEF_STR( Lives ) ) PORT_DIPLOCATION("DIP1:4") PORT_DIPSETTING( 0x08, "3" ) PORT_DIPSETTING( 0x00, "5" ) @@ -3264,7 +3256,7 @@ static INPUT_PORTS_START( bermudat ) PORT_DIPSETTING( 0x08, "Demo Sounds On" ) PORT_DIPSETTING( 0x00, "Freeze" ) PORT_DIPSETTING( 0x04, "Infinite Lives (Cheat)") - PORT_BIT( 0x30, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(FUNC(snk_state::snk_bonus_r<0x30>)) + PORT_BIT( 0x30, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(FUNC(bermudat_state::snk_bonus_r<0x30>)) PORT_DIPNAME( 0xc0, 0x80, "Game Style" ) PORT_DIPLOCATION("DIP2:7,8") PORT_DIPSETTING( 0xc0, "Normal without continue" ) PORT_DIPSETTING( 0x80, "Normal with continue" ) @@ -3329,7 +3321,7 @@ INPUT_PORTS_END static INPUT_PORTS_START( psychos ) PORT_START("IN0") - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(FUNC(snk_state::sound_busy_r)) + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(FUNC(bermudat_state::sound_busy_r)) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_TILT ) /* reset */ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) @@ -3366,7 +3358,7 @@ static INPUT_PORTS_START( psychos ) PORT_DIPNAME( 0x02, 0x02, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("DIP1:2") PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(FUNC(snk_state::snk_bonus_r<0x04>)) + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(FUNC(bermudat_state::snk_bonus_r<0x04>)) PORT_DIPNAME( 0x08, 0x08, DEF_STR( Lives ) ) PORT_DIPLOCATION("DIP1:4") PORT_DIPSETTING( 0x08, "3" ) PORT_DIPSETTING( 0x00, "5" ) @@ -3393,7 +3385,7 @@ static INPUT_PORTS_START( psychos ) PORT_DIPNAME( 0x08, 0x08, "Freeze" ) PORT_DIPLOCATION("DIP2:4") PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_BIT( 0x30, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(FUNC(snk_state::snk_bonus_r<0x30>)) + PORT_BIT( 0x30, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(FUNC(bermudat_state::snk_bonus_r<0x30>)) PORT_DIPNAME( 0x40, 0x00, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("DIP2:7") PORT_DIPSETTING( 0x40, DEF_STR( No ) ) PORT_DIPSETTING( 0x00, DEF_STR( Yes ) ) @@ -3414,7 +3406,7 @@ INPUT_PORTS_END static INPUT_PORTS_START( gwar ) PORT_START("IN0") - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(FUNC(snk_state::sound_busy_r)) + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(FUNC(gwar_state::sound_busy_r)) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE1 ) /* uses "Coin A" settings - code at 0x08c8 */ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_TILT ) /* reset */ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE ) @@ -3428,7 +3420,7 @@ static INPUT_PORTS_START( gwar ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1) PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1) - PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(FUNC(snk_state::gwar_rotary<0>)) + PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(FUNC(gwar_state::gwar_rotary<0>)) PORT_START("P1ROT") PORT_BIT( 0x0f, 0x00, IPT_POSITIONAL ) PORT_POSITIONS(12) PORT_WRAPS PORT_SENSITIVITY(15) PORT_KEYDELTA(1) PORT_CODE_DEC(KEYCODE_Z) PORT_CODE_INC(KEYCODE_X) PORT_REVERSE PORT_FULL_TURN_COUNT(12) @@ -3438,7 +3430,7 @@ static INPUT_PORTS_START( gwar ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2) PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2) - PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(FUNC(snk_state::gwar_rotary<1>)) + PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(FUNC(gwar_state::gwar_rotary<1>)) PORT_START("P2ROT") PORT_BIT( 0x0f, 0x00, IPT_POSITIONAL ) PORT_POSITIONS(12) PORT_WRAPS PORT_SENSITIVITY(15) PORT_KEYDELTA(1) PORT_CODE_DEC(KEYCODE_N) PORT_CODE_INC(KEYCODE_M) PORT_PLAYER(2) PORT_REVERSE PORT_FULL_TURN_COUNT(12) @@ -3460,7 +3452,7 @@ static INPUT_PORTS_START( gwar ) PORT_DIPNAME( 0x02, 0x02, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("DIP1:2") PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(FUNC(snk_state::snk_bonus_r<0x04>)) + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(FUNC(gwar_state::snk_bonus_r<0x04>)) PORT_DIPNAME( 0x08, 0x08, DEF_STR( Lives ) ) PORT_DIPLOCATION("DIP1:4") PORT_DIPSETTING( 0x08, "3" ) PORT_DIPSETTING( 0x00, "5" ) @@ -3486,7 +3478,7 @@ static INPUT_PORTS_START( gwar ) PORT_DIPSETTING( 0x08, "Demo Sounds On" ) PORT_DIPSETTING( 0x00, "Freeze" ) PORT_DIPSETTING( 0x04, "Infinite Lives (Cheat)") - PORT_BIT( 0x30, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(FUNC(snk_state::snk_bonus_r<0x30>)) + PORT_BIT( 0x30, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(FUNC(gwar_state::snk_bonus_r<0x30>)) PORT_DIPUNUSED_DIPLOC( 0x40, 0x40, "DSW2:7" ) PORT_DIPUNUSED_DIPLOC( 0x80, 0x80, "DSW2:8" ) @@ -3509,10 +3501,10 @@ static INPUT_PORTS_START( gwarb ) // connected. If rotary is not connected, player fires in the direction he's facing. PORT_MODIFY("IN1") - PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(FUNC(snk_state::gwarb_rotary<0>)) + PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(FUNC(gwarb_state::gwarb_rotary<0>)) PORT_MODIFY("IN2") - PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(FUNC(snk_state::gwarb_rotary<1>)) + PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(FUNC(gwarb_state::gwarb_rotary<1>)) PORT_START("JOYSTICK_MODE") PORT_CONFNAME( 0x01, 0x00, "Joystick mode" ) @@ -3523,7 +3515,7 @@ INPUT_PORTS_END static INPUT_PORTS_START( chopper ) PORT_START("IN0") - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(FUNC(snk_state::sound_busy_r)) + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(FUNC(bermudat_state::sound_busy_r)) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE1 ) /* uses "Coin A" settings - code at 0x0849 */ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_TILT ) /* reset */ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE ) @@ -3562,7 +3554,7 @@ static INPUT_PORTS_START( chopper ) PORT_DIPNAME( 0x02, 0x02, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("DIP1:2") PORT_DIPSETTING( 0x02, DEF_STR( Upright ) ) /* Single Controls */ PORT_DIPSETTING( 0x00, DEF_STR( Cocktail ) ) - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(FUNC(snk_state::snk_bonus_r<0x04>)) + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(FUNC(bermudat_state::snk_bonus_r<0x04>)) PORT_DIPNAME( 0x08, 0x08, DEF_STR( Lives ) ) PORT_DIPLOCATION("DIP1:4") PORT_DIPSETTING( 0x08, "3" ) PORT_DIPSETTING( 0x00, "5" ) @@ -3588,7 +3580,7 @@ static INPUT_PORTS_START( chopper ) PORT_DIPSETTING( 0x0c, "Demo Sounds On" ) PORT_DIPSETTING( 0x00, "Freeze" ) PORT_DIPSETTING( 0x04, "Infinite Lives (Cheat)") - PORT_BIT( 0x30, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(FUNC(snk_state::snk_bonus_r<0x30>)) + PORT_BIT( 0x30, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(FUNC(bermudat_state::snk_bonus_r<0x30>)) PORT_DIPNAME( 0x40, 0x40, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("DIP2:7") PORT_DIPSETTING( 0x00, DEF_STR( No ) ) PORT_DIPSETTING( 0x40, DEF_STR( Yes ) ) @@ -3644,7 +3636,7 @@ static INPUT_PORTS_START( tdfever ) PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE ) /* also reset - code at 0x074a */ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 ) /* adds 1 credit - code at 0x1065 */ - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(FUNC(snk_state::sound_busy_r)) + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(FUNC(bermudat_state::sound_busy_r)) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START1 ) PORT_NAME("Start Game A") @@ -3786,7 +3778,7 @@ static INPUT_PORTS_START( fsoccer ) PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE ) /* same as the dip switch / also reset - code at 0x00cc */ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 ) /* uses "Coin A" settings - code at 0x677f */ - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(FUNC(snk_state::sound_busy_r)) + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(FUNC(bermudat_state::sound_busy_r)) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START1 ) PORT_NAME("Start Game A") @@ -3934,18 +3926,6 @@ INPUT_PORTS_END /*********************************************************************/ -static const gfx_layout tilelayout_4bpp = -{ - 16,16, - RGN_FRAC(1,1), - 4, - { STEP4(0,1) }, - { 4*1, 4*0, 4*3, 4*2, 4*5, 4*4, 4*7, 4*6, - 32+4*1, 32+4*0, 32+4*3, 32+4*2, 32+4*5, 32+4*4, 32+4*7, 32+4*6 }, - { STEP16(0,4*16) }, - 64*16 -}; - static const gfx_layout spritelayout_3bpp = { 16,16, @@ -4008,44 +3988,44 @@ static GFXDECODE_START( gfx_tnk3 ) GFXDECODE_END static GFXDECODE_START( gfx_ikari ) - GFXDECODE_ENTRY( "tx_tiles", 0, gfx_8x8x4_packed_lsb, 0x180, 0x080>>4 ) - GFXDECODE_ENTRY( "bg_tiles", 0, tilelayout_4bpp, 0x100, 0x080>>4 ) - GFXDECODE_ENTRY( "sp16_tiles", 0, spritelayout_3bpp, 0x000, 0x080>>3 ) - GFXDECODE_ENTRY( "sp32_tiles", 0, bigspritelayout_3bpp, 0x080, 0x080>>3 ) + GFXDECODE_ENTRY( "tx_tiles", 0, gfx_8x8x4_packed_lsb, 0x180, 0x080>>4 ) + GFXDECODE_ENTRY( "bg_tiles", 0, gfx_16x16x4_packed_lsb, 0x100, 0x080>>4 ) + GFXDECODE_ENTRY( "sp16_tiles", 0, spritelayout_3bpp, 0x000, 0x080>>3 ) + GFXDECODE_ENTRY( "sp32_tiles", 0, bigspritelayout_3bpp, 0x080, 0x080>>3 ) /* colors 0x200-0x3ff contain shadows */ GFXDECODE_END static GFXDECODE_START( gfx_gwar ) - GFXDECODE_ENTRY( "tx_tiles", 0, gfx_8x8x4_packed_lsb, 0x000, 0x100>>4 ) - GFXDECODE_ENTRY( "bg_tiles", 0, tilelayout_4bpp, 0x300, 0x100>>4 ) - GFXDECODE_ENTRY( "sp16_tiles", 0, spritelayout_4bpp, 0x100, 0x100>>4 ) - GFXDECODE_ENTRY( "sp32_tiles", 0, bigspritelayout_4bpp, 0x200, 0x100>>4 ) + GFXDECODE_ENTRY( "tx_tiles", 0, gfx_8x8x4_packed_lsb, 0x000, 0x100>>4 ) + GFXDECODE_ENTRY( "bg_tiles", 0, gfx_16x16x4_packed_lsb, 0x300, 0x100>>4 ) + GFXDECODE_ENTRY( "sp16_tiles", 0, spritelayout_4bpp, 0x100, 0x100>>4 ) + GFXDECODE_ENTRY( "sp32_tiles", 0, bigspritelayout_4bpp, 0x200, 0x100>>4 ) GFXDECODE_END static GFXDECODE_START( gfx_tdfever ) - GFXDECODE_ENTRY( "tx_tiles", 0, gfx_8x8x4_packed_lsb, 0x000, 0x100>>4 ) - GFXDECODE_ENTRY( "bg_tiles", 0, tilelayout_4bpp, 0x200, 0x100>>4 ) - GFXDECODE_ENTRY( "sp32_tiles", 0, bigspritelayout_4bpp, 0x100, 0x100>>4 ) + GFXDECODE_ENTRY( "tx_tiles", 0, gfx_8x8x4_packed_lsb, 0x000, 0x100>>4 ) + GFXDECODE_ENTRY( "bg_tiles", 0, gfx_16x16x4_packed_lsb, 0x200, 0x100>>4 ) + GFXDECODE_ENTRY( "sp32_tiles", 0, bigspritelayout_4bpp, 0x100, 0x100>>4 ) /* colors 0x300-0x3ff contain shadows */ GFXDECODE_END /**********************************************************************/ -void snk_state::marvins(machine_config &config) +void marvins_state::marvins(machine_config &config) { /* basic machine hardware */ Z80(config, m_maincpu, 3360000); // 3.36 MHz - m_maincpu->set_addrmap(AS_PROGRAM, &snk_state::marvins_cpuA_map); - m_maincpu->set_vblank_int("screen", FUNC(snk_state::irq0_line_hold)); + m_maincpu->set_addrmap(AS_PROGRAM, &marvins_state::marvins_cpuA_map); + m_maincpu->set_vblank_int("screen", FUNC(marvins_state::irq0_line_hold)); Z80(config, m_subcpu, 3360000); // 3.36 MHz - m_subcpu->set_addrmap(AS_PROGRAM, &snk_state::marvins_cpuB_map); - m_subcpu->set_vblank_int("screen", FUNC(snk_state::irq0_line_hold)); + m_subcpu->set_addrmap(AS_PROGRAM, &marvins_state::marvins_cpuB_map); + m_subcpu->set_vblank_int("screen", FUNC(marvins_state::irq0_line_hold)); Z80(config, m_audiocpu, 8_MHz_XTAL/2); // verified on schematics - m_audiocpu->set_addrmap(AS_PROGRAM, &snk_state::marvins_sound_map); - m_audiocpu->set_addrmap(AS_IO, &snk_state::marvins_sound_portmap); - m_audiocpu->set_periodic_int(FUNC(snk_state::nmi_line_assert), attotime::from_ticks(0x4000, 8_MHz_XTAL/2)); // 244Hz + m_audiocpu->set_addrmap(AS_PROGRAM, &marvins_state::marvins_sound_map); + m_audiocpu->set_addrmap(AS_IO, &marvins_state::marvins_sound_portmap); + m_audiocpu->set_periodic_int(FUNC(marvins_state::nmi_line_assert), attotime::from_ticks(0x4000, 8_MHz_XTAL/2)); // 244Hz config.set_maximum_quantum(attotime::from_hz(6000)); @@ -4054,16 +4034,14 @@ void snk_state::marvins(machine_config &config) m_screen->set_refresh_hz(60); m_screen->set_size(36*8, 28*8); m_screen->set_visarea(0*8, 36*8-1, 1*8, 28*8-1); - m_screen->set_screen_update(FUNC(snk_state::screen_update_marvins)); + m_screen->set_screen_update(FUNC(marvins_state::screen_update_marvins)); m_screen->set_palette(m_palette); GFXDECODE(config, m_gfxdecode, m_palette, gfx_marvins); - PALETTE(config, m_palette, FUNC(snk_state::tnk3_palette), 0x400); + PALETTE(config, m_palette, FUNC(marvins_state::tnk3_palette), 0x400); m_palette->enable_shadows(); - MCFG_VIDEO_START_OVERRIDE(snk_state,marvins) - /* sound hardware */ SPEAKER(config, "mono").front_center(); @@ -4075,22 +4053,22 @@ void snk_state::marvins(machine_config &config) SNKWAVE(config, "wave", 8_MHz_XTAL).add_route(ALL_OUTPUTS, "mono", 0.30); // verified on schematics } -void snk_state::vangrd2(machine_config &config) +void marvins_state::vangrd2(machine_config &config) { marvins(config); /* basic machine hardware */ - m_maincpu->set_addrmap(AS_PROGRAM, &snk_state::madcrash_cpuA_map); - m_subcpu->set_addrmap(AS_PROGRAM, &snk_state::madcrash_cpuB_map); + m_maincpu->set_addrmap(AS_PROGRAM, &marvins_state::madcrash_cpuA_map); + m_subcpu->set_addrmap(AS_PROGRAM, &marvins_state::madcrash_cpuB_map); } -void snk_state::madcrush(machine_config &config) +void marvins_state::madcrush(machine_config &config) { marvins(config); /* basic machine hardware */ - m_maincpu->set_addrmap(AS_PROGRAM, &snk_state::madcrush_cpuA_map); - m_subcpu->set_addrmap(AS_PROGRAM, &snk_state::madcrush_cpuB_map); + m_maincpu->set_addrmap(AS_PROGRAM, &marvins_state::madcrush_cpuA_map); + m_subcpu->set_addrmap(AS_PROGRAM, &marvins_state::madcrush_cpuB_map); } void snk_state::jcross(machine_config &config) @@ -4159,7 +4137,7 @@ void snk_state::hal21(machine_config &config) m_subcpu->set_addrmap(AS_PROGRAM, &snk_state::hal21_cpuB_map); m_audiocpu->set_addrmap(AS_PROGRAM, &snk_state::hal21_sound_map); - m_audiocpu->set_addrmap(AS_IO, &snk_state::hal21_sound_portmap); + m_audiocpu->set_addrmap(AS_IO, &snk_state::marvins_sound_portmap); m_audiocpu->set_periodic_int(FUNC(snk_state::irq0_line_hold), attotime::from_hz(220)); // music tempo, hand tuned /* video hardware */ @@ -4253,25 +4231,25 @@ void snk_state::fitegolf2(machine_config &config) m_screen->set_screen_update(FUNC(snk_state::screen_update_fitegolf2)); } -void snk_state::countryc(machine_config &config) +void countryc_state::countryc(machine_config &config) { fitegolf(config); - m_maincpu->set_addrmap(AS_PROGRAM, &snk_state::countryc_cpuA_map); + m_maincpu->set_addrmap(AS_PROGRAM, &countryc_state::countryc_cpuA_map); } -void snk_state::ikari(machine_config &config) +void ikari_state::ikari(machine_config &config) { /* basic machine hardware */ Z80(config, m_maincpu, 13.4_MHz_XTAL/4); /* verified on pcb */ - m_maincpu->set_addrmap(AS_PROGRAM, &snk_state::ikari_cpuA_map); - m_maincpu->set_vblank_int("screen", FUNC(snk_state::irq0_line_hold)); + m_maincpu->set_addrmap(AS_PROGRAM, &ikari_state::ikari_cpuA_map); + m_maincpu->set_vblank_int("screen", FUNC(ikari_state::irq0_line_hold)); Z80(config, m_subcpu, 13.4_MHz_XTAL/4); /* verified on pcb */ - m_subcpu->set_addrmap(AS_PROGRAM, &snk_state::ikari_cpuB_map); - m_subcpu->set_vblank_int("screen", FUNC(snk_state::irq0_line_hold)); + m_subcpu->set_addrmap(AS_PROGRAM, &ikari_state::ikari_cpuB_map); + m_subcpu->set_vblank_int("screen", FUNC(ikari_state::irq0_line_hold)); Z80(config, m_audiocpu, 8_MHz_XTAL/2); /* verified on pcb */ - m_audiocpu->set_addrmap(AS_PROGRAM, &snk_state::YM3526_YM3526_sound_map); + m_audiocpu->set_addrmap(AS_PROGRAM, &ikari_state::YM3526_YM3526_sound_map); config.set_maximum_quantum(attotime::from_hz(6000)); @@ -4280,55 +4258,53 @@ void snk_state::ikari(machine_config &config) m_screen->set_refresh_hz(60); m_screen->set_size(36*8, 28*8); m_screen->set_visarea(0*8, 36*8-1, 1*8, 28*8-1); - m_screen->set_screen_update(FUNC(snk_state::screen_update_ikari)); + m_screen->set_screen_update(FUNC(ikari_state::screen_update_ikari)); m_screen->set_palette(m_palette); GFXDECODE(config, m_gfxdecode, m_palette, gfx_ikari); PALETTE(config, m_palette, palette_device::RGB_444_PROMS, "proms", 0x400); m_palette->enable_shadows(); - MCFG_VIDEO_START_OVERRIDE(snk_state,ikari) - /* sound hardware */ SPEAKER(config, "mono").front_center(); GENERIC_LATCH_8(config, m_soundlatch); ym3526_device &ym1(YM3526(config, "ym1", 8_MHz_XTAL/2)); /* verified on pcb */ - ym1.irq_handler().set(FUNC(snk_state::ymirq_callback_1)); + ym1.irq_handler().set(FUNC(ikari_state::ymirq_callback_1)); ym1.add_route(ALL_OUTPUTS, "mono", 2.0); ym3526_device &ym2(YM3526(config, "ym2", 8_MHz_XTAL/2)); /* verified on pcb */ - ym2.irq_handler().set(FUNC(snk_state::ymirq_callback_2)); + ym2.irq_handler().set(FUNC(ikari_state::ymirq_callback_2)); ym2.add_route(ALL_OUTPUTS, "mono", 2.0); } -void snk_state::victroad(machine_config &config) +void ikari_state::victroad(machine_config &config) { ikari(config); /* basic machine hardware */ - m_audiocpu->set_addrmap(AS_PROGRAM, &snk_state::YM3526_Y8950_sound_map); + m_audiocpu->set_addrmap(AS_PROGRAM, &ikari_state::YM3526_Y8950_sound_map); /* sound hardware */ y8950_device &ym2(Y8950(config.replace(), "ym2", 8_MHz_XTAL/2)); /* verified on pcb */ - ym2.irq_handler().set(FUNC(snk_state::ymirq_callback_2)); + ym2.irq_handler().set(FUNC(ikari_state::ymirq_callback_2)); ym2.add_route(ALL_OUTPUTS, "mono", 2.0); } -void snk_state::bermudat(machine_config &config) +void bermudat_state::bermudat(machine_config &config) { /* basic machine hardware */ Z80(config, m_maincpu, 8_MHz_XTAL/2); /* verified on pcb */ - m_maincpu->set_addrmap(AS_PROGRAM, &snk_state::bermudat_cpuA_map); - m_maincpu->set_vblank_int("screen", FUNC(snk_state::irq0_line_hold)); + m_maincpu->set_addrmap(AS_PROGRAM, &bermudat_state::bermudat_cpuA_map); + m_maincpu->set_vblank_int("screen", FUNC(bermudat_state::irq0_line_hold)); Z80(config, m_subcpu, 8_MHz_XTAL/2); /* verified on pcb */ - m_subcpu->set_addrmap(AS_PROGRAM, &snk_state::bermudat_cpuB_map); - m_subcpu->set_vblank_int("screen", FUNC(snk_state::irq0_line_hold)); + m_subcpu->set_addrmap(AS_PROGRAM, &bermudat_state::bermudat_cpuB_map); + m_subcpu->set_vblank_int("screen", FUNC(bermudat_state::irq0_line_hold)); Z80(config, m_audiocpu, 8_MHz_XTAL/2); /* verified on pcb */ - m_audiocpu->set_addrmap(AS_PROGRAM, &snk_state::YM3526_Y8950_sound_map); + m_audiocpu->set_addrmap(AS_PROGRAM, &bermudat_state::YM3526_Y8950_sound_map); config.set_maximum_quantum(attotime::from_hz(24000)); @@ -4338,13 +4314,13 @@ void snk_state::bermudat(machine_config &config) // this visible area matches the psychos pcb m_screen->set_size(50*8, 28*8); m_screen->set_visarea(0*8, 50*8-1, 0*8, 28*8-1); - m_screen->set_screen_update(FUNC(snk_state::screen_update_gwar)); + m_screen->set_screen_update(FUNC(bermudat_state::screen_update_gwar)); m_screen->set_palette(m_palette); GFXDECODE(config, m_gfxdecode, m_palette, gfx_gwar); PALETTE(config, m_palette, palette_device::RGB_444_PROMS, "proms", 0x400); - MCFG_VIDEO_START_OVERRIDE(snk_state,gwar) + MCFG_VIDEO_START_OVERRIDE(bermudat_state,gwar) /* sound hardware */ SPEAKER(config, "mono").front_center(); @@ -4352,66 +4328,66 @@ void snk_state::bermudat(machine_config &config) GENERIC_LATCH_8(config, m_soundlatch); ym3526_device &ym1(YM3526(config, "ym1", 8_MHz_XTAL/2)); /* verified on pcb */ - ym1.irq_handler().set(FUNC(snk_state::ymirq_callback_1)); + ym1.irq_handler().set(FUNC(bermudat_state::ymirq_callback_1)); ym1.add_route(ALL_OUTPUTS, "mono", 2.0); y8950_device &ym2(Y8950(config, "ym2", 8_MHz_XTAL/2)); /* verified on pcb */ - ym2.irq_handler().set(FUNC(snk_state::ymirq_callback_2)); + ym2.irq_handler().set(FUNC(bermudat_state::ymirq_callback_2)); ym2.add_route(ALL_OUTPUTS, "mono", 2.0); } -void snk_state::psychos(machine_config &config) +void bermudat_state::psychos(machine_config &config) { bermudat(config); - MCFG_VIDEO_START_OVERRIDE(snk_state,psychos) + MCFG_VIDEO_START_OVERRIDE(bermudat_state,psychos) } -void snk_state::gwar(machine_config &config) +void gwar_state::gwar(machine_config &config) { bermudat(config); // Note: XTAL is 16MHz on Guerilla War video PCB with divider 16/4 - m_maincpu->set_addrmap(AS_PROGRAM, &snk_state::gwar_cpuA_map); - m_subcpu->set_addrmap(AS_PROGRAM, &snk_state::gwar_cpuB_map); + m_maincpu->set_addrmap(AS_PROGRAM, &gwar_state::gwar_cpuA_map); + m_subcpu->set_addrmap(AS_PROGRAM, &gwar_state::gwar_cpuB_map); } -void snk_state::gwara(machine_config &config) +void gwar_state::gwara(machine_config &config) { bermudat(config); - m_maincpu->set_addrmap(AS_PROGRAM, &snk_state::gwara_cpuA_map); - m_subcpu->set_addrmap(AS_PROGRAM, &snk_state::gwara_cpuB_map); + m_maincpu->set_addrmap(AS_PROGRAM, &gwar_state::gwara_cpuA_map); + m_subcpu->set_addrmap(AS_PROGRAM, &gwar_state::gwara_cpuB_map); } -void snk_state::chopper1(machine_config &config) +void bermudat_state::chopper1(machine_config &config) { bermudat(config); - m_subcpu->set_addrmap(AS_PROGRAM, &snk_state::gwar_cpuB_map); - m_audiocpu->set_addrmap(AS_PROGRAM, &snk_state::YM3812_Y8950_sound_map); + m_subcpu->set_addrmap(AS_PROGRAM, &bermudat_state::gwar_cpuB_map); + m_audiocpu->set_addrmap(AS_PROGRAM, &bermudat_state::chopper1_sound_map); /* sound hardware */ ym3812_device &ym1(YM3812(config.replace(), "ym1", 4000000)); - ym1.irq_handler().set(FUNC(snk_state::ymirq_callback_1)); + ym1.irq_handler().set(FUNC(bermudat_state::ymirq_callback_1)); ym1.add_route(ALL_OUTPUTS, "mono", 1.0); } -void snk_state::choppera(machine_config &config) +void bermudat_state::choppera(machine_config &config) { chopper1(config); - m_maincpu->set_addrmap(AS_PROGRAM, &snk_state::gwar_cpuA_map); + m_maincpu->set_addrmap(AS_PROGRAM, &bermudat_state::gwar_cpuA_map); } -void snk_state::tdfever(machine_config &config) +void bermudat_state::tdfever(machine_config &config) { /* basic machine hardware */ Z80(config, m_maincpu, 4000000); - m_maincpu->set_addrmap(AS_PROGRAM, &snk_state::tdfever_cpuA_map); - m_maincpu->set_vblank_int("screen", FUNC(snk_state::irq0_line_hold)); + m_maincpu->set_addrmap(AS_PROGRAM, &bermudat_state::tdfever_cpuA_map); + m_maincpu->set_vblank_int("screen", FUNC(bermudat_state::irq0_line_hold)); Z80(config, m_subcpu, 4000000); - m_subcpu->set_addrmap(AS_PROGRAM, &snk_state::tdfever_cpuB_map); - m_subcpu->set_vblank_int("screen", FUNC(snk_state::irq0_line_hold)); + m_subcpu->set_addrmap(AS_PROGRAM, &bermudat_state::tdfever_cpuB_map); + m_subcpu->set_vblank_int("screen", FUNC(bermudat_state::irq0_line_hold)); Z80(config, m_audiocpu, 4000000); - m_audiocpu->set_addrmap(AS_PROGRAM, &snk_state::YM3526_Y8950_sound_map); + m_audiocpu->set_addrmap(AS_PROGRAM, &bermudat_state::YM3526_Y8950_sound_map); config.set_maximum_quantum(attotime::from_hz(6000)); @@ -4420,13 +4396,13 @@ void snk_state::tdfever(machine_config &config) m_screen->set_refresh_hz(60); m_screen->set_size(50*8, 28*8); m_screen->set_visarea(0*8, 50*8-1, 0*8, 28*8-1); - m_screen->set_screen_update(FUNC(snk_state::screen_update_tdfever)); + m_screen->set_screen_update(FUNC(bermudat_state::screen_update_tdfever)); m_screen->set_palette(m_palette); GFXDECODE(config, m_gfxdecode, m_palette, gfx_tdfever); PALETTE(config, m_palette, palette_device::RGB_444_PROMS, "proms", 0x400).enable_shadows(); - MCFG_VIDEO_START_OVERRIDE(snk_state,tdfever) + MCFG_VIDEO_START_OVERRIDE(bermudat_state,tdfever) /* sound hardware */ SPEAKER(config, "mono").front_center(); @@ -4434,20 +4410,20 @@ void snk_state::tdfever(machine_config &config) GENERIC_LATCH_8(config, m_soundlatch); ym3526_device &ym1(YM3526(config, "ym1", 4000000)); - ym1.irq_handler().set(FUNC(snk_state::ymirq_callback_1)); + ym1.irq_handler().set(FUNC(bermudat_state::ymirq_callback_1)); ym1.add_route(ALL_OUTPUTS, "mono", 1.0); y8950_device &ym2(Y8950(config, "ym2", 4000000)); - ym2.irq_handler().set(FUNC(snk_state::ymirq_callback_2)); + ym2.irq_handler().set(FUNC(bermudat_state::ymirq_callback_2)); ym2.add_route(ALL_OUTPUTS, "mono", 1.0); } -void snk_state::tdfever2(machine_config &config) +void bermudat_state::tdfever2(machine_config &config) { tdfever(config); /* basic machine hardware */ - m_audiocpu->set_addrmap(AS_PROGRAM, &snk_state::Y8950_sound_map); + m_audiocpu->set_addrmap(AS_PROGRAM, &bermudat_state::tdfever2_sound_map); /* sound hardware */ @@ -5005,7 +4981,7 @@ ROM_START( tnk3 ) ROM_REGION( 0x4000, "tx_tiles", 0 ) ROM_LOAD( "p14.1e", 0x0000, 0x2000, CRC(1fd18c43) SHA1(611b5aa97df84c0117681772deb006f32a899ad3) ) - ROM_RELOAD( 0x2000, 0x2000 ) + ROM_RELOAD( 0x2000, 0x2000 ) ROM_REGION( 0x8000, "bg_tiles", 0 ) ROM_LOAD( "p12.3d", 0x0000, 0x4000, CRC(ff495a16) SHA1(e6b97a63efe58018260ff34f0ea4edc81718cb14) ) @@ -5376,13 +5352,13 @@ Video board: A5004UP01-02 ROM_START( ikari ) ROM_REGION( 0x10000, "maincpu", 0 ) - ROM_LOAD( "1.4p", 0x0000, 0x10000, CRC(52a8b2dd) SHA1(a896387d68ed9a55c313bdb81acdf8d68b7a1264) ) + ROM_LOAD( "1.4p", 0x00000, 0x10000, CRC(52a8b2dd) SHA1(a896387d68ed9a55c313bdb81acdf8d68b7a1264) ) ROM_REGION( 0x10000, "sub", 0 ) - ROM_LOAD( "2.8p", 0x0000, 0x10000, CRC(45364d55) SHA1(323b998f782a4681ceb18016c5fb0fa1d6361aac) ) + ROM_LOAD( "2.8p", 0x00000, 0x10000, CRC(45364d55) SHA1(323b998f782a4681ceb18016c5fb0fa1d6361aac) ) ROM_REGION( 0x10000, "audiocpu", 0 ) - ROM_LOAD( "3.7k", 0x0000, 0x10000, CRC(56a26699) SHA1(e9ccb27f1e711e4648fdfe3c7ff956038d3e101c) ) + ROM_LOAD( "3.7k", 0x00000, 0x10000, CRC(56a26699) SHA1(e9ccb27f1e711e4648fdfe3c7ff956038d3e101c) ) // Sockets at 5g and 6e are empty ROM_REGION( 0x0c00, "proms", 0 ) // MB7122 or 82S137 or 63S441 @@ -5716,7 +5692,7 @@ Video board: A5004UP01-02 ROM_START( victroad ) ROM_REGION( 0x10000, "maincpu", 0 ) - ROM_LOAD( "p1.4p", 0x0000, 0x10000, CRC(e334acef) SHA1(f6d8da554276abbe5579c92eea46591a92623f6e) ) + ROM_LOAD( "p1.4p", 0x00000, 0x10000, CRC(e334acef) SHA1(f6d8da554276abbe5579c92eea46591a92623f6e) ) ROM_REGION( 0x10000 , "sub", 0 ) ROM_LOAD( "p2.8p", 0x00000, 0x10000, CRC(907fac83) SHA1(691d95f95ef7a308c7f5e7defb20971b54423745) ) @@ -5768,7 +5744,7 @@ ROM_END ROM_START( dogosoke ) ROM_REGION( 0x10000, "maincpu", 0 ) - ROM_LOAD( "p1.4p", 0x0000, 0x10000, CRC(37867ad2) SHA1(4444e428eb7126451f34351b1a2bc193484ca641) ) + ROM_LOAD( "p1.4p", 0x00000, 0x10000, CRC(37867ad2) SHA1(4444e428eb7126451f34351b1a2bc193484ca641) ) ROM_REGION( 0x10000, "sub", 0 ) ROM_LOAD( "p2.8p", 0x00000, 0x10000, CRC(907fac83) SHA1(691d95f95ef7a308c7f5e7defb20971b54423745) ) @@ -5871,7 +5847,7 @@ Video board: A6004UP01-01 ROM_START( bermudat ) ROM_REGION( 0x10000, "maincpu", 0 ) - ROM_LOAD( "p1.4p", 0x0000, 0x10000, CRC(43dec5e9) SHA1(2b29016d4af2a0a6be87f440f235a6a76f8a52a0) ) + ROM_LOAD( "p1.4p", 0x00000, 0x10000, CRC(43dec5e9) SHA1(2b29016d4af2a0a6be87f440f235a6a76f8a52a0) ) ROM_REGION( 0x10000, "sub", 0 ) ROM_LOAD( "p2.8p", 0x00000, 0x10000, CRC(0e193265) SHA1(765ad63d1f752920d3d7829747e8f2808670ee84) ) @@ -5924,7 +5900,7 @@ ROM_END ROM_START( bermudatj ) ROM_REGION( 0x10000, "maincpu", 0 ) - ROM_LOAD( "p1.4p", 0x0000, 0x10000, CRC(eda75f36) SHA1(d6fcb46dc45007a77bf6a8ca7aa53aefedcecf92) ) + ROM_LOAD( "p1.4p", 0x00000, 0x10000, CRC(eda75f36) SHA1(d6fcb46dc45007a77bf6a8ca7aa53aefedcecf92) ) ROM_REGION( 0x10000, "sub", 0 ) ROM_LOAD( "p2.8p", 0x00000, 0x10000, CRC(0e193265) SHA1(765ad63d1f752920d3d7829747e8f2808670ee84) ) @@ -5977,7 +5953,7 @@ ROM_END ROM_START( worldwar ) ROM_REGION( 0x10000, "maincpu", 0 ) - ROM_LOAD( "ww4.4p", 0x0000, 0x10000, CRC(bc29d09f) SHA1(9bd5a47565934590347b7152457869331ae94375) ) + ROM_LOAD( "ww4.4p", 0x00000, 0x10000, CRC(bc29d09f) SHA1(9bd5a47565934590347b7152457869331ae94375) ) ROM_REGION( 0x10000, "sub", 0 ) ROM_LOAD( "ww5.8p", 0x00000, 0x10000, CRC(8dc15909) SHA1(dc0f0e969c36469cc91ecfb1a98cfdb1020972eb) ) @@ -6030,7 +6006,7 @@ ROM_END ROM_START( bermudata ) // Bermuda Triangle title, World Wars game. No YM ROMs (no speech). ROM_REGION( 0x10000, "maincpu", 0 ) - ROM_LOAD( "wwu4.4p", 0x0000, 0x10000, CRC(4de39d01) SHA1(4312660c6658079c2d148c07d24f741804f3e45c) ) + ROM_LOAD( "wwu4.4p", 0x00000, 0x10000, CRC(4de39d01) SHA1(4312660c6658079c2d148c07d24f741804f3e45c) ) ROM_REGION( 0x10000, "sub", 0 ) ROM_LOAD( "wwu5.8p", 0x00000, 0x10000, CRC(76158e94) SHA1(221e59b3fd87c6193755753d6ac6a96807e23120) ) @@ -6099,7 +6075,7 @@ ROM_START( psychos ) ROM_LOAD( "ps6.8m", 0x00000, 0x10000, CRC(5f426ddb) SHA1(d4b2215122b23066ba2b231992f0f27057259ded) ) ROM_REGION( 0x10000, "audiocpu", 0 ) - ROM_LOAD( "ps5.6j", 0x0000, 0x10000, CRC(64503283) SHA1(e380164ac4268eda1d9ca2404b3dddc5fd3f9dcc) ) + ROM_LOAD( "ps5.6j", 0x00000, 0x10000, CRC(64503283) SHA1(e380164ac4268eda1d9ca2404b3dddc5fd3f9dcc) ) ROM_REGION( 0x1400, "proms", 0 ) // MB7122 or 82S137 or 63S441 ROM_LOAD( "psc1.1k", 0x0000, 0x400, CRC(27b8ca8c) SHA1(a2dbc22ca10c2c2c874bf766fe64981f9be75aba) ) // red @@ -6142,7 +6118,7 @@ ROM_END ROM_START( psychosj ) ROM_REGION( 0x10000, "maincpu", 0 ) - ROM_LOAD( "ps7.4m", 0x0000, 0x10000, CRC(05dfb409) SHA1(e6c378c86689c7ab9190908c8e4aa2d4563c3774) ) + ROM_LOAD( "ps7.4m", 0x00000, 0x10000, CRC(05dfb409) SHA1(e6c378c86689c7ab9190908c8e4aa2d4563c3774) ) ROM_REGION( 0x10000, "sub", 0 ) ROM_LOAD( "ps6.8m", 0x00000, 0x10000, CRC(5f426ddb) SHA1(d4b2215122b23066ba2b231992f0f27057259ded) ) @@ -6851,7 +6827,7 @@ Video board: A6006UP01-03 ROM_START( tdfever ) ROM_REGION( 0x10000, "maincpu", 0 ) - ROM_LOAD( "td2-ver3u.6c", 0x0000, 0x10000, CRC(92138fe4) SHA1(17a2bc12f516cdbea3cc5e283b0a8a2d101dfa47) ) // Red "U" stamped on label + ROM_LOAD( "td2-ver3u.6c", 0x00000, 0x10000, CRC(92138fe4) SHA1(17a2bc12f516cdbea3cc5e283b0a8a2d101dfa47) ) // Red "U" stamped on label ROM_REGION( 0x10000, "sub", 0 ) ROM_LOAD( "td1-ver3u.2c", 0x00000, 0x10000, CRC(798711f5) SHA1(a67d6b71c08df00592cf1a18806ed1c2ee757066) ) // Red "U" stamped on label @@ -6891,7 +6867,7 @@ ROM_END ROM_START( tdfeverj ) ROM_REGION( 0x10000, "maincpu", 0 ) - ROM_LOAD( "td2.6c", 0x0000, 0x10000, CRC(88d88ec4) SHA1(774de920290b5c787b0f3d0076883dda106364be) ) + ROM_LOAD( "td2.6c", 0x00000, 0x10000, CRC(88d88ec4) SHA1(774de920290b5c787b0f3d0076883dda106364be) ) ROM_REGION( 0x10000, "sub", 0 ) ROM_LOAD( "td1.2c", 0x00000, 0x10000, CRC(191e6442) SHA1(6a4d0d7efea734443eef538e99562ce4e2949a84) ) @@ -7034,63 +7010,63 @@ ROM_END // TODO: according to Kold at very least Athena is ROT180 not ROT0 -GAME( 1983, marvins, 0, marvins, marvins, snk_state, empty_init, ROT270, "SNK", "Marvin's Maze", 0 ) -GAME( 1984, vangrd2, 0, vangrd2, vangrd2, snk_state, empty_init, ROT270, "SNK", "Vanguard II", 0 ) -GAME( 1984, madcrash, 0, vangrd2, madcrash, snk_state, empty_init, ROT0, "SNK", "Mad Crasher", 0 ) -GAME( 1984, madcrush, madcrash, madcrush, madcrash, snk_state, empty_init, ROT0, "SNK", "Mad Crusher (Japan)", 0 ) - -GAME( 1984, jcross, 0, jcross, jcross, snk_state, empty_init, ROT270, "SNK", "Jumping Cross (set 1)", 0 ) -GAME( 1984, jcrossa, jcross, jcross, jcross, snk_state, empty_init, ROT270, "SNK", "Jumping Cross (set 2)", 0 ) -GAME( 1984, sgladiat, 0, sgladiat, sgladiat, snk_state, empty_init, ROT0, "SNK", "Gladiator 1984", 0 ) -GAME( 1985, hal21, 0, hal21, hal21, snk_state, empty_init, ROT270, "SNK", "HAL21", 0 ) -GAME( 1985, hal21j, hal21, hal21, hal21, snk_state, empty_init, ROT270, "SNK", "HAL21 (Japan)", 0 ) - -GAME( 1985, aso, 0, aso, aso, snk_state, empty_init, ROT270, "SNK", "ASO - Armored Scrum Object", 0 ) -GAME( 1985, alphamis, aso, aso, alphamis, snk_state, empty_init, ROT270, "SNK", "Alpha Mission", 0 ) -GAME( 1985, arian, aso, aso, alphamis, snk_state, empty_init, ROT270, "SNK", "Arian Mission", 0 ) -GAME( 1985, tnk3, 0, tnk3, tnk3, snk_state, empty_init, ROT270, "SNK", "T.N.K III (US)", 0 ) -GAME( 1985, tnk3j, tnk3, tnk3, tnk3, snk_state, empty_init, ROT270, "SNK", "T.A.N.K (Japan)", 0 ) -GAME( 1985, tnk3b, tnk3, tnk3, tnk3b, snk_state, empty_init, ROT270, "SNK", "T.A.N.K (bootleg, 8-way joystick)", 0 ) -GAME( 1986, athena, 0, athena, athena, snk_state, empty_init, ROT0, "SNK", "Athena", 0 ) -GAME( 1986, athenab, athena, athena, athena, snk_state, empty_init, ROT0, "SNK", "Athena (bootleg)", 0 ) // is this really a bootleg? -GAME( 1987, sathena, athena, athena, athena, snk_state, empty_init, ROT0, "bootleg", "Super Athena (bootleg)", 0 ) -GAME( 1988, fitegolf, 0, fitegolf, fitegolf, snk_state, empty_init, ROT0, "SNK", "Lee Trevino's Fighting Golf (World?)", 0 ) -GAME( 1988, fitegolfu, fitegolf, fitegolf, fitegolfu, snk_state, empty_init, ROT0, "SNK", "Lee Trevino's Fighting Golf (US, Ver 2, set 1)", 0 ) -GAME( 1988, fitegolfua,fitegolf, fitegolf2, fitegolfu, snk_state, empty_init, ROT0, "SNK", "Lee Trevino's Fighting Golf (US, Ver 2, set 2)", 0 ) -GAME( 1988, countryc, 0, countryc, countryc, snk_state, empty_init, ROT0, "SNK", "Country Club", 0 ) - -GAME( 1986, ikari, 0, ikari, ikari, snk_state, empty_init, ROT270, "SNK", "Ikari Warriors (US JAMMA)", 0 ) // distributed by Tradewest(?) -GAME( 1986, ikaria, ikari, ikari, ikaria, snk_state, empty_init, ROT270, "SNK", "Ikari Warriors (US, set 1)", 0 ) // distributed by Tradewest(?) -GAME( 1986, ikaria2, ikari, ikari, ikaria, snk_state, empty_init, ROT270, "SNK", "Ikari Warriors (US, set 2)", 0 ) // distributed by Tradewest(?) -GAME( 1986, ikarinc, ikari, ikari, ikarinc, snk_state, empty_init, ROT270, "SNK", "Ikari Warriors (US No Continues)", 0 ) // distributed by Tradewest(?) -GAME( 1986, ikarijp, ikari, ikari, ikarinc, snk_state, empty_init, ROT270, "SNK", "Ikari (Japan No Continues)", 0 ) -GAME( 1986, ikarijpb, ikari, ikari, ikarijpb, snk_state, empty_init, ROT270, "bootleg", "Ikari (Joystick hack bootleg)", 0 ) -GAME( 1986, ikariram, ikari, ikari, ikarijpb, snk_state, empty_init, ROT270, "bootleg", "Rambo 3 (bootleg of Ikari, Joystick hack)", 0 ) -GAME( 1986, victroad, 0, victroad, victroad, snk_state, empty_init, ROT270, "SNK", "Victory Road", 0 ) -GAME( 1986, dogosoke, victroad, victroad, victroad, snk_state, empty_init, ROT270, "SNK", "Dogou Souken", 0 ) -GAME( 1986, dogosokb, victroad, victroad, dogosokb, snk_state, empty_init, ROT270, "bootleg", "Dogou Souken (Joystick hack bootleg)", 0 ) - -GAME( 1987, bermudat, 0, bermudat, bermudat, snk_state, empty_init, ROT270, "SNK", "Bermuda Triangle (World?)", 0 ) -GAME( 1987, bermudatj, bermudat, bermudat, bermudat, snk_state, empty_init, ROT270, "SNK", "Bermuda Triangle (Japan)", 0 ) -GAME( 1987, worldwar, 0, bermudat, worldwar, snk_state, empty_init, ROT270, "SNK", "World Wars (World?)", 0 ) -GAME( 1987, bermudata, worldwar, bermudat, bermudaa, snk_state, empty_init, ROT270, "SNK", "Bermuda Triangle (World Wars) (US)", 0 ) -GAME( 1987, psychos, 0, psychos, psychos, snk_state, empty_init, ROT0, "SNK", "Psycho Soldier (US)", 0 ) -GAME( 1987, psychosj, psychos, psychos, psychos, snk_state, empty_init, ROT0, "SNK", "Psycho Soldier (Japan)", 0 ) -GAME( 1987, gwar, 0, gwar, gwar, snk_state, empty_init, ROT270, "SNK", "Guerrilla War (US)", 0 ) -GAME( 1987, gwarj, gwar, gwar, gwar, snk_state, empty_init, ROT270, "SNK", "Guevara (Japan)", 0 ) -GAME( 1987, gwara, gwar, gwara, gwar, snk_state, empty_init, ROT270, "SNK", "Guerrilla War (Version 1, set 1)", 0 ) -GAME( 1987, gwarab, gwar, gwara, gwar, snk_state, empty_init, ROT270, "SNK", "Guerrilla War (Version 1, set 2)", 0 ) -GAME( 1987, gwarb, gwar, gwar, gwarb, snk_state, empty_init, ROT270, "bootleg", "Guerrilla War (Joystick hack bootleg)", 0 ) -GAME( 1988, chopper, 0, choppera, choppera, snk_state, empty_init, ROT270, "SNK", "Chopper I (US Ver 2)", 0 ) -GAME( 1988, choppera, chopper, chopper1, chopper, snk_state, empty_init, ROT270, "SNK", "Chopper I (US Ver 1?)", 0 ) -GAME( 1988, chopperb, chopper, chopper1, chopper, snk_state, empty_init, ROT270, "SNK", "Chopper I (US)", 0 ) // First version, without the rev "A" roms -GAME( 1988, legofair, chopper, chopper1, chopper, snk_state, empty_init, ROT270, "SNK", "Koukuu Kihei Monogatari - The Legend of Air Cavalry (Japan)", 0 ) - -GAME( 1987, tdfever, 0, tdfever, tdfever, snk_state, empty_init, ROT90, "SNK", "TouchDown Fever (US)", 0 ) -GAME( 1987, tdfeverj, tdfever, tdfever, tdfever, snk_state, empty_init, ROT90, "SNK", "TouchDown Fever (Japan)", 0 ) -GAME( 1988, tdfever2, tdfever, tdfever2, tdfever, snk_state, empty_init, ROT90, "SNK", "TouchDown Fever 2", 0 ) // upgrade kit for Touchdown Fever -GAME( 1988, tdfever2b, tdfever, tdfever2, tdfever, snk_state, empty_init, ROT90, "bootleg", "TouchDown Fever 2 (bootleg)", 0 ) -GAME( 1988, fsoccer, 0, tdfever2, fsoccer, snk_state, empty_init, ROT0, "SNK", "Fighting Soccer (version 4)", 0 ) -GAME( 1988, fsoccerj, fsoccer, tdfever2, fsoccer, snk_state, empty_init, ROT0, "SNK", "Fighting Soccer (Japan)", 0 ) -GAME( 1988, fsoccerb, fsoccer, tdfever2, fsoccerb, snk_state, empty_init, ROT0, "bootleg", "Fighting Soccer (Joystick hack bootleg)", 0 ) -GAME( 1988, fsoccerba, fsoccer, tdfever2, fsoccerb, snk_state, empty_init, ROT0, "bootleg", "Fighting Soccer (Joystick hack bootleg, alt)", 0 ) +GAME( 1983, marvins, 0, marvins, marvins, marvins_state, empty_init, ROT270, "SNK", "Marvin's Maze", 0 ) +GAME( 1984, vangrd2, 0, vangrd2, vangrd2, marvins_state, empty_init, ROT270, "SNK", "Vanguard II", 0 ) +GAME( 1984, madcrash, 0, vangrd2, madcrash, marvins_state, empty_init, ROT0, "SNK", "Mad Crasher", 0 ) +GAME( 1984, madcrush, madcrash, madcrush, madcrash, marvins_state, empty_init, ROT0, "SNK", "Mad Crusher (Japan)", 0 ) + +GAME( 1984, jcross, 0, jcross, jcross, snk_state, empty_init, ROT270, "SNK", "Jumping Cross (set 1)", 0 ) +GAME( 1984, jcrossa, jcross, jcross, jcross, snk_state, empty_init, ROT270, "SNK", "Jumping Cross (set 2)", 0 ) +GAME( 1984, sgladiat, 0, sgladiat, sgladiat, snk_state, empty_init, ROT0, "SNK", "Gladiator 1984", 0 ) +GAME( 1985, hal21, 0, hal21, hal21, snk_state, empty_init, ROT270, "SNK", "HAL21", 0 ) +GAME( 1985, hal21j, hal21, hal21, hal21, snk_state, empty_init, ROT270, "SNK", "HAL21 (Japan)", 0 ) + +GAME( 1985, aso, 0, aso, aso, snk_state, empty_init, ROT270, "SNK", "ASO - Armored Scrum Object", 0 ) +GAME( 1985, alphamis, aso, aso, alphamis, snk_state, empty_init, ROT270, "SNK", "Alpha Mission", 0 ) +GAME( 1985, arian, aso, aso, alphamis, snk_state, empty_init, ROT270, "SNK", "Arian Mission", 0 ) +GAME( 1985, tnk3, 0, tnk3, tnk3, snk_state, empty_init, ROT270, "SNK", "T.N.K III (US)", 0 ) +GAME( 1985, tnk3j, tnk3, tnk3, tnk3, snk_state, empty_init, ROT270, "SNK", "T.A.N.K (Japan)", 0 ) +GAME( 1985, tnk3b, tnk3, tnk3, tnk3b, snk_state, empty_init, ROT270, "bootleg", "T.A.N.K (bootleg, 8-way joystick)", 0 ) +GAME( 1986, athena, 0, athena, athena, snk_state, empty_init, ROT0, "SNK", "Athena", 0 ) +GAME( 1986, athenab, athena, athena, athena, snk_state, empty_init, ROT0, "bootleg", "Athena (bootleg)", 0 ) // is this really a bootleg? +GAME( 1987, sathena, athena, athena, athena, snk_state, empty_init, ROT0, "bootleg", "Super Athena (bootleg)", 0 ) +GAME( 1988, fitegolf, 0, fitegolf, fitegolf, snk_state, empty_init, ROT0, "SNK", "Lee Trevino's Fighting Golf (World?)", 0 ) +GAME( 1988, fitegolfu, fitegolf, fitegolf, fitegolfu, snk_state, empty_init, ROT0, "SNK", "Lee Trevino's Fighting Golf (US, Ver 2, set 1)", 0 ) +GAME( 1988, fitegolfua,fitegolf, fitegolf2, fitegolfu, snk_state, empty_init, ROT0, "SNK", "Lee Trevino's Fighting Golf (US, Ver 2, set 2)", 0 ) +GAME( 1988, countryc, 0, countryc, countryc, countryc_state, empty_init, ROT0, "SNK", "Country Club", 0 ) + +GAME( 1986, ikari, 0, ikari, ikari, ikari_state, empty_init, ROT270, "SNK", "Ikari Warriors (US JAMMA)", 0 ) // distributed by Tradewest(?) +GAME( 1986, ikaria, ikari, ikari, ikaria, ikari_state, empty_init, ROT270, "SNK", "Ikari Warriors (US, set 1)", 0 ) // distributed by Tradewest(?) +GAME( 1986, ikaria2, ikari, ikari, ikaria, ikari_state, empty_init, ROT270, "SNK", "Ikari Warriors (US, set 2)", 0 ) // distributed by Tradewest(?) +GAME( 1986, ikarinc, ikari, ikari, ikarinc, ikari_state, empty_init, ROT270, "SNK", "Ikari Warriors (US No Continues)", 0 ) // distributed by Tradewest(?) +GAME( 1986, ikarijp, ikari, ikari, ikarinc, ikari_state, empty_init, ROT270, "SNK", "Ikari (Japan No Continues)", 0 ) +GAME( 1986, ikarijpb, ikari, ikari, ikarijpb, ikari_state, empty_init, ROT270, "bootleg", "Ikari (Joystick hack bootleg)", 0 ) +GAME( 1986, ikariram, ikari, ikari, ikarijpb, ikari_state, empty_init, ROT270, "bootleg", "Rambo 3 (bootleg of Ikari, Joystick hack)", 0 ) +GAME( 1986, victroad, 0, victroad, victroad, ikari_state, empty_init, ROT270, "SNK", "Victory Road", 0 ) +GAME( 1986, dogosoke, victroad, victroad, victroad, ikari_state, empty_init, ROT270, "SNK", "Dogou Souken (Japan)", 0 ) +GAME( 1986, dogosokb, victroad, victroad, dogosokb, ikari_state, empty_init, ROT270, "bootleg", "Dogou Souken (Joystick hack bootleg)", 0 ) + +GAME( 1987, bermudat, 0, bermudat, bermudat, bermudat_state, empty_init, ROT270, "SNK", "Bermuda Triangle (World?)", 0 ) +GAME( 1987, bermudatj, bermudat, bermudat, bermudat, bermudat_state, empty_init, ROT270, "SNK", "Bermuda Triangle (Japan)", 0 ) +GAME( 1987, worldwar, 0, bermudat, worldwar, bermudat_state, empty_init, ROT270, "SNK", "World Wars (World?)", 0 ) +GAME( 1987, bermudata, worldwar, bermudat, bermudaa, bermudat_state, empty_init, ROT270, "SNK", "Bermuda Triangle (World Wars) (US)", 0 ) +GAME( 1987, psychos, 0, psychos, psychos, bermudat_state, empty_init, ROT0, "SNK", "Psycho Soldier (US)", 0 ) +GAME( 1987, psychosj, psychos, psychos, psychos, bermudat_state, empty_init, ROT0, "SNK", "Psycho Soldier (Japan)", 0 ) +GAME( 1987, gwar, 0, gwar, gwar, gwar_state, empty_init, ROT270, "SNK", "Guerrilla War (US)", 0 ) +GAME( 1987, gwarj, gwar, gwar, gwar, gwar_state, empty_init, ROT270, "SNK", "Guevara (Japan)", 0 ) +GAME( 1987, gwara, gwar, gwara, gwar, gwar_state, empty_init, ROT270, "SNK", "Guerrilla War (Version 1, set 1)", 0 ) +GAME( 1987, gwarab, gwar, gwara, gwar, gwar_state, empty_init, ROT270, "SNK", "Guerrilla War (Version 1, set 2)", 0 ) +GAME( 1987, gwarb, gwar, gwar, gwarb, gwarb_state, empty_init, ROT270, "bootleg", "Guerrilla War (Joystick hack bootleg)", 0 ) +GAME( 1988, chopper, 0, choppera, choppera, bermudat_state, empty_init, ROT270, "SNK", "Chopper I (US Ver 2)", 0 ) +GAME( 1988, choppera, chopper, chopper1, chopper, bermudat_state, empty_init, ROT270, "SNK", "Chopper I (US Ver 1?)", 0 ) +GAME( 1988, chopperb, chopper, chopper1, chopper, bermudat_state, empty_init, ROT270, "SNK", "Chopper I (US)", 0 ) // First version, without the rev "A" roms +GAME( 1988, legofair, chopper, chopper1, chopper, bermudat_state, empty_init, ROT270, "SNK", "Koukuu Kihei Monogatari - The Legend of Air Cavalry (Japan)", 0 ) + +GAME( 1987, tdfever, 0, tdfever, tdfever, bermudat_state, empty_init, ROT90, "SNK", "TouchDown Fever (US)", 0 ) +GAME( 1987, tdfeverj, tdfever, tdfever, tdfever, bermudat_state, empty_init, ROT90, "SNK", "TouchDown Fever (Japan)", 0 ) +GAME( 1988, tdfever2, tdfever, tdfever2, tdfever, bermudat_state, empty_init, ROT90, "SNK", "TouchDown Fever 2", 0 ) // upgrade kit for Touchdown Fever +GAME( 1988, tdfever2b, tdfever, tdfever2, tdfever, bermudat_state, empty_init, ROT90, "bootleg", "TouchDown Fever 2 (bootleg)", 0 ) +GAME( 1988, fsoccer, 0, tdfever2, fsoccer, bermudat_state, empty_init, ROT0, "SNK", "Fighting Soccer (version 4)", 0 ) +GAME( 1988, fsoccerj, fsoccer, tdfever2, fsoccer, bermudat_state, empty_init, ROT0, "SNK", "Fighting Soccer (Japan)", 0 ) +GAME( 1988, fsoccerb, fsoccer, tdfever2, fsoccerb, bermudat_state, empty_init, ROT0, "bootleg", "Fighting Soccer (Joystick hack bootleg)", 0 ) +GAME( 1988, fsoccerba, fsoccer, tdfever2, fsoccerb, bermudat_state, empty_init, ROT0, "bootleg", "Fighting Soccer (Joystick hack bootleg, alt)", 0 ) diff --git a/src/mame/snk/snk.h b/src/mame/snk/snk.h index 7c3be3aa28f3d..8fa9e72fa999b 100644 --- a/src/mame/snk/snk.h +++ b/src/mame/snk/snk.h @@ -30,50 +30,27 @@ class snk_state : public driver_device m_palette(*this, "palette"), m_soundlatch(*this, "soundlatch"), m_spriteram(*this, "spriteram"), - m_fg_videoram(*this, "fg_videoram"), m_bg_videoram(*this, "bg_videoram"), m_tx_videoram(*this, "tx_videoram"), - m_rot_io(*this, "P%uROT", 1U), - m_trackball_x_io(*this, "TRACKBALLX%u", 1U), - m_trackball_y_io(*this, "TRACKBALLY%u", 1U), - m_joymode_io(*this, "JOYSTICK_MODE"), m_bonus_io(*this, "BONUS") { } - void gwar(machine_config &config); - void psychos(machine_config &config); - void fitegolf(machine_config &config); - void countryc(machine_config &config); - void tdfever2(machine_config &config); - void aso(machine_config &config); - void gwara(machine_config &config); - void tdfever(machine_config &config); - void fitegolf2(machine_config &config); - void jcross(machine_config &config); - void choppera(machine_config &config); - void tnk3(machine_config &config); - void victroad(machine_config &config); - void chopper1(machine_config &config); - void vangrd2(machine_config &config); - void bermudat(machine_config &config); - void hal21(machine_config &config); - void marvins(machine_config &config); - void athena(machine_config &config); - void ikari(machine_config &config); - void sgladiat(machine_config &config); - void madcrush(machine_config &config); + void fitegolf(machine_config &config) ATTR_COLD; + void aso(machine_config &config) ATTR_COLD; + void fitegolf2(machine_config &config) ATTR_COLD; + void jcross(machine_config &config) ATTR_COLD; + void tnk3(machine_config &config) ATTR_COLD; + void hal21(machine_config &config) ATTR_COLD; + void athena(machine_config &config) ATTR_COLD; + void sgladiat(machine_config &config) ATTR_COLD; int sound_busy_r(); - template ioport_value gwar_rotary(); - template ioport_value gwarb_rotary(); - ioport_value countryc_trackball_x(); - ioport_value countryc_trackball_y(); template ioport_value snk_bonus_r(); protected: virtual void machine_start() override ATTR_COLD; + virtual void machine_reset() override ATTR_COLD; -private: required_device m_maincpu; required_device m_audiocpu; required_device m_subcpu; @@ -83,210 +60,323 @@ class snk_state : public driver_device optional_device m_soundlatch; required_shared_ptr m_spriteram; - optional_shared_ptr m_fg_videoram; required_shared_ptr m_bg_videoram; required_shared_ptr m_tx_videoram; - optional_ioport_array<2> m_rot_io; - optional_ioport_array<2> m_trackball_x_io; - optional_ioport_array<2> m_trackball_y_io; - optional_ioport m_joymode_io; optional_ioport m_bonus_io; - int m_countryc_trackball = 0; - int m_last_value[2]{}; - int m_cp_count[2]{}; - - // FIXME this should be initialised on machine reset - int m_sound_status = 0; + uint8_t m_sound_status = 0; tilemap_t *m_tx_tilemap = nullptr; - tilemap_t *m_fg_tilemap = nullptr; tilemap_t *m_bg_tilemap = nullptr; - int m_fg_scrollx = 0; - int m_fg_scrolly = 0; - int m_bg_scrollx = 0; - int m_bg_scrolly = 0; - int m_sp16_scrollx = 0; - int m_sp16_scrolly = 0; - int m_sp32_scrollx = 0; - int m_sp32_scrolly = 0; + int32_t m_bg_scrollx = 0; + int32_t m_bg_scrolly = 0; + int32_t m_sp16_scrollx = 0; + int32_t m_sp16_scrolly = 0; + int32_t m_sp32_scrollx = 0; + int32_t m_sp32_scrolly = 0; uint8_t m_sprite_split_point = 0; + int m_num_sprites = 0; int m_yscroll_mask = 0; uint32_t m_bg_tile_offset = 0; uint32_t m_tx_tile_offset = 0; - int m_is_psychos = 0; uint8_t m_drawmode_table[16]{}; - uint8_t m_empty_tile[16*16]{}; - int m_hf_posy = 0; - int m_hf_posx = 0; - int m_tc16_posy = 0; - int m_tc16_posx = 0; - int m_tc32_posy = 0; - int m_tc32_posx = 0; - uint8_t snk_cpuA_nmi_trigger_r(); - void snk_cpuA_nmi_ack_w(uint8_t data); - uint8_t snk_cpuB_nmi_trigger_r(); - void snk_cpuB_nmi_ack_w(uint8_t data); - uint8_t marvins_sound_nmi_ack_r(); + + uint8_t cpuA_nmi_trigger_r(); + void cpuA_nmi_ack_w(uint8_t data); + uint8_t cpuB_nmi_trigger_r(); + void cpuB_nmi_ack_w(uint8_t data); void sgladiat_soundlatch_w(uint8_t data); uint8_t sgladiat_soundlatch_r(); uint8_t sgladiat_sound_nmi_ack_r(); uint8_t sgladiat_sound_irq_ack_r(); - void snk_soundlatch_w(uint8_t data); - uint8_t snk_sound_status_r(); - void snk_sound_status_w(uint8_t data); + void soundlatch_w(uint8_t data); + uint8_t sound_status_r(); + void sound_status_w(uint8_t data); uint8_t tnk3_cmdirq_ack_r(); uint8_t tnk3_ymirq_ack_r(); uint8_t tnk3_busy_clear_r(); - void hardflags_scrollx_w(uint8_t data); - void hardflags_scrolly_w(uint8_t data); - void hardflags_scroll_msb_w(uint8_t data); - uint8_t hardflags1_r(); - uint8_t hardflags2_r(); - uint8_t hardflags3_r(); - uint8_t hardflags4_r(); - uint8_t hardflags5_r(); - uint8_t hardflags6_r(); - uint8_t hardflags7_r(); - void turbocheck16_1_w(uint8_t data); - void turbocheck16_2_w(uint8_t data); - void turbocheck32_1_w(uint8_t data); - void turbocheck32_2_w(uint8_t data); - void turbocheck_msb_w(uint8_t data); - uint8_t turbocheck16_1_r(); - uint8_t turbocheck16_2_r(); - uint8_t turbocheck16_3_r(); - uint8_t turbocheck16_4_r(); - uint8_t turbocheck16_5_r(); - uint8_t turbocheck16_6_r(); - uint8_t turbocheck16_7_r(); - uint8_t turbocheck16_8_r(); - uint8_t turbocheck32_1_r(); - uint8_t turbocheck32_2_r(); - uint8_t turbocheck32_3_r(); - uint8_t turbocheck32_4_r(); void athena_coin_counter_w(uint8_t data); void ikari_coin_counter_w(uint8_t data); void tdfever_coin_counter_w(uint8_t data); - void countryc_trackball_w(uint8_t data); - void snk_tx_videoram_w(offs_t offset, uint8_t data); - void marvins_fg_videoram_w(offs_t offset, uint8_t data); + void tx_videoram_w(offs_t offset, uint8_t data); void marvins_bg_videoram_w(offs_t offset, uint8_t data); - void snk_bg_videoram_w(offs_t offset, uint8_t data); - void snk_fg_scrollx_w(uint8_t data); - void snk_fg_scrolly_w(uint8_t data); - void snk_bg_scrollx_w(uint8_t data); - void snk_bg_scrolly_w(uint8_t data); - void snk_sp16_scrollx_w(uint8_t data); - void snk_sp16_scrolly_w(uint8_t data); - void snk_sp32_scrollx_w(uint8_t data); - void snk_sp32_scrolly_w(uint8_t data); - void snk_sprite_split_point_w(uint8_t data); - void marvins_palette_bank_w(uint8_t data); - void marvins_flipscreen_w(uint8_t data); + void bg_videoram_w(offs_t offset, uint8_t data); + void bg_scrollx_w(uint8_t data); + void bg_scrolly_w(uint8_t data); + void sp16_scrollx_w(uint8_t data); + void sp16_scrolly_w(uint8_t data); + void sp32_scrollx_w(uint8_t data); + void sp32_scrolly_w(uint8_t data); + void sprite_split_point_w(uint8_t data); void sgladiat_flipscreen_w(uint8_t data); void hal21_flipscreen_w(uint8_t data); - void marvins_scroll_msb_w(uint8_t data); void jcross_scroll_msb_w(uint8_t data); void sgladiat_scroll_msb_w(uint8_t data); void aso_videoattrs_w(uint8_t data); void tnk3_videoattrs_w(uint8_t data); void aso_bg_bank_w(uint8_t data); - void ikari_bg_scroll_msb_w(uint8_t data); - void ikari_sp_scroll_msb_w(uint8_t data); - void ikari_unknown_video_w(uint8_t data); - void gwar_tx_bank_w(uint8_t data); - void gwar_videoattrs_w(uint8_t data); - void gwara_videoattrs_w(uint8_t data); - void gwara_sp_scroll_msb_w(uint8_t data); - void tdfever_sp_scroll_msb_w(uint8_t data); - void tdfever_spriteram_w(offs_t offset, uint8_t data); + void register_save_state() ATTR_COLD; TILEMAP_MAPPER_MEMBER(marvins_tx_scan_cols); TILE_GET_INFO_MEMBER(marvins_get_tx_tile_info); - TILE_GET_INFO_MEMBER(ikari_get_tx_tile_info); - TILE_GET_INFO_MEMBER(gwar_get_tx_tile_info); - TILE_GET_INFO_MEMBER(marvins_get_fg_tile_info); - TILE_GET_INFO_MEMBER(marvins_get_bg_tile_info); TILE_GET_INFO_MEMBER(aso_get_bg_tile_info); TILE_GET_INFO_MEMBER(tnk3_get_bg_tile_info); - TILE_GET_INFO_MEMBER(ikari_get_bg_tile_info); - TILE_GET_INFO_MEMBER(gwar_get_bg_tile_info); - DECLARE_VIDEO_START(marvins); void tnk3_palette(palette_device &palette) const; DECLARE_VIDEO_START(jcross); DECLARE_VIDEO_START(tnk3); - DECLARE_VIDEO_START(ikari); - DECLARE_VIDEO_START(gwar); - DECLARE_VIDEO_START(tdfever); DECLARE_VIDEO_START(sgladiat); DECLARE_VIDEO_START(hal21); DECLARE_VIDEO_START(aso); - DECLARE_VIDEO_START(psychos); - DECLARE_VIDEO_START(snk_3bpp_shadow); - DECLARE_VIDEO_START(snk_4bpp_shadow); - uint32_t screen_update_marvins(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + DECLARE_VIDEO_START(_3bpp_shadow); uint32_t screen_update_tnk3(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - uint32_t screen_update_ikari(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - uint32_t screen_update_gwar(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - uint32_t screen_update_tdfever(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); uint32_t screen_update_fitegolf2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_CALLBACK_MEMBER(sgladiat_sndirq_update_callback); TIMER_CALLBACK_MEMBER(sndirq_update_callback); - void ymirq_callback_2(int state); - void marvins_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, const int scrollx, const int scrolly, const int from, const int to); void tnk3_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, const int xscroll, const int yscroll); - void ikari_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, const int start, const int xscroll, const int yscroll, const uint8_t *source, const int gfxnum ); - void tdfever_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, const int xscroll, const int yscroll, const uint8_t *source, const int gfxnum, const int hw_xflip, const int from, const int to); - int hardflags_check(int num); - int hardflags_check8(int num); - int turbofront_check(int small, int num); - int turbofront_check8(int small, int num); void ymirq_callback_1(int state); + void ymirq_callback_2(int state); - void Y8950_sound_map(address_map &map) ATTR_COLD; void YM3526_Y8950_sound_map(address_map &map) ATTR_COLD; void YM3526_YM3526_sound_map(address_map &map) ATTR_COLD; - void YM3812_Y8950_sound_map(address_map &map) ATTR_COLD; void YM3812_sound_map(address_map &map) ATTR_COLD; void aso_YM3526_sound_map(address_map &map) ATTR_COLD; void aso_cpuA_map(address_map &map) ATTR_COLD; void aso_cpuB_map(address_map &map) ATTR_COLD; - void bermudat_cpuA_map(address_map &map) ATTR_COLD; - void bermudat_cpuB_map(address_map &map) ATTR_COLD; - void countryc_cpuA_map(address_map &map) ATTR_COLD; - void gwar_cpuA_map(address_map &map) ATTR_COLD; - void gwar_cpuB_map(address_map &map) ATTR_COLD; - void gwara_cpuA_map(address_map &map) ATTR_COLD; - void gwara_cpuB_map(address_map &map) ATTR_COLD; void hal21_cpuA_map(address_map &map) ATTR_COLD; void hal21_cpuB_map(address_map &map) ATTR_COLD; void hal21_sound_map(address_map &map) ATTR_COLD; - void hal21_sound_portmap(address_map &map) ATTR_COLD; - void ikari_cpuA_map(address_map &map) ATTR_COLD; - void ikari_cpuB_map(address_map &map) ATTR_COLD; void jcross_cpuA_map(address_map &map) ATTR_COLD; void jcross_cpuB_map(address_map &map) ATTR_COLD; void jcross_sound_map(address_map &map) ATTR_COLD; void jcross_sound_portmap(address_map &map) ATTR_COLD; + void marvins_sound_portmap(address_map &map) ATTR_COLD; + void sgladiat_cpuA_map(address_map &map) ATTR_COLD; + void sgladiat_cpuB_map(address_map &map) ATTR_COLD; + void sound_common_map(address_map &map) ATTR_COLD; + void tnk3_YM3526_sound_map(address_map &map) ATTR_COLD; + void tnk3_cpuA_map(address_map &map) ATTR_COLD; + void tnk3_cpuB_map(address_map &map) ATTR_COLD; +}; + +// with Foreground tilemap +class marvins_state : public snk_state +{ +public: + marvins_state(const machine_config &mconfig, device_type type, const char *tag) : + snk_state(mconfig, type, tag), + m_fg_videoram(*this, "fg_videoram") + { } + + void madcrush(machine_config &config) ATTR_COLD; + void marvins(machine_config &config) ATTR_COLD; + void vangrd2(machine_config &config) ATTR_COLD; + +protected: + virtual void video_start() override ATTR_COLD; + +private: + required_shared_ptr m_fg_videoram; + + tilemap_t *m_fg_tilemap = nullptr; + int32_t m_fg_scrollx = 0; + int32_t m_fg_scrolly = 0; + + uint8_t marvins_sound_nmi_ack_r(); + void marvins_fg_videoram_w(offs_t offset, uint8_t data); + void marvins_palette_bank_w(uint8_t data); + void marvins_flipscreen_w(uint8_t data); + void fg_scrollx_w(uint8_t data); + void fg_scrolly_w(uint8_t data); + void marvins_scroll_msb_w(uint8_t data); + + TILE_GET_INFO_MEMBER(marvins_get_fg_tile_info); + TILE_GET_INFO_MEMBER(marvins_get_bg_tile_info); + void marvins_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, const int scrollx, const int scrolly, const int from, const int to); + uint32_t screen_update_marvins(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + void madcrash_cpuA_map(address_map &map) ATTR_COLD; void madcrash_cpuB_map(address_map &map) ATTR_COLD; void madcrush_cpuA_map(address_map &map) ATTR_COLD; void madcrush_cpuB_map(address_map &map) ATTR_COLD; + void marvins_common_map(address_map &map) ATTR_COLD; void marvins_cpuA_map(address_map &map) ATTR_COLD; void marvins_cpuB_map(address_map &map) ATTR_COLD; void marvins_sound_map(address_map &map) ATTR_COLD; - void marvins_sound_portmap(address_map &map) ATTR_COLD; - void sgladiat_cpuA_map(address_map &map) ATTR_COLD; - void sgladiat_cpuB_map(address_map &map) ATTR_COLD; +}; + +// with trackball +class countryc_state : public snk_state +{ +public: + countryc_state(const machine_config &mconfig, device_type type, const char *tag) : + snk_state(mconfig, type, tag), + m_trackball_x_io(*this, "TRACKBALLX%u", 1U), + m_trackball_y_io(*this, "TRACKBALLY%u", 1U) + { } + + void countryc(machine_config &config) ATTR_COLD; + + ioport_value countryc_trackball_x(); + ioport_value countryc_trackball_y(); + +protected: + virtual void machine_start() override ATTR_COLD; + +private: + required_ioport_array<2> m_trackball_x_io; + required_ioport_array<2> m_trackball_y_io; + + uint8_t m_countryc_trackball = 0; + + void countryc_trackball_w(uint8_t data); + void countryc_cpuA_map(address_map &map) ATTR_COLD; +}; + +// with "Hard Flags" hardware +class ikari_state : public snk_state +{ +public: + ikari_state(const machine_config &mconfig, device_type type, const char *tag) : + snk_state(mconfig, type, tag) + { } + + void ikari(machine_config &config) ATTR_COLD; + void victroad(machine_config &config) ATTR_COLD; + +protected: + virtual void machine_start() override ATTR_COLD; + virtual void video_start() override ATTR_COLD; + +private: + int32_t m_hf_posy = 0; + int32_t m_hf_posx = 0; + + void ikari_bg_scroll_msb_w(uint8_t data); + void ikari_sp_scroll_msb_w(uint8_t data); + void ikari_unknown_video_w(uint8_t data); + void hardflags_scrollx_w(uint8_t data); + void hardflags_scrolly_w(uint8_t data); + void hardflags_scroll_msb_w(uint8_t data); + uint8_t hardflags7_r(); + + TILE_GET_INFO_MEMBER(ikari_get_tx_tile_info); + TILE_GET_INFO_MEMBER(ikari_get_bg_tile_info); + uint32_t screen_update_ikari(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + void ikari_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, const int start, const int xscroll, const int yscroll, const uint8_t *source, const int gfxnum ); + int hardflags_check(int num); + template uint8_t hardflags_check8(); + + void ikari_common_map(address_map &map) ATTR_COLD; + void ikari_cpuA_map(address_map &map) ATTR_COLD; + void ikari_cpuB_map(address_map &map) ATTR_COLD; +}; + +// with "Turbo Front" hardware, Higher screen resolution +class bermudat_state : public snk_state +{ +public: + bermudat_state(const machine_config &mconfig, device_type type, const char *tag) : + snk_state(mconfig, type, tag) + { } + + void bermudat(machine_config &config) ATTR_COLD; + void chopper1(machine_config &config) ATTR_COLD; + void choppera(machine_config &config) ATTR_COLD; + void psychos(machine_config &config) ATTR_COLD; + void tdfever(machine_config &config) ATTR_COLD; + void tdfever2(machine_config &config) ATTR_COLD; + +protected: + virtual void machine_start() override ATTR_COLD; + + bool m_is_psychos = false; + uint8_t m_empty_tile[16*16]{}; + + int32_t m_tc16_posy = 0; + int32_t m_tc16_posx = 0; + int32_t m_tc32_posy = 0; + int32_t m_tc32_posx = 0; + + void gwar_tx_bank_w(uint8_t data); + void gwar_videoattrs_w(uint8_t data); + void gwara_videoattrs_w(uint8_t data); + void gwara_sp_scroll_msb_w(uint8_t data); + void tdfever_sp_scroll_msb_w(uint8_t data); + void tdfever_spriteram_w(offs_t offset, uint8_t data); + void turbocheck16_1_w(uint8_t data); + void turbocheck16_2_w(uint8_t data); + void turbocheck32_1_w(uint8_t data); + void turbocheck32_2_w(uint8_t data); + void turbocheck_msb_w(uint8_t data); + int turbofront_check(bool small, int num); + template uint8_t turbofront_check8(); + + TILE_GET_INFO_MEMBER(gwar_get_tx_tile_info); + TILE_GET_INFO_MEMBER(gwar_get_bg_tile_info); + DECLARE_VIDEO_START(gwar); + DECLARE_VIDEO_START(psychos); + DECLARE_VIDEO_START(_4bpp_shadow); + DECLARE_VIDEO_START(tdfever); + uint32_t screen_update_gwar(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_tdfever(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + void tdfever_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, const int xscroll, const int yscroll, const uint8_t *source, const int gfxnum, const bool hw_xflip, const int from, const int to); + + void bermudat_common_map(address_map &map) ATTR_COLD; + void bermudat_cpuA_map(address_map &map) ATTR_COLD; + void bermudat_cpuB_map(address_map &map) ATTR_COLD; + void chopper1_sound_map(address_map &map) ATTR_COLD; + void gwar_common_map(address_map &map) ATTR_COLD; + void gwar_cpuA_map(address_map &map) ATTR_COLD; + void gwar_cpuB_map(address_map &map) ATTR_COLD; + void tdfever_common_map(address_map &map) ATTR_COLD; void tdfever_cpuA_map(address_map &map) ATTR_COLD; void tdfever_cpuB_map(address_map &map) ATTR_COLD; - void tnk3_YM3526_sound_map(address_map &map) ATTR_COLD; - void tnk3_cpuA_map(address_map &map) ATTR_COLD; - void tnk3_cpuB_map(address_map &map) ATTR_COLD; + void tdfever2_sound_map(address_map &map) ATTR_COLD; +}; + +// bermudat_state with rotary joystick protection +class gwar_state : public bermudat_state +{ +public: + gwar_state(const machine_config &mconfig, device_type type, const char *tag) : + bermudat_state(mconfig, type, tag), + m_rot_io(*this, "P%uROT", 1U) + { } + + void gwar(machine_config &config) ATTR_COLD; + void gwara(machine_config &config) ATTR_COLD; + + template ioport_value gwar_rotary(); + +protected: + virtual void machine_start() override ATTR_COLD; + + required_ioport_array<2> m_rot_io; + + int32_t m_last_value[2]{}; + int32_t m_cp_count[2]{}; + + void gwara_common_map(address_map &map) ATTR_COLD; + void gwara_cpuA_map(address_map &map) ATTR_COLD; + void gwara_cpuB_map(address_map &map) ATTR_COLD; +}; + +// gwar_state bootleg with joystick mode +class gwarb_state : public gwar_state +{ +public: + gwarb_state(const machine_config &mconfig, device_type type, const char *tag) : + gwar_state(mconfig, type, tag), + m_joymode_io(*this, "JOYSTICK_MODE") + { } + + template ioport_value gwarb_rotary() ATTR_COLD; + +private: + required_ioport m_joymode_io; }; #endif // MAME_SNK_SNK_H diff --git a/src/mame/snk/snk_bbusters_spr.cpp b/src/mame/snk/snk_bbusters_spr.cpp index 1dc4ca27e72d5..fd56116111b66 100644 --- a/src/mame/snk/snk_bbusters_spr.cpp +++ b/src/mame/snk/snk_bbusters_spr.cpp @@ -98,7 +98,7 @@ inline const uint8_t *snk_bbusters_spr_device::get_source_ptr(gfx_element *tileg break; } - return tilegfx->get_data((sprite + code) % tilegfx->elements()) + ((dy % 16) * tilegfx->rowbytes()); + return tilegfx->get_data((sprite + code) % tilegfx->elements()) + ((dy & 0xf) * tilegfx->rowbytes()); } void snk_bbusters_spr_device::draw_block(bitmap_ind16 &dest, const rectangle &cliprect, int x, int y, int size, int flipx, int flipy, uint32_t sprite, int color, int block) @@ -106,10 +106,10 @@ void snk_bbusters_spr_device::draw_block(bitmap_ind16 &dest, const rectangle &cl // TODO: respect cliprect gfx_element *tilegfx = gfx(0); - pen_t pen_base = tilegfx->colorbase() + tilegfx->granularity() * (color % tilegfx->colors()); - uint32_t xinc = (m_scale_line_count * 0x10000) / size; + pen_t const pen_base = tilegfx->colorbase() + tilegfx->granularity() * (color % tilegfx->colors()); + uint32_t const xinc = (m_scale_line_count * 0x10000) / size; int dy = y; - int ex = m_scale_line_count; + int const ex = m_scale_line_count; while (m_scale_line_count) { @@ -130,11 +130,11 @@ void snk_bbusters_spr_device::draw_block(bitmap_ind16 &dest, const rectangle &cl for (int sx = 0; sx < size; sx++) { - if ((sx % 16) == 0) + if ((sx & 0xf) == 0) srcptr = get_source_ptr(tilegfx, sprite, sx, srcline, block); - uint8_t pixel = *srcptr++; - if (pixel != 15) + uint8_t const pixel = *srcptr++; + if (pixel != 0xf) destline[(x + (x_index >> 16)) & 0x1ff] = pen_base + pixel; if (flipx) @@ -184,14 +184,14 @@ void snk_bbusters_spr_device::draw_sprites(bitmap_ind16 &bitmap, const rectangle Block type 3: 0x00 = no scale, 0x3f == half size - 128 pixel sprite */ + int const block = (colour >> 8) & 0x3; + bool const fy = BIT(colour, 10); + bool const fx = BIT(colour, 11); colour >>= 12; - int block = (sprram[offs + 0] >> 8) & 0x3; - int fy = sprram[offs + 0] & 0x400; - int fx = sprram[offs + 0] & 0x800; sprite &= 0x3fff; int scale; - switch ((sprram[offs + 0] >> 8) & 0x3) + switch (block) { case 0: scale = sprram[offs + 0] & 0x7; diff --git a/src/mame/snk/snk_v.cpp b/src/mame/snk/snk_v.cpp index d2aa058b78f55..ace214f9b6f96 100644 --- a/src/mame/snk/snk_v.cpp +++ b/src/mame/snk/snk_v.cpp @@ -41,19 +41,19 @@ void snk_state::tnk3_palette(palette_device &palette) const bit1 = BIT(color_prom[i], 1); bit2 = BIT(color_prom[i], 2); bit3 = BIT(color_prom[i], 3); - int const r = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; + const int r = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; bit0 = BIT(color_prom[i + 2*num_colors], 2); bit1 = BIT(color_prom[i + num_colors], 2); bit2 = BIT(color_prom[i + num_colors], 3); bit3 = BIT(color_prom[i], 0); - int const g = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; + const int g = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; bit0 = BIT(color_prom[i + 2*num_colors], 0); bit1 = BIT(color_prom[i + 2*num_colors], 1); bit2 = BIT(color_prom[i + num_colors], 0); bit3 = BIT(color_prom[i + num_colors], 1); - int const b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; + const int b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; palette.set_pen_color(i, rgb_t(r, g, b)); } @@ -74,28 +74,28 @@ TILEMAP_MAPPER_MEMBER(snk_state::marvins_tx_scan_cols) TILE_GET_INFO_MEMBER(snk_state::marvins_get_tx_tile_info) { - int code = m_tx_videoram[tile_index]; - int color = code >> 5; + const int code = m_tx_videoram[tile_index]; + const int color = code >> 5; tileinfo.set(0, m_tx_tile_offset + code, color, - tile_index & 0x400 ? TILE_FORCE_LAYER0 : 0); + BIT(tile_index, 10) ? TILE_FORCE_LAYER0 : 0); } -TILE_GET_INFO_MEMBER(snk_state::ikari_get_tx_tile_info) +TILE_GET_INFO_MEMBER(ikari_state::ikari_get_tx_tile_info) { - int code = m_tx_videoram[tile_index]; + const int code = m_tx_videoram[tile_index]; tileinfo.set(0, m_tx_tile_offset + code, 0, - tile_index & 0x400 ? TILE_FORCE_LAYER0 : 0); + BIT(tile_index, 10) ? TILE_FORCE_LAYER0 : 0); } -TILE_GET_INFO_MEMBER(snk_state::gwar_get_tx_tile_info) +TILE_GET_INFO_MEMBER(bermudat_state::gwar_get_tx_tile_info) { - int code = m_tx_videoram[tile_index]; + const int code = m_tx_videoram[tile_index]; tileinfo.set(0, m_tx_tile_offset + code, @@ -104,9 +104,9 @@ TILE_GET_INFO_MEMBER(snk_state::gwar_get_tx_tile_info) } -TILE_GET_INFO_MEMBER(snk_state::marvins_get_fg_tile_info) +TILE_GET_INFO_MEMBER(marvins_state::marvins_get_fg_tile_info) { - int code = m_fg_videoram[tile_index]; + const int code = m_fg_videoram[tile_index]; tileinfo.set(1, code, @@ -114,9 +114,9 @@ TILE_GET_INFO_MEMBER(snk_state::marvins_get_fg_tile_info) 0); } -TILE_GET_INFO_MEMBER(snk_state::marvins_get_bg_tile_info) +TILE_GET_INFO_MEMBER(marvins_state::marvins_get_bg_tile_info) { - int code = m_bg_videoram[tile_index]; + const int code = m_bg_videoram[tile_index]; tileinfo.set(2, code, @@ -127,7 +127,7 @@ TILE_GET_INFO_MEMBER(snk_state::marvins_get_bg_tile_info) TILE_GET_INFO_MEMBER(snk_state::aso_get_bg_tile_info) { - int code = m_bg_videoram[tile_index]; + const int code = m_bg_videoram[tile_index]; tileinfo.set(1, m_bg_tile_offset + code, @@ -137,9 +137,9 @@ TILE_GET_INFO_MEMBER(snk_state::aso_get_bg_tile_info) TILE_GET_INFO_MEMBER(snk_state::tnk3_get_bg_tile_info) { - int attr = m_bg_videoram[2*tile_index+1]; - int code = m_bg_videoram[2*tile_index] | ((attr & 0x30) << 4); - int color = (attr & 0xf) ^ 8; + const int attr = m_bg_videoram[2*tile_index+1]; + const int code = m_bg_videoram[2*tile_index] | ((attr & 0x30) << 4); + const int color = (attr & 0xf) ^ 8; tileinfo.set(1, code, @@ -147,11 +147,11 @@ TILE_GET_INFO_MEMBER(snk_state::tnk3_get_bg_tile_info) 0); } -TILE_GET_INFO_MEMBER(snk_state::ikari_get_bg_tile_info) +TILE_GET_INFO_MEMBER(ikari_state::ikari_get_bg_tile_info) { - int attr = m_bg_videoram[2*tile_index+1]; - int code = m_bg_videoram[2*tile_index] | ((attr & 0x03) << 8); - int color = (attr & 0x70) >> 4; + const int attr = m_bg_videoram[2*tile_index+1]; + const int code = m_bg_videoram[2*tile_index] | ((attr & 0x03) << 8); + const int color = (attr & 0x70) >> 4; tileinfo.set(1, code, @@ -159,10 +159,10 @@ TILE_GET_INFO_MEMBER(snk_state::ikari_get_bg_tile_info) 0); } -TILE_GET_INFO_MEMBER(snk_state::gwar_get_bg_tile_info) +TILE_GET_INFO_MEMBER(bermudat_state::gwar_get_bg_tile_info) { - int attr = m_bg_videoram[2*tile_index+1]; - int code = m_bg_videoram[2*tile_index] | ((attr & 0x0f) << 8); + const int attr = m_bg_videoram[2*tile_index+1]; + const int code = m_bg_videoram[2*tile_index] | ((attr & 0x0f) << 8); int color = (attr & 0xf0) >> 4; if (m_is_psychos) // psychos has a separate palette bank bit @@ -183,50 +183,58 @@ TILE_GET_INFO_MEMBER(snk_state::gwar_get_bg_tile_info) /**************************************************************************************/ -VIDEO_START_MEMBER(snk_state,snk_3bpp_shadow) +void snk_state::register_save_state() { - int i; + save_item(NAME(m_bg_scrollx)); + save_item(NAME(m_bg_scrolly)); + save_item(NAME(m_sp16_scrollx)); + save_item(NAME(m_sp16_scrolly)); + save_item(NAME(m_sp32_scrollx)); + save_item(NAME(m_sp32_scrolly)); + save_item(NAME(m_sprite_split_point)); +} - if(!(m_palette->shadows_enabled())) +VIDEO_START_MEMBER(snk_state,_3bpp_shadow) +{ + if (!(m_palette->shadows_enabled())) fatalerror("driver should use VIDEO_HAS_SHADOWS\n"); /* prepare shadow draw table */ - for(i = 0; i <= 5; i++) m_drawmode_table[i] = DRAWMODE_SOURCE; + for (int i = 0; i <= 5; i++) m_drawmode_table[i] = DRAWMODE_SOURCE; m_drawmode_table[6] = (m_palette->shadows_enabled()) ? DRAWMODE_SHADOW : DRAWMODE_SOURCE; m_drawmode_table[7] = DRAWMODE_NONE; - for (i = 0x000;i < 0x400;i++) + for (int i = 0x000;i < 0x400;i++) m_palette->shadow_table()[i] = i | 0x200; + + register_save_state(); } -VIDEO_START_MEMBER(snk_state,snk_4bpp_shadow) +VIDEO_START_MEMBER(bermudat_state,_4bpp_shadow) { - int i; - - if(!(m_palette->shadows_enabled())) + if (!(m_palette->shadows_enabled())) fatalerror("driver should use VIDEO_HAS_SHADOWS\n"); /* prepare shadow draw table */ - for(i = 0; i <= 13; i++) m_drawmode_table[i] = DRAWMODE_SOURCE; + for (int i = 0; i <= 13; i++) m_drawmode_table[i] = DRAWMODE_SOURCE; m_drawmode_table[14] = DRAWMODE_SHADOW; m_drawmode_table[15] = DRAWMODE_NONE; /* all palette entries are not affected by shadow sprites... */ - for (i = 0x000;i < 0x400;i++) + for (int i = 0x000;i < 0x400;i++) m_palette->shadow_table()[i] = i; /* ... except for tilemap colors */ - for (i = 0x200;i < 0x300;i++) + for (int i = 0x200;i < 0x300;i++) m_palette->shadow_table()[i] = i + 0x100; } - -VIDEO_START_MEMBER(snk_state,marvins) +void marvins_state::video_start() { - VIDEO_START_CALL_MEMBER(snk_3bpp_shadow); + VIDEO_START_CALL_MEMBER(_3bpp_shadow); - m_tx_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(snk_state::marvins_get_tx_tile_info)), tilemap_mapper_delegate(*this, FUNC(snk_state::marvins_tx_scan_cols)), 8, 8, 36, 28); - m_fg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(snk_state::marvins_get_fg_tile_info)), TILEMAP_SCAN_COLS, 8, 8, 64, 32); - m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(snk_state::marvins_get_bg_tile_info)), TILEMAP_SCAN_COLS, 8, 8, 64, 32); + m_tx_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(marvins_state::marvins_get_tx_tile_info)), tilemap_mapper_delegate(*this, FUNC(marvins_state::marvins_tx_scan_cols)), 8, 8, 36, 28); + m_fg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(marvins_state::marvins_get_fg_tile_info)), TILEMAP_SCAN_COLS, 8, 8, 64, 32); + m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(marvins_state::marvins_get_bg_tile_info)), TILEMAP_SCAN_COLS, 8, 8, 64, 32); m_tx_tilemap->set_transparent_pen(15); m_tx_tilemap->set_scrolldy(8, 8); @@ -239,11 +247,14 @@ VIDEO_START_MEMBER(snk_state,marvins) m_bg_tilemap->set_scrolldy(8, -32); m_tx_tile_offset = 0; + + save_item(NAME(m_fg_scrollx)); + save_item(NAME(m_fg_scrolly)); } VIDEO_START_MEMBER(snk_state,jcross) { - VIDEO_START_CALL_MEMBER(snk_3bpp_shadow); + VIDEO_START_CALL_MEMBER(_3bpp_shadow); m_tx_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(snk_state::marvins_get_tx_tile_info)), tilemap_mapper_delegate(*this, FUNC(snk_state::marvins_tx_scan_cols)), 8, 8, 36, 28); m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(snk_state::aso_get_bg_tile_info)), TILEMAP_SCAN_COLS, 8, 8, 64, 64); @@ -262,7 +273,7 @@ VIDEO_START_MEMBER(snk_state,jcross) VIDEO_START_MEMBER(snk_state,sgladiat) { - VIDEO_START_CALL_MEMBER(snk_3bpp_shadow); + VIDEO_START_CALL_MEMBER(_3bpp_shadow); m_tx_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(snk_state::marvins_get_tx_tile_info)), tilemap_mapper_delegate(*this, FUNC(snk_state::marvins_tx_scan_cols)), 8, 8, 36, 28); m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(snk_state::aso_get_bg_tile_info)), TILEMAP_SCAN_COLS, 8, 8, 64, 32); @@ -302,7 +313,7 @@ VIDEO_START_MEMBER(snk_state,aso) VIDEO_START_MEMBER(snk_state,tnk3) { - VIDEO_START_CALL_MEMBER(snk_3bpp_shadow); + VIDEO_START_CALL_MEMBER(_3bpp_shadow); m_tx_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(snk_state::marvins_get_tx_tile_info)), tilemap_mapper_delegate(*this, FUNC(snk_state::marvins_tx_scan_cols)), 8, 8, 36, 28); m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(snk_state::tnk3_get_bg_tile_info)), TILEMAP_SCAN_COLS, 8, 8, 64, 64); @@ -318,12 +329,12 @@ VIDEO_START_MEMBER(snk_state,tnk3) m_tx_tile_offset = 0; } -VIDEO_START_MEMBER(snk_state,ikari) +void ikari_state::video_start() { - VIDEO_START_CALL_MEMBER(snk_3bpp_shadow); + VIDEO_START_CALL_MEMBER(_3bpp_shadow); - m_tx_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(snk_state::ikari_get_tx_tile_info)), tilemap_mapper_delegate(*this, FUNC(snk_state::marvins_tx_scan_cols)), 8, 8, 36, 28); - m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(snk_state::ikari_get_bg_tile_info)), TILEMAP_SCAN_COLS, 16, 16, 32, 32); + m_tx_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(ikari_state::ikari_get_tx_tile_info)), tilemap_mapper_delegate(*this, FUNC(ikari_state::marvins_tx_scan_cols)), 8, 8, 36, 28); + m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(ikari_state::ikari_get_bg_tile_info)), TILEMAP_SCAN_COLS, 16, 16, 32, 32); m_tx_tilemap->set_transparent_pen(15); m_tx_tilemap->set_scrolldy(8, 8); @@ -334,18 +345,16 @@ VIDEO_START_MEMBER(snk_state,ikari) m_tx_tile_offset = 0; } -VIDEO_START_MEMBER(snk_state,gwar) +VIDEO_START_MEMBER(bermudat_state,gwar) { - int i; - /* prepare drawmode table */ - for(i = 0; i <= 14; i++) m_drawmode_table[i] = DRAWMODE_SOURCE; + for (int i = 0; i <= 14; i++) m_drawmode_table[i] = DRAWMODE_SOURCE; m_drawmode_table[15] = DRAWMODE_NONE; memset(m_empty_tile, 0xf, sizeof(m_empty_tile)); - m_tx_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(snk_state::gwar_get_tx_tile_info)), TILEMAP_SCAN_COLS, 8, 8, 50, 32); - m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(snk_state::gwar_get_bg_tile_info)), TILEMAP_SCAN_COLS, 16, 16, 32, 32); + m_tx_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(bermudat_state::gwar_get_tx_tile_info)), TILEMAP_SCAN_COLS, 8, 8, 50, 32); + m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(bermudat_state::gwar_get_bg_tile_info)), TILEMAP_SCAN_COLS, 16, 16, 32, 32); m_tx_tilemap->set_transparent_pen(15); @@ -354,30 +363,32 @@ VIDEO_START_MEMBER(snk_state,gwar) m_tx_tile_offset = 0; - m_is_psychos = 0; + m_is_psychos = false; + + register_save_state(); } -VIDEO_START_MEMBER(snk_state,psychos) +VIDEO_START_MEMBER(bermudat_state,psychos) { VIDEO_START_CALL_MEMBER(gwar); - m_is_psychos = 1; + m_is_psychos = true; } -VIDEO_START_MEMBER(snk_state,tdfever) +VIDEO_START_MEMBER(bermudat_state,tdfever) { VIDEO_START_CALL_MEMBER(gwar); - VIDEO_START_CALL_MEMBER(snk_4bpp_shadow); + VIDEO_START_CALL_MEMBER(_4bpp_shadow); } /**************************************************************************************/ -void snk_state::snk_tx_videoram_w(offs_t offset, uint8_t data) +void snk_state::tx_videoram_w(offs_t offset, uint8_t data) { m_tx_videoram[offset] = data; m_tx_tilemap->mark_tile_dirty(offset); } -void snk_state::marvins_fg_videoram_w(offs_t offset, uint8_t data) +void marvins_state::marvins_fg_videoram_w(offs_t offset, uint8_t data) { m_fg_videoram[offset] = data; m_fg_tilemap->mark_tile_dirty(offset); @@ -389,75 +400,75 @@ void snk_state::marvins_bg_videoram_w(offs_t offset, uint8_t data) m_bg_tilemap->mark_tile_dirty(offset); } -void snk_state::snk_bg_videoram_w(offs_t offset, uint8_t data) +void snk_state::bg_videoram_w(offs_t offset, uint8_t data) { m_bg_videoram[offset] = data; m_bg_tilemap->mark_tile_dirty(offset >> 1); } -void snk_state::snk_fg_scrollx_w(uint8_t data) +void marvins_state::fg_scrollx_w(uint8_t data) { m_fg_scrollx = (m_fg_scrollx & ~0xff) | data; } -void snk_state::snk_fg_scrolly_w(uint8_t data) +void marvins_state::fg_scrolly_w(uint8_t data) { m_fg_scrolly = (m_fg_scrolly & ~0xff) | data; } -void snk_state::snk_bg_scrollx_w(uint8_t data) +void snk_state::bg_scrollx_w(uint8_t data) { m_bg_scrollx = (m_bg_scrollx & ~0xff) | data; } -void snk_state::snk_bg_scrolly_w(uint8_t data) +void snk_state::bg_scrolly_w(uint8_t data) { m_bg_scrolly = (m_bg_scrolly & ~0xff) | data; } -void snk_state::snk_sp16_scrollx_w(uint8_t data) +void snk_state::sp16_scrollx_w(uint8_t data) { m_sp16_scrollx = (m_sp16_scrollx & ~0xff) | data; } -void snk_state::snk_sp16_scrolly_w(uint8_t data) +void snk_state::sp16_scrolly_w(uint8_t data) { m_sp16_scrolly = (m_sp16_scrolly & ~0xff) | data; } -void snk_state::snk_sp32_scrollx_w(uint8_t data) +void snk_state::sp32_scrollx_w(uint8_t data) { m_sp32_scrollx = (m_sp32_scrollx & ~0xff) | data; } -void snk_state::snk_sp32_scrolly_w(uint8_t data) +void snk_state::sp32_scrolly_w(uint8_t data) { m_sp32_scrolly = (m_sp32_scrolly & ~0xff) | data; } -void snk_state::snk_sprite_split_point_w(uint8_t data) +void snk_state::sprite_split_point_w(uint8_t data) { m_sprite_split_point = data; } -void snk_state::marvins_palette_bank_w(uint8_t data) +void marvins_state::marvins_palette_bank_w(uint8_t data) { m_bg_tilemap->set_palette_offset(data & 0x70); m_fg_tilemap->set_palette_offset((data & 0x07) << 4); } -void snk_state::marvins_flipscreen_w(uint8_t data) +void marvins_state::marvins_flipscreen_w(uint8_t data) { - flip_screen_set(data & 0x80); + flip_screen_set(BIT(data, 7)); // other bits unknown } void snk_state::sgladiat_flipscreen_w(uint8_t data) { - flip_screen_set(data & 0x80); + flip_screen_set(BIT(data, 7)); m_bg_tilemap->set_palette_offset(((data & 0xf) ^ 8) << 4); @@ -466,7 +477,7 @@ void snk_state::sgladiat_flipscreen_w(uint8_t data) void snk_state::hal21_flipscreen_w(uint8_t data) { - flip_screen_set(data & 0x80); + flip_screen_set(BIT(data, 7)); m_bg_tilemap->set_palette_offset(((data & 0xf) ^ 8) << 4); if (m_bg_tile_offset != ((data & 0x20) << 3)) @@ -478,7 +489,7 @@ void snk_state::hal21_flipscreen_w(uint8_t data) // other bits unknown } -void snk_state::marvins_scroll_msb_w(uint8_t data) +void marvins_state::marvins_scroll_msb_w(uint8_t data) { m_bg_scrollx = (m_bg_scrollx & 0xff) | ((data & 0x04) << 6); m_fg_scrollx = (m_fg_scrollx & 0xff) | ((data & 0x02) << 7); @@ -514,7 +525,7 @@ void snk_state::aso_videoattrs_w(uint8_t data) */ - flip_screen_set(data & 0x20); + flip_screen_set(BIT(data, 5)); m_bg_scrolly = (m_bg_scrolly & 0xff) | ((data & 0x10) << 4); m_sp16_scrolly = (m_sp16_scrolly & 0xff) | ((data & 0x08) << 5); @@ -537,7 +548,7 @@ void snk_state::tnk3_videoattrs_w(uint8_t data) */ - flip_screen_set(data & 0x80); + flip_screen_set(BIT(data, 7)); if (m_tx_tile_offset != ((data & 0x40) << 2)) { @@ -561,13 +572,13 @@ void snk_state::aso_bg_bank_w(uint8_t data) } } -void snk_state::ikari_bg_scroll_msb_w(uint8_t data) +void ikari_state::ikari_bg_scroll_msb_w(uint8_t data) { m_bg_scrollx = (m_bg_scrollx & 0xff) | ((data & 0x02) << 7); m_bg_scrolly = (m_bg_scrolly & 0xff) | ((data & 0x01) << 8); } -void snk_state::ikari_sp_scroll_msb_w(uint8_t data) +void ikari_state::ikari_sp_scroll_msb_w(uint8_t data) { m_sp32_scrollx = (m_sp32_scrollx & 0xff) | ((data & 0x20) << 3); m_sp16_scrollx = (m_sp16_scrollx & 0xff) | ((data & 0x10) << 4); @@ -575,7 +586,7 @@ void snk_state::ikari_sp_scroll_msb_w(uint8_t data) m_sp16_scrolly = (m_sp16_scrolly & 0xff) | ((data & 0x04) << 6); } -void snk_state::ikari_unknown_video_w(uint8_t data) +void ikari_state::ikari_unknown_video_w(uint8_t data) { /* meaning of 0xc980 uncertain. Normally 0x20, ikaria/ikarijp sets it to 0x31 during test mode. @@ -597,7 +608,7 @@ void snk_state::ikari_unknown_video_w(uint8_t data) } } -void snk_state::gwar_tx_bank_w(uint8_t data) +void bermudat_state::gwar_tx_bank_w(uint8_t data) { m_tx_tilemap->set_palette_offset((data & 0xf) << 4); if (m_tx_tile_offset != ((data & 0x30) << 4)) @@ -610,9 +621,9 @@ void snk_state::gwar_tx_bank_w(uint8_t data) m_bg_tilemap->set_palette_offset((data & 0x80)); } -void snk_state::gwar_videoattrs_w(uint8_t data) +void bermudat_state::gwar_videoattrs_w(uint8_t data) { - flip_screen_set(data & 0x04); + flip_screen_set(BIT(data, 2)); m_sp32_scrollx = (m_sp32_scrollx & 0xff) | ((data & 0x80) << 1); m_sp16_scrollx = (m_sp16_scrollx & 0xff) | ((data & 0x40) << 2); @@ -622,15 +633,15 @@ void snk_state::gwar_videoattrs_w(uint8_t data) m_bg_scrolly = (m_bg_scrolly & 0xff) | ((data & 0x01) << 8); } -void snk_state::gwara_videoattrs_w(uint8_t data) +void bermudat_state::gwara_videoattrs_w(uint8_t data) { - flip_screen_set(data & 0x10); + flip_screen_set(BIT(data, 4)); m_bg_scrollx = (m_bg_scrollx & 0xff) | ((data & 0x02) << 7); m_bg_scrolly = (m_bg_scrolly & 0xff) | ((data & 0x01) << 8); } -void snk_state::gwara_sp_scroll_msb_w(uint8_t data) +void bermudat_state::gwara_sp_scroll_msb_w(uint8_t data) { m_sp32_scrollx = (m_sp32_scrollx & 0xff) | ((data & 0x20) << 3); m_sp16_scrollx = (m_sp16_scrollx & 0xff) | ((data & 0x10) << 4); @@ -638,18 +649,18 @@ void snk_state::gwara_sp_scroll_msb_w(uint8_t data) m_sp16_scrolly = (m_sp16_scrolly & 0xff) | ((data & 0x04) << 6); } -void snk_state::tdfever_sp_scroll_msb_w(uint8_t data) +void bermudat_state::tdfever_sp_scroll_msb_w(uint8_t data) { m_sp32_scrolly = (m_sp32_scrolly & 0xff) | ((data & 0x80) << 1); m_sp32_scrollx = (m_sp32_scrollx & 0xff) | ((data & 0x40) << 2); } -void snk_state::tdfever_spriteram_w(offs_t offset, uint8_t data) +void bermudat_state::tdfever_spriteram_w(offs_t offset, uint8_t data) { /* partial updates avoid flickers in the fsoccer radar. */ if (offset < 0x80 && m_spriteram[offset] != data) { - int vpos = m_screen->vpos(); + const int vpos = m_screen->vpos(); if (vpos > 0) m_screen->update_partial(vpos - 1); @@ -660,23 +671,28 @@ void snk_state::tdfever_spriteram_w(offs_t offset, uint8_t data) /**************************************************************************************/ -void snk_state::marvins_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, const int scrollx, const int scrolly, const int from, const int to) +void marvins_state::marvins_draw_sprites( + bitmap_ind16 &bitmap, + const rectangle &cliprect, + const int scrollx, + const int scrolly, + const int from, + const int to) { - gfx_element *gfx = m_gfxdecode->gfx(3); - const uint8_t *source, *finish; + gfx_element *const gfx = m_gfxdecode->gfx(3); - source = m_spriteram + from*4; - finish = m_spriteram + to*4; + const uint8_t *source = m_spriteram + from * 4; + const uint8_t *finish = m_spriteram + to * 4; - while( source 512-16) sx -= 512; - if (sy > 256-16) sy -= 256; + if (sx > 512 - 16) sx -= 512; + if (sy > 256 - 16) sy -= 256; gfx->transtable(bitmap,cliprect, tile_number, @@ -698,19 +714,15 @@ void snk_state::marvins_draw_sprites(bitmap_ind16 &bitmap, const rectangle &clip sx, sy, m_drawmode_table); - source+=4; + source += 4; } } void snk_state::tnk3_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, const int xscroll, const int yscroll) { - uint8_t *spriteram = m_spriteram; - gfx_element *gfx = m_gfxdecode->gfx(2); + gfx_element *const gfx = m_gfxdecode->gfx(2); const int size = gfx->width(); - int tile_number, attributes, color, sx, sy; - int xflip,yflip; - int offs; /* jcross and sgladiat have only 25 sprites, the others 50 */ @@ -718,17 +730,17 @@ void snk_state::tnk3_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprec /* sgladiat and tnk3 have 512 tiles, bit 6 is bank and bit 5 is y-flip */ /* athena has 1024 tiles, bit 6 and bit 5 are bank */ - for (offs = 0; offs < m_num_sprites*4; offs += 4) + for (int offs = 0; offs < m_num_sprites * 4; offs += 4) { - tile_number = spriteram[offs+1]; - attributes = spriteram[offs+3]; - color = attributes & 0xf; - sx = xscroll + 301 - size - spriteram[offs+2]; - sy = -yscroll + 7 - size + spriteram[offs]; + uint32_t tile_number = m_spriteram[offs + 1]; + const uint8_t attributes = m_spriteram[offs + 3]; + const uint32_t color = attributes & 0xf; + int sx = xscroll + 301 - size - m_spriteram[offs + 2]; + int sy = -yscroll + 7 - size + m_spriteram[offs]; sx += (attributes & 0x80) << 1; sy += (attributes & 0x10) << 4; - xflip = 0; - yflip = 0; + bool xflip = false; + bool yflip = false; if (gfx->elements() > 256) // all except jcross { @@ -741,7 +753,7 @@ void snk_state::tnk3_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprec } else // all others { - yflip = attributes & 0x20; + yflip = BIT(attributes, 5); } if (flip_screen()) @@ -754,8 +766,8 @@ void snk_state::tnk3_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprec sx &= 0x1ff; sy &= m_yscroll_mask; // sgladiat apparently has only 256 pixels of vertical scrolling range - if (sx > 512-size) sx -= 512; - if (sy > (m_yscroll_mask+1)-size) sy -= (m_yscroll_mask+1); + if (sx > 512 - size) sx -= 512; + if (sy > (m_yscroll_mask + 1) - size) sy -= (m_yscroll_mask + 1); gfx->transtable(bitmap,cliprect, tile_number, @@ -767,22 +779,27 @@ void snk_state::tnk3_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprec } -void snk_state::ikari_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, const int start, const int xscroll, const int yscroll, const uint8_t *source, const int gfxnum ) +void ikari_state::ikari_draw_sprites( + bitmap_ind16 &bitmap, + const rectangle &cliprect, + const int start, + const int xscroll, + const int yscroll, + const uint8_t *source, + const int gfxnum) { - gfx_element *gfx = m_gfxdecode->gfx(gfxnum); + gfx_element *const gfx = m_gfxdecode->gfx(gfxnum); const int size = gfx->width(); - int tile_number, attributes, color, sx, sy; - int which, finish; - finish = (start+25)*4; + const int finish = (start + 25) * 4; - for (which = start*4; which < finish; which += 4) + for (int which = start * 4; which < finish; which += 4) { - tile_number = source[which+1]; - attributes = source[which+3]; - color = attributes & 0xf; - sx = xscroll + 300 - size - source[which+2]; - sy = -yscroll + 7 - size + source[which]; + uint32_t tile_number = source[which + 1]; + const uint8_t attributes = source[which + 3]; + const uint32_t color = attributes & 0xf; + int sx = xscroll + 300 - size - source[which + 2]; + int sy = -yscroll + 7 - size + source[which]; sx += (attributes & 0x80) << 1; sy += (attributes & 0x10) << 4; @@ -799,8 +816,8 @@ void snk_state::ikari_draw_sprites(bitmap_ind16 &bitmap, const rectangle &clipre sx &= 0x1ff; sy &= 0x1ff; - if (sx > 512-size) sx -= 512; - if (sy > 512-size) sy -= 512; + if (sx > 512 - size) sx -= 512; + if (sy > 512 - size) sy -= 512; gfx->transtable(bitmap,cliprect, tile_number, @@ -837,22 +854,27 @@ byte3: attributes -xx-x--- (bank number) x------- (x offset bit8) */ -void snk_state::tdfever_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, const int xscroll, const int yscroll, const uint8_t *source, const int gfxnum, - const int hw_xflip, const int from, const int to) -{ - gfx_element *gfx = m_gfxdecode->gfx(gfxnum); +void bermudat_state::tdfever_draw_sprites( + bitmap_ind16 &bitmap, + const rectangle &cliprect, + const int xscroll, + const int yscroll, + const uint8_t *source, + const int gfxnum, + const bool hw_xflip, + const int from, + const int to) +{ + gfx_element *const gfx = m_gfxdecode->gfx(gfxnum); const int size = gfx->width(); - int tile_number, attributes, sx, sy, color; - int which; - int flipx, flipy; - for(which = from*4; which < to*4; which+=4) + for (int which = from * 4; which < to * 4; which += 4) { - tile_number = source[which+1]; - attributes = source[which+3]; - color = attributes & 0x0f; - sx = -xscroll - 9 + source[which+2]; - sy = -yscroll + 1 - size + source[which]; + uint32_t tile_number = source[which+1]; + const uint8_t attributes = source[which+3]; + uint32_t color = attributes & 0x0f; + int sx = -xscroll - 9 + source[which+2]; + int sy = -yscroll + 1 - size + source[which]; sx += (attributes & 0x80) << 1; sy += (attributes & 0x10) << 4; @@ -870,8 +892,8 @@ void snk_state::tdfever_draw_sprites(bitmap_ind16 &bitmap, const rectangle &clip break; } - flipx = hw_xflip; - flipy = 0; + bool flipx = hw_xflip; + bool flipy = false; if (hw_xflip) sx = 495 - size - sx; @@ -900,7 +922,7 @@ void snk_state::tdfever_draw_sprites(bitmap_ind16 &bitmap, const rectangle &clip /**************************************************************/ -uint32_t snk_state::screen_update_marvins(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t marvins_state::screen_update_marvins(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_bg_tilemap->set_scrollx(0, m_bg_scrollx); m_bg_tilemap->set_scrolly(0, m_bg_scrolly); @@ -935,15 +957,14 @@ uint32_t snk_state::screen_update_fitegolf2(screen_device &screen, bitmap_ind16 m_bg_tilemap->set_scrolly(0, m_bg_scrolly); m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); - tnk3_draw_sprites(bitmap, cliprect, m_sp16_scrollx+1, m_sp16_scrolly); // needs an extra offset?? neither this or fitegolf actually write to sprite offset registers tho? + tnk3_draw_sprites(bitmap, cliprect, m_sp16_scrollx + 1, m_sp16_scrolly); // needs an extra offset?? neither this or fitegolf actually write to sprite offset registers tho? m_tx_tilemap->draw(screen, bitmap, cliprect, 0, 0); return 0; } - -uint32_t snk_state::screen_update_ikari(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t ikari_state::screen_update_ikari(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_bg_tilemap->set_scrollx(0, m_bg_scrollx); m_bg_tilemap->set_scrolly(0, m_bg_scrolly); @@ -959,16 +980,16 @@ uint32_t snk_state::screen_update_ikari(screen_device &screen, bitmap_ind16 &bit } -uint32_t snk_state::screen_update_gwar(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t bermudat_state::screen_update_gwar(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_bg_tilemap->set_scrollx(0, m_bg_scrollx); m_bg_tilemap->set_scrolly(0, m_bg_scrolly); m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); - tdfever_draw_sprites(bitmap, cliprect, m_sp16_scrollx, m_sp16_scrolly, m_spriteram + 0x800, 2, 0, 0, m_sprite_split_point ); - tdfever_draw_sprites(bitmap, cliprect, m_sp32_scrollx, m_sp32_scrolly, m_spriteram, 3, 0, 0, 32 ); - tdfever_draw_sprites(bitmap, cliprect, m_sp16_scrollx, m_sp16_scrolly, m_spriteram + 0x800, 2, 0, m_sprite_split_point, 64 ); + tdfever_draw_sprites(bitmap, cliprect, m_sp16_scrollx, m_sp16_scrolly, m_spriteram + 0x800, 2, false, 0, m_sprite_split_point ); + tdfever_draw_sprites(bitmap, cliprect, m_sp32_scrollx, m_sp32_scrolly, m_spriteram, 3, false, 0, 32 ); + tdfever_draw_sprites(bitmap, cliprect, m_sp16_scrollx, m_sp16_scrolly, m_spriteram + 0x800, 2, false, m_sprite_split_point, 64 ); m_tx_tilemap->draw(screen, bitmap, cliprect, 0, 0); @@ -976,14 +997,14 @@ uint32_t snk_state::screen_update_gwar(screen_device &screen, bitmap_ind16 &bitm } -uint32_t snk_state::screen_update_tdfever(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t bermudat_state::screen_update_tdfever(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_bg_tilemap->set_scrollx(0, m_bg_scrollx); m_bg_tilemap->set_scrolly(0, m_bg_scrolly); m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); - tdfever_draw_sprites(bitmap, cliprect, m_sp32_scrollx, m_sp32_scrolly, m_spriteram, 2, 1, 0, 32 ); + tdfever_draw_sprites(bitmap, cliprect, m_sp32_scrollx, m_sp32_scrolly, m_spriteram, 2, true, 0, 32); m_tx_tilemap->draw(screen, bitmap, cliprect, 0, 0); diff --git a/src/mame/sony/zn.cpp b/src/mame/sony/zn.cpp index 87e2e5cfe35f8..e41b67f0dbae4 100644 --- a/src/mame/sony/zn.cpp +++ b/src/mame/sony/zn.cpp @@ -4710,7 +4710,7 @@ ROM_START( cbajbl ) ROM_LOAD( "uo220.bin", 0x1400000, 0x200000, BAD_DUMP CRC(19102f15) SHA1(b7964e0cb53b608b775d7a713b63f13307b1b532) ) // cb-04.220 [1/2] 2 bits different ROM_LOAD( "uo220h.bin", 0x1600000, 0x200000, BAD_DUMP CRC(e7b94df3) SHA1(07b5d85e1a337f10c25cebdb0f3f893e38a1db6c) ) // cb-04.220 [2/2] 5 bits different ROM_LOAD( "uo221.bin", 0x1800000, 0x200000, CRC(701d7c4e) SHA1(b06c2db7e06d453991f9872bcb62951eb62b5d56) ) // cb-05.221 [1/2] - ROM_LOAD( "uo221h.bin" , 0x1a00000, 0x200000, CRC(5e93c0d6) SHA1(2ec5afd53eee9e8e6e2ac91a269a5ec55cef4da1) ) // cb-05.221 [2/2] + ROM_LOAD( "uo221h.bin", 0x1a00000, 0x200000, CRC(5e93c0d6) SHA1(2ec5afd53eee9e8e6e2ac91a269a5ec55cef4da1) ) // cb-05.221 [2/2] ROM_LOAD( "uo222.bin", 0x1c00000, 0x200000, CRC(76ad7801) SHA1(9cb38aff86f3f8151145f2661bf1261adbd2ec1c) ) // cb-06.222 [1/2] ROM_LOAD( "uo222h.bin", 0x1e00000, 0x200000, CRC(34561670) SHA1(2131fcbbc8bc3da31cd4ef027ec6688af212b7c1) ) // cb-06.222 [2/2] ROM_LOAD( "uo223.bin", 0x2000000, 0x200000, CRC(d4a80392) SHA1(d8d69e8a15910471b718dc6531e4470fc35365cc) ) // cb-07.223 [1/2] diff --git a/src/mame/subsino/subsino2.cpp b/src/mame/subsino/subsino2.cpp index b28ee4f41822d..9924e93088c7d 100644 --- a/src/mame/subsino/subsino2.cpp +++ b/src/mame/subsino/subsino2.cpp @@ -45,7 +45,7 @@ RAMDAC. - Add sound to SS9804/SS9904 games. - ptrain: missing scroll in race screens. - humlan: empty reels when bonus image should scroll in via L0 scroll. The image (crown/fruits) is at y > 0x100 in the tilemap. -- bishjan, new2001, humlan, saklove, squeenb: game is sometimes too fast (can bishjan read the VBLANK state? saklove and xplan can). +- bishjan, new2001, humlan, saklove, squeenb, queenbn: game is sometimes too fast (can bishjan read the VBLANK state? saklove and xplan can). - xtrain: it runs faster than a video from the real thing. It doesn't use vblank irqs (but reads the vblank bit). - mtrain: implement hopper. - xplan: starts with 4 credits, no controls to move the aircraft @@ -66,6 +66,7 @@ by the otherwise seemingly unnecessary internal ROMs. ************************************************************************************************************/ #include "emu.h" + #include "subsino_crypt.h" #include "subsino_io.h" @@ -78,6 +79,7 @@ by the otherwise seemingly unnecessary internal ROMs. #include "sound/okim6295.h" #include "sound/ymopl.h" #include "video/ramdac.h" + #include "emupal.h" #include "screen.h" #include "speaker.h" @@ -132,23 +134,25 @@ class subsino2_state : public driver_device , m_leds(*this, "led%u", 0U) { } - void bishjan(machine_config &config); - void xiaoao(machine_config &config); - void saklove(machine_config &config); - void mtrain(machine_config &config); - void tbonusal(machine_config &config); - void humlan(machine_config &config); - void new2001(machine_config &config); - void expcard(machine_config &config); - void xplan(machine_config &config); - void xtrain(machine_config &config); - void ptrain(machine_config &config); - - void init_wtrnymph(); - void init_mtrain(); - void init_tbonusal(); + void bishjan(machine_config &config) ATTR_COLD; + void xiaoao(machine_config &config) ATTR_COLD; + void saklove(machine_config &config) ATTR_COLD; + void mtrain(machine_config &config) ATTR_COLD; + void tbonusal(machine_config &config) ATTR_COLD; + void humlan(machine_config &config) ATTR_COLD; + void queenbn(machine_config &config) ATTR_COLD; + void new2001(machine_config &config) ATTR_COLD; + void expcard(machine_config &config) ATTR_COLD; + void xplan(machine_config &config) ATTR_COLD; + void xtrain(machine_config &config) ATTR_COLD; + void ptrain(machine_config &config) ATTR_COLD; + + void init_wtrnymph() ATTR_COLD; + void init_mtrain() ATTR_COLD; + void init_tbonusal() ATTR_COLD; protected: + virtual void machine_start() override ATTR_COLD { m_leds.resolve(); } virtual void video_start() override ATTR_COLD; private: @@ -225,7 +229,7 @@ class subsino2_state : public driver_device TILE_GET_INFO_MEMBER(ss9601_get_tile_info_0); TILE_GET_INFO_MEMBER(ss9601_get_tile_info_1); - uint32_t screen_update_subsino2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void bishjan_map(address_map &map) ATTR_COLD; void mtrain_io(address_map &map) ATTR_COLD; @@ -239,8 +243,6 @@ class subsino2_state : public driver_device void xplan_io(address_map &map) ATTR_COLD; void xplan_map(address_map &map) ATTR_COLD; - virtual void machine_start() override { m_leds.resolve(); } - layer_t m_layers[2]; uint8_t m_ss9601_byte_lo; uint8_t m_ss9601_byte_lo2; @@ -745,7 +747,7 @@ void subsino2_state::video_start() save_item(NAME(m_bishjan_input)); } -uint32_t subsino2_state::screen_update_subsino2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t subsino2_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int layers_ctrl = ~m_ss9601_disable; int y; @@ -2807,7 +2809,7 @@ void subsino2_state::bishjan(machine_config &config) m_screen->set_size(512, 256); m_screen->set_visarea(0, 512-1, 0, 256-16-1); m_screen->set_refresh_hz(60); - m_screen->set_screen_update(FUNC(subsino2_state::screen_update_subsino2)); + m_screen->set_screen_update(FUNC(subsino2_state::screen_update)); m_screen->set_palette(m_palette); m_screen->screen_vblank().set_inputline(m_maincpu, 0); // edge-triggered interrupt @@ -2868,6 +2870,13 @@ void subsino2_state::humlan(machine_config &config) // SS9804 } +void subsino2_state::queenbn(machine_config &config) +{ + humlan(config); + + m_maincpu->set_clock(48.94_MHz_XTAL / 3); +} + /*************************************************************************** Magic Train ***************************************************************************/ @@ -2902,7 +2911,7 @@ void subsino2_state::mtrain(machine_config &config) m_screen->set_visarea(0, 512-1, 0, 256-32-1); m_screen->set_refresh_hz(58.7270); m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(2500) /* not accurate */); // game reads vblank state - m_screen->set_screen_update(FUNC(subsino2_state::screen_update_subsino2)); + m_screen->set_screen_update(FUNC(subsino2_state::screen_update)); m_screen->set_palette(m_palette); GFXDECODE(config, m_gfxdecode, m_palette, gfx_ss9601); @@ -2962,7 +2971,7 @@ void subsino2_state::saklove(machine_config &config) m_screen->set_visarea(0, 512-1, 0, 256-16-1); m_screen->set_refresh_hz(58.7270); m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(2500) /* not accurate */); // game reads vblank state - m_screen->set_screen_update(FUNC(subsino2_state::screen_update_subsino2)); + m_screen->set_screen_update(FUNC(subsino2_state::screen_update)); m_screen->set_palette(m_palette); GFXDECODE(config, m_gfxdecode, m_palette, gfx_ss9601); @@ -3013,7 +3022,7 @@ void subsino2_state::xplan(machine_config &config) m_screen->set_visarea(0, 512-1, 0, 256-16-1); m_screen->set_refresh_hz(58.7270); m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(2500) /* not accurate */); // game reads vblank state - m_screen->set_screen_update(FUNC(subsino2_state::screen_update_subsino2)); + m_screen->set_screen_update(FUNC(subsino2_state::screen_update)); m_screen->set_palette(m_palette); m_screen->screen_vblank().set("maincpu", FUNC(am188em_device::int0_w)); @@ -3075,46 +3084,66 @@ void subsino2_state::expcard(machine_config &config) /*************************************************************************** -Bishou Jan (Laugh World) -(C)1999 Subsino - -PCB Layout ----------- - -|------------------------------------------------------| -|TDA1519A 28-WAY | -| VOL | -| HM86171 ULN2003 | -| LM324 | -| S-1 ULN2003 | -| | -| |-------| DSW1(8) | -| |-------| |SUBSINO| | -| 2-V201.U9 |SUBSINO| |SS9802 | | -| |SS9904 | | | | -| | | |-------| | -| |-------| | -| | -| 44.1MHz CXK58257 | -| 3-V201.U25 | -| 1-V203.U21 | -| 4-V201.U26 SW1| -| |-------| |-------| |-----| | -| 5-V201.U27 |SUBSINO| |SUBSINO| |H8 | | -| |SS9601 | |SS9803 | |3044 | | -| 6-V201.U28 | | | | |-----| | -| |-------| |-------| | -| 62256 62256 BATTERY | +Bishou Jan (Laugh World), Subsino, 1999 (with Mahjong 28-way edge instead of 10 + 18 way) +Xiao Ao Jiang Hu (China, Ver. 1.00), Subsino, 1999 +Queen Bee New, Subsino, 2002 +(Several other games produced between 1998-2003 run on this same PCB) +Hardware Info By Guru +--------------------- + +|---| |-----------| |--------------------| |----| +| |--| 10-WAY |------| 18-WAY |--| | +|TDA1519A | +| VOL HM86171 | +|-| LM324 ULN2003 | + |DS1230.Q3 S-1 ULN2003 | +|-| SND.U10 |-------| |-------| DS1| +| LM7805 % |SUBSINO| |SUBSINO| | +| |SS9904 | |SS9802 | | +| | | | | | +|J |-------| |-------| | +|A | +|M XTAL T518B | +|M GFX1.U25 CXK58257| +|A PROG.U21 | +| GFX2.U26 SW1| +| * |-------| |-------| |-----| | +| GFX3.U27 |SUBSINO| |SUBSINO| |H8 | | +|-| |SS9601 | |SS9803 | |3044 | | + | GFX4.U28 | | | | |-----| | +|-| |-------| |-------| | +| CN1 62256 62256 BATTERY | |------------------------------------------------------| Notes: H8/3044 - Subsino re-badged Hitachi H8/3044 HD6433044A22F Microcontroller (QFP100) - The H8/3044 is a H8/3002 with 24bit address bus and has 32k mask ROM and 2k RAM, clock input is 14.7MHz [44.1/3] + The H8/3044 is a H8/3002 with 24bit address bus and has 32kB mask ROM and 2kB RAM, clock input is XTAL/3. MD0,MD1 & MD2 are configured to MODE 6 16MByte Expanded Mode with the on-chip 32k mask ROM enabled. - CXK58257 - Sony CXK58257 32k x8 SRAM (SOP28) + CXK58257 - Sony CXK58257 32kB x8-bit SRAM (SOP28). This RAM is battery-backed. HM86171 - Hualon Microelectronics HMC HM86171 VGA 256 colour RAMDAC (DIP28) - S-1 - ?? Probably some kind of audio OP AMP or DAC? (DIP8) - SW1 - Push Button Test Switch - HSync - 15.75kHz + SS9904 - Custom Subsino Sound Chip (QFP100) + SS9802 - Custom Subsino Chip (QFP100) (I/O & Protection; DS1230A is connected to this chip) + SS9803 - Custom Subsino Chip (QFP100) (Memory Controller) + SS9601 - Custom Subsino Chip (QFP160) (Graphics) + S-1 - Some kind of Audio DAC (DIP8). Connected to LM324 Operational Amplifier + LM324 - Texas Instruments LM324 Quad Operational Amplifier + SW1 - Push Button For NVRAM Clear And Reset + DS1 - 8-Position DIP Switch + BATTERY - 3.6V Ni-Cad Battery + ULN2003 - ULN2003 7-Channel Darlington Transistor Array + CN1 - 64-Pin Expansion Connector for ROM Daughter Board (not populated) + XTAL - Bishou Jan uses 44.1MHz Crystal + Xiao Ao Jiang Hu uses 44.1MHz Crystal + Queen Bee New uses 48.94MHz Crystal + DS1230.Q3 - Dallas DS1230A 1-Wire EEPROM (TO92). Hidden among other parts disguised as a transistor. + Each game has different EEPROM data used for protection. + All these have the surface scratched and the part location is marked Q3. + PROG.U21 - 27C020 or 27C040 EPROM (main program) + SND.U10 - 27C080 or 27C040 EPROM. Game boots to I/O test screen if this ROM is not present so this is a program ROM for + the sound chip and possibly audio data/samples. + % - Location for SOP44 ROM at U9 + GFX.U* - 27C040 or 27C080 EPROM (graphics) + * - Location for a SSOP70 1MB x32-bit ROM at U24. Used on Xiao Ao Jiang Hu instead of 4x EPROMs. + HSync - 15.62kHz VSync - 60Hz ***************************************************************************/ @@ -3153,6 +3182,25 @@ ROM_START( xiaoao ) ROM_LOAD( "xiaoaojianghu-ds2430a.q3", 0x00, 0x28, CRC(518e4ba3) SHA1(704fb6f8ff9966d1b90af849b2b7c6df06d3e4a0) ) ROM_END +ROM_START( queenbn ) // PCB has been hacked to make it work with Queen Bee New instead of Bishou Jan + ROM_REGION( 0x100000, "maincpu", 0 ) + ROM_LOAD( "ss9689_6433044a22f.u16", 0x000000, 0x008000, CRC(ece09075) SHA1(a8bc3aa44f30a6f919f4151c6093fb52e5da2f40) ) + ROM_LOAD( "prg.u21", 0x080000, 0x040000, CRC(e04e5926) SHA1(e17d0015742f9646a6702f8e45845b0c537064e8) ) + ROM_RELOAD( 0x0c0000, 0x040000 ) + + ROM_REGION( 0x200000, "tilemap", 0 ) + ROM_LOAD32_BYTE( "gfx.u25", 0x00000, 0x80000, CRC(c1a5269f) SHA1(a99d5ecc404c3b5bbd69f6f6b6aa0d91df5f97b6) ) + ROM_LOAD32_BYTE( "gfx.u26", 0x00002, 0x80000, CRC(11958b79) SHA1(b9e0df7cd31abd081df62df3805d9ad80d69b9f3) ) + ROM_LOAD32_BYTE( "gfx.u27", 0x00001, 0x80000, CRC(56474613) SHA1(c26211d3c1a3e6eea4e097b4a4ea12743559a5ff) ) + ROM_LOAD32_BYTE( "gfx.u28", 0x00003, 0x80000, CRC(860a85cd) SHA1(f54ac488b26b11e37cf990a0804d40a2df5cbb16) ) + + ROM_REGION( 0x80000, "samples", 0 ) + ROM_LOAD( "snd.u9", 0x00000, 0x80000, CRC(aa4edabb) SHA1(b117ad5bba2e410e20b5cbdb606688c6e2112450) ) + + ROM_REGION( 0x28, "eeprom", 0 ) + ROM_LOAD( "ds2430a-queen-bee-new.q3", 0x00, 0x28, CRC(4f9c3db6) SHA1(7cdc8e4c2fc5528ba33489d38732e753ef01b8fc) ) +ROM_END + /*************************************************************************** @@ -4017,16 +4065,18 @@ GAME( 2000, new2001, 0, new2001, new2001, subsino2_state, empty_ini GAME( 2006, xplan, 0, xplan, xplan, subsino2_state, empty_init, ROT0, "Subsino", "X-Plan (Ver. 101)", MACHINE_NOT_WORKING ) -GAME( 2001, queenbee, 0, humlan, queenbee, subsino2_state, empty_init, ROT0, "Subsino (American Alpha license)", "Queen Bee (Ver. 114)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // severe timing issues -GAME( 2001, queenbeeb, queenbee, humlan, queenbee, subsino2_state, empty_init, ROT0, "Subsino", "Queen Bee (Brazil, Ver. 202)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // severe timing issues, only program ROM available -GAME( 2001, queenbeei, queenbee, humlan, queenbee, subsino2_state, empty_init, ROT0, "Subsino", "Queen Bee (Israel, Ver. 100)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // severe timing issues, only program ROM available -GAME( 2001, queenbeesa, queenbee, humlan, queenbee, subsino2_state, empty_init, ROT0, "Subsino", "Queen Bee (SA-101-HARD)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // severe timing issues, only program ROM available +GAME( 2001, queenbee, 0, humlan, queenbee, subsino2_state, empty_init, ROT0, "Subsino (American Alpha license)", "Queen Bee (Ver. 114)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND | MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_TIMING ) // severe timing issues +GAME( 2001, queenbeeb, queenbee, humlan, queenbee, subsino2_state, empty_init, ROT0, "Subsino", "Queen Bee (Brazil, Ver. 202)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND | MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_TIMING ) // severe timing issues, only program ROM available +GAME( 2001, queenbeei, queenbee, humlan, queenbee, subsino2_state, empty_init, ROT0, "Subsino", "Queen Bee (Israel, Ver. 100)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND | MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_TIMING ) // severe timing issues, only program ROM available +GAME( 2001, queenbeesa, queenbee, humlan, queenbee, subsino2_state, empty_init, ROT0, "Subsino", "Queen Bee (SA-101-HARD)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND | MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_TIMING ) // severe timing issues, only program ROM available + +GAME( 2001, humlan, queenbee, humlan, humlan, subsino2_state, empty_init, ROT0, "Subsino (Truemax license)", "Humlan's Lyckohjul (Sweden, Ver. 402)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND | MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_TIMING ) // severe timing issues -GAME( 2001, humlan, queenbee, humlan, humlan, subsino2_state, empty_init, ROT0, "Subsino (Truemax license)", "Humlan's Lyckohjul (Sweden, Ver. 402)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // severe timing issues +GAME( 2002, queenbn, 0, queenbn, humlan, subsino2_state, empty_init, ROT0, "Subsino", "NuWang Feng New / Queen Bee New (China, Ver. 1.10)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND | MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_TIMING ) // severe timing issues -GAME( 2002, xreel, queenbee, humlan, humlan, subsino2_state, empty_init, ROT0, "Subsino (ECM license)", "X-Reel", MACHINE_NOT_WORKING | MACHINE_NO_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // severe timing issues +GAME( 2002, xreel, queenbee, humlan, humlan, subsino2_state, empty_init, ROT0, "Subsino (ECM license)", "X-Reel", MACHINE_NOT_WORKING | MACHINE_NO_SOUND | MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_TIMING ) // severe timing issues -GAME( 2002, squeenb, 0, humlan, humlan, subsino2_state, empty_init, ROT0, "Subsino", "Super Queen Bee (Ver. 101)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // severe timing issues +GAME( 2002, squeenb, 0, humlan, humlan, subsino2_state, empty_init, ROT0, "Subsino", "Super Queen Bee (Ver. 101)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND | MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_TIMING ) // severe timing issues GAME( 2003, qbeebing, 0, humlan, qbeebing, subsino2_state, empty_init, ROT0, "Subsino", "Queen Bee Bingo", MACHINE_NOT_WORKING | MACHINE_NO_SOUND | MACHINE_IMPERFECT_GRAPHICS ) diff --git a/src/mame/sunelectronics/shanghai.cpp b/src/mame/sunelectronics/shanghai.cpp index cd0ddbb3f3332..03a5a1a0cf603 100644 --- a/src/mame/sunelectronics/shanghai.cpp +++ b/src/mame/sunelectronics/shanghai.cpp @@ -173,11 +173,11 @@ void shanghai_state::kothello_sound_map(address_map &map) map(0x4008, 0x4009).rw("seibu_sound", FUNC(seibu_sound_device::ym_r), FUNC(seibu_sound_device::ym_w)); map(0x4010, 0x4011).r("seibu_sound", FUNC(seibu_sound_device::soundlatch_r)); map(0x4012, 0x4012).r("seibu_sound", FUNC(seibu_sound_device::main_data_pending_r)); - map(0x4013, 0x4013).portr("COIN"); + map(0x4013, 0x4013).r("seibu_sound", FUNC(seibu_sound_device::coin_r)); map(0x4018, 0x4019).w("seibu_sound", FUNC(seibu_sound_device::main_data_w)); map(0x401a, 0x401a).w("adpcm", FUNC(seibu_adpcm_device::ctl_w)); map(0x401b, 0x401b).w("seibu_sound", FUNC(seibu_sound_device::coin_w)); - map(0x8000, 0xffff).bankr("seibu_bank1"); + map(0x8000, 0xffff).bankr("seibu_bank"); } static INPUT_PORTS_START( kothello ) @@ -510,9 +510,10 @@ void shanghai_state::kothello(machine_config &config) ymsnd.add_route(ALL_OUTPUTS, "mono", 0.15); seibu_sound_device &seibu_sound(SEIBU_SOUND(config, "seibu_sound", 0)); + seibu_sound.coin_io_callback().set_ioport("COIN"); seibu_sound.int_callback().set_inputline("audiocpu", 0); seibu_sound.set_rom_tag("audiocpu"); - seibu_sound.set_rombank_tag("seibu_bank1"); + seibu_sound.set_rombank_tag("seibu_bank"); seibu_sound.ym_read_callback().set("ymsnd", FUNC(ym2203_device::read)); seibu_sound.ym_write_callback().set("ymsnd", FUNC(ym2203_device::write)); diff --git a/src/mame/taito/asuka.cpp b/src/mame/taito/asuka.cpp index 6cf60029b1c9f..d9d5c43d28816 100644 --- a/src/mame/taito/asuka.cpp +++ b/src/mame/taito/asuka.cpp @@ -638,7 +638,7 @@ void cadash_state::main_map(address_map &map) } void base_state::eto_map(address_map &map) -{ // N.B. tc100scn mirror overlaps spriteram +{ map(0x000000, 0x0fffff).rom(); map(0x100000, 0x10000f).rw("tc0110pcr", FUNC(tc0110pcr_device::word_r), FUNC(tc0110pcr_device::step1_word_w)); map(0x200000, 0x203fff).ram(); @@ -648,7 +648,7 @@ void base_state::eto_map(address_map &map) map(0x4e0000, 0x4e0001).nopr(); map(0x4e0001, 0x4e0001).w("ciu", FUNC(pc060ha_device::master_port_w)); map(0x4e0003, 0x4e0003).rw("ciu", FUNC(pc060ha_device::master_comm_r), FUNC(pc060ha_device::master_comm_w)); - map(0xc00000, 0xc0ffff).w(m_tc0100scn, FUNC(tc0100scn_device::ram_w)); + map(0xc00000, 0xc0ffff).w(m_tc0100scn, FUNC(tc0100scn_device::ram_w)); // N.B. tc100scn mirror overlaps spriteram map(0xc00000, 0xc03fff).rw(m_pc090oj, FUNC(pc090oj_device::word_r), FUNC(pc090oj_device::word_w)); // sprite RAM map(0xd00000, 0xd0ffff).rw(m_tc0100scn, FUNC(tc0100scn_device::ram_r), FUNC(tc0100scn_device::ram_w)); // tilemaps map(0xd20000, 0xd2000f).rw(m_tc0100scn, FUNC(tc0100scn_device::ctrl_r), FUNC(tc0100scn_device::ctrl_w)); @@ -2024,6 +2024,32 @@ ROM_START( cadashs ) // no labels on the program ROMs ROM_LOAD( "pal20l8b-c21-12.ic47", 0x0600, 0x0144, CRC(bbc2cc97) SHA1(d4a68f28e0d3f5a3b39ecc25640bc9197ad0260b) ) ROM_END +ROM_START( cadashso ) // Taito PCB: K1100526A / J1100218A + ROM_REGION( 0x80000, "maincpu", 0 ) // 512k for 68000 code + ROM_LOAD16_BYTE( "conchimatic_c_31.ic11", 0x00000, 0x20000, CRC(091e71de) SHA1(b4b7346538866866ab92b59fad00d0ba7747d115) ) + ROM_LOAD16_BYTE( "conchimatic_c_33.ic15", 0x00001, 0x20000, CRC(64722757) SHA1(c59dd101d7b2bd3c23672faeac53a5ffcd25cfc3) ) + ROM_LOAD16_BYTE( "conchimatic_c_30.ic10", 0x40000, 0x20000, CRC(f7572e71) SHA1(7471bc8e0773b2cf0f8b3a89bfcc4388a5c21ef1) ) + ROM_LOAD16_BYTE( "conchimatic_c_32.ic14", 0x40001, 0x20000, CRC(3947b8b5) SHA1(10a692d0f881923002db7855293a406d089e6441) ) + + ROM_REGION( 0x80000, "tc0100scn", 0 ) + ROM_LOAD16_WORD_SWAP( "c21-02.9", 0x00000, 0x80000, CRC(205883b9) SHA1(5aafee8cab3f949a7db91bcc26912f331041b51e) ) // SCR tiles (8 x 8) + + ROM_REGION( 0x80000, "pc090oj", 0 ) + ROM_LOAD16_WORD_SWAP( "c21-01.1", 0x00000, 0x80000, CRC(1ff6f39c) SHA1(742f296efc8073fafa73da2c8d7d26ca9514b6bf) ) // Sprites (16 x 16) + + ROM_REGION( 0x10000, "audiocpu", 0 ) + ROM_LOAD( "c21-08.38", 0x00000, 0x10000, CRC(dca495a0) SHA1(4e0f401f1b967da75f33fd7294860ad0b4bf2dce) ) // banked + + ROM_REGION( 0x08000, "subcpu", 0 ) // HD64180RP8 code (link) + ROM_LOAD( "c21-07.57", 0x00000, 0x08000, CRC(f02292bd) SHA1(0a5c06a048ad67f90e0d766b504582e9eef035f7) ) + + ROM_REGION( 0x0800, "plds", 0 ) + ROM_LOAD( "pal16l8b-c21-09.ic34", 0x0000, 0x0104, CRC(4b296700) SHA1(79d6c8fb13e30795d9c1f49885ada658f9722b68) ) + ROM_LOAD( "pal16l8b-c21-10.ic45", 0x0200, 0x0104, CRC(35642f00) SHA1(a04403536b0ef7e8e7251dfc47274a6c8772fd2d) ) + ROM_LOAD( "pal16l8b-c21-11-1.ic46", 0x0400, 0x0104, CRC(f4791e24) SHA1(7e3bbffec7b8f9171e6e09706e5622fef3c99ca0) ) + ROM_LOAD( "pal20l8b-c21-12.ic47", 0x0600, 0x0144, CRC(bbc2cc97) SHA1(d4a68f28e0d3f5a3b39ecc25640bc9197ad0260b) ) +ROM_END + ROM_START( galmedes ) // Taito PCB: K1100388A / J1100169A ROM_REGION( 0x100000, "maincpu", 0 ) // 1024k for 68000 code ROM_LOAD16_BYTE( "gm-prg1.ic23", 0x00000, 0x20000, CRC(32a70753) SHA1(3bd094b7ae600dbc87ba74e8b2d6b86a68346f4f) ) @@ -2208,32 +2234,33 @@ void base_state::init_earthjkr() } // Anonymous namespace -GAME( 1988, bonzeadv, 0, bonzeadv, bonzeadv, bonzeadv_state, empty_init, ROT0, "Taito Corporation Japan", "Bonze Adventure (World, rev 1)", MACHINE_SUPPORTS_SAVE ) -GAME( 1988, bonzeadvo, bonzeadv, bonzeadv, bonzeadv, bonzeadv_state, empty_init, ROT0, "Taito Corporation Japan", "Bonze Adventure (World)", MACHINE_SUPPORTS_SAVE ) -GAME( 1988, bonzeadvu, bonzeadv, bonzeadv, jigkmgri, bonzeadv_state, empty_init, ROT0, "Taito America Corporation", "Bonze Adventure (US, rev 1)", MACHINE_SUPPORTS_SAVE ) -GAME( 1988, jigkmgri, bonzeadv, bonzeadv, jigkmgri, bonzeadv_state, empty_init, ROT0, "Taito Corporation", "Jigoku Meguri (Japan, rev 1)", MACHINE_SUPPORTS_SAVE ) -GAME( 1988, jigkmgria, bonzeadv, bonzeadv, jigkmgri, bonzeadv_state, empty_init, ROT0, "Taito Corporation", "Jigoku Meguri (Japan)", MACHINE_SUPPORTS_SAVE ) +GAME( 1988, bonzeadv, 0, bonzeadv, bonzeadv, bonzeadv_state, empty_init, ROT0, "Taito Corporation Japan", "Bonze Adventure (World, rev 1)", MACHINE_SUPPORTS_SAVE ) +GAME( 1988, bonzeadvo, bonzeadv, bonzeadv, bonzeadv, bonzeadv_state, empty_init, ROT0, "Taito Corporation Japan", "Bonze Adventure (World)", MACHINE_SUPPORTS_SAVE ) +GAME( 1988, bonzeadvu, bonzeadv, bonzeadv, jigkmgri, bonzeadv_state, empty_init, ROT0, "Taito America Corporation", "Bonze Adventure (US, rev 1)", MACHINE_SUPPORTS_SAVE ) +GAME( 1988, jigkmgri, bonzeadv, bonzeadv, jigkmgri, bonzeadv_state, empty_init, ROT0, "Taito Corporation", "Jigoku Meguri (Japan, rev 1)", MACHINE_SUPPORTS_SAVE ) +GAME( 1988, jigkmgria, bonzeadv, bonzeadv, jigkmgri, bonzeadv_state, empty_init, ROT0, "Taito Corporation", "Jigoku Meguri (Japan)", MACHINE_SUPPORTS_SAVE ) GAME( 1988, bonzeadvp, bonzeadv, bonzeadv, jigkmgri, bonzeadv_state, empty_init, ROT0, "Taito Corporation Japan", "Bonze Adventure (World, prototype, newer)", MACHINE_SUPPORTS_SAVE ) GAME( 1988, bonzeadvp2,bonzeadv, bonzeadv, jigkmgri, bonzeadv_state, empty_init, ROT0, "Taito Corporation Japan", "Bonze Adventure (World, prototype, older)", MACHINE_SUPPORTS_SAVE ) -GAME( 1988, asuka, 0, asuka, asuka, msm_state, empty_init, ROT270, "Taito Corporation", "Asuka & Asuka (World)", MACHINE_SUPPORTS_SAVE ) +GAME( 1988, asuka, 0, asuka, asuka, msm_state, empty_init, ROT270, "Taito Corporation", "Asuka & Asuka (World)", MACHINE_SUPPORTS_SAVE ) GAME( 1988, asukaj, asuka, asuka, asuka, msm_state, empty_init, ROT270, "Taito Corporation", "Asuka & Asuka (Japan, rev 1)", MACHINE_SUPPORTS_SAVE ) -GAME( 1988, asukaja, asuka, asuka, asuka, msm_state, empty_init, ROT270, "Taito Corporation", "Asuka & Asuka (Japan)", MACHINE_SUPPORTS_SAVE ) +GAME( 1988, asukaja, asuka, asuka, asuka, msm_state, empty_init, ROT270, "Taito Corporation", "Asuka & Asuka (Japan)", MACHINE_SUPPORTS_SAVE ) GAME( 1989, mofflott, 0, mofflott, mofflott, msm_state, empty_init, ROT270, "Taito Corporation", "Maze of Flott (Japan)", MACHINE_SUPPORTS_SAVE ) -GAME( 1989, cadash, 0, cadash, cadash, cadash_state, empty_init, ROT0, "Taito Corporation Japan", "Cadash (World)", MACHINE_SUPPORTS_SAVE | MACHINE_NODEVICE_LAN ) -GAME( 1989, cadashj, cadash, cadash, cadashj, cadash_state, empty_init, ROT0, "Taito Corporation", "Cadash (Japan, rev 2)", MACHINE_SUPPORTS_SAVE | MACHINE_NODEVICE_LAN ) -GAME( 1989, cadashj1, cadash, cadash, cadashj, cadash_state, empty_init, ROT0, "Taito Corporation", "Cadash (Japan, rev 1)", MACHINE_SUPPORTS_SAVE | MACHINE_NODEVICE_LAN ) -GAME( 1989, cadashjo, cadash, cadash, cadashj, cadash_state, empty_init, ROT0, "Taito Corporation", "Cadash (Japan)", MACHINE_SUPPORTS_SAVE | MACHINE_NODEVICE_LAN ) -GAME( 1989, cadashu, cadash, cadash, cadashu, cadash_state, empty_init, ROT0, "Taito America Corporation", "Cadash (US, rev 2)", MACHINE_SUPPORTS_SAVE | MACHINE_NODEVICE_LAN ) -GAME( 1989, cadashu1, cadash, cadash, cadashu, cadash_state, empty_init, ROT0, "Taito America Corporation", "Cadash (US, rev 1?)", MACHINE_SUPPORTS_SAVE | MACHINE_NODEVICE_LAN ) -GAME( 1989, cadashi, cadash, cadash, cadash, cadash_state, empty_init, ROT0, "Taito Corporation Japan", "Cadash (Italy)", MACHINE_SUPPORTS_SAVE | MACHINE_NODEVICE_LAN ) -GAME( 1989, cadashf, cadash, cadash, cadash, cadash_state, empty_init, ROT0, "Taito Corporation Japan", "Cadash (France)", MACHINE_SUPPORTS_SAVE | MACHINE_NODEVICE_LAN ) -GAME( 1989, cadashg, cadash, cadash, cadash, cadash_state, empty_init, ROT0, "Taito Corporation Japan", "Cadash (Germany, rev 1)", MACHINE_SUPPORTS_SAVE | MACHINE_NODEVICE_LAN ) -GAME( 1989, cadashgo, cadash, cadash, cadash, cadash_state, empty_init, ROT0, "Taito Corporation Japan", "Cadash (Germany)", MACHINE_SUPPORTS_SAVE | MACHINE_NODEVICE_LAN ) -GAME( 1989, cadashp, cadash, cadash, cadashj, cadash_state, empty_init, ROT0, "Taito Corporation Japan", "Cadash (World, prototype)", MACHINE_SUPPORTS_SAVE | MACHINE_NODEVICE_LAN) -GAME( 1989, cadashs, cadash, cadash, cadash, cadash_state, empty_init, ROT0, "Taito Corporation Japan", "Cadash (Spain, rev 1)", MACHINE_SUPPORTS_SAVE | MACHINE_NODEVICE_LAN ) +GAME( 1989, cadash, 0, cadash, cadash, cadash_state, empty_init, ROT0, "Taito Corporation Japan", "Cadash (World)", MACHINE_SUPPORTS_SAVE | MACHINE_NODEVICE_LAN ) +GAME( 1989, cadashj, cadash, cadash, cadashj, cadash_state, empty_init, ROT0, "Taito Corporation", "Cadash (Japan, rev 2)", MACHINE_SUPPORTS_SAVE | MACHINE_NODEVICE_LAN ) +GAME( 1989, cadashj1, cadash, cadash, cadashj, cadash_state, empty_init, ROT0, "Taito Corporation", "Cadash (Japan, rev 1)", MACHINE_SUPPORTS_SAVE | MACHINE_NODEVICE_LAN ) +GAME( 1989, cadashjo, cadash, cadash, cadashj, cadash_state, empty_init, ROT0, "Taito Corporation", "Cadash (Japan)", MACHINE_SUPPORTS_SAVE | MACHINE_NODEVICE_LAN ) +GAME( 1989, cadashu, cadash, cadash, cadashu, cadash_state, empty_init, ROT0, "Taito America Corporation", "Cadash (US, rev 2)", MACHINE_SUPPORTS_SAVE | MACHINE_NODEVICE_LAN ) +GAME( 1989, cadashu1, cadash, cadash, cadashu, cadash_state, empty_init, ROT0, "Taito America Corporation", "Cadash (US, rev 1?)", MACHINE_SUPPORTS_SAVE | MACHINE_NODEVICE_LAN ) +GAME( 1989, cadashi, cadash, cadash, cadash, cadash_state, empty_init, ROT0, "Taito Corporation Japan", "Cadash (Italy)", MACHINE_SUPPORTS_SAVE | MACHINE_NODEVICE_LAN ) +GAME( 1989, cadashf, cadash, cadash, cadash, cadash_state, empty_init, ROT0, "Taito Corporation Japan", "Cadash (France)", MACHINE_SUPPORTS_SAVE | MACHINE_NODEVICE_LAN ) +GAME( 1989, cadashg, cadash, cadash, cadash, cadash_state, empty_init, ROT0, "Taito Corporation Japan", "Cadash (Germany, rev 1)", MACHINE_SUPPORTS_SAVE | MACHINE_NODEVICE_LAN ) +GAME( 1989, cadashgo, cadash, cadash, cadash, cadash_state, empty_init, ROT0, "Taito Corporation Japan", "Cadash (Germany)", MACHINE_SUPPORTS_SAVE | MACHINE_NODEVICE_LAN ) +GAME( 1989, cadashp, cadash, cadash, cadashj, cadash_state, empty_init, ROT0, "Taito Corporation Japan", "Cadash (World, prototype)", MACHINE_SUPPORTS_SAVE | MACHINE_NODEVICE_LAN ) +GAME( 1989, cadashs, cadash, cadash, cadash, cadash_state, empty_init, ROT0, "Taito Corporation Japan", "Cadash (Spain, rev 1)", MACHINE_SUPPORTS_SAVE | MACHINE_NODEVICE_LAN ) +GAME( 1989, cadashso, cadash, cadash, cadash, cadash_state, empty_init, ROT0, "Taito Corporation Japan", "Cadash (Spain)", MACHINE_SUPPORTS_SAVE | MACHINE_NODEVICE_LAN ) GAME( 1992, galmedes, 0, asuka, galmedes, msm_state, empty_init, ROT270, "Visco", "Galmedes (Japan)", MACHINE_SUPPORTS_SAVE ) @@ -2242,5 +2269,5 @@ GAME( 1993, earthjkra, earthjkr, asuka, earthjkr, msm_state, empty_init GAME( 1993, earthjkrb, earthjkr, asuka, earthjkr, msm_state, empty_init, ROT270, "Visco", "U.N. Defense Force: Earth Joker (US / Japan, set 3)", MACHINE_SUPPORTS_SAVE ) GAME( 1993, earthjkrp, earthjkr, asuka, earthjkrp, msm_state, empty_init, ROT270, "Visco", "U.N. Defense Force: Earth Joker (Japan, prototype?)", MACHINE_SUPPORTS_SAVE ) -GAME( 1994, eto, 0, eto, eto, base_state, empty_init, ROT0, "Visco", "Kokontouzai Eto Monogatari (Japan)", MACHINE_SUPPORTS_SAVE ) +GAME( 1994, eto, 0, eto, eto, base_state, empty_init, ROT0, "Visco", "Kokontouzai Eto Monogatari (Japan)", MACHINE_SUPPORTS_SAVE ) GAME( 1994, etoa, eto, eto, eto, base_state, empty_init, ROT0, "Visco", "Kokontouzai Eto Monogatari (Japan, prototype?)", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/taito/flstory.cpp b/src/mame/taito/flstory.cpp index d06ff813b57b8..aaf036d99b003 100644 --- a/src/mame/taito/flstory.cpp +++ b/src/mame/taito/flstory.cpp @@ -7,7 +7,8 @@ added Victorious Nine by BUT TODO: - - TA7630 emulation needs filter support (bass sounds from MSM5232 should be about 2 times louder) + - TA7630 emulation needs filter support (bass sounds from MSM5232 should + be about 2 times louder) ***************************************************************************/ @@ -132,8 +133,6 @@ class flstory_mcu_state : public flstory_state void onna34ro_mcu(machine_config &config) ATTR_COLD; private: - // memory pointers - // devices required_device m_bmcu; @@ -536,7 +535,7 @@ void flstory_mcu_state::rumba_map(address_map &map) void flstory_state::sound_control_0_w(uint8_t data) { m_snd_ctrl0 = data & 0xff; - // popmessage("SND0 0=%02x 1=%02x 2=%02x 3=%02x", m_snd_ctrl0, m_snd_ctrl1, m_snd_ctrl2, m_snd_ctrl3); + //popmessage("SND0 0=%02x 1=%02x 2=%02x 3=%02x", m_snd_ctrl0, m_snd_ctrl1, m_snd_ctrl2, m_snd_ctrl3); // this definitely controls main melody voice on 2'-1 and 4'-1 outputs for(int i=0;i<4;i++) @@ -550,14 +549,14 @@ void flstory_state::sound_control_0_w(uint8_t data) void flstory_state::sound_control_1_w(uint8_t data) { m_snd_ctrl1 = data & 0xff; - // popmessage("SND1 0=%02x 1=%02x 2=%02x 3=%02x", m_snd_ctrl0, m_snd_ctrl1, m_snd_ctrl2, m_snd_ctrl3); + //popmessage("SND1 0=%02x 1=%02x 2=%02x 3=%02x", m_snd_ctrl0, m_snd_ctrl1, m_snd_ctrl2, m_snd_ctrl3); for(int i=0;i<4;i++) m_ta7630->set_channel_volume(m_msm,i+4,m_snd_ctrl1 >> 4); -// m_msm->set_output_gain(4, m_vol_ctrl[(m_snd_ctrl1 >> 4) & 15] / 100.0); /* group2 from msm5232 */ -// m_msm->set_output_gain(5, m_vol_ctrl[(m_snd_ctrl1 >> 4) & 15] / 100.0); /* group2 from msm5232 */ -// m_msm->set_output_gain(6, m_vol_ctrl[(m_snd_ctrl1 >> 4) & 15] / 100.0); /* group2 from msm5232 */ -// m_msm->set_output_gain(7, m_vol_ctrl[(m_snd_ctrl1 >> 4) & 15] / 100.0); /* group2 from msm5232 */ + //m_msm->set_output_gain(4, m_vol_ctrl[(m_snd_ctrl1 >> 4) & 15] / 100.0); /* group2 from msm5232 */ + //m_msm->set_output_gain(5, m_vol_ctrl[(m_snd_ctrl1 >> 4) & 15] / 100.0); /* group2 from msm5232 */ + //m_msm->set_output_gain(6, m_vol_ctrl[(m_snd_ctrl1 >> 4) & 15] / 100.0); /* group2 from msm5232 */ + //m_msm->set_output_gain(7, m_vol_ctrl[(m_snd_ctrl1 >> 4) & 15] / 100.0); /* group2 from msm5232 */ } void flstory_state::sound_control_2_w(uint8_t data) @@ -593,8 +592,6 @@ void flstory_state::sound_map(address_map &map) } - - /* When "Debug Mode" DIP Switch is ON, keep IPT_SERVICE1 ('9') pressed to freeze the game. Once the game is frozen, you can press IPT_START1 ('5') to advance 1 frame, or IPT_START2 ('6') to advance 6 frames. @@ -1123,8 +1120,8 @@ void flstory_state::machine_reset() { // video m_gfxctrl = 0; -// onna34ro doesn't set this up when checking RAM/VRAM (available by keeping pressed service button at startup) -// so we invert the logic here + // onna34ro doesn't set this up when checking RAM/VRAM (available by keeping pressed service button at startup) + // so we invert the logic here m_char_bank = 1; m_palette_bank = 0; @@ -1137,21 +1134,22 @@ void flstory_state::machine_reset() void flstory_state::common(machine_config &config) { - Z80(config, m_maincpu, XTAL(10'733'000)/2); // verified on PCB + Z80(config, m_maincpu, 10.733_MHz_XTAL / 2); // verified on PCB m_maincpu->set_vblank_int("screen", FUNC(flstory_state::irq0_line_hold)); - Z80(config, m_audiocpu, XTAL(8'000'000)/2); // verified on PCB + Z80(config, m_audiocpu, 8_MHz_XTAL / 2); // verified on PCB m_audiocpu->set_addrmap(AS_PROGRAM, &flstory_state::sound_map); - // IRQ generated by ???, NMI generated by the main CPU - m_audiocpu->set_periodic_int(FUNC(flstory_state::irq0_line_hold), attotime::from_hz(2*60)); + + // IRQ generated with discrete-logic counter + const attotime audio_irq_period = attotime::from_ticks(0x10000, 8_MHz_XTAL); // ~122Hz + m_audiocpu->set_periodic_int(FUNC(flstory_state::irq0_line_hold), audio_irq_period); // 100 CPU slices per frame - a high value to ensure proper synchronization of the CPUs config.set_maximum_quantum(attotime::from_hz(6000)); // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); - // derived from ladyfrog.cpp, guess - screen.set_raw(XTAL(8'000'000), 510, 0, 256, 262, 2*8, 30*8); // pixel clock appears to run at 8 MHz + screen.set_raw(8_MHz_XTAL, 510, 0, 256, 262, 2*8, 30*8); // derived from ladyfrog.cpp, guess screen.set_screen_update(FUNC(flstory_state::screen_update_flstory)); screen.set_palette(m_palette); @@ -1169,21 +1167,21 @@ void flstory_state::common(machine_config &config) GENERIC_LATCH_8(config, m_soundlatch2); TA7630(config, m_ta7630); - YM2149(config, m_ay, XTAL(8'000'000)/4); // verified on PCB + YM2149(config, m_ay, 8_MHz_XTAL / 4); // verified on PCB m_ay->port_a_write_callback().set(FUNC(flstory_state::sound_control_2_w)); m_ay->port_b_write_callback().set(FUNC(flstory_state::sound_control_3_w)); m_ay->add_route(ALL_OUTPUTS, "speaker", 0.1); - MSM5232(config, m_msm, XTAL(8'000'000)/4); // verified on PCB - m_msm->set_capacitors(1.0e-6, 1.0e-6, 1.0e-6, 1.0e-6, 1.0e-6, 1.0e-6, 1.0e-6, 1.0e-6); /* 1.0 uF capacitors (verified on real PCB) */ - m_msm->add_route(0, "speaker", 1.0); // pin 28 2'-1 - m_msm->add_route(1, "speaker", 1.0); // pin 29 4'-1 - m_msm->add_route(2, "speaker", 1.0); // pin 30 8'-1 - m_msm->add_route(3, "speaker", 1.0); // pin 31 16'-1 - m_msm->add_route(4, "speaker", 1.0); // pin 36 2'-2 - m_msm->add_route(5, "speaker", 1.0); // pin 35 4'-2 - m_msm->add_route(6, "speaker", 1.0); // pin 34 8'-2 - m_msm->add_route(7, "speaker", 1.0); // pin 33 16'-2 + MSM5232(config, m_msm, 8_MHz_XTAL / 4); // verified on PCB + m_msm->set_capacitors(1.0e-6, 1.0e-6, 1.0e-6, 1.0e-6, 1.0e-6, 1.0e-6, 1.0e-6, 1.0e-6); // 1.0 uF capacitors (verified on real PCB) + m_msm->add_route(0, "speaker", 1.0); // pin 28 2'-1 + m_msm->add_route(1, "speaker", 1.0); // pin 29 4'-1 + m_msm->add_route(2, "speaker", 1.0); // pin 30 8'-1 + m_msm->add_route(3, "speaker", 1.0); // pin 31 16'-1 + m_msm->add_route(4, "speaker", 1.0); // pin 36 2'-2 + m_msm->add_route(5, "speaker", 1.0); // pin 35 4'-2 + m_msm->add_route(6, "speaker", 1.0); // pin 34 8'-2 + m_msm->add_route(7, "speaker", 1.0); // pin 33 16'-2 // pin 1 SOLO 8' not mapped // pin 2 SOLO 16' not mapped // pin 22 Noise Output not mapped @@ -1197,7 +1195,7 @@ void flstory_mcu_state::flstory(machine_config &config) m_maincpu->set_addrmap(AS_PROGRAM, &flstory_mcu_state::flstory_map); - TAITO68705_MCU(config, m_bmcu, XTAL(18'432'000)/6); // verified on PCB + TAITO68705_MCU(config, m_bmcu, 18.432_MHz_XTAL / 6); // verified on PCB MCFG_VIDEO_START_OVERRIDE(flstory_mcu_state,flstory) } @@ -1216,7 +1214,7 @@ void flstory_mcu_state::onna34ro_mcu(machine_config &config) onna34ro(config); m_maincpu->set_addrmap(AS_PROGRAM, &flstory_mcu_state::onna34ro_mcu_map); - TAITO68705_MCU(config, m_bmcu, XTAL(18'432'000)/6); // ? + TAITO68705_MCU(config, m_bmcu, 18.432_MHz_XTAL / 6); // ? } void flstory_mcu_state::victnine(machine_config &config) @@ -1224,10 +1222,10 @@ void flstory_mcu_state::victnine(machine_config &config) common(config); // basic machine hardware - m_maincpu->set_clock(XTAL(8'000'000)/2); // 4 MHz + m_maincpu->set_clock(8_MHz_XTAL / 2); // 4 MHz m_maincpu->set_addrmap(AS_PROGRAM, &flstory_mcu_state::victnine_map); - TAITO68705_MCU(config, m_bmcu, XTAL(18'432'000)/6); + TAITO68705_MCU(config, m_bmcu, 18.432_MHz_XTAL / 6); // video hardware subdevice("screen")->set_screen_update(FUNC(flstory_mcu_state::screen_update_victnine)); @@ -1244,9 +1242,9 @@ void flstory_mcu_state::rumba(machine_config &config) // basic machine hardware m_maincpu->set_addrmap(AS_PROGRAM, &flstory_mcu_state::rumba_map); - m_maincpu->set_clock(XTAL(8'000'000) / 2); // verified on PCB + m_maincpu->set_clock(8_MHz_XTAL / 2); // verified on PCB - TAITO68705_MCU(config, m_bmcu, XTAL(18'432'000)/6); // ? + TAITO68705_MCU(config, m_bmcu, 18.432_MHz_XTAL / 6); // ? // video hardware subdevice("screen")->set_screen_update(FUNC(flstory_mcu_state::screen_update_rumba)); @@ -1547,9 +1545,9 @@ ROM_END } // anonymous namespace -GAME( 1985, flstory, 0, flstory, flstory, flstory_mcu_state, empty_init, ROT180, "Taito", "The FairyLand Story", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) -GAME( 1985, flstoryo, flstory, flstory, flstory, flstory_mcu_state, empty_init, ROT180, "Taito", "The FairyLand Story (earlier)", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) -GAME( 1985, onna34ro, 0, onna34ro_mcu, onna34ro, flstory_mcu_state, empty_init, ROT0, "Taito", "Onna Sanshirou - Typhoon Gal (rev 1)", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) -GAME( 1985, onna34roa, onna34ro, onna34ro, onna34ro, flstory_state, empty_init, ROT0, "Taito", "Onna Sanshirou - Typhoon Gal (bootleg)", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) -GAME( 1984, victnine, 0, victnine, victnine, flstory_mcu_state, empty_init, ROT0, "Taito", "Victorious Nine", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) -GAME( 1984, rumba, 0, rumba, rumba, flstory_mcu_state, empty_init, ROT270, "Taito", "Rumba Lumber (rev 1)", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) +GAME( 1985, flstory, 0, flstory, flstory, flstory_mcu_state, empty_init, ROT180, "Taito", "The FairyLand Story", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) +GAME( 1985, flstoryo, flstory, flstory, flstory, flstory_mcu_state, empty_init, ROT180, "Taito", "The FairyLand Story (earlier)", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) +GAME( 1985, onna34ro, 0, onna34ro_mcu, onna34ro, flstory_mcu_state, empty_init, ROT0, "Taito", "Onna Sanshirou - Typhoon Gal (rev 1)", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) +GAME( 1985, onna34roa, onna34ro, onna34ro, onna34ro, flstory_state, empty_init, ROT0, "bootleg", "Onna Sanshirou - Typhoon Gal (bootleg)", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) +GAME( 1984, victnine, 0, victnine, victnine, flstory_mcu_state, empty_init, ROT0, "Taito", "Victorious Nine", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) +GAME( 1984, rumba, 0, rumba, rumba, flstory_mcu_state, empty_init, ROT270, "Taito", "Rumba Lumber (rev 1)", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/taito/nycaptor.cpp b/src/mame/taito/nycaptor.cpp index f721ca0bebb16..37277a4bd9c5e 100644 --- a/src/mame/taito/nycaptor.cpp +++ b/src/mame/taito/nycaptor.cpp @@ -705,7 +705,6 @@ GFXDECODE_END - void nycaptor_state::machine_start() { if (m_gametype == 0) @@ -722,8 +721,6 @@ void nycaptor_state::machine_start() void nycaptor_state::machine_reset() { -// MACHINE_RESET_CALL_MEMBER(ta7630); - m_generic_control_reg = 0; m_char_bank = 0; @@ -734,21 +731,24 @@ void nycaptor_state::machine_reset() void nycaptor_state::nycaptor(machine_config &config) { /* basic machine hardware */ - Z80(config, m_maincpu, 8000000/2); /* ??? */ + Z80(config, m_maincpu, 8000000/2); /* ??? */ m_maincpu->set_addrmap(AS_PROGRAM, &nycaptor_state::nycaptor_master_map); m_maincpu->set_vblank_int("screen", FUNC(nycaptor_state::irq0_line_hold)); Z80(config, m_subcpu, 8000000/2); m_subcpu->set_addrmap(AS_PROGRAM, &nycaptor_state::nycaptor_slave_map); - m_subcpu->set_vblank_int("screen", FUNC(nycaptor_state::irq0_line_hold)); /* IRQ generated by ??? */ + m_subcpu->set_vblank_int("screen", FUNC(nycaptor_state::irq0_line_hold)); /* IRQ generated by ??? */ Z80(config, m_audiocpu, 8000000/2); m_audiocpu->set_addrmap(AS_PROGRAM, &nycaptor_state::sound_map); - m_audiocpu->set_periodic_int(FUNC(nycaptor_state::irq0_line_hold), attotime::from_hz(2*60)); /* IRQ generated by ??? */ + + const attotime audio_irq_period = attotime::from_ticks(0x10000, 8000000); // ~122Hz + m_audiocpu->set_periodic_int(FUNC(nycaptor_state::irq0_line_hold), audio_irq_period); TAITO68705_MCU(config, m_bmcu, 2000000); - config.set_maximum_quantum(attotime::from_hz(6000)); /* 100 CPU slices per frame - a high value to ensure proper synchronization of the CPUs */ + // 100 CPU slices per frame - a high value to ensure proper synchronization of the CPUs + config.set_maximum_quantum(attotime::from_hz(6000)); /* video hardware */ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); @@ -782,15 +782,15 @@ void nycaptor_state::nycaptor(machine_config &config) ay2.add_route(ALL_OUTPUTS, "speaker", 0.15); MSM5232(config, m_msm, 2000000); - m_msm->set_capacitors(1e-6, 1e-6, 1e-6, 1e-6, 1e-6, 1e-6, 1e-6, 1e-6); /* 1 uF capacitors (match the sample, not verified, standard) */ - m_msm->add_route(0, "speaker", 1.0); // pin 28 2'-1 - m_msm->add_route(1, "speaker", 1.0); // pin 29 4'-1 - m_msm->add_route(2, "speaker", 1.0); // pin 30 8'-1 - m_msm->add_route(3, "speaker", 1.0); // pin 31 16'-1 - m_msm->add_route(4, "speaker", 1.0); // pin 36 2'-2 - m_msm->add_route(5, "speaker", 1.0); // pin 35 4'-2 - m_msm->add_route(6, "speaker", 1.0); // pin 34 8'-2 - m_msm->add_route(7, "speaker", 1.0); // pin 33 16'-2 + m_msm->set_capacitors(1e-6, 1e-6, 1e-6, 1e-6, 1e-6, 1e-6, 1e-6, 1e-6); // 1 uF capacitors (match the sample, not verified, standard) + m_msm->add_route(0, "speaker", 1.0); // pin 28 2'-1 + m_msm->add_route(1, "speaker", 1.0); // pin 29 4'-1 + m_msm->add_route(2, "speaker", 1.0); // pin 30 8'-1 + m_msm->add_route(3, "speaker", 1.0); // pin 31 16'-1 + m_msm->add_route(4, "speaker", 1.0); // pin 36 2'-2 + m_msm->add_route(5, "speaker", 1.0); // pin 35 4'-2 + m_msm->add_route(6, "speaker", 1.0); // pin 34 8'-2 + m_msm->add_route(7, "speaker", 1.0); // pin 33 16'-2 // pin 1 SOLO 8' not mapped // pin 2 SOLO 16' not mapped // pin 22 Noise Output not mapped @@ -811,13 +811,15 @@ void nycaptor_state::cyclshtg(machine_config &config) Z80(config, m_audiocpu, 8000000/2); m_audiocpu->set_addrmap(AS_PROGRAM, &nycaptor_state::sound_map); - m_audiocpu->set_periodic_int(FUNC(nycaptor_state::irq0_line_hold), attotime::from_hz(2*60)); + + const attotime audio_irq_period = attotime::from_ticks(0x10000, 8000000); // ~122Hz + m_audiocpu->set_periodic_int(FUNC(nycaptor_state::irq0_line_hold), audio_irq_period); #ifdef USE_MCU TAITO68705_MCU(config, m_bmcu, 2000000); #endif - config.set_maximum_quantum(attotime::from_hz(60)); + config.set_maximum_quantum(attotime::from_hz(6000)); screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); screen.set_refresh_hz(60); @@ -849,15 +851,15 @@ void nycaptor_state::cyclshtg(machine_config &config) ay2.add_route(ALL_OUTPUTS, "speaker", 0.15); MSM5232(config, m_msm, 2000000); - m_msm->set_capacitors(1e-6, 1e-6, 1e-6, 1e-6, 1e-6, 1e-6, 1e-6, 1e-6); /* 1 uF capacitors (match the sample, not verified, standard) */ - m_msm->add_route(0, "speaker", 1.0); // pin 28 2'-1 - m_msm->add_route(1, "speaker", 1.0); // pin 29 4'-1 - m_msm->add_route(2, "speaker", 1.0); // pin 30 8'-1 - m_msm->add_route(3, "speaker", 1.0); // pin 31 16'-1 - m_msm->add_route(4, "speaker", 1.0); // pin 36 2'-2 - m_msm->add_route(5, "speaker", 1.0); // pin 35 4'-2 - m_msm->add_route(6, "speaker", 1.0); // pin 34 8'-2 - m_msm->add_route(7, "speaker", 1.0); // pin 33 16'-2 + m_msm->set_capacitors(1e-6, 1e-6, 1e-6, 1e-6, 1e-6, 1e-6, 1e-6, 1e-6); // 1 uF capacitors (match the sample, not verified, standard) + m_msm->add_route(0, "speaker", 1.0); // pin 28 2'-1 + m_msm->add_route(1, "speaker", 1.0); // pin 29 4'-1 + m_msm->add_route(2, "speaker", 1.0); // pin 30 8'-1 + m_msm->add_route(3, "speaker", 1.0); // pin 31 16'-1 + m_msm->add_route(4, "speaker", 1.0); // pin 36 2'-2 + m_msm->add_route(5, "speaker", 1.0); // pin 35 4'-2 + m_msm->add_route(6, "speaker", 1.0); // pin 34 8'-2 + m_msm->add_route(7, "speaker", 1.0); // pin 33 16'-2 // pin 1 SOLO 8' not mapped // pin 2 SOLO 16' not mapped // pin 22 Noise Output not mapped @@ -879,9 +881,11 @@ void nycaptor_state::bronx(machine_config &config) Z80(config, m_audiocpu, 8000000/2); m_audiocpu->set_addrmap(AS_PROGRAM, &nycaptor_state::sound_map); - m_audiocpu->set_periodic_int(FUNC(nycaptor_state::irq0_line_hold), attotime::from_hz(2*60)); - config.set_maximum_quantum(attotime::from_hz(120)); + const attotime audio_irq_period = attotime::from_ticks(0x10000, 8000000); // ~122Hz + m_audiocpu->set_periodic_int(FUNC(nycaptor_state::irq0_line_hold), audio_irq_period); + + config.set_maximum_quantum(attotime::from_hz(6000)); screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); screen.set_refresh_hz(60); @@ -913,15 +917,15 @@ void nycaptor_state::bronx(machine_config &config) ay2.add_route(ALL_OUTPUTS, "speaker", 0.15); MSM5232(config, m_msm, 2000000); - m_msm->set_capacitors(1e-6, 1e-6, 1e-6, 1e-6, 1e-6, 1e-6, 1e-6, 1e-6); /* 1 uF capacitors (match the sample, not verified, standard) */ - m_msm->add_route(0, "speaker", 1.0); // pin 28 2'-1 - m_msm->add_route(1, "speaker", 1.0); // pin 29 4'-1 - m_msm->add_route(2, "speaker", 1.0); // pin 30 8'-1 - m_msm->add_route(3, "speaker", 1.0); // pin 31 16'-1 - m_msm->add_route(4, "speaker", 1.0); // pin 36 2'-2 - m_msm->add_route(5, "speaker", 1.0); // pin 35 4'-2 - m_msm->add_route(6, "speaker", 1.0); // pin 34 8'-2 - m_msm->add_route(7, "speaker", 1.0); // pin 33 16'-2 + m_msm->set_capacitors(1e-6, 1e-6, 1e-6, 1e-6, 1e-6, 1e-6, 1e-6, 1e-6); // 1 uF capacitors (match the sample, not verified, standard) + m_msm->add_route(0, "speaker", 1.0); // pin 28 2'-1 + m_msm->add_route(1, "speaker", 1.0); // pin 29 4'-1 + m_msm->add_route(2, "speaker", 1.0); // pin 30 8'-1 + m_msm->add_route(3, "speaker", 1.0); // pin 31 16'-1 + m_msm->add_route(4, "speaker", 1.0); // pin 36 2'-2 + m_msm->add_route(5, "speaker", 1.0); // pin 35 4'-2 + m_msm->add_route(6, "speaker", 1.0); // pin 34 8'-2 + m_msm->add_route(7, "speaker", 1.0); // pin 33 16'-2 // pin 1 SOLO 8' not mapped // pin 2 SOLO 16' not mapped // pin 22 Noise Output not mapped @@ -1292,8 +1296,8 @@ void nycaptor_state::init_colt() m_gametype = 2; } -GAME( 1985, nycaptor, 0, nycaptor, nycaptor, nycaptor_state, init_nycaptor, ROT0, "Taito", "N.Y. Captor (rev 2)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) -GAME( 1986, colt, nycaptor, bronx, colt, nycaptor_state, init_colt, ROT0, "bootleg", "Colt", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) +GAME( 1985, nycaptor, 0, nycaptor, nycaptor, nycaptor_state, init_nycaptor, ROT0, "Taito", "N.Y. Captor (rev 2)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) +GAME( 1986, colt, nycaptor, bronx, colt, nycaptor_state, init_colt, ROT0, "bootleg", "Colt (bootleg of N.Y. Captor)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) -GAME( 1986, cyclshtg, 0, cyclshtg, cyclshtg, nycaptor_state, init_cyclshtg, ROT90, "Taito", "Cycle Shooting", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) -GAME( 1986, bronx, cyclshtg, bronx, bronx, nycaptor_state, init_bronx, ROT90, "bootleg", "Bronx", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) +GAME( 1986, cyclshtg, 0, cyclshtg, cyclshtg, nycaptor_state, init_cyclshtg, ROT90, "Taito", "Cycle Shooting", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) +GAME( 1986, bronx, cyclshtg, bronx, bronx, nycaptor_state, init_bronx, ROT90, "bootleg", "Bronx (bootleg of Cycle Shooting)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/taito/opwolf.cpp b/src/mame/taito/opwolf.cpp index 397d7640f168a..7164cbe330ac0 100644 --- a/src/mame/taito/opwolf.cpp +++ b/src/mame/taito/opwolf.cpp @@ -260,15 +260,11 @@ There are a few unmapped writes for the sound Z80 in the log. Unknown writes to the MSM5205 control addresses (RUN/RES implementation is wrong) -Sound volume filtering is imperfect. Notably the coin insert sound: -MSM1 rings it at volume 0xa8, MSM2 echos it at volume 0x84 but should be more muffled. - Raine source has standard Asuka/Mofflot sprite/tile priority: 0x2000 in sprite_ctrl puts all sprites under top bg layer. But Raine simply kludges in this value, failing to read it from a register. So what is controlling priority. - ***************************************************************************/ #include "emu.h" @@ -283,6 +279,7 @@ register. So what is controlling priority. #include "cpu/m68000/m68000.h" #include "cpu/z80/z80.h" #include "machine/timer.h" +#include "sound/mixer.h" #include "sound/msm5205.h" #include "sound/ymopm.h" @@ -293,11 +290,6 @@ register. So what is controlling priority. namespace { -/* Define clocks based on actual OSC on the PCB */ - -#define CPU_CLOCK (XTAL(16'000'000) / 2) /* clock for 68000 */ -#define SOUND_CPU_CLOCK (XTAL(8'000'000) / 2) /* clock for Z80 sound CPU */ - //************************************************************************** // TYPE DEFINITIONS //************************************************************************** @@ -316,8 +308,6 @@ class opwolf_state : public driver_device m_pc090oj(*this, "pc090oj"), m_msm(*this, "msm%u", 0), m_tc0060dca(*this, "tc0060dca%u", 0), - m_lspeaker(*this, "lspeaker"), - m_rspeaker(*this, "rspeaker"), m_z80bank(*this, "z80bank"), m_recoil(*this, "Player%u_Recoil_Piston", 1U) { } @@ -330,8 +320,8 @@ class opwolf_state : public driver_device void init_opwolfb(); void init_opwolfp(); - ioport_value opwolf_gun_x_r(); - ioport_value opwolf_gun_y_r(); + ioport_value gun_x_r(); + ioport_value gun_y_r(); protected: virtual void machine_start() override ATTR_COLD; @@ -340,19 +330,16 @@ class opwolf_state : public driver_device private: uint16_t cchip_r(offs_t offset); void cchip_w(offs_t offset, uint16_t data); - void opwolf_adpcm_d_w(uint8_t data); - void opwolf_adpcm_e_w(uint8_t data); - void opwolf_spritectrl_w(offs_t offset, uint16_t data); - void opwolf_adpcm_b_w(offs_t offset, uint8_t data); - void opwolf_adpcm_c_w(offs_t offset, uint8_t data); + void spritectrl_w(offs_t offset, uint16_t data); + template void adpcm_w(offs_t offset, uint8_t data); void counters_w(uint8_t data); INTERRUPT_GEN_MEMBER(interrupt); TIMER_DEVICE_CALLBACK_MEMBER(cchip_irq_clear_cb); - void opwolf_colpri_cb(u32 &sprite_colbank, u32 &pri_mask, u16 sprite_ctrl); + void colpri_cb(u32 &sprite_colbank, u32 &pri_mask, u16 sprite_ctrl); uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - void opwolf_msm5205_vck(msm5205_device *device, int chip); + void msm5205_vck(msm5205_device *device, int chip); template void msm5205_vck_w(int state); void opwolf_map(address_map &map) ATTR_COLD; @@ -365,18 +352,17 @@ class opwolf_state : public driver_device optional_shared_ptr m_cchip_ram; /* video-related */ - uint16_t m_sprite_ctrl; - uint16_t m_sprites_flipscreen; + uint16_t m_sprite_ctrl = 0; + uint16_t m_sprites_flipscreen = 0; /* misc */ - uint8_t m_adpcm_b[0x08]; - uint8_t m_adpcm_c[0x08]; - uint32_t m_adpcm_pos[2]; - uint32_t m_adpcm_end[2]; - int m_adpcm_data[2]; + uint8_t m_adpcm_regs[2][8] = { }; + uint32_t m_adpcm_pos[2] = { }; + uint32_t m_adpcm_end[2] = { }; + int m_adpcm_data[2] = { }; - int m_opwolf_gun_xoffs; - int m_opwolf_gun_yoffs; + int m_gun_xoffs = 0; + int m_gun_yoffs = 0; /* devices */ required_device m_maincpu; @@ -387,8 +373,6 @@ class opwolf_state : public driver_device required_device m_pc090oj; required_device_array m_msm; required_device_array m_tc0060dca; - required_device m_lspeaker; - required_device m_rspeaker; required_memory_bank m_z80bank; output_finder<1> m_recoil; }; @@ -407,7 +391,7 @@ void opwolf_state::opwolf_map(address_map &map) map(0x200000, 0x200fff).ram().w("palette", FUNC(palette_device::write16)).share("palette"); map(0x380000, 0x380001).portr("DSWA"); map(0x380002, 0x380003).portr("DSWB"); - map(0x380000, 0x380003).w(FUNC(opwolf_state::opwolf_spritectrl_w)); // usually 0x4, changes when you fire + map(0x380000, 0x380003).w(FUNC(opwolf_state::spritectrl_w)); // usually 0x4, changes when you fire map(0x3a0000, 0x3a0001).portr("IN2"); /* lightgun, read at $11e0/6 */ map(0x3a0002, 0x3a0003).portr("IN3"); map(0x3c0000, 0x3c0001).nopw(); /* watchdog ?? */ @@ -430,7 +414,7 @@ void opwolf_state::opwolfb_map(address_map &map) map(0x200000, 0x200fff).ram().w("palette", FUNC(palette_device::write16)).share("palette"); map(0x380000, 0x380001).portr("DSWA"); map(0x380002, 0x380003).portr("DSWB"); - map(0x380000, 0x380003).w(FUNC(opwolf_state::opwolf_spritectrl_w)); // usually 0x4, changes when you fire + map(0x380000, 0x380003).w(FUNC(opwolf_state::spritectrl_w)); // usually 0x4, changes when you fire map(0x3a0000, 0x3a0001).portr("IN2"); /* lightgun, read at $11e0/6 */ map(0x3a0002, 0x3a0003).portr("IN3"); map(0x3c0000, 0x3c0001).nopw(); /* watchdog ?? */ @@ -452,7 +436,7 @@ void opwolf_state::opwolfp_map(address_map &map) map(0x200000, 0x200fff).ram().w("palette", FUNC(palette_device::write16)).share("palette"); map(0x380000, 0x380001).portr("DSWA"); map(0x380002, 0x380003).portr("DSWB"); - map(0x380000, 0x380003).w(FUNC(opwolf_state::opwolf_spritectrl_w)); // usually 0x4, changes when you fire + map(0x380000, 0x380003).w(FUNC(opwolf_state::spritectrl_w)); // usually 0x4, changes when you fire map(0x3a0000, 0x3a0001).portr("IN2"); /* lightgun, read at $11e0/6 (AND INPUTS) */ map(0x3a0002, 0x3a0003).portr("IN3"); map(0x3c0000, 0x3c0001).nopw(); /* watchdog ?? */ @@ -476,10 +460,10 @@ void opwolf_state::opwolf_sound_z80_map(address_map &map) map(0x9002, 0x9100).nopr(); map(0xa000, 0xa000).w("ciu", FUNC(pc060ha_device::slave_port_w)); map(0xa001, 0xa001).rw("ciu", FUNC(pc060ha_device::slave_comm_r), FUNC(pc060ha_device::slave_comm_w)); - map(0xb000, 0xb006).w(FUNC(opwolf_state::opwolf_adpcm_b_w)); - map(0xc000, 0xc006).w(FUNC(opwolf_state::opwolf_adpcm_c_w)); - map(0xd000, 0xd000).w(FUNC(opwolf_state::opwolf_adpcm_d_w)); - map(0xe000, 0xe000).w(FUNC(opwolf_state::opwolf_adpcm_e_w)); + map(0xb000, 0xb006).w(FUNC(opwolf_state::adpcm_w<0>)); + map(0xc000, 0xc006).w(FUNC(opwolf_state::adpcm_w<1>)); + map(0xd000, 0xd000).w(m_tc0060dca[1], FUNC(tc0060dca_device::volume1_w)); + map(0xe000, 0xe000).w(m_tc0060dca[1], FUNC(tc0060dca_device::volume2_w)); } // this extra z80 substitutes for the c-chip in the bootleg @@ -552,11 +536,11 @@ static INPUT_PORTS_START( opwolf ) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_START("IN2") - PORT_BIT( 0x01ff, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(FUNC(opwolf_state::opwolf_gun_x_r)) + PORT_BIT( 0x01ff, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(FUNC(opwolf_state::gun_x_r)) PORT_BIT( 0xfe00, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_START("IN3") - PORT_BIT( 0x01ff, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(FUNC(opwolf_state::opwolf_gun_y_r)) + PORT_BIT( 0x01ff, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(FUNC(opwolf_state::gun_y_r)) PORT_BIT( 0xfe00, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_START(P1X_PORT_TAG) /* P1X (span allows you to shoot enemies behind status bar) */ @@ -615,7 +599,7 @@ static INPUT_PORTS_START( opwolfb ) PORT_INCLUDE( opwolf ) PORT_MODIFY( "DSWB" ) - PORT_DIPUNUSED( 0x80, IP_ACTIVE_LOW ) /* see notes */ + PORT_DIPUNUSED( 0x80, IP_ACTIVE_LOW ) /* see notes */ INPUT_PORTS_END @@ -631,16 +615,16 @@ void opwolf_state::counters_w(uint8_t data) machine().bookkeeping().coin_counter_w(0, ~data & 0x10); } -ioport_value opwolf_state::opwolf_gun_x_r() +ioport_value opwolf_state::gun_x_r() { /* P1X - Have to remap 8 bit input value, into 0-319 visible range */ int scaled = (ioport(P1X_PORT_TAG)->read() * 320 ) / 256; - return (scaled + 0x15 + m_opwolf_gun_xoffs); + return (scaled + 0x15 + m_gun_xoffs); } -ioport_value opwolf_state::opwolf_gun_y_r() +ioport_value opwolf_state::gun_y_r() { - return (ioport(P1Y_PORT_TAG)->read() - 0x24 + m_opwolf_gun_yoffs); + return (ioport(P1Y_PORT_TAG)->read() - 0x24 + m_gun_yoffs); } @@ -648,9 +632,9 @@ ioport_value opwolf_state::opwolf_gun_y_r() // VIDEO //************************************************************************** -void opwolf_state::opwolf_spritectrl_w(offs_t offset, uint16_t data) +void opwolf_state::spritectrl_w(offs_t offset, uint16_t data) { - // popmessage("opwolf_spritectrl_w ctrl = %4x", data); + // popmessage("spritectrl_w ctrl = %4x", data); if (offset == 0) { // bit 0 -> MOTOR1 transistor @@ -667,7 +651,7 @@ void opwolf_state::opwolf_spritectrl_w(offs_t offset, uint16_t data) } } -void opwolf_state::opwolf_colpri_cb(u32 &sprite_colbank, u32 &pri_mask, u16 sprite_ctrl) +void opwolf_state::colpri_cb(u32 &sprite_colbank, u32 &pri_mask, u16 sprite_ctrl) { sprite_colbank = (sprite_ctrl & 0xe0) >> 1; pri_mask = 0xfc; // sprites under top bg layer @@ -691,8 +675,8 @@ uint32_t opwolf_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap m_pc090oj->draw_sprites(screen, bitmap, cliprect); -// if (ioport("P1X")->read()) -// popmessage("%d %d", machine(), "P1X"), ioport("P1Y")->read()); + //if (ioport("P1X")->read()) + //popmessage("%d %d", machine(), "P1X"), ioport("P1Y")->read()); return 0; } @@ -703,7 +687,7 @@ uint32_t opwolf_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap //************************************************************************** static GFXDECODE_START( gfx_opwolf ) - GFXDECODE_ENTRY( "pc080sn", 0, gfx_8x8x4_packed_msb, 0, 128 ) /* scr tiles */ + GFXDECODE_ENTRY( "pc080sn", 0, gfx_8x8x4_packed_msb, 0, 128 ) /* scr tiles */ GFXDECODE_END @@ -721,6 +705,30 @@ GFXDECODE_END //6 - RES //7 - N/C +template +void opwolf_state::adpcm_w(offs_t offset, uint8_t data) +{ + m_adpcm_regs[N][offset] = data; + + if (offset == 0x04) // trigger? + { + uint16_t start = m_adpcm_regs[N][1] << 8 | m_adpcm_regs[N][0]; + uint16_t end = m_adpcm_regs[N][3] << 8 | m_adpcm_regs[N][2]; + m_adpcm_pos[N] = start << 4; + m_adpcm_end[N] = end << 4; + m_msm[N]->reset_w(0); + + if (N) + m_tc0060dca[0]->volume2_w(m_adpcm_regs[N][5]); + else + m_tc0060dca[0]->volume1_w(m_adpcm_regs[N][5]); + + //logerror("TRIGGER MSM%d\n", N + 1); + } + + //logerror("CPU #1 %c00%i-data=%2x pc=%4x\n", 'b' + N, offset, data, m_audiocpu->pc()); +} + template void opwolf_state::msm5205_vck_w(int state) { @@ -742,66 +750,6 @@ void opwolf_state::msm5205_vck_w(int state) } } -void opwolf_state::opwolf_adpcm_b_w(offs_t offset, uint8_t data) -{ - int start; - int end; - - m_adpcm_b[offset] = data; - - if (offset == 0x04) //trigger ? - { - start = m_adpcm_b[0] + m_adpcm_b[1] * 256; - end = m_adpcm_b[2] + m_adpcm_b[3] * 256; - start *= 16; - end *= 16; - m_adpcm_pos[0] = start; - m_adpcm_end[0] = end; - m_msm[0]->reset_w(0); - m_tc0060dca[0]->set_level(m_adpcm_b[5]); - //logerror("TRIGGER MSM1\n"); - } - -// logerror("CPU #1 b00%i-data=%2x pc=%4x\n",offset,data,m_audiocpu->pc() ); -} - -void opwolf_state::opwolf_adpcm_c_w(offs_t offset, uint8_t data) -{ - int start; - int end; - - m_adpcm_c[offset] = data; - - if (offset == 0x04) //trigger ? - { - start = m_adpcm_c[0] + m_adpcm_c[1] * 256; - end = m_adpcm_c[2] + m_adpcm_c[3] * 256; - start *= 16; - end *= 16; - m_adpcm_pos[1] = start; - m_adpcm_end[1] = end; - m_msm[1]->reset_w(0); - m_tc0060dca[1]->set_level(m_adpcm_c[5]); - //logerror("TRIGGER MSM2\n"); - } - -// logerror("CPU #1 c00%i-data=%2x pc=%4x\n",offset,data,m_audiocpu->pc() ); -} - -void opwolf_state::opwolf_adpcm_d_w(uint8_t data) -{ - // total volume (speaker 1) - for (int i = 0; i <= 2; i++) - m_lspeaker->set_input_gain(i, data / 255.0); -} - -void opwolf_state::opwolf_adpcm_e_w(uint8_t data) -{ - // total volume (speaker 2) - for (int i = 0; i <= 2; i++) - m_rspeaker->set_input_gain(i, data / 255.0); -} - //************************************************************************** // MACHINE EMULATION @@ -812,21 +760,21 @@ void opwolf_state::init_opwolf() uint16_t* rom = (uint16_t*)memregion("maincpu")->base(); // World & US version have different gun offsets, presumably slightly different gun hardware - m_opwolf_gun_xoffs = 0xec - (rom[0x03ffb0 / 2] & 0xff); - m_opwolf_gun_yoffs = 0x1c - (rom[0x03ffae / 2] & 0xff); + m_gun_xoffs = 0xec - (rom[0x03ffb0 / 2] & 0xff); + m_gun_yoffs = 0x1c - (rom[0x03ffae / 2] & 0xff); } void opwolf_state::init_opwolfb() { /* bootleg needs different range of raw gun coords */ - m_opwolf_gun_xoffs = -2; - m_opwolf_gun_yoffs = 17; + m_gun_xoffs = -2; + m_gun_yoffs = 17; } void opwolf_state::init_opwolfp() { - m_opwolf_gun_xoffs = 5; - m_opwolf_gun_yoffs = 30; + m_gun_xoffs = 5; + m_gun_yoffs = 30; } void opwolf_state::machine_start() @@ -835,19 +783,17 @@ void opwolf_state::machine_start() m_z80bank->configure_entries(0, 4, memregion("audiocpu")->base(), 0x4000); - save_item(NAME(m_sprite_ctrl)); - save_item(NAME(m_sprites_flipscreen)); - - save_item(NAME(m_adpcm_b)); - save_item(NAME(m_adpcm_c)); + save_item(NAME(m_adpcm_regs)); save_item(NAME(m_adpcm_pos)); save_item(NAME(m_adpcm_end)); + save_item(NAME(m_adpcm_data)); + + save_item(NAME(m_sprite_ctrl)); + save_item(NAME(m_sprites_flipscreen)); } void opwolf_state::machine_reset() { - m_adpcm_b[0] = m_adpcm_b[1] = 0; - m_adpcm_c[0] = m_adpcm_c[1] = 0; m_adpcm_pos[0] = m_adpcm_pos[1] = 0; m_adpcm_end[0] = m_adpcm_end[1] = 0; m_adpcm_data[0] = m_adpcm_data[1] = -1; @@ -866,12 +812,13 @@ uint16_t opwolf_state::cchip_r(offs_t offset) void opwolf_state::cchip_w(offs_t offset, uint16_t data) { - m_cchip_ram[offset] = data &0xff; + m_cchip_ram[offset] = data & 0xff; } INTERRUPT_GEN_MEMBER(opwolf_state::interrupt) { m_maincpu->set_input_line(5, HOLD_LINE); + if (m_cchip) m_cchip->ext_interrupt(ASSERT_LINE); if (m_cchip_irq_clear) @@ -891,11 +838,11 @@ TIMER_DEVICE_CALLBACK_MEMBER(opwolf_state::cchip_irq_clear_cb) void opwolf_state::opwolf(machine_config &config) { /* basic machine hardware */ - M68000(config, m_maincpu, CPU_CLOCK); /* 8 MHz */ + M68000(config, m_maincpu, 16_MHz_XTAL / 2); /* 8 MHz */ m_maincpu->set_addrmap(AS_PROGRAM, &opwolf_state::opwolf_map); m_maincpu->set_vblank_int("screen", FUNC(opwolf_state::interrupt)); - Z80(config, m_audiocpu, SOUND_CPU_CLOCK); /* 4 MHz */ + Z80(config, m_audiocpu, 8_MHz_XTAL / 2); /* 4 MHz */ m_audiocpu->set_addrmap(AS_PROGRAM, &opwolf_state::opwolf_sound_z80_map); TAITO_CCHIP(config, m_cchip, 12_MHz_XTAL); /* 12MHz measured on pin 20 */ @@ -905,7 +852,11 @@ void opwolf_state::opwolf(machine_config &config) TIMER(config, "cchip_irq_clear").configure_generic(FUNC(opwolf_state::cchip_irq_clear_cb)); - config.set_maximum_quantum(attotime::from_hz(600)); /* 10 CPU slices per frame - enough for the sound CPU to read all commands */ + config.set_maximum_quantum(attotime::from_hz(600)); /* 10 CPU slices per frame - enough for the sound CPU to read all commands */ + + pc060ha_device &ciu(PC060HA(config, "ciu", 0)); + ciu.nmi_callback().set_inputline(m_audiocpu, INPUT_LINE_NMI); + ciu.reset_callback().set_inputline(m_audiocpu, INPUT_LINE_RESET); /* video hardware */ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); @@ -922,41 +873,37 @@ void opwolf_state::opwolf(machine_config &config) PC090OJ(config, m_pc090oj, 0); m_pc090oj->set_palette("palette"); - m_pc090oj->set_colpri_callback(FUNC(opwolf_state::opwolf_colpri_cb)); + m_pc090oj->set_colpri_callback(FUNC(opwolf_state::colpri_cb)); /* sound hardware */ SPEAKER(config, "lspeaker").front_left(); SPEAKER(config, "rspeaker").front_right(); - ym2151_device &ymsnd(YM2151(config, "ymsnd", SOUND_CPU_CLOCK)); /* 4 MHz */ + ym2151_device &ymsnd(YM2151(config, "ymsnd", 8_MHz_XTAL / 2)); /* 4 MHz */ ymsnd.irq_handler().set_inputline(m_audiocpu, 0); ymsnd.port_write_handler().set_membank(m_z80bank).mask(0x03); - ymsnd.add_route(0, "lspeaker", 1.0); - ymsnd.add_route(1, "rspeaker", 1.0); + ymsnd.add_route(ALL_OUTPUTS, "mixer", 0.35); - TC0060DCA(config, m_tc0060dca[0], 384000); - m_tc0060dca[0]->add_route(ALL_OUTPUTS, "lspeaker", 1.0); - m_tc0060dca[0]->add_route(ALL_OUTPUTS, "rspeaker", 1.0); - - MSM5205(config, m_msm[0], 384000); + MSM5205(config, m_msm[0], 384_kHz_XTAL); m_msm[0]->vck_legacy_callback().set(FUNC(opwolf_state::msm5205_vck_w<0>)); - m_msm[0]->set_prescaler_selector(msm5205_device::S48_4B); /* 8 kHz */ - m_msm[0]->add_route(ALL_OUTPUTS, m_tc0060dca[0], 1.0); - m_msm[0]->add_route(ALL_OUTPUTS, m_tc0060dca[0], 1.0); - - TC0060DCA(config, m_tc0060dca[1], 384000); - m_tc0060dca[1]->add_route(ALL_OUTPUTS, "lspeaker", 1.0); - m_tc0060dca[1]->add_route(ALL_OUTPUTS, "rspeaker", 1.0); + m_msm[0]->set_prescaler_selector(msm5205_device::S48_4B); /* 8 kHz */ + m_msm[0]->add_route(0, m_tc0060dca[0], 1.0, 0); - MSM5205(config, m_msm[1], 384000); + MSM5205(config, m_msm[1], 384_kHz_XTAL); m_msm[1]->vck_legacy_callback().set(FUNC(opwolf_state::msm5205_vck_w<1>)); - m_msm[1]->set_prescaler_selector(msm5205_device::S48_4B); /* 8 kHz */ - m_msm[1]->add_route(ALL_OUTPUTS, m_tc0060dca[1], 1.0); - m_msm[1]->add_route(ALL_OUTPUTS, m_tc0060dca[1], 1.0); + m_msm[1]->set_prescaler_selector(msm5205_device::S48_4B); /* 8 kHz */ + m_msm[1]->add_route(0, m_tc0060dca[0], 1.0, 1); - pc060ha_device &ciu(PC060HA(config, "ciu", 0)); - ciu.nmi_callback().set_inputline(m_audiocpu, INPUT_LINE_NMI); - ciu.reset_callback().set_inputline(m_audiocpu, INPUT_LINE_RESET); + TC0060DCA(config, m_tc0060dca[0]); + m_tc0060dca[0]->add_route(ALL_OUTPUTS, "mixer", 1.0); + + mixer_device &mixer = MIXER(config, "mixer"); + mixer.add_route(0, m_tc0060dca[1], 1.0, 0); + mixer.add_route(0, m_tc0060dca[1], 1.0, 1); + + TC0060DCA(config, m_tc0060dca[1]); + m_tc0060dca[1]->add_route(0, "lspeaker", 1.0); + m_tc0060dca[1]->add_route(1, "rspeaker", 1.0); } void opwolf_state::opwolfp(machine_config &config) @@ -972,70 +919,15 @@ void opwolf_state::opwolfp(machine_config &config) void opwolf_state::opwolfb(machine_config &config) /* OSC clocks unknown for the bootleg, but changed to match original sets */ { + opwolfp(config); + /* basic machine hardware */ - M68000(config, m_maincpu, CPU_CLOCK); /* 8 MHz ??? */ m_maincpu->set_addrmap(AS_PROGRAM, &opwolf_state::opwolfb_map); m_maincpu->set_vblank_int("screen", FUNC(opwolf_state::irq5_line_hold)); - Z80(config, m_audiocpu, SOUND_CPU_CLOCK); /* 4 MHz ??? */ - m_audiocpu->set_addrmap(AS_PROGRAM, &opwolf_state::opwolf_sound_z80_map); - - z80_device &sub(Z80(config, "sub", SOUND_CPU_CLOCK)); /* 4 MHz ??? */ + z80_device &sub(Z80(config, "sub", 8_MHz_XTAL / 2)); /* 4 MHz ??? */ sub.set_addrmap(AS_PROGRAM, &opwolf_state::opwolfb_sub_z80_map); sub.set_vblank_int("screen", FUNC(opwolf_state::irq0_line_hold)); - - config.set_maximum_quantum(attotime::from_hz(600)); /* 10 CPU slices per frame - enough for the sound CPU to read all commands */ - - /* video hardware */ - screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); - screen.set_refresh_hz(60); - screen.set_vblank_time(ATTOSECONDS_IN_USEC(0)); - screen.set_size(40*8, 32*8); - screen.set_visarea(0*8, 40*8-1, 1*8, 31*8-1); - screen.set_screen_update(FUNC(opwolf_state::screen_update)); - screen.set_palette("palette"); - - PALETTE(config, "palette").set_format(palette_device::xRGBRRRRGGGGBBBB_bit0, 2048); - - PC080SN(config, m_pc080sn, 0, "palette", gfx_opwolf); - - PC090OJ(config, m_pc090oj, 0); - m_pc090oj->set_palette("palette"); - m_pc090oj->set_colpri_callback(FUNC(opwolf_state::opwolf_colpri_cb)); - - /* sound hardware */ - SPEAKER(config, "lspeaker").front_left(); - SPEAKER(config, "rspeaker").front_right(); - - ym2151_device &ymsnd(YM2151(config, "ymsnd", SOUND_CPU_CLOCK)); - ymsnd.irq_handler().set_inputline(m_audiocpu, 0); - ymsnd.port_write_handler().set_membank(m_z80bank).mask(0x03); - ymsnd.add_route(0, "lspeaker", 1.0); - ymsnd.add_route(1, "rspeaker", 1.0); - - TC0060DCA(config, m_tc0060dca[0], 384000); - m_tc0060dca[0]->add_route(ALL_OUTPUTS, "lspeaker", 1.0); - m_tc0060dca[0]->add_route(ALL_OUTPUTS, "rspeaker", 1.0); - - MSM5205(config, m_msm[0], 384000); - m_msm[0]->vck_legacy_callback().set(FUNC(opwolf_state::msm5205_vck_w<0>)); - m_msm[0]->set_prescaler_selector(msm5205_device::S48_4B); /* 8 kHz */ - m_msm[0]->add_route(ALL_OUTPUTS, m_tc0060dca[0], 1.0); - m_msm[0]->add_route(ALL_OUTPUTS, m_tc0060dca[0], 1.0); - - TC0060DCA(config, m_tc0060dca[1], 384000); - m_tc0060dca[1]->add_route(ALL_OUTPUTS, "lspeaker", 1.0); - m_tc0060dca[1]->add_route(ALL_OUTPUTS, "rspeaker", 1.0); - - MSM5205(config, m_msm[1], 384000); - m_msm[1]->vck_legacy_callback().set(FUNC(opwolf_state::msm5205_vck_w<1>)); - m_msm[1]->set_prescaler_selector(msm5205_device::S48_4B); /* 8 kHz */ - m_msm[1]->add_route(ALL_OUTPUTS, m_tc0060dca[1], 1.0); - m_msm[1]->add_route(ALL_OUTPUTS, m_tc0060dca[1], 1.0); - - pc060ha_device &ciu(PC060HA(config, "ciu", 0)); - ciu.nmi_callback().set_inputline(m_audiocpu, INPUT_LINE_NMI); - ciu.reset_callback().set_inputline(m_audiocpu, INPUT_LINE_RESET); } diff --git a/src/mame/taito/taito_f2.cpp b/src/mame/taito/taito_f2.cpp index 12919d25c878c..18535603f9a9e 100644 --- a/src/mame/taito/taito_f2.cpp +++ b/src/mame/taito/taito_f2.cpp @@ -5685,4 +5685,4 @@ GAME( 1993, qcrayon2, 0, qcrayon2, qcrayon2, taitof2_state, empty_i GAME( 1991, driftout, 0, driftout, driftout, dondokod_state, empty_init, ROT270, "Visco", "Drift Out (Europe)", MACHINE_SUPPORTS_SAVE ) GAME( 1991, driftoutct, driftout, driftoutct,driftoutct, cameltry_state, empty_init, ROT270, "Visco", "Drift Out (Europe, Cameltry conversion)", MACHINE_SUPPORTS_SAVE ) GAME( 1991, driftoutj, driftout, driftout, driftout, dondokod_state, empty_init, ROT270, "Visco", "Drift Out (Japan)", MACHINE_SUPPORTS_SAVE ) -GAME( 1991, driveout, driftout, driveout, driftout, driveout_state, empty_init, ROT270, "bootleg", "Drive Out (bootleg of Drift Out)", MACHINE_SUPPORTS_SAVE ) +GAME( 1991, driveout, driftout, driveout, driftout, driveout_state, empty_init, ROT270, "bootleg (Electronic Devices)", "Drive Out (bootleg of Drift Out)", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/taito/taito_z.cpp b/src/mame/taito/taito_z.cpp index b297d324296f6..90a8f529a9f00 100644 --- a/src/mame/taito/taito_z.cpp +++ b/src/mame/taito/taito_z.cpp @@ -254,7 +254,7 @@ M4300099A CHASE HQ DX (sticker for DX cabinet) | |TC0100SCN| 43256 |-| | 16MHz | | | | TMM2063 |---------| 43256 | -| TC0050DCA |---------| |-| +| TC0060DCA |---------| |-| | Y3016-F TMM2063 |TAITO | |------| | | | |TC0170ABT| |TAITO | | | | TL074 TL074 | | |TC0110| B52-01.IC7 | | @@ -1547,7 +1547,6 @@ void nightstr_state::nightstr_motor_w(offs_t offset, u16 data) m_motor_debug = data; break; } - } void nightstr_state::nightstr_lamps_w(u8 data) diff --git a/src/mame/taito/taito_z.h b/src/mame/taito/taito_z.h index 5314c1e0b3ca9..122431585c07b 100644 --- a/src/mame/taito/taito_z.h +++ b/src/mame/taito/taito_z.h @@ -96,7 +96,7 @@ class taitoz_state : public driver_device output_finder<8> m_cpua_out; /* misc */ - u16 m_cpua_ctrl; + u16 m_cpua_ctrl = 0; private: u32 screen_update_bshark(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); diff --git a/src/mame/taito/tc0060dca.cpp b/src/mame/taito/tc0060dca.cpp index b90a9f091313f..c5496ac09030c 100755 --- a/src/mame/taito/tc0060dca.cpp +++ b/src/mame/taito/tc0060dca.cpp @@ -2,7 +2,7 @@ // copyright-holders:R. Belmont /*************************************************************************** - tc0060dca.cpp - Taito TC0060DCA programmable volume control + tc0060dca.cpp - Taito TC0060DCA stereo programmable volume control Emulation by R. Belmont, volume curve measured by Stephen Leary ***************************************************************************/ @@ -12,43 +12,45 @@ #include -DEFINE_DEVICE_TYPE(TC0060DCA, tc0060dca_device, "tc0060dca", "Taito TC0060DCA programmable volume control") +DEFINE_DEVICE_TYPE(TC0060DCA, tc0060dca_device, "tc0060dca", "Taito TC0060DCA volume control") tc0060dca_device::tc0060dca_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, TC0060DCA, tag, owner, clock), device_sound_interface(mconfig, *this), - m_stream(nullptr), - m_level(0) + m_stream(nullptr) { } -void tc0060dca_device::set_level(u8 level) +void tc0060dca_device::volume1_w(u8 data) { m_stream->update(); - m_level = level; + m_gain[0] = m_atten_table[data]; +} + +void tc0060dca_device::volume2_w(u8 data) +{ + m_stream->update(); + m_gain[1] = m_atten_table[data]; } void tc0060dca_device::device_start() { - m_stream = stream_alloc(8, 2, clock(), STREAM_DEFAULT_FLAGS); + m_stream = stream_alloc(2, 2, SAMPLE_RATE_OUTPUT_ADAPTIVE); for (int x = 0; x < 256; x++) - { m_atten_table[x] = 1.0 / (1.0 + exp(-10 * ((x / 256.0) - 0.6))); - } - save_item(NAME(m_level)); + m_gain[0] = m_gain[1] = m_atten_table[0xff]; + save_item(NAME(m_gain)); } void tc0060dca_device::sound_stream_update(sound_stream &stream, std::vector const &inputs, std::vector &outputs) { - for (int i = 0; i < inputs[0].samples(); i++) + for (int i = 0; i < outputs[0].samples(); i++) { const stream_buffer::sample_t l = inputs[0].get(i); const stream_buffer::sample_t r = inputs[1].get(i); - outputs[0].put(i, l * m_atten_table[m_level]); - outputs[1].put(i, r * m_atten_table[m_level]); + outputs[0].put(i, l * m_gain[0]); + outputs[1].put(i, r * m_gain[1]); } } - - diff --git a/src/mame/taito/tc0060dca.h b/src/mame/taito/tc0060dca.h index 0cbfefc9a5859..d2c00fa9732d3 100755 --- a/src/mame/taito/tc0060dca.h +++ b/src/mame/taito/tc0060dca.h @@ -8,9 +8,10 @@ class tc0060dca_device : public device_t, public device_sound_interface { public: - tc0060dca_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + tc0060dca_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0); - void set_level(u8 level); + void volume1_w(u8 data); + void volume2_w(u8 data); protected: // device_t override @@ -21,7 +22,7 @@ class tc0060dca_device : public device_t, public device_sound_interface private: sound_stream *m_stream; - u8 m_level; + float m_gain[2]; float m_atten_table[256]; }; diff --git a/src/mame/taito/tc0080vco.cpp b/src/mame/taito/tc0080vco.cpp index b2bb9c01faa64..1390750c31c39 100644 --- a/src/mame/taito/tc0080vco.cpp +++ b/src/mame/taito/tc0080vco.cpp @@ -210,16 +210,14 @@ static const int tc0080vco_zoomy_conv_table[] = 0x67,0x68,0x6a,0x6b,0x6c,0x6e,0x6f,0x71, 0x72,0x74,0x76,0x78,0x80,0x7b,0x7d,0x7f }; -/* Y chain size is 16/32?/64/64? pixels. X chain size - is always 64 pixels. */ - -static const u8 size[] = { 1, 2, 4, 4 }; - void tc0080vco_device::get_sprite_params(int offs, bool zoomy_enable) { m_sprite.tile_offs = (m_spriteram[offs + 3] & 0x1fff) << 2; if (m_sprite.tile_offs) { + // Y chain size is 16/32?/64/64? pixels. X chain size is always 64 pixels. + static const u8 size[] = { 1, 2, 4, 4 }; + m_sprite.x0 = m_spriteram[offs + 1] & 0x03ff; m_sprite.y0 = m_spriteram[offs + 0] & 0x03ff; m_sprite.zoomx = (m_spriteram[offs + 2] & 0x7f00) >> 8; @@ -369,10 +367,7 @@ TILE_GET_INFO_MEMBER(tc0080vco_device::get_tx_tile_info) tileinfo.category = 0; } - tileinfo.set(1, - tile, - 0, - 0); + tileinfo.set(1, tile, 0, 0); } @@ -706,8 +701,8 @@ void tc0080vco_device::bg1_tilemap_draw(screen_device &screen, bitmap_ind16 &bit else { /* adjustment for zx is entirely speculative */ - sx = (( 0x200 + m_scroll_ram[layer + 1]) << 16) - (max_x + min_x) * (zx - 0x10000); - sy = (( 0x3fe - m_scroll_ram[layer + 3]) << 16) - (max_y + min_y) * (zy - 0x10000); + sx = (( 0x200 + m_scroll_ram[layer + 1]) << 16) - (max_x + min_x) * (zx - 0x10000); + sy = (( 0x3fe - m_scroll_ram[layer + 3]) << 16) - (max_y + min_y) * (zy - 0x10000); } copyrozbitmap_core(bitmap, cliprect, srcbitmap, sx, sy, zx, 0, 0, zy, false, screen.priority(), [privalue = priority, primask = pmask](u16 &destp, u8 &pri, const u16 &srcp) { PIXEL_OP_COPY_TRANS0_SET_PRIORITY(destp, pri, srcp); }); @@ -786,4 +781,6 @@ void tc0080vco_device::device_post_load() m_bg1_scrollx = m_scroll_ram[2] & 0x03ff; m_bg0_scrolly = m_scroll_ram[3] & 0x03ff; m_bg1_scrolly = m_scroll_ram[4] & 0x03ff; + + gfx(1)->mark_all_dirty(); } diff --git a/src/mame/taito/tc0100scn.cpp b/src/mame/taito/tc0100scn.cpp index 989b887d41688..72dad04efaf25 100644 --- a/src/mame/taito/tc0100scn.cpp +++ b/src/mame/taito/tc0100scn.cpp @@ -240,8 +240,6 @@ void tc0100scn_base_device::device_start() 16*8 /* every sprite takes 16 consecutive bytes */ }; - int xd, yd; - /* Set up clipping for multi-TC0100SCN games. We assume this code won't ever affect single screen games: Thundfox is the only one of those with two chips, and @@ -269,8 +267,8 @@ void tc0100scn_base_device::device_start() 7 bits higher and 2 pixels to the left than chip #1 because that's how thundfox wants it. */ - xd = (m_multiscrn_hack == 0) ? (-m_x_offset) : (-m_x_offset - 2); - yd = (m_multiscrn_hack == 0) ? (8 - m_y_offset) : (1 - m_y_offset); + int xd = (m_multiscrn_hack == 0) ? (-m_x_offset) : (-m_x_offset - 2); + int yd = (m_multiscrn_hack == 0) ? (8 - m_y_offset) : (1 - m_y_offset); m_tilemap[0][0]->set_scrolldx(xd - 16, -m_flip_xoffs - xd - 16); m_tilemap[0][0]->set_scrolldy(yd, -m_flip_yoffs - yd); @@ -345,7 +343,8 @@ void tc0100scn_device::device_start() void tc0620scc_device::device_start() { decode_gfx(gfxinfo_6bpp); - /* make SCC tile GFX format suitable for gfxdecode */ + + // make SCC tile GFX format suitable for gfxdecode gfx_element *gx0 = gfx(0); gfx_element *gx1 = gfx(1); @@ -454,8 +453,6 @@ void tc0100scn_base_device::set_layer_ptrs() void tc0100scn_base_device::restore_scroll() { - int flip; - m_bgscrollx = -m_ctrl[0]; m_fgscrollx = -m_ctrl[1]; m_tilemap[2][0]->set_scrollx(0, -m_ctrl[2]); @@ -466,7 +463,7 @@ void tc0100scn_base_device::restore_scroll() m_tilemap[2][0]->set_scrolly(0, -m_ctrl[5]); m_tilemap[2][1]->set_scrolly(0, -m_ctrl[5]); - flip = (m_ctrl[7] & 0x01) ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0; + int flip = (m_ctrl[7] & 0x01) ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0; m_tilemap[0][0]->set_flip(flip); m_tilemap[1][0]->set_flip(flip); m_tilemap[2][0]->set_flip(flip); @@ -490,6 +487,9 @@ void tc0100scn_base_device::device_post_load() m_tilemap[0][1]->mark_all_dirty(); m_tilemap[1][1]->mark_all_dirty(); m_tilemap[2][1]->mark_all_dirty(); + + gfx(1)->mark_all_dirty(); + gfx(2)->mark_all_dirty(); } u16 tc0100scn_base_device::ram_r(offs_t offset) @@ -616,14 +616,12 @@ void tc0100scn_base_device::tilemap_update() m_dirty = false; } - int j; - m_tilemap[0][m_dblwidth]->set_scrolly(0, m_bgscrolly); m_tilemap[1][m_dblwidth]->set_scrolly(0, m_fgscrolly); - for (j = 0; j < 256; j++) + for (int j = 0; j < 256; j++) m_tilemap[0][m_dblwidth]->set_scrollx((j + m_bgscrolly) & 0x1ff, m_bgscrollx - m_bgscroll_ram[j]); - for (j = 0; j < 256; j++) + for (int j = 0; j < 256; j++) m_tilemap[1][m_dblwidth]->set_scrollx((j + m_fgscrolly) & 0x1ff, m_fgscrollx - m_fgscroll_ram[j]); } @@ -680,8 +678,8 @@ int tc0100scn_base_device::tilemap_draw( screen_device &screen, bitmap_ind16 &bi clip &= screen.visible_area(); #if 0 -if (disable != 0 && disable != 3 && disable != 7) - popmessage("layer disable = %x",disable); + if (disable != 0 && disable != 3 && disable != 7) + popmessage("layer disable = %x", disable); #endif switch (layer) diff --git a/src/mame/taito/tc0480scp.cpp b/src/mame/taito/tc0480scp.cpp index b34c52fab91e4..f54ab54d0394e 100644 --- a/src/mame/taito/tc0480scp.cpp +++ b/src/mame/taito/tc0480scp.cpp @@ -318,7 +318,7 @@ void tc0480scp_device::device_start() /* create the char set (gfx will then be updated dynamically from RAM) */ if (!gfx(1)) - set_gfx(1, std::make_unique(&palette(), tc0480scp_charlayout, (u8 *)&m_ram[0x7000], NATIVE_ENDIAN_VALUE_LE_BE(8,0), 64, m_col_base)); //e000 + set_gfx(1, std::make_unique(&palette(), tc0480scp_charlayout, (u8 *)&m_ram[0x7000], NATIVE_ENDIAN_VALUE_LE_BE(8,0), 64, m_col_base)); // e000 save_item(NAME(m_ram)); save_item(NAME(m_ctrl)); @@ -803,7 +803,7 @@ void tc0480scp_device::bg23_draw(screen_device &screen, bitmap_ind16 &bitmap, co /* flawed calc ?? */ x_index -= (m_x_offset - 0x1f + layer * 4) * ((row_zoom & 0xff) << 8); -/* We used to kludge 270 multiply factor, before adjusting x_index instead */ + /* We used to kludge 270 multiply factor, before adjusting x_index instead */ int x_step = zoomx; if (row_zoom) /* need to reduce x_step */ @@ -917,46 +917,48 @@ void tc0480scp_device::device_post_load() m_tilemap[4][1]->set_flip(flip); reg = m_ctrl[0]; - if (!flip) reg = -reg; + if (!flip) reg = -reg; m_bgscrollx[0] = reg; reg = m_ctrl[1] + 4; - if (!flip) reg = -reg; + if (!flip) reg = -reg; m_bgscrollx[1] = reg; reg = m_ctrl[2] + 8; - if (!flip) reg = -reg; + if (!flip) reg = -reg; m_bgscrollx[2] = reg; reg = m_ctrl[3] + 12; - if (!flip) reg = -reg; + if (!flip) reg = -reg; m_bgscrollx[3] = reg; reg = m_ctrl[4]; - if (flip) reg = -reg; + if (flip) reg = -reg; m_bgscrolly[0] = reg; reg = m_ctrl[5]; - if (flip) reg = -reg; + if (flip) reg = -reg; m_bgscrolly[1] = reg; reg = m_ctrl[6]; - if (flip) reg = -reg; + if (flip) reg = -reg; m_bgscrolly[2] = reg; reg = m_ctrl[7]; - if (flip) reg = -reg; + if (flip) reg = -reg; m_bgscrolly[3] = reg; reg = m_ctrl[0x0c]; - if (!flip) reg -= m_text_xoffs; - if (flip) reg += m_text_xoffs; + if (flip) reg += m_text_xoffs; + else reg -= m_text_xoffs; m_tilemap[4][0]->set_scrollx(0, -reg); m_tilemap[4][1]->set_scrollx(0, -reg); reg = m_ctrl[0x0d]; - if (!flip) reg -= m_text_yoffs; - if (flip) reg += m_text_yoffs; + if (flip) reg += m_text_yoffs; + else reg -= m_text_yoffs; m_tilemap[4][0]->set_scrolly(0, -reg); m_tilemap[4][1]->set_scrolly(0, -reg); + + gfx(1)->mark_all_dirty(); } diff --git a/src/mame/taito/wgp.cpp b/src/mame/taito/wgp.cpp index f2250e6de246b..367b69d60f160 100644 --- a/src/mame/taito/wgp.cpp +++ b/src/mame/taito/wgp.cpp @@ -3,8 +3,8 @@ // thanks-to:Richard Bush /*************************************************************************** -World Grand Prix (c) Taito Corporation 1989 -================ +WGP (c) Taito Corporation 1989 +=== David Graves @@ -17,10 +17,10 @@ any are different from the ones listed below. ***** -World Grand Prix runs on hardware which is pretty different from the -system Taito commonly used for their pseudo-3d racing games of the -time, the Z system. Different screen and sprite hardware is used. -There's also a LAN hookup (for multiple machines). +WGP runs on hardware which is pretty different from the system Taito +commonly used for their pseudo-3d racing games of the time, the Z system. +Different screen and sprite hardware is used. There's also a LAN hookup +(for multiple machines). As well as a TC0100SCN tilemap generator (two 64x64 layers of 8x8 tiles and a layer of 8x8 tiles with graphics data taken from RAM) @@ -34,8 +34,7 @@ from 16x16 gfx chunks via a sprite mapping area in RAM. The piv and sprite layers are rotatable (but not individually, only together). -World Grand Prix has twin 68K CPUs which communicate via $4000 bytes -of shared ram. +WGP has twin 68K CPUs which communicate via $4000 bytes of shared ram. There is a Z80 as well, which takes over sound duties. Commands are written to it by the one of the 68000s (the same as Taito F2 games). @@ -71,8 +70,8 @@ Offer fake-dip selectable analogue steer Is piv/sprite layers rotation control at 0x600000 ? -Verify y-zoom is correct on the stages that use it (including Wgp2 -default course). Row zoom may be hard to verify, but Wgp2 course +Verify y-zoom is correct on the stages that use it (including WGP 2 +default course). Row zoom may be hard to verify, but WGP 2 course selection screen is probably a good test. Implement proper positioning/zoom/rotation for sprites. @@ -84,7 +83,7 @@ and have [int?] timing glitches.) DIP coinage -Wgp +WGP --- Analogue brake pedal works but won't register in service mode. @@ -96,8 +95,8 @@ Analogue brake pedal works but won't register in service mode. in service mode as brake. -Wgp2 ----- +WGP 2 +----- Piv y zoom may be imperfect. Check the up/down hill part of the default course. The road looks a little odd. @@ -112,7 +111,7 @@ testing that ram. We hack prog for CPUB to disable the writes.] ***** -[Wgp stopped with LAN error. (Looks like CPUB tells CPUA what is wrong +[WGP stopped with LAN error. (Looks like CPUB tells CPUA what is wrong with LAN in shared ram $142048. Examined at $e57c which prints out relevant lan error message). Ended up at $e57c from $b14e-xx code section. CPUA does PEA of $e57c which is the fallback if CPUB doesn't @@ -462,18 +461,18 @@ u16 wgp_state::lan_status_r() { logerror("CPU #2 PC %06x: warning - read lan status\n",m_subcpu->pc()); - return (0x4 << 8); /* CPUB expects this in code at $104d0 (Wgp) */ + return (0x4 << 8); /* CPUB expects this in code at $104d0 (WGP) */ } void wgp_state::rotate_port_w(offs_t offset, u16 data) { /* This port may be for piv/sprite layer rotation. - Wgp2 pokes a single set of values (see 2 routines from - $4e4a), so if this is rotation then Wgp2 *doesn't* use + WGP 2 pokes a single set of values (see 2 routines from + $4e4a), so if this is rotation then WGP 2 *doesn't* use it. - Wgp pokes a wide variety of values here, which appear + WGP pokes a wide variety of values here, which appear to move up and down as rotation control words might. See $ae06-d8 which pokes piv ctrl words, then pokes values to this port. @@ -593,7 +592,7 @@ void wgp_state::main_map(address_map &map) map(0x320000, 0x32000f).rw(m_tc0100scn, FUNC(tc0100scn_device::ctrl_r), FUNC(tc0100scn_device::ctrl_w)); map(0x400000, 0x40bfff).ram().share("spritemap"); /* sprite tilemaps */ map(0x40c000, 0x40dfff).ram().share("spriteram"); /* sprite ram */ - map(0x40fff0, 0x40fff1).nopw(); /* ?? (writes 0x8000 and 0 alternately - Wgp2 just 0) */ + map(0x40fff0, 0x40fff1).nopw(); /* ?? (writes 0x8000 and 0 alternately - WGP 2 just 0) */ map(0x500000, 0x501fff).ram(); /* unknown/unused */ map(0x502000, 0x517fff).ram().w(FUNC(wgp_state::pivram_word_w)).share("pivram"); /* piv tilemaps */ map(0x520000, 0x52001f).ram().w(FUNC(wgp_state::piv_ctrl_word_w)).share("piv_ctrlram"); @@ -810,9 +809,10 @@ GFXDECODE_END /*********************************************************** MACHINE DRIVERS -Wgp has high interleaving to prevent "common ram error". +WGP has high interleaving to prevent "common ram error". However sync to vblank is lacking, which is causing the graphics glitches. + ***********************************************************/ void wgp_state::device_post_load() @@ -1170,7 +1170,7 @@ ROM_START( wgp2 ) ROM_REGION( 0x80000, "ymsnd:adpcmb", 0 ) /* delta-t samples */ ROM_LOAD( "c32-12.7", 0x00000, 0x80000, CRC(df48a37b) SHA1(c0c191f4b8a5f55c0f1e52dac9cd3f7d15adace6) ) -// WGP2 security board (has TC0190FMC) +// WGP 2 security board (has TC0190FMC) // ROM_LOAD( "c73-06", 0x00000, 0x00???, NO_DUMP ) ROM_END @@ -1195,9 +1195,10 @@ void wgp_state::init_wgp2() /* Working Games with some graphics problems - e.g. missing rotation */ -GAME( 1989, wgp, 0, wgp, wgp, wgp_state, init_wgp, ROT0, "Taito Corporation Japan", "World Grand Prix (World)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_NODEVICE_LAN | MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) -GAME( 1989, wgpu, wgp, wgp, wgpu, wgp_state, init_wgp, ROT0, "Taito America Corporation", "World Grand Prix (US)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_NODEVICE_LAN | MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) -GAME( 1989, wgpj, wgp, wgp, wgpj, wgp_state, init_wgp, ROT0, "Taito Corporation", "World Grand Prix (Japan)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_NODEVICE_LAN | MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) -GAME( 1989, wgpjoy, wgp, wgp, wgpjoy, wgp_state, init_wgp, ROT0, "Taito Corporation", "World Grand Prix (joystick version) (Japan, set 1)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) -GAME( 1989, wgpjoya, wgp, wgp, wgpjoy, wgp_state, init_wgp, ROT0, "Taito Corporation", "World Grand Prix (joystick version) (Japan, set 2)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) -GAME( 1990, wgp2, wgp, wgp2, wgp2, wgp_state, init_wgp2, ROT0, "Taito Corporation", "World Grand Prix 2 (Japan)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_NODEVICE_LAN | MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) +GAME( 1989, wgp, 0, wgp, wgp, wgp_state, init_wgp, ROT0, "Taito Corporation Japan", "WGP: Real Race Feeling (World)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_NODEVICE_LAN | MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) +GAME( 1989, wgpu, wgp, wgp, wgpu, wgp_state, init_wgp, ROT0, "Taito America Corporation", "WGP: Real Race Feeling (US)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_NODEVICE_LAN | MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) +GAME( 1989, wgpj, wgp, wgp, wgpj, wgp_state, init_wgp, ROT0, "Taito Corporation", "WGP: Real Race Feeling (Japan)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_NODEVICE_LAN | MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) +GAME( 1989, wgpjoy, wgp, wgp, wgpjoy, wgp_state, init_wgp, ROT0, "Taito Corporation", "WGP: Real Race Feeling (joystick version) (Japan, set 1)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) +GAME( 1989, wgpjoya, wgp, wgp, wgpjoy, wgp_state, init_wgp, ROT0, "Taito Corporation", "WGP: Real Race Feeling (joystick version) (Japan, set 2)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) + +GAME( 1990, wgp2, 0, wgp2, wgp2, wgp_state, init_wgp2, ROT0, "Taito Corporation", "WGP 2: Real Race Feeling (Japan)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_NODEVICE_LAN | MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/taito/wgp.h b/src/mame/taito/wgp.h index 0fb4018219df8..0e8b8df903f55 100644 --- a/src/mame/taito/wgp.h +++ b/src/mame/taito/wgp.h @@ -2,7 +2,7 @@ // copyright-holders:David Graves /************************************************************************* - World Grand Prix + Taito WGP *************************************************************************/ #ifndef MAME_TAITO_WGP_H diff --git a/src/mame/taito/wgp_v.cpp b/src/mame/taito/wgp_v.cpp index f78a8115dcfca..0042d6fe1a125 100644 --- a/src/mame/taito/wgp_v.cpp +++ b/src/mame/taito/wgp_v.cpp @@ -181,13 +181,13 @@ void wgp_state::piv_ctrl_word_w(offs_t offset, u16 data, u16 mem_mask) case 0x09: /* piv 1 y zoom (0x7f = normal, values 0 & - 0xff7f-ffbc in Wgp2) */ + 0xff7f-ffbc in WGP 2) */ m_piv_zoom[1] = data; break; case 0x0a: /* piv 2 y zoom (0x7f = normal, values 0 & - 0xff7f-ffbc in Wgp2, 0-0x98 in Wgp round 4/5) */ + 0xff7f-ffbc in WGP 2, 0-0x98 in Wgp round 4/5) */ m_piv_zoom[2] = data; break; } @@ -206,14 +206,14 @@ Implement rotation/zoom properly. Sprite/piv priority: sprites always over? -Wgp round 1 had some junky brown mud bank sprites in-game. +WGP round 1 had some junky brown mud bank sprites in-game. They are indexed 0xe720-e790. 0x2720*4 => +0x9c80-9e80 in the spritemap area. They should be 2x2 not 4x4 tiles. We kludge this. Round 2 +0x9d40-9f40 contains the 2x2 sprites. What REALLY controls number of tiles in a sprite? -Sprite colors: dust after crash in Wgp2 is odd; some -black/grey barrels on late Wgp circuit also look strange - +Sprite colors: dust after crash in WGP 2 is odd; some +black/grey barrels on late WGP circuit also look strange - possibly the same wrong color. @@ -223,13 +223,13 @@ Memory Map 400000 - 40bfff : Sprite tile mapping area Tile numbers (0-0x3fff) alternate with word containing tile - color/unknown bits. I'm _not_ 100% sure that only Wgp2 uses + color/unknown bits. I'm _not_ 100% sure that only WGP 2 uses the unknown bits. xxxxxxxx x....... unused ?? - ........ .x...... unknown (Wgp2 only: Taito tyre bridge on default course) - ........ ..x..... unknown (Wgp2 only) - ........ ...x.... unknown (Wgp2 only: Direction signs just before hill # 1) + ........ .x...... unknown (WGP 2 only: Taito tyre bridge on default course) + ........ ..x..... unknown (WGP 2 only) + ........ ...x.... unknown (WGP 2 only: Direction signs just before hill # 1) ........ ....cccc color (0-15) Tile map for each standard big sprite is 64 bytes (16 tiles). @@ -278,10 +278,10 @@ Memory Map (No longer used entries typically have 0xfff6 in +0x06 and +0x08.) Only 2 rotation examples (i) at 0x40c000 when Taito - logo displayed (Wgp only). (ii) stage 5 (rain). + logo displayed (WGP only). (ii) stage 5 (rain). Other in-game sprites are simply using +0x06 and +0x0c, - So the sprite rotation in Wgp screenshots must be a *blanket* + So the sprite rotation in WGP screenshots must be a *blanket* rotate effect, identical to the one applied to piv layers. This explains why sprite/piv positions are basically okay despite failure to implement rotation. @@ -290,13 +290,13 @@ Memory Map Each word is a sprite number, 0x0 through 0x1bf. If !=0 a word makes active the 0x10 bytes of sprite data at - (40c000 + sprite_num * 0x10). (Wgp2 fills this in reverse). + (40c000 + sprite_num * 0x10). (WGP 2 fills this in reverse). 40fff0: Unknown (sprite control word?) - Wgp alternates 0x8000 and 0. Wgp2 only pokes 0. + WGP alternates 0x8000 and 0. WGP 2 only pokes 0. Could this be some frame buffer control that would help to - reduce the sprite timing glitches in Wgp? + reduce the sprite timing glitches in WGP? ****************************************************************/ @@ -502,11 +502,11 @@ void wgp_state::piv_layer_draw(screen_device &screen, bitmap_ind16 &bitmap, cons const u32 zoomx = 0x10000; /* No overall X zoom, unlike TC0480SCP */ /* Y-axis zoom offers expansion/compression: 0x7f = no zoom, 0xff = max ??? - In WGP see: stage 4 (big spectator stand) - stage 5 (cloud layer) - stage 7 (two bits of background scenery) - stage 8 (unknown - surely something should be appearing here...) - In WGP2 see: road at big hill (default course) */ + In WGP see: stage 4 (big spectator stand) + stage 5 (cloud layer) + stage 7 (two bits of background scenery) + stage 8 (unknown - surely something should be appearing here...) + In WGP 2 see: road at big hill (default course) */ /* This calculation may be wrong, the y_index one too */ const u32 zoomy = 0x10000 - (((m_piv_ctrlram[0x08 + layer] & 0xff) - 0x7f) * 512); diff --git a/src/mame/tatsumi/apache3.cpp b/src/mame/tatsumi/apache3.cpp new file mode 100644 index 0000000000000..a601747a319fa --- /dev/null +++ b/src/mame/tatsumi/apache3.cpp @@ -0,0 +1,669 @@ +// license:BSD-3-Clause +// copyright-holders:Bryan McPhail, Angelo Salese +/*************************************************************************** + + Apache 3 ATF-011 + + TODO: + + - road layer, has twelve rotation registers! + +***************************************************************************/ + +#include "emu.h" +#include "tatsumi.h" + +#include "cpu/nec/nec.h" +#include "cpu/z80/z80.h" +#include "machine/adc0808.h" +#include "machine/i8255.h" +#include "machine/nvram.h" +#include "screen.h" +#include "speaker.h" + +namespace { + +class apache3_state : public tatsumi_state +{ +public: + apache3_state(const machine_config &mconfig, device_type type, const char *tag) + : tatsumi_state(mconfig, type, tag) + , m_subcpu2(*this, "sub2") + , m_apache3_g_ram(*this, "apache3_g_ram") + , m_apache3_z80_ram(*this, "apache3_z80_ram") + , m_apache3_prom(*this, "proms") + , m_vr1(*this, "VR1") + { + } + + void apache3(machine_config &config); + + void init_apache3(); + +protected: + virtual void machine_reset() override ATTR_COLD; + virtual void video_start() override ATTR_COLD; + +private: + uint16_t apache3_bank_r(); + void apache3_bank_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); + void apache3_z80_ctrl_w(uint16_t data); + uint16_t apache3_v30_v20_r(offs_t offset); + void apache3_v30_v20_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); + uint16_t apache3_z80_r(offs_t offset); + void apache3_z80_w(offs_t offset, uint16_t data); + uint8_t apache3_vr1_r(); + void apache3_rotate_w(uint16_t data); + void apache3_road_z_w(uint16_t data); + void apache3_road_x_w(offs_t offset, uint8_t data); + + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + void apache3_68000_reset(int state); + + void apache3_68000_map(address_map &map) ATTR_COLD; + void apache3_v20_map(address_map &map) ATTR_COLD; + void apache3_v30_map(address_map &map) ATTR_COLD; + void apache3_z80_map(address_map &map) ATTR_COLD; + + void draw_sky(bitmap_rgb32 &bitmap, const rectangle &cliprect, int palette_base, int start_offset); + [[maybe_unused]] void draw_ground(bitmap_rgb32 &dst, const rectangle &cliprect); + + required_device m_subcpu2; + + required_shared_ptr m_apache3_g_ram; + required_shared_ptr m_apache3_z80_ram; + required_region_ptr m_apache3_prom; + + required_ioport m_vr1; + + uint16_t m_apache3_rotate_ctrl[12]; + int m_apache3_rot_idx; + std::unique_ptr m_apache3_road_x_ram; + uint8_t m_apache3_road_z; +}; + + +void apache3_state::apache3_road_z_w(uint16_t data) +{ + m_apache3_road_z = data & 0xff; +} + +void apache3_state::apache3_road_x_w(offs_t offset, uint8_t data) +{ + // Note: Double buffered. Yes, this is correct :) + m_apache3_road_x_ram[data] = offset; +} + +void apache3_state::draw_sky(bitmap_rgb32 &bitmap,const rectangle &cliprect, int palette_base, int start_offset) +{ + // all TODO + if (start_offset&0x8000) + start_offset=-(0x10000 - start_offset); + + start_offset=-start_offset; + + start_offset-=48; + for (int y=0; y<256; y++) { + for (int x=0; x<320; x++) { + int col=palette_base + y + start_offset; + if (colpalette_base+127) col=palette_base+127; + + bitmap.pix(y, x) = m_palette->pen(col); + } + } +} + +/* Draw the sky and ground, applying rotation (eventually). Experimental! */ +void apache3_state::draw_ground(bitmap_rgb32 &dst, const rectangle &cliprect) +{ + if (0) + { + uint16_t gva = 0x180; // TODO + uint8_t sky_val = m_apache3_rotate_ctrl[1] & 0xff; + + for (int y = cliprect.min_y; y <= cliprect.max_y; ++y) + { + uint16_t rgdb = 0;//m_apache3_road_x_ram[gva & 0xff]; + uint16_t gha = 0xf60; // test + int ln = (((m_apache3_prom[gva & 0x7f] & 0x7f) + (m_apache3_road_z & 0x7f)) >> 5) & 3; + + if (gva & 0x100) + { + /* Sky */ + for (int x = cliprect.min_x; x <= cliprect.max_x; ++x) + { + dst.pix(y, x) = m_palette->pen(0x100 + (sky_val & 0x7f)); + + /* Update horizontal counter? */ + gha = (gha + 1) & 0xfff; + } + } + else + { + /* Ground */ + for (int x = cliprect.min_x; x <= cliprect.max_x; ++x) + { + uint16_t hval = (rgdb + gha) & 0xfff; // Not quite + + if (hval & 0x800) + hval ^= 0x1ff; // TEST + //else + //hval = hval; + + uint8_t pixels = m_apache3_g_ram[(((gva & 0xff) << 7) | ((hval >> 2) & 0x7f))]; + int pix_sel = hval & 3; + + uint8_t colour = (pixels >> (pix_sel << 1)) & 3; + colour = (BIT(hval, 11) << 4) | (colour << 2) | ln; + + /* Draw the pixel */ + dst.pix(y, x) = m_palette->pen(0x200 + colour); + + /* Update horizontal counter */ + gha = (gha + 1) & 0xfff; + } + } + + /* Update sky counter */ + sky_val++; + gva = (gva + 1) & 0x1ff; + } + } +} + + +void apache3_state::video_start() +{ + m_tx_layer = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(apache3_state::get_text_tile_info)), TILEMAP_SCAN_ROWS, 8,8, 64,64); + m_apache3_road_x_ram = std::make_unique(512); + + m_tx_layer->set_transparent_pen(0); +} + +uint32_t apache3_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +{ + m_sprites->update_cluts(); + + m_tx_layer->set_scrollx(0,24); + + bitmap.fill(m_palette->pen(0), cliprect); + screen.priority().fill(0, cliprect); + m_sprites->draw_sprites(screen.priority(),cliprect,1,(m_sprite_control_ram[0xe0]&0x1000) ? 0x1000 : 0); // Alpha pass only + draw_sky(bitmap, cliprect, 256, m_apache3_rotate_ctrl[1]); + apply_shadow_bitmap(bitmap,cliprect,screen.priority(), 0); +// draw_ground(bitmap, cliprect); + m_sprites->draw_sprites(bitmap,cliprect,0, (m_sprite_control_ram[0x20]&0x1000) ? 0x1000 : 0); + m_tx_layer->draw(screen, bitmap, cliprect, 0,0); + return 0; +} + +uint16_t apache3_state::apache3_bank_r() +{ + return m_control_word; +} + +void apache3_state::apache3_bank_w(offs_t offset, uint16_t data, uint16_t mem_mask) +{ + /* + 0x8000 - Set when accessing palette ram (not implemented, perhaps blank screen?) + 0x0080 - Set when accessing IO cpu RAM/ROM (implemented as halt cpu) + 0x0060 - IOP bank to access from main cpu (0x0 = RAM, 0x20 = lower ROM, 0x60 = upper ROM) + 0x0010 - Set when accessing OBJ cpu RAM/ROM (implemented as halt cpu) + 0x000f - OBJ bank to access from main cpu (0x8 = RAM, 0x0 to 0x7 = ROM) + */ + + COMBINE_DATA(&m_control_word); + + if (m_control_word & 0x7f00) + { + logerror("Unknown control Word: %04x\n",m_control_word); + m_subcpu2->set_input_line(INPUT_LINE_HALT, CLEAR_LINE); // ? + } + + if (m_control_word & 0x10) + m_subcpu->set_input_line(INPUT_LINE_HALT, ASSERT_LINE); + else + m_subcpu->set_input_line(INPUT_LINE_HALT, CLEAR_LINE); + + if (m_control_word & 0x80) + m_audiocpu->set_input_line(INPUT_LINE_HALT, ASSERT_LINE); + else + m_audiocpu->set_input_line(INPUT_LINE_HALT, CLEAR_LINE); + + m_last_control=m_control_word; +} + +// D1 = /ZBREQ - Z80 bus request +// D0 = /GRDACC - Allow 68000 access to road pattern RAM +void apache3_state::apache3_z80_ctrl_w(uint16_t data) +{ + m_subcpu2->set_input_line(INPUT_LINE_HALT, data & 2 ? ASSERT_LINE : CLEAR_LINE); +} + +uint16_t apache3_state::apache3_v30_v20_r(offs_t offset) +{ + address_space &targetspace = m_audiocpu->space(AS_PROGRAM); + + /* Each V20 byte maps to a V30 word */ + if ((m_control_word & 0xe0) == 0xe0) + offset += 0xf8000; /* Upper half */ + else if ((m_control_word & 0xe0) == 0xc0) + offset += 0xf0000; + else if ((m_control_word & 0xe0) == 0x80) + offset += 0x00000; // main ram + else + logerror("%08x: unmapped read z80 rom %08x\n", m_maincpu->pc(), offset); + return 0xff00 | targetspace.read_byte(offset); +} + +void apache3_state::apache3_v30_v20_w(offs_t offset, uint16_t data, uint16_t mem_mask) +{ + address_space &targetspace = m_audiocpu->space(AS_PROGRAM); + + if ((m_control_word & 0xe0) != 0x80) + logerror("%08x: write unmapped v30 rom %08x\n", m_maincpu->pc(), offset); + + /* Only 8 bits of the V30 data bus are connected - ignore writes to the other half */ + if (ACCESSING_BITS_0_7) + { + targetspace.write_byte(offset, data & 0xff); + } +} + +uint16_t apache3_state::apache3_z80_r(offs_t offset) +{ + return m_apache3_z80_ram[offset]; +} + +void apache3_state::apache3_z80_w(offs_t offset, uint16_t data) +{ + m_apache3_z80_ram[offset] = data & 0xff; +} + +uint8_t apache3_state::apache3_vr1_r() +{ + return (uint8_t)((255./100) * (100 - m_vr1->read())); +} + +/* Ground/sky rotation control + * + * There are 12 16-bit values that are + * presumably loaded into the 8 TZ2213 custom + * accumulators and counters. + */ +void apache3_state::apache3_rotate_w(uint16_t data) +{ + m_apache3_rotate_ctrl[m_apache3_rot_idx] = data; + m_apache3_rot_idx = (m_apache3_rot_idx + 1) % 12; +} + +void apache3_state::apache3_v30_map(address_map &map) +{ + map(0x00000, 0x03fff).ram(); + map(0x04000, 0x07fff).ram().share("nvram"); + map(0x08000, 0x08fff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); + map(0x0c000, 0x0dfff).ram().w(FUNC(apache3_state::text_w)).share("videoram"); + map(0x0e800, 0x0e803).w(FUNC(apache3_state::hd6445_crt_w)).umask16(0x00ff); + map(0x0f000, 0x0f001).portr("DSW"); + map(0x0f000, 0x0f001).nopw(); // todo + map(0x0f800, 0x0f801).rw(FUNC(apache3_state::apache3_bank_r), FUNC(apache3_state::apache3_bank_w)); + map(0x10000, 0x1ffff).rw(FUNC(apache3_state::apache3_v30_v20_r), FUNC(apache3_state::apache3_v30_v20_w)); + map(0x20000, 0x2ffff).rw(FUNC(apache3_state::tatsumi_v30_68000_r), FUNC(apache3_state::tatsumi_v30_68000_w)); + map(0x80000, 0xfffff).rom().region("master_rom", 0); +} + +void apache3_state::apache3_68000_map(address_map &map) +{ + map(0x00000, 0x7ffff).rom().region("slave_rom", 0); + map(0x80000, 0x83fff).ram().share("sharedram"); + map(0x90000, 0x93fff).ram().share("spriteram"); + map(0x9a000, 0x9a1ff).rw(FUNC(apache3_state::tatsumi_sprite_control_r), FUNC(apache3_state::tatsumi_sprite_control_w)).share("obj_ctrl_ram"); + map(0xa0000, 0xa0001).w(FUNC(apache3_state::apache3_rotate_w)); // /BNKCS + map(0xb0000, 0xb0001).w(FUNC(apache3_state::apache3_z80_ctrl_w)); + map(0xc0000, 0xc0001).w(FUNC(apache3_state::apache3_road_z_w)); // /LINCS + map(0xd0000, 0xdffff).ram().share("apache3_g_ram"); // /GRDCS + map(0xe0000, 0xe7fff).rw(FUNC(apache3_state::apache3_z80_r), FUNC(apache3_state::apache3_z80_w)); +} + +void apache3_state::apache3_v20_map(address_map &map) +{ + map(0x00000, 0x01fff).ram(); + map(0x04000, 0x04003).rw("ppi", FUNC(i8255_device::read), FUNC(i8255_device::write)); + map(0x06000, 0x06001).portr("IN0"); // esw + map(0x08000, 0x08001).rw(m_ym2151, FUNC(ym2151_device::read), FUNC(ym2151_device::write)); + map(0x0a000, 0x0a000).r(m_oki, FUNC(okim6295_device::read)).w(m_oki, FUNC(okim6295_device::write)); + map(0x0e000, 0x0e007).rw("adc", FUNC(adc0808_device::data_r), FUNC(adc0808_device::address_offset_start_w)); + map(0xf0000, 0xfffff).rom().region("sound_rom", 0); +} + +void apache3_state::apache3_z80_map(address_map &map) +{ + map(0x0000, 0x1fff).ram().share("apache3_z80_ram"); + map(0x8000, 0xffff).w(FUNC(apache3_state::apache3_road_x_w)); +} + + +static INPUT_PORTS_START( apache3 ) + PORT_START("IN0") + PORT_SERVICE_NO_TOGGLE( 0x01, IP_ACTIVE_LOW ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME( "Trigger" ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME( "Power" ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN1 ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN2 ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE1 ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START1 ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME( "Missile" ) + + PORT_START("STICK_X") + PORT_BIT( 0xff, 0x7f, IPT_AD_STICK_X ) PORT_SENSITIVITY(25) PORT_KEYDELTA(15) PORT_PLAYER(1) + + PORT_START("STICK_Y") + PORT_BIT( 0xff, 0x7f, IPT_AD_STICK_Y ) PORT_SENSITIVITY(25) PORT_KEYDELTA(15) PORT_PLAYER(1) + + PORT_START("THROTTLE") + PORT_BIT( 0xff, 0x7f, IPT_AD_STICK_Z ) PORT_SENSITIVITY(25) PORT_KEYDELTA(79) + + PORT_START("VR1") + PORT_ADJUSTER(100, "VR1") + + PORT_START("DSW") + PORT_DIPNAME( 0x0003, 0x0000, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:1,2") + PORT_DIPSETTING( 0x0000, "3" ) + PORT_DIPSETTING( 0x0001, "4" ) + PORT_DIPSETTING( 0x0002, "5" ) + PORT_DIPSETTING( 0x0003, "6" ) + PORT_DIPNAME( 0x000c, 0x0000, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:3,4") + PORT_DIPSETTING( 0x0004, DEF_STR( Easy ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( Normal ) ) + PORT_DIPSETTING( 0x0008, DEF_STR( Hard ) ) + PORT_DIPSETTING( 0x000c, DEF_STR( Hardest ) ) + PORT_DIPNAME( 0x0010, 0x0000, DEF_STR( Demo_Sounds ) ) + PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0020, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:6") /* Listed as "Always On" */ + PORT_DIPSETTING( 0x0020, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0040, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:7") /* Listed as "Not Used" */ + PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0080, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:8") /* Listed as "Always On" */ + PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0700, 0x0000, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:1,2,3") + PORT_DIPSETTING( 0x0200, DEF_STR( 3C_1C ) ) + PORT_DIPSETTING( 0x0100, DEF_STR( 2C_1C ) ) + PORT_DIPSETTING( 0x0700, DEF_STR( 3C_2C ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( 1C_1C ) ) + PORT_DIPSETTING( 0x0600, DEF_STR( 2C_3C ) ) + PORT_DIPSETTING( 0x0300, DEF_STR( 1C_2C ) ) + PORT_DIPSETTING( 0x0400, DEF_STR( 1C_5C ) ) + PORT_DIPSETTING( 0x0500, DEF_STR( 1C_6C ) ) + PORT_DIPNAME( 0x0800, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:4") /* Manual only shows a 3-Way dip box, so 4-8 are unknown */ + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0800, DEF_STR( On ) ) + PORT_DIPNAME( 0x1000, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:5") + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x1000, DEF_STR( On ) ) + PORT_DIPNAME( 0x2000, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:6") + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x2000, DEF_STR( On ) ) + PORT_DIPNAME( 0x4000, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:7") + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x4000, DEF_STR( On ) ) + PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Test ) ) PORT_DIPLOCATION("SW1:8") + PORT_DIPSETTING( 0x8000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) +INPUT_PORTS_END + +static GFXDECODE_START( gfx_apache3 ) + GFXDECODE_ENTRY( "text", 0, gfx_8x8x3_planar, 768, 16) +GFXDECODE_END + + +void apache3_state::apache3_68000_reset(int state) +{ + m_subcpu2->pulse_input_line(INPUT_LINE_RESET, attotime::zero); +} + +void apache3_state::machine_reset() +{ + m_subcpu2->set_input_line(INPUT_LINE_RESET, ASSERT_LINE); // TODO +} + + +void apache3_state::apache3(machine_config &config) +{ + /* basic machine hardware */ + V30(config, m_maincpu, apache3_state::CLOCK_1 / 2); + m_maincpu->set_addrmap(AS_PROGRAM, &apache3_state::apache3_v30_map); + m_maincpu->set_vblank_int("screen", FUNC(apache3_state::v30_interrupt)); + + M68000(config, m_subcpu, apache3_state::CLOCK_2 / 4); + m_subcpu->set_addrmap(AS_PROGRAM, &apache3_state::apache3_68000_map); + m_subcpu->set_vblank_int("screen", FUNC(apache3_state::irq4_line_hold)); + m_subcpu->reset_cb().set(FUNC(apache3_state::apache3_68000_reset)); + + V20(config, m_audiocpu, apache3_state::CLOCK_1 / 2); + m_audiocpu->set_addrmap(AS_PROGRAM, &apache3_state::apache3_v20_map); + + Z80(config, m_subcpu2, apache3_state::CLOCK_2 / 8); + m_subcpu2->set_addrmap(AS_PROGRAM, &apache3_state::apache3_z80_map); + m_subcpu2->set_vblank_int("screen", FUNC(apache3_state::irq0_line_hold)); + + config.set_maximum_quantum(attotime::from_hz(6000)); + NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); + + m58990_device &adc(M58990(config, "adc", 1000000)); // unknown clock + adc.in_callback<0>().set_ioport("STICK_X"); + adc.in_callback<1>().set_ioport("STICK_Y"); + adc.in_callback<2>().set_constant(0); // VSP1 + adc.in_callback<4>().set(FUNC(apache3_state::apache3_vr1_r)); + adc.in_callback<5>().set_ioport("THROTTLE"); + adc.in_callback<6>().set_constant(0); // RPSNC + adc.in_callback<7>().set_constant(0); // LPSNC + + I8255(config, "ppi"); + + /* video hardware */ + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); + screen.set_raw(apache3_state::CLOCK_2 / 8, 400, 0, 320, 272, 0, 240); // TODO: Hook up CRTC + screen.set_screen_update(FUNC(apache3_state::screen_update)); + + TZB215_SPRITES(config, m_sprites, 0, 0x800); + m_sprites->set_sprite_palette_base(0); + m_sprites->set_palette("sprites:palette_clut"); + m_sprites->set_basepalette(m_palette); + m_sprites->set_spriteram(m_spriteram); + + GFXDECODE(config, m_gfxdecode, m_palette, gfx_apache3); + PALETTE(config, m_palette).set_format(palette_device::xRGB_555, 2048); // 2048 real colours + + /* apache 3 schematics state + bit 4: 250 + bit 3: 500 + bit 2: 1k + bit 1: 2k + bit 0: 3.9kOhm resistor + */ + + /* sound hardware */ + SPEAKER(config, "lspeaker").front_left(); + SPEAKER(config, "rspeaker").front_right(); + + YM2151(config, m_ym2151, apache3_state::CLOCK_1 / 4); + m_ym2151->irq_handler().set_inputline(m_audiocpu, INPUT_LINE_IRQ0); + m_ym2151->add_route(0, "lspeaker", 0.45); + m_ym2151->add_route(1, "rspeaker", 0.45); + + OKIM6295(config, m_oki, apache3_state::CLOCK_1 / 4 / 2, okim6295_device::PIN7_HIGH); + m_oki->add_route(ALL_OUTPUTS, "lspeaker", 0.75); + m_oki->add_route(ALL_OUTPUTS, "rspeaker", 0.75); +} + + +ROM_START( apache3 ) + ROM_REGION16_LE( 0x80000, "master_rom", 0 ) /* v30 main cpu */ + ROM_LOAD16_BYTE( "ap-25f.125", 0x020001, 0x10000, CRC(3c7530f4) SHA1(9f7b58a3abddbdc3081ba9dfc1732406eb8c1752) ) + ROM_LOAD16_BYTE( "ap-26f.133", 0x020000, 0x10000, CRC(2955997f) SHA1(86e37def923d9cf4eb33e7979118ec6f1ef62678) ) + ROM_LOAD16_BYTE( "ap-23f.110", 0x060001, 0x10000, CRC(d7077149) SHA1(b08f5a9ee03641c20bdd5e5c9671a22c740150c6) ) + ROM_LOAD16_BYTE( "ap-24f.118", 0x060000, 0x10000, CRC(0bdef11b) SHA1(ed687600962ed2ca3a8e67cbd84fa5486778eade) ) + + ROM_REGION16_BE( 0x80000, "slave_rom", 0 ) /* 68000 sub cpu */ + ROM_LOAD16_BYTE( "ap-19c.80", 0x000001, 0x10000, CRC(0908e468) SHA1(a2d725993bd4cd5425468736154fd3dd9dd7b060) ) + ROM_LOAD16_BYTE( "ap-21c.97", 0x000000, 0x10000, CRC(38a056fb) SHA1(67c8ae58670cebde0771854e1fb5fc2eb2543ecc) ) + ROM_LOAD16_BYTE( "ap-20a.89", 0x040001, 0x20000, CRC(92d24b5e) SHA1(1ea270d46a607e47b7e0961b532316aa05dc8f4e) ) + ROM_LOAD16_BYTE( "ap-22a.105", 0x040000, 0x20000, CRC(a8458a92) SHA1(43674731c2e9962c2bfbb73a85484cf03d6be223) ) + + ROM_REGION( 0x10000, "sound_rom", 0 ) /* 64k code for sound V20 */ + ROM_LOAD( "ap-27d.151", 0x00000, 0x10000, CRC(294b4d79) SHA1(2b03418a12a2aaf3919b98161d8d0ce6ae29a2bb) ) + + ROM_REGION( 0x100000, "sprites:sprites_l", 0) + ROM_LOAD32_BYTE( "ap-00c.15", 0x000000, 0x20000, CRC(ad1ddc2b) SHA1(81f64663c4892ab5fb0e2dc99513dbfee73f15b8) ) + ROM_LOAD32_BYTE( "ap-01c.22", 0x000001, 0x20000, CRC(6286ff00) SHA1(920da4a3a441dbf54ad86c0f4fb6f47a867e9cda) ) + ROM_LOAD32_BYTE( "ap-04c.58", 0x000002, 0x20000, CRC(dc6d55e4) SHA1(9f48f8d6aa1a329a71913139a8d5a50d95a9b9e5) ) + ROM_LOAD32_BYTE( "ap-05c.65", 0x000003, 0x20000, CRC(2e6e495f) SHA1(af610f265da53735b20ddc6df1bda47fc54ee0c3) ) + ROM_LOAD32_BYTE( "ap-02c.34", 0x080000, 0x20000, CRC(af4ee7cb) SHA1(4fe2361b7431971b07671f145abf1ea5861d01db) ) + ROM_LOAD32_BYTE( "ap-03c.46", 0x080001, 0x20000, CRC(60ab495c) SHA1(18340d4fba550495b1e52f8023a0a2ec6349dfeb) ) + ROM_LOAD32_BYTE( "ap-06c.71", 0x080002, 0x20000, CRC(0ea90e55) SHA1(b16d6b8be4853797507d3e5c933a9dd1d451308e) ) + ROM_LOAD32_BYTE( "ap-07c.75", 0x080003, 0x20000, CRC(ba685543) SHA1(140a2b708d4e4de4d207fc2c4a96a5cab8639988) ) + + ROM_REGION( 0x100000, "sprites:sprites_h", 0) + ROM_LOAD32_BYTE( "ap-08c.14", 0x000000, 0x20000, CRC(6437b580) SHA1(2b2ba42add18bbec04fbcf53645a8d44b972e26a) ) + ROM_LOAD32_BYTE( "ap-09c.21", 0x000001, 0x20000, CRC(54d18ef9) SHA1(40ebc6ea49b2a501fe843d60bec8c32d07f2d25d) ) + ROM_LOAD32_BYTE( "ap-12c.57", 0x000002, 0x20000, CRC(f95cf5cf) SHA1(ce373c648cbf3e4863bbc3a1175efe065c75eb13) ) + ROM_LOAD32_BYTE( "ap-13c.64", 0x000003, 0x20000, CRC(67a248c3) SHA1(cc945f7cfecaaab5075c1a3d202369b070d4c656) ) + ROM_LOAD32_BYTE( "ap-10c.33", 0x080000, 0x20000, CRC(74418df4) SHA1(cc1206b10afc2de919b2fb9899486122d27290a4) ) + ROM_LOAD32_BYTE( "ap-11c.45", 0x080001, 0x20000, CRC(195bf78e) SHA1(c3c472f3c4244545b89491b6ebec4f838a6bbb73) ) + ROM_LOAD32_BYTE( "ap-14c.70", 0x080002, 0x20000, CRC(58f7fe16) SHA1(a5b87b42b85808c226df0d2a7b7cdde12d474a41) ) + ROM_LOAD32_BYTE( "ap-15c.74", 0x080003, 0x20000, CRC(1ffd5496) SHA1(25efb568957fc9441a40a7d64cc6afe1a14b392b) ) + + ROM_REGION( 0x18000, "text", 0 ) + ROM_LOAD( "ap-18d.73", 0x000000, 0x8000, CRC(55e664bf) SHA1(505bec8b5ff3f9fa2c5fb1213d54683347905be1) ) + ROM_LOAD( "ap-17d.68", 0x008000, 0x8000, CRC(6199afe4) SHA1(ad8c0ed6c33d984bb29c89f2e7fc7e5a923cefe3) ) + ROM_LOAD( "ap-16d.63", 0x010000, 0x8000, CRC(f115656d) SHA1(61798858dc0172192d89e666696b2c7642756899) ) + + ROM_REGION( 0x40000, "oki", 0 ) /* ADPCM samples */ + ROM_LOAD( "ap-28c.171", 0x000000, 0x20000, CRC(b349f0c2) SHA1(cb1ff1c0e784f669c87ab1eccd3b358950761b74) ) + ROM_LOAD( "ap-29c.176", 0x020000, 0x10000, CRC(b38fced3) SHA1(72f61a719f393957bcccf14687bfbb2e7a5f7aee) ) + + ROM_REGION( 0x200, "proms", 0 ) /* Road stripe PROM */ + ROM_LOAD( "am27s29.ic41", 0x000, 0x200, CRC(c981f1e0) SHA1(7d8492d9f4033ab3734c09ee23016a0b210648b5) ) +ROM_END + +ROM_START( apache3a ) + ROM_REGION16_LE( 0x80000, "master_rom", 0 ) /* v30 main cpu */ + ROM_LOAD16_BYTE( "ap-25c.125", 0x020001, 0x10000, CRC(7bc496a6) SHA1(5491d06181d729407e975b85a8715fdc3b489c67) ) + ROM_LOAD16_BYTE( "ap-26c.133", 0x020000, 0x10000, CRC(9393a470) SHA1(00376f7a545629a83eb5a90b9d1685a68430e4ce) ) + ROM_LOAD16_BYTE( "ap-23e.110", 0x060001, 0x10000, CRC(3e465b8e) SHA1(dfd009221974eb43263dd3f4f80f39bb32c30ced) ) /* hand written label: 23E DD65 */ + ROM_LOAD16_BYTE( "ap-24e.118", 0x060000, 0x10000, CRC(1ef746f2) SHA1(31d77bd954ea6cc00cac40a3a514281da371030b) ) /* hand written label: 24E E2A2 */ + + ROM_REGION16_BE( 0x80000, "slave_rom", 0 ) /* 68000 sub cpu */ + ROM_LOAD16_BYTE( "ap-19c.80", 0x000001, 0x10000, CRC(0908e468) SHA1(a2d725993bd4cd5425468736154fd3dd9dd7b060) ) + ROM_LOAD16_BYTE( "ap-21c.97", 0x000000, 0x10000, CRC(38a056fb) SHA1(67c8ae58670cebde0771854e1fb5fc2eb2543ecc) ) + ROM_LOAD16_BYTE( "ap-20a.89", 0x040001, 0x20000, CRC(92d24b5e) SHA1(1ea270d46a607e47b7e0961b532316aa05dc8f4e) ) + ROM_LOAD16_BYTE( "ap-22a.105", 0x040000, 0x20000, CRC(a8458a92) SHA1(43674731c2e9962c2bfbb73a85484cf03d6be223) ) + + ROM_REGION( 0x10000, "sound_rom", 0 ) /* 64k code for sound V20 */ + ROM_LOAD( "ap-27d.151", 0x00000, 0x10000, CRC(294b4d79) SHA1(2b03418a12a2aaf3919b98161d8d0ce6ae29a2bb) ) + + ROM_REGION( 0x100000, "sprites:sprites_l", 0) + ROM_LOAD32_BYTE( "ap-00c.15", 0x000000, 0x20000, CRC(ad1ddc2b) SHA1(81f64663c4892ab5fb0e2dc99513dbfee73f15b8) ) + ROM_LOAD32_BYTE( "ap-01c.22", 0x000001, 0x20000, CRC(6286ff00) SHA1(920da4a3a441dbf54ad86c0f4fb6f47a867e9cda) ) + ROM_LOAD32_BYTE( "ap-04c.58", 0x000002, 0x20000, CRC(dc6d55e4) SHA1(9f48f8d6aa1a329a71913139a8d5a50d95a9b9e5) ) + ROM_LOAD32_BYTE( "ap-05c.65", 0x000003, 0x20000, CRC(2e6e495f) SHA1(af610f265da53735b20ddc6df1bda47fc54ee0c3) ) + ROM_LOAD32_BYTE( "ap-02c.34", 0x080000, 0x20000, CRC(af4ee7cb) SHA1(4fe2361b7431971b07671f145abf1ea5861d01db) ) + ROM_LOAD32_BYTE( "ap-03c.46", 0x080001, 0x20000, CRC(60ab495c) SHA1(18340d4fba550495b1e52f8023a0a2ec6349dfeb) ) + ROM_LOAD32_BYTE( "ap-06c.71", 0x080002, 0x20000, CRC(0ea90e55) SHA1(b16d6b8be4853797507d3e5c933a9dd1d451308e) ) + ROM_LOAD32_BYTE( "ap-07c.75", 0x080003, 0x20000, CRC(ba685543) SHA1(140a2b708d4e4de4d207fc2c4a96a5cab8639988) ) + + ROM_REGION( 0x100000, "sprites:sprites_h", 0) + ROM_LOAD32_BYTE( "ap-08c.14", 0x000000, 0x20000, CRC(6437b580) SHA1(2b2ba42add18bbec04fbcf53645a8d44b972e26a) ) + ROM_LOAD32_BYTE( "ap-09c.21", 0x000001, 0x20000, CRC(54d18ef9) SHA1(40ebc6ea49b2a501fe843d60bec8c32d07f2d25d) ) + ROM_LOAD32_BYTE( "ap-12c.57", 0x000002, 0x20000, CRC(f95cf5cf) SHA1(ce373c648cbf3e4863bbc3a1175efe065c75eb13) ) + ROM_LOAD32_BYTE( "ap-13c.64", 0x000003, 0x20000, CRC(67a248c3) SHA1(cc945f7cfecaaab5075c1a3d202369b070d4c656) ) + ROM_LOAD32_BYTE( "ap-10c.33", 0x080000, 0x20000, CRC(74418df4) SHA1(cc1206b10afc2de919b2fb9899486122d27290a4) ) + ROM_LOAD32_BYTE( "ap-11c.45", 0x080001, 0x20000, CRC(195bf78e) SHA1(c3c472f3c4244545b89491b6ebec4f838a6bbb73) ) + ROM_LOAD32_BYTE( "ap-14c.70", 0x080002, 0x20000, CRC(58f7fe16) SHA1(a5b87b42b85808c226df0d2a7b7cdde12d474a41) ) + ROM_LOAD32_BYTE( "ap-15c.74", 0x080003, 0x20000, CRC(1ffd5496) SHA1(25efb568957fc9441a40a7d64cc6afe1a14b392b) ) + + ROM_REGION( 0x18000, "text", 0 ) + ROM_LOAD( "ap-18e.73", 0x000000, 0x10000, CRC(d7861a26) SHA1(b1a1e089a293a5536d342c9edafbea303f4f128c) ) + ROM_LOAD( "ap-16e.63", 0x008000, 0x10000, CRC(d3251965) SHA1(aef4f58a6f773060434abda9d7f5f003693577bf) ) + ROM_LOAD( "ap-17e.68", 0x008000, 0x08000, CRC(4509c2ed) SHA1(97a6a6710e83aca212ce43d06c3f26c35f9782b8) ) + + ROM_REGION( 0x40000, "oki", 0 ) /* ADPCM samples */ + ROM_LOAD( "ap-28c.171", 0x000000, 0x20000, CRC(b349f0c2) SHA1(cb1ff1c0e784f669c87ab1eccd3b358950761b74) ) + ROM_LOAD( "ap-29c.176", 0x020000, 0x10000, CRC(b38fced3) SHA1(72f61a719f393957bcccf14687bfbb2e7a5f7aee) ) + + ROM_REGION( 0x200, "proms", 0 ) /* Road stripe PROM */ + ROM_LOAD( "am27s29.ic41", 0x000, 0x200, CRC(c981f1e0) SHA1(7d8492d9f4033ab3734c09ee23016a0b210648b5) ) +ROM_END + +ROM_START( apache3b ) + ROM_REGION16_LE( 0x80000, "master_rom", 0 ) /* v30 main cpu */ + ROM_LOAD16_BYTE( "ap-25c.125", 0x020001, 0x10000, CRC(7bc496a6) SHA1(5491d06181d729407e975b85a8715fdc3b489c67) ) + ROM_LOAD16_BYTE( "ap-26c.133", 0x020000, 0x10000, CRC(9393a470) SHA1(00376f7a545629a83eb5a90b9d1685a68430e4ce) ) + ROM_LOAD16_BYTE( "ap-23g.110", 0x060001, 0x10000, CRC(0ab485e4) SHA1(d8d0695312732c31cedcb1c298810a6793835e80) ) /* Kana Corporation license program ROMs */ + ROM_LOAD16_BYTE( "ap-24g.118", 0x060000, 0x10000, CRC(6348e196) SHA1(6be537491a56a28b62981cae6db8dfc4eb2fece2) ) /* Kana Corporation license program ROMs */ + + ROM_REGION16_BE( 0x80000, "slave_rom", 0 ) /* 68000 sub cpu */ + ROM_LOAD16_BYTE( "ap-19c.80", 0x000001, 0x10000, CRC(0908e468) SHA1(a2d725993bd4cd5425468736154fd3dd9dd7b060) ) + ROM_LOAD16_BYTE( "ap-21c.97", 0x000000, 0x10000, CRC(38a056fb) SHA1(67c8ae58670cebde0771854e1fb5fc2eb2543ecc) ) + ROM_LOAD16_BYTE( "ap-20a.89", 0x040001, 0x20000, CRC(92d24b5e) SHA1(1ea270d46a607e47b7e0961b532316aa05dc8f4e) ) + ROM_LOAD16_BYTE( "ap-22a.105", 0x040000, 0x20000, CRC(a8458a92) SHA1(43674731c2e9962c2bfbb73a85484cf03d6be223) ) + + ROM_REGION( 0x10000, "sound_rom", 0 ) /* 64k code for sound V20 */ + ROM_LOAD( "ap-27d.151", 0x00000, 0x10000, CRC(294b4d79) SHA1(2b03418a12a2aaf3919b98161d8d0ce6ae29a2bb) ) + + ROM_REGION( 0x100000, "sprites:sprites_l", 0) + ROM_LOAD32_BYTE( "ap-00c.15", 0x000000, 0x20000, CRC(ad1ddc2b) SHA1(81f64663c4892ab5fb0e2dc99513dbfee73f15b8) ) + ROM_LOAD32_BYTE( "ap-01c.22", 0x000001, 0x20000, CRC(6286ff00) SHA1(920da4a3a441dbf54ad86c0f4fb6f47a867e9cda) ) + ROM_LOAD32_BYTE( "ap-04c.58", 0x000002, 0x20000, CRC(dc6d55e4) SHA1(9f48f8d6aa1a329a71913139a8d5a50d95a9b9e5) ) + ROM_LOAD32_BYTE( "ap-05c.65", 0x000003, 0x20000, CRC(2e6e495f) SHA1(af610f265da53735b20ddc6df1bda47fc54ee0c3) ) + ROM_LOAD32_BYTE( "ap-02c.34", 0x080000, 0x20000, CRC(af4ee7cb) SHA1(4fe2361b7431971b07671f145abf1ea5861d01db) ) + ROM_LOAD32_BYTE( "ap-03c.46", 0x080001, 0x20000, CRC(60ab495c) SHA1(18340d4fba550495b1e52f8023a0a2ec6349dfeb) ) + ROM_LOAD32_BYTE( "ap-06c.71", 0x080002, 0x20000, CRC(0ea90e55) SHA1(b16d6b8be4853797507d3e5c933a9dd1d451308e) ) + ROM_LOAD32_BYTE( "ap-07c.75", 0x080003, 0x20000, CRC(ba685543) SHA1(140a2b708d4e4de4d207fc2c4a96a5cab8639988) ) + + ROM_REGION( 0x100000, "sprites:sprites_h", 0) + ROM_LOAD32_BYTE( "ap-08c.14", 0x000000, 0x20000, CRC(6437b580) SHA1(2b2ba42add18bbec04fbcf53645a8d44b972e26a) ) + ROM_LOAD32_BYTE( "ap-09c.21", 0x000001, 0x20000, CRC(54d18ef9) SHA1(40ebc6ea49b2a501fe843d60bec8c32d07f2d25d) ) + ROM_LOAD32_BYTE( "ap-12c.57", 0x000002, 0x20000, CRC(f95cf5cf) SHA1(ce373c648cbf3e4863bbc3a1175efe065c75eb13) ) + ROM_LOAD32_BYTE( "ap-13c.64", 0x000003, 0x20000, CRC(67a248c3) SHA1(cc945f7cfecaaab5075c1a3d202369b070d4c656) ) + ROM_LOAD32_BYTE( "ap-10c.33", 0x080000, 0x20000, CRC(74418df4) SHA1(cc1206b10afc2de919b2fb9899486122d27290a4) ) + ROM_LOAD32_BYTE( "ap-11c.45", 0x080001, 0x20000, CRC(195bf78e) SHA1(c3c472f3c4244545b89491b6ebec4f838a6bbb73) ) + ROM_LOAD32_BYTE( "ap-14c.70", 0x080002, 0x20000, CRC(58f7fe16) SHA1(a5b87b42b85808c226df0d2a7b7cdde12d474a41) ) + ROM_LOAD32_BYTE( "ap-15c.74", 0x080003, 0x20000, CRC(1ffd5496) SHA1(25efb568957fc9441a40a7d64cc6afe1a14b392b) ) + + ROM_REGION( 0x18000, "text", 0 ) + ROM_LOAD( "ap-18e.73", 0x000000, 0x10000, CRC(d7861a26) SHA1(b1a1e089a293a5536d342c9edafbea303f4f128c) ) + ROM_LOAD( "ap-16e.63", 0x008000, 0x10000, CRC(d3251965) SHA1(aef4f58a6f773060434abda9d7f5f003693577bf) ) + ROM_LOAD( "ap-17e.68", 0x008000, 0x08000, CRC(4509c2ed) SHA1(97a6a6710e83aca212ce43d06c3f26c35f9782b8) ) + + ROM_REGION( 0x40000, "oki", 0 ) /* ADPCM samples */ + ROM_LOAD( "ap-28c.171", 0x000000, 0x20000, CRC(b349f0c2) SHA1(cb1ff1c0e784f669c87ab1eccd3b358950761b74) ) + ROM_LOAD( "ap-29c.176", 0x020000, 0x10000, CRC(b38fced3) SHA1(72f61a719f393957bcccf14687bfbb2e7a5f7aee) ) + + ROM_REGION( 0x200, "proms", 0 ) /* Road stripe PROM */ + ROM_LOAD( "am27s29.ic41", 0x000, 0x200, CRC(c981f1e0) SHA1(7d8492d9f4033ab3734c09ee23016a0b210648b5) ) +ROM_END + + +void apache3_state::init_apache3() +{ + init_tatsumi(); + + m_apache3_rot_idx = 0; + + save_item(NAME(m_apache3_rot_idx)); + save_item(NAME(m_apache3_rotate_ctrl)); + + // TODO: ym2151_set_port_write_handler for CT1/CT2 outputs +} + +} // anonymous namespace + +GAME( 1988, apache3, 0, apache3, apache3, apache3_state, init_apache3, ROT0, "Tatsumi", "Apache 3 (rev F)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_NOT_WORKING ) // Rev F CPU code +GAME( 1988, apache3a, apache3, apache3, apache3, apache3_state, init_apache3, ROT0, "Tatsumi", "Apache 3 (rev E)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_NOT_WORKING ) // Rev C & E CPU code +GAME( 1988, apache3b, apache3, apache3, apache3, apache3_state, init_apache3, ROT0, "Tatsumi (Kana Corporation license)", "Apache 3 (Kana Corporation license, rev G)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_NOT_WORKING ) // Rev C & G CPU code diff --git a/src/mame/tatsumi/cyclwarr.cpp b/src/mame/tatsumi/cyclwarr.cpp new file mode 100644 index 0000000000000..fad8486349fc5 --- /dev/null +++ b/src/mame/tatsumi/cyclwarr.cpp @@ -0,0 +1,1280 @@ +// license:BSD-3-Clause +// copyright-holders:Bryan McPhail, Angelo Salese +/*************************************************************************** + + Cycle Warriors ABA-011 + Big Fight ABA-011 + + TODO: + + - Combine Big Fight & CycleWarriors video routines - currently each + game uses different sized tilemaps - these are probably software + controlled rather than hardwired, but I don't think either game + changes the size at runtime. + + reference of bigfight : https://youtu.be/aUUoUCr6yhk + + + Cycle Warriors Board Layout + + ABA-011 + + + 6296 CW24A 5864 + CW25A 5864 + YM2151 50MHz + + TZ8315 CW26A + 5864 + TC51821 TC51832 D780C-1 + TC51821 TC51832 + TC51821 TC51832 16MHz + TC51821 TC51832 + + CW00A CW08A + CW01A CW09A + CW02A CW10A + CW03A CW11A 68000-12 81C78 + CW04A CW12A 81C78 + CW05A CW13A CW16B CW18B 65256 + CW06A CW14A CW17A CW19A 65256 + CW07A CW15A CW20A + CW21 65256 + 68000-12 CW22A 65256 + CW23 + + ABA-012 + + HD6445 + + + 51832 + 51832 + 51832 + 51832 + + CW28 + CW29 + CW30 + + CW27 + + Big Fight + Tatsumi, 1992 + + PCB Layout + ---------- + + ABA-011 + A-8 + |-----------------------------------------------------------------| + | LM324 M6295 ROM15 TC5563 | + |LM324 VOL KA51 50MHz TC5563 PAL |-|| + | TC51832 TC51832 |--------| | || + | TC51832 TC51832 |TATSUMI | | || + | TC51832 TC51832 |TZB315 | ROM20 | || + | TC51832 TC51832 | | TMM2063 | || + | ROM0 ROM8 |--------| Z80B | || + | | || + |J PAL 16MHz |-|| + |A ROM2 ROM10 |--------------| PAL | + |M | 68000 | TMM2088 | + |M |--------------| | + |A ROM4 ROM12 TMM2088 | + | ROM16 ROM17 |-|| + | PAL PAL TC51832 | || + | ROM6 ROM14 ROM18 | || + | EPL204 PAL TC51832 | || + | |--------------| | || + | CXD1095Q CXD1095Q | 68000 | ROM19 TC51832 | || + | |--------------| | || + | TC51832 |-|| + | DSW3(4) DSW2(8) DSW1(8) | + |-----------------------------------------------------------------| + Z80 clock - 4.000MHz [16/4] + 68k clocks - 12.500MHz [50/4] + M6295 clock - 2.000MHz [16/8]. Sample rate = 2000000/132 + YM2151 clock - 4.000MHz [16/4] + + |-------------------------| + | D65005(x16) | + |ROM21 |-|| + | | || + | | || + | | || + | | || + | | || + | | || + |PAL |-|| + | ROM24 PAL PAL| + | ROM23 HD6445 | + | ROM22 | + | TC51832(x4) | + | PAL |-|| + | PAL | || + | | || + | | || + | | || + | | || + | | || + | |-|| + |PAL | + |-------------------------| + + +***************************************************************************/ + +#include "emu.h" +#include "tatsumi.h" + +#include "cpu/z80/z80.h" + +#include "screen.h" +#include "speaker.h" + +namespace { + +class cyclwarr_state : public tatsumi_state +{ +public: + cyclwarr_state(const machine_config &mconfig, device_type type, const char *tag) + : tatsumi_state(mconfig, type, tag) + , m_soundlatch(*this, "soundlatch") + , m_master_ram(*this, "master_ram") + , m_slave_ram(*this, "slave_ram") + , m_cyclwarr_videoram(*this, "cw_videoram%u", 0U) + , m_cyclwarr_tileclut(*this, "cw_tileclut") + { + } + + void cyclwarr(machine_config &config); + +protected: + virtual void machine_reset() override ATTR_COLD; + virtual void video_start() override ATTR_COLD; + + void tile_expand(); + + template TILE_GET_INFO_MEMBER(get_tile_info_bigfight); + + tilemap_t *m_layer[4]{}; + uint16_t m_layer_page_size[4]{}; + bool m_layer1_can_be_road = false; + +private: + + uint16_t cyclwarr_sprite_r(offs_t offset); + void cyclwarr_sprite_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); + void video_config_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); + void bigfight_a40000_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); + void mixing_control_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); + void cyclwarr_control_w(uint8_t data); + void cyclwarr_sound_w(uint8_t data); + void output_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); + uint8_t oki_status_xor_r(); + + template uint16_t cyclwarr_videoram_r(offs_t offset); + template void cyclwarr_videoram_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); + + template TILE_GET_INFO_MEMBER(get_tile_info_cyclwarr_road); + + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + + void common_map(address_map &map) ATTR_COLD; + void master_map(address_map &map) ATTR_COLD; + void slave_map(address_map &map) ATTR_COLD; + void sound_map(address_map &map) ATTR_COLD; + + required_device m_soundlatch; + + required_shared_ptr m_master_ram; + required_shared_ptr m_slave_ram; + required_shared_ptr_array m_cyclwarr_videoram; + required_region_ptr m_cyclwarr_tileclut; + + std::vector m_mask; + + uint16_t m_video_config[4]{}; + uint16_t m_mixing_control = 0; + uint16_t m_bigfight_a40000[2]{}; + uint16_t m_bigfight_bank = 0; + uint16_t m_bigfight_last_bank = 0; + uint16_t m_road_color_bank = 0, m_prev_road_bank = 0; + std::unique_ptr m_decoded_gfx; + + void draw_bg(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect, tilemap_t *src, const uint16_t* scrollx, const uint16_t* scrolly, const uint16_t layer_page_size, bool is_road, int hi_priority); + void draw_bg_layers(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect, int hi_priority); + void apply_highlight_bitmap(bitmap_rgb32 &bitmap, const rectangle &cliprect, bitmap_ind8 &highlight_bitmap); +}; + +class bigfight_state : public cyclwarr_state +{ +public: + bigfight_state(const machine_config &mconfig, device_type type, const char *tag) + : cyclwarr_state(mconfig, type, tag) + { + } + + void bigfight(machine_config &config); + +protected: + virtual void video_start() override ATTR_COLD; +}; +/* + * these video registers never changes + * + * Big Fight + * 72f2 5af2 3af2 22fa + * + * Cycle Warriors + * 5673 92c2 3673 267b + * + * Following is complete guesswork (since nothing changes it's very hard to pinpoint what these bits do :/) + * Layer order is 3-1-2-0 ? + * x--- -x-- ---- ---- one of these might be enable page select + * ---- ---- x--- ---- tilemap size + * ---x ---- ---- x--- one these might be color bank + * + */ +void cyclwarr_state::video_config_w(offs_t offset, uint16_t data, uint16_t mem_mask) +{ + COMBINE_DATA(&m_video_config[offset]); +} + +// mixing control (seems to be available only for Big Fight and Cycle Warriors) +// --x- ---- enabled in Big Fight, disabled in Cycle Warriors (unknown purpose) +// ---- -x-- enable shadow mixing +// ---- ---x if 1 invert shadows, i.e. shadows are drawn with original pen while non shadows are halved (Chen stage in Big Fight) +void cyclwarr_state::mixing_control_w(offs_t offset, uint16_t data, uint16_t mem_mask) +{ + COMBINE_DATA(&m_mixing_control); +} + +template +TILE_GET_INFO_MEMBER(cyclwarr_state::get_tile_info_bigfight) +{ + int tile = m_cyclwarr_videoram[Bank >> 1][tile_index&0x7fff]; + int bank = (m_bigfight_a40000[0] >> (((tile&0xc00)>>10)*4))&0xf; + uint16_t tileno = (tile&0x3ff)|(bank<<10); + // color is bits 12-13 + uint8_t color = (tile >> 12) & 0x3; + + // all layers but 0 wants this palette bank (fade in/out effects) + // a similar result is obtainable with priority bit, but then it's wrong for + // Big Fight CRT test (dark red background) and character name bio in attract mode (reference shows it doesn't fade in like rest of text) + // TODO: likely an HW config sets this up + if(Bank != 0) + color |= 4; + // bit 14: ignore transparency on this tile + int opaque = ((tile >> 14) & 1) == 1; + + tileinfo.set(0, tileno, color, opaque ? TILE_FORCE_LAYER0 : 0); + + // bit 15: tile appears in front of sprites + tileinfo.category = (tile >> 15) & 1; + tileinfo.mask_data = &m_mask[tileno<<3]; +} + +// same as above but additionally apply per-scanline color banking +// TODO: split for simplicity, need to merge with above +template +TILE_GET_INFO_MEMBER(cyclwarr_state::get_tile_info_cyclwarr_road) +{ + int tile = m_cyclwarr_videoram[Bank >> 1][tile_index&0x7fff]; + int bank = (m_bigfight_a40000[0] >> (((tile&0xc00)>>10)*4))&0xf; + uint16_t tileno = (tile&0x3ff)|(bank<<10); + uint8_t color = (tile >> 12) & 0x3; +// if(Bank != 0) + color |= 4; + int opaque = ((tile >> 14) & 1) == 1; + + tileinfo.set(0, tileno, color | m_road_color_bank, opaque ? TILE_FORCE_LAYER0 : 0); + + tileinfo.category = (tile >> 15) & 1; + tileinfo.mask_data = &m_mask[((tile&0x3ff)|(bank<<10))<<3]; +} + +void cyclwarr_state::tile_expand() +{ + /* + Each tile (0x4000 of them) has a lookup table in ROM to build an individual 3-bit palette + from sets of 8 bit palettes! + */ + gfx_element *gx0 = m_gfxdecode->gfx(0); + m_mask.resize(gx0->elements() << 3,0); + uint8_t *dest; + + // allocate memory for the assembled data + m_decoded_gfx = std::make_unique(gx0->elements() * gx0->width() * gx0->height()); + + // loop over elements + dest = m_decoded_gfx.get(); + for (int c = 0; c < gx0->elements(); c++) + { + const uint8_t *c0base = gx0->get_data(c); + + // loop over height + for (int y = 0; y < gx0->height(); y++) + { + const uint8_t *c0 = c0base; + + for (int x = 0; x < gx0->width(); x++) + { + uint8_t pix = (*c0++ & 7); + uint8_t respix = m_cyclwarr_tileclut[(c << 3)|pix]; + *dest++ = respix; + // Transparent pixels are set by both the tile pixel data==0 AND colour palette & 7 == 0 + m_mask[(c << 3) | (y & 7)] |= ((pix&0x7)!=0 || ((pix&0x7)==0 && (respix&0x7)!=0)) ? (0x80 >> (x & 7)) : 0; + } + c0base += gx0->rowbytes(); + } + } + + gx0->set_raw_layout(m_decoded_gfx.get(), gx0->width(), gx0->height(), gx0->elements(), 8 * gx0->width(), 8 * gx0->width() * gx0->height()); + gx0->set_granularity(256); +} + +void cyclwarr_state::video_start() +{ + tile_expand(); + m_layer[0] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(cyclwarr_state::get_tile_info_bigfight<0>)), TILEMAP_SCAN_ROWS, 8,8, 64,512); + m_layer[1] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(cyclwarr_state::get_tile_info_cyclwarr_road<1>)), TILEMAP_SCAN_ROWS, 8,8, 128,256); + m_layer[2] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(cyclwarr_state::get_tile_info_bigfight<2>)), TILEMAP_SCAN_ROWS, 8,8, 64,512); + m_layer[3] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(cyclwarr_state::get_tile_info_bigfight<3>)), TILEMAP_SCAN_ROWS, 8,8, 64,512); + + // set up scroll bases + // TODO: more HW configs + m_layer[3]->set_scrolldx(-8,-8); + m_layer_page_size[3] = 0x200; + m_layer[2]->set_scrolldx(-8,-8); + m_layer_page_size[2] = 0x200; + m_layer[1]->set_scrolldx(-8,-8); + m_layer_page_size[1] = 0x200; + m_layer[0]->set_scrolldx(-0x10,-0x10); + m_layer_page_size[0] = 0x100; + + m_layer1_can_be_road = true; +} + +// TODO: it's same video HW, we don't know how/where video registers are mapped +void bigfight_state::video_start() +{ + tile_expand(); + m_layer[0] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(bigfight_state::get_tile_info_bigfight<0>)), TILEMAP_SCAN_ROWS, 8,8, 128,256); + m_layer[1] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(bigfight_state::get_tile_info_bigfight<1>)), TILEMAP_SCAN_ROWS, 8,8, 128,256); + m_layer[2] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(bigfight_state::get_tile_info_bigfight<2>)), TILEMAP_SCAN_ROWS, 8,8, 128,256); + m_layer[3] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(bigfight_state::get_tile_info_bigfight<3>)), TILEMAP_SCAN_ROWS, 8,8, 128,256); + + // set up scroll bases + // TODO: more HW configs + m_layer[3]->set_scrolldx(-8,-8); + m_layer[2]->set_scrolldx(-8,-8); + m_layer[1]->set_scrolldx(-8,-8); + m_layer[0]->set_scrolldx(-0x10,-0x10); + for(int i=0;i<4;i++) + m_layer_page_size[i] = 0x200; + + m_layer1_can_be_road = false; +} + + +void cyclwarr_state::draw_bg(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect, tilemap_t *src, const uint16_t* scrollx, const uint16_t* scrolly, const uint16_t layer_page_size, bool is_road, int hi_priority) +{ + rectangle clip; + clip.min_x = cliprect.min_x; + clip.max_x = cliprect.max_x; + // TODO: both always enabled when this occurs + bool rowscroll_enable = (scrollx[0] & 0x1000) == 0; + bool colscroll_enable = (scrollx[0] & 0x2000) == 0; + // this controls wraparound (tilemap can't go above a threshold) + // TODO: Actually scrolly registers 0xf0 to 0xff are used (can split the tilemap furthermore?) + uint16_t page_select = scrolly[0xff]; + + for (int y=cliprect.min_y; y<=cliprect.max_y; y++) + { + clip.min_y = clip.max_y = y; + int y_base = rowscroll_enable ? y : 0; + int x_base = colscroll_enable ? y : 0; + int src_y = (scrolly[y_base] & 0x7ff); + int src_x = (scrollx[x_base] & 0x7ff); + // apparently if this is on disables wraparound target + int page_disable = scrolly[y_base] & 0x800; + int cur_page = src_y + y; + + // special handling for cycle warriors road: it reads in scrolly table bits 15-13 an + // additional tile color bank and per scanline. + if(is_road == true) + { + if(scrolly[y_base] & 0x8000) + { + m_road_color_bank = (scrolly[y_base] >> 13) & 3; + // road mode disables page wraparound + page_disable = 1; + } + else + m_road_color_bank = 0; + + if(m_road_color_bank != m_prev_road_bank) + { + m_prev_road_bank = m_road_color_bank; + src->mark_all_dirty(); + } + } + + // apply wraparound, if enabled tilemaps can't go above a certain threshold + // cfr. Cycle Warriors scrolling text (ranking, ending), backgrounds when uphill, + // Big Fight vertical scrolling in the morning Funnel stage (not the one chosen at start), + // also Big Fight text garbage in the stage after Mevella joins you (forgot the name) + if((cur_page - page_select) >= layer_page_size && page_disable == 0) + src_y -= layer_page_size; + + src->set_scrollx(0,src_x); + src->set_scrolly(0,src_y); + src->draw(screen, bitmap, clip, TILEMAP_DRAW_CATEGORY(hi_priority), 0); + } +} + +void cyclwarr_state::draw_bg_layers(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect, int hi_priority) +{ + draw_bg(screen, bitmap, cliprect, m_layer[3], &m_cyclwarr_videoram[1][0x000], &m_cyclwarr_videoram[1][0x100], m_layer_page_size[3], false, hi_priority); + draw_bg(screen, bitmap, cliprect, m_layer[2], &m_cyclwarr_videoram[1][0x200], &m_cyclwarr_videoram[1][0x300], m_layer_page_size[2],false, hi_priority); + draw_bg(screen, bitmap, cliprect, m_layer[1], &m_cyclwarr_videoram[0][0x000], &m_cyclwarr_videoram[0][0x100], m_layer_page_size[1],m_layer1_can_be_road, hi_priority); + draw_bg(screen, bitmap, cliprect, m_layer[0], &m_cyclwarr_videoram[0][0x200], &m_cyclwarr_videoram[0][0x300], m_layer_page_size[0], false, hi_priority); +} + +uint32_t cyclwarr_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +{ + m_bigfight_bank=m_bigfight_a40000[0]; + if (m_bigfight_bank!=m_bigfight_last_bank) + { + for (int i = 0; i < 4; i++) + { + m_layer[i]->mark_all_dirty(); + } + m_bigfight_last_bank=m_bigfight_bank; + } + m_sprites->update_cluts(); + + bitmap.fill(m_palette->pen(0), cliprect); + +#if 0 + popmessage("%04x %04x (%04x)|%04x %04x (%04x)|%04x %04x (%04x)|%04x %04x (%04x)" + ,m_cyclwarr_videoram[1][0x000],m_cyclwarr_videoram[1][0x100],m_cyclwarr_videoram[1][0x1ff] + ,m_cyclwarr_videoram[1][0x200],m_cyclwarr_videoram[1][0x300],m_cyclwarr_videoram[1][0x3ff] + ,m_cyclwarr_videoram[0][0x000],m_cyclwarr_videoram[0][0x100],m_cyclwarr_videoram[0][0x1ff] + ,m_cyclwarr_videoram[0][0x200],m_cyclwarr_videoram[0][0x300],m_cyclwarr_videoram[0][0x3ff]); +#endif + +// popmessage("%04x %04x %04x %04x",m_video_config[0],m_video_config[1],m_video_config[2],m_video_config[3]); + + screen.priority().fill(0, cliprect); + m_sprites->draw_sprites(screen.priority(),cliprect,1,(m_sprite_control_ram[0xe0]&0x1000) ? 0x1000 : 0); // Alpha pass only + draw_bg_layers(screen, bitmap, cliprect, 0); + apply_shadow_bitmap(bitmap,cliprect,screen.priority(), m_mixing_control & 1); + m_sprites->draw_sprites(bitmap,cliprect,0,(m_sprite_control_ram[0xe0]&0x1000) ? 0x1000 : 0); + draw_bg_layers(screen, bitmap, cliprect, 1); + return 0; +} + +void cyclwarr_state::cyclwarr_control_w(uint8_t data) +{ + m_control_word = data; + +// if ((m_control_word&0xfe) != (m_last_control&0xfe)) +// logerror("%s control_w %04x\n", m_maincpu->pc(), data); + +/* + +0x1 - watchdog +0x4 - cpu bus lock + + + +*/ + + if ((m_control_word & 4) == 4 && (m_last_control & 4) == 0) + { +// logerror("68k 2 halt\n"); + m_subcpu->set_input_line(INPUT_LINE_HALT, ASSERT_LINE); + } + + if ((m_control_word & 4) == 0 && (m_last_control & 4) == 4) + { +// logerror("68k 2 irq go\n"); + m_subcpu->set_input_line(INPUT_LINE_HALT, CLEAR_LINE); + } + + m_last_control = m_control_word; +} + + +uint8_t cyclwarr_state::oki_status_xor_r() +{ + int r = m_oki->read(); + + // Cycle Warriors and Big Fight access this with reversed activeness. + // this is particularly noticeable with the "We got em" sample played in CW at stage clear: + // gets cut too early with the old hack below. + // fwiw returning normal oki status doesn't work at all, both games don't make any sound. + // TODO: verify with HW + return (r ^ 0xff); +#if 0 + // old hack left for reference + + if (m_audiocpu->pc()==0x2b70 || m_audiocpu->pc()==0x2bb5 + || m_audiocpu->pc()==0x2acc + || m_audiocpu->pc()==0x1c79 // BigFight + || m_audiocpu->pc()==0x1cbe // BigFight + || m_audiocpu->pc()==0xf9881) + return 0xf; + if (m_audiocpu->pc()==0x2ba3 || m_audiocpu->pc()==0x2a9b || m_audiocpu->pc()==0x2adc + || m_audiocpu->pc()==0x1cac) // BigFight + return 0; + return r; +#endif +} + + +void cyclwarr_state::cyclwarr_sound_w(uint8_t data) +{ + m_soundlatch->write(data); + m_audiocpu->pulse_input_line(INPUT_LINE_NMI, attotime::zero); +} + + +uint16_t cyclwarr_state::cyclwarr_sprite_r(offs_t offset) +{ + return m_spriteram[offset]; +} + +void cyclwarr_state::cyclwarr_sprite_w(offs_t offset, uint16_t data, uint16_t mem_mask) +{ + COMBINE_DATA(&m_spriteram[offset]); +} + +void cyclwarr_state::bigfight_a40000_w(offs_t offset, uint16_t data, uint16_t mem_mask) +{ + COMBINE_DATA(&m_bigfight_a40000[offset]); +} + +template +uint16_t cyclwarr_state::cyclwarr_videoram_r(offs_t offset) +{ + return m_cyclwarr_videoram[Bank][offset]; +} + +template +void cyclwarr_state::cyclwarr_videoram_w(offs_t offset, uint16_t data, uint16_t mem_mask) +{ + COMBINE_DATA(&m_cyclwarr_videoram[Bank][offset]); + m_layer[(Bank<<1)|0]->mark_tile_dirty(offset); + m_layer[(Bank<<1)|1]->mark_tile_dirty(offset); +} + +void cyclwarr_state::output_w(offs_t offset, uint16_t data, uint16_t mem_mask) +{ + machine().bookkeeping().coin_counter_w(0, data & 1); + machine().bookkeeping().coin_counter_w(1, data & 2); + if(data & 0xfffc) + logerror("output_w = %04x & %04x\n",data,mem_mask); +} + + +void cyclwarr_state::common_map(address_map &map) +{ + map(0x080000, 0x08ffff).rw(FUNC(cyclwarr_state::cyclwarr_videoram_r<1>), FUNC(cyclwarr_state::cyclwarr_videoram_w<1>)).share("cw_videoram1"); + map(0x090000, 0x09ffff).rw(FUNC(cyclwarr_state::cyclwarr_videoram_r<0>), FUNC(cyclwarr_state::cyclwarr_videoram_w<0>)).share("cw_videoram0"); + + map(0x0a2000, 0x0a2007).w(FUNC(cyclwarr_state::video_config_w)); + map(0x0a4000, 0x0a4001).w(FUNC(cyclwarr_state::bigfight_a40000_w)); + map(0x0a6000, 0x0a6001).w(FUNC(cyclwarr_state::mixing_control_w)); + map(0x0ac000, 0x0ac003).w(FUNC(cyclwarr_state::hd6445_crt_w)).umask16(0x00ff); + + map(0x0b8000, 0x0b8001).w(FUNC(cyclwarr_state::cyclwarr_sound_w)).umask16(0xff00); + map(0x0b9000, 0x0b900f).rw("io1", FUNC(cxd1095_device::read), FUNC(cxd1095_device::write)).umask16(0x00ff).cswidth(16); + map(0x0ba000, 0x0ba00f).rw("io2", FUNC(cxd1095_device::read), FUNC(cxd1095_device::write)).umask16(0x00ff).cswidth(16); + map(0x0bc000, 0x0bc001).w(FUNC(cyclwarr_state::output_w)); + + map(0x0c0000, 0x0c3fff).rw(FUNC(cyclwarr_state::cyclwarr_sprite_r), FUNC(cyclwarr_state::cyclwarr_sprite_w)).share("spriteram"); + map(0x0ca000, 0x0ca1ff).rw(FUNC(cyclwarr_state::tatsumi_sprite_control_r), FUNC(cyclwarr_state::tatsumi_sprite_control_w)).share("obj_ctrl_ram"); + map(0x0d0000, 0x0d3fff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); + + // games accesses these ranges differently, we do mirroring in rom loading to make them match. + // address bit A19 controls if access routes to upper or lower roms + // TODO: it's unknown what Big Fight is supposed to return for the lower roms, let's assume mirror for the time being. + // slave ROMs + // 0x140000 - 0x1bffff tested in Cycle Warriors + // 0x100000 - 0x17ffff tested in Big Fight + map(0x100000, 0x1fffff).rom().region("slave_rom",0); + // same as above but A20 instead of A19 + // master ROMs + // 0x2c0000 - 0x33ffff tested in Cycle Warriors + // 0x200000 - 0x27ffff tested in Big Fight + map(0x200000, 0x3fffff).rom().region("master_rom",0); +} + +void cyclwarr_state::master_map(address_map &map) +{ + map(0x000000, 0x00ffff).ram().share("master_ram"); + map(0x03e000, 0x03efff).ram(); // RAM_A + map(0x040000, 0x04ffff).ram().share("slave_ram"); + common_map(map); +} + +void cyclwarr_state::slave_map(address_map &map) +{ + map(0x000000, 0x00ffff).ram().share("slave_ram"); + common_map(map); +} + +void cyclwarr_state::sound_map(address_map &map) +{ + map(0x0000, 0xdfff).rom(); + map(0xe000, 0xffef).ram(); + map(0xfff0, 0xfff1).rw(m_ym2151, FUNC(ym2151_device::read), FUNC(ym2151_device::write)); + map(0xfff4, 0xfff4).r(FUNC(cyclwarr_state::oki_status_xor_r)).w(m_oki, FUNC(okim6295_device::write)); + map(0xfffc, 0xfffc).r(m_soundlatch, FUNC(generic_latch_8_device::read)); + map(0xfffe, 0xfffe).nopw(); +} + + +static INPUT_PORTS_START( cyclwarr ) + PORT_START("SERVICE") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN3 ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN4 ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE1 ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE2 ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE3 ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SERVICE4 ) + + PORT_START("P1") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1) + + PORT_START("P2") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START2 ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2) + + PORT_START("DSW3") + PORT_DIPNAME( 0x1, 0x1, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW3:1") + PORT_DIPSETTING( 0x1, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0, DEF_STR( On ) ) + PORT_DIPNAME( 0x2, 0x0, "Player Select" ) PORT_DIPLOCATION("SW3:2") + PORT_DIPSETTING( 0x2, "Coin Slot" ) + PORT_DIPSETTING( 0x0, "Select SW" ) + PORT_DIPNAME( 0x4, 0x4, DEF_STR( Service_Mode ) ) PORT_DIPLOCATION("SW3:3") + PORT_DIPSETTING( 0x4, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0, DEF_STR( On ) ) + PORT_DIPNAME( 0x8, 0x8, "Hardware Test Mode" ) PORT_DIPLOCATION("SW3:4") + PORT_DIPSETTING( 0x8, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0, DEF_STR( On ) ) + + PORT_START("DSW1") + PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:1,2,3,4") + PORT_DIPSETTING( 0x00, DEF_STR( 5C_1C ) ) + PORT_DIPSETTING( 0x02, DEF_STR( 4C_1C ) ) + PORT_DIPSETTING( 0x05, DEF_STR( 3C_1C ) ) + PORT_DIPSETTING( 0x08, DEF_STR( 2C_1C ) ) + PORT_DIPSETTING( 0x04, DEF_STR( 3C_2C ) ) + PORT_DIPSETTING( 0x01, DEF_STR( 4C_3C ) ) + PORT_DIPSETTING( 0x0f, DEF_STR( 1C_1C ) ) + PORT_DIPSETTING( 0x03, DEF_STR( 3C_4C ) ) + PORT_DIPSETTING( 0x07, DEF_STR( 2C_3C ) ) + PORT_DIPSETTING( 0x0e, DEF_STR( 1C_2C ) ) + PORT_DIPSETTING( 0x06, DEF_STR( 2C_5C ) ) + PORT_DIPSETTING( 0x0d, DEF_STR( 1C_3C ) ) + PORT_DIPSETTING( 0x0c, DEF_STR( 1C_4C ) ) + PORT_DIPSETTING( 0x0b, DEF_STR( 1C_5C ) ) + PORT_DIPSETTING( 0x0a, DEF_STR( 1C_6C ) ) + PORT_DIPSETTING( 0x09, DEF_STR( 1C_7C ) ) + PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW1:5,6,7,8") + PORT_DIPSETTING( 0x00, DEF_STR( 6C_1C ) ) + PORT_DIPSETTING( 0x10, DEF_STR( 5C_1C ) ) + PORT_DIPSETTING( 0x20, DEF_STR( 4C_1C ) ) + PORT_DIPSETTING( 0x50, DEF_STR( 3C_1C ) ) + PORT_DIPSETTING( 0x80, DEF_STR( 2C_1C ) ) + PORT_DIPSETTING( 0x40, DEF_STR( 3C_2C ) ) + PORT_DIPSETTING( 0xf0, DEF_STR( 1C_1C ) ) + PORT_DIPSETTING( 0x30, DEF_STR( 3C_4C ) ) + PORT_DIPSETTING( 0x70, DEF_STR( 2C_3C ) ) + PORT_DIPSETTING( 0xe0, DEF_STR( 1C_2C ) ) + PORT_DIPSETTING( 0x60, DEF_STR( 2C_5C ) ) + PORT_DIPSETTING( 0xd0, DEF_STR( 1C_3C ) ) + PORT_DIPSETTING( 0xc0, DEF_STR( 1C_4C ) ) + PORT_DIPSETTING( 0xb0, DEF_STR( 1C_5C ) ) + PORT_DIPSETTING( 0xa0, DEF_STR( 1C_6C ) ) + PORT_DIPSETTING( 0x90, DEF_STR( 1C_7C ) ) + + PORT_START("DSW2") + PORT_DIPNAME( 0x03, 0x02, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:1,2") + PORT_DIPSETTING( 0x00, "5" ) + PORT_DIPSETTING( 0x01, "3" ) + PORT_DIPSETTING( 0x02, "2" ) + PORT_DIPSETTING( 0x03, "1" ) + PORT_DIPNAME( 0x04, 0x04, "Ticket Dispenser" ) PORT_DIPLOCATION("SW2:3") + PORT_DIPSETTING( 0x04, "10000" ) + PORT_DIPSETTING( 0x00, "15000" ) + PORT_DIPNAME( 0x18, 0x08, "Machine Type" ) PORT_DIPLOCATION("SW2:4,5") +// PORT_DIPSETTING( 0x00, "2 Players" ) // same as 4 players but text layout is 2p (invalid setting) + PORT_DIPSETTING( 0x08, "2 Players" ) + PORT_DIPSETTING( 0x10, "3 Players" ) + PORT_DIPSETTING( 0x18, "4 Players" ) + PORT_DIPNAME( 0x60, 0x60, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:6,7") + PORT_DIPSETTING( 0x00, DEF_STR( Very_Hard ) ) + PORT_DIPSETTING( 0x20, DEF_STR( Hard ) ) + PORT_DIPSETTING( 0x40, DEF_STR( Easy ) ) + PORT_DIPSETTING( 0x60, DEF_STR( Normal ) ) + PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:8") + PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + + PORT_START("P3") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START3 ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(3) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(3) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(3) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(3) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(3) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(3) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(3) + + PORT_START("P4") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START4 ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(4) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(4) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(4) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(4) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(4) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(4) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(4) +INPUT_PORTS_END + +static INPUT_PORTS_START( cyclwarb ) + PORT_INCLUDE(cyclwarr) + + PORT_MODIFY("DSW3") + PORT_DIPNAME( 0x8, 0x8, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW3:4") + PORT_DIPSETTING( 0x8, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0, DEF_STR( On ) ) +INPUT_PORTS_END + +static INPUT_PORTS_START( bigfight ) + PORT_START("SERVICE") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN3 ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN4 ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE1 ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE2 ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE3 ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SERVICE4 ) + + PORT_START("P1") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1) + + PORT_START("P2") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START2 ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2) + + PORT_START("DSW3") + PORT_DIPNAME( 0x1, 0x1, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW3:1") + PORT_DIPSETTING( 0x1, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0, DEF_STR( On ) ) + PORT_DIPNAME( 0x2, 0x0, "Player Select" ) PORT_DIPLOCATION("SW3:2") + PORT_DIPSETTING( 0x2, "Coin Slot" ) + PORT_DIPSETTING( 0x0, "Select SW" ) + PORT_DIPNAME( 0x4, 0x4, DEF_STR( Service_Mode ) ) PORT_DIPLOCATION("SW3:3") + PORT_DIPSETTING( 0x4, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0, DEF_STR( On ) ) + PORT_DIPNAME( 0x8, 0x8, "Hardware Test Mode" ) PORT_DIPLOCATION("SW3:4") + PORT_DIPSETTING( 0x8, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0, DEF_STR( On ) ) + + PORT_START("DSW1") + PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:1,2,3,4") + PORT_DIPSETTING( 0x00, DEF_STR( 5C_1C ) ) + PORT_DIPSETTING( 0x02, DEF_STR( 4C_1C ) ) + PORT_DIPSETTING( 0x05, DEF_STR( 3C_1C ) ) + PORT_DIPSETTING( 0x08, DEF_STR( 2C_1C ) ) + PORT_DIPSETTING( 0x04, DEF_STR( 3C_2C ) ) + PORT_DIPSETTING( 0x01, DEF_STR( 4C_3C ) ) + PORT_DIPSETTING( 0x0f, DEF_STR( 1C_1C ) ) + PORT_DIPSETTING( 0x03, DEF_STR( 3C_4C ) ) + PORT_DIPSETTING( 0x07, DEF_STR( 2C_3C ) ) + PORT_DIPSETTING( 0x0e, DEF_STR( 1C_2C ) ) + PORT_DIPSETTING( 0x06, DEF_STR( 2C_5C ) ) + PORT_DIPSETTING( 0x0d, DEF_STR( 1C_3C ) ) + PORT_DIPSETTING( 0x0c, DEF_STR( 1C_4C ) ) + PORT_DIPSETTING( 0x0b, DEF_STR( 1C_5C ) ) + PORT_DIPSETTING( 0x0a, DEF_STR( 1C_6C ) ) + PORT_DIPSETTING( 0x09, DEF_STR( 1C_7C ) ) + PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW1:5,6,7,8") + PORT_DIPSETTING( 0x00, DEF_STR( 6C_1C ) ) + PORT_DIPSETTING( 0x10, DEF_STR( 5C_1C ) ) + PORT_DIPSETTING( 0x20, DEF_STR( 4C_1C ) ) + PORT_DIPSETTING( 0x50, DEF_STR( 3C_1C ) ) + PORT_DIPSETTING( 0x80, DEF_STR( 2C_1C ) ) + PORT_DIPSETTING( 0x40, DEF_STR( 3C_2C ) ) + PORT_DIPSETTING( 0xf0, DEF_STR( 1C_1C ) ) + PORT_DIPSETTING( 0x30, DEF_STR( 3C_4C ) ) + PORT_DIPSETTING( 0x70, DEF_STR( 2C_3C ) ) + PORT_DIPSETTING( 0xe0, DEF_STR( 1C_2C ) ) + PORT_DIPSETTING( 0x60, DEF_STR( 2C_5C ) ) + PORT_DIPSETTING( 0xd0, DEF_STR( 1C_3C ) ) + PORT_DIPSETTING( 0xc0, DEF_STR( 1C_4C ) ) + PORT_DIPSETTING( 0xb0, DEF_STR( 1C_5C ) ) + PORT_DIPSETTING( 0xa0, DEF_STR( 1C_6C ) ) + PORT_DIPSETTING( 0x90, DEF_STR( 1C_7C ) ) + + PORT_START("DSW2") + PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:1,2") + PORT_DIPSETTING( 0x00, "1" ) + PORT_DIPSETTING( 0x03, "2" ) + PORT_DIPSETTING( 0x02, "3" ) + PORT_DIPSETTING( 0x01, "4" ) + PORT_DIPNAME( 0x04, 0x04, "Ticket Dispenser" ) PORT_DIPLOCATION("SW2:3") + PORT_DIPSETTING( 0x04, "100000" ) + PORT_DIPSETTING( 0x00, "150000" ) + PORT_DIPNAME( 0x08, 0x08, "Continue Coin" ) PORT_DIPLOCATION("SW2:4") + PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x10, 0x10, "Extend" ) PORT_DIPLOCATION("SW2:5") + PORT_DIPSETTING( 0x10, "100000" ) + PORT_DIPSETTING( 0x00, DEF_STR( None ) ) + PORT_DIPNAME( 0x60, 0x60, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:6,7") + PORT_DIPSETTING( 0x00, DEF_STR( Very_Hard ) ) + PORT_DIPSETTING( 0x20, DEF_STR( Hard ) ) + PORT_DIPSETTING( 0x40, DEF_STR( Easy ) ) + PORT_DIPSETTING( 0x60, DEF_STR( Normal ) ) + PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:8") + PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + + PORT_START("P3") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START3 ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(3) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(3) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(3) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(3) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(3) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(3) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(3) + + PORT_START("P4") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START4 ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(4) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(4) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(4) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(4) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(4) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(4) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(4) +INPUT_PORTS_END + +static GFXDECODE_START( gfx_cyclwarr ) + GFXDECODE_ENTRY( "tilerom", 0, gfx_8x8x3_planar, 0, 16) +GFXDECODE_END + + +void cyclwarr_state::machine_reset() +{ + uint16_t *src; + + // transfer data from rom to initial vector table + src = (uint16_t *)memregion("master_rom")->base(); + + for(int i=0;i<0x100/2;i++) + m_master_ram[i] = src[i]; + + src = (uint16_t *)memregion("slave_rom")->base(); + + for(int i=0;i<0x100/2;i++) + m_slave_ram[i] = src[i]; + + // reset CPUs again so that above will be notified. + // TODO: better way? + m_maincpu->pulse_input_line(INPUT_LINE_RESET, attotime::zero); + m_subcpu->pulse_input_line(INPUT_LINE_RESET, attotime::zero); + + m_last_control = 0; + m_control_word = 0; + + m_road_color_bank = m_prev_road_bank = 0; +} + +void cyclwarr_state::cyclwarr(machine_config &config) +{ + /* basic machine hardware */ + M68000(config, m_maincpu, cyclwarr_state::CLOCK_2 / 4); + m_maincpu->set_addrmap(AS_PROGRAM, &cyclwarr_state::master_map); + m_maincpu->set_vblank_int("screen", FUNC(cyclwarr_state::irq5_line_hold)); + + M68000(config, m_subcpu, cyclwarr_state::CLOCK_2 / 4); + m_subcpu->set_addrmap(AS_PROGRAM, &cyclwarr_state::slave_map); + m_subcpu->set_vblank_int("screen", FUNC(cyclwarr_state::irq5_line_hold)); + + Z80(config, m_audiocpu, cyclwarr_state::CLOCK_1 / 4); + m_audiocpu->set_addrmap(AS_PROGRAM, &cyclwarr_state::sound_map); + + // saner sync value (avoids crashing after crediting) + config.set_maximum_quantum(attotime::from_hz(cyclwarr_state::CLOCK_2 / 1024)); + + cxd1095_device &io1(CXD1095(config, "io1")); + io1.in_portb_cb().set_ioport("SERVICE"); + io1.in_portc_cb().set_ioport("P1"); + io1.in_portd_cb().set_ioport("P2"); + io1.in_porte_cb().set_ioport("DSW3"); + + cxd1095_device &io2(CXD1095(config, "io2")); + io2.in_porta_cb().set_ioport("DSW1"); + io2.in_portb_cb().set_ioport("DSW2"); + io2.in_portc_cb().set_ioport("P3"); + io2.in_portd_cb().set_ioport("P4"); + io2.out_porte_cb().set(FUNC(cyclwarr_state::cyclwarr_control_w)); + + /* video hardware */ + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); + screen.set_raw(cyclwarr_state::CLOCK_2 / 8, 400, 0, 320, 272, 0, 240); // TODO: Hook up CRTC + screen.set_screen_update(FUNC(cyclwarr_state::screen_update)); + + TZB315_SPRITES(config, m_sprites, 0, 0x1000); + m_sprites->set_sprite_palette_base(4096); + m_sprites->set_palette("sprites:palette_clut"); + m_sprites->set_basepalette(m_palette); + m_sprites->set_spriteram(m_spriteram); + + GFXDECODE(config, m_gfxdecode, m_palette, gfx_cyclwarr); + PALETTE(config, m_palette).set_format(palette_device::xRGB_555, 8192); + + /* sound hardware */ + SPEAKER(config, "lspeaker").front_left(); + SPEAKER(config, "rspeaker").front_right(); + + GENERIC_LATCH_8(config, m_soundlatch); +// m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, INPUT_LINE_NMI); + + YM2151(config, m_ym2151, cyclwarr_state::CLOCK_1 / 4); + m_ym2151->irq_handler().set_inputline(m_audiocpu, INPUT_LINE_IRQ0); + m_ym2151->add_route(0, "lspeaker", 0.45); + m_ym2151->add_route(1, "rspeaker", 0.45); + + OKIM6295(config, m_oki, cyclwarr_state::CLOCK_1 / 8, okim6295_device::PIN7_HIGH); + m_oki->add_route(ALL_OUTPUTS, "lspeaker", 0.75); + m_oki->add_route(ALL_OUTPUTS, "rspeaker", 0.75); +} + +void bigfight_state::bigfight(machine_config &config) +{ + cyclwarr(config); + + /* sound hardware */ + // TODO: 2MHz was too fast. Can the clock be software controlled? + m_oki->set_clock(bigfight_state::CLOCK_1 / 8 / 2); +} + + +ROM_START( cyclwarr ) + ROM_REGION16_BE( 0x200000, "master_rom", 0 ) /* 68000 main cpu */ + ROM_LOAD16_BYTE( "cw16c.ic77", 0x000000, 0x20000, CRC(4d88892b) SHA1(dc85231a3c4f83118922c13615381f185bcee832) ) + ROM_LOAD16_BYTE( "cw18c.ic98", 0x000001, 0x20000, CRC(4ff56209) SHA1(d628dc3fdc3e9de568ba8dbabf8e13a62e20a215) ) + ROM_COPY("master_rom", 0x000000, 0x040000, 0x040000 ) + ROM_COPY("master_rom", 0x000000, 0x080000, 0x040000 ) + ROM_COPY("master_rom", 0x000000, 0x0c0000, 0x040000 ) + ROM_LOAD16_BYTE( "cw17b.ic78", 0x100000, 0x20000, CRC(da998afc) SHA1(dd9377ce079df5c66bdb29dfd333428cce817656) ) + ROM_LOAD16_BYTE( "cw19b.ic99", 0x100001, 0x20000, CRC(c15a8413) SHA1(647b2a994a4912b5d7dc71b875f5d08c14412c6a) ) + ROM_COPY("master_rom", 0x100000, 0x140000, 0x040000 ) + ROM_COPY("master_rom", 0x100000, 0x180000, 0x040000 ) + ROM_COPY("master_rom", 0x100000, 0x1c0000, 0x040000 ) + + ROM_REGION16_BE( 0x100000, "slave_rom", 0 ) /* 68000 sub cpu */ + ROM_LOAD16_BYTE( "cw20b.ic100", 0x000000, 0x20000, CRC(4d75292a) SHA1(71d59c1d03b323d4021209a7f0506b4a855a73af) ) + ROM_LOAD16_BYTE( "cw22b.ic102", 0x000001, 0x20000, CRC(0aec0ba4) SHA1(d559e54d303afac4a981c4a933a05278044ac068) ) + ROM_COPY("slave_rom", 0x000000, 0x040000, 0x040000 ) + ROM_LOAD16_BYTE( "cw21.ic101", 0x080000, 0x20000, CRC(ed90d956) SHA1(f533f93da31ac6eb631fb506357717e7cac8e186) ) + ROM_LOAD16_BYTE( "cw23.ic103", 0x080001, 0x20000, CRC(009cdc78) SHA1(a77933a7736546397e8c69226703d6f9be7b55e5) ) + ROM_COPY("slave_rom", 0x080000, 0x0c0000, 0x040000 ) + + ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k code for sound Z80 */ + ROM_LOAD( "cw26a.ic91", 0x000000, 0x10000, CRC(f7a70e3a) SHA1(5581633bf1f15d7f5c1e03de897d65d60f9f1e33) ) + + ROM_REGION( 0x100000, "sprites:sprites_l", 0) + ROM_LOAD32_BYTE( "cw00a.ic26", 0x000000, 0x20000, CRC(058a77f1) SHA1(93f99fcf6ce6714d76af6f6e930115516f0379d3) ) + ROM_LOAD32_BYTE( "cw08a.ic45", 0x000001, 0x20000, CRC(f53993e7) SHA1(ef2d502ab180d2bc0bdb698c2878fdee9a2c33a8) ) + ROM_LOAD32_BYTE( "cw02a.ic28", 0x000002, 0x20000, CRC(4dadf3cb) SHA1(e42c56e295a443cb605d48eba23a16fab3c86525) ) + ROM_LOAD32_BYTE( "cw10a.ic47", 0x000003, 0x20000, CRC(3b7cd251) SHA1(52b9637404fa193421294dfb52c1a7bba0d94c9b) ) + ROM_LOAD32_BYTE( "cw01a.ic27", 0x080000, 0x20000, CRC(7c639948) SHA1(d58ff5735cd3179ffafead385a625baa7962e1d0) ) + ROM_LOAD32_BYTE( "cw09a.ic46", 0x080001, 0x20000, CRC(4ba24af5) SHA1(9203c2639e04aaa09996339f11259750ff8129b9) ) + ROM_LOAD32_BYTE( "cw03a.ic29", 0x080002, 0x20000, CRC(3ca6f98e) SHA1(8526fe38d3b4c66e09049ba18651a9e7255d85d6) ) + ROM_LOAD32_BYTE( "cw11a.ic48", 0x080003, 0x20000, CRC(5d760392) SHA1(7bbda2880af4659c267193ce10ed887a1b54a981) ) + + ROM_REGION( 0x100000, "sprites:sprites_h", 0) + ROM_LOAD32_BYTE( "cw04a.ic30", 0x000000, 0x20000, CRC(f05f594d) SHA1(80effaa517b2154c013419e0bc05fd0797b74c8d) ) + ROM_LOAD32_BYTE( "cw12a.ic49", 0x000001, 0x20000, CRC(4ac07e8b) SHA1(f9de96fba39d5752d61b8f6be87fb605694624ed) ) + ROM_LOAD32_BYTE( "cw06a.ic32", 0x000002, 0x20000, CRC(f628edc9) SHA1(473f7ec28000e6bf72782c1c3f4afb5e021bd430) ) + ROM_LOAD32_BYTE( "cw14a.ic51", 0x000003, 0x20000, CRC(a9131f5f) SHA1(3a2059946984733e6939f3298f0db676e6a3301b) ) + ROM_LOAD32_BYTE( "cw05a.ic31", 0x080000, 0x20000, CRC(c8f5faa9) SHA1(f374531ffd645597eeb1440fd2cadb426fcd3d79) ) + ROM_LOAD32_BYTE( "cw13a.ic50", 0x080001, 0x20000, CRC(8091d381) SHA1(7faf068ce20b2877559f0335df55d61be13146b4) ) + ROM_LOAD32_BYTE( "cw07a.ic33", 0x080002, 0x20000, CRC(314579b5) SHA1(3c10ec490f7821a5b5412295232bbb104d0e4b83) ) + ROM_LOAD32_BYTE( "cw15a.ic52", 0x080003, 0x20000, CRC(7ed4b721) SHA1(b87865effeff77a9ea74354ef2b5911a5102a647) ) + + ROM_REGION( 0x20000, "cw_tileclut", 0 ) + ROM_LOAD( "cw27.ic128", 0x000000, 0x20000, CRC(2db48a9e) SHA1(16c307340d17cd3b5455ebcee681fbe0335dec58) ) + + ROM_REGION( 0x60000, "tilerom", 0 ) + ROM_LOAD( "cw30.ic73", 0x000000, 0x20000, CRC(331d0711) SHA1(82251fe1f1d36f079080943ab1fd04a60077c353) ) + ROM_LOAD( "cw29.ic72", 0x020000, 0x20000, CRC(64dd519c) SHA1(e23611fc2be896861997063546c3eb03527eaf8e) ) + ROM_LOAD( "cw28.ic71", 0x040000, 0x20000, CRC(3fc568ed) SHA1(91125c9deddc659449ca6791a847fe908c2818b2) ) + + ROM_REGION( 0x40000, "oki", 0 ) /* ADPCM samples */ + ROM_LOAD( "cw24a.ic39", 0x000000, 0x20000, CRC(22600cba) SHA1(a1514fbe037942f1493a17eb0b7986949470cb22) ) + ROM_LOAD( "cw25a.ic40", 0x020000, 0x20000, CRC(372c6bc8) SHA1(d4875bf3bffecf338bebba3b8d6a791585556a06) ) +ROM_END + +ROM_START( cyclwarra ) + ROM_REGION16_BE( 0x200000, "master_rom", 0 ) /* 68000 main cpu */ + ROM_LOAD16_BYTE( "cw16b.ic77", 0x000000, 0x20000, CRC(cb1a737a) SHA1(a603ee1256be5641d00a72f64efaaacb65ed9d7d) ) + ROM_LOAD16_BYTE( "cw18b.ic98", 0x000001, 0x20000, CRC(0633ddcb) SHA1(1196ab17065352ec5b37f2f6b383a43a2d0fa3a6) ) + ROM_COPY("master_rom", 0x000000, 0x040000, 0x040000 ) + ROM_COPY("master_rom", 0x000000, 0x080000, 0x040000 ) + ROM_COPY("master_rom", 0x000000, 0x0c0000, 0x040000 ) + ROM_LOAD16_BYTE( "cw17a.ic78", 0x100000, 0x20000, CRC(2ad6f836) SHA1(5fa4275b433013943ba1d1b64a3c725097f946f9) ) + ROM_LOAD16_BYTE( "cw19a.ic99", 0x100001, 0x20000, CRC(d3853658) SHA1(c9338083a04f55bd22285176831f4b0bdb78564f) ) + ROM_COPY("master_rom", 0x100000, 0x140000, 0x040000 ) + ROM_COPY("master_rom", 0x100000, 0x180000, 0x040000 ) + ROM_COPY("master_rom", 0x100000, 0x1c0000, 0x040000 ) + + ROM_REGION16_BE( 0x100000, "slave_rom", 0 ) /* 68000 sub cpu */ + ROM_LOAD16_BYTE( "cw20a.ic100", 0x000000, 0x20000, CRC(c3578ac1) SHA1(21d369da874f01922d0f0b757a42b4321df891d4) ) + ROM_LOAD16_BYTE( "cw22a.ic102", 0x000001, 0x20000, CRC(5339ed24) SHA1(5b0a54c2442dcf7373ff8b55b91af9772473ff77) ) + ROM_COPY("slave_rom", 0x000000, 0x040000, 0x040000 ) + ROM_LOAD16_BYTE( "cw21.ic101", 0x080000, 0x20000, CRC(ed90d956) SHA1(f533f93da31ac6eb631fb506357717e7cac8e186) ) + ROM_LOAD16_BYTE( "cw23.ic103", 0x080001, 0x20000, CRC(009cdc78) SHA1(a77933a7736546397e8c69226703d6f9be7b55e5) ) + ROM_COPY("slave_rom", 0x080000, 0x0c0000, 0x040000 ) + + ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k code for sound Z80 */ + ROM_LOAD( "cw26a.ic91", 0x000000, 0x10000, CRC(f7a70e3a) SHA1(5581633bf1f15d7f5c1e03de897d65d60f9f1e33) ) + + ROM_REGION( 0x100000, "sprites:sprites_l", 0) + ROM_LOAD32_BYTE( "cw00a.ic26", 0x000000, 0x20000, CRC(058a77f1) SHA1(93f99fcf6ce6714d76af6f6e930115516f0379d3) ) + ROM_LOAD32_BYTE( "cw08a.ic45", 0x000001, 0x20000, CRC(f53993e7) SHA1(ef2d502ab180d2bc0bdb698c2878fdee9a2c33a8) ) + ROM_LOAD32_BYTE( "cw02a.ic28", 0x000002, 0x20000, CRC(4dadf3cb) SHA1(e42c56e295a443cb605d48eba23a16fab3c86525) ) + ROM_LOAD32_BYTE( "cw10a.ic47", 0x000003, 0x20000, CRC(3b7cd251) SHA1(52b9637404fa193421294dfb52c1a7bba0d94c9b) ) + ROM_LOAD32_BYTE( "cw01a.ic27", 0x080000, 0x20000, CRC(7c639948) SHA1(d58ff5735cd3179ffafead385a625baa7962e1d0) ) + ROM_LOAD32_BYTE( "cw09a.ic46", 0x080001, 0x20000, CRC(4ba24af5) SHA1(9203c2639e04aaa09996339f11259750ff8129b9) ) + ROM_LOAD32_BYTE( "cw03a.ic29", 0x080002, 0x20000, CRC(3ca6f98e) SHA1(8526fe38d3b4c66e09049ba18651a9e7255d85d6) ) + ROM_LOAD32_BYTE( "cw11a.ic48", 0x080003, 0x20000, CRC(5d760392) SHA1(7bbda2880af4659c267193ce10ed887a1b54a981) ) + + ROM_REGION( 0x100000, "sprites:sprites_h", 0) + ROM_LOAD32_BYTE( "cw04a.ic30", 0x000000, 0x20000, CRC(f05f594d) SHA1(80effaa517b2154c013419e0bc05fd0797b74c8d) ) + ROM_LOAD32_BYTE( "cw12a.ic49", 0x000001, 0x20000, CRC(4ac07e8b) SHA1(f9de96fba39d5752d61b8f6be87fb605694624ed) ) + ROM_LOAD32_BYTE( "cw06a.ic32", 0x000002, 0x20000, CRC(f628edc9) SHA1(473f7ec28000e6bf72782c1c3f4afb5e021bd430) ) + ROM_LOAD32_BYTE( "cw14a.ic51", 0x000003, 0x20000, CRC(a9131f5f) SHA1(3a2059946984733e6939f3298f0db676e6a3301b) ) + ROM_LOAD32_BYTE( "cw05a.ic31", 0x080000, 0x20000, CRC(c8f5faa9) SHA1(f374531ffd645597eeb1440fd2cadb426fcd3d79) ) + ROM_LOAD32_BYTE( "cw13a.ic50", 0x080001, 0x20000, CRC(8091d381) SHA1(7faf068ce20b2877559f0335df55d61be13146b4) ) + ROM_LOAD32_BYTE( "cw07a.ic33", 0x080002, 0x20000, CRC(314579b5) SHA1(3c10ec490f7821a5b5412295232bbb104d0e4b83) ) + ROM_LOAD32_BYTE( "cw15a.ic52", 0x080003, 0x20000, CRC(7ed4b721) SHA1(b87865effeff77a9ea74354ef2b5911a5102a647) ) + + ROM_REGION( 0x20000, "cw_tileclut", 0 ) + ROM_LOAD( "cw27.ic128", 0x000000, 0x20000, CRC(2db48a9e) SHA1(16c307340d17cd3b5455ebcee681fbe0335dec58) ) + + ROM_REGION( 0x60000, "tilerom", 0 ) + ROM_LOAD( "cw30.ic73", 0x000000, 0x20000, CRC(331d0711) SHA1(82251fe1f1d36f079080943ab1fd04a60077c353) ) + ROM_LOAD( "cw29.ic72", 0x020000, 0x20000, CRC(64dd519c) SHA1(e23611fc2be896861997063546c3eb03527eaf8e) ) + ROM_LOAD( "cw28.ic71", 0x040000, 0x20000, CRC(3fc568ed) SHA1(91125c9deddc659449ca6791a847fe908c2818b2) ) + + ROM_REGION( 0x40000, "oki", 0 ) /* ADPCM samples */ + ROM_LOAD( "cw24a.ic39", 0x000000, 0x20000, CRC(22600cba) SHA1(a1514fbe037942f1493a17eb0b7986949470cb22) ) + ROM_LOAD( "cw25a.ic40", 0x020000, 0x20000, CRC(372c6bc8) SHA1(d4875bf3bffecf338bebba3b8d6a791585556a06) ) +ROM_END + +ROM_START( cyclwarrb ) + ROM_REGION16_BE( 0x200000, "master_rom", 0 ) /* 68000 main cpu */ + ROM_LOAD16_BYTE( "cw16.ic77", 0x000000, 0x20000, CRC(47d57cf9) SHA1(9954f3eae496d3e3552f5537d93d798fa8a397b6) ) + ROM_LOAD16_BYTE( "cw18.ic98", 0x000001, 0x20000, CRC(7d541f9e) SHA1(eab9098f08c103d6b96cb0aebe65f53a9cb361fb) ) + ROM_COPY("master_rom", 0x000000, 0x040000, 0x040000 ) + ROM_COPY("master_rom", 0x000000, 0x080000, 0x040000 ) + ROM_COPY("master_rom", 0x000000, 0x0c0000, 0x040000 ) + ROM_LOAD16_BYTE( "cw17.ic78", 0x100000, 0x20000, CRC(008bdf09) SHA1(17f739a65382caf81314840ca491f600e09c3f32) ) + ROM_LOAD16_BYTE( "cw19.ic99", 0x100001, 0x20000, CRC(e82244e0) SHA1(8887927fe74c160bc3b5c1293e0787bd9c9d2bff) ) + ROM_COPY("master_rom", 0x100000, 0x140000, 0x040000 ) + ROM_COPY("master_rom", 0x100000, 0x180000, 0x040000 ) + ROM_COPY("master_rom", 0x100000, 0x1c0000, 0x040000 ) + + ROM_REGION16_BE( 0x100000, "slave_rom", 0 ) /* 68000 sub cpu */ + ROM_LOAD16_BYTE( "cw20.ic100", 0x000000, 0x20000, CRC(c7a6fa85) SHA1(d696c8b9432c07abad3c4ab611d53742970c1fbc) ) + ROM_LOAD16_BYTE( "cw22.ic102", 0x000001, 0x20000, CRC(917c1a2a) SHA1(612d81b8cf68c61206e85926b95238ebcdc22ca3) ) + ROM_COPY("slave_rom", 0x000000, 0x040000, 0x040000 ) + ROM_LOAD16_BYTE( "cw21.ic101", 0x080000, 0x20000, CRC(ed90d956) SHA1(f533f93da31ac6eb631fb506357717e7cac8e186) ) + ROM_LOAD16_BYTE( "cw23.ic103", 0x080001, 0x20000, CRC(009cdc78) SHA1(a77933a7736546397e8c69226703d6f9be7b55e5) ) + ROM_COPY("slave_rom", 0x080000, 0x0c0000, 0x040000 ) + + ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k code for sound Z80 */ + ROM_LOAD( "cw26.ic91", 0x000000, 0x10000, CRC(a6485a3a) SHA1(b4fcf541efe48b3ca32065221fe2f59476a4f96a) ) + + ROM_REGION( 0x100000, "sprites:sprites_l", 0) + ROM_LOAD32_BYTE( "cw00.ic26", 0x000000, 0x20000, CRC(ba00c582) SHA1(2cd645b828595acbe62e2f7aad037fcbdc5a543f) ) + ROM_LOAD32_BYTE( "cw08.ic45", 0x000001, 0x20000, CRC(1583e576) SHA1(646762d1d181231090a18698378f60d09f26f49f) ) + ROM_LOAD32_BYTE( "cw02.ic28", 0x000002, 0x20000, CRC(8376a744) SHA1(633d20199382f760adfb528f5b13730ddf9016e3) ) + ROM_LOAD32_BYTE( "cw10.ic47", 0x000003, 0x20000, CRC(901d849d) SHA1(601b5315717bc45b9ca3b64af019fd4437c65186) ) + ROM_LOAD32_BYTE( "cw01.ic27", 0x080000, 0x20000, CRC(35979022) SHA1(6de5c2a5edc5d76899d329f26bfa7b8b7c4f1919) ) + ROM_LOAD32_BYTE( "cw09.ic46", 0x080001, 0x20000, CRC(8114be09) SHA1(bade99653f8b4e3b5974f94d0cf0fdf2464d7dc7) ) + ROM_LOAD32_BYTE( "cw03.ic29", 0x080002, 0x20000, CRC(951ed812) SHA1(b3db6b467fd626936568773367099c9abcabfab6) ) + ROM_LOAD32_BYTE( "cw11.ic48", 0x080003, 0x20000, CRC(a7e5bf0b) SHA1(883b943d40f4516a21692beffb12514ad9301f20) ) + + ROM_REGION( 0x100000, "sprites:sprites_h", 0) + ROM_LOAD32_BYTE( "cw04.ic30", 0x000000, 0x20000, CRC(890ea7b1) SHA1(737e58800aa6863aff043ba46c9cebc8ba6c1501) ) + ROM_LOAD32_BYTE( "cw12.ic49", 0x000001, 0x20000, CRC(1587e96d) SHA1(2ffcb27d90ef29bc79d0a29f46a1d43565935a15) ) + ROM_LOAD32_BYTE( "cw06.ic32", 0x000002, 0x20000, CRC(47decb23) SHA1(4868c01035175698cb8af7aae80627b51583213f) ) + ROM_LOAD32_BYTE( "cw14.ic51", 0x000003, 0x20000, CRC(a75072a1) SHA1(a988eda496f35204bfdade8aa24441dba440618c) ) + ROM_LOAD32_BYTE( "cw05.ic31", 0x080000, 0x20000, CRC(4e49fcc5) SHA1(e4541961bd2abfb91b76ce78fa705d5dd188e118) ) + ROM_LOAD32_BYTE( "cw13.ic50", 0x080001, 0x20000, CRC(51aee710) SHA1(1d9dc575d0110bd147439c5dd87fe6b4203d125d) ) + ROM_LOAD32_BYTE( "cw07.ic33", 0x080002, 0x20000, CRC(4f6b3c72) SHA1(98ab85f2848f0a0a5f37bf2d6292ad3a039040e1) ) + ROM_LOAD32_BYTE( "cw15.ic52", 0x080003, 0x20000, CRC(9cfc3b14) SHA1(33abb0df0fc1e12e22d35a68c583d2c0a236032e) ) + + ROM_REGION( 0x20000, "cw_tileclut", 0 ) + ROM_LOAD( "cw27.ic128", 0x000000, 0x20000, CRC(2db48a9e) SHA1(16c307340d17cd3b5455ebcee681fbe0335dec58) ) + + ROM_REGION( 0x60000, "tilerom", 0 ) + ROM_LOAD( "cw30.ic73", 0x000000, 0x20000, CRC(331d0711) SHA1(82251fe1f1d36f079080943ab1fd04a60077c353) ) + ROM_LOAD( "cw29.ic72", 0x020000, 0x20000, CRC(64dd519c) SHA1(e23611fc2be896861997063546c3eb03527eaf8e) ) + ROM_LOAD( "cw28.ic71", 0x040000, 0x20000, CRC(3fc568ed) SHA1(91125c9deddc659449ca6791a847fe908c2818b2) ) + + ROM_REGION( 0x40000, "oki", 0 ) /* ADPCM samples */ + ROM_LOAD( "cw24.ic39", 0x000000, 0x20000, CRC(08656756) SHA1(37352ce488c8af36a50c51fa319caed4f2391d72) ) + ROM_LOAD( "cw25.ic40", 0x020000, 0x20000, CRC(36c0b8a6) SHA1(d1519c919fa51b1fc157d5314709a3e6e0b7a5c8) ) +ROM_END + +ROM_START( bigfight ) + ROM_REGION16_BE( 0x200000, "master_rom", 0 ) /* 68000 main cpu */ + ROM_LOAD16_BYTE( "rom16.ic77", 0x000000, 0x40000, CRC(e7304ec8) SHA1(31a37e96bf963b349d36534bc5ebbf45e19ad00e) ) + ROM_LOAD16_BYTE( "rom17.ic98", 0x000001, 0x40000, CRC(4cf090f6) SHA1(9ae0274c890e829a90108ce316aff9665128c982) ) + ROM_COPY("master_rom", 0x000000, 0x080000, 0x080000 ) + ROM_COPY("master_rom", 0x100000, 0x080000, 0x080000 ) + ROM_COPY("master_rom", 0x180000, 0x080000, 0x080000 ) + + ROM_REGION16_BE( 0x100000, "slave_rom", 0 ) /* 68000 sub cpu */ + ROM_LOAD16_BYTE( "rom18.ic100", 0x000000, 0x40000, CRC(49df6207) SHA1(c4126f4542add11a3a3d236311c8787c24c98440) ) + ROM_LOAD16_BYTE( "rom19.ic102", 0x000001, 0x40000, CRC(c12aa9e9) SHA1(19cc7feaa97c6f5148ae8c0077174f96be684f05) ) + ROM_COPY("slave_rom", 0x000000, 0x080000, 0x080000 ) + + ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k code for sound Z80 */ + ROM_LOAD( "rom20.ic91", 0x000000, 0x10000, CRC(b3add091) SHA1(8a67bfff75c13fe4d9b89d30449199200d11cea7) ) // == bf36b.ic91 + + ROM_REGION( 0x200000, "sprites:sprites_l", 0 ) + ROM_LOAD32_BYTE( "rom0.ic26", 0x000000, 0x80000, CRC(a4a3c8d6) SHA1(b5365d9bc6068260c23ba9d5971c7c7d7cc07a97) ) + ROM_LOAD32_BYTE( "rom8.ic45", 0x000001, 0x80000, CRC(220956ed) SHA1(68e0ba1e850101b4cc2778819dfa76f04d88d2d6) ) + ROM_LOAD32_BYTE( "rom2.ic28", 0x000002, 0x80000, CRC(c4f6d243) SHA1(e23b241b5a40b332165a34e2f1bc4366973b2070) ) + ROM_LOAD32_BYTE( "rom10.ic47", 0x000003, 0x80000, CRC(0212d472) SHA1(5549461195fd7b6b43c0174462d7fe1a1bac24e9) ) + + ROM_REGION( 0x200000, "sprites:sprites_h", 0 ) + ROM_LOAD32_BYTE( "rom4.ic30", 0x000000, 0x80000, CRC(999ff7e9) SHA1(a53b06ad084722d7a52fcf01c52967f68620e609) ) + ROM_LOAD32_BYTE( "rom12.ic49", 0x000001, 0x80000, CRC(cb4c1f0b) SHA1(32d64b78ed3d5971eb5d25be2c38e6f2c9048f74) ) + ROM_LOAD32_BYTE( "rom6.ic32", 0x000002, 0x80000, CRC(f70e2d47) SHA1(00517b5f3b2deb6f3f3bd12df421e63884c22b2e) ) + ROM_LOAD32_BYTE( "rom14.ic51", 0x000003, 0x80000, CRC(77430bc9) SHA1(0b1fd54ace84a9fb5b44d5600de8089a20bcbd47) ) + + ROM_REGION( 0x20000, "cw_tileclut", 0 ) + ROM_LOAD( "rom21.ic128", 0x000000, 0x20000, CRC(da027dcf) SHA1(47d18a8a273fea72cb3ad3d58166fe38ca28a860) ) // == bf27.ic128 + + ROM_REGION( 0x60000, "tilerom", 0 ) + ROM_LOAD( "rom24.ic73", 0x000000, 0x20000, CRC(c564185d) SHA1(e9b5fc10a5a5014735852c22db2a054d5787d8cb) ) // == bf30.ic73 + ROM_LOAD( "rom23.ic72", 0x020000, 0x20000, CRC(f8bb340b) SHA1(905a1ec778d6ed5c6f53d9d08cd105eed7e307ca) ) // == bf29.ic72 + ROM_LOAD( "rom22.ic71", 0x040000, 0x20000, CRC(fb505074) SHA1(b6d9b20be7c3e971e5a4392736f087e807b9c850) ) // == bf28.ic71 + + ROM_REGION( 0x40000, "oki", 0 ) /* ADPCM samples */ + ROM_LOAD( "rom15.ic39", 0x000000, 0x40000, CRC(58d136e8) SHA1(4aa063c4b9b057cba4655ecbe44a87c8c411e3aa) ) // == bf24.ic39 + bf25.ic40 +ROM_END + +ROM_START( bigfightj ) // ABA-011 main board + ABA-012 daughter board + ROM_REGION16_BE( 0x200000, "master_rom", 0 ) /* 68000 main cpu */ + ROM_LOAD16_BYTE( "bfj16f.ic77", 0x000000, 0x20000, CRC(9141a488) SHA1(f8b64d2ef6fcea7922f88ed75977f764e98e679b) ) // rev F + ROM_LOAD16_BYTE( "bf18f.ic98", 0x000001, 0x20000, CRC(f23a4935) SHA1(513f2b3a83a0a7c183b2ff20b652279a5bee8863) ) // rev F + ROM_COPY("master_rom", 0x000000, 0x040000, 0x040000 ) + ROM_COPY("master_rom", 0x000000, 0x080000, 0x040000 ) + ROM_COPY("master_rom", 0x000000, 0x0c0000, 0x040000 ) + ROM_LOAD16_BYTE( "bf17e.ic78", 0x100000, 0x20000, CRC(5e5d023d) SHA1(04f59458f15c95ad152b1b99f885f31ccb26ac40) ) // rev E + ROM_LOAD16_BYTE( "bf19e.ic99", 0x100001, 0x20000, CRC(5329e151) SHA1(a7ce98d80379f56808291c42852b1f7173966ed7) ) // rev E + ROM_COPY("master_rom", 0x100000, 0x140000, 0x040000 ) + ROM_COPY("master_rom", 0x100000, 0x180000, 0x040000 ) + ROM_COPY("master_rom", 0x100000, 0x1c0000, 0x040000 ) + + ROM_REGION16_BE( 0x100000, "slave_rom", 0 ) /* 68000 sub cpu */ + ROM_LOAD16_BYTE( "bf20.ic100", 0x000000, 0x20000, CRC(5bd44e11) SHA1(a7acb6d9f40c4b6d54bf131a2e192c16ec22b1af) ) + ROM_LOAD16_BYTE( "bf22.ic102", 0x000001, 0x20000, CRC(e52c29ab) SHA1(2b3aa55a2eeec5cf73666e1d85f65679961472e0) ) + ROM_COPY("slave_rom", 0x000000, 0x040000, 0x040000 ) + ROM_LOAD16_BYTE( "bf21d.ic101", 0x080000, 0x20000, CRC(c4c2f969) SHA1(69f453d51951c02f12f3a40ac925b48430e3f314) ) // rev D + ROM_LOAD16_BYTE( "bf23d.ic103", 0x080001, 0x20000, CRC(c05ae1fe) SHA1(219ddc08d4b8416fb2a9f2cb14ac9c4b4421dadd) ) // rev D + ROM_COPY("slave_rom", 0x080000, 0x0c0000, 0x040000 ) + + ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k code for sound Z80 */ + ROM_LOAD( "bf36b.ic91", 0x000000, 0x10000, CRC(b3add091) SHA1(8a67bfff75c13fe4d9b89d30449199200d11cea7) ) // rev B + + ROM_REGION( 0x200000, "sprites:sprites_l", 0 ) + ROM_LOAD32_BYTE( "bf00d.ic26", 0x000000, 0x40000, CRC(f506d508) SHA1(86255631ac139f1b5c0f5d6e54a0858625497a1e) ) // all rev D + ROM_LOAD32_BYTE( "bf08d.ic45", 0x000001, 0x40000, CRC(4bf948b9) SHA1(c65b95c454d04c7e4a0cf426ac2d45ddc5e8885e) ) + ROM_LOAD32_BYTE( "bf02d.ic28", 0x000002, 0x40000, CRC(af30acf7) SHA1(8f4778b33abb18b113d5d27c0e957d633557c988) ) + ROM_LOAD32_BYTE( "bf10d.ic47", 0x000003, 0x40000, CRC(ffddb7f8) SHA1(505c082adaf71bd2aa15d78d3e8968cbd1f2cc0c) ) + ROM_LOAD32_BYTE( "bf01d.ic27", 0x100000, 0x20000, CRC(ec3f5f17) SHA1(436f176155af8fc3212507448df6852a76289bef) ) + ROM_LOAD32_BYTE( "bf09d.ic46", 0x100001, 0x20000, CRC(284837ed) SHA1(b1c130b45ff0f22985962240c47b7b01df6ac636) ) + ROM_LOAD32_BYTE( "bf03d.ic29", 0x100002, 0x20000, CRC(2ba0398e) SHA1(ec9a29b661b18980c07a446afc89becb1ebddd57) ) + ROM_LOAD32_BYTE( "bf11d.ic48", 0x100003, 0x20000, CRC(3f2fa72f) SHA1(4b4821b6933ea753e092f11d80bcc7698f85ccf2) ) + ROM_COPY("sprites:sprites_l", 0x100000, 0x180000, 0x080000 ) + + ROM_REGION( 0x200000, "sprites:sprites_h", 0) + ROM_LOAD32_BYTE( "bf04d.ic30", 0x000000, 0x40000, CRC(6203d320) SHA1(d58225d8a362971a0eb63c94abc1e8c76198fd2a) ) // all rev D + ROM_LOAD32_BYTE( "bf12d.ic49", 0x000001, 0x40000, CRC(d261dfa7) SHA1(e787901112780e9770300999722fc80aa1d7ab18) ) + ROM_LOAD32_BYTE( "bf06d.ic32", 0x000002, 0x40000, CRC(be187c3c) SHA1(46383eb40c0caeb1bc636630a4d849aa2d1a12d2) ) + ROM_LOAD32_BYTE( "bf14d.ic51", 0x000003, 0x40000, CRC(60f2ab3d) SHA1(babaef6348133b5fe34f9e044732467d8775cc3d) ) + ROM_LOAD32_BYTE( "bf05d.ic31", 0x100000, 0x20000, CRC(2229acbc) SHA1(3031fbb7b730a6d51f08d0021c5d6e91cdbdd56d) ) + ROM_LOAD32_BYTE( "bf13d.ic50", 0x100001, 0x20000, CRC(1e46cd79) SHA1(c81c96b287a6cc91d3ab4dd8043153814560be3d) ) + ROM_LOAD32_BYTE( "bf07d.ic33", 0x100002, 0x20000, CRC(4940b0bb) SHA1(762f21055921093349ca09c35ef516bde6330aa8) ) + ROM_LOAD32_BYTE( "bf15d.ic52", 0x100003, 0x20000, CRC(dab0c80a) SHA1(a172937c9599acbd77dcac02ea7e43f576d66d8c) ) + ROM_COPY("sprites:sprites_h", 0x100000, 0x180000, 0x080000 ) + + ROM_REGION( 0x20000, "cw_tileclut", 0 ) + ROM_LOAD( "bf27.ic128", 0x000000, 0x20000, CRC(da027dcf) SHA1(47d18a8a273fea72cb3ad3d58166fe38ca28a860) ) + + ROM_REGION( 0x60000, "tilerom", 0 ) + ROM_LOAD( "bf30.ic73", 0x000000, 0x20000, CRC(c564185d) SHA1(e9b5fc10a5a5014735852c22db2a054d5787d8cb) ) + ROM_LOAD( "bf29.ic72", 0x020000, 0x20000, CRC(f8bb340b) SHA1(905a1ec778d6ed5c6f53d9d08cd105eed7e307ca) ) + ROM_LOAD( "bf28.ic71", 0x040000, 0x20000, CRC(fb505074) SHA1(b6d9b20be7c3e971e5a4392736f087e807b9c850) ) + + ROM_REGION( 0x40000, "oki", 0 ) /* ADPCM samples */ + ROM_LOAD( "bf24.ic39", 0x000000, 0x20000, CRC(9db80c8a) SHA1(9ce64713758ebab559a0cacc7f7501e5a1a0133a) ) + ROM_LOAD( "bf25.ic40", 0x020000, 0x20000, CRC(630154c4) SHA1(05902371b62a11c13f2582faa591945c037c6311) ) +ROM_END + +} // anonymous namespace + +GAME( 1991, cyclwarr, 0, cyclwarr, cyclwarr, cyclwarr_state, init_tatsumi, ROT0, "Tatsumi", "Cycle Warriors (rev C)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_NOT_WORKING ) // Rev C & B CPU code +GAME( 1991, cyclwarra, cyclwarr, cyclwarr, cyclwarb, cyclwarr_state, init_tatsumi, ROT0, "Tatsumi", "Cycle Warriors (rev B)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_NOT_WORKING ) // Rev B & A CPU code +GAME( 1991, cyclwarrb, cyclwarr, cyclwarr, cyclwarb, cyclwarr_state, init_tatsumi, ROT0, "Tatsumi", "Cycle Warriors", MACHINE_IMPERFECT_GRAPHICS | MACHINE_NOT_WORKING ) // Original version with no Rev roms + +GAME( 1992, bigfight, 0, bigfight, bigfight, bigfight_state, init_tatsumi, ROT0, "Tatsumi", "Big Fight - Big Trouble In The Atlantic Ocean", MACHINE_IMPERFECT_GRAPHICS ) +GAME( 1992, bigfightj, bigfight, bigfight, bigfight, bigfight_state, init_tatsumi, ROT0, "Tatsumi", "Big Fight - Big Trouble In The Atlantic Ocean (Japan, rev F)", MACHINE_IMPERFECT_GRAPHICS ) // Rev D through F CPU codes diff --git a/src/mame/tatsumi/kingdrby.cpp b/src/mame/tatsumi/kingdrby.cpp index 3527f0cdf8391..affba9c3bff39 100644 --- a/src/mame/tatsumi/kingdrby.cpp +++ b/src/mame/tatsumi/kingdrby.cpp @@ -130,7 +130,7 @@ class kingdrby_state : public driver_device TILE_GET_INFO_MEMBER(get_sc1_tile_info); void kingdrby_palette(palette_device &palette) const; void kingdrbb_palette(palette_device &palette) const; - uint32_t screen_update_kingdrby(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); void draw_sprites(bitmap_rgb32 &bitmap, const rectangle &cliprect); void cowrace_sound_io(address_map &map) ATTR_COLD; @@ -274,7 +274,7 @@ void kingdrby_state::draw_sprites(bitmap_rgb32 &bitmap, const rectangle &cliprec } } -uint32_t kingdrby_state::screen_update_kingdrby(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t kingdrby_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { const rectangle &visarea = screen.visible_area(); rectangle clip; @@ -1010,7 +1010,7 @@ void kingdrby_state::kingdrby(machine_config &config) screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500)); /* not accurate */ screen.set_size(256, 256); screen.set_visarea(0, 256-1, 0, 224-1); /* controlled by CRTC */ - screen.set_screen_update(FUNC(kingdrby_state::screen_update_kingdrby)); + screen.set_screen_update(FUNC(kingdrby_state::screen_update)); mc6845_device &crtc(MC6845(config, "crtc", CLK_1/32)); /* 53.333 Hz. guess */ crtc.set_screen("screen"); diff --git a/src/mame/tatsumi/lockon.cpp b/src/mame/tatsumi/lockon.cpp index 311d622a1c54d..b9a78d3432db1 100644 --- a/src/mame/tatsumi/lockon.cpp +++ b/src/mame/tatsumi/lockon.cpp @@ -489,8 +489,8 @@ void lockon_state::lockon(machine_config &config) SCREEN(config, m_screen, SCREEN_TYPE_RASTER); m_screen->set_video_attributes(VIDEO_UPDATE_AFTER_VBLANK); m_screen->set_raw(PIXEL_CLOCK, HTOTAL, HBEND, HBSTART, VTOTAL, VBEND, VBSTART); - m_screen->set_screen_update(FUNC(lockon_state::screen_update_lockon)); - m_screen->screen_vblank().set(FUNC(lockon_state::screen_vblank_lockon)); + m_screen->set_screen_update(FUNC(lockon_state::screen_update)); + m_screen->screen_vblank().set(FUNC(lockon_state::screen_vblank)); m_screen->set_palette(m_palette); GFXDECODE(config, m_gfxdecode, m_palette, gfx_lockon); diff --git a/src/mame/tatsumi/lockon.h b/src/mame/tatsumi/lockon.h index 4a5870407d2e5..5dc8fead4b496 100644 --- a/src/mame/tatsumi/lockon.h +++ b/src/mame/tatsumi/lockon.h @@ -141,8 +141,8 @@ class lockon_state : public driver_device void ym2203_out_b(uint8_t data); TILE_GET_INFO_MEMBER(get_lockon_tile_info); void lockon_palette(palette_device &palette) const; - uint32_t screen_update_lockon(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - void screen_vblank_lockon(int state); + uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + void screen_vblank(int state); TIMER_CALLBACK_MEMBER(cursor_callback); TIMER_CALLBACK_MEMBER(bufend_callback); void scene_draw(); diff --git a/src/mame/tatsumi/lockon_v.cpp b/src/mame/tatsumi/lockon_v.cpp index f4e0e7ed56ece..7e3f9cb854a47 100644 --- a/src/mame/tatsumi/lockon_v.cpp +++ b/src/mame/tatsumi/lockon_v.cpp @@ -884,7 +884,7 @@ void lockon_state::video_start() save_pointer(NAME(m_obj_pal_ram), 2048); } -uint32_t lockon_state::screen_update_lockon(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t lockon_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { /* If screen output is disabled, fill with black */ if (!BIT(m_ctrl_reg, 7)) @@ -905,7 +905,7 @@ uint32_t lockon_state::screen_update_lockon(screen_device &screen, bitmap_ind16 return 0; } -void lockon_state::screen_vblank_lockon(int state) +void lockon_state::screen_vblank(int state) { // on falling edge if (!state) diff --git a/src/mame/tatsumi/roundup5.cpp b/src/mame/tatsumi/roundup5.cpp new file mode 100644 index 0000000000000..2d0fae361be9f --- /dev/null +++ b/src/mame/tatsumi/roundup5.cpp @@ -0,0 +1,779 @@ +// license:BSD-3-Clause +// copyright-holders:Bryan McPhail, Angelo Salese +/*************************************************************************** + + Round Up 5 ATC-011 + + TODO: + + - Finish road layer. + Tunnel sections are borderline unplayable, plus slopes are ugly to watch. + + - Always boots with a coin inserted + $5152 is the coin counter, gets an explicit 1 at boot. + There are other two buffers read from 68k before that, written to $5156 and $515a + If these are 0xffff by then game boots normally ... + +***************************************************************************/ + +#include "emu.h" +#include "tatsumi.h" + +#include "cpu/nec/nec.h" +#include "cpu/z80/z80.h" +#include "machine/i8255.h" + +#include "screen.h" +#include "speaker.h" + +#include "roundup5.lh" + +namespace { + +class roundup5_state : public tatsumi_state +{ +public: + roundup5_state(const machine_config &mconfig, device_type type, const char *tag) + : tatsumi_state(mconfig, type, tag) + , m_vregs(*this, "vregs") + , m_bg_scrollx(*this, "bg_scrollx") + , m_bg_scrolly(*this, "bg_scrolly") + , m_road_ctrl_ram(*this, "road_ctrl_ram") + , m_road_pixel_ram(*this, "road_pixel_ram") + , m_road_color_ram(*this, "road_color_ram") + , m_road_yclip(*this, "road_yclip") + , m_road_vregs(*this, "road_vregs") + { + } + + void roundup5(machine_config &config); + +protected: + virtual void video_start() override ATTR_COLD; + +private: + uint16_t roundup_v30_z80_r(offs_t offset); + void roundup_v30_z80_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); + void roundup5_control_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); + void road_vregs_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); + uint8_t gfxdata_r(offs_t offset); + void gfxdata_w(offs_t offset, uint8_t data); + void output_w(uint8_t data); + + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + + void roundup5_68000_map(address_map &map) ATTR_COLD; + void roundup5_v30_map(address_map &map) ATTR_COLD; + void roundup5_z80_map(address_map &map) ATTR_COLD; + + void draw_road(bitmap_rgb32 &bitmap, const rectangle &cliprect); + void draw_landscape(bitmap_rgb32 &bitmap, const rectangle &cliprect, uint8_t type); + + required_shared_ptr m_vregs; + required_shared_ptr m_bg_scrollx; + required_shared_ptr m_bg_scrolly; + required_shared_ptr m_road_ctrl_ram; + required_shared_ptr m_road_pixel_ram; + required_shared_ptr m_road_color_ram; + required_shared_ptr m_road_yclip; + required_shared_ptr m_road_vregs; + + std::unique_ptr m_tx_gfxram; + std::unique_ptr m_bg_gfxram; +}; + + +uint8_t roundup5_state::gfxdata_r(offs_t offset) +{ + if((m_control_word & 0x200) == 0x200) + { + offset += (m_control_word & 0x6000) << 2; + + return m_bg_gfxram[offset]; + } + + offset+=((m_control_word&0x0c00)>>10) * 0x8000; + return m_tx_gfxram[offset]; +} + +void roundup5_state::gfxdata_w(offs_t offset, uint8_t data) +{ + if((m_control_word & 0x200) == 0x200) + { + offset += (m_control_word & 0x6000) << 2; + m_bg_gfxram[offset] = data; + return; + } + + offset+=((m_control_word&0x0c00)>>10) * 0x8000; + + if (offset>=0x18000 && data) + logerror("effective write to vram %06x %02x (control %04x)\n",offset,data,m_control_word); + + m_tx_gfxram[offset] = data; + + offset=offset%0x8000; + + m_gfxdecode->gfx(0)->mark_dirty(offset/8); +} + +void roundup5_state::video_start() +{ + m_tx_layer = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(roundup5_state::get_text_tile_info)), TILEMAP_SCAN_ROWS, 8,8, 128,64); + m_tx_gfxram = std::make_unique(0x20000); + m_bg_gfxram = std::make_unique(0x20000); + + m_tx_layer->set_transparent_pen(0); + + m_gfxdecode->gfx(0)->set_source(m_tx_gfxram.get()); + + save_pointer(NAME(m_tx_gfxram), 0x20000); + save_pointer(NAME(m_bg_gfxram), 0x20000); +} + +void roundup5_state::draw_road(bitmap_rgb32 &bitmap, const rectangle &cliprect) +{ +/* +0xf980 0x0008 0x8c80 0x4a00 - road right to below, width unknown (32 pixels guess) +0xfa80 0x0008 0x8c80 0x4a00 - road right to below, width unknown (32 pixels guess) + +0xfb80 0x0008 0x8c80 0x4a00 - road in middle of screen, width unknown (32 pixels guess) + +0xfc80 0x0008 0x8c80 0x4a00 - road width above to left, same width as above (ie, xpos - 32) +0xfd80 0x0008 0x8c80 0x4a00 - road width above to left, same width as above (ie, xpos - 32) +0xfe80 0x0008 0x8c80 0x4a00 - road width above to left, same width as above (ie, xpos - 32) +0xff80 0x0008 0x8c80 0x4a00 - road width above to left, same width as above (ie, xpos - 32) +0x0001 - road half/width above to left, (ie, xpos - 16) +0x0081 - road width to left as usual (xpos-16 from above, or 32 from above2) + +0xfb0b 0x210b 0x8cf5 0x0dea - blue & left & right, with blue|----|----|----|----|blue +in this mode changing columns 2 & 3 have no apparent effect +0xfb0b 0x7b09 0x8cf5 0x0dea - as above, but scaled up - perhaps 18 pixels shifted (twice that overall size) +0xfb0b 0x6c07 0x8cf5 0x0dea - as above, but scaled up - perhaps 40 pixels shifted from above +0xfb0b 0xaa06 0x8cf5 0x0dea - as above, but scaled up - perhaps 16 pixels shifted from above +0xfb0b 0xb005 0x8cf5 0x0dea - as above, but scaled up - perhaps 38 pixels shifted from above + +b21 diff is 1a6 +97b 20f +76c c2 +6aa fa +5b0 + + +0x0000 0x0008 0xxxxx 0xxxx - line starting at 0 for 128 pixels - 1 to 1 with road pixel data +0xff00 0x0008 0xxxxx 0xxxx - line starting at 32 for 128 pixels - 1 to 1 with road pixel data +0xfe00 0x0008 0xxxxx 0xxxx - line starting at 64 for 128 pixels - 1 to 1 with road pixel data + + + +at standard zoom (0x800) +shift of 0x100 moves 32 pixels +so shift of 8 is assumed to move 1 pixel + +at double zoom (0x1000) +assume shift of 0x100 only moves 16 pixels +so + +0x100 * 0x400 => 0x40 +0x100 * step 0x800 = must come out at 0x20 +0x100 * step 0x1000 = must come out at 0x10 +0x100 * step 0x2000 = 0x5 + +pos is 11.5 fixed point + +-0x580 = middle +-0x180 +-0x080 +0 +0x80 + +*/ + const uint16_t *data = m_road_ctrl_ram; + + // Road layer enable (?) + if ((m_vregs[0x1]&0x1)==0) + return; + + // Road data bank select (double buffered) + if (m_road_vregs[0]&0x10) + data+=0x400; + + // Apply clipping: global screen + local road y offsets + int y = 256 - ((m_vregs[0xa/2] >> 8) + m_road_yclip[0]); + data+=y*4; + + int visible_line=0; + + for ( ; y>8)&0xf; + int step = swapendian_int16(data[1]); + int samplePos=0; + uint16_t const *const linedata=m_road_pixel_ram;// + (0x100 * pal); + int startPos=0, endPos=0; + + int palette_byte;//=m_road_color_ram[visible_line/8]; + + /* + Each road line consists of up to two sets of 128 pixel data that can be positioned + on the x-axis and stretched/compressed on the x-axis. Any screen pixels to the left + of the first set are drawn with pen 0 of the road pixel data. Any screen pixels to the + right of the second set line are drawn with pen 127 of the road pixel data. + + The road control data is laid out as follows (4 words per screen line, with 2 banks): + + Word 0: Line shift for 1st set - 13.3 signed fixed point value. + Word 1: Line scale - 5.11 fixed point value. So 0x800 is 1:1, 0x400 is 1:2, etc + Word 2: Line shift for 2nd set - 13.3 signed fixed point value. + Word 3: ? + + The scale is shared between both pixel sets. The 2nd set is only used when the road + forks into two between stages. The 2nd line shift is an offset from the last pixel + of the 1st set. The 2nd line shift uses a different palette bank. + +2nd road uses upper palette - confirmed by water stage. +offset is from last pixel of first road segment? +//last pixel of first road is really colour from 2nd road line? + + */ + + palette_byte=m_road_color_ram[visible_line/8]; + pal = 4 + ((palette_byte>>(visible_line%8))&1); + + visible_line++; + + if (shift&0x8000) + shift=-(0x10000 - shift); + shift=-shift; + + if (step) + startPos=((shift<<8) + 0x80 )/ step; + + int x; + + /* Fill in left of road segment */ + for (x=0; (x < startPos) && (x < cliprect.max_x+1); x++) + { + int col = linedata[0]&0xf; + bitmap.pix(y, x) = m_palette->pen(256 + pal*16 + col); + } + + /* If startpos is negative, clip it and adjust the sampling position accordingly */ + if (startPos<0) + { + samplePos=step*(0-startPos); + startPos=0; + } + else + { + samplePos=0; + } + + /* Fill in main part of road, then right-hand side edge */ + for (x=startPos; x < (cliprect.max_x + 1) && ((samplePos>>11)<0x80); x++) + { + // look up colour + int col = linedata[(samplePos>>11)&0x7f]&0xf; + + /* Clamp if we have reached the end of the pixel data */ + //if ((samplePos>>11) > 0x7f) + // col=linedata[0x7f]&0xf; + + bitmap.pix(y, x) = m_palette->pen(256 + pal*16 + col); + + samplePos+=step; + } + + /* Now work out how many pixels until start of 2nd segment */ + startPos=x; + + if (shift2&0x8000) + shift2=-(0x10000 - shift2); + shift2=-shift2; + + if (step) + endPos=((shift2<<8) + 0x80) / step; + else + endPos=0; + endPos-=128; + endPos=startPos+endPos; + + /* Fill pixels */ + for (x=startPos; x < (cliprect.max_x+1) && (x < endPos); x++) + { + int col = linedata[0x80]&0xf; + + /* Clamp if we have reached the end of the pixel data */ + //if ((samplePos>>11) > 0x7f) + // col=linedata[0x7f]&0xf; + + bitmap.pix(y, x) = m_palette->pen(256 + pal*16 + col + 32); + } + + if (endPos<0) + { + // end of left intersection (taking right turn) + samplePos=step*(0-startPos); + } + else if (endPos>11)&0x7f) + 0x200]&0xf; + + /* Clamp if we have reached the end of the pixel data */ + if ((samplePos>>11) > 0x7f) + col=linedata[0x7f + 0x200]&0xf; + + bitmap.pix(y, x) = m_palette->pen(256 + pal*16 + col + 32); + + samplePos+=step; + } + data+=4; + } +} + +// background layer landscape for Round Up 5 +// two bitmap layers, back layer is 512 x 128, the other one is 512 x 64 +// it's safe to assume that three monitor version will have a different arrangement here ... +void roundup5_state::draw_landscape(bitmap_rgb32 &bitmap, const rectangle &cliprect, uint8_t type) +{ + // TODO: guess, assume back layer having less scroll increment than front for parallax scrolling. + // also notice that m_vregs[8/2] >> 8 is identical to [0x0c/2], always? + uint16_t x_base = type ? m_bg_scrollx[0] : m_vregs[0xc/2]; + // TODO: maybe [0xa/2] applies here as well? + uint16_t y_base = m_bg_scrolly[0] & 0x1ff; + uint16_t y_scroll = 0x180 - y_base; + uint32_t base_offset; + uint16_t color_base = type ? 0x100 : 0x110; + int ysize = type ? 64 : 128; + + base_offset = 0x10000 + type * 0x8000; + if(type) + y_scroll += 64; + + //popmessage("%04x %04x %04x",m_vregs[8/2],m_vregs[0xc/2],m_bg_scrollx[0]); + + for(int y = 0; y < ysize; y++) + { + for(int x = 0; x < 512; x++) + { + int res_x = (x_base + x) & 0x1ff; + uint32_t color = m_bg_gfxram[(res_x >> 1)+y*256+base_offset]; + + if(res_x & 1) + color >>= 4; + + color &= 0xf; + + if(cliprect.contains(x, y+y_scroll) && color) + bitmap.pix(y+y_scroll, x) = m_palette->pen(color+color_base); + } + } +} + +uint32_t roundup5_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +{ + int tx_start_addr; + + tx_start_addr = (m_hd6445_reg[0xc] << 8) | (m_hd6445_reg[0xd]); + tx_start_addr &= 0x3fff; + + m_sprites->update_cluts(); + + m_tx_layer->set_scrollx(0,24); + m_tx_layer->set_scrolly(0,(tx_start_addr >> 4) | m_hd6445_reg[0x1d]); + + bitmap.fill(m_palette->pen(384), cliprect); // todo + screen.priority().fill(0, cliprect); + m_sprites->draw_sprites(screen.priority(),cliprect,1,(m_sprite_control_ram[0xe0]&0x1000) ? 0x1000 : 0); // Alpha pass only + draw_landscape(bitmap,cliprect,0); + draw_landscape(bitmap,cliprect,1); + draw_road(bitmap,cliprect); + apply_shadow_bitmap(bitmap,cliprect,screen.priority(), 0); + if(m_control_word & 0x80) // enabled on map screen after a play + { + m_tx_layer->draw(screen, bitmap, cliprect, 0,0); + m_sprites->draw_sprites(bitmap,cliprect,0,(m_sprite_control_ram[0xe0]&0x1000) ? 0x1000 : 0); // Full pass + } + else + { + m_sprites->draw_sprites(bitmap,cliprect,0,(m_sprite_control_ram[0xe0]&0x1000) ? 0x1000 : 0); // Full pass + m_tx_layer->draw(screen, bitmap, cliprect, 0,0); + } + return 0; +} + +uint16_t roundup5_state::roundup_v30_z80_r(offs_t offset) +{ + address_space &targetspace = m_audiocpu->space(AS_PROGRAM); + + /* Each Z80 byte maps to a V30 word */ + if (m_control_word & 0x20) + offset += 0x8000; /* Upper half */ + + return 0xff00 | targetspace.read_byte(offset); +} + +void roundup5_state::roundup_v30_z80_w(offs_t offset, uint16_t data, uint16_t mem_mask) +{ + address_space &targetspace = m_audiocpu->space(AS_PROGRAM); + + /* Only 8 bits of the V30 data bus are connected - ignore writes to the other half */ + if (ACCESSING_BITS_0_7) + { + if (m_control_word & 0x20) + offset += 0x8000; /* Upper half of Z80 address space */ + + targetspace.write_byte(offset, data & 0xff); + } +} + + +void roundup5_state::roundup5_control_w(offs_t offset, uint16_t data, uint16_t mem_mask) +{ + COMBINE_DATA(&m_control_word); + + if (m_control_word & 0x10) + m_subcpu->set_input_line(INPUT_LINE_HALT, ASSERT_LINE); + else + m_subcpu->set_input_line(INPUT_LINE_HALT, CLEAR_LINE); + + if (m_control_word & 0x4) + m_audiocpu->set_input_line(INPUT_LINE_HALT, ASSERT_LINE); + else + m_audiocpu->set_input_line(INPUT_LINE_HALT, CLEAR_LINE); + +// if (offset == 1 && (tatsumi_control_w & 0xfeff) != (last_bank & 0xfeff)) +// logerror("%s: Changed bank to %04x (%d)\n", m_maincpu->pc(), tatsumi_control_w,offset); + +//todo - watchdog + + /* Bank: + + 0x0017 : OBJ banks + 0x0018 : 68000 RAM mask 0x0380 used to save bits when writing + 0x0c10 : 68000 ROM + + 0x0040 : Z80 rom (lower half) mapped to 0x10000 + 0x0060 : Z80 rom (upper half) mapped to 0x10000 + + 0x0080 : enabled when showing map screen after a play + (switches video priority between text layer and sprites) + + 0x0100 : watchdog. + + 0x0c00 : vram bank (bits 0x7000 also set when writing vram) + + 0x8000 : set whenever writing to palette ram? + + Changed bank to 0060 (0) + */ + + if ((m_control_word & 0x8) == 0 && !(m_last_control & 0x8)) + m_subcpu->set_input_line(INPUT_LINE_IRQ4, ASSERT_LINE); +// if (tatsumi_control_w&0x200) +// cpu_set_reset_line(1, CLEAR_LINE); +// else +// cpu_set_reset_line(1, ASSERT_LINE); + +// if ((tatsumi_control_w&0x200) && (last_bank&0x200)==0) +// logerror("68k irq\n"); +// if ((tatsumi_control_w&0x200)==0 && (last_bank&0x200)==0x200) +// logerror("68k reset\n"); + + if (m_control_word == 0x3a00) + { +// cpu_set_reset_line(1, CLEAR_LINE); +// logerror("68k on\n"); + } + + m_last_control = m_control_word; +} + +void roundup5_state::road_vregs_w(offs_t offset, uint16_t data, uint16_t mem_mask) +{ + /* + ---- ---x ---- ---- enabled when there's a road slope of any kind, unknown purpose + ---- ---- -xx- ---- enables alternatively in tunnels sometimes, color mods? + ---- ---- ---x ---- road bank select + ---- ---- ---- xxxx various values written during POST while accessing road pixel ram, + otherwise 0xb at the start of irq service + */ + + COMBINE_DATA(&m_road_vregs[offset]); + + m_subcpu->set_input_line(INPUT_LINE_IRQ4, CLEAR_LINE); // guess, probably wrong +// logerror("d_68k_e0000_w %s %04x\n", m_maincpu->pc(), data); +} + +void roundup5_state::output_w(uint8_t data) +{ + /* + ---- x--- depending on Output Mode dipswitch: + A Mode: enables when police siren is on + B Mode: enables when player collides with objects or go offroad + ---- -x-- start button light + ---- --xx coin counters + */ + // avoid spurious write to coin counters + if(data == 0xff) + return; + + machine().bookkeeping().coin_counter_w(0, data & 1); + machine().bookkeeping().coin_counter_w(1, data & 2); + + if(data & 0xf0) + logerror("output_w = %02x\n",data); +} + + +void roundup5_state::roundup5_v30_map(address_map &map) +{ + map(0x00000, 0x07fff).ram(); + map(0x08000, 0x0bfff).ram().w(FUNC(roundup5_state::text_w)).share("videoram"); + map(0x0c000, 0x0c003).w(FUNC(roundup5_state::hd6445_crt_w)).umask16(0x00ff); + map(0x0d000, 0x0d001).portr("DSW"); + map(0x0d400, 0x0d40f).ram().share("vregs"); + map(0x0d800, 0x0d801).writeonly().share("bg_scrollx"); + map(0x0dc00, 0x0dc01).writeonly().share("bg_scrolly"); + map(0x0e000, 0x0e001).w(FUNC(roundup5_state::roundup5_control_w)); + map(0x0f000, 0x0ffff).rw(m_palette, FUNC(palette_device::read8), FUNC(palette_device::write8)).umask16(0x00ff).share("palette"); + map(0x10000, 0x1ffff).rw(FUNC(roundup5_state::roundup_v30_z80_r), FUNC(roundup5_state::roundup_v30_z80_w)); + map(0x20000, 0x2ffff).rw(FUNC(roundup5_state::tatsumi_v30_68000_r), FUNC(roundup5_state::tatsumi_v30_68000_w)); + map(0x30000, 0x3ffff).rw(FUNC(roundup5_state::gfxdata_r), FUNC(roundup5_state::gfxdata_w)).umask16(0x00ff); + map(0x80000, 0xfffff).rom().region("master_rom", 0); +} + +void roundup5_state::roundup5_68000_map(address_map &map) +{ + map(0x00000, 0x7ffff).rom().region("slave_rom", 0); + map(0x80000, 0x83fff).ram().share("sharedram"); + map(0x90000, 0x93fff).ram().share("spriteram"); + map(0x9a000, 0x9a1ff).rw(FUNC(roundup5_state::tatsumi_sprite_control_r), FUNC(roundup5_state::tatsumi_sprite_control_w)).share("obj_ctrl_ram"); + map(0xa0000, 0xa0fff).ram().share("road_ctrl_ram"); // Road control data + map(0xb0000, 0xb0fff).ram().share("road_pixel_ram"); // Road pixel data + map(0xc0000, 0xc0fff).ram().share("road_color_ram"); // Road colour data + map(0xd0000, 0xd0001).ram().share("road_yclip"); + map(0xe0000, 0xe0001).ram().w(FUNC(roundup5_state::road_vregs_w)).share("road_vregs"); +} + +void roundup5_state::roundup5_z80_map(address_map &map) +{ + map(0x0000, 0xdfff).rom(); + map(0xe000, 0xffef).ram(); + map(0xfff0, 0xfff1).rw(m_ym2151, FUNC(ym2151_device::read), FUNC(ym2151_device::write)); + map(0xfff4, 0xfff4).r(m_oki, FUNC(okim6295_device::read)).w(m_oki, FUNC(okim6295_device::write)); + map(0xfff8, 0xfffb).rw("ppi", FUNC(i8255_device::read), FUNC(i8255_device::write)); + map(0xfffc, 0xfffc).portr("STICKX"); +} + + +static INPUT_PORTS_START( roundup5 ) + PORT_START("IN0") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_NAME("Accelerator") + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_NAME("Brake") + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) PORT_NAME("Shift") PORT_TOGGLE + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1) PORT_NAME("Turbo") + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1 ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) + + PORT_START("IN1") + PORT_SERVICE_NO_TOGGLE( 0x01, IP_ACTIVE_LOW ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN1 ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN2 ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE1 ) + // Tested in service mode, probably unused + PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW-3:1") + PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW-3:2") + PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW-3:3") + PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW-3:4") + PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + + PORT_START("STICKX") + PORT_BIT( 0xff, 0x7f, IPT_AD_STICK_X ) PORT_SENSITIVITY(25) PORT_KEYDELTA(15) PORT_PLAYER(1) + + PORT_START("DSW") /* Verified by Manual & in Game service menu */ + PORT_DIPNAME( 0x0003, 0x0000, DEF_STR( Game_Time ) ) PORT_DIPLOCATION("SW-1:1,2") + PORT_DIPSETTING( 0x0003, "Shortest" ) + PORT_DIPSETTING( 0x0002, "Short" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Medium ) ) + PORT_DIPSETTING( 0x0001, "Long" ) + PORT_DIPNAME( 0x000c, 0x0000, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW-1:3,4") + PORT_DIPSETTING( 0x0004, DEF_STR( Easy ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( Medium ) ) + PORT_DIPSETTING( 0x0008, DEF_STR( Hard ) ) + PORT_DIPSETTING( 0x000c, DEF_STR( Hardest ) ) + PORT_DIPNAME( 0x0010, 0x0000, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW-1:5") + PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0020, 0x0000, DEF_STR( Language ) ) PORT_DIPLOCATION("SW-1:6") + PORT_DIPSETTING( 0x0020, DEF_STR( Japanese ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( English ) ) + PORT_DIPNAME( 0x0040, 0x0000, "Stage 5 Continue" ) PORT_DIPLOCATION("SW-1:7") + PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0080, 0x0000, "Output Mode" ) PORT_DIPLOCATION("SW-1:8") + PORT_DIPSETTING( 0x0000, "A (Light)" ) + PORT_DIPSETTING( 0x0080, "B (Vibration)" ) + // TODO: Coinage was all wrong, maybe manual refers to an undumped version? + PORT_DIPNAME( 0x0700, 0x0000, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW-2:1,2,3") + PORT_DIPSETTING( 0x0200, DEF_STR( 3C_1C ) ) + PORT_DIPSETTING( 0x0100, DEF_STR( 2C_1C ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( 1C_1C ) ) + PORT_DIPSETTING( 0x0700, DEF_STR( 3C_2C ) ) + PORT_DIPSETTING( 0x0600, DEF_STR( 2C_3C ) ) + PORT_DIPSETTING( 0x0300, DEF_STR( 1C_2C ) ) + PORT_DIPSETTING( 0x0400, DEF_STR( 1C_5C ) ) + PORT_DIPSETTING( 0x0500, DEF_STR( 1C_6C ) ) + PORT_DIPNAME( 0x3800, 0x0000, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW-2:4,5,6") + PORT_DIPSETTING( 0x3000, DEF_STR( 4C_1C ) ) + PORT_DIPSETTING( 0x3800, DEF_STR( 4C_3C ) ) + PORT_DIPSETTING( 0x0800, DEF_STR( 2C_1C ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( 1C_1C ) ) + PORT_DIPSETTING( 0x1000, DEF_STR( 1C_2C ) ) + PORT_DIPSETTING( 0x1800, DEF_STR( 1C_3C ) ) + PORT_DIPSETTING( 0x2000, DEF_STR( 1C_4C ) ) + PORT_DIPSETTING( 0x2800, DEF_STR( 1C_5C ) ) + PORT_DIPNAME( 0x4000, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW-2:7") /* Manual only shows nothing for this one */ + PORT_DIPSETTING( 0x4000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + // putting this and sw-2:6 ON position after POST to enable debugging info + PORT_DIPNAME( 0x8000, 0x8000, "Hardware Test Mode" ) PORT_DIPLOCATION("SW-2:8") /* Manual only shows nothing for this one */ + PORT_DIPSETTING( 0x8000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) +INPUT_PORTS_END + +static const gfx_layout roundup5_vramlayout = +{ + 8,8, + 4096, + 3, + { 0x10000 * 8, 0x8000 * 8, 0 }, + { STEP8(0,1) }, + { STEP8(0,8) }, + 8*8 +}; + +static GFXDECODE_START( gfx_roundup5 ) + GFXDECODE_RAM( nullptr, 0, roundup5_vramlayout, 0, 16) +GFXDECODE_END + + +void roundup5_state::roundup5(machine_config &config) +{ + /* basic machine hardware */ + V30(config, m_maincpu, roundup5_state::CLOCK_1 / 2); + m_maincpu->set_addrmap(AS_PROGRAM, &roundup5_state::roundup5_v30_map); + m_maincpu->set_vblank_int("screen", FUNC(roundup5_state::v30_interrupt)); + + M68000(config, m_subcpu, roundup5_state::CLOCK_2 / 4); + m_subcpu->set_addrmap(AS_PROGRAM, &roundup5_state::roundup5_68000_map); + + Z80(config, m_audiocpu, roundup5_state::CLOCK_1 / 4); + m_audiocpu->set_addrmap(AS_PROGRAM, &roundup5_state::roundup5_z80_map); + + config.set_maximum_quantum(attotime::from_hz(6000)); + + i8255_device &ppi(I8255(config, "ppi")); + ppi.in_pa_callback().set_ioport("IN0"); + ppi.in_pb_callback().set_ioport("IN1"); + ppi.out_pc_callback().set(FUNC(roundup5_state::output_w)); + + /* video hardware */ + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); + screen.set_raw(roundup5_state::CLOCK_2 / 8, 400, 0, 320, 272, 0, 240); // TODO: Hook up CRTC + screen.set_screen_update(FUNC(roundup5_state::screen_update)); + + TZB315_SPRITES(config, m_sprites, 0, 0x800); // confirmed TZB315, even if it has the smaller CLUT like Apache 3 / TZB215 + m_sprites->set_sprite_palette_base(512); + m_sprites->set_palette("sprites:palette_clut"); + m_sprites->set_basepalette(m_palette); + m_sprites->set_spriteram(m_spriteram); + + GFXDECODE(config, m_gfxdecode, m_palette, gfx_roundup5); + PALETTE(config, m_palette).set_format(palette_device::xRGB_555, 1024); // 1024 real colours + m_palette->set_membits(8).set_endianness(ENDIANNESS_BIG); + + /* sound hardware */ + SPEAKER(config, "lspeaker").front_left(); + SPEAKER(config, "rspeaker").front_right(); + + YM2151(config, m_ym2151, roundup5_state::CLOCK_1 / 4); + m_ym2151->irq_handler().set_inputline(m_audiocpu, INPUT_LINE_IRQ0); + m_ym2151->add_route(0, "lspeaker", 0.45); + m_ym2151->add_route(1, "rspeaker", 0.45); + + OKIM6295(config, m_oki, roundup5_state::CLOCK_1 / 4 / 2, okim6295_device::PIN7_HIGH); + m_oki->add_route(ALL_OUTPUTS, "lspeaker", 0.75); + m_oki->add_route(ALL_OUTPUTS, "rspeaker", 0.75); +} + + +ROM_START( roundup5 ) + ROM_REGION16_LE( 0x80000, "master_rom", 0 ) /* v30 main cpu */ + ROM_LOAD16_BYTE( "ru-23s", 0x000000, 0x20000, CRC(2dc8c521) SHA1(b78de101db3ef00fc4375ae32a7871e0da2dac6c) ) + ROM_LOAD16_BYTE( "ru-26s", 0x000001, 0x20000, CRC(1e16b531) SHA1(d7badef29cf1c4a9bd262933ecd1ca3343ea94bd) ) + ROM_LOAD16_BYTE( "ru-22t", 0x040000, 0x20000, CRC(9611382e) SHA1(c99258782dbad6d69ba7f54115ee3aa218f9b6ee) ) + ROM_LOAD16_BYTE( "ru-25t", 0x040001, 0x20000, CRC(b6cd0f2d) SHA1(61925c2346d79baaf9bce3d19a7dfc45b8232f92) ) + + ROM_REGION16_BE( 0x80000, "slave_rom", 0 ) /* 68000 sub cpu */ + ROM_LOAD16_BYTE( "ru-20s", 0x000000, 0x20000, CRC(c5524558) SHA1(a94e7e4548148c83a332524ab4e06607732e13d5) ) + ROM_LOAD16_BYTE( "ru-18s", 0x000001, 0x20000, CRC(163ef03d) SHA1(099ac2d74164bdc6402b08efb521f49275780858) ) + ROM_LOAD16_BYTE( "ru-21s", 0x040000, 0x20000, CRC(b9f91b70) SHA1(43c5d9dafb60ed3e5c3eb0e612c2dbc5497f8a6c) ) + ROM_LOAD16_BYTE( "ru-19s", 0x040001, 0x20000, CRC(e3953800) SHA1(28fbc6bf154b512fcefeb04fe12db598b1b20cfe) ) + + ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k code for sound Z80 */ + ROM_LOAD( "ru-28d", 0x000000, 0x10000, CRC(df36c6c5) SHA1(c046482043f6b54c55696ba3d339ffb11d78f674) ) + + ROM_REGION( 0x0c0000, "sprites:sprites_l", 0) + ROM_LOAD32_BYTE( "ru-00b", 0x000000, 0x20000, CRC(388a0647) SHA1(e4ab43832872f44c0fe1aaede4372cc00ca7d32b) ) + ROM_LOAD32_BYTE( "ru-02b", 0x000001, 0x20000, CRC(eff33945) SHA1(3f4c3aaa11ccf945c2f898dfdf815705d8539e21) ) + ROM_LOAD32_BYTE( "ru-04b", 0x000002, 0x20000, CRC(40fda247) SHA1(f5fbc07fda024baedf35ac209210e94df9f15065) ) + ROM_LOAD32_BYTE( "ru-06b", 0x000003, 0x20000, CRC(cd2484f3) SHA1(a23a4d36a8b913104bcc75228317b2979afec888) ) + ROM_LOAD32_BYTE( "ru-01b", 0x080000, 0x10000, CRC(5e91f401) SHA1(df976c5ba0f14b14f5642b5ca35b996bca64e369) ) + ROM_LOAD32_BYTE( "ru-03b", 0x080001, 0x10000, CRC(2fb109de) SHA1(098c103e6bae0f52ec66f0cdda2da60bd7108736) ) + ROM_LOAD32_BYTE( "ru-05b", 0x080002, 0x10000, CRC(23dd10e1) SHA1(f30ff1a8c7ed9bc567b901cbdd202028fffb9f80) ) + ROM_LOAD32_BYTE( "ru-07b", 0x080003, 0x10000, CRC(bb40f46e) SHA1(da694e16d19f60a0dee47551f00f3e50b2d5dcaf) ) + + ROM_REGION( 0x0c0000, "sprites:sprites_h", 0) + ROM_LOAD32_BYTE( "ru-08b", 0x000000, 0x20000, CRC(01729e3c) SHA1(1445287fde0b993d053aab73efafc902a6b7e2cc) ) + ROM_LOAD32_BYTE( "ru-10b", 0x000001, 0x20000, CRC(cd2357a7) SHA1(313460a74244325ce2c659816f2b738f3dc5358a) ) + ROM_LOAD32_BYTE( "ru-12b", 0x000002, 0x20000, CRC(ca63b1f8) SHA1(a50ef8259745dc166eb0a1b2c812ff620818a755) ) + ROM_LOAD32_BYTE( "ru-14b", 0x000003, 0x20000, CRC(dde79bfc) SHA1(2d5888189a6f954801f248a3365e328370fed837) ) + ROM_LOAD32_BYTE( "ru-09b", 0x080000, 0x10000, CRC(629ac0a6) SHA1(c3eeccd6c07be7455cf180c9c7d5efcd6d08c0b5) ) + ROM_LOAD32_BYTE( "ru-11b", 0x080001, 0x10000, CRC(fe3fbf53) SHA1(7400c088025ac22e5d9db816792533fc02f2dcf5) ) + ROM_LOAD32_BYTE( "ru-13b", 0x080002, 0x10000, CRC(d0f6e747) SHA1(ef15ed41124b2d37bc6e92254138690dd644e50f) ) + ROM_LOAD32_BYTE( "ru-15b", 0x080003, 0x10000, CRC(6ee6b22e) SHA1(a28edaf23ca6c7231264de962d5ea37bad39f996) ) + + ROM_REGION( 0x40000, "oki", 0 ) /* ADPCM samples */ + ROM_LOAD( "ru-17b", 0x000000, 0x20000, CRC(82391b47) SHA1(6b1977522c6e906503abc50bdd24c4c38cdc9bdb) ) + ROM_LOAD( "ru-16b", 0x020000, 0x10000, CRC(374fe170) SHA1(5d190a2735698b0384948bfdb1a900f56f0d7ebc) ) +ROM_END + +} // anonymous namespace + +GAMEL(1989, roundup5, 0, roundup5, roundup5, roundup5_state, init_tatsumi, ROT0, "Tatsumi", "Round Up 5 - Super Delta Force", MACHINE_IMPERFECT_GRAPHICS | MACHINE_NOT_WORKING, layout_roundup5 ) diff --git a/src/mame/tatsumi/tatsumi.cpp b/src/mame/tatsumi/tatsumi.cpp index 6bae4b2cbd5a6..9306d5f9fc850 100644 --- a/src/mame/tatsumi/tatsumi.cpp +++ b/src/mame/tatsumi/tatsumi.cpp @@ -2,10 +2,10 @@ // copyright-holders:Bryan McPhail, Angelo Salese /*************************************************************************** - Apache 3 ATF-011 - Round Up 5 ATC-011 - Cycle Warriors ABA-011 - Big Fight ABA-011 + This is a common base for apache3.cpp, roundup5.cpp and cyclwarr.cpp + + Gray Out (from 1987) is likely a similar setup + http://www.tatsu-mi.co.jp/game/trace/index.html Incredibly complex hardware! These are all different boards, but share a similar sprite chip (TZB215 on Apache 3, TZB315 on others). Other @@ -13,143 +13,11 @@ TODO: - Sprite rotation - - Round Up 5: Finish road layer. - Tunnel sections are borderline unplayable, plus slopes are ugly to watch. - - Apache 3: road layer, has twelve rotation registers! - - (fixed) Cycle Warriors: transparent road layer on sidelines, wrong mask_data? - - (fixed) Missing BG layer (Round Up 5) - banked VRAM data from somewhere!? - - Round Up 5: always boots with a coin inserted - $5152 is the coin counter, gets an explicit 1 at boot. - There are other two buffers read from 68k before that, written to $5156 and $515a - If these are 0xffff by then game boots normally ... - - (fixed) Round Up 5 doesn't survive a reset - - (fixed?) Cycle Warriors: test mode text does not appear as it needs a -256 Y - scroll offset from somewhere. - - (fixed) Cycle Warriors: sometimes it draws garbage on character select or even hangs - depending on where player coins up, most likely caused by miscommunication with sub CPU? - - (fixed) Cycle Warriors: ranking screen is completely wrong; - - (fixed) Cycle Warriors: ugly orange color on character select and briefing screens, layer disable? - - Combine Big Fight & CycleWarriors video routines - currently each - game uses different sized tilemaps - these are probably software - controlled rather than hardwired, but I don't think either game - changes the size at runtime. - Split these games into individual drivers, write new devices for video routines. - Dip switches - Deviceify HD6445 (superset of 6845) - Various other things.. - - reference of bigfight : https://youtu.be/aUUoUCr6yhk - - Emulation by Bryan McPhail, mish@tendril.co.uk - - - Cycle Warriors Board Layout - - ABA-011 - - - 6296 CW24A 5864 - CW25A 5864 - YM2151 50MHz - - TZ8315 CW26A - 5864 - TC51821 TC51832 D780C-1 - TC51821 TC51832 - TC51821 TC51832 16MHz - TC51821 TC51832 - - CW00A CW08A - CW01A CW09A - CW02A CW10A - CW03A CW11A 68000-12 81C78 - CW04A CW12A 81C78 - CW05A CW13A CW16B CW18B 65256 - CW06A CW14A CW17A CW19A 65256 - CW07A CW15A CW20A - CW21 65256 - 68000-12 CW22A 65256 - CW23 - - ABA-012 - - HD6445 - - - 51832 - 51832 - 51832 - 51832 - - CW28 - CW29 - CW30 - - CW27 - - Big Fight - Tatsumi, 1992 - - PCB Layout - ---------- - - ABA-011 - A-8 - |-----------------------------------------------------------------| - | LM324 M6295 ROM15 TC5563 | - |LM324 VOL KA51 50MHz TC5563 PAL |-|| - | TC51832 TC51832 |--------| | || - | TC51832 TC51832 |TATSUMI | | || - | TC51832 TC51832 |TZB315 | ROM20 | || - | TC51832 TC51832 | | TMM2063 | || - | ROM0 ROM8 |--------| Z80B | || - | | || - |J PAL 16MHz |-|| - |A ROM2 ROM10 |--------------| PAL | - |M | 68000 | TMM2088 | - |M |--------------| | - |A ROM4 ROM12 TMM2088 | - | ROM16 ROM17 |-|| - | PAL PAL TC51832 | || - | ROM6 ROM14 ROM18 | || - | EPL204 PAL TC51832 | || - | |--------------| | || - | CXD1095Q CXD1095Q | 68000 | ROM19 TC51832 | || - | |--------------| | || - | TC51832 |-|| - | DSW3(4) DSW2(8) DSW1(8) | - |-----------------------------------------------------------------| - Z80 clock - 4.000MHz [16/4] - 68k clocks - 12.500MHz [50/4] - M6295 clock - 2.000MHz [16/8]. Sample rate = 2000000/132 - YM2151 clock - 4.000MHz [16/4] - - |-------------------------| - | D65005(x16) | - |ROM21 |-|| - | | || - | | || - | | || - | | || - | | || - | | || - |PAL |-|| - | ROM24 PAL PAL| - | ROM23 HD6445 | - | ROM22 | - | TC51832(x4) | - | PAL |-|| - | PAL | || - | | || - | | || - | | || - | | || - | | || - | |-|| - |PAL | - |-------------------------| - ***************************************************************************/ #include "emu.h" @@ -163,686 +31,134 @@ #include "screen.h" #include "speaker.h" -#include "roundup5.lh" - - -#define CLOCK_1 XTAL(16'000'000) -#define CLOCK_2 XTAL(50'000'000) - - -/***************************************************************************/ - - -void cyclwarr_state::cyclwarr_sound_w(uint8_t data) -{ - m_soundlatch->write(data); - m_audiocpu->pulse_input_line(INPUT_LINE_NMI, attotime::zero); -} - - -uint16_t cyclwarr_state::cyclwarr_sprite_r(offs_t offset) +void tatsumi_state::hd6445_crt_w(offs_t offset, uint8_t data) { - return m_spriteram[offset]; -} - -void cyclwarr_state::cyclwarr_sprite_w(offs_t offset, uint16_t data, uint16_t mem_mask) -{ - COMBINE_DATA(&m_spriteram[offset]); -} - -void cyclwarr_state::bigfight_a40000_w(offs_t offset, uint16_t data, uint16_t mem_mask) -{ - COMBINE_DATA(&m_bigfight_a40000[offset]); -} - -template -uint16_t cyclwarr_state::cyclwarr_videoram_r(offs_t offset) -{ - return m_cyclwarr_videoram[Bank][offset]; -} - -template -void cyclwarr_state::cyclwarr_videoram_w(offs_t offset, uint16_t data, uint16_t mem_mask) -{ - COMBINE_DATA(&m_cyclwarr_videoram[Bank][offset]); - m_layer[(Bank<<1)|0]->mark_tile_dirty(offset); - m_layer[(Bank<<1)|1]->mark_tile_dirty(offset); + if (offset==0) + m_hd6445_address = data & 0x3f; + if (offset==1) + { + m_hd6445_reg[m_hd6445_address] = data; + + static char const *const regnames[40] = + { + "Horizontal Total Characters", "Horizontal Displayed Characters", "Horizontal Sync Position", "Sync Width", + "Vertical Total Rows", "Vertical Total Adjust", "Vertical Displayed Rows", "Vertical Sync Position", + "Interlace Mode and Skew", "Max Raster Address", "Cursor 1 Start", "Cursor 1 End", + "Screen 1 Start Address (H)", "Screen 1 Start Address (L)", "Cursor 1 Address (H)", "Cursor 1 Address (L)", + "Light Pen (H) (RO)", "Light Pen (L) (RO)", "Screen 2 Start Position", "Screen 2 Start Address (H)", + "Screen 2 Start Address (L)", "Screen 3 Start Position", "Screen 3 Start Address (H)", "Screen 3 Start Address (L)", + "Screen 4 Start Position", "Screen 4 Start Address (H)", "Screen 4 Start Address (L)", "Vertical Sync Position Adjust", + "Light Pen Raster (RO)", "Smooth Scrolling", "Control 1", "Control 2", + "Control 3", "Memory Width Offset", "Cursor 2 Start", "Cursor 2 End", + "Cursor 2 Address (H)", "Cursor 2 Address (L)", "Cursor 1 Width", "Cursor 2 Width" + }; + + if(m_hd6445_address < 40) + logerror("HD6445: register %s [%02x R%d] set %02x\n",regnames[m_hd6445_address],m_hd6445_address,m_hd6445_address,data); + else + logerror("HD6445: illegal register access [%02x R%d] set %02x\n",m_hd6445_address,m_hd6445_address,data); + } } -void cyclwarr_state::output_w(offs_t offset, uint16_t data, uint16_t mem_mask) +uint16_t tatsumi_state::tatsumi_sprite_control_r(offs_t offset) { - machine().bookkeeping().coin_counter_w(0, data & 1); - machine().bookkeeping().coin_counter_w(1, data & 2); - if(data & 0xfffc) - logerror("output_w = %04x & %04x\n",data,mem_mask); + return m_sprite_control_ram[offset]; } -void roundup5_state::output_w(uint8_t data) +void tatsumi_state::tatsumi_sprite_control_w(offs_t offset, uint16_t data, uint16_t mem_mask) { - /* - ---- x--- depending on Output Mode dipswitch: - A Mode: enables when police siren is on - B Mode: enables when player collides with objects or go offroad - ---- -x-- start button light - ---- --xx coin counters - */ - // avoid spurious write to coin counters - if(data == 0xff) - return; - - machine().bookkeeping().coin_counter_w(0, data & 1); - machine().bookkeeping().coin_counter_w(1, data & 2); + COMBINE_DATA(&m_sprite_control_ram[offset]); - if(data & 0xf0) - logerror("output_w = %02x\n",data); + /* 0xe0 is bank switch, others unknown */ +// if ((offset==0xe0 && data&0xefff) || offset!=0xe0) +// logerror("%s: Tatsumi TZB215 sprite control %04x %08x\n", m_maincpu->pc(), offset, data); } -/***************************************************************************/ - -void apache3_state::apache3_v30_map(address_map &map) +// apply shadowing to underlying layers +// TODO: it might mix up with the lower palette bank instead (color bank 0x1400?) +void tatsumi_state::apply_shadow_bitmap(bitmap_rgb32 &bitmap, const rectangle &cliprect, bitmap_ind8 &shadow_bitmap, uint8_t xor_output) { - map(0x00000, 0x03fff).ram(); - map(0x04000, 0x07fff).ram().share("nvram"); - map(0x08000, 0x08fff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); - map(0x0c000, 0x0dfff).ram().w(FUNC(apache3_state::text_w)).share("videoram"); - map(0x0e800, 0x0e803).w(FUNC(tatsumi_state::hd6445_crt_w)).umask16(0x00ff); - map(0x0f000, 0x0f001).portr("DSW"); - map(0x0f000, 0x0f001).nopw(); // todo - map(0x0f800, 0x0f801).rw(FUNC(apache3_state::apache3_bank_r), FUNC(apache3_state::apache3_bank_w)); - map(0x10000, 0x1ffff).rw(FUNC(apache3_state::apache3_v30_v20_r), FUNC(apache3_state::apache3_v30_v20_w)); - map(0x20000, 0x2ffff).rw(FUNC(apache3_state::tatsumi_v30_68000_r), FUNC(apache3_state::tatsumi_v30_68000_w)); - map(0x80000, 0xfffff).rom().region("master_rom", 0); -} - -void apache3_state::apache3_68000_map(address_map &map) -{ - map(0x00000, 0x7ffff).rom().region("slave_rom", 0); - map(0x80000, 0x83fff).ram().share("sharedram"); - map(0x90000, 0x93fff).ram().share("spriteram"); - map(0x9a000, 0x9a1ff).rw(FUNC(apache3_state::tatsumi_sprite_control_r), FUNC(apache3_state::tatsumi_sprite_control_w)).share("obj_ctrl_ram"); - map(0xa0000, 0xa0001).w(FUNC(apache3_state::apache3_rotate_w)); // /BNKCS - map(0xb0000, 0xb0001).w(FUNC(apache3_state::apache3_z80_ctrl_w)); - map(0xc0000, 0xc0001).w(FUNC(apache3_state::apache3_road_z_w)); // /LINCS - map(0xd0000, 0xdffff).ram().share("apache3_g_ram"); // /GRDCS - map(0xe0000, 0xe7fff).rw(FUNC(apache3_state::apache3_z80_r), FUNC(apache3_state::apache3_z80_w)); -} - -void apache3_state::apache3_v20_map(address_map &map) -{ - map(0x00000, 0x01fff).ram(); - map(0x04000, 0x04003).rw("ppi", FUNC(i8255_device::read), FUNC(i8255_device::write)); - map(0x06000, 0x06001).portr("IN0"); // esw - map(0x08000, 0x08001).rw(m_ym2151, FUNC(ym2151_device::read), FUNC(ym2151_device::write)); - map(0x0a000, 0x0a000).r(m_oki, FUNC(okim6295_device::read)).w(m_oki, FUNC(okim6295_device::write)); - map(0x0e000, 0x0e007).rw("adc", FUNC(adc0808_device::data_r), FUNC(adc0808_device::address_offset_start_w)); - map(0xf0000, 0xfffff).rom().region("sound_rom", 0); + for(int y=cliprect.min_y;y> 1,shadow_pen.g() >> 1, shadow_pen.b() >> 1); + } + } + } } -void apache3_state::apache3_z80_map(address_map &map) +void tatsumi_state::text_w(offs_t offset, uint16_t data, uint16_t mem_mask) { - map(0x0000, 0x1fff).ram().share("apache3_z80_ram"); - map(0x8000, 0xffff).w(FUNC(apache3_state::apache3_road_x_w)); + COMBINE_DATA(&m_videoram[offset]); + m_tx_layer->mark_tile_dirty(offset); } -/*****************************************************************/ - -void roundup5_state::roundup5_v30_map(address_map &map) +TILE_GET_INFO_MEMBER(tatsumi_state::get_text_tile_info) { - map(0x00000, 0x07fff).ram(); - map(0x08000, 0x0bfff).ram().w(FUNC(roundup5_state::text_w)).share("videoram"); - map(0x0c000, 0x0c003).w(FUNC(tatsumi_state::hd6445_crt_w)).umask16(0x00ff); - map(0x0d000, 0x0d001).portr("DSW"); - map(0x0d400, 0x0d40f).ram().share("vregs"); - map(0x0d800, 0x0d801).writeonly().share("bg_scrollx"); - map(0x0dc00, 0x0dc01).writeonly().share("bg_scrolly"); - map(0x0e000, 0x0e001).w(FUNC(roundup5_state::roundup5_control_w)); - map(0x0f000, 0x0ffff).rw(m_palette, FUNC(palette_device::read8), FUNC(palette_device::write8)).umask16(0x00ff).share("palette"); - map(0x10000, 0x1ffff).rw(FUNC(roundup5_state::roundup_v30_z80_r), FUNC(roundup5_state::roundup_v30_z80_w)); - map(0x20000, 0x2ffff).rw(FUNC(roundup5_state::tatsumi_v30_68000_r), FUNC(roundup5_state::tatsumi_v30_68000_w)); - map(0x30000, 0x3ffff).rw(FUNC(roundup5_state::gfxdata_r), FUNC(roundup5_state::gfxdata_w)).umask16(0x00ff); - map(0x80000, 0xfffff).rom().region("master_rom", 0); + int tile = m_videoram[tile_index]; + tileinfo.set(0, tile & 0xfff, tile >> 12, 0); } -void roundup5_state::roundup5_68000_map(address_map &map) +void tatsumi_state::tatsumi_reset() { - map(0x00000, 0x7ffff).rom().region("slave_rom", 0); - map(0x80000, 0x83fff).ram().share("sharedram"); - map(0x90000, 0x93fff).ram().share("spriteram"); - map(0x9a000, 0x9a1ff).rw(FUNC(roundup5_state::tatsumi_sprite_control_r), FUNC(roundup5_state::tatsumi_sprite_control_w)).share("obj_ctrl_ram"); - map(0xa0000, 0xa0fff).ram().share("road_ctrl_ram"); // Road control data - map(0xb0000, 0xb0fff).ram().share("road_pixel_ram"); // Road pixel data - map(0xc0000, 0xc0fff).ram().share("road_color_ram"); // Road colour data - map(0xd0000, 0xd0001).ram().share("road_yclip"); - map(0xe0000, 0xe0001).ram().w(FUNC(roundup5_state::road_vregs_w)).share("road_vregs"); -} + m_last_control = 0; + m_control_word = 0; -void roundup5_state::roundup5_z80_map(address_map &map) -{ - map(0x0000, 0xdfff).rom(); - map(0xe000, 0xffef).ram(); - map(0xfff0, 0xfff1).rw(m_ym2151, FUNC(ym2151_device::read), FUNC(ym2151_device::write)); - map(0xfff4, 0xfff4).r(m_oki, FUNC(okim6295_device::read)).w(m_oki, FUNC(okim6295_device::write)); - map(0xfff8, 0xfffb).rw("ppi", FUNC(i8255_device::read), FUNC(i8255_device::write)); - map(0xfffc, 0xfffc).portr("STICKX"); + save_item(NAME(m_last_control)); + save_item(NAME(m_control_word)); } -/******************************************************************************/ - -void cyclwarr_state::common_map(address_map &map) +uint16_t tatsumi_state::tatsumi_v30_68000_r(offs_t offset) { - map(0x080000, 0x08ffff).rw(FUNC(cyclwarr_state::cyclwarr_videoram_r<1>), FUNC(cyclwarr_state::cyclwarr_videoram_w<1>)).share("cw_videoram1"); - map(0x090000, 0x09ffff).rw(FUNC(cyclwarr_state::cyclwarr_videoram_r<0>), FUNC(cyclwarr_state::cyclwarr_videoram_w<0>)).share("cw_videoram0"); - - map(0x0a2000, 0x0a2007).w(FUNC(cyclwarr_state::video_config_w)); - map(0x0a4000, 0x0a4001).w(FUNC(cyclwarr_state::bigfight_a40000_w)); - map(0x0a6000, 0x0a6001).w(FUNC(cyclwarr_state::mixing_control_w)); - map(0x0ac000, 0x0ac003).w(FUNC(tatsumi_state::hd6445_crt_w)).umask16(0x00ff); + const uint16_t* rom=(uint16_t*)m_subregion->base(); - map(0x0b8000, 0x0b8001).w(FUNC(cyclwarr_state::cyclwarr_sound_w)).umask16(0xff00); - map(0x0b9000, 0x0b900f).rw("io1", FUNC(cxd1095_device::read), FUNC(cxd1095_device::write)).umask16(0x00ff).cswidth(16); - map(0x0ba000, 0x0ba00f).rw("io2", FUNC(cxd1095_device::read), FUNC(cxd1095_device::write)).umask16(0x00ff).cswidth(16); - map(0x0bc000, 0x0bc001).w(FUNC(cyclwarr_state::output_w)); - - map(0x0c0000, 0x0c3fff).rw(FUNC(cyclwarr_state::cyclwarr_sprite_r), FUNC(cyclwarr_state::cyclwarr_sprite_w)).share("spriteram"); - map(0x0ca000, 0x0ca1ff).rw(FUNC(cyclwarr_state::tatsumi_sprite_control_r), FUNC(cyclwarr_state::tatsumi_sprite_control_w)).share("obj_ctrl_ram"); - map(0x0d0000, 0x0d3fff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); +//logerror("%s:68000_r(%04X),cw=%04X\n", m_maincpu->pc(), offset*2, m_control_word); + /* Read from 68k RAM */ + if ((m_control_word&0x1f)==0x18) + { +#if 0 + // hack to make roundup 5 boot + // doesn't seem necessary anymore, left for reference + if (m_maincpu->pc()==0xec575) + { + uint8_t *dst = m_mainregion->base(); + dst[BYTE_XOR_LE(0xec57a)]=0x46; + dst[BYTE_XOR_LE(0xec57b)]=0x46; + + dst[BYTE_XOR_LE(0xfc520)]=0x46; //code that stops cpu after coin counter goes mad.. + dst[BYTE_XOR_LE(0xfc521)]=0x46; + dst[BYTE_XOR_LE(0xfc522)]=0x46; + dst[BYTE_XOR_LE(0xfc523)]=0x46; + dst[BYTE_XOR_LE(0xfc524)]=0x46; + dst[BYTE_XOR_LE(0xfc525)]=0x46; + } +#endif + + return m_sharedram[offset & 0x1fff]; + } - // games accesses these ranges differently, we do mirroring in rom loading to make them match. - // address bit A19 controls if access routes to upper or lower roms - // TODO: it's unknown what Big Fight is supposed to return for the lower roms, let's assume mirror for the time being. - // slave ROMs - // 0x140000 - 0x1bffff tested in Cycle Warriors - // 0x100000 - 0x17ffff tested in Big Fight - map(0x100000, 0x1fffff).rom().region("slave_rom",0); - // same as above but A20 instead of A19 - // master ROMs - // 0x2c0000 - 0x33ffff tested in Cycle Warriors - // 0x200000 - 0x27ffff tested in Big Fight - map(0x200000, 0x3fffff).rom().region("master_rom",0); -} + /* Read from 68k ROM */ + offset+=(m_control_word&0x7)*0x8000; -void cyclwarr_state::master_map(address_map &map) -{ - map(0x000000, 0x00ffff).ram().share("master_ram"); - map(0x03e000, 0x03efff).ram(); // RAM_A - map(0x040000, 0x04ffff).ram().share("slave_ram"); - common_map(map); + return rom[offset]; } -void cyclwarr_state::slave_map(address_map &map) +void tatsumi_state::tatsumi_v30_68000_w(offs_t offset, uint16_t data, uint16_t mem_mask) { - map(0x000000, 0x00ffff).ram().share("slave_ram"); - common_map(map); -} + if ((m_control_word&0x1f)!=0x18) + logerror("68k write in bank %05x\n",m_control_word); -void cyclwarr_state::sound_map(address_map &map) -{ - map(0x0000, 0xdfff).rom(); - map(0xe000, 0xffef).ram(); - map(0xfff0, 0xfff1).rw(m_ym2151, FUNC(ym2151_device::read), FUNC(ym2151_device::write)); - map(0xfff4, 0xfff4).r(FUNC(cyclwarr_state::oki_status_xor_r)).w(m_oki, FUNC(okim6295_device::write)); - map(0xfffc, 0xfffc).r(m_soundlatch, FUNC(generic_latch_8_device::read)); - map(0xfffe, 0xfffe).nopw(); + COMBINE_DATA(&m_sharedram[offset]); } - -/******************************************************************************/ - -static INPUT_PORTS_START( apache3 ) - PORT_START("IN0") - PORT_SERVICE_NO_TOGGLE( 0x01, IP_ACTIVE_LOW ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME( "Trigger" ) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME( "Power" ) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN1 ) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN2 ) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE1 ) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START1 ) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME( "Missile" ) - - PORT_START("STICK_X") - PORT_BIT( 0xff, 0x7f, IPT_AD_STICK_X ) PORT_SENSITIVITY(25) PORT_KEYDELTA(15) PORT_PLAYER(1) - - PORT_START("STICK_Y") - PORT_BIT( 0xff, 0x7f, IPT_AD_STICK_Y ) PORT_SENSITIVITY(25) PORT_KEYDELTA(15) PORT_PLAYER(1) - - PORT_START("THROTTLE") - PORT_BIT( 0xff, 0x7f, IPT_AD_STICK_Z ) PORT_SENSITIVITY(25) PORT_KEYDELTA(79) - - PORT_START("VR1") - PORT_ADJUSTER(100, "VR1") - - PORT_START("DSW") - PORT_DIPNAME( 0x0003, 0x0000, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:1,2") - PORT_DIPSETTING( 0x0000, "3" ) - PORT_DIPSETTING( 0x0001, "4" ) - PORT_DIPSETTING( 0x0002, "5" ) - PORT_DIPSETTING( 0x0003, "6" ) - PORT_DIPNAME( 0x000c, 0x0000, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:3,4") - PORT_DIPSETTING( 0x0004, DEF_STR( Easy ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( Normal ) ) - PORT_DIPSETTING( 0x0008, DEF_STR( Hard ) ) - PORT_DIPSETTING( 0x000c, DEF_STR( Hardest ) ) - PORT_DIPNAME( 0x0010, 0x0000, DEF_STR( Demo_Sounds ) ) - PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0020, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:6") /* Listed as "Always On" */ - PORT_DIPSETTING( 0x0020, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0040, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:7") /* Listed as "Not Used" */ - PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0080, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:8") /* Listed as "Always On" */ - PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0700, 0x0000, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:1,2,3") - PORT_DIPSETTING( 0x0200, DEF_STR( 3C_1C ) ) - PORT_DIPSETTING( 0x0100, DEF_STR( 2C_1C ) ) - PORT_DIPSETTING( 0x0700, DEF_STR( 3C_2C ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( 1C_1C ) ) - PORT_DIPSETTING( 0x0600, DEF_STR( 2C_3C ) ) - PORT_DIPSETTING( 0x0300, DEF_STR( 1C_2C ) ) - PORT_DIPSETTING( 0x0400, DEF_STR( 1C_5C ) ) - PORT_DIPSETTING( 0x0500, DEF_STR( 1C_6C ) ) - PORT_DIPNAME( 0x0800, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:4") /* Manual only shows a 3-Way dip box, so 4-8 are unknown */ - PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0800, DEF_STR( On ) ) - PORT_DIPNAME( 0x1000, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:5") - PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x1000, DEF_STR( On ) ) - PORT_DIPNAME( 0x2000, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:6") - PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x2000, DEF_STR( On ) ) - PORT_DIPNAME( 0x4000, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:7") - PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x4000, DEF_STR( On ) ) - PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Test ) ) PORT_DIPLOCATION("SW1:8") - PORT_DIPSETTING( 0x8000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) -INPUT_PORTS_END - -static INPUT_PORTS_START( roundup5 ) - PORT_START("IN0") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_NAME("Accelerator") - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_NAME("Brake") - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) PORT_NAME("Shift") PORT_TOGGLE - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1) PORT_NAME("Turbo") - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1 ) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) - - PORT_START("IN1") - PORT_SERVICE_NO_TOGGLE( 0x01, IP_ACTIVE_LOW ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN1 ) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN2 ) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE1 ) - // Tested in service mode, probably unused - PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW-3:1") - PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW-3:2") - PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW-3:3") - PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW-3:4") - PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - - PORT_START("STICKX") - PORT_BIT( 0xff, 0x7f, IPT_AD_STICK_X ) PORT_SENSITIVITY(25) PORT_KEYDELTA(15) PORT_PLAYER(1) - - PORT_START("DSW") /* Verified by Manual & in Game service menu */ - PORT_DIPNAME( 0x0003, 0x0000, DEF_STR( Game_Time ) ) PORT_DIPLOCATION("SW-1:1,2") - PORT_DIPSETTING( 0x0003, "Shortest" ) - PORT_DIPSETTING( 0x0002, "Short" ) - PORT_DIPSETTING( 0x0000, DEF_STR( Medium ) ) - PORT_DIPSETTING( 0x0001, "Long" ) - PORT_DIPNAME( 0x000c, 0x0000, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW-1:3,4") - PORT_DIPSETTING( 0x0004, DEF_STR( Easy ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( Medium ) ) - PORT_DIPSETTING( 0x0008, DEF_STR( Hard ) ) - PORT_DIPSETTING( 0x000c, DEF_STR( Hardest ) ) - PORT_DIPNAME( 0x0010, 0x0000, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW-1:5") - PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0020, 0x0000, DEF_STR( Language ) ) PORT_DIPLOCATION("SW-1:6") - PORT_DIPSETTING( 0x0020, DEF_STR( Japanese ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( English ) ) - PORT_DIPNAME( 0x0040, 0x0000, "Stage 5 Continue" ) PORT_DIPLOCATION("SW-1:7") - PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0080, 0x0000, "Output Mode" ) PORT_DIPLOCATION("SW-1:8") - PORT_DIPSETTING( 0x0000, "A (Light)" ) - PORT_DIPSETTING( 0x0080, "B (Vibration)" ) - // TODO: Coinage was all wrong, maybe manual refers to an undumped version? - PORT_DIPNAME( 0x0700, 0x0000, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW-2:1,2,3") - PORT_DIPSETTING( 0x0200, DEF_STR( 3C_1C ) ) - PORT_DIPSETTING( 0x0100, DEF_STR( 2C_1C ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( 1C_1C ) ) - PORT_DIPSETTING( 0x0700, DEF_STR( 3C_2C ) ) - PORT_DIPSETTING( 0x0600, DEF_STR( 2C_3C ) ) - PORT_DIPSETTING( 0x0300, DEF_STR( 1C_2C ) ) - PORT_DIPSETTING( 0x0400, DEF_STR( 1C_5C ) ) - PORT_DIPSETTING( 0x0500, DEF_STR( 1C_6C ) ) - PORT_DIPNAME( 0x3800, 0x0000, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW-2:4,5,6") - PORT_DIPSETTING( 0x3000, DEF_STR( 4C_1C ) ) - PORT_DIPSETTING( 0x3800, DEF_STR( 4C_3C ) ) - PORT_DIPSETTING( 0x0800, DEF_STR( 2C_1C ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( 1C_1C ) ) - PORT_DIPSETTING( 0x1000, DEF_STR( 1C_2C ) ) - PORT_DIPSETTING( 0x1800, DEF_STR( 1C_3C ) ) - PORT_DIPSETTING( 0x2000, DEF_STR( 1C_4C ) ) - PORT_DIPSETTING( 0x2800, DEF_STR( 1C_5C ) ) - PORT_DIPNAME( 0x4000, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW-2:7") /* Manual only shows nothing for this one */ - PORT_DIPSETTING( 0x4000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - // putting this and sw-2:6 ON position after POST to enable debugging info - PORT_DIPNAME( 0x8000, 0x8000, "Hardware Test Mode" ) PORT_DIPLOCATION("SW-2:8") /* Manual only shows nothing for this one */ - PORT_DIPSETTING( 0x8000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) -INPUT_PORTS_END - -static INPUT_PORTS_START( cyclwarr ) - PORT_START("SERVICE") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN3 ) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN4 ) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE1 ) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE2 ) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE3 ) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SERVICE4 ) - - PORT_START("P1") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1) - - PORT_START("P2") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START2 ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2) - - PORT_START("DSW3") - PORT_DIPNAME( 0x1, 0x1, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW3:1") - PORT_DIPSETTING( 0x1, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0, DEF_STR( On ) ) - PORT_DIPNAME( 0x2, 0x0, "Player Select" ) PORT_DIPLOCATION("SW3:2") - PORT_DIPSETTING( 0x2, "Coin Slot" ) - PORT_DIPSETTING( 0x0, "Select SW" ) - PORT_DIPNAME( 0x4, 0x4, DEF_STR( Service_Mode ) ) PORT_DIPLOCATION("SW3:3") - PORT_DIPSETTING( 0x4, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0, DEF_STR( On ) ) - PORT_DIPNAME( 0x8, 0x8, "Hardware Test Mode" ) PORT_DIPLOCATION("SW3:4") - PORT_DIPSETTING( 0x8, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0, DEF_STR( On ) ) - - PORT_START("DSW1") - PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:1,2,3,4") - PORT_DIPSETTING( 0x00, DEF_STR( 5C_1C ) ) - PORT_DIPSETTING( 0x02, DEF_STR( 4C_1C ) ) - PORT_DIPSETTING( 0x05, DEF_STR( 3C_1C ) ) - PORT_DIPSETTING( 0x08, DEF_STR( 2C_1C ) ) - PORT_DIPSETTING( 0x04, DEF_STR( 3C_2C ) ) - PORT_DIPSETTING( 0x01, DEF_STR( 4C_3C ) ) - PORT_DIPSETTING( 0x0f, DEF_STR( 1C_1C ) ) - PORT_DIPSETTING( 0x03, DEF_STR( 3C_4C ) ) - PORT_DIPSETTING( 0x07, DEF_STR( 2C_3C ) ) - PORT_DIPSETTING( 0x0e, DEF_STR( 1C_2C ) ) - PORT_DIPSETTING( 0x06, DEF_STR( 2C_5C ) ) - PORT_DIPSETTING( 0x0d, DEF_STR( 1C_3C ) ) - PORT_DIPSETTING( 0x0c, DEF_STR( 1C_4C ) ) - PORT_DIPSETTING( 0x0b, DEF_STR( 1C_5C ) ) - PORT_DIPSETTING( 0x0a, DEF_STR( 1C_6C ) ) - PORT_DIPSETTING( 0x09, DEF_STR( 1C_7C ) ) - PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW1:5,6,7,8") - PORT_DIPSETTING( 0x00, DEF_STR( 6C_1C ) ) - PORT_DIPSETTING( 0x10, DEF_STR( 5C_1C ) ) - PORT_DIPSETTING( 0x20, DEF_STR( 4C_1C ) ) - PORT_DIPSETTING( 0x50, DEF_STR( 3C_1C ) ) - PORT_DIPSETTING( 0x80, DEF_STR( 2C_1C ) ) - PORT_DIPSETTING( 0x40, DEF_STR( 3C_2C ) ) - PORT_DIPSETTING( 0xf0, DEF_STR( 1C_1C ) ) - PORT_DIPSETTING( 0x30, DEF_STR( 3C_4C ) ) - PORT_DIPSETTING( 0x70, DEF_STR( 2C_3C ) ) - PORT_DIPSETTING( 0xe0, DEF_STR( 1C_2C ) ) - PORT_DIPSETTING( 0x60, DEF_STR( 2C_5C ) ) - PORT_DIPSETTING( 0xd0, DEF_STR( 1C_3C ) ) - PORT_DIPSETTING( 0xc0, DEF_STR( 1C_4C ) ) - PORT_DIPSETTING( 0xb0, DEF_STR( 1C_5C ) ) - PORT_DIPSETTING( 0xa0, DEF_STR( 1C_6C ) ) - PORT_DIPSETTING( 0x90, DEF_STR( 1C_7C ) ) - - PORT_START("DSW2") - PORT_DIPNAME( 0x03, 0x02, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:1,2") - PORT_DIPSETTING( 0x00, "5" ) - PORT_DIPSETTING( 0x01, "3" ) - PORT_DIPSETTING( 0x02, "2" ) - PORT_DIPSETTING( 0x03, "1" ) - PORT_DIPNAME( 0x04, 0x04, "Ticket Dispenser" ) PORT_DIPLOCATION("SW2:3") - PORT_DIPSETTING( 0x04, "10000" ) - PORT_DIPSETTING( 0x00, "15000" ) - PORT_DIPNAME( 0x18, 0x08, "Machine Type" ) PORT_DIPLOCATION("SW2:4,5") -// PORT_DIPSETTING( 0x00, "2 Players" ) // same as 4 players but text layout is 2p (invalid setting) - PORT_DIPSETTING( 0x08, "2 Players" ) - PORT_DIPSETTING( 0x10, "3 Players" ) - PORT_DIPSETTING( 0x18, "4 Players" ) - PORT_DIPNAME( 0x60, 0x60, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:6,7") - PORT_DIPSETTING( 0x00, DEF_STR( Very_Hard ) ) - PORT_DIPSETTING( 0x20, DEF_STR( Hard ) ) - PORT_DIPSETTING( 0x40, DEF_STR( Easy ) ) - PORT_DIPSETTING( 0x60, DEF_STR( Normal ) ) - PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:8") - PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - - PORT_START("P3") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START3 ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(3) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(3) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(3) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(3) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(3) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(3) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(3) - - PORT_START("P4") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START4 ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(4) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(4) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(4) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(4) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(4) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(4) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(4) -INPUT_PORTS_END - -static INPUT_PORTS_START( cyclwarb ) - PORT_INCLUDE(cyclwarr) - - PORT_MODIFY("DSW3") - PORT_DIPNAME( 0x8, 0x8, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW3:4") - PORT_DIPSETTING( 0x8, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0, DEF_STR( On ) ) -INPUT_PORTS_END - -static INPUT_PORTS_START( bigfight ) - PORT_START("SERVICE") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN3 ) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN4 ) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE1 ) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE2 ) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE3 ) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SERVICE4 ) - - PORT_START("P1") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1) - - PORT_START("P2") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START2 ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2) - - PORT_START("DSW3") - PORT_DIPNAME( 0x1, 0x1, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW3:1") - PORT_DIPSETTING( 0x1, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0, DEF_STR( On ) ) - PORT_DIPNAME( 0x2, 0x0, "Player Select" ) PORT_DIPLOCATION("SW3:2") - PORT_DIPSETTING( 0x2, "Coin Slot" ) - PORT_DIPSETTING( 0x0, "Select SW" ) - PORT_DIPNAME( 0x4, 0x4, DEF_STR( Service_Mode ) ) PORT_DIPLOCATION("SW3:3") - PORT_DIPSETTING( 0x4, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0, DEF_STR( On ) ) - PORT_DIPNAME( 0x8, 0x8, "Hardware Test Mode" ) PORT_DIPLOCATION("SW3:4") - PORT_DIPSETTING( 0x8, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0, DEF_STR( On ) ) - - PORT_START("DSW1") - PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:1,2,3,4") - PORT_DIPSETTING( 0x00, DEF_STR( 5C_1C ) ) - PORT_DIPSETTING( 0x02, DEF_STR( 4C_1C ) ) - PORT_DIPSETTING( 0x05, DEF_STR( 3C_1C ) ) - PORT_DIPSETTING( 0x08, DEF_STR( 2C_1C ) ) - PORT_DIPSETTING( 0x04, DEF_STR( 3C_2C ) ) - PORT_DIPSETTING( 0x01, DEF_STR( 4C_3C ) ) - PORT_DIPSETTING( 0x0f, DEF_STR( 1C_1C ) ) - PORT_DIPSETTING( 0x03, DEF_STR( 3C_4C ) ) - PORT_DIPSETTING( 0x07, DEF_STR( 2C_3C ) ) - PORT_DIPSETTING( 0x0e, DEF_STR( 1C_2C ) ) - PORT_DIPSETTING( 0x06, DEF_STR( 2C_5C ) ) - PORT_DIPSETTING( 0x0d, DEF_STR( 1C_3C ) ) - PORT_DIPSETTING( 0x0c, DEF_STR( 1C_4C ) ) - PORT_DIPSETTING( 0x0b, DEF_STR( 1C_5C ) ) - PORT_DIPSETTING( 0x0a, DEF_STR( 1C_6C ) ) - PORT_DIPSETTING( 0x09, DEF_STR( 1C_7C ) ) - PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW1:5,6,7,8") - PORT_DIPSETTING( 0x00, DEF_STR( 6C_1C ) ) - PORT_DIPSETTING( 0x10, DEF_STR( 5C_1C ) ) - PORT_DIPSETTING( 0x20, DEF_STR( 4C_1C ) ) - PORT_DIPSETTING( 0x50, DEF_STR( 3C_1C ) ) - PORT_DIPSETTING( 0x80, DEF_STR( 2C_1C ) ) - PORT_DIPSETTING( 0x40, DEF_STR( 3C_2C ) ) - PORT_DIPSETTING( 0xf0, DEF_STR( 1C_1C ) ) - PORT_DIPSETTING( 0x30, DEF_STR( 3C_4C ) ) - PORT_DIPSETTING( 0x70, DEF_STR( 2C_3C ) ) - PORT_DIPSETTING( 0xe0, DEF_STR( 1C_2C ) ) - PORT_DIPSETTING( 0x60, DEF_STR( 2C_5C ) ) - PORT_DIPSETTING( 0xd0, DEF_STR( 1C_3C ) ) - PORT_DIPSETTING( 0xc0, DEF_STR( 1C_4C ) ) - PORT_DIPSETTING( 0xb0, DEF_STR( 1C_5C ) ) - PORT_DIPSETTING( 0xa0, DEF_STR( 1C_6C ) ) - PORT_DIPSETTING( 0x90, DEF_STR( 1C_7C ) ) - - PORT_START("DSW2") - PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:1,2") - PORT_DIPSETTING( 0x00, "1" ) - PORT_DIPSETTING( 0x03, "2" ) - PORT_DIPSETTING( 0x02, "3" ) - PORT_DIPSETTING( 0x01, "4" ) - PORT_DIPNAME( 0x04, 0x04, "Ticket Dispenser" ) PORT_DIPLOCATION("SW2:3") - PORT_DIPSETTING( 0x04, "100000" ) - PORT_DIPSETTING( 0x00, "150000" ) - PORT_DIPNAME( 0x08, 0x08, "Continue Coin" ) PORT_DIPLOCATION("SW2:4") - PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x10, 0x10, "Extend" ) PORT_DIPLOCATION("SW2:5") - PORT_DIPSETTING( 0x10, "100000" ) - PORT_DIPSETTING( 0x00, DEF_STR( None ) ) - PORT_DIPNAME( 0x60, 0x60, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:6,7") - PORT_DIPSETTING( 0x00, DEF_STR( Very_Hard ) ) - PORT_DIPSETTING( 0x20, DEF_STR( Hard ) ) - PORT_DIPSETTING( 0x40, DEF_STR( Easy ) ) - PORT_DIPSETTING( 0x60, DEF_STR( Normal ) ) - PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:8") - PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - - PORT_START("P3") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START3 ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(3) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(3) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(3) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(3) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(3) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(3) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(3) - - PORT_START("P4") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START4 ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(4) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(4) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(4) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(4) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(4) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(4) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(4) -INPUT_PORTS_END - -/******************************************************************************/ - -static const gfx_layout spritelayout = -{ - 8,8, - RGN_FRAC(1,1), - 4, - { STEP4(0,1) }, - { 8,12,0,4, 24,28,16,20 }, - { STEP8(0,4*8) }, - 32*8 -}; - -static const gfx_layout roundup5_vramlayout = -{ - 8,8, - 4096, - 3, - { 0x10000 * 8, 0x8000 * 8, 0 }, - { STEP8(0,1) }, - { STEP8(0,8) }, - 8*8 -}; - -static GFXDECODE_START( gfx_apache3 ) - GFXDECODE_ENTRY( "sprites", 0, spritelayout, 1024, 256) - GFXDECODE_ENTRY( "text", 0, gfx_8x8x3_planar, 768, 16) -GFXDECODE_END - -static GFXDECODE_START( gfx_roundup5 ) - GFXDECODE_ENTRY( "sprites", 0, spritelayout, 1024, 256) - GFXDECODE_RAM( nullptr, 0, roundup5_vramlayout, 0, 16) -GFXDECODE_END - -static GFXDECODE_START( gfx_cyclwarr ) - GFXDECODE_ENTRY( "sprites", 0, spritelayout, 8192, 512) - GFXDECODE_ENTRY( "tilerom", 0, gfx_8x8x3_planar, 0, 16) -GFXDECODE_END - /******************************************************************************/ INTERRUPT_GEN_MEMBER(tatsumi_state::v30_interrupt) @@ -850,809 +166,18 @@ INTERRUPT_GEN_MEMBER(tatsumi_state::v30_interrupt) device.execute().set_input_line_and_vector(0, HOLD_LINE, 0xc8/4); /* V30 - VBL */ } -void apache3_state::apache3_68000_reset(int state) -{ - m_subcpu2->pulse_input_line(INPUT_LINE_RESET, attotime::zero); -} - -MACHINE_RESET_MEMBER(apache3_state,apache3) -{ - m_subcpu2->set_input_line(INPUT_LINE_RESET, ASSERT_LINE); // TODO -} - - -void apache3_state::apache3(machine_config &config) -{ - /* basic machine hardware */ - V30(config, m_maincpu, CLOCK_1 / 2); - m_maincpu->set_addrmap(AS_PROGRAM, &apache3_state::apache3_v30_map); - m_maincpu->set_vblank_int("screen", FUNC(tatsumi_state::v30_interrupt)); - - M68000(config, m_subcpu, CLOCK_2 / 4); - m_subcpu->set_addrmap(AS_PROGRAM, &apache3_state::apache3_68000_map); - m_subcpu->set_vblank_int("screen", FUNC(apache3_state::irq4_line_hold)); - m_subcpu->reset_cb().set(FUNC(apache3_state::apache3_68000_reset)); - - V20(config, m_audiocpu, CLOCK_1 / 2); - m_audiocpu->set_addrmap(AS_PROGRAM, &apache3_state::apache3_v20_map); - - Z80(config, m_subcpu2, CLOCK_2 / 8); - m_subcpu2->set_addrmap(AS_PROGRAM, &apache3_state::apache3_z80_map); - m_subcpu2->set_vblank_int("screen", FUNC(apache3_state::irq0_line_hold)); - - config.set_maximum_quantum(attotime::from_hz(6000)); - NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); - MCFG_MACHINE_RESET_OVERRIDE(apache3_state, apache3) - - m58990_device &adc(M58990(config, "adc", 1000000)); // unknown clock - adc.in_callback<0>().set_ioport("STICK_X"); - adc.in_callback<1>().set_ioport("STICK_Y"); - adc.in_callback<2>().set_constant(0); // VSP1 - adc.in_callback<4>().set(FUNC(apache3_state::apache3_vr1_r)); - adc.in_callback<5>().set_ioport("THROTTLE"); - adc.in_callback<6>().set_constant(0); // RPSNC - adc.in_callback<7>().set_constant(0); // LPSNC - - I8255(config, "ppi"); - - /* video hardware */ - screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); - screen.set_raw(CLOCK_2 / 8, 400, 0, 320, 272, 0, 240); // TODO: Hook up CRTC - screen.set_screen_update(FUNC(apache3_state::screen_update_apache3)); - - GFXDECODE(config, m_gfxdecode, m_palette, gfx_apache3); - PALETTE(config, m_palette).set_format(palette_device::xRGB_555, 1024 + 4096); // 1024 real colours, and 4096 arranged as series of CLUTs - - /* apache 3 schematics state - bit 4: 250 - bit 3: 500 - bit 2: 1k - bit 1: 2k - bit 0: 3.9kOhm resistor - */ - - MCFG_VIDEO_START_OVERRIDE(apache3_state, apache3) - - /* sound hardware */ - SPEAKER(config, "lspeaker").front_left(); - SPEAKER(config, "rspeaker").front_right(); - - YM2151(config, m_ym2151, CLOCK_1 / 4); - m_ym2151->irq_handler().set_inputline(m_audiocpu, INPUT_LINE_IRQ0); - m_ym2151->add_route(0, "lspeaker", 0.45); - m_ym2151->add_route(1, "rspeaker", 0.45); - - OKIM6295(config, m_oki, CLOCK_1 / 4 / 2, okim6295_device::PIN7_HIGH); - m_oki->add_route(ALL_OUTPUTS, "lspeaker", 0.75); - m_oki->add_route(ALL_OUTPUTS, "rspeaker", 0.75); -} - -void roundup5_state::roundup5(machine_config &config) -{ - /* basic machine hardware */ - V30(config, m_maincpu, CLOCK_1 / 2); - m_maincpu->set_addrmap(AS_PROGRAM, &roundup5_state::roundup5_v30_map); - m_maincpu->set_vblank_int("screen", FUNC(tatsumi_state::v30_interrupt)); - - M68000(config, m_subcpu, CLOCK_2 / 4); - m_subcpu->set_addrmap(AS_PROGRAM, &roundup5_state::roundup5_68000_map); - - Z80(config, m_audiocpu, CLOCK_1 / 4); - m_audiocpu->set_addrmap(AS_PROGRAM, &roundup5_state::roundup5_z80_map); - - config.set_maximum_quantum(attotime::from_hz(6000)); - - i8255_device &ppi(I8255(config, "ppi")); - ppi.in_pa_callback().set_ioport("IN0"); - ppi.in_pb_callback().set_ioport("IN1"); - ppi.out_pc_callback().set(FUNC(roundup5_state::output_w)); - - /* video hardware */ - screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); - screen.set_raw(CLOCK_2 / 8, 400, 0, 320, 272, 0, 240); // TODO: Hook up CRTC - screen.set_screen_update(FUNC(roundup5_state::screen_update_roundup5)); - - GFXDECODE(config, m_gfxdecode, m_palette, gfx_roundup5); - PALETTE(config, m_palette).set_format(palette_device::xRGB_555, 1024 + 4096); // 1024 real colours, and 4096 arranged as series of CLUTs - m_palette->set_membits(8).set_endianness(ENDIANNESS_BIG); - MCFG_VIDEO_START_OVERRIDE(roundup5_state,roundup5) - - /* sound hardware */ - SPEAKER(config, "lspeaker").front_left(); - SPEAKER(config, "rspeaker").front_right(); - - YM2151(config, m_ym2151, CLOCK_1 / 4); - m_ym2151->irq_handler().set_inputline(m_audiocpu, INPUT_LINE_IRQ0); - m_ym2151->add_route(0, "lspeaker", 0.45); - m_ym2151->add_route(1, "rspeaker", 0.45); - - OKIM6295(config, m_oki, CLOCK_1 / 4 / 2, okim6295_device::PIN7_HIGH); - m_oki->add_route(ALL_OUTPUTS, "lspeaker", 0.75); - m_oki->add_route(ALL_OUTPUTS, "rspeaker", 0.75); -} - -void cyclwarr_state::machine_reset() -{ - uint16_t *src; - - // transfer data from rom to initial vector table - src = (uint16_t *)memregion("master_rom")->base(); - - for(int i=0;i<0x100/2;i++) - m_master_ram[i] = src[i]; - - src = (uint16_t *)memregion("slave_rom")->base(); - - for(int i=0;i<0x100/2;i++) - m_slave_ram[i] = src[i]; - - // reset CPUs again so that above will be notified. - // TODO: better way? - m_maincpu->pulse_input_line(INPUT_LINE_RESET, attotime::zero); - m_subcpu->pulse_input_line(INPUT_LINE_RESET, attotime::zero); - - m_last_control = 0; - m_control_word = 0; - - m_road_color_bank = m_prev_road_bank = 0; -} - -void cyclwarr_state::cyclwarr(machine_config &config) -{ - /* basic machine hardware */ - M68000(config, m_maincpu, CLOCK_2 / 4); - m_maincpu->set_addrmap(AS_PROGRAM, &cyclwarr_state::master_map); - m_maincpu->set_vblank_int("screen", FUNC(cyclwarr_state::irq5_line_hold)); - - M68000(config, m_subcpu, CLOCK_2 / 4); - m_subcpu->set_addrmap(AS_PROGRAM, &cyclwarr_state::slave_map); - m_subcpu->set_vblank_int("screen", FUNC(cyclwarr_state::irq5_line_hold)); - - Z80(config, m_audiocpu, CLOCK_1 / 4); - m_audiocpu->set_addrmap(AS_PROGRAM, &cyclwarr_state::sound_map); - - // saner sync value (avoids crashing after crediting) - config.set_maximum_quantum(attotime::from_hz(CLOCK_2 / 1024)); - - cxd1095_device &io1(CXD1095(config, "io1")); - io1.in_portb_cb().set_ioport("SERVICE"); - io1.in_portc_cb().set_ioport("P1"); - io1.in_portd_cb().set_ioport("P2"); - io1.in_porte_cb().set_ioport("DSW3"); - - cxd1095_device &io2(CXD1095(config, "io2")); - io2.in_porta_cb().set_ioport("DSW1"); - io2.in_portb_cb().set_ioport("DSW2"); - io2.in_portc_cb().set_ioport("P3"); - io2.in_portd_cb().set_ioport("P4"); - io2.out_porte_cb().set(FUNC(cyclwarr_state::cyclwarr_control_w)); - - /* video hardware */ - screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); - screen.set_raw(CLOCK_2 / 8, 400, 0, 320, 272, 0, 240); // TODO: Hook up CRTC - screen.set_screen_update(FUNC(cyclwarr_state::screen_update_cyclwarr)); - - GFXDECODE(config, m_gfxdecode, m_palette, gfx_cyclwarr); - PALETTE(config, m_palette).set_format(palette_device::xRGB_555, 8192 + 8192); - - MCFG_VIDEO_START_OVERRIDE(cyclwarr_state, cyclwarr) - - /* sound hardware */ - SPEAKER(config, "lspeaker").front_left(); - SPEAKER(config, "rspeaker").front_right(); - - GENERIC_LATCH_8(config, m_soundlatch); -// m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, INPUT_LINE_NMI); - - YM2151(config, m_ym2151, CLOCK_1 / 4); - m_ym2151->irq_handler().set_inputline(m_audiocpu, INPUT_LINE_IRQ0); - m_ym2151->add_route(0, "lspeaker", 0.45); - m_ym2151->add_route(1, "rspeaker", 0.45); - - OKIM6295(config, m_oki, CLOCK_1 / 8, okim6295_device::PIN7_HIGH); - m_oki->add_route(ALL_OUTPUTS, "lspeaker", 0.75); - m_oki->add_route(ALL_OUTPUTS, "rspeaker", 0.75); -} - -void cyclwarr_state::bigfight(machine_config &config) -{ - cyclwarr(config); - - // TODO: it's same video HW, we don't know how/where video registers are mapped -// subdevice("screen")->set_screen_update(FUNC(cyclwarr_state::screen_update_bigfight)); - - MCFG_VIDEO_START_OVERRIDE(cyclwarr_state, bigfight) - - /* sound hardware */ - // TODO: 2MHz was too fast. Can the clock be software controlled? - m_oki->set_clock(CLOCK_1 / 8 / 2); -} /***************************************************************************/ -ROM_START( apache3 ) - ROM_REGION16_LE( 0x80000, "master_rom", 0 ) /* v30 main cpu */ - ROM_LOAD16_BYTE( "ap-25f.125", 0x020001, 0x10000, CRC(3c7530f4) SHA1(9f7b58a3abddbdc3081ba9dfc1732406eb8c1752) ) - ROM_LOAD16_BYTE( "ap-26f.133", 0x020000, 0x10000, CRC(2955997f) SHA1(86e37def923d9cf4eb33e7979118ec6f1ef62678) ) - ROM_LOAD16_BYTE( "ap-23f.110", 0x060001, 0x10000, CRC(d7077149) SHA1(b08f5a9ee03641c20bdd5e5c9671a22c740150c6) ) - ROM_LOAD16_BYTE( "ap-24f.118", 0x060000, 0x10000, CRC(0bdef11b) SHA1(ed687600962ed2ca3a8e67cbd84fa5486778eade) ) - - ROM_REGION16_BE( 0x80000, "slave_rom", 0 ) /* 68000 sub cpu */ - ROM_LOAD16_BYTE( "ap-19c.80", 0x000001, 0x10000, CRC(0908e468) SHA1(a2d725993bd4cd5425468736154fd3dd9dd7b060) ) - ROM_LOAD16_BYTE( "ap-21c.97", 0x000000, 0x10000, CRC(38a056fb) SHA1(67c8ae58670cebde0771854e1fb5fc2eb2543ecc) ) - ROM_LOAD16_BYTE( "ap-20a.89", 0x040001, 0x20000, CRC(92d24b5e) SHA1(1ea270d46a607e47b7e0961b532316aa05dc8f4e) ) - ROM_LOAD16_BYTE( "ap-22a.105", 0x040000, 0x20000, CRC(a8458a92) SHA1(43674731c2e9962c2bfbb73a85484cf03d6be223) ) - - ROM_REGION( 0x10000, "sound_rom", 0 ) /* 64k code for sound V20 */ - ROM_LOAD( "ap-27d.151", 0x00000, 0x10000, CRC(294b4d79) SHA1(2b03418a12a2aaf3919b98161d8d0ce6ae29a2bb) ) - - ROM_REGION( 0x200000, "sprites", ROMREGION_ERASE00 ) - /* Filled in by both regions below */ - - ROM_REGION( 0x100000, "sprites_l", 0) - ROM_LOAD32_BYTE( "ap-00c.15", 0x000000, 0x20000, CRC(ad1ddc2b) SHA1(81f64663c4892ab5fb0e2dc99513dbfee73f15b8) ) - ROM_LOAD32_BYTE( "ap-01c.22", 0x000001, 0x20000, CRC(6286ff00) SHA1(920da4a3a441dbf54ad86c0f4fb6f47a867e9cda) ) - ROM_LOAD32_BYTE( "ap-04c.58", 0x000002, 0x20000, CRC(dc6d55e4) SHA1(9f48f8d6aa1a329a71913139a8d5a50d95a9b9e5) ) - ROM_LOAD32_BYTE( "ap-05c.65", 0x000003, 0x20000, CRC(2e6e495f) SHA1(af610f265da53735b20ddc6df1bda47fc54ee0c3) ) - ROM_LOAD32_BYTE( "ap-02c.34", 0x080000, 0x20000, CRC(af4ee7cb) SHA1(4fe2361b7431971b07671f145abf1ea5861d01db) ) - ROM_LOAD32_BYTE( "ap-03c.46", 0x080001, 0x20000, CRC(60ab495c) SHA1(18340d4fba550495b1e52f8023a0a2ec6349dfeb) ) - ROM_LOAD32_BYTE( "ap-06c.71", 0x080002, 0x20000, CRC(0ea90e55) SHA1(b16d6b8be4853797507d3e5c933a9dd1d451308e) ) - ROM_LOAD32_BYTE( "ap-07c.75", 0x080003, 0x20000, CRC(ba685543) SHA1(140a2b708d4e4de4d207fc2c4a96a5cab8639988) ) - - ROM_REGION( 0x100000, "sprites_h", 0) - ROM_LOAD32_BYTE( "ap-08c.14", 0x000000, 0x20000, CRC(6437b580) SHA1(2b2ba42add18bbec04fbcf53645a8d44b972e26a) ) - ROM_LOAD32_BYTE( "ap-09c.21", 0x000001, 0x20000, CRC(54d18ef9) SHA1(40ebc6ea49b2a501fe843d60bec8c32d07f2d25d) ) - ROM_LOAD32_BYTE( "ap-12c.57", 0x000002, 0x20000, CRC(f95cf5cf) SHA1(ce373c648cbf3e4863bbc3a1175efe065c75eb13) ) - ROM_LOAD32_BYTE( "ap-13c.64", 0x000003, 0x20000, CRC(67a248c3) SHA1(cc945f7cfecaaab5075c1a3d202369b070d4c656) ) - ROM_LOAD32_BYTE( "ap-10c.33", 0x080000, 0x20000, CRC(74418df4) SHA1(cc1206b10afc2de919b2fb9899486122d27290a4) ) - ROM_LOAD32_BYTE( "ap-11c.45", 0x080001, 0x20000, CRC(195bf78e) SHA1(c3c472f3c4244545b89491b6ebec4f838a6bbb73) ) - ROM_LOAD32_BYTE( "ap-14c.70", 0x080002, 0x20000, CRC(58f7fe16) SHA1(a5b87b42b85808c226df0d2a7b7cdde12d474a41) ) - ROM_LOAD32_BYTE( "ap-15c.74", 0x080003, 0x20000, CRC(1ffd5496) SHA1(25efb568957fc9441a40a7d64cc6afe1a14b392b) ) - - ROM_REGION( 0x18000, "text", 0 ) - ROM_LOAD( "ap-18d.73", 0x000000, 0x8000, CRC(55e664bf) SHA1(505bec8b5ff3f9fa2c5fb1213d54683347905be1) ) - ROM_LOAD( "ap-17d.68", 0x008000, 0x8000, CRC(6199afe4) SHA1(ad8c0ed6c33d984bb29c89f2e7fc7e5a923cefe3) ) - ROM_LOAD( "ap-16d.63", 0x010000, 0x8000, CRC(f115656d) SHA1(61798858dc0172192d89e666696b2c7642756899) ) - - ROM_REGION( 0x40000, "oki", 0 ) /* ADPCM samples */ - ROM_LOAD( "ap-28c.171", 0x000000, 0x20000, CRC(b349f0c2) SHA1(cb1ff1c0e784f669c87ab1eccd3b358950761b74) ) - ROM_LOAD( "ap-29c.176", 0x020000, 0x10000, CRC(b38fced3) SHA1(72f61a719f393957bcccf14687bfbb2e7a5f7aee) ) - - ROM_REGION( 0x200, "proms", 0 ) /* Road stripe PROM */ - ROM_LOAD( "am27s29.ic41", 0x000, 0x200, CRC(c981f1e0) SHA1(7d8492d9f4033ab3734c09ee23016a0b210648b5) ) -ROM_END - -ROM_START( apache3a ) - ROM_REGION16_LE( 0x80000, "master_rom", 0 ) /* v30 main cpu */ - ROM_LOAD16_BYTE( "ap-25c.125", 0x020001, 0x10000, CRC(7bc496a6) SHA1(5491d06181d729407e975b85a8715fdc3b489c67) ) - ROM_LOAD16_BYTE( "ap-26c.133", 0x020000, 0x10000, CRC(9393a470) SHA1(00376f7a545629a83eb5a90b9d1685a68430e4ce) ) - ROM_LOAD16_BYTE( "ap-23e.110", 0x060001, 0x10000, CRC(3e465b8e) SHA1(dfd009221974eb43263dd3f4f80f39bb32c30ced) ) /* hand written label: 23E DD65 */ - ROM_LOAD16_BYTE( "ap-24e.118", 0x060000, 0x10000, CRC(1ef746f2) SHA1(31d77bd954ea6cc00cac40a3a514281da371030b) ) /* hand written label: 24E E2A2 */ - - ROM_REGION16_BE( 0x80000, "slave_rom", 0 ) /* 68000 sub cpu */ - ROM_LOAD16_BYTE( "ap-19c.80", 0x000001, 0x10000, CRC(0908e468) SHA1(a2d725993bd4cd5425468736154fd3dd9dd7b060) ) - ROM_LOAD16_BYTE( "ap-21c.97", 0x000000, 0x10000, CRC(38a056fb) SHA1(67c8ae58670cebde0771854e1fb5fc2eb2543ecc) ) - ROM_LOAD16_BYTE( "ap-20a.89", 0x040001, 0x20000, CRC(92d24b5e) SHA1(1ea270d46a607e47b7e0961b532316aa05dc8f4e) ) - ROM_LOAD16_BYTE( "ap-22a.105", 0x040000, 0x20000, CRC(a8458a92) SHA1(43674731c2e9962c2bfbb73a85484cf03d6be223) ) - - ROM_REGION( 0x10000, "sound_rom", 0 ) /* 64k code for sound V20 */ - ROM_LOAD( "ap-27d.151", 0x00000, 0x10000, CRC(294b4d79) SHA1(2b03418a12a2aaf3919b98161d8d0ce6ae29a2bb) ) - - ROM_REGION( 0x200000, "sprites", ROMREGION_ERASE00 ) - /* Filled in by both regions below */ - - ROM_REGION( 0x100000, "sprites_l", 0) - ROM_LOAD32_BYTE( "ap-00c.15", 0x000000, 0x20000, CRC(ad1ddc2b) SHA1(81f64663c4892ab5fb0e2dc99513dbfee73f15b8) ) - ROM_LOAD32_BYTE( "ap-01c.22", 0x000001, 0x20000, CRC(6286ff00) SHA1(920da4a3a441dbf54ad86c0f4fb6f47a867e9cda) ) - ROM_LOAD32_BYTE( "ap-04c.58", 0x000002, 0x20000, CRC(dc6d55e4) SHA1(9f48f8d6aa1a329a71913139a8d5a50d95a9b9e5) ) - ROM_LOAD32_BYTE( "ap-05c.65", 0x000003, 0x20000, CRC(2e6e495f) SHA1(af610f265da53735b20ddc6df1bda47fc54ee0c3) ) - ROM_LOAD32_BYTE( "ap-02c.34", 0x080000, 0x20000, CRC(af4ee7cb) SHA1(4fe2361b7431971b07671f145abf1ea5861d01db) ) - ROM_LOAD32_BYTE( "ap-03c.46", 0x080001, 0x20000, CRC(60ab495c) SHA1(18340d4fba550495b1e52f8023a0a2ec6349dfeb) ) - ROM_LOAD32_BYTE( "ap-06c.71", 0x080002, 0x20000, CRC(0ea90e55) SHA1(b16d6b8be4853797507d3e5c933a9dd1d451308e) ) - ROM_LOAD32_BYTE( "ap-07c.75", 0x080003, 0x20000, CRC(ba685543) SHA1(140a2b708d4e4de4d207fc2c4a96a5cab8639988) ) - - ROM_REGION( 0x100000, "sprites_h", 0) - ROM_LOAD32_BYTE( "ap-08c.14", 0x000000, 0x20000, CRC(6437b580) SHA1(2b2ba42add18bbec04fbcf53645a8d44b972e26a) ) - ROM_LOAD32_BYTE( "ap-09c.21", 0x000001, 0x20000, CRC(54d18ef9) SHA1(40ebc6ea49b2a501fe843d60bec8c32d07f2d25d) ) - ROM_LOAD32_BYTE( "ap-12c.57", 0x000002, 0x20000, CRC(f95cf5cf) SHA1(ce373c648cbf3e4863bbc3a1175efe065c75eb13) ) - ROM_LOAD32_BYTE( "ap-13c.64", 0x000003, 0x20000, CRC(67a248c3) SHA1(cc945f7cfecaaab5075c1a3d202369b070d4c656) ) - ROM_LOAD32_BYTE( "ap-10c.33", 0x080000, 0x20000, CRC(74418df4) SHA1(cc1206b10afc2de919b2fb9899486122d27290a4) ) - ROM_LOAD32_BYTE( "ap-11c.45", 0x080001, 0x20000, CRC(195bf78e) SHA1(c3c472f3c4244545b89491b6ebec4f838a6bbb73) ) - ROM_LOAD32_BYTE( "ap-14c.70", 0x080002, 0x20000, CRC(58f7fe16) SHA1(a5b87b42b85808c226df0d2a7b7cdde12d474a41) ) - ROM_LOAD32_BYTE( "ap-15c.74", 0x080003, 0x20000, CRC(1ffd5496) SHA1(25efb568957fc9441a40a7d64cc6afe1a14b392b) ) - - ROM_REGION( 0x18000, "text", 0 ) - ROM_LOAD( "ap-18e.73", 0x000000, 0x10000, CRC(d7861a26) SHA1(b1a1e089a293a5536d342c9edafbea303f4f128c) ) - ROM_LOAD( "ap-16e.63", 0x008000, 0x10000, CRC(d3251965) SHA1(aef4f58a6f773060434abda9d7f5f003693577bf) ) - ROM_LOAD( "ap-17e.68", 0x008000, 0x08000, CRC(4509c2ed) SHA1(97a6a6710e83aca212ce43d06c3f26c35f9782b8) ) - - ROM_REGION( 0x40000, "oki", 0 ) /* ADPCM samples */ - ROM_LOAD( "ap-28c.171", 0x000000, 0x20000, CRC(b349f0c2) SHA1(cb1ff1c0e784f669c87ab1eccd3b358950761b74) ) - ROM_LOAD( "ap-29c.176", 0x020000, 0x10000, CRC(b38fced3) SHA1(72f61a719f393957bcccf14687bfbb2e7a5f7aee) ) - - ROM_REGION( 0x200, "proms", 0 ) /* Road stripe PROM */ - ROM_LOAD( "am27s29.ic41", 0x000, 0x200, CRC(c981f1e0) SHA1(7d8492d9f4033ab3734c09ee23016a0b210648b5) ) -ROM_END - -ROM_START( apache3b ) - ROM_REGION16_LE( 0x80000, "master_rom", 0 ) /* v30 main cpu */ - ROM_LOAD16_BYTE( "ap-25c.125", 0x020001, 0x10000, CRC(7bc496a6) SHA1(5491d06181d729407e975b85a8715fdc3b489c67) ) - ROM_LOAD16_BYTE( "ap-26c.133", 0x020000, 0x10000, CRC(9393a470) SHA1(00376f7a545629a83eb5a90b9d1685a68430e4ce) ) - ROM_LOAD16_BYTE( "ap-23g.110", 0x060001, 0x10000, CRC(0ab485e4) SHA1(d8d0695312732c31cedcb1c298810a6793835e80) ) /* Kana Corporation license program ROMs */ - ROM_LOAD16_BYTE( "ap-24g.118", 0x060000, 0x10000, CRC(6348e196) SHA1(6be537491a56a28b62981cae6db8dfc4eb2fece2) ) /* Kana Corporation license program ROMs */ - - ROM_REGION16_BE( 0x80000, "slave_rom", 0 ) /* 68000 sub cpu */ - ROM_LOAD16_BYTE( "ap-19c.80", 0x000001, 0x10000, CRC(0908e468) SHA1(a2d725993bd4cd5425468736154fd3dd9dd7b060) ) - ROM_LOAD16_BYTE( "ap-21c.97", 0x000000, 0x10000, CRC(38a056fb) SHA1(67c8ae58670cebde0771854e1fb5fc2eb2543ecc) ) - ROM_LOAD16_BYTE( "ap-20a.89", 0x040001, 0x20000, CRC(92d24b5e) SHA1(1ea270d46a607e47b7e0961b532316aa05dc8f4e) ) - ROM_LOAD16_BYTE( "ap-22a.105", 0x040000, 0x20000, CRC(a8458a92) SHA1(43674731c2e9962c2bfbb73a85484cf03d6be223) ) - - ROM_REGION( 0x10000, "sound_rom", 0 ) /* 64k code for sound V20 */ - ROM_LOAD( "ap-27d.151", 0x00000, 0x10000, CRC(294b4d79) SHA1(2b03418a12a2aaf3919b98161d8d0ce6ae29a2bb) ) - - ROM_REGION( 0x200000, "sprites", ROMREGION_ERASE00 ) - /* Filled in by both regions below */ - - ROM_REGION( 0x100000, "sprites_l", 0) - ROM_LOAD32_BYTE( "ap-00c.15", 0x000000, 0x20000, CRC(ad1ddc2b) SHA1(81f64663c4892ab5fb0e2dc99513dbfee73f15b8) ) - ROM_LOAD32_BYTE( "ap-01c.22", 0x000001, 0x20000, CRC(6286ff00) SHA1(920da4a3a441dbf54ad86c0f4fb6f47a867e9cda) ) - ROM_LOAD32_BYTE( "ap-04c.58", 0x000002, 0x20000, CRC(dc6d55e4) SHA1(9f48f8d6aa1a329a71913139a8d5a50d95a9b9e5) ) - ROM_LOAD32_BYTE( "ap-05c.65", 0x000003, 0x20000, CRC(2e6e495f) SHA1(af610f265da53735b20ddc6df1bda47fc54ee0c3) ) - ROM_LOAD32_BYTE( "ap-02c.34", 0x080000, 0x20000, CRC(af4ee7cb) SHA1(4fe2361b7431971b07671f145abf1ea5861d01db) ) - ROM_LOAD32_BYTE( "ap-03c.46", 0x080001, 0x20000, CRC(60ab495c) SHA1(18340d4fba550495b1e52f8023a0a2ec6349dfeb) ) - ROM_LOAD32_BYTE( "ap-06c.71", 0x080002, 0x20000, CRC(0ea90e55) SHA1(b16d6b8be4853797507d3e5c933a9dd1d451308e) ) - ROM_LOAD32_BYTE( "ap-07c.75", 0x080003, 0x20000, CRC(ba685543) SHA1(140a2b708d4e4de4d207fc2c4a96a5cab8639988) ) - - ROM_REGION( 0x100000, "sprites_h", 0) - ROM_LOAD32_BYTE( "ap-08c.14", 0x000000, 0x20000, CRC(6437b580) SHA1(2b2ba42add18bbec04fbcf53645a8d44b972e26a) ) - ROM_LOAD32_BYTE( "ap-09c.21", 0x000001, 0x20000, CRC(54d18ef9) SHA1(40ebc6ea49b2a501fe843d60bec8c32d07f2d25d) ) - ROM_LOAD32_BYTE( "ap-12c.57", 0x000002, 0x20000, CRC(f95cf5cf) SHA1(ce373c648cbf3e4863bbc3a1175efe065c75eb13) ) - ROM_LOAD32_BYTE( "ap-13c.64", 0x000003, 0x20000, CRC(67a248c3) SHA1(cc945f7cfecaaab5075c1a3d202369b070d4c656) ) - ROM_LOAD32_BYTE( "ap-10c.33", 0x080000, 0x20000, CRC(74418df4) SHA1(cc1206b10afc2de919b2fb9899486122d27290a4) ) - ROM_LOAD32_BYTE( "ap-11c.45", 0x080001, 0x20000, CRC(195bf78e) SHA1(c3c472f3c4244545b89491b6ebec4f838a6bbb73) ) - ROM_LOAD32_BYTE( "ap-14c.70", 0x080002, 0x20000, CRC(58f7fe16) SHA1(a5b87b42b85808c226df0d2a7b7cdde12d474a41) ) - ROM_LOAD32_BYTE( "ap-15c.74", 0x080003, 0x20000, CRC(1ffd5496) SHA1(25efb568957fc9441a40a7d64cc6afe1a14b392b) ) - - ROM_REGION( 0x18000, "text", 0 ) - ROM_LOAD( "ap-18e.73", 0x000000, 0x10000, CRC(d7861a26) SHA1(b1a1e089a293a5536d342c9edafbea303f4f128c) ) - ROM_LOAD( "ap-16e.63", 0x008000, 0x10000, CRC(d3251965) SHA1(aef4f58a6f773060434abda9d7f5f003693577bf) ) - ROM_LOAD( "ap-17e.68", 0x008000, 0x08000, CRC(4509c2ed) SHA1(97a6a6710e83aca212ce43d06c3f26c35f9782b8) ) - - ROM_REGION( 0x40000, "oki", 0 ) /* ADPCM samples */ - ROM_LOAD( "ap-28c.171", 0x000000, 0x20000, CRC(b349f0c2) SHA1(cb1ff1c0e784f669c87ab1eccd3b358950761b74) ) - ROM_LOAD( "ap-29c.176", 0x020000, 0x10000, CRC(b38fced3) SHA1(72f61a719f393957bcccf14687bfbb2e7a5f7aee) ) - - ROM_REGION( 0x200, "proms", 0 ) /* Road stripe PROM */ - ROM_LOAD( "am27s29.ic41", 0x000, 0x200, CRC(c981f1e0) SHA1(7d8492d9f4033ab3734c09ee23016a0b210648b5) ) -ROM_END - -ROM_START( roundup5 ) - ROM_REGION16_LE( 0x80000, "master_rom", 0 ) /* v30 main cpu */ - ROM_LOAD16_BYTE( "ru-23s", 0x000000, 0x20000, CRC(2dc8c521) SHA1(b78de101db3ef00fc4375ae32a7871e0da2dac6c) ) - ROM_LOAD16_BYTE( "ru-26s", 0x000001, 0x20000, CRC(1e16b531) SHA1(d7badef29cf1c4a9bd262933ecd1ca3343ea94bd) ) - ROM_LOAD16_BYTE( "ru-22t", 0x040000, 0x20000, CRC(9611382e) SHA1(c99258782dbad6d69ba7f54115ee3aa218f9b6ee) ) - ROM_LOAD16_BYTE( "ru-25t", 0x040001, 0x20000, CRC(b6cd0f2d) SHA1(61925c2346d79baaf9bce3d19a7dfc45b8232f92) ) - - ROM_REGION16_BE( 0x80000, "slave_rom", 0 ) /* 68000 sub cpu */ - ROM_LOAD16_BYTE( "ru-20s", 0x000000, 0x20000, CRC(c5524558) SHA1(a94e7e4548148c83a332524ab4e06607732e13d5) ) - ROM_LOAD16_BYTE( "ru-18s", 0x000001, 0x20000, CRC(163ef03d) SHA1(099ac2d74164bdc6402b08efb521f49275780858) ) - ROM_LOAD16_BYTE( "ru-21s", 0x040000, 0x20000, CRC(b9f91b70) SHA1(43c5d9dafb60ed3e5c3eb0e612c2dbc5497f8a6c) ) - ROM_LOAD16_BYTE( "ru-19s", 0x040001, 0x20000, CRC(e3953800) SHA1(28fbc6bf154b512fcefeb04fe12db598b1b20cfe) ) - - ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k code for sound Z80 */ - ROM_LOAD( "ru-28d", 0x000000, 0x10000, CRC(df36c6c5) SHA1(c046482043f6b54c55696ba3d339ffb11d78f674) ) - - ROM_REGION( 0x180000, "sprites", ROMREGION_ERASE00 ) - /* Filled in by both regions below */ - - ROM_REGION( 0x0c0000, "sprites_l", 0) - ROM_LOAD32_BYTE( "ru-00b", 0x000000, 0x20000, CRC(388a0647) SHA1(e4ab43832872f44c0fe1aaede4372cc00ca7d32b) ) - ROM_LOAD32_BYTE( "ru-02b", 0x000001, 0x20000, CRC(eff33945) SHA1(3f4c3aaa11ccf945c2f898dfdf815705d8539e21) ) - ROM_LOAD32_BYTE( "ru-04b", 0x000002, 0x20000, CRC(40fda247) SHA1(f5fbc07fda024baedf35ac209210e94df9f15065) ) - ROM_LOAD32_BYTE( "ru-06b", 0x000003, 0x20000, CRC(cd2484f3) SHA1(a23a4d36a8b913104bcc75228317b2979afec888) ) - ROM_LOAD32_BYTE( "ru-01b", 0x080000, 0x10000, CRC(5e91f401) SHA1(df976c5ba0f14b14f5642b5ca35b996bca64e369) ) - ROM_LOAD32_BYTE( "ru-03b", 0x080001, 0x10000, CRC(2fb109de) SHA1(098c103e6bae0f52ec66f0cdda2da60bd7108736) ) - ROM_LOAD32_BYTE( "ru-05b", 0x080002, 0x10000, CRC(23dd10e1) SHA1(f30ff1a8c7ed9bc567b901cbdd202028fffb9f80) ) - ROM_LOAD32_BYTE( "ru-07b", 0x080003, 0x10000, CRC(bb40f46e) SHA1(da694e16d19f60a0dee47551f00f3e50b2d5dcaf) ) - - ROM_REGION( 0x0c0000, "sprites_h", 0) - ROM_LOAD32_BYTE( "ru-08b", 0x000000, 0x20000, CRC(01729e3c) SHA1(1445287fde0b993d053aab73efafc902a6b7e2cc) ) - ROM_LOAD32_BYTE( "ru-10b", 0x000001, 0x20000, CRC(cd2357a7) SHA1(313460a74244325ce2c659816f2b738f3dc5358a) ) - ROM_LOAD32_BYTE( "ru-12b", 0x000002, 0x20000, CRC(ca63b1f8) SHA1(a50ef8259745dc166eb0a1b2c812ff620818a755) ) - ROM_LOAD32_BYTE( "ru-14b", 0x000003, 0x20000, CRC(dde79bfc) SHA1(2d5888189a6f954801f248a3365e328370fed837) ) - ROM_LOAD32_BYTE( "ru-09b", 0x080000, 0x10000, CRC(629ac0a6) SHA1(c3eeccd6c07be7455cf180c9c7d5efcd6d08c0b5) ) - ROM_LOAD32_BYTE( "ru-11b", 0x080001, 0x10000, CRC(fe3fbf53) SHA1(7400c088025ac22e5d9db816792533fc02f2dcf5) ) - ROM_LOAD32_BYTE( "ru-13b", 0x080002, 0x10000, CRC(d0f6e747) SHA1(ef15ed41124b2d37bc6e92254138690dd644e50f) ) - ROM_LOAD32_BYTE( "ru-15b", 0x080003, 0x10000, CRC(6ee6b22e) SHA1(a28edaf23ca6c7231264de962d5ea37bad39f996) ) - - ROM_REGION( 0x40000, "oki", 0 ) /* ADPCM samples */ - ROM_LOAD( "ru-17b", 0x000000, 0x20000, CRC(82391b47) SHA1(6b1977522c6e906503abc50bdd24c4c38cdc9bdb) ) - ROM_LOAD( "ru-16b", 0x020000, 0x10000, CRC(374fe170) SHA1(5d190a2735698b0384948bfdb1a900f56f0d7ebc) ) -ROM_END - -ROM_START( cyclwarr ) - ROM_REGION16_BE( 0x200000, "master_rom", 0 ) /* 68000 main cpu */ - ROM_LOAD16_BYTE( "cw16c.ic77", 0x000000, 0x20000, CRC(4d88892b) SHA1(dc85231a3c4f83118922c13615381f185bcee832) ) - ROM_LOAD16_BYTE( "cw18c.ic98", 0x000001, 0x20000, CRC(4ff56209) SHA1(d628dc3fdc3e9de568ba8dbabf8e13a62e20a215) ) - ROM_COPY("master_rom", 0x000000, 0x040000, 0x040000 ) - ROM_COPY("master_rom", 0x000000, 0x080000, 0x040000 ) - ROM_COPY("master_rom", 0x000000, 0x0c0000, 0x040000 ) - ROM_LOAD16_BYTE( "cw17b.ic78", 0x100000, 0x20000, CRC(da998afc) SHA1(dd9377ce079df5c66bdb29dfd333428cce817656) ) - ROM_LOAD16_BYTE( "cw19b.ic99", 0x100001, 0x20000, CRC(c15a8413) SHA1(647b2a994a4912b5d7dc71b875f5d08c14412c6a) ) - ROM_COPY("master_rom", 0x100000, 0x140000, 0x040000 ) - ROM_COPY("master_rom", 0x100000, 0x180000, 0x040000 ) - ROM_COPY("master_rom", 0x100000, 0x1c0000, 0x040000 ) - ROM_REGION16_BE( 0x100000, "slave_rom", 0 ) /* 68000 sub cpu */ - ROM_LOAD16_BYTE( "cw20b.ic100", 0x000000, 0x20000, CRC(4d75292a) SHA1(71d59c1d03b323d4021209a7f0506b4a855a73af) ) - ROM_LOAD16_BYTE( "cw22b.ic102", 0x000001, 0x20000, CRC(0aec0ba4) SHA1(d559e54d303afac4a981c4a933a05278044ac068) ) - ROM_COPY("slave_rom", 0x000000, 0x040000, 0x040000 ) - ROM_LOAD16_BYTE( "cw21.ic101", 0x080000, 0x20000, CRC(ed90d956) SHA1(f533f93da31ac6eb631fb506357717e7cac8e186) ) - ROM_LOAD16_BYTE( "cw23.ic103", 0x080001, 0x20000, CRC(009cdc78) SHA1(a77933a7736546397e8c69226703d6f9be7b55e5) ) - ROM_COPY("slave_rom", 0x080000, 0x0c0000, 0x040000 ) - - ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k code for sound Z80 */ - ROM_LOAD( "cw26a.ic91", 0x000000, 0x10000, CRC(f7a70e3a) SHA1(5581633bf1f15d7f5c1e03de897d65d60f9f1e33) ) - - ROM_REGION( 0x200000, "sprites", ROMREGION_ERASE00 ) - /* Filled in by both regions below */ - - ROM_REGION( 0x100000, "sprites_l", 0) - ROM_LOAD32_BYTE( "cw00a.ic26", 0x000000, 0x20000, CRC(058a77f1) SHA1(93f99fcf6ce6714d76af6f6e930115516f0379d3) ) - ROM_LOAD32_BYTE( "cw08a.ic45", 0x000001, 0x20000, CRC(f53993e7) SHA1(ef2d502ab180d2bc0bdb698c2878fdee9a2c33a8) ) - ROM_LOAD32_BYTE( "cw02a.ic28", 0x000002, 0x20000, CRC(4dadf3cb) SHA1(e42c56e295a443cb605d48eba23a16fab3c86525) ) - ROM_LOAD32_BYTE( "cw10a.ic47", 0x000003, 0x20000, CRC(3b7cd251) SHA1(52b9637404fa193421294dfb52c1a7bba0d94c9b) ) - ROM_LOAD32_BYTE( "cw01a.ic27", 0x080000, 0x20000, CRC(7c639948) SHA1(d58ff5735cd3179ffafead385a625baa7962e1d0) ) - ROM_LOAD32_BYTE( "cw09a.ic46", 0x080001, 0x20000, CRC(4ba24af5) SHA1(9203c2639e04aaa09996339f11259750ff8129b9) ) - ROM_LOAD32_BYTE( "cw03a.ic29", 0x080002, 0x20000, CRC(3ca6f98e) SHA1(8526fe38d3b4c66e09049ba18651a9e7255d85d6) ) - ROM_LOAD32_BYTE( "cw11a.ic48", 0x080003, 0x20000, CRC(5d760392) SHA1(7bbda2880af4659c267193ce10ed887a1b54a981) ) - - ROM_REGION( 0x100000, "sprites_h", 0) - ROM_LOAD32_BYTE( "cw04a.ic30", 0x000000, 0x20000, CRC(f05f594d) SHA1(80effaa517b2154c013419e0bc05fd0797b74c8d) ) - ROM_LOAD32_BYTE( "cw12a.ic49", 0x000001, 0x20000, CRC(4ac07e8b) SHA1(f9de96fba39d5752d61b8f6be87fb605694624ed) ) - ROM_LOAD32_BYTE( "cw06a.ic32", 0x000002, 0x20000, CRC(f628edc9) SHA1(473f7ec28000e6bf72782c1c3f4afb5e021bd430) ) - ROM_LOAD32_BYTE( "cw14a.ic51", 0x000003, 0x20000, CRC(a9131f5f) SHA1(3a2059946984733e6939f3298f0db676e6a3301b) ) - ROM_LOAD32_BYTE( "cw05a.ic31", 0x080000, 0x20000, CRC(c8f5faa9) SHA1(f374531ffd645597eeb1440fd2cadb426fcd3d79) ) - ROM_LOAD32_BYTE( "cw13a.ic50", 0x080001, 0x20000, CRC(8091d381) SHA1(7faf068ce20b2877559f0335df55d61be13146b4) ) - ROM_LOAD32_BYTE( "cw07a.ic33", 0x080002, 0x20000, CRC(314579b5) SHA1(3c10ec490f7821a5b5412295232bbb104d0e4b83) ) - ROM_LOAD32_BYTE( "cw15a.ic52", 0x080003, 0x20000, CRC(7ed4b721) SHA1(b87865effeff77a9ea74354ef2b5911a5102a647) ) - - ROM_REGION( 0x20000, "cw_tileclut", 0 ) - ROM_LOAD( "cw27.ic128", 0x000000, 0x20000, CRC(2db48a9e) SHA1(16c307340d17cd3b5455ebcee681fbe0335dec58) ) - - ROM_REGION( 0x60000, "tilerom", 0 ) - ROM_LOAD( "cw30.ic73", 0x000000, 0x20000, CRC(331d0711) SHA1(82251fe1f1d36f079080943ab1fd04a60077c353) ) - ROM_LOAD( "cw29.ic72", 0x020000, 0x20000, CRC(64dd519c) SHA1(e23611fc2be896861997063546c3eb03527eaf8e) ) - ROM_LOAD( "cw28.ic71", 0x040000, 0x20000, CRC(3fc568ed) SHA1(91125c9deddc659449ca6791a847fe908c2818b2) ) - - ROM_REGION( 0x40000, "oki", 0 ) /* ADPCM samples */ - ROM_LOAD( "cw24a.ic39", 0x000000, 0x20000, CRC(22600cba) SHA1(a1514fbe037942f1493a17eb0b7986949470cb22) ) - ROM_LOAD( "cw25a.ic40", 0x020000, 0x20000, CRC(372c6bc8) SHA1(d4875bf3bffecf338bebba3b8d6a791585556a06) ) -ROM_END - -ROM_START( cyclwarra ) - ROM_REGION16_BE( 0x200000, "master_rom", 0 ) /* 68000 main cpu */ - ROM_LOAD16_BYTE( "cw16b.ic77", 0x000000, 0x20000, CRC(cb1a737a) SHA1(a603ee1256be5641d00a72f64efaaacb65ed9d7d) ) - ROM_LOAD16_BYTE( "cw18b.ic98", 0x000001, 0x20000, CRC(0633ddcb) SHA1(1196ab17065352ec5b37f2f6b383a43a2d0fa3a6) ) - ROM_COPY("master_rom", 0x000000, 0x040000, 0x040000 ) - ROM_COPY("master_rom", 0x000000, 0x080000, 0x040000 ) - ROM_COPY("master_rom", 0x000000, 0x0c0000, 0x040000 ) - ROM_LOAD16_BYTE( "cw17a.ic78", 0x100000, 0x20000, CRC(2ad6f836) SHA1(5fa4275b433013943ba1d1b64a3c725097f946f9) ) - ROM_LOAD16_BYTE( "cw19a.ic99", 0x100001, 0x20000, CRC(d3853658) SHA1(c9338083a04f55bd22285176831f4b0bdb78564f) ) - ROM_COPY("master_rom", 0x100000, 0x140000, 0x040000 ) - ROM_COPY("master_rom", 0x100000, 0x180000, 0x040000 ) - ROM_COPY("master_rom", 0x100000, 0x1c0000, 0x040000 ) - - ROM_REGION16_BE( 0x100000, "slave_rom", 0 ) /* 68000 sub cpu */ - ROM_LOAD16_BYTE( "cw20a.ic100", 0x000000, 0x20000, CRC(c3578ac1) SHA1(21d369da874f01922d0f0b757a42b4321df891d4) ) - ROM_LOAD16_BYTE( "cw22a.ic102", 0x000001, 0x20000, CRC(5339ed24) SHA1(5b0a54c2442dcf7373ff8b55b91af9772473ff77) ) - ROM_COPY("slave_rom", 0x000000, 0x040000, 0x040000 ) - ROM_LOAD16_BYTE( "cw21.ic101", 0x080000, 0x20000, CRC(ed90d956) SHA1(f533f93da31ac6eb631fb506357717e7cac8e186) ) - ROM_LOAD16_BYTE( "cw23.ic103", 0x080001, 0x20000, CRC(009cdc78) SHA1(a77933a7736546397e8c69226703d6f9be7b55e5) ) - ROM_COPY("slave_rom", 0x080000, 0x0c0000, 0x040000 ) - - ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k code for sound Z80 */ - ROM_LOAD( "cw26a.ic91", 0x000000, 0x10000, CRC(f7a70e3a) SHA1(5581633bf1f15d7f5c1e03de897d65d60f9f1e33) ) - - ROM_REGION( 0x200000, "sprites", ROMREGION_ERASE00 ) - /* Filled in by both regions below */ - - ROM_REGION( 0x100000, "sprites_l", 0) - ROM_LOAD32_BYTE( "cw00a.ic26", 0x000000, 0x20000, CRC(058a77f1) SHA1(93f99fcf6ce6714d76af6f6e930115516f0379d3) ) - ROM_LOAD32_BYTE( "cw08a.ic45", 0x000001, 0x20000, CRC(f53993e7) SHA1(ef2d502ab180d2bc0bdb698c2878fdee9a2c33a8) ) - ROM_LOAD32_BYTE( "cw02a.ic28", 0x000002, 0x20000, CRC(4dadf3cb) SHA1(e42c56e295a443cb605d48eba23a16fab3c86525) ) - ROM_LOAD32_BYTE( "cw10a.ic47", 0x000003, 0x20000, CRC(3b7cd251) SHA1(52b9637404fa193421294dfb52c1a7bba0d94c9b) ) - ROM_LOAD32_BYTE( "cw01a.ic27", 0x080000, 0x20000, CRC(7c639948) SHA1(d58ff5735cd3179ffafead385a625baa7962e1d0) ) - ROM_LOAD32_BYTE( "cw09a.ic46", 0x080001, 0x20000, CRC(4ba24af5) SHA1(9203c2639e04aaa09996339f11259750ff8129b9) ) - ROM_LOAD32_BYTE( "cw03a.ic29", 0x080002, 0x20000, CRC(3ca6f98e) SHA1(8526fe38d3b4c66e09049ba18651a9e7255d85d6) ) - ROM_LOAD32_BYTE( "cw11a.ic48", 0x080003, 0x20000, CRC(5d760392) SHA1(7bbda2880af4659c267193ce10ed887a1b54a981) ) - - ROM_REGION( 0x100000, "sprites_h", 0) - ROM_LOAD32_BYTE( "cw04a.ic30", 0x000000, 0x20000, CRC(f05f594d) SHA1(80effaa517b2154c013419e0bc05fd0797b74c8d) ) - ROM_LOAD32_BYTE( "cw12a.ic49", 0x000001, 0x20000, CRC(4ac07e8b) SHA1(f9de96fba39d5752d61b8f6be87fb605694624ed) ) - ROM_LOAD32_BYTE( "cw06a.ic32", 0x000002, 0x20000, CRC(f628edc9) SHA1(473f7ec28000e6bf72782c1c3f4afb5e021bd430) ) - ROM_LOAD32_BYTE( "cw14a.ic51", 0x000003, 0x20000, CRC(a9131f5f) SHA1(3a2059946984733e6939f3298f0db676e6a3301b) ) - ROM_LOAD32_BYTE( "cw05a.ic31", 0x080000, 0x20000, CRC(c8f5faa9) SHA1(f374531ffd645597eeb1440fd2cadb426fcd3d79) ) - ROM_LOAD32_BYTE( "cw13a.ic50", 0x080001, 0x20000, CRC(8091d381) SHA1(7faf068ce20b2877559f0335df55d61be13146b4) ) - ROM_LOAD32_BYTE( "cw07a.ic33", 0x080002, 0x20000, CRC(314579b5) SHA1(3c10ec490f7821a5b5412295232bbb104d0e4b83) ) - ROM_LOAD32_BYTE( "cw15a.ic52", 0x080003, 0x20000, CRC(7ed4b721) SHA1(b87865effeff77a9ea74354ef2b5911a5102a647) ) - - ROM_REGION( 0x20000, "cw_tileclut", 0 ) - ROM_LOAD( "cw27.ic128", 0x000000, 0x20000, CRC(2db48a9e) SHA1(16c307340d17cd3b5455ebcee681fbe0335dec58) ) - - ROM_REGION( 0x60000, "tilerom", 0 ) - ROM_LOAD( "cw30.ic73", 0x000000, 0x20000, CRC(331d0711) SHA1(82251fe1f1d36f079080943ab1fd04a60077c353) ) - ROM_LOAD( "cw29.ic72", 0x020000, 0x20000, CRC(64dd519c) SHA1(e23611fc2be896861997063546c3eb03527eaf8e) ) - ROM_LOAD( "cw28.ic71", 0x040000, 0x20000, CRC(3fc568ed) SHA1(91125c9deddc659449ca6791a847fe908c2818b2) ) - - ROM_REGION( 0x40000, "oki", 0 ) /* ADPCM samples */ - ROM_LOAD( "cw24a.ic39", 0x000000, 0x20000, CRC(22600cba) SHA1(a1514fbe037942f1493a17eb0b7986949470cb22) ) - ROM_LOAD( "cw25a.ic40", 0x020000, 0x20000, CRC(372c6bc8) SHA1(d4875bf3bffecf338bebba3b8d6a791585556a06) ) -ROM_END - -ROM_START( cyclwarrb ) - ROM_REGION16_BE( 0x200000, "master_rom", 0 ) /* 68000 main cpu */ - ROM_LOAD16_BYTE( "cw16.ic77", 0x000000, 0x20000, CRC(47d57cf9) SHA1(9954f3eae496d3e3552f5537d93d798fa8a397b6) ) - ROM_LOAD16_BYTE( "cw18.ic98", 0x000001, 0x20000, CRC(7d541f9e) SHA1(eab9098f08c103d6b96cb0aebe65f53a9cb361fb) ) - ROM_COPY("master_rom", 0x000000, 0x040000, 0x040000 ) - ROM_COPY("master_rom", 0x000000, 0x080000, 0x040000 ) - ROM_COPY("master_rom", 0x000000, 0x0c0000, 0x040000 ) - ROM_LOAD16_BYTE( "cw17.ic78", 0x100000, 0x20000, CRC(008bdf09) SHA1(17f739a65382caf81314840ca491f600e09c3f32) ) - ROM_LOAD16_BYTE( "cw19.ic99", 0x100001, 0x20000, CRC(e82244e0) SHA1(8887927fe74c160bc3b5c1293e0787bd9c9d2bff) ) - ROM_COPY("master_rom", 0x100000, 0x140000, 0x040000 ) - ROM_COPY("master_rom", 0x100000, 0x180000, 0x040000 ) - ROM_COPY("master_rom", 0x100000, 0x1c0000, 0x040000 ) - - ROM_REGION16_BE( 0x100000, "slave_rom", 0 ) /* 68000 sub cpu */ - ROM_LOAD16_BYTE( "cw20.ic100", 0x000000, 0x20000, CRC(c7a6fa85) SHA1(d696c8b9432c07abad3c4ab611d53742970c1fbc) ) - ROM_LOAD16_BYTE( "cw22.ic102", 0x000001, 0x20000, CRC(917c1a2a) SHA1(612d81b8cf68c61206e85926b95238ebcdc22ca3) ) - ROM_COPY("slave_rom", 0x000000, 0x040000, 0x040000 ) - ROM_LOAD16_BYTE( "cw21.ic101", 0x080000, 0x20000, CRC(ed90d956) SHA1(f533f93da31ac6eb631fb506357717e7cac8e186) ) - ROM_LOAD16_BYTE( "cw23.ic103", 0x080001, 0x20000, CRC(009cdc78) SHA1(a77933a7736546397e8c69226703d6f9be7b55e5) ) - ROM_COPY("slave_rom", 0x080000, 0x0c0000, 0x040000 ) - - ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k code for sound Z80 */ - ROM_LOAD( "cw26.ic91", 0x000000, 0x10000, CRC(a6485a3a) SHA1(b4fcf541efe48b3ca32065221fe2f59476a4f96a) ) - - ROM_REGION( 0x200000, "sprites", ROMREGION_ERASE00 ) - /* Filled in by both regions below */ - - ROM_REGION( 0x100000, "sprites_l", 0) - ROM_LOAD32_BYTE( "cw00.ic26", 0x000000, 0x20000, CRC(ba00c582) SHA1(2cd645b828595acbe62e2f7aad037fcbdc5a543f) ) - ROM_LOAD32_BYTE( "cw08.ic45", 0x000001, 0x20000, CRC(1583e576) SHA1(646762d1d181231090a18698378f60d09f26f49f) ) - ROM_LOAD32_BYTE( "cw02.ic28", 0x000002, 0x20000, CRC(8376a744) SHA1(633d20199382f760adfb528f5b13730ddf9016e3) ) - ROM_LOAD32_BYTE( "cw10.ic47", 0x000003, 0x20000, CRC(901d849d) SHA1(601b5315717bc45b9ca3b64af019fd4437c65186) ) - ROM_LOAD32_BYTE( "cw01.ic27", 0x080000, 0x20000, CRC(35979022) SHA1(6de5c2a5edc5d76899d329f26bfa7b8b7c4f1919) ) - ROM_LOAD32_BYTE( "cw09.ic46", 0x080001, 0x20000, CRC(8114be09) SHA1(bade99653f8b4e3b5974f94d0cf0fdf2464d7dc7) ) - ROM_LOAD32_BYTE( "cw03.ic29", 0x080002, 0x20000, CRC(951ed812) SHA1(b3db6b467fd626936568773367099c9abcabfab6) ) - ROM_LOAD32_BYTE( "cw11.ic48", 0x080003, 0x20000, CRC(a7e5bf0b) SHA1(883b943d40f4516a21692beffb12514ad9301f20) ) - - ROM_REGION( 0x100000, "sprites_h", 0) - ROM_LOAD32_BYTE( "cw04.ic30", 0x000000, 0x20000, CRC(890ea7b1) SHA1(737e58800aa6863aff043ba46c9cebc8ba6c1501) ) - ROM_LOAD32_BYTE( "cw12.ic49", 0x000001, 0x20000, CRC(1587e96d) SHA1(2ffcb27d90ef29bc79d0a29f46a1d43565935a15) ) - ROM_LOAD32_BYTE( "cw06.ic32", 0x000002, 0x20000, CRC(47decb23) SHA1(4868c01035175698cb8af7aae80627b51583213f) ) - ROM_LOAD32_BYTE( "cw14.ic51", 0x000003, 0x20000, CRC(a75072a1) SHA1(a988eda496f35204bfdade8aa24441dba440618c) ) - ROM_LOAD32_BYTE( "cw05.ic31", 0x080000, 0x20000, CRC(4e49fcc5) SHA1(e4541961bd2abfb91b76ce78fa705d5dd188e118) ) - ROM_LOAD32_BYTE( "cw13.ic50", 0x080001, 0x20000, CRC(51aee710) SHA1(1d9dc575d0110bd147439c5dd87fe6b4203d125d) ) - ROM_LOAD32_BYTE( "cw07.ic33", 0x080002, 0x20000, CRC(4f6b3c72) SHA1(98ab85f2848f0a0a5f37bf2d6292ad3a039040e1) ) - ROM_LOAD32_BYTE( "cw15.ic52", 0x080003, 0x20000, CRC(9cfc3b14) SHA1(33abb0df0fc1e12e22d35a68c583d2c0a236032e) ) - - ROM_REGION( 0x20000, "cw_tileclut", 0 ) - ROM_LOAD( "cw27.ic128", 0x000000, 0x20000, CRC(2db48a9e) SHA1(16c307340d17cd3b5455ebcee681fbe0335dec58) ) - - ROM_REGION( 0x60000, "tilerom", 0 ) - ROM_LOAD( "cw30.ic73", 0x000000, 0x20000, CRC(331d0711) SHA1(82251fe1f1d36f079080943ab1fd04a60077c353) ) - ROM_LOAD( "cw29.ic72", 0x020000, 0x20000, CRC(64dd519c) SHA1(e23611fc2be896861997063546c3eb03527eaf8e) ) - ROM_LOAD( "cw28.ic71", 0x040000, 0x20000, CRC(3fc568ed) SHA1(91125c9deddc659449ca6791a847fe908c2818b2) ) - - ROM_REGION( 0x40000, "oki", 0 ) /* ADPCM samples */ - ROM_LOAD( "cw24.ic39", 0x000000, 0x20000, CRC(08656756) SHA1(37352ce488c8af36a50c51fa319caed4f2391d72) ) - ROM_LOAD( "cw25.ic40", 0x020000, 0x20000, CRC(36c0b8a6) SHA1(d1519c919fa51b1fc157d5314709a3e6e0b7a5c8) ) -ROM_END - -ROM_START( bigfight ) - ROM_REGION16_BE( 0x200000, "master_rom", 0 ) /* 68000 main cpu */ - ROM_LOAD16_BYTE( "rom16.ic77", 0x000000, 0x40000, CRC(e7304ec8) SHA1(31a37e96bf963b349d36534bc5ebbf45e19ad00e) ) - ROM_LOAD16_BYTE( "rom17.ic98", 0x000001, 0x40000, CRC(4cf090f6) SHA1(9ae0274c890e829a90108ce316aff9665128c982) ) - ROM_COPY("master_rom", 0x000000, 0x080000, 0x080000 ) - ROM_COPY("master_rom", 0x100000, 0x080000, 0x080000 ) - ROM_COPY("master_rom", 0x180000, 0x080000, 0x080000 ) - - ROM_REGION16_BE( 0x100000, "slave_rom", 0 ) /* 68000 sub cpu */ - ROM_LOAD16_BYTE( "rom18.ic100", 0x000000, 0x40000, CRC(49df6207) SHA1(c4126f4542add11a3a3d236311c8787c24c98440) ) - ROM_LOAD16_BYTE( "rom19.ic102", 0x000001, 0x40000, CRC(c12aa9e9) SHA1(19cc7feaa97c6f5148ae8c0077174f96be684f05) ) - ROM_COPY("slave_rom", 0x000000, 0x080000, 0x080000 ) - - ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k code for sound Z80 */ - ROM_LOAD( "rom20.ic91", 0x000000, 0x10000, CRC(b3add091) SHA1(8a67bfff75c13fe4d9b89d30449199200d11cea7) ) // == bf36b.ic91 - - ROM_REGION( 0x400000, "sprites", ROMREGION_ERASE00 ) - /* Filled in by both regions below */ - - ROM_REGION( 0x200000, "sprites_l", 0 ) - ROM_LOAD32_BYTE( "rom0.ic26", 0x000000, 0x80000, CRC(a4a3c8d6) SHA1(b5365d9bc6068260c23ba9d5971c7c7d7cc07a97) ) - ROM_LOAD32_BYTE( "rom8.ic45", 0x000001, 0x80000, CRC(220956ed) SHA1(68e0ba1e850101b4cc2778819dfa76f04d88d2d6) ) - ROM_LOAD32_BYTE( "rom2.ic28", 0x000002, 0x80000, CRC(c4f6d243) SHA1(e23b241b5a40b332165a34e2f1bc4366973b2070) ) - ROM_LOAD32_BYTE( "rom10.ic47", 0x000003, 0x80000, CRC(0212d472) SHA1(5549461195fd7b6b43c0174462d7fe1a1bac24e9) ) - - ROM_REGION( 0x200000, "sprites_h", 0 ) - ROM_LOAD32_BYTE( "rom4.ic30", 0x000000, 0x80000, CRC(999ff7e9) SHA1(a53b06ad084722d7a52fcf01c52967f68620e609) ) - ROM_LOAD32_BYTE( "rom12.ic49", 0x000001, 0x80000, CRC(cb4c1f0b) SHA1(32d64b78ed3d5971eb5d25be2c38e6f2c9048f74) ) - ROM_LOAD32_BYTE( "rom6.ic32", 0x000002, 0x80000, CRC(f70e2d47) SHA1(00517b5f3b2deb6f3f3bd12df421e63884c22b2e) ) - ROM_LOAD32_BYTE( "rom14.ic51", 0x000003, 0x80000, CRC(77430bc9) SHA1(0b1fd54ace84a9fb5b44d5600de8089a20bcbd47) ) - - ROM_REGION( 0x20000, "cw_tileclut", 0 ) - ROM_LOAD( "rom21.ic128", 0x000000, 0x20000, CRC(da027dcf) SHA1(47d18a8a273fea72cb3ad3d58166fe38ca28a860) ) // == bf27.ic128 - - ROM_REGION( 0x60000, "tilerom", 0 ) - ROM_LOAD( "rom24.ic73", 0x000000, 0x20000, CRC(c564185d) SHA1(e9b5fc10a5a5014735852c22db2a054d5787d8cb) ) // == bf30.ic73 - ROM_LOAD( "rom23.ic72", 0x020000, 0x20000, CRC(f8bb340b) SHA1(905a1ec778d6ed5c6f53d9d08cd105eed7e307ca) ) // == bf29.ic72 - ROM_LOAD( "rom22.ic71", 0x040000, 0x20000, CRC(fb505074) SHA1(b6d9b20be7c3e971e5a4392736f087e807b9c850) ) // == bf28.ic71 - - ROM_REGION( 0x40000, "oki", 0 ) /* ADPCM samples */ - ROM_LOAD( "rom15.ic39", 0x000000, 0x40000, CRC(58d136e8) SHA1(4aa063c4b9b057cba4655ecbe44a87c8c411e3aa) ) // == bf24.ic39 + bf25.ic40 -ROM_END - -ROM_START( bigfightj ) // ABA-011 main board + ABA-012 daughter board - ROM_REGION16_BE( 0x200000, "master_rom", 0 ) /* 68000 main cpu */ - ROM_LOAD16_BYTE( "bfj16f.ic77", 0x000000, 0x20000, CRC(9141a488) SHA1(f8b64d2ef6fcea7922f88ed75977f764e98e679b) ) // rev F - ROM_LOAD16_BYTE( "bf18f.ic98", 0x000001, 0x20000, CRC(f23a4935) SHA1(513f2b3a83a0a7c183b2ff20b652279a5bee8863) ) // rev F - ROM_COPY("master_rom", 0x000000, 0x040000, 0x040000 ) - ROM_COPY("master_rom", 0x000000, 0x080000, 0x040000 ) - ROM_COPY("master_rom", 0x000000, 0x0c0000, 0x040000 ) - ROM_LOAD16_BYTE( "bf17e.ic78", 0x100000, 0x20000, CRC(5e5d023d) SHA1(04f59458f15c95ad152b1b99f885f31ccb26ac40) ) // rev E - ROM_LOAD16_BYTE( "bf19e.ic99", 0x100001, 0x20000, CRC(5329e151) SHA1(a7ce98d80379f56808291c42852b1f7173966ed7) ) // rev E - ROM_COPY("master_rom", 0x100000, 0x140000, 0x040000 ) - ROM_COPY("master_rom", 0x100000, 0x180000, 0x040000 ) - ROM_COPY("master_rom", 0x100000, 0x1c0000, 0x040000 ) - - ROM_REGION16_BE( 0x100000, "slave_rom", 0 ) /* 68000 sub cpu */ - ROM_LOAD16_BYTE( "bf20.ic100", 0x000000, 0x20000, CRC(5bd44e11) SHA1(a7acb6d9f40c4b6d54bf131a2e192c16ec22b1af) ) - ROM_LOAD16_BYTE( "bf22.ic102", 0x000001, 0x20000, CRC(e52c29ab) SHA1(2b3aa55a2eeec5cf73666e1d85f65679961472e0) ) - ROM_COPY("slave_rom", 0x000000, 0x040000, 0x040000 ) - ROM_LOAD16_BYTE( "bf21d.ic101", 0x080000, 0x20000, CRC(c4c2f969) SHA1(69f453d51951c02f12f3a40ac925b48430e3f314) ) // rev D - ROM_LOAD16_BYTE( "bf23d.ic103", 0x080001, 0x20000, CRC(c05ae1fe) SHA1(219ddc08d4b8416fb2a9f2cb14ac9c4b4421dadd) ) // rev D - ROM_COPY("slave_rom", 0x080000, 0x0c0000, 0x040000 ) - - ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k code for sound Z80 */ - ROM_LOAD( "bf36b.ic91", 0x000000, 0x10000, CRC(b3add091) SHA1(8a67bfff75c13fe4d9b89d30449199200d11cea7) ) // rev B - - ROM_REGION( 0x400000, "sprites", ROMREGION_ERASE00 ) - /* Filled in by both regions below */ - - ROM_REGION( 0x200000, "sprites_l", 0 ) - ROM_LOAD32_BYTE( "bf00d.ic26", 0x000000, 0x40000, CRC(f506d508) SHA1(86255631ac139f1b5c0f5d6e54a0858625497a1e) ) // all rev D - ROM_LOAD32_BYTE( "bf08d.ic45", 0x000001, 0x40000, CRC(4bf948b9) SHA1(c65b95c454d04c7e4a0cf426ac2d45ddc5e8885e) ) - ROM_LOAD32_BYTE( "bf02d.ic28", 0x000002, 0x40000, CRC(af30acf7) SHA1(8f4778b33abb18b113d5d27c0e957d633557c988) ) - ROM_LOAD32_BYTE( "bf10d.ic47", 0x000003, 0x40000, CRC(ffddb7f8) SHA1(505c082adaf71bd2aa15d78d3e8968cbd1f2cc0c) ) - ROM_LOAD32_BYTE( "bf01d.ic27", 0x100000, 0x20000, CRC(ec3f5f17) SHA1(436f176155af8fc3212507448df6852a76289bef) ) - ROM_LOAD32_BYTE( "bf09d.ic46", 0x100001, 0x20000, CRC(284837ed) SHA1(b1c130b45ff0f22985962240c47b7b01df6ac636) ) - ROM_LOAD32_BYTE( "bf03d.ic29", 0x100002, 0x20000, CRC(2ba0398e) SHA1(ec9a29b661b18980c07a446afc89becb1ebddd57) ) - ROM_LOAD32_BYTE( "bf11d.ic48", 0x100003, 0x20000, CRC(3f2fa72f) SHA1(4b4821b6933ea753e092f11d80bcc7698f85ccf2) ) - ROM_COPY("sprites_l", 0x100000, 0x180000, 0x080000 ) - - ROM_REGION( 0x200000, "sprites_h", 0) - ROM_LOAD32_BYTE( "bf04d.ic30", 0x000000, 0x40000, CRC(6203d320) SHA1(d58225d8a362971a0eb63c94abc1e8c76198fd2a) ) // all rev D - ROM_LOAD32_BYTE( "bf12d.ic49", 0x000001, 0x40000, CRC(d261dfa7) SHA1(e787901112780e9770300999722fc80aa1d7ab18) ) - ROM_LOAD32_BYTE( "bf06d.ic32", 0x000002, 0x40000, CRC(be187c3c) SHA1(46383eb40c0caeb1bc636630a4d849aa2d1a12d2) ) - ROM_LOAD32_BYTE( "bf14d.ic51", 0x000003, 0x40000, CRC(60f2ab3d) SHA1(babaef6348133b5fe34f9e044732467d8775cc3d) ) - ROM_LOAD32_BYTE( "bf05d.ic31", 0x100000, 0x20000, CRC(2229acbc) SHA1(3031fbb7b730a6d51f08d0021c5d6e91cdbdd56d) ) - ROM_LOAD32_BYTE( "bf13d.ic50", 0x100001, 0x20000, CRC(1e46cd79) SHA1(c81c96b287a6cc91d3ab4dd8043153814560be3d) ) - ROM_LOAD32_BYTE( "bf07d.ic33", 0x100002, 0x20000, CRC(4940b0bb) SHA1(762f21055921093349ca09c35ef516bde6330aa8) ) - ROM_LOAD32_BYTE( "bf15d.ic52", 0x100003, 0x20000, CRC(dab0c80a) SHA1(a172937c9599acbd77dcac02ea7e43f576d66d8c) ) - ROM_COPY("sprites_h", 0x100000, 0x180000, 0x080000 ) - - ROM_REGION( 0x20000, "cw_tileclut", 0 ) - ROM_LOAD( "bf27.ic128", 0x000000, 0x20000, CRC(da027dcf) SHA1(47d18a8a273fea72cb3ad3d58166fe38ca28a860) ) - - ROM_REGION( 0x60000, "tilerom", 0 ) - ROM_LOAD( "bf30.ic73", 0x000000, 0x20000, CRC(c564185d) SHA1(e9b5fc10a5a5014735852c22db2a054d5787d8cb) ) - ROM_LOAD( "bf29.ic72", 0x020000, 0x20000, CRC(f8bb340b) SHA1(905a1ec778d6ed5c6f53d9d08cd105eed7e307ca) ) - ROM_LOAD( "bf28.ic71", 0x040000, 0x20000, CRC(fb505074) SHA1(b6d9b20be7c3e971e5a4392736f087e807b9c850) ) - - ROM_REGION( 0x40000, "oki", 0 ) /* ADPCM samples */ - ROM_LOAD( "bf24.ic39", 0x000000, 0x20000, CRC(9db80c8a) SHA1(9ce64713758ebab559a0cacc7f7501e5a1a0133a) ) - ROM_LOAD( "bf25.ic40", 0x020000, 0x20000, CRC(630154c4) SHA1(05902371b62a11c13f2582faa591945c037c6311) ) -ROM_END /***************************************************************************/ -void apache3_state::init_apache3() -{ - uint8_t *dst = memregion("sprites")->base(); - uint8_t *src1 = memregion("sprites_l")->base(); - uint8_t *src2 = memregion("sprites_h")->base(); - - for (int i = 0; i < 0x100000; i += 32) - { - memcpy(dst,src1,32); - src1+=32; - dst+=32; - memcpy(dst,src2,32); - dst+=32; - src2+=32; - } - // Copy sprite & palette data out of GFX rom area - m_rom_sprite_lookup[0] = memregion("sprites_l")->base(); - m_rom_sprite_lookup[1] = memregion("sprites_h")->base(); - m_rom_clut[0] = memregion("sprites_l")->base()+ 0x100000 - 0x800; - m_rom_clut[1] = memregion("sprites_h")->base()+ 0x100000 - 0x800; - - tatsumi_reset(); - - m_apache3_rot_idx = 0; - - save_item(NAME(m_apache3_rot_idx)); - save_item(NAME(m_apache3_rotate_ctrl)); - - // TODO: ym2151_set_port_write_handler for CT1/CT2 outputs -} - -void roundup5_state::init_roundup5() +void tatsumi_state::init_tatsumi() { - uint8_t *dst = memregion("sprites")->base(); - uint8_t *src1 = memregion("sprites_l")->base(); - uint8_t *src2 = memregion("sprites_h")->base(); - - for (int i = 0; i < 0xc0000; i += 32) - { - memcpy(dst,src1,32); - src1+=32; - dst+=32; - memcpy(dst,src2,32); - dst+=32; - src2+=32; - } - - // Copy sprite & palette data out of GFX rom area - m_rom_sprite_lookup[0] = memregion("sprites_l")->base(); - m_rom_sprite_lookup[1] = memregion("sprites_h")->base(); - m_rom_clut[0] = memregion("sprites_l")->base()+ 0xc0000 - 0x800; - m_rom_clut[1] = memregion("sprites_h")->base()+ 0xc0000 - 0x800; - - tatsumi_reset(); -} - -void cyclwarr_state::init_cyclwarr() -{ - uint8_t *dst = memregion("sprites")->base(); - uint8_t *src1 = memregion("sprites_l")->base(); - int len1 = memregion("sprites_l")->bytes(); - uint8_t *src2 = memregion("sprites_h")->base(); - int len2 = memregion("sprites_h")->bytes(); - - for (int i = 0; i < len1; i += 32) - { - memcpy(dst,src1,32); - src1+=32; - dst+=32; - memcpy(dst,src2,32); - dst+=32; - src2+=32; - } - - // Copy sprite & palette data out of GFX rom area - m_rom_sprite_lookup[0] = memregion("sprites_l")->base(); - m_rom_sprite_lookup[1] = memregion("sprites_h")->base(); - m_rom_clut[0] = memregion("sprites_l")->base() + len1 - 0x1000; - m_rom_clut[1] = memregion("sprites_h")->base() + len2 - 0x1000; - tatsumi_reset(); } /***************************************************************************/ - -/* http://www.tatsu-mi.co.jp/game/trace/index.html */ - -/* ** 1987 grayout - Gray Out (not dumped yet) */ -GAME( 1988, apache3, 0, apache3, apache3, apache3_state, init_apache3, ROT0, "Tatsumi", "Apache 3 (rev F)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_NOT_WORKING ) // Rev F CPU code -GAME( 1988, apache3a, apache3, apache3, apache3, apache3_state, init_apache3, ROT0, "Tatsumi", "Apache 3 (rev E)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_NOT_WORKING ) // Rev C & E CPU code -GAME( 1988, apache3b, apache3, apache3, apache3, apache3_state, init_apache3, ROT0, "Tatsumi (Kana Corporation license)", "Apache 3 (Kana Corporation license, rev G)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_NOT_WORKING ) // Rev C & G CPU code -GAMEL(1989, roundup5, 0, roundup5, roundup5, roundup5_state, init_roundup5, ROT0, "Tatsumi", "Round Up 5 - Super Delta Force", MACHINE_IMPERFECT_GRAPHICS | MACHINE_NOT_WORKING, layout_roundup5 ) -GAME( 1991, cyclwarr, 0, cyclwarr, cyclwarr, cyclwarr_state, init_cyclwarr, ROT0, "Tatsumi", "Cycle Warriors (rev C)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_NOT_WORKING ) // Rev C & B CPU code -GAME( 1991, cyclwarra, cyclwarr, cyclwarr, cyclwarb, cyclwarr_state, init_cyclwarr, ROT0, "Tatsumi", "Cycle Warriors (rev B)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_NOT_WORKING ) // Rev B & A CPU code -GAME( 1991, cyclwarrb, cyclwarr, cyclwarr, cyclwarb, cyclwarr_state, init_cyclwarr, ROT0, "Tatsumi", "Cycle Warriors", MACHINE_IMPERFECT_GRAPHICS | MACHINE_NOT_WORKING ) // Original version with no Rev roms -GAME( 1992, bigfight, 0, bigfight, bigfight, cyclwarr_state, init_cyclwarr, ROT0, "Tatsumi", "Big Fight - Big Trouble In The Atlantic Ocean", MACHINE_IMPERFECT_GRAPHICS ) -GAME( 1992, bigfightj, bigfight, bigfight, bigfight, cyclwarr_state, init_cyclwarr, ROT0, "Tatsumi", "Big Fight - Big Trouble In The Atlantic Ocean (Japan, rev F)", MACHINE_IMPERFECT_GRAPHICS ) // Rev D through F CPU codes diff --git a/src/mame/tatsumi/tatsumi.h b/src/mame/tatsumi/tatsumi.h index 751bebe430bad..295776dad63ea 100644 --- a/src/mame/tatsumi/tatsumi.h +++ b/src/mame/tatsumi/tatsumi.h @@ -5,6 +5,8 @@ #pragma once +#include "tzbx15_sprites.h" + #include "sound/okim6295.h" #include "sound/ymopm.h" #include "cpu/m68000/m68000.h" @@ -23,6 +25,7 @@ class tatsumi_state : public driver_device , m_subcpu(*this, "sub") , m_ym2151(*this, "ymsnd") , m_oki(*this, "oki") + , m_sprites(*this, "sprites") , m_gfxdecode(*this, "gfxdecode") , m_palette(*this, "palette") , m_videoram(*this, "videoram") @@ -33,9 +36,7 @@ class tatsumi_state : public driver_device , m_subregion(*this, "slave_rom") { } - void hd6445_crt_w(offs_t offset, uint8_t data); - INTERRUPT_GEN_MEMBER(v30_interrupt); - TILE_GET_INFO_MEMBER(get_text_tile_info); + void init_tatsumi(); protected: required_device m_maincpu; @@ -43,6 +44,7 @@ class tatsumi_state : public driver_device required_device m_subcpu; optional_device m_ym2151; required_device m_oki; + required_device m_sprites; required_device m_gfxdecode; required_device m_palette; @@ -53,213 +55,28 @@ class tatsumi_state : public driver_device required_memory_region m_mainregion; required_memory_region m_subregion; - uint8_t *m_rom_sprite_lookup[2]; - uint8_t *m_rom_clut[2]; - uint16_t m_control_word; - uint8_t m_last_control; - tilemap_t *m_tx_layer; - bitmap_rgb32 m_temp_bitmap; - std::unique_ptr m_shadow_pen_array; + static constexpr int CLOCK_1 = 16'000'000; + static constexpr int CLOCK_2 = 50'000'000; + + INTERRUPT_GEN_MEMBER(v30_interrupt); + TILE_GET_INFO_MEMBER(get_text_tile_info); + + void hd6445_crt_w(offs_t offset, uint8_t data); + void text_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); uint16_t tatsumi_v30_68000_r(offs_t offset); void tatsumi_v30_68000_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); uint16_t tatsumi_sprite_control_r(offs_t offset); void tatsumi_sprite_control_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); - void tatsumi_reset(); - template void draw_sprites(BitmapClass &bitmap, const rectangle &cliprect, int write_priority_only, int rambank); - template inline void roundupt_drawgfxzoomrotate( BitmapClass &dest_bmp, const rectangle &clip, - gfx_element *gfx, uint32_t code,uint32_t color,int flipx,int flipy,uint32_t ssx,uint32_t ssy, - int scalex, int scaley, int rotate, int write_priority_only ); - void update_cluts(int fake_palette_offset, int object_base, int length); - - uint8_t m_hd6445_reg[64]; void apply_shadow_bitmap(bitmap_rgb32 &bitmap, const rectangle &cliprect, bitmap_ind8 &shadow_bitmap, uint8_t xor_output); - uint8_t m_hd6445_address; -}; - -class apache3_state : public tatsumi_state -{ -public: - apache3_state(const machine_config &mconfig, device_type type, const char *tag) - : tatsumi_state(mconfig, type, tag) - , m_subcpu2(*this, "sub2") - , m_apache3_g_ram(*this, "apache3_g_ram") - , m_apache3_z80_ram(*this, "apache3_z80_ram") - , m_apache3_prom(*this, "proms") - , m_vr1(*this, "VR1") - { - } - - void apache3(machine_config &config); - - void init_apache3(); - -private: - uint16_t apache3_bank_r(); - void apache3_bank_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); - void apache3_z80_ctrl_w(uint16_t data); - uint16_t apache3_v30_v20_r(offs_t offset); - void apache3_v30_v20_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); - uint16_t apache3_z80_r(offs_t offset); - void apache3_z80_w(offs_t offset, uint16_t data); - uint8_t apache3_vr1_r(); - void apache3_rotate_w(uint16_t data); - void apache3_road_z_w(uint16_t data); - void apache3_road_x_w(offs_t offset, uint8_t data); - - DECLARE_MACHINE_RESET(apache3); - DECLARE_VIDEO_START(apache3); - uint32_t screen_update_apache3(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - void apache3_68000_reset(int state); - - void apache3_68000_map(address_map &map) ATTR_COLD; - void apache3_v20_map(address_map &map) ATTR_COLD; - void apache3_v30_map(address_map &map) ATTR_COLD; - void apache3_z80_map(address_map &map) ATTR_COLD; - - void draw_sky(bitmap_rgb32 &bitmap, const rectangle &cliprect, int palette_base, int start_offset); - void draw_ground(bitmap_rgb32 &dst, const rectangle &cliprect); - - required_device m_subcpu2; - - required_shared_ptr m_apache3_g_ram; - required_shared_ptr m_apache3_z80_ram; - required_region_ptr m_apache3_prom; - - required_ioport m_vr1; - - uint16_t m_apache3_rotate_ctrl[12]; - int m_apache3_rot_idx; - std::unique_ptr m_apache3_road_x_ram; - uint8_t m_apache3_road_z; -}; - -class roundup5_state : public tatsumi_state -{ -public: - roundup5_state(const machine_config &mconfig, device_type type, const char *tag) - : tatsumi_state(mconfig, type, tag) - , m_vregs(*this, "vregs") - , m_bg_scrollx(*this, "bg_scrollx") - , m_bg_scrolly(*this, "bg_scrolly") - , m_road_ctrl_ram(*this, "road_ctrl_ram") - , m_road_pixel_ram(*this, "road_pixel_ram") - , m_road_color_ram(*this, "road_color_ram") - , m_road_yclip(*this, "road_yclip") - , m_road_vregs(*this, "road_vregs") - { - } - - void roundup5(machine_config &config); - - void init_roundup5(); - -private: - uint16_t roundup_v30_z80_r(offs_t offset); - void roundup_v30_z80_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); - void roundup5_control_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); - void road_vregs_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); - uint8_t gfxdata_r(offs_t offset); - void gfxdata_w(offs_t offset, uint8_t data); - void output_w(uint8_t data); - - DECLARE_VIDEO_START(roundup5); - uint32_t screen_update_roundup5(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - - void roundup5_68000_map(address_map &map) ATTR_COLD; - void roundup5_v30_map(address_map &map) ATTR_COLD; - void roundup5_z80_map(address_map &map) ATTR_COLD; - -// virtual void machine_reset() override ATTR_COLD; - - void draw_road(bitmap_rgb32 &bitmap, const rectangle &cliprect); - void draw_landscape(bitmap_rgb32 &bitmap, const rectangle &cliprect, uint8_t type); - - required_shared_ptr m_vregs; - required_shared_ptr m_bg_scrollx; - required_shared_ptr m_bg_scrolly; - required_shared_ptr m_road_ctrl_ram; - required_shared_ptr m_road_pixel_ram; - required_shared_ptr m_road_color_ram; - required_shared_ptr m_road_yclip; - required_shared_ptr m_road_vregs; - - std::unique_ptr m_tx_gfxram; - std::unique_ptr m_bg_gfxram; -}; - -class cyclwarr_state : public tatsumi_state -{ -public: - cyclwarr_state(const machine_config &mconfig, device_type type, const char *tag) - : tatsumi_state(mconfig, type, tag) - , m_soundlatch(*this, "soundlatch") - , m_master_ram(*this, "master_ram") - , m_slave_ram(*this, "slave_ram") - , m_cyclwarr_videoram(*this, "cw_videoram%u", 0U) - , m_cyclwarr_tileclut(*this, "cw_tileclut") - { - } - - void cyclwarr(machine_config &config); - void bigfight(machine_config &config); - - void init_cyclwarr(); - -protected: - virtual void machine_reset() override ATTR_COLD; - -private: - uint16_t cyclwarr_sprite_r(offs_t offset); - void cyclwarr_sprite_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); - void video_config_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); - void bigfight_a40000_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); - void mixing_control_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); - void cyclwarr_control_w(uint8_t data); - void cyclwarr_sound_w(uint8_t data); - void output_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); - uint8_t oki_status_xor_r(); - - template uint16_t cyclwarr_videoram_r(offs_t offset); - template void cyclwarr_videoram_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); - - template TILE_GET_INFO_MEMBER(get_tile_info_bigfight); - template TILE_GET_INFO_MEMBER(get_tile_info_cyclwarr_road); - DECLARE_VIDEO_START(cyclwarr); - DECLARE_VIDEO_START(bigfight); - uint32_t screen_update_cyclwarr(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - - void common_map(address_map &map) ATTR_COLD; - void master_map(address_map &map) ATTR_COLD; - void slave_map(address_map &map) ATTR_COLD; - void sound_map(address_map &map) ATTR_COLD; - - required_device m_soundlatch; - - required_shared_ptr m_master_ram; - required_shared_ptr m_slave_ram; - required_shared_ptr_array m_cyclwarr_videoram; - required_region_ptr m_cyclwarr_tileclut; - - std::vector m_mask; - tilemap_t *m_layer[4]{}; - - uint16_t m_video_config[4]{}; - uint16_t m_mixing_control = 0; - uint16_t m_bigfight_a40000[2]{}; - uint16_t m_bigfight_bank = 0; - uint16_t m_bigfight_last_bank = 0; - uint16_t m_road_color_bank = 0, m_prev_road_bank = 0; - uint16_t m_layer_page_size[4]{}; - bool m_layer1_can_be_road = false; - std::unique_ptr m_decoded_gfx; + tilemap_t *m_tx_layer; - void tile_expand(); - void draw_bg(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect, tilemap_t *src, const uint16_t* scrollx, const uint16_t* scrolly, const uint16_t layer_page_size, bool is_road, int hi_priority); - void draw_bg_layers(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect, int hi_priority); - void apply_highlight_bitmap(bitmap_rgb32 &bitmap, const rectangle &cliprect, bitmap_ind8 &highlight_bitmap); + uint16_t m_control_word; + uint8_t m_last_control; + uint8_t m_hd6445_reg[64]; + uint8_t m_hd6445_address; }; #endif // MAME_TATSUMI_TATSUMI_H diff --git a/src/mame/tatsumi/tatsumi_m.cpp b/src/mame/tatsumi/tatsumi_m.cpp deleted file mode 100644 index ee69e99abc426..0000000000000 --- a/src/mame/tatsumi/tatsumi_m.cpp +++ /dev/null @@ -1,330 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Bryan McPhail, Angelo Salese -#include "emu.h" -#include "tatsumi.h" -#include "sound/okim6295.h" - - -/******************************************************************************/ - -void tatsumi_state::tatsumi_reset() -{ - m_last_control = 0; - m_control_word = 0; - - save_item(NAME(m_last_control)); - save_item(NAME(m_control_word)); -} - -/******************************************************************************/ - -uint16_t apache3_state::apache3_bank_r() -{ - return m_control_word; -} - -void apache3_state::apache3_bank_w(offs_t offset, uint16_t data, uint16_t mem_mask) -{ - /* - 0x8000 - Set when accessing palette ram (not implemented, perhaps blank screen?) - 0x0080 - Set when accessing IO cpu RAM/ROM (implemented as halt cpu) - 0x0060 - IOP bank to access from main cpu (0x0 = RAM, 0x20 = lower ROM, 0x60 = upper ROM) - 0x0010 - Set when accessing OBJ cpu RAM/ROM (implemented as halt cpu) - 0x000f - OBJ bank to access from main cpu (0x8 = RAM, 0x0 to 0x7 = ROM) - */ - - COMBINE_DATA(&m_control_word); - - if (m_control_word & 0x7f00) - { - logerror("Unknown control Word: %04x\n",m_control_word); - m_subcpu2->set_input_line(INPUT_LINE_HALT, CLEAR_LINE); // ? - } - - if (m_control_word & 0x10) - m_subcpu->set_input_line(INPUT_LINE_HALT, ASSERT_LINE); - else - m_subcpu->set_input_line(INPUT_LINE_HALT, CLEAR_LINE); - - if (m_control_word & 0x80) - m_audiocpu->set_input_line(INPUT_LINE_HALT, ASSERT_LINE); - else - m_audiocpu->set_input_line(INPUT_LINE_HALT, CLEAR_LINE); - - m_last_control=m_control_word; -} - -// D1 = /ZBREQ - Z80 bus request -// D0 = /GRDACC - Allow 68000 access to road pattern RAM -void apache3_state::apache3_z80_ctrl_w(uint16_t data) -{ - m_subcpu2->set_input_line(INPUT_LINE_HALT, data & 2 ? ASSERT_LINE : CLEAR_LINE); -} - -uint16_t apache3_state::apache3_v30_v20_r(offs_t offset) -{ - address_space &targetspace = m_audiocpu->space(AS_PROGRAM); - - /* Each V20 byte maps to a V30 word */ - if ((m_control_word & 0xe0) == 0xe0) - offset += 0xf8000; /* Upper half */ - else if ((m_control_word & 0xe0) == 0xc0) - offset += 0xf0000; - else if ((m_control_word & 0xe0) == 0x80) - offset += 0x00000; // main ram - else - logerror("%08x: unmapped read z80 rom %08x\n", m_maincpu->pc(), offset); - return 0xff00 | targetspace.read_byte(offset); -} - -void apache3_state::apache3_v30_v20_w(offs_t offset, uint16_t data, uint16_t mem_mask) -{ - address_space &targetspace = m_audiocpu->space(AS_PROGRAM); - - if ((m_control_word & 0xe0) != 0x80) - logerror("%08x: write unmapped v30 rom %08x\n", m_maincpu->pc(), offset); - - /* Only 8 bits of the V30 data bus are connected - ignore writes to the other half */ - if (ACCESSING_BITS_0_7) - { - targetspace.write_byte(offset, data & 0xff); - } -} - -uint16_t apache3_state::apache3_z80_r(offs_t offset) -{ - return m_apache3_z80_ram[offset]; -} - -void apache3_state::apache3_z80_w(offs_t offset, uint16_t data) -{ - m_apache3_z80_ram[offset] = data & 0xff; -} - -uint8_t apache3_state::apache3_vr1_r() -{ - return (uint8_t)((255./100) * (100 - m_vr1->read())); -} - -/* Ground/sky rotation control - * - * There are 12 16-bit values that are - * presumably loaded into the 8 TZ2213 custom - * accumulators and counters. - */ -void apache3_state::apache3_rotate_w(uint16_t data) -{ - m_apache3_rotate_ctrl[m_apache3_rot_idx] = data; - m_apache3_rot_idx = (m_apache3_rot_idx + 1) % 12; -} - -/******************************************************************************/ - -uint16_t roundup5_state::roundup_v30_z80_r(offs_t offset) -{ - address_space &targetspace = m_audiocpu->space(AS_PROGRAM); - - /* Each Z80 byte maps to a V30 word */ - if (m_control_word & 0x20) - offset += 0x8000; /* Upper half */ - - return 0xff00 | targetspace.read_byte(offset); -} - -void roundup5_state::roundup_v30_z80_w(offs_t offset, uint16_t data, uint16_t mem_mask) -{ - address_space &targetspace = m_audiocpu->space(AS_PROGRAM); - - /* Only 8 bits of the V30 data bus are connected - ignore writes to the other half */ - if (ACCESSING_BITS_0_7) - { - if (m_control_word & 0x20) - offset += 0x8000; /* Upper half of Z80 address space */ - - targetspace.write_byte(offset, data & 0xff); - } -} - - -void roundup5_state::roundup5_control_w(offs_t offset, uint16_t data, uint16_t mem_mask) -{ - COMBINE_DATA(&m_control_word); - - if (m_control_word & 0x10) - m_subcpu->set_input_line(INPUT_LINE_HALT, ASSERT_LINE); - else - m_subcpu->set_input_line(INPUT_LINE_HALT, CLEAR_LINE); - - if (m_control_word & 0x4) - m_audiocpu->set_input_line(INPUT_LINE_HALT, ASSERT_LINE); - else - m_audiocpu->set_input_line(INPUT_LINE_HALT, CLEAR_LINE); - -// if (offset == 1 && (tatsumi_control_w & 0xfeff) != (last_bank & 0xfeff)) -// logerror("%s: Changed bank to %04x (%d)\n", m_maincpu->pc(), tatsumi_control_w,offset); - -//todo - watchdog - - /* Bank: - - 0x0017 : OBJ banks - 0x0018 : 68000 RAM mask 0x0380 used to save bits when writing - 0x0c10 : 68000 ROM - - 0x0040 : Z80 rom (lower half) mapped to 0x10000 - 0x0060 : Z80 rom (upper half) mapped to 0x10000 - - 0x0080 : enabled when showing map screen after a play - (switches video priority between text layer and sprites) - - 0x0100 : watchdog. - - 0x0c00 : vram bank (bits 0x7000 also set when writing vram) - - 0x8000 : set whenever writing to palette ram? - - Changed bank to 0060 (0) - */ - - if ((m_control_word & 0x8) == 0 && !(m_last_control & 0x8)) - m_subcpu->set_input_line(INPUT_LINE_IRQ4, ASSERT_LINE); -// if (tatsumi_control_w&0x200) -// cpu_set_reset_line(1, CLEAR_LINE); -// else -// cpu_set_reset_line(1, ASSERT_LINE); - -// if ((tatsumi_control_w&0x200) && (last_bank&0x200)==0) -// logerror("68k irq\n"); -// if ((tatsumi_control_w&0x200)==0 && (last_bank&0x200)==0x200) -// logerror("68k reset\n"); - - if (m_control_word == 0x3a00) - { -// cpu_set_reset_line(1, CLEAR_LINE); -// logerror("68k on\n"); - } - - m_last_control = m_control_word; -} - -void roundup5_state::road_vregs_w(offs_t offset, uint16_t data, uint16_t mem_mask) -{ - /* - ---- ---x ---- ---- enabled when there's a road slope of any kind, unknown purpose - ---- ---- -xx- ---- enables alternatively in tunnels sometimes, color mods? - ---- ---- ---x ---- road bank select - ---- ---- ---- xxxx various values written during POST while accessing road pixel ram, - otherwise 0xb at the start of irq service - */ - - COMBINE_DATA(&m_road_vregs[offset]); - - m_subcpu->set_input_line(INPUT_LINE_IRQ4, CLEAR_LINE); // guess, probably wrong -// logerror("d_68k_e0000_w %s %04x\n", m_maincpu->pc(), data); -} - -/******************************************************************************/ - -void cyclwarr_state::cyclwarr_control_w(uint8_t data) -{ - m_control_word = data; - -// if ((m_control_word&0xfe) != (m_last_control&0xfe)) -// logerror("%s control_w %04x\n", m_maincpu->pc(), data); - -/* - -0x1 - watchdog -0x4 - cpu bus lock - - - -*/ - - if ((m_control_word & 4) == 4 && (m_last_control & 4) == 0) - { -// logerror("68k 2 halt\n"); - m_subcpu->set_input_line(INPUT_LINE_HALT, ASSERT_LINE); - } - - if ((m_control_word & 4) == 0 && (m_last_control & 4) == 4) - { -// logerror("68k 2 irq go\n"); - m_subcpu->set_input_line(INPUT_LINE_HALT, CLEAR_LINE); - } - - m_last_control = m_control_word; -} - -/******************************************************************************/ - -uint16_t tatsumi_state::tatsumi_v30_68000_r(offs_t offset) -{ - const uint16_t* rom=(uint16_t*)m_subregion->base(); - -//logerror("%s:68000_r(%04X),cw=%04X\n", m_maincpu->pc(), offset*2, m_control_word); - /* Read from 68k RAM */ - if ((m_control_word&0x1f)==0x18) - { -#if 0 - // hack to make roundup 5 boot - // doesn't seem necessary anymore, left for reference - if (m_maincpu->pc()==0xec575) - { - uint8_t *dst = m_mainregion->base(); - dst[BYTE_XOR_LE(0xec57a)]=0x46; - dst[BYTE_XOR_LE(0xec57b)]=0x46; - - dst[BYTE_XOR_LE(0xfc520)]=0x46; //code that stops cpu after coin counter goes mad.. - dst[BYTE_XOR_LE(0xfc521)]=0x46; - dst[BYTE_XOR_LE(0xfc522)]=0x46; - dst[BYTE_XOR_LE(0xfc523)]=0x46; - dst[BYTE_XOR_LE(0xfc524)]=0x46; - dst[BYTE_XOR_LE(0xfc525)]=0x46; - } -#endif - - return m_sharedram[offset & 0x1fff]; - } - - /* Read from 68k ROM */ - offset+=(m_control_word&0x7)*0x8000; - - return rom[offset]; -} - -void tatsumi_state::tatsumi_v30_68000_w(offs_t offset, uint16_t data, uint16_t mem_mask) -{ - if ((m_control_word&0x1f)!=0x18) - logerror("68k write in bank %05x\n",m_control_word); - - COMBINE_DATA(&m_sharedram[offset]); -} - -/***********************************************************************************/ - -uint8_t cyclwarr_state::oki_status_xor_r() -{ - int r = m_oki->read(); - - // Cycle Warriors and Big Fight access this with reversed activeness. - // this is particularly noticeable with the "We got em" sample played in CW at stage clear: - // gets cut too early with the old hack below. - // fwiw returning normal oki status doesn't work at all, both games don't make any sound. - // TODO: verify with HW - return (r ^ 0xff); -#if 0 - // old hack left for reference - - if (m_audiocpu->pc()==0x2b70 || m_audiocpu->pc()==0x2bb5 - || m_audiocpu->pc()==0x2acc - || m_audiocpu->pc()==0x1c79 // BigFight - || m_audiocpu->pc()==0x1cbe // BigFight - || m_audiocpu->pc()==0xf9881) - return 0xf; - if (m_audiocpu->pc()==0x2ba3 || m_audiocpu->pc()==0x2a9b || m_audiocpu->pc()==0x2adc - || m_audiocpu->pc()==0x1cac) // BigFight - return 0; - return r; -#endif -} diff --git a/src/mame/tatsumi/tatsumi_v.cpp b/src/mame/tatsumi/tatsumi_v.cpp deleted file mode 100644 index 32bcb9e948aeb..0000000000000 --- a/src/mame/tatsumi/tatsumi_v.cpp +++ /dev/null @@ -1,1284 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Bryan McPhail, Angelo Salese -#include "emu.h" -#include "tatsumi.h" -#include "screen.h" - - -/********************************** - * - * Common routines - * - *********************************/ - -// TODO: move into device -void tatsumi_state::hd6445_crt_w(offs_t offset, uint8_t data) -{ - if (offset==0) - m_hd6445_address = data & 0x3f; - if (offset==1) - { - m_hd6445_reg[m_hd6445_address] = data; - - static char const *const regnames[40] = - { - "Horizontal Total Characters", "Horizontal Displayed Characters", "Horizontal Sync Position", "Sync Width", - "Vertical Total Rows", "Vertical Total Adjust", "Vertical Displayed Rows", "Vertical Sync Position", - "Interlace Mode and Skew", "Max Raster Address", "Cursor 1 Start", "Cursor 1 End", - "Screen 1 Start Address (H)", "Screen 1 Start Address (L)", "Cursor 1 Address (H)", "Cursor 1 Address (L)", - "Light Pen (H) (RO)", "Light Pen (L) (RO)", "Screen 2 Start Position", "Screen 2 Start Address (H)", - "Screen 2 Start Address (L)", "Screen 3 Start Position", "Screen 3 Start Address (H)", "Screen 3 Start Address (L)", - "Screen 4 Start Position", "Screen 4 Start Address (H)", "Screen 4 Start Address (L)", "Vertical Sync Position Adjust", - "Light Pen Raster (RO)", "Smooth Scrolling", "Control 1", "Control 2", - "Control 3", "Memory Width Offset", "Cursor 2 Start", "Cursor 2 End", - "Cursor 2 Address (H)", "Cursor 2 Address (L)", "Cursor 1 Width", "Cursor 2 Width" - }; - - if(m_hd6445_address < 40) - logerror("HD6445: register %s [%02x R%d] set %02x\n",regnames[m_hd6445_address],m_hd6445_address,m_hd6445_address,data); - else - logerror("HD6445: illegal register access [%02x R%d] set %02x\n",m_hd6445_address,m_hd6445_address,data); - } -} - -uint16_t tatsumi_state::tatsumi_sprite_control_r(offs_t offset) -{ - return m_sprite_control_ram[offset]; -} - -void tatsumi_state::tatsumi_sprite_control_w(offs_t offset, uint16_t data, uint16_t mem_mask) -{ - COMBINE_DATA(&m_sprite_control_ram[offset]); - - /* 0xe0 is bank switch, others unknown */ -// if ((offset==0xe0 && data&0xefff) || offset!=0xe0) -// logerror("%s: Tatsumi TZB215 sprite control %04x %08x\n", m_maincpu->pc(), offset, data); -} - -// apply shadowing to underlying layers -// TODO: it might mix up with the lower palette bank instead (color bank 0x1400?) -void tatsumi_state::apply_shadow_bitmap(bitmap_rgb32 &bitmap, const rectangle &cliprect, bitmap_ind8 &shadow_bitmap, uint8_t xor_output) -{ - for(int y=cliprect.min_y;y> 1,shadow_pen.g() >> 1, shadow_pen.b() >> 1); - } - } - } -} - -void tatsumi_state::text_w(offs_t offset, uint16_t data, uint16_t mem_mask) -{ - COMBINE_DATA(&m_videoram[offset]); - m_tx_layer->mark_tile_dirty(offset); -} - -TILE_GET_INFO_MEMBER(tatsumi_state::get_text_tile_info) -{ - int tile = m_videoram[tile_index]; - tileinfo.set(1, - tile & 0xfff, - tile >> 12, - 0); -} - -template -inline void tatsumi_state::roundupt_drawgfxzoomrotate( BitmapClass &dest_bmp, const rectangle &clip, - gfx_element *gfx, uint32_t code,uint32_t color,int flipx,int flipy,uint32_t ssx,uint32_t ssy, - int scalex, int scaley, int rotate, int write_priority_only ) -{ - if (!scalex || !scaley) return; - - /* - scalex and scaley are 16.16 fixed point numbers - 1<<15 : shrink to 50% - 1<<16 : uniform scale - 1<<17 : double to 200% - */ - - /* KW 991012 -- Added code to force clip to bitmap boundary */ - rectangle myclip = clip; - myclip &= dest_bmp.cliprect(); - - if( gfx ) - { - const pen_t *pal = &m_palette->pen(gfx->colorbase() + gfx->granularity() * (color % gfx->colors())); - const uint8_t *shadow_pens = m_shadow_pen_array.get() + (gfx->granularity() * (color % gfx->colors())); - const uint8_t *code_base = gfx->get_data(code % gfx->elements()); - - int block_size = 8 * scalex; - int sprite_screen_height = ((ssy&0xffff)+block_size)>>16; - int sprite_screen_width = ((ssx&0xffff)+block_size)>>16; - - if (sprite_screen_width && sprite_screen_height) - { - /* compute sprite increment per screen pixel */ - int dx = (gfx->width()<<16)/sprite_screen_width; - int dy = (gfx->height()<<16)/sprite_screen_height; - - int sx;//=ssx>>16; - int sy;//=ssy>>16; - - -// int ex = sx+sprite_screen_width; -// int ey = sy+sprite_screen_height; - - int incxx=0x10000;//(int)((float)dx * cos(theta)); -// int incxy=0x0;//(int)((float)dy * -sin(theta)); - int incyx=0x0;//(int)((float)dx * sin(theta)); -// int incyy=0x10000;//(int)((float)dy * cos(theta)); - - if (flipx) - { - } - - - if (ssx&0x80000000) sx=0-(0x10000 - (ssx>>16)); else sx=ssx>>16; - if (ssy&0x80000000) sy=0-(0x10000 - (ssy>>16)); else sy=ssy>>16; - int ex = sx+sprite_screen_width; - int ey = sy+sprite_screen_height; - int x_index_base; - if( flipx ) - { - x_index_base = (sprite_screen_width-1)*dx; - dx = -dx; - incxx=-incxx; - incyx=-incyx; - } - else - { - x_index_base = 0; - } - - int y_index; - if( flipy ) - { - y_index = (sprite_screen_height-1)*dy; - dy = -dy; - } - else - { - y_index = 0; - } - - if( sx < myclip.min_x) - { /* clip left */ - int pixels = myclip.min_x-sx; - sx += pixels; - x_index_base += pixels*dx; - } - if( sy < myclip.min_y ) - { /* clip top */ - int pixels = myclip.min_y-sy; - sy += pixels; - y_index += pixels*dy; - } - /* NS 980211 - fixed incorrect clipping */ - if( ex > myclip.max_x+1 ) - { /* clip right */ - int pixels = ex-myclip.max_x-1; - ex -= pixels; - } - if( ey > myclip.max_y+1 ) - { /* clip bottom */ - int pixels = ey-myclip.max_y-1; - ey -= pixels; - } - - if( ex>sx ) - { /* skip if inner loop doesn't draw anything */ -#if 0 - int startx=0; - int starty=0; - -// int incxx=0x10000; -// int incxy=0; -// int incyx=0; -// int incyy=0x10000; - double theta=rotate * ((2.0 * M_PI)/512.0); - double c=cos(theta); - double s=sin(theta); - - - // if (ey-sy > 0) - // dy=dy / (ey-sy); - { - float angleAsRadians=(float)rotate * (7.28f / 512.0f); - //float ccx = cosf(angleAsRadians); - //float ccy = sinf(angleAsRadians); - float a=0; - - } - - for( int y=sy; y>16) * gfx->rowbytes(); - int c = source[(cx >> 16)]; - if( c != transparent_color ) - { - if (write_priority_only) - dest[x]=shadow_pens[c]; - else - dest[x]=pal[c]; - } - cx += incxx; - cy += incxy; - } - startx += incyx; - starty += incyy; - } -#endif -#if 1 // old - for( int y=sy; y>16) * gfx->rowbytes(); - typename BitmapClass::pixel_t *const dest = &dest_bmp.pix(y); - - int x_index = x_index_base; - for( int x=sx; x>16]; - if( c ) - { - // Only draw shadow pens if writing priority buffer - if (write_priority_only) - dest[x]=shadow_pens[c]; - else if (!shadow_pens[c]) - dest[x]=pal[c]; - } - x_index += dx; - } - - y_index += dy; - } -#endif - } - } - } -} - -static void mycopyrozbitmap_core(bitmap_ind8 &bitmap, const bitmap_rgb32 &srcbitmap, - int dstx, int dsty, int srcwidth, int srcheight, int incxx, int incxy, int incyx, int incyy, - const rectangle &clip, int transparent_color) -{ } - -static void mycopyrozbitmap_core(bitmap_rgb32 &bitmap, const bitmap_rgb32 &srcbitmap, - int dstx, int dsty, int srcwidth, int srcheight, int incxx, int incxy, int incyx, int incyy, - const rectangle &clip, int transparent_color) -{ -// const int xmask = srcbitmap.width()-1; -// const int ymask = srcbitmap.height()-1; - const int widthshifted = srcwidth << 16; - const int heightshifted = srcheight << 16; - - uint32_t startx=0; - uint32_t starty=0; - - int sx = dstx; - int sy = dsty; - int ex = dstx + srcwidth; - int ey = dsty + srcheight; - - if (sxclip.max_x) ex=clip.max_x; - if (syclip.max_y) ey=clip.max_y; - - if (sx <= ex) - { - while (sy <= ey) - { - int x = sx; - uint32_t cx = startx; - uint32_t cy = starty; - uint32_t *dest = &bitmap.pix(sy, sx); - - while (x <= ex) - { - if (cx < widthshifted && cy < heightshifted) - { - int c = srcbitmap.pix(cy >> 16, cx >> 16); - - if (c != transparent_color) - *dest = c; - } - - cx += incxx; - cy += incxy; - x++; - dest++; - } - startx += incyx; - starty += incyy; - sy++; - } - } -} - -template -void tatsumi_state::draw_sprites(BitmapClass &bitmap, const rectangle &cliprect, int write_priority_only, int rambank) -{ - // Sprite data is double buffered - for (int offs = rambank;offs < rambank + 0x800;offs += 6) - { - /* - Sprite RAM itself uses an index into two ROM tables to actually draw the object. - - Sprite RAM format: - - Word 0: 0xf000 - ? - 0x0fff - Index into ROM sprite table - Word 1: 0x8000 - X Flip - 0x4000 - Y Flip - 0x3000 - ? - 0x0ff8 - Color - 0x0007 - ? - Word 2: 0xffff - X position - Word 3: 0xffff - Y position - Word 4: 0x01ff - Scale - Word 5: 0x01ff - Rotation - - Sprite ROM table format, alternate lines come from each bank, with the - very first line indicating control information: - - First bank: - Byte 0: Y destination offset (in scanlines, unaffected by scale). - Byte 1: Always 0? - Byte 2: Number of source scanlines to render from (so unaffected by destination scale). - Byte 3: Usually 0, sometimes 0x80?? - - Other banks: - Byte 0: Width of line in tiles (-1) - Byte 1: X offset to start drawing line at (multipled by scale * 8) - Bytes 2/3: Tile index to start fetching tiles from (increments per tile). - - */ - int y = m_spriteram[offs+3]; - int x = m_spriteram[offs+2]; - int scale = m_spriteram[offs+4] & 0x1ff; - int color = m_spriteram[offs+1] >> 3 & 0x1ff; - int flip_x = m_spriteram[offs+1] & 0x8000; - int flip_y = m_spriteram[offs+1] & 0x4000; - int rotate = 0;//m_spriteram[offs+5]&0x1ff; // Todo: Turned off for now - - int index = m_spriteram[offs]; - -// if (m_spriteram[offs+1]&0x7) -// color=machine().rand()%0xff; - - /* End of sprite list marker */ - if (index == 0xffff || m_spriteram[offs + 4] == 0xffff) // todo - return; - - if (index >= 0x4000) - continue; - - uint8_t const *src1 = m_rom_sprite_lookup[0] + (index * 4); - uint8_t const *src2 = m_rom_sprite_lookup[1] + (index * 4); - - int lines = src1[2]; - int y_offset = src1[0]&0xf8; - - lines -= y_offset; - - int render_x = x << 16; - int render_y = y << 16; - scale = scale << 9; /* 0x80 becomes 0x10000 */ - - if (flip_y) - render_y -= y_offset * scale; - else - render_y += y_offset * scale; - - if (rotate) - { - render_y = 0; - m_temp_bitmap.fill(0); - } - - int extent_x = 0, extent_y = 0; - - src1 += 4; - int h = 0; - - while (lines > 0) { - int base, x_offs, x_width, x_pos, draw_this_line = 1; - int this_extent = 0; - - /* Odd and even lines come from different banks */ - if (h & 1) { - x_width = src1[0] + 1; - x_offs = src1[1] * scale * 8; - base = src1[2] | (src1[3] << 8); - } - else { - x_width = src2[0] + 1; - x_offs = src2[1] * scale * 8; - base = src2[2] | (src2[3] << 8); - } - - if (draw_this_line) { - base *= 2; - - if (!rotate) - { - if (flip_x) - x_pos = render_x - x_offs - scale * 8; - else - x_pos = render_x + x_offs; - } - else - x_pos = x_offs; - - for (int w = 0; w < x_width; w++) { - if (rotate) - roundupt_drawgfxzoomrotate( - m_temp_bitmap,cliprect,m_gfxdecode->gfx(0), - base, - color,flip_x,flip_y,x_pos,render_y, - scale,scale,0,write_priority_only); - else - roundupt_drawgfxzoomrotate( - bitmap,cliprect,m_gfxdecode->gfx(0), - base, - color,flip_x,flip_y,x_pos,render_y, - scale,scale,0,write_priority_only); - base++; - - if (flip_x) - x_pos -= scale * 8; - else - x_pos += scale * 8; - - this_extent += scale * 8; - } - if (h & 1) - src1 += 4; - else - src2 += 4; - - if (this_extent > extent_x) - extent_x = this_extent; - this_extent = 0; - - if (flip_y) - render_y -= 8 * scale; - else - render_y += 8 * scale; - extent_y += 8 * scale; - - h++; - lines -= 8; - } - else - { - h = 32; // hack - } - } - - if (rotate) - { - double theta = rotate * ((2.0 * M_PI) / 512.0); - - int incxx = (int)(65536.0 * cos(theta)); - int incxy = (int)(65536.0 * -sin(theta)); - int incyx = (int)(65536.0 * sin(theta)); - int incyy = (int)(65536.0 * cos(theta)); - - extent_x = extent_x >> 16; - extent_y = extent_y >> 16; - if (extent_x > 2 && extent_y > 2) - mycopyrozbitmap_core(bitmap, m_temp_bitmap, x/* + (extent_x/2)*/, y /*+ (extent_y/2)*/, extent_x, extent_y, incxx, incxy, incyx, incyy, cliprect, 0); - } - } -} - -/* - * Object palettes are build from a series of cluts stored in the object roms. - * - * We update 'Mame palettes' from the clut here in order to simplify the - * draw routines. We also note down any uses of the 'shadow' pen (index 255). - */ -void tatsumi_state::update_cluts(int fake_palette_offset, int object_base, int length) -{ - - const uint8_t* bank1 = m_rom_clut[0]; - const uint8_t* bank2 = m_rom_clut[1]; - for (int i=0; iset_pen_color(fake_palette_offset+i+0,m_palette->pen_color(bank1[1]+object_base)); - m_shadow_pen_array[i+0]=(bank1[1]==255); - m_palette->set_pen_color(fake_palette_offset+i+1,m_palette->pen_color(bank1[0]+object_base)); - m_shadow_pen_array[i+1]=(bank1[0]==255); - m_palette->set_pen_color(fake_palette_offset+i+2,m_palette->pen_color(bank1[3]+object_base)); - m_shadow_pen_array[i+2]=(bank1[3]==255); - m_palette->set_pen_color(fake_palette_offset+i+3,m_palette->pen_color(bank1[2]+object_base)); - m_shadow_pen_array[i+3]=(bank1[2]==255); - - m_palette->set_pen_color(fake_palette_offset+i+4,m_palette->pen_color(bank2[1]+object_base)); - m_shadow_pen_array[i+4]=(bank2[1]==255); - m_palette->set_pen_color(fake_palette_offset+i+5,m_palette->pen_color(bank2[0]+object_base)); - m_shadow_pen_array[i+5]=(bank2[0]==255); - m_palette->set_pen_color(fake_palette_offset+i+6,m_palette->pen_color(bank2[3]+object_base)); - m_shadow_pen_array[i+6]=(bank2[3]==255); - m_palette->set_pen_color(fake_palette_offset+i+7,m_palette->pen_color(bank2[2]+object_base)); - m_shadow_pen_array[i+7]=(bank2[2]==255); - - bank1+=4; - bank2+=4; - } -} - - -/********************************** - * - * Apache 3 - * - *********************************/ - -void apache3_state::apache3_road_z_w(uint16_t data) -{ - m_apache3_road_z = data & 0xff; -} - -void apache3_state::apache3_road_x_w(offs_t offset, uint8_t data) -{ - // Note: Double buffered. Yes, this is correct :) - m_apache3_road_x_ram[data] = offset; -} - -void apache3_state::draw_sky(bitmap_rgb32 &bitmap,const rectangle &cliprect, int palette_base, int start_offset) -{ - // all TODO - if (start_offset&0x8000) - start_offset=-(0x10000 - start_offset); - - start_offset=-start_offset; - -start_offset-=48; - for (int y=0; y<256; y++) { - for (int x=0; x<320; x++) { - int col=palette_base + y + start_offset; - if (colpalette_base+127) col=palette_base+127; - - bitmap.pix(y, x) = m_palette->pen(col); - } - } -} - -/* Draw the sky and ground, applying rotation (eventually). Experimental! */ -void apache3_state::draw_ground(bitmap_rgb32 &dst, const rectangle &cliprect) -{ - if (0) - { - uint16_t gva = 0x180; // TODO - uint8_t sky_val = m_apache3_rotate_ctrl[1] & 0xff; - - for (int y = cliprect.min_y; y <= cliprect.max_y; ++y) - { - uint16_t rgdb = 0;//m_apache3_road_x_ram[gva & 0xff]; - uint16_t gha = 0xf60; // test - int ln = (((m_apache3_prom[gva & 0x7f] & 0x7f) + (m_apache3_road_z & 0x7f)) >> 5) & 3; - - if (gva & 0x100) - { - /* Sky */ - for (int x = cliprect.min_x; x <= cliprect.max_x; ++x) - { - dst.pix(y, x) = m_palette->pen(0x100 + (sky_val & 0x7f)); - - /* Update horizontal counter? */ - gha = (gha + 1) & 0xfff; - } - } - else - { - /* Ground */ - for (int x = cliprect.min_x; x <= cliprect.max_x; ++x) - { - uint16_t hval = (rgdb + gha) & 0xfff; // Not quite - - if (hval & 0x800) - hval ^= 0x1ff; // TEST - //else - //hval = hval; - - uint8_t pixels = m_apache3_g_ram[(((gva & 0xff) << 7) | ((hval >> 2) & 0x7f))]; - int pix_sel = hval & 3; - - uint8_t colour = (pixels >> (pix_sel << 1)) & 3; - colour = (BIT(hval, 11) << 4) | (colour << 2) | ln; - - /* Draw the pixel */ - dst.pix(y, x) = m_palette->pen(0x200 + colour); - - /* Update horizontal counter */ - gha = (gha + 1) & 0xfff; - } - } - - /* Update sky counter */ - sky_val++; - gva = (gva + 1) & 0x1ff; - } - } -} - - -VIDEO_START_MEMBER(apache3_state,apache3) -{ - m_tx_layer = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(tatsumi_state::get_text_tile_info)), TILEMAP_SCAN_ROWS, 8,8, 64,64); - m_shadow_pen_array = make_unique_clear(8192); - m_temp_bitmap.allocate(512, 512); - m_apache3_road_x_ram = std::make_unique(512); - - m_tx_layer->set_transparent_pen(0); -} - -uint32_t apache3_state::screen_update_apache3(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) -{ - update_cluts(1024, 0, 2048+2048); - - m_tx_layer->set_scrollx(0,24); - - bitmap.fill(m_palette->pen(0), cliprect); - screen.priority().fill(0, cliprect); - draw_sprites(screen.priority(),cliprect,1,(m_sprite_control_ram[0xe0]&0x1000) ? 0x1000 : 0); // Alpha pass only - draw_sky(bitmap, cliprect, 256, m_apache3_rotate_ctrl[1]); - apply_shadow_bitmap(bitmap,cliprect,screen.priority(), 0); -// draw_ground(bitmap, cliprect); - draw_sprites(bitmap,cliprect,0, (m_sprite_control_ram[0x20]&0x1000) ? 0x1000 : 0); - m_tx_layer->draw(screen, bitmap, cliprect, 0,0); - return 0; -} - -/********************************** - * - * Round Up 5 - * - *********************************/ - -uint8_t roundup5_state::gfxdata_r(offs_t offset) -{ - if((m_control_word & 0x200) == 0x200) - { - offset += (m_control_word & 0x6000) << 2; - - return m_bg_gfxram[offset]; - } - - offset+=((m_control_word&0x0c00)>>10) * 0x8000; - return m_tx_gfxram[offset]; -} - -void roundup5_state::gfxdata_w(offs_t offset, uint8_t data) -{ - if((m_control_word & 0x200) == 0x200) - { - offset += (m_control_word & 0x6000) << 2; - m_bg_gfxram[offset] = data; - return; - } - - offset+=((m_control_word&0x0c00)>>10) * 0x8000; - - if (offset>=0x18000 && data) - logerror("effective write to vram %06x %02x (control %04x)\n",offset,data,m_control_word); - - m_tx_gfxram[offset] = data; - - offset=offset%0x8000; - - m_gfxdecode->gfx(1)->mark_dirty(offset/8); -} - -VIDEO_START_MEMBER(roundup5_state,roundup5) -{ - m_tx_layer = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(tatsumi_state::get_text_tile_info)), TILEMAP_SCAN_ROWS, 8,8, 128,64); - m_shadow_pen_array = make_unique_clear(8192); - m_tx_gfxram = std::make_unique(0x20000); - m_bg_gfxram = std::make_unique(0x20000); - - m_tx_layer->set_transparent_pen(0); - - m_gfxdecode->gfx(1)->set_source(m_tx_gfxram.get()); - - save_pointer(NAME(m_tx_gfxram), 0x20000); - save_pointer(NAME(m_bg_gfxram), 0x20000); -} - -void roundup5_state::draw_road(bitmap_rgb32 &bitmap, const rectangle &cliprect) -{ -/* -0xf980 0x0008 0x8c80 0x4a00 - road right to below, width unknown (32 pixels guess) -0xfa80 0x0008 0x8c80 0x4a00 - road right to below, width unknown (32 pixels guess) - -0xfb80 0x0008 0x8c80 0x4a00 - road in middle of screen, width unknown (32 pixels guess) - -0xfc80 0x0008 0x8c80 0x4a00 - road width above to left, same width as above (ie, xpos - 32) -0xfd80 0x0008 0x8c80 0x4a00 - road width above to left, same width as above (ie, xpos - 32) -0xfe80 0x0008 0x8c80 0x4a00 - road width above to left, same width as above (ie, xpos - 32) -0xff80 0x0008 0x8c80 0x4a00 - road width above to left, same width as above (ie, xpos - 32) -0x0001 - road half/width above to left, (ie, xpos - 16) -0x0081 - road width to left as usual (xpos-16 from above, or 32 from above2) - -0xfb0b 0x210b 0x8cf5 0x0dea - blue & left & right, with blue|----|----|----|----|blue -in this mode changing columns 2 & 3 have no apparent effect -0xfb0b 0x7b09 0x8cf5 0x0dea - as above, but scaled up - perhaps 18 pixels shifted (twice that overall size) -0xfb0b 0x6c07 0x8cf5 0x0dea - as above, but scaled up - perhaps 40 pixels shifted from above -0xfb0b 0xaa06 0x8cf5 0x0dea - as above, but scaled up - perhaps 16 pixels shifted from above -0xfb0b 0xb005 0x8cf5 0x0dea - as above, but scaled up - perhaps 38 pixels shifted from above - -b21 diff is 1a6 -97b 20f -76c c2 -6aa fa -5b0 - - -0x0000 0x0008 0xxxxx 0xxxx - line starting at 0 for 128 pixels - 1 to 1 with road pixel data -0xff00 0x0008 0xxxxx 0xxxx - line starting at 32 for 128 pixels - 1 to 1 with road pixel data -0xfe00 0x0008 0xxxxx 0xxxx - line starting at 64 for 128 pixels - 1 to 1 with road pixel data - - - -at standard zoom (0x800) -shift of 0x100 moves 32 pixels -so shift of 8 is assumed to move 1 pixel - -at double zoom (0x1000) -assume shift of 0x100 only moves 16 pixels -so - -0x100 * 0x400 => 0x40 -0x100 * step 0x800 = must come out at 0x20 -0x100 * step 0x1000 = must come out at 0x10 -0x100 * step 0x2000 = 0x5 - -pos is 11.5 fixed point - --0x580 = middle --0x180 --0x080 -0 -0x80 - -*/ - const uint16_t *data = m_road_ctrl_ram; - - // Road layer enable (?) - if ((m_vregs[0x1]&0x1)==0) - return; - - // Road data bank select (double buffered) - if (m_road_vregs[0]&0x10) - data+=0x400; - - // Apply clipping: global screen + local road y offsets - int y = 256 - ((m_vregs[0xa/2] >> 8) + m_road_yclip[0]); - data+=y*4; - - int visible_line=0; - - for ( ; y>8)&0xf; - int step = swapendian_int16(data[1]); - int samplePos=0; - uint16_t const *const linedata=m_road_pixel_ram;// + (0x100 * pal); - int startPos=0, endPos=0; - - int palette_byte;//=m_road_color_ram[visible_line/8]; - - /* - Each road line consists of up to two sets of 128 pixel data that can be positioned - on the x-axis and stretched/compressed on the x-axis. Any screen pixels to the left - of the first set are drawn with pen 0 of the road pixel data. Any screen pixels to the - right of the second set line are drawn with pen 127 of the road pixel data. - - The road control data is laid out as follows (4 words per screen line, with 2 banks): - - Word 0: Line shift for 1st set - 13.3 signed fixed point value. - Word 1: Line scale - 5.11 fixed point value. So 0x800 is 1:1, 0x400 is 1:2, etc - Word 2: Line shift for 2nd set - 13.3 signed fixed point value. - Word 3: ? - - The scale is shared between both pixel sets. The 2nd set is only used when the road - forks into two between stages. The 2nd line shift is an offset from the last pixel - of the 1st set. The 2nd line shift uses a different palette bank. - -2nd road uses upper palette - confirmed by water stage. -offset is from last pixel of first road segment? -//last pixel of first road is really colour from 2nd road line? - - */ - - palette_byte=m_road_color_ram[visible_line/8]; - pal = 4 + ((palette_byte>>(visible_line%8))&1); - - visible_line++; - - if (shift&0x8000) - shift=-(0x10000 - shift); - shift=-shift; - - if (step) - startPos=((shift<<8) + 0x80 )/ step; - - int x; - - /* Fill in left of road segment */ - for (x=0; (x < startPos) && (x < cliprect.max_x+1); x++) - { - int col = linedata[0]&0xf; - bitmap.pix(y, x) = m_palette->pen(256 + pal*16 + col); - } - - /* If startpos is negative, clip it and adjust the sampling position accordingly */ - if (startPos<0) - { - samplePos=step*(0-startPos); - startPos=0; - } - else - { - samplePos=0; - } - - /* Fill in main part of road, then right-hand side edge */ - for (x=startPos; x < (cliprect.max_x + 1) && ((samplePos>>11)<0x80); x++) - { - // look up colour - int col = linedata[(samplePos>>11)&0x7f]&0xf; - - /* Clamp if we have reached the end of the pixel data */ - //if ((samplePos>>11) > 0x7f) - // col=linedata[0x7f]&0xf; - - bitmap.pix(y, x) = m_palette->pen(256 + pal*16 + col); - - samplePos+=step; - } - - /* Now work out how many pixels until start of 2nd segment */ - startPos=x; - - if (shift2&0x8000) - shift2=-(0x10000 - shift2); - shift2=-shift2; - - if (step) - endPos=((shift2<<8) + 0x80) / step; - else - endPos=0; - endPos-=128; - endPos=startPos+endPos; - - /* Fill pixels */ - for (x=startPos; x < (cliprect.max_x+1) && (x < endPos); x++) - { - int col = linedata[0x80]&0xf; - - /* Clamp if we have reached the end of the pixel data */ - //if ((samplePos>>11) > 0x7f) - // col=linedata[0x7f]&0xf; - - bitmap.pix(y, x) = m_palette->pen(256 + pal*16 + col + 32); - } - - if (endPos<0) - { - // end of left intersection (taking right turn) - samplePos=step*(0-startPos); - } - else if (endPos>11)&0x7f) + 0x200]&0xf; - - /* Clamp if we have reached the end of the pixel data */ - if ((samplePos>>11) > 0x7f) - col=linedata[0x7f + 0x200]&0xf; - - bitmap.pix(y, x) = m_palette->pen(256 + pal*16 + col + 32); - - samplePos+=step; - } - data+=4; - } -} - -// background layer landscape for Round Up 5 -// two bitmap layers, back layer is 512 x 128, the other one is 512 x 64 -// it's safe to assume that three monitor version will have a different arrangement here ... -void roundup5_state::draw_landscape(bitmap_rgb32 &bitmap, const rectangle &cliprect, uint8_t type) -{ - // TODO: guess, assume back layer having less scroll increment than front for parallax scrolling. - // also notice that m_vregs[8/2] >> 8 is identical to [0x0c/2], always? - uint16_t x_base = type ? m_bg_scrollx[0] : m_vregs[0xc/2]; - // TODO: maybe [0xa/2] applies here as well? - uint16_t y_base = m_bg_scrolly[0] & 0x1ff; - uint16_t y_scroll = 0x180 - y_base; - uint32_t base_offset; - uint16_t color_base = type ? 0x100 : 0x110; - int ysize = type ? 64 : 128; - - base_offset = 0x10000 + type * 0x8000; - if(type) - y_scroll += 64; - - //popmessage("%04x %04x %04x",m_vregs[8/2],m_vregs[0xc/2],m_bg_scrollx[0]); - - for(int y = 0; y < ysize; y++) - { - for(int x = 0; x < 512; x++) - { - int res_x = (x_base + x) & 0x1ff; - uint32_t color = m_bg_gfxram[(res_x >> 1)+y*256+base_offset]; - - if(res_x & 1) - color >>= 4; - - color &= 0xf; - - if(cliprect.contains(x, y+y_scroll) && color) - bitmap.pix(y+y_scroll, x) = m_palette->pen(color+color_base); - } - } -} - -uint32_t roundup5_state::screen_update_roundup5(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) -{ - int tx_start_addr; - - tx_start_addr = (m_hd6445_reg[0xc] << 8) | (m_hd6445_reg[0xd]); - tx_start_addr &= 0x3fff; - - update_cluts(1024, 512, 4096); - - m_tx_layer->set_scrollx(0,24); - m_tx_layer->set_scrolly(0,(tx_start_addr >> 4) | m_hd6445_reg[0x1d]); - - bitmap.fill(m_palette->pen(384), cliprect); // todo - screen.priority().fill(0, cliprect); - draw_sprites(screen.priority(),cliprect,1,(m_sprite_control_ram[0xe0]&0x1000) ? 0x1000 : 0); // Alpha pass only - draw_landscape(bitmap,cliprect,0); - draw_landscape(bitmap,cliprect,1); - draw_road(bitmap,cliprect); - apply_shadow_bitmap(bitmap,cliprect,screen.priority(), 0); - if(m_control_word & 0x80) // enabled on map screen after a play - { - m_tx_layer->draw(screen, bitmap, cliprect, 0,0); - draw_sprites(bitmap,cliprect,0,(m_sprite_control_ram[0xe0]&0x1000) ? 0x1000 : 0); // Full pass - } - else - { - draw_sprites(bitmap,cliprect,0,(m_sprite_control_ram[0xe0]&0x1000) ? 0x1000 : 0); // Full pass - m_tx_layer->draw(screen, bitmap, cliprect, 0,0); - } - return 0; -} - -/********************************** - * - * Cycle Warriors / Big Fight - * - *********************************/ - -/* - * these video registers never changes - * - * Big Fight - * 72f2 5af2 3af2 22fa - * - * Cycle Warriors - * 5673 92c2 3673 267b - * - * Following is complete guesswork (since nothing changes it's very hard to pinpoint what these bits do :/) - * Layer order is 3-1-2-0 ? - * x--- -x-- ---- ---- one of these might be enable page select - * ---- ---- x--- ---- tilemap size - * ---x ---- ---- x--- one these might be color bank - * - */ -void cyclwarr_state::video_config_w(offs_t offset, uint16_t data, uint16_t mem_mask) -{ - COMBINE_DATA(&m_video_config[offset]); -} - -// mixing control (seems to be available only for Big Fight and Cycle Warriors) -// --x- ---- enabled in Big Fight, disabled in Cycle Warriors (unknown purpose) -// ---- -x-- enable shadow mixing -// ---- ---x if 1 invert shadows, i.e. shadows are drawn with original pen while non shadows are halved (Chen stage in Big Fight) -void cyclwarr_state::mixing_control_w(offs_t offset, uint16_t data, uint16_t mem_mask) -{ - COMBINE_DATA(&m_mixing_control); -} - -template -TILE_GET_INFO_MEMBER(cyclwarr_state::get_tile_info_bigfight) -{ - int tile = m_cyclwarr_videoram[Bank >> 1][tile_index&0x7fff]; - int bank = (m_bigfight_a40000[0] >> (((tile&0xc00)>>10)*4))&0xf; - uint16_t tileno = (tile&0x3ff)|(bank<<10); - // color is bits 12-13 - uint8_t color = (tile >> 12) & 0x3; - - // all layers but 0 wants this palette bank (fade in/out effects) - // a similar result is obtainable with priority bit, but then it's wrong for - // Big Fight CRT test (dark red background) and character name bio in attract mode (reference shows it doesn't fade in like rest of text) - // TODO: likely an HW config sets this up - if(Bank != 0) - color |= 4; - // bit 14: ignore transparency on this tile - int opaque = ((tile >> 14) & 1) == 1; - - tileinfo.set(1, - tileno, - color, - opaque ? TILE_FORCE_LAYER0 : 0); - - // bit 15: tile appears in front of sprites - tileinfo.category = (tile >> 15) & 1; - tileinfo.mask_data = &m_mask[tileno<<3]; -} - -// same as above but additionally apply per-scanline color banking -// TODO: split for simplicity, need to merge with above -template -TILE_GET_INFO_MEMBER(cyclwarr_state::get_tile_info_cyclwarr_road) -{ - int tile = m_cyclwarr_videoram[Bank >> 1][tile_index&0x7fff]; - int bank = (m_bigfight_a40000[0] >> (((tile&0xc00)>>10)*4))&0xf; - uint16_t tileno = (tile&0x3ff)|(bank<<10); - uint8_t color = (tile >> 12) & 0x3; -// if(Bank != 0) - color |= 4; - int opaque = ((tile >> 14) & 1) == 1; - - tileinfo.set(1, - tileno, - color | m_road_color_bank, - opaque ? TILE_FORCE_LAYER0 : 0); - - tileinfo.category = (tile >> 15) & 1; - tileinfo.mask_data = &m_mask[((tile&0x3ff)|(bank<<10))<<3]; -} - -void cyclwarr_state::tile_expand() -{ - /* - Each tile (0x4000 of them) has a lookup table in ROM to build an individual 3-bit palette - from sets of 8 bit palettes! - */ - gfx_element *gx0 = m_gfxdecode->gfx(1); - m_mask.resize(gx0->elements() << 3,0); - uint8_t *dest; - - // allocate memory for the assembled data - m_decoded_gfx = std::make_unique(gx0->elements() * gx0->width() * gx0->height()); - - // loop over elements - dest = m_decoded_gfx.get(); - for (int c = 0; c < gx0->elements(); c++) - { - const uint8_t *c0base = gx0->get_data(c); - - // loop over height - for (int y = 0; y < gx0->height(); y++) - { - const uint8_t *c0 = c0base; - - for (int x = 0; x < gx0->width(); x++) - { - uint8_t pix = (*c0++ & 7); - uint8_t respix = m_cyclwarr_tileclut[(c << 3)|pix]; - *dest++ = respix; - // Transparent pixels are set by both the tile pixel data==0 AND colour palette & 7 == 0 - m_mask[(c << 3) | (y & 7)] |= ((pix&0x7)!=0 || ((pix&0x7)==0 && (respix&0x7)!=0)) ? (0x80 >> (x & 7)) : 0; - } - c0base += gx0->rowbytes(); - } - } - - gx0->set_raw_layout(m_decoded_gfx.get(), gx0->width(), gx0->height(), gx0->elements(), 8 * gx0->width(), 8 * gx0->width() * gx0->height()); - gx0->set_granularity(256); -} - - -VIDEO_START_MEMBER(cyclwarr_state,cyclwarr) -{ - tile_expand(); - m_layer[0] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(cyclwarr_state::get_tile_info_bigfight<0>)), TILEMAP_SCAN_ROWS, 8,8, 64,512); - m_layer[1] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(cyclwarr_state::get_tile_info_cyclwarr_road<1>)), TILEMAP_SCAN_ROWS, 8,8, 128,256); - m_layer[2] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(cyclwarr_state::get_tile_info_bigfight<2>)), TILEMAP_SCAN_ROWS, 8,8, 64,512); - m_layer[3] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(cyclwarr_state::get_tile_info_bigfight<3>)), TILEMAP_SCAN_ROWS, 8,8, 64,512); - - m_shadow_pen_array = make_unique_clear(8192); - - // set up scroll bases - // TODO: more HW configs - m_layer[3]->set_scrolldx(-8,-8); - m_layer_page_size[3] = 0x200; - m_layer[2]->set_scrolldx(-8,-8); - m_layer_page_size[2] = 0x200; - m_layer[1]->set_scrolldx(-8,-8); - m_layer_page_size[1] = 0x200; - m_layer[0]->set_scrolldx(-0x10,-0x10); - m_layer_page_size[0] = 0x100; - - m_layer1_can_be_road = true; -} - -VIDEO_START_MEMBER(cyclwarr_state,bigfight) -{ - tile_expand(); - m_layer[0] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(cyclwarr_state::get_tile_info_bigfight<0>)), TILEMAP_SCAN_ROWS, 8,8, 128,256); - m_layer[1] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(cyclwarr_state::get_tile_info_bigfight<1>)), TILEMAP_SCAN_ROWS, 8,8, 128,256); - m_layer[2] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(cyclwarr_state::get_tile_info_bigfight<2>)), TILEMAP_SCAN_ROWS, 8,8, 128,256); - m_layer[3] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(cyclwarr_state::get_tile_info_bigfight<3>)), TILEMAP_SCAN_ROWS, 8,8, 128,256); - - m_shadow_pen_array = make_unique_clear(8192); - - // set up scroll bases - // TODO: more HW configs - m_layer[3]->set_scrolldx(-8,-8); - m_layer[2]->set_scrolldx(-8,-8); - m_layer[1]->set_scrolldx(-8,-8); - m_layer[0]->set_scrolldx(-0x10,-0x10); - for(int i=0;i<4;i++) - m_layer_page_size[i] = 0x200; - - m_layer1_can_be_road = false; -} - - -void cyclwarr_state::draw_bg(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect, tilemap_t *src, const uint16_t* scrollx, const uint16_t* scrolly, const uint16_t layer_page_size, bool is_road, int hi_priority) -{ - rectangle clip; - clip.min_x = cliprect.min_x; - clip.max_x = cliprect.max_x; - // TODO: both always enabled when this occurs - bool rowscroll_enable = (scrollx[0] & 0x1000) == 0; - bool colscroll_enable = (scrollx[0] & 0x2000) == 0; - // this controls wraparound (tilemap can't go above a threshold) - // TODO: Actually scrolly registers 0xf0 to 0xff are used (can split the tilemap furthermore?) - uint16_t page_select = scrolly[0xff]; - - for (int y=cliprect.min_y; y<=cliprect.max_y; y++) - { - clip.min_y = clip.max_y = y; - int y_base = rowscroll_enable ? y : 0; - int x_base = colscroll_enable ? y : 0; - int src_y = (scrolly[y_base] & 0x7ff); - int src_x = (scrollx[x_base] & 0x7ff); - // apparently if this is on disables wraparound target - int page_disable = scrolly[y_base] & 0x800; - int cur_page = src_y + y; - - // special handling for cycle warriors road: it reads in scrolly table bits 15-13 an - // additional tile color bank and per scanline. - if(is_road == true) - { - if(scrolly[y_base] & 0x8000) - { - m_road_color_bank = (scrolly[y_base] >> 13) & 3; - // road mode disables page wraparound - page_disable = 1; - } - else - m_road_color_bank = 0; - - if(m_road_color_bank != m_prev_road_bank) - { - m_prev_road_bank = m_road_color_bank; - src->mark_all_dirty(); - } - } - - // apply wraparound, if enabled tilemaps can't go above a certain threshold - // cfr. Cycle Warriors scrolling text (ranking, ending), backgrounds when uphill, - // Big Fight vertical scrolling in the morning Funnel stage (not the one chosen at start), - // also Big Fight text garbage in the stage after Mevella joins you (forgot the name) - if((cur_page - page_select) >= layer_page_size && page_disable == 0) - src_y -= layer_page_size; - - src->set_scrollx(0,src_x); - src->set_scrolly(0,src_y); - src->draw(screen, bitmap, clip, TILEMAP_DRAW_CATEGORY(hi_priority), 0); - } -} - -void cyclwarr_state::draw_bg_layers(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect, int hi_priority) -{ - draw_bg(screen, bitmap, cliprect, m_layer[3], &m_cyclwarr_videoram[1][0x000], &m_cyclwarr_videoram[1][0x100], m_layer_page_size[3], false, hi_priority); - draw_bg(screen, bitmap, cliprect, m_layer[2], &m_cyclwarr_videoram[1][0x200], &m_cyclwarr_videoram[1][0x300], m_layer_page_size[2],false, hi_priority); - draw_bg(screen, bitmap, cliprect, m_layer[1], &m_cyclwarr_videoram[0][0x000], &m_cyclwarr_videoram[0][0x100], m_layer_page_size[1],m_layer1_can_be_road, hi_priority); - draw_bg(screen, bitmap, cliprect, m_layer[0], &m_cyclwarr_videoram[0][0x200], &m_cyclwarr_videoram[0][0x300], m_layer_page_size[0], false, hi_priority); -} - -uint32_t cyclwarr_state::screen_update_cyclwarr(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) -{ - m_bigfight_bank=m_bigfight_a40000[0]; - if (m_bigfight_bank!=m_bigfight_last_bank) - { - for (int i = 0; i < 4; i++) - { - m_layer[i]->mark_all_dirty(); - } - m_bigfight_last_bank=m_bigfight_bank; - } - update_cluts(8192, 4096, 8192); - - bitmap.fill(m_palette->pen(0), cliprect); - -#if 0 - popmessage("%04x %04x (%04x)|%04x %04x (%04x)|%04x %04x (%04x)|%04x %04x (%04x)" - ,m_cyclwarr_videoram[1][0x000],m_cyclwarr_videoram[1][0x100],m_cyclwarr_videoram[1][0x1ff] - ,m_cyclwarr_videoram[1][0x200],m_cyclwarr_videoram[1][0x300],m_cyclwarr_videoram[1][0x3ff] - ,m_cyclwarr_videoram[0][0x000],m_cyclwarr_videoram[0][0x100],m_cyclwarr_videoram[0][0x1ff] - ,m_cyclwarr_videoram[0][0x200],m_cyclwarr_videoram[0][0x300],m_cyclwarr_videoram[0][0x3ff]); -#endif - -// popmessage("%04x %04x %04x %04x",m_video_config[0],m_video_config[1],m_video_config[2],m_video_config[3]); - - screen.priority().fill(0, cliprect); - draw_sprites(screen.priority(),cliprect,1,(m_sprite_control_ram[0xe0]&0x1000) ? 0x1000 : 0); // Alpha pass only - draw_bg_layers(screen, bitmap, cliprect, 0); - apply_shadow_bitmap(bitmap,cliprect,screen.priority(), m_mixing_control & 1); - draw_sprites(bitmap,cliprect,0,(m_sprite_control_ram[0xe0]&0x1000) ? 0x1000 : 0); - draw_bg_layers(screen, bitmap, cliprect, 1); - return 0; -} diff --git a/src/mame/tatsumi/tzbx15_sprites.cpp b/src/mame/tatsumi/tzbx15_sprites.cpp new file mode 100644 index 0000000000000..204ce60e7c7c7 --- /dev/null +++ b/src/mame/tatsumi/tzbx15_sprites.cpp @@ -0,0 +1,557 @@ +// license:BSD-3-Clause +// copyright-holders:Bryan McPhail, Angelo Salese + +#include "emu.h" +#include "tzbx15_sprites.h" +#include "screen.h" + +// TZB215 on Apache 3 +// TZB315 on Round Up 5, Big Fight, Cycle Warriors +// differences, if any, unknown +// (does not appear to be CLUT size, even if that would have made sense. +// Round Up 5 uses the smaller CLUT like Apache 3 yet is confirmed to be a TZB315) + +DEFINE_DEVICE_TYPE(TZB215_SPRITES, tzb215_device, "tzb215_sprites", "Tatsumi TZB215 Rotating Sprites") +DEFINE_DEVICE_TYPE(TZB315_SPRITES, tzb315_device, "tzb315_sprites", "Tatsumi TZB315 Rotating Sprites") + +tzbx15_device::tzbx15_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock) + : device_t(mconfig, type, tag, owner, clock) + , device_gfx_interface(mconfig, *this) + , m_palette_clut(*this, "palette_clut") + , m_palette_base(*this, finder_base::DUMMY_TAG) + , m_spriteram(*this, finder_base::DUMMY_TAG) + , m_sprites_l_rom(*this, "sprites_l") + , m_sprites_h_rom(*this, "sprites_h") +{ +} + +tzbx15_device::tzbx15_device(const machine_config& mconfig, device_type type, const char* tag, device_t* owner, u32 clock, u32 clut_size) + : tzbx15_device(mconfig, type, tag, owner, clock) +{ + m_rom_clut_size = clut_size; +} + +tzb215_device::tzb215_device(const machine_config& mconfig, const char* tag, device_t* owner, u32 clock, u32 clut_size) + : tzbx15_device(mconfig, TZB215_SPRITES, tag, owner, clock, clut_size) +{ +} + +tzb215_device::tzb215_device(const machine_config& mconfig, const char* tag, device_t* owner, u32 clock) + : tzbx15_device(mconfig, TZB215_SPRITES, tag, owner, clock, 0) +{ +} + +tzb315_device::tzb315_device(const machine_config& mconfig, const char* tag, device_t* owner, u32 clock, u32 clut_size) + : tzbx15_device(mconfig, TZB315_SPRITES, tag, owner, clock, clut_size) +{ +} + +tzb315_device::tzb315_device(const machine_config& mconfig, const char* tag, device_t* owner, u32 clock) + : tzbx15_device(mconfig, TZB315_SPRITES, tag, owner, clock, 0) +{ +} + + + + +void tzbx15_device::common_init() +{ + m_rom_clut_offset = memregion("sprites_l")->bytes() - m_rom_clut_size; + + m_shadow_pen_array = make_unique_clear(m_rom_clut_size * 2); + m_temp_bitmap.allocate(512, 512); +} + +static const gfx_layout spritelayout = +{ + 8,8, + RGN_FRAC(1,1), + 4, + { STEP4(0,1) }, + { 8,12,0,4, 24,28,16,20 }, + { STEP8(0,4*8) }, + 32*8 +}; + +GFXDECODE_MEMBER( tzbx15_device::gfxinfo ) + GFXDECODE_DEVICE("sprites_l", 0, spritelayout, 0, 256) + GFXDECODE_DEVICE("sprites_h", 0, spritelayout, 0, 256) +GFXDECODE_END + +void tzbx15_device::device_start() +{ + common_init(); + decode_gfx(gfxinfo); + gfx(0)->set_colors(m_rom_clut_size / 8); + gfx(1)->set_colors(m_rom_clut_size / 8); +} + +void tzbx15_device::device_reset() +{ +} + +void tzbx15_device::device_add_mconfig(machine_config &config) +{ + // 4096 or 8192 arranged as series of CLUTs + PALETTE(config, m_palette_clut).set_format(palette_device::xRGB_555, m_rom_clut_size * 2); +} + +void tzbx15_device::mycopyrozbitmap_core(bitmap_ind8 &bitmap, const bitmap_rgb32 &srcbitmap, + int dstx, int dsty, int srcwidth, int srcheight, int incxx, int incxy, int incyx, int incyy, + const rectangle &clip, int transparent_color) +{ } + +void tzbx15_device::mycopyrozbitmap_core(bitmap_rgb32 &bitmap, const bitmap_rgb32 &srcbitmap, + int dstx, int dsty, int srcwidth, int srcheight, int incxx, int incxy, int incyx, int incyy, + const rectangle &clip, int transparent_color) +{ + // const int xmask = srcbitmap.width()-1; + // const int ymask = srcbitmap.height()-1; + const int widthshifted = srcwidth << 16; + const int heightshifted = srcheight << 16; + + uint32_t startx = 0; + uint32_t starty = 0; + + int sx = dstx; + int sy = dsty; + int ex = dstx + srcwidth; + int ey = dsty + srcheight; + + if (sx < clip.min_x) sx = clip.min_x; + if (ex > clip.max_x) ex = clip.max_x; + if (sy < clip.min_y) sy = clip.min_y; + if (ey > clip.max_y) ey = clip.max_y; + + if (sx <= ex) + { + while (sy <= ey) + { + int x = sx; + uint32_t cx = startx; + uint32_t cy = starty; + uint32_t* dest = &bitmap.pix(sy, sx); + + while (x <= ex) + { + if (cx < widthshifted && cy < heightshifted) + { + int c = srcbitmap.pix(cy >> 16, cx >> 16); + + if (c != transparent_color) + *dest = c; + } + + cx += incxx; + cy += incxy; + x++; + dest++; + } + startx += incyx; + starty += incyy; + sy++; + } + } +} + +template +void tzbx15_device::roundupt_drawgfxzoomrotate( BitmapClass &dest_bmp, const rectangle &clip, + gfx_element *gfx, uint32_t code,uint32_t color,int flipx,int flipy,uint32_t ssx,uint32_t ssy, + int scalex, int scaley, int rotate, int write_priority_only ) +{ + if (!scalex || !scaley) return; + + /* + scalex and scaley are 16.16 fixed point numbers + 1<<15 : shrink to 50% + 1<<16 : uniform scale + 1<<17 : double to 200% + */ + + /* KW 991012 -- Added code to force clip to bitmap boundary */ + rectangle myclip = clip; + myclip &= dest_bmp.cliprect(); + + if( gfx ) + { + const pen_t *pal = &m_palette_clut->pen(gfx->colorbase() + gfx->granularity() * (color % gfx->colors())); + const uint8_t *shadow_pens = m_shadow_pen_array.get() + (gfx->granularity() * (color % gfx->colors())); + const uint8_t *code_base = gfx->get_data(code % gfx->elements()); + + int block_size = 8 * scalex; + int sprite_screen_height = ((ssy&0xffff)+block_size)>>16; + int sprite_screen_width = ((ssx&0xffff)+block_size)>>16; + + if (sprite_screen_width && sprite_screen_height) + { + /* compute sprite increment per screen pixel */ + int dx = (gfx->width()<<16)/sprite_screen_width; + int dy = (gfx->height()<<16)/sprite_screen_height; + + int sx;//=ssx>>16; + int sy;//=ssy>>16; + + +// int ex = sx+sprite_screen_width; +// int ey = sy+sprite_screen_height; + + int incxx=0x10000;//(int)((float)dx * cos(theta)); +// int incxy=0x0;//(int)((float)dy * -sin(theta)); + int incyx=0x0;//(int)((float)dx * sin(theta)); +// int incyy=0x10000;//(int)((float)dy * cos(theta)); + + if (ssx&0x80000000) sx=0-(0x10000 - (ssx>>16)); else sx=ssx>>16; + if (ssy&0x80000000) sy=0-(0x10000 - (ssy>>16)); else sy=ssy>>16; + int ex = sx+sprite_screen_width; + int ey = sy+sprite_screen_height; + int x_index_base; + if( flipx ) + { + x_index_base = (sprite_screen_width-1)*dx; + dx = -dx; + incxx=-incxx; + incyx=-incyx; + } + else + { + x_index_base = 0; + } + + int y_index; + if( flipy ) + { + y_index = (sprite_screen_height-1)*dy; + dy = -dy; + } + else + { + y_index = 0; + } + + if( sx < myclip.min_x) + { /* clip left */ + int pixels = myclip.min_x-sx; + sx += pixels; + x_index_base += pixels*dx; + } + if( sy < myclip.min_y ) + { /* clip top */ + int pixels = myclip.min_y-sy; + sy += pixels; + y_index += pixels*dy; + } + /* NS 980211 - fixed incorrect clipping */ + if( ex > myclip.max_x+1 ) + { /* clip right */ + int pixels = ex-myclip.max_x-1; + ex -= pixels; + } + if( ey > myclip.max_y+1 ) + { /* clip bottom */ + int pixels = ey-myclip.max_y-1; + ey -= pixels; + } + + if( ex>sx ) + { /* skip if inner loop doesn't draw anything */ +#if 0 + int startx=0; + int starty=0; + +// int incxx=0x10000; +// int incxy=0; +// int incyx=0; +// int incyy=0x10000; + double theta=rotate * ((2.0 * M_PI)/512.0); + double c=cos(theta); + double s=sin(theta); + + + // if (ey-sy > 0) + // dy=dy / (ey-sy); + { + float angleAsRadians=(float)rotate * (7.28f / 512.0f); + //float ccx = cosf(angleAsRadians); + //float ccy = sinf(angleAsRadians); + float a=0; + + } + + for( int y=sy; y>16) * gfx->rowbytes(); + int c = source[(cx >> 16)]; + if( c != transparent_color ) + { + if (write_priority_only) + dest[x]=shadow_pens[c]; + else + dest[x]=pal[c]; + } + cx += incxx; + cy += incxy; + } + startx += incyx; + starty += incyy; + } +#endif +#if 1 // old + for( int y=sy; y>16) * gfx->rowbytes(); + typename BitmapClass::pixel_t *const dest = &dest_bmp.pix(y); + + int x_index = x_index_base; + for( int x=sx; x>16]; + if( c ) + { + // Only draw shadow pens if writing priority buffer + if (write_priority_only) + dest[x]=shadow_pens[c]; + else if (!shadow_pens[c]) + dest[x]=pal[c]; + } + x_index += dx; + } + + y_index += dy; + } +#endif + } + } + } +} + +/* + Sprite RAM itself uses an index into two ROM tables to actually draw the object. + + Sprite RAM format: + + Word 0: 0xf000 - ? + 0x0fff - Index into ROM sprite table + Word 1: 0x8000 - X Flip + 0x4000 - Y Flip + 0x3000 - ? + 0x0ff8 - Color + 0x0007 - ? + Word 2: 0xffff - X position + Word 3: 0xffff - Y position + Word 4: 0x01ff - Scale + Word 5: 0x01ff - Rotation + + Sprite ROM table format, alternate lines come from each bank, with the + very first line indicating control information: + + First bank: + Byte 0: Y destination offset (in scanlines, unaffected by scale). + Byte 1: Always 0? + Byte 2: Number of source scanlines to render from (so unaffected by destination scale). + Byte 3: Usually 0, sometimes 0x80?? + + Other banks: + Byte 0: Width of line in tiles (-1) + Byte 1: X offset to start drawing line at (multipled by scale * 8) + Bytes 2/3: Tile index to start fetching tiles from (increments per tile). + +*/ +template +void tzbx15_device::draw_sprites_main(BitmapClass &bitmap, const rectangle &cliprect, int write_priority_only, int rambank) +{ + // Sprite data is double buffered + for (int offs = rambank;offs < rambank + 0x800;offs += 6) + { + int y = m_spriteram[offs+3]; + int x = m_spriteram[offs+2]; + int scale = m_spriteram[offs+4] & 0x1ff; + int color = m_spriteram[offs+1] >> 3 & 0x1ff; + int flip_x = m_spriteram[offs+1] & 0x8000; + int flip_y = m_spriteram[offs+1] & 0x4000; + int rotate = 0;//m_spriteram[offs+5]&0x1ff; // Todo: Turned off for now + + int index = m_spriteram[offs]; + +// if (m_spriteram[offs+1]&0x7) +// color=machine().rand()%0xff; + + /* End of sprite list marker */ + if (index == 0xffff || m_spriteram[offs + 4] == 0xffff) // todo + return; + + if (index >= 0x4000) + continue; + + uint8_t const *src1 = m_sprites_l_rom + (index * 4); + uint8_t const *src2 = m_sprites_h_rom + (index * 4); + + int lines = src1[2]; + int y_offset = src1[0]&0xf8; + + lines -= y_offset; + + int render_x = x << 16; + int render_y = y << 16; + scale = scale << 9; /* 0x80 becomes 0x10000 */ + + if (flip_y) + render_y -= y_offset * scale; + else + render_y += y_offset * scale; + + if (rotate) + { + render_y = 0; + m_temp_bitmap.fill(0); + } + + int extent_x = 0, extent_y = 0; + + src1 += 4; + int h = 0; + + while (lines > 0) { + int base, x_offs, x_width, x_pos, draw_this_line = 1; + int this_extent = 0; + + /* Odd and even lines come from different banks */ + if (h & 1) { + x_width = src1[0] + 1; + x_offs = src1[1] * scale * 8; + base = src1[2] | (src1[3] << 8); + } + else { + x_width = src2[0] + 1; + x_offs = src2[1] * scale * 8; + base = src2[2] | (src2[3] << 8); + } + + if (draw_this_line) { + base *= 2; + + if (!rotate) + { + if (flip_x) + x_pos = render_x - x_offs - scale * 8; + else + x_pos = render_x + x_offs; + } + else + x_pos = x_offs; + + for (int w = 0; w < x_width; w++) { + if (rotate) + roundupt_drawgfxzoomrotate( + m_temp_bitmap,cliprect,gfx(0 + (base & 1)), + base >> 1, + color,flip_x,flip_y,x_pos,render_y, + scale,scale,0,write_priority_only); + else + roundupt_drawgfxzoomrotate( + bitmap,cliprect,gfx(0 + (base & 1)), + base >> 1, + color,flip_x,flip_y,x_pos,render_y, + scale,scale,0,write_priority_only); + base++; + + if (flip_x) + x_pos -= scale * 8; + else + x_pos += scale * 8; + + this_extent += scale * 8; + } + if (h & 1) + src1 += 4; + else + src2 += 4; + + if (this_extent > extent_x) + extent_x = this_extent; + this_extent = 0; + + if (flip_y) + render_y -= 8 * scale; + else + render_y += 8 * scale; + extent_y += 8 * scale; + + h++; + lines -= 8; + } + else + { + h = 32; // hack + } + } + + if (rotate) + { + double theta = rotate * ((2.0 * M_PI) / 512.0); + + int incxx = (int)(65536.0 * cos(theta)); + int incxy = (int)(65536.0 * -sin(theta)); + int incyx = (int)(65536.0 * sin(theta)); + int incyy = (int)(65536.0 * cos(theta)); + + extent_x = extent_x >> 16; + extent_y = extent_y >> 16; + if (extent_x > 2 && extent_y > 2) + mycopyrozbitmap_core(bitmap, m_temp_bitmap, x/* + (extent_x/2)*/, y /*+ (extent_y/2)*/, extent_x, extent_y, incxx, incxy, incyx, incyy, cliprect, 0); + } + } +} + +void tzbx15_device::draw_sprites(bitmap_rgb32 &bitmap, const rectangle &cliprect, int write_priority_only, int rambank) +{ + draw_sprites_main(bitmap, cliprect, write_priority_only, rambank); +} + +void tzbx15_device::draw_sprites(bitmap_ind8& bitmap, const rectangle &cliprect, int write_priority_only, int rambank) +{ + draw_sprites_main(bitmap, cliprect, write_priority_only, rambank); +} + +/* + * Object palettes are build from a series of cluts stored in the object roms. + * + * We update 'Mame palettes' from the clut here in order to simplify the + * draw routines. We also note down any uses of the 'shadow' pen (index 255). + */ +void tzbx15_device::update_cluts() +{ + const int length = m_rom_clut_size * 2; + const uint8_t* bank1 = m_sprites_l_rom + m_rom_clut_offset; + const uint8_t* bank2 = m_sprites_h_rom + m_rom_clut_offset; + + for (int i = 0; i < length; i+=8) + { + m_palette_clut->set_pen_color(i + 0, m_palette_base->pen_color(bank1[1] + m_sprite_palette_base)); + m_shadow_pen_array[i+0]=(bank1[1] == 255); + m_palette_clut->set_pen_color(i + 1, m_palette_base->pen_color(bank1[0] + m_sprite_palette_base)); + m_shadow_pen_array[i+1]=(bank1[0] == 255); + m_palette_clut->set_pen_color(i + 2, m_palette_base->pen_color(bank1[3] + m_sprite_palette_base)); + m_shadow_pen_array[i+2]=(bank1[3] == 255); + m_palette_clut->set_pen_color(i + 3, m_palette_base->pen_color(bank1[2] + m_sprite_palette_base)); + m_shadow_pen_array[i+3]=(bank1[2] == 255); + + m_palette_clut->set_pen_color(i + 4, m_palette_base->pen_color(bank2[1] + m_sprite_palette_base)); + m_shadow_pen_array[i+4]=(bank2[1] == 255); + m_palette_clut->set_pen_color(i + 5, m_palette_base->pen_color(bank2[0] + m_sprite_palette_base)); + m_shadow_pen_array[i+5]=(bank2[0] == 255); + m_palette_clut->set_pen_color(i + 6, m_palette_base->pen_color(bank2[3] + m_sprite_palette_base)); + m_shadow_pen_array[i+6]=(bank2[3] == 255); + m_palette_clut->set_pen_color(i + 7, m_palette_base->pen_color(bank2[2] + m_sprite_palette_base)); + m_shadow_pen_array[i+7]=(bank2[2] == 255); + + bank1+=4; + bank2+=4; + } +} diff --git a/src/mame/tatsumi/tzbx15_sprites.h b/src/mame/tatsumi/tzbx15_sprites.h new file mode 100644 index 0000000000000..53b224b1cd63d --- /dev/null +++ b/src/mame/tatsumi/tzbx15_sprites.h @@ -0,0 +1,82 @@ +// license:BSD-3-Clause +// copyright-holders:Bryan McPhail, Angelo Salese + +#ifndef MAME_TATSUMI_TZBX15_SPRITES_H +#define MAME_TATSUMI_TZBX15_SPRITES_H + +#pragma once + +#include "emupal.h" + +class tzbx15_device : public device_t, public device_gfx_interface +{ +public: + void set_sprite_palette_base(int sprite_palette_base) { m_sprite_palette_base = sprite_palette_base; } + template void set_basepalette(T &&tag) { m_palette_base.set_tag(std::forward(tag)); } + template void set_spriteram(T &&tag) { m_spriteram.set_tag(std::forward(tag)); } + + void draw_sprites(bitmap_rgb32& bitmap, const rectangle& cliprect, int write_priority_only, int rambank); + void draw_sprites(bitmap_ind8& bitmap, const rectangle& cliprect, int write_priority_only, int rambank); + + void update_cluts(); + +protected: + tzbx15_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock); + tzbx15_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, u32 clut_size); + +private: + + virtual void device_add_mconfig(machine_config &config) override ATTR_COLD; + + virtual void device_start() override ATTR_COLD; + virtual void device_reset() override ATTR_COLD; + + void common_init() ATTR_COLD; + + void mycopyrozbitmap_core(bitmap_ind8 &bitmap, const bitmap_rgb32 &srcbitmap, + int dstx, int dsty, int srcwidth, int srcheight, int incxx, int incxy, int incyx, int incyy, + const rectangle &clip, int transparent_color); + void mycopyrozbitmap_core(bitmap_rgb32 &bitmap, const bitmap_rgb32 &srcbitmap, + int dstx, int dsty, int srcwidth, int srcheight, int incxx, int incxy, int incyx, int incyy, + const rectangle &clip, int transparent_color); + + template void draw_sprites_main(BitmapClass &bitmap, const rectangle &cliprect, int write_priority_only, int rambank); + template inline void roundupt_drawgfxzoomrotate( BitmapClass &dest_bmp, const rectangle &clip, + gfx_element *gfx, uint32_t code,uint32_t color,int flipx,int flipy,uint32_t ssx,uint32_t ssy, + int scalex, int scaley, int rotate, int write_priority_only ); + + DECLARE_GFXDECODE_MEMBER(gfxinfo); + + required_device m_palette_clut; + required_device m_palette_base; + required_shared_ptr m_spriteram; + required_region_ptr m_sprites_l_rom; + required_region_ptr m_sprites_h_rom; + + std::unique_ptr m_shadow_pen_array; + bitmap_rgb32 m_temp_bitmap; + + // config + int m_rom_clut_size; + int m_rom_clut_offset; + int m_sprite_palette_base; +}; + +class tzb215_device : public tzbx15_device +{ +public: + tzb215_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock, u32 clut_size); + tzb215_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); +}; + +class tzb315_device : public tzbx15_device +{ +public: + tzb315_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock, u32 clut_size); + tzb315_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); +}; + +DECLARE_DEVICE_TYPE(TZB215_SPRITES, tzb215_device) +DECLARE_DEVICE_TYPE(TZB315_SPRITES, tzb315_device) + +#endif // MAME_TATSUMI_TZBX15_SPRITES_H diff --git a/src/mame/technos/ddragon.cpp b/src/mame/technos/ddragon.cpp index 84c4cad3937c9..529cd06b8b708 100644 --- a/src/mame/technos/ddragon.cpp +++ b/src/mame/technos/ddragon.cpp @@ -897,7 +897,6 @@ INPUT_PORTS_END * *************************************/ - static const gfx_layout char_layout = { 8,8, @@ -928,6 +927,7 @@ static GFXDECODE_START( gfx_ddragon ) GFXDECODE_ENTRY( "tiles", 0, tile_layout, 256, 8 ) // colors 256-383 GFXDECODE_END + /************************************* * * Machine drivers @@ -936,7 +936,6 @@ GFXDECODE_END static constexpr XTAL MAIN_CLOCK = 12_MHz_XTAL; static constexpr XTAL SOUND_CLOCK = 3.579545_MHz_XTAL; -static constexpr XTAL MCU_CLOCK = MAIN_CLOCK / 3; static constexpr XTAL PIXEL_CLOCK = MAIN_CLOCK / 2; void ddragon_state::ddragon(machine_config &config) @@ -946,7 +945,7 @@ void ddragon_state::ddragon(machine_config &config) m_maincpu->set_addrmap(AS_PROGRAM, &ddragon_state::ddragon_main_map); TIMER(config, "scantimer").configure_scanline(FUNC(ddragon_state::scanline), "screen", 0, 1); - hd63701y0_cpu_device &subcpu(HD63701Y0(config, m_subcpu, MAIN_CLOCK / 2)); // HD63701Y0P, 6 MHz / 4 internally + hd63701y0_cpu_device &subcpu(HD63701Y0(config, m_subcpu, MAIN_CLOCK / 2)); // HD63701Y0P, 6 MHz / 4 internally subcpu.set_addrmap(AS_PROGRAM, &ddragon_state::ddragon_sub_map); subcpu.out_p6_cb().set(FUNC(ddragon_state::sub_port6_w)); @@ -972,18 +971,18 @@ void ddragon_state::ddragon(machine_config &config) ym2151_device &fmsnd(YM2151(config, "fmsnd", SOUND_CLOCK)); fmsnd.irq_handler().set_inputline(m_soundcpu, M6809_FIRQ_LINE); - fmsnd.add_route(0, "mono", 0.60); - fmsnd.add_route(1, "mono", 0.60); + fmsnd.add_route(0, "mono", 0.35); + fmsnd.add_route(1, "mono", 0.35); MSM5205(config, m_adpcm[0], MAIN_CLOCK / 32); - m_adpcm[0]->vck_legacy_callback().set(FUNC(ddragon_state::ddragon_adpcm_int<0>)); // interrupt function - m_adpcm[0]->set_prescaler_selector(msm5205_device::S48_4B); // 8kHz - m_adpcm[0]->add_route(ALL_OUTPUTS, "mono", 0.50); + m_adpcm[0]->vck_legacy_callback().set(FUNC(ddragon_state::ddragon_adpcm_int<0>)); + m_adpcm[0]->set_prescaler_selector(msm5205_device::S48_4B); // 8kHz + m_adpcm[0]->add_route(ALL_OUTPUTS, "mono", 1.0); MSM5205(config, m_adpcm[1], MAIN_CLOCK / 32); - m_adpcm[1]->vck_legacy_callback().set(FUNC(ddragon_state::ddragon_adpcm_int<1>)); // interrupt function - m_adpcm[1]->set_prescaler_selector(msm5205_device::S48_4B); // 8kHz - m_adpcm[1]->add_route(ALL_OUTPUTS, "mono", 0.50); + m_adpcm[1]->vck_legacy_callback().set(FUNC(ddragon_state::ddragon_adpcm_int<1>)); + m_adpcm[1]->set_prescaler_selector(msm5205_device::S48_4B); // 8kHz + m_adpcm[1]->add_route(ALL_OUTPUTS, "mono", 1.0); } void ddragon_state::ddragonbl(machine_config &config) @@ -991,7 +990,7 @@ void ddragon_state::ddragonbl(machine_config &config) ddragon(config); // basic machine hardware - HD6309E(config.replace(), m_subcpu, MAIN_CLOCK / 8); // 1.5MHz; labeled "ENC EL1200AR" on one PCB + HD6309E(config.replace(), m_subcpu, MAIN_CLOCK / 8); // 1.5MHz; labeled "ENC EL1200AR" on one PCB m_subcpu->set_addrmap(AS_PROGRAM, &ddragon_state::sub_6309_map); } @@ -1000,7 +999,7 @@ void ddragon_state::ddragonbla(machine_config &config) ddragon(config); // basic machine hardware - m6803_cpu_device &sub(M6803(config.replace(), "sub", MAIN_CLOCK / 2)); // 6MHz / 4 internally + m6803_cpu_device &sub(M6803(config.replace(), "sub", MAIN_CLOCK / 2)); // 6MHz / 4 internally sub.set_addrmap(AS_PROGRAM, &ddragon_state::ddragonbla_sub_map); sub.out_p2_cb().set(FUNC(ddragon_state::ddragonbla_port_w)); } @@ -1048,20 +1047,20 @@ void ddragon_state::ddragon6809(machine_config &config) m_soundlatch->data_pending_callback().set_inputline(m_soundcpu, M6809_IRQ_LINE); ym2203_device &ym1(YM2203(config, "ym1", 20_MHz_XTAL / 6)); // divisor not verified - ym1.add_route(ALL_OUTPUTS, "mono", 0.60); + ym1.add_route(ALL_OUTPUTS, "mono", 0.35); ym2203_device &ym2(YM2203(config, "ym2", 20_MHz_XTAL / 6)); // divisor not verified - ym2.add_route(ALL_OUTPUTS, "mono", 0.60); + ym2.add_route(ALL_OUTPUTS, "mono", 0.35); MSM5205(config, m_adpcm[0], 500_kHz_XTAL); - m_adpcm[0]->vck_legacy_callback().set(FUNC(ddragon_state::ddragon_adpcm_int<0>)); // interrupt function - m_adpcm[0]->set_prescaler_selector(msm5205_device::S48_4B); // 8kHz - m_adpcm[0]->add_route(ALL_OUTPUTS, "mono", 0.50); + m_adpcm[0]->vck_legacy_callback().set(FUNC(ddragon_state::ddragon_adpcm_int<0>)); + m_adpcm[0]->set_prescaler_selector(msm5205_device::S48_4B); // 8kHz + m_adpcm[0]->add_route(ALL_OUTPUTS, "mono", 1.0); MSM5205(config, m_adpcm[1], 500_kHz_XTAL); - m_adpcm[1]->vck_legacy_callback().set(FUNC(ddragon_state::ddragon_adpcm_int<1>)); // interrupt function - m_adpcm[1]->set_prescaler_selector(msm5205_device::S48_4B); // 8kHz - m_adpcm[1]->add_route(ALL_OUTPUTS, "mono", 0.50); + m_adpcm[1]->vck_legacy_callback().set(FUNC(ddragon_state::ddragon_adpcm_int<1>)); + m_adpcm[1]->set_prescaler_selector(msm5205_device::S48_4B); // 8kHz + m_adpcm[1]->add_route(ALL_OUTPUTS, "mono", 1.0); } void ddragon_state::ddragon2(machine_config &config) @@ -1096,8 +1095,8 @@ void ddragon_state::ddragon2(machine_config &config) ym2151_device &fmsnd(YM2151(config, "fmsnd", SOUND_CLOCK)); fmsnd.irq_handler().set_inputline(m_soundcpu, 0); - fmsnd.add_route(0, "mono", 0.60); - fmsnd.add_route(1, "mono", 0.60); + fmsnd.add_route(0, "mono", 0.35); + fmsnd.add_route(1, "mono", 0.35); okim6295_device &oki(OKIM6295(config, "oki", 1'056'000, okim6295_device::PIN7_HIGH)); // clock frequency & pin 7 verified on bootleg PCB by Jose Tejada oki.add_route(ALL_OUTPUTS, "mono", 0.20); @@ -1130,6 +1129,7 @@ void toffy_state::toffy(machine_config &config) config.device_remove("adpcm2"); } + /************************************* * * ROM definitions @@ -2107,6 +2107,27 @@ ROM_START( toffy ) ROM_LOAD( "5-27512.rom", 0x10000, 0x10000, CRC(4f91eec6) SHA1(18a5f98dfba33837b73d032a6153eeb03263684b) ) ROM_END +ROM_START( toffya ) // original Midas board with original ROM stickers + ROM_REGION( 0x30000, "maincpu", 0 ) + ROM_LOAD( "mde2.u70", 0x00000, 0x10000, CRC(a27f1b49) SHA1(26aa1bc5af09f22207d764a598d99fa9218608e9) ) + ROM_RELOAD( 0x10000, 0x10000 ) + + ROM_REGION( 0x10000, "soundcpu", 0 ) + ROM_LOAD( "mde1.u142", 0x00000, 0x10000, CRC(541bd7f0) SHA1(3f0097f5877eae50651f94d46d7dd9127037eb6e) ) // 1ST AND 2ND HALF IDENTICAL + + ROM_REGION( 0x10000, "chars", 0 ) + ROM_LOAD( "mde7.u35", 0x00000, 0x10000, CRC(6ddc2867) SHA1(9b3c053048efea768651633a76cb636f40289b79) ) // 1xxxxxxxxxxxxxxx = 0xFF + + ROM_REGION( 0x20000, "tiles", 0 ) + // the same as 'Dangerous Dungeons' once decrypted + ROM_LOAD( "mde4.u78", 0x00000, 0x10000, CRC(9506b10d) SHA1(1a205a519fdbb7a3149c2e72c8620e79caa32f0d) ) // 1xxxxxxxxxxxxxxx = 0x00 + ROM_LOAD( "mde3.u77", 0x10000, 0x10000, CRC(77c097cc) SHA1(569b36a2be149d9c8b361a4a73c628c3c7471db4) ) // 1xxxxxxxxxxxxxxx = 0x00 + + ROM_REGION( 0x20000, "sprites", 0 ) + ROM_LOAD( "mde6.u80", 0x00000, 0x10000, CRC(aeef092a) SHA1(520148f663695207567f25fbb0634a650c7986e5) ) // 1ST AND 2ND HALF IDENTICAL + ROM_LOAD( "mde5.u79", 0x10000, 0x10000, CRC(14b52f76) SHA1(8d94bb1b404c483c0dbd69d40d9095fb97bd2faa) ) // 1ST AND 2ND HALF IDENTICAL +ROM_END + ROM_START( stoffy ) ROM_REGION( 0x30000, "maincpu", 0 ) ROM_LOAD( "2.u70", 0x00000, 0x10000, CRC(6203aeb5) SHA1(e57aa520e8096df01461b235f77557c267571a57) ) @@ -2211,6 +2232,7 @@ void toffy_state::init_toffy() } // should the sound ROM be bitswapped too? + // probably not, as the unencrypted set's sound ROM matches } void ddragon_state::init_ddragon6809() @@ -2267,7 +2289,8 @@ GAME( 1992, ddungeone, ddungeon, darktowr, ddungeon, darktowr_state, init_ GAME( 1992, darktowr, 0, darktowr, darktowr, darktowr_state, init_darktowr, ROT0, "The Game Room", "Dark Tower", MACHINE_SUPPORTS_SAVE ) // these run on their own board, but are basically the same game. Toffy even has 'Dangerous Dungeons' text in it -GAME( 1993, toffy, 0, toffy, toffy, toffy_state, init_toffy, ROT0, "Midas", "Toffy", MACHINE_SUPPORTS_SAVE ) +GAME( 1993, toffy, 0, toffy, toffy, toffy_state, init_toffy, ROT0, "Midas", "Toffy (encrypted)", MACHINE_SUPPORTS_SAVE ) +GAME( 1993, toffya, toffy, toffy, toffy, toffy_state, empty_init, ROT0, "Midas", "Toffy (unencrypted)", MACHINE_SUPPORTS_SAVE ) GAME( 1994, stoffy, 0, toffy, toffy, toffy_state, init_toffy, ROT0, "Midas", "Super Toffy", MACHINE_SUPPORTS_SAVE ) GAME( 1994, stoffyu, stoffy, toffy, toffy, toffy_state, init_toffy, ROT0, "Midas (Unico license)", "Super Toffy (Unico license)", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/technos/ddragon3.cpp b/src/mame/technos/ddragon3.cpp index f1b8cb27ca538..7734aee2f439c 100644 --- a/src/mame/technos/ddragon3.cpp +++ b/src/mame/technos/ddragon3.cpp @@ -234,7 +234,6 @@ void wwfwfest_state::wwfwfest_irq_ack_w(offs_t offset, uint16_t data) { if (offset == 0) m_maincpu->set_input_line(3, CLEAR_LINE); - else m_maincpu->set_input_line(2, CLEAR_LINE); } diff --git a/src/mame/technos/ddragon3_v.cpp b/src/mame/technos/ddragon3_v.cpp index d7e18d044bc73..2bd0dfcae8ed1 100644 --- a/src/mame/technos/ddragon3_v.cpp +++ b/src/mame/technos/ddragon3_v.cpp @@ -13,14 +13,14 @@ void ddragon3_state::ddragon3_scroll_w(offs_t offset, uint16_t data, uint16_t me { switch (offset) { - case 0: COMBINE_DATA(&m_fg_scrollx); break; // Scroll X, BG1 - case 1: COMBINE_DATA(&m_fg_scrolly); break; // Scroll Y, BG1 - case 2: COMBINE_DATA(&m_bg_scrollx); break; // Scroll X, BG0 - case 3: COMBINE_DATA(&m_bg_scrolly); break; // Scroll Y, BG0 - case 4: break; // Unknown write - case 5: flip_screen_set(data & 0x01); break; // Flip Screen + case 0: COMBINE_DATA(&m_fg_scrollx); break; // Scroll X, BG1 + case 1: COMBINE_DATA(&m_fg_scrolly); break; // Scroll Y, BG1 + case 2: COMBINE_DATA(&m_bg_scrollx); break; // Scroll X, BG0 + case 3: COMBINE_DATA(&m_bg_scrolly); break; // Scroll Y, BG0 + case 4: break; // Unknown write + case 5: flip_screen_set(data & 0x01); break; // Flip Screen case 6: - COMBINE_DATA(&m_bg_tilebase); // BG Tile Base + COMBINE_DATA(&m_bg_tilebase); // BG Tile Base m_bg_tilebase &= 0x1ff; m_bg_tilemap->mark_all_dirty(); break; @@ -63,23 +63,15 @@ void ddragon3_state::ddragon3_bg_videoram_w(offs_t offset, uint16_t data, uint16 - /*****************************************************************************************************************************************************/ - - TILE_GET_INFO_MEMBER(ddragon3_state::get_fg_tile_info) { - uint16_t *tilebase; - int tileno,colbank; - - tilebase = &m_fg_videoram[tile_index*2]; - tileno = (tilebase[1] & 0x1fff); - colbank = (tilebase[0] & 0x000f); - tileinfo.set(1, - tileno, - colbank, - TILE_FLIPYX((tilebase[0] & 0x00c0) >> 6)); + uint16_t *tilebase = &m_fg_videoram[tile_index * 2]; + int tileno = (tilebase[1] & 0x1fff); + int colbank = (tilebase[0] & 0x000f); + + tileinfo.set(1, tileno, colbank, TILE_FLIPYX((tilebase[0] & 0x00c0) >> 6)); } @@ -92,30 +84,23 @@ void ddragon3_state::ddragon3_fg_videoram_w(offs_t offset, uint16_t data, uint16 - /*****************************************************************************************************************************************************/ /* 8x8 text layer - wwfwfest only */ TILE_GET_INFO_MEMBER(wwfwfest_state::get_fg0_tile_info) { - uint16_t *tilebase; - int tileno; - int colbank; - tilebase = &m_fg0_videoram[tile_index*2]; - tileno = (tilebase[0] & 0x00ff) | ((tilebase[1] & 0x000f) << 8); - colbank = (tilebase[1] & 0x00f0) >> 4; - tileinfo.set(3, - tileno, - colbank, - 0); + uint16_t *tilebase = &m_fg0_videoram[tile_index * 2]; + int tileno = (tilebase[0] & 0x00ff) | ((tilebase[1] & 0x000f) << 8); + int colbank = (tilebase[1] & 0x00f0) >> 4; + + tileinfo.set(3, tileno, colbank, 0); } void wwfwfest_state::wwfwfest_fg0_videoram_w(offs_t offset, uint16_t data) { - /* Videoram is 8 bit, upper & lower byte writes end up in the same place due to m68k byte smearing */ - m_fg0_videoram[offset]=data&0xff; - - m_fg0_tilemap->mark_tile_dirty(offset/2); + // Videoram is 8 bit, upper & lower byte writes end up in the same place due to m68k byte smearing + m_fg0_videoram[offset] = data & 0xff; + m_fg0_tilemap->mark_tile_dirty(offset / 2); } /*****************************************************************************************************************************************************/ @@ -138,7 +123,7 @@ void wwfwfest_state::video_start() { ddragon3_state::video_start(); - m_fg0_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(wwfwfest_state::get_fg0_tile_info)), TILEMAP_SCAN_ROWS, 8, 8,64,32); + m_fg0_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(wwfwfest_state::get_fg0_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); m_fg0_tilemap->set_transparent_pen(0); } @@ -179,52 +164,54 @@ void ddragon3_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprec int length = m_spriteram->bytes(); gfx_element *gfx = m_gfxdecode->gfx(2); uint16_t *source = buffered_spriteram16; - uint16_t *finish = source + length/2; + uint16_t *finish = source + length / 2; - while( source512-16) xpos -=512; + if (source[1] & 0x0001) + { + int xpos = (source[5] & 0x00ff) | (source[1] & 0x0004) << 6; + if (xpos > 512 - 16) xpos -= 512; xpos += m_sprite_xoff; - ypos = (source[0] & 0x00ff) | (source[1] & 0x0002) << 7; + + int ypos = (source[0] & 0x00ff) | (source[1] & 0x0002) << 7; ypos = (256 - ypos) & 0x1ff; - ypos -= 16 ; - flipx = (source[1] & 0x0010) >> 4; - flipy = (source[1] & 0x0008) >> 3; - chain = (source[1] & 0x00e0) >> 5; - chain += 1; - number = (source[2] & 0x00ff) | (source[3] & 0x00ff) << 8; - colourbank = (source[4] & 0x000f); - - if (flip_screen()) { - if (flipy) flipy=0; else flipy=1; - if (flipx) flipx=0; else flipx=1; - ypos=240-ypos-m_sprite_xoff; - xpos=304-xpos; + ypos -= 16; + + int flipx = (source[1] & 0x0010) >> 4; + int flipy = (source[1] & 0x0008) >> 3; + int chain = (source[1] & 0x00e0) >> 5; + int number = (source[2] & 0x00ff) | (source[3] & 0x00ff) << 8; + int colourbank = (source[4] & 0x000f); + + if (flip_screen()) + { + flipy = !flipy; + flipx = !flipx; + ypos = 240 - ypos - m_sprite_xoff; + xpos = 304 - xpos; } - for (count=0;counttranspen(bitmap,cliprect,number+count,colourbank,flipx,flipy,xpos,ypos+(16*(chain-1))-(16*count),0); - } else { - gfx->transpen(bitmap,cliprect,number+count,colourbank,flipx,flipy,xpos,ypos+16*count,0); - } - } else { - if (flipy) { - gfx->transpen(bitmap,cliprect,number+count,colourbank,flipx,flipy,xpos,ypos-(16*(chain-1))+(16*count),0); - } else { - gfx->transpen(bitmap,cliprect,number+count,colourbank,flipx,flipy,xpos,ypos-16*count,0); - } + for (int count = 0; count <= chain; count++) + { + if (flip_screen()) + { + if (!flipy) + gfx->transpen(bitmap, cliprect, number + count, colourbank, flipx, flipy, xpos, ypos + (16 * chain) - (16 * count), 0); + else + gfx->transpen(bitmap, cliprect, number + count, colourbank, flipx, flipy, xpos, ypos + 16 * count, 0); + } + else + { + if (flipy) + gfx->transpen(bitmap, cliprect, number + count, colourbank, flipx, flipy, xpos, ypos - (16 * chain) + (16 * count), 0); + else + gfx->transpen(bitmap, cliprect, number + count, colourbank, flipx, flipy, xpos, ypos - 16 * count, 0); } } } - source+=8; + + source += 8; } } @@ -232,8 +219,6 @@ void ddragon3_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprec /*****************************************************************************************************************************************************/ - - uint32_t ddragon3_state::screen_update_ddragon3(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_bg_tilemap->set_scrollx(0, m_bg_scrollx); @@ -269,7 +254,7 @@ uint32_t ddragon3_state::screen_update_ctribe(screen_device &screen, bitmap_ind1 m_fg_tilemap->set_scrollx(0, m_fg_scrollx); m_fg_tilemap->set_scrolly(0, m_fg_scrolly); - if(m_vreg & 8) + if (m_vreg & 8) { m_fg_tilemap->draw(screen, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0); draw_sprites(bitmap, cliprect); @@ -287,39 +272,44 @@ uint32_t ddragon3_state::screen_update_ctribe(screen_device &screen, bitmap_ind1 uint32_t wwfwfest_state::screen_update_wwfwfest(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - if (m_pri == 0x78) { - m_fg_tilemap->set_scrolly(0, m_fg_scrolly ); - m_fg_tilemap->set_scrollx(0, m_fg_scrollx + m_bg0_dx); - m_bg_tilemap->set_scrolly(0, m_bg_scrolly ); - m_bg_tilemap->set_scrollx(0, m_bg_scrollx + m_bg1_dx[0]); - } else { - m_bg_tilemap->set_scrolly(0, m_fg_scrolly ); - m_bg_tilemap->set_scrollx(0, m_fg_scrollx + m_bg1_dx[1]); - m_fg_tilemap->set_scrolly(0, m_bg_scrolly ); - m_fg_tilemap->set_scrollx(0, m_bg_scrollx + m_bg0_dx); + if (m_pri == 0x78) + { + m_fg_tilemap->set_scrolly(0, m_fg_scrolly); + m_fg_tilemap->set_scrollx(0, m_fg_scrollx + m_bg0_dx); + m_bg_tilemap->set_scrolly(0, m_bg_scrolly); + m_bg_tilemap->set_scrollx(0, m_bg_scrollx + m_bg1_dx[0]); + } + else + { + m_bg_tilemap->set_scrolly(0, m_fg_scrolly); + m_bg_tilemap->set_scrollx(0, m_fg_scrollx + m_bg1_dx[1]); + m_fg_tilemap->set_scrolly(0, m_bg_scrolly); + m_fg_tilemap->set_scrollx(0, m_bg_scrollx + m_bg0_dx); } - /* todo : which bits of pri are significant to the order */ - - if (m_pri == 0x7b) { - m_fg_tilemap->draw(screen, bitmap, cliprect, TILEMAP_DRAW_OPAQUE,0); - m_bg_tilemap->draw(screen, bitmap, cliprect, 0,0); - draw_sprites(bitmap,cliprect); + // TODO: which bits of pri are significant to the order + if (m_pri == 0x7b) + { + m_fg_tilemap->draw(screen, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0); + m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); + draw_sprites(bitmap, cliprect); } - if (m_pri == 0x7c) { - m_fg_tilemap->draw(screen, bitmap, cliprect, TILEMAP_DRAW_OPAQUE,0); - draw_sprites(bitmap,cliprect); - m_bg_tilemap->draw(screen, bitmap, cliprect, 0,0); + if (m_pri == 0x7c) + { + m_fg_tilemap->draw(screen, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0); + draw_sprites(bitmap, cliprect); + m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); } - if (m_pri == 0x78) { - m_bg_tilemap->draw(screen, bitmap, cliprect, TILEMAP_DRAW_OPAQUE,0); - m_fg_tilemap->draw(screen, bitmap, cliprect, 0,0); - draw_sprites(bitmap,cliprect); + if (m_pri == 0x78) + { + m_bg_tilemap->draw(screen, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0); + m_fg_tilemap->draw(screen, bitmap, cliprect, 0, 0); + draw_sprites(bitmap, cliprect); } - m_fg0_tilemap->draw(screen, bitmap, cliprect, 0,0); + m_fg0_tilemap->draw(screen, bitmap, cliprect, 0, 0); return 0; } diff --git a/src/mame/tecmo/tehkanwc.cpp b/src/mame/tecmo/tehkanwc.cpp index 44b9ebe8a9adf..2b1d543a7d1b2 100644 --- a/src/mame/tecmo/tehkanwc.cpp +++ b/src/mame/tecmo/tehkanwc.cpp @@ -801,20 +801,20 @@ GFXDECODE_END void tehkanwc_state::tehkanwc(machine_config &config) { /* basic machine hardware */ - Z80(config, m_maincpu, 18432000/4); /* 18.432000 / 4 */ + Z80(config, m_maincpu, 18.432_MHz_XTAL / 4); m_maincpu->set_addrmap(AS_PROGRAM, &tehkanwc_state::main_mem); m_maincpu->set_vblank_int("screen", FUNC(tehkanwc_state::irq0_line_hold)); - Z80(config, m_subcpu, 18432000/4); + Z80(config, m_subcpu, 18.432_MHz_XTAL / 4); m_subcpu->set_addrmap(AS_PROGRAM, &tehkanwc_state::sub_mem); m_subcpu->set_vblank_int("screen", FUNC(tehkanwc_state::irq0_line_hold)); - Z80(config, m_audiocpu, 18432000/4); + Z80(config, m_audiocpu, 18.432_MHz_XTAL / 4); m_audiocpu->set_addrmap(AS_PROGRAM, &tehkanwc_state::sound_mem); m_audiocpu->set_addrmap(AS_IO, &tehkanwc_state::sound_port); m_audiocpu->set_vblank_int("screen", FUNC(tehkanwc_state::irq0_line_hold)); - config.set_maximum_quantum(attotime::from_hz(600)); /* 10 CPU slices per frame - seems enough to keep the CPUs in sync */ + config.set_maximum_quantum(attotime::from_hz(600)); // 10 CPU slices per frame - seems enough to keep the CPUs in sync WATCHDOG_TIMER(config, "watchdog"); @@ -833,12 +833,12 @@ void tehkanwc_state::tehkanwc(machine_config &config) GENERIC_LATCH_8(config, m_soundlatch); GENERIC_LATCH_8(config, m_soundlatch2); - ym2149_device &ay1(YM2149(config, "ay1", 18432000/12)); + ym2149_device &ay1(YM2149(config, "ay1", 18.432_MHz_XTAL / 12)); ay1.port_a_write_callback().set(FUNC(tehkanwc_state::portA_w)); ay1.port_b_write_callback().set(FUNC(tehkanwc_state::portB_w)); ay1.add_route(ALL_OUTPUTS, "mono", 0.25); - ym2149_device &ay2(YM2149(config, "ay2", 18432000/12)); + ym2149_device &ay2(YM2149(config, "ay2", 18.432_MHz_XTAL / 12)); ay2.port_a_read_callback().set(FUNC(tehkanwc_state::portA_r)); ay2.port_b_read_callback().set(FUNC(tehkanwc_state::portB_r)); ay2.add_route(ALL_OUTPUTS, "mono", 0.25); @@ -852,12 +852,12 @@ void tehkanwc_state::tehkanwc(machine_config &config) void tehkanwc_state::tehkanwcb(machine_config &config) { tehkanwc(config); - ay8910_device &ay1(AY8910(config.replace(), "ay1", 18432000/12)); + ay8910_device &ay1(AY8910(config.replace(), "ay1", 18.432_MHz_XTAL / 12)); ay1.port_a_write_callback().set(FUNC(tehkanwc_state::portA_w)); ay1.port_b_write_callback().set(FUNC(tehkanwc_state::portB_w)); ay1.add_route(ALL_OUTPUTS, "mono", 0.25); - ay8910_device &ay2(AY8910(config.replace(), "ay2", 18432000/12)); + ay8910_device &ay2(AY8910(config.replace(), "ay2", 18.432_MHz_XTAL / 12)); ay2.port_a_read_callback().set(FUNC(tehkanwc_state::portA_r)); ay2.port_b_read_callback().set(FUNC(tehkanwc_state::portB_r)); ay2.add_route(ALL_OUTPUTS, "mono", 0.25); diff --git a/src/mame/tektronix/tek410x_kbd.cpp b/src/mame/tektronix/tek410x_kbd.cpp index 74e5578ab2744..56ebb3b98ac90 100644 --- a/src/mame/tektronix/tek410x_kbd.cpp +++ b/src/mame/tektronix/tek410x_kbd.cpp @@ -25,7 +25,7 @@ 01 Left Shift 02 Right Shift 03 Ctrl - 04 DEras/SEras + 04 DEras/SEras [4404 keyboard: ←/↑] 05 Break 06 Back Space 07 Tab @@ -95,18 +95,18 @@ 47 7 (keypad) 48 8 (keypad) 49 9 (keypad) - 4A F1 - 4B F2 - 4C F3 - 4D F4 - 4E F5 - 4F F6 - 50 F7 - 51 F8 - 52 GEras/Dialog - 53 Cancel/Setup - 54 DCopy/SCopy - 55 Menu + 4A F1 [4404 keyboard: F5] + 4B F2 [4404 keyboard: F6] + 4C F3 [4404 keyboard: F7] + 4D F4 [4404 keyboard: F8] + 4E F5 [4404 keyboard: F9] + 4F F6 [4404 keyboard: F10] + 50 F7 [4404 keyboard: F11] + 51 F8 [4404 keyboard: F12] + 52 GEras/Dialog [4404 keyboard: F1] + 53 Cancel/Setup [4404 keyboard: F2] + 54 DCopy/SCopy [4404 keyboard: F3] + 55 Menu [4404 keyboard: F4] 56 Cursor Right (joystick) 57 Cursor Up (joystick) 58 Cursor Left (joystick) @@ -243,20 +243,20 @@ static INPUT_PORTS_START(tek410x_keyboard) PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(UCHAR_MAMEKEY(0_PAD)) PORT_CODE(KEYCODE_0_PAD) PORT_START("X2") - PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Break") //PORT_CODE(KEYCODE_XXX) + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Break") PORT_CODE(KEYCODE_RALT) PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_UNUSED) PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_UNUSED) - PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Line Feed") PORT_CHAR(0x0a) //PORT_CODE(KEYCODE_XXX) + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Line Feed") PORT_CHAR(0x0a) PORT_CODE(KEYCODE_RCONTROL) // to right of Back Space PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Rub Out") PORT_CODE(KEYCODE_BACKSPACE) PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_UNUSED) - PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(']') PORT_CHAR('}') PORT_CODE(KEYCODE_BACKSLASH) + PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(']') PORT_CHAR('}') PORT_CODE(KEYCODE_BACKSLASH) // to right of =/+ PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_UNUSED) PORT_START("X3") PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Right Shift") PORT_CODE(KEYCODE_RSHIFT) - PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('\\') PORT_CHAR('`') PORT_CODE(KEYCODE_OPENBRACE) + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('\\') PORT_CHAR('`') PORT_CODE(KEYCODE_OPENBRACE) // to right of P PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('\'') PORT_CHAR('"') PORT_CODE(KEYCODE_QUOTE) - PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Back Space") PORT_CHAR(0x08) PORT_CODE(KEYCODE_CLOSEBRACE) + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Back Space") PORT_CHAR(0x08) PORT_CODE(KEYCODE_CLOSEBRACE) // to right of backslash PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('-') PORT_CHAR('_') PORT_CODE(KEYCODE_MINUS) PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Return") PORT_CHAR(0x0d) PORT_CODE(KEYCODE_ENTER) PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('=') PORT_CHAR('+') PORT_CODE(KEYCODE_EQUALS) @@ -294,12 +294,12 @@ static INPUT_PORTS_START(tek410x_keyboard) PORT_START("X7") PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Caps Lock") PORT_CHAR(UCHAR_MAMEKEY(CAPSLOCK)) PORT_CODE(KEYCODE_LCONTROL) - PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Esc") PORT_CHAR(0x1b) //PORT_CODE(KEYCODE_XXX) - PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Tab") PORT_CHAR(0x09) //PORT_CODE(KEYCODE_XXX) - PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('|') PORT_CHAR('~') PORT_CODE(KEYCODE_TAB) - PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("SEras DEras") //PORT_CODE(KEYCODE_XXX) + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Esc") PORT_CHAR(0x1b) PORT_CODE(KEYCODE_ESC) // to left of |/~ + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Tab") PORT_CHAR(0x09) PORT_CODE(KEYCODE_TAB) // to left of Ctrl + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('|') PORT_CHAR('~') PORT_CODE(KEYCODE_BACKSLASH2) // to left of Q + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("SEras DEras") PORT_CODE(KEYCODE_LALT) // to left of [/{ PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Ctrl") PORT_CHAR(UCHAR_SHIFT_2) PORT_CODE(KEYCODE_CAPSLOCK) - PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('[') PORT_CHAR('{') PORT_CODE(KEYCODE_TILDE) + PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('[') PORT_CHAR('{') PORT_CODE(KEYCODE_TILDE) // to left of 1/! PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Left Shift") PORT_CHAR(UCHAR_SHIFT_1) PORT_CODE(KEYCODE_LSHIFT) PORT_START("X8") diff --git a/src/mame/ti/exelv.cpp b/src/mame/ti/exelv.cpp index 87f87ab60edf7..62ce6c555638d 100644 --- a/src/mame/ti/exelv.cpp +++ b/src/mame/ti/exelv.cpp @@ -99,7 +99,7 @@ Using the cassette: #include "cpu/tms7000/tms7000.h" #include "imagedev/cassette.h" -#include "machine/spchrom.h" +#include "machine/tms6100.h" #include "machine/timer.h" #include "sound/tms5220.h" #include "sound/spkrdev.h" @@ -923,13 +923,17 @@ void exelv_state::exeltel(machine_config &config) PALETTE(config, "palette", palette_device::RGB_3BIT); - SPEECHROM(config, "vsm", 0); - /* sound */ SPEAKER(config, "mono").front_center(); TMS5220C(config, m_tms5220c, 9.8304_MHz_XTAL / 15); // unknown divider for "VSPCLK" (generated by TAHC06 gate array) - m_tms5220c->set_speechrom_tag("vsm"); m_tms5220c->add_route(ALL_OUTPUTS, "mono", 1.00); + + TMS6100(config, "vsm", 640_kHz_XTAL/4); + m_tms5220c->m0_cb().set("vsm", FUNC(tms6100_device::m0_w)); + m_tms5220c->m1_cb().set("vsm", FUNC(tms6100_device::m1_w)); + m_tms5220c->addr_cb().set("vsm", FUNC(tms6100_device::add_w)); + m_tms5220c->data_cb().set("vsm", FUNC(tms6100_device::data_line_r)); + m_tms5220c->romclk_cb().set("vsm", FUNC(tms6100_device::clk_w)); } diff --git a/src/mame/ti/geneve.cpp b/src/mame/ti/geneve.cpp index fa3f3f3d6e6b8..5fde031bb0dd7 100644 --- a/src/mame/ti/geneve.cpp +++ b/src/mame/ti/geneve.cpp @@ -210,6 +210,7 @@ namespace { #define GENEVE_SRAM_TAG "sram" #define GENEVE_SRAMX_TAG "sramexp" +#define GENEVE_SRAMU_TAG "sramult" #define GENEVE_DRAM_TAG "dram" #define GENEVE_CLOCK_TAG "mm58274c" #define GENEVE_SOUNDCHIP_TAG "soundchip" @@ -226,6 +227,13 @@ enum FULLGNM = 255 // AME,AMD,FULLGEN }; +enum +{ + SRAM32 = 0, + SRAM64 = 1, + SRAM384 = 2 +}; + void geneve_xt_keyboards(device_slot_interface &device) { device.option_add(STR_KBD_KEYTRONIC_PC3270, PC_KBD_KEYTRONIC_PC3270); @@ -246,6 +254,7 @@ class geneve_state : public driver_device m_dram(*this, GENEVE_DRAM_TAG), m_sram(*this, GENEVE_SRAM_TAG), m_sramx(*this, GENEVE_SRAMX_TAG), + m_sramu(*this, GENEVE_SRAMU_TAG), m_gatearray(*this, GENEVE_GATE_ARRAY_TAG), m_genmod_decoder(*this, GENMOD_DECODER_TAG), m_pal(*this, GENEVE_PAL_TAG), @@ -258,7 +267,7 @@ class geneve_state : public driver_device m_left_button(0), m_pfm_prefix(0), m_pfm_oe(true), - m_sram_exp(true), + m_sram_size(SRAM64), m_genmod(false) { } @@ -305,6 +314,7 @@ class geneve_state : public driver_device required_device m_dram; required_device m_sram; required_device m_sramx; + required_device m_sramu; required_device m_gatearray; optional_device m_genmod_decoder; @@ -362,7 +372,7 @@ class geneve_state : public driver_device // Settings int m_boot_rom = 0; // Kind of boot ROM (EPROM or PFM512 or PFM512A) - bool m_sram_exp; + int m_sram_size = SRAM64; // Genmod modifications bool m_genmod; @@ -415,9 +425,10 @@ static INPUT_PORTS_START(geneve) PORT_INCLUDE(geneve_common) PORT_START( "SRAM" ) - PORT_CONFNAME( 0x03, 0x01, "SRAM expansion 32K" ) - PORT_CONFSETTING( 0x00, "off" ) - PORT_CONFSETTING( 0x01, "on" ) + PORT_CONFNAME( 0x03, 0x01, "SRAM size" ) + PORT_CONFSETTING( SRAM32, "32 KiB" ) + PORT_CONFSETTING( SRAM64, "64 KiB" ) + PORT_CONFSETTING( SRAM384, "384 KiB" ) INPUT_PORTS_END @@ -596,19 +607,29 @@ uint8_t geneve_state::memread(offs_t offset) } // Expanded SRAM 32K (not in Genmod) - if (!m_genmod) + if (!m_genmod && m_gatearray->ramenx_out()==ASSERT_LINE) { - if (m_gatearray->ramenx_out()==ASSERT_LINE) + if (m_sram_size != SRAM32) { - if (m_sram_exp) - { - sramadd = m_gatearray->get_prefix(AB1 | AB2) | addr13; - value = m_sramx->pointer()[sramadd]; - LOGMASKED(LOG_READ, "SRAMX %02x:%04x -> %02x\n", page, addr13, value); - } - else - LOGMASKED(LOG_WARN, "Access to SRAMX page %02x, but no SRAM expansion available\n", page); + sramadd = m_gatearray->get_prefix(AB1 | AB2) | addr13; + value = m_sramx->pointer()[sramadd]; + LOGMASKED(LOG_READ, "SRAMX %02x:%04x -> %02x\n", page, addr13, value); } + else + LOGMASKED(LOG_WARN, "Access to SRAMX page %02x, but no SRAM expansion available\n", page); + } + + // Ultimate SRAM expansion (not in Genmod) + if (!m_genmod && m_gatearray->ramenu_out()==ASSERT_LINE) + { + if (m_sram_size == SRAM384) + { + sramadd = m_gatearray->get_prefix(FULLGEN) | addr13; + value = m_sramu->pointer()[sramadd]; + LOGMASKED(LOG_READ, "SRAMU %02x:%04x -> %02x\n", page, addr13, value); + } + else + LOGMASKED(LOG_WARN, "Access to SRAMU page %02x, but no 384K SRAM expansion available\n", page); } // Peripheral box @@ -703,20 +724,30 @@ void geneve_state::memwrite(offs_t offset, uint8_t data) m_sram->pointer()[sramadd] = data; } - // Expanded SRAM - if (!m_genmod) + // Expanded SRAM (not in Genmod) + if (!m_genmod && m_gatearray->ramenx_out()==ASSERT_LINE) { - if (m_gatearray->ramenx_out()==ASSERT_LINE) + if (m_sram_size != SRAM32) { - if (m_sram_exp) - { - sramadd = m_gatearray->get_prefix(AB1 | AB2) | addr13; - LOGMASKED(LOG_WRITE, "SRAMX %02x:%04x <- %02x\n", page, addr13, data); - m_sramx->pointer()[sramadd] = data; - } - else - LOGMASKED(LOG_WARN, "Access to SRAMX page %02x, but no SRAM expansion available\n", page); + sramadd = m_gatearray->get_prefix(AB1 | AB2) | addr13; + LOGMASKED(LOG_WRITE, "SRAMX %02x:%04x <- %02x\n", page, addr13, data); + m_sramx->pointer()[sramadd] = data; } + else + LOGMASKED(LOG_WARN, "Access to SRAMX page %02x, but no SRAM expansion available\n", page); + } + + // Ultimate SRAM expansion (not in Genmod) + if (!m_genmod && m_gatearray->ramenu_out()==ASSERT_LINE) + { + if (m_sram_size == SRAM384) + { + sramadd = m_gatearray->get_prefix(FULLGEN) | addr13; + LOGMASKED(LOG_READ, "SRAMU %02x:%04x -> %02x\n", page, addr13, data); + m_sramu->pointer()[sramadd] = data; + } + else + LOGMASKED(LOG_WARN, "Access to SRAMU page %02x, but no 384K SRAM expansion available\n", page); } // Peripheral box @@ -1120,16 +1151,14 @@ void geneve_state::machine_reset() if (m_genmod) { - m_sram_exp = false; m_genmod_decoder->set_turbo((ioport("GENMODDIPS")->read() & GENEVE_GM_TURBO)!=0); m_genmod_decoder->set_timode((ioport("GENMODDIPS")->read() & GENEVE_GM_TIM)!=0); } else { // SRAM expansion - // Only separately handled for the standard Geneve; Genmod uses - // the Memex instead - m_sram_exp = (ioport("SRAM")->read()!=0); + // Only applies to the standard Geneve; Genmod uses the Memex instead + m_sram_size = (ioport("SRAM")->read()); } } @@ -1242,6 +1271,9 @@ void geneve_state::geneve_common(machine_config &config) // SRAM RAM(config, GENEVE_SRAM_TAG).set_default_size("32K").set_default_value(0); RAM(config, GENEVE_SRAMX_TAG).set_default_size("32K").set_default_value(0); + + // Ultimate SRAM expansion + RAM(config, GENEVE_SRAMU_TAG).set_default_size("384K").set_default_value(0); } /* diff --git a/src/mame/ti/ti99_8.cpp b/src/mame/ti/ti99_8.cpp index f9a17d59ca9c3..a17cf458308b8 100644 --- a/src/mame/ti/ti99_8.cpp +++ b/src/mame/ti/ti99_8.cpp @@ -652,10 +652,6 @@ void ti99_8_state::clock_out(int state) void ti99_8_state::driver_start() { - // Need to configure the speech ROM for inverse bit order -// speechrom_device* mem = subdevice(TI998_SPEECHROM_REG); -// mem->set_reverse_bit_order(true); - save_item(NAME(m_keyboard_column)); save_item(NAME(m_ready_old)); save_item(NAME(m_int1)); @@ -743,14 +739,19 @@ void ti99_8_state::ti99_8(machine_config& config) // Speech hardware // Note: SPEECHROM uses its tag for referencing the region - SPEECHROM(config, TI998_SPEECHROM_REG, 0).set_reverse_bit_order(true); SPEAKER(config, "speech_out").front_center(); cd2501ecd_device& vsp(CD2501ECD(config, TI998_SPEECHSYN_TAG, 640000L)); vsp.ready_cb().set(TI998_MAINBOARD_TAG, FUNC(mainboard8_device::speech_ready)); - vsp.set_speechrom_tag(TI998_SPEECHROM_REG); vsp.add_route(ALL_OUTPUTS, "speech_out", 0.50); + TMS6100(config, TI998_SPEECHROM_REG, 0); + vsp.m0_cb().set(TI998_SPEECHROM_REG, FUNC(tms6100_device::m0_w)); + vsp.m1_cb().set(TI998_SPEECHROM_REG, FUNC(tms6100_device::m1_w)); + vsp.addr_cb().set(TI998_SPEECHROM_REG, FUNC(tms6100_device::add_w)); + vsp.data_cb().set(TI998_SPEECHROM_REG, FUNC(tms6100_device::data_line_r)); + vsp.romclk_cb().set(TI998_SPEECHROM_REG, FUNC(tms6100_device::clk_w)); + // Cassette drive SPEAKER(config, "cass_out").front_center(); CASSETTE(config, "cassette", 0).add_route(ALL_OUTPUTS, "cass_out", 0.25); diff --git a/src/mame/toaplan/fixeight.cpp b/src/mame/toaplan/fixeight.cpp index 5ffc92219bab8..0d62d056d49f9 100644 --- a/src/mame/toaplan/fixeight.cpp +++ b/src/mame/toaplan/fixeight.cpp @@ -771,4 +771,4 @@ GAME( 1992, fixeightat, fixeight, fixeight, fixeight, fixeight_state, empty GAME( 1992, fixeightut, fixeight, fixeight, fixeight, fixeight_state, empty_init, ROT270, "Toaplan (Taito license)", "FixEight (USA, Taito license)", MACHINE_SUPPORTS_SAVE ) GAME( 1992, fixeightjt, fixeight, fixeight, fixeight, fixeight_state, empty_init, ROT270, "Toaplan (Taito license)", "FixEight - Jigoku no Eiyuu Densetsu (Japan, Taito license)", MACHINE_SUPPORTS_SAVE ) -GAME( 1992, fixeightbl, fixeight, fixeightbl, fixeightbl, fixeight_bootleg_state, init_fixeightbl, ROT270, "bootleg", "FixEight (Korea, bootleg)", MACHINE_SUPPORTS_SAVE ) +GAME( 1992, fixeightbl, fixeight, fixeightbl, fixeightbl, fixeight_bootleg_state, init_fixeightbl, ROT270, "bootleg (Shine)", "FixEight (Korea, bootleg)", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/virtual/vgmplay.cpp b/src/mame/virtual/vgmplay.cpp index 0433c40f6c431..eb39cb463e57b 100644 --- a/src/mame/virtual/vgmplay.cpp +++ b/src/mame/virtual/vgmplay.cpp @@ -8,11 +8,16 @@ #define QSOUND_LLE -#include "imagedev/snapquik.h" +#include "mega32x.h" +#include "vboysound.h" +#include "wswansound.h" #include "cpu/h6280/h6280.h" #include "cpu/m6502/rp2a03.h" #include "cpu/m68000/m68000.h" + +#include "imagedev/snapquik.h" + #include "sound/ay8910.h" #include "sound/c140.h" #include "sound/c352.h" @@ -43,11 +48,6 @@ #include "sound/ymopn.h" #include "sound/ymz280b.h" -#include "mega32x.h" -#include "vboysound.h" -#include "wswansound.h" - -#include "vgmplay.lh" #include "debugger.h" #include "softlist_dev.h" #include "speaker.h" @@ -62,6 +62,8 @@ #include #include +#include "vgmplay.lh" + #define AS_IO16LE 1 #define AS_IO16BE 4 @@ -278,7 +280,7 @@ class vgmplay_device : public cpu_device void pause(); bool paused() const { return m_paused; } void play(); - void toggle_loop() { m_loop = !m_loop; } + void toggle_loop() { m_loop = !m_loop; m_loop_led = m_loop ? 1 : 0; } protected: virtual void device_start() override ATTR_COLD; @@ -337,6 +339,8 @@ class vgmplay_device : public cpu_device uint32_t handle_pcm_write(uint32_t address); void blocks_clear(); + output_finder<> m_playing_led; + output_finder<> m_loop_led; output_finder m_act_leds; led_expiry_list m_act_led_expiries; std::unique_ptr m_act_led_index; @@ -537,6 +541,8 @@ class vgmplay_state : public driver_device vgmplay_device::vgmplay_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : cpu_device(mconfig, VGMPLAY, tag, owner, clock), + m_playing_led(*this, "playing"), + m_loop_led(*this, "loop"), m_act_leds(*this, "led_act_%u", 0U), m_file_config("file", ENDIANNESS_LITTLE, 8, 32), m_io_config("io", ENDIANNESS_LITTLE, 8, 32), @@ -553,6 +559,8 @@ void vgmplay_device::device_start() m_io16le = &space(AS_IO16LE); m_io16be = &space(AS_IO16BE); + m_playing_led.resolve(); + m_loop_led.resolve(); m_act_leds.resolve(); m_act_led_index = std::make_unique(CT_COUNT); for (vgm_chip led = vgm_chip(0); led != CT_COUNT; led = vgm_chip(led + 1)) @@ -574,6 +582,8 @@ void vgmplay_device::device_reset() { m_state = RESET; m_paused = false; + m_playing_led = 1; + m_loop_led = m_loop ? 1 : 0; m_ym2612_stream_offset = 0; std::fill(std::begin(m_upd7759_bank), std::end(m_upd7759_bank), 0); @@ -638,19 +648,26 @@ void vgmplay_device::stop() { device_reset(); m_paused = true; + m_playing_led = 0; } void vgmplay_device::pause() { m_paused = !m_paused; + m_playing_led = m_paused ? 0 : 1; } void vgmplay_device::play() { if (m_paused && m_state != DONE) + { m_paused = false; + m_playing_led = 1; + } else + { device_reset(); + } } uint32_t vgmplay_device::execute_min_cycles() const noexcept diff --git a/src/mame/vsystem/pspikes.cpp b/src/mame/vsystem/pspikes.cpp index b934c331d0ff5..b42f4302950b1 100644 --- a/src/mame/vsystem/pspikes.cpp +++ b/src/mame/vsystem/pspikes.cpp @@ -96,7 +96,7 @@ class pspikes_base_state : public driver_device , m_oki(*this, "oki") , m_gfxdecode(*this, "gfxdecode") , m_palette(*this, "palette") - , m_spr_old(*this, "vsystem_spr_old%u", 1) + , m_spr(*this, "spr%u", 1) , m_vram(*this, "vram.%u", 0) , m_rasterram(*this, "rasterram") , m_sprlookupram(*this, "sprlookupram%u", 1) @@ -111,7 +111,7 @@ class pspikes_base_state : public driver_device void aerfboo2(machine_config &config) ATTR_COLD; protected: - uint32_t pspikes_old_tile_callback(uint32_t code); + uint32_t pspikes_tile_callback(uint32_t code); // handlers template void vram_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); @@ -135,7 +135,7 @@ class pspikes_base_state : public driver_device uint32_t screen_update_pspikesb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); uint32_t screen_update_aerfboot(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); uint32_t screen_update_aerfboo2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - void pspikes_register_state_globals(); + void register_state_globals(); void setbank(int layer, int num, int bank); void aerfboo2_draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int chip, int chip_disabled_pri); void pspikesb_draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); @@ -152,7 +152,7 @@ class pspikes_base_state : public driver_device optional_device m_oki; required_device m_gfxdecode; required_device m_palette; - optional_device_array m_spr_old; + optional_device_array m_spr; // memory pointers optional_shared_ptr_array m_vram; @@ -169,9 +169,9 @@ class pspikes_base_state : public driver_device uint16_t m_scrollx[2]{}; uint16_t m_scrolly[2]{}; bool m_flip_screen = false; - int m_charpalettebank = 0; - int m_spritepalettebank = 0; - int m_sprite_gfx = 0; + uint32_t m_charpalettebank = 0; + uint32_t m_spritepalettebank = 0; + int m_sprite_gfx = 0; }; @@ -199,7 +199,7 @@ class pspikes_sound_cpu_state : public pspikes_base_state void karatblz_gfxbank_w(uint8_t data); void kickball_gfxbank_w(uint8_t data); - uint32_t pspikes_ol2_tile_callback(uint32_t code); + uint32_t pspikes_tile2_callback(uint32_t code); uint32_t screen_update_karatblz(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); @@ -407,7 +407,7 @@ TILE_GET_INFO_MEMBER(pspikes_base_state::get_tile_info) ***************************************************************************/ -void pspikes_base_state::pspikes_register_state_globals() +void pspikes_base_state::register_state_globals() { save_item(NAME(m_gfxbank)); save_item(NAME(m_bank)); @@ -426,7 +426,7 @@ VIDEO_START_MEMBER(pspikes_base_state,pspikes) m_sprite_gfx = 1; m_charpalettebank = 0; - pspikes_register_state_globals(); + register_state_globals(); } void spikes91_state::video_start() @@ -447,7 +447,7 @@ VIDEO_START_MEMBER(pspikes_base_state,karatblz) m_spritepalettebank = 0; m_sprite_gfx = 2; - pspikes_register_state_globals(); + register_state_globals(); } VIDEO_START_MEMBER(pspikes_banked_sound_state,spinlbrk) @@ -462,7 +462,7 @@ VIDEO_START_MEMBER(pspikes_banked_sound_state,spinlbrk) // sprite maps are hardcoded in this game - pspikes_register_state_globals(); + register_state_globals(); } VIDEO_START_MEMBER(pspikes_base_state,turbofrc) @@ -475,7 +475,7 @@ VIDEO_START_MEMBER(pspikes_base_state,turbofrc) m_spritepalettebank = 0; m_sprite_gfx = 2; - pspikes_register_state_globals(); + register_state_globals(); } VIDEO_START_MEMBER(pspikes_base_state,aerofgtb) @@ -487,12 +487,12 @@ VIDEO_START_MEMBER(pspikes_base_state,aerofgtb) } -uint32_t pspikes_base_state::pspikes_old_tile_callback(uint32_t code) +uint32_t pspikes_base_state::pspikes_tile_callback(uint32_t code) { return m_sprlookupram[0][code % (m_sprlookupram[0].bytes()/2)]; } -uint32_t pspikes_sound_cpu_state::pspikes_ol2_tile_callback(uint32_t code) +uint32_t pspikes_sound_cpu_state::pspikes_tile2_callback(uint32_t code) { return m_sprlookupram[1][code % (m_sprlookupram[1].bytes()/2)]; } @@ -604,8 +604,8 @@ uint32_t pspikes_base_state::screen_update_pspikes(screen_device &screen, bitmap screen.priority().fill(0, cliprect); m_tilemap[0]->draw(screen, bitmap, cliprect, 0, 0); - m_spr_old[0]->draw_sprites(m_spriteram,m_spriteram.bytes(),m_spritepalettebank, bitmap, cliprect, screen.priority(), 1, m_flip_screen); - m_spr_old[0]->draw_sprites(m_spriteram,m_spriteram.bytes(),m_spritepalettebank, bitmap, cliprect, screen.priority(), 0, m_flip_screen); + m_spr[0]->draw_sprites(m_spriteram,m_spriteram.bytes(),m_spritepalettebank, bitmap, cliprect, screen.priority(), 1, m_flip_screen); + m_spr[0]->draw_sprites(m_spriteram,m_spriteram.bytes(),m_spritepalettebank, bitmap, cliprect, screen.priority(), 0, m_flip_screen); return 0; } @@ -623,11 +623,11 @@ uint32_t pspikes_sound_cpu_state::screen_update_karatblz(screen_device &screen, m_tilemap[1]->draw(screen, bitmap, cliprect, 0, 0); // we use the priority buffer so sprites are drawn front to back - m_spr_old[1]->draw_sprites(m_spriteram+0x200,m_spriteram.bytes()/2,m_spritepalettebank, bitmap, cliprect, screen.priority(), 1, m_flip_screen); - m_spr_old[1]->draw_sprites(m_spriteram+0x200,m_spriteram.bytes()/2,m_spritepalettebank, bitmap, cliprect, screen.priority(), 0, m_flip_screen); + m_spr[1]->draw_sprites(m_spriteram+0x200,m_spriteram.bytes()/2,m_spritepalettebank, bitmap, cliprect, screen.priority(), 1, m_flip_screen); + m_spr[1]->draw_sprites(m_spriteram+0x200,m_spriteram.bytes()/2,m_spritepalettebank, bitmap, cliprect, screen.priority(), 0, m_flip_screen); - m_spr_old[0]->draw_sprites(m_spriteram+0x000,m_spriteram.bytes()/2,m_spritepalettebank, bitmap, cliprect, screen.priority(), 1, m_flip_screen); - m_spr_old[0]->draw_sprites(m_spriteram+0x000,m_spriteram.bytes()/2,m_spritepalettebank, bitmap, cliprect, screen.priority(), 0, m_flip_screen); + m_spr[0]->draw_sprites(m_spriteram+0x000,m_spriteram.bytes()/2,m_spritepalettebank, bitmap, cliprect, screen.priority(), 1, m_flip_screen); + m_spr[0]->draw_sprites(m_spriteram+0x000,m_spriteram.bytes()/2,m_spritepalettebank, bitmap, cliprect, screen.priority(), 0, m_flip_screen); return 0; } @@ -648,11 +648,11 @@ uint32_t pspikes_banked_sound_state::screen_update_spinlbrk(screen_device &scree m_tilemap[1]->draw(screen, bitmap, cliprect, 0, 1); // we use the priority buffer so sprites are drawn front to back - m_spr_old[0]->draw_sprites(m_spriteram+0x000,m_spriteram.bytes()/2,m_spritepalettebank, bitmap, cliprect, screen.priority(), 0, m_flip_screen); - m_spr_old[0]->draw_sprites(m_spriteram+0x000,m_spriteram.bytes()/2,m_spritepalettebank, bitmap, cliprect, screen.priority(), 1, m_flip_screen); + m_spr[0]->draw_sprites(m_spriteram+0x000,m_spriteram.bytes()/2,m_spritepalettebank, bitmap, cliprect, screen.priority(), 0, m_flip_screen); + m_spr[0]->draw_sprites(m_spriteram+0x000,m_spriteram.bytes()/2,m_spritepalettebank, bitmap, cliprect, screen.priority(), 1, m_flip_screen); - m_spr_old[1]->draw_sprites(m_spriteram+0x200,m_spriteram.bytes()/2,m_spritepalettebank, bitmap, cliprect, screen.priority(), 0, m_flip_screen); - m_spr_old[1]->draw_sprites(m_spriteram+0x200,m_spriteram.bytes()/2,m_spritepalettebank, bitmap, cliprect, screen.priority(), 1, m_flip_screen); + m_spr[1]->draw_sprites(m_spriteram+0x200,m_spriteram.bytes()/2,m_spritepalettebank, bitmap, cliprect, screen.priority(), 0, m_flip_screen); + m_spr[1]->draw_sprites(m_spriteram+0x200,m_spriteram.bytes()/2,m_spritepalettebank, bitmap, cliprect, screen.priority(), 1, m_flip_screen); return 0; } @@ -674,11 +674,11 @@ uint32_t pspikes_banked_sound_state::screen_update_turbofrc(screen_device &scree m_tilemap[1]->draw(screen, bitmap, cliprect, 0, 1); // we use the priority buffer so sprites are drawn front to back - m_spr_old[1]->draw_sprites(m_spriteram+0x200,m_spriteram.bytes()/2,m_spritepalettebank, bitmap, cliprect, screen.priority(), 1, m_flip_screen); //ship - m_spr_old[1]->draw_sprites(m_spriteram+0x200,m_spriteram.bytes()/2,m_spritepalettebank, bitmap, cliprect, screen.priority(), 0, m_flip_screen); //intro + m_spr[1]->draw_sprites(m_spriteram+0x200,m_spriteram.bytes()/2,m_spritepalettebank, bitmap, cliprect, screen.priority(), 1, m_flip_screen); //ship + m_spr[1]->draw_sprites(m_spriteram+0x200,m_spriteram.bytes()/2,m_spritepalettebank, bitmap, cliprect, screen.priority(), 0, m_flip_screen); //intro - m_spr_old[0]->draw_sprites(m_spriteram+0x000,m_spriteram.bytes()/2,m_spritepalettebank, bitmap, cliprect, screen.priority(), 1, m_flip_screen); //enemy - m_spr_old[0]->draw_sprites(m_spriteram+0x000,m_spriteram.bytes()/2,m_spritepalettebank, bitmap, cliprect, screen.priority(), 0, m_flip_screen); //enemy + m_spr[0]->draw_sprites(m_spriteram+0x000,m_spriteram.bytes()/2,m_spritepalettebank, bitmap, cliprect, screen.priority(), 1, m_flip_screen); //enemy + m_spr[0]->draw_sprites(m_spriteram+0x000,m_spriteram.bytes()/2,m_spritepalettebank, bitmap, cliprect, screen.priority(), 0, m_flip_screen); //enemy return 0; } @@ -700,7 +700,7 @@ void wbbc97_state::video_start() m_sprite_gfx = 1; - pspikes_register_state_globals(); + register_state_globals(); save_item(NAME(m_bitmap_enable)); } @@ -1083,8 +1083,8 @@ uint32_t wbbc97_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap m_tilemap[0]->draw(screen, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0); } - m_spr_old[0]->draw_sprites(m_spriteram,m_spriteram.bytes(),m_spritepalettebank, bitmap, cliprect, screen.priority(), 1, m_flip_screen); - m_spr_old[0]->draw_sprites(m_spriteram,m_spriteram.bytes(),m_spritepalettebank, bitmap, cliprect, screen.priority(), 0, m_flip_screen); + m_spr[0]->draw_sprites(m_spriteram,m_spriteram.bytes(),m_spritepalettebank, bitmap, cliprect, screen.priority(), 1, m_flip_screen); + m_spr[0]->draw_sprites(m_spriteram,m_spriteram.bytes(),m_spritepalettebank, bitmap, cliprect, screen.priority(), 0, m_flip_screen); return 0; } @@ -2301,8 +2301,8 @@ void pspikes_banked_sound_state::pspikes(machine_config &config) GFXDECODE(config, m_gfxdecode, m_palette, gfx_pspikes); PALETTE(config, m_palette).set_format(palette_device::xRGB_555, 2048); - VSYSTEM_SPR2(config, m_spr_old[0], 0, m_palette, gfx_pspikes_spr); - m_spr_old[0]->set_tile_indirect_cb(FUNC(pspikes_banked_sound_state::pspikes_old_tile_callback)); + VSYSTEM_SPR2(config, m_spr[0], 0, m_palette, gfx_pspikes_spr); + m_spr[0]->set_tile_indirect_cb(FUNC(pspikes_banked_sound_state::pspikes_tile_callback)); VSYSTEM_GGA(config, "gga", XTAL(14'318'181) / 2); // divider not verified @@ -2420,8 +2420,8 @@ void pspikes_sound_cpu_state::kickball(machine_config &config) GFXDECODE(config, m_gfxdecode, m_palette, gfx_pspikes); PALETTE(config, m_palette).set_format(palette_device::xRGB_555, 2048); - VSYSTEM_SPR2(config, m_spr_old[0], 0, m_palette, gfx_kickball_spr); - m_spr_old[0]->set_tile_indirect_cb(FUNC(pspikes_sound_cpu_state::pspikes_old_tile_callback)); + VSYSTEM_SPR2(config, m_spr[0], 0, m_palette, gfx_kickball_spr); + m_spr[0]->set_tile_indirect_cb(FUNC(pspikes_sound_cpu_state::pspikes_tile_callback)); //VSYSTEM_GGA(config, "gga", 0); // still accessed as if it exists, in clone hardware? @@ -2463,8 +2463,8 @@ void pspikes_base_state::pspikesc(machine_config &config) //VSYSTEM_GGA(config, "gga", 0); - VSYSTEM_SPR2(config, m_spr_old[0], 0, m_palette, gfx_pspikes_spr); - m_spr_old[0]->set_tile_indirect_cb(FUNC(pspikes_base_state::pspikes_old_tile_callback)); + VSYSTEM_SPR2(config, m_spr[0], 0, m_palette, gfx_pspikes_spr); + m_spr[0]->set_tile_indirect_cb(FUNC(pspikes_base_state::pspikes_tile_callback)); MCFG_VIDEO_START_OVERRIDE(pspikes_base_state,pspikes) @@ -2501,11 +2501,11 @@ void pspikes_banked_sound_state::karatblz(machine_config &config) VSYSTEM_GGA(config, "gga", XTAL(14'318'181) / 2); // divider not verified - VSYSTEM_SPR2(config, m_spr_old[0], 0, m_palette, gfx_turbofrc_spr1); - m_spr_old[0]->set_tile_indirect_cb(FUNC(pspikes_banked_sound_state::pspikes_old_tile_callback)); + VSYSTEM_SPR2(config, m_spr[0], 0, m_palette, gfx_turbofrc_spr1); + m_spr[0]->set_tile_indirect_cb(FUNC(pspikes_banked_sound_state::pspikes_tile_callback)); - VSYSTEM_SPR2(config, m_spr_old[1], 0, m_palette, gfx_turbofrc_spr2); - m_spr_old[1]->set_tile_indirect_cb(FUNC(pspikes_banked_sound_state::pspikes_ol2_tile_callback)); + VSYSTEM_SPR2(config, m_spr[1], 0, m_palette, gfx_turbofrc_spr2); + m_spr[1]->set_tile_indirect_cb(FUNC(pspikes_banked_sound_state::pspikes_tile2_callback)); MCFG_VIDEO_START_OVERRIDE(pspikes_banked_sound_state,karatblz) @@ -2548,11 +2548,11 @@ void karatblzbl_state::karatblzbl(machine_config &config) GFXDECODE(config, m_gfxdecode, m_palette, gfx_turbofrc); PALETTE(config, m_palette).set_format(palette_device::xRGB_555, 1024); - VSYSTEM_SPR2(config, m_spr_old[0], 0, m_palette, gfx_turbofrc_spr1); - m_spr_old[0]->set_tile_indirect_cb(FUNC(karatblzbl_state::pspikes_old_tile_callback)); + VSYSTEM_SPR2(config, m_spr[0], 0, m_palette, gfx_turbofrc_spr1); + m_spr[0]->set_tile_indirect_cb(FUNC(karatblzbl_state::pspikes_tile_callback)); - VSYSTEM_SPR2(config, m_spr_old[1], 0, m_palette, gfx_turbofrc_spr2); - m_spr_old[1]->set_tile_indirect_cb(FUNC(karatblzbl_state::pspikes_ol2_tile_callback)); + VSYSTEM_SPR2(config, m_spr[1], 0, m_palette, gfx_turbofrc_spr2); + m_spr[1]->set_tile_indirect_cb(FUNC(karatblzbl_state::pspikes_tile2_callback)); //VSYSTEM_GGA(config, "gga", 0); @@ -2598,12 +2598,12 @@ void pspikes_banked_sound_state::spinlbrk(machine_config &config) VSYSTEM_GGA(config, "gga", XTAL(14'318'181) / 2); // divider not verified - VSYSTEM_SPR2(config, m_spr_old[0], 0, m_palette, gfx_turbofrc_spr1); - m_spr_old[0]->set_pritype(1); + VSYSTEM_SPR2(config, m_spr[0], 0, m_palette, gfx_turbofrc_spr1); + m_spr[0]->set_pritype(1); - VSYSTEM_SPR2(config, m_spr_old[1], 0, m_palette, gfx_turbofrc_spr2); - m_spr_old[1]->set_tile_indirect_cb(FUNC(pspikes_banked_sound_state::spinbrk_tile_callback)); // rom lookup - m_spr_old[1]->set_pritype(1); + VSYSTEM_SPR2(config, m_spr[1], 0, m_palette, gfx_turbofrc_spr2); + m_spr[1]->set_tile_indirect_cb(FUNC(pspikes_banked_sound_state::spinbrk_tile_callback)); // rom lookup + m_spr[1]->set_pritype(1); MCFG_VIDEO_START_OVERRIDE(pspikes_banked_sound_state,spinlbrk) @@ -2648,11 +2648,11 @@ void pspikes_banked_sound_state::turbofrc(machine_config &config) VSYSTEM_GGA(config, "gga", XTAL(14'318'181) / 2); // divider not verified - VSYSTEM_SPR2(config, m_spr_old[0], 0, m_palette, gfx_turbofrc_spr1); - m_spr_old[0]->set_tile_indirect_cb(FUNC(pspikes_banked_sound_state::pspikes_old_tile_callback)); + VSYSTEM_SPR2(config, m_spr[0], 0, m_palette, gfx_turbofrc_spr1); + m_spr[0]->set_tile_indirect_cb(FUNC(pspikes_banked_sound_state::pspikes_tile_callback)); - VSYSTEM_SPR2(config, m_spr_old[1], 0, m_palette, gfx_turbofrc_spr2); - m_spr_old[1]->set_tile_indirect_cb(FUNC(pspikes_banked_sound_state::pspikes_ol2_tile_callback)); + VSYSTEM_SPR2(config, m_spr[1], 0, m_palette, gfx_turbofrc_spr2); + m_spr[1]->set_tile_indirect_cb(FUNC(pspikes_banked_sound_state::pspikes_tile2_callback)); MCFG_VIDEO_START_OVERRIDE(pspikes_banked_sound_state,turbofrc) @@ -2697,13 +2697,13 @@ void pspikes_banked_sound_state::aerofgtb(machine_config &config) VSYSTEM_GGA(config, "gga", XTAL(14'318'181) / 2); // divider not verified - VSYSTEM_SPR2(config, m_spr_old[0], 0, m_palette, gfx_turbofrc_spr1); - m_spr_old[0]->set_tile_indirect_cb(FUNC(pspikes_banked_sound_state::pspikes_old_tile_callback)); - m_spr_old[0]->set_offsets(3, -1); + VSYSTEM_SPR2(config, m_spr[0], 0, m_palette, gfx_turbofrc_spr1); + m_spr[0]->set_tile_indirect_cb(FUNC(pspikes_banked_sound_state::pspikes_tile_callback)); + m_spr[0]->set_offsets(3, -1); - VSYSTEM_SPR2(config, m_spr_old[1], 0, m_palette, gfx_turbofrc_spr2); - m_spr_old[1]->set_tile_indirect_cb(FUNC(pspikes_banked_sound_state::pspikes_ol2_tile_callback)); - m_spr_old[1]->set_offsets(3, -1); + VSYSTEM_SPR2(config, m_spr[1], 0, m_palette, gfx_turbofrc_spr2); + m_spr[1]->set_tile_indirect_cb(FUNC(pspikes_banked_sound_state::pspikes_tile2_callback)); + m_spr[1]->set_offsets(3, -1); MCFG_VIDEO_START_OVERRIDE(pspikes_banked_sound_state,aerofgtb) @@ -2813,8 +2813,8 @@ void wbbc97_state::wbbc97(machine_config &config) //VSYSTEM_GGA(config, "gga", 0); - VSYSTEM_SPR2(config, m_spr_old[0], 0, m_palette, gfx_pspikes_spr); - m_spr_old[0]->set_tile_indirect_cb(FUNC(wbbc97_state::pspikes_old_tile_callback)); + VSYSTEM_SPR2(config, m_spr[0], 0, m_palette, gfx_pspikes_spr); + m_spr[0]->set_tile_indirect_cb(FUNC(wbbc97_state::pspikes_tile_callback)); // sound hardware SPEAKER(config, "mono").front_center(); diff --git a/src/mame/vsystem/vsystem_spr.cpp b/src/mame/vsystem/vsystem_spr.cpp index 33f63734af643..2df3f612f7cb6 100644 --- a/src/mame/vsystem/vsystem_spr.cpp +++ b/src/mame/vsystem/vsystem_spr.cpp @@ -29,7 +29,7 @@ - 5 bit of palette selection for the mixer - Scaling (x/y) - Flipping -- Indipendent sorting list +- Independent sorting list - 1 bit of pri for the mixer Note that this chip can be connected to a VS9210 which adds a level of indirection for diff --git a/src/mame/wing/pinkiri8.cpp b/src/mame/wing/pinkiri8.cpp index 82980a10d1eae..95f63f4849215 100644 --- a/src/mame/wing/pinkiri8.cpp +++ b/src/mame/wing/pinkiri8.cpp @@ -39,11 +39,15 @@ Dumped by Chackn ***************************************************************************/ #include "emu.h" + #include "cpu/z180/hd647180x.h" + #include "sound/okim6295.h" + #include "emupal.h" #include "screen.h" #include "speaker.h" +#include "tilemap.h" #define LOG_VRAM (1U << 1) @@ -53,21 +57,54 @@ Dumped by Chackn /* VDP device to give us our own memory map */ -class janshi_vdp_device : public device_t, public device_memory_interface +class janshi_vdp_device : public device_t, public device_memory_interface, public device_gfx_interface { public: + // constructor/destructor janshi_vdp_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - void map(address_map &map) ATTR_COLD; + // configurations + void set_janshi_hack(bool janshi_hack) { m_janshi_hack = janshi_hack; } + + uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + + void write(offs_t offset, uint8_t data); protected: + virtual void device_add_mconfig(machine_config &config) override ATTR_COLD; virtual void device_validity_check(validity_checker &valid) const override; virtual void device_start() override ATTR_COLD; virtual void device_reset() override ATTR_COLD; virtual space_config_vector memory_space_config() const override; private: - address_space_config m_space_config; + address_space_config m_space_config; + + required_device m_palette; + + required_shared_ptr m_back_vram; + required_shared_ptr m_vram1; + required_shared_ptr m_unk1; + required_shared_ptr m_widthflags; + required_shared_ptr m_unk2; + required_shared_ptr m_vram2; + required_shared_ptr m_crtc_regs; + + // internal states + tilemap_t *m_tilemap = nullptr; + uint32_t m_vram_addr; + int32_t m_prev_writes; + + // configurations + bool m_janshi_hack; + + void back_vram_w(offs_t offset, uint8_t data); + DECLARE_GFXDECODE_MEMBER(gfxinfo); + TILE_GET_INFO_MEMBER(get_tile_info); + + void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); + + void map(address_map &map) ATTR_COLD; }; class pinkiri8_state : public driver_device @@ -75,86 +112,59 @@ class pinkiri8_state : public driver_device public: pinkiri8_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), - m_janshi_back_vram(*this, "janshivdp:back_vram"), - m_janshi_vram1(*this, "janshivdp:vram1"), - m_janshi_unk1(*this, "janshivdp:unk1"), - m_janshi_widthflags(*this, "janshivdp:widthflags"), - m_janshi_unk2(*this, "janshivdp:unk2"), - m_janshi_vram2(*this, "janshivdp:vram2"), - m_janshi_paletteram(*this, "janshivdp:paletteram"), - m_janshi_paletteram2(*this, "janshivdp:paletteram2"), - m_janshi_crtc_regs(*this, "janshivdp:crtc_regs"), m_maincpu(*this, "maincpu"), m_vdp(*this, "janshivdp"), - m_gfxdecode(*this, "gfxdecode"), - m_palette(*this, "palette") + m_io_pl{{*this, "PL1_%u", 1U}, {*this, "PL2_%u", 1U}} { } void pinkiri8(machine_config &config); void ronjan(machine_config &config); + void janshi(machine_config &config); protected: + virtual void machine_start() override ATTR_COLD; + +private: void output_regs_w(uint8_t data); - void pinkiri8_vram_w(offs_t offset, uint8_t data); - void mux_w(uint8_t data); - uint8_t mux_p2_r(); - uint8_t mux_p1_r(); + void io_matrix_w(uint8_t data); + template uint8_t io_matrix_r(); uint8_t ronjan_prot_r(); void ronjan_prot_w(uint8_t data); uint8_t ronjan_prot_status_r(); uint8_t ronjan_patched_prot_r(); - virtual void video_start() override ATTR_COLD; - uint32_t screen_update_pinkiri8(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - - void draw_background(bitmap_ind16 &bitmap, const rectangle &cliprect); - void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); void pinkiri8_io(address_map &map) ATTR_COLD; - void pinkiri8_map(address_map &map) ATTR_COLD; + void prg_map(address_map &map) ATTR_COLD; void ronjan_io(address_map &map) ATTR_COLD; -private: - required_shared_ptr m_janshi_back_vram; - required_shared_ptr m_janshi_vram1; - required_shared_ptr m_janshi_unk1; - required_shared_ptr m_janshi_widthflags; - required_shared_ptr m_janshi_unk2; - required_shared_ptr m_janshi_vram2; - required_shared_ptr m_janshi_paletteram; - required_shared_ptr m_janshi_paletteram2; - required_shared_ptr m_janshi_crtc_regs; - uint32_t m_vram_addr = 0; - int m_prev_writes = 0; - uint8_t m_mux_data = 0; - uint8_t m_prot_read_index = 0; - uint8_t m_prot_char[5]{}; - uint8_t m_prot_index = 0; - required_device m_maincpu; required_device m_vdp; - required_device m_gfxdecode; - required_device m_palette; -}; + required_ioport_array<5> m_io_pl[2]; + uint8_t m_io_matrix = 0; + uint8_t m_prot_read_index = 0; + uint8_t m_prot_char[5]{}; + uint8_t m_prot_index = 0; +}; void janshi_vdp_device::map(address_map &map) { - map(0xfc0000, 0xfc1fff).ram().share("back_vram"); // bg tilemap? - map(0xfc2000, 0xfc2fff).ram().share("vram1"); // xpos, colour, tile number etc. + map(0xfc0000, 0xfc1fff).ram().w(FUNC(janshi_vdp_device::back_vram_w)).share(m_back_vram); // bg tilemap? + map(0xfc2000, 0xfc2fff).ram().share(m_vram1); // xpos, colour, tile number etc. - map(0xfc3700, 0xfc377f).ram().share("unk1"); // ?? height related? - map(0xfc3780, 0xfc37bf).ram().share("widthflags"); - map(0xfc37c0, 0xfc37ff).ram().share("unk2"); // 2x increasing tables 00 10 20 30 etc. + map(0xfc3700, 0xfc377f).ram().share(m_unk1); // ?? height related? + map(0xfc3780, 0xfc37bf).ram().share(m_widthflags); + map(0xfc37c0, 0xfc37ff).ram().share(m_unk2); // 2x increasing tables 00 10 20 30 etc. - map(0xfc3800, 0xfc3fff).ram().share("vram2"); // y pos + unknown + map(0xfc3800, 0xfc3fff).ram().share(m_vram2); // y pos + unknown - map(0xff0000, 0xff07ff).ram().share("paletteram"); //ram().w(FUNC(janshi_vdp_device::paletteram_xBBBBBGGGGGRRRRR_byte_split_lo_w)); - map(0xff2000, 0xff27ff).ram().share("paletteram2"); //ram().w(FUNC(janshi_vdp_device::paletteram_xBBBBBGGGGGRRRRR_byte_split_hi_w)); + map(0xff0000, 0xff07ff).ram().w(m_palette, FUNC(palette_device::write8)).share("palette"); //ram().w(FUNC(janshi_vdp_device::paletteram_xBBBBBGGGGGRRRRR_byte_split_lo_w)); + map(0xff2000, 0xff27ff).ram().w(m_palette, FUNC(palette_device::write8_ext)).share("palette_ext"); //ram().w(FUNC(janshi_vdp_device::paletteram_xBBBBBGGGGGRRRRR_byte_split_hi_w)); - map(0xff6000, 0xff601f).ram().share("crtc_regs"); + map(0xff6000, 0xff601f).ram().share(m_crtc_regs); } DEFINE_DEVICE_TYPE(JANSHIVDP, janshi_vdp_device, "janshi_vdp", "Janshi VDP") @@ -162,12 +172,52 @@ DEFINE_DEVICE_TYPE(JANSHIVDP, janshi_vdp_device, "janshi_vdp", "Janshi VDP") janshi_vdp_device::janshi_vdp_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, JANSHIVDP, tag, owner, clock) , device_memory_interface(mconfig, *this) + , device_gfx_interface(mconfig, *this, gfxinfo, "palette") , m_space_config("janshi_vdp", ENDIANNESS_LITTLE, 8,24, 0, address_map_constructor(FUNC(janshi_vdp_device::map), this)) + , m_palette(*this, "palette") + , m_back_vram(*this, "back_vram") + , m_vram1(*this, "vram1") + , m_unk1(*this, "unk1") + , m_widthflags(*this, "widthflags") + , m_unk2(*this, "unk2") + , m_vram2(*this, "vram2") + , m_crtc_regs(*this, "crtc_regs") + , m_vram_addr(0) + , m_prev_writes(0) + , m_janshi_hack(false) { } +static const gfx_layout charlayout = +{ + 16,8, + RGN_FRAC(1,5), + 5, + { RGN_FRAC(4,5),RGN_FRAC(3,5),RGN_FRAC(2,5),RGN_FRAC(1,5),RGN_FRAC(0,5) }, + { STEP8(0,1), STEP8(8*8,1) }, + { STEP8(0,8) }, + 8*16 +}; + +GFXDECODE_MEMBER(janshi_vdp_device::gfxinfo) + GFXDECODE_DEVICE(DEVICE_SELF, 0, charlayout, 0, 0x40 ) +GFXDECODE_END + +void janshi_vdp_device::device_add_mconfig(machine_config &config) +{ + PALETTE(config, m_palette).set_format(palette_device::xBGR_555, 0x800); +} + void janshi_vdp_device::device_validity_check(validity_checker &valid) const {} -void janshi_vdp_device::device_start() {} + +void janshi_vdp_device::device_start() +{ + m_tilemap = &machine().tilemap().create(*this, tilemap_get_info_delegate(*this, FUNC(janshi_vdp_device::get_tile_info)), TILEMAP_SCAN_ROWS, 16, 8, 32, 64); + + save_item(NAME(m_vram_addr)); + save_item(NAME(m_prev_writes)); +} + void janshi_vdp_device::device_reset() {} device_memory_interface::space_config_vector janshi_vdp_device::memory_space_config() const @@ -177,91 +227,93 @@ device_memory_interface::space_config_vector janshi_vdp_device::memory_space_con }; } -void pinkiri8_state::video_start() {} - - -void pinkiri8_state::draw_background(bitmap_ind16 &bitmap, const rectangle &cliprect) +void janshi_vdp_device::back_vram_w(offs_t offset, uint8_t data) { - gfx_element *gfx = m_gfxdecode->gfx(0); + m_back_vram[offset] = data; + m_tilemap->mark_tile_dirty(offset >> 2); +} - /* FIXME: color is a bit of a mystery */ +void janshi_vdp_device::write(offs_t offset, uint8_t data) +{ + switch (offset) { - int x, y, col, tile, count, attr; + case 0: + m_vram_addr = (data << 0) | (m_vram_addr & 0xffff00); + LOGMASKED(LOG_VRAM, "\n prev writes was %04x\n\naddress set to %04x -\n", m_prev_writes, m_vram_addr); + m_prev_writes = 0; + break; - count = 0; + case 1: + m_vram_addr = (data << 8) | (m_vram_addr & 0xff00ff); + LOGMASKED(LOG_VRAM, "\naddress set to %04x\n", m_vram_addr); + break; - for (y = 0; y < 64; y++) - { - for (x = 0; x < 32; x++) - { - tile = m_janshi_back_vram[count + 1] << 8 | m_janshi_back_vram[count + 0]; - attr = m_janshi_back_vram[count + 2] ^ 0xf0; - col = (attr >> 4) | 0x10; + case 2: + m_vram_addr = (data << 16) | (m_vram_addr & 0x00ffff); + LOGMASKED(LOG_VRAM, "\naddress set to %04x\n", m_vram_addr); + break; - gfx->transpen(bitmap,cliprect, tile, col, 0, 0, x * 16, y * 8, 0); + case 3: + { + LOGMASKED(LOG_VRAM, "%02x ", data); + m_prev_writes++; + m_vram_addr++; - count += 4; - } + space(0).write_byte(m_vram_addr, data); + break; } } } -void pinkiri8_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect) +TILE_GET_INFO_MEMBER(janshi_vdp_device::get_tile_info) { - int MACHINE_TYPE_hack = 0; - int col_bank; - gfx_element *gfx = m_gfxdecode->gfx(0); - - if (!strcmp(machine().system().name,"janshi")) MACHINE_TYPE_hack = 1; - - //popmessage("%02x",m_janshi_crtc_regs[0x0a]); - col_bank = (m_janshi_crtc_regs[0x0a] & 0x40) >> 6; - - - int x,y; //,unk2; - int col; - - int spr_offs,i; - - int width, height; + /* FIXME: color is a bit of a mystery */ + tile_index <<= 2; + int const tile = m_back_vram[tile_index + 1] << 8 | m_back_vram[tile_index + 0]; + int const attr = m_back_vram[tile_index + 2] ^ 0xf0; + int const col = (attr >> 4) | 0x10; + tileinfo.set(0, tile, col, 0); +} +void janshi_vdp_device::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + //popmessage("%02x", m_crtc_regs[0x0a]); + int const col_bank = BIT(m_crtc_regs[0x0a], 6); - for(i=(0x1000/4)-4;i>=0;i--) + for (int i = (0x1000 / 4) - 4; i >= 0; i--) { - /* "vram1" (video map 0xfc2000) - - tttt tttt | 00tt tttt | cccc c000 | xxxx xxxx | - - "vram2" (video map 0xfc3800) + /* + "vram1" (video map 0xfc2000) - yyyy yyyy | ???? ???? | + tttt tttt | 00tt tttt | cccc c000 | xxxx xxxx | + "vram2" (video map 0xfc3800) - widths come from "widthflags" (0xfc3780) - "unk1" (0xfc3700) and "unk2" (0xfc37c0) are a mystery + yyyy yyyy | ???? ???? | - */ - spr_offs = ((m_janshi_vram1[(i*4)+0] & 0xff) | (m_janshi_vram1[(i*4)+1]<<8)) & 0xffff; - col = (m_janshi_vram1[(i*4)+2] & 0xf8) >> 3; - x = m_janshi_vram1[(i*4)+3] * 2; + widths come from "widthflags" (0xfc3780) + "unk1" (0xfc3700) and "unk2" (0xfc37c0) are a mystery + */ -// unk2 = m_janshi_vram2[(i*2)+1]; - y = (m_janshi_vram2[(i*2)+0]); + int spr_offs = (m_vram1[(i * 4) + 0] | (m_vram1[(i * 4) + 1] << 8)) & 0xffff; + int col = (m_vram1[(i * 4) + 2] & 0xf8) >> 3; + int x = m_vram1[(i * 4) + 3] * 2; - y = 0x100-y; + //int unk2 = m_vram2[(i * 2) + 1]; + int y = (m_vram2[(i * 2) + 0]); + y = 0x100 - y; - col|= col_bank<<5; + col |= col_bank << 5; - // width = 0; height = 0; - - width = 2; - height = 2; + //int width = 0, height = 0; + int width = 2; + int height = 2; // this bit determines the sprite width, one bit is used in each word, each bit is used for a range of sprites - int bit = m_janshi_widthflags[(i/0x20)*2 + 1]; + int const bit = m_widthflags[(i / 0x20) * 2 + 1]; if (bit) { @@ -275,41 +327,41 @@ void pinkiri8_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprec } // hacks! - if (MACHINE_TYPE_hack==1) // janshi + if (m_janshi_hack) // janshi { - if (spr_offs<0x400) + if (spr_offs < 0x400) { height = 4; } - else if (spr_offs<0x580) + else if (spr_offs < 0x580) { // height = 2; } - else if (spr_offs<0x880) + else if (spr_offs < 0x880) { height = 4; } - else if (spr_offs<0x1000) + else if (spr_offs < 0x1000) { // height = 2; } - else if (spr_offs<0x1080) + else if (spr_offs < 0x1080) { // height = 2; } - else if (spr_offs<0x1700) + else if (spr_offs < 0x1700) { height = 4; } - else if (spr_offs<0x1730) + else if (spr_offs < 0x1730) { // height = 2; } - else if (spr_offs<0x1930) + else if (spr_offs < 0x1930) { height = 4; } - else if (spr_offs<0x19c0) + else if (spr_offs < 0x19c0) { height = 1; } @@ -317,69 +369,46 @@ void pinkiri8_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprec { height = 4; } - - } - - - - - - if (height==1) - y+=16; - + if (height == 1) + y += 16; // hmm... - if (height==2) - y+=16; - + if (height == 2) + y += 16; + int count = 0; + for (int yy = 0; yy < height; yy++) { - int count = 0; - - - for (int yy=0;yytranspen(bitmap,cliprect,spr_offs+count,col,0,0,(x+xx*16) -7 ,(y+yy*8)-33,0); - count++; - } + gfx(0)->transpen(bitmap, cliprect, + spr_offs + count, col, + 0, 0, + (x + xx * 16) - 7, (y + yy * 8) - 33, + 0); + count++; } } } } -uint32_t pinkiri8_state::screen_update_pinkiri8(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t janshi_vdp_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - /* update palette */ - for (int pen = 0; pen < 0x800 ; pen++) - { - uint16_t val = (m_janshi_paletteram[pen]) | (m_janshi_paletteram2[pen]<<8); - int r = (val & 0x001f) >> 0; - int g = (val & 0x03e0) >> 5; - int b = (val & 0x7c00) >> 10; - m_palette->set_pen_color(pen, pal5bit(r), pal5bit(g), pal5bit(b)); - } - - - #if 0 - if ( machine().input().code_pressed_once(KEYCODE_W) ) + if (machine().input().code_pressed_once(KEYCODE_W)) { - int i; - int count2; printf("-------------------------------\n"); - count2=0; - for (i=0x00;i<0x40;i+=2) + int count2 = 0; + for (int i = 0x00; i < 0x40; i += 2) { - printf("%02x, ", m_janshi_widthflags[i+1]); + printf("%02x, ", m_widthflags[i+1]); count2++; - if (count2==0x10) + if (count2 == 0x10) { printf("\n"); count2 = 0; @@ -388,17 +417,16 @@ uint32_t pinkiri8_state::screen_update_pinkiri8(screen_device &screen, bitmap_in } #endif - bitmap.fill(m_palette->black_pen(), cliprect); - draw_background(bitmap, cliprect); + m_tilemap->draw(screen, bitmap, cliprect, 0, 0); draw_sprites(bitmap, cliprect); return 0; } -void pinkiri8_state::pinkiri8_map(address_map &map) +void pinkiri8_state::prg_map(address_map &map) { map(0x00000, 0x0bfff).rom(); map(0x0c000, 0x0dfff).ram(); @@ -408,78 +436,27 @@ void pinkiri8_state::pinkiri8_map(address_map &map) void pinkiri8_state::output_regs_w(uint8_t data) { - if(data & 0x40) + if (BIT(data, 6)) m_maincpu->set_input_line(INPUT_LINE_NMI, CLEAR_LINE); - //data & 0x80 is probably NMI mask -} - - -void pinkiri8_state::pinkiri8_vram_w(offs_t offset, uint8_t data) -{ - switch(offset) - { - case 0: - m_vram_addr = (data << 0) | (m_vram_addr&0xffff00); - LOGMASKED(LOG_VRAM, "\n prev writes was %04x\n\naddress set to %04x -\n", m_prev_writes, m_vram_addr); - m_prev_writes = 0; - break; - - case 1: - m_vram_addr = (data << 8) | (m_vram_addr & 0xff00ff); - LOGMASKED(LOG_VRAM, "\naddress set to %04x\n", m_vram_addr); - break; - - case 2: - m_vram_addr = (data << 16) | (m_vram_addr & 0x00ffff); - LOGMASKED(LOG_VRAM, "\naddress set to %04x\n", m_vram_addr); - break; - - case 3: - { - address_space &vdp_space = m_vdp->space(); - - LOGMASKED(LOG_VRAM, "%02x ", data); - m_prev_writes++; - m_vram_addr++; - - vdp_space.write_byte(m_vram_addr, data); - break; - } - } + //BIT(data, 7) is probably NMI mask } - -void pinkiri8_state::mux_w(uint8_t data) +void pinkiri8_state::io_matrix_w(uint8_t data) { - m_mux_data = data; + m_io_matrix = data; } -uint8_t pinkiri8_state::mux_p2_r() +template +uint8_t pinkiri8_state::io_matrix_r() { - switch(m_mux_data) + uint8_t ret = 0xff; + for (int i = 0; i < 5; i++) { - case 0x01: return ioport("PL2_01")->read(); - case 0x02: return ioport("PL2_02")->read(); - case 0x04: return ioport("PL2_03")->read(); - case 0x08: return ioport("PL2_04")->read(); - case 0x10: return ioport("PL2_05")->read(); + if (BIT(m_io_matrix, i)) + ret &= m_io_pl[Player][i]->read(); } - return 0xff; -} - -uint8_t pinkiri8_state::mux_p1_r() -{ - switch(m_mux_data) - { - case 0x01: return ioport("PL1_01")->read(); - case 0x02: return ioport("PL1_02")->read(); - case 0x04: return ioport("PL1_03")->read(); - case 0x08: return ioport("PL1_04")->read(); - case 0x10: return ioport("PL1_05")->read(); - } - - return 0xff; + return ret; } void pinkiri8_state::pinkiri8_io(address_map &map) @@ -487,12 +464,12 @@ void pinkiri8_state::pinkiri8_io(address_map &map) map.global_mask(0xff); map(0x00, 0x3f).ram(); //Z180 internal I/O map(0x60, 0x60).nopw(); - map(0x80, 0x83).w(FUNC(pinkiri8_state::pinkiri8_vram_w)); + map(0x80, 0x83).w(m_vdp, FUNC(janshi_vdp_device::write)); map(0xa0, 0xa0).rw("oki", FUNC(okim6295_device::read), FUNC(okim6295_device::write)); //correct? - map(0xb0, 0xb0).w(FUNC(pinkiri8_state::mux_w)); //mux - map(0xb0, 0xb0).r(FUNC(pinkiri8_state::mux_p2_r)); // mux inputs - map(0xb1, 0xb1).r(FUNC(pinkiri8_state::mux_p1_r)); // mux inputs + map(0xb0, 0xb0).w(FUNC(pinkiri8_state::io_matrix_w)); //mux + map(0xb0, 0xb0).r(FUNC(pinkiri8_state::io_matrix_r<1>)); // mux inputs + map(0xb1, 0xb1).r(FUNC(pinkiri8_state::io_matrix_r<0>)); // mux inputs map(0xb2, 0xb2).portr("SYSTEM"); map(0xf8, 0xf8).portr("DSW1"); map(0xf9, 0xf9).portr("DSW2"); @@ -536,7 +513,7 @@ static INPUT_PORTS_START( base_inputs ) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_GAMBLE_KEYIN ) PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_START("PL1_01") + PORT_START("PL1_1") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_A ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_E ) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_I ) @@ -544,7 +521,7 @@ static INPUT_PORTS_START( base_inputs ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_KAN ) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1 ) - PORT_START("PL1_02") + PORT_START("PL1_2") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_B ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_F ) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_J ) @@ -552,7 +529,7 @@ static INPUT_PORTS_START( base_inputs ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_REACH ) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_BET ) - PORT_START("PL1_03") + PORT_START("PL1_3") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_C ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_G ) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_K ) @@ -560,7 +537,7 @@ static INPUT_PORTS_START( base_inputs ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_RON ) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_START("PL1_04") + PORT_START("PL1_4") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_D ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_H ) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_L ) @@ -568,7 +545,7 @@ static INPUT_PORTS_START( base_inputs ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_START("PL1_05") + PORT_START("PL1_5") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_LAST_CHANCE ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_SCORE ) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_DOUBLE_UP ) @@ -576,7 +553,7 @@ static INPUT_PORTS_START( base_inputs ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_BIG ) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_SMALL ) - PORT_START("PL2_01") + PORT_START("PL2_1") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_A ) PORT_PLAYER(2) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_E ) PORT_PLAYER(2) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_I ) PORT_PLAYER(2) @@ -584,7 +561,7 @@ static INPUT_PORTS_START( base_inputs ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_KAN ) PORT_PLAYER(2) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 ) - PORT_START("PL2_02") + PORT_START("PL2_2") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_B ) PORT_PLAYER(2) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_F ) PORT_PLAYER(2) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_J ) PORT_PLAYER(2) @@ -592,7 +569,7 @@ static INPUT_PORTS_START( base_inputs ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_REACH ) PORT_PLAYER(2) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_BET ) PORT_PLAYER(2) - PORT_START("PL2_03") + PORT_START("PL2_3") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_C ) PORT_PLAYER(2) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_G ) PORT_PLAYER(2) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_K ) PORT_PLAYER(2) @@ -600,7 +577,7 @@ static INPUT_PORTS_START( base_inputs ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_RON ) PORT_PLAYER(2) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_START("PL2_04") + PORT_START("PL2_4") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_D ) PORT_PLAYER(2) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_H ) PORT_PLAYER(2) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_L ) PORT_PLAYER(2) @@ -608,7 +585,7 @@ static INPUT_PORTS_START( base_inputs ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_START("PL2_05") + PORT_START("PL2_5") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_LAST_CHANCE ) PORT_PLAYER(2) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_SCORE ) PORT_PLAYER(2) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_DOUBLE_UP ) PORT_PLAYER(2) @@ -913,7 +890,7 @@ static INPUT_PORTS_START( pinkiri8 ) PORT_INCLUDE( base_inputs ) /* standard mahjong panel converted to a hanafuda one */ - PORT_MODIFY("PL1_01") + PORT_MODIFY("PL1_1") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_HANAFUDA_A ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_HANAFUDA_E ) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) @@ -921,7 +898,7 @@ static INPUT_PORTS_START( pinkiri8 ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1 ) - PORT_MODIFY("PL1_02") + PORT_MODIFY("PL1_2") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_HANAFUDA_B ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_HANAFUDA_F ) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) @@ -929,7 +906,7 @@ static INPUT_PORTS_START( pinkiri8 ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_BET ) - PORT_MODIFY("PL1_03") + PORT_MODIFY("PL1_3") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_HANAFUDA_C ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_HANAFUDA_G ) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) @@ -937,7 +914,7 @@ static INPUT_PORTS_START( pinkiri8 ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_MODIFY("PL1_04") + PORT_MODIFY("PL1_4") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_HANAFUDA_D ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_HANAFUDA_H ) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) @@ -945,7 +922,7 @@ static INPUT_PORTS_START( pinkiri8 ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_MODIFY("PL1_05") + PORT_MODIFY("PL1_5") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) @@ -953,7 +930,7 @@ static INPUT_PORTS_START( pinkiri8 ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_MODIFY("PL2_01") + PORT_MODIFY("PL2_1") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_HANAFUDA_A ) PORT_PLAYER(2) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_HANAFUDA_E ) PORT_PLAYER(2) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) @@ -961,7 +938,7 @@ static INPUT_PORTS_START( pinkiri8 ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 ) - PORT_MODIFY("PL2_02") + PORT_MODIFY("PL2_2") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_HANAFUDA_B ) PORT_PLAYER(2) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_HANAFUDA_F ) PORT_PLAYER(2) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) @@ -969,7 +946,7 @@ static INPUT_PORTS_START( pinkiri8 ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_BET ) PORT_PLAYER(2) - PORT_MODIFY("PL2_03") + PORT_MODIFY("PL2_3") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_HANAFUDA_C ) PORT_PLAYER(2) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_HANAFUDA_G ) PORT_PLAYER(2) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) @@ -977,7 +954,7 @@ static INPUT_PORTS_START( pinkiri8 ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_MODIFY("PL2_04") + PORT_MODIFY("PL2_4") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_HANAFUDA_D ) PORT_PLAYER(2) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_HANAFUDA_H ) PORT_PLAYER(2) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) @@ -985,7 +962,7 @@ static INPUT_PORTS_START( pinkiri8 ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_MODIFY("PL2_05") + PORT_MODIFY("PL2_5") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) @@ -1103,25 +1080,19 @@ static INPUT_PORTS_START( pinkiri8 ) PORT_DIPUNUSED_DIPLOC( 0x80, 0x80, "SW4:8" ) INPUT_PORTS_END -static const gfx_layout charlayout = +void pinkiri8_state::machine_start() { - 16,8, - RGN_FRAC(1,5), - 5, - { RGN_FRAC(4,5),RGN_FRAC(3,5),RGN_FRAC(2,5),RGN_FRAC(1,5),RGN_FRAC(0,5) }, - { 0, 1, 2, 3, 4, 5, 6, 7, 8*8+0, 8*8+1, 8*8+2, 8*8+3, 8*8+4, 8*8+5, 8*8+6, 8*8+7 }, - { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 }, - 8*16 -}; + save_item(NAME(m_io_matrix)); -static GFXDECODE_START( gfx_pinkiri8 ) - GFXDECODE_ENTRY( "gfx1", 0, charlayout, 0, 0x100 ) -GFXDECODE_END + save_item(NAME(m_prot_read_index)); + save_item(NAME(m_prot_char)); + save_item(NAME(m_prot_index)); +} void pinkiri8_state::pinkiri8(machine_config &config) { HD647180X(config, m_maincpu, XTAL(32'000'000)/2); - m_maincpu->set_addrmap(AS_PROGRAM, &pinkiri8_state::pinkiri8_map); + m_maincpu->set_addrmap(AS_PROGRAM, &pinkiri8_state::prg_map); m_maincpu->set_addrmap(AS_IO, &pinkiri8_state::pinkiri8_io); m_maincpu->set_vblank_int("screen", FUNC(pinkiri8_state::nmi_line_assert)); m_maincpu->out_pa_callback().set(FUNC(pinkiri8_state::output_regs_w)); @@ -1131,11 +1102,8 @@ void pinkiri8_state::pinkiri8(machine_config &config) screen.set_vblank_time(ATTOSECONDS_IN_USEC(0)); screen.set_size(64*8, 64*8); screen.set_visarea(0*8, 62*8-1, 0*8, 32*8-1); - screen.set_screen_update(FUNC(pinkiri8_state::screen_update_pinkiri8)); - screen.set_palette(m_palette); - - GFXDECODE(config, m_gfxdecode, m_palette, gfx_pinkiri8); - PALETTE(config, m_palette).set_entries(0x2000); + screen.set_screen_update(m_vdp, FUNC(janshi_vdp_device::screen_update)); + screen.set_palette("janshivdp:palette"); JANSHIVDP(config, m_vdp, 0); @@ -1153,6 +1121,13 @@ void pinkiri8_state::ronjan(machine_config &config) m_maincpu->in_pg_callback().set(FUNC(pinkiri8_state::ronjan_prot_status_r)); } +void pinkiri8_state::janshi(machine_config &config) +{ + pinkiri8(config); + + m_vdp->set_janshi_hack(true); +} + /*************************************************************************** Game driver(s) @@ -1164,7 +1139,7 @@ ROM_START( pinkiri8 ) ROM_LOAD( "pinkiri8-ver.1.02.l1", 0x0000, 0x20000, CRC(f2df5b12) SHA1(e374e184a6a1e932550516011ec09a5accec9b03) ) ROM_LOAD( "bios.rom", 0x0000, 0x4000, CRC(399df1ee) SHA1(8251f3aa7da4c7899c8e739c10b61260f4471311) ) //overlapped internal ROM - ROM_REGION( 0x20000*5, "gfx1", 0 ) + ROM_REGION( 0x20000*5, "janshivdp", 0 ) ROM_LOAD( "pinkiri8-chr-01.a1", 0x00000, 0x20000, CRC(8ec73662) SHA1(9098348e519ce753dd7f38f0d855181bfc65aa42) ) ROM_LOAD( "pinkiri8-chr-02.bc1", 0x20000, 0x20000, CRC(8dc20a65) SHA1(4062510fe06e8844a732754b7915a3b67ba2a3c5) ) ROM_LOAD( "pinkiri8-chr-03.d1", 0x40000, 0x20000, CRC(bd5f269a) SHA1(7dfd039227551f0f0ed4afaafc76ca64a39a9b83) ) @@ -1180,7 +1155,7 @@ ROM_START( janshi ) ROM_LOAD( "11.1l", 0x00000, 0x20000, CRC(a7692ddf) SHA1(5e7f43d8337583977baf22a28bbcd9b2182c0cde) ) ROM_LOAD( "=3= 9009 1992.1 new jansh.bin", 0x0000, 0x4000, CRC(63cd3f12) SHA1(aebac739bffaf043e6acffa978e935f73ee1385f) ) //overlapped internal ROM - ROM_REGION( 0x140000, "gfx1", 0 ) + ROM_REGION( 0x140000, "janshivdp", 0 ) ROM_LOAD( "1.1a", 0x000000, 0x40000, CRC(92b140a5) SHA1(f3b38563f74650604ed0faaf84460e0b04b386b7) ) ROM_LOAD( "2.1b", 0x040000, 0x40000, CRC(6de7e086) SHA1(e87426264f0181c17383ffe0f7ec7ff5fce3d809) ) ROM_LOAD( "3.1d", 0x080000, 0x40000, CRC(4e94d8f2) SHA1(a25f542943d74915fc82910baafb9ff9db1ffd70) ) @@ -1196,7 +1171,7 @@ ROM_START( ronjans ) ROM_LOAD( "ver201.bin", 0x00000, 0x20000, CRC(caa98c79) SHA1(e18f52fc910e3a77142ad2a3167805cfd664f0f4) ) ROM_LOAD( "9009 1996.08 ron jan.bin", 0x00000, 0x4000, CRC(4eb74322) SHA1(84f864c0da3fb69948f6eb7ffecf0e722a882efc) ) //overlapped internal ROM - ROM_REGION( 0x140000, "gfx1", 0 ) + ROM_REGION( 0x140000, "janshivdp", 0 ) ROM_LOAD( "eagle.1", 0x000000, 0x40000, CRC(11cef2c4) SHA1(fcd46bfa123cd91053f8d49892778e02a275ffdd) ) ROM_LOAD( "eagle.2", 0x040000, 0x40000, CRC(177c444c) SHA1(5af0f6040ba121c90b3480ce636885cce535d3ea) ) ROM_LOAD( "eagle.3", 0x080000, 0x40000, CRC(5b15b99f) SHA1(b99e2fa4cde7c8661d1a81ce5045f5df4f1de9f2) ) @@ -1212,7 +1187,7 @@ ROM_START( ronjansa ) // the Z180 internal ROM wasn't extracted from this PCB. I ROM_LOAD( "eagle_18.i1", 0x00000, 0x20000, CRC(b5cc6d84) SHA1(e76ec529a7cd788a9ca0119d2f2dc00b29181289) ) ROM_LOAD( "9009 1992.04 ron jan.bin", 0x00000, 0x04000, NO_DUMP ) //overlapped internal ROM - ROM_REGION( 0x140000, "gfx1", 0 ) + ROM_REGION( 0x140000, "janshivdp", 0 ) ROM_LOAD( "eagle_1.a1", 0x000000, 0x40000, CRC(11cef2c4) SHA1(fcd46bfa123cd91053f8d49892778e02a275ffdd) ) ROM_LOAD( "eagle_2.b1", 0x040000, 0x40000, CRC(177c444c) SHA1(5af0f6040ba121c90b3480ce636885cce535d3ea) ) ROM_LOAD( "eagle_3.d1", 0x080000, 0x40000, CRC(5b15b99f) SHA1(b99e2fa4cde7c8661d1a81ce5045f5df4f1de9f2) ) @@ -1228,7 +1203,7 @@ ROM_START( ronjansb ) // the Z180 internal ROM wasn't extracted from this PCB. I ROM_LOAD( "eagle_19.i1", 0x00000, 0x20000, CRC(348fa965) SHA1(082395c51478c1cc053425d30fc94871fdc244ea) ) ROM_LOAD( "9009 1992.09 ron jan.bin", 0x00000, 0x04000, NO_DUMP ) //overlapped internal ROM - ROM_REGION( 0x140000, "gfx1", 0 ) + ROM_REGION( 0x140000, "janshivdp", 0 ) ROM_LOAD( "eagle_1.a1", 0x000000, 0x40000, CRC(11cef2c4) SHA1(fcd46bfa123cd91053f8d49892778e02a275ffdd) ) ROM_LOAD( "eagle_2.b1", 0x040000, 0x40000, CRC(177c444c) SHA1(5af0f6040ba121c90b3480ce636885cce535d3ea) ) ROM_LOAD( "eagle_3.d1", 0x080000, 0x40000, CRC(5b15b99f) SHA1(b99e2fa4cde7c8661d1a81ce5045f5df4f1de9f2) ) @@ -1244,7 +1219,7 @@ ROM_START( ronjan ) // the Z180 internal ROM wasn't extracted from this PCB. Usi ROM_LOAD( "9.l1", 0x00000, 0x20000, CRC(1bc4468e) SHA1(5b317c922d9a6f533958526e676f95af0ee6a19f) ) ROM_LOAD( "9009 1991.11 ron jan.bin", 0x00000, 0x4000, BAD_DUMP CRC(4eb74322) SHA1(84f864c0da3fb69948f6eb7ffecf0e722a882efc) ) //overlapped internal ROM - ROM_REGION( 0x140000, "gfx1", 0 ) + ROM_REGION( 0x140000, "janshivdp", 0 ) ROM_LOAD( "1.a1", 0x000000, 0x20000, CRC(8242a791) SHA1(bb753e81293685499513e83b7a103396b3a32ad8) ) ROM_LOAD( "2.c1", 0x040000, 0x20000, CRC(4b25c09a) SHA1(edbe1907c300f12bf65c81b2d9e034d6f5545bd0) ) ROM_LOAD( "3.d1", 0x080000, 0x20000, CRC(7b956af6) SHA1(4a661d5cc5b06658804c8d377d5a266f5bd9ce85) ) @@ -1260,7 +1235,7 @@ ROM_START( ronjana ) // the Z180 internal ROM wasn't extracted from this PCB. Us ROM_LOAD( "eagle_16.i1", 0x00000, 0x20000, CRC(9b7bf916) SHA1(d8a732bb53926e8127bc3638c8719f3c43c7881d) ) ROM_LOAD( "9009 1991.11 ron jan.bin", 0x00000, 0x04000, BAD_DUMP CRC(4eb74322) SHA1(84f864c0da3fb69948f6eb7ffecf0e722a882efc) ) //overlapped internal ROM - ROM_REGION( 0x140000, "gfx1", 0 ) + ROM_REGION( 0x140000, "janshivdp", 0 ) ROM_LOAD( "eagle_1.a1", 0x000000, 0x40000, CRC(11cef2c4) SHA1(fcd46bfa123cd91053f8d49892778e02a275ffdd) ) ROM_LOAD( "eagle_2.b1", 0x040000, 0x40000, CRC(177c444c) SHA1(5af0f6040ba121c90b3480ce636885cce535d3ea) ) ROM_LOAD( "eagle_3.d1", 0x080000, 0x40000, CRC(5b15b99f) SHA1(b99e2fa4cde7c8661d1a81ce5045f5df4f1de9f2) ) @@ -1275,28 +1250,30 @@ uint8_t pinkiri8_state::ronjan_prot_r() { static const char wing_str[6] = { 'W', 'I', 'N', 'G', '8', '9' }; - m_prot_read_index++; + uint8_t prot_read_index = m_prot_read_index + 1; + if (!machine().side_effects_disabled()) + m_prot_read_index++; - if(m_prot_read_index & 1) + if (BIT(prot_read_index, 0)) return 0xff; //value is discarded - return wing_str[(m_prot_read_index >> 1)-1]; + return wing_str[(prot_read_index >> 1)-1]; } void pinkiri8_state::ronjan_prot_w(uint8_t data) { - if(data == 0) + if (data == 0) { m_prot_index = 0; } else { - if(m_prot_index == 5) + if (m_prot_index == 5) return; m_prot_char[m_prot_index++] = data; - if(m_prot_char[0] == 'E' && m_prot_char[1] == 'R' && m_prot_char[2] == 'R' && m_prot_char[3] == 'O' && m_prot_char[4] == 'R') + if (m_prot_char[0] == 'E' && m_prot_char[1] == 'R' && m_prot_char[2] == 'R' && m_prot_char[3] == 'O' && m_prot_char[4] == 'R') m_prot_read_index = 0; } } @@ -1311,10 +1288,10 @@ uint8_t pinkiri8_state::ronjan_patched_prot_r() return 0; //value is read then discarded } -GAME( 1992, janshi, 0, pinkiri8, janshi, pinkiri8_state, empty_init, ROT0, "Eagle", "Janshi", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS | MACHINE_NOT_WORKING ) +GAME( 1992, janshi, 0, janshi, janshi, pinkiri8_state, empty_init, ROT0, "Eagle", "Janshi", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS | MACHINE_NOT_WORKING ) GAME( 1991, ronjan, ronjans, ronjan, ronjan, pinkiri8_state, empty_init, ROT0, "Wing Co., Ltd", "Ron Jan (set 1)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS | MACHINE_NOT_WORKING ) GAME( 1994, ronjana, ronjans, ronjan, ronjan, pinkiri8_state, empty_init, ROT0, "Wing Co., Ltd", "Ron Jan (set 2)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS | MACHINE_NOT_WORKING ) GAME( 1994, ronjans, 0, ronjan, ronjan, pinkiri8_state, empty_init, ROT0, "Wing Co., Ltd", "Ron Jan Super (set 1)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS | MACHINE_NOT_WORKING ) // 'SUPER' flashes in the middle of the screen GAME( 1994, ronjansa, ronjans, ronjan, ronjan, pinkiri8_state, empty_init, ROT0, "Wing Co., Ltd", "Ron Jan Super (set 2)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS | MACHINE_NOT_WORKING ) // possibly Super or not, needs internal ROM dump GAME( 1994, ronjansb, ronjans, ronjan, ronjan, pinkiri8_state, empty_init, ROT0, "Wing Co., Ltd", "Ron Jan Super (set 3)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS | MACHINE_NOT_WORKING ) // " -GAME( 1994, pinkiri8, 0, pinkiri8, pinkiri8, pinkiri8_state, empty_init, ROT0, "Alta", "Pinkiri 8", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS | MACHINE_NOT_WORKING ) +GAME( 1994, pinkiri8, 0, pinkiri8, pinkiri8, pinkiri8_state, empty_init, ROT0, "Alta", "Pinkiri 8", MACHINE_NO_SOUND | MACHINE_IMPERFECT_GRAPHICS | MACHINE_NOT_WORKING ) diff --git a/src/mame/yachiyo/mole.cpp b/src/mame/yachiyo/mole.cpp index c265466387b71..b332a5f2ab4cb 100644 --- a/src/mame/yachiyo/mole.cpp +++ b/src/mame/yachiyo/mole.cpp @@ -59,6 +59,8 @@ #include "speaker.h" #include "tilemap.h" +#include + namespace { @@ -68,10 +70,11 @@ class mole_state : public driver_device mole_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_gfxdecode(*this, "gfxdecode"), + m_tileram(*this, "tileram", 0x400*2, ENDIANNESS_LITTLE) { } - void mole(machine_config &config); + void mole(machine_config &config) ATTR_COLD; protected: virtual void video_start() override ATTR_COLD; @@ -80,21 +83,21 @@ class mole_state : public driver_device required_device m_maincpu; required_device m_gfxdecode; + memory_share_creator m_tileram; + /* video-related */ tilemap_t *m_bg_tilemap = nullptr; uint8_t m_tile_bank = 0; - /* memory */ - uint16_t m_tileram[0x400]; - - void mole_tileram_w(offs_t offset, uint8_t data); - void mole_tilebank_w(uint8_t data); - void mole_irqack_w(uint8_t data); - void mole_flipscreen_w(uint8_t data); - uint8_t mole_protection_r(offs_t offset); + void tileram_w(offs_t offset, uint8_t data); + void tilebank_w(uint8_t data); + void irqack_w(uint8_t data); + void flipscreen_w(uint8_t data); + uint8_t protection_r(offs_t offset); TILE_GET_INFO_MEMBER(get_bg_tile_info); - uint32_t screen_update_mole(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - void mole_map(address_map &map) ATTR_COLD; + uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + + void main_map(address_map &map) ATTR_COLD; }; @@ -106,42 +109,41 @@ class mole_state : public driver_device TILE_GET_INFO_MEMBER(mole_state::get_bg_tile_info) { - uint16_t code = m_tileram[tile_index]; + uint16_t const code = m_tileram[tile_index]; - tileinfo.set((code & 0x200) ? 1 : 0, code & 0x1ff, 0, 0); + tileinfo.set(BIT(code, 9), code & 0x1ff, 0, 0); } void mole_state::video_start() { - memset(m_tileram, 0, sizeof(m_tileram)); + std::fill_n(&m_tileram[0], m_tileram.length(), 0); m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(mole_state::get_bg_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 40, 25); - save_item(NAME(m_tileram)); save_item(NAME(m_tile_bank)); } -void mole_state::mole_tileram_w(offs_t offset, uint8_t data) +void mole_state::tileram_w(offs_t offset, uint8_t data) { m_tileram[offset] = data | (m_tile_bank << 8); m_bg_tilemap->mark_tile_dirty(offset); } -void mole_state::mole_tilebank_w(uint8_t data) +void mole_state::tilebank_w(uint8_t data) { m_tile_bank = data; } -void mole_state::mole_irqack_w(uint8_t data) +void mole_state::irqack_w(uint8_t data) { m_maincpu->set_input_line(0, CLEAR_LINE); } -void mole_state::mole_flipscreen_w(uint8_t data) +void mole_state::flipscreen_w(uint8_t data) { - flip_screen_set(data & 0x01); + flip_screen_set(BIT(data, 0)); } -uint32_t mole_state::screen_update_mole(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t mole_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); return 0; @@ -154,7 +156,7 @@ uint32_t mole_state::screen_update_mole(screen_device &screen, bitmap_ind16 &bit * *************************************/ -uint8_t mole_state::mole_protection_r(offs_t offset) +uint8_t mole_state::protection_r(offs_t offset) { /* Following are all known examples of Mole Attack ** code reading from the protection circuitry: @@ -209,23 +211,23 @@ uint8_t mole_state::mole_protection_r(offs_t offset) * *************************************/ -void mole_state::mole_map(address_map &map) +void mole_state::main_map(address_map &map) { map(0x0000, 0x03ff).ram(); - map(0x0800, 0x08ff).r(FUNC(mole_state::mole_protection_r)); + map(0x0800, 0x08ff).r(FUNC(mole_state::protection_r)); map(0x0800, 0x0800).nopw(); // ??? map(0x0820, 0x0820).nopw(); // ??? map(0x5000, 0x7fff).mirror(0x8000).rom(); - map(0x8000, 0x83ff).w(FUNC(mole_state::mole_tileram_w)).nopr(); - map(0x8400, 0x8400).w(FUNC(mole_state::mole_tilebank_w)); + map(0x8000, 0x83ff).w(FUNC(mole_state::tileram_w)).nopr(); + map(0x8400, 0x8400).w(FUNC(mole_state::tilebank_w)); map(0x8c00, 0x8c01).w("aysnd", FUNC(ay8910_device::data_address_w)); map(0x8c40, 0x8c40).nopw(); // ??? map(0x8c80, 0x8c80).nopw(); // ??? map(0x8c81, 0x8c81).nopw(); // ??? - map(0x8d00, 0x8d00).portr("DSW").w(FUNC(mole_state::mole_irqack_w)); + map(0x8d00, 0x8d00).portr("DSW").w(FUNC(mole_state::irqack_w)); map(0x8d40, 0x8d40).portr("IN0"); map(0x8d80, 0x8d80).portr("IN1"); - map(0x8dc0, 0x8dc0).portr("IN2").w(FUNC(mole_state::mole_flipscreen_w)); + map(0x8dc0, 0x8dc0).portr("IN2").w(FUNC(mole_state::flipscreen_w)); } @@ -307,8 +309,8 @@ static const gfx_layout tile_layout = static GFXDECODE_START( gfx_mole ) - GFXDECODE_ENTRY( "gfx1", 0x0000, tile_layout, 0x00, 1 ) - GFXDECODE_ENTRY( "gfx1", 0x3000, tile_layout, 0x00, 1 ) + GFXDECODE_ENTRY( "gfx", 0x0000, tile_layout, 0x00, 1 ) + GFXDECODE_ENTRY( "gfx", 0x3000, tile_layout, 0x00, 1 ) GFXDECODE_END @@ -321,8 +323,8 @@ GFXDECODE_END void mole_state::mole(machine_config &config) { /* basic machine hardware */ - M6502(config, m_maincpu, 2000000); // ??? - m_maincpu->set_addrmap(AS_PROGRAM, &mole_state::mole_map); + M6502(config, m_maincpu, 2'000'000); // ??? + m_maincpu->set_addrmap(AS_PROGRAM, &mole_state::main_map); m_maincpu->set_vblank_int("screen", FUNC(mole_state::irq0_line_assert)); /* video hardware */ @@ -331,7 +333,7 @@ void mole_state::mole(machine_config &config) screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500)); screen.set_size(40*8, 25*8); screen.set_visarea(0*8, 40*8-1, 0*8, 25*8-1); - screen.set_screen_update(FUNC(mole_state::screen_update_mole)); + screen.set_screen_update(FUNC(mole_state::screen_update)); screen.set_palette("palette"); GFXDECODE(config, m_gfxdecode, "palette", gfx_mole); @@ -356,7 +358,7 @@ ROM_START( mole ) // ALL ROMS ARE 2732 ROM_LOAD( "m2a.7h", 0x6000, 0x1000, CRC(f2a90642) SHA1(da6887725d70924fc4b9cca83172276976f5020c) ) ROM_LOAD( "m1a.8h", 0x7000, 0x1000, CRC(cff0119a) SHA1(48fc81b8c68e977680e7b8baf1193f0e7e0cd013) ) - ROM_REGION( 0x6000, "gfx1", 0 ) + ROM_REGION( 0x6000, "gfx", 0 ) ROM_LOAD( "mea.4a", 0x0000, 0x1000, CRC(49d89116) SHA1(aa4cde07e10624072e50ba5bd209acf93092cf78) ) ROM_LOAD( "mca.6a", 0x1000, 0x1000, CRC(04e90300) SHA1(c908a3a651e50428eedc2974160cdbf2ed946abc) ) ROM_LOAD( "maa.9a", 0x2000, 0x1000, CRC(6ce9442b) SHA1(c08bf0911f1dfd4a3f9452efcbb3fd3688c4bf8c) ) diff --git a/src/mame/zpa/iq151.cpp b/src/mame/zpa/iq151.cpp index 89b8b7d38fd24..e11fe53ed5c9b 100644 --- a/src/mame/zpa/iq151.cpp +++ b/src/mame/zpa/iq151.cpp @@ -81,7 +81,7 @@ class iq151_state : public driver_device , m_speaker(*this, "speaker") , m_cassette(*this, "cassette") , m_carts(*this, "slot%u", 1U) - , m_boot_bank(*this, "boot") + , m_boot_view(*this, "boot_view") , m_keyboard(*this, "X%X", 0U) { } @@ -113,8 +113,8 @@ class iq151_state : public driver_device required_device m_speaker; required_device m_cassette; required_device_array m_carts; - required_memory_bank m_boot_bank; - required_ioport_array<8> m_keyboard; + memory_view m_boot_view; + required_ioport_array<9> m_keyboard; uint8_t m_vblank_irq_state; uint8_t m_cassette_clk; @@ -159,7 +159,7 @@ uint8_t iq151_state::ppi_portc_r() else { // kb read - data = ioport("X8")->read(); + data = m_keyboard[8]->read(); } return (data & 0xf0) | (m_cassette_data & 0x0f); @@ -174,7 +174,10 @@ void iq151_state::ppi_portc_w(uint8_t data) void iq151_state::boot_bank_w(uint8_t data) { - m_boot_bank->set_entry(data & 1); + if (BIT(data, 0)) + m_boot_view.disable(); + else + m_boot_view.select(0); } @@ -219,9 +222,11 @@ void iq151_state::iq151_mem(address_map &map) map.unmap_value_high(); map(0x0000, 0xffff).rw(FUNC(iq151_state::cartslot_r), FUNC(iq151_state::cartslot_w)); - map(0x0000, 0x07ff).bankrw("boot"); - map(0x0800, 0x7fff).ram(); - map(0xf000, 0xffff).rom(); + map(0x0000, 0x7fff).ram(); + map(0x0000, 0x07ff).view(m_boot_view); + m_boot_view[0](0x0000, 0x07ff).rom().region("maincpu", 0x0800); + //m_boot_view[0](0x0000, 0x07ff).nopw(); // TODO: write ignored when boot ROM is selected? + map(0xf000, 0xffff).rom().region("maincpu", 0x0000); } void iq151_state::iq151_io(address_map &map) @@ -349,14 +354,11 @@ TIMER_DEVICE_CALLBACK_MEMBER(iq151_state::cassette_timer) void iq151_state::machine_start() { - uint8_t *RAM = memregion("maincpu")->base(); - m_boot_bank->configure_entry(0, RAM + 0xf800); - m_boot_bank->configure_entry(1, RAM + 0x0000); } void iq151_state::machine_reset() { - m_boot_bank->set_entry(0); + m_boot_view.select(0); m_vblank_irq_state = 0; } @@ -472,16 +474,16 @@ void iq151_state::iq151(machine_config &config) /* ROM definition */ ROM_START( iq151 ) - ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASE ) + ROM_REGION( 0x1000, "maincpu", ROMREGION_ERASE ) /* A number of bios versions here. The load address is shown for each */ ROM_SYSTEM_BIOS( 0, "orig", "Original" ) - ROMX_LOAD( "iq151_monitor_orig.rom", 0xf000, 0x1000, CRC(acd10268) SHA1(4d75c73f155ed4dc2ac51a9c22232f869cca95e2), ROM_BIOS(0)) + ROMX_LOAD( "iq151_monitor_orig.rom", 0x0000, 0x1000, CRC(acd10268) SHA1(4d75c73f155ed4dc2ac51a9c22232f869cca95e2), ROM_BIOS(0)) ROM_SYSTEM_BIOS( 1, "disasm", "Disassembler" ) - ROMX_LOAD( "iq151_monitor_disasm.rom", 0xf000, 0x1000, CRC(45c2174e) SHA1(703e3271a124c3ef9330ae399308afd903316ab9), ROM_BIOS(1)) + ROMX_LOAD( "iq151_monitor_disasm.rom", 0x0000, 0x1000, CRC(45c2174e) SHA1(703e3271a124c3ef9330ae399308afd903316ab9), ROM_BIOS(1)) ROM_SYSTEM_BIOS( 2, "cpm", "CPM" ) - ROMX_LOAD( "iq151_monitor_cpm.rom", 0xf000, 0x1000, CRC(26f57013) SHA1(4df396edc375dd2dd3c82c4d2affb4f5451066f1), ROM_BIOS(2)) + ROMX_LOAD( "iq151_monitor_cpm.rom", 0x0000, 0x1000, CRC(26f57013) SHA1(4df396edc375dd2dd3c82c4d2affb4f5451066f1), ROM_BIOS(2)) ROM_SYSTEM_BIOS( 3, "cpmold", "CPM (old)" ) - ROMX_LOAD( "iq151_monitor_cpm_old.rom", 0xf000, 0x1000, CRC(6743e1b7) SHA1(ae4f3b1ba2511a1f91c4e8afdfc0e5aeb0fb3a42), ROM_BIOS(3)) + ROMX_LOAD( "iq151_monitor_cpm_old.rom", 0x0000, 0x1000, CRC(6743e1b7) SHA1(ae4f3b1ba2511a1f91c4e8afdfc0e5aeb0fb3a42), ROM_BIOS(3)) ROM_END } // anonymous namespace diff --git a/src/mame/zvt/pp01.cpp b/src/mame/zvt/pp01.cpp index 2e66f7c0fddb7..2cee5b54e167a 100644 --- a/src/mame/zvt/pp01.cpp +++ b/src/mame/zvt/pp01.cpp @@ -32,29 +32,15 @@ Z - ? /* Address maps */ void pp01_state::mem_map(address_map &map) { - map(0x0000, 0x0fff).bankrw("bank0"); - map(0x1000, 0x1fff).bankrw("bank1"); - map(0x2000, 0x2fff).bankrw("bank2"); - map(0x3000, 0x3fff).bankrw("bank3"); - map(0x4000, 0x4fff).bankrw("bank4"); - map(0x5000, 0x5fff).bankrw("bank5"); - map(0x6000, 0x6fff).bankrw("bank6"); - map(0x7000, 0x7fff).bankrw("bank7"); - map(0x8000, 0x8fff).bankrw("bank8"); - map(0x9000, 0x9fff).bankrw("bank9"); - map(0xa000, 0xafff).bankrw("bank10"); - map(0xb000, 0xbfff).bankrw("bank11"); - map(0xc000, 0xcfff).bankrw("bank12"); - map(0xd000, 0xdfff).bankrw("bank13"); - map(0xe000, 0xefff).bankrw("bank14"); - map(0xf000, 0xffff).bankrw("bank15"); + for (int i = 0; i < 16; i++) + map(i << 12, (i << 12) | 0xfff).bankrw(m_bank[i]); } void pp01_state::io_map(address_map &map) { - map(0xc0, 0xc3).rw("ppi1", FUNC(i8255_device::read), FUNC(i8255_device::write)); // system - map(0xc4, 0xc7).rw("ppi2", FUNC(i8255_device::read), FUNC(i8255_device::write)); // user - map(0xc8, 0xc9).mirror(2).rw("uart", FUNC(i8251_device::read), FUNC(i8251_device::write)); + map(0xc0, 0xc3).rw(m_ppi[0], FUNC(i8255_device::read), FUNC(i8255_device::write)); // system + map(0xc4, 0xc7).rw(m_ppi[1], FUNC(i8255_device::read), FUNC(i8255_device::write)); // user + map(0xc8, 0xc9).mirror(2).rw(m_uart, FUNC(i8251_device::read), FUNC(i8251_device::write)); map(0xcc, 0xcf).w(FUNC(pp01_state::video_write_mode_w)); map(0xd0, 0xd3).rw(m_pit, FUNC(pit8253_device::read), FUNC(pit8253_device::write)); //map(0xd4, 0xd7). MH3214 interrupt controller @@ -195,7 +181,7 @@ void pp01_state::pp01(machine_config &config) screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500)); /* not accurate */ screen.set_size(256, 256); screen.set_visarea(0, 256-1, 0, 256-1); - screen.set_screen_update(FUNC(pp01_state::screen_update_pp01)); + screen.set_screen_update(FUNC(pp01_state::screen_update)); screen.set_palette("palette"); PALETTE(config, "palette", FUNC(pp01_state::pp01_palette), 8); @@ -214,15 +200,15 @@ void pp01_state::pp01(machine_config &config) m_pit->set_clk<2>(2000000); m_pit->out_handler<2>().set(FUNC(pp01_state::z2_w)); - I8255A(config, m_ppi1); - m_ppi1->in_pa_callback().set(FUNC(pp01_state::ppi1_porta_r)); - m_ppi1->out_pa_callback().set(FUNC(pp01_state::ppi1_porta_w)); - m_ppi1->in_pb_callback().set(FUNC(pp01_state::ppi1_portb_r)); - m_ppi1->out_pb_callback().set(FUNC(pp01_state::ppi1_portb_w)); - m_ppi1->in_pc_callback().set(FUNC(pp01_state::ppi1_portc_r)); - m_ppi1->out_pc_callback().set(FUNC(pp01_state::ppi1_portc_w)); + I8255A(config, m_ppi[0]); + m_ppi[0]->in_pa_callback().set(FUNC(pp01_state::ppi1_porta_r)); + m_ppi[0]->out_pa_callback().set(FUNC(pp01_state::ppi1_porta_w)); + m_ppi[0]->in_pb_callback().set(FUNC(pp01_state::ppi1_portb_r)); + m_ppi[0]->out_pb_callback().set(FUNC(pp01_state::ppi1_portb_w)); + m_ppi[0]->in_pc_callback().set(FUNC(pp01_state::ppi1_portc_r)); + m_ppi[0]->out_pc_callback().set(FUNC(pp01_state::ppi1_portc_w)); - I8255A(config, m_ppi2); + I8255A(config, m_ppi[1]); /* internal ram */ RAM(config, RAM_TAG).set_default_size("64K").set_default_value(0x00); diff --git a/src/mame/zvt/pp01.h b/src/mame/zvt/pp01.h index e2738eb4bf207..c57e4514ea685 100644 --- a/src/mame/zvt/pp01.h +++ b/src/mame/zvt/pp01.h @@ -28,12 +28,12 @@ class pp01_state : public driver_device : driver_device(mconfig, type, tag) , m_maincpu(*this, "maincpu") , m_pit(*this, "pit") - , m_ppi1(*this, "ppi1") - , m_ppi2(*this, "ppi2") + , m_ppi(*this, "ppi%u", 1U) , m_speaker(*this, "speaker") , m_ram(*this, RAM_TAG) , m_uart(*this, "uart") , m_cass(*this, "cassette") + , m_mainrom(*this, "maincpu") , m_bank(*this, "bank%d", 0U) , m_io_keyboard(*this, "LINE%d", 0U) { } @@ -41,50 +41,53 @@ class pp01_state : public driver_device void pp01(machine_config &config); protected: + virtual void device_post_load() override ATTR_COLD; virtual void machine_start() override ATTR_COLD; virtual void machine_reset() override ATTR_COLD; private: - uint8_t m_video_scroll = 0; - uint8_t m_memory_block[16]{}; - uint8_t m_video_write_mode = 0; - uint8_t m_key_line = 0; - bool m_txe = false, m_txd = false, m_rts = false, m_casspol = false; - u8 m_cass_data[4]{}; - - void video_write_mode_w(uint8_t data); - void video_r_1_w(offs_t offset, uint8_t data); - void video_g_1_w(offs_t offset, uint8_t data); - void video_b_1_w(offs_t offset, uint8_t data); - void video_r_2_w(offs_t offset, uint8_t data); - void video_g_2_w(offs_t offset, uint8_t data); - void video_b_2_w(offs_t offset, uint8_t data); - void mem_block_w(offs_t offset, uint8_t data); - uint8_t mem_block_r(offs_t offset); + void video_write_mode_w(u8 data); + void video_r_1_w(offs_t offset, u8 data); + void video_g_1_w(offs_t offset, u8 data); + void video_b_1_w(offs_t offset, u8 data); + void video_r_2_w(offs_t offset, u8 data); + void video_g_2_w(offs_t offset, u8 data); + void video_b_2_w(offs_t offset, u8 data); + void mem_block_w(offs_t offset, u8 data); + u8 mem_block_r(offs_t offset); TIMER_DEVICE_CALLBACK_MEMBER(kansas_r); void pp01_palette(palette_device &palette) const; - uint32_t screen_update_pp01(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + u32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void z2_w(int state); - uint8_t ppi1_porta_r(); - void ppi1_porta_w(uint8_t data); - uint8_t ppi1_portb_r(); - void ppi1_portb_w(uint8_t data); - void ppi1_portc_w(uint8_t data); - uint8_t ppi1_portc_r(); - void video_w(uint8_t block,uint16_t offset,uint8_t data,uint8_t part); - void set_memory(uint8_t block, uint8_t data); + u8 ppi1_porta_r(); + void ppi1_porta_w(u8 data); + u8 ppi1_portb_r(); + void ppi1_portb_w(u8 data); + void ppi1_portc_w(u8 data); + u8 ppi1_portc_r(); + void video_w(u8 block, uint16_t offset, u8 data, bool part); + void set_memory(u8 block, u8 data); void io_map(address_map &map) ATTR_COLD; void mem_map(address_map &map) ATTR_COLD; + u8 m_video_scroll = 0; + u8 m_memory_block[16]{}; + u8 m_video_write_mode = 0; + u8 m_key_line = 0; + bool m_txe = false, m_txd = false, m_rts = false, m_casspol = false; + u8 m_cass_data[4]{}; + required_device m_maincpu; required_device m_pit; - required_device m_ppi1; - required_device m_ppi2; + required_device_array m_ppi; required_device m_speaker; required_device m_ram; required_device m_uart; required_device m_cass; + + required_region_ptr m_mainrom; required_memory_bank_array<16> m_bank; + required_ioport_array<17> m_io_keyboard; }; diff --git a/src/mame/zvt/pp01_m.cpp b/src/mame/zvt/pp01_m.cpp index 7df4f3fdcea51..3b924bb2eead5 100644 --- a/src/mame/zvt/pp01_m.cpp +++ b/src/mame/zvt/pp01_m.cpp @@ -13,89 +13,74 @@ #include "pp01.h" -void pp01_state::video_write_mode_w(uint8_t data) +void pp01_state::video_write_mode_w(u8 data) { m_video_write_mode = data & 0x0f; } -void pp01_state::video_w(uint8_t block,uint16_t offset,uint8_t data,uint8_t part) +void pp01_state::video_w(u8 block, u16 offset, u8 data, bool part) { - uint16_t addroffset = part ? 0x1000 : 0x0000; - uint8_t *ram = m_ram->pointer(); + u16 const rgb_offset[3] = { 0x6000, 0xa000, 0xe000 }; + offset += part ? 0x1000 : 0x0000; + u8 *const ram = m_ram->pointer(); - if (BIT(m_video_write_mode,3)) + if (BIT(m_video_write_mode, 3)) { // Copy mode - if(BIT(m_video_write_mode,0)) - ram[0x6000+offset+addroffset] = data; - else - ram[0x6000+offset+addroffset] = 0; - - if(BIT(m_video_write_mode,1)) - ram[0xa000+offset+addroffset] = data; - else - ram[0xa000+offset+addroffset] = 0; - - if(BIT(m_video_write_mode,2)) - ram[0xe000+offset+addroffset] = data; - else - ram[0xe000+offset+addroffset] = 0; - + for (int i = 0; i < 3; i++) + { + if (BIT(m_video_write_mode, i)) + ram[rgb_offset[i] + offset] = data; + else + ram[rgb_offset[i] + offset] = 0; + } } else { - if (block==0) - ram[0x6000+offset+addroffset] = data; - else - if (block==1) - ram[0xa000+offset+addroffset] = data; - else - if (block==2) - ram[0xe000+offset+addroffset] = data; + ram[rgb_offset[block] + offset] = data; } } -void pp01_state::video_r_1_w(offs_t offset, uint8_t data) +void pp01_state::video_r_1_w(offs_t offset, u8 data) { - video_w(0,offset,data,0); + video_w(0, offset, data, false); } -void pp01_state::video_g_1_w(offs_t offset, uint8_t data) +void pp01_state::video_g_1_w(offs_t offset, u8 data) { - video_w(1,offset,data,0); + video_w(1, offset, data, false); } -void pp01_state::video_b_1_w(offs_t offset, uint8_t data) +void pp01_state::video_b_1_w(offs_t offset, u8 data) { - video_w(2,offset,data,0); + video_w(2, offset, data, false); } -void pp01_state::video_r_2_w(offs_t offset, uint8_t data) +void pp01_state::video_r_2_w(offs_t offset, u8 data) { - video_w(0,offset,data,1); + video_w(0, offset, data, true); } -void pp01_state::video_g_2_w(offs_t offset, uint8_t data) +void pp01_state::video_g_2_w(offs_t offset, u8 data) { - video_w(1,offset,data,1); + video_w(1, offset, data, true); } -void pp01_state::video_b_2_w(offs_t offset, uint8_t data) +void pp01_state::video_b_2_w(offs_t offset, u8 data) { - video_w(2,offset,data,1); + video_w(2, offset, data, true); } -void pp01_state::set_memory(uint8_t block, uint8_t data) +void pp01_state::set_memory(u8 block, u8 data) { - uint8_t *mem = memregion("maincpu")->base(); address_space &space = m_maincpu->space(AS_PROGRAM); - uint16_t startaddr = block*0x1000; - uint16_t endaddr = startaddr+0xfff; + u16 const startaddr = block * 0x1000; + u16 const endaddr = startaddr + 0xfff; - if (data>=0xE0 && data<=0xEF) + if (data >= 0xe0 && data <= 0xef) { // This is RAM - space.install_read_bank (startaddr, endaddr, m_bank[block]); - switch(data) + space.install_read_bank(startaddr, endaddr, m_bank[block]); + switch (data) { - case 0xe6 : + case 0xe6: space.install_write_handler(startaddr, endaddr, write8sm_delegate(*this, FUNC(pp01_state::video_r_1_w))); break; case 0xe7: @@ -117,46 +102,40 @@ void pp01_state::set_memory(uint8_t block, uint8_t data) space.install_write_bank(startaddr, endaddr, m_bank[block]); break; } - - m_bank[block]->set_base(m_ram->pointer() + (data & 0x0F)* 0x1000); + m_bank[block]->set_base(m_ram->pointer() + (data & 0x0f) * 0x1000); } - else - if (data>=0xFC) + else if (data >= 0xfc) { - space.install_read_bank (startaddr, endaddr, m_bank[block]); + space.install_read_bank(startaddr, endaddr, m_bank[block]); space.unmap_write(startaddr, endaddr); - m_bank[block]->set_base(mem + (data & 0x03)* 0x1000); + m_bank[block]->set_base(&m_mainrom[(data & 0x03) * 0x1000]); } else { - logerror("%02x %02x\n",block,data); - space.unmap_readwrite (startaddr, endaddr); - } -} - -void pp01_state::machine_reset() -{ - int i; - memset(m_memory_block,0xff,16); - for(i=0;i<16;i++) - { - m_memory_block[i] = 0xff; - set_memory(i, 0xff); + logerror("set_memory %02x = %02x\n", block, data); + space.unmap_readwrite(startaddr, endaddr); } - m_uart->write_cts(0); } -void pp01_state::mem_block_w(offs_t offset, uint8_t data) +void pp01_state::mem_block_w(offs_t offset, u8 data) { m_memory_block[offset] = data; set_memory(offset, data); } -uint8_t pp01_state::mem_block_r(offs_t offset) +u8 pp01_state::mem_block_r(offs_t offset) { return m_memory_block[offset]; } +void pp01_state::device_post_load() +{ + for (int i = 0; i < 16; i++) + { + set_memory(i, m_memory_block[i]); + } +} + void pp01_state::machine_start() { save_item(NAME(m_video_scroll)); @@ -170,7 +149,17 @@ void pp01_state::machine_start() save_item(NAME(m_cass_data)); } -TIMER_DEVICE_CALLBACK_MEMBER( pp01_state::kansas_r ) +void pp01_state::machine_reset() +{ + for (int i = 0; i < 16; i++) + { + m_memory_block[i] = 0xff; + set_memory(i, 0xff); + } + m_uart->write_cts(0); +} + +TIMER_DEVICE_CALLBACK_MEMBER(pp01_state::kansas_r) { if (m_rts) { @@ -182,7 +171,7 @@ TIMER_DEVICE_CALLBACK_MEMBER( pp01_state::kansas_r ) m_cass_data[1]++; m_cass_data[2]++; - uint8_t cass_ws = (m_cass->input() > +0.04) ? 1 : 0; + u8 const cass_ws = (m_cass->input() > +0.04) ? 1 : 0; if (cass_ws != m_cass_data[0]) { @@ -193,7 +182,7 @@ TIMER_DEVICE_CALLBACK_MEMBER( pp01_state::kansas_r ) m_cass_data[2] = 0; m_uart->write_rxd(m_casspol); } - if ((m_cass_data[2] & 7)==2) + if ((m_cass_data[2] & 7) == 2) { m_cass_data[3]++; m_uart->write_rxc(BIT(m_cass_data[3], 0)); @@ -208,26 +197,26 @@ void pp01_state::z2_w(int state) m_cass->output((m_txd ^ state) ? -1.0 : 1.0); } -uint8_t pp01_state::ppi1_porta_r() +u8 pp01_state::ppi1_porta_r() { return m_video_scroll; } -void pp01_state::ppi1_porta_w(uint8_t data) +void pp01_state::ppi1_porta_w(u8 data) { m_video_scroll = data; } -uint8_t pp01_state::ppi1_portb_r() +u8 pp01_state::ppi1_portb_r() { return m_io_keyboard[m_key_line]->read() | m_io_keyboard[16]->read(); } -void pp01_state::ppi1_portb_w(uint8_t data) +void pp01_state::ppi1_portb_w(u8 data) { - //logerror("pp01_8255_portb_w %02x\n",data); + //logerror("pp01_8255_portb_w %02x\n", data); } -void pp01_state::ppi1_portc_w(uint8_t data) +void pp01_state::ppi1_portc_w(u8 data) { if (BIT(data, 4)) m_key_line = data & 0x0f; @@ -235,7 +224,7 @@ void pp01_state::ppi1_portc_w(uint8_t data) m_speaker->level_w(BIT(data, 0)); } -uint8_t pp01_state::ppi1_portc_r() +u8 pp01_state::ppi1_portc_r() { return 0xff; } diff --git a/src/mame/zvt/pp01_v.cpp b/src/mame/zvt/pp01_v.cpp index 4055f67bac5f0..e57a825e5d3d6 100644 --- a/src/mame/zvt/pp01_v.cpp +++ b/src/mame/zvt/pp01_v.cpp @@ -12,22 +12,22 @@ #include "emu.h" #include "pp01.h" -uint32_t pp01_state::screen_update_pp01(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +u32 pp01_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - uint8_t const *const ram = m_ram->pointer(); + u8 const *const ram = m_ram->pointer(); - for (int y = 0; y < 256; y++) + for (int y = cliprect.top(); y <= cliprect.bottom(); y++) { - for (int x = 0; x < 32; x++) + for (int x = cliprect.left() & ~7; x <= cliprect.right(); x += 8) { - u16 t = ((y+m_video_scroll)&0xff)*32 + x; - uint8_t const code_r = ram[0x6000 + t]; - uint8_t const code_g = ram[0xa000 + t]; - uint8_t const code_b = ram[0xe000 + t]; + u16 const t = ((y + m_video_scroll) & 0xff) * 32 + (x >> 3); + u8 const code_r = ram[0x6000 + t]; + u8 const code_g = ram[0xa000 + t]; + u8 const code_b = ram[0xe000 + t]; for (int b = 0; b < 8; b++) { - uint8_t const col = (BIT(code_r, b) << 2) | (BIT(code_g, b) << 1) | (BIT(code_b, b) << 0); - bitmap.pix(y, x*8+(7-b)) = col; + u8 const col = (BIT(code_r, b) << 2) | (BIT(code_g, b) << 1) | (BIT(code_b, b) << 0); + bitmap.pix(y, x + (7 - b)) = col; } } } diff --git a/src/osd/modules/debugger/debugwin.cpp b/src/osd/modules/debugger/debugwin.cpp index 6498a95fcd3ac..8ff26d40fb346 100644 --- a/src/osd/modules/debugger/debugwin.cpp +++ b/src/osd/modules/debugger/debugwin.cpp @@ -56,7 +56,9 @@ class debugger_windows : m_main_console(nullptr), m_next_window_pos{ 0, 0 }, m_config(), - m_save_windows(true) + m_save_windows(true), + m_group_windows(true), + m_group_windows_setting(true) { } @@ -76,6 +78,9 @@ class debugger_windows : virtual void set_color_theme(int index) override; virtual bool get_save_window_arrangement() const override { return m_save_windows; } virtual void set_save_window_arrangement(bool save) override { m_save_windows = save; } + virtual bool get_group_windows() const override { return m_group_windows; } + virtual bool get_group_windows_setting() const override { return m_group_windows_setting; } + virtual void set_group_windows_setting(bool group) override { m_group_windows_setting = group; } virtual bool const &waiting_for_debugger() const override { return m_waiting_for_debugger; } virtual bool seq_pressed() const override; @@ -111,6 +116,8 @@ class debugger_windows : util::xml::file::ptr m_config; bool m_save_windows; + bool m_group_windows; + bool m_group_windows_setting; }; @@ -395,6 +402,7 @@ void debugger_windows::config_load(config_type cfgtype, config_level cfglevel, u if (config_type::DEFAULT == cfgtype) { m_save_windows = 0 != parentnode->get_attribute_int(debugger::ATTR_DEBUGGER_SAVE_WINDOWS, m_save_windows ? 1 : 0); + m_group_windows = m_group_windows_setting = 0 != parentnode->get_attribute_int(debugger::ATTR_DEBUGGER_GROUP_WINDOWS, m_group_windows ? 1 : 0); util::xml::data_node const *const colors = parentnode->get_child(debugger::NODE_COLORS); if (colors) m_metrics->set_color_theme(colors->get_attribute_int(debugger::ATTR_COLORS_THEME, m_metrics->get_color_theme())); @@ -421,6 +429,7 @@ void debugger_windows::config_save(config_type cfgtype, util::xml::data_node *pa if (config_type::DEFAULT == cfgtype) { parentnode->set_attribute_int(debugger::ATTR_DEBUGGER_SAVE_WINDOWS, m_save_windows ? 1 : 0); + parentnode->set_attribute_int(debugger::ATTR_DEBUGGER_GROUP_WINDOWS, m_group_windows_setting ? 1 : 0); util::xml::data_node *const colors = parentnode->add_child(debugger::NODE_COLORS, nullptr); if (colors) colors->set_attribute_int(debugger::ATTR_COLORS_THEME, m_metrics->get_color_theme()); diff --git a/src/osd/modules/debugger/win/consolewininfo.cpp b/src/osd/modules/debugger/win/consolewininfo.cpp index 3a4a52be2e236..a5dfd04cc5558 100644 --- a/src/osd/modules/debugger/win/consolewininfo.cpp +++ b/src/osd/modules/debugger/win/consolewininfo.cpp @@ -245,6 +245,7 @@ consolewin_info::consolewin_info(debugger_windows_interface &debugger) : // add the settings menu HMENU const settingsmenu = CreatePopupMenu(); AppendMenu(settingsmenu, MF_ENABLED, ID_SAVE_WINDOWS, TEXT("Save Window Arrangement")); + AppendMenu(settingsmenu, MF_ENABLED, ID_GROUP_WINDOWS, TEXT("Group Debugger Windows (requires restart)")); AppendMenu(settingsmenu, MF_DISABLED | MF_SEPARATOR, 0, TEXT("")); AppendMenu(settingsmenu, MF_ENABLED, ID_LIGHT_BACKGROUND, TEXT("Light Background")); AppendMenu(settingsmenu, MF_ENABLED, ID_DARK_BACKGROUND, TEXT("Dark Background")); @@ -449,6 +450,7 @@ void consolewin_info::update_menu() HMENU const menu = GetMenu(window()); CheckMenuItem(menu, ID_SAVE_WINDOWS, MF_BYCOMMAND | (debugger().get_save_window_arrangement() ? MF_CHECKED : MF_UNCHECKED)); + CheckMenuItem(menu, ID_GROUP_WINDOWS, MF_BYCOMMAND | (debugger().get_group_windows_setting() ? MF_CHECKED : MF_UNCHECKED)); CheckMenuItem(menu, ID_LIGHT_BACKGROUND, MF_BYCOMMAND | ((ui_metrics::THEME_LIGHT_BACKGROUND == metrics().get_color_theme()) ? MF_CHECKED : MF_UNCHECKED)); CheckMenuItem(menu, ID_DARK_BACKGROUND, MF_BYCOMMAND | ((ui_metrics::THEME_DARK_BACKGROUND == metrics().get_color_theme()) ? MF_CHECKED : MF_UNCHECKED)); } @@ -518,6 +520,9 @@ bool consolewin_info::handle_command(WPARAM wparam, LPARAM lparam) case ID_SAVE_WINDOWS: debugger().set_save_window_arrangement(!debugger().get_save_window_arrangement()); return true; + case ID_GROUP_WINDOWS: + debugger().set_group_windows_setting(!debugger().get_group_windows_setting()); + return true; case ID_LIGHT_BACKGROUND: debugger().set_color_theme(ui_metrics::THEME_LIGHT_BACKGROUND); return true; diff --git a/src/osd/modules/debugger/win/debugwin.h b/src/osd/modules/debugger/win/debugwin.h index 52303eefc2c77..d8af29b795eb6 100644 --- a/src/osd/modules/debugger/win/debugwin.h +++ b/src/osd/modules/debugger/win/debugwin.h @@ -40,6 +40,9 @@ class debugger_windows_interface virtual void set_color_theme(int index) = 0; virtual bool get_save_window_arrangement() const = 0; virtual void set_save_window_arrangement(bool save) = 0; + virtual bool get_group_windows() const = 0; + virtual bool get_group_windows_setting() const = 0; + virtual void set_group_windows_setting(bool group) = 0; virtual bool const &waiting_for_debugger() const = 0; virtual bool seq_pressed() const = 0; diff --git a/src/osd/modules/debugger/win/debugwininfo.cpp b/src/osd/modules/debugger/win/debugwininfo.cpp index e48c012dba6d6..f27f7933f082f 100644 --- a/src/osd/modules/debugger/win/debugwininfo.cpp +++ b/src/osd/modules/debugger/win/debugwininfo.cpp @@ -47,7 +47,9 @@ debugwin_info::debugwin_info(debugger_windows_interface &debugger, bool is_main_ m_wnd = win_create_window_ex_utf8( DEBUG_WINDOW_STYLE_EX, "MAMEDebugWindow", title, DEBUG_WINDOW_STYLE, 0, 0, 100, 100, - dynamic_cast(*osd_common_t::window_list().front()).platform_window(), + debugger.get_group_windows() + ? dynamic_cast(*osd_common_t::window_list().front()).platform_window() + : nullptr, create_standard_menubar(), GetModuleHandleUni(), this); diff --git a/src/osd/modules/debugger/win/debugwininfo.h b/src/osd/modules/debugger/win/debugwininfo.h index f6f37c86955d9..e766ca69c12bc 100644 --- a/src/osd/modules/debugger/win/debugwininfo.h +++ b/src/osd/modules/debugger/win/debugwininfo.h @@ -114,6 +114,7 @@ class debugwin_info : protected debugbase_info ID_CLEAR_LOG, ID_SAVE_WINDOWS, + ID_GROUP_WINDOWS, ID_LIGHT_BACKGROUND, ID_DARK_BACKGROUND, diff --git a/src/osd/modules/debugger/xmlconfig.cpp b/src/osd/modules/debugger/xmlconfig.cpp index 7e702938bf839..977e7b55e700c 100644 --- a/src/osd/modules/debugger/xmlconfig.cpp +++ b/src/osd/modules/debugger/xmlconfig.cpp @@ -17,6 +17,7 @@ char const *const NODE_WINDOW_HISTORY = "history"; char const *const NODE_HISTORY_ITEM = "item"; char const *const ATTR_DEBUGGER_SAVE_WINDOWS = "savewindows"; +char const *const ATTR_DEBUGGER_GROUP_WINDOWS = "groupwindows"; char const *const ATTR_WINDOW_TYPE = "type"; char const *const ATTR_WINDOW_POSITION_X = "position_x"; diff --git a/src/osd/modules/debugger/xmlconfig.h b/src/osd/modules/debugger/xmlconfig.h index ae5cdf8393c3b..6ae476cdec74c 100644 --- a/src/osd/modules/debugger/xmlconfig.h +++ b/src/osd/modules/debugger/xmlconfig.h @@ -33,6 +33,7 @@ extern char const *const NODE_WINDOW_HISTORY; extern char const *const NODE_HISTORY_ITEM; extern char const *const ATTR_DEBUGGER_SAVE_WINDOWS; +extern char const *const ATTR_DEBUGGER_GROUP_WINDOWS; extern char const *const ATTR_WINDOW_TYPE; extern char const *const ATTR_WINDOW_POSITION_X; diff --git a/src/osd/modules/file/posixfile.cpp b/src/osd/modules/file/posixfile.cpp index c5ce8bf7b4e45..8aebde2adc2d3 100644 --- a/src/osd/modules/file/posixfile.cpp +++ b/src/osd/modules/file/posixfile.cpp @@ -380,13 +380,17 @@ std::unique_ptr osd_stat(const std::string &path) // create an osd_directory_entry; be sure to make sure that the caller can // free all resources by just freeing the resulting osd_directory_entry - osd::directory::entry *result; - try { result = reinterpret_cast(::operator new(sizeof(*result) + path.length() + 1)); } - catch (...) { return nullptr; } + auto const result = reinterpret_cast( + ::operator new( + sizeof(osd::directory::entry) + path.length() + 1, + std::align_val_t(alignof(osd::directory::entry)), + std::nothrow)); + if (!result) return nullptr; new (result) osd::directory::entry; - std::strcpy(reinterpret_cast(result) + sizeof(*result), path.c_str()); - result->name = reinterpret_cast(result) + sizeof(*result); + auto const resultname = reinterpret_cast(result) + sizeof(*result); + std::strcpy(resultname, path.c_str()); + result->name = resultname; result->type = S_ISDIR(st.st_mode) ? osd::directory::entry::entry_type::DIR : osd::directory::entry::entry_type::FILE; result->size = std::uint64_t(std::make_unsigned_t(st.st_size)); result->last_modified = std::chrono::system_clock::from_time_t(st.st_mtime); diff --git a/src/osd/windows/winmain.cpp b/src/osd/windows/winmain.cpp index 008c81fe54ba0..2f7df659f4494 100644 --- a/src/osd/windows/winmain.cpp +++ b/src/osd/windows/winmain.cpp @@ -352,12 +352,6 @@ void windows_osd_interface::init(running_machine &machine) // initialize the subsystems osd_common_t::init_subsystems(); - // notify listeners of screen configuration - for (const auto &info : osd_common_t::window_list()) - { - machine.output().set_value(string_format("Orientation(%s)", info->monitor()->devicename()), dynamic_cast(*info).m_targetorient); - } - // hook up the debugger log if (options.oslog()) machine.add_logerror_callback(&windows_osd_interface::output_oslog); diff --git a/src/tools/unidasm.cpp b/src/tools/unidasm.cpp index 1d7e9fc693281..ecc7140368551 100644 --- a/src/tools/unidasm.cpp +++ b/src/tools/unidasm.cpp @@ -30,6 +30,7 @@ using util::BIT; #include "cpu/c33/c33dasm.h" #include "cpu/capricorn/capricorn_dasm.h" #include "cpu/ccpu/ccpudasm.h" +#include "cpu/cdc160/cdc160d.h" #include "cpu/cdc1700/cdc1700d.h" #include "cpu/clipper/clipperd.h" #include "cpu/cop400/cop410ds.h" @@ -423,6 +424,8 @@ static const dasm_table_entry dasm_table[] = { "c33", le, 0, []() -> util::disasm_interface * { return new c33_disassembler; } }, { "capricorn", le, 0, []() -> util::disasm_interface * { return new capricorn_disassembler; } }, { "ccpu", le, 0, []() -> util::disasm_interface * { return new ccpu_disassembler; } }, + { "cdc160", be, -1, []() -> util::disasm_interface * { return new cdc160_disassembler; } }, + { "cdc160a", be, -1, []() -> util::disasm_interface * { return new cdc160a_disassembler; } }, { "cdc1700", be, -1, []() -> util::disasm_interface * { return new cdc1700_disassembler; } }, { "cdp1801", le, 0, []() -> util::disasm_interface * { return new cosmac_disassembler(cosmac_disassembler::TYPE_1801); } }, { "cdp1802", le, 0, []() -> util::disasm_interface * { return new cosmac_disassembler(cosmac_disassembler::TYPE_1802); } },