diff --git a/.github/workflows/includeguards.yml b/.github/workflows/includeguards.yml new file mode 100644 index 00000000000..e2e9c897ce9 --- /dev/null +++ b/.github/workflows/includeguards.yml @@ -0,0 +1,25 @@ +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/bgfx/src/shader_spirv.cpp b/3rdparty/bgfx/src/shader_spirv.cpp index 739256546be..2143641a0c4 100644 --- a/3rdparty/bgfx/src/shader_spirv.cpp +++ b/3rdparty/bgfx/src/shader_spirv.cpp @@ -17,7 +17,7 @@ namespace bgfx #define SPV_OPERAND_7(_a0, _a1, _a2, _a3, _a4, _a5, _a6) SPV_OPERAND_1(_a0), SPV_OPERAND_6(_a1, _a2, _a3, _a4, _a5, _a6) #define SPV_OPERAND_8(_a0, _a1, _a2, _a3, _a4, _a5, _a6, _a7) SPV_OPERAND_1(_a0), SPV_OPERAND_7(_a1, _a2, _a3, _a4, _a5, _a6, _a7) #define SPV_OPERAND_9(_a0, _a1, _a2, _a3, _a4, _a5, _a6, _a7, _a8) SPV_OPERAND_1(_a0), SPV_OPERAND_8(_a1, _a2, _a3, _a4, _a5, _a6, _a7, _a8) -#if BX_COMPILER_MSVC +#if BX_COMPILER_MSVC && (!defined(_MSVC_TRADITIONAL) || _MSVC_TRADITIONAL) // Workaround MSVS bug... # define SPV_OPERAND(...) { BX_MACRO_DISPATCHER(SPV_OPERAND_, __VA_ARGS__) BX_VA_ARGS_PASS(__VA_ARGS__) } #else diff --git a/3rdparty/bx/include/bx/macros.h b/3rdparty/bx/include/bx/macros.h index dab1ba7013a..61401af8650 100644 --- a/3rdparty/bx/include/bx/macros.h +++ b/3rdparty/bx/include/bx/macros.h @@ -11,7 +11,7 @@ #define BX_MACROS_H_HEADER_GUARD /// -#if BX_COMPILER_MSVC +#if BX_COMPILER_MSVC && (!defined(_MSVC_TRADITIONAL) || _MSVC_TRADITIONAL) // Workaround MSVS bug... # define BX_VA_ARGS_PASS(...) BX_VA_ARGS_PASS_1_ __VA_ARGS__ BX_VA_ARGS_PASS_2_ # define BX_VA_ARGS_PASS_1_ ( @@ -145,7 +145,7 @@ #define BX_UNUSED_11(_a1, _a2, _a3, _a4, _a5, _a6, _a7, _a8, _a9, _a10, _a11) BX_UNUSED_10(_a1, _a2, _a3, _a4, _a5, _a6, _a7, _a8, _a9, _a10); BX_UNUSED_1(_a11) #define BX_UNUSED_12(_a1, _a2, _a3, _a4, _a5, _a6, _a7, _a8, _a9, _a10, _a11, _a12) BX_UNUSED_11(_a1, _a2, _a3, _a4, _a5, _a6, _a7, _a8, _a9, _a10, _a11); BX_UNUSED_1(_a12) -#if BX_COMPILER_MSVC +#if BX_COMPILER_MSVC && (!defined(_MSVC_TRADITIONAL) || _MSVC_TRADITIONAL) // Workaround MSVS bug... # define BX_UNUSED(...) BX_MACRO_DISPATCHER(BX_UNUSED_, __VA_ARGS__) BX_VA_ARGS_PASS(__VA_ARGS__) #else @@ -226,7 +226,7 @@ #define BX_CLASS_3(_class, _a1, _a2, _a3) BX_CLASS_2(_class, _a1, _a2); BX_CLASS_1(_class, _a3) #define BX_CLASS_4(_class, _a1, _a2, _a3, _a4) BX_CLASS_3(_class, _a1, _a2, _a3); BX_CLASS_1(_class, _a4) -#if BX_COMPILER_MSVC +#if BX_COMPILER_MSVC && (!defined(_MSVC_TRADITIONAL) || _MSVC_TRADITIONAL) # define BX_CLASS(_class, ...) BX_MACRO_DISPATCHER(BX_CLASS_, __VA_ARGS__) BX_VA_ARGS_PASS(_class, __VA_ARGS__) #else # define BX_CLASS(_class, ...) BX_MACRO_DISPATCHER(BX_CLASS_, __VA_ARGS__)(_class, __VA_ARGS__) diff --git a/3rdparty/genie/.travis.yml b/3rdparty/genie/.travis.yml deleted file mode 100644 index 077f5882e3e..00000000000 --- a/3rdparty/genie/.travis.yml +++ /dev/null @@ -1,20 +0,0 @@ -language: cpp -matrix: - include: - - compiler: gcc - os: linux - - compiler: clang - os: osx - -script: - make - -branches: - only: - - master - -notifications: - email: false - -osx_image: - xcode61 diff --git a/3rdparty/genie/README.md b/3rdparty/genie/README.md index 526705e68d3..159ef98c931 100644 --- a/3rdparty/genie/README.md +++ b/3rdparty/genie/README.md @@ -1,6 +1,12 @@ +

+ +

+ [GENie](https://github.com/bkaradzic/genie#what-is-it) - Project generator tool =============================================================================== +[![Build and Upload Artifact](https://github.com/bkaradzic/GENie/actions/workflows/build.yml/badge.svg?branch=master)](https://github.com/bkaradzic/GENie/actions/workflows/build.yml) + What is it? ----------- @@ -9,19 +15,16 @@ generates project from Lua script, making applying the same settings for multiple projects easy. Supported project generators: - * FASTBuild (experimental) * GNU Makefile + * [JSON Compilation Database][jcdb] * Ninja (experimental) - * Qbs / QtCreator (experimental) - * Visual Studio 2010, 2012, 2013, 2015, 2017, 2019 + * Visual Studio 2010, 2012, 2013, 2015, 2017, 2019, 2022 * XCode Download (stable) ----------------- -[![Build Status](https://travis-ci.org/bkaradzic/GENie.svg?branch=master)](https://travis-ci.org/bkaradzic/GENie) - - version 1115 (commit cd9b1a624810b166d11788d01c2aa4daf2ea42e6) + version 1181 (commit 29e6832fdf3b106c0906d288c8ced6c0761b8985) Linux: https://github.com/bkaradzic/bx/raw/master/tools/bin/linux/genie @@ -43,7 +46,11 @@ Documentation ------------- [Scripting Reference](https://github.com/bkaradzic/genie/blob/master/docs/scripting-reference.md#scripting-reference) -[Introduction to GENie - CppCon 2016](https://onedrive.live.com/view.aspx?cid=171ee76e679935c8&page=view&resid=171EE76E679935C8!139573&parId=171EE76E679935C8!18835&authkey=!AKv_SGrgJwxDGDg&app=PowerPoint) + +Introduction to GENie - CppCon 2016 + History ------- @@ -90,7 +97,7 @@ of Premake 4.4 beta 5, and there is no intention to keep it compatible with it. - Added support for generating PS4/Orbis projects. - Fixed PCH race when using concurrent Makefile build. - Added Green Hills Software compiler support. - - Added edit & continue support for 64-bit builds in VS2013 upwards. + - Added edit & continue support for 64-bit builds in vs2013 upwards. - Added `windowstargetplatformversion` to specify VS Windows target version. - Added `NoWinRT` flag to disable WinRT CX builds. - Added `NoBufferSecurityCheck` flag to disable security checks in VS. @@ -120,17 +127,23 @@ of Premake 4.4 beta 5, and there is no intention to keep it compatible with it. - Added `iostargetplatformversion`, `macostargetplatformversion`, and `tvostargetplatformversion` to specify XCode OS target version. - Removed the `xcode3`, and `xcode4` actions. - - Added the `xcode8`, `xcode9`, and `xcode10` actions. + - Added the `xcode8`, `xcode9`, `xcode10`, `xcode11` and `xcode14` actions. - Added `systemincludedirs` that are always searched after directories added using `includedirs`. - Added `NoRuntimeChecks` flag to disable Basic Runtime Checks in non-optimized Visual Studio builds. - Added support for Nintendo Switch projects. - - Added flags for selecting C++ standard: `Cpp11`, `Cpp14`, `Cpp17`, + - Added flags for selecting C++ standard: `Cpp11`, `Cpp14`, `Cpp17`, `Cpp20` and `CppLatest`. - Added `xcodeprojectopts` and `xcodetargetopts`. - Added vs2019 support. - - Added UnitySupport flag to enable Unity (Jumbo) builds in Visual Studio 2019 + - Added `UnitySupport` flag to enable Unity (Jumbo) builds in vs2019 + - Added the `jcdb` action for generating a [JSON compilation database][jcdb]. + - Added support for generating Switch/NX32 Switch/NX64 projects. + - Removed FASTBuild. + - Removed Qbs support. + - Added vs2022 support. + - Added xcode15 action with visionOS support. build - GENie build system scripts ---------------------------------- @@ -240,4 +253,5 @@ Developer Crackshell used GENie for development of games OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + [jcdb]: https://clang.llvm.org/docs/JSONCompilationDatabase.html [zbs]: https://studio.zerobrane.com diff --git a/3rdparty/genie/build/gmake.darwin/genie.make b/3rdparty/genie/build/gmake.darwin/genie.make index 81e820505cb..811b331c0e2 100644 --- a/3rdparty/genie/build/gmake.darwin/genie.make +++ b/3rdparty/genie/build/gmake.darwin/genie.make @@ -1,4 +1,7 @@ # GNU Make project makefile autogenerated by GENie + +.SUFFIXES: + ifndef config config=release endif @@ -49,11 +52,11 @@ ifeq ($(config),release) DEFINES += -DNDEBUG -DLUA_COMPAT_MODULE -DLUA_USE_MACOSX INCLUDES += -I"../../src/host/lua-5.3.0/src" ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP -MP $(DEFINES) $(INCLUDES) - ALL_ASMFLAGS += $(ASMFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os $(MPARAM) -mmacosx-version-min=10.6 - ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os $(MPARAM) -mmacosx-version-min=10.6 - ALL_CXXFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os $(MPARAM) -mmacosx-version-min=10.6 - ALL_OBJCFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os $(MPARAM) -mmacosx-version-min=10.6 - ALL_OBJCPPFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os $(MPARAM) -mmacosx-version-min=10.6 + ALL_ASMFLAGS += $(ASMFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os -m64 -mmacosx-version-min=10.6 + ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os -m64 -mmacosx-version-min=10.6 + ALL_CXXFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os -m64 -mmacosx-version-min=10.6 + ALL_OBJCFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os -m64 -mmacosx-version-min=10.6 + ALL_OBJCPPFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os -m64 -mmacosx-version-min=10.6 ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) ALL_LDFLAGS += $(LDFLAGS) -L"." -mmacosx-version-min=10.6 LIBDEPS += @@ -136,11 +139,11 @@ ifeq ($(config),debug) DEFINES += -D_DEBUG -DLUA_COMPAT_MODULE -DLUA_USE_MACOSX INCLUDES += -I"../../src/host/lua-5.3.0/src" ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP -MP $(DEFINES) $(INCLUDES) - ALL_ASMFLAGS += $(ASMFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g $(MPARAM) -mmacosx-version-min=10.6 - ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g $(MPARAM) -mmacosx-version-min=10.6 - ALL_CXXFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g $(MPARAM) -mmacosx-version-min=10.6 - ALL_OBJCFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g $(MPARAM) -mmacosx-version-min=10.6 - ALL_OBJCPPFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g $(MPARAM) -mmacosx-version-min=10.6 + ALL_ASMFLAGS += $(ASMFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g -m64 -mmacosx-version-min=10.6 + ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g -m64 -mmacosx-version-min=10.6 + ALL_CXXFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g -m64 -mmacosx-version-min=10.6 + ALL_OBJCFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g -m64 -mmacosx-version-min=10.6 + ALL_OBJCPPFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g -m64 -mmacosx-version-min=10.6 ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) ALL_LDFLAGS += $(LDFLAGS) -L"." -mmacosx-version-min=10.6 LIBDEPS += @@ -224,11 +227,11 @@ ifeq ($(config),releaseuniv32) DEFINES += -DNDEBUG -DLUA_COMPAT_MODULE -DLUA_USE_MACOSX INCLUDES += -I"../../src/host/lua-5.3.0/src" ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP -MP $(DEFINES) $(INCLUDES) - ALL_ASMFLAGS += $(ASMFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os -arch i386 -arch ppc $(MPARAM) -mmacosx-version-min=10.6 - ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os -arch i386 -arch ppc $(MPARAM) -mmacosx-version-min=10.6 - ALL_CXXFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os -arch i386 -arch ppc $(MPARAM) -mmacosx-version-min=10.6 - ALL_OBJCFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os -arch i386 -arch ppc $(MPARAM) -mmacosx-version-min=10.6 - ALL_OBJCPPFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os -arch i386 -arch ppc $(MPARAM) -mmacosx-version-min=10.6 + ALL_ASMFLAGS += $(ASMFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os -arch i386 -arch ppc -m64 -mmacosx-version-min=10.6 + ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os -arch i386 -arch ppc -m64 -mmacosx-version-min=10.6 + ALL_CXXFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os -arch i386 -arch ppc -m64 -mmacosx-version-min=10.6 + ALL_OBJCFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os -arch i386 -arch ppc -m64 -mmacosx-version-min=10.6 + ALL_OBJCPPFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os -arch i386 -arch ppc -m64 -mmacosx-version-min=10.6 ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) ALL_LDFLAGS += $(LDFLAGS) -L"." -arch i386 -arch ppc -mmacosx-version-min=10.6 LIBDEPS += @@ -312,11 +315,11 @@ ifeq ($(config),debuguniv32) DEFINES += -D_DEBUG -DLUA_COMPAT_MODULE -DLUA_USE_MACOSX INCLUDES += -I"../../src/host/lua-5.3.0/src" ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP -MP $(DEFINES) $(INCLUDES) - ALL_ASMFLAGS += $(ASMFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g -arch i386 -arch ppc $(MPARAM) -mmacosx-version-min=10.6 - ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g -arch i386 -arch ppc $(MPARAM) -mmacosx-version-min=10.6 - ALL_CXXFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g -arch i386 -arch ppc $(MPARAM) -mmacosx-version-min=10.6 - ALL_OBJCFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g -arch i386 -arch ppc $(MPARAM) -mmacosx-version-min=10.6 - ALL_OBJCPPFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g -arch i386 -arch ppc $(MPARAM) -mmacosx-version-min=10.6 + ALL_ASMFLAGS += $(ASMFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g -arch i386 -arch ppc -m64 -mmacosx-version-min=10.6 + ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g -arch i386 -arch ppc -m64 -mmacosx-version-min=10.6 + ALL_CXXFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g -arch i386 -arch ppc -m64 -mmacosx-version-min=10.6 + ALL_OBJCFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g -arch i386 -arch ppc -m64 -mmacosx-version-min=10.6 + ALL_OBJCPPFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g -arch i386 -arch ppc -m64 -mmacosx-version-min=10.6 ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) ALL_LDFLAGS += $(LDFLAGS) -L"." -arch i386 -arch ppc -mmacosx-version-min=10.6 LIBDEPS += diff --git a/3rdparty/genie/build/gmake.freebsd/genie.make b/3rdparty/genie/build/gmake.freebsd/genie.make index 3ee72460742..15c88d5c9bb 100644 --- a/3rdparty/genie/build/gmake.freebsd/genie.make +++ b/3rdparty/genie/build/gmake.freebsd/genie.make @@ -1,4 +1,7 @@ # GNU Make project makefile autogenerated by GENie + +.SUFFIXES: + ifndef config config=release endif @@ -49,17 +52,21 @@ ifeq ($(config),release) DEFINES += -DNDEBUG -DLUA_COMPAT_MODULE -DLUA_USE_POSIX -DLUA_USE_DLOPEN INCLUDES += -I"../../src/host/lua-5.3.0/src" ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP -MP $(DEFINES) $(INCLUDES) - ALL_ASMFLAGS += $(ASMFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os $(MPARAM) - ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os $(MPARAM) - ALL_CXXFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os $(MPARAM) - ALL_OBJCFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os $(MPARAM) - ALL_OBJCPPFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os $(MPARAM) + ALL_ASMFLAGS += $(ASMFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os -m64 -Wno-implicit-fallthrough + ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os -m64 -Wno-implicit-fallthrough + ALL_CXXFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os -m64 -Wno-implicit-fallthrough + ALL_OBJCFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os -m64 -Wno-implicit-fallthrough + ALL_OBJCPPFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os -m64 -Wno-implicit-fallthrough ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) - ALL_LDFLAGS += $(LDFLAGS) -L. -s -rdynamic + ALL_LDFLAGS += $(LDFLAGS) -L"." -s -rdynamic + LIBDEPS += LDDEPS += + LDRESP = LIBS += $(LDDEPS) -lm EXTERNAL_LIBS += - LINKCMD = $(CC) -o $(TARGET) $(OBJECTS) $(RESOURCES) $(ARCH) $(ALL_LDFLAGS) $(LIBS) + LINKOBJS = $(OBJECTS) + LINKCMD = $(CC) -o $(TARGET) $(LINKOBJS) $(RESOURCES) $(ARCH) $(ALL_LDFLAGS) $(LIBS) + OBJRESP = OBJECTS := \ $(OBJDIR)/src/host/lua-5.3.0/src/lapi.o \ $(OBJDIR)/src/host/lua-5.3.0/src/lauxlib.o \ @@ -132,17 +139,21 @@ ifeq ($(config),debug) DEFINES += -D_DEBUG -DLUA_COMPAT_MODULE -DLUA_USE_POSIX -DLUA_USE_DLOPEN INCLUDES += -I"../../src/host/lua-5.3.0/src" ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP -MP $(DEFINES) $(INCLUDES) - ALL_ASMFLAGS += $(ASMFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g - ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g - ALL_CXXFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g - ALL_OBJCFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g - ALL_OBJCPPFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g + ALL_ASMFLAGS += $(ASMFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g -m64 -Wno-implicit-fallthrough + ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g -m64 -Wno-implicit-fallthrough + ALL_CXXFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g -m64 -Wno-implicit-fallthrough + ALL_OBJCFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g -m64 -Wno-implicit-fallthrough + ALL_OBJCPPFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g -m64 -Wno-implicit-fallthrough ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) - ALL_LDFLAGS += $(LDFLAGS) -L. -rdynamic + ALL_LDFLAGS += $(LDFLAGS) -L"." -rdynamic + LIBDEPS += LDDEPS += + LDRESP = LIBS += $(LDDEPS) -lm EXTERNAL_LIBS += - LINKCMD = $(CC) -o $(TARGET) $(OBJECTS) $(RESOURCES) $(ARCH) $(ALL_LDFLAGS) $(LIBS) + LINKOBJS = $(OBJECTS) + LINKCMD = $(CC) -o $(TARGET) $(LINKOBJS) $(RESOURCES) $(ARCH) $(ALL_LDFLAGS) $(LIBS) + OBJRESP = OBJECTS := \ $(OBJDIR)/src/host/lua-5.3.0/src/lapi.o \ $(OBJDIR)/src/host/lua-5.3.0/src/lauxlib.o \ @@ -220,7 +231,7 @@ RESOURCES := \ all: $(OBJDIRS) $(TARGETDIR) prebuild prelink $(TARGET) @: -$(TARGET): $(GCH) $(OBJECTS) $(LDDEPS) $(EXTERNAL_LIBS) $(RESOURCES) | $(TARGETDIR) $(OBJDIRS) +$(TARGET): $(GCH) $(OBJECTS) $(LIBDEPS) $(EXTERNAL_LIBS) $(RESOURCES) $(OBJRESP) $(LDRESP) | $(TARGETDIR) $(OBJDIRS) @echo Linking genie $(SILENT) $(LINKCMD) $(POSTBUILDCMDS) @@ -259,223 +270,235 @@ $(GCH_OBJC): $(PCH) $(MAKEFILE) | $(OBJDIR) $(SILENT) $(CC) $(ALL_OBJCFLAGS) -x objective-c-header $(DEFINES) $(INCLUDES) -o "$@" -c "$<" endif -$(OBJDIR)/src/host/lua-5.3.0/src/lapi.o: ../../src/host/lua-5.3.0/src/lapi.c $(GCH) $(MAKEFILE) +ifneq (,$(OBJRESP)) +$(OBJRESP): $(OBJECTS) | $(TARGETDIR) $(OBJDIRS) + $(SILENT) echo $^ + $(SILENT) echo $^ > $@ +endif + +ifneq (,$(LDRESP)) +$(LDRESP): $(LDDEPS) | $(TARGETDIR) $(OBJDIRS) + $(SILENT) echo $^ + $(SILENT) echo $^ > $@ +endif + +$(OBJDIR)/src/host/lua-5.3.0/src/lapi.o: ../../src/host/lua-5.3.0/src/lapi.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<" -$(OBJDIR)/src/host/lua-5.3.0/src/lauxlib.o: ../../src/host/lua-5.3.0/src/lauxlib.c $(GCH) $(MAKEFILE) +$(OBJDIR)/src/host/lua-5.3.0/src/lauxlib.o: ../../src/host/lua-5.3.0/src/lauxlib.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<" -$(OBJDIR)/src/host/lua-5.3.0/src/lbaselib.o: ../../src/host/lua-5.3.0/src/lbaselib.c $(GCH) $(MAKEFILE) +$(OBJDIR)/src/host/lua-5.3.0/src/lbaselib.o: ../../src/host/lua-5.3.0/src/lbaselib.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<" -$(OBJDIR)/src/host/lua-5.3.0/src/lbitlib.o: ../../src/host/lua-5.3.0/src/lbitlib.c $(GCH) $(MAKEFILE) +$(OBJDIR)/src/host/lua-5.3.0/src/lbitlib.o: ../../src/host/lua-5.3.0/src/lbitlib.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<" -$(OBJDIR)/src/host/lua-5.3.0/src/lcode.o: ../../src/host/lua-5.3.0/src/lcode.c $(GCH) $(MAKEFILE) +$(OBJDIR)/src/host/lua-5.3.0/src/lcode.o: ../../src/host/lua-5.3.0/src/lcode.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<" -$(OBJDIR)/src/host/lua-5.3.0/src/lcorolib.o: ../../src/host/lua-5.3.0/src/lcorolib.c $(GCH) $(MAKEFILE) +$(OBJDIR)/src/host/lua-5.3.0/src/lcorolib.o: ../../src/host/lua-5.3.0/src/lcorolib.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<" -$(OBJDIR)/src/host/lua-5.3.0/src/lctype.o: ../../src/host/lua-5.3.0/src/lctype.c $(GCH) $(MAKEFILE) +$(OBJDIR)/src/host/lua-5.3.0/src/lctype.o: ../../src/host/lua-5.3.0/src/lctype.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<" -$(OBJDIR)/src/host/lua-5.3.0/src/ldblib.o: ../../src/host/lua-5.3.0/src/ldblib.c $(GCH) $(MAKEFILE) +$(OBJDIR)/src/host/lua-5.3.0/src/ldblib.o: ../../src/host/lua-5.3.0/src/ldblib.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<" -$(OBJDIR)/src/host/lua-5.3.0/src/ldebug.o: ../../src/host/lua-5.3.0/src/ldebug.c $(GCH) $(MAKEFILE) +$(OBJDIR)/src/host/lua-5.3.0/src/ldebug.o: ../../src/host/lua-5.3.0/src/ldebug.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<" -$(OBJDIR)/src/host/lua-5.3.0/src/ldo.o: ../../src/host/lua-5.3.0/src/ldo.c $(GCH) $(MAKEFILE) +$(OBJDIR)/src/host/lua-5.3.0/src/ldo.o: ../../src/host/lua-5.3.0/src/ldo.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<" -$(OBJDIR)/src/host/lua-5.3.0/src/ldump.o: ../../src/host/lua-5.3.0/src/ldump.c $(GCH) $(MAKEFILE) +$(OBJDIR)/src/host/lua-5.3.0/src/ldump.o: ../../src/host/lua-5.3.0/src/ldump.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<" -$(OBJDIR)/src/host/lua-5.3.0/src/lfunc.o: ../../src/host/lua-5.3.0/src/lfunc.c $(GCH) $(MAKEFILE) +$(OBJDIR)/src/host/lua-5.3.0/src/lfunc.o: ../../src/host/lua-5.3.0/src/lfunc.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<" -$(OBJDIR)/src/host/lua-5.3.0/src/lgc.o: ../../src/host/lua-5.3.0/src/lgc.c $(GCH) $(MAKEFILE) +$(OBJDIR)/src/host/lua-5.3.0/src/lgc.o: ../../src/host/lua-5.3.0/src/lgc.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<" -$(OBJDIR)/src/host/lua-5.3.0/src/linit.o: ../../src/host/lua-5.3.0/src/linit.c $(GCH) $(MAKEFILE) +$(OBJDIR)/src/host/lua-5.3.0/src/linit.o: ../../src/host/lua-5.3.0/src/linit.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<" -$(OBJDIR)/src/host/lua-5.3.0/src/liolib.o: ../../src/host/lua-5.3.0/src/liolib.c $(GCH) $(MAKEFILE) +$(OBJDIR)/src/host/lua-5.3.0/src/liolib.o: ../../src/host/lua-5.3.0/src/liolib.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<" -$(OBJDIR)/src/host/lua-5.3.0/src/llex.o: ../../src/host/lua-5.3.0/src/llex.c $(GCH) $(MAKEFILE) +$(OBJDIR)/src/host/lua-5.3.0/src/llex.o: ../../src/host/lua-5.3.0/src/llex.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<" -$(OBJDIR)/src/host/lua-5.3.0/src/lmathlib.o: ../../src/host/lua-5.3.0/src/lmathlib.c $(GCH) $(MAKEFILE) +$(OBJDIR)/src/host/lua-5.3.0/src/lmathlib.o: ../../src/host/lua-5.3.0/src/lmathlib.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<" -$(OBJDIR)/src/host/lua-5.3.0/src/lmem.o: ../../src/host/lua-5.3.0/src/lmem.c $(GCH) $(MAKEFILE) +$(OBJDIR)/src/host/lua-5.3.0/src/lmem.o: ../../src/host/lua-5.3.0/src/lmem.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<" -$(OBJDIR)/src/host/lua-5.3.0/src/loadlib.o: ../../src/host/lua-5.3.0/src/loadlib.c $(GCH) $(MAKEFILE) +$(OBJDIR)/src/host/lua-5.3.0/src/loadlib.o: ../../src/host/lua-5.3.0/src/loadlib.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<" -$(OBJDIR)/src/host/lua-5.3.0/src/lobject.o: ../../src/host/lua-5.3.0/src/lobject.c $(GCH) $(MAKEFILE) +$(OBJDIR)/src/host/lua-5.3.0/src/lobject.o: ../../src/host/lua-5.3.0/src/lobject.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<" -$(OBJDIR)/src/host/lua-5.3.0/src/lopcodes.o: ../../src/host/lua-5.3.0/src/lopcodes.c $(GCH) $(MAKEFILE) +$(OBJDIR)/src/host/lua-5.3.0/src/lopcodes.o: ../../src/host/lua-5.3.0/src/lopcodes.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<" -$(OBJDIR)/src/host/lua-5.3.0/src/loslib.o: ../../src/host/lua-5.3.0/src/loslib.c $(GCH) $(MAKEFILE) +$(OBJDIR)/src/host/lua-5.3.0/src/loslib.o: ../../src/host/lua-5.3.0/src/loslib.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<" -$(OBJDIR)/src/host/lua-5.3.0/src/lparser.o: ../../src/host/lua-5.3.0/src/lparser.c $(GCH) $(MAKEFILE) +$(OBJDIR)/src/host/lua-5.3.0/src/lparser.o: ../../src/host/lua-5.3.0/src/lparser.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<" -$(OBJDIR)/src/host/lua-5.3.0/src/lstate.o: ../../src/host/lua-5.3.0/src/lstate.c $(GCH) $(MAKEFILE) +$(OBJDIR)/src/host/lua-5.3.0/src/lstate.o: ../../src/host/lua-5.3.0/src/lstate.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<" -$(OBJDIR)/src/host/lua-5.3.0/src/lstring.o: ../../src/host/lua-5.3.0/src/lstring.c $(GCH) $(MAKEFILE) +$(OBJDIR)/src/host/lua-5.3.0/src/lstring.o: ../../src/host/lua-5.3.0/src/lstring.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<" -$(OBJDIR)/src/host/lua-5.3.0/src/lstrlib.o: ../../src/host/lua-5.3.0/src/lstrlib.c $(GCH) $(MAKEFILE) +$(OBJDIR)/src/host/lua-5.3.0/src/lstrlib.o: ../../src/host/lua-5.3.0/src/lstrlib.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<" -$(OBJDIR)/src/host/lua-5.3.0/src/ltable.o: ../../src/host/lua-5.3.0/src/ltable.c $(GCH) $(MAKEFILE) +$(OBJDIR)/src/host/lua-5.3.0/src/ltable.o: ../../src/host/lua-5.3.0/src/ltable.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<" -$(OBJDIR)/src/host/lua-5.3.0/src/ltablib.o: ../../src/host/lua-5.3.0/src/ltablib.c $(GCH) $(MAKEFILE) +$(OBJDIR)/src/host/lua-5.3.0/src/ltablib.o: ../../src/host/lua-5.3.0/src/ltablib.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<" -$(OBJDIR)/src/host/lua-5.3.0/src/ltm.o: ../../src/host/lua-5.3.0/src/ltm.c $(GCH) $(MAKEFILE) +$(OBJDIR)/src/host/lua-5.3.0/src/ltm.o: ../../src/host/lua-5.3.0/src/ltm.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<" -$(OBJDIR)/src/host/lua-5.3.0/src/lundump.o: ../../src/host/lua-5.3.0/src/lundump.c $(GCH) $(MAKEFILE) +$(OBJDIR)/src/host/lua-5.3.0/src/lundump.o: ../../src/host/lua-5.3.0/src/lundump.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<" -$(OBJDIR)/src/host/lua-5.3.0/src/lutf8lib.o: ../../src/host/lua-5.3.0/src/lutf8lib.c $(GCH) $(MAKEFILE) +$(OBJDIR)/src/host/lua-5.3.0/src/lutf8lib.o: ../../src/host/lua-5.3.0/src/lutf8lib.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<" -$(OBJDIR)/src/host/lua-5.3.0/src/lvm.o: ../../src/host/lua-5.3.0/src/lvm.c $(GCH) $(MAKEFILE) +$(OBJDIR)/src/host/lua-5.3.0/src/lvm.o: ../../src/host/lua-5.3.0/src/lvm.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<" -$(OBJDIR)/src/host/lua-5.3.0/src/lzio.o: ../../src/host/lua-5.3.0/src/lzio.c $(GCH) $(MAKEFILE) +$(OBJDIR)/src/host/lua-5.3.0/src/lzio.o: ../../src/host/lua-5.3.0/src/lzio.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host/lua-5.3.0/src @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<" -$(OBJDIR)/src/host/os_chdir.o: ../../src/host/os_chdir.c $(GCH) $(MAKEFILE) +$(OBJDIR)/src/host/os_chdir.o: ../../src/host/os_chdir.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<" -$(OBJDIR)/src/host/os_copyfile.o: ../../src/host/os_copyfile.c $(GCH) $(MAKEFILE) +$(OBJDIR)/src/host/os_copyfile.o: ../../src/host/os_copyfile.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<" -$(OBJDIR)/src/host/os_getcwd.o: ../../src/host/os_getcwd.c $(GCH) $(MAKEFILE) +$(OBJDIR)/src/host/os_getcwd.o: ../../src/host/os_getcwd.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<" -$(OBJDIR)/src/host/os_is64bit.o: ../../src/host/os_is64bit.c $(GCH) $(MAKEFILE) +$(OBJDIR)/src/host/os_is64bit.o: ../../src/host/os_is64bit.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<" -$(OBJDIR)/src/host/os_isdir.o: ../../src/host/os_isdir.c $(GCH) $(MAKEFILE) +$(OBJDIR)/src/host/os_isdir.o: ../../src/host/os_isdir.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<" -$(OBJDIR)/src/host/os_isfile.o: ../../src/host/os_isfile.c $(GCH) $(MAKEFILE) +$(OBJDIR)/src/host/os_isfile.o: ../../src/host/os_isfile.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<" -$(OBJDIR)/src/host/os_match.o: ../../src/host/os_match.c $(GCH) $(MAKEFILE) +$(OBJDIR)/src/host/os_match.o: ../../src/host/os_match.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<" -$(OBJDIR)/src/host/os_mkdir.o: ../../src/host/os_mkdir.c $(GCH) $(MAKEFILE) +$(OBJDIR)/src/host/os_mkdir.o: ../../src/host/os_mkdir.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<" -$(OBJDIR)/src/host/os_pathsearch.o: ../../src/host/os_pathsearch.c $(GCH) $(MAKEFILE) +$(OBJDIR)/src/host/os_pathsearch.o: ../../src/host/os_pathsearch.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<" -$(OBJDIR)/src/host/os_rmdir.o: ../../src/host/os_rmdir.c $(GCH) $(MAKEFILE) +$(OBJDIR)/src/host/os_rmdir.o: ../../src/host/os_rmdir.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<" -$(OBJDIR)/src/host/os_stat.o: ../../src/host/os_stat.c $(GCH) $(MAKEFILE) +$(OBJDIR)/src/host/os_stat.o: ../../src/host/os_stat.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<" -$(OBJDIR)/src/host/os_ticks.o: ../../src/host/os_ticks.c $(GCH) $(MAKEFILE) +$(OBJDIR)/src/host/os_ticks.o: ../../src/host/os_ticks.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<" -$(OBJDIR)/src/host/os_uuid.o: ../../src/host/os_uuid.c $(GCH) $(MAKEFILE) +$(OBJDIR)/src/host/os_uuid.o: ../../src/host/os_uuid.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<" -$(OBJDIR)/src/host/path_getabsolute.o: ../../src/host/path_getabsolute.c $(GCH) $(MAKEFILE) +$(OBJDIR)/src/host/path_getabsolute.o: ../../src/host/path_getabsolute.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<" -$(OBJDIR)/src/host/path_getrelative.o: ../../src/host/path_getrelative.c $(GCH) $(MAKEFILE) +$(OBJDIR)/src/host/path_getrelative.o: ../../src/host/path_getrelative.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<" -$(OBJDIR)/src/host/path_helpers.o: ../../src/host/path_helpers.c $(GCH) $(MAKEFILE) +$(OBJDIR)/src/host/path_helpers.o: ../../src/host/path_helpers.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<" -$(OBJDIR)/src/host/path_isabsolute.o: ../../src/host/path_isabsolute.c $(GCH) $(MAKEFILE) +$(OBJDIR)/src/host/path_isabsolute.o: ../../src/host/path_isabsolute.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<" -$(OBJDIR)/src/host/premake.o: ../../src/host/premake.c $(GCH) $(MAKEFILE) +$(OBJDIR)/src/host/premake.o: ../../src/host/premake.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<" -$(OBJDIR)/src/host/premake_main.o: ../../src/host/premake_main.c $(GCH) $(MAKEFILE) +$(OBJDIR)/src/host/premake_main.o: ../../src/host/premake_main.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<" -$(OBJDIR)/src/host/scripts.o: ../../src/host/scripts.c $(GCH) $(MAKEFILE) +$(OBJDIR)/src/host/scripts.o: ../../src/host/scripts.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<" -$(OBJDIR)/src/host/string_endswith.o: ../../src/host/string_endswith.c $(GCH) $(MAKEFILE) +$(OBJDIR)/src/host/string_endswith.o: ../../src/host/string_endswith.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<" -$(OBJDIR)/src/host/string_hash.o: ../../src/host/string_hash.c $(GCH) $(MAKEFILE) +$(OBJDIR)/src/host/string_hash.o: ../../src/host/string_hash.c $(GCH) $(MAKEFILE) | $(OBJDIR)/src/host @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -c "$<" diff --git a/3rdparty/genie/build/gmake.linux/genie.make b/3rdparty/genie/build/gmake.linux/genie.make index af00e6f90f7..251cf897bee 100644 --- a/3rdparty/genie/build/gmake.linux/genie.make +++ b/3rdparty/genie/build/gmake.linux/genie.make @@ -1,4 +1,7 @@ # GNU Make project makefile autogenerated by GENie + +.SUFFIXES: + ifndef config config=release endif @@ -49,11 +52,11 @@ ifeq ($(config),release) DEFINES += -DNDEBUG -DLUA_COMPAT_MODULE -DLUA_USE_POSIX -DLUA_USE_DLOPEN -D_FILE_OFFSET_BITS=64 INCLUDES += -I"../../src/host/lua-5.3.0/src" ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP -MP $(DEFINES) $(INCLUDES) - ALL_ASMFLAGS += $(ASMFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os $(MPARAM) -Wno-implicit-fallthrough - ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os $(MPARAM) -Wno-implicit-fallthrough - ALL_CXXFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os $(MPARAM) -Wno-implicit-fallthrough - ALL_OBJCFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os $(MPARAM) -Wno-implicit-fallthrough - ALL_OBJCPPFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os $(MPARAM) -Wno-implicit-fallthrough + ALL_ASMFLAGS += $(ASMFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os -m64 -Wno-implicit-fallthrough + ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os -m64 -Wno-implicit-fallthrough + ALL_CXXFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os -m64 -Wno-implicit-fallthrough + ALL_OBJCFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os -m64 -Wno-implicit-fallthrough + ALL_OBJCPPFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os -m64 -Wno-implicit-fallthrough ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) ALL_LDFLAGS += $(LDFLAGS) -L"." -s -rdynamic LIBDEPS += @@ -136,11 +139,11 @@ ifeq ($(config),debug) DEFINES += -D_DEBUG -DLUA_COMPAT_MODULE -DLUA_USE_POSIX -DLUA_USE_DLOPEN -D_FILE_OFFSET_BITS=64 INCLUDES += -I"../../src/host/lua-5.3.0/src" ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP -MP $(DEFINES) $(INCLUDES) - ALL_ASMFLAGS += $(ASMFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g $(MPARAM) -Wno-implicit-fallthrough - ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g $(MPARAM) -Wno-implicit-fallthrough - ALL_CXXFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g $(MPARAM) -Wno-implicit-fallthrough - ALL_OBJCFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g $(MPARAM) -Wno-implicit-fallthrough - ALL_OBJCPPFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g $(MPARAM) -Wno-implicit-fallthrough + ALL_ASMFLAGS += $(ASMFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g -m64 -Wno-implicit-fallthrough + ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g -m64 -Wno-implicit-fallthrough + ALL_CXXFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g -m64 -Wno-implicit-fallthrough + ALL_OBJCFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g -m64 -Wno-implicit-fallthrough + ALL_OBJCPPFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g -m64 -Wno-implicit-fallthrough ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) ALL_LDFLAGS += $(LDFLAGS) -L"." -rdynamic LIBDEPS += diff --git a/3rdparty/genie/build/gmake.solaris/Makefile b/3rdparty/genie/build/gmake.solaris/Makefile deleted file mode 100644 index be9880cf2a3..00000000000 --- a/3rdparty/genie/build/gmake.solaris/Makefile +++ /dev/null @@ -1,34 +0,0 @@ -# GNU Make solution makefile autogenerated by GENie -# Type "make help" for usage help - -ifndef config - config=release -endif -export config - -PROJECTS := genie - -.PHONY: all clean help $(PROJECTS) - -all: $(PROJECTS) - -genie: - @echo "==== Building genie ($(config)) ====" - @${MAKE} --no-print-directory -C . -f genie.make - -clean: - @${MAKE} --no-print-directory -C . -f genie.make clean - -help: - @echo "Usage: make [config=name] [target]" - @echo "" - @echo "CONFIGURATIONS:" - @echo " release" - @echo " debug" - @echo "" - @echo "TARGETS:" - @echo " all (default)" - @echo " clean" - @echo " genie" - @echo "" - @echo "For more information, see https://github.com/bkaradzic/genie" diff --git a/3rdparty/genie/build/gmake.solaris/genie.make b/3rdparty/genie/build/gmake.solaris/genie.make deleted file mode 100644 index 56ce127f9d9..00000000000 --- a/3rdparty/genie/build/gmake.solaris/genie.make +++ /dev/null @@ -1,470 +0,0 @@ -# GNU Make project makefile autogenerated by GENie -ifndef config - config=release -endif - -ifndef verbose - SILENT = @ -endif - -SHELLTYPE := msdos -ifeq (,$(ComSpec)$(COMSPEC)) - SHELLTYPE := posix -endif -ifeq (/bin,$(findstring /bin,$(SHELL))) - SHELLTYPE := posix -endif - -ifeq (posix,$(SHELLTYPE)) - MKDIR = $(SILENT) mkdir -p "$(1)" - COPY = $(SILENT) cp -fR "$(1)" "$(2)" - RM= $(SILENT) rm -f "$(1)" -else - MKDIR = $(SILENT) mkdir "$(subst /,\\,$(1))" 2> nul || exit 0 - COPY = $(SILENT) copy /Y "$(subst /,\\,$(1))" "$(subst /,\\,$(2))" - RM = $(SILENT) del /F "$(subst /,\\,$(1))" 2> nul || exit 0 -endif - -CC = gcc -CXX = g++ -AR = ar - -ifndef RESCOMP - ifdef WINDRES - RESCOMP = $(WINDRES) - else - RESCOMP = windres - endif -endif - -ifeq ($(config),release) - OBJDIR = obj/Release - TARGETDIR = ../../bin/solaris - override TARGET = $(TARGETDIR)/genie - DEFINES += -DNDEBUG -DLUA_COMPAT_MODULE -D_REENTRANT -DLUA_USE_POSIX -DLUA_USE_DLOPEN - INCLUDES += -I../../src/host/lua-5.3.0/src - ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) - ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os $(MPARAM) -std=gnu99 - ALL_CXXFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os $(MPARAM) -std=gnu99 - ALL_OBJCFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os $(MPARAM) -std=gnu99 - ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) - ALL_LDFLAGS += $(LDFLAGS) -L. -s -rdynamic - LDDEPS += - LIBS += $(LDDEPS) -ldl -lm - LINKCMD = $(CC) -o $(TARGET) $(OBJECTS) $(RESOURCES) $(ARCH) $(ALL_LDFLAGS) $(LIBS) - OBJECTS := \ - $(OBJDIR)/src/host/os_chdir.o \ - $(OBJDIR)/src/host/os_copyfile.o \ - $(OBJDIR)/src/host/os_getcwd.o \ - $(OBJDIR)/src/host/os_is64bit.o \ - $(OBJDIR)/src/host/os_isdir.o \ - $(OBJDIR)/src/host/os_isfile.o \ - $(OBJDIR)/src/host/os_match.o \ - $(OBJDIR)/src/host/os_mkdir.o \ - $(OBJDIR)/src/host/os_pathsearch.o \ - $(OBJDIR)/src/host/os_rmdir.o \ - $(OBJDIR)/src/host/os_stat.o \ - $(OBJDIR)/src/host/os_ticks.o \ - $(OBJDIR)/src/host/os_uuid.o \ - $(OBJDIR)/src/host/path_getabsolute.o \ - $(OBJDIR)/src/host/path_getrelative.o \ - $(OBJDIR)/src/host/path_helpers.o \ - $(OBJDIR)/src/host/path_isabsolute.o \ - $(OBJDIR)/src/host/premake.o \ - $(OBJDIR)/src/host/premake_main.o \ - $(OBJDIR)/src/host/scripts.o \ - $(OBJDIR)/src/host/string_endswith.o \ - $(OBJDIR)/src/host/string_hash.o \ - $(OBJDIR)/src/host/lua-5.3.0/src/lapi.o \ - $(OBJDIR)/src/host/lua-5.3.0/src/lauxlib.o \ - $(OBJDIR)/src/host/lua-5.3.0/src/lbaselib.o \ - $(OBJDIR)/src/host/lua-5.3.0/src/lbitlib.o \ - $(OBJDIR)/src/host/lua-5.3.0/src/lcode.o \ - $(OBJDIR)/src/host/lua-5.3.0/src/lcorolib.o \ - $(OBJDIR)/src/host/lua-5.3.0/src/lctype.o \ - $(OBJDIR)/src/host/lua-5.3.0/src/ldblib.o \ - $(OBJDIR)/src/host/lua-5.3.0/src/ldebug.o \ - $(OBJDIR)/src/host/lua-5.3.0/src/ldo.o \ - $(OBJDIR)/src/host/lua-5.3.0/src/ldump.o \ - $(OBJDIR)/src/host/lua-5.3.0/src/lfunc.o \ - $(OBJDIR)/src/host/lua-5.3.0/src/lgc.o \ - $(OBJDIR)/src/host/lua-5.3.0/src/linit.o \ - $(OBJDIR)/src/host/lua-5.3.0/src/liolib.o \ - $(OBJDIR)/src/host/lua-5.3.0/src/llex.o \ - $(OBJDIR)/src/host/lua-5.3.0/src/lmathlib.o \ - $(OBJDIR)/src/host/lua-5.3.0/src/lmem.o \ - $(OBJDIR)/src/host/lua-5.3.0/src/loadlib.o \ - $(OBJDIR)/src/host/lua-5.3.0/src/lobject.o \ - $(OBJDIR)/src/host/lua-5.3.0/src/lopcodes.o \ - $(OBJDIR)/src/host/lua-5.3.0/src/loslib.o \ - $(OBJDIR)/src/host/lua-5.3.0/src/lparser.o \ - $(OBJDIR)/src/host/lua-5.3.0/src/lstate.o \ - $(OBJDIR)/src/host/lua-5.3.0/src/lstring.o \ - $(OBJDIR)/src/host/lua-5.3.0/src/lstrlib.o \ - $(OBJDIR)/src/host/lua-5.3.0/src/ltable.o \ - $(OBJDIR)/src/host/lua-5.3.0/src/ltablib.o \ - $(OBJDIR)/src/host/lua-5.3.0/src/ltm.o \ - $(OBJDIR)/src/host/lua-5.3.0/src/lundump.o \ - $(OBJDIR)/src/host/lua-5.3.0/src/lutf8lib.o \ - $(OBJDIR)/src/host/lua-5.3.0/src/lvm.o \ - $(OBJDIR)/src/host/lua-5.3.0/src/lzio.o \ - - define PREBUILDCMDS - endef - define PRELINKCMDS - endef - define POSTBUILDCMDS - endef -endif - -ifeq ($(config),debug) - OBJDIR = obj/Debug - TARGETDIR = ../../bin/solaris - override TARGET = $(TARGETDIR)/genie - DEFINES += -D_DEBUG -DLUA_COMPAT_MODULE -D_REENTRANT -DLUA_USE_POSIX -DLUA_USE_DLOPEN - INCLUDES += -I../../src/host/lua-5.3.0/src - ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) - ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g -std=gnu99 - ALL_CXXFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g -std=gnu99 - ALL_OBJCFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g -std=gnu99 - ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) - ALL_LDFLAGS += $(LDFLAGS) -L. -rdynamic - LDDEPS += - LIBS += $(LDDEPS) -ldl -lm - LINKCMD = $(CC) -o $(TARGET) $(OBJECTS) $(RESOURCES) $(ARCH) $(ALL_LDFLAGS) $(LIBS) - OBJECTS := \ - $(OBJDIR)/src/host/os_chdir.o \ - $(OBJDIR)/src/host/os_copyfile.o \ - $(OBJDIR)/src/host/os_getcwd.o \ - $(OBJDIR)/src/host/os_is64bit.o \ - $(OBJDIR)/src/host/os_isdir.o \ - $(OBJDIR)/src/host/os_isfile.o \ - $(OBJDIR)/src/host/os_match.o \ - $(OBJDIR)/src/host/os_mkdir.o \ - $(OBJDIR)/src/host/os_pathsearch.o \ - $(OBJDIR)/src/host/os_rmdir.o \ - $(OBJDIR)/src/host/os_stat.o \ - $(OBJDIR)/src/host/os_ticks.o \ - $(OBJDIR)/src/host/os_uuid.o \ - $(OBJDIR)/src/host/path_getabsolute.o \ - $(OBJDIR)/src/host/path_getrelative.o \ - $(OBJDIR)/src/host/path_helpers.o \ - $(OBJDIR)/src/host/path_isabsolute.o \ - $(OBJDIR)/src/host/premake.o \ - $(OBJDIR)/src/host/premake_main.o \ - $(OBJDIR)/src/host/scripts.o \ - $(OBJDIR)/src/host/string_endswith.o \ - $(OBJDIR)/src/host/string_hash.o \ - $(OBJDIR)/src/host/lua-5.3.0/src/lapi.o \ - $(OBJDIR)/src/host/lua-5.3.0/src/lauxlib.o \ - $(OBJDIR)/src/host/lua-5.3.0/src/lbaselib.o \ - $(OBJDIR)/src/host/lua-5.3.0/src/lbitlib.o \ - $(OBJDIR)/src/host/lua-5.3.0/src/lcode.o \ - $(OBJDIR)/src/host/lua-5.3.0/src/lcorolib.o \ - $(OBJDIR)/src/host/lua-5.3.0/src/lctype.o \ - $(OBJDIR)/src/host/lua-5.3.0/src/ldblib.o \ - $(OBJDIR)/src/host/lua-5.3.0/src/ldebug.o \ - $(OBJDIR)/src/host/lua-5.3.0/src/ldo.o \ - $(OBJDIR)/src/host/lua-5.3.0/src/ldump.o \ - $(OBJDIR)/src/host/lua-5.3.0/src/lfunc.o \ - $(OBJDIR)/src/host/lua-5.3.0/src/lgc.o \ - $(OBJDIR)/src/host/lua-5.3.0/src/linit.o \ - $(OBJDIR)/src/host/lua-5.3.0/src/liolib.o \ - $(OBJDIR)/src/host/lua-5.3.0/src/llex.o \ - $(OBJDIR)/src/host/lua-5.3.0/src/lmathlib.o \ - $(OBJDIR)/src/host/lua-5.3.0/src/lmem.o \ - $(OBJDIR)/src/host/lua-5.3.0/src/loadlib.o \ - $(OBJDIR)/src/host/lua-5.3.0/src/lobject.o \ - $(OBJDIR)/src/host/lua-5.3.0/src/lopcodes.o \ - $(OBJDIR)/src/host/lua-5.3.0/src/loslib.o \ - $(OBJDIR)/src/host/lua-5.3.0/src/lparser.o \ - $(OBJDIR)/src/host/lua-5.3.0/src/lstate.o \ - $(OBJDIR)/src/host/lua-5.3.0/src/lstring.o \ - $(OBJDIR)/src/host/lua-5.3.0/src/lstrlib.o \ - $(OBJDIR)/src/host/lua-5.3.0/src/ltable.o \ - $(OBJDIR)/src/host/lua-5.3.0/src/ltablib.o \ - $(OBJDIR)/src/host/lua-5.3.0/src/ltm.o \ - $(OBJDIR)/src/host/lua-5.3.0/src/lundump.o \ - $(OBJDIR)/src/host/lua-5.3.0/src/lutf8lib.o \ - $(OBJDIR)/src/host/lua-5.3.0/src/lvm.o \ - $(OBJDIR)/src/host/lua-5.3.0/src/lzio.o \ - - define PREBUILDCMDS - endef - define PRELINKCMDS - endef - define POSTBUILDCMDS - endef -endif - -OBJDIRS := \ - $(OBJDIR) \ - $(OBJDIR)/src/host \ - $(OBJDIR)/src/host/lua-5.3.0/src \ - -RESOURCES := \ - -.PHONY: clean prebuild prelink - -all: $(TARGETDIR) $(OBJDIRS) prebuild prelink $(TARGET) - @: - -$(TARGET): $(GCH) $(OBJECTS) $(LDDEPS) $(RESOURCES) - @echo Linking genie - $(SILENT) $(LINKCMD) - $(POSTBUILDCMDS) - -$(TARGETDIR): - @echo Creating $(TARGETDIR) - -$(call MKDIR,$(TARGETDIR)) - -$(OBJDIRS): - @echo Creating $(@) - -$(call MKDIR,$@) - -clean: - @echo Cleaning genie -ifeq (posix,$(SHELLTYPE)) - $(SILENT) rm -f $(TARGET) - $(SILENT) rm -rf $(OBJDIR) -else - $(SILENT) if exist $(subst /,\\,$(TARGET)) del $(subst /,\\,$(TARGET)) - $(SILENT) if exist $(subst /,\\,$(OBJDIR)) rmdir /s /q $(subst /,\\,$(OBJDIR)) -endif - -prebuild: - $(PREBUILDCMDS) - -prelink: - $(PRELINKCMDS) - -ifneq (,$(PCH)) -$(GCH): $(PCH) - @echo $(notdir $<) - $(SILENT) $(CC) -x c-header $(ALL_CFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) -o "$@" -MF "$(@:%.gch=%.d)" -c "$<" -endif - -$(OBJDIR)/src/host/os_chdir.o: ../../src/host/os_chdir.c - @echo $(notdir $<) - $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" - -$(OBJDIR)/src/host/os_copyfile.o: ../../src/host/os_copyfile.c - @echo $(notdir $<) - $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" - -$(OBJDIR)/src/host/os_getcwd.o: ../../src/host/os_getcwd.c - @echo $(notdir $<) - $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" - -$(OBJDIR)/src/host/os_is64bit.o: ../../src/host/os_is64bit.c - @echo $(notdir $<) - $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" - -$(OBJDIR)/src/host/os_isdir.o: ../../src/host/os_isdir.c - @echo $(notdir $<) - $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" - -$(OBJDIR)/src/host/os_isfile.o: ../../src/host/os_isfile.c - @echo $(notdir $<) - $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" - -$(OBJDIR)/src/host/os_match.o: ../../src/host/os_match.c - @echo $(notdir $<) - $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" - -$(OBJDIR)/src/host/os_mkdir.o: ../../src/host/os_mkdir.c - @echo $(notdir $<) - $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" - -$(OBJDIR)/src/host/os_pathsearch.o: ../../src/host/os_pathsearch.c - @echo $(notdir $<) - $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" - -$(OBJDIR)/src/host/os_rmdir.o: ../../src/host/os_rmdir.c - @echo $(notdir $<) - $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" - -$(OBJDIR)/src/host/os_stat.o: ../../src/host/os_stat.c - @echo $(notdir $<) - $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" - -$(OBJDIR)/src/host/os_ticks.o: ../../src/host/os_ticks.c - @echo $(notdir $<) - $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" - -$(OBJDIR)/src/host/os_uuid.o: ../../src/host/os_uuid.c - @echo $(notdir $<) - $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" - -$(OBJDIR)/src/host/path_getabsolute.o: ../../src/host/path_getabsolute.c - @echo $(notdir $<) - $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" - -$(OBJDIR)/src/host/path_getrelative.o: ../../src/host/path_getrelative.c - @echo $(notdir $<) - $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" - -$(OBJDIR)/src/host/path_helpers.o: ../../src/host/path_helpers.c - @echo $(notdir $<) - $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" - -$(OBJDIR)/src/host/path_isabsolute.o: ../../src/host/path_isabsolute.c - @echo $(notdir $<) - $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" - -$(OBJDIR)/src/host/premake.o: ../../src/host/premake.c - @echo $(notdir $<) - $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" - -$(OBJDIR)/src/host/premake_main.o: ../../src/host/premake_main.c - @echo $(notdir $<) - $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" - -$(OBJDIR)/src/host/scripts.o: ../../src/host/scripts.c - @echo $(notdir $<) - $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" - -$(OBJDIR)/src/host/string_endswith.o: ../../src/host/string_endswith.c - @echo $(notdir $<) - $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" - -$(OBJDIR)/src/host/string_hash.o: ../../src/host/string_hash.c - @echo $(notdir $<) - $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" - -$(OBJDIR)/src/host/lua-5.3.0/src/lapi.o: ../../src/host/lua-5.3.0/src/lapi.c - @echo $(notdir $<) - $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" - -$(OBJDIR)/src/host/lua-5.3.0/src/lauxlib.o: ../../src/host/lua-5.3.0/src/lauxlib.c - @echo $(notdir $<) - $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" - -$(OBJDIR)/src/host/lua-5.3.0/src/lbaselib.o: ../../src/host/lua-5.3.0/src/lbaselib.c - @echo $(notdir $<) - $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" - -$(OBJDIR)/src/host/lua-5.3.0/src/lbitlib.o: ../../src/host/lua-5.3.0/src/lbitlib.c - @echo $(notdir $<) - $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" - -$(OBJDIR)/src/host/lua-5.3.0/src/lcode.o: ../../src/host/lua-5.3.0/src/lcode.c - @echo $(notdir $<) - $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" - -$(OBJDIR)/src/host/lua-5.3.0/src/lcorolib.o: ../../src/host/lua-5.3.0/src/lcorolib.c - @echo $(notdir $<) - $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" - -$(OBJDIR)/src/host/lua-5.3.0/src/lctype.o: ../../src/host/lua-5.3.0/src/lctype.c - @echo $(notdir $<) - $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" - -$(OBJDIR)/src/host/lua-5.3.0/src/ldblib.o: ../../src/host/lua-5.3.0/src/ldblib.c - @echo $(notdir $<) - $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" - -$(OBJDIR)/src/host/lua-5.3.0/src/ldebug.o: ../../src/host/lua-5.3.0/src/ldebug.c - @echo $(notdir $<) - $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" - -$(OBJDIR)/src/host/lua-5.3.0/src/ldo.o: ../../src/host/lua-5.3.0/src/ldo.c - @echo $(notdir $<) - $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" - -$(OBJDIR)/src/host/lua-5.3.0/src/ldump.o: ../../src/host/lua-5.3.0/src/ldump.c - @echo $(notdir $<) - $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" - -$(OBJDIR)/src/host/lua-5.3.0/src/lfunc.o: ../../src/host/lua-5.3.0/src/lfunc.c - @echo $(notdir $<) - $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" - -$(OBJDIR)/src/host/lua-5.3.0/src/lgc.o: ../../src/host/lua-5.3.0/src/lgc.c - @echo $(notdir $<) - $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" - -$(OBJDIR)/src/host/lua-5.3.0/src/linit.o: ../../src/host/lua-5.3.0/src/linit.c - @echo $(notdir $<) - $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" - -$(OBJDIR)/src/host/lua-5.3.0/src/liolib.o: ../../src/host/lua-5.3.0/src/liolib.c - @echo $(notdir $<) - $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" - -$(OBJDIR)/src/host/lua-5.3.0/src/llex.o: ../../src/host/lua-5.3.0/src/llex.c - @echo $(notdir $<) - $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" - -$(OBJDIR)/src/host/lua-5.3.0/src/lmathlib.o: ../../src/host/lua-5.3.0/src/lmathlib.c - @echo $(notdir $<) - $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" - -$(OBJDIR)/src/host/lua-5.3.0/src/lmem.o: ../../src/host/lua-5.3.0/src/lmem.c - @echo $(notdir $<) - $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" - -$(OBJDIR)/src/host/lua-5.3.0/src/loadlib.o: ../../src/host/lua-5.3.0/src/loadlib.c - @echo $(notdir $<) - $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" - -$(OBJDIR)/src/host/lua-5.3.0/src/lobject.o: ../../src/host/lua-5.3.0/src/lobject.c - @echo $(notdir $<) - $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" - -$(OBJDIR)/src/host/lua-5.3.0/src/lopcodes.o: ../../src/host/lua-5.3.0/src/lopcodes.c - @echo $(notdir $<) - $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" - -$(OBJDIR)/src/host/lua-5.3.0/src/loslib.o: ../../src/host/lua-5.3.0/src/loslib.c - @echo $(notdir $<) - $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" - -$(OBJDIR)/src/host/lua-5.3.0/src/lparser.o: ../../src/host/lua-5.3.0/src/lparser.c - @echo $(notdir $<) - $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" - -$(OBJDIR)/src/host/lua-5.3.0/src/lstate.o: ../../src/host/lua-5.3.0/src/lstate.c - @echo $(notdir $<) - $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" - -$(OBJDIR)/src/host/lua-5.3.0/src/lstring.o: ../../src/host/lua-5.3.0/src/lstring.c - @echo $(notdir $<) - $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" - -$(OBJDIR)/src/host/lua-5.3.0/src/lstrlib.o: ../../src/host/lua-5.3.0/src/lstrlib.c - @echo $(notdir $<) - $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" - -$(OBJDIR)/src/host/lua-5.3.0/src/ltable.o: ../../src/host/lua-5.3.0/src/ltable.c - @echo $(notdir $<) - $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" - -$(OBJDIR)/src/host/lua-5.3.0/src/ltablib.o: ../../src/host/lua-5.3.0/src/ltablib.c - @echo $(notdir $<) - $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" - -$(OBJDIR)/src/host/lua-5.3.0/src/ltm.o: ../../src/host/lua-5.3.0/src/ltm.c - @echo $(notdir $<) - $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" - -$(OBJDIR)/src/host/lua-5.3.0/src/lundump.o: ../../src/host/lua-5.3.0/src/lundump.c - @echo $(notdir $<) - $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" - -$(OBJDIR)/src/host/lua-5.3.0/src/lutf8lib.o: ../../src/host/lua-5.3.0/src/lutf8lib.c - @echo $(notdir $<) - $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" - -$(OBJDIR)/src/host/lua-5.3.0/src/lvm.o: ../../src/host/lua-5.3.0/src/lvm.c - @echo $(notdir $<) - $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" - -$(OBJDIR)/src/host/lua-5.3.0/src/lzio.o: ../../src/host/lua-5.3.0/src/lzio.c - @echo $(notdir $<) - $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" - --include $(OBJECTS:%.o=%.d) -ifneq (,$(PCH)) - -include $(OBJDIR)/$(notdir $(PCH)).d -endif diff --git a/3rdparty/genie/build/gmake.windows/genie.make b/3rdparty/genie/build/gmake.windows/genie.make index f3808bfd730..531b94d8567 100644 --- a/3rdparty/genie/build/gmake.windows/genie.make +++ b/3rdparty/genie/build/gmake.windows/genie.make @@ -1,4 +1,7 @@ # GNU Make project makefile autogenerated by GENie + +.SUFFIXES: + ifndef config config=release endif diff --git a/3rdparty/genie/docs/scripting-reference.md b/3rdparty/genie/docs/scripting-reference.md index 35b1217e879..7f1b91e512f 100644 --- a/3rdparty/genie/docs/scripting-reference.md +++ b/3rdparty/genie/docs/scripting-reference.md @@ -341,6 +341,19 @@ configuration "not windows" defines { "NOT_WINDOWS" } ``` +Define a symbol based on custom command line option + +```lua +newoption { + trigger = "gfxapi", + description = "Choose a particular 3D API for rendering", + allowed = { { "opengl", "OpenGL Renderer" } } +} + +configuration "opengl" + defines { "OPENGL" } +``` + Reset the configuration filter ```lua @@ -349,7 +362,7 @@ configuration {} #### Caveats -- Argument chaining: +- Argument chaining: `configuration` can take multiple arguments, e.g., ```lua configuration {"StaticLib", "xcode*", "osx or ios*"} @@ -357,29 +370,29 @@ configuration {} These arguments will be combined as an `AND` clause, i.e. if one of the keywords does _not_ match the actual configuration terms, the following settings will not be applied. - -- Condition evaluation: + +- Condition evaluation: The arguments are **not** evaluated as Lua. They are merely regex-matched against the configuration terms. The implications of this are that parentheses have no effect outside of regular expression groups. A condition like `"not (osx or ios*)"` will not be equivalent to `{"not osx", "not ios*}"`. Furthermore, a condition like `"not osx or ios*"` will be evaluated as the negation of `"osx or ios*"`. - -- `and` is **not** a valid keyword for configuration combinations. + +- `and` is **not** a valid keyword for configuration combinations. However, several keywords will be combined as an `AND` clause. - -- Limits of Lua's regular expressions: + +- Limits of Lua's regular expressions: Each passed keyword is matched against each configuration terms from the project/solution type being built using [Lua's regular expression mechanism](https://www.lua.org/manual/5.3/manual.html#6.4). This means that keyword matching is subject to the same limits as regular Lua regex matching. This implies that regexes like `"(osx|ios)"` do not work. - -- Wildcard expansion: + +- Wildcard expansion: Wildcards will get expanded following the same rules as paths. Similarly, special characters such as `()` will get escaped (i.e. converted to `%(%)`) before being matched. This means that `"not (osx or ios*)"` will in fact get expanded to `"not %(osx or ios[^/]*)"` and then checked as `not` _result of_ `"%(osx or ios[^/]*)"`, which in turn gets broken down to `"%(osx"` and `"ios[^/]*)"`. - -- `"win*"` matchings: + +- `"win*"` matchings: Intuitively, the configuration keyword to match "Windows" ("Win32", "Win64" or "WinCE") configuration would be `"win*"`. However **`"win*"` also matches "WindowedApp"**. Prefer using the term `"vs*"` to check for configurations targeting Windows. @@ -428,10 +441,10 @@ for rule listed commands are executed. **Scope:** solutions, projects, configurations #### Arguments -*input_file* - source file that should be "compiled" with custom task -*output_file* - generated file name -*dependency* - additional dependencies, that can be used as parameters to commands -*command* - command list, special functions in commands are : +*input_file* - source file that should be "compiled" with custom task +*output_file* - generated file name +*dependency* - additional dependencies, that can be used as parameters to commands +*command* - command list, special functions in commands are : $(<) - input file $(@) - output file $(1) - $(9) - additional dependencies @@ -537,7 +550,7 @@ GMAKE specific. Adds dependency between source file and any other file. **Scope:** solutions, projects, configurations #### Arguments -*main_file* - name of source file that depends of other file +*main_file* - name of source file that depends of other file *depending_of* - name of dependency file #### Examples @@ -630,7 +643,16 @@ Specifies build flags to modify the compiling or linking process. Multiple calls #### Arguments _flags_ - List of flag names from list below. Names are case-insensitive and ignored if not supported on a platform. +* _AntBuildDebuggable_ - Enables Visual Studio projects targetting Android to be debugged using the NVIDIA Nsight Tegra tools. ([#321](https://github.com/bkaradzic/GENie/pull/321)) * _C7DebugInfo_ - Enables C7 compatible debug info for MSVC builds. +* _Cpp11_ - Enable usage of C++11 features. +* _Cpp14_ - Enable usage of C++14 features. +* _Cpp17_ - Enable usage of C++17 features. +* _Cpp20_ - Enable usage of C++20 features. +* _CppLatest_ - Enable usage of latest C++ features. +* _DebugEnvsDontMerge_ - Cause Visual Studio projects to not merge debug environment with the one inherited from the parent process. (i.e. sets `Project Properties > Debugging > Merge Environment` to `false`) +* _DebugEnvsInherit_ - Cause Visual Studio projects to inherit debug environment. (i.e. sets in `Project Properties > Debugging > Environment > Edit > Inherit from parent of project defaults` to `true`) +* _DeploymentContent_ - Mark files with `DeploymentContent` flag in the project file. (For C++ Win Store apps) ([#139](https://github.com/bkaradzic/GENie/pull/139)) * _EnableMinimalRebuild_ - Enable Visual Studio's minimal rebuild feature. * _EnableSSE, EnableSSE2, EnableAVX, EnableAVX2_ - Enable SSE/AVX instruction sets * _ExtraWarnings_ - Sets compiler's max warning level. @@ -641,7 +663,6 @@ _flags_ - List of flag names from list below. Names are case-insensitive and ign * _GenerateMapFiles_ - Enable .map file outputs from the Visual Studio linker. * _LinkSupportCircularDependencies_ - Enables the linker to iterate over provided libs in order to resolve circular dependencies (make and ninja only). * _Managed_ - Enable Managed C++ (.NET). -* _MFC_ - Enable support for Microsoft Foundation Classes. * _MinimumWarnings_ - - Sets compiler's minimum warning level (Visual Studio only). * _NativeWChar, NoNativeWChar_ - Toggle support for the wchar data type. * _No64BitChecks_ - Disable 64-bit portability warnings. @@ -651,6 +672,7 @@ _flags_ - List of flag names from list below. Names are case-insensitive and ign * _NoFramePointer_ - Disable the generation of stack frame pointers. * _NoImportLib_ - Prevent the generation of an import library for a Windows DLL. * _NoIncrementalLink_ - Disable support for Visual Studio's incremental linking feature. +* _NoJMC_ - Disable Visual Studio's 'Just my Code' feature. * _NoManifest_ - Prevent the generation of a manifest for Windows executables and shared libraries. * _NoMultiProcessorCompilation_ - Disables Visual Studio's and FastBuild's multiprocessor compilation. * _NoPCH_ - Disable precompiled headers. @@ -671,8 +693,8 @@ _flags_ - List of flag names from list below. Names are case-insensitive and ign * _Unsafe_ - Enable the use of unsafe code in .NET applications. * _UnsignedChar_ - Force `char`s to be `unsigned` by default. * _UseFullPaths_ - Enable absolute paths for `__FILE__`. -* _UseLDResponseFile_ - Enable use of response file (aka @file) for linking lib dependencies (make only). -* _UseObjectResponseFile_ - Enable use of response file (aka @file) for linking objects (make only). +* _UseLDResponseFile_ - Enable use of response file (aka @file) for linking lib dependencies (make and ninja). +* _UseObjectResponseFile_ - Enable use of response file (aka @file) for linking objects (make and ninja). * _WinMain_ - Use WinMain() as the entry point for Windows applications, rather than main(). **Note:** When not set, options will default to the tool default. @@ -903,7 +925,7 @@ Sets the kind of binary object being created by the project, such as a console o _kind_ - project kind identifier. One of: * _ConsoleApp_ - console executable -* _WindowedApp_ - application that runs in a desktop window. Does not apply on Linux. +* _WindowedApp_ - application that runs in a window (Windows, Android, MacOS and iOS). Does not apply on Linux. * _StaticLib_ - static library * _SharedLib_ - shared library or DLL * _Bundle_ - Xcode: Cocoa Bundle, everywhere else: alias to _SharedLib_ @@ -1287,8 +1309,11 @@ _identifiers_ - list of hardware platform specifiers from this list: * _Xbox360_ - Xbox 360 compiler and linker under Visual Studio * _PowerPC_ - PowerPC processors * _ARM_ - ARM-based processors +* _ARM64_ - ARM64-based processors * _Orbis_ - Playstation 4 * _Durango_ - Xbox One +* _NX32_ - Nintendo Switch 32-bit +* _NX64_ - Nintendo Switch 64-bit #### Return Value Current list of target platforms for the active solution @@ -1899,11 +1924,11 @@ xcodetargetopts { --- ### xcodescriptphases({{_cmd_, {_inputpaths_, ...}}}) #### XCode only -Adds a script phase to the generated XCode project file. +Adds a script phase to the generated XCode project file. One tag can contain several commands with different inputpaths. #### Arguments -_cmd_ - The actual command to run. (This can be a shell script file or direct shell code). +_cmd_ - The actual command to run. (This can be a shell script file or direct shell code). _inputpaths_ - The paths passed to the command #### Examples @@ -1948,11 +1973,11 @@ done --- ### xcodecopyresources({{_targetpath_, {_inputfiles_, ...}}}) #### XCode only -Adds a 'Copy Files' phase to the generated XCode project file. +Adds a 'Copy Files' phase to the generated XCode project file. One tag can contain several target paths with different input files. #### Arguments -_targetpath_ - The target path relative to the _Resource_ folder in the resulting `.app` structure. +_targetpath_ - The target path relative to the _Resource_ folder in the resulting `.app` structure. _inputfiles_ - The input files to be copied. #### Examples diff --git a/3rdparty/genie/makefile b/3rdparty/genie/makefile index 48f6fb84122..9df2558f272 100644 --- a/3rdparty/genie/makefile +++ b/3rdparty/genie/makefile @@ -54,7 +54,7 @@ release-windows release-darwin: $(GENIE) release-linux: $(GENIE) $(SILENT) $(GENIE) release - $(SILENT) $(MAKE) -C build/$(PROJECT_TYPE).darwin clean all CC=x86_64-apple-darwin15-clang + $(SILENT) $(MAKE) -C build/$(PROJECT_TYPE).darwin clean all CC=x86_64-apple-darwin20.2-clang $(SILENT) $(MAKE) -C build/$(PROJECT_TYPE).linux clean all $(SILENT) $(MAKE) -C build/$(PROJECT_TYPE).windows clean all CC=x86_64-w64-mingw32-gcc $(SILENT) git checkout src/host/version.h diff --git a/3rdparty/genie/scripts/genie.lua b/3rdparty/genie/scripts/genie.lua index de537253079..291dd526bac 100644 --- a/3rdparty/genie/scripts/genie.lua +++ b/3rdparty/genie/scripts/genie.lua @@ -78,7 +78,7 @@ linkoptions { "-rdynamic" } configuration "linux" - define { "_FILE_OFFSET_BITS=64" } + defines { "_FILE_OFFSET_BITS=64" } configuration "macosx" targetdir "../bin/darwin" diff --git a/3rdparty/genie/src/_manifest.lua b/3rdparty/genie/src/_manifest.lua index 5d4a1ba5f41..b247364452c 100644 --- a/3rdparty/genie/src/_manifest.lua +++ b/3rdparty/genie/src/_manifest.lua @@ -65,7 +65,7 @@ "actions/vstudio/vs2015.lua", "actions/vstudio/vs2017.lua", "actions/vstudio/vs2019.lua", - "actions/vstudio/vsllvm.lua", + "actions/vstudio/vs2022.lua", -- Xcode action "actions/xcode/_xcode.lua", @@ -76,11 +76,9 @@ "actions/xcode/xcode8.lua", "actions/xcode/xcode9.lua", "actions/xcode/xcode10.lua", - - --FASTBuild action - "actions/fastbuild/_fastbuild.lua", - "actions/fastbuild/fastbuild_project.lua", - "actions/fastbuild/fastbuild_solution.lua", + "actions/xcode/xcode11.lua", + "actions/xcode/xcode14.lua", + "actions/xcode/xcode15.lua", -- ninja action "actions/ninja/_ninja.lua", @@ -90,9 +88,7 @@ "actions/ninja/ninja_swift.lua", "actions/ninja/ninja_swift_incremental.lua", - -- qbs action - "actions/qbs/_qbs.lua", - "actions/qbs/qbs_base.lua", - "actions/qbs/qbs_solution.lua", - "actions/qbs/qbs_cpp.lua", + -- jcdb action + "actions/jcdb/_jcdb.lua", + "actions/jcdb/jcdb_solution.lua", } diff --git a/3rdparty/genie/src/actions/cmake/cmake_project.lua b/3rdparty/genie/src/actions/cmake/cmake_project.lua index e40486bfea9..33aa3ba916f 100644 --- a/3rdparty/genie/src/actions/cmake/cmake_project.lua +++ b/3rdparty/genie/src/actions/cmake/cmake_project.lua @@ -41,6 +41,14 @@ function cmake.list(value) end end +function cmake.listWrapped(value, prefix, postfix) + if #value > 0 then + return prefix .. table.concat(value, postfix .. prefix) .. postfix + else + return "" + end +end + function cmake.files(prj) local ret = {} local tr = premake.project.buildsourcetree(prj) @@ -63,9 +71,15 @@ end function cmake.header(prj) _p('# %s project autogenerated by GENie', premake.action.current().shortname) - _p('cmake_minimum_required(VERSION 2.8.4)') + _p('cmake_minimum_required(VERSION 3.15)') + if os.is("windows") then + -- Add support for CMP0091, see https://cmake.org/cmake/help/latest/policy/CMP0091.html + _p('cmake_policy(SET CMP0091 NEW)') + end _p('') _p('project(%s)', premake.esc(prj.name)) + _p('') + _p('include(GNUInstallDirs)') end function cmake.customtasks(prj) @@ -218,6 +232,7 @@ function cmake.project(prj) local commonIncludes = cmake.commonRules(configurations, includestr) local commonDefines = cmake.commonRules(configurations, definestr) + _p('') for _, cfg in ipairs(configurations) do @@ -258,14 +273,24 @@ function cmake.project(prj) if (prj.kind == 'StaticLib') then _p(1, 'add_library(%s STATIC ${source_list})', premake.esc(cfg.buildtarget.basename)) + -- Install + _p(1, 'install(TARGETS %s RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR})', premake.esc(cfg.buildtarget.basename)) end if (prj.kind == 'SharedLib') then _p(1, 'add_library(%s SHARED ${source_list})', premake.esc(cfg.buildtarget.basename)) + -- Install + _p(1, 'install(TARGETS %s RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR})', premake.esc(cfg.buildtarget.basename)) end if (prj.kind == 'ConsoleApp' or prj.kind == 'WindowedApp') then _p(1, 'add_executable(%s ${source_list})', premake.esc(cfg.buildtarget.basename)) - _p(1, 'target_link_libraries(%s%s%s)', premake.esc(cfg.buildtarget.basename), cmake.list(premake.esc(premake.getlinks(cfg, "siblings", "basename"))), cmake.list(cc.getlinkflags(cfg))) + + local libdirs = cmake.listWrapped(premake.esc(premake.getlinks(cfg, "all", "directory")), " -L\"../", "\"") + + _p(1, 'target_link_libraries(%s%s%s%s%s%s)', premake.esc(cfg.buildtarget.basename), libdirs, cmake.list(cfg.linkoptions), cmake.list(cc.getldflags(cfg)), cmake.list(premake.esc(premake.getlinks(cfg, "siblings", "basename"))), cmake.list(cc.getlinkflags(cfg))) + + -- Install + _p(1, 'install(TARGETS %s RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})', premake.esc(cfg.buildtarget.basename)) end _p('endif()') _p('') diff --git a/3rdparty/genie/src/actions/cmake/cmake_workspace.lua b/3rdparty/genie/src/actions/cmake/cmake_workspace.lua index b948f9194e5..ed3c882746f 100644 --- a/3rdparty/genie/src/actions/cmake/cmake_workspace.lua +++ b/3rdparty/genie/src/actions/cmake/cmake_workspace.lua @@ -11,15 +11,43 @@ function premake.cmake.workspace(sln) if (not f) then error(err, 0) end - f:write('# CMakeLists autogenerated by GENie\n') - f:write('cmake_minimum_required(VERSION 2.8.4)\n') - f:write('\n') + f:write([[ + # CMakeLists autogenerated by GENie + project(GENie) + cmake_minimum_required(VERSION 3.15) + + ######################################################################### + + # Set a default build type if none was specified + # Source: https://blog.kitware.com/cmake-and-the-default-build-type/ + set(default_build_type "Release") + if(EXISTS "${CMAKE_SOURCE_DIR}/.git") + set(default_build_type "Debug") + endif() + if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) + message(STATUS "Setting build type to '${default_build_type}' as none was specified.") + set(CMAKE_BUILD_TYPE "${default_build_type}" CACHE STRING "Choose the type of build." FORCE) + # Set the possible values of build type for cmake-gui + set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo") + endif() + + ######################################################################### + ]]) + if os.is("windows") then + -- Add support for CMP0091, see https://cmake.org/cmake/help/latest/policy/CMP0091.html + f:write('cmake_policy(SET CMP0091 NEW)\n') + end f:write('add_subdirectory('.. path.getrelative(_WORKING_DIR, sln.location) ..')\n') f:close() end - _p('# CMakeLists autogenerated by GENie') - _p('cmake_minimum_required(VERSION 2.8.4)') - _p('') + _p([[ + # CMakeLists autogenerated by GENie + cmake_minimum_required(VERSION 3.15) + ]]) + if os.is("windows") then + -- Add support for CMP0091, see https://cmake.org/cmake/help/latest/policy/CMP0091.html + _p('cmake_policy(SET CMP0091 NEW)') + end for i,prj in ipairs(sln.projects) do local name = premake.esc(prj.name) _p('add_subdirectory(%s)', name) diff --git a/3rdparty/genie/src/actions/fastbuild/_fastbuild.lua b/3rdparty/genie/src/actions/fastbuild/_fastbuild.lua deleted file mode 100644 index 5a422ac9db4..00000000000 --- a/3rdparty/genie/src/actions/fastbuild/_fastbuild.lua +++ /dev/null @@ -1,44 +0,0 @@ - premake.fastbuild = { } - local fastbuild = premake.fastbuild - - newaction - { - trigger = "vs2015-fastbuild", - shortname = "FASTBuild VS2015", - description = "Generate FASTBuild configuration files for Visual Studio 2015.", - - valid_kinds = { - "ConsoleApp", - "WindowedApp", - "StaticLib", - "SharedLib", - "Bundle", - }, - - valid_languages = { - "C", - "C++" - }, - - valid_tools = { - cc = { - "msc" - }, - }, - - onsolution = function(sln) - premake.generate(sln, "fbuild.bff", premake.fastbuild.solution) - end, - - onproject = function(prj) - premake.generate(prj, "%%.bff", premake.fastbuild.project) - end, - - oncleansolution = function(sln) - premake.clean.file(sln, "fbuild.bff") - end, - - oncleanproject = function(prj) - premake.clean.file(prj, "%%.bff") - end, - } diff --git a/3rdparty/genie/src/actions/fastbuild/fastbuild_project.lua b/3rdparty/genie/src/actions/fastbuild/fastbuild_project.lua deleted file mode 100644 index 1043b6f0bbc..00000000000 --- a/3rdparty/genie/src/actions/fastbuild/fastbuild_project.lua +++ /dev/null @@ -1,468 +0,0 @@ --- Generates a FASTBuild config file for a project. - --- Note that table order iteration should be deterministic, so the .bff file content is not --- arbitrarily changed each time it's generated. There are several places in this file --- where sorts are done for that reason. - --- Remaining flags to handle: --- NoImportLib = 1, --- NoIncrementalLink = 1, --- NoManifest = 1, --- NoPCH = 1, --- SingleOutputDir = 1, --- StaticATL = 1, --- Symbols = 1, --- Unicode = 1, --- Unsafe = 1, --- WinMain = 1, --- API todo: --- custombuildtask --- dependency - -local function add_trailing_backslash(dir) - if dir:len() > 0 and dir:sub(-1) ~= "\\" then - return dir.."\\" - end - return dir -end - -local function compile(indentlevel, prj, cfg, commonbasepath) - - local firstflag = true - for _, cfgexclude in ipairs(cfg.excludes) do - if path.issourcefile(cfgexclude) then - if firstflag then - _p(indentlevel, '// Excluded files:') - firstflag = false - end - _p(indentlevel, ".CompilerInputFiles - '%s'", cfgexclude) - end - end - if not firstflag then - _p('') - end - - _p(indentlevel, ".CompilerOutputPath = '%s'", add_trailing_backslash(cfg.objectsdir)) - - _p(indentlevel, ".Defines = ''") - for _, define in ipairs(cfg.defines) do - _p(indentlevel+1, "+ ' /D%s'", define) - end - - if cfg.kind == 'SharedLib' then - _p(indentlevel+1, "+ ' /D_WINDLL'") - end - - _p(indentlevel, ".IncludeDirs = ''") - local sortedincdirs = table.join(cfg.userincludedirs, cfg.includedirs, cfg.systemincludedirs) - - -- Setup for special include dir sort to ensure that 'nearby' dirs get precedence over others. - -- Gets the relative path from commonbasepath and counts the steps in that path. - local function getpathnodecount(p) - local nodefinder = string.gmatch(p, "[^\\/]+") - local result = 0 - local node = nodefinder() - while node do - result = result + ((node ~= '.' and 1) or 0) - node = nodefinder() - end - return result - end - - local stepsfrombase = {} - - for _, includedir in ipairs(sortedincdirs) do - stepsfrombase[includedir] = getpathnodecount(path.getrelative(commonbasepath, includedir)) - end - - local function includesort(a, b) - if stepsfrombase[a] == stepsfrombase[b] then - return a < b - else - return stepsfrombase[a] < stepsfrombase[b] - end - end - - table.sort(sortedincdirs, includesort) - for _, includedir in ipairs(sortedincdirs) do - _p(indentlevel+1, "+ ' /I\"%s\"'", includedir) - end - - _p(indentlevel+1, "+ .MSVCIncludes") - - local compileroptions = { - '"%1"', - '/nologo', - '/c', - '/Gm-', - '/Zc:inline', - '/errorReport:prompt', - '/FS', - } - - if cfg.options.ForceCPP then - table.insert(compileroptions, '/TP') - end - - if cfg.flags.PedanticWarnings - or cfg.flags.ExtraWarnings - then - table.insert(compileroptions, '/W4') - end - - if (cfg.flags.NativeWChar == false or - cfg.flags.NoNativeWChar) then - table.insert(compileroptions, '/Zc:wchar_t-') - end - - if (cfg.flags.EnableMinimalRebuild or - cfg.flags.NoMultiProcessorCompilation) then - -- Not compatible with FastBuild - end - - if cfg.flags.FloatFast then - table.insert(compileroptions, '/fp:fast') - elseif cfg.flags.FloatStrict then - table.insert(compileroptions, '/fp:strict') - else - table.insert(compileroptions, '/fp:precise') - end - - if cfg.flags.FastCall then - table.insert(compileroptions, '/Gr') - elseif cfg.flags.StdCall then - table.insert(compileroptions, '/Gd') - end - - if cfg.flags.UnsignedChar then - table.insert(compileroptions, '/J') - end - - if premake.config.isdebugbuild(cfg) then - if cfg.flags.StaticRuntime then - table.insert(compileroptions, '/MTd') - else - table.insert(compileroptions, '/MDd') - end - else - if cfg.flags.StaticRuntime then - table.insert(compileroptions, '/MT') - else - table.insert(compileroptions, '/MD') - end - end - - if cfg.flags.Symbols then - if (cfg.flags.C7DebugInfo) then - table.insert(compileroptions, '/Z7') - else - if premake.config.iseditandcontinue(cfg) then - table.insert(compileroptions, '/ZI') - else - table.insert(compileroptions, '/Zi') - end - local targetdir = add_trailing_backslash(cfg.buildtarget.directory) - table.insert(compileroptions, string.format("/Fd\"%s%s.pdb\"", targetdir, cfg.buildtarget.basename)) - end - end - - local isoptimised = true - if (cfg.flags.Optimize) then - table.insert(compileroptions, '/Ox') - elseif (cfg.flags.OptimizeSize) then - table.insert(compileroptions, '/O1') - elseif (cfg.flags.OptimizeSpeed) then - table.insert(compileroptions, '/O2') - else - isoptimised = false - end - - if isoptimised then - -- Refer to vstudio.vcxproj.lua about FunctionLevelLinking - if cfg.flags.NoOptimizeLink and cfg.flags.NoEditAndContinue then - table.insert(compileroptions, '/GF-') - table.insert(compileroptions, '/Gy-') - else - table.insert(compileroptions, '/GF') - table.insert(compileroptions, '/Gy') - end - else - table.insert(compileroptions, '/Gy') - table.insert(compileroptions, '/Od') - table.insert(compileroptions, '/RTC1') - end - - if cfg.flags.FatalWarnings then - table.insert(compileroptions, '/WX') - else - table.insert(compileroptions, '/WX-') - end - - if cfg.platform == 'x32' then - if cfg.flags.EnableSSE2 then - table.insert(compileroptions, '/arch:SSE2') - elseif cfg.flags.EnableSSE then - table.insert(compileroptions, '/arch:SSE') - end - end - - if cfg.flags.NoExceptions then - else - if cfg.flags.SEH then - table.insert(compileroptions, '/EHa') - else - table.insert(compileroptions, '/EHsc') - end - end - - if cfg.flags.NoRTTI then - table.insert(compileroptions, '/GR-') - else - table.insert(compileroptions, '/GR') - end - - if cfg.flags.NoFramePointer then - table.insert(compileroptions, '/Oy-') - else - table.insert(compileroptions, '/Oy') - end - - for _, addloption in ipairs(cfg.buildoptions) do - table.insert(compileroptions, addloption) - end - - _p(indentlevel, ".CompilerOptions = ''") - for _, option in ipairs(compileroptions) do - _p(indentlevel+1, "+ ' %s'", option) - end - - _p(indentlevel+1, "+ .IncludeDirs") - _p(indentlevel+1, "+ .Defines") - - if not cfg.flags.NoPCH and cfg.pchheader then - _p(indentlevel, ".CompilerInputFiles - '%s'", cfg.pchsource) - _p(indentlevel, ".PCHInputFile = '%s'", cfg.pchsource) - _p(indentlevel, ".PCHOutputFile = .CompilerOutputPath + '%s.pch'", prj.name) - _p(indentlevel, ".CompilerOptions + ' /Fp\"' + .CompilerOutputPath + '%s.pch\"'", prj.name) - _p(indentlevel, ".PCHOptions = .CompilerOptions") - _p(indentlevel+1, "+ ' /Yc\"%s\"'", cfg.pchheader) - _p(indentlevel+1, "+ ' /Fo\"%%3\"'") - _p(indentlevel, ".CompilerOptions + ' /Yu\"%s\"'", cfg.pchheader) - end - _p(indentlevel+1, "+ ' /Fo\"%%2\"'") -- make sure the previous property is .CompilerOptions -end - -local function library(prj, cfg, useconfig, commonbasepath) - _p(1, "Library('%s-%s-%s')", prj.name, cfg.name, cfg.platform) - _p(1, '{') - - useconfig(2) - compile(2, prj, cfg, commonbasepath) - - local librarianoptions = { - '"%1"', - '/OUT:"%2"', - '/NOLOGO', - } - - if cfg.platform == 'x64' then - table.insert(librarianoptions, '/MACHINE:X64') - else - table.insert(librarianoptions, '/MACHINE:X86') - end - - _p(2, ".LibrarianOptions = ''") - for _, option in ipairs(librarianoptions) do - _p(3, "+ ' %s'", option) - end - - _p(2, ".LibrarianOutput = '%s'", cfg.buildtarget.fullpath) - - _p(1, '}') - _p('') -end - -local function binary(prj, cfg, useconfig, bintype, commonbasepath) - _p(1, "ObjectList('%s_obj-%s-%s')", prj.name, cfg.name, cfg.platform) - _p(1, '{') - - useconfig(2) - compile(2, prj, cfg, commonbasepath) - - _p(1, '}') - _p('') - - _p(1, "%s('%s-%s-%s')", bintype, prj.name, cfg.name, cfg.platform) - _p(1, '{') - - useconfig(2) - _p(2, '.Libraries = {') - _p(3, "'%s_obj-%s-%s',", prj.name, cfg.name, cfg.platform) -- Refer to the ObjectList - - local sorteddeplibs = {} - for _, deplib in ipairs(premake.getlinks(cfg, "dependencies", "basename")) do - table.insert(sorteddeplibs, string.format("'%s-%s-%s',", deplib, cfg.name, cfg.platform)) - end - table.sort(sorteddeplibs) - for _, deplib in ipairs(sorteddeplibs) do - _p(3, deplib) - end - _p(3, '}') - - _p(2, '.LinkerLinkObjects = false') - - local linkeroptions = { - '"%1"', - '/OUT:"%2"', - '/NOLOGO', - '/errorReport:prompt', - } - - local subsystemversion = '",5.02"' - if cfg.platform == 'x32' then - subsystemversion = '",5.01"' - end - - if cfg.kind == 'ConsoleApp' then - table.insert(linkeroptions, '/SUBSYSTEM:CONSOLE'..subsystemversion) - else - table.insert(linkeroptions, '/SUBSYSTEM:WINDOWS'..subsystemversion) - end - - if cfg.kind == 'SharedLib' then - table.insert(linkeroptions, '/DLL') - end - - if cfg.platform == 'x64' then - table.insert(linkeroptions, '/MACHINE:X64') - else - table.insert(linkeroptions, '/MACHINE:X86') - end - - for _, libdir in ipairs(cfg.libdirs) do - table.insert(linkeroptions, string.format('/LIBPATH:%s', path.translate(libdir, '\\'))) - end - - if not cfg.flags.WinMain and (cfg.kind == 'ConsoleApp' or cfg.kind == 'WindowedApp') then - if cfg.flags.Unicode then - table.insert(linkeroptions, '/ENTRY:wmainCRTStartup') - else - table.insert(linkeroptions, '/ENTRY:mainCRTStartup') - end - end - - local deffile = premake.findfile(cfg, ".def") - if deffile then - table.insert(linkeroptions, '/DEF:%s', deffile) - end - - if (cfg.flags.Symbols ~= nil) then - table.insert(linkeroptions, '/DEBUG') - end - - if premake.config.islinkeroptimizedbuild(cfg.flags) then - table.insert(linkeroptions, '/OPT:REF') - table.insert(linkeroptions, '/OPT:ICF') - end - - table.insert(linkeroptions, '/INCREMENTAL'..((premake.config.isincrementallink(cfg) and '') or ':NO')) - - for _, addloption in ipairs(cfg.linkoptions) do - table.insert(linkeroptions, addloption) - end - - local linklibs = premake.getlinks(cfg, "all", "fullpath") - - for _, linklib in ipairs(linklibs) do - table.insert(linkeroptions, path.getname(linklib)) - end - - table.sort(linkeroptions) - - _p(2, ".LinkerOptions = ''") - for _, option in ipairs(linkeroptions) do - _p(3, "+ ' %s'", option) - end - _p(3, "+ .MSVCLibPaths") - - _p(2, ".LinkerOutput = '%s'", cfg.buildtarget.fullpath) - - _p(1, '}') - _p('') -end - -local function executable(prj, cfg, useconfig, commonbasepath) - binary(prj, cfg, useconfig, 'Executable', commonbasepath) -end - -local function dll(prj, cfg, useconfig, commonbasepath) - binary(prj, cfg, useconfig, 'DLL', commonbasepath) -end - -local function alias(prj, cfg, target) - _p(1, "Alias('%s-%s-%s')", prj.name, cfg.name, cfg.platform) - _p(1, '{') - _p(2, ".Targets = '%s'", target) - _p(1, '}') - _p('') -end - -function premake.fastbuild.project(prj) - io.indent = ' ' - _p('// FASTBuild project configuration file autogenerated by GENie.') - _p('') - - _p('{') - - local cppfiles = {} - for file in premake.project.eachfile(prj) do - if path.issourcefile(file.name) then - table.insert(cppfiles, file.name) - end - end - - local commonbasepath = cppfiles[1] - for _, file in ipairs(cppfiles) do - commonbasepath = path.getcommonbasedir(commonbasepath..'/', file) - end - - _p(1, ".CompilerInputFilesRoot = '%s/'", commonbasepath) - _p(1, '.CompilerInputFiles = {') - for _, file in ipairs(cppfiles) do - _p(2, "'%s',", file) - end - _p(1, '}') - _p('') - - local targetkindmap = { - ConsoleApp = executable, - WindowedApp = executable, - SharedLib = dll, - StaticLib = library, - } - - local useconfigmap = { - x32 = function(indentlevel) - _p(indentlevel, 'Using(.MSVCx86Config)') - _p('') - end, - x64 = function(indentlevel) - _p(indentlevel, 'Using(.MSVCx64Config)') - _p('') - end, - } - - local nativeplatform = (os.is64bit() and 'x64') or 'x32' - - for _, platform in ipairs(prj.solution.platforms) do - for cfg in premake.eachconfig(prj, platform) do - if cfg.platform == 'Native' then - alias(prj, cfg, string.format('%s-%s-%s', prj.name, cfg.name, nativeplatform)) - else - targetkindmap[prj.kind](prj, cfg, useconfigmap[cfg.platform], commonbasepath) - end - end - end - _p('}') - -end diff --git a/3rdparty/genie/src/actions/fastbuild/fastbuild_solution.lua b/3rdparty/genie/src/actions/fastbuild/fastbuild_solution.lua deleted file mode 100644 index b75b3d0dc8e..00000000000 --- a/3rdparty/genie/src/actions/fastbuild/fastbuild_solution.lua +++ /dev/null @@ -1,195 +0,0 @@ --- Generates a FASTBuild config file for a solution. - --- Note that table order iteration should be deterministic, so the .bff file content is not --- arbitrarily changed each time it's generated. There are several places in this file --- where sorts are done for that reason. - - function premake.fastbuild.solution(sln) - -- Presuppose we are building a fastbuild config for vs2015 only. - - io.indent = ' ' - _p('// FastBuild solution configuration file. Generated by GENie.') - _p('//------------------------------------------------------------------------------------') - _p('// %s', sln.name) - _p('//------------------------------------------------------------------------------------') - - _p('#import VS140COMNTOOLS') - - -- Create a batch file to run vcvarsall, and capture the variables it sets: - local is64bit = os.is64bit() - local target64 = (is64bit and ' amd64') or ' x86_amd64' - local target32 = (is64bit and ' amd64_x86') or '' - - local getvcvarscontent = [[ -@set INCLUDE= -@set LIB= -@set CommandPromptType= -@set PreferredToolArchitecture= -@set Platform= -@set Path=%SystemRoot%\System32;%SystemRoot%;%SystemRoot%\System32\wbem - -@call "%VS140COMNTOOLS%..\..\VC\vcvarsall.bat" %1 - -@echo %INCLUDE% -@echo %LIB% -@echo %CommandPromptType% -@echo %PreferredToolArchitecture% -@echo %Platform% -@echo %Path% -]] - - -- Save the temp file. - - local getvcvarsfilepath = os.getenv('TEMP')..'\\getvcvars.bat' - - local getvcvarsfile = assert(io.open(getvcvarsfilepath, 'w')) - getvcvarsfile:write(getvcvarscontent) - getvcvarsfile:close() - - local vcvarsrawx86 = os.outputof(string.format('call "%s"%s', getvcvarsfilepath, target32)) - local vcvarsrawx64 = os.outputof(string.format('call "%s"%s', getvcvarsfilepath, target64)) - - os.remove(getvcvarsfilepath) - - local msvcvars = {} - msvcvars.x32 = {} - msvcvars.x64 = {} - - local includeslibssplitter = string.gmatch(vcvarsrawx64, "[^\n]+") - msvcvars.x64.includesraw = includeslibssplitter() - msvcvars.x64.libpathsraw = includeslibssplitter() - msvcvars.x64.commandprompttype = includeslibssplitter() - msvcvars.x64.preferredtoolarchitecture = includeslibssplitter() - msvcvars.x64.platform = includeslibssplitter() - msvcvars.x64.pathraw = includeslibssplitter() - - includeslibssplitter = string.gmatch(vcvarsrawx86, "[^\n]+") - msvcvars.x32.includesraw = includeslibssplitter() - msvcvars.x32.libpathsraw = includeslibssplitter() - msvcvars.x32.commandprompttype = includeslibssplitter() - msvcvars.x32.preferredtoolarchitecture = includeslibssplitter() - msvcvars.x32.platform = includeslibssplitter() - msvcvars.x32.pathraw = includeslibssplitter() - - local function printincludes(includesraw) - _p(1, ".MSVCIncludes = ''") - for i in string.gmatch(includesraw, "[^;]+") do - _p(2, "+ ' /I\"%s\"'", i) - end - end - - local function printlibpaths(libpathsraw) - _p(1, ".MSVCLibPaths = ''") - for i in string.gmatch(libpathsraw, "[^;]+") do - _p(2, "+ ' /LIBPATH:\"%s\"'", i) - end - end - - if is64bit then - _p('.MSVCx64Config =') - _p('[') - _p(1, ".Compiler = '$VS140COMNTOOLS$..\\..\\VC\\bin\\amd64\\cl.exe'") - _p(1, ".Librarian = '$VS140COMNTOOLS$..\\..\\VC\\bin\\amd64\\lib.exe'") - _p(1, ".Linker = '$VS140COMNTOOLS$..\\..\\VC\\bin\\amd64\\link.exe'") - printincludes(msvcvars.x64.includesraw) - printlibpaths(msvcvars.x64.libpathsraw) - _p(']') - _p('') - - _p('.MSVCx86Config =') - _p('[') - _p(1, ".Compiler = '$VS140COMNTOOLS$..\\..\\VC\\bin\\amd64_x86\\cl.exe'") - _p(1, ".Librarian = '$VS140COMNTOOLS$..\\..\\VC\\bin\\amd64_x86\\lib.exe'") - _p(1, ".Linker = '$VS140COMNTOOLS$..\\..\\VC\\bin\\amd64_x86\\link.exe'") - printincludes(msvcvars.x32.includesraw) - printlibpaths(msvcvars.x32.libpathsraw) - _p(']') - _p('') - else - _p('.MSVCx64Config =') - _p('[') - _p(1, ".Compiler = '$VS140COMNTOOLS$..\\..\\VC\\bin\\x86_amd64\\cl.exe'") - _p(1, ".Librarian = '$VS140COMNTOOLS$..\\..\\VC\\bin\\x86_amd64\\lib.exe'") - _p(1, ".Linker = '$VS140COMNTOOLS$..\\..\\VC\\bin\\x86_amd64\\link.exe'") - printincludes(msvcvars.x64.includesraw) - printlibpaths(msvcvars.x64.libpathsraw) - _p(']') - _p('') - - _p('.MSVCx86Config =') - _p('[') - _p(1, ".Compiler = '$VS140COMNTOOLS$..\\..\\VC\\bin\\cl.exe'") - _p(1, ".Librarian = '$VS140COMNTOOLS$..\\..\\VC\\bin\\lib.exe'") - _p(1, ".Linker = '$VS140COMNTOOLS$..\\..\\VC\\bin\\link.exe'") - printincludes(msvcvars.x32.includesraw) - printlibpaths(msvcvars.x32.libpathsraw) - _p(']') - _p('') - end - - local msvcbin = '$VS140COMNTOOLS$..\\..\\VC\\bin' .. ((is64bit and '\\amd64') or '') - _p('#import Path') - _p('#import TMP') - _p('#import SystemRoot') - _p('') - _p('Settings') - _p('{') - _p(1, '.Environment = {') - _p(2, "'Path=%s;$Path$',", msvcbin) - _p(2, "'TMP=$TMP$',") - _p(2, "'SystemRoot=$SystemRoot$',") - _p(2, '}') - _p('}') - _p('') - - local function projkindsort(a, b) - local projvaluemap = { - ConsoleApp = 3, - WindowedApp = 3, - SharedLib = 2, - StaticLib = 1, - } - - if projvaluemap[a.kind] == projvaluemap[b.kind] then - return a.name < b.name - else - return projvaluemap[a.kind] < projvaluemap[b.kind] - end - end - - local sortedprojs = {} - for prj in premake.solution.eachproject(sln) do - table.insert(sortedprojs, prj) - end - - table.sort(sortedprojs, projkindsort) - - for _, prj in ipairs(sortedprojs) do - local fname = premake.project.getbasename(prj.name, '%%.bff') - fname = path.join(prj.location, fname) - fname = path.getrelative(sln.location, fname) - _p('#include "%s"', fname) - end - _p('') - - _p('.ProjectVariants = {') - for _, plat in ipairs(sln.platforms) do - for _, cfg in ipairs(sln.configurations) do - _p(1, "'%s-%s',", cfg, plat) - end - end - _p('}') - _p('') - - _p('ForEach(.Variant in .ProjectVariants)') - _p('{') - _p(1, "Alias('all-$Variant$')") - _p(1, '{') - _p(2, '.Targets = {') - for _, prj in ipairs(sortedprojs) do - _p(3, "'%s-$Variant$',", prj.name) - end - _p(2, '}') - _p(1, '}') - _p('}') - end diff --git a/3rdparty/genie/src/actions/jcdb/_jcdb.lua b/3rdparty/genie/src/actions/jcdb/_jcdb.lua new file mode 100644 index 00000000000..14a9eadbbc8 --- /dev/null +++ b/3rdparty/genie/src/actions/jcdb/_jcdb.lua @@ -0,0 +1,21 @@ +-- +-- _jcdb.lua +-- Define the compile_commands.json action(s). +-- Copyright (c) 2020 Johan Skoeld +-- + +newaction { + trigger = "jcdb", + shortname = "compile_commands.json", + description = "Generate a compile_commands.json file.", + + valid_kinds = { "ConsoleApp", "WindowedApp", "StaticLib", "SharedLib", "Bundle" }, + valid_languages = { "C", "C++" }, + valid_tools = { cc = { "gcc" } }, + + onsolution = function(sln) + local jsonpath = path.join(sln.location, "compile_commands.json") + premake.generate(sln, jsonpath, premake.jcdb.generate) + end, +} + diff --git a/3rdparty/genie/src/actions/jcdb/jcdb_solution.lua b/3rdparty/genie/src/actions/jcdb/jcdb_solution.lua new file mode 100644 index 00000000000..581dbd77f04 --- /dev/null +++ b/3rdparty/genie/src/actions/jcdb/jcdb_solution.lua @@ -0,0 +1,153 @@ +-- +-- jcdb_solution.lua +-- compile_commands.json functions. +-- Copyright (c) 2020 Johan Skoeld +-- + +premake.jcdb = {} + +local premake = premake +local jcdb = premake.jcdb + +local encode_chars = { + [0x22] = '\\"', + [0x5c] = "\\\\", + [0x08] = "\\b", + [0x0c] = "\\f", + [0x0a] = "\\n", + [0x0d] = "\\r", + [0x09] = "\\t", +} + +local function encode_string(s) + local res = '"' + + for _, cp in utf8.codes(s) do + if encode_chars[cp] then + res = res..encode_chars[cp] + elseif cp < 32 then + res = res..string.format("\\u%04x", cp) + else + res = res..utf8.char(cp) + end + end + + return res..'"' +end + +local function escape_cmdline_arg(s) + if s:find("%s") then + s = s:gsub("\\", "\\\\") + s = s:gsub('"', '\\"') + s = '"'..s..'"' + end + + return s +end + +local function list(tbl) + return iif(#tbl > 0, " "..table.concat(tbl, " "), "") +end + +local function build_command(cfg, cc, file) + local cmdline = "" + local function app(s) cmdline = cmdline..s end + + -- Compiler + if path.iscfile(file) or path.isasmfile(file) then + app(cc.cc) + else + app(cc.cxx) + end + + -- Flags / Defines / Includes + app(list(cc.getcppflags(cfg))) + app(list(cc.getdefines(cfg.defines))) + app(list(cc.getincludedirs(cfg.includedirs))) + app(list(cc.getquoteincludedirs(cfg.userincludedirs))) + app(list(cc.getsystemincludedirs(cfg.systemincludedirs))) + + -- Custom build options + app(list(cc.getcflags(cfg))) + + if path.iscppfile(file) then + app(list(cc.getcxxflags(cfg))) + end + + if path.isasmfile(file) then + app(list(cfg.buildoptions)) + app(list(cfg.buildoptions_asm)) + elseif path.isobjcfile(file) then + local opts = iif(path.iscfile(file), cfg.buildoptions_objc, cfg.buildoptions_objcpp) + app(list(cc.getobjcflags(cfg))) + app(list(cfg.buildoptions)) + app(list(opts)) + elseif path.iscfile(file) then + app(list(cfg.buildoptions)) + app(list(cfg.buildoptions_c)) + else + app(list(cfg.buildoptions)) + app(list(cfg.buildoptions_cpp)) + end + + -- Forced includes + if cfg.pchheader and not cfg.flags.NoPCH then + -- No need to worry about gch files or anything. Using the pch directly + -- should have the same behavior for our purposes. + app(" -include ") + app(escape_cmdline_arg(cfg.pchheader)) + end + + for _, i in ipairs(cfg.forcedincludes) do + app(" -include ") + app(escape_cmdline_arg(i)) + end + + -- Input / Output + local base = path.trimdots(path.removeext(file))..".o" + local output = path.join(cfg.objectsdir, base) + app(" -o ") + app(escape_cmdline_arg(output)) + app(" -c ") + app(escape_cmdline_arg(file)) + + return cmdline +end + +function jcdb.generate_config(prj, cfg, cc) + table.sort(cfg.files) + + local directory = path.getabsolute(prj.location) + + for _, file in ipairs(cfg.files) do + if path.iscppfile(file) or path.isasmfile(file) then + _p(' { "directory": %s,', encode_string(directory)) + _p(' "command": %s,', encode_string(build_command(cfg, cc, file))) + _p(' "file": %s },', encode_string(file)) + end + end +end + +function jcdb.generate_project(prj) + local cc = premake.gettool(prj) + local platforms = premake.filterplatforms(prj.solution, cc.platforms, "Native") + + for _, platform in ipairs(platforms) do + for cfg in premake.eachconfig(prj, platform) do + jcdb.generate_config(prj, cfg, cc) + end + end +end + +function jcdb.generate(sln) + for _, prj in ipairs(sln.projects) do + jcdb.generate_project(prj) + end + + -- Remove the last comma as JSON doesn't permit trailing commas + io.captured = io.captured:gsub(",%s$", "") + + -- Wrap in brackets + io.captured = "["..io.eol..io.captured..io.eol.."]" +end + diff --git a/3rdparty/genie/src/actions/make/_make.lua b/3rdparty/genie/src/actions/make/_make.lua index 63741e982cb..0f1a4b60519 100644 --- a/3rdparty/genie/src/actions/make/_make.lua +++ b/3rdparty/genie/src/actions/make/_make.lua @@ -47,10 +47,9 @@ return result else -- handle simple replacements - --result = value:gsub(" ", "\\ ") - --result = result:gsub("\"", "\\\"") - --return result - return value + result = value:gsub(" ", "\\ ") + result = result:gsub("\"", "\\\"") + return result end end diff --git a/3rdparty/genie/src/actions/make/make_cpp.lua b/3rdparty/genie/src/actions/make/make_cpp.lua index 880d9d35bf2..760ac9ad7ec 100644 --- a/3rdparty/genie/src/actions/make/make_cpp.lua +++ b/3rdparty/genie/src/actions/make/make_cpp.lua @@ -214,6 +214,10 @@ function premake.gmake_cpp_header(prj, cc, platforms) _p('# %s project makefile autogenerated by GENie', premake.action.current().shortname) + _p('') + + _p('.SUFFIXES:') -- Delete the default suffix rules. + _p('') -- set up the environment _p('ifndef config') diff --git a/3rdparty/genie/src/actions/make/make_csharp.lua b/3rdparty/genie/src/actions/make/make_csharp.lua index ea6a0fcf410..fcfac790d25 100644 --- a/3rdparty/genie/src/actions/make/make_csharp.lua +++ b/3rdparty/genie/src/actions/make/make_csharp.lua @@ -86,6 +86,9 @@ _p('# %s project makefile autogenerated by GENie', premake.action.current().shortname) _p('') + _p('.SUFFIXES:') -- Delete the default suffix rules. + _p('') + _p('ifndef config') _p(' config=%s', _MAKE.esc(prj.configurations[1]:lower())) _p('endif') diff --git a/3rdparty/genie/src/actions/make/make_swift.lua b/3rdparty/genie/src/actions/make/make_swift.lua index 3302c623b1c..4bfb00756f2 100644 --- a/3rdparty/genie/src/actions/make/make_swift.lua +++ b/3rdparty/genie/src/actions/make/make_swift.lua @@ -13,8 +13,12 @@ function premake.make_swift(prj) local platforms = premake.filterplatforms(prj.solution, tool.platforms, "Native") _p('# %s project makefile autogenerated by GENie', premake.action.current().shortname) + _p('') + + _p('.SUFFIXES:') -- Delete the default suffix rules. + _p('') --- set up the environment + -- set up the environment _p('ifndef config') _p(1, 'config=%s', _MAKE.esc(premake.getconfigname(prj.solution.configurations[1], platforms[1], true))) _p('endif') @@ -61,7 +65,7 @@ function premake.make_swift(prj) swift.generate_config(prj, cfg, tool) end end - + _p('.PHONY: ') _p('') _p('all: $(WORK_DIRS) $(TARGET)') @@ -78,7 +82,7 @@ function premake.make_swift(prj) end end _p('') - + local objfiles = {} _p('OBJECTS_WITNESS := $(OBJDIR)/build.stamp') _p('OBJECTS := \\') @@ -90,7 +94,7 @@ function premake.make_swift(prj) end end _p('') - + swift.file_rules(prj, objfiles) swift.linker(prj, tool) swift.generate_clean(prj) @@ -109,7 +113,7 @@ function swift.file_rules(prj, objfiles) _p(1, "$(SILENT) $(SWIFTC) -frontend -c $(SOURCES) -enable-objc-interop $(SDK) -I $(OUT_DIR) $(SWIFTC_FLAGS) -module-cache-path $(MODULECACHE_DIR) -D SWIFT_PACKAGE $(MODULE_MAPS) -emit-module-doc-path $(OUT_DIR)/$(MODULE_NAME).swiftdoc -module-name $(MODULE_NAME) -emit-module-path $(OUT_DIR)/$(MODULE_NAME).swiftmodule -num-threads 8 %s", table.arglist("-o", objfiles)) _p(1, "@mv -f $(OBJDIR)/data.tmp $(OBJECTS_WITNESS)") _p('') - + -- posix only for now _p('$(OBJECTS): $(OBJECTS_WITNESS)') _p(1, '@if test -f $@; then :; else \\') @@ -120,7 +124,7 @@ function swift.file_rules(prj, objfiles) end function swift.linker(prj, tool) - local lddeps = make.list(premake.getlinks(prj, "siblings", "fullpath")) + local lddeps = make.list(premake.getlinks(prj, "siblings", "fullpath")) if prj.kind == "StaticLib" then _p("$(TARGET): $(OBJECTS) %s ", lddeps) @@ -188,4 +192,4 @@ function swift.generate_config(prj, cfg, tool) _p('endif') _p('') -end \ No newline at end of file +end diff --git a/3rdparty/genie/src/actions/make/make_vala.lua b/3rdparty/genie/src/actions/make/make_vala.lua index a7a88c6ddac..308605802ef 100644 --- a/3rdparty/genie/src/actions/make/make_vala.lua +++ b/3rdparty/genie/src/actions/make/make_vala.lua @@ -3,6 +3,10 @@ -- Generate a Vala project makefile. -- + premake.make.vala = { } + premake.make.makefile_ignore = false + + local vala = premake.make.vala local make = premake.make function premake.make_vala(prj) @@ -13,46 +17,8 @@ -- build a list of supported target platforms that also includes a generic build local platforms = premake.filterplatforms(prj.solution, valac.platforms, "Native") - _p('# %s project makefile autogenerated by GENie', premake.action.current().shortname) - - -- set up the environment - _p('ifndef config') - _p(' config=%s', _MAKE.esc(premake.getconfigname(prj.solution.configurations[1], platforms[1], true))) - _p('endif') - _p('') - - _p('ifndef verbose') - _p(' SILENT = @') - _p('endif') - _p('') - - -- identify the shell type - _p('SHELLTYPE := msdos') - _p('ifeq (,$(ComSpec)$(COMSPEC))') - _p(' SHELLTYPE := posix') - _p('endif') - _p('ifeq (/bin,$(findstring /bin,$(SHELL)))') - _p(' SHELLTYPE := posix') - _p('endif') - _p('ifeq (/bin,$(findstring /bin,$(MAKESHELL)))') - _p(' SHELLTYPE := posix') - _p('endif') - _p('') - - _p('ifeq (posix,$(SHELLTYPE))') - _p(' MKDIR = $(SILENT) mkdir -p "$(1)"') - _p(' COPY = $(SILENT) cp -fR "$(1)" "$(2)"') - _p(' RM = $(SILENT) rm -f "$(1)"') - _p('else') - _p(' MKDIR = $(SILENT) mkdir "$(subst /,\\\\,$(1))" 2> nul || exit 0') - _p(' COPY = $(SILENT) copy /Y "$(subst /,\\\\,$(1))" "$(subst /,\\\\,$(2))"') - _p(' RM = $(SILENT) del /F "$(subst /,\\\\,$(1))" 2> nul || exit 0') - _p('endif') - _p('') - - _p('VALAC = %s', valac.valac) - _p('CC = %s', valac.cc) - _p('') + -- output build configurations + premake.gmake_vala_header(prj, valac, platforms) -- write configuration blocks for _, platform in ipairs(platforms) do @@ -61,30 +27,38 @@ end end - -- list sources - _p('SOURCES := \\') - for _, file in ipairs(prj.files) do - if path.issourcefile(file) then - -- check if file is excluded. - if not table.icontains(prj.excludes, file) then - -- if not excluded, add it. - _p('\t%s \\', _MAKE.esc(file)) - end + -- list object directories + local objdirs = {} + local additionalobjdirs = {} + for _, file in ipairs(prj.allfiles) do + if path.issourcefile(file) or path.isgresource(file) then + objdirs[_MAKE.esc(path.getdirectory(path.trimdots(file)))] = 1 end end + + _p('OBJDIRS := \\') + _p('\t$(OBJDIR) \\') + for dir, _ in iter.sortByKeys(objdirs) do + _p('\t$(OBJDIR)/%s \\', dir) + end + for dir, _ in iter.sortByKeys(additionalobjdirs) do + _p('\t%s \\', dir) + end _p('') -- main build rule(s) _p('.PHONY: clean prebuild prelink') _p('') - _p('all: prebuild prelink $(TARGET) | $(TARGETDIR)') + _p('all: $(OBJDIRS) $(TARGETDIR) prebuild prelink $(TARGET)') _p('\t@:') _p('') -- target build rule - _p('$(TARGET): $(SOURCES) | $(TARGETDIR)') - _p('\t$(SILENT) $(VALAC) -o $(TARGET) --cc=$(CC) $(FLAGS) $(SOURCES)') + _p('$(TARGET): $(OBJECTS) | $(TARGETDIR)') + _p('\t@echo Linking %s', prj.name) + _p('\t$(SILENT) $(LINKCMD)') + _p('\t$(POSTBUILDCMDS)') _p('') @@ -93,6 +67,13 @@ _p('$(TARGETDIR):') premake.make_mkdirrule("$(TARGETDIR)") + _p('$(OBJDIRS):') + if (not prj.solution.messageskip) or (not table.contains(prj.solution.messageskip, "SkipCreatingMessage")) then + _p('\t@echo Creating $(@)') + end + _p('\t-$(call MKDIR,$@)') + _p('') + -- clean target _p('clean:') if (not prj.solution.messageskip) or (not table.contains(prj.solution.messageskip, "SkipCleaningMessage")) then @@ -113,6 +94,67 @@ _p('prelink:') _p('\t$(PRELINKCMDS)') _p('') + + vala.fileRules(prj, valac) + end + + + +-- +-- Write the makefile header +-- + + function premake.gmake_vala_header(prj, valac, platforms) + _p('# %s project makefile autogenerated by GENie', premake.action.current().shortname) + _p('') + + _p('.SUFFIXES:') -- Delete the default suffix rules. + _p('') + + -- set up the environment + _p('ifndef config') + _p(' config=%s', _MAKE.esc(premake.getconfigname(prj.solution.configurations[1], platforms[1], true))) + _p('endif') + _p('') + + _p('ifndef verbose') + _p(' SILENT = @') + _p('endif') + _p('') + + -- identify the shell type + _p('SHELLTYPE := msdos') + _p('ifeq (,$(ComSpec)$(COMSPEC))') + _p(' SHELLTYPE := posix') + _p('endif') + _p('ifeq (/bin,$(findstring /bin,$(SHELL)))') + _p(' SHELLTYPE := posix') + _p('endif') + _p('ifeq (/bin,$(findstring /bin,$(MAKESHELL)))') + _p(' SHELLTYPE := posix') + _p('endif') + _p('') + + _p('ifeq (posix,$(SHELLTYPE))') + _p(' MKDIR = $(SILENT) mkdir -p "$(1)"') + _p(' COPY = $(SILENT) cp -fR "$(1)" "$(2)"') + _p(' RM = $(SILENT) rm -f "$(1)"') + _p('else') + _p(' MKDIR = $(SILENT) mkdir "$(subst /,\\\\,$(1))" 2> nul || exit 0') + _p(' COPY = $(SILENT) copy /Y "$(subst /,\\\\,$(1))" "$(subst /,\\\\,$(2))"') + _p(' RM = $(SILENT) del /F "$(subst /,\\\\,$(1))" 2> nul || exit 0') + _p('endif') + _p('') + + _p('VALAC = %s', valac.valac) + _p('CC = %s', valac.cc) + _p('GLIBRC = %s', valac.glibrc) + _p('') + + if (not premake.make.makefile_ignore) then + _p('MAKEFILE = %s', _MAKE.getmakefilename(prj, true)) + _p('') + end end @@ -121,16 +163,71 @@ -- Write a block of configuration settings. -- + local function is_excluded(prj, cfg, file) + if table.icontains(prj.excludes, file) then + return true + end + + if table.icontains(cfg.excludes, file) then + return true + end + + return false + end + function premake.gmake_valac_config(prj, cfg, valac) _p('ifeq ($(config),%s)', _MAKE.esc(cfg.shortname)) - _p(' TARGETDIR = %s', _MAKE.esc(cfg.buildtarget.directory)) - _p(' TARGET = $(TARGETDIR)/%s', _MAKE.esc(cfg.buildtarget.name)) + _p(' BASEDIR = %s', _MAKE.esc(path.getrelative(cfg.location, _WORKING_DIR))) + _p(' OBJDIR = %s', _MAKE.esc(cfg.objectsdir)) + _p(' TARGETDIR = %s', _MAKE.esc(cfg.buildtarget.directory)) + _p(' TARGET = $(TARGETDIR)/%s', _MAKE.esc(cfg.buildtarget.name)) _p(' DEFINES +=%s', make.list(valac.getdefines(cfg.defines))) _p(' VAPIDIRS +=%s', make.list(valac.getvapidirs(cfg.vapidirs))) _p(' PKGS +=%s', make.list(valac.getlinks(cfg.links))) - _p(' FLAGS += $(DEFINES) $(VAPIDIRS) $(PKGS)%s', make.list(table.join(valac.getvalaflags(cfg), valac.getbuildoptions(cfg.buildoptions), valac.getbuildoptions(cfg.buildoptions_c), cfg.buildoptions_vala))) + _p(' FLAGS += $(DEFINES) $(VAPIDIRS) $(PKGS)%s', make.list(table.join(valac.getvalaflags(cfg), cfg.buildoptions_vala))) + _p(' VALA_LDFLAGS= $(shell pkg-config --libs%s)', make.list(cfg.links)) + _p(' ALL_LDFLAGS+= $(LDFLAGS)%s $(VALA_LDFLAGS)', make.list(table.join(cfg.linkoptions))) + _p(' LINKOBJS = %s', "$(OBJECTS)") + _p(' VALA_CFLAGS = $(shell pkg-config --cflags%s)%s', make.list(cfg.links), make.list(valac.getvalaccflags(cfg))) + _p(' ALL_CFLAGS += $(CFLAGS) $(ARCH)%s $(VALA_CFLAGS)', make.list(table.join(cfg.buildoptions, cfg.buildoptions_c))) + _p(' LINKCMD = $(CC) -o $(TARGET) $(LINKOBJS) $(ARCH) $(ALL_LDFLAGS)'); + + table.sort(cfg.files) + + -- add objects for compilation, and remove any that are excluded per config. + _p(' OBJECTS := \\') + for _, file in ipairs(cfg.files) do + if path.issourcefile(file) or path.isgresource(file) then + if not is_excluded(prj, cfg, file) then + _p('\t$(OBJDIR)/%s.o \\' + , _MAKE.esc(path.trimdots(path.removeext(file))) + ) + end + end + end + _p('') + + _p(' SOURCES := \\') + for _, file in ipairs(cfg.files) do + if path.issourcefile(file) and path.isvalafile(file) then + if not is_excluded(prj, cfg, file) then + _p('\t%s \\', _MAKE.esc(file)) + end + end + end + _p('') + + _p(' GRESOURCES := \\') + for _, file in ipairs(cfg.files) do + if path.isgresource(file) then + if not is_excluded(prj, cfg, file) then + _p('\t%s \\', _MAKE.esc(file)) + end + end + end + _p('') _p(' define PREBUILDCMDS') if #cfg.prebuildcommands > 0 then @@ -156,3 +253,109 @@ _p('endif') _p('') end + + + +-- +-- Build command for a single file. +-- + + function vala.fileRules(prj, cc) + local platforms = premake.filterplatforms(prj.solution, cc.platforms, "Native") + + _p('ifneq (,$(OBJRESP))') + _p('$(OBJRESP): $(OBJECTS) | $(TARGETDIR) $(OBJDIRS)') + _p('\t$(SILENT) echo $^') + _p('\t$(SILENT) echo $^ > $@') + _p('endif') + _p('') + + _p('ifneq (,$(LDRESP))') + _p('$(LDRESP): $(LDDEPS) | $(TARGETDIR) $(OBJDIRS)') + _p('\t$(SILENT) echo $^') + _p('\t$(SILENT) echo $^ > $@') + _p('endif') + _p('') + + local pattern_targets = "" + table.sort(prj.allfiles) + for _, file in ipairs(prj.allfiles or {}) do + if path.issourcefile(file) or path.isgresource(file) then + if path.isvalafile(file) or path.iscfile(file) or path.isgresource(file) then + if path.isvalafile(file) or path.isgresource(file) then + _p('$(OBJDIR)/%s.o: $(OBJDIR)/%s.c $(GCH) $(MAKEFILE) | $(OBJDIR)/%s' + , _MAKE.esc(path.trimdots(path.removeext(file))) + , _MAKE.esc(path.trimdots(path.removeext(file))) + , _MAKE.esc(path.getdirectory(path.trimdots(file))) + ) + if not path.isgresource(file) then + pattern_targets = pattern_targets + .. "$(OBJDIR)/" + .. _MAKE.esc(path.trimdots(path.removeext(file))) + .. ".% \\\n" -- Pattern rule: https://stackoverflow.com/a/3077254 + end + else + _p('$(OBJDIR)/%s.o: %s $(GCH) $(MAKEFILE) | $(OBJDIR)/%s' + , _MAKE.esc(path.trimdots(path.removeext(file))) + , file + , _MAKE.esc(path.getdirectory(path.trimdots(file))) + ) + end + if prj.msgcompile then + _p('\t@echo ' .. prj.msgcompile) + else + _p('\t@echo $(notdir $<)') + end + _p('\t$(SILENT) %s $(FORCE_INCLUDE) -o "$@" -c "$<"' + , "$(CC) $(ALL_CFLAGS)" + , _MAKE.esc(path.getbasename(file)) + ) + for _, task in ipairs(prj.postcompiletasks or {}) do + _p('\t$(SILENT) %s', task) + _p('') + end + _p('') + + if path.isgresource(file) then + _p('$(OBJDIR)/%s.c: %s $(GCH) $(MAKEFILE) | $(OBJDIR)/%s' + , _MAKE.esc(path.trimdots(path.removeext(file))) + , _MAKE.esc(file) + , _MAKE.esc(path.getdirectory(path.trimdots(file))) + ) + if prj.msgcompile then + _p('\t@echo ' .. prj.msgcompile) + else + _p('\t@echo $(notdir $<)') + end + _p('\t$(SILENT) %s "$<" --target="$@" --sourcedir="%s" --generate' + , "$(GLIBRC)" + , _MAKE.esc(path.getdirectory(file)) + ) + for _, task in ipairs(prj.postcompiletasks or {}) do + _p('\t$(SILENT) %s', task) + _p('') + end + end + + _p('') + end + end + end + + if pattern_targets ~= "" then + -- Generate .c from corresponding .vala + _p('%s: $(SOURCES) $(GRESOURCES) $(GCH) $(MAKEFILE)', pattern_targets) + if prj.msgcompile then + _p('\t@echo ' .. prj.msgcompile) + else + _p('\t@echo [GEN] valac') + end + _p('\t$(SILENT) %s $(SOURCES) --directory $(OBJDIR) --basedir $(BASEDIR) --gresources=$(GRESOURCES) -C' + , "$(VALAC) $(FLAGS)" + ) + for _, task in ipairs(prj.postcompiletasks or {}) do + _p('\t$(SILENT) %s', task) + _p('') + end + end + end diff --git a/3rdparty/genie/src/actions/ninja/ninja_cpp.lua b/3rdparty/genie/src/actions/ninja/ninja_cpp.lua index 5db216fb453..a0134f34e54 100644 --- a/3rdparty/genie/src/actions/ninja/ninja_cpp.lua +++ b/3rdparty/genie/src/actions/ninja/ninja_cpp.lua @@ -53,7 +53,6 @@ end } _p("") - _p("# core rules for " .. cfg.name) _p("rule cc") _p(" command = " .. wrap_ninja_cmd(tool.cc .. " $defines $includes $flags -MMD -MF $out.d -c -o $out $in")) @@ -67,12 +66,20 @@ end _p(" depfile = $out.d") _p(" deps = gcc") _p("") - _p("rule ar") - _p(" command = " .. wrap_ninja_cmd(tool.ar .. " $flags $out @$out.rsp " .. (os.is("MacOSX") and " 2>&1 > /dev/null | sed -e '/.o) has no symbols$$/d'" or ""))) - _p(" description = ar $out") - _p(" rspfile = $out.rsp") - _p(" rspfile_content = $in $libs") - _p("") + + if cfg.flags.UseObjectResponseFile then + _p("rule ar") + _p(" command = " .. wrap_ninja_cmd(tool.ar .. " $flags $out @$out.rsp " .. (os.is("MacOSX") and " 2>&1 > /dev/null | sed -e '/.o) has no symbols$$/d'" or ""))) + _p(" description = ar $out") + _p(" rspfile = $out.rsp") + _p(" rspfile_content = $in $libs") + _p("") + else + _p("rule ar") + _p(" command = " .. wrap_ninja_cmd(tool.ar .. " $flags $out $in $libs" .. (os.is("MacOSX") and " 2>&1 > /dev/null | sed -e '/.o) has no symbols$$/d'" or ""))) + _p(" description = ar $out") + _p("") + end local link = iif(cfg.language == "C", tool.cc, tool.cxx) _p("rule link") @@ -82,11 +89,19 @@ end startgroup = '-Wl,--start-group' endgroup = '-Wl,--end-group' end - _p(" command = " .. wrap_ninja_cmd("$pre_link " .. link .. " -o $out @$out.rsp $all_ldflags $post_build")) - _p(" description = link $out") - _p(" rspfile = $out.rsp") - _p(" rspfile_content = $all_outputfiles $walibs" .. string.format("%s $libs %s", startgroup, endgroup)) - _p("") + + local rspfile_content = "$all_outputfiles $walibs " .. string.format("%s $libs %s", startgroup, endgroup) + if cfg.flags.UseLDResponseFile then + _p(" command = " .. wrap_ninja_cmd("$pre_link " .. link .. " -o $out @$out.rsp $all_ldflags $post_build")) + _p(" description = link $out") + _p(" rspfile = $out.rsp") + _p(" rspfile_content = %s", rspfile_content) + _p("") + else + _p(" command = " .. wrap_ninja_cmd("$pre_link " .. link .. " -o $out " .. rspfile_content .. " $all_ldflags $post_build")) + _p(" description = link $out") + _p("") + end _p("rule exec") _p(" command = " .. wrap_ninja_cmd("$command")) @@ -134,14 +149,16 @@ end function cpp.custombuildtask(prj, cfg) local cmd_index = 1 - local seen_commands = {} - local command_by_name = {} - local command_files = {} + + local ninja_rules = {} + local ninja_builds = {} local prebuildsuffix = #cfg.prebuildcommands > 0 and "||__prebuildcommands_" .. premake.esc(prj.name) or "" for _, custombuildtask in ipairs(prj.custombuildtask or {}) do for _, buildtask in ipairs(custombuildtask or {}) do + + local commands = {} for _, cmd in ipairs(buildtask[4] or {}) do local num = 1 @@ -155,63 +172,40 @@ end cmd = string.gsub(cmd, '%$%(<%)', '$in') cmd = string.gsub(cmd, '%$%(@%)', '$out') - local cmd_name -- shortened command name - - -- generate shortened rule names for the command, may be nonsensical - -- in some cases but it will at least be unique. - if seen_commands[cmd] == nil then - local _, _, name = string.find(cmd, '([.%w]+)%s') - name = 'cmd' .. cmd_index .. '_' .. string.gsub(name, '[^%w]', '_') - - seen_commands[cmd] = { - name = name, - index = cmd_index, - } - - cmd_index = cmd_index + 1 - cmd_name = name - else - cmd_name = seen_commands[cmd].name - end - - local index = seen_commands[cmd].index - - if command_files[index] == nil then - command_files[index] = {} - end + table.insert(commands, cmd) + end - local cmd_set = command_files[index] + ninja_rules["cmd_" .. cmd_index] = commands - table.insert(cmd_set, { - buildtask[1], - buildtask[2], - buildtask[3], - seen_commands[cmd].name, - }) + table.insert(ninja_builds, { + file_in = buildtask[1], + file_out = buildtask[2], + rule = "cmd_" .. cmd_index, + deps = buildtask[3] + }) - command_files[index] = cmd_set - command_by_name[cmd_name] = cmd - end + cmd_index = cmd_index + 1 end end _p("# custom build rules") - for command, details in pairs(seen_commands) do - _p("rule " .. details.name) - _p(1, "command = " .. wrap_ninja_cmd(command)) + + for rule, commands in pairs(ninja_rules) do + _p("rule " .. rule) + _p(1, "command = " .. wrap_ninja_cmd(table.concat(commands, " && "))) end - for cmd_index, cmdsets in ipairs(command_files) do - for _, cmdset in ipairs(cmdsets) do - local file_in = path.getrelative(cfg.location, cmdset[1]) - local file_out = path.getrelative(cfg.location, cmdset[2]) - local deps = '' - for i, dep in ipairs(cmdset[3]) do - deps = deps .. path.getrelative(cfg.location, dep) .. ' ' - end - _p("build " .. file_out .. ': ' .. cmdset[4] .. ' ' .. file_in .. ' | ' .. deps .. prebuildsuffix) - _p("") + + for i = 1,#ninja_builds do + local build = ninja_builds[i] + + local deps = '' + for i, dep in ipairs(build.deps) do + deps = deps .. path.getrelative(cfg.location, dep) .. ' ' end + + _p("build " .. path.getrelative(cfg.location, build.file_out) .. ': ' .. build.rule .. ' ' .. path.getrelative(cfg.location, build.file_in) .. ' | ' .. deps .. prebuildsuffix) + _p("") end end @@ -303,7 +297,7 @@ end local extra_deps = #cfg.extra_deps and '| ' .. table.concat(cfg.extra_deps[objfilename] or {}, ' ') or '' local order_deps = #cfg.order_deps and '|| ' .. table.concat(cfg.order_deps[objfilename] or {}, ' ') or '' local extra_flags = #cfg.extra_flags and ' ' .. table.concat(cfg.extra_flags[objfilename] or {}, ' ') or '' - + local cflags = "cflags" if path.isobjcfile(file) then _p("build " .. objfilename .. ": cxx " .. file .. extra_deps .. order_deps) @@ -317,7 +311,7 @@ end _p("build " .. objfilename .. ": cxx " .. file .. extra_deps .. order_deps) cflags = "cxxflags" end - + _p(1, "flags = " .. flags[cflags] .. extra_flags) _p(1, "includes = " .. flags.includes) _p(1, "defines = " .. flags.defines) @@ -331,7 +325,7 @@ end function cpp.linker(prj, cfg, objfiles, tool) local all_ldflags = ninja.list(table.join(tool.getlibdirflags(cfg), tool.getldflags(cfg), cfg.linkoptions)) - local prebuildsuffix = #cfg.prebuildcommands > 0 and "||__prebuildcommands" or "" + local prebuildsuffix = #cfg.prebuildcommands > 0 and ("||__prebuildcommands_" .. premake.esc(prj.name)) or "" local libs = {} local walibs = {} local lddeps = {} diff --git a/3rdparty/genie/src/actions/qbs/_qbs.lua b/3rdparty/genie/src/actions/qbs/_qbs.lua deleted file mode 100644 index 8f1ba4b5e0b..00000000000 --- a/3rdparty/genie/src/actions/qbs/_qbs.lua +++ /dev/null @@ -1,41 +0,0 @@ --- --- GENie - Project generator tool --- https://github.com/bkaradzic/GENie#license --- - -premake.qbs = { } - -local qbs = premake.qbs - -newaction -{ - -- Metadata for the command line and help system - trigger = "qbs", - shortname = "qbs", - description = "Generate QBS build files", - module = "qbs", - - -- The capabilities of this action - valid_kinds = {"ConsoleApp", "WindowedApp", "StaticLib", "SharedLib", "Bundle"}, - valid_languages = {"C", "C++"}, - valid_tools = { - cc = { "gcc", "msc" }, - }, - - -- Solution and project generation logic - onsolution = function(sln) - io.eol = "\n" - io.indent = "\t" - io.escaper(qbs.esc) - premake.generate(sln, sln.name .. ".creator.qbs", qbs.generate_solution) - io.indent = " " - premake.generate(sln, sln.name .. ".creator.qbs.user", qbs.generate_user) - end, - - onproject = function(prj) - io.eol = "\n" - io.indent = "\t" - io.escaper(qbs.esc) - premake.generate(prj, prj.name .. ".qbs", qbs.generate_project) - end, -} diff --git a/3rdparty/genie/src/actions/qbs/qbs_base.lua b/3rdparty/genie/src/actions/qbs/qbs_base.lua deleted file mode 100644 index ca24748ecea..00000000000 --- a/3rdparty/genie/src/actions/qbs/qbs_base.lua +++ /dev/null @@ -1,9 +0,0 @@ -function premake.qbs.list(indent, name, table) - if #table > 0 then - _p(indent, '%s: [', name) - for _, item in ipairs(table) do - _p(indent+1, '"%s",', item:gsub('"', '\\"')) - end - _p(indent+1, ']') - end -end \ No newline at end of file diff --git a/3rdparty/genie/src/actions/qbs/qbs_cpp.lua b/3rdparty/genie/src/actions/qbs/qbs_cpp.lua deleted file mode 100644 index 4d76e178728..00000000000 --- a/3rdparty/genie/src/actions/qbs/qbs_cpp.lua +++ /dev/null @@ -1,285 +0,0 @@ --- --- GENie - Project generator tool --- https://github.com/bkaradzic/GENie#license --- - -local qbs = premake.qbs - -local function is_excluded(prj, cfg, file) - if table.icontains(prj.excludes, file) then - return true - end - - if table.icontains(cfg.excludes, file) then - return true - end - - return false -end - -function qbs.generate_project(prj) - - local indent = 0 - - _p(indent, '/*') - _p(indent, ' * QBS project file autogenerated by GENie') - _p(indent, ' * https://github.com/bkaradzic/GENie') - _p(indent, ' */') - _p(indent, '') - _p(indent, 'import qbs 1.0') - _p(indent, '') - - if prj.kind == "ConsoleApp" then - _p(indent, 'CppApplication {') - _p(indent + 1, 'consoleApplication: true') - elseif prj.kind == "WindowedApp" then - _p(indent, 'CppApplication {') - _p(indent + 1, 'consoleApplication: false') - elseif prj.kind == "StaticLib" then - _p(indent, 'StaticLibrary {') - elseif prj.kind == "SharedLib" then - _p(indent, 'DynamicLibrary {') - end - - indent = indent + 1 - _p(indent, 'name: "' .. prj.name .. '"') - --- _p(indent, 'cpp.enableReproducibleBuilds: true') - - _p(indent, 'Depends { name: "cpp" }') - - -- List dependencies, if there are any - local deps = premake.getdependencies(prj) - if #deps > 0 then - for _, depprj in ipairs(deps) do - _p(indent, 'Depends { name: "%s" }', depprj.name) - end - end - - local cc = premake.gettool(prj) - local platforms = premake.filterplatforms(prj.solution, cc.platforms, "Native") - - for _, platform in ipairs(platforms) do - for cfg in premake.eachconfig(prj, platform) do - - if cfg.platform ~= "Native" then - - _p(''); - _p(indent, 'Properties { /* %s */', premake.getconfigname(cfg.name, cfg.platform, true)) - - indent = indent + 1 - - local arch = "" - local linkerFlags = cfg.linkoptions - - if cfg.platform == "x32" then - arch = '&& qbs.architecture == "x86"' --- table.insert(linkerFlags, "-m32") - elseif cfg.platform == "x64" then - arch = '&& qbs.architecture == "x86_64"' --- table.insert(linkerFlags, "-m64") - end - - if cfg.name == "Debug" then - _p(indent, 'condition: qbs.buildVariant == "debug" %s', arch) - else - _p(indent, 'condition: qbs.buildVariant == "release" %s', arch) - end - - _p(indent, 'targetName: "%s"', cfg.buildtarget.basename) - _p(indent, 'destinationDirectory: "%s"', path.getabsolute('projects/qbs/' .. cfg.buildtarget.directory) .. '/') --- _p(indent, 'fileTagsFilter: "application"') --- _p(indent, 'qbs.install: true') --- _p(indent, 'qbs.installDir: "%s"', cfg.buildtarget.directory) --- _p(indent, 'buildDirectory: "%s"', cfg.objectsdir) - --- qbs.list( --- indent --- , "cpp.cppFlags" --- , cc.getcppflags(cfg) --- ) - - if cfg.flags.Cpp11 then - _p(indent, 'cpp.cxxLanguageVersion: "c++11"') - elseif cfg.flags.Cpp14 then - _p(indent, 'cpp.cxxLanguageVersion: "c++14"') - elseif cfg.flags.Cpp17 then - _p(indent, 'cpp.cxxLanguageVersion: "c++17"') - else - _p(indent, 'cpp.cxxLanguageVersion: "c++98"') - end - - if os.is("windows") then - if not cfg.flags.WinMain and (cfg.kind == 'ConsoleApp' or cfg.kind == 'WindowedApp') then - if cfg.flags.Unicode then - _p(indent, 'cpp.entryPoint: "wmainCRTStartup"') - else - _p(indent, 'cpp.entryPoint: "mainCRTStartup"') - end - end - end - - qbs.list( - indent - , "cpp.commonCompilerFlags" - , cfg.buildoptions - ) - - qbs.list( - indent - , "cpp.cFlags" - , cfg.buildoptions_c - ) - - qbs.list( - indent - , "cpp.cxxFlags" - , cfg.buildoptions_cpp - ) - - qbs.list( - indent - , "cpp.objcFlags" - , cfg.buildoptions_objc - ) - - qbs.list( - indent - , "cpp.objcxxFlags" - , cfg.buildoptions_objc - ) - - if cfg.flags.StaticRuntime then - _p(indent, 'cpp.runtimeLibrary: "static"') - else - _p(indent, 'cpp.runtimeLibrary: "dynamic"') - end - - if cfg.flags.PedanticWarnings - or cfg.flags.ExtraWarnings - then - _p(indent, 'cpp.warningLevel: "all"') - else - _p(indent, 'cpp.warningLevel: "default"') - end - - if cfg.flags.FatalWarnings then - _p(indent, 'cpp.treatWarningsAsErrors: true') - else - _p(indent, 'cpp.treatWarningsAsErrors: false') - end - - if cfg.flags.NoRTTI then - _p(indent, 'cpp.enableRtti: false') - else - _p(indent, 'cpp.enableRtti: true') - end - - if cfg.flags.NoExceptions then - _p(indent, 'cpp.enableExceptions: false') - else - _p(indent, 'cpp.enableExceptions: true') - end - - if cfg.flags.Symbols then - _p(indent, 'cpp.debugInformation: true') - else - _p(indent, 'cpp.debugInformation: false') - end - - if cfg.flags.Unicode then - _p(indent, 'cpp.windowsApiCharacterSet: "unicode"') - else - _p(indent, 'cpp.windowsApiCharacterSet: ""') - end - - if not cfg.pchheader or cfg.flags.NoPCH then - _p(indent, 'cpp.usePrecompiledHeader: false') - else - _p(indent, 'cpp.usePrecompiledHeader: true') - _p(indent, 'Group {') - _p(indent+1, 'name: "PCH"') - _p(indent+1, 'files: ["' .. cfg.pchheader .. '"]') - _p(indent+1, 'fileTags: ["cpp_pch_src"]') - _p(indent, '}') - end - - for _, value in ipairs(cfg.flags) do - if (value == "Optimize") then - elseif (value == "OptimizeSize") then - _p(indent, 'cpp.optimization: "small"') - elseif (value == "OptimizeSpeed") then - _p(indent, 'cpp.optimization: "fast"') - end - end - - qbs.list( - indent - , "cpp.defines" - , cfg.defines - ) - - local sortedincdirs = table.join(cfg.userincludedirs, cfg.includedirs, cfg.systemincludedirs) - table.sort(sortedincdirs, includesort) - qbs.list( - indent - , "cpp.includePaths" - , sortedincdirs - ) - - qbs.list( - indent - , "cpp.staticLibraries" - , premake.getlinks(cfg, "system", "fullpath") - ) - - qbs.list( - indent - , "cpp.libraryPaths" - , cfg.libdirs - ) - - qbs.list( - indent - , "cpp.linkerFlags" - , linkerFlags - ) - - table.sort(prj.files) - if #prj.files > 0 then - _p(indent, 'files: [') - for _, file in ipairs(prj.files) do - if path.iscfile(file) - or path.iscppfile(file) - or path.isobjcfile(file) - or path.isresourcefile(file) - or path.iscppheader(file) then - if not is_excluded(prj, cfg, file) then - _p(indent+1, '"%s",', file) - end - end - end - _p(indent+1, ']') - end - - if #prj.excludes > 0 then - _p(indent, 'excludeFiles: [') - table.sort(prj.excludes) - for _, file in ipairs(prj.excludes) do - if path.issourcefile(file) then - _p(indent+1, '"%s",', file) - end - end - _p(indent+1, ']') - end - - indent = indent - 1 - _p(indent, '}'); - end - end - end - - indent = indent - 1 - - _p(indent, '}') -end diff --git a/3rdparty/genie/src/actions/qbs/qbs_solution.lua b/3rdparty/genie/src/actions/qbs/qbs_solution.lua deleted file mode 100644 index d912617dae1..00000000000 --- a/3rdparty/genie/src/actions/qbs/qbs_solution.lua +++ /dev/null @@ -1,251 +0,0 @@ --- --- GENie - Project generator tool --- https://github.com/bkaradzic/GENie#license --- - -local qbs = premake.qbs - -function qbs.generate_solution(sln) - - _p('/*') - _p(' * QBS project file autogenerated by GENie') - _p(' * https://github.com/bkaradzic/GENie') - _p(' */') - _p('') - _p('import qbs') - _p('') - - _p(0, 'Project {') - - _p(1, 'references: [') - for prj in premake.solution.eachproject(sln) do - _p(2, '"' .. prj.name .. '.qbs",') - end - _p(1, ']') - - _p(0, '}') -end - -local function is_app(kind) - if kind == "ConsoleApp" or kind == "WindowedApp" then - return true - end - - return false -end - -function qbs.generate_user(sln) - - _p(0, '') - _p(0, '') - _p(0, '') - _p(0, '') - - local startProject = 0 - local idx = 0 - - for prj in premake.solution.eachproject(sln) do - if is_app(prj.kind) then - if sln.startproject == prj.name then - startProject = idx - end - idx = idx + 1 - end - end - - _p(1, '') - _p(2, 'ProjectExplorer.Project.Target.0') - - _p(2, '') - - _p(3, 'Desktop') - _p(3, 'Desktop') - - local qbsguid = "" - local qbsprofile = "" - - local qtcreatordir = "" - - if _OS == "windows" then - qtcreatordir = path.join(os.getenv("APPDATA"), "QtProject/qtcreator") - else - qtcreatordir = path.join(os.getenv("HOME"), ".config/QtProject/qtcreator") - end - - local file = io.open(path.join(qtcreatordir, "qbs.conf")) - if file == nil then - file = io.open(path.join(qtcreatordir, "qbs/1.6.0/qbs.conf")) - end - - if file ~= nil then - for line in file:lines() do - if line == "[org]" then - -- BK - Need to figure out how to extract kit associated profile name/guid... - -- ~.config/QtProject/qtcreator/qbs.conf - -- - -- [org] - -- qt-project\qbs\preferences\qtcreator\kit\%7B9926e565-8fc0-448d-9d5d-4b0293efd443%7D=qtc_Desktop_1bffddf2 - -- - local str = 'qt-project\\qbs\\preferences\\qtcreator\\kit\\%' - local index = string.len(str)+1 - for line in file:lines() do - if index == string.find(line, '7B', index) then - line = string.sub(line, index+2) - qbsguid = string.sub(line, 1, 36) - qbsprofile = string.sub(line, 41) - --print(qbsguid, qbsprofile) - break - end - end - else - -- ~/.config/QtProject/qtcreator/qbs/1.6.0/qbs.conf - -- - -- org.qt-project.qbs.preferences.qtcreator.kit.{d67ae030-7a33-43e0-850a-afe9e47fe5e1} - -- qtc_Desktop_ee88281c - - local str = '\torg.qt-project.qbs.preferences.qtcreator.kit.' - local index = string.len(str)+1 - for line in file:lines() do - if qbsguid == "" and index == string.find(line, '{', index) then - line = string.sub(line, index+1) - qbsguid = string.sub(line, 1, 36) - elseif qbsguid ~= "" then - qbsprofile = string.sub(line, 10, 29) - --print(qbsguid, qbsprofile) - break - end - end - end - - break - end - io.close(file) - end - - _p(3, '{%s}', qbsguid) - - _p(3, '0') - _p(3, '0') - _p(3, '%d', startProject) - - -- BuildConfiguration - idx = 0 - for _, cfgname in ipairs(sln.configurations) do - -- cfg.objectsdir - _p(3, '', idx) - _p(4, 'build') - _p(4, '') - _p(5, '') - _p(6, 'true') - _p(6, '') - _p(6, 'Qbs Build') - _p(6, 'Qbs.BuildStep') - _p(6, 'false') - _p(6, '') - _p(7, '%s', cfgname:lower()) - _p(7, '%s', qbsprofile) - _p(6, '') - _p(5, '') - _p(5, '1') - _p(5, 'Build') - _p(5, '') - _p(5, 'ProjectExplorer.BuildSteps.Build') - _p(4, '') - _p(4, '') - _p(5, '') - _p(6, 'true') - _p(6, '') - _p(6, 'Qbs Clean') - _p(6, 'Qbs.CleanStep') - _p(6, 'true') - _p(6, 'false') - _p(6, 'false') - _p(5, '') - _p(5, '1') - _p(5, 'Clean') - _p(5, '') - _p(5, 'ProjectExplorer.BuildSteps.Clean') - _p(4, '') - _p(4, '2') - _p(4, 'false') - _p(4, '') - _p(4, '%s', cfgname) - _p(4, '') - _p(4, 'Qbs.QbsBuildConfiguration') - _p(3, '') - - idx = idx + 1 - end - - _p(3, '%d', idx) - - -- DeployConfiguration - _p(3, '') - _p(4, '') - _p(5, '0') - _p(5, 'Deploy') - _p(5, '') - _p(5, 'ProjectExplorer.BuildSteps.Deploy') - _p(4, '') - _p(4, '1') - _p(4, 'Deploy locally') - _p(4, 'Qbs Install') - _p(4, 'Qbs.Deploy') - _p(3, '') - _p(3, '1') - - -- PluginSettings --- _p(3, '') - - -- RunConfiguration - idx = 0 - for prj in premake.solution.eachproject(sln) do - - if is_app(prj.kind) then --- _p(3, 'ProjectExplorer.Project.Target.%d', idx) - - _p(3, '', idx) - - if idx == startProject then - _p(4, '2') - else - _p(4, '-1') - end - _p(4, '') - _p(4, '%s', prj.name) - _p(4, '') - _p(4, 'Qbs.RunConfiguration:%s.%s---Qbs.RC.NameSeparator---%s', prj.name, qbsprofile, prj.name) - - _p(4, '') - - local cfg = premake.getconfig(prj, nil, nil) - if cfg.debugdir ~= nil then - _p(4, '%s', cfg.debugdir) - else - _p(4, '') - end - - _p(3, '') - - idx = idx + 1 - end - end - - _p(3, '%d', idx) - - _p(2, '') - _p(1, '') - - _p(1, '') - _p(2, 'ProjectExplorer.Project.TargetCount') - _p(2, '1') - _p(1, '') - - _p(1, '') - _p(2, 'Version') - _p(2, '18') - _p(1, '') - - _p(0, '') - -end diff --git a/3rdparty/genie/src/actions/vstudio/_vstudio.lua b/3rdparty/genie/src/actions/vstudio/_vstudio.lua index 94bf748dc57..337fda88731 100644 --- a/3rdparty/genie/src/actions/vstudio/_vstudio.lua +++ b/3rdparty/genie/src/actions/vstudio/_vstudio.lua @@ -17,7 +17,7 @@ vs2015 = "v140", vs2017 = "v141", vs2019 = "v142", - vsllvm = "llvm", + vs2022 = "v143", } premake.vstudio.toolset = toolsets[_ACTION] or "unknown?" premake.vstudio.splashpath = '' @@ -32,21 +32,25 @@ -- vstudio.platforms = { - any = "Any CPU", - mixed = "Mixed Platforms", - Native = "Win32", - x86 = "x86", - x32 = "Win32", - x64 = "x64", - PS3 = "PS3", - Xbox360 = "Xbox 360", - ARM = "ARM", - Orbis = "ORBIS", - Durango = "Durango", - TegraAndroid = "Tegra-Android", - NX32 = "NX32", - NX64 = "NX64", - Emscripten = "Emscripten", + any = "Any CPU", + mixed = "Mixed Platforms", + Native = "Win32", + x86 = "x86", + x32 = "Win32", + x64 = "x64", + PS3 = "PS3", + Xbox360 = "Xbox 360", + ARM = "ARM", + ARM64 = "ARM64", + Orbis = "ORBIS", + Durango = "Durango", + TegraAndroid = "Tegra-Android", + NX32 = "NX32", + NX64 = "NX64", + Emscripten = "Emscripten", + ["gdk-desktop"] = "Gaming.Desktop.x64", + ["gdk-xboxone"] = "Gaming.Xbox.XboxOne.x64", + ["gdk-scarlett"] = "Gaming.Xbox.Scarlett.x64", } @@ -72,6 +76,27 @@ + function vstudio.isgdkconsole(cfg) + for _,p in pairs({"gdk-xboxone", "gdk-scarlett"}) do + if cfg.platform == p then + return true + end + end + return false + end + + + + function vstudio.isgdkdesktop(cfg) + return cfg.platform == "gdk-desktop" + end + + + + function vstudio.isgdk(cfg) + return vstudio.isgdkconsole(cfg) or vstudio.isgdkdesktop(cfg) + end + -- -- Process the solution's list of configurations and platforms, creates a list -- of build configuration/platform pairs in a Visual Studio compatible format. diff --git a/3rdparty/genie/src/actions/vstudio/vsllvm.lua b/3rdparty/genie/src/actions/vstudio/vs2022.lua similarity index 74% rename from 3rdparty/genie/src/actions/vstudio/vsllvm.lua rename to 3rdparty/genie/src/actions/vstudio/vs2022.lua index d6c6d1ddb53..2e0d3e940fd 100644 --- a/3rdparty/genie/src/actions/vstudio/vsllvm.lua +++ b/3rdparty/genie/src/actions/vstudio/vs2022.lua @@ -1,22 +1,22 @@ -- --- vsllvm.lua --- Baseline support for Visual Studio LLVM. +-- vs2022.lua +-- Baseline support for Visual Studio 2022. -- - premake.vstudio.vcllvm = {} - local vcllvm = premake.vstudio.vcllvm + premake.vstudio.vc2022 = {} + local vc2022 = premake.vstudio.vc2022 local vstudio = premake.vstudio --- --- Register a command-line action for Visual Studio llvm. +-- Register a command-line action for Visual Studio 2022. --- newaction { - trigger = "vsllvm", - shortname = "Visual Studio LLVM", - description = "Generate Microsoft Visual Studio LLVM project files", + trigger = "vs2022", + shortname = "Visual Studio 2022", + description = "Generate Microsoft Visual Studio 2022 project files", os = "windows", valid_kinds = { "ConsoleApp", "WindowedApp", "StaticLib", "SharedLib", "Bundle" }, @@ -55,10 +55,10 @@ vstudio = { solutionVersion = "12", - targetFramework = "4.5.2", - toolsVersion = "15.0", - windowsTargetPlatformVersion = "8.1", + targetFramework = "4.7.2", + toolsVersion = "16.0", + windowsTargetPlatformVersion = "10.0", supports64bitEditContinue = true, - intDirAbsolute = true, + intDirAbsolute = false, } } diff --git a/3rdparty/genie/src/actions/vstudio/vstudio_solution.lua b/3rdparty/genie/src/actions/vstudio/vstudio_solution.lua index 8115798c8a2..a7162cc8ede 100644 --- a/3rdparty/genie/src/actions/vstudio/vstudio_solution.lua +++ b/3rdparty/genie/src/actions/vstudio/vstudio_solution.lua @@ -85,8 +85,10 @@ function sln2005.header(sln) local action = premake.action.current() _p('Microsoft Visual Studio Solution File, Format Version %d.00', action.vstudio.solutionVersion) - if(_ACTION:sub(3) == "2015" or _ACTION:sub(3) == "2017" or _ACTION:sub(3) == "llvm") then + if(_ACTION:sub(3) == "2015" or _ACTION:sub(3) == "2017") then _p('# Visual Studio %s', action.vstudio.toolsVersion:sub(1,2)) + elseif(_ACTION:sub(3) == "2019") then + _p('# Visual Studio Version %s', action.vstudio.toolsVersion:sub(1,2)) else _p('# Visual Studio %s', _ACTION:sub(3)) end @@ -199,6 +201,10 @@ if premake.vstudio.iswinrt() and prj.kind == "WindowedApp" then _p('\t\t{%s}.%s.Deploy.0 = %s|%s', prj.uuid, cfg.name, cfg.buildcfg, mapped) end + + if premake.vstudio.isgdk(cfg) and prj.kind == "WindowedApp" then + _p('\t\t{%s}.%s.Deploy.0 = %s|%s', prj.uuid, cfg.name, cfg.buildcfg, mapped) + end end end end @@ -258,4 +264,4 @@ end _p('\tEndGlobalSection') - end \ No newline at end of file + end diff --git a/3rdparty/genie/src/actions/vstudio/vstudio_vcxproj.lua b/3rdparty/genie/src/actions/vstudio/vstudio_vcxproj.lua index 678d54f364a..dd9c1c63097 100644 --- a/3rdparty/genie/src/actions/vstudio/vstudio_vcxproj.lua +++ b/3rdparty/genie/src/actions/vstudio/vstudio_vcxproj.lua @@ -66,13 +66,6 @@ else _p(2, 'Win32Proj') end - if _ACTION:sub(3) == "2015" or _ACTION:sub(3) == "2017" or _ACTION:sub(3) == "2019" or _ACTION:sub(3) == "llvm" then - _p(2,'x64') - end - if (_ACTION:sub(3) == "2017" or _ACTION:sub(3) == "llvm") - and os.isdir(path.join(os.getenv("VSINSTALLDIR"), "VC/Tools/MSVC/14.14.26428")) then - _p(2,'14.14.26428') - end if not vstudio.xpwarning then _p(2, 'false') @@ -123,7 +116,8 @@ , premake.esc(cfginfo.name)) local is2019 = premake.action.current() == premake.action.get("vs2019") - if is2019 then + local is2022 = premake.action.current() == premake.action.get("vs2022") + if is2019 or is2022 then _p(2, '%s', action.vstudio.toolsVersion) if cfg.flags.UnitySupport then _p(2, 'true') @@ -137,14 +131,6 @@ _p(2, 'x64') end - if cfg.flags.MFC then - _p(2,'%s', iif(cfg.flags.StaticRuntime, "Static", "Dynamic")) - end - - if cfg.flags.ATL or cfg.flags.StaticATL then - _p(2,'%s', iif(cfg.flags.StaticATL, "Static", "Dynamic")) - end - if cfg.flags.Unicode then _p(2,'Unicode') end @@ -201,7 +187,8 @@ if #cfg.propertysheets > 0 then local dirs = cfg.propertysheets for _, dir in ipairs(dirs) do - _p(2,'', path.translate(dir)) + local translated = path.translate(dir) + _p(2,'', translated, translated) end end @@ -245,6 +232,14 @@ _p(2,'%s', tostring(ignore)) end + if cfg.platform == "NX32" or cfg.platform == "NX64" then + if cfg.flags.Cpp17 then + _p(2,'Gnu++17') + elseif cfg.flags.Cpp20 then + _p(2,'Gnu++20') + end + end + if cfg.platform == "Durango" then _p(2, '$(Console_SdkLibPath);$(Console_SdkWindowsMetadataPath)') _p(2, '$(Console_SdkLibPath)') @@ -266,6 +261,19 @@ _p(2, 'true') end + if vstudio.isgdkconsole(cfg) then + _p(2, '$(Console_SdkRoot)bin;$(Console_SdkToolPath);$(ExecutablePath)') + _p(2, '$(Console_SdkIncludeRoot)') + _p(2, '$(Console_SdkLibPath);$(Console_SdkWindowsMetadataPath)') + _p(2, '$(Console_SdkLibPath)') + _p(2, '$(Console_SdkLibPath);$(Console_SdkWindowsMetadataPath)') + end + + if vstudio.isgdkdesktop(cfg) then + _p(2, '$(Console_SdkIncludeRoot);$(IncludePath)') + _p(2, '$(Console_SdkLibPath);$(LibraryPath)') + end + if cfg.kind ~= "StaticLib" then _p(2,'%s', tostring(premake.config.isincrementallink(cfg))) end @@ -333,6 +341,13 @@ end end + local function include_resdirs(indent,cfg) + if #cfg.resincludedirs> 0 then + _p(indent,'%s;%%(AdditionalIncludeDirectories)' + ,premake.esc(path.translate(table.concat(cfg.resincludedirs, ";"), '\\'))) + end + end + local function using_dirs(indent,cfg) if #cfg.usingdirs > 0 then _p(indent,'%s;%%(AdditionalUsingDirectories)' @@ -343,15 +358,17 @@ local function resource_compile(cfg) _p(2,'') preprocessor(3,cfg,true) - include_dirs(3,cfg) + include_resdirs(3,cfg) _p(2,'') end - local function cppstandard_vs2017_or_2019(cfg) + local function cppstandard(cfg) if cfg.flags.CppLatest then _p(3, 'stdcpplatest') _p(3, 'true') + elseif cfg.flags.Cpp20 then + _p(3, 'stdcpp20') elseif cfg.flags.Cpp17 then _p(3, 'stdcpp17') elseif cfg.flags.Cpp14 then @@ -368,6 +385,12 @@ if cfg.flags.NoExceptions then _p(3, 'false') end + elseif cfg.platform == "NX32" or cfg.platform == "NX64" then + if cfg.flags.NoExceptions then + _p(3, 'false') + else + _p(3, 'true') + end else if cfg.flags.NoExceptions then _p(3, 'false') @@ -419,6 +442,10 @@ end elseif cfg.platform == "TegraAndroid" then -- TODO: tegra setting + elseif cfg.platform == "NX32" or cfg.platform == "NX64" then + if cfg.flags.FloatFast then + _p(3, 'true') + end else if cfg.flags.FloatFast then _p(3,'Fast') @@ -487,6 +514,11 @@ _p(3,'%s', tostring(cfg.flags.Symbols ~= nil)) end + if cfg.platform == "NX32" or cfg.platform == "NX64" then + unsignedChar = "-funsigned-char "; + _p(3,'%s', tostring(cfg.flags.Symbols ~= nil)) + end + if cfg.language == "C" and not cfg.options.ForceCPP then buildoptions = table.join(buildoptions, cfg.buildoptions_c) else @@ -528,6 +560,17 @@ else _p(3,'O2') end + elseif cfg.platform == "NX32" or cfg.platform == "NX64" then + local opt = optimisation(cfg) + if opt == "Disabled" then + _p(3,'O0') + elseif opt == "MinSpace" then + _p(3,'Os') + elseif opt == "MaxSpeed" then + _p(3,'O3') + else + _p(3,'O2') + end else _p(3,'%s', optimisation(cfg)) end @@ -613,6 +656,23 @@ if cfg.flags.FatalWarnings then _p(3, 'true') end + elseif cfg.platform == "NX32" or cfg.platform == "NX64" then + if cfg.flags.PedanticWarnings then + _p(3, 'MoreWarnings') + _p(3, 'true') + elseif cfg.flags.ExtraWarnings then + _p(3, 'NormalWarnings') + _p(3, 'true') + elseif cfg.flags.MinimumWarnings then + _p(3, 'WarningsOff') + _p(3, 'false') + else + _p(3, 'NormalWarnings') + _p(3, 'false') + end + if cfg.flags.FatalWarnings then + _p(3, 'true') + end else if cfg.flags.PedanticWarnings then _p(3, 'EnableAllWarnings') @@ -630,8 +690,9 @@ end if premake.action.current() == premake.action.get("vs2017") or - premake.action.current() == premake.action.get("vs2019") then - cppstandard_vs2017_or_2019(cfg) + premake.action.current() == premake.action.get("vs2019") or + premake.action.current() == premake.action.get("vs2022") then + cppstandard(cfg) end exceptions(cfg) @@ -642,10 +703,6 @@ floating_point(cfg) debug_info(cfg) - if _ACTION:sub(3) == "llvm" then - _p(3,'false') - end - if cfg.flags.Symbols then -- The compiler pdb should be different than the linker pdb, and -- the linker pdb is what should be distributed and used for @@ -727,16 +784,13 @@ end end - local function item_def_lib(prj, cfg) + local function item_def_lib(cfg) -- The Xbox360 project files are stored in another place in the project file. if cfg.kind == 'StaticLib' and cfg.platform ~= "Xbox360" then _p(1,'') _p(2,'$(OutDir)%s',cfg.buildtarget.name) additional_options(2,cfg) link_target_machine(2,cfg) - if _ACTION:sub(3) == "llvm" and prj.name == "portaudio" then -- MSVC-LLVM needs special help - _p(2,'ksuser.lib;%%(AdditionalDependencies)') - end _p(1,'') end end @@ -833,7 +887,7 @@ -- _WIN64: For 64-bit platforms -- _EXPORT: `EXPORT` for shared libraries, empty for other project kinds table.insertflat(defines, iif(premake.config.isdebugbuild(cfg), "_DEBUG", {})) - table.insert(defines, iif(cfg.platform == "x64", "_WIN64", "_WIN32")) + table.insert(defines, iif(cfg.platform == "x64" or cfg.platform == "ARM64", "_WIN64", "_WIN32")) table.insert(defines, iif(prj.kind == "SharedLib", "_EXPORT=EXPORT", "_EXPORT=")) _p(3, '%s;%%(PreprocessorDefinitions)' @@ -878,12 +932,12 @@ function vc2010.link(cfg) local vs2017OrLater = premake.action.current() == premake.action.get("vs2017") or premake.action.current() == premake.action.get("vs2019") - local vsllvm = premake.action.current() == premake.action.get("vsllvm") local links = getcfglinks(cfg) _p(2,'') _p(3,'%s', iif(cfg.kind == "ConsoleApp", "Console", "Windows")) - if (vs2017OrLater or vsllvm) and cfg.flags.FullSymbols then + + if vs2017OrLater and cfg.flags.FullSymbols then _p(3,'DebugFull') else _p(3,'%s', tostring(cfg.flags.Symbols ~= nil)) @@ -1019,15 +1073,18 @@ deps = "-Wl,--start-group;" .. deps .. ";-Wl,--end-group" end - _p(tab, '%s;%s' - , deps - , iif(cfg.platform == "Durango" - , '%(XboxExtensionsDependencies)' - , '%(AdditionalDependencies)' - ) - ) + local adddeps = + iif(cfg.platform == "Durango", '%(XboxExtensionsDependencies)' + , iif(vstudio.isgdkconsole(cfg), '$(Console_Libs);%(XboxExtensionsDependencies);%(AdditionalDependencies)' + , iif(vstudio.isgdkdesktop(cfg), '$(Console_Libs);%(AdditionalDependencies)' + , '%(AdditionalDependencies)'))) + _p(tab, '%s;%s', deps, adddeps) elseif cfg.platform == "Durango" then _p(tab, '%%(XboxExtensionsDependencies)') + elseif vstudio.isgdkconsole(cfg) then + _p(tab, '$(Console_Libs);%%(XboxExtensionsDependencies);%%(AdditionalDependencies)') + elseif vstudio.isgdkdesktop(cfg) then + _p(tab, '$(Console_Libs);%%(AdditionalDependencies)') end end @@ -1082,7 +1139,7 @@ ,premake.esc(cfginfo.name)) vs10_clcompile(cfg) resource_compile(cfg) - item_def_lib(prj, cfg) + item_def_lib(cfg) vc2010.link(cfg) ant_build(prj, cfg) event_hooks(cfg) @@ -1092,7 +1149,6 @@ end end - -- -- Retrieve a list of files for a particular build group, like -- "ClInclude", "ClCompile", "ResourceCompile", "MASM", "None", etc. diff --git a/3rdparty/genie/src/actions/xcode/xcode10.lua b/3rdparty/genie/src/actions/xcode/xcode10.lua index f8ae0b42cac..a412e24f048 100644 --- a/3rdparty/genie/src/actions/xcode/xcode10.lua +++ b/3rdparty/genie/src/actions/xcode/xcode10.lua @@ -70,7 +70,7 @@ { trigger = "xcode10", shortname = "Xcode 10", - description = "Generate Apple Xcode 10 project files (experimental)", + description = "Generate Apple Xcode 10 project files", os = "macosx", valid_kinds = { "ConsoleApp", "WindowedApp", "StaticLib", "SharedLib", "Bundle" }, diff --git a/3rdparty/genie/src/actions/xcode/xcode11.lua b/3rdparty/genie/src/actions/xcode/xcode11.lua new file mode 100644 index 00000000000..ff19bfd3793 --- /dev/null +++ b/3rdparty/genie/src/actions/xcode/xcode11.lua @@ -0,0 +1,91 @@ +-- +-- xcode11.lua +-- Define the Apple XCode 11.0 action and support functions. +-- + + local premake = premake + premake.xcode11 = { } + + local xcode = premake.xcode + local xcode10 = premake.xcode10 + local xcode11 = premake.xcode11 + + function xcode11.XCBuildConfiguration_Target(tr, target, cfg) + local options = xcode10.XCBuildConfiguration_Target(tr, target, cfg) + options.CODE_SIGN_IDENTITY = "-" + return options + end + + function xcode11.project(prj) + local tr = xcode.buildprjtree(prj) + xcode.Header(tr, 48) + xcode.PBXBuildFile(tr) + xcode.PBXContainerItemProxy(tr) + xcode.PBXFileReference(tr,prj) + xcode.PBXFrameworksBuildPhase(tr) + xcode.PBXGroup(tr) + xcode.PBXNativeTarget(tr) + xcode.PBXProject(tr, "8.0") + xcode.PBXReferenceProxy(tr) + xcode.PBXResourcesBuildPhase(tr) + xcode.PBXShellScriptBuildPhase(tr) + xcode.PBXCopyFilesBuildPhase(tr) + xcode.PBXSourcesBuildPhase(tr,prj) + xcode.PBXVariantGroup(tr) + xcode.PBXTargetDependency(tr) + xcode.XCBuildConfiguration(tr, prj, { + ontarget = xcode11.XCBuildConfiguration_Target, + onproject = xcode10.XCBuildConfiguration_Project, + }) + xcode.XCBuildConfigurationList(tr) + xcode.Footer(tr) + end + --]] + + +-- +-- xcode11 action +-- + + newaction + { + trigger = "xcode11", + shortname = "Xcode 11", + description = "Generate Apple Xcode 11 project files", + os = "macosx", + + valid_kinds = { "ConsoleApp", "WindowedApp", "StaticLib", "SharedLib", "Bundle" }, + + valid_languages = { "C", "C++" }, + + valid_tools = { + cc = { "gcc" }, + }, + + valid_platforms = { Native = "Native" }, + default_platform = "Native", + + onsolution = function(sln) + premake.generate(sln, "%%.xcworkspace/contents.xcworkspacedata", xcode.workspace_generate) + premake.generate(sln, "%%.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings", xcode.workspace_settings) + premake.generate(sln, "%%.xcworkspace/xcshareddata/xcschemes/-ALL-.xcscheme", xcode.workspace_scheme) + end, + + onproject = function(prj) + premake.generate(prj, "%%.xcodeproj/project.pbxproj", xcode11.project) + xcode.generate_schemes(prj, "%%.xcodeproj/xcshareddata/xcschemes") + end, + + oncleanproject = function(prj) + premake.clean.directory(prj, "%%.xcodeproj") + premake.clean.directory(prj, "%%.xcworkspace") + end, + + oncheckproject = xcode.checkproject, + + xcode = { + iOSTargetPlatformVersion = nil, + macOSTargetPlatformVersion = nil, + tvOSTargetPlatformVersion = nil, + }, + } diff --git a/3rdparty/genie/src/actions/xcode/xcode14.lua b/3rdparty/genie/src/actions/xcode/xcode14.lua new file mode 100644 index 00000000000..2b17166ad0c --- /dev/null +++ b/3rdparty/genie/src/actions/xcode/xcode14.lua @@ -0,0 +1,121 @@ +-- +-- xcode14.lua +-- Define the Apple XCode 14.0 action and support functions. +-- + + local premake = premake + premake.xcode14 = { } + + local xcode = premake.xcode + local xcode10 = premake.xcode10 + local xcode11 = premake.xcode11 + local xcode14 = premake.xcode14 + + function xcode14.XCBuildConfiguration_Target(tr, target, cfg) + local options = xcode11.XCBuildConfiguration_Target(tr, target, cfg) + options.CODE_SIGN_IDENTITY = "-" + + local action = premake.action.current() + xcode.setdeploymenttarget(cfg, action.xcode, options) + + local iosversion = options.IPHONEOS_DEPLOYMENT_TARGET + local macosversion = options.MACOSX_DEPLOYMENT_TARGET + local tvosversion = options.TVOS_DEPLOYMENT_TARGET + + if iosversion and not xcode.versionge(iosversion, "11") then + error("XCode14 does not support deployment for iOS older than 11") + elseif macosversion and not xcode.versionge(macosversion, "10.13") then + error("XCode14 does not support deployment for macOS older than 10.13") + elseif tvosversion and not xcode.versionge(tvosversion, "11") then + error("XCode14 does not support deployment for tvOS older than 11") + end + + return options + end + + function xcode14.XCBuildConfiguration_Project(tr, prj, cfg) + local options = xcode10.XCBuildConfiguration_Project(tr, prj, cfg) + + options.ENABLE_BITCODE = "NO" -- Bitcode is now deprecated. + + -- We need to set the deployment target for both target + -- and project. XCode will complain, otherwise. + local action = premake.action.current() + xcode.setdeploymenttarget(cfg, action.xcode, options) + + return options + end + + function xcode14.project(prj) + local tr = xcode.buildprjtree(prj) + xcode.Header(tr, 48) + xcode.PBXBuildFile(tr) + xcode.PBXContainerItemProxy(tr) + xcode.PBXFileReference(tr,prj) + xcode.PBXFrameworksBuildPhase(tr) + xcode.PBXGroup(tr) + xcode.PBXNativeTarget(tr) + xcode.PBXProject(tr, "8.0") + xcode.PBXReferenceProxy(tr) + xcode.PBXResourcesBuildPhase(tr) + xcode.PBXShellScriptBuildPhase(tr) + xcode.PBXCopyFilesBuildPhase(tr) + xcode.PBXSourcesBuildPhase(tr,prj) + xcode.PBXVariantGroup(tr) + xcode.PBXTargetDependency(tr) + xcode.XCBuildConfiguration(tr, prj, { + ontarget = xcode14.XCBuildConfiguration_Target, + onproject = xcode14.XCBuildConfiguration_Project, + }) + xcode.XCBuildConfigurationList(tr) + xcode.Footer(tr) + end + --]] + + +-- +-- xcode14 action +-- + + newaction + { + trigger = "xcode14", + shortname = "Xcode 14", + description = "Generate Apple Xcode 14 project files", + os = "macosx", + + valid_kinds = { "ConsoleApp", "WindowedApp", "StaticLib", "SharedLib", "Bundle" }, + + valid_languages = { "C", "C++" }, + + valid_tools = { + cc = { "gcc" }, + }, + + valid_platforms = { Native = "Native" }, + default_platform = "Native", + + onsolution = function(sln) + premake.generate(sln, "%%.xcworkspace/contents.xcworkspacedata", xcode.workspace_generate) + premake.generate(sln, "%%.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings", xcode.workspace_settings) + premake.generate(sln, "%%.xcworkspace/xcshareddata/xcschemes/-ALL-.xcscheme", xcode.workspace_scheme) + end, + + onproject = function(prj) + premake.generate(prj, "%%.xcodeproj/project.pbxproj", xcode14.project) + xcode.generate_schemes(prj, "%%.xcodeproj/xcshareddata/xcschemes") + end, + + oncleanproject = function(prj) + premake.clean.directory(prj, "%%.xcodeproj") + premake.clean.directory(prj, "%%.xcworkspace") + end, + + oncheckproject = xcode.checkproject, + + xcode = { + iOSTargetPlatformVersion = nil, + macOSTargetPlatformVersion = nil, + tvOSTargetPlatformVersion = nil, + }, + } diff --git a/3rdparty/genie/src/actions/xcode/xcode15.lua b/3rdparty/genie/src/actions/xcode/xcode15.lua new file mode 100644 index 00000000000..c698823acae --- /dev/null +++ b/3rdparty/genie/src/actions/xcode/xcode15.lua @@ -0,0 +1,124 @@ +-- +-- xcode15.lua +-- Define the Apple XCode 15.0 action and support functions. +-- + + local premake = premake + premake.xcode15 = { } + + local xcode = premake.xcode + local xcode10 = premake.xcode10 + local xcode11 = premake.xcode11 + local xcode14 = premake.xcode14 + local xcode15 = premake.xcode15 + + function xcode15.XCBuildConfiguration_Target(tr, target, cfg) + local options = xcode11.XCBuildConfiguration_Target(tr, target, cfg) + options.CODE_SIGN_IDENTITY = "-" + + local action = premake.action.current() + xcode.setdeploymenttarget(cfg, action.xcode, options) + + local iosversion = options.IPHONEOS_DEPLOYMENT_TARGET + local macosversion = options.MACOSX_DEPLOYMENT_TARGET + local tvosversion = options.TVOS_DEPLOYMENT_TARGET + local xrosversion = options.XROS_DEPLOYMENT_TARGET + + if iosversion and not xcode.versionge(iosversion, "12") then + error("XCode15 does not support deployment for iOS older than 12") + elseif macosversion and not xcode.versionge(macosversion, "13.5") then + error("XCode15 does not support deployment for macOS older than 13.5") + elseif tvosversion and not xcode.versionge(tvosversion, "12") then + error("XCode15 does not support deployment for tvOS older than 12") + elseif xrosversion and not xcode.versionge(xrosversion, "1.0") then + error("XCode15 does not support deployment for visionOS older than 1.0") + end + + return options + end + + function xcode15.XCBuildConfiguration_Project(tr, prj, cfg) + local options = xcode10.XCBuildConfiguration_Project(tr, prj, cfg) + + -- We need to set the deployment target for both target + -- and project. XCode will complain, otherwise. + local action = premake.action.current() + xcode.setdeploymenttarget(cfg, action.xcode, options) + + return options + end + + function xcode15.project(prj) + local tr = xcode.buildprjtree(prj) + xcode.Header(tr, 48) + xcode.PBXBuildFile(tr) + xcode.PBXContainerItemProxy(tr) + xcode.PBXFileReference(tr,prj) + xcode.PBXFrameworksBuildPhase(tr) + xcode.PBXGroup(tr) + xcode.PBXNativeTarget(tr) + xcode.PBXProject(tr, "8.0") + xcode.PBXReferenceProxy(tr) + xcode.PBXResourcesBuildPhase(tr) + xcode.PBXShellScriptBuildPhase(tr) + xcode.PBXCopyFilesBuildPhase(tr) + xcode.PBXSourcesBuildPhase(tr,prj) + xcode.PBXVariantGroup(tr) + xcode.PBXTargetDependency(tr) + xcode.XCBuildConfiguration(tr, prj, { + ontarget = xcode15.XCBuildConfiguration_Target, + onproject = xcode15.XCBuildConfiguration_Project, + }) + xcode.XCBuildConfigurationList(tr) + xcode.Footer(tr) + end + --]] + + +-- +-- xcode15 action +-- + + newaction + { + trigger = "xcode15", + shortname = "Xcode 15", + description = "Generate Apple Xcode 15 project files", + os = "macosx", + + valid_kinds = { "ConsoleApp", "WindowedApp", "StaticLib", "SharedLib", "Bundle" }, + + valid_languages = { "C", "C++" }, + + valid_tools = { + cc = { "gcc" }, + }, + + valid_platforms = { Native = "Native" }, + default_platform = "Native", + + onsolution = function(sln) + premake.generate(sln, "%%.xcworkspace/contents.xcworkspacedata", xcode.workspace_generate) + premake.generate(sln, "%%.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings", xcode.workspace_settings) + premake.generate(sln, "%%.xcworkspace/xcshareddata/xcschemes/-ALL-.xcscheme", xcode.workspace_scheme) + end, + + onproject = function(prj) + premake.generate(prj, "%%.xcodeproj/project.pbxproj", xcode14.project) + xcode.generate_schemes(prj, "%%.xcodeproj/xcshareddata/xcschemes") + end, + + oncleanproject = function(prj) + premake.clean.directory(prj, "%%.xcodeproj") + premake.clean.directory(prj, "%%.xcworkspace") + end, + + oncheckproject = xcode.checkproject, + + xcode = { + iOSTargetPlatformVersion = nil, + macOSTargetPlatformVersion = nil, + tvOSTargetPlatformVersion = nil, + visionOSTargetPlatformVersion = nil, + }, + } diff --git a/3rdparty/genie/src/actions/xcode/xcode8.lua b/3rdparty/genie/src/actions/xcode/xcode8.lua index 5a658c992fd..c03c499f230 100644 --- a/3rdparty/genie/src/actions/xcode/xcode8.lua +++ b/3rdparty/genie/src/actions/xcode/xcode8.lua @@ -68,21 +68,7 @@ end local action = premake.action.current() - local get_opt = function(opt, def) - return (opt and #opt > 0) and opt or def - end - - local iosversion = get_opt(cfg.iostargetplatformversion, action.xcode.iOSTargetPlatformVersion) - local macosversion = get_opt(cfg.macostargetplatformversion, action.xcode.macOSTargetPlatformVersion) - local tvosversion = get_opt(cfg.tvostargetplatformversion, action.xcode.tvOSTargetPlatformVersion) - - if iosversion then - options.IPHONEOS_DEPLOYMENT_TARGET = iosversion - elseif macosversion then - options.MACOSX_DEPLOYMENT_TARGET = macosversion - elseif tvosversion then - options.TVOS_DEPLOYMENT_TARGET = tvosversion - end + xcode.setdeploymenttarget(cfg, action.xcode, options) if cfg.kind == "Bundle" and not cfg.options.SkipBundling then options.PRODUCT_BUNDLE_IDENTIFIER = "genie." .. cfg.buildtarget.basename:gsub("%s+", ".") --replace spaces with . diff --git a/3rdparty/genie/src/actions/xcode/xcode9.lua b/3rdparty/genie/src/actions/xcode/xcode9.lua index aa70275bdda..0578e8af4d3 100644 --- a/3rdparty/genie/src/actions/xcode/xcode9.lua +++ b/3rdparty/genie/src/actions/xcode/xcode9.lua @@ -13,8 +13,10 @@ function xcode9.XCBuildConfiguration_Project(tr, prj, cfg) local options = xcode8.XCBuildConfiguration_Project(tr, prj, cfg) - if cfg.flags.Cpp17 or cfg.flags.CppLatest then + if cfg.flags.Cpp17 then options.CLANG_CXX_LANGUAGE_STANDARD = "c++17" + elseif cfg.flags.Cpp20 or cfg.flags.CppLatest then + options.CLANG_CXX_LANGUAGE_STANDARD = "c++20" end return table.merge(options, { diff --git a/3rdparty/genie/src/actions/xcode/xcode_common.lua b/3rdparty/genie/src/actions/xcode/xcode_common.lua index 762c27aada1..0eefdb18e21 100644 --- a/3rdparty/genie/src/actions/xcode/xcode_common.lua +++ b/3rdparty/genie/src/actions/xcode/xcode_common.lua @@ -396,6 +396,37 @@ return "\"" .. str:gsub("[\"\\\"]", "\\%0") .. "\"" end +-- +-- Set the deployment target in the project or target options. +-- +-- @param cfg +-- The configuration in use. +-- @param def +-- The default version overrides. +-- @param opts +-- The options to set deployment target in. +-- + + function xcode.setdeploymenttarget(cfg, def, opts) + local get_opt = function(opt, def) + return (opt and #opt > 0) and opt or def + end + + local iosversion = get_opt(cfg.iostargetplatformversion, def.iOSTargetPlatformVersion) + local macosversion = get_opt(cfg.macostargetplatformversion, def.macOSTargetPlatformVersion) + local tvosversion = get_opt(cfg.tvostargetplatformversion, def.tvOSTargetPlatformVersion) + local visionosversion = get_opt(cfg.visionostargetplatformversion, def.visionOSTargetPlatformVersion) + + if iosversion then + opts.IPHONEOS_DEPLOYMENT_TARGET = iosversion + elseif macosversion then + opts.MACOSX_DEPLOYMENT_TARGET = macosversion + elseif tvosversion then + opts.TVOS_DEPLOYMENT_TARGET = tvosversion + elseif visionosversion then + opts.XROS_DEPLOYMENT_TARGET = tvosversion + end + end --------------------------------------------------------------------------- @@ -1269,6 +1300,21 @@ end _p('') end + function xcode.versionge(version, reference) + local vparts = string.explode(version, ".", true) + local rparts = string.explode(reference, ".", true) + + for i=1,#rparts do + local rnum = tonumber(rparts[i]) or 0 + local vnum = tonumber(vparts[i]) or 0 + + if vnum < rnum then + return false + end + end + + return true + end function xcode.Footer() _p(1,'};') diff --git a/3rdparty/genie/src/actions/xcode/xcode_scheme.lua b/3rdparty/genie/src/actions/xcode/xcode_scheme.lua index 662582e2afb..c261aa35fbc 100644 --- a/3rdparty/genie/src/actions/xcode/xcode_scheme.lua +++ b/3rdparty/genie/src/actions/xcode/xcode_scheme.lua @@ -237,3 +237,4 @@ local xcode = premake.xcode end end end + diff --git a/3rdparty/genie/src/base/api.lua b/3rdparty/genie/src/base/api.lua index a5aa0472f7c..4a3e8bd5ec6 100644 --- a/3rdparty/genie/src/base/api.lua +++ b/3rdparty/genie/src/base/api.lua @@ -818,11 +818,11 @@ end allowed = function(value) local allowed_flags = { AntBuildDebuggable = 1, - ATL = 1, C7DebugInfo = 1, Cpp11 = 1, Cpp14 = 1, Cpp17 = 1, + Cpp20 = 1, CppLatest = 1, DebugEnvsDontMerge = 1, DebugEnvsInherit = 1, @@ -843,7 +843,6 @@ end LinkSupportCircularDependencies = 1, Managed = 1, MinimumWarnings = 1, - MFC = 1, NativeWChar = 1, No64BitChecks = 1, NoBufferSecurityCheck = 1, @@ -872,7 +871,6 @@ end DebugRuntime = 1, ReleaseRuntime = 1, SEH = 1, - StaticATL = 1, StaticRuntime = 1, Symbols = 1, Unicode = 1, @@ -942,6 +940,12 @@ end scope = "project", } + newapifield { + name = "visionostargetplatformversion", + kind = "string", + scope = "project", + } + newapifield { name = "windowstargetplatformversion", kind = "string", diff --git a/3rdparty/genie/src/base/bake.lua b/3rdparty/genie/src/base/bake.lua index 9d69487e6d7..221cb623fcf 100644 --- a/3rdparty/genie/src/base/bake.lua +++ b/3rdparty/genie/src/base/bake.lua @@ -162,15 +162,20 @@ end end - local function removevalues(tbl, removes) + local function removevalues(tbl, removes) + for i = #tbl, 1, -1 do + for _, pattern in ipairs(removes) do + if pattern == tbl[i] then + table.remove(tbl, i) + break + end + end + end + for k, v in pairs(tbl) do for _, pattern in ipairs(removes) do if pattern == tbl[k] then - if type(k) == "number" then - table.remove(tbl, k) - else - tbl[k] = nil - end + tbl[k] = nil break end end diff --git a/3rdparty/genie/src/base/cmdline.lua b/3rdparty/genie/src/base/cmdline.lua index c3357b702ae..0127ceff327 100644 --- a/3rdparty/genie/src/base/cmdline.lua +++ b/3rdparty/genie/src/base/cmdline.lua @@ -76,7 +76,13 @@ { "xbox360", "Xbox 360" }, { "durango", "Xbox One" }, { "ARM", "ARM" }, + { "ARM64", "ARM64" }, { "PowerPC", "PowerPC" }, + { "nx32", "Nintendo Switch, 32-bit only" }, + { "nx64", "Nintendo Switch, 64-bit only" }, + { "gdk-desktop", "GDK Windows Desktop" }, + { "gdk-xboxone", "GDK Xbox One" }, + { "gdk-scarlett","GDK Xbox Scarlett" }, } } diff --git a/3rdparty/genie/src/base/config.lua b/3rdparty/genie/src/base/config.lua index eec1ad67499..a255c7cca67 100644 --- a/3rdparty/genie/src/base/config.lua +++ b/3rdparty/genie/src/base/config.lua @@ -104,3 +104,4 @@ end return true end + diff --git a/3rdparty/genie/src/base/globals.lua b/3rdparty/genie/src/base/globals.lua index d24b66f163d..cb6c0f089b0 100644 --- a/3rdparty/genie/src/base/globals.lua +++ b/3rdparty/genie/src/base/globals.lua @@ -67,6 +67,11 @@ cfgsuffix = "ARM", iscrosscompiler = true, }, + ARM64 = + { + cfgsuffix = "ARM64", + iscrosscompiler = true, + }, Orbis = { cfgsuffix = "orbis", @@ -105,6 +110,21 @@ nosharedlibs = true, namestyle = "Emscripten", }, + ["gdk-desktop"] = + { + cfgsuffix = "gdk-desktop", + namestyle = "windows", + }, + ["gdk-xboxone"] = + { + cfgsuffix = "gdk-xboxone", + namestyle = "windows", + }, + ["gdk-scarlett"] = + { + cfgsuffix = "gdk-scarlett", + namestyle = "windows", + }, } diff --git a/3rdparty/genie/src/base/os.lua b/3rdparty/genie/src/base/os.lua index ae88c0ad949..3cddcbb45c3 100644 --- a/3rdparty/genie/src/base/os.lua +++ b/3rdparty/genie/src/base/os.lua @@ -122,7 +122,8 @@ "amd64", "ppc64", "powerpc64", - "sparc64" + "sparc64", + "arm64" } function os.is64bit() diff --git a/3rdparty/genie/src/base/path.lua b/3rdparty/genie/src/base/path.lua index ae2561ac07e..d9eb936c414 100644 --- a/3rdparty/genie/src/base/path.lua +++ b/3rdparty/genie/src/base/path.lua @@ -172,6 +172,10 @@ return path.hasextension(fname, { ".h", ".hh", ".hpp", ".hxx" }) end + function path.iscppmodule(fname) + return path.hasextension(fname, { ".ixx", ".cppm" }) + end + function path.isappxmanifest(fname) return path.hasextension(fname, ".appxmanifest") end @@ -192,6 +196,11 @@ return path.hasextension(fname, ".vala") end + function path.isgresource(fname) + local ending = ".gresource.xml" + return ending == "" or fname:sub(-#ending) == ending + end + function path.isswiftfile(fname) return path.hasextension(fname, ".swift") end @@ -208,6 +217,7 @@ function path.issourcefilevs(fname) return path.hasextension(fname, { ".cc", ".cpp", ".cxx", ".c++", ".c" }) or path.iscxfile(fname) + or path.iscppmodule(fname) end -- diff --git a/3rdparty/genie/src/base/project.lua b/3rdparty/genie/src/base/project.lua index 1c817c4168c..ad12830ed7b 100644 --- a/3rdparty/genie/src/base/project.lua +++ b/3rdparty/genie/src/base/project.lua @@ -463,7 +463,7 @@ -- Fix things up based on the current system local kind = cfg.kind - if premake.iscppproject(cfg) then + if premake.iscppproject(cfg) or premake.isvalaproject(cfg) then -- On Windows, shared libraries link against a static import library if (namestyle == "windows" or system == "windows") and kind == "SharedLib" and direction == "link" @@ -559,7 +559,7 @@ if kind == "ConsoleApp" or kind == "WindowedApp" then ext = ".html" elseif kind == "StaticLib" then - ext = ".bc" + ext = ".a" elseif kind == "SharedLib" then ext = ".js" end @@ -595,8 +595,8 @@ -- any relevant command-line options. -- - function premake.gettool(cfg) - if premake.iscppproject(cfg) then + function premake.gettool(prj) + if premake.iscppproject(prj) then if _OPTIONS.cc then return premake[_OPTIONS.cc] end @@ -605,9 +605,9 @@ return premake[action.valid_tools.cc[1]] end return premake.gcc - elseif premake.isdotnetproject(cfg) then + elseif premake.isdotnetproject(prj) then return premake.dotnet - elseif premake.isswiftproject(cfg) then + elseif premake.isswiftproject(prj) then return premake.swift else return premake.valac @@ -631,7 +631,7 @@ local fname = path.getname(abspath) local max = abspath:len() - fname:len() - + -- First check for an exact match from the inverse vpaths if prj.inversevpaths and prj.inversevpaths[abspath] then return path.join(prj.inversevpaths[abspath], fname) @@ -687,7 +687,7 @@ end end end - + if #matches > 0 then -- for the sake of determinism, return the first alphabetically table.sort(matches) @@ -731,7 +731,8 @@ -- function premake.project.iscproject(prj) - return prj.language == "C" + local language = prj.language or prj.solution.language + return language == "C" end @@ -740,7 +741,8 @@ -- function premake.iscppproject(prj) - return (prj.language == "C" or prj.language == "C++") + local language = prj.language or prj.solution.language + return (language == "C" or language == "C++") end @@ -750,7 +752,8 @@ -- function premake.isdotnetproject(prj) - return (prj.language == "C#") + local language = prj.language or prj.solution.language + return (language == "C#") end -- @@ -758,7 +761,8 @@ -- function premake.isvalaproject(prj) - return (prj.language == "Vala") + local language = prj.language or prj.solution.language + return (language == "Vala") end -- @@ -766,5 +770,6 @@ -- function premake.isswiftproject(prj) - return (prj.language == "Swift") + local language = prj.language or prj.solution.language + return (language == "Swift") end diff --git a/3rdparty/genie/src/host/premake.c b/3rdparty/genie/src/host/premake.c index a8ad1140912..52d365a5848 100644 --- a/3rdparty/genie/src/host/premake.c +++ b/3rdparty/genie/src/host/premake.c @@ -130,6 +130,8 @@ int premake_locate(lua_State* L, const char* argv0) char buffer[PATH_MAX]; const char* path = NULL; + memset(buffer, 0, PATH_MAX); + #if PLATFORM_WINDOWS DWORD len = GetModuleFileName(NULL, buffer, PATH_MAX); if (len > 0) diff --git a/3rdparty/genie/src/host/scripts.c b/3rdparty/genie/src/host/scripts.c index f93d3547332..d052a1418f4 100644 --- a/3rdparty/genie/src/host/scripts.c +++ b/3rdparty/genie/src/host/scripts.c @@ -5,17 +5,18 @@ const char* builtin_scripts[] = { /* base/os.lua */ "function os.executef(cmd, ...)\nlocal arg={...}\ncmd = string.format(cmd, table.unpack(arg))\nreturn os.execute(cmd)\nend\nlocal function parse_ld_so_conf(conf_file)\nlocal first, last\nlocal dirs = { }\nlocal file = io.open(conf_file)\nif file == nil then\nreturn dirs\nend\nfor line in file:lines() do\nfirst = line:find(\"#\", 1, true)\nif first ~= nil then\nline = line:sub(1, first - 1)\nend\nif line ~= \"\" then\nfirst, last = line:find(\"include%s+\")\nif first ~= nil then\nlocal include_glob = line:sub(last + 1)\nlocal includes = os.matchfiles(include_glob)\nfor _, v in ipairs(includes) do\ndirs = table.join(dirs, parse_ld_so_conf(v))\nend\nelse\ntable.insert(dirs, line)\nend\nend\nend\nreturn dirs\nend\nfunction os.findlib(libname)\nlocal path, formats\nif os.is(\"windows\") then\nformats = { \"%s.dll\", \"%s\" }\npath = os.getenv(\"PATH\")\nelse\nif os.is(\"macosx\") then\nformats = { \"lib%s.dylib\", \"%s.dylib\" }\npath = os.getenv(\"DYLD_LIBRARY_PATH\")\nelse\nformats = { \"lib%s.so\", \"%s.so\" }\np" - "ath = os.getenv(\"LD_LIBRARY_PATH\") or \"\"\nfor _, v in ipairs(parse_ld_so_conf(\"/etc/ld.so.conf\")) do\npath = path .. \":\" .. v\nend\nend\ntable.insert(formats, \"%s\")\npath = path or \"\"\nif os.is64bit() then\npath = path .. \":/lib64:/usr/lib64/:usr/local/lib64\"\nend\npath = path .. \":/lib:/usr/lib:/usr/local/lib\"\nend\nfor _, fmt in ipairs(formats) do\nlocal name = string.format(fmt, libname)\nlocal result = os.pathsearch(name, path)\nif result then return result end\nend\nend\nfunction os.get()\nreturn _OPTIONS.os or _OS\nend\nfunction os.is(id)\nreturn (os.get():lower() == id:lower())\nend\nlocal _64BitHostTypes = {\n\"x86_64\",\n\"ia64\",\n\"amd64\",\n\"ppc64\",\n\"powerpc64\",\n\"sparc64\"\n}\nfunction os.is64bit()\nif (os._is64bit()) then\nreturn true\nend\nlocal arch = \"\"\nif _OS == \"windows\" then\narch = os.getenv(\"PROCESSOR_ARCHITECTURE\")\nelseif _OS == \"macosx\" then\narch = os.outputof(\"echo $HOSTTYPE\")\nelse\narch = os.outputof(\"uname -m\")\nend\nif nil ~= arch then\narch = a" - "rch:lower()\nfor _, hosttype in ipairs(_64BitHostTypes) do\nif arch:find(hosttype) then\nreturn true\nend\nend\nend\nreturn false\nend\nlocal function domatch(result, mask, wantfiles)\nif mask:startswith(\"./\") then\nmask = mask:sub(3)\nend\nlocal basedir = mask\nlocal starpos = mask:find(\"%*\")\nif starpos then\nbasedir = basedir:sub(1, starpos - 1)\nend\nbasedir = path.getdirectory(basedir)\nif (basedir == \".\") then basedir = \"\" end\nlocal recurse = mask:find(\"**\", nil, true)\nmask = path.wildcards(mask)\nlocal function matchwalker(basedir)\nlocal wildcard = path.join(basedir, \"*\")\nlocal m = os.matchstart(wildcard)\nwhile (os.matchnext(m)) do\nlocal isfile = os.matchisfile(m)\nif ((wantfiles and isfile) or (not wantfiles and not isfile)) then\nlocal fname = path.join(basedir, os.matchname(m))\nif fname:match(mask) == fname then\ntable.insert(result, fname)\nend\nend\nend\nos.matchdone(m)\nif recurse then\nm = os.matchstart(wildcard)\nwhile (os.matchnext(m)) do\nif not os.matchisfile(m) then\nlocal" - " dirname = os.matchname(m)\nmatchwalker(path.join(basedir, dirname))\nend\nend\nos.matchdone(m)\nend\nend\nmatchwalker(basedir)\nend\nfunction os.matchdirs(...)\nlocal arg={...}\nlocal result = { }\nfor _, mask in ipairs(arg) do\ndomatch(result, mask, false)\nend\nreturn result\nend\nfunction os.matchfiles(...)\nlocal arg={...}\nlocal result = { }\nfor _, mask in ipairs(arg) do\ndomatch(result, mask, true)\nend\nreturn result\nend\nlocal builtin_mkdir = os.mkdir\nfunction os.mkdir(p)\nlocal dir = iif(p:startswith(\"/\"), \"/\", \"\")\nfor part in p:gmatch(\"[^/]+\") do\ndir = dir .. part\nif (part ~= \"\" and not path.isabsolute(part) and not os.isdir(dir)) then\nlocal ok, err = builtin_mkdir(dir)\nif (not ok) then\nreturn nil, err\nend\nend\ndir = dir .. \"/\"\nend\nreturn true\nend\nfunction os.outputof(cmd)\nlocal pipe = io.popen(cmd)\nlocal result = pipe:read('*a')\npipe:close()\nreturn result\nend\nlocal builtin_rmdir = os.rmdir\nfunction os.rmdir(p)\nlocal dirs = os.matchdirs(p .. \"/*\")\nfor _, dname i" - "n ipairs(dirs) do\nos.rmdir(dname)\nend\nlocal files = os.matchfiles(p .. \"/*\")\nfor _, fname in ipairs(files) do\nos.remove(fname)\nend\nbuiltin_rmdir(p)\nend\n", + "ath = os.getenv(\"LD_LIBRARY_PATH\") or \"\"\nfor _, v in ipairs(parse_ld_so_conf(\"/etc/ld.so.conf\")) do\npath = path .. \":\" .. v\nend\nend\ntable.insert(formats, \"%s\")\npath = path or \"\"\nif os.is64bit() then\npath = path .. \":/lib64:/usr/lib64/:usr/local/lib64\"\nend\npath = path .. \":/lib:/usr/lib:/usr/local/lib\"\nend\nfor _, fmt in ipairs(formats) do\nlocal name = string.format(fmt, libname)\nlocal result = os.pathsearch(name, path)\nif result then return result end\nend\nend\nfunction os.get()\nreturn _OPTIONS.os or _OS\nend\nfunction os.is(id)\nreturn (os.get():lower() == id:lower())\nend\nlocal _64BitHostTypes = {\n\"x86_64\",\n\"ia64\",\n\"amd64\",\n\"ppc64\",\n\"powerpc64\",\n\"sparc64\",\n\"arm64\"\n}\nfunction os.is64bit()\nif (os._is64bit()) then\nreturn true\nend\nlocal arch = \"\"\nif _OS == \"windows\" then\narch = os.getenv(\"PROCESSOR_ARCHITECTURE\")\nelseif _OS == \"macosx\" then\narch = os.outputof(\"echo $HOSTTYPE\")\nelse\narch = os.outputof(\"uname -m\")\nend\nif nil ~= arch th" + "en\narch = arch:lower()\nfor _, hosttype in ipairs(_64BitHostTypes) do\nif arch:find(hosttype) then\nreturn true\nend\nend\nend\nreturn false\nend\nlocal function domatch(result, mask, wantfiles)\nif mask:startswith(\"./\") then\nmask = mask:sub(3)\nend\nlocal basedir = mask\nlocal starpos = mask:find(\"%*\")\nif starpos then\nbasedir = basedir:sub(1, starpos - 1)\nend\nbasedir = path.getdirectory(basedir)\nif (basedir == \".\") then basedir = \"\" end\nlocal recurse = mask:find(\"**\", nil, true)\nmask = path.wildcards(mask)\nlocal function matchwalker(basedir)\nlocal wildcard = path.join(basedir, \"*\")\nlocal m = os.matchstart(wildcard)\nwhile (os.matchnext(m)) do\nlocal isfile = os.matchisfile(m)\nif ((wantfiles and isfile) or (not wantfiles and not isfile)) then\nlocal fname = path.join(basedir, os.matchname(m))\nif fname:match(mask) == fname then\ntable.insert(result, fname)\nend\nend\nend\nos.matchdone(m)\nif recurse then\nm = os.matchstart(wildcard)\nwhile (os.matchnext(m)) do\nif not os.matchisfile(m)" + " then\nlocal dirname = os.matchname(m)\nmatchwalker(path.join(basedir, dirname))\nend\nend\nos.matchdone(m)\nend\nend\nmatchwalker(basedir)\nend\nfunction os.matchdirs(...)\nlocal arg={...}\nlocal result = { }\nfor _, mask in ipairs(arg) do\ndomatch(result, mask, false)\nend\nreturn result\nend\nfunction os.matchfiles(...)\nlocal arg={...}\nlocal result = { }\nfor _, mask in ipairs(arg) do\ndomatch(result, mask, true)\nend\nreturn result\nend\nlocal builtin_mkdir = os.mkdir\nfunction os.mkdir(p)\nlocal dir = iif(p:startswith(\"/\"), \"/\", \"\")\nfor part in p:gmatch(\"[^/]+\") do\ndir = dir .. part\nif (part ~= \"\" and not path.isabsolute(part) and not os.isdir(dir)) then\nlocal ok, err = builtin_mkdir(dir)\nif (not ok) then\nreturn nil, err\nend\nend\ndir = dir .. \"/\"\nend\nreturn true\nend\nfunction os.outputof(cmd)\nlocal pipe = io.popen(cmd)\nlocal result = pipe:read('*a')\npipe:close()\nreturn result\nend\nlocal builtin_rmdir = os.rmdir\nfunction os.rmdir(p)\nlocal dirs = os.matchdirs(p .. \"/*\")\nfo" + "r _, dname in ipairs(dirs) do\nos.rmdir(dname)\nend\nlocal files = os.matchfiles(p .. \"/*\")\nfor _, fname in ipairs(files) do\nos.remove(fname)\nend\nbuiltin_rmdir(p)\nend\n", /* base/path.lua */ "function path.getbasename(p)\nlocal name = path.getname(p)\nlocal i = name:findlast(\".\", true)\nif (i) then\nreturn name:sub(1, i - 1)\nelse\nreturn name\nend\nend\nfunction path.removeext(name)\nlocal i = name:findlast(\".\", true)\nif (i) then\nreturn name:sub(1, i - 1)\nelse\nreturn name\nend\nend\nfunction path.getdirectory(p)\nlocal i = p:findlast(\"/\", true)\nif (i) then\nif i > 1 then i = i - 1 end\nreturn p:sub(1, i)\nelse\nreturn \".\"\nend\nend\nfunction path.getdrive(p)\nlocal ch1 = p:sub(1,1)\nlocal ch2 = p:sub(2,2)\nif ch2 == \":\" then\nreturn ch1\nend\nend\nfunction path.getextension(p)\nlocal i = p:findlast(\".\", true)\nif (i) then\nreturn p:sub(i)\nelse\nreturn \"\"\nend\nend\nfunction path.getname(p)\nlocal i = p:findlast(\"[/\\\\]\")\nif (i) then\nreturn p:sub(i + 1)\nelse\nreturn p\nend\nend\nfunction path.getcommonbasedir(a, b)\na = path.getdirectory(a)..'/'\nb = path.getdirectory(b)..'/'\nlocal idx = 0\nwhile (true) do\nlocal tst = a:find('/', idx + 1, true)\nif tst then\nif a:sub(1,t" "st) == b:sub(1,tst) then\nidx = tst\nelse\nbreak\nend\nelse\nbreak\nend\nend\nlocal result = ''\nif idx > 1 then\nresult = a:sub(1, idx - 1)-- Remove the trailing slash to be consistent with other functions.\nend\nreturn result\nend\nfunction path.hasextension(fname, extensions)\nlocal fext = path.getextension(fname):lower()\nif type(extensions) == \"table\" then\nfor _, extension in pairs(extensions) do\nif fext == extension then\nreturn true\nend\nend\nreturn false\nelse\nreturn (fext == extensions)\nend\nend\nfunction path.iscfile(fname)\nreturn path.hasextension(fname, { \".c\", \".m\" })\nend\nfunction path.iscppfile(fname)\nreturn path.hasextension(fname, { \".cc\", \".cpp\", \".cxx\", \".c++\", \".c\", \".m\", \".mm\" })\nend\nfunction path.iscxfile(fname)\nreturn path.hasextension(fname, \".cx\")\nend\nfunction path.isobjcfile(fname)\nreturn path.hasextension(fname, { \".m\", \".mm\" })\nend\nfunction path.iscppheader(fname)\nreturn path.hasextension(fname, { \".h\", \".hh\", \".hpp\", \".hxx\" })\nend" - "\nfunction path.isappxmanifest(fname)\nreturn path.hasextension(fname, \".appxmanifest\")\nend\nfunction path.isandroidbuildfile(fname)\nreturn path.getname(fname) == \"AndroidManifest.xml\"\nend\nfunction path.isnatvis(fname)\nreturn path.hasextension(fname, \".natvis\")\nend\nfunction path.isasmfile(fname)\nreturn path.hasextension(fname, { \".asm\", \".s\", \".S\" })\nend\nfunction path.isvalafile(fname)\nreturn path.hasextension(fname, \".vala\")\nend\nfunction path.isswiftfile(fname)\nreturn path.hasextension(fname, \".swift\")\nend\nfunction path.issourcefile(fname)\nreturn path.iscfile(fname)\nor path.iscppfile(fname)\nor path.iscxfile(fname)\nor path.isasmfile(fname)\nor path.isvalafile(fname)\nor path.isswiftfile(fname)\nend\nfunction path.issourcefilevs(fname)\nreturn path.hasextension(fname, { \".cc\", \".cpp\", \".cxx\", \".c++\", \".c\" })\nor path.iscxfile(fname)\nend\nfunction path.isobjectfile(fname)\nreturn path.hasextension(fname, { \".o\", \".obj\" })\nend\nfunction path.isresourcefile(fname" - ")\nreturn path.hasextension(fname, \".rc\")\nend\nfunction path.isimagefile(fname)\nlocal extensions = { \".png\" }\nlocal ext = path.getextension(fname):lower()\nreturn table.contains(extensions, ext)\nend\nfunction path.join(...)\nlocal arg={...}\nlocal numargs = select(\"#\", ...)\nif numargs == 0 then\nreturn \"\";\nend\nlocal allparts = {}\nfor i = numargs, 1, -1 do\nlocal part = select(i, ...)\nif part and #part > 0 and part ~= \".\" then\nwhile part:endswith(\"/\") do\npart = part:sub(1, -2)\nend\ntable.insert(allparts, 1, part)\nif path.isabsolute(part) then\nbreak\nend\nend\nend\nreturn table.concat(allparts, \"/\")\nend\nfunction path.rebase(p, oldbase, newbase)\np = path.getabsolute(path.join(oldbase, p))\np = path.getrelative(newbase, p)\nreturn p\nend\nfunction path.translate(p, sep)\nif (type(p) == \"table\") then\nlocal result = { }\nfor _, value in ipairs(p) do\ntable.insert(result, path.translate(value))\nend\nreturn result\nelse\nif (not sep) then\nif (os.is(\"windows\")) then\nsep = \"\\\\\"" - "\nelse\nsep = \"/\"\nend\nend\nlocal result = p:gsub(\"[/\\\\]\", sep)\nreturn result\nend\nend\nfunction path.wildcards(pattern)\npattern = pattern:gsub(\"([%+%.%-%^%$%(%)%%])\", \"%%%1\")\npattern = pattern:gsub(\"%*%*\", \"\\001\")\npattern = pattern:gsub(\"%*\", \"\\002\")\npattern = pattern:gsub(\"\\001\", \".*\")\npattern = pattern:gsub(\"\\002\", \"[^/]*\")\nreturn pattern\nend\nfunction path.trimdots(p)\nlocal changed\nrepeat\nchanged = true\nif p:startswith(\"./\") then\np = p:sub(3)\nelseif p:startswith(\"../\") then\np = p:sub(4)\nelse\nchanged = false\nend\nuntil not changed\nreturn p\nend\nfunction path.rebase(p, oldbase, newbase)\np = path.getabsolute(path.join(oldbase, p))\np = path.getrelative(newbase, p)\nreturn p\nend\nfunction path.replaceextension(p, newext)\nlocal ext = path.getextension(p)\nif not ext then\nreturn p\nend\nif #newext > 0 and not newext:findlast(\".\", true) then\nnewext = \".\"..newext\nend\nreturn p:match(\"^(.*)\"..ext..\"$\")..newext\nend\n", + "\nfunction path.iscppmodule(fname)\nreturn path.hasextension(fname, { \".ixx\", \".cppm\" })\nend\nfunction path.isappxmanifest(fname)\nreturn path.hasextension(fname, \".appxmanifest\")\nend\nfunction path.isandroidbuildfile(fname)\nreturn path.getname(fname) == \"AndroidManifest.xml\"\nend\nfunction path.isnatvis(fname)\nreturn path.hasextension(fname, \".natvis\")\nend\nfunction path.isasmfile(fname)\nreturn path.hasextension(fname, { \".asm\", \".s\", \".S\" })\nend\nfunction path.isvalafile(fname)\nreturn path.hasextension(fname, \".vala\")\nend\nfunction path.isgresource(fname)\nlocal ending = \".gresource.xml\"\nreturn ending == \"\" or fname:sub(-#ending) == ending\nend\nfunction path.isswiftfile(fname)\nreturn path.hasextension(fname, \".swift\")\nend\nfunction path.issourcefile(fname)\nreturn path.iscfile(fname)\nor path.iscppfile(fname)\nor path.iscxfile(fname)\nor path.isasmfile(fname)\nor path.isvalafile(fname)\nor path.isswiftfile(fname)\nend\nfunction path.issourcefilevs(fname)\nreturn path.hase" + "xtension(fname, { \".cc\", \".cpp\", \".cxx\", \".c++\", \".c\" })\nor path.iscxfile(fname)\nor path.iscppmodule(fname)\nend\nfunction path.isobjectfile(fname)\nreturn path.hasextension(fname, { \".o\", \".obj\" })\nend\nfunction path.isresourcefile(fname)\nreturn path.hasextension(fname, \".rc\")\nend\nfunction path.isimagefile(fname)\nlocal extensions = { \".png\" }\nlocal ext = path.getextension(fname):lower()\nreturn table.contains(extensions, ext)\nend\nfunction path.join(...)\nlocal arg={...}\nlocal numargs = select(\"#\", ...)\nif numargs == 0 then\nreturn \"\";\nend\nlocal allparts = {}\nfor i = numargs, 1, -1 do\nlocal part = select(i, ...)\nif part and #part > 0 and part ~= \".\" then\nwhile part:endswith(\"/\") do\npart = part:sub(1, -2)\nend\ntable.insert(allparts, 1, part)\nif path.isabsolute(part) then\nbreak\nend\nend\nend\nreturn table.concat(allparts, \"/\")\nend\nfunction path.rebase(p, oldbase, newbase)\np = path.getabsolute(path.join(oldbase, p))\np = path.getrelative(newbase, p)\nreturn p" + "\nend\nfunction path.translate(p, sep)\nif (type(p) == \"table\") then\nlocal result = { }\nfor _, value in ipairs(p) do\ntable.insert(result, path.translate(value))\nend\nreturn result\nelse\nif (not sep) then\nif (os.is(\"windows\")) then\nsep = \"\\\\\"\nelse\nsep = \"/\"\nend\nend\nlocal result = p:gsub(\"[/\\\\]\", sep)\nreturn result\nend\nend\nfunction path.wildcards(pattern)\npattern = pattern:gsub(\"([%+%.%-%^%$%(%)%%])\", \"%%%1\")\npattern = pattern:gsub(\"%*%*\", \"\\001\")\npattern = pattern:gsub(\"%*\", \"\\002\")\npattern = pattern:gsub(\"\\001\", \".*\")\npattern = pattern:gsub(\"\\002\", \"[^/]*\")\nreturn pattern\nend\nfunction path.trimdots(p)\nlocal changed\nrepeat\nchanged = true\nif p:startswith(\"./\") then\np = p:sub(3)\nelseif p:startswith(\"../\") then\np = p:sub(4)\nelse\nchanged = false\nend\nuntil not changed\nreturn p\nend\nfunction path.rebase(p, oldbase, newbase)\np = path.getabsolute(path.join(oldbase, p))\np = path.getrelative(newbase, p)\nreturn p\nend\nfunction path.replacee" + "xtension(p, newext)\nlocal ext = path.getextension(p)\nif not ext then\nreturn p\nend\nif #newext > 0 and not newext:findlast(\".\", true) then\nnewext = \".\"..newext\nend\nreturn p:match(\"^(.*)\"..ext..\"$\")..newext\nend\n", /* base/string.lua */ "function string.explode(s, pattern, plain)\nif (pattern == '') then return false end\nlocal pos = 0\nlocal arr = { }\nfor st,sp in function() return s:find(pattern, pos, plain) end do\ntable.insert(arr, s:sub(pos, st-1))\npos = sp + 1\nend\ntable.insert(arr, s:sub(pos))\nreturn arr\nend\nfunction string.findlast(s, pattern, plain)\nlocal curr = 0\nlocal term = nil\nrepeat\nlocal next, nextterm = s:find(pattern, curr + 1, plain)\nif (next) then\ncurr = next\nterm = nextterm\nend\nuntil (not next)\nif (curr > 0) then\nreturn curr, term\nend\nend\nfunction string.startswith(haystack, needle)\nreturn (haystack:find(needle, 1, true) == 1)\nend\nfunction string.trim(s)\nreturn (s:gsub(\"^%s*(.-)%s*$\", \"%1\"))\nend\n", @@ -30,9 +31,9 @@ const char* builtin_scripts[] = { "{...}\nfor i = 1, #arg do\narg[i] = io.esc(arg[i])\nend\nio.printf(msg, unpack(arg))\nend\nfunction io.esc(value)\nif type(value) == \"table\" then\nlocal result = {}\nlocal n = #value\nfor i = 1, n do\ntable.insert(result, io.esc(value[i]))\nend\nreturn result\nend\nreturn _esc(value or \"\")\nend\nfunction io.escaper(func)\n_esc = func or _escaper\nend\n_p = io.printf\n_x = io.xprintf\n", /* base/globals.lua */ - "premake = { }\npremake.platforms =\n{\nNative =\n{\ncfgsuffix = \"\",\n},\nx32 =\n{\ncfgsuffix = \"32\",\n},\nx64 =\n{\ncfgsuffix = \"64\",\n},\nUniversal =\n{\ncfgsuffix = \"univ\",\n},\nUniversal32 =\n{\ncfgsuffix = \"univ32\",\n},\nUniversal64 =\n{\ncfgsuffix = \"univ64\",\n},\nPS3 =\n{\ncfgsuffix = \"ps3\",\niscrosscompiler = true,\nnosharedlibs = true,\nnamestyle = \"PS3\",\n},\nWiiDev =\n{\ncfgsuffix = \"wii\",\niscrosscompiler = true,\nnamestyle = \"PS3\",\n},\nXbox360 =\n{\ncfgsuffix = \"xbox360\",\niscrosscompiler = true,\nnamestyle = \"windows\",\n},\nPowerPC =\n{\ncfgsuffix = \"ppc\",\niscrosscompiler = true,\n},\nARM =\n{\ncfgsuffix = \"ARM\",\niscrosscompiler = true,\n},\nOrbis =\n{\ncfgsuffix = \"orbis\",\niscrosscompiler = true,\nnamestyle = \"Orbis\",\n},\nDurango =\n{\ncfgsuffix = \"durango\",\niscrosscompiler = true,\nnosharedlibs = true,\nnamestyle = \"windows\",\n},\nTegraAndroi" - "d =\n{\ncfgsuffix = \"tegraandroid\",\niscrosscompiler = true,\nnamestyle = \"TegraAndroid\",\n},\nNX32 =\n{\ncfgsuffix = \"nx32\",\niscrosscompiler = true,\nnamestyle = \"NX\",\n},\nNX64 =\n{\ncfgsuffix = \"nx64\",\niscrosscompiler = true,\nnamestyle = \"NX\",\n},\nEmscripten =\n{\ncfgsuffix = \"emscripten\",\niscrosscompiler = true,\nnosharedlibs = true,\nnamestyle = \"Emscripten\",\n},\n}\nlocal builtin_dofile = dofile\nfunction dofile(fname)\nlocal oldcwd = os.getcwd()\nlocal oldfile = _SCRIPT\nif (not os.isfile(fname)) then\nlocal path = os.pathsearch(fname, _OPTIONS[\"scripts\"], os.getenv(\"PREMAKE_PATH\"))\nif (path) then\nfname = path..\"/\"..fname\nend\nend\n_SCRIPT = path.getabsolute(fname)\nlocal newcwd = path.getdirectory(_SCRIPT)\nos.chdir(newcwd)\nlocal a, b, c, d, e, f = builtin_dofile(_SCRIPT)\n_SCRIPT = oldfile\nos.chdir(oldcwd)\nreturn a, b, c, d, e, f\nend\nfunction iif(expr, trueval, falseval)\nif (expr) then\nreturn trueval\nelse\nreturn " - "falseval\nend\nend\nfunction include(fname)\nlocal dir, name = premake.findDefaultScript(fname, false)\nif dir ~= nil then\nreturn dofile(dir .. \"/\" .. name)\nend\nreturn nil\nend\nfunction printf(msg, ...)\nlocal arg={...}\nprint(string.format(msg, table.unpack(arg)))\nend\nfunction typex(t)\nlocal mt = getmetatable(t)\nif (mt) then\nif (mt.__type) then\nreturn mt.__type\nend\nend\nreturn type(t)\nend\n", + "premake = { }\npremake.platforms =\n{\nNative =\n{\ncfgsuffix = \"\",\n},\nx32 =\n{\ncfgsuffix = \"32\",\n},\nx64 =\n{\ncfgsuffix = \"64\",\n},\nUniversal =\n{\ncfgsuffix = \"univ\",\n},\nUniversal32 =\n{\ncfgsuffix = \"univ32\",\n},\nUniversal64 =\n{\ncfgsuffix = \"univ64\",\n},\nPS3 =\n{\ncfgsuffix = \"ps3\",\niscrosscompiler = true,\nnosharedlibs = true,\nnamestyle = \"PS3\",\n},\nWiiDev =\n{\ncfgsuffix = \"wii\",\niscrosscompiler = true,\nnamestyle = \"PS3\",\n},\nXbox360 =\n{\ncfgsuffix = \"xbox360\",\niscrosscompiler = true,\nnamestyle = \"windows\",\n},\nPowerPC =\n{\ncfgsuffix = \"ppc\",\niscrosscompiler = true,\n},\nARM =\n{\ncfgsuffix = \"ARM\",\niscrosscompiler = true,\n},\nARM64 =\n{\ncfgsuffix = \"ARM64\",\niscrosscompiler = true,\n},\nOrbis =\n{\ncfgsuffix = \"orbis\",\niscrosscompiler = true,\nnamestyle = \"Orbis\",\n},\nDurango =\n{\ncfgsuffix = \"durango\",\niscrosscompiler = true,\nn" + "osharedlibs = true,\nnamestyle = \"windows\",\n},\nTegraAndroid =\n{\ncfgsuffix = \"tegraandroid\",\niscrosscompiler = true,\nnamestyle = \"TegraAndroid\",\n},\nNX32 =\n{\ncfgsuffix = \"nx32\",\niscrosscompiler = true,\nnamestyle = \"NX\",\n},\nNX64 =\n{\ncfgsuffix = \"nx64\",\niscrosscompiler = true,\nnamestyle = \"NX\",\n},\nEmscripten =\n{\ncfgsuffix = \"emscripten\",\niscrosscompiler = true,\nnosharedlibs = true,\nnamestyle = \"Emscripten\",\n},\n[\"gdk-desktop\"] =\n{\ncfgsuffix = \"gdk-desktop\",\nnamestyle = \"windows\",\n},\n[\"gdk-xboxone\"] =\n{\ncfgsuffix = \"gdk-xboxone\",\nnamestyle = \"windows\",\n},\n[\"gdk-scarlett\"] =\n{\ncfgsuffix = \"gdk-scarlett\",\nnamestyle = \"windows\",\n},\n}\nlocal builtin_dofile = dofile\nfunction dofile(fname)\nlocal oldcwd = os.getcwd()\nlocal oldfile = _SCRIPT\nif (not os.isfile(fname)) then\nlocal path = os.pathsearch(fname, _OPTIONS[\"scripts\"], os.getenv(\"PREMAKE_" + "PATH\"))\nif (path) then\nfname = path..\"/\"..fname\nend\nend\n_SCRIPT = path.getabsolute(fname)\nlocal newcwd = path.getdirectory(_SCRIPT)\nos.chdir(newcwd)\nlocal a, b, c, d, e, f = builtin_dofile(_SCRIPT)\n_SCRIPT = oldfile\nos.chdir(oldcwd)\nreturn a, b, c, d, e, f\nend\nfunction iif(expr, trueval, falseval)\nif (expr) then\nreturn trueval\nelse\nreturn falseval\nend\nend\nfunction include(fname)\nlocal dir, name = premake.findDefaultScript(fname, false)\nif dir ~= nil then\nreturn dofile(dir .. \"/\" .. name)\nend\nreturn nil\nend\nfunction printf(msg, ...)\nlocal arg={...}\nprint(string.format(msg, table.unpack(arg)))\nend\nfunction typex(t)\nlocal mt = getmetatable(t)\nif (mt) then\nif (mt.__type) then\nreturn mt.__type\nend\nend\nreturn type(t)\nend\n", /* base/action.lua */ "premake.action = { }\npremake.action.list = { }\nfunction premake.action.add(a)\nlocal missing\nfor _, field in ipairs({\"description\", \"trigger\"}) do\nif (not a[field]) then\nmissing = field\nend\nend\nif (missing) then\nerror(\"action needs a \" .. missing, 3)\nend\npremake.action.list[a.trigger] = a\nend\nfunction premake.action.call(name)\nlocal a = premake.action.list[name]\nfor sln in premake.solution.each() do\nif a.onsolution then\na.onsolution(sln)\nend\nif sln.postsolutioncallbacks then\nfor _,cb in ipairs(sln.postsolutioncallbacks) do\ncb(sln)\nend\nend\nfor prj in premake.solution.eachproject(sln) do\nif a.onproject then\na.onproject(prj)\nend\nif prj.postprojectcallbacks then\nfor _,cb in ipairs(prj.postprojectcallbacks) do\ncb(prj)\nend\nend\nend\nend\nif a.execute then\na.execute()\nend\nend\nfunction premake.action.current()\nreturn premake.action.get(_ACTION)\nend\nfunction premake.action.get(name)\nreturn premake.action.list[name]\nend\nfunction premake.action.each()\nlocal keys = { }\nfor" @@ -57,13 +58,13 @@ const char* builtin_scripts[] = { "return prj\nend\nend\nend\nend\nfunction premake.findfile(prj, extension)\nfor _, fname in ipairs(prj.files) do\nif fname:endswith(extension) then return fname end\nend\nend\nfunction premake.getconfig(prj, cfgname, pltname)\nprj = prj.project or prj\nif pltname == \"Native\" or not table.contains(prj.solution.platforms or {}, pltname) then\npltname = nil\nend\nlocal key = (cfgname or \"\")\nif pltname then key = key .. pltname end\nreturn prj.__configs[key]\nend\nfunction premake.getconfigname(cfgname, platform, useshortname)\nif cfgname then\nlocal name = cfgname\nif platform and platform ~= \"Native\" then\nif useshortname then\nname = name .. premake.platforms[platform].cfgsuffix\nelse\nname = name .. \"|\" .. platform\nend\nend\nreturn iif(useshortname, name:lower(), name)\nend\nend\nfunction premake.getdependencies(prj)\nprj = prj.project or prj\nlocal results = { }\nfor _, cfg in pairs(prj.__configs) do\nfor _, link in ipairs(cfg.links) do\nlocal dep = premake.findproject(link)\nif dep and not table.co" "ntains(results, dep) then\ntable.insert(results, dep)\nend\nend\nend\nreturn results\nend\nfunction premake.project.getbasename(prjname, pattern)\nreturn pattern:gsub(\"%%%%\", prjname)\nend\nfunction premake.project.getfilename(prj, pattern)\nlocal fname = premake.project.getbasename(prj.name, pattern)\nfname = path.join(prj.location, fname)\nreturn path.getrelative(os.getcwd(), fname)\nend\n function premake.getlinks(cfg, kind, part)\nlocal result = iif (part == \"directory\" and kind == \"all\", cfg.libdirs, {})\nlocal cfgname = iif(cfg.name == cfg.project.name, \"\", cfg.name)\nlocal pathstyle = premake.getpathstyle(cfg)\nlocal namestyle = premake.getnamestyle(cfg)\nlocal function canlink(source, target)\nif (target.kind ~= \"SharedLib\" and target.kind ~= \"StaticLib\") then\nreturn false\nend\nif premake.iscppproject(source) then\nreturn premake.iscppproject(target)\nelseif premake.isdotnetproject(source) then\nreturn premake.isdotnetproject(target)\nelseif premake.isswiftproject(source) then\nreturn pre" "make.isswiftproject(source) or premake.iscppproject(source)\nend\nend\nfor _, link in ipairs(cfg.links) do\nlocal item\nlocal prj = premake.findproject(link)\nif prj and kind ~= \"system\" then\nlocal prjcfg = premake.getconfig(prj, cfgname, cfg.platform)\nif kind == \"dependencies\" or canlink(cfg, prjcfg) then\nif (part == \"directory\") then\nitem = path.rebase(prjcfg.linktarget.directory, prjcfg.location, cfg.location)\nelseif (part == \"basename\") then\nitem = prjcfg.linktarget.basename\nelseif (part == \"fullpath\") then\nitem = path.rebase(prjcfg.linktarget.fullpath, prjcfg.location, cfg.location)\nelseif (part == \"object\") then\nitem = prjcfg\nend\nend\nelseif not prj and (kind == \"system\" or kind == \"all\") then\nif (part == \"directory\") then\nitem = path.getdirectory(link)\nelseif (part == \"fullpath\") then\nitem = link\nif namestyle == \"windows\" then\nif premake.iscppproject(cfg) then\nitem = item .. \".lib\"\nelseif premake.isdotnetproject(cfg) then\nitem = item .. \".dll\"\nend\nend\nel" - "seif part == \"name\" then\nitem = path.getname(link)\nelseif part == \"basename\" then\nitem = path.getbasename(link)\nelse\nitem = link\nend\nif item:find(\"/\", nil, true) then\nitem = path.getrelative(cfg.project.location, item)\nend\nend\nif item then\nif pathstyle == \"windows\" and part ~= \"object\" then\nitem = path.translate(item, \"\\\\\")\nend\nif not table.contains(result, item) then\ntable.insert(result, item)\nend\nend\nend\nreturn result\nend\nfunction premake.getnamestyle(cfg)\nreturn premake.platforms[cfg.platform].namestyle or premake.gettool(cfg).namestyle or \"posix\"\nend\nfunction premake.getpathstyle(cfg)\nif premake.action.current().os == \"windows\" then\nreturn \"windows\"\nelse\nreturn \"posix\"\nend\nend\nfunction premake.gettarget(cfg, direction, pathstyle, namestyle, system)\nif system == \"bsd\" then\nsystem = \"linux\"\nend\nlocal kind = cfg.kind\nif premake.iscppproject(cfg) then\nif (namestyle == \"windows\" or system == \"windows\")\nand kind == \"SharedLib\" and direction =" - "= \"link\"\nand not cfg.flags.NoImportLib\nthen\nkind = \"StaticLib\"\nend\nif namestyle == \"posix\" and system == \"windows\" and kind ~= \"StaticLib\" then\nnamestyle = \"windows\"\nend\nend\nlocal field = \"build\"\nif direction == \"link\" and cfg.kind == \"SharedLib\" then\nfield = \"implib\"\nend\nlocal name = cfg[field..\"name\"] or cfg.targetname or cfg.project.name\nlocal dir = cfg[field..\"dir\"] or cfg.targetdir or path.getrelative(cfg.location, cfg.basedir)\nlocal subdir = cfg[field..\"subdir\"] or cfg.targetsubdir or \".\"\nlocal prefix = \"\"\nlocal suffix = \"\"\nlocal ext = \"\"\nlocal bundlepath, bundlename\ndir = path.join(dir, subdir)\nif namestyle == \"windows\" then\nif kind == \"ConsoleApp\" or kind == \"WindowedApp\" then\next = \".exe\"\nelseif kind == \"SharedLib\" then\next = \".dll\"\nelseif kind == \"StaticLib\" then\next = \".lib\"\nend\nelseif namestyle == \"posix\" then\nif kind == \"WindowedApp\" and system == \"macosx\" and not cfg.options.SkipBundling then\nbu" - "ndlename = name .. \".app\"\nbundlepath = path.join(dir, bundlename)\ndir = path.join(bundlepath, \"Contents/MacOS\")\nelseif (kind == \"ConsoleApp\" or kind == \"WindowedApp\") and system == \"os2\" then\next = \".exe\"\nelseif kind == \"SharedLib\" then\nprefix = \"lib\"\next = iif(system == \"macosx\", \".dylib\", \".so\")\nelseif kind == \"StaticLib\" then\nprefix = \"lib\"\next = \".a\"\nend\nelseif namestyle == \"PS3\" then\nif kind == \"ConsoleApp\" or kind == \"WindowedApp\" then\next = \".elf\"\nelseif kind == \"StaticLib\" then\nprefix = \"lib\"\next = \".a\"\nend\nelseif namestyle == \"Orbis\" then\nif kind == \"ConsoleApp\" or kind == \"WindowedApp\" then\next = \".elf\"\nelseif kind == \"StaticLib\" then\nprefix = \"lib\"\next = \".a\"\nelseif kind == \"SharedLib\" then\next = \".prx\"\nend\nelseif namestyle == \"TegraAndroid\" then\nif kind == \"ConsoleApp\" or kind == \"WindowedApp\" or kind == \"SharedLib\" then\nprefix = \"lib\"\next = \".so\"\nelseif kind == \"StaticLib\" then\nprefix = \"lib" - "\"\next = \".a\"\nend\nelseif namestyle == \"NX\" then\nif kind == \"ConsoleApp\" or kind == \"WindowedApp\" then\next = \".nspd_root\"\nelseif kind == \"StaticLib\" then\next = \".a\"\nelseif kind == \"SharedLib\" then\next = \".nro\"\nend\nelseif namestyle == \"Emscripten\" then\nif kind == \"ConsoleApp\" or kind == \"WindowedApp\" then\next = \".html\"\nelseif kind == \"StaticLib\" then\next = \".bc\"\nelseif kind == \"SharedLib\" then\next = \".js\"\nend\nend\nprefix = cfg[field..\"prefix\"] or cfg.targetprefix or prefix\nsuffix = cfg[field..\"suffix\"] or cfg.targetsuffix or suffix\next = cfg[field..\"extension\"] or cfg.targetextension or ext\nlocal result = { }\nresult.basename = name .. suffix\nresult.name = prefix .. name .. suffix .. ext\nresult.directory = dir\nresult.subdirectory = subdir\nresult.prefix = prefix\nresult.suffix = suffix\nresult.fullpath = path.join(result.directory, result.name)\nresult.bundlepath = bundlepath or result.fullpath\nif pathstyle == " - "\"windows\" then\nresult.directory = path.translate(result.directory, \"\\\\\")\nresult.subdirectory = path.translate(result.subdirectory, \"\\\\\")\nresult.fullpath = path.translate(result.fullpath, \"\\\\\")\nend\nreturn result\nend\nfunction premake.gettool(cfg)\nif premake.iscppproject(cfg) then\nif _OPTIONS.cc then\nreturn premake[_OPTIONS.cc]\nend\nlocal action = premake.action.current()\nif action.valid_tools then\nreturn premake[action.valid_tools.cc[1]]\nend\nreturn premake.gcc\nelseif premake.isdotnetproject(cfg) then\nreturn premake.dotnet\nelseif premake.isswiftproject(cfg) then\nreturn premake.swift\nelse\nreturn premake.valac\nend\nend\nfunction premake.project.getvpath(prj, abspath)\nlocal vpath = abspath\nlocal fname = path.getname(abspath)\nlocal max = abspath:len() - fname:len()\n \n -- First check for an exact match from the inverse vpaths\n if prj.inversevpaths and prj.inversevpaths[abspath] then\n return path.join(prj.inversevpaths[abspath], fname)\n" - " end\n local matches = {}\nfor replacement, patterns in pairs(prj.vpaths or {}) do\nfor _, pattern in ipairs(patterns) do\nlocal i = abspath:find(path.wildcards(pattern))\nif i == 1 then\ni = pattern:find(\"*\", 1, true) or (pattern:len() + 1)\nlocal leaf\nif i < max then\nleaf = abspath:sub(i)\nelse\nleaf = fname\nend\nif leaf:startswith(\"/\") then\nleaf = leaf:sub(2)\nend\nlocal stem = \"\"\nif replacement:len() > 0 then\nstem, stars = replacement:gsub(\"%*\", \"\")\nif stars == 0 then\nleaf = path.getname(leaf)\nend\nelse\nleaf = path.getname(leaf)\nend\ntable.insert(matches, path.join(stem, leaf))\nend\nend\nend\n \n if #matches > 0 then\n -- for the sake of determinism, return the first alphabetically\n table.sort(matches)\n vpath = matches[1]\n end\nreturn path.trimdots(vpath)\nend\nfunction premake.hascppproject(sln)\nfor prj in premake.solution.eachproject(sln) do\nif premake.iscppproject(prj) then\nreturn true\nend\nend\nend\nfunctio" - "n premake.hasdotnetproject(sln)\nfor prj in premake.solution.eachproject(sln) do\nif premake.isdotnetproject(prj) then\nreturn true\nend\nend\nend\nfunction premake.project.iscproject(prj)\nreturn prj.language == \"C\"\nend\nfunction premake.iscppproject(prj)\nreturn (prj.language == \"C\" or prj.language == \"C++\")\nend\nfunction premake.isdotnetproject(prj)\nreturn (prj.language == \"C#\")\nend\nfunction premake.isvalaproject(prj)\nreturn (prj.language == \"Vala\")\nend\nfunction premake.isswiftproject(prj)\nreturn (prj.language == \"Swift\")\nend\n", + "seif part == \"name\" then\nitem = path.getname(link)\nelseif part == \"basename\" then\nitem = path.getbasename(link)\nelse\nitem = link\nend\nif item:find(\"/\", nil, true) then\nitem = path.getrelative(cfg.project.location, item)\nend\nend\nif item then\nif pathstyle == \"windows\" and part ~= \"object\" then\nitem = path.translate(item, \"\\\\\")\nend\nif not table.contains(result, item) then\ntable.insert(result, item)\nend\nend\nend\nreturn result\nend\nfunction premake.getnamestyle(cfg)\nreturn premake.platforms[cfg.platform].namestyle or premake.gettool(cfg).namestyle or \"posix\"\nend\nfunction premake.getpathstyle(cfg)\nif premake.action.current().os == \"windows\" then\nreturn \"windows\"\nelse\nreturn \"posix\"\nend\nend\nfunction premake.gettarget(cfg, direction, pathstyle, namestyle, system)\nif system == \"bsd\" then\nsystem = \"linux\"\nend\nlocal kind = cfg.kind\nif premake.iscppproject(cfg) or premake.isvalaproject(cfg) then\nif (namestyle == \"windows\" or system == \"windows\")\nand kind ==" + " \"SharedLib\" and direction == \"link\"\nand not cfg.flags.NoImportLib\nthen\nkind = \"StaticLib\"\nend\nif namestyle == \"posix\" and system == \"windows\" and kind ~= \"StaticLib\" then\nnamestyle = \"windows\"\nend\nend\nlocal field = \"build\"\nif direction == \"link\" and cfg.kind == \"SharedLib\" then\nfield = \"implib\"\nend\nlocal name = cfg[field..\"name\"] or cfg.targetname or cfg.project.name\nlocal dir = cfg[field..\"dir\"] or cfg.targetdir or path.getrelative(cfg.location, cfg.basedir)\nlocal subdir = cfg[field..\"subdir\"] or cfg.targetsubdir or \".\"\nlocal prefix = \"\"\nlocal suffix = \"\"\nlocal ext = \"\"\nlocal bundlepath, bundlename\ndir = path.join(dir, subdir)\nif namestyle == \"windows\" then\nif kind == \"ConsoleApp\" or kind == \"WindowedApp\" then\next = \".exe\"\nelseif kind == \"SharedLib\" then\next = \".dll\"\nelseif kind == \"StaticLib\" then\next = \".lib\"\nend\nelseif namestyle == \"posix\" then\nif kind == \"WindowedApp\" and system == \"macosx\" and not cfg" + ".options.SkipBundling then\nbundlename = name .. \".app\"\nbundlepath = path.join(dir, bundlename)\ndir = path.join(bundlepath, \"Contents/MacOS\")\nelseif (kind == \"ConsoleApp\" or kind == \"WindowedApp\") and system == \"os2\" then\next = \".exe\"\nelseif kind == \"SharedLib\" then\nprefix = \"lib\"\next = iif(system == \"macosx\", \".dylib\", \".so\")\nelseif kind == \"StaticLib\" then\nprefix = \"lib\"\next = \".a\"\nend\nelseif namestyle == \"PS3\" then\nif kind == \"ConsoleApp\" or kind == \"WindowedApp\" then\next = \".elf\"\nelseif kind == \"StaticLib\" then\nprefix = \"lib\"\next = \".a\"\nend\nelseif namestyle == \"Orbis\" then\nif kind == \"ConsoleApp\" or kind == \"WindowedApp\" then\next = \".elf\"\nelseif kind == \"StaticLib\" then\nprefix = \"lib\"\next = \".a\"\nelseif kind == \"SharedLib\" then\next = \".prx\"\nend\nelseif namestyle == \"TegraAndroid\" then\nif kind == \"ConsoleApp\" or kind == \"WindowedApp\" or kind == \"SharedLib\" then\nprefix = \"lib\"\next = \".so\"\nelseif kind == \"St" + "aticLib\" then\nprefix = \"lib\"\next = \".a\"\nend\nelseif namestyle == \"NX\" then\nif kind == \"ConsoleApp\" or kind == \"WindowedApp\" then\next = \".nspd_root\"\nelseif kind == \"StaticLib\" then\next = \".a\"\nelseif kind == \"SharedLib\" then\next = \".nro\"\nend\nelseif namestyle == \"Emscripten\" then\nif kind == \"ConsoleApp\" or kind == \"WindowedApp\" then\next = \".html\"\nelseif kind == \"StaticLib\" then\next = \".a\"\nelseif kind == \"SharedLib\" then\next = \".js\"\nend\nend\nprefix = cfg[field..\"prefix\"] or cfg.targetprefix or prefix\nsuffix = cfg[field..\"suffix\"] or cfg.targetsuffix or suffix\next = cfg[field..\"extension\"] or cfg.targetextension or ext\nlocal result = { }\nresult.basename = name .. suffix\nresult.name = prefix .. name .. suffix .. ext\nresult.directory = dir\nresult.subdirectory = subdir\nresult.prefix = prefix\nresult.suffix = suffix\nresult.fullpath = path.join(result.directory, result.name)\nresult.bundlepath = bundlepath or resul" + "t.fullpath\nif pathstyle == \"windows\" then\nresult.directory = path.translate(result.directory, \"\\\\\")\nresult.subdirectory = path.translate(result.subdirectory, \"\\\\\")\nresult.fullpath = path.translate(result.fullpath, \"\\\\\")\nend\nreturn result\nend\nfunction premake.gettool(prj)\nif premake.iscppproject(prj) then\nif _OPTIONS.cc then\nreturn premake[_OPTIONS.cc]\nend\nlocal action = premake.action.current()\nif action.valid_tools then\nreturn premake[action.valid_tools.cc[1]]\nend\nreturn premake.gcc\nelseif premake.isdotnetproject(prj) then\nreturn premake.dotnet\nelseif premake.isswiftproject(prj) then\nreturn premake.swift\nelse\nreturn premake.valac\nend\nend\nfunction premake.project.getvpath(prj, abspath)\nlocal vpath = abspath\nlocal fname = path.getname(abspath)\nlocal max = abspath:len() - fname:len()\n -- First check for an exact match from the inverse vpaths\n if prj.inversevpaths and prj.inversevpaths[abspath] then\n return path.join(prj.inversevpaths[" + "abspath], fname)\n end\n local matches = {}\nfor replacement, patterns in pairs(prj.vpaths or {}) do\nfor _, pattern in ipairs(patterns) do\nlocal i = abspath:find(path.wildcards(pattern))\nif i == 1 then\ni = pattern:find(\"*\", 1, true) or (pattern:len() + 1)\nlocal leaf\nif i < max then\nleaf = abspath:sub(i)\nelse\nleaf = fname\nend\nif leaf:startswith(\"/\") then\nleaf = leaf:sub(2)\nend\nlocal stem = \"\"\nif replacement:len() > 0 then\nstem, stars = replacement:gsub(\"%*\", \"\")\nif stars == 0 then\nleaf = path.getname(leaf)\nend\nelse\nleaf = path.getname(leaf)\nend\ntable.insert(matches, path.join(stem, leaf))\nend\nend\nend\n if #matches > 0 then\n -- for the sake of determinism, return the first alphabetically\n table.sort(matches)\n vpath = matches[1]\n end\nreturn path.trimdots(vpath)\nend\nfunction premake.hascppproject(sln)\nfor prj in premake.solution.eachproject(sln) do\nif premake.iscppproject(prj) then\nreturn true\nend\nend\nend" + "\nfunction premake.hasdotnetproject(sln)\nfor prj in premake.solution.eachproject(sln) do\nif premake.isdotnetproject(prj) then\nreturn true\nend\nend\nend\nfunction premake.project.iscproject(prj)\nlocal language = prj.language or prj.solution.language\nreturn language == \"C\"\nend\nfunction premake.iscppproject(prj)\nlocal language = prj.language or prj.solution.language\nreturn (language == \"C\" or language == \"C++\")\nend\nfunction premake.isdotnetproject(prj)\nlocal language = prj.language or prj.solution.language\nreturn (language == \"C#\")\nend\nfunction premake.isvalaproject(prj)\nlocal language = prj.language or prj.solution.language\nreturn (language == \"Vala\")\nend\nfunction premake.isswiftproject(prj)\nlocal language = prj.language or prj.solution.language\nreturn (language == \"Swift\")\nend\n", /* base/config.lua */ "premake.config = { }\nlocal config = premake.config\nfunction premake.config.isdebugbuild(cfg)\nif cfg.flags.DebugRuntime then\nreturn true\nend\nif cfg.flags.ReleaseRuntime then\nreturn false\nend\nif cfg.flags.Optimize or cfg.flags.OptimizeSize or cfg.flags.OptimizeSpeed then\nreturn false\nend\nif not cfg.flags.Symbols then\nreturn false\nend\nreturn true\nend\nfunction premake.config.eachfile(cfg)\nlocal i = 0\nlocal t = cfg.files\nreturn function ()\ni = i + 1\nif (i <= #t) then\nlocal fcfg = cfg.__fileconfigs[t[i]]\nfcfg.vpath = premake.project.getvpath(cfg.project, fcfg.name)\nreturn fcfg\nend\nend\nend\nfunction premake.config.isincrementallink(cfg)\nif cfg.kind == \"StaticLib\" then\nreturn false\nend\nreturn not config.islinkeroptimizedbuild(cfg.flags) and not cfg.flags.NoIncrementalLink\nend\nfunction premake.config.isoptimizedbuild(flags)\nreturn flags.Optimize or flags.OptimizeSize or flags.OptimizeSpeed\nend\nfunction premake.config.islinkeroptimizedbuild(flags)\nreturn config.isoptimizedbuild(fl" @@ -71,22 +72,22 @@ const char* builtin_scripts[] = { /* base/bake.lua */ "premake.bake = { }\nlocal bake = premake.bake\nlocal nocopy =\n{\nblocks = true,\nkeywords = true,\nprojects = true,\n__configs = true,\n}\nlocal nocascade =\n{\nmakesettings = true,\n}\nlocal keeprelative =\n{\nbasedir = true,\nlocation = true,\n}\nfunction premake.getactiveterms(obj)\nlocal terms = { _action = _ACTION:lower(), os = os.get() }\nfor key, value in pairs(_OPTIONS) do\nif value ~= \"\" then\ntable.insert(terms, value:lower())\nelse\ntable.insert(terms, key:lower())\nend\nend\nreturn terms\nend\nfunction premake.iskeywordmatch(keyword, terms)\nif keyword:startswith(\"not \") then\nreturn not premake.iskeywordmatch(keyword:sub(5), terms)\nend\nfor _, pattern in ipairs(keyword:explode(\" or \")) do\nfor termkey, term in pairs(terms) do\nif term:match(pattern) == term then\nreturn termkey\nend\nend\nend\nend\nfunction premake.iskeywordsmatch(keywords, terms)\nlocal hasrequired = false\nfor _, keyword in ipairs(keywords) do\nlocal matched = premake.iskeywordmatch(keyword, terms)\nif not matched " - "then\nreturn false\nend\nif matched == \"required\" then\nhasrequired = true\nend\nend\nif terms.required and not hasrequired then\nreturn false\nelse\nreturn true\nend\nend\nlocal function adjustpaths(location, obj)\nfunction adjustpathlist(list)\nfor i, p in ipairs(list) do\nlist[i] = path.getrelative(location, p)\nend\nend\nif obj.allfiles ~= nil then\nadjustpathlist(obj.allfiles)\nend\nfor name, value in pairs(obj) do\nlocal field = premake.fields[name]\nif field and value and not keeprelative[name] then\nif field.kind == \"path\" then\nobj[name] = path.getrelative(location, value)\nelseif field.kind == \"dirlist\" or field.kind == \"filelist\" then\nadjustpathlist(value)\nelseif field.kind == \"keypath\" then\nfor k,v in pairs(value) do\nadjustpathlist(v)\nend\nend\nend\nend\nend\nlocal function removevalue(tbl, remove)\nfor index, item in ipairs(tbl) do\nif item == remove then\ntable.remove(tbl, index)\nbreak\nend\nend\nend\nlocal function removevalues(tbl, removes)\nfor k, v in pairs(tbl) do\nfor _, pat" - "tern in ipairs(removes) do\nif pattern == tbl[k] then\nif type(k) == \"number\" then\ntable.remove(tbl, k)\nelse\ntbl[k] = nil\nend\nbreak\nend\nend\nend\nend\nlocal function mergefield(kind, dest, src, mergecopiestotail)\nlocal tbl = dest or { }\nif kind == \"keyvalue\" or kind == \"keypath\" then\nfor key, value in pairs(src) do\ntbl[key] = mergefield(\"list\", tbl[key], value, mergecopiestotail)\nend\nelse\nfor _, item in ipairs(src) do\nif tbl[item] then\nif mergecopiestotail then\nremovevalue(tbl, item)\ntable.insert(tbl, item)\ntbl[item] = item\nend\nelse\ntable.insert(tbl, item)\ntbl[item] = item\nend\nend\nend\nreturn tbl\nend\nlocal function mergeobject(dest, src)\nif not src then\nreturn\nend\nfor fieldname, value in pairs(src) do\nif not nocopy[fieldname] then\nlocal field = premake.fields[fieldname]\nif field then\nif type(value) == \"table\" then\ndest[fieldname] = mergefield(field.kind, dest[fieldname], value, field.mergecopiestotail)\nif src.removes then\nremoves = src.removes[fieldname]\nif rem" - "oves then\nremovevalues(dest[fieldname], removes)\nend\nend\nelse\ndest[fieldname] = value\nend\nelse\ndest[fieldname] = value\nend\nend\nend\nend\nlocal function merge(dest, obj, basis, terms, cfgname, pltname)\nlocal key = cfgname or \"\"\npltname = pltname or \"Native\"\nif pltname ~= \"Native\" then\nkey = key .. pltname\nend\nterms.config = (cfgname or \"\"):lower()\nterms.platform = pltname:lower()\nlocal cfg = {}\nmergeobject(cfg, basis[key])\nadjustpaths(obj.location, cfg)\nmergeobject(cfg, obj)\nif (cfg.kind) then\nterms['kind']=cfg.kind:lower()\nend\nfor _, blk in ipairs(obj.blocks) do\nif (premake.iskeywordsmatch(blk.keywords, terms))then\nmergeobject(cfg, blk)\nif (cfg.kind and not cfg.terms.kind) then\ncfg.terms['kind'] = cfg.kind:lower()\nterms['kind'] = cfg.kind:lower()\nend\nend\nend\ncfg.name = cfgname\ncfg.platform = pltname\nfor k,v in pairs(terms) do\ncfg.terms[k] =v\nend\ndest[key] = cfg\nend\nlocal function collapse(obj, basis)\nlocal result = {}\nbasis = basis or {}\nlocal sln = ob" - "j.solution or obj\nlocal terms = premake.getactiveterms(obj)\nmerge(result, obj, basis, terms)--this adjusts terms\nfor _, cfgname in ipairs(sln.configurations) do\nlocal terms_local = {}\nfor k,v in pairs(terms)do terms_local[k]=v end\nmerge(result, obj, basis, terms_local, cfgname, \"Native\")--terms cam also be adjusted here\nfor _, pltname in ipairs(sln.platforms or {}) do\nif pltname ~= \"Native\" then\nmerge(result, obj, basis,terms_local, cfgname, pltname)--terms also here\nend\nend\nend\nreturn result\nend\nlocal function builduniquedirs()\nlocal num_variations = 4\nlocal cfg_dirs = {}\nlocal hit_counts = {}\nfor sln in premake.solution.each() do\nfor _, prj in ipairs(sln.projects) do\nfor _, cfg in pairs(prj.__configs) do\nlocal dirs = { }\ndirs[1] = path.getabsolute(path.join(cfg.location, cfg.objdir or cfg.project.objdir or \"obj\"))\ndirs[2] = path.join(dirs[1], iif(cfg.platform == \"Native\", \"\", cfg.platform))\ndirs[3] = path.join(dirs[2], cfg.name)\ndirs[4] = path.join(dirs[3], cfg.project.nam" - "e)\ncfg_dirs[cfg] = dirs\nlocal start = iif(cfg.name, 2, 1)\nfor v = start, num_variations do\nlocal d = dirs[v]\nhit_counts[d] = (hit_counts[d] or 0) + 1\nend\nend\nend\nend\nfor sln in premake.solution.each() do\nfor _, prj in ipairs(sln.projects) do\nfor _, cfg in pairs(prj.__configs) do\nlocal dir\nlocal start = iif(cfg.name, 2, 1)\nfor v = start, iif(cfg.flags.SingleOutputDir==true,num_variations-1,num_variations) do\ndir = cfg_dirs[cfg][v]\nif hit_counts[dir] == 1 then break end\nend\ncfg.objectsdir = path.getrelative(cfg.location, dir)\nend\nend\nend\nend\nlocal function buildtargets()\nfor sln in premake.solution.each() do\nfor _, prj in ipairs(sln.projects) do\nfor _, cfg in pairs(prj.__configs) do\nlocal pathstyle = premake.getpathstyle(cfg)\nlocal namestyle = premake.getnamestyle(cfg)\ncfg.buildtarget = premake.gettarget(cfg, \"build\", pathstyle, namestyle, cfg.system)\ncfg.linktarget = premake.gettarget(cfg, \"link\", pathstyle, namestyle, cfg.system)\nif pathstyle == \"windows\" then\ncfg.objec" - "tsdir = path.translate(cfg.objectsdir, \"\\\\\")\nend\nend\nend\nend\nend\n local function getCfgKind(cfg)\n if(cfg.kind) then\n return cfg.kind;\n end\n if(cfg.project.__configs[\"\"] and cfg.project.__configs[\"\"].kind) then\n return cfg.project.__configs[\"\"].kind;\n end\n return nil\n end\n local function getprojrec(dstArray, foundList, cfg, cfgname, searchField, bLinkage)\n if(not cfg) then return end\n local foundUsePrjs = {};\n for _, useName in ipairs(cfg[searchField]) do\n local testName = useName:lower();\n if((not foundList[testName])) then\n local theProj = nil;\n local theUseProj = nil;\n for _, prj in ipairs(cfg.project.solution.projects) do\n if (prj.name:lower() == testName) then\n if(prj.usage) then\n theUseProj = prj;\n else\n theProj = prj;\n end\n end\n end\n --Must connect to a usage project.\n if(theUseProj) then\n foundList[testName] = true;\n local prjEntry = {\n name = testName,\n proj = theProj,\n usageProj = theUseProj,\n bLinkageOnly = bLinkage,\n" - " };\n dstArray[testName] = prjEntry;\n table.insert(foundUsePrjs, theUseProj);\n end\n end\n end\n for _, usePrj in ipairs(foundUsePrjs) do\n --Links can only recurse through static libraries.\n if((searchField ~= \"links\") or\n (getCfgKind(usePrj.__configs[cfgname]) == \"StaticLib\")) then\n getprojrec(dstArray, foundList, usePrj.__configs[cfgname],\n cfgname, searchField, bLinkage);\n end\n end\n end\n --\n -- This function will recursively get all projects that the given configuration has in its \"uses\"\n -- field. The return values are a list of tables. Each table in that list contains the following:\n --name = The lowercase name of the project.\n --proj = The project. Can be nil if it is usage-only.\n --usageProj = The usage project. Can't be nil, as using a project that has no\n -- usage project is not put into the list.\n --bLinkageOnly = If this is true, then only the linkage information should be copied.\n -- The recursion will only look at the \"uses\" field on *usage* proje" - "cts.\n -- This function will also add projects to the list that are mentioned in the \"links\"\n -- field of usage projects. These will only copy linker information, but they will recurse.\n -- through other \"links\" fields.\n --\n local function getprojectsconnections(cfg, cfgname)\n local dstArray = {};\n local foundList = {};\n foundList[cfg.project.name:lower()] = true;\n --First, follow the uses recursively.\n getprojrec(dstArray, foundList, cfg, cfgname, \"uses\", false);\n --Next, go through all of the usage projects and recursively get their links.\n --But only if they're not already there. Get the links as linkage-only.\n local linkArray = {};\n for prjName, prjEntry in pairs(dstArray) do\n getprojrec(linkArray, foundList, prjEntry.usageProj.__configs[cfgname], cfgname,\n \"links\", true);\n end\n --Copy from linkArray into dstArray.\n for prjName, prjEntry in pairs(linkArray) do\n dstArray[prjName] = prjEntry;\n end\n return dstArray;\n end\n local function isnameofproj(cfg, " - "strName)\n local sln = cfg.project.solution;\n local strTest = strName:lower();\n for prjIx, prj in ipairs(sln.projects) do\n if (prj.name:lower() == strTest) then\n return true;\n end\n end\n return false;\n end\n --\n -- Copies the field from dstCfg to srcCfg.\n --\n local function copydependentfield(srcCfg, dstCfg, strSrcField)\n local srcField = premake.fields[strSrcField];\n local strDstField = strSrcField;\n if type(srcCfg[strSrcField]) == \"table\" then\n --handle paths.\n if (srcField.kind == \"dirlist\" or srcField.kind == \"filelist\") and\n (not keeprelative[strSrcField]) then\n for i,p in ipairs(srcCfg[strSrcField]) do\n table.insert(dstCfg[strDstField],\n path.rebase(p, srcCfg.project.location, dstCfg.project.location))\n end\n else\n if(strSrcField == \"links\") then\n for i,p in ipairs(srcCfg[strSrcField]) do\n if(not isnameofproj(dstCfg, p)) then\n table.insert(dstCfg[strDstField], p)\n else\n printf(\"Failed to copy '%s' from proj '%s'.\",\n p, srcCfg.project.nam" - "e);\n end\n end\n else\n for i,p in ipairs(srcCfg[strSrcField]) do\n table.insert(dstCfg[strDstField], p)\n end\n end\n end\n else\n if(srcField.kind == \"path\" and (not keeprelative[strSrcField])) then\n dstCfg[strDstField] = path.rebase(srcCfg[strSrcField],\n prj.location, dstCfg.project.location);\n else\n dstCfg[strDstField] = srcCfg[strSrcField];\n end\n end\n end\n --\n -- This function will take the list of project entries and apply their usage project data\n -- to the given configuration. It will copy compiling information for the projects that are\n -- not listed as linkage-only. It will copy the linking information for projects only if\n -- the source project is not a static library. It won't copy linking information\n -- if the project is in this solution; instead it will add that project to the configuration's\n -- links field, expecting that Premake will handle the rest.\n --\n local function copyusagedata(cfg, cfgname, linkToProjs)\n local myPrj = cfg.project;\n local" - " bIsStaticLib = (getCfgKind(cfg) == \"StaticLib\");\n for prjName, prjEntry in pairs(linkToProjs) do\n local srcPrj = prjEntry.usageProj;\n local srcCfg = srcPrj.__configs[cfgname];\n for name, field in pairs(premake.fields) do\n if(srcCfg[name]) then\n if(field.usagecopy) then\n if(not prjEntry.bLinkageOnly) then\n copydependentfield(srcCfg, cfg, name)\n end\n elseif(field.linkagecopy) then\n --Copy the linkage data if we're building a non-static thing\n --and this is a pure usage project. If it's not pure-usage, then\n --we will simply put the project's name in the links field later.\n if((not bIsStaticLib) and (not prjEntry.proj)) then\n copydependentfield(srcCfg, cfg, name)\n end\n end\n end\n end\n if((not bIsStaticLib) and prjEntry.proj) then\n table.insert(cfg.links, prjEntry.proj.name);\n end\n end\n end\n local function inverseliteralvpaths()\n for sln in premake.solution.each() do\n for _,prj in ipairs(sln.projects) do\n prj.inversevpaths = " - "{}\n for replacement, patterns in pairs(prj.vpaths or {}) do\n for _, pattern in ipairs(patterns) do\n if string.find(pattern, \"*\") == nil then\n prj.inversevpaths[pattern] = replacement\n end\n end\n end\n end\n end\n end\nfunction premake.bake.buildconfigs()\nfor sln in premake.solution.each() do\nfor _, prj in ipairs(sln.projects) do\nprj.location = prj.location or sln.location or prj.basedir\nadjustpaths(prj.location, prj)\nfor _, blk in ipairs(prj.blocks) do\nadjustpaths(prj.location, blk)\nend\nend\nsln.location = sln.location or sln.basedir\nend\n -- convert paths for imported projects to be relative to solution location\nfor sln in premake.solution.each() do\nfor _, iprj in ipairs(sln.importedprojects) do\niprj.location = path.getabsolute(iprj.location)\nend\nend\n inverseliteralvpaths()\nfor sln in premake.solution.each() do\n" - "local basis = collapse(sln)\nfor _, prj in ipairs(sln.projects) do\nprj.__configs = collapse(prj, basis)\nfor _, cfg in pairs(prj.__configs) do\nbake.postprocess(prj, cfg)\nend\nend\nend\nfor sln in premake.solution.each() do\nfor prjIx, prj in ipairs(sln.projects) do\nif(not prj.usage) then\nfor cfgname, cfg in pairs(prj.__configs) do\nlocal usesPrjs = getprojectsconnections(cfg, cfgname);\ncopyusagedata(cfg, cfgname, usesPrjs)\nend\nend\nend\nend\nfor sln in premake.solution.each() do\nfor prjIx, prj in ipairs(sln.projects) do\nfor cfgName, cfg in pairs(prj.__configs) do\ncfg.build = true\nlocal removes = nil\nif cfg.removes ~= nil then\nremoves = cfg.removes[\"platforms\"];\nend\nif removes ~= nil then\nfor _,p in ipairs(removes) do\nif p == cfg.platform then\ncfg.build = false\nend\nend\nend\nend\nend\nend\nfor sln in premake.solution.each() do\nlocal removeList = {};\nfor index, prj in ipairs(sln.projects) do\nif(prj.usage) then\ntable.insert(removeList, 1, index); --Add in reverse order.\nend\nend\nfor " - "_, index in ipairs(removeList) do\ntable.remove(sln.projects, index);\nend\nend\nbuilduniquedirs()\nbuildtargets(cfg)\nend\nfunction premake.bake.postprocess(prj, cfg)\ncfg.project = prj\ncfg.shortname = premake.getconfigname(cfg.name, cfg.platform, true)\ncfg.longname = premake.getconfigname(cfg.name, cfg.platform)\ncfg.location = cfg.location or cfg.basedir\nlocal platform = premake.platforms[cfg.platform]\nif platform.iscrosscompiler then\ncfg.system = cfg.platform\nelse\ncfg.system = os.get()\nend\nif cfg.kind == \"Bundle\"\nand _ACTION ~= \"gmake\"\nand (_ACTION ~= \"ninja\" and (not prj.options or not prj.options.SkipBundling))\nand not _ACTION:match(\"xcode[0-9]\") then\ncfg.kind = \"SharedLib\"\nend\nif cfg.kind == \"SharedLib\" and platform.nosharedlibs then\ncfg.kind = \"StaticLib\"\nend\nlocal removefiles = cfg.removefiles\nif _ACTION == 'gmake' or _ACTION == 'ninja' then\nremovefiles = table.join(removefiles, cfg.excludes)\nend\nlocal removefilesDict = {}\nfor _, fname in ipairs(removefiles) do" - "\nremovefilesDict[fname] = true\nend\nlocal files = {}\nfor _, fname in ipairs(cfg.files) do\nif removefilesDict[fname] == nil then\ntable.insert(files, fname)\nend\nend\ncfg.files = files\nlocal allfiles = {}\nlocal allfilesDict = {}\nif cfg.allfiles ~= nil then\nfor _, fname in ipairs(cfg.allfiles) do\nif allfilesDict[fname] == nil then\nif removefilesDict[fname] == nil then\nallfilesDict[fname] = true\ntable.insert(allfiles, fname)\nend\nend\nend\nend\ncfg.allfiles = allfiles\nfor name, field in pairs(premake.fields) do\nif field.isflags then\nlocal values = cfg[name]\nfor _, flag in ipairs(values) do values[flag] = true end\nend\nend\nlocal cfgfields = {\n{\"__fileconfigs\", cfg.files},\n{\"__allfileconfigs\", cfg.allfiles},\n}\nfor _, cfgfield in ipairs(cfgfields) do\nlocal fieldname = cfgfield[1]\nlocal field = cfgfield[2]\ncfg[fieldname] = { }\nfor _, fname in ipairs(field) do\nlocal fcfg = {}\nif premake._filelevelconfig then\ncfg.terms.required = fname:lower()\nfor _, blk in ipairs(cfg.project." - "blocks) do\nif (premake.iskeywordsmatch(blk.keywords, cfg.terms)) then\nmergeobject(fcfg, blk)\nend\nend\nend\nfcfg.name = fname\ncfg[fieldname][fname] = fcfg\ntable.insert(cfg[fieldname], fcfg)\nend\nend\nend\n", + "then\nreturn false\nend\nif matched == \"required\" then\nhasrequired = true\nend\nend\nif terms.required and not hasrequired then\nreturn false\nelse\nreturn true\nend\nend\nlocal function adjustpaths(location, obj)\nfunction adjustpathlist(list)\nfor i, p in ipairs(list) do\nlist[i] = path.getrelative(location, p)\nend\nend\nif obj.allfiles ~= nil then\nadjustpathlist(obj.allfiles)\nend\nfor name, value in pairs(obj) do\nlocal field = premake.fields[name]\nif field and value and not keeprelative[name] then\nif field.kind == \"path\" then\nobj[name] = path.getrelative(location, value)\nelseif field.kind == \"dirlist\" or field.kind == \"filelist\" then\nadjustpathlist(value)\nelseif field.kind == \"keypath\" then\nfor k,v in pairs(value) do\nadjustpathlist(v)\nend\nend\nend\nend\nend\nlocal function removevalue(tbl, remove)\nfor index, item in ipairs(tbl) do\nif item == remove then\ntable.remove(tbl, index)\nbreak\nend\nend\nend\n local function removevalues(tbl, removes)\nfor i = #tbl, 1, -1 do\nfor _, patte" + "rn in ipairs(removes) do\nif pattern == tbl[i] then\ntable.remove(tbl, i)\nbreak\nend\nend\nend\nfor k, v in pairs(tbl) do\nfor _, pattern in ipairs(removes) do\nif pattern == tbl[k] then\ntbl[k] = nil\nbreak\nend\nend\nend\nend\nlocal function mergefield(kind, dest, src, mergecopiestotail)\nlocal tbl = dest or { }\nif kind == \"keyvalue\" or kind == \"keypath\" then\nfor key, value in pairs(src) do\ntbl[key] = mergefield(\"list\", tbl[key], value, mergecopiestotail)\nend\nelse\nfor _, item in ipairs(src) do\nif tbl[item] then\nif mergecopiestotail then\nremovevalue(tbl, item)\ntable.insert(tbl, item)\ntbl[item] = item\nend\nelse\ntable.insert(tbl, item)\ntbl[item] = item\nend\nend\nend\nreturn tbl\nend\nlocal function mergeobject(dest, src)\nif not src then\nreturn\nend\nfor fieldname, value in pairs(src) do\nif not nocopy[fieldname] then\nlocal field = premake.fields[fieldname]\nif field then\nif type(value) == \"table\" then\ndest[fieldname] = mergefield(field.kind, dest[fieldname], value, field.mergecopies" + "totail)\nif src.removes then\nremoves = src.removes[fieldname]\nif removes then\nremovevalues(dest[fieldname], removes)\nend\nend\nelse\ndest[fieldname] = value\nend\nelse\ndest[fieldname] = value\nend\nend\nend\nend\nlocal function merge(dest, obj, basis, terms, cfgname, pltname)\nlocal key = cfgname or \"\"\npltname = pltname or \"Native\"\nif pltname ~= \"Native\" then\nkey = key .. pltname\nend\nterms.config = (cfgname or \"\"):lower()\nterms.platform = pltname:lower()\nlocal cfg = {}\nmergeobject(cfg, basis[key])\nadjustpaths(obj.location, cfg)\nmergeobject(cfg, obj)\nif (cfg.kind) then\nterms['kind']=cfg.kind:lower()\nend\nfor _, blk in ipairs(obj.blocks) do\nif (premake.iskeywordsmatch(blk.keywords, terms))then\nmergeobject(cfg, blk)\nif (cfg.kind and not cfg.terms.kind) then\ncfg.terms['kind'] = cfg.kind:lower()\nterms['kind'] = cfg.kind:lower()\nend\nend\nend\ncfg.name = cfgname\ncfg.platform = pltname\nfor k,v in pairs(terms) do\ncfg.terms[k] =v\nend\ndest[key] = cfg\nend\nlocal function collap" + "se(obj, basis)\nlocal result = {}\nbasis = basis or {}\nlocal sln = obj.solution or obj\nlocal terms = premake.getactiveterms(obj)\nmerge(result, obj, basis, terms)--this adjusts terms\nfor _, cfgname in ipairs(sln.configurations) do\nlocal terms_local = {}\nfor k,v in pairs(terms)do terms_local[k]=v end\nmerge(result, obj, basis, terms_local, cfgname, \"Native\")--terms cam also be adjusted here\nfor _, pltname in ipairs(sln.platforms or {}) do\nif pltname ~= \"Native\" then\nmerge(result, obj, basis,terms_local, cfgname, pltname)--terms also here\nend\nend\nend\nreturn result\nend\nlocal function builduniquedirs()\nlocal num_variations = 4\nlocal cfg_dirs = {}\nlocal hit_counts = {}\nfor sln in premake.solution.each() do\nfor _, prj in ipairs(sln.projects) do\nfor _, cfg in pairs(prj.__configs) do\nlocal dirs = { }\ndirs[1] = path.getabsolute(path.join(cfg.location, cfg.objdir or cfg.project.objdir or \"obj\"))\ndirs[2] = path.join(dirs[1], iif(cfg.platform == \"Native\", \"\", cfg.platform))\ndirs[3] = path" + ".join(dirs[2], cfg.name)\ndirs[4] = path.join(dirs[3], cfg.project.name)\ncfg_dirs[cfg] = dirs\nlocal start = iif(cfg.name, 2, 1)\nfor v = start, num_variations do\nlocal d = dirs[v]\nhit_counts[d] = (hit_counts[d] or 0) + 1\nend\nend\nend\nend\nfor sln in premake.solution.each() do\nfor _, prj in ipairs(sln.projects) do\nfor _, cfg in pairs(prj.__configs) do\nlocal dir\nlocal start = iif(cfg.name, 2, 1)\nfor v = start, iif(cfg.flags.SingleOutputDir==true,num_variations-1,num_variations) do\ndir = cfg_dirs[cfg][v]\nif hit_counts[dir] == 1 then break end\nend\ncfg.objectsdir = path.getrelative(cfg.location, dir)\nend\nend\nend\nend\nlocal function buildtargets()\nfor sln in premake.solution.each() do\nfor _, prj in ipairs(sln.projects) do\nfor _, cfg in pairs(prj.__configs) do\nlocal pathstyle = premake.getpathstyle(cfg)\nlocal namestyle = premake.getnamestyle(cfg)\ncfg.buildtarget = premake.gettarget(cfg, \"build\", pathstyle, namestyle, cfg.system)\ncfg.linktarget = premake.gettarget(cfg, \"link\", pathstyl" + "e, namestyle, cfg.system)\nif pathstyle == \"windows\" then\ncfg.objectsdir = path.translate(cfg.objectsdir, \"\\\\\")\nend\nend\nend\nend\nend\n local function getCfgKind(cfg)\n if(cfg.kind) then\n return cfg.kind;\n end\n if(cfg.project.__configs[\"\"] and cfg.project.__configs[\"\"].kind) then\n return cfg.project.__configs[\"\"].kind;\n end\n return nil\n end\n local function getprojrec(dstArray, foundList, cfg, cfgname, searchField, bLinkage)\n if(not cfg) then return end\n local foundUsePrjs = {};\n for _, useName in ipairs(cfg[searchField]) do\n local testName = useName:lower();\n if((not foundList[testName])) then\n local theProj = nil;\n local theUseProj = nil;\n for _, prj in ipairs(cfg.project.solution.projects) do\n if (prj.name:lower() == testName) then\n if(prj.usage) then\n theUseProj = prj;\n else\n theProj = prj;\n end\n end\n end\n --Must connect to a usage project.\n if(theUseProj) then\n foundList[testName] = true;\n local prjEntry = {\n name = testName,\n pr" + "oj = theProj,\n usageProj = theUseProj,\n bLinkageOnly = bLinkage,\n };\n dstArray[testName] = prjEntry;\n table.insert(foundUsePrjs, theUseProj);\n end\n end\n end\n for _, usePrj in ipairs(foundUsePrjs) do\n --Links can only recurse through static libraries.\n if((searchField ~= \"links\") or\n (getCfgKind(usePrj.__configs[cfgname]) == \"StaticLib\")) then\n getprojrec(dstArray, foundList, usePrj.__configs[cfgname],\n cfgname, searchField, bLinkage);\n end\n end\n end\n --\n -- This function will recursively get all projects that the given configuration has in its \"uses\"\n -- field. The return values are a list of tables. Each table in that list contains the following:\n --name = The lowercase name of the project.\n --proj = The project. Can be nil if it is usage-only.\n --usageProj = The usage project. Can't be nil, as using a project that has no\n -- usage project is not put into the list.\n --bLinkageOnly = If this is true, then only the linkage information should be copied.\n " + "-- The recursion will only look at the \"uses\" field on *usage* projects.\n -- This function will also add projects to the list that are mentioned in the \"links\"\n -- field of usage projects. These will only copy linker information, but they will recurse.\n -- through other \"links\" fields.\n --\n local function getprojectsconnections(cfg, cfgname)\n local dstArray = {};\n local foundList = {};\n foundList[cfg.project.name:lower()] = true;\n --First, follow the uses recursively.\n getprojrec(dstArray, foundList, cfg, cfgname, \"uses\", false);\n --Next, go through all of the usage projects and recursively get their links.\n --But only if they're not already there. Get the links as linkage-only.\n local linkArray = {};\n for prjName, prjEntry in pairs(dstArray) do\n getprojrec(linkArray, foundList, prjEntry.usageProj.__configs[cfgname], cfgname,\n \"links\", true);\n end\n --Copy from linkArray into dstArray.\n for prjName, prjEntry in pairs(linkArray) do\n dstArray[prjName] = prjEntry;" + "\n end\n return dstArray;\n end\n local function isnameofproj(cfg, strName)\n local sln = cfg.project.solution;\n local strTest = strName:lower();\n for prjIx, prj in ipairs(sln.projects) do\n if (prj.name:lower() == strTest) then\n return true;\n end\n end\n return false;\n end\n --\n -- Copies the field from dstCfg to srcCfg.\n --\n local function copydependentfield(srcCfg, dstCfg, strSrcField)\n local srcField = premake.fields[strSrcField];\n local strDstField = strSrcField;\n if type(srcCfg[strSrcField]) == \"table\" then\n --handle paths.\n if (srcField.kind == \"dirlist\" or srcField.kind == \"filelist\") and\n (not keeprelative[strSrcField]) then\n for i,p in ipairs(srcCfg[strSrcField]) do\n table.insert(dstCfg[strDstField],\n path.rebase(p, srcCfg.project.location, dstCfg.project.location))\n end\n else\n if(strSrcField == \"links\") then\n for i,p in ipairs(srcCfg[strSrcField]) do\n if(not isnameofproj(dstCfg, p)) then\n table.insert(dstCfg[strDstField], p)\n else\n p" + "rintf(\"Failed to copy '%s' from proj '%s'.\",\n p, srcCfg.project.name);\n end\n end\n else\n for i,p in ipairs(srcCfg[strSrcField]) do\n table.insert(dstCfg[strDstField], p)\n end\n end\n end\n else\n if(srcField.kind == \"path\" and (not keeprelative[strSrcField])) then\n dstCfg[strDstField] = path.rebase(srcCfg[strSrcField],\n prj.location, dstCfg.project.location);\n else\n dstCfg[strDstField] = srcCfg[strSrcField];\n end\n end\n end\n --\n -- This function will take the list of project entries and apply their usage project data\n -- to the given configuration. It will copy compiling information for the projects that are\n -- not listed as linkage-only. It will copy the linking information for projects only if\n -- the source project is not a static library. It won't copy linking information\n -- if the project is in this solution; instead it will add that project to the configuration's\n -- links field, expecting that Premake will handle the rest.\n --\n local function copyusag" + "edata(cfg, cfgname, linkToProjs)\n local myPrj = cfg.project;\n local bIsStaticLib = (getCfgKind(cfg) == \"StaticLib\");\n for prjName, prjEntry in pairs(linkToProjs) do\n local srcPrj = prjEntry.usageProj;\n local srcCfg = srcPrj.__configs[cfgname];\n for name, field in pairs(premake.fields) do\n if(srcCfg[name]) then\n if(field.usagecopy) then\n if(not prjEntry.bLinkageOnly) then\n copydependentfield(srcCfg, cfg, name)\n end\n elseif(field.linkagecopy) then\n --Copy the linkage data if we're building a non-static thing\n --and this is a pure usage project. If it's not pure-usage, then\n --we will simply put the project's name in the links field later.\n if((not bIsStaticLib) and (not prjEntry.proj)) then\n copydependentfield(srcCfg, cfg, name)\n end\n end\n end\n end\n if((not bIsStaticLib) and prjEntry.proj) then\n table.insert(cfg.links, prjEntry.proj.name);\n end\n end\n end\n local function inverseliteralvpaths()\n for sln in premake.solution.each() do\n for" + " _,prj in ipairs(sln.projects) do\n prj.inversevpaths = {}\n for replacement, patterns in pairs(prj.vpaths or {}) do\n for _, pattern in ipairs(patterns) do\n if string.find(pattern, \"*\") == nil then\n prj.inversevpaths[pattern] = replacement\n end\n end\n end\n end\n end\n end\nfunction premake.bake.buildconfigs()\nfor sln in premake.solution.each() do\nfor _, prj in ipairs(sln.projects) do\nprj.location = prj.location or sln.location or prj.basedir\nadjustpaths(prj.location, prj)\nfor _, blk in ipairs(prj.blocks) do\nadjustpaths(prj.location, blk)\nend\nend\nsln.location = sln.location or sln.basedir\nend\n -- convert paths for imported projects to be relative to solution location\nfor sln in premake.solution.each() do\nfor _, iprj in ipairs(sln.importedprojects) do\niprj.location = path.getabsolute(iprj.location)\nend\nend\n" + " inverseliteralvpaths()\nfor sln in premake.solution.each() do\nlocal basis = collapse(sln)\nfor _, prj in ipairs(sln.projects) do\nprj.__configs = collapse(prj, basis)\nfor _, cfg in pairs(prj.__configs) do\nbake.postprocess(prj, cfg)\nend\nend\nend\nfor sln in premake.solution.each() do\nfor prjIx, prj in ipairs(sln.projects) do\nif(not prj.usage) then\nfor cfgname, cfg in pairs(prj.__configs) do\nlocal usesPrjs = getprojectsconnections(cfg, cfgname);\ncopyusagedata(cfg, cfgname, usesPrjs)\nend\nend\nend\nend\nfor sln in premake.solution.each() do\nfor prjIx, prj in ipairs(sln.projects) do\nfor cfgName, cfg in pairs(prj.__configs) do\ncfg.build = true\nlocal removes = nil\nif cfg.removes ~= nil then\nremoves = cfg.removes[\"platforms\"];\nend\nif removes ~= nil then\nfor _,p in ipairs(removes) do\nif p == cfg.platform then\ncfg.build = false\nend\nend\nend\nend\nend\nend\nfor sln in premake.solution.each() do\nlocal removeList = {};\nfor index, prj in ipairs(sln.projects) do\nif(prj.usage) then\ntabl" + "e.insert(removeList, 1, index); --Add in reverse order.\nend\nend\nfor _, index in ipairs(removeList) do\ntable.remove(sln.projects, index);\nend\nend\nbuilduniquedirs()\nbuildtargets(cfg)\nend\nfunction premake.bake.postprocess(prj, cfg)\ncfg.project = prj\ncfg.shortname = premake.getconfigname(cfg.name, cfg.platform, true)\ncfg.longname = premake.getconfigname(cfg.name, cfg.platform)\ncfg.location = cfg.location or cfg.basedir\nlocal platform = premake.platforms[cfg.platform]\nif platform.iscrosscompiler then\ncfg.system = cfg.platform\nelse\ncfg.system = os.get()\nend\nif cfg.kind == \"Bundle\"\nand _ACTION ~= \"gmake\"\nand (_ACTION ~= \"ninja\" and (not prj.options or not prj.options.SkipBundling))\nand not _ACTION:match(\"xcode[0-9]\") then\ncfg.kind = \"SharedLib\"\nend\nif cfg.kind == \"SharedLib\" and platform.nosharedlibs then\ncfg.kind = \"StaticLib\"\nend\nlocal removefiles = cfg.removefiles\nif _ACTION == 'gmake' or _ACTION == 'ninja' then\nremovefiles = table.join(removefiles, cfg.excludes)\ne" + "nd\nlocal removefilesDict = {}\nfor _, fname in ipairs(removefiles) do\nremovefilesDict[fname] = true\nend\nlocal files = {}\nfor _, fname in ipairs(cfg.files) do\nif removefilesDict[fname] == nil then\ntable.insert(files, fname)\nend\nend\ncfg.files = files\nlocal allfiles = {}\nlocal allfilesDict = {}\nif cfg.allfiles ~= nil then\nfor _, fname in ipairs(cfg.allfiles) do\nif allfilesDict[fname] == nil then\nif removefilesDict[fname] == nil then\nallfilesDict[fname] = true\ntable.insert(allfiles, fname)\nend\nend\nend\nend\ncfg.allfiles = allfiles\nfor name, field in pairs(premake.fields) do\nif field.isflags then\nlocal values = cfg[name]\nfor _, flag in ipairs(values) do values[flag] = true end\nend\nend\nlocal cfgfields = {\n{\"__fileconfigs\", cfg.files},\n{\"__allfileconfigs\", cfg.allfiles},\n}\nfor _, cfgfield in ipairs(cfgfields) do\nlocal fieldname = cfgfield[1]\nlocal field = cfgfield[2]\ncfg[fieldname] = { }\nfor _, fname in ipairs(field) do\nlocal fcfg = {}\nif premake._filelevelconfig then" + "\ncfg.terms.required = fname:lower()\nfor _, blk in ipairs(cfg.project.blocks) do\nif (premake.iskeywordsmatch(blk.keywords, cfg.terms)) then\nmergeobject(fcfg, blk)\nend\nend\nend\nfcfg.name = fname\ncfg[fieldname][fname] = fcfg\ntable.insert(cfg[fieldname], fcfg)\nend\nend\nend\n", /* base/api.lua */ "premake.fields = {}\npremake.check_paths = false\nfunction premake.checkvalue(value, allowed)\nif (allowed) then\nif (type(allowed) == \"function\") then\nreturn allowed(value)\nelse\nfor _,v in ipairs(allowed) do\nif (value:lower() == v:lower()) then\nreturn v\nend\nend\nreturn nil, \"invalid value '\" .. value .. \"'\"\nend\nelse\nreturn value\nend\nend\nfunction premake.getobject(t)\nlocal container\nif (t == \"container\" or t == \"solution\") then\ncontainer = premake.CurrentContainer\nelse\ncontainer = premake.CurrentConfiguration\nend\nif t == \"solution\" then\nif typex(container) == \"project\" then\ncontainer = container.solution\nend\nif typex(container) ~= \"solution\" then\ncontainer = nil\nend\nend\nlocal msg\nif (not container) then\nif (t == \"container\") then\nmsg = \"no active solution or project\"\nelseif (t == \"solution\") then\nmsg = \"no active solution\"\nelse\nmsg = \"no active solution, project, or configuration\"\nend\nend\nreturn container, msg\nend\nfunction premake.setarray(obj, " @@ -101,22 +102,23 @@ const char* builtin_scripts[] = { "nd(_ACTION, \"vs\") ~= 1 then\nerror(\"Only available for visual studio actions\")\nend\nsln, err = premake.getobject(\"solution\")\nif not sln then\nerror(err)\nend\nlocal group = creategroupsfrompath(premake.CurrentGroup, sln)\nlocal project = {}\nproject.location = location\nproject.group = group\nproject.flags = {}\ntable.insert(sln.importedprojects, project)\n end\nfunction newaction(a)\npremake.action.add(a)\nend\nfunction newoption(opt)\npremake.option.add(opt)\nend\nfunction enablefilelevelconfig()\npremake._filelevelconfig = true\nend\nfunction newapifield(field)\npremake.fields[field.name] = field\n_G[field.name] = function(value)\nreturn accessor(field.name, value)\nend\nif field.kind == \"list\"\nor field.kind == \"dirlist\"\nor field.kind == \"filelist\"\nor field.kind == \"absolutefilelist\"\nthen\nif field.name ~= \"removefiles\"\nand field.name ~= \"files\" then\n_G[\"remove\"..field.name] = function(value)\npremake.remove(field.name, value)\nend\nend\nend\nend\nnewapifield {\nname = \"arc" "hivesplit_size\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"basedir\",\nkind = \"path\",\nscope = \"container\",\n}\nnewapifield {\nname = \"buildaction\",\nkind = \"string\",\nscope = \"config\",\nallowed = {\n\"Compile\",\n\"Copy\",\n\"Embed\",\n\"None\"\n}\n}\nnewapifield {\nname = \"buildoptions\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"buildoptions_asm\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"buildoptions_c\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"buildoptions_cpp\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"buildoptions_objc\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"buildoptions_objcpp\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"buildoptions_vala\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"clrreferences\",\nkind = \"list\",\nscope = \"container\",\n}\nnewapifield {\nname" " = \"configurations\",\nkind = \"list\",\nscope = \"solution\",\n}\nnewapifield {\nname = \"custombuildtask\",\nkind = \"table\",\nscope = \"config\",\n}\nnewapifield {\nname = \"debugcmd\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"debugargs\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"debugdir\",\nkind = \"path\",\nscope = \"config\",\n}\nnewapifield {\nname = \"debugenvs\" ,\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"defines\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"deploymentoptions\",\nkind = \"list\",\nscope = \"config\",\nusagecopy = true,\n}\nnewapifield {\nname = \"dependency\",\nkind = \"table\",\nscope = \"config\",\n}\nnewapifield {\nname = \"deploymode\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"excludes\",\nkind = \"filelist\",\nscope = \"config\",\n}\nnewapifield {\nname = \"forcenative\",\nkind = \"filelist\",\nscope = \"config\",\n}\nnewapifield " - "{\nname = \"nopch\",\nkind = \"filelist\",\nscope = \"config\",\n}\nnewapifield {\nname = \"files\",\nkind = \"filelist\",\nscope = \"config\",\n}\nnewapifield {\nname = \"removefiles\",\nkind = \"filelist\",\nscope = \"config\",\n}\nnewapifield {\nname = \"flags\",\nkind = \"list\",\nscope = \"config\",\nisflags = true,\nusagecopy = true,\nallowed = function(value)\nlocal allowed_flags = {\nAntBuildDebuggable = 1,\nATL = 1,\nC7DebugInfo = 1,\nCpp11 = 1,\nCpp14 = 1,\nCpp17 = 1,\nCppLatest = 1,\nDebugEnvsDontMerge = 1,\nDebugEnvsInherit = 1,\nDeploymentContent = 1,\nEnableMinimalRebuild = 1,\nEnableSSE = 1,\nEnableSSE2 = 1,\nEnableAVX = 1,\nEnableAVX2 = 1,\nPedanticWarnings = 1,\nExtraWarnings = 1,\nFatalWarnings = 1,\nFloatFast = 1,\nFloatStrict = 1,\nFullSymbols = 1,\nGenerateMapFiles = 1,\nHotpatchable = 1,\nLinkSupportCircularDependencies = 1,\nManaged = 1,\nMinimumWarnings = 1,\nMFC = 1,\nNativeWChar = 1,\nNo64BitChecks = 1,\nNoBufferSecurityCheck = 1,\nNoEditAndContinue = 1,\nNoExceptions = 1,\nNo" - "FramePointer = 1,\nNoImportLib = 1,\nNoIncrementalLink = 1,\nNoJMC = 1,\nNoManifest = 1,\nNoMultiProcessorCompilation = 1,\nNoNativeWChar = 1,\nNoOptimizeLink = 1,\nNoPCH = 1,\nNoRTTI = 1,\nNoRuntimeChecks = 1,\nNoWinMD = 1, -- explicitly disables Windows Metadata\nNoWinRT = 1, -- explicitly disables Windows Runtime Extension\nFastCall = 1,\nStdCall = 1,\nSingleOutputDir = 1,\nObjcARC = 1,\nOptimize = 1,\nOptimizeSize = 1,\nOptimizeSpeed = 1,\nDebugRuntime = 1,\nReleaseRuntime = 1,\nSEH = 1,\nStaticATL = 1,\nStaticRuntime = 1,\nSymbols = 1,\nUnicode = 1,\nUnitySupport = 1,\nUnsafe = 1,\nUnsignedChar = 1,\nUseFullPaths = 1,\nUseLDResponseFile = 1,\nUseObjectResponseFile = 1,\nWinMain = 1\n}\nlocal englishToAmericanSpelling =\n{\nnooptimiselink = 'nooptimizelink',\noptimise = 'optimize',\noptimisesize = 'optimizesize',\noptimisespeed = 'optimizespeed',\n}\nlocal lowervalue = value:lower()\nlowervalue = englishToAmericanSpelling[lowervalue] or lowervalue\nfor v, _ in pairs(allowed_flags) do\nif v:lower() ==" - " lowervalue then\nreturn v\nend\nend\nreturn nil, \"invalid flag\"\nend,\n}\nnewapifield {\nname = \"framework\",\nkind = \"string\",\nscope = \"container\",\nallowed = {\n\"1.0\",\n\"1.1\",\n\"2.0\",\n\"3.0\",\n\"3.5\",\n\"4.0\",\n\"4.5\",\n\"4.5.1\",\n\"4.5.2\",\n\"4.6\",\n\"4.6.1\",\n\"4.6.2\",\n}\n}\nnewapifield {\nname = \"iostargetplatformversion\",\nkind = \"string\",\nscope = \"project\",\n}\nnewapifield {\nname = \"macostargetplatformversion\",\nkind = \"string\",\nscope = \"project\",\n}\nnewapifield {\nname = \"tvostargetplatformversion\",\nkind = \"string\",\nscope = \"project\",\n}\nnewapifield {\nname = \"windowstargetplatformversion\",\nkind = \"string\",\nscope = \"project\",\n}\nnewapifield {\nname = \"windowstargetplatformminversion\",\nkind = \"string\",\nscope = \"project\",\n}\nnewapifield {\nname = \"forcedincludes\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"imagepath\",\nkind = \"path\",\nscope = \"config\",\n}\nnewapifield {\nname = \"imageoptions" - "\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"implibdir\",\nkind = \"path\",\nscope = \"config\",\n}\nnewapifield {\nname = \"implibextension\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"implibname\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"implibprefix\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"implibsuffix\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"includedirs\",\nkind = \"dirlist\",\nscope = \"config\",\nusagecopy = true,\n}\nnewapifield {\nname = \"systemincludedirs\",\nkind = \"dirlist\",\nscope = \"config\",\nusagecopy = true,\n}\nnewapifield {\nname = \"userincludedirs\",\nkind = \"dirlist\",\nscope = \"config\",\nusagecopy = true,\n}\nnewapifield {\nname = \"usingdirs\",\nkind = \"dirlist\",\nscope = \"config\",\nusagecopy = true,\n}\nnewapifield {\nname = \"kind\",\nkind = \"string\",\nscope = \"config\",\nallowed = {\n\"ConsoleApp\",\n\"Window" - "edApp\",\n\"StaticLib\",\n\"SharedLib\",\n\"Bundle\",\n}\n}\nnewapifield {\nname = \"language\",\nkind = \"string\",\nscope = \"container\",\nallowed = {\n\"C\",\n\"C++\",\n\"C#\",\n\"Vala\",\n\"Swift\",\n}\n}\nnewapifield {\nname = \"libdirs\",\nkind = \"dirlist\",\nscope = \"config\",\nlinkagecopy = true,\n}\nnewapifield {\nname = \"linkoptions\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"links\",\nkind = \"list\",\nscope = \"config\",\nallowed = function(value)\nif value:find('/', nil, true) then\nvalue = path.getabsolute(value)\nend\nreturn value\nend,\nlinkagecopy = true,\nmergecopiestotail = true,\n}\nnewapifield {\nname = \"location\",\nkind = \"path\",\nscope = \"container\",\n}\nnewapifield {\nname = \"makesettings\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"messageskip\",\nkind = \"list\",\nscope = \"solution\",\nisflags = true,\nusagecopy = true,\nallowed = function(value)\nlocal allowed_messages = {\nSkipCreatingMessage = 1,\nSkipBuild" - "ingMessage = 1,\nSkipCleaningMessage = 1,\n}\nlocal lowervalue = value:lower()\nfor v, _ in pairs(allowed_messages) do\nif v:lower() == lowervalue then\nreturn v\nend\nend\nreturn nil, \"invalid message to skip\"\nend,\n}\nnewapifield {\nname = \"msgarchiving\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"msgcompile\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"msgprecompile\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"msgcompile_objc\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"msgresource\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"msglinking\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"objdir\",\nkind = \"path\",\nscope = \"config\",\n}\nnewapifield {\nname = \"options\",\nkind = \"list\",\nscope = \"container\",\nisflags = true,\nusagecopy = true,\nallowed = function(value)\nlocal allowed_options = {\nForceCPP = 1,\nArchiveSplit = 1," - "\nSkipBundling = 1,\nXcodeLibrarySchemes = 1,\nXcodeSchemeNoConfigs = 1,\n}\nlocal lowervalue = value:lower()\nfor v, _ in pairs(allowed_options) do\nif v:lower() == lowervalue then\nreturn v\nend\nend\nreturn nil, \"invalid option\"\nend,\n}\nnewapifield {\nname = \"pchheader\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"pchsource\",\nkind = \"path\",\nscope = \"config\",\n}\nnewapifield {\nname = \"platforms\",\nkind = \"list\",\nscope = \"solution\",\nallowed = table.keys(premake.platforms),\n}\nnewapifield {\nname = \"postbuildcommands\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"prebuildcommands\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"postcompiletasks\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"prelinkcommands\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"propertysheets\",\nkind = \"dirlist\",\nscope = \"config\",\n}\nnewapifield {\nname = \"pullmappingfile\"," - "\nkind = \"path\",\nscope = \"config\",\n}\nnewapifield {\nname = \"applicationdatadir\",\nkind = \"path\",\nscope = \"config\",\n}\nnewapifield {\nname = \"finalizemetasource\",\nkind = \"path\",\nscope = \"config\",\n}\nnewapifield {\nname = \"resdefines\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"resincludedirs\",\nkind = \"dirlist\",\nscope = \"config\",\n}\nnewapifield {\nname = \"resoptions\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"sdkreferences\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"startproject\",\nkind = \"string\",\nscope = \"solution\",\n}\nnewapifield {\nname = \"targetdir\",\nkind = \"path\",\nscope = \"config\",\n}\nnewapifield {\nname = \"targetsubdir\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"targetextension\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"targetname\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = " - "\"targetprefix\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"targetsuffix\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"trimpaths\",\nkind = \"dirlist\",\nscope = \"config\",\n}\nnewapifield {\nname = \"uuid\",\nkind = \"string\",\nscope = \"container\",\nallowed = function(value)\nlocal ok = true\nif (#value ~= 36) then ok = false end\nfor i=1,36 do\nlocal ch = value:sub(i,i)\nif (not ch:find(\"[ABCDEFabcdef0123456789-]\")) then ok = false end\nend\nif (value:sub(9,9) ~= \"-\") then ok = false end\nif (value:sub(14,14) ~= \"-\") then ok = false end\nif (value:sub(19,19) ~= \"-\") then ok = false end\nif (value:sub(24,24) ~= \"-\") then ok = false end\nif (not ok) then\nreturn nil, \"invalid UUID\"\nend\nreturn value:upper()\nend\n}\nnewapifield {\nname = \"uses\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"vapidirs\",\nkind = \"dirlist\",\nscope = \"config\",\n}\nnewapifield {\nname = \"vpaths\",\nkind = \"keypath\",\nsco" - "pe = \"container\",\n}\nnewapifield {\nname = \"vsimportreferences\",\nkind = \"filelist\",\nscope = \"container\",\n}\nnewapifield {\nname = \"dpiawareness\",\nkind = \"string\",\nscope = \"config\",\nallowed = {\n\"None\",\n\"High\",\n\"HighPerMonitor\",\n}\n}\nnewapifield {\nname = \"xcodeprojectopts\",\nkind = \"table\",\nscope = \"config\",\n}\nnewapifield {\nname = \"xcodetargetopts\",\nkind = \"table\",\nscope = \"config\",\n}\nnewapifield {\nname = \"xcodescriptphases\",\nkind = \"table\",\nscope = \"config\",\n}\nnewapifield {\nname = \"xcodecopyresources\",\nkind = \"table\",\nscope = \"project\",\n}\nnewapifield {\nname = \"xcodecopyframeworks\",\nkind = \"filelist\",\nscope = \"project\",\n}\nnewapifield {\nname = \"wholearchive\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"swiftmodulemaps\",\nkind = \"filelist\",\nscope = \"config\",\n}\nnewapifield {\nname = \"buildoptions_swift\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"linkopti" - "ons_swift\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"androidtargetapi\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"androidminapi\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"androidarch\",\nkind = \"string\",\nscope = \"config\",\nallowed = {\n\"armv7-a\",\n\"armv7-a-hard\",\n\"arm64-v8a\",\n\"x86\",\n\"x86_64\",\n}\n}\nnewapifield {\nname = \"androidndktoolchainversion\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"androidstltype\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"androidcppstandard\",\nkind = \"string\",\nscope = \"config\",\nallowed = {\n\"c++98\",\n\"c++11\",\n\"c++1y\",\n\"gnu++98\",\n\"gnu++11\",\n\"gnu++1y\",\n}\n}\nnewapifield {\nname = \"androidlinker\",\nkind = \"string\",\nscope = \"config\",\nallowed = {\n\"bfd\",\n\"gold\",\n}\n}\nnewapifield {\nname = \"androiddebugintentparams\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = " - "\"antbuildjavasourcedirs\",\nkind = \"dirlist\",\nscope = \"config\",\n}\nnewapifield {\nname = \"antbuildjardirs\",\nkind = \"dirlist\",\nscope = \"config\",\n}\nnewapifield {\nname = \"antbuildjardependencies\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"antbuildnativelibdirs\",\nkind = \"dirlist\",\nscope = \"config\",\n}\nnewapifield {\nname = \"antbuildnativelibdependencies\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"antbuildassetsdirs\",\nkind = \"dirlist\",\nscope = \"config\",\n}\nnewapifield {\nname = \"postsolutioncallbacks\",\nkind = \"list\",\nscope = \"solution\",\n}\nnewapifield {\nname = \"postprojectcallbacks\",\nkind = \"list\",\nscope = \"project\",\n}\n", + "{\nname = \"nopch\",\nkind = \"filelist\",\nscope = \"config\",\n}\nnewapifield {\nname = \"files\",\nkind = \"filelist\",\nscope = \"config\",\n}\nnewapifield {\nname = \"removefiles\",\nkind = \"filelist\",\nscope = \"config\",\n}\nnewapifield {\nname = \"flags\",\nkind = \"list\",\nscope = \"config\",\nisflags = true,\nusagecopy = true,\nallowed = function(value)\nlocal allowed_flags = {\nAntBuildDebuggable = 1,\nC7DebugInfo = 1,\nCpp11 = 1,\nCpp14 = 1,\nCpp17 = 1,\nCpp20 = 1,\nCppLatest = 1,\nDebugEnvsDontMerge = 1,\nDebugEnvsInherit = 1,\nDeploymentContent = 1,\nEnableMinimalRebuild = 1,\nEnableSSE = 1,\nEnableSSE2 = 1,\nEnableAVX = 1,\nEnableAVX2 = 1,\nPedanticWarnings = 1,\nExtraWarnings = 1,\nFatalWarnings = 1,\nFloatFast = 1,\nFloatStrict = 1,\nFullSymbols = 1,\nGenerateMapFiles = 1,\nHotpatchable = 1,\nLinkSupportCircularDependencies = 1,\nManaged = 1,\nMinimumWarnings = 1,\nNativeWChar = 1,\nNo64BitChecks = 1,\nNoBufferSecurityCheck = 1,\nNoEditAndContinue = 1,\nNoExceptions = 1,\nNoFramePoi" + "nter = 1,\nNoImportLib = 1,\nNoIncrementalLink = 1,\nNoJMC = 1,\nNoManifest = 1,\nNoMultiProcessorCompilation = 1,\nNoNativeWChar = 1,\nNoOptimizeLink = 1,\nNoPCH = 1,\nNoRTTI = 1,\nNoRuntimeChecks = 1,\nNoWinMD = 1, -- explicitly disables Windows Metadata\nNoWinRT = 1, -- explicitly disables Windows Runtime Extension\nFastCall = 1,\nStdCall = 1,\nSingleOutputDir = 1,\nObjcARC = 1,\nOptimize = 1,\nOptimizeSize = 1,\nOptimizeSpeed = 1,\nDebugRuntime = 1,\nReleaseRuntime = 1,\nSEH = 1,\nStaticRuntime = 1,\nSymbols = 1,\nUnicode = 1,\nUnitySupport = 1,\nUnsafe = 1,\nUnsignedChar = 1,\nUseFullPaths = 1,\nUseLDResponseFile = 1,\nUseObjectResponseFile = 1,\nWinMain = 1\n}\nlocal englishToAmericanSpelling =\n{\nnooptimiselink = 'nooptimizelink',\noptimise = 'optimize',\noptimisesize = 'optimizesize',\noptimisespeed = 'optimizespeed',\n}\nlocal lowervalue = value:lower()\nlowervalue = englishToAmericanSpelling[lowervalue] or lowervalue\nfor v, _ in pairs(allowed_flags) do\nif v:lower() == lowervalue then\nreturn" + " v\nend\nend\nreturn nil, \"invalid flag\"\nend,\n}\nnewapifield {\nname = \"framework\",\nkind = \"string\",\nscope = \"container\",\nallowed = {\n\"1.0\",\n\"1.1\",\n\"2.0\",\n\"3.0\",\n\"3.5\",\n\"4.0\",\n\"4.5\",\n\"4.5.1\",\n\"4.5.2\",\n\"4.6\",\n\"4.6.1\",\n\"4.6.2\",\n}\n}\nnewapifield {\nname = \"iostargetplatformversion\",\nkind = \"string\",\nscope = \"project\",\n}\nnewapifield {\nname = \"macostargetplatformversion\",\nkind = \"string\",\nscope = \"project\",\n}\nnewapifield {\nname = \"tvostargetplatformversion\",\nkind = \"string\",\nscope = \"project\",\n}\nnewapifield {\nname = \"visionostargetplatformversion\",\nkind = \"string\",\nscope = \"project\",\n}\nnewapifield {\nname = \"windowstargetplatformversion\",\nkind = \"string\",\nscope = \"project\",\n}\nnewapifield {\nname = \"windowstargetplatformminversion\",\nkind = \"string\",\nscope = \"project\",\n}\nnewapifield {\nname = \"forcedincludes\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"imagepath\"," + "\nkind = \"path\",\nscope = \"config\",\n}\nnewapifield {\nname = \"imageoptions\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"implibdir\",\nkind = \"path\",\nscope = \"config\",\n}\nnewapifield {\nname = \"implibextension\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"implibname\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"implibprefix\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"implibsuffix\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"includedirs\",\nkind = \"dirlist\",\nscope = \"config\",\nusagecopy = true,\n}\nnewapifield {\nname = \"systemincludedirs\",\nkind = \"dirlist\",\nscope = \"config\",\nusagecopy = true,\n}\nnewapifield {\nname = \"userincludedirs\",\nkind = \"dirlist\",\nscope = \"config\",\nusagecopy = true,\n}\nnewapifield {\nname = \"usingdirs\",\nkind = \"dirlist\",\nscope = \"config\",\nusagecopy = true,\n}\nnewapifield {\nname = \"kind\"," + "\nkind = \"string\",\nscope = \"config\",\nallowed = {\n\"ConsoleApp\",\n\"WindowedApp\",\n\"StaticLib\",\n\"SharedLib\",\n\"Bundle\",\n}\n}\nnewapifield {\nname = \"language\",\nkind = \"string\",\nscope = \"container\",\nallowed = {\n\"C\",\n\"C++\",\n\"C#\",\n\"Vala\",\n\"Swift\",\n}\n}\nnewapifield {\nname = \"libdirs\",\nkind = \"dirlist\",\nscope = \"config\",\nlinkagecopy = true,\n}\nnewapifield {\nname = \"linkoptions\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"links\",\nkind = \"list\",\nscope = \"config\",\nallowed = function(value)\nif value:find('/', nil, true) then\nvalue = path.getabsolute(value)\nend\nreturn value\nend,\nlinkagecopy = true,\nmergecopiestotail = true,\n}\nnewapifield {\nname = \"location\",\nkind = \"path\",\nscope = \"container\",\n}\nnewapifield {\nname = \"makesettings\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"messageskip\",\nkind = \"list\",\nscope = \"solution\",\nisflags = true,\nusagecopy = true,\nallowed " + "= function(value)\nlocal allowed_messages = {\nSkipCreatingMessage = 1,\nSkipBuildingMessage = 1,\nSkipCleaningMessage = 1,\n}\nlocal lowervalue = value:lower()\nfor v, _ in pairs(allowed_messages) do\nif v:lower() == lowervalue then\nreturn v\nend\nend\nreturn nil, \"invalid message to skip\"\nend,\n}\nnewapifield {\nname = \"msgarchiving\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"msgcompile\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"msgprecompile\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"msgcompile_objc\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"msgresource\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"msglinking\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"objdir\",\nkind = \"path\",\nscope = \"config\",\n}\nnewapifield {\nname = \"options\",\nkind = \"list\",\nscope = \"container\",\nisflags = true,\nusagecopy = true,\nallo" + "wed = function(value)\nlocal allowed_options = {\nForceCPP = 1,\nArchiveSplit = 1,\nSkipBundling = 1,\nXcodeLibrarySchemes = 1,\nXcodeSchemeNoConfigs = 1,\n}\nlocal lowervalue = value:lower()\nfor v, _ in pairs(allowed_options) do\nif v:lower() == lowervalue then\nreturn v\nend\nend\nreturn nil, \"invalid option\"\nend,\n}\nnewapifield {\nname = \"pchheader\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"pchsource\",\nkind = \"path\",\nscope = \"config\",\n}\nnewapifield {\nname = \"platforms\",\nkind = \"list\",\nscope = \"solution\",\nallowed = table.keys(premake.platforms),\n}\nnewapifield {\nname = \"postbuildcommands\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"prebuildcommands\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"postcompiletasks\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"prelinkcommands\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"propertysheets\",\nkind =" + " \"dirlist\",\nscope = \"config\",\n}\nnewapifield {\nname = \"pullmappingfile\",\nkind = \"path\",\nscope = \"config\",\n}\nnewapifield {\nname = \"applicationdatadir\",\nkind = \"path\",\nscope = \"config\",\n}\nnewapifield {\nname = \"finalizemetasource\",\nkind = \"path\",\nscope = \"config\",\n}\nnewapifield {\nname = \"resdefines\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"resincludedirs\",\nkind = \"dirlist\",\nscope = \"config\",\n}\nnewapifield {\nname = \"resoptions\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"sdkreferences\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"startproject\",\nkind = \"string\",\nscope = \"solution\",\n}\nnewapifield {\nname = \"targetdir\",\nkind = \"path\",\nscope = \"config\",\n}\nnewapifield {\nname = \"targetsubdir\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"targetextension\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"t" + "argetname\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"targetprefix\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"targetsuffix\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"trimpaths\",\nkind = \"dirlist\",\nscope = \"config\",\n}\nnewapifield {\nname = \"uuid\",\nkind = \"string\",\nscope = \"container\",\nallowed = function(value)\nlocal ok = true\nif (#value ~= 36) then ok = false end\nfor i=1,36 do\nlocal ch = value:sub(i,i)\nif (not ch:find(\"[ABCDEFabcdef0123456789-]\")) then ok = false end\nend\nif (value:sub(9,9) ~= \"-\") then ok = false end\nif (value:sub(14,14) ~= \"-\") then ok = false end\nif (value:sub(19,19) ~= \"-\") then ok = false end\nif (value:sub(24,24) ~= \"-\") then ok = false end\nif (not ok) then\nreturn nil, \"invalid UUID\"\nend\nreturn value:upper()\nend\n}\nnewapifield {\nname = \"uses\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"vapidirs\",\nkind = \"dirlist\",\nsc" + "ope = \"config\",\n}\nnewapifield {\nname = \"vpaths\",\nkind = \"keypath\",\nscope = \"container\",\n}\nnewapifield {\nname = \"vsimportreferences\",\nkind = \"filelist\",\nscope = \"container\",\n}\nnewapifield {\nname = \"dpiawareness\",\nkind = \"string\",\nscope = \"config\",\nallowed = {\n\"None\",\n\"High\",\n\"HighPerMonitor\",\n}\n}\nnewapifield {\nname = \"xcodeprojectopts\",\nkind = \"table\",\nscope = \"config\",\n}\nnewapifield {\nname = \"xcodetargetopts\",\nkind = \"table\",\nscope = \"config\",\n}\nnewapifield {\nname = \"xcodescriptphases\",\nkind = \"table\",\nscope = \"config\",\n}\nnewapifield {\nname = \"xcodecopyresources\",\nkind = \"table\",\nscope = \"project\",\n}\nnewapifield {\nname = \"xcodecopyframeworks\",\nkind = \"filelist\",\nscope = \"project\",\n}\nnewapifield {\nname = \"wholearchive\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"swiftmodulemaps\",\nkind = \"filelist\",\nscope = \"config\",\n}\nnewapifield {\nname = \"buildoptions_swif" + "t\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"linkoptions_swift\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"androidtargetapi\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"androidminapi\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"androidarch\",\nkind = \"string\",\nscope = \"config\",\nallowed = {\n\"armv7-a\",\n\"armv7-a-hard\",\n\"arm64-v8a\",\n\"x86\",\n\"x86_64\",\n}\n}\nnewapifield {\nname = \"androidndktoolchainversion\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"androidstltype\",\nkind = \"string\",\nscope = \"config\",\n}\nnewapifield {\nname = \"androidcppstandard\",\nkind = \"string\",\nscope = \"config\",\nallowed = {\n\"c++98\",\n\"c++11\",\n\"c++1y\",\n\"gnu++98\",\n\"gnu++11\",\n\"gnu++1y\",\n}\n}\nnewapifield {\nname = \"androidlinker\",\nkind = \"string\",\nscope = \"config\",\nallowed = {\n\"bfd\",\n\"gold\",\n}\n}\nnewapifield {\nname = \"androiddebugi" + "ntentparams\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"antbuildjavasourcedirs\",\nkind = \"dirlist\",\nscope = \"config\",\n}\nnewapifield {\nname = \"antbuildjardirs\",\nkind = \"dirlist\",\nscope = \"config\",\n}\nnewapifield {\nname = \"antbuildjardependencies\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"antbuildnativelibdirs\",\nkind = \"dirlist\",\nscope = \"config\",\n}\nnewapifield {\nname = \"antbuildnativelibdependencies\",\nkind = \"list\",\nscope = \"config\",\n}\nnewapifield {\nname = \"antbuildassetsdirs\",\nkind = \"dirlist\",\nscope = \"config\",\n}\nnewapifield {\nname = \"postsolutioncallbacks\",\nkind = \"list\",\nscope = \"solution\",\n}\nnewapifield {\nname = \"postprojectcallbacks\",\nkind = \"list\",\nscope = \"project\",\n}\n", /* base/cmdline.lua */ "newoption\n{\ntrigger = \"cc\",\nvalue = \"VALUE\",\ndescription = \"Choose a C/C++ compiler set\",\nallowed = {\n{ \"gcc\", \"GNU GCC (gcc/g++)\" },\n{ \"ow\", \"OpenWatcom\" },\n{ \"ghs\", \"Green Hills Software\" },\n}\n}\nnewoption\n{\ntrigger = \"dotnet\",\nvalue = \"VALUE\",\ndescription = \"Choose a .NET compiler set\",\nallowed = {\n{ \"msnet\", \"Microsoft .NET (csc)\" },\n{ \"mono\", \"Novell Mono (mcs)\" },\n{ \"pnet\", \"Portable.NET (cscc)\" },\n}\n}\nnewoption\n{\ntrigger = \"file\",\nvalue = \"FILE\",\ndescription = \"Read FILE as a Premake script; default is 'premake4.lua'\"\n}\nnewoption\n{\ntrigger = \"help\",\ndescription = \"Display this information\"\n}\nnewoption\n{\ntrigger = \"os\",\nvalue = \"VALUE\",\ndescription = \"Generate files for a different operating system\",\nallowed = {\n{ \"bsd\", \"OpenBSD, NetBSD, or FreeBSD\" },\n{ \"linux\", \"Linux\" },\n{ \"macosx\", \"Apple Mac OS X\" },\n{ \"solaris\", \"Sola" - "ris\" },\n{ \"windows\", \"Microsoft Windows\" },\n}\n}\nnewoption\n{\ntrigger = \"platform\",\nvalue = \"VALUE\",\ndescription = \"Add target architecture (if supported by action)\",\nallowed = {\n{ \"x32\", \"32-bit\" },\n{ \"x64\", \"64-bit\" },\n{ \"universal\", \"Mac OS X Universal, 32- and 64-bit\" },\n{ \"universal32\", \"Mac OS X Universal, 32-bit only\" },\n{ \"universal64\", \"Mac OS X Universal, 64-bit only\" },\n{ \"ps3\", \"Playstation 3\" },\n{ \"orbis\", \"Playstation 4\" },\n{ \"xbox360\", \"Xbox 360\" },\n{ \"durango\", \"Xbox One\" },\n{ \"ARM\", \"ARM\" },\n{ \"PowerPC\", \"PowerPC\" },\n}\n}\nnewoption\n{\ntrigger = \"scripts\",\nvalue = \"path\",\ndescription = \"Search for additional scripts on the given path\"\n}\nnewoption\n{\ntrigger = \"debug-profiler\",\ndescription = \"GENie script generation profiler.\"\n}\nnewoption\n{\ntrigger = \"version\",\ndescription = \"Display version information\"\n}\n", + "ris\" },\n{ \"windows\", \"Microsoft Windows\" },\n}\n}\nnewoption\n{\ntrigger = \"platform\",\nvalue = \"VALUE\",\ndescription = \"Add target architecture (if supported by action)\",\nallowed = {\n{ \"x32\", \"32-bit\" },\n{ \"x64\", \"64-bit\" },\n{ \"universal\", \"Mac OS X Universal, 32- and 64-bit\" },\n{ \"universal32\", \"Mac OS X Universal, 32-bit only\" },\n{ \"universal64\", \"Mac OS X Universal, 64-bit only\" },\n{ \"ps3\", \"Playstation 3\" },\n{ \"orbis\", \"Playstation 4\" },\n{ \"xbox360\", \"Xbox 360\" },\n{ \"durango\", \"Xbox One\" },\n{ \"ARM\", \"ARM\" },\n{ \"ARM64\", \"ARM64\" },\n{ \"PowerPC\", \"PowerPC\" },\n{ \"nx32\", \"Nintendo Switch, 32-bit only\" },\n{ \"nx64\", \"Nintendo Switch, 64-bit only\" },\n{ \"gdk-desktop\", \"GDK Windows Desktop\" },\n{ \"gdk-xboxone\", \"GDK Xbox One\" },\n{ \"gdk-scarlett\",\"GDK Xbox Scarlett\" },\n}\n}\nnewoption\n{\ntrigger = \"scripts\",\nvalue = \"path" + "\",\ndescription = \"Search for additional scripts on the given path\"\n}\nnewoption\n{\ntrigger = \"debug-profiler\",\ndescription = \"GENie script generation profiler.\"\n}\nnewoption\n{\ntrigger = \"version\",\ndescription = \"Display version information\"\n}\n", /* base/inspect.lua */ "-- Copyright (c) 2013 Enrique García Cota\nlocal function smartQuote(str)\n if str:match('\"') and not str:match(\"'\") then\n return \"'\" .. str .. \"'\"\n end\n return '\"' .. str:gsub('\"', '\\\\\"') .. '\"'\nend\nlocal controlCharsTranslation = {\n [\"\\a\"] = \"\\\\a\", [\"\\b\"] = \"\\\\b\", [\"\\f\"] = \"\\\\f\", [\"\\n\"] = \"\\\\n\",\n [\"\\r\"] = \"\\\\r\", [\"\\t\"] = \"\\\\t\", [\"\\v\"] = \"\\\\v\"\n}\nlocal function escapeChar(c) return controlCharsTranslation[c] end\nlocal function escape(str)\n local result = str:gsub(\"\\\\\", \"\\\\\\\\\"):gsub(\"(%c)\", escapeChar)\n return result\nend\nlocal function isIdentifier(str)\n return type(str) == 'string' and str:match( \"^[_%a][_%a%d]*$\" )\nend\nlocal function isArrayKey(k, length)\n return type(k) == 'number' and 1 <= k and k <= length\nend\nlocal function isDictionaryKey(k, length)\n return not isArrayKey(k, length)\nend\nlocal defaultTypeOrders = {\n ['number'] = 1, ['boolean'] = 2, ['string'] = 3, ['table'] = 4,\n ['fu" @@ -146,13 +148,13 @@ const char* builtin_scripts[] = { "fg.kind == \"ConsoleApp\") then\nreturn \"Exe\"\nelseif (cfg.kind == \"WindowedApp\") then\nreturn \"WinExe\"\nelseif (cfg.kind == \"SharedLib\") then\nreturn \"Library\"\nend\nend\n", /* tools/gcc.lua */ - "premake.gcc = { }\npremake.gcc.cc = \"gcc\"\npremake.gcc.cxx = \"g++\"\npremake.gcc.ar = \"ar\"\npremake.gcc.rc = \"windres\"\npremake.gcc.llvm = false\nlocal cflags =\n{\nEnableSSE = \"-msse\",\nEnableSSE2 = \"-msse2\",\nEnableAVX = \"-mavx\",\nEnableAVX2 = \"-mavx2\",\nPedanticWarnings = \"-Wall -Wextra -pedantic\",\nExtraWarnings = \"-Wall -Wextra\",\nFatalWarnings = \"-Werror\",\nFloatFast = \"-ffast-math\",\nFloatStrict = \"-ffloat-store\",\nNoFramePointer = \"-fomit-frame-pointer\",\nOptimize = \"-O2\",\nOptimizeSize = \"-Os\",\nOptimizeSpeed = \"-O3\",\nSymbols = \"-g\",\n}\nlocal cxxflags =\n{\nCpp11 = \"-std=c++11\",\nCpp14 = \"-std=c++14\",\nCpp17 = \"-std=c++17\",\nCppLatest = \"-std=c++2a\",\nNoExceptions = \"-fno-exceptions\",\nNoRTTI = \"-fno-rtti\",\nUnsignedChar = \"-funsigned-char\",\n}\nlocal objcflags =\n{\nObjcARC = \"-fobjc-arc\",\n}\npremake.gcc.platforms =\n{\nNative = {\n" - "cppflags = \"-MMD -MP\",\n},\nx32 = {\ncppflags = \"-MMD -MP\",\nflags = \"-m32\",\n},\nx64 = {\ncppflags = \"-MMD -MP\",\nflags = \"-m64\",\n},\nUniversal = {\nar = \"libtool\",\ncppflags = \"-MMD -MP\",\nflags = \"-arch i386 -arch x86_64 -arch ppc -arch ppc64\",\n},\nUniversal32 = {\nar = \"libtool\",\ncppflags = \"-MMD -MP\",\nflags = \"-arch i386 -arch ppc\",\n},\nUniversal64 = {\nar = \"libtool\",\ncppflags = \"-MMD -MP\",\nflags = \"-arch x86_64 -arch ppc64\",\n},\nPS3 = {\ncc = \"ppu-lv2-g++\",\ncxx = \"ppu-lv2-g++\",\nar = \"ppu-lv2-ar\",\ncppflags = \"-MMD -MP\",\n},\nWiiDev = {\ncppflags = \"-MMD -MP -I$(LIBOGC_INC) $(MACHDEP)\",\nldflags= \"-L$(LIBOGC_LIB) $(MACHDEP)\",\ncfgsettings = [[\n ifeq ($(strip $(DEVKITPPC)),)\n $(error \"DEVKITPPC environment variable is not set\")'\n endif\n include $(DEVKITPPC)/wii_rules']],\n},\nOrbis = {\ncc = \"orbis-clang\",\ncxx = \"orbis-clang++\",\nar = \"orbis-ar\",\ncppflag" - "s = \"-MMD -MP\",\n},\nEmscripten = {\ncc = \"$(EMSCRIPTEN)/emcc\",\ncxx = \"$(EMSCRIPTEN)/em++\",\nar = \"$(EMSCRIPTEN)/emar\",\ncppflags = \"-MMD -MP\",\n}\n}\nlocal platforms = premake.gcc.platforms\nfunction premake.gcc.getcppflags(cfg)\nlocal flags = { }\ntable.insert(flags, platforms[cfg.platform].cppflags)\nif flags[1]:startswith(\"-MMD\") then\ntable.insert(flags, \"-MP\")\nend\nreturn flags\nend\nfunction premake.gcc.getcflags(cfg)\nlocal result = table.translate(cfg.flags, cflags)\ntable.insert(result, platforms[cfg.platform].flags)\nif cfg.system ~= \"windows\" and cfg.kind == \"SharedLib\" then\ntable.insert(result, \"-fPIC\")\nend\nreturn result\nend\nfunction premake.gcc.getcxxflags(cfg)\nlocal result = table.translate(cfg.flags, cxxflags)\nreturn result\nend\nfunction premake.gcc.getobjcflags(cfg)\nreturn table.translate(cfg.flags, objcflags)\nend\nfunction premake.gcc.getldflags(cfg)\nlocal result = { }\nif not cfg.flags.Symbols then\nif cfg.system == \"macosx\" then" - "\nelse\ntable.insert(result, \"-s\")\nend\nend\nif cfg.kind == \"Bundle\" then\ntable.insert(result, \"-bundle\")\nend\nif cfg.kind == \"SharedLib\" then\nif cfg.system == \"macosx\" then\ntable.insert(result, \"-dynamiclib\")\nelse\ntable.insert(result, \"-shared\")\nend\nif cfg.system == \"windows\" and not cfg.flags.NoImportLib then\ntable.insert(result, '-Wl,--out-implib=\"' .. cfg.linktarget.fullpath .. '\"')\nend\nend\nif cfg.kind == \"WindowedApp\" and cfg.system == \"windows\" then\ntable.insert(result, \"-mwindows\")\nend\nlocal platform = platforms[cfg.platform]\ntable.insert(result, platform.flags)\ntable.insert(result, platform.ldflags)\nreturn result\nend\nfunction premake.gcc.getlibdirflags(cfg)\nlocal result = { }\nfor _, value in ipairs(premake.getlinks(cfg, \"all\", \"directory\")) do\ntable.insert(result, '-L\\\"' .. value .. '\\\"')\nend\nreturn result\nend\nfunction premake.gcc.islibfile(p)\nif path.getextension(p) == \".a\" then\nreturn true\nend\nreturn false\nend\nfunction premake.gcc.ge" - "tlibfiles(cfg)\nlocal result = {}\nfor _, value in ipairs(premake.getlinks(cfg, \"system\", \"fullpath\")) do\nif premake.gcc.islibfile(value) then\ntable.insert(result, _MAKE.esc(value))\nend\nend\nreturn result\nend\nfunction premake.gcc.getlinkflags(cfg)\nlocal result = {}\nfor _, value in ipairs(premake.getlinks(cfg, \"system\", \"fullpath\")) do\nif premake.gcc.islibfile(value) then\nvalue = path.rebase(value, cfg.project.location, cfg.location)\ntable.insert(result, _MAKE.esc(value))\nelseif path.getextension(value) == \".framework\" then\ntable.insert(result, '-framework ' .. _MAKE.esc(path.getbasename(value)))\nelse\ntable.insert(result, '-l' .. _MAKE.esc(path.getname(value)))\nend\nend\nreturn result\nend\nfunction premake.gcc.wholearchive(lib)\nif premake.gcc.llvm then\nreturn {\"-force_load\", lib}\nelseif os.get() == \"macosx\" then\nreturn {\"-Wl,-force_load\", lib}\nelse\nreturn {\"-Wl,--whole-archive\", lib, \"-Wl,--no-whole-archive\"}\nend\nend\nfunction premake.gcc.getarchiveflags(prj, cfg, nd" - "x)\nlocal result = {}\nif cfg.platform:startswith(\"Universal\") then\nif prj.options.ArchiveSplit then\nerror(\"gcc tool 'Universal*' platforms do not support split archives\")\nend\ntable.insert(result, '-o')\nelse\nif (not prj.options.ArchiveSplit) then\nif premake.gcc.llvm then\ntable.insert(result, 'rcs')\nelse\ntable.insert(result, '-rcs')\nend\nelse\nif premake.gcc.llvm then\nif (not ndx) then\ntable.insert(result, 'qc')\nelse\ntable.insert(result, 'cs')\nend\nelse\nif (not ndx) then\ntable.insert(result, '-qc')\nelse\ntable.insert(result, '-cs')\nend\nend\nend\nend\nreturn result\nend\nfunction premake.gcc.getdefines(defines)\nlocal result = { }\nfor _,def in ipairs(defines) do\ntable.insert(result, \"-D\" .. def)\nend\nreturn result\nend\nfunction premake.gcc.getincludedirs(includedirs)\nlocal result = { }\nfor _,dir in ipairs(includedirs) do\ntable.insert(result, \"-I\\\"\" .. dir .. \"\\\"\")\nend\nreturn result\nend\nfunction premake.gcc.getquoteincludedirs(includedirs)\nlocal result = { }\nfor _,d" - "ir in ipairs(includedirs) do\ntable.insert(result, \"-iquote \\\"\" .. dir .. \"\\\"\")\nend\nreturn result\nend\nfunction premake.gcc.getsystemincludedirs(includedirs)\nlocal result = { }\nfor _,dir in ipairs(includedirs) do\ntable.insert(result, \"-isystem \\\"\" .. dir .. \"\\\"\")\nend\nreturn result\nend\nfunction premake.gcc.getcfgsettings(cfg)\nreturn platforms[cfg.platform].cfgsettings\nend\n", + "premake.gcc = { }\npremake.gcc.cc = \"gcc\"\npremake.gcc.cxx = \"g++\"\npremake.gcc.ar = \"ar\"\npremake.gcc.rc = \"windres\"\npremake.gcc.llvm = false\nlocal cflags =\n{\nEnableSSE = \"-msse\",\nEnableSSE2 = \"-msse2\",\nEnableAVX = \"-mavx\",\nEnableAVX2 = \"-mavx2\",\nPedanticWarnings = \"-Wall -Wextra -pedantic\",\nExtraWarnings = \"-Wall -Wextra\",\nFatalWarnings = \"-Werror\",\nFloatFast = \"-ffast-math\",\nFloatStrict = \"-ffloat-store\",\nNoFramePointer = \"-fomit-frame-pointer\",\nOptimize = \"-O2\",\nOptimizeSize = \"-Os\",\nOptimizeSpeed = \"-O3\",\nSymbols = \"-g\",\n}\nlocal cxxflags =\n{\nCpp11 = \"-std=c++11\",\nCpp14 = \"-std=c++14\",\nCpp17 = \"-std=c++17\",\nCpp20 = \"-std=c++20\",\nCppLatest = \"-std=c++2b\",\nNoExceptions = \"-fno-exceptions\",\nNoRTTI = \"-fno-rtti\",\nUnsignedChar = \"-funsigned-char\",\n}\nlocal objcflags =\n{\nObjcARC = \"-fobjc-arc\",\n}\npremake." + "gcc.platforms =\n{\nNative = {\ncppflags = \"-MMD -MP\",\n},\nx32 = {\ncppflags = \"-MMD -MP\",\nflags = \"-m32\",\n},\nx64 = {\ncppflags = \"-MMD -MP\",\nflags = \"-m64\",\n},\nUniversal = {\nar = \"libtool\",\ncppflags = \"-MMD -MP\",\nflags = \"-arch i386 -arch x86_64 -arch ppc -arch ppc64\",\n},\nUniversal32 = {\nar = \"libtool\",\ncppflags = \"-MMD -MP\",\nflags = \"-arch i386 -arch ppc\",\n},\nUniversal64 = {\nar = \"libtool\",\ncppflags = \"-MMD -MP\",\nflags = \"-arch x86_64 -arch ppc64\",\n},\nPS3 = {\ncc = \"ppu-lv2-g++\",\ncxx = \"ppu-lv2-g++\",\nar = \"ppu-lv2-ar\",\ncppflags = \"-MMD -MP\",\n},\nWiiDev = {\ncppflags = \"-MMD -MP -I$(LIBOGC_INC) $(MACHDEP)\",\nldflags= \"-L$(LIBOGC_LIB) $(MACHDEP)\",\ncfgsettings = [[\n ifeq ($(strip $(DEVKITPPC)),)\n $(error \"DEVKITPPC environment variable is not set\")'\n endif\n include $(DEVKITPPC)/wii_rules']],\n},\nOrbis = {\ncc = \"orbis-clang\",\ncxx = \"orbis-clang++\",\nar " + " = \"orbis-ar\",\ncppflags = \"-MMD -MP\",\n},\nEmscripten = {\ncc = \"$(EMSCRIPTEN)/emcc\",\ncxx = \"$(EMSCRIPTEN)/em++\",\nar = \"$(EMSCRIPTEN)/emar\",\ncppflags = \"-MMD -MP\",\n},\nNX32 = {\ncc = \"clang\",\ncxx = \"clang++\",\nar = \"armv7l-nintendo-nx-eabihf-ar\",\ncppflags = \"-MMD -MP\",\nflags = \"-march=armv7l\",\n},\nNX64 = {\ncc = \"clang\",\ncxx = \"clang++\",\nar = \"aarch64-nintendo-nx-elf-ar\",\ncppflags = \"-MMD -MP\",\nflags = \"-march=aarch64\",\n},\n}\nlocal platforms = premake.gcc.platforms\nfunction premake.gcc.getcppflags(cfg)\nlocal flags = { }\ntable.insert(flags, platforms[cfg.platform].cppflags)\nif flags[1]:startswith(\"-MMD\") then\ntable.insert(flags, \"-MP\")\nend\nreturn flags\nend\nfunction premake.gcc.getcflags(cfg)\nlocal result = table.translate(cfg.flags, cflags)\ntable.insert(result, platforms[cfg.platform].flags)\nif cfg.system ~= \"windows\" and cfg.kind == \"SharedLib\" then\nt" + "able.insert(result, \"-fPIC\")\nend\nreturn result\nend\nfunction premake.gcc.getcxxflags(cfg)\nlocal result = table.translate(cfg.flags, cxxflags)\nreturn result\nend\nfunction premake.gcc.getobjcflags(cfg)\nreturn table.translate(cfg.flags, objcflags)\nend\nfunction premake.gcc.getldflags(cfg)\nlocal result = { }\nif not cfg.flags.Symbols then\nif cfg.system == \"macosx\" then\nelse\ntable.insert(result, \"-s\")\nend\nend\nif cfg.kind == \"Bundle\" then\ntable.insert(result, \"-bundle\")\nend\nif cfg.kind == \"SharedLib\" then\nif cfg.system == \"macosx\" then\ntable.insert(result, \"-dynamiclib\")\nelse\ntable.insert(result, \"-shared\")\nend\nif cfg.system == \"windows\" and not cfg.flags.NoImportLib then\ntable.insert(result, '-Wl,--out-implib=\"' .. cfg.linktarget.fullpath .. '\"')\nend\nend\nif cfg.kind == \"WindowedApp\" and cfg.system == \"windows\" then\ntable.insert(result, \"-mwindows\")\nend\nlocal platform = platforms[cfg.platform]\ntable.insert(result, platform.flags)\ntable.insert(result, platf" + "orm.ldflags)\nreturn result\nend\nfunction premake.gcc.getlibdirflags(cfg)\nlocal result = { }\nfor _, value in ipairs(premake.getlinks(cfg, \"all\", \"directory\")) do\ntable.insert(result, '-L\\\"' .. value .. '\\\"')\nend\nreturn result\nend\nfunction premake.gcc.islibfile(p)\nif path.getextension(p) == \".a\" then\nreturn true\nend\nreturn false\nend\nfunction premake.gcc.getlibfiles(cfg)\nlocal result = {}\nfor _, value in ipairs(premake.getlinks(cfg, \"system\", \"fullpath\")) do\nif premake.gcc.islibfile(value) then\ntable.insert(result, _MAKE.esc(value))\nend\nend\nreturn result\nend\nfunction premake.gcc.getlinkflags(cfg)\nlocal result = {}\nfor _, value in ipairs(premake.getlinks(cfg, \"system\", \"fullpath\")) do\nif premake.gcc.islibfile(value) then\nvalue = path.rebase(value, cfg.project.location, cfg.location)\ntable.insert(result, _MAKE.esc(value))\nelseif path.getextension(value) == \".framework\" then\ntable.insert(result, '-framework ' .. _MAKE.esc(path.getbasename(value)))\nelse\ntable.inser" + "t(result, '-l' .. _MAKE.esc(path.getname(value)))\nend\nend\nreturn result\nend\nfunction premake.gcc.wholearchive(lib)\nif premake.gcc.llvm then\nreturn {\"-force_load\", lib}\nelseif os.get() == \"macosx\" then\nreturn {\"-Wl,-force_load\", lib}\nelse\nreturn {\"-Wl,--whole-archive\", lib, \"-Wl,--no-whole-archive\"}\nend\nend\nfunction premake.gcc.getarchiveflags(prj, cfg, ndx)\nlocal result = {}\nif cfg.platform:startswith(\"Universal\") then\nif prj.options.ArchiveSplit then\nerror(\"gcc tool 'Universal*' platforms do not support split archives\")\nend\ntable.insert(result, '-o')\nelse\nif (not prj.options.ArchiveSplit) then\nif premake.gcc.llvm then\ntable.insert(result, 'rcs')\nelse\ntable.insert(result, '-rcs')\nend\nelse\nif premake.gcc.llvm then\nif (not ndx) then\ntable.insert(result, 'qc')\nelse\ntable.insert(result, 'cs')\nend\nelse\nif (not ndx) then\ntable.insert(result, '-qc')\nelse\ntable.insert(result, '-cs')\nend\nend\nend\nend\nreturn result\nend\nfunction premake.gcc.getdefines(defines)\nl" + "ocal result = { }\nfor _,def in ipairs(defines) do\ntable.insert(result, \"-D\" .. def)\nend\nreturn result\nend\nfunction premake.gcc.getincludedirs(includedirs)\nlocal result = { }\nfor _,dir in ipairs(includedirs) do\ntable.insert(result, \"-I\\\"\" .. dir .. \"\\\"\")\nend\nreturn result\nend\nfunction premake.gcc.getquoteincludedirs(includedirs)\nlocal result = { }\nfor _,dir in ipairs(includedirs) do\ntable.insert(result, \"-iquote \\\"\" .. dir .. \"\\\"\")\nend\nreturn result\nend\nfunction premake.gcc.getsystemincludedirs(includedirs)\nlocal result = { }\nfor _,dir in ipairs(includedirs) do\ntable.insert(result, \"-isystem \\\"\" .. dir .. \"\\\"\")\nend\nreturn result\nend\nfunction premake.gcc.getcfgsettings(cfg)\nreturn platforms[cfg.platform].cfgsettings\nend\n", /* tools/ghs.lua */ "premake.ghs = { }\npremake.ghs.namestyle = \"PS3\"\npremake.ghs.cc = \"ccppc\"\npremake.ghs.cxx = \"cxppc\"\npremake.ghs.ar = \"cxppc\"\nlocal cflags =\n{\nFatalWarnings = \"--quit_after_warnings\",\nOptimize = \"-Ogeneral\",\nOptimizeSize = \"-Osize\",\nOptimizeSpeed = \"-Ospeed\",\nSymbols = \"-g\",\n}\nlocal cxxflags =\n{\nNoExceptions = \"--no_exceptions\",\nNoRTTI = \"--no_rtti\",\nUnsignedChar = \"--unsigned_chars\",\n}\npremake.ghs.platforms =\n{\nNative = {\ncppflags = \"-MMD\",\n},\nPowerPC = {\ncc = \"ccppc\",\ncxx = \"cxppc\",\nar = \"cxppc\",\ncppflags = \"-MMD\",\narflags = \"-archive -o\",\n},\nARM = {\ncc = \"ccarm\",\ncxx = \"cxarm\",\nar = \"cxarm\",\ncppflags = \"-MMD\",\narflags = \"-archive -o\",\n}\n}\nlocal platforms = premake.ghs.platforms\nfunction premake.ghs.getcppflags(cfg)\nlocal flags = { }\ntable.insert(flags, platforms[cfg.platform].cppflags)\nreturn flags\nend\nfunction premake.ghs.getcf" @@ -172,9 +174,9 @@ const char* builtin_scripts[] = { "esult = { }\nfor _,def in ipairs(defines) do\ntable.insert(result, '-D' .. def)\nend\nreturn result\nend\nfunction premake.snc.getincludedirs(includedirs)\nlocal result = { }\nfor _,dir in ipairs(includedirs) do\ntable.insert(result, \"-I\" .. _MAKE.esc(dir))\nend\nreturn result\nend\n", /* tools/valac.lua */ - "premake.valac = { }\npremake.valac.valac = \"valac\"\npremake.valac.cc = \"gcc\"\nlocal valaflags =\n{\nDisableAssert = \"--disable-assert\", -- Disable assertions\nDisableSinceCheck = \"--disable-since-check\", -- Do not check whether used symbols exist in local packages\nDisableWarnings = \"--disable-warnings\", -- Disable warnings\nEnableChecking = \"--enable-checking\", -- Enable additional run-time checks\nEnableDeprecated = \"--enable-deprecated\", -- Enable deprecated features\nEnableExperimental = \"--enable-experimental\", -- Enable experimental features\nEnableExperimentalNonNull = \"--enable-experimental-non-null\", -- Enable experimental enhancements for non-null types\nEnableGObjectTracing = \"--enable-gobject-tracing\", -- Enable GObject creation tracing\nEnableMemProfiler = \"--enable-mem-profiler\", -- Enable GLib memory profiler\nEnableTh" - "reading = \"--thread\", -- Enable multithreading support\nFatalWarnings = \"--fatal-warnings\", -- Treat warnings as fatal\nHideInternal = \"--hide-internal\", -- Hide symbols marked as internal\nNoStdPkg = \"--nostdpkg\", -- Do not include standard packages\nOptimize = \"-X -O2\",\nOptimizeSize = \"-X -Os\",\nOptimizeSpeed = \"-X -O3\",\nSymbols = \"-g\", -- Produce debug information\n}\npremake.valac.platforms = {}\nfunction premake.valac.getvalaflags(cfg)\nreturn table.translate(cfg.flags, valaflags)\nend\nfunction premake.valac.getlinks(links)\nlocal result = { }\nfor _, pkg in ipairs(links) do\ntable.insert(result, '--pkg ' .. pkg)\nend\nreturn result\nend\nfunction premake.valac.getdefines(defines)\nlocal result = { }\nfor _, def in ipairs(defines) do\ntable.insert(result, '-D ' .. def)\nend\nretu" - "rn result\nend\nfunction premake.valac.getbuildoptions(buildoptions)\nlocal result = { }\nfor _, def in ipairs(buildoptions) do\ntable.insert(result, '-X ' .. def)\nend\nreturn result\nend\nfunction premake.valac.getvapidirs(vapidirs)\nlocal result = { }\nfor _, def in ipairs(vapidirs) do\ntable.insert(result, '--vapidir=' .. def)\nend\nreturn result\nend\n", + "premake.valac = { }\npremake.valac.valac = \"valac\"\npremake.valac.cc = premake.gcc.cc\npremake.valac.glibrc = \"glib-compile-resources\"\nlocal valaflags =\n{\nDisableAssert = \"--disable-assert\", -- Disable assertions\nDisableSinceCheck = \"--disable-since-check\", -- Do not check whether used symbols exist in local packages\nDisableWarnings = \"--disable-warnings\", -- Disable warnings\nEnableChecking = \"--enable-checking\", -- Enable additional run-time checks\nEnableDeprecated = \"--enable-deprecated\", -- Enable deprecated features\nEnableExperimental = \"--enable-experimental\", -- Enable experimental features\nEnableExperimentalNonNull = \"--enable-experimental-non-null\", -- Enable experimental enhancements for non-null types\nEnableGObjectTracing = \"--enable-gobject-tracing\", -- Enable GObject creation tracing\nEnableMemProfiler = \"--enable-mem-pro" + "filer\", -- Enable GLib memory profiler\nFatalWarnings = \"--fatal-warnings\", -- Treat warnings as fatal\nHideInternal = \"--hide-internal\", -- Hide symbols marked as internal\nNoStdPkg = \"--nostdpkg\", -- Do not include standard packages\nSymbols = \"-g\", -- Produce debug information\n}\nlocal valaccflags =\n{\nOptimize = \"-O2\",\nOptimizeSize = \"-Os\",\nOptimizeSpeed = \"-O3\",\nSymbols = \"-g\", -- Produce debug information\n}\npremake.valac.platforms =\n{\nNative = {\n},\nx64 = {\nflags = \"-m64\"\n},\n}\nfunction premake.valac.getvalaflags(cfg)\nreturn table.translate(cfg.flags, valaflags)\nend\nfunction premake.valac.getvalaccflags(cfg)\nreturn table.translate(cfg.flags, valaccflags)\nend\nfunction premake.valac.getlinks(links)\nlocal result = { }\nfor _, pkg in ipairs" + "(links) do\ntable.insert(result, '--pkg ' .. pkg)\nend\nreturn result\nend\nfunction premake.valac.getdefines(defines)\nlocal result = { }\nfor _, def in ipairs(defines) do\ntable.insert(result, '-D ' .. def)\nend\nreturn result\nend\nfunction premake.valac.getvapidirs(vapidirs)\nlocal result = { }\nfor _, def in ipairs(vapidirs) do\ntable.insert(result, '--vapidir=' .. def)\nend\nreturn result\nend\n", /* tools/swift.lua */ "premake.swift = { }\npremake.swift.swiftc = \"swiftc\"\npremake.swift.swift = \"swift\"\npremake.swift.cc = \"gcc\"\npremake.swift.ar = \"ar\"\npremake.swift.ld = \"ld\"\npremake.swift.dsymutil = \"dsymutil\"\nlocal swiftcflags =\n{\nSymbols = \"-g\", -- Produce debug information\nDisableWarnings = \"--suppress-warnings\", -- Disable warnings\nFatalWarnings = \"--warnings-as-errors\", -- Treat warnings as fatal\nOptimize = \"-O -whole-module-optimization\",\nOptimizeSize = \"-O -whole-module-optimization\",\nOptimizeSpeed = \"-Ounchecked -whole-module-optimization\",\nMinimumWarnings = \"-minimum-warnings\",\n}\nlocal swiftlinkflags = {\nStaticRuntime = \"-static-stdlib\",\n}\npremake.swift.platforms = {\nNative = {\nswiftcflags = \"\",\nswiftlinkflags = \"\",\n},\nx64 = {\nswiftcflags = \"\",\nswiftlinkflags = \"\",\n}\n}\nlocal p" @@ -204,24 +206,26 @@ const char* builtin_scripts[] = { "premake.cmake = { }\nnewaction {\ntrigger = \"cmake\",\nshortname = \"CMake\",\ndescription = \"Generate CMake project files\",\nvalid_kinds = { \"ConsoleApp\", \"WindowedApp\", \"StaticLib\", \"SharedLib\", \"Bundle\" },\nvalid_languages = { \"C\", \"C++\" },\nvalid_tools = {\ncc = { \"gcc\" },\n},\nonsolution = function(sln)\npremake.generate(sln, \"CMakeLists.txt\", premake.cmake.workspace)\nend,\nonproject = function(prj)\npremake.generate(prj, \"%%/CMakeLists.txt\", premake.cmake.project)\nend,\noncleansolution = function(sln)\npremake.clean.file(sln, \"CMakeLists.txt\")\nend,\noncleanproject = function(prj)\npremake.clean.file(prj, \"%%/CMakeLists.txt\")\nend\n}", /* actions/cmake/cmake_workspace.lua */ - "function premake.cmake.workspace(sln)\nif (sln.location ~= _WORKING_DIR) then\nlocal name = string.format(\"%s/CMakeLists.txt\", _WORKING_DIR)\nlocal f, err = io.open(name, \"wb\")\nif (not f) then\nerror(err, 0)\nend\nf:write('# CMakeLists autogenerated by GENie\\n')\nf:write('cmake_minimum_required(VERSION 2.8.4)\\n')\nf:write('\\n')\nf:write('add_subdirectory('.. path.getrelative(_WORKING_DIR, sln.location) ..')\\n')\nf:close()\nend\n_p('# CMakeLists autogenerated by GENie')\n_p('cmake_minimum_required(VERSION 2.8.4)')\n_p('')\nfor i,prj in ipairs(sln.projects) do\nlocal name = premake.esc(prj.name)\n_p('add_subdirectory(%s)', name)\nend\nend\n", + "function premake.cmake.workspace(sln)\nif (sln.location ~= _WORKING_DIR) then\nlocal name = string.format(\"%s/CMakeLists.txt\", _WORKING_DIR)\nlocal f, err = io.open(name, \"wb\")\nif (not f) then\nerror(err, 0)\nend\nf:write([[\n# CMakeLists autogenerated by GENie\nproject(GENie)\ncmake_minimum_required(VERSION 3.15)\n#########################################################################\n# Set a default build type if none was specified\n# Source: https://blog.kitware.com/cmake-and-the-default-build-type/\nset(default_build_type \"Release\")\nif(EXISTS \"${CMAKE_SOURCE_DIR}/.git\")\n set(default_build_type \"Debug\")\nendif()\nif(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)\n message(STATUS \"Setting build type to '${default_build_type}' as none was specified.\")\n set(CMAKE_BUILD_TYPE \"${default_build_type}\" CACHE STRING \"Choose the type of build.\" FORCE)\n # Set the possible values of build type for cmake-gui\n set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS \"Debug\" \"Release" + "\" \"MinSizeRel\" \"RelWithDebInfo\")\nendif()\n#########################################################################\n]])\nif os.is(\"windows\") then\nf:write('cmake_policy(SET CMP0091 NEW)\\n')\nend\nf:write('add_subdirectory('.. path.getrelative(_WORKING_DIR, sln.location) ..')\\n')\nf:close()\nend\n_p([[\n# CMakeLists autogenerated by GENie\ncmake_minimum_required(VERSION 3.15)\n]])\nif os.is(\"windows\") then\n_p('cmake_policy(SET CMP0091 NEW)')\nend\nfor i,prj in ipairs(sln.projects) do\nlocal name = premake.esc(prj.name)\n_p('add_subdirectory(%s)', name)\nend\nend\n", /* actions/cmake/cmake_project.lua */ - "local cmake = premake.cmake\nlocal tree = premake.tree\nlocal includestr = 'include_directories(../%s)'\nlocal definestr = 'add_definitions(-D%s)'\nlocal function is_excluded(prj, cfg, file)\n if table.icontains(prj.excludes, file) then\n return true\n end\n if table.icontains(cfg.excludes, file) then\n return true\n end\n return false\nend\nfunction cmake.excludedFiles(prj, cfg, src)\n for _, v in ipairs(src) do\n if (is_excluded(prj, cfg, v)) then\n _p(1, 'list(REMOVE_ITEM source_list ../%s)', v)\n end\n end\nend\nfunction cmake.list(value)\n if #value > 0 then\n return \" \" .. table.concat(value, \" \")\n else\n return \"\"\n end\nend\nfunction cmake.files(prj)\n local ret = {}\n local tr = premake.project.buildsourcetree(prj)\n tree.traverse(tr, {\n onbranchenter = function(node, depth)\n end,\n onbranchexit = function(node, depth)\n end,\n onleaf = function(node, depth)\n " - " assert(node, \"unexpected empty node\")\n if node.cfg then\n table.insert(ret, node.cfg.name)\n _p(1, '../%s', node.cfg.name)\n end\n end,\n }, true, 1)\n return ret\nend\nfunction cmake.header(prj)\n _p('# %s project autogenerated by GENie', premake.action.current().shortname)\n _p('cmake_minimum_required(VERSION 2.8.4)')\n _p('')\n _p('project(%s)', premake.esc(prj.name))\nend\nfunction cmake.customtasks(prj)\n local dirs = {}\n local tasks = {}\n for _, custombuildtask in ipairs(prj.custombuildtask or {}) do\n for _, buildtask in ipairs(custombuildtask or {}) do\n table.insert(tasks, buildtask)\n local d = string.format(\"${CMAKE_CURRENT_SOURCE_DIR}/../%s\", path.getdirectory(path.getrelative(prj.location, buildtask[2])))\n if not table.contains(dirs, d) then\n table.insert(dirs, d)\n _p('file(MAKE_DIRECTORY \\\"%s\\\")', d)\n end\n " - " end\n end\n _p('')\n for _, buildtask in ipairs(tasks) do\n local deps = string.format(\"${CMAKE_CURRENT_SOURCE_DIR}/../%s \", path.getrelative(prj.location, buildtask[1]))\n local outputs = string.format(\"${CMAKE_CURRENT_SOURCE_DIR}/../%s \", path.getrelative(prj.location, buildtask[2]))\n local msg = \"\"\n for _, depdata in ipairs(buildtask[3] or {}) do\n deps = deps .. string.format(\"${CMAKE_CURRENT_SOURCE_DIR}/../%s \", path.getrelative(prj.location, depdata))\n end\n _p('add_custom_command(')\n _p(1, 'OUTPUT %s', outputs)\n _p(1, 'DEPENDS %s', deps)\n for _, cmdline in ipairs(buildtask[4] or {}) do\n if (cmdline:sub(1, 1) ~= \"@\") then\n local cmd = cmdline\n local num = 1\n for _, depdata in ipairs(buildtask[3] or {}) do\n cmd = string.gsub(cmd, \"%$%(\" .. num .. \"%)\", string.format(\"${CMAKE_CURRENT_SOURCE_DIR}/../%s \", path.getrelative(pr" - "j.location, depdata)))\n num = num + 1\n end\n cmd = string.gsub(cmd, \"%$%(<%)\", string.format(\"${CMAKE_CURRENT_SOURCE_DIR}/../%s \", path.getrelative(prj.location, buildtask[1])))\n cmd = string.gsub(cmd, \"%$%(@%)\", outputs)\n _p(1, 'COMMAND %s', cmd)\n else\n msg = cmdline\n end\n end\n _p(1, 'COMMENT \\\"%s\\\"', msg)\n _p(')')\n _p('')\n end\nend\nfunction cmake.depRules(prj)\n local maintable = {}\n for _, dependency in ipairs(prj.dependency) do\n for _, dep in ipairs(dependency) do\n if path.issourcefile(dep[1]) then\n local dep1 = premake.esc(path.getrelative(prj.location, dep[1]))\n local dep2 = premake.esc(path.getrelative(prj.location, dep[2]))\n if not maintable[dep1] then maintable[dep1] = {} end\n table.insert(maintable[dep1], dep2)\n end\n end\n " - " end\n for key, _ in pairs(maintable) do\n local deplist = {}\n local depsname = string.format('%s_deps', path.getname(key))\n for _, d2 in pairs(maintable[key]) do\n table.insert(deplist, d2)\n end\n _p('set(')\n _p(1, depsname)\n for _, v in pairs(deplist) do\n _p(1, '${CMAKE_CURRENT_SOURCE_DIR}/../%s', v)\n end\n _p(')')\n _p('')\n _p('set_source_files_properties(')\n _p(1, '\\\"${CMAKE_CURRENT_SOURCE_DIR}/../%s\\\"', key)\n _p(1, 'PROPERTIES OBJECT_DEPENDS \\\"${%s}\\\"', depsname)\n _p(')')\n _p('')\n end\nend\nfunction cmake.commonRules(conf, str)\n local Dupes = {}\n local t2 = {}\n for _, cfg in ipairs(conf) do\n local cfgd = iif(str == includestr, cfg.includedirs, cfg.defines)\n for _, v in ipairs(cfgd) do\n if(t2[v] == #conf - 1) then\n _p(str, v)\n table.insert(Dupes, v)\n end\n if n" - "ot t2[v] then\n t2[v] = 1\n else\n t2[v] = t2[v] + 1\n end\n end\n end\n return Dupes\nend\nfunction cmake.cfgRules(cfg, dupes, str)\n for _, v in ipairs(cfg) do\n if (not table.icontains(dupes, v)) then\n _p(1, str, v)\n end\n end\nend\nfunction cmake.removeCrosscompiler(platforms)\n for i = #platforms, 1, -1 do\n if premake.platforms[platforms[i]].iscrosscompiler then\n table.remove(platforms, i)\n end\n end\nend\nfunction cmake.project(prj)\n io.indent = \" \"\n cmake.header(prj)\n _p('set(')\n _p('source_list')\n local source_files = cmake.files(prj)\n _p(')')\n _p('')\n local nativeplatform = iif(os.is64bit(), \"x64\", \"x32\")\n local cc = premake.gettool(prj)\n local platforms = premake.filterplatforms(prj.solution, cc.platforms, \"Native\")\n cmake.removeCrosscompiler(platforms)\n local configurations = {}\n for _, platform in ipairs(plat" - "forms) do\n for cfg in premake.eachconfig(prj, platform) do\n -- TODO: Extend support for 32-bit targets on 64-bit hosts\n if cfg.platform == nativeplatform then\n table.insert(configurations, cfg)\n end\n end\n end\n local commonIncludes = cmake.commonRules(configurations, includestr)\n local commonDefines = cmake.commonRules(configurations, definestr)\n _p('')\n for _, cfg in ipairs(configurations) do\n _p('if(CMAKE_BUILD_TYPE MATCHES \\\"%s\\\")', cfg.name)\n -- list excluded files\n cmake.excludedFiles(prj, cfg, source_files)\n -- add includes directories\n cmake.cfgRules(cfg.includedirs, commonIncludes, includestr)\n -- add build defines\n cmake.cfgRules(cfg.defines, commonDefines, definestr)\n -- set CXX flags\n _p(1, 'set(CMAKE_CXX_FLAGS \\\"${CMAKE_CXX_FLAGS} %s\\\")', cmake.list(table.join(cc.getcppflags(cfg), cc.getcflags(cfg), cc.getcxxflags(cfg), cfg.buildoptio" - "ns, cfg.buildoptions_cpp)))\n -- set C flags\n _p(1, 'set(CMAKE_C_FLAGS \\\"${CMAKE_C_FLAGS} %s\\\")', cmake.list(table.join(cc.getcppflags(cfg), cc.getcflags(cfg), cfg.buildoptions, cfg.buildoptions_c)))\n _p('endif()')\n _p('')\n end\n -- force CPP if needed\n if (prj.options.ForceCPP) then\n _p('set_source_files_properties(${source_list} PROPERTIES LANGUAGE CXX)')\n end\n -- add custom tasks\n cmake.customtasks(prj)\n -- per-dependency build rules\n cmake.depRules(prj)\n for _, cfg in ipairs(configurations) do\n _p('if(CMAKE_BUILD_TYPE MATCHES \\\"%s\\\")', cfg.name)\n if (prj.kind == 'StaticLib') then\n _p(1, 'add_library(%s STATIC ${source_list})', premake.esc(cfg.buildtarget.basename))\n end\n if (prj.kind == 'SharedLib') then\n _p(1, 'add_library(%s SHARED ${source_list})', premake.esc(cfg.buildtarget.basename))\n end\n if (prj.kind == 'ConsoleApp' or prj.kind == 'WindowedApp') t" - "hen\n _p(1, 'add_executable(%s ${source_list})', premake.esc(cfg.buildtarget.basename))\n _p(1, 'target_link_libraries(%s%s%s)', premake.esc(cfg.buildtarget.basename), cmake.list(premake.esc(premake.getlinks(cfg, \"siblings\", \"basename\"))), cmake.list(cc.getlinkflags(cfg)))\n end\n _p('endif()')\n _p('')\n end\nend", + "local cmake = premake.cmake\nlocal tree = premake.tree\nlocal includestr = 'include_directories(../%s)'\nlocal definestr = 'add_definitions(-D%s)'\nlocal function is_excluded(prj, cfg, file)\n if table.icontains(prj.excludes, file) then\n return true\n end\n if table.icontains(cfg.excludes, file) then\n return true\n end\n return false\nend\nfunction cmake.excludedFiles(prj, cfg, src)\n for _, v in ipairs(src) do\n if (is_excluded(prj, cfg, v)) then\n _p(1, 'list(REMOVE_ITEM source_list ../%s)', v)\n end\n end\nend\nfunction cmake.list(value)\n if #value > 0 then\n return \" \" .. table.concat(value, \" \")\n else\n return \"\"\n end\nend\nfunction cmake.listWrapped(value, prefix, postfix)\n if #value > 0 then\n return prefix .. table.concat(value, postfix .. prefix) .. postfix\n else\n return \"\"\n end\nend\nfunction cmake.files(prj)\n local ret = {}\n local tr = premake.project.buildsourcetree(prj" + ")\n tree.traverse(tr, {\n onbranchenter = function(node, depth)\n end,\n onbranchexit = function(node, depth)\n end,\n onleaf = function(node, depth)\n assert(node, \"unexpected empty node\")\n if node.cfg then\n table.insert(ret, node.cfg.name)\n _p(1, '../%s', node.cfg.name)\n end\n end,\n }, true, 1)\n return ret\nend\nfunction cmake.header(prj)\n _p('# %s project autogenerated by GENie', premake.action.current().shortname)\n _p('cmake_minimum_required(VERSION 3.15)')\n if os.is(\"windows\") then\n -- Add support for CMP0091, see https://cmake.org/cmake/help/latest/policy/CMP0091.html\n _p('cmake_policy(SET CMP0091 NEW)')\n end\n _p('')\n _p('project(%s)', premake.esc(prj.name))\n _p('')\n _p('include(GNUInstallDirs)')\nend\nfunction cmake.customtasks(prj)\n local dirs = {}\n local tasks = {}\n for _, custombuildtask in ipairs(prj.custombuildtask or" + " {}) do\n for _, buildtask in ipairs(custombuildtask or {}) do\n table.insert(tasks, buildtask)\n local d = string.format(\"${CMAKE_CURRENT_SOURCE_DIR}/../%s\", path.getdirectory(path.getrelative(prj.location, buildtask[2])))\n if not table.contains(dirs, d) then\n table.insert(dirs, d)\n _p('file(MAKE_DIRECTORY \\\"%s\\\")', d)\n end\n end\n end\n _p('')\n for _, buildtask in ipairs(tasks) do\n local deps = string.format(\"${CMAKE_CURRENT_SOURCE_DIR}/../%s \", path.getrelative(prj.location, buildtask[1]))\n local outputs = string.format(\"${CMAKE_CURRENT_SOURCE_DIR}/../%s \", path.getrelative(prj.location, buildtask[2]))\n local msg = \"\"\n for _, depdata in ipairs(buildtask[3] or {}) do\n deps = deps .. string.format(\"${CMAKE_CURRENT_SOURCE_DIR}/../%s \", path.getrelative(prj.location, depdata))\n end\n _p('add_custom_command(')\n _p(1, 'OUTPUT %s', ou" + "tputs)\n _p(1, 'DEPENDS %s', deps)\n for _, cmdline in ipairs(buildtask[4] or {}) do\n if (cmdline:sub(1, 1) ~= \"@\") then\n local cmd = cmdline\n local num = 1\n for _, depdata in ipairs(buildtask[3] or {}) do\n cmd = string.gsub(cmd, \"%$%(\" .. num .. \"%)\", string.format(\"${CMAKE_CURRENT_SOURCE_DIR}/../%s \", path.getrelative(prj.location, depdata)))\n num = num + 1\n end\n cmd = string.gsub(cmd, \"%$%(<%)\", string.format(\"${CMAKE_CURRENT_SOURCE_DIR}/../%s \", path.getrelative(prj.location, buildtask[1])))\n cmd = string.gsub(cmd, \"%$%(@%)\", outputs)\n _p(1, 'COMMAND %s', cmd)\n else\n msg = cmdline\n end\n end\n _p(1, 'COMMENT \\\"%s\\\"', msg)\n _p(')')\n _p('')\n end\nend\nfunction cmake.depRules(prj)\n local maintable = {}\n for _, dependency in ipairs(prj.d" + "ependency) do\n for _, dep in ipairs(dependency) do\n if path.issourcefile(dep[1]) then\n local dep1 = premake.esc(path.getrelative(prj.location, dep[1]))\n local dep2 = premake.esc(path.getrelative(prj.location, dep[2]))\n if not maintable[dep1] then maintable[dep1] = {} end\n table.insert(maintable[dep1], dep2)\n end\n end\n end\n for key, _ in pairs(maintable) do\n local deplist = {}\n local depsname = string.format('%s_deps', path.getname(key))\n for _, d2 in pairs(maintable[key]) do\n table.insert(deplist, d2)\n end\n _p('set(')\n _p(1, depsname)\n for _, v in pairs(deplist) do\n _p(1, '${CMAKE_CURRENT_SOURCE_DIR}/../%s', v)\n end\n _p(')')\n _p('')\n _p('set_source_files_properties(')\n _p(1, '\\\"${CMAKE_CURRENT_SOURCE_DIR}/../%s\\\"', key)\n _p(1, 'PROPERTIES OBJECT_DEPENDS \\\"${%s}\\\"', d" + "epsname)\n _p(')')\n _p('')\n end\nend\nfunction cmake.commonRules(conf, str)\n local Dupes = {}\n local t2 = {}\n for _, cfg in ipairs(conf) do\n local cfgd = iif(str == includestr, cfg.includedirs, cfg.defines)\n for _, v in ipairs(cfgd) do\n if(t2[v] == #conf - 1) then\n _p(str, v)\n table.insert(Dupes, v)\n end\n if not t2[v] then\n t2[v] = 1\n else\n t2[v] = t2[v] + 1\n end\n end\n end\n return Dupes\nend\nfunction cmake.cfgRules(cfg, dupes, str)\n for _, v in ipairs(cfg) do\n if (not table.icontains(dupes, v)) then\n _p(1, str, v)\n end\n end\nend\nfunction cmake.removeCrosscompiler(platforms)\n for i = #platforms, 1, -1 do\n if premake.platforms[platforms[i]].iscrosscompiler then\n table.remove(platforms, i)\n end\n end\nend\nfunction cmake.project(prj)\n io.indent = \" \"" + "\n cmake.header(prj)\n _p('set(')\n _p('source_list')\n local source_files = cmake.files(prj)\n _p(')')\n _p('')\n local nativeplatform = iif(os.is64bit(), \"x64\", \"x32\")\n local cc = premake.gettool(prj)\n local platforms = premake.filterplatforms(prj.solution, cc.platforms, \"Native\")\n cmake.removeCrosscompiler(platforms)\n local configurations = {}\n for _, platform in ipairs(platforms) do\n for cfg in premake.eachconfig(prj, platform) do\n -- TODO: Extend support for 32-bit targets on 64-bit hosts\n if cfg.platform == nativeplatform then\n table.insert(configurations, cfg)\n end\n end\n end\n local commonIncludes = cmake.commonRules(configurations, includestr)\n local commonDefines = cmake.commonRules(configurations, definestr)\n _p('')\n for _, cfg in ipairs(configurations) do\n _p('if(CMAKE_BUILD_TYPE MATCHES \\\"%s\\\")', cfg.name)\n -- list excluded files\n cmake.ex" + "cludedFiles(prj, cfg, source_files)\n -- add includes directories\n cmake.cfgRules(cfg.includedirs, commonIncludes, includestr)\n -- add build defines\n cmake.cfgRules(cfg.defines, commonDefines, definestr)\n -- set CXX flags\n _p(1, 'set(CMAKE_CXX_FLAGS \\\"${CMAKE_CXX_FLAGS} %s\\\")', cmake.list(table.join(cc.getcppflags(cfg), cc.getcflags(cfg), cc.getcxxflags(cfg), cfg.buildoptions, cfg.buildoptions_cpp)))\n -- set C flags\n _p(1, 'set(CMAKE_C_FLAGS \\\"${CMAKE_C_FLAGS} %s\\\")', cmake.list(table.join(cc.getcppflags(cfg), cc.getcflags(cfg), cfg.buildoptions, cfg.buildoptions_c)))\n _p('endif()')\n _p('')\n end\n -- force CPP if needed\n if (prj.options.ForceCPP) then\n _p('set_source_files_properties(${source_list} PROPERTIES LANGUAGE CXX)')\n end\n -- add custom tasks\n cmake.customtasks(prj)\n -- per-dependency build rules\n cmake.depRules(prj)\n for _, cfg in ipairs(configurations) do\n _p('if(C" + "MAKE_BUILD_TYPE MATCHES \\\"%s\\\")', cfg.name)\n if (prj.kind == 'StaticLib') then\n _p(1, 'add_library(%s STATIC ${source_list})', premake.esc(cfg.buildtarget.basename))\n -- Install\n _p(1, 'install(TARGETS %s RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR})', premake.esc(cfg.buildtarget.basename))\n end\n if (prj.kind == 'SharedLib') then\n _p(1, 'add_library(%s SHARED ${source_list})', premake.esc(cfg.buildtarget.basename))\n -- Install\n _p(1, 'install(TARGETS %s RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR})', premake.esc(cfg.buildtarget.basename))\n end\n if (prj.kind == 'ConsoleApp' or prj.kind == 'WindowedApp') then\n _p(1, 'add_executable(%s ${source_list})', premake.esc(cfg.buildtarget.basename))\n local libdirs = cmake.listWrapped(premake.esc(premake.getlinks(cfg, \"all\", \"directory\")), \" -L\\\"../\", \"\\\"\")\n _p(1, 'target_link_libraries(%s%s%s%s%s%s)', premake.es" + "c(cfg.buildtarget.basename), libdirs, cmake.list(cfg.linkoptions), cmake.list(cc.getldflags(cfg)), cmake.list(premake.esc(premake.getlinks(cfg, \"siblings\", \"basename\"))), cmake.list(cc.getlinkflags(cfg)))\n -- Install\n _p(1, 'install(TARGETS %s RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})', premake.esc(cfg.buildtarget.basename))\n end\n _p('endif()')\n _p('')\n end\nend", /* actions/make/_make.lua */ - "_MAKE = { }\npremake.make = { }\nlocal make = premake.make\nfunction _MAKE.esc(value)\nlocal result\nif (type(value) == \"table\") then\nresult = { }\nfor _,v in ipairs(value) do\ntable.insert(result, _MAKE.esc(v))\nend\nreturn result\nelse\nresult = value:gsub(\"\\\\\", \"\\\\\\\\\")\nresult = result:gsub(\" \", \"\\\\ \")\nresult = result:gsub(\"%%(\", \"\\\\%(\")\nresult = result:gsub(\"%%)\", \"\\\\%)\")\nresult = result:gsub(\"$\\\\%((.-)\\\\%)\", \"$%(%1%)\")\nreturn result\nend\nend\nfunction _MAKE.escquote(value)\nlocal result\nif (type(value) == \"table\") then\nresult = { }\nfor _,v in ipairs(value) do\ntable.insert(result, _MAKE.escquote(v))\nend\nreturn result\nelse\nreturn value\nend\nend\nfunction premake.make_copyrule(source, target)\n_p('%s: %s', target, source)\n_p('\\t@echo Copying $(notdir %s)', target)\n_p('\\t-$(call COPY,%s,%s)', source, target)\nend\nfunction premake.make_mkdirrule(var)\n_p('\\t@echo Creating %s', var)\n_p('\\t-$(call MKDIR,%s)', var)\n_p('')\nend\nfunction make.list(val" - "ue)\nif #value > 0 then\nreturn \" \" .. table.concat(value, \" \")\nelse\nreturn \"\"\nend\nend\nfunction _MAKE.getmakefilename(this, searchprjs)\nlocal count = 0\nfor sln in premake.solution.each() do\nif (sln.location == this.location) then count = count + 1 end\nif (searchprjs) then\nfor _,prj in ipairs(sln.projects) do\nif (prj.location == this.location) then count = count + 1 end\nend\nend\nend\nif (count == 1) then\nreturn \"Makefile\"\nelse\nreturn this.name .. \".make\"\nend\nend\nfunction _MAKE.getnames(tbl)\nlocal result = table.extract(tbl, \"name\")\nfor k,v in pairs(result) do\nresult[k] = _MAKE.esc(v)\nend\nreturn result\nend\nfunction make.settings(cfg, cc)\nif #cfg.makesettings > 0 then\nfor _, value in ipairs(cfg.makesettings) do\n_p(value)\nend\nend\nlocal toolsettings = cc.platforms[cfg.platform].cfgsettings\nif toolsettings then\n_p(toolsettings)\nend\nend\nnewaction {\ntrigger = \"gmake\",\nshortname = \"GNU Make\",\ndescription = \"Generate GNU makefiles for POSIX, MinG" - "W, and Cygwin\",\nvalid_kinds = { \"ConsoleApp\", \"WindowedApp\", \"StaticLib\", \"SharedLib\", \"Bundle\" },\nvalid_languages = { \"C\", \"C++\", \"C#\", \"Vala\", \"Swift\" },\nvalid_tools = {\ncc = { \"gcc\", \"ghs\" },\ndotnet = { \"mono\", \"msnet\", \"pnet\" },\nvalac = { \"valac\" },\nswift = { \"swift\" },\n},\nonsolution = function(sln)\npremake.generate(sln, _MAKE.getmakefilename(sln, false), premake.make_solution)\nend,\nonproject = function(prj)\nlocal makefile = _MAKE.getmakefilename(prj, true)\nif premake.isdotnetproject(prj) then\npremake.generate(prj, makefile, premake.make_csharp)\nelseif premake.iscppproject(prj) then\npremake.generate(prj, makefile, premake.make_cpp)\nelseif premake.isswiftproject(prj) then\npremake.generate(prj, makefile, premake.make_swift)\nelse\npremake.generate(prj, makefile, premake.make_vala)\nend\nend,\noncleansolution = function(sln)\npremake.clean.file(sln, _MAKE.getmakefilename(sln, false))\nend,\noncleanproject = function(prj)\npremake.clean.file(p" - "rj, _MAKE.getmakefilename(prj, true))\nend,\ngmake = {}\n}\n", + "_MAKE = { }\npremake.make = { }\nlocal make = premake.make\nfunction _MAKE.esc(value)\nlocal result\nif (type(value) == \"table\") then\nresult = { }\nfor _,v in ipairs(value) do\ntable.insert(result, _MAKE.esc(v))\nend\nreturn result\nelse\nresult = value:gsub(\"\\\\\", \"\\\\\\\\\")\nresult = result:gsub(\" \", \"\\\\ \")\nresult = result:gsub(\"%%(\", \"\\\\%(\")\nresult = result:gsub(\"%%)\", \"\\\\%)\")\nresult = result:gsub(\"$\\\\%((.-)\\\\%)\", \"$%(%1%)\")\nreturn result\nend\nend\nfunction _MAKE.escquote(value)\nlocal result\nif (type(value) == \"table\") then\nresult = { }\nfor _,v in ipairs(value) do\ntable.insert(result, _MAKE.escquote(v))\nend\nreturn result\nelse\nresult = value:gsub(\" \", \"\\\\ \")\nresult = result:gsub(\"\\\"\", \"\\\\\\\"\")\nreturn result\nend\nend\nfunction premake.make_copyrule(source, target)\n_p('%s: %s', target, source)\n_p('\\t@echo Copying $(notdir %s)', target)\n_p('\\t-$(call COPY,%s,%s)', source, target)\nend\nfunction premake.make_mkdirrule(var)\n_p('\\t@echo Cr" + "eating %s', var)\n_p('\\t-$(call MKDIR,%s)', var)\n_p('')\nend\nfunction make.list(value)\nif #value > 0 then\nreturn \" \" .. table.concat(value, \" \")\nelse\nreturn \"\"\nend\nend\nfunction _MAKE.getmakefilename(this, searchprjs)\nlocal count = 0\nfor sln in premake.solution.each() do\nif (sln.location == this.location) then count = count + 1 end\nif (searchprjs) then\nfor _,prj in ipairs(sln.projects) do\nif (prj.location == this.location) then count = count + 1 end\nend\nend\nend\nif (count == 1) then\nreturn \"Makefile\"\nelse\nreturn this.name .. \".make\"\nend\nend\nfunction _MAKE.getnames(tbl)\nlocal result = table.extract(tbl, \"name\")\nfor k,v in pairs(result) do\nresult[k] = _MAKE.esc(v)\nend\nreturn result\nend\nfunction make.settings(cfg, cc)\nif #cfg.makesettings > 0 then\nfor _, value in ipairs(cfg.makesettings) do\n_p(value)\nend\nend\nlocal toolsettings = cc.platforms[cfg.platform].cfgsettings\nif toolsettings then\n_p(toolsettings)\nend\nend\nnewaction {\ntrigger = \"gmake\",\nshort" + "name = \"GNU Make\",\ndescription = \"Generate GNU makefiles for POSIX, MinGW, and Cygwin\",\nvalid_kinds = { \"ConsoleApp\", \"WindowedApp\", \"StaticLib\", \"SharedLib\", \"Bundle\" },\nvalid_languages = { \"C\", \"C++\", \"C#\", \"Vala\", \"Swift\" },\nvalid_tools = {\ncc = { \"gcc\", \"ghs\" },\ndotnet = { \"mono\", \"msnet\", \"pnet\" },\nvalac = { \"valac\" },\nswift = { \"swift\" },\n},\nonsolution = function(sln)\npremake.generate(sln, _MAKE.getmakefilename(sln, false), premake.make_solution)\nend,\nonproject = function(prj)\nlocal makefile = _MAKE.getmakefilename(prj, true)\nif premake.isdotnetproject(prj) then\npremake.generate(prj, makefile, premake.make_csharp)\nelseif premake.iscppproject(prj) then\npremake.generate(prj, makefile, premake.make_cpp)\nelseif premake.isswiftproject(prj) then\npremake.generate(prj, makefile, premake.make_swift)\nelse\npremake.generate(prj, makefile, premake.make_vala)\nend\nend,\noncleansolution = function(sln)\npremake.clean.file(sln, _MAKE.ge" + "tmakefilename(sln, false))\nend,\noncleanproject = function(prj)\npremake.clean.file(prj, _MAKE.getmakefilename(prj, true))\nend,\ngmake = {}\n}\n", /* actions/make/make_solution.lua */ "function premake.make_solution(sln)\nlocal cc = premake[_OPTIONS.cc]\nlocal platforms = premake.filterplatforms(sln, cc.platforms, \"Native\")\n_p('# %s solution makefile autogenerated by GENie', premake.action.current().shortname)\n_p('# Type \"make help\" for usage help')\n_p('')\n_p('ifndef config')\n_p(' config=%s', _MAKE.esc(premake.getconfigname(sln.configurations[1], platforms[1], true)))\n_p('endif')\n_p('export config')\n_p('')\nlocal projects = table.extract(sln.projects, \"name\")\ntable.sort(projects)\n_p('PROJECTS := %s', table.concat(_MAKE.esc(projects), \" \"))\n_p('')\n_p('.PHONY: all clean help $(PROJECTS)')\n_p('')\n_p('all: $(PROJECTS)')\n_p('')\nfor _, prj in ipairs(sln.projects) do\n_p('%s: %s', _MAKE.esc(prj.name), table.concat(_MAKE.esc(table.extract(premake.getdependencies(prj), \"name\")), \" \"))\nif (not sln.messageskip) or (not table.contains(sln.messageskip, \"SkipBuildingMessage\")) then\n_p('\\t@echo \"==== Building %s ($(config)) ====\"', prj.name)\nend\n_p('\\t@${MAKE} --no-pr" @@ -233,110 +237,120 @@ const char* builtin_scripts[] = { "URCES) $(OBJRESP) $(LDRESP) | $(TARGETDIR) $(OBJDIRS)')\nif prj.kind == \"StaticLib\" then\nif prj.msgarchiving then\n_p('\\t@echo ' .. prj.msgarchiving)\nelse\n_p('\\t@echo Archiving %s', prj.name)\nend\nif (not prj.archivesplit_size) then\nprj.archivesplit_size=200\nend\nif (not prj.options.ArchiveSplit) then\n_p('ifeq (posix,$(SHELLTYPE))')\n_p('\\t$(SILENT) rm -f $(TARGET)')\n_p('else')\n_p('\\t$(SILENT) if exist $(subst /,\\\\\\\\,$(TARGET)) del $(subst /,\\\\\\\\,$(TARGET))')\n_p('endif')\n_p('\\t$(SILENT) $(LINKCMD) $(LINKOBJS)' .. (os.is(\"MacOSX\") and \" 2>&1 > /dev/null | sed -e '/.o) has no symbols$$/d'\" or \"\"))\nelse\n_p('\\t$(call RM,$(TARGET))')\n_p('\\t@$(call max_args,$(LINKCMD),'.. prj.archivesplit_size ..',$(LINKOBJS))' .. (os.is(\"MacOSX\") and \" 2>&1 > /dev/null | sed -e '/.o) has no symbols$$/d'\" or \"\"))\n_p('\\t$(SILENT) $(LINKCMD_NDX)')\nend\nelse\nif prj.msglinking then\n_p('\\t@echo ' .. prj.msglinking)\nelse\n_p('\\t@echo Linking %s', prj.name)\nend\n_p('\\t$(SILENT) $(LINKCM" "D)')\nend\n_p('\\t$(POSTBUILDCMDS)')\n_p('')\n_p('$(TARGETDIR):')\npremake.make_mkdirrule(\"$(TARGETDIR)\")\n_p('$(OBJDIRS):')\nif (not prj.solution.messageskip) or (not table.contains(prj.solution.messageskip, \"SkipCreatingMessage\")) then\n_p('\\t@echo Creating $(@)')\nend\n_p('\\t-$(call MKDIR,$@)')\n_p('')\nif os.is(\"MacOSX\") and prj.kind == \"WindowedApp\" and not prj.options.SkipBundling then\n_p('$(dir $(TARGETDIR))PkgInfo:')\n_p('$(dir $(TARGETDIR))Info.plist:')\n_p('')\nend\n_p('clean:')\nif (not prj.solution.messageskip) or (not table.contains(prj.solution.messageskip, \"SkipCleaningMessage\")) then\n_p('\\t@echo Cleaning %s', prj.name)\nend\n_p('ifeq (posix,$(SHELLTYPE))')\n_p('\\t$(SILENT) rm -f $(TARGET)')\n_p('\\t$(SILENT) rm -rf $(OBJDIR)')\n_p('else')\n_p('\\t$(SILENT) if exist $(subst /,\\\\\\\\,$(TARGET)) del $(subst /,\\\\\\\\,$(TARGET))')\n_p('\\t$(SILENT) if exist $(subst /,\\\\\\\\,$(OBJDIR)) rmdir /s /q $(subst /,\\\\\\\\,$(OBJDIR))')\n_p('endif')\n_p('')\n_p('prebuild:')\n_p('\\t$(P" "REBUILDCMDS)')\n_p('')\n_p('prelink:')\n_p('\\t$(PRELINKCMDS)')\n_p('')\ncpp.pchrules(prj)\ncpp.fileRules(prj, cc)\ncpp.dependencyRules(prj)\nfor _, custombuildtask in ipairs(prj.custombuildtask or {}) do\nfor _, buildtask in ipairs(custombuildtask or {}) do\nlocal deps = string.format(\"%s \",path.getrelative(prj.location,buildtask[1]))\nfor _, depdata in ipairs(buildtask[3] or {}) do\ndeps = deps .. string.format(\"%s \",path.getrelative(prj.location,depdata))\nend\n_p('%s: %s | $(TARGETDIR) $(OBJDIRS)'\n,path.getrelative(prj.location,buildtask[2])\n, deps\n)\nfor _, cmdline in ipairs(buildtask[4] or {}) do\nlocal cmd = cmdline\nlocal num = 1\nfor _, depdata in ipairs(buildtask[3] or {}) do\ncmd = string.gsub(cmd,\"%$%(\" .. num ..\"%)\", string.format(\"%s \",path.getrelative(prj.location,depdata)))\nnum = num + 1\nend\ncmd = string.gsub(cmd, \"%$%(<%)\", \"$<\")\ncmd = string.gsub(cmd, \"%$%(@%)\", \"$@\")\n_p('\\t$(SILENT) %s',cmd)\nend\n_p('')\nend\nend\n_p('-include $(OBJECTS:%%.o=%%.d)')\n_p('ifneq (," - "$(PCH))')\n_p(' -include $(OBJDIR)/$(notdir $(PCH)).d')\n_p(' -include $(OBJDIR)/$(notdir $(PCH))_objc.d')\n_p('endif')\nend\nfunction premake.gmake_cpp_header(prj, cc, platforms)\n_p('# %s project makefile autogenerated by GENie', premake.action.current().shortname)\n_p('ifndef config')\n_p(' config=%s', _MAKE.esc(premake.getconfigname(prj.solution.configurations[1], platforms[1], true)))\n_p('endif')\n_p('')\n_p('ifndef verbose')\n_p(' SILENT = @')\n_p('endif')\n_p('')\n_p('SHELLTYPE := msdos')\n_p('ifeq (,$(ComSpec)$(COMSPEC))')\n_p(' SHELLTYPE := posix')\n_p('endif')\n_p('ifeq (/bin,$(findstring /bin,$(SHELL)))')\n_p(' SHELLTYPE := posix')\n_p('endif')\n_p('ifeq (/bin,$(findstring /bin,$(MAKESHELL)))')\n_p(' SHELLTYPE := posix')\n_p('endif')\n_p('')\n_p('ifeq (posix,$(SHELLTYPE))')\n_p(' MKDIR = $(SILENT) mkdir -p \"$(1)\"')\n_p(' COPY = $(SILENT) cp -fR \"$(1)\" \"$(2)\"')\n_p(' RM = $(SILENT) rm -f \"$(1)\"')\n_p('else')\n_p(' MKDIR = $(SILENT) mkdir \"$(subst /,\\\\\\\\,$(1))\" 2> nul || " - "exit 0')\n_p(' COPY = $(SILENT) copy /Y \"$(subst /,\\\\\\\\,$(1))\" \"$(subst /,\\\\\\\\,$(2))\"')\n_p(' RM = $(SILENT) del /F \"$(subst /,\\\\\\\\,$(1))\" 2> nul || exit 0')\n_p('endif')\n_p('')\n_p('CC = %s', cc.cc)\n_p('CXX = %s', cc.cxx)\n_p('AR = %s', cc.ar)\n_p('')\n_p('ifndef RESCOMP')\n_p(' ifdef WINDRES')\n_p(' RESCOMP = $(WINDRES)')\n_p(' else')\n_p(' RESCOMP = %s', cc.rc or 'windres')\n_p(' endif')\n_p('endif')\n_p('')\nif (not premake.make.makefile_ignore) then\n_p('MAKEFILE = %s', _MAKE.getmakefilename(prj, true))\n_p('')\nend\nend\nlocal function is_excluded(prj, cfg, file)\nif table.icontains(prj.excludes, file) then\nreturn true\nend\nif table.icontains(cfg.excludes, file) then\nreturn true\nend\nreturn false\nend\nfunction premake.gmake_cpp_configs(prj, cc, platforms)\nfor _, platform in ipairs(platforms) do\nfor cfg in premake.eachconfig(prj, platform) do\npremake.gmake_cpp_config(prj, cfg, cc)\nend\nend\nend\nfunction premake.gmake_cpp_config(prj, cfg, cc)\n_p('ifeq ($(conf" - "ig),%s)', _MAKE.esc(cfg.shortname))\ncpp.platformtools(cfg, cc)\nlocal targetDir = _MAKE.esc(cfg.buildtarget.directory)\n_p(' ' .. (table.contains(premake.make.override,\"OBJDIR\") and \"override \" or \"\") .. 'OBJDIR = %s', _MAKE.esc(cfg.objectsdir))\n_p(' ' .. (table.contains(premake.make.override,\"TARGETDIR\") and \"override \" or \"\") .. 'TARGETDIR = %s', iif(targetDir == \"\", \".\", targetDir))\n_p(' ' .. (table.contains(premake.make.override,\"TARGET\") and \"override \" or \"\") .. 'TARGET = $(TARGETDIR)/%s', _MAKE.esc(cfg.buildtarget.name))\n_p(' DEFINES +=%s', make.list(_MAKE.escquote(cc.getdefines(cfg.defines))))\nlocal id = make.list(cc.getincludedirs(cfg.includedirs));\nlocal uid = make.list(cc.getquoteincludedirs(cfg.userincludedirs))\nlocal sid = make.list(cc.getsystemincludedirs(cfg.systemincludedirs))\nif id ~= \"\" then\n_p(' INCLUDES +=%s', id)\nend\nif uid ~= \"\" then\n_p(' INCLUDES +=%s', uid)\nend\nif sid " - "~= \"\" then\n_p(' INCLUDES +=%s', sid)\nend\ncpp.pchconfig(cfg)\ncpp.flags(cfg, cc)\ncpp.linker(prj, cfg, cc)\ntable.sort(cfg.files)\nif cfg.flags.UseObjectResponseFile then\n_p(' OBJRESP = $(OBJDIR)/%s_objects', prj.name)\nelse\n_p(' OBJRESP =')\nend\n_p(' OBJECTS := \\\\')\nfor _, file in ipairs(cfg.files) do\nif path.issourcefile(file) then\nif not is_excluded(prj, cfg, file) then\n_p('\\t$(OBJDIR)/%s.o \\\\'\n, _MAKE.esc(path.trimdots(path.removeext(file)))\n)\nend\nend\nend\n_p('')\n_p(' define PREBUILDCMDS')\nif #cfg.prebuildcommands > 0 then\n_p('\\t@echo Running pre-build commands')\n_p('\\t%s', table.implode(cfg.prebuildcommands, \"\", \"\", \"\\n\\t\"))\nend\n_p(' endef')\n_p(' define PRELINKCMDS')\nif #cfg.prelinkcommands > 0 then\n_p('\\t@echo Running pre-link commands')\n_p('\\t%s', table.implode(cfg.prelinkcommands, \"\", \"\", \"\\n\\t\"))\nend\n_p(' endef')\n_p(' define POSTBUILDCMDS')\nif #cfg.postbuildcommands > 0 then\n_p('\\t@echo Running post-bui" - "ld commands')\n_p('\\t%s', table.implode(cfg.postbuildcommands, \"\", \"\", \"\\n\\t\"))\nend\n_p(' endef')\nmake.settings(cfg, cc)\n_p('endif')\n_p('')\nend\nfunction cpp.platformtools(cfg, cc)\nlocal platform = cc.platforms[cfg.platform]\nif platform.cc then\n_p(' CC = %s', platform.cc)\nend\nif platform.cxx then\n_p(' CXX = %s', platform.cxx)\nend\nif platform.ar then\n_p(' AR = %s', platform.ar)\nend\nend\nfunction cpp.flags(cfg, cc)\nif cfg.pchheader and not cfg.flags.NoPCH then\n_p(' FORCE_INCLUDE += -include $(OBJDIR)/$(notdir $(PCH))')\n_p(' FORCE_INCLUDE_OBJC += -include $(OBJDIR)/$(notdir $(PCH))_objc')\nend\nif #cfg.forcedincludes > 0 then\n_p(' FORCE_INCLUDE += -include %s'\n,_MAKE.esc(table.concat(cfg.forcedincludes, \";\")))\nend\n_p(' ALL_CPPFLAGS += $(CPPFLAGS) %s $(DEFINES) $(INCLUDES)', table.concat(cc.getcppflags(cfg), \" \"))\n_p(' ALL_ASMFLAGS += $(ASMFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH)%s', make.list(table.join(cc.getcflags(cfg), c" - "fg.buildoptions, cfg.buildoptions_asm)))\n_p(' ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH)%s', make.list(table.join(cc.getcflags(cfg), cfg.buildoptions, cfg.buildoptions_c)))\n_p(' ALL_CXXFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH)%s', make.list(table.join(cc.getcflags(cfg), cc.getcxxflags(cfg), cfg.buildoptions, cfg.buildoptions_cpp)))\n_p(' ALL_OBJCFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH)%s', make.list(table.join(cc.getcflags(cfg), cc.getobjcflags(cfg), cfg.buildoptions, cfg.buildoptions_objc)))\n_p(' ALL_OBJCPPFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH)%s', make.list(table.join(cc.getcflags(cfg), cc.getcxxflags(cfg), cc.getobjcflags(cfg), cfg.buildoptions, cfg.buildoptions_objcpp)))\n_p(' ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES)%s',\n make.list(table.join(cc.getdefines(cfg.resdefines),\n cc.getincludedirs(cfg.resincludedirs), cfg.resoptions)))\nend\nfunction cpp.linker(prj, cfg, cc)\nlocal libdeps\nl" - "ocal lddeps\nif #cfg.wholearchive > 0 then\nlibdeps = {}\nlddeps = {}\nfor _, linkcfg in ipairs(premake.getlinks(cfg, \"siblings\", \"object\")) do\nlocal linkpath = path.rebase(linkcfg.linktarget.fullpath, linkcfg.location, cfg.location)\nif table.icontains(cfg.wholearchive, linkcfg.project.name) then\nlddeps = table.join(lddeps, cc.wholearchive(linkpath))\nelse\ntable.insert(lddeps, linkpath)\nend\ntable.insert(libdeps, linkpath)\nend\nlibdeps = make.list(_MAKE.esc(libdeps))\nlddeps = make.list(_MAKE.esc(lddeps))\nelse\nlibdeps = make.list(_MAKE.esc(premake.getlinks(cfg, \"siblings\", \"fullpath\")))\nlddeps = libdeps\nend\n_p(' ALL_LDFLAGS += $(LDFLAGS)%s', make.list(table.join(cc.getlibdirflags(cfg), cc.getldflags(cfg), cfg.linkoptions)))\n_p(' LIBDEPS +=%s', libdeps)\n_p(' LDDEPS +=%s', lddeps)\nif cfg.flags.UseLDResponseFile then\n_p(' LDRESP = $(OBJDIR)/%s_libs', prj.name)\n_p(' LIBS += @$(LDRESP)%s', make.list(cc.getlinkflags(cfg)))\nelse" - "\n_p(' LDRESP =')\n_p(' LIBS += $(LDDEPS)%s', make.list(cc.getlinkflags(cfg)))\nend\n_p(' EXTERNAL_LIBS +=%s', make.list(cc.getlibfiles(cfg)))\n_p(' LINKOBJS = %s', (cfg.flags.UseObjectResponseFile and \"@$(OBJRESP)\" or \"$(OBJECTS)\"))\nif cfg.kind == \"StaticLib\" then\nif (not prj.options.ArchiveSplit) then\n_p(' LINKCMD = $(AR) %s $(TARGET)', make.list(cc.getarchiveflags(prj, cfg, false)))\nelse\n_p(' LINKCMD = $(AR) %s $(TARGET)', make.list(cc.getarchiveflags(prj, cfg, false)))\n_p(' LINKCMD_NDX = $(AR) %s $(TARGET)', make.list(cc.getarchiveflags(prj, cfg, true)))\nend\nelse\nlocal tool = iif(cfg.language == \"C\", \"CC\", \"CXX\")\nlocal startgroup = ''\nlocal endgroup = ''\nif (cfg.flags.LinkSupportCircularDependencies) then\nstartgroup = '-Wl,--start-group '\nendgroup = ' -Wl,--end-group'\nend\n_p(' LINKCMD = $(%s) -o $(TARGET) $(LINKOBJS) $(RESOURCES) $(ARCH) $(ALL_LDFLAGS) %s$(LIBS)%s', tool, startgroup," - " endgroup)\nend\nend\nfunction cpp.pchconfig(cfg)\nif not cfg.pchheader or cfg.flags.NoPCH then\nreturn\nend\nlocal pch = cfg.pchheader\nfor _, incdir in ipairs(cfg.includedirs) do\nlocal abspath = path.getabsolute(path.join(cfg.project.location, incdir))\nlocal testname = path.join(abspath, pch)\nif os.isfile(testname) then\npch = path.getrelative(cfg.location, testname)\nbreak\nend\nend\n_p(' PCH = %s', _MAKE.esc(pch))\n_p(' GCH = $(OBJDIR)/$(notdir $(PCH)).gch')\n_p(' GCH_OBJC = $(OBJDIR)/$(notdir $(PCH))_objc.gch')\nend\nfunction cpp.pchrules(prj)\n_p('ifneq (,$(PCH))')\n_p('$(GCH): $(PCH) $(MAKEFILE) | $(OBJDIR)')\nif prj.msgprecompile then\n_p('\\t@echo ' .. prj.msgprecompile)\nelse\n_p('\\t@echo $(notdir $<)')\nend\nlocal cmd = iif(prj.language == \"C\", \"$(CC) $(ALL_CFLAGS) -x c-header\", \"$(CXX) $(ALL_CXXFLAGS) -x c++-header\")\n_p('\\t$(SILENT) %s $(DEFINES) $(INCLUDES) -o \"$@\" -c \"$<\"', cmd)\n_p('')\n_p('$(GCH_OBJC): $(PCH) $(MAKEFILE) | $(OBJDIR)'" - ")\nif prj.msgprecompile then\n_p('\\t@echo ' .. prj.msgprecompile)\nelse\n_p('\\t@echo $(notdir $<)')\nend\nlocal cmd = iif(prj.language == \"C\", \"$(CC) $(ALL_OBJCFLAGS) -x objective-c-header\", \"$(CXX) $(ALL_OBJCPPFLAGS) -x objective-c++-header\")\n_p('\\t$(SILENT) %s $(DEFINES) $(INCLUDES) -o \"$@\" -c \"$<\"', cmd)\n_p('endif')\n_p('')\nend\nfunction cpp.fileRules(prj, cc)\nlocal platforms = premake.filterplatforms(prj.solution, cc.platforms, \"Native\")\n_p('ifneq (,$(OBJRESP))')\n_p('$(OBJRESP): $(OBJECTS) | $(TARGETDIR) $(OBJDIRS)')\n_p('\\t$(SILENT) echo $^')\n_p('\\t$(SILENT) echo $^ > $@')\n_p('endif')\n_p('')\n_p('ifneq (,$(LDRESP))')\n_p('$(LDRESP): $(LDDEPS) | $(TARGETDIR) $(OBJDIRS)')\n_p('\\t$(SILENT) echo $^')\n_p('\\t$(SILENT) echo $^ > $@')\n_p('endif')\n_p('')\ntable.sort(prj.allfiles)\nfor _, file in ipairs(prj.allfiles or {}) do\nif path.issourcefile(file) then\nif (path.isobjcfile(file)) then\n_p('$(OBJDIR)/%s.o: %s $(GCH_OBJC) $(MAKEFILE) | $(OBJDIR)/%s'\n, _MAKE.esc(path.trimdots(path" - ".removeext(file)))\n, _MAKE.esc(file)\n, _MAKE.esc(path.getdirectory(path.trimdots(file)))\n)\nelse\n_p('$(OBJDIR)/%s.o: %s $(GCH) $(MAKEFILE) | $(OBJDIR)/%s'\n, _MAKE.esc(path.trimdots(path.removeext(file)))\n, _MAKE.esc(file)\n, _MAKE.esc(path.getdirectory(path.trimdots(file)))\n)\nend\nif (path.isobjcfile(file) and prj.msgcompile_objc) then\n_p('\\t@echo ' .. prj.msgcompile_objc)\nelseif prj.msgcompile then\n_p('\\t@echo ' .. prj.msgcompile)\nelse\n_p('\\t@echo $(notdir $<)')\nend\nif (path.isobjcfile(file)) then\nif (path.iscfile(file)) then\n_p('\\t$(SILENT) $(CXX) $(ALL_OBJCFLAGS) $(FORCE_INCLUDE_OBJC) -o \"$@\" -c \"$<\"')\nelse\n_p('\\t$(SILENT) $(CXX) $(ALL_OBJCPPFLAGS) $(FORCE_INCLUDE_OBJC) -o \"$@\" -c \"$<\"')\nend\nelseif (path.isasmfile(file)) then\n_p('\\t$(SILENT) $(CC) $(ALL_ASMFLAGS) -o \"$@\" -c \"$<\"')\nelse\ncpp.buildcommand(path.iscfile(file) and not prj.options.ForceCPP, \"o\")\nend\nfor _, task in ipairs(prj.postcompiletasks or {}) do\n_p('\\t$(SILENT) %s', task)\n_p('')\nend\n_p('')\n" - "elseif (path.getextension(file) == \".rc\") then\n_p('$(OBJDIR)/%s.res: %s', _MAKE.esc(path.getbasename(file)), _MAKE.esc(file))\nif prj.msgresource then\n_p('\\t@echo ' .. prj.msgresource)\nelse\n_p('\\t@echo $(notdir $<)')\nend\n_p('\\t$(SILENT) $(RESCOMP) $< -O coff -o \"$@\" $(ALL_RESFLAGS)')\n_p('')\nend\nend\nend\nfunction cpp.dependencyRules(prj)\nfor _, dependency in ipairs(prj.dependency or {}) do\nfor _, dep in ipairs(dependency or {}) do\nif (dep[3]==nil or dep[3]==false) then\n_p('$(OBJDIR)/%s.o: %s'\n, _MAKE.esc(path.trimdots(path.removeext(path.getrelative(prj.location, dep[1]))))\n, _MAKE.esc(path.getrelative(prj.location, dep[2]))\n)\nelse\n_p('%s: %s'\n, _MAKE.esc(dep[1])\n, _MAKE.esc(path.getrelative(prj.location, dep[2]))\n)\nend\n_p('')\nend\nend\nend\nfunction cpp.buildcommand(iscfile, objext)\nlocal flags = iif(iscfile, '$(CC) $(ALL_CFLAGS)', '$(CXX) $(ALL_CXXFLAGS)')\n_p('\\t$(SILENT) %s $(FORCE_INCLUDE) -o \"$@\" -c \"$<\"', flags, objext)\nend\n", + "$(PCH))')\n_p(' -include $(OBJDIR)/$(notdir $(PCH)).d')\n_p(' -include $(OBJDIR)/$(notdir $(PCH))_objc.d')\n_p('endif')\nend\nfunction premake.gmake_cpp_header(prj, cc, platforms)\n_p('# %s project makefile autogenerated by GENie', premake.action.current().shortname)\n_p('')\n_p('.SUFFIXES:') -- Delete the default suffix rules.\n_p('')\n_p('ifndef config')\n_p(' config=%s', _MAKE.esc(premake.getconfigname(prj.solution.configurations[1], platforms[1], true)))\n_p('endif')\n_p('')\n_p('ifndef verbose')\n_p(' SILENT = @')\n_p('endif')\n_p('')\n_p('SHELLTYPE := msdos')\n_p('ifeq (,$(ComSpec)$(COMSPEC))')\n_p(' SHELLTYPE := posix')\n_p('endif')\n_p('ifeq (/bin,$(findstring /bin,$(SHELL)))')\n_p(' SHELLTYPE := posix')\n_p('endif')\n_p('ifeq (/bin,$(findstring /bin,$(MAKESHELL)))')\n_p(' SHELLTYPE := posix')\n_p('endif')\n_p('')\n_p('ifeq (posix,$(SHELLTYPE))')\n_p(' MKDIR = $(SILENT) mkdir -p \"$(1)\"')\n_p(' COPY = $(SILENT) cp -fR \"$(1)\" \"$(2)\"')\n_p(' RM = $(SILENT) rm -f \"$(1)\"')\n_p('else')" + "\n_p(' MKDIR = $(SILENT) mkdir \"$(subst /,\\\\\\\\,$(1))\" 2> nul || exit 0')\n_p(' COPY = $(SILENT) copy /Y \"$(subst /,\\\\\\\\,$(1))\" \"$(subst /,\\\\\\\\,$(2))\"')\n_p(' RM = $(SILENT) del /F \"$(subst /,\\\\\\\\,$(1))\" 2> nul || exit 0')\n_p('endif')\n_p('')\n_p('CC = %s', cc.cc)\n_p('CXX = %s', cc.cxx)\n_p('AR = %s', cc.ar)\n_p('')\n_p('ifndef RESCOMP')\n_p(' ifdef WINDRES')\n_p(' RESCOMP = $(WINDRES)')\n_p(' else')\n_p(' RESCOMP = %s', cc.rc or 'windres')\n_p(' endif')\n_p('endif')\n_p('')\nif (not premake.make.makefile_ignore) then\n_p('MAKEFILE = %s', _MAKE.getmakefilename(prj, true))\n_p('')\nend\nend\nlocal function is_excluded(prj, cfg, file)\nif table.icontains(prj.excludes, file) then\nreturn true\nend\nif table.icontains(cfg.excludes, file) then\nreturn true\nend\nreturn false\nend\nfunction premake.gmake_cpp_configs(prj, cc, platforms)\nfor _, platform in ipairs(platforms) do\nfor cfg in premake.eachconfig(prj, platform) do\npremake.gmake_cpp_config(prj, cfg, cc)\nend\nend" + "\nend\nfunction premake.gmake_cpp_config(prj, cfg, cc)\n_p('ifeq ($(config),%s)', _MAKE.esc(cfg.shortname))\ncpp.platformtools(cfg, cc)\nlocal targetDir = _MAKE.esc(cfg.buildtarget.directory)\n_p(' ' .. (table.contains(premake.make.override,\"OBJDIR\") and \"override \" or \"\") .. 'OBJDIR = %s', _MAKE.esc(cfg.objectsdir))\n_p(' ' .. (table.contains(premake.make.override,\"TARGETDIR\") and \"override \" or \"\") .. 'TARGETDIR = %s', iif(targetDir == \"\", \".\", targetDir))\n_p(' ' .. (table.contains(premake.make.override,\"TARGET\") and \"override \" or \"\") .. 'TARGET = $(TARGETDIR)/%s', _MAKE.esc(cfg.buildtarget.name))\n_p(' DEFINES +=%s', make.list(_MAKE.escquote(cc.getdefines(cfg.defines))))\nlocal id = make.list(cc.getincludedirs(cfg.includedirs));\nlocal uid = make.list(cc.getquoteincludedirs(cfg.userincludedirs))\nlocal sid = make.list(cc.getsystemincludedirs(cfg.systemincludedirs))\nif id ~= \"\" then\n_p(' INCLUDES +=%s', id)\nend" + "\nif uid ~= \"\" then\n_p(' INCLUDES +=%s', uid)\nend\nif sid ~= \"\" then\n_p(' INCLUDES +=%s', sid)\nend\ncpp.pchconfig(cfg)\ncpp.flags(cfg, cc)\ncpp.linker(prj, cfg, cc)\ntable.sort(cfg.files)\nif cfg.flags.UseObjectResponseFile then\n_p(' OBJRESP = $(OBJDIR)/%s_objects', prj.name)\nelse\n_p(' OBJRESP =')\nend\n_p(' OBJECTS := \\\\')\nfor _, file in ipairs(cfg.files) do\nif path.issourcefile(file) then\nif not is_excluded(prj, cfg, file) then\n_p('\\t$(OBJDIR)/%s.o \\\\'\n, _MAKE.esc(path.trimdots(path.removeext(file)))\n)\nend\nend\nend\n_p('')\n_p(' define PREBUILDCMDS')\nif #cfg.prebuildcommands > 0 then\n_p('\\t@echo Running pre-build commands')\n_p('\\t%s', table.implode(cfg.prebuildcommands, \"\", \"\", \"\\n\\t\"))\nend\n_p(' endef')\n_p(' define PRELINKCMDS')\nif #cfg.prelinkcommands > 0 then\n_p('\\t@echo Running pre-link commands')\n_p('\\t%s', table.implode(cfg.prelinkcommands, \"\", \"\", \"\\n\\t\"))\nend\n_p(' endef')\n_p(' define POSTBUILD" + "CMDS')\nif #cfg.postbuildcommands > 0 then\n_p('\\t@echo Running post-build commands')\n_p('\\t%s', table.implode(cfg.postbuildcommands, \"\", \"\", \"\\n\\t\"))\nend\n_p(' endef')\nmake.settings(cfg, cc)\n_p('endif')\n_p('')\nend\nfunction cpp.platformtools(cfg, cc)\nlocal platform = cc.platforms[cfg.platform]\nif platform.cc then\n_p(' CC = %s', platform.cc)\nend\nif platform.cxx then\n_p(' CXX = %s', platform.cxx)\nend\nif platform.ar then\n_p(' AR = %s', platform.ar)\nend\nend\nfunction cpp.flags(cfg, cc)\nif cfg.pchheader and not cfg.flags.NoPCH then\n_p(' FORCE_INCLUDE += -include $(OBJDIR)/$(notdir $(PCH))')\n_p(' FORCE_INCLUDE_OBJC += -include $(OBJDIR)/$(notdir $(PCH))_objc')\nend\nif #cfg.forcedincludes > 0 then\n_p(' FORCE_INCLUDE += -include %s'\n,_MAKE.esc(table.concat(cfg.forcedincludes, \";\")))\nend\n_p(' ALL_CPPFLAGS += $(CPPFLAGS) %s $(DEFINES) $(INCLUDES)', table.concat(cc.getcppflags(cfg), \" \"))\n_p(' ALL_ASMFLAGS += $(ASMFLAGS) $(CFLA" + "GS) $(ALL_CPPFLAGS) $(ARCH)%s', make.list(table.join(cc.getcflags(cfg), cfg.buildoptions, cfg.buildoptions_asm)))\n_p(' ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH)%s', make.list(table.join(cc.getcflags(cfg), cfg.buildoptions, cfg.buildoptions_c)))\n_p(' ALL_CXXFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH)%s', make.list(table.join(cc.getcflags(cfg), cc.getcxxflags(cfg), cfg.buildoptions, cfg.buildoptions_cpp)))\n_p(' ALL_OBJCFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH)%s', make.list(table.join(cc.getcflags(cfg), cc.getobjcflags(cfg), cfg.buildoptions, cfg.buildoptions_objc)))\n_p(' ALL_OBJCPPFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH)%s', make.list(table.join(cc.getcflags(cfg), cc.getcxxflags(cfg), cc.getobjcflags(cfg), cfg.buildoptions, cfg.buildoptions_objcpp)))\n_p(' ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES)%s',\n make.list(table.join(cc.getdefines(cfg.resdefines),\n cc.getincludedirs(cfg.resincludedirs), cf" + "g.resoptions)))\nend\nfunction cpp.linker(prj, cfg, cc)\nlocal libdeps\nlocal lddeps\nif #cfg.wholearchive > 0 then\nlibdeps = {}\nlddeps = {}\nfor _, linkcfg in ipairs(premake.getlinks(cfg, \"siblings\", \"object\")) do\nlocal linkpath = path.rebase(linkcfg.linktarget.fullpath, linkcfg.location, cfg.location)\nif table.icontains(cfg.wholearchive, linkcfg.project.name) then\nlddeps = table.join(lddeps, cc.wholearchive(linkpath))\nelse\ntable.insert(lddeps, linkpath)\nend\ntable.insert(libdeps, linkpath)\nend\nlibdeps = make.list(_MAKE.esc(libdeps))\nlddeps = make.list(_MAKE.esc(lddeps))\nelse\nlibdeps = make.list(_MAKE.esc(premake.getlinks(cfg, \"siblings\", \"fullpath\")))\nlddeps = libdeps\nend\n_p(' ALL_LDFLAGS += $(LDFLAGS)%s', make.list(table.join(cc.getlibdirflags(cfg), cc.getldflags(cfg), cfg.linkoptions)))\n_p(' LIBDEPS +=%s', libdeps)\n_p(' LDDEPS +=%s', lddeps)\nif cfg.flags.UseLDResponseFile then\n_p(' LDRESP = $(OBJDIR)/%s_libs', prj.name)\n_p(' LI" + "BS += @$(LDRESP)%s', make.list(cc.getlinkflags(cfg)))\nelse\n_p(' LDRESP =')\n_p(' LIBS += $(LDDEPS)%s', make.list(cc.getlinkflags(cfg)))\nend\n_p(' EXTERNAL_LIBS +=%s', make.list(cc.getlibfiles(cfg)))\n_p(' LINKOBJS = %s', (cfg.flags.UseObjectResponseFile and \"@$(OBJRESP)\" or \"$(OBJECTS)\"))\nif cfg.kind == \"StaticLib\" then\nif (not prj.options.ArchiveSplit) then\n_p(' LINKCMD = $(AR) %s $(TARGET)', make.list(cc.getarchiveflags(prj, cfg, false)))\nelse\n_p(' LINKCMD = $(AR) %s $(TARGET)', make.list(cc.getarchiveflags(prj, cfg, false)))\n_p(' LINKCMD_NDX = $(AR) %s $(TARGET)', make.list(cc.getarchiveflags(prj, cfg, true)))\nend\nelse\nlocal tool = iif(cfg.language == \"C\", \"CC\", \"CXX\")\nlocal startgroup = ''\nlocal endgroup = ''\nif (cfg.flags.LinkSupportCircularDependencies) then\nstartgroup = '-Wl,--start-group '\nendgroup = ' -Wl,--end-group'\nend\n_p(' LINKCMD = $(%s) -o $(TARGET) $(LINK" + "OBJS) $(RESOURCES) $(ARCH) $(ALL_LDFLAGS) %s$(LIBS)%s', tool, startgroup, endgroup)\nend\nend\nfunction cpp.pchconfig(cfg)\nif not cfg.pchheader or cfg.flags.NoPCH then\nreturn\nend\nlocal pch = cfg.pchheader\nfor _, incdir in ipairs(cfg.includedirs) do\nlocal abspath = path.getabsolute(path.join(cfg.project.location, incdir))\nlocal testname = path.join(abspath, pch)\nif os.isfile(testname) then\npch = path.getrelative(cfg.location, testname)\nbreak\nend\nend\n_p(' PCH = %s', _MAKE.esc(pch))\n_p(' GCH = $(OBJDIR)/$(notdir $(PCH)).gch')\n_p(' GCH_OBJC = $(OBJDIR)/$(notdir $(PCH))_objc.gch')\nend\nfunction cpp.pchrules(prj)\n_p('ifneq (,$(PCH))')\n_p('$(GCH): $(PCH) $(MAKEFILE) | $(OBJDIR)')\nif prj.msgprecompile then\n_p('\\t@echo ' .. prj.msgprecompile)\nelse\n_p('\\t@echo $(notdir $<)')\nend\nlocal cmd = iif(prj.language == \"C\", \"$(CC) $(ALL_CFLAGS) -x c-header\", \"$(CXX) $(ALL_CXXFLAGS) -x c++-header\")\n_p('\\t$(SILENT) %s $(DEFINES) $(INCLUDES) -o \"$@\" -" + "c \"$<\"', cmd)\n_p('')\n_p('$(GCH_OBJC): $(PCH) $(MAKEFILE) | $(OBJDIR)')\nif prj.msgprecompile then\n_p('\\t@echo ' .. prj.msgprecompile)\nelse\n_p('\\t@echo $(notdir $<)')\nend\nlocal cmd = iif(prj.language == \"C\", \"$(CC) $(ALL_OBJCFLAGS) -x objective-c-header\", \"$(CXX) $(ALL_OBJCPPFLAGS) -x objective-c++-header\")\n_p('\\t$(SILENT) %s $(DEFINES) $(INCLUDES) -o \"$@\" -c \"$<\"', cmd)\n_p('endif')\n_p('')\nend\nfunction cpp.fileRules(prj, cc)\nlocal platforms = premake.filterplatforms(prj.solution, cc.platforms, \"Native\")\n_p('ifneq (,$(OBJRESP))')\n_p('$(OBJRESP): $(OBJECTS) | $(TARGETDIR) $(OBJDIRS)')\n_p('\\t$(SILENT) echo $^')\n_p('\\t$(SILENT) echo $^ > $@')\n_p('endif')\n_p('')\n_p('ifneq (,$(LDRESP))')\n_p('$(LDRESP): $(LDDEPS) | $(TARGETDIR) $(OBJDIRS)')\n_p('\\t$(SILENT) echo $^')\n_p('\\t$(SILENT) echo $^ > $@')\n_p('endif')\n_p('')\ntable.sort(prj.allfiles)\nfor _, file in ipairs(prj.allfiles or {}) do\nif path.issourcefile(file) then\nif (path.isobjcfile(file)) then\n_p('$(OBJDIR)/%s.o: %" + "s $(GCH_OBJC) $(MAKEFILE) | $(OBJDIR)/%s'\n, _MAKE.esc(path.trimdots(path.removeext(file)))\n, _MAKE.esc(file)\n, _MAKE.esc(path.getdirectory(path.trimdots(file)))\n)\nelse\n_p('$(OBJDIR)/%s.o: %s $(GCH) $(MAKEFILE) | $(OBJDIR)/%s'\n, _MAKE.esc(path.trimdots(path.removeext(file)))\n, _MAKE.esc(file)\n, _MAKE.esc(path.getdirectory(path.trimdots(file)))\n)\nend\nif (path.isobjcfile(file) and prj.msgcompile_objc) then\n_p('\\t@echo ' .. prj.msgcompile_objc)\nelseif prj.msgcompile then\n_p('\\t@echo ' .. prj.msgcompile)\nelse\n_p('\\t@echo $(notdir $<)')\nend\nif (path.isobjcfile(file)) then\nif (path.iscfile(file)) then\n_p('\\t$(SILENT) $(CXX) $(ALL_OBJCFLAGS) $(FORCE_INCLUDE_OBJC) -o \"$@\" -c \"$<\"')\nelse\n_p('\\t$(SILENT) $(CXX) $(ALL_OBJCPPFLAGS) $(FORCE_INCLUDE_OBJC) -o \"$@\" -c \"$<\"')\nend\nelseif (path.isasmfile(file)) then\n_p('\\t$(SILENT) $(CC) $(ALL_ASMFLAGS) -o \"$@\" -c \"$<\"')\nelse\ncpp.buildcommand(path.iscfile(file) and not prj.options.ForceCPP, \"o\")\nend\nfor _, task in ipairs(prj.postc" + "ompiletasks or {}) do\n_p('\\t$(SILENT) %s', task)\n_p('')\nend\n_p('')\nelseif (path.getextension(file) == \".rc\") then\n_p('$(OBJDIR)/%s.res: %s', _MAKE.esc(path.getbasename(file)), _MAKE.esc(file))\nif prj.msgresource then\n_p('\\t@echo ' .. prj.msgresource)\nelse\n_p('\\t@echo $(notdir $<)')\nend\n_p('\\t$(SILENT) $(RESCOMP) $< -O coff -o \"$@\" $(ALL_RESFLAGS)')\n_p('')\nend\nend\nend\nfunction cpp.dependencyRules(prj)\nfor _, dependency in ipairs(prj.dependency or {}) do\nfor _, dep in ipairs(dependency or {}) do\nif (dep[3]==nil or dep[3]==false) then\n_p('$(OBJDIR)/%s.o: %s'\n, _MAKE.esc(path.trimdots(path.removeext(path.getrelative(prj.location, dep[1]))))\n, _MAKE.esc(path.getrelative(prj.location, dep[2]))\n)\nelse\n_p('%s: %s'\n, _MAKE.esc(dep[1])\n, _MAKE.esc(path.getrelative(prj.location, dep[2]))\n)\nend\n_p('')\nend\nend\nend\nfunction cpp.buildcommand(iscfile, objext)\nlocal flags = iif(iscfile, '$(CC) $(ALL_CFLAGS)', '$(CXX) $(ALL_CXXFLAGS)')\n_p('\\t$(SILENT) %s $(FORCE_INCLUDE) -o \"$@\" -" + "c \"$<\"', flags, objext)\nend\n", /* actions/make/make_csharp.lua */ "local function getresourcefilename(cfg, fname)\nif path.getextension(fname) == \".resx\" then\nlocal name = cfg.buildtarget.basename .. \".\"\nlocal dir = path.getdirectory(fname)\nif dir ~= \".\" then\nname = name .. path.translate(dir, \".\") .. \".\"\nend\nreturn \"$(OBJDIR)/\" .. _MAKE.esc(name .. path.getbasename(fname)) .. \".resources\"\nelse\nreturn fname\nend\nend\nfunction premake.make_csharp(prj)\nlocal csc = premake.dotnet\nlocal cfglibs = { }\nlocal cfgpairs = { }\nlocal anycfg\nfor cfg in premake.eachconfig(prj) do\nanycfg = cfg\ncfglibs[cfg] = premake.getlinks(cfg, \"siblings\", \"fullpath\")\ncfgpairs[cfg] = { }\nfor _, fname in ipairs(cfglibs[cfg]) do\nif path.getdirectory(fname) ~= cfg.buildtarget.directory then\ncfgpairs[cfg][\"$(TARGETDIR)/\" .. _MAKE.esc(path.getname(fname))] = _MAKE.esc(fname)\nend\nend\nend\nlocal sources = {}\nlocal embedded = { }\nlocal copypairs = { }\nfor fcfg in premake.project.eachfile(prj) do\nlocal action = csc.getbuildaction(fcfg)\nif action == \"Compile\" then" - "\ntable.insert(sources, fcfg.name)\nelseif action == \"EmbeddedResource\" then\ntable.insert(embedded, fcfg.name)\nelseif action == \"Content\" then\ncopypairs[\"$(TARGETDIR)/\" .. _MAKE.esc(path.getname(fcfg.name))] = _MAKE.esc(fcfg.name)\nelseif path.getname(fcfg.name):lower() == \"app.config\" then\ncopypairs[\"$(TARGET).config\"] = _MAKE.esc(fcfg.name)\nend\nend\nlocal paths = table.translate(prj.libdirs, function(v) return path.join(prj.basedir, v) end)\npaths = table.join({prj.basedir}, paths)\nfor _, libname in ipairs(premake.getlinks(prj, \"system\", \"fullpath\")) do\nlocal libdir = os.pathsearch(libname..\".dll\", unpack(paths))\nif (libdir) then\nlocal target = \"$(TARGETDIR)/\" .. _MAKE.esc(path.getname(libname))\nlocal source = path.getrelative(prj.basedir, path.join(libdir, libname))..\".dll\"\ncopypairs[target] = _MAKE.esc(source)\nend\nend\n_p('# %s project makefile autogenerated by GENie', premake.action.current().shortname)\n_p('')\n_p('ifndef config')\n_p(' config=%s', _MAKE.esc(prj.configu" - "rations[1]:lower()))\n_p('endif')\n_p('')\n_p('ifndef verbose')\n_p(' SILENT = @')\n_p('endif')\n_p('')\n_p('SHELLTYPE := msdos')\n_p('ifeq (,$(ComSpec)$(COMSPEC))')\n_p(' SHELLTYPE := posix')\n_p('endif')\n_p('ifeq (/bin,$(findstring /bin,$(SHELL)))')\n_p(' SHELLTYPE := posix')\n_p('endif')\n_p('ifeq (/bin,$(findstring /bin,$(MAKESHELL)))')\n_p(' SHELLTYPE := posix')\n_p('endif')\n_p('')\n_p('ifeq (posix,$(SHELLTYPE))')\n_p(' MKDIR = $(SILENT) mkdir -p \"$(1)\"')\n_p(' COPY = $(SILENT) cp -fR \"$(1)\" \"$(2)\"')\n_p('else')\n_p(' MKDIR = $(SILENT) mkdir \"$(subst /,\\\\\\\\,$(1))\" 2> nul')\n_p(' COPY = $(SILENT) copy /Y \"$(subst /,\\\\\\\\,$(1))\" \"$(subst /,\\\\\\\\,$(2))\"')\n_p('endif')\n_p('')\n_p('ifndef CSC')\n_p(' CSC=%s', csc.getcompilervar(prj))\n_p('endif')\n_p('')\n_p('ifndef RESGEN')\n_p(' RESGEN=resgen')\n_p('endif')\n_p('')\nlocal platforms = premake.filterplatforms(prj.solution, premake[_OPTIONS.cc].platforms)\ntable.insert(platforms, 1, \"\")\nfor cfg in premake.eachconfig(prj) " - "do\npremake.gmake_cs_config(cfg, csc, cfglibs)\nend\n_p('# To maintain compatibility with VS.NET, these values must be set at the project level')\n_p('TARGET := $(TARGETDIR)/%s', _MAKE.esc(prj.buildtarget.name))\n_p('FLAGS += /t:%s %s', csc.getkind(prj):lower(), table.implode(_MAKE.esc(prj.libdirs), \"/lib:\", \"\", \" \"))\n_p('REFERENCES += %s', table.implode(_MAKE.esc(premake.getlinks(prj, \"system\", \"basename\")), \"/r:\", \".dll\", \" \"))\n_p('')\n_p('SOURCES := \\\\')\nfor _, fname in ipairs(sources) do\n_p('\\t%s \\\\', _MAKE.esc(path.translate(fname)))\nend\n_p('')\n_p('EMBEDFILES := \\\\')\nfor _, fname in ipairs(embedded) do\n_p('\\t%s \\\\', getresourcefilename(prj, fname))\nend\n_p('')\n_p('COPYFILES += \\\\')\nfor target, source in pairs(cfgpairs[anycfg]) do\n_p('\\t%s \\\\', target)\nend\nfor target, source in pairs(copypairs) do\n_p('\\t%s \\\\', target)\nend\n_p('')\n_p('SHELLTYPE := msdos')\n_p('ifeq (,$(ComSpec)$(COMSPEC))')\n_p(' SHELLTYPE := posix')\n_p('endif')\n_p('ifeq (/bin" - ",$(findstring /bin,$(SHELL)))')\n_p(' SHELLTYPE := posix')\n_p('endif')\n_p('ifeq (/bin,$(findstring /bin,$(MAKESHELL)))')\n_p(' SHELLTYPE := posix')\n_p('endif')\n_p('')\n_p('.PHONY: clean prebuild prelink')\n_p('')\n_p('all: $(TARGETDIR) $(OBJDIR) prebuild $(EMBEDFILES) $(COPYFILES) prelink $(TARGET)')\n_p('')\n_p('$(TARGET): $(SOURCES) $(EMBEDFILES) $(DEPENDS)')\n_p('\\t$(SILENT) $(CSC) /nologo /out:$@ $(FLAGS) $(REFERENCES) $(SOURCES) $(patsubst %%,/resource:%%,$(EMBEDFILES))')\n_p('\\t$(POSTBUILDCMDS)')\n_p('')\n_p('$(TARGETDIR):')\npremake.make_mkdirrule(\"$(TARGETDIR)\")\n_p('$(OBJDIR):')\npremake.make_mkdirrule(\"$(OBJDIR)\")\n_p('clean:')\n_p('\\t@echo Cleaning %s', prj.name)\n_p('ifeq (posix,$(SHELLTYPE))')\n_p('\\t$(SILENT) rm -f $(TARGET) $(COPYFILES)')\n_p('\\t$(SILENT) rm -rf $(OBJDIR)')\n_p('else')\n_p('\\t$(SILENT) if exist $(subst /,\\\\\\\\,$(TARGETDIR)/%s.*) del $(subst /,\\\\\\\\,$(TARGETDIR)/%s.*)', prj.buildtarget.basename, prj.buildtarget.basename)\nfor target, source in pairs(cfgpairs" - "[anycfg]) do\n_p('\\t$(SILENT) if exist $(subst /,\\\\\\\\,%s) del $(subst /,\\\\\\\\,%s)', target, target)\nend\nfor target, source in pairs(copypairs) do\n_p('\\t$(SILENT) if exist $(subst /,\\\\\\\\,%s) del $(subst /,\\\\\\\\,%s)', target, target)\nend\n_p('\\t$(SILENT) if exist $(subst /,\\\\\\\\,$(OBJDIR)) rmdir /s /q $(subst /,\\\\\\\\,$(OBJDIR))')\n_p('endif')\n_p('')\n_p('prebuild:')\n_p('\\t$(PREBUILDCMDS)')\n_p('')\n_p('prelink:')\n_p('\\t$(PRELINKCMDS)')\n_p('')\n_p('# Per-configuration copied file rules')\nfor cfg in premake.eachconfig(prj) do\n_p('ifneq (,$(findstring %s,$(config)))', _MAKE.esc(cfg.name:lower()))\nfor target, source in pairs(cfgpairs[cfg]) do\npremake.make_copyrule(source, target)\nend\n_p('endif')\n_p('')\nend\n_p('# Copied file rules')\nfor target, source in pairs(copypairs) do\npremake.make_copyrule(source, target)\nend\n_p('# Embedded file rules')\nfor _, fname in ipairs(embedded) do\nif path.getextension(fname) == \".resx\" then\n_p('%s: %s', getresourcefilename(prj, fname), " - "_MAKE.esc(fname))\n_p('\\t$(SILENT) $(RESGEN) $^ $@')\nend\n_p('')\nend\nend\nfunction premake.gmake_cs_config(cfg, csc, cfglibs)\nlocal targetDir = _MAKE.esc(cfg.buildtarget.directory)\n_p('ifneq (,$(findstring %s,$(config)))', _MAKE.esc(cfg.name:lower()))\n_p(' TARGETDIR := %s', iif(targetDir == \"\", \".\", targetDir))\n_p(' OBJDIR := %s', _MAKE.esc(cfg.objectsdir))\n_p(' DEPENDS := %s', table.concat(_MAKE.esc(premake.getlinks(cfg, \"dependencies\", \"fullpath\")), \" \"))\n_p(' REFERENCES := %s', table.implode(_MAKE.esc(cfglibs[cfg]), \"/r:\", \"\", \" \"))\n_p(' FLAGS += %s %s', table.implode(cfg.defines, \"/d:\", \"\", \" \"), table.concat(table.join(csc.getflags(cfg), cfg.buildoptions), \" \"))\n_p(' define PREBUILDCMDS')\nif #cfg.prebuildcommands > 0 then\n_p('\\t@echo Running pre-build commands')\n_p('\\t%s', table.implode(cfg.prebuildcommands, \"\", \"\", \"\\n\\t\"))\nend\n_p(' endef')\n_p(' define PRELINKCMDS')\nif #cfg.prelinkcommands > 0 then\n_p('\\t@echo Running pre-link co" - "mmands')\n_p('\\t%s', table.implode(cfg.prelinkcommands, \"\", \"\", \"\\n\\t\"))\nend\n_p(' endef')\n_p(' define POSTBUILDCMDS')\nif #cfg.postbuildcommands > 0 then\n_p('\\t@echo Running post-build commands')\n_p('\\t%s', table.implode(cfg.postbuildcommands, \"\", \"\", \"\\n\\t\"))\nend\n_p(' endef')\n_p('endif')\n_p('')\nend\n", + "\ntable.insert(sources, fcfg.name)\nelseif action == \"EmbeddedResource\" then\ntable.insert(embedded, fcfg.name)\nelseif action == \"Content\" then\ncopypairs[\"$(TARGETDIR)/\" .. _MAKE.esc(path.getname(fcfg.name))] = _MAKE.esc(fcfg.name)\nelseif path.getname(fcfg.name):lower() == \"app.config\" then\ncopypairs[\"$(TARGET).config\"] = _MAKE.esc(fcfg.name)\nend\nend\nlocal paths = table.translate(prj.libdirs, function(v) return path.join(prj.basedir, v) end)\npaths = table.join({prj.basedir}, paths)\nfor _, libname in ipairs(premake.getlinks(prj, \"system\", \"fullpath\")) do\nlocal libdir = os.pathsearch(libname..\".dll\", unpack(paths))\nif (libdir) then\nlocal target = \"$(TARGETDIR)/\" .. _MAKE.esc(path.getname(libname))\nlocal source = path.getrelative(prj.basedir, path.join(libdir, libname))..\".dll\"\ncopypairs[target] = _MAKE.esc(source)\nend\nend\n_p('# %s project makefile autogenerated by GENie', premake.action.current().shortname)\n_p('')\n_p('.SUFFIXES:') -- Delete the default suffix rules.\n_p('')" + "\n_p('ifndef config')\n_p(' config=%s', _MAKE.esc(prj.configurations[1]:lower()))\n_p('endif')\n_p('')\n_p('ifndef verbose')\n_p(' SILENT = @')\n_p('endif')\n_p('')\n_p('SHELLTYPE := msdos')\n_p('ifeq (,$(ComSpec)$(COMSPEC))')\n_p(' SHELLTYPE := posix')\n_p('endif')\n_p('ifeq (/bin,$(findstring /bin,$(SHELL)))')\n_p(' SHELLTYPE := posix')\n_p('endif')\n_p('ifeq (/bin,$(findstring /bin,$(MAKESHELL)))')\n_p(' SHELLTYPE := posix')\n_p('endif')\n_p('')\n_p('ifeq (posix,$(SHELLTYPE))')\n_p(' MKDIR = $(SILENT) mkdir -p \"$(1)\"')\n_p(' COPY = $(SILENT) cp -fR \"$(1)\" \"$(2)\"')\n_p('else')\n_p(' MKDIR = $(SILENT) mkdir \"$(subst /,\\\\\\\\,$(1))\" 2> nul')\n_p(' COPY = $(SILENT) copy /Y \"$(subst /,\\\\\\\\,$(1))\" \"$(subst /,\\\\\\\\,$(2))\"')\n_p('endif')\n_p('')\n_p('ifndef CSC')\n_p(' CSC=%s', csc.getcompilervar(prj))\n_p('endif')\n_p('')\n_p('ifndef RESGEN')\n_p(' RESGEN=resgen')\n_p('endif')\n_p('')\nlocal platforms = premake.filterplatforms(prj.solution, premake[_OPTIONS.cc].platforms)\ntable.i" + "nsert(platforms, 1, \"\")\nfor cfg in premake.eachconfig(prj) do\npremake.gmake_cs_config(cfg, csc, cfglibs)\nend\n_p('# To maintain compatibility with VS.NET, these values must be set at the project level')\n_p('TARGET := $(TARGETDIR)/%s', _MAKE.esc(prj.buildtarget.name))\n_p('FLAGS += /t:%s %s', csc.getkind(prj):lower(), table.implode(_MAKE.esc(prj.libdirs), \"/lib:\", \"\", \" \"))\n_p('REFERENCES += %s', table.implode(_MAKE.esc(premake.getlinks(prj, \"system\", \"basename\")), \"/r:\", \".dll\", \" \"))\n_p('')\n_p('SOURCES := \\\\')\nfor _, fname in ipairs(sources) do\n_p('\\t%s \\\\', _MAKE.esc(path.translate(fname)))\nend\n_p('')\n_p('EMBEDFILES := \\\\')\nfor _, fname in ipairs(embedded) do\n_p('\\t%s \\\\', getresourcefilename(prj, fname))\nend\n_p('')\n_p('COPYFILES += \\\\')\nfor target, source in pairs(cfgpairs[anycfg]) do\n_p('\\t%s \\\\', target)\nend\nfor target, source in pairs(copypairs) do\n_p('\\t%s \\\\', target)\nend\n_p('')\n_p('SHELLTYPE := msdos')\n_p('ifeq (,$(ComSpec)$(COMSPE" + "C))')\n_p(' SHELLTYPE := posix')\n_p('endif')\n_p('ifeq (/bin,$(findstring /bin,$(SHELL)))')\n_p(' SHELLTYPE := posix')\n_p('endif')\n_p('ifeq (/bin,$(findstring /bin,$(MAKESHELL)))')\n_p(' SHELLTYPE := posix')\n_p('endif')\n_p('')\n_p('.PHONY: clean prebuild prelink')\n_p('')\n_p('all: $(TARGETDIR) $(OBJDIR) prebuild $(EMBEDFILES) $(COPYFILES) prelink $(TARGET)')\n_p('')\n_p('$(TARGET): $(SOURCES) $(EMBEDFILES) $(DEPENDS)')\n_p('\\t$(SILENT) $(CSC) /nologo /out:$@ $(FLAGS) $(REFERENCES) $(SOURCES) $(patsubst %%,/resource:%%,$(EMBEDFILES))')\n_p('\\t$(POSTBUILDCMDS)')\n_p('')\n_p('$(TARGETDIR):')\npremake.make_mkdirrule(\"$(TARGETDIR)\")\n_p('$(OBJDIR):')\npremake.make_mkdirrule(\"$(OBJDIR)\")\n_p('clean:')\n_p('\\t@echo Cleaning %s', prj.name)\n_p('ifeq (posix,$(SHELLTYPE))')\n_p('\\t$(SILENT) rm -f $(TARGET) $(COPYFILES)')\n_p('\\t$(SILENT) rm -rf $(OBJDIR)')\n_p('else')\n_p('\\t$(SILENT) if exist $(subst /,\\\\\\\\,$(TARGETDIR)/%s.*) del $(subst /,\\\\\\\\,$(TARGETDIR)/%s.*)', prj.buildtarget.basename, p" + "rj.buildtarget.basename)\nfor target, source in pairs(cfgpairs[anycfg]) do\n_p('\\t$(SILENT) if exist $(subst /,\\\\\\\\,%s) del $(subst /,\\\\\\\\,%s)', target, target)\nend\nfor target, source in pairs(copypairs) do\n_p('\\t$(SILENT) if exist $(subst /,\\\\\\\\,%s) del $(subst /,\\\\\\\\,%s)', target, target)\nend\n_p('\\t$(SILENT) if exist $(subst /,\\\\\\\\,$(OBJDIR)) rmdir /s /q $(subst /,\\\\\\\\,$(OBJDIR))')\n_p('endif')\n_p('')\n_p('prebuild:')\n_p('\\t$(PREBUILDCMDS)')\n_p('')\n_p('prelink:')\n_p('\\t$(PRELINKCMDS)')\n_p('')\n_p('# Per-configuration copied file rules')\nfor cfg in premake.eachconfig(prj) do\n_p('ifneq (,$(findstring %s,$(config)))', _MAKE.esc(cfg.name:lower()))\nfor target, source in pairs(cfgpairs[cfg]) do\npremake.make_copyrule(source, target)\nend\n_p('endif')\n_p('')\nend\n_p('# Copied file rules')\nfor target, source in pairs(copypairs) do\npremake.make_copyrule(source, target)\nend\n_p('# Embedded file rules')\nfor _, fname in ipairs(embedded) do\nif path.getextension(fname) == " + "\".resx\" then\n_p('%s: %s', getresourcefilename(prj, fname), _MAKE.esc(fname))\n_p('\\t$(SILENT) $(RESGEN) $^ $@')\nend\n_p('')\nend\nend\nfunction premake.gmake_cs_config(cfg, csc, cfglibs)\nlocal targetDir = _MAKE.esc(cfg.buildtarget.directory)\n_p('ifneq (,$(findstring %s,$(config)))', _MAKE.esc(cfg.name:lower()))\n_p(' TARGETDIR := %s', iif(targetDir == \"\", \".\", targetDir))\n_p(' OBJDIR := %s', _MAKE.esc(cfg.objectsdir))\n_p(' DEPENDS := %s', table.concat(_MAKE.esc(premake.getlinks(cfg, \"dependencies\", \"fullpath\")), \" \"))\n_p(' REFERENCES := %s', table.implode(_MAKE.esc(cfglibs[cfg]), \"/r:\", \"\", \" \"))\n_p(' FLAGS += %s %s', table.implode(cfg.defines, \"/d:\", \"\", \" \"), table.concat(table.join(csc.getflags(cfg), cfg.buildoptions), \" \"))\n_p(' define PREBUILDCMDS')\nif #cfg.prebuildcommands > 0 then\n_p('\\t@echo Running pre-build commands')\n_p('\\t%s', table.implode(cfg.prebuildcommands, \"\", \"\", \"\\n\\t\"))\nend\n_p(' endef')\n_p(' define PRELINKCMDS')\nif #" + "cfg.prelinkcommands > 0 then\n_p('\\t@echo Running pre-link commands')\n_p('\\t%s', table.implode(cfg.prelinkcommands, \"\", \"\", \"\\n\\t\"))\nend\n_p(' endef')\n_p(' define POSTBUILDCMDS')\nif #cfg.postbuildcommands > 0 then\n_p('\\t@echo Running post-build commands')\n_p('\\t%s', table.implode(cfg.postbuildcommands, \"\", \"\", \"\\n\\t\"))\nend\n_p(' endef')\n_p('endif')\n_p('')\nend\n", /* actions/make/make_vala.lua */ - "local make = premake.make\nfunction premake.make_vala(prj)\nlocal valac = premake.gettool(prj)\nlocal platforms = premake.filterplatforms(prj.solution, valac.platforms, \"Native\")\n_p('# %s project makefile autogenerated by GENie', premake.action.current().shortname)\n_p('ifndef config')\n_p(' config=%s', _MAKE.esc(premake.getconfigname(prj.solution.configurations[1], platforms[1], true)))\n_p('endif')\n_p('')\n_p('ifndef verbose')\n_p(' SILENT = @')\n_p('endif')\n_p('')\n_p('SHELLTYPE := msdos')\n_p('ifeq (,$(ComSpec)$(COMSPEC))')\n_p(' SHELLTYPE := posix')\n_p('endif')\n_p('ifeq (/bin,$(findstring /bin,$(SHELL)))')\n_p(' SHELLTYPE := posix')\n_p('endif')\n_p('ifeq (/bin,$(findstring /bin,$(MAKESHELL)))')\n_p(' SHELLTYPE := posix')\n_p('endif')\n_p('')\n_p('ifeq (posix,$(SHELLTYPE))')\n_p(' MKDIR = $(SILENT) mkdir -p \"$(1)\"')\n_p(' COPY = $(SILENT) cp -fR \"$(1)\" \"$(2)\"')\n_p(' RM = $(SILENT) rm -f \"$(1)\"')\n_p('else')\n_p(' MKDIR = $(SILENT) mkdir \"$(subst /,\\\\\\\\,$(1))\" 2> nul || e" - "xit 0')\n_p(' COPY = $(SILENT) copy /Y \"$(subst /,\\\\\\\\,$(1))\" \"$(subst /,\\\\\\\\,$(2))\"')\n_p(' RM = $(SILENT) del /F \"$(subst /,\\\\\\\\,$(1))\" 2> nul || exit 0')\n_p('endif')\n_p('')\n_p('VALAC = %s', valac.valac)\n_p('CC = %s', valac.cc)\n_p('')\nfor _, platform in ipairs(platforms) do\nfor cfg in premake.eachconfig(prj, platform) do\npremake.gmake_valac_config(prj, cfg, valac)\nend\nend\n_p('SOURCES := \\\\')\nfor _, file in ipairs(prj.files) do\nif path.issourcefile(file) then\nif not table.icontains(prj.excludes, file) then\n_p('\\t%s \\\\', _MAKE.esc(file))\nend\nend\nend\n_p('')\n_p('.PHONY: clean prebuild prelink')\n_p('')\n_p('all: prebuild prelink $(TARGET) | $(TARGETDIR)')\n_p('\\t@:')\n_p('')\n_p('$(TARGET): $(SOURCES) | $(TARGETDIR)')\n_p('\\t$(SILENT) $(VALAC) -o $(TARGET) --cc=$(CC) $(FLAGS) $(SOURCES)')\n_p('\\t$(POSTBUILDCMDS)')\n_p('')\n_p('$(TARGETDIR):')\npremake.make_mkdirrule(\"$(TARGETDIR)\")\n_p('clean:')\nif (not prj.solution.messageskip) or (not table.contains(prj" - ".solution.messageskip, \"SkipCleaningMessage\")) then\n_p('\\t@echo Cleaning %s', prj.name)\nend\n_p('ifeq (posix,$(SHELLTYPE))')\n_p('\\t$(SILENT) rm -f $(TARGET)')\n_p('else')\n_p('\\t$(SILENT) if exist $(subst /,\\\\\\\\,$(TARGET)) del $(subst /,\\\\\\\\,$(TARGET))')\n_p('endif')\n_p('')\n_p('prebuild:')\n_p('\\t$(PREBUILDCMDS)')\n_p('')\n_p('prelink:')\n_p('\\t$(PRELINKCMDS)')\n_p('')\nend\nfunction premake.gmake_valac_config(prj, cfg, valac)\n_p('ifeq ($(config),%s)', _MAKE.esc(cfg.shortname))\n_p(' TARGETDIR = %s', _MAKE.esc(cfg.buildtarget.directory))\n_p(' TARGET = $(TARGETDIR)/%s', _MAKE.esc(cfg.buildtarget.name))\n_p(' DEFINES +=%s', make.list(valac.getdefines(cfg.defines)))\n_p(' VAPIDIRS +=%s', make.list(valac.getvapidirs(cfg.vapidirs)))\n_p(' PKGS +=%s', make.list(valac.getlinks(cfg.links)))\n_p(' FLAGS += $(DEFINES) $(VAPIDIRS) $(PKGS)%s', make.list(table.join(valac.getvalaflags(cfg), valac.getbuildoptions(cfg.buildoptions), valac.getbuildoptions(cfg.buildoptions_c), c" - "fg.buildoptions_vala)))\n_p(' define PREBUILDCMDS')\nif #cfg.prebuildcommands > 0 then\n_p('\\t@echo Running pre-build commands')\n_p('\\t%s', table.implode(cfg.prebuildcommands, \"\", \"\", \"\\n\\t\"))\nend\n_p(' endef')\n_p(' define PRELINKCMDS')\nif #cfg.prelinkcommands > 0 then\n_p('\\t@echo Running pre-link commands')\n_p('\\t%s', table.implode(cfg.prelinkcommands, \"\", \"\", \"\\n\\t\"))\nend\n_p(' endef')\n_p(' define POSTBUILDCMDS')\nif #cfg.postbuildcommands > 0 then\n_p('\\t@echo Running post-build commands')\n_p('\\t%s', table.implode(cfg.postbuildcommands, \"\", \"\", \"\\n\\t\"))\nend\n_p(' endef')\n_p('endif')\n_p('')\nend\n", + "premake.make.vala = { }\npremake.make.makefile_ignore = false\nlocal vala = premake.make.vala\nlocal make = premake.make\nfunction premake.make_vala(prj)\nlocal valac = premake.gettool(prj)\nlocal platforms = premake.filterplatforms(prj.solution, valac.platforms, \"Native\")\npremake.gmake_vala_header(prj, valac, platforms)\nfor _, platform in ipairs(platforms) do\nfor cfg in premake.eachconfig(prj, platform) do\npremake.gmake_valac_config(prj, cfg, valac)\nend\nend\nlocal objdirs = {}\nlocal additionalobjdirs = {}\nfor _, file in ipairs(prj.allfiles) do\nif path.issourcefile(file) or path.isgresource(file) then\nobjdirs[_MAKE.esc(path.getdirectory(path.trimdots(file)))] = 1\nend\nend\n_p('OBJDIRS := \\\\')\n_p('\\t$(OBJDIR) \\\\')\nfor dir, _ in iter.sortByKeys(objdirs) do\n_p('\\t$(OBJDIR)/%s \\\\', dir)\nend\nfor dir, _ in iter.sortByKeys(additionalobjdirs) do\n_p('\\t%s \\\\', dir)\nend\n_p('')\n_p('.PHONY: clean prebuild prelink')\n_p('')\n_p('all: $(OBJDIRS) $(TARGETDIR) prebuild prelink $(TARGET)')\n_p(" + "'\\t@:')\n_p('')\n_p('$(TARGET): $(OBJECTS) | $(TARGETDIR)')\n_p('\\t@echo Linking %s', prj.name)\n_p('\\t$(SILENT) $(LINKCMD)')\n_p('\\t$(POSTBUILDCMDS)')\n_p('')\n_p('$(TARGETDIR):')\npremake.make_mkdirrule(\"$(TARGETDIR)\")\n_p('$(OBJDIRS):')\nif (not prj.solution.messageskip) or (not table.contains(prj.solution.messageskip, \"SkipCreatingMessage\")) then\n_p('\\t@echo Creating $(@)')\nend\n_p('\\t-$(call MKDIR,$@)')\n_p('')\n_p('clean:')\nif (not prj.solution.messageskip) or (not table.contains(prj.solution.messageskip, \"SkipCleaningMessage\")) then\n_p('\\t@echo Cleaning %s', prj.name)\nend\n_p('ifeq (posix,$(SHELLTYPE))')\n_p('\\t$(SILENT) rm -f $(TARGET)')\n_p('else')\n_p('\\t$(SILENT) if exist $(subst /,\\\\\\\\,$(TARGET)) del $(subst /,\\\\\\\\,$(TARGET))')\n_p('endif')\n_p('')\n_p('prebuild:')\n_p('\\t$(PREBUILDCMDS)')\n_p('')\n_p('prelink:')\n_p('\\t$(PRELINKCMDS)')\n_p('')\nvala.fileRules(prj, valac)\nend\nfunction premake.gmake_vala_header(prj, valac, platforms)\n_p('# %s project makefile autoge" + "nerated by GENie', premake.action.current().shortname)\n_p('')\n_p('.SUFFIXES:') -- Delete the default suffix rules.\n_p('')\n_p('ifndef config')\n_p(' config=%s', _MAKE.esc(premake.getconfigname(prj.solution.configurations[1], platforms[1], true)))\n_p('endif')\n_p('')\n_p('ifndef verbose')\n_p(' SILENT = @')\n_p('endif')\n_p('')\n_p('SHELLTYPE := msdos')\n_p('ifeq (,$(ComSpec)$(COMSPEC))')\n_p(' SHELLTYPE := posix')\n_p('endif')\n_p('ifeq (/bin,$(findstring /bin,$(SHELL)))')\n_p(' SHELLTYPE := posix')\n_p('endif')\n_p('ifeq (/bin,$(findstring /bin,$(MAKESHELL)))')\n_p(' SHELLTYPE := posix')\n_p('endif')\n_p('')\n_p('ifeq (posix,$(SHELLTYPE))')\n_p(' MKDIR = $(SILENT) mkdir -p \"$(1)\"')\n_p(' COPY = $(SILENT) cp -fR \"$(1)\" \"$(2)\"')\n_p(' RM = $(SILENT) rm -f \"$(1)\"')\n_p('else')\n_p(' MKDIR = $(SILENT) mkdir \"$(subst /,\\\\\\\\,$(1))\" 2> nul || exit 0')\n_p(' COPY = $(SILENT) copy /Y \"$(subst /,\\\\\\\\,$(1))\" \"$(subst /,\\\\\\\\,$(2))\"')\n_p(' RM = $(SILENT) del /F \"$(subst /" + ",\\\\\\\\,$(1))\" 2> nul || exit 0')\n_p('endif')\n_p('')\n_p('VALAC = %s', valac.valac)\n_p('CC = %s', valac.cc)\n_p('GLIBRC = %s', valac.glibrc)\n_p('')\nif (not premake.make.makefile_ignore) then\n_p('MAKEFILE = %s', _MAKE.getmakefilename(prj, true))\n_p('')\nend\nend\nlocal function is_excluded(prj, cfg, file)\nif table.icontains(prj.excludes, file) then\nreturn true\nend\nif table.icontains(cfg.excludes, file) then\nreturn true\nend\nreturn false\nend\nfunction premake.gmake_valac_config(prj, cfg, valac)\n_p('ifeq ($(config),%s)', _MAKE.esc(cfg.shortname))\n_p(' BASEDIR = %s', _MAKE.esc(path.getrelative(cfg.location, _WORKING_DIR)))\n_p(' OBJDIR = %s', _MAKE.esc(cfg.objectsdir))\n_p(' TARGETDIR = %s', _MAKE.esc(cfg.buildtarget.directory))\n_p(' TARGET = $(TARGETDIR)/%s', _MAKE.esc(cfg.buildtarget.name))\n_p(' DEFINES +=%s', make.list(valac.getdefines(cfg.defines)))\n_p(' VAPIDIRS +=%s', make.list(valac.getvapidirs(cfg.vapidirs)))\n_p(' PKGS +=%s', make.list(valac.get" + "links(cfg.links)))\n_p(' FLAGS += $(DEFINES) $(VAPIDIRS) $(PKGS)%s', make.list(table.join(valac.getvalaflags(cfg), cfg.buildoptions_vala)))\n_p(' VALA_LDFLAGS= $(shell pkg-config --libs%s)', make.list(cfg.links))\n_p(' ALL_LDFLAGS+= $(LDFLAGS)%s $(VALA_LDFLAGS)', make.list(table.join(cfg.linkoptions)))\n_p(' LINKOBJS = %s', \"$(OBJECTS)\")\n_p(' VALA_CFLAGS = $(shell pkg-config --cflags%s)%s', make.list(cfg.links), make.list(valac.getvalaccflags(cfg)))\n_p(' ALL_CFLAGS += $(CFLAGS) $(ARCH)%s $(VALA_CFLAGS)', make.list(table.join(cfg.buildoptions, cfg.buildoptions_c)))\n_p(' LINKCMD = $(CC) -o $(TARGET) $(LINKOBJS) $(ARCH) $(ALL_LDFLAGS)');\ntable.sort(cfg.files)\n_p(' OBJECTS := \\\\')\nfor _, file in ipairs(cfg.files) do\nif path.issourcefile(file) or path.isgresource(file) then\nif not is_excluded(prj, cfg, file) then\n_p('\\t$(OBJDIR)/%s.o \\\\'\n, _MAKE.esc(path.trimdots(path.removeext(file)))\n)\nend\nend\nend\n_p('')\n_p(' SOURCES := \\\\')\nfor _, file in ipairs(cfg.files) do\nif pa" + "th.issourcefile(file) and path.isvalafile(file) then\nif not is_excluded(prj, cfg, file) then\n_p('\\t%s \\\\', _MAKE.esc(file))\nend\nend\nend\n_p('')\n_p(' GRESOURCES := \\\\')\nfor _, file in ipairs(cfg.files) do\nif path.isgresource(file) then\nif not is_excluded(prj, cfg, file) then\n_p('\\t%s \\\\', _MAKE.esc(file))\nend\nend\nend\n_p('')\n_p(' define PREBUILDCMDS')\nif #cfg.prebuildcommands > 0 then\n_p('\\t@echo Running pre-build commands')\n_p('\\t%s', table.implode(cfg.prebuildcommands, \"\", \"\", \"\\n\\t\"))\nend\n_p(' endef')\n_p(' define PRELINKCMDS')\nif #cfg.prelinkcommands > 0 then\n_p('\\t@echo Running pre-link commands')\n_p('\\t%s', table.implode(cfg.prelinkcommands, \"\", \"\", \"\\n\\t\"))\nend\n_p(' endef')\n_p(' define POSTBUILDCMDS')\nif #cfg.postbuildcommands > 0 then\n_p('\\t@echo Running post-build commands')\n_p('\\t%s', table.implode(cfg.postbuildcommands, \"\", \"\", \"\\n\\t\"))\nend\n_p(' endef')\n_p('endif')\n_p('')\nend\nfunction vala.fileRules(prj, cc)\nlocal platfor" + "ms = premake.filterplatforms(prj.solution, cc.platforms, \"Native\")\n_p('ifneq (,$(OBJRESP))')\n_p('$(OBJRESP): $(OBJECTS) | $(TARGETDIR) $(OBJDIRS)')\n_p('\\t$(SILENT) echo $^')\n_p('\\t$(SILENT) echo $^ > $@')\n_p('endif')\n_p('')\n_p('ifneq (,$(LDRESP))')\n_p('$(LDRESP): $(LDDEPS) | $(TARGETDIR) $(OBJDIRS)')\n_p('\\t$(SILENT) echo $^')\n_p('\\t$(SILENT) echo $^ > $@')\n_p('endif')\n_p('')\nlocal pattern_targets = \"\"\ntable.sort(prj.allfiles)\nfor _, file in ipairs(prj.allfiles or {}) do\nif path.issourcefile(file) or path.isgresource(file) then\nif path.isvalafile(file) or path.iscfile(file) or path.isgresource(file) then\nif path.isvalafile(file) or path.isgresource(file) then\n_p('$(OBJDIR)/%s.o: $(OBJDIR)/%s.c $(GCH) $(MAKEFILE) | $(OBJDIR)/%s'\n, _MAKE.esc(path.trimdots(path.removeext(file)))\n, _MAKE.esc(path.trimdots(path.removeext(file)))\n, _MAKE.esc(path.getdirectory(path.trimdots(file)))\n)\nif not path.isgresource(file) then\npattern_targets = pattern_targets\n.. \"$(OBJDIR)/\"\n.. _MAKE.esc(p" + "ath.trimdots(path.removeext(file)))\n.. \".% \\\\\\n\" -- Pattern rule: https://stackoverflow.com/a/3077254\nend\nelse\n_p('$(OBJDIR)/%s.o: %s $(GCH) $(MAKEFILE) | $(OBJDIR)/%s'\n, _MAKE.esc(path.trimdots(path.removeext(file)))\n, file\n, _MAKE.esc(path.getdirectory(path.trimdots(file)))\n)\nend\nif prj.msgcompile then\n_p('\\t@echo ' .. prj.msgcompile)\nelse\n_p('\\t@echo $(notdir $<)')\nend\n_p('\\t$(SILENT) %s $(FORCE_INCLUDE) -o \"$@\" -c \"$<\"'\n, \"$(CC) $(ALL_CFLAGS)\"\n, _MAKE.esc(path.getbasename(file))\n)\nfor _, task in ipairs(prj.postcompiletasks or {}) do\n_p('\\t$(SILENT) %s', task)\n_p('')\nend\n_p('')\nif path.isgresource(file) then\n_p('$(OBJDIR)/%s.c: %s $(GCH) $(MAKEFILE) | $(OBJDIR)/%s'\n, _MAKE.esc(path.trimdots(path.removeext(file)))\n, _MAKE.esc(file)\n, _MAKE.esc(path.getdirectory(path.trimdots(file)))\n)\nif prj.msgcompile then\n_p('\\t@echo ' .. prj.msgcompile)\nelse\n_p('\\t@echo $(notdir $<)')\nend\n_p('\\t$(SILENT) %s \"$<\" --target=\"$@\" --sourcedir=\"%s\" --generate'\n, \"$(GL" + "IBRC)\"\n, _MAKE.esc(path.getdirectory(file))\n)\nfor _, task in ipairs(prj.postcompiletasks or {}) do\n_p('\\t$(SILENT) %s', task)\n_p('')\nend\nend\n_p('')\nend\nend\nend\nif pattern_targets ~= \"\" then\n_p('%s: $(SOURCES) $(GRESOURCES) $(GCH) $(MAKEFILE)', pattern_targets)\nif prj.msgcompile then\n_p('\\t@echo ' .. prj.msgcompile)\nelse\n_p('\\t@echo [GEN] valac')\nend\n_p('\\t$(SILENT) %s $(SOURCES) --directory $(OBJDIR) --basedir $(BASEDIR) --gresources=$(GRESOURCES) -C'\n, \"$(VALAC) $(FLAGS)\"\n)\nfor _, task in ipairs(prj.postcompiletasks or {}) do\n_p('\\t$(SILENT) %s', task)\n_p('')\nend\nend\nend\n", /* actions/make/make_swift.lua */ - "local make = premake.make\nlocal swift = { }\nfunction premake.make_swift(prj)\nlocal tool = premake.gettool(prj)\nlocal platforms = premake.filterplatforms(prj.solution, tool.platforms, \"Native\")\n_p('# %s project makefile autogenerated by GENie', premake.action.current().shortname)\n_p('ifndef config')\n_p(1, 'config=%s', _MAKE.esc(premake.getconfigname(prj.solution.configurations[1], platforms[1], true)))\n_p('endif')\n_p('')\n_p('ifndef verbose')\n_p(1, 'SILENT = @')\n_p('endif')\n_p('')\n_p('SHELLTYPE := msdos')\n_p('ifeq (,$(ComSpec)$(COMSPEC))')\n_p(1, 'SHELLTYPE := posix')\n_p('endif')\n_p('ifeq (/bin,$(findstring /bin,$(SHELL)))')\n_p(1, 'SHELLTYPE := posix')\n_p('endif')\n_p('ifeq (/bin,$(findstring /bin,$(MAKESHELL)))')\n_p(1, 'SHELLTYPE := posix')\n_p('endif')\n_p('')\n_p('ifeq (posix,$(SHELLTYPE))')\n_p(1, 'MKDIR = $(SILENT) mkdir -p \"$(1)\"')\n_p(1, 'COPY = $(SILENT) cp -fR \"$(1)\" \"$(2)\"')\n_p(1, 'RM = $(SILENT) rm -f \"$(1)\"')\n_p('else')\n_p(1, 'MKDIR = $(SILENT) mkdir \"$(subst /," - "\\\\\\\\,$(1))\" 2> nul || exit 0')\n_p(1, 'COPY = $(SILENT) copy /Y \"$(subst /,\\\\\\\\,$(1))\" \"$(subst /,\\\\\\\\,$(2))\"')\n_p(1, 'RM = $(SILENT) del /F \"$(subst /,\\\\\\\\,$(1))\" 2> nul || exit 0')\n_p('endif')\n_p('')\n_p('SWIFTC = %s', tool.swift)\n_p('SWIFTLINK = %s', tool.swiftc)\n_p('DSYMUTIL = %s', tool.dsymutil)\n_p('AR = %s', tool.ar)\n_p('')\nfor _, platform in ipairs(platforms) do\nfor cfg in premake.eachconfig(prj, platform) do\nswift.generate_config(prj, cfg, tool)\nend\nend\n_p('.PHONY: ')\n_p('')\n_p('all: $(WORK_DIRS) $(TARGET)')\n_p('')\n_p('$(WORK_DIRS):')\n_p(1, '$(SILENT) $(call MKDIR,$@)')\n_p('')\n_p('SOURCES := \\\\')\nfor _, file in ipairs(prj.files) do\nif path.isswiftfile(file) then\n_p(1, '%s \\\\', _MAKE.esc(file))\nend\nend\n_p('')\nlocal objfiles = {}\n_p('OBJECTS_WITNESS := $(OBJDIR)/build.stamp')\n_p('OBJECTS := \\\\')\nfor _, file in ipairs(prj.files) do\nif path.isswiftfile(file) then\nlocal objname = _MAKE.esc(swift.objectname(file))\ntable.insert(objfiles, objnam" - "e)\n_p(1, '%s \\\\', objname)\nend\nend\n_p('')\nswift.file_rules(prj, objfiles)\nswift.linker(prj, tool)\nswift.generate_clean(prj)\nend\nfunction swift.objectname(file)\nreturn path.join(\"$(OBJDIR)\", path.getname(file)..\".o\")\nend\nfunction swift.file_rules(prj, objfiles)\n_p('$(OBJECTS_WITNESS): $(SOURCES)')\n_p(1, \"@rm -f $(OBJDIR)/data.tmp\")\n_p(1, \"@touch $(OBJDIR)/data.tmp\")\n_p(1, \"$(SILENT) $(SWIFTC) -frontend -c $(SOURCES) -enable-objc-interop $(SDK) -I $(OUT_DIR) $(SWIFTC_FLAGS) -module-cache-path $(MODULECACHE_DIR) -D SWIFT_PACKAGE $(MODULE_MAPS) -emit-module-doc-path $(OUT_DIR)/$(MODULE_NAME).swiftdoc -module-name $(MODULE_NAME) -emit-module-path $(OUT_DIR)/$(MODULE_NAME).swiftmodule -num-threads 8 %s\", table.arglist(\"-o\", objfiles))\n_p(1, \"@mv -f $(OBJDIR)/data.tmp $(OBJECTS_WITNESS)\")\n_p('')\n_p('$(OBJECTS): $(OBJECTS_WITNESS)')\n_p(1, '@if test -f $@; then :; else \\\\')\n_p(2, 'rm -f $(OBJECTS_WITNESS); \\\\')\n_p(2, '$(MAKE) $(AM_MAKEFLAGS) $(OBJECTS_WITNESS); \\\\')\n_p(1, 'f" - "i')\n_p('')\nend\nfunction swift.linker(prj, tool)\nlocal lddeps = make.list(premake.getlinks(prj, \"siblings\", \"fullpath\")) \nif prj.kind == \"StaticLib\" then\n_p(\"$(TARGET): $(OBJECTS) %s \", lddeps)\n_p(1, \"$(SILENT) $(AR) cr $(AR_FLAGS) $@ $(OBJECTS) %s\", (os.is(\"MacOSX\") and \" 2>&1 > /dev/null | sed -e '/.o) has no symbols$$/d'\" or \"\"))\nelse\n_p(\"$(TARGET): $(OBJECTS) $(LDDEPS)\", lddeps)\n_p(1, \"$(SILENT) $(SWIFTLINK) $(SDK) -L $(OUT_DIR) -o $@ $(SWIFTLINK_FLAGS) $(LD_FLAGS) $(OBJECTS)\")\n_p(\"ifdef SYMBOLS\")\n_p(1, \"$(SILENT) $(DSYMUTIL) $(TARGET) -o $(SYMBOLS)\")\n_p(\"endif\")\nend\n_p('')\nend\nfunction swift.generate_clean(prj)\n_p('clean:')\nif (not prj.solution.messageskip) or (not table.contains(prj.solution.messageskip, \"SkipCleaningMessage\")) then\n_p('\\t@echo Cleaning %s', prj.name)\nend\n_p('ifeq (posix,$(SHELLTYPE))')\n_p('\\t$(SILENT) rm -f $(TARGET)')\n_p('\\t$(SILENT) rm -rf $(OBJDIR)')\n_p('\\t$(SILENT) rm -rf $(SYMBOLS)')\n_p('\\t$(SILENT) rm -rf $(MODULECACHE_DIR" - ")')\n_p('else')\n_p('\\t$(SILENT) if exist $(subst /,\\\\\\\\,$(TARGET)) del $(subst /,\\\\\\\\,$(TARGET))')\n_p('\\t$(SILENT) if exist $(subst /,\\\\\\\\,$(OBJDIR)) rmdir /s /q $(subst /,\\\\\\\\,$(OBJDIR))')\n_p('\\t$(SILENT) if exist $(subst /,\\\\\\\\,$(SYMBOLS)) rmdir /s /q $(subst /,\\\\\\\\,$(SYMBOLS))')\n_p('\\t$(SILENT) if exist $(subst /,\\\\\\\\,$(MODULECACHE_DIR)) rmdir /s /q $(subst /,\\\\\\\\,$(MODULECACHE_DIR))')\n_p('endif')\n_p('')\nend\nfunction swift.generate_config(prj, cfg, tool)\n_p('ifeq ($(config),%s)', _MAKE.esc(cfg.shortname))\n_p(1, \"OUT_DIR = %s\", cfg.buildtarget.directory)\n _p(1, \"MODULECACHE_DIR = $(OUT_DIR)/ModuleCache\")\n_p(1, \"TARGET = $(OUT_DIR)/%s\", _MAKE.esc(cfg.buildtarget.name))\nlocal objdir = path.join(cfg.objectsdir, prj.name .. \".build\")\n_p(1, \"OBJDIR = %s\", objdir)\n_p(1, \"MODULE_NAME = %s\", prj.name)\n_p(1, \"MODULE_MAPS = %s\", make.list(tool.getmodulemaps(cfg)))\n_p(1, \"SWIFTC_FLAGS = %s\", make.list(tool.getswiftcflags(cfg)))\n_p(1, \"SWIFTLINK_FLA" - "GS = %s\", make.list(tool.getswiftlinkflags(cfg)))\n_p(1, \"AR_FLAGS = %s\", make.list(tool.getarchiveflags(cfg, cfg, false)))\n_p(1, \"LD_FLAGS = %s\", make.list(tool.getldflags(cfg)))\n_p(1, \"LDDEPS = %s\", make.list(premake.getlinks(cfg, \"siblings\", \"fullpath\")))\nif cfg.flags.Symbols then\n_p(1, \"SYMBOLS = $(TARGET).dSYM\")\nend\nlocal sdk = tool.get_sdk_path(cfg)\nif sdk then\n_p(1, \"TOOLCHAIN_PATH = %s\", tool.get_toolchain_path(cfg))\n_p(1, \"SDK_PATH = %s\", sdk)\n_p(1, \"PLATFORM_PATH = %s\", tool.get_sdk_platform_path(cfg))\n_p(1, \"SDK = -sdk $(SDK_PATH)\")\nelse\n_p(1, \"SDK_PATH =\")\n_p(1, \"SDK =\")\nend\n_p(1,'WORK_DIRS = $(OUT_DIR) $(OBJDIR)')\n_p('endif')\n_p('')\nend", + "local make = premake.make\nlocal swift = { }\nfunction premake.make_swift(prj)\nlocal tool = premake.gettool(prj)\nlocal platforms = premake.filterplatforms(prj.solution, tool.platforms, \"Native\")\n_p('# %s project makefile autogenerated by GENie', premake.action.current().shortname)\n_p('')\n_p('.SUFFIXES:') -- Delete the default suffix rules.\n_p('')\n_p('ifndef config')\n_p(1, 'config=%s', _MAKE.esc(premake.getconfigname(prj.solution.configurations[1], platforms[1], true)))\n_p('endif')\n_p('')\n_p('ifndef verbose')\n_p(1, 'SILENT = @')\n_p('endif')\n_p('')\n_p('SHELLTYPE := msdos')\n_p('ifeq (,$(ComSpec)$(COMSPEC))')\n_p(1, 'SHELLTYPE := posix')\n_p('endif')\n_p('ifeq (/bin,$(findstring /bin,$(SHELL)))')\n_p(1, 'SHELLTYPE := posix')\n_p('endif')\n_p('ifeq (/bin,$(findstring /bin,$(MAKESHELL)))')\n_p(1, 'SHELLTYPE := posix')\n_p('endif')\n_p('')\n_p('ifeq (posix,$(SHELLTYPE))')\n_p(1, 'MKDIR = $(SILENT) mkdir -p \"$(1)\"')\n_p(1, 'COPY = $(SILENT) cp -fR \"$(1)\" \"$(2)\"')\n_p(1, 'RM = $(SILENT) rm -" + "f \"$(1)\"')\n_p('else')\n_p(1, 'MKDIR = $(SILENT) mkdir \"$(subst /,\\\\\\\\,$(1))\" 2> nul || exit 0')\n_p(1, 'COPY = $(SILENT) copy /Y \"$(subst /,\\\\\\\\,$(1))\" \"$(subst /,\\\\\\\\,$(2))\"')\n_p(1, 'RM = $(SILENT) del /F \"$(subst /,\\\\\\\\,$(1))\" 2> nul || exit 0')\n_p('endif')\n_p('')\n_p('SWIFTC = %s', tool.swift)\n_p('SWIFTLINK = %s', tool.swiftc)\n_p('DSYMUTIL = %s', tool.dsymutil)\n_p('AR = %s', tool.ar)\n_p('')\nfor _, platform in ipairs(platforms) do\nfor cfg in premake.eachconfig(prj, platform) do\nswift.generate_config(prj, cfg, tool)\nend\nend\n_p('.PHONY: ')\n_p('')\n_p('all: $(WORK_DIRS) $(TARGET)')\n_p('')\n_p('$(WORK_DIRS):')\n_p(1, '$(SILENT) $(call MKDIR,$@)')\n_p('')\n_p('SOURCES := \\\\')\nfor _, file in ipairs(prj.files) do\nif path.isswiftfile(file) then\n_p(1, '%s \\\\', _MAKE.esc(file))\nend\nend\n_p('')\nlocal objfiles = {}\n_p('OBJECTS_WITNESS := $(OBJDIR)/build.stamp')\n_p('OBJECTS := \\\\')\nfor _, file in ipairs(prj.files) do\nif path.isswiftfile(file) then\nlocal objna" + "me = _MAKE.esc(swift.objectname(file))\ntable.insert(objfiles, objname)\n_p(1, '%s \\\\', objname)\nend\nend\n_p('')\nswift.file_rules(prj, objfiles)\nswift.linker(prj, tool)\nswift.generate_clean(prj)\nend\nfunction swift.objectname(file)\nreturn path.join(\"$(OBJDIR)\", path.getname(file)..\".o\")\nend\nfunction swift.file_rules(prj, objfiles)\n_p('$(OBJECTS_WITNESS): $(SOURCES)')\n_p(1, \"@rm -f $(OBJDIR)/data.tmp\")\n_p(1, \"@touch $(OBJDIR)/data.tmp\")\n_p(1, \"$(SILENT) $(SWIFTC) -frontend -c $(SOURCES) -enable-objc-interop $(SDK) -I $(OUT_DIR) $(SWIFTC_FLAGS) -module-cache-path $(MODULECACHE_DIR) -D SWIFT_PACKAGE $(MODULE_MAPS) -emit-module-doc-path $(OUT_DIR)/$(MODULE_NAME).swiftdoc -module-name $(MODULE_NAME) -emit-module-path $(OUT_DIR)/$(MODULE_NAME).swiftmodule -num-threads 8 %s\", table.arglist(\"-o\", objfiles))\n_p(1, \"@mv -f $(OBJDIR)/data.tmp $(OBJECTS_WITNESS)\")\n_p('')\n_p('$(OBJECTS): $(OBJECTS_WITNESS)')\n_p(1, '@if test -f $@; then :; else \\\\')\n_p(2, 'rm -f $(OBJECTS_WITNESS); \\\\')" + "\n_p(2, '$(MAKE) $(AM_MAKEFLAGS) $(OBJECTS_WITNESS); \\\\')\n_p(1, 'fi')\n_p('')\nend\nfunction swift.linker(prj, tool)\nlocal lddeps = make.list(premake.getlinks(prj, \"siblings\", \"fullpath\"))\nif prj.kind == \"StaticLib\" then\n_p(\"$(TARGET): $(OBJECTS) %s \", lddeps)\n_p(1, \"$(SILENT) $(AR) cr $(AR_FLAGS) $@ $(OBJECTS) %s\", (os.is(\"MacOSX\") and \" 2>&1 > /dev/null | sed -e '/.o) has no symbols$$/d'\" or \"\"))\nelse\n_p(\"$(TARGET): $(OBJECTS) $(LDDEPS)\", lddeps)\n_p(1, \"$(SILENT) $(SWIFTLINK) $(SDK) -L $(OUT_DIR) -o $@ $(SWIFTLINK_FLAGS) $(LD_FLAGS) $(OBJECTS)\")\n_p(\"ifdef SYMBOLS\")\n_p(1, \"$(SILENT) $(DSYMUTIL) $(TARGET) -o $(SYMBOLS)\")\n_p(\"endif\")\nend\n_p('')\nend\nfunction swift.generate_clean(prj)\n_p('clean:')\nif (not prj.solution.messageskip) or (not table.contains(prj.solution.messageskip, \"SkipCleaningMessage\")) then\n_p('\\t@echo Cleaning %s', prj.name)\nend\n_p('ifeq (posix,$(SHELLTYPE))')\n_p('\\t$(SILENT) rm -f $(TARGET)')\n_p('\\t$(SILENT) rm -rf $(OBJDIR)')\n_p('\\t$(SI" + "LENT) rm -rf $(SYMBOLS)')\n_p('\\t$(SILENT) rm -rf $(MODULECACHE_DIR)')\n_p('else')\n_p('\\t$(SILENT) if exist $(subst /,\\\\\\\\,$(TARGET)) del $(subst /,\\\\\\\\,$(TARGET))')\n_p('\\t$(SILENT) if exist $(subst /,\\\\\\\\,$(OBJDIR)) rmdir /s /q $(subst /,\\\\\\\\,$(OBJDIR))')\n_p('\\t$(SILENT) if exist $(subst /,\\\\\\\\,$(SYMBOLS)) rmdir /s /q $(subst /,\\\\\\\\,$(SYMBOLS))')\n_p('\\t$(SILENT) if exist $(subst /,\\\\\\\\,$(MODULECACHE_DIR)) rmdir /s /q $(subst /,\\\\\\\\,$(MODULECACHE_DIR))')\n_p('endif')\n_p('')\nend\nfunction swift.generate_config(prj, cfg, tool)\n_p('ifeq ($(config),%s)', _MAKE.esc(cfg.shortname))\n_p(1, \"OUT_DIR = %s\", cfg.buildtarget.directory)\n _p(1, \"MODULECACHE_DIR = $(OUT_DIR)/ModuleCache\")\n_p(1, \"TARGET = $(OUT_DIR)/%s\", _MAKE.esc(cfg.buildtarget.name))\nlocal objdir = path.join(cfg.objectsdir, prj.name .. \".build\")\n_p(1, \"OBJDIR = %s\", objdir)\n_p(1, \"MODULE_NAME = %s\", prj.name)\n_p(1, \"MODULE_MAPS = %s\", make.list(tool.getmodulemaps(cfg)))\n_p(1, \"SWIFTC_FLAGS" + " = %s\", make.list(tool.getswiftcflags(cfg)))\n_p(1, \"SWIFTLINK_FLAGS = %s\", make.list(tool.getswiftlinkflags(cfg)))\n_p(1, \"AR_FLAGS = %s\", make.list(tool.getarchiveflags(cfg, cfg, false)))\n_p(1, \"LD_FLAGS = %s\", make.list(tool.getldflags(cfg)))\n_p(1, \"LDDEPS = %s\", make.list(premake.getlinks(cfg, \"siblings\", \"fullpath\")))\nif cfg.flags.Symbols then\n_p(1, \"SYMBOLS = $(TARGET).dSYM\")\nend\nlocal sdk = tool.get_sdk_path(cfg)\nif sdk then\n_p(1, \"TOOLCHAIN_PATH = %s\", tool.get_toolchain_path(cfg))\n_p(1, \"SDK_PATH = %s\", sdk)\n_p(1, \"PLATFORM_PATH = %s\", tool.get_sdk_platform_path(cfg))\n_p(1, \"SDK = -sdk $(SDK_PATH)\")\nelse\n_p(1, \"SDK_PATH =\")\n_p(1, \"SDK =\")\nend\n_p(1,'WORK_DIRS = $(OUT_DIR) $(OBJDIR)')\n_p('endif')\n_p('')\nend\n", /* actions/vstudio/_vstudio.lua */ - "premake.vstudio = { }\nlocal toolsets = {\nvs2010 = \"v100\",\nvs2012 = \"v110\",\nvs2013 = \"v120\",\nvs2015 = \"v140\",\nvs2017 = \"v141\",\nvs2019 = \"v142\",\nvsllvm = \"llvm\",\n}\npremake.vstudio.toolset = toolsets[_ACTION] or \"unknown?\"\npremake.vstudio.splashpath = ''\npremake.vstudio.xpwarning = true\nlocal vstudio = premake.vstudio\nvstudio.platforms = {\nany = \"Any CPU\",\nmixed = \"Mixed Platforms\",\nNative = \"Win32\",\nx86 = \"x86\",\nx32 = \"Win32\",\nx64 = \"x64\",\nPS3 = \"PS3\",\nXbox360 = \"Xbox 360\",\nARM = \"ARM\",\nOrbis = \"ORBIS\",\nDurango = \"Durango\",\nTegraAndroid = \"Tegra-Android\",\nNX32 = \"NX32\",\nNX64 = \"NX64\",\nEmscripten = \"Emscripten\",\n}\nfunction vstudio.arch(prj)\nif (prj.language == \"C#\") then\nreturn \"Any CPU\"\nelse\nreturn \"Win32\"\nend\nend\nfunction vstudio.iswinrt()\nreturn vstudio.storeapp ~= nil and vstudio.storeapp ~= ''\nend\nfunction vstudio.buildconfigs(sln)\nlocal cfgs = { }\nlocal platforms = premake.filter" - "platforms(sln, vstudio.platforms, \"Native\")\nlocal hascpp = premake.hascppproject(sln)\nlocal hasdotnet = premake.hasdotnetproject(sln)\nif hasdotnet and (_ACTION > \"vs2008\" or hascpp) then\ntable.insert(platforms, 1, \"mixed\")\nend\nif hasdotnet and (_ACTION < \"vs2010\" or not hascpp) then\ntable.insert(platforms, 1, \"any\")\nend\nif _ACTION > \"vs2008\" then\nlocal platforms2010 = { }\nfor _, platform in ipairs(platforms) do\nif vstudio.platforms[platform] == \"Win32\" then\nif hascpp then\ntable.insert(platforms2010, platform)\nend\nif hasdotnet then\ntable.insert(platforms2010, \"x86\")\nend\nelse\ntable.insert(platforms2010, platform)\nend\nend\nplatforms = platforms2010\nend\nfor _, buildcfg in ipairs(sln.configurations) do\nfor _, platform in ipairs(platforms) do\nlocal entry = { }\nentry.src_buildcfg = buildcfg\nentry.src_platform = platform\nif platform ~= \"PS3\" or _ACTION > \"vs2008\" then\nentry.buildcfg = buildcfg\nentry.platform = vstudio.platforms[platform]\nelse\nentry.buildcfg = pla" - "tform .. \" \" .. buildcfg\nentry.platform = \"Win32\"\nend\nentry.name = entry.buildcfg .. \"|\" .. entry.platform\nentry.isreal = (platform ~= \"any\" and platform ~= \"mixed\")\ntable.insert(cfgs, entry)\nend\nend\nreturn cfgs\nend\nfunction premake.vstudio.bakeimports(sln)\nfor _,iprj in ipairs(sln.importedprojects) do\nif string.find(iprj.location, \".csproj\") ~= nil then\niprj.language = \"C#\"\nelse\niprj.language = \"C++\"\nend\nlocal f, err = io.open(iprj.location, \"r\")\nif (not f) then\nerror(err, 1)\nend\nlocal projcontents = f:read(\"*all\")\nf:close()\nlocal found, _, uuid = string.find(projcontents, \"{([%w%-]+)}\")\nif not found then\nerror(\"Could not find ProjectGuid element in project \" .. iprj.location, 1)\nend\niprj.uuid = uuid\nif iprj.language == \"C++\" and string.find(projcontents, \"true\") then\niprj.flags.Managed = true\nend\niprj.relpath = path.getrelative(sln.location, iprj.location)\nend\nend\nfunction premake.vstudio.getimpo" - "rtprj(prjpath, sln)\nfor _,iprj in ipairs(sln.importedprojects) do\nif prjpath == iprj.relpath then\nreturn iprj\nend\nend\nerror(\"Could not find reference import project \" .. prjpath, 1)\nend\nfunction vstudio.cleansolution(sln)\npremake.clean.file(sln, \"%%.sln\")\npremake.clean.file(sln, \"%%.suo\")\npremake.clean.file(sln, \"%%.ncb\")\npremake.clean.file(sln, \"%%.userprefs\")\npremake.clean.file(sln, \"%%.usertasks\")\nend\nfunction vstudio.cleanproject(prj)\nlocal fname = premake.project.getfilename(prj, \"%%\")\nos.remove(fname .. \".vcproj\")\nos.remove(fname .. \".vcproj.user\")\nos.remove(fname .. \".vcxproj\")\nos.remove(fname .. \".vcxproj.user\")\nos.remove(fname .. \".vcxproj.filters\")\nos.remove(fname .. \".csproj\")\nos.remove(fname .. \".csproj.user\")\nos.remove(fname .. \".pidb\")\nos.remove(fname .. \".sdf\")\nend\nfunction vstudio.cleantarget(name)\nos.remove(name .. \".pdb\")\nos.remove(name .. \".idb\")\nos.remove(name .. \".ilk\")\nos.remove(name .. \".vshost.exe\")\nos.remove(name ." - ". \".exe.manifest\")\nend\nfunction vstudio.projectfile(prj)\nlocal pattern\nif prj.language == \"C#\" then\npattern = \"%%.csproj\"\nelse\npattern = iif(_ACTION > \"vs2008\", \"%%.vcxproj\", \"%%.vcproj\")\nend\nlocal fname = premake.project.getbasename(prj.name, pattern)\nfname = path.join(prj.location, fname)\nreturn fname\nend\nfunction vstudio.tool(prj)\nif (prj.language == \"C#\") then\nreturn \"FAE04EC0-301F-11D3-BF4B-00C04F79EFBC\"\nelse\nreturn \"8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942\"\nend\nend\n", + "premake.vstudio = { }\nlocal toolsets = {\nvs2010 = \"v100\",\nvs2012 = \"v110\",\nvs2013 = \"v120\",\nvs2015 = \"v140\",\nvs2017 = \"v141\",\nvs2019 = \"v142\",\nvs2022 = \"v143\",\n}\npremake.vstudio.toolset = toolsets[_ACTION] or \"unknown?\"\npremake.vstudio.splashpath = ''\npremake.vstudio.xpwarning = true\nlocal vstudio = premake.vstudio\nvstudio.platforms = {\nany = \"Any CPU\",\nmixed = \"Mixed Platforms\",\nNative = \"Win32\",\nx86 = \"x86\",\nx32 = \"Win32\",\nx64 = \"x64\",\nPS3 = \"PS3\",\nXbox360 = \"Xbox 360\",\nARM = \"ARM\",\nARM64 = \"ARM64\",\nOrbis = \"ORBIS\",\nDurango = \"Durango\",\nTegraAndroid = \"Tegra-Android\",\nNX32 = \"NX32\",\nNX64 = \"NX64\",\nEmscripten = \"Emscripten\",\n[\"gdk-desktop\"] = \"Gaming.Desktop.x64\",\n[\"gdk-xboxone\"] = \"Gaming.Xbox.XboxOne.x64\",\n[\"gdk-scarlett\"] = \"Gaming.Xbox.Scarlett.x64\",\n}\nfunction vstudio.arch(prj)\nif (prj" + ".language == \"C#\") then\nreturn \"Any CPU\"\nelse\nreturn \"Win32\"\nend\nend\nfunction vstudio.iswinrt()\nreturn vstudio.storeapp ~= nil and vstudio.storeapp ~= ''\nend\nfunction vstudio.isgdkconsole(cfg)\nfor _,p in pairs({\"gdk-xboxone\", \"gdk-scarlett\"}) do\nif cfg.platform == p then\nreturn true\nend\nend\nreturn false\nend\nfunction vstudio.isgdkdesktop(cfg)\nreturn cfg.platform == \"gdk-desktop\"\nend\nfunction vstudio.isgdk(cfg)\nreturn vstudio.isgdkconsole(cfg) or vstudio.isgdkdesktop(cfg)\nend\n \nfunction vstudio.buildconfigs(sln)\nlocal cfgs = { }\nlocal platforms = premake.filterplatforms(sln, vstudio.platforms, \"Native\")\nlocal hascpp = premake.hascppproject(sln)\nlocal hasdotnet = premake.hasdotnetproject(sln)\nif hasdotnet and (_ACTION > \"vs2008\" or hascpp) then\ntable.insert(platforms, 1, \"mixed\")\nend\nif hasdotnet and (_ACTION < \"vs2010\" or not hascpp) then\ntable.insert(platforms, 1, \"any\")\nend\nif _ACTION > \"vs2008\" then\nlocal platforms2010 = { }\nfor _, platfor" + "m in ipairs(platforms) do\nif vstudio.platforms[platform] == \"Win32\" then\nif hascpp then\ntable.insert(platforms2010, platform)\nend\nif hasdotnet then\ntable.insert(platforms2010, \"x86\")\nend\nelse\ntable.insert(platforms2010, platform)\nend\nend\nplatforms = platforms2010\nend\nfor _, buildcfg in ipairs(sln.configurations) do\nfor _, platform in ipairs(platforms) do\nlocal entry = { }\nentry.src_buildcfg = buildcfg\nentry.src_platform = platform\nif platform ~= \"PS3\" or _ACTION > \"vs2008\" then\nentry.buildcfg = buildcfg\nentry.platform = vstudio.platforms[platform]\nelse\nentry.buildcfg = platform .. \" \" .. buildcfg\nentry.platform = \"Win32\"\nend\nentry.name = entry.buildcfg .. \"|\" .. entry.platform\nentry.isreal = (platform ~= \"any\" and platform ~= \"mixed\")\ntable.insert(cfgs, entry)\nend\nend\nreturn cfgs\nend\nfunction premake.vstudio.bakeimports(sln)\nfor _,iprj in ipairs(sln.importedprojects) do\nif string.find(iprj.location, \".csproj\") ~= nil then\niprj.language = \"C#\"\nelse\nipr" + "j.language = \"C++\"\nend\nlocal f, err = io.open(iprj.location, \"r\")\nif (not f) then\nerror(err, 1)\nend\nlocal projcontents = f:read(\"*all\")\nf:close()\nlocal found, _, uuid = string.find(projcontents, \"{([%w%-]+)}\")\nif not found then\nerror(\"Could not find ProjectGuid element in project \" .. iprj.location, 1)\nend\niprj.uuid = uuid\nif iprj.language == \"C++\" and string.find(projcontents, \"true\") then\niprj.flags.Managed = true\nend\niprj.relpath = path.getrelative(sln.location, iprj.location)\nend\nend\nfunction premake.vstudio.getimportprj(prjpath, sln)\nfor _,iprj in ipairs(sln.importedprojects) do\nif prjpath == iprj.relpath then\nreturn iprj\nend\nend\nerror(\"Could not find reference import project \" .. prjpath, 1)\nend\nfunction vstudio.cleansolution(sln)\npremake.clean.file(sln, \"%%.sln\")\npremake.clean.file(sln, \"%%.suo\")\npremake.clean.file(sln, \"%%.ncb\")\npremake.clean.file(sln, \"%%.userprefs\")\npremake.clean.file(sln, \"%%" + ".usertasks\")\nend\nfunction vstudio.cleanproject(prj)\nlocal fname = premake.project.getfilename(prj, \"%%\")\nos.remove(fname .. \".vcproj\")\nos.remove(fname .. \".vcproj.user\")\nos.remove(fname .. \".vcxproj\")\nos.remove(fname .. \".vcxproj.user\")\nos.remove(fname .. \".vcxproj.filters\")\nos.remove(fname .. \".csproj\")\nos.remove(fname .. \".csproj.user\")\nos.remove(fname .. \".pidb\")\nos.remove(fname .. \".sdf\")\nend\nfunction vstudio.cleantarget(name)\nos.remove(name .. \".pdb\")\nos.remove(name .. \".idb\")\nos.remove(name .. \".ilk\")\nos.remove(name .. \".vshost.exe\")\nos.remove(name .. \".exe.manifest\")\nend\nfunction vstudio.projectfile(prj)\nlocal pattern\nif prj.language == \"C#\" then\npattern = \"%%.csproj\"\nelse\npattern = iif(_ACTION > \"vs2008\", \"%%.vcxproj\", \"%%.vcproj\")\nend\nlocal fname = premake.project.getbasename(prj.name, pattern)\nfname = path.join(prj.location, fname)\nreturn fname\nend\nfunction vstudio.tool(prj)\nif (prj.language == \"C#\") then\nreturn \"FAE04EC0-3" + "01F-11D3-BF4B-00C04F79EFBC\"\nelse\nreturn \"8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942\"\nend\nend\n", /* actions/vstudio/vstudio_solution.lua */ "premake.vstudio.sln2005 = { }\nlocal vstudio = premake.vstudio\nlocal sln2005 = premake.vstudio.sln2005\nfunction sln2005.generate(sln)\nio.eol = '\\r\\n'\nsln.vstudio_configs = premake.vstudio.buildconfigs(sln)\npremake.vstudio.bakeimports(sln)\n_p('\\239\\187\\191')\nsln2005.reorderProjects(sln)\nsln2005.header(sln)\nfor grp in premake.solution.eachgroup(sln) do\nsln2005.group(grp)\nend\nfor prj in premake.solution.eachproject(sln) do\nsln2005.project(prj)\nend\n \nfor _,iprj in ipairs(sln.importedprojects) do\nsln2005.importproject(iprj)\nend\n_p('Global')\nsln2005.platforms(sln)\nsln2005.project_platforms(sln)\nsln2005.properties(sln)\nsln2005.project_groups(sln)\n_p('EndGlobal')\nend\nfunction sln2005.reorderProjects(sln)\nif sln.startproject then\nfor i, prj in ipairs(sln.projects) do\nif sln.startproject == prj.name then\nlocal cur = prj.group\nwhile cur ~= nil do\nfor j, group in ipairs(sln.groups) do\nif group == cur then\ntable.remove(sln.groups, j)\nbreak\nend\nend\ntable.insert(sln.groups, 1" - ", cur)\ncur = cur.parent\nend\ntable.remove(sln.projects, i)\ntable.insert(sln.projects, 1, prj)\nbreak\nend\nend\nend\nend\nfunction sln2005.header(sln)\nlocal action = premake.action.current()\n_p('Microsoft Visual Studio Solution File, Format Version %d.00', action.vstudio.solutionVersion)\nif(_ACTION:sub(3) == \"2015\" or _ACTION:sub(3) == \"2017\" or _ACTION:sub(3) == \"llvm\") then\n_p('# Visual Studio %s', action.vstudio.toolsVersion:sub(1,2))\nelse\n_p('# Visual Studio %s', _ACTION:sub(3))\nend\nend\nfunction sln2005.project(prj)\nlocal projpath = path.translate(path.getrelative(prj.solution.location, vstudio.projectfile(prj)), \"\\\\\")\n_p('Project(\"{%s}\") = \"%s\", \"%s\", \"{%s}\"', vstudio.tool(prj), prj.name, projpath, prj.uuid)\nsln2005.projectdependencies(prj)\n_p('EndProject')\nend\nfunction sln2005.group(grp)\n_p('Project(\"{2150E333-8FDC-42A3-9474-1A3956D46DE8}\") = \"%s\", \"%s\", \"{%s}\"', grp.name, grp.name, grp.uuid)\n_p('EndProject')\nend\n \nfunction sln2005.importproject(iprj)" - "\n_p('Project(\"{%s}\") = \"%s\", \"%s\", \"{%s}\"', vstudio.tool(iprj), path.getbasename(iprj.location), iprj.relpath, iprj.uuid)\n_p('EndProject')\nend\nfunction sln2005.projectdependencies(prj)\nlocal deps = premake.getdependencies(prj)\nif #deps > 0 then\nlocal function compareuuid(a, b) return a.uuid < b.uuid end\ntable.sort(deps, compareuuid)\n_p('\\tProjectSection(ProjectDependencies) = postProject')\nfor _, dep in ipairs(deps) do\n_p('\\t\\t{%s} = {%s}', dep.uuid, dep.uuid)\nend\n_p('\\tEndProjectSection')\nend\nend\nfunction sln2005.platforms(sln)\n_p('\\tGlobalSection(SolutionConfigurationPlatforms) = preSolution')\nfor _, cfg in ipairs(sln.vstudio_configs) do\n_p('\\t\\t%s = %s', cfg.name, cfg.name)\nend\n_p('\\tEndGlobalSection')\nend\nfunction sln2005.project_platform(prj, sln)\nfor _, cfg in ipairs(sln.vstudio_configs) do\nlocal mapped\nlocal buildfor\nif premake.isdotnetproject(prj) then\nbuildfor = \"x64\"\nmapped = \"Any CPU\"\nelseif prj.flags and prj.flags.Managed then\nmapped = \"x64\"\nels" - "e\nif cfg.platform == \"Any CPU\" or cfg.platform == \"Mixed Platforms\" then\nmapped = sln.vstudio_configs[3].platform\nelse\nmapped = cfg.platform\nend\nend\nlocal build_project = true\nif prj.solution ~= nil then\n build_project = premake.getconfig(prj, cfg.src_buildcfg, cfg.src_platform).build\nend\n_p('\\t\\t{%s}.%s.ActiveCfg = %s|%s', prj.uuid, cfg.name, cfg.buildcfg, mapped)\nif build_project then\n if mapped == cfg.platform or cfg.platform == \"Mixed Platforms\" or buildfor == cfg.platform then\n _p('\\t\\t{%s}.%s.Build.0 = %s|%s', prj.uuid, cfg.name, cfg.buildcfg, mapped)\n end\n if premake.vstudio.iswinrt() and prj.kind == \"WindowedApp\" then\n _p('\\t\\t{%s}.%s.Deploy.0 = %s|%s', prj.uuid, cfg.name, cfg.buildcfg, mapped)\n end\nend\nend\nend\nfunction sln2005.project_platforms(sln)\n_p('\\tGlobalSection(ProjectConfigurationPlatforms) = postSolution')\nfor prj in premake.solution.eachproject(sln) do\nsln2005.project_platform(prj, sln)\nend\nfor _,iprj in ipairs(sln.imported" - "projects) do\nsln2005.project_platform(iprj, sln)\nend\n_p('\\tEndGlobalSection')\nend\nfunction sln2005.properties(sln)\n_p('\\tGlobalSection(SolutionProperties) = preSolution')\n_p('\\t\\tHideSolutionNode = FALSE')\n_p('\\tEndGlobalSection')\nend\nfunction sln2005.project_groups(sln)\n_p('\\tGlobalSection(NestedProjects) = preSolution')\nfor grp in premake.solution.eachgroup(sln) do\nif grp.parent ~= nil then\n_p('\\t\\t{%s} = {%s}', grp.uuid, grp.parent.uuid)\nend\nend\nfor prj in premake.solution.eachproject(sln) do\nif prj.group ~= nil then\n_p('\\t\\t{%s} = {%s}', prj.uuid, prj.group.uuid)\nend\nend\nfor _,iprj in ipairs(sln.importedprojects) do\nif iprj.group ~= nil then\n_p('\\t\\t{%s} = {%s}', iprj.uuid, iprj.group.uuid)\nend\nend\n \n_p('\\tEndGlobalSection')\nend", + ", cur)\ncur = cur.parent\nend\ntable.remove(sln.projects, i)\ntable.insert(sln.projects, 1, prj)\nbreak\nend\nend\nend\nend\nfunction sln2005.header(sln)\nlocal action = premake.action.current()\n_p('Microsoft Visual Studio Solution File, Format Version %d.00', action.vstudio.solutionVersion)\nif(_ACTION:sub(3) == \"2015\" or _ACTION:sub(3) == \"2017\") then\n_p('# Visual Studio %s', action.vstudio.toolsVersion:sub(1,2))\nelseif(_ACTION:sub(3) == \"2019\") then\n_p('# Visual Studio Version %s', action.vstudio.toolsVersion:sub(1,2))\nelse\n_p('# Visual Studio %s', _ACTION:sub(3))\nend\nend\nfunction sln2005.project(prj)\nlocal projpath = path.translate(path.getrelative(prj.solution.location, vstudio.projectfile(prj)), \"\\\\\")\n_p('Project(\"{%s}\") = \"%s\", \"%s\", \"{%s}\"', vstudio.tool(prj), prj.name, projpath, prj.uuid)\nsln2005.projectdependencies(prj)\n_p('EndProject')\nend\nfunction sln2005.group(grp)\n_p('Project(\"{2150E333-8FDC-42A3-9474-1A3956D46DE8}\") = \"%s\", \"%s\", \"{%s}\"', grp.name, grp." + "name, grp.uuid)\n_p('EndProject')\nend\n \nfunction sln2005.importproject(iprj)\n_p('Project(\"{%s}\") = \"%s\", \"%s\", \"{%s}\"', vstudio.tool(iprj), path.getbasename(iprj.location), iprj.relpath, iprj.uuid)\n_p('EndProject')\nend\nfunction sln2005.projectdependencies(prj)\nlocal deps = premake.getdependencies(prj)\nif #deps > 0 then\nlocal function compareuuid(a, b) return a.uuid < b.uuid end\ntable.sort(deps, compareuuid)\n_p('\\tProjectSection(ProjectDependencies) = postProject')\nfor _, dep in ipairs(deps) do\n_p('\\t\\t{%s} = {%s}', dep.uuid, dep.uuid)\nend\n_p('\\tEndProjectSection')\nend\nend\nfunction sln2005.platforms(sln)\n_p('\\tGlobalSection(SolutionConfigurationPlatforms) = preSolution')\nfor _, cfg in ipairs(sln.vstudio_configs) do\n_p('\\t\\t%s = %s', cfg.name, cfg.name)\nend\n_p('\\tEndGlobalSection')\nend\nfunction sln2005.project_platform(prj, sln)\nfor _, cfg in ipairs(sln.vstudio_configs) do\nlocal mapped\nlocal buildfor\nif premake.isdotnetproject(prj) then\nbuildfor = \"x64\"\nmapped" + " = \"Any CPU\"\nelseif prj.flags and prj.flags.Managed then\nmapped = \"x64\"\nelse\nif cfg.platform == \"Any CPU\" or cfg.platform == \"Mixed Platforms\" then\nmapped = sln.vstudio_configs[3].platform\nelse\nmapped = cfg.platform\nend\nend\nlocal build_project = true\nif prj.solution ~= nil then\n build_project = premake.getconfig(prj, cfg.src_buildcfg, cfg.src_platform).build\nend\n_p('\\t\\t{%s}.%s.ActiveCfg = %s|%s', prj.uuid, cfg.name, cfg.buildcfg, mapped)\nif build_project then\n if mapped == cfg.platform or cfg.platform == \"Mixed Platforms\" or buildfor == cfg.platform then\n _p('\\t\\t{%s}.%s.Build.0 = %s|%s', prj.uuid, cfg.name, cfg.buildcfg, mapped)\n end\n if premake.vstudio.iswinrt() and prj.kind == \"WindowedApp\" then\n _p('\\t\\t{%s}.%s.Deploy.0 = %s|%s', prj.uuid, cfg.name, cfg.buildcfg, mapped)\n end\n if premake.vstudio.isgdk(cfg) and prj.kind == \"WindowedApp\" then\n _p('\\t\\t{%s}.%s.Deploy.0 = %s|%s', prj.uuid, cfg.name, cfg.buildcfg, mapped)\n end\ne" + "nd\nend\nend\nfunction sln2005.project_platforms(sln)\n_p('\\tGlobalSection(ProjectConfigurationPlatforms) = postSolution')\nfor prj in premake.solution.eachproject(sln) do\nsln2005.project_platform(prj, sln)\nend\nfor _,iprj in ipairs(sln.importedprojects) do\nsln2005.project_platform(iprj, sln)\nend\n_p('\\tEndGlobalSection')\nend\nfunction sln2005.properties(sln)\n_p('\\tGlobalSection(SolutionProperties) = preSolution')\n_p('\\t\\tHideSolutionNode = FALSE')\n_p('\\tEndGlobalSection')\nend\nfunction sln2005.project_groups(sln)\n_p('\\tGlobalSection(NestedProjects) = preSolution')\nfor grp in premake.solution.eachgroup(sln) do\nif grp.parent ~= nil then\n_p('\\t\\t{%s} = {%s}', grp.uuid, grp.parent.uuid)\nend\nend\nfor prj in premake.solution.eachproject(sln) do\nif prj.group ~= nil then\n_p('\\t\\t{%s} = {%s}', prj.uuid, prj.group.uuid)\nend\nend\nfor _,iprj in ipairs(sln.importedprojects) do\nif iprj.group ~= nil then\n_p('\\t\\t{%s} = {%s}', iprj.uuid, iprj.group.uuid)\nend\nend\n \n_p('\\tEndGlobal" + "Section')\nend\n", /* actions/vstudio/vstudio_vcxproj.lua */ "premake.vstudio.vc2010 = { }\nlocal vc2010 = premake.vstudio.vc2010\nlocal vstudio = premake.vstudio\nlocal function vs2010_config(prj)\nfor _, cfginfo in ipairs(prj.solution.vstudio_configs) do\nif cfginfo.src_platform == \"TegraAndroid\" then\n_p(1,'')\n_p(2,'11')\n_p(1,'')\nbreak\nend\nend\n_p(1,'')\nfor _, cfginfo in ipairs(prj.solution.vstudio_configs) do\n_p(2,'', premake.esc(cfginfo.name))\n_p(3,'%s',cfginfo.buildcfg)\n_p(3,'%s',cfginfo.platform)\n_p(2,'')\nend\n_p(1,'')\nend\nlocal function vs2010_globals(prj)\nlocal action = premake.action.current()\n_p(1,'')\n_p(2, '{%s}',prj.uuid)\n_p(2, '%s',prj.name)\nif vstudio.store" "app ~= \"durango\" then\nlocal windowsTargetPlatformVersion = prj.windowstargetplatformversion or action.vstudio.windowsTargetPlatformVersion\nif windowsTargetPlatformVersion ~= nil then\n_p(2,'%s',windowsTargetPlatformVersion)\nif windowsTargetPlatformVersion and string.startswith(windowsTargetPlatformVersion, \"10.\") then\n_p(2,'%s', prj.windowstargetplatformminversion or \"10.0.10240.0\")\nend\nend\nend\nif prj.flags and prj.flags.Managed then\nlocal frameworkVersion = prj.framework or \"4.0\"\n_p(2, 'v%s', frameworkVersion)\n_p(2, 'ManagedCProj')\nelseif vstudio.iswinrt() then\n_p(2, 'en-US')\nif vstudio.storeapp == \"durango\" then\n_p(2, 'Win32Proj')\n_p(2, 'title')\n_p(2, '14.0')\n_p(2, 'Native')\nelse\n_p(2, 'true')\n_p(2, '12.0')\n_p(2, 'Windows Store')\n_p(2, '%s', vstudio.storeapp)\nend\nelse\n_p(2, 'Win32Proj')\nend\nif _ACTION:sub(3) == \"2015\" or _ACTION:sub(3) == \"2017\" or _ACTION:sub(3) == \"2019\" or _ACTION:sub(3) == \"llvm\" then\n_p(2,'x64')\nend\nif (_ACTION:sub(3) == \"2017\" or _ACTION:sub(3) == \"llvm\")\nand os.isdir(path.join(os.getenv(\"VSINSTALLDIR\"), \"VC/Tools/MSVC/14.14.26428\")) then\n_p(2,'14.14.26428')\nend\nif not vstudio.xpwarning then\n_p(2, 'false')\nend\n_p(1,'')\nend\nfunction vc2010.config_type(config)\nlocal t =\n{\nSharedLib = \"Dyna" - "micLibrary\",\nStaticLib = \"StaticLibrary\",\nConsoleApp = \"Application\",\nWindowedApp = \"Application\"\n}\nreturn t[config.kind]\nend\nlocal function if_config_and_platform()\nreturn 'Condition=\"\\'$(Configuration)|$(Platform)\\'==\\'%s\\'\"'\nend\nlocal function optimisation(cfg)\nlocal result = \"Disabled\"\nfor _, value in ipairs(cfg.flags) do\nif (value == \"Optimize\") then\nresult = \"Full\"\nelseif (value == \"OptimizeSize\") then\nresult = \"MinSpace\"\nelseif (value == \"OptimizeSpeed\") then\nresult = \"MaxSpeed\"\nend\nend\nreturn result\nend\nfunction vc2010.configurationPropertyGroup(cfg, cfginfo)\n_p(1, ''\n, premake.esc(cfginfo.name))\nlocal is2019 = premake.action.current() == premake.action.get(\"vs2019\")\nif is2019 then\n _p(2, '%s', action.vstudio.toolsVersion)\nif cfg.flags.UnitySupport then\n _p(2, 'true')\nend\nend\n_p(2, '%s', vc2010.config_type(cfg))\n_p(2, '%s', iif(optimisation(cfg) == \"Disabled\",\"true\",\"false\"))\n_p(2, '%s', premake.vstudio.toolset)\nif os.is64bit() then\n_p(2, 'x64')\nend\nif cfg.flags.MFC then\n_p(2,'%s', iif(cfg.flags.StaticRuntime, \"Static\", \"Dynamic\"))\nend\nif cfg.flags.ATL or cfg.flags.StaticATL then\n_p(2,'%s', iif(cfg.flags.StaticATL, \"Static\", \"Dynamic\"))\nend\nif cfg.flags.Unicode then\n_p(2,'Unicode')\nend\nif cfg.flags.Managed then\n_p(2,'true')\nend\nif cfg.platform == \"TegraAndroid\" then\nif cfg.androidtargetapi then\n_p(2,'android-%s', cfg.androidtargetapi)\nend\nif cfg.androidminapi then\n_p(2,'android-%s', cfg.androidminapi)\nend\nif cfg.androidarch " - "then\n_p(2,'%s', cfg.androidarch)\nend\nif cfg.androidndktoolchainversion then\n_p(2,'%s', cfg.androidndktoolchainversion)\nend\nif cfg.androidstltype then\n_p(2,'%s', cfg.androidstltype)\nend\nend\nif cfg.platform == \"NX32\" or cfg.platform == \"NX64\" then\n_p(2,'$(NINTENDO_SDK_ROOT)\\\\')\n_p(2,'NX')\nif premake.config.isdebugbuild(cfg) then\n_p(2,'Debug')\nelse\n_p(2,'Release')\nend\nend\nif cfg.flags.Symbols and (premake.action.current() == premake.action.get(\"vs2017\") or is2019) then\n_p(2, 'true')\nend\n_p(1,'')\nend\nlocal function import_props(prj)\nfor _, cfginfo in ipairs(prj.solution.vstudio_configs) do\nlocal cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform)\n_p(1,''\n,premake.esc(cfginfo.name))\n_p(2,'')\nif #cfg.propertysheets > 0 then\nlocal dirs = cfg.propertysheets\nfor _, dir in ipairs(dirs) do\n_p(2,'', path.translate(dir))\nend\nend\n_p(1,'')\nend\nend\nlocal function add_trailing_backslash(dir)\nif dir:len() > 0 and dir:sub(-1) ~= \"\\\\\" then\nreturn dir..\"\\\\\"\nend\nreturn dir\nend\nfunction vc2010.outputProperties(prj)\nfor _, cfginfo in ipairs(prj.solution.vstudio_configs) do\nlocal cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform)\nlocal target = cfg.buildtarget\nlocal outdir = add_trailing_backslash(target.directory)\nlocal intdir = add_trailing_backslash(iif(action.vstudio.intDirAbsolute\n, path.translate(\n path.join(prj.solution.locati" - "on, cfg.objectsdir)\n, '\\\\')\n, cfg.objectsdir\n))\n_p(1,'', premake.esc(cfginfo.name))\n_p(2,'%s', iif(outdir:len() > 0, premake.esc(outdir), \".\\\\\"))\nif cfg.platform == \"Xbox360\" then\n_p(2,'$(OutDir)%s', premake.esc(target.name))\nend\n_p(2,'%s', premake.esc(intdir))\n_p(2,'%s', premake.esc(path.getbasename(target.name)))\n_p(2,'%s', premake.esc(path.getextension(target.name)))\nif cfg.kind == \"SharedLib\" then\nlocal ignore = (cfg.flags.NoImportLib ~= nil)\n_p(2,'%s', tostring(ignore))\nend\nif cfg.platform == \"Durango\" then\n_p(2, '$(Console_SdkLibPath);$(Console_SdkWindowsMetadataPath)')\n_p(2, '$(Console_SdkLibPath)')\n_p(2, '$(Console_SdkLibPath);$(Console_SdkWindowsMetadataPath)')\n_p(2, '$(Console_" - "SdkIncludeRoot)')\n_p(2, '$(Console_SdkRoot)bin;$(VCInstallDir)bin\\\\x86_amd64;$(VCInstallDir)bin;$(WindowsSDK_ExecutablePath_x86);$(VSInstallDir)Common7\\\\Tools\\\\bin;$(VSInstallDir)Common7\\\\tools;$(VSInstallDir)Common7\\\\ide;$(ProgramFiles)\\\\HTML Help Workshop;$(MSBuildToolsPath32);$(FxCopDir);$(PATH);')\nif cfg.imagepath then\n_p(2, '%s', cfg.imagepath)\nelse\n_p(2, '%s', prj.name)\nend\nif cfg.pullmappingfile ~= nil then\n_p(2,'%s', premake.esc(cfg.pullmappingfile))\nend\n_p(2, '*.pdb;*.ilk;*.exp;*.lib;*.winmd;*.appxrecipe;*.pri;*.idb')\n_p(2, 'true')\nend\nif cfg.kind ~= \"StaticLib\" then\n_p(2,'%s', tostring(premake.config.isincrementallink(cfg)))\nend\nif cfg.applicationdatadir ~= nil then\n_p(2,'%s', premake.esc(cfg.applicationdatadir))\nend\nif cfg.flags.NoManifest then\n_p(2,'false')\nend\n_p(1,'')\nend\nend\nlocal function runtime(cfg)\nlocal runtime\nlocal flags = cfg.flags\nif premake.config.isdebugbuild(cfg) then\nruntime = iif(flags.StaticRuntime and not flags.Managed, \"MultiThreadedDebug\", \"MultiThreadedDebugDLL\")\nelse\nruntime = iif(flags.StaticRuntime and not flags.Managed, \"MultiThreaded\", \"MultiThreadedDLL\")\nend\nreturn runtime\nend\nlocal function precompiled_header(cfg)\n if not cfg.flags.NoPCH and cfg.pchheader then\n_p(3,'Use')\n_p(3,'%s', cfg.pchheader)\nelse\n_p(3,'')\nend\nend\nlocal function preprocessor(indent,cfg,escape)\nif #cfg.defines > 0 then\nlocal defines = table.concat(cfg.defines, \";\")\nif escape then\ndefines = defines:gsub('\"', '\\\\\"')\nend\nlocal isPreprocessorDef" - "initionPresent = string.find(defines, \"%%%(PreprocessorDefinitions%)\")\nif isPreprocessorDefinitionPresent then\n_p(indent,'%s'\n,premake.esc(defines))\nelse\n_p(indent,'%s;%%(PreprocessorDefinitions)'\n,premake.esc(defines))\nend\nelse\n_p(indent,'')\nend\nend\nlocal function include_dirs(indent,cfg)\nlocal includedirs = table.join(cfg.userincludedirs, cfg.includedirs, cfg.systemincludedirs)\nif #includedirs> 0 then\n_p(indent,'%s;%%(AdditionalIncludeDirectories)'\n,premake.esc(path.translate(table.concat(includedirs, \";\"), '\\\\')))\nend\nend\nlocal function using_dirs(indent,cfg)\nif #cfg.usingdirs > 0 then\n_p(indent,'%s;%%(AdditionalUsingDirectories)'\n,premake.esc(path.translate(table.concat(cfg.usingdirs, \";\"), '\\\\')))\nend\nend" - "\nlocal function resource_compile(cfg)\n_p(2,'')\npreprocessor(3,cfg,true)\ninclude_dirs(3,cfg)\n_p(2,'')\nend\nlocal function cppstandard_vs2017_or_2019(cfg)\nif cfg.flags.CppLatest then\n_p(3, 'stdcpplatest')\n_p(3, 'true')\nelseif cfg.flags.Cpp17 then\n_p(3, 'stdcpp17')\nelseif cfg.flags.Cpp14 then\n_p(3, 'stdcpp14')\nend\nend\nlocal function exceptions(cfg)\nif cfg.platform == \"Orbis\" then\nif cfg.flags.NoExceptions then\n_p(3, 'false')\nend\nelseif cfg.platform == \"TegraAndroid\" then\nif cfg.flags.NoExceptions then\n_p(3, 'false')\nend\nelse\nif cfg.flags.NoExceptions then\n_p(3, 'false')\nelseif cfg.flags.SEH then\n_p(3, 'Async')\nend\nend\nend\nlocal function rtti(cfg)\nif c" - "fg.flags.NoRTTI and not cfg.flags.Managed then\n_p(3,'false')\nend\nend\nlocal function calling_convention(cfg)\nif cfg.flags.FastCall then\n_p(3,'FastCall')\nelseif cfg.flags.StdCall then\n_p(3,'StdCall')\nend\nend\nlocal function wchar_t_builtin(cfg)\nif cfg.flags.NativeWChar then\n_p(3,'true')\nelseif cfg.flags.NoNativeWChar then\n_p(3,'false')\nend\nend\nlocal function sse(cfg)\nif cfg.flags.EnableSSE then\n_p(3, 'StreamingSIMDExtensions')\nelseif cfg.flags.EnableSSE2 then\n_p(3, 'StreamingSIMDExtensions2')\nelseif cfg.flags.EnableAVX then\n_p(3, 'AdvancedVectorExtensions')\nelseif cfg.flags.EnableAVX2 then" - "\n_p(3, 'AdvancedVectorExtensions2')\nend\nend\nlocal function floating_point(cfg)\nif cfg.platform == \"Orbis\" then\nif cfg.flags.FloatFast then\n_p(3,'true')\nend\nelseif cfg.platform == \"TegraAndroid\" then\nelse\nif cfg.flags.FloatFast then\n_p(3,'Fast')\nelseif cfg.flags.FloatStrict and not cfg.flags.Managed then\n_p(3,'Strict')\nend\nend\nend\nlocal function debug_info(cfg)\nlocal debug_info = ''\nif cfg.flags.Symbols then\nif cfg.flags.C7DebugInfo then\ndebug_info = \"OldStyle\"\nelseif (action.vstudio.supports64bitEditContinue == false and cfg.platform == \"x64\")\nor not premake.config.iseditandcontinue(cfg)\nthen\ndebug_info = \"ProgramDatabase\"\nelse\ndebug_info = \"EditAndContinue\"\nend\nend\n_p(3,'%s',debug_info)\nend\nlocal function minimal_build(cfg)\nif premake.config.isdebugbuild(" - "cfg) and cfg.flags.EnableMinimalRebuild then\n_p(3,'true')\nelse\n_p(3,'false')\nend\nend\nlocal function compile_language(cfg)\nif cfg.options.ForceCPP then\n_p(3,'CompileAsCpp')\nelse\nif cfg.language == \"C\" then\n_p(3,'CompileAsC')\nend\nend\nend\nlocal function forcedinclude_files(indent,cfg)\nif #cfg.forcedincludes > 0 then\n_p(indent,'%s'\n,premake.esc(path.translate(table.concat(cfg.forcedincludes, \";\"), '\\\\')))\nend\nend\nlocal function vs10_clcompile(cfg)\n_p(2,'')\nlocal unsignedChar = \"/J \"\nlocal buildoptions = cfg.buildoptions\nif cfg.platform == \"Orbis\" then\nunsignedChar = \"-funsigned-char \";\n_p(3,'%s', tostring(cfg.flags.Symbols ~= nil))\nend\nif cfg.language == \"C\" and not cfg.options.ForceCPP then\nbuildoptions = table.join(buildoptions, cfg.buildoptions_c)\nelse\n" - "buildoptions = table.join(buildoptions, cfg.buildoptions_cpp)\nend\n_p(3,'%s %s%%(AdditionalOptions)'\n, table.concat(premake.esc(buildoptions), \" \")\n, iif(cfg.flags.UnsignedChar and cfg.platform ~= \"TegraAndroid\", unsignedChar, \" \")\n)\nif cfg.platform == \"TegraAndroid\" then\n_p(3,'%s', tostring(cfg.flags.UnsignedChar == nil))\n_p(3,'%s', tostring(cfg.flags.Symbols ~= nil))\nif cfg.androidcppstandard then\n_p(3,'%s', cfg.androidcppstandard)\nend\nend\nif cfg.platform == \"Orbis\" then\nlocal opt = optimisation(cfg)\nif opt == \"Disabled\" then\n_p(3,'Level0')\nelseif opt == \"MinSpace\" then\n_p(3,'Levelz') -- Oz is more aggressive than Os\nelseif opt == \"MaxSpeed\" then\n_p(3,'Level3')\nelse\n_p(3,'Level2')\nend\nelseif cfg.platform == \"TegraAndroid\" then\nlocal opt = optimisation(cfg)\nif opt == \"Disabled\" then\n_p(3,'O0')\nelseif opt == \"MinSpace\" then\n_p(3,'Os')\nelseif opt == \"MaxSpeed\" then\n_p(3,'O3')\nelse\n_p(3,'O2')\nend\nelse\n_p(3,'%s', optimisation(cfg))\nend\ninclude_dirs(3, cfg)\nusing_dirs(3, cfg)\npreprocessor(3, cfg)\nminimal_build(cfg)\nif premake.config.isoptimizedbuild(cfg.flags) then\nif cfg.flags.NoOptimizeLink and cfg.flags.NoEditAndContinue then\n_p(3, 'false')\n_p(3, 'false')\nelse\n_p(3, 'true')\n_p(3, 'true')\nend\nelse\n_p(3, 'true')\nif cfg.flags.NoRuntimeChecks then\n_p(3, 'Default')\nelseif not cfg.flags.Managed then\n_p(3, 'EnableFastChecks')\nend\nif cfg.flags.ExtraWarnings then\nend\nend\nif cfg.platform == \"Durango\" or cfg.flags.NoWinRT then\n_p(3, 'false')\nend\n_p(3, '%s', runtime(cfg))\nif cfg.flags.NoBufferSecurityCheck then\n_p(3, 'false')\nend\nif not cfg.flags.NoMultiProcessorCompilation and not cfg.flags.EnableMinimalRebuild then\n_p(3, 'true')\nelse\n_p(3, 'false')\nend\nprecompiled_header(cfg)\nif cfg.platform == \"Orbis\" then\nif cfg.flags.PedanticWarnings then\n_p(3, 'MoreWarnings')\n_p(3, 'true')\nelseif cfg.flags.ExtraWarnings then\n_p(3, 'NormalWarnings')\n_p(3, 'true')\nelseif cfg.flags.MinimumWarnings then\n_p(3, 'WarningsOff')\n_p(3, 'false')\nelse\n_p(3, 'NormalWarnings')\n_p(3, 'false')\nend\nif cfg.flags.FatalWarnings then\n_p(3, 'true')\nend\nelseif cfg.platform == \"TegraAndroid\" then\nif cfg.flags.PedanticWarnings or cfg.flags.ExtraWarnings then\n_p(3, 'AllWarnings')\nelseif cfg.flags.MinimumWarnings then\n_p(3, 'DisableAllWarnings')\nelse\n_p(3, 'NormalWarnings')\nend\nif cfg.flags.FatalWarnings then\n_p(3, 'true')\nend\nelse\nif cfg.flags.PedanticWarnings then\n_p(3, 'EnableAllWarnings')\nelseif cfg.flags.ExtraWarnings then\n_p(3, 'Level4')\nelseif cfg.flags.MinimumWarnings then\n_p(3, 'Level1')\nelse\n_p(3 ,'Level3')\nend\nend\nif cfg.flags.FatalWarnings then\n_p(3, 'true')\nend\nif premake.action.current() == premake.action.get(\"vs2017\") or\n premake.action.current() == premake.action.get(\"vs2019\") then\ncppstandard_vs2017_or_2019(cfg)\nend\nexceptions(cfg)\nrtti(cfg)\ncalling_convention(cfg)\nwchar_t_builtin(cfg)\nsse(cfg)\nfloating_point(cfg)\ndebug_info(cfg)\nif _ACTION:sub(3) == \"llvm\" then\n_p(3,'false')\nend\nif cfg.flags.Symbols then\nif cfg.kind == \"StaticLib\" then\n_p(3, '$(OutDir)%s.pdb'\n, path.getbasename(cfg.buildtarget.name)\n)\nelse\n_p(3, '$(IntDir)%s.compile.pdb'\n, path.getbasename(cfg.buildtarget.name)\n)\nend\nend\nif cfg.flags.Hotpatchable then\n_p(3, 'true')\nend\nif cfg.flags.NoFramePointer then\n_p(3, 'true')" - "\nend\nif cfg.flags.UseFullPaths then\n_p(3, 'true')\nend\nif cfg.flags.NoJMC then\n_p(3,'false' )\nend\ncompile_language(cfg)\nforcedinclude_files(3,cfg);\nif vstudio.diagformat then\n_p(3, '%s', vstudio.diagformat)\nelse\n_p(3, 'Caret')\nend\n_p(2,'')\nend\nlocal function event_hooks(cfg)\nif #cfg.postbuildcommands> 0 then\n _p(2,'')\n_p(3,'%s',premake.esc(table.implode(cfg.postbuildcommands, \"\", \"\", \"\\r\\n\")))\n_p(2,'')\nend\nif #cfg.prebuildcommands> 0 then\n _p(2,'')\n_p(3,'%s',premake.esc(table.implode(cfg.prebuildcommands, \"\", \"\", \"\\r\\n\")))\n_p(2,'')\nend\nif #cfg.prelinkcommands> 0 then\n _p(2,'')\n_p(3,'%s',premake.esc(table.implode(cfg.prelinkcommands, \"\", \"\", \"\\r\\n\")))\n_p(2,'')\nend\nend\nlocal function additional_options(indent,cfg)\nif #cfg.linkoptions > 0 then\n_p(indent,'%s %%(AdditionalOptions)',\ntable.concat(premake.esc(cfg.linkoptions), \" \"))\nend\nend\nlocal function link_target_machine(index,cfg)\nlocal platforms = {x32 = 'MachineX86', x64 = 'MachineX64'}\nif platforms[cfg.platform] then\n_p(index,'%s', platforms[cfg.platform])\nend\nend\nlocal function item_def_lib(prj, cfg)\nif cfg.kind == 'StaticLib' and cfg.platform ~= \"Xbox360\" then\n_p(1,'')\n_p(2,'$(OutDir)%s',cfg.buildtarget.name)\nadditional_options(2,cfg)\nlink_target_machine(2,cfg)\nif _ACTION:sub(3) == \"llvm\" and prj.name == \"portaudio\" then -- MSVC-LLVM needs special help\n_p(2,'ksuser.lib;%%(AdditionalDependencies)')\nend\n_p(1,'')\nend\nend\nlocal function import_lib(cfg)\nif cfg.kind == \"SharedLib\" then\nlocal implibname = cfg.linkt" - "arget.fullpath\n_p(3,'%s',iif(cfg.flags.NoImportLib, cfg.objectsdir .. \"\\\\\" .. path.getname(implibname), implibname))\nend\nend\nlocal function hasmasmfiles(prj)\nlocal files = vc2010.getfilegroup(prj, \"MASM\")\nreturn #files > 0\nend\nlocal function ismanagedprj(prj, cfgname, pltname)\nlocal cfg = premake.getconfig(prj, cfgname, pltname)\nreturn cfg.flags.Managed == true\nend\nlocal function getcfglinks(cfg)\nlocal haswholearchive = #cfg.wholearchive > 0\nlocal msvcnaming = premake.getnamestyle(cfg) == \"windows\"\nlocal iscppprj = premake.iscppproject(cfg)\nlocal isnetprj = premake.isdotnetproject(cfg)\nlocal linkobjs = {}\nlocal links = iif(haswholearchive\n, premake.getlinks(cfg, \"all\", \"object\")\n, premake.getlinks(cfg, \"system\", \"fullpath\")\n)\nfor _, link in ipairs(links) do\nlocal name = nil\nlocal directory = nil\nlocal whole = nil\nif type(link) == \"table\" then\nif not ismanagedprj(link.project, cfg.name, cfg.platform) then\n" - "name = link.linktarget.basename\ndirectory = path.rebase(link.linktarget.directory, link.location, cfg.location)\nwhole = table.icontains(cfg.wholearchive, link.project.name)\nend\nelse\nname = link\nwhole = table.icontains(cfg.wholearchive, link)\nend\nif name then\nif haswholearchive and msvcnaming then\nif iscppprj then\nname = name .. \".lib\"\nelseif isnetprj then\nname = name .. \".dll\"\nend\nend\ntable.insert(linkobjs, {name=name, directory=directory, wholearchive=whole})\nend\nend\nreturn linkobjs\nend\nlocal function vs10_masm(prj, cfg)\nif hasmasmfiles(prj) then\n_p(2, '')\n_p(3,'%s %%(AdditionalOptions)'\n, table.concat(premake.esc(table.join(cfg.buildoptions, cfg.buildoptions_asm)), \" \")\n)\nlocal includedirs = table.join(cfg.userincludedirs, cfg.includedirs, cfg.systemincludedirs)\nif #includedirs > 0 then\n_p(3, '%s;%%(IncludePaths)'\n, premake.esc(path.translate(table.concat(includedirs, \";\"), '\\\\'" - "))\n)\nend\nlocal defines = table.join(cfg.defines)\ntable.insertflat(defines, iif(premake.config.isdebugbuild(cfg), \"_DEBUG\", {}))\ntable.insert(defines, iif(cfg.platform == \"x64\", \"_WIN64\", \"_WIN32\"))\ntable.insert(defines, iif(prj.kind == \"SharedLib\", \"_EXPORT=EXPORT\", \"_EXPORT=\"))\n_p(3, '%s;%%(PreprocessorDefinitions)'\n, premake.esc(table.concat(defines, \";\"))\n)\nif cfg.flags.FatalWarnings then\n_p(3,'true')\nend\nif cfg.flags.MinimumWarnings then\n_p(3,'0')\nelse\n_p(3,'3')\nend\n_p(2, '')\nend\nend\nlocal function additional_manifest(cfg)\nif(cfg.dpiawareness ~= nil) then\n_p(2,'')\nif(cfg.dpiawareness == \"None\") then\n_p(3, 'false')\nend\nif(cfg.dpiawareness == \"High\") then\n_p(3, 'true')\nend\nif(cfg.dpiawareness == \"HighPerMoni" - "tor\") then\n_p(3, 'PerMonitorHighDPIAware')\nend\n_p(2,'')\nend\nend\nfunction vc2010.link(cfg)\nlocal vs2017OrLater = premake.action.current() == premake.action.get(\"vs2017\") or\n premake.action.current() == premake.action.get(\"vs2019\")\nlocal vsllvm = premake.action.current() == premake.action.get(\"vsllvm\")\nlocal links = getcfglinks(cfg)\n_p(2,'')\n_p(3,'%s', iif(cfg.kind == \"ConsoleApp\", \"Console\", \"Windows\"))\nif (vs2017OrLater or vsllvm) and cfg.flags.FullSymbols then\n_p(3,'DebugFull')\nelse\n_p(3,'%s', tostring(cfg.flags.Symbols ~= nil))\nend\nif cfg.flags.Symbols then\n_p(3, '$(OutDir)%s.pdb'\n, path.getbasename(cfg.buildtarget.name)\n)\nend\nif premake.config.islinkeroptimizedbuild(cfg.flags) then\nif cfg.platform == \"Orbis\" then\n_p(3,'Stri" - "pFuncsAndData')\n_p(3,'true')\nelse\n_p(3,'true')\n_p(3,'true')\nend\nelseif cfg.platform == \"Orbis\" and premake.config.iseditandcontinue(cfg) then\n_p(3,'true')\nend\nif cfg.finalizemetasource ~= nil then\n_p(3,'%s', premake.esc(cfg.finalizemetasource))\nend\nif cfg.kind ~= 'StaticLib' then\nvc2010.additionalDependencies(3, cfg, links)\nvc2010.additionalLibraryDirectories(3, cfg, links)\n_p(3,'$(OutDir)%s', cfg.buildtarget.name)\nif vc2010.config_type(cfg) == 'Application' and not cfg.flags.WinMain and not cfg.flags.Managed then\nif cfg.flags.Unicode then\n_p(3,'wmainCRTStartup')\nelse\n_p(3,'mainCRTStartup')\nend\nend\nimport_lib(cfg)\nlocal deffile = premake.findfile(cfg, \".def\")\nif deffile t" - "hen\n_p(3,'%s', deffile)\nend\nlink_target_machine(3,cfg)\nadditional_options(3,cfg)\nif cfg.flags.NoWinMD and vstudio.iswinrt() and prj.kind == \"WindowedApp\" then\n_p(3,'false' )\nend\nend\nif cfg.platform == \"TegraAndroid\" then\nif cfg.androidlinker then\n_p(3,'%s',cfg.androidlinker)\nend\nend\nif cfg.flags.Hotpatchable then\n_p(3, 'Enabled')\nend\nif cfg.flags.GenerateMapFiles then\n_p(3, 'true')\nend\n_p(2,'')\nif #cfg.wholearchive > 0 then\n_p(2, '')\n_p(3, 'false')\n_p(2, '')\nend\nend\nfunction vc2010.additionalLibraryDirectories(tab, cfg, links)\nlocal dirs = cfg.libdirs\nfor _, link in ipairs(links) do\nif link.directory and not table.icontains(dirs, link.directory) then\ntable.insert(dirs, link.directo" - "ry)\nend\nend\n_p(tab, '%s;%%(AdditionalLibraryDirectories)'\n, premake.esc(path.translate(table.concat(dirs, ';'), '\\\\'))\n)\nend\nfunction vc2010.additionalDependencies(tab, cfg, links)\nif #links > 0 then\nlocal deps = \"\"\nif cfg.platform == \"Orbis\" then\nlocal iswhole = false\nfor _, link in ipairs(links) do\nif link.wholearchive and not iswhole then\ndeps = deps .. \"--whole-archive;\"\niswhole = true\nelseif not link.wholearchive and iswhole then\ndeps = deps .. \"--no-whole-archive;\"\niswhole = false\nend\ndeps = deps .. \"-l\" .. link.name .. \";\"\nend\nelse\nfor _, link in ipairs(links) do\nif link.wholearchive then\ndeps = deps .. \"/WHOLEARCHIVE:\" .. link.name .. \";\"\nelse\ndeps = deps .. link.name .. \";\"\nend\nend\nend\nif cfg.platform == \"TegraAndroid\" then\ndeps = \"-Wl,--start-group;\" .. deps .. \";-Wl,--end-group\"\nend\n_p(tab, '%s;%s'\n, deps\n, iif(cfg.platform == \"D" - "urango\"\n, '%(XboxExtensionsDependencies)'\n, '%(AdditionalDependencies)'\n)\n)\nelseif cfg.platform == \"Durango\" then\n_p(tab, '%%(XboxExtensionsDependencies)')\nend\nend\nfunction ant_build(prj, cfg)\nif cfg.platform == \"TegraAndroid\" then\nlocal files = vc2010.getfilegroup(prj, \"AndroidBuild\")\n_p(2,'')\nif #files > 0 then\n_p(3,'%s',path.translate(files[1].name))\nend\nlocal isdebugbuild = premake.config.isdebugbuild(cfg)\n_p(3,'%s',iif(isdebugbuild, 'Debug','Release'))\n_p(3,'%s',tostring(cfg.flags.AntBuildDebuggable ~= nil))\nif #cfg.antbuildjavasourcedirs > 0 then\nlocal dirs = table.concat(cfg.antbuildjavasourcedirs,\";\")\n_p(3,'%s',dirs)\nend\nif #cfg.antbuildjardirs > 0 then\nlocal dirs = table.concat(cfg.antbuildjardirs,\";\")\n_p(3,'%s',dirs)\nend\nif #cfg.antbuildja" - "rdependencies > 0 then\nlocal dirs = table.concat(cfg.antbuildjardependencies,\";\")\n_p(3,'%s',dirs)\nend\nif #cfg.antbuildnativelibdirs > 0 then\nlocal dirs = table.concat(cfg.antbuildnativelibdirs,\";\")\n_p(3,'%s',dirs)\nend\nif #cfg.antbuildnativelibdependencies > 0 then\nlocal dirs = table.concat(cfg.antbuildnativelibdependencies,\";\")\n_p(3,'%s',dirs)\nend\nif #cfg.antbuildassetsdirs > 0 then\nlocal dirs = table.concat(cfg.antbuildassetsdirs,\";\")\n_p(3,'%s',dirs)\nend\n_p(2,'')\nend\nend\nlocal function item_definitions(prj)\nfor _, cfginfo in ipairs(prj.solution.vstudio_configs) do\nlocal cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform)\n_p(1,''\n,premake.esc(cfginfo.name))\nvs10_clcompile(cfg)\nresource_compile(cfg)\nitem_def_lib(prj, cfg)\nvc2010." - "link(cfg)\nant_build(prj, cfg)\nevent_hooks(cfg)\nvs10_masm(prj, cfg)\nadditional_manifest(cfg)\n_p(1,'')\nend\nend\nfunction vc2010.getfilegroup(prj, group)\nlocal sortedfiles = prj.vc2010sortedfiles\nif not sortedfiles then\nsortedfiles = {\nClCompile = {},\nClInclude = {},\nMASM = {},\nObject = {},\nNone = {},\nResourceCompile = {},\nAppxManifest = {},\nAndroidBuild = {},\nNatvis = {},\nImage = {},\nDeploymentContent = {}\n}\nlocal foundAppxManifest = false\nfor file in premake.project.eachfile(prj, true) do\nif path.issourcefilevs(file.name) then\ntable.insert(sortedfiles.ClCompile, file)\nelseif path.iscppheader(file.name) then\nif not table.icontains(prj.removefiles, file) then\ntable.insert(sortedfiles.ClInclude, file)\nend\nelseif path.isobjectfile(file.name) then\ntable.insert(sortedfiles.Object, file)\nelseif path.isresourcefile(file.name) then\ntable.insert(sortedfiles.ResourceCompile, file)\nelseif path.isimagefile(file.name) then\ntable.insert(sortedfiles.Image, file)\nelseif" - " path.isappxmanifest(file.name) then\nfoundAppxManifest = true\ntable.insert(sortedfiles.AppxManifest, file)\nelseif path.isandroidbuildfile(file.name) then\ntable.insert(sortedfiles.AndroidBuild, file)\nelseif path.isnatvis(file.name) then\ntable.insert(sortedfiles.Natvis, file)\nelseif path.isasmfile(file.name) then\ntable.insert(sortedfiles.MASM, file)\nelseif file.flags and table.icontains(file.flags, \"DeploymentContent\") then\ntable.insert(sortedfiles.DeploymentContent, file)\nelse\ntable.insert(sortedfiles.None, file)\nend\nend\nif vstudio.iswinrt() and prj.kind == \"WindowedApp\" and not foundAppxManifest then\nvstudio.needAppxManifest = true\nlocal fcfg = {}\nfcfg.name = prj.name .. \"/Package.appxmanifest\"\nfcfg.vpath = premake.project.getvpath(prj, fcfg.name)\ntable.insert(sortedfiles.AppxManifest, fcfg)\nlocal logo = {}\nlogo.name = prj.name .. \"/Logo.png\"\nlogo.vpath = logo.name\ntable.insert(sortedfiles.Image, logo)\nlocal smallLogo = {}\nsmallLogo.name = prj.name .. \"/SmallLogo.png\"\nsma" - "llLogo.vpath = smallLogo.name\ntable.insert(sortedfiles.Image, smallLogo)\nlocal storeLogo = {}\nstoreLogo.name = prj.name .. \"/StoreLogo.png\"\nstoreLogo.vpath = storeLogo.name\ntable.insert(sortedfiles.Image, storeLogo)\nlocal splashScreen = {}\nsplashScreen.name = prj.name .. \"/SplashScreen.png\"\nsplashScreen.vpath = splashScreen.name\ntable.insert(sortedfiles.Image, splashScreen)\nend\nprj.vc2010sortedfiles = sortedfiles\nend\nreturn sortedfiles[group]\nend\nfunction vc2010.files(prj)\nvc2010.simplefilesgroup(prj, \"ClInclude\")\nvc2010.compilerfilesgroup(prj)\nvc2010.simplefilesgroup(prj, \"Object\")\nvc2010.simplefilesgroup(prj, \"None\")\nvc2010.customtaskgroup(prj)\nvc2010.simplefilesgroup(prj, \"ResourceCompile\")\nvc2010.simplefilesgroup(prj, \"AppxManifest\")\nvc2010.simplefilesgroup(prj, \"AndroidBuild\")\nvc2010.simplefilesgroup(prj, \"Natvis\")\nvc2010.deploymentcontentgroup(prj, \"Image\")\nvc2010.deploymentcontentgroup(prj, \"DeploymentContent\", \"None\")\nend\nfunction vc2010.customtaskg" - "roup(prj)\nlocal files = { }\nfor _, custombuildtask in ipairs(prj.custombuildtask or {}) do\nfor _, buildtask in ipairs(custombuildtask or {}) do\nlocal fcfg = { }\nfcfg.name = path.getrelative(prj.location,buildtask[1])\nfcfg.vpath = path.trimdots(fcfg.name)\ntable.insert(files, fcfg)\nend\nend\nif #files > 0 then\n_p(1,'')\nlocal groupedBuildTasks = {}\nlocal buildTaskNames = {}\nfor _, custombuildtask in ipairs(prj.custombuildtask or {}) do\nfor _, buildtask in ipairs(custombuildtask or {}) do\nif (groupedBuildTasks[buildtask[1]] == nil) then\ngroupedBuildTasks[buildtask[1]] = {}\ntable.insert(buildTaskNames, buildtask[1])\nend\ntable.insert(groupedBuildTasks[buildtask[1]], buildtask)\nend\nend\nfor _, name in ipairs(buildTaskNames) do\ncustombuildtask = groupedBuildTasks[name]\n_p(2,'', path.translate(path.getrelative(prj.location,name), \"\\\\\"))\n_p(3,'Text')\nlocal cmd = \"\"\nlocal outputs = \"\"\nfor _, buildtask in ipairs(custombuildt" - "ask or {}) do\nfor _, cmdline in ipairs(buildtask[4] or {}) do\ncmd = cmd .. cmdline\nlocal num = 1\nfor _, depdata in ipairs(buildtask[3] or {}) do\ncmd = string.gsub(cmd,\"%$%(\" .. num ..\"%)\", string.format(\"%s \",path.getrelative(prj.location,depdata)))\nnum = num + 1\nend\ncmd = string.gsub(cmd, \"%$%(<%)\", string.format(\"%s \",path.getrelative(prj.location,buildtask[1])))\ncmd = string.gsub(cmd, \"%$%(@%)\", string.format(\"%s \",path.getrelative(prj.location,buildtask[2])))\ncmd = cmd .. \"\\r\\n\"\nend\noutputs = outputs .. path.getrelative(prj.location,buildtask[2]) .. \";\"\nend\n_p(3,'%s',cmd)\n_p(3,'%s%%(Outputs)',outputs)\n_p(3,'Designer')\n_p(3,'')\n_p(2,'')\nend\n_p(1,'')\nend\nend\nfunction vc2010.simplefilesgroup(prj, section, subtype)\nlocal configs = prj.solution.vstudio_configs\nlocal files = vc2010.getfilegroup(prj, section)\nif #files > 0 then\nlocal config_mappings = {}\nfor _, cfg" - "info in ipairs(configs) do\nlocal cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform)\nif cfg.pchheader and cfg.pchsource and not cfg.flags.NoPCH then\nconfig_mappings[cfginfo] = path.translate(cfg.pchsource, \"\\\\\")\nend\nend\n_p(1,'')\nfor _, file in ipairs(files) do\nlocal prjexcluded = table.icontains(prj.excludes, file.name)\nlocal excludedcfgs = {}\nif not prjexcluded then\nfor _, vsconfig in ipairs(configs) do\nlocal cfg = premake.getconfig(prj, vsconfig.src_buildcfg, vsconfig.src_platform)\nlocal fileincfg = table.icontains(cfg.files, file.name)\nlocal cfgexcluded = table.icontains(cfg.excludes, file.name)\nif not fileincfg or cfgexcluded then\ntable.insert(excludedcfgs, vsconfig.name)\nend\nend\nend\nif subtype or prjexcluded or #excludedcfgs > 0 then\n_p(2, '<%s Include=\\\"%s\\\">', section, path.translate(file.name, \"\\\\\"))\nif prjexcluded then\n_p(3, 'true')\nelse\nfor _, cfgname in ipairs(excludedcfgs) do\n_p(3, 'true'\n, premake.esc(cfgname)\n)\nend\nend\nif subtype then\n_p(3, '%s', subtype)\nend\n_p(2,'', section)\nelse\n_p(2, '<%s Include=\\\"%s\\\" />', section, path.translate(file.name, \"\\\\\"))\nend\nend\n_p(1,'')\nend\nend\nfunction vc2010.deploymentcontentgroup(prj, section, filetype)\nif filetype == nil then\nfiletype = section\nend\nlocal files = vc2010.getfilegroup(prj, section)\nif #files > 0 then\n_p(1,'')\nfor _, file in ipairs(files) do\n_p(2,'<%s Include=\\\"%s\\\">', filetype, path.translate(file.name, \"\\\\\"))\n_p(3,'true')\n_p(3,'%s', path.translate(file.vpath, \"\\\\\"))\n_p(2,'', filetype)\nend\n_p(1,'')\nend\nend\nfunction vc2010.compilerfilesgroup(prj)\nlocal configs = prj.solution.vstudio_configs\nlocal files = vc2010.getfilegroup(prj, \"ClCompile\")\nif #files > 0 then\nlocal config_mappings = {}\nfor _, cf" - "ginfo in ipairs(configs) do\nlocal cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform)\nif cfg.pchheader and cfg.pchsource and not cfg.flags.NoPCH then\nconfig_mappings[cfginfo] = path.translate(cfg.pchsource, \"\\\\\")\nend\nend\n_p(1,'')\nlocal existingBasenames = {};\nfor _, file in ipairs(files) do\nlocal filename = string.lower(path.getbasename(file.name))\nlocal disambiguation = existingBasenames[filename] or 0;\nexistingBasenames[filename] = disambiguation + 1\nlocal translatedpath = path.translate(file.name, \"\\\\\")\n_p(2, '', translatedpath)\nfor _, vsconfig in ipairs(configs) do\nlocal cfg = premake.getconfig(prj, vsconfig.src_buildcfg, vsconfig.src_platform)\nlocal namestyle = premake.getnamestyle(cfg)\nif namestyle == \"TegraAndroid\" or namestyle == \"NX\" then\n_p(3, '$(IntDir)%s.o', premake.esc(vsconfig.name), premake.esc(path.translate(path.trimdots(path.removeext(f" - "ile.name)))) )\nelse\nif disambiguation > 0 then\n_p(3, '$(IntDir)%s\\\\', premake.esc(vsconfig.name), tostring(disambiguation))\nend\nend\nend\nif path.iscxfile(file.name) then\n_p(3, 'true')\n_p(3, 'true')\n_p(3, 'NotUsing')\nend\nif vstudio.iswinrt() and string.len(file.name) > 2 and string.sub(file.name, -2) == \".c\" then\n_p(3,'FALSE')\nend\nfor _, cfginfo in ipairs(configs) do\nif config_mappings[cfginfo] and translatedpath == config_mappings[cfginfo] then\n_p(3,'Create', premake.esc(cfginfo.name))\nconfig_mappings[cfginfo] = nil --only one source file per pch\nend\nend\nlocal nopch = table.icontains(prj.nopch, file.name)\nfor _, vsconfig in ipairs(configs) do\nlocal cfg = premake.getconfig(prj, vsconfig.src_buildcfg, vsconfig." - "src_platform)\nif nopch or table.icontains(cfg.nopch, file.name) then\n_p(3,'NotUsing', premake.esc(vsconfig.name))\nend\nend\nlocal excluded = table.icontains(prj.excludes, file.name)\nfor _, vsconfig in ipairs(configs) do\nlocal cfg = premake.getconfig(prj, vsconfig.src_buildcfg, vsconfig.src_platform)\nlocal fileincfg = table.icontains(cfg.files, file.name)\nlocal cfgexcluded = table.icontains(cfg.excludes, file.name)\nif excluded or not fileincfg or cfgexcluded then\n_p(3, 'true'\n, premake.esc(vsconfig.name)\n)\nend\nend\nif prj.flags and prj.flags.Managed then\nlocal prjforcenative = table.icontains(prj.forcenative, file.name)\nfor _,vsconfig in ipairs(configs) do\nlocal cfg = premake.getconfig(prj, vsconfig.src_buildcfg, vsconfig.src_platform)\nif prjforcenative or table.icontains(cfg.forcenative, file.name) then\n_p(3, 'false', premake.esc(vsconfig.name))\nend\nend\nend\n_p(2,'')\nend\n_p(1,'')\nend\nend\nfunction vc2010.masmfiles(prj)\nlocal configs = prj.solution.vstudio_configs\nlocal files = vc2010.getfilegroup(prj, \"MASM\")\nif #files > 0 then\n_p(1, '')\nfor _, file in ipairs(files) do\nlocal translatedpath = path.translate(file.name, \"\\\\\")\n_p(2, '', translatedpath)\nlocal excluded = table.icontains(prj.excludes, file.name)\nfor _, vsconfig in ipairs(configs) do\nlocal cfg = premake.getconfig(prj, vsconfig.src_buildcfg, vsconfig.src_platform)\nlocal fileincfg = table.icontains(cfg.files, file.name)\nlocal cfgexcluded = table.icontains(cfg.excludes, file.name)\nif excluded or not fileincfg or cfgexcluded then\n_p(3, 'true'\n, premake.esc(vsconfig.name)\n)\nend\nend\n_p(2, '')\nend\n_p(1, '')\nend\nend\nfunction vc2010.header(target" - "s)\nio.eol = \"\\r\\n\"\n_p('')\nlocal t = \"\"\nif targets then\nt = ' DefaultTargets=\"' .. targets .. '\"'\nend\n_p('', t, action.vstudio.toolsVersion)\nend\nfunction premake.vs2010_vcxproj(prj)\nlocal usemasm = hasmasmfiles(prj)\nio.indent = \" \"\nvc2010.header(\"Build\")\nvs2010_config(prj)\nvs2010_globals(prj)\n_p(1,'')\nfor _, cfginfo in ipairs(prj.solution.vstudio_configs) do\nlocal cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform)\nvc2010.configurationPropertyGroup(cfg, cfginfo)\nend\n_p(1,'')\n_p(1,'')\nif usemasm then\n_p(2, '')\nend\n_p(1,'')\nimport_props(prj)\n_p(1,'')\nvc2010.outputProperties(prj)\nitem_definitions(prj)\nvc2010.files(prj)\nvc2010.clrReferences(prj)\nvc2010.projectReferences(prj)\nvc2010.sdkReferences(prj)\nvc2010.masmfiles(prj)\n_p(1,'')\n_p(1,'')\nif usemasm then\n_p(2, '')\nend\n_p(1,'')\n_p('')\nend\nfunction vc2010.clrReferences(prj)\nif #prj.clrreferences == 0 then\nreturn\nend\n_p(1,'')\nfor _, ref in ipairs(prj.clrreferences) do\nif os.isfile(ref) then\nlocal assembly = path.getbasename(ref)\n_p(2,'', assembly)\n_p(3,'%s', path.getrelative(prj.location, ref))\n_p(2,'')\nelse\n_p(2,'', ref)\nend\nend\n_p(1,'')\nend\nfunction vc2010.projectReferences(prj)\nlocal deps = premake.getdependencies(prj)\nif #deps == 0 and " - "#prj.vsimportreferences == 0 then\nreturn\nend\nlocal function compareuuid(a, b) return a.uuid < b.uuid end\ntable.sort(deps, compareuuid)\ntable.sort(table.join(prj.vsimportreferences), compareuuid)\n_p(1,'')\nfor _, dep in ipairs(deps) do\nlocal deppath = path.getrelative(prj.location, vstudio.projectfile(dep))\n_p(2,'', path.translate(deppath, \"\\\\\"))\n_p(3,'{%s}', dep.uuid)\nif vstudio.iswinrt() then\n_p(3,'false')\nend\n_p(2,'')\nend\nfor _, ref in ipairs(prj.vsimportreferences) do\nlocal slnrelpath = path.rebase(ref, prj.location, sln.location)\nlocal iprj = premake.vstudio.getimportprj(slnrelpath, prj.solution)\n_p(2,'', ref)\n_p(3,'{%s}', iprj.uuid)\n_p(2,'')\nend\n_p(1,'')\nend\nfunction vc2010.sdkReferences(prj)\nlocal refs = prj.sdkreferences\nif #refs > 0 then\n_p(1,'')\nfor _, ref in ipairs(refs) do\n_p(2,'', ref)\nend\n_p(1,'')\nend\nend\nfunction vc2010.debugdir(cfg)\nlocal isnx = (cfg.platform == \"NX32\" or cfg.platform == \"NX64\")\nlocal debuggerFlavor =\n iif(isnx, 'OasisNXDebugger'\n, iif(cfg.platform == \"Orbis\", 'ORBISDebugger'\n, iif(cfg.platform == \"Durango\", 'XboxOneVCppDebugger'\n, iif(cfg.platform == \"TegraAndroid\", 'AndroidDebugger'\n, iif(vstudio.iswinrt(), 'AppHostLocalDebugger'\n, 'WindowsLocalDebugger'\n)))))\n_p(2, '%s', debuggerFlavor)\nif cfg.debugdir and not vstudio.iswinrt() then\n_p(2, '%s'\n, path.translate(cfg.debugdir, '\\\\')\n)\nend\nif cfg.debugcmd then\n_p(2, '%s', cfg.debugcmd)\nend\nif cfg.debugargs then\n_p(2, '%s'\n, table.concat(cfg.debugargs, \" \")\n)\nend\nif cfg.debugenvs and #cfg.debugenvs > 0 then\n_p(2, '%s%s'\n, table.concat(cfg.debugenvs, \"\\n\")\n, iif(cfg.flags.DebugEnvsInherit,'\\n$(LocalDebuggerEnvironment)', '')\n)\nif cfg.flags.DebugEnvsDontMerge then\n_p(2, 'false')\nend\nend\nif cfg.deploymode then\n_p(2, '%s', cfg.deploymode)\nend\nif cfg.platform == \"TegraAndroid\" then\nif cfg.androiddebugintentparams then\n_p(2, '%s'\n, table.concat(cfg.androiddebugintentparams, \" \")\n)\nend\nend\nend\nfunction premake.vs2010_vcxproj_user(prj)\nio.indent = \" \"\nvc2010.header()\nfor _, cfginfo in ipairs(prj.solution.vstudio_configs) do\nlocal cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform)\n_p(' ', premake.esc(cfginfo.name))\nvc2010.debugdir(cfg)\n_p" - "(' ')\nend\n_p('')\nend\nlocal png1x1data = {\n0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52, -- .PNG........IHDR\n0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x03, 0x00, 0x00, 0x00, 0x25, 0xdb, 0x56, -- .............%.V\n0xca, 0x00, 0x00, 0x00, 0x03, 0x50, 0x4c, 0x54, 0x45, 0x00, 0x00, 0x00, 0xa7, 0x7a, 0x3d, 0xda, -- .....PLTE....z=.\n0x00, 0x00, 0x00, 0x01, 0x74, 0x52, 0x4e, 0x53, 0x00, 0x40, 0xe6, 0xd8, 0x66, 0x00, 0x00, 0x00, -- ....tRNS.@..f...\n0x0a, 0x49, 0x44, 0x41, 0x54, 0x08, 0xd7, 0x63, 0x60, 0x00, 0x00, 0x00, 0x02, 0x00, 0x01, 0xe2, -- .IDAT..c`.......\n0x21, 0xbc, 0x33, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82, -- !.3....IEND.B`.\n}\nfunction png1x1(obj, filename)\nfilename = premake.project.getfilename(obj, filename)\nlocal f, err = io.open(filename, \"wb\")\nif f then\nfor _, byte in ipairs(png1x1data) do\nf:write(string.char(byte))\nend\nf:close()\nend\nend\nfunction premak" - "e.vs2010_appxmanifest(prj)\nio.indent = \" \"\nio.eol = \"\\r\\n\"\n_p('')\nif vstudio.storeapp == \"10.0\" then\n_p('')\nelseif vstudio.storeapp == \"durango\" then\n_p('')\nend\n_p(1, '')\nif vstudio.storeapp == \"10.0\" then\n_p(1, '')\nend\n_p(1, '')\n_p(2, '' .. prj.name .. '')\n_p(2, 'PublisherDisplayName')\n_p(2, '' .. prj.name .. '\\\\StoreLogo.png')\npng1x1(prj, \"%%/StoreLogo.png\")\n_p(2, '' .. prj.name .. '')\n_p(1,'')\nif vstudio.storeapp == \"10.0\" then\n_p(1, '')\n_p(2, '')\n_p(1, '')\nelseif vstudio.storeapp == \"durango\" then\n_p(1, '')\n_p(2, '6.2')\n_p(2, '6.2')\n_p(1, '')\nend\n_p(1, '')\n_p(2, '')\n_p(1, '')\n_p(1, '')\n_p(2, '')\nif vstudio.storeapp == \"10.0\" then\n_p(3, '')\n_p(4, '')\npng1x1(prj, \"%%/SplashScreen.png\")\n_p(3, '')\nelseif vstudio.storeapp == \"durango\" then\n_p(3, '')\n_p(5, '')\npng1x1(prj, \"%%/SplashScreen.png\")\n_p(3, '')\n_p(3, '')\n_p(4, '')\n_p(4, '')\n_p(4, '')\n_p(3, '')\nend\n_p(2, '')\n_p(1, '')\n_p('')\nend\n", + "nimumVisualStudioVersion>')\n_p(2, 'Native')\nelse\n_p(2, 'true')\n_p(2, '12.0')\n_p(2, 'Windows Store')\n_p(2, '%s', vstudio.storeapp)\nend\nelse\n_p(2, 'Win32Proj')\nend\nif not vstudio.xpwarning then\n_p(2, 'false')\nend\n_p(1,'')\nend\nfunction vc2010.config_type(config)\nlocal t =\n{\nSharedLib = \"DynamicLibrary\",\nStaticLib = \"StaticLibrary\",\nConsoleApp = \"Application\",\nWindowedApp = \"Application\"\n}\nreturn t[config.kind]\nend\nlocal function if_config_and_platform()\nreturn 'Condition=\"\\'$(Configuration)|$(Platform)\\'==\\'%s\\'\"'\nend\nlocal function optimisation(cfg)\nlocal result = \"Disabled\"\nfor _, value in ipairs(cfg.flags) do\nif (value == \"Optimize\") then\nresult = \"Full\"\nels" + "eif (value == \"OptimizeSize\") then\nresult = \"MinSpace\"\nelseif (value == \"OptimizeSpeed\") then\nresult = \"MaxSpeed\"\nend\nend\nreturn result\nend\nfunction vc2010.configurationPropertyGroup(cfg, cfginfo)\n_p(1, ''\n, premake.esc(cfginfo.name))\nlocal is2019 = premake.action.current() == premake.action.get(\"vs2019\")\nlocal is2022 = premake.action.current() == premake.action.get(\"vs2022\")\nif is2019 or is2022 then\n _p(2, '%s', action.vstudio.toolsVersion)\nif cfg.flags.UnitySupport then\n _p(2, 'true')\nend\nend\n_p(2, '%s', vc2010.config_type(cfg))\n_p(2, '%s', iif(optimisation(cfg) == \"Disabled\",\"true\",\"false\"))\n_p(2, '%s', premake.vstudio.toolset)\nif os.is64bit() then\n_p(2, 'x64')\nend\nif cfg.flags.Unicode then\n_p(2,'Unicode')\nend\nif cfg.flags.Managed then\n_p(2,'true')\nend\nif cfg.platform == \"TegraAndroid\" then\nif cfg.androidtargetapi then\n_p(2,'android-%s', cfg.androidtargetapi)\nend\nif cfg.androidminapi then\n_p(2,'android-%s', cfg.androidminapi)\nend\nif cfg.androidarch then\n_p(2,'%s', cfg.androidarch)\nend\nif cfg.androidndktoolchainversion then\n_p(2,'%s', cfg.androidndktoolchainversion)\nend\nif cfg.androidstltype then\n_p(2,'%s', cfg.androidstltype)\nend\nend\nif cfg.platform == \"NX32\" or cfg.platform == \"NX64\" then\n_p(2,'$(NINTENDO_SDK_ROOT)\\\\')\n_p(2,'NX')\nif premake.config.isdebugbuild(cfg) then\n_p(2,'Debug')\nelse\n_p(2,'Release')\nend\nend\nif cfg.flags.Symbols and (premake.action.current() == premake.action.get(\"vs2017\") or is2019) then\n_p(2, 'true')\nend\n_p(1,'')\nend\nlocal function import_props(prj)\nfor _, cfginfo in ipairs(prj.solution.vstudio_configs) do\nlocal cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform)\n_p(1,''\n,premake.esc(cfginfo.name))\n_p(2,'')\nif #cfg.propertysheets > 0 then\nlocal dirs = cfg.propertysheets\nfor _, dir in ipairs(dirs) do\nlocal translated = path.translate(dir)\n_p(2,'', translated, translated)\nend\nend\n_p(1,'')\nend\nend\nlocal f" + "unction add_trailing_backslash(dir)\nif dir:len() > 0 and dir:sub(-1) ~= \"\\\\\" then\nreturn dir..\"\\\\\"\nend\nreturn dir\nend\nfunction vc2010.outputProperties(prj)\nfor _, cfginfo in ipairs(prj.solution.vstudio_configs) do\nlocal cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform)\nlocal target = cfg.buildtarget\nlocal outdir = add_trailing_backslash(target.directory)\nlocal intdir = add_trailing_backslash(iif(action.vstudio.intDirAbsolute\n, path.translate(\n path.join(prj.solution.location, cfg.objectsdir)\n, '\\\\')\n, cfg.objectsdir\n))\n_p(1,'', premake.esc(cfginfo.name))\n_p(2,'%s', iif(outdir:len() > 0, premake.esc(outdir), \".\\\\\"))\nif cfg.platform == \"Xbox360\" then\n_p(2,'$(OutDir)%s', premake.esc(target.name))\nend\n_p(2,'%s', premake.esc(intdir))\n_p(2,'%s', premake.esc(path.getbasename(target.name)))\n_p(2,'%s', pr" + "emake.esc(path.getextension(target.name)))\nif cfg.kind == \"SharedLib\" then\nlocal ignore = (cfg.flags.NoImportLib ~= nil)\n_p(2,'%s', tostring(ignore))\nend\nif cfg.platform == \"NX32\" or cfg.platform == \"NX64\" then\nif cfg.flags.Cpp17 then\n_p(2,'Gnu++17')\nelseif cfg.flags.Cpp20 then\n_p(2,'Gnu++20')\nend\nend\nif cfg.platform == \"Durango\" then\n_p(2, '$(Console_SdkLibPath);$(Console_SdkWindowsMetadataPath)')\n_p(2, '$(Console_SdkLibPath)')\n_p(2, '$(Console_SdkLibPath);$(Console_SdkWindowsMetadataPath)')\n_p(2, '$(Console_SdkIncludeRoot)')\n_p(2, '$(Console_SdkRoot)bin;$(VCInstallDir)bin\\\\x86_amd64;$(VCInstallDir)bin;$(WindowsSDK_ExecutablePath_x86);$(VSInstallDir)Common7\\\\Tools\\\\bin;$(VSInstallDir)Common7\\\\tools;$(VSInstallDir)Common7" + "\\\\ide;$(ProgramFiles)\\\\HTML Help Workshop;$(MSBuildToolsPath32);$(FxCopDir);$(PATH);')\nif cfg.imagepath then\n_p(2, '%s', cfg.imagepath)\nelse\n_p(2, '%s', prj.name)\nend\nif cfg.pullmappingfile ~= nil then\n_p(2,'%s', premake.esc(cfg.pullmappingfile))\nend\n_p(2, '*.pdb;*.ilk;*.exp;*.lib;*.winmd;*.appxrecipe;*.pri;*.idb')\n_p(2, 'true')\nend\nif vstudio.isgdkconsole(cfg) then\n_p(2, '$(Console_SdkRoot)bin;$(Console_SdkToolPath);$(ExecutablePath)')\n_p(2, '$(Console_SdkIncludeRoot)')\n_p(2, '$(Console_SdkLibPath);$(Console_SdkWindowsMetadataPath)')\n_p(2, '$(Console_SdkLibPath)')\n_p(2, '$(Console_SdkLibPath);$(Console_SdkWindowsMetadataPath)')\nend\nif vst" + "udio.isgdkdesktop(cfg) then\n_p(2, '$(Console_SdkIncludeRoot);$(IncludePath)')\n_p(2, '$(Console_SdkLibPath);$(LibraryPath)')\nend\nif cfg.kind ~= \"StaticLib\" then\n_p(2,'%s', tostring(premake.config.isincrementallink(cfg)))\nend\nif cfg.applicationdatadir ~= nil then\n_p(2,'%s', premake.esc(cfg.applicationdatadir))\nend\nif cfg.flags.NoManifest then\n_p(2,'false')\nend\n_p(1,'')\nend\nend\nlocal function runtime(cfg)\nlocal runtime\nlocal flags = cfg.flags\nif premake.config.isdebugbuild(cfg) then\nruntime = iif(flags.StaticRuntime and not flags.Managed, \"MultiThreadedDebug\", \"MultiThreadedDebugDLL\")\nelse\nruntime = iif(flags.StaticRuntime and not flags.Managed, \"MultiThreaded\", \"MultiThreadedDLL\")\nend\nreturn runtime\nend\nlocal function precompiled_header(cfg)\n if not cfg.flags.NoPCH and cfg.pchheader then\n_p" + "(3,'Use')\n_p(3,'%s', cfg.pchheader)\nelse\n_p(3,'')\nend\nend\nlocal function preprocessor(indent,cfg,escape)\nif #cfg.defines > 0 then\nlocal defines = table.concat(cfg.defines, \";\")\nif escape then\ndefines = defines:gsub('\"', '\\\\\"')\nend\nlocal isPreprocessorDefinitionPresent = string.find(defines, \"%%%(PreprocessorDefinitions%)\")\nif isPreprocessorDefinitionPresent then\n_p(indent,'%s'\n,premake.esc(defines))\nelse\n_p(indent,'%s;%%(PreprocessorDefinitions)'\n,premake.esc(defines))\nend\nelse\n_p(indent,'')\nend\nend\nlocal function include_dirs(indent,cfg)\nlocal includedirs = table.join(cfg.userincludedirs, cfg.includedirs, cfg.systemincludedirs)\nif #includedirs> 0 then\n_p(indent,'%s;%%(Addi" + "tionalIncludeDirectories)'\n,premake.esc(path.translate(table.concat(includedirs, \";\"), '\\\\')))\nend\nend\nlocal function include_resdirs(indent,cfg)\nif #cfg.resincludedirs> 0 then\n_p(indent,'%s;%%(AdditionalIncludeDirectories)'\n,premake.esc(path.translate(table.concat(cfg.resincludedirs, \";\"), '\\\\')))\nend\nend\nlocal function using_dirs(indent,cfg)\nif #cfg.usingdirs > 0 then\n_p(indent,'%s;%%(AdditionalUsingDirectories)'\n,premake.esc(path.translate(table.concat(cfg.usingdirs, \";\"), '\\\\')))\nend\nend\nlocal function resource_compile(cfg)\n_p(2,'')\npreprocessor(3,cfg,true)\ninclude_resdirs(3,cfg)\n_p(2,'')\nend\nlocal function cppstandard(cfg)\nif cfg.flags.CppLatest then\n_p(3, 'stdcpplatest')\n_p(3, 'true')\nelseif cfg.flags.Cpp20 then\n_p(3, " + "'stdcpp20')\nelseif cfg.flags.Cpp17 then\n_p(3, 'stdcpp17')\nelseif cfg.flags.Cpp14 then\n_p(3, 'stdcpp14')\nend\nend\nlocal function exceptions(cfg)\nif cfg.platform == \"Orbis\" then\nif cfg.flags.NoExceptions then\n_p(3, 'false')\nend\nelseif cfg.platform == \"TegraAndroid\" then\nif cfg.flags.NoExceptions then\n_p(3, 'false')\nend\nelseif cfg.platform == \"NX32\" or cfg.platform == \"NX64\" then\nif cfg.flags.NoExceptions then\n_p(3, 'false')\nelse\n_p(3, 'true')\nend\nelse\nif cfg.flags.NoExceptions then\n_p(3, 'false')\nelseif cfg.flags.SEH then\n_p(3, 'Async')\nend\nend\nend\nlocal function rtti(cfg)\nif cfg.flags.NoRTTI and not cfg.flags.Managed then\n_p(3,'false')\nend\nend\nlocal function calling_convention(cfg)\nif cfg.flags.FastCall then\n_p(3,'FastCall')\nelseif cfg.flags.StdCall then\n_p(3,'StdCall')\nend\nend\nlocal function wchar_t_builtin(cfg)\nif cfg.flags.NativeWChar then\n_p(3,'true')\nelseif cfg.flags.NoNativeWChar then\n_p(3,'false')\nend\nend\nlocal function sse(cfg)\nif cfg.flags.EnableSSE then\n_p(3, 'StreamingSIMDExtensions')\nelseif cfg.flags.EnableSSE2 then\n_p(3, 'StreamingSIMDExtensions2')\nelseif cfg.flags.EnableAVX then\n_p(3, 'AdvancedVectorExtensions')\nelseif cfg.flags.EnableAVX2 then\n_p(3, 'AdvancedVectorExtensions2')\nend\nend\nlocal function floating_point(cfg)\nif cfg.platform == \"Orbis\" then\nif cfg.flags.FloatFast then\n_p(3,'true')\nend\nelseif cfg.platform == \"TegraAndroid\" then\nelseif cfg.platform == \"NX32\" or cfg.platform == \"NX64\" then\nif cfg.flags.FloatFast then\n_p(3, 'true')\nend\nelse\nif cfg.flags.FloatFast then\n_p(3,'Fast')\nelseif cfg.flags.FloatStrict and not cfg.flags.Managed then\n_p(3,'Strict')\nend\nend\nend\nlocal function debug_info(cfg)\nlocal debug_info = ''\nif cfg.flags.Symbols then\nif cfg.flags.C7DebugInfo then\ndebug_info = \"OldStyle\"\nelseif (action.vstudio.supports64bitEditContinue == false and cfg.platform == \"x64\")\nor not premake.config.iseditandcontinue(cfg)\nthen\ndebug_info = \"ProgramDatabase\"\nelse\ndebug_info = \"EditAndContinue\"\nend\nend\n_p(3,'%s',debug_info)\nend\nlocal fun" + "ction minimal_build(cfg)\nif premake.config.isdebugbuild(cfg) and cfg.flags.EnableMinimalRebuild then\n_p(3,'true')\nelse\n_p(3,'false')\nend\nend\nlocal function compile_language(cfg)\nif cfg.options.ForceCPP then\n_p(3,'CompileAsCpp')\nelse\nif cfg.language == \"C\" then\n_p(3,'CompileAsC')\nend\nend\nend\nlocal function forcedinclude_files(indent,cfg)\nif #cfg.forcedincludes > 0 then\n_p(indent,'%s'\n,premake.esc(path.translate(table.concat(cfg.forcedincludes, \";\"), '\\\\')))\nend\nend\nlocal function vs10_clcompile(cfg)\n_p(2,'')\nlocal unsignedChar = \"/J \"\nlocal buildoptions = cfg.buildoptions\nif cfg.platform == \"Orbis\" then\nunsignedChar = \"-funsigned-char \";\n_p(3,'%s', tostring(cfg.flags.Symbols ~= nil))\nend\nif cfg.platform == \"NX32\" or cfg.platform == \"NX64\" then\nunsigned" + "Char = \"-funsigned-char \";\n_p(3,'%s', tostring(cfg.flags.Symbols ~= nil))\nend\nif cfg.language == \"C\" and not cfg.options.ForceCPP then\nbuildoptions = table.join(buildoptions, cfg.buildoptions_c)\nelse\nbuildoptions = table.join(buildoptions, cfg.buildoptions_cpp)\nend\n_p(3,'%s %s%%(AdditionalOptions)'\n, table.concat(premake.esc(buildoptions), \" \")\n, iif(cfg.flags.UnsignedChar and cfg.platform ~= \"TegraAndroid\", unsignedChar, \" \")\n)\nif cfg.platform == \"TegraAndroid\" then\n_p(3,'%s', tostring(cfg.flags.UnsignedChar == nil))\n_p(3,'%s', tostring(cfg.flags.Symbols ~= nil))\nif cfg.androidcppstandard then\n_p(3,'%s', cfg.androidcppstandard)\nend\nend\nif cfg.platform == \"Orbis\" then\nlocal opt = optimisation(cfg)\nif opt == \"Disabled\" then\n_p(3,'Level0')\nelseif opt == \"MinSpace\" then\n_p(3,'Levelz') -- Oz is more aggressive than Os\nelseif opt == \"MaxSpeed\" then\n_p(3,'Level3')\nelse\n_p(3,'Level2')\nend\nelseif cfg.platform == \"TegraAndroid\" then\nlocal opt = optimisation(cfg)\nif opt == \"Disabled\" then\n_p(3,'O0')\nelseif opt == \"MinSpace\" then\n_p(3,'Os')\nelseif opt == \"MaxSpeed\" then\n_p(3,'O3')\nelse\n_p(3,'O2')\nend\nelseif cfg.platform == \"NX32\" or cfg.platform == \"NX64\" then\nlocal opt = optimisation(cfg)\nif opt == \"Disabled\" then\n_p(3,'O0')\nelseif opt == \"MinSpace\" then\n_p(3,'Os')\nelseif opt == \"MaxSpeed\" then\n_p(3,'O3')\nelse" + "\n_p(3,'O2')\nend\nelse\n_p(3,'%s', optimisation(cfg))\nend\ninclude_dirs(3, cfg)\nusing_dirs(3, cfg)\npreprocessor(3, cfg)\nminimal_build(cfg)\nif premake.config.isoptimizedbuild(cfg.flags) then\nif cfg.flags.NoOptimizeLink and cfg.flags.NoEditAndContinue then\n_p(3, 'false')\n_p(3, 'false')\nelse\n_p(3, 'true')\n_p(3, 'true')\nend\nelse\n_p(3, 'true')\nif cfg.flags.NoRuntimeChecks then\n_p(3, 'Default')\nelseif not cfg.flags.Managed then\n_p(3, 'EnableFastChecks')\nend\nif cfg.flags.ExtraWarnings then\nend\nend\nif cfg.platform == \"Durango\" or cfg.flags.NoWinRT then\n_p(3, 'false')\nend\n_p(3, '%s', r" + "untime(cfg))\nif cfg.flags.NoBufferSecurityCheck then\n_p(3, 'false')\nend\nif not cfg.flags.NoMultiProcessorCompilation and not cfg.flags.EnableMinimalRebuild then\n_p(3, 'true')\nelse\n_p(3, 'false')\nend\nprecompiled_header(cfg)\nif cfg.platform == \"Orbis\" then\nif cfg.flags.PedanticWarnings then\n_p(3, 'MoreWarnings')\n_p(3, 'true')\nelseif cfg.flags.ExtraWarnings then\n_p(3, 'NormalWarnings')\n_p(3, 'true')\nelseif cfg.flags.MinimumWarnings then\n_p(3, 'WarningsOff')\n_p(3, 'false')\nelse\n_p(3, 'NormalWarnings')\n_p(3, 'false')\nend\nif cfg.flags.FatalWarnings then\n_p(3, 'true')\nend\nelseif cfg.platform == \"T" + "egraAndroid\" then\nif cfg.flags.PedanticWarnings or cfg.flags.ExtraWarnings then\n_p(3, 'AllWarnings')\nelseif cfg.flags.MinimumWarnings then\n_p(3, 'DisableAllWarnings')\nelse\n_p(3, 'NormalWarnings')\nend\nif cfg.flags.FatalWarnings then\n_p(3, 'true')\nend\nelseif cfg.platform == \"NX32\" or cfg.platform == \"NX64\" then\nif cfg.flags.PedanticWarnings then\n_p(3, 'MoreWarnings')\n_p(3, 'true')\nelseif cfg.flags.ExtraWarnings then\n_p(3, 'NormalWarnings')\n_p(3, 'true')\nelseif cfg.flags.MinimumWarnings then\n_p(3, 'WarningsOff')\n_p(3, 'false')\nelse\n_p(3, 'NormalWarnings')\n_p(3, 'false')\nend\nif cfg.flags.FatalWarnings then\n_p(3, 'true')\nend\nelse\nif cfg.flags." + "PedanticWarnings then\n_p(3, 'EnableAllWarnings')\nelseif cfg.flags.ExtraWarnings then\n_p(3, 'Level4')\nelseif cfg.flags.MinimumWarnings then\n_p(3, 'Level1')\nelse\n_p(3 ,'Level3')\nend\nend\nif cfg.flags.FatalWarnings then\n_p(3, 'true')\nend\nif premake.action.current() == premake.action.get(\"vs2017\") or\n premake.action.current() == premake.action.get(\"vs2019\") or\n premake.action.current() == premake.action.get(\"vs2022\") then\ncppstandard(cfg)\nend\nexceptions(cfg)\nrtti(cfg)\ncalling_convention(cfg)\nwchar_t_builtin(cfg)\nsse(cfg)\nfloating_point(cfg)\ndebug_info(cfg)\nif cfg.flags.Symbols then\nif cfg.kind == \"StaticLib\" then\n_p(3, '$(OutDir)%s.pdb'\n, path.getbasename(cfg.buildtarget.name)\n)\nelse\n_p(3, '$(IntDir)%s.compile.pdb'\n" + ", path.getbasename(cfg.buildtarget.name)\n)\nend\nend\nif cfg.flags.Hotpatchable then\n_p(3, 'true')\nend\nif cfg.flags.NoFramePointer then\n_p(3, 'true')\nend\nif cfg.flags.UseFullPaths then\n_p(3, 'true')\nend\nif cfg.flags.NoJMC then\n_p(3,'false' )\nend\ncompile_language(cfg)\nforcedinclude_files(3,cfg);\nif vstudio.diagformat then\n_p(3, '%s', vstudio.diagformat)\nelse\n_p(3, 'Caret')\nend\n_p(2,'')\nend\nlocal function event_hooks(cfg)\nif #cfg.postbuildcommands> 0 then\n _p(2,'')\n_p(3,'%s',premake.esc(table.implode(cfg.postbuildcommands, \"\", \"\", \"\\r\\n\")))\n_p(2,'')\nend\nif #cfg.prebuildcommands> 0 then\n _p(2,'')\n_p(3,'%s',premake.esc(table.implode(cfg.prebui" + "ldcommands, \"\", \"\", \"\\r\\n\")))\n_p(2,'')\nend\nif #cfg.prelinkcommands> 0 then\n _p(2,'')\n_p(3,'%s',premake.esc(table.implode(cfg.prelinkcommands, \"\", \"\", \"\\r\\n\")))\n_p(2,'')\nend\nend\nlocal function additional_options(indent,cfg)\nif #cfg.linkoptions > 0 then\n_p(indent,'%s %%(AdditionalOptions)',\ntable.concat(premake.esc(cfg.linkoptions), \" \"))\nend\nend\nlocal function link_target_machine(index,cfg)\nlocal platforms = {x32 = 'MachineX86', x64 = 'MachineX64'}\nif platforms[cfg.platform] then\n_p(index,'%s', platforms[cfg.platform])\nend\nend\nlocal function item_def_lib(cfg)\nif cfg.kind == 'StaticLib' and cfg.platform ~= \"Xbox360\" then\n_p(1,'')\n_p(2,'$(OutDir)%s',cfg.buildtarget.name)\nadditional_options(2,cfg)\nlink_target_machine(2,cfg)\n_p(1,'')\nend\nend\nlocal function import_lib(cfg)\nif cfg.kind == \"Shared" + "Lib\" then\nlocal implibname = cfg.linktarget.fullpath\n_p(3,'%s',iif(cfg.flags.NoImportLib, cfg.objectsdir .. \"\\\\\" .. path.getname(implibname), implibname))\nend\nend\nlocal function hasmasmfiles(prj)\nlocal files = vc2010.getfilegroup(prj, \"MASM\")\nreturn #files > 0\nend\nlocal function ismanagedprj(prj, cfgname, pltname)\nlocal cfg = premake.getconfig(prj, cfgname, pltname)\nreturn cfg.flags.Managed == true\nend\nlocal function getcfglinks(cfg)\nlocal haswholearchive = #cfg.wholearchive > 0\nlocal msvcnaming = premake.getnamestyle(cfg) == \"windows\"\nlocal iscppprj = premake.iscppproject(cfg)\nlocal isnetprj = premake.isdotnetproject(cfg)\nlocal linkobjs = {}\nlocal links = iif(haswholearchive\n, premake.getlinks(cfg, \"all\", \"object\")\n, premake.getlinks(cfg, \"system\", \"fullpath\")\n)\nfor _, link in ipairs(links) do\nlocal name = nil\nlocal directory = nil\nlocal whole = nil\nif type(link) == \"table\" then\nif not ismanagedprj(link" + ".project, cfg.name, cfg.platform) then\nname = link.linktarget.basename\ndirectory = path.rebase(link.linktarget.directory, link.location, cfg.location)\nwhole = table.icontains(cfg.wholearchive, link.project.name)\nend\nelse\nname = link\nwhole = table.icontains(cfg.wholearchive, link)\nend\nif name then\nif haswholearchive and msvcnaming then\nif iscppprj then\nname = name .. \".lib\"\nelseif isnetprj then\nname = name .. \".dll\"\nend\nend\ntable.insert(linkobjs, {name=name, directory=directory, wholearchive=whole})\nend\nend\nreturn linkobjs\nend\nlocal function vs10_masm(prj, cfg)\nif hasmasmfiles(prj) then\n_p(2, '')\n_p(3,'%s %%(AdditionalOptions)'\n, table.concat(premake.esc(table.join(cfg.buildoptions, cfg.buildoptions_asm)), \" \")\n)\nlocal includedirs = table.join(cfg.userincludedirs, cfg.includedirs, cfg.systemincludedirs)\nif #includedirs > 0 then\n_p(3, '%s;%%(IncludePaths)'\n, premake.esc(path.translate(" + "table.concat(includedirs, \";\"), '\\\\'))\n)\nend\nlocal defines = table.join(cfg.defines)\ntable.insertflat(defines, iif(premake.config.isdebugbuild(cfg), \"_DEBUG\", {}))\ntable.insert(defines, iif(cfg.platform == \"x64\" or cfg.platform == \"ARM64\", \"_WIN64\", \"_WIN32\"))\ntable.insert(defines, iif(prj.kind == \"SharedLib\", \"_EXPORT=EXPORT\", \"_EXPORT=\"))\n_p(3, '%s;%%(PreprocessorDefinitions)'\n, premake.esc(table.concat(defines, \";\"))\n)\nif cfg.flags.FatalWarnings then\n_p(3,'true')\nend\nif cfg.flags.MinimumWarnings then\n_p(3,'0')\nelse\n_p(3,'3')\nend\n_p(2, '')\nend\nend\nlocal function additional_manifest(cfg)\nif(cfg.dpiawareness ~= nil) then\n_p(2,'')\nif(cfg.dpiawareness == \"None\") then\n_p(3, 'false')\nend\nif(cfg.dpiawareness == \"High\") then\n_p(3, 't" + "rue')\nend\nif(cfg.dpiawareness == \"HighPerMonitor\") then\n_p(3, 'PerMonitorHighDPIAware')\nend\n_p(2,'')\nend\nend\nfunction vc2010.link(cfg)\nlocal vs2017OrLater = premake.action.current() == premake.action.get(\"vs2017\") or\n premake.action.current() == premake.action.get(\"vs2019\")\nlocal links = getcfglinks(cfg)\n_p(2,'')\n_p(3,'%s', iif(cfg.kind == \"ConsoleApp\", \"Console\", \"Windows\"))\nif vs2017OrLater and cfg.flags.FullSymbols then\n_p(3,'DebugFull')\nelse\n_p(3,'%s', tostring(cfg.flags.Symbols ~= nil))\nend\nif cfg.flags.Symbols then\n_p(3, '$(OutDir)%s.pdb'\n, path.getbasename(cfg.buildtarget.name)\n)\nend\nif premake.config.islinkeroptimizedbuild(cfg.flags) then\nif cfg.platform == \"Orbis\" then\n_p(3,'StripFuncsAndData')\n_p(3,'true')\nelse\n_p(3,'true')\n_p(3,'true')\nend\nelseif cfg.platform == \"Orbis\" and premake.config.iseditandcontinue(cfg) then\n_p(3,'true')\nend\nif cfg.finalizemetasource ~= nil then\n_p(3,'%s', premake.esc(cfg.finalizemetasource))\nend\nif cfg.kind ~= 'StaticLib' then\nvc2010.additionalDependencies(3, cfg, links)\nvc2010.additionalLibraryDirectories(3, cfg, links)\n_p(3,'$(OutDir)%s', cfg.buildtarget.name)\nif vc2010.config_type(cfg) == 'Application' and not cfg.flags.WinMain and not cfg.flags.Managed then\nif cfg.flags.Unicode then\n_p(3,'wmainCRTStartup')\nelse\n_p(3,'mainCRTStartup')\nend\nend\nimport_lib(cfg)\nlocal deffile = premake.findfile(cfg, \".def\")\nif deffile then\n_p(3,'%s', deffile)\nend\nlink_target_machine(3,cfg)\nadditional_options(3,cfg)\nif cfg.flags.NoWinMD and vstudio.iswinrt() and prj.kind == \"WindowedApp\" then\n_p(3,'false' )\nend\nend\nif cfg.platform == \"TegraAndroid\" then\nif cfg.androidlinker then\n_p(3,'%s',cfg.androidlinker)\nend\nend\nif cfg.flags.Hotpatchable then\n_p(3, 'Enabled')\nend\nif cfg.flags.GenerateMapFiles then\n_p(3, 'true')\nend\n_p(2,'')\nif #cfg.wholearchive > 0 then\n_p(2, '')\n_p(3, 'false')\n_p(2, '')\nend\nend\nfunction vc2010.additionalLibraryDirectories(tab, cfg, links)\nlocal dirs = cfg.libdirs\nfor _, link in ipairs(links) do\nif link.directory and not table.icontains(dirs, link.directory) then\ntable.insert(dirs, link.directory)\nend\nend\n_p(" + "tab, '%s;%%(AdditionalLibraryDirectories)'\n, premake.esc(path.translate(table.concat(dirs, ';'), '\\\\'))\n)\nend\nfunction vc2010.additionalDependencies(tab, cfg, links)\nif #links > 0 then\nlocal deps = \"\"\nif cfg.platform == \"Orbis\" then\nlocal iswhole = false\nfor _, link in ipairs(links) do\nif link.wholearchive and not iswhole then\ndeps = deps .. \"--whole-archive;\"\niswhole = true\nelseif not link.wholearchive and iswhole then\ndeps = deps .. \"--no-whole-archive;\"\niswhole = false\nend\ndeps = deps .. \"-l\" .. link.name .. \";\"\nend\nelse\nfor _, link in ipairs(links) do\nif link.wholearchive then\ndeps = deps .. \"/WHOLEARCHIVE:\" .. link.name .. \";\"\nelse\ndeps = deps .. link.name .. \";\"\nend\nend\nend\nif cfg.platform == \"TegraAndroid\" then\ndeps = \"-Wl,--start-group;\" .. deps .. \";-Wl,--end-group\"\nend\nlocal adddeps =\n iif(cfg.platform == \"Durango\", '%(XboxExtensionsDependencies)'\n, iif(vstudio.isgdkconsole" + "(cfg), '$(Console_Libs);%(XboxExtensionsDependencies);%(AdditionalDependencies)'\n, iif(vstudio.isgdkdesktop(cfg), '$(Console_Libs);%(AdditionalDependencies)'\n, '%(AdditionalDependencies)')))\n_p(tab, '%s;%s', deps, adddeps)\nelseif cfg.platform == \"Durango\" then\n_p(tab, '%%(XboxExtensionsDependencies)')\nelseif vstudio.isgdkconsole(cfg) then\n_p(tab, '$(Console_Libs);%%(XboxExtensionsDependencies);%%(AdditionalDependencies)')\nelseif vstudio.isgdkdesktop(cfg) then\n_p(tab, '$(Console_Libs);%%(AdditionalDependencies)')\nend\nend\nfunction ant_build(prj, cfg)\nif cfg.platform == \"TegraAndroid\" then\nlocal files = vc2010.getfilegroup(prj, \"AndroidBuild\")\n_p(2,'')\nif #files > 0 then\n_p(3,'%s',path.tran" + "slate(files[1].name))\nend\nlocal isdebugbuild = premake.config.isdebugbuild(cfg)\n_p(3,'%s',iif(isdebugbuild, 'Debug','Release'))\n_p(3,'%s',tostring(cfg.flags.AntBuildDebuggable ~= nil))\nif #cfg.antbuildjavasourcedirs > 0 then\nlocal dirs = table.concat(cfg.antbuildjavasourcedirs,\";\")\n_p(3,'%s',dirs)\nend\nif #cfg.antbuildjardirs > 0 then\nlocal dirs = table.concat(cfg.antbuildjardirs,\";\")\n_p(3,'%s',dirs)\nend\nif #cfg.antbuildjardependencies > 0 then\nlocal dirs = table.concat(cfg.antbuildjardependencies,\";\")\n_p(3,'%s',dirs)\nend\nif #cfg.antbuildnativelibdirs > 0 then\nlocal dirs = table.concat(cfg.antbuildnativelibdirs,\";\")\n_p(3,'%s',dirs)\nend\nif #cfg.antbuildnativelibdependencies > 0 then\nlocal dirs = table.concat(cfg.antbuildnativelibdependencies,\";\")\n_p(3,'%s',dirs)\nend\nif #cfg.antbuildassetsdirs > 0 then\nlocal dirs = table.concat(cfg.antbuildassetsdirs,\";\")\n_p(3,'%s',dirs)\nend\n_p(2,'')\nend\nend\nlocal function item_definitions(prj)\nfor _, cfginfo in ipairs(prj.solution.vstudio_configs) do\nlocal cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform)\n_p(1,''\n,premake.esc(cfginfo.name))\nvs10_clcompile(cfg)\nresource_compile(cfg)\nitem_def_lib(cfg)\nvc2010.link(cfg)\nant_build(prj, cfg)\nevent_hooks(cfg)\nvs10_masm(prj, cfg)\nadditional_manifest(cfg)\n_p(1,'')\nend\nend\nfunction vc2010.getfilegroup(prj, group)\nlocal sortedfiles = prj.vc2010sortedfiles\nif not sortedfiles then\nsortedfiles = {\nClCompile = {},\nClInclude = {},\nMASM = {},\nObject = {},\nNone = {},\nResourceCompile = {},\nAppxManifest = {},\nAndroidBuild = {},\nNatvis = {},\nImage = {},\nDeploymentContent = {}\n}\nlocal foundAppx" + "Manifest = false\nfor file in premake.project.eachfile(prj, true) do\nif path.issourcefilevs(file.name) then\ntable.insert(sortedfiles.ClCompile, file)\nelseif path.iscppheader(file.name) then\nif not table.icontains(prj.removefiles, file) then\ntable.insert(sortedfiles.ClInclude, file)\nend\nelseif path.isobjectfile(file.name) then\ntable.insert(sortedfiles.Object, file)\nelseif path.isresourcefile(file.name) then\ntable.insert(sortedfiles.ResourceCompile, file)\nelseif path.isimagefile(file.name) then\ntable.insert(sortedfiles.Image, file)\nelseif path.isappxmanifest(file.name) then\nfoundAppxManifest = true\ntable.insert(sortedfiles.AppxManifest, file)\nelseif path.isandroidbuildfile(file.name) then\ntable.insert(sortedfiles.AndroidBuild, file)\nelseif path.isnatvis(file.name) then\ntable.insert(sortedfiles.Natvis, file)\nelseif path.isasmfile(file.name) then\ntable.insert(sortedfiles.MASM, file)\nelseif file.flags and table.icontains(file.flags, \"DeploymentContent\") then\ntable.insert(sortedfiles.Deploym" + "entContent, file)\nelse\ntable.insert(sortedfiles.None, file)\nend\nend\nif vstudio.iswinrt() and prj.kind == \"WindowedApp\" and not foundAppxManifest then\nvstudio.needAppxManifest = true\nlocal fcfg = {}\nfcfg.name = prj.name .. \"/Package.appxmanifest\"\nfcfg.vpath = premake.project.getvpath(prj, fcfg.name)\ntable.insert(sortedfiles.AppxManifest, fcfg)\nlocal logo = {}\nlogo.name = prj.name .. \"/Logo.png\"\nlogo.vpath = logo.name\ntable.insert(sortedfiles.Image, logo)\nlocal smallLogo = {}\nsmallLogo.name = prj.name .. \"/SmallLogo.png\"\nsmallLogo.vpath = smallLogo.name\ntable.insert(sortedfiles.Image, smallLogo)\nlocal storeLogo = {}\nstoreLogo.name = prj.name .. \"/StoreLogo.png\"\nstoreLogo.vpath = storeLogo.name\ntable.insert(sortedfiles.Image, storeLogo)\nlocal splashScreen = {}\nsplashScreen.name = prj.name .. \"/SplashScreen.png\"\nsplashScreen.vpath = splashScreen.name\ntable.insert(sortedfiles.Image, splashScreen)\nend\nprj.vc2010sortedfiles = sortedfiles\nend\nreturn sortedfiles[group]\nend" + "\nfunction vc2010.files(prj)\nvc2010.simplefilesgroup(prj, \"ClInclude\")\nvc2010.compilerfilesgroup(prj)\nvc2010.simplefilesgroup(prj, \"Object\")\nvc2010.simplefilesgroup(prj, \"None\")\nvc2010.customtaskgroup(prj)\nvc2010.simplefilesgroup(prj, \"ResourceCompile\")\nvc2010.simplefilesgroup(prj, \"AppxManifest\")\nvc2010.simplefilesgroup(prj, \"AndroidBuild\")\nvc2010.simplefilesgroup(prj, \"Natvis\")\nvc2010.deploymentcontentgroup(prj, \"Image\")\nvc2010.deploymentcontentgroup(prj, \"DeploymentContent\", \"None\")\nend\nfunction vc2010.customtaskgroup(prj)\nlocal files = { }\nfor _, custombuildtask in ipairs(prj.custombuildtask or {}) do\nfor _, buildtask in ipairs(custombuildtask or {}) do\nlocal fcfg = { }\nfcfg.name = path.getrelative(prj.location,buildtask[1])\nfcfg.vpath = path.trimdots(fcfg.name)\ntable.insert(files, fcfg)\nend\nend\nif #files > 0 then\n_p(1,'')\nlocal groupedBuildTasks = {}\nlocal buildTaskNames = {}\nfor _, custombuildtask in ipairs(prj.custombuildtask or {}) do\nfor _, b" + "uildtask in ipairs(custombuildtask or {}) do\nif (groupedBuildTasks[buildtask[1]] == nil) then\ngroupedBuildTasks[buildtask[1]] = {}\ntable.insert(buildTaskNames, buildtask[1])\nend\ntable.insert(groupedBuildTasks[buildtask[1]], buildtask)\nend\nend\nfor _, name in ipairs(buildTaskNames) do\ncustombuildtask = groupedBuildTasks[name]\n_p(2,'', path.translate(path.getrelative(prj.location,name), \"\\\\\"))\n_p(3,'Text')\nlocal cmd = \"\"\nlocal outputs = \"\"\nfor _, buildtask in ipairs(custombuildtask or {}) do\nfor _, cmdline in ipairs(buildtask[4] or {}) do\ncmd = cmd .. cmdline\nlocal num = 1\nfor _, depdata in ipairs(buildtask[3] or {}) do\ncmd = string.gsub(cmd,\"%$%(\" .. num ..\"%)\", string.format(\"%s \",path.getrelative(prj.location,depdata)))\nnum = num + 1\nend\ncmd = string.gsub(cmd, \"%$%(<%)\", string.format(\"%s \",path.getrelative(prj.location,buildtask[1])))\ncmd = string.gsub(cmd, \"%$%(@%)\", string.format(\"%s \",path.getrelative(prj.loca" + "tion,buildtask[2])))\ncmd = cmd .. \"\\r\\n\"\nend\noutputs = outputs .. path.getrelative(prj.location,buildtask[2]) .. \";\"\nend\n_p(3,'%s',cmd)\n_p(3,'%s%%(Outputs)',outputs)\n_p(3,'Designer')\n_p(3,'')\n_p(2,'')\nend\n_p(1,'')\nend\nend\nfunction vc2010.simplefilesgroup(prj, section, subtype)\nlocal configs = prj.solution.vstudio_configs\nlocal files = vc2010.getfilegroup(prj, section)\nif #files > 0 then\nlocal config_mappings = {}\nfor _, cfginfo in ipairs(configs) do\nlocal cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform)\nif cfg.pchheader and cfg.pchsource and not cfg.flags.NoPCH then\nconfig_mappings[cfginfo] = path.translate(cfg.pchsource, \"\\\\\")\nend\nend\n_p(1,'')\nfor _, file in ipairs(files) do\nlocal prjexcluded = table.icontains(prj.excludes, file.name)\nlocal excludedcfgs = {}\nif not prjexcluded then\nfor _, vsconfig in ipairs(configs) do\nlocal cfg = pr" + "emake.getconfig(prj, vsconfig.src_buildcfg, vsconfig.src_platform)\nlocal fileincfg = table.icontains(cfg.files, file.name)\nlocal cfgexcluded = table.icontains(cfg.excludes, file.name)\nif not fileincfg or cfgexcluded then\ntable.insert(excludedcfgs, vsconfig.name)\nend\nend\nend\nif subtype or prjexcluded or #excludedcfgs > 0 then\n_p(2, '<%s Include=\\\"%s\\\">', section, path.translate(file.name, \"\\\\\"))\nif prjexcluded then\n_p(3, 'true')\nelse\nfor _, cfgname in ipairs(excludedcfgs) do\n_p(3, 'true'\n, premake.esc(cfgname)\n)\nend\nend\nif subtype then\n_p(3, '%s', subtype)\nend\n_p(2,'', section)\nelse\n_p(2, '<%s Include=\\\"%s\\\" />', section, path.translate(file.name, \"\\\\\"))\nend\nend\n_p(1,'')\nend\nend\nfunction vc2010.deploymentcontentgroup(prj, section, filetype)\nif filetype == nil then\nfiletype = section\nend\nlocal files = vc2010.getfil" + "egroup(prj, section)\nif #files > 0 then\n_p(1,'')\nfor _, file in ipairs(files) do\n_p(2,'<%s Include=\\\"%s\\\">', filetype, path.translate(file.name, \"\\\\\"))\n_p(3,'true')\n_p(3,'%s', path.translate(file.vpath, \"\\\\\"))\n_p(2,'', filetype)\nend\n_p(1,'')\nend\nend\nfunction vc2010.compilerfilesgroup(prj)\nlocal configs = prj.solution.vstudio_configs\nlocal files = vc2010.getfilegroup(prj, \"ClCompile\")\nif #files > 0 then\nlocal config_mappings = {}\nfor _, cfginfo in ipairs(configs) do\nlocal cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform)\nif cfg.pchheader and cfg.pchsource and not cfg.flags.NoPCH then\nconfig_mappings[cfginfo] = path.translate(cfg.pchsource, \"\\\\\")\nend\nend\n_p(1,'')\nlocal existingBasenames = {};\nfor _, file in ipairs(files) do\nlocal filename = string.lower(path.getbasename(file.name))\nlocal disambiguation = existingBasenames[filename] or 0;\nexistingBasenam" + "es[filename] = disambiguation + 1\nlocal translatedpath = path.translate(file.name, \"\\\\\")\n_p(2, '', translatedpath)\nfor _, vsconfig in ipairs(configs) do\nlocal cfg = premake.getconfig(prj, vsconfig.src_buildcfg, vsconfig.src_platform)\nlocal namestyle = premake.getnamestyle(cfg)\nif namestyle == \"TegraAndroid\" or namestyle == \"NX\" then\n_p(3, '$(IntDir)%s.o', premake.esc(vsconfig.name), premake.esc(path.translate(path.trimdots(path.removeext(file.name)))) )\nelse\nif disambiguation > 0 then\n_p(3, '$(IntDir)%s\\\\', premake.esc(vsconfig.name), tostring(disambiguation))\nend\nend\nend\nif path.iscxfile(file.name) then\n_p(3, 'true')\n_p(3, 'true')\n_p(3, 'NotUsing')\nend\nif vstudio.iswinrt() and string.len(file.name) > 2 and string.s" + "ub(file.name, -2) == \".c\" then\n_p(3,'FALSE')\nend\nfor _, cfginfo in ipairs(configs) do\nif config_mappings[cfginfo] and translatedpath == config_mappings[cfginfo] then\n_p(3,'Create', premake.esc(cfginfo.name))\nconfig_mappings[cfginfo] = nil --only one source file per pch\nend\nend\nlocal nopch = table.icontains(prj.nopch, file.name)\nfor _, vsconfig in ipairs(configs) do\nlocal cfg = premake.getconfig(prj, vsconfig.src_buildcfg, vsconfig.src_platform)\nif nopch or table.icontains(cfg.nopch, file.name) then\n_p(3,'NotUsing', premake.esc(vsconfig.name))\nend\nend\nlocal excluded = table.icontains(prj.excludes, file.name)\nfor _, vsconfig in ipairs(configs) do\nlocal cfg = premake.getconfig(prj, vsconfig.src_buildcfg, vsconfig.src_platform)\nlocal fileincfg = table.icontains(cfg.files, file.name)\nlocal cfgexcluded = table.icontai" + "ns(cfg.excludes, file.name)\nif excluded or not fileincfg or cfgexcluded then\n_p(3, 'true'\n, premake.esc(vsconfig.name)\n)\nend\nend\nif prj.flags and prj.flags.Managed then\nlocal prjforcenative = table.icontains(prj.forcenative, file.name)\nfor _,vsconfig in ipairs(configs) do\nlocal cfg = premake.getconfig(prj, vsconfig.src_buildcfg, vsconfig.src_platform)\nif prjforcenative or table.icontains(cfg.forcenative, file.name) then\n_p(3, 'false', premake.esc(vsconfig.name))\nend\nend\nend\n_p(2,'')\nend\n_p(1,'')\nend\nend\nfunction vc2010.masmfiles(prj)\nlocal configs = prj.solution.vstudio_configs\nlocal files = vc2010.getfilegroup(prj, \"MASM\")\nif #files > 0 then\n_p(1, '')\nfor _, file in ipairs(files) do\nlocal translatedpath = path.translate(file.name, \"\\\\\")\n_p(2, '', translatedpath)\nlocal exclud" + "ed = table.icontains(prj.excludes, file.name)\nfor _, vsconfig in ipairs(configs) do\nlocal cfg = premake.getconfig(prj, vsconfig.src_buildcfg, vsconfig.src_platform)\nlocal fileincfg = table.icontains(cfg.files, file.name)\nlocal cfgexcluded = table.icontains(cfg.excludes, file.name)\nif excluded or not fileincfg or cfgexcluded then\n_p(3, 'true'\n, premake.esc(vsconfig.name)\n)\nend\nend\n_p(2, '')\nend\n_p(1, '')\nend\nend\nfunction vc2010.header(targets)\nio.eol = \"\\r\\n\"\n_p('')\nlocal t = \"\"\nif targets then\nt = ' DefaultTargets=\"' .. targets .. '\"'\nend\n_p('', t, action.vstudio.toolsVersion)\nend\nfunction premake.vs2010_vcxproj(prj)\nlocal usemasm = hasmasmfiles(prj)\nio.indent = \" \"\nvc2010.header(\"Build\")\nvs2010_config(prj)\nvs2010_globals(prj)\n_p(1,'')\nfor _, cfginfo in ipairs(prj.solution.vstudio_configs) do\nlocal cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform)\nvc2010.configurationPropertyGroup(cfg, cfginfo)\nend\n_p(1,'')\n_p(1,'')\nif usemasm then\n_p(2, '')\nend\n_p(1,'')\nimport_props(prj)\n_p(1,'')\nvc2010.outputProperties(prj)\nitem_definitions(prj)\nvc2010.files(prj)\nvc2010.clrReferences(prj)\nvc2010.projectReferences(prj)\nvc2010.sdkReferences(prj)\nvc2010.masmfiles(prj)\n_p(1,'')\n_p(1,'')\nif usemasm then\n_p(2, '')\nend\n_p(1,'')\n_p('" + "')\nend\nfunction vc2010.clrReferences(prj)\nif #prj.clrreferences == 0 then\nreturn\nend\n_p(1,'')\nfor _, ref in ipairs(prj.clrreferences) do\nif os.isfile(ref) then\nlocal assembly = path.getbasename(ref)\n_p(2,'', assembly)\n_p(3,'%s', path.getrelative(prj.location, ref))\n_p(2,'')\nelse\n_p(2,'', ref)\nend\nend\n_p(1,'')\nend\nfunction vc2010.projectReferences(prj)\nlocal deps = premake.getdependencies(prj)\nif #deps == 0 and #prj.vsimportreferences == 0 then\nreturn\nend\nlocal function compareuuid(a, b) return a.uuid < b.uuid end\ntable.sort(deps, compareuuid)\ntable.sort(table.join(prj.vsimportreferences), compareuuid)\n_p(1,'')\nfor _, dep in ipairs(deps) do\nlocal deppath = path.getrelative(prj.location, vstudio.projectfile(dep))\n_p(2,'', path.translate(deppath, \"\\\\\"))\n_p(3,'{%s}', dep.uuid)\nif vstudio.iswinrt" + "() then\n_p(3,'false')\nend\n_p(2,'')\nend\nfor _, ref in ipairs(prj.vsimportreferences) do\nlocal slnrelpath = path.rebase(ref, prj.location, sln.location)\nlocal iprj = premake.vstudio.getimportprj(slnrelpath, prj.solution)\n_p(2,'', ref)\n_p(3,'{%s}', iprj.uuid)\n_p(2,'')\nend\n_p(1,'')\nend\nfunction vc2010.sdkReferences(prj)\nlocal refs = prj.sdkreferences\nif #refs > 0 then\n_p(1,'')\nfor _, ref in ipairs(refs) do\n_p(2,'', ref)\nend\n_p(1,'')\nend\nend\nfunction vc2010.debugdir(cfg)\nlocal isnx = (cfg.platform == \"NX32\" or cfg.platform == \"NX64\")\nlocal debuggerFlavor =\n iif(isnx, 'OasisNXDebugger'\n, iif(cfg.platform == \"Orbis\", 'ORBISDebugger'\n, iif(cfg.platform == \"Durango\", 'XboxOneVCppDebugger'\n, iif(cfg.platform == \"TegraAndroid\", 'And" + "roidDebugger'\n, iif(vstudio.iswinrt(), 'AppHostLocalDebugger'\n, 'WindowsLocalDebugger'\n)))))\n_p(2, '%s', debuggerFlavor)\nif cfg.debugdir and not vstudio.iswinrt() then\n_p(2, '%s'\n, path.translate(cfg.debugdir, '\\\\')\n)\nend\nif cfg.debugcmd then\n_p(2, '%s', cfg.debugcmd)\nend\nif cfg.debugargs then\n_p(2, '%s'\n, table.concat(cfg.debugargs, \" \")\n)\nend\nif cfg.debugenvs and #cfg.debugenvs > 0 then\n_p(2, '%s%s'\n, table.concat(cfg.debugenvs, \"\\n\")\n, iif(cfg.flags.DebugEnvsInherit,'\\n$(LocalDebuggerEnvironment)', '')\n)\nif cfg.flags.DebugEnvsDontMerge then\n_p(2, 'false')\nend\nend\nif cfg.deploymode then\n_p(2, '%s', cfg.deploymode)\nend\nif cfg.platform == \"TegraAndroid\" then\nif cfg.androiddebugintentparams then\n_p(2, '%s'\n, table.concat(cfg.androiddebugintentparams, \" \")\n)\nend\nend\nend\nfunction premake.vs2010_vcxproj_user(prj)\nio.indent = \" \"\nvc2010.header()\nfor _, cfginfo in ipairs(prj.solution.vstudio_configs) do\nlocal cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform)\n_p(' ', premake.esc(cfginfo.name))\nvc2010.debugdir(cfg)\n_p(' ')\nend\n_p('')\nend\nlocal png1x1data = {\n0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52, -- .PNG........IHDR\n0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x03, 0x00, 0x00, 0x00, 0x25, 0xdb, 0x56, -- .............%.V\n0xca, 0x00, 0x00, 0x00, 0x03, 0x50, 0x4c, 0x54, 0x45, 0x00, 0x00, 0x00, 0xa7, 0x7a, 0x3d, 0xda, -- .....PLTE....z=.\n0x00, 0x00, 0x00, 0x01, 0x74, 0x52, 0x4e, 0x5" + "3, 0x00, 0x40, 0xe6, 0xd8, 0x66, 0x00, 0x00, 0x00, -- ....tRNS.@..f...\n0x0a, 0x49, 0x44, 0x41, 0x54, 0x08, 0xd7, 0x63, 0x60, 0x00, 0x00, 0x00, 0x02, 0x00, 0x01, 0xe2, -- .IDAT..c`.......\n0x21, 0xbc, 0x33, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82, -- !.3....IEND.B`.\n}\nfunction png1x1(obj, filename)\nfilename = premake.project.getfilename(obj, filename)\nlocal f, err = io.open(filename, \"wb\")\nif f then\nfor _, byte in ipairs(png1x1data) do\nf:write(string.char(byte))\nend\nf:close()\nend\nend\nfunction premake.vs2010_appxmanifest(prj)\nio.indent = \" \"\nio.eol = \"\\r\\n\"\n_p('')\nif vstudio.storeapp == \"10.0\" then\n_p('')\nelseif vstudi" + "o.storeapp == \"durango\" then\n_p('')\nend\n_p(1, '')\nif vstudio.storeapp == \"10.0\" then\n_p(1, '')\nend\n_p(1, '')\n_p(2, '' .. prj.name .. '')\n_p(2, 'PublisherDisplayName')\n_p(2, '' .. prj.name .. '\\\\StoreLogo.png')\npng1x1(prj, \"%%/StoreLogo.png\")\n_p(2, '' .. prj.name .. '')\n_p(1,'')\nif vstudio.storeapp == \"10.0\" then\n_p(1, '')\n_p(2, '')\n_p(1, '')\nelseif vstudio.storeapp == \"durango\" then\n_p(1, '')\n_p(2, '6.2')\n_p(2, '6.2')\n_p(1, '')\nend\n_p(1, '')\n_p(2, '')\n_p(1, '')\n_p(1, '')\n_p(2, '')\nif vstudio.storeapp == \"10.0\" then\n_p(3, '')\n_p" + "(4, '')\npng1x1(prj, \"%%/SplashScreen.png\")\n_p(3, '')\nelseif vstudio.storeapp == \"durango\" then\n_p(3, '')\n_p(5, '')\npng1x1(prj, \"%%/SplashScreen.png\")\n_p(3, '')\n_p(3, '')\n_p(4, '')\n_p(4, '')\n_p(4, '')\n_p(3, '')\nend\n_p(2, '')\n_p(1, '')\n_p('')\nend\n", /* actions/vstudio/vstudio_vcxproj_filters.lua */ "local vc2010 = premake.vstudio.vc2010\nlocal project = premake.project\nfunction vc2010.filteridgroup(prj)\nlocal filters = { }\nlocal filterfound = false\nfor file in premake.project.eachfile(prj, true) do\nlocal folders = string.explode(file.vpath, \"/\", true)\nlocal path = \"\"\nfor i = 1, #folders - 1 do\nif not filterfound then\nfilterfound = true\n_p(1,'')\nend\npath = path .. folders[i]\nif not filters[path] then\nfilters[path] = true\n_p(2, '', path)\n_p(3, '{%s}', os.uuid(path))\n_p(2, '')\nend\npath = path .. \"\\\\\"\nend\nend\nfor _, custombuildtask in ipairs(prj.custombuildtask or {}) do\nfor _, buildtask in ipairs(custombuildtask or {}) do\nlocal folders = string.explode(path.trimdots(path.getrelative(prj.location,buildtask[1])), \"/\", true)\nlocal path = \"\"\nfor i = 1, #folders - 1 do\nif not filterfound then\nfilterfound = true\n_p(1,'')\nend\npath = path .. folders[i]\nif not filters[path] then\nfilt" @@ -367,9 +381,9 @@ const char* builtin_scripts[] = { "premake.vstudio.vc2019 = {}\nlocal vc2019 = premake.vstudio.vc2019\nlocal vstudio = premake.vstudio\nnewaction\n{\ntrigger = \"vs2019\",\nshortname = \"Visual Studio 2019\",\ndescription = \"Generate Microsoft Visual Studio 2019 project files\",\nos = \"windows\",\nvalid_kinds = { \"ConsoleApp\", \"WindowedApp\", \"StaticLib\", \"SharedLib\", \"Bundle\" },\nvalid_languages = { \"C\", \"C++\", \"C#\" },\nvalid_tools = {\ncc = { \"msc\" },\ndotnet = { \"msnet\" },\n},\nonsolution = function(sln)\npremake.generate(sln, \"%%.sln\", vstudio.sln2005.generate)\nend,\nonproject = function(prj)\nif premake.isdotnetproject(prj) then\npremake.generate(prj, \"%%.csproj\", vstudio.cs2005.generate)\npremake.generate(prj, \"%%.csproj.user\", vstudio.cs2005.generate_user)\nelse\npremake.vstudio.needAppxManifest = false\npremake.generate(prj, \"%%.vcxproj\", premake.vs2010_vcxproj)\npremake.generate(prj, \"%%.vcxproj.user\", premake.vs2010_vcxproj_user)\npremake.generate(prj, \"%%.v" "cxproj.filters\", vstudio.vc2010.generate_filters)\nif premake.vstudio.needAppxManifest then\npremake.generate(prj, \"%%/Package.appxmanifest\", premake.vs2010_appxmanifest)\nend\nend\nend,\noncleansolution = premake.vstudio.cleansolution,\noncleanproject = premake.vstudio.cleanproject,\noncleantarget = premake.vstudio.cleantarget,\nvstudio = {\nsolutionVersion = \"12\",\ntargetFramework = \"4.7.2\",\ntoolsVersion = \"16.0\",\nwindowsTargetPlatformVersion = \"10.0\",\nsupports64bitEditContinue = true,\nintDirAbsolute = false,\n}\n}\n", - /* actions/vstudio/vsllvm.lua */ - "premake.vstudio.vcllvm = {}\nlocal vcllvm = premake.vstudio.vcllvm\nlocal vstudio = premake.vstudio\nnewaction\n{\ntrigger = \"vsllvm\",\nshortname = \"Visual Studio LLVM\",\ndescription = \"Generate Microsoft Visual Studio LLVM project files\",\nos = \"windows\",\nvalid_kinds = { \"ConsoleApp\", \"WindowedApp\", \"StaticLib\", \"SharedLib\", \"Bundle\" },\nvalid_languages = { \"C\", \"C++\", \"C#\" },\nvalid_tools = {\ncc = { \"msc\" },\ndotnet = { \"msnet\" },\n},\nonsolution = function(sln)\npremake.generate(sln, \"%%.sln\", vstudio.sln2005.generate)\nend,\nonproject = function(prj)\nif premake.isdotnetproject(prj) then\npremake.generate(prj, \"%%.csproj\", vstudio.cs2005.generate)\npremake.generate(prj, \"%%.csproj.user\", vstudio.cs2005.generate_user)\nelse\npremake.vstudio.needAppxManifest = false\npremake.generate(prj, \"%%.vcxproj\", premake.vs2010_vcxproj)\npremake.generate(prj, \"%%.vcxproj.user\", premake.vs2010_vcxproj_user)\npremake.generate(prj, \"%%.v" - "cxproj.filters\", vstudio.vc2010.generate_filters)\nif premake.vstudio.needAppxManifest then\npremake.generate(prj, \"%%/Package.appxmanifest\", premake.vs2010_appxmanifest)\nend\nend\nend,\noncleansolution = premake.vstudio.cleansolution,\noncleanproject = premake.vstudio.cleanproject,\noncleantarget = premake.vstudio.cleantarget,\nvstudio = {\nsolutionVersion = \"12\",\ntargetFramework = \"4.5.2\",\ntoolsVersion = \"15.0\",\nwindowsTargetPlatformVersion = \"8.1\",\nsupports64bitEditContinue = true,\nintDirAbsolute = true,\n}\n}\n", + /* actions/vstudio/vs2022.lua */ + "premake.vstudio.vc2022 = {}\nlocal vc2022 = premake.vstudio.vc2022\nlocal vstudio = premake.vstudio\nnewaction\n{\ntrigger = \"vs2022\",\nshortname = \"Visual Studio 2022\",\ndescription = \"Generate Microsoft Visual Studio 2022 project files\",\nos = \"windows\",\nvalid_kinds = { \"ConsoleApp\", \"WindowedApp\", \"StaticLib\", \"SharedLib\", \"Bundle\" },\nvalid_languages = { \"C\", \"C++\", \"C#\" },\nvalid_tools = {\ncc = { \"msc\" },\ndotnet = { \"msnet\" },\n},\nonsolution = function(sln)\npremake.generate(sln, \"%%.sln\", vstudio.sln2005.generate)\nend,\nonproject = function(prj)\nif premake.isdotnetproject(prj) then\npremake.generate(prj, \"%%.csproj\", vstudio.cs2005.generate)\npremake.generate(prj, \"%%.csproj.user\", vstudio.cs2005.generate_user)\nelse\npremake.vstudio.needAppxManifest = false\npremake.generate(prj, \"%%.vcxproj\", premake.vs2010_vcxproj)\npremake.generate(prj, \"%%.vcxproj.user\", premake.vs2010_vcxproj_user)\npremake.generate(prj, \"%%.v" + "cxproj.filters\", vstudio.vc2010.generate_filters)\nif premake.vstudio.needAppxManifest then\npremake.generate(prj, \"%%/Package.appxmanifest\", premake.vs2010_appxmanifest)\nend\nend\nend,\noncleansolution = premake.vstudio.cleansolution,\noncleanproject = premake.vstudio.cleanproject,\noncleantarget = premake.vstudio.cleantarget,\nvstudio = {\nsolutionVersion = \"12\",\ntargetFramework = \"4.7.2\",\ntoolsVersion = \"16.0\",\nwindowsTargetPlatformVersion = \"10.0\",\nsupports64bitEditContinue = true,\nintDirAbsolute = false,\n}\n}\n", /* actions/xcode/_xcode.lua */ "premake.xcode = { }\nfunction premake.xcode.checkproject(prj)\nlocal last\nfor cfg in premake.eachconfig(prj) do\nif last and last ~= cfg.kind then\nerror(\"Project '\" .. prj.name .. \"' uses more than one target kind; not supported by Xcode\", 0)\nend\nlast = cfg.kind\nend\nend\npremake.xcode.toolset = \"macosx\"\n", @@ -382,28 +396,29 @@ const char* builtin_scripts[] = { "textension(node.path)] or\n(types[string.lower(path.getextension(node.path))] or \"text\")\nend\nfunction xcode.getproducttype(node)\nlocal types = {\nConsoleApp = \"com.apple.product-type.tool\",\nWindowedApp = node.cfg.options.SkipBundling and \"com.apple.product-type.tool\" or \"com.apple.product-type.application\",\nStaticLib = \"com.apple.product-type.library.static\",\nSharedLib = \"com.apple.product-type.library.dynamic\",\nBundle = node.cfg.options.SkipBundling and \"com.apple.product-type.tool\" or \"com.apple.product-type.bundle\",\n}\nreturn types[node.cfg.kind]\nend\nfunction xcode.gettargettype(node)\nlocal types = {\nConsoleApp = \"\\\"compiled.mach-o.executable\\\"\",\nWindowedApp = node.cfg.options.SkipBundling and \"\\\"compiled.mach-o.executable\\\"\" or \"wrapper.application\",\nStaticLib = \"archive.ar\",\nSharedLib = \"\\\"compiled.mach-o.dylib\\\"\",\nBundle = node.cfg.options.SkipBundling and \"\\\"compiled.mach-o.bundle\\\"\" or \"wrapper.cfbundle\",\n}\nreturn types" "[node.cfg.kind]\nend\nfunction xcode.getxcodeprojname(prj)\nlocal fname = premake.project.getfilename(prj, \"%%.xcodeproj\")\nreturn fname\nend\nfunction xcode.isframework(fname)\nreturn (path.getextension(fname) == \".framework\" or path.getextension(fname) == \".tbd\")\nend\nfunction xcode.uuid(param)\nreturn os.uuid(param):upper():gsub('-',''):sub(0,24)\nend\nfunction xcode.newid(node, usage)\nlocal base = ''\nlocal prj = node.project\nif prj == nil then\nlocal parent = node.parent\nwhile parent ~= nil do\nif parent.project ~= nil then\nprj = parent.project\nbreak\nend\nparent = parent.parent\nend\nend\nif prj ~= nil then\nprj.uuidcounter = (prj.uuidcounter or 0) + 1\nbase = base .. prj.name .. \"$\" .. prj.uuidcounter .. \"$\"\nend\nbase = base .. \"$\" .. (node.path or node.name or \"\")\nbase = base .. \"$\" .. (usage or \"\")\nreturn xcode.uuid(base)\nend\nfunction xcode.getscriptphaselabel(cmd, count, cfg)\nreturn string.format(\"\\\"Script Phase %s [%s] (%s)\\\"\", count, cmd:match(\"(%w+)(.+)\"), iif" "(cfg, xcode.getconfigname(cfg), \"all\"))\nend\nfunction xcode.getcopyphaselabel(type, count, target)\nreturn string.format(\"\\\"Copy %s %s [%s]\\\"\", type, count, target)\nend\nfunction xcode.preparesolution(sln)\nsln.xcode = { }\nsln.xcode.platforms = premake.filterplatforms(sln, premake.action.current().valid_platforms, \"Universal\")\nfor prj in premake.solution.eachproject(sln) do\nlocal cfg = premake.getconfig(prj, prj.configurations[1], sln.xcode.platforms[1])\nlocal node = premake.tree.new(path.getname(cfg.buildtarget.bundlepath))\nnode.cfg = cfg\nnode.id = premake.xcode.newid(node, \"product\")\nnode.targetid = premake.xcode.newid(node, \"target\")\nprj.xcode = {}\nprj.xcode.projectnode = node\nend\nend\nfunction xcode.printlist(list, tag, sort)\nif #list > 0 then\nif sort ~= nil and sort == true then\ntable.sort(list)\nend\n_p(4,'%s = (', tag)\nfor _, item in ipairs(list) do\nlocal escaped_item = item:gsub(\"\\\"\", \"\\\\\\\\\\\\\\\"\"):gsub(\"'\", \"\\\\\\\\'\")\n_p(5, '\"%s\",', escaped_item)\ne" - "nd\n_p(4,');')\nend\nend\nfunction xcode.quotestr(str)\nif str:match(\"[^a-zA-Z0-9$._/]\") == nil then\nreturn str\nend\nreturn \"\\\"\" .. str:gsub(\"[\\\"\\\\\\\"]\", \"\\\\%0\") .. \"\\\"\"\nend\nfunction xcode.Header(tr, objversion)\n_p('// !$*UTF8*$!')\n_p('{')\n_p(1,'archiveVersion = 1;')\n_p(1,'classes = {')\n_p(1,'};')\n_p(1,'objectVersion = %d;', objversion)\n_p(1,'objects = {')\n_p('')\nend\nfunction xcode.PBXBuildFile(tr)\nlocal function gatherCopyFiles(which)\nlocal copyfiles = {}\nlocal targets = tr.project[which]\nif #targets > 0 then\nfor _, t in ipairs(targets) do\nfor __, tt in ipairs(t) do\ntable.insertflat(copyfiles, tt[2])\nend\nend\nend\nreturn table.translate(copyfiles, path.getname)\nend\nlocal function gatherCopyFrameworks(which)\nlocal copyfiles = {}\nlocal targets = tr.project[which]\nif #targets > 0 then\ntable.insertflat(copyfiles, targets)\nend\nreturn table.translate(copyfiles, path.getname)\nend\nlocal copyfiles = table.flatten({\ngatherCopyFiles('xcodecopyresources'),\ngatherCop" - "yFrameworks('xcodecopyframeworks')\n})\n_p('/* Begin PBXBuildFile section */')\ntree.traverse(tr, {\nonnode = function(node)\nif node.buildid then\n_p(2,'%s /* %s in %s */ = {isa = PBXBuildFile; fileRef = %s /* %s */; };',\nnode.buildid, node.name, xcode.getbuildcategory(node), node.id, node.name)\nend\nif table.icontains(copyfiles, node.name) then\n_p(2,'%s /* %s in %s */ = {isa = PBXBuildFile; fileRef = %s /* %s */; %s };',\nxcode.uuid(node.name .. 'in CopyFiles'), node.name, 'CopyFiles', node.id, node.name,\niif(xcode.isframework(node.name), \"settings = {ATTRIBUTES = (CodeSignOnCopy, ); };\", \"\")\n)\nend\nend\n})\n_p('/* End PBXBuildFile section */')\n_p('')\nend\nfunction xcode.PBXContainerItemProxy(tr)\nif #tr.projects.children > 0 then\n_p('/* Begin PBXContainerItemProxy section */')\nfor _, node in ipairs(tr.projects.children) do\n_p(2,'%s /* PBXContainerItemProxy */ = {', node.productproxyid)\n_p(3,'isa = PBXContainerItemProxy;')\n_p(3,'containerPortal = %s /* %s */;', node.id, path.getname(node.pat" - "h))\n_p(3,'proxyType = 2;')\n_p(3,'remoteGlobalIDString = %s;', node.project.xcode.projectnode.id)\n_p(3,'remoteInfo = \"%s\";', node.project.xcode.projectnode.name)\n_p(2,'};')\n_p(2,'%s /* PBXContainerItemProxy */ = {', node.targetproxyid)\n_p(3,'isa = PBXContainerItemProxy;')\n_p(3,'containerPortal = %s /* %s */;', node.id, path.getname(node.path))\n_p(3,'proxyType = 1;')\n_p(3,'remoteGlobalIDString = %s;', node.project.xcode.projectnode.targetid)\n_p(3,'remoteInfo = \"%s\";', node.project.xcode.projectnode.name)\n_p(2,'};')\nend\n_p('/* End PBXContainerItemProxy section */')\n_p('')\nend\nend\nfunction xcode.PBXFileReference(tr,prj)\n_p('/* Begin PBXFileReference section */')\ntree.traverse(tr, {\nonleaf = function(node)\nif not node.path then\nreturn\nend\nif node.kind == \"product\" then\n_p(2,'%s /* %s */ = {isa = PBXFileReference; explicitFileType = %s; includeInIndex = 0; name = \"%s\"; path = \"%s\"; sourceTree = BUILT_PRODUCTS_DIR; };',\nnode.id, node.name, xcode.gettargettype(node), node.name, path" - ".getname(node.cfg.buildtarget.bundlepath))\nelseif node.parent.parent == tr.projects then\nlocal relpath = path.getrelative(tr.project.location, node.parent.project.location)\n_p(2,'%s /* %s */ = {isa = PBXFileReference; lastKnownFileType = \"wrapper.pb-project\"; name = \"%s\"; path = \"%s\"; sourceTree = SOURCE_ROOT; };',\nnode.parent.id, node.parent.name, node.parent.name, path.join(relpath, node.parent.name))\nelse\nlocal pth, src\nif xcode.isframework(node.path) then\nlocal nodePath = node.path\nlocal _, matchEnd, variable = string.find(nodePath, \"^%$%((.+)%)/\")\nif variable then\nnodePath = string.sub(nodePath, matchEnd + 1)\nend\nif string.find(nodePath,'/') then\nif string.find(nodePath,'^%.')then\nnodePath = path.getabsolute(path.join(tr.project.location, nodePath))\nend\npth = nodePath\nelseif path.getextension(nodePath)=='.tbd' then\npth = \"/usr/lib/\" .. nodePath\nelse\npth = \"/System/Library/Frameworks/\" .. nodePath\nend\nif variable then\nsrc = variable\nif string.find(pth, '^/') then\npth " - "= string.sub(pth, 2)\nend\nelse\nsrc = \"\"\nend\nelse\nsrc = \"\"\nif node.location then\npth = node.location\nelseif node.parent.isvpath then\npth = node.cfg.name\nelse\npth = tree.getlocalpath(node)\nend\nend\nif (not prj.options.ForceCPP) then\n_p(2,'%s /* %s */ = {isa = PBXFileReference; lastKnownFileType = %s; name = \"%s\"; path = \"%s\"; sourceTree = \"%s\"; };',\nnode.id, node.name, xcode.getfiletype(node), node.name, pth, src)\nelse\n_p(2,'%s /* %s */ = {isa = PBXFileReference; explicitFileType = %s; name = \"%s\"; path = \"%s\"; sourceTree = \"%s\"; };',\nnode.id, node.name, xcode.getfiletypeForced(node), node.name, pth, src)\nend\nend\nend\n})\n_p('/* End PBXFileReference section */')\n_p('')\nend\nfunction xcode.PBXFrameworksBuildPhase(tr)\n_p('/* Begin PBXFrameworksBuildPhase section */')\n_p(2,'%s /* Frameworks */ = {', tr.products.children[1].fxstageid)\n_p(3,'isa = PBXFrameworksBuildPhase;')\n_p(3,'buildActionMask = 2147483647;')\n_p(3,'files = (')\ntree.traverse(tr.frameworks" - ", {\nonleaf = function(node)\n_p(4,'%s /* %s in Frameworks */,', node.buildid, node.name)\nend\n})\ntree.traverse(tr.projects, {\nonleaf = function(node)\n_p(4,'%s /* %s in Frameworks */,', node.buildid, node.name)\nend\n})\n_p(3,');')\n_p(3,'runOnlyForDeploymentPostprocessing = 0;')\n_p(2,'};')\n_p('/* End PBXFrameworksBuildPhase section */')\n_p('')\nend\nfunction xcode.PBXGroup(tr)\n_p('/* Begin PBXGroup section */')\ntree.traverse(tr, {\nonnode = function(node)\nif (node.path and #node.children == 0) or node.kind == \"vgroup\" then\nreturn\nend\nif node.parent == tr.projects then\n_p(2,'%s /* Products */ = {', node.productgroupid)\nelse\n_p(2,'%s /* %s */ = {', node.id, node.name)\nend\n_p(3,'isa = PBXGroup;')\n_p(3,'children = (')\nfor _, childnode in ipairs(node.children) do\n_p(4,'%s /* %s */,', childnode.id, childnode.name)\nend\n_p(3,');')\nif node.parent == tr.projects then\n_p(3,'name = Products;')\nelse\n_p(3,'name = \"%s\";', node.name)\nif node.location then\n_p(3,'path = \"%s\";', node.location)" - "\nelseif node.path and not node.isvpath then\nlocal p = node.path\nif node.parent.path then\np = path.getrelative(node.parent.path, node.path)\nend\n_p(3,'path = \"%s\";', p)\nend\nend\n_p(3,'sourceTree = \"\";')\n_p(2,'};')\nend\n}, true)\n_p('/* End PBXGroup section */')\n_p('')\nend\nfunction xcode.PBXNativeTarget(tr)\n_p('/* Begin PBXNativeTarget section */')\nfor _, node in ipairs(tr.products.children) do\nlocal name = tr.project.name\nlocal function hasBuildCommands(which)\nif #tr.project[which] > 0 then\nreturn true\nend\nfor _, cfg in ipairs(tr.configs) do\nif #cfg[which] > 0 then\nreturn true\nend\nend\nend\nlocal function dobuildblock(id, label, which, action)\nif hasBuildCommands(which) then\nlocal commandcount = 0\nfor _, cfg in ipairs(tr.configs) do\ncommandcount = commandcount + #cfg[which]\nend\nif commandcount > 0 then\naction(id, label)\nend\nend\nend\nlocal function doscriptphases(which, action)\nlocal i = 0\nfor _, cfg in ipairs(tr.configs) do\nlocal cfgcmds = cfg[which]\nif cfgcmds ~" - "= nil then\nfor __, scripts in ipairs(cfgcmds) do\nfor ___, script in ipairs(scripts) do\nlocal cmd = script[1]\nlocal label = xcode.getscriptphaselabel(cmd, i, cfg)\nlocal id = xcode.uuid(label)\naction(id, label)\ni = i + 1\nend\nend\nend\nend\nend\nlocal function docopyresources(which, action)\nif hasBuildCommands(which) then\nlocal targets = tr.project[which]\nif #targets > 0 then\nlocal i = 0\nfor _, t in ipairs(targets) do\nfor __, tt in ipairs(t) do\nlocal label = xcode.getcopyphaselabel('Resources', i, tt[1])\nlocal id = xcode.uuid(label)\naction(id, label)\ni = i + 1\nend\nend\nend\nend\nend\nlocal function docopyframeworks(which, action)\nif hasBuildCommands(which) then\nlocal targets = tr.project[which]\nif #targets > 0 then\nlocal label = \"Copy Frameworks\"\nlocal id = xcode.uuid(label)\naction(id, label)\nend\nend\nend\nlocal function _p_label(id, label)\n_p(4, '%s /* %s */,', id, label)\nend\n_p(2,'%s /* %s */ = {', node.targetid, name)\n_p(3,'isa = PBXNativeTarget;')\n_p(3,'buildConfigurationLi" - "st = %s /* Build configuration list for PBXNativeTarget \"%s\" */;', node.cfgsection, name)\n_p(3,'buildPhases = (')\ndobuildblock('9607AE1010C857E500CD1376', 'Prebuild', 'prebuildcommands', _p_label)\n_p(4,'%s /* Resources */,', node.resstageid)\n_p(4,'%s /* Sources */,', node.sourcesid)\ndobuildblock('9607AE3510C85E7E00CD1376', 'Prelink', 'prelinkcommands', _p_label)\n_p(4,'%s /* Frameworks */,', node.fxstageid)\ndobuildblock('9607AE3710C85E8F00CD1376', 'Postbuild', 'postbuildcommands', _p_label)\ndoscriptphases(\"xcodescriptphases\", _p_label)\ndocopyresources(\"xcodecopyresources\", _p_label)\nif tr.project.kind == \"WindowedApp\" then\ndocopyframeworks(\"xcodecopyframeworks\", _p_label)\nend\n_p(3,');')\n_p(3,'buildRules = (')\n_p(3,');')\n_p(3,'dependencies = (')\nfor _, node in ipairs(tr.projects.children) do\n_p(4,'%s /* PBXTargetDependency */,', node.targetdependid)\nend\n_p(3,');')\n_p(3,'name = \"%s\";', name)\nlocal p\nif node.cfg.kind == \"ConsoleApp\" then\np = \"$(HOME)/bin\"\nelseif node.cfg.ki" - "nd == \"WindowedApp\" then\np = \"$(HOME)/Applications\"\nend\nif p then\n_p(3,'productInstallPath = \"%s\";', p)\nend\n_p(3,'productName = \"%s\";', name)\n_p(3,'productReference = %s /* %s */;', node.id, node.name)\n_p(3,'productType = \"%s\";', xcode.getproducttype(node))\n_p(2,'};')\nend\n_p('/* End PBXNativeTarget section */')\n_p('')\nend\nfunction xcode.PBXProject(tr, compatVersion)\n_p('/* Begin PBXProject section */')\n_p(2,'__RootObject_ /* Project object */ = {')\n_p(3,'isa = PBXProject;')\n_p(3,'buildConfigurationList = 1DEB928908733DD80010E9CD /* Build configuration list for PBXProject \"%s\" */;', tr.name)\n_p(3,'compatibilityVersion = \"Xcode %s\";', compatVersion)\n_p(3,'hasScannedForEncodings = 1;')\n_p(3,'mainGroup = %s /* %s */;', tr.id, tr.name)\n_p(3,'projectDirPath = \"\";')\nif #tr.projects.children > 0 then\n_p(3,'projectReferences = (')\nfor _, node in ipairs(tr.projects.children) do\n_p(4,'{')\n_p(5,'ProductGroup = %s /* Products */;', node.productgroupid)\n_p(5,'ProjectRef = %s /* %s" - " */;', node.id, path.getname(node.path))\n_p(4,'},')\nend\n_p(3,');')\nend\n_p(3,'projectRoot = \"\";')\n_p(3,'targets = (')\nfor _, node in ipairs(tr.products.children) do\n_p(4,'%s /* %s */,', node.targetid, node.name)\nend\n_p(3,');')\n_p(2,'};')\n_p('/* End PBXProject section */')\n_p('')\nend\nfunction xcode.PBXReferenceProxy(tr)\nif #tr.projects.children > 0 then\n_p('/* Begin PBXReferenceProxy section */')\ntree.traverse(tr.projects, {\nonleaf = function(node)\n_p(2,'%s /* %s */ = {', node.id, node.name)\n_p(3,'isa = PBXReferenceProxy;')\n_p(3,'fileType = %s;', xcode.gettargettype(node))\n_p(3,'path = \"%s\";', node.path)\n_p(3,'remoteRef = %s /* PBXContainerItemProxy */;', node.parent.productproxyid)\n_p(3,'sourceTree = BUILT_PRODUCTS_DIR;')\n_p(2,'};')\nend\n})\n_p('/* End PBXReferenceProxy section */')\n_p('')\nend\nend\nfunction xcode.PBXResourcesBuildPhase(tr)\n_p('/* Begin PBXResourcesBuildPhase section */')\nfor _, target in ipairs(tr.products.children) do\n_p(2,'%s /* Resources */ = {', target.r" - "esstageid)\n_p(3,'isa = PBXResourcesBuildPhase;')\n_p(3,'buildActionMask = 2147483647;')\n_p(3,'files = (')\ntree.traverse(tr, {\nonnode = function(node)\nif xcode.getbuildcategory(node) == \"Resources\" then\n_p(4,'%s /* %s in Resources */,', node.buildid, node.name)\nend\nend\n})\n_p(3,');')\n_p(3,'runOnlyForDeploymentPostprocessing = 0;')\n_p(2,'};')\nend\n_p('/* End PBXResourcesBuildPhase section */')\n_p('')\nend\nfunction xcode.PBXShellScriptBuildPhase(tr)\nlocal wrapperWritten = false\nlocal function doblock(id, name, commands, files)\nif commands ~= nil then\ncommands = table.flatten(commands)\nend\nif #commands > 0 then\nif not wrapperWritten then\n_p('/* Begin PBXShellScriptBuildPhase section */')\nwrapperWritten = true\nend\n_p(2,'%s /* %s */ = {', id, name)\n_p(3,'isa = PBXShellScriptBuildPhase;')\n_p(3,'buildActionMask = 2147483647;')\n_p(3,'files = (')\n_p(3,');')\n_p(3,'inputPaths = (');\nif files ~= nil then\nfiles = table.flatten(files)\nif #files > 0 then\nfor _, file in ipairs(files) do\n_p(" - "4, '\"%s\",', file)\nend\nend\nend\n_p(3,');');\n_p(3,'name = %s;', name);\n_p(3,'outputPaths = (');\n_p(3,');');\n_p(3,'runOnlyForDeploymentPostprocessing = 0;');\n_p(3,'shellPath = /bin/sh;');\n_p(3,'shellScript = \"%s\";', table.concat(commands, \"\\\\n\"):gsub('\"', '\\\\\"'))\n_p(2,'};')\nend\nend\nlocal function wrapcommands(cmds, cfg)\nlocal commands = {}\nif #cmds > 0 then\ntable.insert(commands, 'if [ \"${CONFIGURATION}\" = \"' .. xcode.getconfigname(cfg) .. '\" ]; then')\nfor i = 1, #cmds do\nlocal cmd = cmds[i]\ncmd = cmd:gsub('\\\\','\\\\\\\\')\ntable.insert(commands, cmd)\nend\ntable.insert(commands, 'fi')\nend\nreturn commands\nend\nlocal function dobuildblock(id, name, which)\nlocal commands = {}\nfor _, cfg in ipairs(tr.configs) do\nlocal cfgcmds = wrapcommands(cfg[which], cfg)\nif #cfgcmds > 0 then\nfor i, cmd in ipairs(cfgcmds) do\ntable.insert(commands, cmd)\nend\nend\nend\ndoblock(id, name, commands)\nend\nlocal function doscriptphases(which)\nlocal i = 0\nfor _, cfg in ipairs(tr.configs) d" - "o\nlocal cfgcmds = cfg[which]\nif cfgcmds ~= nil then\nfor __, scripts in ipairs(cfgcmds) do\nfor ___, script in ipairs(scripts) do\nlocal cmd = script[1]\nlocal files = script[2]\nlocal label = xcode.getscriptphaselabel(cmd, i, cfg)\nlocal id = xcode.uuid(label)\ndoblock(id, label, wrapcommands({cmd}, cfg), files)\ni = i + 1\nend\nend\nend\nend\nend\ndobuildblock(\"9607AE1010C857E500CD1376\", \"Prebuild\", \"prebuildcommands\")\ndobuildblock(\"9607AE3510C85E7E00CD1376\", \"Prelink\", \"prelinkcommands\")\ndobuildblock(\"9607AE3710C85E8F00CD1376\", \"Postbuild\", \"postbuildcommands\")\ndoscriptphases(\"xcodescriptphases\")\nif wrapperWritten then\n_p('/* End PBXShellScriptBuildPhase section */')\nend\nend\nfunction xcode.PBXSourcesBuildPhase(tr,prj)\n_p('/* Begin PBXSourcesBuildPhase section */')\nfor _, target in ipairs(tr.products.children) do\n_p(2,'%s /* Sources */ = {', target.sourcesid)\n_p(3,'isa = PBXSourcesBuildPhase;')\n_p(3,'buildActionMask = 2147483647;')\n_p(3,'files = (')\ntree.traverse(tr, {\no" - "nleaf = function(node)\nif xcode.getbuildcategory(node) == \"Sources\" then\nif not table.icontains(prj.excludes, node.cfg.name) then -- if not excluded\n_p(4,'%s /* %s in Sources */,', node.buildid, node.name)\nend\nend\nend\n})\n_p(3,');')\n_p(3,'runOnlyForDeploymentPostprocessing = 0;')\n_p(2,'};')\nend\n_p('/* End PBXSourcesBuildPhase section */')\n_p('')\nend\nfunction xcode.PBXCopyFilesBuildPhase(tr)\nlocal wrapperWritten = false\nlocal function doblock(id, name, folderSpec, path, files)\nif #files > 0 then\nif not wrapperWritten then\n_p('/* Begin PBXCopyFilesBuildPhase section */')\nwrapperWritten = true\nend\n_p(2,'%s /* %s */ = {', id, name)\n_p(3,'isa = PBXCopyFilesBuildPhase;')\n_p(3,'buildActionMask = 2147483647;')\n_p(3,'dstPath = \\\"%s\\\";', path)\n_p(3,'dstSubfolderSpec = \\\"%s\\\";', folderSpec)\n_p(3,'files = (')\ntree.traverse(tr, {\nonleaf = function(node)\nif table.icontains(files, node.name) then\n_p(4,'%s /* %s in %s */,',\nxcode.uuid(node.name .. 'in CopyFiles'), node.name, 'CopyFile" - "s')\nend\nend\n})\n_p(3,');')\n_p(3,'runOnlyForDeploymentPostprocessing = 0;');\n_p(2,'};')\nend\nend\nlocal function docopyresources(which)\nlocal targets = tr.project[which]\nif #targets > 0 then\nlocal i = 0\nfor _, t in ipairs(targets) do\nfor __, tt in ipairs(t) do\nlocal label = xcode.getcopyphaselabel('Resources', i, tt[1])\nlocal id = xcode.uuid(label)\nlocal files = table.translate(table.flatten(tt[2]), path.getname)\ndoblock(id, label, 7, tt[1], files)\ni = i + 1\nend\nend\nend\nend\nlocal function docopyframeworks(which)\nlocal targets = tr.project[which]\nif #targets > 0 then\nlocal label = \"Copy Frameworks\"\nlocal id = xcode.uuid(label)\nlocal files = table.translate(table.flatten(targets), path.getname)\ndoblock(id, label, 10, \"\", files)\nend\nend\ndocopyresources(\"xcodecopyresources\")\nif tr.project.kind == \"WindowedApp\" then\ndocopyframeworks(\"xcodecopyframeworks\")\nend\nif wrapperWritten then\n_p('/* End PBXCopyFilesBuildPhase section */')\nend\nend\nfunction xcode.PBXVariantGroup(tr" - ")\n_p('/* Begin PBXVariantGroup section */')\ntree.traverse(tr, {\nonbranch = function(node)\nif node.kind == \"vgroup\" then\n_p(2,'%s /* %s */ = {', node.id, node.name)\n_p(3,'isa = PBXVariantGroup;')\n_p(3,'children = (')\nfor _, lang in ipairs(node.children) do\n_p(4,'%s /* %s */,', lang.id, lang.name)\nend\n_p(3,');')\n_p(3,'name = %s;', node.name)\n_p(3,'sourceTree = \"\";')\n_p(2,'};')\nend\nend\n})\n_p('/* End PBXVariantGroup section */')\n_p('')\nend\nfunction xcode.PBXTargetDependency(tr)\nif #tr.projects.children > 0 then\n_p('/* Begin PBXTargetDependency section */')\ntree.traverse(tr.projects, {\nonleaf = function(node)\n_p(2,'%s /* PBXTargetDependency */ = {', node.parent.targetdependid)\n_p(3,'isa = PBXTargetDependency;')\n_p(3,'name = \"%s\";', node.name)\n_p(3,'targetProxy = %s /* PBXContainerItemProxy */;', node.parent.targetproxyid)\n_p(2,'};')\nend\n})\n_p('/* End PBXTargetDependency section */')\n_p('')\nend\nend\nfunction xcode.cfg_excluded_files(prj, cfg)\nlocal excluded = {}\nloc" - "al function exclude_pattern(file)\nif path.isabsolute(file) then\nreturn file\nend\nlocal start, term = file:findlast(\"/%.%./\")\nif term then\nreturn path.join(\"*\", file:sub(term + 1))\nend\nstart, term = file:find(\"%.%./\")\nif start == 1 then\nreturn path.join(\"*\", file:sub(term + 1))\nend\nreturn path.join(\"*\", file)\nend\nlocal function add_file(file)\nlocal name = exclude_pattern(file)\nif not table.icontains(excluded, name) then\ntable.insert(excluded, name)\nend\nend\nlocal function verify_file(file)\nlocal name = exclude_pattern(file)\nif table.icontains(excluded, name) then\nerror(\"'\" .. file .. \"' would be excluded by the rule to exclude '\" .. name .. \"'\")\nend\nend\nfor _, file in ipairs(cfg.excludes) do\nadd_file(file)\nend\nfor _, file in ipairs(prj.allfiles) do\nif not table.icontains(prj.excludes, file) and not table.icontains(cfg.excludes, file) then\nif not table.icontains(cfg.files, file) then\nadd_file(file)\nelse\nverify_file(file)\nend\nend\nend\ntable.sort(excluded)\nreturn" - " excluded\nend\nfunction xcode.XCBuildConfiguration_Impl(tr, id, opts, cfg)\nlocal cfgname = xcode.getconfigname(cfg)\n_p(2,'%s /* %s */ = {', id, cfgname)\n_p(3,'isa = XCBuildConfiguration;')\n_p(3,'buildSettings = {')\nfor k, v in table.sortedpairs(opts) do\nif type(v) == \"table\" then\nif #v > 0 then\n_p(4,'%s = (', k)\nfor i, v2 in ipairs(v) do\n_p(5,'%s,', xcode.quotestr(tostring(v2)))\nend\n_p(4,');')\nend\nelse\n_p(4,'%s = %s;', k, xcode.quotestr(tostring(v)))\nend\nend\n_p(3,'};')\n_p(3,'name = %s;', xcode.quotestr(cfgname))\n_p(2,'};')\nend\nlocal function add_options(options, extras)\nfor _, tbl in ipairs(extras) do\nfor tkey, tval in pairs(tbl) do\noptions[tkey] = tval\nend\nend\nend\nlocal function add_wholearchive_links(opts, cfg)\nif #cfg.wholearchive > 0 then\nlocal linkopts = {}\nfor _, depcfg in ipairs(premake.getlinks(cfg, \"siblings\", \"object\")) do\nif table.icontains(cfg.wholearchive, depcfg.project.name) then\nlocal linkpath = path.rebase(depcfg.linktarget.fullpath, depcfg.location, cf" - "g.location)\ntable.insert(linkopts, \"-force_load\")\ntable.insert(linkopts, linkpath)\nend\nend\nif opts.OTHER_LDFLAGS then\nlinkopts = table.join(linkopts, opts.OTHER_LDFLAGS)\nend\nopts.OTHER_LDFLAGS = linkopts\nend\nend\nfunction xcode.XCBuildConfiguration(tr, prj, opts)\n_p('/* Begin XCBuildConfiguration section */')\nfor _, target in ipairs(tr.products.children) do\nfor _, cfg in ipairs(tr.configs) do\nlocal values = opts.ontarget(tr, target, cfg)\nadd_options(values, cfg.xcodetargetopts)\nxcode.XCBuildConfiguration_Impl(tr, cfg.xcode.targetid, values, cfg)\nend\nend\nfor _, cfg in ipairs(tr.configs) do\nlocal values = opts.onproject(tr, prj, cfg)\nadd_options(values, cfg.xcodeprojectopts)\nadd_wholearchive_links(values, cfg)\nxcode.XCBuildConfiguration_Impl(tr, cfg.xcode.projectid, values, cfg)\nend\n_p('/* End XCBuildConfiguration section */')\n_p('')\nend\nfunction xcode.XCBuildConfigurationList(tr)\nlocal sln = tr.project.solution\n_p('/* Begin XCConfigurationList section */')\nfor _, target in ipair" - "s(tr.products.children) do\n_p(2,'%s /* Build configuration list for PBXNativeTarget \"%s\" */ = {', target.cfgsection, target.name)\n_p(3,'isa = XCConfigurationList;')\n_p(3,'buildConfigurations = (')\nfor _, cfg in ipairs(tr.configs) do\n_p(4,'%s /* %s */,', cfg.xcode.targetid, xcode.getconfigname(cfg))\nend\n_p(3,');')\n_p(3,'defaultConfigurationIsVisible = 0;')\n_p(3,'defaultConfigurationName = \"%s\";', xcode.getconfigname(tr.configs[1]))\n_p(2,'};')\nend\n_p(2,'1DEB928908733DD80010E9CD /* Build configuration list for PBXProject \"%s\" */ = {', tr.name)\n_p(3,'isa = XCConfigurationList;')\n_p(3,'buildConfigurations = (')\nfor _, cfg in ipairs(tr.configs) do\n_p(4,'%s /* %s */,', cfg.xcode.projectid, xcode.getconfigname(cfg))\nend\n_p(3,');')\n_p(3,'defaultConfigurationIsVisible = 0;')\n_p(3,'defaultConfigurationName = \"%s\";', xcode.getconfigname(tr.configs[1]))\n_p(2,'};')\n_p('/* End XCConfigurationList section */')\n_p('')\nend\nfunction xcode.Footer()\n_p(1,'};')\n_p('\\trootObject = __RootObject_ /*" - " Project object */;')\n_p('}')\nend\n", + "nd\n_p(4,');')\nend\nend\nfunction xcode.quotestr(str)\nif str:match(\"[^a-zA-Z0-9$._/]\") == nil then\nreturn str\nend\nreturn \"\\\"\" .. str:gsub(\"[\\\"\\\\\\\"]\", \"\\\\%0\") .. \"\\\"\"\nend\nfunction xcode.setdeploymenttarget(cfg, def, opts)\nlocal get_opt = function(opt, def)\nreturn (opt and #opt > 0) and opt or def\nend\nlocal iosversion = get_opt(cfg.iostargetplatformversion, def.iOSTargetPlatformVersion)\nlocal macosversion = get_opt(cfg.macostargetplatformversion, def.macOSTargetPlatformVersion)\nlocal tvosversion = get_opt(cfg.tvostargetplatformversion, def.tvOSTargetPlatformVersion)\nlocal visionosversion = get_opt(cfg.visionostargetplatformversion, def.visionOSTargetPlatformVersion)\nif iosversion then\nopts.IPHONEOS_DEPLOYMENT_TARGET = iosversion\nelseif macosversion then\nopts.MACOSX_DEPLOYMENT_TARGET = macosversion\nelseif tvosversion then\nopts.TVOS_DEPLOYMENT_TARGET = tvosversion\nelseif visionosversion then\nopts.XROS_DEPLOYMENT_TARGET = tvosversion\nend\nend\nfunction xcode.Header(tr, o" + "bjversion)\n_p('// !$*UTF8*$!')\n_p('{')\n_p(1,'archiveVersion = 1;')\n_p(1,'classes = {')\n_p(1,'};')\n_p(1,'objectVersion = %d;', objversion)\n_p(1,'objects = {')\n_p('')\nend\nfunction xcode.PBXBuildFile(tr)\nlocal function gatherCopyFiles(which)\nlocal copyfiles = {}\nlocal targets = tr.project[which]\nif #targets > 0 then\nfor _, t in ipairs(targets) do\nfor __, tt in ipairs(t) do\ntable.insertflat(copyfiles, tt[2])\nend\nend\nend\nreturn table.translate(copyfiles, path.getname)\nend\nlocal function gatherCopyFrameworks(which)\nlocal copyfiles = {}\nlocal targets = tr.project[which]\nif #targets > 0 then\ntable.insertflat(copyfiles, targets)\nend\nreturn table.translate(copyfiles, path.getname)\nend\nlocal copyfiles = table.flatten({\ngatherCopyFiles('xcodecopyresources'),\ngatherCopyFrameworks('xcodecopyframeworks')\n})\n_p('/* Begin PBXBuildFile section */')\ntree.traverse(tr, {\nonnode = function(node)\nif node.buildid then\n_p(2,'%s /* %s in %s */ = {isa = PBXBuildFile; fileRef = %s /* %s */; };',\nno" + "de.buildid, node.name, xcode.getbuildcategory(node), node.id, node.name)\nend\nif table.icontains(copyfiles, node.name) then\n_p(2,'%s /* %s in %s */ = {isa = PBXBuildFile; fileRef = %s /* %s */; %s };',\nxcode.uuid(node.name .. 'in CopyFiles'), node.name, 'CopyFiles', node.id, node.name,\niif(xcode.isframework(node.name), \"settings = {ATTRIBUTES = (CodeSignOnCopy, ); };\", \"\")\n)\nend\nend\n})\n_p('/* End PBXBuildFile section */')\n_p('')\nend\nfunction xcode.PBXContainerItemProxy(tr)\nif #tr.projects.children > 0 then\n_p('/* Begin PBXContainerItemProxy section */')\nfor _, node in ipairs(tr.projects.children) do\n_p(2,'%s /* PBXContainerItemProxy */ = {', node.productproxyid)\n_p(3,'isa = PBXContainerItemProxy;')\n_p(3,'containerPortal = %s /* %s */;', node.id, path.getname(node.path))\n_p(3,'proxyType = 2;')\n_p(3,'remoteGlobalIDString = %s;', node.project.xcode.projectnode.id)\n_p(3,'remoteInfo = \"%s\";', node.project.xcode.projectnode.name)\n_p(2,'};')\n_p(2,'%s /* PBXContainerItemProxy */ = {', node" + ".targetproxyid)\n_p(3,'isa = PBXContainerItemProxy;')\n_p(3,'containerPortal = %s /* %s */;', node.id, path.getname(node.path))\n_p(3,'proxyType = 1;')\n_p(3,'remoteGlobalIDString = %s;', node.project.xcode.projectnode.targetid)\n_p(3,'remoteInfo = \"%s\";', node.project.xcode.projectnode.name)\n_p(2,'};')\nend\n_p('/* End PBXContainerItemProxy section */')\n_p('')\nend\nend\nfunction xcode.PBXFileReference(tr,prj)\n_p('/* Begin PBXFileReference section */')\ntree.traverse(tr, {\nonleaf = function(node)\nif not node.path then\nreturn\nend\nif node.kind == \"product\" then\n_p(2,'%s /* %s */ = {isa = PBXFileReference; explicitFileType = %s; includeInIndex = 0; name = \"%s\"; path = \"%s\"; sourceTree = BUILT_PRODUCTS_DIR; };',\nnode.id, node.name, xcode.gettargettype(node), node.name, path.getname(node.cfg.buildtarget.bundlepath))\nelseif node.parent.parent == tr.projects then\nlocal relpath = path.getrelative(tr.project.location, node.parent.project.location)\n_p(2,'%s /* %s */ = {isa = PBXFileReference; lastK" + "nownFileType = \"wrapper.pb-project\"; name = \"%s\"; path = \"%s\"; sourceTree = SOURCE_ROOT; };',\nnode.parent.id, node.parent.name, node.parent.name, path.join(relpath, node.parent.name))\nelse\nlocal pth, src\nif xcode.isframework(node.path) then\nlocal nodePath = node.path\nlocal _, matchEnd, variable = string.find(nodePath, \"^%$%((.+)%)/\")\nif variable then\nnodePath = string.sub(nodePath, matchEnd + 1)\nend\nif string.find(nodePath,'/') then\nif string.find(nodePath,'^%.')then\nnodePath = path.getabsolute(path.join(tr.project.location, nodePath))\nend\npth = nodePath\nelseif path.getextension(nodePath)=='.tbd' then\npth = \"/usr/lib/\" .. nodePath\nelse\npth = \"/System/Library/Frameworks/\" .. nodePath\nend\nif variable then\nsrc = variable\nif string.find(pth, '^/') then\npth = string.sub(pth, 2)\nend\nelse\nsrc = \"\"\nend\nelse\nsrc = \"\"\nif node.location then\npth = node.location\nelseif node.parent.isvpath then\npth = node.cfg.name\nelse\npth = tree.getlocalpath(node)\nend\ne" + "nd\nif (not prj.options.ForceCPP) then\n_p(2,'%s /* %s */ = {isa = PBXFileReference; lastKnownFileType = %s; name = \"%s\"; path = \"%s\"; sourceTree = \"%s\"; };',\nnode.id, node.name, xcode.getfiletype(node), node.name, pth, src)\nelse\n_p(2,'%s /* %s */ = {isa = PBXFileReference; explicitFileType = %s; name = \"%s\"; path = \"%s\"; sourceTree = \"%s\"; };',\nnode.id, node.name, xcode.getfiletypeForced(node), node.name, pth, src)\nend\nend\nend\n})\n_p('/* End PBXFileReference section */')\n_p('')\nend\nfunction xcode.PBXFrameworksBuildPhase(tr)\n_p('/* Begin PBXFrameworksBuildPhase section */')\n_p(2,'%s /* Frameworks */ = {', tr.products.children[1].fxstageid)\n_p(3,'isa = PBXFrameworksBuildPhase;')\n_p(3,'buildActionMask = 2147483647;')\n_p(3,'files = (')\ntree.traverse(tr.frameworks, {\nonleaf = function(node)\n_p(4,'%s /* %s in Frameworks */,', node.buildid, node.name)\nend\n})\ntree.traverse(tr.projects, {\nonleaf = function(node)\n_p(4,'%s /* %s in Frameworks */,', node.buildid, node.name)\nend\n})\n_" + "p(3,');')\n_p(3,'runOnlyForDeploymentPostprocessing = 0;')\n_p(2,'};')\n_p('/* End PBXFrameworksBuildPhase section */')\n_p('')\nend\nfunction xcode.PBXGroup(tr)\n_p('/* Begin PBXGroup section */')\ntree.traverse(tr, {\nonnode = function(node)\nif (node.path and #node.children == 0) or node.kind == \"vgroup\" then\nreturn\nend\nif node.parent == tr.projects then\n_p(2,'%s /* Products */ = {', node.productgroupid)\nelse\n_p(2,'%s /* %s */ = {', node.id, node.name)\nend\n_p(3,'isa = PBXGroup;')\n_p(3,'children = (')\nfor _, childnode in ipairs(node.children) do\n_p(4,'%s /* %s */,', childnode.id, childnode.name)\nend\n_p(3,');')\nif node.parent == tr.projects then\n_p(3,'name = Products;')\nelse\n_p(3,'name = \"%s\";', node.name)\nif node.location then\n_p(3,'path = \"%s\";', node.location)\nelseif node.path and not node.isvpath then\nlocal p = node.path\nif node.parent.path then\np = path.getrelative(node.parent.path, node.path)\nend\n_p(3,'path = \"%s\";', p)\nend\nend\n_p(3,'sourceTree = \"\";')\n_p(2," + "'};')\nend\n}, true)\n_p('/* End PBXGroup section */')\n_p('')\nend\nfunction xcode.PBXNativeTarget(tr)\n_p('/* Begin PBXNativeTarget section */')\nfor _, node in ipairs(tr.products.children) do\nlocal name = tr.project.name\nlocal function hasBuildCommands(which)\nif #tr.project[which] > 0 then\nreturn true\nend\nfor _, cfg in ipairs(tr.configs) do\nif #cfg[which] > 0 then\nreturn true\nend\nend\nend\nlocal function dobuildblock(id, label, which, action)\nif hasBuildCommands(which) then\nlocal commandcount = 0\nfor _, cfg in ipairs(tr.configs) do\ncommandcount = commandcount + #cfg[which]\nend\nif commandcount > 0 then\naction(id, label)\nend\nend\nend\nlocal function doscriptphases(which, action)\nlocal i = 0\nfor _, cfg in ipairs(tr.configs) do\nlocal cfgcmds = cfg[which]\nif cfgcmds ~= nil then\nfor __, scripts in ipairs(cfgcmds) do\nfor ___, script in ipairs(scripts) do\nlocal cmd = script[1]\nlocal label = xcode.getscriptphaselabel(cmd, i, cfg)\nlocal id = xcode.uuid(label)\naction(id, label)\ni = i + 1" + "\nend\nend\nend\nend\nend\nlocal function docopyresources(which, action)\nif hasBuildCommands(which) then\nlocal targets = tr.project[which]\nif #targets > 0 then\nlocal i = 0\nfor _, t in ipairs(targets) do\nfor __, tt in ipairs(t) do\nlocal label = xcode.getcopyphaselabel('Resources', i, tt[1])\nlocal id = xcode.uuid(label)\naction(id, label)\ni = i + 1\nend\nend\nend\nend\nend\nlocal function docopyframeworks(which, action)\nif hasBuildCommands(which) then\nlocal targets = tr.project[which]\nif #targets > 0 then\nlocal label = \"Copy Frameworks\"\nlocal id = xcode.uuid(label)\naction(id, label)\nend\nend\nend\nlocal function _p_label(id, label)\n_p(4, '%s /* %s */,', id, label)\nend\n_p(2,'%s /* %s */ = {', node.targetid, name)\n_p(3,'isa = PBXNativeTarget;')\n_p(3,'buildConfigurationList = %s /* Build configuration list for PBXNativeTarget \"%s\" */;', node.cfgsection, name)\n_p(3,'buildPhases = (')\ndobuildblock('9607AE1010C857E500CD1376', 'Prebuild', 'prebuildcommands', _p_label)\n_p(4,'%s /* Resources *" + "/,', node.resstageid)\n_p(4,'%s /* Sources */,', node.sourcesid)\ndobuildblock('9607AE3510C85E7E00CD1376', 'Prelink', 'prelinkcommands', _p_label)\n_p(4,'%s /* Frameworks */,', node.fxstageid)\ndobuildblock('9607AE3710C85E8F00CD1376', 'Postbuild', 'postbuildcommands', _p_label)\ndoscriptphases(\"xcodescriptphases\", _p_label)\ndocopyresources(\"xcodecopyresources\", _p_label)\nif tr.project.kind == \"WindowedApp\" then\ndocopyframeworks(\"xcodecopyframeworks\", _p_label)\nend\n_p(3,');')\n_p(3,'buildRules = (')\n_p(3,');')\n_p(3,'dependencies = (')\nfor _, node in ipairs(tr.projects.children) do\n_p(4,'%s /* PBXTargetDependency */,', node.targetdependid)\nend\n_p(3,');')\n_p(3,'name = \"%s\";', name)\nlocal p\nif node.cfg.kind == \"ConsoleApp\" then\np = \"$(HOME)/bin\"\nelseif node.cfg.kind == \"WindowedApp\" then\np = \"$(HOME)/Applications\"\nend\nif p then\n_p(3,'productInstallPath = \"%s\";', p)\nend\n_p(3,'productName = \"%s\";', name)\n_p(3,'productReference = %s /* %s */;', node.id, node.name)\n_p(3,'p" + "roductType = \"%s\";', xcode.getproducttype(node))\n_p(2,'};')\nend\n_p('/* End PBXNativeTarget section */')\n_p('')\nend\nfunction xcode.PBXProject(tr, compatVersion)\n_p('/* Begin PBXProject section */')\n_p(2,'__RootObject_ /* Project object */ = {')\n_p(3,'isa = PBXProject;')\n_p(3,'buildConfigurationList = 1DEB928908733DD80010E9CD /* Build configuration list for PBXProject \"%s\" */;', tr.name)\n_p(3,'compatibilityVersion = \"Xcode %s\";', compatVersion)\n_p(3,'hasScannedForEncodings = 1;')\n_p(3,'mainGroup = %s /* %s */;', tr.id, tr.name)\n_p(3,'projectDirPath = \"\";')\nif #tr.projects.children > 0 then\n_p(3,'projectReferences = (')\nfor _, node in ipairs(tr.projects.children) do\n_p(4,'{')\n_p(5,'ProductGroup = %s /* Products */;', node.productgroupid)\n_p(5,'ProjectRef = %s /* %s */;', node.id, path.getname(node.path))\n_p(4,'},')\nend\n_p(3,');')\nend\n_p(3,'projectRoot = \"\";')\n_p(3,'targets = (')\nfor _, node in ipairs(tr.products.children) do\n_p(4,'%s /* %s */,', node.targetid, node.name)\nend" + "\n_p(3,');')\n_p(2,'};')\n_p('/* End PBXProject section */')\n_p('')\nend\nfunction xcode.PBXReferenceProxy(tr)\nif #tr.projects.children > 0 then\n_p('/* Begin PBXReferenceProxy section */')\ntree.traverse(tr.projects, {\nonleaf = function(node)\n_p(2,'%s /* %s */ = {', node.id, node.name)\n_p(3,'isa = PBXReferenceProxy;')\n_p(3,'fileType = %s;', xcode.gettargettype(node))\n_p(3,'path = \"%s\";', node.path)\n_p(3,'remoteRef = %s /* PBXContainerItemProxy */;', node.parent.productproxyid)\n_p(3,'sourceTree = BUILT_PRODUCTS_DIR;')\n_p(2,'};')\nend\n})\n_p('/* End PBXReferenceProxy section */')\n_p('')\nend\nend\nfunction xcode.PBXResourcesBuildPhase(tr)\n_p('/* Begin PBXResourcesBuildPhase section */')\nfor _, target in ipairs(tr.products.children) do\n_p(2,'%s /* Resources */ = {', target.resstageid)\n_p(3,'isa = PBXResourcesBuildPhase;')\n_p(3,'buildActionMask = 2147483647;')\n_p(3,'files = (')\ntree.traverse(tr, {\nonnode = function(node)\nif xcode.getbuildcategory(node) == \"Resources\" then\n_p(4,'%s /* %s " + "in Resources */,', node.buildid, node.name)\nend\nend\n})\n_p(3,');')\n_p(3,'runOnlyForDeploymentPostprocessing = 0;')\n_p(2,'};')\nend\n_p('/* End PBXResourcesBuildPhase section */')\n_p('')\nend\nfunction xcode.PBXShellScriptBuildPhase(tr)\nlocal wrapperWritten = false\nlocal function doblock(id, name, commands, files)\nif commands ~= nil then\ncommands = table.flatten(commands)\nend\nif #commands > 0 then\nif not wrapperWritten then\n_p('/* Begin PBXShellScriptBuildPhase section */')\nwrapperWritten = true\nend\n_p(2,'%s /* %s */ = {', id, name)\n_p(3,'isa = PBXShellScriptBuildPhase;')\n_p(3,'buildActionMask = 2147483647;')\n_p(3,'files = (')\n_p(3,');')\n_p(3,'inputPaths = (');\nif files ~= nil then\nfiles = table.flatten(files)\nif #files > 0 then\nfor _, file in ipairs(files) do\n_p(4, '\"%s\",', file)\nend\nend\nend\n_p(3,');');\n_p(3,'name = %s;', name);\n_p(3,'outputPaths = (');\n_p(3,');');\n_p(3,'runOnlyForDeploymentPostprocessing = 0;');\n_p(3,'shellPath = /bin/sh;');\n_p(3,'shellScript = \"%s\";'," + " table.concat(commands, \"\\\\n\"):gsub('\"', '\\\\\"'))\n_p(2,'};')\nend\nend\nlocal function wrapcommands(cmds, cfg)\nlocal commands = {}\nif #cmds > 0 then\ntable.insert(commands, 'if [ \"${CONFIGURATION}\" = \"' .. xcode.getconfigname(cfg) .. '\" ]; then')\nfor i = 1, #cmds do\nlocal cmd = cmds[i]\ncmd = cmd:gsub('\\\\','\\\\\\\\')\ntable.insert(commands, cmd)\nend\ntable.insert(commands, 'fi')\nend\nreturn commands\nend\nlocal function dobuildblock(id, name, which)\nlocal commands = {}\nfor _, cfg in ipairs(tr.configs) do\nlocal cfgcmds = wrapcommands(cfg[which], cfg)\nif #cfgcmds > 0 then\nfor i, cmd in ipairs(cfgcmds) do\ntable.insert(commands, cmd)\nend\nend\nend\ndoblock(id, name, commands)\nend\nlocal function doscriptphases(which)\nlocal i = 0\nfor _, cfg in ipairs(tr.configs) do\nlocal cfgcmds = cfg[which]\nif cfgcmds ~= nil then\nfor __, scripts in ipairs(cfgcmds) do\nfor ___, script in ipairs(scripts) do\nlocal cmd = script[1]\nlocal files = script[2]\nlocal label = xcode.getscriptphaselabel(cmd," + " i, cfg)\nlocal id = xcode.uuid(label)\ndoblock(id, label, wrapcommands({cmd}, cfg), files)\ni = i + 1\nend\nend\nend\nend\nend\ndobuildblock(\"9607AE1010C857E500CD1376\", \"Prebuild\", \"prebuildcommands\")\ndobuildblock(\"9607AE3510C85E7E00CD1376\", \"Prelink\", \"prelinkcommands\")\ndobuildblock(\"9607AE3710C85E8F00CD1376\", \"Postbuild\", \"postbuildcommands\")\ndoscriptphases(\"xcodescriptphases\")\nif wrapperWritten then\n_p('/* End PBXShellScriptBuildPhase section */')\nend\nend\nfunction xcode.PBXSourcesBuildPhase(tr,prj)\n_p('/* Begin PBXSourcesBuildPhase section */')\nfor _, target in ipairs(tr.products.children) do\n_p(2,'%s /* Sources */ = {', target.sourcesid)\n_p(3,'isa = PBXSourcesBuildPhase;')\n_p(3,'buildActionMask = 2147483647;')\n_p(3,'files = (')\ntree.traverse(tr, {\nonleaf = function(node)\nif xcode.getbuildcategory(node) == \"Sources\" then\nif not table.icontains(prj.excludes, node.cfg.name) then -- if not excluded\n_p(4,'%s /* %s in Sources */,', node.buildid, node.name)\nend\nend\nend" + "\n})\n_p(3,');')\n_p(3,'runOnlyForDeploymentPostprocessing = 0;')\n_p(2,'};')\nend\n_p('/* End PBXSourcesBuildPhase section */')\n_p('')\nend\nfunction xcode.PBXCopyFilesBuildPhase(tr)\nlocal wrapperWritten = false\nlocal function doblock(id, name, folderSpec, path, files)\nif #files > 0 then\nif not wrapperWritten then\n_p('/* Begin PBXCopyFilesBuildPhase section */')\nwrapperWritten = true\nend\n_p(2,'%s /* %s */ = {', id, name)\n_p(3,'isa = PBXCopyFilesBuildPhase;')\n_p(3,'buildActionMask = 2147483647;')\n_p(3,'dstPath = \\\"%s\\\";', path)\n_p(3,'dstSubfolderSpec = \\\"%s\\\";', folderSpec)\n_p(3,'files = (')\ntree.traverse(tr, {\nonleaf = function(node)\nif table.icontains(files, node.name) then\n_p(4,'%s /* %s in %s */,',\nxcode.uuid(node.name .. 'in CopyFiles'), node.name, 'CopyFiles')\nend\nend\n})\n_p(3,');')\n_p(3,'runOnlyForDeploymentPostprocessing = 0;');\n_p(2,'};')\nend\nend\nlocal function docopyresources(which)\nlocal targets = tr.project[which]\nif #targets > 0 then\nlocal i = 0\nfor _, t in i" + "pairs(targets) do\nfor __, tt in ipairs(t) do\nlocal label = xcode.getcopyphaselabel('Resources', i, tt[1])\nlocal id = xcode.uuid(label)\nlocal files = table.translate(table.flatten(tt[2]), path.getname)\ndoblock(id, label, 7, tt[1], files)\ni = i + 1\nend\nend\nend\nend\nlocal function docopyframeworks(which)\nlocal targets = tr.project[which]\nif #targets > 0 then\nlocal label = \"Copy Frameworks\"\nlocal id = xcode.uuid(label)\nlocal files = table.translate(table.flatten(targets), path.getname)\ndoblock(id, label, 10, \"\", files)\nend\nend\ndocopyresources(\"xcodecopyresources\")\nif tr.project.kind == \"WindowedApp\" then\ndocopyframeworks(\"xcodecopyframeworks\")\nend\nif wrapperWritten then\n_p('/* End PBXCopyFilesBuildPhase section */')\nend\nend\nfunction xcode.PBXVariantGroup(tr)\n_p('/* Begin PBXVariantGroup section */')\ntree.traverse(tr, {\nonbranch = function(node)\nif node.kind == \"vgroup\" then\n_p(2,'%s /* %s */ = {', node.id, node.name)\n_p(3,'isa = PBXVariantGroup;')\n_p(3,'children = (')" + "\nfor _, lang in ipairs(node.children) do\n_p(4,'%s /* %s */,', lang.id, lang.name)\nend\n_p(3,');')\n_p(3,'name = %s;', node.name)\n_p(3,'sourceTree = \"\";')\n_p(2,'};')\nend\nend\n})\n_p('/* End PBXVariantGroup section */')\n_p('')\nend\nfunction xcode.PBXTargetDependency(tr)\nif #tr.projects.children > 0 then\n_p('/* Begin PBXTargetDependency section */')\ntree.traverse(tr.projects, {\nonleaf = function(node)\n_p(2,'%s /* PBXTargetDependency */ = {', node.parent.targetdependid)\n_p(3,'isa = PBXTargetDependency;')\n_p(3,'name = \"%s\";', node.name)\n_p(3,'targetProxy = %s /* PBXContainerItemProxy */;', node.parent.targetproxyid)\n_p(2,'};')\nend\n})\n_p('/* End PBXTargetDependency section */')\n_p('')\nend\nend\nfunction xcode.cfg_excluded_files(prj, cfg)\nlocal excluded = {}\nlocal function exclude_pattern(file)\nif path.isabsolute(file) then\nreturn file\nend\nlocal start, term = file:findlast(\"/%.%./\")\nif term then\nreturn path.join(\"*\", file:sub(term + 1))\nend\nstart, term = file:find(\"%.%" + "./\")\nif start == 1 then\nreturn path.join(\"*\", file:sub(term + 1))\nend\nreturn path.join(\"*\", file)\nend\nlocal function add_file(file)\nlocal name = exclude_pattern(file)\nif not table.icontains(excluded, name) then\ntable.insert(excluded, name)\nend\nend\nlocal function verify_file(file)\nlocal name = exclude_pattern(file)\nif table.icontains(excluded, name) then\nerror(\"'\" .. file .. \"' would be excluded by the rule to exclude '\" .. name .. \"'\")\nend\nend\nfor _, file in ipairs(cfg.excludes) do\nadd_file(file)\nend\nfor _, file in ipairs(prj.allfiles) do\nif not table.icontains(prj.excludes, file) and not table.icontains(cfg.excludes, file) then\nif not table.icontains(cfg.files, file) then\nadd_file(file)\nelse\nverify_file(file)\nend\nend\nend\ntable.sort(excluded)\nreturn excluded\nend\nfunction xcode.XCBuildConfiguration_Impl(tr, id, opts, cfg)\nlocal cfgname = xcode.getconfigname(cfg)\n_p(2,'%s /* %s */ = {', id, cfgname)\n_p(3,'isa = XCBuildConfiguration;')\n_p(3,'buildSettings = {')\nfor" + " k, v in table.sortedpairs(opts) do\nif type(v) == \"table\" then\nif #v > 0 then\n_p(4,'%s = (', k)\nfor i, v2 in ipairs(v) do\n_p(5,'%s,', xcode.quotestr(tostring(v2)))\nend\n_p(4,');')\nend\nelse\n_p(4,'%s = %s;', k, xcode.quotestr(tostring(v)))\nend\nend\n_p(3,'};')\n_p(3,'name = %s;', xcode.quotestr(cfgname))\n_p(2,'};')\nend\nlocal function add_options(options, extras)\nfor _, tbl in ipairs(extras) do\nfor tkey, tval in pairs(tbl) do\noptions[tkey] = tval\nend\nend\nend\nlocal function add_wholearchive_links(opts, cfg)\nif #cfg.wholearchive > 0 then\nlocal linkopts = {}\nfor _, depcfg in ipairs(premake.getlinks(cfg, \"siblings\", \"object\")) do\nif table.icontains(cfg.wholearchive, depcfg.project.name) then\nlocal linkpath = path.rebase(depcfg.linktarget.fullpath, depcfg.location, cfg.location)\ntable.insert(linkopts, \"-force_load\")\ntable.insert(linkopts, linkpath)\nend\nend\nif opts.OTHER_LDFLAGS then\nlinkopts = table.join(linkopts, opts.OTHER_LDFLAGS)\nend\nopts.OTHER_LDFLAGS = linkopts\nend\nend" + "\nfunction xcode.XCBuildConfiguration(tr, prj, opts)\n_p('/* Begin XCBuildConfiguration section */')\nfor _, target in ipairs(tr.products.children) do\nfor _, cfg in ipairs(tr.configs) do\nlocal values = opts.ontarget(tr, target, cfg)\nadd_options(values, cfg.xcodetargetopts)\nxcode.XCBuildConfiguration_Impl(tr, cfg.xcode.targetid, values, cfg)\nend\nend\nfor _, cfg in ipairs(tr.configs) do\nlocal values = opts.onproject(tr, prj, cfg)\nadd_options(values, cfg.xcodeprojectopts)\nadd_wholearchive_links(values, cfg)\nxcode.XCBuildConfiguration_Impl(tr, cfg.xcode.projectid, values, cfg)\nend\n_p('/* End XCBuildConfiguration section */')\n_p('')\nend\nfunction xcode.XCBuildConfigurationList(tr)\nlocal sln = tr.project.solution\n_p('/* Begin XCConfigurationList section */')\nfor _, target in ipairs(tr.products.children) do\n_p(2,'%s /* Build configuration list for PBXNativeTarget \"%s\" */ = {', target.cfgsection, target.name)\n_p(3,'isa = XCConfigurationList;')\n_p(3,'buildConfigurations = (')\nfor _, cfg in ipairs" + "(tr.configs) do\n_p(4,'%s /* %s */,', cfg.xcode.targetid, xcode.getconfigname(cfg))\nend\n_p(3,');')\n_p(3,'defaultConfigurationIsVisible = 0;')\n_p(3,'defaultConfigurationName = \"%s\";', xcode.getconfigname(tr.configs[1]))\n_p(2,'};')\nend\n_p(2,'1DEB928908733DD80010E9CD /* Build configuration list for PBXProject \"%s\" */ = {', tr.name)\n_p(3,'isa = XCConfigurationList;')\n_p(3,'buildConfigurations = (')\nfor _, cfg in ipairs(tr.configs) do\n_p(4,'%s /* %s */,', cfg.xcode.projectid, xcode.getconfigname(cfg))\nend\n_p(3,');')\n_p(3,'defaultConfigurationIsVisible = 0;')\n_p(3,'defaultConfigurationName = \"%s\";', xcode.getconfigname(tr.configs[1]))\n_p(2,'};')\n_p('/* End XCConfigurationList section */')\n_p('')\nend\nfunction xcode.versionge(version, reference)\nlocal vparts = string.explode(version, \".\", true)\nlocal rparts = string.explode(reference, \".\", true)\nfor i=1,#rparts do\nlocal rnum = tonumber(rparts[i]) or 0\nlocal vnum = tonumber(vparts[i]) or 0\nif vnum < rnum then\nreturn false\nend\nend" + "\nreturn true\nend\nfunction xcode.Footer()\n_p(1,'};')\n_p('\\trootObject = __RootObject_ /* Project object */;')\n_p('}')\nend\n", /* actions/xcode/xcode_project.lua */ "local xcode = premake.xcode\nlocal tree = premake.tree\nfunction xcode.buildprjtree(prj)\nlocal tr = premake.project.buildsourcetree(prj, true)\ntr.configs = {}\nfor _, cfgname in ipairs(prj.solution.configurations) do\nfor _, platform in ipairs(prj.solution.xcode.platforms) do\nlocal cfg = premake.getconfig(prj, cfgname, platform)\ncfg.xcode = {}\ncfg.xcode.targetid = xcode.newid(prj.xcode.projectnode, \"tgt:\"..platform..cfgname)\ncfg.xcode.projectid = xcode.newid(tr, \"prj:\"..platform..cfgname)\ntable.insert(tr.configs, cfg)\nend\nend\ntree.traverse(tr, {\nonbranch = function(node)\nif path.getextension(node.name) == \".lproj\" then\nlocal lang = path.getbasename(node.name) -- \"English\", \"French\", etc.\nfor _, filenode in ipairs(node.children) do\nlocal grpnode = node.parent.children[filenode.name]\nif not grpnode then\ngrpnode = tree.insert(node.parent, tree.new(filenode.name))\ngrpnode.kind = \"vgroup\"\nend\nfilenode.name = path.getbasename(lang)\ntree.insert(grpnode, filenode)\nend\ntree.remove(no" @@ -426,49 +441,41 @@ const char* builtin_scripts[] = { /* actions/xcode/xcode8.lua */ "local premake = premake\npremake.xcode8 = { }\nlocal xcode = premake.xcode\nlocal xcode8 = premake.xcode8\nfunction xcode8.XCBuildConfiguration_Target(tr, target, cfg)\nlocal cfgname = xcode.getconfigname(cfg)\nlocal installpaths = {\nConsoleApp = \"/usr/local/bin\",\nWindowedApp = \"$(HOME)/Applications\",\nSharedLib = \"/usr/local/lib\",\nStaticLib = \"/usr/local/lib\",\nBundle = \"$(LOCAL_LIBRARY_DIR)/Bundles\",\n}\nlocal options = {\nALWAYS_SEARCH_USER_PATHS = \"NO\",\nGCC_DYNAMIC_NO_PIC = \"NO\",\nGCC_MODEL_TUNING = \"G5\",\nINSTALL_PATH = installpaths[cfg.kind],\nPRODUCT_NAME = cfg.buildtarget.basename,\n}\nif not cfg.flags.Symbols then\noptions.DEBUG_INFORMATION_FORMAT = \"dwarf-with-dsym\"\nend\nif cfg.kind ~= \"StaticLib\" and cfg.buildtarget.prefix ~= \"\" then\noptions.EXECUTABLE_PREFIX = cfg.buildtarget.prefix\nend\nif cfg.targetextension then\nlocal ext = cfg.targetextension\noptions.EXECUTABLE_EXTENSION = iif(ext:startswith(\".\"), ext:sub(2), ext)\nend\nif cfg.flags.ObjcARC then\noptions.CLA" - "NG_ENABLE_OBJC_ARC = \"YES\"\nend\nlocal outdir = path.getdirectory(cfg.buildtarget.bundlepath)\nif outdir ~= \".\" then\noptions.CONFIGURATION_BUILD_DIR = outdir\nend\nif tr.infoplist then\noptions.INFOPLIST_FILE = tr.infoplist.cfg.name\nend\nlocal infoplist_file = nil\nfor _, v in ipairs(cfg.files) do\nif (string.find (string.lower (v), 'info.plist') ~= nil) then\ninfoplist_file = string.format('$(SRCROOT)/%s', v)\nend\nend\nif infoplist_file ~= nil then\noptions.INFOPLIST_FILE = infoplist_file\nend\nlocal action = premake.action.current()\nlocal get_opt = function(opt, def)\nreturn (opt and #opt > 0) and opt or def\nend\nlocal iosversion = get_opt(cfg.iostargetplatformversion, action.xcode.iOSTargetPlatformVersion)\nlocal macosversion = get_opt(cfg.macostargetplatformversion, action.xcode.macOSTargetPlatformVersion)\nlocal tvosversion = get_opt(cfg.tvostargetplatformversion, action.xcode.tvOSTargetPlatformVersion)\nif iosversion then\noptions.IPHONEOS_DEPLOYMENT_TARGET = iosversion\nelseif macosversion then" - "\noptions.MACOSX_DEPLOYMENT_TARGET = macosversion\nelseif tvosversion then\noptions.TVOS_DEPLOYMENT_TARGET = tvosversion\nend\nif cfg.kind == \"Bundle\" and not cfg.options.SkipBundling then\noptions.PRODUCT_BUNDLE_IDENTIFIER = \"genie.\" .. cfg.buildtarget.basename:gsub(\"%s+\", \".\") --replace spaces with .\nlocal ext = cfg.targetextension\nif ext then\noptions.WRAPPER_EXTENSION = iif(ext:startswith(\".\"), ext:sub(2), ext)\nelse\noptions.WRAPPER_EXTENSION = \"bundle\"\nend\nend\nreturn options\nend\nfunction xcode8.XCBuildConfiguration_Project(tr, prj, cfg)\nlocal cfgname = xcode.getconfigname(cfg)\nlocal archs = {\nNative = nil,\nx32 = \"i386\",\nx64 = \"x86_64\",\nUniversal32 = \"$(ARCHS_STANDARD_32_BIT)\",\nUniversal64 = \"$(ARCHS_STANDARD_64_BIT)\",\nUniversal = \"$(ARCHS_STANDARD_32_64_BIT)\",\n}\nlocal checks = {\n[\"-ffast-math\"] = cfg.flags.FloatFast,\n[\"-ffloat-store\"] = cfg.flags.FloatStrict,\n[\"-fomit-frame-pointer\"] = cfg.flags.NoFramePointer,\n}\nloc" - "al cflags = { }\nfor flag, check in pairs(checks) do\nif check then\ntable.insert(cflags, flag)\nend\nend\nlocal ldflags = { }\nfor _, lib in ipairs(premake.getlinks(cfg, \"system\")) do\nif not xcode.isframework(lib) then\ntable.insert(ldflags, \"-l\" .. lib)\nend\nend\nlocal options = {\nARCHS = archs[cfg.platform],\nCLANG_WARN__DUPLICATE_METHOD_MATCH = \"YES\",\nCLANG_WARN_BOOL_CONVERSION = \"YES\",\nCLANG_WARN_CONSTANT_CONVERSION = \"YES\",\nCLANG_WARN_EMPTY_BODY = \"YES\",\nCLANG_WARN_ENUM_CONVERSION = \"YES\",\nCLANG_WARN_INFINITE_RECURSION = \"YES\",\nCLANG_WARN_INT_CONVERSION = \"YES\",\nCLANG_WARN_SUSPICIOUS_MOVE = \"YES\",\nCLANG_WARN_UNREACHABLE_CODE = \"YES\",\nCONFIGURATION_TEMP_DIR = \"$(OBJROOT)\",\nENABLE_STRICT_OBJC_MSGSEND = \"YES\",\nENABLE_TESTABILITY = \"YES\",\nGCC_C_LANGUAGE_STANDARD = \"gnu99\",\nGCC_NO_COMMON_BLOCKS = \"YES\",\nGCC_PREP" - "ROCESSOR_DEFINITIONS = cfg.defines,\nGCC_SYMBOLS_PRIVATE_EXTERN = \"NO\",\nGCC_WARN_64_TO_32_BIT_CONVERSION = \"YES\",\nGCC_WARN_ABOUT_RETURN_TYPE = \"YES\",\nGCC_WARN_UNDECLARED_SELECTOR = \"YES\",\nGCC_WARN_UNINITIALIZED_AUTOS = \"YES\",\nGCC_WARN_UNUSED_FUNCTION = \"YES\",\nGCC_WARN_UNUSED_VARIABLE = \"YES\",\nHEADER_SEARCH_PATHS = table.join(cfg.includedirs, cfg.systemincludedirs),\nLIBRARY_SEARCH_PATHS = cfg.libdirs,\nOBJROOT = cfg.objectsdir,\nONLY_ACTIVE_ARCH = \"YES\",\nOTHER_CFLAGS = table.join(cflags, cfg.buildoptions, cfg.buildoptions_c),\nOTHER_CPLUSPLUSFLAGS = table.join(cflags, cfg.buildoptions, cfg.buildoptions_cpp),\nOTHER_LDFLAGS = table.join(ldflags, cfg.linkoptions),\nSDKROOT = xcode.toolset,\nUSER_HEADER_SEARCH_PATHS = cfg.userincludedirs,\n}\nif tr.entitlements then\nop" - "tions.CODE_SIGN_ENTITLEMENTS = tr.entitlements.cfg.name\nend\nlocal targetdir = path.getdirectory(cfg.buildtarget.bundlepath)\nif targetdir ~= \".\" then\noptions.CONFIGURATION_BUILD_DIR = \"$(SYMROOT)\"\noptions.SYMROOT = targetdir\nend\nif cfg.flags.Symbols then\noptions.COPY_PHASE_STRIP = \"NO\"\nend\nlocal excluded = xcode.cfg_excluded_files(prj, cfg)\nif #excluded > 0 then\noptions.EXCLUDED_SOURCE_FILE_NAMES = excluded\nend\nif cfg.flags.NoExceptions then\noptions.GCC_ENABLE_CPP_EXCEPTIONS = \"NO\"\nend\nif cfg.flags.NoRTTI then\noptions.GCC_ENABLE_CPP_RTTI = \"NO\"\nend\nif cfg.flags.Symbols and not cfg.flags.NoEditAndContinue then\noptions.GCC_ENABLE_FIX_AND_CONTINUE = \"YES\"\nend\nif cfg.flags.NoExceptions then\noptions.GCC_ENABLE_OBJC_EXCEPTIONS = \"NO\"\nend\nif cfg.flags.Optimize or cfg.flags.OptimizeSize then\noptions.GCC_OPTIMIZATION_LEVEL = \"s\"\nelseif cfg.flags.OptimizeSpeed then\noptions.GCC_OPTIMIZATION_LEVEL = 3\nelse\noptions.GCC_OPTIMIZATION_LEVEL = 0\nend\nif cfg.pchheader and not cfg.f" - "lags.NoPCH then\noptions.GCC_PRECOMPILE_PREFIX_HEADER = \"YES\"\nlocal pch = cfg.pchheader\nfor _, incdir in ipairs(cfg.includedirs) do\nlocal abspath = path.getabsolute(path.join(cfg.project.location, incdir))\nlocal testname = path.join(abspath, pch)\nif os.isfile(testname) then\npch = path.getrelative(cfg.location, testname)\nbreak\nend\nend\noptions.GCC_PREFIX_HEADER = pch\nend\nif cfg.flags.FatalWarnings then\noptions.GCC_TREAT_WARNINGS_AS_ERRORS = \"YES\"\nend\nif cfg.kind == \"Bundle\" then\noptions.MACH_O_TYPE = \"mh_bundle\"\nend\nif cfg.flags.StaticRuntime then\noptions.STANDARD_C_PLUS_PLUS_LIBRARY_TYPE = \"static\"\nend\nif cfg.flags.PedanticWarnings or cfg.flags.ExtraWarnings then\noptions.WARNING_CFLAGS = \"-Wall\"\nend\nif cfg.flags.Cpp11 then\noptions.CLANG_CXX_LANGUAGE_STANDARD = \"c++11\"\nelseif cfg.flags.Cpp14 or cfg.flags.CppLatest then\noptions.CLANG_CXX_LANGUAGE_STANDARD = \"c++14\"\nelseif cfg.flags.Cpp17 then\nif premake.action.current() == premake.action.get(\"xcode8\") then\nerror(\"X" - "Code8 does not support C++17.\")\nend\nend\nfor _, val in ipairs(premake.xcode.parameters) do\nlocal eqpos = string.find(val, \"=\")\nif eqpos ~= nil then\nlocal key = string.trim(string.sub(val, 1, eqpos - 1))\nlocal value = string.trim(string.sub(val, eqpos + 1))\noptions[key] = value\nend\nend\nreturn options\nend\nfunction xcode8.project(prj)\nlocal tr = xcode.buildprjtree(prj)\nxcode.Header(tr, 48)\nxcode.PBXBuildFile(tr)\nxcode.PBXContainerItemProxy(tr)\nxcode.PBXFileReference(tr,prj)\nxcode.PBXFrameworksBuildPhase(tr)\nxcode.PBXGroup(tr)\nxcode.PBXNativeTarget(tr)\nxcode.PBXProject(tr, \"8.0\")\nxcode.PBXReferenceProxy(tr)\nxcode.PBXResourcesBuildPhase(tr)\nxcode.PBXShellScriptBuildPhase(tr)\nxcode.PBXCopyFilesBuildPhase(tr)\nxcode.PBXSourcesBuildPhase(tr,prj)\nxcode.PBXVariantGroup(tr)\nxcode.PBXTargetDependency(tr)\nxcode.XCBuildConfiguration(tr, prj, {\nontarget = xcode8.XCBuildConfiguration_Target,\nonproject = xcode8.XCBuildConfiguration_Project,\n})\nxcode.XCBuildConfigurationList(tr)\nxcode.Foote" - "r(tr)\nend\nnewaction\n{\ntrigger = \"xcode8\",\nshortname = \"Xcode 8\",\ndescription = \"Generate Apple Xcode 8 project files\",\nos = \"macosx\",\nvalid_kinds = { \"ConsoleApp\", \"WindowedApp\", \"StaticLib\", \"SharedLib\", \"Bundle\" },\nvalid_languages = { \"C\", \"C++\" },\nvalid_tools = {\ncc = { \"gcc\" },\n},\nvalid_platforms = {\nNative = \"Native\",\nx32 = \"Native 32-bit\",\nx64 = \"Native 64-bit\",\nUniversal = \"Universal\",\n},\ndefault_platform = \"Native\",\nonsolution = function(sln)\npremake.generate(sln, \"%%.xcworkspace/contents.xcworkspacedata\", xcode.workspace_generate)\npremake.generate(sln, \"%%.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings\", xcode.workspace_settings)\npremake.generate(sln, \"%%.xcworkspace/xcshareddata/xcschemes/-ALL-.xcscheme\", xcode.workspace_scheme)\nend,\nonproject = function(prj)\npremake.generate(prj, \"%%.xcodeproj/project.pbxproj\", xcode8.project)\nxcode.generate_schemes(prj, \"%%.xcodeproj/xcshareddata/" - "xcschemes\")\nend,\noncleanproject = function(prj)\npremake.clean.directory(prj, \"%%.xcodeproj\")\npremake.clean.directory(prj, \"%%.xcworkspace\")\nend,\noncheckproject = xcode.checkproject,\nxcode = {\niOSTargetPlatformVersion = nil,\nmacOSTargetPlatformVersion = nil,\ntvOSTargetPlatformVersion = nil,\n},\n}\n", + "NG_ENABLE_OBJC_ARC = \"YES\"\nend\nlocal outdir = path.getdirectory(cfg.buildtarget.bundlepath)\nif outdir ~= \".\" then\noptions.CONFIGURATION_BUILD_DIR = outdir\nend\nif tr.infoplist then\noptions.INFOPLIST_FILE = tr.infoplist.cfg.name\nend\nlocal infoplist_file = nil\nfor _, v in ipairs(cfg.files) do\nif (string.find (string.lower (v), 'info.plist') ~= nil) then\ninfoplist_file = string.format('$(SRCROOT)/%s', v)\nend\nend\nif infoplist_file ~= nil then\noptions.INFOPLIST_FILE = infoplist_file\nend\nlocal action = premake.action.current()\nxcode.setdeploymenttarget(cfg, action.xcode, options)\nif cfg.kind == \"Bundle\" and not cfg.options.SkipBundling then\noptions.PRODUCT_BUNDLE_IDENTIFIER = \"genie.\" .. cfg.buildtarget.basename:gsub(\"%s+\", \".\") --replace spaces with .\nlocal ext = cfg.targetextension\nif ext then\noptions.WRAPPER_EXTENSION = iif(ext:startswith(\".\"), ext:sub(2), ext)\nelse\noptions.WRAPPER_EXTENSION = \"bundle\"\nend\nend\nreturn options\nend\nfunction xcode8.XCBuildConfiguration_Pr" + "oject(tr, prj, cfg)\nlocal cfgname = xcode.getconfigname(cfg)\nlocal archs = {\nNative = nil,\nx32 = \"i386\",\nx64 = \"x86_64\",\nUniversal32 = \"$(ARCHS_STANDARD_32_BIT)\",\nUniversal64 = \"$(ARCHS_STANDARD_64_BIT)\",\nUniversal = \"$(ARCHS_STANDARD_32_64_BIT)\",\n}\nlocal checks = {\n[\"-ffast-math\"] = cfg.flags.FloatFast,\n[\"-ffloat-store\"] = cfg.flags.FloatStrict,\n[\"-fomit-frame-pointer\"] = cfg.flags.NoFramePointer,\n}\nlocal cflags = { }\nfor flag, check in pairs(checks) do\nif check then\ntable.insert(cflags, flag)\nend\nend\nlocal ldflags = { }\nfor _, lib in ipairs(premake.getlinks(cfg, \"system\")) do\nif not xcode.isframework(lib) then\ntable.insert(ldflags, \"-l\" .. lib)\nend\nend\nlocal options = {\nARCHS = archs[cfg.platform],\nCLANG_WARN__DUPLICATE_METHOD_MATCH = \"YES\",\nCLANG_WARN_BOOL_CONVERSION = \"YES\",\nCLANG_WARN_CONSTANT_CONVERSION = \"YES\",\nCLANG_WARN_EMPTY_BODY = \"YES\",\nCLANG_WARN" + "_ENUM_CONVERSION = \"YES\",\nCLANG_WARN_INFINITE_RECURSION = \"YES\",\nCLANG_WARN_INT_CONVERSION = \"YES\",\nCLANG_WARN_SUSPICIOUS_MOVE = \"YES\",\nCLANG_WARN_UNREACHABLE_CODE = \"YES\",\nCONFIGURATION_TEMP_DIR = \"$(OBJROOT)\",\nENABLE_STRICT_OBJC_MSGSEND = \"YES\",\nENABLE_TESTABILITY = \"YES\",\nGCC_C_LANGUAGE_STANDARD = \"gnu99\",\nGCC_NO_COMMON_BLOCKS = \"YES\",\nGCC_PREPROCESSOR_DEFINITIONS = cfg.defines,\nGCC_SYMBOLS_PRIVATE_EXTERN = \"NO\",\nGCC_WARN_64_TO_32_BIT_CONVERSION = \"YES\",\nGCC_WARN_ABOUT_RETURN_TYPE = \"YES\",\nGCC_WARN_UNDECLARED_SELECTOR = \"YES\",\nGCC_WARN_UNINITIALIZED_AUTOS = \"YES\",\nGCC_WARN_UNUSED_FUNCTION = \"YES\",\nGCC_WARN_UNUSED_VARIABLE = \"YES\",\nHEADER_SEARCH_PATHS = table.join(cfg.includedirs, cfg.systemincludedirs),\nLIBRARY_SEARCH_PATHS = cfg.libdirs,\nOBJROOT =" + " cfg.objectsdir,\nONLY_ACTIVE_ARCH = \"YES\",\nOTHER_CFLAGS = table.join(cflags, cfg.buildoptions, cfg.buildoptions_c),\nOTHER_CPLUSPLUSFLAGS = table.join(cflags, cfg.buildoptions, cfg.buildoptions_cpp),\nOTHER_LDFLAGS = table.join(ldflags, cfg.linkoptions),\nSDKROOT = xcode.toolset,\nUSER_HEADER_SEARCH_PATHS = cfg.userincludedirs,\n}\nif tr.entitlements then\noptions.CODE_SIGN_ENTITLEMENTS = tr.entitlements.cfg.name\nend\nlocal targetdir = path.getdirectory(cfg.buildtarget.bundlepath)\nif targetdir ~= \".\" then\noptions.CONFIGURATION_BUILD_DIR = \"$(SYMROOT)\"\noptions.SYMROOT = targetdir\nend\nif cfg.flags.Symbols then\noptions.COPY_PHASE_STRIP = \"NO\"\nend\nlocal excluded = xcode.cfg_excluded_files(prj, cfg)\nif #excluded > 0 then\noptions.EXCLUDED_SOURCE_FILE_NAMES = excluded\nend\nif cfg.flags.NoExceptions then\noptions.GCC_ENABLE_CPP_EXCEPTIONS = \"NO\"\nend\nif cfg.flags.NoRTTI then\noptions" + ".GCC_ENABLE_CPP_RTTI = \"NO\"\nend\nif cfg.flags.Symbols and not cfg.flags.NoEditAndContinue then\noptions.GCC_ENABLE_FIX_AND_CONTINUE = \"YES\"\nend\nif cfg.flags.NoExceptions then\noptions.GCC_ENABLE_OBJC_EXCEPTIONS = \"NO\"\nend\nif cfg.flags.Optimize or cfg.flags.OptimizeSize then\noptions.GCC_OPTIMIZATION_LEVEL = \"s\"\nelseif cfg.flags.OptimizeSpeed then\noptions.GCC_OPTIMIZATION_LEVEL = 3\nelse\noptions.GCC_OPTIMIZATION_LEVEL = 0\nend\nif cfg.pchheader and not cfg.flags.NoPCH then\noptions.GCC_PRECOMPILE_PREFIX_HEADER = \"YES\"\nlocal pch = cfg.pchheader\nfor _, incdir in ipairs(cfg.includedirs) do\nlocal abspath = path.getabsolute(path.join(cfg.project.location, incdir))\nlocal testname = path.join(abspath, pch)\nif os.isfile(testname) then\npch = path.getrelative(cfg.location, testname)\nbreak\nend\nend\noptions.GCC_PREFIX_HEADER = pch\nend\nif cfg.flags.FatalWarnings then\noptions.GCC_TREAT_WARNINGS_AS_ERRORS = \"YES\"\nend\nif cfg.kind == \"Bundle\" then\noptions.MACH_O_TYPE = \"mh_bundle\"\nend\nif" + " cfg.flags.StaticRuntime then\noptions.STANDARD_C_PLUS_PLUS_LIBRARY_TYPE = \"static\"\nend\nif cfg.flags.PedanticWarnings or cfg.flags.ExtraWarnings then\noptions.WARNING_CFLAGS = \"-Wall\"\nend\nif cfg.flags.Cpp11 then\noptions.CLANG_CXX_LANGUAGE_STANDARD = \"c++11\"\nelseif cfg.flags.Cpp14 or cfg.flags.CppLatest then\noptions.CLANG_CXX_LANGUAGE_STANDARD = \"c++14\"\nelseif cfg.flags.Cpp17 then\nif premake.action.current() == premake.action.get(\"xcode8\") then\nerror(\"XCode8 does not support C++17.\")\nend\nend\nfor _, val in ipairs(premake.xcode.parameters) do\nlocal eqpos = string.find(val, \"=\")\nif eqpos ~= nil then\nlocal key = string.trim(string.sub(val, 1, eqpos - 1))\nlocal value = string.trim(string.sub(val, eqpos + 1))\noptions[key] = value\nend\nend\nreturn options\nend\nfunction xcode8.project(prj)\nlocal tr = xcode.buildprjtree(prj)\nxcode.Header(tr, 48)\nxcode.PBXBuildFile(tr)\nxcode.PBXContainerItemProxy(tr)\nxcode.PBXFileReference(tr,prj)\nxcode.PBXFrameworksBuildPhase(tr)\nxcode.PBXGroup(t" + "r)\nxcode.PBXNativeTarget(tr)\nxcode.PBXProject(tr, \"8.0\")\nxcode.PBXReferenceProxy(tr)\nxcode.PBXResourcesBuildPhase(tr)\nxcode.PBXShellScriptBuildPhase(tr)\nxcode.PBXCopyFilesBuildPhase(tr)\nxcode.PBXSourcesBuildPhase(tr,prj)\nxcode.PBXVariantGroup(tr)\nxcode.PBXTargetDependency(tr)\nxcode.XCBuildConfiguration(tr, prj, {\nontarget = xcode8.XCBuildConfiguration_Target,\nonproject = xcode8.XCBuildConfiguration_Project,\n})\nxcode.XCBuildConfigurationList(tr)\nxcode.Footer(tr)\nend\nnewaction\n{\ntrigger = \"xcode8\",\nshortname = \"Xcode 8\",\ndescription = \"Generate Apple Xcode 8 project files\",\nos = \"macosx\",\nvalid_kinds = { \"ConsoleApp\", \"WindowedApp\", \"StaticLib\", \"SharedLib\", \"Bundle\" },\nvalid_languages = { \"C\", \"C++\" },\nvalid_tools = {\ncc = { \"gcc\" },\n},\nvalid_platforms = {\nNative = \"Native\",\nx32 = \"Native 32-bit\",\nx64 = \"Native 64-bit\",\nUniversal = \"Universal\",\n},\ndefault_platform = \"Native\",\nonsolution = function(s" + "ln)\npremake.generate(sln, \"%%.xcworkspace/contents.xcworkspacedata\", xcode.workspace_generate)\npremake.generate(sln, \"%%.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings\", xcode.workspace_settings)\npremake.generate(sln, \"%%.xcworkspace/xcshareddata/xcschemes/-ALL-.xcscheme\", xcode.workspace_scheme)\nend,\nonproject = function(prj)\npremake.generate(prj, \"%%.xcodeproj/project.pbxproj\", xcode8.project)\nxcode.generate_schemes(prj, \"%%.xcodeproj/xcshareddata/xcschemes\")\nend,\noncleanproject = function(prj)\npremake.clean.directory(prj, \"%%.xcodeproj\")\npremake.clean.directory(prj, \"%%.xcworkspace\")\nend,\noncheckproject = xcode.checkproject,\nxcode = {\niOSTargetPlatformVersion = nil,\nmacOSTargetPlatformVersion = nil,\ntvOSTargetPlatformVersion = nil,\n},\n}\n", /* actions/xcode/xcode9.lua */ - "local premake = premake\npremake.xcode9 = { }\nlocal xcode = premake.xcode\nlocal xcode8 = premake.xcode8\nlocal xcode9 = premake.xcode9\nfunction xcode9.XCBuildConfiguration_Project(tr, prj, cfg)\nlocal options = xcode8.XCBuildConfiguration_Project(tr, prj, cfg)\nif cfg.flags.Cpp17 or cfg.flags.CppLatest then\noptions.CLANG_CXX_LANGUAGE_STANDARD = \"c++17\"\nend\nreturn table.merge(options, {\nCLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = \"YES\",\nCLANG_WARN_COMMA = \"YES\",\nCLANG_WARN_NON_LITERAL_NULL_CONVERSION = \"YES\",\nCLANG_WARN_OBJC_LITERAL_CONVERSION = \"YES\",\nCLANG_WARN_RANGE_LOOP_ANALYSIS = \"YES\",\nCLANG_WARN_STRICT_PROTOTYPES = \"YES\",\n})\nend\nfunction xcode9.project(prj)\nlocal tr = xcode.buildprjtree(prj)\nxcode.Header(tr, 48)\nxcode.PBXBuildFile(tr)\nxcode.PBXContainerItemProxy(tr)\nxcode.PBXFileReference(tr,prj)\nxcode.PBXFrameworksBuildPhase(tr)\nxcode.PBXGroup(tr)\nxcode.PBXNativeTarget(tr)\nxcode.PBXProject(tr, \"8.0\")\nxcode.PBXReferenceProxy(tr)\nxcode.PBXResourcesBuildPhase(tr)\nxc" - "ode.PBXShellScriptBuildPhase(tr)\nxcode.PBXCopyFilesBuildPhase(tr)\nxcode.PBXSourcesBuildPhase(tr,prj)\nxcode.PBXVariantGroup(tr)\nxcode.PBXTargetDependency(tr)\nxcode.XCBuildConfiguration(tr, prj, {\nontarget = xcode8.XCBuildConfiguration_Target,\nonproject = xcode9.XCBuildConfiguration_Project,\n})\nxcode.XCBuildConfigurationList(tr)\nxcode.Footer(tr)\nend\nnewaction\n{\ntrigger = \"xcode9\",\nshortname = \"Xcode 9\",\ndescription = \"Generate Apple Xcode 9 project files\",\nos = \"macosx\",\nvalid_kinds = { \"ConsoleApp\", \"WindowedApp\", \"StaticLib\", \"SharedLib\", \"Bundle\" },\nvalid_languages = { \"C\", \"C++\" },\nvalid_tools = {\ncc = { \"gcc\" },\n},\nvalid_platforms = {\nNative = \"Native\",\nx32 = \"Native 32-bit\",\nx64 = \"Native 64-bit\",\nUniversal = \"Universal\",\n},\ndefault_platform = \"Native\",\nonsolution = function(sln)\npremake.generate(sln, \"%%.xcworkspace/contents.xcworkspacedata\", xcode.workspace_generate)\npremake.generate(sln, \"%%.x" - "cworkspace/xcshareddata/WorkspaceSettings.xcsettings\", xcode.workspace_settings)\npremake.generate(sln, \"%%.xcworkspace/xcshareddata/xcschemes/-ALL-.xcscheme\", xcode.workspace_scheme)\nend,\nonproject = function(prj)\npremake.generate(prj, \"%%.xcodeproj/project.pbxproj\", xcode9.project)\nxcode.generate_schemes(prj, \"%%.xcodeproj/xcshareddata/xcschemes\")\nend,\noncleanproject = function(prj)\npremake.clean.directory(prj, \"%%.xcodeproj\")\npremake.clean.directory(prj, \"%%.xcworkspace\")\nend,\noncheckproject = xcode.checkproject,\nxcode = {\niOSTargetPlatformVersion = nil,\nmacOSTargetPlatformVersion = nil,\ntvOSTargetPlatformVersion = nil,\n},\n}\n", + "local premake = premake\npremake.xcode9 = { }\nlocal xcode = premake.xcode\nlocal xcode8 = premake.xcode8\nlocal xcode9 = premake.xcode9\nfunction xcode9.XCBuildConfiguration_Project(tr, prj, cfg)\nlocal options = xcode8.XCBuildConfiguration_Project(tr, prj, cfg)\nif cfg.flags.Cpp17 then\noptions.CLANG_CXX_LANGUAGE_STANDARD = \"c++17\"\nelseif cfg.flags.Cpp20 or cfg.flags.CppLatest then\noptions.CLANG_CXX_LANGUAGE_STANDARD = \"c++20\"\nend\nreturn table.merge(options, {\nCLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = \"YES\",\nCLANG_WARN_COMMA = \"YES\",\nCLANG_WARN_NON_LITERAL_NULL_CONVERSION = \"YES\",\nCLANG_WARN_OBJC_LITERAL_CONVERSION = \"YES\",\nCLANG_WARN_RANGE_LOOP_ANALYSIS = \"YES\",\nCLANG_WARN_STRICT_PROTOTYPES = \"YES\",\n})\nend\nfunction xcode9.project(prj)\nlocal tr = xcode.buildprjtree(prj)\nxcode.Header(tr, 48)\nxcode.PBXBuildFile(tr)\nxcode.PBXContainerItemProxy(tr)\nxcode.PBXFileReference(tr,prj)\nxcode.PBXFrameworksBuildPhase(tr)\nxcode.PBXGroup(tr)\nxcode.PBXNativeTarget(tr)\nxcode.PBXProject(t" + "r, \"8.0\")\nxcode.PBXReferenceProxy(tr)\nxcode.PBXResourcesBuildPhase(tr)\nxcode.PBXShellScriptBuildPhase(tr)\nxcode.PBXCopyFilesBuildPhase(tr)\nxcode.PBXSourcesBuildPhase(tr,prj)\nxcode.PBXVariantGroup(tr)\nxcode.PBXTargetDependency(tr)\nxcode.XCBuildConfiguration(tr, prj, {\nontarget = xcode8.XCBuildConfiguration_Target,\nonproject = xcode9.XCBuildConfiguration_Project,\n})\nxcode.XCBuildConfigurationList(tr)\nxcode.Footer(tr)\nend\nnewaction\n{\ntrigger = \"xcode9\",\nshortname = \"Xcode 9\",\ndescription = \"Generate Apple Xcode 9 project files\",\nos = \"macosx\",\nvalid_kinds = { \"ConsoleApp\", \"WindowedApp\", \"StaticLib\", \"SharedLib\", \"Bundle\" },\nvalid_languages = { \"C\", \"C++\" },\nvalid_tools = {\ncc = { \"gcc\" },\n},\nvalid_platforms = {\nNative = \"Native\",\nx32 = \"Native 32-bit\",\nx64 = \"Native 64-bit\",\nUniversal = \"Universal\",\n},\ndefault_platform = \"Native\",\nonsolution = function(sln)\npremake.generate(sln, \"%%.xcworkspace/conte" + "nts.xcworkspacedata\", xcode.workspace_generate)\npremake.generate(sln, \"%%.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings\", xcode.workspace_settings)\npremake.generate(sln, \"%%.xcworkspace/xcshareddata/xcschemes/-ALL-.xcscheme\", xcode.workspace_scheme)\nend,\nonproject = function(prj)\npremake.generate(prj, \"%%.xcodeproj/project.pbxproj\", xcode9.project)\nxcode.generate_schemes(prj, \"%%.xcodeproj/xcshareddata/xcschemes\")\nend,\noncleanproject = function(prj)\npremake.clean.directory(prj, \"%%.xcodeproj\")\npremake.clean.directory(prj, \"%%.xcworkspace\")\nend,\noncheckproject = xcode.checkproject,\nxcode = {\niOSTargetPlatformVersion = nil,\nmacOSTargetPlatformVersion = nil,\ntvOSTargetPlatformVersion = nil,\n},\n}\n", /* actions/xcode/xcode10.lua */ "local premake = premake\npremake.xcode10 = { }\nlocal xcode = premake.xcode\nlocal xcode8 = premake.xcode8\nlocal xcode9 = premake.xcode9\nlocal xcode10 = premake.xcode10\nfunction xcode10.XCBuildConfiguration_Project(tr, prj, cfg)\nlocal options = xcode9.XCBuildConfiguration_Project(tr, prj, cfg)\nreturn table.merge(options, {\nCLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = \"YES\",\nCLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = \"YES\",\nCLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = \"YES\",\nCLANG_WARN_COMMA = \"YES\",\nCLANG_WARN_NON_LITERAL_NULL_CONVERSION = \"YES\",\nCLANG_WARN_OBJC_LITERAL_CONVERSION = \"YES\",\nCLANG_WARN_RANGE_LOOP_ANALYSIS = \"YES\",\nCLANG_WARN_STRICT_PROTOTYPES = \"YES\",\n})\nend\nfunction xcode10.XCBuildConfiguration_Target(tr, target, cfg)\nlocal options = xcode8.XCBuildConfiguration_Target(tr, target, cfg)\nif not cfg.flags.ObjcARC then\noptions.CLANG_ENABLE_OBJC_WEAK = \"YES\"\nend\nreturn options\nend\nfunction xcode10.project(prj)\nlocal tr = xcode.buildprjtree(prj)\nxcode.Header(tr, 48)" - "\nxcode.PBXBuildFile(tr)\nxcode.PBXContainerItemProxy(tr)\nxcode.PBXFileReference(tr,prj)\nxcode.PBXFrameworksBuildPhase(tr)\nxcode.PBXGroup(tr)\nxcode.PBXNativeTarget(tr)\nxcode.PBXProject(tr, \"8.0\")\nxcode.PBXReferenceProxy(tr)\nxcode.PBXResourcesBuildPhase(tr)\nxcode.PBXShellScriptBuildPhase(tr)\nxcode.PBXCopyFilesBuildPhase(tr)\nxcode.PBXSourcesBuildPhase(tr,prj)\nxcode.PBXVariantGroup(tr)\nxcode.PBXTargetDependency(tr)\nxcode.XCBuildConfiguration(tr, prj, {\nontarget = xcode10.XCBuildConfiguration_Target,\nonproject = xcode10.XCBuildConfiguration_Project,\n})\nxcode.XCBuildConfigurationList(tr)\nxcode.Footer(tr)\nend\nnewaction\n{\ntrigger = \"xcode10\",\nshortname = \"Xcode 10\",\ndescription = \"Generate Apple Xcode 10 project files (experimental)\",\nos = \"macosx\",\nvalid_kinds = { \"ConsoleApp\", \"WindowedApp\", \"StaticLib\", \"SharedLib\", \"Bundle\" },\nvalid_languages = { \"C\", \"C++\" },\nvalid_tools = {\ncc = { \"gcc\" },\n},\nvalid_platforms = {" - "\nNative = \"Native\",\nx32 = \"Native 32-bit\",\nx64 = \"Native 64-bit\",\nUniversal = \"Universal\",\n},\ndefault_platform = \"Native\",\nonsolution = function(sln)\npremake.generate(sln, \"%%.xcworkspace/contents.xcworkspacedata\", xcode.workspace_generate)\npremake.generate(sln, \"%%.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings\", xcode.workspace_settings)\npremake.generate(sln, \"%%.xcworkspace/xcshareddata/xcschemes/-ALL-.xcscheme\", xcode.workspace_scheme)\nend,\nonproject = function(prj)\npremake.generate(prj, \"%%.xcodeproj/project.pbxproj\", xcode10.project)\nxcode.generate_schemes(prj, \"%%.xcodeproj/xcshareddata/xcschemes\")\nend,\noncleanproject = function(prj)\npremake.clean.directory(prj, \"%%.xcodeproj\")\npremake.clean.directory(prj, \"%%.xcworkspace\")\nend,\noncheckproject = xcode.checkproject,\nxcode = {\niOSTargetPlatformVersion = nil,\nmacOSTargetPlatformVersion = nil,\ntvOSTargetPlatformVersion = nil,\n},\n}\n", - - /* actions/fastbuild/_fastbuild.lua */ - "premake.fastbuild = { }\nlocal fastbuild = premake.fastbuild\nnewaction\n{\ntrigger = \"vs2015-fastbuild\",\nshortname = \"FASTBuild VS2015\",\ndescription = \"Generate FASTBuild configuration files for Visual Studio 2015.\",\nvalid_kinds = {\n\"ConsoleApp\",\n\"WindowedApp\",\n\"StaticLib\",\n\"SharedLib\",\n\"Bundle\",\n},\nvalid_languages = {\n\"C\",\n\"C++\"\n},\nvalid_tools = {\ncc = {\n\"msc\"\n},\n},\nonsolution = function(sln)\npremake.generate(sln, \"fbuild.bff\", premake.fastbuild.solution)\nend,\nonproject = function(prj)\npremake.generate(prj, \"%%.bff\", premake.fastbuild.project)\nend,\noncleansolution = function(sln)\npremake.clean.file(sln, \"fbuild.bff\")\nend,\noncleanproject = function(prj)\npremake.clean.file(prj, \"%%.bff\")\nend,\n}\n", - - /* actions/fastbuild/fastbuild_project.lua */ - "-- Generates a FASTBuild config file for a project.\nlocal function add_trailing_backslash(dir)\nif dir:len() > 0 and dir:sub(-1) ~= \"\\\\\" then\nreturn dir..\"\\\\\"\nend\nreturn dir\nend\nlocal function compile(indentlevel, prj, cfg, commonbasepath)\nlocal firstflag = true\nfor _, cfgexclude in ipairs(cfg.excludes) do\nif path.issourcefile(cfgexclude) then\nif firstflag then\n_p(indentlevel, '// Excluded files:')\nfirstflag = false\nend\n_p(indentlevel, \".CompilerInputFiles - '%s'\", cfgexclude)\nend\nend\nif not firstflag then\n_p('')\nend\n_p(indentlevel, \".CompilerOutputPath = '%s'\", add_trailing_backslash(cfg.objectsdir))\n_p(indentlevel, \".Defines = ''\")\nfor _, define in ipairs(cfg.defines) do\n_p(indentlevel+1, \"+ ' /D%s'\", define)\nend\nif cfg.kind == 'SharedLib' then\n_p(indentlevel+1, \"+ ' /D_WINDLL'\")\nend\n_p(indentlevel, \".IncludeDirs = ''\")\nlocal sortedincdirs = table.join(cfg.userincludedirs, cfg.includedirs, cfg.systemincludedirs)\nlocal function getpathnodecount(p)\nlocal nodef" - "inder = string.gmatch(p, \"[^\\\\/]+\")\nlocal result = 0\nlocal node = nodefinder()\nwhile node do\nresult = result + ((node ~= '.' and 1) or 0)\nnode = nodefinder()\nend\nreturn result\nend\nlocal stepsfrombase = {}\nfor _, includedir in ipairs(sortedincdirs) do\nstepsfrombase[includedir] = getpathnodecount(path.getrelative(commonbasepath, includedir))\nend\nlocal function includesort(a, b)\nif stepsfrombase[a] == stepsfrombase[b] then\nreturn a < b\nelse\nreturn stepsfrombase[a] < stepsfrombase[b]\nend\nend\ntable.sort(sortedincdirs, includesort)\nfor _, includedir in ipairs(sortedincdirs) do\n_p(indentlevel+1, \"+ ' /I\\\"%s\\\"'\", includedir)\nend\n_p(indentlevel+1, \"+ .MSVCIncludes\")\nlocal compileroptions = {\n'\"%1\"',\n'/nologo',\n'/c',\n'/Gm-',\n'/Zc:inline',\n'/errorReport:prompt',\n'/FS',\n}\nif cfg.options.ForceCPP then\ntable.insert(compileroptions, '/TP')\nend\nif cfg.flags.PedanticWarnings\nor cfg.flags.ExtraWarnings\nthen\ntable.insert(compileroptions, '/W4')\nend\nif (cfg.flags.NativeWChar" - " == false or\ncfg.flags.NoNativeWChar) then\ntable.insert(compileroptions, '/Zc:wchar_t-')\nend\nif (cfg.flags.EnableMinimalRebuild or\ncfg.flags.NoMultiProcessorCompilation) then\nend\nif cfg.flags.FloatFast then\ntable.insert(compileroptions, '/fp:fast')\nelseif cfg.flags.FloatStrict then\ntable.insert(compileroptions, '/fp:strict')\nelse\ntable.insert(compileroptions, '/fp:precise')\nend\nif cfg.flags.FastCall then\ntable.insert(compileroptions, '/Gr')\nelseif cfg.flags.StdCall then\ntable.insert(compileroptions, '/Gd')\nend\nif cfg.flags.UnsignedChar then\ntable.insert(compileroptions, '/J')\nend\nif premake.config.isdebugbuild(cfg) then\nif cfg.flags.StaticRuntime then\ntable.insert(compileroptions, '/MTd')\nelse\ntable.insert(compileroptions, '/MDd')\nend\nelse\nif cfg.flags.StaticRuntime then\ntable.insert(compileroptions, '/MT')\nelse\ntable.insert(compileroptions, '/MD')\nend\nend\nif cfg.flags.Symbols then\nif (cfg.flags.C7DebugInfo) then\ntable.insert(compileroptions, '/Z7')\nelse\nif premake.config" - ".iseditandcontinue(cfg) then\ntable.insert(compileroptions, '/ZI')\nelse\ntable.insert(compileroptions, '/Zi')\nend\nlocal targetdir = add_trailing_backslash(cfg.buildtarget.directory)\ntable.insert(compileroptions, string.format(\"/Fd\\\"%s%s.pdb\\\"\", targetdir, cfg.buildtarget.basename))\nend\nend\nlocal isoptimised = true\nif (cfg.flags.Optimize) then\ntable.insert(compileroptions, '/Ox')\nelseif (cfg.flags.OptimizeSize) then\ntable.insert(compileroptions, '/O1')\nelseif (cfg.flags.OptimizeSpeed) then\ntable.insert(compileroptions, '/O2')\nelse\nisoptimised = false\nend\nif isoptimised then\nif cfg.flags.NoOptimizeLink and cfg.flags.NoEditAndContinue then\ntable.insert(compileroptions, '/GF-')\ntable.insert(compileroptions, '/Gy-')\nelse\ntable.insert(compileroptions, '/GF')\ntable.insert(compileroptions, '/Gy')\nend\nelse\ntable.insert(compileroptions, '/Gy')\ntable.insert(compileroptions, '/Od')\ntable.insert(compileroptions, '/RTC1')\nend\nif cfg.flags.FatalWarnings then\ntable.insert(compileroptions, " - "'/WX')\nelse\ntable.insert(compileroptions, '/WX-')\nend\nif cfg.platform == 'x32' then\nif cfg.flags.EnableSSE2 then\ntable.insert(compileroptions, '/arch:SSE2')\nelseif cfg.flags.EnableSSE then\ntable.insert(compileroptions, '/arch:SSE')\nend\nend\nif cfg.flags.NoExceptions then\nelse\nif cfg.flags.SEH then\ntable.insert(compileroptions, '/EHa')\nelse\ntable.insert(compileroptions, '/EHsc')\nend\nend\nif cfg.flags.NoRTTI then\ntable.insert(compileroptions, '/GR-')\nelse\ntable.insert(compileroptions, '/GR')\nend\nif cfg.flags.NoFramePointer then\ntable.insert(compileroptions, '/Oy-')\nelse\ntable.insert(compileroptions, '/Oy')\nend\nfor _, addloption in ipairs(cfg.buildoptions) do\ntable.insert(compileroptions, addloption)\nend\n_p(indentlevel, \".CompilerOptions = ''\")\nfor _, option in ipairs(compileroptions) do\n_p(indentlevel+1, \"+ ' %s'\", option)\nend\n_p(indentlevel+1, \"+ .IncludeDirs\")\n_p(indentlevel+1, \"+ .Defines\")\nif not cfg.flags.NoPCH and cfg.pchheader then\n_p(indentlevel, \".CompilerIn" - "putFiles - '%s'\", cfg.pchsource)\n_p(indentlevel, \".PCHInputFile = '%s'\", cfg.pchsource)\n_p(indentlevel, \".PCHOutputFile = .CompilerOutputPath + '%s.pch'\", prj.name)\n_p(indentlevel, \".CompilerOptions + ' /Fp\\\"' + .CompilerOutputPath + '%s.pch\\\"'\", prj.name)\n_p(indentlevel, \".PCHOptions = .CompilerOptions\")\n_p(indentlevel+1, \"+ ' /Yc\\\"%s\\\"'\", cfg.pchheader)\n_p(indentlevel+1, \"+ ' /Fo\\\"%%3\\\"'\")\n_p(indentlevel, \".CompilerOptions + ' /Yu\\\"%s\\\"'\", cfg.pchheader)\nend\n_p(indentlevel+1, \"+ ' /Fo\\\"%%2\\\"'\") -- make sure the previous property is .CompilerOptions\nend\nlocal function library(prj, cfg, useconfig, commonbasepath)\n_p(1, \"Library('%s-%s-%s')\", prj.name, cfg.name, cfg.platform)\n_p(1, '{')\nuseconfig(2)\ncompile(2, prj, cfg, commonbasepath)\nlocal librarianoptions = {\n'\"%1\"',\n'/OUT:\"%2\"',\n'/NOLOGO',\n}\nif cfg.platform == 'x64' then\ntable.insert(librarianoptions, '/MACHINE:X64')\nelse\ntable.insert(librarianoptions, '/MACHINE:X86')\nend\n_p(2, \".Libraria" - "nOptions = ''\")\nfor _, option in ipairs(librarianoptions) do\n_p(3, \"+ ' %s'\", option)\nend\n_p(2, \".LibrarianOutput = '%s'\", cfg.buildtarget.fullpath)\n_p(1, '}')\n_p('')\nend\nlocal function binary(prj, cfg, useconfig, bintype, commonbasepath)\n_p(1, \"ObjectList('%s_obj-%s-%s')\", prj.name, cfg.name, cfg.platform)\n_p(1, '{')\nuseconfig(2)\ncompile(2, prj, cfg, commonbasepath)\n_p(1, '}')\n_p('')\n_p(1, \"%s('%s-%s-%s')\", bintype, prj.name, cfg.name, cfg.platform)\n_p(1, '{')\nuseconfig(2)\n_p(2, '.Libraries = {')\n_p(3, \"'%s_obj-%s-%s',\", prj.name, cfg.name, cfg.platform) -- Refer to the ObjectList\nlocal sorteddeplibs = {}\nfor _, deplib in ipairs(premake.getlinks(cfg, \"dependencies\", \"basename\")) do\ntable.insert(sorteddeplibs, string.format(\"'%s-%s-%s',\", deplib, cfg.name, cfg.platform))\nend\ntable.sort(sorteddeplibs)\nfor _, deplib in ipairs(sorteddeplibs) do\n_p(3, deplib)\nend\n_p(3, '}')\n_p(2, '.LinkerLinkObjects = false')\nlocal linkeroptions = {\n'\"%1\"',\n'/OUT:\"%2\"',\n'/NOLOG" - "O',\n'/errorReport:prompt',\n}\nlocal subsystemversion = '\",5.02\"'\nif cfg.platform == 'x32' then\nsubsystemversion = '\",5.01\"'\nend\nif cfg.kind == 'ConsoleApp' then\ntable.insert(linkeroptions, '/SUBSYSTEM:CONSOLE'..subsystemversion)\nelse\ntable.insert(linkeroptions, '/SUBSYSTEM:WINDOWS'..subsystemversion)\nend\nif cfg.kind == 'SharedLib' then\ntable.insert(linkeroptions, '/DLL')\nend\nif cfg.platform == 'x64' then\ntable.insert(linkeroptions, '/MACHINE:X64')\nelse\ntable.insert(linkeroptions, '/MACHINE:X86')\nend\nfor _, libdir in ipairs(cfg.libdirs) do\ntable.insert(linkeroptions, string.format('/LIBPATH:%s', path.translate(libdir, '\\\\')))\nend\nif not cfg.flags.WinMain and (cfg.kind == 'ConsoleApp' or cfg.kind == 'WindowedApp') then\nif cfg.flags.Unicode then\ntable.insert(linkeroptions, '/ENTRY:wmainCRTStartup')\nelse\ntable.insert(linkeroptions, '/ENTRY:mainCRTStartup')\nend\nend\nlocal deffile = premake.findfile(cfg, \".def\")\nif deffile then\ntable.insert(linkeroptions, '/DEF:%s', deffile)\nen" - "d\nif (cfg.flags.Symbols ~= nil) then\ntable.insert(linkeroptions, '/DEBUG')\nend\nif premake.config.islinkeroptimizedbuild(cfg.flags) then\ntable.insert(linkeroptions, '/OPT:REF')\ntable.insert(linkeroptions, '/OPT:ICF')\nend\ntable.insert(linkeroptions, '/INCREMENTAL'..((premake.config.isincrementallink(cfg) and '') or ':NO'))\nfor _, addloption in ipairs(cfg.linkoptions) do\ntable.insert(linkeroptions, addloption)\nend\nlocal linklibs = premake.getlinks(cfg, \"all\", \"fullpath\")\nfor _, linklib in ipairs(linklibs) do\ntable.insert(linkeroptions, path.getname(linklib))\nend\ntable.sort(linkeroptions)\n_p(2, \".LinkerOptions = ''\")\nfor _, option in ipairs(linkeroptions) do\n_p(3, \"+ ' %s'\", option)\nend\n_p(3, \"+ .MSVCLibPaths\")\n_p(2, \".LinkerOutput = '%s'\", cfg.buildtarget.fullpath)\n_p(1, '}')\n_p('')\nend\nlocal function executable(prj, cfg, useconfig, commonbasepath)\nbinary(prj, cfg, useconfig, 'Executable', commonbasepath)\nend\nlocal function dll(prj, cfg, useconfig, commonbasepath)\nbinary(" - "prj, cfg, useconfig, 'DLL', commonbasepath)\nend\nlocal function alias(prj, cfg, target)\n_p(1, \"Alias('%s-%s-%s')\", prj.name, cfg.name, cfg.platform)\n_p(1, '{')\n_p(2, \".Targets = '%s'\", target)\n_p(1, '}')\n_p('')\nend\nfunction premake.fastbuild.project(prj)\nio.indent = ' '\n_p('// FASTBuild project configuration file autogenerated by GENie.')\n_p('')\n_p('{')\nlocal cppfiles = {}\nfor file in premake.project.eachfile(prj) do\nif path.issourcefile(file.name) then\ntable.insert(cppfiles, file.name)\nend\nend\nlocal commonbasepath = cppfiles[1]\nfor _, file in ipairs(cppfiles) do\ncommonbasepath = path.getcommonbasedir(commonbasepath..'/', file)\nend\n_p(1, \".CompilerInputFilesRoot = '%s/'\", commonbasepath)\n_p(1, '.CompilerInputFiles = {')\nfor _, file in ipairs(cppfiles) do\n_p(2, \"'%s',\", file)\nend\n_p(1, '}')\n_p('')\nlocal targetkindmap = {\nConsoleApp = executable,\nWindowedApp = executable,\nSharedLib = dll,\nStaticLib = library,\n}\nlocal useconfigmap = {\nx32 = function(indentlevel)\n_p" - "(indentlevel, 'Using(.MSVCx86Config)')\n_p('')\nend,\nx64 = function(indentlevel)\n_p(indentlevel, 'Using(.MSVCx64Config)')\n_p('')\nend,\n}\nlocal nativeplatform = (os.is64bit() and 'x64') or 'x32'\nfor _, platform in ipairs(prj.solution.platforms) do\nfor cfg in premake.eachconfig(prj, platform) do\nif cfg.platform == 'Native' then\nalias(prj, cfg, string.format('%s-%s-%s', prj.name, cfg.name, nativeplatform))\nelse\ntargetkindmap[prj.kind](prj, cfg, useconfigmap[cfg.platform], commonbasepath)\nend\nend\nend\n_p('}')\nend\n", - - /* actions/fastbuild/fastbuild_solution.lua */ - "-- Generates a FASTBuild config file for a solution.\nfunction premake.fastbuild.solution(sln)\nio.indent = ' '\n_p('// FastBuild solution configuration file. Generated by GENie.')\n_p('//------------------------------------------------------------------------------------')\n_p('// %s', sln.name)\n_p('//------------------------------------------------------------------------------------')\n_p('#import VS140COMNTOOLS')\nlocal is64bit = os.is64bit()\nlocal target64 = (is64bit and ' amd64') or ' x86_amd64'\nlocal target32 = (is64bit and ' amd64_x86') or ''\nlocal getvcvarscontent = [[\n@set INCLUDE=\n@set LIB=\n@set CommandPromptType=\n@set PreferredToolArchitecture=\n@set Platform=\n@set Path=%SystemRoot%\\System32;%SystemRoot%;%SystemRoot%\\System32\\wbem\n@call \"%VS140COMNTOOLS%..\\..\\VC\\vcvarsall.bat\" %1\n@echo %INCLUDE%\n@echo %LIB%\n@echo %CommandPromptType%\n@echo %PreferredToolArchitecture%\n@echo %Platform%\n@echo %Path%\n]]\nlocal getvcvarsfilepath = os.getenv('TEMP')..'\\\\getvcvars.bat'\nlocal" - " getvcvarsfile = assert(io.open(getvcvarsfilepath, 'w'))\ngetvcvarsfile:write(getvcvarscontent)\ngetvcvarsfile:close()\nlocal vcvarsrawx86 = os.outputof(string.format('call \"%s\"%s', getvcvarsfilepath, target32))\nlocal vcvarsrawx64 = os.outputof(string.format('call \"%s\"%s', getvcvarsfilepath, target64))\nos.remove(getvcvarsfilepath)\nlocal msvcvars = {}\nmsvcvars.x32 = {}\nmsvcvars.x64 = {}\nlocal includeslibssplitter = string.gmatch(vcvarsrawx64, \"[^\\n]+\")\nmsvcvars.x64.includesraw = includeslibssplitter()\nmsvcvars.x64.libpathsraw = includeslibssplitter()\nmsvcvars.x64.commandprompttype = includeslibssplitter()\nmsvcvars.x64.preferredtoolarchitecture = includeslibssplitter()\nmsvcvars.x64.platform = includeslibssplitter()\nmsvcvars.x64.pathraw = includeslibssplitter()\nincludeslibssplitter = string.gmatch(vcvarsrawx86, \"[^\\n]+\")\nmsvcvars.x32.includesraw = includeslibssplitter()\nmsvcvars.x32.libpathsraw = includeslibssplitter()\nmsvcvars.x32.commandprompttype = includeslibssplitter()\nmsvcvars.x32" - ".preferredtoolarchitecture = includeslibssplitter()\nmsvcvars.x32.platform = includeslibssplitter()\nmsvcvars.x32.pathraw = includeslibssplitter()\nlocal function printincludes(includesraw)\n_p(1, \".MSVCIncludes = ''\")\nfor i in string.gmatch(includesraw, \"[^;]+\") do\n_p(2, \"+ ' /I\\\"%s\\\"'\", i)\nend\nend\nlocal function printlibpaths(libpathsraw)\n_p(1, \".MSVCLibPaths = ''\")\nfor i in string.gmatch(libpathsraw, \"[^;]+\") do\n_p(2, \"+ ' /LIBPATH:\\\"%s\\\"'\", i)\nend\nend\nif is64bit then\n_p('.MSVCx64Config =')\n_p('[')\n_p(1, \".Compiler = '$VS140COMNTOOLS$..\\\\..\\\\VC\\\\bin\\\\amd64\\\\cl.exe'\")\n_p(1, \".Librarian = '$VS140COMNTOOLS$..\\\\..\\\\VC\\\\bin\\\\amd64\\\\lib.exe'\")\n_p(1, \".Linker = '$VS140COMNTOOLS$..\\\\..\\\\VC\\\\bin\\\\amd64\\\\link.exe'\")\nprintincludes(msvcvars.x64.includesraw)\nprintlibpaths(msvcvars.x64.libpathsraw)\n_p(']')\n_p('')\n_p('.MSVCx86Config =')\n_p('[')\n_p(1, \".Compiler = '$VS140COMNTOOLS$..\\\\..\\\\VC\\\\bin\\\\amd64_x86\\\\cl.exe'\")\n_p(1, \"." - "Librarian = '$VS140COMNTOOLS$..\\\\..\\\\VC\\\\bin\\\\amd64_x86\\\\lib.exe'\")\n_p(1, \".Linker = '$VS140COMNTOOLS$..\\\\..\\\\VC\\\\bin\\\\amd64_x86\\\\link.exe'\")\nprintincludes(msvcvars.x32.includesraw)\nprintlibpaths(msvcvars.x32.libpathsraw)\n_p(']')\n_p('')\nelse\n_p('.MSVCx64Config =')\n_p('[')\n_p(1, \".Compiler = '$VS140COMNTOOLS$..\\\\..\\\\VC\\\\bin\\\\x86_amd64\\\\cl.exe'\")\n_p(1, \".Librarian = '$VS140COMNTOOLS$..\\\\..\\\\VC\\\\bin\\\\x86_amd64\\\\lib.exe'\")\n_p(1, \".Linker = '$VS140COMNTOOLS$..\\\\..\\\\VC\\\\bin\\\\x86_amd64\\\\link.exe'\")\nprintincludes(msvcvars.x64.includesraw)\nprintlibpaths(msvcvars.x64.libpathsraw)\n_p(']')\n_p('')\n_p('.MSVCx86Config =')\n_p('[')\n_p(1, \".Compiler = '$VS140COMNTOOLS$..\\\\..\\\\VC\\\\bin\\\\cl.exe'\")\n_p(1, \".Librarian = '$VS140COMNTOOLS$..\\\\..\\\\VC\\\\bin\\\\lib.exe'\")\n_p(1, \".Linker = '$VS140COMNTOOLS$..\\\\..\\\\VC\\\\bin\\\\link.exe'\")\nprintincludes(msvcvars.x32.includesraw)\nprintlibpaths(msvcvars.x32.libpathsraw)\n_p(']')" - "\n_p('')\nend\nlocal msvcbin = '$VS140COMNTOOLS$..\\\\..\\\\VC\\\\bin' .. ((is64bit and '\\\\amd64') or '')\n_p('#import Path')\n_p('#import TMP')\n_p('#import SystemRoot')\n_p('')\n_p('Settings')\n_p('{')\n_p(1, '.Environment = {')\n_p(2, \"'Path=%s;$Path$',\", msvcbin)\n_p(2, \"'TMP=$TMP$',\")\n_p(2, \"'SystemRoot=$SystemRoot$',\")\n_p(2, '}')\n_p('}')\n_p('')\nlocal function projkindsort(a, b)\nlocal projvaluemap = {\nConsoleApp = 3,\nWindowedApp = 3,\nSharedLib = 2,\nStaticLib = 1,\n}\nif projvaluemap[a.kind] == projvaluemap[b.kind] then\nreturn a.name < b.name\nelse\nreturn projvaluemap[a.kind] < projvaluemap[b.kind]\nend\nend\nlocal sortedprojs = {}\nfor prj in premake.solution.eachproject(sln) do\ntable.insert(sortedprojs, prj)\nend\ntable.sort(sortedprojs, projkindsort)\nfor _, prj in ipairs(sortedprojs) do\nlocal fname = premake.project.getbasename(prj.name, '%%.bff')\nfname = path.join(prj.location, fname)\nfname = path.getrelative(sln.location, fname)\n_p('#include \"%s\"', fname)\nend\n_p('')" - "\n_p('.ProjectVariants = {')\nfor _, plat in ipairs(sln.platforms) do\nfor _, cfg in ipairs(sln.configurations) do\n_p(1, \"'%s-%s',\", cfg, plat)\nend\nend\n_p('}')\n_p('')\n_p('ForEach(.Variant in .ProjectVariants)')\n_p('{')\n_p(1, \"Alias('all-$Variant$')\")\n_p(1, '{')\n_p(2, '.Targets = {')\nfor _, prj in ipairs(sortedprojs) do\n_p(3, \"'%s-$Variant$',\", prj.name)\nend\n_p(2, '}')\n_p(1, '}')\n_p('}')\nend\n", + "\nxcode.PBXBuildFile(tr)\nxcode.PBXContainerItemProxy(tr)\nxcode.PBXFileReference(tr,prj)\nxcode.PBXFrameworksBuildPhase(tr)\nxcode.PBXGroup(tr)\nxcode.PBXNativeTarget(tr)\nxcode.PBXProject(tr, \"8.0\")\nxcode.PBXReferenceProxy(tr)\nxcode.PBXResourcesBuildPhase(tr)\nxcode.PBXShellScriptBuildPhase(tr)\nxcode.PBXCopyFilesBuildPhase(tr)\nxcode.PBXSourcesBuildPhase(tr,prj)\nxcode.PBXVariantGroup(tr)\nxcode.PBXTargetDependency(tr)\nxcode.XCBuildConfiguration(tr, prj, {\nontarget = xcode10.XCBuildConfiguration_Target,\nonproject = xcode10.XCBuildConfiguration_Project,\n})\nxcode.XCBuildConfigurationList(tr)\nxcode.Footer(tr)\nend\nnewaction\n{\ntrigger = \"xcode10\",\nshortname = \"Xcode 10\",\ndescription = \"Generate Apple Xcode 10 project files\",\nos = \"macosx\",\nvalid_kinds = { \"ConsoleApp\", \"WindowedApp\", \"StaticLib\", \"SharedLib\", \"Bundle\" },\nvalid_languages = { \"C\", \"C++\" },\nvalid_tools = {\ncc = { \"gcc\" },\n},\nvalid_platforms = {\nNative = \"Nat" + "ive\",\nx32 = \"Native 32-bit\",\nx64 = \"Native 64-bit\",\nUniversal = \"Universal\",\n},\ndefault_platform = \"Native\",\nonsolution = function(sln)\npremake.generate(sln, \"%%.xcworkspace/contents.xcworkspacedata\", xcode.workspace_generate)\npremake.generate(sln, \"%%.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings\", xcode.workspace_settings)\npremake.generate(sln, \"%%.xcworkspace/xcshareddata/xcschemes/-ALL-.xcscheme\", xcode.workspace_scheme)\nend,\nonproject = function(prj)\npremake.generate(prj, \"%%.xcodeproj/project.pbxproj\", xcode10.project)\nxcode.generate_schemes(prj, \"%%.xcodeproj/xcshareddata/xcschemes\")\nend,\noncleanproject = function(prj)\npremake.clean.directory(prj, \"%%.xcodeproj\")\npremake.clean.directory(prj, \"%%.xcworkspace\")\nend,\noncheckproject = xcode.checkproject,\nxcode = {\niOSTargetPlatformVersion = nil,\nmacOSTargetPlatformVersion = nil,\ntvOSTargetPlatformVersion = nil,\n},\n}\n", + + /* actions/xcode/xcode11.lua */ + "local premake = premake\npremake.xcode11 = { }\nlocal xcode = premake.xcode\nlocal xcode10 = premake.xcode10\nlocal xcode11 = premake.xcode11\nfunction xcode11.XCBuildConfiguration_Target(tr, target, cfg)\nlocal options = xcode10.XCBuildConfiguration_Target(tr, target, cfg)\noptions.CODE_SIGN_IDENTITY = \"-\"\nreturn options\nend\nfunction xcode11.project(prj)\nlocal tr = xcode.buildprjtree(prj)\nxcode.Header(tr, 48)\nxcode.PBXBuildFile(tr)\nxcode.PBXContainerItemProxy(tr)\nxcode.PBXFileReference(tr,prj)\nxcode.PBXFrameworksBuildPhase(tr)\nxcode.PBXGroup(tr)\nxcode.PBXNativeTarget(tr)\nxcode.PBXProject(tr, \"8.0\")\nxcode.PBXReferenceProxy(tr)\nxcode.PBXResourcesBuildPhase(tr)\nxcode.PBXShellScriptBuildPhase(tr)\nxcode.PBXCopyFilesBuildPhase(tr)\nxcode.PBXSourcesBuildPhase(tr,prj)\nxcode.PBXVariantGroup(tr)\nxcode.PBXTargetDependency(tr)\nxcode.XCBuildConfiguration(tr, prj, {\nontarget = xcode11.XCBuildConfiguration_Target,\nonproject = xcode10.XCBuildConfiguration_Project,\n})\nxcode.XCBuildConfigurationList" + "(tr)\nxcode.Footer(tr)\nend\nnewaction\n{\ntrigger = \"xcode11\",\nshortname = \"Xcode 11\",\ndescription = \"Generate Apple Xcode 11 project files\",\nos = \"macosx\",\nvalid_kinds = { \"ConsoleApp\", \"WindowedApp\", \"StaticLib\", \"SharedLib\", \"Bundle\" },\nvalid_languages = { \"C\", \"C++\" },\nvalid_tools = {\ncc = { \"gcc\" },\n},\nvalid_platforms = { Native = \"Native\" },\ndefault_platform = \"Native\",\nonsolution = function(sln)\npremake.generate(sln, \"%%.xcworkspace/contents.xcworkspacedata\", xcode.workspace_generate)\npremake.generate(sln, \"%%.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings\", xcode.workspace_settings)\npremake.generate(sln, \"%%.xcworkspace/xcshareddata/xcschemes/-ALL-.xcscheme\", xcode.workspace_scheme)\nend,\nonproject = function(prj)\npremake.generate(prj, \"%%.xcodeproj/project.pbxproj\", xcode11.project)\nxcode.generate_schemes(prj, \"%%.xcodeproj/xcshareddata/xcschemes\")\nend,\noncleanproject = function(prj)\npremake.cl" + "ean.directory(prj, \"%%.xcodeproj\")\npremake.clean.directory(prj, \"%%.xcworkspace\")\nend,\noncheckproject = xcode.checkproject,\nxcode = {\niOSTargetPlatformVersion = nil,\nmacOSTargetPlatformVersion = nil,\ntvOSTargetPlatformVersion = nil,\n},\n}\n", + + /* actions/xcode/xcode14.lua */ + "local premake = premake\npremake.xcode14 = { }\nlocal xcode = premake.xcode\nlocal xcode10 = premake.xcode10\nlocal xcode11 = premake.xcode11\nlocal xcode14 = premake.xcode14\nfunction xcode14.XCBuildConfiguration_Target(tr, target, cfg)\nlocal options = xcode11.XCBuildConfiguration_Target(tr, target, cfg)\noptions.CODE_SIGN_IDENTITY = \"-\"\nlocal action = premake.action.current()\nxcode.setdeploymenttarget(cfg, action.xcode, options)\nlocal iosversion = options.IPHONEOS_DEPLOYMENT_TARGET\nlocal macosversion = options.MACOSX_DEPLOYMENT_TARGET\nlocal tvosversion = options.TVOS_DEPLOYMENT_TARGET\nif iosversion and not xcode.versionge(iosversion, \"11\") then\n error(\"XCode14 does not support deployment for iOS older than 11\")\nelseif macosversion and not xcode.versionge(macosversion, \"10.13\") then\n error(\"XCode14 does not support deployment for macOS older than 10.13\")\nelseif tvosversion and not xcode.versionge(tvosversion, \"11\") then\n error(\"XCode14 does not support deployment for tvOS older" + " than 11\")\nend\nreturn options\nend\nfunction xcode14.XCBuildConfiguration_Project(tr, prj, cfg)\nlocal options = xcode10.XCBuildConfiguration_Project(tr, prj, cfg)\noptions.ENABLE_BITCODE = \"NO\" -- Bitcode is now deprecated.\nlocal action = premake.action.current()\nxcode.setdeploymenttarget(cfg, action.xcode, options)\nreturn options\nend\nfunction xcode14.project(prj)\nlocal tr = xcode.buildprjtree(prj)\nxcode.Header(tr, 48)\nxcode.PBXBuildFile(tr)\nxcode.PBXContainerItemProxy(tr)\nxcode.PBXFileReference(tr,prj)\nxcode.PBXFrameworksBuildPhase(tr)\nxcode.PBXGroup(tr)\nxcode.PBXNativeTarget(tr)\nxcode.PBXProject(tr, \"8.0\")\nxcode.PBXReferenceProxy(tr)\nxcode.PBXResourcesBuildPhase(tr)\nxcode.PBXShellScriptBuildPhase(tr)\nxcode.PBXCopyFilesBuildPhase(tr)\nxcode.PBXSourcesBuildPhase(tr,prj)\nxcode.PBXVariantGroup(tr)\nxcode.PBXTargetDependency(tr)\nxcode.XCBuildConfiguration(tr, prj, {\nontarget = xcode14.XCBuildConfiguration_Target,\nonproject = xcode14.XCBuildConfiguration_Project,\n})\nxcode.XCBuildCon" + "figurationList(tr)\nxcode.Footer(tr)\nend\nnewaction\n{\ntrigger = \"xcode14\",\nshortname = \"Xcode 14\",\ndescription = \"Generate Apple Xcode 14 project files\",\nos = \"macosx\",\nvalid_kinds = { \"ConsoleApp\", \"WindowedApp\", \"StaticLib\", \"SharedLib\", \"Bundle\" },\nvalid_languages = { \"C\", \"C++\" },\nvalid_tools = {\ncc = { \"gcc\" },\n},\nvalid_platforms = { Native = \"Native\" },\ndefault_platform = \"Native\",\nonsolution = function(sln)\npremake.generate(sln, \"%%.xcworkspace/contents.xcworkspacedata\", xcode.workspace_generate)\npremake.generate(sln, \"%%.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings\", xcode.workspace_settings)\npremake.generate(sln, \"%%.xcworkspace/xcshareddata/xcschemes/-ALL-.xcscheme\", xcode.workspace_scheme)\nend,\nonproject = function(prj)\npremake.generate(prj, \"%%.xcodeproj/project.pbxproj\", xcode14.project)\nxcode.generate_schemes(prj, \"%%.xcodeproj/xcshareddata/xcschemes\")\nend,\noncleanproject = function(pr" + "j)\npremake.clean.directory(prj, \"%%.xcodeproj\")\npremake.clean.directory(prj, \"%%.xcworkspace\")\nend,\noncheckproject = xcode.checkproject,\nxcode = {\niOSTargetPlatformVersion = nil,\nmacOSTargetPlatformVersion = nil,\ntvOSTargetPlatformVersion = nil,\n},\n}\n", + + /* actions/xcode/xcode15.lua */ + "local premake = premake\npremake.xcode15 = { }\nlocal xcode = premake.xcode\nlocal xcode10 = premake.xcode10\nlocal xcode11 = premake.xcode11\nlocal xcode14 = premake.xcode14\nlocal xcode15 = premake.xcode15\nfunction xcode15.XCBuildConfiguration_Target(tr, target, cfg)\nlocal options = xcode11.XCBuildConfiguration_Target(tr, target, cfg)\noptions.CODE_SIGN_IDENTITY = \"-\"\nlocal action = premake.action.current()\nxcode.setdeploymenttarget(cfg, action.xcode, options)\nlocal iosversion = options.IPHONEOS_DEPLOYMENT_TARGET\nlocal macosversion = options.MACOSX_DEPLOYMENT_TARGET\nlocal tvosversion = options.TVOS_DEPLOYMENT_TARGET\nlocal xrosversion = options.XROS_DEPLOYMENT_TARGET\nif iosversion and not xcode.versionge(iosversion, \"12\") then\n error(\"XCode15 does not support deployment for iOS older than 12\")\nelseif macosversion and not xcode.versionge(macosversion, \"13.5\") then\n error(\"XCode15 does not support deployment for macOS older than 13.5\")\nelseif tvosversion and not xcode.versionge(tvosv" + "ersion, \"12\") then\n error(\"XCode15 does not support deployment for tvOS older than 12\")\nelseif xrosversion and not xcode.versionge(xrosversion, \"1.0\") then\n error(\"XCode15 does not support deployment for visionOS older than 1.0\")\nend\nreturn options\nend\nfunction xcode15.XCBuildConfiguration_Project(tr, prj, cfg)\nlocal options = xcode10.XCBuildConfiguration_Project(tr, prj, cfg)\nlocal action = premake.action.current()\nxcode.setdeploymenttarget(cfg, action.xcode, options)\nreturn options\nend\nfunction xcode15.project(prj)\nlocal tr = xcode.buildprjtree(prj)\nxcode.Header(tr, 48)\nxcode.PBXBuildFile(tr)\nxcode.PBXContainerItemProxy(tr)\nxcode.PBXFileReference(tr,prj)\nxcode.PBXFrameworksBuildPhase(tr)\nxcode.PBXGroup(tr)\nxcode.PBXNativeTarget(tr)\nxcode.PBXProject(tr, \"8.0\")\nxcode.PBXReferenceProxy(tr)\nxcode.PBXResourcesBuildPhase(tr)\nxcode.PBXShellScriptBuildPhase(tr)\nxcode.PBXCopyFilesBuildPhase(tr)\nxcode.PBXSourcesBuildPhase(tr,prj)\nxcode.PBXVariantGroup(tr)\nxcode.PBXTargetDepen" + "dency(tr)\nxcode.XCBuildConfiguration(tr, prj, {\nontarget = xcode15.XCBuildConfiguration_Target,\nonproject = xcode15.XCBuildConfiguration_Project,\n})\nxcode.XCBuildConfigurationList(tr)\nxcode.Footer(tr)\nend\nnewaction\n{\ntrigger = \"xcode15\",\nshortname = \"Xcode 15\",\ndescription = \"Generate Apple Xcode 15 project files\",\nos = \"macosx\",\nvalid_kinds = { \"ConsoleApp\", \"WindowedApp\", \"StaticLib\", \"SharedLib\", \"Bundle\" },\nvalid_languages = { \"C\", \"C++\" },\nvalid_tools = {\ncc = { \"gcc\" },\n},\nvalid_platforms = { Native = \"Native\" },\ndefault_platform = \"Native\",\nonsolution = function(sln)\npremake.generate(sln, \"%%.xcworkspace/contents.xcworkspacedata\", xcode.workspace_generate)\npremake.generate(sln, \"%%.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings\", xcode.workspace_settings)\npremake.generate(sln, \"%%.xcworkspace/xcshareddata/xcschemes/-ALL-.xcscheme\", xcode.workspace_scheme)\nend,\nonproject = function(prj)\npremake." + "generate(prj, \"%%.xcodeproj/project.pbxproj\", xcode14.project)\nxcode.generate_schemes(prj, \"%%.xcodeproj/xcshareddata/xcschemes\")\nend,\noncleanproject = function(prj)\npremake.clean.directory(prj, \"%%.xcodeproj\")\npremake.clean.directory(prj, \"%%.xcworkspace\")\nend,\noncheckproject = xcode.checkproject,\nxcode = {\niOSTargetPlatformVersion = nil,\nmacOSTargetPlatformVersion = nil,\ntvOSTargetPlatformVersion = nil,\nvisionOSTargetPlatformVersion = nil,\n},\n}\n", /* actions/ninja/_ninja.lua */ "premake.ninja = { }\nlocal p = premake\nnewaction\n{\ntrigger = \"ninja\",\nshortname = \"ninja\",\ndescription = \"Generate Ninja build files\",\nmodule = \"ninja\",\nvalid_kinds = {\"ConsoleApp\", \"WindowedApp\", \"StaticLib\", \"SharedLib\", \"Bundle\"},\nvalid_languages = {\"C\", \"C++\", \"Swift\"},\nvalid_tools = {\ncc = { \"gcc\" },\nswift = { \"swift\" },\n},\nonsolution = function(sln)\nio.eol = \"\\r\\n\"\nio.indent = \"\\t\"\nio.escaper(p.ninja.esc)\np.generate(sln, \"Makefile\", p.ninja.generate_solution)\nio.indent = \" \"\np.ninja.generate_ninja_builds(sln)\nend,\nonproject = function(prj)\nio.eol = \"\\r\\n\"\nio.indent = \" \"\nio.escaper(p.ninja.esc)\np.ninja.generate_project(prj)\nend,\noncleansolution = function(sln)\nfor _,name in ipairs(sln.configurations) do\npremake.clean.file(sln, p.ninja.get_solution_name(sln, name))\nend\nend,\noncleanproject = function(prj)\nend,\noncleantarget = function(prj)\nend,\n}\n", @@ -488,17 +495,17 @@ const char* builtin_scripts[] = { /* actions/ninja/ninja_cpp.lua */ "premake.ninja.cpp = { }\nlocal ninja = premake.ninja\nlocal cpp = premake.ninja.cpp\nlocal p = premake\nlocal function wrap_ninja_cmd(c)\nif os.is(\"windows\") then\nreturn 'cmd /c \"' .. c .. '\"'\nelse\nreturn c\nend\nend\nfunction ninja.generate_cpp(prj)\nlocal pxy = ninja.get_proxy(\"prj\", prj)\nlocal tool = premake.gettool(prj)\nlocal platforms = premake.filterplatforms(prj.solution, tool.platforms, \"Native\")\nfor _, platform in ipairs(platforms) do\nfor cfg in p.eachconfig(pxy, platform) do\np.generate(cfg, cfg:getprojectfilename(), function() cpp.generate_config(prj, cfg) end)\nend\nend\nend\nfunction cpp.generate_config(prj, cfg)\nlocal tool = premake.gettool(prj)\n_p('# Ninja build project file autogenerated by GENie')\n_p('# https://github.com/bkaradzic/GENie')\n_p(\"\")\n_p(\"ninja_required_version = 1.7\")\n_p(\"\")\nlocal flags = {\ndefines = ninja.list(tool.getdefines(cfg.defines)),\nincludes = ninja.list(table.join(tool.getincludedirs(cfg.includedirs), tool.getquoteincludedirs(cfg.us" "erincludedirs), tool.getsystemincludedirs(cfg.systemincludedirs))),\ncppflags = ninja.list(tool.getcppflags(cfg)),\nasmflags = ninja.list(table.join(tool.getcflags(cfg), cfg.buildoptions, cfg.buildoptions_asm)),\ncflags = ninja.list(table.join(tool.getcflags(cfg), cfg.buildoptions, cfg.buildoptions_c)),\ncxxflags = ninja.list(table.join(tool.getcflags(cfg), tool.getcxxflags(cfg), cfg.buildoptions, cfg.buildoptions_cpp)),\nobjcflags = ninja.list(table.join(tool.getcflags(cfg), tool.getcxxflags(cfg), cfg.buildoptions, cfg.buildoptions_objc)),\n}\n_p(\"\")\n_p(\"# core rules for \" .. cfg.name)\n_p(\"rule cc\")\n_p(\" command = \" .. wrap_ninja_cmd(tool.cc .. \" $defines $includes $flags -MMD -MF $out.d -c -o $out $in\"))\n_p(\" description = cc $out\")\n_p(\" depfile = $out.d\")\n_p(\" deps = gcc\")\n_p(\"\")\n_p(\"rule cxx\")\n_p(\" command = \" .. wrap_ninja_cmd(tool.cxx .. \" $defines $includes $flags -MMD -MF $out.d -c -o $out $in\"))\n_p(\" description = cxx $out\")\n_p(\" de" - "pfile = $out.d\")\n_p(\" deps = gcc\")\n_p(\"\")\n_p(\"rule ar\")\n_p(\" command = \" .. wrap_ninja_cmd(tool.ar .. \" $flags $out @$out.rsp \" .. (os.is(\"MacOSX\") and \" 2>&1 > /dev/null | sed -e '/.o) has no symbols$$/d'\" or \"\")))\n_p(\" description = ar $out\")\n_p(\" rspfile = $out.rsp\")\n_p(\" rspfile_content = $in $libs\")\n_p(\"\")\nlocal link = iif(cfg.language == \"C\", tool.cc, tool.cxx)\n_p(\"rule link\")\nlocal startgroup = ''\nlocal endgroup = ''\nif (cfg.flags.LinkSupportCircularDependencies) then\nstartgroup = '-Wl,--start-group'\nendgroup = '-Wl,--end-group'\nend\n_p(\" command = \" .. wrap_ninja_cmd(\"$pre_link \" .. link .. \" -o $out @$out.rsp $all_ldflags $post_build\"))\n_p(\" description = link $out\")\n_p(\" rspfile = $out.rsp\")\n_p(\" rspfile_content = $all_outputfiles $walibs\" .. string.format(\"%s $libs %s\", startgroup, endgroup))\n_p(\"\")\n_p(\"rule exec\")\n_p(\" command = \" .. wrap_ninja_cmd(\"$command\"))\n" - "_p(\" description = Run $type commands\")\n_p(\"\")\nif #cfg.prebuildcommands > 0 then\n_p(\"build __prebuildcommands_\" .. premake.esc(prj.name) .. \": exec\")\n_p(1, \"command = \" .. wrap_ninja_cmd(\"echo Running pre-build commands && \" .. table.implode(cfg.prebuildcommands, \"\", \"\", \" && \")))\n_p(1, \"type = pre-build\")\n_p(\"\")\nend\ncfg.pchheader_full = cfg.pchheader\nfor _, incdir in ipairs(cfg.includedirs) do\nlocal abspath = path.getabsolute(path.join(cfg.project.location, cfg.shortname, incdir))\nlocal testname = path.join(abspath, cfg.pchheader_full)\nif os.isfile(testname) then\ncfg.pchheader_full = path.getrelative(cfg.location, testname)\nbreak\nend\nend\ncpp.custombuildtask(prj, cfg)\ncpp.dependencyRules(prj, cfg)\ncpp.file_rules(prj, cfg, flags)\nlocal objfiles = {}\nfor _, file in ipairs(cfg.files) do\nif path.issourcefile(file) then\ntable.insert(objfiles, cpp.objectname(cfg, file))\nend\nend\n_p('')\ncpp.linker(prj, cfg, objfiles, tool, flags)\n_p(\"\")\nend\nfunction cpp.customb" - "uildtask(prj, cfg)\nlocal cmd_index = 1\nlocal seen_commands = {}\nlocal command_by_name = {}\nlocal command_files = {}\nlocal prebuildsuffix = #cfg.prebuildcommands > 0 and \"||__prebuildcommands_\" .. premake.esc(prj.name) or \"\"\nfor _, custombuildtask in ipairs(prj.custombuildtask or {}) do\nfor _, buildtask in ipairs(custombuildtask or {}) do\nfor _, cmd in ipairs(buildtask[4] or {}) do\nlocal num = 1\nfor _, depdata in ipairs(buildtask[3] or {}) do\ncmd = string.gsub(cmd,\"%$%(\" .. num ..\"%)\", string.format(\"%s \", path.getrelative(cfg.location, depdata)))\nnum = num + 1\nend\ncmd = string.gsub(cmd, '%$%(<%)', '$in')\ncmd = string.gsub(cmd, '%$%(@%)', '$out')\nlocal cmd_name -- shortened command name\nif seen_commands[cmd] == nil then\nlocal _, _, name = string.find(cmd, '([.%w]+)%s')\nname = 'cmd' .. cmd_index .. '_' .. string.gsub(name, '[^%w]', '_')\nseen_commands[cmd] = {\nname = name,\nindex = cmd_index,\n}\ncmd_index = cmd_index + 1\ncmd_name = name\nelse\ncmd_name = seen_commands[cmd].name\ne" - "nd\nlocal index = seen_commands[cmd].index\nif command_files[index] == nil then\ncommand_files[index] = {}\nend\nlocal cmd_set = command_files[index]\ntable.insert(cmd_set, {\nbuildtask[1],\nbuildtask[2],\nbuildtask[3],\nseen_commands[cmd].name,\n})\ncommand_files[index] = cmd_set\ncommand_by_name[cmd_name] = cmd\nend\nend\nend\n_p(\"# custom build rules\")\nfor command, details in pairs(seen_commands) do\n_p(\"rule \" .. details.name)\n_p(1, \"command = \" .. wrap_ninja_cmd(command))\nend\nfor cmd_index, cmdsets in ipairs(command_files) do\nfor _, cmdset in ipairs(cmdsets) do\nlocal file_in = path.getrelative(cfg.location, cmdset[1])\nlocal file_out = path.getrelative(cfg.location, cmdset[2])\nlocal deps = ''\nfor i, dep in ipairs(cmdset[3]) do\ndeps = deps .. path.getrelative(cfg.location, dep) .. ' '\nend\n_p(\"build \" .. file_out .. ': ' .. cmdset[4] .. ' ' .. file_in .. ' | ' .. deps .. prebuildsuffix)\n_p(\"\")\nend\nend\nend\nfunction cpp.dependencyRules(prj, cfg)\nlocal extra_deps = {}\nlocal order_de" - "ps = {}\nlocal extra_flags = {}\nfor _, dependency in ipairs(prj.dependency or {}) do\nfor _, dep in ipairs(dependency or {}) do\nlocal objfilename = cpp.objectname(cfg, path.getrelative(prj.location, dep[1]))\nlocal dependency = path.getrelative(cfg.location, dep[2])\nif extra_deps[objfilename] == nil then\nextra_deps[objfilename] = {}\nend\ntable.insert(extra_deps[objfilename], dependency)\nend\nend\nlocal pchfilename = cfg.pchheader_full and cpp.pchname(cfg, cfg.pchheader_full) or ''\nfor _, file in ipairs(cfg.files) do\nlocal objfilename = file == cfg.pchheader and cpp.pchname(cfg, file) or cpp.objectname(cfg, file)\nif path.issourcefile(file) or file == cfg.pchheader then\nif #cfg.prebuildcommands > 0 then\nif order_deps[objfilename] == nil then\norder_deps[objfilename] = {}\nend\ntable.insert(order_deps[objfilename], '__prebuildcommands_' .. premake.esc(prj.name))\nend\nend\nif path.issourcefile(file) then\nif cfg.pchheader_full and not cfg.flags.NoPCH then\nlocal nopch = table.icontains(prj.nopch, file)" - "\nif not nopch then\nlocal suffix = path.isobjcfile(file) and '_objc' or ''\nif extra_deps[objfilename] == nil then\nextra_deps[objfilename] = {}\nend\ntable.insert(extra_deps[objfilename], pchfilename .. suffix .. \".gch\")\nif extra_flags[objfilename] == nil then\nextra_flags[objfilename] = {}\nend\ntable.insert(extra_flags[objfilename], '-include ' .. pchfilename .. suffix)\nend\nend\nend\nend\ncfg.extra_deps = extra_deps\ncfg.order_deps = order_deps\ncfg.extra_flags = extra_flags\nend\nfunction cpp.objectname(cfg, file)\nreturn path.join(cfg.objectsdir, path.trimdots(path.removeext(file)) .. \".o\")\nend\nfunction cpp.pchname(cfg, file)\nreturn path.join(cfg.objectsdir, path.trimdots(file))\nend\nfunction cpp.file_rules(prj,cfg, flags)\n_p(\"# build files\")\nfor _, file in ipairs(cfg.files) do\n_p(\"# FILE: \" .. file)\nif cfg.pchheader_full == file then\nlocal pchfilename = cpp.pchname(cfg, file)\nlocal extra_deps = #cfg.extra_deps and '| ' .. table.concat(cfg.extra_deps[pchfilename] or {}, ' ') or ''\nl" - "ocal order_deps = #cfg.order_deps and '|| ' .. table.concat(cfg.order_deps[pchfilename] or {}, ' ') or ''\nlocal extra_flags = #cfg.extra_flags and ' ' .. table.concat(cfg.extra_flags[pchfilename] or {}, ' ') or ''\n_p(\"build \" .. pchfilename .. \".gch : cxx \" .. file .. extra_deps .. order_deps)\n_p(1, \"flags = \" .. flags['cxxflags'] .. extra_flags .. iif(prj.language == \"C\", \"-x c-header\", \"-x c++-header\"))\n_p(1, \"includes = \" .. flags.includes)\n_p(1, \"defines = \" .. flags.defines)\n_p(\"build \" .. pchfilename .. \"_objc.gch : cxx \" .. file .. extra_deps .. order_deps)\n_p(1, \"flags = \" .. flags['objcflags'] .. extra_flags .. iif(prj.language == \"C\", \"-x objective-c-header\", \"-x objective-c++-header\"))\n_p(1, \"includes = \" .. flags.includes)\n_p(1, \"defines = \" .. flags.defines)\nelseif path.issourcefile(file) then\nlocal objfilename = cpp.objectname(cfg, file)\nlocal extra_deps = #cfg.extra_deps and '| ' .. table.concat(cfg.extra_deps[objfilename] or {}, ' ') or ''\nlo" - "cal order_deps = #cfg.order_deps and '|| ' .. table.concat(cfg.order_deps[objfilename] or {}, ' ') or ''\nlocal extra_flags = #cfg.extra_flags and ' ' .. table.concat(cfg.extra_flags[objfilename] or {}, ' ') or ''\nlocal cflags = \"cflags\"\nif path.isobjcfile(file) then\n_p(\"build \" .. objfilename .. \": cxx \" .. file .. extra_deps .. order_deps)\ncflags = \"objcflags\"\nelseif path.isasmfile(file) then\n_p(\"build \" .. objfilename .. \": cc \" .. file .. extra_deps .. order_deps)\ncflags = \"asmflags\"\nelseif path.iscfile(file) and not cfg.options.ForceCPP then\n_p(\"build \" .. objfilename .. \": cc \" .. file .. extra_deps .. order_deps)\nelse\n_p(\"build \" .. objfilename .. \": cxx \" .. file .. extra_deps .. order_deps)\ncflags = \"cxxflags\"\nend\n_p(1, \"flags = \" .. flags[cflags] .. extra_flags)\n_p(1, \"includes = \" .. flags.includes)\n_p(1, \"defines = \" .. flags.defines)\nelseif path.isresourcefile(file) then\nend\nend\n_p(\"\")\nend\nfunction cpp.linker(prj, cfg, objfiles, tool)\nloca" - "l all_ldflags = ninja.list(table.join(tool.getlibdirflags(cfg), tool.getldflags(cfg), cfg.linkoptions))\nlocal prebuildsuffix = #cfg.prebuildcommands > 0 and \"||__prebuildcommands\" or \"\"\nlocal libs = {}\nlocal walibs = {}\nlocal lddeps = {}\nif #cfg.wholearchive > 0 then\nfor _, linkcfg in ipairs(premake.getlinks(cfg, \"siblings\", \"object\")) do\nlocal linkpath = path.rebase(linkcfg.linktarget.fullpath, linkcfg.location, cfg.location)\ntable.insert(lddeps, linkpath)\nif table.icontains(cfg.wholearchive, linkcfg.project.name) then\ntable.insert(walibs, table.concat(tool.wholearchive(linkpath), ' '))\nelse\ntable.insert(libs, linkpath)\nend\nend\nelse\nlddeps = premake.getlinks(cfg, \"siblings\", \"fullpath\")\nlibs = lddeps\nend\nlddeps = ninja.list(lddeps)\nlibs = ninja.list(libs) .. \" \" .. ninja.list(tool.getlinkflags(cfg))\nwalibs = ninja.list(walibs)\nlocal function writevars()\n_p(1, \"all_ldflags = \" .. all_ldflags)\n" - "_p(1, \"libs = \" .. libs)\n_p(1, \"walibs = \" .. walibs)\n_p(1, \"all_outputfiles = \" .. table.concat(objfiles, \" \"))\nif #cfg.prelinkcommands > 0 then\n_p(1, 'pre_link = echo Running pre-link commands && ' .. table.implode(cfg.prelinkcommands, \"\", \"\", \" && \") .. \" && \")\nend\nif #cfg.postbuildcommands > 0 then\n_p(1, 'post_build = && echo Running post-build commands && ' .. table.implode(cfg.postbuildcommands, \"\", \"\", \" && \"))\nend\nend\nif cfg.kind == \"StaticLib\" then\nlocal ar_flags = ninja.list(tool.getarchiveflags(cfg, cfg, false))\n_p(\"# link static lib\")\n_p(\"build \" .. cfg:getoutputfilename() .. \": ar \" .. table.concat(objfiles, \" \") .. \" | \" .. lddeps .. prebuildsuffix)\n_p(1, \"flags = \" .. ninja.list(tool.getarchiveflags(cfg, cfg, false)))\n_p(1, \"all_outputfiles = \" .. table.concat(objfiles, \" \"))\nelseif cfg.kind == \"SharedLib\" or cfg.kind == \"Bundle\" then\nlocal output = cfg:getoutputfilename()\n_p(\"# link shared lib\")\n_p(" - "\"build \" .. output .. \": link \" .. table.concat(objfiles, \" \") .. \" | \" .. lddeps .. prebuildsuffix)\nwritevars()\nelseif (cfg.kind == \"ConsoleApp\") or (cfg.kind == \"WindowedApp\") then\n_p(\"# link executable\")\n_p(\"build \" .. cfg:getoutputfilename() .. \": link \" .. table.concat(objfiles, \" \") .. \" | \" .. lddeps .. prebuildsuffix)\nwritevars()\nelse\np.error(\"ninja action doesn't support this kind of target \" .. cfg.kind)\nend\nend\n", + "pfile = $out.d\")\n_p(\" deps = gcc\")\n_p(\"\")\nif cfg.flags.UseObjectResponseFile then\n_p(\"rule ar\")\n_p(\" command = \" .. wrap_ninja_cmd(tool.ar .. \" $flags $out @$out.rsp \" .. (os.is(\"MacOSX\") and \" 2>&1 > /dev/null | sed -e '/.o) has no symbols$$/d'\" or \"\")))\n_p(\" description = ar $out\")\n_p(\" rspfile = $out.rsp\")\n_p(\" rspfile_content = $in $libs\")\n_p(\"\")\nelse\n_p(\"rule ar\")\n_p(\" command = \" .. wrap_ninja_cmd(tool.ar .. \" $flags $out $in $libs\" .. (os.is(\"MacOSX\") and \" 2>&1 > /dev/null | sed -e '/.o) has no symbols$$/d'\" or \"\")))\n_p(\" description = ar $out\")\n_p(\"\")\nend\nlocal link = iif(cfg.language == \"C\", tool.cc, tool.cxx)\n_p(\"rule link\")\nlocal startgroup = ''\nlocal endgroup = ''\nif (cfg.flags.LinkSupportCircularDependencies) then\nstartgroup = '-Wl,--start-group'\nendgroup = '-Wl,--end-group'\nend\nlocal rspfile_content = \"$all_outputfiles $walibs \" .. string.format(\"%s $libs %s\", startgroup, en" + "dgroup)\nif cfg.flags.UseLDResponseFile then\n_p(\" command = \" .. wrap_ninja_cmd(\"$pre_link \" .. link .. \" -o $out @$out.rsp $all_ldflags $post_build\"))\n_p(\" description = link $out\")\n_p(\" rspfile = $out.rsp\")\n_p(\" rspfile_content = %s\", rspfile_content)\n_p(\"\")\nelse\n_p(\" command = \" .. wrap_ninja_cmd(\"$pre_link \" .. link .. \" -o $out \" .. rspfile_content .. \" $all_ldflags $post_build\"))\n_p(\" description = link $out\")\n_p(\"\")\nend\n_p(\"rule exec\")\n_p(\" command = \" .. wrap_ninja_cmd(\"$command\"))\n_p(\" description = Run $type commands\")\n_p(\"\")\nif #cfg.prebuildcommands > 0 then\n_p(\"build __prebuildcommands_\" .. premake.esc(prj.name) .. \": exec\")\n_p(1, \"command = \" .. wrap_ninja_cmd(\"echo Running pre-build commands && \" .. table.implode(cfg.prebuildcommands, \"\", \"\", \" && \")))\n_p(1, \"type = pre-build\")\n_p(\"\")\nend\ncfg.pchheader_full = cfg.pchheader\nfor _, incdir in ipairs(cfg.includedirs) do\nlocal ab" + "spath = path.getabsolute(path.join(cfg.project.location, cfg.shortname, incdir))\nlocal testname = path.join(abspath, cfg.pchheader_full)\nif os.isfile(testname) then\ncfg.pchheader_full = path.getrelative(cfg.location, testname)\nbreak\nend\nend\ncpp.custombuildtask(prj, cfg)\ncpp.dependencyRules(prj, cfg)\ncpp.file_rules(prj, cfg, flags)\nlocal objfiles = {}\nfor _, file in ipairs(cfg.files) do\nif path.issourcefile(file) then\ntable.insert(objfiles, cpp.objectname(cfg, file))\nend\nend\n_p('')\ncpp.linker(prj, cfg, objfiles, tool, flags)\n_p(\"\")\nend\nfunction cpp.custombuildtask(prj, cfg)\nlocal cmd_index = 1\nlocal ninja_rules = {}\nlocal ninja_builds = {}\nlocal prebuildsuffix = #cfg.prebuildcommands > 0 and \"||__prebuildcommands_\" .. premake.esc(prj.name) or \"\"\nfor _, custombuildtask in ipairs(prj.custombuildtask or {}) do\nfor _, buildtask in ipairs(custombuildtask or {}) do\nlocal commands = {}\nfor _, cmd in ipairs(buildtask[4] or {}) do\nlocal num = 1\nfor _, depdata in ipairs(buildtask[3] or" + " {}) do\ncmd = string.gsub(cmd,\"%$%(\" .. num ..\"%)\", string.format(\"%s \", path.getrelative(cfg.location, depdata)))\nnum = num + 1\nend\ncmd = string.gsub(cmd, '%$%(<%)', '$in')\ncmd = string.gsub(cmd, '%$%(@%)', '$out')\ntable.insert(commands, cmd)\nend\nninja_rules[\"cmd_\" .. cmd_index] = commands\ntable.insert(ninja_builds, {\nfile_in = buildtask[1],\nfile_out = buildtask[2],\nrule = \"cmd_\" .. cmd_index,\ndeps = buildtask[3]\n})\ncmd_index = cmd_index + 1\nend\nend\n_p(\"# custom build rules\")\nfor rule, commands in pairs(ninja_rules) do\n_p(\"rule \" .. rule)\n_p(1, \"command = \" .. wrap_ninja_cmd(table.concat(commands, \" && \")))\nend\nfor i = 1,#ninja_builds do\nlocal build = ninja_builds[i]\nlocal deps = ''\nfor i, dep in ipairs(build.deps) do\ndeps = deps .. path.getrelative(cfg.location, dep) .. ' '\nend\n_p(\"build \" .. path.getrelative(cfg.location, build.file_out) .. ': ' .. build.rule .. ' ' .. path.getrelative(cfg.location, build.file_in) .. ' | ' .. deps .. prebuildsuffix)\n_p(\"\")" + "\nend\nend\nfunction cpp.dependencyRules(prj, cfg)\nlocal extra_deps = {}\nlocal order_deps = {}\nlocal extra_flags = {}\nfor _, dependency in ipairs(prj.dependency or {}) do\nfor _, dep in ipairs(dependency or {}) do\nlocal objfilename = cpp.objectname(cfg, path.getrelative(prj.location, dep[1]))\nlocal dependency = path.getrelative(cfg.location, dep[2])\nif extra_deps[objfilename] == nil then\nextra_deps[objfilename] = {}\nend\ntable.insert(extra_deps[objfilename], dependency)\nend\nend\nlocal pchfilename = cfg.pchheader_full and cpp.pchname(cfg, cfg.pchheader_full) or ''\nfor _, file in ipairs(cfg.files) do\nlocal objfilename = file == cfg.pchheader and cpp.pchname(cfg, file) or cpp.objectname(cfg, file)\nif path.issourcefile(file) or file == cfg.pchheader then\nif #cfg.prebuildcommands > 0 then\nif order_deps[objfilename] == nil then\norder_deps[objfilename] = {}\nend\ntable.insert(order_deps[objfilename], '__prebuildcommands_' .. premake.esc(prj.name))\nend\nend\nif path.issourcefile(file) then\nif cfg.pc" + "hheader_full and not cfg.flags.NoPCH then\nlocal nopch = table.icontains(prj.nopch, file)\nif not nopch then\nlocal suffix = path.isobjcfile(file) and '_objc' or ''\nif extra_deps[objfilename] == nil then\nextra_deps[objfilename] = {}\nend\ntable.insert(extra_deps[objfilename], pchfilename .. suffix .. \".gch\")\nif extra_flags[objfilename] == nil then\nextra_flags[objfilename] = {}\nend\ntable.insert(extra_flags[objfilename], '-include ' .. pchfilename .. suffix)\nend\nend\nend\nend\ncfg.extra_deps = extra_deps\ncfg.order_deps = order_deps\ncfg.extra_flags = extra_flags\nend\nfunction cpp.objectname(cfg, file)\nreturn path.join(cfg.objectsdir, path.trimdots(path.removeext(file)) .. \".o\")\nend\nfunction cpp.pchname(cfg, file)\nreturn path.join(cfg.objectsdir, path.trimdots(file))\nend\nfunction cpp.file_rules(prj,cfg, flags)\n_p(\"# build files\")\nfor _, file in ipairs(cfg.files) do\n_p(\"# FILE: \" .. file)\nif cfg.pchheader_full == file then\nlocal pchfilename = cpp.pchname(cfg, file)\nlocal extra_deps = " + "#cfg.extra_deps and '| ' .. table.concat(cfg.extra_deps[pchfilename] or {}, ' ') or ''\nlocal order_deps = #cfg.order_deps and '|| ' .. table.concat(cfg.order_deps[pchfilename] or {}, ' ') or ''\nlocal extra_flags = #cfg.extra_flags and ' ' .. table.concat(cfg.extra_flags[pchfilename] or {}, ' ') or ''\n_p(\"build \" .. pchfilename .. \".gch : cxx \" .. file .. extra_deps .. order_deps)\n_p(1, \"flags = \" .. flags['cxxflags'] .. extra_flags .. iif(prj.language == \"C\", \"-x c-header\", \"-x c++-header\"))\n_p(1, \"includes = \" .. flags.includes)\n_p(1, \"defines = \" .. flags.defines)\n_p(\"build \" .. pchfilename .. \"_objc.gch : cxx \" .. file .. extra_deps .. order_deps)\n_p(1, \"flags = \" .. flags['objcflags'] .. extra_flags .. iif(prj.language == \"C\", \"-x objective-c-header\", \"-x objective-c++-header\"))\n_p(1, \"includes = \" .. flags.includes)\n_p(1, \"defines = \" .. flags.defines)\nelseif path.issourcefile(file) then\nlocal objfilename = cpp.objectname(cfg, file)\nlocal extra_deps = #" + "cfg.extra_deps and '| ' .. table.concat(cfg.extra_deps[objfilename] or {}, ' ') or ''\nlocal order_deps = #cfg.order_deps and '|| ' .. table.concat(cfg.order_deps[objfilename] or {}, ' ') or ''\nlocal extra_flags = #cfg.extra_flags and ' ' .. table.concat(cfg.extra_flags[objfilename] or {}, ' ') or ''\nlocal cflags = \"cflags\"\nif path.isobjcfile(file) then\n_p(\"build \" .. objfilename .. \": cxx \" .. file .. extra_deps .. order_deps)\ncflags = \"objcflags\"\nelseif path.isasmfile(file) then\n_p(\"build \" .. objfilename .. \": cc \" .. file .. extra_deps .. order_deps)\ncflags = \"asmflags\"\nelseif path.iscfile(file) and not cfg.options.ForceCPP then\n_p(\"build \" .. objfilename .. \": cc \" .. file .. extra_deps .. order_deps)\nelse\n_p(\"build \" .. objfilename .. \": cxx \" .. file .. extra_deps .. order_deps)\ncflags = \"cxxflags\"\nend\n_p(1, \"flags = \" .. flags[cflags] .. extra_flags)\n_p(1, \"includes = \" .. flags.includes)\n_p(1, \"defines = \" .. flags.defines)\nelseif path.isresourcefile" + "(file) then\nend\nend\n_p(\"\")\nend\nfunction cpp.linker(prj, cfg, objfiles, tool)\nlocal all_ldflags = ninja.list(table.join(tool.getlibdirflags(cfg), tool.getldflags(cfg), cfg.linkoptions))\nlocal prebuildsuffix = #cfg.prebuildcommands > 0 and (\"||__prebuildcommands_\" .. premake.esc(prj.name)) or \"\"\nlocal libs = {}\nlocal walibs = {}\nlocal lddeps = {}\nif #cfg.wholearchive > 0 then\nfor _, linkcfg in ipairs(premake.getlinks(cfg, \"siblings\", \"object\")) do\nlocal linkpath = path.rebase(linkcfg.linktarget.fullpath, linkcfg.location, cfg.location)\ntable.insert(lddeps, linkpath)\nif table.icontains(cfg.wholearchive, linkcfg.project.name) then\ntable.insert(walibs, table.concat(tool.wholearchive(linkpath), ' '))\nelse\ntable.insert(libs, linkpath)\nend\nend\nelse\nlddeps = premake.getlinks(cfg, \"siblings\", \"fullpath\")\nlibs = lddeps\nend\nlddeps = ninja.list(lddeps)\nlibs = ninja.list(libs) .. \" \" .. ninja.list(tool.getlinkflags(cfg))\n" + "walibs = ninja.list(walibs)\nlocal function writevars()\n_p(1, \"all_ldflags = \" .. all_ldflags)\n_p(1, \"libs = \" .. libs)\n_p(1, \"walibs = \" .. walibs)\n_p(1, \"all_outputfiles = \" .. table.concat(objfiles, \" \"))\nif #cfg.prelinkcommands > 0 then\n_p(1, 'pre_link = echo Running pre-link commands && ' .. table.implode(cfg.prelinkcommands, \"\", \"\", \" && \") .. \" && \")\nend\nif #cfg.postbuildcommands > 0 then\n_p(1, 'post_build = && echo Running post-build commands && ' .. table.implode(cfg.postbuildcommands, \"\", \"\", \" && \"))\nend\nend\nif cfg.kind == \"StaticLib\" then\nlocal ar_flags = ninja.list(tool.getarchiveflags(cfg, cfg, false))\n_p(\"# link static lib\")\n_p(\"build \" .. cfg:getoutputfilename() .. \": ar \" .. table.concat(objfiles, \" \") .. \" | \" .. lddeps .. prebuildsuffix)\n_p(1, \"flags = \" .. ninja.list(tool.getarchiveflags(cfg, cfg, false)))\n_p(1, \"all_outputfiles = \" .. table.concat(objfiles, \" \"))\nelseif cfg.kind ==" + " \"SharedLib\" or cfg.kind == \"Bundle\" then\nlocal output = cfg:getoutputfilename()\n_p(\"# link shared lib\")\n_p(\"build \" .. output .. \": link \" .. table.concat(objfiles, \" \") .. \" | \" .. lddeps .. prebuildsuffix)\nwritevars()\nelseif (cfg.kind == \"ConsoleApp\") or (cfg.kind == \"WindowedApp\") then\n_p(\"# link executable\")\n_p(\"build \" .. cfg:getoutputfilename() .. \": link \" .. table.concat(objfiles, \" \") .. \" | \" .. lddeps .. prebuildsuffix)\nwritevars()\nelse\np.error(\"ninja action doesn't support this kind of target \" .. cfg.kind)\nend\nend\n", /* actions/ninja/ninja_swift.lua */ "local ninja = premake.ninja\nlocal swift = {}\nlocal p = premake\nfunction ninja.generate_swift(prj)\nlocal pxy = ninja.get_proxy(\"prj\", prj)\nlocal tool = premake.gettool(prj)\nlocal platforms = premake.filterplatforms(prj.solution, tool.platforms, \"Native\")\nfor _, platform in ipairs(platforms) do\nfor cfg in p.eachconfig(pxy, platform) do\np.generate(cfg, cfg:getprojectfilename(), function() swift.generate_config(prj, cfg) end)\nend\nend\nend\nfunction swift.generate_config(prj, cfg)\nlocal tool = premake.gettool(prj)\nlocal flags = {\nswiftcflags = ninja.list(tool.getswiftcflags(cfg)),\nswiftlinkflags = ninja.list(tool.getswiftlinkflags(cfg)),\n}\n_p(\"# Swift project build file\")\n_p(\"# generated with GENie ninja\")\n_p(\"\")\n_p(\"ninja_required_version = 1.7\")\n_p(\"\")\n_p(\"out_dir = %s\", cfg.buildtarget.directory)\n_p(\"obj_dir = %s\", path.join(cfg.objectsdir, prj.name .. \".build\"))\n_p(\"target = $out_dir/%s\", cfg.buildtarget.name)\n_p(\"module_name = %s\", prj.name)\n_p(\"module_" @@ -515,31 +522,14 @@ const char* builtin_scripts[] = { "ags = \" .. all_ldflags)\n_p(1, \"libs = \" .. libs)\nend\nlocal objfiles, modfiles, docfiles = table.unpack(depfiles)\n_p(\"build $out_dir/$module_name.swiftmodule | $out_dir/$module_name.swiftdoc: swiftm %s | %s\", table.concat(modfiles, \" \"), table.concat(docfiles, \" \"))\n_p(\"\")\nlocal output = cfg:getoutputfilename()\nif cfg.kind == \"StaticLib\" then\nlocal ar_flags = ninja.list(tool.getarchiveflags(cfg, cfg, false))\n_p(\"build %s: ar %s | %s $out_dir/$module_name.swiftmodule $out_dir/$module_name.swiftdoc\", output, table.concat(objfiles, \" \"), lddeps)\n_p(1, \"flags = %s\", ninja.list(tool.getarchiveflags(cfg, cfg, false)))\nelseif cfg.kind == \"SharedLib\" then\n_p(\"build %s : swiftlink %s | %s $out_dir/$module_name.swiftmodule $out_dir/$module_name.swiftdoc\", output, table.concat(objfiles, \" \"), libs)\nwritevars()\nelseif (cfg.kind == \"ConsoleApp\") or (cfg.kind == \"WindowedApp\") then\n_p(\"build %s: swiftlink %s | %s $out_dir/$module_name.swiftmodule $out_dir/$module_name.swift" "doc\", output, table.concat(objfiles, \" \"), lddeps)\nelse\np.error(\"ninja action doesn't support this kind of target \" .. cfg.kind)\nend\nend\n", - /* actions/qbs/_qbs.lua */ - "premake.qbs = { }\nlocal qbs = premake.qbs\nnewaction\n{\ntrigger = \"qbs\",\nshortname = \"qbs\",\ndescription = \"Generate QBS build files\",\nmodule = \"qbs\",\nvalid_kinds = {\"ConsoleApp\", \"WindowedApp\", \"StaticLib\", \"SharedLib\", \"Bundle\"},\nvalid_languages = {\"C\", \"C++\"},\nvalid_tools = {\ncc = { \"gcc\", \"msc\" },\n},\nonsolution = function(sln)\nio.eol = \"\\n\"\nio.indent = \"\\t\"\nio.escaper(qbs.esc)\npremake.generate(sln, sln.name .. \".creator.qbs\", qbs.generate_solution)\nio.indent = \" \"\npremake.generate(sln, sln.name .. \".creator.qbs.user\", qbs.generate_user)\nend,\nonproject = function(prj)\nio.eol = \"\\n\"\nio.indent = \"\\t\"\nio.escaper(qbs.esc)\npremake.generate(prj, prj.name .. \".qbs\", qbs.generate_project)\nend,\n}\n", - - /* actions/qbs/qbs_base.lua */ - "function premake.qbs.list(indent, name, table)\nif #table > 0 then\n_p(indent, '%s: [', name)\nfor _, item in ipairs(table) do\n_p(indent+1, '\"%s\",', item:gsub('\"', '\\\\\"'))\nend\n_p(indent+1, ']')\nend\nend", - - /* actions/qbs/qbs_solution.lua */ - "local qbs = premake.qbs\nfunction qbs.generate_solution(sln)\n_p('/*')\n_p(' * QBS project file autogenerated by GENie')\n_p(' * https://github.com/bkaradzic/GENie')\n_p(' */')\n_p('')\n_p('import qbs')\n_p('')\n_p(0, 'Project {')\n_p(1, 'references: [')\nfor prj in premake.solution.eachproject(sln) do\n_p(2, '\"' .. prj.name .. '.qbs\",')\nend\n_p(1, ']')\n_p(0, '}')\nend\nlocal function is_app(kind)\nif kind == \"ConsoleApp\" or kind == \"WindowedApp\" then\nreturn true\nend\nreturn false\nend\nfunction qbs.generate_user(sln)\n_p(0, '')\n_p(0, '')\n_p(0, '')\n_p(0, '')\nlocal startProject = 0\nlocal idx = 0\nfor prj in premake.solution.eachproject(sln) do\nif is_app(prj.kind) then\nif sln.startproject == prj.name then\nstartProject = idx\nend\nidx = idx + 1\nend\nend\n_p(1, '')\n_p(2, 'ProjectExplorer.Project.Target.0')\n" - "_p(2, '')\n_p(3, 'Desktop')\n_p(3, 'Desktop')\nlocal qbsguid = \"\"\nlocal qbsprofile = \"\"\nlocal qtcreatordir = \"\"\nif _OS == \"windows\" then\nqtcreatordir = path.join(os.getenv(\"APPDATA\"), \"QtProject/qtcreator\")\nelse\nqtcreatordir = path.join(os.getenv(\"HOME\"), \".config/QtProject/qtcreator\")\nend\nlocal file = io.open(path.join(qtcreatordir, \"qbs.conf\"))\nif file == nil then\nfile = io.open(path.join(qtcreatordir, \"qbs/1.6.0/qbs.conf\"))\nend\nif file ~= nil then\nfor line in file:lines() do\nif line == \"[org]\" then\nlocal str = 'qt-project\\\\qbs\\\\preferences\\\\qtcreator\\\\kit\\\\%'\nlocal index = string.len(str)+1\nfor line in file:lines() do\nif index == string.find(line, '7B', index) then\nline = string.sub(line, index+2)\nqbsguid = string.sub(line, 1, 36)\nqbspro" - "file = string.sub(line, 41)\nbreak\nend\nend\nelse\nlocal str = '\\torg.qt-project.qbs.preferences.qtcreator.kit.'\nlocal index = string.len(str)+1\nfor line in file:lines() do\nif qbsguid == \"\" and index == string.find(line, '{', index) then\nline = string.sub(line, index+1)\nqbsguid = string.sub(line, 1, 36)\nelseif qbsguid ~= \"\" then\nqbsprofile = string.sub(line, 10, 29)\nbreak\nend\nend\nend\nbreak\nend\nio.close(file)\nend\n_p(3, '{%s}', qbsguid)\n_p(3, '0')\n_p(3, '0')\n_p(3, '%d', startProject)\nidx = 0\nfor _, cfgname in ipairs(sln.configurations) do\n_p(3, '', idx)\n_p(4, 'build')\n_p(4, '')\n_p(5, '')\n_p(6, 'true')\n_p(6, '')\n_p(6, 'Qbs Build')\n_p(6, 'Qbs.BuildStep')\n_p(6, 'false')\n_p(6, '')\n_p(7, '%s', cfgname:lower())\n_p(7, '%s', qbsprofile)\n_p(6, '')\n_p(5, '')\n_p(5, '1')\n_p(5, 'Build')\n_p(5, '')\n_p(5, 'ProjectExplorer.BuildSteps.Build')\n_p(4, '')\n_p(4, '')\n_p(5, '')\n_p(6, 'true')\n_p(6, '')\n_p(6, 'Qbs Clean')\n_p(6, 'Qbs" - ".CleanStep')\n_p(6, 'true')\n_p(6, 'false')\n_p(6, 'false')\n_p(5, '')\n_p(5, '1')\n_p(5, 'Clean')\n_p(5, '')\n_p(5, 'ProjectExplorer.BuildSteps.Clean')\n_p(4, '')\n_p(4, '2')\n_p(4, 'false')\n_p(4, '')\n_p(4, '%s', cfgname)\n_p(4, '')\n_p(4, 'Qbs.QbsBuildConfiguration')\n_p(3, '')\nidx = idx + 1\nend\n_p(3, '%d', idx)\n_p(3, '')\n_p(4, '')\n_p(5, '0')\n_p(5, 'Deploy')\n_p(5, '')\n_p(5, 'ProjectExplorer.BuildSteps.Deploy')\n_p(4, '')\n_p(4, '1')\n_p(4, 'Deploy locally')\n_p(4, 'Qbs Install')\n_p(4, 'Qbs.Deploy')\n_p(3, '')\n_p(3, '1')\nidx = 0\nfor prj in premake.solution.eachproject(sln) do\nif is_app(prj.kind) then\n_p(3, '', idx)\nif idx == startProject then\n_p(4, '2')\nelse\n_p(4, '-1')\nend\n_p(4, '')\n_p(4, '%s', prj.name)\n_p(4, '')\n_p(4, 'Qbs.RunConfiguration:%s.%s---Qbs.RC.NameSeparator---%s', prj.name, qbsprofile, prj.name)\n_p(4, '')\nlocal cfg = premake.getconfig(prj, nil, nil)\nif cfg.debugdir ~= nil then\n_p(4, '%s', cfg.debugdir)\nelse\n_p(4, '')\nend\n_p(3, '')\nidx = idx + 1\nend\nend\n_p(3, '%d', idx)\n_p(2, '')\n_p(1, '')\n_p(1," - " '')\n_p(2, 'ProjectExplorer.Project.TargetCount')\n_p(2, '1')\n_p(1, '')\n_p(1, '')\n_p(2, 'Version')\n_p(2, '18')\n_p(1, '')\n_p(0, '')\nend\n", - - /* actions/qbs/qbs_cpp.lua */ - "local qbs = premake.qbs\nlocal function is_excluded(prj, cfg, file)\nif table.icontains(prj.excludes, file) then\nreturn true\nend\nif table.icontains(cfg.excludes, file) then\nreturn true\nend\nreturn false\nend\nfunction qbs.generate_project(prj)\nlocal indent = 0\n_p(indent, '/*')\n_p(indent, ' * QBS project file autogenerated by GENie')\n_p(indent, ' * https://github.com/bkaradzic/GENie')\n_p(indent, ' */')\n_p(indent, '')\n_p(indent, 'import qbs 1.0')\n_p(indent, '')\nif prj.kind == \"ConsoleApp\" then\n_p(indent, 'CppApplication {')\n_p(indent + 1, 'consoleApplication: true')\nelseif prj.kind == \"WindowedApp\" then\n_p(indent, 'CppApplication {')\n_p(indent + 1, 'consoleApplication: false')\nelseif prj.kind == \"StaticLib\" then\n_p(indent, 'StaticLibrary {')\nelseif prj.kind == \"SharedLib\" then\n_p(indent, 'DynamicLibrary {')\nend\nindent = indent + 1\n_p(indent, 'name: \"' .. prj.name .. '\"')\n_p(indent, 'Depends { name: \"cpp\" }')\nlocal deps = premake.getdependencies(prj)\nif #deps > 0 then\nfor" - " _, depprj in ipairs(deps) do\n_p(indent, 'Depends { name: \"%s\" }', depprj.name)\nend\nend\nlocal cc = premake.gettool(prj)\nlocal platforms = premake.filterplatforms(prj.solution, cc.platforms, \"Native\")\nfor _, platform in ipairs(platforms) do\nfor cfg in premake.eachconfig(prj, platform) do\nif cfg.platform ~= \"Native\" then\n_p('');\n_p(indent, 'Properties { /* %s */', premake.getconfigname(cfg.name, cfg.platform, true))\nindent = indent + 1\nlocal arch = \"\"\nlocal linkerFlags = cfg.linkoptions\nif cfg.platform == \"x32\" then\narch = '&& qbs.architecture == \"x86\"'\nelseif cfg.platform == \"x64\" then\narch = '&& qbs.architecture == \"x86_64\"'\nend\nif cfg.name == \"Debug\" then\n_p(indent, 'condition: qbs.buildVariant == \"debug\" %s', arch)\nelse\n_p(indent, 'condition: qbs.buildVariant == \"release\" %s', arch)\nend\n_p(indent, 'targetName: \"%s\"', cfg.buildtarget.basename)\n_p(indent, 'destinationDirectory: \"%s\"', path.getabsolute('projects/qbs/' .. cfg.buildtarget.directory) .. '/')\nif c" - "fg.flags.Cpp11 then\n_p(indent, 'cpp.cxxLanguageVersion: \"c++11\"')\nelseif cfg.flags.Cpp14 then\n_p(indent, 'cpp.cxxLanguageVersion: \"c++14\"')\nelseif cfg.flags.Cpp17 then\n_p(indent, 'cpp.cxxLanguageVersion: \"c++17\"')\nelse\n_p(indent, 'cpp.cxxLanguageVersion: \"c++98\"')\nend\nif os.is(\"windows\") then\nif not cfg.flags.WinMain and (cfg.kind == 'ConsoleApp' or cfg.kind == 'WindowedApp') then\nif cfg.flags.Unicode then\n_p(indent, 'cpp.entryPoint: \"wmainCRTStartup\"')\nelse\n_p(indent, 'cpp.entryPoint: \"mainCRTStartup\"')\nend\nend\nend\nqbs.list(\n indent\n, \"cpp.commonCompilerFlags\"\n, cfg.buildoptions\n)\nqbs.list(\n indent\n, \"cpp.cFlags\"\n, cfg.buildoptions_c\n)\nqbs.list(\n indent\n, \"cpp.cxxFlags\"\n, cfg.buildoptions_cpp\n)\nqbs.list(\n indent\n, \"cpp.objcFlags\"\n, cfg.buildoptions_objc\n)\nqbs.list(\n indent\n, \"cpp.objcxxFlags\"\n, cfg.buildoptions_objc\n)\nif cfg.flags.StaticRuntime then\n_p(indent, 'cpp.runtimeLibrary: \"static\"')\nelse\n_p(indent, 'cpp.runtimeLibrary: \"dyn" - "amic\"')\nend\nif cfg.flags.PedanticWarnings\nor cfg.flags.ExtraWarnings\nthen\n_p(indent, 'cpp.warningLevel: \"all\"')\nelse\n_p(indent, 'cpp.warningLevel: \"default\"')\nend\nif cfg.flags.FatalWarnings then\n_p(indent, 'cpp.treatWarningsAsErrors: true')\nelse\n_p(indent, 'cpp.treatWarningsAsErrors: false')\nend\nif cfg.flags.NoRTTI then\n_p(indent, 'cpp.enableRtti: false')\nelse\n_p(indent, 'cpp.enableRtti: true')\nend\nif cfg.flags.NoExceptions then\n_p(indent, 'cpp.enableExceptions: false')\nelse\n_p(indent, 'cpp.enableExceptions: true')\nend\nif cfg.flags.Symbols then\n_p(indent, 'cpp.debugInformation: true')\nelse\n_p(indent, 'cpp.debugInformation: false')\nend\nif cfg.flags.Unicode then\n_p(indent, 'cpp.windowsApiCharacterSet: \"unicode\"')\nelse\n_p(indent, 'cpp.windowsApiCharacterSet: \"\"')\nend\nif not cfg.pchheader or cfg.flags.NoPCH then\n_p(indent, 'cpp.usePrecompiledHeader: false')\nelse\n_p(indent, 'cpp.usePrecompiledHeader: true')\n_p(indent, 'Group {')\n_p(indent+1, 'name: \"PCH\"')\n_p(inden" - "t+1, 'files: [\"' .. cfg.pchheader .. '\"]')\n_p(indent+1, 'fileTags: [\"cpp_pch_src\"]')\n_p(indent, '}')\nend\nfor _, value in ipairs(cfg.flags) do\nif (value == \"Optimize\") then\nelseif (value == \"OptimizeSize\") then\n_p(indent, 'cpp.optimization: \"small\"')\nelseif (value == \"OptimizeSpeed\") then\n_p(indent, 'cpp.optimization: \"fast\"')\nend\nend\nqbs.list(\n indent\n, \"cpp.defines\"\n, cfg.defines\n)\nlocal sortedincdirs = table.join(cfg.userincludedirs, cfg.includedirs, cfg.systemincludedirs)\ntable.sort(sortedincdirs, includesort)\nqbs.list(\n indent\n, \"cpp.includePaths\"\n, sortedincdirs\n)\nqbs.list(\n indent\n, \"cpp.staticLibraries\"\n, premake.getlinks(cfg, \"system\", \"fullpath\")\n)\nqbs.list(\n indent\n, \"cpp.libraryPaths\"\n, cfg.libdirs\n)\nqbs.list(\n indent\n, \"cpp.linkerFlags\"\n, linkerFlags\n)\ntable.sort(prj.files)\nif #prj.files > 0 then\n_p(indent, 'files: [')\nfor _, file in ipairs(prj.files) do\nif path.iscfile(file)\nor path.iscppfile(file)\nor path.isobjcfile(fil" - "e)\nor path.isresourcefile(file)\nor path.iscppheader(file) then\nif not is_excluded(prj, cfg, file) then\n_p(indent+1, '\"%s\",', file)\nend\nend\nend\n_p(indent+1, ']')\nend\nif #prj.excludes > 0 then\n_p(indent, 'excludeFiles: [')\ntable.sort(prj.excludes)\nfor _, file in ipairs(prj.excludes) do\nif path.issourcefile(file) then\n_p(indent+1, '\"%s\",', file)\nend\nend\n_p(indent+1, ']')\nend\nindent = indent - 1\n_p(indent, '}');\nend\nend\nend\nindent = indent - 1\n_p(indent, '}')\nend\n", + /* actions/jcdb/_jcdb.lua */ + "newaction {\ntrigger = \"jcdb\",\nshortname = \"compile_commands.json\",\ndescription = \"Generate a compile_commands.json file.\",\nvalid_kinds = { \"ConsoleApp\", \"WindowedApp\", \"StaticLib\", \"SharedLib\", \"Bundle\" },\nvalid_languages = { \"C\", \"C++\" },\nvalid_tools = { cc = { \"gcc\" } },\nonsolution = function(sln)\nlocal jsonpath = path.join(sln.location, \"compile_commands.json\")\npremake.generate(sln, jsonpath, premake.jcdb.generate)\nend,\n}\n", + + /* actions/jcdb/jcdb_solution.lua */ + "premake.jcdb = {}\nlocal premake = premake\nlocal jcdb = premake.jcdb\nlocal encode_chars = {\n[0x22] = '\\\\\"',\n[0x5c] = \"\\\\\\\\\",\n[0x08] = \"\\\\b\",\n[0x0c] = \"\\\\f\",\n[0x0a] = \"\\\\n\",\n[0x0d] = \"\\\\r\",\n[0x09] = \"\\\\t\",\n}\nlocal function encode_string(s)\nlocal res = '\"'\nfor _, cp in utf8.codes(s) do\nif encode_chars[cp] then\nres = res..encode_chars[cp]\nelseif cp < 32 then\nres = res..string.format(\"\\\\u%04x\", cp)\nelse\nres = res..utf8.char(cp)\nend\nend\nreturn res..'\"'\nend\nlocal function escape_cmdline_arg(s)\nif s:find(\"%s\") then\ns = s:gsub(\"\\\\\", \"\\\\\\\\\")\ns = s:gsub('\"', '\\\\\"')\ns = '\"'..s..'\"'\nend\nreturn s\nend\nlocal function list(tbl)\nreturn iif(#tbl > 0, \" \"..table.concat(tbl, \" \"), \"\")\nend\nlocal function build_command(cfg, cc, file)\nlocal cmdline = \"\"\nlocal function app(s) cmdline = cmdline..s end\nif path.iscfile(file) or path.isasmfile(file) then\napp(cc.cc)\nelse\napp(cc.cxx)\nend\napp(list(cc.getcppflags(cfg)))\napp(list(cc.getdef" + "ines(cfg.defines)))\napp(list(cc.getincludedirs(cfg.includedirs)))\napp(list(cc.getquoteincludedirs(cfg.userincludedirs)))\napp(list(cc.getsystemincludedirs(cfg.systemincludedirs)))\napp(list(cc.getcflags(cfg)))\nif path.iscppfile(file) then\napp(list(cc.getcxxflags(cfg)))\nend\nif path.isasmfile(file) then\napp(list(cfg.buildoptions))\napp(list(cfg.buildoptions_asm))\nelseif path.isobjcfile(file) then\nlocal opts = iif(path.iscfile(file), cfg.buildoptions_objc, cfg.buildoptions_objcpp)\napp(list(cc.getobjcflags(cfg)))\napp(list(cfg.buildoptions))\napp(list(opts))\nelseif path.iscfile(file) then\napp(list(cfg.buildoptions))\napp(list(cfg.buildoptions_c))\nelse\napp(list(cfg.buildoptions))\napp(list(cfg.buildoptions_cpp))\nend\nif cfg.pchheader and not cfg.flags.NoPCH then\napp(\" -include \")\napp(escape_cmdline_arg(cfg.pchheader))\nend\nfor _, i in ipairs(cfg.forcedincludes) do\napp(\" -include \")\napp(escape_cmdline_arg(i))\nend\nlocal base = path.trimdots(path.removeext(file))..\".o\"\nlocal output = path." + "join(cfg.objectsdir, base)\napp(\" -o \")\napp(escape_cmdline_arg(output))\napp(\" -c \")\napp(escape_cmdline_arg(file))\nreturn cmdline\nend\nfunction jcdb.generate_config(prj, cfg, cc)\ntable.sort(cfg.files)\nlocal directory = path.getabsolute(prj.location)\nfor _, file in ipairs(cfg.files) do\nif path.iscppfile(file) or path.isasmfile(file) then\n_p(' { \"directory\": %s,', encode_string(directory))\n_p(' \"command\": %s,', encode_string(build_command(cfg, cc, file)))\n_p(' \"file\": %s },', encode_string(file))\nend\nend\nend\nfunction jcdb.generate_project(prj)\nlocal cc = premake.gettool(prj)\nlocal platforms = premake.filterplatforms(prj.solution, cc.platforms, \"Native\")\nfor _, platform in ipairs(platforms) do\nfor cfg in premake.eachconfig(prj, platform) do\njcdb.generate_config(prj, cfg, cc)\nend\nend\nend\nfunction jcdb.generate(sln)\nfor _, prj in ipairs(sln.projects) do\njcdb.generate_project(prj)\nend\nio.captured = io.captured:gsub(\",%s$\", \"\")\nio.captured = \"[\"..io.eol..io.captur" + "ed..io.eol..\"]\"\nend\n", /* _premake_main.lua */ "_WORKING_DIR = os.getcwd()\nlocal function injectplatform(platform)\nif not platform then return true end\nplatform = premake.checkvalue(platform, premake.fields.platforms.allowed)\nfor sln in premake.solution.each() do\nlocal platforms = sln.platforms or { }\nif #platforms == 0 then\ntable.insert(platforms, \"Native\")\nend\nif not table.contains(platforms, \"Native\") then\nreturn false, sln.name .. \" does not target native platform\\nNative platform settings are required for the --platform feature.\"\nend\nif not table.contains(platforms, platform) then\ntable.insert(platforms, platform)\nend\nsln.platforms = platforms\nend\nreturn true\nend\nfunction _premake_main(scriptpath)\nif (scriptpath) then\nlocal scripts = dofile(scriptpath .. \"/_manifest.lua\")\nfor _,v in ipairs(scripts) do\ndofile(scriptpath .. \"/\" .. v)\nend\nend\nlocal profiler = newProfiler()\nif (nil ~= _OPTIONS[\"debug-profiler\"]) then\nprofiler:start()\nend\n_PREMAKE_COMMAND = path.getabsolute(_PREMAKE_COMMAND)\npremake.action" diff --git a/3rdparty/genie/src/host/version.h b/3rdparty/genie/src/host/version.h index 91f561ceb56..423a1604bba 100644 --- a/3rdparty/genie/src/host/version.h +++ b/3rdparty/genie/src/host/version.h @@ -1,3 +1,2 @@ -// This file is autogenerated, do not change it. -#define VERSION 0 -#define VERSION_STR "" +#define VERSION 1181 +#define VERSION_STR "version 1181 (commit 29e6832fdf3b106c0906d288c8ced6c0761b8985)" diff --git a/3rdparty/genie/src/tools/gcc.lua b/3rdparty/genie/src/tools/gcc.lua index 3c87aa2074a..30a9fa91d91 100644 --- a/3rdparty/genie/src/tools/gcc.lua +++ b/3rdparty/genie/src/tools/gcc.lua @@ -46,7 +46,8 @@ Cpp11 = "-std=c++11", Cpp14 = "-std=c++14", Cpp17 = "-std=c++17", - CppLatest = "-std=c++2a", + Cpp20 = "-std=c++20", + CppLatest = "-std=c++2b", NoExceptions = "-fno-exceptions", NoRTTI = "-fno-rtti", UnsignedChar = "-funsigned-char", @@ -115,7 +116,21 @@ cxx = "$(EMSCRIPTEN)/em++", ar = "$(EMSCRIPTEN)/emar", cppflags = "-MMD -MP", - } + }, + NX32 = { + cc = "clang", + cxx = "clang++", + ar = "armv7l-nintendo-nx-eabihf-ar", + cppflags = "-MMD -MP", + flags = "-march=armv7l", + }, + NX64 = { + cc = "clang", + cxx = "clang++", + ar = "aarch64-nintendo-nx-elf-ar", + cppflags = "-MMD -MP", + flags = "-march=aarch64", + }, } local platforms = premake.gcc.platforms diff --git a/3rdparty/genie/src/tools/valac.lua b/3rdparty/genie/src/tools/valac.lua index 4101c2e04fd..43f65818cf4 100644 --- a/3rdparty/genie/src/tools/valac.lua +++ b/3rdparty/genie/src/tools/valac.lua @@ -12,7 +12,8 @@ -- premake.valac.valac = "valac" - premake.valac.cc = "gcc" + premake.valac.cc = premake.gcc.cc + premake.valac.glibrc = "glib-compile-resources" -- @@ -30,20 +31,37 @@ EnableExperimentalNonNull = "--enable-experimental-non-null", -- Enable experimental enhancements for non-null types EnableGObjectTracing = "--enable-gobject-tracing", -- Enable GObject creation tracing EnableMemProfiler = "--enable-mem-profiler", -- Enable GLib memory profiler - EnableThreading = "--thread", -- Enable multithreading support FatalWarnings = "--fatal-warnings", -- Treat warnings as fatal HideInternal = "--hide-internal", -- Hide symbols marked as internal NoStdPkg = "--nostdpkg", -- Do not include standard packages - Optimize = "-X -O2", - OptimizeSize = "-X -Os", - OptimizeSpeed = "-X -O3", Symbols = "-g", -- Produce debug information } - premake.valac.platforms = {} + local valaccflags = + { + Optimize = "-O2", + OptimizeSize = "-Os", + OptimizeSpeed = "-O3", + Symbols = "-g", -- Produce debug information + } -- --- Returns a list of compiler flags, based on the supplied configuration. +-- Map platforms to flags +-- + + premake.valac.platforms = + { + Native = { + }, + x64 = { + flags = "-m64" + }, + } + + + +-- +-- Returns a list of compiler flags for `valac`, based on the supplied configuration. -- function premake.valac.getvalaflags(cfg) @@ -52,6 +70,16 @@ +-- +-- Returns a list of compiler flags for `cc`, based on the supplied configuration. +-- + + function premake.valac.getvalaccflags(cfg) + return table.translate(cfg.flags, valaccflags) + end + + + -- -- Decorate pkgs for the Vala command line. -- @@ -80,18 +108,6 @@ --- --- Decorate C flags for the Vala command line. --- - - function premake.valac.getbuildoptions(buildoptions) - local result = { } - for _, def in ipairs(buildoptions) do - table.insert(result, '-X ' .. def) - end - return result - end - -- -- Decorate vapidirs for the Vala command line. -- diff --git a/3rdparty/genie/tests/actions/vstudio/test_vs2010_flags.lua b/3rdparty/genie/tests/actions/vstudio/test_vs2010_flags.lua index 65b824ea725..be1784c223b 100644 --- a/3rdparty/genie/tests/actions/vstudio/test_vs2010_flags.lua +++ b/3rdparty/genie/tests/actions/vstudio/test_vs2010_flags.lua @@ -205,13 +205,6 @@ function vs10_flags.release_minimalRebuild_setToFalse() test.string_contains(buffer,'false') end -function vs10_flags.mfc_useOfMfc_setToStatic() - flags{"MFC"} - - local buffer = get_buffer() - test.string_contains(buffer,'Dynamic') -end - --there is not an option for /Z7 OldStyle --/ZI is not compatible with /clr or x64_64 --minimal Rebuild requires /Zi in x86_64 diff --git a/3rdparty/genie/tests/actions/vstudio/vc200x/test_mfc.lua b/3rdparty/genie/tests/actions/vstudio/vc200x/test_mfc.lua deleted file mode 100644 index cf0a54a6e54..00000000000 --- a/3rdparty/genie/tests/actions/vstudio/vc200x/test_mfc.lua +++ /dev/null @@ -1,98 +0,0 @@ --- --- tests/actions/vstudio/vc200x/test_mfc.lua --- Validate ATL/MFC support in Visual Studio 200x C/C++ projects. --- Copyright (c) 2011 Jason Perkins and the Premake project --- - - T.vstudio_vs200x_mfc = { } - local suite = T.vstudio_vs200x_mfc - local vc200x = premake.vstudio.vc200x - - --- --- Setup --- - - local sln, prj, cfg - - function suite.setup() - _ACTION = "vs2008" - sln, prj = test.createsolution() - end - - local function prepare(platform) - premake.bake.buildconfigs() - sln.vstudio_configs = premake.vstudio.buildconfigs(sln) - cfg = premake.getconfig(prj, "Debug", platform) - vc200x.Configuration("Debug|Win32", cfg) - end - - --- --- When MFC is enabled, it should match the runtime library linking --- method (static or dynamic). --- - - function suite.useOfMfc_isDynamic_onSharedRuntime() - flags { "MFC" } - prepare() - test.capture [[ - - ]] - end - - function suite.useOfMfc_isStatic_onStaticRuntime() - flags { "MFC", "StaticRuntime" } - prepare() - test.capture [[ - - ]] - end - --- --- Same as above for ATL. --- - - function suite.useOfAtl_isDynamic_onSharedRuntime() - flags { "ATL" } - prepare() - test.capture [[ - - ]] - end - - function suite.useOfAtl_isStatic_onStaticRuntime() - flags { "StaticATL" } - prepare() - test.capture [[ - - ]] - end diff --git a/3rdparty/genie/tests/actions/vstudio/vc2010/test_mfc.lua b/3rdparty/genie/tests/actions/vstudio/vc2010/test_mfc.lua deleted file mode 100644 index 1ada1585673..00000000000 --- a/3rdparty/genie/tests/actions/vstudio/vc2010/test_mfc.lua +++ /dev/null @@ -1,60 +0,0 @@ --- --- tests/actions/vstudio/vc2010/test_mfc.lua --- Validate MFC support in Visual Studio 2010 C/C++ projects. --- Copyright (c) 2011 Jason Perkins and the Premake project --- - - T.vstudio_vs2010_mfc = { } - local suite = T.vstudio_vs2010_mfc - local vc2010 = premake.vstudio.vc2010 - - --- --- Setup --- - - local sln, prj, cfg - - function suite.setup() - _ACTION = "vs2010" - sln, prj = test.createsolution() - end - - local function prepare(platform) - premake.bake.buildconfigs() - sln.vstudio_configs = premake.vstudio.buildconfigs(sln) - cfg = premake.getconfig(prj, "Debug", platform) - vc2010.configurationPropertyGroup(cfg, sln.vstudio_configs[1]) - end - - --- --- When MFC is enabled, it should match the runtime library linking --- method (static or dynamic). --- - - function suite.useOfMfc_isDynamic_onSharedRuntime() - flags { "MFC" } - prepare() - test.capture [[ - - Application - true - MultiByte - Dynamic - - ]] - end - - function suite.useOfMfc_isStatic_onStaticRuntime() - flags { "MFC", "StaticRuntime" } - prepare() - test.capture [[ - - Application - true - MultiByte - Static - - ]] - end diff --git a/3rdparty/genie/tests/premake4.lua b/3rdparty/genie/tests/premake4.lua index 30166e734a3..626eb3e06e1 100644 --- a/3rdparty/genie/tests/premake4.lua +++ b/3rdparty/genie/tests/premake4.lua @@ -98,7 +98,6 @@ dofile("actions/vstudio/vc200x/header.lua") dofile("actions/vstudio/vc200x/test_files.lua") dofile("actions/vstudio/vc200x/test_filters.lua") - dofile("actions/vstudio/vc200x/test_mfc.lua") -- Visual Studio 2010 C/C++ projects dofile("actions/vstudio/vc2010/test_config_props.lua") @@ -108,7 +107,6 @@ dofile("actions/vstudio/vc2010/test_filters.lua") dofile("actions/vstudio/vc2010/test_link_settings.lua") dofile("actions/vstudio/vc2010/test_links.lua") - dofile("actions/vstudio/vc2010/test_mfc.lua") dofile("actions/vstudio/vc2010/test_output_props.lua") dofile("actions/vstudio/vc2010/test_pch.lua") dofile("actions/vstudio/vc2010/test_project_refs.lua") diff --git a/android-project/app/src/main/AndroidManifest.xml b/android-project/app/src/main/AndroidManifest.xml index 4801bc308ca..849c6bd28a2 100644 --- a/android-project/app/src/main/AndroidManifest.xml +++ b/android-project/app/src/main/AndroidManifest.xml @@ -4,8 +4,8 @@ --> diff --git a/docs/source/conf.py b/docs/source/conf.py index ff6181e63fa..8ac9328bedd 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -63,9 +63,9 @@ # built documents. # # The short X.Y version. -version = '0.271' +version = '0.272' # The full version, including alpha/beta/rc tags. -release = '0.271' +release = '0.272' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/hash/cassvisn_cart.xml b/hash/cassvisn_cart.xml new file mode 100644 index 00000000000..9fbb64e17bb --- /dev/null +++ b/hash/cassvisn_cart.xml @@ -0,0 +1,215 @@ + + + + + + + + + + + Yosaku + 1981 + Epoch + + + + + + + + + + + + + + Baseball + 1981 + Epoch + + + + + + + + + + + + + + + Galaxian + 1981 + Epoch + + + + + + + + + + + + + + Big Sports 12 + 1982 + Epoch + + + + + + + + + + + + + + + Battle Vader + 1982 + Epoch + + + + + + + + + + + + + + PakPak Monster + 1982 + Epoch + + + + + + + + + + + + + + New Baseball + 1982 + Epoch + + + + + + + + + + + + + + Monster Mansion + 1982 + Epoch + + + + + + + + + + + + + + Astro Command + 1982 + Epoch + + + + + + + + + + + + + + Monster Block + 1984 + Epoch + + + + + + + + + + + + + + Elevator Panic + 1984 + Epoch + + + + + + + + + + + + + diff --git a/hash/ibm5170_cdrom.xml b/hash/ibm5170_cdrom.xml index f748df505b9..fca6dbbb011 100644 --- a/hash/ibm5170_cdrom.xml +++ b/hash/ibm5170_cdrom.xml @@ -2267,6 +2267,35 @@ Offset [CDDA] audio, does not stop when exiting game (including getting to Windo + + + + + + + + + + + + + + Civilization: Call to Power (Limited Edition, v1.1) + 1996 + Activision + + + + + + + + + + + The Civil War @@ -7008,6 +7037,59 @@ Incredibly slow in tearing down even on pcipcs7 (bypass with fast forward) + + Corel Linux Deluxe + 1999 + Corel + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + FreeDOS 1.0 2006 diff --git a/hash/pc98.xml b/hash/pc98.xml index 1f3f69101a4..6b7db539e63 100644 --- a/hash/pc98.xml +++ b/hash/pc98.xml @@ -11258,12 +11258,14 @@ Has optional [RS-MIDI] sound support + - Chitty Chitty Train + Chitty Chitty Train (.fdi installed hack) 1993 ビッツー (Bit²) @@ -11274,6 +11276,23 @@ Requires 3.5" floppy emulation + + + Chitty Chitty Train (Ver 1.00, .hdm installed hack) + 1993 + ビッツー (Bit²) + + + + + + + + + + Chou·Baku 1993 @@ -30090,6 +30109,21 @@ Black screen, keeps hitting an empty divide by zero exception at PC=1fcb6 + + Lemmings + 1991 + イマジニア (Imagineer) + + + + + + + + + Lenam - Sword of Legend 1990 @@ -43682,6 +43716,18 @@ Cannot install, gets stuck at "please insert disk and press mouse" prompt, tests + + Shikinjou + 1990 + スキャップトラスト (Scap Trust) + + + + + + + + Shin Best Nine Pro Yakyuu 1986 @@ -45190,12 +45236,12 @@ OPN channel 1 keeps repeating on deaths (verify) - + Spindizzy II 1991 アルシスソフト (Arsys Software) diff --git a/hash/psion_ssd.xml b/hash/psion_ssd.xml index 9dd84199b0c..4726dce18e5 100644 --- a/hash/psion_ssd.xml +++ b/hash/psion_ssd.xml @@ -8,7 +8,7 @@ license:CC0-1.0 - + EROS Ver.4.0 (Licensed to The Yorkshire Post) 1995 Design Systems @@ -20,7 +20,7 @@ license:CC0-1.0 - + MC Missile 1990 <homebrew> @@ -33,7 +33,7 @@ license:CC0-1.0 - + Spreadsheet 1990 Psion @@ -45,7 +45,7 @@ license:CC0-1.0 - + System Disk V2.12 1989 Psion @@ -57,7 +57,7 @@ license:CC0-1.0 - + System Disk V2.20 1989 Psion @@ -69,7 +69,7 @@ license:CC0-1.0 - + System Disk (MC Word) V2.50 1992 Psion diff --git a/hash/sc3000_cart.xml b/hash/sc3000_cart.xml index fbad65c2b30..35504749000 100644 --- a/hash/sc3000_cart.xml +++ b/hash/sc3000_cart.xml @@ -4,7 +4,7 @@ license:CC0-1.0 --> - + BASIC Level III (Jpn) @@ -39,9 +39,12 @@ license:CC0-1.0 1985 Sega + + + diff --git a/hash/sc3000_cass.xml b/hash/sc3000_cass.xml index 52b04da7924..9af69c8a238 100644 --- a/hash/sc3000_cass.xml +++ b/hash/sc3000_cass.xml @@ -3,7 +3,31 @@ - + + + + Addition Tutor + 1983 + John Sands Electronics + + + + + + + + + + Australian General Knowledge Tutor + 1984 + John Sands Electronics + + + + + + + The Secret of Bastow Manor @@ -40,7 +64,7 @@ license:CC0-1.0 City Lander 198? - Grandstand + Grandstand Leisure @@ -49,10 +73,53 @@ license:CC0-1.0 + + Columbia + 1984 + Sprites + + + + + + + + + + + + Creation des Sprites + 1984 + Sprites + + + + + + + + + + + + + Crocky + 1984 + Loriciels + + + + + + + + + + Dragonquest 1984 - John Sands + John Sands Electronics @@ -77,7 +144,8 @@ license:CC0-1.0 Environoid 1984 - John Sands + John Sands Electronics + @@ -86,10 +154,28 @@ license:CC0-1.0 + + Faites Vos Jeux - Niveau 1 + 1984 + Distribution & Services + + + + + + + + + + + + + + Help 1984 - Grandstand + Grandstand Leisure @@ -102,7 +188,7 @@ license:CC0-1.0 The House 1984 - Grandstand + Grandstand Leisure @@ -112,6 +198,54 @@ license:CC0-1.0 + + Indiana Jaune & Super Lab + 1984 + Sprites + + + + + + + + + + + + + + + + + + + Kamikaze + 1984 + Loriciels + + + + + + + + + + + + Keyboard Learning Program + 1983 + John Sands Electronics + + + + + + + + + Lawn 198? @@ -156,6 +290,20 @@ license:CC0-1.0 + + Moniteur Désassembleur + 1984 + Loriciels + + + + + + + + + + Quick Draw 198? @@ -168,10 +316,24 @@ license:CC0-1.0 + + + Reversi Champion + 1983 + Loriciels + + + + + + + + Solar Conquest 1984 - John Sands + John Sands Electronics + @@ -180,6 +342,98 @@ license:CC0-1.0 + + Pre-School Shape and Colour Quiz + 198? + Grandstand Leisure + + + + + + + + + + Skull Island + 1984 + Dotsoft + + + + + + + + + + + Subtraction Tutor + 198? + Grandstand Leisure + + + + + + + + + Supertape 1 + + 1984 + John Sands Electronics + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Télécran + 198? + Yeno + + + + + + + + Video Poker 1984 @@ -218,4 +472,16 @@ license:CC0-1.0 + + Watch Me Draw + 1984 + John Sands Electronics + + + + + + + + diff --git a/hash/zx81_cass.xml b/hash/zx81_cass.xml index 0f4d6a452c9..b2f74fecd0f 100644 --- a/hash/zx81_cass.xml +++ b/hash/zx81_cass.xml @@ -24,7 +24,7 @@ TZX files for ZX81 are just the .P dumps with an additional header on top, so th 10 Games for 1K 1981 - J.K.Greye Software + J.K. Greye Software @@ -135,7 +135,7 @@ RAND USR 16530 3D Defender 1981 - J.K.Greye Software + J.K. Greye Software @@ -196,7 +196,7 @@ RAND USR 16530 3D Monster Maze 1981 - J.K.Greye Software + J.K. Greye Software @@ -602,6 +602,7 @@ RAND USR 16530 1984 Loriciels + @@ -877,7 +878,7 @@ RAND USR 16530 Black Crystal 1982 - Carnell + Carnell Software @@ -905,9 +906,9 @@ RAND USR 16530 - Black Crystal (Clam Shell) + Black Crystal (clam shell) 1982 - Carnell + Carnell Software @@ -961,7 +962,7 @@ RAND USR 16530 Black Crystal (single sided) 1982 - Carnell + Carnell Software @@ -987,6 +988,19 @@ RAND USR 16530 + + Blitz Balle + 1984 + Sprites + + + + + + + + + Bomber 1982 @@ -1048,7 +1062,7 @@ RAND USR 16530 Breakout (JKG) 1981 - J.K.Greye Software + J.K. Greye Software @@ -1493,7 +1507,9 @@ RAND USR 16530 Le Chateau Hanté 1984 Sprites + + @@ -1800,7 +1816,7 @@ RAND USR 16530 - Comp-u-Share + Comp-U-Share 198? Micromega @@ -1810,6 +1826,26 @@ RAND USR 16530 + + Comp-U-Tax/82 + 1982 + Micromega + + + + + + + + + + + + + + + + ComputaCalc ZX 1981 @@ -2171,6 +2207,7 @@ RAND USR 16530 Dungeons of Doom 1982 Temptation Software + @@ -2266,9 +2303,9 @@ RAND USR 16530 - English Literature 1 (WHSmith) + English Literature 1 (W.H. Smith) 1982 - W.H.Smith + W.H. Smith @@ -2302,9 +2339,9 @@ RAND USR 16530 - English Literature 2 (WHSmith) + English Literature 2 (W.H. Smith) 1982 - W.H.Smith + W.H. Smith @@ -2513,7 +2550,7 @@ RAND USR 16530 - The Fast One (Green Inlay) + The Fast One (green inlay) 198? Campbell Systems @@ -2920,6 +2957,18 @@ RAND USR 16530 + + Game of Life + 1981 + Individual Software Service + + + + + + + + Game Pac @@ -3162,7 +3211,7 @@ RAND USR 16530 Games Tape 2 1981 - J.K.Greye Software + J.K. Greye Software @@ -3184,9 +3233,9 @@ RAND USR 16530 - Games Tape 2 (Typed) + Games Tape 2 (typed) 1981 - J.K.Greye Software + J.K. Greye Software @@ -3295,9 +3344,9 @@ RAND USR 16530 - Geography 1 (WHSmith) + Geography 1 (W.H. Smith) 1982 - W.H.Smith + W.H. Smith @@ -3483,7 +3532,7 @@ RAND USR 16530 - Graphics Toolkit (Colour Inlay) + Graphics Toolkit (colour inlay) 1982 JRS Software @@ -3732,9 +3781,9 @@ RAND USR 16530 - History 1 (WHSmith) + History 1 (W.H. Smith) 1982 - W.H.Smith + W.H. Smith @@ -3801,7 +3850,7 @@ RAND USR 16530 - Hopper (Truck) + Hopper (truck cover) 1981 PSS @@ -3859,6 +3908,7 @@ RAND USR 16530 Intercepteur Cobalt 1984 ERE Informatique + @@ -3983,7 +4033,7 @@ RAND USR 16530 - Invaders (Monochrome) + Invaders (monochrome) 198? Bug Byte @@ -4045,9 +4095,9 @@ RAND USR 16530 - Inventions 1 (WHSmith) + Inventions 1 (W.H. Smith) 1982 - W.H.Smith + W.H. Smith @@ -4145,6 +4195,56 @@ RAND USR 16530 + + Jogos 80 - Ano 12 - Número 19 (Julho 2018) (cover tape) + 2018 + Revista Jogos 80 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Jungle Maths 1982 @@ -4787,9 +4887,9 @@ RAND USR 16530 - Mathematics 1 (WHSmith) + Mathematics 1 (W.H. Smith) 1982 - W.H.Smith + W.H. Smith @@ -4945,7 +5045,7 @@ RAND USR 16530 - Meteor Storm (FastMaster) + Meteor Storm (fast master) 1982 dK'tronics @@ -4966,6 +5066,84 @@ RAND USR 16530 + + MicroGame: Caçadores do Tesouro + 1984 + Engesoft + + + + + + + + + + + + + + + + + + + + + + + + MicroGame: Challenger + 1984 + Engesoft + + + + + + + + + + + + + + + + + + + + + + + + MicroGame: Pinball Wizard + 1984 + Engesoft + + + + + + + + + + + + + + + + + + + + + + Mind vs. Machine 1982 @@ -5089,6 +5267,17 @@ RAND USR 16530 + + Monitor and Disassembler + 1982 + Crystal Computing + + + + + + + Moniteur Desassembleur 1982 @@ -5229,9 +5418,9 @@ RAND USR 16530 - Music 1 (WHSmith) + Music 1 (W.H. Smith) 1982 - W.H.Smith + W.H. Smith @@ -5468,13 +5657,15 @@ RAND USR 16530 + - + + - + @@ -5498,7 +5689,7 @@ RAND USR 16530 - Patrouille De L'Espace + Patrouille de l'Espace 1981 Sinclair Research @@ -5681,7 +5872,7 @@ RAND USR 16530 - Pilot (New) + Pilot (newer) 1982 Hewson Consultants @@ -6003,6 +6194,7 @@ RAND USR 16530 Q Save 198? PSS + @@ -6016,9 +6208,10 @@ RAND USR 16530 - Q Save (Inter) + Q Save (Intercomputer) 1982 Intercomputer Inc + @@ -6034,9 +6227,10 @@ RAND USR 16530 - Q Save (Red) + Q Save (red cover) 198? PSS + @@ -6107,7 +6301,7 @@ RAND USR 16530 - QS Scramble (Alt) + QS Scramble (alt) 1982 Quicksilva @@ -6316,7 +6510,7 @@ RAND USR 16530 - Rubik Cube (Alt) + Rubik Cube (alt) 1982 CDS Micro Systems @@ -6327,7 +6521,7 @@ RAND USR 16530 - Rubik Cube (Brown Inlay) + Rubik Cube (brown inlay) 1982 CDS Micro Systems @@ -6385,6 +6579,27 @@ RAND USR 16530 + + Scorpirus + 1984 + ERE Informatique + + + + + + + + + + + + + + + + + Scram 81 1983 @@ -6413,7 +6628,7 @@ RAND USR 16530 - Scramble (Colour Inlay) + Scramble (colour inlay) 198? Mikro-Gen @@ -6459,7 +6674,7 @@ RAND USR 16530 - Sea Wolf (Newer) + Sea Wolf (newer) 1983 Stephen Hartley Computing @@ -6687,9 +6902,9 @@ RAND USR 16530 - Spelling 1 (WHSmith) + Spelling 1 (W.H. Smith) 1982 - W.H.Smith + W.H. Smith @@ -7903,6 +8118,7 @@ RAND USR 16530 Traffic 1984 Loriciels + @@ -8128,7 +8344,7 @@ RAND USR 16530 Volcanic Dungeon 1982 - Carnell + Carnell Software @@ -8492,7 +8708,7 @@ RAND USR 16530 - Zuckman (Black Inlay) + Zuckman (black inlay) 1982 DJL Software @@ -8834,7 +9050,7 @@ RAND USR 16530 - ZX Chess II (Improved) + ZX Chess II (improved) 1981 Artic @@ -8858,7 +9074,7 @@ RAND USR 16530 ZX Compendium 1983 - Carnell + Carnell Software @@ -9027,6 +9243,19 @@ RAND USR 16530 + + Aerial + 2022 + Inufuto + + + + + + + + + Ant Attack 2013 @@ -9040,6 +9269,32 @@ RAND USR 16530 + + AntiAir + 2024 + Inufuto + + + + + + + + + + + Ascend + 2022 + Inufuto + + + + + + + + + Avalanche 2011 @@ -9054,6 +9309,32 @@ RAND USR 16530 + + Battlot + 2022 + Inufuto + + + + + + + + + + + Bootskell + 2022 + Inufuto + + + + + + + + + Boulder Logic 2011 @@ -9081,6 +9362,32 @@ RAND USR 16530 + + Cacorm + 2022 + Inufuto + + + + + + + + + + + Cracky + 2023 + Inufuto + + + + + + + + + Crozxy Road 2015 @@ -9121,6 +9428,32 @@ RAND USR 16530 + + Guntus + 2022 + Inufuto + + + + + + + + + + + Hopman + 2023 + Inufuto + + + + + + + + + Impact 2012 @@ -9134,6 +9467,19 @@ RAND USR 16530 + + Lift + 2022 + Inufuto + + + + + + + + + Mayhem 2011 @@ -9148,6 +9494,19 @@ RAND USR 16530 + + Mazy + 2022 + Inufuto + + + + + + + + + Miner Man 2011 @@ -9161,6 +9520,19 @@ RAND USR 16530 + + Neuras + 2022 + Inufuto + + + + + + + + + Noir Shapes 2012 @@ -9187,6 +9559,19 @@ RAND USR 16530 + + Osotos + 2024 + Inufuto + + + + + + + + + Pandemic 2014 @@ -9226,6 +9611,19 @@ RAND USR 16530 + + Ruptus + 2022 + Inufuto + + + + + + + + + Shrooms 2021 @@ -9307,6 +9705,19 @@ RAND USR 16530 + + Yewdow + 2023 + Inufuto + + + + + + + + + ZXagon 2014 diff --git a/makefile b/makefile index 52771fcbb19..44a3b595367 100644 --- a/makefile +++ b/makefile @@ -1165,28 +1165,28 @@ windows_x86_clang: generate $(PROJECTDIR)/$(MAKETYPE)-mingw-clang/Makefile $(SILENT) $(MAKE) $(MAKEPARAMS) -C $(PROJECTDIR)/$(MAKETYPE)-mingw-clang config=$(CONFIG)32 WINDRES=$(WINDRES) #------------------------------------------------- -# Visual Studio 2019 +# Visual Studio 2022 #------------------------------------------------- -.PHONY: vs2019 -vs2019: generate - $(SILENT) $(GENIE) $(PARAMS) $(TARGET_PARAMS) vs2019 +.PHONY: vs2022 +vs2022: generate + $(SILENT) $(GENIE) $(PARAMS) $(TARGET_PARAMS) vs2022 ifdef MSBUILD - $(SILENT) msbuild.exe $(PROJECTDIR_WIN)/vs2019/$(PROJECT_NAME).sln $(MSBUILD_PARAMS) + $(SILENT) msbuild.exe $(PROJECTDIR_WIN)/vs2022/$(PROJECT_NAME).sln $(MSBUILD_PARAMS) endif -.PHONY: vs2019_clang -vs2019_clang: generate - $(SILENT) $(GENIE) $(PARAMS) $(TARGET_PARAMS) --vs=clangcl vs2019 +.PHONY: vs2022_clang +vs2022_clang: generate + $(SILENT) $(GENIE) $(PARAMS) $(TARGET_PARAMS) --vs=clangcl vs2022 ifdef MSBUILD - $(SILENT) msbuild.exe $(PROJECTDIR_WIN)/vs2019-clang/$(PROJECT_NAME).sln $(MSBUILD_PARAMS) + $(SILENT) msbuild.exe $(PROJECTDIR_WIN)/vs2022-clang/$(PROJECT_NAME).sln $(MSBUILD_PARAMS) endif -.PHONY: vs2019_intel -vs2019_intel: generate - $(SILENT) $(GENIE) $(PARAMS) $(TARGET_PARAMS) --vs=intel-15 vs2019 +.PHONY: vs2022_intel +vs2022_intel: generate + $(SILENT) $(GENIE) $(PARAMS) $(TARGET_PARAMS) --vs=intel-15 vs2022 ifdef MSBUILD - $(SILENT) msbuild.exe $(PROJECTDIR_WIN)/vs2019-intel/$(PROJECT_NAME).sln $(MSBUILD_PARAMS) + $(SILENT) msbuild.exe $(PROJECTDIR_WIN)/vs2022-intel/$(PROJECT_NAME).sln $(MSBUILD_PARAMS) endif #------------------------------------------------- @@ -1578,7 +1578,7 @@ endif ifeq (posix,$(SHELLTYPE)) $(GENDIR)/version.cpp: makefile $(GENDIR)/git_desc | $(GEN_FOLDERS) - @echo '#define BARE_BUILD_VERSION "0.272.0"' > $@ + @echo '#define BARE_BUILD_VERSION "0.272.x"' > $@ @echo '#define BARE_VCS_REVISION "$(NEW_GIT_VERSION)"' >> $@ @echo 'extern const char bare_build_version[];' >> $@ @echo 'extern const char bare_vcs_revision[];' >> $@ @@ -1588,7 +1588,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.272.0" > $@ + @echo #define BARE_BUILD_VERSION "0.272.x" > $@ @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 new file mode 100755 index 00000000000..f294cc6412f --- /dev/null +++ b/scripts/build/check_include_guards.py @@ -0,0 +1,47 @@ +#!/usr/bin/python3 +## +## icense:BSD-3-Clause +## copyright-holders:Vas Crabb + +import io +import os +import os.path +import re +import sys + + +def pathsplit(p): + result = [ ] + while p: + d, n = os.path.split(p) + if not n: + result.insert(0, d) + break + else: + result.insert(0, n) + p = d + return result + + +if __name__ == '__main__': + extpat = re.compile('.+\\.(h|hpp)$') + substpat = re.compile('[-.]') + guardpat = re.compile('^ *# *ifndef +([^\s]+)(\s+.*)?') + bad = False + 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))]) + '_' + for f in files: + if extpat.match(f): + expected = prefix + substpat.sub('_', f.upper()) + fp = os.path.join(path, f) + with io.open(fp, 'r', encoding='utf-8') as fd: + for l in fd: + m = guardpat.match(l) + if m: + if m.group(1) != expected: + sys.stderr.write('%s: #include guard does not appear to match expected %s\n' % (fp, expected)) + bad = True + break + if bad: + sys.exit(1) diff --git a/scripts/genie.lua b/scripts/genie.lua index deeca09b50d..a4588c20503 100644 --- a/scripts/genie.lua +++ b/scripts/genie.lua @@ -1040,12 +1040,12 @@ end end buildoptions { "-fdiagnostics-show-note-include-stack", + "-Wno-error=tautological-compare", "-Wno-cast-align", "-Wno-constant-logical-operand", "-Wno-extern-c-compat", "-Wno-ignored-qualifiers", "-Wno-pragma-pack", -- clang 6.0 complains when the packing change lifetime is not contained within a header file. - "-Wno-tautological-compare", "-Wno-unknown-attributes", "-Wno-unknown-warning-option", "-Wno-unused-value", @@ -1292,6 +1292,9 @@ configuration { "vs20*" } } buildoptions { + "/Zc:preprocessor", + "/utf-8", + "/permissive-", "/w45038", -- warning C5038: data member 'member1' will be initialized after data member 'member2' } diff --git a/scripts/src/3rdparty.lua b/scripts/src/3rdparty.lua index 23cb4b4e9ba..8516049c663 100755 --- a/scripts/src/3rdparty.lua +++ b/scripts/src/3rdparty.lua @@ -29,7 +29,7 @@ project "expat" "PACKAGE=\"expat\"", "PACKAGE_BUGREPORT=\"expat-bugs@libexpat.org\"", "PACKAGE_NAME=\"expat\"", - "PACKAGE_STRING=\"expat 2.2.10\"", + "PACKAGE_STRING=\"expat-2.2.10\"", "PACKAGE_TARNAME=\"expat\"", "PACKAGE_URL=\"\"", "PACKAGE_VERSION=\"2.2.10\"", diff --git a/scripts/src/bus.lua b/scripts/src/bus.lua index bfbaffc229e..d7fdfe15364 100644 --- a/scripts/src/bus.lua +++ b/scripts/src/bus.lua @@ -4688,6 +4688,8 @@ if (BUSES["ZORRO"]~=null) then MAME_DIR .. "src/devices/bus/amiga/zorro/action_replay.h", MAME_DIR .. "src/devices/bus/amiga/zorro/buddha.cpp", MAME_DIR .. "src/devices/bus/amiga/zorro/buddha.h", + MAME_DIR .. "src/devices/bus/amiga/zorro/ripple.cpp", + MAME_DIR .. "src/devices/bus/amiga/zorro/ripple.h", } end @@ -5765,9 +5767,23 @@ if (BUSES["H89BUS"]~=null) then MAME_DIR .. "src/devices/bus/heathzenith/h89/mms77316_fdc.h", MAME_DIR .. "src/devices/bus/heathzenith/h89/sigmasoft_sound.cpp", MAME_DIR .. "src/devices/bus/heathzenith/h89/sigmasoft_sound.h", + MAME_DIR .. "src/devices/bus/heathzenith/h89/sigmasoft_parallel_port.cpp", + MAME_DIR .. "src/devices/bus/heathzenith/h89/sigmasoft_parallel_port.h", MAME_DIR .. "src/devices/bus/heathzenith/h89/we_pullup.cpp", MAME_DIR .. "src/devices/bus/heathzenith/h89/we_pullup.h", MAME_DIR .. "src/devices/bus/heathzenith/h89/z37_fdc.cpp", MAME_DIR .. "src/devices/bus/heathzenith/h89/z37_fdc.h", } end + +--------------------------------------------------- +-- +--@src/devices/bus/heathzenith/h19/tlb.h,BUSES["HEATH_TLB_CONNECTOR"] = true +--------------------------------------------------- + +if (BUSES["HEATH_TLB_CONNECTOR"]~=null) then + files { + MAME_DIR .. "src/devices/bus/heathzenith/h19/tlb.cpp", + MAME_DIR .. "src/devices/bus/heathzenith/h19/tlb.h", + } +end diff --git a/scripts/src/cpu.lua b/scripts/src/cpu.lua index 1b8f0f97b0d..302d4ff83f5 100644 --- a/scripts/src/cpu.lua +++ b/scripts/src/cpu.lua @@ -2575,7 +2575,6 @@ if CPUS["S2650"] then files { MAME_DIR .. "src/devices/cpu/s2650/s2650.cpp", MAME_DIR .. "src/devices/cpu/s2650/s2650.h", - MAME_DIR .. "src/devices/cpu/s2650/s2650cpu.h", } end @@ -4136,6 +4135,23 @@ if opt_tool(CPUS, "HT1130") then table.insert(disasm_files , MAME_DIR .. "src/devices/cpu/ht1130/ht1130d.h") end +-------------------------------------------------- +-- UPD777 +--@src/devices/cpu/upd777/upd777.h,CPUS["UPD777"] = true +-------------------------------------------------- + +if CPUS["UPD777"] then + files { + MAME_DIR .. "src/devices/cpu/upd777/upd777.cpp", + MAME_DIR .. "src/devices/cpu/upd777/upd777.h", + } +end + +if opt_tool(CPUS, "UPD777") then + table.insert(disasm_files , MAME_DIR .. "src/devices/cpu/upd777/upd777dasm.cpp") + table.insert(disasm_files , MAME_DIR .. "src/devices/cpu/upd777/upd777dasm.h") +end + -------------------------------------------------- -- Epson C33 STD, C33 ADV, etc. --@src/devices/cpu/c33/c33common.h,CPUS["C33"] = true diff --git a/scripts/target/mame/tiny.lua b/scripts/target/mame/tiny.lua index 3b6b722b6b2..402027691c1 100644 --- a/scripts/target/mame/tiny.lua +++ b/scripts/target/mame/tiny.lua @@ -154,6 +154,8 @@ files{ MAME_DIR .. "src/mame/shared/s11c_bg.h", MAME_DIR .. "src/mame/shared/williamssound.cpp", MAME_DIR .. "src/mame/shared/williamssound.h", + MAME_DIR .. "src/mame/midway/williamsblitter.cpp", + MAME_DIR .. "src/mame/midway/williamsblitter.h", MAME_DIR .. "src/mame/midway/williams.cpp", MAME_DIR .. "src/mame/midway/williams.h", MAME_DIR .. "src/mame/midway/williams_m.cpp", diff --git a/scripts/toolchain.lua b/scripts/toolchain.lua index 966d55d1dbb..3181d25d67c 100644 --- a/scripts/toolchain.lua +++ b/scripts/toolchain.lua @@ -211,7 +211,7 @@ function toolchain(_buildDir, _subDir) premake.gcc.ar = toolchainPrefix .. "ar" location (_buildDir .. "projects/" .. _subDir .. "/".. _ACTION .. "-osx-clang") end - elseif _ACTION == "vs2019" then + elseif _ACTION == "vs2022" then if "clangcl" == _OPTIONS["vs"] then premake.vstudio.toolset = ("ClangCL") diff --git a/src/devices/bus/a2gameio/joyport.cpp b/src/devices/bus/a2gameio/joyport.cpp index 3e6e9793dae..7ff0e7a9adc 100644 --- a/src/devices/bus/a2gameio/joyport.cpp +++ b/src/devices/bus/a2gameio/joyport.cpp @@ -127,4 +127,4 @@ void apple2_joyport_device::an1_w(int state) //************************************************************************** // device type definition -DEFINE_DEVICE_TYPE_PRIVATE(APPLE2_JOYPORT, device_a2gameio_interface, apple2_joyport_device, "a2joyprt", "Sirius JoyPort") +DEFINE_DEVICE_TYPE_PRIVATE(APPLE2_JOYPORT, device_a2gameio_interface, apple2_joyport_device, "a2joyprt", "Sirius JoyPort with Atari joysticks") diff --git a/src/devices/bus/amiga/zorro/cards.cpp b/src/devices/bus/amiga/zorro/cards.cpp index 27b5e6afd6b..83f30491bc7 100644 --- a/src/devices/bus/amiga/zorro/cards.cpp +++ b/src/devices/bus/amiga/zorro/cards.cpp @@ -16,6 +16,7 @@ #include "a590.h" #include "action_replay.h" #include "buddha.h" +#include "ripple.h" void a1000_expansion_cards(device_slot_interface &device) @@ -45,6 +46,7 @@ void zorro2_cards(device_slot_interface &device) device.option_add("a2091", ZORRO_A2091); device.option_add("a2232", ZORRO_A2232); device.option_add("buddha", ZORRO_BUDDHA); + device.option_add("ripple", ZORRO_RIPPLE); } void zorro3_cards(device_slot_interface &device) @@ -55,4 +57,5 @@ void zorro3_cards(device_slot_interface &device) device.option_add("a2091", ZORRO_A2091); device.option_add("a2232", ZORRO_A2232); device.option_add("buddha", ZORRO_BUDDHA); + device.option_add("ripple", ZORRO_RIPPLE); } diff --git a/src/devices/bus/amiga/zorro/ripple.cpp b/src/devices/bus/amiga/zorro/ripple.cpp new file mode 100644 index 00000000000..39ca1c350da --- /dev/null +++ b/src/devices/bus/amiga/zorro/ripple.cpp @@ -0,0 +1,233 @@ +// license: GPL-2.0+ +// copyright-holders: Dirk Best +/*************************************************************************** + + RIPPLE IDE + + Zorro-II IDE interface for Amiga 2000/3000/4000 + + Notes: + - See https://github.com/LIV2/RIPPLE-IDE + - To enable boot from CD-ROM you need CDFileSystem from OS 3.2.1 or + later, then you can issue the command "LoadModule L:CDFileSystem" + - If you have the correct version of CDFileSystem you can also flash + it to the controller with "lideflash -C L:CDFileSystem" + + TODO: + - Verify cs1 access + +***************************************************************************/ + +#include "emu.h" +#include "ripple.h" + +#define VERBOSE 1 +#include "logmacro.h" + + +//************************************************************************** +// TYPE DEFINITIONS +//************************************************************************** + +DEFINE_DEVICE_TYPE(ZORRO_RIPPLE, bus::amiga::zorro::ripple_ide_device, "zorro_ripple", "RIPPLE IDE Interface") + +namespace bus::amiga::zorro { + +ripple_ide_device::ripple_ide_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : + device_t(mconfig, ZORRO_RIPPLE, tag, owner, clock), + device_zorro2_card_interface(mconfig, *this), + m_ata_0(*this, "ata_0"), + m_ata_1(*this, "ata_1"), + m_flash(*this, "flash") +{ +} + + +//************************************************************************** +// ADDRESS MAPS +//************************************************************************** + +void ripple_ide_device::mmio_map(address_map &map) +{ + map(0x01000, 0x01fff).rw(FUNC(ripple_ide_device::ide0_cs0_r), FUNC(ripple_ide_device::ide0_cs0_w)); + map(0x02000, 0x02fff).rw(FUNC(ripple_ide_device::ide1_cs0_r), FUNC(ripple_ide_device::ide1_cs0_w)); + map(0x05000, 0x05fff).rw(FUNC(ripple_ide_device::ide0_cs1_r), FUNC(ripple_ide_device::ide0_cs1_w)); + map(0x06000, 0x06fff).rw(FUNC(ripple_ide_device::ide1_cs1_r), FUNC(ripple_ide_device::ide1_cs1_w)); + map(0x08000, 0x08fff).w(FUNC(ripple_ide_device::bank_select_w)); + map(0x10000, 0x1ffff).rw(FUNC(ripple_ide_device::banked_flash_r), FUNC(ripple_ide_device::banked_flash_w)).umask16(0xff00); +} + + +//************************************************************************** +// MACHINE DEFINITIONS +//************************************************************************** + +void ripple_ide_device::device_add_mconfig(machine_config &config) +{ + ATA_INTERFACE(config, m_ata_0).options(ata_devices, nullptr, nullptr, false); + ATA_INTERFACE(config, m_ata_1).options(ata_devices, nullptr, nullptr, false); + + SST_39SF010(config, "flash"); +} + + +//************************************************************************** +// ROM DEFINITIONS +//************************************************************************** + +ROM_START( lide ) + ROM_REGION(0x20000, "flash", ROMREGION_ERASEFF) + ROM_DEFAULT_BIOS("40.8") + ROM_SYSTEM_BIOS(0, "40.8", "Release 40.8") + ROMX_LOAD("lide_40-8.rom", 0x0000, 0x8000, CRC(3f021472) SHA1(83762ef5a883e5c43ad321eaa03fde7454f70785), ROM_BIOS(0)) +ROM_END + +const tiny_rom_entry *ripple_ide_device::device_rom_region() const +{ + return ROM_NAME( lide ); +} + + +//************************************************************************** +// MACHINE EMULATION +//************************************************************************** + +void ripple_ide_device::device_start() +{ + // register for save states + save_item(NAME(m_base_address)); + save_item(NAME(m_flash_bank)); +} + +void ripple_ide_device::device_reset() +{ + m_flash_bank = 0; +} + +void ripple_ide_device::bank_select_w(offs_t offset, uint16_t data, uint16_t mem_mask) +{ + if (ACCESSING_BITS_8_15) + m_flash_bank = data >> 14; +} + +uint8_t ripple_ide_device::banked_flash_r(offs_t offset) +{ + return m_flash->read(m_flash_bank << 15 | offset); +} + +void ripple_ide_device::banked_flash_w(offs_t offset, uint8_t data) +{ + m_flash->write(m_flash_bank << 15 | offset, data); +} + +uint16_t ripple_ide_device::ide0_cs0_r(offs_t offset, uint16_t mem_mask) +{ + return m_ata_0->cs0_swap_r(offset >> 8, mem_mask); +} + +void ripple_ide_device::ide0_cs0_w(offs_t offset, uint16_t data, uint16_t mem_mask) +{ + m_ata_0->cs0_swap_w(offset >> 8, data, mem_mask); +} + +uint16_t ripple_ide_device::ide0_cs1_r(offs_t offset, uint16_t mem_mask) +{ + return m_ata_0->cs1_swap_r(offset >> 8, mem_mask); +} + +void ripple_ide_device::ide0_cs1_w(offs_t offset, uint16_t data, uint16_t mem_mask) +{ + m_ata_0->cs1_swap_w(offset >> 8, data, mem_mask); +} + +uint16_t ripple_ide_device::ide1_cs0_r(offs_t offset, uint16_t mem_mask) +{ + return m_ata_1->cs0_swap_r(offset >> 8, mem_mask); +} + +void ripple_ide_device::ide1_cs0_w(offs_t offset, uint16_t data, uint16_t mem_mask) +{ + m_ata_1->cs0_swap_w(offset >> 8, data, mem_mask); +} + +uint16_t ripple_ide_device::ide1_cs1_r(offs_t offset, uint16_t mem_mask) +{ + return m_ata_1->cs1_swap_r(offset >> 8, mem_mask); +} + +void ripple_ide_device::ide1_cs1_w(offs_t offset, uint16_t data, uint16_t mem_mask) +{ + m_ata_1->cs1_swap_w(offset >> 8, data, mem_mask); +} + + +//************************************************************************** +// AUTOCONFIG +//************************************************************************** + +void ripple_ide_device::autoconfig_base_address(offs_t address) +{ + LOG("autoconfig_base_address received: 0x%06x\n", address); + LOG("-> installing ripple ide\n"); + + // save base address so that the tap can reconfigure our space + m_base_address = address; + + // stop responding to default autoconfig + m_slot->space().unmap_readwrite(0xe80000, 0xe8007f); + + // flash occupies our space until the ide registers are switched in + m_slot->space().install_readwrite_handler(address, address + 0x1ffff, + emu::rw_delegate(m_flash, FUNC(intelfsh8_device::read)), + emu::rw_delegate(m_flash, FUNC(intelfsh8_device::write)), 0xff00); + + // install write tap to handle switching in ide registers + m_write_tap.remove(); + m_write_tap = m_slot->space().install_write_tap( + address, address + 0x1ffff, + "rom_disable_w", + [this] (offs_t offset, uint16_t &data, uint16_t mem_mask) + { + m_write_tap.remove(); + + // ripple registers are now available + m_slot->space().install_device(m_base_address, m_base_address + 0x1ffff, *this, &ripple_ide_device::mmio_map); + + // we need to repeat the write here as this tap won't hit it yet + // the initial write will instead hit the flash, but it's harmless + m_slot->space().write_word(offset, data, mem_mask); + }, + &m_write_tap + ); + + // we're done + m_slot->cfgout_w(0); +} + +void ripple_ide_device::cfgin_w(int state) +{ + LOG("configin_w (%d)\n", state); + + if (state == 0) + { + // setup autoconfig + autoconfig_board_type(BOARD_TYPE_ZORRO2); + autoconfig_board_size(BOARD_SIZE_128K); + autoconfig_link_into_memory(false); + autoconfig_rom_vector_valid(true); + autoconfig_multi_device(false); + autoconfig_8meg_preferred(false); + autoconfig_can_shutup(true); + autoconfig_product(7); + autoconfig_manufacturer(5194); + autoconfig_serial(0x00000000); + autoconfig_rom_vector(0x0008); + + // install autoconfig handler + m_slot->space().install_readwrite_handler(0xe80000, 0xe8007f, + read16_delegate(*this, FUNC(amiga_autoconfig::autoconfig_read)), + write16_delegate(*this, FUNC(amiga_autoconfig::autoconfig_write)), 0xffff); + } +} + +} // namespace bus::amiga::zorro diff --git a/src/devices/bus/amiga/zorro/ripple.h b/src/devices/bus/amiga/zorro/ripple.h new file mode 100644 index 00000000000..d967f4c1584 --- /dev/null +++ b/src/devices/bus/amiga/zorro/ripple.h @@ -0,0 +1,73 @@ +// license: GPL-2.0+ +// copyright-holders: Dirk Best +/*************************************************************************** + + RIPPLE IDE + + Zorro-II IDE interface for Amiga 2000/3000/4000 + +***************************************************************************/ + +#ifndef MAME_BUS_AMIGA_ZORRO_RIPPLE_H +#define MAME_BUS_AMIGA_ZORRO_RIPPLE_H + +#pragma once + +#include "zorro.h" +#include "machine/autoconfig.h" +#include "machine/intelfsh.h" +#include "bus/ata/ataintf.h" + +namespace bus::amiga::zorro { + +class ripple_ide_device : public device_t, public device_zorro2_card_interface, public amiga_autoconfig +{ +public: + ripple_ide_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; + + virtual void device_start() override ATTR_COLD; + virtual void device_reset() override ATTR_COLD; + + // device_zorro2_card_interface overrides + virtual void cfgin_w(int state) override; + + // amiga_autoconfig overrides + virtual void autoconfig_base_address(offs_t address) override; + +private: + void mmio_map(address_map &map) ATTR_COLD; + + // flash + void bank_select_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); + uint8_t banked_flash_r(offs_t offset); + void banked_flash_w(offs_t offset, uint8_t data); + + // ide register + uint16_t ide0_cs0_r(offs_t offset, uint16_t mem_mask = ~0); + void ide0_cs0_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); + uint16_t ide0_cs1_r(offs_t offset, uint16_t mem_mask = ~0); + void ide0_cs1_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); + uint16_t ide1_cs0_r(offs_t offset, uint16_t mem_mask = ~0); + void ide1_cs0_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); + uint16_t ide1_cs1_r(offs_t offset, uint16_t mem_mask = ~0); + void ide1_cs1_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); + + required_device m_ata_0; + required_device m_ata_1; + required_device m_flash; + memory_passthrough_handler m_write_tap; + + offs_t m_base_address = 0; + uint8_t m_flash_bank = 0; +}; + +} // namespace bus::amiga::zorro + +// device type declaration +DECLARE_DEVICE_TYPE_NS(ZORRO_RIPPLE, bus::amiga::zorro, ripple_ide_device) + +#endif // MAME_BUS_AMIGA_ZORRO_RIPPLE_H diff --git a/src/devices/bus/ata/atapihle.cpp b/src/devices/bus/ata/atapihle.cpp index 0161084fe1d..ab8cf22d775 100644 --- a/src/devices/bus/ata/atapihle.cpp +++ b/src/devices/bus/ata/atapihle.cpp @@ -106,7 +106,8 @@ void atapi_hle_device::fill_buffer() case IDE_COMMAND_PACKET: if (m_buffer_size >= m_data_size) { - m_buffer_size = m_data_size; + // MSCDEX/SHSUCDX PC drivers wants the clamp for CD audio playback (29 bytes). + m_buffer_size = m_data_size & 0xfffe; } else { diff --git a/src/devices/bus/bbc/tube/tube_cms6809.h b/src/devices/bus/bbc/tube/tube_cms6809.h index 6e2f4e49e9f..2066de5d339 100644 --- a/src/devices/bus/bbc/tube/tube_cms6809.h +++ b/src/devices/bus/bbc/tube/tube_cms6809.h @@ -6,9 +6,10 @@ **********************************************************************/ +#ifndef MAME_BUS_BBC_TUBE_TUBE_CMS6809_H +#define MAME_BUS_BBC_TUBE_TUBE_CMS6809_H -#ifndef MAME_BUS_BBC_TUBE_CMS6809_H -#define MAME_BUS_BBC_TUBE_CMS6809_H +#pragma once #include "tube.h" #include "cpu/m6809/m6809.h" @@ -50,5 +51,4 @@ class bbc_tube_cms6809_device : // device type definition DECLARE_DEVICE_TYPE(BBC_TUBE_CMS6809, bbc_tube_cms6809_device) - -#endif /* MAME_BUS_BBC_TUBE_CMS6809_H */ +#endif // MAME_BUS_BBC_TUBE_TUBE_CMS6809_H diff --git a/src/devices/bus/bbc/tube/tube_matchbox.h b/src/devices/bus/bbc/tube/tube_matchbox.h index 5feb9c700c6..250f4bf4b48 100644 --- a/src/devices/bus/bbc/tube/tube_matchbox.h +++ b/src/devices/bus/bbc/tube/tube_matchbox.h @@ -1,11 +1,13 @@ // license:BSD-3-Clause // copyright-holders:Nigel Barnes -#ifndef MAME_BUS_BBC_TUBE_MATCHBOX_H -#define MAME_BUS_BBC_TUBE_MATCHBOX_H +#ifndef MAME_BUS_BBC_TUBE_TUBE_MATCHBOX_H +#define MAME_BUS_BBC_TUBE_TUBE_MATCHBOX_H + +#pragma once #include "tube.h" DECLARE_DEVICE_TYPE(BBC_TUBE_MATCHBOX, device_bbc_tube_interface) -#endif // MAME_BUS_BBC_TUBE_MATCHBOX_H +#endif // MAME_BUS_BBC_TUBE_TUBE_MATCHBOX_H diff --git a/src/devices/bus/bbc/tube/tube_rc6502.h b/src/devices/bus/bbc/tube/tube_rc6502.h index 20ad64dcb1a..016c1b3bd85 100644 --- a/src/devices/bus/bbc/tube/tube_rc6502.h +++ b/src/devices/bus/bbc/tube/tube_rc6502.h @@ -8,9 +8,10 @@ **********************************************************************/ +#ifndef MAME_BUS_BBC_TUBE_TUBE_RC6502_H +#define MAME_BUS_BBC_TUBE_TUBE_RC6502_H -#ifndef MAME_BUS_BBC_TUBE_RC6502_H -#define MAME_BUS_BBC_TUBE_RC6502_H +#pragma once #include "tube.h" #include "cpu/m6502/w65c02s.h" @@ -94,5 +95,4 @@ class bbc_tube_rc65816_device : public bbc_tube_rc6502_device DECLARE_DEVICE_TYPE(BBC_TUBE_RC6502, bbc_tube_rc6502_device) DECLARE_DEVICE_TYPE(BBC_TUBE_RC65816, bbc_tube_rc65816_device) - -#endif /* MAME_BUS_BBC_TUBE_RC6502_H */ +#endif // MAME_BUS_BBC_TUBE_TUBE_RC6502_H diff --git a/src/devices/bus/bbc/tube/tube_x25.h b/src/devices/bus/bbc/tube/tube_x25.h index ad3bf3e8015..f0ac884d96b 100644 --- a/src/devices/bus/bbc/tube/tube_x25.h +++ b/src/devices/bus/bbc/tube/tube_x25.h @@ -8,9 +8,10 @@ **********************************************************************/ +#ifndef MAME_BUS_BBC_TUBE_TUBE_X25_H +#define MAME_BUS_BBC_TUBE_TUBE_X25_H -#ifndef MAME_BUS_BBC_TUBE_X25_H -#define MAME_BUS_BBC_TUBE_X25_H +#pragma once #include "tube.h" #include "cpu/z80/z80.h" @@ -63,5 +64,4 @@ class bbc_tube_x25_device : // device type definition DECLARE_DEVICE_TYPE(BBC_TUBE_X25, bbc_tube_x25_device) - -#endif /* MAME_BUS_BBC_TUBE_X25_H */ +#endif // MAME_BUS_BBC_TUBE_TUBE_X25_H diff --git a/src/devices/bus/bbc/tube/tube_z80.h b/src/devices/bus/bbc/tube/tube_z80.h index bb19c59263f..981f1f8ac6b 100644 --- a/src/devices/bus/bbc/tube/tube_z80.h +++ b/src/devices/bus/bbc/tube/tube_z80.h @@ -8,9 +8,10 @@ **********************************************************************/ +#ifndef MAME_BUS_BBC_TUBE_TUBE_Z80_H +#define MAME_BUS_BBC_TUBE_TUBE_Z80_H -#ifndef MAME_BUS_BBC_TUBE_Z80_H -#define MAME_BUS_BBC_TUBE_Z80_H +#pragma once #include "tube.h" #include "cpu/z80/z80.h" @@ -82,5 +83,4 @@ class bbc_tube_z80w_device : public bbc_tube_z80_device DECLARE_DEVICE_TYPE(BBC_TUBE_Z80, bbc_tube_z80_device) DECLARE_DEVICE_TYPE(BBC_TUBE_Z80W, bbc_tube_z80w_device) - -#endif /* MAME_BUS_BBC_TUBE_Z80_H */ +#endif // MAME_BUS_BBC_TUBE_TUBE_Z80_H diff --git a/src/devices/bus/bbc/tube/tube_zep100.h b/src/devices/bus/bbc/tube/tube_zep100.h index d135116b07b..e426e51c0db 100644 --- a/src/devices/bus/bbc/tube/tube_zep100.h +++ b/src/devices/bus/bbc/tube/tube_zep100.h @@ -8,9 +8,10 @@ **********************************************************************/ +#ifndef MAME_BUS_BBC_TUBE_TUBE_ZEP100_H +#define MAME_BUS_BBC_TUBE_TUBE_ZEP100_H -#ifndef MAME_BUS_BBC_TUBE_ZEP100_H -#define MAME_BUS_BBC_TUBE_ZEP100_H +#pragma once #include "tube.h" #include "cpu/z80/z80.h" @@ -104,5 +105,4 @@ DECLARE_DEVICE_TYPE(BBC_TUBE_ZEP100L, bbc_tube_zep100l_device) DECLARE_DEVICE_TYPE(BBC_TUBE_ZEP100W, bbc_tube_zep100w_device) DECLARE_DEVICE_TYPE(BBC_TUBE_ZEP100M, bbc_tube_zep100m_device) - -#endif /* MAME_BUS_BBC_TUBE_ZEP100_H */ +#endif // MAME_BUS_BBC_TUBE_TUBE_ZEP100_H diff --git a/src/devices/bus/bml3/kanji.h b/src/devices/bus/bml3/kanji.h index 3afdf75350d..3d559010a76 100644 --- a/src/devices/bus/bml3/kanji.h +++ b/src/devices/bus/bml3/kanji.h @@ -2,14 +2,14 @@ // copyright-holders:Jonathan Edwards /********************************************************************* - bml3kanji.h + kanji.h Hitachi MP-9740 (?) kanji character ROM for the MB-689x *********************************************************************/ -#ifndef MAME_BUS_BML3_BML3KANJI_H -#define MAME_BUS_BML3_BML3KANJI_H +#ifndef MAME_BUS_BML3_KANJI_H +#define MAME_BUS_BML3_KANJI_H #pragma once @@ -48,4 +48,4 @@ class bml3bus_kanji_device: // device type definition DECLARE_DEVICE_TYPE(BML3BUS_KANJI, bml3bus_kanji_device) -#endif // MAME_BUS_BML3_BML3KANJI_H +#endif // MAME_BUS_BML3_KANJI_H diff --git a/src/devices/bus/bml3/mp1802.h b/src/devices/bus/bml3/mp1802.h index 7b9701d56f7..908442a6bd7 100644 --- a/src/devices/bus/bml3/mp1802.h +++ b/src/devices/bus/bml3/mp1802.h @@ -2,15 +2,15 @@ // copyright-holders:Jonathan Edwards /********************************************************************* - bml3mp1802.h + mp1802.h Hitachi MP-1802 floppy disk controller card for the MB-6890 Hitachi MP-3550 floppy drive is attached *********************************************************************/ -#ifndef MAME_BUS_BML3_BML3MP1802_H -#define MAME_BUS_BML3_BML3MP1802_H +#ifndef MAME_BUS_BML3_MP1802_H +#define MAME_BUS_BML3_MP1802_H #pragma once @@ -59,4 +59,4 @@ class bml3bus_mp1802_device: // device type definition DECLARE_DEVICE_TYPE(BML3BUS_MP1802, bml3bus_mp1802_device) -#endif // MAME_BUS_BML3_BML3MP1802_H +#endif // MAME_BUS_BML3_MP1802_H diff --git a/src/devices/bus/bml3/mp1805.h b/src/devices/bus/bml3/mp1805.h index 63eae04b81a..c4f089eed83 100644 --- a/src/devices/bus/bml3/mp1805.h +++ b/src/devices/bus/bml3/mp1805.h @@ -2,15 +2,15 @@ // copyright-holders:Jonathan Edwards /********************************************************************* - bml3mp1805.h + mp1805.h Hitachi MP-1805 floppy disk controller card for the MB-6890 Floppy drive is attached *********************************************************************/ -#ifndef MAME_BUS_BML3_BML3MP1805_H -#define MAME_BUS_BML3_BML3MP1805_H +#ifndef MAME_BUS_BML3_MP1805_H +#define MAME_BUS_BML3_MP1805_H #pragma once @@ -58,4 +58,4 @@ class bml3bus_mp1805_device: // device type definition DECLARE_DEVICE_TYPE(BML3BUS_MP1805, bml3bus_mp1805_device) -#endif // MAME_BUS_BML3_BML3MP1805_H +#endif // MAME_BUS_BML3_MP1805_H diff --git a/src/devices/bus/bml3/rtc.h b/src/devices/bus/bml3/rtc.h index 106b17d6d24..cc29da7f920 100644 --- a/src/devices/bus/bml3/rtc.h +++ b/src/devices/bus/bml3/rtc.h @@ -2,14 +2,14 @@ // copyright-holders:Russell Bull /********************************************************************* - bml3rtc.h + rtc.h Hitachi RTC card for the MB-6890 *********************************************************************/ -#ifndef MAME_BUS_BML3_BML3RTC_H -#define MAME_BUS_BML3_BML3RTC_H +#ifndef MAME_BUS_BML3_RTC_H +#define MAME_BUS_BML3_RTC_H #pragma once @@ -51,4 +51,4 @@ class bml3bus_rtc_device: // device type definition DECLARE_DEVICE_TYPE(BML3BUS_RTC, bml3bus_rtc_device) -#endif // MAME_BUS_BML3_BML3RTC_H +#endif // MAME_BUS_BML3_RTC_H diff --git a/src/devices/bus/c64/final3.h b/src/devices/bus/c64/final3.h index 11fe285fdaa..03b5c959c0c 100644 --- a/src/devices/bus/c64/final3.h +++ b/src/devices/bus/c64/final3.h @@ -6,8 +6,8 @@ **********************************************************************/ -#ifndef MAME_BUS_C4_FINAL3_H -#define MAME_BUS_C4_FINAL3_H +#ifndef MAME_BUS_C64_FINAL3_H +#define MAME_BUS_C64_FINAL3_H #pragma once @@ -53,4 +53,4 @@ class c64_final3_cartridge_device : public device_t, DECLARE_DEVICE_TYPE(C64_FINAL3, c64_final3_cartridge_device) -#endif // MAME_BUS_C4_FINAL3_H +#endif // MAME_BUS_C64_FINAL3_H diff --git a/src/devices/bus/c64/georam.h b/src/devices/bus/c64/georam.h index 48848fd8679..0f8c53f642a 100644 --- a/src/devices/bus/c64/georam.h +++ b/src/devices/bus/c64/georam.h @@ -6,8 +6,8 @@ **********************************************************************/ -#ifndef MAME_BUC_C64_GEORAM_H -#define MAME_BUC_C64_GEORAM_H +#ifndef MAME_BUS_C64_GEORAM_H +#define MAME_BUS_C64_GEORAM_H #pragma once @@ -49,4 +49,4 @@ class c64_georam_cartridge_device : public device_t, DECLARE_DEVICE_TYPE(C64_GEORAM, c64_georam_cartridge_device) -#endif // MAME_BUC_C64_GEORAM_H +#endif // MAME_BUS_C64_GEORAM_H diff --git a/src/devices/bus/c64/stardos.h b/src/devices/bus/c64/stardos.h index a1174de9d06..ca6aea021d2 100644 --- a/src/devices/bus/c64/stardos.h +++ b/src/devices/bus/c64/stardos.h @@ -6,8 +6,8 @@ **********************************************************************/ -#ifndef MAME_BUS_C4_STARDOS_H -#define MAME_BUS_C4_STARDOS_H +#ifndef MAME_BUS_C64_STARDOS_H +#define MAME_BUS_C64_STARDOS_H #pragma once @@ -56,4 +56,4 @@ class c64_stardos_cartridge_device : public device_t, DECLARE_DEVICE_TYPE(C64_STARDOS, c64_stardos_cartridge_device) -#endif // MAME_BUS_C4_STARDOS_H +#endif // MAME_BUS_C64_STARDOS_H diff --git a/src/devices/bus/c64/system3.h b/src/devices/bus/c64/system3.h index 8bb916c24d0..fde76522a58 100644 --- a/src/devices/bus/c64/system3.h +++ b/src/devices/bus/c64/system3.h @@ -6,8 +6,8 @@ **********************************************************************/ -#ifndef MAME_BUS_BUS_SYSTEM3_H -#define MAME_BUS_BUS_SYSTEM3_H +#ifndef MAME_BUS_C64_SYSTEM3_H +#define MAME_BUS_C64_SYSTEM3_H #pragma once diff --git a/src/devices/bus/c64/tibdd001.h b/src/devices/bus/c64/tibdd001.h index 57b75fddef7..21511806087 100644 --- a/src/devices/bus/c64/tibdd001.h +++ b/src/devices/bus/c64/tibdd001.h @@ -6,8 +6,8 @@ **********************************************************************/ -#ifndef MAME_BUS_C64_TIB_DD_001_H -#define MAME_BUS_C64_TIB_DD_001_H +#ifndef MAME_BUS_C64_TIBDD001_H +#define MAME_BUS_C64_TIBDD001_H #pragma once @@ -57,4 +57,4 @@ class c64_tib_dd_001_device : public device_t, DECLARE_DEVICE_TYPE(C64_TIB_DD_001, c64_tib_dd_001_device) -#endif // MAME_BUS_C64_TIB_DD_001_H +#endif // MAME_BUS_C64_TIBDD001_H diff --git a/src/devices/bus/cbmiec/c1526.h b/src/devices/bus/cbmiec/c1526.h index 90d84568349..52b7f906a47 100644 --- a/src/devices/bus/cbmiec/c1526.h +++ b/src/devices/bus/cbmiec/c1526.h @@ -6,8 +6,8 @@ **********************************************************************/ -#ifndef MAME_BUS_CBMIEC_C1626_H -#define MAME_BUS_CBMIEC_C1626_H +#ifndef MAME_BUS_CBMIEC_C1526_H +#define MAME_BUS_CBMIEC_C1526_H #pragma once @@ -82,4 +82,4 @@ DECLARE_DEVICE_TYPE(C1526, c1526_device) DECLARE_DEVICE_TYPE(C4023, c4023_device) -#endif // MAME_BUS_CBMIEC_C1626_H +#endif // MAME_BUS_CBMIEC_C1526_H diff --git a/src/devices/bus/cbus/mpu_pc98.h b/src/devices/bus/cbus/mpu_pc98.h index 6f754094afd..71c6d5c6f11 100644 --- a/src/devices/bus/cbus/mpu_pc98.h +++ b/src/devices/bus/cbus/mpu_pc98.h @@ -1,7 +1,7 @@ // license:BSD-3-Clause // copyright-holders:R. Belmont,Kevin Horton -#ifndef MAME_BUS_CBUS_MPU401_H -#define MAME_BUS_CBUS_MPU401_H +#ifndef MAME_BUS_CBUS_MPU_PC98_H +#define MAME_BUS_CBUS_MPU_PC98_H #pragma once @@ -42,4 +42,4 @@ class mpu_pc98_device : public device_t // device type definition DECLARE_DEVICE_TYPE(MPU_PC98, mpu_pc98_device) -#endif // MAME_BUS_CBUS_MPU401_H +#endif // MAME_BUS_CBUS_MPU_PC98_H diff --git a/src/devices/bus/cbus/pc9801_cbus.h b/src/devices/bus/cbus/pc9801_cbus.h index 9f2aa21832f..14c1213e00b 100644 --- a/src/devices/bus/cbus/pc9801_cbus.h +++ b/src/devices/bus/cbus/pc9801_cbus.h @@ -58,8 +58,8 @@ **********************************************************************/ -#ifndef MAME_MACHINE_PC9801_CBUS_H -#define MAME_MACHINE_PC9801_CBUS_H +#ifndef MAME_BUS_CBUS_PC9801_CBUS_H +#define MAME_BUS_CBUS_PC9801_CBUS_H #pragma once @@ -135,4 +135,4 @@ class pc9801_slot_device : public device_t, public device_slot_interface // device type definition DECLARE_DEVICE_TYPE(PC9801CBUS_SLOT, pc9801_slot_device) -#endif // MAME_MACHINE_PC9801_CBUS_H +#endif // MAME_BUS_CBUS_PC9801_CBUS_H diff --git a/src/devices/bus/coco/coco_dwsock.h b/src/devices/bus/coco/coco_dwsock.h index a9d474e6087..9533b4ca15b 100644 --- a/src/devices/bus/coco/coco_dwsock.h +++ b/src/devices/bus/coco/coco_dwsock.h @@ -1,7 +1,7 @@ // license:BSD-3-Clause // copyright-holders:Nathan Woods -#ifndef MAME_BUS_COCO_COCO_DWSOCKH_H -#define MAME_BUS_COCO_COCO_DWSOCKH_H +#ifndef MAME_BUS_COCO_COCO_DWSOCK_H +#define MAME_BUS_COCO_COCO_DWSOCK_H #include "osdfile.h" @@ -69,4 +69,4 @@ DECLARE_DEVICE_TYPE(COCO_DWSOCK, beckerport_device) // device iterator typedef device_type_enumerator beckerport_device_enumerator; -#endif // MAME_BUS_COCO_COCO_DWSOCKH_H +#endif // MAME_BUS_COCO_COCO_DWSOCK_H diff --git a/src/devices/bus/coco/coco_multi.h b/src/devices/bus/coco/coco_multi.h index 94e9c6bbc05..f4f3ea23db5 100644 --- a/src/devices/bus/coco/coco_multi.h +++ b/src/devices/bus/coco/coco_multi.h @@ -1,7 +1,7 @@ // license:BSD-3-Clause // copyright-holders:Nathan Woods -#ifndef MAME_BUS_COCO_COCO_MULTIPAK_H -#define MAME_BUS_COCO_COCO_MULTIPAK_H +#ifndef MAME_BUS_COCO_COCO_MULTI_H +#define MAME_BUS_COCO_COCO_MULTI_H #pragma once @@ -11,4 +11,4 @@ DECLARE_DEVICE_TYPE(COCO_MULTIPAK, device_cococart_interface) DECLARE_DEVICE_TYPE(DRAGON_MULTIPAK, device_cococart_interface) -#endif // MAME_BUS_COCO_COCO_MULTIPAK_H +#endif // MAME_BUS_COCO_COCO_MULTI_H diff --git a/src/devices/bus/coco/meb_intrf.h b/src/devices/bus/coco/meb_intrf.h index 859ea6366b2..d9919cb1e51 100644 --- a/src/devices/bus/coco/meb_intrf.h +++ b/src/devices/bus/coco/meb_intrf.h @@ -2,14 +2,14 @@ // copyright-holders:tim lindner /********************************************************************* - intrf.h + meb_intrf.h CRC / Disto Mini Expansion Bus management *********************************************************************/ -#ifndef MAME_BUS_COCO_DISTOMEB_H -#define MAME_BUS_COCO_DISTOMEB_H +#ifndef MAME_BUS_COCO_MEB_INTRF_H +#define MAME_BUS_COCO_MEB_INTRF_H #pragma once @@ -87,4 +87,4 @@ class device_distomeb_interface : public device_interface void disto_meb_add_basic_devices(device_slot_interface &device); -#endif // MAME_BUS_COCO_DISTOMEB_H +#endif // MAME_BUS_COCO_MEB_INTRF_H diff --git a/src/devices/bus/coleco/cartridge/exp.h b/src/devices/bus/coleco/cartridge/exp.h index ef007010fcd..59362fff11b 100644 --- a/src/devices/bus/coleco/cartridge/exp.h +++ b/src/devices/bus/coleco/cartridge/exp.h @@ -25,8 +25,8 @@ **********************************************************************/ -#ifndef MAME_BUS_COLECO_EXP_H -#define MAME_BUS_COLECO_EXP_H +#ifndef MAME_BUS_COLECO_CARTRIDGE_EXP_H +#define MAME_BUS_COLECO_CARTRIDGE_EXP_H #pragma once @@ -113,4 +113,4 @@ DECLARE_DEVICE_TYPE(COLECOVISION_CARTRIDGE_SLOT, colecovision_cartridge_slot_dev void colecovision_cartridges(device_slot_interface &device); -#endif // MAME_BUS_COLECO_EXP_H +#endif // MAME_BUS_COLECO_CARTRIDGE_EXP_H diff --git a/src/devices/bus/coleco/cartridge/megacart.h b/src/devices/bus/coleco/cartridge/megacart.h index 6df59475f67..cc94c5932e6 100644 --- a/src/devices/bus/coleco/cartridge/megacart.h +++ b/src/devices/bus/coleco/cartridge/megacart.h @@ -6,8 +6,8 @@ **********************************************************************/ -#ifndef MAME_BUS_COLECO_MEGACART_H -#define MAME_BUS_COLECO_MEGACART_H +#ifndef MAME_BUS_COLECO_CARTRIDGE_MEGACART_H +#define MAME_BUS_COLECO_CARTRIDGE_MEGACART_H #pragma once @@ -46,4 +46,4 @@ class colecovision_megacart_cartridge_device : public device_t, DECLARE_DEVICE_TYPE(COLECOVISION_MEGACART, colecovision_megacart_cartridge_device) -#endif // MAME_BUS_COLECO_MEGACART_H +#endif // MAME_BUS_COLECO_CARTRIDGE_MEGACART_H diff --git a/src/devices/bus/coleco/cartridge/std.h b/src/devices/bus/coleco/cartridge/std.h index 54ff0b70b13..33c11cf050e 100644 --- a/src/devices/bus/coleco/cartridge/std.h +++ b/src/devices/bus/coleco/cartridge/std.h @@ -6,8 +6,8 @@ **********************************************************************/ -#ifndef MAME_BUS_COLECO_STD_H -#define MAME_BUS_COLECO_STD_H +#ifndef MAME_BUS_COLECO_CARTRIDGE_STD_H +#define MAME_BUS_COLECO_CARTRIDGE_STD_H #pragma once @@ -40,5 +40,4 @@ class colecovision_standard_cartridge_device : public device_t, // device type definition DECLARE_DEVICE_TYPE(COLECOVISION_STANDARD, colecovision_standard_cartridge_device) - -#endif // MAME_BUS_COLECO_STD_H +#endif // MAME_BUS_COLECO_CARTRIDGE_STD_H diff --git a/src/devices/bus/coleco/cartridge/xin1.h b/src/devices/bus/coleco/cartridge/xin1.h index 5e1dd6fc9c9..757095f705d 100644 --- a/src/devices/bus/coleco/cartridge/xin1.h +++ b/src/devices/bus/coleco/cartridge/xin1.h @@ -6,8 +6,8 @@ **********************************************************************/ -#ifndef MAME_BUS_COLECO_XIN1_H -#define MAME_BUS_COLECO_XIN1_H +#ifndef MAME_BUS_COLECO_CARTRIDGE_XIN1_H +#define MAME_BUS_COLECO_CARTRIDGE_XIN1_H #pragma once @@ -44,5 +44,4 @@ class colecovision_xin1_cartridge_device : public device_t, // device type definition DECLARE_DEVICE_TYPE(COLECOVISION_XIN1, colecovision_xin1_cartridge_device) - -#endif // MAME_BUS_COLECO_XIN1_H +#endif // MAME_BUS_COLECO_CARTRIDGE_XIN1_H diff --git a/src/devices/bus/coleco/controller/ctrl.h b/src/devices/bus/coleco/controller/ctrl.h index b5f5c36127f..6862f4d1380 100644 --- a/src/devices/bus/coleco/controller/ctrl.h +++ b/src/devices/bus/coleco/controller/ctrl.h @@ -9,8 +9,8 @@ **********************************************************************/ -#ifndef MAME_BUS_COLECO_CTRL_H -#define MAME_BUS_COLECO_CTRL_H +#ifndef MAME_BUS_COLECO_CONTROLLER_CTRL_H +#define MAME_BUS_COLECO_CONTROLLER_CTRL_H #pragma once @@ -89,4 +89,4 @@ DECLARE_DEVICE_TYPE(COLECOVISION_CONTROL_PORT, colecovision_control_port_device) void colecovision_control_port_devices(device_slot_interface &device); -#endif // MAME_BUS_COLECO_CTRL_H +#endif // MAME_BUS_COLECO_CONTROLLER_CTRL_H diff --git a/src/devices/bus/coleco/controller/hand.h b/src/devices/bus/coleco/controller/hand.h index 026ef89a7df..9f6395be155 100644 --- a/src/devices/bus/coleco/controller/hand.h +++ b/src/devices/bus/coleco/controller/hand.h @@ -6,8 +6,8 @@ **********************************************************************/ -#ifndef MAME_BUS_COLECO_HAND_H -#define MAME_BUS_COLECO_HAND_H +#ifndef MAME_BUS_COLECO_CONTROLLER_HAND_H +#define MAME_BUS_COLECO_CONTROLLER_HAND_H #pragma once @@ -50,5 +50,4 @@ class coleco_hand_controller_device : public device_t, // device type definition DECLARE_DEVICE_TYPE(COLECO_HAND_CONTROLLER, coleco_hand_controller_device) - -#endif // MAME_BUS_COLECO_HAND_H +#endif // MAME_BUS_COLECO_CONTROLLER_HAND_H diff --git a/src/devices/bus/coleco/controller/sac.h b/src/devices/bus/coleco/controller/sac.h index f1f3db57344..ba7df71efd1 100644 --- a/src/devices/bus/coleco/controller/sac.h +++ b/src/devices/bus/coleco/controller/sac.h @@ -6,8 +6,8 @@ **********************************************************************/ -#ifndef MAME_BUS_COLECO_SAC_H -#define MAME_BUS_COLECO_SAC_H +#ifndef MAME_BUS_COLECO_CONTROLLER_SAC_H +#define MAME_BUS_COLECO_CONTROLLER_SAC_H #pragma once @@ -51,5 +51,4 @@ class coleco_super_action_controller_device : public device_t, // device type definition DECLARE_DEVICE_TYPE(COLECO_SUPER_ACTION_CONTROLLER, coleco_super_action_controller_device) - -#endif // MAME_BUS_COLECO_SAC_H +#endif // MAME_BUS_COLECO_CONTROLLER_SAC_H diff --git a/src/devices/bus/coleco/expansion/cards.h b/src/devices/bus/coleco/expansion/cards.h index 08577a2cba9..6d724420df8 100644 --- a/src/devices/bus/coleco/expansion/cards.h +++ b/src/devices/bus/coleco/expansion/cards.h @@ -6,11 +6,11 @@ ***************************************************************************/ -#ifndef MAME_BUS_COlECO_EXPANSION_CARDS_H -#define MAME_BUS_COlECO_EXPANSION_CARDS_H +#ifndef MAME_BUS_COLECO_EXPANSION_CARDS_H +#define MAME_BUS_COLECO_EXPANSION_CARDS_H #pragma once void coleco_expansion_cards(device_slot_interface &device); -#endif // MAME_BUS_COlECO_EXPANSION_CARDS_H +#endif // MAME_BUS_COLECO_EXPANSION_CARDS_H diff --git a/src/devices/bus/coleco/expansion/expansion.h b/src/devices/bus/coleco/expansion/expansion.h index e48cc59b2f7..0c38f42f514 100644 --- a/src/devices/bus/coleco/expansion/expansion.h +++ b/src/devices/bus/coleco/expansion/expansion.h @@ -39,8 +39,8 @@ ***************************************************************************/ -#ifndef MAME_BUS_COlECO_EXPANSION_EXPANSION_H -#define MAME_BUS_COlECO_EXPANSION_EXPANSION_H +#ifndef MAME_BUS_COLECO_EXPANSION_EXPANSION_H +#define MAME_BUS_COLECO_EXPANSION_EXPANSION_H #pragma once @@ -123,4 +123,4 @@ class device_coleco_expansion_interface : public device_interface DECLARE_DEVICE_TYPE(COLECO_EXPANSION, coleco_expansion_device) -#endif // MAME_BUS_COlECO_EXPANSION_EXPANSION_H +#endif // MAME_BUS_COLECO_EXPANSION_EXPANSION_H diff --git a/src/devices/bus/einstein/pipe/silicon_disc.h b/src/devices/bus/einstein/pipe/silicon_disc.h index d30f564b0d2..132414c04b5 100644 --- a/src/devices/bus/einstein/pipe/silicon_disc.h +++ b/src/devices/bus/einstein/pipe/silicon_disc.h @@ -8,8 +8,8 @@ ***************************************************************************/ -#ifndef MAME_BUS_EINSTEIN_SILICON_DISC_H -#define MAME_BUS_EINSTEIN_SILICON_DISC_H +#ifndef MAME_BUS_EINSTEIN_PIPE_SILICON_DISC_H +#define MAME_BUS_EINSTEIN_PIPE_SILICON_DISC_H #pragma once @@ -51,4 +51,4 @@ class einstein_silicon_disc_device : public device_t, public device_tatung_pipe_ // device type definition DECLARE_DEVICE_TYPE(EINSTEIN_SILICON_DISC, einstein_silicon_disc_device) -#endif // MAME_BUS_EINSTEIN_SILICON_DISC_H +#endif // MAME_BUS_EINSTEIN_PIPE_SILICON_DISC_H diff --git a/src/devices/bus/einstein/pipe/tk02.h b/src/devices/bus/einstein/pipe/tk02.h index 2a592715907..5b4c05e4c18 100644 --- a/src/devices/bus/einstein/pipe/tk02.h +++ b/src/devices/bus/einstein/pipe/tk02.h @@ -6,8 +6,8 @@ ***************************************************************************/ -#ifndef MAME_BUS_EINSTEIN_TK02_H -#define MAME_BUS_EINSTEIN_TK02_H +#ifndef MAME_BUS_EINSTEIN_PIPE_TK02_H +#define MAME_BUS_EINSTEIN_PIPE_TK02_H #pragma once @@ -59,4 +59,4 @@ class tk02_device : public device_t, public device_tatung_pipe_interface // device type definition DECLARE_DEVICE_TYPE(TK02_80COL, tk02_device) -#endif // MAME_BUS_EINSTEIN_TK02_H +#endif // MAME_BUS_EINSTEIN_PIPE_TK02_H diff --git a/src/devices/bus/electron/cart/slot.h b/src/devices/bus/electron/cart/slot.h index 8f930392e66..a9f4ab1e12e 100644 --- a/src/devices/bus/electron/cart/slot.h +++ b/src/devices/bus/electron/cart/slot.h @@ -91,8 +91,8 @@ 22 0V - Zero volts. **********************************************************************/ -#ifndef MAME_BUS_ELECTRON_CARTSLOT_H -#define MAME_BUS_ELECTRON_CARTSLOT_H +#ifndef MAME_BUS_ELECTRON_CART_SLOT_H +#define MAME_BUS_ELECTRON_CART_SLOT_H #pragma once @@ -211,5 +211,4 @@ DECLARE_DEVICE_TYPE(ELECTRON_CARTSLOT, electron_cartslot_device) void electron_cart(device_slot_interface &device); - -#endif // MAME_BUS_ELECTRON_CARTSLOT_H +#endif // MAME_BUS_ELECTRON_CART_SLOT_H diff --git a/src/devices/bus/electron/m2105.h b/src/devices/bus/electron/m2105.h index b9c02a179a9..152f229a96c 100644 --- a/src/devices/bus/electron/m2105.h +++ b/src/devices/bus/electron/m2105.h @@ -6,8 +6,8 @@ **********************************************************************/ -#ifndef MAME_BUS_ELECTRON_M2105_M -#define MAME_BUS_ELECTRON_M2105_M +#ifndef MAME_BUS_ELECTRON_M2105_H +#define MAME_BUS_ELECTRON_M2105_H #pragma once @@ -59,5 +59,4 @@ class electron_m2105_device: // device type definition DECLARE_DEVICE_TYPE(ELECTRON_M2105, electron_m2105_device) - -#endif // MAME_BUS_ELECTRON_M2105_M +#endif // MAME_BUS_ELECTRON_M2105_H diff --git a/src/devices/bus/electron/mc68k.h b/src/devices/bus/electron/mc68k.h index d8b5e29894c..67c23eba8a6 100644 --- a/src/devices/bus/electron/mc68k.h +++ b/src/devices/bus/electron/mc68k.h @@ -6,8 +6,8 @@ **********************************************************************/ -#ifndef MAME_BUS_ELECTRON_MC68K_M -#define MAME_BUS_ELECTRON_MC68K_M +#ifndef MAME_BUS_ELECTRON_MC68K_H +#define MAME_BUS_ELECTRON_MC68K_H #pragma once @@ -59,5 +59,4 @@ class electron_mc68k_device: // device type definition DECLARE_DEVICE_TYPE(ELECTRON_MC68K, electron_mc68k_device) - -#endif // MAME_BUS_ELECTRON_MC68K_M +#endif // MAME_BUS_ELECTRON_MC68K_H diff --git a/src/devices/bus/epson_qx/keyboard/keyboard.h b/src/devices/bus/epson_qx/keyboard/keyboard.h index b0ee9275d61..f260cd4849d 100644 --- a/src/devices/bus/epson_qx/keyboard/keyboard.h +++ b/src/devices/bus/epson_qx/keyboard/keyboard.h @@ -10,8 +10,8 @@ ***************************************************************************/ -#ifndef MAME_BUS_EPSON_QX_KEYBOARD_H -#define MAME_BUS_EPSON_QX_KEYBOARD_H +#ifndef MAME_BUS_EPSON_QX_KEYBOARD_KEYBOARD_H +#define MAME_BUS_EPSON_QX_KEYBOARD_KEYBOARD_H #pragma once @@ -111,4 +111,4 @@ DECLARE_DEVICE_TYPE_NS(EPSON_QX_KEYBOARD_PORT, bus::epson_qx::keyboard, keyboard DECLARE_DEVICE_TYPE_NS(QX10_KEYBOARD_HASCI, bus::epson_qx::keyboard, qx10_keyboard_hasci) DECLARE_DEVICE_TYPE_NS(QX10_KEYBOARD_ASCII, bus::epson_qx::keyboard, qx10_keyboard_ascii) -#endif +#endif // MAME_BUS_EPSON_QX_KEYBOARD_KEYBOARD_H diff --git a/src/devices/bus/epson_qx/option.h b/src/devices/bus/epson_qx/option.h index 8df99a60211..0f39a194b51 100644 --- a/src/devices/bus/epson_qx/option.h +++ b/src/devices/bus/epson_qx/option.h @@ -97,8 +97,8 @@ |---| |---| |---| |---| |---| */ -#ifndef MAME_BUS_EPSON_QX_BUS_H -#define MAME_BUS_EPSON_QX_BUS_H +#ifndef MAME_BUS_EPSON_QX_OPTION_H +#define MAME_BUS_EPSON_QX_OPTION_H #pragma once @@ -277,4 +277,4 @@ void option_bus_devices(device_slot_interface &device); DECLARE_DEVICE_TYPE_NS(EPSON_QX_OPTION_BUS_SLOT, bus::epson_qx, option_slot_device) DECLARE_DEVICE_TYPE_NS(EPSON_QX_OPTION_BUS, bus::epson_qx, option_bus_device) -#endif +#endif // MAME_BUS_EPSON_QX_OPTION_H diff --git a/src/devices/bus/epson_qx/sound_card.h b/src/devices/bus/epson_qx/sound_card.h index 2d36ff6bc43..61d1a8a4ed1 100644 --- a/src/devices/bus/epson_qx/sound_card.h +++ b/src/devices/bus/epson_qx/sound_card.h @@ -6,8 +6,8 @@ * *******************************************************************/ -#ifndef MAME_BUS_EPSON_QX_YM2149_H -#define MAME_BUS_EPSON_QX_YM2149_H +#ifndef MAME_BUS_EPSON_QX_SOUND_CARD_H +#define MAME_BUS_EPSON_QX_SOUND_CARD_H #pragma once @@ -58,4 +58,4 @@ class ym2149_sound_card_device : public device_t, public device_option_expansion DECLARE_DEVICE_TYPE_NS(EPSON_QX_OPTION_YM2149, bus::epson_qx, ym2149_sound_card_device) -#endif // MAME_BUS_EPSON_QX_YM2149_H +#endif // MAME_BUS_EPSON_QX_SOUND_CARD_H diff --git a/src/devices/bus/fp1000/fp1000_exp.h b/src/devices/bus/fp1000/fp1000_exp.h index 39dd2449795..4faca42d4f2 100644 --- a/src/devices/bus/fp1000/fp1000_exp.h +++ b/src/devices/bus/fp1000/fp1000_exp.h @@ -1,8 +1,8 @@ // license:BSD-3-Clause // copyright-holders:Angelo Salese -#ifndef MAME_BUS_FP1000_EXP_H -#define MAME_BUS_FP1000_EXP_H +#ifndef MAME_BUS_FP1000_FP1000_EXP_H +#define MAME_BUS_FP1000_FP1000_EXP_H #pragma once @@ -98,4 +98,4 @@ DECLARE_DEVICE_TYPE(FP1000_EXP_SLOT, fp1000_exp_slot_device) void fp1000_exp_devices(device_slot_interface &device); -#endif // MAME_MACHINE_FP1000_EXP_H +#endif // MAME_BUS_FP1000_FP1000_EXP_H diff --git a/src/devices/bus/fp1000/fp1020fd.h b/src/devices/bus/fp1000/fp1020fd.h index 3ba84bc61eb..e19feef985b 100644 --- a/src/devices/bus/fp1000/fp1020fd.h +++ b/src/devices/bus/fp1000/fp1020fd.h @@ -1,8 +1,8 @@ // license:BSD-3-Clause // copyright-holders:Angelo Salese -#ifndef MAME_BUS_FP1020FD_H -#define MAME_BUS_FP1020FD_H +#ifndef MAME_BUS_FP1000_FP1020FD_H +#define MAME_BUS_FP1000_FP1020FD_H #pragma once @@ -39,5 +39,4 @@ class fp1020fd_device : public fp1060io_exp_device DECLARE_DEVICE_TYPE(FP1020FD, fp1020fd_device) - -#endif // MAME_BUS_FP1020FD_H +#endif // MAME_BUS_FP1000_FP1020FD_H diff --git a/src/devices/bus/fp1000/fp1030_rampack.h b/src/devices/bus/fp1000/fp1030_rampack.h index aa63a8dffb5..05168afccc0 100644 --- a/src/devices/bus/fp1000/fp1030_rampack.h +++ b/src/devices/bus/fp1000/fp1030_rampack.h @@ -1,8 +1,8 @@ // license:BSD-3-Clause // copyright-holders:Angelo Salese -#ifndef MAME_BUS_FP1030_RAMPACK_H -#define MAME_BUS_FP1030_RAMPACK_H +#ifndef MAME_BUS_FP1000_FP1030_RAMPACK_H +#define MAME_BUS_FP1000_FP1030_RAMPACK_H #pragma once @@ -31,4 +31,4 @@ class fp1030_rampack_device : public fp1060io_exp_device DECLARE_DEVICE_TYPE(FP1030_RAMPACK, fp1030_rampack_device) -#endif // MAME_BUS_FP1030_RAMPACK_H +#endif // MAME_BUS_FP1000_FP1030_RAMPACK_H diff --git a/src/devices/bus/fp1000/fp1060io.h b/src/devices/bus/fp1000/fp1060io.h index 7e4f298fe29..4f69eeddf1a 100644 --- a/src/devices/bus/fp1000/fp1060io.h +++ b/src/devices/bus/fp1000/fp1060io.h @@ -1,8 +1,8 @@ // license:BSD-3-Clause // copyright-holders:Angelo Salese -#ifndef MAME_BUS_FP1060IO_H -#define MAME_BUS_FP1060IO_H +#ifndef MAME_BUS_FP1000_FP1060IO_H +#define MAME_BUS_FP1000_FP1060IO_H #pragma once @@ -35,5 +35,4 @@ class fp1060io_device : public fp1000_exp_device DECLARE_DEVICE_TYPE(FP1060IO, fp1060io_device) - -#endif // MAME_BUS_FP1060IO_H +#endif // MAME_BUS_FP1000_FP1060IO_H diff --git a/src/devices/bus/fp1000/fp1060io_exp.h b/src/devices/bus/fp1000/fp1060io_exp.h index df39924647c..59e176b6ff8 100644 --- a/src/devices/bus/fp1000/fp1060io_exp.h +++ b/src/devices/bus/fp1000/fp1060io_exp.h @@ -1,8 +1,8 @@ // license:BSD-3-Clause // copyright-holders:Angelo Salese -#ifndef MAME_BUS_FP1060IO_EXP_H -#define MAME_BUS_FP1060IO_EXP_H +#ifndef MAME_BUS_FP1000_FP1060IO_EXP_H +#define MAME_BUS_FP1000_FP1060IO_EXP_H #pragma once @@ -83,5 +83,4 @@ void fp1060io_slot_devices(device_slot_interface &device); DECLARE_DEVICE_TYPE(FP1060IO_EXP_SLOT, fp1060io_exp_slot_device) -#endif // MAME_BUS_FP1060IO_EXP_H - +#endif // MAME_BUS_FP1000_FP1060IO_EXP_H diff --git a/src/devices/bus/gamate/gamate_protection.h b/src/devices/bus/gamate/gamate_protection.h index 4c6f077f246..d0065693dbe 100644 --- a/src/devices/bus/gamate/gamate_protection.h +++ b/src/devices/bus/gamate/gamate_protection.h @@ -1,8 +1,8 @@ // license:BSD-3-Clause // copyright-holders:David Haywood -#ifndef MAME_BUS_GAMATE_PROTECTION_H -#define MAME_BUS_GAMATE_PROTECTION_H +#ifndef MAME_BUS_GAMATE_GAMATE_PROTECTION_H +#define MAME_BUS_GAMATE_GAMATE_PROTECTION_H #pragma once @@ -35,5 +35,4 @@ class gamate_protection_device : public device_t const uint8_t m_prot_string[15] = { 0x42, 0x49, 0x54, 0x20, 0x43, 0x4F, 0x52, 0x50, 0x4F, 0x52, 0x41, 0x54, 0x49, 0x4F, 0x4E }; // "BIT CORPORATION" }; -#endif // MAME_BUS_GAMATE_PROTECTION_H - +#endif // MAME_BUS_GAMATE_GAMATE_PROTECTION_H diff --git a/src/devices/bus/gio64/newport.h b/src/devices/bus/gio64/newport.h index 116ff6637be..65a03476e35 100644 --- a/src/devices/bus/gio64/newport.h +++ b/src/devices/bus/gio64/newport.h @@ -8,8 +8,8 @@ *********************************************************************/ -#ifndef MAME_BUS_GIO_NEWPORT_H -#define MAME_BUS_GIO_NEWPORT_H +#ifndef MAME_BUS_GIO64_NEWPORT_H +#define MAME_BUS_GIO64_NEWPORT_H #pragma once @@ -547,4 +547,4 @@ class gio64_xl24_device : public newport_base_device DECLARE_DEVICE_TYPE(GIO64_XL8, gio64_xl8_device) DECLARE_DEVICE_TYPE(GIO64_XL24, gio64_xl24_device) -#endif // MAME_BUS_GIO_NEWPORT_H +#endif // MAME_BUS_GIO64_NEWPORT_H diff --git a/src/mame/heathzenith/tlb.cpp b/src/devices/bus/heathzenith/h19/tlb.cpp similarity index 100% rename from src/mame/heathzenith/tlb.cpp rename to src/devices/bus/heathzenith/h19/tlb.cpp diff --git a/src/mame/heathzenith/tlb.h b/src/devices/bus/heathzenith/h19/tlb.h similarity index 99% rename from src/mame/heathzenith/tlb.h rename to src/devices/bus/heathzenith/h19/tlb.h index b0ed5ba31ef..db216209bca 100644 --- a/src/mame/heathzenith/tlb.h +++ b/src/devices/bus/heathzenith/h19/tlb.h @@ -6,8 +6,8 @@ ****************************************************************************/ -#ifndef MAME_HEATHZENITH_TLB_H -#define MAME_HEATHZENITH_TLB_H +#ifndef MAME_BUS_HEATHZENITH_H19_TLB_H +#define MAME_BUS_HEATHZENITH_H19_TLB_H #pragma once @@ -474,4 +474,4 @@ class heath_tlb_connector : public device_t, // device type definition DECLARE_DEVICE_TYPE(HEATH_TLB_CONNECTOR, heath_tlb_connector) -#endif // MAME_HEATHZENITH_TLB_H +#endif // MAME_BUS_HEATHZENITH_H19_TLB_H diff --git a/src/devices/bus/heathzenith/h89/cards.cpp b/src/devices/bus/heathzenith/h89/cards.cpp index 22f379601b1..618f07d4f6a 100644 --- a/src/devices/bus/heathzenith/h89/cards.cpp +++ b/src/devices/bus/heathzenith/h89/cards.cpp @@ -12,12 +12,14 @@ #include "h_88_3.h" #include "h_88_5.h" #include "mms77316_fdc.h" +#include "sigmasoft_parallel_port.h" #include "sigmasoft_sound.h" #include "we_pullup.h" #include "z37_fdc.h" void h89_left_cards(device_slot_interface &device) { + device.option_add("ss_parallel", H89BUS_SIGMASOFT_PARALLEL); } void h89_right_cards(device_slot_interface &device) diff --git a/src/devices/bus/heathzenith/h89/h17_fdc.cpp b/src/devices/bus/heathzenith/h89/h17_fdc.cpp index 80a1f6deaa1..26edaaa8929 100644 --- a/src/devices/bus/heathzenith/h89/h17_fdc.cpp +++ b/src/devices/bus/heathzenith/h89/h17_fdc.cpp @@ -39,6 +39,8 @@ #define FUNCNAME __PRETTY_FUNCTION__ #endif +namespace { + class heath_h17_fdc_device : public device_t, public device_h89bus_right_card_interface { public: @@ -49,7 +51,7 @@ class heath_h17_fdc_device : public device_t, public device_h89bus_right_card_in virtual void write(u8 select_lines, u8 offset, u8 data) override; virtual u8 read(u8 select_lines, u8 offset) override; - void side_select_w(int state); + [[maybe_unused]] void side_select_w(int state); protected: static constexpr u8 MAX_FLOPPY_DRIVES = 3; @@ -360,4 +362,6 @@ void heath_h17_fdc_device::sync_character_received(int state) m_sync_char_received = bool(!BIT(state, 0)); } +} // anonymous namespace + DEFINE_DEVICE_TYPE_PRIVATE(H89BUS_H_17_FDC, device_h89bus_right_card_interface, heath_h17_fdc_device, "h89_h17_fdc", "Heath H-17 Hard-sectored Controller (H-88-1)"); diff --git a/src/devices/bus/heathzenith/h89/h89bus.cpp b/src/devices/bus/heathzenith/h89/h89bus.cpp index 848713aa76d..17a6fab2dd6 100644 --- a/src/devices/bus/heathzenith/h89/h89bus.cpp +++ b/src/devices/bus/heathzenith/h89/h89bus.cpp @@ -1,5 +1,5 @@ // license:BSD-3-Clause -// copyright-holders:R. Belmont +// copyright-holders:R. Belmont, Mark Garlanger /*************************************************************************** h89bus.cpp - Heath/Zenith H-89/Z-90 bus @@ -175,8 +175,7 @@ const tiny_rom_entry *h89bus_device::device_rom_region() const void h89bus_device::device_start() { - // don't claim I/O below 0x10 for now - m_io_space->install_readwrite_handler(0x0010, 0x00ff, emu::rw_delegate(*this, FUNC(h89bus_device::io_dispatch_r)), emu::rw_delegate(*this, FUNC(h89bus_device::io_dispatch_w))); + m_io_space->install_readwrite_handler(0x0000, 0x00ff, emu::rw_delegate(*this, FUNC(h89bus_device::io_dispatch_r)), emu::rw_delegate(*this, FUNC(h89bus_device::io_dispatch_w))); } void h89bus_device::add_h89bus_left_card(device_h89bus_left_card_interface &card) @@ -242,37 +241,33 @@ u8 h89bus_device::io_dispatch_r(offs_t offset) { u8 retval = 0; - offset += 0x10; - if (m_decode_prom[offset] != 0xff) - { - u16 decode = m_decode_prom[offset] ^ 0xff; + u16 decode = m_decode_prom[offset] ^ 0xff; + if (decode) + { if ((decode & H89_GPP) && ((offset & 7) == 2)) return m_in_gpp_cb(offset); if (decode & H89_NMI) return m_in_nmi_cb(offset); if (decode & H89_TERM) return m_in_tlb_cb(offset & 7); - if (decode) + for (device_h89bus_right_card_interface &entry : m_right_device_list) { - for (device_h89bus_right_card_interface &entry : m_right_device_list) + if (entry.m_p506_signals) + { + // p506 does not have CASS or LP + retval |= entry.read(decode & ~(H89_CASS | H89_LP), offset & 7); + } + else { - if (entry.m_p506_signals) - { - // p506 does not have CASS or LP - retval |= entry.read(decode & ~(H89_CASS | H89_LP), offset & 7); - } - else - { - // p504/p505 does not have FLPY - retval |= entry.read(decode & ~H89_FLPY , offset & 7); - } + // p504/p505 does not have FLPY + retval |= entry.read(decode & ~H89_FLPY , offset & 7); } } + } - // service left-slot cards that have a motherboard connection to snoop the I/O space - for (device_h89bus_left_card_interface &entry : m_left_device_list) - { - retval |= entry.read(H89_IO, offset); - } + // service left-slot cards that have a motherboard connection to snoop the I/O space + for (device_h89bus_left_card_interface &entry : m_left_device_list) + { + retval |= entry.read(H89_IO, offset & 0x1fff); } return retval; @@ -280,37 +275,33 @@ u8 h89bus_device::io_dispatch_r(offs_t offset) void h89bus_device::io_dispatch_w(offs_t offset, u8 data) { - offset += 0x10; - if (m_decode_prom[offset] != 0xff) - { - u16 decode = m_decode_prom[offset] ^ 0xff; + u16 decode = m_decode_prom[offset] ^ 0xff; + if (decode) + { if (decode & H89_GPP) m_out_gpp_cb(offset, data); if (decode & H89_NMI) { m_out_nmi_cb(offset, data); return; } if (decode & H89_TERM) { m_out_tlb_cb(offset & 7, data); return; } - if (decode) + for (device_h89bus_right_card_interface &entry : m_right_device_list) { - for (device_h89bus_right_card_interface &entry : m_right_device_list) + if (entry.m_p506_signals) + { + // p506 does not have CASS or LP + entry.write(decode & ~(H89_CASS | H89_LP), offset & 7, data); + } + else { - if (entry.m_p506_signals) - { - // p506 does not have CASS or LP - entry.write(decode & ~(H89_CASS | H89_LP), offset & 7, data); - } - else - { - // p504/p505 does not have FLPY - entry.write(decode & ~H89_FLPY, offset & 7, data); - } + // p504/p505 does not have FLPY + entry.write(decode & ~H89_FLPY, offset & 7, data); } } + } - // service left-slot cards that have a motherboard connection to snoop the I/O space - for (device_h89bus_left_card_interface &entry : m_left_device_list) - { - entry.write(H89_IO, offset, data); - } + // service left-slot cards that have a motherboard connection to snoop the I/O space + for (device_h89bus_left_card_interface &entry : m_left_device_list) + { + entry.write(H89_IO, offset, data); } } diff --git a/src/devices/bus/heathzenith/h89/sigmasoft_parallel_port.cpp b/src/devices/bus/heathzenith/h89/sigmasoft_parallel_port.cpp new file mode 100644 index 00000000000..9f47f999198 --- /dev/null +++ b/src/devices/bus/heathzenith/h89/sigmasoft_parallel_port.cpp @@ -0,0 +1,245 @@ +// license:BSD-3-Clause +// copyright-holders:Mark Garlanger +/*************************************************************************** + + SigmaSoft Universal Parallel Interface Board + + +****************************************************************************/ + +#include "emu.h" + +#include "bus/heathzenith/h19/tlb.h" + +#include "sigmasoft_parallel_port.h" + +// +// Logging defines +// +#define LOG_REG (1U << 1) // Shows register setup +#define LOG_FUNC (1U << 2) // Function calls + +#define VERBOSE (0) + +#include "logmacro.h" + +#define LOGREG(...) LOGMASKED(LOG_REG, __VA_ARGS__) +#define LOGFUNC(...) LOGMASKED(LOG_FUNC, __VA_ARGS__) + +#ifdef _MSC_VER +#define FUNCNAME __func__ +#else +#define FUNCNAME __PRETTY_FUNCTION__ +#endif + +// TODO make this configurable with jumper config +static constexpr u8 BASE_ADDR = 0x08; + +class sigmasoft_parallel_port : public device_t, public device_h89bus_left_card_interface +{ +public: + sigmasoft_parallel_port(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock = 0); + + virtual u8 read(u8 select_lines, u16 offset) override; + virtual void write(u8 select_lines, u16 offset, u8 data) override; + + auto ctrl_r_cb() { return m_ctrl_r.bind(); } + auto video_mem_r_cb() { return m_video_mem_r.bind(); } + + auto video_mem_cb() { return m_video_mem_w.bind(); } + auto io_lo_cb() { return m_io_lo_addr.bind(); } + auto io_hi_cb() { return m_io_hi_addr.bind(); } + auto window_lo_cb() { return m_window_lo_addr.bind(); } + auto window_hi_cb() { return m_window_hi_addr.bind(); } + auto ctrl_cb() { return m_ctrl_w.bind(); } + +protected: + + virtual void device_start() override ATTR_COLD; + virtual void device_add_mconfig(machine_config& config) override ATTR_COLD;; + + u8 video_mem_r(); + void video_mem_w(u8 val); + + void io_lo_addr_w(u8 val); + void io_hi_addr_w(u8 val); + + void window_lo_addr_w(u8 val); + void window_hi_addr_w(u8 val); + + void ctrl_w(u8 val); + u8 ctrl_r(); + +private: + + // Reads + devcb_read8 m_ctrl_r; + devcb_read8 m_video_mem_r; + + // Writes + devcb_write8 m_video_mem_w; + devcb_write8 m_io_lo_addr; + devcb_write8 m_io_hi_addr; + devcb_write8 m_window_lo_addr; + devcb_write8 m_window_hi_addr; + devcb_write8 m_ctrl_w; +}; + + +sigmasoft_parallel_port::sigmasoft_parallel_port(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock): + device_t(mconfig, H89BUS_SIGMASOFT_PARALLEL, tag, owner, clock), + device_h89bus_left_card_interface(mconfig, *this), + m_ctrl_r(*this, 0x00), + m_video_mem_r(*this, 0x00), + m_video_mem_w(*this), + m_io_lo_addr(*this), + m_io_hi_addr(*this), + m_window_lo_addr(*this), + m_window_hi_addr(*this), + m_ctrl_w(*this) +{ +} + +void sigmasoft_parallel_port::video_mem_w(u8 val) +{ + m_video_mem_w(val); +} + +void sigmasoft_parallel_port::io_lo_addr_w(u8 val) +{ + m_io_lo_addr(val); +} + +void sigmasoft_parallel_port::io_hi_addr_w(u8 val) +{ + m_io_hi_addr(val); +} + +void sigmasoft_parallel_port::window_lo_addr_w(u8 val) +{ + m_window_lo_addr(val); +} + +void sigmasoft_parallel_port::window_hi_addr_w(u8 val) +{ + m_window_hi_addr(val); +} + +void sigmasoft_parallel_port::ctrl_w(u8 val) +{ + m_ctrl_w(val); +} + +void sigmasoft_parallel_port::write(u8 select_lines, u16 offset, u8 data) +{ + offset -= BASE_ADDR; + if (!(select_lines & h89bus_device::H89_IO) || offset >= 8) + { + return; + } + + LOGFUNC("%s: reg: %d val: %d\n", FUNCNAME, offset, data); + + switch (offset) + { + case 0: + video_mem_w(data); + break; + case 1: + io_lo_addr_w(data); + break; + case 2: + io_hi_addr_w(data); + break; + case 3: + window_lo_addr_w(data); + break; + case 4: + window_hi_addr_w(data); + break; + case 5: + ctrl_w(data); + break; + case 6: + // TODO - Centronics interface + break; + case 7: + // TODO - Centronics interface + break; + } +} + +u8 sigmasoft_parallel_port::video_mem_r() +{ + // get video memory value from igc device + return m_video_mem_r(); +} + +u8 sigmasoft_parallel_port::ctrl_r() +{ + // get control register from igc device + return m_ctrl_r(); +} + +u8 sigmasoft_parallel_port::read(u8 select_lines, u16 offset) +{ + offset -= BASE_ADDR; + u8 value = 0x00; + + if (!(select_lines & h89bus_device::H89_IO) || offset >= 8) + { + return value; + } + + switch (offset) + { + case 0: + value = video_mem_r(); + break; + case 1: + // TODO - Light Pen Low address + break; + case 2: + // TODO - Light Pen High address + break; + case 3: + // TODO - Left input device + break; + case 4: + // TODO - Right input device + break; + case 5: + // Control Register + value = ctrl_r(); + break; + case 6: + // TODO - Centronics interface + break; + case 7: + // TODO - Centronics interface + break; + } + + LOGFUNC("%s: reg: %d val: %d\n", FUNCNAME, offset, value); + + return value; +} + +void sigmasoft_parallel_port::device_start() +{ +} + +void sigmasoft_parallel_port::device_add_mconfig(machine_config &config) +{ + // connect callbacks to TLB + ctrl_r_cb().set("^^tlbc", FUNC(heath_tlb_connector::sigma_ctrl_r)); + video_mem_r_cb().set("^^tlbc", FUNC(heath_tlb_connector::sigma_video_mem_r)); + video_mem_cb().set("^^tlbc", FUNC(heath_tlb_connector::sigma_video_mem_w)); + io_lo_cb().set("^^tlbc", FUNC(heath_tlb_connector::sigma_io_lo_addr_w)); + io_hi_cb().set("^^tlbc", FUNC(heath_tlb_connector::sigma_io_hi_addr_w)); + window_lo_cb().set("^^tlbc", FUNC(heath_tlb_connector::sigma_window_lo_addr_w)); + window_hi_cb().set("^^tlbc", FUNC(heath_tlb_connector::sigma_window_hi_addr_w)); + ctrl_cb().set("^^tlbc", FUNC(heath_tlb_connector::sigma_ctrl_w)); +} + +DEFINE_DEVICE_TYPE_PRIVATE(H89BUS_SIGMASOFT_PARALLEL, device_h89bus_left_card_interface, sigmasoft_parallel_port, "sigmasoft_parallel_port", "SigmaSoft Universal Parallel Board"); diff --git a/src/devices/bus/heathzenith/h89/sigmasoft_parallel_port.h b/src/devices/bus/heathzenith/h89/sigmasoft_parallel_port.h new file mode 100644 index 00000000000..e35cdec5de6 --- /dev/null +++ b/src/devices/bus/heathzenith/h89/sigmasoft_parallel_port.h @@ -0,0 +1,18 @@ +// license:BSD-3-Clause +// copyright-holders:Mark Garlanger +/*************************************************************************** + + SigmaSoft Universal Parallel Interface Board + +****************************************************************************/ + +#ifndef MAME_BUS_HEATHZENITH_H89_SIGMASOFT_PARALLEL_PORT_H +#define MAME_BUS_HEATHZENITH_H89_SIGMASOFT_PARALLEL_PORT_H + +#pragma once + +#include "h89bus.h" + +DECLARE_DEVICE_TYPE(H89BUS_SIGMASOFT_PARALLEL, device_h89bus_left_card_interface) + +#endif // MAME_BUS_HEATHZENITH_H89_SIGMASOFT_PARALLEL_PORT_H diff --git a/src/devices/bus/heathzenith/h89/z37_fdc.h b/src/devices/bus/heathzenith/h89/z37_fdc.h index a3400914250..045ccabc74a 100644 --- a/src/devices/bus/heathzenith/h89/z37_fdc.h +++ b/src/devices/bus/heathzenith/h89/z37_fdc.h @@ -6,7 +6,7 @@ ****************************************************************************/ -#ifndef MAME__Z37_FDC_H +#ifndef MAME_BUS_HEATHZENITH_H89_Z37_FDC_H #define MAME_BUS_HEATHZENITH_H89_Z37_FDC_H #pragma once diff --git a/src/devices/bus/hp9845_io/98035.h b/src/devices/bus/hp9845_io/98035.h index c7c56579ddc..b6a9fe40264 100644 --- a/src/devices/bus/hp9845_io/98035.h +++ b/src/devices/bus/hp9845_io/98035.h @@ -8,8 +8,8 @@ *********************************************************************/ -#ifndef MAME_BUS_HP_9845_IO_98035_H -#define MAME_BUS_HP_9845_IO_98035_H +#ifndef MAME_BUS_HP9845_IO_98035_H +#define MAME_BUS_HP9845_IO_98035_H #pragma once @@ -125,4 +125,4 @@ class hp98035_io_card_device : public device_t, public device_hp9845_io_interfac // device type definition DECLARE_DEVICE_TYPE(HP98035_IO_CARD, hp98035_io_card_device) -#endif // MAME_BUS_HP_9845_IO_98035_H +#endif // MAME_BUS_HP9845_IO_98035_H diff --git a/src/devices/bus/hp_dio/hp98265a.h b/src/devices/bus/hp_dio/hp98265a.h index f4be410e236..945777f4418 100644 --- a/src/devices/bus/hp_dio/hp98265a.h +++ b/src/devices/bus/hp_dio/hp98265a.h @@ -1,8 +1,8 @@ // license:BSD-3-Clause // copyright-holders:Sven Schnelle -#ifndef MAME_BUS_HPDIO_98265A_H -#define MAME_BUS_HPDIO_98265A_H +#ifndef MAME_BUS_HP_DIO_HP98265A_H +#define MAME_BUS_HP_DIO_HP98265A_H #pragma once @@ -10,4 +10,4 @@ DECLARE_DEVICE_TYPE_NS(HPDIO_98265A, bus::hp_dio, device_dio16_card_interface) -#endif // MAME_BUS_HPDIO_98265A_H +#endif // MAME_BUS_HP_DIO_HP98265A_H diff --git a/src/devices/bus/hp_dio/hp98543.h b/src/devices/bus/hp_dio/hp98543.h index edf7ccdb3be..2432380e5c3 100644 --- a/src/devices/bus/hp_dio/hp98543.h +++ b/src/devices/bus/hp_dio/hp98543.h @@ -1,8 +1,8 @@ // license:BSD-3-Clause // copyright-holders:Sven Schnelle -#ifndef MAME_BUS_HPDIO_98543_H -#define MAME_BUS_HPDIO_98543_H +#ifndef MAME_BUS_HP_DIO_HP98543_H +#define MAME_BUS_HP_DIO_HP98543_H #pragma once @@ -11,4 +11,4 @@ // device type definition DECLARE_DEVICE_TYPE_NS(HPDIO_98543, bus::hp_dio, device_dio16_card_interface) -#endif // MAME_BUS_HPDIO_98543_H +#endif // MAME_BUS_HP_DIO_HP98543_H diff --git a/src/devices/bus/hp_dio/hp98544.h b/src/devices/bus/hp_dio/hp98544.h index 63a41d4386e..3b1116e307a 100644 --- a/src/devices/bus/hp_dio/hp98544.h +++ b/src/devices/bus/hp_dio/hp98544.h @@ -1,7 +1,7 @@ // license:BSD-3-Clause // copyright-holders:R. Belmont -#ifndef MAME_BUS_HPDIO_98544_H -#define MAME_BUS_HPDIO_98544_H +#ifndef MAME_BUS_HP_DIO_HP98544_H +#define MAME_BUS_HP_DIO_HP98544_H #pragma once @@ -9,4 +9,4 @@ DECLARE_DEVICE_TYPE_NS(HPDIO_98544, bus::hp_dio, device_dio16_card_interface) -#endif // MAME_BUS_HPDIO_98544_H +#endif // MAME_BUS_HP_DIO_HP98544_H diff --git a/src/devices/bus/hp_dio/hp98550.h b/src/devices/bus/hp_dio/hp98550.h index 174a01a04d2..ca2e681fb02 100644 --- a/src/devices/bus/hp_dio/hp98550.h +++ b/src/devices/bus/hp_dio/hp98550.h @@ -1,8 +1,8 @@ // license:BSD-3-Clause // copyright-holders:Sven Schnelle -#ifndef MAME_BUS_HPDIO_98550_H -#define MAME_BUS_HPDIO_98550_H +#ifndef MAME_BUS_HP_DIO_HP98550_H +#define MAME_BUS_HP_DIO_HP98550_H #pragma once @@ -10,4 +10,4 @@ DECLARE_DEVICE_TYPE_NS(HPDIO_98550, bus::hp_dio, device_dio32_card_interface) -#endif // MAME_BUS_HPDIO_98550_H +#endif // MAME_BUS_HP_DIO_HP98550_H diff --git a/src/devices/bus/hp_dio/hp98603a.h b/src/devices/bus/hp_dio/hp98603a.h index e7f7efb40f4..c5573a287c8 100644 --- a/src/devices/bus/hp_dio/hp98603a.h +++ b/src/devices/bus/hp_dio/hp98603a.h @@ -1,8 +1,8 @@ // license:BSD-3-Clause // copyright-holders:Sven Schnelle -#ifndef MAME_BUS_HPDIO_98603A_H -#define MAME_BUS_HPDIO_98603A_H +#ifndef MAME_BUS_HP_DIO_HP98603A_H +#define MAME_BUS_HP_DIO_HP98603A_H #pragma once @@ -10,4 +10,4 @@ DECLARE_DEVICE_TYPE_NS(HPDIO_98603A, bus::hp_dio, device_dio16_card_interface) -#endif // MAME_BUS_HPDIO_98603A_H +#endif // MAME_BUS_HP_DIO_HP98603A_H diff --git a/src/devices/bus/hp_dio/hp98603b.h b/src/devices/bus/hp_dio/hp98603b.h index ade7c285e3e..e402eb9ca58 100644 --- a/src/devices/bus/hp_dio/hp98603b.h +++ b/src/devices/bus/hp_dio/hp98603b.h @@ -1,8 +1,8 @@ // license:BSD-3-Clause // copyright-holders:Sven Schnelle -#ifndef MAME_BUS_HPDIO_98603B_H -#define MAME_BUS_HPDIO_98603B_H +#ifndef MAME_BUS_HP_DIO_HP98603B_H +#define MAME_BUS_HP_DIO_HP98603B_H #pragma once @@ -10,4 +10,4 @@ DECLARE_DEVICE_TYPE_NS(HPDIO_98603B, bus::hp_dio, device_dio16_card_interface) -#endif // MAME_BUS_HPDIO_98603B_H +#endif // MAME_BUS_HP_DIO_HP98603B_H diff --git a/src/devices/bus/hp_dio/hp98620.h b/src/devices/bus/hp_dio/hp98620.h index 59b97b15131..887a1535ddf 100644 --- a/src/devices/bus/hp_dio/hp98620.h +++ b/src/devices/bus/hp_dio/hp98620.h @@ -1,8 +1,8 @@ // license:BSD-3-Clause // copyright-holders:Sven Schnelle -#ifndef MAME_BUS_HPDIO_98620_H -#define MAME_BUS_HPDIO_98620_H +#ifndef MAME_BUS_HP_DIO_HP98620_H +#define MAME_BUS_HP_DIO_HP98620_H #pragma once @@ -10,4 +10,4 @@ DECLARE_DEVICE_TYPE_NS(HPDIO_98620, bus::hp_dio, device_dio16_card_interface) -#endif // MAME_BUS_HPDIO_98620_H +#endif // MAME_BUS_HP_DIO_HP98620_H diff --git a/src/devices/bus/hp_dio/hp98624.h b/src/devices/bus/hp_dio/hp98624.h index bc419cd4337..71001500306 100644 --- a/src/devices/bus/hp_dio/hp98624.h +++ b/src/devices/bus/hp_dio/hp98624.h @@ -1,8 +1,8 @@ // license:BSD-3-Clause // copyright-holders:Sven Schnelle -#ifndef MAME_BUS_HPDIO_98624_H -#define MAME_BUS_HPDIO_98624_H +#ifndef MAME_BUS_HP_DIO_HP98624_H +#define MAME_BUS_HP_DIO_HP98624_H #pragma once @@ -10,4 +10,4 @@ DECLARE_DEVICE_TYPE_NS(HPDIO_98624, bus::hp_dio, device_dio16_card_interface) -#endif // MAME_BUS_HPDIO_98624_H +#endif // MAME_BUS_HP_DIO_HP98624_H diff --git a/src/devices/bus/hp_dio/hp98643.h b/src/devices/bus/hp_dio/hp98643.h index 58fdf8df71c..518ed54f9dc 100644 --- a/src/devices/bus/hp_dio/hp98643.h +++ b/src/devices/bus/hp_dio/hp98643.h @@ -1,8 +1,8 @@ // license:BSD-3-Clause // copyright-holders:Sven Schnelle -#ifndef MAME_BUS_HPDIO_98643_H -#define MAME_BUS_HPDIO_98643_H +#ifndef MAME_BUS_HP_DIO_HP98643_H +#define MAME_BUS_HP_DIO_HP98643_H #pragma once @@ -11,4 +11,4 @@ // device type definition DECLARE_DEVICE_TYPE_NS(HPDIO_98643, bus::hp_dio, device_dio16_card_interface) -#endif // MAME_BUS_HPDIO_98643_H +#endif // MAME_BUS_HP_DIO_HP98643_H diff --git a/src/devices/bus/hp_dio/hp98644.h b/src/devices/bus/hp_dio/hp98644.h index 848fb0ac09e..b8b3762c3b0 100644 --- a/src/devices/bus/hp_dio/hp98644.h +++ b/src/devices/bus/hp_dio/hp98644.h @@ -1,8 +1,8 @@ // license:BSD-3-Clause -// copyright-holders:R. Belmont +// copyright-holders:Sven Schnelle -#ifndef MAME_BUS_HPDIO_98644_H -#define MAME_BUS_HPDIO_98644_H +#ifndef MAME_BUS_HP_DIO_HP98644_H +#define MAME_BUS_HP_DIO_HP98644_H #pragma once @@ -11,4 +11,4 @@ // device type definition DECLARE_DEVICE_TYPE_NS(HPDIO_98644, bus::hp_dio, device_dio16_card_interface) -#endif // MAME_BUS_HPDIO_98644_H +#endif // MAME_BUS_HP_DIO_HP98644_H diff --git a/src/devices/bus/hp_dio/hp_dio.h b/src/devices/bus/hp_dio/hp_dio.h index af0db99ed14..2f86ae05e6a 100644 --- a/src/devices/bus/hp_dio/hp_dio.h +++ b/src/devices/bus/hp_dio/hp_dio.h @@ -12,8 +12,8 @@ ***************************************************************************/ -#ifndef MAME_BUS_HPDIO_HPDIO_H -#define MAME_BUS_HPDIO_HPDIO_H +#ifndef MAME_BUS_HP_DIO_HP_DIO_H +#define MAME_BUS_HP_DIO_HP_DIO_H #pragma once @@ -291,4 +291,4 @@ DECLARE_DEVICE_TYPE_NS(DIO16, bus::hp_dio, dio16_device) void dio16_cards(device_slot_interface &device); void dio32_cards(device_slot_interface &device); -#endif // MAME_BUS_HPDIO_HPDIO_H +#endif // MAME_BUS_HP_DIO_HP_DIO_H diff --git a/src/devices/bus/hp_dio/human_interface.h b/src/devices/bus/hp_dio/human_interface.h index b5bf0a21374..910e73b4039 100644 --- a/src/devices/bus/hp_dio/human_interface.h +++ b/src/devices/bus/hp_dio/human_interface.h @@ -1,8 +1,8 @@ // license:BSD-3-Clause // copyright-holders:Sven Schnelle -#ifndef MAME_BUS_HPDIO_HUMAN_INTERFACE_H -#define MAME_BUS_HPDIO_HUMAN_INTERFACE_H +#ifndef MAME_BUS_HP_DIO_HUMAN_INTERFACE_H +#define MAME_BUS_HP_DIO_HUMAN_INTERFACE_H #pragma once @@ -102,4 +102,4 @@ class human_interface_device : // device type definition DECLARE_DEVICE_TYPE_NS(HPDIO_HUMAN_INTERFACE, bus::hp_dio, human_interface_device) -#endif // MAME_BUS_HPDIO_HUMAN_INTERFACE_H +#endif // MAME_BUS_HP_DIO_HUMAN_INTERFACE_H diff --git a/src/devices/bus/hp_hil/hlebase.h b/src/devices/bus/hp_hil/hlebase.h index 978c548379e..16cedab8ab2 100644 --- a/src/devices/bus/hp_hil/hlebase.h +++ b/src/devices/bus/hp_hil/hlebase.h @@ -1,7 +1,7 @@ // license:BSD-3-Clause // copyright-holders:Sergey Svishchev -#ifndef MAME_DEVICES_HP_HIL_HLEBASE_H -#define MAME_DEVICES_HP_HIL_HLEBASE_H +#ifndef MAME_BUS_HP_HIL_HLEBASE_H +#define MAME_BUS_HP_HIL_HLEBASE_H #pragma once @@ -41,4 +41,4 @@ class hle_device_base } // namespace bus::hp_hil -#endif // MAME_DEVICES_HP_HIL_HLEBASE_H +#endif // MAME_BUS_HP_HIL_HLEBASE_H diff --git a/src/devices/bus/hp_hil/hlekbd.h b/src/devices/bus/hp_hil/hlekbd.h index cbdf8ac94be..921cf4bb757 100644 --- a/src/devices/bus/hp_hil/hlekbd.h +++ b/src/devices/bus/hp_hil/hlekbd.h @@ -1,7 +1,7 @@ // license:BSD-3-Clause // copyright-holders:Sergey Svishchev -#ifndef MAME_DEVICES_HP_HIL_HLEKBD_H -#define MAME_DEVICES_HP_HIL_HLEKBD_H +#ifndef MAME_BUS_HP_HIL_HLEKBD_H +#define MAME_BUS_HP_HIL_HLEKBD_H #pragma once @@ -70,4 +70,4 @@ class hle_hp_itf_device DECLARE_DEVICE_TYPE_NS(HP_IPC_HLE_KEYBOARD, bus::hp_hil, hle_hp_ipc_device); DECLARE_DEVICE_TYPE_NS(HP_ITF_HLE_KEYBOARD, bus::hp_hil, hle_hp_itf_device); -#endif // MAME_DEVICES_HP_HIL_HLEKBD_H +#endif // MAME_BUS_HP_HIL_HLEKBD_H diff --git a/src/devices/bus/hp_hil/hlemouse.h b/src/devices/bus/hp_hil/hlemouse.h index 14def7680bd..f8f4c019368 100644 --- a/src/devices/bus/hp_hil/hlemouse.h +++ b/src/devices/bus/hp_hil/hlemouse.h @@ -1,7 +1,7 @@ // license:BSD-3-Clause // copyright-holders:Sven Schnelle -#ifndef MAME_DEVICES_HP_HIL_HLEMOUSE_H -#define MAME_DEVICES_HP_HIL_HLEMOUSE_H +#ifndef MAME_BUS_HP_HIL_HLEMOUSE_H +#define MAME_BUS_HP_HIL_HLEMOUSE_H #pragma once @@ -47,4 +47,4 @@ class hle_hp_46060b_device DECLARE_DEVICE_TYPE_NS(HP_46060B_MOUSE, bus::hp_hil, hle_hp_46060b_device); -#endif // MAME_DEVICES_HP_HIL_HLEMOUSE_H +#endif // MAME_BUS_HP_HIL_HLEMOUSE_H diff --git a/src/devices/bus/ieee488/c8050.h b/src/devices/bus/ieee488/c8050.h index 11e6946e616..19ce2f03156 100644 --- a/src/devices/bus/ieee488/c8050.h +++ b/src/devices/bus/ieee488/c8050.h @@ -6,8 +6,8 @@ **********************************************************************/ -#ifndef MAME_BUS_IEE488_C8050_H -#define MAME_BUS_IEE488_C8050_H +#ifndef MAME_BUS_IEEE488_C8050_H +#define MAME_BUS_IEEE488_C8050_H #pragma once @@ -146,4 +146,4 @@ DECLARE_DEVICE_TYPE(C8250LP, c8250lp_device) DECLARE_DEVICE_TYPE(SFD1001, sfd1001_device) -#endif // MAME_BUS_IEE488_C8050_H +#endif // MAME_BUS_IEEE488_C8050_H diff --git a/src/devices/bus/interpro/keyboard/hle.h b/src/devices/bus/interpro/keyboard/hle.h index c175a2e1ec9..10953f9af0f 100644 --- a/src/devices/bus/interpro/keyboard/hle.h +++ b/src/devices/bus/interpro/keyboard/hle.h @@ -1,7 +1,7 @@ // license:BSD-3-Clause // copyright-holders:Patrick Mackinlay -#ifndef MAME_DEVICES_INTERPRO_KEYBOARD_HLE_H -#define MAME_DEVICES_INTERPRO_KEYBOARD_HLE_H +#ifndef MAME_BUS_INTERPRO_KEYBOARD_HLE_H +#define MAME_BUS_INTERPRO_KEYBOARD_HLE_H #pragma once @@ -118,4 +118,4 @@ class hle_en_us_device : public hle_device_base DECLARE_DEVICE_TYPE_NS(INTERPRO_HLE_EN_US_KEYBOARD, bus::interpro::keyboard, hle_en_us_device) -#endif // MAME_DEVICES_INTERPRO_KEYBOARD_HLE_H +#endif // MAME_BUS_INTERPRO_KEYBOARD_HLE_H diff --git a/src/devices/bus/interpro/keyboard/lle.h b/src/devices/bus/interpro/keyboard/lle.h index 69ff831700e..9bd869adbfa 100644 --- a/src/devices/bus/interpro/keyboard/lle.h +++ b/src/devices/bus/interpro/keyboard/lle.h @@ -1,7 +1,7 @@ // license:BSD-3-Clause // copyright-holders:Patrick Mackinlay -#ifndef MAME_DEVICES_INTERPRO_KEYBOARD_LLE_H -#define MAME_DEVICES_INTERPRO_KEYBOARD_LLE_H +#ifndef MAME_BUS_INTERPRO_KEYBOARD_LLE_H +#define MAME_BUS_INTERPRO_KEYBOARD_LLE_H #pragma once @@ -70,4 +70,4 @@ class lle_en_us_device : public lle_device_base DECLARE_DEVICE_TYPE_NS(INTERPRO_LLE_EN_US_KEYBOARD, bus::interpro::keyboard, lle_en_us_device) -#endif // MAME_DEVICES_INTERPRO_KEYBOARD_LLE_H +#endif // MAME_BUS_INTERPRO_KEYBOARD_LLE_H diff --git a/src/devices/bus/intv/voice.h b/src/devices/bus/intv/voice.h index b28dbac0154..937c28f0a89 100644 --- a/src/devices/bus/intv/voice.h +++ b/src/devices/bus/intv/voice.h @@ -1,10 +1,13 @@ // license:BSD-3-Clause // copyright-holders:Fabio Priuli -#ifndef __INTV_VOICE_H -#define __INTV_VOICE_H +#ifndef MAME_BUS_INTV_VOICE_H +#define MAME_BUS_INTV_VOICE_H + +#pragma once -#include "slot.h" #include "rom.h" +#include "slot.h" + #include "sound/sp0256.h" @@ -62,4 +65,4 @@ class intv_voice_device : public intv_rom_device // device type definition DECLARE_DEVICE_TYPE(INTV_ROM_VOICE, intv_voice_device) -#endif // MAME_BUS_INTV_SLOT_H +#endif // MAME_BUS_INTV_VOICE_H diff --git a/src/devices/bus/isa/aha1542c.h b/src/devices/bus/isa/aha1542c.h index 0760402e509..b3c1b556798 100644 --- a/src/devices/bus/isa/aha1542c.h +++ b/src/devices/bus/isa/aha1542c.h @@ -10,8 +10,8 @@ **********************************************************************/ -#ifndef MAME_BUS_AHA1542C_H -#define MAME_BUS_AHA1542C_H +#ifndef MAME_BUS_ISA_AHA1542C_H +#define MAME_BUS_ISA_AHA1542C_H #pragma once @@ -94,4 +94,4 @@ DECLARE_DEVICE_TYPE(AHA1542C, aha1542c_device) DECLARE_DEVICE_TYPE(AHA1542CF, aha1542cf_device) DECLARE_DEVICE_TYPE(AHA1542CP, aha1542cp_device) -#endif // MAME_BUS_AHA1542C_H +#endif // MAME_BUS_ISA_AHA1542C_H diff --git a/src/devices/bus/isa/lbaenhancer.h b/src/devices/bus/isa/lbaenhancer.h index 6612e1ea602..c025752ede2 100644 --- a/src/devices/bus/isa/lbaenhancer.h +++ b/src/devices/bus/isa/lbaenhancer.h @@ -6,8 +6,8 @@ **********************************************************************/ -#ifndef MAME_BUS_ISA_LBA_ENHANCER_H -#define MAME_BUS_ISA_LBA_ENHANCER_H +#ifndef MAME_BUS_ISA_LBAENHANCER_H +#define MAME_BUS_ISA_LBAENHANCER_H #pragma once @@ -41,4 +41,4 @@ class lba_enhancer_device : public device_t, // device type definition DECLARE_DEVICE_TYPE(ISA8_LBA_ENHANCER, lba_enhancer_device) -#endif // MAME_BUS_ISA_LBA_ENHANCER_H +#endif // MAME_BUS_ISA_LBAENHANCER_H diff --git a/src/devices/bus/isa/p1_sound.h b/src/devices/bus/isa/p1_sound.h index 17c4967a14c..54f84c07327 100644 --- a/src/devices/bus/isa/p1_sound.h +++ b/src/devices/bus/isa/p1_sound.h @@ -6,8 +6,8 @@ **********************************************************************/ -#ifndef MAME_BUS_P1_SOUND_H -#define MAME_BUS_P1_SOUND_H +#ifndef MAME_BUS_ISA_P1_SOUND_H +#define MAME_BUS_ISA_P1_SOUND_H #pragma once @@ -67,4 +67,4 @@ class p1_sound_device : public device_t, DECLARE_DEVICE_TYPE(P1_SOUND, p1_sound_device) -#endif // MAME_BUS_P1_SOUND_H +#endif // MAME_BUS_ISA_P1_SOUND_H diff --git a/src/devices/bus/isa/sb16.cpp b/src/devices/bus/isa/sb16.cpp index 16c759c951d..30d0a6f8950 100644 --- a/src/devices/bus/isa/sb16.cpp +++ b/src/devices/bus/isa/sb16.cpp @@ -163,12 +163,15 @@ void sb16_lle_device::ctrl8_w(uint8_t data) * bit3 - * bit4 - * bit5 - - * bit6 - ? + * bit6 - ? (wolf3d) * bit7 - toggle for 8bit irq */ if(data & 4) { m_dma8_cnt = m_dma8_len; + if (!(BIT(m_mode, 6))) + m_dma8_cnt >>= 1; + m_dma8_cnt ++; m_dma8_done = false; } if(!(data & 2) || !(m_ctrl16 & 2)) @@ -210,6 +213,9 @@ void sb16_lle_device::ctrl16_w(uint8_t data) if(data & 4) { m_dma16_cnt = m_dma16_len; + if (!(BIT(m_mode, 7))) + m_dma16_cnt >>= 1; + m_dma16_cnt ++; m_dma16_done = false; } if(!(data & 2) || !(m_ctrl8 & 2)) @@ -382,7 +388,7 @@ void sb16_lle_device::sb16_io(address_map &map) map(0x0004, 0x0004).mirror(0xff00).rw(FUNC(sb16_lle_device::mode_r), FUNC(sb16_lle_device::mode_w)); map(0x0005, 0x0005).mirror(0xff00).rw(FUNC(sb16_lle_device::dac_ctrl_r), FUNC(sb16_lle_device::dac_ctrl_w)); map(0x0006, 0x0006).mirror(0xff00).r(FUNC(sb16_lle_device::dma_stat_r)); -// map(0x0007, 0x0007) // unknown +// map(0x0007, 0x0007) // unknown, readback status of stereo f/f? map(0x0008, 0x0008).mirror(0xff00).rw(FUNC(sb16_lle_device::ctrl8_r), FUNC(sb16_lle_device::ctrl8_w)); map(0x0009, 0x0009).mirror(0xff00).w(FUNC(sb16_lle_device::rate_w)); map(0x000A, 0x000A).mirror(0xff00).r(FUNC(sb16_lle_device::dma8_cnt_lo_r)); @@ -496,7 +502,7 @@ uint8_t sb16_lle_device::dack_r(int line) return ret; } - ++m_adc_fifo_tail %= 16; + ++m_adc_fifo_tail %= FIFO_SIZE; if(m_adc_fifo_ctrl & 4) { @@ -504,7 +510,7 @@ uint8_t sb16_lle_device::dack_r(int line) return ret; } - if(m_adc_fifo_head == ((m_adc_fifo_tail + 1) % 16)) + if(m_adc_fifo_head == ((m_adc_fifo_tail + 1) % FIFO_SIZE)) m_isa->drq1_w(0); return ret; } @@ -539,7 +545,7 @@ void sb16_lle_device::dack_w(int line, uint8_t data) return; } - ++m_dac_fifo_head %= 16; + ++m_dac_fifo_head %= FIFO_SIZE; if(m_dac_fifo_ctrl & 4) { @@ -573,7 +579,7 @@ uint16_t sb16_lle_device::dack16_r(int line) m_isa->drq5_w(0); return ret; } - ++m_adc_fifo_tail %= 16; + ++m_adc_fifo_tail %= FIFO_SIZE; if(m_adc_fifo_ctrl & 4) { @@ -581,7 +587,7 @@ uint16_t sb16_lle_device::dack16_r(int line) return ret; } - if(m_adc_fifo_head == ((m_adc_fifo_tail + 1) % 16)) + if(m_adc_fifo_head == ((m_adc_fifo_tail + 1) % FIFO_SIZE)) m_isa->drq5_w(0); return ret; } @@ -608,7 +614,7 @@ void sb16_lle_device::dack16_w(int line, uint16_t data) m_isa->drq5_w(0); return; } - ++m_dac_fifo_head %= 16; + ++m_dac_fifo_head %= FIFO_SIZE; if(m_dac_fifo_ctrl & 4) { @@ -859,12 +865,12 @@ TIMER_CALLBACK_MEMBER(sb16_lle_device::timer_tick) m_isa->drq5_w(1); if((!(m_ctrl8 & 2) && !(m_mode & 1)) || (!(m_ctrl16 & 2) && (m_mode & 1))) - ++m_dac_fifo_tail %= 16; + ++m_dac_fifo_tail %= FIFO_SIZE; if((!(m_ctrl8 & 2) && (m_mode & 1)) || (!(m_ctrl16 & 2) && !(m_mode & 1))) { m_adc_fifo[m_adc_fifo_head].h[0] = adcl; m_adc_fifo[m_adc_fifo_head].h[1] = adcr; - ++m_adc_fifo_head %= 16; + ++m_adc_fifo_head %= FIFO_SIZE; } } diff --git a/src/devices/bus/isa/sb16.h b/src/devices/bus/isa/sb16.h index a54fe0ae489..9facc1e201e 100644 --- a/src/devices/bus/isa/sb16.h +++ b/src/devices/bus/isa/sb16.h @@ -108,7 +108,8 @@ class sb16_lle_device : public device_t, public device_isa16_card_interface uint16_t h[2]; uint8_t b[4]; } samples; - samples m_adc_fifo[16], m_dac_fifo[16]; + static constexpr int FIFO_SIZE = 16; + samples m_adc_fifo[FIFO_SIZE], m_dac_fifo[FIFO_SIZE]; int m_adc_fifo_head, m_adc_fifo_tail, m_dac_fifo_head, m_dac_fifo_tail; bool m_adc_r, m_dac_r, m_adc_h, m_dac_h, m_irq8, m_irq16, m_irq_midi; bool m_dma8_done, m_dma16_done; diff --git a/src/devices/bus/isa/wdxt_gen.h b/src/devices/bus/isa/wdxt_gen.h index d5ddffdfbc1..2c2f2ed24a2 100644 --- a/src/devices/bus/isa/wdxt_gen.h +++ b/src/devices/bus/isa/wdxt_gen.h @@ -13,8 +13,8 @@ **********************************************************************/ -#ifndef MAME_BUS_ISA8_WDXT_GEN_H -#define MAME_BUS_ISA8_WDXT_GEN_H +#ifndef MAME_BUS_ISA_WDXT_GEN_H +#define MAME_BUS_ISA_WDXT_GEN_H #pragma once @@ -82,4 +82,4 @@ class wdxt_gen_device : public device_t, // device type definition DECLARE_DEVICE_TYPE(ISA8_WDXT_GEN, wdxt_gen_device) -#endif // MAME_BUS_ISA8_WDXT_GEN_H +#endif // MAME_BUS_ISA_WDXT_GEN_H diff --git a/src/devices/bus/isbx/isbx.h b/src/devices/bus/isbx/isbx.h index 527474e4bbc..769d7bde8b7 100644 --- a/src/devices/bus/isbx/isbx.h +++ b/src/devices/bus/isbx/isbx.h @@ -31,8 +31,8 @@ **********************************************************************/ -#ifndef MAME_BUS_ISBX_ISBX_SLOT_H -#define MAME_BUS_ISBX_ISBX_SLOT_H +#ifndef MAME_BUS_ISBX_ISBX_H +#define MAME_BUS_ISBX_ISBX_H #pragma once @@ -131,4 +131,4 @@ DECLARE_DEVICE_TYPE(ISBX_SLOT, isbx_slot_device) void isbx_cards(device_slot_interface &device); -#endif // MAME_BUS_ISBX_ISBX_SLOT_H +#endif // MAME_BUS_ISBX_ISBX_H diff --git a/src/devices/bus/jvs/jvshle.h b/src/devices/bus/jvs/jvshle.h index 67f7b9fc859..1d3abfbd461 100644 --- a/src/devices/bus/jvs/jvshle.h +++ b/src/devices/bus/jvs/jvshle.h @@ -1,7 +1,7 @@ // license:BSD-3-Clause // copyright-holders:smf -#ifndef MAME_BUS_JVS_JVSDEV_H -#define MAME_BUS_JVS_JVSDEV_H +#ifndef MAME_BUS_JVS_JVSHLE_H +#define MAME_BUS_JVS_JVSHLE_H #pragma once @@ -172,4 +172,4 @@ class jvs_hle_device : uint8_t m_analog_output_channels; }; -#endif // MAME_BUS_JVS_JVSDEV_H +#endif // MAME_BUS_JVS_JVSHLE_H diff --git a/src/devices/bus/macpds/hyperdrive.h b/src/devices/bus/macpds/hyperdrive.h index a3ff16b2c4c..13580c73ced 100644 --- a/src/devices/bus/macpds/hyperdrive.h +++ b/src/devices/bus/macpds/hyperdrive.h @@ -1,7 +1,7 @@ // license:BSD-3-Clause // copyright-holders:R. Belmont -#ifndef MAME_BUS_PDS_HYPERDRIVE_H -#define MAME_BUS_PDS_HYPERDRIVE_H +#ifndef MAME_BUS_MACPDS_HYPERDRIVE_H +#define MAME_BUS_MACPDS_HYPERDRIVE_H #pragma once @@ -50,4 +50,4 @@ class macpds_hyperdrive_device : // device type definition DECLARE_DEVICE_TYPE(PDS_HYPERDRIVE, macpds_hyperdrive_device) -#endif // MAME_BUS_PDS_TPDFPD_H +#endif // MAME_BUS_MACPDS_HYPERDRIVE_H diff --git a/src/devices/bus/macpds/pds_tpdfpd.h b/src/devices/bus/macpds/pds_tpdfpd.h index 048c7057c90..26fef74fb3a 100644 --- a/src/devices/bus/macpds/pds_tpdfpd.h +++ b/src/devices/bus/macpds/pds_tpdfpd.h @@ -1,7 +1,7 @@ // license:BSD-3-Clause // copyright-holders:R. Belmont -#ifndef MAME_BUS_PDS_TPDFPD_H -#define MAME_BUS_PDS_TPDFPD_H +#ifndef MAME_BUS_MACPDS_PDS_TPDFPD_H +#define MAME_BUS_MACPDS_PDS_TPDFPD_H #pragma once @@ -53,4 +53,4 @@ class macpds_sedisplay_device : // device type definition DECLARE_DEVICE_TYPE(PDS_SEDISPLAY, macpds_sedisplay_device) -#endif // MAME_BUS_PDS_TPDFPD_H +#endif // MAME_BUS_MACPDS_PDS_TPDFPD_H diff --git a/src/devices/bus/mc10/mc10_cart.h b/src/devices/bus/mc10/mc10_cart.h index e726647bdd0..9f9116e3a9e 100644 --- a/src/devices/bus/mc10/mc10_cart.h +++ b/src/devices/bus/mc10/mc10_cart.h @@ -8,8 +8,8 @@ *********************************************************************/ -#ifndef MAME_BUS_MC10_MC10CART_H -#define MAME_BUS_MC10_MC10CART_H +#ifndef MAME_BUS_MC10_MC10_CART_H +#define MAME_BUS_MC10_MC10_CART_H #pragma once @@ -107,4 +107,4 @@ void mc10_cart_add_basic_devices(device_slot_interface &device); void alice_cart_add_basic_devices(device_slot_interface &device); void alice32_cart_add_basic_devices(device_slot_interface &device); -#endif // MAME_BUS_MC10_MC10CART_H +#endif // MAME_BUS_MC10_MC10_CART_H diff --git a/src/devices/bus/mc10/mcx128.h b/src/devices/bus/mc10/mcx128.h index 865809f94f8..a4c936a3d78 100644 --- a/src/devices/bus/mc10/mcx128.h +++ b/src/devices/bus/mc10/mcx128.h @@ -1,7 +1,7 @@ // license:BSD-3-Clause // copyright-holders:tim lindner -#ifndef MAME_BUS_MC10_MC10_MCX128_H -#define MAME_BUS_MC10_MC10_MCX128_H +#ifndef MAME_BUS_MC10_MCX128_H +#define MAME_BUS_MC10_MCX128_H #pragma once @@ -10,5 +10,5 @@ // device type definition DECLARE_DEVICE_TYPE(MC10_PAK_MCX128, device_mc10cart_interface) -#endif // MAME_BUS_MC10_MC10_MCX128_H +#endif // MAME_BUS_MC10_MCX128_H diff --git a/src/devices/bus/mc10/pak.h b/src/devices/bus/mc10/pak.h index 74bb66b140d..073e7ec6b85 100644 --- a/src/devices/bus/mc10/pak.h +++ b/src/devices/bus/mc10/pak.h @@ -1,7 +1,7 @@ // license:BSD-3-Clause // copyright-holders:tim lindner -#ifndef MAME_BUS_MC10_MC10_PAK_H -#define MAME_BUS_MC10_MC10_PAK_H +#ifndef MAME_BUS_MC10_PAK_H +#define MAME_BUS_MC10_PAK_H #pragma once @@ -9,4 +9,4 @@ DECLARE_DEVICE_TYPE(MC10_PAK, device_mc10cart_interface) -#endif // MAME_BUS_MC10_MC10_PAK_H +#endif // MAME_BUS_MC10_PAK_H diff --git a/src/devices/bus/mc10/ram.h b/src/devices/bus/mc10/ram.h index e32530f81e6..efe89fd3370 100644 --- a/src/devices/bus/mc10/ram.h +++ b/src/devices/bus/mc10/ram.h @@ -1,7 +1,7 @@ // license:BSD-3-Clause // copyright-holders:tim lindner -#ifndef MAME_BUS_MC10_MC10_RAM_H -#define MAME_BUS_MC10_MC10_RAM_H +#ifndef MAME_BUS_MC10_RAM_H +#define MAME_BUS_MC10_RAM_H #pragma once @@ -10,5 +10,5 @@ // device type definition DECLARE_DEVICE_TYPE(MC10_PAK_RAM, device_mc10cart_interface) -#endif // MAME_BUS_MC10_MC10_RAM_H +#endif // MAME_BUS_MC10_RAM_H diff --git a/src/devices/bus/msx/cart/easi_speech.h b/src/devices/bus/msx/cart/easi_speech.h index 2403603c02a..ddb959e04bb 100644 --- a/src/devices/bus/msx/cart/easi_speech.h +++ b/src/devices/bus/msx/cart/easi_speech.h @@ -1,7 +1,7 @@ // license:BSD-3-Clause // copyright-holders:hap -#ifndef MAME_BUS_MSX_CART_EASISPEECH_H -#define MAME_BUS_MSX_CART_EASISPEECH_H +#ifndef MAME_BUS_MSX_CART_EASI_SPEECH_H +#define MAME_BUS_MSX_CART_EASI_SPEECH_H #pragma once @@ -10,4 +10,4 @@ DECLARE_DEVICE_TYPE(MSX_CART_EASISPEECH, msx_cart_interface) -#endif // MAME_BUS_MSX_CART_EASISPEECH_H +#endif // MAME_BUS_MSX_CART_EASI_SPEECH_H diff --git a/src/devices/bus/mtu130/board.h b/src/devices/bus/mtu130/board.h index 2cf3e83e515..a7b09bebeeb 100644 --- a/src/devices/bus/mtu130/board.h +++ b/src/devices/bus/mtu130/board.h @@ -3,8 +3,8 @@ // MTU-130 extension board -#ifndef MAME_BUS_MTU130_EXTENSION_H -#define MAME_BUS_MTU130_EXTENSION_H +#ifndef MAME_BUS_MTU130_BOARD_H +#define MAME_BUS_MTU130_BOARD_H #include "machine/input_merger.h" @@ -66,4 +66,4 @@ class mtu130_extension_device : public device_t, public device_single_card_slot_ DECLARE_DEVICE_TYPE(MTU130_EXTENSION, mtu130_extension_device) -#endif +#endif // MAME_BUS_MTU130_BOARD_H diff --git a/src/devices/bus/mtx/sdx.h b/src/devices/bus/mtx/sdx.h index e55de584f1d..4e7183d9565 100644 --- a/src/devices/bus/mtx/sdx.h +++ b/src/devices/bus/mtx/sdx.h @@ -6,8 +6,8 @@ **********************************************************************/ -#ifndef MAME_BUS_MTX_EXP_SDX_H -#define MAME_BUS_MTX_EXP_SDX_H +#ifndef MAME_BUS_MTX_SDX_H +#define MAME_BUS_MTX_SDX_H #include "exp.h" #include "imagedev/floppy.h" @@ -97,5 +97,4 @@ class mtx_sdxcpm_device : public mtx_sdx_device DECLARE_DEVICE_TYPE(MTX_SDXBAS, mtx_sdxbas_device) DECLARE_DEVICE_TYPE(MTX_SDXCPM, mtx_sdxcpm_device) - -#endif // MAME_BUS_MTX_EXP_SDX_H +#endif // MAME_BUS_MTX_SDX_H diff --git a/src/devices/bus/nes_ctrl/bandaihs.h b/src/devices/bus/nes_ctrl/bandaihs.h index 169b9eaa5e1..ebe5615292d 100644 --- a/src/devices/bus/nes_ctrl/bandaihs.h +++ b/src/devices/bus/nes_ctrl/bandaihs.h @@ -6,8 +6,8 @@ **********************************************************************/ -#ifndef MAME_BUS_NES_CTRL_BANDAIHS -#define MAME_BUS_NES_CTRL_BANDAIHS +#ifndef MAME_BUS_NES_CTRL_BANDAIHS_H +#define MAME_BUS_NES_CTRL_BANDAIHS_H #pragma once @@ -50,4 +50,4 @@ class nes_bandaihs_device : public device_t, // device type definition DECLARE_DEVICE_TYPE(NES_BANDAIHS, nes_bandaihs_device) -#endif // MAME_BUS_NES_CTRL_BANDAIHS +#endif // MAME_BUS_NES_CTRL_BANDAIHS_H diff --git a/src/devices/bus/nes_ctrl/fckeybrd.h b/src/devices/bus/nes_ctrl/fckeybrd.h index 0260c5386db..623c7022d09 100644 --- a/src/devices/bus/nes_ctrl/fckeybrd.h +++ b/src/devices/bus/nes_ctrl/fckeybrd.h @@ -6,8 +6,8 @@ **********************************************************************/ -#ifndef MAME_BUS_NES_CTRL_FCKEYBOARD_H -#define MAME_BUS_NES_CTRL_FCKEYBOARD_H +#ifndef MAME_BUS_NES_CTRL_FCKEYBRD_H +#define MAME_BUS_NES_CTRL_FCKEYBRD_H #pragma once @@ -48,4 +48,4 @@ class nes_fckeybrd_device : public device_t, // device type definition DECLARE_DEVICE_TYPE(NES_FCKEYBOARD, nes_fckeybrd_device) -#endif // MAME_BUS_NES_CTRL_FCKEYBOARD_H +#endif // MAME_BUS_NES_CTRL_FCKEYBRD_H diff --git a/src/devices/bus/nes_ctrl/rob.h b/src/devices/bus/nes_ctrl/rob.h index 36d46dd65ab..445cb5292e2 100644 --- a/src/devices/bus/nes_ctrl/rob.h +++ b/src/devices/bus/nes_ctrl/rob.h @@ -6,8 +6,8 @@ **********************************************************************/ -#ifndef MAME_BUS_NES_CTRL_ROB -#define MAME_BUS_NES_CTRL_ROB +#ifndef MAME_BUS_NES_CTRL_ROB_H +#define MAME_BUS_NES_CTRL_ROB_H #pragma once @@ -51,4 +51,4 @@ class nes_rob_device : public device_t, // device type definition DECLARE_DEVICE_TYPE(NES_ROB, nes_rob_device) -#endif // MAME_BUS_NES_CTRL_ROB +#endif // MAME_BUS_NES_CTRL_ROB_H diff --git a/src/devices/bus/nes_ctrl/zapper.h b/src/devices/bus/nes_ctrl/zapper.h index e22a4001551..f7ec17b7401 100644 --- a/src/devices/bus/nes_ctrl/zapper.h +++ b/src/devices/bus/nes_ctrl/zapper.h @@ -6,8 +6,8 @@ **********************************************************************/ -#ifndef MAME_BUS_NES_CTRL_ZAPPER -#define MAME_BUS_NES_CTRL_ZAPPER +#ifndef MAME_BUS_NES_CTRL_ZAPPER_H +#define MAME_BUS_NES_CTRL_ZAPPER_H #pragma once @@ -50,4 +50,4 @@ class nes_zapper_device : public device_t, // device type definition DECLARE_DEVICE_TYPE(NES_ZAPPER, nes_zapper_device) -#endif // MAME_BUS_NES_CTRL_ZAPPER +#endif // MAME_BUS_NES_CTRL_ZAPPER_H diff --git a/src/devices/bus/nes_ctrl/zapper_sensor.h b/src/devices/bus/nes_ctrl/zapper_sensor.h index f63a38e6b01..0f556e27a34 100644 --- a/src/devices/bus/nes_ctrl/zapper_sensor.h +++ b/src/devices/bus/nes_ctrl/zapper_sensor.h @@ -7,8 +7,8 @@ **********************************************************************/ -#ifndef MAME_BUS_NES_CTRL_ZAPPER_SENSOR -#define MAME_BUS_NES_CTRL_ZAPPER_SENSOR +#ifndef MAME_BUS_NES_CTRL_ZAPPER_SENSOR_H +#define MAME_BUS_NES_CTRL_ZAPPER_SENSOR_H #pragma once @@ -50,4 +50,4 @@ class nes_zapper_sensor_device : public device_t // device type definition DECLARE_DEVICE_TYPE(NES_ZAPPER_SENSOR, nes_zapper_sensor_device) -#endif // MAME_BUS_NES_CTRL_ZAPPER_SENSOR +#endif // MAME_BUS_NES_CTRL_ZAPPER_SENSOR_H diff --git a/src/devices/bus/nscsi/cw7501.h b/src/devices/bus/nscsi/cw7501.h index 17a41900704..db1d3f42c69 100644 --- a/src/devices/bus/nscsi/cw7501.h +++ b/src/devices/bus/nscsi/cw7501.h @@ -1,8 +1,8 @@ // license:BSD-3-Clause // copyright-holders:AJR -#ifndef MAME_BUS_NSCSI_CW7501 -#define MAME_BUS_NSCSI_CW7501 1 +#ifndef MAME_BUS_NSCSI_CW7501_H +#define MAME_BUS_NSCSI_CW7501_H #pragma once @@ -49,4 +49,4 @@ class cdr4210_device : public cw7501_device DECLARE_DEVICE_TYPE(CW7501, cw7501_device) DECLARE_DEVICE_TYPE(CDR4210, cdr4210_device) -#endif // MAME_BUS_NSCSI_CW7501 +#endif // MAME_BUS_NSCSI_CW7501_H diff --git a/src/devices/bus/nscsi/hd.cpp b/src/devices/bus/nscsi/hd.cpp index 8e210e22d10..fe5fc45127b 100644 --- a/src/devices/bus/nscsi/hd.cpp +++ b/src/devices/bus/nscsi/hd.cpp @@ -245,7 +245,7 @@ void nscsi_harddisk_device::scsi_command() case 0x01: // read-write error recovery page scsi_cmdbuf[pos++] = 0x01; // !PS, page id scsi_cmdbuf[pos++] = 0x0a; // page length - scsi_cmdbuf[pos++] = 0; // various bits + scsi_cmdbuf[pos++] = 0x26; // various bits scsi_cmdbuf[pos++] = 0; // read retry count scsi_cmdbuf[pos++] = 0; // correction span scsi_cmdbuf[pos++] = 0; // head offset count @@ -384,7 +384,7 @@ void nscsi_harddisk_device::scsi_command() } if (!fail) { - scsi_cmdbuf[0] = pos; + scsi_cmdbuf[0] = pos - 1; if (pos > size) pos = size; @@ -444,6 +444,11 @@ void nscsi_harddisk_device::scsi_command() break; } + case SC_SYNCHRONIZE_CACHE: + LOG("command SYNCHRONIZE CACHE (10)\n"); + scsi_status_complete(SS_GOOD); + break; + case SC_READ_CAPACITY: { LOG("command READ CAPACITY\n"); diff --git a/src/devices/bus/nscsi/s1410.h b/src/devices/bus/nscsi/s1410.h index 36ff2f5161b..a7f69e9cd94 100644 --- a/src/devices/bus/nscsi/s1410.h +++ b/src/devices/bus/nscsi/s1410.h @@ -1,7 +1,7 @@ // license:BSD-3-Clause // copyright-holders:Olivier Galibert -#ifndef MAME_MACHINE_NSCSI_S1410_H -#define MAME_MACHINE_NSCSI_S1410_H +#ifndef MAME_BUS_NSCSI_S1410_H +#define MAME_BUS_NSCSI_S1410_H #pragma once diff --git a/src/devices/bus/nubus/8lc.h b/src/devices/bus/nubus/8lc.h index afbb9523433..b43bc4e7583 100644 --- a/src/devices/bus/nubus/8lc.h +++ b/src/devices/bus/nubus/8lc.h @@ -1,7 +1,7 @@ // license:BSD-3-Clause // copyright-holders:R. Belmont -#ifndef MAME_BUS_NUBUS_COLORVUE8LC_H -#define MAME_BUS_NUBUS_COLORVUE8LC_H +#ifndef MAME_BUS_NUBUS_8LC_H +#define MAME_BUS_NUBUS_8LC_H #pragma once @@ -9,4 +9,4 @@ DECLARE_DEVICE_TYPE(PDSLC_COLORVUE8LC, device_nubus_card_interface) -#endif // MAME_BUS_NUBUS_COLORVUE8LC_H +#endif // MAME_BUS_NUBUS_8LC_H diff --git a/src/devices/bus/nubus/nubus_vikbw.h b/src/devices/bus/nubus/nubus_vikbw.h index 4e4bc038cc8..099bd9ea08d 100644 --- a/src/devices/bus/nubus/nubus_vikbw.h +++ b/src/devices/bus/nubus/nubus_vikbw.h @@ -1,7 +1,7 @@ // license:BSD-3-Clause // copyright-holders:R. Belmont -#ifndef MAME_BUS_NUBUS_VIKBW_H -#define MAME_BUS_NUBUS_VIKBW_H +#ifndef MAME_BUS_NUBUS_NUBUS_VIKBW_H +#define MAME_BUS_NUBUS_NUBUS_VIKBW_H #pragma once @@ -9,4 +9,4 @@ DECLARE_DEVICE_TYPE(NUBUS_VIKBW, device_nubus_card_interface) -#endif // MAME_BUS_NUBUS_VIKBW_H +#endif // MAME_BUS_NUBUS_NUBUS_VIKBW_H diff --git a/src/devices/bus/nubus/nubus_wsportrait.h b/src/devices/bus/nubus/nubus_wsportrait.h index 3b3546eb721..a0bf6011aa1 100644 --- a/src/devices/bus/nubus/nubus_wsportrait.h +++ b/src/devices/bus/nubus/nubus_wsportrait.h @@ -1,7 +1,7 @@ // license:BSD-3-Clause // copyright-holders:R. Belmont -#ifndef MAME_BUS_NUBUS_WSPORTRAIT_H -#define MAME_BUS_NUBUS_WSPORTRAIT_H +#ifndef MAME_BUS_NUBUS_NUBUS_WSPORTRAIT_H +#define MAME_BUS_NUBUS_NUBUS_WSPORTRAIT_H #pragma once @@ -9,4 +9,4 @@ DECLARE_DEVICE_TYPE(NUBUS_WSPORTRAIT, device_nubus_card_interface) -#endif // MAME_BUS_NUBUS_WSPORTRAIT_H +#endif // MAME_BUS_NUBUS_NUBUS_WSPORTRAIT_H diff --git a/src/devices/bus/nubus/thunder4gx.h b/src/devices/bus/nubus/thunder4gx.h index 625238c0907..e211abb9b6e 100644 --- a/src/devices/bus/nubus/thunder4gx.h +++ b/src/devices/bus/nubus/thunder4gx.h @@ -1,7 +1,7 @@ // license:BSD-3-Clause // copyright-holders:R. Belmont -#ifndef MAME_BUS_NUBUS_THUNDER_4_GX_H -#define MAME_BUS_NUBUS_THUNDER_4_GX_H +#ifndef MAME_BUS_NUBUS_THUNDER4GX_H +#define MAME_BUS_NUBUS_THUNDER4GX_H #pragma once @@ -9,4 +9,4 @@ DECLARE_DEVICE_TYPE(NUBUS_THUNDERIVGX, device_nubus_card_interface) -#endif // MAME_BUS_NUBUS_THUNDER_4_GX_H +#endif // MAME_BUS_NUBUS_THUNDER4GX_H diff --git a/src/devices/bus/pc8801/pc8801_23.h b/src/devices/bus/pc8801/pc8801_23.h index b0bf65ae8ab..385a2080b54 100644 --- a/src/devices/bus/pc8801/pc8801_23.h +++ b/src/devices/bus/pc8801/pc8801_23.h @@ -1,8 +1,8 @@ // license:BSD-3-Clause // copyright-holders:Angelo Salese -#ifndef MAME_BUS_PC8801_23_H -#define MAME_BUS_PC8801_23_H +#ifndef MAME_BUS_PC8801_PC8801_23_H +#define MAME_BUS_PC8801_PC8801_23_H #pragma once @@ -39,5 +39,4 @@ class pc8801_23_device : public pc8801_exp_device DECLARE_DEVICE_TYPE(PC8801_23, pc8801_23_device) - -#endif // MAME_BUS_PC8801_23_H +#endif // MAME_BUS_PC8801_PC8801_23_H diff --git a/src/devices/bus/pc8801/pc8801_31.h b/src/devices/bus/pc8801/pc8801_31.h index aea5614943c..cc68677ca6d 100644 --- a/src/devices/bus/pc8801/pc8801_31.h +++ b/src/devices/bus/pc8801/pc8801_31.h @@ -6,8 +6,8 @@ **************************************************************************************************/ -#ifndef MAME_BUS_PC8801_31_H -#define MAME_BUS_PC8801_31_H +#ifndef MAME_BUS_PC8801_PC8801_31_H +#define MAME_BUS_PC8801_PC8801_31_H #pragma once @@ -63,4 +63,4 @@ class pc8801_31_device : public device_t // device type definition DECLARE_DEVICE_TYPE(PC8801_31, pc8801_31_device) -#endif // MAME_BUS_PC8801_31_H +#endif // MAME_BUS_PC8801_PC8801_31_H diff --git a/src/devices/bus/pc8801/pc8801_exp.h b/src/devices/bus/pc8801/pc8801_exp.h index 8305c68522f..b393fc8c40a 100644 --- a/src/devices/bus/pc8801/pc8801_exp.h +++ b/src/devices/bus/pc8801/pc8801_exp.h @@ -1,8 +1,8 @@ // license:BSD-3-Clause // copyright-holders:Angelo Salese -#ifndef MAME_BUS_PC8801_EXP_H -#define MAME_BUS_PC8801_EXP_H +#ifndef MAME_BUS_PC8801_PC8801_EXP_H +#define MAME_BUS_PC8801_PC8801_EXP_H #pragma once @@ -91,4 +91,4 @@ DECLARE_DEVICE_TYPE(PC8801_EXP_SLOT, pc8801_exp_slot_device) void pc8801_exp_devices(device_slot_interface &device); -#endif // MAME_MACHINE_PC8801_EXP_H +#endif // MAME_MACHINE_PC8801_PC8801_EXP_H diff --git a/src/devices/bus/pc_joy/pc_joy_magnum6.h b/src/devices/bus/pc_joy/pc_joy_magnum6.h index ab7daf41701..c6af086819b 100644 --- a/src/devices/bus/pc_joy/pc_joy_magnum6.h +++ b/src/devices/bus/pc_joy/pc_joy_magnum6.h @@ -1,8 +1,8 @@ // license:BSD-3-Clause // copyright-holders:Angelo Salese -#ifndef MAME_BUS_PC_JOY_MAGNUM6_H -#define MAME_BUS_PC_JOY_MAGNUM6_H +#ifndef MAME_BUS_PC_JOY_PC_JOY_MAGNUM6_H +#define MAME_BUS_PC_JOY_PC_JOY_MAGNUM6_H #include "pc_joy.h" @@ -21,4 +21,4 @@ class pc_joy_magnum6_device : public pc_basic_joy_device DECLARE_DEVICE_TYPE(PC_MAGNUM6_PAD, pc_joy_magnum6_device) -#endif // MAME_BUS_PC_JOY_MAGNUM6_H +#endif // MAME_BUS_PC_JOY_PC_JOY_MAGNUM6_H diff --git a/src/devices/bus/pc_kbd/hle_mouse.h b/src/devices/bus/pc_kbd/hle_mouse.h index 1a5d91273d7..6d90cf80d05 100644 --- a/src/devices/bus/pc_kbd/hle_mouse.h +++ b/src/devices/bus/pc_kbd/hle_mouse.h @@ -1,8 +1,8 @@ // license:BSD-3-Clause // copyright-holders:Patrick Mackinlay -#ifndef MAME_BUS_HLE_PS2_MOUSE_H -#define MAME_BUS_HLE_PS2_MOUSE_H +#ifndef MAME_BUS_PC_KBD_HLE_MOUSE_H +#define MAME_BUS_PC_KBD_HLE_MOUSE_H #pragma once @@ -95,4 +95,4 @@ class hle_ps2_mouse_device // device type definition DECLARE_DEVICE_TYPE(HLE_PS2_MOUSE, hle_ps2_mouse_device) -#endif // MAME_BUS_HLE_PS2_MOUSE_H +#endif // MAME_BUS_PC_KBD_HLE_MOUSE_H diff --git a/src/devices/bus/pc_kbd/msnat.h b/src/devices/bus/pc_kbd/msnat.h index acf98030ddf..ee339b1772b 100644 --- a/src/devices/bus/pc_kbd/msnat.h +++ b/src/devices/bus/pc_kbd/msnat.h @@ -6,8 +6,8 @@ ***************************************************************************/ -#ifndef MAME_BUS_PC_KB_MSNAT_H -#define MAME_BUS_PC_KB_MSNAT_H +#ifndef MAME_BUS_PC_KBD_MSNAT_H +#define MAME_BUS_PC_KBD_MSNAT_H #pragma once @@ -61,4 +61,4 @@ class pc_kbd_microsoft_natural_device : public device_t, // device type definition DECLARE_DEVICE_TYPE(PC_KBD_MICROSOFT_NATURAL, pc_kbd_microsoft_natural_device) -#endif // MAME_BUS_PC_KB_MSNAT_H +#endif // MAME_BUS_PC_KBD_MSNAT_H diff --git a/src/devices/bus/pccard/ataflash.h b/src/devices/bus/pccard/ataflash.h index 16000d88e88..02e82378a28 100644 --- a/src/devices/bus/pccard/ataflash.h +++ b/src/devices/bus/pccard/ataflash.h @@ -1,7 +1,7 @@ // license:BSD-3-Clause // copyright-holders:smf -#ifndef MAME_MACHINE_ATAFLASH_H -#define MAME_MACHINE_ATAFLASH_H +#ifndef MAME_BUS_PCCARD_ATAFLASH_H +#define MAME_BUS_PCCARD_ATAFLASH_H #pragma once @@ -101,4 +101,4 @@ DECLARE_DEVICE_TYPE(TAITO_PCCARD2, taito_pccard2_device) DECLARE_DEVICE_TYPE(TAITO_COMPACT_FLASH, taito_compact_flash_device) DECLARE_DEVICE_TYPE(ATA_FLASH_PCCARD, ata_flash_pccard_device) -#endif // MAME_MACHINE_ATAFLASH_H +#endif // MAME_BUS_PCCARD_ATAFLASH_H diff --git a/src/devices/bus/pccard/konami_dual.h b/src/devices/bus/pccard/konami_dual.h index aefe97ac553..c364aee57a2 100644 --- a/src/devices/bus/pccard/konami_dual.h +++ b/src/devices/bus/pccard/konami_dual.h @@ -1,7 +1,7 @@ // license:GPL-2.0+ // copyright-holders:smf -#ifndef MAME_BUS_PCCARD_KONAMI_DUAL_PCCARD_H -#define MAME_BUS_PCCARD_KONAMI_DUAL_PCCARD_H +#ifndef MAME_BUS_PCCARD_KONAMI_DUAL_H +#define MAME_BUS_PCCARD_KONAMI_DUAL_H #pragma once @@ -27,4 +27,4 @@ class konami_dual_pccard_device : DECLARE_DEVICE_TYPE(KONAMI_DUAL_PCCARD, konami_dual_pccard_device) -#endif // MAME_BUS_PCCARD_KONAMI_DUAL_PCCARD_H +#endif // MAME_BUS_PCCARD_KONAMI_DUAL_H diff --git a/src/devices/bus/pci/ncr53c825.h b/src/devices/bus/pci/ncr53c825.h index 694c101d261..fe363ca22c5 100644 --- a/src/devices/bus/pci/ncr53c825.h +++ b/src/devices/bus/pci/ncr53c825.h @@ -1,8 +1,8 @@ // license:BSD-3-Clause // copyright-holders: -#ifndef MAME_BUS_PCI_NCR53C825_PCI_H -#define MAME_BUS_PCI_NCR53C825_PCI_H +#ifndef MAME_BUS_PCI_NCR53C825_H +#define MAME_BUS_PCI_NCR53C825_H #pragma once @@ -36,4 +36,4 @@ class ncr53c825_pci_device : public pci_card_device DECLARE_DEVICE_TYPE(NCR53C825_PCI, ncr53c825_pci_device) -#endif // MAME_BUS_PCI_NCR53C825_PCI_H +#endif // MAME_BUS_PCI_NCR53C825_H diff --git a/src/devices/bus/pci/neon250.h b/src/devices/bus/pci/neon250.h index 41f5162ce8d..286f25a4343 100644 --- a/src/devices/bus/pci/neon250.h +++ b/src/devices/bus/pci/neon250.h @@ -1,8 +1,7 @@ // license:BSD-3-Clause // copyright-holders: - -#ifndef MAME_VIDEO_NEON250_H -#define MAME_VIDEO_NEON250_H +#ifndef MAME_BUS_PCI_NEON250_H +#define MAME_BUS_PCI_NEON250_H #pragma once @@ -51,4 +50,4 @@ class neon250_device : public pci_card_device DECLARE_DEVICE_TYPE(NEON250, neon250_device) -#endif // MAME_VIDEO_NEON250_H +#endif // MAME_BUS_PCI_NEON250_H diff --git a/src/devices/bus/pci/oti_spitfire.h b/src/devices/bus/pci/oti_spitfire.h index 11a1620cb1b..5494f9701c3 100644 --- a/src/devices/bus/pci/oti_spitfire.h +++ b/src/devices/bus/pci/oti_spitfire.h @@ -1,8 +1,7 @@ // license:BSD-3-Clause // copyright-holders:Angelo Salese - -#ifndef MAME_BUS_PCI_OTI_SPITFIRE_PCI_H -#define MAME_BUS_PCI_OTI_SPITFIRE_PCI_H +#ifndef MAME_BUS_PCI_OTI_SPITFIRE_H +#define MAME_BUS_PCI_OTI_SPITFIRE_H #pragma once @@ -45,4 +44,4 @@ class oti64111_pci_device : public pci_card_device DECLARE_DEVICE_TYPE(OTI64111_PCI, oti64111_pci_device) -#endif // MAME_BUS_PCI_OTI_SPITFIRE_PCI_H +#endif // MAME_BUS_PCI_OTI_SPITFIRE_H diff --git a/src/devices/bus/pci/rivatnt.h b/src/devices/bus/pci/rivatnt.h index a23393ad29a..be68c9f7bb6 100644 --- a/src/devices/bus/pci/rivatnt.h +++ b/src/devices/bus/pci/rivatnt.h @@ -1,8 +1,7 @@ // license:BSD-3-Clause // copyright-holders: Angelo Salese - -#ifndef MAME_BUS_VIDEO_RIVATNT_H -#define MAME_BUS_VIDEO_RIVATNT_H +#ifndef MAME_BUS_PCI_RIVATNT_H +#define MAME_BUS_PCI_RIVATNT_H #pragma once @@ -69,5 +68,4 @@ DECLARE_DEVICE_TYPE(RIVATNT2_ULTRA, rivatnt2_ultra_device) DECLARE_DEVICE_TYPE(VANTA, vanta_device) DECLARE_DEVICE_TYPE(RIVATNT2_M64, rivatnt2_model64_device) - -#endif +#endif // MAME_BUS_PCI_RIVATNT_H diff --git a/src/devices/bus/pci/rtl8139_pci.h b/src/devices/bus/pci/rtl8139_pci.h index 5e9220cdee7..bef9d7aeb8c 100644 --- a/src/devices/bus/pci/rtl8139_pci.h +++ b/src/devices/bus/pci/rtl8139_pci.h @@ -1,8 +1,7 @@ // license:BSD-3-Clause // copyright-holders: - -#ifndef MAME_BUS_PCI_RTL8129_PCI_H -#define MAME_BUS_PCI_RTL8129_PCI_H +#ifndef MAME_BUS_PCI_RTL8139_PCI_H +#define MAME_BUS_PCI_RTL8139_PCI_H #pragma once @@ -35,4 +34,4 @@ class rtl8139_pci_device : public pci_card_device DECLARE_DEVICE_TYPE(RTL8139_PCI, rtl8139_pci_device) -#endif // MAME_NETWORK_RTL8129_PCI_H +#endif // MAME_NETWORK_RTL8139_PCI_H diff --git a/src/devices/bus/pci/vision.h b/src/devices/bus/pci/vision.h index ebe0f0b9a54..366a5b31ec8 100644 --- a/src/devices/bus/pci/vision.h +++ b/src/devices/bus/pci/vision.h @@ -1,8 +1,8 @@ // license:BSD-3-Clause // copyright-holders: Angelo Salese -#ifndef MAME_BUS_PCI_S3VISION_PCI_H -#define MAME_BUS_PCI_S3VISION_PCI_H +#ifndef MAME_BUS_PCI_VISION_H +#define MAME_BUS_PCI_VISION_H #pragma once @@ -73,4 +73,4 @@ DECLARE_DEVICE_TYPE(VISION864_PCI, vision864_pci_device) DECLARE_DEVICE_TYPE(VISION964_PCI, vision964_pci_device) DECLARE_DEVICE_TYPE(VISION968_PCI, vision968_pci_device) -#endif // MAME_BUS_PCI_S3VISION_PCI_H +#endif // MAME_BUS_PCI_S3VISION_H diff --git a/src/devices/bus/plg1x0/plg100-vl.h b/src/devices/bus/plg1x0/plg100-vl.h index 6ff3cd48a8f..e4485c4929b 100644 --- a/src/devices/bus/plg1x0/plg100-vl.h +++ b/src/devices/bus/plg1x0/plg100-vl.h @@ -1,8 +1,8 @@ // license:BSD-3-Clause // copyright-holders:Olivier Galibert -#ifndef MAME_BUS_PLG1X0_PLG100VL_H -#define MAME_BUS_PLG1X0_PLG100VL_H +#ifndef MAME_BUS_PLG1X0_PLG100_VL_H +#define MAME_BUS_PLG1X0_PLG100_VL_H // Yamaha PLG100-VL diff --git a/src/devices/bus/plg1x0/plg150-ap.h b/src/devices/bus/plg1x0/plg150-ap.h index 8e56ed6061c..6316689193e 100644 --- a/src/devices/bus/plg1x0/plg150-ap.h +++ b/src/devices/bus/plg1x0/plg150-ap.h @@ -1,8 +1,8 @@ // license:BSD-3-Clause // copyright-holders:Olivier Galibert -#ifndef MAME_BUS_PLG1X0_PLG150AP_H -#define MAME_BUS_PLG1X0_PLG150AP_H +#ifndef MAME_BUS_PLG1X0_PLG150_AP_H +#define MAME_BUS_PLG1X0_PLG150_AP_H // Yamaha PLG150-AP diff --git a/src/devices/bus/ql/kempston_di.h b/src/devices/bus/ql/kempston_di.h index a8a8024f0fd..c7e942cbd7f 100644 --- a/src/devices/bus/ql/kempston_di.h +++ b/src/devices/bus/ql/kempston_di.h @@ -6,8 +6,8 @@ **********************************************************************/ -#ifndef MAME_BUS_QQL_KEMPSTON_DI_H -#define MAME_BUS_QQL_KEMPSTON_DI_H +#ifndef MAME_BUS_QL_KEMPSTON_DI_H +#define MAME_BUS_QL_KEMPSTON_DI_H #pragma once @@ -44,4 +44,4 @@ class kempston_disk_interface_device : public device_t, public device_ql_expansi DECLARE_DEVICE_TYPE(KEMPSTON_DISK_INTERFACE, kempston_disk_interface_device) -#endif // MAME_BUS_QQL_KEMPSTON_DI_H +#endif // MAME_BUS_QL_KEMPSTON_DI_H diff --git a/src/devices/bus/ql/miracle_hd.h b/src/devices/bus/ql/miracle_hd.h index 285bab8ddb0..ec89dbcb1bc 100644 --- a/src/devices/bus/ql/miracle_hd.h +++ b/src/devices/bus/ql/miracle_hd.h @@ -6,8 +6,8 @@ **********************************************************************/ -#ifndef MAME_BUS_QL_MIRACLE_HD -#define MAME_BUS_QL_MIRACLE_HD +#ifndef MAME_BUS_QL_MIRACLE_HD_H +#define MAME_BUS_QL_MIRACLE_HD_H #pragma once @@ -44,4 +44,4 @@ class miracle_hard_disk_device : public device_t, // device type definition DECLARE_DEVICE_TYPE(MIRACLE_HARD_DISK, miracle_hard_disk_device) -#endif // MAME_BUS_QL_MIRACLE_HD +#endif // MAME_BUS_QL_MIRACLE_HD_H diff --git a/src/devices/bus/rc2014/cf.h b/src/devices/bus/rc2014/cf.h index 3efc1223c33..c024735abd3 100644 --- a/src/devices/bus/rc2014/cf.h +++ b/src/devices/bus/rc2014/cf.h @@ -6,8 +6,8 @@ **********************************************************************/ -#ifndef MAME_BUS_RC2014_COMPACT_FLASH_H -#define MAME_BUS_RC2014_COMPACT_FLASH_H +#ifndef MAME_BUS_RC2014_CF_H +#define MAME_BUS_RC2014_CF_H #pragma once @@ -15,4 +15,4 @@ DECLARE_DEVICE_TYPE(RC2014_COMPACT_FLASH, device_rc2014_card_interface) -#endif // MAME_BUS_RC2014_COMPACT_FLASH_H +#endif // MAME_BUS_RC2014_CF_H diff --git a/src/devices/bus/s100/seals8k.h b/src/devices/bus/s100/seals8k.h index 8d12cc6de9d..fc4020e7e15 100644 --- a/src/devices/bus/s100/seals8k.h +++ b/src/devices/bus/s100/seals8k.h @@ -6,8 +6,8 @@ **********************************************************************/ -#ifndef MAME_BUS_S100_8K_SC_H -#define MAME_BUS_S100_8K_SC_H +#ifndef MAME_BUS_S100_SEALS8K_H +#define MAME_BUS_S100_SEALS8K_H #pragma once @@ -16,4 +16,4 @@ DECLARE_DEVICE_TYPE(S100_8K_SC, device_s100_card_interface) DECLARE_DEVICE_TYPE(S100_8K_SC_BB, device_s100_card_interface) -#endif // MAME_BUS_S100_8K_SC_H +#endif // MAME_BUS_S100_SEALS8K_H diff --git a/src/devices/bus/saitek_osa/expansion.h b/src/devices/bus/saitek_osa/expansion.h index 6954c392384..3646e663bad 100644 --- a/src/devices/bus/saitek_osa/expansion.h +++ b/src/devices/bus/saitek_osa/expansion.h @@ -24,8 +24,8 @@ *******************************************************************************/ -#ifndef MAME_BUS_SAITEKOSA_EXPANSION_H -#define MAME_BUS_SAITEKOSA_EXPANSION_H +#ifndef MAME_BUS_SAITEK_OSA_EXPANSION_H +#define MAME_BUS_SAITEK_OSA_EXPANSION_H #pragma once @@ -123,5 +123,4 @@ class device_saitekosa_expansion_interface : public device_interface void saitekosa_expansion_modules(device_slot_interface &device); - -#endif // MAME_BUS_SAITEKOSA_EXPANSION_H +#endif // MAME_BUS_SAITEK_OSA_EXPANSION_H diff --git a/src/devices/bus/saitek_osa/maestro.h b/src/devices/bus/saitek_osa/maestro.h index 74b38c132a2..a3440416c7a 100644 --- a/src/devices/bus/saitek_osa/maestro.h +++ b/src/devices/bus/saitek_osa/maestro.h @@ -6,8 +6,8 @@ *******************************************************************************/ -#ifndef MAME_BUS_SAITEKOSA_MAESTRO_H -#define MAME_BUS_SAITEKOSA_MAESTRO_H +#ifndef MAME_BUS_SAITEK_OSA_MAESTRO_H +#define MAME_BUS_SAITEK_OSA_MAESTRO_H #pragma once @@ -16,4 +16,4 @@ DECLARE_DEVICE_TYPE(OSA_MAESTRO, device_saitekosa_expansion_interface) DECLARE_DEVICE_TYPE(OSA_ANALYST, device_saitekosa_expansion_interface) -#endif // MAME_BUS_SAITEKOSA_MAESTRO_H +#endif // MAME_BUS_SAITEK_OSA_MAESTRO_H diff --git a/src/devices/bus/saitek_osa/maestroa.h b/src/devices/bus/saitek_osa/maestroa.h index b2021501945..9ce0909040d 100644 --- a/src/devices/bus/saitek_osa/maestroa.h +++ b/src/devices/bus/saitek_osa/maestroa.h @@ -6,8 +6,8 @@ *******************************************************************************/ -#ifndef MAME_BUS_SAITEKOSA_MAESTROA_H -#define MAME_BUS_SAITEKOSA_MAESTROA_H +#ifndef MAME_BUS_SAITEK_OSA_MAESTROA_H +#define MAME_BUS_SAITEK_OSA_MAESTROA_H #pragma once @@ -15,4 +15,4 @@ DECLARE_DEVICE_TYPE(OSA_MAESTROA, device_saitekosa_expansion_interface) -#endif // MAME_BUS_SAITEKOSA_MAESTROA_H +#endif // MAME_BUS_SAITEK_OSA_MAESTROA_H diff --git a/src/devices/bus/saitek_osa/sparc.h b/src/devices/bus/saitek_osa/sparc.h index 94a870740b8..eb5484c9dc6 100644 --- a/src/devices/bus/saitek_osa/sparc.h +++ b/src/devices/bus/saitek_osa/sparc.h @@ -6,8 +6,8 @@ *******************************************************************************/ -#ifndef MAME_BUS_SAITEKOSA_SPARC_H -#define MAME_BUS_SAITEKOSA_SPARC_H +#ifndef MAME_BUS_SAITEK_OSA_SPARC_H +#define MAME_BUS_SAITEK_OSA_SPARC_H #pragma once @@ -15,4 +15,4 @@ DECLARE_DEVICE_TYPE(OSA_SPARC, device_saitekosa_expansion_interface) -#endif // MAME_BUS_SAITEKOSA_SPARC_H +#endif // MAME_BUS_SAITEK_OSA_SPARC_H diff --git a/src/devices/bus/scsi/scsicd512.h b/src/devices/bus/scsi/scsicd512.h index 81055348538..b858aeea3f2 100644 --- a/src/devices/bus/scsi/scsicd512.h +++ b/src/devices/bus/scsi/scsicd512.h @@ -6,8 +6,8 @@ ***************************************************************************/ -#ifndef DEVICES_BUS_SCSI_SCSICD512_H -#define DEVICES_BUS_SCSI_SCSICD512_H +#ifndef MAME_BUS_SCSI_SCSICD512_H +#define MAME_BUS_SCSI_SCSICD512_H #pragma once @@ -83,4 +83,4 @@ DECLARE_DEVICE_TYPE(XM5401SUN, toshiba_xm5401_sun_device) DECLARE_DEVICE_TYPE(XM5701, toshiba_xm5701_device) DECLARE_DEVICE_TYPE(XM5701SUN, toshiba_xm5701_sun_device) -#endif // DEVICES_BUS_SCSI_SCSICD512_H +#endif // MAME_BUS_SCSI_SCSICD512_H diff --git a/src/devices/bus/sega8/sega8_slot.h b/src/devices/bus/sega8/sega8_slot.h index 0e2f7b0bd18..7f320b4fc42 100644 --- a/src/devices/bus/sega8/sega8_slot.h +++ b/src/devices/bus/sega8/sega8_slot.h @@ -1,7 +1,7 @@ // license:BSD-3-Clause // copyright-holders:Fabio Priuli -#ifndef MAME_BUS_SEGA8_SLOT_H -#define MAME_BUS_SEGA8_SLOT_H +#ifndef MAME_BUS_SEGA8_SEGA8_SLOT_H +#define MAME_BUS_SEGA8_SEGA8_SLOT_H #pragma once @@ -353,4 +353,4 @@ void sg1000mk3_cart(device_slot_interface &device); void sms_cart(device_slot_interface &device); void gg_cart(device_slot_interface &device); -#endif // MAME_BUS_SEGA8_SLOT_H +#endif // MAME_BUS_SEGA8_SEGA8_SLOT_H diff --git a/src/devices/bus/segaai/segaai_exp.h b/src/devices/bus/segaai/segaai_exp.h index c1d96166a11..2eef6014261 100644 --- a/src/devices/bus/segaai/segaai_exp.h +++ b/src/devices/bus/segaai/segaai_exp.h @@ -1,7 +1,7 @@ // license:BSD-3-Clause // copyright-holders:Wilbert Pol -#ifndef MAME_BUS_SEGAAI_EXP_H -#define MAME_BUS_SEGAAI_EXP_H +#ifndef MAME_BUS_SEGAAI_SEGAAI_EXP_H +#define MAME_BUS_SEGAAI_SEGAAI_EXP_H #pragma once @@ -60,4 +60,4 @@ class segaai_exp_interface : public device_interface // slot interfaces void segaai_exp(device_slot_interface &device); -#endif +#endif // MAME_BUS_SEGAAI_SEGAAI_EXP_H diff --git a/src/devices/bus/segaai/segaai_slot.h b/src/devices/bus/segaai/segaai_slot.h index 3ce496a2b1f..ce1e1d76c07 100644 --- a/src/devices/bus/segaai/segaai_slot.h +++ b/src/devices/bus/segaai/segaai_slot.h @@ -1,7 +1,7 @@ // license:BSD-3-Clause // copyright-holders:Wilbert Pol -#ifndef MAME_BUS_SEGAAI_SLOT_H -#define MAME_BUS_SEGAAI_SLOT_H +#ifndef MAME_BUS_SEGAAI_SEGAAI_SLOT_H +#define MAME_BUS_SEGAAI_SEGAAI_SLOT_H #pragma once @@ -70,4 +70,4 @@ class segaai_card_interface : public device_interface void segaai_cards(device_slot_interface &device); -#endif +#endif // MAME_BUS_SEGAAI_SEGAAI_SLOT_H diff --git a/src/devices/bus/sg1000_exp/kblink.h b/src/devices/bus/sg1000_exp/kblink.h index 6c667b60b1a..f8c84faa214 100644 --- a/src/devices/bus/sg1000_exp/kblink.h +++ b/src/devices/bus/sg1000_exp/kblink.h @@ -9,8 +9,8 @@ is supported by the game F-16 Fighting Falcon for its 2 players mode. **********************************************************************/ -#ifndef MAME_BUS_SG1000_EXP_SK1100_KBLINK_H -#define MAME_BUS_SG1000_EXP_SK1100_KBLINK_H +#ifndef MAME_BUS_SG1000_EXP_KBLINK_H +#define MAME_BUS_SG1000_EXP_KBLINK_H #pragma once @@ -81,4 +81,4 @@ class sk1100_link_cable_device : public device_t, DECLARE_DEVICE_TYPE(SK1100_LINK_CABLE, sk1100_link_cable_device) -#endif // MAME_BUS_SG1000_EXP_SK1100_KBLINK_H +#endif // MAME_BUS_SG1000_EXP_KBLINK_H diff --git a/src/devices/bus/sg1000_exp/sg1000exp.cpp b/src/devices/bus/sg1000_exp/sg1000exp.cpp index ad568d7cb27..0cc164448e8 100644 --- a/src/devices/bus/sg1000_exp/sg1000exp.cpp +++ b/src/devices/bus/sg1000_exp/sg1000exp.cpp @@ -124,5 +124,6 @@ bool sg1000_expansion_slot_device::is_writeable(uint8_t offset) void sg1000_expansion_devices(device_slot_interface &device) { device.option_add("sk1100", SEGA_SK1100); + device.option_add("sk1100e", SEGA_SK1100E); device.option_add("fm", SEGA_FM_UNIT); } diff --git a/src/devices/bus/sg1000_exp/sk1100.cpp b/src/devices/bus/sg1000_exp/sk1100.cpp index 8f0d3d6eb5d..f65451827bd 100644 --- a/src/devices/bus/sg1000_exp/sk1100.cpp +++ b/src/devices/bus/sg1000_exp/sk1100.cpp @@ -9,9 +9,14 @@ Release data from the Sega Retro project: Year: 1984 Country/region: JP Model code: SK-1100 +Though no export version of the SK-1100 itself was actually released, +the export SC-3000 keyboard is identical aside from key labels (mostly +letters with diacritics replacing katakana), and functional differences +are all handled by software. + TODO: -- SP-400 serial printer +- SP-400 serial printer (custom 7-pin TTL-level connector) **********************************************************************/ @@ -29,6 +34,7 @@ Release data from the Sega Retro project: //************************************************************************** DEFINE_DEVICE_TYPE(SEGA_SK1100, sega_sk1100_device, "sega_sk1100", "Sega SK-1100 Keyboard") +DEFINE_DEVICE_TYPE(SEGA_SK1100E, sega_sk1100e_device, "sega_sk1100e", "Sega SK-1100 Keyboard (with diareses)") /*------------------------------------------------- @@ -37,70 +43,179 @@ DEFINE_DEVICE_TYPE(SEGA_SK1100, sega_sk1100_device, "sega_sk1100", "Sega SK-1100 static INPUT_PORTS_START( sk1100_keys ) PORT_START("PA0") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_1) PORT_CHAR('1') PORT_CHAR('!') - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Q) PORT_CHAR('Q') PORT_CHAR('q') - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_A) PORT_CHAR('A') PORT_CHAR('a') - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Z) PORT_CHAR('Z') PORT_CHAR('z') - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("ENG DIER'S") PORT_CODE(KEYCODE_RALT) PORT_CHAR(UCHAR_MAMEKEY(RALT)) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_COMMA) PORT_CHAR(',') PORT_CHAR('<') - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_K) PORT_CHAR('K') PORT_CHAR('k') - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_I) PORT_CHAR('I') PORT_CHAR('i') + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(u8"1 \u30CC ! GOTO") PORT_CODE(KEYCODE_1) PORT_CHAR('1', 0x30cc) PORT_CHAR('!') // ヌ + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(u8"Q \u30BF REM") PORT_CODE(KEYCODE_Q) PORT_CHAR('Q', 0x30bf) PORT_CHAR('q') // タ + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(u8"A \u30C1 CHR$(") PORT_CODE(KEYCODE_A) PORT_CHAR('A', 0x30c1) PORT_CHAR('a') // チ + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(u8"Z \u30C4 ASC(") PORT_CODE(KEYCODE_Z) PORT_CHAR('Z', 0x30c4) PORT_CHAR('z', 0x30c3) // ツ ッ + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(u8"\u82F1\u6570/\u30AB\u30CA (Alphanumerics/Kana)") PORT_CODE(KEYCODE_RALT) PORT_CHAR(UCHAR_MAMEKEY(RALT)) // 英数/カナ + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(u8", \u30CD < \u3001 SGN(") PORT_CODE(KEYCODE_COMMA) PORT_CHAR(',', 0x30cd) PORT_CHAR('<', 0x3001) // ネ 、 + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(u8"K \u30CE COS(") PORT_CODE(KEYCODE_K) PORT_CHAR('K', 0x30ce) PORT_CHAR('k') // ノ + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(u8"I \u30CB TO") PORT_CODE(KEYCODE_I) PORT_CHAR('I', 0x30cb) PORT_CHAR('i') // ニ + + PORT_START("PA1") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(u8"2 \u30D5 \" GOSUB") PORT_CODE(KEYCODE_2) PORT_CHAR('2', 0x30d5) PORT_CHAR('"') // フ + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(u8"W \u30C6 DATA") PORT_CODE(KEYCODE_W) PORT_CHAR('W', 0x30c6) PORT_CHAR('w') // テ + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(u8"S \u30C8 STR$(") PORT_CODE(KEYCODE_S) PORT_CHAR('S', 0x30c8) PORT_CHAR('s') // ト + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(u8"X \u30B5 VAL(") PORT_CODE(KEYCODE_X) PORT_CHAR('X', 0x30b5) PORT_CHAR('x') // サ + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("SPC") PORT_CODE(KEYCODE_SPACE) PORT_CHAR(' ') + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(u8". \u30EB > \u3002 RND(") PORT_CODE(KEYCODE_STOP) PORT_CHAR('.', 0x30eb) PORT_CHAR('>', 0x3002) // ル 。 + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(u8"L \u30EA TAN(") PORT_CODE(KEYCODE_L) PORT_CHAR('L', 0x30ea) PORT_CHAR('l') // リ + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(u8"O \u30E9 STEP") PORT_CODE(KEYCODE_O) PORT_CHAR('O', 0x30e9) PORT_CHAR('o') // ラ + + PORT_START("PA2") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(u8"3 \u30A2 # RETURN") PORT_CODE(KEYCODE_3) PORT_CHAR('3', 0x30a2) PORT_CHAR('#', 0x30a1) // ア ァ + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(u8"E \u30A4 READ") PORT_CODE(KEYCODE_E) PORT_CHAR('E', 0x30a4) PORT_CHAR('e', 0x30a3) // イ ィ + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(u8"D \u30B7 TIME$") PORT_CODE(KEYCODE_D) PORT_CHAR('D', 0x30b7) PORT_CHAR('d') // シ + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(u8"C \u30BD SQR(") PORT_CODE(KEYCODE_C) PORT_CHAR('C', 0x30bd) PORT_CHAR('c') // ソ + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Clr Home CLS") PORT_CODE(KEYCODE_INSERT) PORT_CHAR(UCHAR_MAMEKEY(HOME)) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(u8"/ \u30E1 ? FRE") PORT_CODE(KEYCODE_SLASH) PORT_CHAR('/', 0x30e1) PORT_CHAR('?') // メ + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(u8"; \u30EC + RAD(") PORT_CODE(KEYCODE_COLON) PORT_CHAR(';', 0x30ec) PORT_CHAR('+') // レ + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(u8"P \u30BB NEXT") PORT_CODE(KEYCODE_P) PORT_CHAR('P', 0x30bb) PORT_CHAR('p') // セ + + PORT_START("PA3") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(u8"4 \u30A6 $ SCREEN") PORT_CODE(KEYCODE_4) PORT_CHAR('4', 0x30a6) PORT_CHAR('$', 0x30a5) // ウ ゥ + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(u8"R \u30B9 RESTORE") PORT_CODE(KEYCODE_R) PORT_CHAR('R', 0x30b9) PORT_CHAR('r') // ス + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(u8"F \u30CF LEFT$(") PORT_CODE(KEYCODE_F) PORT_CHAR('F', 0x30cf) PORT_CHAR('f') // ハ + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(u8"V \u30D2 EXP(") PORT_CODE(KEYCODE_V) PORT_CHAR('V', 0x30d2) PORT_CHAR('v') // ヒ + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Del Ins DELETE") PORT_CODE(KEYCODE_DEL) PORT_CHAR(8) PORT_CHAR(UCHAR_MAMEKEY(INSERT)) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(u8"\u30ED π PI") PORT_CODE(KEYCODE_BACKSLASH2) PORT_CHAR(0x30ed) PORT_CHAR(U'π') // ロ + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(u8": \u30B1 * PRINT") PORT_CODE(KEYCODE_QUOTE) PORT_CHAR(':', 0x30b1) PORT_CHAR('*') // ケ + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(u8"@ \u309B ` IF") PORT_CODE(KEYCODE_OPENBRACE) PORT_CHAR('@', 0x309b) PORT_CHAR('`') // ゛ + + PORT_START("PA4") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(u8"5 \u30A8 % POSITION") PORT_CODE(KEYCODE_5) PORT_CHAR('5', 0x30a8) PORT_CHAR('%', 0x30a7) // エ ェ + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(u8"T \u30AB INPUT") PORT_CODE(KEYCODE_T) PORT_CHAR('T', 0x30ab) PORT_CHAR('t') // カ + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(u8"G \u30AD RIGHT$(") PORT_CODE(KEYCODE_G) PORT_CHAR('G', 0x30ad) PORT_CHAR('g') // キ + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(u8"B \u30B3 LOG(") PORT_CODE(KEYCODE_B) PORT_CHAR('B', 0x30b3) PORT_CHAR('b') // コ + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(u8"\u2193") PORT_CODE(KEYCODE_DOWN) PORT_CHAR(UCHAR_MAMEKEY(DOWN)) // U+2193 = ↓ + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(u8"] \u30E0 } \u300d LIST") PORT_CODE(KEYCODE_BACKSLASH) PORT_CHAR(']', 0x30e0) PORT_CHAR('}', 0x300d) // ム 」 + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(u8"[ \u309C { \u300c THEN") PORT_CODE(KEYCODE_CLOSEBRACE) PORT_CHAR('[', 0x309c) PORT_CHAR('{', 0x300c) // ゜ 「 + + PORT_START("PA5") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(u8"6 \u30AA & COLOR") PORT_CODE(KEYCODE_6) PORT_CHAR('6', 0x30aa) PORT_CHAR('&', 0x30a9) // オ ォ + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(u8"Y \u30F3 DIM") PORT_CODE(KEYCODE_Y) PORT_CHAR('Y', 0x30f3) PORT_CHAR('y') // ン + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(u8"H \u30AF MID$(") PORT_CODE(KEYCODE_H) PORT_CHAR('H', 0x30af) PORT_CHAR('h') // ク + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(u8"N \u30DF ABS(") PORT_CODE(KEYCODE_N) PORT_CHAR('N', 0x30df) PORT_CHAR('n') // ミ + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(u8"\u2190") PORT_CODE(KEYCODE_LEFT) PORT_CHAR(UCHAR_MAMEKEY(LEFT)) // U+2190 = ← + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("CR") PORT_CODE(KEYCODE_ENTER) PORT_CHAR(13) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) + + PORT_START("PA6") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(u8"7 \u30E4 ' LINE") PORT_CODE(KEYCODE_7) PORT_CHAR('7', 0x30e4) PORT_CHAR('\'', 0x30e3) // ヤ ャ + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(u8"U \u30CA FOR") PORT_CODE(KEYCODE_U) PORT_CHAR('U', 0x30ca) PORT_CHAR('u') // ナ + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(u8"J \u30DE SIN(") PORT_CODE(KEYCODE_J) PORT_CHAR('J', 0x30de) PORT_CHAR('j') // マ + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(u8"M \u30E2 INT(") PORT_CODE(KEYCODE_M) PORT_CHAR('M', 0x30e2) PORT_CHAR('m') // モ + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(u8"\u2192") PORT_CODE(KEYCODE_RIGHT) PORT_CHAR(UCHAR_MAMEKEY(RIGHT)) // U+2192 = → + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(u8"\u2191") PORT_CODE(KEYCODE_UP) PORT_CHAR(UCHAR_MAMEKEY(UP)) // U+2191 = ↑ + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) + + PORT_START("PA7") + PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED ) // keyboard disabled + + PORT_START("PB0") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(u8"8 \u30E6 ( PSET") PORT_CODE(KEYCODE_8) PORT_CHAR('8', 0x30e6) PORT_CHAR('(', 0x30e5) // ユ ュ + PORT_BIT( 0x0e, IP_ACTIVE_LOW, IPT_UNUSED ) + + PORT_START("PB1") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(u8"9 \u30E8 ) SAVE\"") PORT_CODE(KEYCODE_9) PORT_CHAR('9', 0x30e8) PORT_CHAR(')', 0x30e7) // ヨ ョ + PORT_BIT( 0x0e, IP_ACTIVE_LOW, IPT_UNUSED ) + + PORT_START("PB2") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(u8"0 \u30EF LOAD\"") PORT_CODE(KEYCODE_0) PORT_CHAR('0', 0x30ef) // ワ + PORT_BIT( 0x0e, IP_ACTIVE_LOW, IPT_UNUSED ) + + PORT_START("PB3") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(u8"- \u30DB = VERIFY\"") PORT_CODE(KEYCODE_MINUS) PORT_CHAR('-', 0x30db) PORT_CHAR('=') // ホ + PORT_BIT( 0x0e, IP_ACTIVE_LOW, IPT_UNUSED ) + + PORT_START("PB4") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(u8"^ \u30D8 ~ AUTO") PORT_CODE(KEYCODE_EQUALS) PORT_CHAR('^', 0x30d8) PORT_CHAR('~') // ヘ + PORT_BIT( 0x0e, IP_ACTIVE_LOW, IPT_UNUSED ) + + PORT_START("PB5") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(u8"¥ \u30FC | RUN") PORT_CODE(KEYCODE_BACKSPACE) PORT_CHAR(U'¥', 0x30fc) PORT_CHAR('|') // ー + PORT_BIT( 0x06, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Func") PORT_CODE(KEYCODE_TAB) + + PORT_START("PB6") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Break") PORT_CODE(KEYCODE_ESC) PORT_CHAR(UCHAR_MAMEKEY(ESC)) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Graph") PORT_CODE(KEYCODE_LALT) PORT_CHAR(UCHAR_MAMEKEY(LALT)) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Ctrl") PORT_CODE(KEYCODE_LCONTROL) PORT_CHAR(UCHAR_MAMEKEY(LCONTROL)) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Shift") PORT_CODE(KEYCODE_LSHIFT) PORT_CODE(KEYCODE_RSHIFT) PORT_CHAR(UCHAR_SHIFT_1) + + PORT_START("PB7") + PORT_BIT( 0x0f, IP_ACTIVE_LOW, IPT_UNUSED ) // keyboard disabled +INPUT_PORTS_END + +static INPUT_PORTS_START( sk1100e_keys ) + PORT_START("PA0") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(u8"1 ! Â GOTO") PORT_CODE(KEYCODE_1) PORT_CHAR('1') PORT_CHAR('!') PORT_CHAR(U'Â') + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(u8"Q Á REM") PORT_CODE(KEYCODE_Q) PORT_CHAR('Q') PORT_CHAR('q') PORT_CHAR(U'Á') + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(u8"A Ä CHR$(") PORT_CODE(KEYCODE_A) PORT_CHAR('A') PORT_CHAR('a') PORT_CHAR(U'Ä') + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(u8"Z μ ASC(") PORT_CODE(KEYCODE_Z) PORT_CHAR('Z') PORT_CHAR('z') PORT_CHAR(U'μ') + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Eng Dier's") PORT_CODE(KEYCODE_RALT) PORT_CHAR(UCHAR_SHIFT_2) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(u8", < Ū SGN(") PORT_CODE(KEYCODE_COMMA) PORT_CHAR(',') PORT_CHAR('<') PORT_CHAR(U'Ū') + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(u8"K Ü COS(") PORT_CODE(KEYCODE_K) PORT_CHAR('K') PORT_CHAR('k') PORT_CHAR(U'Ü') + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(u8"I Ù TO") PORT_CODE(KEYCODE_I) PORT_CHAR('I') PORT_CHAR('i') PORT_CHAR(U'Ù') PORT_START("PA1") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_2) PORT_CHAR('2') PORT_CHAR('"') - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_W) PORT_CHAR('W') PORT_CHAR('w') - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_S) PORT_CHAR('S') PORT_CHAR('s') - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_X) PORT_CHAR('X') PORT_CHAR('x') + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(u8"2 \" Ǎ GOSUB") PORT_CODE(KEYCODE_2) PORT_CHAR('2') PORT_CHAR('"') PORT_CHAR(U'Ă') + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(u8"W À DATA") PORT_CODE(KEYCODE_W) PORT_CHAR('W') PORT_CHAR('w') PORT_CHAR(U'À') + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(u8"S Å STR$(") PORT_CODE(KEYCODE_S) PORT_CHAR('S') PORT_CHAR('s') PORT_CHAR(U'Å') + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(u8"X Λ VAL(") PORT_CODE(KEYCODE_X) PORT_CHAR('X') PORT_CHAR('x') PORT_CHAR(U'Λ') PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("SPC") PORT_CODE(KEYCODE_SPACE) PORT_CHAR(' ') - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_STOP) PORT_CHAR('.') PORT_CHAR('>') - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_L) PORT_CHAR('L') PORT_CHAR('l') - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_O) PORT_CHAR('O') PORT_CHAR('o') + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(u8". > Î RND(") PORT_CODE(KEYCODE_STOP) PORT_CHAR('.') PORT_CHAR('>') PORT_CHAR(U'Î') + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(u8"L Í TAN(") PORT_CODE(KEYCODE_L) PORT_CHAR('L') PORT_CHAR('l') PORT_CHAR(U'Í') + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(u8"O Ì STEP") PORT_CODE(KEYCODE_O) PORT_CHAR('O') PORT_CHAR('o') PORT_CHAR(U'Ì') PORT_START("PA2") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_3) PORT_CHAR('3') PORT_CHAR('#') - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_E) PORT_CHAR('E') PORT_CHAR('e') - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_D) PORT_CHAR('D') PORT_CHAR('d') - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_C) PORT_CHAR('C') PORT_CHAR('c') - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("HOME CLR") PORT_CODE(KEYCODE_HOME) PORT_CHAR(UCHAR_MAMEKEY(HOME)) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_SLASH) PORT_CHAR('/') PORT_CHAR('?') - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_COLON) PORT_CHAR(';') PORT_CHAR('+') - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_P) PORT_CHAR('P') PORT_CHAR('p') + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(u8"3 # Ê RETURN") PORT_CODE(KEYCODE_3) PORT_CHAR('3') PORT_CHAR('#') PORT_CHAR(U'Ê') + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(u8"E É READ") PORT_CODE(KEYCODE_E) PORT_CHAR('E') PORT_CHAR('e') PORT_CHAR(U'É') + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(u8"D Ã TIME$") PORT_CODE(KEYCODE_D) PORT_CHAR('D') PORT_CHAR('d') PORT_CHAR(U'Ã') + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(u8"C Ç SQR(") PORT_CODE(KEYCODE_C) PORT_CHAR('C') PORT_CHAR('c') PORT_CHAR(U'Ç') + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Clr Home CLS") PORT_CODE(KEYCODE_INSERT) PORT_CHAR(UCHAR_MAMEKEY(HOME)) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(u8"/ ? Ī FRE") PORT_CODE(KEYCODE_SLASH) PORT_CHAR('/') PORT_CHAR('?') PORT_CHAR(U'Ī') + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(u8"; + Ï RAD(") PORT_CODE(KEYCODE_COLON) PORT_CHAR(';') PORT_CHAR('+') PORT_CHAR(U'Ï') + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(u8"P Ó NEXT") PORT_CODE(KEYCODE_P) PORT_CHAR('P') PORT_CHAR('p') PORT_CHAR(U'Ó') PORT_START("PA3") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_4) PORT_CHAR('4') PORT_CHAR('$') - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_R) PORT_CHAR('R') PORT_CHAR('r') - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F) PORT_CHAR('F') PORT_CHAR('f') - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_V) PORT_CHAR('V') PORT_CHAR('v') - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("INS DEL") PORT_CODE(KEYCODE_BACKSPACE) PORT_CHAR(8) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_EQUALS) PORT_CHAR(U'π') - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_QUOTE) PORT_CHAR(':') PORT_CHAR('*') - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_OPENBRACE) PORT_CHAR('@') PORT_CHAR('`') + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(u8"4 $ Ě SCREEN") PORT_CODE(KEYCODE_4) PORT_CHAR('4') PORT_CHAR('$') PORT_CHAR(U'Ě') + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(u8"R È RESTORE") PORT_CODE(KEYCODE_R) PORT_CHAR('R') PORT_CHAR('r') PORT_CHAR(U'È') + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(u8"F Ā LEFT$(") PORT_CODE(KEYCODE_F) PORT_CHAR('F') PORT_CHAR('f') PORT_CHAR(U'Ā') + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(u8"V ¿ EXP(") PORT_CODE(KEYCODE_V) PORT_CHAR('V') PORT_CHAR('v') PORT_CHAR(U'¿') + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Del Ins DELETE") PORT_CODE(KEYCODE_DEL) PORT_CHAR(8) PORT_CHAR(UCHAR_MAMEKEY(INSERT)) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(u8"Õ π PI") PORT_CODE(KEYCODE_BACKSLASH2) PORT_CHAR(U'Õ') PORT_CHAR(U'π') + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(u8": * Ö PRINT") PORT_CODE(KEYCODE_QUOTE) PORT_CHAR(':') PORT_CHAR('*') PORT_CHAR(U'Ö') + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(u8"@ ` Ò IF") PORT_CODE(KEYCODE_OPENBRACE) PORT_CHAR('@') PORT_CHAR('`') PORT_CHAR(U'Ò') PORT_START("PA4") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_5) PORT_CHAR('5') PORT_CHAR('%') - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_T) PORT_CHAR('T') PORT_CHAR('t') - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_G) PORT_CHAR('G') PORT_CHAR('g') - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_B) PORT_CHAR('B') PORT_CHAR('b') + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(u8"5 % Ë POSITION") PORT_CODE(KEYCODE_5) PORT_CHAR('5') PORT_CHAR('%') PORT_CHAR(U'Ë') + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(u8"T Ñ INPUT") PORT_CODE(KEYCODE_T) PORT_CHAR('T') PORT_CHAR('t') PORT_CHAR(U'Ñ') + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(u8"G α RIGHT$(") PORT_CODE(KEYCODE_G) PORT_CHAR('G') PORT_CHAR('g') PORT_CHAR(U'α') + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(u8"B ¡ LOG(") PORT_CODE(KEYCODE_B) PORT_CHAR('B') PORT_CHAR('b') PORT_CHAR(U'¡') PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(u8"\u2193") PORT_CODE(KEYCODE_DOWN) PORT_CHAR(UCHAR_MAMEKEY(DOWN)) // U+2193 = ↓ - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_BACKSLASH) PORT_CHAR(']') PORT_CHAR('}') - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_CLOSEBRACE) PORT_CHAR('[') PORT_CHAR('{') + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(u8"] } Σ LIST") PORT_CODE(KEYCODE_BACKSLASH) PORT_CHAR(']') PORT_CHAR('}') PORT_CHAR(U'Σ') + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(u8"[ { Φ THEN") PORT_CODE(KEYCODE_CLOSEBRACE) PORT_CHAR('[') PORT_CHAR('{') PORT_CHAR(U'Φ') PORT_START("PA5") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_6) PORT_CHAR('6') PORT_CHAR('&') - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Y) PORT_CHAR('Y') PORT_CHAR('y') - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_H) PORT_CHAR('H') PORT_CHAR('h') - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_N) PORT_CHAR('N') PORT_CHAR('n') + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(u8"6 & Ē COLOR") PORT_CODE(KEYCODE_6) PORT_CHAR('6') PORT_CHAR('&') PORT_CHAR(U'Ē') + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(u8"Y Nˆ DIM") PORT_CODE(KEYCODE_Y) PORT_CHAR('Y') PORT_CHAR('y') + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(u8"H β MID$(") PORT_CODE(KEYCODE_H) PORT_CHAR('H') PORT_CHAR('h') PORT_CHAR(U'β') + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(u8"N Æ ABS(") PORT_CODE(KEYCODE_N) PORT_CHAR('N') PORT_CHAR('n') PORT_CHAR(U'Æ') PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(u8"\u2190") PORT_CODE(KEYCODE_LEFT) PORT_CHAR(UCHAR_MAMEKEY(LEFT)) // U+2190 = ← PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("CR") PORT_CODE(KEYCODE_ENTER) PORT_CHAR(13) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_START("PA6") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_7) PORT_CHAR('7') PORT_CHAR('\'') - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_U) PORT_CHAR('U') PORT_CHAR('u') - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_J) PORT_CHAR('J') PORT_CHAR('j') - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_M) PORT_CHAR('M') PORT_CHAR('m') + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(u8"7 ' Û LINE") PORT_CODE(KEYCODE_7) PORT_CHAR('7') PORT_CHAR('\'') PORT_CHAR(U'Û') + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(u8"U Ú FOR") PORT_CODE(KEYCODE_U) PORT_CHAR('U') PORT_CHAR('u') PORT_CHAR(U'Ú') + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(u8"J θ SIN(") PORT_CODE(KEYCODE_J) PORT_CHAR('J') PORT_CHAR('j') PORT_CHAR(U'θ') + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(u8"M Ω INT(") PORT_CODE(KEYCODE_M) PORT_CHAR('M') PORT_CHAR('m') PORT_CHAR(U'Ω') PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(u8"\u2192") PORT_CODE(KEYCODE_RIGHT) PORT_CHAR(UCHAR_MAMEKEY(RIGHT)) // U+2192 = → PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(u8"\u2191") PORT_CODE(KEYCODE_UP) PORT_CHAR(UCHAR_MAMEKEY(UP)) // U+2191 = ↑ @@ -110,35 +225,35 @@ static INPUT_PORTS_START( sk1100_keys ) PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED ) // keyboard disabled PORT_START("PB0") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_8) PORT_CHAR('8') PORT_CHAR('(') + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(u8"8 ( Ǔ PSET") PORT_CODE(KEYCODE_8) PORT_CHAR('8') PORT_CHAR('(') PORT_CHAR(U'Ǔ') PORT_BIT( 0x0e, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_START("PB1") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_9) PORT_CHAR('9') PORT_CHAR(')') + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(u8"9 ) Ǐ SAVE\"") PORT_CODE(KEYCODE_9) PORT_CHAR('9') PORT_CHAR(')') PORT_CHAR(U'Ǐ') PORT_BIT( 0x0e, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_START("PB2") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_0) PORT_CHAR('0') + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(u8"0 Ô LOAD\"") PORT_CODE(KEYCODE_0) PORT_CHAR('0') PORT_BIT( 0x0e, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_START("PB3") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_MINUS) PORT_CHAR('-') PORT_CHAR('=') + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(u8"- = Ǒ VERIFY\"") PORT_CODE(KEYCODE_MINUS) PORT_CHAR('-') PORT_CHAR('=') PORT_CHAR(U'Ǒ') PORT_BIT( 0x0e, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_START("PB4") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_BACKSLASH2) PORT_CHAR('^') + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(u8"^ ~ O¸ AUTO") PORT_CODE(KEYCODE_EQUALS) PORT_CHAR('^') PORT_CHAR('~') PORT_BIT( 0x0e, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_START("PB5") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_TILDE) PORT_CHAR(U'¥') + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(u8"¥ | £ RUN") PORT_CODE(KEYCODE_BACKSPACE) PORT_CHAR(U'¥') PORT_CHAR('|') PORT_CHAR(U'£') PORT_BIT( 0x06, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("FUNC") PORT_CODE(KEYCODE_TAB) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Func") PORT_CODE(KEYCODE_TAB) PORT_START("PB6") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("BREAK") PORT_CODE(KEYCODE_ESC) PORT_CHAR(UCHAR_MAMEKEY(ESC)) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("GRAPH") PORT_CODE(KEYCODE_LALT) PORT_CHAR(UCHAR_MAMEKEY(LALT)) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("CTRL") PORT_CODE(KEYCODE_LCONTROL) PORT_CHAR(UCHAR_MAMEKEY(LCONTROL)) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("SHIFT") PORT_CODE(KEYCODE_LSHIFT) PORT_CODE(KEYCODE_RSHIFT) PORT_CHAR(UCHAR_SHIFT_1) + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Break") PORT_CODE(KEYCODE_ESC) PORT_CHAR(UCHAR_MAMEKEY(ESC)) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Graph") PORT_CODE(KEYCODE_LALT) PORT_CHAR(UCHAR_MAMEKEY(LALT)) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Ctrl") PORT_CODE(KEYCODE_LCONTROL) PORT_CHAR(UCHAR_MAMEKEY(LCONTROL)) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Shift") PORT_CODE(KEYCODE_LSHIFT) PORT_CODE(KEYCODE_RSHIFT) PORT_CHAR(UCHAR_SHIFT_1) PORT_START("PB7") PORT_BIT( 0x0f, IP_ACTIVE_LOW, IPT_UNUSED ) // keyboard disabled @@ -154,6 +269,11 @@ ioport_constructor sega_sk1100_device::device_input_ports() const return INPUT_PORTS_NAME( sk1100_keys ); } +ioport_constructor sega_sk1100e_device::device_input_ports() const +{ + return INPUT_PORTS_NAME( sk1100e_keys ); +} + void sega_sk1100_device::device_add_mconfig(machine_config &config) { @@ -183,8 +303,8 @@ void sega_sk1100_device::device_add_mconfig(machine_config &config) // sega_sk1100_device - constructor //------------------------------------------------- -sega_sk1100_device::sega_sk1100_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : - device_t(mconfig, SEGA_SK1100, tag, owner, clock), +sega_sk1100_device::sega_sk1100_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_sg1000_expansion_slot_interface(mconfig, *this), m_cassette(*this, "cassette"), m_ppi(*this, UPD9255_0_TAG), @@ -195,6 +315,16 @@ sega_sk1100_device::sega_sk1100_device(const machine_config &mconfig, const char { } +sega_sk1100_device::sega_sk1100_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : + sega_sk1100_device(mconfig, SEGA_SK1100, tag, owner, clock) +{ +} + +sega_sk1100e_device::sega_sk1100e_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : + sega_sk1100_device(mconfig, SEGA_SK1100E, tag, owner, clock) +{ +} + //------------------------------------------------- // device_start - device-specific startup diff --git a/src/devices/bus/sg1000_exp/sk1100.h b/src/devices/bus/sg1000_exp/sk1100.h index ceb33e6769d..a587f4cc845 100644 --- a/src/devices/bus/sg1000_exp/sk1100.h +++ b/src/devices/bus/sg1000_exp/sk1100.h @@ -34,13 +34,13 @@ class sega_sk1100_device : public device_t, // construction/destruction sega_sk1100_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - // optional information overrides - virtual ioport_constructor device_input_ports() const override ATTR_COLD; - protected: + sega_sk1100_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_add_mconfig(machine_config &config) override ATTR_COLD; + virtual ioport_constructor device_input_ports() const override ATTR_COLD; // device_sg1000_expansion_slot_interface overrides virtual uint8_t peripheral_r(offs_t offset) override; @@ -62,9 +62,20 @@ class sega_sk1100_device : public device_t, uint8_t m_keylatch; }; +class sega_sk1100e_device : public sega_sk1100_device +{ +public: + // construction/destruction + sega_sk1100e_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + +protected: + // optional information overrides + virtual ioport_constructor device_input_ports() const override ATTR_COLD; +}; // device type definition DECLARE_DEVICE_TYPE(SEGA_SK1100, sega_sk1100_device) +DECLARE_DEVICE_TYPE(SEGA_SK1100E, sega_sk1100e_device) #endif // MAME_BUS_SG1000_EXP_SK1100_H diff --git a/src/devices/bus/sg1000_exp/sk1100prn.h b/src/devices/bus/sg1000_exp/sk1100prn.h index a0d8bb83cae..9dfcfca5a6c 100644 --- a/src/devices/bus/sg1000_exp/sk1100prn.h +++ b/src/devices/bus/sg1000_exp/sk1100prn.h @@ -9,8 +9,8 @@ **********************************************************************/ -#ifndef MAME_BUS_SG1000_EXP_SK1100_PRN_H -#define MAME_BUS_SG1000_EXP_SK1100_PRN_H +#ifndef MAME_BUS_SG1000_EXP_SK1100PRN_H +#define MAME_BUS_SG1000_EXP_SK1100PRN_H #pragma once @@ -84,5 +84,4 @@ DECLARE_DEVICE_TYPE(SK1100_PRINTER_PORT, sk1100_printer_port_device) void sk1100_printer_port_devices(device_slot_interface &device); - -#endif // MAME_BUS_SG1000_EXP_SK1100_PRN_H +#endif // MAME_BUS_SG1000_EXP_SK1100PRN_H diff --git a/src/devices/bus/sms_ctrl/rs232adapt.h b/src/devices/bus/sms_ctrl/rs232adapt.h index ae98dbb8dc5..27335514b51 100644 --- a/src/devices/bus/sms_ctrl/rs232adapt.h +++ b/src/devices/bus/sms_ctrl/rs232adapt.h @@ -5,8 +5,8 @@ Mega Drive RS-232 Adapter emulation **********************************************************************/ -#ifndef MAME_BUS_SMS_CTRL_RS232_H -#define MAME_BUS_SMS_CTRL_RS232_H +#ifndef MAME_BUS_SMS_CTRL_RS232ADAPT_H +#define MAME_BUS_SMS_CTRL_RS232ADAPT_H #pragma once @@ -15,4 +15,4 @@ DECLARE_DEVICE_TYPE(SMS_RS232, device_sms_control_interface) -#endif // MAME_BUS_SMS_CTRL_RS232_H +#endif // MAME_BUS_SMS_CTRL_RS232ADAPT_H diff --git a/src/devices/bus/sms_ctrl/sportsjp.h b/src/devices/bus/sms_ctrl/sportsjp.h index 016605c5d2e..9947a717d0f 100644 --- a/src/devices/bus/sms_ctrl/sportsjp.h +++ b/src/devices/bus/sms_ctrl/sportsjp.h @@ -5,8 +5,8 @@ Sega Master System "Sports Pad" (Japanese model) emulation **********************************************************************/ -#ifndef MAME_BUS_SMS_CTROL_SPORTSJP_H -#define MAME_BUS_SMS_CTROL_SPORTSJP_H +#ifndef MAME_BUS_SMS_CTRL_SPORTSJP_H +#define MAME_BUS_SMS_CTRL_SPORTSJP_H #pragma once @@ -15,4 +15,4 @@ DECLARE_DEVICE_TYPE(SMS_SPORTS_PAD_JP, device_sms_control_interface) -#endif // MAME_BUS_SMS_CTROL_SPORTSJP_H +#endif // MAME_BUS_SMS_CTRL_SPORTSJP_H diff --git a/src/devices/bus/snes_ctrl/sscope.h b/src/devices/bus/snes_ctrl/sscope.h index 2af2329749b..3c4d718c010 100644 --- a/src/devices/bus/snes_ctrl/sscope.h +++ b/src/devices/bus/snes_ctrl/sscope.h @@ -6,8 +6,8 @@ **********************************************************************/ -#ifndef MAME_BUS_SNES_CTRL_SUPERSCOPE_H -#define MAME_BUS_SNES_CTRL_SUPERSCOPE_H +#ifndef MAME_BUS_SNES_CTRL_SSCOPE_H +#define MAME_BUS_SNES_CTRL_SSCOPE_H #pragma once @@ -55,4 +55,4 @@ class snes_sscope_device : public device_t, // device type definition DECLARE_DEVICE_TYPE(SNES_SUPERSCOPE, snes_sscope_device) -#endif // MAME_BUS_SNES_CTRL_SUPERSCOPE_H +#endif // MAME_BUS_SNES_CTRL_SSCOPE_H diff --git a/src/devices/bus/spectrum/floppyone.h b/src/devices/bus/spectrum/floppyone.h index 7992f0c7aea..e77fb61d5be 100644 --- a/src/devices/bus/spectrum/floppyone.h +++ b/src/devices/bus/spectrum/floppyone.h @@ -6,14 +6,16 @@ (c) 1984/5 R.P.Gush *********************************************************************/ -#ifndef MAME_BUS_SPECTRUM_FLPONE_H -#define MAME_BUS_SPECTRUM_FLPONE_H +#ifndef MAME_BUS_SPECTRUM_FLOPPYONE_H +#define MAME_BUS_SPECTRUM_FLOPPYONE_H #include "exp.h" -#include "imagedev/floppy.h" -#include "machine/wd_fdc.h" + #include "bus/centronics/ctronics.h" #include "bus/rs232/rs232.h" +#include "imagedev/floppy.h" +#include "machine/wd_fdc.h" + //************************************************************************** // TYPE DEFINITIONS @@ -76,5 +78,4 @@ class spectrum_flpone_device : // device type definition DECLARE_DEVICE_TYPE(SPECTRUM_FLPONE, spectrum_flpone_device) - -#endif // MAME_BUS_SPECTRUM_FLPONE_H +#endif // MAME_BUS_SPECTRUM_FLOPPYONE_H diff --git a/src/devices/bus/spectrum/nemoide.h b/src/devices/bus/spectrum/nemoide.h index 441f3c9514a..b2af6963064 100644 --- a/src/devices/bus/spectrum/nemoide.h +++ b/src/devices/bus/spectrum/nemoide.h @@ -1,8 +1,8 @@ // license:BSD-3-Clause // copyright-holders:Andrei I. Holub -#ifndef MAME_SINCLAIR_NEMOIDE_H -#define MAME_SINCLAIR_NEMOIDE_H +#ifndef MAME_BUS_SPECTRUM_NEMOIDE_H +#define MAME_BUS_SPECTRUM_NEMOIDE_H #pragma once @@ -11,4 +11,4 @@ DECLARE_DEVICE_TYPE(ZXBUS_NEMOIDE, device_zxbus_card_interface) -#endif // MAME_SINCLAIR_NEMOIDE_H +#endif // MAME_BUS_SPECTRUM_NEMOIDE_H diff --git a/src/devices/bus/spectrum/neogs.h b/src/devices/bus/spectrum/neogs.h index 79170356690..6045520e1f7 100644 --- a/src/devices/bus/spectrum/neogs.h +++ b/src/devices/bus/spectrum/neogs.h @@ -1,8 +1,8 @@ // license:BSD-3-Clause // copyright-holders:Andrei I. Holub -#ifndef MAME_SINCLAIR_NEOGS_H -#define MAME_SINCLAIR_NEOGS_H +#ifndef MAME_BUS_SPECTRUM_NEOGS_H +#define MAME_BUS_SPECTRUM_NEOGS_H #pragma once @@ -11,4 +11,4 @@ DECLARE_DEVICE_TYPE(ZXBUS_NEOGS, device_zxbus_card_interface) -#endif // MAME_SINCLAIR_NEOGS_H +#endif // MAME_BUS_SPECTRUM_NEOGS_H diff --git a/src/devices/bus/spectrum/smuc.h b/src/devices/bus/spectrum/smuc.h index 87de5539783..93eadd904a3 100644 --- a/src/devices/bus/spectrum/smuc.h +++ b/src/devices/bus/spectrum/smuc.h @@ -1,8 +1,8 @@ // license:BSD-3-Clause // copyright-holders:Andrei I. Holub -#ifndef MAME_SINCLAIR_SMUC_H -#define MAME_SINCLAIR_SMUC_H +#ifndef MAME_BUS_SPECTRUM_SMUC_H +#define MAME_BUS_SPECTRUM_SMUC_H #pragma once @@ -11,4 +11,4 @@ DECLARE_DEVICE_TYPE(ZXBUS_SMUC, device_zxbus_card_interface) -#endif // MAME_SINCLAIR_SMUC_H +#endif // MAME_BUS_SPECTRUM_SMUC_H diff --git a/src/devices/bus/ss50/dc5.h b/src/devices/bus/ss50/dc5.h index f795e6d5b13..05ca3e7004f 100644 --- a/src/devices/bus/ss50/dc5.h +++ b/src/devices/bus/ss50/dc5.h @@ -5,11 +5,11 @@ SWTPC SS30 DC5 Floppy Disk Controller **********************************************************************/ -#ifndef MAME_DEVICE_BUS_SS50_DC5_H -#define MAME_DEVICE_BUS_SS50_DC5_H +#ifndef MAME_BUS_SS50_DC5_H +#define MAME_BUS_SS50_DC5_H #include "interface.h" DECLARE_DEVICE_TYPE(SS50_DC5, ss50_card_interface) -#endif // MAME_DEVICE_BUS_SS50_DC5_H +#endif // MAME_BUS_SS50_DC5_H diff --git a/src/devices/bus/ss50/mpc.h b/src/devices/bus/ss50/mpc.h index 3cf864dc3b3..73cf175af8e 100644 --- a/src/devices/bus/ss50/mpc.h +++ b/src/devices/bus/ss50/mpc.h @@ -5,11 +5,11 @@ SWTPC MP-C Serial Control Interface **********************************************************************/ -#ifndef MAME_DEVICE_BUS_SS50_MPC_H -#define MAME_DEVICE_BUS_SS50_MPC_H +#ifndef MAME_BUS_SS50_MPC_H +#define MAME_BUS_SS50_MPC_H #include "interface.h" DECLARE_DEVICE_TYPE(SS50_MPC, ss50_card_interface) -#endif // MAME_DEVICE_BUS_SS50_MPC_H +#endif // MAME_BUS_SS50_MPC_H diff --git a/src/devices/bus/ss50/mps.h b/src/devices/bus/ss50/mps.h index e381efcfa0a..66e3bccb7d6 100644 --- a/src/devices/bus/ss50/mps.h +++ b/src/devices/bus/ss50/mps.h @@ -5,11 +5,11 @@ SWTPC MP-S Serial Interface **********************************************************************/ -#ifndef MAME_DEVICE_BUS_SS50_MPS_H -#define MAME_DEVICE_BUS_SS50_MPS_H +#ifndef MAME_BUS_SS50_MPS_H +#define MAME_BUS_SS50_MPS_H #include "interface.h" DECLARE_DEVICE_TYPE(SS50_MPS, ss50_card_interface) -#endif // MAME_DEVICE_BUS_SS50_MPS_H +#endif // MAME_BUS_SS50_MPS_H diff --git a/src/devices/bus/ss50/mps2.h b/src/devices/bus/ss50/mps2.h index a415a2dbe46..e8fe9b51f50 100644 --- a/src/devices/bus/ss50/mps2.h +++ b/src/devices/bus/ss50/mps2.h @@ -5,11 +5,11 @@ SWTPC MP-S2 Dual Serial Interface **********************************************************************/ -#ifndef MAME_DEVICE_BUS_SS50_MPS2_H -#define MAME_DEVICE_BUS_SS50_MPS2_H +#ifndef MAME_BUS_SS50_MPS2_H +#define MAME_BUS_SS50_MPS2_H #include "interface.h" DECLARE_DEVICE_TYPE(SS50_MPS2, ss50_card_interface) -#endif // MAME_DEVICE_BUS_SS50_MPS2_H +#endif // MAME_BUS_SS50_MPS2_H diff --git a/src/devices/bus/ss50/mpt.h b/src/devices/bus/ss50/mpt.h index a9344f7873a..bd8a375480c 100644 --- a/src/devices/bus/ss50/mpt.h +++ b/src/devices/bus/ss50/mpt.h @@ -5,11 +5,11 @@ SWTPC MP-T Timer / counter **********************************************************************/ -#ifndef MAME_DEVICE_BUS_SS50_MPT_H -#define MAME_DEVICE_BUS_SS50_MPT_H +#ifndef MAME_BUS_SS50_MPT_H +#define MAME_BUS_SS50_MPT_H #include "interface.h" DECLARE_DEVICE_TYPE(SS50_MPT, ss50_card_interface) -#endif // MAME_DEVICE_BUS_SS50_MPT_H +#endif // MAME_BUS_SS50_MPT_H diff --git a/src/devices/bus/ss50/piaide.h b/src/devices/bus/ss50/piaide.h index 51fa31b58be..a16d8480870 100644 --- a/src/devices/bus/ss50/piaide.h +++ b/src/devices/bus/ss50/piaide.h @@ -5,11 +5,11 @@ PIA IDE Hard Disk Interface **********************************************************************/ -#ifndef MAME_DEVICE_BUS_SS50_PIAIDE_H -#define MAME_DEVICE_BUS_SS50_PIAIDE_H +#ifndef MAME_BUS_SS50_PIAIDE_H +#define MAME_BUS_SS50_PIAIDE_H #include "interface.h" DECLARE_DEVICE_TYPE(SS50_PIAIDE, ss50_card_interface) -#endif // MAME_DEVICE_BUS_SS50_PIAIDE_H +#endif // MAME_BUS_SS50_PIAIDE_H diff --git a/src/devices/bus/sunkbd/hlekbd.h b/src/devices/bus/sunkbd/hlekbd.h index 12677678e75..e53fe2f13ef 100644 --- a/src/devices/bus/sunkbd/hlekbd.h +++ b/src/devices/bus/sunkbd/hlekbd.h @@ -1,7 +1,7 @@ // license:BSD-3-Clause // copyright-holders:Vas Crabb -#ifndef MAME_DEVICES_SUNKBD_HLEKBD_H -#define MAME_DEVICES_SUNKBD_HLEKBD_H +#ifndef MAME_BUS_SUNKBD_HLEKBD_H +#define MAME_BUS_SUNKBD_HLEKBD_H #pragma once @@ -114,4 +114,4 @@ DECLARE_DEVICE_TYPE_NS(SUN_TYPE5_GB_HLE_KEYBOARD, bus::sunkbd, hle_device_base) DECLARE_DEVICE_TYPE_NS(SUN_TYPE5_SE_HLE_KEYBOARD, bus::sunkbd, hle_device_base) DECLARE_DEVICE_TYPE_NS(SUN_TYPE5_JP_HLE_KEYBOARD, bus::sunkbd, hle_device_base) -#endif // MAME_DEVICES_SUNKBD_HLEKBD_H +#endif // MAME_BUS_SUNKBD_HLEKBD_H diff --git a/src/devices/bus/sunmouse/hlemouse.h b/src/devices/bus/sunmouse/hlemouse.h index b025dd28d97..270aa0d408a 100644 --- a/src/devices/bus/sunmouse/hlemouse.h +++ b/src/devices/bus/sunmouse/hlemouse.h @@ -1,7 +1,7 @@ // license:BSD-3-Clause // copyright-holders:Vas Crabb -#ifndef MAME_DEVICES_SUNMOUSE_HLEMOUSE_H -#define MAME_DEVICES_SUNMOUSE_HLEMOUSE_H +#ifndef MAME_BUS_SUNMOUSE_HLEMOUSE_H +#define MAME_BUS_SUNMOUSE_HLEMOUSE_H #pragma once @@ -79,4 +79,4 @@ class hle_4800baud_device : public hle_device_base DECLARE_DEVICE_TYPE_NS(SUN_1200BAUD_HLE_MOUSE, bus::sunmouse, hle_1200baud_device) DECLARE_DEVICE_TYPE_NS(SUN_4800BAUD_HLE_MOUSE, bus::sunmouse, hle_4800baud_device) -#endif // MAME_DEVICES_SUNMOUSE_HLEMOUSE_H +#endif // MAME_BUS_SUNMOUSE_HLEMOUSE_H diff --git a/src/devices/bus/supracan/rom.h b/src/devices/bus/supracan/rom.h index 2f8abc900df..80f4fd42ed4 100644 --- a/src/devices/bus/supracan/rom.h +++ b/src/devices/bus/supracan/rom.h @@ -1,7 +1,7 @@ // license:BSD-3-Clause // copyright-holders: -#ifndef MAME_BUS_SUPERACAN_ROM_H -#define MAME_BUS_SUPERACAN_ROM_H +#ifndef MAME_BUS_SUPRACAN_ROM_H +#define MAME_BUS_SUPRACAN_ROM_H #pragma once @@ -43,4 +43,4 @@ class superacan_rom_device : public device_t, DECLARE_DEVICE_TYPE(SUPERACAN_ROM_STD, superacan_rom_device) -#endif // MAME_BUS_SUPERACAN_ROM_H +#endif // MAME_BUS_SUPRACAN_ROM_H diff --git a/src/devices/bus/supracan/slot.h b/src/devices/bus/supracan/slot.h index a9982603add..6b3f308d64f 100644 --- a/src/devices/bus/supracan/slot.h +++ b/src/devices/bus/supracan/slot.h @@ -1,8 +1,8 @@ // license:BSD-3-Clause // copyright-holders: -#ifndef MAME_BUS_SUPERACAN_SLOT_H -#define MAME_BUS_SUPERACAN_SLOT_H +#ifndef MAME_BUS_SUPRACAN_SLOT_H +#define MAME_BUS_SUPRACAN_SLOT_H #include "imagedev/cartrom.h" @@ -87,4 +87,4 @@ class superacan_cart_slot_device : public device_t, DECLARE_DEVICE_TYPE(SUPERACAN_CART_SLOT, superacan_cart_slot_device) -#endif // MAME_BUS_SUPERACAN_SLOT_H +#endif // MAME_BUS_SUPRACAN_SLOT_H diff --git a/src/devices/bus/tanbus/keyboard/keyboard.h b/src/devices/bus/tanbus/keyboard/keyboard.h index 4c12e12be8a..cb4020f22b3 100644 --- a/src/devices/bus/tanbus/keyboard/keyboard.h +++ b/src/devices/bus/tanbus/keyboard/keyboard.h @@ -6,8 +6,8 @@ **********************************************************************/ -#ifndef MAME_BUS_TANBUS_KEYBOARD_H -#define MAME_BUS_TANBUS_KEYBOARD_H +#ifndef MAME_BUS_TANBUS_KEYBOARD_KEYBOARD_H +#define MAME_BUS_TANBUS_KEYBOARD_KEYBOARD_H #pragma once @@ -79,4 +79,4 @@ DECLARE_DEVICE_TYPE(MICROTAN_KBD_SLOT, microtan_kbd_slot_device) void microtan_kbd_devices(device_slot_interface &device); -#endif // MAME_BUS_TANBUS_KEYBOARD_H +#endif // MAME_BUS_TANBUS_KEYBOARD_KEYBOARD_H diff --git a/src/devices/bus/ti8x/teeconn.h b/src/devices/bus/ti8x/teeconn.h index 4b3aa2bd4cf..83db867a507 100644 --- a/src/devices/bus/ti8x/teeconn.h +++ b/src/devices/bus/ti8x/teeconn.h @@ -1,7 +1,7 @@ // license:BSD-3-Clause // copyright-holders:Vas Crabb -#ifndef MAME_DEVICES_BUS_TI8X_TEECONN_H -#define MAME_DEVICES_BUS_TI8X_TEECONN_H +#ifndef MAME_BUS_TI8X_TEECONN_H +#define MAME_BUS_TI8X_TEECONN_H #pragma once @@ -10,4 +10,4 @@ DECLARE_DEVICE_TYPE(TI8X_TEE_CONNECTOR, device_ti8x_link_port_interface) -#endif // MAME_DEVICES_BUS_TI8X_TEECONN_H +#endif // MAME_BUS_TI8X_TEECONN_H diff --git a/src/devices/bus/ti8x/ti8x.h b/src/devices/bus/ti8x/ti8x.h index 3bf95c0c270..ca82e9191d0 100644 --- a/src/devices/bus/ti8x/ti8x.h +++ b/src/devices/bus/ti8x/ti8x.h @@ -32,8 +32,8 @@ output. This makes implementing things like the tee connector easier. */ -#ifndef MAME_DEVICES_BUS_TI8X_TI8X_H -#define MAME_DEVICES_BUS_TI8X_TI8X_H +#ifndef MAME_BUS_TI8X_TI8X_H +#define MAME_BUS_TI8X_TI8X_H #pragma once @@ -200,4 +200,4 @@ class device_ti8x_link_port_byte_interface : public device_ti8x_link_port_bit_in void default_ti8x_link_devices(device_slot_interface &device); -#endif // MAME_DEVICES_BUS_TI8X_TI8X_H +#endif // MAME_BUS_TI8X_TI8X_H diff --git a/src/devices/bus/ti8x/tispeaker.h b/src/devices/bus/ti8x/tispeaker.h index 7219c229213..0173630d48b 100644 --- a/src/devices/bus/ti8x/tispeaker.h +++ b/src/devices/bus/ti8x/tispeaker.h @@ -1,7 +1,7 @@ // license:BSD-3-Clause // copyright-holders:Vas Crabb -#ifndef MAME_DEVICES_BUS_TI8X_TISPEAKER_H -#define MAME_DEVICES_BUS_TI8X_TISPEAKER_H +#ifndef MAME_BUS_TI8X_TISPEAKER_H +#define MAME_BUS_TI8X_TISPEAKER_H #pragma once @@ -11,4 +11,4 @@ DECLARE_DEVICE_TYPE(TI8X_SPEAKER_STEREO, device_ti8x_link_port_interface) DECLARE_DEVICE_TYPE(TI8X_SPEAKER_MONO, device_ti8x_link_port_interface) -#endif // MAME_DEVICES_BUS_TI8X_TISPEAKER_H +#endif // MAME_BUS_TI8X_TISPEAKER_H diff --git a/src/devices/bus/ti99/internal/buffram.h b/src/devices/bus/ti99/internal/buffram.h index 488588140e9..10e67da9e2a 100644 --- a/src/devices/bus/ti99/internal/buffram.h +++ b/src/devices/bus/ti99/internal/buffram.h @@ -9,8 +9,8 @@ *******************************************************************************/ -#ifndef MAME_BUS_TI99_INTERNAL_BRAM_H -#define MAME_BUS_TI99_INTERNAL_BRAM_H +#ifndef MAME_BUS_TI99_INTERNAL_BUFFRAM_H +#define MAME_BUS_TI99_INTERNAL_BUFFRAM_H #pragma once @@ -46,4 +46,4 @@ class buffered_ram_device : public device_t, public device_nvram_interface DECLARE_DEVICE_TYPE_NS(BUFF_RAM, bus::ti99::internal, buffered_ram_device) -#endif // MAME_BUS_TI99_INTERNAL_BRAM_H +#endif // MAME_BUS_TI99_INTERNAL_BUFFRAM_H diff --git a/src/devices/bus/ti99/peb/bwg.h b/src/devices/bus/ti99/peb/bwg.h index 6b096d8cf50..13d746a5cd8 100644 --- a/src/devices/bus/ti99/peb/bwg.h +++ b/src/devices/bus/ti99/peb/bwg.h @@ -11,8 +11,8 @@ *****************************************************************************/ -#ifndef MAME_BUS_TI99_PED_BWG_H -#define MAME_BUS_TI99_PED_BWG_H +#ifndef MAME_BUS_TI99_PEB_BWG_H +#define MAME_BUS_TI99_PEB_BWG_H #pragma once @@ -135,4 +135,4 @@ class snug_bwg_device : public device_t, public device_ti99_peribox_card_interfa DECLARE_DEVICE_TYPE_NS(TI99_BWG, bus::ti99::peb, snug_bwg_device) -#endif // MAME_BUS_TI99_PED_BWG_H +#endif // MAME_BUS_TI99_PEB_BWG_H diff --git a/src/devices/bus/ti99/peb/cc_fdc.h b/src/devices/bus/ti99/peb/cc_fdc.h index bf674f2acbd..0946c6246fd 100644 --- a/src/devices/bus/ti99/peb/cc_fdc.h +++ b/src/devices/bus/ti99/peb/cc_fdc.h @@ -10,8 +10,8 @@ *****************************************************************************/ -#ifndef MAME_BUS_TI99_PEB_CORCOMP_H -#define MAME_BUS_TI99_PEB_CORCOMP_H +#ifndef MAME_BUS_TI99_PEB_CC_FDC_H +#define MAME_BUS_TI99_PEB_CC_FDC_H #pragma once @@ -246,4 +246,4 @@ DECLARE_DEVICE_TYPE_NS(CCDCC_PALU1, bus::ti99::peb, ccdcc_palu1_device) DECLARE_DEVICE_TYPE_NS(CCFDC_PALU12, bus::ti99::peb, ccfdc_palu12_device) DECLARE_DEVICE_TYPE_NS(CCFDC_PALU6, bus::ti99::peb, ccfdc_palu6_device) -#endif // MAME_BUS_TI99_PEB_CORCOMP_H +#endif // MAME_BUS_TI99_PEB_CC_FDC_H diff --git a/src/devices/bus/ti99/peb/myarcfdc.h b/src/devices/bus/ti99/peb/myarcfdc.h index 88ee0ce5d39..aa5917f02b2 100644 --- a/src/devices/bus/ti99/peb/myarcfdc.h +++ b/src/devices/bus/ti99/peb/myarcfdc.h @@ -9,8 +9,8 @@ *****************************************************************************/ -#ifndef MAME_BUS_TI99_PEB_DDCC_H -#define MAME_BUS_TI99_PEB_DDCC_H +#ifndef MAME_BUS_TI99_PEB_MYARCFDC_H +#define MAME_BUS_TI99_PEB_MYARCFDC_H #pragma once @@ -134,4 +134,4 @@ class ddcc1_pal_device : public device_t DECLARE_DEVICE_TYPE_NS(TI99_DDCC1, bus::ti99::peb, myarc_fdc_device) DECLARE_DEVICE_TYPE_NS(DDCC1_PAL, bus::ti99::peb, ddcc1_pal_device) -#endif // MAME_BUS_TI99_PEB_DDCC_H +#endif // MAME_BUS_TI99_PEB_MYARCFDC_H diff --git a/src/devices/bus/ti99/peb/scsicard.h b/src/devices/bus/ti99/peb/scsicard.h index 4f100a31ae1..af9adee4476 100644 --- a/src/devices/bus/ti99/peb/scsicard.h +++ b/src/devices/bus/ti99/peb/scsicard.h @@ -10,8 +10,8 @@ *****************************************************************************/ -#ifndef MAME_BUS_TI99_PEB_SCSI_H -#define MAME_BUS_TI99_PEB_SCSI_H +#ifndef MAME_BUS_TI99_PEB_SCSICARD_H +#define MAME_BUS_TI99_PEB_SCSICARD_H #pragma once @@ -142,4 +142,4 @@ class whtscsi_pld_device : public device_t DECLARE_DEVICE_TYPE_NS(TI99_WHTSCSI, bus::ti99::peb, whtech_scsi_card_device) DECLARE_DEVICE_TYPE_NS(WHTSCSI_PLD, bus::ti99::peb, whtscsi_pld_device) -#endif // MAME_BUS_TI99_PEB_SCSI_H +#endif // MAME_BUS_TI99_PEB_SCSICARD_H diff --git a/src/devices/bus/tmc600/euro.h b/src/devices/bus/tmc600/euro.h index afd52a8daa3..bf2e95ded78 100644 --- a/src/devices/bus/tmc600/euro.h +++ b/src/devices/bus/tmc600/euro.h @@ -42,8 +42,8 @@ **********************************************************************/ -#ifndef MAME_DEVICES_TMC600_EURO_H -#define MAME_DEVICES_TMC600_EURO_H +#ifndef MAME_BUS_TMC600_EURO_H +#define MAME_BUS_TMC600_EURO_H #pragma once @@ -104,5 +104,4 @@ void tmc600_eurobus_cards(device_slot_interface &device); typedef device_type_enumerator tmc600_eurobus_slot_enumerator; - -#endif // MAME_DEVICES_TMC600_EURO_H +#endif // MAME_BUS_TMC600_EURO_H diff --git a/src/devices/bus/vcs_ctrl/ctrl.h b/src/devices/bus/vcs_ctrl/ctrl.h index 45a788b7bfe..b1ca5fde075 100644 --- a/src/devices/bus/vcs_ctrl/ctrl.h +++ b/src/devices/bus/vcs_ctrl/ctrl.h @@ -9,8 +9,8 @@ **********************************************************************/ -#ifndef MAME_BUS_CVS_CTRL_CTRL_H -#define MAME_BUS_CVS_CTRL_CTRL_H +#ifndef MAME_BUS_VCS_CTRL_CTRL_H +#define MAME_BUS_VCS_CTRL_CTRL_H #pragma once @@ -115,4 +115,4 @@ DECLARE_DEVICE_TYPE(VCS_CONTROL_PORT, vcs_control_port_device) void vcs_control_port_devices(device_slot_interface &device); void a800_control_port_devices(device_slot_interface &device); -#endif // MAME_BUS_CVS_CTRL_CTRL_H +#endif // MAME_BUS_VCS_CTRL_CTRL_H diff --git a/src/devices/bus/vme/vme_cards.h b/src/devices/bus/vme/vme_cards.h index 196c96c77e2..25ac3e3d109 100644 --- a/src/devices/bus/vme/vme_cards.h +++ b/src/devices/bus/vme/vme_cards.h @@ -1,11 +1,11 @@ // license:BSD-3-Clause // copyright-holders:Patrick Mackinlay -#ifndef MAME_BUS_VME_CARDS_H -#define MAME_BUS_VME_CARDS_H +#ifndef MAME_BUS_VME_VME_CARDS_H +#define MAME_BUS_VME_VME_CARDS_H #pragma once void vme_cards(device_slot_interface &device); -#endif // MAME_BUS_VME_CARDS_H +#endif // MAME_BUS_VME_VME_CARDS_H diff --git a/src/devices/bus/wysekbd/wysekbd.h b/src/devices/bus/wysekbd/wysekbd.h index dace2925ef4..f9372419a07 100644 --- a/src/devices/bus/wysekbd/wysekbd.h +++ b/src/devices/bus/wysekbd/wysekbd.h @@ -6,8 +6,8 @@ ***************************************************************************/ -#ifndef MAME_BUS_WYSEKBD_KEYBOARD_H -#define MAME_BUS_WYSEKBD_KEYBOARD_H +#ifndef MAME_BUS_WYSEKBD_WYSEKBD_H +#define MAME_BUS_WYSEKBD_WYSEKBD_H #pragma once @@ -91,4 +91,4 @@ inline int wyse_keyboard_port_device::data_r() return 1; } -#endif // MAME_BUS_WYSEKBD_KEYBOARD_H +#endif // MAME_BUS_WYSEKBD_WYSEKBD_H diff --git a/src/devices/cpu/arm7/lpc210x.h b/src/devices/cpu/arm7/lpc210x.h index ec6ac9a461c..00bee60ef00 100644 --- a/src/devices/cpu/arm7/lpc210x.h +++ b/src/devices/cpu/arm7/lpc210x.h @@ -1,8 +1,8 @@ // license:BSD-3-Clause // copyright-holders:David Haywood -#ifndef MAME_CPU_ARM7_LPC2103_H -#define MAME_CPU_ARM7_LPC2103_H +#ifndef MAME_CPU_ARM7_LPC210X_H +#define MAME_CPU_ARM7_LPC210X_H #pragma once @@ -87,4 +87,4 @@ class lpc210x_device : public arm7_cpu_device // device type definition DECLARE_DEVICE_TYPE(LPC2103, lpc210x_device) -#endif // MAME_CPU_ARM7_LPC2103_H +#endif // MAME_CPU_ARM7_LPC210X_H diff --git a/src/devices/cpu/axc51/axc51.h b/src/devices/cpu/axc51/axc51.h index ee6439b59a8..8dccb9ce981 100644 --- a/src/devices/cpu/axc51/axc51.h +++ b/src/devices/cpu/axc51/axc51.h @@ -1,8 +1,8 @@ // license:BSD-3-Clause // copyright-holders:Steve Ellenoff, Manuel Abadia, Couriersud, David Haywood -#ifndef MAME_CPU_SFR_SFR_H -#define MAME_CPU_SFR_SFR_H +#ifndef MAME_CPU_AXC51_AXC51_H +#define MAME_CPU_AXC51_AXC51_H #pragma once @@ -541,5 +541,4 @@ class ax208p_cpu_device : public ax208_cpu_device virtual const tiny_rom_entry *device_rom_region() const override ATTR_COLD; }; - -#endif // MAME_CPU_SFR_SFR_H +#endif // MAME_CPU_AXC51_AXC51_H diff --git a/src/devices/cpu/axc51/axc51dasm.h b/src/devices/cpu/axc51/axc51dasm.h index a5b66315bbc..25438dcd2ea 100644 --- a/src/devices/cpu/axc51/axc51dasm.h +++ b/src/devices/cpu/axc51/axc51dasm.h @@ -1,8 +1,8 @@ // license:BSD-3-Clause // copyright-holders:Steve Ellenoff, David Haywood -#ifndef MAME_CPU_SFR_AXC51DASM_H -#define MAME_CPU_SFR_AXC51DASM_H +#ifndef MAME_CPU_AXC51_AXC51DASM_H +#define MAME_CPU_AXC51_AXC51DASM_H #pragma once @@ -90,5 +90,4 @@ class ax208_disassembler : public axc51core_disassembler virtual void disassemble_op_lcall(std::ostream& stream, unsigned &PC, const data_buffer& params) override; }; - -#endif +#endif // MAME_CPU_AXC51_AXC51DASM_H diff --git a/src/devices/cpu/c33/s1c33209.h b/src/devices/cpu/c33/s1c33209.h index d2a3581adcf..b92fd094d5c 100644 --- a/src/devices/cpu/c33/s1c33209.h +++ b/src/devices/cpu/c33/s1c33209.h @@ -4,8 +4,8 @@ Epson S1C33209/221/222 CMOS 32-bit single chip microcomputer */ -#ifndef MAME_CPU_C33_S2C33209_H -#define MAME_CPU_C33_S2C33209_H +#ifndef MAME_CPU_C33_S1C33209_H +#define MAME_CPU_C33_S1C33209_H #pragma once @@ -54,4 +54,4 @@ DECLARE_DEVICE_TYPE(S1C33209, s1c33209_device) DECLARE_DEVICE_TYPE(S1C33221, s1c33221_device) DECLARE_DEVICE_TYPE(S1C33222, s1c33222_device) -#endif // MAME_CPU_C33_S2C33209_H +#endif // MAME_CPU_C33_S1C33209_H diff --git a/src/devices/cpu/clipper/clipperd.h b/src/devices/cpu/clipper/clipperd.h index cac65afdf93..5db8a4ed2f4 100644 --- a/src/devices/cpu/clipper/clipperd.h +++ b/src/devices/cpu/clipper/clipperd.h @@ -1,8 +1,8 @@ // license:BSD-3-Clause // copyright-holders:Patrick Mackinlay -#ifndef MAME_CPU_CLIPPER_CLIPPERDASM_H -#define MAME_CPU_CLIPPER_CLIPPERDASM_H +#ifndef MAME_CPU_CLIPPER_CLIPPERD_H +#define MAME_CPU_CLIPPER_CLIPPERD_H #pragma once @@ -20,4 +20,4 @@ class clipper_disassembler : public util::disasm_interface std::string address (offs_t pc, const data_buffer &opcodes); }; -#endif +#endif // MAME_CPU_CLIPPER_CLIPPERD_H diff --git a/src/devices/cpu/cop400/cop400.h b/src/devices/cpu/cop400/cop400.h index 12cd8315330..c6ad46cb6f3 100644 --- a/src/devices/cpu/cop400/cop400.h +++ b/src/devices/cpu/cop400/cop400.h @@ -8,8 +8,8 @@ ***************************************************************************/ -#ifndef MAME_DEVICES_CPU_COP400_H -#define MAME_DEVICES_CPU_COP400_H +#ifndef MAME_CPU_COP400_COP400_H +#define MAME_CPU_COP400_COP400_H #pragma once @@ -528,4 +528,4 @@ DECLARE_DEVICE_TYPE(COP444C, cop444c_cpu_device) DECLARE_DEVICE_TYPE(COP445C, cop445c_cpu_device) DECLARE_DEVICE_TYPE(COP446C, cop446c_cpu_device) -#endif // MAME_DEVICES_CPU_COP400_H +#endif // MAME_CPU_COP400_COP400_H diff --git a/src/devices/cpu/cop400/cop410ds.h b/src/devices/cpu/cop400/cop410ds.h index e30eda21588..4a9162f1874 100644 --- a/src/devices/cpu/cop400/cop410ds.h +++ b/src/devices/cpu/cop400/cop410ds.h @@ -8,8 +8,8 @@ ***************************************************************************/ -#ifndef MAME_CPU_COP410_COP410DS_H -#define MAME_CPU_COP410_COP410DS_H +#ifndef MAME_CPU_COP400_COP410DS_H +#define MAME_CPU_COP400_COP410DS_H #pragma once @@ -23,4 +23,4 @@ class cop410_disassembler : public util::disasm_interface virtual offs_t disassemble(std::ostream &stream, offs_t pc, const data_buffer &opcodes, const data_buffer ¶ms) override; }; -#endif +#endif // MAME_CPU_COP400_COP410DS_H diff --git a/src/devices/cpu/cop400/cop420ds.h b/src/devices/cpu/cop400/cop420ds.h index befe8ca7871..58e8610a6e3 100644 --- a/src/devices/cpu/cop400/cop420ds.h +++ b/src/devices/cpu/cop400/cop420ds.h @@ -8,8 +8,8 @@ ***************************************************************************/ -#ifndef MAME_CPU_COP420_COP420DS_H -#define MAME_CPU_COP420_COP420DS_H +#ifndef MAME_CPU_COP400_COP420DS_H +#define MAME_CPU_COP400_COP420DS_H #pragma once @@ -23,4 +23,4 @@ class cop420_disassembler : public util::disasm_interface virtual offs_t disassemble(std::ostream &stream, offs_t pc, const data_buffer &opcodes, const data_buffer ¶ms) override; }; -#endif +#endif // MAME_CPU_COP400_COP420DS_H diff --git a/src/devices/cpu/cop400/cop424ds.h b/src/devices/cpu/cop400/cop424ds.h index 4448f705b6d..8ebaa48b829 100644 --- a/src/devices/cpu/cop400/cop424ds.h +++ b/src/devices/cpu/cop400/cop424ds.h @@ -8,8 +8,8 @@ ***************************************************************************/ -#ifndef MAME_CPU_COP424_COP424DS_H -#define MAME_CPU_COP424_COP424DS_H +#ifndef MAME_CPU_COP400_COP424DS_H +#define MAME_CPU_COP400_COP424DS_H #pragma once @@ -23,4 +23,4 @@ class cop424_disassembler : public util::disasm_interface virtual offs_t disassemble(std::ostream &stream, offs_t pc, const data_buffer &opcodes, const data_buffer ¶ms) override; }; -#endif +#endif // MAME_CPU_COP400_COP424DS_H diff --git a/src/devices/cpu/cop400/cop444ds.h b/src/devices/cpu/cop400/cop444ds.h index 9a976ff33ed..558632e0c46 100644 --- a/src/devices/cpu/cop400/cop444ds.h +++ b/src/devices/cpu/cop400/cop444ds.h @@ -8,8 +8,8 @@ ***************************************************************************/ -#ifndef MAME_CPU_COP444_COP444DS_H -#define MAME_CPU_COP444_COP444DS_H +#ifndef MAME_CPU_COP400_COP444DS_H +#define MAME_CPU_COP400_COP444DS_H #pragma once @@ -23,4 +23,4 @@ class cop444_disassembler : public util::disasm_interface virtual offs_t disassemble(std::ostream &stream, offs_t pc, const data_buffer &opcodes, const data_buffer ¶ms) override; }; -#endif +#endif // MAME_CPU_COP400_COP444DS_H diff --git a/src/devices/cpu/cp1610/1610dasm.h b/src/devices/cpu/cp1610/1610dasm.h index 59cc61b36f9..4f23cf1af24 100644 --- a/src/devices/cpu/cp1610/1610dasm.h +++ b/src/devices/cpu/cp1610/1610dasm.h @@ -1,8 +1,8 @@ // license:BSD-3-Clause // copyright-holders:Frank Palazzolo -#ifndef MAME_CPU_CP1610_CP1610DASM_H -#define MAME_CPU_CP1610_CP1610DASM_H +#ifndef MAME_CPU_CP1610_1610DASM_H +#define MAME_CPU_CP1610_1610DASM_H #pragma once @@ -16,4 +16,4 @@ class cp1610_disassembler : public util::disasm_interface virtual offs_t disassemble(std::ostream &stream, offs_t pc, const data_buffer &opcodes, const data_buffer ¶ms) override; }; -#endif +#endif // MAME_CPU_CP1610_1610DASM_H diff --git a/src/devices/cpu/drcbeut.h b/src/devices/cpu/drcbeut.h index 7317b0ba30b..ee398e168f1 100644 --- a/src/devices/cpu/drcbeut.h +++ b/src/devices/cpu/drcbeut.h @@ -8,10 +8,10 @@ ***************************************************************************/ -#pragma once +#ifndef MAME_CPU_DRCBEUT_H +#define MAME_CPU_DRCBEUT_H -#ifndef __DRCBEUT_H__ -#define __DRCBEUT_H__ +#pragma once #include "drcuml.h" @@ -163,4 +163,4 @@ class drc_label_list }; -#endif /* __DRCBEUT_H__ */ +#endif // MAME_CPU_DRCBEUT_H diff --git a/src/devices/cpu/dsp56156/dsp56def.h b/src/devices/cpu/dsp56156/dsp56def.h index 3ae4dd414ec..a49d07c3899 100644 --- a/src/devices/cpu/dsp56156/dsp56def.h +++ b/src/devices/cpu/dsp56156/dsp56def.h @@ -4,13 +4,15 @@ // All the macros that are fit to print. // /////////////////////////////////////////// -#ifndef __DSP56_DEF_H__ -#define __DSP56_DEF_H__ +#ifndef MAME_CPU_DSP56156_DSP56DEF_H +#define MAME_CPU_DSP56156_DSP56DEF_H + +#pragma once #include "dsp56156.h" -namespace DSP_56156 -{ +namespace DSP_56156 { + /*************************************************************************** ALU ***************************************************************************/ @@ -53,4 +55,4 @@ namespace DSP_56156 } // namespace DSP_56156 -#endif +#endif // MAME_CPU_DSP56156_DSP56DEF_H diff --git a/src/devices/cpu/dsp56156/dsp56dsm.h b/src/devices/cpu/dsp56156/dsp56dsm.h index c750bebfdb1..4a5afb15bd1 100644 --- a/src/devices/cpu/dsp56156/dsp56dsm.h +++ b/src/devices/cpu/dsp56156/dsp56dsm.h @@ -8,8 +8,8 @@ ***************************************************************************/ -#ifndef MAME_CPU_DSP56156_DSP56156DSM_H -#define MAME_CPU_DSP56156_DSP56156DSM_H +#ifndef MAME_CPU_DSP56156_DSP56DSM_H +#define MAME_CPU_DSP56156_DSP56DSM_H #pragma once @@ -23,4 +23,4 @@ class dsp56156_disassembler : public util::disasm_interface virtual offs_t disassemble(std::ostream &stream, offs_t pc, const data_buffer &opcodes, const data_buffer ¶ms) override; }; -#endif +#endif // MAME_CPU_DSP56156_DSP56DSM_H diff --git a/src/devices/cpu/dsp56156/dsp56pcu.h b/src/devices/cpu/dsp56156/dsp56pcu.h index 5f82cc21877..06d57689eb6 100644 --- a/src/devices/cpu/dsp56156/dsp56pcu.h +++ b/src/devices/cpu/dsp56156/dsp56pcu.h @@ -1,12 +1,14 @@ // license:BSD-3-Clause // copyright-holders:Andrew Gardner -#ifndef DSP56156_PCU_H -#define DSP56156_PCU_H +#ifndef MAME_CPU_DSP56156_DSP56PCU_H +#define MAME_CPU_DSP56156_DSP56PCU_H + +#pragma once #include "dsp56156.h" -namespace DSP_56156 -{ +namespace DSP_56156 { + /*************************************************************************** PCU ***************************************************************************/ @@ -148,4 +150,4 @@ int8_t dsp56156_get_irq_priority(dsp56156_core* cpustate, int index); } // namespace DSP_56156 -#endif +#endif // MAME_CPU_DSP56156_DSP56PCU_H diff --git a/src/devices/cpu/dsp56156/inst.h b/src/devices/cpu/dsp56156/inst.h index 9ae926900ee..4fcf7f66bdb 100644 --- a/src/devices/cpu/dsp56156/inst.h +++ b/src/devices/cpu/dsp56156/inst.h @@ -1,7 +1,9 @@ // license:BSD-3-Clause // copyright-holders:Andrew Gardner -#ifndef DSP56156_INSTRUCTION_H -#define DSP56156_INSTRUCTION_H +#ifndef MAME_CPU_DSP56156_INST_H +#define MAME_CPU_DSP56156_INST_H + +#pragma once #include "opcode.h" #include "tables.h" @@ -13,8 +15,8 @@ // // An Instruction is the base class all regular ops inherit from. // -namespace DSP_56156 -{ +namespace DSP_56156 { + #define UNIMPLEMENTED_OPCODE() osd_printf_error("Unimplemented opcode: PC=%04x | %s;\n", PC, __PRETTY_FUNCTION__); class Opcode; @@ -3482,5 +3484,6 @@ class Shfr: public Instruction reg_id m_source2; }; -} -#endif +} // namespace DSP_56156 + +#endif // MAME_CPU_DSP56156_INST_H diff --git a/src/devices/cpu/dsp56156/opcode.h b/src/devices/cpu/dsp56156/opcode.h index 304017caf61..41154bfc29d 100644 --- a/src/devices/cpu/dsp56156/opcode.h +++ b/src/devices/cpu/dsp56156/opcode.h @@ -1,7 +1,7 @@ // license:BSD-3-Clause // copyright-holders:Andrew Gardner -#ifndef DSP56156_OPCODE_H -#define DSP56156_OPCODE_H +#ifndef MAME_CPU_DSP56156_OPCODE_H +#define MAME_CPU_DSP56156_OPCODE_H #include "inst.h" #include "pmove.h" @@ -42,4 +42,4 @@ class Opcode } // namespace DSP_56156 -#endif +#endif // MAME_CPU_DSP56156_OPCODE_H diff --git a/src/devices/cpu/dsp56156/pmove.h b/src/devices/cpu/dsp56156/pmove.h index 2f75eff0b8b..55732661a97 100644 --- a/src/devices/cpu/dsp56156/pmove.h +++ b/src/devices/cpu/dsp56156/pmove.h @@ -1,7 +1,9 @@ // license:BSD-3-Clause // copyright-holders:Andrew Gardner -#ifndef DSP56156_PMOVE_H -#define DSP56156_PMOVE_H +#ifndef MAME_CPU_DSP56156_PMOVE_H +#define MAME_CPU_DSP56156_PMOVE_H + +#pragma once #include "opcode.h" #include "tables.h" @@ -9,8 +11,8 @@ // // A ParallelMove Object is what all parallel move classes inherit from. // -namespace DSP_56156 -{ +namespace DSP_56156 { + class Opcode; class ParallelMove @@ -316,5 +318,6 @@ class XMemoryDataMoveWithShortDisplacement: public ParallelMove std::string m_destination; }; -} -#endif +} // namespace DSP_56156 + +#endif // MAME_CPU_DSP56156_PMOVE_H diff --git a/src/devices/cpu/dsp56156/tables.h b/src/devices/cpu/dsp56156/tables.h index b6fe4fbe815..221dbd45df5 100644 --- a/src/devices/cpu/dsp56156/tables.h +++ b/src/devices/cpu/dsp56156/tables.h @@ -1,16 +1,16 @@ // license:BSD-3-Clause // copyright-holders:Andrew Gardner -#ifndef DSP56156_TABLES_H -#define DSP56156_TABLES_H +#ifndef MAME_CPU_DSP56156_TABLES_H +#define MAME_CPU_DSP56156_TABLES_H -#include -#include +#pragma once #include "dsp56156.h" -namespace DSP_56156 -{ -#define BITSn(CUR,MASK) (dsp56156_op_maskn(CUR,MASK)) +#include +#include + +namespace DSP_56156 { enum bitsModified {BM_NONE = 0x0, BM_LOW = 0x1, BM_MIDDLE = 0x2, BM_HIGH = 0x4}; @@ -77,6 +77,7 @@ int8_t get_6_bit_signed_value(uint16_t bits); // Helpers uint16_t dsp56156_op_maskn(uint16_t cur, uint16_t mask); +inline uint16_t BITSn(uint16_t cur, uint16_t mask) { return dsp56156_op_maskn(cur, mask); } bool registerOverlap(const reg_id& r0, const size_t bmd, const reg_id& r1); @@ -88,6 +89,6 @@ std::string opMnemonicAsString(const op_mnem& mnem); reg_id stringAsRegID(const std::string& str); uint8_t regIDAsNum(const reg_id& regId); +} // namespace DSP_56156 -} -#endif +#endif // MAME_CPU_DSP56156_TABLES_H diff --git a/src/devices/cpu/dspp/dsppfe.h b/src/devices/cpu/dspp/dsppfe.h index b3eb5cb0d4d..5c0023e313a 100644 --- a/src/devices/cpu/dspp/dsppfe.h +++ b/src/devices/cpu/dspp/dsppfe.h @@ -8,8 +8,10 @@ ***************************************************************************/ -#ifndef DEVICES_CPU_DSPP_DSPPFE_H -#define DEVICES_CPU_DSPP_DSPPFE_H +#ifndef MAME_CPU_DSPP_DSPPFE_H +#define MAME_CPU_DSPP_DSPPFE_H + +#pragma once #include "dspp.h" #include "cpu/drcfe.h" @@ -69,5 +71,4 @@ class dspp_frontend : public drc_frontend dspp_device *m_dspp; }; - -#endif /* DEVICES_CPU_DSPP_DSPPFE_H */ +#endif // MAME_CPU_DSPP_DSPPFE_H diff --git a/src/devices/cpu/e132xs/32xsdefs.h b/src/devices/cpu/e132xs/32xsdefs.h index 78413ec5863..b8ef2ade6b9 100644 --- a/src/devices/cpu/e132xs/32xsdefs.h +++ b/src/devices/cpu/e132xs/32xsdefs.h @@ -1,7 +1,9 @@ // license:BSD-3-Clause // copyright-holders:Pierpaolo Prazzoli -#ifndef MAME_CPU_E132XS_XS32DEFS_H -#define MAME_CPU_E132XS_XS32DEFS_H +#ifndef MAME_CPU_E132XS_32XSDEFS_H +#define MAME_CPU_E132XS_32XSDEFS_H + +#pragma once /*************************************************************************** COMPILE-TIME DEFINITIONS @@ -225,6 +227,4 @@ //other bits are reversed, in particular 7 - 5 for the operating system. //the user program can only change the above 2 flags - -#endif // MAME_CPU_E132XS_XS32DEFS_H - +#endif // MAME_CPU_E132XS_32XSDEFS_H diff --git a/src/devices/cpu/e132xs/e132xsdrc_ops.hxx b/src/devices/cpu/e132xs/e132xsdrc_ops.hxx index 9679faf8364..82f915354e9 100644 --- a/src/devices/cpu/e132xs/e132xsdrc_ops.hxx +++ b/src/devices/cpu/e132xs/e132xsdrc_ops.hxx @@ -1,5 +1,9 @@ // license:BSD-3-Clause // copyright-holders:Ryan Holtz +#ifndef MAME_CPU_E132XS_E132XSDRC_OPS_HXX +#define MAME_CPU_E132XS_E132XSDRC_OPS_HXX + +#pragma once #include "e132xs.h" @@ -5207,3 +5211,4 @@ void hyperstone_device::generate_do(drcuml_block &block, compiler_state &compile fatalerror(" "); } +#endif // MAME_CPU_E132XS_E132XSDRC_OPS_HXX diff --git a/src/devices/cpu/es5510/es5510d.h b/src/devices/cpu/es5510/es5510d.h index e80b4a3fe36..7814a8ee17f 100644 --- a/src/devices/cpu/es5510/es5510d.h +++ b/src/devices/cpu/es5510/es5510d.h @@ -7,8 +7,8 @@ * ***************************************************************************/ -#ifndef MAME_CPU_ES5510_ES5510DASM_H -#define MAME_CPU_ES5510_ES5510DASM_H +#ifndef MAME_CPU_ES5510_ES5510D_H +#define MAME_CPU_ES5510_ES5510D_H #pragma once @@ -22,4 +22,4 @@ class es5510_disassembler : public util::disasm_interface virtual offs_t disassemble(std::ostream &stream, offs_t pc, const data_buffer &opcodes, const data_buffer ¶ms) override; }; -#endif +#endif // MAME_CPU_ES5510_ES5510D_H diff --git a/src/devices/cpu/evolution/evo.h b/src/devices/cpu/evolution/evo.h index db71b475f10..ce5884d2dab 100644 --- a/src/devices/cpu/evolution/evo.h +++ b/src/devices/cpu/evolution/evo.h @@ -1,8 +1,8 @@ // license:BSD-3-Clause // copyright-holders:David Haywood -#ifndef MAME_CPU_EVO_EVO_H -#define MAME_CPU_EVO_EVO_H +#ifndef MAME_CPU_EVOLUTION_EVO_H +#define MAME_CPU_EVOLUTION_EVO_H #pragma once @@ -36,4 +36,4 @@ class evo_cpu_device : public cpu_device DECLARE_DEVICE_TYPE(EVOLUTION_CPU, evo_cpu_device) -#endif // MAME_CPU_EVO_EVO_H +#endif // MAME_CPU_EVOLUTION_EVO_H diff --git a/src/devices/cpu/f2mc16/f2mc16_reload.h b/src/devices/cpu/f2mc16/f2mc16_reload.h index 185f2bbabb3..2543290a81c 100644 --- a/src/devices/cpu/f2mc16/f2mc16_reload.h +++ b/src/devices/cpu/f2mc16/f2mc16_reload.h @@ -6,8 +6,8 @@ ***************************************************************************/ -#ifndef MAME_CPU_F2MC16_F2MC16_TIMER_H -#define MAME_CPU_F2MC16_F2MC16_TIMER_H +#ifndef MAME_CPU_F2MC16_F2MC16_RELOAD_H +#define MAME_CPU_F2MC16_F2MC16_RELOAD_H #pragma once @@ -72,4 +72,4 @@ class f2mc16_reload_timer_device : DECLARE_DEVICE_TYPE(F2MC16_RELOAD_TIMER, f2mc16_reload_timer_device) -#endif +#endif // MAME_CPU_F2MC16_F2MC16_RELOAD_H diff --git a/src/devices/cpu/f2mc16/mb90640a.h b/src/devices/cpu/f2mc16/mb90640a.h index dbf5b198960..c4bcff49a46 100644 --- a/src/devices/cpu/f2mc16/mb90640a.h +++ b/src/devices/cpu/f2mc16/mb90640a.h @@ -1,7 +1,7 @@ // license:BSD-3-Clause // copyright-holders:smf -#ifndef MAME_CPU_F2MC16_MB90640_H -#define MAME_CPU_F2MC16_MB90640_H +#ifndef MAME_CPU_F2MC16_MB90640A_H +#define MAME_CPU_F2MC16_MB90640A_H #pragma once @@ -49,4 +49,4 @@ class mb90641a_device : public mb90640a_device DECLARE_DEVICE_TYPE(MB90641A, mb90641a_device) -#endif // MAME_CPU_F2MC16_MB90640_H +#endif // MAME_CPU_F2MC16_MB90640A_H diff --git a/src/devices/cpu/gigatron/gigatron.h b/src/devices/cpu/gigatron/gigatron.h index 23c505c24c9..af516640240 100644 --- a/src/devices/cpu/gigatron/gigatron.h +++ b/src/devices/cpu/gigatron/gigatron.h @@ -11,8 +11,8 @@ * *****************************************************************************/ -#ifndef MAME_CPU_GTRON_H -#define MAME_CPU_GTRON_H +#ifndef MAME_CPU_GIGATRON_GIGATRON_H +#define MAME_CPU_GIGATRON_GIGATRON_H #pragma once @@ -34,23 +34,23 @@ class gigatron_cpu_device : public cpu_device auto ir_cb() { return m_ir_cb.bind(); } protected: - // device-level overrides + // device_t implementation virtual void device_start() override ATTR_COLD; virtual void device_reset() override ATTR_COLD; - // device_execute_interface overrides + // device_execute_interface implementation virtual uint32_t execute_min_cycles() const noexcept override { return 1; } virtual uint32_t execute_max_cycles() const noexcept override { return 7; } virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; - // device_state_interface overrides + // device_state_interface implementation virtual void state_string_export(const device_state_entry &entry, std::string &str) const override; - // device_disasm_interface overrides + // device_disasm_interface implementation virtual std::unique_ptr create_disassembler() override; - // device_memory_interface overrides + // device_memory_interface implementation virtual space_config_vector memory_space_config() const override; void reset_cpu(); @@ -92,7 +92,4 @@ class gigatron_cpu_device : public cpu_device DECLARE_DEVICE_TYPE(GTRON, gigatron_cpu_device) - - -#endif // MAME_CPU_GTRON_H - +#endif // MAME_CPU_GIGATRON_GIGATRON_H diff --git a/src/devices/cpu/hcd62121/hcd62121.cpp b/src/devices/cpu/hcd62121/hcd62121.cpp index 641ea096fe3..08b1707da15 100644 --- a/src/devices/cpu/hcd62121/hcd62121.cpp +++ b/src/devices/cpu/hcd62121/hcd62121.cpp @@ -66,9 +66,14 @@ hcd62121_cpu_device::hcd62121_cpu_device(const machine_config &mconfig, const ch , m_f(0) , m_time(0) , m_time_op(0) + , m_unk_f5(0) , m_cycles_until_timeout(0) , m_is_timer_started(false) + , m_is_timer_irq_enabled(false) + , m_is_timer_irq_asserted(false) + , m_is_timer_wait_elapsed(true) , m_is_infinite_timeout(false) + , m_timer_cycles(0) , m_lar(0) , m_opt(0) , m_port(0) @@ -145,12 +150,12 @@ void hcd62121_cpu_device::write_reg(int size, u8 op1) if (op1 & 0x80) { for (int i = 0; i < size; i++) - m_reg[(op1 - i) & 0x7f] = m_temp1[i]; + set_reg((op1 - i) & 0x7f, m_temp1[i]); } else { for (int i = 0; i < size; i++) - m_reg[(op1 + i) & 0x7f] = m_temp1[i]; + set_reg((op1 + i) & 0x7f, m_temp1[i]); } } @@ -219,13 +224,13 @@ void hcd62121_cpu_device::write_regreg(int size, u8 arg1, u8 arg2) { /* store in arg1 */ for (int i = 0; i < size; i++) - m_reg[(arg1 + i) & 0x7f] = m_temp1[i]; + set_reg((arg1 + i) & 0x7f, m_temp1[i]); } else { /* store in arg2 */ for (int i = 0; i < size; i++) - m_reg[(arg2 + i) & 0x7f] = m_temp1[i]; + set_reg((arg2 + i) & 0x7f, m_temp1[i]); } } @@ -286,7 +291,7 @@ void hcd62121_cpu_device::write_iregreg(int size, u8 op1, u8 op2) { /* store in reg2 */ for (int i = 0; i < size; i++) - m_reg[(op2 + i) & 0x7f] = m_temp1[i]; + set_reg((op2 + i) & 0x7f, m_temp1[i]); } } @@ -297,7 +302,7 @@ void hcd62121_cpu_device::write_iregreg2(int size, u8 op1, u8 op2) { /* store in reg2 */ for (int i = 0; i < size; i++) - m_reg[(op2 + i) & 0x7f] = m_temp2[i]; + set_reg((op2 + i) & 0x7f, m_temp2[i]); } else { @@ -574,17 +579,22 @@ void hcd62121_cpu_device::device_reset() { m_sp = 0x0000; m_ip = 0x0000; + m_dsize = 0; m_cseg = 0; m_dseg = 0; m_sseg = 0; - m_lar = 0; m_f = 0; m_time = 0; m_time_op = 0; + m_unk_f5 = 0; m_cycles_until_timeout = 0; m_is_timer_started = false; + m_is_timer_irq_enabled = false; + m_is_timer_irq_asserted = false; + m_is_timer_wait_elapsed = true; m_is_infinite_timeout = false; - m_dsize = 0; + m_timer_cycles = 0; + m_lar = 0; m_opt = 0; m_port = 0; @@ -869,15 +879,29 @@ inline void hcd62121_cpu_device::op_sub(int size) } +inline void hcd62121_cpu_device::op_pushb(u8 source) +{ + m_program->write_byte((m_sseg << 16) | m_sp, source); + m_sp--; +} + + inline void hcd62121_cpu_device::op_pushw(u16 source) { - m_program->write_byte(( m_sseg << 16) | m_sp, source & 0xff); + m_program->write_byte((m_sseg << 16) | m_sp, source & 0xff); m_sp--; - m_program->write_byte(( m_sseg << 16) | m_sp, source >> 8); + m_program->write_byte((m_sseg << 16) | m_sp, source >> 8); m_sp--; } +inline u8 hcd62121_cpu_device::op_popb() +{ + m_sp++; + return m_program->read_byte((m_sseg << 16) | m_sp); +} + + inline u16 hcd62121_cpu_device::op_popw() { m_sp++; @@ -888,14 +912,29 @@ inline u16 hcd62121_cpu_device::op_popw() return res; } +void hcd62121_cpu_device::timer_elapsed() +{ + m_is_timer_wait_elapsed = true; + + if (m_is_timer_irq_enabled) + { + m_is_timer_irq_asserted = true; + + // Call timer interrupt vector. + op_pushb(m_cseg); + op_pushw(m_ip); + m_cseg = 0x00; + m_ip = 0x0008; + } +} void hcd62121_cpu_device::execute_run() { do { - if (m_ki_cb() != 0) + if (m_ki_cb() != 0 && m_input_flag_cb() == 0) { - m_cycles_until_timeout = 0; + m_is_timer_wait_elapsed = true; m_is_infinite_timeout = false; } @@ -904,15 +943,26 @@ void hcd62121_cpu_device::execute_run() set_input_flag(false); } - if (m_is_infinite_timeout) + if (m_is_infinite_timeout && !m_is_timer_wait_elapsed) { m_icount = 0; } - else if (m_cycles_until_timeout > 0) + else if (m_cycles_until_timeout > 0 && !m_is_timer_irq_asserted) { int cycles_to_consume = std::min(m_cycles_until_timeout, m_icount); m_cycles_until_timeout -= cycles_to_consume; - m_icount -= cycles_to_consume; + + if (!m_is_timer_wait_elapsed) + { + // It's a blocking wait, consume as much as possible in this quantum. + m_icount -= cycles_to_consume; + } + + if (m_cycles_until_timeout <= 0) + { + m_cycles_until_timeout += m_timer_cycles; + timer_elapsed(); + } } if (m_icount <= 0) { @@ -1656,7 +1706,22 @@ void hcd62121_cpu_device::execute_run() break; case 0x8E: /* unk_8E */ - logerror("%02x:%04x: unimplemented instruction %02x encountered\n", m_cseg, m_ip-1, op); + { + logerror("%02x:%04x: unimplemented instruction %02x encountered\n", m_cseg, m_ip-1, op); + if (m_unk_f5 == 0xd0) + { + /* + FIXME: Needs to be validated with hardware tests. + + Instruction 0x8E is called before reading and testing inputs in some cases. + While the timer is also configured, there's no blocking wait for it to expire. + Instead, there's a busy wait on 2 bytes at register R76 that aren't updated directly by + program code. So far only seen when instruction 0xF5 is executed with operand 0xD0, but + maybe irrelevant, see JD-364 @ 21:b65f. + */ + m_is_timer_irq_enabled = true; + } + } break; case 0x90: /* retzh */ @@ -1685,6 +1750,12 @@ void hcd62121_cpu_device::execute_run() } break; + case 0x9E: /* reti */ + m_ip = op_popw(); + m_cseg = op_popb(); + m_is_timer_irq_asserted = false; + break; + case 0x9F: /* ret */ m_ip = op_popw(); break; @@ -1738,7 +1809,72 @@ void hcd62121_cpu_device::execute_run() { u8 arg = read_op(); + /* + When timer control is set with operand 0xC0, the CPU periodically reads + from external RAM (address range 0x7c00..0x7fff) at an interval of + 832 clock cycles, with the reads themselves taking another 64 clock cycles. + This needs to be explicitly setup, involving writes to unknown segments + 0x11 and 0xE1 (see cfx9850.bin @ 00:00fe), otherwise there's only activity + on address lines without any reads. + + The total sum of these state reads can be approximated to the closest + power of two to define timeout values. Multiple samples were averaged, + as the state read interval can start at a distinct point in time from + the timer wait execution. + */ + const u64 TIMER_STATE_READ_CYCLES = 832 + 64; + m_is_infinite_timeout = false; + m_is_timer_wait_elapsed = true; + m_cycles_until_timeout = m_timer_cycles = 0; m_time_op = arg; + switch (m_time_op) + { + case 0x01: case 0x03: + // Likely only timeouts on KO enabled input. + m_is_infinite_timeout = true; + break; + case 0x11: case 0x13: case 0x15: case 0x17: case 0x19: case 0x1b: case 0x1d: case 0x1f: + case 0x31: case 0x33: case 0x35: case 0x37: case 0x39: case 0x3b: case 0x3d: case 0x3f: + case 0x51: case 0x53: case 0x55: case 0x57: case 0x59: case 0x5b: case 0x5d: case 0x5f: + case 0x71: case 0x73: case 0x75: case 0x77: case 0x79: case 0x7b: case 0x7d: case 0x7f: + case 0x91: case 0x93: case 0x95: case 0x97: case 0x99: case 0x9b: case 0x9d: case 0x9f: + case 0xb1: case 0xb3: case 0xb5: case 0xb7: case 0xb9: case 0xbb: case 0xbd: case 0xbf: + case 0xd1: case 0xd3: case 0xd5: case 0xd7: case 0xd9: case 0xdb: case 0xdd: case 0xdf: + // Approximately 814.32us + m_timer_cycles = 0x4 * TIMER_STATE_READ_CYCLES; + break; + case 0x21: case 0x23: case 0x25: case 0x27: case 0x29: case 0x2b: case 0x2d: case 0x2f: + case 0x61: case 0x63: case 0x65: case 0x67: case 0x69: case 0x6b: case 0x6d: case 0x6f: + case 0xa1: case 0xa3: case 0xa5: case 0xa7: case 0xa9: case 0xab: case 0xad: case 0xaf: + // Approximately 1.63ms + m_timer_cycles = 0x8 * TIMER_STATE_READ_CYCLES; + break; + case 0x05: case 0x07: case 0x0d: case 0x0f: + case 0x45: case 0x47: case 0x4d: case 0x4f: + case 0xc5: case 0xc7: case 0xcd: case 0xcf: + // Approximately 209.34ms + m_timer_cycles = 0x400 * TIMER_STATE_READ_CYCLES; + break; + case 0x09: case 0x0b: + case 0x49: case 0x4b: + case 0xc9: case 0xcb: + // Approximately 837.61ms + m_timer_cycles = 0x1000 * TIMER_STATE_READ_CYCLES; + break; + case 0x41: case 0x43: + case 0xc1: case 0xc3: + // Approximately 1.68s + m_timer_cycles = 0x2000 * TIMER_STATE_READ_CYCLES; + break; + case 0x81: case 0x83: + // Approximately 100.58s + m_timer_cycles = 0x7a800 * TIMER_STATE_READ_CYCLES; + break; + default: + logerror("%02x:%04x: unimplemented timer value %02x encountered\n", m_cseg, m_ip-1, m_time_op); + break; + } + m_cycles_until_timeout = m_timer_cycles; m_is_timer_started = true; } break; @@ -1804,7 +1940,7 @@ void hcd62121_cpu_device::execute_run() for (int i = 0; i < size; i++) { - m_reg[(reg + i) & 0x7f] = read_op(); + set_reg((reg + i) & 0x7f, read_op()); } } break; @@ -1848,7 +1984,18 @@ void hcd62121_cpu_device::execute_run() m_lar += pre_inc; if (arg1 & 0x80) { + /* + FIXME: Needs to be validated with hardware tests. + + JD-368 @ 20:047a must write value 0x7f @ 40:1819, despite 0x7f7f being + expected @ 20:3492. This routine is used to clear RAM, and will overflow + if 40:1818 = 0xff7f7f, since it will loop beyond the expected 0x8000 size + to clear. + + Does this instruction zero-extend immediate values? + */ m_program->write_byte((m_dseg << 16) | m_lar, arg2); + arg2 = 0; } else { @@ -1863,7 +2010,7 @@ void hcd62121_cpu_device::execute_run() for (int i = 0; i < size; i++) { m_lar += pre_inc; - m_reg[(arg2 + i) & 0x7f] = m_program->read_byte((m_dseg << 16) | m_lar); + set_reg((arg2 + i) & 0x7f, m_program->read_byte((m_dseg << 16) | m_lar)); m_lar += post_inc; } } @@ -1970,16 +2117,16 @@ void hcd62121_cpu_device::execute_run() logerror("%06x: in0 read\n", (m_cseg << 16) | m_ip); u8 reg1 = read_op(); - m_reg[reg1 & 0x7f] = m_in0_cb(); + set_reg(reg1 & 0x7f, m_in0_cb()); } break; case 0xE1: /* movb reg,OPT */ - m_reg[read_op() & 0x7f] = m_opt; + set_reg(read_op() & 0x7f, m_opt); break; case 0xE2: /* in kb, reg */ - m_reg[read_op() & 0x7f] = m_ki_cb(); + set_reg(read_op() & 0x7f, m_ki_cb()); break; case 0xE3: /* movb reg,dsize */ @@ -1987,7 +2134,7 @@ void hcd62121_cpu_device::execute_run() u8 reg = read_op(); if (reg & 0x80) fatalerror("%02x:%04x: unimplemented instruction %02x encountered with (arg & 0x80) != 0\n", m_cseg, m_ip-1, op); - m_reg[reg & 0x7f] = m_dsize; + set_reg(reg & 0x7f, m_dsize); } break; @@ -1996,24 +2143,24 @@ void hcd62121_cpu_device::execute_run() u8 reg = read_op(); if (reg & 0x80) fatalerror("%02x:%04x: unimplemented instruction %02x encountered with (arg & 0x80) != 0\n", m_cseg, m_ip-1, op); - m_reg[reg & 0x7f] = m_f; + set_reg(reg & 0x7f, m_f); } break; case 0xE5: /* movb reg,TIME */ - m_reg[read_op() & 0x7f] = m_time; + set_reg(read_op() & 0x7f, m_time); break; case 0xE6: /* movb reg,PORT */ - m_reg[read_op() & 0x7f] = m_port; + set_reg(read_op() & 0x7f, m_port); break; case 0xE8: /* movw r1,lar */ { u8 reg1 = read_op(); - m_reg[reg1 & 0x7f] = m_lar & 0xff; - m_reg[(reg1 + 1) & 0x7f] = m_lar >> 8; + set_reg(reg1 & 0x7f, m_lar & 0xff); + set_reg((reg1 + 1) & 0x7f, m_lar >> 8); } break; @@ -2021,8 +2168,8 @@ void hcd62121_cpu_device::execute_run() { u8 reg1 = read_op(); - m_reg[reg1 & 0x7f] = m_ip & 0xff; - m_reg[(reg1 + 1) & 0x7f] = m_ip >> 8; + set_reg(reg1 & 0x7f, m_ip & 0xff); + set_reg((reg1 + 1) & 0x7f, m_ip >> 8); } break; @@ -2030,21 +2177,21 @@ void hcd62121_cpu_device::execute_run() { u8 reg1 = read_op(); - m_reg[reg1 & 0x7f] = m_sp & 0xff; - m_reg[(reg1 + 1) & 0x7f] = m_sp >> 8; + set_reg(reg1 & 0x7f, m_sp & 0xff); + set_reg((reg1 + 1) & 0x7f, m_sp >> 8); } break; case 0xED: /* movb reg,ds */ - m_reg[read_op() & 0x7f] = m_dseg; + set_reg(read_op() & 0x7f, m_dseg); break; case 0xEE: /* movb reg,cs */ - m_reg[read_op() & 0x7f] = m_cseg; + set_reg(read_op() & 0x7f, m_cseg); break; case 0xEF: /* movb reg,ss */ - m_reg[read_op() & 0x7f] = m_sseg; + set_reg(read_op() & 0x7f, m_sseg); break; case 0xF0: /* movb OPT,reg */ @@ -2057,170 +2204,33 @@ void hcd62121_cpu_device::execute_run() m_port_cb(m_port); break; + case 0xF5: /* unk_F5 reg/i8 (out?) */ + logerror("%02x:%04x: unimplemented instruction %02x encountered\n", m_cseg, m_ip-1, op); + m_unk_f5 = read_op(); + break; + case 0xF1: /* unk_F1 reg/i8 (out?) */ case 0xF3: /* unk_F3 reg/i8 (out?) */ - case 0xF5: /* unk_F5 reg/i8 (out?) */ case 0xF6: /* unk_F6 reg/i8 (out?) */ case 0xF7: /* timer_ctrl i8 */ + case 0xF8: /* unk_F8 reg/i8 (out?) */ logerror("%02x:%04x: unimplemented instruction %02x encountered\n", m_cseg, m_ip-1, op); read_op(); break; - case 0xFC: /* unk_FC - disable interrupts/stop timer?? */ - logerror("%02x:%04x: unimplemented instruction %02x encountered\n", m_cseg, m_ip-1, op); + case 0xFC: /* timer_clear */ + // FIXME: Needs to be validated with hardware tests. + m_cycles_until_timeout = m_timer_cycles = 0; + m_is_timer_irq_enabled = false; + m_is_timer_irq_asserted = false; + m_is_timer_wait_elapsed = true; break; case 0xFD: /* timer_wait_low (no X1 clock, address or data bus activity) */ case 0xFE: /* timer_wait */ - if (m_time_op & 0x01) + if (BIT(m_time_op, 0)) { - /* - When timer control is set with operand 0xC0, the CPU periodically reads - from external RAM (address range 0x7c00..0x7fff) at an interval of - 832 clock cycles, with the reads themselves taking another 64 clock cycles. - This needs to be explicitly setup, involving writes to unknown segments - 0x11 and 0xE1 (see cfx9850.bin @ 00:00fe), otherwise there's only activity - on address lines without any reads. - - The total sum of these state reads can be approximated to the closest - power of two to define timeout values. Multiple samples were averaged, - as the state read interval can start at a distinct point in time from - the timer wait execution. - */ - const u64 TIMER_STATE_READ_CYCLES = 832 + 64; - switch (m_time_op) - { - case 0x01: - case 0x03: - // Likely only timeouts on KO enabled input. - m_is_infinite_timeout = true; - break; - case 0x11: - case 0x13: - case 0x15: - case 0x17: - case 0x19: - case 0x1b: - case 0x1d: - case 0x1f: - case 0x31: - case 0x33: - case 0x35: - case 0x37: - case 0x39: - case 0x3b: - case 0x3d: - case 0x3f: - case 0x51: - case 0x53: - case 0x55: - case 0x57: - case 0x59: - case 0x5b: - case 0x5d: - case 0x5f: - case 0x71: - case 0x73: - case 0x75: - case 0x77: - case 0x79: - case 0x7b: - case 0x7d: - case 0x7f: - case 0x91: - case 0x93: - case 0x95: - case 0x97: - case 0x99: - case 0x9b: - case 0x9d: - case 0x9f: - case 0xb1: - case 0xb3: - case 0xb5: - case 0xb7: - case 0xb9: - case 0xbb: - case 0xbd: - case 0xbf: - case 0xd1: - case 0xd3: - case 0xd5: - case 0xd7: - case 0xd9: - case 0xdb: - case 0xdd: - case 0xdf: - // Approximately 814.32us - m_cycles_until_timeout = 0x4 * TIMER_STATE_READ_CYCLES; - break; - case 0x21: - case 0x23: - case 0x25: - case 0x27: - case 0x29: - case 0x2b: - case 0x2d: - case 0x2f: - case 0x61: - case 0x63: - case 0x65: - case 0x67: - case 0x69: - case 0x6b: - case 0x6d: - case 0x6f: - case 0xa1: - case 0xa3: - case 0xa5: - case 0xa7: - case 0xa9: - case 0xab: - case 0xad: - case 0xaf: - // Approximately 1.63ms - m_cycles_until_timeout = 0x8 * TIMER_STATE_READ_CYCLES; - break; - case 0x05: - case 0x07: - case 0x0d: - case 0x0f: - case 0x45: - case 0x47: - case 0x4d: - case 0x4f: - case 0xc5: - case 0xc7: - case 0xcd: - case 0xcf: - // Approximately 209.34ms - m_cycles_until_timeout = 0x400 * TIMER_STATE_READ_CYCLES; - break; - case 0x09: - case 0x0b: - case 0x49: - case 0x4b: - case 0xc9: - case 0xcb: - // Approximately 837.61ms - m_cycles_until_timeout = 0x1000 * TIMER_STATE_READ_CYCLES; - break; - case 0x41: - case 0x43: - case 0xc1: - case 0xc3: - // Approximately 1.68s - m_cycles_until_timeout = 0x2000 * TIMER_STATE_READ_CYCLES; - break; - case 0x81: - case 0x83: - // Approximately 100.58s - m_cycles_until_timeout = 0x7a800 * TIMER_STATE_READ_CYCLES; - break; - default: - logerror("%02x:%04x: unimplemented timer value %02x encountered\n", m_cseg, m_ip-1, m_time_op); - break; - } + m_is_timer_wait_elapsed = false; } else { diff --git a/src/devices/cpu/hcd62121/hcd62121.h b/src/devices/cpu/hcd62121/hcd62121.h index 51404f95318..98d6e23ad7f 100644 --- a/src/devices/cpu/hcd62121/hcd62121.h +++ b/src/devices/cpu/hcd62121/hcd62121.h @@ -83,8 +83,12 @@ class hcd62121_cpu_device : public cpu_device void op_addb(int size); void op_subb(int size); void op_sub(int size); + void op_pushb(u8 source); void op_pushw(u16 source); + u8 op_popb(); u16 op_popw(); + void set_reg(u8 i, u8 val) { m_reg[i] = val; /*logerror("R%02X = %02x @ %06X\n", i, val, (m_cseg << 16) | m_ip);*/ } + void timer_elapsed(); address_space_config m_program_config; @@ -98,9 +102,14 @@ class hcd62121_cpu_device : public cpu_device u8 m_f; u8 m_time; u8 m_time_op; + u8 m_unk_f5; s32 m_cycles_until_timeout; bool m_is_timer_started; + bool m_is_timer_irq_enabled; + bool m_is_timer_irq_asserted; + bool m_is_timer_wait_elapsed; bool m_is_infinite_timeout; + s32 m_timer_cycles; emu_timer *m_timer; u16 m_lar; u8 m_reg[0x80]; diff --git a/src/devices/cpu/hcd62121/hcd62121d.cpp b/src/devices/cpu/hcd62121/hcd62121d.cpp index 661d40b1701..86109e67287 100644 --- a/src/devices/cpu/hcd62121/hcd62121d.cpp +++ b/src/devices/cpu/hcd62121/hcd62121d.cpp @@ -157,14 +157,14 @@ const hcd62121_disassembler::dasm hcd62121_disassembler::ops[256] = { "movb", ARG_REG, ARG_CS }, { "movb", ARG_REG, ARG_SS }, /* 0xf0 */ - { "movb", ARG_OPT, ARG_REG }, { "unF1?", ARG_I8, ARG_NONE }, - { "movb", ARG_PORT, ARG_REG }, { "unF3?", ARG_I8, ARG_NONE }, - { "unF4?", ARG_I8, ARG_NONE }, { "unF5?", ARG_I8, ARG_NONE }, - { "unF6?", ARG_I8, ARG_NONE }, { "timer_ctrl", ARG_I8, ARG_NONE }, - { "unF8?", ARG_NONE, ARG_NONE }, { "unF9?", ARG_NONE, ARG_NONE }, - { "unFA?", ARG_NONE, ARG_NONE }, { "unFb?", ARG_NONE, ARG_NONE }, - { "unFC?", ARG_NONE, ARG_NONE }, { "timer_wait_low", ARG_NONE, ARG_NONE }, - { "timer_wait", ARG_NONE, ARG_NONE }, { "nop", ARG_NONE, ARG_NONE } + { "movb", ARG_OPT, ARG_REG }, { "unF1?", ARG_I8, ARG_NONE }, + { "movb", ARG_PORT, ARG_REG }, { "unF3?", ARG_I8, ARG_NONE }, + { "unF4?", ARG_I8, ARG_NONE }, { "unF5?", ARG_I8, ARG_NONE }, + { "unF6?", ARG_I8, ARG_NONE }, { "timer_ctrl", ARG_I8, ARG_NONE }, + { "unF8?", ARG_I8, ARG_NONE }, { "unF9?", ARG_NONE, ARG_NONE }, + { "unFA?", ARG_NONE, ARG_NONE }, { "unFb?", ARG_NONE, ARG_NONE }, + { "timer_clear", ARG_NONE, ARG_NONE }, { "timer_wait_low", ARG_NONE, ARG_NONE }, + { "timer_wait", ARG_NONE, ARG_NONE }, { "nop", ARG_NONE, ARG_NONE } }; u32 hcd62121_disassembler::opcode_alignment() const diff --git a/src/devices/cpu/i386/cycles.h b/src/devices/cpu/i386/cycles.h index 2ca28aff180..f6721a39549 100644 --- a/src/devices/cpu/i386/cycles.h +++ b/src/devices/cpu/i386/cycles.h @@ -1,10 +1,10 @@ // license:BSD-3-Clause // copyright-holders:Ville Linde, Barry Rodewald, Carl, Philip Bennett -#pragma once +#ifndef MAME_CPU_I386_CYCLES_H +#define MAME_CPU_I386_CYCLES_H -#ifndef __CYCLES_H__ -#define __CYCLES_H__ +#pragma once struct X86_CYCLE_TABLE { @@ -340,4 +340,4 @@ static const X86_CYCLE_TABLE x86_cycle_table[] = { CYCLES_CMPXCHG_REG_MEM_F, { { 0, 0 }, { 10, 10 }, { 10, 10 }, { 10, 10 } } }, }; -#endif /* __CYCLES_H__ */ +#endif // MAME_CPU_I386_CYCLES_H diff --git a/src/devices/cpu/i386/i386priv.h b/src/devices/cpu/i386/i386priv.h index 63814d2dc6e..3e5ea5b70f8 100644 --- a/src/devices/cpu/i386/i386priv.h +++ b/src/devices/cpu/i386/i386priv.h @@ -1,9 +1,9 @@ // license:BSD-3-Clause // copyright-holders:Ville Linde, Barry Rodewald, Carl, Philip Bennett -#pragma once +#ifndef MAME_CPU_I386_I386PRIV_H +#define MAME_CPU_I386_I386PRIV_H -#ifndef __I386_H__ -#define __I386_H__ +#pragma once #include "i386dasm.h" @@ -724,4 +724,4 @@ enum X86_CYCLES #define OP_4BYTE3AF2 0x00400000 #define OP_4BYTE38F3 0x00200000 -#endif /* __I386_H__ */ +#endif // MAME_CPU_I386_I386PRIV_H diff --git a/src/devices/cpu/i386/x87priv.h b/src/devices/cpu/i386/x87priv.h index 1d2c227b292..379a929f954 100644 --- a/src/devices/cpu/i386/x87priv.h +++ b/src/devices/cpu/i386/x87priv.h @@ -1,9 +1,9 @@ // license:BSD-3-Clause // copyright-holders:Philip Bennett -#pragma once +#ifndef MAME_CPU_I386_X87PRIV_H +#define MAME_CPU_I386_X87PRIV_H -#ifndef __X87PRIV_H__ -#define __X87PRIV_H__ +#pragma once #include @@ -165,4 +165,4 @@ void i386_device::WRITE80(uint32_t ea, floatx80 t) WRITE16(ea + 8, t.high); } -#endif /* __X87PRIV_H__ */ +#endif // MAME_CPU_I386_X87PRIV_H diff --git a/src/devices/cpu/i8089/i8089_channel.h b/src/devices/cpu/i8089/i8089_channel.h index a2481a97fb1..97a1ac36c4f 100644 --- a/src/devices/cpu/i8089/i8089_channel.h +++ b/src/devices/cpu/i8089/i8089_channel.h @@ -8,8 +8,8 @@ ***************************************************************************/ -#ifndef MAME_CPU_I8080_I8089_CHANNEL_H -#define MAME_CPU_I8080_I8089_CHANNEL_H +#ifndef MAME_CPU_I8089_I8089_CHANNEL_H +#define MAME_CPU_I8089_I8089_CHANNEL_H #pragma once @@ -206,4 +206,4 @@ class i8089_channel_device : public device_t // device type definition DECLARE_DEVICE_TYPE(I8089_CHANNEL, i8089_channel_device) -#endif // MAME_CPU_I8080_I8089_CHANNEL_H +#endif // MAME_CPU_I8089_I8089_CHANNEL_H diff --git a/src/devices/cpu/i8089/i8089_dasm.h b/src/devices/cpu/i8089/i8089_dasm.h index de699f7fb5d..f2626725081 100644 --- a/src/devices/cpu/i8089/i8089_dasm.h +++ b/src/devices/cpu/i8089/i8089_dasm.h @@ -8,8 +8,8 @@ ***************************************************************************/ -#ifndef MAME_CPU_I8089_I8089DASM_H -#define MAME_CPU_I8089_I8089DASM_H +#ifndef MAME_CPU_I8089_I8089_DASM_H +#define MAME_CPU_I8089_I8089_DASM_H #pragma once @@ -68,4 +68,4 @@ class i8089_disassembler : public util::disasm_interface void load_instruction(); }; -#endif +#endif // MAME_CPU_I8089_I8089_DASM_H diff --git a/src/devices/cpu/i860/i860dec.hxx b/src/devices/cpu/i860/i860dec.hxx index af286b04c4b..39723bbe43a 100644 --- a/src/devices/cpu/i860/i860dec.hxx +++ b/src/devices/cpu/i860/i860dec.hxx @@ -35,6 +35,11 @@ * today also use IEEE FP. * */ +#ifndef MAME_CPU_I860_I860DEC_HXX +#define MAME_CPU_I860_I860DEC_HXX + +#pragma once + #include "i860.h" #include @@ -4670,3 +4675,5 @@ void debugger (i860s *cpustate) } #endif + +#endif // MAME_CPU_I860_I860DEC_HXX diff --git a/src/devices/cpu/lr35902/lr35902d.h b/src/devices/cpu/lr35902/lr35902d.h index 550a8bdaef8..55216605f14 100644 --- a/src/devices/cpu/lr35902/lr35902d.h +++ b/src/devices/cpu/lr35902/lr35902d.h @@ -7,8 +7,8 @@ * *****************************************************************************/ -#ifndef MAME_CPU_LR35902_LR35902DASM_H -#define MAME_CPU_LR35902_LR35902DASM_H +#ifndef MAME_CPU_LR35902_LR35902D_H +#define MAME_CPU_LR35902_LR35902D_H #pragma once @@ -45,4 +45,4 @@ class lr35902_disassembler : public util::disasm_interface static const lr35902dasm mnemonic_main[256]; }; -#endif +#endif // MAME_CPU_LR35902_LR35902D_H diff --git a/src/devices/cpu/m68000/m68000mcu.h b/src/devices/cpu/m68000/m68000mcu.h index aa6d8309c44..8b50865f01f 100644 --- a/src/devices/cpu/m68000/m68000mcu.h +++ b/src/devices/cpu/m68000/m68000mcu.h @@ -1,7 +1,7 @@ // license:BSD-3-Clause // copyright-holders:Olivier Galibert -#ifndef MAME_CPU_M68000_M68000mcu_H -#define MAME_CPU_M68000_M68000mcu_H +#ifndef MAME_CPU_M68000_M68000MCU_H +#define MAME_CPU_M68000_M68000MCU_H #pragma once @@ -33,4 +33,4 @@ class m68000_mcu_device : public m68000_device void set_current_interrupt_level(u32 level); }; -#endif +#endif // MAME_CPU_M68000_M68000MCU_H diff --git a/src/devices/cpu/m68000/m68kfpu.cpp b/src/devices/cpu/m68000/m68kfpu.cpp index dda4c0fb4b6..75839bba69e 100644 --- a/src/devices/cpu/m68000/m68kfpu.cpp +++ b/src/devices/cpu/m68000/m68kfpu.cpp @@ -573,6 +573,10 @@ u32 m68000_musashi_device::READ_EA_32(int ea) { return REG_D()[reg]; } + case 1: // An + { + return REG_A()[reg]; + } case 2: // (An) { u32 ea = REG_A()[reg]; @@ -1865,20 +1869,7 @@ void m68000_musashi_device::fmove_fpcr(u16 w2) switch (mode) { case 0: // Dn - #if 0 - if (dir) - { - if (regsel & 4) WRITE_EA_32(ea, m_fpcr); - if (regsel & 2) WRITE_EA_32(ea, m_fpsr); - if (regsel & 1) WRITE_EA_32(ea, m_fpiar); - } - else - { - if (regsel & 4) m_fpcr = READ_EA_32(ea); - if (regsel & 2) m_fpsr = READ_EA_32(ea); - if (regsel & 1) m_fpiar = READ_EA_32(ea); - } - #endif + case 1: // An break; case 2: // (An) @@ -1943,6 +1934,7 @@ void m68000_musashi_device::fmove_fpcr(u16 w2) switch (mode) { case 0: // Dn + case 1: // An case 3: // (An)+ case 4: // -(An) if (dir) // From system control reg to diff --git a/src/devices/cpu/mb86235/mb86235fe.h b/src/devices/cpu/mb86235/mb86235fe.h index ef8bff02df8..309b30b9133 100644 --- a/src/devices/cpu/mb86235/mb86235fe.h +++ b/src/devices/cpu/mb86235/mb86235fe.h @@ -7,14 +7,14 @@ ******************************************************************************/ +#ifndef MAME_CPU_MB86235_MB86235FE_H +#define MAME_CPU_MB86235_MB86235FE_H + #pragma once #include "mb86235.h" #include "cpu/drcfe.h" -#ifndef __MB86235FE_H__ -#define __MB86235FE_H__ - class mb86235_frontend : public drc_frontend { public: @@ -44,4 +44,4 @@ class mb86235_frontend : public drc_frontend void describe_ea(opcode_desc &desc, int md, int arx, int ary, int disp); }; -#endif /* __MB86235FE_H__ */ +#endif // MAME_CPU_MB86235_MB86235FE_H diff --git a/src/devices/cpu/mcs48/mcs48dsm.h b/src/devices/cpu/mcs48/mcs48dsm.h index af437879212..3144796ad1a 100644 --- a/src/devices/cpu/mcs48/mcs48dsm.h +++ b/src/devices/cpu/mcs48/mcs48dsm.h @@ -7,8 +7,8 @@ ***************************************************************************/ -#ifndef MAME_CPU_MCS48_MCS48DASM_H -#define MAME_CPU_MCS48_MCS48DASM_H +#ifndef MAME_CPU_MCS48_MCS48DSM_H +#define MAME_CPU_MCS48_MCS48DSM_H #pragma once @@ -28,4 +28,4 @@ class mcs48_disassembler : public util::disasm_interface bool m_i802x; }; -#endif +#endif // MAME_CPU_MCS48_MCS48DSM_H diff --git a/src/devices/cpu/minx/minxd.h b/src/devices/cpu/minx/minxd.h index 08786c5dda8..4ab5803d1bb 100644 --- a/src/devices/cpu/minx/minxd.h +++ b/src/devices/cpu/minx/minxd.h @@ -7,8 +7,8 @@ ************************************************************/ -#ifndef MAME_CPU_MINX_MINXDASM_H -#define MAME_CPU_MINX_MINXDASM_H +#ifndef MAME_CPU_MINX_MINXD_H +#define MAME_CPU_MINX_MINXD_H #pragma once @@ -86,4 +86,4 @@ class minx_disassembler : public util::disasm_interface static const minxdasm mnemonic_cf[256]; }; -#endif +#endif // MAME_CPU_MINX_MINXD_H diff --git a/src/devices/cpu/patinhofeio/patinhofeio_cpu.h b/src/devices/cpu/patinhofeio/patinhofeio_cpu.h index fdef1418dce..a5df23f86dd 100644 --- a/src/devices/cpu/patinhofeio/patinhofeio_cpu.h +++ b/src/devices/cpu/patinhofeio/patinhofeio_cpu.h @@ -1,7 +1,7 @@ // license:GPL-2.0+ // copyright-holders:Felipe Sanches -#ifndef MAME_DEVICES_CPU_PATINHOFEIO_CPU_H -#define MAME_DEVICES_CPU_PATINHOFEIO_CPU_H +#ifndef MAME_CPU_PATINHOFEIO_PATINHOFEIO_CPU_H +#define MAME_CPU_PATINHOFEIO_PATINHOFEIO_CPU_H #pragma once @@ -132,4 +132,4 @@ class patinho_feio_cpu_device : public cpu_device { DECLARE_DEVICE_TYPE(PATO_FEIO_CPU, patinho_feio_cpu_device) -#endif // MAME_DEVICES_CPU_PATINHOFEIO_CPU_H +#endif // MAME_CPU_PATINHOFEIO_PATINHOFEIO_CPU_H diff --git a/src/devices/cpu/pdp8/pdp8.h b/src/devices/cpu/pdp8/pdp8.h index d481f2752bb..f8352f5fda5 100644 --- a/src/devices/cpu/pdp8/pdp8.h +++ b/src/devices/cpu/pdp8/pdp8.h @@ -6,10 +6,10 @@ Written by Ryan Holtz */ -#pragma once +#ifndef MAME_CPU_PDP8_PDP8_H +#define MAME_CPU_PDP8_PDP8_H -#ifndef __PDP8_H__ -#define __PDP8_H__ +#pragma once //************************************************************************** // TYPE DEFINITIONS @@ -105,4 +105,4 @@ enum PDP8_HALT }; -#endif /* __PDP8_H__ */ +#endif // MAME_CPU_PDP8_PDP8_H diff --git a/src/devices/cpu/s2650/2650dasm.cpp b/src/devices/cpu/s2650/2650dasm.cpp index 6b6fdf85095..a927ac4b759 100644 --- a/src/devices/cpu/s2650/2650dasm.cpp +++ b/src/devices/cpu/s2650/2650dasm.cpp @@ -12,32 +12,12 @@ #include "emu.h" #include "2650dasm.h" -/* handy table to build relative offsets from HR (holding register) */ -const int s2650_disassembler::rel[0x100] = { - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - -64,-63,-62,-61,-60,-59,-58,-57,-56,-55,-54,-53,-52,-51,-50,-49, - -48,-47,-46,-45,-44,-43,-42,-41,-40,-39,-38,-37,-36,-35,-34,-33, - -32,-31,-30,-29,-28,-27,-26,-25,-24,-23,-22,-21,-20,-19,-18,-17, - -16,-15,-14,-13,-12,-11,-10, -9, -8, -7, -6, -5, -4, -3, -2, -1, - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - -64,-63,-62,-61,-60,-59,-58,-57,-56,-55,-54,-53,-52,-51,-50,-49, - -48,-47,-46,-45,-44,-43,-42,-41,-40,-39,-38,-37,-36,-35,-34,-33, - -32,-31,-30,-29,-28,-27,-26,-25,-24,-23,-22,-21,-20,-19,-18,-17, - -16,-15,-14,-13,-12,-11,-10, -9, -8, -7, -6, -5, -4, -3, -2, -1, -}; - std::string s2650_disassembler::SYM(int addr) { return util::string_format("$%04x", addr); } -/* format an immediate */ +// format an immediate std::string s2650_disassembler::IMM(offs_t pc, const data_buffer ¶ms) { return util::string_format("$%02x", params.r8(pc)); @@ -52,7 +32,7 @@ void s2650_disassembler::add(std::string &buf, const std::string &str) buf += str; } -/* format an immediate for PSL */ +// format an immediate for PSL std::string s2650_disassembler::IMM_PSL(offs_t pc, const data_buffer ¶ms) { u8 v = params.r8(pc); @@ -68,23 +48,23 @@ std::string s2650_disassembler::IMM_PSL(offs_t pc, const data_buffer ¶ms) case 0x80: add(buff, "m"); break; case 0xc0: add(buff, "cc"); break; } - if (v & 0x20) /* inter digit carry */ + if (v & 0x20) // inter digit carry add(buff, "idc"); - if (v & 0x10) /* register select */ + if (v & 0x10) // register select add(buff, "rs"); - if (v & 0x08) /* with carry */ + if (v & 0x08) // with carry add(buff, "wc"); - if (v & 0x04) /* overflow */ + if (v & 0x04) // overflow add(buff, "ovf"); - if (v & 0x02) /* 2's complement comparisons */ + if (v & 0x02) // 2's complement comparisons add(buff, "com"); - if (v & 0x01) /* carry */ + if (v & 0x01) // carry add(buff, "c"); return buff; } } -/* format an immediate for PSU (processor status upper) */ +// format an immediate for PSU (processor status upper) std::string s2650_disassembler::IMM_PSU(offs_t pc, const data_buffer ¶ms) { int v = params.r8(pc); @@ -94,45 +74,45 @@ std::string s2650_disassembler::IMM_PSU(offs_t pc, const data_buffer ¶ms) } else { std::string buff; - if (v & 0x80) /* sense input */ + if (v & 0x80) // sense input add(buff, "si"); - if (v & 0x40) /* flag output */ + if (v & 0x40) // flag output add(buff, "fo"); - if (v & 0x20) /* interrupt inhibit */ + if (v & 0x20) // interrupt inhibit add(buff, "ii"); - if (v & 0x10) /* unused bit 4 */ + if (v & 0x10) // unused bit 4 add(buff, "4"); - if (v & 0x08) /* unused bit 3 */ + if (v & 0x08) // unused bit 3 add(buff, "3"); - if (v & 0x04) /* stack pointer bit 2 */ + if (v & 0x04) // stack pointer bit 2 add(buff, "sp2"); - if (v & 0x02) /* stack pointer bit 1 */ + if (v & 0x02) // stack pointer bit 1 add(buff, "sp1"); - if (v & 0x01) /* stack pointer bit 0 */ + if (v & 0x01) // stack pointer bit 0 add(buff, "sp0"); return buff; } } -/* format an relative address */ +// format an relative address std::string s2650_disassembler::REL(offs_t pc, const data_buffer ¶ms) { int o = params.r8(pc); - return util::string_format("%s%s", (o&0x80)?"*":"", SYM((pc&0x6000)+((pc+1+rel[o])&0x1fff))); + return util::string_format("%s%s", (o & 0x80) ? "*" : "", SYM((pc & 0x6000) + ((pc + 1 + util::sext(o, 7)) & 0x1fff))); } -/* format an relative address (implicit page 0) */ +// format an relative address (implicit page 0) std::string s2650_disassembler::REL0(offs_t pc, const data_buffer ¶ms) { int o = params.r8(pc); - return util::string_format("%s%s", (o&0x80)?"*":"", SYM((rel[o]) & 0x1fff)); + return util::string_format("%s%s", (o & 0x80) ? "*" : "", SYM(util::sext(o, 7) & 0x1fff)); } -/* format a destination register and an absolute address */ +// format a destination register and an absolute address std::string s2650_disassembler::ABS(int load, int r, offs_t pc, const data_buffer ¶ms) { int h = params.r8(pc); - int l = params.r8((pc&0x6000)+((pc+1)&0x1fff)); + int l = params.r8((pc & 0x6000) + ((pc + 1) & 0x1fff)); int a = (pc & 0x6000) + ((h & 0x1f) << 8) + l; if (m_config->get_z80_mnemonics_mode()) { @@ -174,11 +154,11 @@ std::string s2650_disassembler::ABS(int load, int r, offs_t pc, const data_buffe return ""; } -/* format an (branch) absolute address */ +// format an (branch) absolute address std::string s2650_disassembler::ADR(offs_t pc, const data_buffer ¶ms) { int h = params.r8(pc); - int l = params.r8((pc&0x6000)+((pc+1)&0x1fff)); + int l = params.r8((pc & 0x6000) + ((pc + 1) & 0x1fff)); int a = ((h & 0x7f) << 8) + l; if (h & 0x80) return util::string_format("*%s", SYM(a)); @@ -190,7 +170,7 @@ s2650_disassembler::s2650_disassembler(config *conf) : m_config(conf) { } -/* disassemble one instruction at PC into buff. return byte size of instr */ +// disassemble one instruction at PC into buff. return byte size of instr offs_t s2650_disassembler::disassemble(std::ostream &stream, offs_t pc, const data_buffer &opcodes, const data_buffer ¶ms) { uint32_t flags = 0; @@ -215,7 +195,7 @@ offs_t s2650_disassembler::disassemble(std::ostream &stream, offs_t pc, const da pc+=1; break; case 0x0c: case 0x0d: case 0x0e: case 0x0f: - util::stream_format(stream, z80 ? "ld %s" : "loda,%s", ABS(1,rv,pc, params)); + util::stream_format(stream, z80 ? "ld %s" : "loda,%s", ABS(1, rv, pc, params)); pc+=2; break; case 0x10: case 0x11: @@ -273,7 +253,7 @@ offs_t s2650_disassembler::disassemble(std::ostream &stream, offs_t pc, const da pc+=1; break; case 0x2c: case 0x2d: case 0x2e: case 0x2f: - util::stream_format(stream, z80 ? "xor %s" : "eora,%s", ABS(1,rv,pc, params)); + util::stream_format(stream, z80 ? "xor %s" : "eora,%s", ABS(1, rv, pc, params)); pc+=2; break; case 0x30: case 0x31: case 0x32: case 0x33: @@ -326,7 +306,7 @@ offs_t s2650_disassembler::disassemble(std::ostream &stream, offs_t pc, const da pc+=1; break; case 0x4c: case 0x4d: case 0x4e: case 0x4f: - util::stream_format(stream, z80 ? "and %s" : "anda,%s", ABS(1,rv,pc, params)); + util::stream_format(stream, z80 ? "and %s" : "anda,%s", ABS(1, rv, pc, params)); pc+=2; break; case 0x50: case 0x51: case 0x52: case 0x53: @@ -358,7 +338,7 @@ offs_t s2650_disassembler::disassemble(std::ostream &stream, offs_t pc, const da pc+=1; break; case 0x6c: case 0x6d: case 0x6e: case 0x6f: - util::stream_format(stream, z80 ? "or %s" : "iora,%s", ABS(1,rv,pc, params)); + util::stream_format(stream, z80 ? "or %s" : "iora,%s", ABS(1, rv, pc, params)); pc+=2; break; case 0x70: case 0x71: case 0x72: case 0x73: @@ -402,7 +382,7 @@ offs_t s2650_disassembler::disassemble(std::ostream &stream, offs_t pc, const da pc+=1; break; case 0x8c: case 0x8d: case 0x8e: case 0x8f: - util::stream_format(stream, z80 ? "add %s" : "adda,%s", ABS(1,rv,pc, params)); + util::stream_format(stream, z80 ? "add %s" : "adda,%s", ABS(1, rv, pc, params)); pc+=2; break; case 0x90: case 0x91: @@ -446,7 +426,7 @@ offs_t s2650_disassembler::disassemble(std::ostream &stream, offs_t pc, const da pc+=1; break; case 0xac: case 0xad: case 0xae: case 0xaf: - util::stream_format(stream, z80 ? "sub %s" : "suba,%s", ABS(1,rv,pc, params)); + util::stream_format(stream, z80 ? "sub %s" : "suba,%s", ABS(1, rv, pc, params)); pc+=2; break; case 0xb0: case 0xb1: case 0xb2: case 0xb3: @@ -497,7 +477,7 @@ offs_t s2650_disassembler::disassemble(std::ostream &stream, offs_t pc, const da pc+=1; break; case 0xcc: case 0xcd: case 0xce: case 0xcf: - util::stream_format(stream, z80 ? "ld %s" : "stra,%s", ABS(0,rv,pc, params)); + util::stream_format(stream, z80 ? "ld %s" : "stra,%s", ABS( 0, rv, pc, params)); pc+=2; break; case 0xd0: case 0xd1: case 0xd2: case 0xd3: @@ -518,7 +498,7 @@ offs_t s2650_disassembler::disassemble(std::ostream &stream, offs_t pc, const da flags = STEP_COND; break; case 0xe0: case 0xe1: case 0xe2: case 0xe3: - util::stream_format(stream, z80 ? "cp r0,%d" : "comz,%d", rv); + util::stream_format(stream, z80 ? "cp r0,r%d" : "comz,%d", rv); break; case 0xe4: case 0xe5: case 0xe6: case 0xe7: util::stream_format(stream, z80 ? "cp r%d,%s" : "comi,%d %s", rv, IMM(pc, params)); @@ -529,7 +509,7 @@ offs_t s2650_disassembler::disassemble(std::ostream &stream, offs_t pc, const da pc+=1; break; case 0xec: case 0xed: case 0xee: case 0xef: - util::stream_format(stream, z80 ? "cp %s" : "coma,%s", ABS(1,rv,pc, params)); + util::stream_format(stream, z80 ? "cp %s" : "coma,%s", ABS(1, rv, pc, params)); pc+=2; break; case 0xf0: case 0xf1: case 0xf2: case 0xf3: @@ -552,18 +532,3 @@ offs_t s2650_disassembler::disassemble(std::ostream &stream, offs_t pc, const da } return (pc - PC) | flags | SUPPORTED; } - -u32 s2650_disassembler::opcode_alignment() const -{ - return 1; -} - -u32 s2650_disassembler::interface_flags() const -{ - return PAGED; -} - -u32 s2650_disassembler::page_address_bits() const -{ - return 13; -} diff --git a/src/devices/cpu/s2650/2650dasm.h b/src/devices/cpu/s2650/2650dasm.h index cb5db5f85c8..1caae51c948 100644 --- a/src/devices/cpu/s2650/2650dasm.h +++ b/src/devices/cpu/s2650/2650dasm.h @@ -25,13 +25,12 @@ class s2650_disassembler : public util::disasm_interface s2650_disassembler(config *conf); virtual ~s2650_disassembler() = default; - virtual u32 opcode_alignment() const override; - virtual u32 interface_flags() const override; - virtual u32 page_address_bits() const override; + virtual u32 opcode_alignment() const override { return 1; } + virtual u32 interface_flags() const override { return PAGED; } + virtual u32 page_address_bits() const override { return 13; } virtual offs_t disassemble(std::ostream &stream, offs_t pc, const data_buffer &opcodes, const data_buffer ¶ms) override; private: - static const int rel[0x100]; static const char cc[4]; void add(std::string &buf, const std::string &str); diff --git a/src/devices/cpu/s2650/s2650.cpp b/src/devices/cpu/s2650/s2650.cpp index baa8beae391..5a6d26d02d9 100644 --- a/src/devices/cpu/s2650/s2650.cpp +++ b/src/devices/cpu/s2650/s2650.cpp @@ -14,13 +14,15 @@ #include "emu.h" #include "s2650.h" -#include "s2650cpu.h" -/* define this to have some interrupt information logged */ +// define this to have some interrupt information logged //#define VERBOSE 1 #include "logmacro.h" -/* define this to expand all EA calculations inline */ +// define this to enable Z80 mnemonics in the debugger +#define DEBUG_Z80 0 + +// define this to expand all EA calculations inline #define INLINE_EA 1 @@ -36,7 +38,7 @@ s2650_device::s2650_device(const machine_config &mconfig, const char *tag, devic , m_flag_handler(*this) , m_intack_handler(*this, 0x00) , m_ppc(0), m_page(0), m_iar(0), m_ea(0), m_psl(0), m_psu(0), m_r(0) - , m_halt(0), m_ir(0), m_irq_state(0), m_icount(0) + , m_halt(0), m_ir(0), m_irq_state(0) , m_debugger_temp(0) { memset(m_reg, 0x00, sizeof(m_reg)); @@ -44,8 +46,7 @@ s2650_device::s2650_device(const machine_config &mconfig, const char *tag, devic bool s2650_device::get_z80_mnemonics_mode() const { - // Needs to become configurable live - return false; + return bool(DEBUG_Z80); } std::unique_ptr s2650_device::create_disassembler() @@ -55,7 +56,8 @@ std::unique_ptr s2650_device::create_disassembler() device_memory_interface::space_config_vector s2650_device::memory_space_config() const { - return space_config_vector { + return space_config_vector + { // Memory-mapped: M/~IO=1 std::make_pair(AS_PROGRAM, &m_program_config), @@ -70,8 +72,8 @@ device_memory_interface::space_config_vector s2650_device::memory_space_config() } -/* condition code changes for a byte */ -static const uint8_t ccc[0x200] = { +// condition code changes for a byte +static const uint8_t ccc[0x100] = { 0x00,0x40,0x40,0x40,0x40,0x40,0x40,0x40, 0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40, 0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40, @@ -103,64 +105,38 @@ static const uint8_t ccc[0x200] = { 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, - 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, - 0x04,0x44,0x44,0x44,0x44,0x44,0x44,0x44, - 0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44, - 0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44, - 0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44, - 0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44, - 0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44, - 0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44, - 0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44, - 0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44, - 0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44, - 0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44, - 0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44, - 0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44, - 0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44, - 0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44, - 0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44, - 0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84, - 0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84, - 0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84, - 0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84, - 0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84, - 0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84, - 0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84, - 0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84, - 0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84, - 0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84, - 0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84, - 0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84, - 0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84, - 0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84, - 0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84, - 0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84 + 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80 }; + /*************************************************************** - * handy table to build PC relative offsets - * from HR (holding register) + * macros for CPU registers/flags ***************************************************************/ -static const int S2650_relative[0x100] = -{ - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - -64,-63,-62,-61,-60,-59,-58,-57,-56,-55,-54,-53,-52,-51,-50,-49, - -48,-47,-46,-45,-44,-43,-42,-41,-40,-39,-38,-37,-36,-35,-34,-33, - -32,-31,-30,-29,-28,-27,-26,-25,-24,-23,-22,-21,-20,-19,-18,-17, - -16,-15,-14,-13,-12,-11,-10, -9, -8, -7, -6, -5, -4, -3, -2, -1, - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - -64,-63,-62,-61,-60,-59,-58,-57,-56,-55,-54,-53,-52,-51,-50,-49, - -48,-47,-46,-45,-44,-43,-42,-41,-40,-39,-38,-37,-36,-35,-34,-33, - -32,-31,-30,-29,-28,-27,-26,-25,-24,-23,-22,-21,-20,-19,-18,-17, - -16,-15,-14,-13,-12,-11,-10, -9, -8, -7, -6, -5, -4, -3, -2, -1, -}; +#define PMSK 0x1fff // mask page offset +#define PLEN 0x2000 // page length +#define PAGE 0x6000 // mask page +#define AMSK 0x7fff // mask address range + +// processor status lower +#define C 0x01 // carry flag +#define COM 0x02 // compare: 0 binary, 1 2s complement +#define OVF 0x04 // 2s complement overflow +#define WC 0x08 // with carry: use carry in arithmetic / rotate ops +#define RS 0x10 // register select 0: R0/R1/R2/R3 1: R0/R4/R5/R6 +#define IDC 0x20 // inter digit carry: bit-3-to-bit-4 carry +#define CC 0xc0 // condition code + +// processor status upper +#define SP 0x07 // stack pointer: indexing 8 15bit words +#define PSU34 0x18 // unused bits +#define II 0x20 // interrupt inhibit 0: allow, 1: inhibit +#define FO 0x40 // flag output +#define SI 0x80 // sense input + +#define R0 m_reg[0] +#define R1 m_reg[1] +#define R2 m_reg[2] +#define R3 m_reg[3] /*************************************************************** @@ -216,15 +192,17 @@ inline int s2650_device::check_irq_line() } standard_irq_callback(0, m_page + m_iar); - /* Say hi */ + // Say hi int vector = m_intack_handler(); - /* build effective address within first 8K page */ - m_ea = S2650_relative[vector] & PMSK; - if (vector & 0x80) /* indirect bit set ? */ + + // build effective address within first 8K page + m_ea = util::sext(vector, 7) & PMSK; + if (vector & 0x80) // indirect bit set ? { int addr = m_ea; cycles += 6; - /* build indirect 32K address */ + + // build indirect 32K address m_ea = RDMEM(addr) << 8; if (!(++addr & PMSK)) addr -= PLEN; m_ea = (m_ea + RDMEM(addr)) & AMSK; @@ -245,18 +223,7 @@ inline int s2650_device::check_irq_line() * set condition code (zero,plus,minus) from result ***************************************************************/ #define SET_CC(result) \ - m_psl = (m_psl & ~CC) | ccc[result] - -/*************************************************************** - * - * set condition code (zero,plus,minus) and overflow - ***************************************************************/ -#define SET_CC_OVF(result,value) \ - m_psl = (m_psl & ~(OVF+CC)) | \ - ccc[result + (((value) & 0x80) << 1)] - -#define SET_CC_OVF_ADD(result,value1,value2) SET_CC_OVF(result,~((value1) ^ (value2)) & ((value1) ^ (result))) -#define SET_CC_OVF_SUB(result,value1,value2) SET_CC_OVF(result,~((value1) ^ (value2)) & ((value1) ^ (result))) + m_psl = (m_psl & ~CC) | ccc[result & 0xff] /*************************************************************** * ROP @@ -288,13 +255,15 @@ inline uint8_t s2650_device::ARG() { \ uint8_t hr = ARG(); /* get 'holding register' */ \ /* build effective address within current 8K page */ \ - m_ea = page + ((m_iar + S2650_relative[hr]) & PMSK); \ - if (hr & 0x80) { /* indirect bit set ? */ \ - int addr = m_ea; \ - m_icount -= 6; \ + m_ea = page + ((m_iar + util::sext(hr, 7)) & PMSK); \ + if (hr & 0x80) \ + { \ + /* indirect bit set ? */ \ + int addr = m_ea; \ + m_icount -= 6; \ /* build indirect 32K address */ \ - m_ea = RDMEM(addr) << 8; \ - if( (++addr & PMSK) == 0 ) addr -= PLEN; /* page wrap */\ + m_ea = RDMEM(addr) << 8; \ + if ((++addr & PMSK) == 0) addr -= PLEN; /* page wrap */ \ m_ea = (m_ea + RDMEM(addr)) & AMSK; \ } \ } @@ -307,13 +276,15 @@ inline uint8_t s2650_device::ARG() { \ uint8_t hr = ARG(); /* get 'holding register' */ \ /* build effective address from 0 */ \ - m_ea = (S2650_relative[hr] & PMSK); \ - if (hr & 0x80) { /* indirect bit set ? */ \ - int addr = m_ea; \ - m_icount -= 6; \ + m_ea = (util::sext(hr, 7) & PMSK); \ + if (hr & 0x80) \ + { \ + /* indirect bit set ? */ \ + int addr = m_ea; \ + m_icount -= 6; \ /* build indirect 32K address */ \ - m_ea = RDMEM(addr) << 8; \ - if( (++addr & PMSK) == 0 ) addr -= PLEN; /* page wrap */\ + m_ea = RDMEM(addr) << 8; \ + if ((++addr & PMSK) == 0) addr -= PLEN; /* page wrap */ \ m_ea = (m_ea + RDMEM(addr)) & AMSK; \ } \ } @@ -324,38 +295,40 @@ inline uint8_t s2650_device::ARG() ***************************************************************/ #define _ABS_EA() \ { \ - uint8_t hr, dr; \ - hr = ARG(); /* get 'holding register' */ \ - dr = ARG(); /* get 'data bus register' */ \ + uint8_t hr, dr; \ + hr = ARG(); /* get 'holding register' */ \ + dr = ARG(); /* get 'data bus register' */ \ /* build effective address within current 8K page */ \ m_ea = m_page + (((hr << 8) + dr) & PMSK); \ /* indirect addressing ? */ \ - if (hr & 0x80) { \ - int addr = m_ea; \ - m_icount -= 6; \ + if (hr & 0x80) \ + { \ + int addr = m_ea; \ + m_icount -= 6; \ /* build indirect 32K address */ \ /* build indirect 32K address */ \ - m_ea = RDMEM(addr) << 8; \ - if( (++addr & PMSK) == 0 ) addr -= PLEN; /* page wrap */\ + m_ea = RDMEM(addr) << 8; \ + if ((++addr & PMSK) == 0) addr -= PLEN; /* page wrap */ \ m_ea = (m_ea + RDMEM(addr)) & AMSK; \ } \ /* check indexed addressing modes */ \ - switch (hr & 0x60) { \ + switch (hr & 0x60) \ + { \ case 0x00: /* not indexed */ \ break; \ case 0x20: /* auto increment indexed */ \ m_reg[m_r] += 1; \ - m_ea = (m_ea & PAGE)+((m_ea+m_reg[m_r]) & PMSK); \ - m_r = 0; /* absolute addressing reg is R0 */ \ + m_ea = (m_ea & PAGE) + ((m_ea + m_reg[m_r]) & PMSK);\ + m_r = 0; /* absolute addressing reg is R0 */ \ break; \ case 0x40: /* auto decrement indexed */ \ m_reg[m_r] -= 1; \ - m_ea = (m_ea & PAGE)+((m_ea+m_reg[m_r]) & PMSK); \ - m_r = 0; /* absolute addressing reg is R0 */ \ + m_ea = (m_ea & PAGE) + ((m_ea + m_reg[m_r]) & PMSK);\ + m_r = 0; /* absolute addressing reg is R0 */ \ break; \ case 0x60: /* indexed */ \ - m_ea = (m_ea & PAGE)+((m_ea+m_reg[m_r]) & PMSK); \ - m_r = 0; /* absolute addressing reg is R0 */ \ + m_ea = (m_ea & PAGE) + ((m_ea + m_reg[m_r]) & PMSK);\ + m_r = 0; /* absolute addressing reg is R0 */ \ break; \ } \ } @@ -366,18 +339,19 @@ inline uint8_t s2650_device::ARG() ***************************************************************/ #define _BRA_EA() \ { \ - uint8_t hr, dr; \ - hr = ARG(); /* get 'holding register' */ \ - dr = ARG(); /* get 'data bus register' */ \ + uint8_t hr, dr; \ + hr = ARG(); /* get 'holding register' */ \ + dr = ARG(); /* get 'data bus register' */ \ /* build address in 32K address space */ \ - m_ea = ((hr << 8) + dr) & AMSK; \ + m_ea = ((hr << 8) + dr) & AMSK; \ /* indirect addressing ? */ \ - if (hr & 0x80) { \ - int addr = m_ea; \ - m_icount -= 6; \ + if (hr & 0x80) \ + { \ + int addr = m_ea; \ + m_icount -= 6; \ /* build indirect 32K address */ \ - m_ea = RDMEM(addr) << 8; \ - if( (++addr & PMSK) == 0 ) addr -= PLEN; /* page wrap */\ + m_ea = RDMEM(addr) << 8; \ + if ((++addr & PMSK) == 0) addr -= PLEN; /* page wrap */ \ m_ea = (m_ea + RDMEM(addr)) & AMSK; \ } \ } @@ -389,16 +363,16 @@ inline uint8_t s2650_device::ARG() ***************************************************************/ #define SWAP_REGS \ { \ - uint8_t tmp; \ - tmp = m_reg[1]; \ + uint8_t tmp; \ + tmp = m_reg[1]; \ m_reg[1] = m_reg[4]; \ - m_reg[4] = tmp; \ - tmp = m_reg[2]; \ + m_reg[4] = tmp; \ + tmp = m_reg[2]; \ m_reg[2] = m_reg[5]; \ - m_reg[5] = tmp; \ - tmp = m_reg[3]; \ + m_reg[5] = tmp; \ + tmp = m_reg[3]; \ m_reg[3] = m_reg[6]; \ - m_reg[6] = tmp; \ + m_reg[6] = tmp; \ } /*************************************************************** @@ -409,10 +383,14 @@ inline uint8_t s2650_device::ARG() { \ if (cond) \ { \ - REL_EA( m_page ); \ + REL_EA(m_page); \ m_page = m_ea & PAGE; \ m_iar = m_ea & PMSK; \ - } else m_iar = (m_iar + 1) & PMSK; \ + } \ + else \ + { \ + m_iar = (m_iar + 1) & PMSK; \ + } \ } /*************************************************************** @@ -421,7 +399,7 @@ inline uint8_t s2650_device::ARG() ***************************************************************/ #define M_ZBRR() \ { \ - REL_ZERO( 0 ); \ + REL_ZERO(0); \ m_page = m_ea & PAGE; \ m_iar = m_ea & PMSK; \ } @@ -432,12 +410,16 @@ inline uint8_t s2650_device::ARG() ***************************************************************/ #define M_BRA(cond) \ { \ - if( cond ) \ + if (cond) \ { \ BRA_EA(); \ m_page = m_ea & PAGE; \ m_iar = m_ea & PMSK; \ - } else m_iar = (m_iar + 2) & PMSK; \ + } \ + else \ + { \ + m_iar = (m_iar + 2) & PMSK; \ + } \ } /*************************************************************** @@ -447,7 +429,7 @@ inline uint8_t s2650_device::ARG() #define M_BXA() \ { \ BRA_EA(); \ - m_ea = (m_ea + m_reg[3]) & AMSK; \ + m_ea = (m_ea + m_reg[3]) & AMSK; \ m_page = m_ea & PAGE; \ m_iar = m_ea & PMSK; \ } @@ -458,14 +440,18 @@ inline uint8_t s2650_device::ARG() ***************************************************************/ #define M_BSR(cond) \ { \ - if( cond ) \ + if (cond) \ { \ - REL_EA(m_page); \ - set_sp(get_sp() + 1); \ + REL_EA(m_page); \ + set_sp(get_sp() + 1); \ m_ras[get_sp()] = m_page + m_iar; \ - m_page = m_ea & PAGE; \ - m_iar = m_ea & PMSK; \ - } else m_iar = (m_iar + 1) & PMSK; \ + m_page = m_ea & PAGE; \ + m_iar = m_ea & PMSK; \ + } \ + else \ + { \ + m_iar = (m_iar + 1) & PMSK; \ + } \ } /*************************************************************** @@ -475,10 +461,10 @@ inline uint8_t s2650_device::ARG() #define M_ZBSR() \ { \ REL_ZERO(0); \ - set_sp(get_sp() + 1); \ + set_sp(get_sp() + 1); \ m_ras[get_sp()] = m_page + m_iar; \ - m_page = m_ea & PAGE; \ - m_iar = m_ea & PMSK; \ + m_page = m_ea & PAGE; \ + m_iar = m_ea & PMSK; \ } /*************************************************************** @@ -487,14 +473,18 @@ inline uint8_t s2650_device::ARG() ***************************************************************/ #define M_BSA(cond) \ { \ - if( cond ) \ + if (cond) \ { \ BRA_EA(); \ - set_sp(get_sp() + 1); \ + set_sp(get_sp() + 1); \ m_ras[get_sp()] = m_page + m_iar; \ m_page = m_ea & PAGE; \ m_iar = m_ea & PMSK; \ - } else m_iar = (m_iar + 2) & PMSK; \ + } \ + else \ + { \ + m_iar = (m_iar + 2) & PMSK; \ + } \ } /*************************************************************** @@ -504,8 +494,8 @@ inline uint8_t s2650_device::ARG() #define M_BSXA() \ { \ BRA_EA(); \ - m_ea = (m_ea + m_reg[3]) & AMSK; \ - set_sp(get_sp() + 1); \ + m_ea = (m_ea + m_reg[3]) & AMSK; \ + set_sp(get_sp() + 1); \ m_ras[get_sp()] = m_page + m_iar; \ m_page = m_ea & PAGE; \ m_iar = m_ea & PMSK; \ @@ -517,13 +507,13 @@ inline uint8_t s2650_device::ARG() ***************************************************************/ #define M_RET(cond) \ { \ - if( cond ) \ + if (cond) \ { \ - m_icount -= 6; \ - m_ea = m_ras[get_sp()]; \ - set_sp(get_sp() - 1); \ - m_page = m_ea & PAGE; \ - m_iar = m_ea & PMSK; \ + m_icount -= 6; \ + m_ea = m_ras[get_sp()]; \ + set_sp(get_sp() - 1); \ + m_page = m_ea & PAGE; \ + m_iar = m_ea & PMSK; \ } \ } @@ -535,14 +525,14 @@ inline uint8_t s2650_device::ARG() ***************************************************************/ #define M_RETE(cond) \ { \ - if( cond ) \ + if (cond) \ { \ - m_ea = m_ras[get_sp()]; \ - set_sp(get_sp() - 1); \ - m_page = m_ea & PAGE; \ - m_iar = m_ea & PMSK; \ - set_psu(m_psu & ~II); \ - m_icount -= check_irq_line(); \ + m_ea = m_ras[get_sp()]; \ + set_sp(get_sp() - 1); \ + m_page = m_ea & PAGE; \ + m_iar = m_ea & PMSK; \ + set_psu(m_psu & ~II); \ + m_icount -= check_irq_line(); \ } \ } @@ -600,15 +590,16 @@ inline uint8_t s2650_device::ARG() ***************************************************************/ #define M_ADD(dest,_source) \ { \ - uint8_t source = _source; \ - uint8_t before = dest; \ + uint8_t source = _source; \ + uint8_t before = dest; \ /* add source; carry only if WC is set */ \ - uint16_t res = dest + source + ((m_psl >> 3) & m_psl & C); \ - m_psl &= ~(C | OVF | IDC); \ - if(res & 0x100) m_psl |= C; \ + uint16_t res = dest + source + ((m_psl >> 3) & m_psl & C); \ + m_psl &= ~(C | OVF | IDC); \ + if (res & 0x100) m_psl |= C; \ dest = res & 0xff; \ - if( (dest & 15) < (before & 15) ) m_psl |= IDC; \ - SET_CC_OVF_ADD(dest,before,source); \ + if ((dest ^ before ^ source) & 0x10) m_psl |= IDC; \ + if ((before ^ dest) & (source ^ dest) & 0x80) m_psl |= OVF; \ + SET_CC(dest); \ } /*************************************************************** @@ -618,15 +609,16 @@ inline uint8_t s2650_device::ARG() ***************************************************************/ #define M_SUB(dest,_source) \ { \ - uint8_t source = _source; \ - uint8_t before = dest; \ + uint8_t source = _source; \ + uint8_t before = dest; \ /* subtract source; borrow only if WC is set */ \ - uint16_t res = dest - source - ((m_psl >> 3) & (m_psl ^ C) & C); \ - m_psl &= ~(C | OVF | IDC); \ - if((res & 0x100)==0) m_psl |= C; \ + uint16_t res = dest - source - ((m_psl >> 3) & (m_psl ^ C) & C); \ + m_psl &= ~(C | OVF | IDC); \ + if ((res & 0x100) == 0) m_psl |= C; \ dest = res & 0xff; \ - if( (dest & 15) <= (before & 15) ) m_psl |= IDC; \ - SET_CC_OVF_SUB(dest,before,source); \ + if (~(dest ^ before ^ source) & 0x10) m_psl |= IDC; \ + if ((before ^ dest) & (source ^ dest) & 0x80) m_psl |= OVF; \ + SET_CC(dest); \ } /*************************************************************** @@ -636,13 +628,12 @@ inline uint8_t s2650_device::ARG() ***************************************************************/ #define M_COM(reg,val) \ { \ - int d; \ - m_psl &= ~CC; \ - if (m_psl & COM) d = (uint8_t)reg - (uint8_t)val; \ - else d = (int8_t)reg - (int8_t)val; \ - if( d < 0 ) m_psl |= 0x80; \ - else \ - if( d > 0 ) m_psl |= 0x40; \ + int16_t res; \ + m_psl &= ~CC; \ + if (m_psl & COM) res = (uint8_t)reg - (uint8_t)val; \ + else res = (int8_t)reg - (int8_t)val; \ + if (res < 0) m_psl |= 0x80; \ + else if (res > 0) m_psl |= 0x40; \ } /*************************************************************** @@ -651,8 +642,8 @@ inline uint8_t s2650_device::ARG() ***************************************************************/ #define M_DAR(dest) \ { \ - if ((m_psl & C) == 0) dest += 0xA0; \ - if ((m_psl & IDC) == 0) dest = (dest & 0xF0) | ((dest + 0x0A) & 0x0F);\ + if ((m_psl & C) == 0) dest += 0xa0; \ + if ((m_psl & IDC) == 0) dest = (dest & 0xf0) | ((dest + 0x0a) & 0x0f); \ } /*************************************************************** @@ -662,13 +653,13 @@ inline uint8_t s2650_device::ARG() ***************************************************************/ #define M_RRL(dest) \ { \ - uint8_t before = dest; \ - if( m_psl & WC ) \ + uint8_t before = dest; \ + if (m_psl & WC) \ { \ uint8_t c = m_psl & C; \ - m_psl &= ~(C + IDC); \ + m_psl &= ~(C + IDC); \ dest = (before << 1) | c; \ - m_psl |= (before >> 7) + (dest & IDC); \ + m_psl |= (before >> 7) + (dest & IDC); \ } \ else \ { \ @@ -685,14 +676,18 @@ inline uint8_t s2650_device::ARG() ***************************************************************/ #define M_RRR(dest) \ { \ - uint8_t before = dest; \ - if (m_psl & WC) \ + uint8_t before = dest; \ + if (m_psl & WC) \ { \ uint8_t c = m_psl & C; \ - m_psl &= ~(C + IDC); \ + m_psl &= ~(C + IDC); \ dest = (before >> 1) | (c << 7); \ - m_psl |= (before & C) + (dest & IDC); \ - } else dest = (before >> 1) | (before << 7); \ + m_psl |= (before & C) + (dest & IDC); \ + } \ + else \ + { \ + dest = (before >> 1) | (before << 7); \ + } \ SET_CC(dest); \ m_psl = (m_psl & ~OVF) | (((dest ^ before) >> 5) & OVF); \ } @@ -716,7 +711,7 @@ inline uint8_t s2650_device::ARG() ***************************************************************/ #define M_SPSL() \ { \ - R0 = m_psl; \ + R0 = m_psl; \ SET_CC(R0); \ } @@ -727,8 +722,8 @@ inline uint8_t s2650_device::ARG() #define M_CPSU() \ { \ uint8_t cpsu = ARG() & ~SI; \ - set_psu(m_psu & ~cpsu); \ - m_icount -= check_irq_line(); \ + set_psu(m_psu & ~cpsu); \ + m_icount -= check_irq_line(); \ } /*************************************************************** @@ -737,11 +732,11 @@ inline uint8_t s2650_device::ARG() ***************************************************************/ #define M_CPSL() \ { \ - uint8_t cpsl = ARG(); \ + uint8_t cpsl = ARG(); \ /* select other register set now ? */ \ - if( (cpsl & RS) && (m_psl & RS) ) \ + if ((cpsl & RS) && (m_psl & RS)) \ SWAP_REGS; \ - m_psl = m_psl & ~cpsl; \ + m_psl = m_psl & ~cpsl; \ } /*************************************************************** @@ -751,8 +746,8 @@ inline uint8_t s2650_device::ARG() ***************************************************************/ #define M_PPSU() \ { \ - uint8_t ppsu = (ARG() & ~PSU34) & ~SI; \ - set_psu(m_psu | ppsu); \ + uint8_t ppsu = (ARG() & ~PSU34) & ~SI; \ + set_psu(m_psu | ppsu); \ } /*************************************************************** @@ -763,7 +758,7 @@ inline uint8_t s2650_device::ARG() { \ uint8_t ppsl = ARG(); \ /* select 2nd register set now ? */ \ - if ((ppsl & RS) && !(m_psl & RS)) \ + if ((ppsl & RS) && !(m_psl & RS)) \ SWAP_REGS; \ m_psl = m_psl | ppsl; \ } @@ -776,9 +771,9 @@ inline uint8_t s2650_device::ARG() { \ uint8_t tpsu = ARG(); \ uint8_t rpsu = get_psu(); \ - m_psl &= ~CC; \ - if( (rpsu & tpsu) != tpsu ) \ - m_psl |= 0x80; \ + m_psl &= ~CC; \ + if ((rpsu & tpsu) != tpsu) \ + m_psl |= 0x80; \ } /*************************************************************** @@ -788,10 +783,10 @@ inline uint8_t s2650_device::ARG() #define M_TPSL() \ { \ uint8_t tpsl = ARG(); \ - if( (m_psl & tpsl) != tpsl ) \ + if ((m_psl & tpsl) != tpsl) \ m_psl = (m_psl & ~CC) | 0x80; \ else \ - m_psl &= ~CC; \ + m_psl &= ~CC; \ } /*************************************************************** @@ -800,10 +795,10 @@ inline uint8_t s2650_device::ARG() ***************************************************************/ #define M_TMI(value) \ { \ - uint8_t tmi = ARG(); \ - m_psl &= ~CC; \ - if( (value & tmi) != tmi ) \ - m_psl |= 0x80; \ + uint8_t tmi = ARG(); \ + m_psl &= ~CC; \ + if ((value & tmi) != tmi) \ + m_psl |= 0x80; \ } #if INLINE_EA @@ -910,7 +905,7 @@ void s2650_device::state_string_export(const device_state_entry &entry, std::str switch (entry.index()) { case STATE_GENFLAGS: - str = string_format("%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c", + str = string_format("%c%c%c%c%c%c%c%c %c%c%c%c%c%c%c%c", m_psu & 0x80 ? 'S':'.', m_psu & 0x40 ? 'O':'.', m_psu & 0x20 ? 'I':'.', @@ -945,7 +940,7 @@ void s2650_device::device_reset() memset(m_ras, 0, sizeof(m_ras)); m_psl = COM | WC; - /* force write */ + // force write m_psu = 0xff; set_psu(0); } @@ -991,9 +986,8 @@ void s2650_device::s2650_set_sense(int state) void s2650_device::execute_run() { - /* check for external irqs */ - int cycles = check_irq_line(); - m_icount -= cycles; + // check for external irqs + m_icount -= check_irq_line(); do { @@ -1002,602 +996,589 @@ void s2650_device::execute_run() debugger_instruction_hook(m_page + m_iar); m_ir = ROP(); - m_r = m_ir & 3; /* register / value */ - switch (m_ir) { - case 0x00: /* LODZ,0 */ - case 0x01: /* LODZ,1 */ - case 0x02: /* LODZ,2 */ - case 0x03: /* LODZ,3 */ + m_r = m_ir & 3; // register / value + switch (m_ir) + { + case 0x00: // LODZ,0 + case 0x01: // LODZ,1 + case 0x02: // LODZ,2 + case 0x03: // LODZ,3 m_icount -= 6; - M_LOD( R0, m_reg[m_r] ); + M_LOD(R0, m_reg[m_r]); break; - case 0x04: /* LODI,0 v */ - case 0x05: /* LODI,1 v */ - case 0x06: /* LODI,2 v */ - case 0x07: /* LODI,3 v */ + case 0x04: // LODI,0 v + case 0x05: // LODI,1 v + case 0x06: // LODI,2 v + case 0x07: // LODI,3 v m_icount -= 6; - M_LOD( m_reg[m_r], ARG() ); + M_LOD(m_reg[m_r], ARG()); break; - case 0x08: /* LODR,0 (*)a */ - case 0x09: /* LODR,1 (*)a */ - case 0x0a: /* LODR,2 (*)a */ - case 0x0b: /* LODR,3 (*)a */ + case 0x08: // LODR,0 (*)a + case 0x09: // LODR,1 (*)a + case 0x0a: // LODR,2 (*)a + case 0x0b: // LODR,3 (*)a m_icount -= 9; - REL_EA( m_page ); - M_LOD( m_reg[m_r], RDMEM(m_ea) ); + REL_EA(m_page); + M_LOD(m_reg[m_r], RDMEM(m_ea)); break; - case 0x0c: /* LODA,0 (*)a(,X) */ - case 0x0d: /* LODA,1 (*)a(,X) */ - case 0x0e: /* LODA,2 (*)a(,X) */ - case 0x0f: /* LODA,3 (*)a(,X) */ + case 0x0c: // LODA,0 (*)a(,X) + case 0x0d: // LODA,1 (*)a(,X) + case 0x0e: // LODA,2 (*)a(,X) + case 0x0f: // LODA,3 (*)a(,X) m_icount -= 12; ABS_EA(); - M_LOD( m_reg[m_r], RDMEM(m_ea) ); + M_LOD(m_reg[m_r], RDMEM(m_ea)); break; - case 0x10: /* illegal */ - case 0x11: /* illegal */ - m_icount -= 7; - break; - case 0x12: /* SPSU */ + case 0x12: // SPSU m_icount -= 6; M_SPSU(); break; - case 0x13: /* SPSL */ + case 0x13: // SPSL m_icount -= 6; M_SPSL(); break; - case 0x14: /* RETC,0 (zero) */ - case 0x15: /* RETC,1 (plus) */ - case 0x16: /* RETC,2 (minus) */ - m_icount -= 9; /* +2 cycles if condition is true */ - M_RET( (m_psl >> 6) == m_r ); + case 0x14: // RETC,0 (zero) + case 0x15: // RETC,1 (plus) + case 0x16: // RETC,2 (minus) + m_icount -= 9; // +2 cycles if condition is true + M_RET((m_psl >> 6) == m_r); break; - case 0x17: /* RETC,3 (always) */ - m_icount -= 9; /* +2 cycles if condition is true */ - M_RET( 1 ); + case 0x17: // RETC,3 (always) + m_icount -= 9; // +2 cycles if condition is true + M_RET(1); break; - case 0x18: /* BCTR,0 (*)a */ - case 0x19: /* BCTR,1 (*)a */ - case 0x1a: /* BCTR,2 (*)a */ + case 0x18: // BCTR,0 (*)a + case 0x19: // BCTR,1 (*)a + case 0x1a: // BCTR,2 (*)a m_icount -= 9; - M_BRR( (m_psl >> 6) == m_r ); + M_BRR((m_psl >> 6) == m_r); break; - case 0x1b: /* BCTR,3 (*)a */ + case 0x1b: // BCTR,3 (*)a m_icount -= 9; - M_BRR( 1 ); + M_BRR(1); break; - case 0x1c: /* BCTA,0 (*)a */ - case 0x1d: /* BCTA,1 (*)a */ - case 0x1e: /* BCTA,2 (*)a */ + case 0x1c: // BCTA,0 (*)a + case 0x1d: // BCTA,1 (*)a + case 0x1e: // BCTA,2 (*)a m_icount -= 9; - M_BRA( (m_psl >> 6) == m_r ); + M_BRA((m_psl >> 6) == m_r); break; - case 0x1f: /* BCTA,3 (*)a */ + case 0x1f: // BCTA,3 (*)a m_icount -= 9; - M_BRA( 1 ); + M_BRA(1); break; - case 0x20: /* EORZ,0 */ - case 0x21: /* EORZ,1 */ - case 0x22: /* EORZ,2 */ - case 0x23: /* EORZ,3 */ + case 0x20: // EORZ,0 + case 0x21: // EORZ,1 + case 0x22: // EORZ,2 + case 0x23: // EORZ,3 m_icount -= 6; - M_EOR( R0, m_reg[m_r] ); + M_EOR(R0, m_reg[m_r]); break; - case 0x24: /* EORI,0 v */ - case 0x25: /* EORI,1 v */ - case 0x26: /* EORI,2 v */ - case 0x27: /* EORI,3 v */ + case 0x24: // EORI,0 v + case 0x25: // EORI,1 v + case 0x26: // EORI,2 v + case 0x27: // EORI,3 v m_icount -= 6; - M_EOR( m_reg[m_r], ARG() ); + M_EOR(m_reg[m_r], ARG()); break; - case 0x28: /* EORR,0 (*)a */ - case 0x29: /* EORR,1 (*)a */ - case 0x2a: /* EORR,2 (*)a */ - case 0x2b: /* EORR,3 (*)a */ + case 0x28: // EORR,0 (*)a + case 0x29: // EORR,1 (*)a + case 0x2a: // EORR,2 (*)a + case 0x2b: // EORR,3 (*)a m_icount -= 9; - REL_EA( m_page ); - M_EOR( m_reg[m_r], RDMEM(m_ea) ); + REL_EA(m_page); + M_EOR(m_reg[m_r], RDMEM(m_ea)); break; - case 0x2c: /* EORA,0 (*)a(,X) */ - case 0x2d: /* EORA,1 (*)a(,X) */ - case 0x2e: /* EORA,2 (*)a(,X) */ - case 0x2f: /* EORA,3 (*)a(,X) */ + case 0x2c: // EORA,0 (*)a(,X) + case 0x2d: // EORA,1 (*)a(,X) + case 0x2e: // EORA,2 (*)a(,X) + case 0x2f: // EORA,3 (*)a(,X) m_icount -= 12; ABS_EA(); - M_EOR( m_reg[m_r], RDMEM(m_ea) ); + M_EOR(m_reg[m_r], RDMEM(m_ea)); break; - case 0x30: /* REDC,0 */ - case 0x31: /* REDC,1 */ - case 0x32: /* REDC,2 */ - case 0x33: /* REDC,3 */ + case 0x30: // REDC,0 + case 0x31: // REDC,1 + case 0x32: // REDC,2 + case 0x33: // REDC,3 m_icount -= 6; m_reg[m_r] = m_data.read_byte(S2650_CTRL_PORT); - SET_CC( m_reg[m_r] ); + SET_CC(m_reg[m_r]); break; - case 0x34: /* RETE,0 */ - case 0x35: /* RETE,1 */ - case 0x36: /* RETE,2 */ + case 0x34: // RETE,0 + case 0x35: // RETE,1 + case 0x36: // RETE,2 m_icount -= 9; - M_RETE( (m_psl >> 6) == m_r ); + M_RETE((m_psl >> 6) == m_r); break; - case 0x37: /* RETE,3 */ + case 0x37: // RETE,3 m_icount -= 9; - M_RETE( 1 ); + M_RETE(1); break; - case 0x38: /* BSTR,0 (*)a */ - case 0x39: /* BSTR,1 (*)a */ - case 0x3a: /* BSTR,2 (*)a */ + case 0x38: // BSTR,0 (*)a + case 0x39: // BSTR,1 (*)a + case 0x3a: // BSTR,2 (*)a m_icount -= 9; - M_BSR( (m_psl >> 6) == m_r ); + M_BSR((m_psl >> 6) == m_r); break; - case 0x3b: /* BSTR,R3 (*)a */ + case 0x3b: // BSTR,R3 (*)a m_icount -= 9; - M_BSR( 1 ); + M_BSR(1); break; - case 0x3c: /* BSTA,0 (*)a */ - case 0x3d: /* BSTA,1 (*)a */ - case 0x3e: /* BSTA,2 (*)a */ + case 0x3c: // BSTA,0 (*)a + case 0x3d: // BSTA,1 (*)a + case 0x3e: // BSTA,2 (*)a m_icount -= 9; - M_BSA( (m_psl >> 6) == m_r ); + M_BSA((m_psl >> 6) == m_r); break; - case 0x3f: /* BSTA,3 (*)a */ + case 0x3f: // BSTA,3 (*)a m_icount -= 9; - M_BSA( 1 ); + M_BSA(1); break; - case 0x40: /* HALT */ + case 0x40: // HALT m_icount -= 6; m_iar = (m_iar - 1) & PMSK; m_halt = 1; if (m_icount > 0) m_icount = 0; break; - case 0x41: /* ANDZ,1 */ - case 0x42: /* ANDZ,2 */ - case 0x43: /* ANDZ,3 */ + case 0x41: // ANDZ,1 + case 0x42: // ANDZ,2 + case 0x43: // ANDZ,3 m_icount -= 6; - M_AND( R0, m_reg[m_r] ); + M_AND(R0, m_reg[m_r]); break; - case 0x44: /* ANDI,0 v */ - case 0x45: /* ANDI,1 v */ - case 0x46: /* ANDI,2 v */ - case 0x47: /* ANDI,3 v */ + case 0x44: // ANDI,0 v + case 0x45: // ANDI,1 v + case 0x46: // ANDI,2 v + case 0x47: // ANDI,3 v m_icount -= 6; - M_AND( m_reg[m_r], ARG() ); + M_AND(m_reg[m_r], ARG()); break; - case 0x48: /* ANDR,0 (*)a */ - case 0x49: /* ANDR,1 (*)a */ - case 0x4a: /* ANDR,2 (*)a */ - case 0x4b: /* ANDR,3 (*)a */ + case 0x48: // ANDR,0 (*)a + case 0x49: // ANDR,1 (*)a + case 0x4a: // ANDR,2 (*)a + case 0x4b: // ANDR,3 (*)a m_icount -= 9; - REL_EA( m_page ); - M_AND( m_reg[m_r], RDMEM(m_ea) ); + REL_EA(m_page); + M_AND(m_reg[m_r], RDMEM(m_ea)); break; - case 0x4c: /* ANDA,0 (*)a(,X) */ - case 0x4d: /* ANDA,1 (*)a(,X) */ - case 0x4e: /* ANDA,2 (*)a(,X) */ - case 0x4f: /* ANDA,3 (*)a(,X) */ + case 0x4c: // ANDA,0 (*)a(,X) + case 0x4d: // ANDA,1 (*)a(,X) + case 0x4e: // ANDA,2 (*)a(,X) + case 0x4f: // ANDA,3 (*)a(,X) m_icount -= 12; ABS_EA(); - M_AND( m_reg[m_r], RDMEM(m_ea) ); + M_AND(m_reg[m_r], RDMEM(m_ea)); break; - case 0x50: /* RRR,0 */ - case 0x51: /* RRR,1 */ - case 0x52: /* RRR,2 */ - case 0x53: /* RRR,3 */ + case 0x50: // RRR,0 + case 0x51: // RRR,1 + case 0x52: // RRR,2 + case 0x53: // RRR,3 m_icount -= 6; - M_RRR( m_reg[m_r] ); + M_RRR(m_reg[m_r]); break; - case 0x54: /* REDE,0 v */ - case 0x55: /* REDE,1 v */ - case 0x56: /* REDE,2 v */ - case 0x57: /* REDE,3 v */ + case 0x54: // REDE,0 v + case 0x55: // REDE,1 v + case 0x56: // REDE,2 v + case 0x57: // REDE,3 v m_icount -= 9; m_reg[m_r] = m_io.read_byte(ARG()); SET_CC(m_reg[m_r]); break; - case 0x58: /* BRNR,0 (*)a */ - case 0x59: /* BRNR,1 (*)a */ - case 0x5a: /* BRNR,2 (*)a */ - case 0x5b: /* BRNR,3 (*)a */ + case 0x58: // BRNR,0 (*)a + case 0x59: // BRNR,1 (*)a + case 0x5a: // BRNR,2 (*)a + case 0x5b: // BRNR,3 (*)a m_icount -= 9; - M_BRR( m_reg[m_r] ); + M_BRR(m_reg[m_r]); break; - case 0x5c: /* BRNA,0 (*)a */ - case 0x5d: /* BRNA,1 (*)a */ - case 0x5e: /* BRNA,2 (*)a */ - case 0x5f: /* BRNA,3 (*)a */ + case 0x5c: // BRNA,0 (*)a + case 0x5d: // BRNA,1 (*)a + case 0x5e: // BRNA,2 (*)a + case 0x5f: // BRNA,3 (*)a m_icount -= 9; - M_BRA( m_reg[m_r] ); + M_BRA(m_reg[m_r]); break; - case 0x60: /* IORZ,0 */ - case 0x61: /* IORZ,1 */ - case 0x62: /* IORZ,2 */ - case 0x63: /* IORZ,3 */ + case 0x60: // IORZ,0 + case 0x61: // IORZ,1 + case 0x62: // IORZ,2 + case 0x63: // IORZ,3 m_icount -= 6; - M_IOR( R0, m_reg[m_r] ); + M_IOR(R0, m_reg[m_r]); break; - case 0x64: /* IORI,0 v */ - case 0x65: /* IORI,1 v */ - case 0x66: /* IORI,2 v */ - case 0x67: /* IORI,3 v */ + case 0x64: // IORI,0 v + case 0x65: // IORI,1 v + case 0x66: // IORI,2 v + case 0x67: // IORI,3 v m_icount -= 6; - M_IOR( m_reg[m_r], ARG() ); + M_IOR(m_reg[m_r], ARG()); break; - case 0x68: /* IORR,0 (*)a */ - case 0x69: /* IORR,1 (*)a */ - case 0x6a: /* IORR,2 (*)a */ - case 0x6b: /* IORR,3 (*)a */ + case 0x68: // IORR,0 (*)a + case 0x69: // IORR,1 (*)a + case 0x6a: // IORR,2 (*)a + case 0x6b: // IORR,3 (*)a m_icount -= 9; - REL_EA( m_page ); - M_IOR( m_reg[m_r],RDMEM(m_ea) ); + REL_EA(m_page); + M_IOR(m_reg[m_r],RDMEM(m_ea)); break; - case 0x6c: /* IORA,0 (*)a(,X) */ - case 0x6d: /* IORA,1 (*)a(,X) */ - case 0x6e: /* IORA,2 (*)a(,X) */ - case 0x6f: /* IORA,3 (*)a(,X) */ + case 0x6c: // IORA,0 (*)a(,X) + case 0x6d: // IORA,1 (*)a(,X) + case 0x6e: // IORA,2 (*)a(,X) + case 0x6f: // IORA,3 (*)a(,X) m_icount -= 12; ABS_EA(); - M_IOR( m_reg[m_r], RDMEM(m_ea) ); + M_IOR(m_reg[m_r], RDMEM(m_ea)); break; - case 0x70: /* REDD,0 */ - case 0x71: /* REDD,1 */ - case 0x72: /* REDD,2 */ - case 0x73: /* REDD,3 */ + case 0x70: // REDD,0 + case 0x71: // REDD,1 + case 0x72: // REDD,2 + case 0x73: // REDD,3 m_icount -= 6; m_reg[m_r] = m_data.read_byte(S2650_DATA_PORT); SET_CC(m_reg[m_r]); break; - case 0x74: /* CPSU */ + case 0x74: // CPSU m_icount -= 9; M_CPSU(); break; - case 0x75: /* CPSL */ + case 0x75: // CPSL m_icount -= 9; M_CPSL(); break; - case 0x76: /* PPSU */ + case 0x76: // PPSU m_icount -= 9; M_PPSU(); break; - case 0x77: /* PPSL */ + case 0x77: // PPSL m_icount -= 9; M_PPSL(); break; - case 0x78: /* BSNR,0 (*)a */ - case 0x79: /* BSNR,1 (*)a */ - case 0x7a: /* BSNR,2 (*)a */ - case 0x7b: /* BSNR,3 (*)a */ + case 0x78: // BSNR,0 (*)a + case 0x79: // BSNR,1 (*)a + case 0x7a: // BSNR,2 (*)a + case 0x7b: // BSNR,3 (*)a m_icount -= 9; - M_BSR( m_reg[m_r] ); + M_BSR(m_reg[m_r]); break; - case 0x7c: /* BSNA,0 (*)a */ - case 0x7d: /* BSNA,1 (*)a */ - case 0x7e: /* BSNA,2 (*)a */ - case 0x7f: /* BSNA,3 (*)a */ + case 0x7c: // BSNA,0 (*)a + case 0x7d: // BSNA,1 (*)a + case 0x7e: // BSNA,2 (*)a + case 0x7f: // BSNA,3 (*)a m_icount -= 9; - M_BSA( m_reg[m_r] ); + M_BSA(m_reg[m_r]); break; - case 0x80: /* ADDZ,0 */ - case 0x81: /* ADDZ,1 */ - case 0x82: /* ADDZ,2 */ - case 0x83: /* ADDZ,3 */ + case 0x80: // ADDZ,0 + case 0x81: // ADDZ,1 + case 0x82: // ADDZ,2 + case 0x83: // ADDZ,3 m_icount -= 6; - M_ADD( R0,m_reg[m_r] ); + M_ADD(R0,m_reg[m_r]); break; - case 0x84: /* ADDI,0 v */ - case 0x85: /* ADDI,1 v */ - case 0x86: /* ADDI,2 v */ - case 0x87: /* ADDI,3 v */ + case 0x84: // ADDI,0 v + case 0x85: // ADDI,1 v + case 0x86: // ADDI,2 v + case 0x87: // ADDI,3 v m_icount -= 6; - M_ADD( m_reg[m_r], ARG() ); + M_ADD(m_reg[m_r], ARG()); break; - case 0x88: /* ADDR,0 (*)a */ - case 0x89: /* ADDR,1 (*)a */ - case 0x8a: /* ADDR,2 (*)a */ - case 0x8b: /* ADDR,3 (*)a */ + case 0x88: // ADDR,0 (*)a + case 0x89: // ADDR,1 (*)a + case 0x8a: // ADDR,2 (*)a + case 0x8b: // ADDR,3 (*)a m_icount -= 9; REL_EA(m_page); - M_ADD( m_reg[m_r], RDMEM(m_ea) ); + M_ADD(m_reg[m_r], RDMEM(m_ea)); break; - case 0x8c: /* ADDA,0 (*)a(,X) */ - case 0x8d: /* ADDA,1 (*)a(,X) */ - case 0x8e: /* ADDA,2 (*)a(,X) */ - case 0x8f: /* ADDA,3 (*)a(,X) */ + case 0x8c: // ADDA,0 (*)a(,X) + case 0x8d: // ADDA,1 (*)a(,X) + case 0x8e: // ADDA,2 (*)a(,X) + case 0x8f: // ADDA,3 (*)a(,X) m_icount -= 12; ABS_EA(); - M_ADD( m_reg[m_r], RDMEM(m_ea) ); + M_ADD(m_reg[m_r], RDMEM(m_ea)); break; - case 0x90: /* illegal */ - case 0x91: /* illegal */ - m_icount -= 7; - break; - case 0x92: /* LPSU */ + case 0x92: // LPSU m_icount -= 6; set_psu((R0 & ~PSU34 & ~SI) | (m_psu & SI)); break; - case 0x93: /* LPSL */ + case 0x93: // LPSL m_icount -= 6; - /* change register set ? */ + // change register set ? if ((m_psl ^ R0) & RS) SWAP_REGS; m_psl = R0; break; - case 0x94: /* DAR,0 */ - case 0x95: /* DAR,1 */ - case 0x96: /* DAR,2 */ - case 0x97: /* DAR,3 */ + case 0x94: // DAR,0 + case 0x95: // DAR,1 + case 0x96: // DAR,2 + case 0x97: // DAR,3 m_icount -= 9; - M_DAR( m_reg[m_r] ); + M_DAR(m_reg[m_r]); break; - case 0x98: /* BCFR,0 (*)a */ - case 0x99: /* BCFR,1 (*)a */ - case 0x9a: /* BCFR,2 (*)a */ + case 0x98: // BCFR,0 (*)a + case 0x99: // BCFR,1 (*)a + case 0x9a: // BCFR,2 (*)a m_icount -= 9; - M_BRR( (m_psl >> 6) != m_r ); + M_BRR((m_psl >> 6) != m_r); break; - case 0x9b: /* ZBRR (*)a */ + case 0x9b: // ZBRR (*)a m_icount -= 9; M_ZBRR(); break; - case 0x9c: /* BCFA,0 (*)a */ - case 0x9d: /* BCFA,1 (*)a */ - case 0x9e: /* BCFA,2 (*)a */ + case 0x9c: // BCFA,0 (*)a + case 0x9d: // BCFA,1 (*)a + case 0x9e: // BCFA,2 (*)a m_icount -= 9; - M_BRA( (m_psl >> 6) != m_r ); + M_BRA((m_psl >> 6) != m_r); break; - case 0x9f: /* BXA (*)a */ + case 0x9f: // BXA (*)a m_icount -= 9; M_BXA(); break; - case 0xa0: /* SUBZ,0 */ - case 0xa1: /* SUBZ,1 */ - case 0xa2: /* SUBZ,2 */ - case 0xa3: /* SUBZ,3 */ + case 0xa0: // SUBZ,0 + case 0xa1: // SUBZ,1 + case 0xa2: // SUBZ,2 + case 0xa3: // SUBZ,3 m_icount -= 6; - M_SUB( R0, m_reg[m_r] ); + M_SUB(R0, m_reg[m_r]); break; - case 0xa4: /* SUBI,0 v */ - case 0xa5: /* SUBI,1 v */ - case 0xa6: /* SUBI,2 v */ - case 0xa7: /* SUBI,3 v */ + case 0xa4: // SUBI,0 v + case 0xa5: // SUBI,1 v + case 0xa6: // SUBI,2 v + case 0xa7: // SUBI,3 v m_icount -= 6; - M_SUB( m_reg[m_r], ARG() ); + M_SUB(m_reg[m_r], ARG()); break; - case 0xa8: /* SUBR,0 (*)a */ - case 0xa9: /* SUBR,1 (*)a */ - case 0xaa: /* SUBR,2 (*)a */ - case 0xab: /* SUBR,3 (*)a */ + case 0xa8: // SUBR,0 (*)a + case 0xa9: // SUBR,1 (*)a + case 0xaa: // SUBR,2 (*)a + case 0xab: // SUBR,3 (*)a m_icount -= 9; REL_EA(m_page); - M_SUB( m_reg[m_r], RDMEM(m_ea) ); + M_SUB(m_reg[m_r], RDMEM(m_ea)); break; - case 0xac: /* SUBA,0 (*)a(,X) */ - case 0xad: /* SUBA,1 (*)a(,X) */ - case 0xae: /* SUBA,2 (*)a(,X) */ - case 0xaf: /* SUBA,3 (*)a(,X) */ + case 0xac: // SUBA,0 (*)a(,X) + case 0xad: // SUBA,1 (*)a(,X) + case 0xae: // SUBA,2 (*)a(,X) + case 0xaf: // SUBA,3 (*)a(,X) m_icount -= 12; ABS_EA(); - M_SUB( m_reg[m_r], RDMEM(m_ea) ); + M_SUB(m_reg[m_r], RDMEM(m_ea)); break; - case 0xb0: /* WRTC,0 */ - case 0xb1: /* WRTC,1 */ - case 0xb2: /* WRTC,2 */ - case 0xb3: /* WRTC,3 */ + case 0xb0: // WRTC,0 + case 0xb1: // WRTC,1 + case 0xb2: // WRTC,2 + case 0xb3: // WRTC,3 m_icount -= 6; m_data.write_byte(S2650_CTRL_PORT,m_reg[m_r]); break; - case 0xb4: /* TPSU */ + case 0xb4: // TPSU m_icount -= 9; M_TPSU(); break; - case 0xb5: /* TPSL */ + case 0xb5: // TPSL m_icount -= 9; M_TPSL(); break; - case 0xb6: /* illegal */ - case 0xb7: /* illegal */ - m_icount -= 7; - break; - case 0xb8: /* BSFR,0 (*)a */ - case 0xb9: /* BSFR,1 (*)a */ - case 0xba: /* BSFR,2 (*)a */ + case 0xb8: // BSFR,0 (*)a + case 0xb9: // BSFR,1 (*)a + case 0xba: // BSFR,2 (*)a m_icount -= 9; - M_BSR( (m_psl >> 6) != m_r ); + M_BSR((m_psl >> 6) != m_r); break; - case 0xbb: /* ZBSR (*)a */ + case 0xbb: // ZBSR (*)a m_icount -= 9; M_ZBSR(); break; - case 0xbc: /* BSFA,0 (*)a */ - case 0xbd: /* BSFA,1 (*)a */ - case 0xbe: /* BSFA,2 (*)a */ + case 0xbc: // BSFA,0 (*)a + case 0xbd: // BSFA,1 (*)a + case 0xbe: // BSFA,2 (*)a m_icount -= 9; - M_BSA( (m_psl >> 6) != m_r ); + M_BSA((m_psl >> 6) != m_r); break; - case 0xbf: /* BSXA (*)a */ + case 0xbf: // BSXA (*)a m_icount -= 9; M_BSXA(); break; - case 0xc0: /* NOP */ + case 0xc0: // NOP m_icount -= 6; break; - case 0xc1: /* STRZ,1 */ - case 0xc2: /* STRZ,2 */ - case 0xc3: /* STRZ,3 */ + case 0xc1: // STRZ,1 + case 0xc2: // STRZ,2 + case 0xc3: // STRZ,3 m_icount -= 6; - M_LOD( m_reg[m_r], R0 ); - break; - - case 0xc4: /* illegal */ - case 0xc5: /* illegal */ - case 0xc6: /* illegal */ - case 0xc7: /* illegal */ - m_icount -= 7; + M_LOD(m_reg[m_r], R0); break; - case 0xc8: /* STRR,0 (*)a */ - case 0xc9: /* STRR,1 (*)a */ - case 0xca: /* STRR,2 (*)a */ - case 0xcb: /* STRR,3 (*)a */ + case 0xc8: // STRR,0 (*)a + case 0xc9: // STRR,1 (*)a + case 0xca: // STRR,2 (*)a + case 0xcb: // STRR,3 (*)a m_icount -= 9; REL_EA(m_page); - M_STR( m_ea, m_reg[m_r] ); + M_STR(m_ea, m_reg[m_r]); break; - case 0xcc: /* STRA,0 (*)a(,X) */ - case 0xcd: /* STRA,1 (*)a(,X) */ - case 0xce: /* STRA,2 (*)a(,X) */ - case 0xcf: /* STRA,3 (*)a(,X) */ + case 0xcc: // STRA,0 (*)a(,X) + case 0xcd: // STRA,1 (*)a(,X) + case 0xce: // STRA,2 (*)a(,X) + case 0xcf: // STRA,3 (*)a(,X) m_icount -= 12; ABS_EA(); - M_STR( m_ea, m_reg[m_r] ); + M_STR(m_ea, m_reg[m_r]); break; - case 0xd0: /* RRL,0 */ - case 0xd1: /* RRL,1 */ - case 0xd2: /* RRL,2 */ - case 0xd3: /* RRL,3 */ + case 0xd0: // RRL,0 + case 0xd1: // RRL,1 + case 0xd2: // RRL,2 + case 0xd3: // RRL,3 m_icount -= 6; - M_RRL( m_reg[m_r] ); + M_RRL(m_reg[m_r]); break; - case 0xd4: /* WRTE,0 v */ - case 0xd5: /* WRTE,1 v */ - case 0xd6: /* WRTE,2 v */ - case 0xd7: /* WRTE,3 v */ + case 0xd4: // WRTE,0 v + case 0xd5: // WRTE,1 v + case 0xd6: // WRTE,2 v + case 0xd7: // WRTE,3 v m_icount -= 9; - m_io.write_byte( ARG(), m_reg[m_r] ); + m_io.write_byte(ARG(), m_reg[m_r]); break; - case 0xd8: /* BIRR,0 (*)a */ - case 0xd9: /* BIRR,1 (*)a */ - case 0xda: /* BIRR,2 (*)a */ - case 0xdb: /* BIRR,3 (*)a */ + case 0xd8: // BIRR,0 (*)a + case 0xd9: // BIRR,1 (*)a + case 0xda: // BIRR,2 (*)a + case 0xdb: // BIRR,3 (*)a m_icount -= 9; - M_BRR( ++m_reg[m_r] ); + M_BRR(++m_reg[m_r]); break; - case 0xdc: /* BIRA,0 (*)a */ - case 0xdd: /* BIRA,1 (*)a */ - case 0xde: /* BIRA,2 (*)a */ - case 0xdf: /* BIRA,3 (*)a */ + case 0xdc: // BIRA,0 (*)a + case 0xdd: // BIRA,1 (*)a + case 0xde: // BIRA,2 (*)a + case 0xdf: // BIRA,3 (*)a m_icount -= 9; - M_BRA( ++m_reg[m_r] ); + M_BRA(++m_reg[m_r]); break; - case 0xe0: /* COMZ,0 */ - case 0xe1: /* COMZ,1 */ - case 0xe2: /* COMZ,2 */ - case 0xe3: /* COMZ,3 */ + case 0xe0: // COMZ,0 + case 0xe1: // COMZ,1 + case 0xe2: // COMZ,2 + case 0xe3: // COMZ,3 m_icount -= 6; - M_COM( R0, m_reg[m_r] ); + M_COM(R0, m_reg[m_r]); break; - case 0xe4: /* COMI,0 v */ - case 0xe5: /* COMI,1 v */ - case 0xe6: /* COMI,2 v */ - case 0xe7: /* COMI,3 v */ + case 0xe4: // COMI,0 v + case 0xe5: // COMI,1 v + case 0xe6: // COMI,2 v + case 0xe7: // COMI,3 v m_icount -= 6; - M_COM( m_reg[m_r], ARG() ); + M_COM(m_reg[m_r], ARG()); break; - case 0xe8: /* COMR,0 (*)a */ - case 0xe9: /* COMR,1 (*)a */ - case 0xea: /* COMR,2 (*)a */ - case 0xeb: /* COMR,3 (*)a */ + case 0xe8: // COMR,0 (*)a + case 0xe9: // COMR,1 (*)a + case 0xea: // COMR,2 (*)a + case 0xeb: // COMR,3 (*)a m_icount -= 9; REL_EA(m_page); - M_COM( m_reg[m_r], RDMEM(m_ea) ); + M_COM(m_reg[m_r], RDMEM(m_ea)); break; - case 0xec: /* COMA,0 (*)a(,X) */ - case 0xed: /* COMA,1 (*)a(,X) */ - case 0xee: /* COMA,2 (*)a(,X) */ - case 0xef: /* COMA,3 (*)a(,X) */ + case 0xec: // COMA,0 (*)a(,X) + case 0xed: // COMA,1 (*)a(,X) + case 0xee: // COMA,2 (*)a(,X) + case 0xef: // COMA,3 (*)a(,X) m_icount -= 12; ABS_EA(); - M_COM( m_reg[m_r], RDMEM(m_ea) ); + M_COM(m_reg[m_r], RDMEM(m_ea)); break; - case 0xf0: /* WRTD,0 */ - case 0xf1: /* WRTD,1 */ - case 0xf2: /* WRTD,2 */ - case 0xf3: /* WRTD,3 */ + case 0xf0: // WRTD,0 + case 0xf1: // WRTD,1 + case 0xf2: // WRTD,2 + case 0xf3: // WRTD,3 m_icount -= 6; m_data.write_byte(S2650_DATA_PORT, m_reg[m_r]); break; - case 0xf4: /* TMI,0 v */ - case 0xf5: /* TMI,1 v */ - case 0xf6: /* TMI,2 v */ - case 0xf7: /* TMI,3 v */ + case 0xf4: // TMI,0 v + case 0xf5: // TMI,1 v + case 0xf6: // TMI,2 v + case 0xf7: // TMI,3 v m_icount -= 9; - M_TMI( m_reg[m_r] ); + M_TMI(m_reg[m_r]); break; - case 0xf8: /* BDRR,0 (*)a */ - case 0xf9: /* BDRR,1 (*)a */ - case 0xfa: /* BDRR,2 (*)a */ - case 0xfb: /* BDRR,3 (*)a */ + case 0xf8: // BDRR,0 (*)a + case 0xf9: // BDRR,1 (*)a + case 0xfa: // BDRR,2 (*)a + case 0xfb: // BDRR,3 (*)a m_icount -= 9; - M_BRR( --m_reg[m_r] ); + M_BRR(--m_reg[m_r]); break; - case 0xfc: /* BDRA,0 (*)a */ - case 0xfd: /* BDRA,1 (*)a */ - case 0xfe: /* BDRA,2 (*)a */ - case 0xff: /* BDRA,3 (*)a */ + case 0xfc: // BDRA,0 (*)a + case 0xfd: // BDRA,1 (*)a + case 0xfe: // BDRA,2 (*)a + case 0xff: // BDRA,3 (*)a m_icount -= 9; - M_BRA( --m_reg[m_r] ); + M_BRA(--m_reg[m_r]); + break; + + default: // illegal + m_icount -= 6; + logerror("%s: illegal opcode $%02X @ $%04X\n", tag(), m_ppc, m_ir); break; } - } while( m_icount > 0 ); + } while (m_icount > 0); } diff --git a/src/devices/cpu/s2650/s2650.h b/src/devices/cpu/s2650/s2650.h index e21e861aa62..2f03b3db284 100644 --- a/src/devices/cpu/s2650/s2650.h +++ b/src/devices/cpu/s2650/s2650.h @@ -69,17 +69,17 @@ class s2650_device : public cpu_device, public s2650_disassembler::config devcb_write_line m_flag_handler; devcb_read8 m_intack_handler; - uint16_t m_ppc; /* previous program counter (page + iar) */ - uint16_t m_page; /* 8K page select register (A14..A13) */ - uint16_t m_iar; /* instruction address register (A12..A0) */ - uint16_t m_ea; /* effective address (A14..A0) */ - uint8_t m_psl; /* processor status lower */ - uint8_t m_psu; /* processor status upper */ - uint8_t m_r; /* absolute addressing dst/src register */ - uint8_t m_reg[7]; /* 7 general purpose registers */ - uint8_t m_halt; /* 1 if cpu is halted */ - uint8_t m_ir; /* instruction register */ - uint16_t m_ras[8]; /* 8 return address stack entries */ + uint16_t m_ppc; // previous program counter (page + iar) + uint16_t m_page; // 8K page select register (A14..A13) + uint16_t m_iar; // instruction address register (A12..A0) + uint16_t m_ea; // effective address (A14..A0) + uint8_t m_psl; // processor status lower + uint8_t m_psu; // processor status upper + uint8_t m_r; // absolute addressing dst/src register + uint8_t m_reg[7]; // 7 general purpose registers + uint8_t m_halt; // 1 if cpu is halted + uint8_t m_ir; // instruction register + uint16_t m_ras[8]; // 8 return address stack entries uint8_t m_irq_state; int m_icount; diff --git a/src/devices/cpu/s2650/s2650cpu.h b/src/devices/cpu/s2650/s2650cpu.h deleted file mode 100644 index c4ff88f7aff..00000000000 --- a/src/devices/cpu/s2650/s2650cpu.h +++ /dev/null @@ -1,33 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Juergen Buchmueller -/******************************************************* - * - * Portable Signetics 2650 cpu emulation - * - *******************************************************/ - -#define PMSK 0x1fff /* mask page offset */ -#define PLEN 0x2000 /* page length */ -#define PAGE 0x6000 /* mask page */ -#define AMSK 0x7fff /* mask address range */ - -/* processor status lower */ -#define C 0x01 /* carry flag */ -#define COM 0x02 /* compare: 0 binary, 1 2s complement */ -#define OVF 0x04 /* 2s complement overflow */ -#define WC 0x08 /* with carry: use carry in arithmetic / rotate ops */ -#define RS 0x10 /* register select 0: R0/R1/R2/R3 1: R0/R4/R5/R6 */ -#define IDC 0x20 /* inter digit carry: bit-3-to-bit-4 carry */ -#define CC 0xc0 /* condition code */ - -/* processor status upper */ -#define SP 0x07 /* stack pointer: indexing 8 15bit words */ -#define PSU34 0x18 /* unused bits */ -#define II 0x20 /* interrupt inhibit 0: allow, 1: inhibit */ -#define FO 0x40 /* flag output */ -#define SI 0x80 /* sense input */ - -#define R0 m_reg[0] -#define R1 m_reg[1] -#define R2 m_reg[2] -#define R3 m_reg[3] diff --git a/src/devices/cpu/sh/sh3comn.h b/src/devices/cpu/sh/sh3comn.h index 30f8e59ab68..29aeef4cead 100644 --- a/src/devices/cpu/sh/sh3comn.h +++ b/src/devices/cpu/sh/sh3comn.h @@ -1,9 +1,9 @@ // license:BSD-3-Clause // copyright-holders:R. Belmont -#pragma once +#ifndef MAME_CPU_SH_SH3COMN_H +#define MAME_CPU_SH_SH3COMN_H -#ifndef __SH3COMN_H__ -#define __SH3COMN_H__ +#pragma once // actual port handling is more complex than this @@ -95,4 +95,4 @@ #define SH3_EXPEVT_ADDR ((0xffffffd4 - SH3_UPPER_REGBASE)/4) #define SH3_INTEVT_ADDR ((0xffffffd8 - SH3_UPPER_REGBASE)/4) -#endif /* __SH3COMN_H__ */ +#endif // MAME_CPU_SH_SH3COMN_H diff --git a/src/devices/cpu/sh/sh4.h b/src/devices/cpu/sh/sh4.h index 329cd9d2c71..cefe18843db 100644 --- a/src/devices/cpu/sh/sh4.h +++ b/src/devices/cpu/sh/sh4.h @@ -10,8 +10,8 @@ * *****************************************************************************/ -#ifndef MAME_CPU_SH4_SH4_H -#define MAME_CPU_SH4_SH4_H +#ifndef MAME_CPU_SH_SH4_H +#define MAME_CPU_SH_SH4_H #pragma once @@ -807,5 +807,4 @@ DECLARE_DEVICE_TYPE(SH3BE, sh3be_device) DECLARE_DEVICE_TYPE(SH4LE, sh4_device) DECLARE_DEVICE_TYPE(SH4BE, sh4be_device) - -#endif // MAME_CPU_SH4_SH4_H +#endif // MAME_CPU_SH_SH4_H diff --git a/src/devices/cpu/sh/sh4comn.h b/src/devices/cpu/sh/sh4comn.h index 5f02378ed9f..bac004d36b4 100644 --- a/src/devices/cpu/sh/sh4comn.h +++ b/src/devices/cpu/sh/sh4comn.h @@ -8,10 +8,10 @@ * *****************************************************************************/ -#pragma once +#ifndef MAME_CPU_SH_SH4COMN_H +#define MAME_CPU_SH_SH4COMN_H -#ifndef __SH4COMN_H__ -#define __SH4COMN_H__ +#pragma once #include "sh.h" @@ -73,4 +73,4 @@ enum #define REGFLAG_SSR (1 << 10) #define REGFLAG_SPC (1 << 11) -#endif /* __SH4COMN_H__ */ +#endif // MAME_CPU_SH_SH4COMN_H diff --git a/src/devices/cpu/sh/sh4regs.h b/src/devices/cpu/sh/sh4regs.h index 384f062858e..59f0044e283 100644 --- a/src/devices/cpu/sh/sh4regs.h +++ b/src/devices/cpu/sh/sh4regs.h @@ -1,9 +1,9 @@ // license:BSD-3-Clause // copyright-holders:R. Belmont -#pragma once +#ifndef MAME_CPU_SH_SH4REGS_H +#define MAME_CPU_SH_SH4REGS_H -#ifndef __SH4REGS_H__ -#define __SH4REGS_H__ +#pragma once /* 00000001111111100000000011111100 */ #define PTEH 0x2000 /* FF000000 */ @@ -180,4 +180,4 @@ #define PVR_SH7751R 0x04050000 #define PRR_SH7751R 0x00000110 -#endif /* __SH4REGS_H__ */ +#endif // MAME_CPU_SH_SH4REGS_H diff --git a/src/devices/cpu/sh/sh7604_wdt.h b/src/devices/cpu/sh/sh7604_wdt.h index a0d977f7c01..88f33b0e9e8 100644 --- a/src/devices/cpu/sh/sh7604_wdt.h +++ b/src/devices/cpu/sh/sh7604_wdt.h @@ -6,13 +6,12 @@ ***************************************************************************/ -#ifndef MAME_CPU_SH7604_WDT_H -#define MAME_CPU_SH7604_WDT_H +#ifndef MAME_CPU_SH_SH7604_WDT_H +#define MAME_CPU_SH_SH7604_WDT_H #pragma once - //************************************************************************** // TYPE DEFINITIONS //************************************************************************** @@ -44,4 +43,4 @@ class sh7604_wdt_device : public device_t // device type definition DECLARE_DEVICE_TYPE(SH7604_WDT, sh7604_wdt_device) -#endif // MAME_CPU_SH7604_WDT_H +#endif // MAME_CPU_SH_SH7604_WDT_H diff --git a/src/devices/cpu/sh/sh_dasm.h b/src/devices/cpu/sh/sh_dasm.h index 52d6b2eb723..2b29187ee73 100644 --- a/src/devices/cpu/sh/sh_dasm.h +++ b/src/devices/cpu/sh/sh_dasm.h @@ -1,8 +1,8 @@ // license:BSD-3-Clause // copyright-holders:Juergen Buchmueller, R. Belmont -#ifndef MAME_CPU_SH_SHDASM_H -#define MAME_CPU_SH_SHDASM_H +#ifndef MAME_CPU_SH_SH_DASM_H +#define MAME_CPU_SH_SH_DASM_H #pragma once @@ -42,4 +42,4 @@ class sh_disassembler : public util::disasm_interface bool m_is_sh34; }; -#endif +#endif // MAME_CPU_SH_SH_DASM_H diff --git a/src/devices/cpu/sparc/sparcdasm.h b/src/devices/cpu/sparc/sparcdasm.h index 91a22df173a..b92a2c283a3 100644 --- a/src/devices/cpu/sparc/sparcdasm.h +++ b/src/devices/cpu/sparc/sparcdasm.h @@ -4,8 +4,8 @@ SPARC disassembler */ -#ifndef MAME_DEVICES_CPU_SPARC_SPARC_DASM_H -#define MAME_DEVICES_CPU_SPARC_SPARC_DASM_H +#ifndef MAME_CPU_SPARC_SPARCDASM_H +#define MAME_CPU_SPARC_SPARCDASM_H #pragma once @@ -255,4 +255,4 @@ class sparc_disassembler : public util::disasm_interface vis_op_desc_map m_vis_op_desc; }; -#endif // MAME_DEVICES_CPU_SPARC_SPARC_DASM_H +#endif // MAME_CPU_SPARC_SPARCDASM_H diff --git a/src/devices/cpu/sparc/sparcdefs.h b/src/devices/cpu/sparc/sparcdefs.h index 66147c37780..19784b173a7 100644 --- a/src/devices/cpu/sparc/sparcdefs.h +++ b/src/devices/cpu/sparc/sparcdefs.h @@ -7,10 +7,10 @@ // //================================================================ -#pragma once +#ifndef MAME_CPU_SPARC_SPARCDEFS_H +#define MAME_CPU_SPARC_SPARCDEFS_H -#ifndef CPU_SPARC_SPARC_DEFS_H -#define CPU_SPARC_SPARC_DEFS_H +#pragma once #define PSR_CWP_MASK 0x0000001f #define PSR_ET_SHIFT 5 @@ -485,4 +485,4 @@ #define FPOP_FCMPED 0x056 #define FPOP_FCMPEX 0x057 -#endif // CPU_SPARC_SPARC_DEFS_H +#endif // MAME_CPU_SPARC_SPARCDEFS_H diff --git a/src/devices/cpu/spc700/spc700ds.h b/src/devices/cpu/spc700/spc700ds.h index fdd7bbeba7b..9306b23b740 100644 --- a/src/devices/cpu/spc700/spc700ds.h +++ b/src/devices/cpu/spc700/spc700ds.h @@ -1,9 +1,10 @@ // license:BSD-3-Clause // copyright-holders:Karl Stenerud +#ifndef MAME_CPU_SPC700_SPC700DS_H +#define MAME_CPU_SPC700_SPC700DS_H + #pragma once -#ifndef __SPC700DS_H__ -#define __SPC700DS_H__ /* ======================================================================== */ /* =============================== COPYRIGHT ============================== */ /* ======================================================================== */ @@ -62,4 +63,4 @@ class spc700_disassembler : public util::disasm_interface }; -#endif /* __SPC700DS_H__ */ +#endif // MAME_CPU_SPC700_SPC700DS_H diff --git a/src/devices/cpu/ssp1601/ssp1601d.h b/src/devices/cpu/ssp1601/ssp1601d.h index 9c868a5d308..6ebd8db47aa 100644 --- a/src/devices/cpu/ssp1601/ssp1601d.h +++ b/src/devices/cpu/ssp1601/ssp1601d.h @@ -8,8 +8,8 @@ */ -#ifndef MAME_CPU_SSP1601_SSP1601DASM_H -#define MAME_CPU_SSP1601_SSP1601DASM_H +#ifndef MAME_CPU_SSP1601_SSP1601D_H +#define MAME_CPU_SSP1601_SSP1601D_H #pragma once @@ -34,4 +34,4 @@ class ssp1601_disassembler : public util::disasm_interface static std::string get_cond(int op); }; -#endif +#endif // MAME_CPU_SSP1601_SSP1601D_H diff --git a/src/devices/cpu/st62xx/st62xx.h b/src/devices/cpu/st62xx/st62xx.h index e897dab172a..5d584d9db19 100644 --- a/src/devices/cpu/st62xx/st62xx.h +++ b/src/devices/cpu/st62xx/st62xx.h @@ -30,8 +30,8 @@ **********************************************************************/ -#ifndef MAME_CPU_ST62XX_H -#define MAME_CPU_ST62XX_H +#ifndef MAME_CPU_ST62XX_ST62XX_H +#define MAME_CPU_ST62XX_ST62XX_H #pragma once @@ -308,4 +308,4 @@ class st6228_device : public cpu_device DECLARE_DEVICE_TYPE(ST6228, st6228_device) -#endif // MAME_CPU_ST62XX_H +#endif // MAME_CPU_ST62XX_ST62XX_H diff --git a/src/devices/cpu/st62xx/st62xx_dasm.h b/src/devices/cpu/st62xx/st62xx_dasm.h index 1e30f04dd47..5a93b964921 100644 --- a/src/devices/cpu/st62xx/st62xx_dasm.h +++ b/src/devices/cpu/st62xx/st62xx_dasm.h @@ -6,8 +6,8 @@ **********************************************************************/ -#ifndef MAME_CPU_ST62XX_DASM_H -#define MAME_CPU_ST62XX_DASM_H +#ifndef MAME_CPU_ST62XX_ST62XX_DASM_H +#define MAME_CPU_ST62XX_ST62XX_DASM_H #pragma once @@ -24,4 +24,4 @@ class st62xx_disassembler : public util::disasm_interface std::string reg_name(const uint8_t reg); }; -#endif // MAME_CPU_ST62XX_DASM_H +#endif // MAME_CPU_ST62XX_ST62XX_DASM_H diff --git a/src/devices/cpu/tms32010/32010dsm.h b/src/devices/cpu/tms32010/32010dsm.h index d2b93d5f5a4..bbbd7876fa5 100644 --- a/src/devices/cpu/tms32010/32010dsm.h +++ b/src/devices/cpu/tms32010/32010dsm.h @@ -24,8 +24,8 @@ * * \**************************************************************************/ -#ifndef MAME_CPU_TMS32010_DIS32010_H -#define MAME_CPU_TMS32010_DIS32010_H +#ifndef MAME_CPU_TMS32010_32010DSM_H +#define MAME_CPU_TMS32010_32010DSM_H #pragma once @@ -56,4 +56,4 @@ class tms32010_disassembler : public util::disasm_interface std::vector Op; }; -#endif +#endif // MAME_CPU_TMS32010_32010DSM_H diff --git a/src/devices/cpu/tms32025/tms32025.h b/src/devices/cpu/tms32025/tms32025.h index 687675f74f1..c35a2841c74 100644 --- a/src/devices/cpu/tms32025/tms32025.h +++ b/src/devices/cpu/tms32025/tms32025.h @@ -17,8 +17,8 @@ * * \***************************************************************************/ -#ifndef MAME_TMS32025_TMS32025_H -#define MAME_TMS32025_TMS32025_H +#ifndef MAME_CPU_TMS32025_TMS32025_H +#define MAME_CPU_TMS32025_TMS32025_H #pragma once @@ -404,4 +404,4 @@ DECLARE_DEVICE_TYPE(TMS32020, tms32020_device) DECLARE_DEVICE_TYPE(TMS32025, tms32025_device) DECLARE_DEVICE_TYPE(TMS32026, tms32026_device) -#endif // MAME_TMS32025_TMS32025_H +#endif // MAME_CPU_TMS32025_TMS32025_H diff --git a/src/devices/cpu/tms9900/9900dasm.h b/src/devices/cpu/tms9900/9900dasm.h index bdae664e297..5b5df98313c 100644 --- a/src/devices/cpu/tms9900/9900dasm.h +++ b/src/devices/cpu/tms9900/9900dasm.h @@ -7,8 +7,8 @@ * *****************************************************************************/ -#ifndef MAME_CPU_TMS9900_TMS9900DASM_H -#define MAME_CPU_TMS9900_TMS9900DASM_H +#ifndef MAME_CPU_TMS9900_9900DASM_H +#define MAME_CPU_TMS9900_9900DASM_H #pragma once @@ -133,4 +133,4 @@ class tms9900_disassembler : public util::disasm_interface void print_arg (std::ostream &stream, int mode, int arg, const data_buffer ¶ms, offs_t &PC); }; -#endif +#endif // MAME_CPU_TMS9900_9900DASM_H diff --git a/src/devices/cpu/tms9900/tms9995.h b/src/devices/cpu/tms9900/tms9995.h index 4e0689e406f..c175906eeaf 100644 --- a/src/devices/cpu/tms9900/tms9995.h +++ b/src/devices/cpu/tms9900/tms9995.h @@ -7,8 +7,8 @@ Also see tms9900.h for types of TMS99xx processors. */ -#ifndef MAME_CPU_TMS9995_TMS9995_H -#define MAME_CPU_TMS9995_TMS9995_H +#ifndef MAME_CPU_TMS9900_TMS9995_H +#define MAME_CPU_TMS9900_TMS9995_H #pragma once @@ -416,4 +416,4 @@ class tms9995_mp9537_device : public tms9995_device } }; -#endif // MAME_CPU_TMS9995_TMS9995_H +#endif // MAME_CPU_TMS9900_TMS9995_H diff --git a/src/devices/cpu/tms9900/tms99com.h b/src/devices/cpu/tms9900/tms99com.h index 02cc729263d..a293f161b53 100644 --- a/src/devices/cpu/tms9900/tms99com.h +++ b/src/devices/cpu/tms9900/tms99com.h @@ -42,8 +42,10 @@ significant changes (e.g. privileged mode, address mapper). */ -#ifndef __TMS99COMMON_H__ -#define __TMS99COMMON_H__ +#ifndef MAME_CPU_TMS9900_TMS99COM_H +#define MAME_CPU_TMS9900_TMS99COM_H + +#pragma once enum { @@ -80,4 +82,5 @@ enum TMS99xx_BUS_DBIN = 1, TMS99xx_BUS_IAQ = 2 }; -#endif /* __TMS99COMMON_H__ */ + +#endif // MAME_CPU_TMS9900_TMS99COM_H diff --git a/src/devices/cpu/upd777/upd777.cpp b/src/devices/cpu/upd777/upd777.cpp new file mode 100644 index 00000000000..fda5e638bb4 --- /dev/null +++ b/src/devices/cpu/upd777/upd777.cpp @@ -0,0 +1,1262 @@ +// license:BSD-3-Clause +// copyright-holders:Vas Crabb + +#include "emu.h" +#include "upd777.h" + +#include "upd777dasm.h" + + +#define LOG_UNHANDLED_OPS (1U << 1) + +#define VERBOSE (LOG_UNHANDLED_OPS) +#include "logmacro.h" + +DEFINE_DEVICE_TYPE(UPD777, upd777_cpu_device, "upd777", "uPD777") + +upd777_cpu_device::upd777_cpu_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, address_map_constructor data) + : cpu_device(mconfig, type, tag, owner, clock) + , m_datamem(*this, "datamem") + , m_space_config("program", ENDIANNESS_BIG, 16, 11, -1, address_map_constructor(FUNC(upd777_cpu_device::internal_map), this)) + , m_data_config("data", ENDIANNESS_BIG, 8, 7, 0, data) + , m_gfxdecode(*this, "gfxdecode") + , m_palette(*this, "palette") + , m_screen(*this, "screen") + , m_prgregion(*this, "prg") + , m_patregion(*this, "patterns") + , m_port_in(*this, 0xff) +{ +} + +upd777_cpu_device::upd777_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : upd777_cpu_device(mconfig, UPD777, tag, owner, clock, address_map_constructor(FUNC(upd777_cpu_device::internal_data_map), this)) +{ +} + +std::unique_ptr upd777_cpu_device::create_disassembler() +{ + return std::make_unique(); +} + +device_memory_interface::space_config_vector upd777_cpu_device::memory_space_config() const +{ + return space_config_vector{ + std::make_pair(AS_PROGRAM, &m_space_config), + std::make_pair(AS_DATA, &m_data_config) + }; +} + +void upd777_cpu_device::internal_map(address_map &map) +{ + map(0x000, 0x7ff).rom().region("prg", 0); +} + +void upd777_cpu_device::internal_data_map(address_map &map) +{ + // 0x20 groups of 4 7-bit values + // groups 0x00-0x18 are used for sprite/pattern entries with the format + + // 6543210 + // 00 yyyyyyp (y = ypos, p = PRIO) + // 01 xxxxxxx (x = xpos) + // 02 ttttttt (t = pattern) + // 03 YYYRGBS (Y = , RGB = color, S=ySUB) + + map(0x00, 0x7f).ram().share("datamem"); +} + +void upd777_cpu_device::increment_pc() +{ + u16 lowpc = m_pc & 0x07f; + u16 highpc = m_pc & 0x780; + + const u16 xnor = BIT(lowpc, 6) ^ BIT(lowpc, 5) ^ 1; + lowpc = ((lowpc << 1) | xnor) & 0x7f; + + // is returning to the start of the page the correct behavior? + if (lowpc == 0x00) + { + logerror("overflowing PC, returning to start of current page %03x\n", highpc); + // pakpak runs better if you do this, but that is clearly by chance as + // most other cases show this isn't meant to happen + //highpc += 0x80; + //highpc &= 0x7ff; + } + + m_pc = highpc | lowpc; +} + +void upd777_cpu_device::device_start() +{ + space(AS_PROGRAM).specific(m_space); + space(AS_DATA).specific(m_data); + + set_icountptr(m_icount); + + state_add(UPD777_PC, "PC", m_pc); + state_add(STATE_GENPC, "GENPC", m_pc).noshow(); + state_add(STATE_GENPCBASE, "CURPC", m_pc).noshow(); + + state_add(UPD777_A1, "A1", m_a[0]); + state_add(UPD777_A2, "A2", m_a[1]); + state_add(UPD777_A3, "A3", m_a[2]); + state_add(UPD777_A4, "A4", m_a[3]); + + state_add(UPD777_L, "L", m_l); + state_add(UPD777_H, "H", m_h); + + state_add(UPD777_ADDR_STACK0, "ADDR_STACK0", m_stack[0]); + state_add(UPD777_ADDR_STACK1, "ADDR_STACK1", m_stack[1]); + state_add(UPD777_ADDR_STACK2, "ADDR_STACK2", m_stack[2]); + state_add(UPD777_ADDR_STACK_POS, "ADDR_STACK_POS", m_stackpos); + + //state_add(UPD777_SKIP, "SKIP", m_skip); // will always be showing 0 as debugger doesn't hook on skipped opcodes + + save_item(NAME(m_ppc)); + save_item(NAME(m_pc)); + save_item(NAME(m_skip)); + save_item(NAME(m_a)); + save_item(NAME(m_l)); + save_item(NAME(m_ldash)); + save_item(NAME(m_x4)); + save_item(NAME(m_h)); + + save_item(NAME(m_frs)); + save_item(NAME(m_fls)); + + save_item(NAME(m_mode)); + save_item(NAME(m_stb)); + + save_item(NAME(m_stack)); + save_item(NAME(m_stackpos)); + + save_item(NAME(m_disp)); + save_item(NAME(m_gpe)); + save_item(NAME(m_kie)); + save_item(NAME(m_sme)); +} + +void upd777_cpu_device::device_reset() +{ + m_ppc = 0; + m_pc = 0; + + m_a[0] = m_a[1] = m_a[2] = m_a[3] = 0; + m_l = 0; + m_ldash = 0; + m_x4 = 0; + m_h = 0; + + m_frs = 0; + m_fls = 0; + + m_skip = 1; // the first opcode is always 'NOP' so maybe skip is 1 on startup? + + m_stack[0] = m_stack[1] = m_stack[2] = 0; + m_stackpos = 0; + + m_disp = 0; + m_gpe = 0; + m_kie = 0; + m_sme = 0; +} + +inline u16 upd777_cpu_device::fetch() +{ + u16 opcode = m_space.read_word(m_pc); + m_ppc = m_pc; + increment_pc(); + return opcode; +} + + +inline void upd777_cpu_device::set_a11(int a11) +{ + m_pc = (m_pc & 0x3ff) | (a11 & 1) << 10; +} + +inline void upd777_cpu_device::set_new_pc(int newpc) +{ + m_pc = newpc; +} + +// L reg (lower memory pointer) is 2 bit +inline void upd777_cpu_device::set_l(int l) +{ + m_l = l & 0x3; +} + +inline u8 upd777_cpu_device::get_l() const +{ + return m_l & 0x3; +} + +// H reg (upper memory pointer) is 5-bit +inline void upd777_cpu_device::set_h(int h) +{ + m_h = h & 0x1f; +} + +// H reg is used as upper bits of memory address +inline u8 upd777_cpu_device::get_h_shifted() const +{ + return (m_h & 0x1f) << 2; +} + +inline u8 upd777_cpu_device::get_h() const +{ + return m_h & 0x1f; +} + +// M is the content of memory address pointed to by H and L +inline u8 upd777_cpu_device::get_m_data() +{ + u8 addr = get_h_shifted() | get_l(); + return read_data_mem(addr & 0x7f) & 0x7f; +} + +inline void upd777_cpu_device::set_m_data(u8 data) +{ + u8 addr = get_h_shifted() | get_l(); + write_data_mem(addr & 0x7f, data & 0x7f); +} + +// 'A' regs are 7-bit +inline void upd777_cpu_device::set_a1(u8 data) { m_a[0] = data & 0x7f; } +inline void upd777_cpu_device::set_a2(u8 data) { m_a[1] = data & 0x7f; } +inline void upd777_cpu_device::set_a3(u8 data) { m_a[2] = data & 0x7f; } +inline void upd777_cpu_device::set_a4(u8 data) { m_a[3] = data & 0x7f; } + +inline void upd777_cpu_device::set_a1_or_a2(int reg, u8 value) +{ + if (reg == 0) + set_a1(value); + else + set_a2(value); +} + +// 'A' regs are 7-bit +inline u8 upd777_cpu_device::get_a1() const { return m_a[0] & 0x7f; } +inline u8 upd777_cpu_device::get_a2() const { return m_a[1] & 0x7f; } +inline u8 upd777_cpu_device::get_a3() const { return m_a[2] & 0x7f; } +inline u8 upd777_cpu_device::get_a4() const { return m_a[3] & 0x7f; } + +inline u8 upd777_cpu_device::get_a1_or_a2(int reg) const +{ + if (reg == 0) + return get_a1(); + else + return get_a2(); +} + +// FRS/FLS are the 2 7-bit sound registers +inline void upd777_cpu_device::set_frs(u8 frs) { m_frs = frs & 0x7f; } +inline void upd777_cpu_device::set_fls(u8 fls) { m_fls = fls & 0x7f; } + +// MODE is a 7-bit register with the following format +// 6543210 +// rbhpRGB (r = reverberate sound effect, b = brightness, h = hue, p = black/prio, RGB = color) +inline void upd777_cpu_device::set_mode(u8 mode) { m_mode = mode & 0x7f; } + +// single bit enable registers, although they have an important effect on the K->M opcode +inline void upd777_cpu_device::set_disp(u8 data) { m_disp = data & 1; } +inline void upd777_cpu_device::set_gpe(u8 data) { m_gpe = data & 1; } +inline void upd777_cpu_device::set_kie(u8 data) { m_kie = data & 1; } +inline void upd777_cpu_device::set_sme(u8 data) { m_sme = data & 1; } + +inline u8 upd777_cpu_device::get_kie() const { return m_kie & 1; } +inline u8 upd777_cpu_device::get_sme() const { return m_sme & 1; } + + +inline u8 upd777_cpu_device::read_data_mem(u8 addr) +{ + // data memory is 7-bit + return m_data.read_byte(addr) & 0x7f; +} + +inline void upd777_cpu_device::write_data_mem(u8 addr, u8 data) +{ + // data memory is 7-bit + m_data.write_byte(addr, data & 0x7f); +} + +inline void upd777_cpu_device::push_to_stack(u16 addr) +{ + if (m_stackpos < 3) + { + m_stack[m_stackpos] = addr; + m_stackpos++; + } + else + { + logerror("attempting to push to full address stack\n"); + } +} + +inline u16 upd777_cpu_device::pull_from_stack() +{ + if (m_stackpos > 0) + { + m_stackpos--; + return m_stack[m_stackpos]; + } + else + { + logerror("attempting to pull from empty address stack\n"); + return 0; + } +} + +void upd777_cpu_device::do_op() +{ + const u16 inst = fetch(); + + if (inst >= 0b0000'1000'0000 && inst <= 0b0000'1111'1111) + { + // 080 - 0ff Skip if (M[H[5:1],L[2:1]][7:1]-K[7:1]) makes borrow + const int k = inst & 0x7f; + u8 m = get_m_data(); + m = m - k; + if (m & 0x80) + m_skip = 1; + } + else if (inst >= 0b0001'0000'0000 && inst <= 0b0001'0111'1111) + { + // 100-17f M[H[5:1],L[2:1]][7:1]+K[7:1]->M[H[5:1],L[2:1]][7:1], Skip if carry, N->L[2:1] + const int k = inst & 0x1f; + const int n = (inst >> 5) & 0x3; + u8 m = get_m_data(); + m = m + k; + set_m_data(m & 0x7f); + + if (m & 0x80) + m_skip = 1; + + // TODO: prevents infinitely scrolling screen, and allows pakpak to boot, but this does't make logical + // sense, unless the 'Skip if carry' in the text above is specifically meaning this only applies + // when skipping, however if you apply the same to the next opcode it breaks text rendering + // eg 'score' text in the same game. + if (m_skip) + set_l(n); + } + else if (inst >= 0b0001'1000'0000 && inst <= 0b0001'1111'1111) + { + // 180-1ff M[H[5:1],L[2:1]][7:1]-K[7:1]->M[H[5:1],L[2:1]][7:1], Skip if borrow, N->L[2:1] + const int k = inst & 0x1f; + const int n = (inst >> 5) & 0x3; + u8 m = get_m_data(); + m = m - k; + set_m_data(m & 0x7f); + + if (m & 0x80) + m_skip = 1; + + set_l(n); + } + else if (inst >= 0b0100'1000'0000 && inst <= 0b0100'1011'1111) + { + // 480-4bf H[5:1]-K[5:1]->H[5:1], Skip if borrow + const int k = inst & 0x1f; + u8 h = get_h(); + h = h - k; + if (h & 0x20) + m_skip = 1; + set_h(h & 0x1f); + } + else if (inst >= 0b0100'1100'0000 && inst <= 0b0100'1111'1111) + { + // 4c0 - 4ff H[5:1]+K[5:1]->H[5:1], Skip if carry + const int k = inst & 0x1f; + u8 h = get_h(); + h = h + k; + if (h & 0x20) + m_skip = 1; + set_h(h & 0x1f); + } + else if (inst >= 0b0101'0000'0000 && inst <= 0b0101'0111'1111) + { + // 500 - 57f + // When (KIE=0)&(SME=0), Store K[7:1] to M[H[5:1],L[2:1]][7:1] + // When (KIE=1), Store KIN[7:1] to M[H[5:1],L[2:1]][7:1] + // When (SME=1), Store HCL[7:1] to M[H[5:1],L[2:1]][7:1] + const int k = inst & 0x7f; + + if (get_kie()) // documentation does not state if KIE or SME has priority + { + LOGMASKED(LOG_UNHANDLED_OPS, "KIE->M\n", k); + // Inputs for Cassette Vision appear to be read by this + // (selected based on the STB output value?) + set_m_data(m_port_in(m_stb)); + } + else if (get_sme()) + { + LOGMASKED(LOG_UNHANDLED_OPS, "SME->M\n", k); + set_m_data(0); + } + else + { + set_m_data(k & 0x7f); + } + } + else if (inst >= 0b0101'1000'0000 && inst <= 0b0101'1111'1111) + { + // 580 - 5ff Store K[7:6] to L[2:1] and K[5:1] to H[5:1] + const int k = inst & 0x7f; + set_l(k >> 5); + set_h(k & 0x1f); + } + else if (inst >= 0b0110'0000'0000 && inst <= 0b0111'1111'1111) + { + // 600-67f Store K[7:1] to A1[7:1] + // 680-6ff Store K[7:1] to A2[7:1] + // 700-77f Store K[7:1] to A3[7:1] + // 780-7ff Store K[7:1] to A4[7:1] + const int reg = (inst & 0x180) >> 7; + const int k = inst & 0x7f; + switch (reg) + { + case 0: set_a1(k); break; + case 1: set_a2(k); break; + case 2: set_a3(k); break; + case 3: set_a4(k); break; + } + } + else if (inst >= 0b1000'0000'0000 && inst <= 0b1011'1111'1111) + { + // 800 - bff Move K[10:1] to A[10:1], Jump to A[11:1] + u16 fulladdress = (m_ppc & 0x400) | (inst & 0x3ff); + set_new_pc(fulladdress); + } + else if (inst >= 0b1100'0000'0000 && inst <= 0b1111'1111'1111) + { + // c00 - fff Move K[10:1] to A[10:1], 0 to A11, Jump to A[11:1], Push next A[11:1] up to ROM address stack + const int k = inst & 0x3ff; + push_to_stack(m_pc); + set_new_pc(k); + } + else if (((inst & 0b1111'0000'0000) == 0b0010'0000'0000) && ((inst & 0b0000'0000'1100) != 0b0000'0000'0100)) + { + // 0b0010'rrnR'oonn where rr = reg1 (A1, A2, M or H), n = invert condition, R = reg2 (A1 or A2) and oo = optype (only 0,2,3 are valid, no cases here for 1) nn = next l value + + // optype · (AND) + // 200 Skip if (A1[7:1]·A1[7:1]) makes zero, N->L[2:1] + // 220 Skip if (A1[7:1]·A1[7:1]) makes non zero, N->L[2:1] + // 210 Skip if (A1[7:1]·A2[7:1]) makes zero, N->L[2:1] + // 230 Skip if (A1[7:1]·A2[7:1]) makes non zero, N->L[2:1] + // 240 Skip if (A2[7:1]·A1[7:1]) makes zero, N->L[2:1] + // 260 Skip if (A2[7:1]·A1[7:1]) makes non zero, N->L[2:1] + // 250 Skip if (A2[7:1]·A2[7:1]) makes zero, N->L[2:1] + // 270 Skip if (A2[7:1]·A2[7:1]) makes non zero, N->L[2:1] + // 280 Skip if (M[H[5:1],L[2:1]][7:1]·A1[7:1]) makes zero, N->L[2:1] + // 2a0 Skip if (M[H[5:1],L[2:1]][7:1]·A1[7:1]) makes non zero, N->L[2:1] + // 290 Skip if (M[H[5:1],L[2:1]][7:1]·A2[7:1]) makes zero, N->L[2:1] + // 2b0 Skip if (M[H[5:1],L[2:1]][7:1]·A2[7:1]) makes non zero, N->L[2:1] + // 2c0 Skip if (H[5:1]·A1[5:1]) makes zero, N->L[2:1] + // 2e0 Skip if (H[5:1]·A1[5:1]) makes non zero, N->L[2:1] + // 2d0 Skip if (H[5:1]·A2[5:1]) makes zero, N->L[2:1] + // 2f0 Skip if (H[5:1]·A2[5:1]) makes non zero, N->L[2:1] + + // optype = (these are expressed as x=y in the opcopde syntax, but x-y in the description, in reality it seems to act as 'CMP' so x-y = 0) + // 208 Skip if (A1[7:1]-A1[7:1]) makes zero, N->L[2:1] + // 228 Skip if (A1[7:1]-A1[7:1]) makes non zero, N->L[2:1] + // 218 Skip if (A1[7:1]-A2[7:1]) makes zero, N->L[2:1] + // 238 Skip if (A1[7:1]-A2[7:1]) makes non zero, N->L[2:1] + // 248 Skip if (A2[7:1]-A1[7:1]) makes zero, N->L[2:1] + // 268 Skip if (A2[7:1]-A1[7:1]) makes non zero, N->L[2:1] + // 258 Skip if (A2[7:1]-A2[7:1]) makes zero, N->L[2:1] + // 278 Skip if (A2[7:1]-A2[7:1]) makes non zero, N->L[2:1] + // 288 Skip if (M[H[5:1],L[2:1]][7:1]-A1[7:1]) makes zero, N->L[2:1] + // 2a8 Skip if (M[H[5:1],L[2:1]][7:1]-A1[7:1]) makes non zero, N->L[2:1] + // 298 Skip if (M[H[5:1],L[2:1]][7:1]-A2[7:1]) makes zero, N->L[2:1] + // 2b8 Skip if (M[H[5:1],L[2:1]][7:1]-A2[7:1]) makes non zero, N->L[2:1] + // 2c8 Skip if (H[5:1]-A1[5:1]) makes zero, N->L[2:1] + // 2e8 Skip if (H[5:1]-A1[5:1]) makes non zero, N->L[2:1] + // 2d8 Skip if (H[5:1]-A2[5:1]) makes zero, N->L[2:1] + // 2f8 Skip if (H[5:1]-A2[5:1]) makes non zero, N->L[2:1] + + // optype - + // 20c Skip if (A1[7:1]-A1[7:1]) makes borrow, N->L[2:1] + // 22c Skip if (A1[7:1]-A1[7:1]) makes non borrow, N->L[2:1] + // 21c Skip if (A1[7:1]-A2[7:1]) makes borrow, N->L[2:1] + // 23c Skip if (A1[7:1]-A2[7:1]) makes non borrow, N->L[2:1] + // 24c Skip if (A2[7:1]-A1[7:1]) makes borrow, N->L[2:1] + // 26c Skip if (A2[7:1]-A1[7:1]) makes non borrow, N->L[2:1] + // 25c Skip if (A2[7:1]-A2[7:1]) makes borrow, N->L[2:1] + // 27c Skip if (A2[7:1]-A2[7:1]) makes non borrow, N->L[2:1] + // 28c Skip if (M[H[5:1],L[2:1]][7:1]-A1[7:1]) makes borrow, N->L[2:1] + // 2ac Skip if (M[H[5:1],L[2:1]][7:1]-A1[7:1]) makes non borrow, N->L[2:1] + // 29c Skip if (M[H[5:1],L[2:1]][7:1]-A2[7:1]) makes borrow, N->L[2:1] + // 2bc Skip if (M[H[5:1],L[2:1]][7:1]-A2[7:1]) makes non borrow, N->L[2:1] + // 2cc Skip if (H[5:1]-A1[5:1]) makes borrow, N->L[2:1] + // 2ec Skip if (H[5:1]-A1[5:1]) makes non borrow, N->L[2:1] + // 2dc Skip if (H[5:1]-A2[5:1]) makes borrow, N->L[2:1] + // 2fc Skip if (H[5:1]-A2[5:1]) makes non borrow, N->L[2:1] + const int non = inst & 0x20; + const int optype = (inst & 0x0c) >> 2; + const int reg1 = (inst & 0xc0) >> 6; + const int reg2 = (inst & 0x10) >> 4; + const int n = inst & 0x3; + u8 srcreg2 = get_a1_or_a2(reg2); + u8 srcreg1 = 0; + switch (reg1) + { + case 0: srcreg1 = get_a1(); break; + case 1: srcreg1 = get_a2(); break; + case 2: srcreg1 = get_m_data(); break; + case 3: + { + srcreg1 = get_h(); + srcreg2 &= 0x1f; + break; + } + } + + switch (optype) + { + case 0: // AND + { + if (!non) + { + if ((srcreg1 & srcreg2) == 0) // skip if (x·y) makes zero, N->L[2:1] + m_skip = 1; + } + else + { + if ((srcreg1 & srcreg2) != 0) // skip if (x·y) makes non zero, N->L[2:1] + m_skip = 1; + } + break; + } + case 1: // invalid + { + // can't happen, no switch case leads here + break; + } + case 2: // = + { + if (!non) + { + if (srcreg1 == srcreg2) // skip if (x-y) makes zero, N->L[2:1] + m_skip = 1; + } + else + { + if (srcreg1 != srcreg2) // skip if (x-y) makes non zero, N->L[2:1] + m_skip = 1; + } + break; + } + case 3: // - + { + u8 result = srcreg1 - srcreg2; + + if (!non) + { + if (result & 0x80) // skip if (x-y) makes borrow, N->L[2:1] + m_skip = 1; + } + else + { + if ((result & 0x80) == 0) // skip if (x-y) makes non borrow, N->L[2:1] + m_skip = 1; + } + + break; + } + } + + set_l(n); + } + else if ((inst & 0b1111'1010'0000) == 0b0011'0010'0000) + { + // 0b0011'0r1R'oonn (where r = reg1, R = reg2, o = optype, and n = next l value) + // 320 AND A1[7:1] and A1[7:1], store to A1[7:1], N->L[2:1] + // 324 Add A1[7:1] and A1[7:1], store to A1[7:1], N->L[2:1] + // 328 OR A1[7:1] and A1[7:1], store to A1[7:1], N->L[2:1] + // 32c Subtract A1[7:1] and A1[7:1], store to A1[7:1], Skip if borrow, N->L[2:1] + // 330 AND A1[7:1] and A2[7:1], store to A1[7:1], N->L[2:1] + // 334 Add A1[7:1] and A2[7:1], store to A1[7:1], N->L[2:1] + // 338 OR A1[7:1] and A2[7:1], store to A1[7:1], N->L[2:1] + // 33c Subtract A1[7:1] and A2[7:1], store to A1[7:1], Skip if borrow, N->L[2:1] + // 360 AND A2[7:1] and A1[7:1], store to A2[7:1], N->L[2:1] + // 364 Add A2[7:1] and A1[7:1], store to A2[7:1], N->L[2:1] + // 368 OR A2[7:1] and A1[7:1], store to A2[7:1], N->L[2:1] + // 36c Subtract A2[7:1] and A1[7:1], store to A2[7:1], Skip if borrow, N->L[2:1] + // 370 AND A2[7:1] and A2[7:1], store to A2[7:1], N->L[2:1] + // 374 Add A2[7:1] and A2[7:1], store to A2[7:1], N->L[2:1] + // 378 OR A2[7:1] and A2[7:1], store to A2[7:1], N->L[2:1] + // 37c Subtract A2[7:1] and A2[7:1], store to A2[7:1], Skip if borrow, N->L[2:1] + const int optype = (inst & 0x0c) >> 2; + const int reg2 = (inst & 0x10) >> 4; + const int reg1 = (inst & 0x40) >> 6; + const int n = inst & 0x3; + + u8 src1 = get_a1_or_a2(reg1); + u8 src2 = get_a1_or_a2(reg2); + + switch (optype) + { + case 0: // AND + { + src1 = src1 & src2; + break; + } + case 1: // ADD + { + src1 = src1 + src2; + // not in this case? + //if (src1 & 0x80) + // m_skip = 1; + break; + } + case 2: // OR + { + src1 = src1 | src2; + break; + } + case 3: // MINUS + { + src1 = src1 - src2; + if (src1 & 0x80) + m_skip = 1; + break; + } + } + set_a1_or_a2(reg1, src1); + set_l(n); + } + else if ((inst & 0b1111'1110'0000) == 0b0011'1010'0000) + { + // 0b0011'101r'oonn (where r = reg, o = optype, n = next l value) + // 3a0 AND M[H[5:1],L[2:1]][7:1] and A1[7:1], store to M[H[5:1],L[2:1]][7:1], N->L[2:1] + // 3a4 Add M[H[5:1],L[2:1]][7:1] and A1[7:1], store to M[H[5:1],L[2:1]][7:1], N->L[2:1] Skip if carry + // 3a8 OR M[H[5:1],L[2:1]][7:1] and A1[7:1], store to M[H[5:1],L[2:1]][7:1], N->L[2:1] + // 3ac Subtract M[H[5:1],L[2:1]][7:1] and A1[7:1], store to M[H[5:1],L[2:1]][7:1], N->L[2:1] Skip if borrow + // 3b0 AND M[H[5:1],L[2:1]][7:1] and A2[7:1], store to M[H[5:1],L[2:1]][7:1], N->L[2:1] + // 3b4 Add M[H[5:1],L[2:1]][7:1] and A2[7:1], store to M[H[5:1],L[2:1]][7:1], N->L[2:1] Skip if carry + // 3b8 OR M[H[5:1],L[2:1]][7:1] and A2[7:1], store to M[H[5:1],L[2:1]][7:1], N->L[2:1] + // 3bc Subtract M[H[5:1],L[2:1]][7:1] and A2[7:1], store to M[H[5:1],L[2:1]][7:1], N->L[2:1] Skip if borrow + const int optype = (inst & 0x0c) >> 2; + const int reg2 = (inst & 0x10) >> 4; + const int n = inst & 0x3; + u8 src2 = get_a1_or_a2(reg2); + u8 m = get_m_data(); + + switch (optype) + { + case 0: // AND + { + m = m & src2; + break; + } + case 1: // ADD + { + m = m + src2; + if (m & 0x80) + m_skip = 1; + break; + } + case 2: // OR + { + m = m | src2; + break; + } + case 3: // MINUS + { + m = m - src2; + if (m & 0x80) + m_skip = 1; + break; + } + } + set_m_data(m); + set_l(n); + } + else if ((inst & 0b1111'1110'0000) == 0b0011'1110'0000) + { + // 0b0011'111r'oonn (where r = reg, o = optype, n = next l value) + // 3e0 AND H[5:1] and A1[5:1], store to H[5:1], N->L[2:1] + // 3e4 Add H[5:1] and A1[5:1], store to H[5:1], N->L[2:1] + // 3e8 OR H[5:1] and A1[5:1], store to H[5:1], N->L[2:1] + // 3ec Subtract H[5:1] and A1[5:1], store to H[5:1], Skip if borrow, N->L[2:1] + // 3f0 AND H[5:1] and A2[5:1], store to H[5:1], N->L[2:1] + // 3f4 Add H[5:1] and A2[5:1], store to H[5:1], N->L[2:1] + // 3f8 OR H[5:1] and A2[5:1], store to H[5:1], N->L[2:1] + // 3fc Subtract H[5:1] and A2[5:1], store to H[5:1], Skip if borrow, N->L[2:1] + const int optype = (inst & 0x0c) >> 2; + const int reg2 = (inst & 0x10) >> 4; + const int n = inst & 0x3; + u8 src2 = get_a1_or_a2(reg2) & 0x1f; + u8 h = get_h(); + + switch (optype) + { + case 0: // AND + { + h = h & src2; + break; + } + case 1: // ADD + { + h = h + src2; + break; + } + case 2: // OR + { + h = h | src2; + break; + } + case 3: // MINUS + { + h = h - src2; + if (h & 0x20) + m_skip = 1; + break; + } + } + set_h(h & 0x1f); + set_l(n); + } + else if ((inst & 0b1111'1100'0010) == 0b0100'0100'0000) + { + // 0b0100'01dg'ks0n (where d = DISP, G = GPE, K = KIE, S = SME, n = A11) + // 440 Set D to DISP, G to GPE, K to KIE, S to SME, N->A[11] + const int d = (inst >> 5) & 0x1; + const int g = (inst >> 4) & 0x1; + const int k = (inst >> 3) & 0x1; + const int s = (inst >> 2) & 0x1; + const int n = inst & 0x1; + set_disp(d); + set_gpe(g); + set_kie(k); + set_sme(s); + set_a11(n); + } + else if (inst == 0b0000'0000'0000) + { + // 000 No Operation + // nothing + } + else if (inst == 0b0000'0000'0100) + { + // 004 Skip if (Gun Port Latch) = 1 + LOGMASKED(LOG_UNHANDLED_OPS, "GPL\n"); + } + else if (inst == 0b0000'0000'1000) + { + // 008 Move H[5:1] to Line Buffer Register[5:1] + u8 h = get_h(); + //LOGMASKED(LOG_UNHANDLED_OPS, "H(%02x)->NRM\n", h); + + // this seems to push a value from RAM into the line buffer for the current 4(?) scanlines + u8 m1 = read_data_mem(get_h_shifted() | 0); + u8 m2 = read_data_mem(get_h_shifted() | 1); + u8 m3 = read_data_mem(get_h_shifted() | 2); + u8 m4 = read_data_mem(get_h_shifted() | 3); + push_to_line_buffer(h, m1,m2,m3,m4); + } + else if (inst == 0b0000'0001'1000) + { + // 018 H[5:1]<->X4[5:1], 0->X4[7:6], 0->X3[7:1], 0->X1'[1], 0->A1'[1], L[2:1]<->L'[2:1] + LOGMASKED(LOG_UNHANDLED_OPS, "H<->X\n"); +#if 1 + // this opcode is not well explained! but X4 etc. are referenced on Data RAM & Register Files which makes + // it even more confusing (while L' isn't referenced anywhere else at all!) + u8 temp; + + temp = m_x4; + m_x4 = get_h(); + m_h = temp; + + temp = m_ldash; + m_ldash = get_l(); + set_l(temp); +#endif + } + else if (inst == 0b0000'0010'0000) + { + // 020 Subroutine End, Pop down address stack + u16 addr = pull_from_stack(); + set_new_pc(addr); + } + else if (inst == 0b0000'0100'1001) + { + // 049 Skip if (4H Horizontal Blank) = 1 + //LOGMASKED(LOG_UNHANDLED_OPS, "4H BLK\n"); + if (get_hbl_4_state()) + m_skip = 1; + } + else if (inst == 0b0000'0100'1010) + { + // 04a Skip if (Vertical Blank) = 1, 0->M[[18:00],[3]][1] + LOGMASKED(LOG_UNHANDLED_OPS, "VBLK\n"); + if (get_vbl_state()) + m_skip = 1; + + // TODO: + // need to do the 0->M[[18:00],[3]][1] bit + } + else if (inst == 0b0000'0100'1100) + { + // 04c Skip if (GP&SW/ input) = 1 + LOGMASKED(LOG_UNHANDLED_OPS, "GPSW/\n"); + } + else if (inst == 0b0000'0101'0100) + { + // 054 Move (A4[7:1],A3[7:1],A2[7:1],A1[7:1]) to M[H[5:1]][28:1] + write_data_mem(get_h_shifted() | 0, get_a1()); + write_data_mem(get_h_shifted() | 1, get_a2()); + write_data_mem(get_h_shifted() | 2, get_a3()); + write_data_mem(get_h_shifted() | 3, get_a4()); + } + else if (inst == 0b0000'0101'1000) + { + // 058 Move M[H[5:1]][28:1] to (A4[7:1],A3[7:1],A2[7:1],A1[7:1]) + u8 m1 = read_data_mem(get_h_shifted() | 0); + u8 m2 = read_data_mem(get_h_shifted() | 1); + u8 m3 = read_data_mem(get_h_shifted() | 2); + u8 m4 = read_data_mem(get_h_shifted() | 3); + set_a1(m1); + set_a2(m2); + set_a3(m3); + set_a4(m4); + } + else if (inst == 0b0000'0101'1100) + { + // 05c Exchange (A4[7:1],A3[7:1],A2[7:1],A1[7:1]) and M[H[5:1]][28:1] + u8 m1 = read_data_mem(get_h_shifted() | 0); + u8 m2 = read_data_mem(get_h_shifted() | 1); + u8 m3 = read_data_mem(get_h_shifted() | 2); + u8 m4 = read_data_mem(get_h_shifted() | 3); + write_data_mem(get_h_shifted() | 0, get_a1()); + write_data_mem(get_h_shifted() | 1, get_a2()); + write_data_mem(get_h_shifted() | 2, get_a3()); + write_data_mem(get_h_shifted() | 3, get_a4()); + set_a1(m1); + set_a2(m2); + set_a3(m3); + set_a4(m4); + } + else if (inst == 0b0000'0110'0000) + { + // 060 Subroutine End, Pop down address stack, Skip + u16 addr = pull_from_stack(); + set_new_pc(addr); + m_skip = 1; + } + else if (inst == 0b0011'0000'1000) + { + // 308 Move A1[7:1] to FLS[7:1], 0->L[2:1] + u8 a1 = get_a1(); + set_fls(a1); + set_l(0); + } + else if (inst == 0b0011'0100'1000) + { + // 348 Move A2[7:1] to FLS[7:1], 0->L[2:1] + u8 a2 = get_a2(); + set_fls(a2); + set_l(0); + } + else if (inst == 0b0011'1000'1000) + { + // 388 Move M[H[5:1],L[2:1]][7:1] to FLS[7:1], 0->L[2:1] + u8 m = get_m_data(); + set_fls(m); + set_l(0); + } + else if (inst == 0b0011'0000'1001) + { + // 309 Move A1[7:1] to FRS[7:1], 1->L[2:1] + u8 a1 = get_a1(); + set_frs(a1); + set_l(1); + } + else if (inst == 0b0011'0100'1001) + { + // 349 Move A2[7:1] to FRS[7:1], 1->L[2:1] + u8 a2 = get_a2(); + set_frs(a2); + set_l(1); + } + else if (inst == 0b0011'1000'1001) + { + // 389 Move M[H[5:1],L[2:1]][7:1] to FRS[7:1], 1->L[2:1] + u8 m = get_m_data(); + set_frs(m); + set_l(1); + } + else if ((inst == 0b0000'0010'1000) || (inst == 0b0000'0010'1001)) + { + // 028 Shift STB[4:1], N->STB[1] + // STB is an input strobe / shifter + const int n = inst & 1; + LOGMASKED(LOG_UNHANDLED_OPS, "0x%d->STB\n", n); + + m_stb = (m_stb << 1) | n; + m_stb &= 0xf; + } + + else if ((inst == 0b0011'0000'1010) || (inst == 0b0011'0000'1011)) + { + // 30a Move A1[7:1] to MODE[7:1], 1N->L[2:1] + const int n = (inst & 0x1) + 2; + u8 a1 = get_a1(); + set_mode(a1); + set_l(n); + } + else if ((inst == 0b0011'01001010) || (inst == 0b0011'0100'1011)) + { + // 34a Move A2[7:1] to MODE[7:1], 1N->L[2:1] + const int n = (inst & 0x1) + 2; + u8 a2 = get_a2(); + set_mode(a2); + set_l(n); + } + else if ((inst == 0b0011'1000'1010) || (inst == 0b00111000'1011)) + { + // 38a Move M[H[5:1],L[2:1]][7:1] to MODE[7:1], 1N->L[2:1] + const int n = (inst & 0x1) + 2; + u8 m = get_m_data(); + set_mode(m); + set_l(n); + } + else if ((inst == 0b0100'0000'0000) || (inst == 0b0100'0000'0001)) + { + // 400 N->A[11] + const int n = inst & 0x1; + set_a11(n); + } + else if ((inst == 0b0100'0000'0010) || (inst == 0b0100'0000'0011)) + { + // 402 Jump to (000,M[H[5:1],L[2:1]][5:1],1N), 0->L[2:1], N->A[11] + const int n = inst & 0x1; + LOGMASKED(LOG_UNHANDLED_OPS, "JPM, 0->L, %d->A11\n", n); + set_a11(n); + } + else if ((inst & 0b1111'1111'1100) == 0b0011'0000'0000) + { + // 300 N->L[2:1] + const int n = inst & 0x3; + set_l(n); + } + else if ((inst & 0b1111'1111'1100) == 0b0011'0001'0000) + { + // 310 Move A2[7:1] to A1[7:1], N->L[2:1] + const int n = inst & 0x3; + u8 a2 = get_a2(); + set_a1(a2); + set_l(n); + } + else if ((inst & 0b1111'1111'1100) == 0b0011'0100'0000) + { + // 340 Move A1[7:1] to A2[7:1], N->L[2:1] + const int n = inst & 0x3; + u8 a1 = get_a1(); + set_a2(a1); + set_l(n); + } + else if ((inst & 0b1111'1111'1100) == 0b0011'0001'1000) + { + // 318 Right shift A1[7:1], 0->A1[7], N->L[2:1] + const int n = inst & 0x3; + u8 a1 = get_a1(); + a1 = a1 >> 1; + set_a1(a1); + set_l(n); + } + else if ((inst & 0b1111'1111'1100) == 0b0011'0101'1000) + { + // 358 Right shift A2[7:1], 0->A2[7], N->L[2:1] + const int n = inst & 0x3; + u8 a2 = get_a2(); + a2 = a2 >> 1; + set_a2(a2); + set_l(n); + } + else if ((inst & 0b1111'1111'1100) == 0b0011'1001'1000) + { + // 398 Right shift M[H[5:1],L[2:1]][7:1], 0->M[H[5:1],L[2:1]][7], N->L[2:1] + const int n = inst & 0x3; + u8 m = get_m_data(); + m = m >> 1; + set_m_data(m); + set_l(n); + } + else if ((inst & 0b1111'1111'1100) == 0b0011'0001'1100) + { + // 31c Subtract A1[7:1] and A2[7:1], store to A2[7:1], Skip if borrow, N->L[2:1] + const int n = inst & 0x3; + u8 a1 = get_a1(); + u8 a2 = get_a2(); + a2 = a1 - a2; + if (a2 & 0x80) + m_skip = 1; + set_a2(a2); + set_l(n); + } + else if ((inst & 0b1111'1111'1100) == 0b0011'0100'1100) + { + // 34c Subtract A2[7:1] and A1[7:1], store to A1[7:1], Skip if borrow, N->L[2:1] + const int n = inst & 0x3; + u8 a1 = get_a1(); + u8 a2 = get_a2(); + a1 = a2 - a1; + if (a1 & 0x80) + m_skip = 1; + set_a1(a1); + set_l(n); + } + else if ((inst & 0b1111'1110'1100) == 0b0011'1000'0000) + { + // 380 Move A1[7:1] to M[H[5:1],L[2:1]][7:1], N->L[2:1] + // 390 Move A2[7:1] to M[H[5:1],L[2:1]][7:1], N->L[2:1] + const int reg = (inst & 0x10) >> 4; + const int n = inst & 0x3; + u8 src = get_a1_or_a2(reg); + set_m_data(src); + set_l(n); + } + else if ((inst & 0b1111'1110'1100) == 0b0011'1000'0100) + { + // 384 Exchange M[H[5:1],L[2:1]][7:1] and A1[7:1], N->L[2:1] + // 394 Exchange M[H[5:1],L[2:1]][7:1] and A2[7:1], N->L[2:1] + const int reg = (inst & 0x10) >> 4; + const int n = inst & 0x3; + u8 src = get_a1_or_a2(reg); + u8 m = get_m_data(); + set_m_data(src); + set_a1_or_a2(reg,m); + set_l(n); + } + else if ((inst & 0b1111'1110'1100) == 0b0011'1000'1100) + { + // 38c Move M[H[5:1],L[2:1]][7:1] to A1[7:1], N->L[2:1] + // 39c Move M[H[5:1],L[2:1]][7:1] to A2[7:1], N->L[2:1] + const int reg = (inst & 0x10) >> 4; + const int n = inst & 0x3; + u8 m = get_m_data(); + set_a1_or_a2(reg,m); + set_l(n); + } + else if ((inst & 0b1111'1110'1100) == 0b0011'1100'0000) + { + // 3c0 Move A1[5:1] to H[5:1], N->L[2:1] + // 3d0 Move A2[5:1] to H[5:1], N->L[2:1] + const int reg = (inst & 0x10) >> 4; + const int n = inst & 0x3; + u8 src = get_a1_or_a2(reg); + set_h(src); + set_l(n); + } + else if ((inst & 0b1111'1110'1100) == 0b0011'1100'1100) + { + // 3cc Move H[5:1] to A1[5:1], 0->A1[7:6], N->L[2:1] + // 3dc Move H[5:1] to A2[5:1], 0->A2[7:6], N->L[2:1] + const int reg = (inst & 0x10) >> 4; + const int n = inst & 0x3; + u8 h = get_h() & 0x1f; + set_a1_or_a2(reg,h); + set_l(n); + } + else if ((inst & 0b1111'1011'0011) == 0b0000'0011'0000) + { + // 30 Skip if (PD1 input) = 1 + // 34 Skip if (PD2 input) = 1 + // 38 Skip if (PD3 input) = 1 + // 3c Skip if (PD4 input) = 1 + // 70 Skip if (PD1 input) = 0 + // 74 Skip if (PD2 input) = 0 + // 78 Skip if (PD3 input) = 0 + // 7c Skip if (PD4 input) = 0 + const int which = (inst & 0x00c) >> 2; + const int inv = inst & 0x40; + LOGMASKED(LOG_UNHANDLED_OPS, "PD%d %sJ\n", which + 1, inv ? "/" : ""); + } + else + { + LOGMASKED(LOG_UNHANDLED_OPS, "%04x \n", inst); + } +} + +void upd777_cpu_device::execute_run() +{ + while (m_icount > 0) + { + if (m_skip) + { + fetch(); + m_skip = 0; + } + + debugger_instruction_hook(m_pc); + do_op(); + m_icount--; + } +} + +void upd777_cpu_device::execute_set_input(int inputnum, int state) +{ +} + + +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + + +bool upd777_cpu_device::get_vbl_state() +{ + int vpos = m_screen->vpos(); + if (vpos > 240) + return true; + + return false; +} + +bool upd777_cpu_device::get_hbl_4_state() +{ + // I *think* this is Hblank for every 4th line (so a new display list can be written?) + int vpos = m_screen->vpos(); + if ((vpos % 4) == 0) + { + int hpos = m_screen->hpos(); + if (hpos > 200) + return true; + } + + return false; +} + +uint32_t upd777_cpu_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + // this needs to be scanline based, drawing whatever has been pushed to the linebuffer for the current + // group of scanlines! + + bitmap.fill(0, cliprect); + gfx_element *gfx = m_gfxdecode->gfx(0); + gfx_element *gfx2 = m_gfxdecode->gfx(1); + + for (int i = 0; i <= 0x18; i++) + { + u8 s0 = m_datamem[(i * 4) + 0]; + u8 s1 = m_datamem[(i * 4) + 1]; + u8 s2 = m_datamem[(i * 4) + 2]; + u8 s3 = m_datamem[(i * 4) + 3]; + + int ypos = (s0 & 0x7e) >> 1; + //int prio = (s0 & 0x01); + int xpos = (s1 & 0x7f); + int patn = (s2 & 0x7f); + //int ylow = (s3 & 0x70); + int pal = (s3 & 0x0e) >> 1; + //int ysub = (s3 & 0x01); + + if (patn<0x70) + gfx->zoom_transpen(bitmap, cliprect, patn, pal, 0, 0, xpos * 4, ypos * 4, 0x40000, 0x40000, 0); + else + gfx2->zoom_transpen(bitmap, cliprect, patn-0x70, pal, 0, 0, xpos * 4, ypos * 4, 0x40000, 0x40000, 0); + } + + return 0; +} + +// documentation says patterns 0x00 - 0x6e are 7x7 +// and patterns 0x70 - 0x7e are 8x7 +// but they all seem to be stored at 11x7, just with some columns blank? +// this is probably because of how they were read out, over 11 data lines + +// 0x00-0x2f are 'Normal (7x7) +// 0x30-0x67 are 'Bent' (7x7) +// 0x68-0x6f are 'Y Repeat' (7x7) +// 0x70-0x77 are 'XY Repeat' (8x7) +// 0x78-0x7f are 'X Repeat' (8x7) +// +// NOTE, sprite patterns *7 and *f are unused so documentation expresses these ranges as to 66, 6e etc. rather than 67 6f +// +// it isn't clear how the 'Bent' effect etc. is enabled, as clearly not all patterns in this range should use it? + +static const gfx_layout test_layout = +{ + 7,7, + 0x70, + 1, + { 0 }, + { 4,5,6,7,8,9,10 }, + { 0*11,1*11,2*11,3*11,4*11,5*11,6*11 }, + 7*11 +}; + +static const gfx_layout test2_layout = +{ + 8,7, + 0x10, + 1, + { 0 }, + { 3,4,5,6,7,8,9,10 }, + { 0*11,1*11,2*11,3*11,4*11,5*11,6*11 }, + 7*11 +}; + +static GFXDECODE_START( gfx_ud777 ) + GFXDECODE_ENTRY( "patterns", 0x000, test_layout, 0, 8 ) + GFXDECODE_ENTRY( "patterns", 0x436, test2_layout, 0, 8 ) +GFXDECODE_END + + +void upd777_cpu_device::palette_init(palette_device &palette) const +{ + // just a fake palette for now + for (int i = 0; i < palette.entries(); i++) + { + if (i & 1) + { + palette.set_pen_color(i, rgb_t(((i >> 1) & 1) ? 0xff : 0x7f, ((i >> 2) & 1) ? 0xff : 0x7f, ((i >> 3) & 1) ? 0xff : 0x7f)); + } + else + { + palette.set_pen_color(i, rgb_t(0, 0, 0)); + } + } +} + +void upd777_cpu_device::push_to_line_buffer(u8 h, u8 m1, u8 m2, u8 m3, u8 m4) +{ + logerror("sprite %02x pushed to line buffer at scanline %d hpos %d: details %02x %02x %02x %02x\n", h, m_screen->vpos(), m_screen->hpos(), m1, m2, m3, m4); +} + +TIMER_DEVICE_CALLBACK_MEMBER(upd777_cpu_device::scanline_timer) +{ + int scanline = param; + + logerror("scanline %d\n", scanline); +} + +void upd777_cpu_device::device_add_mconfig(machine_config &config) +{ + // or pass the screen from the driver? + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_refresh_hz(60); + m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(2000)); + m_screen->set_size(512, 256); + m_screen->set_visarea(0, 512-1, 0, 256-0-1); + m_screen->set_screen_update(FUNC(upd777_cpu_device::screen_update)); + m_screen->set_palette(m_palette); + + TIMER(config, "scantimer").configure_scanline(FUNC(upd777_cpu_device::scanline_timer), "screen", 0, 1); + + GFXDECODE(config, m_gfxdecode, m_palette, gfx_ud777); + PALETTE(config, m_palette, FUNC(upd777_cpu_device::palette_init), 32 * 3).set_entries(0x10); +} + +ROM_START( upd777 ) + ROM_REGION16_BE( 0x1000, "prg", ROMREGION_ERASEFF ) + ROM_REGION( 0x4d0, "patterns", ROMREGION_ERASEFF ) +ROM_END + +const tiny_rom_entry *upd777_cpu_device::device_rom_region() const +{ + return ROM_NAME(upd777); +} + diff --git a/src/devices/cpu/upd777/upd777.h b/src/devices/cpu/upd777/upd777.h new file mode 100644 index 00000000000..cdb787fd104 --- /dev/null +++ b/src/devices/cpu/upd777/upd777.h @@ -0,0 +1,165 @@ +// license:BSD-3-Clause +// copyright-holders:Vas Crabb + +#ifndef MAME_CPU_UPD777_UPD777_H +#define MAME_CPU_UPD777_UPD777_H + +#pragma once + +#include "machine/timer.h" + +#include "emupal.h" +#include "screen.h" + + +class upd777_cpu_device : public cpu_device +{ +public: + upd777_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); + + enum { + UPD777_PC = 0, + UPD777_A1, + UPD777_A2, + UPD777_A3, + UPD777_A4, + UPD777_SKIP, + UPD777_H, + UPD777_L, + UPD777_ADDR_STACK0, + UPD777_ADDR_STACK1, + UPD777_ADDR_STACK2, + UPD777_ADDR_STACK_POS, + }; + + u16* get_prgregion() { return &m_prgregion[0]; } + u8* get_patregion() { return &m_patregion[0]; } + + auto in_cb() { return m_port_in.bind(); } + +protected: + upd777_cpu_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, address_map_constructor data); + + virtual void device_start() override; + virtual void device_reset() override; + + virtual void execute_run() override; + virtual void execute_set_input(int inputnum, int state) override; + + virtual void device_add_mconfig(machine_config &config) override; + virtual const tiny_rom_entry *device_rom_region() const override; + + virtual std::unique_ptr create_disassembler() override; + + virtual space_config_vector memory_space_config() const override; + + bool get_vbl_state(); + bool get_hbl_4_state(); + + + void internal_map(address_map &map); + void internal_data_map(address_map &map); + + required_shared_ptr m_datamem; + +private: + void increment_pc(); + u16 fetch(); + void do_op(); + + + u8 get_l() const; + void set_l(int l); + u8 get_h_shifted() const; + u8 get_h() const; + void set_h(int h); + void set_a11(int a11); + void set_new_pc(int newpc); + + void set_frs(u8 frs); + void set_fls(u8 fls); + void set_mode(u8 mode); + + u8 get_m_data(); + void set_m_data(u8 data); + + u8 get_a1() const; + u8 get_a2() const; + u8 get_a3() const; + u8 get_a4() const; + u8 get_a1_or_a2(int reg) const; + + void set_a1(u8 data); + void set_a2(u8 data); + void set_a3(u8 data); + void set_a4(u8 data); + void set_a1_or_a2(int reg, u8 value); + + void set_disp(u8 data); + void set_gpe(u8 data); + void set_kie(u8 data); + void set_sme(u8 data); + + u8 get_kie() const; + u8 get_sme() const; + + u8 read_data_mem(u8 addr); + void write_data_mem(u8 addr, u8 data); + void push_to_stack(u16 addr); + u16 pull_from_stack(); + + address_space_config m_space_config; + address_space_config m_data_config; + + memory_access<11, 1, -1, ENDIANNESS_BIG>::specific m_space; + memory_access<8, 0, 0, ENDIANNESS_BIG>::specific m_data; + + u32 m_ppc; + u32 m_pc; + s32 m_icount; + u8 m_skip; + u8 m_a[4]; // A1 to A4 + u8 m_h; + u8 m_l; + u16 m_stack[3]; // 3 11-bit registers + u8 m_stackpos; + + u8 m_frs; + u8 m_fls; + + u8 m_mode; + + u8 m_stb; + + // what are these, used by H<->X opcode + u8 m_ldash; + u8 m_x4; + + // single bit enable registers? + u8 m_disp; + u8 m_gpe; + u8 m_kie; + u8 m_sme; + + ///////////////////////////////////// VIDEO RELATED + + uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + + void push_to_line_buffer(u8 h, u8 m1, u8 m2, u8 m3, u8 m4); + + void palette_init(palette_device &palette) const; + + TIMER_DEVICE_CALLBACK_MEMBER(scanline_timer); + + required_device m_gfxdecode; + required_device m_palette; + required_device m_screen; + required_region_ptr m_prgregion; + required_region_ptr m_patregion; + + devcb_read8 m_port_in; +}; + +DECLARE_DEVICE_TYPE(UPD777, upd777_cpu_device) + +#endif // MAME_CPU_UPD777_UPD777_H diff --git a/src/devices/cpu/upd777/upd777dasm.cpp b/src/devices/cpu/upd777/upd777dasm.cpp new file mode 100644 index 00000000000..fd7597b8bab --- /dev/null +++ b/src/devices/cpu/upd777/upd777dasm.cpp @@ -0,0 +1,504 @@ +// license:BSD-3-Clause +// copyright-holders:Vas Crabb + +#include "emu.h" +#include "upd777dasm.h" + +upd777_disassembler::upd777_disassembler() + : util::disasm_interface() +{ + // init lfsr pc lut + for (u32 i = 0, pc = 0; i < 0x7f; i++) + { + m_l2r[i] = pc; + m_r2l[pc] = i; + const int top1 = (pc & 0x40) >> 6; + const int top2 = (pc & 0x20) >> 5; + const int nor = (top1 ^ top2) ^ 1; + pc = (pc << 1) | nor; + pc &= 0x7f; + } + m_l2r[0x7f] = 0x7f; + m_r2l[0x7f] = 0x7f; +} + + +std::string upd777_disassembler::get_300optype_name(int optype) +{ + switch (optype) + { + case 0x00: return "."; // 'AND' expressed as '·' in documentation, but disassembler isn't keen on that + case 0x01: return "+"; + case 0x02: return "v"; // 'OR' + case 0x03: return "-"; + } + return ""; +} + +std::string upd777_disassembler::get_200optype_name(int optype) +{ + switch (optype) + { + case 0x00: return "."; // 'AND' expressed as '·' in documentation, but disassembler isn't keen on that + case 0x01: return ""; + case 0x02: return "="; + case 0x03: return "-"; + } + return ""; +} + +std::string upd777_disassembler::get_reg_name(int reg) +{ + switch (reg) + { + case 0x00: return "A1"; // general reg A1 + case 0x01: return "A2"; // general reg A2 + case 0x02: return "M"; // content of memory + case 0x03: return "H"; // high address + } + return ""; +} + +offs_t upd777_disassembler::disassemble(std::ostream &stream, offs_t pc, const upd777_disassembler::data_buffer &opcodes, const upd777_disassembler::data_buffer ¶ms) +{ + u16 inst = opcodes.r16(pc); + + if (inst >= 0b0000'1000'0000 && inst <= 0b0000'1111'1111) + { + // 080 - 0ff Skip if (M[H[5:1],L[2:1]][7:1]-K[7:1]) makes borrow + const int k = inst & 0x7f; + util::stream_format(stream, "M-0x%02x", k); + } + else if (inst >= 0b0001'0000'0000 && inst <= 0b0001'0111'1111) + { + // 100-17f M[H[5:1],L[2:1]][7:1]+K[7:1]->M[H[5:1],L[2:1]][7:1], Skip if carry, N->L[2:1] + const int k = inst & 0x1f; + const int n = (inst >> 5) & 0x3; + util::stream_format(stream, "M+0x%02x->M, 0x%d->L", k, n); + } + else if (inst >= 0b0001'1000'0000 && inst <= 0b0001'1111'1111) + { + // 180-1ff M[H[5:1],L[2:1]][7:1]-K[7:1]->M[H[5:1],L[2:1]][7:1], Skip if borrow, N->L[2:1] + const int k = inst & 0x1f; + const int n = (inst >> 5) & 0x3; + util::stream_format(stream, "M-0x%02x->M, 0x%d->L", k, n); + } + else if (inst >= 0b0100'1000'0000 && inst <= 0b0100'1011'1111) + { + // 480-4bf H[5:1]-K[5:1]->H[5:1], Skip if borrow + const int k = inst & 0x1f; + util::stream_format(stream, "H-0x%02x->H BOJ", k); + } + else if (inst >= 0b0100'1100'0000 && inst <= 0b0100'1111'1111) + { + // 4c0 - 4ff H[5:1]+K[5:1]->H[5:1], Skip if carry + const int k = inst & 0x1f; + util::stream_format(stream, "H+0x%02x->H CAJ", k); + } + else if (inst >= 0b0101'0000'0000 && inst <= 0b0101'0111'1111) + { + // 500 - 57f + // When (KIE=0)&(SME=0), Store K[7:1] to M[H[5:1],L[2:1]][7:1] + // When (KIE=1), Store KIN[7:1] to M[H[5:1],L[2:1]][7:1] + // When (SME=1), Store HCL[7:1] to M[H[5:1],L[2:1]][7:1] + const int k = inst & 0x7f; + util::stream_format(stream, "0x%02x->M", k); + } + else if (inst >= 0b0101'1000'0000 && inst <= 0b0101'1111'1111) + { + // 580 - 5ff Store K[7:6] to L[2:1] and K[5:1] to H[5:1] + const int k = inst & 0x7f; + util::stream_format(stream, "0x%02x->L,H", k); + } + else if (inst >= 0b0110'0000'0000 && inst <= 0b0111'1111'1111) + { + // 600-67f Store K[7:1] to A1[7:1] + // 680-6ff Store K[7:1] to A2[7:1] + // 700-77f Store K[7:1] to A3[7:1] + // 780-7ff Store K[7:1] to A4[7:1] + const int reg = (inst & 0x180) >> 7; + const int k = inst & 0x7f; + util::stream_format(stream, "0x%02x->A%d", k, reg+1); + } + else if (inst >= 0b1000'0000'0000 && inst <= 0b1011'1111'1111) + { + // 800 - bff Move K[10:1] to A[10:1], Jump to A[11:1] + u16 fulladdress = (pc & 0x400) | (inst & 0x3ff); + util::stream_format(stream, "JP 0x%03x (%01x:%02x)", fulladdress, (fulladdress & 0x780)>>7, inst & 0x07f); + } + else if (inst >= 0b1100'0000'0000 && inst <= 0b1111'1111'1111) + { + // c00 - fff Move K[10:1] to A[10:1], 0 to A11, Jump to A[11:1], Push next A[11:1] up to ROM address stack + const int k = inst & 0x3ff; + util::stream_format(stream, "JS 0x%03x (%01x:%02x)", k & 0x3ff, (k & 0x380)>>7, k & 0x07f); + } + else if (((inst & 0b1111'0000'0000) == 0b0010'0000'0000) && ((inst & 0b0000'0000'1100) != 0b0000'0000'0100)) + { + // 0b0010'rrnR'oonn where rr = reg1 (A1, A2, M or H), n = invert condition, R = reg2 (A1 or A2) and oo = optype (only 0,2,3 are valid, no cases here for 1) nn = next l value + // + // optype · (AND) + // 200 Skip if (A1[7:1]·A1[7:1]) makes zero, N->L[2:1] + // 220 Skip if (A1[7:1]·A1[7:1]) makes non zero, N->L[2:1] + // 210 Skip if (A1[7:1]·A2[7:1]) makes zero, N->L[2:1] + // 230 Skip if (A1[7:1]·A2[7:1]) makes non zero, N->L[2:1] + // 240 Skip if (A2[7:1]·A1[7:1]) makes zero, N->L[2:1] + // 260 Skip if (A2[7:1]·A1[7:1]) makes non zero, N->L[2:1] + // 250 Skip if (A2[7:1]·A2[7:1]) makes zero, N->L[2:1] + // 270 Skip if (A2[7:1]·A2[7:1]) makes non zero, N->L[2:1] + // 280 Skip if (M[H[5:1],L[2:1]][7:1]·A1[7:1]) makes zero, N->L[2:1] + // 2a0 Skip if (M[H[5:1],L[2:1]][7:1]·A1[7:1]) makes non zero, N->L[2:1] + // 290 Skip if (M[H[5:1],L[2:1]][7:1]·A2[7:1]) makes zero, N->L[2:1] + // 2b0 Skip if (M[H[5:1],L[2:1]][7:1]·A2[7:1]) makes non zero, N->L[2:1] + // 2c0 Skip if (H[5:1]·A1[5:1]) makes zero, N->L[2:1] + // 2e0 Skip if (H[5:1]·A1[5:1]) makes non zero, N->L[2:1] + // 2d0 Skip if (H[5:1]·A2[5:1]) makes zero, N->L[2:1] + // 2f0 Skip if (H[5:1]·A2[5:1]) makes non zero, N->L[2:1] + + // optype = (these are expressed as x=y in the opcopde syntax, but x-y in the description, in reality it seems to act as 'CMP' so x-y = 0) + // 208 Skip if (A1[7:1]-A1[7:1]) makes zero, N->L[2:1] + // 228 Skip if (A1[7:1]-A1[7:1]) makes non zero, N->L[2:1] + // 218 Skip if (A1[7:1]-A2[7:1]) makes zero, N->L[2:1] + // 238 Skip if (A1[7:1]-A2[7:1]) makes non zero, N->L[2:1] + // 248 Skip if (A2[7:1]-A1[7:1]) makes zero, N->L[2:1] + // 268 Skip if (A2[7:1]-A1[7:1]) makes non zero, N->L[2:1] + // 258 Skip if (A2[7:1]-A2[7:1]) makes zero, N->L[2:1] + // 278 Skip if (A2[7:1]-A2[7:1]) makes non zero, N->L[2:1] + // 288 Skip if (M[H[5:1],L[2:1]][7:1]-A1[7:1]) makes zero, N->L[2:1] + // 2a8 Skip if (M[H[5:1],L[2:1]][7:1]-A1[7:1]) makes non zero, N->L[2:1] + // 298 Skip if (M[H[5:1],L[2:1]][7:1]-A2[7:1]) makes zero, N->L[2:1] + // 2b8 Skip if (M[H[5:1],L[2:1]][7:1]-A2[7:1]) makes non zero, N->L[2:1] + // 2c8 Skip if (H[5:1]-A1[5:1]) makes zero, N->L[2:1] + // 2e8 Skip if (H[5:1]-A1[5:1]) makes non zero, N->L[2:1] + // 2d8 Skip if (H[5:1]-A2[5:1]) makes zero, N->L[2:1] + // 2f8 Skip if (H[5:1]-A2[5:1]) makes non zero, N->L[2:1] + + // optype - + // 20c Skip if (A1[7:1]-A1[7:1]) makes borrow, N->L[2:1] + // 22c Skip if (A1[7:1]-A1[7:1]) makes non borrow, N->L[2:1] + // 21c Skip if (A1[7:1]-A2[7:1]) makes borrow, N->L[2:1] + // 23c Skip if (A1[7:1]-A2[7:1]) makes non borrow, N->L[2:1] + // 24c Skip if (A2[7:1]-A1[7:1]) makes borrow, N->L[2:1] + // 26c Skip if (A2[7:1]-A1[7:1]) makes non borrow, N->L[2:1] + // 25c Skip if (A2[7:1]-A2[7:1]) makes borrow, N->L[2:1] + // 27c Skip if (A2[7:1]-A2[7:1]) makes non borrow, N->L[2:1] + // 28c Skip if (M[H[5:1],L[2:1]][7:1]-A1[7:1]) makes borrow, N->L[2:1] + // 2ac Skip if (M[H[5:1],L[2:1]][7:1]-A1[7:1]) makes non borrow, N->L[2:1] + // 29c Skip if (M[H[5:1],L[2:1]][7:1]-A2[7:1]) makes borrow, N->L[2:1] + // 2bc Skip if (M[H[5:1],L[2:1]][7:1]-A2[7:1]) makes non borrow, N->L[2:1] + // 2cc Skip if (H[5:1]-A1[5:1]) makes borrow, N->L[2:1] + // 2ec Skip if (H[5:1]-A1[5:1]) makes non borrow, N->L[2:1] + // 2dc Skip if (H[5:1]-A2[5:1]) makes borrow, N->L[2:1] + // 2fc Skip if (H[5:1]-A2[5:1]) makes non borrow, N->L[2:1] + const int non = inst & 0x20; + const int optype = (inst & 0x0c) >> 2; + const int reg1 = (inst & 0xc0) >> 6; + const int reg2 = (inst & 0x10) >> 4; + const int n = inst & 0x3; + util::stream_format(stream, "%s%s%s, 0x%d->L %s%s", get_reg_name(reg1), get_200optype_name(optype), get_reg_name(reg2), n, (optype == 3) ? "BOJ" : "EQJ", non ? "/" : ""); + } + else if ((inst & 0b1111'1010'0000) == 0b0011'0010'0000) + { + // 0b0011'0r1R'oonn (where r = reg1, R = reg2, o = optype, and n = next l value) + // 320 AND A1[7:1] and A1[7:1], store to A1[7:1], N->L[2:1] + // 324 Add A1[7:1] and A1[7:1], store to A1[7:1], N->L[2:1] + // 328 OR A1[7:1] and A1[7:1], store to A1[7:1], N->L[2:1] + // 32c Subtract A1[7:1] and A1[7:1], store to A1[7:1], Skip if borrow, N->L[2:1] + // 330 AND A1[7:1] and A2[7:1], store to A1[7:1], N->L[2:1] + // 334 Add A1[7:1] and A2[7:1], store to A1[7:1], N->L[2:1] + // 338 OR A1[7:1] and A2[7:1], store to A1[7:1], N->L[2:1] + // 33c Subtract A1[7:1] and A2[7:1], store to A1[7:1], Skip if borrow, N->L[2:1] + // 360 AND A2[7:1] and A1[7:1], store to A2[7:1], N->L[2:1] + // 364 Add A2[7:1] and A1[7:1], store to A2[7:1], N->L[2:1] + // 368 OR A2[7:1] and A1[7:1], store to A2[7:1], N->L[2:1] + // 36c Subtract A2[7:1] and A1[7:1], store to A2[7:1], Skip if borrow, N->L[2:1] + // 370 AND A2[7:1] and A2[7:1], store to A2[7:1], N->L[2:1] + // 374 Add A2[7:1] and A2[7:1], store to A2[7:1], N->L[2:1] + // 378 OR A2[7:1] and A2[7:1], store to A2[7:1], N->L[2:1] + // 37c Subtract A2[7:1] and A2[7:1], store to A2[7:1], Skip if borrow, N->L[2:1] + const int optype = (inst & 0x0c) >> 2; + const int reg2 = (inst & 0x10) >> 4; + const int reg1 = (inst & 0x40) >> 6; + const int n = inst & 0x3; + util::stream_format(stream, "%s%s%s->%s, 0x%d->L %s", get_reg_name(reg1), get_300optype_name(optype), get_reg_name(reg2), get_reg_name(reg1), n, (optype == 3) ? "BOJ" : ""); + } + else if ((inst & 0b1111'1110'0000) == 0b0011'1010'0000) + { + // 0b0011'101r'oonn (where r = reg, o = optype, n = next l value) + // 3a0 AND M[H[5:1],L[2:1]][7:1] and A1[7:1], store to M[H[5:1],L[2:1]][7:1], N->L[2:1] + // 3a4 Add M[H[5:1],L[2:1]][7:1] and A1[7:1], store to M[H[5:1],L[2:1]][7:1], N->L[2:1] Skip if carry + // 3a8 OR M[H[5:1],L[2:1]][7:1] and A1[7:1], store to M[H[5:1],L[2:1]][7:1], N->L[2:1] + // 3ac Subtract M[H[5:1],L[2:1]][7:1] and A1[7:1], store to M[H[5:1],L[2:1]][7:1], N->L[2:1] Skip if borrow + // 3b0 AND M[H[5:1],L[2:1]][7:1] and A2[7:1], store to M[H[5:1],L[2:1]][7:1], N->L[2:1] + // 3b4 Add M[H[5:1],L[2:1]][7:1] and A2[7:1], store to M[H[5:1],L[2:1]][7:1], N->L[2:1] Skip if carry + // 3b8 OR M[H[5:1],L[2:1]][7:1] and A2[7:1], store to M[H[5:1],L[2:1]][7:1], N->L[2:1] + // 3bc Subtract M[H[5:1],L[2:1]][7:1] and A2[7:1], store to M[H[5:1],L[2:1]][7:1], N->L[2:1] Skip if borrow + const int optype = (inst & 0x0c) >> 2; + const int reg2 = (inst & 0x10) >> 4; + const int n = inst & 0x3; + util::stream_format(stream, "M%s%s->M, 0x%d->L", get_300optype_name(optype), get_reg_name(reg2), n); + } + else if ((inst & 0b1111'1110'0000) == 0b0011'1110'0000) + { + // 0b0011'111r'oonn (where r = reg, o = optype, n = next l value) + // 3e0 AND H[5:1] and A1[5:1], store to H[5:1], N->L[2:1] + // 3e4 Add H[5:1] and A1[5:1], store to H[5:1], N->L[2:1] + // 3e8 OR H[5:1] and A1[5:1], store to H[5:1], N->L[2:1] + // 3ec Subtract H[5:1] and A1[5:1], store to H[5:1], Skip if borrow, N->L[2:1] + // 3f0 AND H[5:1] and A2[5:1], store to H[5:1], N->L[2:1] + // 3f4 Add H[5:1] and A2[5:1], store to H[5:1], N->L[2:1] + // 3f8 OR H[5:1] and A2[5:1], store to H[5:1], N->L[2:1] + // 3fc Subtract H[5:1] and A2[5:1], store to H[5:1], Skip if borrow, N->L[2:1] + const int optype = (inst & 0x0c) >> 2; + const int reg = (inst & 0x10) >> 4; + const int n = inst & 0x3; + util::stream_format(stream, "H%s%s->H, 0x%d->L", get_300optype_name(optype), get_reg_name(reg), n); + } + else if ((inst & 0b1111'1100'0010) == 0b0100'0100'0000) + { + // 0b0100'01dg'ks0n (where d = DISP, G = GPE, K = KIE, S = SME, n = A11) + // 440 Set D to DISP, G to GPE, K to KIE, S to SME, N->A[11] + const int d = (inst >> 5) & 0x1; + const int g = (inst >> 4) & 0x1; + const int k = (inst >> 3) & 0x1; + const int s = (inst >> 2) & 0x1; + const int n = inst & 0x1; + util::stream_format(stream, "%d->D, %d->G, %d->K, %d->S, %d->A11", d, g, k, s, n); + } + else if (inst == 0b0000'0000'0000) + { + // 000 No Operation + util::stream_format(stream, "NOP"); + } + else if (inst == 0b0000'0000'0100) + { + // 004 Skip if (Gun Port Latch) = 1 + util::stream_format(stream, "GPL"); + } + else if (inst == 0b0000'0000'1000) + { + // 008 Move H[5:1] to Line Buffer Register[5:1] + util::stream_format(stream, "H->NRM"); + } + else if (inst == 0b0000'0001'1000) + { + // 018 H[5:1]<->X4[5:1], 0->X4[7:6], 0->X3[7:1], 0->X1'[1], 0->A1'[1], L[2:1]<->L'[2:1] + util::stream_format(stream, "H<->X"); + } + else if (inst == 0b0000'0010'0000) + { + // 020 Subroutine End, Pop down address stack + util::stream_format(stream, "SRE"); + } + else if (inst == 0b0000'0100'1001) + { + // 049 Skip if (4H Horizontal Blank) = 1 + util::stream_format(stream, "4H BLK"); + } + else if (inst == 0b0000'0100'1010) + { + // 04a Skip if (Vertical Blank) = 1, 0->M[[18:00],[3]][1] + util::stream_format(stream, "VBLK"); + } + else if (inst == 0b0000'0100'1100) + { + // 04c Skip if (GP&SW/ input) = 1 + util::stream_format(stream, "GPSW/"); + } + else if (inst == 0b0000'0101'0100) + { + // 054 Move (A4[7:1],A3[7:1],A2[7:1],A1[7:1]) to M[H[5:1]][28:1] + util::stream_format(stream, "A->MA"); + } + else if (inst == 0b0000'0101'1000) + { + // 058 Move M[H[5:1]][28:1] to (A4[7:1],A3[7:1],A2[7:1],A1[7:1]) + util::stream_format(stream, "MA->A"); + } + else if (inst == 0b0000'0101'1100) + { + // 05c Exchange (A4[7:1],A3[7:1],A2[7:1],A1[7:1]) and M[H[5:1]][28:1] + util::stream_format(stream, "MA<->A"); + } + else if (inst == 0b0000'0110'0000) + { + // 060 Subroutine End, Pop down address stack, Skip + util::stream_format(stream, "SRE+1"); + } + else if (inst == 0b0011'0000'1000) + { + // 308 Move A1[7:1] to FLS[7:1], 0->L[2:1] + util::stream_format(stream, "A1->FLS, 0->L"); + } + else if (inst == 0b0011'0100'1000) + { + // 348 Move A2[7:1] to FLS[7:1], 0->L[2:1] + util::stream_format(stream, "A2->FLS, 0->L"); + } + else if (inst == 0b0011'1000'1000) + { + // 388 Move M[H[5:1],L[2:1]][7:1] to FLS[7:1], 0->L[2:1] + util::stream_format(stream, "M->FLS, 0->L"); + } + else if (inst == 0b0011'0000'1001) + { + // 309 Move A1[7:1] to FRS[7:1], 1->L[2:1] + util::stream_format(stream, "A1->FRS, 1->L"); + } + else if (inst == 0b0011'0100'1001) + { + // 349 Move A2[7:1] to FRS[7:1], 1->L[2:1] + util::stream_format(stream, "A2->FRS, 1->L"); + } + else if (inst == 0b0011'1000'1001) + { + // 389 Move M[H[5:1],L[2:1]][7:1] to FRS[7:1], 1->L[2:1] + util::stream_format(stream, "M->FRS, 1->L"); + } + else if ((inst == 0b0000'0010'1000) || (inst == 0b0000'0010'1001)) + { + // 028 Shift STB[4:1], N->STB[1] + // STB is an input strobe / shifter + const int n = inst & 1; + util::stream_format(stream, "0x%d->STB", n); + } + else if ((inst == 0b0011'0000'1010) || (inst == 0b0011'0000'1011)) + { + // 30a Move A1[7:1] to MODE[7:1], 1N->L[2:1] + const int n = (inst & 0x1) + 2; + util::stream_format(stream, "A1->MODE, 0x%d->L", n); + } + else if ((inst == 0b0011'01001010) || (inst == 0b0011'0100'1011)) + { + // 34a Move A2[7:1] to MODE[7:1], 1N->L[2:1] + const int n = (inst & 0x1) + 2; + util::stream_format(stream, "A2->MODE, 0x%d->L", n); + } + else if ((inst == 0b0011'1000'1010) || (inst == 0b00111000'1011)) + { + // 38a Move M[H[5:1],L[2:1]][7:1] to MODE[7:1], 1N->L[2:1] + const int n = (inst & 0x1) + 2; + util::stream_format(stream, "M->MODE, 0x%d->L", n); + } + + else if ((inst == 0b0100'0000'0000) || (inst == 0b0100'0000'0001)) + { + // 400 N->A[11] + const int n = inst & 0x1; + util::stream_format(stream, "%d->A11", n); + } + else if ((inst == 0b0100'0000'0010) || (inst == 0b0100'0000'0011)) + { + // 402 Jump to (000,M[H[5:1],L[2:1]][5:1],1N), 0->L[2:1], N->A[11] + const int n = inst & 0x1; + util::stream_format(stream, "JPM, 0->L, %d->A11", n); + } + else if ((inst & 0b1111'1111'1100) == 0b0011'0000'0000) + { + // 300 N->L[2:1] + const int n = inst & 0x3; + util::stream_format(stream, "0x%d->L", n); + } + else if ((inst & 0b1111'1111'1100) == 0b0011'0001'0000) + { + // 310 Move A2[7:1] to A1[7:1], N->L[2:1] + const int n = inst & 0x3; + util::stream_format(stream, "A2->A1, 0x%d->L", n); + } + else if ((inst & 0b1111'1111'1100) == 0b0011'0100'0000) + { + // 340 Move A1[7:1] to A2[7:1], N->L[2:1] + const int n = inst & 0x3; + util::stream_format(stream, "A1->A2, 0x%d->L", n); + } + + else if ((inst & 0b1111'1111'1100) == 0b0011'0001'1000) + { + // 318 Right shift A1[7:1], 0->A1[7], N->L[2:1] + const int n = inst & 0x3; + util::stream_format(stream, "A1->RS, 0x%d->L", n); + } + else if ((inst & 0b1111'1111'1100) == 0b0011'0101'1000) + { + // 358 Right shift A2[7:1], 0->A2[7], N->L[2:1] + const int n = inst & 0x3; + util::stream_format(stream, "A2->RS, 0x%d->L", n); + } + else if ((inst & 0b1111'1111'1100) == 0b0011'1001'1000) + { + // 398 Right shift M[H[5:1],L[2:1]][7:1], 0->M[H[5:1],L[2:1]][7], N->L[2:1] + const int n = inst & 0x3; + util::stream_format(stream, "M->RS, 0x%d->L", n); + } + else if ((inst & 0b1111'1111'1100) == 0b0011'0001'1100) + { + // 31c Subtract A1[7:1] and A2[7:1], store to A2[7:1], Skip if borrow, N->L[2:1] + const int n = inst & 0x3; + util::stream_format(stream, "A1-A2->A2, 0x%d->L", n); + } + else if ((inst & 0b1111'1111'1100) == 0b0011'0100'1100) + { + // 34c Subtract A2[7:1] and A1[7:1], store to A1[7:1], Skip if borrow, N->L[2:1] + const int n = inst & 0x3; + util::stream_format(stream, "A2-A1->A1, 0x%d->L", n); + } + else if ((inst & 0b1111'1110'1100) == 0b0011'1000'0000) + { + // 380 Move A1[7:1] to M[H[5:1],L[2:1]][7:1], N->L[2:1] + // 390 Move A2[7:1] to M[H[5:1],L[2:1]][7:1], N->L[2:1] + const int reg = (inst & 0x10) >> 4; + const int n = inst & 0x3; + util::stream_format(stream, "A%d->M, 0x%d->L", reg + 1, n); + } + else if ((inst & 0b1111'1110'1100) == 0b0011'1000'0100) + { + // 384 Exchange M[H[5:1],L[2:1]][7:1] and A1[7:1], N->L[2:1] + // 394 Exchange M[H[5:1],L[2:1]][7:1] and A2[7:1], N->L[2:1] + const int reg = (inst & 0x10) >> 4; + const int n = inst & 0x3; + util::stream_format(stream, "M<->A%d, 0x%d->L", reg + 1, n); + } + else if ((inst & 0b1111'1110'1100) == 0b0011'1000'1100) + { + // 38c Move M[H[5:1],L[2:1]][7:1] to A1[7:1], N->L[2:1] + // 39c Move M[H[5:1],L[2:1]][7:1] to A2[7:1], N->L[2:1] + const int reg = (inst & 0x10) >> 4; + const int n = inst & 0x3; + util::stream_format(stream, "M->A%d, 0x%d->L", reg + 1, n); + } + else if ((inst & 0b1111'1110'1100) == 0b0011'1100'0000) + { + // 3c0 Move A1[5:1] to H[5:1], N->L[2:1] + // 3d0 Move A2[5:1] to H[5:1], N->L[2:1] + const int reg = (inst & 0x10) >> 4; + const int n = inst & 0x3; + util::stream_format(stream, "A%d->H, 0x%d->L", reg + 1, n); + } + else if ((inst & 0b1111'1110'1100) == 0b0011'1100'1100) + { + // 3cc Move H[5:1] to A1[5:1], 0->A1[7:6], N->L[2:1] + // 3dc Move H[5:1] to A2[5:1], 0->A2[7:6], N->L[2:1] + const int reg = (inst & 0x10) >> 4; + const int n = inst & 0x3; + util::stream_format(stream, "H->A%d, 0x%d->L", reg + 1, n); + } + else if ((inst & 0b1111'1011'0011) == 0b0000'0011'0000) + { + // 30 Skip if (PD1 input) = 1 + // 34 Skip if (PD2 input) = 1 + // 38 Skip if (PD3 input) = 1 + // 3c Skip if (PD4 input) = 1 + // 70 Skip if (PD1 input) = 0 + // 74 Skip if (PD2 input) = 0 + // 78 Skip if (PD3 input) = 0 + // 7c Skip if (PD4 input) = 0 + const int which = (inst & 0x00c) >> 2; + const int inv = inst & 0x40; + util::stream_format(stream, "PD%d %sJ", which + 1, inv ? "/" : ""); + } + else + { + util::stream_format(stream, "%04x ", inst); + } + + return 1; +} diff --git a/src/devices/cpu/upd777/upd777dasm.h b/src/devices/cpu/upd777/upd777dasm.h new file mode 100644 index 00000000000..b7729edbc30 --- /dev/null +++ b/src/devices/cpu/upd777/upd777dasm.h @@ -0,0 +1,34 @@ +// license:BSD-3-Clause +// copyright-holders:Vas Crabb + +#ifndef MAME_CPU_UPD777_UPD777DASM_H +#define MAME_CPU_UPD777_UPD777DASM_H + +#pragma once + + +class upd777_disassembler : public util::disasm_interface +{ +public: + // construction/destruction + upd777_disassembler(); + +protected: + // disassembler overrides + virtual u32 opcode_alignment() const override { return 1; } + virtual u32 interface_flags() const override { return NONLINEAR_PC | PAGED; } + virtual u32 page_address_bits() const override { return 7; } + virtual offs_t pc_linear_to_real(offs_t pc) const override { return (pc & ~0x7f) | m_l2r[pc & 0x7f]; } + virtual offs_t pc_real_to_linear(offs_t pc) const override { return (pc & ~0x7f) | m_r2l[pc & 0x7f]; } + virtual offs_t disassemble(std::ostream &stream, offs_t pc, const data_buffer &opcodes, const data_buffer ¶ms) override; + +private: + u8 m_l2r[0x80]; + u8 m_r2l[0x80]; + + std::string get_300optype_name(int optype); + std::string get_200optype_name(int optype); + std::string get_reg_name(int reg); +}; + +#endif // MAME_CPU_UPD777_UPD777DASM_H diff --git a/src/devices/cpu/upd7810/upd7810_dasm.h b/src/devices/cpu/upd7810/upd7810_dasm.h index a367ab24a48..7aaf47e8d14 100644 --- a/src/devices/cpu/upd7810/upd7810_dasm.h +++ b/src/devices/cpu/upd7810/upd7810_dasm.h @@ -8,8 +8,8 @@ * *****************************************************************************/ -#ifndef MAME_CPU_UPD7810_UPD7810DASM_H -#define MAME_CPU_UPD7810_UPD7810DASM_H +#ifndef MAME_CPU_UPD7810_UPD7810_DASM_H +#define MAME_CPU_UPD7810_UPD7810_DASM_H #pragma once @@ -288,4 +288,4 @@ class upd78c05_disassembler : public upd7810_base_disassembler virtual ~upd78c05_disassembler() = default; }; -#endif +#endif // MAME_CPU_UPD7810_UPD7810_DASM_H diff --git a/src/devices/cpu/v30mz/v30mz.h b/src/devices/cpu/v30mz/v30mz.h index ab342184273..da1612977ff 100644 --- a/src/devices/cpu/v30mz/v30mz.h +++ b/src/devices/cpu/v30mz/v30mz.h @@ -1,7 +1,7 @@ // license:BSD-3-Clause // copyright-holders:Wilbert Pol,Bryan McPhail -#ifndef MAME_CPU_V32MZ_V30MZ_H -#define MAME_CPU_V32MZ_V30MZ_H +#ifndef MAME_CPU_V30MZ_V30MZ_H +#define MAME_CPU_V30MZ_V30MZ_H #include "cpu/nec/necdasm.h" @@ -229,4 +229,4 @@ class v30mz_cpu_device : public cpu_device, public nec_disassembler::config uint16_t m_debugger_temp; }; -#endif // MAME_CPU_V32MZ_V30MZ_H +#endif // MAME_CPU_V30MZ_V30MZ_H diff --git a/src/devices/cpu/v620/v620dasm.h b/src/devices/cpu/v620/v620dasm.h index 8c93150cf9b..58be863ba9b 100644 --- a/src/devices/cpu/v620/v620dasm.h +++ b/src/devices/cpu/v620/v620dasm.h @@ -1,8 +1,8 @@ // license:BSD-3-Clause // copyright-holders:AJR -#ifndef MAME_CPU_V620_V620_H -#define MAME_CPU_V620_V620_H +#ifndef MAME_CPU_V620_V620DASM_H +#define MAME_CPU_V620_V620DASM_H #pragma once @@ -51,4 +51,4 @@ class v75_disassembler : public v620f_disassembler virtual offs_t dasm_io(std::ostream &stream, u16 inst, offs_t pc, const data_buffer &opcodes) const override; }; -#endif // MAME_CPU_V620_V620_H +#endif // MAME_CPU_V620_V620DASM_H diff --git a/src/devices/imagedev/avivideo.h b/src/devices/imagedev/avivideo.h index e14b4298415..67d0f30d132 100644 --- a/src/devices/imagedev/avivideo.h +++ b/src/devices/imagedev/avivideo.h @@ -8,8 +8,8 @@ *********************************************************************/ -#ifndef MAME_DEVICES_IMAGEDEV_AVIVIDEO_H -#define MAME_DEVICES_IMAGEDEV_AVIVIDEO_H +#ifndef MAME_IMAGEDEV_AVIVIDEO_H +#define MAME_IMAGEDEV_AVIVIDEO_H #pragma once @@ -69,4 +69,4 @@ class avivideo_image_device : public device_t, public device_image_interface // device type definition DECLARE_DEVICE_TYPE(IMAGE_AVIVIDEO, avivideo_image_device) -#endif // MAME_DEVICES_IMAGEDEV_AVIVIDEO_H +#endif // MAME_IMAGEDEV_AVIVIDEO_H diff --git a/src/devices/imagedev/bitbngr.h b/src/devices/imagedev/bitbngr.h index 7fdc7deaa6b..a10cfc80bb1 100644 --- a/src/devices/imagedev/bitbngr.h +++ b/src/devices/imagedev/bitbngr.h @@ -6,8 +6,10 @@ *********************************************************************/ -#ifndef MAME_DEVICES_IMAGEDEV_BITBNGR_H -#define MAME_DEVICES_IMAGEDEV_BITBNGR_H +#ifndef MAME_IMAGEDEV_BITBNGR_H +#define MAME_IMAGEDEV_BITBNGR_H + +#pragma once class bitbanger_device : public device_t, public device_image_interface @@ -53,4 +55,4 @@ class bitbanger_device : public device_t, // device type definition DECLARE_DEVICE_TYPE(BITBANGER, bitbanger_device) -#endif // MAME_DEVICES_IMAGEDEV_BITBNGR_H +#endif // MAME_IMAGEDEV_BITBNGR_H diff --git a/src/devices/imagedev/cartrom.h b/src/devices/imagedev/cartrom.h index 851f7238892..07b58c786cb 100644 --- a/src/devices/imagedev/cartrom.h +++ b/src/devices/imagedev/cartrom.h @@ -8,8 +8,8 @@ *********************************************************************/ -#ifndef MAME_DEVICES_IMAGEDEV_CARTROM_H -#define MAME_DEVICES_IMAGEDEV_CARTROM_H +#ifndef MAME_IMAGEDEV_CARTROM_H +#define MAME_IMAGEDEV_CARTROM_H #pragma once @@ -52,4 +52,4 @@ class device_cartrom_image_interface : public device_rom_image_interface device_cartrom_image_interface(const machine_config &mconfig, device_t &device); }; -#endif // MAME_DEVICES_IMAGEDEV_CARTROM_H +#endif // MAME_IMAGEDEV_CARTROM_H diff --git a/src/devices/imagedev/cassette.h b/src/devices/imagedev/cassette.h index a123d349e9c..60bd0357324 100644 --- a/src/devices/imagedev/cassette.h +++ b/src/devices/imagedev/cassette.h @@ -8,8 +8,10 @@ *********************************************************************/ -#ifndef MAME_DEVICES_IMAGEDEV_CASSETTE_H -#define MAME_DEVICES_IMAGEDEV_CASSETTE_H +#ifndef MAME_IMAGEDEV_CASSETTE_H +#define MAME_IMAGEDEV_CASSETTE_H + +#pragma once #include "formats/cassimg.h" @@ -142,4 +144,4 @@ DECLARE_DEVICE_TYPE(CASSETTE, cassette_image_device) // device iterator typedef device_type_enumerator cassette_device_enumerator; -#endif // MAME_DEVICES_IMAGEDEV_CASSETTE_H +#endif // MAME_IMAGEDEV_CASSETTE_H diff --git a/src/devices/imagedev/cdromimg.h b/src/devices/imagedev/cdromimg.h index 6b423c5ca5a..e7d9feaa62d 100644 --- a/src/devices/imagedev/cdromimg.h +++ b/src/devices/imagedev/cdromimg.h @@ -8,8 +8,8 @@ *********************************************************************/ -#ifndef MAME_DEVICES_IMAGEDEV_CHD_CD_H -#define MAME_DEVICES_IMAGEDEV_CHD_CD_H +#ifndef MAME_IMAGEDEV_CDROMIMG_H +#define MAME_IMAGEDEV_CDROMIMG_H #pragma once @@ -114,4 +114,4 @@ class dvdrom_image_device : public cdrom_image_device }; -#endif // MAME_DEVICES_IMAGEDEV_CHD_CD_H +#endif // MAME_IMAGEDEV_CDROMIMG_H diff --git a/src/devices/imagedev/diablo.h b/src/devices/imagedev/diablo.h index 56a1f4ef7c2..c4b6e9408cf 100644 --- a/src/devices/imagedev/diablo.h +++ b/src/devices/imagedev/diablo.h @@ -4,8 +4,8 @@ * DIABLO drive image to hard disk interface **********************************************************/ -#ifndef MAME_DEVICES_IMAGEDEV_DIABLO_H -#define MAME_DEVICES_IMAGEDEV_DIABLO_H +#ifndef MAME_IMAGEDEV_DIABLO_H +#define MAME_IMAGEDEV_DIABLO_H #pragma once @@ -78,4 +78,4 @@ class diablo_image_device : public harddisk_image_base_device // device type definition DECLARE_DEVICE_TYPE(DIABLO, diablo_image_device) -#endif // MAME_DEVICES_IMAGEDEV_DIABLO_H +#endif // MAME_IMAGEDEV_DIABLO_H diff --git a/src/devices/imagedev/flopdrv.h b/src/devices/imagedev/flopdrv.h index a07307c05aa..f33a2612387 100644 --- a/src/devices/imagedev/flopdrv.h +++ b/src/devices/imagedev/flopdrv.h @@ -2,8 +2,8 @@ // copyright-holders:Nathan Woods, Miodrag Milanovic /* flopdrv provides simple emulation of a disc drive */ -#ifndef MAME_DEVICES_IMAGEDV_FLOPDRV_H -#define MAME_DEVICES_IMAGEDV_FLOPDRV_H +#ifndef MAME_IMAGEDEV_FLOPDRV_H +#define MAME_IMAGEDEV_FLOPDRV_H #pragma once @@ -224,4 +224,4 @@ class legacy_floppy_image_device : public device_t, char m_extension_list[256]; }; -#endif // MAME_DEVICES_IMAGEDV_FLOPDRV_H +#endif // MAME_IMAGEDEV_FLOPDRV_H diff --git a/src/devices/imagedev/floppy.h b/src/devices/imagedev/floppy.h index 3419bd180fc..8e03f9438a7 100644 --- a/src/devices/imagedev/floppy.h +++ b/src/devices/imagedev/floppy.h @@ -6,8 +6,8 @@ *********************************************************************/ -#ifndef MAME_DEVICES_IMAGEDEV_FLOPPY_H -#define MAME_DEVICES_IMAGEDEV_FLOPPY_H +#ifndef MAME_IMAGEDEV_FLOPPY_H +#define MAME_IMAGEDEV_FLOPPY_H #pragma once @@ -488,4 +488,4 @@ DECLARE_DEVICE_TYPE(FLOPPY_CONNECTOR, floppy_connector) extern template class device_finder; extern template class device_finder; -#endif // MAME_DEVICES_IMAGEDEV_FLOPPY_H +#endif // MAME_IMAGEDEV_FLOPPY_H diff --git a/src/devices/imagedev/harddriv.h b/src/devices/imagedev/harddriv.h index d360f06f623..852c1f3c79a 100644 --- a/src/devices/imagedev/harddriv.h +++ b/src/devices/imagedev/harddriv.h @@ -8,8 +8,8 @@ *********************************************************************/ -#ifndef MAME_DEVICES_IMAGEDEV_HARDDRIV_H -#define MAME_DEVICES_IMAGEDEV_HARDDRIV_H +#ifndef MAME_IMAGEDEV_HARDDRIV_H +#define MAME_IMAGEDEV_HARDDRIV_H #include "softlist_dev.h" @@ -111,4 +111,4 @@ class harddisk_image_device : public harddisk_image_base_device // device type definition DECLARE_DEVICE_TYPE(HARDDISK, harddisk_image_device) -#endif // MAME_DEVICES_IMAGEDEV_HARDDRIV_H +#endif // MAME_IMAGEDEV_HARDDRIV_H diff --git a/src/devices/imagedev/magtape.h b/src/devices/imagedev/magtape.h index 8d302a93a58..200c5252925 100644 --- a/src/devices/imagedev/magtape.h +++ b/src/devices/imagedev/magtape.h @@ -8,8 +8,8 @@ *********************************************************************/ -#ifndef MAME_DEVICES_IMAGEDEV_MAGTAPE_H -#define MAME_DEVICES_IMAGEDEV_MAGTAPE_H +#ifndef MAME_IMAGEDEV_MAGTAPE_H +#define MAME_IMAGEDEV_MAGTAPE_H #pragma once @@ -53,4 +53,4 @@ class microtape_image_device : public magtape_image_device virtual const char *image_brief_type_name() const noexcept override { return "utap"; } }; -#endif // MAME_DEVICES_IMAGEDEV_MAGTAPE_H +#endif // MAME_IMAGEDEV_MAGTAPE_H diff --git a/src/devices/imagedev/memcard.h b/src/devices/imagedev/memcard.h index afac414a39a..8bc41fd1425 100644 --- a/src/devices/imagedev/memcard.h +++ b/src/devices/imagedev/memcard.h @@ -8,8 +8,8 @@ *********************************************************************/ -#ifndef MAME_DEVICES_IMAGEDEV_MEMCARD_H -#define MAME_DEVICES_IMAGEDEV_MEMCARD_H +#ifndef MAME_IMAGEDEV_MEMCARD_H +#define MAME_IMAGEDEV_MEMCARD_H #pragma once @@ -36,4 +36,4 @@ class device_memcard_image_interface : public device_image_interface device_memcard_image_interface(const machine_config &mconfig, device_t &device); }; -#endif // MAME_DEVICES_IMAGEDEV_MEMCARD_H +#endif // MAME_IMAGEDEV_MEMCARD_H diff --git a/src/devices/imagedev/mfmhd.h b/src/devices/imagedev/mfmhd.h index 8bf9b057683..2d733f5a9af 100644 --- a/src/devices/imagedev/mfmhd.h +++ b/src/devices/imagedev/mfmhd.h @@ -11,8 +11,8 @@ *****************************************************************************/ -#ifndef MAME_DEVICES_IMAGEDEV_MFMHD_H -#define MAME_DEVICES_IMAGEDEV_MFMHD_H +#ifndef MAME_IMAGEDEV_MFMHD_H +#define MAME_IMAGEDEV_MFMHD_H #pragma once @@ -269,4 +269,4 @@ class mfm_harddisk_connector : public device_t, DECLARE_DEVICE_TYPE(MFM_HD_CONNECTOR, mfm_harddisk_connector) -#endif // MAME_DEVICES_IMAGEDEV_MFMHD_H +#endif // MAME_IMAGEDEV_MFMHD_H diff --git a/src/devices/imagedev/microdrv.h b/src/devices/imagedev/microdrv.h index 26aa9db97db..c4480fade69 100644 --- a/src/devices/imagedev/microdrv.h +++ b/src/devices/imagedev/microdrv.h @@ -8,8 +8,8 @@ *********************************************************************/ -#ifndef MAME_DEVICES_IMAGEDEV_MICRODRV_H -#define MAME_DEVICES_IMAGEDEV_MICRODRV_H +#ifndef MAME_IMAGEDEV_MICRODRV_H +#define MAME_IMAGEDEV_MICRODRV_H #pragma once @@ -85,4 +85,4 @@ class microdrive_image_device : public microtape_image_device // device type definition DECLARE_DEVICE_TYPE(MICRODRIVE, microdrive_image_device) -#endif // MAME_DEVICES_IMAGEDEV_MICRODRV_H +#endif // MAME_IMAGEDEV_MICRODRV_H diff --git a/src/devices/imagedev/papertape.h b/src/devices/imagedev/papertape.h index a0fa6b9cada..cb4359860c1 100644 --- a/src/devices/imagedev/papertape.h +++ b/src/devices/imagedev/papertape.h @@ -8,8 +8,8 @@ *********************************************************************/ -#ifndef MAME_DEVICES_IMAGEDEV_PAPERTAPE_H -#define MAME_DEVICES_IMAGEDEV_PAPERTAPE_H +#ifndef MAME_IMAGEDEV_PAPERTAPE_H +#define MAME_IMAGEDEV_PAPERTAPE_H #pragma once @@ -68,4 +68,4 @@ class paper_tape_punch_device : public paper_tape_image_device paper_tape_punch_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock); }; -#endif // MAME_DEVICES_IMAGEDEV_PAPERTAPE_H +#endif // MAME_IMAGEDEV_PAPERTAPE_H diff --git a/src/devices/imagedev/picture.h b/src/devices/imagedev/picture.h index 4e10f533458..4e57d01714f 100644 --- a/src/devices/imagedev/picture.h +++ b/src/devices/imagedev/picture.h @@ -8,8 +8,8 @@ *********************************************************************/ -#ifndef MAME_DEVICES_IMAGEDEV_PICTURE_H -#define MAME_DEVICES_IMAGEDEV_PICTURE_H +#ifndef MAME_IMAGEDEV_PICTURE_H +#define MAME_IMAGEDEV_PICTURE_H #pragma once @@ -55,4 +55,4 @@ class picture_image_device : public device_t, // device type definition DECLARE_DEVICE_TYPE(IMAGE_PICTURE, picture_image_device) -#endif // MAME_DEVICES_IMAGEDEV_PICTURE_H +#endif // MAME_IMAGEDEV_PICTURE_H diff --git a/src/devices/imagedev/printer.h b/src/devices/imagedev/printer.h index ae3b78fd7fa..46346a87ff4 100644 --- a/src/devices/imagedev/printer.h +++ b/src/devices/imagedev/printer.h @@ -8,8 +8,8 @@ ****************************************************************************/ -#ifndef MAME_DEVICES_IMAGEDEV_PRINTER_H -#define MAME_DEVICES_IMAGEDEV_PRINTER_H +#ifndef MAME_IMAGEDEV_PRINTER_H +#define MAME_IMAGEDEV_PRINTER_H #pragma once @@ -61,4 +61,4 @@ class printer_image_device : public device_t, // device type definition DECLARE_DEVICE_TYPE(PRINTER, printer_image_device) -#endif // MAME_DEVICES_IMAGEDEV_PRINTER_H +#endif // MAME_IMAGEDEV_PRINTER_H diff --git a/src/devices/imagedev/simh_tape_image.h b/src/devices/imagedev/simh_tape_image.h index 15607015e55..887122be593 100644 --- a/src/devices/imagedev/simh_tape_image.h +++ b/src/devices/imagedev/simh_tape_image.h @@ -1,8 +1,8 @@ // license:BSD-3-Clause // copyright-holders:Mietek Bak -#ifndef MAME_DEVICES_IMAGEDEV_SIMH_TAPE_IMAGE_H -#define MAME_DEVICES_IMAGEDEV_SIMH_TAPE_IMAGE_H +#ifndef MAME_IMAGEDEV_SIMH_TAPE_IMAGE_H +#define MAME_IMAGEDEV_SIMH_TAPE_IMAGE_H #pragma once @@ -49,4 +49,4 @@ class simh_tape_image_device : public microtape_image_device ////////////////////////////////////////////////////////////////////////////// -#endif // MAME_DEVICES_IMAGEDEV_SIMH_TAPE_IMAGE_H +#endif // MAME_IMAGEDEV_SIMH_TAPE_IMAGE_H diff --git a/src/devices/imagedev/snapquik.h b/src/devices/imagedev/snapquik.h index 32f6f7c782f..7e12778a3b0 100644 --- a/src/devices/imagedev/snapquik.h +++ b/src/devices/imagedev/snapquik.h @@ -8,8 +8,8 @@ *********************************************************************/ -#ifndef MAME_DEVICES_IMAGEDEV_SNAPQUIK_H -#define MAME_DEVICES_IMAGEDEV_SNAPQUIK_H +#ifndef MAME_IMAGEDEV_SNAPQUIK_H +#define MAME_IMAGEDEV_SNAPQUIK_H #pragma once @@ -112,4 +112,4 @@ DECLARE_DEVICE_TYPE(QUICKLOAD, quickload_image_device) #define QUICKLOAD_LOAD_MEMBER(_name) std::pair _name(snapshot_image_device &image) #define DECLARE_QUICKLOAD_LOAD_MEMBER(_name) QUICKLOAD_LOAD_MEMBER(_name) -#endif // MAME_DEVICES_IMAGEDEV_SNAPQUIK_H +#endif // MAME_IMAGEDEV_SNAPQUIK_H diff --git a/src/devices/imagedev/wafadrive.h b/src/devices/imagedev/wafadrive.h index b4de79654cb..79e20ea913b 100644 --- a/src/devices/imagedev/wafadrive.h +++ b/src/devices/imagedev/wafadrive.h @@ -9,13 +9,13 @@ *********************************************************************/ -#ifndef MAME_DEVICES_IMAGEDEV_WAFADRIVE_H -#define MAME_DEVICES_IMAGEDEV_WAFADRIVE_H - -#include "magtape.h" +#ifndef MAME_IMAGEDEV_WAFADRIVE_H +#define MAME_IMAGEDEV_WAFADRIVE_H #pragma once +#include "magtape.h" + /*************************************************************************** TYPE DEFINITIONS ***************************************************************************/ @@ -46,4 +46,4 @@ class wafadrive_image_device : public microtape_image_device // device type definition DECLARE_DEVICE_TYPE(WAFADRIVE_IMAGE, wafadrive_image_device) -#endif // MAME_DEVICES_IMAGEDEV_WAFADRIVE_H +#endif // MAME_IMAGEDEV_WAFADRIVE_H diff --git a/src/devices/machine/6821pia.h b/src/devices/machine/6821pia.h index 22d5009a745..e888e176658 100644 --- a/src/devices/machine/6821pia.h +++ b/src/devices/machine/6821pia.h @@ -16,14 +16,12 @@ **********************************************************************/ -#ifndef MAME_DEVICES_MACHINE_6821PIA_H -#define MAME_DEVICES_MACHINE_6821PIA_H +#ifndef MAME_MACHINE_6821PIA_H +#define MAME_MACHINE_6821PIA_H #pragma once - - /*************************************************************************** TYPE DEFINITIONS ***************************************************************************/ @@ -216,5 +214,4 @@ class pia6821_device : public device_t // device type definition DECLARE_DEVICE_TYPE(PIA6821, pia6821_device) - -#endif // MAME_DEVICES_MACHINE_6821PIA_H +#endif // MAME_MACHINE_6821PIA_H diff --git a/src/devices/machine/68307bus.h b/src/devices/machine/68307bus.h index e927979c034..d0ff1e244b7 100644 --- a/src/devices/machine/68307bus.h +++ b/src/devices/machine/68307bus.h @@ -1,7 +1,7 @@ // license:BSD-3-Clause // copyright-holders:David Haywood -#ifndef MAME_MACHINE_68307_BUS_H -#define MAME_MACHINE_68307_BUS_H +#ifndef MAME_MACHINE_68307BUS_H +#define MAME_MACHINE_68307BUS_H #pragma once @@ -19,4 +19,4 @@ class m68307_cpu_device::m68307_mbus void reset(); }; -#endif // MAME_MACHINE_68307_BUS_H +#endif // MAME_MACHINE_68307BUS_H diff --git a/src/devices/machine/74148.h b/src/devices/machine/74148.h index 9c5194b31f7..1a1d7c1ae6b 100644 --- a/src/devices/machine/74148.h +++ b/src/devices/machine/74148.h @@ -40,8 +40,8 @@ *****************************************************************************/ -#ifndef MAME_DEVICES_MACHINE_74148_H -#define MAME_DEVICES_MACHINE_74148_H +#ifndef MAME_MACHINE_74148_H +#define MAME_MACHINE_74148_H #pragma once diff --git a/src/devices/machine/74153.h b/src/devices/machine/74153.h index 708eb63e7c0..13dd844096d 100644 --- a/src/devices/machine/74153.h +++ b/src/devices/machine/74153.h @@ -18,8 +18,8 @@ ***************************************************************************/ -#ifndef MAME_DEVICES_MACHINE_74153_H -#define MAME_DEVICES_MACHINE_74153_H +#ifndef MAME_MACHINE_74153_H +#define MAME_MACHINE_74153_H #pragma once @@ -83,4 +83,4 @@ class ttl153_device : public device_t // device type definition DECLARE_DEVICE_TYPE(TTL153, ttl153_device) -#endif // MAME_DEVICES_MACHINE_74153_H +#endif // MAME_MACHINE_74153_H diff --git a/src/devices/machine/74165.h b/src/devices/machine/74165.h index e7d953fda9e..1f2580a899e 100644 --- a/src/devices/machine/74165.h +++ b/src/devices/machine/74165.h @@ -18,8 +18,8 @@ ***************************************************************************/ -#ifndef MAME_DEVICES_MACHINE_74165_H -#define MAME_DEVICES_MACHINE_74165_H +#ifndef MAME_MACHINE_74165_H +#define MAME_MACHINE_74165_H #pragma once @@ -70,4 +70,4 @@ class ttl165_device : public device_t // device type definition DECLARE_DEVICE_TYPE(TTL165, ttl165_device) -#endif // MAME_DEVICES_MACHINE_74165_H +#endif // MAME_MACHINE_74165_H diff --git a/src/devices/machine/74166.h b/src/devices/machine/74166.h index 80095ce5458..9a22d69bd6a 100644 --- a/src/devices/machine/74166.h +++ b/src/devices/machine/74166.h @@ -18,8 +18,8 @@ ***************************************************************************/ -#ifndef MAME_DEVICES_MACHINE_74166_H -#define MAME_DEVICES_MACHINE_74166_H +#ifndef MAME_MACHINE_74166_H +#define MAME_MACHINE_74166_H #pragma once @@ -69,4 +69,4 @@ class ttl166_device : public device_t // device type definition DECLARE_DEVICE_TYPE(TTL166, ttl166_device) -#endif // MAME_DEVICES_MACHINE_74166_H +#endif // MAME_MACHINE_74166_H diff --git a/src/devices/machine/7474.h b/src/devices/machine/7474.h index e5d1a7a1fa0..42d6c74b862 100644 --- a/src/devices/machine/7474.h +++ b/src/devices/machine/7474.h @@ -39,8 +39,8 @@ *****************************************************************************/ -#ifndef MAME_MACHINE_TTL7474_H -#define MAME_MACHINE_TTL7474_H +#ifndef MAME_MACHINE_7474_H +#define MAME_MACHINE_7474_H #pragma once @@ -102,4 +102,4 @@ class ttl7474_device : public device_t // device type definition DECLARE_DEVICE_TYPE(TTL7474, ttl7474_device) -#endif // MAME_MACHINE_TTL7474_H +#endif // MAME_MACHINE_7474_H diff --git a/src/devices/machine/adc0808.h b/src/devices/machine/adc0808.h index aeb529b697e..0d4f957399a 100644 --- a/src/devices/machine/adc0808.h +++ b/src/devices/machine/adc0808.h @@ -31,8 +31,8 @@ ***************************************************************************/ -#ifndef MAME_DEVICES_MACHINE_ADC0808_H -#define MAME_DEVICES_MACHINE_ADC0808_H +#ifndef MAME_MACHINE_ADC0808_H +#define MAME_MACHINE_ADC0808_H #pragma once @@ -110,4 +110,4 @@ DECLARE_DEVICE_TYPE(ADC0808, adc0808_device) DECLARE_DEVICE_TYPE(ADC0809, adc0809_device) DECLARE_DEVICE_TYPE(M58990, m58990_device) -#endif // MAME_DEVICES_MACHINE_ADC0808_H +#endif // MAME_MACHINE_ADC0808_H diff --git a/src/devices/machine/adc0844.h b/src/devices/machine/adc0844.h index c4735da1b6c..7dc76c173d1 100644 --- a/src/devices/machine/adc0844.h +++ b/src/devices/machine/adc0844.h @@ -20,8 +20,8 @@ ***************************************************************************/ -#ifndef MAME_DEVICES_MACHINE_ADC0844_H -#define MAME_DEVICES_MACHINE_ADC0844_H +#ifndef MAME_MACHINE_ADC0844_H +#define MAME_MACHINE_ADC0844_H #pragma once @@ -92,4 +92,4 @@ class adc0848_device : public adc0844_device DECLARE_DEVICE_TYPE(ADC0844, adc0844_device) DECLARE_DEVICE_TYPE(ADC0848, adc0848_device) -#endif // MAME_DEVICES_MACHINE_ADC0844_H +#endif // MAME_MACHINE_ADC0844_H diff --git a/src/devices/machine/am2910.h b/src/devices/machine/am2910.h index bd0dff03f36..d4ddd435729 100644 --- a/src/devices/machine/am2910.h +++ b/src/devices/machine/am2910.h @@ -7,8 +7,8 @@ ***************************************************************************/ -#ifndef MAME_MACHINE_AM2910_AM2910_H -#define MAME_MACHINE_AM2910_AM2910_H +#ifndef MAME_MACHINE_AM2910_H +#define MAME_MACHINE_AM2910_H #pragma once @@ -79,4 +79,4 @@ class am2910_device : public device_t // device type definition DECLARE_DEVICE_TYPE(AM2910, am2910_device) -#endif // MAME_MACHINE_AM2910_AM2910_H +#endif // MAME_MACHINE_AM2910_H diff --git a/src/devices/machine/am9517a.h b/src/devices/machine/am9517a.h index 68490ef0c6c..af8361892b6 100644 --- a/src/devices/machine/am9517a.h +++ b/src/devices/machine/am9517a.h @@ -29,8 +29,8 @@ ***************************************************************************/ -#ifndef MAME_MACHINE_AM9517_H -#define MAME_MACHINE_AM9517_H +#ifndef MAME_MACHINE_AM9517A_H +#define MAME_MACHINE_AM9517A_H #pragma once @@ -244,4 +244,4 @@ DECLARE_DEVICE_TYPE(V5X_DMAU, v5x_dmau_device) DECLARE_DEVICE_TYPE(PCXPORT_DMAC, pcxport_dmac_device) DECLARE_DEVICE_TYPE(EISA_DMA, eisa_dma_device) -#endif // MAME_MACHINE_AM9517_H +#endif // MAME_MACHINE_AM9517A_H diff --git a/src/devices/machine/applepic.h b/src/devices/machine/applepic.h index 2ed67e4dbd0..b4c7629713c 100644 --- a/src/devices/machine/applepic.h +++ b/src/devices/machine/applepic.h @@ -1,8 +1,8 @@ // license:BSD-3-Clause // copyright-holders:AJR -#ifndef MAME_DEVICES_MACHINE_APPLEPIC_H -#define MAME_DEVICES_MACHINE_APPLEPIC_H +#ifndef MAME_MACHINE_APPLEPIC_H +#define MAME_MACHINE_APPLEPIC_H #pragma once @@ -107,4 +107,4 @@ class applepic_device : public device_t // device type declaration DECLARE_DEVICE_TYPE(APPLEPIC, applepic_device) -#endif // MAME_DEVICES_MACHINE_APPLEPIC_H +#endif // MAME_MACHINE_APPLEPIC_H diff --git a/src/devices/machine/bankdev.h b/src/devices/machine/bankdev.h index eb9220dfe70..e84899115c0 100644 --- a/src/devices/machine/bankdev.h +++ b/src/devices/machine/bankdev.h @@ -1,7 +1,7 @@ // license:BSD-3-Clause // copyright-holders:smf -#ifndef MAME_DEVICES_MACHINE_BANKDEV_H -#define MAME_DEVICES_MACHINE_BANKDEV_H +#ifndef MAME_MACHINE_BANKDEV_H +#define MAME_MACHINE_BANKDEV_H #pragma once @@ -77,4 +77,4 @@ class address_map_bank_device : // device type definition DECLARE_DEVICE_TYPE(ADDRESS_MAP_BANK, address_map_bank_device) -#endif // MAME_DEVICES_MACHINE_BANKDEV_H +#endif // MAME_MACHINE_BANKDEV_H diff --git a/src/devices/machine/bcreader.h b/src/devices/machine/bcreader.h index e527f5db238..bb96c3b9521 100644 --- a/src/devices/machine/bcreader.h +++ b/src/devices/machine/bcreader.h @@ -8,8 +8,8 @@ *********************************************************************/ -#ifndef MAME_DEVICES_MACHINE_BCREADER_H -#define MAME_DEVICES_MACHINE_BCREADER_H +#ifndef MAME_MACHINE_BCREADER_H +#define MAME_MACHINE_BCREADER_H #pragma once @@ -49,4 +49,4 @@ DECLARE_DEVICE_TYPE(BARCODE_READER, barcode_reader_device) // device type iterator typedef device_type_enumerator barcode_reader_device_enumerator; -#endif // MAME_DEVICES_MACHINE_BCREADER_H +#endif // MAME_MACHINE_BCREADER_H diff --git a/src/devices/machine/buffer.h b/src/devices/machine/buffer.h index d1ce83327c1..d1f9684665f 100644 --- a/src/devices/machine/buffer.h +++ b/src/devices/machine/buffer.h @@ -1,7 +1,9 @@ // license:BSD-3-Clause // copyright-holders:smf -#ifndef MAME_DEVICES_MACHINE_BUFFER_H -#define MAME_DEVICES_MACHINE_BUFFER_H +#ifndef MAME_MACHINE_BUFFER_H +#define MAME_MACHINE_BUFFER_H + +#pragma once class input_buffer_device : public device_t { @@ -27,4 +29,4 @@ class input_buffer_device : public device_t DECLARE_DEVICE_TYPE(INPUT_BUFFER, input_buffer_device) -#endif // MAME_DEVICES_MACHINE_BUFFER_H +#endif // MAME_MACHINE_BUFFER_H diff --git a/src/devices/machine/dp8573a.h b/src/devices/machine/dp8573a.h index a0fc749d1f2..8bf564bab66 100644 --- a/src/devices/machine/dp8573a.h +++ b/src/devices/machine/dp8573a.h @@ -1,8 +1,8 @@ // license:BSD-3-Clause // copyright-holders:Ryan Holtz -#ifndef DEVICES_MACHINE_DP8573_H -#define DEVICES_MACHINE_DP8573_H +#ifndef MAME_MACHINE_DP8573A_H +#define MAME_MACHINE_DP8573A_H #pragma once @@ -70,4 +70,4 @@ class dp8572a_device : public dp8573a_device DECLARE_DEVICE_TYPE(DP8572A, dp8572a_device) DECLARE_DEVICE_TYPE(DP8573A, dp8573a_device) -#endif // DEVICES_MACHINE_DP8573_H +#endif // MAME_MACHINE_DP8573A_H diff --git a/src/devices/machine/gt913_snd.h b/src/devices/machine/gt913_snd.h index de5060a16e1..790eca81196 100644 --- a/src/devices/machine/gt913_snd.h +++ b/src/devices/machine/gt913_snd.h @@ -4,8 +4,8 @@ Casio GT913 sound (HLE) ***************************************************************************/ -#ifndef MAME_AUDIO_GT913_H -#define MAME_AUDIO_GT913_H +#ifndef MAME_MACHINE_GT913_SND_H +#define MAME_MACHINE_GT913_SND_H #pragma once @@ -85,4 +85,4 @@ class gt913_sound_device : public device_t, // device type definition DECLARE_DEVICE_TYPE(GT913_SOUND, gt913_sound_device) -#endif // MAME_AUDIO_GT913_H +#endif // MAME_MACHINE_GT913_SND_H diff --git a/src/devices/machine/i8087.h b/src/devices/machine/i8087.h index 9f8e17b613a..8a7fac194a0 100644 --- a/src/devices/machine/i8087.h +++ b/src/devices/machine/i8087.h @@ -1,5 +1,9 @@ // license:BSD-3-Clause // copyright-holders:Philip Bennett, Carl +#ifndef MAME_MACHINE_I8087_H +#define MAME_MACHINE_I8087_H + +#pragma once // SoftFloat 2 lacks an include guard #ifndef softfloat2_h @@ -223,3 +227,5 @@ class i8087_device : public device_t void build_opcode_table(); }; + +#endif // MAME_MACHINE_I8087_H diff --git a/src/devices/machine/intelfsh.cpp b/src/devices/machine/intelfsh.cpp index a8bb66b4046..3bbc7925cc0 100644 --- a/src/devices/machine/intelfsh.cpp +++ b/src/devices/machine/intelfsh.cpp @@ -114,6 +114,7 @@ DEFINE_DEVICE_TYPE(TMS_29F040, tms_29f040_device, "t DEFINE_DEVICE_TYPE(PANASONIC_MN63F805MNP, panasonic_mn63f805mnp_device, "panasonic_mn63f805mnp", "Panasonic MN63F805MNP Flash") DEFINE_DEVICE_TYPE(SANYO_LE26FV10N1TS, sanyo_le26fv10n1ts_device, "sanyo_le26fv10n1ts", "Sanyo LE26FV10N1TS Flash") DEFINE_DEVICE_TYPE(SST_28SF040, sst_28sf040_device, "sst_28sf040", "SST 28SF040 Flash") +DEFINE_DEVICE_TYPE(SST_39SF010, sst_39sf010_device, "sst_39sf010", "SST 39SF010 Flash") DEFINE_DEVICE_TYPE(SST_39SF040, sst_39sf040_device, "sst_39sf040", "SST 39SF040 Flash") DEFINE_DEVICE_TYPE(SST_39VF020, sst_39vf020_device, "sst_39vf020", "SST 39VF020 Flash") DEFINE_DEVICE_TYPE(SST_49LF020, sst_49lf020_device, "sst_49lf020", "SST 49LF020 Flash") @@ -271,6 +272,9 @@ sanyo_le26fv10n1ts_device::sanyo_le26fv10n1ts_device(const machine_config &mconf sst_28sf040_device::sst_28sf040_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : intelfsh8_device(mconfig, SST_28SF040, tag, owner, clock, 0x80000, MFG_SST, 0x04) { } +sst_39sf010_device::sst_39sf010_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : intelfsh8_device(mconfig, SST_39SF010, tag, owner, clock, 0x20000, MFG_SST, 0xb5) { m_addrmask = 0x7fff; } + sst_39sf040_device::sst_39sf040_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : intelfsh8_device(mconfig, SST_39SF040, tag, owner, clock, 0x80000, MFG_SST, 0xb7) { m_addrmask = 0x7fff; } @@ -798,6 +802,10 @@ void intelfsh_device::write_full(uint32_t address, uint32_t data) { m_flash_mode = FM_ERASEAMD3; } + else if( ( address & m_addrmask ) == 0x2aaa && ( data & 0xff ) == 0x55 && m_addrmask ) + { + m_flash_mode = FM_ERASEAMD3; + } else { logerror( "unexpected %08x=%02x in FM_ERASEAMD2\n", address, data & 0xff ); diff --git a/src/devices/machine/intelfsh.h b/src/devices/machine/intelfsh.h index 208c292e640..5db03effe96 100644 --- a/src/devices/machine/intelfsh.h +++ b/src/devices/machine/intelfsh.h @@ -247,6 +247,12 @@ class sst_28sf040_device : public intelfsh8_device sst_28sf040_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0); }; +class sst_39sf010_device : public intelfsh8_device +{ +public: + sst_39sf010_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0); +}; + class sst_39sf040_device : public intelfsh8_device { public: @@ -418,6 +424,7 @@ DECLARE_DEVICE_TYPE(TMS_29F040, tms_29f040_device) DECLARE_DEVICE_TYPE(PANASONIC_MN63F805MNP, panasonic_mn63f805mnp_device) DECLARE_DEVICE_TYPE(SANYO_LE26FV10N1TS, sanyo_le26fv10n1ts_device) DECLARE_DEVICE_TYPE(SST_28SF040, sst_28sf040_device) +DECLARE_DEVICE_TYPE(SST_39SF010, sst_39sf010_device) DECLARE_DEVICE_TYPE(SST_39SF040, sst_39sf040_device) DECLARE_DEVICE_TYPE(SST_39VF020, sst_39vf020_device) DECLARE_DEVICE_TYPE(SST_49LF020, sst_49lf020_device) diff --git a/src/devices/machine/ldp1450hle.h b/src/devices/machine/ldp1450hle.h index 06ccd9b5415..22f71ce6a54 100644 --- a/src/devices/machine/ldp1450hle.h +++ b/src/devices/machine/ldp1450hle.h @@ -7,8 +7,8 @@ *************************************************************************/ -#ifndef MAME_MACHINE_LDP1450_H -#define MAME_MACHINE_LDP1450_H +#ifndef MAME_MACHINE_LDP1450HLE_H +#define MAME_MACHINE_LDP1450HLE_H #pragma once @@ -195,4 +195,4 @@ class sony_ldp1450hle_device : public laserdisc_device, public device_serial_int }; -#endif // MAME_MACHINE_LDP1450_H +#endif // MAME_MACHINE_LDP1450HLE_H diff --git a/src/devices/machine/ldv4200hle.h b/src/devices/machine/ldv4200hle.h index e7826a20ec9..8c40db7c04e 100644 --- a/src/devices/machine/ldv4200hle.h +++ b/src/devices/machine/ldv4200hle.h @@ -4,12 +4,12 @@ ldv4200hle.h - Pioneer LD-V4200 laserdisc player simulation. + Pioneer LD-V4200 LaserDisc player simulation. *************************************************************************/ -#ifndef MAME_MACHINE_LDV4200_H -#define MAME_MACHINE_LDV4200_H +#ifndef MAME_MACHINE_LDV4200HLE_H +#define MAME_MACHINE_LDV4200HLE_H #pragma once @@ -209,4 +209,4 @@ class pioneer_ldv4200hle_device : public laserdisc_device, public device_serial_ uint32_t m_curr_frame; }; -#endif // MAME_MACHINE_LDV4200_H +#endif // MAME_MACHINE_LDV4200HLE_H diff --git a/src/devices/machine/locomo.h b/src/devices/machine/locomo.h index 52f7ad69355..ae26826d88d 100644 --- a/src/devices/machine/locomo.h +++ b/src/devices/machine/locomo.h @@ -6,8 +6,8 @@ ***************************************************************************/ -#ifndef MAME_MACHINE_LOCOMO -#define MAME_MACHINE_LOCOMO +#ifndef MAME_MACHINE_LOCOMO_H +#define MAME_MACHINE_LOCOMO_H #pragma once @@ -31,4 +31,4 @@ class locomo_device : public device_t DECLARE_DEVICE_TYPE(LOCOMO, locomo_device) -#endif // MAME_MACHINE_LOCOMO +#endif // MAME_MACHINE_LOCOMO_H diff --git a/src/devices/machine/mediagx_cs5530_video.h b/src/devices/machine/mediagx_cs5530_video.h index 3efaf975a4c..4d0ce803b9c 100644 --- a/src/devices/machine/mediagx_cs5530_video.h +++ b/src/devices/machine/mediagx_cs5530_video.h @@ -1,8 +1,8 @@ // license: BSD-3-Clause // copyright-holders: Angelo Salese -#ifndef MAME_MACHINE_SIS630_VGA_H -#define MAME_MACHINE_SIS630_VGA_H +#ifndef MAME_MACHINE_MEDIAGX_CS5530_VIDEO_H +#define MAME_MACHINE_MEDIAGX_CS5530_VIDEO_H #pragma once @@ -26,4 +26,4 @@ class mediagx_cs5530_video_device : public pci_device DECLARE_DEVICE_TYPE(MEDIAGX_CS5530_VIDEO, mediagx_cs5530_video_device) -#endif +#endif // MAME_MACHINE_MEDIAGX_CS5530_VIDEO_H diff --git a/src/devices/machine/mv_sonora.h b/src/devices/machine/mv_sonora.h index 1b9c2945a80..96c3c89eeed 100644 --- a/src/devices/machine/mv_sonora.h +++ b/src/devices/machine/mv_sonora.h @@ -6,8 +6,8 @@ Supports 5 different modelines at up to 16bpp *********************************************************************/ -#ifndef MAME_MACHINE_MAC_VIDEO_SONORA_H -#define MAME_MACHINE_MAC_VIDEO_SONORA_H +#ifndef MAME_MACHINE_MV_SONORA_H +#define MAME_MACHINE_MV_SONORA_H #pragma once @@ -73,4 +73,4 @@ class mac_video_sonora_device : public device_t DECLARE_DEVICE_TYPE(MAC_VIDEO_SONORA, mac_video_sonora_device) -#endif /* MAME_MACHINE_MAC_VIDEO_SONORA_H */ +#endif // MAME_MACHINE_MV_SONORA_H diff --git a/src/devices/machine/nscsi_bus.cpp b/src/devices/machine/nscsi_bus.cpp index 1f95b670c44..f9b73ec5540 100644 --- a/src/devices/machine/nscsi_bus.cpp +++ b/src/devices/machine/nscsi_bus.cpp @@ -14,8 +14,8 @@ #define LOG_DATA (1U << 4) #define LOG_DATA_SENT (1U << 5) -//#define VERBOSE (LOG_GENERAL | LOG_STATE | LOG_CONTROL | LOG_DATA) #define VERBOSE (LOG_UNSUPPORTED) +#define LOG_OUTPUT_FUNC osd_printf_info #include "logmacro.h" @@ -217,13 +217,13 @@ const char *const nscsi_full_device::command_names[256] = { /* 50 */ "XDWRITE", "READ_DISC_INFORMATION/XPWRITE", "READ_TRACK_INFORMATION/XDREAD", "RESERVE_TRACK", "SEND_OPC_INFORMATION", "MODE_SELECT_10", "RESERVE_10", "RELEASE_10", /* 58 */ "REPAIR_TRACK", "READ_MASTER_CUE", "MODE_SENSE_10", "CLOSE_TRACK_SESSION", "READ_BUFFER_CAPACITY", "SEND_CUE_SHEET", "PERSISTENT_RESERVE_IN", "PERSISTENT_RESERVE_OUT", /* 80 */ "XDWRITE_EXTENDED", "REBUILD", "REGENERATE", "EXTENDED_COPY", "RECEIVE_COPY_RESULTS", "?", "?", "?", - /* 88 */ "?", "?", "?", "?", "?", "?", "?", "?", - /* 90 */ "?", "?", "?", "?", "?", "?", "?", "?", - /* 98 */ "?", "?", "?", "?", "?", "?", "?", "?", + /* 88 */ "?", "?", "WRITE_16", "?", "?", "?", "?", "?", + /* 90 */ "?", "SYNCHRONIZE_CACHE_16", "?", "WRITE_SAME_16", "?", "?", "?", "?", + /* 98 */ "?", "?", "?", "?", "?", "?", "READ_CAPACITY_166/READ_LONG_16", "WRITE_LONG_16", /* a0 */ "REPORT_LUNS", "BLANK", "SEND_EVENT", "REPORT_DEVICE_IDENTIFIER/SEND_KEY", "SET_DEVICE_IDENTIFIER/REPORT_KEY", "PLAY_AUDIO_12", "LOAD_UNLOAD_MEDIUM", "MOVE_MEDIUM_ATTACHED/SET_READ_AHEAD", /* a8 */ "READ_12", "PLAY_RELATIVE_12", "WRITE_12", "?", "ERASE_12/GET_PERFORMANCE", "READ_DVD_STRUCTURE", "WRITE_AND_VERIFY_12", "VERIFY_12", /* b0 */ "SEARCH_DATA_HIGH_12", "SEARCH_DATA_EQUAL_12", "SEARCH_DATA_LOW_12", "SET_LIMITS_12", "READ_ELEMENT_STATUS_ATTACHED", "?", "SET_STREAMING", "READ_DEFECT_DATA_12", - /* b8 */ "?", "READ_CD_MSF", "SCAN_MMC", "SET_CD_SPEED", "PLAY_CD", "MECHANISM_STATUS", "READ_CD", "SEND_DVD_STRUCTURE", + /* b8 */ "?", "READ_CD_MSF", "SCAN_MMC", "SET_CD_SPEED", "PLAY_CD/SPARE_IN", "MECHANISM_STATUS/SPARE_OUT", "READ_CD", "SEND_DVD_STRUCTURE", /* c0 */ "?", "?", "?", "?", "?", "?", "?", "?", /* c8 */ "?", "?", "?", "?", "?", "?", "?", "?", /* d0 */ "?", "?", "?", "?", "?", "?", "?", "?", @@ -532,7 +532,7 @@ void nscsi_full_device::scsi_put_data(int id, int pos, uint8_t data) scsi_sense_buffer[pos] = data; break; default: - fatalerror("nscsi_full_device::scsi_put_data - unknown id\n"); + fatalerror("nscsi_full_device::scsi_put_data - unknown id %d\n", id); } } @@ -553,7 +553,9 @@ bool nscsi_full_device::scsi_command_done(uint8_t command, uint8_t length) case 4: return true; case 5: return length == 12; case 6: return true; - case 7: return true; + case 7: return length == 32; + case 8: return length == 16; + case 9: return length == 16; } return true; } diff --git a/src/devices/machine/nscsi_bus.h b/src/devices/machine/nscsi_bus.h index 9eaa4c4c5d9..764832ae840 100644 --- a/src/devices/machine/nscsi_bus.h +++ b/src/devices/machine/nscsi_bus.h @@ -603,6 +603,12 @@ class nscsi_full_device : public nscsi_device, public nscsi_slot_card_interface SC_REGENERATE = 0x82, SC_EXTENDED_COPY = 0x83, SC_RECEIVE_COPY_RESULTS = 0x84, + SC_WRITE_16 = 0x8a, + SC_SYNCHRONIZE_CACHE_16 = 0x91, + SC_WRITE_SAME_16 = 0x93, + SC_READ_CAPACITY_16 = 0x9e, + SC_READ_LONG_16 = 0x9e, + SC_WRITE_LONG_16 = 0x9f, SC_REPORT_LUNS = 0xa0, SC_BLANK = 0xa1, SC_SEND_EVENT = 0xa2, @@ -633,7 +639,9 @@ class nscsi_full_device : public nscsi_device, public nscsi_slot_card_interface SC_SCAN_MMC = 0xba, SC_SET_CD_SPEED = 0xbb, SC_PLAY_CD = 0xbc, + SC_SPARE_IN = 0xbc, SC_MECHANISM_STATUS = 0xbd, + SC_SPARE_OUT = 0xbd, SC_READ_CD = 0xbe, SC_SEND_DVD_STRUCTURE = 0xbf }; diff --git a/src/devices/machine/pc97338.h b/src/devices/machine/pc97338.h index e7d5a45387d..f40ddf8d5a3 100644 --- a/src/devices/machine/pc97338.h +++ b/src/devices/machine/pc97338.h @@ -1,8 +1,8 @@ // license:BSD-3-Clause // copyright-holders: Angelo Salese -#ifndef MAME_MACHINE_PC97336_H -#define MAME_MACHINE_PC97336_H +#ifndef MAME_MACHINE_PC97338_H +#define MAME_MACHINE_PC97338_H #pragma once @@ -121,4 +121,4 @@ class pc97338_device : public device_t, DECLARE_DEVICE_TYPE(PC97338, pc97338_device); -#endif // MAME_MACHINE_PC97336_H +#endif // MAME_MACHINE_PC97338_H diff --git a/src/devices/machine/psion_asic3.cpp b/src/devices/machine/psion_asic3.cpp index d7e71866f72..409c5246acd 100644 --- a/src/devices/machine/psion_asic3.cpp +++ b/src/devices/machine/psion_asic3.cpp @@ -9,7 +9,6 @@ TODO: - Battery status readings, maybe different analogue channel. - - Resolve ambiguity about status register, S3 and MC/HC machines expect different data. ******************************************************************************/ @@ -176,7 +175,7 @@ uint8_t psion_psu_asic5_device::data_r() case 0x0d: // A3Status // b0 ColdStart // b1 PowerFail - data = 0x00; // ColdStart + data = 0x02; // PowerFail (required to initialise MC400/200/Word) LOG("%s data_r: A3Status register %02x\n", machine().describe_context(), data); break; @@ -287,7 +286,7 @@ uint8_t psion_psu_asic3_device::data_r() data = 0x07; break; } - data |= 0x40; // ColdStart + data |= 0x40; // PowerFail (required to initialise MC600) LOG("%s data_r: PS34R_STATUS %02x\n", machine().describe_context(), data); break; diff --git a/src/devices/machine/pxa255.h b/src/devices/machine/pxa255.h index e12c6d8683f..9acd9dac987 100644 --- a/src/devices/machine/pxa255.h +++ b/src/devices/machine/pxa255.h @@ -9,8 +9,8 @@ * **************************************************************************/ -#ifndef MAME_MACHINE_PXA255 -#define MAME_MACHINE_PXA255 +#ifndef MAME_MACHINE_PXA255_H +#define MAME_MACHINE_PXA255_H #pragma once @@ -478,4 +478,4 @@ class pxa255_periphs_device : public device_t DECLARE_DEVICE_TYPE(PXA255_PERIPHERALS, pxa255_periphs_device) -#endif // MAME_MACHINE_PXA255 +#endif // MAME_MACHINE_PXA255_H diff --git a/src/devices/machine/s2636.cpp b/src/devices/machine/s2636.cpp index 59c80a09abf..10a5a2e2be8 100644 --- a/src/devices/machine/s2636.cpp +++ b/src/devices/machine/s2636.cpp @@ -228,17 +228,6 @@ bitmap_ind16 const &s2636_device::update(const rectangle &cliprect) } -//------------------------------------------------- -// render the first line into the bitmap -//------------------------------------------------- - -void s2636_device::render_first_line() -{ - m_screen_line = 0; - render_next_line(); -} - - //------------------------------------------------- // render next line into the bitmap //------------------------------------------------- @@ -249,7 +238,7 @@ void s2636_device::render_next_line() // pre-clear the line for convenience rectangle const &vis_area = screen().visible_area(); - uint16_t *const row = &m_bitmap.pix(m_screen_line); + uint16_t *const row = &m_bitmap.pix(m_screen_line); m_bitmap.plot_box(0, m_screen_line, m_bitmap.width(), 1, 0); if ((vis_area.min_y > m_screen_line) || (vis_area.max_y < m_screen_line)) @@ -300,8 +289,8 @@ void s2636_device::render_next_line() m_obj_cnt[i] -= obj_inc; // fetch appropriate line from object - uint8_t const obj_bits = m_registers[OFFS_OBJ[i] + OBJ_HEIGHT - 1 - (m_obj_cnt[i] >> 3)]; - uint16_t const obj_clr = object_color(i) | 0x08 | (0x10 << i); + uint8_t const obj_bits = m_registers[OFFS_OBJ[i] + OBJ_HEIGHT - 1 - (m_obj_cnt[i] >> 3)]; + uint16_t const obj_clr = object_color(i) | 0x08 | (0x10 << i); // blit it to the line ignoring intermediate pixels int const obj_h_cnt = m_registers[OFFS_OBJ[i] + (m_obj_dup[i] ? OFFS_HCB : OFFS_HC)] + m_x_offset; @@ -331,15 +320,15 @@ void s2636_device::render_next_line() } // let's take a look at the score display - uint16_t const bg_clr = m_registers[REG_BG_ENB_CLR] & 0x07; - int const score_row = m_vis_line - m_y_offset - SCORE_START_Y[m_registers[REG_SCORE_FMT] & 0x01]; + uint16_t const bg_clr = m_registers[REG_BG_ENB_CLR] & 0x07; + int const score_row = m_vis_line - m_y_offset - SCORE_START_Y[m_registers[REG_SCORE_FMT] & 0x01]; if ((0 <= score_row) && (SCORE_HEIGHT > score_row)) { int const (&score_start_x)[SCORE_DIGITS] = SCORE_START_X[(m_registers[REG_SCORE_FMT] >> 1) & 0x01]; for (int i = 0; i < SCORE_DIGITS; i++) { - uint16_t score_bits = SCORE_FONT[score_digit(i)][score_row >> 2]; - int screen_col = vis_area.min_x + ((score_start_x[i] + m_x_offset) * m_divider); + uint16_t score_bits = SCORE_FONT[score_digit(i)][score_row >> 2]; + int screen_col = vis_area.min_x + ((score_start_x[i] + m_x_offset) * m_divider); while (score_bits && (vis_area.max_x >= screen_col)) { if (score_bits & 0x0001) row[screen_col] |= bg_clr | 0x08; @@ -350,16 +339,16 @@ void s2636_device::render_next_line() } // work out how the background pattern will be drawn - bool const bg_enable = bool(m_registers[REG_BG_ENB_CLR] & 0x08); - int const bg_row = m_vis_line - m_y_offset - BG_START_Y; - bool const bg_draw = bg_enable && (0 <= bg_row) && (BG_HEIGHT > bg_row); - int const bg_vbar_offs = OFFS_VBAR_DEF + ((bg_row / 20) << 2) + (((bg_row % 20) >= 2) ? 2 : 0); - int const bg_hbar_offs = OFFS_HBAR_DEF + (bg_row / 40); - uint16_t const bg_vbar_bits = (uint16_t(m_registers[bg_vbar_offs]) << 8) | uint16_t(m_registers[bg_vbar_offs + 1]); - uint8_t const bg_hbar_bits = m_registers[bg_hbar_offs]; - bool const bg_hbar_stretch = bool(bg_hbar_bits & (1 << ((((bg_row % 40) >= 20) ? 3 : 0) + (((bg_row % 20) >= 11) ? 2 : ((bg_row % 20) >= 2) ? 1 : 0)))); - int const bg_hbar_width = bg_hbar_stretch ? 8 : (0xc0 == (bg_hbar_bits & 0xc0)) ? 4 : (0x40 == (bg_hbar_bits & 0xc0)) ? 2 : 1; - uint16_t const scrn_clr = bg_enable ? ((m_registers[REG_BG_ENB_CLR] >> 4) & 0x07) : 0x00; + bool const bg_enable = bool(m_registers[REG_BG_ENB_CLR] & 0x08); + int const bg_row = m_vis_line - m_y_offset - BG_START_Y; + bool const bg_draw = bg_enable && (0 <= bg_row) && (BG_HEIGHT > bg_row); + int const bg_vbar_offs = OFFS_VBAR_DEF + ((bg_row / 20) << 2) + (((bg_row % 20) >= 2) ? 2 : 0); + int const bg_hbar_offs = OFFS_HBAR_DEF + (bg_row / 40); + uint16_t const bg_vbar_bits = (uint16_t(m_registers[bg_vbar_offs]) << 8) | uint16_t(m_registers[bg_vbar_offs + 1]); + uint8_t const bg_hbar_bits = m_registers[bg_hbar_offs]; + bool const bg_hbar_stretch = bool(bg_hbar_bits & (1 << ((((bg_row % 40) >= 20) ? 3 : 0) + (((bg_row % 20) >= 11) ? 2 : ((bg_row % 20) >= 2) ? 1 : 0)))); + int const bg_hbar_width = bg_hbar_stretch ? 8 : (0xc0 == (bg_hbar_bits & 0xc0)) ? 4 : (0x40 == (bg_hbar_bits & 0xc0)) ? 2 : 1; + uint16_t const scrn_clr = bg_enable ? ((m_registers[REG_BG_ENB_CLR] >> 4) & 0x07) : 0x00; for (int screen_col = vis_area.min_x, x = 0; vis_area.max_x >= screen_col; x++) { @@ -372,8 +361,8 @@ void s2636_device::render_next_line() if ((row[screen_col] & 0x40) && (row[screen_col] & 0x80)) m_registers[REG_VBL_COL_OBJ] |= 0x01; // work out if the background hits this pixel - int const bg_col = x - m_x_offset - BG_START_X; - bool const bg = bool(bg_vbar_bits & (1U << (15 - (bg_col >> 3)))); + int const bg_col = x - m_x_offset - BG_START_X; + bool const bg = bool(bg_vbar_bits & (1U << (15 - (bg_col >> 3)))); if (bg_draw && (0 <= bg_col) && (BG_WIDTH > bg_col) && bg && (bg_hbar_width > (bg_col & 0x07))) { // do object-background collisions @@ -452,7 +441,6 @@ void s2636_device::write_intack(int state) // sound_stream_update - generate audio output //------------------------------------------------- - void s2636_device::sound_stream_update(sound_stream &stream, std::vector const &inputs, std::vector &outputs) { auto &buffer = outputs[0]; diff --git a/src/devices/machine/s2636.h b/src/devices/machine/s2636.h index 7923c30cd51..25c3d89f761 100644 --- a/src/devices/machine/s2636.h +++ b/src/devices/machine/s2636.h @@ -41,12 +41,13 @@ class s2636_device : public device_t, // D3 indicates how the S2636 drew this pixel - 0 = background, 1 = object/score bitmap_ind16 const &bitmap() const { return m_bitmap; } - // this function is for backwards compatibility and will eventually be removed - // use the functions below for per-scanline drawing/collisions + // This function is for backwards compatibility and will eventually be removed. + // Please note that it is not compatible with partial updates, use the functions + // below for per-scanline drawing/collisions. bitmap_ind16 const &update(const rectangle &cliprect); - // call render_first_line to render the first line of the display and render_next_line for each additional line - void render_first_line(); + // render_next_line will draw one line at a time, call start_new_frame at line 0 + void start_new_frame() { m_screen_line = 0; } void render_next_line(); uint8_t read_data(offs_t offset); @@ -126,7 +127,7 @@ class s2636_device : public device_t, bitmap_ind16 m_bitmap; // 256-byte register file (not all of this really exists) - uint8_t m_registers[0x100]; + uint8_t m_registers[0x100]; // tracking where we're up to in the screen update bool m_vrst; diff --git a/src/devices/machine/sa1110.h b/src/devices/machine/sa1110.h index 892107878f3..42c8131e442 100644 --- a/src/devices/machine/sa1110.h +++ b/src/devices/machine/sa1110.h @@ -6,8 +6,8 @@ ***************************************************************************/ -#ifndef MAME_MACHINE_SA1110 -#define MAME_MACHINE_SA1110 +#ifndef MAME_MACHINE_SA1110_H +#define MAME_MACHINE_SA1110_H #pragma once @@ -905,4 +905,4 @@ class sa1110_periphs_device : public device_t, public device_serial_interface DECLARE_DEVICE_TYPE(SA1110_PERIPHERALS, sa1110_periphs_device) -#endif // MAME_MACHINE_SA1110 +#endif // MAME_MACHINE_SA1110_H diff --git a/src/devices/machine/sa1111.h b/src/devices/machine/sa1111.h index 9c09d47ec4e..b44562e499c 100644 --- a/src/devices/machine/sa1111.h +++ b/src/devices/machine/sa1111.h @@ -6,8 +6,8 @@ ***************************************************************************/ -#ifndef MAME_MACHINE_SA1111 -#define MAME_MACHINE_SA1111 +#ifndef MAME_MACHINE_SA1111_H +#define MAME_MACHINE_SA1111_H #pragma once @@ -685,4 +685,4 @@ class sa1111_device : public device_t DECLARE_DEVICE_TYPE(SA1111, sa1111_device) -#endif // MAME_MACHINE_SA1111 +#endif // MAME_MACHINE_SA1111_H diff --git a/src/devices/machine/scc66470.h b/src/devices/machine/scc66470.h index f5eeaf63215..c66bee84850 100644 --- a/src/devices/machine/scc66470.h +++ b/src/devices/machine/scc66470.h @@ -6,8 +6,8 @@ ***************************************************************************/ -#ifndef MAME_VIDEO_SCC66470_H -#define MAME_VIDEO_SCC66470_H +#ifndef MAME_MACHINE_SCC66470_H +#define MAME_MACHINE_SCC66470_H #pragma once @@ -112,4 +112,4 @@ class scc66470_device : public device_t, public device_memory_interface, public // device type definition DECLARE_DEVICE_TYPE(SCC66470, scc66470_device) -#endif // MAME_VIDEO_SCC66470_H +#endif // MAME_MACHINE_SCC66470_H diff --git a/src/devices/machine/sci4.h b/src/devices/machine/sci4.h index 21452de5aee..bbffd9a239a 100644 --- a/src/devices/machine/sci4.h +++ b/src/devices/machine/sci4.h @@ -3,8 +3,8 @@ // Yamaha SCI4 / XV833A00, 7-lines serial chip with 4 multiplexed on one and the other 3 separated -#ifndef DEVICES_MACHINE_SCI4_H -#define DEVICES_MACHINE_SCI4_H +#ifndef MAME_MACHINE_SCI4_H +#define MAME_MACHINE_SCI4_H #pragma once @@ -71,4 +71,4 @@ class sci4_device : public device_t DECLARE_DEVICE_TYPE(SCI4, sci4_device) -#endif +#endif // MAME_MACHINE_SCI4_H diff --git a/src/devices/machine/scoop.h b/src/devices/machine/scoop.h index 818b31a702b..40bdf966060 100644 --- a/src/devices/machine/scoop.h +++ b/src/devices/machine/scoop.h @@ -6,8 +6,8 @@ ***************************************************************************/ -#ifndef MAME_MACHINE_SCOOP -#define MAME_MACHINE_SCOOP +#ifndef MAME_MACHINE_SCOOP_H +#define MAME_MACHINE_SCOOP_H #pragma once @@ -39,4 +39,4 @@ class scoop_device : public device_t DECLARE_DEVICE_TYPE(SCOOP, scoop_device) -#endif // MAME_MACHINE_SCOOP +#endif // MAME_MACHINE_SCOOP_H diff --git a/src/devices/machine/segacrpt_device.h b/src/devices/machine/segacrpt_device.h index 559bee34655..59d1d62599b 100644 --- a/src/devices/machine/segacrpt_device.h +++ b/src/devices/machine/segacrpt_device.h @@ -1,8 +1,8 @@ // license:BSD-3-Clause // copyright-holders:David Haywood -#ifndef MAME_MACHINE_SEGACRYPT_DEVICE_H -#define MAME_MACHINE_SEGACRYPT_DEVICE_H +#ifndef MAME_MACHINE_SEGACRPT_DEVICE_H +#define MAME_MACHINE_SEGACRPT_DEVICE_H #pragma once @@ -290,5 +290,4 @@ DECLARE_DEVICE_TYPE(SEGA_315_5128, sega_315_5128_device) DECLARE_DEVICE_TYPE(SEGA_315_5028, sega_315_5028_device) DECLARE_DEVICE_TYPE(SEGA_315_5084, sega_315_5084_device) - -#endif // MAME_MACHINE_SEGACRYPT_DEVICE_H +#endif // MAME_MACHINE_SEGACRPT_DEVICE_H diff --git a/src/devices/machine/sis630_gui.h b/src/devices/machine/sis630_gui.h index 36cc02686cb..150ed584f93 100644 --- a/src/devices/machine/sis630_gui.h +++ b/src/devices/machine/sis630_gui.h @@ -1,8 +1,8 @@ // license: BSD-3-Clause // copyright-holders: Angelo Salese -#ifndef MAME_MACHINE_SIS630_VGA_H -#define MAME_MACHINE_SIS630_VGA_H +#ifndef MAME_MACHINE_SIS630_GUI_H +#define MAME_MACHINE_SIS630_GUI_H #pragma once @@ -94,5 +94,4 @@ class sis630_bridge_device : public pci_bridge_device DECLARE_DEVICE_TYPE(SIS630_BRIDGE, sis630_bridge_device) - -#endif +#endif // MAME_MACHINE_SIS630_GUI_H diff --git a/src/devices/machine/sis85c496.h b/src/devices/machine/sis85c496.h index c6e914ddb46..679cc26e31c 100644 --- a/src/devices/machine/sis85c496.h +++ b/src/devices/machine/sis85c496.h @@ -2,8 +2,8 @@ // copyright-holders:R. Belmont // SiS 85c496 northbridge (PCI & CPU Memory Controller) -#ifndef SIS85C496_H -#define SIS85C496_H +#ifndef MAME_MACHINE_SIS85C496_H +#define MAME_MACHINE_SIS85C496_H #include "pci.h" #include "machine/ds128x.h" @@ -193,4 +193,4 @@ class sis85c496_host_device : public pci_host_device { DECLARE_DEVICE_TYPE(SIS85C496_HOST, sis85c496_host_device) -#endif +#endif // MAME_MACHINE_SIS85C496_H diff --git a/src/devices/machine/smartmed.h b/src/devices/machine/smartmed.h index 0799f8c1063..cf029b7c3a7 100644 --- a/src/devices/machine/smartmed.h +++ b/src/devices/machine/smartmed.h @@ -4,8 +4,8 @@ smartmed.h: header file for smartmed.c */ -#ifndef MAME_MACHINE_SMARTMEDIA_H -#define MAME_MACHINE_SMARTMEDIA_H +#ifndef MAME_MACHINE_SMARTMED_H +#define MAME_MACHINE_SMARTMED_H #pragma once @@ -54,4 +54,4 @@ class smartmedia_image_device : public nand_device, public device_memcard_image_ // device type definition DECLARE_DEVICE_TYPE(SMARTMEDIA, smartmedia_image_device) -#endif // MAME_MACHINE_SMARTMEDIA_H +#endif // MAME_MACHINE_SMARTMED_H diff --git a/src/devices/machine/smpc.h b/src/devices/machine/smpc.h index 873998b71aa..dfe8d541be5 100644 --- a/src/devices/machine/smpc.h +++ b/src/devices/machine/smpc.h @@ -6,8 +6,8 @@ //void saturn_SMPC_w(offs_t offset, uint8_t data); //uint8_t saturn_SMPC_r(offs_t offset); -#ifndef MAME_MACHINE_SMPC_HLE_H -#define MAME_MACHINE_SMPC_HLE_H +#ifndef MAME_MACHINE_SMPC_H +#define MAME_MACHINE_SMPC_H #pragma once @@ -199,12 +199,4 @@ class smpc_hle_device : public device_t, // device type definition DECLARE_DEVICE_TYPE(SMPC_HLE, smpc_hle_device) - - -//************************************************************************** -// GLOBAL VARIABLES -//************************************************************************** - - -#endif // MAME_MACHINE_SMPC_HLE_H - +#endif // MAME_MACHINE_SMPC_H diff --git a/src/devices/machine/sun4c_mmu.h b/src/devices/machine/sun4c_mmu.h index 2a3da5b6d6f..423d866ec80 100644 --- a/src/devices/machine/sun4c_mmu.h +++ b/src/devices/machine/sun4c_mmu.h @@ -6,10 +6,10 @@ ***************************************************************************/ -#pragma once +#ifndef MAME_MACHINE_SUN4C_MMU_H +#define MAME_MACHINE_SUN4C_MMU_H -#ifndef DEVICE_MACHINE_SUN4C_MMU_H -#define DEVICE_MACHINE_SUN4C_MMU_H +#pragma once #include "cpu/sparc/sparc_intf.h" #include "machine/ram.h" @@ -211,4 +211,4 @@ class sun4c_mmu_device : public sun4_mmu_base_device DECLARE_DEVICE_TYPE(SUN4_MMU, sun4_mmu_device) DECLARE_DEVICE_TYPE(SUN4C_MMU, sun4c_mmu_device) -#endif // DEVICE_MACHINE_SUN4C_MMU_H +#endif // MAME_MACHINE_SUN4C_MMU_H diff --git a/src/devices/machine/tdc1008.h b/src/devices/machine/tdc1008.h index d35ec428487..1df2a66ed5a 100644 --- a/src/devices/machine/tdc1008.h +++ b/src/devices/machine/tdc1008.h @@ -7,8 +7,8 @@ ***************************************************************************/ -#ifndef MAME_MACHINE_TDC1008_TDC1008_H -#define MAME_MACHINE_TDC1008_TDC1008_H +#ifndef MAME_MACHINE_TDC1008_H +#define MAME_MACHINE_TDC1008_H #pragma once @@ -108,4 +108,4 @@ class tdc1008_device : public device_t // device type definition DECLARE_DEVICE_TYPE(TDC1008, tdc1008_device) -#endif // MAME_MACHINE_TDC1008_TDC1008_H +#endif // MAME_MACHINE_TDC1008_H diff --git a/src/devices/machine/timehelp.h b/src/devices/machine/timehelp.h index 8716c63c450..555c8cb83f9 100644 --- a/src/devices/machine/timehelp.h +++ b/src/devices/machine/timehelp.h @@ -8,10 +8,10 @@ ***************************************************************************/ -#pragma once +#ifndef MAME_MACHINE_TIMEHELP_H +#define MAME_MACHINE_TIMEHELP_H -#ifndef SRC_DEVICES_MACHINE_TIMEHELP_H -#define SRC_DEVICES_MACHINE_TIMEHELP_H +#pragma once class time_helper { @@ -55,4 +55,4 @@ class time_helper }; -#endif // SRC_DEVICES_MACHINE_TIMEHELP_H +#endif // MAME_MACHINE_TIMEHELP_H diff --git a/src/devices/machine/tmc208k.h b/src/devices/machine/tmc208k.h index bbb770d13ee..e2c51eaa034 100644 --- a/src/devices/machine/tmc208k.h +++ b/src/devices/machine/tmc208k.h @@ -10,8 +10,8 @@ ***************************************************************************/ -#ifndef MAME_MACHINE_TMC208K_TMC208K_H -#define MAME_MACHINE_TMC208K_TMC208K_H +#ifndef MAME_MACHINE_TMC208K_H +#define MAME_MACHINE_TMC208K_H #pragma once @@ -99,4 +99,4 @@ class tmc28ku_device : public tmc208_base_device DECLARE_DEVICE_TYPE(TMC208K, tmc208k_device) DECLARE_DEVICE_TYPE(TMC28KU, tmc28ku_device) -#endif // MAME_MACHINE_TMC208K_TMC208K_H +#endif // MAME_MACHINE_TMC208K_H diff --git a/src/devices/machine/ucb1200.h b/src/devices/machine/ucb1200.h index e07519274bc..fe1f2009c3e 100644 --- a/src/devices/machine/ucb1200.h +++ b/src/devices/machine/ucb1200.h @@ -6,8 +6,8 @@ ***************************************************************************/ -#ifndef MAME_MACHINE_UCB1200 -#define MAME_MACHINE_UCB1200 +#ifndef MAME_MACHINE_UCB1200_H +#define MAME_MACHINE_UCB1200_H #pragma once @@ -144,4 +144,4 @@ class ucb1200_device : public device_t DECLARE_DEVICE_TYPE(UCB1200, ucb1200_device) -#endif // MAME_MACHINE_UCB1200 +#endif // MAME_MACHINE_UCB1200_H diff --git a/src/devices/machine/upd7004.h b/src/devices/machine/upd7004.h index 12e607720c2..2864177ee96 100644 --- a/src/devices/machine/upd7004.h +++ b/src/devices/machine/upd7004.h @@ -24,8 +24,8 @@ ***************************************************************************/ -#ifndef MAME_DEVICES_MACHINE_UPD7004_H -#define MAME_DEVICES_MACHINE_UPD7004_H +#ifndef MAME_MACHINE_UPD7004_H +#define MAME_MACHINE_UPD7004_H #pragma once @@ -78,4 +78,4 @@ class upd7004_device : public device_t // device type definition DECLARE_DEVICE_TYPE(UPD7004, upd7004_device) -#endif // MAME_DEVICES_MACHINE_UPD7004_H +#endif // MAME_MACHINE_UPD7004_H diff --git a/src/devices/machine/upd765.h b/src/devices/machine/upd765.h index ad5324019ee..5465ea7c10d 100644 --- a/src/devices/machine/upd765.h +++ b/src/devices/machine/upd765.h @@ -1,7 +1,7 @@ // license:BSD-3-Clause // copyright-holders:Olivier Galibert -#ifndef MAME_DEVICES_MACHINE_UPD765_H -#define MAME_DEVICES_MACHINE_UPD765_H +#ifndef MAME_MACHINE_UPD765_H +#define MAME_MACHINE_UPD765_H #pragma once @@ -635,4 +635,4 @@ DECLARE_DEVICE_TYPE(MCS3201, mcs3201_device) DECLARE_DEVICE_TYPE(TC8566AF, tc8566af_device) DECLARE_DEVICE_TYPE(HD63266F, hd63266f_device) -#endif // MAME_DEVICES_MACHINE_UPD765_H +#endif // MAME_MACHINE_UPD765_H diff --git a/src/devices/sound/iopspu.h b/src/devices/sound/iopspu.h index e771746c0ca..d52d3f2d4a4 100644 --- a/src/devices/sound/iopspu.h +++ b/src/devices/sound/iopspu.h @@ -9,8 +9,8 @@ * */ -#ifndef MAME_MACHINE_IOPSPU_H -#define MAME_MACHINE_IOPSPU_H +#ifndef MAME_SOUND_IOPSPU_H +#define MAME_SOUND_IOPSPU_H #pragma once @@ -98,4 +98,4 @@ class iop_spu_device : public device_t, public device_sound_interface DECLARE_DEVICE_TYPE(SONYIOP_SPU, iop_spu_device) -#endif // MAME_MACHINE_IOPSPU_H +#endif // MAME_SOUND_IOPSPU_H diff --git a/src/devices/sound/meg.h b/src/devices/sound/meg.h index 53dad3a2616..046aca47ad5 100644 --- a/src/devices/sound/meg.h +++ b/src/devices/sound/meg.h @@ -5,8 +5,8 @@ // // Audio dsp dedicated to effects generation, part of the SWP20 lineup -#ifndef DEVICES_SOUND_MEG_H -#define DEVICES_SOUND_MEG_H +#ifndef MAME_SOUND_MEG_H +#define MAME_SOUND_MEG_H #pragma once @@ -68,4 +68,4 @@ class meg_device : public device_t DECLARE_DEVICE_TYPE(MEG, meg_device) -#endif +#endif // MAME_SOUND_MEG_H diff --git a/src/devices/sound/nes_apu_vt.h b/src/devices/sound/nes_apu_vt.h index 20336c13a78..f53d5b6ca7c 100644 --- a/src/devices/sound/nes_apu_vt.h +++ b/src/devices/sound/nes_apu_vt.h @@ -1,8 +1,8 @@ // license:BSD-3-Clause // copyright-holders:David Haywood -#ifndef MAME_AUDIO_NES_VT_APU_H -#define MAME_AUDIO_NES_VT_APU_H +#ifndef MAME_SOUND_NES_APU_VT_H +#define MAME_SOUND_NES_APU_VT_H #pragma once @@ -23,4 +23,4 @@ class nes_apu_vt_device : public nesapu_device private: }; -#endif // MAME_AUDIO_NES_VT_APU_H +#endif // MAME_SOUND_NES_APU_VT_H diff --git a/src/devices/sound/nn71003f.h b/src/devices/sound/nn71003f.h index 8471bbb6d13..bdf1803cf54 100644 --- a/src/devices/sound/nn71003f.h +++ b/src/devices/sound/nn71003f.h @@ -3,8 +3,8 @@ // Nippon Steel Corp NN71003F mpeg audio decoder -#ifndef DEVICES_SOUND_NN71003F_H -#define DEVICES_SOUND_NN71003F_H +#ifndef MAME_SOUND_NN71003F_H +#define MAME_SOUND_NN71003F_H #pragma once @@ -39,4 +39,4 @@ class nn71003f_device : public device_t, public device_sound_interface DECLARE_DEVICE_TYPE(NN71003F, nn71003f_device) -#endif +#endif // MAME_SOUND_NN71003F_H diff --git a/src/devices/sound/rp2c33_snd.h b/src/devices/sound/rp2c33_snd.h index e60c036da8e..fb125b56747 100644 --- a/src/devices/sound/rp2c33_snd.h +++ b/src/devices/sound/rp2c33_snd.h @@ -6,8 +6,8 @@ ***************************************************************************/ -#ifndef MAME_MACHINE_RP2C33_SND_H -#define MAME_MACHINE_RP2C33_SND_H +#ifndef MAME_SOUND_RP2C33_SND_H +#define MAME_SOUND_RP2C33_SND_H #pragma once @@ -95,11 +95,4 @@ class rp2c33_sound_device : public device_t, public device_sound_interface // device type definition DECLARE_DEVICE_TYPE(RP2C33_SOUND, rp2c33_sound_device) - - -//************************************************************************** -// GLOBAL VARIABLES -//************************************************************************** - - -#endif // MAME_MACHINE_RP2C33_SND_H +#endif // MAME_SOUND_RP2C33_SND_H diff --git a/src/devices/sound/segapcm.h b/src/devices/sound/segapcm.h index a51c03f78b0..c89ab3e1859 100644 --- a/src/devices/sound/segapcm.h +++ b/src/devices/sound/segapcm.h @@ -4,8 +4,8 @@ /* SEGA 8bit PCM */ /*********************************************************/ -#ifndef MAMESOUND_SEGAPCM_H -#define MAMESOUND_SEGAPCM_H +#ifndef MAME_SOUND_SEGAPCM_H +#define MAME_SOUND_SEGAPCM_H #pragma once @@ -56,4 +56,4 @@ class segapcm_device : public device_t, DECLARE_DEVICE_TYPE(SEGAPCM, segapcm_device) -#endif // MAMESOUND_SEGAPCM_H +#endif // MAME_SOUND_SEGAPCM_H diff --git a/src/devices/sound/swp00.h b/src/devices/sound/swp00.h index cdb56fb158f..22d8bc60db4 100644 --- a/src/devices/sound/swp00.h +++ b/src/devices/sound/swp00.h @@ -3,8 +3,8 @@ // Yamaha SWP00, rompler/dsp combo -#ifndef DEVICES_SOUND_SWP00_H -#define DEVICES_SOUND_SWP00_H +#ifndef MAME_SOUND_SWP00_H +#define MAME_SOUND_SWP00_H #pragma once @@ -247,4 +247,4 @@ class swp00_device : public device_t, public device_sound_interface, public devi DECLARE_DEVICE_TYPE(SWP00, swp00_device) -#endif +#endif // MAME_SOUND_SWP00_H diff --git a/src/devices/sound/swp20.h b/src/devices/sound/swp20.h index df644bdad26..5d02a24f8cf 100644 --- a/src/devices/sound/swp20.h +++ b/src/devices/sound/swp20.h @@ -3,8 +3,8 @@ // Yamaha SWP20, rompler -#ifndef DEVICES_SOUND_SWP20_H -#define DEVICES_SOUND_SWP20_H +#ifndef MAME_SOUND_SWP20_H +#define MAME_SOUND_SWP20_H #pragma once @@ -72,4 +72,4 @@ class swp20_device : public device_t, public device_sound_interface, public devi DECLARE_DEVICE_TYPE(SWP20, swp20_device) -#endif +#endif // MAME_SOUND_SWP20_H diff --git a/src/devices/sound/swp30.h b/src/devices/sound/swp30.h index 0ee30f4d264..e6b9d8be03e 100644 --- a/src/devices/sound/swp30.h +++ b/src/devices/sound/swp30.h @@ -3,8 +3,8 @@ // Yamaha SWP30/30B, rompler/dsp combo -#ifndef DEVICES_SOUND_SWP30_H -#define DEVICES_SOUND_SWP30_H +#ifndef MAME_SOUND_SWP30_H +#define MAME_SOUND_SWP30_H #pragma once @@ -239,4 +239,4 @@ class swp30_device : public cpu_device, public device_sound_interface, public sw DECLARE_DEVICE_TYPE(SWP30, swp30_device) -#endif +#endif // MAME_SOUND_SWP30_H diff --git a/src/devices/sound/swp30d.h b/src/devices/sound/swp30d.h index d993f9f03f6..d6e13bb4c8d 100644 --- a/src/devices/sound/swp30d.h +++ b/src/devices/sound/swp30d.h @@ -7,8 +7,8 @@ // // Disassembler -#ifndef DEVICES_SOUND_SWP30D_H -#define DEVICES_SOUND_SWP30D_H +#ifndef MAME_SOUND_SWP30D_H +#define MAME_SOUND_SWP30D_H #pragma once @@ -36,4 +36,4 @@ class swp30_disassembler : public util::disasm_interface static inline void append(std::string &r, const std::string &e); }; -#endif +#endif // MAME_SOUND_SWP30D_H diff --git a/src/devices/sound/swx00.h b/src/devices/sound/swx00.h index 0dc99c1b809..e35ddd0a63a 100644 --- a/src/devices/sound/swx00.h +++ b/src/devices/sound/swx00.h @@ -3,8 +3,8 @@ // Yamaha SWX00, rompler/dsp/cpu combo, audio support -#ifndef DEVICES_SOUND_SWX00_H -#define DEVICES_SOUND_SWX00_H +#ifndef MAME_SOUND_SWX00_H +#define MAME_SOUND_SWX00_H #pragma once @@ -123,4 +123,4 @@ class swx00_sound_device : public device_t, public device_sound_interface, publi DECLARE_DEVICE_TYPE(SWX00_SOUND, swx00_sound_device) -#endif +#endif // MAME_SOUND_SWX00_H diff --git a/src/devices/sound/tms5110.cpp b/src/devices/sound/tms5110.cpp index bc08ea2a18d..eb09016a035 100644 --- a/src/devices/sound/tms5110.cpp +++ b/src/devices/sound/tms5110.cpp @@ -237,6 +237,7 @@ void tms5110_device::register_for_save_states() save_item(NAME(m_romclk_hack_state)); } + /********************************************************************************************** printbits helper function: takes a long int input and prints the resulting bits to stderr @@ -307,7 +308,6 @@ void tms5110_device::perform_dummy_read() - /********************************************************************************************** tms5110_process -- fill the buffer with a specific number of samples @@ -585,6 +585,7 @@ void tms5110_device::process(int16_t *buffer, unsigned int size) } } + /********************************************************************************************** clip_analog -- clips the 14 bit return value from the lattice filter to its final 10 bit value (-512 to 511), and upshifts/range extends this to 16 bits @@ -595,7 +596,8 @@ static int16_t clip_analog(int16_t cliptemp) { /* clipping, just like the patent shows: * the top 10 bits of this result are visible on the digital output IO pin. - * next, if the top 3 bits of the 14 bit result are all the same, the lowest of those 3 bits plus the next 7 bits are the signed analog output, otherwise the low bits are all forced to match the inverse of the topmost bit, i.e.: + * next, if the top 3 bits of the 14 bit result are all the same, the lowest of those 3 bits plus the next 7 bits are the signed analog output, + * otherwise the low bits are all forced to match the inverse of the topmost bit, i.e.: * 1x xxxx xxxx xxxx -> 0b10000000 * 11 1bcd efgh xxxx -> 0b1bcdefgh * 00 0bcd efgh xxxx -> 0b0bcdefgh @@ -633,6 +635,7 @@ static int16_t clip_analog(int16_t cliptemp) output, this makes almost no difference in the computation. **********************************************************************************************/ + static int32_t matrix_multiply(int32_t a, int32_t b) { int32_t result; @@ -648,6 +651,7 @@ static int32_t matrix_multiply(int32_t a, int32_t b) return result; } + /********************************************************************************************** lattice_filter -- executes one 'full run' of the lattice filter on a specific byte of @@ -724,7 +728,6 @@ int32_t tms5110_device::lattice_filter() - /****************************************************************************************** PDC_set -- set Processor Data Clock. Execute CTL_pins command on hi-lo transition. @@ -984,29 +987,6 @@ void tms5110_device::parse_frame() } -#if 0 -/*This is an example word TEN taken from the TMS5110A datasheet*/ -static const unsigned int example_word_TEN[619]={ -/* 1*/1,0,0,0, 0, 0,0,0,0,0, 1,1,0,0,0, 0,0,0,1,0, 0,1,1,1, 0,1,0,1, -/* 2*/1,0,0,0, 0, 0,0,0,0,0, 1,0,0,1,0, 0,0,1,1,0, 0,0,1,1, 0,1,0,1, -/* 3*/1,1,0,0, 0, 1,0,0,0,0, 1,0,1,0,0, 0,1,0,1,0, 0,1,0,0, 1,0,1,0, 1,0,0,0, 1,0,0,1, 0,1,0,1, 0,0,1, 0,1,0, 0,1,1, -/* 4*/1,1,1,0, 0, 0,1,1,1,1, 1,0,1,0,1, 0,1,1,1,0, 0,1,0,1, 0,1,1,1, 0,1,1,1, 1,0,1,1, 1,0,1,0, 0,1,1, 0,1,0, 0,1,1, -/* 5*/1,1,1,0, 0, 1,0,0,0,0, 1,0,1,0,0, 0,1,1,1,0, 0,1,0,1, 1,0,1,0, 1,0,0,0, 1,1,0,0, 1,0,1,1, 1,0,0, 0,1,0, 0,1,1, -/* 6*/1,1,1,0, 0, 1,0,0,0,1, 1,0,1,0,1, 0,1,1,0,1, 0,1,1,0, 0,1,1,1, 0,1,1,1, 1,0,1,0, 1,0,1,0, 1,1,0, 0,0,1, 1,0,0, -/* 7*/1,1,1,0, 0, 1,0,0,1,0, 1,0,1,1,1, 0,1,1,1,0, 0,1,1,1, 0,1,1,1, 0,1,0,1, 0,1,1,0, 1,0,0,1, 1,1,0, 0,1,0, 0,1,1, -/* 8*/1,1,1,0, 1, 1,0,1,0,1, -/* 9*/1,1,1,0, 0, 1,1,0,0,1, 1,0,1,1,1, 0,1,0,1,1, 1,0,1,1, 0,1,1,1, 0,1,0,0, 1,0,0,0, 1,0,0,0, 1,1,0, 0,1,1, 0,1,1, -/*10*/1,1,0,1, 0, 1,1,0,1,0, 1,0,1,0,1, 0,1,1,0,1, 1,0,1,1, 0,1,0,1, 0,1,0,0, 1,0,0,0, 1,0,1,0, 1,1,0, 0,1,0, 1,0,0, -/*11*/1,0,1,1, 0, 1,1,0,1,1, 1,0,0,1,1, 1,0,0,1,0, 0,1,1,0, 0,0,1,1, 0,1,0,1, 1,0,0,1, 1,0,1,0, 1,0,0, 0,1,1, 0,1,1, -/*12*/1,0,0,0, 0, 1,1,1,0,0, 1,0,0,1,1, 0,0,1,1,0, 0,1,0,0, 0,1,1,0, 1,1,0,0, 0,1,0,1, 1,0,0,0, 1,0,0, 0,1,0, 1,0,1, -/*13*/0,1,1,1, 1, 1,1,1,0,1, -/*14*/0,1,1,1, 0, 1,1,1,1,0, 1,0,0,1,1, 0,0,1,1,1, 0,1,0,1, 0,1,0,1, 1,1,0,0, 0,1,1,1, 1,0,0,0, 1,0,0, 0,1,0, 1,0,1, -/*15*/0,1,1,0, 0, 1,1,1,1,0, 1,0,1,0,1, 0,0,1,1,0, 0,1,0,0, 0,0,1,1, 1,1,0,0, 1,0,0,1, 0,1,1,1, 1,0,1, 0,1,0, 1,0,1, -/*16*/1,1,1,1 -}; -#endif - - //------------------------------------------------- // device_start - device-specific startup //------------------------------------------------- @@ -1109,7 +1089,8 @@ void tms5110_device::device_reset() /****************************************************************************** tms5110_ctl_w -- write Control Command to the sound chip -commands like Speech, Reset, etc., are loaded into the chip via the CTL pins + + commands like Speech, Reset, etc., are loaded into the chip via the CTL pins ******************************************************************************/ @@ -1178,7 +1159,7 @@ uint8_t m58817_device::status_r() { /* bring up to date first */ m_stream->update(); - return (TALK_STATUS() << 0); /*CTL1 = still talking ? */ + return (TALK_STATUS() << 0); /* CTL1 = still talking ? */ } TIMER_CALLBACK_MEMBER(tms5110_device::romclk_hack_toggle) @@ -1207,14 +1188,10 @@ int tms5110_device::romclk_hack_r() /****************************************************************************** - tms5110_update -- update the sound chip so that it is in sync with CPU execution + sound_stream_update -- update the sound chip so that it is in sync with CPU execution ******************************************************************************/ -//------------------------------------------------- -// sound_stream_update - handle a stream update -//------------------------------------------------- - void tms5110_device::sound_stream_update(sound_stream &stream, std::vector const &inputs, std::vector &outputs) { int16_t sample_data[MAX_SAMPLE_CHUNK]; @@ -1238,7 +1215,7 @@ void tms5110_device::sound_stream_update(sound_stream &stream, std::vector= cliprect.top() && yval <= cliprect.bottom() && (yval - m_vbp) < m_al << interlace) draw_graphics_line(bitmap, addr, yval, wd, pitch_shift); } } diff --git a/src/devices/video/wd90c26.h b/src/devices/video/wd90c26.h index 5a866a2c227..5066113b75e 100644 --- a/src/devices/video/wd90c26.h +++ b/src/devices/video/wd90c26.h @@ -1,8 +1,8 @@ // license:BSD-3-Clause // copyright-holders:Angelo Salese -#ifndef MAME_VIDEO_WD902C26_H -#define MAME_VIDEO_WD902C26_H +#ifndef MAME_VIDEO_WD90C26_H +#define MAME_VIDEO_WD90C26_H #pragma once @@ -21,4 +21,4 @@ class wd90c26_vga_device : public wd90c11a_vga_device DECLARE_DEVICE_TYPE(WD90C26, wd90c26_vga_device) -#endif // MAME_VIDEO_WD902C26_H +#endif // MAME_VIDEO_WD90C26_H diff --git a/src/devices/video/zr36110.h b/src/devices/video/zr36110.h index 8cc376ba7a3..c554d871bfd 100644 --- a/src/devices/video/zr36110.h +++ b/src/devices/video/zr36110.h @@ -3,8 +3,8 @@ // Zoran ZR36110 mpeg video decoder -#ifndef MAME_VIDEO_ZR36110 -#define MAME_VIDEO_ZR36110 +#ifndef MAME_VIDEO_ZR36110_H +#define MAME_VIDEO_ZR36110_H #pragma once @@ -95,5 +95,4 @@ class zr36110_device : public device_t DECLARE_DEVICE_TYPE(ZR36110, zr36110_device) -#endif - +#endif // MAME_VIDEO_ZR36110_H diff --git a/src/emu/screen.cpp b/src/emu/screen.cpp index cf311fb21eb..b14e9c39d84 100644 --- a/src/emu/screen.cpp +++ b/src/emu/screen.cpp @@ -926,6 +926,7 @@ void screen_device::device_stop() void screen_device::device_post_load() { realloc_screen_bitmaps(); + m_scanline0_timer->adjust(time_until_pos(0)); } @@ -1914,7 +1915,7 @@ void screen_device::finalize_burnin() //------------------------------------------------- -// finalize_burnin - finalize the burnin bitmap +// load_effect_overlay - //------------------------------------------------- void screen_device::load_effect_overlay(const char *filename) diff --git a/src/emu/xtal.cpp b/src/emu/xtal.cpp index 1ee3b6f0f54..15489fcd56c 100644 --- a/src/emu/xtal.cpp +++ b/src/emu/xtal.cpp @@ -486,6 +486,7 @@ const double XTAL::known_xtals[] = { 53'693'175, // 53.693175_MHz_XTAL PSX-based h/w, Sony ZN1-2-based (15x NTSC subcarrier) 54'000'000, // 54_MHz_XTAL Taito JC 55'000'000, // 55_MHz_XTAL Eolith Vega + 56'000'000, // 56_MHz_XTAL ARM7500 based Belatra slot machines 57'272'727, // 57.272727_MHz_XTAL Psikyo SH2 with /2 divider (16x NTSC subcarrier) 57'283'200, // 57.2832_MHz_XTAL Macintosh IIci RBV, 15-inch portrait display 58'000'000, // 58_MHz_XTAL Magic Reel (Play System) diff --git a/src/frontend/mame/ui/selmenu.cpp b/src/frontend/mame/ui/selmenu.cpp index e06103db3d0..240bbd2b663 100644 --- a/src/frontend/mame/ui/selmenu.cpp +++ b/src/frontend/mame/ui/selmenu.cpp @@ -1361,20 +1361,20 @@ bool menu_select_launch::scale_icon(bitmap_argb32 &&src, texture_and_bitmap &dst assert(dst.texture); if (src.valid()) { - // reduce the source bitmap if it's too big + // scale the source bitmap bitmap_argb32 tmp; - float const ratio((std::min)({ float(m_icon_height) / src.height(), float(m_icon_width) / src.width(), 1.0F })); - if (1.0F > ratio) + float const ratio((std::min)({ float(m_icon_height) / src.height(), float(m_icon_width) / src.width() })); + if (1.0F == ratio) + { + tmp = std::move(src); + } + else { float const pix_height(std::ceil(src.height() * ratio)); float const pix_width(std::ceil(src.width() * ratio)); tmp.allocate(s32(pix_width), s32(pix_height)); render_resample_argb_bitmap_hq(tmp, src, render_color{ 1.0F, 1.0F, 1.0F, 1.0F }, true); } - else - { - tmp = std::move(src); - } // copy into the destination dst.bitmap.allocate(m_icon_width, m_icon_height); diff --git a/src/mame/amiga/amiga.cpp b/src/mame/amiga/amiga.cpp index a730260f849..1f607a0ca9a 100644 --- a/src/mame/amiga/amiga.cpp +++ b/src/mame/amiga/amiga.cpp @@ -2331,6 +2331,14 @@ ROM_START( a2000 ) ROMX_LOAD("kick40063.u2", 0x00000, 0x80000, CRC(fc24ae0d) SHA1(3b7f1493b27e212830f989f26ca76c02049f09ca), ROM_GROUPWORD | ROM_BIOS(3)) ROM_SYSTEM_BIOS(4, "logica2", "Logica Diagnostic 2.0") ROMX_LOAD("logica2.u2", 0x00000, 0x80000, CRC(8484f426) SHA1(ba10d16166b2e2d6177c979c99edf8462b21651e), ROM_GROUPWORD | ROM_BIOS(4)) +#if 0 // not enabled yet, kickstart 3.2 is new and actively sold + ROM_SYSTEM_BIOS(5, "kick32", "Kickstart 3.2 (47.96)") + ROMX_LOAD("kick47096.u2", 0x00000, 0x80000, CRC(8173d7b6) SHA1(b88e364daf23c9c9920e548b0d3d944e65b1031d), ROM_GROUPWORD | ROM_BIOS(5)) + ROM_SYSTEM_BIOS(6, "kick321", "Kickstart 3.2 (47.102)") + ROMX_LOAD("kick47102.u2", 0x00000, 0x80000, CRC(4f078456) SHA1(8f64ada68a7f128ba782e8dc9fa583344171590a), ROM_GROUPWORD | ROM_BIOS(6)) + ROM_SYSTEM_BIOS(7, "kick322", "Kickstart 3.2 (47.111)") + ROMX_LOAD("kick47111.u2", 0x00000, 0x80000, CRC(e4458462) SHA1(7d5ebe686b69d59a863cc77a36b2cd60359a9ed2), ROM_GROUPWORD | ROM_BIOS(7)) +#endif ROM_END // Amiga 2000CR chip location: U500 diff --git a/src/mame/apple/apple2e.cpp b/src/mame/apple/apple2e.cpp index b452c3d1b72..9a90dfe8353 100644 --- a/src/mame/apple/apple2e.cpp +++ b/src/mame/apple/apple2e.cpp @@ -28,6 +28,12 @@ if double-lo-res works or not. We emulate the much more common Rev B or later board. + Has a keyboard switch on models with localized keyboard to toggle between the + US QWERTY and local keyboards. US models do not have a physical keyboard switch, + however Rev B motherboards have the DVORAK in ROM that is inaccessible to the user + without a hardware modification (see: Apple IIe Hardware: Dvorak + Keyboard Layout (May 25, 1989) from the Apple Tech Info Library) + IIe enhanced: 65C02 CPU with more instructions, MouseText in the character generator. IIe platinum: Like enhanced but with added numeric keypad and extended 80-column card @@ -50,7 +56,10 @@ - Apple II Mouse card (firmware entry points are compatible, but the hardware implementation omits the 68705 and is quite different!) - Has a 40/80 column switch and a QWERTY/DVORAK switch. + Has a 40/80 column switch and a keyboard switch. The keyboard switches + between QWERTY and DVORAK layouts on models without localized keyboards. + On models with localized keyboards, it switches between US QWERTY + and the local keyboard layout and character set. IIc (UniDisk 3.5): IIc with ROM doubled to 32K and the ROMSWITCH register added to page between the original 16K ROM and the new added 16K. The @@ -88,6 +97,8 @@ External drive port allows IIgs-style daisy-chaining. + 40/80 column switch removed. + ---------------------------------- TK3000 keyboard matrix: @@ -215,6 +226,7 @@ class apple2e_state : public driver_device m_mousey(*this, MOUSE_YAXIS_TAG), m_kbdrom(*this, "keyboard"), m_kbspecial(*this, "keyb_special"), + m_kbd_lang_sel(*this, "kbd_lang_select"), m_sysconfig(*this, "a2_config"), m_franklin_fkeys(*this, "franklin_fkeys"), m_speaker(*this, A2_SPEAKER_TAG), @@ -271,6 +283,7 @@ class apple2e_state : public driver_device optional_ioport m_mouseb, m_mousex, m_mousey; optional_memory_region m_kbdrom; required_ioport m_kbspecial; + optional_ioport m_kbd_lang_sel; // high-order nibble: keyboard selection offset - low-order nibble: character ROM area selection offset (including lo-res patterns) optional_ioport m_sysconfig; optional_ioport m_franklin_fkeys; required_device m_speaker; @@ -386,13 +399,17 @@ class apple2e_state : public driver_device void ace500(machine_config &config); void ace2200(machine_config &config); void apple2c_iwm(machine_config &config); + void apple2c_iwm_pal(machine_config &config); void apple2c_mem(machine_config &config); + void apple2c_mem_pal(machine_config &config); void cec(machine_config &config); void mprof3(machine_config &config); void apple2e(machine_config &config); void apple2epal(machine_config &config); void apple2ep(machine_config &config); + void apple2eppal(machine_config &config); void apple2c(machine_config &config); + void apple2cpal(machine_config &config); void tk3000(machine_config &config); void apple2ee(machine_config &config); void apple2eepal(machine_config &config); @@ -1046,6 +1063,10 @@ void apple2e_state::machine_start() m_x0 = false; m_y0 = false; + m_35sel = false; + m_hdsel = false; + m_intdrive = false; + // setup save states save_item(NAME(m_speaker_state)); save_item(NAME(m_cassette_state)); @@ -1326,6 +1347,16 @@ TIMER_DEVICE_CALLBACK_MEMBER(apple2e_state::apple2_interrupt) update_iic_mouse(); } + // update character selection + if (m_kbd_lang_sel) + { + u8 charset_id = m_kbd_lang_sel->read() & 0x0f; + if (m_video->get_iie_langsw() != charset_id) + { + m_video->set_iie_langsw(charset_id); + } + } + if (scanline == 192) { m_vbl = true; @@ -2110,6 +2141,9 @@ u8 apple2e_state::c000_laser_r(offs_t offset) switch (offset) { + case 0x60: // 40/80 column switch + return ((m_sysconfig.read_safe(0) & 0x40) ? 0x80 : 0) | uFloatingBus7; + case 0x63: // read mouse button return (m_mouseb->read() ? 0 : 0x80) | uFloatingBus7; @@ -2475,8 +2509,8 @@ u8 apple2e_state::c000_iic_r(offs_t offset) case 0x43: // read Y0Edge (IIc only) return m_y0edge ? 0x80 : 0x00; - case 0x60: // 40/80 column switch (IIc only) - return ((m_sysconfig->read() & 0x40) ? 0x80 : 0) | uFloatingBus7; + case 0x60: // 40/80 column switch (IIc and Franklin ACE 500 only) + return ((m_sysconfig.read_safe(0) & 0x40) ? 0x80 : 0) | uFloatingBus7; case 0x61: // button 0 or Open Apple or mouse button 1 case 0x69: @@ -3790,12 +3824,10 @@ void apple2e_state::ay3600_data_ready_w(int state) } trans |= (m_kbspecial->read() & 0x01) ? 0x0000 : 0x0200; // caps lock is bit 9 (active low) - if (m_isiic) + if (m_kbd_lang_sel) { - if (m_sysconfig->read() & 0x80) - { - trans += 0x400; // go to DVORAK half of the ROM - } + u8 kbd_layout_id = (m_kbd_lang_sel->read() & 0xf0) >> 4; + trans += kbd_layout_id * 0x400; // go to second half of the ROM (DVORAK on US IIc/IIe models) or beyond } m_transchar = decode[trans]; @@ -3844,6 +3876,7 @@ static INPUT_PORTS_START( apple2_sysconfig_accel ) PORT_CONFNAME(0x20, 0x00, "Bootup speed") PORT_CONFSETTING(0x00, "Standard") PORT_CONFSETTING(0x20, "4 MHz") + INPUT_PORTS_END static INPUT_PORTS_START( laser128_sysconfig ) @@ -3851,17 +3884,21 @@ static INPUT_PORTS_START( laser128_sysconfig ) PORT_CONFNAME(0x08, 0x00, "Printer type") PORT_CONFSETTING(0x00, "Serial") PORT_CONFSETTING(0x08, "Parallel") + PORT_CONFNAME(0x40, 0x40, "40/80 Columns") + PORT_CONFSETTING(0x00, "80 columns") + PORT_CONFSETTING(0x40, "40 columns") + + PORT_START("kbd_lang_select") + PORT_CONFNAME(0xff, 0x00, "Keyboard") + PORT_CONFSETTING(0x00, "QWERTY") + PORT_CONFSETTING(0x10, "DVORAK") // Only switch keyboard offset - second half of character ROM "laser 128 video rom vt27-0706-0.bin" has French characters INPUT_PORTS_END -static INPUT_PORTS_START( apple2c_sysconfig ) +static INPUT_PORTS_START( apple2c_common_config ) PORT_START("a2_config") PORT_CONFNAME(0x40, 0x40, "40/80 Columns") PORT_CONFSETTING(0x00, "80 columns") PORT_CONFSETTING(0x40, "40 columns") - PORT_CONFNAME(0x80, 0x00, "QWERTY/DVORAK") - PORT_CONFSETTING(0x00, "QWERTY") - PORT_CONFSETTING(0x80, "DVORAK") - PORT_CONFNAME(0x10, 0x00, "CPU type") PORT_CONFSETTING(0x00, "Standard") PORT_CONFSETTING(0x10, "4 MHz Zip Chip") @@ -3870,18 +3907,9 @@ static INPUT_PORTS_START( apple2c_sysconfig ) PORT_CONFSETTING(0x20, "4 MHz") INPUT_PORTS_END -static INPUT_PORTS_START( apple2cp_sysconfig ) - PORT_START("a2_config") - PORT_CONFNAME(0x04, 0x04, "40/80 Columns") - PORT_CONFSETTING(0x00, "80 columns") - PORT_CONFSETTING(0x04, "40 columns") - PORT_CONFNAME(0x08, 0x00, "QWERTY/DVORAK") - PORT_CONFSETTING(0x00, "QWERTY") - PORT_CONFSETTING(0x08, "DVORAK") -INPUT_PORTS_END - /* - Apple IIe & IIc key matrix (from "Sams ComputerFacts: Apple IIe" and "Sams ComputerFacts: Apple IIc") + + North American (NAM) Apple IIe & IIc key matrix (from "Sams ComputerFacts: Apple IIe" and "Sams ComputerFacts: Apple IIc") | Y0 | Y1 | Y2 | Y3 | Y4 | Y5 | Y6 | Y7 | Y8 | Y9 | | | | | | | | | | | | @@ -3902,6 +3930,66 @@ INPUT_PORTS_END ----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| X7 | | | | | | | DEL |DOWN |LEFT |RIGHT| ----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| + + The ISO Apple IIe & IIc key matrix (\| and `~ are swapped) + + | Y0 | Y1 | Y2 | Y3 | Y4 | Y5 | Y6 | Y7 | Y8 | Y9 | + | | | | | | | | | | | + ----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| + X0 | ESC | 1 | 2 | 3 | 4 | 6 | 5 | 7 | 8 | 9 | + ----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| + X1 | TAB | Q | W | E | R | Y | T | U | I | O | + ----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| + X2 | A | D | S | H | F | G | J | K | ;: | L | + ----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| + X3 | Z | X | C | V | B | M | N | ,< | .> | /? | + ----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| + X4 | | | | | | | `~ | += | 0 | -_ | + ----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| + X5 | | | | | | | \| | P | [{ | ]} | + ----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| + X6 | | | | | | |RETRN| UP | SPC | '" | + ----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| + X7 | | | | | | | DEL |DOWN |LEFT |RIGHT| + ----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| + + */ + + /* + Original Apple IIe keypad matrix (341-0132-B - 1982, and returned to use with 341-0132-D) + + | Y0 | Y1 | Y2 | Y3 | Y4 | Y5 | + | | | | | | | + ----+-----+-----+-----+-----+-----+-----+ + X4 | KP/ |KPLFT| KP0 | KP1 | KP2 | KP3 | + ----+-----+-----+-----+-----+-----+-----+ + X5 | KP) |KPEsc| KP4 | KP5 | KP6 | KP7 | + ----+-----+-----+-----+-----+-----+-----+ + X6 | KP* |KPRGT| KP8 | KP9 | KP. | KP+ | + ----+-----+-----+-----+-----+-----+-----+ + X7 | KP? |KPSPC| KP( | KP- |KPENT| KP, | + ----+-----+-----+-----+-----+-----+-----+ + + Note: KP ? is labeled as Print on the physical keypad (P/N: A2M2003), where ? is a shortcut for PRINT in Applesoft Basic + + */ + + /* + Revised Apple IIe keypad matrix (341-0132-C - 1983) + + | Y0 | Y1 | Y2 | Y3 | Y4 | Y5 | + | | | | | | | + ----+-----+-----+-----+-----+-----+-----+ + X4 | KP/ |KPDWN| KP0 | KP1 | KP2 | KP3 | + ----+-----+-----+-----+-----+-----+-----+ + X5 | KP) |KPUP | KP4 | KP5 | KP6 | KP7 | + ----+-----+-----+-----+-----+-----+-----+ + X6 | KP* |KPLFT| KP8 | KP9 | KP. | KP+ | + ----+-----+-----+-----+-----+-----+-----+ + X7 |KPEsc|KPRGT| KP( | KP- |KPENT| KP, | + ----+-----+-----+-----+-----+-----+-----+ + + Note: It is unknown if Apple released any numeric keypads with up, down arrows */ /* @@ -3928,7 +4016,92 @@ INPUT_PORTS_END ----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| */ -static INPUT_PORTS_START( apple2e_common ) + /* + Keyboard ROMs contain tables of physical key to ASCII code translation. The tables factor in whether the lock, shift, and control keys are pressed. + The following Apple IIe/IIc keyboard layouts are known to exist: + + - North American (NAM) + -- US English QWERTY + -- US English DVORAK + -- Western hemisphere French QWERTY + -- Western hemisphere Spanish QWERTY + --- original as documented in Apple // Supplement to the Owner's Manual (1982) - document 030-0535-A + --- revised as documented in Apple IIe Technical Reference Manual (1989) - document 030-1194-B + - ISO + -- US English QWERTY + -- UK English QWERTY + -- French AZERTY + -- Italian QZERTY + -- German QWERTZ + -- Swedish QWERTY + -- Spanish QWERTY + + The table below lists keyboard ROMs believed to exist. Notes: + - Good dumps are required to complete/correct this table + - The 342- prefix is used below, but in some cases, it could be 341, or both 342/341. It is believed that the content is identical when both ROMs are avaiable. + - SL: shift lock instead of caps lock + - SC: shift cancels the lock when both are activated + + ROM ID Year Type Primary Language/Layout Alternate Language/Layout Countries Keypad Layout Verified + ========== ==== ==== ======================= ========================= ============= ============= ======== + 342-0132-A 1982 NAM US QWERTY ? US original no + 342-0132-B 1982 NAM US QWERTY US DVORAK (original) US, AU original yes + 342-0132-C 1983 NAM US QWERTY US DVORAK (revised) US, AU revised yes + 342-0132-D 1984 NAM US QWERTY US DVORAK (revised) US, AU original yes + 342-0150-A 1982 ISO UK QWERTY US QWERTY UK, NL, AU original yes + 342-0151-A 1982 ISO German QWERTZ US QWERTY DE original yes + 342-0152-A 1982 ISO Swedish QWERTY US QWERTY SE, FI original yes + 342-0153-A 1982 ISO French AZERTY US QWERTY FR, BE original yes + 342-0154-A 1982 ISO Italian QZERTY US QWERTY IT original no + 342-0155-A 1982 ISO US QWERTY Western Spanish QWERTY (original) Latin America original no (order may be reversed) + 342-0211-A 1982 ISO Spanish QWERTY US QWERTY ES, PT original yes + 342-0283-A 1983 ISO French AZERTY (SL) US QWERTY FR original no + 342-0284-A 198? ISO Italian QZERTY (SL) US QWERTY IT original no + 342-0292-A 198? NAM US QWERTY Western French QWERTY CA original no (order may be reversed) + 342-0???-A 198? NAM US QWERTY Western Spanish QWERTY (revised) Latin America original no (order may be reversed) + 342-0326-A 1985 ISO French AZERTY (SL, SC) US QWERTY FR, BE original partial (only the French half of the ROM has been located) + 342-0327-A 1985 ISO German QWERTZ US QWERTY DE original no + 342-0329-A 1985 ISO Italian QZERTY (SL) US QWERTY IT original no + + The table below lists video character generator ROMs believed to exist. Notes: + - Good dumps are required to complete/correct this table + - The 342- prefix is used below, but in some cases, it could be 341, or both 342/341. It is believed that the content is identical when both ROMs are avaiable. + - Western French and Spanish ROMs have the same character sets as the European French and Spanish ROMs. The differences may be the order of primary vs. alternate languages, but this needs confirmation. + + ROM ID Primary Language Alternate Language MouseText Countries Verified + ========== ================ ================== ========= ============= ======== + 342-0133-A US English none no US, AU yes + 342-0160-A UK English US English no UK, NL, AU yes + 342-0161-A German US English no DE yes + 342-0162-A Swedish US English no SE yes + 342-0163-A French US English no FR, BE no + 342-0164-A Italian US English no IT no + 342-0165-A US English Spanish no Latin America no (order may be reversed) + 342-0166-A US English French no CA no (order may be reversed) + 342-0167-A US English Spanish no Latin America no (order may be reversed) + 342-0168-A US English French no CA no (order may be reversed) + 342-0212-A Spanish US English no ES, PT yes + 342-0265-A US English none yes US, AU yes + 342-0273-A UK English US English yes UK, NL, AU yes + 342-0274-A French US English yes FR, BE yes + 342-0275-A German US English yes DE no + 342-0276-A Italian US English yes IT no + 342-0306-A US English French yes CA no (order may be reversed) + 342-0307-A US English Spanish yes Latin America no (order may be reversed) + 342-0nnn-A Swedish US English yes SE no + 342-0nnn-A Spanish US English yes ES, PT no + + References: + - Apple // Supplement to the Owner's Manual (1982) - document 030-0535-A + - Apple //e Enhancement Kit - Dealer's Installation Instructions - document 030-1142-A + - Apple IIe Technical Reference Manual (1989) - document 030-1194-B + - Apple IIc Reference Manual (1984) - document 030-1022-B + - Apple IIc Technical Reference Manual (1987) - document 030-1238-B + - Apple IIc Technical Reference - Second Edition (1989) + + */ + +static INPUT_PORTS_START( apple2e_nam_us_kbd ) PORT_START("X0") PORT_BIT(0x001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Esc") PORT_CODE(KEYCODE_ESC) PORT_CHAR(27) PORT_BIT(0x002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_1) PORT_CHAR('1') PORT_CHAR('!') @@ -3943,36 +4116,36 @@ static INPUT_PORTS_START( apple2e_common ) PORT_START("X1") PORT_BIT(0x001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Tab") PORT_CODE(KEYCODE_TAB) PORT_CHAR(9) - PORT_BIT(0x002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_Q) PORT_CHAR('Q') PORT_CHAR('q') - PORT_BIT(0x004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_W) PORT_CHAR('W') PORT_CHAR('w') - PORT_BIT(0x008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_E) PORT_CHAR('E') PORT_CHAR('e') - PORT_BIT(0x010, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_R) PORT_CHAR('R') PORT_CHAR('r') - PORT_BIT(0x020, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_Y) PORT_CHAR('Y') PORT_CHAR('y') - PORT_BIT(0x040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_T) PORT_CHAR('T') PORT_CHAR('t') - PORT_BIT(0x080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_U) PORT_CHAR('U') PORT_CHAR('u') - PORT_BIT(0x100, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_I) PORT_CHAR('I') PORT_CHAR('i') - PORT_BIT(0x200, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_O) PORT_CHAR('O') PORT_CHAR('o') + PORT_BIT(0x002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_Q) PORT_CHAR('q') PORT_CHAR('Q') + PORT_BIT(0x004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_W) PORT_CHAR('w') PORT_CHAR('W') + PORT_BIT(0x008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_E) PORT_CHAR('e') PORT_CHAR('E') + PORT_BIT(0x010, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_R) PORT_CHAR('r') PORT_CHAR('R') + PORT_BIT(0x020, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_Y) PORT_CHAR('y') PORT_CHAR('Y') + PORT_BIT(0x040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_T) PORT_CHAR('t') PORT_CHAR('T') + PORT_BIT(0x080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_U) PORT_CHAR('u') PORT_CHAR('U') + PORT_BIT(0x100, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_I) PORT_CHAR('i') PORT_CHAR('I') + PORT_BIT(0x200, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_O) PORT_CHAR('o') PORT_CHAR('O') PORT_START("X2") - PORT_BIT(0x001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_A) PORT_CHAR('A') PORT_CHAR('a') - PORT_BIT(0x002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_D) PORT_CHAR('D') PORT_CHAR('d') - PORT_BIT(0x004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_S) PORT_CHAR('S') PORT_CHAR('s') - PORT_BIT(0x008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_H) PORT_CHAR('H') PORT_CHAR('h') - PORT_BIT(0x010, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_F) PORT_CHAR('F') PORT_CHAR('f') - PORT_BIT(0x020, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_G) PORT_CHAR('G') PORT_CHAR('g') - PORT_BIT(0x040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_J) PORT_CHAR('J') PORT_CHAR('j') - PORT_BIT(0x080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_K) PORT_CHAR('K') PORT_CHAR('k') + PORT_BIT(0x001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_A) PORT_CHAR('a') PORT_CHAR('A') + PORT_BIT(0x002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_D) PORT_CHAR('d') PORT_CHAR('D') + PORT_BIT(0x004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_S) PORT_CHAR('s') PORT_CHAR('S') + PORT_BIT(0x008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_H) PORT_CHAR('h') PORT_CHAR('H') + PORT_BIT(0x010, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_F) PORT_CHAR('f') PORT_CHAR('F') + PORT_BIT(0x020, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_G) PORT_CHAR('g') PORT_CHAR('G') + PORT_BIT(0x040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_J) PORT_CHAR('j') PORT_CHAR('J') + PORT_BIT(0x080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_K) PORT_CHAR('k') PORT_CHAR('K') PORT_BIT(0x100, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_COLON) PORT_CHAR(';') PORT_CHAR(':') - PORT_BIT(0x200, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_L) PORT_CHAR('L') PORT_CHAR('l') + PORT_BIT(0x200, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_L) PORT_CHAR('l') PORT_CHAR('L') PORT_START("X3") - PORT_BIT(0x001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_Z) PORT_CHAR('Z') PORT_CHAR('z') - PORT_BIT(0x002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_X) PORT_CHAR('X') PORT_CHAR('x') - PORT_BIT(0x004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_C) PORT_CHAR('C') PORT_CHAR('c') - PORT_BIT(0x008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_V) PORT_CHAR('V') PORT_CHAR('v') - PORT_BIT(0x010, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_B) PORT_CHAR('B') PORT_CHAR('b') - PORT_BIT(0x020, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_N) PORT_CHAR('N') PORT_CHAR('n') - PORT_BIT(0x040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_M) PORT_CHAR('M') PORT_CHAR('m') + PORT_BIT(0x001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_Z) PORT_CHAR('z') PORT_CHAR('Z') + PORT_BIT(0x002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_X) PORT_CHAR('x') PORT_CHAR('X') + PORT_BIT(0x004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_C) PORT_CHAR('c') PORT_CHAR('C') + PORT_BIT(0x008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_V) PORT_CHAR('v') PORT_CHAR('V') + PORT_BIT(0x010, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_B) PORT_CHAR('b') PORT_CHAR('B') + PORT_BIT(0x020, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_N) PORT_CHAR('n') PORT_CHAR('N') + PORT_BIT(0x040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_M) PORT_CHAR('m') PORT_CHAR('M') PORT_BIT(0x080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_COMMA) PORT_CHAR(',') PORT_CHAR('<') PORT_BIT(0x100, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_STOP) PORT_CHAR('.') PORT_CHAR('>') PORT_BIT(0x200, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_SLASH) PORT_CHAR('/') PORT_CHAR('?') @@ -3997,7 +4170,7 @@ static INPUT_PORTS_START( apple2e_common ) PORT_BIT(0x010, IP_ACTIVE_HIGH, IPT_UNUSED) PORT_BIT(0x020, IP_ACTIVE_HIGH, IPT_UNUSED) PORT_BIT(0x040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_TILDE) PORT_CHAR('`') PORT_CHAR('~') - PORT_BIT(0x080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_P) PORT_CHAR('P') PORT_CHAR('p') + PORT_BIT(0x080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_P) PORT_CHAR('p') PORT_CHAR('P') PORT_BIT(0x100, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_OPENBRACE) PORT_CHAR('[') PORT_CHAR('{') PORT_BIT(0x200, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_CLOSEBRACE) PORT_CHAR(']') PORT_CHAR('}') @@ -4038,6 +4211,16 @@ static INPUT_PORTS_START( apple2e_common ) PORT_BIT(0x200, IP_ACTIVE_HIGH, IPT_UNUSED) INPUT_PORTS_END +static INPUT_PORTS_START( apple2e_iso_us_kbd ) + PORT_INCLUDE( apple2e_nam_us_kbd ) + + PORT_MODIFY("X4") + PORT_BIT(0x040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_BACKSLASH) PORT_CHAR('`') PORT_CHAR('~') + + PORT_MODIFY("X5") + PORT_BIT(0x040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_BACKSLASH2) PORT_CODE(KEYCODE_TILDE) PORT_CHAR('\\') PORT_CHAR('|') +INPUT_PORTS_END + static INPUT_PORTS_START( apple2e_special ) PORT_START("keyb_special") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Caps Lock") PORT_CODE(KEYCODE_CAPSLOCK) PORT_TOGGLE @@ -4049,6 +4232,11 @@ static INPUT_PORTS_START( apple2e_special ) PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("RESET") PORT_CODE(KEYCODE_F12) INPUT_PORTS_END +static INPUT_PORTS_START( apple2e_special_sl ) // replace Caps Lock with Shift Lock + PORT_MODIFY("keyb_special") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Shift Lock") PORT_CODE(KEYCODE_CAPSLOCK) PORT_TOGGLE +INPUT_PORTS_END + static INPUT_PORTS_START( ceci ) PORT_START("X0") PORT_BIT(0x001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_0) PORT_CHAR('0') PORT_CHAR(')') @@ -4153,7 +4341,7 @@ static INPUT_PORTS_START( ceci ) PORT_START("keyb_special") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Caps Lock") PORT_CODE(KEYCODE_CAPSLOCK) PORT_TOGGLE PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Left Shift") PORT_CODE(KEYCODE_LSHIFT) PORT_CHAR(UCHAR_SHIFT_1) - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Right Shift") PORT_CODE(KEYCODE_RSHIFT) PORT_CHAR(UCHAR_SHIFT_1) + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Right Shift") PORT_CODE(KEYCODE_RSHIFT) PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Control") PORT_CODE(KEYCODE_LCONTROL) PORT_CHAR(UCHAR_SHIFT_2) PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED) PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED) @@ -4264,7 +4452,7 @@ static INPUT_PORTS_START( cecm ) PORT_START("keyb_special") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Caps Lock") PORT_CODE(KEYCODE_CAPSLOCK) PORT_TOGGLE PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Left Shift") PORT_CODE(KEYCODE_LSHIFT) PORT_CHAR(UCHAR_SHIFT_1) - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Right Shift") PORT_CODE(KEYCODE_RSHIFT) PORT_CHAR(UCHAR_SHIFT_1) + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Right Shift") PORT_CODE(KEYCODE_RSHIFT) PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Control") PORT_CODE(KEYCODE_LCONTROL) PORT_CHAR(UCHAR_SHIFT_2) PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED) PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED) @@ -4375,7 +4563,7 @@ static INPUT_PORTS_START( zijini ) PORT_START("keyb_special") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Caps Lock") PORT_CODE(KEYCODE_CAPSLOCK) PORT_TOGGLE PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Left Shift") PORT_CODE(KEYCODE_LSHIFT) PORT_CHAR(UCHAR_SHIFT_1) - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Right Shift") PORT_CODE(KEYCODE_RSHIFT) PORT_CHAR(UCHAR_SHIFT_1) + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Right Shift") PORT_CODE(KEYCODE_RSHIFT) PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Control") PORT_CODE(KEYCODE_LCONTROL) PORT_CHAR(UCHAR_SHIFT_2) PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED) PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED) @@ -4383,15 +4571,14 @@ static INPUT_PORTS_START( zijini ) INPUT_PORTS_END static INPUT_PORTS_START( apple2e ) - PORT_INCLUDE( apple2e_common ) + PORT_INCLUDE( apple2e_nam_us_kbd ) PORT_INCLUDE( apple2e_special ) PORT_INCLUDE( apple2_sysconfig_accel ) INPUT_PORTS_END static INPUT_PORTS_START( apple2c ) - PORT_INCLUDE( apple2e_common ) PORT_INCLUDE( apple2e_special ) - PORT_INCLUDE( apple2c_sysconfig ) + PORT_INCLUDE( apple2c_common_config ) PORT_START(MOUSE_BUTTON_TAG) /* Mouse - button */ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_NAME("Mouse Button") PORT_CODE(MOUSECODE_BUTTON1) @@ -4403,8 +4590,28 @@ static INPUT_PORTS_START( apple2c ) PORT_BIT( 0xff, 0x00, IPT_MOUSE_Y) PORT_SENSITIVITY(40) PORT_KEYDELTA(0) PORT_PLAYER(1) INPUT_PORTS_END +static INPUT_PORTS_START( apple2cus_sysconfig ) + PORT_START("kbd_lang_select") + PORT_CONFNAME(0xff, 0x00, "Keyboard") + PORT_CONFSETTING(0x00, "QWERTY") + PORT_CONFSETTING(0x12, "DVORAK") +INPUT_PORTS_END + +static INPUT_PORTS_START( apple2cus ) + PORT_INCLUDE( apple2e_nam_us_kbd ) + PORT_INCLUDE( apple2c ) + PORT_INCLUDE( apple2cus_sysconfig ) +INPUT_PORTS_END + +static INPUT_PORTS_START( apple2euk_sysconfig ) + PORT_START("kbd_lang_select") + PORT_CONFNAME(0xff, 0x00, "Keyboard") + PORT_CONFSETTING(0x00, "UK English") + PORT_CONFSETTING(0x12, "US English") +INPUT_PORTS_END + static INPUT_PORTS_START( laser128 ) - PORT_INCLUDE( apple2e_common ) + PORT_INCLUDE( apple2e_nam_us_kbd ) PORT_INCLUDE( laser128_sysconfig ) PORT_START("keyb_special") @@ -4426,13 +4633,13 @@ static INPUT_PORTS_START( laser128 ) PORT_BIT( 0xff, 0x00, IPT_MOUSE_Y) PORT_SENSITIVITY(40) PORT_KEYDELTA(0) PORT_PLAYER(1) INPUT_PORTS_END -static INPUT_PORTS_START( ace500 ) - PORT_INCLUDE( apple2e_common ) +static INPUT_PORTS_START( ace_common ) + PORT_INCLUDE( apple2e_nam_us_kbd ) - PORT_START("a2_config") - PORT_CONFNAME(0x80, 0x00, "Auto Line Feed for printer") - PORT_CONFSETTING(0x80, DEF_STR(On)) - PORT_CONFSETTING(0x00, DEF_STR(Off)) + PORT_START("kbd_lang_select") + PORT_CONFNAME(0xff, 0x00, "Character Set") // Franklin ACE's switch changes video ROM character output without affecting the keyboard + PORT_CONFSETTING(0x00, "Mouse") + PORT_CONFSETTING(0x02, "Std") PORT_START("keyb_special") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Caps Lock") PORT_CODE(KEYCODE_CAPSLOCK) PORT_TOGGLE @@ -4467,10 +4674,31 @@ static INPUT_PORTS_START( ace500 ) PORT_BIT( 0xff, 0x00, IPT_MOUSE_Y) PORT_SENSITIVITY(40) PORT_KEYDELTA(0) PORT_PLAYER(1) INPUT_PORTS_END +static INPUT_PORTS_START( ace2200 ) + PORT_START("a2_config") + PORT_CONFNAME(0x80, 0x00, "Auto Line Feed for printer") + PORT_CONFSETTING(0x80, DEF_STR(On)) + PORT_CONFSETTING(0x00, DEF_STR(Off)) + + PORT_INCLUDE( ace_common ) +INPUT_PORTS_END + +static INPUT_PORTS_START( ace500 ) + PORT_START("a2_config") + PORT_CONFNAME(0x40, 0x40, "40/80 Columns") + PORT_CONFSETTING(0x00, "80 columns") + PORT_CONFSETTING(0x40, "40 columns") + PORT_CONFNAME(0x80, 0x00, "Auto Line Feed for printer") + PORT_CONFSETTING(0x80, DEF_STR(On)) + PORT_CONFSETTING(0x00, DEF_STR(Off)) + + PORT_INCLUDE( ace_common ) +INPUT_PORTS_END + static INPUT_PORTS_START( apple2cp ) - PORT_INCLUDE( apple2e_common ) + PORT_INCLUDE( apple2e_nam_us_kbd ) PORT_INCLUDE( apple2e_special ) - PORT_INCLUDE( apple2cp_sysconfig ) + PORT_INCLUDE( apple2cus_sysconfig ) PORT_START(MOUSE_BUTTON_TAG) /* Mouse - button */ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_NAME("Mouse Button") PORT_CODE(MOUSECODE_BUTTON1) @@ -4482,488 +4710,236 @@ static INPUT_PORTS_START( apple2cp ) PORT_BIT( 0xff, 0x00, IPT_MOUSE_Y) PORT_SENSITIVITY(40) PORT_KEYDELTA(0) PORT_PLAYER(1) INPUT_PORTS_END -static INPUT_PORTS_START( apple2euk ) - PORT_START("X0") - PORT_BIT(0x001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Esc") PORT_CODE(KEYCODE_ESC) PORT_CHAR(27) - PORT_BIT(0x002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_1) PORT_CHAR('1') PORT_CHAR('!') - PORT_BIT(0x004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_2) PORT_CHAR('2') PORT_CHAR('\"') - PORT_BIT(0x008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_3) PORT_CHAR('3') PORT_CHAR(0xa3) // a3 is Unicode for the pound sign - PORT_BIT(0x010, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_4) PORT_CHAR('4') PORT_CHAR('$') - PORT_BIT(0x020, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_6) PORT_CHAR('6') PORT_CHAR('&') - PORT_BIT(0x040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_5) PORT_CHAR('5') PORT_CHAR('%') - PORT_BIT(0x080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_7) PORT_CHAR('7') PORT_CHAR('\'') - PORT_BIT(0x100, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_8) PORT_CHAR('8') PORT_CHAR('(') - PORT_BIT(0x200, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_9) PORT_CHAR('9') PORT_CHAR(')') +static INPUT_PORTS_START( apple2eus_sysconfig ) + PORT_START("kbd_lang_select") + PORT_CONFNAME(0xff, 0x00, "Dvorak keyboard layout mod") + PORT_CONFSETTING(0x00, "Not installed") + PORT_CONFSETTING(0x10, "Installed") +INPUT_PORTS_END - PORT_START("X1") - PORT_BIT(0x001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Tab") PORT_CODE(KEYCODE_TAB) PORT_CHAR(9) - PORT_BIT(0x002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_Q) PORT_CHAR('Q') PORT_CHAR('q') - PORT_BIT(0x004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_W) PORT_CHAR('W') PORT_CHAR('w') - PORT_BIT(0x008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_E) PORT_CHAR('E') PORT_CHAR('e') - PORT_BIT(0x010, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_R) PORT_CHAR('R') PORT_CHAR('r') - PORT_BIT(0x020, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_Y) PORT_CHAR('Y') PORT_CHAR('y') - PORT_BIT(0x040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_T) PORT_CHAR('T') PORT_CHAR('t') - PORT_BIT(0x080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_U) PORT_CHAR('U') PORT_CHAR('u') - PORT_BIT(0x100, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_I) PORT_CHAR('I') PORT_CHAR('i') - PORT_BIT(0x200, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_O) PORT_CHAR('O') PORT_CHAR('o') +static INPUT_PORTS_START( apple2eus ) + PORT_INCLUDE( apple2e ) + PORT_INCLUDE( apple2eus_sysconfig ) +INPUT_PORTS_END - PORT_START("X2") - PORT_BIT(0x001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_A) PORT_CHAR('A') PORT_CHAR('a') - PORT_BIT(0x002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_D) PORT_CHAR('D') PORT_CHAR('d') - PORT_BIT(0x004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_S) PORT_CHAR('S') PORT_CHAR('s') - PORT_BIT(0x008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_H) PORT_CHAR('H') PORT_CHAR('h') - PORT_BIT(0x010, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_F) PORT_CHAR('F') PORT_CHAR('f') - PORT_BIT(0x020, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_G) PORT_CHAR('G') PORT_CHAR('g') - PORT_BIT(0x040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_J) PORT_CHAR('J') PORT_CHAR('j') - PORT_BIT(0x080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_K) PORT_CHAR('K') PORT_CHAR('k') - PORT_BIT(0x100, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_COLON) PORT_CHAR(';') PORT_CHAR(':') - PORT_BIT(0x200, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_L) PORT_CHAR('L') PORT_CHAR('l') +static INPUT_PORTS_START( tk3000 ) + PORT_INCLUDE( apple2e ) - PORT_START("X3") - PORT_BIT(0x001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_Z) PORT_CHAR('Z') PORT_CHAR('z') - PORT_BIT(0x002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_X) PORT_CHAR('X') PORT_CHAR('x') - PORT_BIT(0x004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_C) PORT_CHAR('C') PORT_CHAR('c') - PORT_BIT(0x008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_V) PORT_CHAR('V') PORT_CHAR('v') - PORT_BIT(0x010, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_B) PORT_CHAR('B') PORT_CHAR('b') - PORT_BIT(0x020, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_N) PORT_CHAR('N') PORT_CHAR('n') - PORT_BIT(0x040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_M) PORT_CHAR('M') PORT_CHAR('m') - PORT_BIT(0x080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_COMMA) PORT_CHAR(',') PORT_CHAR('<') - PORT_BIT(0x100, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_STOP) PORT_CHAR('.') PORT_CHAR('>') - PORT_BIT(0x200, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_SLASH) PORT_CHAR('/') PORT_CHAR('?') + PORT_START("kbd_lang_select") + PORT_CONFNAME(0xff, 0x00, "Character Set") + PORT_CONFSETTING(0x00, "Portuguese") + PORT_CONFSETTING(0x01, "US English") +INPUT_PORTS_END - PORT_START("X4") - PORT_BIT(0x001, IP_ACTIVE_HIGH, IPT_UNUSED) - PORT_BIT(0x002, IP_ACTIVE_HIGH, IPT_UNUSED) - PORT_BIT(0x004, IP_ACTIVE_HIGH, IPT_UNUSED) - PORT_BIT(0x008, IP_ACTIVE_HIGH, IPT_UNUSED) - PORT_BIT(0x010, IP_ACTIVE_HIGH, IPT_UNUSED) - PORT_BIT(0x020, IP_ACTIVE_HIGH, IPT_UNUSED) - PORT_BIT(0x040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_BACKSLASH) PORT_CHAR('\\') PORT_CHAR('|') - PORT_BIT(0x080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_EQUALS) PORT_CHAR('=') PORT_CHAR('+') - PORT_BIT(0x100, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_0) PORT_CHAR('0') PORT_CHAR(')') - PORT_BIT(0x200, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_MINUS) PORT_CHAR('-') PORT_CHAR('_') +static INPUT_PORTS_START( spectred ) + PORT_INCLUDE( apple2e ) - PORT_START("X5") - PORT_BIT(0x001, IP_ACTIVE_HIGH, IPT_UNUSED) - PORT_BIT(0x002, IP_ACTIVE_HIGH, IPT_UNUSED) - PORT_BIT(0x004, IP_ACTIVE_HIGH, IPT_UNUSED) - PORT_BIT(0x008, IP_ACTIVE_HIGH, IPT_UNUSED) - PORT_BIT(0x010, IP_ACTIVE_HIGH, IPT_UNUSED) - PORT_BIT(0x020, IP_ACTIVE_HIGH, IPT_UNUSED) - PORT_BIT(0x040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_TILDE) PORT_CHAR('`') PORT_CHAR('~') - PORT_BIT(0x080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_P) PORT_CHAR('P') PORT_CHAR('p') - PORT_BIT(0x100, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_OPENBRACE) PORT_CHAR('[') PORT_CHAR('{') - PORT_BIT(0x200, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_CLOSEBRACE) PORT_CHAR(']') PORT_CHAR('}') + PORT_START("kbd_lang_select") + PORT_CONFNAME(0xff, 0x00, "Character Set") + PORT_CONFSETTING(0x00, "Portuguese without MouseText") + PORT_CONFSETTING(0x01, "US English with MouseText") +INPUT_PORTS_END - PORT_START("X6") - PORT_BIT(0x001, IP_ACTIVE_HIGH, IPT_UNUSED) - PORT_BIT(0x002, IP_ACTIVE_HIGH, IPT_UNUSED) - PORT_BIT(0x004, IP_ACTIVE_HIGH, IPT_UNUSED) - PORT_BIT(0x008, IP_ACTIVE_HIGH, IPT_UNUSED) - PORT_BIT(0x010, IP_ACTIVE_HIGH, IPT_UNUSED) - PORT_BIT(0x020, IP_ACTIVE_HIGH, IPT_UNUSED) - PORT_BIT(0x040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Return") PORT_CODE(KEYCODE_ENTER) PORT_CHAR(13) - PORT_BIT(0x080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME(UTF8_UP) PORT_CODE(KEYCODE_UP) - PORT_BIT(0x100, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_SPACE) PORT_CHAR(' ') - PORT_BIT(0x200, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_QUOTE) PORT_CHAR('\'') PORT_CHAR('\"') +static INPUT_PORTS_START( prav8c ) + PORT_INCLUDE( apple2e ) - PORT_START("X7") - PORT_BIT(0x001, IP_ACTIVE_HIGH, IPT_UNUSED) - PORT_BIT(0x002, IP_ACTIVE_HIGH, IPT_UNUSED) - PORT_BIT(0x004, IP_ACTIVE_HIGH, IPT_UNUSED) - PORT_BIT(0x008, IP_ACTIVE_HIGH, IPT_UNUSED) - PORT_BIT(0x010, IP_ACTIVE_HIGH, IPT_UNUSED) - PORT_BIT(0x020, IP_ACTIVE_HIGH, IPT_UNUSED) - PORT_BIT(0x040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Delete") PORT_CODE(KEYCODE_BACKSPACE)PORT_CHAR(8) - PORT_BIT(0x080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME(UTF8_DOWN) PORT_CODE(KEYCODE_DOWN) PORT_CHAR(10) - PORT_BIT(0x100, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME(UTF8_LEFT) PORT_CODE(KEYCODE_LEFT) - PORT_BIT(0x200, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME(UTF8_RIGHT) PORT_CODE(KEYCODE_RIGHT) + PORT_START("kbd_lang_select") + PORT_CONFNAME(0xff, 0x00, "Character Set") + PORT_CONFSETTING(0x00, "Cyrilic") + PORT_CONFSETTING(0x02, "US English") +INPUT_PORTS_END - PORT_START("X8") - PORT_BIT(0x001, IP_ACTIVE_HIGH, IPT_UNUSED) - PORT_BIT(0x002, IP_ACTIVE_HIGH, IPT_UNUSED) - PORT_BIT(0x004, IP_ACTIVE_HIGH, IPT_UNUSED) - PORT_BIT(0x008, IP_ACTIVE_HIGH, IPT_UNUSED) - PORT_BIT(0x010, IP_ACTIVE_HIGH, IPT_UNUSED) - PORT_BIT(0x020, IP_ACTIVE_HIGH, IPT_UNUSED) - PORT_BIT(0x040, IP_ACTIVE_HIGH, IPT_UNUSED) - PORT_BIT(0x080, IP_ACTIVE_HIGH, IPT_UNUSED) - PORT_BIT(0x100, IP_ACTIVE_HIGH, IPT_UNUSED) - PORT_BIT(0x200, IP_ACTIVE_HIGH, IPT_UNUSED) +static INPUT_PORTS_START( apple2e_iso_uk_kbd ) + PORT_INCLUDE( apple2e_iso_us_kbd ) - PORT_START("keyb_special") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Caps Lock") PORT_CODE(KEYCODE_CAPSLOCK) PORT_TOGGLE - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Left Shift") PORT_CODE(KEYCODE_LSHIFT) PORT_CHAR(UCHAR_SHIFT_1) - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Right Shift") PORT_CODE(KEYCODE_RSHIFT) PORT_CHAR(UCHAR_SHIFT_1) - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Control") PORT_CODE(KEYCODE_LCONTROL) PORT_CHAR(UCHAR_SHIFT_2) - PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Open Apple") PORT_CODE(KEYCODE_LALT) - PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Solid Apple") PORT_CODE(KEYCODE_RALT) - PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("RESET") PORT_CODE(KEYCODE_F12) + PORT_MODIFY("X0") + PORT_BIT(0x008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_3) PORT_CHAR('3') PORT_CHAR(U'£') +INPUT_PORTS_END - PORT_INCLUDE(apple2_sysconfig_accel) +static INPUT_PORTS_START( apple2euk_common ) + PORT_INCLUDE( apple2euk_sysconfig ) + PORT_INCLUDE( apple2e_iso_uk_kbd ) INPUT_PORTS_END -static INPUT_PORTS_START( apple2ees ) - PORT_START("X0") - PORT_BIT(0x001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Esc") PORT_CODE(KEYCODE_ESC) PORT_CHAR(27) - PORT_BIT(0x002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_1) PORT_CHAR('1') PORT_CHAR('!') +static INPUT_PORTS_START( apple2cuk ) + PORT_INCLUDE( apple2euk_common ) + PORT_INCLUDE( apple2c ) +INPUT_PORTS_END + +static INPUT_PORTS_START( apple2euk ) + PORT_INCLUDE( apple2euk_common ) + PORT_INCLUDE( apple2e_special ) + PORT_INCLUDE( apple2_sysconfig_accel ) +INPUT_PORTS_END + +static INPUT_PORTS_START( apple2ees_sysconfig ) + PORT_START("kbd_lang_select") + PORT_CONFNAME(0xff, 0x00, "Keyboard") + PORT_CONFSETTING(0x00, "Spanish") + PORT_CONFSETTING(0x12, "US English") +INPUT_PORTS_END + +static INPUT_PORTS_START( apple2e_iso_es_kbd ) + PORT_INCLUDE( apple2e_iso_us_kbd ) + + PORT_MODIFY("X0") PORT_BIT(0x004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_2) PORT_CHAR('2') PORT_CHAR('\"') - PORT_BIT(0x008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_3) PORT_CHAR('3') PORT_CHAR(0xa3) // a3 is Unicode for the pound sign - PORT_BIT(0x010, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_4) PORT_CHAR('4') PORT_CHAR('$') + PORT_BIT(0x008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_3) PORT_CHAR('3') PORT_CHAR(U'£') PORT_BIT(0x020, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_6) PORT_CHAR('6') PORT_CHAR('&') PORT_BIT(0x040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_5) PORT_CHAR('5') PORT_CHAR('%') PORT_BIT(0x080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_7) PORT_CHAR('7') PORT_CHAR('/') PORT_BIT(0x100, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_8) PORT_CHAR('8') PORT_CHAR('(') PORT_BIT(0x200, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_9) PORT_CHAR('9') PORT_CHAR(')') - PORT_START("X1") - PORT_BIT(0x001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Tab") PORT_CODE(KEYCODE_TAB) PORT_CHAR(9) - PORT_BIT(0x002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_Q) PORT_CHAR('Q') PORT_CHAR('q') - PORT_BIT(0x004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_W) PORT_CHAR('W') PORT_CHAR('w') - PORT_BIT(0x008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_E) PORT_CHAR('E') PORT_CHAR('e') - PORT_BIT(0x010, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_R) PORT_CHAR('R') PORT_CHAR('r') - PORT_BIT(0x020, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_Y) PORT_CHAR('Y') PORT_CHAR('y') - PORT_BIT(0x040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_T) PORT_CHAR('T') PORT_CHAR('t') - PORT_BIT(0x080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_U) PORT_CHAR('U') PORT_CHAR('u') - PORT_BIT(0x100, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_I) PORT_CHAR('I') PORT_CHAR('i') - PORT_BIT(0x200, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_O) PORT_CHAR('O') PORT_CHAR('o') - - PORT_START("X2") - PORT_BIT(0x001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_A) PORT_CHAR('A') PORT_CHAR('a') - PORT_BIT(0x002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_D) PORT_CHAR('D') PORT_CHAR('d') - PORT_BIT(0x004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_S) PORT_CHAR('S') PORT_CHAR('s') - PORT_BIT(0x008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_H) PORT_CHAR('H') PORT_CHAR('h') - PORT_BIT(0x010, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_F) PORT_CHAR('F') PORT_CHAR('f') - PORT_BIT(0x020, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_G) PORT_CHAR('G') PORT_CHAR('g') - PORT_BIT(0x040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_J) PORT_CHAR('J') PORT_CHAR('j') - PORT_BIT(0x080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_K) PORT_CHAR('K') PORT_CHAR('k') - PORT_BIT(0x100, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_COLON) PORT_CHAR(0xf1) PORT_CHAR(0xf1) - PORT_BIT(0x200, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_L) PORT_CHAR('L') PORT_CHAR('l') + PORT_MODIFY("X2") + PORT_BIT(0x100, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_COLON) PORT_CHAR(U'ñ') PORT_CHAR(U'Ñ') - PORT_START("X3") - PORT_BIT(0x001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_Z) PORT_CHAR('Z') PORT_CHAR('z') - PORT_BIT(0x002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_X) PORT_CHAR('X') PORT_CHAR('x') - PORT_BIT(0x004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_C) PORT_CHAR('C') PORT_CHAR('c') - PORT_BIT(0x008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_V) PORT_CHAR('V') PORT_CHAR('v') - PORT_BIT(0x010, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_B) PORT_CHAR('B') PORT_CHAR('b') - PORT_BIT(0x020, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_N) PORT_CHAR('N') PORT_CHAR('n') - PORT_BIT(0x040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_M) PORT_CHAR('M') PORT_CHAR('m') + PORT_MODIFY("X3") PORT_BIT(0x080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_COMMA) PORT_CHAR(',') PORT_CHAR(';') PORT_BIT(0x100, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_STOP) PORT_CHAR('.') PORT_CHAR(':') PORT_BIT(0x200, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_SLASH) PORT_CHAR('-') PORT_CHAR('_') - PORT_START("X4") - PORT_BIT(0x001, IP_ACTIVE_HIGH, IPT_UNUSED) - PORT_BIT(0x002, IP_ACTIVE_HIGH, IPT_UNUSED) - PORT_BIT(0x004, IP_ACTIVE_HIGH, IPT_UNUSED) - PORT_BIT(0x008, IP_ACTIVE_HIGH, IPT_UNUSED) - PORT_BIT(0x010, IP_ACTIVE_HIGH, IPT_UNUSED) - PORT_BIT(0x020, IP_ACTIVE_HIGH, IPT_UNUSED) - PORT_BIT(0x040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_BACKSLASH) PORT_CHAR('\\') PORT_CHAR('|') - PORT_BIT(0x080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_EQUALS) PORT_CHAR('`') PORT_CHAR(0xbf) // inverted question mark + PORT_MODIFY("X4") + PORT_BIT(0x040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_BACKSLASH) PORT_CHAR(U'º') PORT_CHAR(U'§') + PORT_BIT(0x080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_EQUALS) PORT_CHAR('`') PORT_CHAR(U'¿') PORT_BIT(0x100, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_0) PORT_CHAR('0') PORT_CHAR('=') PORT_BIT(0x200, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_MINUS) PORT_CHAR('\'') PORT_CHAR('?') - PORT_START("X5") - PORT_BIT(0x001, IP_ACTIVE_HIGH, IPT_UNUSED) - PORT_BIT(0x002, IP_ACTIVE_HIGH, IPT_UNUSED) - PORT_BIT(0x004, IP_ACTIVE_HIGH, IPT_UNUSED) - PORT_BIT(0x008, IP_ACTIVE_HIGH, IPT_UNUSED) - PORT_BIT(0x010, IP_ACTIVE_HIGH, IPT_UNUSED) - PORT_BIT(0x020, IP_ACTIVE_HIGH, IPT_UNUSED) - PORT_BIT(0x040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_TILDE) PORT_CHAR('<') PORT_CHAR('>') - PORT_BIT(0x080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_P) PORT_CHAR('P') PORT_CHAR('p') + PORT_MODIFY("X5") + PORT_BIT(0x040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_BACKSLASH2) PORT_CODE(KEYCODE_TILDE) PORT_CHAR('<') PORT_CHAR('>') PORT_BIT(0x100, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_OPENBRACE) PORT_CHAR('~') PORT_CHAR('^') PORT_BIT(0x200, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_CLOSEBRACE) PORT_CHAR('+') PORT_CHAR('*') - PORT_START("X6") - PORT_BIT(0x001, IP_ACTIVE_HIGH, IPT_UNUSED) - PORT_BIT(0x002, IP_ACTIVE_HIGH, IPT_UNUSED) - PORT_BIT(0x004, IP_ACTIVE_HIGH, IPT_UNUSED) - PORT_BIT(0x008, IP_ACTIVE_HIGH, IPT_UNUSED) - PORT_BIT(0x010, IP_ACTIVE_HIGH, IPT_UNUSED) - PORT_BIT(0x020, IP_ACTIVE_HIGH, IPT_UNUSED) - PORT_BIT(0x040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Return") PORT_CODE(KEYCODE_ENTER) PORT_CHAR(13) - PORT_BIT(0x080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME(UTF8_UP) PORT_CODE(KEYCODE_UP) - PORT_BIT(0x100, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_SPACE) PORT_CHAR(' ') - PORT_BIT(0x200, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_QUOTE) PORT_CHAR(0xc7) PORT_CHAR(0xa1) // c with cedilla / inverted exclamation point + PORT_MODIFY("X6") + PORT_BIT(0x200, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_QUOTE) PORT_CHAR(U'ç') PORT_CHAR(U'¡') +INPUT_PORTS_END - PORT_START("X7") - PORT_BIT(0x001, IP_ACTIVE_HIGH, IPT_UNUSED) - PORT_BIT(0x002, IP_ACTIVE_HIGH, IPT_UNUSED) - PORT_BIT(0x004, IP_ACTIVE_HIGH, IPT_UNUSED) - PORT_BIT(0x008, IP_ACTIVE_HIGH, IPT_UNUSED) - PORT_BIT(0x010, IP_ACTIVE_HIGH, IPT_UNUSED) - PORT_BIT(0x020, IP_ACTIVE_HIGH, IPT_UNUSED) - PORT_BIT(0x040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Delete") PORT_CODE(KEYCODE_BACKSPACE)PORT_CHAR(8) - PORT_BIT(0x080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME(UTF8_DOWN) PORT_CODE(KEYCODE_DOWN) PORT_CHAR(10) - PORT_BIT(0x100, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME(UTF8_LEFT) PORT_CODE(KEYCODE_LEFT) - PORT_BIT(0x200, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME(UTF8_RIGHT) PORT_CODE(KEYCODE_RIGHT) +static INPUT_PORTS_START( apple2ees_common ) + PORT_INCLUDE( apple2ees_sysconfig ) + PORT_INCLUDE( apple2e_iso_es_kbd ) +INPUT_PORTS_END - PORT_START("X8") - PORT_BIT(0x001, IP_ACTIVE_HIGH, IPT_UNUSED) - PORT_BIT(0x002, IP_ACTIVE_HIGH, IPT_UNUSED) - PORT_BIT(0x004, IP_ACTIVE_HIGH, IPT_UNUSED) - PORT_BIT(0x008, IP_ACTIVE_HIGH, IPT_UNUSED) - PORT_BIT(0x010, IP_ACTIVE_HIGH, IPT_UNUSED) - PORT_BIT(0x020, IP_ACTIVE_HIGH, IPT_UNUSED) - PORT_BIT(0x040, IP_ACTIVE_HIGH, IPT_UNUSED) - PORT_BIT(0x080, IP_ACTIVE_HIGH, IPT_UNUSED) - PORT_BIT(0x100, IP_ACTIVE_HIGH, IPT_UNUSED) - PORT_BIT(0x200, IP_ACTIVE_HIGH, IPT_UNUSED) +static INPUT_PORTS_START( apple2ees ) + PORT_INCLUDE( apple2ees_common ) + PORT_INCLUDE( apple2e_special ) + PORT_INCLUDE( apple2_sysconfig_accel ) +INPUT_PORTS_END - PORT_START("keyb_special") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Caps Lock") PORT_CODE(KEYCODE_CAPSLOCK) PORT_TOGGLE - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Left Shift") PORT_CODE(KEYCODE_LSHIFT) PORT_CHAR(UCHAR_SHIFT_1) - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Right Shift") PORT_CODE(KEYCODE_RSHIFT) PORT_CHAR(UCHAR_SHIFT_1) - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Control") PORT_CODE(KEYCODE_LCONTROL) PORT_CHAR(UCHAR_SHIFT_2) - PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Open Apple") PORT_CODE(KEYCODE_LALT) - PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Solid Apple") PORT_CODE(KEYCODE_RALT) - PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("RESET") PORT_CODE(KEYCODE_F12) - - PORT_INCLUDE(apple2_sysconfig_accel) +static INPUT_PORTS_START( apple2efr_sysconfig ) + PORT_START("kbd_lang_select") + PORT_CONFNAME(0xff, 0x00, "Keyboard") + PORT_CONFSETTING(0x00, "French") + PORT_CONFSETTING(0x12, "US English") INPUT_PORTS_END -static INPUT_PORTS_START( apple2efr ) // French AZERTY keyboard (Apple uses the Belgian AZERTY layout in France also) - PORT_START("X0") - PORT_BIT(0x001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Esc") PORT_CODE(KEYCODE_ESC) PORT_CHAR(27) - PORT_BIT(0x002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_1) PORT_CHAR('1') PORT_CHAR('&') - PORT_BIT(0x004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_2) PORT_CHAR('2') PORT_CHAR(0xe9) // e with acute - PORT_BIT(0x008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_3) PORT_CHAR('3') PORT_CHAR('\"') - PORT_BIT(0x010, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_4) PORT_CHAR('4') PORT_CHAR('\'') - PORT_BIT(0x040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_5) PORT_CHAR('5') PORT_CHAR('(') - PORT_BIT(0x020, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_6) PORT_CHAR('6') PORT_CHAR(0xa7) // section sign - PORT_BIT(0x080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_7) PORT_CHAR('7') PORT_CHAR(0xe8) // e with grave - PORT_BIT(0x100, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_8) PORT_CHAR('8') PORT_CHAR('!') - PORT_BIT(0x200, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_9) PORT_CHAR('9') PORT_CHAR(0xe7) // c with cedilla - - PORT_START("X1") - PORT_BIT(0x001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Tab") PORT_CODE(KEYCODE_TAB) PORT_CHAR(9) - 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_W) PORT_CHAR('Z') PORT_CHAR('z') - PORT_BIT(0x008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_E) PORT_CHAR('E') PORT_CHAR('e') - PORT_BIT(0x010, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_R) PORT_CHAR('R') PORT_CHAR('r') - PORT_BIT(0x020, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_Y) PORT_CHAR('Y') PORT_CHAR('y') - PORT_BIT(0x040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_T) PORT_CHAR('T') PORT_CHAR('t') - PORT_BIT(0x080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_U) PORT_CHAR('U') PORT_CHAR('u') - PORT_BIT(0x100, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_I) PORT_CHAR('I') PORT_CHAR('i') - PORT_BIT(0x200, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_O) PORT_CHAR('O') PORT_CHAR('o') - - PORT_START("X2") - PORT_BIT(0x001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_A) PORT_CHAR('Q') PORT_CHAR('q') - PORT_BIT(0x002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_D) PORT_CHAR('D') PORT_CHAR('d') - PORT_BIT(0x004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_S) PORT_CHAR('S') PORT_CHAR('s') - PORT_BIT(0x008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_H) PORT_CHAR('H') PORT_CHAR('h') - PORT_BIT(0x010, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_F) PORT_CHAR('F') PORT_CHAR('f') - PORT_BIT(0x020, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_G) PORT_CHAR('G') PORT_CHAR('g') - PORT_BIT(0x040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_J) PORT_CHAR('J') PORT_CHAR('j') - PORT_BIT(0x080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_K) PORT_CHAR('K') PORT_CHAR('k') - PORT_BIT(0x100, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_COLON) PORT_CHAR('M') PORT_CHAR('m') - PORT_BIT(0x200, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_L) PORT_CHAR('L') PORT_CHAR('l') - - PORT_START("X3") - PORT_BIT(0x001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_Z) PORT_CHAR('W') PORT_CHAR('w') - PORT_BIT(0x002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_X) PORT_CHAR('X') PORT_CHAR('x') - PORT_BIT(0x004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_C) PORT_CHAR('C') PORT_CHAR('c') - PORT_BIT(0x008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_V) PORT_CHAR('V') PORT_CHAR('v') - PORT_BIT(0x010, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_B) PORT_CHAR('B') PORT_CHAR('b') - PORT_BIT(0x020, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_N) PORT_CHAR('N') PORT_CHAR('n') - PORT_BIT(0x040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_M) PORT_CHAR('?') PORT_CHAR(',') - PORT_BIT(0x080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_COMMA) PORT_CHAR('.') PORT_CHAR(';') - PORT_BIT(0x100, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_STOP) PORT_CHAR('/') PORT_CHAR(':') - PORT_BIT(0x200, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_SLASH) PORT_CHAR('+') PORT_CHAR('=') - - PORT_START("X4") - PORT_BIT(0x001, IP_ACTIVE_HIGH, IPT_UNUSED) - PORT_BIT(0x002, IP_ACTIVE_HIGH, IPT_UNUSED) - PORT_BIT(0x004, IP_ACTIVE_HIGH, IPT_UNUSED) - PORT_BIT(0x008, IP_ACTIVE_HIGH, IPT_UNUSED) - PORT_BIT(0x010, IP_ACTIVE_HIGH, IPT_UNUSED) - PORT_BIT(0x020, IP_ACTIVE_HIGH, IPT_UNUSED) - PORT_BIT(0x040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_BACKSLASH) PORT_CHAR(0xa3) PORT_CHAR('`') // UK pound (actually to the left of the return key on the QSDF row) - PORT_BIT(0x080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_EQUALS) PORT_CHAR('_') PORT_CHAR('-') - PORT_BIT(0x100, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_0) PORT_CHAR('0') PORT_CHAR(0xe0) // a with grave - PORT_BIT(0x200, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_MINUS) PORT_CHAR(0xb0) PORT_CHAR(')') // degree symbol - - PORT_START("X5") - PORT_BIT(0x001, IP_ACTIVE_HIGH, IPT_UNUSED) - PORT_BIT(0x002, IP_ACTIVE_HIGH, IPT_UNUSED) - PORT_BIT(0x004, IP_ACTIVE_HIGH, IPT_UNUSED) - PORT_BIT(0x008, IP_ACTIVE_HIGH, IPT_UNUSED) - PORT_BIT(0x010, IP_ACTIVE_HIGH, IPT_UNUSED) - PORT_BIT(0x020, IP_ACTIVE_HIGH, IPT_UNUSED) - PORT_BIT(0x040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_TILDE) PORT_CHAR('>') PORT_CHAR('<') // actually the key between left shift and W - PORT_BIT(0x080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_P) PORT_CHAR('P') PORT_CHAR('p') - PORT_BIT(0x100, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_OPENBRACE) PORT_CHAR(0xa8) PORT_CHAR('^') // diaresis +static INPUT_PORTS_START( apple2e_iso_fr_kbd ) // French AZERTY keyboard (Apple uses the Belgian AZERTY layout in France also) + PORT_INCLUDE( apple2e_iso_us_kbd ) + + PORT_MODIFY("X0") + PORT_BIT(0x002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_1) PORT_CHAR('&') PORT_CHAR('1') + PORT_BIT(0x004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_2) PORT_CHAR(U'é') PORT_CHAR('2') + PORT_BIT(0x008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_3) PORT_CHAR('\"') PORT_CHAR('3') + PORT_BIT(0x010, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_4) PORT_CHAR('\'') PORT_CHAR('4') + PORT_BIT(0x040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_5) PORT_CHAR('(') PORT_CHAR('5') + PORT_BIT(0x020, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_6) PORT_CHAR(U'§') PORT_CHAR('6') + PORT_BIT(0x080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_7) PORT_CHAR(U'è') PORT_CHAR('7') + PORT_BIT(0x100, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_8) PORT_CHAR('!') PORT_CHAR('8') + PORT_BIT(0x200, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_9) PORT_CHAR(U'ç') PORT_CHAR('9') + + PORT_MODIFY("X1") + 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_W) PORT_CHAR('z') PORT_CHAR('Z') + + PORT_MODIFY("X2") + PORT_BIT(0x001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_A) PORT_CHAR('q') PORT_CHAR('Q') + PORT_BIT(0x100, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_COLON) PORT_CHAR('m') PORT_CHAR('M') + + PORT_MODIFY("X3") + PORT_BIT(0x001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_Z) PORT_CHAR('w') PORT_CHAR('W') + PORT_BIT(0x040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_M) PORT_CHAR(',') PORT_CHAR('?') + PORT_BIT(0x080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_COMMA) PORT_CHAR(';') PORT_CHAR('.') + PORT_BIT(0x100, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_STOP) PORT_CHAR(':') PORT_CHAR('/') + PORT_BIT(0x200, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_SLASH) PORT_CHAR('=') PORT_CHAR('+') + + PORT_MODIFY("X4") + PORT_BIT(0x040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_BACKSLASH) PORT_CHAR('`') PORT_CHAR(U'£') // (actually to the left of the return key on the QSDF row) + PORT_BIT(0x080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_EQUALS) PORT_CHAR('-') PORT_CHAR('_') + PORT_BIT(0x100, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_0) PORT_CHAR(U'à') PORT_CHAR('0') + PORT_BIT(0x200, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_MINUS) PORT_CHAR(')') PORT_CHAR(U'°') + + PORT_MODIFY("X5") + PORT_BIT(0x040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_BACKSLASH2) PORT_CODE(KEYCODE_TILDE) PORT_CHAR('<') PORT_CHAR('>') // actually the key between left shift and W + PORT_BIT(0x100, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_OPENBRACE) PORT_CHAR('^') PORT_CHAR(U'¨') PORT_BIT(0x200, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_CLOSEBRACE) PORT_CHAR('$') PORT_CHAR('*') - PORT_START("X6") - PORT_BIT(0x001, IP_ACTIVE_HIGH, IPT_UNUSED) - PORT_BIT(0x002, IP_ACTIVE_HIGH, IPT_UNUSED) - PORT_BIT(0x004, IP_ACTIVE_HIGH, IPT_UNUSED) - PORT_BIT(0x008, IP_ACTIVE_HIGH, IPT_UNUSED) - PORT_BIT(0x010, IP_ACTIVE_HIGH, IPT_UNUSED) - PORT_BIT(0x020, IP_ACTIVE_HIGH, IPT_UNUSED) - PORT_BIT(0x040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Return") PORT_CODE(KEYCODE_ENTER) PORT_CHAR(13) - PORT_BIT(0x080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME(UTF8_UP) PORT_CODE(KEYCODE_UP) - PORT_BIT(0x100, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_SPACE) PORT_CHAR(' ') - PORT_BIT(0x200, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_QUOTE) PORT_CHAR('\'') PORT_CHAR('\"') - - PORT_START("X7") - PORT_BIT(0x001, IP_ACTIVE_HIGH, IPT_UNUSED) - PORT_BIT(0x002, IP_ACTIVE_HIGH, IPT_UNUSED) - PORT_BIT(0x004, IP_ACTIVE_HIGH, IPT_UNUSED) - PORT_BIT(0x008, IP_ACTIVE_HIGH, IPT_UNUSED) - PORT_BIT(0x010, IP_ACTIVE_HIGH, IPT_UNUSED) - PORT_BIT(0x020, IP_ACTIVE_HIGH, IPT_UNUSED) - PORT_BIT(0x040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Delete") PORT_CODE(KEYCODE_BACKSPACE)PORT_CHAR(8) - PORT_BIT(0x080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME(UTF8_DOWN) PORT_CODE(KEYCODE_DOWN) PORT_CHAR(10) - PORT_BIT(0x100, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME(UTF8_LEFT) PORT_CODE(KEYCODE_LEFT) - PORT_BIT(0x200, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME(UTF8_RIGHT) PORT_CODE(KEYCODE_RIGHT) - - PORT_START("X8") - PORT_BIT(0x001, IP_ACTIVE_HIGH, IPT_UNUSED) - PORT_BIT(0x002, IP_ACTIVE_HIGH, IPT_UNUSED) - PORT_BIT(0x004, IP_ACTIVE_HIGH, IPT_UNUSED) - PORT_BIT(0x008, IP_ACTIVE_HIGH, IPT_UNUSED) - PORT_BIT(0x010, IP_ACTIVE_HIGH, IPT_UNUSED) - PORT_BIT(0x020, IP_ACTIVE_HIGH, IPT_UNUSED) - PORT_BIT(0x040, IP_ACTIVE_HIGH, IPT_UNUSED) - PORT_BIT(0x080, IP_ACTIVE_HIGH, IPT_UNUSED) - PORT_BIT(0x100, IP_ACTIVE_HIGH, IPT_UNUSED) - PORT_BIT(0x200, IP_ACTIVE_HIGH, IPT_UNUSED) - - PORT_START("keyb_special") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Caps Lock") PORT_CODE(KEYCODE_CAPSLOCK) PORT_TOGGLE - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Left Shift") PORT_CODE(KEYCODE_LSHIFT) PORT_CHAR(UCHAR_SHIFT_1) - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Right Shift") PORT_CODE(KEYCODE_RSHIFT) PORT_CHAR(UCHAR_SHIFT_1) - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Control") PORT_CODE(KEYCODE_LCONTROL) PORT_CHAR(UCHAR_SHIFT_2) - PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Open Apple") PORT_CODE(KEYCODE_LALT) - PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Solid Apple") PORT_CODE(KEYCODE_RALT) - PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("RESET") PORT_CODE(KEYCODE_F12) - - PORT_INCLUDE(apple2_sysconfig_accel) + PORT_MODIFY("X6") + PORT_BIT(0x200, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_QUOTE) PORT_CHAR(U'ù') PORT_CHAR('%') INPUT_PORTS_END -INPUT_PORTS_START( apple2ep ) - PORT_START("X0") - PORT_BIT(0x001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Esc") PORT_CODE(KEYCODE_ESC) PORT_CHAR(27) - PORT_BIT(0x002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_1) PORT_CHAR('1') PORT_CHAR('!') - PORT_BIT(0x004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_2) PORT_CHAR('2') PORT_CHAR('@') - PORT_BIT(0x008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_3) PORT_CHAR('3') PORT_CHAR('#') - PORT_BIT(0x010, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_4) PORT_CHAR('4') PORT_CHAR('$') - PORT_BIT(0x020, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_6) PORT_CHAR('6') PORT_CHAR('^') - PORT_BIT(0x040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_5) PORT_CHAR('5') PORT_CHAR('%') - PORT_BIT(0x080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_7) PORT_CHAR('7') PORT_CHAR('&') - PORT_BIT(0x100, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_8) PORT_CHAR('8') PORT_CHAR('*') - PORT_BIT(0x200, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_9) PORT_CHAR('9') PORT_CHAR('(') +static INPUT_PORTS_START( apple2efr_common ) + PORT_INCLUDE( apple2efr_sysconfig ) + PORT_INCLUDE( apple2e_iso_fr_kbd ) +INPUT_PORTS_END - PORT_START("X1") - PORT_BIT(0x001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Tab") PORT_CODE(KEYCODE_TAB) PORT_CHAR(9) - PORT_BIT(0x002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_Q) PORT_CHAR('Q') PORT_CHAR('q') - PORT_BIT(0x004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_W) PORT_CHAR('W') PORT_CHAR('w') - PORT_BIT(0x008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_E) PORT_CHAR('E') PORT_CHAR('e') - PORT_BIT(0x010, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_R) PORT_CHAR('R') PORT_CHAR('r') - PORT_BIT(0x020, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_Y) PORT_CHAR('Y') PORT_CHAR('y') - PORT_BIT(0x040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_T) PORT_CHAR('T') PORT_CHAR('t') - PORT_BIT(0x080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_U) PORT_CHAR('U') PORT_CHAR('u') - PORT_BIT(0x100, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_I) PORT_CHAR('I') PORT_CHAR('i') - PORT_BIT(0x200, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_O) PORT_CHAR('O') PORT_CHAR('o') +static INPUT_PORTS_START( apple2cfr ) + PORT_INCLUDE( apple2efr_common ) + PORT_INCLUDE( apple2c ) + PORT_INCLUDE( apple2e_special_sl ) +INPUT_PORTS_END - PORT_START("X2") - PORT_BIT(0x001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_A) PORT_CHAR('A') PORT_CHAR('a') - PORT_BIT(0x002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_D) PORT_CHAR('D') PORT_CHAR('d') - PORT_BIT(0x004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_S) PORT_CHAR('S') PORT_CHAR('s') - PORT_BIT(0x008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_H) PORT_CHAR('H') PORT_CHAR('h') - PORT_BIT(0x010, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_F) PORT_CHAR('F') PORT_CHAR('f') - PORT_BIT(0x020, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_G) PORT_CHAR('G') PORT_CHAR('g') - PORT_BIT(0x040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_J) PORT_CHAR('J') PORT_CHAR('j') - PORT_BIT(0x080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_K) PORT_CHAR('K') PORT_CHAR('k') - PORT_BIT(0x100, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_COLON) PORT_CHAR(';') PORT_CHAR(':') - PORT_BIT(0x200, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_L) PORT_CHAR('L') PORT_CHAR('l') +static INPUT_PORTS_START( apple2efr ) + PORT_INCLUDE( apple2efr_common ) + PORT_INCLUDE( apple2e_special ) + PORT_INCLUDE( apple2_sysconfig_accel ) +INPUT_PORTS_END - PORT_START("X3") - PORT_BIT(0x001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_Z) PORT_CHAR('Z') PORT_CHAR('z') - PORT_BIT(0x002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_X) PORT_CHAR('X') PORT_CHAR('x') - PORT_BIT(0x004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_C) PORT_CHAR('C') PORT_CHAR('c') - PORT_BIT(0x008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_V) PORT_CHAR('V') PORT_CHAR('v') - PORT_BIT(0x010, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_B) PORT_CHAR('B') PORT_CHAR('b') - PORT_BIT(0x020, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_N) PORT_CHAR('N') PORT_CHAR('n') - PORT_BIT(0x040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_M) PORT_CHAR('M') PORT_CHAR('m') - PORT_BIT(0x080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_COMMA) PORT_CHAR(',') PORT_CHAR('<') - PORT_BIT(0x100, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_STOP) PORT_CHAR('.') PORT_CHAR('>') - PORT_BIT(0x200, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_SLASH) PORT_CHAR('/') PORT_CHAR('?') +static INPUT_PORTS_START( apple2eefr ) + PORT_INCLUDE( apple2efr_common ) + PORT_INCLUDE( apple2e_special ) + PORT_INCLUDE( apple2e_special_sl ) + PORT_INCLUDE( apple2_sysconfig_accel ) +INPUT_PORTS_END - PORT_START("X4") +INPUT_PORTS_START( apple2ep_keypad ) // must be included after including the main Apple IIe keyboard + PORT_MODIFY("X4") PORT_BIT(0x001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_SLASH_PAD) PORT_CHAR(UCHAR_MAMEKEY(SLASH_PAD)) - PORT_BIT(0x002, IP_ACTIVE_HIGH, IPT_UNUSED) PORT_BIT(0x004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_0_PAD) PORT_CHAR(UCHAR_MAMEKEY(0_PAD)) PORT_BIT(0x008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_1_PAD) PORT_CHAR(UCHAR_MAMEKEY(1_PAD)) PORT_BIT(0x010, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_2_PAD) PORT_CHAR(UCHAR_MAMEKEY(2_PAD)) PORT_BIT(0x020, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_3_PAD) PORT_CHAR(UCHAR_MAMEKEY(3_PAD)) - PORT_BIT(0x040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_BACKSLASH) PORT_CHAR('\\') PORT_CHAR('|') - PORT_BIT(0x080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_EQUALS) PORT_CHAR('=') PORT_CHAR('+') - PORT_BIT(0x100, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_0) PORT_CHAR('0') PORT_CHAR(')') - PORT_BIT(0x200, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_MINUS) PORT_CHAR('-') PORT_CHAR('_') - PORT_START("X5") - PORT_BIT(0x001, IP_ACTIVE_HIGH, IPT_UNUSED) + PORT_MODIFY("X5") PORT_BIT(0x002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Keypad Esc") PORT_CODE(KEYCODE_NUMLOCK) PORT_BIT(0x004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_4_PAD) PORT_CHAR(UCHAR_MAMEKEY(4_PAD)) PORT_BIT(0x008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_5_PAD) PORT_CHAR(UCHAR_MAMEKEY(5_PAD)) PORT_BIT(0x010, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_6_PAD) PORT_CHAR(UCHAR_MAMEKEY(6_PAD)) PORT_BIT(0x020, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_7_PAD) PORT_CHAR(UCHAR_MAMEKEY(7_PAD)) - PORT_BIT(0x040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_TILDE) PORT_CHAR('`') PORT_CHAR('~') - PORT_BIT(0x080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_P) PORT_CHAR('P') PORT_CHAR('p') - PORT_BIT(0x100, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_OPENBRACE) PORT_CHAR('[') PORT_CHAR('{') - PORT_BIT(0x200, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_CLOSEBRACE) PORT_CHAR(']') PORT_CHAR('}') - PORT_START("X6") + PORT_MODIFY("X6") PORT_BIT(0x001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_ASTERISK) PORT_CHAR(UCHAR_MAMEKEY(ASTERISK)) - PORT_BIT(0x002, IP_ACTIVE_HIGH, IPT_UNUSED) PORT_BIT(0x004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_8_PAD) PORT_CHAR(UCHAR_MAMEKEY(8_PAD)) PORT_BIT(0x008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_9_PAD) PORT_CHAR(UCHAR_MAMEKEY(9_PAD)) PORT_BIT(0x010, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_DEL_PAD) PORT_CHAR(UCHAR_MAMEKEY(DEL_PAD)) PORT_BIT(0x020, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_PLUS_PAD) PORT_CHAR(UCHAR_MAMEKEY(PLUS_PAD)) - PORT_BIT(0x040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Return") PORT_CODE(KEYCODE_ENTER) PORT_CHAR(13) - PORT_BIT(0x080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME(UTF8_UP) PORT_CODE(KEYCODE_UP) PORT_CHAR(UCHAR_MAMEKEY(UP)) - PORT_BIT(0x100, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_SPACE) PORT_CHAR(' ') - PORT_BIT(0x200, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_QUOTE) PORT_CHAR('\'') PORT_CHAR('\"') - PORT_START("X7") - PORT_BIT(0x001, IP_ACTIVE_HIGH, IPT_UNUSED) - PORT_BIT(0x002, IP_ACTIVE_HIGH, IPT_UNUSED) - PORT_BIT(0x004, IP_ACTIVE_HIGH, IPT_UNUSED) + PORT_MODIFY("X7") PORT_BIT(0x008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_MINUS_PAD) PORT_CHAR(UCHAR_MAMEKEY(MINUS_PAD)) PORT_BIT(0x010, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_ENTER_PAD) PORT_CHAR(UCHAR_MAMEKEY(ENTER_PAD)) - PORT_BIT(0x020, IP_ACTIVE_HIGH, IPT_UNUSED) - PORT_BIT(0x040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Delete") PORT_CODE(KEYCODE_BACKSPACE)PORT_CHAR(8) - PORT_BIT(0x080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME(UTF8_DOWN) PORT_CODE(KEYCODE_DOWN) PORT_CHAR(UCHAR_MAMEKEY(DOWN)) - PORT_BIT(0x100, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME(UTF8_LEFT) PORT_CODE(KEYCODE_LEFT) PORT_CHAR(UCHAR_MAMEKEY(LEFT)) - PORT_BIT(0x200, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME(UTF8_RIGHT) PORT_CODE(KEYCODE_RIGHT) PORT_CHAR(UCHAR_MAMEKEY(RIGHT)) +INPUT_PORTS_END - PORT_START("X8") - PORT_BIT(0x001, IP_ACTIVE_HIGH, IPT_UNUSED) - PORT_BIT(0x002, IP_ACTIVE_HIGH, IPT_UNUSED) - PORT_BIT(0x004, IP_ACTIVE_HIGH, IPT_UNUSED) - PORT_BIT(0x008, IP_ACTIVE_HIGH, IPT_UNUSED) - PORT_BIT(0x010, IP_ACTIVE_HIGH, IPT_UNUSED) - PORT_BIT(0x020, IP_ACTIVE_HIGH, IPT_UNUSED) - PORT_BIT(0x040, IP_ACTIVE_HIGH, IPT_UNUSED) - PORT_BIT(0x080, IP_ACTIVE_HIGH, IPT_UNUSED) - PORT_BIT(0x100, IP_ACTIVE_HIGH, IPT_UNUSED) - PORT_BIT(0x200, IP_ACTIVE_HIGH, IPT_UNUSED) +static INPUT_PORTS_START( apple2epus ) + PORT_INCLUDE( apple2eus ) + PORT_INCLUDE( apple2ep_keypad ) +INPUT_PORTS_END - PORT_START("keyb_special") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Caps Lock") PORT_CODE(KEYCODE_CAPSLOCK) PORT_TOGGLE - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Left Shift") PORT_CODE(KEYCODE_LSHIFT) PORT_CHAR(UCHAR_SHIFT_1) - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Right Shift") PORT_CODE(KEYCODE_RSHIFT) PORT_CHAR(UCHAR_SHIFT_1) - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Control") PORT_CODE(KEYCODE_LCONTROL) PORT_CHAR(UCHAR_SHIFT_2) - PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Open Apple") PORT_CODE(KEYCODE_LALT) - PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Solid Apple") PORT_CODE(KEYCODE_RALT) - PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("RESET") PORT_CODE(KEYCODE_F12) +static INPUT_PORTS_START( apple2epuk ) + PORT_INCLUDE( apple2euk ) + PORT_INCLUDE( apple2ep_keypad ) +INPUT_PORTS_END - PORT_INCLUDE(apple2_sysconfig_accel) +static INPUT_PORTS_START( apple2epfr ) + PORT_INCLUDE( apple2eefr ) + PORT_INCLUDE( apple2ep_keypad ) INPUT_PORTS_END static void apple2eaux_cards(device_slot_interface &device) @@ -5080,9 +5056,7 @@ void apple2e_state::apple2e(machine_config &config) void apple2e_state::apple2epal(machine_config &config) { apple2e(config); - M6502(config.replace(), m_maincpu, 1016966); - m_maincpu->set_addrmap(AS_PROGRAM, &apple2e_state::base_map); - m_maincpu->set_dasm_override(FUNC(apple2e_state::dasm_trampoline)); + m_maincpu->set_clock(1016966); m_screen->set_raw(1016966 * 14, (65 * 7) * 2, 0, (40 * 7) * 2, 312, 0, 192); } @@ -5101,10 +5075,7 @@ void apple2e_state::apple2ee(machine_config &config) void apple2e_state::apple2eepal(machine_config &config) { apple2ee(config); - M65C02(config.replace(), m_maincpu, 1016966); - m_maincpu->set_addrmap(AS_PROGRAM, &apple2e_state::base_map); - m_maincpu->set_dasm_override(FUNC(apple2e_state::dasm_trampoline)); - + m_maincpu->set_clock(1016966); m_screen->set_raw(1016966 * 14, (65 * 7) * 2, 0, (40 * 7) * 2, 312, 0, 192); } @@ -5131,10 +5102,14 @@ void apple2e_state::tk3000(machine_config &config) void apple2e_state::apple2ep(machine_config &config) { - apple2e(config); - M65C02(config.replace(), m_maincpu, 1021800); - m_maincpu->set_addrmap(AS_PROGRAM, &apple2e_state::base_map); - m_maincpu->set_dasm_override(FUNC(apple2e_state::dasm_trampoline)); + apple2ee(config); +} + +void apple2e_state::apple2eppal(machine_config &config) +{ + apple2ee(config); + m_maincpu->set_clock(1016966); + m_screen->set_raw(1016966 * 14, (65 * 7) * 2, 0, (40 * 7) * 2, 312, 0, 192); } void apple2e_state::apple2c(machine_config &config) @@ -5142,9 +5117,7 @@ void apple2e_state::apple2c(machine_config &config) apple2e_common(config, true, false); subdevice("flop_a2_orig")->set_filter("A2C"); // Filter list to compatible disks for this machine. - M65C02(config.replace(), m_maincpu, 1021800); m_maincpu->set_addrmap(AS_PROGRAM, &apple2e_state::apple2c_map); - m_maincpu->set_dasm_override(FUNC(apple2e_state::dasm_trampoline)); // IIc and friends have no cassette port config.device_remove(A2_CASSETTE_TAG); @@ -5189,12 +5162,18 @@ void apple2e_state::apple2c(machine_config &config) m_ram->set_default_size("128K").set_extra_options("128K"); } +void apple2e_state::apple2cpal(machine_config &config) +{ + apple2c(config); + m_maincpu->set_clock(1016966); + m_screen->set_raw(1016966 * 14, (65 * 7) * 2, 0, (40 * 7) * 2, 312, 0, 192); +} + void apple2e_state::apple2cp(machine_config &config) { apple2c(config); - M65C02(config.replace(), m_maincpu, 1021800); + m_maincpu->set_addrmap(AS_PROGRAM, &apple2e_state::apple2c_memexp_map); - m_maincpu->set_dasm_override(FUNC(apple2e_state::dasm_trampoline)); config.device_remove("sl4"); config.device_remove("sl6"); @@ -5216,23 +5195,34 @@ void apple2e_state::apple2c_iwm(machine_config &config) { apple2c(config); - config.device_remove("sl6"); - A2BUS_IWM(config, "sl6", A2BUS_7M_CLOCK).set_onboard(m_a2bus); + A2BUS_IWM(config.replace(), "sl6", A2BUS_7M_CLOCK).set_onboard(m_a2bus); +} + +void apple2e_state::apple2c_iwm_pal(machine_config &config) +{ + apple2c_iwm(config); + m_maincpu->set_clock(1016966); + m_screen->set_raw(1016966 * 14, (65 * 7) * 2, 0, (40 * 7) * 2, 312, 0, 192); } void apple2e_state::apple2c_mem(machine_config &config) { apple2c(config); - M65C02(config.replace(), m_maincpu, 1021800); + m_maincpu->set_addrmap(AS_PROGRAM, &apple2e_state::apple2c_memexp_map); - m_maincpu->set_dasm_override(FUNC(apple2e_state::dasm_trampoline)); - config.device_remove("sl6"); - A2BUS_IWM(config, "sl6", A2BUS_7M_CLOCK).set_onboard(m_a2bus); + A2BUS_IWM(config.replace(), "sl6", A2BUS_7M_CLOCK).set_onboard(m_a2bus); m_ram->set_default_size("128K").set_extra_options("128K, 384K, 640K, 896K, 1152K"); } +void apple2e_state::apple2c_mem_pal(machine_config &config) +{ + apple2c_mem(config); + m_maincpu->set_clock(1016966); + m_screen->set_raw(1016966 * 14, (65 * 7) * 2, 0, (40 * 7) * 2, 312, 0, 192); +} + void apple2e_state::laser128(machine_config &config) { apple2c(config); @@ -5440,6 +5430,7 @@ void apple2e_state::cec(machine_config &config) ***************************************************************************/ + ROM_START(apple2e) ROM_REGION(0x2000,"gfx1",0) ROM_LOAD ( "342-0133-a.chr", 0x0000, 0x1000,CRC(b081df66) SHA1(7060de104046736529c1e8a687a0dd7b84f8c51b)) @@ -5465,6 +5456,18 @@ ROM_START(apple2euk) ROM_LOAD( "341-0150-a.e12", 0x000, 0x800, CRC(66ffacd7) SHA1(47bb9608be38ff75429a989b930a93b47099648e) ) ROM_END +ROM_START(apple2efr) + ROM_REGION(0x2000, "gfx1", 0) + ROM_LOAD("341-0163-a.e9", 0x0000, 0x2000, BAD_DUMP CRC(1824d614) SHA1(a513bec3e44b8e823465720f3db6ee3f7781c1cd)) // created from "342-0274-a.e9" + + ROM_REGION(0x10000,"maincpu",0) + ROM_LOAD("342-0135-b.64", 0x0000, 0x2000, CRC(e248835e) SHA1(523838c19c79f481fa02df56856da1ec3816d16e)) + ROM_LOAD("342-0134-a.64", 0x2000, 0x2000, CRC(fc3d59d8) SHA1(8895a4b703f2184b673078f411f4089889b61c54)) + + ROM_REGION(0x800, "keyboard", ROMREGION_ERASE00) + ROM_LOAD("342-0153-a.f12", 0x000, 0x800, CRC(cbf1bbe7) SHA1(d1628c911ec4a0ff583f7346d3c38dc82023263e)) +ROM_END + ROM_START(apple2ees) ROM_REGION(0x2000,"gfx1",0) ROM_LOAD( "341-0212-a.e9", 0x000000, 0x002000, CRC(bc5575ef) SHA1(aa20c257255ef552295d32a3f56ccbb52b8716c3) ) @@ -5524,7 +5527,7 @@ ROM_START(apple2eefr) ROM_LOAD( "342-0303-a.e5", 0x2000, 0x2000, CRC(95e10034) SHA1(afb09bb96038232dc757d40c0605623cae38088e) ) ROM_REGION( 0x800, "keyboard", ROMREGION_ERASE00 ) - ROM_LOAD( "341-0326-a.f12", 0x0000, 0x0800, CRC(7e79f3fa) SHA1(17f22593e94c1e59ba110d4b32c3334ef418885c) ) + ROM_LOAD( "342-0326-a.f12", 0x0000, 0x0800, BAD_DUMP CRC(f04970a9) SHA1(806a602195c18ffec637c03b6bb3405188b0dc1e) ) // merged French half of 341-0326-a.f12 with QWERTY 341-0150-a.e12 ROM_END ROM_START(apple2ep) @@ -5540,6 +5543,28 @@ ROM_START(apple2ep) ROM_LOAD( "341-0132-d.e12", 0x000, 0x800, CRC(c506efb9) SHA1(8e14e85c645187504ec9d162b3ea614a0c421d32) ) ROM_END +ROM_START(apple2epuk) + ROM_REGION(0x2000,"gfx1",0) + ROM_LOAD("342-0273-a.chr", 0x0000, 0x2000, CRC(9157085a) SHA1(85479a509d6c8176949a5b20720567b7022aa631)) + + ROM_REGION(0x10000,"maincpu",0) + ROM_LOAD("32-0349-b.128", 0x0000, 0x4000, CRC(1d70b193) SHA1(b8ea90abe135a0031065e01697c4a3a20d51198b)) /* should rom name be 342-0349-b? */ + + ROM_REGION( 0x800, "keyboard", 0 ) + ROM_LOAD("341-0150-a.e12", 0x000, 0x800, CRC(66ffacd7) SHA1(47bb9608be38ff75429a989b930a93b47099648e)) +ROM_END + +ROM_START(apple2epfr) + ROM_REGION(0x2000,"gfx1",0) + ROM_LOAD( "342-0274-a.e9", 0x0000, 0x2000, CRC(8f342081) SHA1(c81c1bbf237e70f8c3e5eef3c8fd5bd9b9f54d1e) ) + + ROM_REGION(0x10000,"maincpu",0) + ROM_LOAD("32-0349-b.128", 0x0000, 0x4000, CRC(1d70b193) SHA1(b8ea90abe135a0031065e01697c4a3a20d51198b)) /* should rom name be 342-0349-b? */ + + ROM_REGION( 0x800, "keyboard", 0 ) + ROM_LOAD( "342-0326-a.f12", 0x0000, 0x0800, BAD_DUMP CRC(f04970a9) SHA1(806a602195c18ffec637c03b6bb3405188b0dc1e) ) // merged French half of 341-0326-a.f12 with QWERTY 341-0150-a.e12 +ROM_END + ROM_START(apple2c) ROM_REGION(0x2000,"gfx1",0) ROM_LOAD ( "341-0265-a.chr", 0x0000, 0x1000,CRC(2651014d) SHA1(b2b5d87f52693817fc747df087a4aa1ddcdb1f10)) @@ -5552,6 +5577,28 @@ ROM_START(apple2c) ROM_LOAD( "342-0132-c.e12", 0x000, 0x800, CRC(e47045f4) SHA1(12a2e718f5f4acd69b6c33a45a4a940b1440a481) ) // 1983 US-Dvorak ROM_END +ROM_START(apple2cuk) + ROM_REGION(0x2000,"gfx1",0) + ROM_LOAD("342-0273-a.chr", 0x0000, 0x2000, CRC(9157085a) SHA1(85479a509d6c8176949a5b20720567b7022aa631)) + + ROM_REGION(0x10000,"maincpu",0) + ROM_LOAD("a2c.128", 0x0000, 0x4000, CRC(f0edaa1b) SHA1(1a9b8aca5e32bb702ddb7791daddd60a89655729)) /* should be 342-0272-A? */ + + ROM_REGION( 0x800, "keyboard", 0 ) + ROM_LOAD("341-0150-a.e12", 0x000, 0x800, CRC(66ffacd7) SHA1(47bb9608be38ff75429a989b930a93b47099648e)) +ROM_END + +ROM_START(apple2cfr) + ROM_REGION(0x2000,"gfx1",0) + ROM_LOAD( "342-0274-a.e9", 0x0000, 0x2000, CRC(8f342081) SHA1(c81c1bbf237e70f8c3e5eef3c8fd5bd9b9f54d1e) ) + + ROM_REGION(0x10000,"maincpu",0) + ROM_LOAD("a2c.128", 0x0000, 0x4000, CRC(f0edaa1b) SHA1(1a9b8aca5e32bb702ddb7791daddd60a89655729)) /* should be 342-0272-A? */ + + ROM_REGION( 0x800, "keyboard", 0 ) + ROM_LOAD( "342-0326-a.f12", 0x0000, 0x0800, BAD_DUMP CRC(f04970a9) SHA1(806a602195c18ffec637c03b6bb3405188b0dc1e) ) // merged French half of 341-0326-a.f12 with QWERTY 341-0150-a.e12 +ROM_END + ROM_START(spectred) ROM_REGION(0x8000,"gfx1",0) ROM_LOAD ( "spm-c_ed_06-08-85.u6", 0x0000, 0x4000, CRC(a1b9ffe4) SHA1(3cb281f19f91372e24685792b7bff778944f99ed) ) @@ -5617,6 +5664,28 @@ ROM_START(apple2c0) ROM_LOAD( "342-0132-c.e12", 0x000, 0x800, CRC(e47045f4) SHA1(12a2e718f5f4acd69b6c33a45a4a940b1440a481) ) // 1983 US-Dvorak ROM_END +ROM_START(apple2c0uk) + ROM_REGION(0x2000,"gfx1",0) + ROM_LOAD("342-0273-a.chr", 0x0000, 0x2000, CRC(9157085a) SHA1(85479a509d6c8176949a5b20720567b7022aa631)) + + ROM_REGION(0x10000,"maincpu",0) + ROM_LOAD("3420033a.256", 0x0000, 0x8000, CRC(c8b979b3) SHA1(10767e96cc17bad0970afda3a4146564e6272ba1)) + + ROM_REGION( 0x800, "keyboard", 0 ) + ROM_LOAD("341-0150-a.e12", 0x000, 0x800, CRC(66ffacd7) SHA1(47bb9608be38ff75429a989b930a93b47099648e)) +ROM_END + +ROM_START(apple2c0fr) + ROM_REGION(0x2000,"gfx1",0) + ROM_LOAD( "342-0274-a.e9", 0x0000, 0x2000, CRC(8f342081) SHA1(c81c1bbf237e70f8c3e5eef3c8fd5bd9b9f54d1e) ) + + ROM_REGION(0x10000,"maincpu",0) + ROM_LOAD("3420033a.256", 0x0000, 0x8000, CRC(c8b979b3) SHA1(10767e96cc17bad0970afda3a4146564e6272ba1)) + + ROM_REGION( 0x800, "keyboard", ROMREGION_ERASE00 ) + ROM_LOAD( "342-0326-a.f12", 0x0000, 0x0800, BAD_DUMP CRC(f04970a9) SHA1(806a602195c18ffec637c03b6bb3405188b0dc1e) ) // merged French half of 341-0326-a.f12 with QWERTY 341-0150-a.e12 +ROM_END + ROM_START(apple2c3) ROM_REGION(0x2000,"gfx1",0) ROM_LOAD ( "341-0265-a.chr", 0x0000, 0x1000,CRC(2651014d) SHA1(b2b5d87f52693817fc747df087a4aa1ddcdb1f10)) @@ -5629,6 +5698,28 @@ ROM_START(apple2c3) ROM_LOAD( "342-0132-c.e12", 0x000, 0x800, CRC(e47045f4) SHA1(12a2e718f5f4acd69b6c33a45a4a940b1440a481) ) // 1983 US-Dvorak ROM_END +ROM_START(apple2c3uk) + ROM_REGION(0x2000,"gfx1",0) + ROM_LOAD("342-0273-a.chr", 0x0000, 0x2000, CRC(9157085a) SHA1(85479a509d6c8176949a5b20720567b7022aa631)) + + ROM_REGION(0x10000,"maincpu",0) + ROM_LOAD("342-0445-a.256", 0x0000, 0x8000, CRC(bc5a79ff) SHA1(5338d9baa7ae202457b6500fde5883dbdc86e5d3)) + + ROM_REGION( 0x800, "keyboard", 0 ) + ROM_LOAD("341-0150-a.e12", 0x000, 0x800, CRC(66ffacd7) SHA1(47bb9608be38ff75429a989b930a93b47099648e)) +ROM_END + +ROM_START(apple2c3fr) + ROM_REGION(0x2000,"gfx1",0) + ROM_LOAD( "342-0274-a.e9", 0x0000, 0x2000, CRC(8f342081) SHA1(c81c1bbf237e70f8c3e5eef3c8fd5bd9b9f54d1e) ) + + ROM_REGION(0x10000,"maincpu",0) + ROM_LOAD("342-0445-a.256", 0x0000, 0x8000, CRC(bc5a79ff) SHA1(5338d9baa7ae202457b6500fde5883dbdc86e5d3)) + + ROM_REGION( 0x800, "keyboard", ROMREGION_ERASE00 ) + ROM_LOAD( "342-0326-a.f12", 0x0000, 0x0800, BAD_DUMP CRC(f04970a9) SHA1(806a602195c18ffec637c03b6bb3405188b0dc1e) ) // merged French half of 341-0326-a.f12 with QWERTY 341-0150-a.e12 +ROM_END + ROM_START(apple2c4) ROM_REGION(0x2000,"gfx1",0) ROM_LOAD ( "341-0265-a.chr", 0x0000, 0x1000,CRC(2651014d) SHA1(b2b5d87f52693817fc747df087a4aa1ddcdb1f10)) @@ -5641,6 +5732,28 @@ ROM_START(apple2c4) ROM_LOAD( "342-0132-c.e12", 0x000, 0x800, CRC(e47045f4) SHA1(12a2e718f5f4acd69b6c33a45a4a940b1440a481) ) // 1983 US-Dvorak ROM_END +ROM_START(apple2c4uk) + ROM_REGION(0x2000,"gfx1",0) + ROM_LOAD("342-0273-a.chr", 0x0000, 0x2000, CRC(9157085a) SHA1(85479a509d6c8176949a5b20720567b7022aa631)) + + ROM_REGION(0x10000,"maincpu",0) + ROM_LOAD("3410445b.256", 0x0000, 0x8000, CRC(06f53328) SHA1(015061597c4cda7755aeb88b735994ffd2f235ca)) + + ROM_REGION( 0x800, "keyboard", 0 ) + ROM_LOAD("341-0150-a.e12", 0x000, 0x800, CRC(66ffacd7) SHA1(47bb9608be38ff75429a989b930a93b47099648e)) +ROM_END + +ROM_START(apple2c4fr) + ROM_REGION(0x2000,"gfx1",0) + ROM_LOAD( "342-0274-a.e9", 0x0000, 0x2000, CRC(8f342081) SHA1(c81c1bbf237e70f8c3e5eef3c8fd5bd9b9f54d1e) ) + + ROM_REGION(0x10000,"maincpu",0) + ROM_LOAD("3410445b.256", 0x0000, 0x8000, CRC(06f53328) SHA1(015061597c4cda7755aeb88b735994ffd2f235ca)) + + ROM_REGION( 0x800, "keyboard", ROMREGION_ERASE00 ) + ROM_LOAD( "342-0326-a.f12", 0x0000, 0x0800, BAD_DUMP CRC(f04970a9) SHA1(806a602195c18ffec637c03b6bb3405188b0dc1e) ) // merged French half of 341-0326-a.f12 with QWERTY 341-0150-a.e12 +ROM_END + ROM_START(laser128) ROM_REGION(0x2000,"gfx1",0) ROM_LOAD( "laser 128 video rom vt27-0706-0.bin", 0x0800, 0x0800, CRC(7884cc0f) SHA1(693a0a66191465825b8f7b5e746b463f3000e9cc) ) @@ -5898,32 +6011,43 @@ ROM_END } // anonymous namespace -/* YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME */ -COMP( 1983, apple2e, 0, apple2, apple2e, apple2e, apple2e_state, empty_init, "Apple Computer", "Apple //e", MACHINE_SUPPORTS_SAVE ) -COMP( 1983, apple2euk, apple2e, 0, apple2epal, apple2euk, apple2e_state, init_pal, "Apple Computer", "Apple //e (UK)", MACHINE_SUPPORTS_SAVE ) -COMP( 1983, apple2ees, apple2e, 0, apple2epal, apple2ees, apple2e_state, init_pal, "Apple Computer", "Apple //e (Spain)", MACHINE_SUPPORTS_SAVE ) -COMP( 1983, mprof3, apple2e, 0, mprof3, apple2e, apple2e_state, empty_init, "Multitech", "Microprofessor III", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) -COMP( 1985, apple2ee, apple2e, 0, apple2ee, apple2e, apple2e_state, empty_init, "Apple Computer", "Apple //e (enhanced)", MACHINE_SUPPORTS_SAVE ) -COMP( 1985, apple2eeuk, apple2e, 0, apple2eepal, apple2euk, apple2e_state, init_pal, "Apple Computer", "Apple //e (enhanced, UK)", MACHINE_SUPPORTS_SAVE ) -COMP( 1985, apple2eefr, apple2e, 0, apple2eepal, apple2efr, apple2e_state, init_pal, "Apple Computer", "Apple //e (enhanced, France)", MACHINE_SUPPORTS_SAVE ) -COMP( 1987, apple2ep, apple2e, 0, apple2ep, apple2ep, apple2e_state, empty_init, "Apple Computer", "Apple //e (Platinum)", MACHINE_SUPPORTS_SAVE ) -COMP( 1984, apple2c, 0, apple2, apple2c, apple2c, apple2e_state, empty_init, "Apple Computer", "Apple //c" , MACHINE_SUPPORTS_SAVE ) -COMP( 1985?,spectred, apple2e, 0, spectred, apple2e, apple2e_state, empty_init, "Scopus/Spectrum", "Spectrum ED" , MACHINE_SUPPORTS_SAVE ) -COMP( 1986, tk3000, apple2c, 0, tk3000, apple2e, apple2e_state, empty_init, "Microdigital", "TK3000//e" , MACHINE_SUPPORTS_SAVE ) -COMP( 1989, prav8c, apple2e, 0, apple2e, apple2e, apple2e_state, empty_init, "Pravetz", "Pravetz 8C", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) -COMP( 1987, laser128, apple2c, 0, laser128, laser128, apple2e_state, init_laser128, "Video Technology", "Laser 128", MACHINE_SUPPORTS_SAVE ) -COMP( 1987, laser128o, apple2c, 0, laser128o, laser128, apple2e_state, init_laser128, "Video Technology", "Laser 128 (original hardware)", MACHINE_SUPPORTS_SAVE ) -COMP( 1988, las128ex, apple2c, 0, laser128, laser128, apple2e_state, init_128ex, "Video Technology", "Laser 128ex (version 4.5)", MACHINE_SUPPORTS_SAVE ) -COMP( 1988, las128e2, apple2c, 0, laser128ex2, laser128, apple2e_state, init_128ex, "Video Technology", "Laser 128ex2 (version 6.1)", MACHINE_SUPPORTS_SAVE ) -COMP( 1985, apple2c0, apple2c, 0, apple2c_iwm, apple2c, apple2e_state, empty_init, "Apple Computer", "Apple //c (UniDisk 3.5)", MACHINE_SUPPORTS_SAVE ) -COMP( 1986, apple2c3, apple2c, 0, apple2c_mem, apple2c, apple2e_state, empty_init, "Apple Computer", "Apple //c (Original Memory Expansion)", MACHINE_SUPPORTS_SAVE ) -COMP( 1986, apple2c4, apple2c, 0, apple2c_mem, apple2c, apple2e_state, empty_init, "Apple Computer", "Apple //c (rev 4)", MACHINE_SUPPORTS_SAVE ) -COMP( 1987, ceci, 0, apple2, cec, ceci, apple2e_state, empty_init, "Shaanxi Province Computer Factory", "China Education Computer I", MACHINE_SUPPORTS_SAVE ) -COMP( 1989, cece, 0, apple2, cec, ceci, apple2e_state, empty_init, "Shaanxi Province Computer Factory", "China Education Computer E", MACHINE_SUPPORTS_SAVE ) -COMP( 1989, cecg, 0, apple2, cec, ceci, apple2e_state, empty_init, "Shaanxi Province Computer Factory", "China Education Computer G", MACHINE_SUPPORTS_SAVE ) -COMP( 1989, cecm, 0, apple2, cec, cecm, apple2e_state, empty_init, "Shaanxi Province Computer Factory", "China Education Computer M", MACHINE_SUPPORTS_SAVE ) -COMP( 1991, cec2000, 0, apple2, cec, ceci, apple2e_state, empty_init, "Shaanxi Province Computer Factory", "China Education Computer 2000", MACHINE_SUPPORTS_SAVE ) -COMP( 1989, zijini, 0, apple2, cec, zijini, apple2e_state, empty_init, "Nanjing Computer Factory", "Zi Jin I", MACHINE_SUPPORTS_SAVE ) -COMP( 1988, apple2cp, apple2c, 0, apple2cp, apple2cp, apple2e_state, empty_init, "Apple Computer", "Apple //c Plus", MACHINE_SUPPORTS_SAVE ) -COMP( 1985, ace2200, apple2e, 0, ace2200, ace500, apple2e_state, init_ace2200,"Franklin Computer", "Franklin ACE 2200", MACHINE_SUPPORTS_SAVE) -COMP( 1986, ace500, apple2c, 0, ace500, ace500, apple2e_state, init_ace500,"Franklin Computer", "Franklin ACE 500", MACHINE_SUPPORTS_SAVE) +/* YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME */ +COMP( 1983, apple2e, 0, apple2, apple2e, apple2eus, apple2e_state, empty_init, "Apple Computer", "Apple //e", MACHINE_SUPPORTS_SAVE ) +COMP( 1983, apple2euk, apple2e, 0, apple2epal, apple2euk, apple2e_state, init_pal, "Apple Computer", "Apple //e (UK)", MACHINE_SUPPORTS_SAVE ) +COMP( 1983, apple2efr, apple2e, 0, apple2epal, apple2efr, apple2e_state, init_pal, "Apple Computer", "Apple //e (France)", MACHINE_SUPPORTS_SAVE ) +COMP( 1983, apple2ees, apple2e, 0, apple2epal, apple2ees, apple2e_state, init_pal, "Apple Computer", "Apple //e (Spain)", MACHINE_SUPPORTS_SAVE ) +COMP( 1983, mprof3, apple2e, 0, mprof3, apple2e, apple2e_state, empty_init, "Multitech", "Microprofessor III", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) +COMP( 1985, apple2ee, apple2e, 0, apple2ee, apple2eus, apple2e_state, empty_init, "Apple Computer", "Apple //e (enhanced)", MACHINE_SUPPORTS_SAVE ) +COMP( 1985, apple2eeuk, apple2e, 0, apple2eepal, apple2euk, apple2e_state, init_pal, "Apple Computer", "Apple //e (enhanced, UK)", MACHINE_SUPPORTS_SAVE ) +COMP( 1985, apple2eefr, apple2e, 0, apple2eepal, apple2eefr, apple2e_state, init_pal, "Apple Computer", "Apple //e (enhanced, France)", MACHINE_SUPPORTS_SAVE ) +COMP( 1987, apple2ep, apple2e, 0, apple2ep, apple2epus, apple2e_state, empty_init, "Apple Computer", "Apple //e (Platinum)", MACHINE_SUPPORTS_SAVE ) +COMP( 1987, apple2epuk, apple2e, 0, apple2eppal, apple2epuk, apple2e_state, init_pal, "Apple Computer", "Apple //e (Platinum, UK)", MACHINE_SUPPORTS_SAVE ) +COMP( 1987, apple2epfr, apple2e, 0, apple2eppal, apple2epfr, apple2e_state, init_pal, "Apple Computer", "Apple //e (Platinum, France)", MACHINE_SUPPORTS_SAVE ) +COMP( 1984, apple2c, 0, apple2, apple2c, apple2cus, apple2e_state, empty_init, "Apple Computer", "Apple //c" , MACHINE_SUPPORTS_SAVE ) +COMP( 1984, apple2cuk, apple2c, 0, apple2cpal, apple2cuk, apple2e_state, init_pal, "Apple Computer", "Apple //c (UK)" , MACHINE_SUPPORTS_SAVE ) +COMP( 1984, apple2cfr, apple2c, 0, apple2cpal, apple2cfr, apple2e_state, init_pal, "Apple Computer", "Apple //c (France)" , MACHINE_SUPPORTS_SAVE ) +COMP( 1985?,spectred, apple2e, 0, spectred, spectred, apple2e_state, empty_init, "Scopus/Spectrum", "Spectrum ED" , MACHINE_SUPPORTS_SAVE ) +COMP( 1986, tk3000, apple2c, 0, tk3000, tk3000, apple2e_state, empty_init, "Microdigital", "TK3000//e" , MACHINE_SUPPORTS_SAVE ) +COMP( 1989, prav8c, apple2e, 0, apple2e, prav8c, apple2e_state, empty_init, "Pravetz", "Pravetz 8C", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) +COMP( 1987, laser128, apple2c, 0, laser128, laser128, apple2e_state, init_laser128, "Video Technology", "Laser 128", MACHINE_SUPPORTS_SAVE ) +COMP( 1987, laser128o, apple2c, 0, laser128o, laser128, apple2e_state, init_laser128, "Video Technology", "Laser 128 (original hardware)", MACHINE_SUPPORTS_SAVE ) +COMP( 1988, las128ex, apple2c, 0, laser128, laser128, apple2e_state, init_128ex, "Video Technology", "Laser 128ex (version 4.5)", MACHINE_SUPPORTS_SAVE ) +COMP( 1988, las128e2, apple2c, 0, laser128ex2, laser128, apple2e_state, init_128ex, "Video Technology", "Laser 128ex2 (version 6.1)", MACHINE_SUPPORTS_SAVE ) +COMP( 1985, apple2c0, apple2c, 0, apple2c_iwm, apple2cus, apple2e_state, empty_init, "Apple Computer", "Apple //c (UniDisk 3.5)", MACHINE_SUPPORTS_SAVE ) +COMP( 1985, apple2c0uk, apple2c, 0, apple2c_iwm_pal, apple2cuk, apple2e_state, init_pal, "Apple Computer", "Apple //c (UniDisk 3.5, UK)", MACHINE_SUPPORTS_SAVE ) +COMP( 1985, apple2c0fr, apple2c, 0, apple2c_iwm_pal, apple2cfr, apple2e_state, init_pal, "Apple Computer", "Apple //c (UniDisk 3.5, France)", MACHINE_SUPPORTS_SAVE ) +COMP( 1986, apple2c3, apple2c, 0, apple2c_mem, apple2cus, apple2e_state, empty_init, "Apple Computer", "Apple //c (Original Memory Expansion)", MACHINE_SUPPORTS_SAVE ) +COMP( 1986, apple2c3uk, apple2c, 0, apple2c_mem_pal, apple2cuk, apple2e_state, init_pal, "Apple Computer", "Apple //c (Original Memory Expansion, UK)", MACHINE_SUPPORTS_SAVE ) +COMP( 1986, apple2c3fr, apple2c, 0, apple2c_mem_pal, apple2cfr, apple2e_state, init_pal, "Apple Computer", "Apple //c (Original Memory Expansion, France)", MACHINE_SUPPORTS_SAVE ) +COMP( 1986, apple2c4, apple2c, 0, apple2c_mem, apple2cus, apple2e_state, empty_init, "Apple Computer", "Apple //c (rev 4)", MACHINE_SUPPORTS_SAVE ) +COMP( 1986, apple2c4uk, apple2c, 0, apple2c_mem_pal, apple2cuk, apple2e_state, init_pal, "Apple Computer", "Apple //c (rev 4, UK)", MACHINE_SUPPORTS_SAVE ) +COMP( 1986, apple2c4fr, apple2c, 0, apple2c_mem_pal, apple2cfr, apple2e_state, init_pal, "Apple Computer", "Apple //c (rev 4, France)", MACHINE_SUPPORTS_SAVE ) +COMP( 1987, ceci, 0, apple2, cec, ceci, apple2e_state, empty_init, "Shaanxi Province Computer Factory", "China Education Computer I", MACHINE_SUPPORTS_SAVE ) +COMP( 1989, cece, 0, apple2, cec, ceci, apple2e_state, empty_init, "Shaanxi Province Computer Factory", "China Education Computer E", MACHINE_SUPPORTS_SAVE ) +COMP( 1989, cecg, 0, apple2, cec, ceci, apple2e_state, empty_init, "Shaanxi Province Computer Factory", "China Education Computer G", MACHINE_SUPPORTS_SAVE ) +COMP( 1989, cecm, 0, apple2, cec, cecm, apple2e_state, empty_init, "Shaanxi Province Computer Factory", "China Education Computer M", MACHINE_SUPPORTS_SAVE ) +COMP( 1991, cec2000, 0, apple2, cec, ceci, apple2e_state, empty_init, "Shaanxi Province Computer Factory", "China Education Computer 2000", MACHINE_SUPPORTS_SAVE ) +COMP( 1989, zijini, 0, apple2, cec, zijini, apple2e_state, empty_init, "Nanjing Computer Factory", "Zi Jin I", MACHINE_SUPPORTS_SAVE ) +COMP( 1988, apple2cp, apple2c, 0, apple2cp, apple2cp, apple2e_state, empty_init, "Apple Computer", "Apple //c Plus", MACHINE_SUPPORTS_SAVE ) +COMP( 1985, ace2200, apple2e, 0, ace2200, ace2200, apple2e_state, init_ace2200, "Franklin Computer", "Franklin ACE 2200", MACHINE_SUPPORTS_SAVE) +COMP( 1986, ace500, apple2c, 0, ace500, ace500, apple2e_state, init_ace500, "Franklin Computer", "Franklin ACE 500", MACHINE_SUPPORTS_SAVE) diff --git a/src/mame/apple/apple2video.cpp b/src/mame/apple/apple2video.cpp index 7dcbe708e25..d6e5692ceef 100644 --- a/src/mame/apple/apple2video.cpp +++ b/src/mame/apple/apple2video.cpp @@ -399,6 +399,10 @@ unsigned a2_video_device::get_text_character(uint32_t code, int row) invert_mask ^= 0x7f; // and flip the color } } + if (Model == model::IIE) + { + code |= get_iie_langsw() * 0x100; + } } else // original II and II Plus { diff --git a/src/mame/apple/apple2video.h b/src/mame/apple/apple2video.h index e602e7e9b31..91aeeaf3978 100644 --- a/src/mame/apple/apple2video.h +++ b/src/mame/apple/apple2video.h @@ -71,6 +71,9 @@ class a2_video_device : public device_t, public device_palette_interface, public uint32_t screen_update_GS(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + void set_iie_langsw(u8 iie_langsw) { m_iie_langsw = iie_langsw; } + u8 get_iie_langsw() const { return m_iie_langsw; } + protected: a2_video_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock); @@ -121,6 +124,7 @@ class a2_video_device : public device_t, public device_palette_interface, public bool m_80store = false; bool m_monohgr = false; u8 m_GSfg = 0, m_GSbg = 0, m_GSborder = 0, m_newvideo = 0, m_monochrome = 0, m_rgbmode = 0; + u8 m_iie_langsw = 0; // language switch/modification on IIe/IIc/IIc+ and clones optional_ioport m_vidconfig; }; diff --git a/src/mame/aristocrat/aristmk4.cpp b/src/mame/aristocrat/aristmk4.cpp index 47fc6a7ed38..86b0e9ffce5 100644 --- a/src/mame/aristocrat/aristmk4.cpp +++ b/src/mame/aristocrat/aristmk4.cpp @@ -1735,7 +1735,7 @@ void aristmk4_state::aristmk4_palette(palette_device &palette) const for (int i = 0; i < palette.entries(); i++) { const uint8_t data = color_prom[i]; - const int b = 0x4f * BIT(data, 0) + 0xa8 * BIT(data, 1); + const int b = 0x52 * BIT(data, 0) + 0xad * BIT(data, 1); const int g = 0x21 * BIT(data, 2) + 0x47 * BIT(data, 3) + 0x97 * BIT(data, 4); const int r = 0x21 * BIT(data, 5) + 0x47 * BIT(data, 6) + 0x97 * BIT(data, 7); @@ -1884,9 +1884,9 @@ void aristmk4_state::lions_palette(palette_device &palette) const { for (int i = 0; i < palette.entries(); i++) { - const int b = 0x4f * BIT(i, 0) + 0xa8 * BIT(i, 1); - const int g = 0x4f * BIT(i, 2) + 0xa8 * BIT(i, 3); - const int r = 0x4f * BIT(i, 4) + 0xa8 * BIT(i, 5); + const int b = 0x52 * BIT(i, 0) + 0xad * BIT(i, 1); + const int g = 0x52 * BIT(i, 2) + 0xad * BIT(i, 3); + const int r = 0x52 * BIT(i, 4) + 0xad * BIT(i, 5); palette.set_pen_color(i, rgb_t(r, g, b)); } diff --git a/src/mame/capcom/cps1.cpp b/src/mame/capcom/cps1.cpp index 9ce6edefa5b..44a2abebc0b 100644 --- a/src/mame/capcom/cps1.cpp +++ b/src/mame/capcom/cps1.cpp @@ -13898,7 +13898,6 @@ ROM_START( pang3b5 ) ROM_LOAD( "c632.ic1", 0x0200, 0x0117, CRC(0fbd9270) SHA1(d7e737b20c44d41e29ca94be56114b31934dde81) ) ROM_END - /* B-Board 91635B-2 */ /* Note that this USA set seems to be the only one where GFX are stored into EPROMs instead of the usual mask ROMs. */ ROM_START( megaman ) @@ -14431,6 +14430,43 @@ ROM_START( sfzbch ) ROM_LOAD( "sfz63b.1a", 0x0000, 0x0104, CRC(f5a351da) SHA1(a867947d784167b5284efb76a8634ca5713dafdb) ) ROM_END +ROM_START( cps1mult ) + ROM_REGION( 0x4000000, "maincpu", 0 ) /* 68000 code */ + ROM_LOAD16_WORD_SWAP( "prg_0.bin", 0x0000000, 0x800000, CRC(cbb4062c) SHA1(468bd4c381da299491807daad0a2f1a4128d8fce) ) + ROM_LOAD16_WORD_SWAP( "prg_1.bin", 0x0800000, 0x800000, CRC(e434b882) SHA1(d66c92aaaf43e37fc224013e4c93dc02550616e6) ) + ROM_LOAD16_WORD_SWAP( "prg_2.bin", 0x1000000, 0x800000, CRC(2ce2fc75) SHA1(0fc038f0188e91e3490c127877a17b57f5bb10fd) ) + ROM_LOAD16_WORD_SWAP( "prg_3.bin", 0x1800000, 0x800000, CRC(0a93b43e) SHA1(bf3669c3970beacabbe4876d6d302ddcb531aa21) ) + ROM_LOAD16_WORD_SWAP( "prg_4.bin", 0x2000000, 0x800000, CRC(80b6dfb3) SHA1(332daea56d4dc00cceea8b84d9a0872de7f5f48d) ) + ROM_LOAD16_WORD_SWAP( "prg_5.bin", 0x2800000, 0x800000, CRC(bfa503e7) SHA1(0efecaf34832e6db5aad429513df1188a1086e6a) ) + ROM_LOAD16_WORD_SWAP( "prg_6.bin", 0x3000000, 0x800000, CRC(977d2d34) SHA1(1b9ed488f600aa3352ad6a4ce88b385a44f5b598) ) + ROM_LOAD16_WORD_SWAP( "prg_7.bin", 0x3800000, 0x800000, CRC(65b0d8fd) SHA1(1ae4bf558c5884b4429a6bd1b3130076bf0de47a) ) + + ROM_REGION( 0x8000000, "gfx", 0 ) + ROM_LOAD( "ca_0.bin", 0x0000000, 0x0800000, CRC(6819f572) SHA1(08026fe527a3e3e98c4b490f677a6daad9013752) ) + ROM_LOAD( "ca_1.bin", 0x0800000, 0x0800000, CRC(f18256d2) SHA1(0ba49b2f1abc67a08965e43df70aed42b3bc1c31) ) + ROM_LOAD( "ca_2.bin", 0x1000000, 0x0800000, CRC(1f474165) SHA1(c0c3632c1dbadeaea1334cfe8954d091458d773a) ) + ROM_LOAD( "ca_3.bin", 0x1800000, 0x0800000, CRC(1f7f36a7) SHA1(33fb5e280111ce7f1dcf18093285d8834ac76be9) ) + ROM_LOAD( "ca_4.bin", 0x2000000, 0x0800000, CRC(b6c2ae5c) SHA1(e7769bb593d37934280bf7d16d95b867854d4a4b) ) + ROM_LOAD( "ca_5.bin", 0x2800000, 0x0800000, CRC(68e7b97e) SHA1(f2457e0341d8571a81f31497f7a54c6b9b312276) ) + ROM_LOAD( "ca_6.bin", 0x3000000, 0x0800000, CRC(d7df2079) SHA1(ab1ae0fa4b8f3db1390b7504e62b2db2540ab003) ) + ROM_LOAD( "ca_7.bin", 0x3800000, 0x0800000, CRC(76c35a1f) SHA1(8139a759ba9edaad44962a73f494e2af20a49787) ) + ROM_LOAD( "cb_0.bin", 0x4000000, 0x0800000, CRC(c9ca6efc) SHA1(7c2c8b62fd2e10e968e7f739536ba0bc99826ffe) ) + ROM_LOAD( "cb_1.bin", 0x4800000, 0x0800000, CRC(c53de0e5) SHA1(518407210e3afcc43dea776f0cafe735f5b1d0fb) ) + ROM_LOAD( "cb_2.bin", 0x5000000, 0x0800000, CRC(2934a28c) SHA1(ab0a800adee07d485fd2b93be3f56d49cf18078f) ) + ROM_LOAD( "cb_3.bin", 0x5800000, 0x0800000, CRC(ca41ae19) SHA1(ef8fc3b2f7027be4431bcd5954490392b40af329) ) + ROM_LOAD( "cb_4.bin", 0x6000000, 0x0800000, CRC(b9ea6163) SHA1(9759ee1ec434406c1640743266a8576ca112dd92) ) + ROM_LOAD( "cb_5.bin", 0x6800000, 0x0800000, CRC(74a402f2) SHA1(1d04ae19d0ed81532a01c8c069267fc6474fabdd) ) + ROM_LOAD( "cb_6.bin", 0x7000000, 0x0800000, CRC(73f471e1) SHA1(d0a56fb43c0b8f37d60c728bd4fc8abeeb294774) ) + ROM_LOAD( "cb_7.bin", 0x7800000, 0x0800000, CRC(7570e1f0) SHA1(e19243d21ee126c62f5e96150dd04c1ff8a18868) ) + + ROM_REGION( 0x100000, "audiocpu", 0 ) + ROM_LOAD( "m1_074733.bin", 0x000000, 0x100000, CRC(fbb43b64) SHA1(099e02ba2e3e2b04bb99144009927dac584f89f0) ) + + ROM_REGION( 0x400000, "oki", 0 ) /* Samples */ + ROM_LOAD( "mx29f1610mcpsop44.u18", 0x000000, 0x200000, CRC(69cd2a53) SHA1(f5d78d7f4a807d5124cc8d48e57d283c3ddf972b) ) + ROM_LOAD( "mx29f1610mcpsop44.u19a", 0x200000, 0x200000, CRC(4a0cebaa) SHA1(9384780fad82310122ac930bafe2e2c48b562676) ) +ROM_END + uint16_t cps_state::sf2rb_prot_r(offs_t offset) { @@ -14661,8 +14697,28 @@ void cps_state::init_pang3() init_pang3b(); } +void cps_state::init_cps1mult() +{ + init_cps1(); + + uint8_t *rom = memregion("maincpu")->base(); + int rom_size = memregion("maincpu")->bytes(); + std::vector buffer(rom_size); + memcpy(&buffer[0], rom, rom_size); + + for (int i = 0; i < rom_size; i++) + rom[i] = buffer[bitswap<28>(i, 27, 26, 18, 23, 16, 17, 21, 24, 19, 25, 22, 20, 5, 6, 7, 8, 13, 15, 14, 9, 10, 12, 11, 1, 2, 3, 4, 0)]; + + uint8_t *gfxrom = memregion("gfx")->base(); + rom_size = memregion("gfx")->bytes(); + std::vector gfxbuffer(rom_size); + memcpy(&gfxbuffer[0], gfxrom, rom_size); + for (int i = 0; i < rom_size; i++) + gfxrom[i] = gfxbuffer[bitswap<28>(i, 27, 1, 20, 21, 18, 19, 23, 25, 2, 26, 24, 22, 7, 8, 9, 10, 15, 17, 16, 11, 12, 14, 13, 3, 4, 5, 6, 0)]; // TODO: 25 and 26 to be verified +} + /* -Pang 3b4 - code accesso to $5762b0 and $57a2b0 (PIC) +Pang 3b4 - code access to $5762b0 and $57a2b0 (PIC) --------- Dip switch decoding --------- 0E001A: move.b $80001c.l, D0 ; !Dip switch B @@ -15068,4 +15124,7 @@ CONS( 1995, sfzch, 0, 0, cps1_12MHz, sfzch, cps_state, init_cps1, "Capcom", CONS( 1995, sfach, sfzch, 0, cps1_12MHz, sfzch, cps_state, init_cps1, "Capcom", "Street Fighter Alpha: Warriors' Dreams (CPS Changer, Publicity USA 950727)", MACHINE_SUPPORTS_SAVE ) CONS( 1995, sfzbch, sfzch, 0, cps1_12MHz, sfzch, cps_state, init_cps1, "Capcom", "Street Fighter Zero (CPS Changer, Brazil 950727)", MACHINE_SUPPORTS_SAVE ) +/* CPS1 multi game bootleg */ +GAME( 20??, cps1mult, 0, cps1_12MHz, sf2, cps_state, init_cps1mult, ROT0, "bootleg", "CPS1 Multi Game", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) // needs game selection support via DIP switches + // Ken Sei Mogura: Street Fighter II - see capcom/kenseim.cpp diff --git a/src/mame/capcom/cps1.h b/src/mame/capcom/cps1.h index f0586ffed64..acc3a12b34a 100644 --- a/src/mame/capcom/cps1.h +++ b/src/mame/capcom/cps1.h @@ -149,6 +149,7 @@ class cps_state : public driver_device void varthb3(machine_config &config); void init_cps1(); + void init_cps1mult(); void init_sf2ee(); void init_wof(); void init_dino(); diff --git a/src/mame/capcom/cps1_v.cpp b/src/mame/capcom/cps1_v.cpp index b6981fc02a5..210dcc7e072 100644 --- a/src/mame/capcom/cps1_v.cpp +++ b/src/mame/capcom/cps1_v.cpp @@ -2013,6 +2013,9 @@ static const struct CPS1config cps1_config_table[]= {"kenseim", CPS_B_21_DEF, mapper_KNM10B }, + /* CPS1 multi game bootleg */ + {"cps1mult", CPS_B_21_DEF, mapper_CP1B1F }, // TODO: not correct for all games + {nullptr} /* End of table */ }; diff --git a/src/mame/capcom/cps2.cpp b/src/mame/capcom/cps2.cpp index 08ae5963e14..289e78e7208 100644 --- a/src/mame/capcom/cps2.cpp +++ b/src/mame/capcom/cps2.cpp @@ -3793,10 +3793,10 @@ ROM_END ROM_START( ddsomjr1 ) ROM_REGION( CODE_SIZE, "maincpu", 0 ) // 68000 code - ROM_LOAD16_WORD_SWAP( "dd2j.03b", 0x000000, 0x80000, CRC(965d74e5) SHA1(d7aa1b78043cdf09ee71a6dd5fe78e0588ca7875) ) - ROM_LOAD16_WORD_SWAP( "dd2j.04b", 0x080000, 0x80000, CRC(958eb8f3) SHA1(3d9747bc9091b0b42c953a19992b94cb2bf69159) ) - ROM_LOAD16_WORD_SWAP( "dd2.05b", 0x100000, 0x80000, CRC(d38571ca) SHA1(f0105a4f201e11f489e44c8061b0025de2e32f93) ) - ROM_LOAD16_WORD_SWAP( "dd2.06b", 0x180000, 0x80000, CRC(6d5a3bbb) SHA1(549e31398e706a80d41db6600555e27e902c335c) ) + ROM_LOAD16_WORD_SWAP( "dd2j.03e", 0x000000, 0x80000, CRC(b2fd4a24) SHA1(6b5bd11e665e84a9de56d167a5d8957a3a967f8c) ) + ROM_LOAD16_WORD_SWAP( "dd2j.04e", 0x080000, 0x80000, CRC(3a68c310) SHA1(8806ea2765e82f396158f0ae8a906cda90bd3472) ) + ROM_LOAD16_WORD_SWAP( "dd2.05e", 0x100000, 0x80000, CRC(aa56f42f) SHA1(2795a1c8978c5f459daaca57985c24027139d7e1) ) + ROM_LOAD16_WORD_SWAP( "dd2.06e", 0x180000, 0x80000, CRC(2f8cd040) SHA1(f2ec09d06432a5f44dd85557d94b35d01b0ece6a) ) ROM_LOAD16_WORD_SWAP( "dd2.07", 0x200000, 0x80000, CRC(909a0b8b) SHA1(58bda17c36063a79df8b5031755c7909a9bda221) ) ROM_LOAD16_WORD_SWAP( "dd2.08", 0x280000, 0x80000, CRC(e53c4d01) SHA1(bad872e4e793a39f68bc0e580772e982714b5876) ) ROM_LOAD16_WORD_SWAP( "dd2.09", 0x300000, 0x80000, CRC(5f86279f) SHA1(c2a454e5f821b1cdd49f2cf0602e9bfb7ba63340) ) @@ -3827,10 +3827,10 @@ ROM_END ROM_START( ddsomjr2 ) ROM_REGION( CODE_SIZE, "maincpu", 0 ) // 68000 code - ROM_LOAD16_WORD_SWAP( "dd2j.03b", 0x000000, 0x80000, CRC(b2fd4a24) SHA1(6b5bd11e665e84a9de56d167a5d8957a3a967f8c) ) - ROM_LOAD16_WORD_SWAP( "dd2j.04b", 0x080000, 0x80000, CRC(3a68c310) SHA1(8806ea2765e82f396158f0ae8a906cda90bd3472) ) - ROM_LOAD16_WORD_SWAP( "dd2.05b", 0x100000, 0x80000, CRC(aa56f42f) SHA1(2795a1c8978c5f459daaca57985c24027139d7e1) ) - ROM_LOAD16_WORD_SWAP( "dd2.06b", 0x180000, 0x80000, CRC(2f8cd040) SHA1(f2ec09d06432a5f44dd85557d94b35d01b0ece6a) ) + ROM_LOAD16_WORD_SWAP( "dd2j.03b", 0x000000, 0x80000, CRC(965d74e5) SHA1(d7aa1b78043cdf09ee71a6dd5fe78e0588ca7875) ) + ROM_LOAD16_WORD_SWAP( "dd2j.04b", 0x080000, 0x80000, CRC(958eb8f3) SHA1(3d9747bc9091b0b42c953a19992b94cb2bf69159) ) + ROM_LOAD16_WORD_SWAP( "dd2.05b", 0x100000, 0x80000, CRC(d38571ca) SHA1(f0105a4f201e11f489e44c8061b0025de2e32f93) ) + ROM_LOAD16_WORD_SWAP( "dd2.06b", 0x180000, 0x80000, CRC(6d5a3bbb) SHA1(549e31398e706a80d41db6600555e27e902c335c) ) ROM_LOAD16_WORD_SWAP( "dd2.07", 0x200000, 0x80000, CRC(909a0b8b) SHA1(58bda17c36063a79df8b5031755c7909a9bda221) ) ROM_LOAD16_WORD_SWAP( "dd2.08", 0x280000, 0x80000, CRC(e53c4d01) SHA1(bad872e4e793a39f68bc0e580772e982714b5876) ) ROM_LOAD16_WORD_SWAP( "dd2.09", 0x300000, 0x80000, CRC(5f86279f) SHA1(c2a454e5f821b1cdd49f2cf0602e9bfb7ba63340) ) @@ -12717,8 +12717,8 @@ GAME( 1996, ddsomr3, ddsom, cps2, cps2_4p4b, cps2_state, init_cps2, GAME( 1996, ddsomu, ddsom, cps2, cps2_4p4b, cps2_state, init_cps2, ROT0, "Capcom", "Dungeons & Dragons: Shadow over Mystara (USA 960619)", MACHINE_SUPPORTS_SAVE ) GAME( 1996, ddsomur1, ddsom, cps2, cps2_4p4b, cps2_state, init_cps2, ROT0, "Capcom", "Dungeons & Dragons: Shadow over Mystara (USA 960209)", MACHINE_SUPPORTS_SAVE ) GAME( 1996, ddsomj, ddsom, cps2, cps2_4p4b, cps2_state, init_cps2, ROT0, "Capcom", "Dungeons & Dragons: Shadow over Mystara (Japan 960619)", MACHINE_SUPPORTS_SAVE ) -GAME( 1996, ddsomjr1, ddsom, cps2, cps2_4p4b, cps2_state, init_cps2, ROT0, "Capcom", "Dungeons & Dragons: Shadow over Mystara (Japan 960206)", MACHINE_SUPPORTS_SAVE ) -GAME( 1996, ddsomjr2, ddsom, cps2, cps2_4p4b, cps2_state, init_cps2, ROT0, "Capcom", "Dungeons & Dragons: Shadow over Mystara (Japan 960223)", MACHINE_SUPPORTS_SAVE ) +GAME( 1996, ddsomjr1, ddsom, cps2, cps2_4p4b, cps2_state, init_cps2, ROT0, "Capcom", "Dungeons & Dragons: Shadow over Mystara (Japan 960223)", MACHINE_SUPPORTS_SAVE ) +GAME( 1996, ddsomjr2, ddsom, cps2, cps2_4p4b, cps2_state, init_cps2, ROT0, "Capcom", "Dungeons & Dragons: Shadow over Mystara (Japan 960206)", MACHINE_SUPPORTS_SAVE ) GAME( 1996, ddsoma, ddsom, cps2, cps2_4p4b, cps2_state, init_cps2, ROT0, "Capcom", "Dungeons & Dragons: Shadow over Mystara (Asia 960619)", MACHINE_SUPPORTS_SAVE ) GAME( 1996, ddsomar1, ddsom, cps2, cps2_4p4b, cps2_state, init_cps2, ROT0, "Capcom", "Dungeons & Dragons: Shadow over Mystara (Asia 960208)", MACHINE_SUPPORTS_SAVE ) GAME( 1996, ddsomh, ddsom, cps2, cps2_4p4b, cps2_state, init_cps2, ROT0, "Capcom", "Dungeons & Dragons: Shadow over Mystara (Hispanic 960223)", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/casio/pickytlk.cpp b/src/mame/casio/pickytlk.cpp index e1fed5cc5d1..bced0df7fb0 100644 --- a/src/mame/casio/pickytlk.cpp +++ b/src/mame/casio/pickytlk.cpp @@ -2,19 +2,16 @@ // copyright-holders:QUFB /*************************************************************************** - Driver for Casio Picky Talk + Driver for Casio Picky Talk and Casio Plet's TODO: - Communication port; - Panel active buttons display; - Review PORT/OPT callbacks copied from CFX9850G; - - Some points of interest can be accessed under the debugger: - - 1. bpset 0x200328 - 2. ip=3fe (clock screen) - 3. ip=410 (main screen) + - Fix unk_F8 loop when viewing calendar in JD-363/JD-364 models; + - Fix busy loop @ 20:2981 in Plet's models; + - Keyboard input for Plet's models; Hardware -------- @@ -26,6 +23,25 @@ - LSI3 (Static RAM): NEC D441000LGZ (1M-bit, 128K-word by 8-bit) - LSI5 (Mask ROM): NEC D23C8000XGX-C64 (8M-bit, 1M-word by 8-bit, pin compatible with AMD AM29F800B) + Plet's (MK-300): + + - PCB revision: A141252-1 Z836-1 + - LSI1 (CPU): Unknown (instruction set compatible with Hitachi HCD62121) + - LSI3 (Static RAM): Toshiba TC551001BFL-10V (1M-bit, 128K-word by 8-bit) + - LSI5 (Mask ROM): NEC D23C8000XGX-C77 (8M-bit, 1M-word by 8-bit, pin compatible with AMD AM29F800B) + + Plet's (MK-350): + + - PCB revision: A141252-1 Z836-1 + - LSI1 (CPU): Unknown (instruction set compatible with Hitachi HCD62121) + - LSI3 (Static RAM): NEC D441000LGW-B85X + - LSI5 (Mask ROM): Oki M538032E-48 + + Hidden Features + --------------- + + [JD-370] On the debugger, run "bpset 20adb2,,{ ip=20ad27; g; }" to access an unused test program. + ***************************************************************************/ #include "emu.h" @@ -46,10 +62,10 @@ namespace { -class pickytlk_state : public driver_device +class pickytlk_base_state : public driver_device { public: - pickytlk_state(const machine_config &mconfig, device_type type, const char *tag) + pickytlk_base_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag) , m_display_ram(*this, "display_ram") , m_maincpu(*this, "maincpu") @@ -68,7 +84,7 @@ class pickytlk_state : public driver_device ioport_value pen_y_rescale_r(); ioport_value pen_target_r(); -private: +protected: enum pen_target : u8 { PEN_TARGET_LCD = 0, @@ -96,11 +112,11 @@ class pickytlk_state : public driver_device TIMER_CALLBACK_MEMBER(io_timer_tick); u8 io_pen_x_read(); u8 io_pen_y_read(); - u8 tablet_read(offs_t offset); + virtual u8 tablet_read(offs_t offset); void tablet_write(offs_t offset, u8 data); + virtual void pickytlk_layout(machine_config &config); void update_crosshair(screen_device &screen); - void pickytlk_palette(palette_device &palette) const; u32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void pickytlk_mem(address_map &map) ATTR_COLD; @@ -128,19 +144,19 @@ class pickytlk_state : public driver_device u8 m_pen_target; }; -void pickytlk_state::machine_start() +void pickytlk_base_state::machine_start() { save_item(NAME(m_ko)); save_item(NAME(m_port)); save_item(NAME(m_opt)); m_io_tablet_regs = make_unique_clear(0x100); save_pointer(NAME(m_io_tablet_regs), 0x100); - m_io_timer = timer_alloc(FUNC(pickytlk_state::io_timer_tick), this); + m_io_timer = timer_alloc(FUNC(pickytlk_base_state::io_timer_tick), this); save_item(NAME(m_pen_state)); save_item(NAME(m_pen_target)); } -void pickytlk_state::machine_reset() +void pickytlk_base_state::machine_reset() { memset(m_io_tablet_regs.get(), 0, 0x100); m_io_timer->reset(attotime::never); @@ -148,14 +164,14 @@ void pickytlk_state::machine_reset() m_pen_target = PEN_TARGET_LCD; } -CROSSHAIR_MAPPER_MEMBER(pickytlk_state::pen_y_mapper) +CROSSHAIR_MAPPER_MEMBER(pickytlk_base_state::pen_y_mapper) { // Parameter `linear_value` is ignored, since we will read the input port directly // for adjustments, just need to return that value in the expected range [0.0f..1.0f]. return (float) pen_y_rescale_r() / 0xff; } -ioport_value pickytlk_state::pen_y_rescale_r() +ioport_value pickytlk_base_state::pen_y_rescale_r() { /* There are two distinct areas that can be interacted with the pen: @@ -182,25 +198,12 @@ ioport_value pickytlk_state::pen_y_rescale_r() return adjusted_value; } -ioport_value pickytlk_state::pen_target_r() +ioport_value pickytlk_base_state::pen_target_r() { return m_pen_target; } -void pickytlk_state::pickytlk_mem(address_map &map) -{ - map(0x000000, 0x007fff).mirror(0x008000).rom(); - map(0x080000, 0x0807ff).ram(); - map(0x080300, 0x08030f).rw(FUNC(pickytlk_state::tablet_read), FUNC(pickytlk_state::tablet_write)); -// map(0x100000, 0x10ffff) // some memory mapped i/o??? -// map(0x110000, 0x11ffff) // some memory mapped i/o??? - map(0x200000, 0x2fffff).rom().region("mask_rom", 0); - map(0x400000, 0x4007ff).ram().share("display_ram"); - map(0x400800, 0x41ffff).ram(); -// map(0xe10000, 0xe1ffff) // some memory mapped i/o??? -} - -TIMER_CALLBACK_MEMBER(pickytlk_state::io_timer_tick) +TIMER_CALLBACK_MEMBER(pickytlk_base_state::io_timer_tick) { if (m_pen_state == PEN_PRESS) { @@ -208,7 +211,7 @@ TIMER_CALLBACK_MEMBER(pickytlk_state::io_timer_tick) } } -u8 pickytlk_state::io_pen_x_read() +u8 pickytlk_base_state::io_pen_x_read() { // Pen callibration tests seem to check coordinates relative to the center of the LCD screen, // and those offsets also align with the LCD position relative to the full tablet surface. @@ -218,7 +221,7 @@ u8 pickytlk_state::io_pen_x_read() return rescale(io_pen_x_pos, io_pen_x_min, io_pen_x_max, 0x20, 0xdf); } -u8 pickytlk_state::io_pen_y_read() +u8 pickytlk_base_state::io_pen_y_read() { s16 io_pen_y_min = m_io_pen_y->field(0xff)->minval(); s16 io_pen_y_max = m_io_pen_y->field(0xff)->maxval(); @@ -228,77 +231,43 @@ u8 pickytlk_state::io_pen_y_read() : rescale(io_pen_y_pos, io_pen_y_min, io_pen_y_max, 0xa0, 0xf0); } -u8 pickytlk_state::tablet_read(offs_t offset) +u8 pickytlk_base_state::tablet_read(offs_t offset) { - /* - Pen coordinates can return a mirrored value when bit 4 is not set. - Both pairs of values , are approximated from these tests: - - General case: - - x1 + x2 > 0xc8 - - y1 + y2 > 0xc8 - - Reset screen with "OK" prompt: - - x1 > 0x7d - - y1 > 0x7d - - Pen callibration: - - x1 < 0x72 - - x2 < 0x72 - - y1 < 0x64 - - y1 > 0x68 - */ - LOGMASKED(LOG_TABLET, "%s: tablet_read [%02x] = %02x\n", machine().describe_context(), offset, m_io_tablet_regs[offset]); - switch (offset) - { - case 0: - { - u8 y = BIT(m_ko, 7) ? io_pen_y_read() : 0; - LOGMASKED(LOG_TABLET, "%s: pen y = %02x\n", machine().describe_context(), y); - return BIT(m_ko, 4) ? y : (0xff - y); - } - case 1: - { - u8 x = BIT(m_ko, 6) ? io_pen_x_read() : 0; - LOGMASKED(LOG_TABLET, "%s: pen x = %02x\n", machine().describe_context(), x); - return BIT(m_ko, 4) ? x : (0xff - x); - } - case 4: - // Can return 0 if other values are not stable/ready? - return 0x80; - default: - return m_io_tablet_regs[offset]; - } + // Default (overriden by each system) + return 0; } -void pickytlk_state::tablet_write(offs_t offset, u8 data) +void pickytlk_base_state::tablet_write(offs_t offset, u8 data) { LOGMASKED(LOG_TABLET, "%s: tablet_write [%02x] = %02x\n", machine().describe_context(), offset, data); m_io_tablet_regs[offset] = data; } -void pickytlk_state::kol_w(u8 data) +void pickytlk_base_state::kol_w(u8 data) { m_ko = (m_ko & 0xff00) | data; LOGMASKED(LOG_IO, "%s: KO = %04x\n", machine().describe_context(), m_ko); } -void pickytlk_state::koh_w(u8 data) +void pickytlk_base_state::koh_w(u8 data) { m_ko = (m_ko & 0x00ff) | (u16(data) << 8); LOGMASKED(LOG_IO, "%s: KO = %04x\n", machine().describe_context(), m_ko); } -void pickytlk_state::port_w(u8 data) +void pickytlk_base_state::port_w(u8 data) { m_port = data; LOGMASKED(LOG_IO, "%s: PORT = %02x\n", machine().describe_context(), m_port); } -void pickytlk_state::opt_w(u8 data) +void pickytlk_base_state::opt_w(u8 data) { m_opt = data; LOGMASKED(LOG_IO, "%s: OPT = %02x\n", machine().describe_context(), m_opt); } -u8 pickytlk_state::ki_r() +u8 pickytlk_base_state::ki_r() { if (BIT(m_io_buttons->read(), 6)) { @@ -308,7 +277,7 @@ u8 pickytlk_state::ki_r() // FIXME: Adjust delay when more accurate instruction timings are implemented. // Program code waits for input flag to be stable by executing `mov DSIZE,0xff` // then `movq R00,R00` 15 times (see pickytlk ROM @ 2015f6). - m_io_timer->adjust(attotime::from_msec(1), 0, attotime::never); + m_io_timer->adjust(attotime::from_msec(20), 0, attotime::never); } } else @@ -320,7 +289,7 @@ u8 pickytlk_state::ki_r() return m_pen_state == PEN_PRESS ? 0x80 : 0; } -u8 pickytlk_state::in0_r() +u8 pickytlk_base_state::in0_r() { // battery level? // bit4 -> if reset CPU keeps restarting (several unknown instructions before jumping to 0) @@ -332,26 +301,23 @@ u8 pickytlk_state::in0_r() return 0x30 & ~0x00; } -u8 pickytlk_state::input_flag_read() +u8 pickytlk_base_state::input_flag_read() { - return m_pen_state == PEN_HOLD ? 0 : 1; + return m_pen_state == PEN_PRESS || m_pen_state == PEN_HOLD ? 0 : 1; } -void pickytlk_state::update_crosshair(screen_device &screen) +void pickytlk_base_state::pickytlk_layout(machine_config &config) { - // Either screen crosshair or layout view's cursor should be visible at a time. - machine().crosshair().get_crosshair(0).set_screen(m_pen_target ? CROSSHAIR_SCREEN_NONE : &screen); + // Nothing (overriden by each system) } -void pickytlk_state::pickytlk_palette(palette_device &palette) const +void pickytlk_base_state::update_crosshair(screen_device &screen) { - palette.set_pen_color(0, 0xee, 0xee, 0xcc); - palette.set_pen_color(1, 0x11, 0x33, 0x99); - palette.set_pen_color(2, 0x33, 0xcc, 0x77); - palette.set_pen_color(3, 0xee, 0x77, 0x33); + // Either screen crosshair or layout view's cursor should be visible at a time. + machine().crosshair().get_crosshair(0).set_screen(m_pen_target ? CROSSHAIR_SCREEN_NONE : &screen); } -u32 pickytlk_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +u32 pickytlk_base_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { update_crosshair(screen); @@ -388,55 +354,303 @@ static INPUT_PORTS_START(pickytlk) // TODO: On/Off/Reset PORT_START("BUTTONS") PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_PLAYER(1) PORT_NAME("Pen Down") - PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(FUNC(pickytlk_state::pen_target_r)) + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(FUNC(pickytlk_base_state::pen_target_r)) PORT_START("PEN_X") PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_X ) PORT_CROSSHAIR(X, 1.0, 0.0, 0) PORT_SENSITIVITY(30) PORT_KEYDELTA(10) PORT_MINMAX(0, 255) PORT_PLAYER(1) PORT_NAME("Pen X") PORT_START("PEN_Y") - PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_Y ) PORT_CROSSHAIR(Y, 1.0, 0.0, 0) PORT_SENSITIVITY(30) PORT_KEYDELTA(10) PORT_MINMAX(0, 255) PORT_PLAYER(1) PORT_NAME("Pen Y") PORT_CROSSHAIR_MAPPER_MEMBER(FUNC(pickytlk_state::pen_y_mapper)) + PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_Y ) PORT_CROSSHAIR(Y, 1.0, 0.0, 0) PORT_SENSITIVITY(30) PORT_KEYDELTA(10) PORT_MINMAX(0, 255) PORT_PLAYER(1) PORT_NAME("Pen Y") PORT_CROSSHAIR_MAPPER_MEMBER(FUNC(pickytlk_base_state::pen_y_mapper)) PORT_START("PEN_Y_RESCALE") - PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(FUNC(pickytlk_state::pen_y_rescale_r)) + PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(FUNC(pickytlk_base_state::pen_y_rescale_r)) INPUT_PORTS_END -void pickytlk_state::pickytlk(machine_config &config) +void pickytlk_base_state::pickytlk(machine_config &config) { HCD62121(config, m_maincpu, 4300000); /* X1 - 4.3 MHz */ - m_maincpu->set_addrmap(AS_PROGRAM, &pickytlk_state::pickytlk_mem); - m_maincpu->kol_cb().set(FUNC(pickytlk_state::kol_w)); - m_maincpu->koh_cb().set(FUNC(pickytlk_state::koh_w)); - m_maincpu->port_cb().set(FUNC(pickytlk_state::port_w)); - m_maincpu->opt_cb().set(FUNC(pickytlk_state::opt_w)); - m_maincpu->ki_cb().set(FUNC(pickytlk_state::ki_r)); - m_maincpu->in0_cb().set(FUNC(pickytlk_state::in0_r)); - m_maincpu->input_flag_cb().set(FUNC(pickytlk_state::input_flag_read)); + m_maincpu->kol_cb().set(FUNC(pickytlk_base_state::kol_w)); + m_maincpu->koh_cb().set(FUNC(pickytlk_base_state::koh_w)); + m_maincpu->port_cb().set(FUNC(pickytlk_base_state::port_w)); + m_maincpu->opt_cb().set(FUNC(pickytlk_base_state::opt_w)); + m_maincpu->ki_cb().set(FUNC(pickytlk_base_state::ki_r)); + m_maincpu->in0_cb().set(FUNC(pickytlk_base_state::in0_r)); + m_maincpu->input_flag_cb().set(FUNC(pickytlk_base_state::input_flag_read)); screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_LCD)); screen.set_refresh_hz(60); screen.set_size(127, 64); screen.set_visarea(0, 126, 0, 63); - screen.set_screen_update(FUNC(pickytlk_state::screen_update)); + screen.set_screen_update(FUNC(pickytlk_base_state::screen_update)); screen.set_palette("palette"); - // TODO: Verify amount of colors and palette. Colors can be changed by changing the contrast. - PALETTE(config, "palette", FUNC(pickytlk_state::pickytlk_palette), 4); + pickytlk_layout(config); +} + + +class pickytlk_monocolor_state : public pickytlk_base_state +{ +public: + pickytlk_monocolor_state(const machine_config &mconfig, device_type type, const char *tag) + : pickytlk_base_state(mconfig, type, tag) + { } + + void pickytlk_monocolor(machine_config &config); +private: + virtual u8 tablet_read(offs_t offset) override; + virtual void pickytlk_layout(machine_config &config) override; + void pickytlk_mem(address_map &map); + void pickytlk_palette(palette_device &palette) const; +}; + +void pickytlk_monocolor_state::pickytlk_layout(machine_config &config) +{ config.set_default_layout(layout_pickytlk); } +u8 pickytlk_monocolor_state::tablet_read(offs_t offset) +{ + LOGMASKED(LOG_TABLET, "%s: tablet_read [%02x] = %02x\n", machine().describe_context(), offset, m_io_tablet_regs[offset]); -ROM_START(pickytlk) - ROM_REGION(0x8000, "maincpu", 0) + if (BIT(offset, 0)) + { + u8 y = BIT(m_ko, 3) ? io_pen_y_read() : 0; + LOGMASKED(LOG_TABLET, "%s: pen y = %02x\n", machine().describe_context(), y); + return BIT(m_ko, 0) ? y : (0xff - y); + } + else + { + u8 x = BIT(m_ko, 2) ? io_pen_x_read() : 0; + LOGMASKED(LOG_TABLET, "%s: pen x = %02x\n", machine().describe_context(), x); + return BIT(m_ko, 0) ? x : (0xff - x); + } +} + +void pickytlk_monocolor_state::pickytlk_mem(address_map &map) +{ + map(0x000000, 0x00bfff).rom(); +// map(0x040000, 0x04ffff) // Unknown + map(0x080000, 0x0807ff).ram(); +// map(0x100000, 0x10ffff) // Unknown + map(0x200000, 0x2fffff).rom().region("mask_rom", 0); + map(0x400000, 0x4007ff).ram().share("display_ram"); + map(0x400800, 0x41ffff).ram(); + // Read after pen callibration + map(0x800030, 0x80003f).rw(FUNC(pickytlk_monocolor_state::tablet_read), FUNC(pickytlk_monocolor_state::tablet_write)); + // Read before pen callibration + map(0x800040, 0x80004f).rw(FUNC(pickytlk_monocolor_state::tablet_read), FUNC(pickytlk_monocolor_state::tablet_write)); +// map(0xe00000, 0xe0ffff) // LCD I/O +} + +void pickytlk_monocolor_state::pickytlk_palette(palette_device &palette) const +{ + palette.set_pen_color(0, 0xee, 0xee, 0xcc); + palette.set_pen_color(1, 0x11, 0x11, 0x11); + palette.set_pen_color(2, 0x11, 0x11, 0x11); + palette.set_pen_color(3, 0x11, 0x11, 0x11); +} + +void pickytlk_monocolor_state::pickytlk_monocolor(machine_config &config) +{ + pickytlk_base_state::pickytlk(config); + + m_maincpu->set_addrmap(AS_PROGRAM, &pickytlk_monocolor_state::pickytlk_mem); + + // TODO: Verify palette. Colors can be changed by changing the contrast. + PALETTE(config, "palette", FUNC(pickytlk_monocolor_state::pickytlk_palette), 4); +} + + +class pickytlk_multicolor_state : public pickytlk_base_state +{ +public: + pickytlk_multicolor_state(const machine_config &mconfig, device_type type, const char *tag) + : pickytlk_base_state(mconfig, type, tag) + { } + + void pickytlk_multicolor(machine_config &config); + +private: + virtual u8 tablet_read(offs_t offset) override; + virtual void pickytlk_layout(machine_config &config) override; + void pickytlk_mem(address_map &map); + void pickytlk_palette(palette_device &palette) const; +}; + +void pickytlk_multicolor_state::pickytlk_layout(machine_config &config) +{ + config.set_default_layout(layout_pickytlk); +} + +u8 pickytlk_multicolor_state::tablet_read(offs_t offset) +{ + /* + Pen coordinates can return a mirrored value when bit 4 is not set. + Both pairs of values , are approximated from these tests: + - General case: + - x1 + x2 > 0xc8 + - y1 + y2 > 0xc8 + - Reset screen with "OK" prompt: + - x1 > 0x7d + - y1 > 0x7d + - Pen callibration: + - x1 < 0x72 + - x2 < 0x72 + - y1 < 0x64 + - y1 > 0x68 + */ + LOGMASKED(LOG_TABLET, "%s: tablet_read [%02x] = %02x\n", machine().describe_context(), offset, m_io_tablet_regs[offset]); + switch (offset) + { + case 0: + { + u8 y = BIT(m_ko, 7) ? io_pen_y_read() : 0; + LOGMASKED(LOG_TABLET, "%s: pen y = %02x\n", machine().describe_context(), y); + return BIT(m_ko, 4) ? y : (0xff - y); + } + case 1: + { + u8 x = BIT(m_ko, 6) ? io_pen_x_read() : 0; + LOGMASKED(LOG_TABLET, "%s: pen x = %02x\n", machine().describe_context(), x); + return BIT(m_ko, 4) ? x : (0xff - x); + } + case 4: + // Can return 0 if other values are not stable/ready? + return 0x80; + default: + return m_io_tablet_regs[offset]; + } +} + +void pickytlk_multicolor_state::pickytlk_mem(address_map &map) +{ + map(0x000000, 0x007fff).rom(); + map(0x080000, 0x0807ff).ram(); + map(0x080300, 0x08030f).rw(FUNC(pickytlk_multicolor_state::tablet_read), FUNC(pickytlk_multicolor_state::tablet_write)); +// map(0x100000, 0x10ffff) // Unknown +// map(0x110000, 0x11ffff) // LCD I/O + map(0x200000, 0x2fffff).rom().region("mask_rom", 0); + map(0x400000, 0x4007ff).ram().share("display_ram"); + map(0x400800, 0x41ffff).ram(); +// map(0xe10000, 0xe1ffff) // LCD I/O +} + +void pickytlk_multicolor_state::pickytlk_palette(palette_device &palette) const +{ + palette.set_pen_color(0, 0xee, 0xee, 0xcc); + palette.set_pen_color(1, 0x11, 0x33, 0x99); + palette.set_pen_color(2, 0x33, 0xcc, 0x77); + palette.set_pen_color(3, 0xee, 0x77, 0x33); +} + +void pickytlk_multicolor_state::pickytlk_multicolor(machine_config &config) +{ + pickytlk_base_state::pickytlk(config); + + m_maincpu->set_addrmap(AS_PROGRAM, &pickytlk_multicolor_state::pickytlk_mem); + + // TODO: Verify palette. Colors can be changed by changing the contrast. + PALETTE(config, "palette", FUNC(pickytlk_multicolor_state::pickytlk_palette), 4); +} + + +class plets_state : public pickytlk_multicolor_state +{ +public: + plets_state(const machine_config &mconfig, device_type type, const char *tag) + : pickytlk_multicolor_state(mconfig, type, tag) + { } + +private: + virtual void pickytlk_layout(machine_config &config) override; +}; + +void plets_state::pickytlk_layout(machine_config &config) +{ + // Nothing +} + + +#define CPU_ROM_MONOCOLOR \ + ROM_REGION(0xc000, "maincpu", 0) \ + ROM_LOAD("cpu.lsi1", 0x0000, 0xc000, CRC(67c76253) SHA1(2f7d368e584608d0ed3135159c36f35f02cdd8c4)) + +#define CPU_ROM_MULTICOLOR \ + ROM_REGION(0x8000, "maincpu", 0) \ ROM_LOAD("cpu.lsi1", 0x0000, 0x8000, CRC(d58efff9) SHA1(a8d2c2a331d79c5299274e2f2d180deda60a5aed)) + +ROM_START(jd363) + CPU_ROM_MONOCOLOR + + ROM_REGION(0x100000, "mask_rom", 0) + ROM_LOAD("d23c8000lwgx-c11.lsi5", 0x00000, 0x100000, CRC(d4c6e7d2) SHA1(ef199725f04da977cd47293dba8086011f156baf)) +ROM_END + +ROM_START(pickydis) + CPU_ROM_MONOCOLOR + + ROM_REGION(0x100000, "mask_rom", 0) + ROM_LOAD("d23c8000lwgx-c14.lsi5", 0x00000, 0x100000, CRC(1a6273c7) SHA1(f0601873503272d9a620789b5c9798f6e1baf4e7)) +ROM_END + +ROM_START(jd364) + CPU_ROM_MULTICOLOR + + ROM_REGION(0x100000, "mask_rom", 0) + ROM_LOAD("d23c8000lwgx-c12.lsi5", 0x00000, 0x100000, CRC(c023b709) SHA1(0c081a62f00d0fbee496a5c9067fb145cb79c8cd)) +ROM_END + +ROM_START(jd368) + CPU_ROM_MULTICOLOR + + ROM_REGION(0x100000, "mask_rom", 0) + ROM_LOAD("d23c8000xgx-c42.lsi5", 0x00000, 0x100000, CRC(c396bafb) SHA1(0d5610d288ab2474017c05ed54fc816d2e82525f)) +ROM_END + +ROM_START(pickytlk) + CPU_ROM_MULTICOLOR + ROM_REGION(0x100000, "mask_rom", 0) ROM_LOAD("d23c8000xgx-c64.lsi5", 0x00000, 0x100000, CRC(6ed6feae) SHA1(f9a63db3d048da0954cab052690deb01ec384b22)) ROM_END +ROM_START(mk300) + CPU_ROM_MULTICOLOR + + ROM_REGION(0x100000, "mask_rom", 0) + ROM_LOAD("d23c8000xgx-c77.lsi5", 0x00000, 0x100000, CRC(50ecb853) SHA1(5f2564ccb6ff7e0e5a21064ca32626f35dc81506)) +ROM_END + +ROM_START(mk350) + CPU_ROM_MULTICOLOR + + ROM_REGION(0x100000, "mask_rom", 0) + ROM_LOAD("m538032e-48.lsi5", 0x00000, 0x100000, CRC(42068a99) SHA1(24f8dc15a51a391d4c35cce7332d55f1fa4d8160)) +ROM_END + } // anonymous namespace -// "CASIO スーパーピッキートーク「グルタンの森」はやわかりビデオ" has copyright dates 1997,1998,1999 -COMP(1997, pickytlk, 0, 0, pickytlk, pickytlk, pickytlk_state, empty_init, "Casio", "Super Picky Talk - Forest of Gurutan", MACHINE_NO_SOUND | MACHINE_NOT_WORKING) +// Release date 1995-09 from "Casio Game Perfect Catalogue" +COMP(1995, jd363, 0, 0, pickytlk_monocolor, pickytlk, pickytlk_monocolor_state, empty_init, "Casio", "Picky Talk - Super Denshi Techou", MACHINE_NO_SOUND | MACHINE_NOT_WORKING) + +// ROM date 9539K7001 +COMP(1995?, pickydis, 0, 0, pickytlk_monocolor, pickytlk, pickytlk_monocolor_state, empty_init, "Tsukuda Original", "Disney Characters - Tegaki Electronic Note", MACHINE_NO_SOUND | MACHINE_NOT_WORKING) + +// Release date 1995-10 from "Casio Game Perfect Catalogue" +COMP(1995, jd364, 0, 0, pickytlk_multicolor, pickytlk, pickytlk_multicolor_state, empty_init, "Casio", "Color Picky Talk - Super Denshi Techou", MACHINE_NO_SOUND | MACHINE_NOT_WORKING) + +// ROM date 9737K7041 +COMP(1997?, jd368, 0, 0, pickytlk_multicolor, pickytlk, pickytlk_multicolor_state, empty_init, "Casio", "Super Picky Talk - Access Pet", MACHINE_NO_SOUND | MACHINE_NOT_WORKING) + +// Release date 1998-07 from "Casio Game Perfect Catalogue" +COMP(1998, pickytlk, 0, 0, pickytlk_multicolor, pickytlk, pickytlk_multicolor_state, empty_init, "Casio", "Super Picky Talk - Forest of Gurutan", MACHINE_NO_SOUND | MACHINE_NOT_WORKING) + +// Release date 1999-09 from "Casio Game Perfect Catalogue" +COMP(1999, mk300, 0, 0, pickytlk_multicolor, pickytlk, plets_state, empty_init, "Casio", "Plet's (MK-300)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING) + +// ROM date 0019K7001 +COMP(2000?, mk350, 0, 0, pickytlk_multicolor, pickytlk, plets_state, empty_init, "Casio", "Plet's (MK-350)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING) diff --git a/src/mame/cirsa/cirsa2080606.cpp b/src/mame/cirsa/cirsa2080606.cpp index edf06539861..40df32c5d0a 100644 --- a/src/mame/cirsa/cirsa2080606.cpp +++ b/src/mame/cirsa/cirsa2080606.cpp @@ -17,7 +17,7 @@ - La Perla del Caribe Plus - Las Joyas de Cleopatra - Leyendas de Oriente - - Lucky Player + - Lucky Player (2012 version) - Máquina del Tiempo - Multi Star - Ocean's Treasures diff --git a/src/mame/cvs/cvs_base.cpp b/src/mame/cvs/cvs_base.cpp deleted file mode 100644 index 9a9690ace4b..00000000000 --- a/src/mame/cvs/cvs_base.cpp +++ /dev/null @@ -1,105 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders: Mike Coates, Couriersud - -// common methods shared by Century CVS and derived hardware - -#include "emu.h" - -#include "cvs_base.h" - - -void cvs_base_state::machine_start() -{ - // register state save - save_item(NAME(m_collision_register)); - save_item(NAME(m_stars_scroll)); -} - -void cvs_base_state::machine_reset() -{ - m_collision_register = 0; - m_stars_scroll = 0; -} - -void cvs_base_state::write_s2650_flag(int state) // TODO: remove once set_memview is available via devcb -{ - m_ram_view.select(state); -} - -uint8_t cvs_base_state::collision_r() -{ - return m_collision_register; -} - -uint8_t cvs_base_state::collision_clear() -{ - if (!machine().side_effects_disabled()) - m_collision_register = 0; - return 0; -} - -// cvs stars hardware - -void cvs_base_state::scroll_start() -{ - m_stars_scroll++; -} - -void cvs_base_state::init_stars() -{ - int generator = 0; - - // precalculate the star background - - m_total_stars = 0; - - for (int y = 255; y >= 0; y--) - { - for (int x = 511; x >= 0; x--) - { - generator <<= 1; - int const bit1 = BIT(~generator, 17); - int const bit2 = BIT(generator, 5); - - if (bit1 ^ bit2) - generator |= 1; - - if (BIT(~generator, 16) && (generator & 0xfe) == 0xfe) - { - if (BIT(~generator, 12) && BIT(~generator, 13)) - { - if (m_total_stars < CVS_MAX_STARS) - { - m_stars[m_total_stars].x = x; - m_stars[m_total_stars].y = y; - m_stars[m_total_stars].code = 1; - - m_total_stars++; - } - } - } - } - } -} - -void cvs_base_state::update_stars(bitmap_ind16 &bitmap, const rectangle &cliprect, const pen_t star_pen, bool update_always) -{ - for (int offs = 0; offs < m_total_stars; offs++) - { - uint8_t x = (m_stars[offs].x + m_stars_scroll) >> 1; - uint8_t y = m_stars[offs].y + ((m_stars_scroll + m_stars[offs].x) >> 9); - - if (BIT(y, 0) ^ BIT(x, 4)) - { - if (flip_screen_x()) - x = ~x; - - if (flip_screen_y()) - y = ~y; - - if ((y >= cliprect.top()) && (y <= cliprect.bottom()) && - (update_always || (m_palette->pen_indirect(bitmap.pix(y, x)) == 0))) - bitmap.pix(y, x) = star_pen; - } - } -} diff --git a/src/mame/cvs/cvs_base.h b/src/mame/cvs/cvs_base.h deleted file mode 100644 index fa34f480184..00000000000 --- a/src/mame/cvs/cvs_base.h +++ /dev/null @@ -1,84 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders: Mike Coates, Couriersud - -/*************************************************************************** - - Century CVS System - -****************************************************************************/ - -#ifndef MAME_CVS_CVS_BASE_H -#define MAME_CVS_CVS_BASE_H - -#pragma once - -#include "cpu/s2650/s2650.h" -#include "machine/gen_latch.h" -#include "machine/s2636.h" -#include "sound/dac.h" -#include "sound/tms5110.h" - -#include "emupal.h" -#include "screen.h" - - -class cvs_base_state : public driver_device -{ -protected: - static inline constexpr uint8_t CVS_MAX_STARS = 250; - static inline constexpr int8_t CVS_S2636_Y_OFFSET = -5; - static inline constexpr int8_t CVS_S2636_X_OFFSET = -26; - - struct cvs_star - { - int x = 0, y = 0, code = 0; - }; - - // memory pointers - required_shared_ptr m_bullet_ram; - - // video-related - cvs_star m_stars[CVS_MAX_STARS]; - bitmap_ind16 m_collision_background; - uint8_t m_collision_register = 0U; - uint16_t m_total_stars = 0U; - int32_t m_stars_scroll = 0U; - - // devices - required_device m_maincpu; - optional_device_array m_s2636; - required_device m_gfxdecode; - required_device m_screen; - required_device m_palette; - - // memory - memory_share_creator m_video_ram; - memory_share_creator m_color_ram; - - memory_view m_ram_view; - - cvs_base_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag) - , m_bullet_ram(*this, "bullet_ram") - , m_maincpu(*this, "maincpu") - , m_s2636(*this, "s2636%u", 0U) - , m_gfxdecode(*this, "gfxdecode") - , m_screen(*this, "screen") - , m_palette(*this, "palette") - , m_video_ram(*this, "video_ram", 0x400, ENDIANNESS_BIG) - , m_color_ram(*this, "color_ram", 0x400, ENDIANNESS_BIG) - , m_ram_view(*this, "video_color_ram_view") - { } - - virtual void machine_start() override ATTR_COLD; - virtual void machine_reset() override ATTR_COLD; - - void write_s2650_flag(int state); - uint8_t collision_r(); - uint8_t collision_clear(); - void scroll_start(); - void init_stars() ATTR_COLD; - void update_stars(bitmap_ind16 &bitmap, const rectangle &cliprect, const pen_t star_pen, bool update_always); -}; - -#endif // MAME_CVS_CVS_BASE_H diff --git a/src/mame/cvs/galaxia.cpp b/src/mame/cvs/galaxia.cpp deleted file mode 100644 index 1e9b0a3c998..00000000000 --- a/src/mame/cvs/galaxia.cpp +++ /dev/null @@ -1,759 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders: David Haywood, hap - -/* - -Galaxia by Zaccaria (1979) -Also released in several regions as "Super Galaxians". -Set regions are unknown, so all are currently named Galaxia. - -Taken from an untested board. - -1K byte files were 2708 or equivalent. -512 byte file is a 82S130 PROM. - -This is not a direct pirate of Galaxian as you might think from the name. -The game uses a Signetics 2650A CPU with three 40-pin 2636 chips, which are -responsible for basic sound and some video functions. - -Other than that, the video hardware looks like it's similar to Galaxian -(2 x 2114, 2 x 2101, 2 x EPROM) but there is no attack RAM and the graphics -EPROMS are 2708. The graphics EPROMS do contain Galaxian-like graphics... - -Quick PCB sketch: - ------------------------------------------------------------------------------ - | | - | 13l 13i 13h | - | | - | PROM 11l 11i 11h S2636 S2621 XTAL | -|6-| 14.31818 | - | 10i 10h S2636 | -|5-| | -|--| 8i 8h S2636 S2650A | -|--| | -|--| | - | | -|4-| | -|--| | -|--| | -|--| | - | | -|3-| | -|--| | -|--| | -|--| DSW | - | 3d | -|2-| DSW |-1| - | 1d |--| - | |--| - ------------------------------------------------------------------------------ - -Astro Wars (port of Astro Fighter) is on a stripped down board of Galaxia, -using only one 2636 chip, less RAM, and no PROM. - -Manual and Schematic for Galaxia can be found at: -http://www.zzzaccaria.com/manuals/SuperGalaxiansTechnicalManual.zip -http://www.zzzaccaria.com/manuals/GalaxiaSchematics.zip - -The manual for Astro Wars can also be found at: -http://www.opdenkelder.com/Astrowars_manual.zip - -HW has many similarities with quasar.cpp / cvs.cpp / zac2650.cpp -real hardware video of Astro Wars can be seen here: youtu.be/eSrQFBMeDlM ---- - -TODO: -- go through everything in the schematics for astrowar / galaxia -- video rewrite to: - * support RAW_PARAMS, blanking is much like how laserbat hardware does it - and is needed to correct the speed in all machines - * improve bullets - * provide correct color/star generation, using info from Galaxia technical - manual and schematics - * provide accurate sprite/bg sync in astrowar -- what is the PROM for? schematics are too burnt to tell anything -- add sound board emulation - -*/ - -#include "emu.h" - -#include "cvs_base.h" - -#include "speaker.h" -#include "tilemap.h" - - -namespace { - -class galaxia_state : public cvs_base_state -{ -public: - galaxia_state(const machine_config &mconfig, device_type type, const char *tag) - : cvs_base_state(mconfig, type, tag) - { } - - void galaxia(machine_config &config) ATTR_COLD; - - void init_common() ATTR_COLD; - -protected: - virtual void video_start() override ATTR_COLD; - - tilemap_t *m_bg_tilemap = nullptr; - - template void video_w(offs_t offset, uint8_t data); - void vblank_irq(int state); - void data_map(address_map &map) ATTR_COLD; - void io_map(address_map &map) ATTR_COLD; - -private: - void scroll_w(uint8_t data); - void ctrlport_w(uint8_t data); - void dataport_w(uint8_t data); - uint8_t collision_r(); - uint8_t collision_clear(); - TILE_GET_INFO_MEMBER(get_bg_tile_info); - void palette(palette_device &palette) const ATTR_COLD; - uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - void mem_map(address_map &map) ATTR_COLD; -}; - -class astrowar_state : public galaxia_state -{ -public: - astrowar_state(const machine_config &mconfig, device_type type, const char *tag) - : galaxia_state(mconfig, type, tag) - { } - - void astrowar(machine_config &config) ATTR_COLD; - -protected: - virtual void video_start() override ATTR_COLD; - -private: - bitmap_ind16 m_temp_bitmap; - TILE_GET_INFO_MEMBER(get_bg_tile_info); - void palette(palette_device &palette) const ATTR_COLD; - uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - void mem_map(address_map &map) ATTR_COLD; -}; - - -static constexpr uint8_t SPRITE_PEN_BASE = 0x10; -static constexpr uint8_t STAR_PEN = 0x18; -static constexpr uint8_t BULLET_PEN = 0x19; - - -// Colors are 3bpp, but how they are generated is a mystery -// there's no color PROM on the PCB, nor palette RAM - -void galaxia_state::palette(palette_device &palette) const -{ - // estimated with video/photo references - constexpr int lut_clr[0x18] = { - // background - 0, 1, 4, 5, - 0, 3, 6, 2, - 0, 1, 4, 5, // unused? - 0, 3, 1, 7, - - // sprites - 0, 4, 3, 6, 1, 5, 2, 7 - }; - - for (int i = 0; i < 0x18; i++) - palette.set_pen_color(i, pal1bit(lut_clr[i] >> 0), pal1bit(lut_clr[i] >> 1), pal1bit(lut_clr[i] >> 2)); - - // stars/bullets - palette.set_pen_color(STAR_PEN, pal1bit(1), pal1bit(1), pal1bit(1)); - palette.set_pen_color(BULLET_PEN, pal1bit(1), pal1bit(1), pal1bit(0)); -} - -void astrowar_state::palette(palette_device &palette) const -{ - // no reference material available(?), except for Data East astrof - constexpr int lut_clr[8] = { 7, 3, 5, 1, 4, 2, 6, 7 }; - - for (int i = 0; i < 8; i++) - { - // background - palette.set_pen_color(i * 2, 0, 0, 0); - palette.set_pen_color(i * 2 + 1, pal1bit(lut_clr[i] >> 0), pal1bit(lut_clr[i] >> 1), pal1bit(lut_clr[i] >> 2)); - - // sprites - palette.set_pen_color(i | SPRITE_PEN_BASE, pal1bit(i >> 0), pal1bit(i >> 1), pal1bit(i >> 2)); - } - - // stars/bullets - palette.set_pen_color(STAR_PEN, pal1bit(1), pal1bit(1), pal1bit(1)); - palette.set_pen_color(BULLET_PEN, pal1bit(1), pal1bit(1), pal1bit(0)); -} - -TILE_GET_INFO_MEMBER(galaxia_state::get_bg_tile_info) -{ - uint8_t code = m_video_ram[tile_index] & 0x7f; // d7 unused - uint8_t color = m_color_ram[tile_index] & 3; // highest bits unused - - tileinfo.set(0, code, color, 0); -} - -TILE_GET_INFO_MEMBER(astrowar_state::get_bg_tile_info) -{ - uint8_t code = m_video_ram[tile_index]; - uint8_t color = m_color_ram[tile_index] & 7; // highest bits unused - - tileinfo.set(0, code, color, 0); -} - -void galaxia_state::init_common() -{ - assert((STAR_PEN & 7) == 0); - init_stars(); -} - -void galaxia_state::video_start() -{ - init_common(); - - m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(galaxia_state::get_bg_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 32, 32); - m_bg_tilemap->set_transparent_pen(0); - m_bg_tilemap->set_scroll_cols(8); - -} - -void astrowar_state::video_start() -{ - init_common(); - - m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(astrowar_state::get_bg_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 32, 32); - m_bg_tilemap->set_transparent_pen(0); - m_bg_tilemap->set_scroll_cols(8); - m_bg_tilemap->set_scrolldx(8, 8); - - m_screen->register_screen_bitmap(m_temp_bitmap); -} - - -/********************************************************************************/ - -uint32_t galaxia_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) -{ - bitmap_ind16 const &s2636_0_bitmap = m_s2636[0]->update(cliprect); - bitmap_ind16 const &s2636_1_bitmap = m_s2636[1]->update(cliprect); - bitmap_ind16 const &s2636_2_bitmap = m_s2636[2]->update(cliprect); - - bitmap.fill(0, cliprect); - update_stars(bitmap, cliprect, STAR_PEN, 1); - m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); - - for (int y = cliprect.top(); y <= cliprect.bottom(); y++) - { - for (int x = cliprect.left(); x <= cliprect.right(); x++) - { - bool const bullet = m_bullet_ram[y] && x == (m_bullet_ram[y] ^ 0xff); - bool const background = (bitmap.pix(y, x) & 3) != 0; - - // draw bullets (guesswork) - if (bullet) - { - // background vs. bullet collision detection - if (background) m_collision_register |= 0x80; - - // bullet size/color/priority is guessed - bitmap.pix(y, x) = BULLET_PEN; - if (x) bitmap.pix(y, x - 1) = BULLET_PEN; - } - - // copy the S2636 images into the main bitmap and check collision - int const pixel0 = s2636_0_bitmap.pix(y, x); - int const pixel1 = s2636_1_bitmap.pix(y, x); - int const pixel2 = s2636_2_bitmap.pix(y, x); - - int const pixel = pixel0 | pixel1 | pixel2; - - if (S2636_IS_PIXEL_DRAWN(pixel)) - { - // S2636 vs. S2636 collision detection - if (S2636_IS_PIXEL_DRAWN(pixel0) && S2636_IS_PIXEL_DRAWN(pixel1)) m_collision_register |= 0x01; - if (S2636_IS_PIXEL_DRAWN(pixel1) && S2636_IS_PIXEL_DRAWN(pixel2)) m_collision_register |= 0x02; - if (S2636_IS_PIXEL_DRAWN(pixel2) && S2636_IS_PIXEL_DRAWN(pixel0)) m_collision_register |= 0x04; - - // S2636 vs. bullet collision detection - if (bullet) m_collision_register |= 0x08; - - // S2636 vs. background collision detection - if (background) - { - /* bit4 causes problems on 2nd level - if (S2636_IS_PIXEL_DRAWN(pixel0)) m_collision_register |= 0x10; */ - if (S2636_IS_PIXEL_DRAWN(pixel1)) m_collision_register |= 0x20; - if (S2636_IS_PIXEL_DRAWN(pixel2)) m_collision_register |= 0x40; - } - - bitmap.pix(y, x) = S2636_PIXEL_COLOR(pixel) | SPRITE_PEN_BASE; - } - } - } - - return 0; -} - - -uint32_t astrowar_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) -{ - // astrowar has only one S2636 - bitmap_ind16 const &s2636_0_bitmap = m_s2636[0]->update(cliprect); - - bitmap.fill(0, cliprect); - update_stars(bitmap, cliprect, STAR_PEN, 1); - m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); - copybitmap(m_temp_bitmap, bitmap, 0, 0, 0, 0, cliprect); - - for (int y = cliprect.top(); y <= cliprect.bottom(); y++) - { - // draw bullets (guesswork) - if (m_bullet_ram[y]) - { - uint8_t const pos = m_bullet_ram[y] ^ 0xff; - - // background vs. bullet collision detection - if (m_temp_bitmap.pix(y, pos) & 1) - m_collision_register |= 0x02; - - // bullet size/color/priority is guessed - bitmap.pix(y, pos) = BULLET_PEN; - if (pos) bitmap.pix(y, pos - 1) = BULLET_PEN; - } - - for (int x = cliprect.left(); x <= cliprect.right(); x++) - { - // NOTE: similar to zac2650.cpp, the sprite chip runs at a different frequency than the background generator - // the exact timing ratio is unknown, so we'll have to do with guesswork - float const s_ratio = 256.0f / 196.0f; - - float const sx = x * s_ratio; - if (int(sx + 0.5f) > cliprect.right()) - break; - - // copy the S2636 bitmap into the main bitmap and check collision - int const pixel = s2636_0_bitmap.pix(y, x); - - if (S2636_IS_PIXEL_DRAWN(pixel)) - { - // S2636 vs. background collision detection - if ((m_temp_bitmap.pix(y, int(sx)) | m_temp_bitmap.pix(y, int(sx + 0.5f))) & 1) - m_collision_register |= 0x01; - - bitmap.pix(y, int(sx)) = S2636_PIXEL_COLOR(pixel) | SPRITE_PEN_BASE; - bitmap.pix(y, int(sx + 0.5f)) = S2636_PIXEL_COLOR(pixel) | SPRITE_PEN_BASE; - } - } - } - - return 0; -} - - -void galaxia_state::vblank_irq(int state) -{ - if (state) - { - m_maincpu->set_input_line(0, ASSERT_LINE); - scroll_start(); - } -} - - -/*************************************************************************** - - I/O - -***************************************************************************/ - -template -void galaxia_state::video_w(offs_t offset, uint8_t data) -{ - m_bg_tilemap->mark_tile_dirty(offset); - Which ? m_video_ram[offset] = data : m_color_ram[offset] = data; -} - -void galaxia_state::scroll_w(uint8_t data) -{ - m_screen->update_partial(m_screen->vpos()); - - // fixed scrolling area - for (int i = 1; i < 6; i++) - m_bg_tilemap->set_scrolly(i, data); -} - -void galaxia_state::ctrlport_w(uint8_t data) -{ - // d0: triggers on every new credit - // d1: coin counter? if you put a coin in slot A, galaxia constantly - // strobes sets and clears the bit. if you put a coin in slot B - // however, the bit is set and cleared only once. - // d5: set as soon as the game completes selftest - // other bits: unknown -} - -void galaxia_state::dataport_w(uint8_t data) -{ - // seems to be related to sound board comms -} - -uint8_t galaxia_state::collision_r() -{ - m_screen->update_partial(m_screen->vpos()); - return m_collision_register; -} - -uint8_t galaxia_state::collision_clear() -{ - m_screen->update_partial(m_screen->vpos()); - m_collision_register = 0; - return 0xff; -} - -void galaxia_state::mem_map(address_map &map) -{ - map(0x0000, 0x13ff).rom(); - map(0x1400, 0x14ff).mirror(0x6000).ram().share(m_bullet_ram); - map(0x1500, 0x15ff).mirror(0x6000).rw(m_s2636[0], FUNC(s2636_device::read_data), FUNC(s2636_device::write_data)); - map(0x1600, 0x16ff).mirror(0x6000).rw(m_s2636[1], FUNC(s2636_device::read_data), FUNC(s2636_device::write_data)); - map(0x1700, 0x17ff).mirror(0x6000).rw(m_s2636[2], FUNC(s2636_device::read_data), FUNC(s2636_device::write_data)); - map(0x1800, 0x1bff).mirror(0x6000).view(m_ram_view); - m_ram_view[0](0x1800, 0x1bff).ram().w(FUNC(galaxia_state::video_w<0>)).share(m_color_ram); - m_ram_view[1](0x1800, 0x1bff).ram().w(FUNC(galaxia_state::video_w<1>)).share(m_video_ram); - map(0x1c00, 0x1fff).mirror(0x6000).ram(); - map(0x2000, 0x33ff).rom(); - map(0x7214, 0x7214).portr("IN0"); -} - -void astrowar_state::mem_map(address_map &map) -{ - map(0x0000, 0x13ff).rom(); - map(0x1400, 0x14ff).mirror(0x6000).ram(); - map(0x1500, 0x15ff).mirror(0x6000).rw(m_s2636[0], FUNC(s2636_device::read_data), FUNC(s2636_device::write_data)); - map(0x1800, 0x1bff).mirror(0x6000).view(m_ram_view); - m_ram_view[0](0x1800, 0x1bff).ram().w(FUNC(astrowar_state::video_w<0>)).share(m_color_ram); - m_ram_view[1](0x1800, 0x1bff).ram().w(FUNC(astrowar_state::video_w<1>)).share(m_video_ram); - map(0x1c00, 0x1cff).mirror(0x6000).ram().share(m_bullet_ram); - map(0x2000, 0x33ff).rom(); -} - -void galaxia_state::io_map(address_map &map) -{ - map.unmap_value_high(); - map(0x00, 0x00).w(FUNC(galaxia_state::scroll_w)).portr("IN0"); - map(0x02, 0x02).portr("IN1"); - map(0x05, 0x05).nopr(); - map(0x06, 0x06).portr("DSW0"); - map(0x07, 0x07).portr("DSW1"); - map(0xac, 0xac).nopr(); -} - -void galaxia_state::data_map(address_map &map) -{ - map(S2650_CTRL_PORT, S2650_CTRL_PORT).rw(FUNC(galaxia_state::collision_r), FUNC(galaxia_state::ctrlport_w)); - map(S2650_DATA_PORT, S2650_DATA_PORT).rw(FUNC(galaxia_state::collision_clear), FUNC(galaxia_state::dataport_w)); -} - - -/*************************************************************************** - - Inputs - -***************************************************************************/ - -static INPUT_PORTS_START( galaxia ) - PORT_START("IN0") - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 ) - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 ) - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_COIN2 ) PORT_IMPULSE(1) - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_IMPULSE(1) - PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2) - PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON1 ) - PORT_BIT( 0xc0, IP_ACTIVE_HIGH, IPT_UNKNOWN ) - - PORT_START("IN1") - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_PLAYER(2) - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_PLAYER(2) - PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY - PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY - PORT_BIT( 0xc3, IP_ACTIVE_HIGH, IPT_UNKNOWN ) - - PORT_START("DSW0") - PORT_DIPNAME( 0x07, 0x00, DEF_STR( Coinage ) ) - PORT_DIPSETTING( 0x00, "A 1C_1C B 2C_1C" ) - PORT_DIPSETTING( 0x01, "A 1C_2C B 2C_1C" ) - PORT_DIPSETTING( 0x02, "A 1C_3C B 2C_1C" ) - PORT_DIPSETTING( 0x03, "A 1C_5C B 2C_1C" ) - PORT_DIPSETTING( 0x04, "A 1C_1C B 1C_1C" ) - PORT_DIPSETTING( 0x05, "A 1C_2C B 1C_1C" ) - PORT_DIPSETTING( 0x06, "A 1C_3C B 1C_1C" ) - PORT_DIPSETTING( 0x07, "A 1C_5C B 1C_1C" ) - PORT_DIPNAME( 0x08, 0x00, DEF_STR( Lives ) ) - PORT_DIPSETTING( 0x00, "3" ) - PORT_DIPSETTING( 0x08, "5" ) - - PORT_DIPNAME( 0x10, 0x00, "UNK04" ) - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x10, DEF_STR( On ) ) - PORT_DIPNAME( 0x20, 0x00, "UNK05" ) - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x20, DEF_STR( On ) ) - PORT_DIPNAME( 0x40, 0x00, "UNK06" ) - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x40, DEF_STR( On ) ) - PORT_DIPNAME( 0x80, 0x00, "UNK07" ) - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x80, DEF_STR( On ) ) - - PORT_START("DSW1") - PORT_DIPNAME( 0x01, 0x00, "UNK10" ) - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x01, DEF_STR( On ) ) - PORT_DIPNAME( 0x02, 0x00, "UNK11" ) - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x02, DEF_STR( On ) ) - PORT_DIPNAME( 0x04, 0x00, "UNK12" ) - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x04, DEF_STR( On ) ) - PORT_DIPNAME( 0x08, 0x00, "UNK13" ) - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x08, DEF_STR( On ) ) - - PORT_DIPNAME( 0x10, 0x00, "UNK14" ) - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x10, DEF_STR( On ) ) - PORT_DIPNAME( 0x20, 0x00, "UNK15" ) - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x20, DEF_STR( On ) ) - PORT_DIPNAME( 0x40, 0x00, "UNK16" ) - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x40, DEF_STR( On ) ) - PORT_DIPNAME( 0x80, 0x00, "UNK17" ) - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x80, DEF_STR( On ) ) -INPUT_PORTS_END - - -/*************************************************************************** - - Machine Configs - -***************************************************************************/ - -static const gfx_layout tiles8x8x2_layout = -{ - 8,8, - RGN_FRAC(1,2), - 2, - { RGN_FRAC(0,2), RGN_FRAC(1,2) }, - { 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 -}; - -static GFXDECODE_START( gfx_galaxia ) - GFXDECODE_ENTRY( "tiles", 0, tiles8x8x2_layout, 0, 4 ) -GFXDECODE_END - -static GFXDECODE_START( gfx_astrowar ) - GFXDECODE_ENTRY( "tiles", 0, gfx_8x8x1, 0, 8 ) -GFXDECODE_END - - -void galaxia_state::galaxia(machine_config &config) -{ - // basic machine hardware - S2650(config, m_maincpu, XTAL(14'318'181) / 8); - m_maincpu->set_addrmap(AS_PROGRAM, &galaxia_state::mem_map); - m_maincpu->set_addrmap(AS_IO, &galaxia_state::io_map); - m_maincpu->set_addrmap(AS_DATA, &galaxia_state::data_map); - m_maincpu->sense_handler().set("screen", FUNC(screen_device::vblank)); - m_maincpu->flag_handler().set(FUNC(galaxia_state::write_s2650_flag)); - m_maincpu->intack_handler().set([this]() { m_maincpu->set_input_line(0, CLEAR_LINE); return 0x03; }); - - // video hardware - SCREEN(config, m_screen, SCREEN_TYPE_RASTER); - m_screen->set_video_attributes(VIDEO_ALWAYS_UPDATE); - m_screen->set_refresh_hz(60); // wrong - m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(2500)); - m_screen->set_size(256, 256); - m_screen->set_visarea(0*8, 30*8-1, 2*8, 32*8-1); - m_screen->set_screen_update(FUNC(galaxia_state::screen_update)); - m_screen->set_palette(m_palette); - m_screen->screen_vblank().set(FUNC(galaxia_state::vblank_irq)); - - GFXDECODE(config, m_gfxdecode, m_palette, gfx_galaxia); - PALETTE(config, m_palette, FUNC(galaxia_state::palette), 0x18+2); - - S2636(config, m_s2636[0], 0); - m_s2636[0]->set_offsets(-13, -26); - m_s2636[0]->add_route(ALL_OUTPUTS, "mono", 0.25); - - S2636(config, m_s2636[1], 0); - m_s2636[1]->set_offsets(-13, -26); - m_s2636[1]->add_route(ALL_OUTPUTS, "mono", 0.25); - - S2636(config, m_s2636[2], 0); - m_s2636[2]->set_offsets(-13, -26); - m_s2636[2]->add_route(ALL_OUTPUTS, "mono", 0.25); - - // sound hardware - SPEAKER(config, "mono").front_center(); -} - -void astrowar_state::astrowar(machine_config &config) -{ - // basic machine hardware - S2650(config, m_maincpu, XTAL(14'318'181) / 8); - m_maincpu->set_addrmap(AS_PROGRAM, &astrowar_state::mem_map); - m_maincpu->set_addrmap(AS_IO, &astrowar_state::io_map); - m_maincpu->set_addrmap(AS_DATA, &astrowar_state::data_map); - m_maincpu->sense_handler().set("screen", FUNC(screen_device::vblank)); - m_maincpu->flag_handler().set(FUNC(astrowar_state::write_s2650_flag)); - m_maincpu->intack_handler().set([this]() { m_maincpu->set_input_line(0, CLEAR_LINE); return 0x03; }); - - // video hardware - SCREEN(config, m_screen, SCREEN_TYPE_RASTER); - m_screen->set_video_attributes(VIDEO_ALWAYS_UPDATE); - m_screen->set_refresh_hz(60); - m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(2500)); - m_screen->set_size(256, 256); - m_screen->set_visarea(1*8, 31*8-1, 2*8, 32*8-1); - m_screen->set_screen_update(FUNC(astrowar_state::screen_update)); - m_screen->set_palette(m_palette); - m_screen->screen_vblank().set(FUNC(astrowar_state::vblank_irq)); - - GFXDECODE(config, m_gfxdecode, m_palette, gfx_astrowar); - PALETTE(config, m_palette, FUNC(astrowar_state::palette), 0x18+2); - - S2636(config, m_s2636[0], 0); - m_s2636[0]->set_offsets(-13, -8); - m_s2636[0]->add_route(ALL_OUTPUTS, "mono", 0.25); - - // sound hardware - SPEAKER(config, "mono").front_center(); -} - - -/*************************************************************************** - - Game drivers - -***************************************************************************/ - -ROM_START( galaxia ) - ROM_REGION( 0x10000, "maincpu", 0 ) - ROM_LOAD( "galaxia.8h", 0x00000, 0x0400, CRC(f3b4ffde) SHA1(15b004e7821bfc145158b1e9435f061c524f6b86) ) - ROM_LOAD( "galaxia.10h", 0x00400, 0x0400, CRC(6d07fdd4) SHA1(d7d4b345a055275d59951788569db370bccd5195) ) - ROM_LOAD( "galaxia.11h", 0x00800, 0x0400, CRC(1520eb3d) SHA1(3683174da701e1124af0f9c2ee4a9a84f3fea33a) ) - ROM_LOAD( "galaxia.13h", 0x00c00, 0x0400, CRC(c4482770) SHA1(aee983cc3d80989f49aea4138961bb623039484a) ) - ROM_LOAD( "galaxia.8i", 0x01000, 0x0400, CRC(45b88599) SHA1(3b79c21db1aa9d80fac81ac5a554e438805febd1) ) - ROM_LOAD( "galaxia.10i", 0x02000, 0x0400, CRC(c0baa654) SHA1(80e0880c32ad285fbce0f7f552268b964b97cab3) ) - ROM_LOAD( "galaxia.11i", 0x02400, 0x0400, CRC(4456808a) SHA1(f9e8cfdde0e17f13f1be297b2b4503ccc959b33c) ) - ROM_LOAD( "galaxia.13i", 0x02800, 0x0400, CRC(cf653b9a) SHA1(fef5943de60cb5ba2459fc6ae7419e29c96a76cd) ) - ROM_LOAD( "galaxia.11l", 0x02c00, 0x0400, CRC(50c6a645) SHA1(46638907bc393df6be25fc7461d73047d1746ffc) ) - ROM_LOAD( "galaxia.13l", 0x03000, 0x0400, CRC(3a9c38c7) SHA1(d1e934092b69c0f3f9636eba05a1d8a6d9588e6b) ) - - ROM_REGION( 0x0800, "tiles", 0 ) - ROM_LOAD( "galaxia.1d", 0x00000, 0x0400, CRC(2dd50aab) SHA1(758d7a5383c9a1ee134d99e3f7025819cfbe0e0f) ) - ROM_LOAD( "galaxia.3d", 0x00400, 0x0400, CRC(1dc30185) SHA1(e3c75eecb80b376ece98f602e1b9587487841824) ) - - ROM_REGION( 0x0200, "proms", 0 ) // unknown function - ROM_LOAD( "prom.11o", 0x0000, 0x0200, CRC(ae816417) SHA1(9497857d13c943a2735c3b85798199054e613b2c) ) -ROM_END - -ROM_START( galaxiaa ) - ROM_REGION( 0x10000, "maincpu", 0 ) - ROM_LOAD( "galaxia.8h", 0x00000, 0x0400, CRC(f3b4ffde) SHA1(15b004e7821bfc145158b1e9435f061c524f6b86) ) - ROM_LOAD( "galaxia.10h", 0x00400, 0x0400, CRC(6d07fdd4) SHA1(d7d4b345a055275d59951788569db370bccd5195) ) - ROM_LOAD( "galaxia.11h", 0x00800, 0x0400, CRC(1520eb3d) SHA1(3683174da701e1124af0f9c2ee4a9a84f3fea33a) ) - ROM_LOAD( "galaxia.13h", 0x00c00, 0x0400, CRC(c4482770) SHA1(aee983cc3d80989f49aea4138961bb623039484a) ) - ROM_LOAD( "galaxia.8i", 0x01000, 0x0400, CRC(45b88599) SHA1(3b79c21db1aa9d80fac81ac5a554e438805febd1) ) - ROM_LOAD( "galaxia.10i", 0x02000, 0x0400, CRC(76bd9fe3) SHA1(1abc8e40063aaa9140ea5e0341127eb0a7e86c88) ) // sldh - ROM_LOAD( "galaxia.11i", 0x02400, 0x0400, CRC(4456808a) SHA1(f9e8cfdde0e17f13f1be297b2b4503ccc959b33c) ) - ROM_LOAD( "galaxia.13i", 0x02800, 0x0400, CRC(cf653b9a) SHA1(fef5943de60cb5ba2459fc6ae7419e29c96a76cd) ) - ROM_LOAD( "galaxia.11l", 0x02c00, 0x0400, CRC(50c6a645) SHA1(46638907bc393df6be25fc7461d73047d1746ffc) ) - ROM_LOAD( "galaxia.13l", 0x03000, 0x0400, CRC(3a9c38c7) SHA1(d1e934092b69c0f3f9636eba05a1d8a6d9588e6b) ) - - ROM_REGION( 0x0800, "tiles", 0 ) - ROM_LOAD( "galaxia.1d", 0x00000, 0x0400, CRC(2dd50aab) SHA1(758d7a5383c9a1ee134d99e3f7025819cfbe0e0f) ) // taken from parent - ROM_LOAD( "galaxia.3d", 0x00400, 0x0400, CRC(1dc30185) SHA1(e3c75eecb80b376ece98f602e1b9587487841824) ) // taken from parent - - ROM_REGION( 0x0200, "proms", 0 ) // unknown function - ROM_LOAD( "prom.11o", 0x0000, 0x0200, CRC(ae816417) SHA1(9497857d13c943a2735c3b85798199054e613b2c) ) -ROM_END - -ROM_START( galaxiab ) - ROM_REGION( 0x10000, "maincpu", 0 ) - ROM_LOAD( "galaxia.8h", 0x00000, 0x0400, CRC(f3b4ffde) SHA1(15b004e7821bfc145158b1e9435f061c524f6b86) ) - ROM_LOAD( "galaxia.10h", 0x00400, 0x0400, CRC(6d07fdd4) SHA1(d7d4b345a055275d59951788569db370bccd5195) ) - ROM_LOAD( "galaxia.11h", 0x00800, 0x0400, CRC(1520eb3d) SHA1(3683174da701e1124af0f9c2ee4a9a84f3fea33a) ) - ROM_LOAD( "galaxia.13h", 0x00c00, 0x0400, CRC(1d22219b) SHA1(6ab8ea8c78db30d80de98879018726d0420d30fe) ) // sldh - only 1 bit difference compared with set 1/2, however not considered a bad dump since it was found on two boards - ROM_LOAD( "galaxia.8i", 0x01000, 0x0400, CRC(45b88599) SHA1(3b79c21db1aa9d80fac81ac5a554e438805febd1) ) - ROM_LOAD( "galaxia.10i", 0x02000, 0x0400, CRC(76bd9fe3) SHA1(1abc8e40063aaa9140ea5e0341127eb0a7e86c88) ) // sldh - ROM_LOAD( "galaxia.11i", 0x02400, 0x0400, CRC(4456808a) SHA1(f9e8cfdde0e17f13f1be297b2b4503ccc959b33c) ) - ROM_LOAD( "galaxia.13i", 0x02800, 0x0400, CRC(cf653b9a) SHA1(fef5943de60cb5ba2459fc6ae7419e29c96a76cd) ) - ROM_LOAD( "galaxia.11l", 0x02c00, 0x0400, CRC(50c6a645) SHA1(46638907bc393df6be25fc7461d73047d1746ffc) ) - ROM_LOAD( "galaxia.13l", 0x03000, 0x0400, CRC(3a9c38c7) SHA1(d1e934092b69c0f3f9636eba05a1d8a6d9588e6b) ) - - ROM_REGION( 0x0800, "tiles", 0 ) - ROM_LOAD( "galaxia.1d", 0x00000, 0x0400, CRC(2dd50aab) SHA1(758d7a5383c9a1ee134d99e3f7025819cfbe0e0f) ) // taken from parent - ROM_LOAD( "galaxia.3d", 0x00400, 0x0400, CRC(1dc30185) SHA1(e3c75eecb80b376ece98f602e1b9587487841824) ) // taken from parent - - ROM_REGION( 0x0200, "proms", 0 ) // unknown function - ROM_LOAD( "prom.11o", 0x0000, 0x0200, CRC(ae816417) SHA1(9497857d13c943a2735c3b85798199054e613b2c) ) -ROM_END - -ROM_START( galaxiac ) - ROM_REGION( 0x10000, "maincpu", 0 ) - ROM_LOAD( "galaxia.8h", 0x00000, 0x0400, CRC(f3b4ffde) SHA1(15b004e7821bfc145158b1e9435f061c524f6b86) ) - ROM_LOAD( "galaxia.10h", 0x00400, 0x0400, CRC(6d07fdd4) SHA1(d7d4b345a055275d59951788569db370bccd5195) ) - ROM_LOAD( "galaxia.11h", 0x00800, 0x0400, CRC(5682d56f) SHA1(15afb3296e93f8371d36b686ce372f917bd5b771) ) // sldh - ROM_LOAD( "galaxia.13h", 0x00c00, 0x0400, CRC(80dafe84) SHA1(8a71a05f1b0ddba36bf748a4801f3a78f63af1db) ) // sldh - ROM_LOAD( "galaxia.8i", 0x01000, 0x0400, CRC(45b88599) SHA1(3b79c21db1aa9d80fac81ac5a554e438805febd1) ) - ROM_LOAD( "galaxia.10i", 0x02000, 0x0400, CRC(76bd9fe3) SHA1(1abc8e40063aaa9140ea5e0341127eb0a7e86c88) ) // sldh - ROM_LOAD( "galaxia.11i", 0x02400, 0x0400, CRC(4456808a) SHA1(f9e8cfdde0e17f13f1be297b2b4503ccc959b33c) ) - ROM_LOAD( "galaxia.13i", 0x02800, 0x0400, CRC(ffe86fdb) SHA1(67b02a5c39dbe515b6d68583c8831b0dae15374a) ) // sldh - ROM_LOAD( "galaxia.11l", 0x02c00, 0x0400, CRC(8e3f5343) SHA1(6298be9bb33975854cb3d009b89913b1a8018aee) ) // sldh - ROM_LOAD( "galaxia.13l", 0x03000, 0x0400, CRC(3a9c38c7) SHA1(d1e934092b69c0f3f9636eba05a1d8a6d9588e6b) ) - - ROM_REGION( 0x0800, "tiles", 0 ) - ROM_LOAD( "galaxia.1d", 0x00000, 0x0400, CRC(2dd50aab) SHA1(758d7a5383c9a1ee134d99e3f7025819cfbe0e0f) ) // taken from parent - ROM_LOAD( "galaxia.3d", 0x00400, 0x0400, CRC(1dc30185) SHA1(e3c75eecb80b376ece98f602e1b9587487841824) ) // taken from parent - - ROM_REGION( 0x0200, "proms", 0 ) // unknown function - ROM_LOAD( "prom.11o", 0x0000, 0x0200, CRC(ae816417) SHA1(9497857d13c943a2735c3b85798199054e613b2c) ) -ROM_END - - -ROM_START( astrowar ) - ROM_REGION( 0x10000, "maincpu", 0 ) - ROM_LOAD( "astro.8h", 0x00000, 0x0400, CRC(b0ec246c) SHA1(f9123b5e317938655f5e8b3f8a5810d0b2b7c7af) ) - ROM_LOAD( "astro.10h", 0x00400, 0x0400, CRC(090d360f) SHA1(528ddcdc30a5a291bd8850ff6f134fcc19af562f) ) - ROM_LOAD( "astro.11h", 0x00800, 0x0400, CRC(72ab1378) SHA1(50743c64c4775076aa6f1d8ab2e05c14884bf0ba) ) - ROM_LOAD( "astro.13h", 0x00c00, 0x0400, CRC(2dc4c895) SHA1(831afbfd4ebfd6522ab0758222bc6f9826148a5d) ) - ROM_LOAD( "astro.8i", 0x01000, 0x0400, CRC(ab87fbfc) SHA1(34b670f96c260f186c643e588995ae5d80377784) ) - ROM_LOAD( "astro.10i", 0x02000, 0x0400, CRC(533675c1) SHA1(69cc066e1874a135a53a21b7b2461bda456504f1) ) - ROM_LOAD( "astro.11i", 0x02400, 0x0400, CRC(59cf8901) SHA1(e849d4c99350b7e3453c156d91618b71b5be1163) ) - ROM_LOAD( "astro.13i", 0x02800, 0x0400, CRC(5149c121) SHA1(232ba594e283fb25c31d8ae0b7d8315a81852a71) BAD_DUMP ) // suspected bad byte at 0x2a00 - ROM_LOAD( "astro.11l", 0x02c00, 0x0400, CRC(29f52f57) SHA1(5cb50b82e09c537eeaeae167351fca686fde8228) ) - ROM_LOAD( "astro.13l", 0x03000, 0x0400, CRC(882cdb87) SHA1(062ee8d296316cbce2eb62e72774aa4181e9847d) ) - - ROM_REGION( 0x0800, "tiles", 0 ) - ROM_LOAD( "astro.1d", 0x00000, 0x0400, CRC(6053f834) SHA1(e0b76800c241b3c8010c09869cecbc109b25310a) ) - ROM_LOAD( "astro.3d", 0x00400, 0x0400, CRC(822505aa) SHA1(f9d3465e14bb850a286f8b4f42aa0a4044413b67) ) -ROM_END - -} // anonymous namespace - - -GAME( 1979, galaxia, 0, galaxia, galaxia, galaxia_state, empty_init, ROT90, "Zaccaria / Zelco", "Galaxia (set 1)", MACHINE_IMPERFECT_COLORS | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) -GAME( 1979, galaxiaa, galaxia, galaxia, galaxia, galaxia_state, empty_init, ROT90, "Zaccaria / Zelco", "Galaxia (set 2)", MACHINE_IMPERFECT_COLORS | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) -GAME( 1979, galaxiab, galaxia, galaxia, galaxia, galaxia_state, empty_init, ROT90, "Zaccaria / Zelco", "Galaxia (set 3)", MACHINE_IMPERFECT_COLORS | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) -GAME( 1979, galaxiac, galaxia, galaxia, galaxia, galaxia_state, empty_init, ROT90, "Zaccaria / Zelco", "Galaxia (set 4)", MACHINE_IMPERFECT_COLORS | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) -GAME( 1980, astrowar, 0, astrowar, galaxia, astrowar_state, empty_init, ROT90, "Zaccaria / Zelco", "Astro Wars", MACHINE_IMPERFECT_COLORS | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/dataeast/chanbara.cpp b/src/mame/dataeast/chanbara.cpp index 08d540497c8..e297ec8cebb 100644 --- a/src/mame/dataeast/chanbara.cpp +++ b/src/mame/dataeast/chanbara.cpp @@ -33,7 +33,7 @@ DE-0207-0 |-----------------------------------------------------------| Notes: 6809 - MC68B09EP, clock 1.500MHz [12/8] - YM2203 - clock 1.500MHz [12/8] + YM2203 - clock 1.500MHz [12/8] on øM (pin 38), øS (pin 39) is 1MHz VSC30 - clock 3.000MHz [12/4, pin 7), custom DECO DIP40 IC HMC20 - DECO HMC20 custom DIP28 IC. Provides many clocks each divided by 2 (i.e. 12MHz, 6MHz, 3MHz, 1.5MHz, 750kHz etc) @@ -45,14 +45,14 @@ DE-0207-0 ------------------------ TODO: -- Verify what happens if you skip an enemy, on MAME the next one may appear out of - thin air. MAME previously showed garbage sprites moving fast to the left and later - changing into an enemy character, disable the (~attr & 0x01) check to see. - BGM tempo is too slow, what is it caused by? See https://mametesters.org/view.php?id=8024 BTANB: -- on enemies that hide behind the roof on the 3rd level, their feet are visible below - the roof, and their head is behind the sky +- If you skip an upper floor enemy (just walk under them), the next time one shows up, + it may appear out of thin air instead of scrolling in from the right. This doesn't + happen when skipping lower floor enemies. +- On enemies that hide behind the roof on the 3rd level, their feet are visible below + the roof, and their head is behind the sky. ****************************************************************************************/ @@ -188,7 +188,7 @@ void chanbara_state::draw_sprites(screen_device &screen, bitmap_ind16& bitmap, c int sx = (240 - m_spriteram[offs + 3]) & 0xff; int sy = (240 - m_spriteram[offs + 2]) & 0xff; - // disabled? + // not visible if (~attr & 0x01) continue; diff --git a/src/mame/dataeast/dec8.cpp b/src/mame/dataeast/dec8.cpp index c2a973d7ef4..9d54338d1b6 100644 --- a/src/mame/dataeast/dec8.cpp +++ b/src/mame/dataeast/dec8.cpp @@ -1672,6 +1672,7 @@ static const gfx_layout sr_sprites = { 16*8, 1+(16*8), 2+(16*8), 3+(16*8), 4+(16*8), 5+(16*8), 6+(16*8), 7+(16*8), 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,9*8,10*8,11*8,12*8,13*8,14*8,15*8 }, +// { 0*8, 2*8, 1*8, 3*8, 4*8, 6*8, 5*8, 7*8 ,8*8,10*8,9*8,11*8,12*8,14*8,13*8,15*8 }, bootleg decode 16*16 }; @@ -3658,6 +3659,45 @@ ROM_START( srdarwinj ) ROM_LOAD( "dy_12.f4", 0x00000, 0x100, CRC(ebfaaed9) SHA1(5723dbfa3eb3fc4df8c8975b320a5c49848309d8) ) /* Priority (Not yet used) */ ROM_END +ROM_START( srdarwinb ) + ROM_REGION( 0x28000, "maincpu", 0 ) + ROM_LOAD( "3.bin", 0x20000, 0x08000, CRC(7942b43f) SHA1(15de0c02d45d06c145fba48ef05baae793a1cb46) ) + ROM_CONTINUE( 0x08000, 0x08000 ) + ROM_LOAD( "4.bin", 0x10000, 0x10000, CRC(2bf6b461) SHA1(435d922c7b9df7f2b2f774346caed81d330be8a0) ) + + ROM_REGION( 2*0x10000, "audiocpu", 0 ) // 64K for sound CPU + 64k for decrypted opcodes + ROM_LOAD( "5.bin", 0x8000, 0x8000, CRC(2ae3591c) SHA1(f21b06d84e2c3d3895be0812024641fd006e45cf) ) + + ROM_REGION( 0x1000, "mcu", 0 ) // PCB lacks of i8751 microcontroller + ROM_LOAD( "mcu.bin", 0x0000, 0x1000, NO_DUMP ) + + ROM_REGION( 0x8000, "char", 0 ) + ROM_LOAD( "12.bin", 0x0000, 0x4000, CRC(f5c835cd) SHA1(8b41862dc18ba2e2677c94ecef45a40467aa89ad) ) + ROM_CONTINUE( 0x0000, 0x4000 ) // all data in the 2nd half + + ROM_REGION( 0x30000, "sprites", 0 ) + ROM_LOAD( "6.bin", 0x00000, 0x8000, CRC(3c84a2c6) SHA1(558a7d9acb5af06a7728d010262e3a35c3cdbe25) ) + ROM_LOAD( "7.bin", 0x08000, 0x8000, CRC(990cfc7b) SHA1(84ab42010a483e8a4cd86357898f55e644d1b11e) ) + ROM_LOAD( "10.bin", 0x10000, 0x8000, CRC(cf7dcdc1) SHA1(a94a970ff564da0fef8cd7cdcbf9aee5f83b596c) ) + ROM_LOAD( "11.bin", 0x18000, 0x8000, CRC(3674e392) SHA1(d91387c2412bf950993751c2e4764f818489316f) ) + ROM_LOAD( "8.bin", 0x20000, 0x8000, CRC(cc39b73f) SHA1(8cdbef67526f29ccf77c04aec5e34253bcdf96c3) ) + ROM_LOAD( "9.bin", 0x28000, 0x8000, CRC(d15aaa08) SHA1(69649f0cb2f11107b37ae7914dd90f4c6269316f) ) + + ROM_REGION( 0x40000, "tiles1", 0 ) + ROM_LOAD( "1.bin", 0x00000, 0x4000, CRC(44f2a4f9) SHA1(97368dd112451cd630f2fa5ba54679e84e7d4d97) ) + ROM_CONTINUE( 0x10000, 0x4000 ) + ROM_CONTINUE( 0x20000, 0x4000 ) + ROM_CONTINUE( 0x30000, 0x4000 ) + ROM_LOAD( "2.bin", 0x08000, 0x4000, CRC(522d9a9e) SHA1(248274ed6df604357cad386fcf0521b26810aa0e) ) + ROM_CONTINUE( 0x18000, 0x4000 ) + ROM_CONTINUE( 0x28000, 0x4000 ) + ROM_CONTINUE( 0x38000, 0x4000 ) + + ROM_REGION( 256, "proms", 0 ) + ROM_LOAD( "82s123.bin", 0x00000, 0x100, NO_DUMP ) // Priority (Not yet used) +ROM_END + + ROM_START( cobracom ) ROM_REGION( 0x30000, "maincpu", 0 ) ROM_LOAD( "el11-5.5j", 0x08000, 0x08000, CRC(af0a8b05) SHA1(096e4e7f2785a20bfaec14277413ce4e20e90214) ) @@ -3863,6 +3903,22 @@ void lastmisn_state::init_meikyuhbl() m_palette->update(); } +void srdarwin_state::init_srdarwinb() +{ + // this bootleg has the sprite ROMs with bytes swapped. + // just worked here to avoid a new gfxdecode and machine driver. + + u8 *rom = memregion("sprites")->base(); + uint8_t byte1; + + for (int i = 0; i < 0x30000; i += 4) + { + byte1 = rom[i + 1]; + + rom[i + 1] = rom[i + 2]; + rom[i + 2] = byte1; + } +} /******************************************************************************/ @@ -3892,6 +3948,7 @@ GAME( 1987, oscarj1, oscar, oscar, oscarj, oscar_state, empty_ini GAME( 1987, oscarj2, oscar, oscar, oscarj, oscar_state, empty_init, ROT0, "Data East Corporation", "Psycho-Nics Oscar (Japan revision 2)", MACHINE_SUPPORTS_SAVE ) GAME( 1987, srdarwin, 0, srdarwin, srdarwin, srdarwin_state, empty_init, ROT270, "Data East Corporation", "Super Real Darwin (World)", MACHINE_SUPPORTS_SAVE ) GAME( 1987, srdarwinj, srdarwin, srdarwin, srdarwinj, srdarwin_state, empty_init, ROT270, "Data East Corporation", "Super Real Darwin (Japan)", MACHINE_SUPPORTS_SAVE ) +GAME( 1987, srdarwinb, srdarwin, srdarwin, srdarwinj, srdarwin_state, init_srdarwinb, ROT270, "bootleg", "Super Real Darwin (Japan, bootleg)", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) // Unlike most Deco games of this period Cobra Command does not seem to have a Data East USA release. Instead the Data East Corporation release // was used in the US as evidenced by boards with the EL romset bearing AAMA seal stickers (American Amusement Machine Association) diff --git a/src/mame/dataeast/dec8.h b/src/mame/dataeast/dec8.h index 3f2cf1e5872..9e81437dc6d 100644 --- a/src/mame/dataeast/dec8.h +++ b/src/mame/dataeast/dec8.h @@ -147,6 +147,7 @@ class srdarwin_state : public dec8_mcu_state_base } void srdarwin(machine_config &config); + void init_srdarwinb(); protected: virtual void video_start() override ATTR_COLD; diff --git a/src/mame/dynax/ddenlovr.cpp b/src/mame/dynax/ddenlovr.cpp index ef619292c15..b02e02ee5ef 100644 --- a/src/mame/dynax/ddenlovr.cpp +++ b/src/mame/dynax/ddenlovr.cpp @@ -53,6 +53,7 @@ Year + Game Board CPU Sound 1999 Mj Jong-Tei NM532-9902 Z80 YM2413 M6295 4L10FXXXX? 2000 Mj Gorgeous Night TSM003-0002 Z80 YM2413 M6295 4L10FXXXX? 2000 Mj Jong-Tei TSM005-0004 Z80 YM2413 M6295 scratched off +2001 Mj Dai-Reach TSM004-0002 Z80 YM2413 M6295 scratched off 2149C (I8255 in disguise?) 2002 Mj Daimyojin TSM015-0111 Z80 YM2413 M6295 70C160F011 2004 Mj Momotarou TSM015-0111? Z80 YM2413 M6295 70C160F011? ----------------------------------------------------------------------------------------------------------------------------------- @@ -124,9 +125,9 @@ Year + Game Board CPU Sound #include "dynax.h" #include "cpu/m68000/m68000.h" -#include "cpu/z80/z80.h" -#include "cpu/z80/tmpz84c015.h" #include "cpu/z80/kl5c80a12.h" +#include "cpu/z80/tmpz84c015.h" +#include "cpu/z80/z80.h" #include "sound/ay8910.h" #include "sound/ymopl.h" #include "machine/74259.h" @@ -329,20 +330,20 @@ class ddenlovr_state : public dynax_state uint16_t akamaru_e0010d_r(); protected: void mjflove_rombank_w(uint8_t data); + void sryudens_rambank_w(uint8_t data); private: uint8_t mjflove_protection_r(); uint8_t mjflove_keyb_r(offs_t offset); void mjflove_coincounter_w(uint8_t data); uint8_t sryudens_keyb_r(offs_t offset); void sryudens_coincounter_w(uint8_t data); - void sryudens_rambank_w(uint8_t data); protected: uint8_t daimyojn_keyb1_r(); uint8_t daimyojn_keyb2_r(); + void seljan2_palette_enab_w(uint8_t data); private: void janshinp_coincounter_w(uint8_t data); void seljan2_rombank_w(uint8_t data); - void seljan2_palette_enab_w(uint8_t data); void seljan2_palette_w(offs_t offset, uint8_t data); void quizchq_oki_bank_w(uint8_t data); void ddenlovr_oki_bank_w(uint8_t data); @@ -586,6 +587,7 @@ class hanakanz_state : public ddenlovr_state void mjreach1(machine_config &config); void daimyojn(machine_config &config); void kotbinyo(machine_config &config); + void daireach(machine_config &config); void init_momotaro(); @@ -626,6 +628,7 @@ class hanakanz_state : public ddenlovr_state uint8_t daimyojn_protection_r(); uint8_t momotaro_protection_r(); uint8_t jongteia_protection_r(); + uint8_t daireach_protection_r(); void daimyojn_palette_sel_w(uint8_t data); void daimyojn_blitter_data_palette_w(uint8_t data); uint8_t daimyojn_year_hack_r(offs_t offset); @@ -638,6 +641,7 @@ class hanakanz_state : public ddenlovr_state void hanakanz_map(address_map &map) ATTR_COLD; void daimyojn_portmap(address_map &map) ATTR_COLD; + void daireach_portmap(address_map &map) ATTR_COLD; void hanakanz_portmap(address_map &map) ATTR_COLD; void hkagerou_portmap(address_map &map) ATTR_COLD; void jongtei_portmap(address_map &map) ATTR_COLD; @@ -4662,6 +4666,56 @@ void hanakanz_state::daimyojn_portmap(address_map &map) } +/*************************************************************************** + Mahjong Dai-Reach +***************************************************************************/ + +// 1B40: D4 ED 76 C9 CB +// 1B45: C3 FA 61 DE DC + +uint8_t hanakanz_state::daireach_protection_r() +{ + switch (m_prot_val) + { + case 0xd4: return 0xc3; + case 0xed: return 0xfa; + case 0x76: return 0x61; + case 0xc9: return 0xde; + case 0xcb: return 0xdc; + } + return 0xff; +} + + +void hanakanz_state::daireach_portmap(address_map &map) +{ + map.global_mask(0xff); + map(0x00, 0x0f).rw("rtc", FUNC(msm6242_device::read), FUNC(msm6242_device::write)); + map(0x20, 0x23).w(FUNC(hanakanz_state::ddenlovr_palette_base_w)); + map(0x24, 0x27).w(FUNC(hanakanz_state::ddenlovr_palette_mask_w)); + map(0x28, 0x2b).w(FUNC(hanakanz_state::ddenlovr_transparency_pen_w)); + map(0x2c, 0x2f).w(FUNC(hanakanz_state::ddenlovr_transparency_mask_w)); + map(0x34, 0x34).w(FUNC(hanakanz_state::ddenlovr_bgcolor_w)); + map(0x35, 0x35).w(FUNC(hanakanz_state::ddenlovr_priority_w)); + map(0x36, 0x36).w(FUNC(hanakanz_state::ddenlovr_layer_enable_w)); + map(0x38, 0x38).nopr(); // ? ack or watchdog + map(0x40, 0x41).w(FUNC(hanakanz_state::ddenlovr_blitter_w)); + map(0x43, 0x43).r(FUNC(hanakanz_state::ddenlovr_gfxrom_r)); + map(0x60, 0x60).rw("aysnd", FUNC(ay8910_device::data_r),FUNC(ay8910_device::address_w)); // dsw + map(0x62, 0x62).w("aysnd", FUNC(ay8910_device::data_w)); + map(0x64, 0x65).w("ym2413", FUNC(ym2413_device::write)); + map(0x66, 0x66).rw(m_oki, FUNC(okim6295_device::read), FUNC(okim6295_device::write)); + map(0x68, 0x68).w(FUNC(hanakanz_state::mjflove_rombank_w)); + map(0x6a, 0x6a).nopr().w(FUNC(hanakanz_state::sryudens_rambank_w)); + map(0x6c, 0x6c).r(FUNC(hanakanz_state::hanakanz_rand_r)); + map(0x6e, 0x6e).rw(FUNC(hanakanz_state::daireach_protection_r), FUNC(hanakanz_state::daimyojn_protection_w)); + map(0x70, 0x70).portr("SYSTEM"); + map(0x72, 0x72).r(FUNC(hanakanz_state::daimyojn_keyb1_r)); + map(0x74, 0x74).r(FUNC(hanakanz_state::daimyojn_keyb2_r)); + map(0x78, 0x78).w(FUNC(hanakanz_state::mjchuuka_oki_bank_w)); + map(0x7e, 0x7e).w(FUNC(hanakanz_state::seljan2_palette_enab_w)); // writes: 1 = palette RAM at b000, 0 = ROM +} + static INPUT_PORTS_START( ddenlovj ) PORT_START("P1") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 ) @@ -10830,6 +10884,16 @@ void ddenlovr_state::seljan2(machine_config &config) MSM6242(config, "rtc", XTAL(32'768)).out_int_handler().set(m_maincpu, FUNC(tmpz84c015_device::trg1)); } +void hanakanz_state::daireach(machine_config &config) +{ + seljan2(config); + + auto &maincpu(*subdevice("maincpu")); + maincpu.set_addrmap(AS_IO, &hanakanz_state::daireach_portmap); + maincpu.out_pb_callback().set(FUNC(hanakanz_state::mjchuuka_coincounter_w)); + + MCFG_VIDEO_START_OVERRIDE(hanakanz_state, ddenlovr) +} /*************************************************************************** Mahjong Daimyojin @@ -12946,6 +13010,29 @@ ROM_END /*************************************************************************** +Mahjong Dai Reach + +TSM004-0002 Techno-Top, Limited + +Has 4 banks of 10 DIP switches + +***************************************************************************/ + +ROM_START( daireach ) + ROM_REGION( 0x90000+0x8000+16*0x1000, "maincpu", 0 ) // Z80 Code + ROM_LOAD( "01202.5c", 0x00000, 0x80000, CRC(2d1cc94d) SHA1(4db6ea0414abfaf21c5bdd5e1cf395b01db1dce6) ) + ROM_RELOAD( 0x10000, 0x80000 ) + + ROM_REGION( 0x600000, "blitter", 0 ) + ROM_LOAD( "01203.11c", 0x000000, 0x200000, CRC(da054dbf) SHA1(80bab808711e6eb1521b68faee4b6ee7af001811) ) + ROM_LOAD( "01204.11a", 0x400000, 0x200000, CRC(ac96b1fc) SHA1(c045b048a8226c2fb3ba6feee36ce487c7ba12d2) ) + + ROM_REGION( 0x80000, "oki", 0 ) + ROM_LOAD( "01201.1c", 0x00000, 0x80000, CRC(9a638bc8) SHA1(c584ea5f8fcfc03fd8e04a5da182388d8a707df1) ) +ROM_END + +/*************************************************************************** + Mahjong Gorgeous Night PCB is identical to Mahjong Jong-Tei, but with number: @@ -13356,6 +13443,8 @@ GAME( 2000, jongteia, jongtei, jongteia, jongtei, hanakanz_state, empty_init GAME( 2000, mjgnight, 0, mjgnight, mjgnight, hanakanz_state, empty_init, ROT0, "Techno-Top", "Mahjong Gorgeous Night (Japan, TSM003-01)", MACHINE_NO_COCKTAIL ) +GAME( 2001, daireach, 0, daireach, seljan2, hanakanz_state, empty_init, ROT0, "Techno-Top", "Mahjong Dai-Reach (Japan, TSM012-C01)", MACHINE_NOT_WORKING | MACHINE_NO_COCKTAIL ) + GAME( 2002, daimyojn, 0, daimyojn, daimyojn, hanakanz_state, empty_init, ROT0, "Dynax / Techno-Top / Techno-Planning", "Mahjong Daimyojin (Japan, T017-PB-00)", MACHINE_NO_COCKTAIL ) GAME( 2004, momotaro, 0, daimyojn, daimyojn, hanakanz_state, init_momotaro, ROT0, "Techno-Top", "Mahjong Momotarou (Japan, T027-RB-01)", MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_GRAPHICS | MACHINE_NOT_WORKING ) diff --git a/src/mame/dynax/dynax.cpp b/src/mame/dynax/dynax.cpp index 5c101a985ea..b674ed4228d 100644 --- a/src/mame/dynax/dynax.cpp +++ b/src/mame/dynax/dynax.cpp @@ -553,19 +553,9 @@ void dynax_adpcm_state::hjingi_lockout_w(int state) machine().bookkeeping().coin_lockout_w(0, !state); } -void dynax_adpcm_state::hjingi_hopper_w(int state) -{ - m_hopper = state; -} - -uint8_t dynax_adpcm_state::hjingi_hopper_bit() -{ - return (m_hopper && !(m_screen->frame_number() % 10)) ? 0 : (1 << 6); -} - uint8_t dynax_adpcm_state::hjingi_keyboard_0_r() { - return hanamai_keyboard_0_r() | hjingi_hopper_bit(); + return hanamai_keyboard_0_r() | (m_hopper->line_r() ? 0 : (1 << 6)); } uint8_t dynax_adpcm_state::hjingi_keyboard_1_r() @@ -974,7 +964,7 @@ void dynax_adpcm_state::mjelctrn_io_map(address_map &map) map(0x80, 0x80).w(FUNC(dynax_adpcm_state::hanamai_keyboard_w)); // keyboard row select map(0x81, 0x81).portr("COINS"); // Coins map(0x82, 0x82).r(FUNC(dynax_adpcm_state::mjelctrn_keyboard_1_r)); // P2 - map(0x83, 0x83).r(FUNC(dynax_adpcm_state::hanamai_keyboard_0_r)); // P1 + map(0x83, 0x83).r(FUNC(dynax_adpcm_state::hjingi_keyboard_0_r)); // P1 map(0x84, 0x84).r(FUNC(dynax_adpcm_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 @@ -999,7 +989,7 @@ void dynax_adpcm_state::mjembase_io_map(address_map &map) map(0x20, 0x20).w(FUNC(dynax_adpcm_state::hanamai_keyboard_w)); // keyboard row select map(0x21, 0x21).portr("COINS"); // Coins map(0x22, 0x22).r(FUNC(dynax_adpcm_state::mjelctrn_keyboard_1_r)); // P2 - map(0x23, 0x23).r(FUNC(dynax_adpcm_state::hanamai_keyboard_0_r)); // P1 + map(0x23, 0x23).r(FUNC(dynax_adpcm_state::hjingi_keyboard_0_r)); // P1 map(0x24, 0x24).portr("DSW3"); // map(0x40, 0x40).nopw(); // CRT Controller // map(0x41, 0x41).nopw(); // CRT Controller @@ -1060,58 +1050,64 @@ uint8_t dynax_state::tenkai_ip_r(offs_t offset) static const char *const keynames0[] = { "KEY0", "KEY1", "KEY2", "KEY3", "KEY4" }; //static const char *const keynames1[] = { "KEY5", "KEY6", "KEY7", "KEY8", "KEY9" }; + uint8_t result = 0xff; switch (offset) { - case 0: + case 0: + switch (m_input_sel) { - switch (m_input_sel) - { - case 0x00: - case 0x80: - return ioport("COINS")->read(); // coins - - case 0x02: - case 0x82: - // do other bits do anything? - return m_hopper->line_r() ? 0xbf : 0xff; - - default: - logerror("%s: unmapped ip_sel=%02x read from offs %x\n", machine().describe_context(), m_input_sel, offset); - return 0xff; - } + case 0x00: + case 0x80: + result = ioport("COINS")->read(); // coins + break; + + case 0x02: + case 0x82: + // do other bits do anything? + result = m_hopper->line_r() ? 0xbf : 0xff; + break; + + default: + logerror("%s: unmapped ip_sel=%02x read from offs %x\n", machine().describe_context(), m_input_sel, offset); } + break; - case 1: + case 1: + switch (m_input_sel) { - switch (m_input_sel) + case 0x0d: + result = 0xff; + break; + + // player 2 + case 0x81: + if (m_keyb >= 5) + logerror("%s: unmapped keyb=%02x read\n", machine().describe_context(), m_keyb); + result = 0xff;//ioport(keynames1[m_keyb++])->read(); + break; + + // player 1 + case 0x82: + if (m_input_mode != 0xff) + { + result = 0x00; + } + else if (m_keyb >= 5) { - case 0x0d: - return 0xff; - - // player 2 - case 0x81: - if (m_keyb >= 5) - logerror("%s: unmapped keyb=%02x read\n", machine().describe_context(), m_keyb); - return 0xff;//ioport(keynames1[m_keyb++])->read(); - - // player 1 - case 0x82: - if (m_input_mode != 0xff) - return 0x00; - if (m_keyb >= 5) - { - logerror("%s: unmapped keyb=%02x read\n", machine().describe_context(), m_keyb); - return 0x00; - } - return ioport(keynames0[m_keyb++])->read(); - - default: - logerror("%s: unmapped ip_sel=%02x read from offs %x\n", machine().describe_context(), m_input_sel, offset); - return 0xff; + logerror("%s: unmapped keyb=%02x read\n", machine().describe_context(), m_keyb); + result = 0x00; } + result = ioport(keynames0[m_keyb])->read(); + if (!machine().side_effects_disabled()) + ++m_keyb; + break; + + default: + logerror("%s: unmapped ip_sel=%02x read from offs %x\n", machine().describe_context(), m_input_sel, offset); } + break; } - return 0xff; + return result; } @@ -1122,14 +1118,14 @@ void dynax_state::tenkai_dswsel_w(uint8_t data) uint8_t dynax_state::tenkai_dsw_r() { - if (!BIT(m_dsw_sel, 0)) return ioport("DSW0")->read(); - if (!BIT(m_dsw_sel, 1)) return ioport("DSW1")->read(); - if (!BIT(m_dsw_sel, 2)) return ioport("DSW2")->read(); - if (!BIT(m_dsw_sel, 3)) return ioport("DSW3")->read(); - if (!BIT(m_dsw_sel, 4)) return ioport("DSW4")->read(); - logerror("%s: unmapped dsw %02x read\n", machine().describe_context(), m_dsw_sel); + uint8_t result = 0xff; + if (!BIT(m_dsw_sel, 0)) result &= ioport("DSW0")->read(); + if (!BIT(m_dsw_sel, 1)) result &= ioport("DSW1")->read(); + if (!BIT(m_dsw_sel, 2)) result &= ioport("DSW2")->read(); + if (!BIT(m_dsw_sel, 3)) result &= ioport("DSW3")->read(); + if (!BIT(m_dsw_sel, 4)) result &= ioport("DSW4")->read(); - return 0xff; + return result; } uint8_t dynax_state::tenkai_palette_r(offs_t offset) @@ -1520,83 +1516,23 @@ static INPUT_PORTS_START( MAHJONG_KEYS ) INPUT_PORTS_END static INPUT_PORTS_START( MAHJONG_KEYS_BET ) - PORT_START("KEY0") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_A ) PORT_PLAYER(1) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_E ) PORT_PLAYER(1) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_I ) PORT_PLAYER(1) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_M ) PORT_PLAYER(1) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_KAN ) PORT_PLAYER(1) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1 ) + PORT_INCLUDE( MAHJONG_KEYS ) - PORT_START("KEY1") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_B ) PORT_PLAYER(1) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_F ) PORT_PLAYER(1) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_J ) PORT_PLAYER(1) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_N ) PORT_PLAYER(1) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_REACH ) PORT_PLAYER(1) + PORT_MODIFY("KEY1") PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_BET ) PORT_PLAYER(1) - PORT_START("KEY2") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_C ) PORT_PLAYER(1) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_G ) PORT_PLAYER(1) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_K ) PORT_PLAYER(1) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_CHI ) PORT_PLAYER(1) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_RON ) PORT_PLAYER(1) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) - - PORT_START("KEY3") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_D ) PORT_PLAYER(1) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_H ) PORT_PLAYER(1) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_L ) PORT_PLAYER(1) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_PON ) PORT_PLAYER(1) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) - - PORT_START("KEY4") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_LAST_CHANCE ) PORT_PLAYER(1) // "l" + PORT_MODIFY("KEY4") PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_SCORE ) PORT_PLAYER(1) // "t" PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_DOUBLE_UP ) PORT_PLAYER(1) // "w" - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_FLIP_FLOP ) PORT_PLAYER(1) // "f" PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_BIG ) PORT_PLAYER(1) // "b" PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_SMALL ) PORT_PLAYER(1) // "s" - PORT_START("KEY5") - 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) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_M ) PORT_PLAYER(2) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_KAN ) PORT_PLAYER(2) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 ) - - PORT_START("KEY6") - 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) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_N ) PORT_PLAYER(2) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_REACH ) PORT_PLAYER(2) + PORT_MODIFY("KEY6") PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_BET ) PORT_PLAYER(2) - PORT_START("KEY7") - 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) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_CHI ) PORT_PLAYER(2) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_RON ) PORT_PLAYER(2) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) - - PORT_START("KEY8") - 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) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_PON ) PORT_PLAYER(2) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) - - PORT_START("KEY9") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_LAST_CHANCE ) PORT_PLAYER(2) // "l" + PORT_MODIFY("KEY9") PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_SCORE ) PORT_PLAYER(2) // "t" PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_DOUBLE_UP ) PORT_PLAYER(2) // "w" - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_FLIP_FLOP ) PORT_PLAYER(2) // "f" PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_BIG ) PORT_PLAYER(2) // "b" PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_SMALL ) PORT_PLAYER(2) // "s" INPUT_PORTS_END @@ -1684,173 +1620,130 @@ static INPUT_PORTS_START( HANAFUDA_KEYS ) INPUT_PORTS_END INPUT_PORTS_START( HANAFUDA_KEYS_BET ) - PORT_START("KEY0") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_HANAFUDA_A ) PORT_PLAYER(1) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_HANAFUDA_E ) PORT_PLAYER(1) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_HANAFUDA_YES ) PORT_PLAYER(1) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1 ) + PORT_INCLUDE( HANAFUDA_KEYS ) - PORT_START("KEY1") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_HANAFUDA_B ) PORT_PLAYER(1) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_HANAFUDA_F ) PORT_PLAYER(1) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_HANAFUDA_NO ) PORT_PLAYER(1) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_MODIFY("KEY1") PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_BET ) PORT_PLAYER(1) - PORT_START("KEY2") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_HANAFUDA_C ) PORT_PLAYER(1) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_HANAFUDA_G ) PORT_PLAYER(1) - 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_START("KEY3") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_HANAFUDA_D ) PORT_PLAYER(1) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_HANAFUDA_H ) PORT_PLAYER(1) - 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_START("KEY4") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_LAST_CHANCE ) // "l" + PORT_MODIFY("KEY4") PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_SCORE ) // "t" PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_DOUBLE_UP ) // "w" - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_FLIP_FLOP ) // "f" PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_BIG ) // "b" PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_SMALL ) // "s" - PORT_START("KEY5") - 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_UNKNOWN ) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_HANAFUDA_YES ) PORT_PLAYER(2) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 ) - - PORT_START("KEY6") - 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_UNKNOWN ) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_HANAFUDA_NO ) PORT_PLAYER(2) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_MODIFY("KEY6") PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_BET ) PORT_PLAYER(2) - PORT_START("KEY7") - 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_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_START("KEY8") - 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_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_START("KEY9") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_LAST_CHANCE ) PORT_PLAYER(2) // "l" + PORT_MODIFY("KEY9") PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_SCORE ) PORT_PLAYER(2) // "t" PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_DOUBLE_UP ) PORT_PLAYER(2) // "w" - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_FLIP_FLOP ) PORT_PLAYER(2) // "f" PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_BIG ) PORT_PLAYER(2) // "b" PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_SMALL ) PORT_PLAYER(2) // "s" INPUT_PORTS_END -/* + +#if 0 [[maybe_unused]] static INPUT_PORTS_START( HANAFUDA_KEYS_BET_ALT ) - PORT_START("KEY0") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_HANAFUDA_A ) PORT_PLAYER(1) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_HANAFUDA_E ) PORT_PLAYER(1) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_HANAFUDA_YES ) PORT_PLAYER(1) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_SCORE ) // "t" - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1 ) - - PORT_START("KEY1") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_HANAFUDA_B ) PORT_PLAYER(1) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_HANAFUDA_F ) PORT_PLAYER(1) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_HANAFUDA_NO ) PORT_PLAYER(1) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_SMALL ) // "s" - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) - - PORT_START("KEY2") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_HANAFUDA_C ) PORT_PLAYER(1) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_HANAFUDA_G ) PORT_PLAYER(1) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_BIG ) // "b" - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) - - PORT_START("KEY3") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_HANAFUDA_D ) PORT_PLAYER(1) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_HANAFUDA_H ) PORT_PLAYER(1) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_DOUBLE_UP ) // "w" - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) - - PORT_START("KEY4") - 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("KEY5") - 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_UNKNOWN ) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_HANAFUDA_YES ) PORT_PLAYER(2) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_SCORE ) PORT_PLAYER(2) // "t" - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 ) - - PORT_START("KEY6") - 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_UNKNOWN ) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_HANAFUDA_NO ) PORT_PLAYER(2) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_SMALL ) PORT_PLAYER(2) // "s" - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) - - PORT_START("KEY7") - 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_UNKNOWN ) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_BIG ) PORT_PLAYER(2) // "b" - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) - - PORT_START("KEY8") - 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_UNKNOWN ) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_DOUBLE_UP ) PORT_PLAYER(2) // "w" - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) - - PORT_START("KEY9") - 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_INCLUDE( HANAFUDA_KEYS ) + + PORT_MODIFY("KEY0") + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_SCORE ) // "t" + + PORT_MODIFY("KEY1") + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_SMALL ) // "s" + + PORT_MODIFY("KEY2") + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_BIG ) // "b" + + PORT_MODIFY("KEY3") + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_DOUBLE_UP ) // "w" + + PORT_MODIFY("KEY4") + PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN ) + + PORT_MODIFY("KEY5") + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_SCORE ) PORT_PLAYER(2) // "t" + + PORT_MODIFY("KEY6") + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_SMALL ) PORT_PLAYER(2) // "s" + + PORT_MODIFY("KEY7") + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_BIG ) PORT_PLAYER(2) // "b" + + PORT_MODIFY("KEY8") + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_DOUBLE_UP ) PORT_PLAYER(2) // "w" + + PORT_MODIFY("KEY9") + PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN ) INPUT_PORTS_END -*/ +#endif + +#define MAHJONG_COIN_TEST(ct, cm) \ + PORT_START("COINS") \ + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT ) PORT_CODE(KEYCODE_4) PORT_CONDITION(ct, cm, EQUALS, 0) /* Pay */ \ + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_GAMBLE_KEYOUT ) PORT_CONDITION(ct, cm, EQUALS, cm) \ + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* 18B */ \ + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_TOGGLE /* Test */ \ + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) /* Analyzer */ \ + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) /* Memory Reset */ \ + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BILL1 ) PORT_CODE(KEYCODE_6) /* Note */ \ + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 ) /* Coin */ \ + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SERVICE1 ) /* Service */ + +#define MAHJONG_PAYOUT_RATE(shift, loc) \ + PORT_DIPNAME( 0x0f << shift, 0x07 << shift, "Payout Rate" ) PORT_DIPLOCATION(loc) \ + PORT_DIPSETTING( 0x00 << shift, "50%" ) \ + PORT_DIPSETTING( 0x01 << shift, "53%" ) \ + PORT_DIPSETTING( 0x02 << shift, "56%" ) \ + PORT_DIPSETTING( 0x03 << shift, "59%" ) \ + PORT_DIPSETTING( 0x04 << shift, "62%" ) \ + PORT_DIPSETTING( 0x05 << shift, "65%" ) \ + PORT_DIPSETTING( 0x06 << shift, "68%" ) \ + PORT_DIPSETTING( 0x07 << shift, "71%" ) \ + PORT_DIPSETTING( 0x08 << shift, "75%" ) \ + PORT_DIPSETTING( 0x09 << shift, "78%" ) \ + PORT_DIPSETTING( 0x0a << shift, "81%" ) \ + PORT_DIPSETTING( 0x0b << shift, "84%" ) \ + PORT_DIPSETTING( 0x0c << shift, "87%" ) \ + PORT_DIPSETTING( 0x0d << shift, "90%" ) \ + PORT_DIPSETTING( 0x0e << shift, "93%" ) \ + PORT_DIPSETTING( 0x0f << shift, "96%" ) + +#define MAHJONG_ODDS_RATE(shift, loc) \ + PORT_DIPNAME( 0x03 << shift, 0x00 << shift, "Odds Rate" ) PORT_DIPLOCATION(loc) \ + PORT_DIPSETTING( 0x03 << shift, "1 2 4 8 12 16 24 32" ) \ + PORT_DIPSETTING( 0x00 << shift, "1 2 3 5 8 15 30 50" ) \ + PORT_DIPSETTING( 0x01 << shift, "1 2 3 5 10 25 50 100" ) \ + PORT_DIPSETTING( 0x02 << shift, "1 2 3 5 10 50 100 200" ) + +#define MAHJONG_COINAGE(shift, loc) \ + PORT_DIPNAME( 0x03 << shift, 0x03 << shift, DEF_STR(Coinage) ) PORT_DIPLOCATION(loc) /* COIN RATE */ \ + PORT_DIPSETTING( 0x03 << shift, DEF_STR(1C_1C) ) /* 1コイン  1プレイ */ \ + PORT_DIPSETTING( 0x02 << shift, DEF_STR(1C_2C) ) /* 1コイン  2プレイ */ \ + PORT_DIPSETTING( 0x01 << shift, DEF_STR(1C_5C) ) /* 1コイン  5プレイ */ \ + PORT_DIPSETTING( 0x00 << shift, "1 Coin/10 Credits" ) /* 1コイン 10プレイ */ + +#define MAHJONG_NOTE_CREDITS(shift, loc, ct, cs) \ + PORT_DIPNAME( 0x01 << shift, 0x00 << shift, "Credits Per Note" ) PORT_DIPLOCATION(loc) /* NOTE RATE */ \ + PORT_DIPSETTING( 0x01 << shift, "5" ) PORT_CONDITION(ct, 0x03 << cs, EQUALS, 0x03 << cs) /* COIN×5 */ \ + PORT_DIPSETTING( 0x01 << shift, "10" ) PORT_CONDITION(ct, 0x03 << cs, EQUALS, 0x02 << cs) \ + PORT_DIPSETTING( 0x01 << shift, "25" ) PORT_CONDITION(ct, 0x03 << cs, EQUALS, 0x01 << cs) \ + PORT_DIPSETTING( 0x01 << shift, "50" ) PORT_CONDITION(ct, 0x03 << cs, EQUALS, 0x00 << cs) \ + PORT_DIPSETTING( 0x00 << shift, "10" ) PORT_CONDITION(ct, 0x03 << cs, EQUALS, 0x03 << cs) /* COIN×10 */ \ + PORT_DIPSETTING( 0x00 << shift, "20" ) PORT_CONDITION(ct, 0x03 << cs, EQUALS, 0x02 << cs) \ + PORT_DIPSETTING( 0x00 << shift, "50" ) PORT_CONDITION(ct, 0x03 << cs, EQUALS, 0x01 << cs) \ + PORT_DIPSETTING( 0x00 << shift, "100" ) PORT_CONDITION(ct, 0x03 << cs, EQUALS, 0x00 << cs) + +#define MAHJONG_YAKUMAN_BONUS(shift, loc) \ + PORT_DIPNAME( 0x07 << shift, 0x04 << shift, "Yakuman Bonus Cycle" ) PORT_DIPLOCATION(loc) /* 役満ボーナスの設定周期 */ \ + PORT_DIPSETTING( 0x07 << shift, "None" ) /* 無し */ \ + PORT_DIPSETTING( 0x06 << shift, "First time only" ) /* 初回のみ */ \ + PORT_DIPSETTING( 0x05 << shift, "Every 300 coins" ) /* 300コイン毎 */ \ + PORT_DIPSETTING( 0x04 << shift, "Every 500 coins" ) /* 500コイン毎 */ \ + PORT_DIPSETTING( 0x03 << shift, "Every 700 coins" ) /* 700コイン毎 */ \ + PORT_DIPSETTING( 0x02 << shift, "Every 1000 coins" ) /* 1000コイン毎 */ \ + /* PORT_DIPSETTING( 0x01 << shift, "Every 1000 coins" )*/ \ + /* PORT_DIPSETTING( 0x00 << shift, "Every 1000 coins" )*/ + static INPUT_PORTS_START( cdracula ) PORT_START("P1") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1) @@ -3161,140 +3054,98 @@ INPUT_PORTS_END static INPUT_PORTS_START( mjembase ) PORT_START("DSW2") /* DIP1, 7c20 (port $1e) */ - PORT_DIPNAME( 0x0f, 0x07, "Pay Out Rate" ) - PORT_DIPSETTING( 0x00, "50" ) - PORT_DIPSETTING( 0x01, "53" ) - PORT_DIPSETTING( 0x02, "56" ) - PORT_DIPSETTING( 0x03, "59" ) - PORT_DIPSETTING( 0x04, "62" ) - PORT_DIPSETTING( 0x05, "65" ) - PORT_DIPSETTING( 0x06, "68" ) - PORT_DIPSETTING( 0x07, "71" ) - PORT_DIPSETTING( 0x08, "75" ) - PORT_DIPSETTING( 0x09, "78" ) - PORT_DIPSETTING( 0x0a, "81" ) - PORT_DIPSETTING( 0x0b, "84" ) - PORT_DIPSETTING( 0x0c, "87" ) - PORT_DIPSETTING( 0x0d, "90" ) - PORT_DIPSETTING( 0x0e, "93" ) - PORT_DIPSETTING( 0x0f, "96" ) - PORT_DIPNAME( 0x30, 0x30, "Max Bet" ) + MAHJONG_PAYOUT_RATE(0, "SW 1:1,2,3,4") + PORT_DIPNAME( 0x30, 0x10, "Maximum Bet" ) PORT_DIPLOCATION("SW 1:5,6") PORT_DIPSETTING( 0x30, "1" ) PORT_DIPSETTING( 0x20, "5" ) PORT_DIPSETTING( 0x10, "10" ) PORT_DIPSETTING( 0x00, "20" ) - PORT_DIPNAME( 0x40, 0x40, DEF_STR( Coin_B ) ) - PORT_DIPSETTING( 0x40, DEF_STR( 1C_5C ) ) - PORT_DIPSETTING( 0x00, "1 Coin/10 Credits" ) - PORT_DIPNAME( 0x80, 0x80, DEF_STR( Flip_Screen ) ) - PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + MAHJONG_NOTE_CREDITS(6, "SW 1:7", "DSW1", 2) + PORT_DIPNAME( 0x80, 0x80, DEF_STR(Flip_Screen) ) PORT_DIPLOCATION("SW 1:8") + PORT_DIPSETTING( 0x80, DEF_STR(Off) ) + PORT_DIPSETTING( 0x00, DEF_STR(On) ) PORT_START("DSW1") /* DIP2, 7c21 (port $1c) */ - PORT_DIPNAME( 0x03, 0x03, "Difficulty?" ) - PORT_DIPSETTING( 0x03, "0" ) // 20 - PORT_DIPSETTING( 0x00, "1" ) // 32 - PORT_DIPSETTING( 0x01, "2" ) // 64 - PORT_DIPSETTING( 0x02, "3" ) // c8 - PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Coin_A ) ) - PORT_DIPSETTING( 0x0c, DEF_STR( 1C_1C ) ) - PORT_DIPSETTING( 0x08, DEF_STR( 1C_2C ) ) - PORT_DIPSETTING( 0x04, DEF_STR( 1C_5C ) ) - PORT_DIPSETTING( 0x00, "1 Coin/10 Credits" ) - PORT_DIPNAME( 0x30, 0x30, "Min Pay?" ) + MAHJONG_ODDS_RATE(0, "SW 2:1,2") + MAHJONG_COINAGE(2, "SW 2:3,4") + PORT_DIPNAME( 0x30, 0x30, "Minimum Bet" ) PORT_DIPLOCATION("SW 2:5,6") PORT_DIPSETTING( 0x30, "1" ) PORT_DIPSETTING( 0x20, "2" ) PORT_DIPSETTING( 0x10, "3" ) PORT_DIPSETTING( 0x00, "5" ) - PORT_DIPNAME( 0x40, 0x40, "Allow Coin Out" ) - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x40, DEF_STR( On ) ) - PORT_DIPNAME( 0x80, 0x80, "Win A Prize?" ) - PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x40, 0x40, "Payout Mode" ) PORT_DIPLOCATION("SW 2:7") + PORT_DIPSETTING( 0x40, "Key-out" ) + PORT_DIPSETTING( 0x00, "Hopper" ) + PORT_DIPNAME( 0x80, 0x80, "Hopper Polarity" ) PORT_DIPLOCATION("SW 2:8") + PORT_DIPSETTING( 0x80, DEF_STR(Normal) ) + PORT_DIPSETTING( 0x00, "Inverted" ) PORT_START("DSW0") /* DIP3, 7c22 (port $06, AY) */ /* note that these are in reverse order wrt the others */ - PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x02, 0x02, "DonDen Key" ) + PORT_DIPNAME( 0x01, 0x01, "Disable H Pose" ) PORT_DIPLOCATION("SW 3:8") + PORT_DIPSETTING( 0x01, DEF_STR(No) ) + PORT_DIPSETTING( 0x00, DEF_STR(Yes) ) // win sequences show scrolling images of gals wearing bikinis irrespective of SW 4-8 setting + PORT_DIPNAME( 0x02, 0x00, "Don Den Button" ) PORT_DIPLOCATION("SW 3:7") PORT_DIPSETTING( 0x02, "A" ) PORT_DIPSETTING( 0x00, "Flip Flop" ) - PORT_DIPNAME( 0x04, 0x04, "Draw New Tile" ) - PORT_DIPSETTING( 0x00, "Automatic" ) - PORT_DIPSETTING( 0x04, "Manual" ) - PORT_DIPNAME( 0x08, 0x08, "Win Rate?" ) - PORT_DIPSETTING( 0x08, DEF_STR( High ) ) - PORT_DIPSETTING( 0x00, DEF_STR( Low ) ) - PORT_DIPNAME( 0x10, 0x10, "YAKU times" ) + PORT_DIPNAME( 0x04, 0x00, "Service Count" ) PORT_DIPLOCATION("SW 3:6") + PORT_DIPSETTING( 0x04, DEF_STR(Off) ) + PORT_DIPSETTING( 0x00, DEF_STR(On) ) + PORT_DIPNAME( 0x08, 0x00, "Computer Strength" ) PORT_DIPLOCATION("SW 3:5") + PORT_DIPSETTING( 0x00, DEF_STR(Normal) ) + PORT_DIPSETTING( 0x08, "Strong" ) + PORT_DIPNAME( 0x10, 0x10, "Yakuman Bonuses Per Cycle" ) PORT_DIPLOCATION("SW 3:4") PORT_DIPSETTING( 0x10, "1" ) PORT_DIPSETTING( 0x00, "2" ) - PORT_DIPNAME( 0xe0, 0xe0, "YAKUMAN Bonus" ) - PORT_DIPSETTING( 0xe0, "Cut" ) - PORT_DIPSETTING( 0x60, "1 T" ) - PORT_DIPSETTING( 0xa0, "300" ) - PORT_DIPSETTING( 0x20, "500" ) - PORT_DIPSETTING( 0xc0, "700" ) - PORT_DIPSETTING( 0x40, "1000" ) -// PORT_DIPSETTING( 0x80, "1000" ) -// PORT_DIPSETTING( 0x00, "1000" ) + PORT_DIPNAME( 0xe0, 0xc0, "Yakuman Bonus Cycle" ) PORT_DIPLOCATION("SW 3:3,2,1") + PORT_DIPSETTING( 0xe0, "None" ) + PORT_DIPSETTING( 0x60, "First time only" ) + PORT_DIPSETTING( 0xa0, "Every 300 coins" ) + PORT_DIPSETTING( 0x20, "Every 500 coins" ) + PORT_DIPSETTING( 0xc0, "Every 700 coins" ) + PORT_DIPSETTING( 0x40, "Every 1000 coins" ) +// PORT_DIPSETTING( 0x80, "Every 1000 coins" ) +// PORT_DIPSETTING( 0x00, "Every 1000 coins" ) PORT_START("DSW3") /* DIP4, 7c23 (port $24) */ - PORT_DIPNAME( 0x01, 0x01, "Last Chance" ) - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x01, DEF_STR( On ) ) - PORT_DIPNAME( 0x02, 0x02, "Pay Rate?" ) - PORT_DIPSETTING( 0x02, DEF_STR( High ) ) - PORT_DIPSETTING( 0x00, DEF_STR( Low ) ) - PORT_DIPNAME( 0x04, 0x04, "Choose Bonus" ) - PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x08, 0x08, "In-Game Bet?" ) - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x08, DEF_STR( On ) ) - PORT_DIPNAME( 0x10, 0x00, DEF_STR( Demo_Sounds ) ) - PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x20, 0x00, "In-Game Music" ) - PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x40, 0x40, "Select Girl" ) - PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x80, 0x00, "Nudity" ) - PORT_DIPSETTING( 0x00, DEF_STR( Yes ) ) - PORT_DIPSETTING( 0x80, DEF_STR( No ) ) // Moles On Gal's Face + PORT_DIPNAME( 0x01, 0x01, "Last Chance" ) PORT_DIPLOCATION("SW 4:1") + PORT_DIPSETTING( 0x01, "Free" ) + PORT_DIPSETTING( 0x00, "Paid" ) + PORT_DIPNAME( 0x02, 0x00, "Renchan Rate" ) PORT_DIPLOCATION("SW 4:2") + PORT_DIPSETTING( 0x02, DEF_STR(Off) ) + PORT_DIPSETTING( 0x00, DEF_STR(On) ) + PORT_DIPNAME( 0x04, 0x00, "Auto Tsumo" ) PORT_DIPLOCATION("SW 4:3") + PORT_DIPSETTING( 0x04, DEF_STR(Off) ) + PORT_DIPSETTING( 0x00, DEF_STR(On) ) + PORT_DIPNAME( 0x08, 0x00, "Double Up" ) PORT_DIPLOCATION("SW 4:4") + PORT_DIPSETTING( 0x08, DEF_STR(Off) ) + PORT_DIPSETTING( 0x00, DEF_STR(On) ) // press Bet during game to double the bet + PORT_DIPNAME( 0x10, 0x00, DEF_STR(Demo_Sounds) ) PORT_DIPLOCATION("SW 4:5") + PORT_DIPSETTING( 0x10, DEF_STR(Off) ) + PORT_DIPSETTING( 0x00, DEF_STR(On) ) + PORT_DIPNAME( 0x20, 0x00, "In-Game Music" ) PORT_DIPLOCATION("SW 4:6") + PORT_DIPSETTING( 0x20, DEF_STR(Off) ) + PORT_DIPSETTING( 0x00, DEF_STR(On) ) + PORT_DIPNAME( 0x40, 0x40, "Gal Select" ) PORT_DIPLOCATION("SW 4:7") + PORT_DIPSETTING( 0x40, DEF_STR(Off) ) + PORT_DIPSETTING( 0x00, DEF_STR(On) ) + PORT_DIPNAME( 0x80, 0x80, "Gal H Pose" ) PORT_DIPLOCATION("SW 4:8") + PORT_DIPSETTING( 0x80, DEF_STR(Off) ) // shows moles on gals' faces, win sequences show scrolling images of gals wearing bikinis + PORT_DIPSETTING( 0x00, DEF_STR(On) ) // win sequences show "interaction" with gals if SW 3-8 is off PORT_START("FAKE") /* IN10 - Fake DSW */ - PORT_DIPNAME( 0xff, 0xff, "Allow Bets" ) - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0xff, DEF_STR( On ) ) + PORT_CONFNAME( 0xff, 0xff, "Allow Bets" ) + PORT_CONFSETTING( 0x00, DEF_STR( Off ) ) + PORT_CONFSETTING( 0xff, DEF_STR( On ) ) - PORT_START("COINS") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT ) PORT_CODE(KEYCODE_4) // Pay - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) // 18B - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE ) // Test - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) // Analyzer - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) // Memory Reset - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN2 ) // Note - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 ) // Coin - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SERVICE1 ) // Service + MAHJONG_COIN_TEST("DSW1", 0x40) PORT_INCLUDE( MAHJONG_KEYS_BET ) INPUT_PORTS_END -// DIP switch locations verified on mjelctrb PCB +// DIP switch locations verified on mjelctrb PCB - disagrees with input test static INPUT_PORTS_START( mjelct3 ) - PORT_START("COINS") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT ) PORT_CODE(KEYCODE_4) // Pay - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) // 18B - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE ) // Test - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) // Analyzer - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) // Memory Reset - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN2 ) // Note - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 ) // Coin - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SERVICE1 ) // Service + MAHJONG_COIN_TEST("DSW1", 0x40) PORT_INCLUDE( MAHJONG_KEYS_BET ) @@ -3308,64 +3159,34 @@ static INPUT_PORTS_START( mjelct3 ) PORT_DIPSETTING( 0x00, "1" ) // 32 PORT_DIPSETTING( 0x01, "2" ) // 64 PORT_DIPSETTING( 0x02, "3" ) // c8 - PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW3:3,4") - PORT_DIPSETTING( 0x0c, DEF_STR( 1C_1C ) ) - PORT_DIPSETTING( 0x08, DEF_STR( 1C_2C ) ) - PORT_DIPSETTING( 0x04, DEF_STR( 1C_5C ) ) - PORT_DIPSETTING( 0x00, "1 Coin/10 Credits" ) - PORT_DIPNAME( 0x30, 0x30, "Min Pay?" ) PORT_DIPLOCATION("SW3:5,6") + MAHJONG_COINAGE(2, "SW3:3,4") + PORT_DIPNAME( 0x30, 0x30, "Minimum Bet" ) PORT_DIPLOCATION("SW3:5,6") PORT_DIPSETTING( 0x30, "1" ) PORT_DIPSETTING( 0x20, "2" ) PORT_DIPSETTING( 0x10, "3" ) PORT_DIPSETTING( 0x00, "5" ) - PORT_DIPNAME( 0x40, 0x40, "Allow Coin Out" ) PORT_DIPLOCATION("SW3:7") - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x40, DEF_STR( On ) ) - PORT_DIPNAME( 0x80, 0x80, "Win A Prize?" ) PORT_DIPLOCATION("SW3:8") - PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x40, 0x40, "Payout Mode" ) PORT_DIPLOCATION("SW3:7") + PORT_DIPSETTING( 0x40, "Key-out" ) + PORT_DIPSETTING( 0x00, "Hopper" ) + PORT_DIPNAME( 0x80, 0x80, "Hopper Polarity" ) PORT_DIPLOCATION("SW3:8") + PORT_DIPSETTING( 0x80, DEF_STR(Normal) ) + PORT_DIPSETTING( 0x00, "Inverted" ) PORT_START("DSW1") /* 7c20 (select = 40) */ - PORT_DIPNAME( 0x0f, 0x07, "Pay Out Rate" ) PORT_DIPLOCATION("SW4:1,2,3,4") - PORT_DIPSETTING( 0x00, "50" ) - PORT_DIPSETTING( 0x01, "53" ) - PORT_DIPSETTING( 0x02, "56" ) - PORT_DIPSETTING( 0x03, "59" ) - PORT_DIPSETTING( 0x04, "62" ) - PORT_DIPSETTING( 0x05, "65" ) - PORT_DIPSETTING( 0x06, "68" ) - PORT_DIPSETTING( 0x07, "71" ) - PORT_DIPSETTING( 0x08, "75" ) - PORT_DIPSETTING( 0x09, "78" ) - PORT_DIPSETTING( 0x0a, "81" ) - PORT_DIPSETTING( 0x0b, "84" ) - PORT_DIPSETTING( 0x0c, "87" ) - PORT_DIPSETTING( 0x0d, "90" ) - PORT_DIPSETTING( 0x0e, "93" ) - PORT_DIPSETTING( 0x0f, "96" ) - PORT_DIPNAME( 0x30, 0x30, "Max Bet" ) PORT_DIPLOCATION("SW4:5,6") + MAHJONG_PAYOUT_RATE(0, "SW4:1,2,3,4") + PORT_DIPNAME( 0x30, 0x30, "Maximum Bet" ) PORT_DIPLOCATION("SW4:5,6") PORT_DIPSETTING( 0x30, "1" ) PORT_DIPSETTING( 0x20, "5" ) PORT_DIPSETTING( 0x10, "10" ) PORT_DIPSETTING( 0x00, "20" ) - PORT_DIPNAME( 0x40, 0x40, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW4:7") - PORT_DIPSETTING( 0x40, DEF_STR( 1C_5C ) ) - PORT_DIPSETTING( 0x00, "1 Coin/10 Credits" ) + MAHJONG_NOTE_CREDITS(6, "SW4:7", "DSW0", 2) PORT_DIPNAME( 0x80, 0x80, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW4:8") PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_START("DSW2") /* 7c22 (select = 80) */ - PORT_DIPNAME( 0x07, 0x07, "YAKUMAN Bonus" ) PORT_DIPLOCATION("SW2:1,2,3") - PORT_DIPSETTING( 0x07, "Cut" ) - PORT_DIPSETTING( 0x06, "1 T" ) - PORT_DIPSETTING( 0x05, "300" ) - PORT_DIPSETTING( 0x04, "500" ) - PORT_DIPSETTING( 0x03, "700" ) - PORT_DIPSETTING( 0x02, "1000" ) -// PORT_DIPSETTING( 0x01, "1000" ) -// PORT_DIPSETTING( 0x00, "1000" ) - PORT_DIPNAME( 0x08, 0x08, "YAKU times" ) PORT_DIPLOCATION("SW2:4") + MAHJONG_YAKUMAN_BONUS(0, "SW2:1,2,3") + PORT_DIPNAME( 0x08, 0x08, "Yakuman Bonuses Per Cycle" ) PORT_DIPLOCATION("SW2:4") PORT_DIPSETTING( 0x08, "1" ) PORT_DIPSETTING( 0x00, "2" ) PORT_DIPNAME( 0x10, 0x10, "Win Rate?" ) PORT_DIPLOCATION("SW2:5") @@ -3374,7 +3195,7 @@ static INPUT_PORTS_START( mjelct3 ) PORT_DIPNAME( 0x20, 0x20, "Draw New Tile (Part 3 Only)" ) PORT_DIPLOCATION("SW2:6") PORT_DIPSETTING( 0x00, "Automatic" ) PORT_DIPSETTING( 0x20, "Manual" ) - PORT_DIPNAME( 0x40, 0x40, "DonDen Key" ) PORT_DIPLOCATION("SW2:7") + PORT_DIPNAME( 0x40, 0x00, "Don Den Button" ) PORT_DIPLOCATION("SW2:7") PORT_DIPSETTING( 0x40, "A" ) PORT_DIPSETTING( 0x00, "Flip Flop" ) PORT_DIPNAME( 0x80, 0x00, "Subtitle" ) PORT_DIPLOCATION("SW2:8") @@ -3383,8 +3204,8 @@ static INPUT_PORTS_START( mjelct3 ) PORT_START("DSW3") /* 7c23 (select = c0) */ PORT_DIPNAME( 0x01, 0x01, "Last Chance" ) PORT_DIPLOCATION("SW5:1") - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x01, DEF_STR( On ) ) + PORT_DIPSETTING( 0x00, DEF_STR(Off) ) + PORT_DIPSETTING( 0x01, DEF_STR(On) ) PORT_DIPNAME( 0x02, 0x02, "Pay Rate?" ) PORT_DIPLOCATION("SW5:2") PORT_DIPSETTING( 0x02, DEF_STR( High ) ) PORT_DIPSETTING( 0x00, DEF_STR( Low ) ) @@ -3394,15 +3215,15 @@ static INPUT_PORTS_START( mjelct3 ) PORT_DIPNAME( 0x08, 0x08, "In-Game Bet?" ) PORT_DIPLOCATION("SW5:4") PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) PORT_DIPSETTING( 0x08, DEF_STR( On ) ) - PORT_DIPNAME( 0x10, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW5:5") - PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x10, 0x00, DEF_STR(Demo_Sounds) ) PORT_DIPLOCATION("SW5:5") + PORT_DIPSETTING( 0x10, DEF_STR(Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR(On) ) PORT_DIPNAME( 0x20, 0x00, "In-Game Music" ) PORT_DIPLOCATION("SW5:6") - PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x40, 0x40, "Select Girl" ) PORT_DIPLOCATION("SW5:7") - PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPSETTING( 0x20, DEF_STR(Off) ) + PORT_DIPSETTING( 0x00, DEF_STR(On) ) + PORT_DIPNAME( 0x40, 0x40, "Gal Select" ) PORT_DIPLOCATION("SW5:7") + PORT_DIPSETTING( 0x40, DEF_STR(Off) ) + PORT_DIPSETTING( 0x00, DEF_STR(On) ) PORT_DIPNAME( 0x80, 0x00, "Nudity" ) PORT_DIPLOCATION("SW5:8") PORT_DIPSETTING( 0x00, DEF_STR( Yes ) ) PORT_DIPSETTING( 0x80, DEF_STR( No ) ) // Moles On Gal's Face @@ -3417,13 +3238,13 @@ INPUT_PORTS_END static INPUT_PORTS_START( mjelctrn ) PORT_START("COINS") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT ) PORT_CODE(KEYCODE_4) // Pay - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) // 18B - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE ) // Test - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) // Analyzer - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) // Memory Reset - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN2 ) // Note - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 ) // Coin - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SERVICE1 ) // Service + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) // 18B + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_TOGGLE // Test + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) // Analyzer + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) // Memory Reset + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BILL1 ) PORT_CODE(KEYCODE_6) // Note + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 ) // Coin + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SERVICE1 ) // Service PORT_INCLUDE( MAHJONG_KEYS_BET ) @@ -3437,12 +3258,12 @@ static INPUT_PORTS_START( mjelctrn ) PORT_DIPSETTING( 0x00, "1" ) // 32 PORT_DIPSETTING( 0x01, "2" ) // 64 PORT_DIPSETTING( 0x02, "3" ) // c8 - PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW3:3,4") + PORT_DIPNAME( 0x0c, 0x0c, DEF_STR(Coinage) ) PORT_DIPLOCATION("SW3:3,4") PORT_DIPSETTING( 0x0c, DEF_STR( 1C_1C ) ) PORT_DIPSETTING( 0x08, DEF_STR( 1C_2C ) ) PORT_DIPSETTING( 0x04, DEF_STR( 1C_5C ) ) PORT_DIPSETTING( 0x00, "1 Coin/10 Credits" ) - PORT_DIPNAME( 0x30, 0x30, "Min Pay?" ) PORT_DIPLOCATION("SW3:5,6") + PORT_DIPNAME( 0x30, 0x30, "Minimum Bet" ) PORT_DIPLOCATION("SW3:5,6") PORT_DIPSETTING( 0x30, "1" ) PORT_DIPSETTING( 0x20, "2" ) PORT_DIPSETTING( 0x10, "3" ) @@ -3455,46 +3276,44 @@ static INPUT_PORTS_START( mjelctrn ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_START("DSW1") /* 7c20 (select = 40) */ - PORT_DIPNAME( 0x0f, 0x07, "Pay Out Rate" ) PORT_DIPLOCATION("SW4:1,2,3,4") - PORT_DIPSETTING( 0x00, "50" ) - PORT_DIPSETTING( 0x01, "53" ) - PORT_DIPSETTING( 0x02, "56" ) - PORT_DIPSETTING( 0x03, "59" ) - PORT_DIPSETTING( 0x04, "62" ) - PORT_DIPSETTING( 0x05, "65" ) - PORT_DIPSETTING( 0x06, "68" ) - PORT_DIPSETTING( 0x07, "71" ) - PORT_DIPSETTING( 0x08, "75" ) - PORT_DIPSETTING( 0x09, "78" ) - PORT_DIPSETTING( 0x0a, "81" ) - PORT_DIPSETTING( 0x0b, "84" ) - PORT_DIPSETTING( 0x0c, "87" ) - PORT_DIPSETTING( 0x0d, "90" ) - PORT_DIPSETTING( 0x0e, "93" ) - PORT_DIPSETTING( 0x0f, "96" ) - PORT_DIPNAME( 0x30, 0x30, "Max Bet" ) PORT_DIPLOCATION("SW4:5,6") + PORT_DIPNAME( 0x0f, 0x07, "Payout Rate" ) PORT_DIPLOCATION("SW4:1,2,3,4") + PORT_DIPSETTING( 0x00, "50%" ) + PORT_DIPSETTING( 0x01, "53%" ) + PORT_DIPSETTING( 0x02, "56%" ) + PORT_DIPSETTING( 0x03, "59%" ) + PORT_DIPSETTING( 0x04, "62%" ) + PORT_DIPSETTING( 0x05, "65%" ) + PORT_DIPSETTING( 0x06, "68%" ) + PORT_DIPSETTING( 0x07, "71%" ) + PORT_DIPSETTING( 0x08, "75%" ) + PORT_DIPSETTING( 0x09, "78%" ) + PORT_DIPSETTING( 0x0a, "81%" ) + PORT_DIPSETTING( 0x0b, "84%" ) + PORT_DIPSETTING( 0x0c, "87%" ) + PORT_DIPSETTING( 0x0d, "90%" ) + PORT_DIPSETTING( 0x0e, "93%" ) + PORT_DIPSETTING( 0x0f, "96%" ) + PORT_DIPNAME( 0x30, 0x10, "Maximum Bet" ) PORT_DIPLOCATION("SW4:5,6") PORT_DIPSETTING( 0x30, "1" ) PORT_DIPSETTING( 0x20, "5" ) PORT_DIPSETTING( 0x10, "10" ) PORT_DIPSETTING( 0x00, "20" ) - PORT_DIPNAME( 0x40, 0x40, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW4:7") - PORT_DIPSETTING( 0x40, DEF_STR( 1C_5C ) ) - PORT_DIPSETTING( 0x00, "1 Coin/10 Credits" ) + PORT_DIPNAME( 0x40, 0x00, "Credits Per Note" ) PORT_DIPLOCATION("SW4:7") + PORT_DIPSETTING( 0x40, "5" ) PORT_CONDITION("DSW0", 0x0c, EQUALS, 0x0c) + PORT_DIPSETTING( 0x40, "10" ) PORT_CONDITION("DSW0", 0x0c, EQUALS, 0x08) + PORT_DIPSETTING( 0x40, "25" ) PORT_CONDITION("DSW0", 0x0c, EQUALS, 0x04) + PORT_DIPSETTING( 0x40, "50" ) PORT_CONDITION("DSW0", 0x0c, EQUALS, 0x00) + PORT_DIPSETTING( 0x00, "10" ) PORT_CONDITION("DSW0", 0x0c, EQUALS, 0x0c) + PORT_DIPSETTING( 0x00, "20" ) PORT_CONDITION("DSW0", 0x0c, EQUALS, 0x08) + PORT_DIPSETTING( 0x00, "50" ) PORT_CONDITION("DSW0", 0x0c, EQUALS, 0x04) + PORT_DIPSETTING( 0x00, "100" ) PORT_CONDITION("DSW0", 0x0c, EQUALS, 0x00) PORT_DIPNAME( 0x80, 0x80, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW4:8") PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_START("DSW2") /* 7c22 (select = 80) */ - PORT_DIPNAME( 0x07, 0x07, "YAKUMAN Bonus" ) PORT_DIPLOCATION("SW2:1,2,3") - PORT_DIPSETTING( 0x07, "Cut" ) - PORT_DIPSETTING( 0x06, "1 T" ) - PORT_DIPSETTING( 0x05, "300" ) - PORT_DIPSETTING( 0x04, "500" ) - PORT_DIPSETTING( 0x03, "700" ) - PORT_DIPSETTING( 0x02, "1000" ) -// PORT_DIPSETTING( 0x01, "1000" ) -// PORT_DIPSETTING( 0x00, "1000" ) - PORT_DIPNAME( 0x08, 0x08, "YAKU times" ) PORT_DIPLOCATION("SW2:4") + MAHJONG_YAKUMAN_BONUS(0, "SW2:1,2,3") + PORT_DIPNAME( 0x08, 0x08, "Yakuman Bonuses Per Cycle" ) PORT_DIPLOCATION("SW2:4") PORT_DIPSETTING( 0x08, "1" ) PORT_DIPSETTING( 0x00, "2" ) PORT_DIPNAME( 0x10, 0x10, "Win Rate?" ) PORT_DIPLOCATION("SW2:5") @@ -3768,28 +3587,8 @@ static INPUT_PORTS_START( tenkai ) // There is an additional 4-switch bank (SW 5) for selecting the wiring options. PORT_START("DSW0") - PORT_DIPNAME( 0x0f, 0x07, "Payout Rate" ) PORT_DIPLOCATION("SW 1:1,2,3,4") // PAY-OUT RATE - PORT_DIPSETTING( 0x00, "50%" ) - PORT_DIPSETTING( 0x01, "53%" ) - PORT_DIPSETTING( 0x02, "56%" ) - PORT_DIPSETTING( 0x03, "59%" ) - PORT_DIPSETTING( 0x04, "62%" ) - PORT_DIPSETTING( 0x05, "65%" ) - PORT_DIPSETTING( 0x06, "68%" ) - PORT_DIPSETTING( 0x07, "71%" ) - PORT_DIPSETTING( 0x08, "75%" ) - PORT_DIPSETTING( 0x09, "78%" ) - PORT_DIPSETTING( 0x0a, "81%" ) - PORT_DIPSETTING( 0x0b, "84%" ) - PORT_DIPSETTING( 0x0c, "87%" ) - PORT_DIPSETTING( 0x0d, "90%" ) - PORT_DIPSETTING( 0x0e, "93%" ) - PORT_DIPSETTING( 0x0f, "96%" ) - PORT_DIPNAME( 0x30, 0x00, "Odds Rate" ) PORT_DIPLOCATION("SW 1:5,6") // ODDS RATE - PORT_DIPSETTING( 0x30, "1 2 4 8 12 16 24 32" ) - PORT_DIPSETTING( 0x00, "1 2 3 5 8 15 30 50" ) - PORT_DIPSETTING( 0x10, "1 2 3 5 10 25 50 100" ) - PORT_DIPSETTING( 0x20, "1 2 3 5 10 50 100 200" ) + MAHJONG_PAYOUT_RATE(0, "SW 1:1,2,3,4") // PAY-OUT RATE + MAHJONG_ODDS_RATE(4, "SW 1:5,6") // ODDS RATE PORT_DIPNAME( 0xc0, 0x40, "Maximum Bet" ) PORT_DIPLOCATION("SW 1:7,8") // BET-MAX PORT_DIPSETTING( 0xc0, "1" ) PORT_DIPSETTING( 0x80, "5" ) @@ -3797,25 +3596,13 @@ static INPUT_PORTS_START( tenkai ) PORT_DIPSETTING( 0x00, "20" ) PORT_START("DSW1") - PORT_DIPNAME( 0x03, 0x03, DEF_STR(Coinage) ) PORT_DIPLOCATION("SW 2:1,2") // COIN RATE - PORT_DIPSETTING( 0x03, DEF_STR(1C_1C) ) // 1コイン  1プレイ - PORT_DIPSETTING( 0x02, DEF_STR(1C_2C) ) // 1コイン  2プレイ - PORT_DIPSETTING( 0x01, DEF_STR(1C_5C) ) // 1コイン  5プレイ - PORT_DIPSETTING( 0x00, "1 Coin/10 Credits" ) // 1コイン 10プレイ + MAHJONG_COINAGE(0, "SW 2:1,2") // COIN RATE PORT_DIPNAME( 0x0c, 0x0c, "Minimum Bet" ) PORT_DIPLOCATION("SW 2:3,4") // ゲーム・スタート時の最低レート数 PORT_DIPSETTING( 0x0c, "1" ) // レート 1 PORT_DIPSETTING( 0x08, "2" ) // レート 2 PORT_DIPSETTING( 0x04, "3" ) // レート 3 PORT_DIPSETTING( 0x00, "5" ) // レート 5 - PORT_DIPNAME( 0x70, 0x40, "Yakuman Bonus Cycle" ) PORT_DIPLOCATION("SW 2:5,6,7") // 役満ボーナスの設定周期 - PORT_DIPSETTING( 0x70, "None" ) // 無し - PORT_DIPSETTING( 0x60, "First time only" ) // 初回のみ - PORT_DIPSETTING( 0x50, "Every 300 coins" ) // 300コイン毎 - PORT_DIPSETTING( 0x40, "Every 500 coins" ) // 500コイン毎 - PORT_DIPSETTING( 0x30, "Every 700 coins" ) // 700コイン毎 - PORT_DIPSETTING( 0x20, "Every 1000 coins" ) // 1000コイン毎 -// PORT_DIPSETTING( 0x10, "Every 1000 coins" ) -// PORT_DIPSETTING( 0x00, "Every 1000 coins" ) + MAHJONG_YAKUMAN_BONUS(4, "SW 2:5,6,7") // 役満ボーナスの設定周期 PORT_DIPNAME( 0x80, 0x00, "Yakuman Bonuses Per Cycle" ) PORT_DIPLOCATION("SW 2:8") // 役満ボーナスの回数設定周期毎に PORT_DIPSETTING( 0x00, "1" ) // 1回 PORT_DIPSETTING( 0x80, "2" ) // 2回 @@ -3873,15 +3660,7 @@ static INPUT_PORTS_START( tenkai ) PORT_DIPSETTING( 0x00, DEF_STR(On) ) // 有 PORT_START("DSW4") /* (top) */ - PORT_DIPNAME( 0x01, 0x00, "Credits Per Note" ) PORT_DIPLOCATION("SW 1:9") // NOTE RATE - PORT_DIPSETTING( 0x01, "5" ) PORT_CONDITION("DSW1", 0x03, EQUALS, 0x03) // COIN×5 - PORT_DIPSETTING( 0x01, "10" ) PORT_CONDITION("DSW1", 0x03, EQUALS, 0x02) - PORT_DIPSETTING( 0x01, "25" ) PORT_CONDITION("DSW1", 0x03, EQUALS, 0x01) - PORT_DIPSETTING( 0x01, "50" ) PORT_CONDITION("DSW1", 0x03, EQUALS, 0x00) - PORT_DIPSETTING( 0x00, "10" ) PORT_CONDITION("DSW1", 0x03, EQUALS, 0x03) // COIN×10 - PORT_DIPSETTING( 0x00, "20" ) PORT_CONDITION("DSW1", 0x03, EQUALS, 0x02) - PORT_DIPSETTING( 0x00, "50" ) PORT_CONDITION("DSW1", 0x03, EQUALS, 0x01) - PORT_DIPSETTING( 0x00, "100" ) PORT_CONDITION("DSW1", 0x03, EQUALS, 0x00) + MAHJONG_NOTE_CREDITS(0, "SW 1:9", "DSW1", 0) // NOTE RATE PORT_DIPNAME( 0x02, 0x02, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW 1:10") // モニター画面反転 PORT_DIPSETTING( 0x02, DEF_STR(Off) ) // 通常 PORT_DIPSETTING( 0x00, DEF_STR(On) ) // 反転 @@ -3907,16 +3686,7 @@ static INPUT_PORTS_START( tenkai ) PORT_DIPSETTING( 0x80, DEF_STR(No) ) PORT_DIPSETTING( 0x00, DEF_STR(Yes) ) - PORT_START("COINS") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT ) PORT_CODE(KEYCODE_4) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00) // Pay (default assignment conflicts with I) - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_GAMBLE_KEYOUT ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) // 18B - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_TOGGLE // Test - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) // Analyzer - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) // Memory Reset - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BILL1 ) PORT_CODE(KEYCODE_6) // Note (default assignment conflicts with Small) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 ) // Coin - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SERVICE1 ) // Service + MAHJONG_COIN_TEST("DSW2", 0x01) PORT_INCLUDE( MAHJONG_KEYS_BET ) INPUT_PORTS_END @@ -3930,6 +3700,11 @@ INPUT_PORTS_START( ougonhai ) // SW 3 OFF OFF ON ON ON ON OFF OFF OFF OFF OFF ON ON ON ON OFF // SW 4 OFF ON ON OFF OFF OFF OFF OFF ON ON ON OFF OFF OFF OFF OFF + // The manual implies SW 3 and SW 4 are banks of eight DIP switches, however + // the board has pads for banks of ten DIP switches, and ten DIP switches + // are shown in the input test. Boards have been found populated with banks + // of eight DIP switches or ten DIP switches. + PORT_INCLUDE( tenkai ) PORT_MODIFY("DSW2") @@ -3969,7 +3744,10 @@ INPUT_PORTS_START( ougonhai ) PORT_DIPNAME( 0x08, 0x00, "Renchan Rate" ) PORT_DIPLOCATION("SW 2:10") // 連荘レート PORT_DIPSETTING( 0x08, DEF_STR(Off) ) // 無 PORT_DIPSETTING( 0x00, DEF_STR(On) ) // 有 - PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_DIPUNKNOWN_DIPLOC( 0x10, 0x10, "SW 3:9" ) // not documented + PORT_DIPUNKNOWN_DIPLOC( 0x20, 0x20, "SW 3:10" ) // not documented + PORT_DIPUNKNOWN_DIPLOC( 0x40, 0x40, "SW 4:9" ) // not documented + PORT_DIPUNKNOWN_DIPLOC( 0x80, 0x80, "SW 4:10" ) // not documented INPUT_PORTS_END @@ -4300,7 +4078,6 @@ void dynax_adpcm_state::machine_start() save_item(NAME(m_msm5205next)); save_item(NAME(m_resetkludge)); - save_item(NAME(m_hopper)); save_item(NAME(m_toggle)); } @@ -4310,7 +4087,6 @@ void dynax_adpcm_state::machine_reset() m_msm5205next = 0; m_resetkludge = 0; - m_hopper = 0; m_toggle = 0; // start with the MSM5205 reset @@ -4544,9 +4320,11 @@ void dynax_adpcm_state::hjingi(machine_config &config) ls259_device &outlatch(LS259(config, "outlatch")); outlatch.q_out_cb<0>().set(FUNC(dynax_adpcm_state::coincounter_0_w)); outlatch.q_out_cb<1>().set(FUNC(dynax_adpcm_state::coincounter_1_w)); - outlatch.q_out_cb<2>().set(FUNC(dynax_adpcm_state::hjingi_hopper_w)); + outlatch.q_out_cb<2>().set(m_hopper, FUNC(hopper_device::motor_w)); outlatch.q_out_cb<3>().set(FUNC(dynax_adpcm_state::hjingi_lockout_w)); + HOPPER(config, m_hopper, attotime::from_msec(50)); + /* video hardware */ SCREEN(config, m_screen, SCREEN_TYPE_RASTER); m_screen->set_refresh_hz(60); @@ -4929,8 +4707,11 @@ void dynax_adpcm_state::mjelctrn(machine_config &config) m_mainlatch->q_out_cb<2>().set(FUNC(dynax_adpcm_state::layer_half2_w)); // Q3, Q4 seem to be related to wrap around enable + subdevice("outlatch")->q_out_cb<2>().set(m_hopper, FUNC(hopper_device::motor_w)); config.device_remove("mainirq"); + HOPPER(config, m_hopper, attotime::from_msec(50)); + m_screen->screen_vblank().set(m_maincpu, FUNC(tmpz84c015_device::trg0)).invert(); m_blitter->ready_cb().set(m_maincpu, FUNC(tmpz84c015_device::trg1)); @@ -4951,6 +4732,7 @@ void dynax_adpcm_state::mjembase(machine_config &config) // 13C m_mainlatch->q_out_cb<3>().set(FUNC(dynax_adpcm_state::coincounter_0_w)); m_mainlatch->q_out_cb<4>().set(FUNC(dynax_adpcm_state::coincounter_1_w)); + m_mainlatch->q_out_cb<5>().set(m_hopper, FUNC(hopper_device::motor_w)); config.device_remove("outlatch"); diff --git a/src/mame/dynax/dynax.h b/src/mame/dynax/dynax.h index 341f1d4f6fc..17b32bb7e6b 100644 --- a/src/mame/dynax/dynax.h +++ b/src/mame/dynax/dynax.h @@ -270,9 +270,6 @@ class dynax_adpcm_state : public dynax_state void adpcm_reset_w(uint8_t data); private: - // input/output - uint8_t m_hopper = 0U; // hjingi - // misc int m_toggle = 0; @@ -285,8 +282,6 @@ class dynax_adpcm_state : public dynax_state void nanajign_palette_hi_w(offs_t offset, uint8_t data); void nanajign_palette_update(offs_t offset); void hjingi_lockout_w(int state); - void hjingi_hopper_w(int state); - uint8_t hjingi_hopper_bit(); uint8_t hjingi_keyboard_0_r(); uint8_t hjingi_keyboard_1_r(); void yarunara_input_w(offs_t offset, uint8_t data); diff --git a/src/mame/epoch/cassvisn.cpp b/src/mame/epoch/cassvisn.cpp new file mode 100644 index 00000000000..129d5136955 --- /dev/null +++ b/src/mame/epoch/cassvisn.cpp @@ -0,0 +1,112 @@ +// license:BSD-3-Clause +// copyright-holders:Vas Crabb + +/* + +for architecture details see +https://www.oguchi-rd.com/LSI%20products.php +the linked 'design note' contains a large amount of useful information +https://www.oguchi-rd.com/777/777%20Design%20Note.pdf + +*/ + +#include "emu.h" + +#include "bus/generic/carts.h" +#include "bus/generic/slot.h" +#include "cpu/upd777/upd777.h" + +#include "softlist_dev.h" + + +namespace { + +class cassvisn_state : public driver_device +{ +public: + cassvisn_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), + m_maincpu(*this, "maincpu"), + m_cart(*this, "cartslot"), + m_in(*this, "IN%u", 0) + { } + + void cassvisn(machine_config &config); + +protected: + DECLARE_DEVICE_IMAGE_LOAD_MEMBER(cart_load); +private: + u8 input_r(offs_t offset); + + required_device m_maincpu; + required_device m_cart; + required_ioport_array<2> m_in; +}; + +u8 cassvisn_state::input_r(offs_t offset) +{ + return m_in[offset & 1]->read(); +} + +static INPUT_PORTS_START( cassvisn ) + PORT_START("IN0") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 ) + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_START2 ) + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON4 ) + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON3 ) + PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON1 ) // Jump on elvpanic + + PORT_START("IN1") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON10 ) + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON9 ) + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON8 ) + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON7 ) + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON6 ) + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON5 ) + PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON2 ) // Jump on monstrmn +INPUT_PORTS_END + +DEVICE_IMAGE_LOAD_MEMBER(cassvisn_state::cart_load) +{ + if (!image.loaded_through_softlist()) + return std::make_pair(image_error::UNSUPPORTED, "Cartridges must be loaded from the software list"); + + auto const prgsize = m_cart->common_get_size("prg"); + if (prgsize != 0xf00) + return std::make_pair(image_error::BADSOFTWARE, "prg region must be 0xf00 bytes in size"); + + m_cart->rom_alloc(prgsize, GENERIC_ROM16_WIDTH, ENDIANNESS_BIG); + m_cart->common_load_rom(m_cart->get_rom_base(), prgsize, "prg"); + uint16_t *prgbase = m_maincpu->get_prgregion(); + memcpy(prgbase, m_cart->get_rom_base(), prgsize); + + auto const patsize = m_cart->common_get_size("pat"); + if (patsize != 0x4d0) + return std::make_pair(image_error::BADSOFTWARE, "pat region patsize must be 0x4d0 bytes in size"); + + m_cart->common_load_rom(m_maincpu->get_patregion(), patsize, "pat"); + + return std::make_pair(std::error_condition(), std::string()); +} + +void cassvisn_state::cassvisn(machine_config &config) +{ + UPD777(config, m_maincpu, 2'000'000); // frequency? UPD774 / UPD778 in some carts? + m_maincpu->in_cb().set(FUNC(cassvisn_state::input_r)); + + GENERIC_CARTSLOT(config, m_cart, generic_plain_slot, "cassvisn_cart"); + m_cart->set_width(GENERIC_ROM16_WIDTH); + m_cart->set_device_load(FUNC(cassvisn_state::cart_load)); + m_cart->set_must_be_loaded(true); + + SOFTWARE_LIST(config, "cart_list").set_original("cassvisn_cart"); +} + +ROM_START( cassvisn ) +ROM_END + +} // anonymous namespace + +CONS( 1981, cassvisn, 0, 0, cassvisn, cassvisn, cassvisn_state, empty_init, "Epoch", "Cassette Vision", MACHINE_IS_SKELETON ) diff --git a/src/mame/epoch/scv.cpp b/src/mame/epoch/scv.cpp index 7efb0c5c1cf..271d52ec1b8 100644 --- a/src/mame/epoch/scv.cpp +++ b/src/mame/epoch/scv.cpp @@ -52,8 +52,8 @@ class scv_state : public driver_device void scv_palette(palette_device &palette) const; u32 screen_update_scv(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - void draw_sprite_part(bitmap_ind16 &bitmap, u8 x, u8 y, u8 pat, u8 col, u8 screen_sprite_start_line); - void draw_sprite(bitmap_ind16 &bitmap, u8 x, u8 y, u8 tile_idx, u8 col, bool left, bool right, bool top, bool bottom, u8 clip_y, u8 screen_sprite_start_line); + void draw_sprite_part(bitmap_ind16 &bitmap, u8 x, u8 y, u8 pat, u8 col); + void draw_sprite(bitmap_ind16 &bitmap, u8 x, u8 y, u8 tile_idx, u8 col, bool left, bool right, bool top, bool bottom, u8 clip_y); void draw_sprites(bitmap_ind16 &bitmap); void draw_text(bitmap_ind16 &bitmap, u8 x, u8 y, u8 *char_data, u8 fg, uint8_t bg); void draw_semi_graph(bitmap_ind16 &bitmap, u8 x, u8 y, u8 data, u8 fg); @@ -251,9 +251,9 @@ TIMER_CALLBACK_MEMBER(scv_state::vblank_update) } -void scv_state::draw_sprite_part(bitmap_ind16 &bitmap, u8 x, u8 y, u8 pat, u8 col, u8 screen_sprite_start_line) +void scv_state::draw_sprite_part(bitmap_ind16 &bitmap, u8 x, u8 y, u8 pat, u8 col) { - if ((x >= 4) && ((y + 2) >= screen_sprite_start_line)) + if (x >= 4) { x -= 4; @@ -272,7 +272,7 @@ void scv_state::draw_sprite_part(bitmap_ind16 &bitmap, u8 x, u8 y, u8 pat, u8 co } -void scv_state::draw_sprite(bitmap_ind16 &bitmap, u8 x, u8 y, u8 tile_idx, u8 col, bool left, bool right, bool top, bool bottom, u8 clip_y, u8 screen_sprite_start_line) +void scv_state::draw_sprite(bitmap_ind16 &bitmap, u8 x, u8 y, u8 tile_idx, u8 col, bool left, bool right, bool top, bool bottom, u8 clip_y) { y += clip_y * 2; for (int j = clip_y * 4; j < 32; j += 4, y += 2) @@ -284,20 +284,20 @@ void scv_state::draw_sprite(bitmap_ind16 &bitmap, u8 x, u8 y, u8 tile_idx, u8 co const u8 pat0 = m_videoram[tile_idx * 32 + j + 0]; const u8 pat1 = m_videoram[tile_idx * 32 + j + 1]; - draw_sprite_part(bitmap, x , y, pat0 >> 4, col, screen_sprite_start_line); - draw_sprite_part(bitmap, x + 4, y, pat1 >> 4, col, screen_sprite_start_line); - draw_sprite_part(bitmap, x , y + 1, pat0 & 0x0f, col, screen_sprite_start_line); - draw_sprite_part(bitmap, x + 4, y + 1, pat1 & 0x0f, col, screen_sprite_start_line); + draw_sprite_part(bitmap, x , y, pat0 >> 4, col); + draw_sprite_part(bitmap, x + 4, y, pat1 >> 4, col); + draw_sprite_part(bitmap, x , y + 1, pat0 & 0x0f, col); + draw_sprite_part(bitmap, x + 4, y + 1, pat1 & 0x0f, col); } if (right) { const u8 pat2 = m_videoram[tile_idx * 32 + j + 2]; const u8 pat3 = m_videoram[tile_idx * 32 + j + 3]; - draw_sprite_part(bitmap, x + 8, y, pat2 >> 4, col, screen_sprite_start_line); - draw_sprite_part(bitmap, x + 12, y, pat3 >> 4, col, screen_sprite_start_line); - draw_sprite_part(bitmap, x + 8, y + 1, pat2 & 0x0f, col, screen_sprite_start_line); - draw_sprite_part(bitmap, x + 12, y + 1, pat3 & 0x0f, col, screen_sprite_start_line); + draw_sprite_part(bitmap, x + 8, y, pat2 >> 4, col); + draw_sprite_part(bitmap, x + 12, y, pat3 >> 4, col); + draw_sprite_part(bitmap, x + 8, y + 1, pat2 & 0x0f, col); + draw_sprite_part(bitmap, x + 12, y + 1, pat3 & 0x0f, col); } } } @@ -306,9 +306,9 @@ void scv_state::draw_sprite(bitmap_ind16 &bitmap, u8 x, u8 y, u8 tile_idx, u8 co void scv_state::draw_sprites(bitmap_ind16 &bitmap) { - const u8 screen_start_sprite_line = (((m_videoram[0x1400] & 0xf7) == 0x17) && ((m_videoram[0x1402] & 0xef) == 0x4f)) ? 21 + 32 : 0; + const u8 num_sprites = BIT(m_videoram[0x1400], 2) ? 64 : 128; - for (int i = 0; i < 128; i++) + for (int i = 0; i < num_sprites; i++) { u8 spr_y = m_videoram[0x1200 + i * 4] & 0xfe; u8 y_32 = BIT(m_videoram[0x1200 + i * 4], 0); // Xx32 sprite @@ -352,28 +352,28 @@ void scv_state::draw_sprites(bitmap_ind16 &bitmap) if (BIT(m_videoram[0x1400], 5) && BIT(i, 5)) { // 2 color sprite handling - draw_sprite(bitmap, spr_x, spr_y, tile_idx, col, left, right, top, bottom, clip, screen_start_sprite_line); + draw_sprite(bitmap, spr_x, spr_y, tile_idx, col, left, right, top, bottom, clip); if (x_32 || y_32) { col = BIT(i, 4) ? s_spr_2col_lut1[col] : s_spr_2col_lut0[col]; tile_idx ^= (8 * x_32 + y_32); - draw_sprite(bitmap, spr_x, spr_y, tile_idx, col, left, right, top, bottom, clip, screen_start_sprite_line); + draw_sprite(bitmap, spr_x, spr_y, tile_idx, col, left, right, top, bottom, clip); } } else { // regular sprite handling - draw_sprite(bitmap, spr_x, spr_y, tile_idx, col, left, right, top, bottom, clip, screen_start_sprite_line); + draw_sprite(bitmap, spr_x, spr_y, tile_idx, col, left, right, top, bottom, clip); if (x_32) - draw_sprite(bitmap, spr_x + 16, spr_y, tile_idx | 8, col, 1, 1, top, bottom, clip, screen_start_sprite_line); + draw_sprite(bitmap, spr_x + 16, spr_y, tile_idx | 8, col, 1, 1, top, bottom, clip); if (y_32) { clip = BIT(clip, 3) ? (clip & 0x07) : 0; - draw_sprite(bitmap, spr_x, spr_y + 16, tile_idx | 1, col, left, right, 1, 1, clip, screen_start_sprite_line); + draw_sprite(bitmap, spr_x, spr_y + 16, tile_idx | 1, col, left, right, 1, 1, clip); if (x_32) - draw_sprite(bitmap, spr_x + 16, spr_y + 16, tile_idx | 9, col, 1, 1, 1, 1, clip, screen_start_sprite_line); + draw_sprite(bitmap, spr_x + 16, spr_y + 16, tile_idx | 9, col, 1, 1, 1, 1, clip); } } } diff --git a/src/mame/epson/qx10.cpp b/src/mame/epson/qx10.cpp index 2572dc99d54..8cc996967cd 100644 --- a/src/mame/epson/qx10.cpp +++ b/src/mame/epson/qx10.cpp @@ -40,6 +40,7 @@ #include "bus/rs232/rs232.h" #include "cpu/z80/z80.h" #include "imagedev/floppy.h" +#include "imagedev/snapquik.h" #include "machine/am9517a.h" #include "machine/i8255.h" #include "machine/mc146818.h" @@ -50,13 +51,12 @@ #include "machine/upd765.h" #include "machine/z80sio.h" #include "sound/spkrdev.h" -#include "speaker.h" #include "video/upd7220.h" -#include "emupal.h" +#include "emupal.h" +#include "speaker.h" #include "screen.h" #include "softlist_dev.h" -#include "imagedev/snapquik.h" namespace { diff --git a/src/mame/f32/silvmil.cpp b/src/mame/f32/silvmil.cpp index 9ae2acca51d..113574b346b 100644 --- a/src/mame/f32/silvmil.cpp +++ b/src/mame/f32/silvmil.cpp @@ -1,16 +1,19 @@ // license:BSD-3-Clause // copyright-holders:David Haywood /* - Silver Millennium - yet another Data East / Tumble Pop derived hardware - this one seems similar to (but not identical to) - the f32/crospang.cpp hardware from F2 system - also very close to gotcha.c, which was also a Para - board. +Silver Millennium - todo: refresh rate - verify dipswitches - difficulty & unknown dips +yet another Data East / Tumble Pop derived hardware +this one seems similar to (but not identical to) +the f32/crospang.cpp hardware from F2 system +also very close to gotcha.cpp, which was also a Para +board. + +TODO: +- refresh rate +- verify dipswitches - difficulty & unknown dips +- like gotcha, what is the audiocpu NMI for? OSC on Silver Millennium are 12MHz, 14.31818MHz & 4.096MHz The above has been verified on two boards. @@ -31,6 +34,7 @@ Very likely to be 'whatever crystals we had on hand which were close enough for #include "machine/gen_latch.h" #include "sound/okim6295.h" #include "sound/ymopm.h" + #include "emupal.h" #include "screen.h" #include "speaker.h" diff --git a/src/mame/funworld/funworld.cpp b/src/mame/funworld/funworld.cpp index 8e76a38106d..5ddb9c39d2b 100644 --- a/src/mame/funworld/funworld.cpp +++ b/src/mame/funworld/funworld.cpp @@ -3742,8 +3742,8 @@ uint8_t jokercrd_state::jokercrd_opcode_r(offs_t offset) // it should be noted, however, that the subroutine @c0da seems to be called just from here: // c044: 64 6a stz $6a // c046: 20 da c0 jsr $c0da - // and, if no interrupt is messing with the accesed data, the STZ @c044 should make the BEQ @c0ef - // become an inconditional jump, converting the opcode @c0f1 in dead code + // and, if no interrupt is messing with the accessed data, the STZ @c044 should make the BEQ @c0ef + // become an unconditional jump, converting the opcode @c0f1 in dead code constexpr uint8_t UNKN {0xfc}; @@ -7164,11 +7164,11 @@ ROM_END Program roms are encrypted. Seems to be a Big Deal clone, running in Fun World Multi Win hardware. - Unfortunatelly, the graphics ROM vesely_zg_1.ic10 has address 8 line (leg 25) shorted. + Unfortunately, the graphics ROM vesely_zg_1.ic10 has address 8 line (leg 25) shorted. Seems that the protection diode was blown due to a bad handling. With forensics techniques, a special device was constructed to process - the faulty ROM and try to read the contents. Fortunatelly after all these + the faulty ROM and try to read the contents. Fortunately after all these efforts, we got a perfect and complete dump. @@ -7236,6 +7236,22 @@ ROM_START( jokercrd ) ROM_LOAD( "ic13.bin", 0x0000, 0x0200, CRC(e59fc06e) SHA1(88a3bb89f020fe2b20f768ca010a082e0b974831) ) ROM_END +ROM_START( jokercrdf ) + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "bc4_t.ic38", 0x4000, 0x4000, CRC(2c1701b2) SHA1(1457bc1c0c7845173ebb930dfe3d313a4866b9ad) ) + ROM_LOAD( "bc4_p.ic12", 0xc000, 0x4000, CRC(b5fde2a2) SHA1(508c881267447c06d0d65e9ca2517574d2b73fcc) ) + + ROM_REGION( 0x0800, "decode", 0 ) // inside of the custom CPU + ROM_LOAD( "internal_table.bin", 0x0000, 0x0800, CRC(f1d8f35d) SHA1(2b5f9222a81a627d43fd8448385f85c71c24b914) ) + + ROM_REGION( 0x10000, "gfx1", 0 ) + ROM_LOAD( "2.ic11", 0x0000, 0x8000, CRC(ba994fc3) SHA1(95d2a802c38d7249f10eb2bbe46edfb9b14b6faa) ) + ROM_LOAD( "1.ic10", 0x8000, 0x8000, CRC(367db105) SHA1(400b82dc9e0be4c17a02add009aab3c43dd901f8) ) + + ROM_REGION( 0x0200, "proms", 0 ) + // PROM was broken beyond repair on this PCB, using the one from jokcrdep since GFX ROMs match 100% + ROM_LOAD( "ic13.bin", 0x0000, 0x0200, BAD_DUMP CRC(f990a9ae) SHA1(f7133798b5f20dd5b8dbe5d1a6876341710d93a8) ) +ROM_END /* Mongolfier New @@ -8981,6 +8997,7 @@ GAME( 2001, multiwinb, multiwin, fw2ndpal, funworld, funworld_state, empty_in GAME( 1993, powercrd, 0, multiwina,funworld, multiwina_state,empty_init, ROT0, "Fun World", "Power Card (Ver 0263, encrypted)", 0 ) // clone of Bonus Card. GAME( 1993, megacard, 0, multiwina,funworld, multiwina_state,empty_init, ROT0, "Fun World", "Mega Card (Ver.0210, encrypted)", 0 ) GAME( 1993, megacarda, megacard, multiwina,funworld, multiwina_state,empty_init, ROT0, "Fun World", "Mega Card (Ver.0053, encrypted)", 0 ) +GAME( 1993, jokercrdf, 0, multiwina,funworld, multiwina_state,empty_init, ROT0, "Fun World", "Joker Card (encrypted)", 0 ) GAME( 1993, jokercrd, 0, jokercrd, funworld, jokercrd_state, empty_init, ROT0, "Amatic Trading", "Joker Card 300 (Ver.A267BC, encrypted)", 0 ) GAME( 1991, royalcrdf, royalcrd, royalcrdf,royalcrdf, royalcrdf_state,driver_init, ROT0, "Evona Electronic", "Royal Card (Evona, Polish, encrypted)", 0 ) GAME( 198?, saloon, 0, saloon, saloon, funworld_state, init_saloon, ROT0, "", "Saloon (French, encrypted)", 0 ) diff --git a/src/mame/galaxian/galaxian_rockclim.cpp b/src/mame/galaxian/galaxian_rockclim.cpp index a42f931b939..8bd6a81efd1 100644 --- a/src/mame/galaxian/galaxian_rockclim.cpp +++ b/src/mame/galaxian/galaxian_rockclim.cpp @@ -238,7 +238,7 @@ void galaxian_rockclim_state::rockclim_palette(palette_device &palette) const // blue component bit0 = BIT(*color_prom, 6); bit1 = BIT(*color_prom, 7); - int const b = 0x4f * bit0 + 0xa8 * bit1; + int const b = 0x52 * bit0 + 0xad * bit1; palette.set_pen_color(i, r, g, b); color_prom++; diff --git a/src/mame/galaxian/galaxold_v.cpp b/src/mame/galaxian/galaxold_v.cpp index 07c83b0f923..42b6e63cd2e 100644 --- a/src/mame/galaxian/galaxold_v.cpp +++ b/src/mame/galaxian/galaxold_v.cpp @@ -68,7 +68,7 @@ void galaxold_state::galaxold_palette(palette_device &palette) // blue component bit0 = BIT(*color_prom, 6); bit1 = BIT(*color_prom, 7); - int const b = 0x4f * bit0 + 0xa8 * bit1; + int const b = 0x52 * bit0 + 0xad * bit1; palette.set_pen_color(i, r, g, b); color_prom++; @@ -134,7 +134,7 @@ void galaxold_state::s2650_palette(palette_device &palette) const // blue component bit0 = BIT(*color_prom, 6); bit1 = BIT(*color_prom, 7); - int const b = 0x4f * bit0 + 0xa8 * bit1; + int const b = 0x52 * bit0 + 0xad * bit1; palette.set_pen_color(i, r, g, b); color_prom++; @@ -281,7 +281,7 @@ void galaxold_state::dambustr_palette(palette_device &palette) // blue component bit0 = BIT(*color_prom, 6); bit1 = BIT(*color_prom, 7); - int const g = 0x4f * bit0 + 0xa8 * bit1; + int const g = 0x52 * bit0 + 0xad * bit1; palette.set_pen_color(i, r, g, b); color_prom++; @@ -305,7 +305,7 @@ void galaxold_state::dambustr_palette(palette_device &palette) { int const r = BIT(i, 0) * 0x47; int const g = BIT(i, 1) * 0x47; - int const b = BIT(i, 2) * 0x4f; + int const b = BIT(i, 2) * 0x47; palette.set_pen_color(BACKGROUND_COLOR_BASE + i, r, g, b); } } diff --git a/src/mame/heathzenith/h19.cpp b/src/mame/heathzenith/h19.cpp index a3b0fe21fa7..acbed68032d 100644 --- a/src/mame/heathzenith/h19.cpp +++ b/src/mame/heathzenith/h19.cpp @@ -12,7 +12,7 @@ #include "emu.h" -#include "tlb.h" +#include "bus/heathzenith/h19/tlb.h" #include "bus/rs232/rs232.h" #include "h19.lh" diff --git a/src/mame/heathzenith/h89.cpp b/src/mame/heathzenith/h89.cpp index ca3bb725ccd..0412404811b 100644 --- a/src/mame/heathzenith/h89.cpp +++ b/src/mame/heathzenith/h89.cpp @@ -44,9 +44,8 @@ #include "emu.h" #include "intr_cntrl.h" -#include "sigmasoft_parallel_port.h" -#include "tlb.h" +#include "bus/heathzenith/h19/tlb.h" #include "bus/heathzenith/h89/h89bus.h" #include "bus/heathzenith/h89/cards.h" #include "cpu/z80/z80.h" @@ -198,17 +197,11 @@ class h89_sigmasoft_state : public h89_state { public: h89_sigmasoft_state(const machine_config &mconfig, device_type type, const char *tag): - h89_state(mconfig, type, tag), - m_sigma_parallel(*this, "sigma_parallel") + h89_state(mconfig, type, tag) { } void h89_sigmasoft(machine_config &config); - -protected: - required_device m_sigma_parallel; - - void h89_sigmasoft_io(address_map &map); }; @@ -377,44 +370,6 @@ void h89_base_state::h89_base_io(address_map &map) map.global_mask(0xff); } -void h89_sigmasoft_state::h89_sigmasoft_io(address_map &map) -{ - h89_base_io(map); - - // Add SigmaSoft parallel port board, required for IGC graphics - map(0x08,0x0f).rw(m_sigma_parallel, FUNC(sigmasoft_parallel_port::read), FUNC(sigmasoft_parallel_port::write)); -} - -/* - Memory Map for MMS 444-61C PROM - - PORT - Use | Hex | - ----------------------------+-------+ - Not specified, available | 0-37 | - MMS 77316 | 38-3F | - MMS Internal test fixtures | 40-47 | - MMS 77317 ACT/XCOMP I/O | 48-4F | - MMS 77315 CAMEO I/O | 50-56 | - Unused | 57 | - MMS 77314 Corvus I/O | 58-59 | - MMS 77314 REMEX I/O | 5A-5B | - MMS 77314,15,17 Conf Port | 5C | - Unused | 5D-77 | - Disk I/O #1 | 78-7B | - Disk I/O #2 | 7C-7F | - HDOS reserved | 80-CF | - DCE Serial I/O | D0-D7 | - DTE Serial I/O | D8-DF | - DCE Serial I/O | EO-E7 | - Console I/O | E8-EF | - NMI | F0-F1 | - General purpose port | F2 | - Unused | F8-F9 | - NMI | FA-FB | - Unused | FC-FF | - */ - // Input ports static INPUT_PORTS_START( h88 ) @@ -1032,19 +987,10 @@ void h89_sigmasoft_state::h89_sigmasoft(machine_config &config) { h89(config); m_h89bus->set_default_bios_tag("444-61"); - m_maincpu->set_addrmap(AS_IO, &h89_sigmasoft_state::h89_sigmasoft_io); sigma_tlb_options(m_tlbc); - SIGMASOFT_PARALLEL_PORT(config, m_sigma_parallel); - m_sigma_parallel->ctrl_r_cb().set(m_tlbc, FUNC(heath_tlb_connector::sigma_ctrl_r)); - m_sigma_parallel->video_mem_r_cb().set(m_tlbc, FUNC(heath_tlb_connector::sigma_video_mem_r)); - m_sigma_parallel->video_mem_cb().set(m_tlbc, FUNC(heath_tlb_connector::sigma_video_mem_w)); - m_sigma_parallel->io_lo_cb().set(m_tlbc, FUNC(heath_tlb_connector::sigma_io_lo_addr_w)); - m_sigma_parallel->io_hi_cb().set(m_tlbc, FUNC(heath_tlb_connector::sigma_io_hi_addr_w)); - m_sigma_parallel->window_lo_cb().set(m_tlbc, FUNC(heath_tlb_connector::sigma_window_lo_addr_w)); - m_sigma_parallel->window_hi_cb().set(m_tlbc, FUNC(heath_tlb_connector::sigma_window_hi_addr_w)); - m_sigma_parallel->ctrl_cb().set(m_tlbc, FUNC(heath_tlb_connector::sigma_ctrl_w)); + H89BUS_LEFT_SLOT(config.replace(), "p501", "h89bus", h89_left_cards, "ss_parallel"); } void h89_mms_state::h89_mms(machine_config &config) diff --git a/src/mame/heathzenith/sigmasoft_parallel_port.cpp b/src/mame/heathzenith/sigmasoft_parallel_port.cpp deleted file mode 100644 index a412f204245..00000000000 --- a/src/mame/heathzenith/sigmasoft_parallel_port.cpp +++ /dev/null @@ -1,165 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Mark Garlanger -/*************************************************************************** - - SigmaSoft Universal Parallel Interface Board - - -****************************************************************************/ - -#include "emu.h" - -#include "sigmasoft_parallel_port.h" - -// -// Logging defines -// -#define LOG_REG (1U << 1) // Shows register setup -#define LOG_FUNC (1U << 2) // Function calls - -#define VERBOSE (0) - -#include "logmacro.h" - -#define LOGREG(...) LOGMASKED(LOG_REG, __VA_ARGS__) -#define LOGFUNC(...) LOGMASKED(LOG_FUNC, __VA_ARGS__) - -#ifdef _MSC_VER -#define FUNCNAME __func__ -#else -#define FUNCNAME __PRETTY_FUNCTION__ -#endif - - -DEFINE_DEVICE_TYPE(SIGMASOFT_PARALLEL_PORT, sigmasoft_parallel_port, "sigmasoft_parallel_port", "SigmaSoft Universal Parallel Board"); - -sigmasoft_parallel_port::sigmasoft_parallel_port(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock): - device_t(mconfig, SIGMASOFT_PARALLEL_PORT, tag, owner, clock), - m_ctrl_r(*this, 0x00), - m_video_mem_r(*this, 0x00), - m_video_mem_w(*this), - m_io_lo_addr(*this), - m_io_hi_addr(*this), - m_window_lo_addr(*this), - m_window_hi_addr(*this), - m_ctrl_w(*this) -{ -} - -void sigmasoft_parallel_port::video_mem_w(u8 val) -{ - m_video_mem_w(val); -} - -void sigmasoft_parallel_port::io_lo_addr_w(u8 val) -{ - m_io_lo_addr(val); -} - -void sigmasoft_parallel_port::io_hi_addr_w(u8 val) -{ - m_io_hi_addr(val); -} - -void sigmasoft_parallel_port::window_lo_addr_w(u8 val) -{ - m_window_lo_addr(val); -} - -void sigmasoft_parallel_port::window_hi_addr_w(u8 val) -{ - m_window_hi_addr(val); -} - -void sigmasoft_parallel_port::ctrl_w(u8 val) -{ - m_ctrl_w(val); -} - -void sigmasoft_parallel_port::write(offs_t reg, u8 val) -{ - LOGFUNC("%s: reg: %d val: %d\n", FUNCNAME, reg, val); - - switch (reg) - { - case 0: - video_mem_w(val); - break; - case 1: - io_lo_addr_w(val); - break; - case 2: - io_hi_addr_w(val); - break; - case 3: - window_lo_addr_w(val); - break; - case 4: - window_hi_addr_w(val); - break; - case 5: - ctrl_w(val); - break; - case 6: - // TODO - Centronics interface - break; - case 7: - // TODO - Centronics interface - break; - } -} - -u8 sigmasoft_parallel_port::video_mem_r() -{ - // get video memory value from igc device - return m_video_mem_r(); -} - -u8 sigmasoft_parallel_port::ctrl_r() -{ - // get control register from igc device - return m_ctrl_r(); -} - -u8 sigmasoft_parallel_port::read(offs_t reg) -{ - // default return for the h89 - u8 value = 0xff; - - switch (reg) - { - case 0: - value = video_mem_r(); - break; - case 1: - // TODO - Light Pen Low address - break; - case 2: - // TODO - Light Pen High address - break; - case 3: - // TODO - Left input device - break; - case 4: - // TODO - Right input device - break; - case 5: - // Control Register - value = ctrl_r(); - break; - case 6: - // TODO - Centronics interface - break; - case 7: - // TODO - Centronics interface - break; - } - - LOGFUNC("%s: reg: %d val: %d\n", FUNCNAME, reg, value); - - return value; -} - -void sigmasoft_parallel_port::device_start() -{ -} diff --git a/src/mame/heathzenith/sigmasoft_parallel_port.h b/src/mame/heathzenith/sigmasoft_parallel_port.h deleted file mode 100644 index 60030b2647b..00000000000 --- a/src/mame/heathzenith/sigmasoft_parallel_port.h +++ /dev/null @@ -1,67 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Mark Garlanger -/*************************************************************************** - - SigmaSoft Universal Parallel Interface Board - -****************************************************************************/ - -#ifndef MAME_HEATHZENITH_SIGMASOFT_PARALLEL_PORT_H -#define MAME_HEATHZENITH_SIGMASOFT_PARALLEL_PORT_H - -#pragma once - - -class sigmasoft_parallel_port : public device_t -{ -public: - sigmasoft_parallel_port(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock = 0); - - void write(offs_t reg, u8 val); - u8 read(offs_t reg); - - auto ctrl_r_cb() { return m_ctrl_r.bind(); } - auto video_mem_r_cb() { return m_video_mem_r.bind(); } - - auto video_mem_cb() { return m_video_mem_w.bind(); } - auto io_lo_cb() { return m_io_lo_addr.bind(); } - auto io_hi_cb() { return m_io_hi_addr.bind(); } - auto window_lo_cb() { return m_window_lo_addr.bind(); } - auto window_hi_cb() { return m_window_hi_addr.bind(); } - auto ctrl_cb() { return m_ctrl_w.bind(); } - -protected: - - virtual void device_start() override ATTR_COLD; - - u8 video_mem_r(); - void video_mem_w(u8 val); - - void io_lo_addr_w(u8 val); - void io_hi_addr_w(u8 val); - - void window_lo_addr_w(u8 val); - void window_hi_addr_w(u8 val); - - void ctrl_w(u8 val); - u8 ctrl_r(); - -private: - - // Reads - devcb_read8 m_ctrl_r; - devcb_read8 m_video_mem_r; - - // Writes - devcb_write8 m_video_mem_w; - devcb_write8 m_io_lo_addr; - devcb_write8 m_io_hi_addr; - devcb_write8 m_window_lo_addr; - devcb_write8 m_window_hi_addr; - devcb_write8 m_ctrl_w; -}; - -DECLARE_DEVICE_TYPE(SIGMASOFT_PARALLEL_PORT, sigmasoft_parallel_port) - - -#endif // MAME_HEATHZENITH_SIGMASOFT_PARALLEL_PORT_H diff --git a/src/mame/irem/m63.cpp b/src/mame/irem/m63.cpp index 7ad5982bd25..c2e2802fdbe 100644 --- a/src/mame/irem/m63.cpp +++ b/src/mame/irem/m63.cpp @@ -277,7 +277,7 @@ void m63_state::m63_palette(palette_device &palette) const // blue component bit0 = BIT(color_prom[i], 6); bit1 = BIT(color_prom[i], 7); - int const b = 0x4f * bit0 + 0xa8 * bit1; + int const b = 0x52 * bit0 + 0xad * bit1; palette.set_pen_color(i + 256, rgb_t(r, g, b)); } diff --git a/src/mame/jaleco/tetrisp2.cpp b/src/mame/jaleco/tetrisp2.cpp index aad5257ef20..5c47ea3a236 100644 --- a/src/mame/jaleco/tetrisp2.cpp +++ b/src/mame/jaleco/tetrisp2.cpp @@ -74,34 +74,20 @@ To Do: ***************************************************************************/ -u16 tetrisp2_state::rockn_adpcmbank_r() +u16 rockn_state::rockn_adpcmbank_r() { return ((m_rockn_adpcmbank & 0xf0ff) | (m_rockn_protectdata << 8)); } -void tetrisp2_state::rockn_adpcmbank_w(u16 data) +void rockn_state::rockn_adpcmbank_w(u16 data) { - u8 *SNDROM = memregion("ymz")->base(); - int bank; - m_rockn_adpcmbank = data; - bank = ((data & 0x001f) >> 2); - - if (bank > 7) - { - popmessage("!!!!! ADPCM BANK OVER:%01X (%04X) !!!!!", bank, data); - bank = 0; - } - - memcpy(&SNDROM[0x0400000], &SNDROM[0x1000000 + (0x0c00000 * bank)], 0x0c00000); + m_ymzbank[0]->set_entry((data >> 2) & 0x07); } -void tetrisp2_state::rockn2_adpcmbank_w(u16 data) +void rockn_state::rockn2_adpcmbank_w(u16 data) { - u8 *SNDROM = memregion("ymz")->base(); - int bank; - - char banktable[9][3]= + const uint8_t banktable[9][3]= { { 0, 1, 2 }, // bank $00 { 3, 4, 5 }, // bank $04 @@ -115,7 +101,7 @@ void tetrisp2_state::rockn2_adpcmbank_w(u16 data) }; m_rockn_adpcmbank = data; - bank = ((data & 0x003f) >> 2); + int bank = ((data & 0x003f) >> 2); if (bank > 8) { @@ -123,46 +109,40 @@ void tetrisp2_state::rockn2_adpcmbank_w(u16 data) bank = 0; } - memcpy(&SNDROM[0x0400000], &SNDROM[0x1000000 + (0x0400000 * banktable[bank][0] )], 0x0400000); - memcpy(&SNDROM[0x0800000], &SNDROM[0x1000000 + (0x0400000 * banktable[bank][1] )], 0x0400000); - memcpy(&SNDROM[0x0c00000], &SNDROM[0x1000000 + (0x0400000 * banktable[bank][2] )], 0x0400000); + for (int i = 0; i < 3; i++) + m_ymzbank[i]->set_entry(banktable[bank][i]); } -u16 tetrisp2_state::rockn_soundvolume_r() +u16 rockn_state::rockn_soundvolume_r() { return 0xffff; } -void tetrisp2_state::rockn_soundvolume_w(u16 data) +void rockn_state::rockn_soundvolume_w(u16 data) { m_rockn_soundvolume = data; // TODO: unemulated } -void tetrisp2_state::nndmseal_sound_bank_w(offs_t offset, u16 data, u16 mem_mask) +void nndmseal_state::nndmseal_sound_bank_w(u8 data) { - if (ACCESSING_BITS_0_7) + if (BIT(data, 2)) { - u8 *rom = memregion("okisource")->base(); - - if (data & 0x04) - { - m_bank_lo = data & 0x03; + m_bank_lo = data & 0x03; - memcpy(memregion("oki")->base(), rom + (m_bank_lo * 0x80000), 0x20000); + m_okibank[0]->set_entry(m_bank_lo); + m_okibank[1]->set_entry((m_bank_lo * 4) + m_bank_hi); -// logerror("PC:%06X sound bank_lo = %02X\n",m_maincpu->pc(),m_bank_lo); - } - else - { - m_bank_hi = data & 0x03; - - memcpy(memregion("oki")->base() + 0x20000, rom + (m_bank_lo * 0x80000) + (m_bank_hi * 0x20000), 0x20000); +// logerror("PC:%06X sound bank_lo = %02X\n",m_maincpu->pc(),m_bank_lo); + } + else + { + m_bank_hi = data & 0x03; + m_okibank[1]->set_entry((m_bank_lo * 4) + m_bank_hi); -// logerror("PC:%06X sound bank_hi = %02X\n",m_maincpu->pc(),m_bank_hi); - } +// logerror("PC:%06X sound bank_hi = %02X\n",m_maincpu->pc(),m_bank_hi); } } @@ -176,9 +156,9 @@ void tetrisp2_state::nndmseal_sound_bank_w(offs_t offset, u16 data, u16 mem_mask u16 tetrisp2_state::tetrisp2_ip_1_word_r() { - return ( ioport("SYSTEM")->read() & 0xfcff ) | - ( machine().rand() & ~0xfcff ) | - ( 1 << (8 + (machine().rand()&1)) ); + return (m_io_system->read() & 0xfcff) | + ( machine().rand() & ~0xfcff) | + (1 << (8 + (machine().rand() & 1))); } @@ -195,18 +175,18 @@ u16 tetrisp2_state::tetrisp2_ip_1_word_r() /* The game only ever writes even bytes and reads odd bytes */ u16 tetrisp2_state::tetrisp2_nvram_r(offs_t offset) { - return ( (m_nvram[offset] >> 8) & 0x00ff ) | - ( (m_nvram[offset] << 8) & 0xff00 ) ; + return ((m_nvram[offset] >> 8) & 0x00ff) | + ((m_nvram[offset] << 8) & 0xff00); } -void tetrisp2_state::tetrisp2_nvram_w(offs_t offset, u16 data, u16 mem_mask) +void tetrisp2_state::nvram_w(offs_t offset, u16 data, u16 mem_mask) { COMBINE_DATA(&m_nvram[offset]); } -u16 tetrisp2_state::rockn_nvram_r(offs_t offset) +u16 rockn_state::rockn_nvram_r(offs_t offset) { - return m_nvram[offset]; + return m_nvram[offset]; } @@ -219,32 +199,32 @@ u16 tetrisp2_state::rockn_nvram_r(offs_t offset) ***************************************************************************/ -u16 rocknms_state::rocknms_main2sub_r() +u16 rocknms_state::main2sub_r() { - return m_rocknms_main2sub; + return m_main2sub; } -void rocknms_state::rocknms_main2sub_w(offs_t offset, u16 data, u16 mem_mask) +void rocknms_state::main2sub_w(offs_t offset, u16 data, u16 mem_mask) { if (ACCESSING_BITS_0_7) - m_rocknms_main2sub = (data ^ 0xffff); + m_main2sub = (data ^ 0xffff); } -ioport_value rocknms_state::rocknms_main2sub_status_r() +ioport_value rocknms_state::main2sub_status_r() { - return m_rocknms_sub2main & 0x0003; + return m_sub2main & 0x0003; } -void rocknms_state::rocknms_sub2main_w(offs_t offset, u16 data, u16 mem_mask) +void rocknms_state::sub2main_w(offs_t offset, u16 data, u16 mem_mask) { if (ACCESSING_BITS_0_7) - m_rocknms_sub2main = (data ^ 0xffff); + m_sub2main = (data ^ 0xffff); } void tetrisp2_state::tetrisp2_coincounter_w(u16 data) { - machine().bookkeeping().coin_counter_w(0, (data & 0x0001)); + machine().bookkeeping().coin_counter_w(0, BIT(data, 0)); } @@ -260,26 +240,26 @@ void tetrisp2_state::tetrisp2_coincounter_w(u16 data) void tetrisp2_state::tetrisp2_map(address_map &map) { map(0x000000, 0x0fffff).rom(); // ROM - map(0x100000, 0x103fff).ram().share("spriteram"); // Object RAM + map(0x100000, 0x103fff).ram().share(m_spriteram); // Object RAM map(0x104000, 0x107fff).ram(); // Spare Object RAM map(0x108000, 0x10ffff).ram(); // Work RAM - map(0x200000, 0x23ffff).rw(FUNC(tetrisp2_state::tetrisp2_priority_r), FUNC(tetrisp2_state::tetrisp2_priority_w)); - map(0x300000, 0x31ffff).ram().w(FUNC(tetrisp2_state::tetrisp2_palette_w)).share("paletteram"); // Palette - map(0x400000, 0x403fff).ram().w(FUNC(tetrisp2_state::tetrisp2_vram_fg_w)).share("vram_fg"); // Foreground - map(0x404000, 0x407fff).ram().w(FUNC(tetrisp2_state::tetrisp2_vram_bg_w)).share("vram_bg"); // Background + map(0x200000, 0x23ffff).rw(FUNC(tetrisp2_state::priority_r), FUNC(tetrisp2_state::priority_w)); + map(0x300000, 0x31ffff).ram().w(FUNC(tetrisp2_state::palette_w)).share(m_paletteram); // Palette + map(0x400000, 0x403fff).ram().w(FUNC(tetrisp2_state::vram_fg_w)).share(m_vram_fg); // Foreground + map(0x404000, 0x407fff).ram().w(FUNC(tetrisp2_state::vram_bg_w)).share(m_vram_bg); // Background map(0x408000, 0x409fff).ram(); // ??? map(0x500000, 0x50ffff).ram(); // Line - map(0x600000, 0x60ffff).ram().w(FUNC(tetrisp2_state::tetrisp2_vram_rot_w)).share("vram_rot"); // Rotation - map(0x650000, 0x651fff).ram().w(FUNC(tetrisp2_state::tetrisp2_vram_rot_w)); // Rotation (mirror) + map(0x600000, 0x60ffff).ram().w(FUNC(tetrisp2_state::vram_rot_w)).share(m_vram_rot); // Rotation + map(0x650000, 0x651fff).ram().w(FUNC(tetrisp2_state::vram_rot_w)); // Rotation (mirror) map(0x800000, 0x800003).rw("ymz", FUNC(ymz280b_device::read), FUNC(ymz280b_device::write)).umask16(0x00ff); // Sound - map(0x900000, 0x903fff).r(FUNC(tetrisp2_state::tetrisp2_nvram_r)).w(FUNC(tetrisp2_state::tetrisp2_nvram_w)).share("nvram"); // NVRAM - map(0x904000, 0x907fff).r(FUNC(tetrisp2_state::tetrisp2_nvram_r)).w(FUNC(tetrisp2_state::tetrisp2_nvram_w)); // NVRAM (mirror) + map(0x900000, 0x903fff).r(FUNC(tetrisp2_state::tetrisp2_nvram_r)).w(FUNC(tetrisp2_state::nvram_w)).share("nvram"); // NVRAM + map(0x904000, 0x907fff).r(FUNC(tetrisp2_state::tetrisp2_nvram_r)).w(FUNC(tetrisp2_state::nvram_w)); // NVRAM (mirror) map(0xb00000, 0xb00001).w(FUNC(tetrisp2_state::tetrisp2_coincounter_w)); // Coin Counter map(0xb20000, 0xb20001).nopw(); // ??? - map(0xb40000, 0xb4000b).writeonly().share("scroll_fg"); // Foreground Scrolling - map(0xb40010, 0xb4001b).writeonly().share("scroll_bg"); // Background Scrolling + map(0xb40000, 0xb4000b).writeonly().share(m_scroll_fg); // Foreground Scrolling + map(0xb40010, 0xb4001b).writeonly().share(m_scroll_bg); // Background Scrolling map(0xb4003e, 0xb4003f).nopw(); // scr_size - map(0xb60000, 0xb6002f).writeonly().share("rotregs"); // Rotation Registers + map(0xb60000, 0xb6002f).writeonly().share(m_rotregs); // Rotation Registers map(0xba0000, 0xba001f).m(m_sysctrl, FUNC(jaleco_ms32_sysctrl_device::amap)); map(0xbe0000, 0xbe0001).nopr(); // INT-level1 dummy read map(0xbe0002, 0xbe0003).portr("PLAYERS"); // Inputs @@ -289,13 +269,13 @@ void tetrisp2_state::tetrisp2_map(address_map &map) } -void tetrisp2_state::nndmseal_coincounter_w(offs_t offset, u16 data, u16 mem_mask) +void nndmseal_state::nndmseal_coincounter_w(offs_t offset, u16 data, u16 mem_mask) { if (ACCESSING_BITS_0_7) { - machine().bookkeeping().coin_counter_w(0, data & 0x0001 ); - // data & 0x0004 ? - machine().bookkeeping().coin_lockout_w(0,(~data) & 0x0008 ); + machine().bookkeeping().coin_counter_w(0, BIT( data, 0)); + // BIT(data, 2) ? + machine().bookkeeping().coin_lockout_w(0, BIT(~data, 3)); } if (ACCESSING_BITS_8_15) { @@ -307,43 +287,43 @@ void tetrisp2_state::nndmseal_coincounter_w(offs_t offset, u16 data, u16 mem_mas // popmessage("%04x",data); } -void tetrisp2_state::nndmseal_b20000_w(u16 data) +void nndmseal_state::nndmseal_b20000_w(u16 data) { // leds? // popmessage("%04x",data); } -void tetrisp2_state::nndmseal_map(address_map &map) +void nndmseal_state::nndmseal_map(address_map &map) { map(0x000000, 0x07ffff).rom(); - map(0x100000, 0x103fff).ram().share("spriteram"); // Object RAM + map(0x100000, 0x103fff).ram().share(m_spriteram); // Object RAM map(0x104000, 0x107fff).ram(); // Spare Object RAM map(0x108000, 0x10ffff).ram(); // Work RAM - map(0x200000, 0x23ffff).rw(FUNC(tetrisp2_state::tetrisp2_priority_r), FUNC(tetrisp2_state::tetrisp2_priority_w)); - map(0x300000, 0x31ffff).ram().w(FUNC(tetrisp2_state::tetrisp2_palette_w)).share("paletteram"); // Palette - map(0x400000, 0x403fff).ram().w(FUNC(tetrisp2_state::tetrisp2_vram_fg_w)).share("vram_fg"); // Foreground - map(0x404000, 0x407fff).ram().w(FUNC(tetrisp2_state::tetrisp2_vram_bg_w)).share("vram_bg"); // Background + map(0x200000, 0x23ffff).rw(FUNC(nndmseal_state::priority_r), FUNC(nndmseal_state::priority_w)); + map(0x300000, 0x31ffff).ram().w(FUNC(nndmseal_state::palette_w)).share(m_paletteram); // Palette + map(0x400000, 0x403fff).ram().w(FUNC(nndmseal_state::vram_fg_w)).share(m_vram_fg); // Foreground + map(0x404000, 0x407fff).ram().w(FUNC(nndmseal_state::vram_bg_w)).share(m_vram_bg); // Background map(0x408000, 0x409fff).ram(); // ??? map(0x500000, 0x50ffff).ram(); // Line - map(0x600000, 0x60ffff).ram().w(FUNC(tetrisp2_state::tetrisp2_vram_rot_w)).share("vram_rot"); // Rotation - map(0x650000, 0x651fff).ram().w(FUNC(tetrisp2_state::tetrisp2_vram_rot_w)); // Rotation (mirror) + map(0x600000, 0x60ffff).ram().w(FUNC(nndmseal_state::vram_rot_w)).share(m_vram_rot); // Rotation + map(0x650000, 0x651fff).ram().w(FUNC(nndmseal_state::vram_rot_w)); // Rotation (mirror) map(0x800000, 0x800003).rw("oki", FUNC(okim6295_device::read), FUNC(okim6295_device::write)).umask16(0x00ff); // Sound - map(0x900000, 0x903fff).rw(FUNC(tetrisp2_state::tetrisp2_nvram_r), FUNC(tetrisp2_state::tetrisp2_nvram_w)).share("nvram"); // NVRAM + map(0x900000, 0x903fff).rw(FUNC(nndmseal_state::tetrisp2_nvram_r), FUNC(nndmseal_state::nvram_w)).share("nvram"); // NVRAM - map(0xb00000, 0xb00001).w(FUNC(tetrisp2_state::nndmseal_coincounter_w)); // Coin Counter - map(0xb20000, 0xb20001).w(FUNC(tetrisp2_state::nndmseal_b20000_w)); // ??? + map(0xb00000, 0xb00001).w(FUNC(nndmseal_state::nndmseal_coincounter_w)); // Coin Counter + map(0xb20000, 0xb20001).w(FUNC(nndmseal_state::nndmseal_b20000_w)); // ??? - map(0xb40000, 0xb4000b).writeonly().share("scroll_fg"); // Foreground Scrolling - map(0xb40010, 0xb4001b).writeonly().share("scroll_bg"); // Background Scrolling + map(0xb40000, 0xb4000b).writeonly().share(m_scroll_fg); // Foreground Scrolling + map(0xb40010, 0xb4001b).writeonly().share(m_scroll_bg); // Background Scrolling map(0xb4003e, 0xb4003f).nopw(); // scr_size - map(0xb60000, 0xb6002f).writeonly().share("rotregs"); // Rotation Registers + map(0xb60000, 0xb6002f).writeonly().share(m_rotregs); // Rotation Registers - map(0xb80000, 0xb80001).w(FUNC(tetrisp2_state::nndmseal_sound_bank_w)); + map(0xb80001, 0xb80001).w(FUNC(nndmseal_state::nndmseal_sound_bank_w)); map(0xba0000, 0xba001f).m(m_sysctrl, FUNC(jaleco_ms32_sysctrl_device::amap)); @@ -356,31 +336,37 @@ void tetrisp2_state::nndmseal_map(address_map &map) map(0xbe000a, 0xbe000b).r("watchdog", FUNC(watchdog_timer_device::reset16_r)); } +void nndmseal_state::nndmseal_oki_map(address_map &map) +{ + map(0x00000, 0x1ffff).bankr(m_okibank[0]); + map(0x20000, 0x3ffff).bankr(m_okibank[1]); +} -void tetrisp2_state::rockn1_map(address_map &map) + +void rockn_state::rockn1_map(address_map &map) { map(0x000000, 0x0fffff).rom(); // ROM - map(0x100000, 0x103fff).ram().share("spriteram"); // Object RAM + map(0x100000, 0x103fff).ram().share(m_spriteram); // Object RAM map(0x104000, 0x107fff).ram(); // Spare Object RAM map(0x108000, 0x10ffff).ram(); // Work RAM - map(0x200000, 0x23ffff).rw(FUNC(tetrisp2_state::tetrisp2_priority_r), FUNC(tetrisp2_state::tetrisp2_priority_w)); - map(0x300000, 0x31ffff).ram().w(FUNC(tetrisp2_state::tetrisp2_palette_w)).share("paletteram"); // Palette - map(0x400000, 0x403fff).ram().w(FUNC(tetrisp2_state::tetrisp2_vram_fg_w)).share("vram_fg"); // Foreground - map(0x404000, 0x407fff).ram().w(FUNC(tetrisp2_state::tetrisp2_vram_bg_w)).share("vram_bg"); // Background + map(0x200000, 0x23ffff).rw(FUNC(rockn_state::priority_r), FUNC(rockn_state::priority_w)); + map(0x300000, 0x31ffff).ram().w(FUNC(rockn_state::palette_w)).share(m_paletteram); // Palette + map(0x400000, 0x403fff).ram().w(FUNC(rockn_state::vram_fg_w)).share(m_vram_fg); // Foreground + map(0x404000, 0x407fff).ram().w(FUNC(rockn_state::vram_bg_w)).share(m_vram_bg); // Background map(0x408000, 0x409fff).ram(); // ??? map(0x500000, 0x50ffff).ram(); // Line - map(0x600000, 0x60ffff).ram().w(FUNC(tetrisp2_state::tetrisp2_vram_rot_w)).share("vram_rot"); // Rotation - map(0x900000, 0x903fff).r(FUNC(tetrisp2_state::rockn_nvram_r)).w(FUNC(tetrisp2_state::tetrisp2_nvram_w)).share("nvram"); // NVRAM - map(0xa30000, 0xa30001).rw(FUNC(tetrisp2_state::rockn_soundvolume_r), FUNC(tetrisp2_state::rockn_soundvolume_w)); // Sound Volume + map(0x600000, 0x60ffff).ram().w(FUNC(rockn_state::vram_rot_w)).share(m_vram_rot); // Rotation + map(0x900000, 0x903fff).r(FUNC(rockn_state::rockn_nvram_r)).w(FUNC(rockn_state::nvram_w)).share("nvram"); // NVRAM + map(0xa30000, 0xa30001).rw(FUNC(rockn_state::rockn_soundvolume_r), FUNC(rockn_state::rockn_soundvolume_w)); // Sound Volume map(0xa40000, 0xa40003).rw("ymz", FUNC(ymz280b_device::read), FUNC(ymz280b_device::write)).umask16(0x00ff); // Sound - map(0xa44000, 0xa44001).rw(FUNC(tetrisp2_state::rockn_adpcmbank_r), FUNC(tetrisp2_state::rockn_adpcmbank_w)); // Sound Bank + map(0xa44000, 0xa44001).rw(FUNC(rockn_state::rockn_adpcmbank_r), FUNC(rockn_state::rockn_adpcmbank_w)); // Sound Bank map(0xa48000, 0xa48001).noprw(); // YMZ280 Reset - map(0xb00000, 0xb00001).w(FUNC(tetrisp2_state::tetrisp2_coincounter_w)); // Coin Counter + map(0xb00000, 0xb00001).w(FUNC(rockn_state::tetrisp2_coincounter_w)); // Coin Counter map(0xb20000, 0xb20001).noprw(); // ??? - map(0xb40000, 0xb4000b).writeonly().share("scroll_fg"); // Foreground Scrolling - map(0xb40010, 0xb4001b).writeonly().share("scroll_bg"); // Background Scrolling + map(0xb40000, 0xb4000b).writeonly().share(m_scroll_fg); // Foreground Scrolling + map(0xb40010, 0xb4001b).writeonly().share(m_scroll_bg); // Background Scrolling map(0xb4003e, 0xb4003f).nopw(); // scr_size - map(0xb60000, 0xb6002f).writeonly().share("rotregs"); // Rotation Registers + map(0xb60000, 0xb6002f).writeonly().share(m_rotregs); // Rotation Registers map(0xba0000, 0xba001f).m(m_sysctrl, FUNC(jaleco_ms32_sysctrl_device::amap)); map(0xbe0000, 0xbe0001).nopr(); // INT-level1 dummy read map(0xbe0002, 0xbe0003).portr("PLAYERS"); // Inputs @@ -389,31 +375,37 @@ void tetrisp2_state::rockn1_map(address_map &map) map(0xbe000a, 0xbe000b).r("watchdog", FUNC(watchdog_timer_device::reset16_r)); // Watchdog } +void rockn_state::rockn1_ymz_map(address_map &map) +{ + map(0x000000, 0x3fffff).rom().region("ymz", 0); + map(0x400000, 0xffffff).bankr(m_ymzbank[0]); +} + -void tetrisp2_state::rockn2_map(address_map &map) +void rockn_state::rockn2_map(address_map &map) { map(0x000000, 0x0fffff).rom(); // ROM - map(0x100000, 0x103fff).ram().share("spriteram"); // Object RAM + map(0x100000, 0x103fff).ram().share(m_spriteram); // Object RAM map(0x104000, 0x107fff).ram(); // Spare Object RAM map(0x108000, 0x10ffff).ram(); // Work RAM - map(0x200000, 0x23ffff).rw(FUNC(tetrisp2_state::tetrisp2_priority_r), FUNC(tetrisp2_state::tetrisp2_priority_w)); - map(0x300000, 0x31ffff).ram().w(FUNC(tetrisp2_state::tetrisp2_palette_w)).share("paletteram"); // Palette + map(0x200000, 0x23ffff).rw(FUNC(rockn_state::priority_r), FUNC(rockn_state::priority_w)); + map(0x300000, 0x31ffff).ram().w(FUNC(rockn_state::palette_w)).share(m_paletteram); // Palette map(0x500000, 0x50ffff).ram(); // Line - map(0x600000, 0x60ffff).ram().w(FUNC(tetrisp2_state::tetrisp2_vram_rot_w)).share("vram_rot"); // Rotation - map(0x800000, 0x803fff).ram().w(FUNC(tetrisp2_state::tetrisp2_vram_fg_w)).share("vram_fg"); // Foreground - map(0x804000, 0x807fff).ram().w(FUNC(tetrisp2_state::tetrisp2_vram_bg_w)).share("vram_bg"); // Background + map(0x600000, 0x60ffff).ram().w(FUNC(rockn_state::vram_rot_w)).share(m_vram_rot); // Rotation + map(0x800000, 0x803fff).ram().w(FUNC(rockn_state::vram_fg_w)).share(m_vram_fg); // Foreground + map(0x804000, 0x807fff).ram().w(FUNC(rockn_state::vram_bg_w)).share(m_vram_bg); // Background map(0x808000, 0x809fff).ram(); // ??? - map(0x900000, 0x903fff).r(FUNC(tetrisp2_state::rockn_nvram_r)).w(FUNC(tetrisp2_state::tetrisp2_nvram_w)).share("nvram"); // NVRAM - map(0xa30000, 0xa30001).rw(FUNC(tetrisp2_state::rockn_soundvolume_r), FUNC(tetrisp2_state::rockn_soundvolume_w)); // Sound Volume + map(0x900000, 0x903fff).r(FUNC(rockn_state::rockn_nvram_r)).w(FUNC(rockn_state::nvram_w)).share("nvram"); // NVRAM + map(0xa30000, 0xa30001).rw(FUNC(rockn_state::rockn_soundvolume_r), FUNC(rockn_state::rockn_soundvolume_w)); // Sound Volume map(0xa40000, 0xa40003).rw("ymz", FUNC(ymz280b_device::read), FUNC(ymz280b_device::write)).umask16(0x00ff); // Sound - map(0xa44000, 0xa44001).rw(FUNC(tetrisp2_state::rockn_adpcmbank_r), FUNC(tetrisp2_state::rockn2_adpcmbank_w)); // Sound Bank + map(0xa44000, 0xa44001).rw(FUNC(rockn_state::rockn_adpcmbank_r), FUNC(rockn_state::rockn2_adpcmbank_w)); // Sound Bank map(0xa48000, 0xa48001).nopw(); // YMZ280 Reset - map(0xb00000, 0xb00001).w(FUNC(tetrisp2_state::tetrisp2_coincounter_w)); // Coin Counter + map(0xb00000, 0xb00001).w(FUNC(rockn_state::tetrisp2_coincounter_w)); // Coin Counter map(0xb20000, 0xb20001).nopw(); // ??? - map(0xb40000, 0xb4000b).writeonly().share("scroll_fg"); // Foreground Scrolling - map(0xb40010, 0xb4001b).writeonly().share("scroll_bg"); // Background Scrolling + map(0xb40000, 0xb4000b).writeonly().share(m_scroll_fg); // Foreground Scrolling + map(0xb40010, 0xb4001b).writeonly().share(m_scroll_bg); // Background Scrolling map(0xb4003e, 0xb4003f).nopw(); // scr_size - map(0xb60000, 0xb6002f).writeonly().share("rotregs"); // Rotation Registers + map(0xb60000, 0xb6002f).writeonly().share(m_rotregs); // Rotation Registers map(0xba0000, 0xba001f).m(m_sysctrl, FUNC(jaleco_ms32_sysctrl_device::amap)); map(0xbe0000, 0xbe0001).nopr(); // INT-level1 dummy read map(0xbe0002, 0xbe0003).portr("PLAYERS"); // Inputs @@ -422,32 +414,40 @@ void tetrisp2_state::rockn2_map(address_map &map) map(0xbe000a, 0xbe000b).r("watchdog", FUNC(watchdog_timer_device::reset16_r)); // Watchdog } +void rockn_state::rockn2_ymz_map(address_map &map) +{ + map(0x000000, 0x3fffff).rom().region("ymz", 0); + map(0x400000, 0x7fffff).bankr(m_ymzbank[0]); + map(0x800000, 0xbfffff).bankr(m_ymzbank[1]); + map(0xc00000, 0xffffff).bankr(m_ymzbank[2]); +} + void rocknms_state::rocknms_main_map(address_map &map) { map(0x000000, 0x0fffff).rom(); // ROM - map(0x100000, 0x103fff).ram().share("spriteram"); // Object RAM + map(0x100000, 0x103fff).ram().share(m_spriteram); // Object RAM map(0x104000, 0x107fff).ram(); // Spare Object RAM map(0x108000, 0x10ffff).ram(); // Work RAM - map(0x200000, 0x23ffff).rw(FUNC(rocknms_state::tetrisp2_priority_r), FUNC(rocknms_state::tetrisp2_priority_w)); - map(0x300000, 0x31ffff).ram().w(FUNC(rocknms_state::tetrisp2_palette_w)).share("paletteram"); // Palette + map(0x200000, 0x23ffff).rw(FUNC(rocknms_state::priority_r), FUNC(rocknms_state::priority_w)); + map(0x300000, 0x31ffff).ram().w(FUNC(rocknms_state::palette_w)).share(m_paletteram); // Palette // map(0x500000, 0x50ffff).ram(); // Line - map(0x600000, 0x60ffff).ram().w(FUNC(rocknms_state::tetrisp2_vram_rot_w)).share("vram_rot"); // Rotation - map(0x800000, 0x803fff).ram().w(FUNC(rocknms_state::tetrisp2_vram_fg_w)).share("vram_fg"); // Foreground - map(0x804000, 0x807fff).ram().w(FUNC(rocknms_state::tetrisp2_vram_bg_w)).share("vram_bg"); // Background + map(0x600000, 0x60ffff).ram().w(FUNC(rocknms_state::vram_rot_w)).share(m_vram_rot); // Rotation + map(0x800000, 0x803fff).ram().w(FUNC(rocknms_state::vram_fg_w)).share(m_vram_fg); // Foreground + map(0x804000, 0x807fff).ram().w(FUNC(rocknms_state::vram_bg_w)).share(m_vram_bg); // Background // map(0x808000, 0x809fff).ram(); // ??? - map(0x900000, 0x903fff).r(FUNC(rocknms_state::rockn_nvram_r)).w(FUNC(rocknms_state::tetrisp2_nvram_w)).share("nvram"); // NVRAM + map(0x900000, 0x903fff).r(FUNC(rocknms_state::rockn_nvram_r)).w(FUNC(rocknms_state::nvram_w)).share("nvram"); // NVRAM map(0xa30000, 0xa30001).rw(FUNC(rocknms_state::rockn_soundvolume_r), FUNC(rocknms_state::rockn_soundvolume_w)); // Sound Volume map(0xa40000, 0xa40003).rw("ymz", FUNC(ymz280b_device::read), FUNC(ymz280b_device::write)).umask16(0x00ff); // Sound map(0xa44000, 0xa44001).rw(FUNC(rocknms_state::rockn_adpcmbank_r), FUNC(rocknms_state::rockn_adpcmbank_w)); // Sound Bank map(0xa48000, 0xa48001).nopw(); // YMZ280 Reset - map(0xa00000, 0xa00001).w(FUNC(rocknms_state::rocknms_main2sub_w)); // MAIN -> SUB Communication + map(0xa00000, 0xa00001).w(FUNC(rocknms_state::main2sub_w)); // MAIN -> SUB Communication map(0xb00000, 0xb00001).w(FUNC(rocknms_state::tetrisp2_coincounter_w)); // Coin Counter map(0xb20000, 0xb20001).nopw(); // ??? - map(0xb40000, 0xb4000b).writeonly().share("scroll_fg"); // Foreground Scrolling - map(0xb40010, 0xb4001b).writeonly().share("scroll_bg"); // Background Scrolling + map(0xb40000, 0xb4000b).writeonly().share(m_scroll_fg); // Foreground Scrolling + map(0xb40010, 0xb4001b).writeonly().share(m_scroll_bg); // Background Scrolling map(0xb4003e, 0xb4003f).nopw(); // scr_size - map(0xb60000, 0xb6002f).writeonly().share("rotregs"); // Rotation Registers + map(0xb60000, 0xb6002f).writeonly().share(m_rotregs); // Rotation Registers map(0xba0000, 0xba001f).m(m_sysctrl, FUNC(jaleco_ms32_sysctrl_device::amap)); map(0xbe0000, 0xbe0001).nopr(); // INT-level1 dummy read map(0xbe0002, 0xbe0003).portr("PLAYERS"); @@ -460,30 +460,30 @@ void rocknms_state::rocknms_main_map(address_map &map) void rocknms_state::rocknms_sub_map(address_map &map) { map(0x000000, 0x0fffff).rom(); // ROM - map(0x100000, 0x103fff).ram().share("spriteram2"); // Object RAM + map(0x100000, 0x103fff).ram().share(m_spriteram2); // Object RAM map(0x104000, 0x107fff).ram(); // Spare Object RAM map(0x108000, 0x10ffff).ram(); // Work RAM - map(0x200000, 0x23ffff).ram().w(FUNC(rocknms_state::rocknms_sub_priority_w)).share("sub_priority"); // Priority - map(0x300000, 0x31ffff).ram().w(FUNC(rocknms_state::rocknms_sub_palette_w)).share("sub_paletteram"); // Palette + map(0x200000, 0x23ffff).ram().w(FUNC(rocknms_state::sub_priority_w)).share(m_sub_priority); // Priority + map(0x300000, 0x31ffff).ram().w(FUNC(rocknms_state::sub_palette_w)).share(m_sub_paletteram); // Palette // map(0x500000, 0x50ffff).ram(); // Line - map(0x600000, 0x60ffff).ram().w(FUNC(rocknms_state::rocknms_sub_vram_rot_w)).share("sub_vram_rot"); // Rotation - map(0x800000, 0x803fff).ram().w(FUNC(rocknms_state::rocknms_sub_vram_fg_w)).share("sub_vram_fg"); // Foreground - map(0x804000, 0x807fff).ram().w(FUNC(rocknms_state::rocknms_sub_vram_bg_w)).share("sub_vram_bg"); // Background + map(0x600000, 0x60ffff).ram().w(FUNC(rocknms_state::sub_vram_rot_w)).share(m_sub_vram_rot); // Rotation + map(0x800000, 0x803fff).ram().w(FUNC(rocknms_state::sub_vram_fg_w)).share(m_sub_vram_fg); // Foreground + map(0x804000, 0x807fff).ram().w(FUNC(rocknms_state::sub_vram_bg_w)).share(m_sub_vram_bg); // Background // map(0x808000, 0x809fff).ram(); // ??? map(0x900000, 0x907fff).ram(); // NVRAM map(0xa30000, 0xa30001).w(FUNC(rocknms_state::rockn_soundvolume_w)); // Sound Volume map(0xa40000, 0xa40003).w("ymz", FUNC(ymz280b_device::write)).umask16(0x00ff); // Sound map(0xa44000, 0xa44001).w(FUNC(rocknms_state::rockn_adpcmbank_w)); // Sound Bank map(0xa48000, 0xa48001).nopw(); // YMZ280 Reset - map(0xb00000, 0xb00001).w(FUNC(rocknms_state::rocknms_sub2main_w)); // MAIN <- SUB Communication + map(0xb00000, 0xb00001).w(FUNC(rocknms_state::sub2main_w)); // MAIN <- SUB Communication map(0xb20000, 0xb20001).nopw(); // ??? - map(0xb40000, 0xb4000b).writeonly().share("sub_scroll_fg"); // Foreground Scrolling - map(0xb40010, 0xb4001b).writeonly().share("sub_scroll_bg"); // Background Scrolling + map(0xb40000, 0xb4000b).writeonly().share(m_sub_scroll_fg); // Foreground Scrolling + map(0xb40010, 0xb4001b).writeonly().share(m_sub_scroll_bg); // Background Scrolling map(0xb4003e, 0xb4003f).nopw(); // scr_size - map(0xb60000, 0xb6002f).writeonly().share("sub_rotregs"); // Rotation Registers + map(0xb60000, 0xb6002f).writeonly().share(m_sub_rotregs); // Rotation Registers map(0xba0000, 0xba001f).m(m_sub_sysctrl, FUNC(jaleco_ms32_sysctrl_device::amap)); // map(0xbe0000, 0xbe0001).nopr(); // INT-level1 dummy read - map(0xbe0002, 0xbe0003).rw(FUNC(rocknms_state::rocknms_main2sub_r), FUNC(rocknms_state::rocknms_sub2main_w)); // MAIN <-> SUB Communication + map(0xbe0002, 0xbe0003).rw(FUNC(rocknms_state::main2sub_r), FUNC(rocknms_state::sub2main_w)); // MAIN <-> SUB Communication map(0xbe000a, 0xbe000b).r("watchdog", FUNC(watchdog_timer_device::reset16_r)); // Watchdog } @@ -496,31 +496,31 @@ void rocknms_state::rocknms_sub_map(address_map &map) u16 stepstag_state::stepstag_soundvolume_r() { - uint8_t vr1 = (64 - m_soundvr[0]->read()) << 2; - uint8_t vr2 = m_soundvr[1] ? (64 - m_soundvr[1]->read()) << 2 : 0; // Doesn't exist in Stepping Stage + const u8 vr1 = (64 - m_soundvr[0]->read()) << 2; + const u8 vr2 = m_soundvr[1] ? (64 - m_soundvr[1]->read()) << 2 : 0; // Doesn't exist in Stepping Stage return (vr2 << 8) | vr1; } u16 stepstag_state::stepstag_coins_r() { // bits 8 & 9? - return ( ioport("COINS")->read() & 0xfcff ) | - ( vj_upload_fini ? 0x300 : 0x100 ); + return (m_io_coins->read() & 0xfcff) | + (m_vj_upload_fini ? 0x300 : 0x100); } void stepstag_state::stepstag_b20000_w(offs_t offset, u16 data, u16 mem_mask) { if (ACCESSING_BITS_0_7) - vj_upload_idx++; + m_vj_upload_idx++; - if (vj_upload_idx >= 0xa1a8) // 0x14350/2 - vj_upload_fini = true; + if (m_vj_upload_idx >= 0xa1a8) // 0x14350/2 + m_vj_upload_fini = true; } void stepstag_state::stepstag_b00000_w(u16 data) { - vj_upload_idx = 0; - vj_upload_fini = false; + m_vj_upload_idx = 0; + m_vj_upload_fini = false; } u16 stepstag_state::stepstag_sprite_status_status_r() @@ -893,17 +893,17 @@ void stepstag_state::adv7176a_w(u16 data) void stepstag_state::stepstag_map(address_map &map) { map(0x000000, 0x0fffff).rom(); - map(0x100000, 0x103fff).ram().share("spriteram"); // Object RAM + map(0x100000, 0x103fff).ram().share(m_spriteram); // Object RAM map(0x108000, 0x10ffff).ram(); // Work RAM - map(0x200000, 0x23ffff).rw(FUNC(stepstag_state::tetrisp2_priority_r), FUNC(stepstag_state::tetrisp2_priority_w)); - map(0x300000, 0x31ffff).ram().w(FUNC(stepstag_state::tetrisp2_palette_w)).share("paletteram"); // Palette - map(0x400000, 0x403fff).ram().w(FUNC(stepstag_state::tetrisp2_vram_fg_w)).share("vram_fg"); // Foreground - map(0x404000, 0x407fff).ram().w(FUNC(stepstag_state::tetrisp2_vram_bg_w)).share("vram_bg"); // Background + map(0x200000, 0x23ffff).rw(FUNC(stepstag_state::priority_r), FUNC(stepstag_state::priority_w)); + map(0x300000, 0x31ffff).ram().w(FUNC(stepstag_state::palette_w)).share(m_paletteram); // Palette + map(0x400000, 0x403fff).ram().w(FUNC(stepstag_state::vram_fg_w)).share(m_vram_fg); // Foreground + map(0x404000, 0x407fff).ram().w(FUNC(stepstag_state::vram_bg_w)).share(m_vram_bg); // Background // map(0x408000, 0x409fff).ram(); // ??? map(0x500000, 0x50ffff).ram(); // Line - map(0x600000, 0x60ffff).ram().w(FUNC(stepstag_state::tetrisp2_vram_rot_w)).share("vram_rot"); // Rotation - map(0x900000, 0x903fff).rw(FUNC(stepstag_state::rockn_nvram_r), FUNC(stepstag_state::tetrisp2_nvram_w)).share("nvram"); // NVRAM -// map(0x904000, 0x907fff).rw(FUNC(stepstag_state::rockn_nvram_r), FUNC(stepstag_state::tetrisp2_nvram_w); // NVRAM (mirror) + map(0x600000, 0x60ffff).ram().w(FUNC(stepstag_state::vram_rot_w)).share(m_vram_rot); // Rotation + map(0x900000, 0x903fff).rw(FUNC(stepstag_state::rockn_nvram_r), FUNC(stepstag_state::nvram_w)).share("nvram"); // NVRAM +// map(0x904000, 0x907fff).rw(FUNC(stepstag_state::rockn_nvram_r), FUNC(stepstag_state::nvram_w); // NVRAM (mirror) map(0xa00000, 0xa00001).nopr().w(FUNC(stepstag_state::stepstag_neon_w)); // Neon?? map(0xa10000, 0xa10001).portr("RHYTHM").w(FUNC(stepstag_state::stepstag_step_leds_w)); // I/O map(0xa20000, 0xa20001).nopr().w(FUNC(stepstag_state::stepstag_button_leds_w)); // I/O @@ -917,10 +917,10 @@ void stepstag_state::stepstag_map(address_map &map) map(0xb00000, 0xb00001).w(FUNC(stepstag_state::stepstag_b00000_w)); // init xilinx uploading?? map(0xb20000, 0xb20001).w(FUNC(stepstag_state::stepstag_b20000_w)); // 98343 interface board xilinx uploading? - map(0xb40000, 0xb4000b).writeonly().share("scroll_fg"); // Foreground Scrolling - map(0xb40010, 0xb4001b).writeonly().share("scroll_bg"); // Background Scrolling + map(0xb40000, 0xb4000b).writeonly().share(m_scroll_fg); // Foreground Scrolling + map(0xb40010, 0xb4001b).writeonly().share(m_scroll_bg); // Background Scrolling map(0xb4003e, 0xb4003f).ram(); // scr_size - map(0xb60000, 0xb6002f).writeonly().share("rotregs"); // Rotation Registers + map(0xb60000, 0xb6002f).writeonly().share(m_rotregs); // Rotation Registers map(0xba0000, 0xba001f).m(m_sysctrl, FUNC(jaleco_ms32_sysctrl_device::amap)); map(0xbe0000, 0xbe0001).nopr(); // INT-level1 dummy read map(0xbe0002, 0xbe0003).portr("BUTTONS"); // Inputs @@ -935,9 +935,9 @@ void stepstag_state::stepstag_sub_map(address_map &map) map(0x000000, 0x0fffff).rom(); map(0x200000, 0x20ffff).ram(); - map(0x300000, 0x33ffff).ram().w(FUNC(stepstag_state::stepstag_palette_left_w)).share("paletteram1"); - map(0x400000, 0x43ffff).ram().w(FUNC(stepstag_state::stepstag_palette_mid_w)).share("paletteram2"); - map(0x500000, 0x53ffff).ram().w(FUNC(stepstag_state::stepstag_palette_right_w)).share("paletteram3"); + map(0x300000, 0x33ffff).ram().w(FUNC(stepstag_state::palette_left_w)).share(m_vj_paletteram_l); + map(0x400000, 0x43ffff).ram().w(FUNC(stepstag_state::palette_mid_w)).share(m_vj_paletteram_m); + map(0x500000, 0x53ffff).ram().w(FUNC(stepstag_state::palette_right_w)).share(m_vj_paletteram_r); map(0x700000, 0x700001).w(m_jaleco_vj_pc, FUNC(jaleco_vj_pc_device::video_mix_w<0>)); map(0x700002, 0x700003).w(m_jaleco_vj_pc, FUNC(jaleco_vj_pc_device::video_mix_w<1>)); @@ -945,19 +945,19 @@ void stepstag_state::stepstag_sub_map(address_map &map) map(0x700006, 0x700007).w(m_jaleco_vj_pc, FUNC(jaleco_vj_pc_device::video_control_w)); // left screen sprites - map(0x800000, 0x8007ff).ram().share("spriteram1"); // Object RAM + map(0x800000, 0x8007ff).ram().share(m_spriteram1); // Object RAM map(0x800800, 0x87ffff).ram(); map(0x880000, 0x880001).w(FUNC(stepstag_state::stepstag_spriteram1_updated_w)); // map(0x8c0000, 0x8c0001).nopw(); // cleared at boot // middle screen sprites - map(0x900000, 0x9007ff).ram().share("spriteram2"); // Object RAM + map(0x900000, 0x9007ff).ram().share(m_spriteram2); // Object RAM map(0x900800, 0x97ffff).ram(); map(0x980000, 0x980001).w(FUNC(stepstag_state::stepstag_spriteram2_updated_w)); // map(0x9c0000, 0x9c0001).nopw(); // cleared at boot // right screen sprites - map(0xa00000, 0xa007ff).ram().share("spriteram3"); // Object RAM + map(0xa00000, 0xa007ff).ram().share(m_spriteram3); // Object RAM map(0xa00800, 0xa7ffff).ram(); map(0xa80000, 0xa80001).w(FUNC(stepstag_state::stepstag_spriteram3_updated_w)); // map(0xac0000, 0xac0001).nopw(); // cleared at boot @@ -1326,7 +1326,7 @@ INPUT_PORTS_END static INPUT_PORTS_START( rocknms ) PORT_START("PLAYERS") // IN0 - $be0002.w - PORT_BIT( 0x0003, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(FUNC(rocknms_state::rocknms_main2sub_status_r)) // MAIN -> SUB Communication + PORT_BIT( 0x0003, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(FUNC(rocknms_state::main2sub_status_r)) // MAIN -> SUB Communication PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1) PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1) PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(1) @@ -1666,42 +1666,16 @@ INPUT_PORTS_END ***************************************************************************/ - -/* 8x8x8 tiles */ -static const gfx_layout layout_8x8x8 = -{ - 8,8, - RGN_FRAC(1,1), - 8, - { STEP8(0,1) }, - { STEP8(0,8) }, - { STEP8(0,8*8) }, - 8*8*8 -}; - -/* 16x16x8 tiles */ -static const gfx_layout layout_16x16x8 = -{ - 16,16, - RGN_FRAC(1,1), - 8, - { STEP8(0,1) }, - { STEP16(0,8) }, - { STEP16(0,16*8) }, - 16*16*8 -}; - - static GFXDECODE_START( gfx_tetrisp2 ) - GFXDECODE_ENTRY( "gfx2", 0, layout_16x16x8, 0x1000, 0x10 ) // [1] Background - GFXDECODE_ENTRY( "gfx3", 0, layout_16x16x8, 0x2000, 0x10 ) // [2] Rotation - GFXDECODE_ENTRY( "gfx4", 0, layout_8x8x8, 0x6000, 0x10 ) // [3] Foreground + GFXDECODE_ENTRY( "tiles_bg", 0, gfx_16x16x8_raw, 0x1000, 0x10 ) // [1] Background + GFXDECODE_ENTRY( "tiles_rot", 0, gfx_16x16x8_raw, 0x2000, 0x10 ) // [2] Rotation + GFXDECODE_ENTRY( "tiles_fg", 0, gfx_8x8x8_raw, 0x6000, 0x10 ) // [3] Foreground GFXDECODE_END static GFXDECODE_START( gfx_rocknms_sub ) - GFXDECODE_ENTRY( "gfx6", 0, layout_16x16x8, 0x1000, 0x10 ) // [1] Background - GFXDECODE_ENTRY( "gfx7", 0, layout_16x16x8, 0x2000, 0x10 ) // [2] Rotation - GFXDECODE_ENTRY( "gfx8", 0, layout_8x8x8, 0x6000, 0x10 ) // [3] Foreground + GFXDECODE_ENTRY( "sub_tiles_bg", 0, gfx_16x16x8_raw, 0x1000, 0x10 ) // [1] Background + GFXDECODE_ENTRY( "sub_tiles_rot", 0, gfx_16x16x8_raw, 0x2000, 0x10 ) // [2] Rotation + GFXDECODE_ENTRY( "sub_tiles_fg", 0, gfx_8x8x8_raw, 0x6000, 0x10 ) // [3] Foreground GFXDECODE_END /*************************************************************************** @@ -1712,42 +1686,72 @@ GFXDECODE_END ***************************************************************************/ -void tetrisp2_state::init_rockn_timer() +void nndmseal_state::machine_start() +{ + tetrisp2_state::machine_start(); + + m_okibank[0]->configure_entries(0, 4, memregion("oki")->base(), 0x80000); + m_okibank[1]->configure_entries(0, 16, memregion("oki")->base(), 0x20000); + m_okibank[0]->set_entry(0); + m_okibank[1]->set_entry(0); + + m_bank_hi = 0; + m_bank_lo = 0; + + save_item(NAME(m_bank_lo)); + save_item(NAME(m_bank_hi)); +} + +void rockn_state::machine_start() { + tetrisp2_state::machine_start(); + save_item(NAME(m_rockn_protectdata)); save_item(NAME(m_rockn_adpcmbank)); save_item(NAME(m_rockn_soundvolume)); } -void tetrisp2_state::init_rockn() +void rocknms_state::machine_start() { - init_rockn_timer(); - m_rockn_protectdata = 1; + rockn_state::machine_start(); + + save_item(NAME(m_main2sub)); + save_item(NAME(m_sub2main)); } -void tetrisp2_state::init_rockn1() +void rockn_state::init_rockn() { - init_rockn_timer(); + m_ymzbank[0]->configure_entries(0, 8, memregion("ymz")->base() + 0x400000, 0xc00000); + m_ymzbank[0]->set_entry(0); m_rockn_protectdata = 1; } -void tetrisp2_state::init_rockn2() +void rockn_state::init_rockn2() { - init_rockn_timer(); + m_ymzbank[0]->configure_entries(0, 21, memregion("ymz")->base() + 0x400000, 0x400000); + m_ymzbank[1]->configure_entries(0, 21, memregion("ymz")->base() + 0x400000, 0x400000); + m_ymzbank[2]->configure_entries(0, 21, memregion("ymz")->base() + 0x400000, 0x400000); + m_ymzbank[0]->set_entry(0); + m_ymzbank[1]->set_entry(1); + m_ymzbank[2]->set_entry(2); m_rockn_protectdata = 2; } void rocknms_state::init_rocknms() { - init_rockn_timer(); + m_ymzbank[0]->configure_entries(0, 8, memregion("ymz")->base() + 0x400000, 0xc00000); + m_ymzbank[0]->set_entry(0); m_rockn_protectdata = 3; - save_item(NAME(m_rocknms_main2sub)); - save_item(NAME(m_rocknms_sub2main)); } -void tetrisp2_state::init_rockn3() +void rockn_state::init_rockn3() { - init_rockn_timer(); + m_ymzbank[0]->configure_entries(0, 21, memregion("ymz")->base() + 0x400000, 0x400000); + m_ymzbank[1]->configure_entries(0, 21, memregion("ymz")->base() + 0x400000, 0x400000); + m_ymzbank[2]->configure_entries(0, 21, memregion("ymz")->base() + 0x400000, 0x400000); + m_ymzbank[0]->set_entry(0); + m_ymzbank[1]->set_entry(1); + m_ymzbank[2]->set_entry(2); m_rockn_protectdata = 4; } @@ -1814,8 +1818,6 @@ void tetrisp2_state::tetrisp2(machine_config &config) setup_main_sprite(config, pixel_clock); setup_main_sysctrl(config, XTAL(48'000'000)); - MCFG_VIDEO_START_OVERRIDE(tetrisp2_state,tetrisp2) - /* sound hardware */ SPEAKER(config, "lspeaker").front_left(); SPEAKER(config, "rspeaker").front_right(); @@ -1826,11 +1828,11 @@ void tetrisp2_state::tetrisp2(machine_config &config) } -void tetrisp2_state::nndmseal(machine_config &config) +void nndmseal_state::nndmseal(machine_config &config) { /* basic machine hardware */ M68000(config, m_maincpu, XTAL(12'000'000)); // 12MHz - m_maincpu->set_addrmap(AS_PROGRAM, &tetrisp2_state::nndmseal_map); + m_maincpu->set_addrmap(AS_PROGRAM, &nndmseal_state::nndmseal_map); NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); @@ -1842,7 +1844,7 @@ void tetrisp2_state::nndmseal(machine_config &config) constexpr XTAL pixel_clock = XTAL(42'954'545)/6; SCREEN(config, m_screen, SCREEN_TYPE_RASTER); m_screen->set_raw(pixel_clock, 455, 0, 384, 262, 0, 240); - m_screen->set_screen_update(FUNC(tetrisp2_state::screen_update_tetrisp2)); + m_screen->set_screen_update(FUNC(nndmseal_state::screen_update_tetrisp2)); m_screen->set_palette(m_palette); GFXDECODE(config, m_gfxdecode, m_palette, gfx_tetrisp2); @@ -1851,20 +1853,20 @@ void tetrisp2_state::nndmseal(machine_config &config) setup_main_sprite(config, pixel_clock); setup_main_sysctrl(config, XTAL(42'954'545)); - MCFG_VIDEO_START_OVERRIDE(tetrisp2_state,nndmseal) // bg layer offset - /* sound hardware */ SPEAKER(config, "mono").front_center(); - OKIM6295(config, "oki", XTAL(2'000'000), okim6295_device::PIN7_HIGH).add_route(ALL_OUTPUTS, "mono", 1.0); // 2MHz + okim6295_device &oki(OKIM6295(config, "oki", XTAL(2'000'000), okim6295_device::PIN7_HIGH)); + oki.set_addrmap(0, &nndmseal_state::nndmseal_oki_map); + oki.add_route(ALL_OUTPUTS, "mono", 1.0); // 2MHz } -void tetrisp2_state::rockn(machine_config &config) +void rockn_state::rockn(machine_config &config) { /* basic machine hardware */ M68000(config, m_maincpu, XTAL(12'000'000)); // 12MHz - m_maincpu->set_addrmap(AS_PROGRAM, &tetrisp2_state::rockn1_map); + m_maincpu->set_addrmap(AS_PROGRAM, &rockn_state::rockn1_map); NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); @@ -1874,7 +1876,7 @@ void tetrisp2_state::rockn(machine_config &config) constexpr XTAL pixel_clock = XTAL(48'000'000)/8; SCREEN(config, m_screen, SCREEN_TYPE_RASTER); m_screen->set_raw(pixel_clock, 384, 0, 320, 263, 0, 224); - m_screen->set_screen_update(FUNC(tetrisp2_state::screen_update_rockntread)); + m_screen->set_screen_update(FUNC(rockn_state::screen_update_rockntread)); m_screen->set_palette(m_palette); GFXDECODE(config, m_gfxdecode, m_palette, gfx_tetrisp2); @@ -1883,23 +1885,22 @@ void tetrisp2_state::rockn(machine_config &config) setup_main_sprite(config, pixel_clock); setup_main_sysctrl(config, XTAL(48'000'000)); - MCFG_VIDEO_START_OVERRIDE(tetrisp2_state,rockntread) - /* sound hardware */ SPEAKER(config, "lspeaker").front_left(); SPEAKER(config, "rspeaker").front_right(); ymz280b_device &ymz(YMZ280B(config, "ymz", XTAL(16'934'400))); // 16.9344MHz + ymz.set_addrmap(0, &rockn_state::rockn1_ymz_map); ymz.add_route(0, "lspeaker", 1.0); ymz.add_route(1, "rspeaker", 1.0); } -void tetrisp2_state::rockn2(machine_config &config) +void rockn_state::rockn2(machine_config &config) { /* basic machine hardware */ M68000(config, m_maincpu, XTAL(12'000'000)); // 12MHz - m_maincpu->set_addrmap(AS_PROGRAM, &tetrisp2_state::rockn2_map); + m_maincpu->set_addrmap(AS_PROGRAM, &rockn_state::rockn2_map); NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); @@ -1909,7 +1910,7 @@ void tetrisp2_state::rockn2(machine_config &config) constexpr XTAL pixel_clock = XTAL(48'000'000)/8; SCREEN(config, m_screen, SCREEN_TYPE_RASTER); m_screen->set_raw(pixel_clock, 384, 0, 320, 263, 0, 224); - m_screen->set_screen_update(FUNC(tetrisp2_state::screen_update_rockntread)); + m_screen->set_screen_update(FUNC(rockn_state::screen_update_rockntread)); m_screen->set_palette(m_palette); GFXDECODE(config, m_gfxdecode, m_palette, gfx_tetrisp2); @@ -1918,13 +1919,12 @@ void tetrisp2_state::rockn2(machine_config &config) setup_main_sprite(config, pixel_clock); setup_main_sysctrl(config, XTAL(48'000'000)); - MCFG_VIDEO_START_OVERRIDE(tetrisp2_state,rockntread) - /* sound hardware */ SPEAKER(config, "lspeaker").front_left(); SPEAKER(config, "rspeaker").front_right(); ymz280b_device &ymz(YMZ280B(config, "ymz", XTAL(16'934'400))); // 16.9344MHz + ymz.set_addrmap(0, &rockn_state::rockn2_ymz_map); ymz.add_route(0, "lspeaker", 1.0); ymz.add_route(1, "rspeaker", 1.0); } @@ -1970,12 +1970,12 @@ void rocknms_state::rocknms(machine_config &config) SCREEN(config, m_screen, SCREEN_TYPE_RASTER); m_screen->set_orientation(ROT0); m_screen->set_raw(pixel_clock, 384, 0, 320, 263, 0, 224); - m_screen->set_screen_update(FUNC(rocknms_state::screen_update_rocknms_left)); + m_screen->set_screen_update(FUNC(rocknms_state::screen_update_top)); SCREEN(config, m_sub_screen, SCREEN_TYPE_RASTER); m_sub_screen->set_orientation(ROT270); m_sub_screen->set_raw(pixel_clock, 384, 0, 320, 263, 0, 224); - m_sub_screen->set_screen_update(FUNC(rocknms_state::screen_update_rocknms_right)); + m_sub_screen->set_screen_update(FUNC(rocknms_state::screen_update_bottom)); GFXDECODE(config, m_gfxdecode, m_palette, gfx_tetrisp2); PALETTE(config, m_palette).set_entries(0x8000); @@ -1985,11 +1985,11 @@ void rocknms_state::rocknms(machine_config &config) setup_main_sprite(config, pixel_clock); - JALECO_MEGASYSTEM32_SPRITE(config, m_rocknms_sub_sprite, pixel_clock); // 48MHz for video? - m_rocknms_sub_sprite->set_palette(m_sub_palette); - m_rocknms_sub_sprite->set_color_base(0); - m_rocknms_sub_sprite->set_color_entries(16); - m_rocknms_sub_sprite->set_zoom(false); + JALECO_MEGASYSTEM32_SPRITE(config, m_sub_sprite, pixel_clock); // 48MHz for video? + m_sub_sprite->set_palette(m_sub_palette); + m_sub_sprite->set_color_base(0); + m_sub_sprite->set_color_entries(16); + m_sub_sprite->set_zoom(false); setup_main_sysctrl(config, XTAL(48'000'000)); @@ -2000,13 +2000,12 @@ void rocknms_state::rocknms(machine_config &config) m_sub_sysctrl->prg_timer_cb().set(FUNC(rocknms_state::sub_timer_irq_w)); m_sub_sysctrl->sound_reset_cb().set(FUNC(rocknms_state::sub_sound_reset_line_w)); - MCFG_VIDEO_START_OVERRIDE(rocknms_state,rocknms) - /* sound hardware */ SPEAKER(config, "lspeaker").front_left(); SPEAKER(config, "rspeaker").front_right(); ymz280b_device &ymz(YMZ280B(config, "ymz", XTAL(16'934'400))); // 16.9344MHz + ymz.set_addrmap(0, &rocknms_state::rockn1_ymz_map); ymz.add_route(0, "lspeaker", 1.0); ymz.add_route(1, "rspeaker", 1.0); } @@ -2216,7 +2215,7 @@ void stepstag_state::vjdash(machine_config &config) // 4 Screens void stepstag_state::machine_start() { - tetrisp2_state::machine_start(); + rockn_state::machine_start(); m_spriteram1_data = std::make_unique(0x400); m_spriteram2_data = std::make_unique(0x400); @@ -2319,15 +2318,15 @@ ROM_START( tetrisp2 ) /* Version 2.8 */ /* If t2p_m01&2 from this board were correctly read, since they hold the same data of the above but with swapped halves, it means they had to invert the top bit of the "page select" register in the sprite's hardware on this board! */ - ROM_REGION( 0x800000, "gfx2", 0 ) /* 16x16x8 (Background) */ + ROM_REGION( 0x800000, "tiles_bg", 0 ) /* 16x16x8 (Background) */ ROM_LOAD( "96019-06.13", 0x000000, 0x400000, CRC(16f7093c) SHA1(2be77c6a692c5d762f5553ae24e8c415ab194cc6) ) //ROM_LOAD( "96019-04.6", 0x400000, 0x100000, CRC(b849dec9) SHA1(fa7ac00fbe587a74c3fb8c74a0f91f7afeb8682f) ) - ROM_REGION( 0x100000, "gfx3", 0 ) /* 16x16x8 (Rotation) */ - ROM_COPY( "gfx2", 0x400000, 0x000000, 0x100000 ) + ROM_REGION( 0x100000, "tiles_rot", 0 ) /* 16x16x8 (Rotation) */ + ROM_COPY( "tiles_bg", 0x400000, 0x000000, 0x100000 ) ROM_LOAD( "96019-04.6", 0x000000, 0x100000, CRC(b849dec9) SHA1(fa7ac00fbe587a74c3fb8c74a0f91f7afeb8682f) ) - ROM_REGION( 0x080000, "gfx4", 0 ) /* 8x8x8 (Foreground) */ + ROM_REGION( 0x080000, "tiles_fg", 0 ) /* 8x8x8 (Foreground) */ ROM_LOAD( "tetp2-10.ic27", 0x000000, 0x080000, CRC(34dd1bad) SHA1(9bdf1dde11f82839676400de5dd7acb06ea8cdb2) ) // 11111xxxxxxxxxxxxxx = 0xFF ROM_REGION( 0x400000, "ymz", 0 ) /* Samples */ @@ -2346,15 +2345,15 @@ ROM_START( tetrisp2a ) /* Version 2.7 */ /* If t2p_m01&2 from this board were correctly read, since they hold the same data of the above but with swapped halves, it means they had to invert the top bit of the "page select" register in the sprite's hardware on this board! */ - ROM_REGION( 0x800000, "gfx2", 0 ) /* 16x16x8 (Background) */ + ROM_REGION( 0x800000, "tiles_bg", 0 ) /* 16x16x8 (Background) */ ROM_LOAD( "96019-06.13", 0x000000, 0x400000, CRC(16f7093c) SHA1(2be77c6a692c5d762f5553ae24e8c415ab194cc6) ) //ROM_LOAD( "96019-04.6", 0x400000, 0x100000, CRC(b849dec9) SHA1(fa7ac00fbe587a74c3fb8c74a0f91f7afeb8682f) ) - ROM_REGION( 0x100000, "gfx3", 0 ) /* 16x16x8 (Rotation) */ - ROM_COPY( "gfx2", 0x400000, 0x000000, 0x100000 ) + ROM_REGION( 0x100000, "tiles_rot", 0 ) /* 16x16x8 (Rotation) */ + ROM_COPY( "tiles_bg", 0x400000, 0x000000, 0x100000 ) ROM_LOAD( "96019-04.6", 0x000000, 0x100000, CRC(b849dec9) SHA1(fa7ac00fbe587a74c3fb8c74a0f91f7afeb8682f) ) - ROM_REGION( 0x080000, "gfx4", 0 ) /* 8x8x8 (Foreground) */ + ROM_REGION( 0x080000, "tiles_fg", 0 ) /* 8x8x8 (Foreground) */ ROM_LOAD( "tetp2-10.ic27", 0x000000, 0x080000, CRC(34dd1bad) SHA1(9bdf1dde11f82839676400de5dd7acb06ea8cdb2) ) // 11111xxxxxxxxxxxxxx = 0xFF ROM_REGION( 0x400000, "ymz", 0 ) /* Samples */ @@ -2370,13 +2369,13 @@ ROM_START( tetrisp2j ) /* Version 2.2 */ ROM_LOAD32_WORD( "96019-01.9", 0x000000, 0x400000, CRC(06f7dc64) SHA1(722c51b707b9854c0293afdff18b27ec7cae6719) ) ROM_LOAD32_WORD( "96019-02.8", 0x000002, 0x400000, CRC(3e613bed) SHA1(038b5e43fa3d69654107c8093126eeb2e8fa4ddc) ) - ROM_REGION( 0x400000, "gfx2", 0 ) /* 16x16x8 (Background) */ + ROM_REGION( 0x400000, "tiles_bg", 0 ) /* 16x16x8 (Background) */ ROM_LOAD( "96019-06.13", 0x000000, 0x400000, CRC(16f7093c) SHA1(2be77c6a692c5d762f5553ae24e8c415ab194cc6) ) - ROM_REGION( 0x100000, "gfx3", 0 ) /* 16x16x8 (Rotation) */ + ROM_REGION( 0x100000, "tiles_rot", 0 ) /* 16x16x8 (Rotation) */ ROM_LOAD( "96019-04.6", 0x000000, 0x100000, CRC(b849dec9) SHA1(fa7ac00fbe587a74c3fb8c74a0f91f7afeb8682f) ) - ROM_REGION( 0x080000, "gfx4", 0 ) /* 8x8x8 (Foreground) */ + ROM_REGION( 0x080000, "tiles_fg", 0 ) /* 8x8x8 (Foreground) */ ROM_LOAD( "tetp2-10.ic27", 0x000000, 0x080000, CRC(34dd1bad) SHA1(9bdf1dde11f82839676400de5dd7acb06ea8cdb2) ) // 11111xxxxxxxxxxxxxx = 0xFF ROM_REGION( 0x400000, "ymz", 0 ) /* Samples */ @@ -2393,13 +2392,13 @@ ROM_START( tetrisp2ja ) /* Version 2.1 */ ROM_LOAD32_WORD( "96019-01.9", 0x000000, 0x400000, CRC(06f7dc64) SHA1(722c51b707b9854c0293afdff18b27ec7cae6719) ) ROM_LOAD32_WORD( "96019-02.8", 0x000002, 0x400000, CRC(3e613bed) SHA1(038b5e43fa3d69654107c8093126eeb2e8fa4ddc) ) - ROM_REGION( 0x400000, "gfx2", 0 ) /* 16x16x8 (Background) */ + ROM_REGION( 0x400000, "tiles_bg", 0 ) /* 16x16x8 (Background) */ ROM_LOAD( "96019-06.13", 0x000000, 0x400000, CRC(16f7093c) SHA1(2be77c6a692c5d762f5553ae24e8c415ab194cc6) ) - ROM_REGION( 0x100000, "gfx3", 0 ) /* 16x16x8 (Rotation) */ + ROM_REGION( 0x100000, "tiles_rot", 0 ) /* 16x16x8 (Rotation) */ ROM_LOAD( "96019-04.6", 0x000000, 0x100000, CRC(b849dec9) SHA1(fa7ac00fbe587a74c3fb8c74a0f91f7afeb8682f) ) - ROM_REGION( 0x080000, "gfx4", 0 ) /* 8x8x8 (Foreground) */ + ROM_REGION( 0x080000, "tiles_fg", 0 ) /* 8x8x8 (Foreground) */ ROM_LOAD( "tetp2-10.ic27", 0x000000, 0x080000, CRC(34dd1bad) SHA1(9bdf1dde11f82839676400de5dd7acb06ea8cdb2) ) // 11111xxxxxxxxxxxxxx = 0xFF ROM_REGION( 0x400000, "ymz", 0 ) /* Samples */ @@ -2471,20 +2470,17 @@ ROM_START( nndmseal ) ROM_REGION( 0x100000, "sprite", ROMREGION_ERASE ) /* 8x8x8 (Sprites) */ /* This game doesn't use sprites, but the region needs to be a valid size for at least one sprite 'page' for the init to work. */ - ROM_REGION( 0x400000, "gfx2", 0 ) // 16x16x8 (Background) + ROM_REGION( 0x400000, "tiles_bg", 0 ) // 16x16x8 (Background) ROM_LOAD( "mr97006-02.5", 0x000000, 0x200000, CRC(4793f84e) SHA1(05acba6cc8a527a6050af79a460b08c4676287aa) ) ROM_LOAD( "mr97001-01.6", 0x200000, 0x200000, CRC(dd648e8a) SHA1(7036ab30d0ea179c59d74c1fbe4372968722ec0f) ) - ROM_REGION( 0x200000, "gfx3", 0 ) // 16x16x8 (Rotation) + ROM_REGION( 0x200000, "tiles_rot", 0 ) // 16x16x8 (Rotation) ROM_LOAD( "mr97006-01.2", 0x000000, 0x200000, CRC(32283485) SHA1(14ccd25389b97825d9a727809c3a1de803687c16) ) - ROM_REGION( 0x100000, "gfx4", 0 ) // 8x8x8 (Foreground) + ROM_REGION( 0x100000, "tiles_fg", 0 ) // 8x8x8 (Foreground) ROM_LOAD( "mr97006-04.8", 0x000000, 0x100000, CRC(6726a25b) SHA1(4ea49c014477229eaf9de4a0b9bf83021b82c095) ) - ROM_REGION( 0x40000, "oki", ROMREGION_ERASE ) // Samples - // filled in from "okisource" - - ROM_REGION( 0x200000, "okisource", 0 ) // Samples + ROM_REGION( 0x200000, "oki", 0 ) // Samples ROM_LOAD( "mr96017-04.9", 0x000000, 0x200000, CRC(c2e7b444) SHA1(e2b9d3d94720d01beff1108ef3dfbff805ddd1fd) ) ROM_END @@ -2496,20 +2492,17 @@ ROM_START( nndmseal11 ) ROM_REGION( 0x100000, "sprite", ROMREGION_ERASE ) /* 8x8x8 (Sprites) */ /* This game doesn't use sprites, but the region needs to be a valid size for at least one sprite 'page' for the init to work. */ - ROM_REGION( 0x400000, "gfx2", 0 ) // 16x16x8 (Background) + ROM_REGION( 0x400000, "tiles_bg", 0 ) // 16x16x8 (Background) ROM_LOAD( "mr97006-02.5", 0x000000, 0x200000, CRC(4793f84e) SHA1(05acba6cc8a527a6050af79a460b08c4676287aa) ) ROM_LOAD( "mr97001-01.6", 0x200000, 0x200000, CRC(dd648e8a) SHA1(7036ab30d0ea179c59d74c1fbe4372968722ec0f) ) - ROM_REGION( 0x200000, "gfx3", 0 ) // 16x16x8 (Rotation) + ROM_REGION( 0x200000, "tiles_rot", 0 ) // 16x16x8 (Rotation) ROM_LOAD( "mr97006-01.2", 0x000000, 0x200000, CRC(32283485) SHA1(14ccd25389b97825d9a727809c3a1de803687c16) ) - ROM_REGION( 0x100000, "gfx4", 0 ) // 8x8x8 (Foreground) + ROM_REGION( 0x100000, "tiles_fg", 0 ) // 8x8x8 (Foreground) ROM_LOAD( "mr97006-04.8", 0x000000, 0x100000, CRC(6726a25b) SHA1(4ea49c014477229eaf9de4a0b9bf83021b82c095) ) - ROM_REGION( 0x40000, "oki", ROMREGION_ERASE ) // Samples - // filled in from "okisource" - - ROM_REGION( 0x200000, "okisource", 0 ) // Samples + ROM_REGION( 0x200000, "oki", 0 ) // Samples ROM_LOAD( "mr96017-04.9", 0x000000, 0x200000, CRC(c2e7b444) SHA1(e2b9d3d94720d01beff1108ef3dfbff805ddd1fd) ) ROM_END @@ -2556,19 +2549,16 @@ ROM_START( nndmseala ) ROM_REGION( 0x100000, "sprite", ROMREGION_ERASE ) /* 8x8x8 (Sprites) */ /* This game doesn't use sprites, but the region needs to be a valid size for at least one sprite 'page' for the init to work. */ - ROM_REGION( 0x200000, "gfx2", 0 ) // 16x16x8 (Background) + ROM_REGION( 0x200000, "tiles_bg", 0 ) // 16x16x8 (Background) ROM_LOAD( "mr97032-02.ic5", 0x000000, 0x200000, CRC(460f16bd) SHA1(cdc4efa9897060d2ae3b21915dba68661e76ec03) ) - ROM_REGION( 0x400000, "gfx3", 0 ) // 16x16x8 (Rotation) + ROM_REGION( 0x400000, "tiles_rot", 0 ) // 16x16x8 (Rotation) ROM_LOAD( "mr97032-01.ic2", 0x000000, 0x400000, CRC(18c1a394) SHA1(491a2eb190efb5684f5eddb317adacd55afa727c) ) - ROM_REGION( 0x100000, "gfx4", 0 ) // 8x8x8 (Foreground) + ROM_REGION( 0x100000, "tiles_fg", 0 ) // 8x8x8 (Foreground) ROM_LOAD( "mr97032-03.ic8", 0x000000, 0x100000, CRC(5678a378) SHA1(306a3238590fa6e274e3c2ad334f5f210738dd7d) ) - ROM_REGION( 0x40000, "oki", ROMREGION_ERASE ) // Samples - // filled in from "okisource" - - ROM_REGION( 0x200000, "okisource", 0 ) // Samples + ROM_REGION( 0x200000, "oki", 0 ) // Samples ROM_LOAD( "mr97016-04.ic9", 0x000000, 0x200000, CRC(f421232b) SHA1(d9cdc911566e795e6968d4b349c008b47132bea3) ) ROM_END @@ -2580,19 +2570,16 @@ ROM_START( nndmsealb ) // NS-96205 96017 + NS-97211 97005 ROM_REGION( 0x100000, "sprite", ROMREGION_ERASE ) // 8x8x8 (Sprites) // This game doesn't use sprites, but the region needs to be a valid size for at least one sprite 'page' for the init to work. - ROM_REGION( 0x200000, "gfx2", 0 ) // 16x16x8 (Background) + ROM_REGION( 0x200000, "tiles_bg", 0 ) // 16x16x8 (Background) ROM_LOAD( "mr98009-02.ic6", 0x000000, 0x200000, CRC(94f1a8ba) SHA1(a9b627d27aac7c548977d0f799b1d7389801c8d8) ) - ROM_REGION( 0x400000, "gfx3", 0 ) // 16x16x8 (Rotation) + ROM_REGION( 0x400000, "tiles_rot", 0 ) // 16x16x8 (Rotation) ROM_LOAD( "mr98009-01.ic2", 0x000000, 0x400000, CRC(b3451bd0) SHA1(84c879b417c2042810f310ff366da7790afd1f81) ) - ROM_REGION( 0x100000, "gfx4", 0 ) // 8x8x8 (Foreground) + ROM_REGION( 0x100000, "tiles_fg", 0 ) // 8x8x8 (Foreground) ROM_LOAD( "mr98009-03.ic10", 0x000000, 0x100000, CRC(f0574f06) SHA1(42ff312dde90406b0aa355ff455765b12bbd6e6c) ) - ROM_REGION( 0x40000, "oki", ROMREGION_ERASE ) // Samples - // filled in from "okisource" - - ROM_REGION( 0x200000, "okisource", 0 ) // Samples + ROM_REGION( 0x200000, "oki", 0 ) // Samples ROM_LOAD( "mr97016-04.ic12", 0x000000, 0x200000, CRC(f421232b) SHA1(d9cdc911566e795e6968d4b349c008b47132bea3) ) ROM_END @@ -2604,19 +2591,16 @@ ROM_START( nndmsealc ) // NS-96205 96017 + NS-96206A 96017 ROM_REGION( 0x100000, "sprite", ROMREGION_ERASE ) // 8x8x8 (Sprites) // This game doesn't use sprites, but the region needs to be a valid size for at least one sprite 'page' for the init to work. - ROM_REGION( 0x400000, "gfx2", 0 ) // 16x16x8 (Background) + ROM_REGION( 0x400000, "tiles_bg", 0 ) // 16x16x8 (Background) ROM_LOAD( "mr98058-02.ic7", 0x000000, 0x400000, CRC(9d8401e3) SHA1(4b113f47c94b113d680c5420cdd5709e5b93b069) ) - ROM_REGION( 0x400000, "gfx3", 0 ) // 16x16x8 (Rotation) + ROM_REGION( 0x400000, "tiles_rot", 0 ) // 16x16x8 (Rotation) ROM_LOAD( "mr98058-01.ic2", 0x000000, 0x400000, CRC(a10848f0) SHA1(e86ed4fe85658046572903c6903e6ac9d885b85c) ) - ROM_REGION( 0x100000, "gfx4", 0 ) // 8x8x8 (Foreground) + ROM_REGION( 0x100000, "tiles_fg", 0 ) // 8x8x8 (Foreground) ROM_LOAD( "mr98058-03.ic10", 0x000000, 0x100000, CRC(4696609b) SHA1(6810483426b4c94e5d8b6fff4cbbbf3d953e26a7) ) - ROM_REGION( 0x40000, "oki", ROMREGION_ERASE ) // Samples - // filled in from "okisource" - - ROM_REGION( 0x200000, "okisource", 0 ) // Samples + ROM_REGION( 0x200000, "oki", 0 ) // Samples ROM_LOAD( "mr97016-04.ic16", 0x000000, 0x200000, CRC(f421232b) SHA1(d9cdc911566e795e6968d4b349c008b47132bea3) ) ROM_END @@ -2698,33 +2682,32 @@ ROM_START( rockn ) ROM_LOAD32_WORD( "rock_n_1_vj-98344_8.bin", 0x000002, 0x200000, CRC(fa3f6f9c) SHA1(586dcc690a1a4aa7c97932ad496382def6a074a4) ) ROM_LOAD32_WORD( "rock_n_1_vj-98344_9.bin", 0x000000, 0x200000, CRC(3d12a688) SHA1(356b2ea81d960838b604c5a17cc77e79fb0e40ce) ) - ROM_REGION( 0x200000, "gfx2", 0 ) /* 16x16x8 (Background) */ + ROM_REGION( 0x200000, "tiles_bg", 0 ) /* 16x16x8 (Background) */ ROM_LOAD16_WORD( "rock_n_1_vj-98344_13.bin", 0x000000, 0x200000, CRC(261b99a0) SHA1(7b3c768ae9d7429e2559fe32c1a4ff220d727e7e) ) - ROM_REGION( 0x100000, "gfx3", 0 ) /* 16x16x8 (Rotation) */ + ROM_REGION( 0x100000, "tiles_rot", 0 ) /* 16x16x8 (Rotation) */ ROM_LOAD( "rock_n_1_vj-98344_6.bin", 0x000000, 0x100000, CRC(5551717f) SHA1(64943a9a68ad4074f3f5128d7796e4f03baa14d5) ) - ROM_REGION( 0x080000, "gfx4", 0 ) /* 8x8x8 (Foreground) */ + ROM_REGION( 0x080000, "tiles_fg", 0 ) /* 8x8x8 (Foreground) */ ROM_LOAD( "rock_n_1_vj-98344_10.bin", 0x000000, 0x080000, CRC(918663a8) SHA1(aedacb741c986ef8159385cfef866cb7e3ef6cb6) ) /* from the bootleg set, are they right for this? */ - ROM_REGION( 0x7000000, "ymz", 0 ) /* Samples */ + ROM_REGION( 0x6400000, "ymz", ROMREGION_ERASEFF ) /* Samples */ ROM_LOAD( "sound00", 0x0000000, 0x0400000, CRC(c354f753) SHA1(bf538c02e2162a93d8c6793a1211e21480156223) ) // COMMON AREA - ROM_FILL( 0x0400000, 0x0c00000, 0xff ) // BANK AREA - ROM_LOAD( "sound01", 0x1000000, 0x0400000, CRC(5b42999e) SHA1(376c773f292eae8b75db11bad3cb6ec5fe48392e) ) // bank 0 - ROM_LOAD( "sound02", 0x1400000, 0x0400000, CRC(8306f302) SHA1(8c0437d7ab8d74d4d15f4a641d30602e39cdd99d) ) // bank 0 - ROM_LOAD( "sound03", 0x1800000, 0x0400000, CRC(3fda842c) SHA1(2b9e7c548b689bab491237e36a2dcf4782a81d79) ) // bank 0 - ROM_LOAD( "sound04", 0x1c00000, 0x0400000, CRC(86d4f289) SHA1(908490ab0cf8d33cf3e127f71edee3bece70b86d) ) // bank 1 - ROM_LOAD( "sound05", 0x2000000, 0x0400000, CRC(f8dbf47d) SHA1(f19f7ae26e3b8af17a4e66e6722dd2f5c36d33f8) ) // bank 1 - ROM_LOAD( "sound06", 0x2400000, 0x0400000, CRC(525aff97) SHA1(b18e5bdf67d3a89f39c59f4f9bd3bb608dacc7f7) ) // bank 1 - ROM_LOAD( "sound07", 0x2800000, 0x0400000, CRC(5bd8bb95) SHA1(3b33c42778f7d50ca1513d37e7bc4a4efcc3cf82) ) // bank 2 - ROM_LOAD( "sound08", 0x2c00000, 0x0400000, CRC(304c1643) SHA1(0be090077e00d4b9abce2fac4821c630b6a40f22) ) // bank 2 - ROM_LOAD( "sound09", 0x3000000, 0x0400000, CRC(78c22c56) SHA1(eb48d188d25538a1d381ca760f8e98096ee12bfe) ) // bank 2 - ROM_LOAD( "sound10", 0x3400000, 0x0400000, CRC(d5e8d8a5) SHA1(df7db3c8b110ce1aa85e627537afb744c98877bd) ) // bank 3 - ROM_LOAD( "sound11", 0x3800000, 0x0400000, CRC(569ef4dd) SHA1(777f8a3aef741655555364d00a1eaa472ac4b922) ) // bank 3 - ROM_LOAD( "sound12", 0x3c00000, 0x0400000, CRC(aae8d59c) SHA1(ccca1f511ce0ea8d452f3b1d24350b5cee402ad2) ) // bank 3 - ROM_LOAD( "sound13", 0x4000000, 0x0400000, CRC(9ec1459b) SHA1(10e08a47636dec431cdb8e105cf61287fe9c6637) ) // bank 4 - ROM_LOAD( "sound14", 0x4400000, 0x0400000, CRC(b26f9a81) SHA1(0d1c8e382eb5877f9a748ff289be97cbdb73b0cc) ) // bank 4 + ROM_LOAD( "sound01", 0x0400000, 0x0400000, CRC(5b42999e) SHA1(376c773f292eae8b75db11bad3cb6ec5fe48392e) ) // bank 0 + ROM_LOAD( "sound02", 0x0800000, 0x0400000, CRC(8306f302) SHA1(8c0437d7ab8d74d4d15f4a641d30602e39cdd99d) ) // bank 0 + ROM_LOAD( "sound03", 0x0c00000, 0x0400000, CRC(3fda842c) SHA1(2b9e7c548b689bab491237e36a2dcf4782a81d79) ) // bank 0 + ROM_LOAD( "sound04", 0x1000000, 0x0400000, CRC(86d4f289) SHA1(908490ab0cf8d33cf3e127f71edee3bece70b86d) ) // bank 1 + ROM_LOAD( "sound05", 0x1400000, 0x0400000, CRC(f8dbf47d) SHA1(f19f7ae26e3b8af17a4e66e6722dd2f5c36d33f8) ) // bank 1 + ROM_LOAD( "sound06", 0x1800000, 0x0400000, CRC(525aff97) SHA1(b18e5bdf67d3a89f39c59f4f9bd3bb608dacc7f7) ) // bank 1 + ROM_LOAD( "sound07", 0x1c00000, 0x0400000, CRC(5bd8bb95) SHA1(3b33c42778f7d50ca1513d37e7bc4a4efcc3cf82) ) // bank 2 + ROM_LOAD( "sound08", 0x2000000, 0x0400000, CRC(304c1643) SHA1(0be090077e00d4b9abce2fac4821c630b6a40f22) ) // bank 2 + ROM_LOAD( "sound09", 0x2400000, 0x0400000, CRC(78c22c56) SHA1(eb48d188d25538a1d381ca760f8e98096ee12bfe) ) // bank 2 + ROM_LOAD( "sound10", 0x2800000, 0x0400000, CRC(d5e8d8a5) SHA1(df7db3c8b110ce1aa85e627537afb744c98877bd) ) // bank 3 + ROM_LOAD( "sound11", 0x2c00000, 0x0400000, CRC(569ef4dd) SHA1(777f8a3aef741655555364d00a1eaa472ac4b922) ) // bank 3 + ROM_LOAD( "sound12", 0x3000000, 0x0400000, CRC(aae8d59c) SHA1(ccca1f511ce0ea8d452f3b1d24350b5cee402ad2) ) // bank 3 + ROM_LOAD( "sound13", 0x3400000, 0x0400000, CRC(9ec1459b) SHA1(10e08a47636dec431cdb8e105cf61287fe9c6637) ) // bank 4 + ROM_LOAD( "sound14", 0x3800000, 0x0400000, CRC(b26f9a81) SHA1(0d1c8e382eb5877f9a748ff289be97cbdb73b0cc) ) // bank 4 ROM_END ROM_START( rockna ) @@ -2736,32 +2719,31 @@ ROM_START( rockna ) ROM_LOAD32_WORD( "rock_n_1_vj-98344_8.bin", 0x000002, 0x200000, CRC(fa3f6f9c) SHA1(586dcc690a1a4aa7c97932ad496382def6a074a4) ) ROM_LOAD32_WORD( "rock_n_1_vj-98344_9.bin", 0x000000, 0x200000, CRC(3d12a688) SHA1(356b2ea81d960838b604c5a17cc77e79fb0e40ce) ) - ROM_REGION( 0x200000, "gfx2", 0 ) /* 16x16x8 (Background) */ + ROM_REGION( 0x200000, "tiles_bg", 0 ) /* 16x16x8 (Background) */ ROM_LOAD16_WORD( "rock_n_1_vj-98344_13.bin", 0x000000, 0x200000, CRC(261b99a0) SHA1(7b3c768ae9d7429e2559fe32c1a4ff220d727e7e) ) - ROM_REGION( 0x100000, "gfx3", 0 ) /* 16x16x8 (Rotation) */ + ROM_REGION( 0x100000, "tiles_rot", 0 ) /* 16x16x8 (Rotation) */ ROM_LOAD( "rock_n_1_vj-98344_6.bin", 0x000000, 0x100000, CRC(5551717f) SHA1(64943a9a68ad4074f3f5128d7796e4f03baa14d5) ) - ROM_REGION( 0x080000, "gfx4", 0 ) /* 8x8x8 (Foreground) */ + ROM_REGION( 0x080000, "tiles_fg", 0 ) /* 8x8x8 (Foreground) */ ROM_LOAD( "rock_n_1_vj-98344_10.bin", 0x000000, 0x080000, CRC(918663a8) SHA1(aedacb741c986ef8159385cfef866cb7e3ef6cb6) ) - ROM_REGION( 0x7000000, "ymz", 0 ) /* Samples */ + ROM_REGION( 0x6400000, "ymz", ROMREGION_ERASEFF ) /* Samples */ ROM_LOAD( "sound00", 0x0000000, 0x0400000, CRC(c354f753) SHA1(bf538c02e2162a93d8c6793a1211e21480156223) ) // COMMON AREA - ROM_FILL( 0x0400000, 0x0c00000, 0xff ) // BANK AREA - ROM_LOAD( "sound01", 0x1000000, 0x0400000, CRC(5b42999e) SHA1(376c773f292eae8b75db11bad3cb6ec5fe48392e) ) // bank 0 - ROM_LOAD( "sound02", 0x1400000, 0x0400000, CRC(8306f302) SHA1(8c0437d7ab8d74d4d15f4a641d30602e39cdd99d) ) // bank 0 - ROM_LOAD( "sound03", 0x1800000, 0x0400000, CRC(3fda842c) SHA1(2b9e7c548b689bab491237e36a2dcf4782a81d79) ) // bank 0 - ROM_LOAD( "sound04", 0x1c00000, 0x0400000, CRC(86d4f289) SHA1(908490ab0cf8d33cf3e127f71edee3bece70b86d) ) // bank 1 - ROM_LOAD( "sound05", 0x2000000, 0x0400000, CRC(f8dbf47d) SHA1(f19f7ae26e3b8af17a4e66e6722dd2f5c36d33f8) ) // bank 1 - ROM_LOAD( "sound06", 0x2400000, 0x0400000, CRC(525aff97) SHA1(b18e5bdf67d3a89f39c59f4f9bd3bb608dacc7f7) ) // bank 1 - ROM_LOAD( "sound07", 0x2800000, 0x0400000, CRC(5bd8bb95) SHA1(3b33c42778f7d50ca1513d37e7bc4a4efcc3cf82) ) // bank 2 - ROM_LOAD( "sound08", 0x2c00000, 0x0400000, CRC(304c1643) SHA1(0be090077e00d4b9abce2fac4821c630b6a40f22) ) // bank 2 - ROM_LOAD( "sound09", 0x3000000, 0x0400000, CRC(78c22c56) SHA1(eb48d188d25538a1d381ca760f8e98096ee12bfe) ) // bank 2 - ROM_LOAD( "sound10", 0x3400000, 0x0400000, CRC(d5e8d8a5) SHA1(df7db3c8b110ce1aa85e627537afb744c98877bd) ) // bank 3 - ROM_LOAD( "sound11", 0x3800000, 0x0400000, CRC(569ef4dd) SHA1(777f8a3aef741655555364d00a1eaa472ac4b922) ) // bank 3 - ROM_LOAD( "sound12", 0x3c00000, 0x0400000, CRC(aae8d59c) SHA1(ccca1f511ce0ea8d452f3b1d24350b5cee402ad2) ) // bank 3 - ROM_LOAD( "sound13", 0x4000000, 0x0400000, CRC(9ec1459b) SHA1(10e08a47636dec431cdb8e105cf61287fe9c6637) ) // bank 4 - ROM_LOAD( "sound14", 0x4400000, 0x0400000, CRC(b26f9a81) SHA1(0d1c8e382eb5877f9a748ff289be97cbdb73b0cc) ) // bank 4 + ROM_LOAD( "sound01", 0x0400000, 0x0400000, CRC(5b42999e) SHA1(376c773f292eae8b75db11bad3cb6ec5fe48392e) ) // bank 0 + ROM_LOAD( "sound02", 0x0800000, 0x0400000, CRC(8306f302) SHA1(8c0437d7ab8d74d4d15f4a641d30602e39cdd99d) ) // bank 0 + ROM_LOAD( "sound03", 0x0c00000, 0x0400000, CRC(3fda842c) SHA1(2b9e7c548b689bab491237e36a2dcf4782a81d79) ) // bank 0 + ROM_LOAD( "sound04", 0x1000000, 0x0400000, CRC(86d4f289) SHA1(908490ab0cf8d33cf3e127f71edee3bece70b86d) ) // bank 1 + ROM_LOAD( "sound05", 0x1400000, 0x0400000, CRC(f8dbf47d) SHA1(f19f7ae26e3b8af17a4e66e6722dd2f5c36d33f8) ) // bank 1 + ROM_LOAD( "sound06", 0x1800000, 0x0400000, CRC(525aff97) SHA1(b18e5bdf67d3a89f39c59f4f9bd3bb608dacc7f7) ) // bank 1 + ROM_LOAD( "sound07", 0x1c00000, 0x0400000, CRC(5bd8bb95) SHA1(3b33c42778f7d50ca1513d37e7bc4a4efcc3cf82) ) // bank 2 + ROM_LOAD( "sound08", 0x2000000, 0x0400000, CRC(304c1643) SHA1(0be090077e00d4b9abce2fac4821c630b6a40f22) ) // bank 2 + ROM_LOAD( "sound09", 0x2400000, 0x0400000, CRC(78c22c56) SHA1(eb48d188d25538a1d381ca760f8e98096ee12bfe) ) // bank 2 + ROM_LOAD( "sound10", 0x2800000, 0x0400000, CRC(d5e8d8a5) SHA1(df7db3c8b110ce1aa85e627537afb744c98877bd) ) // bank 3 + ROM_LOAD( "sound11", 0x2c00000, 0x0400000, CRC(569ef4dd) SHA1(777f8a3aef741655555364d00a1eaa472ac4b922) ) // bank 3 + ROM_LOAD( "sound12", 0x3000000, 0x0400000, CRC(aae8d59c) SHA1(ccca1f511ce0ea8d452f3b1d24350b5cee402ad2) ) // bank 3 + ROM_LOAD( "sound13", 0x3400000, 0x0400000, CRC(9ec1459b) SHA1(10e08a47636dec431cdb8e105cf61287fe9c6637) ) // bank 4 + ROM_LOAD( "sound14", 0x3800000, 0x0400000, CRC(b26f9a81) SHA1(0d1c8e382eb5877f9a748ff289be97cbdb73b0cc) ) // bank 4 ROM_END ROM_START( rockn2 ) @@ -2773,42 +2755,41 @@ ROM_START( rockn2 ) ROM_LOAD32_WORD( "rock_n_2_vj-98344_8_v1.0", 0x000002, 0x200000, CRC(673ce2c2) SHA1(6c0a13de386b02a7f3a86e8128374938ede2525c) ) ROM_LOAD32_WORD( "rock_n_2_vj-98344_9_v1.0", 0x000000, 0x200000, CRC(9d3968cf) SHA1(11c96e7685ab8c1b416396238ec5c12e7819385f) ) - ROM_REGION( 0x200000, "gfx2", 0 ) /* 16x16x8 (Background) */ + ROM_REGION( 0x200000, "tiles_bg", 0 ) /* 16x16x8 (Background) */ ROM_LOAD16_WORD( "rock_n_2_vj-98344_13_v1.0", 0x000000, 0x200000, CRC(e35c55b3) SHA1(a18367c28befc3f71823f1d4ab2126ad6f8a28fc) ) - ROM_REGION( 0x200000, "gfx3", 0 ) /* 16x16x8 (Rotation) */ + ROM_REGION( 0x200000, "tiles_rot", 0 ) /* 16x16x8 (Rotation) */ ROM_LOAD( "rock_n_2_vj-98344_6_v1.0", 0x000000, 0x200000, CRC(241d7449) SHA1(9fcc2d128d7be273836460313c0e73c81e33c9cb) ) - ROM_REGION( 0x080000, "gfx4", 0 ) /* 8x8x8 (Foreground) */ + ROM_REGION( 0x080000, "tiles_fg", 0 ) /* 8x8x8 (Foreground) */ ROM_LOAD( "rock_n_2_vj-98344_10_v1.0", 0x000000, 0x080000, CRC(ae74d5b3) SHA1(07aa6ee540a783e3f2a8710a7095d922cff1d443) ) - ROM_REGION( 0x7000000, "ymz", 0 ) /* Samples */ + ROM_REGION( 0x6400000, "ymz", ROMREGION_ERASEFF ) /* Samples */ ROM_LOAD( "sound00", 0x0000000, 0x0400000, CRC(4e9611a3) SHA1(2a9b1d5afc0ea9a3285f9fc6b49a1c3abd8cd2a5) ) // COMMON AREA - ROM_FILL( 0x0400000, 0x0c00000, 0xff ) // BANK AREA - ROM_LOAD( "sound01", 0x1000000, 0x0400000, CRC(ec600f13) SHA1(151cb0a16782c8bba223d0f6881b80c1e43bc9bc) ) // bank 0 - ROM_LOAD( "sound02", 0x1400000, 0x0400000, CRC(8306f302) SHA1(8c0437d7ab8d74d4d15f4a641d30602e39cdd99d) ) // bank 0 - ROM_LOAD( "sound03", 0x1800000, 0x0400000, CRC(3fda842c) SHA1(2b9e7c548b689bab491237e36a2dcf4782a81d79) ) // bank 0 - ROM_LOAD( "sound04", 0x1c00000, 0x0400000, CRC(86d4f289) SHA1(908490ab0cf8d33cf3e127f71edee3bece70b86d) ) // bank 1 - ROM_LOAD( "sound05", 0x2000000, 0x0400000, CRC(f8dbf47d) SHA1(f19f7ae26e3b8af17a4e66e6722dd2f5c36d33f8) ) // bank 1 - ROM_LOAD( "sound06", 0x2400000, 0x0400000, CRC(06f7bd63) SHA1(d8b27212ebba99f5129483550aeac5b86ff2a1d2) ) // bank 1 - ROM_LOAD( "sound07", 0x2800000, 0x0400000, CRC(22f042f6) SHA1(649bdf43dd698150992e68b23fd758bca56c615b) ) // bank 2 - ROM_LOAD( "sound08", 0x2c00000, 0x0400000, CRC(dd294d8e) SHA1(49d889d341ab6167d9741340eb27902923b6cb42) ) // bank 2 - ROM_LOAD( "sound09", 0x3000000, 0x0400000, CRC(8fedee6e) SHA1(540c01d1c5f410abb1f86f33a5a532208946cb7c) ) // bank 2 - ROM_LOAD( "sound10", 0x3400000, 0x0400000, CRC(01292f11) SHA1(da88b14bf8df34e7574cf8c9f5dd385db13ab34c) ) // bank 3 - ROM_LOAD( "sound11", 0x3800000, 0x0400000, CRC(20dc76ba) SHA1(078397f2de54d4ca91035dce11419ac0d934fbfa) ) // bank 3 - ROM_LOAD( "sound12", 0x3c00000, 0x0400000, CRC(11fff0bc) SHA1(2767fcc3a5d3200750b011c97a83073719a9325f) ) // bank 3 - ROM_LOAD( "sound13", 0x4000000, 0x0400000, CRC(2367dd18) SHA1(b58f757ce4c832c5462637f4e08d7be511ca0c96) ) // bank 4 - ROM_LOAD( "sound14", 0x4400000, 0x0400000, CRC(75ced8c0) SHA1(fda17464767be073a36c117f5212411b66197dd9) ) // bank 4 - ROM_LOAD( "sound15", 0x4800000, 0x0400000, CRC(aeaca380) SHA1(1c389911aa766abec389b1c79a1542759ac58b9f) ) // bank 4 - ROM_LOAD( "sound16", 0x4c00000, 0x0400000, CRC(21d50e32) SHA1(24eaceb7c0b868b6e8fc16b403dae2427e422bf6) ) // bank 5 - ROM_LOAD( "sound17", 0x5000000, 0x0400000, CRC(de785a2a) SHA1(1f5ae46ac9476a31a431ce0f0cf124e1c8c930a6) ) // bank 5 - ROM_LOAD( "sound18", 0x5400000, 0x0400000, CRC(18cabb1e) SHA1(c769820e2e84eff0e4ce956236656ae757e3299c) ) // bank 5 - ROM_LOAD( "sound19", 0x5800000, 0x0400000, CRC(33c89e53) SHA1(7d216f5db6b30c9b05a9a77030498ff68ae6fbad) ) // bank 6 - ROM_LOAD( "sound20", 0x5c00000, 0x0400000, CRC(89c1b088) SHA1(9b4118815959a5fb65b2a293015f592a46f4126f) ) // bank 6 - ROM_LOAD( "sound21", 0x6000000, 0x0400000, CRC(13db74bd) SHA1(ab87438bbac97d46b1b8195b61dca1d72172a621) ) // bank 6 -// ROM_LOAD( "sound22", 0x6400000, 0x0400000 ) // bank 7 ( ** unpopulated ** - IC24) -// ROM_LOAD( "sound23", 0x6800000, 0x0400000 ) // bank 7 ( ** unpopulated ** - IC25) -// ROM_LOAD( "sound24", 0x6c00000, 0x0400000 ) // bank 7 ( ** unpopulated ** - IC26) + ROM_LOAD( "sound01", 0x0400000, 0x0400000, CRC(ec600f13) SHA1(151cb0a16782c8bba223d0f6881b80c1e43bc9bc) ) // bank 0 + ROM_LOAD( "sound02", 0x0800000, 0x0400000, CRC(8306f302) SHA1(8c0437d7ab8d74d4d15f4a641d30602e39cdd99d) ) // bank 0 + ROM_LOAD( "sound03", 0x0c00000, 0x0400000, CRC(3fda842c) SHA1(2b9e7c548b689bab491237e36a2dcf4782a81d79) ) // bank 0 + ROM_LOAD( "sound04", 0x1000000, 0x0400000, CRC(86d4f289) SHA1(908490ab0cf8d33cf3e127f71edee3bece70b86d) ) // bank 1 + ROM_LOAD( "sound05", 0x1400000, 0x0400000, CRC(f8dbf47d) SHA1(f19f7ae26e3b8af17a4e66e6722dd2f5c36d33f8) ) // bank 1 + ROM_LOAD( "sound06", 0x1800000, 0x0400000, CRC(06f7bd63) SHA1(d8b27212ebba99f5129483550aeac5b86ff2a1d2) ) // bank 1 + ROM_LOAD( "sound07", 0x1c00000, 0x0400000, CRC(22f042f6) SHA1(649bdf43dd698150992e68b23fd758bca56c615b) ) // bank 2 + ROM_LOAD( "sound08", 0x2000000, 0x0400000, CRC(dd294d8e) SHA1(49d889d341ab6167d9741340eb27902923b6cb42) ) // bank 2 + ROM_LOAD( "sound09", 0x2400000, 0x0400000, CRC(8fedee6e) SHA1(540c01d1c5f410abb1f86f33a5a532208946cb7c) ) // bank 2 + ROM_LOAD( "sound10", 0x2800000, 0x0400000, CRC(01292f11) SHA1(da88b14bf8df34e7574cf8c9f5dd385db13ab34c) ) // bank 3 + ROM_LOAD( "sound11", 0x2c00000, 0x0400000, CRC(20dc76ba) SHA1(078397f2de54d4ca91035dce11419ac0d934fbfa) ) // bank 3 + ROM_LOAD( "sound12", 0x3000000, 0x0400000, CRC(11fff0bc) SHA1(2767fcc3a5d3200750b011c97a83073719a9325f) ) // bank 3 + ROM_LOAD( "sound13", 0x3400000, 0x0400000, CRC(2367dd18) SHA1(b58f757ce4c832c5462637f4e08d7be511ca0c96) ) // bank 4 + ROM_LOAD( "sound14", 0x3800000, 0x0400000, CRC(75ced8c0) SHA1(fda17464767be073a36c117f5212411b66197dd9) ) // bank 4 + ROM_LOAD( "sound15", 0x3c00000, 0x0400000, CRC(aeaca380) SHA1(1c389911aa766abec389b1c79a1542759ac58b9f) ) // bank 4 + ROM_LOAD( "sound16", 0x4000000, 0x0400000, CRC(21d50e32) SHA1(24eaceb7c0b868b6e8fc16b403dae2427e422bf6) ) // bank 5 + ROM_LOAD( "sound17", 0x4400000, 0x0400000, CRC(de785a2a) SHA1(1f5ae46ac9476a31a431ce0f0cf124e1c8c930a6) ) // bank 5 + ROM_LOAD( "sound18", 0x4800000, 0x0400000, CRC(18cabb1e) SHA1(c769820e2e84eff0e4ce956236656ae757e3299c) ) // bank 5 + ROM_LOAD( "sound19", 0x4c00000, 0x0400000, CRC(33c89e53) SHA1(7d216f5db6b30c9b05a9a77030498ff68ae6fbad) ) // bank 6 + ROM_LOAD( "sound20", 0x5000000, 0x0400000, CRC(89c1b088) SHA1(9b4118815959a5fb65b2a293015f592a46f4126f) ) // bank 6 + ROM_LOAD( "sound21", 0x5400000, 0x0400000, CRC(13db74bd) SHA1(ab87438bbac97d46b1b8195b61dca1d72172a621) ) // bank 6 +// ROM_LOAD( "sound22", 0x5800000, 0x0400000 ) // bank 7 ( ** unpopulated ** - IC24) +// ROM_LOAD( "sound23", 0x5c00000, 0x0400000 ) // bank 7 ( ** unpopulated ** - IC25) +// ROM_LOAD( "sound24", 0x6000000, 0x0400000 ) // bank 7 ( ** unpopulated ** - IC26) ROM_END /*************************************************************************** @@ -2851,42 +2832,42 @@ ROM_START( rockn3 ) ROM_LOAD32_WORD( "rock_n_3_vj-98344_8_v1.0", 0x000002, 0x200000, CRC(468bf696) SHA1(d58e399ff876ab0f4ef52aaa85d86d72db307b6a) ) /* IC32 (alt PCB number 8) */ ROM_LOAD32_WORD( "rock_n_3_vj-98344_9_v1.0", 0x000000, 0x200000, CRC(8a61fc18) SHA1(4e895a2014e711d044ed5d8bff8a91766f14b307) ) /* IC33 (alt PCB number 9) */ - ROM_REGION( 0x200000, "gfx2", 0 ) /* 16x16x8 (Background) */ + ROM_REGION( 0x200000, "tiles_bg", 0 ) /* 16x16x8 (Background) */ ROM_LOAD16_WORD( "rock_n_3_vj-98344_13_v1.0", 0x000000, 0x200000, CRC(e01bf471) SHA1(4485c71770bdb8800ded4afb37814c2d287b78be) ) /* IC10 (alt PCB number 13) */ - ROM_REGION( 0x200000, "gfx3", 0 ) /* 16x16x8 (Rotation) */ + ROM_REGION( 0x200000, "tiles_rot", 0 ) /* 16x16x8 (Rotation) */ ROM_LOAD( "rock_n_3_vj-98344_6_v1.0", 0x000000, 0x200000, CRC(4e146de5) SHA1(5971cbb91da5fde652786d82d0143197518bad9b) ) /* IC38 (alt PCB number 6) */ - ROM_REGION( 0x080000, "gfx4", 0 ) /* 8x8x8 (Foreground) */ + ROM_REGION( 0x080000, "tiles_fg", 0 ) /* 8x8x8 (Foreground) */ ROM_LOAD( "rock_n_3_vj-98344_10_v1.0", 0x000000, 0x080000, CRC(8100039e) SHA1(e07b1e2f3cbcb1c086edd628d20423ecd4f74860) ) /* IC19 (alt PCB number 10) */ - ROM_REGION( 0x7000000, "ymz", 0 ) /* Samples - On separate ROM board with YMZ280B-F sound chip */ + ROM_REGION( 0x6400000, "ymz", ROMREGION_ERASEFF ) /* Samples - On separate ROM board with YMZ280B-F sound chip */ ROM_LOAD( "mr99029-01.ic28", 0x0000000, 0x0400000, CRC(e2f69042) SHA1(deb361a53ed6a9033e21c2f805f327cc3e9b11c6) ) // COMMON AREA (alt PCB number 25) - ROM_FILL( 0x0400000, 0x0c00000, 0xff ) // BANK AREA (unpopulated IC29, IC36 & IC37 (alt PCB numbers 26, 27 & 28 repectively) - ROM_LOAD( "mr99029-02.ic1", 0x1000000, 0x0400000, CRC(b328b18f) SHA1(22edebcabd6c8ed65d8c9e501621991d404c430d) ) // bank 0 (alt PCB number 1) - ROM_LOAD( "mr99029-03.ic2", 0x1400000, 0x0400000, CRC(f46438e3) SHA1(718f54fc0e3689f5ab29bef2ec13eb2aa9b117fc) ) // bank 0 (alt PCB number 2) - ROM_LOAD( "mr99029-04.ic3", 0x1800000, 0x0400000, CRC(b979e887) SHA1(10852ceb1b9e24fb87cf9339bc9fb4ae066a1221) ) // bank 0 (alt PCB number 3) - ROM_LOAD( "mr99029-05.ic4", 0x1c00000, 0x0400000, CRC(0bb2c212) SHA1(4f8ab3c96c3e1aa337a3fe871cffc04ec603f8c0) ) // bank 1 (alt PCB number 4) - ROM_LOAD( "mr99029-06.ic5", 0x2000000, 0x0400000, CRC(3116e437) SHA1(f1b06592a6f0eba92eb4511d3ca03a3bb51e8c9d) ) // bank 1 (alt PCB number 5) - ROM_LOAD( "mr99029-07.ic6", 0x2400000, 0x0400000, CRC(26b37ef6) SHA1(f7090f3ec81f0c651c53d460b476e63f52dd06dc) ) // bank 1 (alt PCB number 6) - ROM_LOAD( "mr99029-08.ic7", 0x2800000, 0x0400000, CRC(1dd3f4e3) SHA1(8474e00b962368164c717e5fe2e926852f3b4426) ) // bank 2 (alt PCB number 7) - ROM_LOAD( "mr99029-09.ic8", 0x2c00000, 0x0400000, CRC(a1b03d67) SHA1(95f89a37e97d62706e15fd5571ff2e70dd98fee2) ) // bank 2 (alt PCB number 8) - ROM_LOAD( "mr99029-10.ic10", 0x3000000, 0x0400000, CRC(35107aac) SHA1(d56a66e15c46c33cf6c9c28edf48b730b681d21a) ) // bank 2 (alt PCB number 9) - ROM_LOAD( "mr99029-11.ic11", 0x3400000, 0x0400000, CRC(059ec592) SHA1(205210af558eb7e8e1399b2a506ef0285c5feda3) ) // bank 3 (alt PCB number 10) - ROM_LOAD( "mr99029-12.ic12", 0x3800000, 0x0400000, CRC(84d4badb) SHA1(fc20f97a008f000a49e7cadd559789516643704a) ) // bank 3 (alt PCB number 11) - ROM_LOAD( "mr99029-13.ic13", 0x3c00000, 0x0400000, CRC(4527a9b7) SHA1(a73ebece5c84bf14f8d25bbd869b7b43b1fcd042) ) // bank 3 (alt PCB number 12) - ROM_LOAD( "mr99029-14.ic14", 0x4000000, 0x0400000, CRC(bfa4b7ce) SHA1(4100f2deabb8994e8e3ff897a1db13693ab64c11) ) // bank 4 (alt PCB number 13) - ROM_LOAD( "mr99029-15.ic15", 0x4400000, 0x0400000, CRC(a2ccd2ce) SHA1(fc6325219f7b8e68c22a129f5ec4e900e326fb9d) ) // bank 4 (alt PCB number 14) - ROM_LOAD( "mr99029-16.ic16", 0x4800000, 0x0400000, CRC(95baf678) SHA1(f7b39a3379f16df0560a22d4f42165ebbe05cebe) ) // bank 4 (alt PCB number 15) - ROM_LOAD( "mr99029-17.ic17", 0x4c00000, 0x0400000, CRC(5883c84b) SHA1(54aec4e1e2f5edc198aebc4788caf5062f9a5b6c) ) // bank 5 (alt PCB number 16) - ROM_LOAD( "mr99029-18.ic19", 0x5000000, 0x0400000, CRC(f92098ce) SHA1(9b13cd37ad5d7baf36b20218c4bced956084ec45) ) // bank 5 (alt PCB number 17) - ROM_LOAD( "mr99029-19.ic20", 0x5400000, 0x0400000, CRC(dbb2c228) SHA1(f7cd24026236e2c616376c695b9e986cc221f36d) ) // bank 5 (alt PCB number 18) - ROM_LOAD( "mr99029-20.ic21", 0x5800000, 0x0400000, CRC(9efdae1c) SHA1(6158a1804fbaa9ce27ae7e12cfda5f49084b4998) ) // bank 6 (alt PCB number 19) - ROM_LOAD( "mr99029-21.ic22", 0x5c00000, 0x0400000, CRC(5f301b83) SHA1(e24e85c43a62871360545aa42dfa439045334b79) ) // bank 6 (alt PCB number 20) -// ROM_LOAD( "ic23", 0x6000000, 0x0400000 ) // bank 6 ( ** unpopulated ** - alt PCB number 21) -// ROM_LOAD( "ic24", 0x6400000, 0x0400000 ) // bank 7 ( ** unpopulated ** - alt PCB number 22) -// ROM_LOAD( "ic25", 0x6800000, 0x0400000 ) // bank 7 ( ** unpopulated ** - alt PCB number 23) -// ROM_LOAD( "ic26", 0x6c00000, 0x0400000 ) // bank 7 ( ** unpopulated ** - alt PCB number 24) + // BANK AREA (unpopulated IC29, IC36 & IC37 (alt PCB numbers 26, 27 & 28 repectively) + ROM_LOAD( "mr99029-02.ic1", 0x0400000, 0x0400000, CRC(b328b18f) SHA1(22edebcabd6c8ed65d8c9e501621991d404c430d) ) // bank 0 (alt PCB number 1) + ROM_LOAD( "mr99029-03.ic2", 0x0800000, 0x0400000, CRC(f46438e3) SHA1(718f54fc0e3689f5ab29bef2ec13eb2aa9b117fc) ) // bank 0 (alt PCB number 2) + ROM_LOAD( "mr99029-04.ic3", 0x0c00000, 0x0400000, CRC(b979e887) SHA1(10852ceb1b9e24fb87cf9339bc9fb4ae066a1221) ) // bank 0 (alt PCB number 3) + ROM_LOAD( "mr99029-05.ic4", 0x1000000, 0x0400000, CRC(0bb2c212) SHA1(4f8ab3c96c3e1aa337a3fe871cffc04ec603f8c0) ) // bank 1 (alt PCB number 4) + ROM_LOAD( "mr99029-06.ic5", 0x1400000, 0x0400000, CRC(3116e437) SHA1(f1b06592a6f0eba92eb4511d3ca03a3bb51e8c9d) ) // bank 1 (alt PCB number 5) + ROM_LOAD( "mr99029-07.ic6", 0x1800000, 0x0400000, CRC(26b37ef6) SHA1(f7090f3ec81f0c651c53d460b476e63f52dd06dc) ) // bank 1 (alt PCB number 6) + ROM_LOAD( "mr99029-08.ic7", 0x1c00000, 0x0400000, CRC(1dd3f4e3) SHA1(8474e00b962368164c717e5fe2e926852f3b4426) ) // bank 2 (alt PCB number 7) + ROM_LOAD( "mr99029-09.ic8", 0x2000000, 0x0400000, CRC(a1b03d67) SHA1(95f89a37e97d62706e15fd5571ff2e70dd98fee2) ) // bank 2 (alt PCB number 8) + ROM_LOAD( "mr99029-10.ic10", 0x2400000, 0x0400000, CRC(35107aac) SHA1(d56a66e15c46c33cf6c9c28edf48b730b681d21a) ) // bank 2 (alt PCB number 9) + ROM_LOAD( "mr99029-11.ic11", 0x2800000, 0x0400000, CRC(059ec592) SHA1(205210af558eb7e8e1399b2a506ef0285c5feda3) ) // bank 3 (alt PCB number 10) + ROM_LOAD( "mr99029-12.ic12", 0x2c00000, 0x0400000, CRC(84d4badb) SHA1(fc20f97a008f000a49e7cadd559789516643704a) ) // bank 3 (alt PCB number 11) + ROM_LOAD( "mr99029-13.ic13", 0x3000000, 0x0400000, CRC(4527a9b7) SHA1(a73ebece5c84bf14f8d25bbd869b7b43b1fcd042) ) // bank 3 (alt PCB number 12) + ROM_LOAD( "mr99029-14.ic14", 0x3400000, 0x0400000, CRC(bfa4b7ce) SHA1(4100f2deabb8994e8e3ff897a1db13693ab64c11) ) // bank 4 (alt PCB number 13) + ROM_LOAD( "mr99029-15.ic15", 0x3800000, 0x0400000, CRC(a2ccd2ce) SHA1(fc6325219f7b8e68c22a129f5ec4e900e326fb9d) ) // bank 4 (alt PCB number 14) + ROM_LOAD( "mr99029-16.ic16", 0x3c00000, 0x0400000, CRC(95baf678) SHA1(f7b39a3379f16df0560a22d4f42165ebbe05cebe) ) // bank 4 (alt PCB number 15) + ROM_LOAD( "mr99029-17.ic17", 0x4000000, 0x0400000, CRC(5883c84b) SHA1(54aec4e1e2f5edc198aebc4788caf5062f9a5b6c) ) // bank 5 (alt PCB number 16) + ROM_LOAD( "mr99029-18.ic19", 0x4400000, 0x0400000, CRC(f92098ce) SHA1(9b13cd37ad5d7baf36b20218c4bced956084ec45) ) // bank 5 (alt PCB number 17) + ROM_LOAD( "mr99029-19.ic20", 0x4800000, 0x0400000, CRC(dbb2c228) SHA1(f7cd24026236e2c616376c695b9e986cc221f36d) ) // bank 5 (alt PCB number 18) + ROM_LOAD( "mr99029-20.ic21", 0x4c00000, 0x0400000, CRC(9efdae1c) SHA1(6158a1804fbaa9ce27ae7e12cfda5f49084b4998) ) // bank 6 (alt PCB number 19) + ROM_LOAD( "mr99029-21.ic22", 0x5000000, 0x0400000, CRC(5f301b83) SHA1(e24e85c43a62871360545aa42dfa439045334b79) ) // bank 6 (alt PCB number 20) +// ROM_LOAD( "ic23", 0x5400000, 0x0400000 ) // bank 6 ( ** unpopulated ** - alt PCB number 21) +// ROM_LOAD( "ic24", 0x5800000, 0x0400000 ) // bank 7 ( ** unpopulated ** - alt PCB number 22) +// ROM_LOAD( "ic25", 0x5c00000, 0x0400000 ) // bank 7 ( ** unpopulated ** - alt PCB number 23) +// ROM_LOAD( "ic26", 0x6000000, 0x0400000 ) // bank 7 ( ** unpopulated ** - alt PCB number 24) ROM_END ROM_START( rockn4 ) /* Prototype */ @@ -2898,27 +2879,26 @@ ROM_START( rockn4 ) /* Prototype */ ROM_LOAD32_WORD( "rock_n_4_vj-98344_8.bin", 0x000002, 0x200000, CRC(5eeae537) SHA1(6bb8c658a2985c3919f0590a0147eead995c01c9) ) ROM_LOAD32_WORD( "rock_n_4_vj-98344_9.bin", 0x000000, 0x200000, CRC(3fedddc9) SHA1(4bd8f402ecf8e6255326927e825179fa6d300e73) ) - ROM_REGION( 0x200000, "gfx2", 0 ) /* 16x16x8 (Background) */ + ROM_REGION( 0x200000, "tiles_bg", 0 ) /* 16x16x8 (Background) */ ROM_LOAD16_WORD( "rock_n_4_vj-98344_13.bin", 0x000000, 0x200000, CRC(ead41e79) SHA1(9c24b1e52b6ed43d5b5a1caf48f2974b8fa61f4a) ) - ROM_REGION( 0x200000, "gfx3", 0 ) /* 16x16x8 (Rotation) */ + ROM_REGION( 0x200000, "tiles_rot", 0 ) /* 16x16x8 (Rotation) */ ROM_LOAD( "rock_n_4_vj-98344_6.bin", 0x000000, 0x200000, CRC(eb16fc67) SHA1(5be40f2c9a5693785268eafcfcf348f147533463) ) - ROM_REGION( 0x100000, "gfx4", 0 ) /* 8x8x8 (Foreground) */ + ROM_REGION( 0x100000, "tiles_fg", 0 ) /* 8x8x8 (Foreground) */ ROM_LOAD( "rock_n_4_vj-98344_10.bin", 0x000000, 0x100000, CRC(37d50259) SHA1(fd02f98a981470c47889f0b2f813ce59373a4b42) ) - ROM_REGION( 0x7000000, "ymz", 0 ) /* Samples */ + ROM_REGION( 0x6400000, "ymz", ROMREGION_ERASEFF ) /* Samples */ ROM_LOAD( "sound00", 0x0000000, 0x0400000, CRC(918ea8eb) SHA1(0cd82859634635b6ce49db36fb91ed3365a101eb) ) // COMMON AREA - ROM_FILL( 0x0400000, 0x0c00000, 0xff ) // BANK AREA - ROM_LOAD( "sound01", 0x1000000, 0x0400000, CRC(c548e51e) SHA1(4fe1e35c9ed4366dce98b4f4c00f94e202ef15dc) ) // bank 0 - ROM_LOAD( "sound02", 0x1400000, 0x0400000, CRC(ffda0253) SHA1(9b8ae98accc2f72a1cd881086f89e647e4904ad9) ) // bank 0 - ROM_LOAD( "sound03", 0x1800000, 0x0400000, CRC(1f813af5) SHA1(a72d842e39b9fc955a2fc6721673b34b1b591e4a) ) // bank 0 - ROM_LOAD( "sound04", 0x1c00000, 0x0400000, CRC(035c4ff3) SHA1(9290c49244dc45ad5d6543775c5f2cc507e54e77) ) // bank 1 - ROM_LOAD( "sound05", 0x2000000, 0x0400000, CRC(0f01f7b0) SHA1(e0c6daa1606dd5aaac59a7ae75d76e937e9c0151) ) // bank 1 - ROM_LOAD( "sound06", 0x2400000, 0x0400000, CRC(31574b1c) SHA1(a08b50b4c4f2be32892b7534f2192101f8af6762) ) // bank 1 - ROM_LOAD( "sound07", 0x2800000, 0x0400000, CRC(388e2c91) SHA1(493ef760858a82cbc38de59c4db3f273c0ddfdfb) ) // bank 2 - ROM_LOAD( "sound08", 0x2c00000, 0x0400000, CRC(6e7e3f23) SHA1(4b9b959f79254d0633f1c4324b7ee6a17e222308) ) // bank 2 - ROM_LOAD( "sound09", 0x3000000, 0x0400000, CRC(39fa512f) SHA1(d07426bc74492496756b67b8ded1b507726720c7) ) // bank 2 + ROM_LOAD( "sound01", 0x0400000, 0x0400000, CRC(c548e51e) SHA1(4fe1e35c9ed4366dce98b4f4c00f94e202ef15dc) ) // bank 0 + ROM_LOAD( "sound02", 0x0800000, 0x0400000, CRC(ffda0253) SHA1(9b8ae98accc2f72a1cd881086f89e647e4904ad9) ) // bank 0 + ROM_LOAD( "sound03", 0x0c00000, 0x0400000, CRC(1f813af5) SHA1(a72d842e39b9fc955a2fc6721673b34b1b591e4a) ) // bank 0 + ROM_LOAD( "sound04", 0x1000000, 0x0400000, CRC(035c4ff3) SHA1(9290c49244dc45ad5d6543775c5f2cc507e54e77) ) // bank 1 + ROM_LOAD( "sound05", 0x1400000, 0x0400000, CRC(0f01f7b0) SHA1(e0c6daa1606dd5aaac59a7ae75d76e937e9c0151) ) // bank 1 + ROM_LOAD( "sound06", 0x1800000, 0x0400000, CRC(31574b1c) SHA1(a08b50b4c4f2be32892b7534f2192101f8af6762) ) // bank 1 + ROM_LOAD( "sound07", 0x1c00000, 0x0400000, CRC(388e2c91) SHA1(493ef760858a82cbc38de59c4db3f273c0ddfdfb) ) // bank 2 + ROM_LOAD( "sound08", 0x2000000, 0x0400000, CRC(6e7e3f23) SHA1(4b9b959f79254d0633f1c4324b7ee6a17e222308) ) // bank 2 + ROM_LOAD( "sound09", 0x2400000, 0x0400000, CRC(39fa512f) SHA1(d07426bc74492496756b67b8ded1b507726720c7) ) // bank 2 ROM_END ROM_START( rocknms ) @@ -2934,51 +2914,50 @@ ROM_START( rocknms ) ROM_LOAD32_WORD( "mast_spr1", 0x000002, 0x400000, CRC(520152dc) SHA1(619a55352c0dab914f6188d66272a24495b5d1d4) ) ROM_LOAD32_WORD( "mast_spr0", 0x000000, 0x400000, CRC(1caad02a) SHA1(00c3fc849d1f633874fee30f7d0caf0c62735c50) ) - ROM_REGION( 0x200000, "gfx2", 0 ) /* 16x16x8 (Background) */ + ROM_REGION( 0x200000, "tiles_bg", 0 ) /* 16x16x8 (Background) */ ROM_LOAD16_WORD( "mast_back", 0x000000, 0x200000, CRC(1ca30e3f) SHA1(763c9dd287c186b6ca8ecb88c3ce29d68fea9179) ) - ROM_REGION( 0x200000, "gfx3", 0 ) /* 16x16x8 (Rotation) */ + ROM_REGION( 0x200000, "tiles_rot", 0 ) /* 16x16x8 (Rotation) */ ROM_LOAD( "mast_rot", 0x000000, 0x200000, CRC(1f29b622) SHA1(aab6aafb98fa732266675daa63dc4c0d2084bcbd) ) - ROM_REGION( 0x080000, "gfx4", 0 ) /* 8x8x8 (Foreground) */ + ROM_REGION( 0x080000, "tiles_fg", 0 ) /* 8x8x8 (Foreground) */ ROM_LOAD( "mast_front", 0x000000, 0x080000, CRC(a4717579) SHA1(cf28c0f19713ebf9f8fd5d55d654c1cd2e8cd73d) ) ROM_REGION( 0x800000, "sub_sprite", 0 ) /* 8x8x8 (Sprites) */ ROM_LOAD32_WORD( "slav_spr1", 0x000002, 0x400000, CRC(3f8124b0) SHA1(c9ab89f559551d2298d28e107b2d44d312e53216) ) ROM_LOAD32_WORD( "slav_spr0", 0x000000, 0x400000, CRC(48a7f5b1) SHA1(4724856bde3cf975efc3be407b60693a69a39365) ) - ROM_REGION( 0x200000, "gfx6", 0 ) /* 16x16x8 (Background) */ + ROM_REGION( 0x200000, "sub_tiles_bg", 0 ) /* 16x16x8 (Background) */ ROM_LOAD16_WORD( "slav_back", 0x000000, 0x200000, CRC(f0a28e32) SHA1(517b98dee6ec201bab02a3c81b0937ed462a626e) ) - ROM_REGION( 0x200000, "gfx7", 0 ) /* 16x16x8 (Rotation) */ + ROM_REGION( 0x200000, "sub_tiles_rot", 0 ) /* 16x16x8 (Rotation) */ ROM_LOAD( "slav_rot", 0x000000, 0x200000, CRC(0bab21f4) SHA1(afd3f32d7bb99b3f566b302fce11059ae8788715) ) - ROM_REGION( 0x080000, "gfx8", 0 ) /* 8x8x8 (Foreground) */ + ROM_REGION( 0x080000, "sub_tiles_fg", 0 ) /* 8x8x8 (Foreground) */ ROM_LOAD( "slav_front", 0x000000, 0x080000, CRC(b65734a7) SHA1(80190e260ed32cb3355f0604722b85eb659483d0) ) - ROM_REGION( 0x7000000, "ymz", 0 ) /* Samples */ + ROM_REGION( 0x6400000, "ymz", ROMREGION_ERASEFF ) /* Samples */ ROM_LOAD( "sound00", 0x0000000, 0x0400000, CRC(8bafae71) SHA1(db74accd4bc1bfeb4a3341a0fd572b81287f1278) ) // COMMON AREA - ROM_FILL( 0x0400000, 0x0c00000, 0xff ) // BANK AREA - ROM_LOAD( "sound01", 0x1000000, 0x0400000, CRC(eec0589b) SHA1(f54c1c7e7741100a1398ebd45aef4755171d9965) ) // bank 0 - ROM_LOAD( "sound02", 0x1400000, 0x0400000, CRC(564aa972) SHA1(b19e960fd79647e5bcca509982c9887decb92bc6) ) // bank 0 - ROM_LOAD( "sound03", 0x1800000, 0x0400000, CRC(940302d0) SHA1(b28c2bb1a9b8cea0b6963ffa5d3ac26d90b0bffc) ) // bank 0 - ROM_LOAD( "sound04", 0x1c00000, 0x0400000, CRC(766db7f8) SHA1(41cfcac2e8d4307f75c56d57431b841e6d64b23c) ) // bank 1 - ROM_LOAD( "sound05", 0x2000000, 0x0400000, CRC(3a3002f9) SHA1(27b24b8a34a0b919e051e81a10e87aa300b11d8f) ) // bank 1 - ROM_LOAD( "sound06", 0x2400000, 0x0400000, CRC(06b04df9) SHA1(4bfc7c05843b4533f238f5360230cb71d7a66d56) ) // bank 1 - ROM_LOAD( "sound07", 0x2800000, 0x0400000, CRC(da74305e) SHA1(9dfb744f36ac8b3661006921dc482e941711f389) ) // bank 2 - ROM_LOAD( "sound08", 0x2c00000, 0x0400000, CRC(b5a0aa48) SHA1(2deb2c1c97c259f5e79e9dc3cd8859548549a189) ) // bank 2 - ROM_LOAD( "sound09", 0x3000000, 0x0400000, CRC(0fd4a088) SHA1(5c1ea8a14dee7ee885ce0c86fb463741599db44d) ) // bank 2 - ROM_LOAD( "sound10", 0x3400000, 0x0400000, CRC(33c89e53) SHA1(7d216f5db6b30c9b05a9a77030498ff68ae6fbad) ) // bank 3 - ROM_LOAD( "sound11", 0x3800000, 0x0400000, CRC(f9256a3f) SHA1(a3ec0845497d349c97222a1f986c252c8ca781e7) ) // bank 3 - ROM_LOAD( "sound12", 0x3c00000, 0x0400000, CRC(b0a09f3e) SHA1(d2e37eb935d7ef7e887ff79a49bc11da11c31f3c) ) // bank 3 - ROM_LOAD( "sound13", 0x4000000, 0x0400000, CRC(d5cee673) SHA1(85194c73c43b69bccbcc895f147d5251bb039c2a) ) // bank 4 - ROM_LOAD( "sound14", 0x4400000, 0x0400000, CRC(b394aa8a) SHA1(68541d5d98e2d59d6a3096f0c10b74b6f5803722) ) // bank 4 - ROM_LOAD( "sound15", 0x4800000, 0x0400000, CRC(6c791501) SHA1(8c67f070651493d6f7a2ef7b8a5f9e12c0181f67) ) // bank 4 - ROM_LOAD( "sound16", 0x4c00000, 0x0400000, CRC(fe80159e) SHA1(b6a980d4f62dfeaa6f51a99518aa4d483fe338e5) ) // bank 5 - ROM_LOAD( "sound17", 0x5000000, 0x0400000, CRC(142c1159) SHA1(dfabbe69119c84040d6368561e93514ce7bb91db) ) // bank 5 - ROM_LOAD( "sound18", 0x5400000, 0x0400000, CRC(cc595d85) SHA1(5f725771d79e71d62b64bb18e2a51b839a6e4c7f) ) // bank 5 - ROM_LOAD( "sound19", 0x5800000, 0x0400000, CRC(82b085a3) SHA1(5a5f2ed90d659bbad710c23b9df2a7dbb3c9acfe) ) // bank 6 - ROM_LOAD( "sound20", 0x5c00000, 0x0400000, CRC(dd5e9680) SHA1(5a2826641ad75757ce4a583e0ea901d54d20ffca) ) // bank 6 + ROM_LOAD( "sound01", 0x0400000, 0x0400000, CRC(eec0589b) SHA1(f54c1c7e7741100a1398ebd45aef4755171d9965) ) // bank 0 + ROM_LOAD( "sound02", 0x0800000, 0x0400000, CRC(564aa972) SHA1(b19e960fd79647e5bcca509982c9887decb92bc6) ) // bank 0 + ROM_LOAD( "sound03", 0x0c00000, 0x0400000, CRC(940302d0) SHA1(b28c2bb1a9b8cea0b6963ffa5d3ac26d90b0bffc) ) // bank 0 + ROM_LOAD( "sound04", 0x1000000, 0x0400000, CRC(766db7f8) SHA1(41cfcac2e8d4307f75c56d57431b841e6d64b23c) ) // bank 1 + ROM_LOAD( "sound05", 0x1400000, 0x0400000, CRC(3a3002f9) SHA1(27b24b8a34a0b919e051e81a10e87aa300b11d8f) ) // bank 1 + ROM_LOAD( "sound06", 0x1800000, 0x0400000, CRC(06b04df9) SHA1(4bfc7c05843b4533f238f5360230cb71d7a66d56) ) // bank 1 + ROM_LOAD( "sound07", 0x1c00000, 0x0400000, CRC(da74305e) SHA1(9dfb744f36ac8b3661006921dc482e941711f389) ) // bank 2 + ROM_LOAD( "sound08", 0x2000000, 0x0400000, CRC(b5a0aa48) SHA1(2deb2c1c97c259f5e79e9dc3cd8859548549a189) ) // bank 2 + ROM_LOAD( "sound09", 0x2400000, 0x0400000, CRC(0fd4a088) SHA1(5c1ea8a14dee7ee885ce0c86fb463741599db44d) ) // bank 2 + ROM_LOAD( "sound10", 0x2800000, 0x0400000, CRC(33c89e53) SHA1(7d216f5db6b30c9b05a9a77030498ff68ae6fbad) ) // bank 3 + ROM_LOAD( "sound11", 0x2c00000, 0x0400000, CRC(f9256a3f) SHA1(a3ec0845497d349c97222a1f986c252c8ca781e7) ) // bank 3 + ROM_LOAD( "sound12", 0x3000000, 0x0400000, CRC(b0a09f3e) SHA1(d2e37eb935d7ef7e887ff79a49bc11da11c31f3c) ) // bank 3 + ROM_LOAD( "sound13", 0x3400000, 0x0400000, CRC(d5cee673) SHA1(85194c73c43b69bccbcc895f147d5251bb039c2a) ) // bank 4 + ROM_LOAD( "sound14", 0x3800000, 0x0400000, CRC(b394aa8a) SHA1(68541d5d98e2d59d6a3096f0c10b74b6f5803722) ) // bank 4 + ROM_LOAD( "sound15", 0x3c00000, 0x0400000, CRC(6c791501) SHA1(8c67f070651493d6f7a2ef7b8a5f9e12c0181f67) ) // bank 4 + ROM_LOAD( "sound16", 0x4000000, 0x0400000, CRC(fe80159e) SHA1(b6a980d4f62dfeaa6f51a99518aa4d483fe338e5) ) // bank 5 + ROM_LOAD( "sound17", 0x4400000, 0x0400000, CRC(142c1159) SHA1(dfabbe69119c84040d6368561e93514ce7bb91db) ) // bank 5 + ROM_LOAD( "sound18", 0x4800000, 0x0400000, CRC(cc595d85) SHA1(5f725771d79e71d62b64bb18e2a51b839a6e4c7f) ) // bank 5 + ROM_LOAD( "sound19", 0x4c00000, 0x0400000, CRC(82b085a3) SHA1(5a5f2ed90d659bbad710c23b9df2a7dbb3c9acfe) ) // bank 6 + ROM_LOAD( "sound20", 0x5000000, 0x0400000, CRC(dd5e9680) SHA1(5a2826641ad75757ce4a583e0ea901d54d20ffca) ) // bank 6 ROM_END @@ -3116,17 +3095,17 @@ ROM_START( vjslap ) ROM_LOAD( "mr98053-13.ic11", 0x1800000, 0x400000, CRC(a38af3a1) SHA1(ce7b2d7518f9de050293f3b9a073a1cedbc444fa) ) ROM_LOAD( "mr98053-16.ic10", 0x1c00000, 0x400000, CRC(9c7f5964) SHA1(4e8d0a14c2459774204a8b24ea23a65520d3fc29) ) - ROM_REGION( 0x080000, "gfx4", 0 ) /* 8x8x8 (Foreground) */ + ROM_REGION( 0x080000, "tiles_fg", 0 ) /* 8x8x8 (Foreground) */ ROM_LOAD( "vj10_ver1.0.ic27", 0x000000, 0x080000, CRC(c143b7e4) SHA1(055699a18aa3529bb252dca391cf3f1e19f9ebe8) ) ROM_REGION( 0x800000, "sprite", 0 ) /* 8x8x8 (Sprites) */ ROM_LOAD32_WORD( "obj-o.ic40", 0x000002, 0x400000, CRC(eaa927f1) SHA1(84742aecc1f9e40c289c87319255001cb701949f) ) ROM_LOAD32_WORD( "obj-e.ic41", 0x000000, 0x400000, CRC(a6c1e41b) SHA1(157af81a70604bee194c9b24f5b74774b3e7eff3) ) - ROM_REGION( 0x400000, "gfx2", 0 ) /* 16x16x8 (Background) */ + ROM_REGION( 0x400000, "tiles_bg", 0 ) /* 16x16x8 (Background) */ ROM_LOAD16_WORD( "bg.ic14", 0x000000, 0x200000, CRC(45f045ed) SHA1(196a41c71f3e579ff5c43ca75f5473a0597333b3) ) - ROM_REGION( 0x400000, "gfx3", 0 ) /* 16x16x8 (Rotation) */ + ROM_REGION( 0x400000, "tiles_rot", 0 ) /* 16x16x8 (Rotation) */ ROM_LOAD( "mr98053-04.ic36", 0x000000, 0x200000, CRC(4c69de30) SHA1(5f758498abb87f86f428193413c8e06bb4024725) ) ROM_REGION( 0x001000, "gal", ROMREGION_ERASE ) // ICT GAL @@ -3178,17 +3157,17 @@ ROM_START( vjdash ) ROM_LOAD( "mr98053-13.ic11", 0x1800000, 0x400000, CRC(a38af3a1) SHA1(ce7b2d7518f9de050293f3b9a073a1cedbc444fa) ) ROM_LOAD( "mr98053-16.ic10", 0x1c00000, 0x400000, CRC(9c7f5964) SHA1(4e8d0a14c2459774204a8b24ea23a65520d3fc29) ) - ROM_REGION( 0x080000, "gfx4", 0 ) /* 8x8x8 (Foreground) */ + ROM_REGION( 0x080000, "tiles_fg", 0 ) /* 8x8x8 (Foreground) */ ROM_LOAD( "vjdash_ver1.0.ic27", 0x000000, 0x080000, CRC(f3cff858) SHA1(9277e5fb3494f7afb7f3911792d1c68b2b1b147e) ) ROM_REGION( 0x800000, "sprite", 0 ) /* 8x8x8 (Sprites) */ ROM_LOAD32_WORD( "vjdash_8.ic40", 0x000002, 0x400000, CRC(798bc4a4) SHA1(5aca6495e48a1d72bf2993ff26f0462d78acc88b) ) ROM_LOAD32_WORD( "vjdash_9.ic41", 0x000000, 0x400000, CRC(f2489f68) SHA1(d98f08dd0fa3448e266afaf6971aa5b39686d4f4) ) - ROM_REGION( 0x400000, "gfx2", 0 ) /* 16x16x8 (Background) */ + ROM_REGION( 0x400000, "tiles_bg", 0 ) /* 16x16x8 (Background) */ ROM_LOAD16_WORD( "bg.ic14", 0x000000, 0x200000, CRC(45f045ed) SHA1(196a41c71f3e579ff5c43ca75f5473a0597333b3) ) - ROM_REGION( 0x400000, "gfx3", 0 ) /* 16x16x8 (Rotation) */ + ROM_REGION( 0x400000, "tiles_rot", 0 ) /* 16x16x8 (Rotation) */ ROM_LOAD( "mr98053-04.ic36", 0x000000, 0x200000, CRC(4c69de30) SHA1(5f758498abb87f86f428193413c8e06bb4024725) ) ROM_REGION( 0x001000, "gal", 0 ) // ICT GAL @@ -3242,17 +3221,17 @@ ROM_START( vjdasha ) ROM_LOAD( "mr98053-13.ic11", 0x1800000, 0x400000, CRC(a38af3a1) SHA1(ce7b2d7518f9de050293f3b9a073a1cedbc444fa) BAD_DUMP ) ROM_LOAD( "mr98053-16.ic10", 0x1c00000, 0x400000, CRC(9c7f5964) SHA1(4e8d0a14c2459774204a8b24ea23a65520d3fc29) BAD_DUMP ) - ROM_REGION( 0x080000, "gfx4", 0 ) /* 8x8x8 (Foreground) */ + ROM_REGION( 0x080000, "tiles_fg", 0 ) /* 8x8x8 (Foreground) */ ROM_LOAD( "vjdash_ver1.0.ic27", 0x000000, 0x080000, CRC(f3cff858) SHA1(9277e5fb3494f7afb7f3911792d1c68b2b1b147e) ) ROM_REGION( 0x800000, "sprite", 0 ) /* 8x8x8 (Sprites) */ ROM_LOAD32_WORD( "vjdash_8.ic40", 0x000002, 0x400000, CRC(798bc4a4) SHA1(5aca6495e48a1d72bf2993ff26f0462d78acc88b) BAD_DUMP ) // From vjdash set, may be different on a real Dash Ver 1.2 board ROM_LOAD32_WORD( "vjdash_9.ic41", 0x000000, 0x400000, CRC(f2489f68) SHA1(d98f08dd0fa3448e266afaf6971aa5b39686d4f4) BAD_DUMP ) - ROM_REGION( 0x400000, "gfx2", 0 ) /* 16x16x8 (Background) */ + ROM_REGION( 0x400000, "tiles_bg", 0 ) /* 16x16x8 (Background) */ ROM_LOAD16_WORD( "mr98053-03.ic14", 0x000000, 0x200000, CRC(0bd32084) SHA1(2fcac3019ebedc54b83b08f527aa968ce6d48617) ) - ROM_REGION( 0x400000, "gfx3", 0 ) /* 16x16x8 (Rotation) */ + ROM_REGION( 0x400000, "tiles_rot", 0 ) /* 16x16x8 (Rotation) */ ROM_LOAD( "mr98053-04.ic36", 0x000000, 0x200000, CRC(4c69de30) SHA1(5f758498abb87f86f428193413c8e06bb4024725) ) ROM_REGION( 0x001000, "gal", 0 ) // ICT GAL @@ -3300,15 +3279,15 @@ ROM_START( stepstag ) ROM_LOAD( "s.s.s._vj-98348_26_pr99021-01", 0x800000, 0x400000, BAD_DUMP CRC(fefb3777) SHA1(df624e105ab1dea52317e318ad29caa02b900788) ) // VERTICAL ROM_LOAD( "s.s.s._vj-98348_3_pr99021-01", 0x800000, 0x400000, CRC(e0fbc6f1) SHA1(7ca4507702f3f81bb9de3f9b5d270d379e439633) ) // VERTICAL - ROM_REGION( 0x400000, "gfx4", 0 ) // foreground tiles + ROM_REGION( 0x400000, "tiles_fg", 0 ) // foreground tiles ROM_LOAD( "vjdash_ver1.0.ic27", 0x000000, 0x080000, BAD_DUMP CRC(f3cff858) SHA1(9277e5fb3494f7afb7f3911792d1c68b2b1b147e) ) ROM_REGION( 0x400000, "sprite", ROMREGION_ERASE ) /* 8x8x8 (Sprites) */ - ROM_REGION( 0x400000, "gfx2", ROMREGION_ERASE ) /* 16x16x8 (Background) */ + ROM_REGION( 0x400000, "tiles_bg", ROMREGION_ERASE ) /* 16x16x8 (Background) */ ROM_LOAD16_WORD( "stepstag_scroll", 0x000000, 0x400000, NO_DUMP ) - ROM_REGION( 0x400000, "gfx3", ROMREGION_ERASE ) /* 16x16x8 (Rotation) */ + ROM_REGION( 0x400000, "tiles_rot", ROMREGION_ERASE ) /* 16x16x8 (Rotation) */ ROM_LOAD( "stepstag_rott", 0x000000, 0x400000, NO_DUMP ) DISK_REGION( "jaleco_vj_pc:pci:07.1:ide1:0:hdd" ) @@ -3352,14 +3331,14 @@ ROM_START( step3 ) ROM_LOAD( "mr9930-03.ic28", 0x0800000, 0x400000, CRC(9a5d070f) SHA1(b4668b4f299033140a2c56499cc2712ba111cb57) ) // 8x8 VERTICAL ROM_LOAD( "vj98348_step3_25_v1.1", 0x0c00000, 0x400000, CRC(dec612df) SHA1(acb86bb90c1cc61c7db3e022c69a5ff0611ffbae) ) // 8x8 VERTICAL - ROM_REGION( 0x400000, "gfx4", 0 ) // foreground tiles + ROM_REGION( 0x400000, "tiles_fg", 0 ) // foreground tiles ROM_LOAD( "vjdash_ver1.0.ic27", 0x000000, 0x080000, BAD_DUMP CRC(f3cff858) SHA1(9277e5fb3494f7afb7f3911792d1c68b2b1b147e) ) ROM_REGION( 0x400000, "sprite", ROMREGION_ERASE ) /* 8x8x8 (Sprites) */ - ROM_REGION( 0x400000, "gfx2", ROMREGION_ERASE ) /* 16x16x8 (Background) */ + ROM_REGION( 0x400000, "tiles_bg", ROMREGION_ERASE ) /* 16x16x8 (Background) */ - ROM_REGION( 0x400000, "gfx3", ROMREGION_ERASE ) /* 16x16x8 (Rotation) */ + ROM_REGION( 0x400000, "tiles_rot", ROMREGION_ERASE ) /* 16x16x8 (Rotation) */ DISK_REGION( "jaleco_vj_pc:pci:07.1:ide1:0:hdd" ) DISK_IMAGE( "step3", 0, SHA1(926a32998c837f7ba45d07db243c43c1f9d46d6a) ) @@ -3375,31 +3354,31 @@ ROM_END ***************************************************************************/ // YEAR, NAME, PARENT, MACHINE, INPUT, STATE, INIT, MONITOR, COMPANY, FULLNAME, FLAGS -GAME( 1997, tetrisp2, 0, tetrisp2, tetrisp2, tetrisp2_state, empty_init, ROT0, "Jaleco / The Tetris Company", "Tetris Plus 2 (World, V2.8)", MACHINE_SUPPORTS_SAVE ) -GAME( 1997, tetrisp2a, tetrisp2, tetrisp2, tetrisp2, tetrisp2_state, empty_init, ROT0, "Jaleco / The Tetris Company", "Tetris Plus 2 (World, V2.7)", MACHINE_SUPPORTS_SAVE ) -GAME( 1997, tetrisp2j, tetrisp2, tetrisp2, tetrisp2j, tetrisp2_state, empty_init, ROT0, "Jaleco / The Tetris Company", "Tetris Plus 2 (Japan, V2.2)", MACHINE_SUPPORTS_SAVE ) -GAME( 1997, tetrisp2ja,tetrisp2, tetrisp2, tetrisp2j, tetrisp2_state, empty_init, ROT0, "Jaleco / The Tetris Company", "Tetris Plus 2 (Japan, V2.1)", MACHINE_SUPPORTS_SAVE ) - -GAME( 1997, nndmseal, 0, nndmseal, nndmseal, nndmseal_state, init_rockn, ROT0 | ORIENTATION_FLIP_X, "I'Max / Jaleco", "Nandemo Seal Iinkai (ver 1.3)", MACHINE_SUPPORTS_SAVE | MACHINE_NOT_WORKING ) -GAME( 1997, nndmseal11,nndmseal, nndmseal, nndmseal, nndmseal_state, init_rockn, ROT0 | ORIENTATION_FLIP_X, "I'Max / Jaleco", "Nandemo Seal Iinkai (ver 1.1)", MACHINE_SUPPORTS_SAVE | MACHINE_NOT_WORKING ) -GAME( 1997, nndmseala, nndmseal, nndmseal, nndmseal, nndmseal_state, init_rockn, ROT0 | ORIENTATION_FLIP_X, "I'Max / Jaleco", "Nandemo Seal Iinkai (Astro Boy ver. 1.0?)", MACHINE_SUPPORTS_SAVE | MACHINE_NOT_WORKING ) // version guessed -GAME( 1997, nndmsealb, nndmseal, nndmseal, nndmseal, nndmseal_state, init_rockn, ROT0 | ORIENTATION_FLIP_X, "I'Max / Jaleco", "Nandemo Seal Iinkai (Astro Boy ver. 1.1)", MACHINE_SUPPORTS_SAVE | MACHINE_NOT_WORKING ) // appears to have one more mode than the one above, ver taken from PRG ROM labels -GAME( 1997, nndmsealc, nndmseal, nndmseal, nndmseal, nndmseal_state, init_rockn, ROT0 | ORIENTATION_FLIP_X, "I'Max / Jaleco", "Nandemo Seal Iinkai (alternate ver 1.0)", MACHINE_SUPPORTS_SAVE | MACHINE_NOT_WORKING ) // only shows Jaleco copyright even though I'Max is in strings in ROMs. Ver taken from PRG ROM labels - -GAME( 1999, rockn, 0, rockn, rockn, tetrisp2_state, init_rockn, ROT270, "Jaleco", "Rock'n Tread (Japan)", MACHINE_SUPPORTS_SAVE ) -GAME( 1999, rockna, rockn, rockn, rockn, tetrisp2_state, init_rockn1, ROT270, "Jaleco", "Rock'n Tread (Japan, alternate)", MACHINE_SUPPORTS_SAVE ) -GAME( 1999, rockn2, 0, rockn2, rockn, tetrisp2_state, init_rockn2, ROT270, "Jaleco", "Rock'n Tread 2 (Japan)", MACHINE_SUPPORTS_SAVE ) -GAME( 1999, rocknms, 0, rocknms, rocknms, rocknms_state, init_rocknms, ROT0, "Jaleco", "Rock'n MegaSession (Japan)", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_GRAPHICS ) -GAME( 1999, rockn3, 0, rockn2, rockn, tetrisp2_state, init_rockn3, ROT270, "Jaleco", "Rock'n 3 (Japan)", MACHINE_SUPPORTS_SAVE ) -GAME( 2000, rockn4, 0, rockn2, rockn, tetrisp2_state, init_rockn3, ROT270, "Jaleco / PCCWJ", "Rock'n 4 (Japan, prototype)", MACHINE_SUPPORTS_SAVE ) - -GAME( 1999, vjslap, 0, vjdash, vjdash, stepstag_state, empty_init, ROT0, "Jaleco", "VJ: Visual & Music Slap", MACHINE_NO_SOUND | MACHINE_NOT_WORKING ) -GAME( 1999, vjdash, vjslap, vjdash, vjdash, stepstag_state, empty_init, ROT0, "Jaleco", "VJ Dash (ver 1.0)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING ) -GAME( 1999, vjdasha, vjslap, vjdash, vjdash, stepstag_state, empty_init, ROT0, "Jaleco", "VJ Dash (Ver 1.2)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING ) +GAME( 1997, tetrisp2, 0, tetrisp2, tetrisp2, tetrisp2_state, empty_init, ROT0, "Jaleco / The Tetris Company", "Tetris Plus 2 (World, V2.8)", MACHINE_SUPPORTS_SAVE ) +GAME( 1997, tetrisp2a, tetrisp2, tetrisp2, tetrisp2, tetrisp2_state, empty_init, ROT0, "Jaleco / The Tetris Company", "Tetris Plus 2 (World, V2.7)", MACHINE_SUPPORTS_SAVE ) +GAME( 1997, tetrisp2j, tetrisp2, tetrisp2, tetrisp2j, tetrisp2_state, empty_init, ROT0, "Jaleco / The Tetris Company", "Tetris Plus 2 (Japan, V2.2)", MACHINE_SUPPORTS_SAVE ) +GAME( 1997, tetrisp2ja,tetrisp2, tetrisp2, tetrisp2j, tetrisp2_state, empty_init, ROT0, "Jaleco / The Tetris Company", "Tetris Plus 2 (Japan, V2.1)", MACHINE_SUPPORTS_SAVE ) + +GAME( 1997, nndmseal, 0, nndmseal, nndmseal, nndmseal_state, empty_init, ROT0 | ORIENTATION_FLIP_X, "I'Max / Jaleco", "Nandemo Seal Iinkai (ver 1.3)", MACHINE_SUPPORTS_SAVE | MACHINE_NOT_WORKING ) +GAME( 1997, nndmseal11,nndmseal, nndmseal, nndmseal, nndmseal_state, empty_init, ROT0 | ORIENTATION_FLIP_X, "I'Max / Jaleco", "Nandemo Seal Iinkai (ver 1.1)", MACHINE_SUPPORTS_SAVE | MACHINE_NOT_WORKING ) +GAME( 1997, nndmseala, nndmseal, nndmseal, nndmseal, nndmseal_state, empty_init, ROT0 | ORIENTATION_FLIP_X, "I'Max / Jaleco", "Nandemo Seal Iinkai (Astro Boy ver. 1.0?)", MACHINE_SUPPORTS_SAVE | MACHINE_NOT_WORKING ) // version guessed +GAME( 1997, nndmsealb, nndmseal, nndmseal, nndmseal, nndmseal_state, empty_init, ROT0 | ORIENTATION_FLIP_X, "I'Max / Jaleco", "Nandemo Seal Iinkai (Astro Boy ver. 1.1)", MACHINE_SUPPORTS_SAVE | MACHINE_NOT_WORKING ) // appears to have one more mode than the one above, ver taken from PRG ROM labels +GAME( 1997, nndmsealc, nndmseal, nndmseal, nndmseal, nndmseal_state, empty_init, ROT0 | ORIENTATION_FLIP_X, "I'Max / Jaleco", "Nandemo Seal Iinkai (alternate ver 1.0)", MACHINE_SUPPORTS_SAVE | MACHINE_NOT_WORKING ) // only shows Jaleco copyright even though I'Max is in strings in ROMs. Ver taken from PRG ROM labels + +GAME( 1999, rockn, 0, rockn, rockn, rockn_state, init_rockn, ROT270, "Jaleco", "Rock'n Tread (Japan)", MACHINE_SUPPORTS_SAVE ) +GAME( 1999, rockna, rockn, rockn, rockn, rockn_state, init_rockn, ROT270, "Jaleco", "Rock'n Tread (Japan, alternate)", MACHINE_SUPPORTS_SAVE ) +GAME( 1999, rockn2, 0, rockn2, rockn, rockn_state, init_rockn2, ROT270, "Jaleco", "Rock'n Tread 2 (Japan)", MACHINE_SUPPORTS_SAVE ) +GAME( 1999, rocknms, 0, rocknms, rocknms, rocknms_state, init_rocknms, ROT0, "Jaleco", "Rock'n MegaSession (Japan)", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_GRAPHICS ) +GAME( 1999, rockn3, 0, rockn2, rockn, rockn_state, init_rockn3, ROT270, "Jaleco", "Rock'n 3 (Japan)", MACHINE_SUPPORTS_SAVE ) +GAME( 2000, rockn4, 0, rockn2, rockn, rockn_state, init_rockn3, ROT270, "Jaleco / PCCWJ", "Rock'n 4 (Japan, prototype)", MACHINE_SUPPORTS_SAVE ) + +GAME( 1999, vjslap, 0, vjdash, vjdash, stepstag_state, empty_init, ROT0, "Jaleco", "VJ: Visual & Music Slap", MACHINE_NO_SOUND | MACHINE_NOT_WORKING ) +GAME( 1999, vjdash, vjslap, vjdash, vjdash, stepstag_state, empty_init, ROT0, "Jaleco", "VJ Dash (ver 1.0)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING ) +GAME( 1999, vjdasha, vjslap, vjdash, vjdash, stepstag_state, empty_init, ROT0, "Jaleco", "VJ Dash (Ver 1.2)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING ) // Undumped: // - Stepping Stage <- the original Game // - Stepping Stage 2 Supreme // Dumped (partially): -GAME( 1999, stepstag, 0, stepstag, stepstag, stepstag_state, empty_init, ROT0, "Jaleco", "Stepping Stage Special", MACHINE_NO_SOUND | MACHINE_NOT_WORKING ) -GAME( 1999, step3, 0, stepstag, stepstag, stepstag_state, empty_init, ROT0, "Jaleco", "Stepping 3 Superior", MACHINE_NO_SOUND | MACHINE_NOT_WORKING ) +GAME( 1999, stepstag, 0, stepstag, stepstag, stepstag_state, empty_init, ROT0, "Jaleco", "Stepping Stage Special", MACHINE_NO_SOUND | MACHINE_NOT_WORKING ) +GAME( 1999, step3, 0, stepstag, stepstag, stepstag_state, empty_init, ROT0, "Jaleco", "Stepping 3 Superior", MACHINE_NO_SOUND | MACHINE_NOT_WORKING ) diff --git a/src/mame/jaleco/tetrisp2.h b/src/mame/jaleco/tetrisp2.h index 9b9fd7395a7..dc00340e859 100644 --- a/src/mame/jaleco/tetrisp2.h +++ b/src/mame/jaleco/tetrisp2.h @@ -19,14 +19,13 @@ class tetrisp2_state : public driver_device { public: - tetrisp2_state(const machine_config &mconfig, device_type type, const char *tag) : - driver_device(mconfig, type, tag) + tetrisp2_state(const machine_config &mconfig, device_type type, const char *tag) + : driver_device(mconfig, type, tag) , m_maincpu(*this, "maincpu") , m_sysctrl(*this, "sysctrl") , m_sprite(*this, "sprite") , m_screen(*this, "screen") , m_spriteram(*this, "spriteram") - , m_spriteram2(*this, "spriteram2") , m_vram_fg(*this, "vram_fg") , m_vram_bg(*this, "vram_bg") , m_vram_rot(*this, "vram_rot") @@ -35,77 +34,52 @@ class tetrisp2_state : public driver_device , m_scroll_bg(*this, "scroll_bg") , m_rotregs(*this, "rotregs") , m_gfxdecode(*this, "gfxdecode") - , m_sub_gfxdecode(*this, "sub_gfxdecode") , m_palette(*this, "palette") , m_paletteram(*this, "paletteram") + , m_io_system(*this, "SYSTEM") , m_leds(*this, "led%u", 0U) { } - void rockn2(machine_config &config); - void tetrisp2(machine_config &config); - void nndmseal(machine_config &config); - void rockn(machine_config &config); + void tetrisp2(machine_config &config) ATTR_COLD; - void init_rockn2(); - void init_rockn1(); - void init_rockn(); - void init_rockn3(); +protected: + virtual void machine_start() override ATTR_COLD { m_leds.resolve(); } + virtual void video_start() override ATTR_COLD; - TILE_GET_INFO_MEMBER(get_tile_info_bg); - TILE_GET_INFO_MEMBER(get_tile_info_rot); + void setup_main_sysctrl(machine_config &config, const XTAL clock) ATTR_COLD; + void setup_main_sprite(machine_config &config, const XTAL clock) ATTR_COLD; -protected: - void setup_main_sysctrl(machine_config &config, const XTAL clock); - void setup_main_sprite(machine_config &config, const XTAL clock); void flipscreen_w(int state); void timer_irq_w(int state); void vblank_irq_w(int state); void field_irq_w(int state); void sound_reset_line_w(int state); - u16 rockn_adpcmbank_r(); - void rockn_adpcmbank_w(u16 data); - void rockn2_adpcmbank_w(u16 data); - u16 rockn_soundvolume_r(); - void rockn_soundvolume_w(u16 data); - void nndmseal_sound_bank_w(offs_t offset, u16 data, u16 mem_mask = ~0); u16 tetrisp2_ip_1_word_r(); - u16 rockn_nvram_r(offs_t offset); void tetrisp2_coincounter_w(u16 data); - void nndmseal_coincounter_w(offs_t offset, u16 data, u16 mem_mask = ~0); - void nndmseal_b20000_w(u16 data); u16 tetrisp2_nvram_r(offs_t offset); - void tetrisp2_nvram_w(offs_t offset, u16 data, u16 mem_mask = ~0); - void tetrisp2_palette_w(offs_t offset, u16 data, u16 mem_mask = ~0); - void tetrisp2_priority_w(offs_t offset, u16 data, u16 mem_mask = ~0); - u16 tetrisp2_priority_r(offs_t offset); - void tetrisp2_vram_bg_w(offs_t offset, u16 data, u16 mem_mask = ~0); - void tetrisp2_vram_fg_w(offs_t offset, u16 data, u16 mem_mask = ~0); - void tetrisp2_vram_rot_w(offs_t offset, u16 data, u16 mem_mask = ~0); + void nvram_w(offs_t offset, u16 data, u16 mem_mask = ~0); + void palette_w(offs_t offset, u16 data, u16 mem_mask = ~0); + void priority_w(offs_t offset, u16 data, u16 mem_mask = ~0); + u16 priority_r(offs_t offset); + void vram_bg_w(offs_t offset, u16 data, u16 mem_mask = ~0); + void vram_fg_w(offs_t offset, u16 data, u16 mem_mask = ~0); + void vram_rot_w(offs_t offset, u16 data, u16 mem_mask = ~0); TILE_GET_INFO_MEMBER(get_tile_info_fg); + TILE_GET_INFO_MEMBER(get_tile_info_bg); + TILE_GET_INFO_MEMBER(get_tile_info_rot); - DECLARE_VIDEO_START(tetrisp2); - DECLARE_VIDEO_START(nndmseal); - DECLARE_VIDEO_START(rockntread); u32 screen_update_tetrisp2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - u32 screen_update_rockntread(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - void init_rockn_timer(); - void nndmseal_map(address_map &map) ATTR_COLD; - void rockn1_map(address_map &map) ATTR_COLD; - void rockn2_map(address_map &map) ATTR_COLD; void tetrisp2_map(address_map &map) ATTR_COLD; - virtual void machine_start() override { m_leds.resolve(); } - required_device m_maincpu; required_device m_sysctrl; required_device m_sprite; required_device m_screen; required_shared_ptr m_spriteram; - optional_shared_ptr m_spriteram2; required_shared_ptr m_vram_fg; required_shared_ptr m_vram_bg; @@ -116,107 +90,179 @@ class tetrisp2_state : public driver_device required_shared_ptr m_rotregs; std::unique_ptr m_priority; required_device m_gfxdecode; - optional_device m_sub_gfxdecode; required_device m_palette; required_shared_ptr m_paletteram; + + optional_ioport m_io_system; output_finder<45> m_leds; - u16 m_rockn_protectdata = 0; - u16 m_rockn_adpcmbank = 0; - u16 m_rockn_soundvolume = 0; - int m_rot_ofsx = 0, m_rot_ofsy = 0; - int m_bank_lo = 0; - int m_bank_hi = 0; + s32 m_rot_ofsx = 0, m_rot_ofsy = 0; tilemap_t *m_tilemap_bg = nullptr; tilemap_t *m_tilemap_fg = nullptr; tilemap_t *m_tilemap_rot = nullptr; }; +// With camera, printer, OKI MSM6295 sound subsystem class nndmseal_state : public tetrisp2_state { public: - using tetrisp2_state::tetrisp2_state; static constexpr feature_type unemulated_features() { return feature::CAMERA | feature::PRINTER; } + + nndmseal_state(const machine_config &mconfig, device_type type, const char *tag) + : tetrisp2_state(mconfig, type, tag) + , m_okibank(*this, "okibank%u", 0U) + { } + + void nndmseal(machine_config &config) ATTR_COLD; + +protected: + virtual void machine_start() override ATTR_COLD; + virtual void video_start() override ATTR_COLD; + +private: + void nndmseal_sound_bank_w(u8 data); + void nndmseal_coincounter_w(offs_t offset, u16 data, u16 mem_mask = ~0); + void nndmseal_b20000_w(u16 data); + + void nndmseal_map(address_map &map) ATTR_COLD; + void nndmseal_oki_map(address_map &map) ATTR_COLD; + + required_memory_bank_array<2> m_okibank; + + u8 m_bank_lo; + u8 m_bank_hi; }; -class rocknms_state : public tetrisp2_state +// with ADPCM bankswitching and alternative layer size +class rockn_state : public tetrisp2_state { public: - rocknms_state(const machine_config &mconfig, device_type type, const char *tag) + rockn_state(const machine_config &mconfig, device_type type, const char *tag) : tetrisp2_state(mconfig, type, tag) + , m_spriteram2(*this, "spriteram2") + , m_ymzbank(*this, "ymzbank_%u", 0U) + { } + + void rockn(machine_config &config) ATTR_COLD; + void rockn2(machine_config &config) ATTR_COLD; + + void init_rockn() ATTR_COLD; + void init_rockn2() ATTR_COLD; + void init_rockn3() ATTR_COLD; + +protected: + virtual void machine_start() override ATTR_COLD; + virtual void video_start() override ATTR_COLD; + + u16 rockn_adpcmbank_r(); + void rockn_adpcmbank_w(u16 data); + void rockn2_adpcmbank_w(u16 data); + u16 rockn_soundvolume_r(); + void rockn_soundvolume_w(u16 data); + u16 rockn_nvram_r(offs_t offset); + + u32 screen_update_rockntread(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + + void rockn1_map(address_map &map) ATTR_COLD; + void rockn1_ymz_map(address_map &map) ATTR_COLD; + void rockn2_map(address_map &map) ATTR_COLD; + void rockn2_ymz_map(address_map &map) ATTR_COLD; + + optional_shared_ptr m_spriteram2; + + optional_memory_bank_array<3> m_ymzbank; + + u16 m_rockn_protectdata = 0; + u16 m_rockn_adpcmbank = 0; + u16 m_rockn_soundvolume = 0; +}; + +class rocknms_state : public rockn_state +{ +public: + rocknms_state(const machine_config &mconfig, device_type type, const char *tag) + : rockn_state(mconfig, type, tag) , m_subcpu(*this, "sub") , m_sub_sysctrl(*this, "sub_sysctrl") , m_sub_screen(*this, "sub_screen") - , m_rocknms_sub_sprite(*this, "sub_sprite") - , m_rocknms_sub_priority(*this, "sub_priority") - , m_rocknms_sub_vram_rot(*this, "sub_vram_rot") - , m_rocknms_sub_vram_fg(*this, "sub_vram_fg") - , m_rocknms_sub_vram_bg(*this, "sub_vram_bg") - , m_rocknms_sub_scroll_fg(*this, "sub_scroll_fg") - , m_rocknms_sub_scroll_bg(*this, "sub_scroll_bg") - , m_rocknms_sub_rotregs(*this, "sub_rotregs") + , m_sub_sprite(*this, "sub_sprite") + , m_sub_priority(*this, "sub_priority") + , m_sub_vram_rot(*this, "sub_vram_rot") + , m_sub_vram_fg(*this, "sub_vram_fg") + , m_sub_vram_bg(*this, "sub_vram_bg") + , m_sub_scroll_fg(*this, "sub_scroll_fg") + , m_sub_scroll_bg(*this, "sub_scroll_bg") + , m_sub_rotregs(*this, "sub_rotregs") , m_sub_palette(*this, "sub_palette") , m_sub_paletteram(*this, "sub_paletteram") + , m_sub_gfxdecode(*this, "sub_gfxdecode") { } - void rocknms(machine_config &config); - void init_rocknms(); - ioport_value rocknms_main2sub_status_r(); + void rocknms(machine_config &config) ATTR_COLD; + + ioport_value main2sub_status_r(); + + void init_rocknms() ATTR_COLD; + +protected: + virtual void machine_start() override ATTR_COLD; + virtual void video_start() override ATTR_COLD; private: required_device m_subcpu; required_device m_sub_sysctrl; required_device m_sub_screen; - required_device m_rocknms_sub_sprite; - required_shared_ptr m_rocknms_sub_priority; - required_shared_ptr m_rocknms_sub_vram_rot; - required_shared_ptr m_rocknms_sub_vram_fg; - required_shared_ptr m_rocknms_sub_vram_bg; - required_shared_ptr m_rocknms_sub_scroll_fg; - required_shared_ptr m_rocknms_sub_scroll_bg; - required_shared_ptr m_rocknms_sub_rotregs; + required_device m_sub_sprite; + required_shared_ptr m_sub_priority; + required_shared_ptr m_sub_vram_rot; + required_shared_ptr m_sub_vram_fg; + required_shared_ptr m_sub_vram_bg; + required_shared_ptr m_sub_scroll_fg; + required_shared_ptr m_sub_scroll_bg; + required_shared_ptr m_sub_rotregs; required_device m_sub_palette; required_shared_ptr m_sub_paletteram; + required_device m_sub_gfxdecode; + + u32 screen_update_top(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + u32 screen_update_bottom(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - u32 screen_update_rocknms_left(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - u32 screen_update_rocknms_right(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); void rocknms_main_map(address_map &map) ATTR_COLD; void rocknms_sub_map(address_map &map) ATTR_COLD; - u16 rocknms_main2sub_r(); - void rocknms_main2sub_w(offs_t offset, u16 data, u16 mem_mask = ~0); - void rocknms_sub2main_w(offs_t offset, u16 data, u16 mem_mask = ~0); - void rocknms_sub_palette_w(offs_t offset, u16 data, u16 mem_mask = ~0); - void rocknms_sub_priority_w(offs_t offset, u16 data, u16 mem_mask = ~0); - void rocknms_sub_vram_bg_w(offs_t offset, u16 data, u16 mem_mask = ~0); - void rocknms_sub_vram_fg_w(offs_t offset, u16 data, u16 mem_mask = ~0); - void rocknms_sub_vram_rot_w(offs_t offset, u16 data, u16 mem_mask = ~0); - DECLARE_VIDEO_START(rocknms); - - TILE_GET_INFO_MEMBER(get_tile_info_rocknms_sub_bg); - TILE_GET_INFO_MEMBER(get_tile_info_rocknms_sub_fg); - TILE_GET_INFO_MEMBER(get_tile_info_rocknms_sub_rot); + u16 main2sub_r(); + void main2sub_w(offs_t offset, u16 data, u16 mem_mask = ~0); + void sub2main_w(offs_t offset, u16 data, u16 mem_mask = ~0); + void sub_palette_w(offs_t offset, u16 data, u16 mem_mask = ~0); + void sub_priority_w(offs_t offset, u16 data, u16 mem_mask = ~0); + void sub_vram_bg_w(offs_t offset, u16 data, u16 mem_mask = ~0); + void sub_vram_fg_w(offs_t offset, u16 data, u16 mem_mask = ~0); + void sub_vram_rot_w(offs_t offset, u16 data, u16 mem_mask = ~0); - u16 m_rocknms_main2sub = 0; - u16 m_rocknms_sub2main = 0; - - tilemap_t *m_tilemap_sub_bg = nullptr; - tilemap_t *m_tilemap_sub_fg = nullptr; - tilemap_t *m_tilemap_sub_rot = nullptr; + TILE_GET_INFO_MEMBER(get_tile_info_sub_bg); + TILE_GET_INFO_MEMBER(get_tile_info_sub_fg); + TILE_GET_INFO_MEMBER(get_tile_info_sub_rot); void sub_flipscreen_w(int state); void sub_timer_irq_w(int state); void sub_vblank_irq_w(int state); void sub_field_irq_w(int state); void sub_sound_reset_line_w(int state); + + u16 m_main2sub = 0; + u16 m_sub2main = 0; + + tilemap_t *m_tilemap_sub_bg = nullptr; + tilemap_t *m_tilemap_sub_fg = nullptr; + tilemap_t *m_tilemap_sub_rot = nullptr; }; -class stepstag_state : public tetrisp2_state +class stepstag_state : public rockn_state { public: - stepstag_state(const machine_config &mconfig, device_type type, const char *tag) : - tetrisp2_state(mconfig, type, tag) + stepstag_state(const machine_config &mconfig, device_type type, const char *tag) + : rockn_state(mconfig, type, tag) , m_subcpu(*this, "sub") , m_vj_sprite_l(*this, "sprite_l") , m_vj_sprite_m(*this, "sprite_m") @@ -233,10 +279,11 @@ class stepstag_state : public tetrisp2_state , m_jaleco_vj_pc(*this, "jaleco_vj_pc") , m_soundvr(*this, "SOUND_VR%u", 1) , m_rscreen(*this, "rscreen") + , m_io_coins(*this, "COINS") { } - void stepstag(machine_config &config); - void vjdash(machine_config &config); + void stepstag(machine_config &config) ATTR_COLD; + void vjdash(machine_config &config) ATTR_COLD; DECLARE_VIDEO_START(stepstag); @@ -246,8 +293,6 @@ class stepstag_state : public tetrisp2_state private: u16 stepstag_coins_r(); - u16 vj_upload_idx = 0; - bool vj_upload_fini = false; void stepstag_b00000_w(u16 data); void stepstag_b20000_w(offs_t offset, u16 data, u16 mem_mask = ~0); u16 stepstag_sprite_status_status_r(); @@ -256,9 +301,9 @@ class stepstag_state : public tetrisp2_state void stepstag_neon_w(offs_t offset, u16 data, u16 mem_mask = ~0); void stepstag_step_leds_w(offs_t offset, u16 data, u16 mem_mask = ~0); void stepstag_button_leds_w(offs_t offset, u16 data, u16 mem_mask = ~0); - void stepstag_palette_left_w(offs_t offset, u16 data, u16 mem_mask = ~0); - void stepstag_palette_mid_w(offs_t offset, u16 data, u16 mem_mask = ~0); - void stepstag_palette_right_w(offs_t offset, u16 data, u16 mem_mask = ~0); + void palette_left_w(offs_t offset, u16 data, u16 mem_mask = ~0); + void palette_mid_w(offs_t offset, u16 data, u16 mem_mask = ~0); + void palette_right_w(offs_t offset, u16 data, u16 mem_mask = ~0); void stepstag_spriteram1_updated_w(u16 data); void stepstag_spriteram2_updated_w(u16 data); @@ -304,10 +349,15 @@ class stepstag_state : public tetrisp2_state optional_ioport_array<2> m_soundvr; required_device m_rscreen; + required_ioport m_io_coins; + std::unique_ptr m_spriteram1_data; std::unique_ptr m_spriteram2_data; std::unique_ptr m_spriteram3_data; + u16 m_vj_upload_idx = 0; + bool m_vj_upload_fini = false; + uint8_t m_adv7176a_sclock; uint8_t m_adv7176a_sdata; uint8_t m_adv7176a_state; diff --git a/src/mame/jaleco/tetrisp2_v.cpp b/src/mame/jaleco/tetrisp2_v.cpp index 27f75ca47ac..591f816d19d 100644 --- a/src/mame/jaleco/tetrisp2_v.cpp +++ b/src/mame/jaleco/tetrisp2_v.cpp @@ -58,17 +58,17 @@ void rocknms_state::sub_flipscreen_w(int state) ***************************************************************************/ /* BBBBBGGGGGRRRRRx xxxxxxxxxxxxxxxx */ -void tetrisp2_state::tetrisp2_palette_w(offs_t offset, u16 data, u16 mem_mask) +void tetrisp2_state::palette_w(offs_t offset, u16 data, u16 mem_mask) { data = COMBINE_DATA(&m_paletteram[offset]); - if ((offset & 1) == 0) + if (BIT(~offset, 0)) m_palette->set_pen_color(offset/2,pal5bit(data >> 1),pal5bit(data >> 6),pal5bit(data >> 11)); } -void rocknms_state::rocknms_sub_palette_w(offs_t offset, u16 data, u16 mem_mask) +void rocknms_state::sub_palette_w(offs_t offset, u16 data, u16 mem_mask) { data = COMBINE_DATA(&m_sub_paletteram[offset]); - if ((offset & 1) == 0) + if (BIT(~offset, 0)) m_sub_palette->set_pen_color(offset/2,pal5bit(data >> 1),pal5bit(data >> 6),pal5bit(data >> 11)); } @@ -82,7 +82,7 @@ void rocknms_state::rocknms_sub_palette_w(offs_t offset, u16 data, u16 mem_mask) ***************************************************************************/ -void tetrisp2_state::tetrisp2_priority_w(offs_t offset, u16 data, u16 mem_mask) +void tetrisp2_state::priority_w(offs_t offset, u16 data, u16 mem_mask) { if (ACCESSING_BITS_0_7) m_priority[offset] = data; @@ -90,17 +90,17 @@ void tetrisp2_state::tetrisp2_priority_w(offs_t offset, u16 data, u16 mem_mask) m_priority[offset] = data >> 8; } -u16 tetrisp2_state::tetrisp2_priority_r(offs_t offset) +u16 tetrisp2_state::priority_r(offs_t offset) { return m_priority[offset] | 0xff00; } -void rocknms_state::rocknms_sub_priority_w(offs_t offset, u16 data, u16 mem_mask) +void rocknms_state::sub_priority_w(offs_t offset, u16 data, u16 mem_mask) { if (ACCESSING_BITS_0_7) - m_rocknms_sub_priority[offset] = data; + m_sub_priority[offset] = data; else - m_rocknms_sub_priority[offset] = data >> 8; + m_sub_priority[offset] = data >> 8; } @@ -133,7 +133,7 @@ TILE_GET_INFO_MEMBER(tetrisp2_state::get_tile_info_bg) 0); } -void tetrisp2_state::tetrisp2_vram_bg_w(offs_t offset, u16 data, u16 mem_mask) +void tetrisp2_state::vram_bg_w(offs_t offset, u16 data, u16 mem_mask) { COMBINE_DATA(&m_vram_bg[offset]); m_tilemap_bg->mark_tile_dirty(offset/2); @@ -153,7 +153,7 @@ TILE_GET_INFO_MEMBER(tetrisp2_state::get_tile_info_fg) 0); } -void tetrisp2_state::tetrisp2_vram_fg_w(offs_t offset, u16 data, u16 mem_mask) +void tetrisp2_state::vram_fg_w(offs_t offset, u16 data, u16 mem_mask) { // VJ and Stepping Stage write to the upper byte here to display ASCII text, // other usages in those games outside of ASCII text write a full 16-bit value. @@ -168,73 +168,73 @@ void tetrisp2_state::tetrisp2_vram_fg_w(offs_t offset, u16 data, u16 mem_mask) TILE_GET_INFO_MEMBER(tetrisp2_state::get_tile_info_rot) { - u16 code_hi = m_vram_rot[ 2 * tile_index + 0]; - u16 code_lo = m_vram_rot[ 2 * tile_index + 1]; + u16 code_hi = m_vram_rot[2 * tile_index + 0]; + u16 code_lo = m_vram_rot[2 * tile_index + 1]; tileinfo.set(1, code_hi, code_lo & 0xf, 0); } -void tetrisp2_state::tetrisp2_vram_rot_w(offs_t offset, u16 data, u16 mem_mask) +void tetrisp2_state::vram_rot_w(offs_t offset, u16 data, u16 mem_mask) { COMBINE_DATA(&m_vram_rot[offset]); m_tilemap_rot->mark_tile_dirty(offset/2); } -TILE_GET_INFO_MEMBER(rocknms_state::get_tile_info_rocknms_sub_bg) +TILE_GET_INFO_MEMBER(rocknms_state::get_tile_info_sub_bg) { - u16 code_hi = m_rocknms_sub_vram_bg[ 2 * tile_index + 0]; - u16 code_lo = m_rocknms_sub_vram_bg[ 2 * tile_index + 1]; + u16 code_hi = m_sub_vram_bg[2 * tile_index + 0]; + u16 code_lo = m_sub_vram_bg[2 * tile_index + 1]; tileinfo.set(0, code_hi, code_lo & 0xf, 0); } -void rocknms_state::rocknms_sub_vram_bg_w(offs_t offset, u16 data, u16 mem_mask) +void rocknms_state::sub_vram_bg_w(offs_t offset, u16 data, u16 mem_mask) { - COMBINE_DATA(&m_rocknms_sub_vram_bg[offset]); + COMBINE_DATA(&m_sub_vram_bg[offset]); m_tilemap_sub_bg->mark_tile_dirty(offset/2); } -TILE_GET_INFO_MEMBER(rocknms_state::get_tile_info_rocknms_sub_fg) +TILE_GET_INFO_MEMBER(rocknms_state::get_tile_info_sub_fg) { - u16 code_hi = m_rocknms_sub_vram_fg[ 2 * tile_index + 0]; - u16 code_lo = m_rocknms_sub_vram_fg[ 2 * tile_index + 1]; + u16 code_hi = m_sub_vram_fg[2 * tile_index + 0]; + u16 code_lo = m_sub_vram_fg[2 * tile_index + 1]; tileinfo.set(2, code_hi, code_lo & 0xf, 0); } -void rocknms_state::rocknms_sub_vram_fg_w(offs_t offset, u16 data, u16 mem_mask) +void rocknms_state::sub_vram_fg_w(offs_t offset, u16 data, u16 mem_mask) { - COMBINE_DATA(&m_rocknms_sub_vram_fg[offset]); + COMBINE_DATA(&m_sub_vram_fg[offset]); m_tilemap_sub_fg->mark_tile_dirty(offset/2); } -TILE_GET_INFO_MEMBER(rocknms_state::get_tile_info_rocknms_sub_rot) +TILE_GET_INFO_MEMBER(rocknms_state::get_tile_info_sub_rot) { - u16 code_hi = m_rocknms_sub_vram_rot[ 2 * tile_index + 0]; - u16 code_lo = m_rocknms_sub_vram_rot[ 2 * tile_index + 1]; + u16 code_hi = m_sub_vram_rot[2 * tile_index + 0]; + u16 code_lo = m_sub_vram_rot[2 * tile_index + 1]; tileinfo.set(1, code_hi, code_lo & 0xf, 0); } -void rocknms_state::rocknms_sub_vram_rot_w(offs_t offset, u16 data, u16 mem_mask) +void rocknms_state::sub_vram_rot_w(offs_t offset, u16 data, u16 mem_mask) { - COMBINE_DATA(&m_rocknms_sub_vram_rot[offset]); + COMBINE_DATA(&m_sub_vram_rot[offset]); m_tilemap_sub_rot->mark_tile_dirty(offset/2); } -VIDEO_START_MEMBER(tetrisp2_state,tetrisp2) +void tetrisp2_state::video_start() { m_tilemap_bg = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(tetrisp2_state::get_tile_info_bg)), TILEMAP_SCAN_ROWS, 16,16, NX_0,NY_0); m_tilemap_fg = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(tetrisp2_state::get_tile_info_fg)), TILEMAP_SCAN_ROWS, 8,8, NX_1,NY_1); @@ -246,23 +246,22 @@ VIDEO_START_MEMBER(tetrisp2_state,tetrisp2) // should be smaller and mirrored like m32 I guess m_priority = std::make_unique(0x40000); + save_item(NAME(m_rot_ofsx)); + save_item(NAME(m_rot_ofsy)); save_pointer(NAME(m_priority), 0x40000); } -VIDEO_START_MEMBER(tetrisp2_state,nndmseal) +void nndmseal_state::video_start() { - VIDEO_START_CALL_MEMBER( tetrisp2 ); + tetrisp2_state::video_start(); m_tilemap_bg->set_scrolldx(-4,-4); - - m_bank_hi = 0; - m_bank_lo = 0; } -VIDEO_START_MEMBER(tetrisp2_state,rockntread) +void rockn_state::video_start() { - m_tilemap_bg = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(tetrisp2_state::get_tile_info_bg)), TILEMAP_SCAN_ROWS, 16,16, 256,16); // rockn ms(main),1,2,3,4 - m_tilemap_fg = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(tetrisp2_state::get_tile_info_fg)), TILEMAP_SCAN_ROWS, 8,8, 64,64); - m_tilemap_rot = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(tetrisp2_state::get_tile_info_rot)), TILEMAP_SCAN_ROWS, 16,16, 128,128); + m_tilemap_bg = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(rockn_state::get_tile_info_bg)), TILEMAP_SCAN_ROWS, 16,16, 256,16); // rockn ms(main),1,2,3,4 + m_tilemap_fg = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(rockn_state::get_tile_info_fg)), TILEMAP_SCAN_ROWS, 8,8, 64,64); + m_tilemap_rot = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(rockn_state::get_tile_info_rot)), TILEMAP_SCAN_ROWS, 16,16, 128,128); m_tilemap_bg->set_transparent_pen(0); m_tilemap_fg->set_transparent_pen(0); @@ -276,14 +275,13 @@ VIDEO_START_MEMBER(tetrisp2_state,rockntread) save_pointer(NAME(m_priority), 0x40000); } - -VIDEO_START_MEMBER(rocknms_state,rocknms) +void rocknms_state::video_start() { - VIDEO_START_CALL_MEMBER( rockntread ); + rockn_state::video_start(); - m_tilemap_sub_bg = &machine().tilemap().create(*m_sub_gfxdecode, tilemap_get_info_delegate(*this, FUNC(rocknms_state::get_tile_info_rocknms_sub_bg)), TILEMAP_SCAN_ROWS, 16,16, 32,256); - m_tilemap_sub_fg = &machine().tilemap().create(*m_sub_gfxdecode, tilemap_get_info_delegate(*this, FUNC(rocknms_state::get_tile_info_rocknms_sub_fg)), TILEMAP_SCAN_ROWS, 8,8, 64,64); - m_tilemap_sub_rot = &machine().tilemap().create(*m_sub_gfxdecode, tilemap_get_info_delegate(*this, FUNC(rocknms_state::get_tile_info_rocknms_sub_rot)), TILEMAP_SCAN_ROWS, 16,16, 128,128); + m_tilemap_sub_bg = &machine().tilemap().create(*m_sub_gfxdecode, tilemap_get_info_delegate(*this, FUNC(rocknms_state::get_tile_info_sub_bg)), TILEMAP_SCAN_ROWS, 16,16, 32,256); + m_tilemap_sub_fg = &machine().tilemap().create(*m_sub_gfxdecode, tilemap_get_info_delegate(*this, FUNC(rocknms_state::get_tile_info_sub_fg)), TILEMAP_SCAN_ROWS, 8,8, 64,64); + m_tilemap_sub_rot = &machine().tilemap().create(*m_sub_gfxdecode, tilemap_get_info_delegate(*this, FUNC(rocknms_state::get_tile_info_sub_rot)), TILEMAP_SCAN_ROWS, 16,16, 128,128); m_tilemap_sub_bg->set_transparent_pen(0); m_tilemap_sub_fg->set_transparent_pen(0); @@ -390,24 +388,20 @@ static void tetrisp2_draw_sprites(BitmapClass &bitmap, bitmap_ind8 &bitmap_pri, u32 tetrisp2_state::screen_update_tetrisp2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - int asc_pri; - int scr_pri; - int rot_pri; - /* Black background color */ bitmap.fill(0, cliprect); screen.priority().fill(0); - m_tilemap_bg->set_scrollx(0, (((m_scroll_bg[ 0 ] + 0x0014) + m_scroll_bg[ 2 ] ) & 0xffff)); - m_tilemap_bg->set_scrolly(0, (((m_scroll_bg[ 3 ] + 0x0000) + m_scroll_bg[ 5 ] ) & 0xffff)); + m_tilemap_bg->set_scrollx(0, (((m_scroll_bg[0] + 0x0014) + m_scroll_bg[2] ) & 0xffff)); + m_tilemap_bg->set_scrolly(0, (((m_scroll_bg[3] + 0x0000) + m_scroll_bg[5] ) & 0xffff)); - m_tilemap_fg->set_scrollx(0, m_scroll_fg[ 2 ]); - m_tilemap_fg->set_scrolly(0, m_scroll_fg[ 5 ]); + m_tilemap_fg->set_scrollx(0, m_scroll_fg[2]); + m_tilemap_fg->set_scrolly(0, m_scroll_fg[5]); - m_tilemap_rot->set_scrollx(0, (m_rotregs[ 0 ] - m_rot_ofsx)); - m_tilemap_rot->set_scrolly(0, (m_rotregs[ 2 ] - m_rot_ofsy)); + m_tilemap_rot->set_scrollx(0, (m_rotregs[0] - m_rot_ofsx)); + m_tilemap_rot->set_scrolly(0, (m_rotregs[2] - m_rot_ofsy)); - asc_pri = scr_pri = rot_pri = 0; + int asc_pri = 0, scr_pri = 0, rot_pri = 0; if((m_priority[0x2b00 / 2] & 0x00ff) == 0x0034) asc_pri++; @@ -450,26 +444,22 @@ u32 tetrisp2_state::screen_update_tetrisp2(screen_device &screen, bitmap_ind16 & return 0; } -u32 tetrisp2_state::screen_update_rockntread(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +u32 rockn_state::screen_update_rockntread(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - int asc_pri; - int scr_pri; - int rot_pri; - /* Black background color */ bitmap.fill(0, cliprect); screen.priority().fill(0); - m_tilemap_bg->set_scrollx(0, (((m_scroll_bg[ 0 ] + 0x0014) + m_scroll_bg[ 2 ] ) & 0xffff)); - m_tilemap_bg->set_scrolly(0, (((m_scroll_bg[ 3 ] + 0x0000) + m_scroll_bg[ 5 ] ) & 0xffff)); + m_tilemap_bg->set_scrollx(0, (((m_scroll_bg[0] + 0x0014) + m_scroll_bg[2] ) & 0xffff)); + m_tilemap_bg->set_scrolly(0, (((m_scroll_bg[3] + 0x0000) + m_scroll_bg[5] ) & 0xffff)); - m_tilemap_fg->set_scrollx(0, m_scroll_fg[ 2 ]); - m_tilemap_fg->set_scrolly(0, m_scroll_fg[ 5 ]); + m_tilemap_fg->set_scrollx(0, m_scroll_fg[2]); + m_tilemap_fg->set_scrolly(0, m_scroll_fg[5]); - m_tilemap_rot->set_scrollx(0, (m_rotregs[ 0 ] - m_rot_ofsx)); - m_tilemap_rot->set_scrolly(0, (m_rotregs[ 2 ] - m_rot_ofsy)); + m_tilemap_rot->set_scrollx(0, (m_rotregs[0] - m_rot_ofsx)); + m_tilemap_rot->set_scrolly(0, (m_rotregs[2] - m_rot_ofsy)); - asc_pri = scr_pri = rot_pri = 0; + int asc_pri = 0, scr_pri = 0, rot_pri = 0; if((m_priority[0x2b00 / 2] & 0x00ff) == 0x0034) asc_pri++; @@ -515,35 +505,31 @@ u32 tetrisp2_state::screen_update_rockntread(screen_device &screen, bitmap_ind16 -u32 rocknms_state::screen_update_rocknms_left(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +u32 rocknms_state::screen_update_top(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { - int asc_pri; - int scr_pri; - int rot_pri; - - m_tilemap_sub_bg->set_scrollx(0, m_rocknms_sub_scroll_bg[ 2 ] + 0x000); - m_tilemap_sub_bg->set_scrolly(0, m_rocknms_sub_scroll_bg[ 5 ] + 0x000); - m_tilemap_sub_fg->set_scrollx(0, m_rocknms_sub_scroll_fg[ 2 ] + 0x000); - m_tilemap_sub_fg->set_scrolly(0, m_rocknms_sub_scroll_fg[ 5 ] + 0x000); - m_tilemap_sub_rot->set_scrollx(0, m_rocknms_sub_rotregs[ 0 ] + 0x400); - m_tilemap_sub_rot->set_scrolly(0, m_rocknms_sub_rotregs[ 2 ] + 0x400); + m_tilemap_sub_bg->set_scrollx(0, m_sub_scroll_bg[2] + 0x000); + m_tilemap_sub_bg->set_scrolly(0, m_sub_scroll_bg[5] + 0x000); + m_tilemap_sub_fg->set_scrollx(0, m_sub_scroll_fg[2] + 0x000); + m_tilemap_sub_fg->set_scrolly(0, m_sub_scroll_fg[5] + 0x000); + m_tilemap_sub_rot->set_scrollx(0, m_sub_rotregs[0] + 0x400); + m_tilemap_sub_rot->set_scrolly(0, m_sub_rotregs[2] + 0x400); bitmap.fill(m_palette->pen(0x0000), cliprect); screen.priority().fill(0, cliprect); - asc_pri = scr_pri = rot_pri = 0; + int asc_pri = 0, scr_pri = 0, rot_pri = 0; - if((m_rocknms_sub_priority[0x2b00 / 2] & 0x00ff) == 0x0034) + if((m_sub_priority[0x2b00 / 2] & 0x00ff) == 0x0034) asc_pri++; else rot_pri++; - if((m_rocknms_sub_priority[0x2e00 / 2] & 0x00ff) == 0x0034) + if((m_sub_priority[0x2e00 / 2] & 0x00ff) == 0x0034) asc_pri++; else scr_pri++; - if((m_rocknms_sub_priority[0x3a00 / 2] & 0x00ff) == 0x000c) + if((m_sub_priority[0x3a00 / 2] & 0x00ff) == 0x000c) scr_pri++; else rot_pri++; @@ -570,29 +556,25 @@ u32 rocknms_state::screen_update_rocknms_left(screen_device &screen, bitmap_rgb3 m_tilemap_sub_fg->draw(screen, bitmap, cliprect, 0, 1 << 2); tetrisp2_draw_sprites(bitmap, screen.priority(), cliprect, m_priority.get(), - m_spriteram2, m_spriteram2.bytes(), m_rocknms_sub_sprite); + m_spriteram2, m_spriteram2.bytes(), m_sub_sprite); return 0; } -u32 rocknms_state::screen_update_rocknms_right(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +u32 rocknms_state::screen_update_bottom(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { - int asc_pri; - int scr_pri; - int rot_pri; - - m_tilemap_bg->set_scrollx(0, m_scroll_bg[ 2 ] + 0x000); - m_tilemap_bg->set_scrolly(0, m_scroll_bg[ 5 ] + 0x000); - m_tilemap_fg->set_scrollx(0, m_scroll_fg[ 2 ] + 0x000); - m_tilemap_fg->set_scrolly(0, m_scroll_fg[ 5 ] + 0x000); - m_tilemap_rot->set_scrollx(0, m_rotregs[ 0 ] + 0x400); - m_tilemap_rot->set_scrolly(0, m_rotregs[ 2 ] + 0x400); + m_tilemap_bg->set_scrollx(0, m_scroll_bg[2] + 0x000); + m_tilemap_bg->set_scrolly(0, m_scroll_bg[5] + 0x000); + m_tilemap_fg->set_scrollx(0, m_scroll_fg[2] + 0x000); + m_tilemap_fg->set_scrolly(0, m_scroll_fg[5] + 0x000); + m_tilemap_rot->set_scrollx(0, m_rotregs[0] + 0x400); + m_tilemap_rot->set_scrolly(0, m_rotregs[2] + 0x400); /* Black background color */ bitmap.fill(m_palette->pen(0x0000), cliprect); screen.priority().fill(0, cliprect); - asc_pri = scr_pri = rot_pri = 0; + int asc_pri = 0, scr_pri = 0, rot_pri = 0; if((m_priority[0x2b00 / 2] & 0x00ff) == 0x0034) asc_pri++; @@ -766,19 +748,19 @@ void stepstag_state::convert_yuv422_to_rgb888(palette_device *paldev, u16 *palra paldev->set_pen_color(offset/4, r, g, b); } -void stepstag_state::stepstag_palette_left_w(offs_t offset, u16 data, u16 mem_mask) +void stepstag_state::palette_left_w(offs_t offset, u16 data, u16 mem_mask) { COMBINE_DATA(&m_vj_paletteram_l[offset]); convert_yuv422_to_rgb888(m_vj_palette_l,m_vj_paletteram_l,offset); } -void stepstag_state::stepstag_palette_mid_w(offs_t offset, u16 data, u16 mem_mask) +void stepstag_state::palette_mid_w(offs_t offset, u16 data, u16 mem_mask) { COMBINE_DATA(&m_vj_paletteram_m[offset]); convert_yuv422_to_rgb888(m_vj_palette_m,m_vj_paletteram_m,offset); } -void stepstag_state::stepstag_palette_right_w(offs_t offset, u16 data, u16 mem_mask) +void stepstag_state::palette_right_w(offs_t offset, u16 data, u16 mem_mask) { COMBINE_DATA(&m_vj_paletteram_r[offset]); convert_yuv422_to_rgb888(m_vj_palette_r,m_vj_paletteram_r,offset); diff --git a/src/mame/konami/battlnts.cpp b/src/mame/konami/battlnts.cpp index 7221e9c29a7..0201fe3c6c1 100644 --- a/src/mame/konami/battlnts.cpp +++ b/src/mame/konami/battlnts.cpp @@ -331,6 +331,8 @@ void battlnts_state::battlnts(machine_config &config) K007342(config, m_k007342, 0, "palette", gfx_battlnts_tiles); m_k007342->set_tile_callback(FUNC(battlnts_state::tile_callback)); + m_k007342->flipscreen_cb().set(m_k007420, FUNC(k007420_device::set_flipscreen)); + m_k007342->sprite_wrap_y_cb().set(m_k007420, FUNC(k007420_device::set_wrap_y)); K007420(config, m_k007420, 0, "palette", gfx_battlnts_spr); m_k007420->set_bank_limit(0x3ff); diff --git a/src/mame/konami/bladestl.cpp b/src/mame/konami/bladestl.cpp index 4c7b0bdcf66..dd772c6b699 100644 --- a/src/mame/konami/bladestl.cpp +++ b/src/mame/konami/bladestl.cpp @@ -173,6 +173,7 @@ uint32_t bladestl_state::screen_update(screen_device &screen, bitmap_ind16 &bitm m_k007342->tilemap_draw(screen, bitmap, cliprect, 1, 1 | TILEMAP_DRAW_OPAQUE, 0); m_k007342->tilemap_draw(screen, bitmap, cliprect, 0, 0 ,0); m_k007342->tilemap_draw(screen, bitmap, cliprect, 0, 1 ,0); + return 0; } @@ -446,6 +447,8 @@ void bladestl_state::bladestl(machine_config &config) K007342(config, m_k007342, 0, "palette", gfx_bladestl_tiles); m_k007342->set_tile_callback(FUNC(bladestl_state::tile_callback)); + m_k007342->flipscreen_cb().set(m_k007420, FUNC(k007420_device::set_flipscreen)); + m_k007342->sprite_wrap_y_cb().set(m_k007420, FUNC(k007420_device::set_wrap_y)); K007420(config, m_k007420, 0, "palette", gfx_bladestl_spr); m_k007420->set_bank_limit(0x3ff); diff --git a/src/mame/konami/flkatck.cpp b/src/mame/konami/flkatck.cpp index 51980bc0213..7e178728681 100644 --- a/src/mame/konami/flkatck.cpp +++ b/src/mame/konami/flkatck.cpp @@ -242,7 +242,7 @@ uint32_t flkatck_state::screen_update(screen_device &screen, bitmap_ind16 &bitma // draw the graphics m_k007121_tilemap[0]->draw(screen, bitmap, clip[0], 0, 0); - m_k007121->sprites_draw(bitmap, cliprect, &m_spriteram[sprite_buffer], 0, 40, 0, screen.priority(), (uint32_t)-1, true); + m_k007121->sprites_draw(bitmap, cliprect, &m_spriteram[sprite_buffer], 0, 40, 0, screen.priority(), (uint32_t)-1); m_k007121_tilemap[1]->draw(screen, bitmap, clip[1], 0, 0); return 0; } diff --git a/src/mame/konami/hcastle.cpp b/src/mame/konami/hcastle.cpp index f6c24132bcd..e6348bcd115 100644 --- a/src/mame/konami/hcastle.cpp +++ b/src/mame/konami/hcastle.cpp @@ -261,8 +261,8 @@ uint32_t hcastle_state::screen_update(screen_device &screen, bitmap_ind16 &bitma m_tilemap[0]->set_scrolly(0, ctrl_1_2); m_tilemap[0]->set_scrollx(0, ((ctrl_1_1 << 8) + ctrl_1_0)); -// Sprite priority -// if (ctrl_1_3 & 0x20) + // Sprite priority + //if (ctrl_1_3 & 0x20) if ((m_gfx_bank & 0x04) == 0) { m_tilemap[1]->draw(screen, bitmap, cliprect, 0, 0); diff --git a/src/mame/konami/k007121.cpp b/src/mame/konami/k007121.cpp index d635d33483c..0c4350b0fdc 100644 --- a/src/mame/konami/k007121.cpp +++ b/src/mame/konami/k007121.cpp @@ -1,6 +1,7 @@ // license:BSD-3-Clause // copyright-holders:Fabio Priuli, Acho A. Tang, R. Belmont /* + Konami 007121 ------ This is an interesting beast. It is an evolution of the 005885, with more @@ -110,6 +111,7 @@ control registers -----x-- firq enable ----x--- flip screen ---x---- unknown (contra, labyrunr) + */ #include "emu.h" @@ -172,7 +174,7 @@ void k007121_device::ctrl_w(offs_t offset, uint8_t data) switch (offset) { case 6: - /* palette bank change */ + // palette bank change if ((m_ctrlram[offset] & 0x30) != (data & 0x30)) machine().tilemap().mark_all_dirty(); break; @@ -208,15 +210,15 @@ void k007121_device::ctrl_w(offs_t offset, uint8_t data) * */ -void k007121_device::sprites_draw( bitmap_ind16 &bitmap, const rectangle &cliprect, - const uint8_t *source, int base_color, int global_x_offset, int bank_base, bitmap_ind8 &priority_bitmap, uint32_t pri_mask, bool is_flakatck ) +void k007121_device::sprites_draw(bitmap_ind16 &bitmap, const rectangle &cliprect, + const uint8_t *source, int base_color, int global_x_offset, int bank_base, bitmap_ind8 &priority_bitmap, uint32_t pri_mask) { // TODO: sprite limit is supposed to be per-line! (check MT #00185) int num = 0x40; - //num = (k007121->ctrlram[0x03] & 0x40) ? 0x80 : 0x40; /* WRONG!!! (needed by combatsc) */ + //num = (m_ctrlram[0x03] & 0x40) ? 0x80 : 0x40; // WRONG!!! (needed by combatsc) int inc = 5; - /* when using priority buffer, draw front to back */ + // when using priority buffer, draw front to back if (pri_mask != (uint32_t)-1) { source += (num - 1)*inc; @@ -225,13 +227,13 @@ void k007121_device::sprites_draw( bitmap_ind16 &bitmap, const rectangle &clipre for (int i = 0; i < num; i++) { - int number = source[0]; /* sprite number */ - int sprite_bank = source[1] & 0x0f; /* sprite bank */ - int sx = source[3]; /* vertical position */ - int sy = source[2]; /* horizontal position */ - int attr = source[4]; /* attributes */ - int xflip = source[4] & 0x10; /* flip x */ - int yflip = source[4] & 0x20; /* flip y */ + int number = source[0]; + int sprite_bank = source[1] & 0x0f; + int sx = source[3]; + int sy = source[2]; + int attr = source[4]; + int xflip = source[4] & 0x10; + int yflip = source[4] & 0x20; int color = base_color + ((source[1] & 0xf0) >> 4); int width, height; int transparent_mask; @@ -246,10 +248,8 @@ void k007121_device::sprites_draw( bitmap_ind16 &bitmap, const rectangle &clipre number = number << 2; number += (sprite_bank >> 2) & 3; - /* Flak Attack doesn't use a lookup PROM, it maps the color code directly */ - /* to a palette entry */ - // TODO: check if it's true or callback-ize this one and remove the per-game hack. - if (is_flakatck) + // Flak Attack doesn't use a lookup PROM, it maps the color code directly to a palette entry + if (palette().indirect_entries() == 0) transparent_mask = 1 << 0; else transparent_mask = palette().transpen_mask(*gfx(0), color, 0); @@ -258,12 +258,32 @@ void k007121_device::sprites_draw( bitmap_ind16 &bitmap, const rectangle &clipre switch (attr & 0xe) { - case 0x06: width = height = 1; break; - case 0x04: width = 1; height = 2; number &= (~2); break; - case 0x02: width = 2; height = 1; number &= (~1); break; - case 0x00: width = height = 2; number &= (~3); break; - case 0x08: width = height = 4; number &= (~3); break; - default: width = 1; height = 1; + case 0x06: + width = height = 1; + break; + + case 0x04: + width = 1; height = 2; + number &= ~2; + break; + + case 0x02: + width = 2; height = 1; + number &= ~1; + break; + + case 0x00: + width = height = 2; + number &= ~3; + break; + + case 0x08: + width = height = 4; + number &= ~0xf; + break; + + default: + width = 1; height = 1; //logerror("Unknown sprite size %02x\n", attr & 0xe); break; } diff --git a/src/mame/konami/k007121.h b/src/mame/konami/k007121.h index 505175ba011..d6d4e43476a 100644 --- a/src/mame/konami/k007121.h +++ b/src/mame/konami/k007121.h @@ -22,9 +22,9 @@ class k007121_device : public device_t, public device_gfx_interface uint8_t ctrlram_r(offs_t offset); void ctrl_w(offs_t offset, uint8_t data); - /* shall we move source in the interface? */ - /* also notice that now we directly pass *gfx[chip] instead of **gfx !! */ - void sprites_draw( bitmap_ind16 &bitmap, const rectangle &cliprect, const uint8_t *source, int base_color, int global_x_offset, int bank_base, bitmap_ind8 &priority_bitmap, uint32_t pri_mask, bool is_flakatck = false ); + // shall we move source in the interface? + // also notice that now we directly pass *gfx[chip] instead of **gfx !! + void sprites_draw(bitmap_ind16 &bitmap, const rectangle &cliprect, const uint8_t *source, int base_color, int global_x_offset, int bank_base, bitmap_ind8 &priority_bitmap, uint32_t pri_mask); protected: // device-level overrides diff --git a/src/mame/konami/k007342.cpp b/src/mame/konami/k007342.cpp index 460e7e6bca9..a70a727dd5a 100644 --- a/src/mame/konami/k007342.cpp +++ b/src/mame/konami/k007342.cpp @@ -1,6 +1,7 @@ // license:BSD-3-Clause // copyright-holders:Fabio Priuli,Acho A. Tang, R. Belmont /* + Konami 007342 ------ The 007342 manages 2 64x32 scrolling tilemaps with 8x8 characters, and @@ -8,6 +9,9 @@ optionally generates timing clocks and interrupt signals. It uses 0x2000 bytes of RAM, plus 0x0200 bytes for scrolling, and a variable amount of ROM. It cannot read the ROMs. +Some of the control flags are specifically meant for other Konami chips, +such as the sprite wraparound flag for 007420. + control registers 000: ------x- INT control ---x---- flip screen (TODO: doesn't work with thehustl) @@ -26,6 +30,11 @@ control registers 005: x scroll 2 006: y scroll 2 007: not used + +TODO: +- device should be combined with 007420? see comment from AWJ here: + https://mametesters.org/view.php?id=4902 + */ #include "emu.h" @@ -48,10 +57,9 @@ k007342_device::k007342_device(const machine_config &mconfig, const char *tag, d m_tilemap{ nullptr, nullptr }, m_flipscreen(false), m_int_enabled(false), - //m_regs[8], - //m_scrollx[2], - //m_scrolly[2], - m_callback(*this) + m_callback(*this), + m_flipscreen_cb(*this), + m_sprite_wrap_y_cb(*this) { } @@ -95,6 +103,10 @@ void k007342_device::device_reset() { m_int_enabled = false; m_flipscreen = false; + + m_flipscreen_cb(0); + m_sprite_wrap_y_cb(0); + m_scrollx[0] = 0; m_scrollx[1] = 0; m_scrolly[0] = 0; @@ -117,9 +129,9 @@ void k007342_device::write(offs_t offset, uint8_t data) { m_ram[offset] = data; - if (offset < 0x1000) /* layer 0 */ + if (offset < 0x1000) m_tilemap[0]->mark_tile_dirty(offset & 0x7ff); - else /* layer 1 */ + else m_tilemap[1]->mark_tile_dirty(offset & 0x7ff); } @@ -138,33 +150,37 @@ void k007342_device::vreg_w(offs_t offset, uint8_t data) switch (offset) { case 0x00: - /* bit 1: INT control */ + // bit 1: INT control m_int_enabled = BIT(data, 1); + + // bit 4: flip screen m_flipscreen = BIT(data, 4); + m_flipscreen_cb(BIT(data, 4)); m_tilemap[0]->set_flip(m_flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); m_tilemap[1]->set_flip(m_flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); break; - case 0x01: /* used for banking in Rock'n'Rage */ + case 0x01: // used for banking in Rock'n'Rage if (data != m_regs[1]) machine().tilemap().mark_all_dirty(); - [[fallthrough]]; + break; case 0x02: m_scrollx[0] = (m_scrollx[0] & 0xff) | ((data & 0x01) << 8); m_scrollx[1] = (m_scrollx[1] & 0xff) | ((data & 0x02) << 7); + m_sprite_wrap_y_cb(BIT(data, 7)); break; - case 0x03: /* scroll x (register 0) */ + case 0x03: // scroll x (register 0) m_scrollx[0] = (m_scrollx[0] & 0x100) | data; break; - case 0x04: /* scroll y (register 0) */ + case 0x04: // scroll y (register 0) m_scrolly[0] = data; break; - case 0x05: /* scroll x (register 1) */ + case 0x05: // scroll x (register 1) m_scrollx[1] = (m_scrollx[1] & 0x100) | data; break; - case 0x06: /* scroll y (register 1) */ + case 0x06: // scroll y (register 1) m_scrolly[1] = data; break; - case 0x07: /* unused */ + case 0x07: // unused break; } m_regs[offset] = data; @@ -172,18 +188,18 @@ void k007342_device::vreg_w(offs_t offset, uint8_t data) void k007342_device::tilemap_update() { - /* update scroll */ + // update scroll switch (m_regs[2] & 0x1c) { case 0x00: - case 0x08: /* unknown, blades of steel shootout between periods */ + case 0x08: // unknown, blades of steel shootout between periods m_tilemap[0]->set_scroll_rows(1); m_tilemap[0]->set_scroll_cols(1); m_tilemap[0]->set_scrollx(0, m_scrollx[0]); m_tilemap[0]->set_scrolly(0, m_scrolly[0]); break; - case 0x0c: /* 32 columns */ + case 0x0c: // 32 columns m_tilemap[0]->set_scroll_rows(1); m_tilemap[0]->set_scroll_cols(512); m_tilemap[0]->set_scrollx(0, m_scrollx[0]); @@ -192,7 +208,7 @@ void k007342_device::tilemap_update() m_scroll_ram[2 * (offs / 8)] + 256 * m_scroll_ram[2 * (offs / 8) + 1]); break; - case 0x14: /* 256 rows */ + case 0x14: // 256 rows m_tilemap[0]->set_scroll_rows(256); m_tilemap[0]->set_scroll_cols(1); m_tilemap[0]->set_scrolly(0, m_scrolly[0]); @@ -202,7 +218,7 @@ void k007342_device::tilemap_update() break; default: -// popmessage("unknown scroll ctrl %02x", m_regs[2] & 0x1c); + //popmessage("unknown scroll ctrl %02x", m_regs[2] & 0x1c); break; } @@ -230,11 +246,6 @@ void k007342_device::tilemap_draw(screen_device &screen, bitmap_ind16 &bitmap, c m_tilemap[num]->draw(screen, bitmap, cliprect, flags, priority); } -int k007342_device::is_int_enabled() -{ - return m_int_enabled; -} - /*************************************************************************** @@ -254,7 +265,7 @@ int k007342_device::is_int_enabled() TILEMAP_MAPPER_MEMBER(k007342_device::scan) { - /* logical (col,row) -> memory offset */ + // logical (col,row) -> memory offset return (col & 0x1f) + ((row & 0x1f) << 5) + ((col & 0x20) << 5); } @@ -269,11 +280,7 @@ void k007342_device::get_tile_info( tile_data &tileinfo, int tile_index, uint8_t if (!m_callback.isnull()) m_callback(layer, m_regs[1], code, color, flags); - - tileinfo.set(0, - code, - color, - flags); + tileinfo.set(0, code, color, flags); } TILE_GET_INFO_MEMBER(k007342_device::get_tile_info0) diff --git a/src/mame/konami/k007342.h b/src/mame/konami/k007342.h index 2f659ddf4ef..d88d9c7f7fd 100644 --- a/src/mame/konami/k007342.h +++ b/src/mame/konami/k007342.h @@ -23,6 +23,8 @@ class k007342_device : public device_t, public device_gfx_interface // configuration template void set_tile_callback(T &&... args) { m_callback.set(std::forward(args)...); } + auto flipscreen_cb() { return m_flipscreen_cb.bind(); } + auto sprite_wrap_y_cb() { return m_sprite_wrap_y_cb.bind(); } uint8_t read(offs_t offset); void write(offs_t offset, uint8_t data); @@ -32,7 +34,7 @@ class k007342_device : public device_t, public device_gfx_interface void tilemap_update(); void tilemap_draw(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int num, int flags, uint32_t priority); - int is_int_enabled(); + int is_int_enabled() { return m_int_enabled; } protected: // device_t implementation @@ -51,7 +53,10 @@ class k007342_device : public device_t, public device_gfx_interface uint8_t m_regs[8]; uint16_t m_scrollx[2]; uint8_t m_scrolly[2]; + tile_delegate m_callback; + devcb_write_line m_flipscreen_cb; + devcb_write_line m_sprite_wrap_y_cb; TILEMAP_MAPPER_MEMBER(scan); TILE_GET_INFO_MEMBER(get_tile_info0); diff --git a/src/mame/konami/k007420.cpp b/src/mame/konami/k007420.cpp index c9c65a55ee0..d68af547143 100644 --- a/src/mame/konami/k007420.cpp +++ b/src/mame/konami/k007420.cpp @@ -1,6 +1,7 @@ // license:BSD-3-Clause // copyright-holders:Fabio Priuli,Acho A. Tang, R. Belmont /* + Konami 007420 ------ Sprite generator. 8 bytes per sprite with zoom. It uses 0x200 bytes of RAM, @@ -8,6 +9,7 @@ and a variable amount of ROM. Nothing is known about its external interface. TODO: - sprite X wraparound? (Rock N Rage sprites disappears on left edge of screen) + */ #include "emu.h" @@ -26,9 +28,9 @@ k007420_device::k007420_device(const machine_config &mconfig, const char *tag, d , device_gfx_interface(mconfig, *this) , m_ram(nullptr) , m_flipscreen(false) + , m_wrap_y(false) , m_banklimit(0) , m_callback(*this) - //, m_regs[8] { } @@ -41,11 +43,11 @@ void k007420_device::device_start() // bind the init function m_callback.resolve(); - m_ram = make_unique_clear(0x200); + m_ram = make_unique_clear(K007420_SPRITERAM_SIZE); - save_pointer(NAME(m_ram), 0x200); - save_item(NAME(m_flipscreen)); // current one uses 7342 one - save_item(NAME(m_regs)); // current one uses 7342 ones + save_pointer(NAME(m_ram), K007420_SPRITERAM_SIZE); + save_item(NAME(m_flipscreen)); + save_item(NAME(m_wrap_y)); } //------------------------------------------------- @@ -54,9 +56,6 @@ void k007420_device::device_start() void k007420_device::device_reset() { - m_flipscreen = false; - for (int i = 0; i < 8; i++) - m_regs[i] = 0; } /***************************************************************************** @@ -115,50 +114,71 @@ void k007420_device::sprites_draw(bitmap_ind16 &bitmap, const rectangle &cliprec const uint32_t bank = code & bankmask; code &= codemask; - /* 0x080 = normal scale, 0x040 = double size, 0x100 half size */ + // 0x080 = normal scale, 0x040 = double size, 0x100 half size uint32_t zoom = m_ram[offs + 5] | ((m_ram[offs + 4] & 0x03) << 8); if (!zoom) continue; zoom = 0x10000 * 128 / zoom; - uint8_t w, h; + uint8_t width, height; switch (m_ram[offs + 4] & 0x70) { - case 0x30: w = h = 1; break; - case 0x20: w = 2; h = 1; code &= (~1); break; - case 0x10: w = 1; h = 2; code &= (~2); break; - case 0x00: w = h = 2; code &= (~3); break; - case 0x40: w = h = 4; code &= (~3); break; - default: w = 1; h = 1; -//logerror("Unknown sprite size %02x\n",(m_ram[offs + 4] & 0x70) >> 4); + case 0x30: + width = height = 1; + break; + + case 0x20: + width = 2; height = 1; + code &= ~1; + break; + + case 0x10: + width = 1; height = 2; + code &= ~2; + break; + + case 0x00: + width = height = 2; + code &= ~3; + break; + + case 0x40: + width = height = 4; + code &= ~0xf; + break; + + default: + width = 1; height = 1; + //logerror("Unknown sprite size %02x\n",(m_ram[offs + 4] & 0x70) >> 4); + break; } if (m_flipscreen) { - ox = 256 - ox - ((zoom * w + (1 << 12)) >> 13); - oy = 256 - oy - ((zoom * h + (1 << 12)) >> 13); + ox = 256 - ox - ((zoom * width + (1 << 12)) >> 13); + oy = 256 - oy - ((zoom * height + (1 << 12)) >> 13); flipx = !flipx; flipy = !flipy; } if (zoom == 0x10000) { - for (int y = 0; y < h; y++) + for (int y = 0; y < height; y++) { const int sy = oy + 8 * y; - for (int x = 0; x < w; x++) + for (int x = 0; x < width; x++) { uint32_t c = code; const int sx = ox + 8 * x; if (flipx) - c += xoffset[(w - 1 - x)]; + c += xoffset[(width - 1 - x)]; else c += xoffset[x]; if (flipy) - c += yoffset[(h - 1 - y)]; + c += yoffset[(height - 1 - y)]; else c += yoffset[y]; @@ -168,40 +188,43 @@ void k007420_device::sprites_draw(bitmap_ind16 &bitmap, const rectangle &cliprec c += bank; gfx(0)->transpen(bitmap,cliprect, - c, - color, - flipx,flipy, - sx,sy,0); - - if (m_regs[2] & 0x80) - gfx(0)->transpen(bitmap,cliprect, c, color, flipx,flipy, - sx,sy-256,0); + sx,sy,0); + + if (m_wrap_y) + { + const int dy = m_flipscreen ? +256 : -256; + gfx(0)->transpen(bitmap,cliprect, + c, + color, + flipx,flipy, + sx,sy+dy,0); + } } } } else { - for (int y = 0; y < h; y++) + for (int y = 0; y < height; y++) { const int sy = oy + ((zoom * y + (1 << 12)) >> 13); const int zh = (oy + ((zoom * (y + 1) + (1 << 12)) >> 13)) - sy; - for (int x = 0; x < w; x++) + for (int x = 0; x < width; x++) { uint32_t c = code; - const int sx = ox + ((zoom * x + (1<<12)) >> 13); + const int sx = ox + ((zoom * x + (1 << 12)) >> 13); const int zw = (ox + ((zoom * (x + 1) + (1 << 12)) >> 13)) - sx; if (flipx) - c += xoffset[(w - 1 - x)]; + c += xoffset[(width - 1 - x)]; else c += xoffset[x]; if (flipy) - c += yoffset[(h - 1 - y)]; + c += yoffset[(height - 1 - y)]; else c += yoffset[y]; @@ -211,19 +234,22 @@ void k007420_device::sprites_draw(bitmap_ind16 &bitmap, const rectangle &cliprec c += bank; gfx(0)->zoom_transpen(bitmap,cliprect, - c, - color, - flipx,flipy, - sx,sy, - (zw << 16) / 8,(zh << 16) / 8,0); - - if (m_regs[2] & 0x80) - gfx(0)->zoom_transpen(bitmap,cliprect, c, color, flipx,flipy, - sx,sy-256, + sx,sy, (zw << 16) / 8,(zh << 16) / 8,0); + + if (m_wrap_y) + { + const int dy = m_flipscreen ? +256 : -256; + gfx(0)->zoom_transpen(bitmap,cliprect, + c, + color, + flipx,flipy, + sx,sy+dy, + (zw << 16) / 8,(zh << 16) / 8,0); + } } } } diff --git a/src/mame/konami/k007420.h b/src/mame/konami/k007420.h index 1cbf19ec9f7..76377c74f18 100644 --- a/src/mame/konami/k007420.h +++ b/src/mame/konami/k007420.h @@ -28,6 +28,10 @@ class k007420_device : public device_t, public device_gfx_interface void write(offs_t offset, uint8_t data); void sprites_draw(bitmap_ind16 &bitmap, const rectangle &cliprect); + // signals from paired chip (commonly K007342) + void set_flipscreen(int flip) { m_flipscreen = bool(flip); } + void set_wrap_y(int wrap) { m_wrap_y = bool(wrap); } + protected: // device_t implementation virtual void device_start() override ATTR_COLD; @@ -37,8 +41,8 @@ class k007420_device : public device_t, public device_gfx_interface // internal state std::unique_ptr m_ram; - bool m_flipscreen; // current code uses the 7342 flipscreen!! - uint8_t m_regs[8]; // current code uses the 7342 regs!! (only [2]) + bool m_flipscreen; + bool m_wrap_y; uint32_t m_banklimit; sprite_delegate m_callback; }; diff --git a/src/mame/konami/konmedal68k.cpp b/src/mame/konami/konmedal68k.cpp index 9d408529029..a52f8601105 100644 --- a/src/mame/konami/konmedal68k.cpp +++ b/src/mame/konami/konmedal68k.cpp @@ -811,7 +811,7 @@ ROM_START(spcpokan) ROM_LOAD("642-a06-14n.bin", 0x000000, 0x080000, CRC(ebcc67cf) SHA1(b2efd41438fa562e8545695b09d124c730a9c8d3)) ROM_LOAD("642-a07-17n.bin", 0x080000, 0x080000, CRC(80da3c5e) SHA1(843db853958ed994185e9d3a156014466e080863)) ROM_LOAD("642-a08-19n.bin", 0x100000, 0x080000, CRC(cfaeba54) SHA1(83a8a7b6a4cfa26d2c804a26d7ab17ed376625f4)) - ROM_LOAD("642-a09-22n.bin", 0x180000, 0x080000, BAD_DUMP CRC(8b01e2cb) SHA1(8a15c2462f0a35136386eeba0d926349fb9f5cf9)) // byte sum should be f9c7, is f9c8 so POST fails + ROM_LOAD("642-a09-22n.bin", 0x180000, 0x080000, CRC(8b01e2cb) SHA1(8a15c2462f0a35136386eeba0d926349fb9f5cf9)) ROM_REGION(0x200000, "ymz", 0) ROM_LOAD("642-a01-2f.bin", 0x000000, 0x080000, CRC(2096c185) SHA1(948ec4bc3896fae5d1f7c478ee7fafd25ef30b74)) diff --git a/src/mame/konami/labyrunr.cpp b/src/mame/konami/labyrunr.cpp index e86286f26e8..a7ade814206 100644 --- a/src/mame/konami/labyrunr.cpp +++ b/src/mame/konami/labyrunr.cpp @@ -137,7 +137,7 @@ TILE_GET_INFO_MEMBER(labyrunr_state::get_tile_info) code + bank * 256, ((ctrl_6 & 0x30) * 2 + 16) + (attr & 7), 0); - tileinfo.category = Which ? (attr & 0x40) >> 6 : 0; + tileinfo.category = Which ? 0 : (attr & 0x40) >> 6; } @@ -217,7 +217,7 @@ uint32_t labyrunr_state::screen_update(screen_device &screen, bitmap_ind16 &bitm } m_layer[0]->draw(screen, bitmap, finalclip0, TILEMAP_DRAW_OPAQUE | TILEMAP_DRAW_CATEGORY(0), 0); - m_k007121->sprites_draw(bitmap, cliprect, m_spriteram, (m_k007121->ctrlram_r(6) & 0x30) * 2, 40, 0, screen.priority(), (m_k007121->ctrlram_r(3) & 0x40) >> 5); + m_k007121->sprites_draw(bitmap, cliprect, m_spriteram, (m_k007121->ctrlram_r(6) & 0x30) * 2, 40, 0, screen.priority(), (m_k007121->ctrlram_r(3) & 0x20) >> 4); m_layer[0]->draw(screen, bitmap, finalclip0, TILEMAP_DRAW_OPAQUE | TILEMAP_DRAW_CATEGORY(1), 0); // we ignore the transparency because layer1 is drawn only at the top of the screen also covering sprites m_layer[1]->draw(screen, bitmap, finalclip1, TILEMAP_DRAW_OPAQUE, 0); @@ -248,7 +248,6 @@ uint32_t labyrunr_state::screen_update(screen_device &screen, bitmap_ind16 &bitm } finalclip1.max_x = cliprect.max_x - ctrl_0 + 8; - } else { @@ -284,7 +283,7 @@ uint32_t labyrunr_state::screen_update(screen_device &screen, bitmap_ind16 &bitm if (use_clip3[0]) m_layer[0]->draw(screen, bitmap, finalclip3, TILEMAP_DRAW_CATEGORY(0), 0); - m_k007121->sprites_draw(bitmap, cliprect, m_spriteram, (m_k007121->ctrlram_r(6) & 0x30) * 2,40,0,screen.priority(),(m_k007121->ctrlram_r(3) & 0x40) >> 5); + m_k007121->sprites_draw(bitmap, cliprect, m_spriteram, (m_k007121->ctrlram_r(6) & 0x30) * 2, 40, 0, screen.priority(), (m_k007121->ctrlram_r(3) & 0x20) >> 4); m_layer[0]->draw(screen, bitmap, finalclip0, TILEMAP_DRAW_CATEGORY(1), 0); if (use_clip3[0]) @@ -293,8 +292,8 @@ uint32_t labyrunr_state::screen_update(screen_device &screen, bitmap_ind16 &bitm m_layer[1]->draw(screen, bitmap, finalclip1, 0, 0); if (use_clip3[1]) m_layer[1]->draw(screen, bitmap, finalclip3, 0, 0); - } + return 0; } @@ -317,7 +316,7 @@ void labyrunr_state::bankswitch_w(uint8_t data) if (data & 0xe0) logerror("bankswitch %02x", data); // bits 0-2 = bank number - m_mainbank->set_entry(data & 0x07); // shall we check if data & 7 > #banks? + m_mainbank->set_entry(data & 0x07); // shall we check if data & 7 > #banks? // bits 3 and 4 are coin counters machine().bookkeeping().coin_counter_w(0, data & 0x08); @@ -418,6 +417,7 @@ static GFXDECODE_START( gfx_labyrunr ) GFXDECODE_ENTRY( "gfx", 0, gfx_8x8x4_packed_msb, 0, 8*16 ) GFXDECODE_END + /*************************************************************************** Machine Driver @@ -490,14 +490,14 @@ ROM_START( tricktrp ) ROM_LOAD( "771e03", 0x18000, 0x10000, CRC(d0d68036) SHA1(8589ee07e229259341a4cc22bc64de8f06536472) ) ROM_REGION( 0x40000, "gfx", 0 ) - ROM_LOAD16_BYTE( "771e01a", 0x00001, 0x10000, CRC(103ffa0d) SHA1(1949c49ca3b243e4cfb5fb19ecd3a1e1492cfddd) ) // tiles + sprites + ROM_LOAD16_BYTE( "771e01a", 0x00001, 0x10000, CRC(103ffa0d) SHA1(1949c49ca3b243e4cfb5fb19ecd3a1e1492cfddd) ) // tiles + sprites ROM_LOAD16_BYTE( "771e01c", 0x00000, 0x10000, CRC(cfec5be9) SHA1(2b6a32e2608a70c47d1ec9b4de38b5c3a0898cde) ) ROM_LOAD16_BYTE( "771d01b", 0x20001, 0x10000, CRC(07f2a71c) SHA1(63c79e75e71539e69d4d9d35e629a6021124f6d0) ) ROM_LOAD16_BYTE( "771d01d", 0x20000, 0x10000, CRC(f6810a49) SHA1(b40e9f0d0919188a05c1990347da8dc8ff12d65a) ) ROM_REGION( 0x0100, "proms", 0 ) - ROM_LOAD( "771d02.08d", 0x0000, 0x0100, CRC(3d34bb5a) SHA1(3f3c845f1197457244e7c7e4f9b2a03c278613e4) ) // sprite lookup table - // there is no char lookup table + ROM_LOAD( "771d02.08d", 0x0000, 0x0100, CRC(3d34bb5a) SHA1(3f3c845f1197457244e7c7e4f9b2a03c278613e4) ) // sprite lookup table + // there is no char lookup table ROM_END ROM_START( labyrunr ) @@ -507,11 +507,11 @@ ROM_START( labyrunr ) ROM_LOAD( "771j03.08f", 0x18000, 0x10000, CRC(12b49044) SHA1(e9b22fb093cfb746a9767e94ef5deef98bed5b7a) ) ROM_REGION( 0x40000, "gfx", 0 ) - ROM_LOAD16_WORD_SWAP( "771d01.14a", 0x00000, 0x40000, CRC(15c8f5f9) SHA1(e4235e1315d0331f3ce5047834a68764ed43aa4b) ) // tiles + sprites + ROM_LOAD16_WORD_SWAP( "771d01.14a", 0x00000, 0x40000, CRC(15c8f5f9) SHA1(e4235e1315d0331f3ce5047834a68764ed43aa4b) ) // tiles + sprites ROM_REGION( 0x0100, "proms", 0 ) - ROM_LOAD( "771d02.08d", 0x0000, 0x0100, CRC(3d34bb5a) SHA1(3f3c845f1197457244e7c7e4f9b2a03c278613e4) ) // sprite lookup table - // there is no char lookup table + ROM_LOAD( "771d02.08d", 0x0000, 0x0100, CRC(3d34bb5a) SHA1(3f3c845f1197457244e7c7e4f9b2a03c278613e4) ) // sprite lookup table + // there is no char lookup table ROM_END ROM_START( labyrunrk ) @@ -521,14 +521,14 @@ ROM_START( labyrunrk ) ROM_LOAD( "771k03.8f", 0x18000, 0x10000, CRC(48d732ae) SHA1(8bc7917397f32cf5f995b3763ae921725e27de05) ) ROM_REGION( 0x40000, "gfx", 0 ) - ROM_LOAD16_BYTE( "771d01a.13a", 0x00001, 0x10000, CRC(0cd1ed1a) SHA1(eac6c106de28acc54535ae1fb99f778c1ed4013e) ) // tiles + sprites + ROM_LOAD16_BYTE( "771d01a.13a", 0x00001, 0x10000, CRC(0cd1ed1a) SHA1(eac6c106de28acc54535ae1fb99f778c1ed4013e) ) // tiles + sprites ROM_LOAD16_BYTE( "771d01c.13a", 0x00000, 0x10000, CRC(d75521fe) SHA1(72f0c4d9511bc70d77415f50be93293026305bd5) ) ROM_LOAD16_BYTE( "771d01b", 0x20001, 0x10000, CRC(07f2a71c) SHA1(63c79e75e71539e69d4d9d35e629a6021124f6d0) ) ROM_LOAD16_BYTE( "771d01d", 0x20000, 0x10000, CRC(f6810a49) SHA1(b40e9f0d0919188a05c1990347da8dc8ff12d65a) ) ROM_REGION( 0x0100, "proms", 0 ) - ROM_LOAD( "771d02.08d", 0x0000, 0x0100, CRC(3d34bb5a) SHA1(3f3c845f1197457244e7c7e4f9b2a03c278613e4) ) // sprite lookup table - // there is no char lookup table + ROM_LOAD( "771d02.08d", 0x0000, 0x0100, CRC(3d34bb5a) SHA1(3f3c845f1197457244e7c7e4f9b2a03c278613e4) ) // sprite lookup table + // there is no char lookup table ROM_END ROM_START( labyrunrf ) @@ -538,14 +538,14 @@ ROM_START( labyrunrf ) ROM_LOAD( "771k03.8f", 0x18000, 0x10000, CRC(6c073295) SHA1(67be17ad0c3bfd5ff8cd6ed31b217e438733ed1c) ) ROM_REGION( 0x40000, "gfx", 0 ) - ROM_LOAD16_BYTE( "771d01a.13a", 0x00001, 0x10000, CRC(0cd1ed1a) SHA1(eac6c106de28acc54535ae1fb99f778c1ed4013e) ) // tiles + sprites + ROM_LOAD16_BYTE( "771d01a.13a", 0x00001, 0x10000, CRC(0cd1ed1a) SHA1(eac6c106de28acc54535ae1fb99f778c1ed4013e) ) // tiles + sprites ROM_LOAD16_BYTE( "771d01c.13a", 0x00000, 0x10000, CRC(d75521fe) SHA1(72f0c4d9511bc70d77415f50be93293026305bd5) ) ROM_LOAD16_BYTE( "771d01b", 0x20001, 0x10000, CRC(07f2a71c) SHA1(63c79e75e71539e69d4d9d35e629a6021124f6d0) ) ROM_LOAD16_BYTE( "771d01d", 0x20000, 0x10000, CRC(f6810a49) SHA1(b40e9f0d0919188a05c1990347da8dc8ff12d65a) ) ROM_REGION( 0x0100, "proms", 0 ) - ROM_LOAD( "771d02.08d", 0x0000, 0x0100, CRC(3d34bb5a) SHA1(3f3c845f1197457244e7c7e4f9b2a03c278613e4) ) // sprite lookup table - // there is no char lookup table + ROM_LOAD( "771d02.08d", 0x0000, 0x0100, CRC(3d34bb5a) SHA1(3f3c845f1197457244e7c7e4f9b2a03c278613e4) ) // sprite lookup table + // there is no char lookup table ROM_END } // anonymous namespace diff --git a/src/mame/konami/rockrage.cpp b/src/mame/konami/rockrage.cpp index 0e6dd73c17d..19d273666c4 100644 --- a/src/mame/konami/rockrage.cpp +++ b/src/mame/konami/rockrage.cpp @@ -388,6 +388,8 @@ void rockrage_state::rockrage(machine_config &config) K007342(config, m_k007342, 0, m_palette, gfx_rockrage_tiles); m_k007342->set_tile_callback(FUNC(rockrage_state::tile_callback)); + m_k007342->flipscreen_cb().set(m_k007420, FUNC(k007420_device::set_flipscreen)); + m_k007342->sprite_wrap_y_cb().set(m_k007420, FUNC(k007420_device::set_wrap_y)); K007420(config, m_k007420, 0, m_palette, gfx_rockrage_spr); m_k007420->set_bank_limit(0x3ff); @@ -403,7 +405,7 @@ void rockrage_state::rockrage(machine_config &config) GENERIC_LATCH_8(config, "soundlatch").data_pending_callback().set_inputline(m_audiocpu, M6809_IRQ_LINE); - YM2151(config, "ymsnd", 3'579'545).add_route(0, "lspeaker", 0.60).add_route(1, "rspeaker", 0.60); + YM2151(config, "ymsnd", 3'579'545).add_route(0, "lspeaker", 0.30).add_route(1, "rspeaker", 0.30); VLM5030(config, m_vlm, 3'579'545); m_vlm->set_addrmap(0, &rockrage_state::vlm_map); diff --git a/src/mame/leapfrog/leappad.cpp b/src/mame/leapfrog/leappad.cpp index a715c63715f..de34fb49c18 100644 --- a/src/mame/leapfrog/leappad.cpp +++ b/src/mame/leapfrog/leappad.cpp @@ -4,11 +4,12 @@ LEAPPAD: Example-Video: https://www.youtube.com/watch?v=LtUhENu5TKc - The LEAPPAD is basically compareable to the SEGA PICO, but without + The LEAPPAD is basically comparable to the SEGA PICO, but without Screen-Output! Each "Game" consists of two parts (Book + Cartridge). Insert the cartridge into the system and add the Book on the Top of the "console" and you can click on each pages and hear sounds or learning-stuff on each page... + Note: The Cocopad shares the same BIOS as the Leappad (CRC32 c886cddc) MY FIRST LEAPPAD: Basically the same as the LEAPPAD, but for even younger kids! (Cartridge @@ -22,7 +23,7 @@ also released some kind of Tablet with this name, and they even released a new "LEAPPAD" in around 2016: https://www.youtube.com/watch?v=MXFSgj6xLTU , which nearly looks like the - same, but is most likely techically completely different... + same, but is most likely technically completely different... The cartridges pinout is the same on the three systems: A1 N/C (A21?) @@ -66,14 +67,36 @@ B19 D4 B20 GND + Cocopad BIOS pinout: + +-----------+ + A23-| |- GND + A21-| |- A22 + A18-| |- A20 + A17-| |- A19 + A07-| |- A08 + A06-| |- A09 + A05-| |- A10 + A04-| |- A11 + A03-| |- A12 + A02-| |- A13 + A01-| |- A14 + A00-| |- A15 + CE-| |- A16 + GND-| |- CE + OE-| |- A-1 + D00-| |- D07 + D01-| |- D06 + D02-| |- D05 + D03-| |- D04 + VCC-| |- GND + +-----------+ *******************************************************************************/ #include "emu.h" -#include "cpu/mcs51/mcs51.h" - #include "bus/generic/slot.h" #include "bus/generic/carts.h" +#include "cpu/mcs51/mcs51.h" #include "screen.h" #include "softlist_dev.h" @@ -96,10 +119,11 @@ class leapfrog_leappad_state : public driver_device void leapfrog_mfleappad(machine_config &config); void leapfrog_ltleappad(machine_config &config); -private: +protected: virtual void machine_start() override ATTR_COLD; virtual void machine_reset() override ATTR_COLD; +private: void prog_map(address_map &map) ATTR_COLD; void ext_map(address_map &map) ATTR_COLD; diff --git a/src/mame/mame.lst b/src/mame/mame.lst index b991f710c24..72b021f7f6e 100644 --- a/src/mame/mame.lst +++ b/src/mame/mame.lst @@ -788,13 +788,19 @@ apple1 // Jul 1976 Apple 1 @source:apple/apple2.cpp ace100 // ??? 1982 Franklin Ace 100 ace1000 // 1982 Franklin ACE 1000 +albert // Albert +am100 // ASEM AM100 am64 // 1985 ASEM AM 64 (motherboard is marked AM-100 but it boots as "AM 64") apple2 // Apr 1977 Apple ][ apple2jp // ??? ???? Apple ][j+ apple2p // Jun 1979 Apple ][+ basis108 // 1982 Germany Basis 108 +craft2p // 1982 Craft? +dodo // GTAC Do-Do elppa // 198? Victor do Brasil Elppa II+ +hkc8800a // 1984 HKC 8800A ivelultr // Ivasim Ivel Ultra +laser2c // 1985? Laser //c (Brazil) maxxi // 1982 Polymax Maxxi microeng // 1982 Micro Engenho (Brazilian Apple2 clone) - Spectrum/SCOPUS prav82 // Pravetz 82 @@ -803,51 +809,56 @@ space84 // 1985 IBS/ComputerTechnik Space 84 uniap2en // 1982 Unitron AP II (in English) uniap2pt // 1982 Unitron AP II (in Brazilian Portuguese) uniap2ti // 1982 Unitron AP II+ (Teclado Inteligente) -craft2p // 1982 Craft? -laser2c // 1985? Laser //c (Brazil) -hkc8800a // 1984 HKC 8800A -albert // Albert -am100 // ASEM AM100 -dodo // GTAC Do-Do @source:apple/apple2e.cpp +ace2200 // 1985 Franklin Ace 2200 +ace500 // 1986 Franklin Ace 500 apple2c // Apr 1984 Apple //c apple2c0 // ??? 1985 Apple //c (3.5 ROM) +apple2c0uk // ??? 1985 Apple //c (3.5 ROM) (UK) +apple2c0fr // ??? 1985 Apple //c (3.5 ROM) (France) apple2c3 // Sep 1986 Apple //c (Original Mem. Exp.) +apple2c3uk // Sep 1986 Apple //c (Original Mem. Exp.) (UK) +apple2c3fr // Sep 1986 Apple //c (Original Mem. Exp.) (France) apple2c4 // ??? 198? Apple //c (rev 4) +apple2c4uk // ??? 198? Apple //c (rev 4) (UK) +apple2c4fr // ??? 198? Apple //c (rev 4) (France) +apple2cfr // Apr 1984 Apple //c (France) apple2cp // Sep 1988 Apple //c+ +apple2cuk // Apr 1984 Apple //c (UK) apple2e // Jan 1983 Apple //e apple2ee // Mar 1985 Apple //e Enhanced -apple2eeuk // Mar 1985 Apple //e Enhanced (UK) apple2eefr // Mar 1985 Apple //e Enhanced (France) apple2ees // Mar 1985 Apple //e Enhanced (Spain) +apple2eeuk // Mar 1985 Apple //e Enhanced (UK) +apple2efr // Jan 1983 Apple //e (France) apple2ep // Jan 1987 Apple //e Platinum +apple2epfr // Jan 1987 Apple //e Platinum (France) +apple2epuk // Jan 1987 Apple //e Platinum (UK) apple2euk // Jan 1983 Apple //e (UK) +cec2000 // China Education Computer-2000 +cece // China Education Computer-E +cecg // China Education Computer-G +ceci // China Education Computer-I +cecm // China Education Computer-M las128e2 // ??? Laser 128 EX2 las128ex // ??? 1988 Laser 128 EX laser128 // ??? 1987 Laser 128 laser128o // mprof3 // Microprofessor III prav8c // Pravetz 8C -tk3000 // Microdigital TK3000 spectred -ceci // China Education Computer-I -cece // China Education Computer-E -cecg // China Education Computer-G -cecm // China Education Computer-M -cec2000 // China Education Computer-2000 +tk3000 // Microdigital TK3000 zijini // 1989 Zi Jin I -ace2200 // 1985 Franklin Ace 2200 -ace500 // 1986 Franklin Ace 500 @source:apple/apple2gs.cpp apple2gs // Aug 1989 Apple IIgs ROM03 +apple2gsmt // 1991 "Mark Twain" prototype apple2gsr0 // Sep 1986 Apple IIgs ROM00 apple2gsr0p // June 19, 1986 Apple IIgs ROM00 prototype apple2gsr0p2 // March 10, 1986 Apple IIgs ROM00 prototype apple2gsr1 // Sep 1987 Apple IIgs ROM01 apple2gsr3p // ??? 198? Apple IIgs ROM03 prototype -apple2gsmt // 1991 "Mark Twain" prototype @source:apple/apple3.cpp apple3 // May 1980 Apple /// @@ -15250,6 +15261,7 @@ cawingr1 // 09/10/1990 (c) 1990 (World) cawingu // 30/11/1990 (c) 1990 (USA) cawingur1 // 12/10/1990 (c) 1990 (USA) chikij // 19/06/1990 (c) 1990 (Japan) +cps1mult // bootleg cworld2j // 11/06/1992 (c) 1992 (Japan) cworld2ja // 11/06/1992 (c) 1992 (Japan) cworld2jb // 11/06/1992 (c) 1992 (Japan) @@ -15537,8 +15549,8 @@ ddsomar1 // 08/02/1996 (c) 1996 (Asia) ddsomb // 23/02/1996 (c) 1996 (Brazil) ddsomh // 23/02/1996 (c) 1996 (Hispanic) ddsomj // 19/06/1996 (c) 1996 (Japan) -ddsomjr1 // 06/02/1996 (c) 1996 (Japan) -ddsomjr2 // 23/02/1996 (c) 1996 (Japan) +ddsomjr1 // 23/02/1996 (c) 1996 (Japan) +ddsomjr2 // 06/02/1996 (c) 1996 (Japan) ddsomr1 // 23/02/1996 (c) 1996 (Euro) ddsomr2 // 09/02/1996 (c) 1996 (Euro) ddsomr3 // 08/02/1996 (c) 1996 (Euro) @@ -16126,7 +16138,13 @@ pb1000 // Casio PB-1000 pb2000c // Casio PB-2000C @source:casio/pickytlk.cpp -pickytlk // Casio Picky Talk +jd363 // Casio Picky Talk - Super Denshi Techou +jd364 // Casio Color Picky Talk - Super Denshi Techou +jd368 // Casio Super Picky Talk - Access Pet +mk300 // Casio Plet's (MK-300) +mk350 // Casio Plet's (MK-350) +pickydis // Tsukuda Original Disney Characters - Tegaki Electronic Note +pickytlk // Casio Super Picky Talk - Forest of Gurutan @source:casio/pv1000.cpp pv1000 // Casio PV-1000 @@ -16626,42 +16644,6 @@ c10 // cb308 // mcb216 // -@source:cvs/cvs.cpp -8ball // (c) 1982 Century -8ball1 // (c) 1982 Century -cosmos // (c) 1981 Century -darkwar // (c) 1981 Century -dazzler // (c) 1982 Century -diggerc // (c) 1982 Century -goldbug // (c) 1982 Century -heartatk // (c) 1983 Century Electronics -hero // (c) 1983 Seatongrove (c) 1984 CVS -hunchbak // (c) 1983 Century -hunchbaka // (c) 1983 Century -huncholy // (c) 1984 Seatongrove (c) CVS -logger // (c) 1982 Century (rev 3) -loggerr2 // (c) 1982 E T Marketing (rev 2) -outline // (c) 1982 Century -radarzon // (c) 1982 Century -radarzon1 // (c) 1982 Century -radarzont // (c) 1982 Tuni Electro Service -raiders // (c) 1983 Century Electronics UK -raidersr3 // (c) 1983 Century Electronics UK -spacefrt // (c) 1981 Century -superbik // (c) 1983 Century -wallst // (c) 1982 Century - -@source:cvs/galaxia.cpp -astrowar // (c) 1980 -galaxia // (c) 1979 -galaxiaa // (c) 1979 -galaxiab // (c) 1979 -galaxiac // (c) 1979 - -@source:cvs/quasar.cpp -quasar // (c) 1980 Zelco Games Italy -quasara // (c) 1980 Zelco Games Italy - @source:cxg/chess2001.cpp ch2001 @@ -16920,6 +16902,7 @@ oscaru // (c) 1987 Data East USA (US) shackled // (c) 1986 Data East USA (US) srdarwin // (c) 1987 Data East Corporation (World) srdarwinj // (c) 1987 Data East Corporation (Japan) +srdarwinb // bootleg @source:dataeast/deco156.cpp hvysmsh // MBG (c) 1993 Data East Corporation (World) @@ -17501,6 +17484,7 @@ animaljr // "75" (c) 1993 Nakanihon/Taito (USA) animaljrj // "75" (c) 1993 Nakanihon/Taito (Japan) animaljrs // "75" (c) 1993 Nakanihon/Taito (Spanish version) daimyojn // "017" 2002 Dynax / Techno-Top +daireach // Mahjong Dai-Reach (C) 2001 Techno-Top ddenlovj // "112" (c) 1995 Dynax (Japan) ddenlovr // "113" (c) 1996 Dynax (Hong Kong) ddenlovrb // bootleg @@ -17856,6 +17840,9 @@ touryuu // (c) 200? Yuki Enterprise @source:eolith/vegaeo.cpp crazywar // (c) 2002 Eolith +@source:epoch/cassvisn.cpp +cassvisn + @source:epoch/gamepock.cpp gamepock // Epoch Game Pocket Computer @@ -18286,6 +18273,7 @@ funquizb // (c) 1990 Fun World gratispk // (c) 1995 Mega Soft gratispka // (c) 1995 Mega Soft jokercrd // (c) 1993 Vesely Svet +jokercrdf // (c) 1993 Fun World jollycrd // (c) 1985 TAB-Austria jollycrda // (c) 1985 TAB-Austria jolyc3x3 // (c) 1985 TAB-Austria @@ -29153,6 +29141,7 @@ fairyl2bl // ldrink // ldrinka // merryjn // +unkbel // @source:misc/bingoman.cpp bingoman // @@ -29430,6 +29419,31 @@ gangrose // tsarevna // tsarevnaa // +@source:misc/cvs.cpp +8ball // (c) 1982 Century +8ball1 // (c) 1982 Century +cosmos // (c) 1981 Century +darkwar // (c) 1981 Century +dazzler // (c) 1982 Century +diggerc // (c) 1982 Century +goldbug // (c) 1982 Century +heartatk // (c) 1983 Century Electronics +hero // (c) 1983 Seatongrove (c) 1984 CVS +hunchbak // (c) 1983 Century +hunchbaka // (c) 1983 Century +huncholy // (c) 1984 Seatongrove (c) CVS +logger // (c) 1982 Century (rev 3) +loggerr2 // (c) 1982 E T Marketing (rev 2) +outline // (c) 1982 Century +radarzon // (c) 1982 Century +radarzon1 // (c) 1982 Century +radarzont // (c) 1982 Tuni Electro Service +raiders // (c) 1983 Century Electronics UK +raidersr3 // (c) 1983 Century Electronics UK +spacefrt // (c) 1981 Century +superbik // (c) 1983 Century +wallst // (c) 1982 Century + @source:misc/cwheel.cpp cwheel // (c) 19?? Gamebar @@ -30914,6 +30928,7 @@ touchemea // @source:misc/laserbas.cpp futflash // (c) 1981 HOEI (Arcade TV Game List - P.96, Right, 18 from top) +futflasha // (c) 1981 HOEI " laserbas // (c) 1981 Amstar/HOEI laserbasa // (c) 1981 Amstar/HOEI @@ -32582,6 +32597,20 @@ multi16 // @source:mitsubishi/trium.cpp triumec // +@source:modelracing/dribling.cpp +dribling // (c) 1983 Model Racing +driblinga // (c) 1983 Model Racing +driblingam // bootleg (Automave) +driblingo // (c) 1983 Olympia +driblingvm // bootleg (Videomac) + +@source:modelracing/sshot.cpp +gunchamps // (c) 1980 Model Racing (sshot.cpp) +sshot // (c) 1979 Model Racing + +@source:modelracing/subhuntr.cpp +subhuntr // 1979 Model Racing + @source:morrow/microdec.cpp md2 // md3 // @@ -32643,20 +32672,6 @@ sys1121 // (c) 1984 Motorola @source:motorola/uchroma68.cpp uchroma68 // 1980 Motorola evaluation board for the MC6847 -@source:mr/dribling.cpp -dribling // (c) 1983 Model Racing -driblinga // (c) 1983 Model Racing -driblingam // bootleg (Automave) -driblingo // (c) 1983 Olympia -driblingvm // bootleg (Videomac) - -@source:mr/sshot.cpp -gunchamps // (c) 1980 Model Racing (sshot.cpp) -sshot // (c) 1979 Model Racing - -@source:mr/subhuntr.cpp -subhuntr // 1979 Model Racing - @source:msx/big10.cpp big10 // big10a // (c) 1986 System Make @@ -38742,6 +38757,12 @@ soldividk // (c) 1997 (Korea) tgm2 // (c) 2000 tgm2p // (c) 2000 +@source:psion/mc400.cpp +mc200 // 1989 Psion MC 200 +mc400 // 1989 Psion MC 400 +mcword // 1992 Psion MC Word +mcword_de // 1992 Psion MC Word (German) + @source:psion/psion.cpp psion1 // psioncm // @@ -39004,6 +39025,7 @@ mc50mk2 // @source:roland/roland_mt32.cpp cm32l // +mt100 // mt32 // @source:roland/roland_mt80s.cpp @@ -40773,7 +40795,7 @@ strkfgtrj // 1991.06 Strike Fighter (Japan) omv1000 // Tsukuda Original Othello Multivision FG-1000 omv2000 // Tsukuda Original Othello Multivision FG-2000 sc3000 // Sega SC-3000 (Japan) -sc3000h // Sega SC-3000H (Japan) +sc3000pal // Sega SC-3000 (Europe/Australia/New Zealand) sf7000 // Sega SC-3000 w/ SF-7000 (Japan) sg1000 // Sega SG-1000 (Japan) sg1000m2 // Sega SG-1000 Mark II (Japan) @@ -45217,9 +45239,100 @@ gizmondo // kontiki // tiki100 // +@source:toaplan/batsugun.cpp +batsugun // TP-030 (c) 1993 Toaplan +batsuguna // TP-030 (c) 1993 Toaplan +batsugunb // +batsugunc // TP-030 (c) 1993 Toaplan +batsugunbl // bootleg +batsugunsp // TP-030 (c) 1993 Toaplan + +@source:toaplan/dogyuun.cpp +dogyuun // TP-022 (c) 1992 Toaplan +dogyuuna // TP-022 (c) 1992 Toaplan +dogyuunb // TP-022 (c) 1992 Toaplan +dogyuunt // TP-022 (c) 1992 Toaplan +dogyuunto // TX-022 (c) 1992 Toaplan + +@source:toaplan/dt7.cpp +dt7 + +@source:toaplan/enmadaio.cpp +enmadaio // TP-031 + +@source:toaplan/fixeight.cpp +fixeight // TP-026 (c) 1992 + Taito license +fixeighta // TP-026 (c) 1992 + Taito license +fixeightat // TP-026 (c) 1992 + Taito license +fixeightbl // bootleg +fixeighth // TP-026 (c) 1992 + Taito license +fixeightht // TP-026 (c) 1992 + Taito license +fixeightj // TP-026 (c) 1992 + Taito license +fixeightjt // TP-026 (c) 1992 + Taito license +fixeightk // TP-026 (c) 1992 + Taito license +fixeightkt // TP-026 (c) 1992 + Taito license +fixeightt // TP-026 (c) 1992 + Taito license +fixeighttw // TP-026 (c) 1992 + Taito license +fixeighttwt // TP-026 (c) 1992 + Taito license +fixeightu // TP-026 (c) 1992 + Taito license +fixeightut // TP-026 (c) 1992 + Taito license + +@source:toaplan/ghox.cpp +ghox // TP-021 (c) 1991 Toaplan +ghoxj // TP-021 (c) 1991 Toaplan +ghoxjo // TP-021 (c) 1991 Toaplan + +@source:toaplan/kbash.cpp +kbash // TP-023 (c) 1993 Toaplan +kbash2 // bootleg +kbashk // TP-023 (c) 1993 Toaplan +kbashp // TP-023 (c) 1993 Toaplan + @source:toaplan/mjsister.cpp mjsister // (c) 1986 Toaplan +@source:toaplan/pipibibi.cpp +pipibibs // TP-025 +pipibibsa // TP-025 +pipibibsbl // (c) 1991 Ryouta Kikaku (bootleg) +pipibibsbl2 // bootleg +pipibibsbl3 // (c) 1991 Ryouta Kikaku (bootleg) +pipibibsp // TP-025 + +@source:toaplan/raizing.cpp +bgaregga // (c) 1996 Raizing/8ing +bgareggabl // hack +bgareggabla // hack +bgareggablj // hack +bgareggacn // (c) 1996 Raizing/8ing +bgareggahk // (c) 1996 Raizing/8ing +bgareggak // (c) 1996 Raizing/8ing +bgaregganv // (c) 1996 Raizing/8ing +bgareggat // (c) 1996 Raizing/8ing +bgareggat2 // (c) 1996 Raizing/8ing +bgareggatw // (c) 1996 Raizing/8ing +kingdmgp // (c) 1994 Raizing/8ing +mahoudai // (c) 1993 Raizing + Able license +shippumd // (c) 1994 Raizing/8ing +sstriker // (c) 1993 Raizing +sstrikerk // (c) 1993 Raizing + +@source:toaplan/raizing_batrider.cpp +batrider // (c) 1998 Raizing/8ing +batriderc // (c) 1998 Raizing/8ing +batriderhk // (c) 1998 Raizing/8ing +batriderj // (c) 1998 Raizing/8ing +batriderja // (c) 1998 Raizing/8ing +batriderk // (c) 1998 Raizing/8ing +batridert // (c) 1998 Raizing/8ing +batrideru // (c) 1998 Raizing/8ing +bbakraid // (c) 1999 8ing +bbakraidc // (c) 1999 8ing +bbakraidj // (c) 1999 8ing +bbakraidja // (c) 1999 8ing +nprobowl // (c) 1996 Zuck + Able license +probowl2 // (c) 1996 Zuck + Able license + @source:toaplan/slapfght.cpp alcon // A77 / TP-??? getstarb1 // GX-006 bootleg but (c) 1986 Taito Corporation @@ -45243,6 +45356,23 @@ tigerhj // A47 (c) 1985 Taito Corporation GX-551 [not @source:toaplan/slapfght_ms.cpp slapfighm +@source:toaplan/snowbro2.cpp +snowbro2 // TP-033 (c) 1994 Hanafram +snowbro2b // +snowbro2b2 // +snowbro2b3 // +snowbro2ny // TP-033 (c) 1994 Nyanko + +@source:toaplan/sunwise.cpp +burgkids // (c) 1995 Sunwise +othldrby // (c) 1995 Sunwise +pwrkick // (c) 1994 Sunwise + +@source:toaplan/tekipaki.cpp +tekipaki // TP-020 (c) 1991 Toaplan +tekipakit // TP-020 (c) 1991 Toaplan (location test) +whoopee // TP-025 (on TP-020) + @source:toaplan/toaplan1.cpp demonwld // TP-O16 (c) 1990 Toaplan (+ Taito license when set to Japan) demonwld1 // TP-O16 (c) 1989 Toaplan + Taito license @@ -45277,92 +45407,8 @@ zerowing // TP-O15 (c) 1989 Toaplan zerowing1 // TP-O15 (c) 1989 Toaplan zerowingw // TP-O15 (c) 1989 Williams Electronics -@source:toaplan/toaplan2.cpp -batrider // (c) 1998 Raizing/8ing -batriderc // (c) 1998 Raizing/8ing -batriderhk // (c) 1998 Raizing/8ing -batriderj // (c) 1998 Raizing/8ing -batriderja // (c) 1998 Raizing/8ing -batriderk // (c) 1998 Raizing/8ing -batridert // (c) 1998 Raizing/8ing -batrideru // (c) 1998 Raizing/8ing -batsugun // TP-030 (c) 1993 Toaplan -batsuguna // TP-030 (c) 1993 Toaplan -batsugunb // -batsugunc // TP-030 (c) 1993 Toaplan -batsugunbl // bootleg -batsugunsp // TP-030 (c) 1993 Toaplan -bbakraid // (c) 1999 8ing -bbakraidc // (c) 1999 8ing -bbakraidj // (c) 1999 8ing -bbakraidja // (c) 1999 8ing -bgaregga // (c) 1996 Raizing/8ing -bgareggabl // hack -bgareggabla // hack -bgareggablj // hack -bgareggacn // (c) 1996 Raizing/8ing -bgareggahk // (c) 1996 Raizing/8ing -bgareggak // (c) 1996 Raizing/8ing -bgaregganv // (c) 1996 Raizing/8ing -bgareggat // (c) 1996 Raizing/8ing -bgareggat2 // (c) 1996 Raizing/8ing -bgareggatw // (c) 1996 Raizing/8ing -burgkids // (c) 1995 Sunwise -dogyuun // TP-022 (c) 1992 Toaplan -dogyuuna // TP-022 (c) 1992 Toaplan -dogyuunb // TP-022 (c) 1992 Toaplan -dogyuunt // TP-022 (c) 1992 Toaplan -dogyuunto // TX-022 (c) 1992 Toaplan -fixeight // TP-026 (c) 1992 + Taito license -fixeighta // TP-026 (c) 1992 + Taito license -fixeightat // TP-026 (c) 1992 + Taito license -fixeightbl // bootleg -fixeighth // TP-026 (c) 1992 + Taito license -fixeightht // TP-026 (c) 1992 + Taito license -fixeightj // TP-026 (c) 1992 + Taito license -fixeightjt // TP-026 (c) 1992 + Taito license -fixeightk // TP-026 (c) 1992 + Taito license -fixeightkt // TP-026 (c) 1992 + Taito license -fixeightt // TP-026 (c) 1992 + Taito license -fixeighttw // TP-026 (c) 1992 + Taito license -fixeighttwt // TP-026 (c) 1992 + Taito license -fixeightu // TP-026 (c) 1992 + Taito license -fixeightut // TP-026 (c) 1992 + Taito license -ghox // TP-021 (c) 1991 Toaplan -ghoxj // TP-021 (c) 1991 Toaplan -ghoxjo // TP-021 (c) 1991 Toaplan -grindstm // TP-027 (c) 1993 Toaplan + Unite Trading license (Korea) -grindstma // TP-027 (c) 1993 Toaplan + Unite Trading license (Korea) -kbash // TP-023 (c) 1993 Toaplan -kbash2 // bootleg -kbashk // TP-023 (c) 1993 Toaplan -kbashp // TP-023 (c) 1993 Toaplan -kingdmgp // (c) 1994 Raizing/8ing -mahoudai // (c) 1993 Raizing + Able license -nprobowl // (c) 1996 Zuck + Able license -othldrby // (c) 1995 Sunwise -pipibibs // TP-025 -pipibibsa // TP-025 -pipibibsbl // (c) 1991 Ryouta Kikaku (bootleg) -pipibibsbl2 // bootleg -pipibibsbl3 // (c) 1991 Ryouta Kikaku (bootleg) -pipibibsp // TP-025 -probowl2 // (c) 1996 Zuck + Able license -pwrkick // (c) 1994 Sunwise -shippumd // (c) 1994 Raizing/8ing -snowbro2 // TP-033 (c) 1994 Hanafram -snowbro2b // -snowbro2b2 // -snowbro2b3 // -snowbro2ny // TP-033 (c) 1994 Nyanko -sstriker // (c) 1993 Raizing -sstrikerk // (c) 1993 Raizing -tekipaki // TP-020 (c) 1991 Toaplan -tekipakit // TP-020 (c) 1991 Toaplan (location test) +@source:toaplan/truxton2.cpp truxton2 // TP-024 (c) 1992 Toaplan -vfive // TP-027 (c) 1993 Toaplan (Japan) -whoopee // TP-025 -enmadaio // TP-031 @source:toaplan/twincobr.cpp fnshark // bootleg @@ -45384,6 +45430,11 @@ twincobru // B30 / TP-011 (c) 1987 Taito America Corporati @source:toaplan/twincobr_ms.cpp twincobrm // bootleg (Modular System) +@source:toaplan/vfive.cpp +grindstm // TP-027 (c) 1993 Toaplan + Unite Trading license (Korea) +grindstma // TP-027 (c) 1993 Toaplan + Unite Trading license (Korea) +vfive // TP-027 (c) 1993 Toaplan (Japan) + @source:toaplan/wardner.cpp pyros // B25 / TP-009 (c) 1987 Taito America Corporation (US) wardner // B25 / TP-009 (c) 1987 Taito Corporation Japan (World) @@ -46880,6 +46931,7 @@ wicat // @source:wing/luckgrln.cpp 7smash // (c) 1993 Sovic luckgrln // (c) 1991 Wing Co. Ltd +luckstrn // (c) 1991 Wing Co. Ltd @source:wing/lucky37.cpp bingo75 // (c) 199? Wing Co. Ltd @@ -46895,6 +46947,7 @@ excitbj // (c) 1992 Wing Co. Ltd lucky74 // (c) 1988 Wing Co. Ltd lucky74a // (c) 1988 Wing Co. Ltd lucky74b // (c) 1988 Wing Co. Ltd +lucky88w // (c) 1988 Wing Co. Ltd @source:wing/pinkiri8.cpp janshi // @@ -47148,12 +47201,22 @@ magix // (c) 1995 Yun Sung magixb // bootleg rocktris // (c) 1994? Yun Sung +@source:zaccaria/galaxia.cpp +astrowar // (c) 1980 +galaxia // (c) 1979 +galaxiaa // (c) 1979 +galaxiab // (c) 1979 + @source:zaccaria/laserbat.cpp catnmous // (c) 1982 catnmousa // (c) 1982 laserbat // (c) 1981 lazarian // (c) 1981 +@source:zaccaria/quasar.cpp +quasar // (c) 1980 Zelco Games Italy +quasara // (c) 1980 Zelco Games Italy + @source:zaccaria/seabattl.cpp armada // seabattl // (c) 1980 diff --git a/src/mame/midway/williams.cpp b/src/mame/midway/williams.cpp index 13c1a14e446..fe2cb299380 100644 --- a/src/mame/midway/williams.cpp +++ b/src/mame/midway/williams.cpp @@ -41,25 +41,7 @@ **************************************************************************** - Blitter (Stargate and Defender do not have blitter) - --------------------------------------------------- - - CA00 start_blitter Each bits has a function - 1000 0000 Do not process half the byte 4-7 - 0100 0000 Do not process half the byte 0-3 - 0010 0000 Shift the shape one pixel right (to display a shape on an odd pixel) - 0001 0000 Remap, if shape != 0 then pixel = mask - 0000 1000 Source 1 = take source 0 = take Mask only - 0000 0100 ? - 0000 0010 Transparent - 0000 0001 - CA01 blitter_mask Not really a mask, more a remap color, see Blitter - CA02 blitter_source hi - CA03 blitter_source lo - CA04 blitter_dest hi - CA05 blitter_dest lo - CA06 blitter_w_h H Do a XOR with 4 to have the real value (Except Splat) - CA07 blitter_w_h W Do a XOR with 4 to have the real value (Except Splat) + CA00-CA07 blitter (Stargate and Defender do not have blitter) CB00 6 bits of the video counters bits 2-7 @@ -553,17 +535,21 @@ void williams_state::main_map(address_map &map) map(0xc804, 0xc807).mirror(0x00f0).rw(m_pia[0], FUNC(pia6821_device::read), FUNC(pia6821_device::write)); map(0xc80c, 0xc80f).mirror(0x00f0).rw(m_pia[1], FUNC(pia6821_device::read), FUNC(pia6821_device::write)); map(0xc900, 0xc9ff).w(FUNC(williams_state::vram_select_w)); - map(0xca00, 0xca07).mirror(0x00f8).w(FUNC(williams_state::blitter_w)); map(0xcb00, 0xcbff).r(FUNC(williams_state::video_counter_r)); map(0xcbff, 0xcbff).w(FUNC(williams_state::watchdog_reset_w)); map(0xcc00, 0xcfff).ram().w(FUNC(williams_state::cmos_4bit_w)).share("nvram"); map(0xd000, 0xffff).rom(); } +void williams_state::main_map_blitter(address_map &map) +{ + main_map(map); + map(0xca00, 0xca07).mirror(0x00f8).m(m_blitter, FUNC(williams_blitter_device::map)); +} void williams_state::sinistar_main_map(address_map &map) { - main_map(map); + main_map_blitter(map); map(0xc900, 0xc9ff).w(FUNC(williams_state::sinistar_vram_select_w)); @@ -574,7 +560,7 @@ void williams_state::sinistar_main_map(address_map &map) void williams_state::bubbles_main_map(address_map &map) { - main_map(map); + main_map_blitter(map); // bubbles has additional CMOS for a full 8 bits map(0xcc00, 0xcfff).ram().share("nvram"); @@ -583,7 +569,7 @@ void williams_state::bubbles_main_map(address_map &map) void williams_state::spdball_main_map(address_map &map) { - main_map(map); + main_map_blitter(map); // install extra input handlers map(0xc800, 0xc800).portr("AN0"); @@ -598,7 +584,7 @@ void williams_state::spdball_main_map(address_map &map) void williams_state::alienar_main_map(address_map &map) { - main_map(map); + main_map_blitter(map); map(0xcbff, 0xcbff).nopw(); } @@ -621,10 +607,10 @@ void blaster_state::blaster_main_map(address_map &map) map(0xc804, 0xc807).mirror(0x00f0).rw(m_pia[0], FUNC(pia6821_device::read), FUNC(pia6821_device::write)); map(0xc80c, 0xc80f).mirror(0x00f0).rw(m_pia[1], FUNC(pia6821_device::read), FUNC(pia6821_device::write)); map(0xc900, 0xc93f).w(FUNC(blaster_state::blaster_vram_select_w)); - map(0xc940, 0xc97f).w(FUNC(blaster_state::remap_select_w)); + map(0xc940, 0xc97f).w(m_blitter, FUNC(williams_blitter_device::remap_select_w)); map(0xc980, 0xc9bf).w(FUNC(blaster_state::bank_select_w)); map(0xc9c0, 0xc9ff).w(FUNC(blaster_state::video_control_w)); - map(0xca00, 0xca07).mirror(0x00f8).w(FUNC(blaster_state::blitter_w)); + map(0xca00, 0xca07).mirror(0x00f8).m(m_blitter, FUNC(williams_blitter_device::map)); map(0xcb00, 0xcbff).r(FUNC(blaster_state::video_counter_r)); map(0xcbff, 0xcbff).w(FUNC(blaster_state::watchdog_reset_w)); map(0xcc00, 0xcfff).ram().w(FUNC(blaster_state::cmos_4bit_w)).share("nvram"); @@ -648,7 +634,7 @@ void williams2_state::common_map(address_map &map) m_palette_view[0](0x8000, 0x87ff).ram().w(FUNC(williams2_state::paletteram_w)).share(m_paletteram); map(0xc000, 0xc7ff).ram().w(FUNC(williams2_state::tileram_w)).share(m_tileram); map(0xc800, 0xc87f).w(FUNC(williams2_state::bank_select_w)); - map(0xc880, 0xc887).mirror(0x0078).w(FUNC(williams2_state::blitter_w)); + map(0xc880, 0xc887).mirror(0x0078).m(m_blitter, FUNC(williams_blitter_device::map)); map(0xc900, 0xc97f).w(FUNC(williams2_state::watchdog_reset_w)); map(0xc980, 0xc983).mirror(0x0070).rw(m_pia[1], FUNC(pia6821_device::read), FUNC(pia6821_device::write)); map(0xc984, 0xc987).mirror(0x0070).rw(m_pia[0], FUNC(pia6821_device::read), FUNC(pia6821_device::write)); @@ -658,7 +644,7 @@ void williams2_state::common_map(address_map &map) map(0xcb40, 0xcb5f).w(FUNC(williams2_state::xscroll_low_w)); map(0xcb60, 0xcb7f).w(FUNC(williams2_state::xscroll_high_w)); map(0xcb80, 0xcb9f).w(FUNC(williams2_state::video_control_w)); - map(0xcba0, 0xcbbf).w(FUNC(williams2_state::blit_window_enable_w)); + map(0xcba0, 0xcbbf).w(m_blitter, FUNC(williams_blitter_device::window_enable_w)); map(0xcbe0, 0xcbef).r(FUNC(williams2_state::video_counter_r)); map(0xcc00, 0xcfff).ram().w(FUNC(williams2_state::cmos_4bit_w)).share("nvram"); } @@ -1596,31 +1582,17 @@ void williams_state::williams_base(machine_config &config) m_pia[2]->irqb_handler().set("soundirq", FUNC(input_merger_any_high_device::in_w<1>)); } -void williams_state::williams_b0(machine_config &config) -{ - williams_base(config); - m_blitter_config = WILLIAMS_BLITTER_NONE; - m_blitter_clip_address = 0x0000; -} - void williams_state::williams_b1(machine_config &config) { williams_base(config); - m_blitter_config = WILLIAMS_BLITTER_SC1; - m_blitter_clip_address = 0xc000; -} - -void williams_state::williams_b2(machine_config &config) -{ - williams_base(config); - m_blitter_config = WILLIAMS_BLITTER_SC2; - m_blitter_clip_address = 0xc000; + WILLIAMS_BLITTER_SC1(config, m_blitter, 0xc000, m_maincpu, m_videoram); + m_maincpu->set_addrmap(AS_PROGRAM, &williams_state::main_map_blitter); } void defender_state::defender(machine_config &config) { - williams_b0(config); + williams_base(config); m_maincpu->set_addrmap(AS_PROGRAM, &defender_state::defender_main_map); m_soundcpu->set_addrmap(AS_PROGRAM, &defender_state::defender_sound_map); @@ -1681,7 +1653,8 @@ void williams_state::joust(machine_config &config) void williams_state::splat(machine_config &config) { - williams_b2(config); + williams_base(config); + WILLIAMS_BLITTER_SC2(config, m_blitter, 0xc000, m_maincpu, m_videoram); williams_muxed(config); } @@ -1704,8 +1677,8 @@ void williams_state::bubbles(machine_config &config) void williams_state::sinistar_upright(machine_config &config) { // Sinistar: blitter window clip - williams_b1(config); - m_blitter_clip_address = 0x7400; + williams_base(config); + WILLIAMS_BLITTER_SC1(config, m_blitter, 0x7400, m_maincpu, m_videoram); m_maincpu->set_addrmap(AS_PROGRAM, &williams_state::sinistar_main_map); @@ -1786,8 +1759,8 @@ void williams_state::lottofun(machine_config &config) void blaster_state::blastkit(machine_config &config) { - williams_b2(config); - m_blitter_clip_address = 0x9700; + williams_base(config); + WILLIAMS_BLITTER_SC2(config, m_blitter, 0x9700, m_maincpu, m_videoram, "proms"); m_maincpu->set_addrmap(AS_PROGRAM, &blaster_state::blaster_main_map); @@ -1899,8 +1872,7 @@ void williams2_state::williams2_base(machine_config &config) m_pia[2]->irqa_handler().set("soundirq", FUNC(input_merger_any_high_device::in_w<0>)); m_pia[2]->irqb_handler().set("soundirq", FUNC(input_merger_any_high_device::in_w<1>)); - m_blitter_config = WILLIAMS_BLITTER_SC2; - m_blitter_clip_address = 0x9000; + WILLIAMS_BLITTER_SC2(config, m_blitter, 0x9000, m_maincpu, m_videoram); } @@ -3953,7 +3925,7 @@ GAME( 1982, jin, 0, jin, jin, defender_state, e // Standard Williams hardware -GAME( 1981, stargate, 0, williams_b0, stargate, williams_state, empty_init, ROT0, "Williams / Vid Kidz", "Stargate", MACHINE_SUPPORTS_SAVE ) +GAME( 1981, stargate, 0, williams_base, stargate, williams_state, empty_init, ROT0, "Williams / Vid Kidz", "Stargate", MACHINE_SUPPORTS_SAVE ) GAME( 1982, conquest, 0, williams_b1, conquest, conquest_state, empty_init, ROT270, "Williams / Vid Kidz", "Conquest (prototype)", MACHINE_IS_INCOMPLETE | MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/midway/williams.h b/src/mame/midway/williams.h index 1df94ba3a90..f736b07d9ed 100644 --- a/src/mame/midway/williams.h +++ b/src/mame/midway/williams.h @@ -12,6 +12,7 @@ #include "s11c_bg.h" #include "williamssound.h" +#include "williamsblitter.h" #include "cpu/m6800/m6800.h" #include "cpu/m6809/m6809.h" @@ -39,6 +40,7 @@ class williams_state : public driver_device m_screen(*this, "screen"), m_palette(*this, "palette"), m_paletteram(*this, "paletteram"), + m_blitter(*this, "blitter"), m_pia(*this, "pia_%u", 0U), m_nvram(*this, "nvram"), m_videoram(*this, "videoram"), @@ -47,9 +49,8 @@ class williams_state : public driver_device m_49way_y(*this, "49WAYY") { } - void williams_b0(machine_config &config); + void williams_base(machine_config &config); void williams_b1(machine_config &config); - void williams_b2(machine_config &config); void joust(machine_config &config); void bubbles(machine_config &config); @@ -71,33 +72,13 @@ class williams_state : public driver_device void palette_init(palette_device &palette) const; protected: - // blitter type - enum - { - WILLIAMS_BLITTER_NONE = 0, // no blitter - WILLIAMS_BLITTER_SC1 = 1, // Special Chip 1 blitter - WILLIAMS_BLITTER_SC2 = 2 // Special Chip 2 "bugfixed" blitter - }; - - // controlbyte (0xCA00) bit definitions - enum - { - WMS_BLITTER_CONTROLBYTE_NO_EVEN = 0x80, - WMS_BLITTER_CONTROLBYTE_NO_ODD = 0x40, - WMS_BLITTER_CONTROLBYTE_SHIFT = 0x20, - WMS_BLITTER_CONTROLBYTE_SOLID = 0x10, - WMS_BLITTER_CONTROLBYTE_FOREGROUND_ONLY = 0x08, - WMS_BLITTER_CONTROLBYTE_SLOW = 0x04, // 2us blits instead of 1us - WMS_BLITTER_CONTROLBYTE_DST_STRIDE_256 = 0x02, - WMS_BLITTER_CONTROLBYTE_SRC_STRIDE_256 = 0x01 - }; - required_device m_maincpu; required_device m_soundcpu; required_device m_watchdog; required_device m_screen; - optional_device m_palette; - optional_shared_ptr m_paletteram; + required_device m_palette; + required_shared_ptr m_paletteram; + optional_device m_blitter; optional_device_array m_pia; required_shared_ptr m_nvram; @@ -108,16 +89,8 @@ class williams_state : public driver_device optional_ioport m_49way_x; optional_ioport m_49way_y; - uint8_t m_blitter_config; - uint16_t m_blitter_clip_address; - uint8_t m_blitter_window_enable; uint8_t m_cocktail; std::unique_ptr m_palette_lookup; - uint8_t m_blitterram[8]; - uint8_t m_blitter_xor; - uint8_t m_blitter_remap_index; - const uint8_t *m_blitter_remap; - std::unique_ptr m_blitter_remap_lookup; virtual void machine_reset() override ATTR_COLD; virtual void video_start() override ATTR_COLD; @@ -126,7 +99,6 @@ class williams_state : public driver_device void vram_select_w(u8 data); void sinistar_vram_select_w(u8 data); void cmos_4bit_w(offs_t offset, u8 data); - void blitter_w(address_space &space, offs_t offset, u8 data); template TIMER_CALLBACK_MEMBER(deferred_snd_cmd_w); @@ -134,15 +106,10 @@ class williams_state : public driver_device void playball_snd_cmd_w(u8 data); void cockpit_snd_cmd_w(u8 data); - void state_save_register(); - void blitter_init(int blitter_config, const uint8_t *remap_prom); - inline void blit_pixel(address_space &space, int dstaddr, int srcdata, int controlbyte); - int blitter_core(address_space &space, int sstart, int dstart, int w, int h, int data); - - void williams_base(machine_config &config); void williams_muxed(machine_config &config); void main_map(address_map &map) ATTR_COLD; + void main_map_blitter(address_map &map) ATTR_COLD; void bubbles_main_map(address_map &map) ATTR_COLD; void sinistar_main_map(address_map &map) ATTR_COLD; void spdball_main_map(address_map &map) ATTR_COLD; @@ -237,7 +204,6 @@ class blaster_state : public williams_state void blaster_vram_select_w(u8 data); void bank_select_w(u8 data); - void remap_select_w(u8 data); void video_control_w(u8 data); TIMER_CALLBACK_MEMBER(deferred_snd_cmd_w); void blaster_snd_cmd_w(u8 data); diff --git a/src/mame/midway/williams_m.cpp b/src/mame/midway/williams_m.cpp index 2eefd25075e..d7f60a1df0d 100644 --- a/src/mame/midway/williams_m.cpp +++ b/src/mame/midway/williams_m.cpp @@ -375,7 +375,7 @@ void williams_state::sinistar_vram_select_w(u8 data) vram_select_w(data); // window enable from bit 2 (clips to 0x7400) - m_blitter_window_enable = BIT(data, 2); + m_blitter->window_enable_w(BIT(data, 2)); } @@ -421,7 +421,7 @@ void blaster_state::blaster_vram_select_w(u8 data) m_cocktail = BIT(data, 1); // window enable from bit 2 (clips to 0x9700) - m_blitter_window_enable = BIT(data, 2); + m_blitter->window_enable_w(BIT(data, 2)); } diff --git a/src/mame/midway/williams_v.cpp b/src/mame/midway/williams_v.cpp index eea6f16fb9f..75eb1c7fa76 100644 --- a/src/mame/midway/williams_v.cpp +++ b/src/mame/midway/williams_v.cpp @@ -160,26 +160,15 @@ The full silkscreen markings of SC2 (under the "Special Chip 2" sticker, if it i * *************************************/ -void williams_state::state_save_register() -{ - save_item(NAME(m_blitter_window_enable)); - save_item(NAME(m_cocktail)); - save_item(NAME(m_blitterram)); - save_item(NAME(m_blitter_remap_index)); -} - - void williams_state::video_start() { - blitter_init(m_blitter_config, nullptr); - state_save_register(); + save_item(NAME(m_cocktail)); } void blaster_state::video_start() { - blitter_init(m_blitter_config, memregion("proms")->base()); - state_save_register(); + williams_state::video_start(); save_item(NAME(m_color0)); save_item(NAME(m_video_control)); } @@ -187,13 +176,12 @@ void blaster_state::video_start() void williams2_state::video_start() { - blitter_init(m_blitter_config, nullptr); + williams_state::video_start(); /* create the tilemap */ m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(williams2_state::get_tile_info)), TILEMAP_SCAN_COLS, 24,16, 128,16); m_bg_tilemap->set_scrolldx(2, 0); - state_save_register(); save_item(NAME(m_tilemap_xscroll)); save_item(NAME(m_fg_color)); save_item(NAME(m_gain)); @@ -313,7 +301,6 @@ uint32_t mysticm_state::screen_update(screen_device &screen, bitmap_rgb32 &bitma rgb_t pens[16]; /* draw the background */ - //printf("y %d %d %d\n", cliprect.min_y, cliprect.max_y, m_screen->vpos()); m_bg_tilemap->mark_all_dirty(); m_bg_tilemap->draw(screen, bitmap, cliprect, TILEMAP_DRAW_OPAQUE | TILEMAP_DRAW_ALL_CATEGORIES, 0); @@ -644,205 +631,7 @@ void williams2_state::xscroll_high_w(u8 data) * *************************************/ -void blaster_state::remap_select_w(u8 data) -{ - m_blitter_remap_index = data; - m_blitter_remap = m_blitter_remap_lookup.get() + data * 256; -} - - void blaster_state::video_control_w(u8 data) { m_video_control = data; } - - - -/************************************* - * - * Blitter setup and control - * - *************************************/ - -void williams_state::blitter_init(int blitter_config, const uint8_t *remap_prom) -{ - std::fill(std::begin(m_blitterram), std::end(m_blitterram), 0); - static const uint8_t dummy_table[] = { 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15 }; - - /* by default, there is no clipping window - this will be touched only by games that have one */ - m_blitter_window_enable = 0; - - /* switch off the video config */ - m_blitter_xor = (blitter_config == WILLIAMS_BLITTER_SC1) ? 4 : 0; - - /* create the remap table; if no PROM, make an identity remap table */ - m_blitter_remap_lookup = std::make_unique(256 * 256); - m_blitter_remap_index = 0; - m_blitter_remap = m_blitter_remap_lookup.get(); - for (int i = 0; i < 256; i++) - { - const uint8_t *table = remap_prom ? (remap_prom + (i & 0x7f) * 16) : dummy_table; - for (int j = 0; j < 256; j++) - m_blitter_remap_lookup[i * 256 + j] = (table[j >> 4] << 4) | table[j & 0x0f]; - } -} - - -void williams_state::blitter_w(address_space &space, offs_t offset, u8 data) -{ - /* store the data */ - m_blitterram[offset] = data; - - /* only writes to location 0 trigger the blit */ - if (offset != 0) - return; - - /* compute the starting locations */ - int sstart = (m_blitterram[2] << 8) + m_blitterram[3]; - int dstart = (m_blitterram[4] << 8) + m_blitterram[5]; - - /* compute the width and height */ - int w = m_blitterram[6] ^ m_blitter_xor; - int h = m_blitterram[7] ^ m_blitter_xor; - - /* adjust the width and height */ - if (w == 0) w = 1; - if (h == 0) h = 1; - - /* do the actual blit */ - int const accesses = blitter_core(space, sstart, dstart, w, h, data); - - /* based on the number of memory accesses needed to do the blit, compute how long the blit will take */ - int estimated_clocks_at_4MHz = 4; - if(data & WMS_BLITTER_CONTROLBYTE_SLOW) - { - estimated_clocks_at_4MHz += 4 * (accesses + 2); - } - else - { - estimated_clocks_at_4MHz += 2 * (accesses + 3); - } - - m_maincpu->adjust_icount(-((estimated_clocks_at_4MHz + 3) / 4)); - - /* Log blits */ - logerror("%04X:Blit @ %3d : %02X%02X -> %02X%02X, %3dx%3d, mask=%02X, flags=%02X, icount=%d, win=%d\n", - m_maincpu->pc(), m_screen->vpos(), - m_blitterram[2], m_blitterram[3], - m_blitterram[4], m_blitterram[5], - m_blitterram[6], m_blitterram[7], - m_blitterram[1], m_blitterram[0], - ((estimated_clocks_at_4MHz + 3) / 4), m_blitter_window_enable); -} - - -void williams2_state::blit_window_enable_w(u8 data) -{ - m_blitter_window_enable = BIT(data, 0); -} - - - -/************************************* - * - * Blitter core - * - *************************************/ - -inline void williams_state::blit_pixel(address_space &space, int dstaddr, int srcdata, int controlbyte) -{ - /* always read from video RAM regardless of the bank setting */ - int curpix = (dstaddr < 0xc000) ? m_videoram[dstaddr] : space.read_byte(dstaddr); // current pixel values at dest - - int const solid = m_blitterram[1]; - unsigned char keepmask = 0xff; // what part of original dst byte should be kept, based on NO_EVEN and NO_ODD flags - - // even pixel (D7-D4) - if((controlbyte & WMS_BLITTER_CONTROLBYTE_FOREGROUND_ONLY) && !(srcdata & 0xf0)) // FG only and src even pixel=0 - { - if(controlbyte & WMS_BLITTER_CONTROLBYTE_NO_EVEN) - keepmask &= 0x0f; - } - else - { - if(!(controlbyte & WMS_BLITTER_CONTROLBYTE_NO_EVEN)) - keepmask &= 0x0f; - } - - // odd pixel (D3-D0) - if((controlbyte & WMS_BLITTER_CONTROLBYTE_FOREGROUND_ONLY) && !(srcdata & 0x0f)) // FG only and src odd pixel=0 - { - if(controlbyte & WMS_BLITTER_CONTROLBYTE_NO_ODD) - keepmask &= 0xf0; - } - else - { - if(!(controlbyte & WMS_BLITTER_CONTROLBYTE_NO_ODD)) - keepmask &= 0xf0; - } - - curpix &= keepmask; - if(controlbyte & WMS_BLITTER_CONTROLBYTE_SOLID) - curpix |= (solid & ~keepmask); - else - curpix |= (srcdata & ~keepmask); - - /* if the window is enabled, only blit to videoram below the clipping address */ - /* note that we have to allow blits to non-video RAM (e.g. tileram, Sinistar $DXXX SRAM) because those */ - /* are not blocked by the window enable */ - if (!m_blitter_window_enable || dstaddr < m_blitter_clip_address || dstaddr >= 0xc000) - space.write_byte(dstaddr, curpix); -} - - -int williams_state::blitter_core(address_space &space, int sstart, int dstart, int w, int h, int controlbyte) -{ - int accesses = 0; - - /* compute how much to advance in the x and y loops */ - int const sxadv = (controlbyte & WMS_BLITTER_CONTROLBYTE_SRC_STRIDE_256) ? 0x100 : 1; - int const syadv = (controlbyte & WMS_BLITTER_CONTROLBYTE_SRC_STRIDE_256) ? 1 : w; - int const dxadv = (controlbyte & WMS_BLITTER_CONTROLBYTE_DST_STRIDE_256) ? 0x100 : 1; - int const dyadv = (controlbyte & WMS_BLITTER_CONTROLBYTE_DST_STRIDE_256) ? 1 : w; - - int pixdata = 0; - - /* loop over the height */ - for (int y = 0; y < h; y++) - { - int source = sstart & 0xffff; - int dest = dstart & 0xffff; - - /* loop over the width */ - for (int x = 0; x < w; x++) - { - if (!(controlbyte & WMS_BLITTER_CONTROLBYTE_SHIFT)) // no shift - { - blit_pixel(space, dest, m_blitter_remap[space.read_byte(source)], controlbyte); - } - else - { - // shift one pixel right - pixdata = (pixdata << 8) | m_blitter_remap[space.read_byte(source)]; - blit_pixel(space, dest, (pixdata >> 4) & 0xff, controlbyte); - } - accesses += 2; - - /* advance src and dst pointers */ - source = (source + sxadv) & 0xffff; - dest = (dest + dxadv) & 0xffff; - } - - /* note that PlayBall! indicates the X coordinate doesn't wrap */ - if (controlbyte & WMS_BLITTER_CONTROLBYTE_DST_STRIDE_256) - dstart = (dstart & 0xff00) | ((dstart + dyadv) & 0xff); - else - dstart += dyadv; - - if (controlbyte & WMS_BLITTER_CONTROLBYTE_SRC_STRIDE_256) - sstart = (sstart & 0xff00) | ((sstart + syadv) & 0xff); - else - sstart += syadv; - } - return accesses; -} diff --git a/src/mame/midway/williamsblitter.cpp b/src/mame/midway/williamsblitter.cpp new file mode 100644 index 00000000000..ffda9b97799 --- /dev/null +++ b/src/mame/midway/williamsblitter.cpp @@ -0,0 +1,251 @@ +// license:BSD-3-Clause +// copyright-holders:Aaron Giles +/*************************************************************************** + + Williams first-generation blitter + + Register Description + -------------------- + + CA00 start_blitter Control bits + CA01 mask Solid color to optionally use instead of source + CA02 source Source address MSB + CA03 source Source address LSB + CA04 dest Destination address MSB + CA05 dest Destination address LSB + CA06 w_h Blit width (XOR with 4 to have the real value on first-rev blitter) + CA07 w_h Blit height (XOR with 4 to have the real value on first-rev blitter) + +***************************************************************************/ + +#include "emu.h" +#include "williamsblitter.h" + +#define VERBOSE (0) +#include "logmacro.h" + +DEFINE_DEVICE_TYPE(WILLIAMS_BLITTER_SC1, williams_blitter_sc1_device, "williams_blitter_sc1_device", "Williams Blitter (SC1)") +DEFINE_DEVICE_TYPE(WILLIAMS_BLITTER_SC2, williams_blitter_sc2_device, "williams_blitter_sc2_device", "Williams Blitter (SC2)") + +williams_blitter_device::williams_blitter_device(machine_config const &mconfig, device_type type, char const *tag, device_t *owner, u32 clock) : + device_t(mconfig, type, tag, owner, clock), + m_cpu(*this, finder_base::DUMMY_TAG), + m_vram(*this, finder_base::DUMMY_TAG), + m_proms(*this, finder_base::DUMMY_TAG) +{ +} + +williams_blitter_sc1_device::williams_blitter_sc1_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : + williams_blitter_device(mconfig, WILLIAMS_BLITTER_SC1, tag, owner, clock) +{ +} + +williams_blitter_sc2_device::williams_blitter_sc2_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : + williams_blitter_device(mconfig, WILLIAMS_BLITTER_SC2, tag, owner, clock) +{ +} + +void williams_blitter_device::device_start() +{ + static const u8 dummy_table[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }; + + m_window_enable = 0; + + // create the remap table; if no PROM, make an identity remap table + m_remap_lookup = std::make_unique(256 * 256); + m_remap = m_remap_lookup.get(); + for (int i = 0; i < 256; i++) + { + const u8 *table = m_proms.found() ? &m_proms[(i & 0x7f) * 16] : dummy_table; + for (int j = 0; j < 256; j++) + { + m_remap_lookup[i * 256 + j] = (table[j >> 4] << 4) | table[j & 0x0f]; + } + } + + save_item(NAME(m_window_enable)); + save_item(NAME(m_control)); + save_item(NAME(m_no_even)); + save_item(NAME(m_no_odd)); + save_item(NAME(m_solid)); + save_item(NAME(m_fg_only)); + save_item(NAME(m_solid_color)); + save_item(NAME(m_sstart)); + save_item(NAME(m_dstart)); + save_item(NAME(m_width)); + save_item(NAME(m_height)); + save_item(NAME(m_remap_index)); +} + +void williams_blitter_device::device_reset() +{ + m_control = 0; + m_no_even = false; + m_no_odd = false; + m_solid = false; + m_fg_only = false; + m_solid_color = 0; + m_sstart = 0; + m_dstart = 0; + m_width = 0; + m_height = 0; + m_remap_index = 0; +} + +void williams_blitter_device::map(address_map &map) +{ + map(0x0, 0x0).w(FUNC(williams_blitter_device::control_w)); + map(0x1, 0x1).lw8(NAME([this](u8 data) { m_solid_color = data; })); + map(0x2, 0x2).lw8(NAME([this](u8 data) { m_sstart = (m_sstart & 0x00ff) | ((u16)data << 8); })); + map(0x3, 0x3).lw8(NAME([this](u8 data) { m_sstart = (m_sstart & 0xff00) | data; })); + map(0x4, 0x4).lw8(NAME([this](u8 data) { m_dstart = (m_dstart & 0x00ff) | ((u16)data << 8); })); + map(0x5, 0x5).lw8(NAME([this](u8 data) { m_dstart = (m_dstart & 0xff00) | data; })); + map(0x6, 0x6).lw8(NAME([this](u8 data) { m_width = data; })); + map(0x7, 0x7).lw8(NAME([this](u8 data) { m_height = data; })); +} + +void williams_blitter_device::control_w(address_space &space, offs_t offset, u8 data) +{ + m_control = data; + m_no_even = BIT(data, CONTROLBYTE_NO_EVEN); + m_no_odd = BIT(data, CONTROLBYTE_NO_ODD); + m_solid = BIT(data, CONTROLBYTE_SOLID); + m_fg_only = BIT(data, CONTROLBYTE_FOREGROUND_ONLY); + + int w = m_width ^ m_size_xor; + int h = m_height ^ m_size_xor; + + if (w == 0) + w = 1; + if (h == 0) + h = 1; + + const int accesses = blit_core(space, w, h); + + // based on the number of memory accesses needed to do the blit, compute how long the blit will take + int estimated_clocks_at_4MHz = 4; + if (BIT(m_control, CONTROLBYTE_SLOW)) + estimated_clocks_at_4MHz += 4 * (accesses + 2); + else + estimated_clocks_at_4MHz += 2 * (accesses + 3); + + m_cpu->adjust_icount(-((estimated_clocks_at_4MHz + 3) / 4)); + + // log blits + LOG("%04X:Blit : %04X -> %04X, %3dx%3d, mask=%02X, flags=%02X, icount=%d, win=%d\n", + m_cpu->pc(), m_sstart, m_dstart, m_width, m_height, m_solid_color, m_control, + ((estimated_clocks_at_4MHz + 3) / 4), m_window_enable); +} + +void williams_blitter_device::remap_select_w(u8 data) +{ + m_remap_index = data; + if (m_proms != nullptr) + m_remap = m_remap_lookup.get() + data * 256; +} + +void williams_blitter_device::window_enable_w(u8 data) +{ + m_window_enable = BIT(data, 0); +} + +inline void williams_blitter_device::blit_pixel(address_space &space, int dstaddr, int srcdata) +{ + // always read from video RAM regardless of the bank setting + int curpix = (dstaddr < 0xc000) ? m_vram[dstaddr] : space.read_byte(dstaddr); // current pixel values at dest + + u8 keepmask = 0xff; // what part of original dst byte should be kept, based on NO_EVEN and NO_ODD flags + + // even pixel (D7-D4) + if (m_fg_only && !(srcdata & 0xf0)) // FG only and src even pixel=0 + { + if (m_no_even) + keepmask &= 0x0f; + } + else + { + if (!m_no_even) + keepmask &= 0x0f; + } + + // odd pixel (D3-D0) + if (m_fg_only && !(srcdata & 0x0f)) // FG only and src odd pixel=0 + { + if (m_no_odd) + keepmask &= 0xf0; + } + else + { + if (!m_no_odd) + keepmask &= 0xf0; + } + + curpix &= keepmask; + if (m_solid) + curpix |= m_solid_color & ~keepmask; + else + curpix |= srcdata & ~keepmask; + + /* if the window is enabled, only blit to videoram below the clipping address */ + /* note that we have to allow blits to non-video RAM (e.g. tileram, Sinistar $DXXX SRAM) because those */ + /* are not blocked by the window enable */ + if (!m_window_enable || dstaddr < m_clip_address || dstaddr >= 0xc000) + space.write_byte(dstaddr, curpix); +} + +int williams_blitter_device::blit_core(address_space &space, int w, int h) +{ + // compute how much to advance in the x and y loops + const bool dst_stride_256 = BIT(m_control, CONTROLBYTE_DST_STRIDE_256); + const bool src_stride_256 = BIT(m_control, CONTROLBYTE_SRC_STRIDE_256); + const int sxadv = src_stride_256 ? 0x100 : 1; + const int syadv = src_stride_256 ? 1 : w; + const int dxadv = dst_stride_256 ? 0x100 : 1; + const int dyadv = dst_stride_256 ? 1 : w; + + int accesses = 0; + int pixdata = 0; + + // loop over the height + const bool shift = BIT(m_control, CONTROLBYTE_SHIFT); + u16 sstart = m_sstart; + u16 dstart = m_dstart; + for (int y = 0; y < h; y++) + { + u16 source = sstart; + u16 dest = dstart; + + // loop over the width + for (int x = 0; x < w; x++) + { + const u8 rawval = m_remap[space.read_byte(source)]; + if (shift) + { + // shift one pixel right + pixdata = (pixdata << 8) | rawval; + blit_pixel(space, dest, (pixdata >> 4) & 0xff); + } + else + { + blit_pixel(space, dest, rawval); + } + accesses += 2; + + // advance src and dst pointers + source += sxadv; + dest += dxadv; + } + + // note that PlayBall! indicates the X coordinate doesn't wrap + if (dst_stride_256) + dstart = (dstart & 0xff00) | ((dstart + dyadv) & 0xff); + else + dstart += dyadv; + + if (src_stride_256) + sstart = (sstart & 0xff00) | ((sstart + syadv) & 0xff); + else + sstart += syadv; + } + return accesses; +} diff --git a/src/mame/midway/williamsblitter.h b/src/mame/midway/williamsblitter.h new file mode 100644 index 00000000000..5a05cfe89ca --- /dev/null +++ b/src/mame/midway/williamsblitter.h @@ -0,0 +1,129 @@ +// license:BSD-3-Clause +// copyright-holders:Aaron Giles +/*************************************************************************** + + Williams first-generation blitter + +***************************************************************************/ + +#ifndef MAME_MIDWAY_WILLIAMSBLITTER_H +#define MAME_MIDWAY_WILLIAMSBLITTER_H + +#pragma once + +class williams_blitter_device : public device_t { +public: + template void set_cpu_tag(T &&cpu_tag) { m_cpu.set_tag(std::forward(cpu_tag)); } + template void set_vram_tag(T &&vram_tag) { m_vram.set_tag(std::forward(vram_tag)); } + template void set_proms_tag(T &&proms_tag) { m_proms.set_tag(std::forward(proms_tag)); } + + void map(address_map &map) ATTR_COLD; + + void remap_select_w(u8 data); + void window_enable_w(u8 data); + +protected: + williams_blitter_device(machine_config const &mconfig, device_type type, char const *tag, device_t *owner, u32 clock = 0); + + void set_clip_address(u16 clip_address) { m_clip_address = clip_address; } + void set_size_xor(u32 size_xor) { m_size_xor = size_xor; } + + virtual void device_start() override ATTR_COLD; + virtual void device_reset() override ATTR_COLD; + +private: + // control byte bit definitions + enum + { + CONTROLBYTE_NO_EVEN = 7, + CONTROLBYTE_NO_ODD = 6, + CONTROLBYTE_SHIFT = 5, + CONTROLBYTE_SOLID = 4, + CONTROLBYTE_FOREGROUND_ONLY = 3, + CONTROLBYTE_SLOW = 2, // 2us blits instead of 1us + CONTROLBYTE_DST_STRIDE_256 = 1, + CONTROLBYTE_SRC_STRIDE_256 = 0 + }; + + required_device m_cpu; + required_shared_ptr m_vram; + optional_region_ptr m_proms; + + void control_w(address_space &space, offs_t offset, u8 data); + inline void blit_pixel(address_space &space, int dstaddr, int srcdata); + int blit_core(address_space &space, int w, int h); + + u16 m_clip_address; + u8 m_window_enable; + u8 m_control; + bool m_no_even; + bool m_no_odd; + bool m_solid; + bool m_fg_only; + u8 m_solid_color; + u16 m_sstart; + u16 m_dstart; + u8 m_width; + u8 m_height; + u8 m_size_xor; + u8 m_remap_index; + const u8 *m_remap; + std::unique_ptr m_remap_lookup; +}; + +class williams_blitter_sc1_device : public williams_blitter_device { +public: + template + williams_blitter_sc1_device(const machine_config &mconfig, const char *tag, device_t *owner, u16 clip_address, T &&cpu_tag, U &&vram_tag) + : williams_blitter_sc1_device(mconfig, tag, owner) + { + set_size_xor(4); + set_clip_address(clip_address); + set_cpu_tag(std::forward(cpu_tag)); + set_vram_tag(std::forward(vram_tag)); + } + + template + williams_blitter_sc1_device(const machine_config &mconfig, const char *tag, device_t *owner, u16 clip_address, T &&cpu_tag, U &&vram_tag, V &&proms_tag) + : williams_blitter_sc1_device(mconfig, tag, owner) + { + set_size_xor(4); + set_clip_address(clip_address); + set_cpu_tag(std::forward(cpu_tag)); + set_vram_tag(std::forward(vram_tag)); + set_proms_tag(std::forward(proms_tag)); + } + + williams_blitter_sc1_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock = 0); +}; + +class williams_blitter_sc2_device : public williams_blitter_device { +public: + template + williams_blitter_sc2_device(const machine_config &mconfig, const char *tag, device_t *owner, u16 clip_address, T &&cpu_tag, U &&vram_tag) + : williams_blitter_sc2_device(mconfig, tag, owner) + { + set_size_xor(0); + set_clip_address(clip_address); + set_cpu_tag(std::forward(cpu_tag)); + set_vram_tag(std::forward(vram_tag)); + } + + template + williams_blitter_sc2_device(const machine_config &mconfig, const char *tag, device_t *owner, u16 clip_address, T &&cpu_tag, U &&vram_tag, V &&proms_tag) + : williams_blitter_sc2_device(mconfig, tag, owner) + { + set_size_xor(0); + set_clip_address(clip_address); + set_cpu_tag(std::forward(cpu_tag)); + set_vram_tag(std::forward(vram_tag)); + set_proms_tag(std::forward(proms_tag)); + } + + williams_blitter_sc2_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock = 0); +}; + +DECLARE_DEVICE_TYPE(WILLIAMS_BLITTER_SC1, williams_blitter_sc1_device) +DECLARE_DEVICE_TYPE(WILLIAMS_BLITTER_SC2, williams_blitter_sc2_device) + +#endif // MAME_MIDWAY_WILLIAMSBLITTER_H diff --git a/src/mame/midway/wmg.cpp b/src/mame/midway/wmg.cpp index e5fc3178958..0a7cf9e787d 100644 --- a/src/mame/midway/wmg.cpp +++ b/src/mame/midway/wmg.cpp @@ -148,7 +148,7 @@ void wmg_state::wmg_cpu1(address_map &map) m_io_view[0](0xc804, 0xc807).r(FUNC(wmg_state::wmg_pia_0_r)).w(m_pia[0], FUNC(pia6821_device::write)); m_io_view[0](0xc80c, 0xc80f).rw(m_pia[1], FUNC(pia6821_device::read), FUNC(pia6821_device::write)); m_io_view[0](0xc900, 0xc9ff).nopr().w(FUNC(wmg_state::wmg_vram_select_w)); - m_io_view[0](0xca00, 0xca07).w(FUNC(wmg_state::blitter_w)); + m_io_view[0](0xca00, 0xca07).m(m_blitter, FUNC(williams_blitter_device::map)); m_io_view[0](0xcb00, 0xcbff).r(FUNC(wmg_state::video_counter_r)); m_io_view[0](0xcbff, 0xcbff).w(FUNC(wmg_state::watchdog_reset_w)); m_io_view[0](0xcc00, 0xcfff).bankrw(m_nvrambank); @@ -539,8 +539,7 @@ void wmg_state::wmg(machine_config &config) pia2.irqa_handler().set("soundirq", FUNC(input_merger_any_high_device::in_w<0>)); pia2.irqb_handler().set("soundirq", FUNC(input_merger_any_high_device::in_w<1>)); - m_blitter_config = WILLIAMS_BLITTER_SC1; - m_blitter_clip_address = 0xc000; + WILLIAMS_BLITTER_SC1(config, m_blitter, 0xc000, m_maincpu, m_videoram); } /************************************* diff --git a/src/mame/misc/belatra.cpp b/src/mame/misc/belatra.cpp index d33a838458c..35740ac9622 100644 --- a/src/mame/misc/belatra.cpp +++ b/src/mame/misc/belatra.cpp @@ -7,8 +7,38 @@ SoC is suspected to be an ARM7500 or similar. +The following hardware description comes from PCB with "GS Unterhaltungssysteme Vertriebs- & Produktions GmbH" sticker. +However they were probably only the distributor. The hardware is currently believed to be the same or cloned: + +ULN2803A: DD5 & DD6 & DD4 +MM74HC273: DD1, DD2, DD3 +MM74HC244: DD7, DD8, DD9, DD10 +DS1309: DD14 +PALCE16V8: DD21 +V62C518256L: DD13 +29F160: DD11, DD12 +CL-PS7500FE56QC: DD15 +74AC04: DD19 +EPSON 11.0592: DD17 +EPSON 56.0000: DD18 +CS4334K: DA1 +ADM691AR 0228 138074.1: DD20 +AT90S2313-10PI: DD16 +ADM208EAR 0230 140807.1: DD22 + +RAM-Modul: 8x MT4C4M4E8DJ + +Markings on the board: +CTE 002 94V-0 0245 +002BG358A + +Markings on the RAM-Modul: +MICRON TECHNOLOGY INC. +099 D U.S.A. +4096-43-73 ET + TODO: -- just a skeleton and everything is complete guesswork. +- just a skeleton. */ /* @@ -79,10 +109,11 @@ void belatra_state::program_map(address_map &map) { map(0x00000000, 0x001fffff).rom().region("maincpu", 0x000000); // TODO: implement this as proper flash ROM device map(0x00800000, 0x009fffff).rom().region("maincpu", 0x200000); // " - map(0x03200000, 0x032001ff).m(m_iomd, FUNC(arm7500fe_iomd_device::map)); // TODO: writes to some unimplemented registers - //map(0x03340000, 0x03340003).r; - //map(0x03400000, 0x037fffff).w(m_vidc, FUNC(arm_vidc20_device::write)); - //map(0x08000000, 0x0800000f).r; + map(0x03200000, 0x032001ff).m(m_iomd, FUNC(arm7500fe_iomd_device::map)); // TODO: the games write to adn read from some unimplemented registers + // msecr_r is hardcoded to return 0x80 but these games seem to expect 0x20, too + // map(0x03340000, 0x03340003).lr32(NAME([this] () -> uint32_t { return machine().rand() & 0x01; })); + // map(0x03400000, 0x037fffff).w(m_vidc, FUNC(arm_vidc20_device::write)); + // map(0x08000000, 0x0800000f).r; map(0x10000000, 0x13ffffff).ram(); map(0x14000000, 0x17ffffff).ram(); } @@ -92,7 +123,7 @@ INPUT_PORTS_END void belatra_state::belatra(machine_config &config) { - ARM7500(config, m_maincpu, 54'000'000); // CPU type and clock guessed + ARM7500(config, m_maincpu, 56_MHz_XTAL); m_maincpu->set_addrmap(AS_PROGRAM, &belatra_state::program_map); SCREEN(config, "screen", SCREEN_TYPE_RASTER); @@ -102,7 +133,7 @@ void belatra_state::belatra(machine_config &config) m_vidc->vblank().set(m_iomd, FUNC(arm_iomd_device::vblank_irq)); m_vidc->sound_drq().set(m_iomd, FUNC(arm_iomd_device::sound_drq)); - ARM7500FE_IOMD(config, m_iomd, 54'000'000); // CPU type and clock guessed + ARM7500FE_IOMD(config, m_iomd, 56_MHz_XTAL); m_iomd->set_host_cpu_tag(m_maincpu); m_iomd->set_vidc_tag(m_vidc); m_iomd->iocr_read_od<0>().set([this] () { logerror("%s: IOCR read OD 0\n", machine().describe_context()); return 0; }); @@ -123,59 +154,73 @@ void belatra_state::belatra(machine_config &config) ROM_START( merryjn ) - ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) + ROM_REGION( 0x400000, "maincpu", 0 ) ROM_LOAD( "am29f160bd_mery_up.bin", 0x000000, 0x200000, CRC(475161a5) SHA1(784904ffb949e56cac1126eaacf09db19a51b2f0) ) ROM_LOAD( "am29f160bd_mery_down.bin", 0x200000, 0x200000, CRC(f8b6354c) SHA1(6de6e0c7927d2d673ac3fd5dc1c8263a73dcbb14) ) ROM_END ROM_START( fairyl2 ) - ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) + ROM_REGION( 0x400000, "maincpu", 0 ) ROM_LOAD( "zfl2-1belatra.bin", 0x000000, 0x200000, CRC(cb0f3eba) SHA1(a7776810cfe037c25c196bbe900e5e17a2005d2d) ) ROM_LOAD( "zfl2-2belatra.bin", 0x200000, 0x200000, CRC(755fad4b) SHA1(12243fdf95fcdd9012d1bbde6a18abb00918f560) ) - ROM_REGION( 0x400000, "others", ROMREGION_ERASEFF ) - ROM_LOAD( "at90s2313_fl2.bin", 0x0000, 0x000800, CRC(38e2d37e) SHA1(78178cb3ea219a71d1f15ffde722f9c03ad64dda) ) + ROM_REGION( 0x800, "mcu", 0 ) + ROM_LOAD( "at90s2313_fl2.bin", 0x000, 0x800, CRC(38e2d37e) SHA1(78178cb3ea219a71d1f15ffde722f9c03ad64dda) ) ROM_END ROM_START( fairyl2a ) - ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) + ROM_REGION( 0x400000, "maincpu", 0 ) ROM_LOAD( "fairy_land2_up_original.bin", 0x000000, 0x200000, CRC(e9c24e75) SHA1(c80acfdcab4ed098596cd3f92a38086881344bb2) ) ROM_LOAD( "fairy_land2_dw_original.bin", 0x200000, 0x200000, CRC(9d07818f) SHA1(8427b264ef03379cd6f3fbe4f5e141837ffef6fe) ) ROM_END ROM_START( fairyl2b ) - ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) + ROM_REGION( 0x400000, "maincpu", 0 ) ROM_LOAD( "zfl2-1 china.bin", 0x000000, 0x200000, CRC(3bfd7a0f) SHA1(e67c3fa27e5945de23efb8cb9899bcb23808e4cf) ) ROM_LOAD( "zfl2-2 china.bin", 0x200000, 0x200000, CRC(1e1e172a) SHA1(6fb2eec95947ec7995f9c3c52f26b2c6dd5fd6b9) ) ROM_END ROM_START( fairyl2bl ) - ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) + ROM_REGION( 0x400000, "maincpu", 0 ) ROM_LOAD( "fairy_land2_up_pirate.bin", 0x000000, 0x200000, CRC(e9c24e75) SHA1(c80acfdcab4ed098596cd3f92a38086881344bb2) ) ROM_LOAD( "fairy_land2_dw_pirate.bin", 0x200000, 0x200000, CRC(00bf73d0) SHA1(3fa81815b4bbb5ed4dcd64afa1ad799a5a0bd48e) ) ROM_END ROM_START( ldrink ) - ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) + ROM_REGION( 0x400000, "maincpu", 0 ) ROM_LOAD( "lucky_up.bin", 0x000000, 0x200000, CRC(5d5277cc) SHA1(893369a58ea3ba3c7ba82a4cc4b1ffdbcc6745e2) ) ROM_LOAD( "lucky_down.bin", 0x200000, 0x200000, CRC(e4c5b32a) SHA1(c8c44a7e35bbc88ba271566f8324b71818aa223c) ) ROM_END ROM_START( ldrinka ) - ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) + ROM_REGION( 0x400000, "maincpu", 0 ) ROM_LOAD( "zld-0012534-1belatra.bin", 0x000000, 0x200000, CRC(7a9b1e9f) SHA1(d9c7551b812bda509ba5ade09d2f82a77a5215d3) ) ROM_LOAD( "zld-0012534-2belatra.bin", 0x200000, 0x200000, CRC(e3e74597) SHA1(0157dbf806eb2e5f0c9b9e8ed68d38748a713a6e) ) ROM_END +ROM_START( unkbel ) + ROM_REGION( 0x400000, "maincpu", 0 ) + ROM_LOAD( "29f160.dd11", 0x000000, 0x200000, CRC(cd92dd9d) SHA1(24aee4e3d986750183cb110bb3497da4c8179f73) ) + ROM_LOAD( "29f160.dd12", 0x200000, 0x200000, CRC(d03e57b8) SHA1(557ad08bbc5992f11722c04aba8ff52cf93ffe59) ) // 1xxxxxxxxxxxxxxxxxxxx = 0xFF + + ROM_REGION( 0x800, "mcu", ROMREGION_ERASE00 ) + ROM_LOAD( "at90s2313.dd16", 0x000, 0x800, NO_DUMP ) // protected + + ROM_REGION( 0x117, "plds", ROMREGION_ERASE00 ) + ROM_LOAD( "palce16v8.dd21", 0x000, 0x117, CRC(8bafb445) SHA1(5249747c958e14e622361002fd5bfbb1403f0d67) ) +ROM_END + } // anonymous namespace -GAME( 2004, fairyl2, 0, belatra, belatra, belatra_state, empty_init, ROT0, "Belatra", "Fairy Land 2 (set 1)", MACHINE_IS_SKELETON ) -GAME( 2004, fairyl2a, fairyl2, belatra, belatra, belatra_state, empty_init, ROT0, "Belatra", "Fairy Land 2 (set 2)", MACHINE_IS_SKELETON ) -GAME( 2004, fairyl2b, fairyl2, belatra, belatra, belatra_state, empty_init, ROT0, "Belatra", "Fairy Land 2 (set 3)", MACHINE_IS_SKELETON ) -GAME( 2004, fairyl2bl, fairyl2, belatra, belatra, belatra_state, empty_init, ROT0, "Belatra", "Fairy Land 2 (bootleg)", MACHINE_IS_SKELETON ) +GAME( 2004, fairyl2, 0, belatra, belatra, belatra_state, empty_init, ROT0, "Belatra", "Fairy Land 2 (set 1)", MACHINE_IS_SKELETON ) +GAME( 2004, fairyl2a, fairyl2, belatra, belatra, belatra_state, empty_init, ROT0, "Belatra", "Fairy Land 2 (set 2)", MACHINE_IS_SKELETON ) +GAME( 2004, fairyl2b, fairyl2, belatra, belatra, belatra_state, empty_init, ROT0, "Belatra", "Fairy Land 2 (set 3)", MACHINE_IS_SKELETON ) +GAME( 2004, fairyl2bl, fairyl2, belatra, belatra, belatra_state, empty_init, ROT0, "Belatra", "Fairy Land 2 (bootleg)", MACHINE_IS_SKELETON ) + +GAME( 2004, ldrink, 0, belatra, belatra, belatra_state, empty_init, ROT0, "Belatra", "Lucky Drink (set 1)", MACHINE_IS_SKELETON ) +GAME( 2004, ldrinka, ldrink, belatra, belatra, belatra_state, empty_init, ROT0, "Belatra", "Lucky Drink (set 2)", MACHINE_IS_SKELETON ) -GAME( 2004, ldrink, 0, belatra, belatra, belatra_state, empty_init, ROT0, "Belatra", "Lucky Drink (set 1)", MACHINE_IS_SKELETON ) -GAME( 2004, ldrinka, ldrink, belatra, belatra, belatra_state, empty_init, ROT0, "Belatra", "Lucky Drink (set 2)", MACHINE_IS_SKELETON ) +GAME( 2004, merryjn, 0, belatra, belatra, belatra_state, empty_init, ROT0, "Belatra", "Merry Joiner", MACHINE_IS_SKELETON ) -GAME( 2004, merryjn, 0, belatra, belatra, belatra_state, empty_init, ROT0, "Belatra", "Merry Joiner", MACHINE_IS_SKELETON ) +GAME( 200?, unkbel, 0, belatra, belatra, belatra_state, empty_init, ROT0, "Belatra", "unknown Belatra slot machine", MACHINE_IS_SKELETON ) diff --git a/src/mame/cvs/cvs.cpp b/src/mame/misc/cvs.cpp similarity index 81% rename from src/mame/cvs/cvs.cpp rename to src/mame/misc/cvs.cpp index 607849e1038..4a83026e57f 100644 --- a/src/mame/cvs/cvs.cpp +++ b/src/mame/misc/cvs.cpp @@ -24,6 +24,8 @@ MAIN BOARD: * Note the upper two address lines are latched using an I/O read. The I/O map only has space for 128 character bit maps +None of the games use the 2636 sound. + The CPU CANNOT read the character PROMs ------ @@ -81,59 +83,79 @@ Driver by Mike Coates Hardware Info - Malcolm & Darren + Malcolm & Darren Additional work - 2009 Couriersud - -Todo & FIXME: + Couriersud, 2009 +TODO: - Emulate protection properly in later games (reads area 0x73fx); -- Superbike hangs indefinitely when collecting balloon bonus the - second time around, protection or s2650 core bug? -- the board most probably has discrete circuits. The 393Hz tone used - for shots (superbike) and collisions (8ball) is just a guess. +- The board most probably has discrete circuits. Possibly 2 beepers (current + frequency is completely guessed), and a pitch sweep sound. +- Is the star generator correct? On photos, it looks like there are more stars + overall (higher star density). ***************************************************************************/ #include "emu.h" -#include "cvs_base.h" +#include "cpu/s2650/s2650.h" +#include "machine/gen_latch.h" +#include "machine/s2636.h" +#include "sound/beep.h" +#include "sound/dac.h" +#include "sound/tms5110.h" +#include "emupal.h" +#include "screen.h" #include "speaker.h" -namespace { +// configurable logging +#define LOG_VIDEOFX (1U << 1) +#define LOG_SPEECH (1U << 2) +#define LOG_4BITDAC (1U << 3) +#define LOG_SHTRIGGER (1U << 4) -/* Turn to 1 so all inputs are always available (this shall only be a debug feature) */ -#define CVS_SHOW_ALL_INPUTS 0 +//#define VERBOSE (LOG_VIDEOFX) +#include "logmacro.h" + +// Turn to 1 so all inputs are always available (this shall only be a debug feature) +#define CVS_SHOW_ALL_INPUTS 0 -#define VERBOSE 0 -#define LOG(x) do { if (VERBOSE) logerror x; } while (0) +namespace { -class cvs_state : public cvs_base_state +class cvs_state : public driver_device { public: cvs_state(const machine_config &mconfig, device_type type, const char *tag) - : cvs_base_state(mconfig, type, tag) - , m_palette_ram(*this, "palette_ram", 0x10, ENDIANNESS_BIG) - , m_character_ram(*this, "character_ram", 3 * 0x800, ENDIANNESS_BIG) - , m_4_bit_dac_data(*this, "4bit_dac") - , m_tms5110_ctl_data(*this, "tms5110_ctl") - , m_dac3_state(*this, "dac3_state") - , m_speech_data_rom(*this, "speechdata") + : driver_device(mconfig, type, tag) + , m_maincpu(*this, "maincpu") , m_audiocpu(*this, "audiocpu") , m_speechcpu(*this, "speechcpu") + , m_s2636(*this, "s2636_%u", 0U) + , m_gfxdecode(*this, "gfxdecode") + , m_screen(*this, "screen") + , m_palette(*this, "palette") , m_dac2(*this, "dac2") - , m_dac3(*this, "dac3") + , m_beep(*this, "beep%u", 0) , m_tms5110(*this, "tms") , m_soundlatch(*this, "soundlatch") , m_in(*this, "IN%u", 0U) - , m_dsw2(*this, "DSW2") - , m_dsw3(*this, "DSW3") + , m_dsw(*this, "DSW%u", 1U) , m_lamps(*this, "lamp%u", 1U) + , m_video_ram(*this, "video_ram", 0x400, ENDIANNESS_BIG) + , m_color_ram(*this, "color_ram", 0x400, ENDIANNESS_BIG) + , m_palette_ram(*this, "palette_ram", 0x10, ENDIANNESS_BIG) + , m_character_ram(*this, "character_ram", 3 * 0x800, ENDIANNESS_BIG) + , m_bullet_ram(*this, "bullet_ram") + , m_4_bit_dac_data(*this, "4bit_dac") + , m_tms5110_ctl_data(*this, "tms5110_ctl") + , m_sh_trigger(*this, "sh_trigger") + , m_speech_data_rom(*this, "speechdata") + , m_ram_view(*this, "video_color_ram_view") { } void init_raiders() ATTR_COLD; @@ -148,80 +170,109 @@ class cvs_state : public cvs_base_state virtual void machine_start() override ATTR_COLD; virtual void machine_reset() override ATTR_COLD; virtual void video_start() override ATTR_COLD; + virtual void device_post_load() override { m_gfxdecode->gfx(1)->mark_all_dirty(); } private: - // memory pointers - memory_share_creator m_palette_ram; - memory_share_creator m_character_ram; /* only half is used, but - by allocating twice the amount, - we can use the same gfx_layout */ - required_shared_ptr m_4_bit_dac_data; - required_shared_ptr m_tms5110_ctl_data; - required_shared_ptr m_dac3_state; - required_region_ptr m_speech_data_rom; - - bitmap_ind16 m_background_bitmap = 0; - bitmap_ind16 m_scrolled_collision_background = 0; - uint8_t m_stars_on = 0U; - uint8_t m_scroll_reg = 0U; - - // misc - uint8_t m_protection_counter = 0U; - emu_timer *m_393hz_timer = nullptr; - uint8_t m_393hz_clock = 0U; - - uint16_t m_character_ram_page_start = 0U; - uint8_t m_character_banking_mode = 0U; - uint16_t m_speech_rom_bit_address = 0U; + // max stars is more than it needs to be, to allow experimenting with the star generator + static constexpr u16 MAX_STARS = 0x400; + static constexpr u16 SPRITE_PEN_BASE = 0x820; + static constexpr u16 BULLET_STAR_PEN = 0x828; // devices + required_device m_maincpu; required_device m_audiocpu; required_device m_speechcpu; + required_device_array m_s2636; + required_device m_gfxdecode; + required_device m_screen; + required_device m_palette; required_device m_dac2; - required_device m_dac3; + required_device_array m_beep; required_device m_tms5110; required_device m_soundlatch; required_ioport_array<4> m_in; - required_ioport m_dsw2; - required_ioport m_dsw3; + required_ioport_array<3> m_dsw; output_finder<2> m_lamps; - uint8_t huncholy_prot_r(offs_t offset); - uint8_t superbik_prot_r(); - uint8_t hero_prot_r(offs_t offset); - int speech_rom_read_bit(); - void slave_cpu_interrupt(int state); - uint8_t input_r(offs_t offset); - void speech_rom_address_lo_w(uint8_t data); - void speech_rom_address_hi_w(uint8_t data); - uint8_t speech_command_r(); - void audio_command_w(uint8_t data); - uint8_t palette_r(offs_t offset) { return m_palette_ram[offset & 0x0f]; } - void palette_w(offs_t offset, uint8_t data) { m_palette_ram[offset & 0x0f] = data; } - void video_fx_w(uint8_t data); - void scroll_w(uint8_t data); - void _4_bit_dac_data_w(offs_t offset, uint8_t data); - void unknown_w(offs_t offset, uint8_t data); - void tms5110_ctl_w(offs_t offset, uint8_t data); - void tms5110_pdc_w(offs_t offset, uint8_t data); - TIMER_CALLBACK_MEMBER(_393hz_timer_cb); - void start_393hz_timer() ATTR_COLD; - void palette(palette_device &palette) const ATTR_COLD; - uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - INTERRUPT_GEN_MEMBER(main_cpu_interrupt); - void set_pens(); - void dac_cpu_map(address_map &map) ATTR_COLD; + // memory + memory_share_creator m_video_ram; + memory_share_creator m_color_ram; + memory_share_creator m_palette_ram; + memory_share_creator m_character_ram; // only half is used, but we can use the same gfx_layout like this + required_shared_ptr m_bullet_ram; + required_shared_ptr m_4_bit_dac_data; + required_shared_ptr m_tms5110_ctl_data; + required_shared_ptr m_sh_trigger; + required_region_ptr m_speech_data_rom; + + memory_view m_ram_view; + + // misc + u8 m_protection_counter = 0; + u16 m_character_ram_page_start = 0; + u8 m_character_banking_mode = 0; + u16 m_speech_rom_bit_address = 0; + + bitmap_ind16 m_background_bitmap = 0; + bitmap_ind16 m_collision_background; + bitmap_ind16 m_scrolled_collision_background = 0; + u8 m_scroll_reg = 0; + u8 m_collision = 0; + + // stars + u8 m_stars_on = false; + u16 m_stars_scroll = 0; + u16 m_total_stars = 0; + + struct star_t + { + u16 x = 0; + u16 y = 0; + }; + star_t m_stars[MAX_STARS]; + + void audio_cpu_map(address_map &map) ATTR_COLD; void main_cpu_data_map(address_map &map) ATTR_COLD; void main_cpu_io_map(address_map &map) ATTR_COLD; void main_cpu_map(address_map &map) ATTR_COLD; void speech_cpu_map(address_map &map) ATTR_COLD; - template uint8_t character_ram_r(offs_t offset); - template void character_ram_w(offs_t offset, uint8_t data); -}; + void palette(palette_device &palette) const ATTR_COLD; + void set_pens(); + u32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + void video_fx_w(u8 data); + void scroll_w(u8 data); + u8 collision_r(); + u8 collision_clear_r(); + + void init_stars() ATTR_COLD; + void update_stars(bitmap_ind16 &bitmap, const rectangle &cliprect); + void scroll_stars(int state); + + template u8 character_ram_r(offs_t offset); + template void character_ram_w(offs_t offset, u8 data); + u8 palette_r(offs_t offset) { return m_palette_ram[offset & 0x0f]; } + void palette_w(offs_t offset, u8 data) { m_palette_ram[offset & 0x0f] = data; } + void audio_cpu_interrupt(int state); + void main_cpu_interrupt(int state); + u8 input_r(offs_t offset); + + void _4_bit_dac_data_w(offs_t offset, u8 data); + void sh_trigger_w(offs_t offset, u8 data); + + void speech_rom_address_lo_w(u8 data); + void speech_rom_address_hi_w(u8 data); + u8 speech_command_r(); + void audio_command_w(u8 data); + void tms5110_ctl_w(offs_t offset, u8 data); + void tms5110_pdc_w(offs_t offset, u8 data); + int speech_rom_read_bit(); + + u8 superbik_prot_r(); + u8 hero_prot_r(offs_t offset); + u8 huncholy_prot_r(offs_t offset); +}; -static constexpr uint16_t SPRITE_PEN_BASE = 0x820; -static constexpr uint16_t BULLET_STAR_PEN = 0x828; /****************************************************** @@ -235,14 +286,14 @@ static constexpr uint16_t BULLET_STAR_PEN = 0x828; void cvs_state::palette(palette_device &palette) const { - uint8_t const *const color_prom = memregion("proms")->base(); + u8 const *const color_prom = memregion("proms")->base(); // color mapping PROM for (int attr = 0; attr < 0x100; attr++) { for (int i = 0; i < 8; i++) { - uint8_t ctabentry = color_prom[(i << 8) | attr] & 0x07; + u8 ctabentry = color_prom[(i << 8) | attr] & 0x07; // bits 0 and 2 are swapped ctabentry = bitswap<8>(ctabentry, 7, 6, 5, 4, 3, 0, 1, 2); @@ -282,36 +333,52 @@ void cvs_state::set_pens() } - -void cvs_state::video_fx_w(uint8_t data) +void cvs_state::video_fx_w(u8 data) { if (data & 0xce) - logerror("%4x : CVS: Unimplemented CVS video fx = %2x\n", m_maincpu->pc(), data & 0xce); + LOGMASKED(LOG_VIDEOFX, "%04x: Unimplemented CVS video fx = %2x\n", m_maincpu->pc(), data & 0xce); - m_stars_on = data & 0x01; + m_stars_on = bool(data & 0x01); - if (data & 0x02) logerror(" SHADE BRIGHTER TO RIGHT\n"); - if (data & 0x04) logerror(" SCREEN ROTATE\n"); - if (data & 0x08) logerror(" SHADE BRIGHTER TO LEFT\n"); + if (data & 0x02) LOGMASKED(LOG_VIDEOFX, " SHADE BRIGHTER TO RIGHT\n"); + if (data & 0x04) LOGMASKED(LOG_VIDEOFX, " SCREEN ROTATE\n"); + if (data & 0x08) LOGMASKED(LOG_VIDEOFX, " SHADE BRIGHTER TO LEFT\n"); m_lamps[0] = BIT(data, 4); m_lamps[1] = BIT(data, 5); - if (data & 0x40) logerror(" SHADE BRIGHTER TO BOTTOM\n"); - if (data & 0x80) logerror(" SHADE BRIGHTER TO TOP\n"); + if (data & 0x40) LOGMASKED(LOG_VIDEOFX, " SHADE BRIGHTER TO BOTTOM\n"); + if (data & 0x80) LOGMASKED(LOG_VIDEOFX, " SHADE BRIGHTER TO TOP\n"); } -void cvs_state::scroll_w(uint8_t data) +void cvs_state::scroll_w(u8 data) { m_scroll_reg = 255 - data; } +u8 cvs_state::collision_r() +{ + return m_collision; +} + +u8 cvs_state::collision_clear_r() +{ + if (!machine().side_effects_disabled()) + m_collision = 0; + return 0; +} + + void cvs_state::video_start() { init_stars(); + // cosmos relies on non-0 initial character RAM for the title screen + for (int i = 0; i < 0x1800; i++) + m_character_ram[i | 0x400] = 0xff; + // create helper bitmaps m_screen->register_screen_bitmap(m_background_bitmap); m_screen->register_screen_bitmap(m_collision_background); @@ -324,7 +391,67 @@ void cvs_state::video_start() } -uint32_t cvs_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) + +/************************************* + * + * Stars + * + *************************************/ + +void cvs_state::init_stars() +{ + u32 generator = 0; + m_total_stars = 0; + + // precalculate the star background + for (int y = 255; y >= 0; y--) + { + for (int x = 511; x >= 0; x--) + { + generator <<= 1; + generator |= BIT(~generator, 17) ^ BIT(generator, 5); + + if ((generator & 0x130fe) == 0xfe && m_total_stars != MAX_STARS) + { + m_stars[m_total_stars].x = x; + m_stars[m_total_stars].y = y; + + m_total_stars++; + } + } + } +} + +void cvs_state::update_stars(bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + for (int offs = 0; offs < m_total_stars; offs++) + { + u8 x = (m_stars[offs].x + m_stars_scroll) >> 1; + u8 y = m_stars[offs].y + ((m_stars_scroll + m_stars[offs].x) >> 9); + + if (BIT(y, 0) ^ BIT(x, 4)) + { + if (cliprect.contains(x, y) && m_palette->pen_indirect(bitmap.pix(y, x)) == 0) + bitmap.pix(y, x) = BULLET_STAR_PEN; + } + } +} + +void cvs_state::scroll_stars(int state) +{ + if (state) + m_stars_scroll++; +} + + + +/************************************* + * + * Display refresh + * + *************************************/ + +u32 cvs_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { static const int ram_based_char_start_indices[] = { 0xe0, 0xc0, 0x100, 0x80 }; @@ -334,11 +461,11 @@ uint32_t cvs_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, c for (offs_t offs = 0; offs < 0x0400; offs++) { int collision_color = 0x100; - uint8_t const code = m_video_ram[offs]; - uint8_t const color = m_color_ram[offs]; + u8 const code = m_video_ram[offs]; + u8 const color = m_color_ram[offs]; - uint8_t const x = offs << 3; - uint8_t const y = offs >> 5 << 3; + u8 const x = offs << 3; + u8 const y = offs >> 5 << 3; int const gfxnum = (code < ram_based_char_start_indices[m_character_banking_mode]) ? 0 : 1; @@ -364,7 +491,6 @@ uint32_t cvs_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, c x, y); } - // Update screen - 8 regions, fixed scrolling area int scroll[8]; @@ -394,22 +520,24 @@ uint32_t cvs_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, c { int const bx = 255 - 7 - m_bullet_ram[offs] - ct; - // Bullet/Object Collision - if ((s2636_0_bitmap.pix(offs, bx) != 0) || - (s2636_1_bitmap.pix(offs, bx) != 0) || - (s2636_2_bitmap.pix(offs, bx) != 0)) - m_collision_register |= 0x08; + if (cliprect.contains(bx, offs)) + { + // Bullet/Object Collision + if ((s2636_0_bitmap.pix(offs, bx) != 0) || + (s2636_1_bitmap.pix(offs, bx) != 0) || + (s2636_2_bitmap.pix(offs, bx) != 0)) + m_collision |= 0x08; - // Bullet/Background Collision - if (m_palette->pen_indirect(m_scrolled_collision_background.pix(offs, bx))) - m_collision_register |= 0x80; + // Bullet/Background Collision + if (m_palette->pen_indirect(m_scrolled_collision_background.pix(offs, bx))) + m_collision |= 0x80; - bitmap.pix(offs, bx) = BULLET_STAR_PEN; + bitmap.pix(offs, bx) = BULLET_STAR_PEN; + } } } } - // mix and copy the S2636 images into the main bitmap, also check for collision for (int y = cliprect.top(); y <= cliprect.bottom(); y++) { @@ -426,16 +554,16 @@ uint32_t cvs_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, c bitmap.pix(y, x) = SPRITE_PEN_BASE + S2636_PIXEL_COLOR(pixel); // S2636 vs. S2636 collision detection - if (S2636_IS_PIXEL_DRAWN(pixel0) && S2636_IS_PIXEL_DRAWN(pixel1)) m_collision_register |= 0x01; - if (S2636_IS_PIXEL_DRAWN(pixel1) && S2636_IS_PIXEL_DRAWN(pixel2)) m_collision_register |= 0x02; - if (S2636_IS_PIXEL_DRAWN(pixel0) && S2636_IS_PIXEL_DRAWN(pixel2)) m_collision_register |= 0x04; + if (S2636_IS_PIXEL_DRAWN(pixel0) && S2636_IS_PIXEL_DRAWN(pixel1)) m_collision |= 0x01; + if (S2636_IS_PIXEL_DRAWN(pixel1) && S2636_IS_PIXEL_DRAWN(pixel2)) m_collision |= 0x02; + if (S2636_IS_PIXEL_DRAWN(pixel0) && S2636_IS_PIXEL_DRAWN(pixel2)) m_collision |= 0x04; // S2636 vs. background collision detection if (m_palette->pen_indirect(m_scrolled_collision_background.pix(y, x))) { - if (S2636_IS_PIXEL_DRAWN(pixel0)) m_collision_register |= 0x10; - if (S2636_IS_PIXEL_DRAWN(pixel1)) m_collision_register |= 0x20; - if (S2636_IS_PIXEL_DRAWN(pixel2)) m_collision_register |= 0x40; + if (S2636_IS_PIXEL_DRAWN(pixel0)) m_collision |= 0x10; + if (S2636_IS_PIXEL_DRAWN(pixel1)) m_collision |= 0x20; + if (S2636_IS_PIXEL_DRAWN(pixel2)) m_collision |= 0x40; } } } @@ -443,26 +571,27 @@ uint32_t cvs_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, c // stars circuit if (m_stars_on) - update_stars(bitmap, cliprect, BULLET_STAR_PEN, 0); + update_stars(bitmap, cliprect); return 0; } + /************************************* * * Multiplexed memory access * *************************************/ -template -uint8_t cvs_state::character_ram_r(offs_t offset) +template +u8 cvs_state::character_ram_r(offs_t offset) { return m_character_ram[(Which * 0x800) | 0x400 | m_character_ram_page_start | offset]; } -template -void cvs_state::character_ram_w(offs_t offset, uint8_t data) +template +void cvs_state::character_ram_w(offs_t offset, u8 data) { offset |= (Which * 0x800) | 0x400 | m_character_ram_page_start; m_character_ram[offset] = data; @@ -477,15 +606,13 @@ void cvs_state::character_ram_w(offs_t offset, uint8_t data) * *************************************/ -INTERRUPT_GEN_MEMBER(cvs_state::main_cpu_interrupt) +void cvs_state::main_cpu_interrupt(int state) { - m_maincpu->pulse_input_line(0, m_maincpu->minimum_quantum_time()); - - scroll_start(); + if (state) + m_maincpu->pulse_input_line(0, m_maincpu->minimum_quantum_time()); } - -void cvs_state::slave_cpu_interrupt(int state) +void cvs_state::audio_cpu_interrupt(int state) { m_audiocpu->set_input_line(0, state ? ASSERT_LINE : CLEAR_LINE); } @@ -498,9 +625,9 @@ void cvs_state::slave_cpu_interrupt(int state) * *************************************/ -uint8_t cvs_state::input_r(offs_t offset) +u8 cvs_state::input_r(offs_t offset) { - uint8_t ret = 0; + u8 ret = 0; // the upper 4 bits of the address is used to select the character banking attributes m_character_banking_mode = (offset >> 4) & 0x03; @@ -513,8 +640,8 @@ uint8_t cvs_state::input_r(offs_t offset) case 0x02: ret = m_in[1]->read(); break; case 0x03: ret = m_in[2]->read(); break; case 0x04: ret = m_in[3]->read(); break; - case 0x06: ret = m_dsw3->read(); break; - case 0x07: ret = m_dsw2->read(); break; + case 0x06: ret = m_dsw[2]->read(); break; + case 0x07: ret = m_dsw[1]->read(); break; default: logerror("%04x : CVS: Reading unmapped input port 0x%02x\n", m_maincpu->pc(), offset & 0x0f); break; } @@ -523,102 +650,76 @@ uint8_t cvs_state::input_r(offs_t offset) -/************************************* - * - * Timing - * - *************************************/ -#if 0 -int cvs_state::cvs_393hz_clock_r() -{ - return m_393hz_clock; -} -#endif - -TIMER_CALLBACK_MEMBER(cvs_state::_393hz_timer_cb) -{ - m_393hz_clock = !m_393hz_clock; - - if (m_dac3_state[2]) - m_dac3->write(m_393hz_clock); -} - - -void cvs_state::start_393hz_timer() -{ - m_393hz_timer = timer_alloc(FUNC(cvs_state::_393hz_timer_cb), this); - m_393hz_timer->adjust(attotime::from_hz(30*393), 0, attotime::from_hz(30*393)); -} - - - /************************************* * * 4-bit DAC * *************************************/ -void cvs_state::_4_bit_dac_data_w(offs_t offset, uint8_t data) +void cvs_state::_4_bit_dac_data_w(offs_t offset, u8 data) { - static int old_data[4] = {0,0,0,0}; + data = BIT(data, 7); - if (data != old_data[offset]) + if (data != m_4_bit_dac_data[offset]) { - LOG(("4BIT: %02x %02x\n", offset, data)); - old_data[offset] = data; + LOGMASKED(LOG_4BITDAC, "4BIT: %d %d\n", offset, data); + m_4_bit_dac_data[offset] = data; } - m_4_bit_dac_data[offset] = data >> 7; // merge into D0-D3 - uint8_t const dac_value = (m_4_bit_dac_data[0] << 0) | - (m_4_bit_dac_data[1] << 1) | - (m_4_bit_dac_data[2] << 2) | - (m_4_bit_dac_data[3] << 3); + u8 const dac_value = (m_4_bit_dac_data[0] << 0) | + (m_4_bit_dac_data[1] << 1) | + (m_4_bit_dac_data[2] << 2) | + (m_4_bit_dac_data[3] << 3); // output m_dac2->write(dac_value); } -void cvs_state::unknown_w(offs_t offset, uint8_t data) +void cvs_state::sh_trigger_w(offs_t offset, u8 data) { - /* offset 2 is used in 8ball - * offset 0 is used in spacefrt - * offset 3 is used in darkwar + /* offset 0 is used in darkwar, spacefrt, logger, raiders + * offset 2 is used in darkwar, spacefrt, 8ball, superbik, raiders + * offset 3 is used in cosmos, darkwar, superbik, raiders * - * offset 1 is not used (no trace in disassembly) + * offset 1 is only used inadvertedly by logger */ - if (data != m_dac3_state[offset]) + data &= 1; + + if (data != m_sh_trigger[offset]) { - if (VERBOSE && offset != 2) - popmessage("Unknown: %02x %02x\n", offset, data); - m_dac3_state[offset] = data; + LOGMASKED(LOG_SHTRIGGER, "TRIG: %d %d\n", offset, data); + m_sh_trigger[offset] = data; } + + if (offset == 2 || offset == 3) + m_beep[offset & 1]->set_state(data); } + /************************************* * * Speech hardware * *************************************/ - -void cvs_state::speech_rom_address_lo_w(uint8_t data) +void cvs_state::speech_rom_address_lo_w(u8 data) { // assuming that d0-d2 are cleared here m_speech_rom_bit_address = (m_speech_rom_bit_address & 0xf800) | (data << 3); - LOG(("%04x : CVS: Speech Lo %02x Address = %04x\n", m_speechcpu->pc(), data, m_speech_rom_bit_address >> 3)); + LOGMASKED(LOG_SPEECH, "%04x : CVS: Speech Lo %02x Address = %04x\n", m_speechcpu->pc(), data, m_speech_rom_bit_address >> 3); } -void cvs_state::speech_rom_address_hi_w(uint8_t data) +void cvs_state::speech_rom_address_hi_w(u8 data) { m_speech_rom_bit_address = (m_speech_rom_bit_address & 0x07ff) | (data << 11); - LOG(("%04x : CVS: Speech Hi %02x Address = %04x\n", m_speechcpu->pc(), data, m_speech_rom_bit_address >> 3)); + LOGMASKED(LOG_SPEECH, "%04x : CVS: Speech Hi %02x Address = %04x\n", m_speechcpu->pc(), data, m_speech_rom_bit_address >> 3); } -uint8_t cvs_state::speech_command_r() +u8 cvs_state::speech_command_r() { /* FIXME: this was by observation on board ??? * -bit 7 is TMS status (active LO) */ @@ -626,27 +727,27 @@ uint8_t cvs_state::speech_command_r() } -void cvs_state::tms5110_ctl_w(offs_t offset, uint8_t data) +void cvs_state::tms5110_ctl_w(offs_t offset, u8 data) { /* * offset 0: CS ? */ m_tms5110_ctl_data[offset] = (~data >> 7) & 0x01; - uint8_t const ctl = 0 | // CTL1 - (m_tms5110_ctl_data[1] << 1) | // CTL2 - (m_tms5110_ctl_data[2] << 2) | // CTL4 - (m_tms5110_ctl_data[1] << 3); // CTL8 + u8 const ctl = 0 | // CTL1 + (m_tms5110_ctl_data[1] << 1) | // CTL2 + (m_tms5110_ctl_data[2] << 2) | // CTL4 + (m_tms5110_ctl_data[1] << 3); // CTL8 - LOG(("CVS: Speech CTL = %04x %02x %02x\n", ctl, offset, data)); + LOGMASKED(LOG_SPEECH, "CVS: Speech CTL = %04x %02x %02x\n", ctl, offset, data); m_tms5110->ctl_w(ctl); } -void cvs_state::tms5110_pdc_w(offs_t offset, uint8_t data) +void cvs_state::tms5110_pdc_w(offs_t offset, u8 data) { - uint8_t const out = ((~data) >> 7) & 1; - LOG(("CVS: Speech PDC = %02x %02x\n", offset, out)); + u8 const out = ((~data) >> 7) & 1; + LOGMASKED(LOG_SPEECH, "CVS: Speech PDC = %02x %02x\n", offset, out); m_tms5110->pdc_w(out); } @@ -664,18 +765,19 @@ int cvs_state::speech_rom_read_bit() } + /************************************* * * Inter-CPU communications * *************************************/ -void cvs_state::audio_command_w(uint8_t data) +void cvs_state::audio_command_w(u8 data) { - LOG(("data %02x\n", data)); + //LOG(("data %02x\n", data)); // cause interrupt on audio CPU if bit 7 set m_soundlatch->write(data); - slave_cpu_interrupt(data & 0x80 ? 1 : 0); + audio_cpu_interrupt(data & 0x80 ? 1 : 0); } @@ -688,7 +790,6 @@ void cvs_state::audio_command_w(uint8_t data) void cvs_state::main_cpu_map(address_map &map) { - map.global_mask(0x7fff); map(0x0000, 0x13ff).rom(); map(0x1400, 0x1bff).mirror(0x6000).view(m_ram_view); m_ram_view[0](0x1400, 0x14ff).ram().share(m_bullet_ram); @@ -715,16 +816,18 @@ void cvs_state::main_cpu_io_map(address_map &map) void cvs_state::main_cpu_data_map(address_map &map) { map(S2650_CTRL_PORT, S2650_CTRL_PORT).rw(FUNC(cvs_state::collision_r), FUNC(cvs_state::audio_command_w)); - map(S2650_DATA_PORT, S2650_DATA_PORT).rw(FUNC(cvs_state::collision_clear), FUNC(cvs_state::video_fx_w)); + map(S2650_DATA_PORT, S2650_DATA_PORT).rw(FUNC(cvs_state::collision_clear_r), FUNC(cvs_state::video_fx_w)); } + + /************************************* * * DAC driving CPU memory/IO handlers * *************************************/ -void cvs_state::dac_cpu_map(address_map &map) +void cvs_state::audio_cpu_map(address_map &map) { map.global_mask(0x7fff); map(0x0000, 0x0fff).rom(); @@ -732,7 +835,7 @@ void cvs_state::dac_cpu_map(address_map &map) map(0x1800, 0x1800).r(m_soundlatch, FUNC(generic_latch_8_device::read)); map(0x1840, 0x1840).w("dac1", FUNC(dac_byte_interface::data_w)); map(0x1880, 0x1883).w(FUNC(cvs_state::_4_bit_dac_data_w)).share(m_4_bit_dac_data); - map(0x1884, 0x1887).w(FUNC(cvs_state::unknown_w)).share(m_dac3_state); // ???? not connected to anything + map(0x1884, 0x1887).w(FUNC(cvs_state::sh_trigger_w)).share(m_sh_trigger); } @@ -755,6 +858,7 @@ void cvs_state::speech_cpu_map(address_map &map) } + /************************************* * * Standard CVS port definitions @@ -796,15 +900,8 @@ static INPUT_PORTS_START( cvs ) PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_START("DSW3") - PORT_DIPUNUSED( 0x01, IP_ACTIVE_HIGH ) // can't tell if it's ACTIVE_HIGH or ACTIVE_LOW - PORT_DIPUNUSED( 0x02, IP_ACTIVE_HIGH ) // can't tell if it's ACTIVE_HIGH or ACTIVE_LOW - PORT_DIPUNUSED( 0x04, IP_ACTIVE_HIGH ) // can't tell if it's ACTIVE_HIGH or ACTIVE_LOW - PORT_DIPUNUSED( 0x08, IP_ACTIVE_HIGH ) // can't tell if it's ACTIVE_HIGH or ACTIVE_LOW - PORT_DIPNAME( 0x10, 0x00, DEF_STR( Cabinet ) ) - PORT_DIPSETTING( 0x00, DEF_STR( Upright ) ) - PORT_DIPSETTING( 0x10, DEF_STR( Cocktail ) ) - PORT_DIPUNUSED( 0x20, IP_ACTIVE_HIGH ) // can't tell if it's ACTIVE_HIGH or ACTIVE_LOW + PORT_START("DSW1") + PORT_BIT( 0x0f, IP_ACTIVE_HIGH, IPT_UNKNOWN ) PORT_START("DSW2") PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coin_A ) ) @@ -821,11 +918,27 @@ static INPUT_PORTS_START( cvs ) PORT_DIPSETTING( 0x00, "3" ) PORT_DIPSETTING( 0x10, "5" ) PORT_DIPUNUSED( 0x20, IP_ACTIVE_HIGH ) // can't tell if it's ACTIVE_HIGH or ACTIVE_LOW + + PORT_START("DSW3") + PORT_DIPUNUSED( 0x01, IP_ACTIVE_HIGH ) // can't tell if it's ACTIVE_HIGH or ACTIVE_LOW + PORT_DIPUNUSED( 0x02, IP_ACTIVE_HIGH ) // can't tell if it's ACTIVE_HIGH or ACTIVE_LOW + PORT_DIPUNUSED( 0x04, IP_ACTIVE_HIGH ) // can't tell if it's ACTIVE_HIGH or ACTIVE_LOW + PORT_DIPUNUSED( 0x08, IP_ACTIVE_HIGH ) // can't tell if it's ACTIVE_HIGH or ACTIVE_LOW + PORT_DIPNAME( 0x10, 0x00, DEF_STR( Cabinet ) ) + PORT_DIPSETTING( 0x00, DEF_STR( Upright ) ) + PORT_DIPSETTING( 0x10, DEF_STR( Cocktail ) ) + PORT_DIPUNUSED( 0x20, IP_ACTIVE_HIGH ) // can't tell if it's ACTIVE_HIGH or ACTIVE_LOW INPUT_PORTS_END static INPUT_PORTS_START( cvs_registration ) PORT_INCLUDE(cvs) + PORT_MODIFY("DSW2") + // Told to be "Meter Pulses" but I don't know what this means + PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) ) // has an effect when COIN2 is pressed (when COIN1 is pressed, value always 1) + PORT_DIPSETTING( 0x00, "2" ) + PORT_DIPSETTING( 0x20, "5" ) + PORT_MODIFY("DSW3") PORT_DIPNAME( 0x01, 0x01, "Registration" ) // can't tell what shall be the default value PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) @@ -834,12 +947,6 @@ static INPUT_PORTS_START( cvs_registration ) PORT_DIPSETTING( 0x02, "3" ) PORT_DIPSETTING( 0x00, "10" ) // bits 2 and 3 determine bonus life settings but they might change from game to game - they are sometimes unused - - PORT_MODIFY("DSW2") - // Told to be "Meter Pulses" but I don't know what this means - PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) ) // has an effect when COIN2 is pressed (when COIN1 is pressed, value always 1) - PORT_DIPSETTING( 0x00, "2" ) - PORT_DIPSETTING( 0x20, "5" ) INPUT_PORTS_END @@ -927,6 +1034,8 @@ static INPUT_PORTS_START( 8ball ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) // IPT_BUTTON2 #endif + // DSW2 bit 5 stored at 0x1d93 - code at 0x0858 ('8ball') or 0x08c0 ('8ball1') - read back code at 0x0073 + PORT_MODIFY("DSW3") PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Bonus_Life ) ) PORT_DIPSETTING( 0x0c, "10k only" ) // displays "10000" @@ -936,8 +1045,6 @@ static INPUT_PORTS_START( 8ball ) PORT_DIPNAME( 0x20, 0x00, "Colors" ) // stored at 0x1ed4 - code at 0x0847 ('8ball') or 0x08af ('8ball1') PORT_DIPSETTING( 0x00, "Palette 1" ) // table at 0x0781 ('8ball') or 0x07e9 ('8ball1') - 16 bytes PORT_DIPSETTING( 0x20, "Palette 2" ) // table at 0x0791 ('8ball') or 0x07f9 ('8ball1') - 16 bytes - - // DSW2 bit 5 stored at 0x1d93 - code at 0x0858 ('8ball') or 0x08c0 ('8ball1') - read back code at 0x0073 INPUT_PORTS_END static INPUT_PORTS_START( logger ) @@ -949,6 +1056,8 @@ static INPUT_PORTS_START( logger ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) // IPT_BUTTON2 #endif + // DSW2 bit 5 stored at 0x7da1 - code at 0x6ec7 - read back code at 0x0073 + PORT_MODIFY("DSW3") PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Bonus_Life ) ) PORT_DIPSETTING( 0x0c, "10k only" ) // displays "10000" @@ -956,8 +1065,6 @@ static INPUT_PORTS_START( logger ) PORT_DIPSETTING( 0x04, "40k only" ) // displays "40000" PORT_DIPSETTING( 0x00, "80k only" ) // displays "80000" // DSW3 bit 5 stored at 0x7dc8 - code at 0x6eb6 - not read back - - // DSW2 bit 5 stored at 0x7da1 - code at 0x6ec7 - read back code at 0x0073 INPUT_PORTS_END static INPUT_PORTS_START( dazzler ) @@ -969,14 +1076,14 @@ static INPUT_PORTS_START( dazzler ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) // IPT_BUTTON2 #endif + // DSW2 bit 5 stored at 0x7d9c - code at 0x6b51 - read back code at 0x0099 + PORT_MODIFY("DSW3") PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Bonus_Life ) ) PORT_DIPSETTING( 0x0c, "10k only" ) // displays "10000" PORT_DIPSETTING( 0x04, "20k only" ) // displays "20000" PORT_DIPSETTING( 0x08, "40k only" ) // displays "40000" PORT_DIPSETTING( 0x00, "80k only" ) // displays "80000" - - // DSW2 bit 5 stored at 0x7d9c - code at 0x6b51 - read back code at 0x0099 INPUT_PORTS_END static INPUT_PORTS_START( wallst ) @@ -988,14 +1095,14 @@ static INPUT_PORTS_START( wallst ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) // IPT_BUTTON2 #endif + // DSW2 bit 5 stored at 0x1e95 - code at 0x1232 - read back code at 0x6054 + PORT_MODIFY("DSW3") PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Bonus_Life ) ) PORT_DIPSETTING( 0x0c, "10k only" ) // displays "10000" PORT_DIPSETTING( 0x04, "20k only" ) // displays "20000" PORT_DIPSETTING( 0x08, "40k only" ) // displays "40000" PORT_DIPSETTING( 0x00, "80k only" ) // displays "80000" - - // DSW2 bit 5 stored at 0x1e95 - code at 0x1232 - read back code at 0x6054 INPUT_PORTS_END static INPUT_PORTS_START( radarzon ) @@ -1007,14 +1114,14 @@ static INPUT_PORTS_START( radarzon ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) // IPT_BUTTON2 #endif + // DSW2 bit 5 stored at 0x3d6e - code at 0x22aa - read back code at 0x00e4 + PORT_MODIFY("DSW3") PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Bonus_Life ) ) PORT_DIPSETTING( 0x0c, "100k only" ) // displays "100000" PORT_DIPSETTING( 0x04, "200k only" ) // displays "200000" PORT_DIPSETTING( 0x08, "400k only" ) // displays "400000" PORT_DIPSETTING( 0x00, "800k only" ) // displays "800000" - - // DSW2 bit 5 stored at 0x3d6e - code at 0x22aa - read back code at 0x00e4 INPUT_PORTS_END static INPUT_PORTS_START( goldbug ) @@ -1026,14 +1133,14 @@ static INPUT_PORTS_START( goldbug ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) // IPT_BUTTON2 #endif + // DSW2 bit 5 stored at 0x3d89 - code at 0x3377 - read back code at 0x6054 + PORT_MODIFY("DSW3") PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Bonus_Life ) ) PORT_DIPSETTING( 0x0c, "100k only" ) // displays "100000" PORT_DIPSETTING( 0x04, "200k only" ) // displays "200000" PORT_DIPSETTING( 0x08, "400k only" ) // displays "400000" PORT_DIPSETTING( 0x00, "800k only" ) // displays "800000" - - // DSW2 bit 5 stored at 0x3d89 - code at 0x3377 - read back code at 0x6054 INPUT_PORTS_END static INPUT_PORTS_START( diggerc ) @@ -1045,23 +1152,23 @@ static INPUT_PORTS_START( diggerc ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) // IPT_BUTTON2 #endif + // DSW2 bit 5 stored at 0x3db3 - code at 0x22ad - read back code at 0x00e4 + PORT_MODIFY("DSW3") PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Bonus_Life ) ) PORT_DIPSETTING( 0x0c, "50k only" ) // displays "50000" PORT_DIPSETTING( 0x04, "100k only" ) // displays "100000" PORT_DIPSETTING( 0x08, "150k only" ) // displays "150000" PORT_DIPSETTING( 0x00, "200k only" ) // displays "200000" - - // DSW2 bit 5 stored at 0x3db3 - code at 0x22ad - read back code at 0x00e4 INPUT_PORTS_END static INPUT_PORTS_START( heartatk ) PORT_INCLUDE(cvs_registration) + // DSW2 bit 5 stored at 0x1e76 - code at 0x0c5c - read back code at 0x00e4 + // DSW3 bits 2 and 3 stored at 0x1c61 (0, 2, 1, 3) - code at 0x0c52 // read back code at 0x2197 but untested value : bonus life always at 100000 - - // DSW2 bit 5 stored at 0x1e76 - code at 0x0c5c - read back code at 0x00e4 INPUT_PORTS_END static INPUT_PORTS_START( hunchbak ) @@ -1093,19 +1200,19 @@ INPUT_PORTS_END static INPUT_PORTS_START( superbik ) PORT_INCLUDE(cvs_registration) - // DSW3 bits 2 and 3 are not read : bonus life always at 5000 - // DSW2 bit 5 stored at 0x1e79 - code at 0x060f - read back code at 0x25bf + + // DSW3 bits 2 and 3 are not read : bonus life always at 5000 INPUT_PORTS_END static INPUT_PORTS_START( raiders ) PORT_INCLUDE(cvs_registration) - // DSW3 bits 2 and 3 are not read : bonus life always at 100000 - PORT_MODIFY("DSW2") PORT_DIPUNUSED( 0x10, IP_ACTIVE_HIGH ) // always 4 lives - table at 0x4218 - 2 bytes // DSW2 bit 5 stored at 0x1e79 - code at 0x1307 - read back code at 0x251d + + // DSW3 bits 2 and 3 are not read : bonus life always at 100000 INPUT_PORTS_END static INPUT_PORTS_START( hero ) @@ -1117,11 +1224,11 @@ static INPUT_PORTS_START( hero ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) // IPT_BUTTON2 #endif - // DSW3 bits 2 and 3 are not read : bonus life always at 150000 - PORT_MODIFY("DSW2") PORT_DIPUNUSED( 0x10, IP_ACTIVE_HIGH ) // always 3 lives - table at 0x4ebb - 2 bytes // DSW2 bit 5 stored at 0x1e99 - code at 0x0fdd - read back code at 0x0352 + + // DSW3 bits 2 and 3 are not read : bonus life always at 150000 INPUT_PORTS_END static INPUT_PORTS_START( huncholy ) @@ -1133,11 +1240,11 @@ static INPUT_PORTS_START( huncholy ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) // IPT_BUTTON2 #endif - // DSW3 bits 2 and 3 are not read : bonus life always at 20000 - PORT_MODIFY("DSW2") PORT_DIPUNUSED( 0x10, IP_ACTIVE_HIGH ) // always 3 lives - table at 0x4531 - 2 bytes // DSW2 bit 5 stored at 0x1e7c - code at 0x067d - read back code at 0x2f95 + + // DSW3 bits 2 and 3 are not read : bonus life always at 20000 INPUT_PORTS_END @@ -1172,34 +1279,31 @@ GFXDECODE_END * *************************************/ - void cvs_state::machine_start() { - cvs_base_state::machine_start(); - m_lamps.resolve(); - start_393hz_timer(); - // register state save save_item(NAME(m_character_ram_page_start)); save_item(NAME(m_character_banking_mode)); - save_item(NAME(m_393hz_clock)); + save_item(NAME(m_protection_counter)); save_item(NAME(m_speech_rom_bit_address)); - save_item(NAME(m_stars_on)); save_item(NAME(m_scroll_reg)); + save_item(NAME(m_collision)); + save_item(NAME(m_stars_on)); + save_item(NAME(m_stars_scroll)); } void cvs_state::machine_reset() { - cvs_base_state::machine_reset(); - m_character_ram_page_start = 0; m_character_banking_mode = 0; m_speech_rom_bit_address = 0; - m_393hz_clock = 0; - m_stars_on = 0; + m_protection_counter = 0; m_scroll_reg = 0; + m_collision = 0; + m_stars_on = false; + m_stars_scroll = 0; } void cvs_state::cvs(machine_config &config) @@ -1209,21 +1313,17 @@ void cvs_state::cvs(machine_config &config) m_maincpu->set_addrmap(AS_PROGRAM, &cvs_state::main_cpu_map); m_maincpu->set_addrmap(AS_IO, &cvs_state::main_cpu_io_map); m_maincpu->set_addrmap(AS_DATA, &cvs_state::main_cpu_data_map); - m_maincpu->set_vblank_int("screen", FUNC(cvs_state::main_cpu_interrupt)); m_maincpu->sense_handler().set("screen", FUNC(screen_device::vblank)); - m_maincpu->flag_handler().set(FUNC(cvs_state::write_s2650_flag)); + m_maincpu->flag_handler().set([this] (int state) { m_ram_view.select(state); }); m_maincpu->intack_handler().set_constant(0x03); S2650(config, m_audiocpu, XTAL(14'318'181) / 16); - m_audiocpu->set_addrmap(AS_PROGRAM, &cvs_state::dac_cpu_map); + m_audiocpu->set_addrmap(AS_PROGRAM, &cvs_state::audio_cpu_map); m_audiocpu->intack_handler().set([this] { m_audiocpu->set_input_line(0, CLEAR_LINE); return 0x03; }); - // doesn't look like it is used at all - //m_audiocpu->sense_handler().set(FUNC(cvs_state::cvs_393hz_clock_r)); S2650(config, m_speechcpu, XTAL(14'318'181) / 16); m_speechcpu->set_addrmap(AS_PROGRAM, &cvs_state::speech_cpu_map); // romclk is much more probable, 393 Hz results in timing issues - //m_speechcpu->sense_handler().set(FUNC(cvs_state::cvs_393hz_clock_r)); m_speechcpu->sense_handler().set("tms", FUNC(tms5110_device::romclk_hack_r)); // video hardware @@ -1239,46 +1339,52 @@ void cvs_state::cvs(machine_config &config) m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(1000)); m_screen->set_screen_update(FUNC(cvs_state::screen_update)); m_screen->set_palette(m_palette); + m_screen->screen_vblank().set(FUNC(cvs_state::main_cpu_interrupt)); + m_screen->screen_vblank().append(FUNC(cvs_state::scroll_stars)); S2636(config, m_s2636[0], 0); - m_s2636[0]->set_offsets(CVS_S2636_Y_OFFSET, CVS_S2636_X_OFFSET); + m_s2636[0]->set_offsets(-5, -26); S2636(config, m_s2636[1], 0); - m_s2636[1]->set_offsets(CVS_S2636_Y_OFFSET, CVS_S2636_X_OFFSET); + m_s2636[1]->set_offsets(-5, -26); S2636(config, m_s2636[2], 0); - m_s2636[2]->set_offsets(CVS_S2636_Y_OFFSET, CVS_S2636_X_OFFSET); + m_s2636[2]->set_offsets(-5, -26); // audio hardware SPEAKER(config, "speaker").front_center(); GENERIC_LATCH_8(config, m_soundlatch); - DAC_8BIT_R2R(config, "dac1", 0).add_route(ALL_OUTPUTS, "speaker", 0.25); // unknown DAC - DAC_4BIT_R2R(config, m_dac2, 0).add_route(ALL_OUTPUTS, "speaker", 0.25); // unknown DAC - DAC_1BIT(config, m_dac3, 0).add_route(ALL_OUTPUTS, "speaker", 0.5); + DAC_8BIT_R2R(config, "dac1", 0).add_route(ALL_OUTPUTS, "speaker", 0.15); // unknown DAC + DAC_4BIT_R2R(config, m_dac2, 0).add_route(ALL_OUTPUTS, "speaker", 0.20); // unknown DAC + + BEEP(config, m_beep[0], 600).add_route(ALL_OUTPUTS, "speaker", 0.15); // placeholder + BEEP(config, m_beep[1], 150).add_route(ALL_OUTPUTS, "speaker", 0.15); // " TMS5100(config, m_tms5110, XTAL(640'000)); m_tms5110->data().set(FUNC(cvs_state::speech_rom_read_bit)); - m_tms5110->add_route(ALL_OUTPUTS, "speaker", 0.5); + m_tms5110->add_route(ALL_OUTPUTS, "speaker", 0.30); } + /************************************* * * ROM definitions * *************************************/ -#define CVS_COMMON_ROMS \ +#define CVS_COMMON_ROMS \ ROM_REGION( 0x8000, "speechcpu", 0 ) \ - ROM_LOAD( "5b.bin", 0x0000, 0x0800, CRC(f055a624) SHA1(5dfe89d7271092e665cdd5cd59d15a2b70f92f43) ) \ - \ - ROM_REGION( 0x0820, "proms", 0 ) \ - ROM_LOAD( "82s185.10h", 0x0000, 0x0800, CRC(c205bca6) SHA1(ec9bd220e75f7b067ede6139763ef8aca0fb7a29) ) \ + ROM_LOAD( "5b.bin", 0x0000, 0x0800, CRC(f055a624) SHA1(5dfe89d7271092e665cdd5cd59d15a2b70f92f43) ) \ + \ + ROM_REGION( 0x0820, "proms", 0 ) \ + ROM_LOAD( "82s185.10h", 0x0000, 0x0800, CRC(c205bca6) SHA1(ec9bd220e75f7b067ede6139763ef8aca0fb7a29) ) \ ROM_LOAD( "82s123.10k", 0x0800, 0x0020, CRC(b5221cec) SHA1(71d9830b33b1a8140b0fe1a2ba8024ba8e6e48e0) ) + #define CVS_ROM_REGION_SPEECH_DATA(name, len, hash) \ - ROM_REGION( 0x1000, "speechdata", 0 ) \ + ROM_REGION( 0x1000, "speechdata", 0 ) \ ROM_LOAD( name, 0x0000, len, hash ) #define ROM_LOAD_STAGGERED(name, offs, hash) \ @@ -1288,23 +1394,23 @@ void cvs_state::cvs(machine_config &config) ROM_CONTINUE( 0x6000 + offs, 0x0400 ) -ROM_START( huncholy ) +ROM_START( cosmos ) ROM_REGION( 0x8000, "maincpu", 0 ) - ROM_LOAD_STAGGERED( "ho-gp1.bin", 0x0000, CRC(4f17cda7) SHA1(ae6fe495c723042c6e060d4ada50aaef1019d5eb) ) - ROM_LOAD_STAGGERED( "ho-gp2.bin", 0x0400, CRC(70fa52c7) SHA1(179813fdc204870d72c0bfa8cd5dbf277e1f67c4) ) - ROM_LOAD_STAGGERED( "ho-gp3.bin", 0x0800, CRC(931934b1) SHA1(08fe5ad3459862246e9ea845abab4e01e1dbd62d) ) - ROM_LOAD_STAGGERED( "ho-gp4.bin", 0x0c00, CRC(af5cd501) SHA1(9a79b173aa41a82faa9f19210d3e18bfa6c593fa) ) - ROM_LOAD_STAGGERED( "ho-gp5.bin", 0x1000, CRC(658e8974) SHA1(30d0ada1cce99a842bad8f5a58630bc1b7048b03) ) + ROM_LOAD_STAGGERED( "cs-gp1.bin", 0x0000, CRC(7eb96ddf) SHA1(f7456ee1ace03ab98c4e8128d375464122c4df01) ) + ROM_LOAD_STAGGERED( "cs-gp2.bin", 0x0400, CRC(6975a8f7) SHA1(13192d4eedd843c0c1d7e5c54a3086f71b09fbcb) ) + ROM_LOAD_STAGGERED( "cs-gp3.bin", 0x0800, CRC(76904b13) SHA1(de219999e4a1b72142e71ea707b6250f4732ccb3) ) + ROM_LOAD_STAGGERED( "cs-gp4.bin", 0x0c00, CRC(bdc89719) SHA1(668267d0b05990ff83a9e38a62950d3d725a53b3) ) + ROM_LOAD_STAGGERED( "cs-gp5.bin", 0x1000, CRC(94be44ea) SHA1(e496ea79d177c6d2d79d59f7d45c86b547469c6f) ) ROM_REGION( 0x8000, "audiocpu", 0 ) - ROM_LOAD( "ho-sdp1.bin", 0x0000, 0x1000, CRC(3efb3ffd) SHA1(be4807c8b4fe23f2247aa3b6ac02285bee1a0520) ) + ROM_LOAD( "cs-sdp1.bin", 0x0000, 0x0800, CRC(b385b669) SHA1(79621d3fb3eb4ea6fa8a733faa6f21edeacae186) ) - CVS_ROM_REGION_SPEECH_DATA( "ho-sp1.bin", 0x1000, CRC(3fd39b1e) SHA1(f5d0b2cfaeda994762403f039a6f7933c5525234) ) + CVS_ROM_REGION_SPEECH_DATA( "cs-sp1.bin", 0x1000, CRC(3c7fe86d) SHA1(9ae0b63b231a7092820650a196cde60588bc6b58) ) ROM_REGION( 0x1800, "tiles", 0 ) - ROM_LOAD( "ho-cp1.bin", 0x0000, 0x0800, CRC(c6c73d46) SHA1(63aba92f77105fedf46337b591b074020bec05d0) ) - ROM_LOAD( "ho-cp2.bin", 0x0800, 0x0800, CRC(e596371c) SHA1(93a0d0ccdf830ae72d070b03b7e2222f4a737ead) ) - ROM_LOAD( "ho-cp3.bin", 0x1000, 0x0800, CRC(11fae1cf) SHA1(5ceabfb1ff1a6f76d1649512f57d7151f5258ecb) ) + ROM_LOAD( "cs-cp1.bin", 0x0000, 0x0800, CRC(6a48c898) SHA1(c27f7bcdb2fe042ec52d1b9b4b9a4e47c288862d) ) + ROM_LOAD( "cs-cp2.bin", 0x0800, 0x0800, CRC(db0dfd8c) SHA1(f2b0dd43f0e514fdae54e4066606187f45b98e38) ) + ROM_LOAD( "cs-cp3.bin", 0x1000, 0x0800, CRC(01eee875) SHA1(6c41d716b5795f085229d855518862fb85f395a4) ) CVS_COMMON_ROMS ROM_END @@ -1330,6 +1436,27 @@ ROM_START( darkwar ) CVS_COMMON_ROMS ROM_END +ROM_START( spacefrt ) + ROM_REGION( 0x8000, "maincpu", 0 ) + ROM_LOAD_STAGGERED( "sf-gp1.bin", 0x0000, CRC(1158fc3a) SHA1(c1f470324b6ec65c3061f78a6ff8620154f20c09) ) + ROM_LOAD_STAGGERED( "sf-gp2.bin", 0x0400, CRC(8b4e1582) SHA1(5b92082d67f32197c0c61ddd8e1e3feb742195f4) ) + ROM_LOAD_STAGGERED( "sf-gp3.bin", 0x0800, CRC(48f05102) SHA1(72d40cdd0bbc4cfeb6ddf550de0dafc61270d382) ) + ROM_LOAD_STAGGERED( "sf-gp4.bin", 0x0c00, CRC(c5b14631) SHA1(360bed649185a090f7c96adadd7f045ef574865a) ) + ROM_LOAD_STAGGERED( "sf-gp5.bin", 0x1000, CRC(d7eca1b6) SHA1(8444e61827f0153d04c4f9c08416e7ab753d6918) ) + + ROM_REGION( 0x8000, "audiocpu", 0 ) + ROM_LOAD( "sf-sdp1.bin", 0x0000, 0x0800, CRC(339a327f) SHA1(940887cd4660e37537fd9b57aa1ec3a4717ea0cf) ) + + CVS_ROM_REGION_SPEECH_DATA( "sf-sp1.bin", 0x1000, CRC(c5628d30) SHA1(d29a5852a1762cbd5f3eba29ae2bf49b3a26f894) ) + + ROM_REGION( 0x1800, "tiles", 0 ) + ROM_LOAD( "sf-cp1.bin", 0x0000, 0x0800, CRC(da194a68) SHA1(4215267e91644cf1e1f32f898bc9562bfba711f3) ) + ROM_LOAD( "sf-cp2.bin", 0x0800, 0x0800, CRC(b96977c7) SHA1(8f0fab044f16787bce83562e2b22d962d0a2c209) ) + ROM_LOAD( "sf-cp3.bin", 0x1000, 0x0800, CRC(f5d67b9a) SHA1(a492b41c53b1f28ac5f70969e5f06afa948c1a7d) ) + + CVS_COMMON_ROMS +ROM_END + ROM_START( 8ball ) ROM_REGION( 0x8000, "maincpu", 0 ) ROM_LOAD_STAGGERED( "8b-gp1.bin", 0x0000, CRC(1b4fb37f) SHA1(df6dd2766a3b70eec0bde0ae1932b35abdab3735) ) @@ -1372,65 +1499,44 @@ ROM_START( 8ball1 ) CVS_COMMON_ROMS ROM_END -ROM_START( hunchbak ) // actual ROM label has "Century Elect. Ltd. (c)1981", and some label has HB/HB2 handwritten - ROM_REGION( 0x8000, "maincpu", 0 ) - ROM_LOAD_STAGGERED( "hb-gp1.bin", 0x0000, CRC(af801d54) SHA1(68e31561e98f7e2caa337dd764941d08f075b559) ) - ROM_LOAD_STAGGERED( "hb-gp2.bin", 0x0400, CRC(b448cc8e) SHA1(ed94f662c0e08a3a0aca073fbec29ae1fbd0328e) ) - ROM_LOAD_STAGGERED( "hb-gp3.bin", 0x0800, CRC(57c6ea7b) SHA1(8c3ba01ab1917a8c24180ed1c0011dbfed36d406) ) - ROM_LOAD_STAGGERED( "hb-gp4.bin", 0x0c00, CRC(7f91287b) SHA1(9383d885c142417de73879905cbce272ba9514c7) ) - ROM_LOAD_STAGGERED( "hb-gp5.bin", 0x1000, CRC(1dd5755c) SHA1(b1e158d52bd9a238e3e32ed3024e495df2292dcb) ) - - ROM_REGION( 0x8000, "audiocpu", 0 ) - ROM_LOAD( "6c.sdp1", 0x0000, 0x1000, CRC(f9ba2854) SHA1(d041198e2e8b8c3e668bd1610310f8d25c5b1119) ) - - CVS_ROM_REGION_SPEECH_DATA( "8a.sp1", 0x0800, CRC(ed1cd201) SHA1(6cc3842dda1bfddc06ffb436c55d14276286bd67) ) - - ROM_REGION( 0x1800, "tiles", 0 ) - ROM_LOAD( "11a.cp1", 0x0000, 0x0800, CRC(f256b047) SHA1(02d79882bad37ffdd58ef478e2658a1369c32ebc) ) - ROM_LOAD( "10a.cp2", 0x0800, 0x0800, CRC(b870c64f) SHA1(ce4f8de87568782ce02bba754edff85df7f5c393) ) - ROM_LOAD( "9a.cp3", 0x1000, 0x0800, CRC(9a7dab88) SHA1(cd39a9d4f982a7f49c478db1408d7e07335f2ddc) ) - - CVS_COMMON_ROMS -ROM_END - -ROM_START( hunchbaka ) +ROM_START( logger ) // actual ROM label has "Century Elect. Ltd. (c)1981", and LOG3 is handwritten ROM_REGION( 0x8000, "maincpu", 0 ) - ROM_LOAD_STAGGERED( "1b.gp1", 0x0000, CRC(c816860b) SHA1(1109639645496d4644564d21c816b8baf8c84cf7) ) - ROM_LOAD_STAGGERED( "2a.gp2", 0x0400, CRC(cab1e524) SHA1(c3fd7ac9ce5893fd2602a15ad0f6e3267a4ca122) ) - ROM_LOAD_STAGGERED( "3a.gp3", 0x0800, CRC(b2adcfeb) SHA1(3090e2c6b945857c1e48dea395015a05c6165cd9) ) - ROM_LOAD_STAGGERED( "4c.gp4", 0x0c00, CRC(229a8b71) SHA1(ea3815eb69d4927da356eada0add8382735feb48) ) - ROM_LOAD_STAGGERED( "5a.gp5", 0x1000, CRC(cb4f0313) SHA1(1ef63cbe62e7a54d45e0afbc398c9d9b601e6403) ) + ROM_LOAD_STAGGERED( "1clog3.gp1", 0x0000, CRC(0022b9ed) SHA1(4b94d2663f802a8140e8eae1b66ee78fdfa654f5) ) + ROM_LOAD_STAGGERED( "2clog3.gp2", 0x0400, CRC(23c5c8dc) SHA1(37fb6a62cb798d96de20078fe4a3af74a2be0e66) ) + ROM_LOAD_STAGGERED( "3clog3.gp3", 0x0800, CRC(f9288f74) SHA1(8bb588194186fc0e0c2d61ed2746542c978ebb76) ) + ROM_LOAD_STAGGERED( "4clog3.gp4", 0x0c00, CRC(e52ef7bf) SHA1(df5509b6847d6b9520a9d83b15083546898a981e) ) + ROM_LOAD_STAGGERED( "5clog3.gp5", 0x1000, CRC(4ee04359) SHA1(a592d4b280ac0ad5f06d68a7809092548261f123) ) ROM_REGION( 0x8000, "audiocpu", 0 ) - ROM_LOAD( "6c.sdp1", 0x0000, 0x1000, CRC(f9ba2854) SHA1(d041198e2e8b8c3e668bd1610310f8d25c5b1119) ) + ROM_LOAD( "6clog3.sdp1", 0x0000, 0x1000, CRC(5af8da17) SHA1(357f02cdf38c6659aca51fa0a8534542fc29623c) ) - CVS_ROM_REGION_SPEECH_DATA( "8a.sp1", 0x0800, CRC(ed1cd201) SHA1(6cc3842dda1bfddc06ffb436c55d14276286bd67) ) + CVS_ROM_REGION_SPEECH_DATA( "8clog3.sp1", 0x0800, CRC(74f67815) SHA1(6a26a16c27a7e4d58b611e5127115005a60cff91) ) ROM_REGION( 0x1800, "tiles", 0 ) - ROM_LOAD( "11a.cp1", 0x0000, 0x0800, CRC(f256b047) SHA1(02d79882bad37ffdd58ef478e2658a1369c32ebc) ) - ROM_LOAD( "10a.cp2", 0x0800, 0x0800, CRC(b870c64f) SHA1(ce4f8de87568782ce02bba754edff85df7f5c393) ) - ROM_LOAD( "9a.cp3", 0x1000, 0x0800, CRC(9a7dab88) SHA1(cd39a9d4f982a7f49c478db1408d7e07335f2ddc) ) + ROM_LOAD( "11clog3.cp1", 0x0000, 0x0800, CRC(e4ede80e) SHA1(62f2bc78106a057b6a8420d40421908df609bf29) ) + ROM_LOAD( "10clog3.cp2", 0x0800, 0x0800, CRC(d3de8e5b) SHA1(f95320e001869c42e51195d9cc11e4f2555e153f) ) + ROM_LOAD( "9clog3.cp3", 0x1000, 0x0800, CRC(9b8d1031) SHA1(87ef12aeae80cc0f240dead651c6222848f8dccc) ) CVS_COMMON_ROMS ROM_END -ROM_START( wallst ) +ROM_START( loggerr2 ) ROM_REGION( 0x8000, "maincpu", 0 ) - ROM_LOAD_STAGGERED( "ws-gp1.bin", 0x0000, CRC(bdac81b6) SHA1(6ce865d8902e815742a9ecf10d6f9495f376dede) ) - ROM_LOAD_STAGGERED( "ws-gp2.bin", 0x0400, CRC(9ca67cdd) SHA1(575a4d8d037d2a3c07a8f49d93c7cf6781349ec1) ) - ROM_LOAD_STAGGERED( "ws-gp3.bin", 0x0800, CRC(c2f407f2) SHA1(8208064fd0138a6ccacf03275b8d28793245bfd9) ) - ROM_LOAD_STAGGERED( "ws-gp4.bin", 0x0c00, CRC(1e4b2fe1) SHA1(28eda70cc9cf619452729092e68734ab1a5dc7fb) ) - ROM_LOAD_STAGGERED( "ws-gp5.bin", 0x1000, CRC(eec7bfd0) SHA1(6485e9e2e1624118e38892e74f80431820fd9672) ) + ROM_LOAD_STAGGERED( "logger_r2_gp1_11ce.1", 0x0000, CRC(02b0a75e) SHA1(06fbfa3a31e104da86f21ef8f600715224b7f332) ) // hand written LOGGER R2 GP1 11CE + ROM_LOAD_STAGGERED( "logger_r2_gp2_5265.2", 0x0400, CRC(3285aa08) SHA1(f5c8496b2d33229572d4442f703a2aaf93f1403f) ) // hand written LOGGER R2 GP2 5265 + ROM_LOAD_STAGGERED( "logger_r2_gp3_da04.3", 0x0800, CRC(d6a2a442) SHA1(7da009f8d3d4fb0b6624cd46ecae08675c317905) ) // hand written LOGGER R2 GP3 DA04 + ROM_LOAD_STAGGERED( "logger_r2_gp4_657b.4", 0x0c00, CRC(608b551c) SHA1(f2fde14860606f501ab0046fbe4dca0b97eb2481) ) // hand written LOGGER R2 GP4 657B + ROM_LOAD_STAGGERED( "logger_r2_gp5_c2d5.5", 0x1000, CRC(3d8ecdcd) SHA1(c9ea38aee898a4ac6cb6409da819d1a053088526) ) // hand written LOGGER R2 GP5 C2D5 ROM_REGION( 0x8000, "audiocpu", 0 ) - ROM_LOAD( "ws-sdp1.bin", 0x0000, 0x1000, CRC(faed2ac0) SHA1(c2c48e24a560d918531e5c17fb109d68bdec850f) ) + ROM_LOAD( "logger_sdp1_414a.6", 0x0000, 0x1000, CRC(5af8da17) SHA1(357f02cdf38c6659aca51fa0a8534542fc29623c) ) // hand written LOGGER SDP1 414A - CVS_ROM_REGION_SPEECH_DATA( "ws-sp1.bin", 0x0800, CRC(84b72637) SHA1(9c5834320f39545403839fb7088c37177a6c8861) ) + CVS_ROM_REGION_SPEECH_DATA( "logger_sp1_4626.8", 0x0800, CRC(74f67815) SHA1(6a26a16c27a7e4d58b611e5127115005a60cff91) ) // hand written LOGGER SP1 4626 ROM_REGION( 0x1800, "tiles", 0 ) - ROM_LOAD( "ws-cp1.bin", 0x0000, 0x0800, CRC(5aca11df) SHA1(5ef815b5b09445515ff8b958c4ea29f1a221cee1) ) - ROM_LOAD( "ws-cp2.bin", 0x0800, 0x0800, CRC(ca530d85) SHA1(e5a78667c3583d06d8387848323b11e4a91091ec) ) - ROM_LOAD( "ws-cp3.bin", 0x1000, 0x0800, CRC(1e0225d6) SHA1(410795046c64c24de6711b167315308808b54291) ) + ROM_LOAD( "logger_r2_cp1_d9cf.11", 0x0000, 0x0800, CRC(a1c1eb8c) SHA1(9fa2495b1b245f5889006cfc8857f51e57379cef) ) // hand written LOGGER R2 CP1 D9CF + ROM_LOAD( "logger_r2_cp2_cd1e.10", 0x0800, 0x0800, CRC(432d28d0) SHA1(30b9ec84fe04c5e48f4a1f9f7ab86a6a222db4cf) ) // hand written LOGGER R2 CP2 CD1E + ROM_LOAD( "logger_r2_cp3_5535.9", 0x1000, 0x0800, CRC(c87fcfcd) SHA1(eb937a6aa04ebe873cf46c4b3abf7bb02766eedf) ) // hand written LOGGER R2 CP3 5535 CVS_COMMON_ROMS ROM_END @@ -1456,6 +1562,27 @@ ROM_START( dazzler ) CVS_COMMON_ROMS ROM_END +ROM_START( wallst ) + ROM_REGION( 0x8000, "maincpu", 0 ) + ROM_LOAD_STAGGERED( "ws-gp1.bin", 0x0000, CRC(bdac81b6) SHA1(6ce865d8902e815742a9ecf10d6f9495f376dede) ) + ROM_LOAD_STAGGERED( "ws-gp2.bin", 0x0400, CRC(9ca67cdd) SHA1(575a4d8d037d2a3c07a8f49d93c7cf6781349ec1) ) + ROM_LOAD_STAGGERED( "ws-gp3.bin", 0x0800, CRC(c2f407f2) SHA1(8208064fd0138a6ccacf03275b8d28793245bfd9) ) + ROM_LOAD_STAGGERED( "ws-gp4.bin", 0x0c00, CRC(1e4b2fe1) SHA1(28eda70cc9cf619452729092e68734ab1a5dc7fb) ) + ROM_LOAD_STAGGERED( "ws-gp5.bin", 0x1000, CRC(eec7bfd0) SHA1(6485e9e2e1624118e38892e74f80431820fd9672) ) + + ROM_REGION( 0x8000, "audiocpu", 0 ) + ROM_LOAD( "ws-sdp1.bin", 0x0000, 0x1000, CRC(faed2ac0) SHA1(c2c48e24a560d918531e5c17fb109d68bdec850f) ) + + CVS_ROM_REGION_SPEECH_DATA( "ws-sp1.bin", 0x0800, CRC(84b72637) SHA1(9c5834320f39545403839fb7088c37177a6c8861) ) + + ROM_REGION( 0x1800, "tiles", 0 ) + ROM_LOAD( "ws-cp1.bin", 0x0000, 0x0800, CRC(5aca11df) SHA1(5ef815b5b09445515ff8b958c4ea29f1a221cee1) ) + ROM_LOAD( "ws-cp2.bin", 0x0800, 0x0800, CRC(ca530d85) SHA1(e5a78667c3583d06d8387848323b11e4a91091ec) ) + ROM_LOAD( "ws-cp3.bin", 0x1000, 0x0800, CRC(1e0225d6) SHA1(410795046c64c24de6711b167315308808b54291) ) + + CVS_COMMON_ROMS +ROM_END + ROM_START( radarzon ) ROM_REGION( 0x8000, "maincpu", 0 ) ROM_LOAD_STAGGERED( "rd-gp1.bin", 0x0000, CRC(775786ba) SHA1(5ad0f4e774821a7ed73615118ea42132d3b5424b) ) @@ -1582,149 +1709,86 @@ ROM_START( diggerc ) CVS_COMMON_ROMS ROM_END -ROM_START( superbik ) - ROM_REGION( 0x8000, "maincpu", 0 ) - ROM_LOAD_STAGGERED( "sb-gp1.bin", 0x0000, CRC(f0209700) SHA1(7843e8ebcbecb93814863ddd135f5acb0d481043) ) - ROM_LOAD_STAGGERED( "sb-gp2.bin", 0x0400, CRC(1956d687) SHA1(00e261c5b1e1414b45661310c47daeceb3d5f4bf) ) - ROM_LOAD_STAGGERED( "sb-gp3.bin", 0x0800, CRC(ceb27b75) SHA1(56fecc72746113a6611c18663d1b9e0e2daf57b4) ) - ROM_LOAD_STAGGERED( "sb-gp4.bin", 0x0c00, CRC(430b70b3) SHA1(207c4939331c1561d145cbee0538da072aa51f5b) ) - ROM_LOAD_STAGGERED( "sb-gp5.bin", 0x1000, CRC(013615a3) SHA1(1795a4dcc98255ad185503a99f48b7bacb5edc9d) ) - - ROM_REGION( 0x8000, "audiocpu", 0 ) - ROM_LOAD( "sb-sdp1.bin", 0x0000, 0x0800, CRC(e977c090) SHA1(24bd4165434c745c1514d49cc90bcb621fb3a0f8) ) - - CVS_ROM_REGION_SPEECH_DATA( "sb-sp1.bin", 0x0800, CRC(0aeb9ccd) SHA1(e7123eed21e4e758bbe1cebfd5aad44a5de45c27) ) - - ROM_REGION( 0x1800, "tiles", 0 ) - ROM_LOAD( "sb-cp1.bin", 0x0000, 0x0800, CRC(03ba7760) SHA1(4ed252e2c4ec7cea2199524f7c35a1dc7c44f8d8) ) - ROM_LOAD( "sb-cp2.bin", 0x0800, 0x0800, CRC(04de69f2) SHA1(3ef3b3c159d47230622b6cc45baad8737bd93a90) ) - ROM_LOAD( "sb-cp3.bin", 0x1000, 0x0800, CRC(bb7d0b9a) SHA1(94c72d6961204be9cab351ac854ac9c69b51e79a) ) - - CVS_COMMON_ROMS -ROM_END - -ROM_START( hero ) - ROM_REGION( 0x8000, "maincpu", 0 ) - ROM_LOAD_STAGGERED( "hr-gp1.bin", 0x0000, CRC(82f39788) SHA1(44217dc2312d10fceeb35adf3999cd6f240b60be) ) - ROM_LOAD_STAGGERED( "hr-gp2.bin", 0x0400, CRC(79607812) SHA1(eaab829a2f5bcb8ec92c3f4122cffae31a4a77cb) ) - ROM_LOAD_STAGGERED( "hr-gp3.bin", 0x0800, CRC(2902715c) SHA1(cf63f72681d1dcbdabdf7673ad8f61b5969e4bd1) ) - ROM_LOAD_STAGGERED( "hr-gp4.bin", 0x0c00, CRC(696d2f8e) SHA1(73dd57f0f84e37ae707a89e17253aa3dd0c8b48b) ) - ROM_LOAD_STAGGERED( "hr-gp5.bin", 0x1000, CRC(936a4ba6) SHA1(86cddcfafbd93dcdad3a1f26e280ceb96f779ab0) ) - - ROM_REGION( 0x8000, "audiocpu", 0 ) - ROM_LOAD( "hr-sdp1.bin", 0x0000, 0x0800, CRC(c34ecf79) SHA1(07c96283410b1e7401140094db95800708cf310f) ) - - CVS_ROM_REGION_SPEECH_DATA( "hr-sp1.bin", 0x0800, CRC(a5c33cb1) SHA1(447ffb193b0dc4985bae5d8c214a893afd08664b) ) - - ROM_REGION( 0x1800, "tiles", 0 ) - ROM_LOAD( "hr-cp1.bin", 0x0000, 0x0800, CRC(2d201496) SHA1(f195aa1b231a0e1752c7da824a10321f0527f8c9) ) - ROM_LOAD( "hr-cp2.bin", 0x0800, 0x0800, CRC(21b61fe3) SHA1(31882003f0557ffc4ec38ae6ee07b5d294b4162c) ) - ROM_LOAD( "hr-cp3.bin", 0x1000, 0x0800, CRC(9c8e3f9e) SHA1(9d949a4d12b45da12b434677670b2b109568564a) ) - - CVS_COMMON_ROMS -ROM_END - -ROM_START( logger ) // actual ROM label has "Century Elect. Ltd. (c)1981", and LOG3 is handwritten - ROM_REGION( 0x8000, "maincpu", 0 ) - ROM_LOAD_STAGGERED( "1clog3.gp1", 0x0000, CRC(0022b9ed) SHA1(4b94d2663f802a8140e8eae1b66ee78fdfa654f5) ) - ROM_LOAD_STAGGERED( "2clog3.gp2", 0x0400, CRC(23c5c8dc) SHA1(37fb6a62cb798d96de20078fe4a3af74a2be0e66) ) - ROM_LOAD_STAGGERED( "3clog3.gp3", 0x0800, CRC(f9288f74) SHA1(8bb588194186fc0e0c2d61ed2746542c978ebb76) ) - ROM_LOAD_STAGGERED( "4clog3.gp4", 0x0c00, CRC(e52ef7bf) SHA1(df5509b6847d6b9520a9d83b15083546898a981e) ) - ROM_LOAD_STAGGERED( "5clog3.gp5", 0x1000, CRC(4ee04359) SHA1(a592d4b280ac0ad5f06d68a7809092548261f123) ) - - ROM_REGION( 0x8000, "audiocpu", 0 ) - ROM_LOAD( "6clog3.sdp1", 0x0000, 0x1000, CRC(5af8da17) SHA1(357f02cdf38c6659aca51fa0a8534542fc29623c) ) - - CVS_ROM_REGION_SPEECH_DATA( "8clog3.sp1", 0x0800, CRC(74f67815) SHA1(6a26a16c27a7e4d58b611e5127115005a60cff91) ) - - ROM_REGION( 0x1800, "tiles", 0 ) - ROM_LOAD( "11clog3.cp1", 0x0000, 0x0800, CRC(e4ede80e) SHA1(62f2bc78106a057b6a8420d40421908df609bf29) ) - ROM_LOAD( "10clog3.cp2", 0x0800, 0x0800, CRC(d3de8e5b) SHA1(f95320e001869c42e51195d9cc11e4f2555e153f) ) - ROM_LOAD( "9clog3.cp3", 0x1000, 0x0800, CRC(9b8d1031) SHA1(87ef12aeae80cc0f240dead651c6222848f8dccc) ) - - CVS_COMMON_ROMS -ROM_END - -ROM_START( loggerr2 ) +ROM_START( heartatk ) ROM_REGION( 0x8000, "maincpu", 0 ) - ROM_LOAD_STAGGERED( "logger_r2_gp1_11ce.1", 0x0000, CRC(02b0a75e) SHA1(06fbfa3a31e104da86f21ef8f600715224b7f332) ) // hand written LOGGER R2 GP1 11CE - ROM_LOAD_STAGGERED( "logger_r2_gp2_5265.2", 0x0400, CRC(3285aa08) SHA1(f5c8496b2d33229572d4442f703a2aaf93f1403f) ) // hand written LOGGER R2 GP2 5265 - ROM_LOAD_STAGGERED( "logger_r2_gp3_da04.3", 0x0800, CRC(d6a2a442) SHA1(7da009f8d3d4fb0b6624cd46ecae08675c317905) ) // hand written LOGGER R2 GP3 DA04 - ROM_LOAD_STAGGERED( "logger_r2_gp4_657b.4", 0x0c00, CRC(608b551c) SHA1(f2fde14860606f501ab0046fbe4dca0b97eb2481) ) // hand written LOGGER R2 GP4 657B - ROM_LOAD_STAGGERED( "logger_r2_gp5_c2d5.5", 0x1000, CRC(3d8ecdcd) SHA1(c9ea38aee898a4ac6cb6409da819d1a053088526) ) // hand written LOGGER R2 GP5 C2D5 + ROM_LOAD_STAGGERED( "ha-gp1.bin", 0x0000, CRC(e8297c23) SHA1(e79ae7e99f904afe90b43a54df7b0e257d65ac0b) ) + ROM_LOAD_STAGGERED( "ha-gp2.bin", 0x0400, CRC(f7632afc) SHA1(ebfc6e12c8b5078e8c448aa25d9de9d39c0baa5e) ) + ROM_LOAD_STAGGERED( "ha-gp3.bin", 0x0800, CRC(a9ce3c6a) SHA1(86ddb27c1c132f3cf5ad4268ea9a458e0da23677) ) + ROM_LOAD_STAGGERED( "ha-gp4.bin", 0x0c00, CRC(090f30a9) SHA1(acd6b0c7358bf4664d0de668853076326e82fd04) ) + ROM_LOAD_STAGGERED( "ha-gp5.bin", 0x1000, CRC(163b3d2d) SHA1(275275b54533e0ce2df6d189619be05a99c68b6d) ) ROM_REGION( 0x8000, "audiocpu", 0 ) - ROM_LOAD( "logger_sdp1_414a.6", 0x0000, 0x1000, CRC(5af8da17) SHA1(357f02cdf38c6659aca51fa0a8534542fc29623c) ) // hand written LOGGER SDP1 414A + ROM_LOAD( "ha-sdp1.bin", 0x0000, 0x1000, CRC(b9c466a0) SHA1(f28c21a15cf6d52123ed7feac4eea2a42ea5e93d) ) - CVS_ROM_REGION_SPEECH_DATA( "logger_sp1_4626.8", 0x0800, CRC(74f67815) SHA1(6a26a16c27a7e4d58b611e5127115005a60cff91) ) // hand written LOGGER SP1 4626 + CVS_ROM_REGION_SPEECH_DATA( "ha-sp1.bin", 0x1000, CRC(fa21422a) SHA1(a75d13455c65e5a77db02fc87f0c112e329d0d6d) ) ROM_REGION( 0x1800, "tiles", 0 ) - ROM_LOAD( "logger_r2_cp1_d9cf.11", 0x0000, 0x0800, CRC(a1c1eb8c) SHA1(9fa2495b1b245f5889006cfc8857f51e57379cef) ) // hand written LOGGER R2 CP1 D9CF - ROM_LOAD( "logger_r2_cp2_cd1e.10", 0x0800, 0x0800, CRC(432d28d0) SHA1(30b9ec84fe04c5e48f4a1f9f7ab86a6a222db4cf) ) // hand written LOGGER R2 CP2 CD1E - ROM_LOAD( "logger_r2_cp3_5535.9", 0x1000, 0x0800, CRC(c87fcfcd) SHA1(eb937a6aa04ebe873cf46c4b3abf7bb02766eedf) ) // hand written LOGGER R2 CP3 5535 + ROM_LOAD( "ha-cp1.bin", 0x0000, 0x0800, CRC(2d0f6d13) SHA1(55e45eaf1bf24a7a78a2f34ffc0d99a4c191d138) ) + ROM_LOAD( "ha-cp2.bin", 0x0800, 0x0800, CRC(7f5671bd) SHA1(7f4ae92a96c5a847c113f6f7e8d67d3e5ee0bcb0) ) + ROM_LOAD( "ha-cp3.bin", 0x1000, 0x0800, CRC(35b05ab4) SHA1(f336eb0c674c3d52e84be0f37b70953cce6112dc) ) CVS_COMMON_ROMS ROM_END -ROM_START( cosmos ) +ROM_START( hunchbak ) // actual ROM label has "Century Elect. Ltd. (c)1981", and some label has HB/HB2 handwritten ROM_REGION( 0x8000, "maincpu", 0 ) - ROM_LOAD_STAGGERED( "cs-gp1.bin", 0x0000, CRC(7eb96ddf) SHA1(f7456ee1ace03ab98c4e8128d375464122c4df01) ) - ROM_LOAD_STAGGERED( "cs-gp2.bin", 0x0400, CRC(6975a8f7) SHA1(13192d4eedd843c0c1d7e5c54a3086f71b09fbcb) ) - ROM_LOAD_STAGGERED( "cs-gp3.bin", 0x0800, CRC(76904b13) SHA1(de219999e4a1b72142e71ea707b6250f4732ccb3) ) - ROM_LOAD_STAGGERED( "cs-gp4.bin", 0x0c00, CRC(bdc89719) SHA1(668267d0b05990ff83a9e38a62950d3d725a53b3) ) - ROM_LOAD_STAGGERED( "cs-gp5.bin", 0x1000, CRC(94be44ea) SHA1(e496ea79d177c6d2d79d59f7d45c86b547469c6f) ) + ROM_LOAD_STAGGERED( "hb-gp1.bin", 0x0000, CRC(af801d54) SHA1(68e31561e98f7e2caa337dd764941d08f075b559) ) + ROM_LOAD_STAGGERED( "hb-gp2.bin", 0x0400, CRC(b448cc8e) SHA1(ed94f662c0e08a3a0aca073fbec29ae1fbd0328e) ) + ROM_LOAD_STAGGERED( "hb-gp3.bin", 0x0800, CRC(57c6ea7b) SHA1(8c3ba01ab1917a8c24180ed1c0011dbfed36d406) ) + ROM_LOAD_STAGGERED( "hb-gp4.bin", 0x0c00, CRC(7f91287b) SHA1(9383d885c142417de73879905cbce272ba9514c7) ) + ROM_LOAD_STAGGERED( "hb-gp5.bin", 0x1000, CRC(1dd5755c) SHA1(b1e158d52bd9a238e3e32ed3024e495df2292dcb) ) ROM_REGION( 0x8000, "audiocpu", 0 ) - ROM_LOAD( "cs-sdp1.bin", 0x0000, 0x0800, CRC(b385b669) SHA1(79621d3fb3eb4ea6fa8a733faa6f21edeacae186) ) + ROM_LOAD( "6c.sdp1", 0x0000, 0x1000, CRC(f9ba2854) SHA1(d041198e2e8b8c3e668bd1610310f8d25c5b1119) ) - CVS_ROM_REGION_SPEECH_DATA( "cs-sp1.bin", 0x1000, CRC(3c7fe86d) SHA1(9ae0b63b231a7092820650a196cde60588bc6b58) ) + CVS_ROM_REGION_SPEECH_DATA( "8a.sp1", 0x0800, CRC(ed1cd201) SHA1(6cc3842dda1bfddc06ffb436c55d14276286bd67) ) ROM_REGION( 0x1800, "tiles", 0 ) - ROM_LOAD( "cs-cp1.bin", 0x0000, 0x0800, CRC(6a48c898) SHA1(c27f7bcdb2fe042ec52d1b9b4b9a4e47c288862d) ) - ROM_LOAD( "cs-cp2.bin", 0x0800, 0x0800, CRC(db0dfd8c) SHA1(f2b0dd43f0e514fdae54e4066606187f45b98e38) ) - ROM_LOAD( "cs-cp3.bin", 0x1000, 0x0800, CRC(01eee875) SHA1(6c41d716b5795f085229d855518862fb85f395a4) ) + ROM_LOAD( "11a.cp1", 0x0000, 0x0800, CRC(f256b047) SHA1(02d79882bad37ffdd58ef478e2658a1369c32ebc) ) + ROM_LOAD( "10a.cp2", 0x0800, 0x0800, CRC(b870c64f) SHA1(ce4f8de87568782ce02bba754edff85df7f5c393) ) + ROM_LOAD( "9a.cp3", 0x1000, 0x0800, CRC(9a7dab88) SHA1(cd39a9d4f982a7f49c478db1408d7e07335f2ddc) ) CVS_COMMON_ROMS ROM_END -ROM_START( heartatk ) +ROM_START( hunchbaka ) ROM_REGION( 0x8000, "maincpu", 0 ) - ROM_LOAD_STAGGERED( "ha-gp1.bin", 0x0000, CRC(e8297c23) SHA1(e79ae7e99f904afe90b43a54df7b0e257d65ac0b) ) - ROM_LOAD_STAGGERED( "ha-gp2.bin", 0x0400, CRC(f7632afc) SHA1(ebfc6e12c8b5078e8c448aa25d9de9d39c0baa5e) ) - ROM_LOAD_STAGGERED( "ha-gp3.bin", 0x0800, CRC(a9ce3c6a) SHA1(86ddb27c1c132f3cf5ad4268ea9a458e0da23677) ) - ROM_LOAD_STAGGERED( "ha-gp4.bin", 0x0c00, CRC(090f30a9) SHA1(acd6b0c7358bf4664d0de668853076326e82fd04) ) - ROM_LOAD_STAGGERED( "ha-gp5.bin", 0x1000, CRC(163b3d2d) SHA1(275275b54533e0ce2df6d189619be05a99c68b6d) ) + ROM_LOAD_STAGGERED( "1b.gp1", 0x0000, CRC(c816860b) SHA1(1109639645496d4644564d21c816b8baf8c84cf7) ) + ROM_LOAD_STAGGERED( "2a.gp2", 0x0400, CRC(cab1e524) SHA1(c3fd7ac9ce5893fd2602a15ad0f6e3267a4ca122) ) + ROM_LOAD_STAGGERED( "3a.gp3", 0x0800, CRC(b2adcfeb) SHA1(3090e2c6b945857c1e48dea395015a05c6165cd9) ) + ROM_LOAD_STAGGERED( "4c.gp4", 0x0c00, CRC(229a8b71) SHA1(ea3815eb69d4927da356eada0add8382735feb48) ) + ROM_LOAD_STAGGERED( "5a.gp5", 0x1000, CRC(cb4f0313) SHA1(1ef63cbe62e7a54d45e0afbc398c9d9b601e6403) ) ROM_REGION( 0x8000, "audiocpu", 0 ) - ROM_LOAD( "ha-sdp1.bin", 0x0000, 0x1000, CRC(b9c466a0) SHA1(f28c21a15cf6d52123ed7feac4eea2a42ea5e93d) ) + ROM_LOAD( "6c.sdp1", 0x0000, 0x1000, CRC(f9ba2854) SHA1(d041198e2e8b8c3e668bd1610310f8d25c5b1119) ) - CVS_ROM_REGION_SPEECH_DATA( "ha-sp1.bin", 0x1000, CRC(fa21422a) SHA1(a75d13455c65e5a77db02fc87f0c112e329d0d6d) ) + CVS_ROM_REGION_SPEECH_DATA( "8a.sp1", 0x0800, CRC(ed1cd201) SHA1(6cc3842dda1bfddc06ffb436c55d14276286bd67) ) ROM_REGION( 0x1800, "tiles", 0 ) - ROM_LOAD( "ha-cp1.bin", 0x0000, 0x0800, CRC(2d0f6d13) SHA1(55e45eaf1bf24a7a78a2f34ffc0d99a4c191d138) ) - ROM_LOAD( "ha-cp2.bin", 0x0800, 0x0800, CRC(7f5671bd) SHA1(7f4ae92a96c5a847c113f6f7e8d67d3e5ee0bcb0) ) - ROM_LOAD( "ha-cp3.bin", 0x1000, 0x0800, CRC(35b05ab4) SHA1(f336eb0c674c3d52e84be0f37b70953cce6112dc) ) + ROM_LOAD( "11a.cp1", 0x0000, 0x0800, CRC(f256b047) SHA1(02d79882bad37ffdd58ef478e2658a1369c32ebc) ) + ROM_LOAD( "10a.cp2", 0x0800, 0x0800, CRC(b870c64f) SHA1(ce4f8de87568782ce02bba754edff85df7f5c393) ) + ROM_LOAD( "9a.cp3", 0x1000, 0x0800, CRC(9a7dab88) SHA1(cd39a9d4f982a7f49c478db1408d7e07335f2ddc) ) CVS_COMMON_ROMS ROM_END -ROM_START( spacefrt ) +ROM_START( superbik ) ROM_REGION( 0x8000, "maincpu", 0 ) - ROM_LOAD_STAGGERED( "sf-gp1.bin", 0x0000, CRC(1158fc3a) SHA1(c1f470324b6ec65c3061f78a6ff8620154f20c09) ) - ROM_LOAD_STAGGERED( "sf-gp2.bin", 0x0400, CRC(8b4e1582) SHA1(5b92082d67f32197c0c61ddd8e1e3feb742195f4) ) - ROM_LOAD_STAGGERED( "sf-gp3.bin", 0x0800, CRC(48f05102) SHA1(72d40cdd0bbc4cfeb6ddf550de0dafc61270d382) ) - ROM_LOAD_STAGGERED( "sf-gp4.bin", 0x0c00, CRC(c5b14631) SHA1(360bed649185a090f7c96adadd7f045ef574865a) ) - ROM_LOAD_STAGGERED( "sf-gp5.bin", 0x1000, CRC(d7eca1b6) SHA1(8444e61827f0153d04c4f9c08416e7ab753d6918) ) + ROM_LOAD_STAGGERED( "sb-gp1.bin", 0x0000, CRC(f0209700) SHA1(7843e8ebcbecb93814863ddd135f5acb0d481043) ) + ROM_LOAD_STAGGERED( "sb-gp2.bin", 0x0400, CRC(1956d687) SHA1(00e261c5b1e1414b45661310c47daeceb3d5f4bf) ) + ROM_LOAD_STAGGERED( "sb-gp3.bin", 0x0800, CRC(ceb27b75) SHA1(56fecc72746113a6611c18663d1b9e0e2daf57b4) ) + ROM_LOAD_STAGGERED( "sb-gp4.bin", 0x0c00, CRC(430b70b3) SHA1(207c4939331c1561d145cbee0538da072aa51f5b) ) + ROM_LOAD_STAGGERED( "sb-gp5.bin", 0x1000, CRC(013615a3) SHA1(1795a4dcc98255ad185503a99f48b7bacb5edc9d) ) ROM_REGION( 0x8000, "audiocpu", 0 ) - ROM_LOAD( "sf-sdp1.bin", 0x0000, 0x0800, CRC(339a327f) SHA1(940887cd4660e37537fd9b57aa1ec3a4717ea0cf) ) + ROM_LOAD( "sb-sdp1.bin", 0x0000, 0x0800, CRC(e977c090) SHA1(24bd4165434c745c1514d49cc90bcb621fb3a0f8) ) - CVS_ROM_REGION_SPEECH_DATA( "sf-sp1.bin", 0x1000, CRC(c5628d30) SHA1(d29a5852a1762cbd5f3eba29ae2bf49b3a26f894) ) + CVS_ROM_REGION_SPEECH_DATA( "sb-sp1.bin", 0x0800, CRC(0aeb9ccd) SHA1(e7123eed21e4e758bbe1cebfd5aad44a5de45c27) ) ROM_REGION( 0x1800, "tiles", 0 ) - ROM_LOAD( "sf-cp1.bin", 0x0000, 0x0800, CRC(da194a68) SHA1(4215267e91644cf1e1f32f898bc9562bfba711f3) ) - ROM_LOAD( "sf-cp2.bin", 0x0800, 0x0800, CRC(b96977c7) SHA1(8f0fab044f16787bce83562e2b22d962d0a2c209) ) - ROM_LOAD( "sf-cp3.bin", 0x1000, 0x0800, CRC(f5d67b9a) SHA1(a492b41c53b1f28ac5f70969e5f06afa948c1a7d) ) + ROM_LOAD( "sb-cp1.bin", 0x0000, 0x0800, CRC(03ba7760) SHA1(4ed252e2c4ec7cea2199524f7c35a1dc7c44f8d8) ) + ROM_LOAD( "sb-cp2.bin", 0x0800, 0x0800, CRC(04de69f2) SHA1(3ef3b3c159d47230622b6cc45baad8737bd93a90) ) + ROM_LOAD( "sb-cp3.bin", 0x1000, 0x0800, CRC(bb7d0b9a) SHA1(94c72d6961204be9cab351ac854ac9c69b51e79a) ) CVS_COMMON_ROMS ROM_END @@ -1771,6 +1835,47 @@ ROM_START( raidersr3 ) CVS_COMMON_ROMS ROM_END +ROM_START( hero ) + ROM_REGION( 0x8000, "maincpu", 0 ) + ROM_LOAD_STAGGERED( "hr-gp1.bin", 0x0000, CRC(82f39788) SHA1(44217dc2312d10fceeb35adf3999cd6f240b60be) ) + ROM_LOAD_STAGGERED( "hr-gp2.bin", 0x0400, CRC(79607812) SHA1(eaab829a2f5bcb8ec92c3f4122cffae31a4a77cb) ) + ROM_LOAD_STAGGERED( "hr-gp3.bin", 0x0800, CRC(2902715c) SHA1(cf63f72681d1dcbdabdf7673ad8f61b5969e4bd1) ) + ROM_LOAD_STAGGERED( "hr-gp4.bin", 0x0c00, CRC(696d2f8e) SHA1(73dd57f0f84e37ae707a89e17253aa3dd0c8b48b) ) + ROM_LOAD_STAGGERED( "hr-gp5.bin", 0x1000, CRC(936a4ba6) SHA1(86cddcfafbd93dcdad3a1f26e280ceb96f779ab0) ) + + ROM_REGION( 0x8000, "audiocpu", 0 ) + ROM_LOAD( "hr-sdp1.bin", 0x0000, 0x0800, CRC(c34ecf79) SHA1(07c96283410b1e7401140094db95800708cf310f) ) + + CVS_ROM_REGION_SPEECH_DATA( "hr-sp1.bin", 0x0800, CRC(a5c33cb1) SHA1(447ffb193b0dc4985bae5d8c214a893afd08664b) ) + + ROM_REGION( 0x1800, "tiles", 0 ) + ROM_LOAD( "hr-cp1.bin", 0x0000, 0x0800, CRC(2d201496) SHA1(f195aa1b231a0e1752c7da824a10321f0527f8c9) ) + ROM_LOAD( "hr-cp2.bin", 0x0800, 0x0800, CRC(21b61fe3) SHA1(31882003f0557ffc4ec38ae6ee07b5d294b4162c) ) + ROM_LOAD( "hr-cp3.bin", 0x1000, 0x0800, CRC(9c8e3f9e) SHA1(9d949a4d12b45da12b434677670b2b109568564a) ) + + CVS_COMMON_ROMS +ROM_END + +ROM_START( huncholy ) + ROM_REGION( 0x8000, "maincpu", 0 ) + ROM_LOAD_STAGGERED( "ho-gp1.bin", 0x0000, CRC(4f17cda7) SHA1(ae6fe495c723042c6e060d4ada50aaef1019d5eb) ) + ROM_LOAD_STAGGERED( "ho-gp2.bin", 0x0400, CRC(70fa52c7) SHA1(179813fdc204870d72c0bfa8cd5dbf277e1f67c4) ) + ROM_LOAD_STAGGERED( "ho-gp3.bin", 0x0800, CRC(931934b1) SHA1(08fe5ad3459862246e9ea845abab4e01e1dbd62d) ) + ROM_LOAD_STAGGERED( "ho-gp4.bin", 0x0c00, CRC(af5cd501) SHA1(9a79b173aa41a82faa9f19210d3e18bfa6c593fa) ) + ROM_LOAD_STAGGERED( "ho-gp5.bin", 0x1000, CRC(658e8974) SHA1(30d0ada1cce99a842bad8f5a58630bc1b7048b03) ) + + ROM_REGION( 0x8000, "audiocpu", 0 ) + ROM_LOAD( "ho-sdp1.bin", 0x0000, 0x1000, CRC(3efb3ffd) SHA1(be4807c8b4fe23f2247aa3b6ac02285bee1a0520) ) + + CVS_ROM_REGION_SPEECH_DATA( "ho-sp1.bin", 0x1000, CRC(3fd39b1e) SHA1(f5d0b2cfaeda994762403f039a6f7933c5525234) ) + + ROM_REGION( 0x1800, "tiles", 0 ) + ROM_LOAD( "ho-cp1.bin", 0x0000, 0x0800, CRC(c6c73d46) SHA1(63aba92f77105fedf46337b591b074020bec05d0) ) + ROM_LOAD( "ho-cp2.bin", 0x0800, 0x0800, CRC(e596371c) SHA1(93a0d0ccdf830ae72d070b03b7e2222f4a737ead) ) + ROM_LOAD( "ho-cp3.bin", 0x1000, 0x0800, CRC(11fae1cf) SHA1(5ceabfb1ff1a6f76d1649512f57d7151f5258ecb) ) + + CVS_COMMON_ROMS +ROM_END @@ -1780,53 +1885,44 @@ ROM_END * *************************************/ -uint8_t cvs_state::huncholy_prot_r(offs_t offset) -{ - if (offset == 1) - { - m_protection_counter++; - if ((m_protection_counter & 0x0f) == 0x01) return 0x00; - return 0xff; - } - - return 0; // offset 0 -} - -void cvs_state::init_huncholy() -{ - m_maincpu->space(AS_PROGRAM).install_read_handler(0x6ff1, 0x6ff2, read8sm_delegate(*this, FUNC(cvs_state::huncholy_prot_r))); - - save_item(NAME(m_protection_counter)); - m_protection_counter = 0; -} - - void cvs_state::init_hunchbaka() { - uint8_t *rom = memregion("maincpu")->base(); + u8 *rom = memregion("maincpu")->base(); + // data lines D2 and D5 swapped for (offs_t offs = 0; offs < 0x7400; offs++) rom[offs] = bitswap<8>(rom[offs], 7, 6, 2, 4, 3, 5, 1, 0); } -uint8_t cvs_state::superbik_prot_r() +u8 cvs_state::superbik_prot_r() { - m_protection_counter++; - if ((m_protection_counter & 0x0f) == 0x02) return 0; - return 0xff; + if (!machine().side_effects_disabled()) + m_protection_counter++; + + return ((m_protection_counter & 0x0f) == 0x02) ? 0 : 0xff; } void cvs_state::init_superbik() { - m_protection_counter = 0; m_maincpu->space(AS_PROGRAM).install_read_handler(0x73f1, 0x73f2, read8smo_delegate(*this, FUNC(cvs_state::superbik_prot_r))); +} - save_item(NAME(m_protection_counter)); + +void cvs_state::init_raiders() +{ + u8 *rom = memregion("maincpu")->base(); + + // data lines D1 and D6 swapped + for (offs_t offs = 0; offs < 0x7400; offs++) + rom[offs] = bitswap<8>(rom[offs], 7, 1, 5, 4, 3, 2, 6, 0); + + // partially remove mirroring on $3xxx/$7xxx (protection) + m_maincpu->space(AS_PROGRAM).unmap_readwrite(0x3400, 0x3bff, 0x4000); } -uint8_t cvs_state::hero_prot_r(offs_t offset) +u8 cvs_state::hero_prot_r(offs_t offset) { u8 *rom = memregion("maincpu")->base() + 0x73f0; @@ -1857,49 +1953,56 @@ void cvs_state::init_hero() } -void cvs_state::init_raiders() +u8 cvs_state::huncholy_prot_r(offs_t offset) { - uint8_t *rom = memregion("maincpu")->base(); + if (offset == 1) + { + if (!machine().side_effects_disabled()) + m_protection_counter++; - // data lines D1 and D6 swapped - for (offs_t offs = 0; offs < 0x7400; offs++) - rom[offs] = bitswap<8>(rom[offs], 7, 1, 5, 4, 3, 2, 6, 0); + return ((m_protection_counter & 0x0f) == 0x01) ? 0 : 0xff; + } + + return 0; // offset 0 +} - // patch out protection - rom[0x010a] = 0xc0; - rom[0x010b] = 0xc0; - rom[0x010c] = 0xc0; +void cvs_state::init_huncholy() +{ + m_maincpu->space(AS_PROGRAM).install_read_handler(0x6ff1, 0x6ff2, read8sm_delegate(*this, FUNC(cvs_state::huncholy_prot_r))); } + } // anonymous namespace + /************************************* * * Game drivers * *************************************/ -GAME( 1981, cosmos, 0, cvs, cosmos, cvs_state, empty_init, ROT90, "Century Electronics", "Cosmos", MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) -GAME( 1981, darkwar, 0, cvs, darkwar, cvs_state, empty_init, ROT90, "Century Electronics", "Dark Warrior", MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) -GAME( 1981, spacefrt, 0, cvs, spacefrt, cvs_state, empty_init, ROT90, "Century Electronics", "Space Fortress (CVS)", MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) -GAME( 1982, 8ball, 0, cvs, 8ball, cvs_state, empty_init, ROT90, "Century Electronics", "Video Eight Ball", MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) -GAME( 1982, 8ball1, 8ball, cvs, 8ball, cvs_state, empty_init, ROT90, "Century Electronics", "Video Eight Ball (Rev.1)", MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) -GAME( 1982, logger, 0, cvs, logger, cvs_state, empty_init, ROT90, "Century Electronics", "Logger (Rev.3)", MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) -GAME( 1982, loggerr2, logger, cvs, logger, cvs_state, empty_init, ROT90, "Century Electronics (Enter-Tech, Ltd. license)", "Logger (Rev.2)", MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) -GAME( 1982, dazzler, 0, cvs, dazzler, cvs_state, empty_init, ROT90, "Century Electronics", "Dazzler", MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) -GAME( 1982, wallst, 0, cvs, wallst, cvs_state, empty_init, ROT90, "Century Electronics", "Wall Street", MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) -GAME( 1982, radarzon, 0, cvs, radarzon, cvs_state, empty_init, ROT90, "Century Electronics", "Radar Zone", MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) -GAME( 1982, radarzon1, radarzon, cvs, radarzon, cvs_state, empty_init, ROT90, "Century Electronics", "Radar Zone (Rev.1)", MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) -GAME( 1982, radarzont, radarzon, cvs, radarzon, cvs_state, empty_init, ROT90, "Century Electronics (Tuni Electro Service license)", "Radar Zone (Tuni)", MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) // Tuni Electro Service = predecessor to Enter-Tech -GAME( 1982, outline, radarzon, cvs, radarzon, cvs_state, empty_init, ROT90, "Century Electronics", "Outline", MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) -GAME( 1982, goldbug, 0, cvs, goldbug, cvs_state, empty_init, ROT90, "Century Electronics", "Gold Bug", MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) -GAME( 1982, diggerc, 0, cvs, diggerc, cvs_state, empty_init, ROT90, "Century Electronics", "Digger (CVS)", MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) -GAME( 1983, heartatk, 0, cvs, heartatk, cvs_state, empty_init, ROT90, "Century Electronics", "Heart Attack", MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) -GAME( 1983, hunchbak, 0, cvs, hunchbak, cvs_state, empty_init, ROT90, "Century Electronics", "Hunchback (set 1)", MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) -GAME( 1983, hunchbaka, hunchbak, cvs, hunchbak, cvs_state, init_hunchbaka, ROT90, "Century Electronics", "Hunchback (set 2)", MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) -GAME( 1983, superbik, 0, cvs, superbik, cvs_state, init_superbik, ROT90, "Century Electronics", "Superbike", MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) -GAME( 1983, raiders, 0, cvs, raiders, cvs_state, init_raiders, ROT90, "Century Electronics", "Raiders", MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_SOUND | MACHINE_UNEMULATED_PROTECTION| MACHINE_SUPPORTS_SAVE ) -GAME( 1983, raidersr3, raiders, cvs, raiders, cvs_state, init_raiders, ROT90, "Century Electronics", "Raiders (Rev.3)", MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_SOUND | MACHINE_UNEMULATED_PROTECTION| MACHINE_SUPPORTS_SAVE ) -GAME( 1984, hero, 0, cvs, hero, cvs_state, init_hero, ROT90, "Seatongrove UK, Ltd.", "Hero", MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) // (C) 1984 CVS on titlescreen, (C) 1983 Seatongrove on highscore screen -GAME( 1984, huncholy, 0, cvs, huncholy, cvs_state, init_huncholy, ROT90, "Seatongrove UK, Ltd.", "Hunchback Olympic", MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) +// YEAR, NAME, PARENT, MACHINE, INPUT, CLASS, INIT, SCREEN, COMPANY, FULLNAME, FLAGS +GAME( 1981, cosmos, 0, cvs, cosmos, cvs_state, empty_init, ROT90, "Century Electronics", "Cosmos", MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) +GAME( 1981, darkwar, 0, cvs, darkwar, cvs_state, empty_init, ROT90, "Century Electronics", "Dark Warrior", MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) +GAME( 1981, spacefrt, 0, cvs, spacefrt, cvs_state, empty_init, ROT90, "Century Electronics", "Space Fortress (CVS)", MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) +GAME( 1982, 8ball, 0, cvs, 8ball, cvs_state, empty_init, ROT90, "Century Electronics", "Video Eight Ball", MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) +GAME( 1982, 8ball1, 8ball, cvs, 8ball, cvs_state, empty_init, ROT90, "Century Electronics", "Video Eight Ball (Rev.1)", MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) +GAME( 1982, logger, 0, cvs, logger, cvs_state, empty_init, ROT90, "Century Electronics", "Logger (Rev.3)", MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) +GAME( 1982, loggerr2, logger, cvs, logger, cvs_state, empty_init, ROT90, "Century Electronics (Enter-Tech, Ltd. license)", "Logger (Rev.2)", MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) +GAME( 1982, dazzler, 0, cvs, dazzler, cvs_state, empty_init, ROT90, "Century Electronics", "Dazzler", MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) +GAME( 1982, wallst, 0, cvs, wallst, cvs_state, empty_init, ROT90, "Century Electronics", "Wall Street", MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) +GAME( 1982, radarzon, 0, cvs, radarzon, cvs_state, empty_init, ROT90, "Century Electronics", "Radar Zone", MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) +GAME( 1982, radarzon1, radarzon, cvs, radarzon, cvs_state, empty_init, ROT90, "Century Electronics", "Radar Zone (Rev.1)", MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) +GAME( 1982, radarzont, radarzon, cvs, radarzon, cvs_state, empty_init, ROT90, "Century Electronics (Tuni Electro Service license)", "Radar Zone (Tuni)", MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) // Tuni Electro Service = predecessor to Enter-Tech +GAME( 1982, outline, radarzon, cvs, radarzon, cvs_state, empty_init, ROT90, "Century Electronics", "Outline", MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) +GAME( 1982, goldbug, 0, cvs, goldbug, cvs_state, empty_init, ROT90, "Century Electronics", "Gold Bug", MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) +GAME( 1982, diggerc, 0, cvs, diggerc, cvs_state, empty_init, ROT90, "Century Electronics", "Digger (CVS)", MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) +GAME( 1983, heartatk, 0, cvs, heartatk, cvs_state, empty_init, ROT90, "Century Electronics", "Heart Attack", MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) +GAME( 1983, hunchbak, 0, cvs, hunchbak, cvs_state, empty_init, ROT90, "Century Electronics", "Hunchback (set 1)", MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) +GAME( 1983, hunchbaka, hunchbak, cvs, hunchbak, cvs_state, init_hunchbaka, ROT90, "Century Electronics", "Hunchback (set 2)", MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) +GAME( 1983, superbik, 0, cvs, superbik, cvs_state, init_superbik, ROT90, "Century Electronics", "Superbike", MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) +GAME( 1983, raiders, 0, cvs, raiders, cvs_state, init_raiders, ROT90, "Century Electronics", "Raiders", MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) +GAME( 1983, raidersr3, raiders, cvs, raiders, cvs_state, init_raiders, ROT90, "Century Electronics", "Raiders (Rev.3)", MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) +GAME( 1984, hero, 0, cvs, hero, cvs_state, init_hero, ROT90, "Seatongrove UK, Ltd.", "Hero", MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) // (C) 1984 CVS on titlescreen, (C) 1983 Seatongrove on highscore screen +GAME( 1984, huncholy, 0, cvs, huncholy, cvs_state, init_huncholy, ROT90, "Seatongrove UK, Ltd.", "Hunchback Olympic", MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/misc/gotcha.cpp b/src/mame/misc/gotcha.cpp index aa624d6e403..7ea36700927 100644 --- a/src/mame/misc/gotcha.cpp +++ b/src/mame/misc/gotcha.cpp @@ -10,8 +10,9 @@ driver by Nicola Salmoria - Find out what the "Explane Type" dip switch actually does. - Unknown writes to 0x30000c. It changes for some levels, it's probably gfx related but since everything seems fine I've no idea what it might do. -- Unknown sound writes at c00f; also, there's an NMI handler that would - read from c00f. +- Unknown sound writes at c00f. +- What is the audiocpu NMI for? It reads from c00f, and if you let NMI trigger + periodically, music will eventually fail. - Sound samples were getting chopped; I fixed this by changing sound/adpcm.cpp to disregard requests to play new samples until the previous one is finished*. @@ -58,7 +59,7 @@ PCB Layout ***************************************************************************/ #include "emu.h" -#include "gotcha.h" +#include "decospr.h" #include "cpu/m68000/m68000.h" #include "cpu/z80/z80.h" @@ -69,10 +70,167 @@ PCB Layout #include "emupal.h" #include "screen.h" #include "speaker.h" +#include "tilemap.h" #include "gotcha.lh" +namespace { + +class gotcha_state : public driver_device +{ +public: + gotcha_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), + m_fgvideoram(*this, "fgvideoram"), + m_bgvideoram(*this, "bgvideoram"), + m_spriteram(*this, "spriteram"), + m_sprgen(*this, "spritegen"), + m_audiocpu(*this, "audiocpu"), + m_maincpu(*this, "maincpu"), + m_oki(*this, "oki"), + m_gfxdecode(*this, "gfxdecode"), + m_lamp_r(*this, "lamp_p%u_r", 1U), + m_lamp_g(*this, "lamp_p%u_g", 1U), + m_lamp_b(*this, "lamp_p%u_b", 1U), + m_lamp_s(*this, "lamp_p%u_s", 1U) + { + } + + void gotcha(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: + void lamps_w(uint16_t data); + void fgvideoram_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); + void bgvideoram_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); + void gfxbank_select_w(uint8_t data); + void gfxbank_w(uint8_t data); + void scroll_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); + void oki_bank_w(uint8_t data); + TILEMAP_MAPPER_MEMBER(tilemap_scan); + TILE_GET_INFO_MEMBER(fg_get_tile_info); + TILE_GET_INFO_MEMBER(bg_get_tile_info); + uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + inline void get_tile_info( tile_data &tileinfo, int tile_index ,uint16_t *vram, int color_offs); + void main_map(address_map &map) ATTR_COLD; + void sound_map(address_map &map) ATTR_COLD; + + // memory pointers + required_shared_ptr m_fgvideoram; + required_shared_ptr m_bgvideoram; + required_shared_ptr m_spriteram; + optional_device m_sprgen; + + // video-related + tilemap_t *m_bg_tilemap = nullptr; + tilemap_t *m_fg_tilemap = nullptr; + uint8_t m_banksel = 0U; + uint8_t m_gfxbank[4]{}; + uint16_t m_scroll[4]{}; + + // devices + required_device m_audiocpu; + required_device m_maincpu; + required_device m_oki; + required_device m_gfxdecode; + + output_finder<3> m_lamp_r; + output_finder<3> m_lamp_g; + output_finder<3> m_lamp_b; + output_finder<3> m_lamp_s; +}; + + +TILEMAP_MAPPER_MEMBER(gotcha_state::tilemap_scan) +{ + return (col & 0x1f) | (row << 5) | ((col & 0x20) << 5); +} + +inline void gotcha_state::get_tile_info( tile_data &tileinfo, int tile_index ,uint16_t *vram, int color_offs) +{ + uint16_t data = vram[tile_index]; + int code = (data & 0x3ff) | (m_gfxbank[(data & 0x0c00) >> 10] << 10); + + tileinfo.set(0, code, (data >> 12) + color_offs, 0); +} + +TILE_GET_INFO_MEMBER(gotcha_state::fg_get_tile_info) +{ + get_tile_info(tileinfo, tile_index, m_fgvideoram, 0); +} + +TILE_GET_INFO_MEMBER(gotcha_state::bg_get_tile_info) +{ + get_tile_info(tileinfo, tile_index, m_bgvideoram, 16); +} + + +void gotcha_state::video_start() +{ + m_fg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(gotcha_state::fg_get_tile_info)), tilemap_mapper_delegate(*this, FUNC(gotcha_state::tilemap_scan)), 16, 16, 64, 32); + m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(gotcha_state::bg_get_tile_info)), tilemap_mapper_delegate(*this, FUNC(gotcha_state::tilemap_scan)), 16, 16, 64, 32); + + m_fg_tilemap->set_transparent_pen(0); + + m_fg_tilemap->set_scrolldx(-1, 0); + m_bg_tilemap->set_scrolldx(-5, 0); +} + + +void gotcha_state::fgvideoram_w(offs_t offset, uint16_t data, uint16_t mem_mask) +{ + COMBINE_DATA(&m_fgvideoram[offset]); + m_fg_tilemap->mark_tile_dirty(offset); +} + +void gotcha_state::bgvideoram_w(offs_t offset, uint16_t data, uint16_t mem_mask) +{ + COMBINE_DATA(&m_bgvideoram[offset]); + m_bg_tilemap->mark_tile_dirty(offset); +} + +void gotcha_state::gfxbank_select_w(uint8_t data) +{ + m_banksel = data & 0x03; +} + +void gotcha_state::gfxbank_w(uint8_t data) +{ + if (m_gfxbank[m_banksel] != (data & 0x0f)) + { + m_gfxbank[m_banksel] = data & 0x0f; + machine().tilemap().mark_all_dirty(); + } +} + +void gotcha_state::scroll_w(offs_t offset, uint16_t data, uint16_t mem_mask) +{ + COMBINE_DATA(&m_scroll[offset]); + + switch (offset) + { + case 0: m_fg_tilemap->set_scrollx(0, m_scroll[0]); break; + case 1: m_fg_tilemap->set_scrolly(0, m_scroll[1]); break; + case 2: m_bg_tilemap->set_scrollx(0, m_scroll[2]); break; + case 3: m_bg_tilemap->set_scrolly(0, m_scroll[3]); break; + } +} + + +uint32_t gotcha_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + m_bg_tilemap->draw(screen, bitmap, cliprect); + m_fg_tilemap->draw(screen, bitmap, cliprect); + m_sprgen->draw_sprites(bitmap, cliprect, m_spriteram, 0x400); + return 0; +} + + void gotcha_state::lamps_w(uint16_t data) { for (int p = 0; p < 3; p++) @@ -273,7 +431,6 @@ void gotcha_state::gotcha(machine_config &config) screen.set_screen_update(FUNC(gotcha_state::screen_update)); screen.set_palette("palette"); screen.screen_vblank().set_inputline(m_maincpu, M68K_IRQ_6, HOLD_LINE); - screen.screen_vblank().append_inputline(m_audiocpu, INPUT_LINE_NMI); // ? GFXDECODE(config, m_gfxdecode, "palette", gfx_gotcha); PALETTE(config, "palette").set_format(palette_device::xRGB_555, 768); @@ -411,6 +568,9 @@ ROM_START( ppchampa ) ROM_LOAD( "uz11", 0x00000, 0x80000, CRC(3d96274c) SHA1(c7a670af86194c370bf8fb30afbe027ab78a0227) ) ROM_END +} // anonymous namespace + + GAMEL( 1997, gotcha, 0, gotcha, gotcha, gotcha_state, empty_init, ROT0, "Dongsung / Para", "Got-cha Mini Game Festival", MACHINE_SUPPORTS_SAVE, layout_gotcha ) GAMEL( 1997, ppchamp, gotcha, gotcha, gotcha, gotcha_state, empty_init, ROT0, "Dongsung / Para", "Pasha Pasha Champ Mini Game Festival (Korea, set 1)", MACHINE_SUPPORTS_SAVE, layout_gotcha ) GAMEL( 1997, ppchampa, gotcha, gotcha, gotcha, gotcha_state, empty_init, ROT0, "Dongsung / Para", "Pasha Pasha Champ Mini Game Festival (Korea, set 2)", MACHINE_SUPPORTS_SAVE, layout_gotcha ) diff --git a/src/mame/misc/gotcha.h b/src/mame/misc/gotcha.h deleted file mode 100644 index 7543d333bdb..00000000000 --- a/src/mame/misc/gotcha.h +++ /dev/null @@ -1,86 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Nicola Salmoria -/************************************************************************* - - Gotcha - -*************************************************************************/ -#ifndef MAME_MISC_GOTCHA_H -#define MAME_MISC_GOTCHA_H - -#pragma once - -#include "decospr.h" - -#include "sound/okim6295.h" -#include "tilemap.h" - -class gotcha_state : public driver_device -{ -public: - gotcha_state(const machine_config &mconfig, device_type type, const char *tag) : - driver_device(mconfig, type, tag), - m_fgvideoram(*this, "fgvideoram"), - m_bgvideoram(*this, "bgvideoram"), - m_spriteram(*this, "spriteram"), - m_sprgen(*this, "spritegen"), - m_audiocpu(*this, "audiocpu"), - m_maincpu(*this, "maincpu"), - m_oki(*this, "oki"), - m_gfxdecode(*this, "gfxdecode"), - m_lamp_r(*this, "lamp_p%u_r", 1U), - m_lamp_g(*this, "lamp_p%u_g", 1U), - m_lamp_b(*this, "lamp_p%u_b", 1U), - m_lamp_s(*this, "lamp_p%u_s", 1U) - { - } - - void gotcha(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: - void lamps_w(uint16_t data); - void fgvideoram_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); - void bgvideoram_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); - void gfxbank_select_w(uint8_t data); - void gfxbank_w(uint8_t data); - void scroll_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); - void oki_bank_w(uint8_t data); - TILEMAP_MAPPER_MEMBER(tilemap_scan); - TILE_GET_INFO_MEMBER(fg_get_tile_info); - TILE_GET_INFO_MEMBER(bg_get_tile_info); - uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - inline void get_tile_info( tile_data &tileinfo, int tile_index ,uint16_t *vram, int color_offs); - void main_map(address_map &map) ATTR_COLD; - void sound_map(address_map &map) ATTR_COLD; - - /* memory pointers */ - required_shared_ptr m_fgvideoram; - required_shared_ptr m_bgvideoram; - required_shared_ptr m_spriteram; - optional_device m_sprgen; - - /* video-related */ - tilemap_t *m_bg_tilemap = nullptr; - tilemap_t *m_fg_tilemap = nullptr; - uint8_t m_banksel = 0U; - uint8_t m_gfxbank[4]{}; - uint16_t m_scroll[4]{}; - - /* devices */ - required_device m_audiocpu; - required_device m_maincpu; - required_device m_oki; - required_device m_gfxdecode; - - output_finder<3> m_lamp_r; - output_finder<3> m_lamp_g; - output_finder<3> m_lamp_b; - output_finder<3> m_lamp_s; -}; - -#endif // MAME_MISC_GOTCHA_H diff --git a/src/mame/misc/gotcha_v.cpp b/src/mame/misc/gotcha_v.cpp deleted file mode 100644 index b78878f7c20..00000000000 --- a/src/mame/misc/gotcha_v.cpp +++ /dev/null @@ -1,102 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Nicola Salmoria -#include "emu.h" -#include "gotcha.h" - - -/*************************************************************************** - - Callbacks for the TileMap code - -***************************************************************************/ - -TILEMAP_MAPPER_MEMBER(gotcha_state::tilemap_scan) -{ - return (col & 0x1f) | (row << 5) | ((col & 0x20) << 5); -} - -inline void gotcha_state::get_tile_info( tile_data &tileinfo, int tile_index ,uint16_t *vram, int color_offs) -{ - uint16_t data = vram[tile_index]; - int code = (data & 0x3ff) | (m_gfxbank[(data & 0x0c00) >> 10] << 10); - - tileinfo.set(0, code, (data >> 12) + color_offs, 0); -} - -TILE_GET_INFO_MEMBER(gotcha_state::fg_get_tile_info) -{ - get_tile_info(tileinfo, tile_index, m_fgvideoram, 0); -} - -TILE_GET_INFO_MEMBER(gotcha_state::bg_get_tile_info) -{ - get_tile_info(tileinfo, tile_index, m_bgvideoram, 16); -} - - - -/*************************************************************************** - - Start the video hardware emulation. - -***************************************************************************/ - -void gotcha_state::video_start() -{ - m_fg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(gotcha_state::fg_get_tile_info)), tilemap_mapper_delegate(*this, FUNC(gotcha_state::tilemap_scan)), 16, 16, 64, 32); - m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(gotcha_state::bg_get_tile_info)), tilemap_mapper_delegate(*this, FUNC(gotcha_state::tilemap_scan)), 16, 16, 64, 32); - - m_fg_tilemap->set_transparent_pen(0); - - m_fg_tilemap->set_scrolldx(-1, 0); - m_bg_tilemap->set_scrolldx(-5, 0); -} - - -void gotcha_state::fgvideoram_w(offs_t offset, uint16_t data, uint16_t mem_mask) -{ - COMBINE_DATA(&m_fgvideoram[offset]); - m_fg_tilemap->mark_tile_dirty(offset); -} - -void gotcha_state::bgvideoram_w(offs_t offset, uint16_t data, uint16_t mem_mask) -{ - COMBINE_DATA(&m_bgvideoram[offset]); - m_bg_tilemap->mark_tile_dirty(offset); -} - -void gotcha_state::gfxbank_select_w(uint8_t data) -{ - m_banksel = data & 0x03; -} - -void gotcha_state::gfxbank_w(uint8_t data) -{ - if (m_gfxbank[m_banksel] != (data & 0x0f)) - { - m_gfxbank[m_banksel] = data & 0x0f; - machine().tilemap().mark_all_dirty(); - } -} - -void gotcha_state::scroll_w(offs_t offset, uint16_t data, uint16_t mem_mask) -{ - COMBINE_DATA(&m_scroll[offset]); - - switch (offset) - { - case 0: m_fg_tilemap->set_scrollx(0, m_scroll[0]); break; - case 1: m_fg_tilemap->set_scrolly(0, m_scroll[1]); break; - case 2: m_bg_tilemap->set_scrollx(0, m_scroll[2]); break; - case 3: m_bg_tilemap->set_scrolly(0, m_scroll[3]); break; - } -} - - -uint32_t gotcha_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) -{ - m_bg_tilemap->draw(screen, bitmap, cliprect); - m_fg_tilemap->draw(screen, bitmap, cliprect); - m_sprgen->draw_sprites(bitmap, cliprect, m_spriteram, 0x400); - return 0; -} diff --git a/src/mame/misc/joystand.cpp b/src/mame/misc/joystand.cpp index a3e411e2893..93f7d927ad8 100644 --- a/src/mame/misc/joystand.cpp +++ b/src/mame/misc/joystand.cpp @@ -782,9 +782,9 @@ ROM_START( x180 ) // YUVO PCC180C PCB + JSR-1A REV.B riser PCB. Similar to the j ROM_LOAD16_BYTE( "msvol1b.odd.u6", 0x00001, 0x80000, CRC(dd46fd51) SHA1(60832cb90d5335cd55422e56c8482ac7c88f70ff) ) ROM_REGION( 0x600000, "tiles", 0 ) // on riser PCB - ROM_LOAD( "e28f016sa.u1", 0x000000, 0x200000, NO_DUMP ) - ROM_LOAD( "e28f016sa.u2", 0x200000, 0x200000, NO_DUMP ) - ROM_LOAD( "e28f016sa.u3", 0x400000, 0x200000, NO_DUMP ) + ROM_LOAD( "e28f016sa.u3", 0x000000, 0x200000, CRC(cbb9ca7f) SHA1(3e7679142ce9c87d654f3fb2b53c560a145d2150) ) + ROM_LOAD( "e28f016sa.u2", 0x200000, 0x200000, CRC(308666c1) SHA1(68c8617b5c0514bc57d1c98a9d73bc310542bf8b) ) + ROM_LOAD( "e28f016sa.u1", 0x400000, 0x200000, CRC(4e478f0a) SHA1(627947a6c26a9ab61bb1f61389e8ba1ce64b3d56) ) ROM_REGION( 0x100000, "oki", 0 ) ROM_LOAD( "x180-sej1.ver1.00.ic14", 0x00000, 0x80000, CRC(86a0801b) SHA1(a252ed786bf51b963feb6ff253303ea3b67d8fcf) ) diff --git a/src/mame/misc/laserbas.cpp b/src/mame/misc/laserbas.cpp index f985a50bebb..b1aaebc465f 100644 --- a/src/mame/misc/laserbas.cpp +++ b/src/mame/misc/laserbas.cpp @@ -520,8 +520,21 @@ ROM_START( futflash ) ROM_LOAD( "ff.8", 0xf000, 0x0800, CRC(623f558f) SHA1(be6c6565df658555f21c43a8c2459cf399794a84) ) ROM_END +ROM_START( futflasha ) // XBC-101-02-1 + XBC-102-02-1 PCBs. This set shows blue instead of black backgrounds. Seems an earlier release. + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "1.a8", 0x0000, 0x1000, CRC(c41fcd92) SHA1(3981aaf9486b2c8b8467d5ac4768bdded3e27586) ) + ROM_LOAD( "2.a9", 0x1000, 0x1000, CRC(4375ecb4) SHA1(20e5a19f4835622337bd8fc8f367a8d18f386606) ) + ROM_LOAD( "3.a10", 0x2000, 0x1000, CRC(da415ea9) SHA1(c1f76b3d72dc162ff65676a03bc502ba5732283d) ) + ROM_LOAD( "4.a11", 0x3000, 0x1000, CRC(16c8fd53) SHA1(1c05ef472ce326069b1e33bd041eb3f02bf66b32) ) + ROM_LOAD( "5.a12", 0xc000, 0x1000, CRC(6459073e) SHA1(78b8a23534826dd2d3b3c6c5d5708c8a78a4b6bf) ) // same as set 1 + ROM_LOAD( "6.b8", 0xd000, 0x1000, CRC(ddf623ee) SHA1(5640071eb01c5102f1df0f58f1493617adbe370a) ) + ROM_LOAD( "7.b9", 0xe000, 0x1000, CRC(9d2148d7) SHA1(24954d82a09d9fcfdc61e91b7c824daa5dd701c3) ) // same as set 1 + ROM_LOAD( "8.b10", 0xf000, 0x0800, CRC(a539dd18) SHA1(3d8a23aeab7cb907fcd9f7d416527dcad3f84d1f) ) +ROM_END + } // anonymous namespace -GAME( 1980, futflash, 0, laserbas, laserbas, laserbas_state, empty_init, ROT270, "Hoei", "Future Flash", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_COLORS | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) -GAME( 1981, laserbas, futflash, laserbas, laserbas, laserbas_state, empty_init, ROT270, "Hoei (Amstar license)", "Laser Base (set 1)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_COLORS | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) -GAME( 1981, laserbasa, futflash, laserbas, laserbas, laserbas_state, empty_init, ROT270, "Hoei (Amstar license)", "Laser Base (set 2)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_COLORS | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) +GAME( 1980, futflash, 0, laserbas, laserbas, laserbas_state, empty_init, ROT270, "Hoei", "Future Flash (set 1)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_COLORS | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) +GAME( 1980, futflasha, futflash, laserbas, laserbas, laserbas_state, empty_init, ROT270, "Hoei", "Future Flash (set 2)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_COLORS | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) +GAME( 1981, laserbas, futflash, laserbas, laserbas, laserbas_state, empty_init, ROT270, "Hoei (Amstar license)", "Laser Base (set 1)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_COLORS | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) +GAME( 1981, laserbasa, futflash, laserbas, laserbas, laserbas_state, empty_init, ROT270, "Hoei (Amstar license)", "Laser Base (set 2)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_COLORS | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/misc/mirax.cpp b/src/mame/misc/mirax.cpp index 2ee824ab706..e44d4548c52 100644 --- a/src/mame/misc/mirax.cpp +++ b/src/mame/misc/mirax.cpp @@ -221,7 +221,7 @@ void mirax_state::mirax_palette(palette_device &palette) const // blue component bit0 = BIT(color_prom[i], 6); bit1 = BIT(color_prom[i], 7); - int const b = 0x4f * bit0 + 0xa8 * bit1; + int const b = 0x52 * bit0 + 0xad * bit1; palette.set_pen_color(i, rgb_t(r, g, b)); } diff --git a/src/mame/misc/winbingo.cpp b/src/mame/misc/winbingo.cpp index 686a03a9ad4..1221d8fe070 100644 --- a/src/mame/misc/winbingo.cpp +++ b/src/mame/misc/winbingo.cpp @@ -25,10 +25,12 @@ The only partially dumped game is Win Bingo 2006 */ #include "emu.h" + +#include "cpu/h8/h83048.h" + #include "emupal.h" #include "screen.h" #include "speaker.h" -#include "cpu/h8/h83048.h" namespace { @@ -38,7 +40,7 @@ class winbingo_state : public driver_device public: winbingo_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag) - {} + { } void wbingo06(machine_config &config); diff --git a/src/mame/misc/xyonix.cpp b/src/mame/misc/xyonix.cpp index 552fe63fbc4..b5729d3174e 100644 --- a/src/mame/misc/xyonix.cpp +++ b/src/mame/misc/xyonix.cpp @@ -158,7 +158,7 @@ void xyonix_state::palette(palette_device &palette) const // blue component bit0 = BIT(color_prom[i], 3); bit1 = BIT(color_prom[i], 4); - int const b = 0x4f * bit0 + 0xa8 * bit1; + int const b = 0x52 * bit0 + 0xad * bit1; palette.set_pen_color(i, rgb_t(r, g, b)); } diff --git a/src/mame/mr/dribling.cpp b/src/mame/modelracing/dribling.cpp similarity index 100% rename from src/mame/mr/dribling.cpp rename to src/mame/modelracing/dribling.cpp diff --git a/src/mame/mr/nl_dribling.cpp b/src/mame/modelracing/nl_dribling.cpp similarity index 100% rename from src/mame/mr/nl_dribling.cpp rename to src/mame/modelracing/nl_dribling.cpp diff --git a/src/mame/mr/nl_dribling.h b/src/mame/modelracing/nl_dribling.h similarity index 50% rename from src/mame/mr/nl_dribling.h rename to src/mame/modelracing/nl_dribling.h index bf48dde146c..9799006b0f7 100644 --- a/src/mame/mr/nl_dribling.h +++ b/src/mame/modelracing/nl_dribling.h @@ -1,10 +1,10 @@ // license:BSD-3-Clause // copyright-holders: Enzo Lombardi -#ifndef MAME_MR_NL_DRIBLING_H -#define MAME_MR_NL_DRIBLING_H +#ifndef MAME_MODELRACING_NL_DRIBLING_H +#define MAME_MODELRACING_NL_DRIBLING_H #include "netlist/nl_setup.h" NETLIST_EXTERNAL(dribling) -#endif // MAME_MR_NL_DRIBLING_H +#endif // MAME_MODELRACING_NL_DRIBLING_H diff --git a/src/mame/mr/sshot.cpp b/src/mame/modelracing/sshot.cpp similarity index 99% rename from src/mame/mr/sshot.cpp rename to src/mame/modelracing/sshot.cpp index f6715c2d179..05c4f29a28d 100644 --- a/src/mame/mr/sshot.cpp +++ b/src/mame/modelracing/sshot.cpp @@ -5,10 +5,11 @@ * Model Racing's Super Shot * Model Racing's Gun Champ on Super Shot hardware - Driver by Mariusz Wojcieszek +Driver by Mariusz Wojcieszek + +TODO: +- Discrete sound - Todo: - - Discrete sound SUPER SHOT Mainboard: @@ -380,7 +381,7 @@ void sshot_state::sshot(machine_config &config) // video hardware SCREEN(config, m_screen, SCREEN_TYPE_RASTER); - m_screen->set_refresh_hz(60); + m_screen->set_refresh_hz(50); m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(2500)); m_screen->set_size(32*8, 32*8); m_screen->set_visarea(0*8, 31*8-1, 0*8, 32*8-1); diff --git a/src/mame/mr/subhuntr.cpp b/src/mame/modelracing/subhuntr.cpp similarity index 98% rename from src/mame/mr/subhuntr.cpp rename to src/mame/modelracing/subhuntr.cpp index 5c7b3f6cf53..ea4aad5bc36 100644 --- a/src/mame/mr/subhuntr.cpp +++ b/src/mame/modelracing/subhuntr.cpp @@ -29,8 +29,10 @@ horizontal/vertical sync pulse. */ #include "emu.h" + #include "cpu/s2650/s2650.h" #include "machine/s2636.h" + #include "emupal.h" #include "screen.h" #include "speaker.h" @@ -206,16 +208,13 @@ TIMER_CALLBACK_MEMBER(subhuntr_state::video_callback) if (!y) { - m_pvi1_h5->render_first_line(); - m_pvi2_l5->render_first_line(); - m_pvi3_n5->render_first_line(); - } - else - { - m_pvi1_h5->render_next_line(); - m_pvi2_l5->render_next_line(); - m_pvi3_n5->render_next_line(); + m_pvi1_h5->start_new_frame(); + m_pvi2_l5->start_new_frame(); + m_pvi3_n5->start_new_frame(); } + m_pvi1_h5->render_next_line(); + m_pvi2_l5->render_next_line(); + m_pvi3_n5->render_next_line(); u16 const *src1 = &m_pvi1_h5->bitmap().pix(y); u16 const *src2 = &m_pvi2_l5->bitmap().pix(y); diff --git a/src/mame/nasco/crgolf.cpp b/src/mame/nasco/crgolf.cpp index e6c335d7616..09c6e1e2698 100644 --- a/src/mame/nasco/crgolf.cpp +++ b/src/mame/nasco/crgolf.cpp @@ -247,7 +247,7 @@ void crgolf_state::palette(palette_device &palette) const // blue component bit0 = BIT(data, 6); bit1 = BIT(data, 7); - int const b = 0x4f * bit0 + 0xa8 * bit1; + int const b = 0x52 * bit0 + 0xad * bit1; m_palette->set_pen_color(offs, r, g, b); } diff --git a/src/mame/nec/pc9801.cpp b/src/mame/nec/pc9801.cpp index 580d8876022..07e7a48b3c5 100644 --- a/src/mame/nec/pc9801.cpp +++ b/src/mame/nec/pc9801.cpp @@ -847,6 +847,8 @@ void pc9801vm_state::pc9801rs_a0_w(offs_t offset, uint8_t data) pal4bit(m_analog16.g[m_analog16.pal_entry]), pal4bit(m_analog16.b[m_analog16.pal_entry]) ); + // lemmings raster effects + m_screen->update_partial(m_screen->vpos()); return; } @@ -1066,9 +1068,15 @@ void pc9801vm_state::dma_access_ctrl_w(offs_t offset, u8 data) // ARTIC device +/* + * [0] read bits 15-0 of the counter device + * [1] read bits 23-8 of the counter device + * + * FreeDOS(98) Kernel will test [1] a whole lot during HMA allocation + */ uint16_t pc9801vm_state::timestamp_r(offs_t offset) { - return (m_maincpu->total_cycles() >> (16 * offset)); + return (m_maincpu->total_cycles() >> (8 * offset)); } void pc9801vm_state::artic_wait_w(u8 data) @@ -2374,12 +2382,12 @@ void pc9801_state::pc9801_common(machine_config &config) SCREEN(config, m_screen, SCREEN_TYPE_RASTER); m_screen->set_raw(21.0526_MHz_XTAL, 848, 0, 640, 440, 0, 400); m_screen->set_screen_update(FUNC(pc9801_state::screen_update)); - m_screen->screen_vblank().set(FUNC(pc9801_state::vrtc_irq)); UPD7220(config, m_hgdc[0], 21.0526_MHz_XTAL / 8, "screen"); m_hgdc[0]->set_addrmap(0, &pc9801_state::upd7220_1_map); m_hgdc[0]->set_draw_text(FUNC(pc9801_state::hgdc_draw_text)); m_hgdc[0]->vsync_wr_callback().set(m_hgdc[1], FUNC(upd7220_device::ext_sync_w)); + m_hgdc[0]->vsync_wr_callback().append(FUNC(pc9801_state::vrtc_irq)); UPD7220(config, m_hgdc[1], 21.0526_MHz_XTAL / 8, "screen"); m_hgdc[1]->set_addrmap(0, &pc9801_state::upd7220_2_map); diff --git a/src/mame/nichibutsu/seicross.cpp b/src/mame/nichibutsu/seicross.cpp index 310c6015eac..92a43531c93 100644 --- a/src/mame/nichibutsu/seicross.cpp +++ b/src/mame/nichibutsu/seicross.cpp @@ -225,7 +225,7 @@ void seicross_state::palette(palette_device &palette) const // blue component bit0 = BIT(color_prom[i], 6); bit1 = BIT(color_prom[i], 7); - int const b = 0x4f * bit0 + 0xa8 * bit1; + int const b = 0x52 * bit0 + 0xad * bit1; palette.set_pen_color(i, rgb_t(r, g, b)); } @@ -290,8 +290,8 @@ void seicross_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprec m_gfxdecode->gfx(1)->transpen(bitmap, cliprect, code, color, flipx, flipy, sx, sy, 0); - if (sx > 0xf0) - m_gfxdecode->gfx(1)->transpen(bitmap, cliprect, code, color, flipx, flipy, sx - 256, sy, 0); + const int dx = flip_screen() ? +256 : -256; + m_gfxdecode->gfx(1)->transpen(bitmap, cliprect, code, color, flipx, flipy, sx + dx, sy, 0); } } } diff --git a/src/mame/nl.flt b/src/mame/nl.flt index 0ac39331a85..726985cbe67 100644 --- a/src/mame/nl.flt +++ b/src/mame/nl.flt @@ -11,7 +11,7 @@ irem/m62.cpp jpm/jpmsru.cpp midway/sspeedr.cpp misc/cocoloco.cpp -mr/dribling.cpp +modelracing/dribling.cpp nintendo/mario.cpp nintendo/popeye.cpp ramtek/starcrus.cpp diff --git a/src/mame/philips/cdicdic.cpp b/src/mame/philips/cdicdic.cpp index fc44e8503fc..136607bce60 100644 --- a/src/mame/philips/cdicdic.cpp +++ b/src/mame/philips/cdicdic.cpp @@ -706,7 +706,7 @@ void cdicdic_device::process_audio_map() else { m_decode_addr = 0xffff; - m_audio_sector_counter = m_audio_format_sectors; + m_audio_sector_counter = 0; } if (was_decoding) diff --git a/src/mame/pinball/bingo.cpp b/src/mame/pinball/bingo.cpp index 39cded702d3..213c9643576 100644 --- a/src/mame/pinball/bingo.cpp +++ b/src/mame/pinball/bingo.cpp @@ -2,6 +2,7 @@ // copyright-holders:Miodrag Milanovic #include "emu.h" + #include "cpu/s2650/s2650.h" #include "cpu/i8085/i8085.h" #include "cpu/i86/i186.h" @@ -12,22 +13,22 @@ namespace { class bingo_state : public driver_device { public: - bingo_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag), - m_maincpu(*this, "maincpu") + bingo_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), + m_maincpu(*this, "maincpu") { } void bingo(machine_config &config); void bingo_map(address_map &map) ATTR_COLD; -protected: + void init_bingo(); + +protected: // devices required_device m_maincpu; // driver_device overrides virtual void machine_reset() override ATTR_COLD; -public: - void init_bingo(); }; @@ -59,22 +60,22 @@ void bingo_state::bingo(machine_config &config) class seeben_state : public driver_device { public: - seeben_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag), - m_maincpu(*this, "maincpu") + seeben_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), + m_maincpu(*this, "maincpu") { } void seeben(machine_config &config); void seeben_map(address_map &map) ATTR_COLD; -protected: + void init_seeben(); + +protected: // devices required_device m_maincpu; // driver_device overrides virtual void machine_reset() override ATTR_COLD; -public: - void init_seeben(); }; @@ -103,22 +104,21 @@ void seeben_state::seeben(machine_config &config) class splin_state : public driver_device { public: - splin_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag), - m_maincpu(*this, "maincpu") + splin_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), + m_maincpu(*this, "maincpu") { } void splin(machine_config &config); void splin_map(address_map &map) ATTR_COLD; -protected: + void init_splin(); +protected: // devices required_device m_maincpu; // driver_device overrides virtual void machine_reset() override ATTR_COLD; -public: - void init_splin(); }; void splin_state::splin_map(address_map &map) diff --git a/src/mame/psion/mc400.cpp b/src/mame/psion/mc400.cpp new file mode 100644 index 00000000000..0b28a9d45d3 --- /dev/null +++ b/src/mame/psion/mc400.cpp @@ -0,0 +1,466 @@ +// license:BSD-3-Clause +// copyright-holders:Nigel Barnes +/****************************************************************************** + + Psion MC400/MC200 Series + +******************************************************************************/ + +#include "emu.h" + +#include "bus/psion/module/slot.h" +#include "cpu/i86/i86.h" +#include "machine/nvram.h" +#include "machine/psion_asic1.h" +#include "machine/psion_asic2.h" +#include "machine/psion_asic3.h" +#include "machine/psion_ssd.h" +#include "machine/ram.h" +#include "sound/spkrdev.h" + +#include "emupal.h" +#include "screen.h" +#include "softlist_dev.h" +#include "speaker.h" + + +namespace { + +class psionmc_state : public driver_device +{ +public: + psionmc_state(const machine_config &mconfig, device_type type, const char *tag) + : driver_device(mconfig, type, tag) + , m_maincpu(*this, "maincpu") + , m_asic1(*this, "asic1") + , m_asic2(*this, "asic2") + , m_asic3(*this, "asic3") + , m_ram(*this, "ram") + , m_nvram(*this, "nvram") + , m_palette(*this, "palette") + , m_keyboard(*this, "COL%u", 0U) + , m_speaker(*this, "speaker") + , m_ssd(*this, "ssd%u", 1U) + , m_exp(*this, "exp%u", 1U) + , m_penup_timer(nullptr) + { } + + void psionmc(machine_config &config); + void mc200(machine_config &config); + void mc400(machine_config &config); + + DECLARE_INPUT_CHANGED_MEMBER(key_on); + //DECLARE_INPUT_CHANGED_MEMBER(reset); + DECLARE_INPUT_CHANGED_MEMBER(digitiser_changed); + +protected: + virtual void machine_start() override ATTR_COLD; + +private: + required_device m_maincpu; + optional_device m_asic1; + required_device m_asic2; + required_device m_asic3; + required_device m_ram; + required_device m_nvram; + required_device m_palette; + required_ioport_array<10> m_keyboard; + required_device m_speaker; + required_device_array m_ssd; + required_device_array m_exp; + + emu_timer *m_penup_timer; + + TIMER_CALLBACK_MEMBER(digitiser_penup); + + void palette_init(palette_device &palette); + + void mem_map(address_map &map) ATTR_COLD; + void io_map(address_map &map) ATTR_COLD; + void asic1_map(address_map &map) ATTR_COLD; + + int m_dr = 0; + uint16_t m_digitiser[2] = { 0, 0 }; +}; + + +void psionmc_state::machine_start() +{ + m_asic1->space(0).install_ram(0, m_ram->mask(), m_ram->pointer()); + m_nvram->set_base(m_ram->pointer(), m_ram->size()); + + m_penup_timer = timer_alloc(FUNC(psionmc_state::digitiser_penup), this); + m_penup_timer->adjust(attotime::never); +} + + +void psionmc_state::mem_map(address_map &map) +{ + map(0x00000, 0xfffff).rw(m_asic1, FUNC(psion_asic1_device::mem_r), FUNC(psion_asic1_device::mem_w)); +} + +void psionmc_state::io_map(address_map &map) +{ + map(0x0000, 0x001f).rw(m_asic1, FUNC(psion_asic1_device::io_r), FUNC(psion_asic1_device::io_w)); + map(0x0080, 0x008f).rw(m_asic2, FUNC(psion_asic2_device::io_r), FUNC(psion_asic2_device::io_w)).umask16(0x00ff); + map(0x0100, 0x01ff).rw(m_exp[0], FUNC(psion_module_slot_device::io_r), FUNC(psion_module_slot_device::io_w)); + map(0x0200, 0x02ff).rw(m_exp[1], FUNC(psion_module_slot_device::io_r), FUNC(psion_module_slot_device::io_w)); +} + +void psionmc_state::asic1_map(address_map &map) +{ + map(0x00000, 0xb7fff).noprw(); + map(0xb8000, 0xbffff).ram(); // 32K video RAM + map(0xc0000, 0xfffff).rom().region("flash", 0); +} + + +static INPUT_PORTS_START( psionmc ) + PORT_START("COL0") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_LCONTROL) PORT_CHAR(UCHAR_MAMEKEY(LCONTROL)) PORT_NAME("Control") + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_LSHIFT) PORT_CHAR(UCHAR_SHIFT_1) PORT_NAME("Shift (L)") + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_LALT) PORT_CHAR(UCHAR_MAMEKEY(LALT)) PORT_NAME("Psion") + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_CAPSLOCK) PORT_CHAR(UCHAR_MAMEKEY(CAPSLOCK)) PORT_NAME("Caps Lock") + PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_RSHIFT) PORT_CHAR(UCHAR_SHIFT_1) PORT_NAME("Shift (R)") + PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_UNUSED) + PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_LEFT) PORT_CHAR(UCHAR_MAMEKEY(LEFT)) PORT_NAME(u8"\u2190") // U+2190 = ← + PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_DOWN) PORT_CHAR(UCHAR_MAMEKEY(DOWN)) PORT_NAME(u8"\u2193") // U+2193 = ↓ + + PORT_START("COL1") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_1) PORT_CHAR('1') PORT_CHAR('!') + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_2) PORT_CHAR('2') PORT_CHAR('"') + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_Q) PORT_CHAR('q') PORT_CHAR('Q') + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_W) PORT_CHAR('w') PORT_CHAR('W') + PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_A) PORT_CHAR('a') PORT_CHAR('A') + PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_S) PORT_CHAR('s') PORT_CHAR('S') + PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_Z) PORT_CHAR('z') PORT_CHAR('Z') + PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_X) PORT_CHAR('x') PORT_CHAR('X') + + PORT_START("COL2") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_3) PORT_CHAR('3') PORT_CHAR(0xa3) + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_4) PORT_CHAR('4') PORT_CHAR('$') + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_E) PORT_CHAR('e') PORT_CHAR('E') + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_R) PORT_CHAR('r') PORT_CHAR('R') + PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_D) PORT_CHAR('d') PORT_CHAR('D') + PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_F) PORT_CHAR('f') PORT_CHAR('F') + PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_C) PORT_CHAR('c') PORT_CHAR('C') + PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_V) PORT_CHAR('v') PORT_CHAR('V') + + PORT_START("COL3") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_5) PORT_CHAR('5') PORT_CHAR('%') + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_6) PORT_CHAR('6') PORT_CHAR('^') + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_T) PORT_CHAR('t') PORT_CHAR('T') + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_Y) PORT_CHAR('y') PORT_CHAR('Y') + PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_G) PORT_CHAR('g') PORT_CHAR('G') + PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_H) PORT_CHAR('h') PORT_CHAR('H') + PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_B) PORT_CHAR('b') PORT_CHAR('B') + PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_N) PORT_CHAR('n') PORT_CHAR('N') + + PORT_START("COL4") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_7) PORT_CHAR('7') PORT_CHAR('&') + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_8) PORT_CHAR('8') PORT_CHAR('*') + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_U) PORT_CHAR('u') PORT_CHAR('U') + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_I) PORT_CHAR('i') PORT_CHAR('I') + PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_J) PORT_CHAR('j') PORT_CHAR('J') + PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_K) PORT_CHAR('k') PORT_CHAR('K') + PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_M) PORT_CHAR('m') PORT_CHAR('M') + PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_COMMA) PORT_CHAR(',') PORT_CHAR('<') + + PORT_START("COL5") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_9) PORT_CHAR('9') PORT_CHAR('(') + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_0) PORT_CHAR('0') PORT_CHAR(')') + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_O) PORT_CHAR('o') PORT_CHAR('O') + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_P) PORT_CHAR('p') PORT_CHAR('P') + PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_L) PORT_CHAR('l') PORT_CHAR('L') + PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_COLON) PORT_CHAR(';') PORT_CHAR(':') + PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_STOP) PORT_CHAR('.') PORT_CHAR('>') + PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_SLASH) PORT_CHAR('/') PORT_CHAR('?') + + PORT_START("COL6") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_MINUS) PORT_CHAR('-') PORT_CHAR('_') + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_EQUALS) PORT_CHAR('=') PORT_CHAR('+') + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_OPENBRACE) PORT_CHAR('[') PORT_CHAR('{') + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_CLOSEBRACE) PORT_CHAR(']') PORT_CHAR('}') + PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_QUOTE) PORT_CHAR('\'') PORT_CHAR('@') + PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_BACKSLASH) PORT_CHAR('#') PORT_CHAR('~') + PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_UP) PORT_CHAR(UCHAR_MAMEKEY(UP)) PORT_NAME(u8"\u2191") // U+2191 = ↑ + PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_ENTER) PORT_CHAR(13) PORT_NAME("Enter") + + PORT_START("COL7") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_BACKSPACE) PORT_CHAR(0x08) PORT_NAME("Backspace") + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_TAB) PORT_CHAR(0x09) PORT_NAME("Tab") + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_UNUSED) + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_TILDE) PORT_CHAR('\\') PORT_CHAR('|') + PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_UNUSED) + PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_UNUSED) + PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_SPACE) PORT_CHAR(' ') PORT_NAME("Space") + PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_RIGHT) PORT_CHAR(UCHAR_MAMEKEY(RIGHT)) PORT_NAME(u8"\u2192") // U+2192 = → + + PORT_START("COL8") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_INSERT) PORT_CHAR(UCHAR_MAMEKEY(INSERT)) PORT_NAME("Task") + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_HOME) PORT_CHAR(UCHAR_MAMEKEY(HOME)) PORT_NAME("Home") + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_PGUP) PORT_CHAR(UCHAR_MAMEKEY(PGUP)) PORT_NAME("Page Up") + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("LCD") + PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_CODE(MOUSECODE_BUTTON1) PORT_NAME("Touchpad Button") + PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_UNUSED) + PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_UNUSED) + PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_UNUSED) + + PORT_START("COL9") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_DEL) PORT_CHAR(UCHAR_MAMEKEY(DEL)) PORT_NAME("Delete") + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_END) PORT_CHAR(UCHAR_MAMEKEY(END)) PORT_NAME("End") + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_PGDN) PORT_CHAR(UCHAR_MAMEKEY(PGDN)) PORT_NAME("Page Down") + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Record") + PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_UNUSED) + PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_UNUSED) + PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_UNUSED) + PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_UNUSED) + + PORT_START("ESC") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_ESC) PORT_CHAR(UCHAR_MAMEKEY(ESC)) PORT_NAME("On Esc") PORT_CHANGED_MEMBER(DEVICE_SELF, FUNC(psionmc_state::key_on), 0) + + PORT_START("DIGIT0") + PORT_BIT(0x7ff, 0x300, IPT_AD_STICK_X) PORT_NAME("Touchpad X-Axis") PORT_MINMAX(0x0c0, 0x7c0) PORT_SENSITIVITY(20) PORT_CHANGED_MEMBER(DEVICE_SELF, FUNC(psionmc_state::digitiser_changed), 0) + + PORT_START("DIGIT1") + PORT_BIT(0x7ff, 0x300, IPT_AD_STICK_Y) PORT_NAME("Touchpad Y-Axis") PORT_MINMAX(0x100, 0x640) PORT_SENSITIVITY(20) PORT_CHANGED_MEMBER(DEVICE_SELF, FUNC(psionmc_state::digitiser_changed), 1) PORT_REVERSE + + //PORT_START("RESET") + //PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_F3) PORT_CHAR(UCHAR_MAMEKEY(F3)) PORT_NAME("Reset") PORT_CHANGED_MEMBER(DEVICE_SELF, FUNC(psionmc_state::reset), 0) +INPUT_PORTS_END + +static INPUT_PORTS_START(psionmc_de) + PORT_INCLUDE(psionmc) + + PORT_MODIFY("COL1") + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_Q) PORT_CHAR('q') PORT_CHAR('Q') PORT_CHAR('@') + PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_Z) PORT_CHAR('y') PORT_CHAR('Y') + + PORT_MODIFY("COL2") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_3) PORT_CHAR('3') PORT_CHAR(0xa7) + + PORT_MODIFY("COL3") + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_6) PORT_CHAR('6') PORT_CHAR('&') + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_Y) PORT_CHAR('z') PORT_CHAR('Z') + + PORT_MODIFY("COL4") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_7) PORT_CHAR('7') PORT_CHAR('/') PORT_CHAR('{') + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_8) PORT_CHAR('8') PORT_CHAR('(') PORT_CHAR('[') + PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_COMMA) PORT_CHAR(',') PORT_CHAR(';') + + PORT_MODIFY("COL5") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_9) PORT_CHAR('9') PORT_CHAR(')') PORT_CHAR(']') + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_0) PORT_CHAR('0') PORT_CHAR('=') PORT_CHAR('}') + PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_COLON) PORT_CHAR(0xf6) PORT_CHAR(0xd6) + PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_STOP) PORT_CHAR('.') PORT_CHAR(':') + PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_SLASH) PORT_CHAR('-') PORT_CHAR('_') + + PORT_MODIFY("COL6") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_MINUS) PORT_CHAR(0xdf) PORT_CHAR('?') PORT_CHAR('\\') + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_EQUALS) PORT_CHAR('\'') PORT_CHAR('`') + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_OPENBRACE) PORT_CHAR(0xfc) PORT_CHAR(0xdc) + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_CLOSEBRACE) PORT_CHAR('+') PORT_CHAR('*') PORT_CHAR('~') + PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_QUOTE) PORT_CHAR(0xe4) PORT_CHAR(0xc4) + PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_BACKSLASH) PORT_CHAR('<') PORT_CHAR('>') PORT_CHAR('|') + + PORT_MODIFY("COL7") + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_TILDE) PORT_CHAR('#') PORT_CHAR('^') +INPUT_PORTS_END + +INPUT_CHANGED_MEMBER(psionmc_state::key_on) +{ + if (newval) + { + m_asic2->on_clr_w(newval); + } +} + +//INPUT_CHANGED_MEMBER(psionmc_state::reset) +//{ +// if (newval) +// { +// m_asic2->reset_w(0); +// } +//} + +INPUT_CHANGED_MEMBER(psionmc_state::digitiser_changed) +{ + m_digitiser[param] = newval; + + m_penup_timer->adjust(attotime::from_msec(200), 0); +} + +TIMER_CALLBACK_MEMBER(psionmc_state::digitiser_penup) +{ + m_digitiser[0] |= 0x800; + m_digitiser[1] |= 0x800; +} + + +void psionmc_state::palette_init(palette_device &palette) +{ + palette.set_pen_color(0, rgb_t(131, 136, 139)); + palette.set_pen_color(1, rgb_t(92, 83, 88)); +} + + +void psionmc_state::psionmc(machine_config &config) +{ + I8086(config, m_maincpu, 15.36_MHz_XTAL / 2); // M80C86A + m_maincpu->set_addrmap(AS_PROGRAM, &psionmc_state::mem_map); + m_maincpu->set_addrmap(AS_IO, &psionmc_state::io_map); + m_maincpu->set_irq_acknowledge_callback(m_asic1, FUNC(psion_asic1_device::inta_cb)); + + PSION_ASIC1(config, m_asic1, 15.36_MHz_XTAL); + m_asic1->set_screen("screen"); + m_asic1->set_laptop_mode(true); + m_asic1->set_addrmap(0, &psionmc_state::asic1_map); + m_asic1->int_cb().set_inputline(m_maincpu, INPUT_LINE_IRQ0); + m_asic1->nmi_cb().set_inputline(m_maincpu, INPUT_LINE_NMI); + m_asic1->frcovl_cb().set(m_asic2, FUNC(psion_asic2_device::frcovl_w)); + + PSION_ASIC2(config, m_asic2, 15.36_MHz_XTAL); + m_asic2->int_cb().set(m_asic1, FUNC(psion_asic1_device::eint3_w)); + m_asic2->nmi_cb().set(m_asic1, FUNC(psion_asic1_device::enmi_w)); + m_asic2->cbusy_cb().set_inputline(m_maincpu, INPUT_LINE_TEST); + m_asic2->buz_cb().set(m_speaker, FUNC(speaker_sound_device::level_w)); + m_asic2->buzvol_cb().set([this](int state) { m_speaker->set_output_gain(ALL_OUTPUTS, state ? 1.0 : 0.25); }); + m_asic2->dr_cb().set([this](int state) { m_dr = state; }); + m_asic2->col_cb().set([this](uint8_t data) { return m_keyboard[data]->read(); }); + m_asic2->data_r<0>().set(m_asic3, FUNC(psion_asic3_device::data_r)); // Power supply (ASIC3) + m_asic2->data_w<0>().set(m_asic3, FUNC(psion_asic3_device::data_w)); + m_asic2->data_r<1>().set(m_ssd[0], FUNC(psion_ssd_device::data_r)); // SSD Pack 1 + m_asic2->data_w<1>().set(m_ssd[0], FUNC(psion_ssd_device::data_w)); + m_asic2->data_r<2>().set(m_ssd[1], FUNC(psion_ssd_device::data_r)); // SSD Pack 2 + m_asic2->data_w<2>().set(m_ssd[1], FUNC(psion_ssd_device::data_w)); + m_asic2->data_r<3>().set(m_ssd[2], FUNC(psion_ssd_device::data_r)); // SSD Pack 3 + m_asic2->data_w<3>().set(m_ssd[2], FUNC(psion_ssd_device::data_w)); + m_asic2->data_r<4>().set(m_ssd[3], FUNC(psion_ssd_device::data_r)); // SSD Pack 4 + m_asic2->data_w<4>().set(m_ssd[3], FUNC(psion_ssd_device::data_w)); + m_asic2->data_r<5>().set(m_exp[1], FUNC(psion_module_slot_device::data_r)); // Expansion port B + m_asic2->data_w<5>().set(m_exp[1], FUNC(psion_module_slot_device::data_w)); + m_asic2->data_r<6>().set(m_exp[0], FUNC(psion_module_slot_device::data_r)); // Expansion port A + m_asic2->data_w<6>().set(m_exp[0], FUNC(psion_module_slot_device::data_w)); + //m_asic2->data_r<7>().set(m_asic5, FUNC(psion_asic5_device::data_r)); // High speed link + //m_asic2->data_w<7>().set(m_asic5, FUNC(psion_asic5_device::data_w)); + + PSION_PSU_ASIC5(config, m_asic3); + m_asic3->adin_cb().set([this]() { return m_digitiser[m_dr]; }); + + RAM(config, m_ram); + NVRAM(config, "nvram", nvram_device::DEFAULT_NONE); + + PALETTE(config, "palette", FUNC(psionmc_state::palette_init), 2); + + SPEAKER(config, "mono").front_center(); + SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 1.00); // Piezo buzzer + + PSION_SSD(config, m_ssd[0]); + m_ssd[0]->door_cb().set(m_asic2, FUNC(psion_asic2_device::dnmi_w)); + PSION_SSD(config, m_ssd[1]); + m_ssd[1]->door_cb().set(m_asic2, FUNC(psion_asic2_device::dnmi_w)); + PSION_SSD(config, m_ssd[2]); + m_ssd[2]->door_cb().set(m_asic2, FUNC(psion_asic2_device::dnmi_w)); + PSION_SSD(config, m_ssd[3]); + m_ssd[3]->door_cb().set(m_asic2, FUNC(psion_asic2_device::dnmi_w)); + + PSION_MODULE_SLOT(config, m_exp[0], psion_mcmodule_devices, "serpar"); // RS232/Parallel + m_exp[0]->intr_cb().set(m_asic1, FUNC(psion_asic1_device::eint2_w)); + PSION_MODULE_SLOT(config, m_exp[1], psion_mcmodule_devices, nullptr); + m_exp[1]->intr_cb().set(m_asic1, FUNC(psion_asic1_device::eint1_w)); + + SOFTWARE_LIST(config, "ssd_list").set_original("psion_ssd").set_filter("MC"); +} + +void psionmc_state::mc200(machine_config &config) +{ + psionmc(config); + + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_LCD)); + screen.set_size(640, 200); + screen.set_visarea_full(); + screen.set_refresh_hz(66); + screen.set_screen_update(m_asic1, FUNC(psion_asic1_device::screen_update_single)); + screen.set_palette(m_palette); + + m_ram->set_default_size("128K"); +} + +void psionmc_state::mc400(machine_config &config) +{ + psionmc(config); + + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_LCD)); + screen.set_size(640, 400); + screen.set_visarea_full(); + screen.set_refresh_hz(66); + screen.set_screen_update(m_asic1, FUNC(psion_asic1_device::screen_update_dual)); + screen.set_palette(m_palette); + + m_ram->set_default_size("256K"); +} + + +ROM_START( mc200 ) + ROM_REGION16_LE(0x40000, "flash", ROMREGION_ERASEFF) + // 2 x 28F010 128k flash chips, V2.20F also known to exist + ROM_SYSTEM_BIOS(0, "212f", "V2.12F 081090") + ROMX_LOAD("v212f_0.bin", 0x00000, 0x20000, CRC(ff346271) SHA1(50a01bbd653bbdffb59e37753a3ddd8c1f677ca5), ROM_BIOS(0) | ROM_SKIP(1)) + ROMX_LOAD("v212f_1.bin", 0x00001, 0x20000, CRC(4f266410) SHA1(3d31b36daa239b0b80ec74855ecfa59fb05c9aaa), ROM_BIOS(0) | ROM_SKIP(1)) + + ROM_REGION(0x20000, "ssd3", 0) + ROM_LOAD("mc200_system_disk.bin", 0x00000, 0x20000, CRC(8d7dab78) SHA1(a4ae14bfb30525033e681558e0aa5e4c5b21c62e)) +ROM_END + +ROM_START( mc400 ) + ROM_REGION16_LE(0x40000, "flash", ROMREGION_ERASEFF) + // 2 x 28F010 128k flash chips + ROM_SYSTEM_BIOS(0, "212f", "V2.12F 081090") + ROMX_LOAD("v212f_0.bin", 0x00000, 0x20000, CRC(ff346271) SHA1(50a01bbd653bbdffb59e37753a3ddd8c1f677ca5), ROM_BIOS(0) | ROM_SKIP(1)) + ROMX_LOAD("v212f_1.bin", 0x00001, 0x20000, CRC(4f266410) SHA1(3d31b36daa239b0b80ec74855ecfa59fb05c9aaa), ROM_BIOS(0) | ROM_SKIP(1)) + ROM_SYSTEM_BIOS(1, "126f", "V1.26F 020290") + ROMX_LOAD("v126f_0.bin", 0x00000, 0x20000, CRC(2c569929) SHA1(8a89a3aa1811e3e41da0e3849c9d98ad61362b33), ROM_BIOS(1) | ROM_SKIP(1)) + ROMX_LOAD("v126f_1.bin", 0x00001, 0x20000, CRC(e5a63fae) SHA1(dd630d5905601217dfbae183d3df621f98a82fd3), ROM_BIOS(1) | ROM_SKIP(1)) + + // Psion test ROM master images + ROM_SYSTEM_BIOS(2, "110ftst", "V1.10F Serial/Parallel Test") + ROMX_LOAD("v110ftst.bin", 0x00000, 0x40000, CRC(178e8a7e) SHA1(a6e3e14e63c83473292eea87526c66873930b275), ROM_BIOS(2)) + ROM_SYSTEM_BIOS(3, "101ftst", "V1.01F Serial/Parallel Test") + ROMX_LOAD("v101ftst.bin", 0x00000, 0x40000, CRC(8b8ec6b2) SHA1(fc9f914322bd1b1dbe60e84f317549fda9b80aad), ROM_BIOS(3)) + ROM_SYSTEM_BIOS(4, "062atst", "V0.62A/1 MC Final Test") + ROMX_LOAD("v062atst.bin", 0x00000, 0x40000, CRC(72e026a5) SHA1(e7cbdecdad0574bd4804393189c8c768e934b6f5), ROM_BIOS(4)) + + ROM_REGION(0x20000, "ssd3", 0) + ROM_LOAD("mc400_system_disk.bin", 0x00000, 0x20000, CRC(2ee09e83) SHA1(2ba5dcdb07986f53ac97ca2e397ded0fc839a70a)) +ROM_END + +ROM_START( mcword ) + ROM_REGION16_LE(0x40000, "flash", ROMREGION_ERASEFF) + // 2 x 28F010 128k flash chips + ROM_SYSTEM_BIOS(0, "260f", "V2.60F/ENG 060892") + ROMX_LOAD("v260f_0.bin", 0x00000, 0x20000, CRC(b4f2e560) SHA1(18bed2f8dfde458953eca2d0c21c4a94ba83bdf1), ROM_BIOS(0) | ROM_SKIP(1)) + ROMX_LOAD("v260f_1.bin", 0x00001, 0x20000, CRC(abe679da) SHA1(751d9efd44c4bedaad77ef2ef8a16605eb88787c), ROM_BIOS(0) | ROM_SKIP(1)) + + ROM_REGION(0x40000, "ssd3", 0) + ROM_LOAD("mcword_system_disk.bin", 0, 0x40000, CRC(c7f8ad21) SHA1(5bc99c5430ad631dd094a0f99c2963a8c32b0556)) +ROM_END + +ROM_START( mcword_de ) + ROM_REGION16_LE(0x40000, "flash", ROMREGION_ERASEFF) + // 2 x 28F010 128k flash chips + ROM_SYSTEM_BIOS(0, "260f", "V2.60F/ENG 260892") + ROMX_LOAD("v260f_0_de.bin", 0x00000, 0x20000, CRC(5a92ee9a) SHA1(b84de4c30c78aa6cb9f453ebbe54bf53ae00a842), ROM_BIOS(0) | ROM_SKIP(1)) + ROMX_LOAD("v260f_1_de.bin", 0x00001, 0x20000, CRC(088bc86d) SHA1(9aa665e4e6bc111ffb4bd24c0eeb7da91962e902), ROM_BIOS(0) | ROM_SKIP(1)) + + ROM_REGION(0x40000, "ssd3", 0) + ROM_LOAD("mcword_system_disk.bin", 0x00000, 0x40000, CRC(c7f8ad21) SHA1(5bc99c5430ad631dd094a0f99c2963a8c32b0556)) +ROM_END + +} // anonymous namespace + + +// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS +COMP( 1989, mc200, mc400, 0, mc200, psionmc, psionmc_state, empty_init, "Psion", "MC 200", MACHINE_SUPPORTS_SAVE ) +COMP( 1989, mc400, 0, 0, mc400, psionmc, psionmc_state, empty_init, "Psion", "MC 400", MACHINE_SUPPORTS_SAVE ) +COMP( 1992, mcword, mc400, 0, mc400, psionmc, psionmc_state, empty_init, "Psion", "MC Word", MACHINE_SUPPORTS_SAVE ) +COMP( 1992, mcword_de, mc400, 0, mc400, psionmc_de, psionmc_state, empty_init, "Psion", "MC Word (German)", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/roland/roland_mt32.cpp b/src/mame/roland/roland_mt32.cpp index 4cdef38f8e8..675a647e2ab 100644 --- a/src/mame/roland/roland_mt32.cpp +++ b/src/mame/roland/roland_mt32.cpp @@ -21,6 +21,10 @@ with a MPU-401 frontend added to communicate with the synth. All the roms are identical with the CM32L. + MT-100 is a desktop digital synthesizer which shares functionality + and main board with the MT-32, but extends it with a sequencer + and a Quick Disk drive. + Some special tricks: - pressing 3+V (Part 3 + Volume) at boot time starts the test mode @@ -436,6 +440,23 @@ ROM_START( mt32 ) ROM_LOAD( "r15179857.ic13.bin", 0, 0x8000, CRC(cb219d85) SHA1(c2933cb7ad86e51904aa1c3bc12fa234e73a337f) ) ROM_END +ROM_START( mt100 ) + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_DEFAULT_BIOS( "203" ) + + ROM_SYSTEM_BIOS( 0, "203", "Firmware 2.0.3" ) + ROMX_LOAD( "mt32_2.0.3.ic28", 0, 0x10000, CRC(6af6b774) SHA1(5837064c9df4741a55f7c4d8787ac158dff2d3ce), ROM_BIOS(0) ) + + ROM_REGION( 0x80000, "la32", 0 ) + ROM_LOAD( "r15449121.ic37.bin", 0, 0x80000, CRC(573e31cc) SHA1(f6b1eebc4b2d200ec6d3d21d51325d5b48c60252) ) // Same as c32l + + ROM_REGION( 0x8000, "boss", 0 ) + ROM_LOAD( "r15179917.ic13.bin", 0, 0x8000, CRC(236c87a6) SHA1(e1c03905c46e962d1deb15eeed92eb61b42bba4a) ) // Same as c32l + + ROM_REGION( 0x10000, "prboard", 0 ) + ROM_LOAD( "mt100_4.0.0.bin", 0, 0x8000, CRC(0e3bffbb) SHA1(aeef44d56f0026243b4a6415ee5c60a8de9cea0f) ) // Roland MC-03 PR-100 Ver 4.00 +ROM_END + ROM_START( cm32l ) ROM_REGION( 0x10000, "maincpu", 0 ) ROM_DEFAULT_BIOS( "102" ) @@ -463,4 +484,5 @@ ROM_END CONS( 1987, mt32, 0, 0, mt32, mt32, mt32_state, empty_init, "Roland", "MT-32", MACHINE_NOT_WORKING | MACHINE_NO_SOUND ) +CONS( 1988, mt100, 0, 0, mt32, mt32, mt32_state, empty_init, "Roland", "MT-100", MACHINE_NOT_WORKING | MACHINE_NO_SOUND ) CONS( 1989, cm32l, 0, 0, mt32, mt32, mt32_state, empty_init, "Roland", "CM-32L", MACHINE_NOT_WORKING | MACHINE_NO_SOUND ) diff --git a/src/mame/saitek/gk2000.cpp b/src/mame/saitek/gk2000.cpp index 4c0309ab54f..f7ae7c04151 100644 --- a/src/mame/saitek/gk2000.cpp +++ b/src/mame/saitek/gk2000.cpp @@ -18,7 +18,7 @@ engine is by Frans Morsch. adds some kind of auxillary autosave state feature at power-off BTANB: -- see note below about so-called H8 bug +- see note below about so-called H8 bug on the A20 ROM ================================================================================ @@ -33,11 +33,15 @@ GK 2000 (H8/323 version): - LCD with 5 7segs and custom segments - piezo, 16 LEDs, button sensors chessboard -Radio Shack Chess Master: -- PCB label: same as Centurion / Cougar (see below) +Barracuda: +- PCB label: ST39B-PE-013, P/N: 51K090-01310 - Hitachi H8/3212 MCU, 10MHz XTAL - rest is same as GK 2000 +Radio Shack Chess Master: +- PCB label: same as Centurion / Cougar (see below) +- rest is same as Barracuda + H8/323 A13 MCU is used in: - Saitek GK 2000 (1992 version, 86071220X12) - Saitek Travel Champion 2080 (86071220X12) @@ -49,7 +53,7 @@ Travel Champion 2080 and Tandy Mega 2050X are 14MHz instead of 20MHz. H8/3212 V03 MCU (DIP) is used in: - Saitek GK 2000 (1997 version, suspected) -- Saitek Barracuda (suspected) +- Saitek Barracuda - Saitek Mephisto Montana - Tandy (Radio Shack) Chess Master (aka Master Chess Computer) diff --git a/src/mame/sega/sg1000.cpp b/src/mame/sega/sg1000.cpp index df6293cd0c5..c326e2e7eb5 100644 --- a/src/mame/sega/sg1000.cpp +++ b/src/mame/sega/sg1000.cpp @@ -76,7 +76,6 @@ PCB Layout #include "imagedev/floppy.h" #include "machine/i8251.h" #include "machine/i8255.h" -#include "machine/ram.h" #include "machine/upd765.h" #include "sound/sn76496.h" #include "video/tms9928a.h" @@ -105,7 +104,6 @@ class sg1000_state_base : public driver_device sg1000_state_base(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), m_maincpu(*this, Z80_TAG), - m_ram(*this, RAM_TAG), m_rom(*this, Z80_TAG), m_cart(*this, "slot"), m_sgexpslot(*this, "sgexp") @@ -113,7 +111,6 @@ class sg1000_state_base : public driver_device protected: required_device m_maincpu; - required_device m_ram; required_memory_region m_rom; optional_device m_cart; required_device m_sgexpslot; @@ -190,6 +187,7 @@ class sc3000_state : public sg1000_state { } void sc3000(machine_config &config); + void sc3000pal(machine_config &config); protected: virtual void machine_start() override ATTR_COLD; @@ -204,7 +202,8 @@ class sf7000_state : public sc3000_state sc3000_state(mconfig, type, tag), m_fdc(*this, UPD765_TAG), m_centronics(*this, "centronics"), - m_floppy0(*this, UPD765_TAG ":0:3ssdd") + m_floppy0(*this, UPD765_TAG ":0:3ssdd"), + m_romview(*this, "romview") { } void sf7000(machine_config &config); @@ -214,10 +213,11 @@ class sf7000_state : public sc3000_state required_device m_centronics; required_device m_floppy0; + memory_view m_romview; + int m_centronics_busy = 0; virtual void machine_start() override ATTR_COLD; - virtual void machine_reset() override ATTR_COLD; void write_centronics_busy(int state); uint8_t ppi_pa_r(); @@ -361,8 +361,9 @@ void sg1000_state::sc3000_io_map(address_map &map) void sf7000_state::sf7000_map(address_map &map) { - map(0x0000, 0x3fff).bankr("bank1").bankw("bank2"); - map(0x4000, 0xffff).ram(); + map(0x0000, 0xffff).ram(); + map(0x0000, 0x3fff).view(m_romview); + m_romview[0](0x0000, 0x3fff).rom().region(Z80_TAG, 0); } /*------------------------------------------------- @@ -479,7 +480,8 @@ static INPUT_PORTS_START( sc3000 ) // keyboard keys are added by the embedded sk1100 device PORT_START("NMI") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("RESET") PORT_CODE(KEYCODE_F10) PORT_CHANGED_MEMBER(DEVICE_SELF, FUNC(sg1000_state::trigger_nmi), 0) + // This is actually part of the main keyboard, though emulated separately here + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("Reset") PORT_CODE(KEYCODE_F10) PORT_CHANGED_MEMBER(DEVICE_SELF, FUNC(sg1000_state::trigger_nmi), 0) INPUT_PORTS_END /*------------------------------------------------- @@ -541,7 +543,7 @@ void sf7000_state::ppi_pc_w(uint8_t data) /* Signal Description - PC0 /INUSE signal to FDD + PC0 /INUSE signal to FDD (drives LED?) PC1 /MOTOR ON signal to FDD PC2 TC signal to FDC PC3 RESET signal to FDC @@ -563,13 +565,13 @@ void sf7000_state::ppi_pc_w(uint8_t data) m_fdc->tc_w(BIT(data, 2)); /* FDC reset */ - if (BIT(data, 3)) - { - m_fdc->reset(); - } + m_fdc->reset_w(BIT(data, 3)); /* ROM selection */ - membank("bank1")->set_entry(BIT(data, 6)); + if (BIT(data, 6)) + m_romview.disable(); + else + m_romview.select(0); /* printer strobe */ m_centronics->write_strobe(BIT(data, 7)); @@ -660,17 +662,6 @@ void sf7000_state::machine_start() sc3000_state::machine_start(); save_item(NAME(m_centronics_busy)); - - /* configure memory banking */ - membank("bank1")->configure_entry(0, m_rom->base()); - membank("bank1")->configure_entry(1, m_ram->pointer()); - membank("bank2")->configure_entry(0, m_ram->pointer()); -} - -void sf7000_state::machine_reset() -{ - membank("bank1")->set_entry(0); - membank("bank2")->set_entry(0); } /*************************************************************************** @@ -680,10 +671,10 @@ void sf7000_state::machine_reset() void sg1000_state_base::sg1000_base(machine_config &config) { /* basic machine hardware */ - Z80(config, m_maincpu, XTAL(10'738'635) / 3); // LH0080A + Z80(config, m_maincpu, 10.738635_MHz_XTAL / 3); // LH0080A /* video hardware */ - tms9918a_device &vdp(TMS9918A(config, TMS9918A_TAG, XTAL(10'738'635))); + tms9918a_device &vdp(TMS9918A(config, TMS9918A_TAG, 10.738635_MHz_XTAL)); vdp.set_screen("screen"); vdp.set_vram_size(0x4000); vdp.int_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0); @@ -693,7 +684,7 @@ void sg1000_state_base::sg1000_base(machine_config &config) /* sound hardware */ SPEAKER(config, "mono").front_center(); - SN76489A(config, SN76489AN_TAG, XTAL(10'738'635) / 3).add_route(ALL_OUTPUTS, "mono", 1.00); + SN76489A(config, SN76489AN_TAG, 10.738635_MHz_XTAL / 3).add_route(ALL_OUTPUTS, "mono", 1.00); /* software lists */ SOFTWARE_LIST(config, "cart_list").set_original("sg1000"); @@ -733,9 +724,6 @@ void sg1000_state::sg1000(machine_config &config) /* cartridge */ SG1000_CART_SLOT(config, m_cart, sg1000_cart, nullptr).set_must_be_loaded(true); - - /* internal ram */ - RAM(config, m_ram).set_default_size("1K"); } /*------------------------------------------------- @@ -754,9 +742,6 @@ void omv_state::omv1000(machine_config &config) /* cartridge */ OMV_CART_SLOT(config, m_cart, sg1000_cart, nullptr); - - /* internal ram */ - RAM(config, m_ram).set_default_size("2K"); } /*------------------------------------------------- @@ -784,9 +769,22 @@ void sc3000_state::sc3000(machine_config &config) /* cartridge */ SC3000_CART_SLOT(config, m_cart, sg1000_cart, nullptr).set_must_be_loaded(true); +} + +void sc3000_state::sc3000pal(machine_config &config) +{ + sc3000(config); - /* internal ram */ - RAM(config, m_ram).set_default_size("2K"); + tms9929a_device &vdp(TMS9929A(config.replace(), TMS9918A_TAG, 10.738635_MHz_XTAL)); + vdp.set_screen("screen"); + vdp.set_vram_size(0x4000); + vdp.int_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0); + + // Z80A and SN76489AN are clocked by a separate ceramic oscillator since TMS9929A has no CPUCLK output + m_maincpu->set_clock(3.58_MHz_XTAL); + subdevice(SN76489AN_TAG)->set_clock(3.58_MHz_XTAL); + + m_sgexpslot->set_default_option("sk1100e"); } /*------------------------------------------------- @@ -807,17 +805,21 @@ void sf7000_state::sf7000(machine_config &config) ppi.in_pa_callback().set(FUNC(sf7000_state::ppi_pa_r)); ppi.out_pb_callback().set("cent_data_out", FUNC(output_latch_device::write)); ppi.out_pc_callback().set(FUNC(sf7000_state::ppi_pc_w)); + ppi.tri_pc_callback().set_constant(0x8f); // /ROM SEL must be active after reset - i8251_device &upd8251(I8251(config, UPD8251_TAG, 0)); + i8251_device &upd8251(I8251(config, UPD8251_TAG, 4.9152_MHz_XTAL / 2)); upd8251.txd_handler().set(RS232_TAG, FUNC(rs232_port_device::write_txd)); upd8251.dtr_handler().set(RS232_TAG, FUNC(rs232_port_device::write_dtr)); upd8251.rts_handler().set(RS232_TAG, FUNC(rs232_port_device::write_rts)); rs232_port_device &rs232(RS232_PORT(config, RS232_TAG, default_rs232_devices, nullptr)); rs232.rxd_handler().set(UPD8251_TAG, FUNC(i8251_device::write_rxd)); + rs232.cts_handler().set(UPD8251_TAG, FUNC(i8251_device::write_cts)); rs232.dsr_handler().set(UPD8251_TAG, FUNC(i8251_device::write_dsr)); - UPD765A(config, m_fdc, 8'000'000, false, false); + UPD765A(config, m_fdc, 16_MHz_XTAL / 4); // clocked through SED9420C + m_fdc->set_ready_line_connected(true); // or disconnected by split pad? + m_fdc->set_select_lines_connected(false); // FIXME: actually connected according to schematics FLOPPY_CONNECTOR(config, UPD765_TAG ":0", sf7000_floppies, "3ssdd", sf7000_state::floppy_formats); CENTRONICS(config, m_centronics, centronics_devices, "printer"); @@ -828,9 +830,6 @@ void sf7000_state::sf7000(machine_config &config) /* software lists */ SOFTWARE_LIST(config, "flop_list").set_original("sf7000"); - - /* internal ram */ - RAM(config, m_ram).set_default_size("64K"); } /*************************************************************************** @@ -845,7 +844,7 @@ ROM_END #define rom_sc3000 rom_sg1000 -#define rom_sc3000h rom_sg1000 +#define rom_sc3000pal rom_sg1000 ROM_START( sf7000 ) ROM_REGION( 0x10000, Z80_TAG, ROMREGION_ERASE00 ) @@ -869,11 +868,14 @@ ROM_END SYSTEM DRIVERS ***************************************************************************/ -// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS -CONS( 1983, sg1000, 0, 0, sg1000, sg1000, sg1000_state, empty_init, "Sega", "SG-1000", MACHINE_SUPPORTS_SAVE ) -CONS( 1984, sg1000m2, sg1000, 0, sc3000, sc3000, sc3000_state, empty_init, "Sega", "SG-1000 II", MACHINE_SUPPORTS_SAVE ) -COMP( 1983, sc3000, 0, sg1000, sc3000, sc3000, sc3000_state, empty_init, "Sega", "SC-3000", MACHINE_SUPPORTS_SAVE ) -COMP( 1983, sc3000h, sc3000, 0, sc3000, sc3000, sc3000_state, empty_init, "Sega", "SC-3000H", MACHINE_SUPPORTS_SAVE ) -COMP( 1983, sf7000, sc3000, 0, sf7000, sf7000, sf7000_state, empty_init, "Sega", "SC-3000/Super Control Station SF-7000", MACHINE_SUPPORTS_SAVE ) -CONS( 1984, omv1000, sg1000, 0, omv1000, omv1000, omv_state, empty_init, "Tsukuda Original", "Othello Multivision FG-1000", MACHINE_SUPPORTS_SAVE ) -CONS( 1984, omv2000, sg1000, 0, omv2000, omv2000, omv2000_state, empty_init, "Tsukuda Original", "Othello Multivision FG-2000", MACHINE_SUPPORTS_SAVE ) +// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS +CONS( 1983, sg1000, 0, 0, sg1000, sg1000, sg1000_state, empty_init, "Sega", "SG-1000", MACHINE_SUPPORTS_SAVE ) +CONS( 1984, sg1000m2, sg1000, 0, sc3000, sc3000, sc3000_state, empty_init, "Sega", "SG-1000 II", MACHINE_SUPPORTS_SAVE ) +CONS( 1984, omv1000, sg1000, 0, omv1000, omv1000, omv_state, empty_init, "Tsukuda Original", "Othello Multivision FG-1000", MACHINE_SUPPORTS_SAVE ) +CONS( 1984, omv2000, sg1000, 0, omv2000, omv2000, omv2000_state, empty_init, "Tsukuda Original", "Othello Multivision FG-2000", MACHINE_SUPPORTS_SAVE ) + +// SC-3000 and SC-3000H are identical except for key mechanism. +// PAL/SECAM versions of SC-3000 were distributed by Yeno in France, by John Sands Electronics in Australia and by Grandstand Leisure in New Zealand. +COMP( 1983, sc3000, 0, sg1000, sc3000, sc3000, sc3000_state, empty_init, "Sega", "SC-3000 (NTSC)", MACHINE_SUPPORTS_SAVE ) +COMP( 1983, sc3000pal, sc3000, 0, sc3000pal, sc3000, sc3000_state, empty_init, "Sega", "SC-3000 (PAL)", MACHINE_SUPPORTS_SAVE ) +COMP( 1983, sf7000, sc3000, 0, sf7000, sf7000, sf7000_state, empty_init, "Sega", "SC-3000/Super Control Station SF-7000", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/seibu/deadang.cpp b/src/mame/seibu/deadang.cpp index 6775e285958..d76157c5d93 100644 --- a/src/mame/seibu/deadang.cpp +++ b/src/mame/seibu/deadang.cpp @@ -338,7 +338,7 @@ uint32_t deadang_state::screen_update(screen_device &screen, bitmap_ind16 &bitma 0x01: Background playfield disable 0x02: Middle playfield disable 0x04: Top playfield disable - 0x08: ? Toggles at start of game + 0x08: Text layer disable 0x10: Sprite disable 0x20: Unused? 0x40: Flipscreen @@ -347,6 +347,7 @@ uint32_t deadang_state::screen_update(screen_device &screen, bitmap_ind16 &bitma m_pf_layer[2]->enable(!(m_scroll_ram[0x34] & 1)); m_pf_layer[0]->enable(!(m_scroll_ram[0x34] & 2)); m_pf_layer[1]->enable(!(m_scroll_ram[0x34] & 4)); + m_text_layer->enable(!(m_scroll_ram[0x34] & 8)); flip_screen_set(m_scroll_ram[0x34] & 0x40); bitmap.fill(m_palette->black_pen(), cliprect); diff --git a/src/mame/skeleton/banpresto_tomy_h8s.cpp b/src/mame/skeleton/banpresto_tomy_h8s.cpp index de5611b3623..a01cdc84b0e 100644 --- a/src/mame/skeleton/banpresto_tomy_h8s.cpp +++ b/src/mame/skeleton/banpresto_tomy_h8s.cpp @@ -21,6 +21,7 @@ The main components are: The BPSC-2006KG PCB adds a TPA3004D2 audio amplifier. +** means not dumped *** means not dumped nor identified Banpresto "Chara Medal Island" series: @@ -32,7 +33,7 @@ Banpresto "Chara Medal Island" series: almost surely more Takara / Tomy "VS medal" series (games show produced by Amodio and Tomy copyright on title screen): -*** TM-01 - ??? - ??? +** TM-01 - Kurohige Kiki Ippatsu - 黒ひげ危機一発 *** TM-02 - ??? - ??? TM-03 - Zoids (may not be complete title) - ゾイド *** TM-04 - ??? - ??? diff --git a/src/mame/snk/lasso_v.cpp b/src/mame/snk/lasso_v.cpp index 14f5159be99..834a2d852f7 100644 --- a/src/mame/snk/lasso_v.cpp +++ b/src/mame/snk/lasso_v.cpp @@ -59,7 +59,7 @@ rgb_t lasso_state::get_color(int data) // blue component bit0 = BIT(data, 6); bit1 = BIT(data, 7); - int const b = 0x4f * bit0 + 0xa8 * bit1; + int const b = 0x52 * bit0 + 0xad * bit1; return rgb_t(r, g, b); } diff --git a/src/mame/snk/munchmo.cpp b/src/mame/snk/munchmo.cpp index d43a6a66b84..3f1830e14e3 100644 --- a/src/mame/snk/munchmo.cpp +++ b/src/mame/snk/munchmo.cpp @@ -142,7 +142,7 @@ void munchmo_state::palette(palette_device &palette) const // blue component bit0 = BIT(color_prom[i], 6); bit1 = BIT(color_prom[i], 7); - int const b = 0x4f * bit0 + 0xa8 * bit1; + int const b = 0x52 * bit0 + 0xad * bit1; palette.set_pen_color(i, rgb_t(r, g, b)); } diff --git a/src/mame/taito/jollyjgr.cpp b/src/mame/taito/jollyjgr.cpp index 012a1c87760..8958607f886 100644 --- a/src/mame/taito/jollyjgr.cpp +++ b/src/mame/taito/jollyjgr.cpp @@ -476,7 +476,7 @@ void jollyjgr_state::jollyjgr_palette(palette_device &palette) const // blue component bit0 = BIT(*color_prom, 6); bit1 = BIT(*color_prom, 7); - int const b = 0x4f * bit0 + 0xa8 * bit1; + int const b = 0x52 * bit0 + 0xad * bit1; palette.set_pen_color(i, rgb_t(r,g,b)); color_prom++; diff --git a/src/mame/tecfri/ambush.cpp b/src/mame/tecfri/ambush.cpp index dee39906f16..35cc9bbd955 100644 --- a/src/mame/tecfri/ambush.cpp +++ b/src/mame/tecfri/ambush.cpp @@ -81,8 +81,7 @@ class ambush_state : public driver_device private: void ambush_palette(palette_device &palette) const; - void mario_palette(palette_device &palette) const; - void mariobla_palette(palette_device &palette) const; + void mariobl_palette(palette_device &palette) const; void dkong3_palette(palette_device &palette) const; uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); @@ -337,36 +336,7 @@ void ambush_state::ambush_palette(palette_device &palette) const } } -void ambush_state::mario_palette(palette_device &palette) const -{ - uint8_t const *const color_prom = memregion("colors")->base(); - - for (int i = 0; i < palette.entries(); i++) - { - int bit0, bit1, bit2; - - // red component - bit0 = BIT(color_prom[i], 5); - bit1 = BIT(color_prom[i], 6); - bit2 = BIT(color_prom[i], 7); - int const r = 255 - (0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2); - - // green component - bit0 = BIT(color_prom[i], 2); - bit1 = BIT(color_prom[i], 3); - bit2 = BIT(color_prom[i], 4); - int const g = 255 - (0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2); - - // blue component - bit0 = BIT(color_prom[i], 0); - bit1 = BIT(color_prom[i], 1); - int const b = 255 - (0x55 * bit0 + 0xaa * bit1); - - palette.set_pen_color(i, rgb_t(r, g, b)); - } -} - -void ambush_state::mariobla_palette(palette_device &palette) const +void ambush_state::mariobl_palette(palette_device &palette) const { uint8_t const *const color_prom = memregion("colors")->base(); @@ -783,7 +753,7 @@ void ambush_state::mariobl(machine_config &config) m_gfxdecode->set_info(gfx_mariobl); - subdevice("palette")->set_init(FUNC(ambush_state::mario_palette)); + subdevice("palette")->set_init(FUNC(ambush_state::mariobl_palette)); ay8910_device &ay1(AY8910(config.replace(), "ay1", XTAL(18'432'000)/6/2)); ay1.port_a_read_callback().set_ioport("buttons"); @@ -798,8 +768,6 @@ void ambush_state::mariobla(machine_config &config) { mariobl(config); - subdevice("palette")->set_init(FUNC(ambush_state::mariobla_palette)); - auto &outlatch(*subdevice("outlatch")); outlatch.q_out_cb<5>().set(FUNC(ambush_state::color_bank_1_w)); outlatch.q_out_cb<6>().set_nop(); @@ -923,10 +891,19 @@ ROM_START( mariobl ) ROM_LOAD("mbjba-1.3l", 0x4000, 0x2000, CRC(c772cb8f) SHA1(7fd6dd9888928fad5c50d96b4ecff954ea8975ce)) ROM_REGION(0x200, "colors", 0) - ROM_LOAD("a.bpr", 0x000, 0x100, NO_DUMP) - ROM_LOAD("b.bpr", 0x100, 0x100, NO_DUMP) - // taken from mario - ROM_LOAD("tma1-c-4p.4p", 0x000, 0x200, CRC(afc9bd41) SHA1(90b739c4c7f24a88b6ac5ca29b06c032906a2801)) + ROM_LOAD("n82s147n.15", 0x000, 0x200, CRC(6a109f4b) SHA1(b117f85728afc6d3efeff0a7075b797996916f6e)) + + ROM_REGION(0x200, "other_prom", 0) + ROM_LOAD("n82s147n.13", 0x000, 0x200, CRC(a334e4f3) SHA1(b15e3d9851b43976e98c47e3365c1b69022b0a7d)) + + ROM_REGION(0xb00, "plds", ROMREGION_ERASE00) + ROM_LOAD("82s153.2", 0x000, 0x0eb, CRC(3b6ec269) SHA1(447cb00549b606f870f8b7a78aa241acacd4dc5c)) + ROM_LOAD("82s153.4", 0x100, 0x0eb, CRC(8e227b3e) SHA1(6ff6c705269de46a8498fbcc13dd09e92e45b732)) + ROM_LOAD("82s153.11", 0x200, 0x0eb, CRC(9da5e80d) SHA1(3bd1a55e68a7e6b7590fe3c15ae2e3a36b298fa6)) + ROM_LOAD("pal16x4cj.10", 0x300, 0x104, CRC(d2731879) SHA1(81d4719f0a93d8bf8fb113693fc3ffb67c12248b)) + ROM_LOAD("pal16r4cn.1", 0x500, 0x104, NO_DUMP ) // read protected + ROM_LOAD("pal16r4cn.5", 0x700, 0x104, NO_DUMP ) // read protected + ROM_LOAD("pal16r4cn.6", 0x900, 0x104, NO_DUMP ) // read protected ROM_END ROM_START( mariobla ) diff --git a/src/mame/toaplan/batsugun.cpp b/src/mame/toaplan/batsugun.cpp new file mode 100644 index 00000000000..dfe8031ffa9 --- /dev/null +++ b/src/mame/toaplan/batsugun.cpp @@ -0,0 +1,613 @@ +// license:BSD-3-Clause +// copyright-holders:Quench, Yochizo, David Haywood + +#include "emu.h" + +#include "gp9001.h" +#include "toaplan_coincounter.h" +#include "toaplipt.h" + +#include "cpu/m68000/m68000.h" +#include "cpu/nec/v25.h" +#include "sound/okim6295.h" +#include "sound/ymopm.h" + +#include "emupal.h" +#include "screen.h" +#include "speaker.h" +#include "tilemap.h" + +/* +Name Board No Maker Game name +---------------------------------------------------------------------------- +batsugun TP-030 Toaplan Batsugun +batsuguna TP-030 Toaplan Batsugun (older) +batsugunsp TP-030 Toaplan Batsugun (Special Version) + +batsugun - The Special Version has many changes to make the game easier: it adds an autofire button, + replaces the regular bomb with the more powerful double bomb (which in the original version + required both players in a two player game to press their bomb buttons at once), gives you + a shield that can absorb one hit each time your ship "levels up", etc. It also changes the + colors of the title screen, ship select screen, stages, and enemies. + batsugun compared to batsuguna has code that looks more like the Special Version, but it + doesn't have any of the Special Version features. All the differences between batsugun + and batsuguna look like bug fixes that were carried over into the Special Version. +*/ + +namespace { + +class batsugun_state : public driver_device +{ +public: + batsugun_state(const machine_config &mconfig, device_type type, const char *tag) + : driver_device(mconfig, type, tag) + , m_maincpu(*this, "maincpu") + , m_vdp(*this, "gp9001_%u", 0U) + , m_oki(*this, "oki") + , m_palette(*this, "palette") + , m_shared_ram(*this, "shared_ram") + , m_audiocpu(*this, "audiocpu") + , m_screen(*this, "screen") + , m_coincounter(*this, "coincounter") + { } + + void batsugun(machine_config &config) ATTR_COLD; + +protected: + virtual void machine_reset() override ATTR_COLD; + virtual void video_start() override ATTR_COLD; + + required_device m_maincpu; + required_device_array m_vdp; + required_device m_oki; + required_device m_palette; + +private: + u32 screen_update_batsugun(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + + void batsugun_68k_mem(address_map &map) ATTR_COLD; + void v25_mem(address_map &map) ATTR_COLD; + void coin_sound_reset_w(u8 data); + + u8 shared_ram_r(offs_t offset) { return m_shared_ram[offset]; } + void shared_ram_w(offs_t offset, u8 data) { m_shared_ram[offset] = data; } + + void screen_vblank(int state); + + void reset_audiocpu(int state); + + optional_shared_ptr m_shared_ram; // 8 bit RAM shared between 68K and sound CPU + optional_device m_audiocpu; + required_device m_screen; + required_device m_coincounter; + bitmap_ind8 m_custom_priority_bitmap; + bitmap_ind16 m_secondary_render_bitmap; +}; + +class batsugun_bootleg_state : public batsugun_state +{ +public: + batsugun_bootleg_state(const machine_config &mconfig, device_type type, const char *tag) + : batsugun_state(mconfig, type, tag) + , m_okibank(*this, "okibank") + { } + + void batsugunbl(machine_config &config); + + void init_batsugunbl(); + +protected: + virtual void video_start() override ATTR_COLD; + +private: + void batsugunbl_oki_bankswitch_w(u8 data); + void batsugunbl_68k_mem(address_map &map) ATTR_COLD; + void cpu_space_batsugunbl_map(address_map &map); + void fixeightbl_oki(address_map &map) ATTR_COLD; + + required_memory_bank m_okibank; +}; + + +void batsugun_bootleg_state::video_start() +{ + batsugun_state::video_start(); + + // This bootleg has additional layer offsets. TODO: further refinement needed + m_vdp[0]->set_tm_extra_offsets(0, 0, 0, 0, 0); + m_vdp[0]->set_tm_extra_offsets(1, 0, 0, 0, 0); + m_vdp[0]->set_tm_extra_offsets(2, 0, 0, 0, 0); + m_vdp[0]->set_sp_extra_offsets(0x37, 0x07, 0, 0); + + m_vdp[1]->set_tm_extra_offsets(0, -0x05, 0x07, 0, 0); + m_vdp[1]->set_tm_extra_offsets(1, -0x05, 0x07, 0, 0); + m_vdp[1]->set_tm_extra_offsets(2, 0, 0, 0, 0); + m_vdp[1]->set_sp_extra_offsets(0x39, 0x12, 0, 0); + + m_vdp[0]->init_scroll_regs(); + m_vdp[1]->init_scroll_regs(); +} + +// renders to 2 bitmaps, and mixes output +u32 batsugun_state::screen_update_batsugun(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + bitmap.fill(0, cliprect); + m_custom_priority_bitmap.fill(0, cliprect); + m_vdp[0]->render_vdp(bitmap, cliprect); + + m_secondary_render_bitmap.fill(0, cliprect); + m_custom_priority_bitmap.fill(0, cliprect); + m_vdp[1]->render_vdp(m_secondary_render_bitmap, cliprect); + + for (int y = cliprect.min_y; y <= cliprect.max_y; y++) + { + u16 *const src_vdp0 = &bitmap.pix(y); + u16 const *const src_vdp1 = &m_secondary_render_bitmap.pix(y); + + for (int x = cliprect.min_x; x <= cliprect.max_x; x++) + { + const u16 GPU0_LUTaddr = src_vdp0[x]; + const u16 GPU1_LUTaddr = src_vdp1[x]; + const bool COMPARISON = ((GPU0_LUTaddr & 0x0780) > (GPU1_LUTaddr & 0x0780)); + + if (!(GPU1_LUTaddr & 0x000f)) + { + src_vdp0[x] = GPU0_LUTaddr; + } + else + { + if (!(GPU0_LUTaddr & 0x000f)) + { + src_vdp0[x] = GPU1_LUTaddr; // bg pen + } + else + { + if (COMPARISON) + { + src_vdp0[x] = GPU1_LUTaddr; + } + else + { + src_vdp0[x] = GPU0_LUTaddr; + } + + } + } + } + } + + return 0; +} + +void batsugun_state::screen_vblank(int state) +{ + // rising edge + if (state) + { + m_vdp[0]->screen_eof(); + m_vdp[1]->screen_eof(); + } +} + + +void batsugun_state::reset_audiocpu(int state) +{ + if (state) + coin_sound_reset_w(0); +} + +void batsugun_state::machine_reset() +{ + if (m_audiocpu) + coin_sound_reset_w(0); +} + +void batsugun_state::video_start() +{ + m_screen->register_screen_bitmap(m_custom_priority_bitmap); + m_secondary_render_bitmap.reset(); + m_vdp[0]->custom_priority_bitmap = &m_custom_priority_bitmap; + m_screen->register_screen_bitmap(m_secondary_render_bitmap); + m_vdp[1]->custom_priority_bitmap = &m_custom_priority_bitmap; +} + +void batsugun_bootleg_state::fixeightbl_oki(address_map &map) +{ + map(0x00000, 0x2ffff).rom(); + map(0x30000, 0x3ffff).bankr(m_okibank); +} + + +void batsugun_state::coin_sound_reset_w(u8 data) +{ + m_coincounter->coin_w(data & ~0x20); + m_audiocpu->set_input_line(INPUT_LINE_RESET, (data & 0x20) ? CLEAR_LINE : ASSERT_LINE); +} + +static INPUT_PORTS_START( base ) + PORT_START("IN1") + TOAPLAN_JOY_UDLR_3_BUTTONS( 1 ) + + PORT_START("IN2") + TOAPLAN_JOY_UDLR_3_BUTTONS( 2 ) + + PORT_START("SYS") + PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_SERVICE1 ) + PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_TILT ) + TOAPLAN_TEST_SWITCH( 0x04, IP_ACTIVE_HIGH ) + PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_COIN1 ) + PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_COIN2 ) + PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_START1 ) + PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_START2 ) + PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_UNKNOWN ) + + PORT_START("DSWA") + TOAPLAN_MACHINE_NO_COCKTAIL_LOC(SW1) + // Coinage on bit mask 0x00f0 + PORT_BIT( 0x00f0, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // Modified below + + PORT_START("DSWB") + TOAPLAN_DIFFICULTY_LOC(SW2) + // Per-game features on bit mask 0x00fc + PORT_BIT( 0x00fc, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // Modified below +INPUT_PORTS_END + + +static INPUT_PORTS_START( batsugun ) + PORT_INCLUDE( base ) + + PORT_MODIFY("DSWA") + PORT_DIPNAME( 0x0001, 0x0000, DEF_STR( Continue_Price ) ) PORT_DIPLOCATION("SW1:!1") + PORT_DIPSETTING( 0x0000, DEF_STR( Normal ) ) + PORT_DIPSETTING( 0x0001, "Discount" ) + // Various features on bit mask 0x000e - see above + TOAPLAN_COINAGE_JAPAN_LOC(SW1) // European coinage shown in Service Mode but not actually used + + PORT_MODIFY("DSWB") + // Difficulty on bit mask 0x0003 - see above + PORT_DIPNAME( 0x000c, 0x0000, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW2:!3,!4") + PORT_DIPSETTING( 0x000c, DEF_STR( None ) ) + PORT_DIPSETTING( 0x0008, "1500k only" ) + PORT_DIPSETTING( 0x0000, "1000k only" ) + PORT_DIPSETTING( 0x0004, "500k and every 600k" ) + PORT_DIPNAME( 0x0030, 0x0000, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:!5,!6") + PORT_DIPSETTING( 0x0030, "1" ) + PORT_DIPSETTING( 0x0020, "2" ) + PORT_DIPSETTING( 0x0000, "3" ) + PORT_DIPSETTING( 0x0010, "5" ) + PORT_DIPNAME( 0x0040, 0x0000, "Invulnerability (Cheat)" ) PORT_DIPLOCATION("SW2:!7") + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0040, DEF_STR( On ) ) + PORT_DIPNAME( 0x0080, 0x0000, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("SW2:!8") + PORT_DIPSETTING( 0x0080, DEF_STR( No ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( Yes ) ) + + PORT_START("JMPR") + PORT_CONFNAME( 0x00f0, 0x0090, DEF_STR( Region ) ) //PORT_CONFLOCATION("JP:!4,!3,!2,!1") + PORT_CONFSETTING( 0x0090, DEF_STR( Europe ) ) + PORT_CONFSETTING( 0x0080, "Europe (Taito Corp.)" ) + PORT_CONFSETTING( 0x00b0, DEF_STR( USA ) ) + PORT_CONFSETTING( 0x00a0, "USA (Taito Corp.)" ) + PORT_CONFSETTING( 0x00f0, DEF_STR( Japan ) ) +// PORT_CONFSETTING( 0x00e0, DEF_STR( Japan ) ) + PORT_CONFSETTING( 0x00d0, "Japan (Taito Corp.)" ) +// PORT_CONFSETTING( 0x00c0, "Japan (Taito Corp.)" ) + PORT_CONFSETTING( 0x0070, DEF_STR( Southeast_Asia ) ) + PORT_CONFSETTING( 0x0060, "Southeast Asia (Taito Corp.)" ) + PORT_CONFSETTING( 0x0050, DEF_STR( Taiwan ) ) + PORT_CONFSETTING( 0x0040, "Taiwan (Taito Corp.)" ) + PORT_CONFSETTING( 0x0030, DEF_STR( Hong_Kong ) ) + PORT_CONFSETTING( 0x0020, "Hong Kong (Taito Corp.)" ) + PORT_CONFSETTING( 0x0010, DEF_STR( Korea ) ) + PORT_CONFSETTING( 0x0000, "Korea (Unite Trading)" ) +INPUT_PORTS_END + + +static INPUT_PORTS_START( batsugunbl ) + PORT_INCLUDE( batsugun ) + + PORT_MODIFY("JMPR") + PORT_CONFNAME( 0x000f, 0x0009, DEF_STR( Region ) ) //PORT_CONFLOCATION("JP:!4,!3,!2,!1") + PORT_CONFSETTING( 0x0009, DEF_STR( Europe ) ) + PORT_CONFSETTING( 0x0008, "Europe (Taito Corp.)" ) + PORT_CONFSETTING( 0x000b, DEF_STR( USA ) ) + PORT_CONFSETTING( 0x000a, "USA (Taito Corp.)" ) + PORT_CONFSETTING( 0x000f, DEF_STR( Japan ) ) +// PORT_CONFSETTING( 0x000e, DEF_STR( Japan ) ) + PORT_CONFSETTING( 0x000d, "Japan (Taito Corp.)" ) +// PORT_CONFSETTING( 0x000c, "Japan (Taito Corp.)" ) + PORT_CONFSETTING( 0x0007, DEF_STR( Southeast_Asia ) ) + PORT_CONFSETTING( 0x0006, "Southeast Asia (Taito Corp.)" ) + PORT_CONFSETTING( 0x0005, DEF_STR( Taiwan ) ) + PORT_CONFSETTING( 0x0004, "Taiwan (Taito Corp.)" ) + PORT_CONFSETTING( 0x0003, DEF_STR( Hong_Kong ) ) + PORT_CONFSETTING( 0x0002, "Hong Kong (Taito Corp.)" ) + PORT_CONFSETTING( 0x0001, DEF_STR( Korea ) ) + PORT_CONFSETTING( 0x0000, "Korea (Unite Trading)" ) + PORT_CONFNAME( 0x00f0, 0x00f0, "(null)" ) +INPUT_PORTS_END + + + +void batsugun_state::batsugun_68k_mem(address_map &map) +{ + map(0x000000, 0x07ffff).rom(); + map(0x100000, 0x10ffff).ram(); + map(0x200010, 0x200011).portr("IN1"); + map(0x200014, 0x200015).portr("IN2"); + map(0x200018, 0x200019).portr("SYS"); + map(0x20001d, 0x20001d).w(FUNC(batsugun_state::coin_sound_reset_w)); // Coin count/lock + v25 reset line + map(0x210000, 0x21ffff).rw(FUNC(batsugun_state::shared_ram_r), FUNC(batsugun_state::shared_ram_w)).umask16(0x00ff); + map(0x300000, 0x30000d).rw(m_vdp[0], FUNC(gp9001vdp_device::read), FUNC(gp9001vdp_device::write)); + map(0x400000, 0x400fff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); + map(0x500000, 0x50000d).rw(m_vdp[1], FUNC(gp9001vdp_device::read), FUNC(gp9001vdp_device::write)); + map(0x700000, 0x700001).r(m_vdp[0], FUNC(gp9001vdp_device::vdpcount_r)); +} + +void batsugun_bootleg_state::batsugunbl_oki_bankswitch_w(u8 data) +{ + data &= 7; + if (data <= 4) m_okibank->set_entry(data); +} + + +void batsugun_bootleg_state::batsugunbl_68k_mem(address_map &map) +{ + map(0x000000, 0x07ffff).rom(); + map(0x100000, 0x10ffff).ram(); + // map(0x200004, 0x200005).r() // only cleared at boot? + map(0x200005, 0x200005).w(FUNC(batsugun_bootleg_state::batsugunbl_oki_bankswitch_w)); // TODO: doesn't sound correct + map(0x200009, 0x200009).rw(m_oki, FUNC(okim6295_device::read), FUNC(okim6295_device::write)); + map(0x200010, 0x200011).portr("IN1"); + map(0x200014, 0x200015).portr("IN2"); + map(0x200018, 0x200019).portr("SYS"); + map(0x20001c, 0x20001d).nopw(); // leftover code from the original? + map(0x21f004, 0x21f005).portr("DSWA"); + map(0x21f006, 0x21f007).portr("DSWB"); + map(0x21f008, 0x21f009).portr("JMPR"); + map(0x300000, 0x30000d).rw(m_vdp[0], FUNC(gp9001vdp_device::read), FUNC(gp9001vdp_device::write)); + map(0x400000, 0x400fff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); + map(0x500000, 0x50000d).rw(m_vdp[1], FUNC(gp9001vdp_device::read), FUNC(gp9001vdp_device::write)); + map(0x700000, 0x700001).r(m_vdp[0], FUNC(gp9001vdp_device::vdpcount_r)); +} + +void batsugun_bootleg_state::cpu_space_batsugunbl_map(address_map &map) +{ + map(0xfffff0, 0xffffff).m(m_maincpu, FUNC(m68000_base_device::autovectors_map)); + map(0xfffff5, 0xfffff5).lr8(NAME([this] () { m_maincpu->set_input_line(M68K_IRQ_2, CLEAR_LINE); return m68000_device::autovector(2); })); +} + +void batsugun_state::v25_mem(address_map &map) +{ + map(0x00000, 0x00001).rw("ymsnd", FUNC(ym2151_device::read), FUNC(ym2151_device::write)); + map(0x00004, 0x00004).rw(m_oki, FUNC(okim6295_device::read), FUNC(okim6295_device::write)); + map(0x80000, 0x87fff).mirror(0x78000).ram().share(m_shared_ram); +} + +void batsugun_state::batsugun(machine_config &config) +{ + /* basic machine hardware */ + M68000(config, m_maincpu, 32_MHz_XTAL/2); // 16MHz, 32MHz Oscillator + m_maincpu->set_addrmap(AS_PROGRAM, &batsugun_state::batsugun_68k_mem); + m_maincpu->reset_cb().set(FUNC(batsugun_state::reset_audiocpu)); + + v25_device &audiocpu(V25(config, m_audiocpu, 32_MHz_XTAL/2)); // NEC V25 type Toaplan marked CPU ??? + audiocpu.set_addrmap(AS_PROGRAM, &batsugun_state::v25_mem); + audiocpu.pt_in_cb().set_ioport("DSWA").exor(0xff); + audiocpu.p0_in_cb().set_ioport("DSWB").exor(0xff); + audiocpu.p1_in_cb().set_ioport("JMPR").exor(0xff); + audiocpu.p2_out_cb().set_nop(); // bit 0 is FAULT according to kbash schematic + + TOAPLAN_COINCOUNTER(config, m_coincounter, 0); + + /* video hardware */ + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_video_attributes(VIDEO_UPDATE_BEFORE_VBLANK); + m_screen->set_raw(27_MHz_XTAL/4, 432, 0, 320, 262, 0, 240); + m_screen->set_screen_update(FUNC(batsugun_state::screen_update_batsugun)); + m_screen->screen_vblank().set(FUNC(batsugun_state::screen_vblank)); + m_screen->set_palette(m_palette); + + PALETTE(config, m_palette).set_format(palette_device::xBGR_555, gp9001vdp_device::VDP_PALETTE_LENGTH); + + GP9001_VDP(config, m_vdp[0], 27_MHz_XTAL); + m_vdp[0]->set_palette(m_palette); + m_vdp[0]->vint_out_cb().set_inputline(m_maincpu, M68K_IRQ_4); + + GP9001_VDP(config, m_vdp[1], 27_MHz_XTAL); + m_vdp[1]->set_palette(m_palette); + + /* sound hardware */ + SPEAKER(config, "mono").front_center(); + + YM2151(config, "ymsnd", 27_MHz_XTAL/8).add_route(ALL_OUTPUTS, "mono", 0.5); + + OKIM6295(config, m_oki, 32_MHz_XTAL/8, okim6295_device::PIN7_LOW); + m_oki->add_route(ALL_OUTPUTS, "mono", 0.5); +} + +void batsugun_bootleg_state::batsugunbl(machine_config &config) +{ + batsugun(config); + + m_maincpu->set_addrmap(AS_PROGRAM, &batsugun_bootleg_state::batsugunbl_68k_mem); + m_maincpu->set_addrmap(m68000_base_device::AS_CPU_SPACE, &batsugun_bootleg_state::cpu_space_batsugunbl_map); + m_maincpu->reset_cb().set_nop(); + + m_vdp[0]->vint_out_cb().set_inputline(m_maincpu, M68K_IRQ_2, ASSERT_LINE); + + config.device_remove("audiocpu"); + config.device_remove("ymsnd"); + + m_oki->set_addrmap(0, &batsugun_bootleg_state::fixeightbl_oki); +} + + + + + +ROM_START( batsugun ) + ROM_REGION( 0x080000, "maincpu", 0 ) /* Main 68K code */ + ROM_LOAD16_WORD_SWAP( "tp030_1a.bin", 0x000000, 0x080000, CRC(cb1d4554) SHA1(ef31f24d77e1c13bdf5558a04a6253e2e3e6a790) ) + + /* Secondary CPU is a Toaplan marked chip, (TS-007-Spy TOA PLAN) */ + /* It's a NEC V25 (PLCC94) (program uploaded by main CPU) */ + + ROM_REGION( 0x400000, "gp9001_0", 0 ) + ROM_LOAD( "tp030_3l.bin", 0x000000, 0x100000, CRC(3024b793) SHA1(e161db940f069279356fca2c5bf2753f07773705) ) + ROM_LOAD( "tp030_3h.bin", 0x100000, 0x100000, CRC(ed75730b) SHA1(341f0f728144a049486d996c9bb14078578c6879) ) + ROM_LOAD( "tp030_4l.bin", 0x200000, 0x100000, CRC(fedb9861) SHA1(4b0917056bd359b21935358c6bcc729262be6417) ) + ROM_LOAD( "tp030_4h.bin", 0x300000, 0x100000, CRC(d482948b) SHA1(31be7dc5cff072403b783bf203b9805ffcad7284) ) + + ROM_REGION( 0x200000, "gp9001_1", 0 ) + ROM_LOAD( "tp030_5.bin", 0x000000, 0x100000, CRC(bcf5ba05) SHA1(40f98888a29cdd30cda5dfb60fdc667c69b0fdb0) ) + ROM_LOAD( "tp030_6.bin", 0x100000, 0x100000, CRC(0666fecd) SHA1(aa8f921fc51590b5b05bbe0b0ad0cce5ff359c64) ) + + ROM_REGION( 0x40000, "oki", 0 ) /* ADPCM Samples */ + ROM_LOAD( "tp030_2.bin", 0x00000, 0x40000, CRC(276146f5) SHA1(bf11d1f6782cefcad77d52af4f7e6054a8f93440) ) + + ROM_REGION( 0x1000, "plds", 0 ) /* Logic for mixing output of both GP9001 GFX controllers */ + ROM_LOAD( "tp030_u19_gal16v8b-15.bin", 0x0000, 0x117, CRC(f71669e8) SHA1(ec1fbe04605fee864af4b01f001af227938c9f21) ) +// ROM_LOAD( "tp030_u19_gal16v8b-15.jed", 0x0000, 0x991, CRC(31be54a2) SHA1(06278942a9a2ea858c0352b2ef5a65bf329b7b82) ) +ROM_END + +ROM_START( batsuguna ) + ROM_REGION( 0x080000, "maincpu", 0 ) /* Main 68K code */ + ROM_LOAD16_WORD_SWAP( "tp030_01.bin", 0x000000, 0x080000, CRC(3873d7dd) SHA1(baf6187d7d554cfcf4a86b63f07fc30df7ef84c9) ) + + /* Secondary CPU is a Toaplan marked chip, (TS-007-Spy TOA PLAN) */ + /* It's a NEC V25 (PLCC94) (program uploaded by main CPU) */ + + ROM_REGION( 0x400000, "gp9001_0", 0 ) + ROM_LOAD( "tp030_3l.bin", 0x000000, 0x100000, CRC(3024b793) SHA1(e161db940f069279356fca2c5bf2753f07773705) ) + ROM_LOAD( "tp030_3h.bin", 0x100000, 0x100000, CRC(ed75730b) SHA1(341f0f728144a049486d996c9bb14078578c6879) ) + ROM_LOAD( "tp030_4l.bin", 0x200000, 0x100000, CRC(fedb9861) SHA1(4b0917056bd359b21935358c6bcc729262be6417) ) + ROM_LOAD( "tp030_4h.bin", 0x300000, 0x100000, CRC(d482948b) SHA1(31be7dc5cff072403b783bf203b9805ffcad7284) ) + + ROM_REGION( 0x200000, "gp9001_1", 0 ) + ROM_LOAD( "tp030_5.bin", 0x000000, 0x100000, CRC(bcf5ba05) SHA1(40f98888a29cdd30cda5dfb60fdc667c69b0fdb0) ) + ROM_LOAD( "tp030_6.bin", 0x100000, 0x100000, CRC(0666fecd) SHA1(aa8f921fc51590b5b05bbe0b0ad0cce5ff359c64) ) + + ROM_REGION( 0x40000, "oki", 0 ) /* ADPCM Samples */ + ROM_LOAD( "tp030_2.bin", 0x00000, 0x40000, CRC(276146f5) SHA1(bf11d1f6782cefcad77d52af4f7e6054a8f93440) ) + + ROM_REGION( 0x1000, "plds", 0 ) /* Logic for mixing output of both GP9001 GFX controllers */ + ROM_LOAD( "tp030_u19_gal16v8b-15.bin", 0x0000, 0x117, CRC(f71669e8) SHA1(ec1fbe04605fee864af4b01f001af227938c9f21) ) +ROM_END + +ROM_START( batsugunb ) + ROM_REGION( 0x080000, "maincpu", 0 ) /* Main 68K code */ + ROM_LOAD16_WORD_SWAP( "large_rom1.bin", 0x000000, 0x080000, CRC(c9de8ed8) SHA1(8de9acd26e83c8ea3388137da528704116aa7bdb) ) + + /* Secondary CPU is a Toaplan marked chip, (TS-007-Spy TOA PLAN) */ + /* It's a NEC V25 (PLCC94) (program uploaded by main CPU) */ + + ROM_REGION( 0x400000, "gp9001_0", 0 ) + ROM_LOAD16_BYTE( "rom12.bin", 0x000000, 0x080000, CRC(d25affc6) SHA1(00803ae5a2bc06edbfb9ea6e3df51f195bbee8cb) ) + ROM_LOAD16_BYTE( "rom6.bin", 0x000001, 0x080000, CRC(ddd6df60) SHA1(3b46945c51e7b10b473d98916f075e8def336ce7) ) + ROM_LOAD16_BYTE( "rom11.bin", 0x100000, 0x080000, CRC(ed72fe3e) SHA1(5c0f4d5cc84b45e1924dacfa4c0b602cc1600b2f) ) + ROM_LOAD16_BYTE( "rom5.bin", 0x100001, 0x080000, CRC(fd44b33b) SHA1(791cf6056a2dbafa5f41f1dcf686947ee990647d) ) + ROM_LOAD16_BYTE( "rom10.bin", 0x200000, 0x080000, CRC(86b2c6a9) SHA1(b3f39246012c6cd9df69a6797d56479523b33bcb) ) + ROM_LOAD16_BYTE( "rom4.bin", 0x200001, 0x080000, CRC(e7c1c623) SHA1(0d8922ce901b5f74f1bd397d5d9c6ab4e918b1d1) ) + ROM_LOAD16_BYTE( "rom9.bin", 0x300000, 0x080000, CRC(fda8ee00) SHA1(d5ea617a72b2721386eb2dfc15b76de2e30f069c) ) + ROM_LOAD16_BYTE( "rom3.bin", 0x300001, 0x080000, CRC(a7c4dee8) SHA1(94e2dda067612fac810157f8cf392b685b38798b) ) + + ROM_REGION( 0x200000, "gp9001_1", 0 ) + ROM_LOAD16_BYTE( "rom8.bin", 0x000000, 0x080000, CRC(a2c6a170) SHA1(154048ddc8ca2b4e9617e142d904ad2698b0ad02) ) + ROM_LOAD16_BYTE( "rom2.bin", 0x000001, 0x080000, CRC(a457e202) SHA1(4a9f2f95c866fc9d40af1c57ce1940f0a6dc1b82) ) + ROM_LOAD16_BYTE( "rom7.bin", 0x100000, 0x080000, CRC(8644518f) SHA1(570141deeb796cfae57600d5a518d34bb6dc14d0) ) + ROM_LOAD16_BYTE( "rom1.bin", 0x100001, 0x080000, CRC(8e339897) SHA1(80e84c291f287c0783bddfcb1b7ebf78c154cadc) ) + + ROM_REGION( 0x40000, "oki", 0 ) /* ADPCM Samples */ + ROM_LOAD( "rom13.bin", 0x00000, 0x40000, CRC(276146f5) SHA1(bf11d1f6782cefcad77d52af4f7e6054a8f93440) ) + + ROM_REGION( 0x1000, "plds", 0 ) /* Logic for mixing output of both GP9001 GFX controllers */ + ROM_LOAD( "tp030_u19_gal16v8b-15.bin", 0x0000, 0x117, CRC(f71669e8) SHA1(ec1fbe04605fee864af4b01f001af227938c9f21) ) +// ROM_LOAD( "tp030_u19_gal16v8b-15.jed", 0x0000, 0x991, CRC(31be54a2) SHA1(06278942a9a2ea858c0352b2ef5a65bf329b7b82) ) +ROM_END + +// very similar to batsuguna, same main CPU label, seems to have just a tiny bit more code +ROM_START( batsugunc ) + ROM_REGION( 0x080000, "maincpu", 0 ) // Main 68K code + ROM_LOAD16_WORD_SWAP( "tp-030_01.u69", 0x000000, 0x080000, CRC(545305c4) SHA1(9411ad7fe0be89a9f04b9116c9c709dc5e98c345) ) + + /* Secondary CPU is a Toaplan marked chip, (TS-007-Spy TOA PLAN) */ + /* It's a NEC V25 (PLCC94) (program uploaded by main CPU) */ + + ROM_REGION( 0x400000, "gp9001_0", 0 ) + ROM_LOAD( "tp030_rom3-l.u55", 0x000000, 0x100000, CRC(3024b793) SHA1(e161db940f069279356fca2c5bf2753f07773705) ) + ROM_LOAD( "tp030_rom3-h.u56", 0x100000, 0x100000, CRC(ed75730b) SHA1(341f0f728144a049486d996c9bb14078578c6879) ) + ROM_LOAD( "tp030_rom4-l.u54", 0x200000, 0x100000, CRC(fedb9861) SHA1(4b0917056bd359b21935358c6bcc729262be6417) ) + ROM_LOAD( "tp030_rom4-h.u57", 0x300000, 0x100000, CRC(d482948b) SHA1(31be7dc5cff072403b783bf203b9805ffcad7284) ) + + ROM_REGION( 0x200000, "gp9001_1", 0 ) + ROM_LOAD( "tp030_rom5.u32", 0x000000, 0x100000, CRC(bcf5ba05) SHA1(40f98888a29cdd30cda5dfb60fdc667c69b0fdb0) ) + ROM_LOAD( "tp030_rom6.u31", 0x100000, 0x100000, CRC(0666fecd) SHA1(aa8f921fc51590b5b05bbe0b0ad0cce5ff359c64) ) + + ROM_REGION( 0x40000, "oki", 0 ) + ROM_LOAD( "tp030_rom2.u65", 0x00000, 0x40000, CRC(276146f5) SHA1(bf11d1f6782cefcad77d52af4f7e6054a8f93440) ) + + ROM_REGION( 0x1000, "plds", 0 ) // Logic for mixing output of both GP9001 GFX controllers + ROM_LOAD( "tp030_u19_gal16v8b-15.bin", 0x0000, 0x117, CRC(f71669e8) SHA1(ec1fbe04605fee864af4b01f001af227938c9f21) ) +// ROM_LOAD( "tp030_u19_gal16v8b-15.jed", 0x0000, 0x991, CRC(31be54a2) SHA1(06278942a9a2ea858c0352b2ef5a65bf329b7b82) ) +ROM_END + +ROM_START( batsugunsp ) + ROM_REGION( 0x080000, "maincpu", 0 ) /* Main 68K code */ + ROM_LOAD16_WORD_SWAP( "tp-030sp.u69", 0x000000, 0x080000, CRC(8072a0cd) SHA1(3a0a9cdf894926a16800c4882a2b00383d981367) ) + + /* Secondary CPU is a Toaplan marked chip, (TS-007-Spy TOA PLAN) */ + /* It's a NEC V25 (PLCC94) (program uploaded by main CPU) */ + + ROM_REGION( 0x400000, "gp9001_0", 0 ) + ROM_LOAD( "tp030_3l.bin", 0x000000, 0x100000, CRC(3024b793) SHA1(e161db940f069279356fca2c5bf2753f07773705) ) + ROM_LOAD( "tp030_3h.bin", 0x100000, 0x100000, CRC(ed75730b) SHA1(341f0f728144a049486d996c9bb14078578c6879) ) + ROM_LOAD( "tp030_4l.bin", 0x200000, 0x100000, CRC(fedb9861) SHA1(4b0917056bd359b21935358c6bcc729262be6417) ) + ROM_LOAD( "tp030_4h.bin", 0x300000, 0x100000, CRC(d482948b) SHA1(31be7dc5cff072403b783bf203b9805ffcad7284) ) + + ROM_REGION( 0x200000, "gp9001_1", 0 ) + ROM_LOAD( "tp030_5.bin", 0x000000, 0x100000, CRC(bcf5ba05) SHA1(40f98888a29cdd30cda5dfb60fdc667c69b0fdb0) ) + ROM_LOAD( "tp030_6.bin", 0x100000, 0x100000, CRC(0666fecd) SHA1(aa8f921fc51590b5b05bbe0b0ad0cce5ff359c64) ) + + ROM_REGION( 0x40000, "oki", 0 ) /* ADPCM Samples */ + ROM_LOAD( "tp030_2.bin", 0x00000, 0x40000, CRC(276146f5) SHA1(bf11d1f6782cefcad77d52af4f7e6054a8f93440) ) + + ROM_REGION( 0x1000, "plds", 0 ) /* Logic for mixing output of both GP9001 GFX controllers */ + ROM_LOAD( "tp030_u19_gal16v8b-15.bin", 0x0000, 0x117, CRC(f71669e8) SHA1(ec1fbe04605fee864af4b01f001af227938c9f21) ) +ROM_END + +// a cost-cutting bootleg PCB with only M68000 + OKIM6295. A pair of TPC1020 seem to do the job of the GP9001s. +// according to the dumper 'audio is pretty garbage, and some sprites overlay the UI incorrectly' +ROM_START( batsugunbl ) + ROM_REGION( 0x080000, "maincpu", 0 ) + ROM_LOAD16_WORD_SWAP( "27c240.bin", 0x000000, 0x080000, CRC(a34df8bb) SHA1(10d456f5437b21a95fd8018bdb19a08a110241c4) ) + + ROM_REGION( 0x400000, "gp9001_0", 0 ) // same as original + ROM_LOAD( "27c8100-j.bin", 0x000000, 0x100000, CRC(3024b793) SHA1(e161db940f069279356fca2c5bf2753f07773705) ) + ROM_LOAD( "27c8100-k.bin", 0x100000, 0x100000, CRC(ed75730b) SHA1(341f0f728144a049486d996c9bb14078578c6879) ) + ROM_LOAD( "27c8100-l.bin", 0x200000, 0x100000, CRC(fedb9861) SHA1(4b0917056bd359b21935358c6bcc729262be6417) ) + ROM_LOAD( "27c8100-m.bin", 0x300000, 0x100000, CRC(d482948b) SHA1(31be7dc5cff072403b783bf203b9805ffcad7284) ) + + ROM_REGION( 0x200000, "gp9001_1", 0 ) // same as original + ROM_LOAD( "27c8100-n.bin", 0x000000, 0x100000, CRC(bcf5ba05) SHA1(40f98888a29cdd30cda5dfb60fdc667c69b0fdb0) ) + ROM_LOAD( "27c8100-o.bin", 0x100000, 0x100000, CRC(0666fecd) SHA1(aa8f921fc51590b5b05bbe0b0ad0cce5ff359c64) ) + + ROM_REGION( 0x80000, "oki", 0 ) // more samples to compensate for missing YM2151 + ROM_LOAD( "27c040.bin", 0x00000, 0x80000, CRC(1f8ec1b6) SHA1(28107a90d29613ceddc001df2556543b33c1294c) ) +ROM_END + +void batsugun_bootleg_state::init_batsugunbl() +{ + u8 *ROM = memregion("oki")->base(); + + m_okibank->configure_entries(0, 5, &ROM[0x30000], 0x10000); +} + +} // anonymous namespace + +GAME( 1993, batsugun, 0, batsugun, batsugun, batsugun_state, empty_init, ROT270, "Toaplan", "Batsugun", MACHINE_SUPPORTS_SAVE ) +GAME( 1993, batsuguna, batsugun, batsugun, batsugun, batsugun_state, empty_init, ROT270, "Toaplan", "Batsugun (older, set 1)", MACHINE_SUPPORTS_SAVE ) +GAME( 1993, batsugunc, batsugun, batsugun, batsugun, batsugun_state, empty_init, ROT270, "Toaplan", "Batsugun (older, set 2)", MACHINE_SUPPORTS_SAVE ) +GAME( 1993, batsugunb, batsugun, batsugun, batsugun, batsugun_state, empty_init, ROT270, "Toaplan", "Batsugun (Korean PCB)", MACHINE_SUPPORTS_SAVE ) // cheap looking PCB (same 'TP-030' numbering as original) but without Mask ROMs. Still has original customs etc. Jumpers were set to the Korea Unite Trading license, so likely made in Korea, not a bootleg tho. +GAME( 1993, batsugunsp, batsugun, batsugun, batsugun, batsugun_state, empty_init, ROT270, "Toaplan", "Batsugun - Special Version", MACHINE_SUPPORTS_SAVE ) +GAME( 1993, batsugunbl, batsugun, batsugunbl, batsugunbl, batsugun_bootleg_state, init_batsugunbl, ROT270, "Toaplan", "Batsugun (bootleg)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) // needs correct GFX offsets and oki banking fix diff --git a/src/mame/toaplan/dogyuun.cpp b/src/mame/toaplan/dogyuun.cpp new file mode 100644 index 00000000000..00a780f6cf1 --- /dev/null +++ b/src/mame/toaplan/dogyuun.cpp @@ -0,0 +1,506 @@ +// license:BSD-3-Clause +// copyright-holders:Quench, Yochizo, David Haywood + +#include "emu.h" + +#include "gp9001.h" +#include "toaplan_coincounter.h" +#include "toaplan_v25_tables.h" +#include "toaplipt.h" + +#include "cpu/m68000/m68000.h" +#include "cpu/nec/v25.h" +#include "cpu/z80/z80.h" +#include "sound/okim6295.h" +#include "sound/ymopm.h" + +#include "emupal.h" +#include "screen.h" +#include "speaker.h" +#include "tilemap.h" + +/* +Name Board No Maker Game name +---------------------------------------------------------------------------- +dogyuun TP-022 Toaplan Dogyuun +dogyuuna TP-022 Toaplan Dogyuun (older) +dogyuunt TP-022 Toaplan Dogyuun (location test) + +dogyuun - In the location test version, if you are hit while you have a bomb, the bomb explodes + automatically and saves you from dying. In the final released version, the bomb explodes + but you die anyway. + The only difference between the dogyuun and dogyuuna sets is some of the region jumper + settings; see the INPUT_PORTS definitions. +*/ + +namespace { + +class dogyuun_state : public driver_device +{ +public: + dogyuun_state(const machine_config &mconfig, device_type type, const char *tag) + : driver_device(mconfig, type, tag) + , m_maincpu(*this, "maincpu") + , m_audiocpu(*this, "audiocpu") + , m_shared_ram(*this, "shared_ram") + , m_vdp(*this, "gp9001_%u", 0U) + , m_oki(*this, "oki") + , m_palette(*this, "palette") + , m_coincounter(*this, "coincounter") + , m_screen(*this, "screen") + { } + + void dogyuun(machine_config &config) ATTR_COLD; + void dogyuunto(machine_config &config) ATTR_COLD; + +protected: + virtual void machine_reset() override ATTR_COLD; + virtual void video_start() override ATTR_COLD; + + u8 shared_ram_r(offs_t offset) { return m_shared_ram[offset]; } + void shared_ram_w(offs_t offset, u8 data) { m_shared_ram[offset] = data; } + + template void coin_sound_reset_w(u8 data); + + void dogyuun_base(machine_config &config) ATTR_COLD; + + required_device m_maincpu; + required_device m_audiocpu; + required_shared_ptr m_shared_ram; // 8 bit RAM shared between 68K and sound CPU + required_device_array m_vdp; + required_device m_oki; + required_device m_palette; + +private: + u32 screen_update_dogyuun(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + + void screen_vblank(int state); + + void reset_audiocpu(int state); + + void dogyuun_68k_mem(address_map &map) ATTR_COLD; + void v25_mem(address_map &map) ATTR_COLD; + void dogyuunto_68k_mem(address_map &map) ATTR_COLD; + void dogyuunto_sound_z80_mem(address_map &map) ATTR_COLD; + + required_device m_coincounter; + required_device m_screen; + bitmap_ind8 m_custom_priority_bitmap; + bitmap_ind16 m_secondary_render_bitmap; +}; + +void dogyuun_state::reset_audiocpu(int state) +{ + if (state) + { + m_coincounter->coin_w(0); + m_audiocpu->set_input_line(INPUT_LINE_RESET, ASSERT_LINE); + } +} + +void dogyuun_state::machine_reset() +{ + m_coincounter->coin_w(0); + m_audiocpu->set_input_line(INPUT_LINE_RESET, ASSERT_LINE); +} + +void dogyuun_state::video_start() +{ + m_screen->register_screen_bitmap(m_custom_priority_bitmap); + m_secondary_render_bitmap.reset(); + m_vdp[0]->custom_priority_bitmap = &m_custom_priority_bitmap; + m_screen->register_screen_bitmap(m_secondary_render_bitmap); + m_vdp[1]->custom_priority_bitmap = &m_custom_priority_bitmap; +} + +void dogyuun_state::screen_vblank(int state) +{ + if (state) // rising edge + { + m_vdp[0]->screen_eof(); + m_vdp[1]->screen_eof(); + } +} + +u32 dogyuun_state::screen_update_dogyuun(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + bitmap.fill(0, cliprect); + m_custom_priority_bitmap.fill(0, cliprect); + m_vdp[1]->render_vdp(bitmap, cliprect); + m_custom_priority_bitmap.fill(0, cliprect); + m_vdp[0]->render_vdp(bitmap, cliprect); + return 0; +} + +static INPUT_PORTS_START( base ) + PORT_START("IN1") + TOAPLAN_JOY_UDLR_3_BUTTONS( 1 ) + + PORT_START("IN2") + TOAPLAN_JOY_UDLR_3_BUTTONS( 2 ) + + PORT_START("SYS") + PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_SERVICE1 ) + PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_TILT ) + TOAPLAN_TEST_SWITCH( 0x04, IP_ACTIVE_HIGH ) + PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_COIN1 ) + PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_COIN2 ) + PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_START1 ) + PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_START2 ) + PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_UNKNOWN ) + + PORT_START("DSWA") + TOAPLAN_MACHINE_NO_COCKTAIL_LOC(SW1) + // Coinage on bit mask 0x00f0 + PORT_BIT( 0x00f0, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // Modified below + + PORT_START("DSWB") + TOAPLAN_DIFFICULTY_LOC(SW2) + // Per-game features on bit mask 0x00fc + PORT_BIT( 0x00fc, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // Modified below +INPUT_PORTS_END + +static INPUT_PORTS_START( dogyuun ) + PORT_INCLUDE( base ) + + PORT_MODIFY("DSWA") + PORT_DIPNAME( 0x0001, 0x0000, DEF_STR( Free_Play) ) PORT_DIPLOCATION("SW1:!1") + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0001, DEF_STR( On ) ) + // Various features on bit mask 0x000e - see above + TOAPLAN_COINAGE_DUAL_LOC( JMPR, 0x8000, 0x8000, SW1 ) + + PORT_MODIFY("DSWB") + // Difficulty on bit mask 0x0003 - see above + PORT_DIPNAME( 0x000c, 0x0000, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW2:!3,!4") + PORT_DIPSETTING( 0x000c, DEF_STR( None ) ) + PORT_DIPSETTING( 0x0008, "400k only" ) + PORT_DIPSETTING( 0x0000, "200k only" ) + PORT_DIPSETTING( 0x0004, "200k, 400k and 600k" ) + PORT_DIPNAME( 0x0030, 0x0000, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:!5,!6") + PORT_DIPSETTING( 0x0030, "1" ) + PORT_DIPSETTING( 0x0020, "2" ) + PORT_DIPSETTING( 0x0000, "3" ) + PORT_DIPSETTING( 0x0010, "5" ) + PORT_DIPNAME( 0x0040, 0x0000, "Invulnerability (Cheat)" ) PORT_DIPLOCATION("SW2:!7") + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0040, DEF_STR( On ) ) + PORT_DIPNAME( 0x0080, 0x0000, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("SW2:!8") + PORT_DIPSETTING( 0x0080, DEF_STR( No ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( Yes ) ) + + PORT_START("JMPR") + // Bit Mask 0x8000 is used here to signify European Coinage for MAME purposes - not read on the real board! + // "No speedups": all speedup items in game are replaced with bombs + PORT_CONFNAME( 0x80f0, 0x8030, DEF_STR( Region ) ) //PORT_CONFLOCATION("JP:!4,!3,!2,!1,FAKE:!1") + PORT_CONFSETTING( 0x8030, DEF_STR( Europe ) ) + PORT_CONFSETTING( 0x0010, DEF_STR( USA ) ) + PORT_CONFSETTING( 0x0020, "USA (Atari Games Corp.)" ) + PORT_CONFSETTING( 0x0000, DEF_STR( Japan ) ) + PORT_CONFSETTING( 0x0040, "Hong Kong (Charterfield); no speedups" ) + PORT_CONFSETTING( 0x0050, "Korea (Unite Trading); no speedups" ) + PORT_CONFSETTING( 0x0060, "Taiwan; no speedups" ) + PORT_CONFSETTING( 0x0070, "USA; no speedups" ) + PORT_CONFSETTING( 0x0080, "Southeast Asia (Charterfield); no speedups" ) + PORT_CONFSETTING( 0x0090, "Hong Kong (Charterfield)" ) + PORT_CONFSETTING( 0x00a0, "Korea (Unite Trading)" ) + PORT_CONFSETTING( 0x00b0, DEF_STR( Taiwan ) ) + PORT_CONFSETTING( 0x00c0, "USA (Atari Games Corp.); no speedups" ) + PORT_CONFSETTING( 0x00d0, "Southeast Asia (Charterfield)" ) + PORT_CONFSETTING( 0x80e0, "Europe; no speedups" ) + PORT_CONFSETTING( 0x00f0, "Japan (Taito Corp.)" ) +INPUT_PORTS_END + +static INPUT_PORTS_START( dogyuuna ) + PORT_INCLUDE( dogyuun ) + + PORT_MODIFY("DSWA") + TOAPLAN_COINAGE_DUAL_LOC( JMPR, 0xf0, 0x30, SW1 ) + + PORT_MODIFY("JMPR") + // "No speedups": all speedup items in game are replaced with bombs + PORT_CONFNAME( 0x00f0, 0x0030, DEF_STR( Region ) ) //PORT_CONFLOCATION("JP:!4,!3,!2,!1") + PORT_CONFSETTING( 0x0030, DEF_STR( Europe ) ) + PORT_CONFSETTING( 0x0010, DEF_STR( USA ) ) + PORT_CONFSETTING( 0x0020, "USA (Atari Games Corp.)" ) + PORT_CONFSETTING( 0x0000, DEF_STR( Japan ) ) + PORT_CONFSETTING( 0x0040, "Hong Kong (Charterfield); no speedups" ) + PORT_CONFSETTING( 0x0050, "Korea (Unite Trading); no speedups" ) + PORT_CONFSETTING( 0x0060, "Taiwan; no speedups" ) +// PORT_CONFSETTING( 0x0070, "Taiwan (Licensed to ???????); no speedups" ) + PORT_CONFSETTING( 0x0080, "Southeast Asia (Charterfield); no speedups" ) + PORT_CONFSETTING( 0x0090, "Hong Kong (Charterfield)" ) + PORT_CONFSETTING( 0x00a0, "Korea (Unite Trading)" ) + PORT_CONFSETTING( 0x00b0, DEF_STR( Taiwan ) ) +// PORT_CONFSETTING( 0x00c0, "Taiwan (Licensed to ???????)" ) + PORT_CONFSETTING( 0x00d0, "Southeast Asia (Charterfield)" ) +// PORT_CONFSETTING( 0x00e0, DEF_STR( Unused ) ) + PORT_CONFSETTING( 0x00f0, "Japan (Taito Corp.)" ) +INPUT_PORTS_END + +static INPUT_PORTS_START( dogyuunt ) + PORT_INCLUDE( dogyuun ) + + PORT_MODIFY("DSWA") + TOAPLAN_COINAGE_DUAL_LOC( JMPR, 0xf0, 0x20, SW1 ) + + PORT_MODIFY("JMPR") + PORT_CONFNAME( 0x00f0, 0x0020, DEF_STR( Region ) ) //PORT_CONFLOCATION("JP:!4,!3,!2,!1") + PORT_CONFSETTING( 0x0020, DEF_STR( Europe ) ) + PORT_CONFSETTING( 0x0010, DEF_STR( USA ) ) + PORT_CONFSETTING( 0x0000, DEF_STR( Japan ) ) + PORT_CONFSETTING( 0x0030, DEF_STR( Hong_Kong ) ) + PORT_CONFSETTING( 0x0040, DEF_STR( Korea ) ) + PORT_CONFSETTING( 0x0050, DEF_STR( Taiwan ) ) + PORT_CONFSETTING( 0x0060, "Southeast Asia (Charterfield)" ) + PORT_CONFSETTING( 0x0070, "USA (Romstar, Inc.)" ) + PORT_CONFSETTING( 0x0080, "Hong Kong (Honest Trading Co.)" ) + PORT_CONFSETTING( 0x0090, "Korea (JC Trading Corp.)" ) + PORT_CONFSETTING( 0x00a0, "USA (Fabtek)" ) +// PORT_CONFSETTING( 0x00b0, DEF_STR( Unused ) ) +// PORT_CONFSETTING( 0x00c0, DEF_STR( Unused ) ) +// PORT_CONFSETTING( 0x00d0, DEF_STR( Unused ) ) +// PORT_CONFSETTING( 0x00e0, DEF_STR( Unused ) ) + PORT_CONFSETTING( 0x00f0, "Japan (Taito Corp.)" ) +INPUT_PORTS_END + +template +void dogyuun_state::coin_sound_reset_w(u8 data) +{ + m_coincounter->coin_w(data & ~(u8(1) << B)); + m_audiocpu->set_input_line(INPUT_LINE_RESET, BIT(data, B) ? CLEAR_LINE : ASSERT_LINE); +} + +void dogyuun_state::dogyuun_68k_mem(address_map &map) +{ + map(0x000000, 0x07ffff).rom(); + map(0x100000, 0x103fff).ram(); + map(0x200010, 0x200011).portr("IN1"); + map(0x200014, 0x200015).portr("IN2"); + map(0x200018, 0x200019).portr("SYS"); + map(0x20001d, 0x20001d).w(FUNC(dogyuun_state::coin_sound_reset_w<5>)); // Coin count/lock + v25 reset line + map(0x210000, 0x21ffff).rw(FUNC(dogyuun_state::shared_ram_r), FUNC(dogyuun_state::shared_ram_w)).umask16(0x00ff); + map(0x300000, 0x30000d).rw(m_vdp[0], FUNC(gp9001vdp_device::read), FUNC(gp9001vdp_device::write)); + map(0x400000, 0x400fff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); + map(0x500000, 0x50000d).rw(m_vdp[1], FUNC(gp9001vdp_device::read), FUNC(gp9001vdp_device::write)); + map(0x700000, 0x700001).r(m_vdp[0], FUNC(gp9001vdp_device::vdpcount_r)); // test bit 8 +} + + +void dogyuun_state::dogyuunto_68k_mem(address_map &map) +{ + map(0x000000, 0x07ffff).rom(); + map(0x100000, 0x103fff).ram(); + map(0x218000, 0x218fff).rw(FUNC(dogyuun_state::shared_ram_r), FUNC(dogyuun_state::shared_ram_w)).umask16(0x00ff); // reads the same area as the finished game on startup, but then uses only this part + map(0x21c01d, 0x21c01d).w(FUNC(dogyuun_state::coin_sound_reset_w<4>)); // Coin count/lock + Z80 reset line + map(0x21c020, 0x21c021).portr("IN1"); + map(0x21c024, 0x21c025).portr("IN2"); + map(0x21c028, 0x21c029).portr("SYS"); + map(0x21c02c, 0x21c02d).portr("DSWA"); + map(0x21c030, 0x21c031).portr("DSWB"); + map(0x300000, 0x30000d).rw(m_vdp[0], FUNC(gp9001vdp_device::read), FUNC(gp9001vdp_device::write)); + map(0x400000, 0x400fff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); + map(0x500000, 0x50000d).rw(m_vdp[1], FUNC(gp9001vdp_device::read), FUNC(gp9001vdp_device::write)); + map(0x700000, 0x700001).r(m_vdp[0], FUNC(gp9001vdp_device::vdpcount_r)); // test bit 8 +} + +void dogyuun_state::dogyuunto_sound_z80_mem(address_map &map) +{ + map(0x0000, 0x7fff).rom(); + map(0xc000, 0xc7ff).ram().share(m_shared_ram); + map(0xe000, 0xe001).rw("ymsnd", FUNC(ym2151_device::read), FUNC(ym2151_device::write)); + map(0xe004, 0xe004).rw(m_oki, FUNC(okim6295_device::read), FUNC(okim6295_device::write)); +} + +void dogyuun_state::v25_mem(address_map &map) +{ + map(0x00000, 0x00001).rw("ymsnd", FUNC(ym2151_device::read), FUNC(ym2151_device::write)); + map(0x00004, 0x00004).rw(m_oki, FUNC(okim6295_device::read), FUNC(okim6295_device::write)); + map(0x80000, 0x87fff).mirror(0x78000).ram().share(m_shared_ram); +} + +void dogyuun_state::dogyuun_base(machine_config &config) +{ + /* basic machine hardware */ + M68000(config, m_maincpu, 25_MHz_XTAL/2); /* verified on pcb */ + m_maincpu->reset_cb().set(FUNC(dogyuun_state::reset_audiocpu)); + + TOAPLAN_COINCOUNTER(config, m_coincounter, 0); + + /* video hardware */ + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_video_attributes(VIDEO_UPDATE_BEFORE_VBLANK); + m_screen->set_raw(27_MHz_XTAL/4, 432, 0, 320, 262, 0, 240); + m_screen->set_screen_update(FUNC(dogyuun_state::screen_update_dogyuun)); + m_screen->screen_vblank().set(FUNC(dogyuun_state::screen_vblank)); + m_screen->set_palette(m_palette); + + PALETTE(config, m_palette).set_format(palette_device::xBGR_555, gp9001vdp_device::VDP_PALETTE_LENGTH); + + GP9001_VDP(config, m_vdp[0], 27_MHz_XTAL); + m_vdp[0]->set_palette(m_palette); + m_vdp[0]->vint_out_cb().set_inputline(m_maincpu, M68K_IRQ_4); + + GP9001_VDP(config, m_vdp[1], 27_MHz_XTAL); + m_vdp[1]->set_palette(m_palette); + + /* sound hardware */ + SPEAKER(config, "mono").front_center(); + + YM2151(config, "ymsnd", 27_MHz_XTAL/8).add_route(ALL_OUTPUTS, "mono", 0.5); // verified on pcb + + OKIM6295(config, m_oki, 25_MHz_XTAL/24, okim6295_device::PIN7_HIGH); // verified on PCB + m_oki->add_route(ALL_OUTPUTS, "mono", 0.5); +} + +void dogyuun_state::dogyuun(machine_config& config) +{ + dogyuun_base(config); + + m_maincpu->set_addrmap(AS_PROGRAM, &dogyuun_state::dogyuun_68k_mem); + + v25_device &audiocpu(V25(config, m_audiocpu, 25_MHz_XTAL/2)); /* NEC V25 type Toaplan marked CPU ??? */ + audiocpu.set_addrmap(AS_PROGRAM, &dogyuun_state::v25_mem); + audiocpu.set_decryption_table(toaplan_v25_tables::nitro_decryption_table); + audiocpu.pt_in_cb().set_ioport("DSWB").exor(0xff); + audiocpu.p0_in_cb().set_ioport("DSWA").exor(0xff); + audiocpu.p1_in_cb().set_ioport("JMPR").exor(0xff); + audiocpu.p2_out_cb().set_nop(); // bit 0 is FAULT according to kbash schematic +} + + +void dogyuun_state::dogyuunto(machine_config &config) +{ + dogyuun_base(config); + + m_maincpu->set_addrmap(AS_PROGRAM, &dogyuun_state::dogyuunto_68k_mem); + m_maincpu->set_clock(24_MHz_XTAL / 2); // 24 MHz instead of 25 + + z80_device &audiocpu(Z80(config, "audiocpu", 27_MHz_XTAL / 8)); // guessed divisor + audiocpu.set_addrmap(AS_PROGRAM, &dogyuun_state::dogyuunto_sound_z80_mem); + + m_oki->set_clock(1.056_MHz_XTAL); // blue resonator 1056J +} + + +ROM_START( dogyuun ) + ROM_REGION( 0x080000, "maincpu", 0 ) /* Main 68K code */ + ROM_LOAD16_WORD_SWAP( "tp022_01.r16", 0x000000, 0x080000, CRC(79eb2429) SHA1(088c5ed0ed77557ab71f52cafe35028e3648ae1e) ) + + /* Secondary CPU is a Toaplan marked chip, (TS-002-MACH TOA PLAN) */ + /* It's a NEC V25 (PLCC94) (encrypted program uploaded by main CPU) */ + + ROM_REGION( 0x200000, "gp9001_0", 0 ) + ROM_LOAD16_WORD_SWAP( "tp022_3.w92", 0x000000, 0x100000, CRC(191b595f) SHA1(89344946daa18087cc83f92027cf5da659b1c7a5) ) + ROM_LOAD16_WORD_SWAP( "tp022_4.w93", 0x100000, 0x100000, CRC(d58d29ca) SHA1(90d142fef37764ef817347a2bed77892a288a077) ) + + ROM_REGION( 0x400000, "gp9001_1", 0 ) + ROM_LOAD16_WORD_SWAP( "tp022_5.w16", 0x000000, 0x200000, CRC(d4c1db45) SHA1(f5655467149ba737128c2f54c9c6cdaca6e4c35c) ) + ROM_LOAD16_WORD_SWAP( "tp022_6.w17", 0x200000, 0x200000, CRC(d48dc74f) SHA1(081b5a00a2ff2bd82b98b30aab3cb5b6ae1014d5) ) + + ROM_REGION( 0x40000, "oki", 0 ) /* ADPCM Samples */ + ROM_LOAD( "tp022_2.w30", 0x00000, 0x40000, CRC(043271b3) SHA1(c7eaa929e55dd956579b824ea9d20a1d0129a925) ) +ROM_END + + +ROM_START( dogyuuna ) + ROM_REGION( 0x080000, "maincpu", 0 ) /* Main 68K code */ + ROM_LOAD16_WORD_SWAP( "01.u64", 0x000000, 0x080000, CRC(fe5bd7f4) SHA1(9c725466112a514c9ed0fb074422d291c175c3f4) ) + + /* Secondary CPU is a Toaplan marked chip, (TS-002-MACH TOA PLAN) */ + /* It's a NEC V25 (PLCC94) (encrypted program uploaded by main CPU) */ + + ROM_REGION( 0x200000, "gp9001_0", 0 ) + ROM_LOAD16_WORD_SWAP( "tp022_3.w92", 0x000000, 0x100000, CRC(191b595f) SHA1(89344946daa18087cc83f92027cf5da659b1c7a5) ) + ROM_LOAD16_WORD_SWAP( "tp022_4.w93", 0x100000, 0x100000, CRC(d58d29ca) SHA1(90d142fef37764ef817347a2bed77892a288a077) ) + + ROM_REGION( 0x400000, "gp9001_1", 0 ) + ROM_LOAD16_WORD_SWAP( "tp022_5.w16", 0x000000, 0x200000, CRC(d4c1db45) SHA1(f5655467149ba737128c2f54c9c6cdaca6e4c35c) ) + ROM_LOAD16_WORD_SWAP( "tp022_6.w17", 0x200000, 0x200000, CRC(d48dc74f) SHA1(081b5a00a2ff2bd82b98b30aab3cb5b6ae1014d5) ) + + ROM_REGION( 0x40000, "oki", 0 ) /* ADPCM Samples */ + ROM_LOAD( "tp022_2.w30", 0x00000, 0x40000, CRC(043271b3) SHA1(c7eaa929e55dd956579b824ea9d20a1d0129a925) ) +ROM_END + + +// found on a standard TP-022-1 PCB, main CPU ROM had a MR sticker. It's a little closer to the location test than to the released versions (i.e region configuration). +ROM_START( dogyuunb ) + ROM_REGION( 0x080000, "maincpu", 0 ) // Main 68K code + ROM_LOAD16_WORD_SWAP( "mr.u64", 0x000000, 0x080000, CRC(4dc258dc) SHA1(ac2783030a8367a20bfad282942c2aa383156291) ) // M27C4002 + + // Secondary CPU is a Toaplan marked chip, (TS-002-MACH TOA PLAN) + // It's a NEC V25 (PLCC94) (encrypted program uploaded by main CPU) + + ROM_REGION( 0x200000, "gp9001_0", 0 ) + ROM_LOAD16_WORD_SWAP( "tp022_3.w92", 0x000000, 0x100000, CRC(191b595f) SHA1(89344946daa18087cc83f92027cf5da659b1c7a5) ) + ROM_LOAD16_WORD_SWAP( "tp022_4.w93", 0x100000, 0x100000, CRC(d58d29ca) SHA1(90d142fef37764ef817347a2bed77892a288a077) ) + + ROM_REGION( 0x400000, "gp9001_1", 0 ) + ROM_LOAD16_WORD_SWAP( "tp022_5.w16", 0x000000, 0x200000, CRC(d4c1db45) SHA1(f5655467149ba737128c2f54c9c6cdaca6e4c35c) ) + ROM_LOAD16_WORD_SWAP( "tp022_6.w17", 0x200000, 0x200000, CRC(d48dc74f) SHA1(081b5a00a2ff2bd82b98b30aab3cb5b6ae1014d5) ) + + ROM_REGION( 0x40000, "oki", 0 ) + ROM_LOAD( "tp022_2.w30", 0x00000, 0x40000, CRC(043271b3) SHA1(c7eaa929e55dd956579b824ea9d20a1d0129a925) ) +ROM_END + + +ROM_START( dogyuunt ) + ROM_REGION( 0x080000, "maincpu", 0 ) /* Main 68K code */ + ROM_LOAD16_WORD_SWAP( "sample10.9.u64.bin", 0x000000, 0x080000, CRC(585f5016) SHA1(18d57843f33a560a3bb4b6aef176f7ef795b742d) ) + + /* Secondary CPU is a Toaplan marked chip, (TS-002-MACH TOA PLAN) */ + /* It's a NEC V25 (PLCC94) (encrypted program uploaded by main CPU) */ + + ROM_REGION( 0x200000, "gp9001_0", 0 ) + ROM_LOAD16_WORD_SWAP( "tp022_3.w92", 0x000000, 0x100000, CRC(191b595f) SHA1(89344946daa18087cc83f92027cf5da659b1c7a5) ) + ROM_LOAD16_WORD_SWAP( "tp022_4.w93", 0x100000, 0x100000, CRC(d58d29ca) SHA1(90d142fef37764ef817347a2bed77892a288a077) ) + + ROM_REGION( 0x400000, "gp9001_1", 0 ) + ROM_LOAD16_WORD_SWAP( "tp022_5.w16", 0x000000, 0x200000, CRC(d4c1db45) SHA1(f5655467149ba737128c2f54c9c6cdaca6e4c35c) ) + ROM_LOAD16_WORD_SWAP( "tp022_6.w17", 0x200000, 0x200000, CRC(d48dc74f) SHA1(081b5a00a2ff2bd82b98b30aab3cb5b6ae1014d5) ) + + ROM_REGION( 0x40000, "oki", 0 ) /* ADPCM Samples */ + ROM_LOAD( "tp022_2.w30", 0x00000, 0x40000, CRC(043271b3) SHA1(c7eaa929e55dd956579b824ea9d20a1d0129a925) ) +ROM_END + + +/* +This set came on a TX-022 PCB (different from the final version, TP-022). +Seems the game is always in 'debug mode' according to the test menu (dip has no effect). Still, it has no invicibility effect. +Couldn't find a read for the region settings jumpers. +Hardware differences according to the dumper: +* Two GCUs have nearly identical sections copy-pasted, one above the other. +* Toaplan HK-1000 ceramic module is used for inputs; the final implements the logic separately. +* Inputs mapped in the main CPU address space. +* No NEC V25 sound CPU; instead, there is a Z80 with its own ROM. +* Sound amp pinout is reversed; mounted to the underside as a bodge fix (this is how I received it). +* Board is marked "TX-022" instead of "TP-022". A halfway point from the development code "GX-022" +*/ +ROM_START( dogyuunto ) + ROM_REGION( 0x080000, "maincpu", 0 ) + ROM_LOAD16_WORD_SWAP( "8-25.u11", 0x000000, 0x080000, CRC(4d3c952f) SHA1(194f3065c513238921047ead8b425c3d0538b9a7) ) // real hand-written label is '8/25' + + ROM_REGION( 0x08000, "audiocpu", 0 ) + ROM_LOAD( "u25", 0x00000, 0x08000, CRC(41a34a7e) SHA1(c4f7833249436fd064c7088c9776d12dee4a7d39) ) // only had a white label + + // the GP9001 mask ROMs were not dumped for this set, but the ROM codes match so they are believed identical + ROM_REGION( 0x200000, "gp9001_0", 0 ) + ROM_LOAD16_WORD_SWAP( "tp022_3.w92", 0x000000, 0x100000, CRC(191b595f) SHA1(89344946daa18087cc83f92027cf5da659b1c7a5) ) + ROM_LOAD16_WORD_SWAP( "tp022_4.w93", 0x100000, 0x100000, CRC(d58d29ca) SHA1(90d142fef37764ef817347a2bed77892a288a077) ) + + ROM_REGION( 0x400000, "gp9001_1", 0 ) + ROM_LOAD16_WORD_SWAP( "tp022_5.w16", 0x000000, 0x200000, CRC(d4c1db45) SHA1(f5655467149ba737128c2f54c9c6cdaca6e4c35c) ) + ROM_LOAD16_WORD_SWAP( "tp022_6.w17", 0x200000, 0x200000, CRC(d48dc74f) SHA1(081b5a00a2ff2bd82b98b30aab3cb5b6ae1014d5) ) + + // this may have some corruption (only 24, apparently random, bytes differ from the standard ROM), however preserve it for now until it has been verified. + ROM_REGION( 0x40000, "oki", 0 ) + ROM_LOAD( "2m.u29", 0x00000, 0x40000, CRC(5e7a77d8) SHA1(da6beb5e8e015965ff42fd52f5aa0c0ae5bcee4f) ) // '2M' hand-written +ROM_END + +} // anonymous namespace + +GAME( 1992, dogyuun, 0, dogyuun, dogyuun, dogyuun_state, empty_init, ROT270, "Toaplan", "Dogyuun", MACHINE_SUPPORTS_SAVE ) +GAME( 1992, dogyuuna, dogyuun, dogyuun, dogyuuna, dogyuun_state, empty_init, ROT270, "Toaplan", "Dogyuun (older set)", MACHINE_SUPPORTS_SAVE ) +GAME( 1992, dogyuunb, dogyuun, dogyuun, dogyuunt, dogyuun_state, empty_init, ROT270, "Toaplan", "Dogyuun (oldest set)", MACHINE_SUPPORTS_SAVE ) // maybe a newer location test version, instead +GAME( 1992, dogyuunt, dogyuun, dogyuun, dogyuunt, dogyuun_state, empty_init, ROT270, "Toaplan", "Dogyuun (10/9/1992 location test)", MACHINE_SUPPORTS_SAVE ) +GAME( 1992, dogyuunto, dogyuun, dogyuunto, dogyuunt, dogyuun_state, empty_init, ROT270, "Toaplan", "Dogyuun (8/25/1992 location test)", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/toaplan/dt7.cpp b/src/mame/toaplan/dt7.cpp new file mode 100644 index 00000000000..d4059dd20c9 --- /dev/null +++ b/src/mame/toaplan/dt7.cpp @@ -0,0 +1,561 @@ +// license:BSD-3-Clause +// copyright-holders:David Haywood + +/* This is derived from toaplan2.cpp, but there are enough hardware + differences to keep it separate + + TODO: + - verify audio CPU opcodes + - correctly hook up interrupts (especially V25) + - correctly hook up inputs (there's a steering wheel test? is the game switchable) + - serial comms (needs support in V25 core?) for linked units + - verify frequencies on chips + - verify alt titles, some regions have 'Car Fighting' as a subtitle, region comes from EEPROM? + - verify text layer palettes + - currently only coins up with service button + - course selection cursor doesn't move? + - sound dies after one stage? + - game crashes after two stages? +*/ + + +#include "emu.h" + +#include "toaplipt.h" +#include "toaplan_v25_tables.h" +#include "gp9001.h" + +#include "cpu/m68000/m68000.h" +#include "cpu/nec/v25.h" +#include "cpu/z80/z80.h" +#include "machine/eepromser.h" +#include "sound/okim6295.h" +#include "sound/ymopm.h" + +#include "emupal.h" +#include "screen.h" +#include "speaker.h" +#include "tilemap.h" + +namespace { + +class dt7_state : public driver_device +{ +public: + dt7_state(const machine_config &mconfig, device_type type, const char *tag) + : driver_device(mconfig, type, tag) + , m_maincpu(*this, "maincpu") + , m_subcpu(*this, "subcpu") + , m_audiocpu(*this, "audiocpu") + , m_vdp(*this, "gp9001_%u", 0U) + , m_oki(*this, "oki%u", 1U) + , m_eeprom(*this, "eeprom") + , m_gfxdecode(*this, "gfxdecode%u", 0U) + , m_screen(*this, "screen%u", 0U) + , m_palette(*this, "palette%u", 0U) + , m_shared_ram(*this, "shared_ram") + , m_tx_videoram(*this, "tx_videoram") + { } + +public: + void dt7(machine_config &config) ATTR_COLD; + +protected: + virtual void video_start() override ATTR_COLD; + +private: + void dt7_reset(int state); + + u32 screen_update_dt7_1(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + u32 screen_update_dt7_2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + + void tx_videoram_dt7_w(offs_t offset, u16 data, u16 mem_mask = ~0); + + TILE_GET_INFO_MEMBER(get_text_dt7_tile_info); + + void dt7_68k_0_mem(address_map &map); + void dt7_68k_1_mem(address_map &map); + void dt7_v25_mem(address_map &map); + void dt7_shared_mem(address_map &map); + + void dt7_irq(int state); + void dt7_unk_w(u8 data); + + uint8_t unmapped_v25_io1_r(); + uint8_t unmapped_v25_io2_r(); + + uint8_t read_port_t(); + uint8_t read_port_2(); + void write_port_2(uint8_t data); + + u8 dt7_shared_ram_hack_r(offs_t offset); + void shared_ram_w(offs_t offset, u8 data); + + void screen_vblank(int state); + + uint8_t m_ioport_state = 0x00; + + tilemap_t *m_tx_tilemap[2]; /* Tilemap for extra-text-layer */ + + bitmap_ind8 m_custom_priority_bitmap; + + required_device m_maincpu; + required_device m_subcpu; + required_device m_audiocpu; + required_device_array m_vdp; + required_device_array m_oki; + required_device m_eeprom; + required_device_array m_gfxdecode; + required_device_array m_screen; + required_device_array m_palette; + required_shared_ptr m_shared_ram; // 8 bit RAM shared between 68K and sound CPU + required_shared_ptr m_tx_videoram; +}; + + +void dt7_state::dt7_irq(int state) +{ + // only the first VDP gets IRQ acked, so does it trigger both CPUs, or does the main CPU then trigger sub? + m_maincpu->set_input_line(4, state ? ASSERT_LINE : CLEAR_LINE); + m_subcpu->set_input_line(4, state ? ASSERT_LINE : CLEAR_LINE); + + // this reads the inputs (again what is the source?) + // the audio CPU also has a 'serial' interrupt populated? + // and the boards can be linked together + + // triggering this prevents our other timer? interrupt from working however? + //m_audiocpu->set_input_line(NEC_INPUT_LINE_INTP0, state ? ASSERT_LINE : CLEAR_LINE); +} + + +// this is conditional on the unknown type of branch (see #define G_B0 in the table0 +uint8_t dt7_state::read_port_t() +{ + logerror("%s: read port t\n", machine().describe_context()); return machine().rand(); +} + +uint8_t dt7_state::read_port_2() +{ + logerror("%s: read port 2\n", machine().describe_context()); + + return 0xff; +} + +// it seems to attempt to read inputs (including the tilt switch?) here on startup +// strangely all the EEPROM access code (which is otherwise very similar to FixEight +// also has accesses to this port added, maybe something is sitting in the middle? +void dt7_state::write_port_2(uint8_t data) +{ + if ((m_ioport_state & 0x01) != (data & 0x01)) + { + if (data & 0x01) + logerror("%s: bit 0x01 low to high\n", machine().describe_context()); + else + logerror("%s: bit 0x01 high to low\n", machine().describe_context()); + } + + if ((m_ioport_state & 0x02) != (data & 0x02)) + { + if (data & 0x02) + logerror("%s: bit 0x02 low to high\n", machine().describe_context()); + else + logerror("%s: bit 0x02 high to low\n", machine().describe_context()); + } + + if ((m_ioport_state & 0x04) != (data & 0x04)) + { + if (data & 0x04) + logerror("%s: bit 0x04 low to high\n", machine().describe_context()); + else + logerror("%s: bit 0x04 high to low\n", machine().describe_context()); + } + + if ((m_ioport_state & 0x08) != (data & 0x08)) + { + if (data & 0x08) + logerror("%s: bit 0x08 low to high\n", machine().describe_context()); + else + logerror("%s: bit 0x08 high to low\n", machine().describe_context()); + } + + if ((m_ioport_state & 0x10) != (data & 0x10)) + { + if (data & 0x10) + logerror("%s: bit 0x10 low to high\n", machine().describe_context()); + else + logerror("%s: bit 0x10 high to low\n", machine().describe_context()); + } + + if ((m_ioport_state & 0x20) != (data & 0x20)) + { + if (data & 0x20) + logerror("%s: bit 0x20 low to high\n", machine().describe_context()); + else + logerror("%s: bit 0x20 high to low\n", machine().describe_context()); + } + + if ((m_ioport_state & 0x40) != (data & 0x40)) + { + if (data & 0x40) + logerror("%s: bit 0x40 low to high\n", machine().describe_context()); + else + logerror("%s: bit 0x40 high to low\n", machine().describe_context()); + } + + if ((m_ioport_state & 0x80) != (data & 0x80)) + { + if (data & 0x80) + logerror("%s: bit 0x80 low to high\n", machine().describe_context()); + else + logerror("%s: bit 0x80 high to low\n", machine().describe_context()); + } + + m_ioport_state = data; +} + + +// hacks because the sound CPU isn't running properly +u8 dt7_state::dt7_shared_ram_hack_r(offs_t offset) +{ + u16 ret = m_shared_ram[offset]; + + u32 addr = (offset * 2) + 0x610000; + + if (addr == 0x061f00c) + return ioport("SYS")->read();// machine().rand(); + + //return ret; + + + u32 pc = m_maincpu->pc(); + if (pc == 0x7d84) + return 0xff; + if (addr == 0x061d000) // settings (from EEPROM?) including flipscreen + return 0x00; + if (addr == 0x061d002) // settings (from EEPROM?) dipswitch? + return 0x00; + if (addr == 0x061d004) // settings (from EEPROM?) region + return 0xff; + if (addr == 0x061f004) + return ioport("IN1")->read(); ;// machine().rand(); // p1 inputs + if (addr == 0x061f006) + return ioport("IN2")->read();// machine().rand(); // P2 inputs +// logerror("%08x: dt7_shared_ram_hack_r address %08x ret %02x\n", pc, addr, ret); + return ret; +} + +void dt7_state::shared_ram_w(offs_t offset, u8 data) +{ + m_shared_ram[offset] = data; +} + + +void dt7_state::dt7_unk_w(u8 data) +{ + m_audiocpu->set_input_line(INPUT_LINE_RESET, (data & 0x80) ? CLEAR_LINE : ASSERT_LINE); +} + + +void dt7_state::dt7_68k_0_mem(address_map &map) +{ + map(0x000000, 0x07ffff).rom(); + map(0x100000, 0x10ffff).ram(); + + map(0x380000, 0x380001).r(m_vdp[0], FUNC(gp9001vdp_device::vdpcount_r)); + + map(0x200000, 0x200fff).ram().w(m_palette[0], FUNC(palette_device::write16)).share("palette0"); + map(0x280000, 0x280fff).ram().w(m_palette[1], FUNC(palette_device::write16)).share("palette1"); + + map(0x300000, 0x300000).w(FUNC(dt7_state::dt7_unk_w)); + + map(0x400000, 0x40000d).rw(m_vdp[0], FUNC(gp9001vdp_device::read), FUNC(gp9001vdp_device::write)); + map(0x480000, 0x48000d).rw(m_vdp[1], FUNC(gp9001vdp_device::read), FUNC(gp9001vdp_device::write)); + + dt7_shared_mem(map); + + map(0x610000, 0x61ffff).rw(FUNC(dt7_state::dt7_shared_ram_hack_r), FUNC(dt7_state::shared_ram_w)).umask16(0x00ff); +// map(0x620000, 0x62ffff).rw(FUNC(dt7_state::dt7_shared_ram_hack_r), FUNC(dt7_state::shared_ram_w)).umask16(0x00ff); +} + +void dt7_state::dt7_shared_mem(address_map &map) +{ + map(0x500000, 0x50ffff).ram().share("shared_ram2"); + // is this really in the middle of shared RAM, or is there a DMA to get it out? + map(0x509000, 0x50afff).ram().w(FUNC(dt7_state::tx_videoram_dt7_w)).share("tx_videoram"); + +} +void dt7_state::dt7_68k_1_mem(address_map &map) +{ + map(0x000000, 0x07ffff).rom().mirror(0x080000); // mirror needed or road doesn't draw + dt7_shared_mem(map); +} + + +uint8_t dt7_state::unmapped_v25_io1_r() +{ + logerror("%s: 0x58008 unknown read\n", machine().describe_context()); + return machine().rand(); +} + +uint8_t dt7_state::unmapped_v25_io2_r() +{ + logerror("%s: 0x5800a unknown read\n", machine().describe_context()); + return machine().rand(); +} + + +void dt7_state::dt7_v25_mem(address_map &map) +{ + // exact mirroring unknown, don't cover up where the inputs/sound maps + map(0x00000, 0x07fff).ram().share("shared_ram"); + map(0x20000, 0x27fff).ram().share("shared_ram"); + map(0x28000, 0x2ffff).ram().share("shared_ram"); + map(0x60000, 0x67fff).ram().share("shared_ram"); + map(0x68000, 0x6ffff).ram().share("shared_ram"); + map(0x70000, 0x77fff).ram().share("shared_ram"); + map(0xf8000, 0xfffff).ram().share("shared_ram"); + + map(0x58000, 0x58001).rw("ymsnd", FUNC(ym2151_device::read), FUNC(ym2151_device::write)); + map(0x58002, 0x58002).rw(m_oki[0], FUNC(okim6295_device::read), FUNC(okim6295_device::write)); + map(0x58004, 0x58005).rw("ymsnd2", FUNC(ym2151_device::read), FUNC(ym2151_device::write)); + map(0x58006, 0x58006).rw(m_oki[1], FUNC(okim6295_device::read), FUNC(okim6295_device::write)); + map(0x58008, 0x58008).r(FUNC(dt7_state::unmapped_v25_io1_r)); + map(0x5800a, 0x5800a).r(FUNC(dt7_state::unmapped_v25_io2_r)); +} + +void dt7_state::dt7_reset(int state) +{ + //if (m_audiocpu != nullptr) + // m_audiocpu->pulse_input_line(INPUT_LINE_RESET, attotime::zero); + + // needed when exiting service menu + m_subcpu->pulse_input_line(INPUT_LINE_RESET, attotime::zero); +} + +static GFXDECODE_START( gfx_textrom_double ) + GFXDECODE_ENTRY( "text_0", 0, gfx_8x8x4_packed_msb, 0, 128 ) +GFXDECODE_END + +static GFXDECODE_START( gfx_textrom_double_1 ) + GFXDECODE_ENTRY( "text_1", 0, gfx_8x8x4_packed_msb, 0, 128 ) +GFXDECODE_END + +void dt7_state::dt7(machine_config &config) +{ + /* basic machine hardware */ + M68000(config, m_maincpu, 32_MHz_XTAL/2); + m_maincpu->set_addrmap(AS_PROGRAM, &dt7_state::dt7_68k_0_mem); + m_maincpu->reset_cb().set(FUNC(dt7_state::dt7_reset)); + + M68000(config, m_subcpu, 32_MHz_XTAL/2); + m_subcpu->set_addrmap(AS_PROGRAM, &dt7_state::dt7_68k_1_mem); + + v25_device &audiocpu(V25(config, m_audiocpu, 32_MHz_XTAL/2)); + audiocpu.set_addrmap(AS_PROGRAM, &dt7_state::dt7_v25_mem); + audiocpu.set_decryption_table(toaplan_v25_tables::dt7_decryption_table); + audiocpu.pt_in_cb().set(FUNC(dt7_state::read_port_t)); + audiocpu.p2_in_cb().set(FUNC(dt7_state::read_port_2)); + audiocpu.p2_out_cb().set(FUNC(dt7_state::write_port_2)); + //audiocpu.p1_in_cb().set_ioport("EEPROM"); + //audiocpu.p1_out_cb().set_ioport("EEPROM"); + + // eeprom type confirmed, and gets inited after first boot, but then game won't boot again? + EEPROM_93C66_16BIT(config, m_eeprom); + + config.set_maximum_quantum(attotime::from_hz(6000)); + + /* video hardware */ + SCREEN(config, m_screen[0], SCREEN_TYPE_RASTER); + m_screen[0]->set_video_attributes(VIDEO_UPDATE_BEFORE_VBLANK); + m_screen[0]->set_raw(27_MHz_XTAL/4, 432, 0, 320, 262, 0, 240); + m_screen[0]->set_screen_update(FUNC(dt7_state::screen_update_dt7_1)); + m_screen[0]->screen_vblank().set(FUNC(dt7_state::screen_vblank)); + m_screen[0]->set_palette(m_palette[0]); + + SCREEN(config, m_screen[1], SCREEN_TYPE_RASTER); + m_screen[1]->set_video_attributes(VIDEO_UPDATE_BEFORE_VBLANK); + m_screen[1]->set_raw(27_MHz_XTAL/4, 432, 0, 320, 262, 0, 240); + m_screen[1]->set_screen_update(FUNC(dt7_state::screen_update_dt7_2)); + //m_screen[1]->screen_vblank().set(FUNC(dt7_state::screen_vblank)); + m_screen[1]->set_palette(m_palette[1]); + + PALETTE(config, m_palette[0]).set_format(palette_device::xBGR_555, gp9001vdp_device::VDP_PALETTE_LENGTH); + + PALETTE(config, m_palette[1]).set_format(palette_device::xBGR_555, gp9001vdp_device::VDP_PALETTE_LENGTH); + + GP9001_VDP(config, m_vdp[0], 27_MHz_XTAL); + m_vdp[0]->set_palette(m_palette[0]); + m_vdp[0]->vint_out_cb().set(FUNC(dt7_state::dt7_irq)); + m_vdp[0]->set_screen(m_screen[0]); + + GP9001_VDP(config, m_vdp[1], 27_MHz_XTAL); + m_vdp[1]->set_palette(m_palette[1]); + m_vdp[1]->set_screen(m_screen[1]); + + GFXDECODE(config, m_gfxdecode[0], m_palette[0], gfx_textrom_double); + + GFXDECODE(config, m_gfxdecode[1], m_palette[1], gfx_textrom_double_1); + + /* sound hardware */ + SPEAKER(config, "lspeaker").front_left(); + SPEAKER(config, "rspeaker").front_right(); + + YM2151(config, "ymsnd", 27_MHz_XTAL/8).add_route(ALL_OUTPUTS, "lspeaker", 0.5); + + OKIM6295(config, m_oki[0], 27_MHz_XTAL / 24, okim6295_device::PIN7_HIGH); + m_oki[0]->add_route(ALL_OUTPUTS, "lspeaker", 0.5); + + YM2151(config, "ymsnd2", 27_MHz_XTAL/8).add_route(ALL_OUTPUTS, "rspeaker", 0.5); + + OKIM6295(config, m_oki[1], 27_MHz_XTAL/24, okim6295_device::PIN7_HIGH); + m_oki[1]->add_route(ALL_OUTPUTS, "rspeaker", 0.5); +} + + +static INPUT_PORTS_START( dt7 ) + PORT_START("IN1") + TOAPLAN_JOY_UDLR_3_BUTTONS( 1 ) + + PORT_START("IN2") + TOAPLAN_JOY_UDLR_3_BUTTONS( 2 ) + + PORT_START("SYS") + PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_SERVICE1 ) + PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_TILT ) + TOAPLAN_TEST_SWITCH( 0x04, IP_ACTIVE_HIGH ) + PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_COIN1 ) + PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_COIN2 ) + PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_START1 ) + PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_START2 ) + PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_UNKNOWN ) + + PORT_START("EEPROM") + PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", FUNC(eeprom_serial_93cxx_device::cs_write)) + PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", FUNC(eeprom_serial_93cxx_device::clk_write)) + PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", FUNC(eeprom_serial_93cxx_device::di_write)) + PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", FUNC(eeprom_serial_93cxx_device::do_read)) +INPUT_PORTS_END + +TILE_GET_INFO_MEMBER(dt7_state::get_text_dt7_tile_info) +{ + const u16 attrib = m_tx_videoram[tile_index]; + const u32 tile_number = attrib & 0x3ff; + + u32 color = (attrib & 0xf800) >> 11; + + color |= 0x60; + + tileinfo.set(0, + tile_number, + color, + 0); +} + +void dt7_state::video_start() +{ + /* our current VDP implementation needs this bitmap to work with */ + m_screen[0]->register_screen_bitmap(m_custom_priority_bitmap); + m_vdp[0]->custom_priority_bitmap = &m_custom_priority_bitmap; + m_vdp[1]->custom_priority_bitmap = &m_custom_priority_bitmap; + + // a different part of this tilemap is displayed on each screen + // each screen has a different palette and uses a ROM in a different location on the PCB + m_tx_tilemap[0] = &machine().tilemap().create(*m_gfxdecode[0], tilemap_get_info_delegate(*this, FUNC(dt7_state::get_text_dt7_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 64, 64); + m_tx_tilemap[1] = &machine().tilemap().create(*m_gfxdecode[1], tilemap_get_info_delegate(*this, FUNC(dt7_state::get_text_dt7_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 64, 64); + + m_tx_tilemap[0]->set_transparent_pen(0); + m_tx_tilemap[1]->set_transparent_pen(0); +} + +void dt7_state::tx_videoram_dt7_w(offs_t offset, u16 data, u16 mem_mask) +{ + COMBINE_DATA(&m_tx_videoram[offset]); + if (offset < 64 * 64) + { + m_tx_tilemap[0]->mark_tile_dirty(offset); + m_tx_tilemap[1]->mark_tile_dirty(offset); + } +} + +u32 dt7_state::screen_update_dt7_1(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + bitmap.fill(0, cliprect); + m_custom_priority_bitmap.fill(0, cliprect); + m_vdp[0]->render_vdp(bitmap, cliprect); + + m_tx_tilemap[0]->set_scrolldy(0, 0); + m_tx_tilemap[0]->draw(screen, bitmap, cliprect, 0); + + return 0; +} + +u32 dt7_state::screen_update_dt7_2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + bitmap.fill(0, cliprect); + m_custom_priority_bitmap.fill(0, cliprect); + m_vdp[1]->render_vdp(bitmap, cliprect); + + m_tx_tilemap[1]->set_scrolldy(256 + 16, 256 + 16); + m_tx_tilemap[1]->draw(screen, bitmap, cliprect, 0); + + return 0; +} + +void dt7_state::screen_vblank(int state) +{ + m_vdp[0]->screen_eof(); + m_vdp[1]->screen_eof(); +} + + + +ROM_START( dt7 ) + ROM_REGION( 0x080000, "maincpu", 0 ) /* Main 68K code */ + ROM_LOAD16_WORD_SWAP( "main.11", 0x000000, 0x080000, CRC(01646c22) SHA1(4b87f00dc99e1206b3b9eaee425fc05e1a033bee) ) + + ROM_REGION( 0x080000, "subcpu", 0 ) /* Main 68K code */ + ROM_LOAD16_WORD_SWAP( "2.21", 0x000000, 0x080000, CRC(a08e25ed) SHA1(db10c64ce305477442b35e7624052aae9fb6e412) ) + + /* Secondary CPU is a Toaplan marked chip, (TS-007-Spy TOA PLAN) */ + /* It's a NEC V25 (PLCC94) (encrypted program uploaded by main CPU) */ + /* Note, same markings as other games found in toaplan2.cpp, but table is different! */ + + ROM_REGION( 0x400000, "gp9001_0", 0 ) + ROM_LOAD( "3a.49", 0x000000, 0x080000, CRC(ba8e378c) SHA1(d5eb4a839d6b3c2b9bf0bd87f06859a01a2c0cbf) ) + ROM_LOAD( "3b.50", 0x080000, 0x080000, CRC(a9e4c6c7) SHA1(4058b1b887f41494a70b0b09e581ef5e3a444a1c) ) + ROM_LOAD( "3c.51", 0x100000, 0x080000, CRC(ffc6fa95) SHA1(87d18520fae7eec9336fc8cfb1adc2923ea10f8d) ) + ROM_LOAD( "3d.52", 0x180000, 0x080000, CRC(3faaa3e7) SHA1(ec3e6e8d16a8095c857ff270d2bd48c04664b62f) ) + ROM_LOAD( "4a.30", 0x200000, 0x080000, CRC(53627ea6) SHA1(02f9cc223427a2b78e60bc866fd6c73df07b438d) ) + ROM_LOAD( "4b.31", 0x280000, 0x080000, CRC(a7e20eb4) SHA1(73da86764a93350224ada21b3178dde0a34cc657) ) + ROM_LOAD( "4c.32", 0x300000, 0x080000, CRC(ad0fc76a) SHA1(112e934a2cab13f994d1873aaaec40d38d2c2deb) ) + ROM_LOAD( "4d.33", 0x380000, 0x080000, CRC(280f97af) SHA1(9fe74c67440d7c952f091fb77905b7515852e0fb) ) + + ROM_REGION( 0x08000, "text_0", 0 ) + ROM_LOAD( "7text.115", 0x000000, 0x08000, CRC(7fb47a44) SHA1(1b5401967f33dc232187bf9f2a402b71286c5fc2) ) + // some dumps contain an empty '1M' ROM located next to each 'text' ROM on the PCB? + + ROM_REGION( 0x400000, "gp9001_1", 0 ) + ROM_LOAD( "3a.68", 0x000000, 0x080000, CRC(ba8e378c) SHA1(d5eb4a839d6b3c2b9bf0bd87f06859a01a2c0cbf) ) + ROM_LOAD( "3b.69", 0x080000, 0x080000, CRC(a9e4c6c7) SHA1(4058b1b887f41494a70b0b09e581ef5e3a444a1c) ) + ROM_LOAD( "3c.70", 0x100000, 0x080000, CRC(ffc6fa95) SHA1(87d18520fae7eec9336fc8cfb1adc2923ea10f8d) ) + ROM_LOAD( "3d.71", 0x180000, 0x080000, CRC(3faaa3e7) SHA1(ec3e6e8d16a8095c857ff270d2bd48c04664b62f) ) + ROM_LOAD( "4a.87", 0x200000, 0x080000, CRC(53627ea6) SHA1(02f9cc223427a2b78e60bc866fd6c73df07b438d) ) + ROM_LOAD( "4b.88", 0x280000, 0x080000, CRC(a7e20eb4) SHA1(73da86764a93350224ada21b3178dde0a34cc657) ) + ROM_LOAD( "4c.89", 0x300000, 0x080000, CRC(ad0fc76a) SHA1(112e934a2cab13f994d1873aaaec40d38d2c2deb) ) + ROM_LOAD( "4d.90", 0x380000, 0x080000, CRC(280f97af) SHA1(9fe74c67440d7c952f091fb77905b7515852e0fb) ) + + ROM_REGION( 0x08000, "text_1", 0 ) + ROM_LOAD( "7text.152", 0x000000, 0x08000, CRC(7fb47a44) SHA1(1b5401967f33dc232187bf9f2a402b71286c5fc2) ) + // some dumps contain an empty '1M' ROM located next to each 'text' ROM on the PCB? + + ROM_REGION( 0x40000, "oki1", 0 ) /* ADPCM Samples */ + ROM_LOAD( "7adpcm.37", 0x00000, 0x40000, CRC(aefce555) SHA1(0d47190287957122fefdae17ccf6bcfaef8cd430) ) + + ROM_REGION( 0x40000, "oki2", 0 ) /* ADPCM Samples */ + ROM_LOAD( "7adpcm.43", 0x00000, 0x40000, CRC(aefce555) SHA1(0d47190287957122fefdae17ccf6bcfaef8cd430) ) +ROM_END + +} // anonymous namespace + +// The region comes from the EEPROM? so will need clones like FixEight +GAME( 1993, dt7, 0, dt7, dt7, dt7_state,empty_init, ROT270, "Toaplan", "DT7 (prototype)", MACHINE_NOT_WORKING ) diff --git a/src/mame/toaplan/enmadaio.cpp b/src/mame/toaplan/enmadaio.cpp new file mode 100644 index 00000000000..e9c27126e1b --- /dev/null +++ b/src/mame/toaplan/enmadaio.cpp @@ -0,0 +1,409 @@ +// license:BSD-3-Clause +// copyright-holders:David Haywood + +#include "emu.h" + +#include "gp9001.h" +#include "toaplipt.h" + +#include "cpu/m68000/m68000.h" +#include "sound/okim6295.h" +#include "sound/ymopm.h" + +#include "emupal.h" +#include "screen.h" +#include "speaker.h" +#include "tilemap.h" + +/* +Name Board No Maker Game name +---------------------------------------------------------------------------- +enmadaio TP-031 Toaplan Enma Daio +*/ + +namespace { + +class enmadaio_state : public driver_device +{ +public: + enmadaio_state(const machine_config &mconfig, device_type type, const char *tag) + : driver_device(mconfig, type, tag) + , m_maincpu(*this, "maincpu") + , m_vdp(*this, "gp9001") + , m_oki(*this, "oki") + , m_screen(*this, "screen") + , m_palette(*this, "palette") + , m_okibank(*this, "okibank") + { } + + void enmadaio(machine_config &config) ATTR_COLD; + + void init_enmadaio() ATTR_COLD; + +protected: + virtual void video_start() override ATTR_COLD; + +private: + + void enmadaio_oki_bank_w(offs_t offset, u16 data, u16 mem_mask = ~0); + void enmadaio_68k_mem(address_map &map) ATTR_COLD; + void enmadaio_oki(address_map &map) ATTR_COLD; + + u32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + void screen_vblank(int state); + + required_device m_maincpu; + required_device m_vdp; + required_device m_oki; + required_device m_screen; + required_device m_palette; + required_memory_bank m_okibank; + bitmap_ind8 m_custom_priority_bitmap; +}; + +void enmadaio_state::video_start() +{ + m_screen->register_screen_bitmap(m_custom_priority_bitmap); + m_vdp->custom_priority_bitmap = &m_custom_priority_bitmap; +} + +u32 enmadaio_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + bitmap.fill(0, cliprect); + m_custom_priority_bitmap.fill(0, cliprect); + m_vdp->render_vdp(bitmap, cliprect); + return 0; +} + +void enmadaio_state::screen_vblank(int state) +{ + if (state) // rising edge + { + m_vdp->screen_eof(); + } +} + +static INPUT_PORTS_START( enmadaio ) + PORT_START("SYS") + PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_SERVICE1 ) + PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_TILT ) + TOAPLAN_TEST_SWITCH( 0x04, IP_ACTIVE_HIGH ) + PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_COIN1 ) + PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_COIN2 ) + PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_START1 ) + PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_START2 ) + PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_UNKNOWN ) + + PORT_START("DSWA") + PORT_DIPNAME( 0x0001, 0x0000, "Game Mode" ) + PORT_DIPSETTING( 0x0000, "Normal Game" ) + PORT_DIPSETTING( 0x0001, "Stop and Slow Mode" ) + PORT_DIPNAME( 0x0002, 0x0000, DEF_STR( Flip_Screen ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0002, DEF_STR( On ) ) + PORT_DIPNAME( 0x0004, 0x0000, DEF_STR( Unknown ) ) // unused + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0004, DEF_STR( On ) ) + PORT_DIPNAME( 0x0008, 0x0000, DEF_STR( Demo_Sounds ) ) + PORT_DIPSETTING( 0x0008, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0030, 0x0030, DEF_STR( Coin_A ) ) + PORT_DIPSETTING( 0x0030, DEF_STR( 1C_1C ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( 2C_1C ) ) + PORT_DIPSETTING( 0x0010, DEF_STR( 3C_1C ) ) + PORT_DIPSETTING( 0x0020, DEF_STR( 4C_1C ) ) + PORT_DIPNAME( 0x0040, 0x0000, DEF_STR( Unknown ) ) // unused + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0040, DEF_STR( On ) ) + PORT_DIPNAME( 0x0080, 0x0000, DEF_STR( Unknown ) ) // unused + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0080, DEF_STR( On ) ) + + PORT_START("MISC2") // should be DSWB? but not even read in test mode display? + PORT_DIPNAME( 0x0001, 0x0001, "2" ) + PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0002, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0008, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0020, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0200, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0400, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0800, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x1000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x4000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x8000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + + PORT_START("MISC3") + PORT_DIPNAME( 0x0001, 0x0001, "3" ) + PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0002, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0008, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("yes") + PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("no") + PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0200, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0400, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0800, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x1000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x4000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x8000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + + PORT_START("MISC4") + PORT_DIPNAME( 0x0001, 0x0001, "4" ) + PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0002, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0004, 0x0000, "Status of Something 1" ) // gives error in attract mode otherwise + PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0008, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0020, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0040, 0x0000, "Status of Something 2" ) // turn this off and it comes up with an error + PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0200, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0400, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0800, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x1000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x4000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x8000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + + PORT_START("UNK") + PORT_BIT( 0xff, 0x00, IPT_DIAL ) PORT_SENSITIVITY(30) PORT_KEYDELTA(15) // this is the sensor, not sure what it measures, pulse / heartbeat? + PORT_DIPNAME( 0x0100, 0x0100, "Freeze" ) // not sure + PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0200, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0400, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0800, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x1000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x4000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x8000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + +INPUT_PORTS_END + + +void enmadaio_state::enmadaio_oki_bank_w(offs_t offset, u16 data, u16 mem_mask) +{ + data &= mem_mask; + + if (data < 0x60) + { + m_okibank->set_entry(data); + } + else + { + logerror("enmadaio_oki_bank_w >=0x60 (%04x)\n",data); + } +} + +void enmadaio_state::enmadaio_68k_mem(address_map &map) +{ + map(0x000000, 0x07ffff).rom(); + map(0x100000, 0x103fff).ram(); //.share("nvram"); + map(0x104000, 0x10ffff).ram(); + + map(0x200000, 0x20000d).rw(m_vdp, FUNC(gp9001vdp_device::read), FUNC(gp9001vdp_device::write)); + map(0x300000, 0x300fff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); + map(0x400000, 0x400003).rw("ymsnd", FUNC(ym2151_device::read), FUNC(ym2151_device::write)).umask16(0x00ff); + map(0x500001, 0x500001).rw(m_oki, FUNC(okim6295_device::read), FUNC(okim6295_device::write)); + + map(0x700000, 0x700001).r(m_vdp, FUNC(gp9001vdp_device::vdpcount_r)); + + map(0x700004, 0x700005).portr("DSWA"); + map(0x70000c, 0x70000d).portr("MISC2"); + map(0x700010, 0x700011).portr("MISC3"); + map(0x700014, 0x700015).portr("MISC4"); + map(0x700018, 0x700019).portr("SYS"); + map(0x70001c, 0x70001d).portr("UNK"); //.portr("SYS"); + + map(0x700020, 0x700021).w(FUNC(enmadaio_state::enmadaio_oki_bank_w)); // oki bank + + map(0x700028, 0x700029).nopw(); + map(0x70003c, 0x70003d).nopw(); + map(0x70002c, 0x70002d).nopw(); +} + +void enmadaio_state::enmadaio_oki(address_map &map) +{ + map(0x00000, 0x3ffff).bankr(m_okibank); +} + + +void enmadaio_state::enmadaio(machine_config &config) +{ + /* basic machine hardware */ + M68000(config, m_maincpu, 20_MHz_XTAL/2); + m_maincpu->set_addrmap(AS_PROGRAM, &enmadaio_state::enmadaio_68k_mem); + + /* video hardware */ + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_video_attributes(VIDEO_UPDATE_BEFORE_VBLANK); + m_screen->set_raw(27_MHz_XTAL/4, 432, 0, 320, 262, 0, 240); + m_screen->set_screen_update(FUNC(enmadaio_state::screen_update)); + m_screen->screen_vblank().set(FUNC(enmadaio_state::screen_vblank)); + m_screen->set_palette(m_palette); + + PALETTE(config, m_palette).set_format(palette_device::xBGR_555, gp9001vdp_device::VDP_PALETTE_LENGTH); + + GP9001_VDP(config, m_vdp, 27_MHz_XTAL); + m_vdp->set_palette(m_palette); + m_vdp->vint_out_cb().set_inputline(m_maincpu, M68K_IRQ_4); + + /* sound hardware */ + SPEAKER(config, "mono").front_center(); + + YM2151(config, "ymsnd", 27_MHz_XTAL/8).add_route(ALL_OUTPUTS, "mono", 0.5); + + OKIM6295(config, m_oki, 16_MHz_XTAL/4, okim6295_device::PIN7_LOW); // pin7 not confirmed + m_oki->set_addrmap(0, &enmadaio_state::enmadaio_oki); + m_oki->add_route(ALL_OUTPUTS, "mono", 0.5); +} + +void enmadaio_state::init_enmadaio() +{ + u8 *ROM = memregion("oki")->base(); + + m_okibank->configure_entries(0, 0x60, ROM, 0x40000); + m_okibank->set_entry(0); +} + + +ROM_START( enmadaio ) + ROM_REGION( 0x080000, "maincpu", 0 ) + ROM_LOAD16_WORD_SWAP( "03n_u53.c8", 0x00000, 0x80000, CRC(1a6ca2ee) SHA1(13d34a10004ca172db7953e2be8daa90fc5b62ed) ) + + ROM_REGION( 0x200000, "gp9001", 0 ) + ROM_LOAD( "rom4_u30.c19", 0x000000, 0x100000, CRC(7a012d8b) SHA1(a33d9490573a9fd1e799d3fe567f991926851c51) ) + ROM_LOAD( "rom5_u31.c18", 0x100000, 0x100000, CRC(60b127ab) SHA1(98785dfd6a86b4bd2c9786f6f72796c023b5b73a) ) + + ROM_REGION( 0x1800000, "oki", 0 ) /* OKIM6295 samples */ // each rom contains 8 0x40000 banks, there are 12 roms, so 96 (0x60) banks here! + ROM_LOAD( "rom6_u65.a1", 0x0000000, 0x0200000, CRC(f33c6c0b) SHA1(06d73cd5b6d27de4d68f2dde1ed4dfa72b9a9178) ) + ROM_LOAD( "rom7_u66.a3", 0x0200000, 0x0200000, CRC(1306f8b3) SHA1(21b0d3180f1f4af77074c35c66844e38a464fea0) ) + ROM_LOAD( "rom8_u61.a4", 0x0400000, 0x0200000, CRC(4f211c00) SHA1(b067de95ad595a4915effefb83789e4e3d9db6f9) ) + ROM_LOAD( "rom9_u62.a6", 0x0600000, 0x0200000, CRC(292d3ef6) SHA1(d027d4c64e57f46e444ee83b62f6c3bdf02e4eed) ) + ROM_LOAD( "rom10_u67.a8", 0x0800000, 0x0200000, CRC(5219bf86) SHA1(946c8fcf3c04a88517d1a66ccd56609d22da945f) ) + ROM_LOAD( "rom11_u68.a10", 0x0a00000, 0x0200000, CRC(56fe4b1d) SHA1(2ea0413b435dd178174eb66d38dc9f7ab3d07ba5) ) + ROM_LOAD( "rom12_u63.a11", 0x0c00000, 0x0200000, CRC(cc48ff18) SHA1(10f6d9f445c9244b797846450f0c94700ccc7367) ) + ROM_LOAD( "rom13_u64.a13", 0x0e00000, 0x0200000, CRC(a3cd181a) SHA1(6a87479c24a61f7ac940e9c9bb62a18f26c9c843) ) + ROM_LOAD( "rom14_u69.a14", 0x1000000, 0x0200000, CRC(5d8cddec) SHA1(1912850d065d4ce1a1cdfd5a704218e660b5345b) ) + ROM_LOAD( "rom15_u70.a16", 0x1200000, 0x0200000, CRC(c75012f5) SHA1(b1ba0abab3eb8e9e3778eecab4951d828c85cecb) ) + ROM_LOAD( "rom16_u71.a18", 0x1400000, 0x0200000, CRC(efd02b0d) SHA1(b23fa3298fc29086f9ab05bc58775ff47b4cb7a9) ) + ROM_LOAD( "rom17_u72.a19", 0x1600000, 0x0200000, CRC(6b8717c3) SHA1(b5b7e35deaa2f34bccd1e83844d4bc0be845d0b8) ) +ROM_END + +} // anonymous namespace + +GAME( 1993, enmadaio, 0, enmadaio, enmadaio, enmadaio_state, init_enmadaio, ROT0, "Toaplan / Taito", "Enma Daio (Japan)", 0 ) // TP-031 diff --git a/src/mame/toaplan/fixeight.cpp b/src/mame/toaplan/fixeight.cpp new file mode 100644 index 00000000000..05968850754 --- /dev/null +++ b/src/mame/toaplan/fixeight.cpp @@ -0,0 +1,782 @@ +// license:BSD-3-Clause +// copyright-holders:Quench, Yochizo, David Haywood + +#include "emu.h" + +#include "gp9001.h" +#include "toaplan_coincounter.h" +#include "toaplan_v25_tables.h" +#include "toaplipt.h" + +#include "cpu/m68000/m68000.h" +#include "cpu/nec/v25.h" +#include "cpu/z80/z80.h" +#include "machine/eepromser.h" +#include "sound/okim6295.h" +#include "sound/ymopm.h" + +#include "emupal.h" +#include "screen.h" +#include "speaker.h" +#include "tilemap.h" + +/* +Name Board No Maker Game name +---------------------------------------------------------------------------- +fixeight TP-026 Toaplan FixEight +fixeightbl bootleg Toaplan FixEight + + +fixeight - The same program is used for all regions, and the region can be changed just by swapping + EEPROMs. However, the V25 code also recognizes a secret input that rewrites the EEPROM to + use any one of the 14 recognized regional licenses, using the state of the player 1 and + player 2 button inputs held in conjunction with it as a 4-bit binary code: + + Region Button input + ------------------------ ------------------------------------ + Korea, Taito license No buttons + Korea P1 button 1 + Hong Kong, Taito license P1 button 2 + Hong Kong P1 buttons 1 & 2 + Taiwan, Taito license P2 button 1 + Taiwan P1 button 1 + P2 button 1 + SE Asia, Taito license P1 button 2 + P2 button 1 + Southeast Asia P1 buttons 1 & 2 + P2 button 1 + Europe, Taito license P2 button 2 + Europe P1 button 1 + P2 button 2 + USA, Taito license P1 button 2 + P2 button 2 + USA P1 buttons 1 & 2 + P2 button 2 + (Invalid) P2 buttons 1 & 2 + (Invalid) P1 button 1 + P2 buttons 1 & 2 + Japan P1 button 2 + P2 buttons 1 & 2 + Japan, Taito license P1 buttons 1 & 2 + P2 buttons 1 & 2 + +To Do / Unknowns: + - Priority problem on 2nd player side of selection screen in Fixeight bootleg. + - Fixeight bootleg text in sound check mode does not display properly + with the CPU set to 10MHz (ok at 16MHz). Possible error in video_count_r routine. +*/ + +namespace { + +class fixeight_state : public driver_device +{ +public: + fixeight_state(const machine_config &mconfig, device_type type, const char *tag) + : driver_device(mconfig, type, tag) + , m_tx_videoram(*this, "tx_videoram") + , m_tx_lineselect(*this, "tx_lineselect") + , m_tx_linescroll(*this, "tx_linescroll") + , m_tx_gfxram(*this, "tx_gfxram") + , m_shared_ram(*this, "shared_ram") + , m_maincpu(*this, "maincpu") + , m_audiocpu(*this, "audiocpu") + , m_vdp(*this, "gp9001") + , m_oki(*this, "oki") + , m_eeprom(*this, "eeprom") + , m_gfxdecode(*this, "gfxdecode") + , m_screen(*this, "screen") + , m_palette(*this, "palette") + { } + + void fixeight(machine_config &config) ATTR_COLD; + void init_fixeight() ATTR_COLD; + +protected: + virtual void machine_reset() override ATTR_COLD; + virtual void video_start() override ATTR_COLD; + + virtual void device_post_load() override ATTR_COLD; + + void fixeight_68k_mem(address_map &map) ATTR_COLD; + void fixeight_v25_mem(address_map &map) ATTR_COLD; + + void create_tx_tilemap(int dx = 0, int dx_flipped = 0) ATTR_COLD; + + u32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + void screen_vblank(int state); + void tx_gfxram_w(offs_t offset, u16 data, u16 mem_mask = ~0); + + u8 shared_ram_r(offs_t offset) { return m_shared_ram[offset]; } + void shared_ram_w(offs_t offset, u8 data) { m_shared_ram[offset] = data; } + + void tx_videoram_w(offs_t offset, u16 data, u16 mem_mask = ~0); + void tx_linescroll_w(offs_t offset, u16 data, u16 mem_mask = ~0); + TILE_GET_INFO_MEMBER(get_text_tile_info); + + void sound_reset_w(u8 data); + tilemap_t *m_tx_tilemap = nullptr; /* Tilemap for extra-text-layer */ + required_shared_ptr m_tx_videoram; + optional_shared_ptr m_tx_lineselect; // originals only + optional_shared_ptr m_tx_linescroll; // originals only + optional_shared_ptr m_tx_gfxram; // originals only + void reset_audiocpu(int state); + + optional_shared_ptr m_shared_ram; // originals only - 8 bit RAM shared between 68K and sound CPU + + required_device m_maincpu; + optional_device m_audiocpu; // originals only + required_device m_vdp; + required_device m_oki; + optional_device m_eeprom; // originals only + required_device m_gfxdecode; + required_device m_screen; + required_device m_palette; + bitmap_ind8 m_custom_priority_bitmap; +}; + +class fixeight_bootleg_state : public fixeight_state +{ +public: + fixeight_bootleg_state(const machine_config &mconfig, device_type type, const char *tag) + : fixeight_state(mconfig, type, tag) + , m_okibank(*this, "okibank") + { } + + void fixeightbl(machine_config &config) ATTR_COLD; + + void init_fixeightbl() ATTR_COLD; + +protected: + virtual void video_start() override ATTR_COLD; + + void fixeightbl_68k_mem(address_map &map) ATTR_COLD; + void cpu_space_fixeightbl_map(address_map &map) ATTR_COLD; + + void fixeightbl_oki(address_map &map) ATTR_COLD; + + void fixeightbl_oki_bankswitch_w(u8 data); + + u32 screen_update_bootleg(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + + optional_memory_bank m_okibank; +}; + + +void fixeight_state::machine_reset() +{ + if (m_audiocpu) + sound_reset_w(0); +} + +void fixeight_state::reset_audiocpu(int state) +{ + if (state) + sound_reset_w(0); +} + + +TILE_GET_INFO_MEMBER(fixeight_state::get_text_tile_info) +{ + const u16 attrib = m_tx_videoram[tile_index]; + const u32 tile_number = attrib & 0x3ff; + const u32 color = attrib >> 10; + tileinfo.set(0, + tile_number, + color, + 0); +} + +void fixeight_state::tx_videoram_w(offs_t offset, u16 data, u16 mem_mask) +{ + COMBINE_DATA(&m_tx_videoram[offset]); + if (offset < 64*32) + m_tx_tilemap->mark_tile_dirty(offset); +} + +void fixeight_state::tx_linescroll_w(offs_t offset, u16 data, u16 mem_mask) +{ + /*** Line-Scroll RAM for Text Layer ***/ + COMBINE_DATA(&m_tx_linescroll[offset]); + + m_tx_tilemap->set_scrollx(offset, m_tx_linescroll[offset]); +} + +void fixeight_state::screen_vblank(int state) +{ + // rising edge + if (state) + { + m_vdp->screen_eof(); + } +} + + +void fixeight_state::create_tx_tilemap(int dx, int dx_flipped) +{ + m_tx_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(fixeight_state::get_text_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); + + m_tx_tilemap->set_scroll_rows(8*32); /* line scrolling */ + m_tx_tilemap->set_scroll_cols(1); + m_tx_tilemap->set_scrolldx(dx, dx_flipped); + m_tx_tilemap->set_transparent_pen(0); +} + +u32 fixeight_bootleg_state::screen_update_bootleg(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + bitmap.fill(0, cliprect); + m_custom_priority_bitmap.fill(0, cliprect); + m_vdp->render_vdp(bitmap, cliprect); + m_tx_tilemap->draw(screen, bitmap, cliprect, 0); + return 0; +} + +void fixeight_bootleg_state::video_start() +{ + m_screen->register_screen_bitmap(m_custom_priority_bitmap); + m_vdp->custom_priority_bitmap = &m_custom_priority_bitmap; + + create_tx_tilemap(); + + /* This bootleg has additional layer offsets on the VDP */ + m_vdp->set_tm_extra_offsets(0, -0x1d6 - 26, -0x1ef - 15, 0, 0); + m_vdp->set_tm_extra_offsets(1, -0x1d8 - 22, -0x1ef - 15, 0, 0); + m_vdp->set_tm_extra_offsets(2, -0x1da - 18, -0x1ef - 15, 0, 0); + m_vdp->set_sp_extra_offsets(8/*-0x1cc - 64*/, 8/*-0x1ef - 128*/, 0, 0); + + m_vdp->init_scroll_regs(); +} + + +void fixeight_state::video_start() +{ + m_screen->register_screen_bitmap(m_custom_priority_bitmap); + m_vdp->custom_priority_bitmap = &m_custom_priority_bitmap; + + m_gfxdecode->gfx(0)->set_source(reinterpret_cast(m_tx_gfxram.target())); + create_tx_tilemap(0x1d5, 0x16a); +} + + +u32 fixeight_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + bitmap.fill(0, cliprect); + m_custom_priority_bitmap.fill(0, cliprect); + m_vdp->render_vdp(bitmap, cliprect); + + rectangle clip = cliprect; + + /* it seems likely that flipx can be set per line! */ + /* however, none of the games does it, and emulating it in the */ + /* MAME tilemap system without being ultra slow would be tricky */ + m_tx_tilemap->set_flip(m_tx_lineselect[0] & 0x8000 ? 0 : TILEMAP_FLIPX); + + /* line select is used for 'for use in' and '8ing' screen on bbakraid, 'Raizing' logo on batrider */ + for (int y = cliprect.min_y; y <= cliprect.max_y; y++) + { + clip.min_y = clip.max_y = y; + m_tx_tilemap->set_scrolly(0, m_tx_lineselect[y] - y); + m_tx_tilemap->draw(screen, bitmap, clip, 0); + } + return 0; +} + +void fixeight_state::tx_gfxram_w(offs_t offset, u16 data, u16 mem_mask) +{ + /*** Dynamic GFX decoding for Truxton 2 / FixEight ***/ + + const u16 oldword = m_tx_gfxram[offset]; + + if (oldword != data) + { + COMBINE_DATA(&m_tx_gfxram[offset]); + m_gfxdecode->gfx(0)->mark_dirty(offset/32); + } +} + +void fixeight_state::device_post_load() +{ + if (m_tx_gfxram != nullptr) + m_gfxdecode->gfx(0)->mark_all_dirty(); +} + + +static INPUT_PORTS_START( fixeight ) + // The Suicide buttons are technically P1 and P2 Button 3, but we hook + // them up as IPT_OTHER so each player has the same number of buttons. + PORT_START("IN1") + PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(1) PORT_8WAY + PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1) PORT_8WAY + PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1) PORT_8WAY + PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1) PORT_8WAY + PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(1) + PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(1) + PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P1 Suicide (Cheat)") + PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_UNKNOWN ) + PORT_BIT( 0xff00, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // Unknown/Unused + + PORT_START("IN2") + PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(2) PORT_8WAY + PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2) PORT_8WAY + PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2) PORT_8WAY + PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2) PORT_8WAY + PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2) + PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(2) + PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P2 Suicide (Cheat)") + PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_UNKNOWN ) + PORT_BIT( 0xff00, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // Unknown/Unused + + PORT_START("IN3") + PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(3) PORT_8WAY + PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(3) PORT_8WAY + PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(3) PORT_8WAY + PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(3) PORT_8WAY + PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(3) + PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(3) + PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_START3 ) + PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_MEMORY_RESET ) PORT_NAME("Region Reset") + PORT_BIT( 0xff00, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // Unknown/Unused + + PORT_START("SYS") + PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_COIN3 ) + PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_TILT ) + PORT_SERVICE_NO_TOGGLE(0x0004, IP_ACTIVE_HIGH) // Service input is a pushbutton marked 'Test SW' + PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_COIN1 ) + PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_COIN2 ) + PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_START1 ) + PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_START2 ) + PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_UNKNOWN ) + PORT_BIT( 0xff00, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // Unknown/Unused + + PORT_START("EEPROM") + PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", FUNC(eeprom_serial_93cxx_device::cs_write)) + PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", FUNC(eeprom_serial_93cxx_device::clk_write)) + PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", FUNC(eeprom_serial_93cxx_device::di_write)) + PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", FUNC(eeprom_serial_93cxx_device::do_read)) +INPUT_PORTS_END + + +static INPUT_PORTS_START( 2b ) + PORT_START("IN1") + TOAPLAN_JOY_UDLR_2_BUTTONS( 1 ) + + PORT_START("IN2") + TOAPLAN_JOY_UDLR_2_BUTTONS( 2 ) + + PORT_START("SYS") + PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_SERVICE1 ) + PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_TILT ) + TOAPLAN_TEST_SWITCH( 0x04, IP_ACTIVE_HIGH ) + PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_COIN1 ) + PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_COIN2 ) + PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_START1 ) + PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_START2 ) + PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_UNKNOWN ) + + PORT_START("DSWA") + TOAPLAN_MACHINE_NO_COCKTAIL_LOC(SW1) + // Coinage on bit mask 0x00f0 + PORT_BIT( 0x00f0, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // Modified below + + PORT_START("DSWB") + TOAPLAN_DIFFICULTY_LOC(SW2) + // Per-game features on bit mask 0x00fc + PORT_BIT( 0x00fc, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // Modified below +INPUT_PORTS_END + +static INPUT_PORTS_START( fixeightbl ) + PORT_INCLUDE( 2b ) + + PORT_MODIFY("SYS") + PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_COIN3 ) + PORT_SERVICE_NO_TOGGLE(0x0004, IP_ACTIVE_HIGH) // Service input is a pushbutton marked 'Test SW' + + PORT_START("IN3") + PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(3) PORT_8WAY + PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(3) PORT_8WAY + PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(3) PORT_8WAY + PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(3) PORT_8WAY + PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(3) + PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(3) + PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_START3 ) + PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_UNKNOWN ) + PORT_BIT( 0xff00, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // Unknown/Unused + + PORT_MODIFY("DSWA") + PORT_DIPNAME( 0x0001, 0x0000, "Maximum Players" ) PORT_DIPLOCATION("SW1:!1") + PORT_DIPSETTING( 0x0000, "2" ) + PORT_DIPSETTING( 0x0001, "3" ) + PORT_DIPNAME( 0x0002, 0x0000, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW1:!2") // This video HW doesn't support flip screen + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0002, DEF_STR( On ) ) + PORT_DIPNAME( 0x0004, 0x0004, "Shooting Style" ) PORT_DIPLOCATION("SW1:!3") + PORT_DIPSETTING( 0x0004, "Semi-Auto" ) + PORT_DIPSETTING( 0x0000, "Full-Auto" ) + // Various features on bit mask 0x0008 - see above + TOAPLAN_COINAGE_JAPAN_LOC(SW1) + + PORT_MODIFY("DSWB") + // Difficulty on bit mask 0x0003 - see above + PORT_DIPNAME( 0x000c, 0x0000, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW2:!3,!4") + PORT_DIPSETTING( 0x000c, DEF_STR( None ) ) + PORT_DIPSETTING( 0x0000, "500k and every 500k" ) + PORT_DIPSETTING( 0x0008, "300k only" ) + PORT_DIPSETTING( 0x0004, "300k and every 300k" ) + PORT_DIPNAME( 0x0030, 0x0000, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:!5,!6") + PORT_DIPSETTING( 0x0030, "1" ) + PORT_DIPSETTING( 0x0020, "2" ) + PORT_DIPSETTING( 0x0000, "3" ) + PORT_DIPSETTING( 0x0010, "5" ) + PORT_DIPNAME( 0x0040, 0x0000, "Invulnerability (Cheat)" ) PORT_DIPLOCATION("SW2:!7") + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0040, DEF_STR( On ) ) + PORT_DIPNAME( 0x0080, 0x0000, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("SW2:!8") + PORT_DIPSETTING( 0x0080, DEF_STR( No ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( Yes ) ) +INPUT_PORTS_END + +void fixeight_state::sound_reset_w(u8 data) +{ + m_audiocpu->set_input_line(INPUT_LINE_RESET, (data & 0x08) ? CLEAR_LINE : ASSERT_LINE); +} + +void fixeight_state::fixeight_68k_mem(address_map &map) +{ + map(0x000000, 0x07ffff).rom(); + map(0x100000, 0x103fff).ram(); + map(0x200000, 0x200001).portr("IN1"); + map(0x200004, 0x200005).portr("IN2"); + map(0x200008, 0x200009).portr("IN3"); + map(0x200010, 0x200011).portr("SYS"); + map(0x20001d, 0x20001d).w("coincounter", FUNC(toaplan_coincounter_device::coin_w)); + map(0x280000, 0x28ffff).rw(FUNC(fixeight_state::shared_ram_r), FUNC(fixeight_state::shared_ram_w)).umask16(0x00ff); + map(0x300000, 0x30000d).rw(m_vdp, FUNC(gp9001vdp_device::read), FUNC(gp9001vdp_device::write)); + map(0x400000, 0x400fff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); + map(0x500000, 0x501fff).ram().w(FUNC(fixeight_state::tx_videoram_w)).share(m_tx_videoram); + map(0x502000, 0x5021ff).ram().share(m_tx_lineselect); + map(0x503000, 0x5031ff).ram().w(FUNC(fixeight_state::tx_linescroll_w)).share(m_tx_linescroll); + map(0x600000, 0x60ffff).ram().w(FUNC(fixeight_state::tx_gfxram_w)).share(m_tx_gfxram); + map(0x700000, 0x700001).w(FUNC(fixeight_state::sound_reset_w)).umask16(0x00ff).cswidth(16); + map(0x800000, 0x800001).r(m_vdp, FUNC(gp9001vdp_device::vdpcount_r)); +} + + +void fixeight_bootleg_state::fixeightbl_oki_bankswitch_w(u8 data) +{ + data &= 7; + if (data <= 4) m_okibank->set_entry(data); +} + + +void fixeight_bootleg_state::fixeightbl_68k_mem(address_map &map) +{ + map(0x000000, 0x0fffff).rom(); // 0-7ffff ? + map(0x100000, 0x10ffff).ram(); // 100000-107fff 105000-105xxx 106000-106xxx 108000 - related to sound ? + map(0x200000, 0x200001).portr("IN1"); + map(0x200004, 0x200005).portr("IN2"); + map(0x200008, 0x200009).portr("IN3"); + map(0x20000c, 0x20000d).portr("DSWB"); + map(0x200010, 0x200011).portr("SYS"); + map(0x200015, 0x200015).w(FUNC(fixeight_bootleg_state::fixeightbl_oki_bankswitch_w)); // Sound banking. Code at $4084c, $5070 + map(0x200019, 0x200019).rw(m_oki, FUNC(okim6295_device::read), FUNC(okim6295_device::write)); + map(0x20001c, 0x20001d).portr("DSWA"); + map(0x300000, 0x30000d).rw(m_vdp, FUNC(gp9001vdp_device::read), FUNC(gp9001vdp_device::write)); + map(0x400000, 0x400fff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); + map(0x500000, 0x501fff).ram().w(FUNC(fixeight_bootleg_state::tx_videoram_w)).share(m_tx_videoram); + map(0x700000, 0x700001).r(m_vdp, FUNC(gp9001vdp_device::vdpcount_r)); + map(0x800000, 0x87ffff).rom().region("maincpu", 0x80000); +} + + +void fixeight_state::fixeight_v25_mem(address_map &map) +{ + map(0x00000, 0x00000).portr("IN1"); + map(0x00002, 0x00002).portr("IN2"); + map(0x00004, 0x00004).portr("IN3"); + map(0x0000a, 0x0000b).rw("ymsnd", FUNC(ym2151_device::read), FUNC(ym2151_device::write)); + map(0x0000c, 0x0000c).rw(m_oki, FUNC(okim6295_device::read), FUNC(okim6295_device::write)); + map(0x80000, 0x87fff).mirror(0x78000).ram().share(m_shared_ram); +} + +void fixeight_bootleg_state::cpu_space_fixeightbl_map(address_map &map) +{ + map(0xfffff0, 0xffffff).m(m_maincpu, FUNC(m68000_base_device::autovectors_map)); + map(0xfffff5, 0xfffff5).lr8(NAME([this] () { m_maincpu->set_input_line(M68K_IRQ_2, CLEAR_LINE); return m68000_device::autovector(2); })); +} + + + +#define XOR(a) WORD_XOR_LE(a) +#define LOC(x) (x+XOR(0)) + +static const gfx_layout truxton2_tx_tilelayout = +{ + 8,8, /* 8x8 characters */ + 1024, /* 1024 characters */ + 4, /* 4 bits per pixel */ + { STEP4(0,1) }, + { LOC(0)*4, LOC(1)*4, LOC(4)*4, LOC(5)*4, LOC(8)*4, LOC(9)*4, LOC(12)*4, LOC(13)*4 }, + { STEP8(0,8*8) }, + 8*8*8 +}; + + +static GFXDECODE_START( gfx ) + GFXDECODE_ENTRY( nullptr, 0, truxton2_tx_tilelayout, 64*16, 64 ) +GFXDECODE_END + +static GFXDECODE_START( gfx_textrom ) + GFXDECODE_ENTRY( "text", 0, gfx_8x8x4_packed_msb, 64*16, 64 ) +GFXDECODE_END + +void fixeight_state::fixeight(machine_config &config) +{ + /* basic machine hardware */ + M68000(config, m_maincpu, 16_MHz_XTAL); // verified on PCB + m_maincpu->set_addrmap(AS_PROGRAM, &fixeight_state::fixeight_68k_mem); + m_maincpu->reset_cb().set(FUNC(fixeight_state::reset_audiocpu)); + + v25_device &audiocpu(V25(config, m_audiocpu, 16_MHz_XTAL)); // NEC V25 type Toaplan marked CPU ??? + audiocpu.set_addrmap(AS_PROGRAM, &fixeight_state::fixeight_v25_mem); + audiocpu.set_decryption_table(toaplan_v25_tables::ts001turbo_decryption_table); + audiocpu.p0_in_cb().set_ioport("EEPROM"); + audiocpu.p0_out_cb().set_ioport("EEPROM"); + + TOAPLAN_COINCOUNTER(config, "coincounter", 0); + + EEPROM_93C46_16BIT(config, m_eeprom); + + /* video hardware */ + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_video_attributes(VIDEO_UPDATE_BEFORE_VBLANK); + m_screen->set_raw(27_MHz_XTAL/4, 432, 0, 320, 262, 0, 240); // verified on PCB + m_screen->set_screen_update(FUNC(fixeight_state::screen_update)); + m_screen->screen_vblank().set(FUNC(fixeight_state::screen_vblank)); + m_screen->set_palette(m_palette); + + GFXDECODE(config, m_gfxdecode, m_palette, gfx); + PALETTE(config, m_palette).set_format(palette_device::xBGR_555, gp9001vdp_device::VDP_PALETTE_LENGTH); + + GP9001_VDP(config, m_vdp, 27_MHz_XTAL); + m_vdp->set_palette(m_palette); + m_vdp->vint_out_cb().set_inputline(m_maincpu, M68K_IRQ_4); + + /* sound hardware */ + SPEAKER(config, "mono").front_center(); + + YM2151(config, "ymsnd", 27_MHz_XTAL/8).add_route(ALL_OUTPUTS, "mono", 0.5); /* verified on pcb */ + + OKIM6295(config, m_oki, 16_MHz_XTAL/16, okim6295_device::PIN7_HIGH); /* verified on pcb */ + m_oki->add_route(ALL_OUTPUTS, "mono", 0.5); +} + +void fixeight_bootleg_state::fixeightbl_oki(address_map &map) +{ + map(0x00000, 0x2ffff).rom(); + map(0x30000, 0x3ffff).bankr(m_okibank); +} + +void fixeight_bootleg_state::fixeightbl(machine_config &config) +{ + /* basic machine hardware */ + M68000(config, m_maincpu, XTAL(10'000'000)); /* 10MHz Oscillator */ + m_maincpu->set_addrmap(AS_PROGRAM, &fixeight_bootleg_state::fixeightbl_68k_mem); + m_maincpu->set_addrmap(m68000_base_device::AS_CPU_SPACE, &fixeight_bootleg_state::cpu_space_fixeightbl_map); + + TOAPLAN_COINCOUNTER(config, "coincounter", 0); + + /* video hardware */ + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_video_attributes(VIDEO_UPDATE_BEFORE_VBLANK); + m_screen->set_raw(27_MHz_XTAL/4, 432, 0, 320, 262, 0, 240); + //m_screen->set_refresh_hz(60); + //m_screen->set_size(432, 262); + //m_screen->set_visarea(0, 319, 0, 239); + m_screen->set_screen_update(FUNC(fixeight_bootleg_state::screen_update_bootleg)); + m_screen->screen_vblank().set(FUNC(fixeight_bootleg_state::screen_vblank)); + m_screen->set_palette(m_palette); + + GFXDECODE(config, m_gfxdecode, m_palette, gfx_textrom); + PALETTE(config, m_palette).set_format(palette_device::xBGR_555, gp9001vdp_device::VDP_PALETTE_LENGTH); + + GP9001_VDP(config, m_vdp, 27_MHz_XTAL); + m_vdp->set_palette(m_palette); + m_vdp->vint_out_cb().set_inputline(m_maincpu, M68K_IRQ_2, ASSERT_LINE); + + /* sound hardware */ + SPEAKER(config, "mono").front_center(); + + OKIM6295(config, m_oki, 14_MHz_XTAL/16, okim6295_device::PIN7_LOW); + m_oki->add_route(ALL_OUTPUTS, "mono", 1.0); + m_oki->set_addrmap(0, &fixeight_bootleg_state::fixeightbl_oki); +} + + +#define ROMS_FIXEIGHT \ + ROM_REGION( 0x080000, "maincpu", 0 ) \ + ROM_LOAD16_WORD_SWAP( "tp-026-1", 0x000000, 0x080000, CRC(f7b1746a) SHA1(0bbea6f111b818bc9b9b2060af4fe900f37cf7f9) ) \ + ROM_REGION( 0x400000, "gp9001", 0 ) \ + ROM_LOAD( "tp-026-3", 0x000000, 0x200000, CRC(e5578d98) SHA1(280d2b716d955e767d311fc9596823852435b6d7) ) \ + ROM_LOAD( "tp-026-4", 0x200000, 0x200000, CRC(b760cb53) SHA1(bc9c5e49e45cdda0f774be0038aa4deb21d4d285) ) \ + ROM_REGION( 0x40000, "oki", 0 ) \ + ROM_LOAD( "tp-026-2", 0x00000, 0x40000, CRC(85063f1f) SHA1(1bf4d77494de421c98f6273b9876e60d827a6826) ) + +// note you may need to byteswap these EEPROM files to reprogram the original chip, this is the same for many supported in MAME. + +ROM_START( fixeightkt ) + ROMS_FIXEIGHT + ROM_REGION16_BE( 0x80, "eeprom", 0 ) + ROM_LOAD( "fixeightkt.nv", 0x00, 0x80, CRC(08fa73ba) SHA1(b7761d3dd3f4485e55c8ef2cf1a840ca771ee2fc) ) +ROM_END + +ROM_START( fixeightk ) + ROMS_FIXEIGHT + ROM_REGION16_BE( 0x80, "eeprom", 0 ) + ROM_LOAD( "fixeightk.nv", 0x00, 0x80, CRC(cac91c6f) SHA1(55b284f081753d60abff63493094322756b7f0c5) ) +ROM_END + +ROM_START( fixeightht ) + ROMS_FIXEIGHT + ROM_REGION16_BE( 0x80, "eeprom", 0 ) + ROM_LOAD( "fixeightht.nv", 0x00, 0x80, CRC(57edaa51) SHA1(b8d50e82590b8cbbbcafec5f9cfbc91e4c286db5) ) +ROM_END + +ROM_START( fixeighth ) + ROMS_FIXEIGHT + ROM_REGION16_BE( 0x80, "eeprom", 0 ) + ROM_LOAD( "fixeighth.nv", 0x00, 0x80, CRC(95dec584) SHA1(1c309074b51da5a5263dee00403296946e41067b) ) +ROM_END + +ROM_START( fixeighttwt ) + ROMS_FIXEIGHT + ROM_REGION16_BE( 0x80, "eeprom", 0 ) + ROM_LOAD( "fixeighttwt.nv", 0x00, 0x80, CRC(b6d5c06c) SHA1(7fda380ac6835a983c57d093ccad7bd76893c9ba)) +ROM_END + +ROM_START( fixeighttw ) + ROMS_FIXEIGHT + ROM_REGION16_BE( 0x80, "eeprom", 0 ) + ROM_LOAD( "fixeighttw.nv", 0x00, 0x80, CRC(74e6afb9) SHA1(87bdc95eb0d2d54375de2c622557d503e14154be)) +ROM_END + +ROM_START( fixeightat ) + ROMS_FIXEIGHT + ROM_REGION16_BE( 0x80, "eeprom", 0 ) + ROM_LOAD( "fixeightat.nv", 0x00, 0x80,CRC(e9c21987) SHA1(7f699e38deb84902ed62b857a3d2b4e3ea1475bb) ) +ROM_END + +ROM_START( fixeighta ) + ROMS_FIXEIGHT + ROM_REGION16_BE( 0x80, "eeprom", 0 ) + ROM_LOAD( "fixeighta.nv", 0x00, 0x80, CRC(2bf17652) SHA1(4ec6f188e63610d258cd6b2432d2200d61d80bed)) +ROM_END + +ROM_START( fixeightt ) + ROMS_FIXEIGHT + ROM_REGION16_BE( 0x80, "eeprom", 0 ) + ROM_LOAD( "fixeightt.nv", 0x00, 0x80, CRC(c0da4a05) SHA1(3686161244e3e8be0e2fdb5fc5c24e39a7aeba85) ) +ROM_END + +ROM_START( fixeight ) + ROMS_FIXEIGHT + ROM_REGION16_BE( 0x80, "eeprom", 0 ) + ROM_LOAD( "fixeight.nv", 0x00, 0x80, CRC(02e925d0) SHA1(5839d10aceff84916ea99e9c6afcdc90eef7468b) ) +ROM_END + +ROM_START( fixeightut ) + ROMS_FIXEIGHT + ROM_REGION16_BE( 0x80, "eeprom", 0 ) + ROM_LOAD( "fixeightut.nv", 0x00, 0x80, CRC(9fcd93ee) SHA1(4f2750f09d9b8ff358a2fd6c7a4a8ba6de67017a) ) +ROM_END + +ROM_START( fixeightu ) + ROMS_FIXEIGHT + ROM_REGION16_BE( 0x80, "eeprom", 0 ) + ROM_LOAD( "fixeightu.nv", 0x00, 0x80, CRC(5dfefc3b) SHA1(5203525c58e2ae10575af2e277a5696bd64c5b60) ) +ROM_END + +ROM_START( fixeightj ) + ROMS_FIXEIGHT + ROM_REGION16_BE( 0x80, "eeprom", 0 ) + ROM_LOAD( "fixeightj.nv", 0x00, 0x80, CRC(21e22038) SHA1(29fb10061e62799bb5e4171e144daac49f0cdf06) ) +ROM_END + +ROM_START( fixeightjt ) + ROMS_FIXEIGHT + ROM_REGION16_BE( 0x80, "eeprom", 0 ) + ROM_LOAD( "fixeightjt.nv", 0x00, 0x80, CRC(e3d14fed) SHA1(ee4982ef195240c5eaa5005ca1d591901fb01b47) ) +ROM_END + + +/* +Fix Eight (bootleg) +Toaplan, 1992 + +PCB Layout +---------- + +|--------------------------------------------| +| 1.BIN PAL 14MHz PAL| +| M6295 PAL | +| PAL 6116 4.BIN 681000 681000| +| 6116 | +| 6116 681000 681000| +|J 6116 PAL | +|A PAL | +|M | +|M 62256 62256 PAL | +|A 2.BIN 3.BIN PAL | +| PAL | +| 68000 PAL | +| DSW2 |------| 5.BIN | +| DSW1 6264 |TPC | | +| 3.579545MHz |1020 | 6.BIN | +| 10MHz 6264 |------| 7.BIN | +|--------------------------------------------| +Notes: + 68000 clock at 10.000MHz + M6295 clock at 875kHz [14M/16]. Sample rate = 875000 / 165 + VSync at 60Hz + 6116 - 2k x8 SRAM (x4) + 6264 - 8k x8 SRAM (x2) + 62256 - 32k x8 SRAM (x2) + 681000- 128k x8 SRAM (x4) +*/ + + +ROM_START( fixeightbl ) + ROM_REGION( 0x100000, "maincpu", 0 ) /* Main 68K code */ + ROM_LOAD16_BYTE( "3.bin", 0x000000, 0x80000, CRC(cc77d4b4) SHA1(4d3376cbae13d90c6314d8bb9236c2183fc6253c) ) + ROM_LOAD16_BYTE( "2.bin", 0x000001, 0x80000, CRC(ed715488) SHA1(37be9bc8ff6b54a1f660d89469c6c2da6301e9cd) ) + + ROM_REGION( 0x400000, "gp9001", 0 ) + ROM_LOAD( "tp-026-3", 0x000000, 0x200000, CRC(e5578d98) SHA1(280d2b716d955e767d311fc9596823852435b6d7) ) + ROM_LOAD( "tp-026-4", 0x200000, 0x200000, CRC(b760cb53) SHA1(bc9c5e49e45cdda0f774be0038aa4deb21d4d285) ) + + ROM_REGION( 0x08000, "text", 0) + ROM_LOAD( "4.bin", 0x00000, 0x08000, CRC(a6aca465) SHA1(2b331faeee1832e0adc5218254a99d66331862c6) ) + + ROM_REGION( 0x80000, "oki", 0 ) /* ADPCM Samples */ + ROM_LOAD( "1.bin", 0x00000, 0x80000, CRC(888f19ac) SHA1(d2f4f8b7be7a0fdb95baa0af8930e50e2f875c05) ) + + ROM_REGION( 0x8000, "user1", 0 ) /* ??? Some sort of table - same as in pipibibsbl */ + ROM_LOAD( "5.bin", 0x0000, 0x8000, CRC(456dd16e) SHA1(84779ee64d3ea33ba1ba4dee39b504a81c6811a1) ) +ROM_END + + +void fixeight_bootleg_state::init_fixeightbl() +{ + u8 *ROM = memregion("oki")->base(); + + m_okibank->configure_entries(0, 5, &ROM[0x30000], 0x10000); +} + +} // anonymous namespace + +// region is in eeprom (and also requires correct return value from a v25 mapped address??) +GAME( 1992, fixeight, 0, fixeight, fixeight, fixeight_state, empty_init, ROT270, "Toaplan", "FixEight (Europe)", MACHINE_SUPPORTS_SAVE ) +GAME( 1992, fixeightk, fixeight, fixeight, fixeight, fixeight_state, empty_init, ROT270, "Toaplan", "FixEight (Korea)", MACHINE_SUPPORTS_SAVE ) +GAME( 1992, fixeighth, fixeight, fixeight, fixeight, fixeight_state, empty_init, ROT270, "Toaplan", "FixEight (Hong Kong)", MACHINE_SUPPORTS_SAVE ) +GAME( 1992, fixeighttw, fixeight, fixeight, fixeight, fixeight_state, empty_init, ROT270, "Toaplan", "FixEight (Taiwan)", MACHINE_SUPPORTS_SAVE ) +GAME( 1992, fixeighta, fixeight, fixeight, fixeight, fixeight_state, empty_init, ROT270, "Toaplan", "FixEight (Southeast Asia)", MACHINE_SUPPORTS_SAVE ) +GAME( 1992, fixeightu, fixeight, fixeight, fixeight, fixeight_state, empty_init, ROT270, "Toaplan", "FixEight (USA)", MACHINE_SUPPORTS_SAVE ) +GAME( 1992, fixeightj, fixeight, fixeight, fixeight, fixeight_state, empty_init, ROT270, "Toaplan", "FixEight - Jigoku no Eiyuu Densetsu (Japan)", MACHINE_SUPPORTS_SAVE ) +GAME( 1992, fixeightt, fixeight, fixeight, fixeight, fixeight_state, empty_init, ROT270, "Toaplan (Taito license)", "FixEight (Europe, Taito license)", MACHINE_SUPPORTS_SAVE ) +GAME( 1992, fixeightkt, fixeight, fixeight, fixeight, fixeight_state, empty_init, ROT270, "Toaplan (Taito license)", "FixEight (Korea, Taito license)", MACHINE_SUPPORTS_SAVE ) +GAME( 1992, fixeightht, fixeight, fixeight, fixeight, fixeight_state, empty_init, ROT270, "Toaplan (Taito license)", "FixEight (Hong Kong, Taito license)", MACHINE_SUPPORTS_SAVE ) +GAME( 1992, fixeighttwt, fixeight, fixeight, fixeight, fixeight_state, empty_init, ROT270, "Toaplan (Taito license)", "FixEight (Taiwan, Taito license)", MACHINE_SUPPORTS_SAVE ) +GAME( 1992, fixeightat, fixeight, fixeight, fixeight, fixeight_state, empty_init, ROT270, "Toaplan (Taito license)", "FixEight (Southeast Asia, Taito license)", MACHINE_SUPPORTS_SAVE ) +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 ) diff --git a/src/mame/toaplan/ghox.cpp b/src/mame/toaplan/ghox.cpp new file mode 100644 index 00000000000..5c77893b594 --- /dev/null +++ b/src/mame/toaplan/ghox.cpp @@ -0,0 +1,340 @@ +// license:BSD-3-Clause +// copyright-holders:Quench, Yochizo, David Haywood + +#include "emu.h" + +#include "gp9001.h" +#include "toaplan_coincounter.h" +#include "toaplipt.h" + +#include "cpu/m68000/m68000.h" +#include "cpu/z180/hd647180x.h" +#include "sound/ymopm.h" + +#include "emupal.h" +#include "screen.h" +#include "speaker.h" +#include "tilemap.h" + +/* +Name Board No Maker Game name +---------------------------------------------------------------------------- +ghox TP-021 Toaplan Ghox (Spinner with single up/down axis control) +ghoxj TP-021 Toaplan Ghox (8-Way Joystick controls) + + +ghox - The ghoxj set displays an English title screen when the jumpers are set for Japan/Taito, + and fails to display the "Winners Don't Use Drugs" logo when set for USA/Taito (either + Taito America or Taito Japan). +*/ + +namespace { + +class ghox_state : public driver_device +{ +public: + ghox_state(const machine_config &mconfig, device_type type, const char *tag) + : driver_device(mconfig, type, tag) + , m_io_pad(*this, "PAD%u", 1U) + , m_shared_ram(*this, "shared_ram") + , m_maincpu(*this, "maincpu") + , m_audiocpu(*this, "audiocpu") + , m_vdp(*this, "gp9001") + , m_screen(*this, "screen") + , m_palette(*this, "palette") + { } + + void ghox(machine_config &config) ATTR_COLD; + +protected: + virtual void machine_start() override ATTR_COLD; + virtual void machine_reset() override ATTR_COLD; + virtual void video_start() override ATTR_COLD; + +private: + void ghox_68k_mem(address_map &map) ATTR_COLD; + void ghox_hd647180_mem_map(address_map &map) ATTR_COLD; + + u32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + void screen_vblank(int state); + + template u16 ghox_h_analog_r(); + u8 shared_ram_r(offs_t offset) { return m_shared_ram[offset]; } + void shared_ram_w(offs_t offset, u8 data) { m_shared_ram[offset] = data; } + + s8 m_old_paddle_h[2] = {0}; + + required_ioport_array<2> m_io_pad; + required_shared_ptr m_shared_ram; // 8 bit RAM shared between 68K and sound CPU + required_device m_maincpu; + required_device m_audiocpu; + required_device m_vdp; + required_device m_screen; + required_device m_palette; + bitmap_ind8 m_custom_priority_bitmap; +}; + + +void ghox_state::video_start() +{ + m_screen->register_screen_bitmap(m_custom_priority_bitmap); + m_vdp->custom_priority_bitmap = &m_custom_priority_bitmap; +} + + +u32 ghox_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + bitmap.fill(0, cliprect); + m_custom_priority_bitmap.fill(0, cliprect); + m_vdp->render_vdp(bitmap, cliprect); + return 0; +} + +void ghox_state::screen_vblank(int state) +{ + if (state) // rising edge + { + m_vdp->screen_eof(); + } +} + +void ghox_state::machine_start() +{ + save_item(NAME(m_old_paddle_h)); +} + +void ghox_state::machine_reset() +{ + m_old_paddle_h[0] = 0; + m_old_paddle_h[1] = 0; +} + +template +u16 ghox_state::ghox_h_analog_r() +{ + const s8 new_value = m_io_pad[Which]->read(); + const s8 result = new_value - m_old_paddle_h[Which]; + if (!machine().side_effects_disabled()) + m_old_paddle_h[Which] = new_value; + return result; +} + +static INPUT_PORTS_START( base ) + PORT_START("IN1") + TOAPLAN_JOY_UDLR_2_BUTTONS( 1 ) + + PORT_START("IN2") + TOAPLAN_JOY_UDLR_2_BUTTONS( 2 ) + + PORT_START("SYS") + PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_SERVICE1 ) + PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_TILT ) + TOAPLAN_TEST_SWITCH( 0x04, IP_ACTIVE_HIGH ) + PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_COIN1 ) + PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_COIN2 ) + PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_START1 ) + PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_START2 ) + PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_UNKNOWN ) + + PORT_START("DSWA") + TOAPLAN_MACHINE_NO_COCKTAIL_LOC(SW1) + // Coinage on bit mask 0x00f0 + PORT_BIT( 0x00f0, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // Modified below + + PORT_START("DSWB") + TOAPLAN_DIFFICULTY_LOC(SW2) + // Per-game features on bit mask 0x00fc + PORT_BIT( 0x00fc, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // Modified below +INPUT_PORTS_END + +static INPUT_PORTS_START( ghox ) + PORT_INCLUDE( base ) + + PORT_MODIFY("DSWA") + // Various features on bit mask 0x000f - see above + TOAPLAN_COINAGE_DUAL_LOC( JMPR, 0x80000, 0x80000, SW1 ) + + PORT_MODIFY("DSWB") + // Difficulty on bit mask 0x0003 - see above + // "Debug Mode" corresponds to "Invulnerability" in the other games + // (i.e. it enables pause and slow motion) + PORT_DIPNAME( 0x000c, 0x0000, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW2:!3,!4") + PORT_DIPSETTING( 0x000c, DEF_STR( None ) ) + PORT_DIPSETTING( 0x0008, "100k only" ) + PORT_DIPSETTING( 0x0004, "100k and 300k" ) + PORT_DIPSETTING( 0x0000, "100k and every 200k" ) + PORT_DIPNAME( 0x0030, 0x0000, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:!5,!6") + PORT_DIPSETTING( 0x0030, "1" ) + PORT_DIPSETTING( 0x0020, "2" ) + PORT_DIPSETTING( 0x0000, "3" ) + PORT_DIPSETTING( 0x0010, "5" ) + PORT_DIPNAME( 0x0040, 0x0000, "Debug Mode (Cheat)" ) PORT_DIPLOCATION("SW2:!7") + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0040, DEF_STR( On ) ) + PORT_DIPNAME( 0x0080, 0x0000, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW2:!8") + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0080, DEF_STR( On ) ) + + PORT_START("JMPR") + // Bit Mask 0x80000 is used here to signify European Coinage for MAME purposes - not read on the real board! + PORT_CONFNAME( 0x8000f, 0x80002, DEF_STR( Region ) ) //PORT_CONFLOCATION("JP:!4,!3,!2,!1,FAKE:!1") + PORT_CONFSETTING( 0x80002, DEF_STR( Europe ) ) + PORT_CONFSETTING( 0x00001, DEF_STR( USA ) ) + PORT_CONFSETTING( 0x00000, DEF_STR( Japan ) ) + PORT_CONFSETTING( 0x00003, "Hong Kong (Honest Trading Co.)" ) + PORT_CONFSETTING( 0x00004, DEF_STR( Korea ) ) + PORT_CONFSETTING( 0x00005, DEF_STR( Taiwan ) ) + PORT_CONFSETTING( 0x80006, "Spain & Portugal (APM Electronics S.A.)" ) + PORT_CONFSETTING( 0x80007, "Italy (Star Electronica SRL)" ) + PORT_CONFSETTING( 0x80008, "UK (JP Leisure Limited)" ) + PORT_CONFSETTING( 0x00009, "USA (Romstar, Inc.)" ) + PORT_CONFSETTING( 0x8000a, "Europe (Nova Apparate GMBH & Co.)" ) + PORT_CONFSETTING( 0x0000b, "USA (Taito America Corporation)" ) + PORT_CONFSETTING( 0x0000c, "USA (Taito Corporation Japan)" ) + PORT_CONFSETTING( 0x8000d, "Europe (Taito Corporation Japan)" ) + PORT_CONFSETTING( 0x0000e, "Japan (Licensed to [blank])" ) // English title screen + PORT_CONFSETTING( 0x0000f, "Japan (Taito Corporation)" ) + + PORT_START("PAD1") /* Paddle 1 (left-right) read at $100000 */ + PORT_BIT( 0xff, 0x00, IPT_DIAL ) PORT_SENSITIVITY(25) PORT_KEYDELTA(15) PORT_PLAYER(1) + PORT_BIT( 0xff00, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // Unknown/Unused + + PORT_START("PAD2") /* Paddle 2 (left-right) read at $040000 */ + PORT_BIT( 0xff, 0x00, IPT_DIAL ) PORT_SENSITIVITY(25) PORT_KEYDELTA(15) PORT_PLAYER(2) + PORT_BIT( 0xff00, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // Unknown/Unused +INPUT_PORTS_END + +static INPUT_PORTS_START( ghoxjo ) + PORT_INCLUDE( ghox ) + + PORT_MODIFY("JMPR") + // Bit Mask 0x80000 is used here to signify European Coinage for MAME purposes - not read on the real board! + PORT_CONFNAME( 0x8000f, 0x80002, DEF_STR( Region ) ) //PORT_CONFLOCATION("JP:!4,!3,!2,!1,FAKE:!1") + PORT_CONFSETTING( 0x80002, DEF_STR( Europe ) ) + PORT_CONFSETTING( 0x00001, DEF_STR( USA ) ) + PORT_CONFSETTING( 0x00000, DEF_STR( Japan ) ) + PORT_CONFSETTING( 0x00003, "Hong Kong (Honest Trading Co.)" ) + PORT_CONFSETTING( 0x00004, DEF_STR( Korea ) ) + PORT_CONFSETTING( 0x00005, DEF_STR( Taiwan ) ) + PORT_CONFSETTING( 0x80006, "Spain & Portugal (APM Electronics S.A.)" ) + PORT_CONFSETTING( 0x80007, "Italy (Star Electronica SRL)" ) + PORT_CONFSETTING( 0x80008, "UK (JP Leisure Limited)" ) + PORT_CONFSETTING( 0x00009, "USA (Romstar, Inc.)" ) + PORT_CONFSETTING( 0x8000a, "Europe (Nova Apparate GMBH & Co.)" ) + PORT_CONFSETTING( 0x0000b, "Japan (Unused) [b]" ) + PORT_CONFSETTING( 0x0000c, "Japan (Unused) [c]" ) + PORT_CONFSETTING( 0x0000d, "Japan (Unused) [d]" ) + PORT_CONFSETTING( 0x0000e, "Japan (Unused) [e]" ) + PORT_CONFSETTING( 0x0000f, "Japan (Unused) [f]" ) +INPUT_PORTS_END + + +void ghox_state::ghox_68k_mem(address_map &map) +{ + map(0x000000, 0x03ffff).rom(); + map(0x040000, 0x040001).r(FUNC(ghox_state::ghox_h_analog_r<1>)); + map(0x080000, 0x083fff).ram(); + map(0x0c0000, 0x0c0fff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); + map(0x100000, 0x100001).r(FUNC(ghox_state::ghox_h_analog_r<0>)); + map(0x140000, 0x14000d).rw(m_vdp, FUNC(gp9001vdp_device::read), FUNC(gp9001vdp_device::write)); + map(0x180000, 0x180fff).rw(FUNC(ghox_state::shared_ram_r), FUNC(ghox_state::shared_ram_w)).umask16(0x00ff); + map(0x181001, 0x181001).w("coincounter", FUNC(toaplan_coincounter_device::coin_w)); + map(0x18100c, 0x18100d).portr("JMPR"); +} + +void ghox_state::ghox_hd647180_mem_map(address_map &map) +{ + map(0x40000, 0x407ff).ram().share(m_shared_ram); + + map(0x80002, 0x80002).portr("DSWA"); + map(0x80004, 0x80004).portr("DSWB"); + map(0x80006, 0x80006).nopr(); // nothing? + map(0x80008, 0x80008).portr("IN1"); + map(0x8000a, 0x8000a).portr("IN2"); + + map(0x8000c, 0x8000e).portr("SYS"); + + map(0x8000e, 0x8000f).rw("ymsnd", FUNC(ym2151_device::read), FUNC(ym2151_device::write)); +} + + +void ghox_state::ghox(machine_config &config) +{ + /* basic machine hardware */ + M68000(config, m_maincpu, 10_MHz_XTAL); /* verified on pcb */ + m_maincpu->set_addrmap(AS_PROGRAM, &ghox_state::ghox_68k_mem); + m_maincpu->reset_cb().set_inputline(m_audiocpu, INPUT_LINE_RESET); + + HD647180X(config, m_audiocpu, 10_MHz_XTAL); + m_audiocpu->set_addrmap(AS_PROGRAM, &ghox_state::ghox_hd647180_mem_map); + + TOAPLAN_COINCOUNTER(config, "coincounter", 0); + + config.set_maximum_quantum(attotime::from_hz(600)); + + /* video hardware */ + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_video_attributes(VIDEO_UPDATE_BEFORE_VBLANK); + m_screen->set_raw(27_MHz_XTAL/4, 432, 0, 320, 262, 0, 240); + m_screen->set_screen_update(FUNC(ghox_state::screen_update)); + m_screen->screen_vblank().set(FUNC(ghox_state::screen_vblank)); + m_screen->set_palette(m_palette); + + PALETTE(config, m_palette).set_format(palette_device::xBGR_555, gp9001vdp_device::VDP_PALETTE_LENGTH); + + GP9001_VDP(config, m_vdp, 27_MHz_XTAL); + m_vdp->set_palette(m_palette); + m_vdp->vint_out_cb().set_inputline(m_maincpu, M68K_IRQ_4); + + /* sound hardware */ + SPEAKER(config, "mono").front_center(); + + YM2151(config, "ymsnd", 27_MHz_XTAL/8).add_route(ALL_OUTPUTS, "mono", 0.5); // verified on pcb +} + + +ROM_START( ghox ) /* Spinner with single axis (up/down) controls */ + ROM_REGION( 0x040000, "maincpu", 0 ) /* Main 68K code */ + ROM_LOAD16_BYTE( "tp021-01.u10", 0x000000, 0x020000, CRC(9e56ac67) SHA1(daf241d9e55a6e60fc004ed61f787641595b1e62) ) + ROM_LOAD16_BYTE( "tp021-02.u11", 0x000001, 0x020000, CRC(15cac60f) SHA1(6efa3a50a5dfe6ef4072738d6a7d0d95dca8a675) ) + + ROM_REGION( 0x10000, "audiocpu", 0 ) /* Sound HD647180 code */ + ROM_LOAD( "hd647180.021", 0x00000, 0x08000, CRC(6ab59e5b) SHA1(d814dd3a8f1ee638794e2bd422eed4247ba4a15e) ) + + ROM_REGION( 0x100000, "gp9001", 0 ) + ROM_LOAD( "tp021-03.u36", 0x000000, 0x080000, CRC(a15d8e9d) SHA1(640a33997bdce8e84bea6a944139716379839037) ) + ROM_LOAD( "tp021-04.u37", 0x080000, 0x080000, CRC(26ed1c9a) SHA1(37da8af86ea24327444c2d4ad3dfbd936208d43d) ) +ROM_END + + +ROM_START( ghoxj ) /* 8-way joystick for controls */ + ROM_REGION( 0x040000, "maincpu", 0 ) /* Main 68K code */ + ROM_LOAD16_BYTE( "tp021-01a.u10", 0x000000, 0x020000, CRC(c11b13c8) SHA1(da7defc1d3b6ddded910ba56c31fbbdb5ed57b09) ) + ROM_LOAD16_BYTE( "tp021-02a.u11", 0x000001, 0x020000, CRC(8d426767) SHA1(1ed4a8bcbf4352257e7d58cb5c2c91eb48c2f047) ) + + ROM_REGION( 0x10000, "audiocpu", 0 ) /* Sound HD647180 code */ + ROM_LOAD( "hd647180.021", 0x00000, 0x08000, CRC(6ab59e5b) SHA1(d814dd3a8f1ee638794e2bd422eed4247ba4a15e) ) + + ROM_REGION( 0x100000, "gp9001", 0 ) + ROM_LOAD( "tp021-03.u36", 0x000000, 0x080000, CRC(a15d8e9d) SHA1(640a33997bdce8e84bea6a944139716379839037) ) + ROM_LOAD( "tp021-04.u37", 0x080000, 0x080000, CRC(26ed1c9a) SHA1(37da8af86ea24327444c2d4ad3dfbd936208d43d) ) +ROM_END + +ROM_START( ghoxjo ) /* older version (with fewer regions) of the 8-way joystick version */ + ROM_REGION( 0x040000, "maincpu", 0 ) /* Main 68K code */ + ROM_LOAD16_BYTE( "tp021-01.ghoxsticker.u10", 0x000000, 0x020000, CRC(ad3a8817) SHA1(317267e0c00934a86bf05c5afd6c69a7944a2ed3) ) // TP021 ?01? label covered with a handwriten 'GHOX' sticker + ROM_LOAD16_BYTE( "tp021-02.ghoxsticker.u11", 0x000001, 0x020000, CRC(2340e981) SHA1(d8e3f55e67fe6500f9e6c7eed1388dc895c5f574) ) // TP021 ?02? label covered with a handwriten 'GHOX' sticker + + ROM_REGION( 0x10000, "audiocpu", 0 ) /* Sound HD647180 code */ + ROM_LOAD( "hd647180.021", 0x00000, 0x08000, CRC(6ab59e5b) SHA1(d814dd3a8f1ee638794e2bd422eed4247ba4a15e) ) + + ROM_REGION( 0x100000, "gp9001", 0 ) + ROM_LOAD( "tp021-03.u36", 0x000000, 0x080000, CRC(a15d8e9d) SHA1(640a33997bdce8e84bea6a944139716379839037) ) + ROM_LOAD( "tp021-04.u37", 0x080000, 0x080000, CRC(26ed1c9a) SHA1(37da8af86ea24327444c2d4ad3dfbd936208d43d) ) +ROM_END + +} // anonymous namespace + +GAME( 1991, ghox, 0, ghox, ghox, ghox_state, empty_init, ROT270, "Toaplan", "Ghox (spinner)", MACHINE_SUPPORTS_SAVE ) +GAME( 1991, ghoxj, ghox, ghox, ghox, ghox_state, empty_init, ROT270, "Toaplan", "Ghox (joystick)", MACHINE_SUPPORTS_SAVE ) +GAME( 1991, ghoxjo, ghox, ghox, ghoxjo, ghox_state, empty_init, ROT270, "Toaplan", "Ghox (joystick, older)", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/toaplan/gp9001.cpp b/src/mame/toaplan/gp9001.cpp index 17423e9a35f..32d49d7cb68 100644 --- a/src/mame/toaplan/gp9001.cpp +++ b/src/mame/toaplan/gp9001.cpp @@ -378,6 +378,38 @@ u16 gp9001vdp_device::vdpstatus_r() return ((screen().vpos() + 15) % 262) >= 245; } +// this is a common form of reading several of the flags provide by the VDP +u16 gp9001vdp_device::vdpcount_r() +{ + /* +---------+---------+--------+---------------------------+ */ + /* | /H-Sync | /V-Sync | /Blank | Scanline Count | */ + /* | Bit 15 | Bit 14 | Bit 8 | Bit 7-0 (count from #EF) | */ + /* +---------+---------+--------+---------------------------+ */ + /*************** Control Signals are active low ***************/ + + int vpos = screen().vpos(); + + u16 video_status = 0xff00; // Set signals inactive + + vpos = (vpos + 15) % 262; + + if (hsync_r()) + video_status &= ~0x8000; + if (vsync_r()) + video_status &= ~0x4000; + if (fblank_r()) + video_status &= ~0x0100; + if (vpos < 256) + video_status |= (vpos & 0xff); + else + video_status |= 0xff; + +// logerror("VC: vpos=%04x hpos=%04x VBL=%04x\n",vpos,hpos,m_screen->vblank()); + + return video_status; +} + + void gp9001vdp_device::scroll_reg_select_w(u16 data, u16 mem_mask) { if (ACCESSING_BITS_0_7) diff --git a/src/mame/toaplan/gp9001.h b/src/mame/toaplan/gp9001.h index 0390fec2121..c624027e6c8 100644 --- a/src/mame/toaplan/gp9001.h +++ b/src/mame/toaplan/gp9001.h @@ -15,6 +15,8 @@ class gp9001vdp_device : public device_t, public device_memory_interface { public: + static constexpr unsigned VDP_PALETTE_LENGTH = 0x10000; + typedef device_delegate gp9001_cb_delegate; gp9001vdp_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); @@ -50,6 +52,7 @@ class gp9001vdp_device : public device_t, int hsync_r(); int vsync_r(); int fblank_r(); + u16 vdpcount_r(); // these bootlegs have strange access u16 bootleg_videoram16_r(offs_t offset); @@ -137,9 +140,9 @@ class gp9001vdp_device : public device_t, DECLARE_GFXDECODE_MEMBER(gfxinfo); void voffs_w(u16 data, u16 mem_mask = ~0); - int videoram16_r(void); + int videoram16_r(); void videoram16_w(u16 data, u16 mem_mask = ~0); - u16 vdpstatus_r(void); + u16 vdpstatus_r(); void scroll_reg_select_w(u16 data, u16 mem_mask = ~0); void scroll_reg_data_w(u16 data, u16 mem_mask = ~0); diff --git a/src/mame/toaplan/kbash.cpp b/src/mame/toaplan/kbash.cpp new file mode 100644 index 00000000000..bb9c6598522 --- /dev/null +++ b/src/mame/toaplan/kbash.cpp @@ -0,0 +1,504 @@ +// license:BSD-3-Clause +// copyright-holders:Quench, Yochizo, David Haywood + +#include "emu.h" + +#include "gp9001.h" +#include "toaplan_coincounter.h" +#include "toaplan_v25_tables.h" +#include "toaplipt.h" + +#include "cpu/m68000/m68000.h" +#include "cpu/nec/v25.h" +#include "sound/okim6295.h" +#include "sound/ymopm.h" + +#include "emupal.h" +#include "screen.h" +#include "speaker.h" +#include "tilemap.h" + +/* +Name Board No Maker Game name +---------------------------------------------------------------------------- +kbash TP-023 Toaplan Knuckle Bash +kbash2 bootleg Toaplan Knuckle Bash 2 +*/ + +namespace { + +class kbash_state : public driver_device +{ +public: + kbash_state(const machine_config &mconfig, device_type type, const char *tag) + : driver_device(mconfig, type, tag) + , m_shared_ram(*this, "shared_ram") + , m_maincpu(*this, "maincpu") + , m_audiocpu(*this, "audiocpu") + , m_vdp(*this, "gp9001") + , m_oki(*this, "oki") + , m_screen(*this, "screen") + , m_palette(*this, "palette") + { } + + void kbash(machine_config &config) ATTR_COLD; + +protected: + virtual void video_start() override ATTR_COLD; + + void kbash_68k_mem(address_map &map) ATTR_COLD; + void kbash_v25_mem(address_map &map) ATTR_COLD; + + void kbash_oki_bankswitch_w(u8 data); + + u32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + void screen_vblank(int state); + + u8 shared_ram_r(offs_t offset) { return m_shared_ram[offset]; } + void shared_ram_w(offs_t offset, u8 data) { m_shared_ram[offset] = data; } + + optional_shared_ptr m_shared_ram; // 8 bit RAM shared between 68K and sound CPU + + required_device m_maincpu; + optional_device m_audiocpu; + required_device m_vdp; + required_device m_oki; + required_device m_screen; + required_device m_palette; + bitmap_ind8 m_custom_priority_bitmap; +}; + +class kbash2_state : public kbash_state +{ +public: + kbash2_state(const machine_config &mconfig, device_type type, const char *tag) + : kbash_state(mconfig, type, tag) + , m_musicoki(*this, "musicoki") + { } + + void kbash2(machine_config &config) ATTR_COLD; + +protected: + void kbash2_68k_mem(address_map &map) ATTR_COLD; + + required_device m_musicoki; +}; + +void kbash_state::video_start() +{ + m_screen->register_screen_bitmap(m_custom_priority_bitmap); + m_vdp->custom_priority_bitmap = &m_custom_priority_bitmap; +} + +u32 kbash_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + bitmap.fill(0, cliprect); + m_custom_priority_bitmap.fill(0, cliprect); + m_vdp->render_vdp(bitmap, cliprect); + return 0; +} + +void kbash_state::screen_vblank(int state) +{ + if (state) // rising edge + { + m_vdp->screen_eof(); + } +} + + + +void kbash_state::kbash_oki_bankswitch_w(u8 data) +{ + m_oki->set_rom_bank(data & 1); +} + + +static INPUT_PORTS_START( base ) + PORT_START("IN1") + TOAPLAN_JOY_UDLR_3_BUTTONS( 1 ) + + PORT_START("IN2") + TOAPLAN_JOY_UDLR_3_BUTTONS( 2 ) + + PORT_START("SYS") + PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_SERVICE1 ) + PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_TILT ) + TOAPLAN_TEST_SWITCH( 0x04, IP_ACTIVE_HIGH ) + PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_COIN1 ) + PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_COIN2 ) + PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_START1 ) + PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_START2 ) + PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_UNKNOWN ) + + PORT_START("DSWA") + TOAPLAN_MACHINE_NO_COCKTAIL_LOC(SW1) + // Coinage on bit mask 0x00f0 + PORT_BIT( 0x00f0, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // Modified below + + PORT_START("DSWB") + TOAPLAN_DIFFICULTY_LOC(SW2) + // Per-game features on bit mask 0x00fc + PORT_BIT( 0x00fc, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // Modified below +INPUT_PORTS_END + + +static INPUT_PORTS_START( kbash ) + PORT_INCLUDE( base ) + + PORT_MODIFY("DSWA") + PORT_DIPNAME( 0x0001, 0x0000, DEF_STR( Continue_Price ) ) PORT_DIPLOCATION("SW1:!1") + PORT_DIPSETTING( 0x0000, DEF_STR( Normal ) ) + PORT_DIPSETTING( 0x0001, "Discount" ) + // Various features on bit mask 0x000e - see above + TOAPLAN_COINAGE_DUAL_LOC( JMPR, 0x70, 0x20, SW1 ) + + PORT_MODIFY("DSWB") + // Difficulty on bit mask 0x0003 - see above + PORT_DIPNAME( 0x000c, 0x0000, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW2:!3,!4") + PORT_DIPSETTING( 0x000c, DEF_STR( None ) ) + PORT_DIPSETTING( 0x0008, "200k only" ) + PORT_DIPSETTING( 0x0004, "100k only" ) + PORT_DIPSETTING( 0x0000, "100k and 400k" ) + PORT_DIPNAME( 0x0030, 0x0000, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:!5,!6") + PORT_DIPSETTING( 0x0030, "1" ) + PORT_DIPSETTING( 0x0000, "2" ) + PORT_DIPSETTING( 0x0020, "3" ) + PORT_DIPSETTING( 0x0010, "4" ) + PORT_DIPNAME( 0x0040, 0x0000, "Invulnerability (Cheat)" ) PORT_DIPLOCATION("SW2:!7") + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0040, DEF_STR( On ) ) + PORT_DIPNAME( 0x0080, 0x0000, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("SW2:!8") + PORT_DIPSETTING( 0x0080, DEF_STR( No ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( Yes ) ) + + PORT_START("JMPR") + PORT_CONFNAME( 0x00f0, 0x0020, DEF_STR( Region ) ) //PORT_CONFLOCATION("JP:!4,!3,!2,!1") + PORT_CONFSETTING( 0x0020, "Europe, USA (Atari Games)" ) // European coinage + PORT_CONFSETTING( 0x0010, "USA, Europe (Atari Games)" ) + PORT_CONFSETTING( 0x0000, DEF_STR( Japan ) ) + PORT_CONFSETTING( 0x0030, DEF_STR( Korea ) ) + PORT_CONFSETTING( 0x0040, DEF_STR( Hong_Kong ) ) + PORT_CONFSETTING( 0x0050, DEF_STR( Taiwan ) ) + PORT_CONFSETTING( 0x0060, DEF_STR( Southeast_Asia ) ) // Service Mode wrongly shows European coinage +// PORT_CONFSETTING( 0x0070, DEF_STR( Unused ) ) +// PORT_CONFSETTING( 0x0080, DEF_STR( Unused ) ) + PORT_CONFSETTING( 0x0090, DEF_STR( USA ) ) + PORT_CONFSETTING( 0x00a0, DEF_STR( Europe ) ) // European coinage +// PORT_CONFSETTING( 0x00b0, DEF_STR( Unused ) ) +// PORT_CONFSETTING( 0x00c0, DEF_STR( Unused ) ) +// PORT_CONFSETTING( 0x00d0, DEF_STR( Unused ) ) +// PORT_CONFSETTING( 0x00e0, DEF_STR( Unused ) ) // Service Mode wrongly shows European coinage +// PORT_CONFSETTING( 0x00f0, DEF_STR( Unused ) ) +INPUT_PORTS_END + +static INPUT_PORTS_START( kbashk ) + PORT_INCLUDE( kbash ) + + PORT_MODIFY("JMPR") + PORT_CONFNAME( 0x00f0, 0x0000, DEF_STR( Region ) ) //PORT_CONFLOCATION("JP:!4,!3,!2,!1") + PORT_CONFSETTING( 0x0000, "Japan (Taito license)" ) // Taito license + PORT_CONFSETTING( 0x0010, DEF_STR( Unused ) ) + PORT_CONFSETTING( 0x0020, DEF_STR( Unused ) ) + PORT_CONFSETTING( 0x0030, DEF_STR( Korea ) ) + PORT_CONFSETTING( 0x0040, DEF_STR( Hong_Kong ) ) + PORT_CONFSETTING( 0x0050, DEF_STR( Taiwan ) ) + PORT_CONFSETTING( 0x0060, DEF_STR( Southeast_Asia ) ) + PORT_CONFSETTING( 0x0070, DEF_STR( Unused ) ) + PORT_CONFSETTING( 0x0080, DEF_STR( Japan ) ) // no Taito license + PORT_CONFSETTING( 0x0090, DEF_STR( Unused ) ) + PORT_CONFSETTING( 0x00a0, DEF_STR( Unused ) ) + PORT_CONFSETTING( 0x00b0, DEF_STR( Korea ) ) + PORT_CONFSETTING( 0x00c0, DEF_STR( Hong_Kong )) + PORT_CONFSETTING( 0x00d0, DEF_STR( Taiwan )) + PORT_CONFSETTING( 0x00e0, DEF_STR( Southeast_Asia )) + PORT_CONFSETTING( 0x00f0, DEF_STR( Unused ) ) +INPUT_PORTS_END + +static INPUT_PORTS_START( kbash2 ) + PORT_INCLUDE( kbash ) + + PORT_MODIFY("DSWA") + TOAPLAN_COINAGE_DUAL_LOC( JMPR, 0x07, 0x02, SW1 ) + + PORT_MODIFY("JMPR") + PORT_CONFNAME( 0x000f, 0x0006, DEF_STR( Region ) ) //PORT_CONFLOCATION("JP:!4,!3,!2,!1") + PORT_CONFSETTING( 0x0000, "Japan (Taito Corp.)" ) +// PORT_CONFSETTING( 0x0001, DEF_STR( Unused ) ) +// PORT_CONFSETTING( 0x0002, DEF_STR( Unused ) ) // European coinage + PORT_CONFSETTING( 0x0003, "Korea (Unite Trading)" ) + PORT_CONFSETTING( 0x0004, DEF_STR( Hong_Kong ) ) + PORT_CONFSETTING( 0x0005, DEF_STR( Taiwan ) ) + PORT_CONFSETTING( 0x0006, "Southeast Asia (Charterfield)" ) // Service Mode wrongly shows European coinage +// PORT_CONFSETTING( 0x0007, DEF_STR( Unused ) ) + PORT_CONFSETTING( 0x0008, DEF_STR( Japan ) ) +// PORT_CONFSETTING( 0x0009, DEF_STR( Unused ) ) +// PORT_CONFSETTING( 0x000a, DEF_STR( Unused ) ) // European coinage + PORT_CONFSETTING( 0x000b, DEF_STR( Korea ) ) +// PORT_CONFSETTING( 0x000c, DEF_STR( Hong_Kong ) ) +// PORT_CONFSETTING( 0x000d, DEF_STR( Taiwan ) ) + PORT_CONFSETTING( 0x000e, DEF_STR( Southeast_Asia ) ) // Service Mode wrongly shows European coinage +// PORT_CONFSETTING( 0x000f, DEF_STR( Unused ) ) + PORT_BIT( 0x00f0, IP_ACTIVE_HIGH, IPT_UNKNOWN ) +INPUT_PORTS_END + + + +void kbash_state::kbash_68k_mem(address_map &map) +{ + map(0x000000, 0x07ffff).rom(); + map(0x100000, 0x103fff).ram(); + map(0x200000, 0x200fff).rw(FUNC(kbash_state::shared_ram_r), FUNC(kbash_state::shared_ram_w)).umask16(0x00ff); + map(0x208010, 0x208011).portr("IN1"); + map(0x208014, 0x208015).portr("IN2"); + map(0x208018, 0x208019).portr("SYS"); + map(0x20801d, 0x20801d).w("coincounter", FUNC(toaplan_coincounter_device::coin_w)); + map(0x300000, 0x30000d).rw(m_vdp, FUNC(gp9001vdp_device::read), FUNC(gp9001vdp_device::write)); + map(0x400000, 0x400fff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); + map(0x700000, 0x700001).r(m_vdp, FUNC(gp9001vdp_device::vdpcount_r)); // test bit 8 +} + + +void kbash2_state::kbash2_68k_mem(address_map &map) +{ + map(0x000000, 0x07ffff).rom(); + map(0x100000, 0x103fff).ram(); + map(0x104000, 0x10401f).ram(); // Sound related? + map(0x200000, 0x200001).noprw(); // Left over from original code - Sound Number write, Status read + map(0x200002, 0x200003).nopw(); // Left over from original code - Reset Sound + map(0x200004, 0x200005).portr("DSWA"); + map(0x200008, 0x200009).portr("DSWB"); + map(0x20000c, 0x20000d).portr("JMPR"); + map(0x200010, 0x200011).portr("IN1"); + map(0x200014, 0x200015).portr("IN2"); + map(0x200018, 0x200019).portr("SYS"); + map(0x200021, 0x200021).rw(m_musicoki, FUNC(okim6295_device::read), FUNC(okim6295_device::write)); + map(0x200025, 0x200025).rw(m_oki, FUNC(okim6295_device::read), FUNC(okim6295_device::write)); + map(0x200029, 0x200029).w(FUNC(kbash2_state::kbash_oki_bankswitch_w)); + map(0x20002c, 0x20002d).r(m_vdp, FUNC(gp9001vdp_device::vdpcount_r)); + map(0x300000, 0x30000d).rw(m_vdp, FUNC(gp9001vdp_device::read), FUNC(gp9001vdp_device::write)); + map(0x400000, 0x400fff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); +} + +void kbash_state::kbash_v25_mem(address_map &map) +{ + map(0x00000, 0x007ff).ram().share(m_shared_ram); + map(0x04000, 0x04001).rw("ymsnd", FUNC(ym2151_device::read), FUNC(ym2151_device::write)); + map(0x04002, 0x04002).rw(m_oki, FUNC(okim6295_device::read), FUNC(okim6295_device::write)); + map(0x80000, 0x87fff).mirror(0x78000).rom().region("audiocpu", 0); +} + + +void kbash_state::kbash(machine_config &config) +{ + /* basic machine hardware */ + M68000(config, m_maincpu, 16_MHz_XTAL); /* 16MHz Oscillator */ + m_maincpu->set_addrmap(AS_PROGRAM, &kbash_state::kbash_68k_mem); + m_maincpu->reset_cb().set_inputline(m_audiocpu, INPUT_LINE_RESET); + + /* ROM based v25 */ + v25_device &audiocpu(V25(config, m_audiocpu, 16_MHz_XTAL)); /* NEC V25 type Toaplan marked CPU ??? */ + audiocpu.set_addrmap(AS_PROGRAM, &kbash_state::kbash_v25_mem); + audiocpu.set_decryption_table(toaplan_v25_tables::nitro_decryption_table); + audiocpu.pt_in_cb().set_ioport("DSWA").exor(0xff); + audiocpu.p0_in_cb().set_ioport("DSWB").exor(0xff); + audiocpu.p1_in_cb().set_ioport("JMPR").exor(0xff); + audiocpu.p2_out_cb().set_nop(); // bit 0 is FAULT according to kbash schematic + + TOAPLAN_COINCOUNTER(config, "coincounter", 0); + + /* video hardware */ + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_video_attributes(VIDEO_UPDATE_BEFORE_VBLANK); + m_screen->set_raw(27_MHz_XTAL/4, 432, 0, 320, 262, 0, 240); + m_screen->set_screen_update(FUNC(kbash_state::screen_update)); + m_screen->screen_vblank().set(FUNC(kbash_state::screen_vblank)); + m_screen->set_palette(m_palette); + + PALETTE(config, m_palette).set_format(palette_device::xBGR_555, gp9001vdp_device::VDP_PALETTE_LENGTH); + + GP9001_VDP(config, m_vdp, 27_MHz_XTAL); + m_vdp->set_palette(m_palette); + m_vdp->vint_out_cb().set_inputline(m_maincpu, M68K_IRQ_4); + + /* sound hardware */ + SPEAKER(config, "mono").front_center(); + + YM2151(config, "ymsnd", 27_MHz_XTAL/8).add_route(ALL_OUTPUTS, "mono", 0.5); + + OKIM6295(config, m_oki, 32_MHz_XTAL/32, okim6295_device::PIN7_HIGH); + m_oki->add_route(ALL_OUTPUTS, "mono", 0.5); +} + + +void kbash2_state::kbash2(machine_config &config) +{ + /* basic machine hardware */ + M68000(config, m_maincpu, 16_MHz_XTAL); /* 16MHz Oscillator */ + m_maincpu->set_addrmap(AS_PROGRAM, &kbash2_state::kbash2_68k_mem); + + /* video hardware */ + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_video_attributes(VIDEO_UPDATE_BEFORE_VBLANK); + m_screen->set_raw(27_MHz_XTAL/4, 432, 0, 320, 262, 0, 240); + m_screen->set_screen_update(FUNC(kbash2_state::screen_update)); + m_screen->screen_vblank().set(FUNC(kbash2_state::screen_vblank)); + m_screen->set_palette(m_palette); + + PALETTE(config, m_palette).set_format(palette_device::xBGR_555, gp9001vdp_device::VDP_PALETTE_LENGTH); + + GP9001_VDP(config, m_vdp, 27_MHz_XTAL); + m_vdp->set_palette(m_palette); + m_vdp->vint_out_cb().set_inputline(m_maincpu, M68K_IRQ_4); + + /* sound hardware */ + SPEAKER(config, "mono").front_center(); + + OKIM6295(config, m_oki, 16_MHz_XTAL/16, okim6295_device::PIN7_HIGH); + m_oki->add_route(ALL_OUTPUTS, "mono", 0.5); + + OKIM6295(config, m_musicoki, 16_MHz_XTAL/16, okim6295_device::PIN7_HIGH); + m_musicoki->add_route(ALL_OUTPUTS, "mono", 0.5); +} + + +ROM_START( kbash ) + ROM_REGION( 0x080000, "maincpu", 0 ) /* Main 68K code */ + ROM_LOAD16_WORD_SWAP( "tp023_01.bin", 0x000000, 0x080000, CRC(2965f81d) SHA1(46f2df30fa92c80ba5a37f75e756424e15534784) ) + + /* Secondary CPU is a Toaplan marked chip, (TS-004-Dash TOA PLAN) */ + /* It's a NEC V25 (PLCC94) (encrypted) */ + + ROM_REGION( 0x8000, "audiocpu", 0 ) /* Sound CPU code */ + ROM_LOAD( "tp023_02.bin", 0x0000, 0x8000, CRC(4cd882a1) SHA1(7199a5c384918f775f0815e09c46b2a58141814a) ) + + ROM_REGION( 0x800000, "gp9001", 0 ) + ROM_LOAD( "tp023_3.bin", 0x000000, 0x200000, CRC(32ad508b) SHA1(e473489beaf649d3e5236770eb043327e309850c) ) + ROM_LOAD( "tp023_5.bin", 0x200000, 0x200000, CRC(b84c90eb) SHA1(17a1531d884d9a9696d1b25d65f9155f02396e0e) ) + ROM_LOAD( "tp023_4.bin", 0x400000, 0x200000, CRC(e493c077) SHA1(0edcfb70483ad07206695d9283031b85cd198a36) ) + ROM_LOAD( "tp023_6.bin", 0x600000, 0x200000, CRC(9084b50a) SHA1(03b58278619524d2f09a4b1c152d5e057e792a56) ) + + ROM_REGION( 0x40000, "oki", 0 ) /* ADPCM Samples */ + ROM_LOAD( "tp023_7.bin", 0x00000, 0x40000, CRC(3732318f) SHA1(f0768459f5ad2dee53d408a0a5ae3a314864e667) ) +ROM_END + +ROM_START( kbashk ) + ROM_REGION( 0x080000, "maincpu", 0 ) /* Main 68K code */ + ROM_LOAD16_WORD_SWAP( "tp023_01.u52", 0x000000, 0x080000, CRC(099aefbc) SHA1(8daa0deffe221e1bb5a8744ced18c23ad319ffd3) ) // same label as parent? + + /* Secondary CPU is a Toaplan marked chip, (TS-004-Dash TOA PLAN) */ + /* It's a NEC V25 (PLCC94) (encrypted) */ + + ROM_REGION( 0x8000, "audiocpu", 0 ) /* Sound CPU code */ + ROM_LOAD( "tp023_02.bin", 0x0000, 0x8000, CRC(4cd882a1) SHA1(7199a5c384918f775f0815e09c46b2a58141814a) ) + + ROM_REGION( 0x800000, "gp9001", 0 ) + ROM_LOAD( "tp023_3.bin", 0x000000, 0x200000, CRC(32ad508b) SHA1(e473489beaf649d3e5236770eb043327e309850c) ) + ROM_LOAD( "tp023_5.bin", 0x200000, 0x200000, CRC(b84c90eb) SHA1(17a1531d884d9a9696d1b25d65f9155f02396e0e) ) + ROM_LOAD( "tp023_4.bin", 0x400000, 0x200000, CRC(e493c077) SHA1(0edcfb70483ad07206695d9283031b85cd198a36) ) + ROM_LOAD( "tp023_6.bin", 0x600000, 0x200000, CRC(9084b50a) SHA1(03b58278619524d2f09a4b1c152d5e057e792a56) ) + + ROM_REGION( 0x40000, "oki", 0 ) /* ADPCM Samples */ + ROM_LOAD( "tp023_7.bin", 0x00000, 0x40000, CRC(3732318f) SHA1(f0768459f5ad2dee53d408a0a5ae3a314864e667) ) +ROM_END + +// all labels handwritten. Given the AOU on the audio ROM, maybe a prototype destined to be showed there? +// GFX ROMs are on 4 riser boards. They are smaller but contain the same data as the final version. +// Only different ROMs are the main and audio CPU ones +ROM_START( kbashp ) + ROM_REGION( 0x080000, "maincpu", 0 ) + ROM_LOAD16_WORD_SWAP( "2-19.u52", 0x000000, 0x080000, CRC(60dfdfec) SHA1(ca61433c8f7b1b765a699c375c946f113beeccc4) ) // actually 2/19 + + /* Secondary CPU is a Toaplan marked chip, (NITRO TOA PLAN 509) */ + /* It's a NEC V25 (PLCC94) (encrypted) */ + + ROM_REGION( 0x8000, "audiocpu", 0 ) + ROM_LOAD( "aou-nb-sound.u34", 0x0000, 0x8000, CRC(26ba8fb1) SHA1(4259c4704f0fea0c8befa2e60a0838280b23a507) ) + + ROM_REGION( 0x800000, "gp9001", 0 ) + ROM_LOAD( "0.u1", 0x000000, 0x080000, CRC(1b87ffa5) SHA1(fbd5ac9e9635c1f5b1b896a3d504b827c0a99679) ) + ROM_LOAD( "2.u2", 0x080000, 0x080000, CRC(a411457e) SHA1(6b515e6524aa4fb1785d99556fefb0434368de84) ) + ROM_LOAD( "4.u3", 0x100000, 0x080000, CRC(631f770d) SHA1(0f0c11bc5549ed68d20dfc6ae51c3caec65aab88) ) + ROM_LOAD( "6.u4", 0x180000, 0x080000, CRC(5a46d262) SHA1(56d5180196b5acf76b700e627878998e88a21f3c) ) + ROM_LOAD( "8.u1", 0x200000, 0x080000, CRC(11b1c986) SHA1(05260c6cc5ab4239b52549e0dcda8853fc1fcd3a) ) + ROM_LOAD( "a.u2", 0x280000, 0x080000, CRC(4c4b47ce) SHA1(a41a27ac96bd9eb57bc4bd8b6592b70e86ad16d3) ) + ROM_LOAD( "c.u3", 0x300000, 0x080000, CRC(1ccc6a19) SHA1(d5735c2f075d81018021ec9e8642104227b67ace) ) + ROM_LOAD( "e.u4", 0x380000, 0x080000, CRC(731ad154) SHA1(78efce53000d170098b57342641299aacb7a82aa) ) + ROM_LOAD( "3.u1", 0x400000, 0x080000, CRC(7fbe0452) SHA1(c9b8c0d7126382fcdf8b5fa9a4466292954c88f7) ) + ROM_LOAD( "1.u2", 0x480000, 0x080000, CRC(6cd94e90) SHA1(9957ad69f8e80370dbf2cd863d0646241236f6b4) ) + ROM_LOAD( "5.u3", 0x500000, 0x080000, CRC(9cb4884e) SHA1(f596902b7740de4c262b4b18ac17eccca566ea77) ) + ROM_LOAD( "7.u4", 0x580000, 0x080000, CRC(53c2e0b6) SHA1(ee1128ad41ae3c68ef32d4211dd5205a9a5bb216) ) + ROM_LOAD( "g.u1", 0x600000, 0x080000, CRC(a63c795c) SHA1(30d3bb29cd73b31e233229f9304e3b87feaf01f3) ) + ROM_LOAD( "b.u2", 0x680000, 0x080000, CRC(32f8c39b) SHA1(a9029910c0b4fc3693081056a0afb9bcf9c0e699) ) + ROM_LOAD( "d.u3", 0x700000, 0x080000, CRC(40ac17d5) SHA1(140c67cf86ce545469fbe899b1f38c3a070908c9) ) + ROM_LOAD( "f.u4", 0x780000, 0x080000, CRC(2ca4eb83) SHA1(0d7c4242a82aba49cafd96ee5b051918d1b23b08) ) + + ROM_REGION( 0x40000, "oki", 0 ) + ROM_LOAD( "2m-nb-pcm.u40", 0x00000, 0x40000, CRC(3732318f) SHA1(f0768459f5ad2dee53d408a0a5ae3a314864e667) ) +ROM_END + +/* +Knuckle Bash 2 +This is a hacked version of Knuckle Bash on bootleg/Korean/Chinese +hardware showing (C)Toaplan 1999 Licensed to Charterfield + +PCB Layout +---------- + +|--------------------------------------------| +|UPC1241 EPROM MECAT-S | +| LM324 | +| M6295 M6295 | +| PAL 62256 M5M51008 | +| 62256 MECAT-M M5M51008 | +| 6116 M5M51008 | +|J 6116 14.31818MHz M5M51008 | +|A 68000 | +|M 16MHz | +|M PAL | +|A PAL | +| |-------| | +| |ACTEL | PAL | +| |A40MX04| PAL | +| | | | +| DSW1 |-------| 050917-10 | +| |ACTEL | | +| DSW2 |A40MX04| MECAT-12 | +|62256 | | | +|62256 |-------| MECAT-34 | +|--------------------------------------------| +Notes: + 68000 clock 16.000MHz + M6295 clock 1.000MHz [16/16]. Sample rate (Hz) 16000000/16/132 + M5M51008 - Mitsubishi M5M51008 128k x8 SRAM (SOP32) + 62256 - 32k x8 SRAM + 6116 - 2k x8 SRAM + VSync 60Hz + HSync 15.68kHz +*/ + +ROM_START( kbash2 ) + ROM_REGION( 0x80000, "maincpu", 0 ) /* Main 68K code */ + ROM_LOAD16_WORD_SWAP( "mecat-m", 0x000000, 0x80000, CRC(bd2263c6) SHA1(eb794c0fc9c1fb4337114d48149283d42d22e4b3) ) + + ROM_REGION( 0x800000, "gp9001", 0 ) + ROM_LOAD( "mecat-34", 0x000000, 0x400000, CRC(6be7b37e) SHA1(13160ad0712fee932bb98cc226e651895b19228a) ) + ROM_LOAD( "mecat-12", 0x400000, 0x400000, CRC(49e46b1f) SHA1(d12b12696a8473eb34f3cd247ab060289a6c0e9c) ) + + ROM_REGION( 0x80000, "oki", 0 ) /* ADPCM Music */ + ROM_LOAD( "mecat-s", 0x00000, 0x80000, CRC(3eb7adf4) SHA1(b0e6e99726b854858bd0e69eb77f12b9664b35e6) ) + + ROM_REGION( 0x40000, "musicoki", 0 ) /* ADPCM Samples */ + ROM_LOAD( "eprom", 0x00000, 0x40000, CRC(31115cb9) SHA1(c79ea01bd865e2fc3aaab3ff05483c8fd27e5c98) ) + + ROM_REGION( 0x10000, "user1", 0 ) /* ??? Some sort of table - same as in pipibibi*/ + ROM_LOAD( "050917-10", 0x0000, 0x10000, CRC(6b213183) SHA1(599c59d155d11edb151bfaed1d24ef964462a447) ) +ROM_END + +} // anonymous namespace + +GAME( 1993, kbash, 0, kbash, kbash, kbash_state, empty_init, ROT0, "Toaplan / Atari", "Knuckle Bash", MACHINE_SUPPORTS_SAVE ) // Atari license shown for some regions. +GAME( 1993, kbashk, kbash, kbash, kbashk, kbash_state, empty_init, ROT0, "Toaplan / Taito", "Knuckle Bash (Korean PCB)", MACHINE_SUPPORTS_SAVE ) // Japan region has optional Taito license, maybe the original Japan release? +GAME( 1993, kbashp, kbash, kbash, kbash, kbash_state, empty_init, ROT0, "Toaplan / Taito", "Knuckle Bash (location test)", MACHINE_SUPPORTS_SAVE ) + +GAME( 1999, kbash2, 0, kbash2, kbash2, kbash2_state, empty_init, ROT0, "bootleg", "Knuckle Bash 2 (bootleg)", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/toaplan/mjsister.cpp b/src/mame/toaplan/mjsister.cpp index 92365c88241..f4a43512af7 100644 --- a/src/mame/toaplan/mjsister.cpp +++ b/src/mame/toaplan/mjsister.cpp @@ -9,11 +9,13 @@ *****************************************************************************/ #include "emu.h" + #include "cpu/z80/z80.h" #include "machine/74259.h" #include "video/mc6845.h" #include "sound/ay8910.h" #include "sound/dac.h" + #include "emupal.h" #include "screen.h" #include "speaker.h" @@ -21,9 +23,6 @@ namespace { -#define MCLK 12000000 - - class mjsister_state : public driver_device { public: @@ -34,43 +33,53 @@ class mjsister_state : public driver_device m_palette(*this, "palette"), m_crtc(*this, "crtc"), m_dac(*this, "dac"), + m_io_key(*this, "KEY%u", 0U), + m_samples_region(*this, "samples"), + m_vram(*this, "vram", 0x10000, ENDIANNESS_LITTLE), m_rombank(*this, "rombank"), m_vrambank(*this, "vrambank") { } - void mjsister(machine_config &config); + void mjsister(machine_config &config) ATTR_COLD; protected: virtual void machine_start() override ATTR_COLD; virtual void machine_reset() override ATTR_COLD; private: - /* video-related */ - bool m_video_enable; - int m_colorbank; - - /* misc */ - int m_input_sel1; - int m_input_sel2; - bool m_irq_enable; - - uint32_t m_dac_adr; - uint32_t m_dac_bank; - uint32_t m_dac_adr_s; - uint32_t m_dac_adr_e; - uint32_t m_dac_busy; + static constexpr XTAL MCLK = XTAL(12'000'000); - /* devices */ + // devices required_device m_maincpu; required_device_array m_mainlatch; required_device m_palette; required_device m_crtc; required_device m_dac; + required_ioport_array<6> m_io_key; - /* memory */ + // memory + required_region_ptr m_samples_region; + memory_share_creator m_vram; required_memory_bank m_rombank; required_memory_bank m_vrambank; - std::unique_ptr m_vram; + + // video-related + bool m_video_enable; + uint8_t m_colorbank; + + // misc + uint8_t m_input_sel1; + uint8_t m_input_sel2; + bool m_irq_enable; + + uint32_t m_dac_adr; + uint32_t m_dac_bank; + uint32_t m_dac_adr_s; + uint32_t m_dac_adr_e; + bool m_dac_busy; + + emu_timer *m_dac_timer; + void dac_adr_s_w(uint8_t data); void dac_adr_e_w(uint8_t data); void rombank_w(int state); @@ -87,12 +96,10 @@ class mjsister_state : public driver_device INTERRUPT_GEN_MEMBER(interrupt); uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - void mjsister_io_map(address_map &map) ATTR_COLD; - void mjsister_map(address_map &map) ATTR_COLD; - - emu_timer *m_dac_timer; - MC6845_UPDATE_ROW(crtc_update_row); + + void io_map(address_map &map) ATTR_COLD; + void main_map(address_map &map) ATTR_COLD; }; @@ -131,16 +138,16 @@ MC6845_UPDATE_ROW( mjsister_state::crtc_update_row ) } // background layer - uint8_t data_bg = m_vram[0x400 + ((ma << 3) | (ra << 7) | i)]; + const uint8_t data_bg = m_vram[0x400 + ((ma << 3) | (ra << 7) | i)]; bitmap.pix(y, x1) = pen[m_colorbank << 5 | ((data_bg & 0x0f) >> 0)]; bitmap.pix(y, x2) = pen[m_colorbank << 5 | ((data_bg & 0xf0) >> 4)]; // foreground layer - uint8_t data_fg = m_vram[0x8000 | (0x400 + ((ma << 3) | (ra << 7) | i))]; + const uint8_t data_fg = m_vram[0x8000 | (0x400 + ((ma << 3) | (ra << 7) | i))]; - uint8_t c1 = ((data_fg & 0x0f) >> 0); - uint8_t c2 = ((data_fg & 0xf0) >> 4); + const uint8_t c1 = ((data_fg & 0x0f) >> 0); + const uint8_t c2 = ((data_fg & 0xf0) >> 4); // 0 is transparent if (c1) bitmap.pix(y, x1) = pen[m_colorbank << 5 | 0x10 | c1]; @@ -157,14 +164,12 @@ MC6845_UPDATE_ROW( mjsister_state::crtc_update_row ) TIMER_CALLBACK_MEMBER(mjsister_state::dac_callback) { - uint8_t *DACROM = memregion("samples")->base(); - - m_dac->write(DACROM[(m_dac_bank * 0x10000 + m_dac_adr++) & 0x1ffff]); + m_dac->write(m_samples_region[(m_dac_bank * 0x10000 + m_dac_adr++) & 0x1ffff]); if (((m_dac_adr & 0xff00 ) >> 8) != m_dac_adr_e) m_dac_timer->adjust(attotime::from_hz(MCLK) * 1024); else - m_dac_busy = 0; + m_dac_busy = false; } void mjsister_state::dac_adr_s_w(uint8_t data) @@ -177,10 +182,10 @@ void mjsister_state::dac_adr_e_w(uint8_t data) m_dac_adr_e = data; m_dac_adr = m_dac_adr_s << 8; - if (m_dac_busy == 0) + if (!m_dac_busy) m_dac_timer->adjust(attotime::zero); - m_dac_busy = 1; + m_dac_busy = true; } void mjsister_state::rombank_w(int state) @@ -232,16 +237,14 @@ void mjsister_state::input_sel2_w(uint8_t data) uint8_t mjsister_state::keys_r() { - int p, i, ret = 0; - static const char *const keynames[] = { "KEY0", "KEY1", "KEY2", "KEY3", "KEY4", "KEY5" }; - - p = m_input_sel1 & 0x3f; + uint8_t ret = 0; + const uint8_t p = m_input_sel1 & 0x3f; // p |= ((m_input_sel2 & 8) << 4) | ((m_input_sel2 & 0x20) << 1); - for (i = 0; i < 6; i++) + for (int i = 0; i < 6; i++) { if (BIT(p, i)) - ret |= ioport(keynames[i])->read(); + ret |= m_io_key[i]->read(); } return ret; @@ -253,14 +256,14 @@ uint8_t mjsister_state::keys_r() * *************************************/ -void mjsister_state::mjsister_map(address_map &map) +void mjsister_state::main_map(address_map &map) { - map(0x0000, 0x77ff).rom(); + map(0x0000, 0x77ff).rom().region("maincpu", 0); map(0x7800, 0x7fff).ram(); - map(0x8000, 0xffff).bankr("rombank").bankw("vrambank"); + map(0x8000, 0xffff).bankr(m_rombank).bankw(m_vrambank); } -void mjsister_state::mjsister_io_map(address_map &map) +void mjsister_state::io_map(address_map &map) { map.global_mask(0xff); map(0x00, 0x00).w(m_crtc, FUNC(hd6845s_device::address_w)); @@ -270,8 +273,8 @@ void mjsister_state::mjsister_io_map(address_map &map) map(0x12, 0x12).w("aysnd", FUNC(ay8910_device::data_w)); map(0x20, 0x20).r(FUNC(mjsister_state::keys_r)); map(0x21, 0x21).portr("IN0"); - map(0x30, 0x30).w("mainlatch1", FUNC(ls259_device::write_nibble_d0)); - map(0x31, 0x31).w("mainlatch2", FUNC(ls259_device::write_nibble_d0)); + map(0x30, 0x30).w(m_mainlatch[0], FUNC(ls259_device::write_nibble_d0)); + map(0x31, 0x31).w(m_mainlatch[1], FUNC(ls259_device::write_nibble_d0)); map(0x32, 0x32).w(FUNC(mjsister_state::input_sel1_w)); map(0x33, 0x33).w(FUNC(mjsister_state::input_sel2_w)); map(0x34, 0x34).w(FUNC(mjsister_state::dac_adr_s_w)); @@ -310,7 +313,7 @@ static INPUT_PORTS_START( mjsister ) PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_START("DSW2") /* not on PCB */ + PORT_START("DSW2") // not on PCB PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_START("IN0") @@ -381,15 +384,14 @@ INPUT_PORTS_END void mjsister_state::machine_start() { - uint8_t *ROM = memregion("maincpu")->base(); - m_rombank->configure_entries(0, 4, &ROM[0x10000], 0x8000); + m_rombank->configure_entries(0, 4, memregion("banked")->base(), 0x8000); - m_vram = make_unique_clear(0x10000); - m_vrambank->configure_entries(0, 2, m_vram.get(), 0x8000); + m_vrambank->configure_entries(0, 2, m_vram.target(), 0x8000); m_dac_timer = timer_alloc(FUNC(mjsister_state::dac_callback), this); - save_pointer(NAME(m_vram), 0x10000); + m_irq_enable = false; + save_item(NAME(m_dac_busy)); save_item(NAME(m_video_enable)); save_item(NAME(m_colorbank)); @@ -404,14 +406,14 @@ void mjsister_state::machine_start() void mjsister_state::machine_reset() { - m_dac_busy = 0; - m_video_enable = 0; + m_video_enable = false; m_input_sel1 = 0; m_input_sel2 = 0; m_dac_adr = 0; m_dac_bank = 0; m_dac_adr_s = 0; m_dac_adr_e = 0; + m_dac_busy = false; } INTERRUPT_GEN_MEMBER(mjsister_state::interrupt) @@ -422,10 +424,10 @@ INTERRUPT_GEN_MEMBER(mjsister_state::interrupt) void mjsister_state::mjsister(machine_config &config) { - /* basic machine hardware */ - Z80(config, m_maincpu, MCLK/2); /* 6.000 MHz */ - m_maincpu->set_addrmap(AS_PROGRAM, &mjsister_state::mjsister_map); - m_maincpu->set_addrmap(AS_IO, &mjsister_state::mjsister_io_map); + // basic machine hardware + Z80(config, m_maincpu, MCLK / 2); // 6.000 MHz + m_maincpu->set_addrmap(AS_PROGRAM, &mjsister_state::main_map); + m_maincpu->set_addrmap(AS_IO, &mjsister_state::io_map); m_maincpu->set_periodic_int(FUNC(mjsister_state::interrupt), attotime::from_hz(2*60)); LS259(config, m_mainlatch[0]); @@ -443,28 +445,28 @@ void mjsister_state::mjsister(machine_config &config) m_mainlatch[1]->q_out_cb<5>().set(FUNC(mjsister_state::dac_bank_w)); m_mainlatch[1]->q_out_cb<6>().set(FUNC(mjsister_state::rombank_w)); - /* video hardware */ + // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); - screen.set_raw(MCLK/2, 384, 0, 256, 268, 0, 240); // 6 MHz? + screen.set_raw(MCLK / 2, 384, 0, 256, 268, 0, 240); // 6 MHz? screen.set_screen_update(FUNC(mjsister_state::screen_update)); PALETTE(config, m_palette, palette_device::RGB_444_PROMS, "proms", 256); - HD6845S(config, m_crtc, MCLK/4); // 3 MHz? + HD6845S(config, m_crtc, MCLK / 4); // 3 MHz? m_crtc->set_screen("screen"); m_crtc->set_show_border_area(false); m_crtc->set_char_width(2); m_crtc->set_update_row_callback(FUNC(mjsister_state::crtc_update_row)); - /* sound hardware */ + // sound hardware SPEAKER(config, "speaker").front_center(); - ay8910_device &aysnd(AY8910(config, "aysnd", MCLK/8)); + ay8910_device &aysnd(AY8910(config, "aysnd", MCLK / 8)); aysnd.port_a_read_callback().set_ioport("DSW1"); aysnd.port_b_read_callback().set_ioport("DSW2"); aysnd.add_route(ALL_OUTPUTS, "speaker", 0.15); - DAC_8BIT_R2R(config, "dac", 0).add_route(ALL_OUTPUTS, "speaker", 0.5); // unknown DAC + DAC_8BIT_R2R(config, m_dac, 0).add_route(ALL_OUTPUTS, "speaker", 0.5); // unknown DAC } /************************************* @@ -474,16 +476,18 @@ void mjsister_state::mjsister(machine_config &config) *************************************/ ROM_START( mjsister ) - ROM_REGION( 0x30000, "maincpu", 0 ) /* CPU */ + ROM_REGION( 0x08000, "maincpu", 0 ) // CPU ROM_LOAD( "ms00.bin", 0x00000, 0x08000, CRC(9468c33b) SHA1(63aecdcaa8493d58549dfd1d217743210cf953bc) ) - ROM_LOAD( "ms01t.bin", 0x10000, 0x10000, CRC(a7b6e530) SHA1(fda9bea214968a8814d2c43226b3b32316581050) ) /* banked */ - ROM_LOAD( "ms02t.bin", 0x20000, 0x10000, CRC(7752b5ba) SHA1(84dcf27a62eb290ba07c85af155897ec72f320a8) ) /* banked */ - ROM_REGION( 0x20000, "samples", 0 ) /* samples */ + ROM_REGION( 0x20000, "banked", 0 ) // banked at 0x8000 + ROM_LOAD( "ms01t.bin", 0x00000, 0x10000, CRC(a7b6e530) SHA1(fda9bea214968a8814d2c43226b3b32316581050) ) + ROM_LOAD( "ms02t.bin", 0x10000, 0x10000, CRC(7752b5ba) SHA1(84dcf27a62eb290ba07c85af155897ec72f320a8) ) + + ROM_REGION( 0x20000, "samples", 0 ) // samples ROM_LOAD( "ms03.bin", 0x00000, 0x10000, CRC(10a68e5e) SHA1(a0e2fa34c1c4f34642f65fbf17e9da9c2554a0c6) ) ROM_LOAD( "ms04.bin", 0x10000, 0x10000, CRC(641b09c1) SHA1(15cde906175bcb5190d36cc91cbef003ef91e425) ) - ROM_REGION( 0x00400, "proms", 0 ) /* color PROMs */ + ROM_REGION( 0x00400, "proms", 0 ) // color PROMs ROM_LOAD( "ms05.bpr", 0x0000, 0x0100, CRC(dd231a5f) SHA1(be008593ac8ba8f5a1dd5b188dc7dc4c03016805) ) // R ROM_LOAD( "ms06.bpr", 0x0100, 0x0100, CRC(df8e8852) SHA1(842a891440aef55a560d24c96f249618b9f4b97f) ) // G ROM_LOAD( "ms07.bpr", 0x0200, 0x0100, CRC(6cb3a735) SHA1(468ae3d40552dc2ec24f5f2988850093d73948a6) ) // B diff --git a/src/mame/toaplan/pipibibi.cpp b/src/mame/toaplan/pipibibi.cpp new file mode 100644 index 00000000000..5cf61098666 --- /dev/null +++ b/src/mame/toaplan/pipibibi.cpp @@ -0,0 +1,486 @@ +// license:BSD-3-Clause +// copyright-holders:Quench, Yochizo, David Haywood + +#include "emu.h" + +#include "gp9001.h" +#include "toaplan_coincounter.h" +#include "toaplipt.h" + +#include "cpu/m68000/m68000.h" +#include "cpu/z80/z80.h" +#include "sound/ymopm.h" +#include "sound/ymopl.h" + +#include "emupal.h" +#include "screen.h" +#include "speaker.h" +#include "tilemap.h" + +/* +* Name Board No Maker Game name +---------------------------------------------------------------------------- +pipibibs TP-025 Toaplan Pipi & Bibis / Whoopee!! (set 1) +pipibibsa TP-025 Toaplan Pipi & Bibis / Whoopee!! (set 2) +pipibibsp TP-025 Toaplan Pipi & Bibis / Whoopee!! (Prototype) +pipibibsbl bootleg Toaplan Pipi & Bibis / Whoopee!! (based of the prototype) + +TODO: + - move bootlegs to oneshot.cpp driver +*/ + +namespace { + +class pipibibi_state : public driver_device +{ +public: + pipibibi_state(const machine_config &mconfig, device_type type, const char *tag) + : driver_device(mconfig, type, tag) + , m_shared_ram(*this, "shared_ram") + , m_maincpu(*this, "maincpu") + , m_audiocpu(*this, "audiocpu") + , m_vdp(*this, "gp9001") + , m_screen(*this, "screen") + , m_palette(*this, "palette") + { } + + void pipibibs(machine_config &config) ATTR_COLD; + +protected: + virtual void video_start() override ATTR_COLD; + u32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + void screen_vblank(int state); + + u8 shared_ram_r(offs_t offset) { return m_shared_ram[offset]; } + void shared_ram_w(offs_t offset, u8 data) { m_shared_ram[offset] = data; } + + void pipibibs_68k_mem(address_map &map) ATTR_COLD; + void pipibibs_sound_z80_mem(address_map &map) ATTR_COLD; + + required_shared_ptr m_shared_ram; // 8 bit RAM shared between 68K and sound CPU + required_device m_maincpu; + required_device m_audiocpu; + required_device m_vdp; + required_device m_screen; + required_device m_palette; + bitmap_ind8 m_custom_priority_bitmap; +}; + +class pipibibi_bootleg_state : public pipibibi_state +{ +public: + pipibibi_bootleg_state(const machine_config &mconfig, device_type type, const char *tag) + : pipibibi_state(mconfig, type, tag) + { } + + void pipibibsbl(machine_config &config) ATTR_COLD; + + void init_pipibibsbl() ATTR_COLD; + +private: + void cpu_space_pipibibsbl_map(address_map &map) ATTR_COLD; + void pipibibi_bootleg_68k_mem(address_map &map) ATTR_COLD; +}; + +void pipibibi_state::video_start() +{ + m_screen->register_screen_bitmap(m_custom_priority_bitmap); + m_vdp->custom_priority_bitmap = &m_custom_priority_bitmap; +} + + +u32 pipibibi_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + bitmap.fill(0, cliprect); + m_custom_priority_bitmap.fill(0, cliprect); + m_vdp->render_vdp(bitmap, cliprect); + return 0; +} + +void pipibibi_state::screen_vblank(int state) +{ + if (state) // rising edge + { + m_vdp->screen_eof(); + } +} + + + +static INPUT_PORTS_START( base ) + PORT_START("IN1") + TOAPLAN_JOY_UDLR_2_BUTTONS( 1 ) + + PORT_START("IN2") + TOAPLAN_JOY_UDLR_2_BUTTONS( 2 ) + + PORT_START("SYS") + PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_SERVICE1 ) + PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_TILT ) + TOAPLAN_TEST_SWITCH( 0x04, IP_ACTIVE_HIGH ) + PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_COIN1 ) + PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_COIN2 ) + PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_START1 ) + PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_START2 ) + PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_UNKNOWN ) + + PORT_START("DSWA") + TOAPLAN_MACHINE_NO_COCKTAIL_LOC(SW1) + // Coinage on bit mask 0x00f0 + PORT_BIT( 0x00f0, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // Modified below + + PORT_START("DSWB") + TOAPLAN_DIFFICULTY_LOC(SW2) + // Per-game features on bit mask 0x00fc + PORT_BIT( 0x00fc, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // Modified below +INPUT_PORTS_END + +static INPUT_PORTS_START( pipibibs ) + PORT_INCLUDE( base ) + + PORT_MODIFY("DSWA") + // Various features on bit mask 0x000f - see above + TOAPLAN_COINAGE_DUAL_LOC( JMPR, 0x06, 0x06, SW1 ) + + PORT_MODIFY("DSWB") + // Difficulty on bit mask 0x0003 - see above + PORT_DIPNAME( 0x000c, 0x0000, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW2:!3,!4") + PORT_DIPSETTING( 0x000c, DEF_STR( None ) ) + PORT_DIPSETTING( 0x0008, "200k only" ) + PORT_DIPSETTING( 0x0000, "200k and every 300k" ) + PORT_DIPSETTING( 0x0004, "150k and every 200k" ) + PORT_DIPNAME( 0x0030, 0x0000, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:!5,!6") + PORT_DIPSETTING( 0x0030, "1" ) + PORT_DIPSETTING( 0x0020, "2" ) + PORT_DIPSETTING( 0x0000, "3" ) + PORT_DIPSETTING( 0x0010, "5" ) + PORT_DIPNAME( 0x0040, 0x0000, "Invulnerability (Cheat)" ) PORT_DIPLOCATION("SW2:!7") + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0040, DEF_STR( On ) ) + PORT_DIPNAME( 0x0080, 0x0000, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW2:!8") + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0080, DEF_STR( On ) ) + + PORT_START("JMPR") + PORT_CONFNAME( 0x0008, 0x0000, "Nudity" ) //PORT_CONFLOCATION("JP:!1") + PORT_CONFSETTING( 0x0008, DEF_STR( Low ) ) + PORT_CONFSETTING( 0x0000, "High, but censored" ) + PORT_CONFNAME( 0x0007, 0x0006, DEF_STR( Region ) ) //PORT_CONFLOCATION("JP:!4,!3,!2") + PORT_CONFSETTING( 0x0006, DEF_STR( Europe ) ) + PORT_CONFSETTING( 0x0004, DEF_STR( USA ) ) + PORT_CONFSETTING( 0x0000, DEF_STR( Japan ) ) + PORT_CONFSETTING( 0x0001, DEF_STR( Asia ) ) + PORT_CONFSETTING( 0x0002, "Hong Kong (Honest Trading Co.)" ) + PORT_CONFSETTING( 0x0003, DEF_STR( Taiwan ) ) + PORT_CONFSETTING( 0x0005, "USA (Romstar, Inc.)" ) + PORT_CONFSETTING( 0x0007, "Europe (Nova Apparate GMBH & Co.)" ) +INPUT_PORTS_END + +static INPUT_PORTS_START( pipibibsp ) + PORT_INCLUDE( pipibibs ) + + PORT_MODIFY("DSWA") + // Various features on bit mask 0x000d - see above + TOAPLAN_COINAGE_DUAL_LOC( JMPR, 0x80000, 0x80000, SW1 ) + + PORT_MODIFY("JMPR") + // Bit Mask 0x80000 is used here to signify European Coinage for MAME purposes - not read on the real board! + PORT_CONFNAME( 0x80007, 0x00002, DEF_STR( Region ) ) //PORT_CONFLOCATION("JP:!4,!3,!2,FAKE:!1") + PORT_CONFSETTING( 0x00002, DEF_STR( World ) ) + PORT_CONFSETTING( 0x80005, DEF_STR( Europe ) ) + PORT_CONFSETTING( 0x00004, DEF_STR( USA ) ) + PORT_CONFSETTING( 0x00000, "Japan (Ryouta Kikaku)" ) + PORT_CONFSETTING( 0x00001, "Hong Kong (Honest Trading Co.)" ) + PORT_CONFSETTING( 0x80006, "Spain & Portugal (APM Electronics S.A.)" ) + PORT_CONFSETTING( 0x00007, "World (Ryouta Kikaku)" ) +INPUT_PORTS_END + +static INPUT_PORTS_START( pipibibsbl ) + PORT_INCLUDE( pipibibs ) + + PORT_MODIFY("DSWA") + PORT_DIPNAME( 0x0002, 0x0000, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW1:!2") // In Test Mode, it shows as Normal/Invert Screen - HW doesn't support it + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0002, DEF_STR( On ) ) + // Various features on bit mask 0x000d - see above + TOAPLAN_COINAGE_DUAL_LOC( JMPR, 0x80000, 0x80000, SW1 ) + + PORT_MODIFY("JMPR") + // Bit Mask 0x80000 is used here to signify European Coinage for MAME purposes - not read on the real board! + PORT_CONFNAME( 0x80007, 0x00002, DEF_STR( Region ) ) //PORT_CONFLOCATION("JP:!4,!3,!2,FAKE:!1") + PORT_CONFSETTING( 0x00002, DEF_STR( World ) ) + PORT_CONFSETTING( 0x80005, DEF_STR( Europe ) ) + PORT_CONFSETTING( 0x00004, DEF_STR( USA ) ) + PORT_CONFSETTING( 0x00000, "Japan (Ryouta Kikaku)" ) + PORT_CONFSETTING( 0x00001, "Hong Kong (Honest Trading Co.)" ) + PORT_CONFSETTING( 0x80006, "Spain & Portugal (APM Electronics S.A.)" ) + PORT_CONFSETTING( 0x00007, "World (Ryouta Kikaku)" ) +INPUT_PORTS_END + +void pipibibi_state::pipibibs_68k_mem(address_map &map) +{ + map(0x000000, 0x03ffff).rom(); + map(0x080000, 0x082fff).ram(); + map(0x0c0000, 0x0c0fff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); + map(0x140000, 0x14000d).rw(m_vdp, FUNC(gp9001vdp_device::read), FUNC(gp9001vdp_device::write)); + map(0x190000, 0x190fff).rw(FUNC(pipibibi_state::shared_ram_r), FUNC(pipibibi_state::shared_ram_w)).umask16(0x00ff); + map(0x19c01d, 0x19c01d).w("coincounter", FUNC(toaplan_coincounter_device::coin_w)); + map(0x19c020, 0x19c021).portr("DSWA"); + map(0x19c024, 0x19c025).portr("DSWB"); + map(0x19c028, 0x19c029).portr("JMPR"); + map(0x19c02c, 0x19c02d).portr("SYS"); + map(0x19c030, 0x19c031).portr("IN1"); + map(0x19c034, 0x19c035).portr("IN2"); +} + +// odd scroll registers +void pipibibi_bootleg_state::pipibibi_bootleg_68k_mem(address_map &map) +{ + map(0x000000, 0x03ffff).rom(); + map(0x080000, 0x082fff).ram(); + map(0x083000, 0x0837ff).rw(m_vdp, FUNC(gp9001vdp_device::bootleg_spriteram16_r), FUNC(gp9001vdp_device::bootleg_spriteram16_w)); // SpriteRAM + map(0x083800, 0x087fff).ram(); // SpriteRAM (unused) + map(0x0c0000, 0x0c0fff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); + map(0x120000, 0x120fff).ram(); // Copy of SpriteRAM ? +// map(0x13f000, 0x13f001).nopw(); // ??? + map(0x180000, 0x182fff).rw(m_vdp, FUNC(gp9001vdp_device::bootleg_videoram16_r), FUNC(gp9001vdp_device::bootleg_videoram16_w)); // TileRAM + map(0x188000, 0x18800f).w(m_vdp, FUNC(gp9001vdp_device::bootleg_scroll_w)); + map(0x190003, 0x190003).r(FUNC(pipibibi_bootleg_state::shared_ram_r)); // Z80 ready ? + map(0x190011, 0x190011).w(FUNC(pipibibi_bootleg_state::shared_ram_w)); // Z80 task to perform + map(0x19c01d, 0x19c01d).w("coincounter", FUNC(toaplan_coincounter_device::coin_w)); + map(0x19c020, 0x19c021).portr("DSWA"); + map(0x19c024, 0x19c025).portr("DSWB"); + map(0x19c028, 0x19c029).portr("JMPR"); + map(0x19c02c, 0x19c02d).portr("SYS"); + map(0x19c030, 0x19c031).portr("IN1"); + map(0x19c034, 0x19c035).portr("IN2"); +} + + +void pipibibi_bootleg_state::cpu_space_pipibibsbl_map(address_map &map) +{ + map(0xfffff0, 0xffffff).m(m_maincpu, FUNC(m68000_base_device::autovectors_map)); + map(0xfffff9, 0xfffff9).lr8(NAME([this] () { m_maincpu->set_input_line(M68K_IRQ_4, CLEAR_LINE); return m68000_device::autovector(4); })); +} + +void pipibibi_state::pipibibs_sound_z80_mem(address_map &map) +{ + map(0x0000, 0x7fff).rom(); + map(0x8000, 0x87ff).ram().share(m_shared_ram); + map(0xe000, 0xe001).rw("ymsnd", FUNC(ym3812_device::read), FUNC(ym3812_device::write)); +} + +void pipibibi_state::pipibibs(machine_config &config) +{ + /* basic machine hardware */ + M68000(config, m_maincpu, 10_MHz_XTAL); // verified on PCB + m_maincpu->set_addrmap(AS_PROGRAM, &pipibibi_state::pipibibs_68k_mem); + m_maincpu->reset_cb().set_inputline(m_audiocpu, INPUT_LINE_RESET); + + Z80(config, m_audiocpu, 27_MHz_XTAL/8); // verified on PCB + m_audiocpu->set_addrmap(AS_PROGRAM, &pipibibi_state::pipibibs_sound_z80_mem); + + TOAPLAN_COINCOUNTER(config, "coincounter", 0); + + config.set_maximum_quantum(attotime::from_hz(600)); + + /* video hardware */ + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_video_attributes(VIDEO_UPDATE_BEFORE_VBLANK); + m_screen->set_raw(27_MHz_XTAL/4, 432, 0, 320, 262, 0, 240); + m_screen->set_screen_update(FUNC(pipibibi_state::screen_update)); + m_screen->screen_vblank().set(FUNC(pipibibi_state::screen_vblank)); + m_screen->set_palette(m_palette); + + PALETTE(config, m_palette).set_format(palette_device::xBGR_555, gp9001vdp_device::VDP_PALETTE_LENGTH); + + GP9001_VDP(config, m_vdp, 27_MHz_XTAL); + m_vdp->set_palette(m_palette); + m_vdp->vint_out_cb().set_inputline(m_maincpu, M68K_IRQ_4); + + /* sound hardware */ + SPEAKER(config, "mono").front_center(); + + ym3812_device &ymsnd(YM3812(config, "ymsnd", 27_MHz_XTAL/8)); // verified on PCB + ymsnd.irq_handler().set_inputline(m_audiocpu, 0); + ymsnd.add_route(ALL_OUTPUTS, "mono", 1.0); +} + + +void pipibibi_bootleg_state::pipibibsbl(machine_config &config) +{ + /* basic machine hardware */ + M68000(config, m_maincpu, 12_MHz_XTAL); // ??? (position labeled "68000-12" but 10 MHz-rated parts used) + m_maincpu->set_addrmap(AS_PROGRAM, &pipibibi_bootleg_state::pipibibi_bootleg_68k_mem); + m_maincpu->set_addrmap(m68000_base_device::AS_CPU_SPACE, &pipibibi_bootleg_state::cpu_space_pipibibsbl_map); + m_maincpu->reset_cb().set_inputline(m_audiocpu, INPUT_LINE_RESET); + + Z80(config, m_audiocpu, 12_MHz_XTAL / 2); // GoldStar Z8400B; clock source and divider unknown + m_audiocpu->set_addrmap(AS_PROGRAM, &pipibibi_bootleg_state::pipibibs_sound_z80_mem); + + TOAPLAN_COINCOUNTER(config, "coincounter", 0); + + config.set_maximum_quantum(attotime::from_hz(600)); + + /* video hardware */ + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_video_attributes(VIDEO_UPDATE_BEFORE_VBLANK); + m_screen->set_raw(28.322_MHz_XTAL / 4, 450, 0, 320, 262, 0, 240); // guess, but this is within NTSC parameters + m_screen->set_screen_update(FUNC(pipibibi_bootleg_state::screen_update)); + m_screen->screen_vblank().set(FUNC(pipibibi_bootleg_state::screen_vblank)); + m_screen->set_palette(m_palette); + + PALETTE(config, m_palette).set_format(palette_device::xBGR_555, gp9001vdp_device::VDP_PALETTE_LENGTH); + + GP9001_VDP(config, m_vdp, 27_MHz_XTAL); // FIXME: bootleg has no VDP + m_vdp->set_palette(m_palette); + m_vdp->vint_out_cb().set_inputline(m_maincpu, M68K_IRQ_4, ASSERT_LINE); + m_vdp->set_bootleg_extra_offsets(0x01f, 0x1ef, 0x01d, 0x1ef, 0x01b, 0x1ef, 0x1d4, 0x1f7); + + /* sound hardware */ + SPEAKER(config, "mono").front_center(); + + ym3812_device &ymsnd(YM3812(config, "ymsnd", 28.322_MHz_XTAL / 8)); // ??? + ymsnd.irq_handler().set_inputline(m_audiocpu, 0); + ymsnd.add_route(ALL_OUTPUTS, "mono", 1.0); +} + +void pipibibi_bootleg_state::init_pipibibsbl() +{ + u16 *ROM = (u16 *)(memregion("maincpu")->base()); + + for (int i = 0; i < (0x040000/2); i += 4) + { + ROM[i+0] = bitswap<16>(ROM[i+0],0x1,0x5,0x6,0x7,0x8,0x2,0x0,0x9,0xe,0xd,0x4,0x3,0xf,0xa,0xb,0xc); + ROM[i+1] = bitswap<16>(ROM[i+1],0x5,0x3,0x1,0xf,0xd,0xb,0x9,0x0,0x2,0x4,0x6,0x8,0xa,0xc,0xe,0x7); + ROM[i+2] = bitswap<16>(ROM[i+2],0xc,0xd,0xe,0xf,0x8,0x9,0xa,0xb,0x3,0x2,0x1,0x0,0x7,0x6,0x5,0x4); + ROM[i+3] = bitswap<16>(ROM[i+3],0x8,0x9,0xa,0xb,0xc,0xd,0xe,0xf,0x3,0x2,0x1,0x0,0x7,0x6,0x5,0x4); + } +} + +ROM_START( pipibibs ) + ROM_REGION( 0x040000, "maincpu", 0 ) /* Main 68K code */ + ROM_LOAD16_BYTE( "tp025-1.bin", 0x000000, 0x020000, CRC(b2ea8659) SHA1(400431b656dbfbd5a9bc5961c3ea04c4d38b6f77) ) + ROM_LOAD16_BYTE( "tp025-2.bin", 0x000001, 0x020000, CRC(dc53b939) SHA1(e4de371f97ba7c350273ad43b7f58ff31672a269) ) + + ROM_REGION( 0x10000, "audiocpu", 0 ) /* Sound Z80 code */ + ROM_LOAD( "tp025-5.bin", 0x0000, 0x8000, CRC(bf8ffde5) SHA1(79c09cc9a0ea979f5af5a7e5ad671ea486f5f43e) ) + + ROM_REGION( 0x200000, "gp9001", 0 ) + ROM_LOAD( "tp025-4.bin", 0x000000, 0x100000, CRC(ab97f744) SHA1(c1620e614345dbd5c6567e4cb6f55c61b900d0ee) ) + ROM_LOAD( "tp025-3.bin", 0x100000, 0x100000, CRC(7b16101e) SHA1(ae0119bbfa0937d18c4fbb0a3ef7cdc3b9fa6b56) ) +ROM_END + + +ROM_START( pipibibsa ) + ROM_REGION( 0x040000, "maincpu", 0 ) /* Main 68K code */ + ROM_LOAD16_BYTE( "tp025-1.alt.bin", 0x000000, 0x020000, CRC(3e522d98) SHA1(043dd76b99e130909e47063d4cc773177a2eaccf) ) + ROM_LOAD16_BYTE( "tp025-2.alt.bin", 0x000001, 0x020000, CRC(48370485) SHA1(9895e086c9a5eeec4f454cbc6098adb2f66d4e11) ) + + ROM_REGION( 0x10000, "audiocpu", 0 ) /* Sound Z80 code */ + ROM_LOAD( "tp025-5.bin", 0x0000, 0x8000, CRC(bf8ffde5) SHA1(79c09cc9a0ea979f5af5a7e5ad671ea486f5f43e) ) + + ROM_REGION( 0x200000, "gp9001", 0 ) + ROM_LOAD( "tp025-4.bin", 0x000000, 0x100000, CRC(ab97f744) SHA1(c1620e614345dbd5c6567e4cb6f55c61b900d0ee) ) + ROM_LOAD( "tp025-3.bin", 0x100000, 0x100000, CRC(7b16101e) SHA1(ae0119bbfa0937d18c4fbb0a3ef7cdc3b9fa6b56) ) +ROM_END + + +ROM_START( whoopee ) + ROM_REGION( 0x040000, "maincpu", 0 ) /* Main 68K code */ + ROM_LOAD16_BYTE( "whoopee.1", 0x000000, 0x020000, CRC(28882e7e) SHA1(8fcd278a7d005eb81cd9e461139c0c0f756a4fa4) ) + ROM_LOAD16_BYTE( "whoopee.2", 0x000001, 0x020000, CRC(6796f133) SHA1(d4e657be260ba3fd3f0556ade617882513b52685) ) + + ROM_REGION( 0x10000, "audiocpu", 0 ) /* Sound HD647180 code */ + ROM_LOAD( "hd647180.025", 0x00000, 0x08000, CRC(c02436f6) SHA1(385343f88991646ec23b385eaea82718f1251ea6) ) + + ROM_REGION( 0x200000, "gp9001", 0 ) + ROM_LOAD( "tp025-4.bin", 0x000000, 0x100000, CRC(ab97f744) SHA1(c1620e614345dbd5c6567e4cb6f55c61b900d0ee) ) + ROM_LOAD( "tp025-3.bin", 0x100000, 0x100000, CRC(7b16101e) SHA1(ae0119bbfa0937d18c4fbb0a3ef7cdc3b9fa6b56) ) +ROM_END + + +ROM_START( pipibibsp ) + ROM_REGION( 0x080000, "maincpu", 0 ) /* Main 68K code */ + ROM_LOAD16_BYTE( "pip_cpu_e", 0x000000, 0x020000, CRC(ae3205bd) SHA1(1613fec637dfed213433dca0d267e49f4848df81) ) + ROM_LOAD16_BYTE( "pip_cpu_o", 0x000001, 0x020000, CRC(241669a9) SHA1(234e0bb819453e16625d15d2cf22496bbc547943) ) + + ROM_REGION( 0x10000, "audiocpu", 0 ) /* Sound Z80 code */ + ROM_LOAD( "pip_snd", 0x0000, 0x8000, CRC(8ebf183b) SHA1(602b138c85b02d121d007f6788b322aa107c7d91) ) + + ROM_REGION( 0x200000, "gp9001", 0 ) + ROM_LOAD( "cg_01_l", 0x000000, 0x080000, CRC(21d1ef46) SHA1(d7ccbe56eb08be421c241065cbaa99cc9cca4d73) ) + ROM_LOAD( "cg_01_h", 0x080000, 0x080000, CRC(d5726328) SHA1(26401ba8ce22fda161306b91d70afefa959cde8c) ) + ROM_LOAD( "cg_23_l", 0x100000, 0x080000, CRC(114d41d0) SHA1(d1166d495d92c6082fffbed422deb7605c5a41a2) ) + ROM_LOAD( "cg_23_h", 0x180000, 0x080000, CRC(e0468152) SHA1(f5a872d8658e959ec6cce51c7798291b5b973f15) ) +ROM_END + + +// TODO: this runs on oneshot.cpp hardware. Move to that driver and remove the hacks in video/gp9001.cpp needed to run it in this driver +ROM_START( pipibibsbl ) /* Based off the proto code. */ + ROM_REGION( 0x040000, "maincpu", 0 ) /* Main 68K code */ + ROM_LOAD16_BYTE( "ppbb06.bin", 0x000000, 0x020000, CRC(14c92515) SHA1(2d7f7c89272bb2a8115f163ad651bef3bca5107e) ) + ROM_LOAD16_BYTE( "ppbb05.bin", 0x000001, 0x020000, CRC(3d51133c) SHA1(d7bd94ad11e9aeb5a5165c5ac6f71950849bcd2f) ) + + ROM_REGION( 0x10000, "audiocpu", 0 ) /* Sound Z80 code */ + ROM_LOAD( "ppbb08.bin", 0x0000, 0x8000, CRC(101c0358) SHA1(162e02d00b7bdcdd3b48a0cd0527b7428435ec50) ) // same data as komocomo in oneshot.cpp + + ROM_REGION( 0x200000, "gp9001", 0 ) + /* GFX data differs slightly from Toaplan boards ??? */ + ROM_LOAD16_BYTE( "ppbb01.bin", 0x000000, 0x080000, CRC(0fcae44b) SHA1(ac72bc79e3a5d0a81647c312d310d00ace017272) ) + ROM_LOAD16_BYTE( "ppbb02.bin", 0x000001, 0x080000, CRC(8bfcdf87) SHA1(4537a7d646d3014f069c6fd0be457bb32e2f18ac) ) + ROM_LOAD16_BYTE( "ppbb03.bin", 0x100000, 0x080000, CRC(abdd2b8b) SHA1(a4246dd63515f01d1227c9a9e16d9f1c739ee39e) ) + ROM_LOAD16_BYTE( "ppbb04.bin", 0x100001, 0x080000, CRC(70faa734) SHA1(4448f4dbded56c142e57293d371e0a422c3a667e) ) + + ROM_REGION( 0x8000, "user1", 0 ) /* ??? Some sort of table */ + ROM_LOAD( "ppbb07.bin", 0x0000, 0x8000, CRC(456dd16e) SHA1(84779ee64d3ea33ba1ba4dee39b504a81c6811a1) ) // 1xxxxxxxxxxxxxx = 0xFF, same data as komocomo in oneshot.cpp +ROM_END + + +// TODO: determine if this is the correct driver or if this needs to be moved somewhere else, too +ROM_START( pipibibsbl2 ) // PIPI001 PCB + ROM_REGION( 0x040000, "maincpu", 0 ) /* Main 68K code */ + ROM_LOAD16_BYTE( "06.bin", 0x000000, 0x020000, CRC(25f49c2f) SHA1(a61246ec8a07ba14ee0a01c3458c59840b435c0b) ) + ROM_LOAD16_BYTE( "07.bin", 0x000001, 0x020000, CRC(15250177) SHA1(a5ee5ccc219f300d7387b45dc8f8b72fd0f37d7e) ) + + ROM_REGION( 0x20000, "audiocpu", 0 ) /* Sound Z80 code */ + ROM_LOAD( "08.bin", 0x00000, 0x10000, CRC(f2080071) SHA1(68cbae9559879b2dc19c41a7efbd13ab4a569d3f) ) // // 1ST AND 2ND HALF IDENTICAL, same as komocomo in oneshot.cpp + + ROM_REGION( 0x200000, "gp9001", 0 ) + ROM_LOAD16_BYTE( "01.bin", 0x000000, 0x80000, CRC(505e9e9f) SHA1(998995d94585d785263cc926f68632065aa6c366) ) + ROM_LOAD16_BYTE( "02.bin", 0x000001, 0x80000, CRC(860018f5) SHA1(7f42dffb27940629447d688e1771b4ecf04f3b43) ) + ROM_LOAD16_BYTE( "03.bin", 0x100000, 0x80000, CRC(ece1bc0f) SHA1(d29f1520f1a3a9d276d36af650bc0d70bcb5b8da) ) + ROM_LOAD16_BYTE( "04.bin", 0x100001, 0x80000, CRC(f328d7a3) SHA1(2c4fb5d6202f847aaf7c7be719c0c92b8bb5946b) ) + + ROM_REGION( 0x20000, "user1", 0 ) + ROM_LOAD( "5.bin", 0x00000, 0x20000, CRC(8107c4bd) SHA1(64e2fafa808c16c722454b611a8492a4620a925c) ) // motherboard ROM, unknown purpose +ROM_END + +ROM_START( pipibibsbl3 ) + ROM_REGION( 0x040000, "maincpu", 0 ) // Main 68K code, not scrambled + ROM_LOAD16_BYTE( "5.bin", 0x000000, 0x020000, CRC(7fab770c) SHA1(c96808870c5906e0203f38114702bd660e491a7d) ) + ROM_LOAD16_BYTE( "6.bin", 0x000001, 0x020000, CRC(9007ef00) SHA1(594052be7351e0b8e30f83abd9a91ab1429d82ef) ) + + ROM_REGION( 0x10000, "audiocpu", 0 ) // Sound Z80 code + ROM_LOAD( "7.bin", 0x0000, 0x8000, CRC(101c0358) SHA1(162e02d00b7bdcdd3b48a0cd0527b7428435ec50) ) // same data as komocomo in oneshot.cpp + + ROM_REGION( 0x200000, "gp9001", 0 ) + // GFX data differs slightly from Toaplan boards ??? + ROM_LOAD16_BYTE( "4.bin", 0x000000, 0x080000, CRC(0fcae44b) SHA1(ac72bc79e3a5d0a81647c312d310d00ace017272) ) + ROM_LOAD16_BYTE( "3.bin", 0x000001, 0x080000, CRC(8bfcdf87) SHA1(4537a7d646d3014f069c6fd0be457bb32e2f18ac) ) + ROM_LOAD16_BYTE( "2.bin", 0x100000, 0x080000, CRC(abdd2b8b) SHA1(a4246dd63515f01d1227c9a9e16d9f1c739ee39e) ) + ROM_LOAD16_BYTE( "1.bin", 0x100001, 0x080000, CRC(70faa734) SHA1(4448f4dbded56c142e57293d371e0a422c3a667e) ) + + ROM_REGION( 0x8000, "user1", 0 ) // ??? Some sort of table + ROM_LOAD( "8.bin", 0x0000, 0x8000, CRC(456dd16e) SHA1(84779ee64d3ea33ba1ba4dee39b504a81c6811a1) ) // 1xxxxxxxxxxxxxx = 0xFF, same data as komocomo in oneshot.cpp +ROM_END + +} // anonymous namespace + +GAME( 1991, pipibibs, 0, pipibibs, pipibibs, pipibibi_state, empty_init, ROT0, "Toaplan", "Pipi & Bibis / Whoopee!! (Z80 sound cpu, set 1)", MACHINE_SUPPORTS_SAVE ) +GAME( 1991, pipibibsa, pipibibs, pipibibs, pipibibs, pipibibi_state, empty_init, ROT0, "Toaplan", "Pipi & Bibis / Whoopee!! (Z80 sound cpu, set 2)", MACHINE_SUPPORTS_SAVE ) +GAME( 1991, pipibibsp, pipibibs, pipibibs, pipibibsp, pipibibi_state, empty_init, ROT0, "Toaplan", "Pipi & Bibis / Whoopee!! (prototype)", MACHINE_SUPPORTS_SAVE ) + +GAME( 1991, pipibibsbl, pipibibs, pipibibsbl, pipibibsbl, pipibibi_bootleg_state, init_pipibibsbl, ROT0, "bootleg (Ryouta Kikaku)", "Pipi & Bibis / Whoopee!! (Ryouta Kikaku bootleg, encrypted)", MACHINE_SUPPORTS_SAVE ) +GAME( 1991, pipibibsbl2, pipibibs, pipibibsbl, pipibibsbl, pipibibi_bootleg_state, empty_init, ROT0, "bootleg", "Pipi & Bibis / Whoopee!! (bootleg, decrypted)", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) // different memory map, not scrambled +GAME( 1991, pipibibsbl3, pipibibs, pipibibsbl, pipibibsbl, pipibibi_bootleg_state, empty_init, ROT0, "bootleg (Ryouta Kikaku)", "Pipi & Bibis / Whoopee!! (Ryouta Kikaku bootleg, decrypted)", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/toaplan/raizing.cpp b/src/mame/toaplan/raizing.cpp new file mode 100644 index 00000000000..46145bdf89d --- /dev/null +++ b/src/mame/toaplan/raizing.cpp @@ -0,0 +1,1341 @@ +// license:BSD-3-Clause +// copyright-holders:Quench, Yochizo, David Haywood + +#include "emu.h" + +#include "raizing.h" + +// TODO: this is the old toaplan2.cpp header text, it could do with splitting between the new drivers + +/***************************************************************************** + + ToaPlan game hardware from 1991 - 1994 + Raizing/8ing game hardware from 1993 onwards + ------------------------------------------------- + Driver by: Quench and Yochizo + Original othldrby.c by Nicola Salmoria + + Raizing games and Truxton 2 are heavily dependent on the Raine source - + many thanks to Richard Bush and the Raine team. [Yochizo] + + +Supported games: + + Name Board No Maker Game name + ---------------------------------------------------------------------------- + sstriker RA-MA7893-01 Raizing Sorcer Striker + sstrikera RA-MA7893-01 Raizing Sorcer Striker (Unite Trading license) + mahoudai RA-MA7893-01 Raizing Mahou Daisakusen (Japan) + kingdmgp RA-MA9402-03 Raizing/8ing Kingdom Grandprix + shippumd RA-MA9402-03 Raizing/8ing Shippu Mahou Daisakusen (Japan) + bgaregga RA9503 Raizing/8ing Battle Garegga (World - Sat Feb 3 1996) + bgareggat RA9503 Raizing/8ing Battle Garegga (location test - Wed Jan 17 1996) + bgareggahk RA9503 Raizing/8ing Battle Garegga (Hong Kong (and Austria?) - Sat Feb 3 1996) + bgareggatw RA9503 Raizing/8ing Battle Garegga (Taiwan (and Germany?) - Thu Feb 1 1996) + bgaregganv RA9503 Raizing/8ing Battle Garegga - New Version (Hong Kong (and Austria?) - Sat Mar 2 1996) + bgareggat2 RA9503 Raizing/8ing Battle Garegga - Type 2 (World - Sat Mar 2 1996) + bgareggacn RA9503 Raizing/8ing Battle Garegga - Type 2 (China (and Denmark?) - Tue Apr 2 1996) + + SET NOTES: + + sstriker - The mahoudai set reads the region jumpers, but the lookup tables in ROM that map jumper + settings to copyright text, coinage settings, etc., contain identical values for every + jumper setting, effectively ignoring the jumpers and forcing the region to Japan. + On the other hand, sstriker has its title screen and all its text in English even when + the region is set to Japan. This seems odd but has been verified correct on two boards. + The only difference between sstriker and sstrikera is the copyright text displayed when + the region is set to Korea. + + kingdmgp - The kingdmgp and shippumd sets have identical program ROMs but a different graphics ROM + for the text layer. Setting the region to Japan with the kingdmgp ROM, or to anything other + than Japan with the shippumd ROM, results in a corrupt title screen and unreadable text. + In kingdmgp some of the tiles needed for the credits screen in attract mode have been + stripped out, resulting in boxes where letters should be. It doesn't seem very professional + but appears to be a genuine release. A lot of boards being sold as 'Kingdom Grand Prix' are + in fact conversions using Neill Corlett's hack. + + bgaregga - The later versions change the small bullet-shaped enemy bullets to bright yellow balls, + eliminate the flying metal debris from explosions, and require additional joystick input + to access the Extended, Harder, Special, and Stage Edit hidden features. + In addition to these changes, the bgareggat2 set uses only two buttons. Instead of being + able to change the formation of your options with the third button, each of the selectable + ships has a different, fixed option formation. However, the third button can still be used + to select an alternate ship color and to enter the secret character and Stage Edit codes. + + + **************************************************************************** + * Battle Garegga and Armed Police Batrider have secret characters * + * and game features. * + * Try to input the following commands to use them. * + * ======================================================================== * + * Battle Garegga * + * The button you use to select your ship not only determines its * + * color, but affects its characteristics. * + * A: Default characteristics. * + * B: Slightly higher speed than A type. * + * C: Slightly smaller hitbox than A type. * + * A+B+C: Same speed as B type and same hitbox as C type. * + * * + * After inserting a coin (pushing a credit button), input * + * UP UP DOWN DOWN LEFT RIGHT LEFT RIGHT A B C START * + * then you can use Mahou Daisakusen characters. * + * * + * Note: In versions of the game dated Mar 2 1996 or later, you must * + * hold the joystick RIGHT in addition to the specified button(s) * + * when entering any of the following commands. Even if Stage Edit * + * is enabled via dipswitch, you need to hold RIGHT to use it. * + * * + * EXTENDED: After inserting a coin, hold A and press START. * + * You play through all stages twice before the game ends. * + * HARDER: After inserting a coin, hold B and press START. * + * Difficulty is increased. * + * SPECIAL: After inserting a coin, hold A and B and press START. * + * Combination of EXTENDED and HARDER modes. * + * STAGE EDIT: After inserting a coin, hold C and press START. * + * You can choose what order to play Stage 2, 3 and 4 in, * + * or even skip them. * + * * + * EXTENDED, HARDER, and SPECIAL modes each have their own high score list. * + * ------------------------------------------------------------------------ * + **************************************************************************** + +Game status: + +To Do / Unknowns: + - Find out how exactly how sound CPU communication really works in bgaregga/batrider/bbakraid + current emulation seems to work (plays all sounds), but there are still some unknown reads/writes + - Music timing is bit different on bbakraid. + reference : https://www.youtube.com/watch?v=zjrWs0iHQ5A + +*****************************************************************************/ + +void raizing_base_state::reset_audiocpu(int state) +{ + if (m_audiocpu != nullptr) + m_audiocpu->set_input_line(INPUT_LINE_RESET, state); +} + +TILE_GET_INFO_MEMBER(raizing_base_state::get_text_tile_info) +{ + const u16 attrib = m_tx_videoram[tile_index]; + const u32 tile_number = attrib & 0x3ff; + const u32 color = attrib >> 10; + tileinfo.set(0, + tile_number, + color, + 0); +} + +void raizing_base_state::tx_videoram_w(offs_t offset, u16 data, u16 mem_mask) +{ + COMBINE_DATA(&m_tx_videoram[offset]); + if (offset < 64*32) + m_tx_tilemap->mark_tile_dirty(offset); +} + +void raizing_base_state::tx_linescroll_w(offs_t offset, u16 data, u16 mem_mask) +{ + /*** Line-Scroll RAM for Text Layer ***/ + COMBINE_DATA(&m_tx_linescroll[offset]); + + m_tx_tilemap->set_scrollx(offset, m_tx_linescroll[offset]); +} + + + +void raizing_base_state::device_post_load() +{ + if (m_tx_gfxram != nullptr) + m_gfxdecode->gfx(0)->mark_all_dirty(); +} + + +u32 raizing_base_state::screen_update_base(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + bitmap.fill(0, cliprect); + m_custom_priority_bitmap.fill(0, cliprect); + m_vdp->render_vdp(bitmap, cliprect); + + return 0; +} + +void raizing_base_state::screen_vblank(int state) +{ + // rising edge + if (state) + { + m_vdp->screen_eof(); + } +} + +u32 raizing_base_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + screen_update_base(screen, bitmap, cliprect); + + rectangle clip = cliprect; + + /* it seems likely that flipx can be set per line! */ + /* however, none of the games does it, and emulating it in the */ + /* MAME tilemap system without being ultra slow would be tricky */ + m_tx_tilemap->set_flip(m_tx_lineselect[0] & 0x8000 ? 0 : TILEMAP_FLIPX); + + /* line select is used for 'for use in' and '8ing' screen on bbakraid, 'Raizing' logo on batrider */ + for (int y = cliprect.min_y; y <= cliprect.max_y; y++) + { + clip.min_y = clip.max_y = y; + m_tx_tilemap->set_scrolly(0, m_tx_lineselect[y] - y); + m_tx_tilemap->draw(screen, bitmap, clip, 0); + } + return 0; +} + + + +void raizing_base_state::create_tx_tilemap(int dx, int dx_flipped) +{ + m_tx_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(raizing_base_state::get_text_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); + + m_tx_tilemap->set_scroll_rows(8*32); /* line scrolling */ + m_tx_tilemap->set_scroll_cols(1); + m_tx_tilemap->set_scrolldx(dx, dx_flipped); + m_tx_tilemap->set_transparent_pen(0); +} + +void raizing_base_state::bgaregga_common_video_start() +{ + m_screen->register_screen_bitmap(m_custom_priority_bitmap); + m_vdp->custom_priority_bitmap = &m_custom_priority_bitmap; + + /* Create the Text tilemap for this game */ + create_tx_tilemap(0x1d4, 0x16b); +} + + +void raizing_base_state::raizing_z80_bankswitch_w(u8 data) +{ + m_audiobank->set_entry(data & 0x0f); +} + +// bgaregga and batrider don't actually have a NMK112, but rather a GAL +// programmed to bankswitch the sound ROMs in a similar fashion. +// it may not be a coincidence that the composer and sound designer for +// these two games, Manabu "Santaruru" Namiki, came to Raizing from NMK... +void raizing_base_state::raizing_oki_bankswitch_w(offs_t offset, u8 data) +{ + m_raizing_okibank[(offset & 4) >> 2][offset & 3]->set_entry(data & 0xf); + m_raizing_okibank[(offset & 4) >> 2][4 + (offset & 3)]->set_entry(data & 0xf); + offset++; + data >>= 4; + m_raizing_okibank[(offset & 4) >> 2][offset & 3]->set_entry(data & 0xf); + m_raizing_okibank[(offset & 4) >> 2][4 + (offset & 3)]->set_entry(data & 0xf); +} + +void raizing_base_state::common_bgaregga_reset() +{ + for (int chip = 0; chip < 2; chip++) + { + for (int i = 0; i < 8; i++) + { + if (m_raizing_okibank[chip][i] != nullptr) + m_raizing_okibank[chip][i]->set_entry(0); + } + } +} + +void raizing_base_state::common_mem(address_map &map, offs_t rom_limit) +{ + map(0x000000, rom_limit).rom(); + map(0x100000, 0x10ffff).ram(); + map(0x218000, 0x21bfff).rw(FUNC(raizing_base_state::shared_ram_r), FUNC(raizing_base_state::shared_ram_w)).umask16(0x00ff); + map(0x21c020, 0x21c021).portr("IN1"); + map(0x21c024, 0x21c025).portr("IN2"); + map(0x21c028, 0x21c029).portr("SYS"); + map(0x21c02c, 0x21c02d).portr("DSWA"); + map(0x21c030, 0x21c031).portr("DSWB"); + map(0x21c034, 0x21c035).portr("JMPR"); + map(0x21c03c, 0x21c03d).r(m_vdp, FUNC(gp9001vdp_device::vdpcount_r)); + map(0x300000, 0x30000d).rw(m_vdp, FUNC(gp9001vdp_device::read), FUNC(gp9001vdp_device::write)); + map(0x400000, 0x400fff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); + map(0x500000, 0x501fff).ram().w(FUNC(raizing_base_state::tx_videoram_w)).share(m_tx_videoram); + map(0x502000, 0x502fff).ram().share(m_tx_lineselect); + map(0x503000, 0x5031ff).ram().w(FUNC(raizing_base_state::tx_linescroll_w)).share(m_tx_linescroll); + map(0x503200, 0x503fff).ram(); +} + +void raizing_base_state::install_raizing_okibank(int chip) +{ + assert(m_oki_rom[chip] && m_raizing_okibank[chip][0]); + + for (int i = 0; i < 4; i++) + { + m_raizing_okibank[chip][i]->configure_entries(0, 16, &m_oki_rom[chip][(i * 0x100)], 0x10000); + } + m_raizing_okibank[chip][4]->configure_entries(0, 16, &m_oki_rom[chip][0x400], 0x10000); + for (int i = 5; i < 8; i++) + { + m_raizing_okibank[chip][i]->configure_entries(0, 16, &m_oki_rom[chip][0], 0x10000); + } +} + + +namespace { + +class bgaregga_state : public raizing_base_state +{ +public: + bgaregga_state(const machine_config &mconfig, device_type type, const char *tag) + : raizing_base_state(mconfig, type, tag) + { } + + void bgaregga(machine_config &config) ATTR_COLD; + + void init_bgaregga() ATTR_COLD; + +protected: + virtual void machine_reset() override ATTR_COLD; + virtual void video_start() override ATTR_COLD; + +private: + void bgaregga_68k_mem(address_map &map) ATTR_COLD; + void bgaregga_sound_z80_mem(address_map &map) ATTR_COLD; + + u8 bgaregga_E01D_r(); +}; + +class bgaregga_bootleg_state : public bgaregga_state +{ +public: + bgaregga_bootleg_state(const machine_config &mconfig, device_type type, const char *tag) + : bgaregga_state(mconfig, type, tag) + { } + + void bgareggabl(machine_config &config) ATTR_COLD; + +protected: + virtual void video_start() override ATTR_COLD; + +private: + u32 screen_update_bootleg(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); +}; + + +class sstriker_state : public raizing_base_state +{ +public: + sstriker_state(const machine_config &mconfig, device_type type, const char *tag) + : raizing_base_state(mconfig, type, tag) + { } + + void mahoudai(machine_config &config) ATTR_COLD; + void shippumd(machine_config &config) ATTR_COLD; + +protected: + virtual void video_start() override ATTR_COLD; + +private: + void mahoudai_68k_mem(address_map &map) ATTR_COLD; + void shippumd_68k_mem(address_map &map) ATTR_COLD; + void raizing_sound_z80_mem(address_map &map) ATTR_COLD; + + void shippumd_coin_w(u8 data); +}; + + +void bgaregga_state::video_start() +{ + bgaregga_common_video_start(); +} + +void sstriker_state::video_start() +{ + bgaregga_common_video_start(); +} + +void bgaregga_bootleg_state::video_start() +{ + m_screen->register_screen_bitmap(m_custom_priority_bitmap); + m_vdp->custom_priority_bitmap = &m_custom_priority_bitmap; + + /* Create the Text tilemap for this game */ + create_tx_tilemap(4, 4); +} + + + + +u32 bgaregga_bootleg_state::screen_update_bootleg(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + screen_update_base(screen, bitmap, cliprect); + m_tx_tilemap->draw(screen, bitmap, cliprect, 0); + return 0; +} + + +/***************************************************************************** + Input Port definitions + The following commands are available when the Invulnerability dipswitch + is set (or, in some games, also when the JAMMA Test switch is pressed): + + P2 start : pause + P1 start : resume + Hold P1 start & P2 start : slow motion + + In bgaregga, batrider and bbakraid, the commands are different: + + Tap P1 start : pause/resume + Hold P1 start : slow motion + + Additional per-game test features are as follows: + + truxton2 - While playing in invulnerable mode, press button 3 to suicide. + + fixeight - While playing in invulnerable mode, press button 3 to suicide + (player 1 and player 2 only) + + batsugun - While playing in invulnerable mode, press the following buttons + to stage skip: + + P2 button 3 & P2 button 1 : Skip to end of stage 1 + P2 button 3 & P2 button 2 : Skip to end of stage 2 + P2 button 3 : Skip to end of stage 3 + + sstriker - While playing in invulnerable mode as player 2, press + /kingdmgp P2 button 3 to skip to the end of the current stage. + + bgaregga - Press and hold P1 button 1, P1 button 2 and P1 button 3 while + powering on in service mode to enter the special service mode. + "OPTIONS" and "PLAY DATAS" are added to the menu, and the + dipswitch display will show the region jumpers (normally hidden). + Choose "GAME MODE" from the special service mode to enter the + special game mode. In the special game mode, you can use pause + and slow motion even when not playing in invulnerable mode. + + batrider - While playing in invulnerable mode, press P1 Start and P2 Start + to skip directly to the ending scene. + + batrider - Press and hold P1 button 1, P1 button 2 and P1 button 3 while + /bbakraid powering on in service mode to enter the special service mode. + You can change the game's region by pressing left/right. + Choose "GAME MODE" from the special service mode to enter the + special game mode. In the special game mode, you can use pause + and slow motion even when not playing in invulnerable mode. + While the game is paused in special mode, press button 3 to + display debugging information. + +*****************************************************************************/ + +static INPUT_PORTS_START( 2b ) + PORT_START("IN1") + TOAPLAN_JOY_UDLR_2_BUTTONS( 1 ) + + PORT_START("IN2") + TOAPLAN_JOY_UDLR_2_BUTTONS( 2 ) + + PORT_START("SYS") + PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_SERVICE1 ) + PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_TILT ) + TOAPLAN_TEST_SWITCH( 0x04, IP_ACTIVE_HIGH ) + PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_COIN1 ) + PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_COIN2 ) + PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_START1 ) + PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_START2 ) + PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_UNKNOWN ) + + PORT_START("DSWA") + TOAPLAN_MACHINE_NO_COCKTAIL_LOC(SW1) + // Coinage on bit mask 0x00f0 + PORT_BIT( 0x00f0, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // Modified below + + PORT_START("DSWB") + TOAPLAN_DIFFICULTY_LOC(SW2) + // Per-game features on bit mask 0x00fc + PORT_BIT( 0x00fc, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // Modified below +INPUT_PORTS_END + + +static INPUT_PORTS_START( 3b ) + PORT_INCLUDE( 2b ) + + PORT_MODIFY("IN1") + TOAPLAN_JOY_UDLR_3_BUTTONS( 1 ) + + PORT_MODIFY("IN2") + TOAPLAN_JOY_UDLR_3_BUTTONS( 2 ) +INPUT_PORTS_END + + +static INPUT_PORTS_START( sstriker ) + PORT_INCLUDE( 3b ) + + PORT_MODIFY("DSWA") + PORT_DIPNAME( 0x0001, 0x0000, DEF_STR( Free_Play ) ) PORT_DIPLOCATION("SW1:!1") + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0001, DEF_STR( On ) ) + // Various features on bit mask 0x000e - see above + TOAPLAN_COINAGE_DUAL_LOC( JMPR, 0x0e, 0x04, SW1 ) + + PORT_MODIFY("DSWB") + // Difficulty on bit mask 0x0003 - see above + PORT_DIPNAME( 0x000c, 0x0000, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW2:!3,!4") + PORT_DIPSETTING( 0x000c, DEF_STR( None ) ) + PORT_DIPSETTING( 0x0008, "200k only" ) + PORT_DIPSETTING( 0x0000, "Every 300k" ) + PORT_DIPSETTING( 0x0004, "200k and 500k" ) + PORT_DIPNAME( 0x0030, 0x0000, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:!5,!6") + PORT_DIPSETTING( 0x0030, "1" ) + PORT_DIPSETTING( 0x0020, "2" ) + PORT_DIPSETTING( 0x0000, "3" ) + PORT_DIPSETTING( 0x0010, "5" ) + PORT_DIPNAME( 0x0040, 0x0000, "Invulnerability (Cheat)" ) PORT_DIPLOCATION("SW2:!7") + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0040, DEF_STR( On ) ) + PORT_DIPNAME( 0x0080, 0x0000, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("SW2:!8") + PORT_DIPSETTING( 0x0080, DEF_STR( No ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( Yes ) ) + + PORT_START("JMPR") + PORT_CONFNAME( 0x0001, 0x0001, "FBI Logo" ) //PORT_CONFLOCATION("JP:!4") + PORT_CONFSETTING( 0x0001, DEF_STR( Off ) ) + PORT_CONFSETTING( 0x0000, DEF_STR( On ) ) + PORT_CONFNAME( 0x000e, 0x0004, DEF_STR( Region ) ) //PORT_CONFLOCATION("JP:!3,!2,!1") + PORT_CONFSETTING( 0x0004, DEF_STR( Europe ) ) + PORT_CONFSETTING( 0x0002, DEF_STR( USA ) ) + PORT_CONFSETTING( 0x0000, DEF_STR( Japan ) ) + PORT_CONFSETTING( 0x0006, DEF_STR( Southeast_Asia ) ) + PORT_CONFSETTING( 0x0008, DEF_STR( China ) ) + PORT_CONFSETTING( 0x000a, DEF_STR( Korea ) ) + PORT_CONFSETTING( 0x000c, DEF_STR( Hong_Kong ) ) + PORT_CONFSETTING( 0x000e, DEF_STR( Taiwan ) ) +INPUT_PORTS_END + + +static INPUT_PORTS_START( sstrikerk ) // Although the region jumper is functional, it's a Korean board / version + PORT_INCLUDE( sstriker ) + + PORT_MODIFY("JMPR") + PORT_CONFNAME( 0x000e, 0x000a, DEF_STR( Region ) ) //PORT_CONFLOCATION("JP:!3,!2,!1") + PORT_CONFSETTING( 0x0004, DEF_STR( Europe ) ) + PORT_CONFSETTING( 0x0002, DEF_STR( USA ) ) + PORT_CONFSETTING( 0x0000, DEF_STR( Japan ) ) + PORT_CONFSETTING( 0x0006, DEF_STR( Southeast_Asia ) ) + PORT_CONFSETTING( 0x0008, DEF_STR( China ) ) + PORT_CONFSETTING( 0x000a, "Korea (Unite Trading)" ) + PORT_CONFSETTING( 0x000c, DEF_STR( Hong_Kong ) ) + PORT_CONFSETTING( 0x000e, DEF_STR( Taiwan ) ) +INPUT_PORTS_END + + +static INPUT_PORTS_START( mahoudai ) + PORT_INCLUDE( sstriker ) + + PORT_MODIFY("JMPR") + // Effectively unused by this set - see notes + PORT_BIT( 0xffff, IP_ACTIVE_HIGH, IPT_UNKNOWN ) +INPUT_PORTS_END + + +static INPUT_PORTS_START( kingdmgp ) + PORT_INCLUDE( sstriker ) + + // The code and lookup tables pertaining to the jumpers are almost identical to sstriker. + // However, this set apparently lacks (reachable) code to display the FBI logo, + // even though the logo itself is present in the gfx ROMs. + PORT_MODIFY("JMPR") + PORT_CONFNAME( 0x0001, 0x0000, DEF_STR( Unused ) ) //PORT_CONFLOCATION("JP:!4") + PORT_CONFSETTING( 0x0000, DEF_STR( Off ) ) + PORT_CONFSETTING( 0x0001, DEF_STR( On ) ) + PORT_CONFNAME( 0x000e, 0x0004, DEF_STR( Region ) ) //PORT_CONFLOCATION("JP:!3,!2,!1") + PORT_CONFSETTING( 0x0004, DEF_STR( Europe ) ) + PORT_CONFSETTING( 0x0002, DEF_STR( USA ) ) +// PORT_CONFSETTING( 0x0000, DEF_STR( Japan ) ) // Corrupt title screen and text - use shippumd + PORT_CONFSETTING( 0x0006, DEF_STR( Southeast_Asia ) ) + PORT_CONFSETTING( 0x0008, DEF_STR( China ) ) + PORT_CONFSETTING( 0x000a, "Korea (Unite Trading license)" ) + PORT_CONFSETTING( 0x000c, DEF_STR( Hong_Kong ) ) + PORT_CONFSETTING( 0x000e, DEF_STR( Taiwan ) ) +INPUT_PORTS_END + + +static INPUT_PORTS_START( shippumd ) + PORT_INCLUDE( sstriker ) + + PORT_MODIFY("JMPR") + // Title screen and text are corrupt for anything but Japan + PORT_BIT( 0xffff, IP_ACTIVE_HIGH, IPT_UNKNOWN ) +INPUT_PORTS_END + + +static INPUT_PORTS_START( bgaregga ) + PORT_START("IN1") + PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(1) PORT_8WAY + PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1) PORT_8WAY + PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1) PORT_8WAY + PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1) PORT_8WAY + PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(1) + PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(1) + PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_PLAYER(1) + PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_UNKNOWN ) + PORT_BIT( 0xff00, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // Unknown/Unused + + PORT_START("IN2") + PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(2) PORT_8WAY + PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2) PORT_8WAY + PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2) PORT_8WAY + PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2) PORT_8WAY + PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2) + PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(2) + PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_PLAYER(2) + PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_UNKNOWN ) + PORT_BIT( 0xff00, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // Unknown/Unused + + PORT_START("SYS") + PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_SERVICE1 ) + PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_UNKNOWN ) + TOAPLAN_TEST_SWITCH( 0x04, IP_ACTIVE_HIGH ) + PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_COIN1 ) + PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_COIN2 ) + PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_START1 ) + PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_START2 ) + PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_UNKNOWN ) + PORT_BIT( 0xff00, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // Unknown/Unused + + PORT_START("DSWA") + PORT_SERVICE_DIPLOC(0x0001, IP_ACTIVE_HIGH, "SW1:!1") + PORT_DIPNAME( 0x0002, 0x0000, "Credits to Start" ) PORT_DIPLOCATION("SW1:!2") + PORT_DIPSETTING( 0x0000, "1" ) + PORT_DIPSETTING( 0x0002, "2" ) + PORT_DIPNAME( 0x001c, 0x0000, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:!3,!4,!5") + PORT_DIPSETTING( 0x0018, DEF_STR( 4C_1C ) ) + PORT_DIPSETTING( 0x0014, DEF_STR( 3C_1C ) ) + PORT_DIPSETTING( 0x0010, DEF_STR( 2C_1C ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( 1C_1C ) ) + PORT_DIPSETTING( 0x0004, DEF_STR( 1C_2C ) ) + PORT_DIPSETTING( 0x0008, DEF_STR( 1C_3C ) ) + PORT_DIPSETTING( 0x000c, DEF_STR( 1C_4C ) ) + PORT_DIPSETTING( 0x001c, DEF_STR( Free_Play ) ) + PORT_DIPNAME( 0x00e0, 0x0000, DEF_STR( Coin_B ) ) PORT_CONDITION("DSWA", 0x001c, NOTEQUALS, 0x001c) PORT_DIPLOCATION("SW1:!6,!7,!8") + PORT_DIPSETTING( 0x00c0, DEF_STR( 4C_1C ) ) PORT_CONDITION("DSWA", 0x001c, NOTEQUALS, 0x001c) + PORT_DIPSETTING( 0x00a0, DEF_STR( 3C_1C ) ) PORT_CONDITION("DSWA", 0x001c, NOTEQUALS, 0x001c) + PORT_DIPSETTING( 0x0080, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSWA", 0x001c, NOTEQUALS, 0x001c) + PORT_DIPSETTING( 0x0000, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSWA", 0x001c, NOTEQUALS, 0x001c) +// PORT_DIPSETTING( 0x00e0, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSWA", 0x001c, NOTEQUALS, 0x001c) + PORT_DIPSETTING( 0x0020, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSWA", 0x001c, NOTEQUALS, 0x001c) + PORT_DIPSETTING( 0x0040, DEF_STR( 1C_3C ) ) PORT_CONDITION("DSWA", 0x001c, NOTEQUALS, 0x001c) + PORT_DIPSETTING( 0x0060, DEF_STR( 1C_4C ) ) PORT_CONDITION("DSWA", 0x001c, NOTEQUALS, 0x001c) + // When Coin_A is set to Free_Play, Coin_A becomes Coin_A and Coin_B, and the following dips occur + PORT_DIPNAME( 0x0020, 0x0000, "Joystick Mode" ) PORT_CONDITION("DSWA", 0x001c, EQUALS, 0x001c) PORT_DIPLOCATION("SW1:!6") + PORT_DIPSETTING( 0x0000, "90 degrees ACW" ) PORT_CONDITION("DSWA", 0x001c, EQUALS, 0x001c) + PORT_DIPSETTING( 0x0020, DEF_STR( Normal ) ) PORT_CONDITION("DSWA", 0x001c, EQUALS, 0x001c) + PORT_DIPNAME( 0x0040, 0x0000, "Effect" ) PORT_CONDITION("DSWA", 0x001c, EQUALS, 0x001c) PORT_DIPLOCATION("SW1:!7") + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) PORT_CONDITION("DSWA", 0x001c, EQUALS, 0x001c) + PORT_DIPSETTING( 0x0040, DEF_STR( On ) ) PORT_CONDITION("DSWA", 0x001c, EQUALS, 0x001c) + PORT_DIPNAME( 0x0080, 0x0000, "Music" ) PORT_CONDITION("DSWA", 0x001c, EQUALS, 0x001c) PORT_DIPLOCATION("SW1:!8") + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) PORT_CONDITION("DSWA", 0x001c, EQUALS, 0x001c) + PORT_DIPSETTING( 0x0080, DEF_STR( On ) ) PORT_CONDITION("DSWA", 0x001c, EQUALS, 0x001c) + + PORT_START("DSWB") + PORT_DIPNAME( 0x0003, 0x0000, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:!1,!2") + PORT_DIPSETTING( 0x0001, DEF_STR( Easy ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( Normal ) ) + PORT_DIPSETTING( 0x0002, DEF_STR( Hard ) ) + PORT_DIPSETTING( 0x0003, DEF_STR( Very_Hard ) ) + PORT_DIPNAME( 0x0004, 0x0000, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW2:!3") + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0004, DEF_STR( On ) ) + PORT_DIPNAME( 0x0008, 0x0000, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:!4") + PORT_DIPSETTING( 0x0008, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0070, 0x0000, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:!5,!6,!7") + PORT_DIPSETTING( 0x0030, "1" ) + PORT_DIPSETTING( 0x0020, "2" ) + PORT_DIPSETTING( 0x0000, "3" ) + PORT_DIPSETTING( 0x0010, "4" ) + PORT_DIPSETTING( 0x0040, "5" ) + PORT_DIPSETTING( 0x0050, "6" ) + PORT_DIPSETTING( 0x0060, DEF_STR( Infinite ) ) + PORT_DIPSETTING( 0x0070, "Invulnerability (Cheat)" ) + PORT_DIPNAME( 0x0080, 0x0000, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW2:!8") + PORT_DIPSETTING( 0x0000, DEF_STR( None ) ) PORT_CONDITION("JMPR",0x0003,NOTEQUALS,0x0000) // Non-Japan + PORT_DIPSETTING( 0x0080, "Every 2000k" ) PORT_CONDITION("JMPR",0x0003,NOTEQUALS,0x0000) // Non-Japan + PORT_DIPSETTING( 0x0080, "1000k and 2000k" ) PORT_CONDITION("JMPR",0x0003,EQUALS,0x0000) // Japan + PORT_DIPSETTING( 0x0000, "Every 1000k" ) PORT_CONDITION("JMPR",0x0003,EQUALS,0x0000) // Japan + + PORT_START("JMPR") // DSW3 and jumper + PORT_DIPNAME( 0x0008, 0x0000, "Stage Edit" ) PORT_DIPLOCATION("SW3:!1") + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0008, DEF_STR( On ) ) + PORT_DIPNAME( 0x0004, 0x0000, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("SW3:!2") + PORT_DIPSETTING( 0x0004, DEF_STR( No ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( Yes ) ) + PORT_CONFNAME( 0x0003, 0x0001, DEF_STR( Region ) ) //PORT_CONFLOCATION("JP:!2,!1") + PORT_CONFSETTING( 0x0001, "Europe (Tuning)" ) + PORT_CONFSETTING( 0x0002, "USA (Fabtek)" ) + PORT_CONFSETTING( 0x0000, DEF_STR( Japan ) ) + PORT_CONFSETTING( 0x0003, DEF_STR( Asia ) ) +INPUT_PORTS_END + + +static INPUT_PORTS_START( bgareggahk ) + PORT_INCLUDE( bgaregga ) + + PORT_MODIFY("JMPR") + PORT_CONFNAME( 0x0003, 0x0003, DEF_STR( Region ) ) //PORT_CONFLOCATION("JP:!2,!1") + PORT_CONFSETTING( 0x0001, "Austria (Tuning)" ) + // These two settings end up reporting ROM-0 as BAD +// PORT_CONFSETTING( 0x0002, "USA (Fabtek)" ) +// PORT_CONFSETTING( 0x0000, DEF_STR( Japan ) ) + PORT_CONFSETTING( 0x0003, "Hong Kong (Metrotainment)" ) +INPUT_PORTS_END + + +static INPUT_PORTS_START( bgareggatw ) + PORT_INCLUDE( bgaregga ) + + PORT_MODIFY("JMPR") + PORT_CONFNAME( 0x0003, 0x0003, DEF_STR( Region ) ) //PORT_CONFLOCATION("JP:!2,!1") + PORT_CONFSETTING( 0x0001, "Germany (Tuning)" ) + // These two settings end up reporting ROM-0 as BAD +// PORT_CONFSETTING( 0x0002, "USA (Fabtek)" ) +// PORT_CONFSETTING( 0x0000, DEF_STR( Japan ) ) + PORT_CONFSETTING( 0x0003, "Taiwan (Liang Hwa)" ) +INPUT_PORTS_END + + +static INPUT_PORTS_START( bgareggak ) + PORT_INCLUDE( bgaregga ) + + PORT_MODIFY("JMPR") + PORT_CONFNAME( 0x0003, 0x0003, DEF_STR( Region ) ) //PORT_CONFLOCATION("JP:!2,!1") + PORT_CONFSETTING( 0x0001, "Greece" ) + PORT_CONFSETTING( 0x0003, "Korea" ) +INPUT_PORTS_END + + +static INPUT_PORTS_START( bgareggacn ) + PORT_INCLUDE( bgaregga ) + + PORT_MODIFY("JMPR") + PORT_CONFNAME( 0x0003, 0x0003, DEF_STR( Region ) ) //PORT_CONFLOCATION("JP:!2,!1") + PORT_CONFSETTING( 0x0001, "Denmark (Tuning)" ) + // These two settings end up reporting ROM-0 as BAD +// PORT_CONFSETTING( 0x0002, "USA (Fabtek)" ) +// PORT_CONFSETTING( 0x0000, DEF_STR( Japan ) ) + PORT_CONFSETTING( 0x0003, DEF_STR( China ) ) +INPUT_PORTS_END + + +static INPUT_PORTS_START( bgareggabl ) + PORT_INCLUDE( bgaregga ) + + PORT_MODIFY("DSWB") // Always uses bonus life settings from Japan region + PORT_DIPNAME( 0x0080, 0x0000, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW2:!8") + PORT_DIPSETTING( 0x0080, "1000k and 2000k" ) + PORT_DIPSETTING( 0x0000, "Every 1000k" ) + + PORT_MODIFY("JMPR") // Region is hard-coded + PORT_BIT( 0x0003, IP_ACTIVE_HIGH, IPT_UNKNOWN ) +INPUT_PORTS_END + + + +u8 bgaregga_state::bgaregga_E01D_r() +{ + // the Z80 reads this address during its IRQ routine, + // and reads the soundlatch only if the lowest bit is clear. + return m_soundlatch[0]->pending_r() ? 0 : 1; +} + +void sstriker_state::shippumd_coin_w(u8 data) +{ + m_coincounter->coin_w(data & ~0x10); + m_oki[0]->set_rom_bank(BIT(data, 4)); +} + +void bgaregga_state::machine_reset() +{ + raizing_base_state::machine_reset(); + + common_bgaregga_reset(); +} + +void sstriker_state::mahoudai_68k_mem(address_map &map) +{ + common_mem(map, 0x07ffff); + + map(0x21c01d, 0x21c01d).w(m_coincounter, FUNC(toaplan_coincounter_device::coin_w)); + map(0x401000, 0x4017ff).ram(); // Unused palette RAM +} + +void sstriker_state::shippumd_68k_mem(address_map &map) +{ + common_mem(map, 0x0fffff); + +// map(0x21c008, 0x21c009).nopw(); // ??? + map(0x21c01d, 0x21c01d).w(FUNC(sstriker_state::shippumd_coin_w)); // Coin count/lock + oki bankswitch + map(0x401000, 0x4017ff).ram(); // Unused palette RAM +} + +void bgaregga_state::bgaregga_68k_mem(address_map &map) +{ + common_mem(map, 0x0fffff); + + map(0x21c01d, 0x21c01d).w(m_coincounter, FUNC(toaplan_coincounter_device::coin_w)); + map(0x600001, 0x600001).w(m_soundlatch[0], FUNC(generic_latch_8_device::write)); +} + +void sstriker_state::raizing_sound_z80_mem(address_map &map) +{ + map(0x0000, 0xbfff).rom(); + map(0xc000, 0xdfff).ram().share(m_shared_ram); + map(0xe000, 0xe001).rw("ymsnd", FUNC(ym2151_device::read), FUNC(ym2151_device::write)); + map(0xe004, 0xe004).rw(m_oki[0], FUNC(okim6295_device::read), FUNC(okim6295_device::write)); + map(0xe00e, 0xe00e).w(m_coincounter, FUNC(toaplan_coincounter_device::coin_w)); +} + +void bgaregga_state::bgaregga_sound_z80_mem(address_map &map) +{ + map(0x0000, 0x7fff).rom(); + map(0x8000, 0xbfff).bankr(m_audiobank); + map(0xc000, 0xdfff).ram().share(m_shared_ram); + map(0xe000, 0xe001).rw("ymsnd", FUNC(ym2151_device::read), FUNC(ym2151_device::write)); + map(0xe004, 0xe004).rw(m_oki[0], FUNC(okim6295_device::read), FUNC(okim6295_device::write)); + map(0xe006, 0xe008).w(FUNC(bgaregga_state::raizing_oki_bankswitch_w)); + map(0xe00a, 0xe00a).w(FUNC(bgaregga_state::raizing_z80_bankswitch_w)); + map(0xe00c, 0xe00c).w(m_soundlatch[0], FUNC(generic_latch_8_device::acknowledge_w)); + map(0xe01c, 0xe01c).r(m_soundlatch[0], FUNC(generic_latch_8_device::read)); + map(0xe01d, 0xe01d).r(FUNC(bgaregga_state::bgaregga_E01D_r)); +} + +static GFXDECODE_START( gfx_textrom ) + GFXDECODE_ENTRY( "text", 0, gfx_8x8x4_packed_msb, 64*16, 64 ) +GFXDECODE_END + +void sstriker_state::mahoudai(machine_config &config) +{ + /* basic machine hardware */ + M68000(config, m_maincpu, 32_MHz_XTAL/2); // 16MHz, 32MHz Oscillator + m_maincpu->set_addrmap(AS_PROGRAM, &sstriker_state::mahoudai_68k_mem); + m_maincpu->reset_cb().set(FUNC(sstriker_state::reset_audiocpu)); + + Z80(config, m_audiocpu, 32_MHz_XTAL/8); // 4MHz, 32MHz Oscillator + m_audiocpu->set_addrmap(AS_PROGRAM, &sstriker_state::raizing_sound_z80_mem); + + TOAPLAN_COINCOUNTER(config, m_coincounter, 0); + + config.set_maximum_quantum(attotime::from_hz(600)); + + /* video hardware */ + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_video_attributes(VIDEO_UPDATE_BEFORE_VBLANK); + m_screen->set_raw(27_MHz_XTAL/4, 432, 0, 320, 262, 0, 240); + m_screen->set_screen_update(FUNC(sstriker_state::screen_update)); + m_screen->screen_vblank().set(FUNC(sstriker_state::screen_vblank)); + m_screen->set_palette(m_palette); + + GFXDECODE(config, m_gfxdecode, m_palette, gfx_textrom); + PALETTE(config, m_palette).set_format(palette_device::xBGR_555, gp9001vdp_device::VDP_PALETTE_LENGTH); + + GP9001_VDP(config, m_vdp, 27_MHz_XTAL); + m_vdp->set_palette(m_palette); + m_vdp->vint_out_cb().set_inputline(m_maincpu, M68K_IRQ_4); + + /* sound hardware */ + SPEAKER(config, "mono").front_center(); + + YM2151(config, "ymsnd", 27_MHz_XTAL/8).add_route(ALL_OUTPUTS, "mono", 0.35); + + OKIM6295(config, m_oki[0], 32_MHz_XTAL/32, okim6295_device::PIN7_HIGH); + m_oki[0]->add_route(ALL_OUTPUTS, "mono", 0.5); +} + +void sstriker_state::shippumd(machine_config &config) +{ + mahoudai(config); + /* basic machine hardware */ + m_maincpu->set_addrmap(AS_PROGRAM, &sstriker_state::shippumd_68k_mem); +} + +void bgaregga_state::bgaregga(machine_config &config) +{ + /* basic machine hardware */ + M68000(config, m_maincpu, 32_MHz_XTAL/2); // 16MHz, 32MHz Oscillator + m_maincpu->set_addrmap(AS_PROGRAM, &bgaregga_state::bgaregga_68k_mem); + m_maincpu->reset_cb().set(FUNC(bgaregga_state::reset_audiocpu)); + + Z80(config, m_audiocpu, 32_MHz_XTAL/8); // 4MHz, 32MHz Oscillator + m_audiocpu->set_addrmap(AS_PROGRAM, &bgaregga_state::bgaregga_sound_z80_mem); + + TOAPLAN_COINCOUNTER(config, m_coincounter, 0); + + config.set_maximum_quantum(attotime::from_hz(6000)); + + /* video hardware */ + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_video_attributes(VIDEO_UPDATE_BEFORE_VBLANK); + m_screen->set_raw(27_MHz_XTAL/4, 432, 0, 320, 262, 0, 240); + m_screen->set_screen_update(FUNC(bgaregga_state::screen_update)); + m_screen->screen_vblank().set(FUNC(bgaregga_state::screen_vblank)); + m_screen->set_palette(m_palette); + + GFXDECODE(config, m_gfxdecode, m_palette, gfx_textrom); + PALETTE(config, m_palette).set_format(palette_device::xBGR_555, gp9001vdp_device::VDP_PALETTE_LENGTH); + + GP9001_VDP(config, m_vdp, 27_MHz_XTAL); + m_vdp->set_palette(m_palette); + m_vdp->vint_out_cb().set_inputline(m_maincpu, M68K_IRQ_4); + + /* sound hardware */ + SPEAKER(config, "mono").front_center(); + + GENERIC_LATCH_8(config, m_soundlatch[0]); + m_soundlatch[0]->data_pending_callback().set_inputline(m_audiocpu, 0); + m_soundlatch[0]->set_separate_acknowledge(true); + + YM2151(config, "ymsnd", 32_MHz_XTAL/8).add_route(ALL_OUTPUTS, "mono", 0.3); + + OKIM6295(config, m_oki[0], 32_MHz_XTAL/16, okim6295_device::PIN7_HIGH); + m_oki[0]->set_addrmap(0, &bgaregga_state::raizing_oki<0>); + m_oki[0]->add_route(ALL_OUTPUTS, "mono", 0.6); +} + + +void bgaregga_bootleg_state::bgareggabl(machine_config &config) +{ + bgaregga(config); + + m_screen->set_screen_update(FUNC(bgaregga_bootleg_state::screen_update_bootleg)); +} + + +void bgaregga_state::init_bgaregga() +{ + u8 *Z80 = memregion("audiocpu")->base(); + + m_audiobank->configure_entries(0, 8, Z80, 0x4000); // Test mode only, Mirror of First 128KB Areas? + m_audiobank->configure_entries(8, 8, Z80, 0x4000); + install_raizing_okibank(0); +} + + + +/* -------------------------- Raizing games ------------------------- */ + + +/* +For the two sets of Sorcer Striker (World) the only differences +are 2 bytes plus a corrected checksum for each set: + +File Offset sstriker sstrikera + 0x160 17 0B <-- Rom checksum value + 0x161 79 6D <-- Rom checksum value + + 0x92C 18 0C <-- Index of copyright strings to display for Korea + 0x92D 18 0C <-- Index of copyright strings to display for Korea + +0C points to the strings "LICENSED TO UNITE TRADING" / "FOR KOREA". +18 points to a pair of empty strings. + +Printed labels for the eproms look like: + +RA-MA-01 + 01 +RAIZING + +Both English and Japanese sets use the same labels and numbers for the roms +even if the roms contain different code / data. +*/ + +ROM_START( sstriker ) + ROM_REGION( 0x080000, "maincpu", 0 ) /* Main 68K code */ + ROM_LOAD16_WORD_SWAP( "ra-ma_01_01.u65", 0x000000, 0x080000, CRC(708fd51d) SHA1(167186d4cf13af37ec0fa6a59c738c54dbbf3c7c) ) + + ROM_REGION( 0x10000, "audiocpu", 0 ) /* Sound Z80 code */ + ROM_LOAD( "ra-ma-01_02.u66", 0x00000, 0x10000, CRC(eabfa46d) SHA1(402c99ebf88f9025f74f0a28ced22b7882a65eb3) ) + + ROM_REGION( 0x200000, "gp9001", 0 ) + ROM_LOAD( "ra-ma01-rom2.u2", 0x000000, 0x100000, CRC(54e2bd95) SHA1(341359dd46152615675bb90e8a184216c8feebff) ) + ROM_LOAD( "ra-ma01-rom3.u1", 0x100000, 0x100000, CRC(21cd378f) SHA1(e1695bccec949d18b1c03e9c42dca384554b0d7c) ) + + ROM_REGION( 0x008000, "text", 0 ) + ROM_LOAD( "ra-ma-01_05.u81", 0x000000, 0x008000, CRC(88b58841) SHA1(1d16b538c11a291bd1f46a510bfbd6259b45a0b5) ) + + ROM_REGION( 0x40000, "oki1", 0 ) /* ADPCM Samples */ + ROM_LOAD( "ra-ma01-rom1.u57", 0x00000, 0x40000, CRC(6edb2ab8) SHA1(e3032e8eda2686f30df4b7a088c5a4d4d45782ed) ) +ROM_END + + +ROM_START( sstrikerk ) + ROM_REGION( 0x080000, "maincpu", 0 ) /* Main 68K code */ + ROM_LOAD16_WORD_SWAP( "ra-ma-01_01.u65", 0x000000, 0x080000, CRC(92259f84) SHA1(127e62e407d95efd360bfe2cac9577f326abf6ef) ) + + ROM_REGION( 0x10000, "audiocpu", 0 ) /* Sound Z80 code */ + ROM_LOAD( "ra-ma-01_02.u66", 0x00000, 0x10000, CRC(eabfa46d) SHA1(402c99ebf88f9025f74f0a28ced22b7882a65eb3) ) + + ROM_REGION( 0x200000, "gp9001", 0 ) + ROM_LOAD( "ra-ma01-rom2.u2", 0x000000, 0x100000, CRC(54e2bd95) SHA1(341359dd46152615675bb90e8a184216c8feebff) ) + ROM_LOAD( "ra-ma01-rom3.u1", 0x100000, 0x100000, CRC(21cd378f) SHA1(e1695bccec949d18b1c03e9c42dca384554b0d7c) ) + // also seen with 4 smaller ROMs instead of 2 + // 01.bin ra-ma01-rom2.u2 [even] IDENTICAL + // 02.bin ra-ma01-rom2.u2 [odd] IDENTICAL + // 03.bin ra-ma01-rom3.u1 [even] IDENTICAL + // 04.bin ra-ma01-rom3.u1 [odd] IDENTICAL + + ROM_REGION( 0x008000, "text", 0 ) + ROM_LOAD( "ra-ma-01_05.u81", 0x000000, 0x008000, CRC(88b58841) SHA1(1d16b538c11a291bd1f46a510bfbd6259b45a0b5) ) + + ROM_REGION( 0x40000, "oki1", 0 ) /* ADPCM Samples */ + ROM_LOAD( "ra-ma01-rom1.u57", 0x00000, 0x40000, CRC(6edb2ab8) SHA1(e3032e8eda2686f30df4b7a088c5a4d4d45782ed) ) +ROM_END + + +ROM_START( mahoudai ) + ROM_REGION( 0x080000, "maincpu", 0 ) /* Main 68K code */ + ROM_LOAD16_WORD_SWAP( "ra_ma_01_01.u65", 0x000000, 0x080000, CRC(970ccc5c) SHA1(c87cab83bde0284e631f02e50068407fee81d941) ) + + ROM_REGION( 0x10000, "audiocpu", 0 ) /* Sound Z80 code */ + ROM_LOAD( "ra-ma-01_02.u66", 0x00000, 0x10000, CRC(eabfa46d) SHA1(402c99ebf88f9025f74f0a28ced22b7882a65eb3) ) + + ROM_REGION( 0x200000, "gp9001", 0 ) + ROM_LOAD( "ra-ma01-rom2.u2", 0x000000, 0x100000, CRC(54e2bd95) SHA1(341359dd46152615675bb90e8a184216c8feebff) ) + ROM_LOAD( "ra-ma01-rom3.u1", 0x100000, 0x100000, CRC(21cd378f) SHA1(e1695bccec949d18b1c03e9c42dca384554b0d7c) ) + + ROM_REGION( 0x008000, "text", 0 ) + ROM_LOAD( "ra_ma_01_05.u81", 0x000000, 0x008000, CRC(c00d1e80) SHA1(53e64c4c0c6309130b37597d13b44a9e95b717d8) ) + + ROM_REGION( 0x40000, "oki1", 0 ) /* ADPCM Samples */ + ROM_LOAD( "ra-ma01-rom1.u57", 0x00000, 0x40000, CRC(6edb2ab8) SHA1(e3032e8eda2686f30df4b7a088c5a4d4d45782ed) ) +ROM_END + + +ROM_START( kingdmgp ) + ROM_REGION( 0x100000, "maincpu", 0 ) /* Main 68K code */ + ROM_LOAD16_BYTE( "ma02rom1.bin", 0x000000, 0x080000, CRC(a678b149) SHA1(8c1a631e023dbba0a3fa6cd1b7d10dec1663213a) ) + ROM_LOAD16_BYTE( "ma02rom0.bin", 0x000001, 0x080000, CRC(f226a212) SHA1(526acf3d05fdc88054a772fbea3de2af532bf3d2) ) + + ROM_REGION( 0x10000, "audiocpu", 0 ) /* Sound Z80 code */ + ROM_LOAD( "ma02rom2.bin", 0x00000, 0x10000, CRC(dde8a57e) SHA1(f522a3f17e229c71512464349760a9e27778bf6a) ) + + ROM_REGION( 0x400000, "gp9001", 0 ) + ROM_LOAD( "ma02rom3.bin", 0x000000, 0x200000, CRC(0e797142) SHA1(a480ccd151e49b886d3175a6deff56e1f2c26c3e) ) + ROM_LOAD( "ma02rom4.bin", 0x200000, 0x200000, CRC(72a6fa53) SHA1(ce92e65205b84361cfb90305a61e9541b5c4dc2f) ) + + ROM_REGION( 0x008000, "text", 0 ) + ROM_LOAD( "ma02rom5.eng", 0x000000, 0x008000, CRC(8c28460b) SHA1(0aed170762f6044896a7e608df60bbd37c583a71) ) + + ROM_REGION( 0x80000, "oki1", 0 ) /* ADPCM Samples */ + ROM_LOAD( "ma02rom6.bin", 0x00000, 0x80000, CRC(199e7cae) SHA1(0f5e13cc8ec42c80bb4bbff90aba29cdb15213d4) ) +ROM_END + + +ROM_START( shippumd ) + ROM_REGION( 0x100000, "maincpu", 0 ) /* Main 68K code */ + ROM_LOAD16_BYTE( "ma02rom1.bin", 0x000000, 0x080000, CRC(a678b149) SHA1(8c1a631e023dbba0a3fa6cd1b7d10dec1663213a) ) + ROM_LOAD16_BYTE( "ma02rom0.bin", 0x000001, 0x080000, CRC(f226a212) SHA1(526acf3d05fdc88054a772fbea3de2af532bf3d2) ) + + ROM_REGION( 0x10000, "audiocpu", 0 ) /* Sound Z80 code */ + ROM_LOAD( "ma02rom2.bin", 0x00000, 0x10000, CRC(dde8a57e) SHA1(f522a3f17e229c71512464349760a9e27778bf6a) ) + + ROM_REGION( 0x400000, "gp9001", 0 ) + ROM_LOAD( "ma02rom3.bin", 0x000000, 0x200000, CRC(0e797142) SHA1(a480ccd151e49b886d3175a6deff56e1f2c26c3e) ) + ROM_LOAD( "ma02rom4.bin", 0x200000, 0x200000, CRC(72a6fa53) SHA1(ce92e65205b84361cfb90305a61e9541b5c4dc2f) ) + + ROM_REGION( 0x008000, "text", 0 ) + ROM_LOAD( "ma02rom5.bin", 0x000000, 0x008000, CRC(116ae559) SHA1(4cc2d2a23cc0aefd457111b7990e47184e79204c) ) + + ROM_REGION( 0x80000, "oki1", 0 ) /* ADPCM Samples */ + ROM_LOAD( "ma02rom6.bin", 0x00000, 0x80000, CRC(199e7cae) SHA1(0f5e13cc8ec42c80bb4bbff90aba29cdb15213d4) ) +ROM_END + +ROM_START( bgareggat ) + /* Dumped from a location test board, with some minor changes compared to the final. + * All ROMs are socketed + * All PAL/GALs are socketed + * PLDs at U33, U125 are PALCE16V8H/4 instead of GAL16V8B as usual (no functional impact) + * JP4 features four DIP switches, instead of two DIPs + two jumpers as in the final. + + The date codes are written referencing Heisei year 8 (1996). + + The program ROMs feature hand-written labels formatted like this: + BATTLE GAREGGA + PRG 0 + 8.1.17. + */ + ROM_REGION( 0x100000, "maincpu", 0 ) /* Main 68K code */ + ROM_LOAD16_BYTE( "battlegaregga-prg0-8-1-17.bin", 0x000000, 0x080000, CRC(c032176f) SHA1(799ba0424489361dd2f814afaf841326bc23300c) ) + ROM_LOAD16_BYTE( "battlegaregga-prg1-8-1-17.bin", 0x000001, 0x080000, CRC(3822f375) SHA1(a5a84cf48c86d8ac97f401280667658d7f451896) ) + + /* Hand-written label that reads + BATTLE GAREGGA + SND + 8.1.18. ロケVer. + */ + ROM_REGION( 0x20000, "audiocpu", 0 ) /* Sound Z80 code + bank */ + ROM_LOAD( "battlegaregga-snd-8-1-18-loke-ver.bin", 0x00000, 0x20000, CRC(f5ea56f7) SHA1(9db04069b378dbad6626fd29d3762e3361b9aa0d) ) + + /* Stored on NEC ES23C16000W Mask ROMs with no Raizing/8ing custom markings.*/ + ROM_REGION( 0x800000, "gp9001", 0 ) + ROM_LOAD( "rom4.bin", 0x000000, 0x200000, CRC(b333d81f) SHA1(5481465f1304334fd55798be2f44324c57c2dbcb) ) + ROM_LOAD( "rom3.bin", 0x200000, 0x200000, CRC(51b9ebfb) SHA1(30e0c326f5175aa436df8dba08f6f4e08130b92f) ) + ROM_LOAD( "rom2.bin", 0x400000, 0x200000, CRC(b330e5e2) SHA1(5d48e9d56f99d093b6390e0af1609fd796df2d35) ) + ROM_LOAD( "rom1.bin", 0x600000, 0x200000, CRC(7eafdd70) SHA1(7c8da8e86c3f9491719b1d7d5d285568d7614f38) ) + + /* Hand-written label that reads + BATTLE GAREGGA + TEXT + 8.1.17. 8AA6 + + 8AA6 is the checksum of the text ROM, which matches release. + */ + ROM_REGION( 0x008000, "text", 0 ) + ROM_LOAD( "text.u81", 0x00000, 0x08000, CRC(e67fd534) SHA1(987d0edffc2c243a13d4567319ea3d185eaadbf8) ) + + /* Stored on an NEC ES23C8001EJ Mask ROM with no Raizing/8ing custom markings.*/ + ROM_REGION( 0x100000, "oki1", 0 ) /* ADPCM Samples */ + ROM_LOAD( "rom5.bin", 0x000000, 0x100000, CRC(f6d49863) SHA1(3a3c354852adad06e8a051511abfab7606bce382) ) +ROM_END + +ROM_START( bgaregga ) + ROM_REGION( 0x100000, "maincpu", 0 ) /* Main 68K code */ + ROM_LOAD16_BYTE( "prg0.bin", 0x000000, 0x080000, CRC(f80c2fc2) SHA1(a9aac5c7f5439b6fe8d1b3db1fb02a27cc28fdf6) ) + ROM_LOAD16_BYTE( "prg1.bin", 0x000001, 0x080000, CRC(2ccfdd1e) SHA1(7a9f11f851854f3f8389b9c3c0906ebb8dc28712) ) + + ROM_REGION( 0x20000, "audiocpu", 0 ) /* Sound Z80 code + bank */ + ROM_LOAD( "snd.bin", 0x00000, 0x20000, CRC(68632952) SHA1(fb834db83157948e2b420b6051102a9c6ac3969b) ) + + ROM_REGION( 0x800000, "gp9001", 0 ) + ROM_LOAD( "rom4.bin", 0x000000, 0x200000, CRC(b333d81f) SHA1(5481465f1304334fd55798be2f44324c57c2dbcb) ) + ROM_LOAD( "rom3.bin", 0x200000, 0x200000, CRC(51b9ebfb) SHA1(30e0c326f5175aa436df8dba08f6f4e08130b92f) ) + ROM_LOAD( "rom2.bin", 0x400000, 0x200000, CRC(b330e5e2) SHA1(5d48e9d56f99d093b6390e0af1609fd796df2d35) ) + ROM_LOAD( "rom1.bin", 0x600000, 0x200000, CRC(7eafdd70) SHA1(7c8da8e86c3f9491719b1d7d5d285568d7614f38) ) + + ROM_REGION( 0x008000, "text", 0 ) + ROM_LOAD( "text.u81", 0x00000, 0x08000, CRC(e67fd534) SHA1(987d0edffc2c243a13d4567319ea3d185eaadbf8) ) + + ROM_REGION( 0x100000, "oki1", 0 ) /* ADPCM Samples */ + ROM_LOAD( "rom5.bin", 0x000000, 0x100000, CRC(f6d49863) SHA1(3a3c354852adad06e8a051511abfab7606bce382) ) +ROM_END + + +ROM_START( bgareggahk ) + ROM_REGION( 0x100000, "maincpu", 0 ) /* Main 68K code */ + ROM_LOAD16_BYTE( "prg_0.rom", 0x000000, 0x080000, CRC(26e0019e) SHA1(5197001f5d59246b137e19ed1952a8207b25d4c0) ) + ROM_LOAD16_BYTE( "prg_1.rom", 0x000001, 0x080000, CRC(2ccfdd1e) SHA1(7a9f11f851854f3f8389b9c3c0906ebb8dc28712) ) + + ROM_REGION( 0x20000, "audiocpu", 0 ) /* Sound Z80 code + bank */ + ROM_LOAD( "snd.bin", 0x00000, 0x20000, CRC(68632952) SHA1(fb834db83157948e2b420b6051102a9c6ac3969b) ) + + ROM_REGION( 0x800000, "gp9001", 0 ) + ROM_LOAD( "rom4.bin", 0x000000, 0x200000, CRC(b333d81f) SHA1(5481465f1304334fd55798be2f44324c57c2dbcb) ) + ROM_LOAD( "rom3.bin", 0x200000, 0x200000, CRC(51b9ebfb) SHA1(30e0c326f5175aa436df8dba08f6f4e08130b92f) ) + ROM_LOAD( "rom2.bin", 0x400000, 0x200000, CRC(b330e5e2) SHA1(5d48e9d56f99d093b6390e0af1609fd796df2d35) ) + ROM_LOAD( "rom1.bin", 0x600000, 0x200000, CRC(7eafdd70) SHA1(7c8da8e86c3f9491719b1d7d5d285568d7614f38) ) + + ROM_REGION( 0x008000, "text", 0 ) + ROM_LOAD( "text.u81", 0x00000, 0x08000, CRC(e67fd534) SHA1(987d0edffc2c243a13d4567319ea3d185eaadbf8) ) + + ROM_REGION( 0x100000, "oki1", 0 ) /* ADPCM Samples */ + ROM_LOAD( "rom5.bin", 0x000000, 0x100000, CRC(f6d49863) SHA1(3a3c354852adad06e8a051511abfab7606bce382) ) +ROM_END + + +ROM_START( bgareggatw ) + ROM_REGION( 0x100000, "maincpu", 0 ) /* Main 68K code */ + ROM_LOAD16_BYTE( "garegga_prg0.u123", 0x000000, 0x080000, CRC(235b7405) SHA1(a2434801df4231a6b48f6c63f47c202d25a89e79) ) + ROM_LOAD16_BYTE( "garegga_prg1.u65", 0x000001, 0x080000, CRC(c29ccf6a) SHA1(38806e0b4ff852f4bfefd80c56ca23f71623e275) ) + + ROM_REGION( 0x20000, "audiocpu", 0 ) /* Sound Z80 code + bank */ + ROM_LOAD( "snd.bin", 0x00000, 0x20000, CRC(68632952) SHA1(fb834db83157948e2b420b6051102a9c6ac3969b) ) + + ROM_REGION( 0x800000, "gp9001", 0 ) + ROM_LOAD( "rom4.bin", 0x000000, 0x200000, CRC(b333d81f) SHA1(5481465f1304334fd55798be2f44324c57c2dbcb) ) + ROM_LOAD( "rom3.bin", 0x200000, 0x200000, CRC(51b9ebfb) SHA1(30e0c326f5175aa436df8dba08f6f4e08130b92f) ) + ROM_LOAD( "rom2.bin", 0x400000, 0x200000, CRC(b330e5e2) SHA1(5d48e9d56f99d093b6390e0af1609fd796df2d35) ) + ROM_LOAD( "rom1.bin", 0x600000, 0x200000, CRC(7eafdd70) SHA1(7c8da8e86c3f9491719b1d7d5d285568d7614f38) ) + + ROM_REGION( 0x008000, "text", 0 ) + ROM_LOAD( "text.u81", 0x00000, 0x08000, CRC(e67fd534) SHA1(987d0edffc2c243a13d4567319ea3d185eaadbf8) ) + + ROM_REGION( 0x100000, "oki1", 0 ) /* ADPCM Samples */ + ROM_LOAD( "rom5.bin", 0x000000, 0x100000, CRC(f6d49863) SHA1(3a3c354852adad06e8a051511abfab7606bce382) ) +ROM_END + + +// only the program ROMs' dumps were provided for this set. +// According to the dumper: 'In the Korea Region Setting, DIP SWITCH's 'STAGE EDIT' does not work and +// the C button (formation change) function in the in-game is also deleted.' +ROM_START( bgareggak ) + ROM_REGION( 0x100000, "maincpu", 0 ) // Main 68K code + ROM_LOAD16_BYTE( "prg0.bin", 0x000000, 0x080000, CRC(40a108a7) SHA1(cc3227dc87ffefb961dbcdff146e787dbfbdfc2c) ) + ROM_LOAD16_BYTE( "prg1.bin", 0x000001, 0x080000, CRC(45a6e48a) SHA1(f4d4158b8556b4261291ba9905b9731623b47e54) ) + + ROM_REGION( 0x20000, "audiocpu", 0 ) // Sound Z80 code + bank + ROM_LOAD( "snd.bin", 0x00000, 0x20000, BAD_DUMP CRC(68632952) SHA1(fb834db83157948e2b420b6051102a9c6ac3969b) ) + + ROM_REGION( 0x800000, "gp9001", 0 ) + ROM_LOAD( "rom4.bin", 0x000000, 0x200000, BAD_DUMP CRC(b333d81f) SHA1(5481465f1304334fd55798be2f44324c57c2dbcb) ) + ROM_LOAD( "rom3.bin", 0x200000, 0x200000, BAD_DUMP CRC(51b9ebfb) SHA1(30e0c326f5175aa436df8dba08f6f4e08130b92f) ) + ROM_LOAD( "rom2.bin", 0x400000, 0x200000, BAD_DUMP CRC(b330e5e2) SHA1(5d48e9d56f99d093b6390e0af1609fd796df2d35) ) + ROM_LOAD( "rom1.bin", 0x600000, 0x200000, BAD_DUMP CRC(7eafdd70) SHA1(7c8da8e86c3f9491719b1d7d5d285568d7614f38) ) + + ROM_REGION( 0x008000, "text", 0 ) + ROM_LOAD( "text.u81", 0x00000, 0x08000, BAD_DUMP CRC(e67fd534) SHA1(987d0edffc2c243a13d4567319ea3d185eaadbf8) ) + + ROM_REGION( 0x100000, "oki1", 0 ) // ADPCM Samples + ROM_LOAD( "rom5.bin", 0x000000, 0x100000, BAD_DUMP CRC(f6d49863) SHA1(3a3c354852adad06e8a051511abfab7606bce382) ) +ROM_END + + +ROM_START( bgaregganv ) + ROM_REGION( 0x100000, "maincpu", 0 ) /* Main 68K code */ + ROM_LOAD16_BYTE( "prg_0.bin", 0x000000, 0x080000, CRC(951ecc07) SHA1(a82e4b59e4a974566e59f3ab2fbae1aec7d88a2b) ) + ROM_LOAD16_BYTE( "prg_1.bin", 0x000001, 0x080000, CRC(729a60c6) SHA1(cb6f5d138bb82c32910f42d8ee16fa573a23cef3) ) + + ROM_REGION( 0x20000, "audiocpu", 0 ) /* Sound Z80 code + bank */ + ROM_LOAD( "snd.bin", 0x00000, 0x20000, CRC(68632952) SHA1(fb834db83157948e2b420b6051102a9c6ac3969b) ) + + ROM_REGION( 0x800000, "gp9001", 0 ) + ROM_LOAD( "rom4.bin", 0x000000, 0x200000, CRC(b333d81f) SHA1(5481465f1304334fd55798be2f44324c57c2dbcb) ) + ROM_LOAD( "rom3.bin", 0x200000, 0x200000, CRC(51b9ebfb) SHA1(30e0c326f5175aa436df8dba08f6f4e08130b92f) ) + ROM_LOAD( "rom2.bin", 0x400000, 0x200000, CRC(b330e5e2) SHA1(5d48e9d56f99d093b6390e0af1609fd796df2d35) ) + ROM_LOAD( "rom1.bin", 0x600000, 0x200000, CRC(7eafdd70) SHA1(7c8da8e86c3f9491719b1d7d5d285568d7614f38) ) + + ROM_REGION( 0x008000, "text", 0 ) + ROM_LOAD( "text.u81", 0x00000, 0x08000, CRC(e67fd534) SHA1(987d0edffc2c243a13d4567319ea3d185eaadbf8) ) + + ROM_REGION( 0x100000, "oki1", 0 ) /* ADPCM Samples */ + ROM_LOAD( "rom5.bin", 0x000000, 0x100000, CRC(f6d49863) SHA1(3a3c354852adad06e8a051511abfab7606bce382) ) +ROM_END + + +ROM_START( bgareggat2 ) + ROM_REGION( 0x100000, "maincpu", 0 ) /* Main 68K code */ + ROM_LOAD16_BYTE( "prg0", 0x000000, 0x080000, CRC(84094099) SHA1(49fc68a8bcdae4477e20eade9dd569de88b0b798) ) + ROM_LOAD16_BYTE( "prg1", 0x000001, 0x080000, CRC(46f92fe4) SHA1(62a02cc1dbdc3ac362339aebb62368eb89b06bad) ) + + ROM_REGION( 0x20000, "audiocpu", 0 ) /* Sound Z80 code + bank */ + ROM_LOAD( "snd.bin", 0x00000, 0x20000, CRC(68632952) SHA1(fb834db83157948e2b420b6051102a9c6ac3969b) ) + + ROM_REGION( 0x800000, "gp9001", 0 ) + ROM_LOAD( "rom4.bin", 0x000000, 0x200000, CRC(b333d81f) SHA1(5481465f1304334fd55798be2f44324c57c2dbcb) ) + ROM_LOAD( "rom3.bin", 0x200000, 0x200000, CRC(51b9ebfb) SHA1(30e0c326f5175aa436df8dba08f6f4e08130b92f) ) + ROM_LOAD( "rom2.bin", 0x400000, 0x200000, CRC(b330e5e2) SHA1(5d48e9d56f99d093b6390e0af1609fd796df2d35) ) + ROM_LOAD( "rom1.bin", 0x600000, 0x200000, CRC(7eafdd70) SHA1(7c8da8e86c3f9491719b1d7d5d285568d7614f38) ) + + ROM_REGION( 0x008000, "text", 0 ) + ROM_LOAD( "text.u81", 0x00000, 0x08000, CRC(e67fd534) SHA1(987d0edffc2c243a13d4567319ea3d185eaadbf8) ) + + ROM_REGION( 0x100000, "oki1", 0 ) /* ADPCM Samples */ + ROM_LOAD( "rom5.bin", 0x000000, 0x100000, CRC(f6d49863) SHA1(3a3c354852adad06e8a051511abfab7606bce382) ) +ROM_END + + +ROM_START( bgareggacn ) + ROM_REGION( 0x100000, "maincpu", 0 ) /* Main 68K code */ + ROM_LOAD16_BYTE( "u123", 0x000000, 0x080000, CRC(88a4e66a) SHA1(ca97e564eed0c5e028b937312e55da56400d5c8c) ) + ROM_LOAD16_BYTE( "u65", 0x000001, 0x080000, CRC(5dea32a3) SHA1(59df6689e3eb5ea9e49a758604d21a64c65ca14d) ) + + ROM_REGION( 0x20000, "audiocpu", 0 ) /* Sound Z80 code + bank */ + ROM_LOAD( "snd.bin", 0x00000, 0x20000, CRC(68632952) SHA1(fb834db83157948e2b420b6051102a9c6ac3969b) ) + + ROM_REGION( 0x800000, "gp9001", 0 ) + ROM_LOAD( "rom4.bin", 0x000000, 0x200000, CRC(b333d81f) SHA1(5481465f1304334fd55798be2f44324c57c2dbcb) ) + ROM_LOAD( "rom3.bin", 0x200000, 0x200000, CRC(51b9ebfb) SHA1(30e0c326f5175aa436df8dba08f6f4e08130b92f) ) + ROM_LOAD( "rom2.bin", 0x400000, 0x200000, CRC(b330e5e2) SHA1(5d48e9d56f99d093b6390e0af1609fd796df2d35) ) + ROM_LOAD( "rom1.bin", 0x600000, 0x200000, CRC(7eafdd70) SHA1(7c8da8e86c3f9491719b1d7d5d285568d7614f38) ) + + ROM_REGION( 0x008000, "text", 0 ) + ROM_LOAD( "text.u81", 0x00000, 0x08000, CRC(e67fd534) SHA1(987d0edffc2c243a13d4567319ea3d185eaadbf8) ) + + ROM_REGION( 0x100000, "oki1", 0 ) /* ADPCM Samples */ + ROM_LOAD( "rom5.bin", 0x000000, 0x100000, CRC(f6d49863) SHA1(3a3c354852adad06e8a051511abfab7606bce382) ) +ROM_END + +// 1945二代 (1945 Èr Dài) +ROM_START( bgareggabl ) + ROM_REGION( 0x100000, "maincpu", 0 ) /* Main 68K code */ + ROM_LOAD16_WORD_SWAP( "xt-8m.bin", 0x000000, 0x100000, CRC(4a6657cb) SHA1(1838956e7597eaa78ea5ee58d0ccc79cbbd7ded5) ) + + ROM_REGION( 0x20000, "audiocpu", 0 ) /* Sound Z80 code + bank */ + ROM_LOAD( "snd.bin", 0x00000, 0x20000, CRC(68632952) SHA1(fb834db83157948e2b420b6051102a9c6ac3969b) ) + + ROM_REGION( 0x800000, "gp9001", 0 ) + ROM_LOAD( "6@-322", 0x000000, 0x400000, CRC(37fe48ed) SHA1(ded5d13c33b4582310cdfb3dd52c052f741c00c5) ) /* == rom4.bin+rom3.bin */ + ROM_LOAD( "5@-322", 0x400000, 0x400000, CRC(5a06c031) SHA1(ee241ff90117cec1f33ab163601a9d5c75609739) ) /* == rom2.bin+rom1.bin */ + + ROM_REGION( 0x008000, "text", 0 ) + ROM_LOAD( "1@-256", 0x00000, 0x08000, CRC(760dcd14) SHA1(e151e5d7ca5557277f306b9484ec021f4edf1e07) ) + + ROM_REGION( 0x010000, "user1", 0 ) // not graphics + ROM_LOAD( "2@-256", 0x00000, 0x08000, CRC(456dd16e) SHA1(84779ee64d3ea33ba1ba4dee39b504a81c6811a1) ) + + ROM_REGION( 0x100000, "oki1", 0 ) /* ADPCM Samples */ + ROM_LOAD( "rom5.bin", 0x000000, 0x100000, CRC(f6d49863) SHA1(3a3c354852adad06e8a051511abfab7606bce382) ) +ROM_END + +// 雷神传 (Léishén Chuán) +ROM_START( bgareggabla ) + ROM_REGION( 0x100000, "maincpu", 0 ) /* Main 68K code */ + ROM_LOAD16_WORD_SWAP( "27c8100.mon-sys", 0x000000, 0x100000, CRC(d334e5aa) SHA1(41607b5630d7b92a96607ea95c5b55ad43745857) ) + + ROM_REGION( 0x20000, "audiocpu", 0 ) /* Sound Z80 code + bank */ + ROM_LOAD( "snd.bin", 0x00000, 0x20000, CRC(68632952) SHA1(fb834db83157948e2b420b6051102a9c6ac3969b) ) + + ROM_REGION( 0x800000, "gp9001", 0 ) + ROM_LOAD( "rom4.bin", 0x000000, 0x200000, CRC(b333d81f) SHA1(5481465f1304334fd55798be2f44324c57c2dbcb) ) + ROM_LOAD( "rom3.bin", 0x200000, 0x200000, CRC(51b9ebfb) SHA1(30e0c326f5175aa436df8dba08f6f4e08130b92f) ) + ROM_LOAD( "rom2.bin", 0x400000, 0x200000, CRC(b330e5e2) SHA1(5d48e9d56f99d093b6390e0af1609fd796df2d35) ) + ROM_LOAD( "rom1.bin", 0x600000, 0x200000, CRC(7eafdd70) SHA1(7c8da8e86c3f9491719b1d7d5d285568d7614f38) ) + + ROM_REGION( 0x008000, "text", 0 ) + ROM_LOAD( "text.bin", 0x00000, 0x08000, CRC(00d100bd) SHA1(fb6028e3519d6588a966d1b16d47453db2e51fd7)) + + ROM_REGION( 0x010000, "user1", 0 ) // not graphics + ROM_LOAD( "base.bin", 0x00000, 0x08000, CRC(456dd16e) SHA1(84779ee64d3ea33ba1ba4dee39b504a81c6811a1) ) + + ROM_REGION( 0x100000, "oki1", 0 ) /* ADPCM Samples */ + ROM_LOAD( "rom5.bin", 0x000000, 0x100000, CRC(f6d49863) SHA1(3a3c354852adad06e8a051511abfab7606bce382) ) +ROM_END + +ROM_START( bgareggablj ) // fixed on Japanese region + ROM_REGION( 0x100000, "maincpu", 0 ) // Main 68K code + ROM_LOAD16_WORD_SWAP( "sys.bin", 0x000000, 0x100000, CRC(b2a1225f) SHA1(dda00aa5e7ce3f39bb0eebbcd9500ef22a5d74d3) ) // 1ST AND 2ND HALF IDENTICAL + ROM_IGNORE( 0x100000 ) + + ROM_REGION( 0x20000, "audiocpu", 0 ) // Sound Z80 code + bank + ROM_LOAD( "snd.bin", 0x00000, 0x20000, CRC(68632952) SHA1(fb834db83157948e2b420b6051102a9c6ac3969b) ) + + ROM_REGION( 0x800000, "gp9001", 0 ) + ROM_LOAD( "322_2.bin", 0x000000, 0x400000, CRC(37fe48ed) SHA1(ded5d13c33b4582310cdfb3dd52c052f741c00c5) ) // == rom4.bin+rom3.bin + ROM_LOAD( "322_1.bin", 0x400000, 0x400000, CRC(5a06c031) SHA1(ee241ff90117cec1f33ab163601a9d5c75609739) ) // == rom2.bin+rom1.bin + + ROM_REGION( 0x008000, "text", 0 ) + ROM_LOAD( "text.bin", 0x00000, 0x08000, CRC(e67fd534) SHA1(987d0edffc2c243a13d4567319ea3d185eaadbf8) ) + + ROM_REGION( 0x010000, "user1", 0 ) // not graphics + ROM_LOAD( "base.bin", 0x00000, 0x08000, CRC(456dd16e) SHA1(84779ee64d3ea33ba1ba4dee39b504a81c6811a1) ) + + ROM_REGION( 0x100000, "oki1", 0 ) // ADPCM Samples + ROM_LOAD( "rom5.bin", 0x000000, 0x100000, CRC(f6d49863) SHA1(3a3c354852adad06e8a051511abfab7606bce382) ) +ROM_END + +} // anonymous namespace + + +GAME( 1993, sstriker, 0, mahoudai, sstriker, sstriker_state, empty_init, ROT270, "Raizing", "Sorcer Striker", MACHINE_SUPPORTS_SAVE ) // verified on two different PCBs +GAME( 1993, sstrikerk, sstriker, mahoudai, sstrikerk, sstriker_state, empty_init, ROT270, "Raizing (Unite Trading license)", "Sorcer Striker (Korea)", MACHINE_SUPPORTS_SAVE ) // Although the region jumper is functional, it's a Korean board / version +GAME( 1993, mahoudai, sstriker, mahoudai, mahoudai, sstriker_state, empty_init, ROT270, "Raizing (Able license)", "Mahou Daisakusen (Japan)", MACHINE_SUPPORTS_SAVE ) + +GAME( 1994, kingdmgp, 0, shippumd, kingdmgp, sstriker_state, empty_init, ROT270, "Raizing / Eighting", "Kingdom Grandprix", MACHINE_SUPPORTS_SAVE ) // from Korean board, missing letters on credits screen but this is correct +GAME( 1994, shippumd, kingdmgp, shippumd, shippumd, sstriker_state, empty_init, ROT270, "Raizing / Eighting", "Shippu Mahou Daisakusen (Japan)", MACHINE_SUPPORTS_SAVE ) + +GAME( 1996, bgaregga, 0, bgaregga, bgaregga, bgaregga_state, init_bgaregga, ROT270, "Raizing / Eighting", "Battle Garegga (Europe / USA / Japan / Asia) (Sat Feb 3 1996)", MACHINE_SUPPORTS_SAVE ) +GAME( 1996, bgareggat, bgaregga, bgaregga, bgaregga, bgaregga_state, init_bgaregga, ROT270, "Raizing / Eighting", "Battle Garegga (location test) (Wed Jan 17 1996)", MACHINE_SUPPORTS_SAVE ) +GAME( 1996, bgareggahk, bgaregga, bgaregga, bgareggahk, bgaregga_state, init_bgaregga, ROT270, "Raizing / Eighting", "Battle Garegga (Austria / Hong Kong) (Sat Feb 3 1996)", MACHINE_SUPPORTS_SAVE ) +GAME( 1996, bgareggatw, bgaregga, bgaregga, bgareggatw, bgaregga_state, init_bgaregga, ROT270, "Raizing / Eighting", "Battle Garegga (Taiwan / Germany) (Thu Feb 1 1996)", MACHINE_SUPPORTS_SAVE ) +GAME( 1996, bgareggak, bgaregga, bgaregga, bgareggak, bgaregga_state, init_bgaregga, ROT270, "Raizing / Eighting", "Battle Garegga (Korea / Greece) (Wed Feb 7 1996)", MACHINE_SUPPORTS_SAVE ) +GAME( 1996, bgaregganv, bgaregga, bgaregga, bgareggahk, bgaregga_state, init_bgaregga, ROT270, "Raizing / Eighting", "Battle Garegga - New Version (Austria / Hong Kong) (Sat Mar 2 1996)", MACHINE_SUPPORTS_SAVE ) // displays New Version only when set to HK +GAME( 1996, bgareggat2, bgaregga, bgaregga, bgaregga, bgaregga_state, init_bgaregga, ROT270, "Raizing / Eighting", "Battle Garegga - Type 2 (Europe / USA / Japan / Asia) (Sat Mar 2 1996)", MACHINE_SUPPORTS_SAVE ) // displays Type 2 only when set to Europe +GAME( 1996, bgareggacn, bgaregga, bgaregga, bgareggacn, bgaregga_state, init_bgaregga, ROT270, "Raizing / Eighting", "Battle Garegga - Type 2 (Denmark / China) (Tue Apr 2 1996)", MACHINE_SUPPORTS_SAVE ) // displays Type 2 only when set to Denmark +GAME( 1998, bgareggabl, bgaregga, bgareggabl, bgareggabl, bgaregga_bootleg_state, init_bgaregga, ROT270, "bootleg (Melody)", "1945 Er Dai / 1945 Part-2 (Chinese hack of Battle Garegga)", MACHINE_SUPPORTS_SAVE ) // based on Thu Feb 1 1996 set, Region hardcoded to China +GAME( 1997, bgareggabla, bgaregga, bgareggabl, bgareggabl, bgaregga_bootleg_state, init_bgaregga, ROT270, "bootleg (Melody)", "Leishen Chuan / Thunder Deity Biography (Chinese hack of Battle Garegga)", MACHINE_SUPPORTS_SAVE ) // based on Thu Feb 1 1996 set, Region hardcoded to Asia +GAME( 1996, bgareggablj, bgaregga, bgareggabl, bgareggabl, bgaregga_bootleg_state, init_bgaregga, ROT270, "bootleg", "Battle Garegga (Japan, bootleg) (Sat Feb 3 1996)", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/toaplan/raizing.h b/src/mame/toaplan/raizing.h new file mode 100644 index 00000000000..99203d3ee5f --- /dev/null +++ b/src/mame/toaplan/raizing.h @@ -0,0 +1,116 @@ +// license:BSD-3-Clause +// copyright-holders:Quench, Yochizo, David Haywood +#ifndef MAME_TOAPLAN_RAIZING_H +#define MAME_TOAPLAN_RAIZING_H + +#pragma once + +#include "gp9001.h" +#include "toaplan_coincounter.h" +#include "toaplipt.h" + +#include "cpu/m68000/m68000.h" +#include "cpu/z80/z80.h" +#include "machine/bankdev.h" +#include "machine/eepromser.h" +#include "machine/gen_latch.h" +#include "sound/okim6295.h" +#include "sound/ymopm.h" +#include "sound/ymz280b.h" + +#include "emupal.h" +#include "screen.h" +#include "speaker.h" +#include "tilemap.h" + + +class raizing_base_state : public driver_device +{ +public: + raizing_base_state(const machine_config &mconfig, device_type type, const char *tag) + : driver_device(mconfig, type, tag) + , m_tx_videoram(*this, "tx_videoram") + , m_tx_lineselect(*this, "tx_lineselect") + , m_tx_linescroll(*this, "tx_linescroll") + , m_tx_gfxram(*this, "tx_gfxram") + , m_audiobank(*this, "audiobank") + , m_raizing_okibank{ + { *this, "raizing_okibank0_%u", 0U }, + { *this, "raizing_okibank1_%u", 0U } } + , m_shared_ram(*this, "shared_ram") + , m_maincpu(*this, "maincpu") + , m_audiocpu(*this, "audiocpu") + , m_vdp(*this, "gp9001") + , m_oki(*this, "oki%u", 1U) + , m_gfxdecode(*this, "gfxdecode") + , m_screen(*this, "screen") + , m_palette(*this, "palette") + , m_soundlatch(*this, "soundlatch%u", 1U) + , m_oki_rom(*this, "oki%u", 1U) + , m_coincounter(*this, "coincounter") + { } + +protected: + u32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + virtual void device_post_load() override ATTR_COLD; + + // used by everything + void create_tx_tilemap(int dx = 0, int dx_flipped = 0); + // used by bgaregga + batrider etc. + void bgaregga_common_video_start(); + void raizing_z80_bankswitch_w(u8 data); + void raizing_oki_bankswitch_w(offs_t offset, u8 data); + void install_raizing_okibank(int chip); + void common_bgaregga_reset(); + + void common_mem(address_map &map, offs_t rom_limit) ATTR_COLD; + + // similar as NMK112, but GAL-driven; NOT actual NMK112 is present + template + void raizing_oki(address_map &map) + { + map(0x00000, 0x000ff).bankr(m_raizing_okibank[Chip][0]); + map(0x00100, 0x001ff).bankr(m_raizing_okibank[Chip][1]); + map(0x00200, 0x002ff).bankr(m_raizing_okibank[Chip][2]); + map(0x00300, 0x003ff).bankr(m_raizing_okibank[Chip][3]); + map(0x00400, 0x0ffff).bankr(m_raizing_okibank[Chip][4]); + map(0x10000, 0x1ffff).bankr(m_raizing_okibank[Chip][5]); + map(0x20000, 0x2ffff).bankr(m_raizing_okibank[Chip][6]); + map(0x30000, 0x3ffff).bankr(m_raizing_okibank[Chip][7]); + }; + + u8 shared_ram_r(offs_t offset) { return m_shared_ram[offset]; } + void shared_ram_w(offs_t offset, u8 data) { m_shared_ram[offset] = data; } + + u32 screen_update_base(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + void screen_vblank(int state); + + void tx_videoram_w(offs_t offset, u16 data, u16 mem_mask = ~0); + void tx_linescroll_w(offs_t offset, u16 data, u16 mem_mask = ~0); + TILE_GET_INFO_MEMBER(get_text_tile_info); + + void coin_w(u8 data); + void reset_audiocpu(int state); + + tilemap_t *m_tx_tilemap = nullptr; /* Tilemap for extra-text-layer */ + required_shared_ptr m_tx_videoram; + optional_shared_ptr m_tx_lineselect; + optional_shared_ptr m_tx_linescroll; + optional_shared_ptr m_tx_gfxram; + optional_memory_bank m_audiobank; // batrider and bgaregga + optional_memory_bank_array<8> m_raizing_okibank[2]; + optional_shared_ptr m_shared_ram; // 8 bit RAM shared between 68K and sound CPU + required_device m_maincpu; + optional_device m_audiocpu; + required_device m_vdp; + optional_device_array m_oki; + optional_device m_gfxdecode; + required_device m_screen; + required_device m_palette; + optional_device_array m_soundlatch; // tekipaki, batrider, bgaregga, batsugun + optional_region_ptr_array m_oki_rom; + required_device m_coincounter; + bitmap_ind8 m_custom_priority_bitmap; +}; + +#endif // MAME_TOAPLAN_RAIZING_H diff --git a/src/mame/toaplan/raizing_batrider.cpp b/src/mame/toaplan/raizing_batrider.cpp new file mode 100644 index 00000000000..75754030b8d --- /dev/null +++ b/src/mame/toaplan/raizing_batrider.cpp @@ -0,0 +1,1436 @@ +// license:BSD-3-Clause +// copyright-holders:Quench, Yochizo, David Haywood + +#include "emu.h" + +#include "raizing.h" + +/* + +Name Board No Maker Game name +---------------------------------------------------------------------------- +batrider RA9704 Raizing/8ing Armed Police Batrider (Europe - Fri Feb 13 1998) +batrideru RA9704 Raizing/8ing Armed Police Batrider (USA - Fri Feb 13 1998) +batriderc RA9704 Raizing/8ing Armed Police Batrider (China - Fri Feb 13 1998) +batriderj RA9704 Raizing/8ing Armed Police Batrider - B Version (Japan - Fri Feb 13 1998) +batriderk RA9704 Raizing/8ing Armed Police Batrider (Korea - Fri Feb 13 1998) +batriderja RA9704 Raizing/8ing Armed Police Batrider (Japan - Mon Dec 22 1997) +batridert RA9704 Raizing/8ing Armed Police Batrider (Taiwan - Mon Dec 22 1997) +bbakraid ET68-V99 8ing Battle Bakraid - Unlimited Version (USA - Tue Jun 8th, 1999) +bbakraidj ET68-V99 8ing Battle Bakraid - Unlimited Version (Japan - Tue Jun 8th, 1999) +bbakraidja ET68-V99 8ing Battle Bakraid (Japan - Wed Apr 7th, 1999) + +batrider - Batrider was marketed as a two button game, and the regular ships all use only the first + two buttons, but in the original version you need the third button in order to control the + options of the hidden Battle Garegga ships. + This problem was fixed in the B Version, which lets you change the Battle Garegga ships' + option formation using Street Fighter style joystick commands (as well as by using the third + button, if the cabinet has one) + +bbakraid - Because players managed to counter stop the original Battle Bakraid not long after release, + the Unlimited Version, which can display more score digits, was released as a ROM upgrade. + The upgrade also fixes the bug in the original version that prevented the unlocking of + Team Edit mode from being saved in the EEPROM. + + **************************************************************************** + * Armed Police Batrider * + * The button you use to select your ship not only determines its * + * color, but affects its characteristics. * + * A: High main shot power, low option shot power. * + * Average speed. Default autofire rate is 15 Hz. * + * B: Low main shot power, high option shot power. Slightly * + * slower than A type. Default autofire rate is 12 Hz. * + * C: High main shot and option shot power, but lowest speed. * + * Default autofire rate is 20 Hz. * + * START: Low main shot and option shot power, but highest speed. * + * Default autofire rate is 10 Hz. * + * * + * Note: The following features can also be enabled via dipswitches. * + * * + * PLAYER SELECT: After inserting a coin, input * + * UP UP DOWN DOWN LEFT RIGHT LEFT RIGHT B A * + * You can select a single character instead of a team. * + * GUEST PLAYERS: After inserting a coin, input * + * UP UP DOWN DOWN LEFT RIGHT LEFT RIGHT A B * + * You can use Mahou Daisakusen and Battle Garegga characters. * + * SPECIAL COURSE: After inserting a coin, input * + * UP DOWN UP DOWN LEFT RIGHT LEFT RIGHT A B * + * You can select the Special course, which consists of bosses only. * + * STAGE EDIT: When you select your course, press A and B simultaneously. * + * You can choose what order to play Stage 2, 3 and 4 in, * + * or even skip them. * + **************************************************************************** + + ############################################################################ + # In Battle Bakraid, the button you use to select your ship not only # + # determines its color, but affects its characteristics. # + # A: Increased main shot power. Default autofire rate is 20 Hz. # + # B: Increased bomb blast duration. Default autofire rate is 12 Hz. # + # C: Increased side shot power. Default autofire rate is 15 Hz. # + # START: Increased speed. Default autofire rate is 10 Hz. # + # # + # STAGE EDIT: When you select your course, press A and B simultaneously. # + # You can choose what order to play Stage 2, 3, 4 and 5 in, # + # or even skip them. Stage Edit can also be enabled via dipswitch. # + # ======================================================================== # + # Battle Bakraid has unlocking codes to gain access to extra players # + # and game features. Once each feature is unlocked, it is saved in EEPROM # + # and remains unlocked until you erase the EEPROM from the service mode. # + # However, in the original (non-Unlimited) version, the unlocking of # + # Team Edit is not saved in EEPROM, apparently due to a bug. # + # Special thanks go to the 'R8ZING Shooter Tribute' page for finding # + # and publishing this info. # + # ======================================================================== # + # PLAYER SELECT: PHASE 2 # + # Result: 3 more fighter planes available. # + # Code: UP UP DOWN DOWN LEFT RIGHT LEFT RIGHT A B Start # + # Conditions: # + # 1. Start from the title screen # + # 2. Insert Coin # + # 3. Watch the 20 sec. counter and enter each part of the code right # + # between the counting. # + # Example: 12,up,11,up,10,down,9,down,8,left,7,right,6.left,5,r.. # + # After entering the [B] button a chime should sound. Phase 2 unlocked! # + # ------------------------------------------------------------------------ # + # PLAYER SELECT: PHASE 3 # + # Result: 2 more fighter planes available. # + # Code: UP UP DOWN DOWN LEFT RIGHT LEFT RIGHT B A Start # + # Conditions: # + # 1. Unlock Player Select Phase 2 first # + # 2. Insert Coin # + # 3. Watch the 20 sec. counter and enter each part of the code right # + # between the counting. # + # Important: The entering of this code has to be finished before the # + # counter passes 10 ! To do so, you will have to start after coin # + # insertion, right before it starts to count: # + # Example: up,19,up,18,down,17,down,16,left,15,right,14.left,.. # + # After entering the [A] button a chime should sound. Phase 3 unlocked! # + # ------------------------------------------------------------------------ # + # TEAM EDIT: ENABLE # + # Result: Unlocks the 'team edit' feature to select a team of different # + # ships like in Batrider. # + # Code: UP DOWN UP DOWN LEFT RIGHT LEFT RIGHT A B Start # + # Conditions: # + # 1. Unlock Player Select Phase 2 and Phase 3 first # + # 2. Insert Coin # + # 3. Watch the 20 sec. counter and enter each part of the code right # + # between the counting. # + # Important: This code hast to be entered so that the counter is at 0 when # + # you press the final button [B]. To do so, start after second 9: # + # Example: 9,up,8,down,7,up,6,down,5,left,4,right,3,left,2,right,1,A,0,B # + # After entering the [B] button a chime should sound. Team edit unlocked! # + # # + # Note: In the Japan version, to use Team Edit after unlocking it, # + # you must hold UP or DOWN while selecting your course. # + # In the USA version, if Team Edit is unlocked, the game asks you # + # if you want to use it after you select your course. # + # ------------------------------------------------------------------------ # + # SPECIAL COURSE: ENABLE # + # Result: Unlocks the Special course, a game mode where you fight the # + # bosses only. # + # Code: UP DOWN UP DOWN LEFT RIGHT LEFT RIGHT B A Start # + # Conditions: # + # 1. Start from the title screen # + # 2. Hold [C] button # + # 3. Insert Coin # + # 4. Watch the 20 sec. counter and enter each part of the code right # + # between the counting. # + # 5. Release [C] button # + # After entering the [A] button a chime should sound. Special course # + # unlocked! # + ############################################################################ + +*/ + +namespace { + +class batrider_state : public raizing_base_state +{ +public: + batrider_state(const machine_config &mconfig, device_type type, const char *tag) + : raizing_base_state(mconfig, type, tag) + , m_dma_space(*this, "dma_space") + , m_mainram(*this, "mainram") + , m_z80_rom(*this, "audiocpu") + { } + + void batrider(machine_config &config) ATTR_COLD; + + void init_batrider() ATTR_COLD; + +protected: + virtual void machine_start() override ATTR_COLD; + virtual void machine_reset() override ATTR_COLD; + virtual void video_start() override ATTR_COLD; + + void batrider_68k_mem(address_map &map) ATTR_COLD; + void batrider_dma_mem(address_map &map) ATTR_COLD; + void batrider_sound_z80_mem(address_map &map) ATTR_COLD; + void batrider_sound_z80_port(address_map &map) ATTR_COLD; + + u16 batrider_z80_busack_r(); + void batrider_z80_busreq_w(u8 data); + u16 batrider_z80rom_r(offs_t offset); + void batrider_soundlatch_w(u8 data); + void batrider_soundlatch2_w(u8 data); + void batrider_unknown_sound_w(u16 data); + void batrider_clear_sndirq_w(u16 data); + void batrider_sndirq_w(u8 data); + void batrider_clear_nmi_w(u8 data); + void batrider_tx_gfxram_w(offs_t offset, u16 data, u16 mem_mask = ~0); + void batrider_textdata_dma_w(u16 data); + void batrider_pal_text_dma_w(u16 data); + void batrider_objectbank_w(offs_t offset, u8 data); + void batrider_bank_cb(u8 layer, u32 &code); + + + required_device m_dma_space; + required_shared_ptr m_mainram; + optional_region_ptr m_z80_rom; + + u16 m_gfxrom_bank[8]{}; /* Batrider object bank */ + u8 m_sndirq_line = 0; /* IRQ4 for batrider, IRQ2 for bbakraid */ + u8 m_z80_busreq = 0; +}; + + +class bbakraid_state : public batrider_state +{ +public: + bbakraid_state(const machine_config &mconfig, device_type type, const char *tag) + : batrider_state(mconfig, type, tag) + , m_eepromout(*this, "EEPROMOUT") + , m_eeprom(*this, "eeprom") + { } + + void bbakraid(machine_config &config) ATTR_COLD; + + void init_bbakraid() ATTR_COLD; + +private: + void bbakraid_68k_mem(address_map &map) ATTR_COLD; + void bbakraid_sound_z80_mem(address_map &map) ATTR_COLD; + void bbakraid_sound_z80_port(address_map &map) ATTR_COLD; + + INTERRUPT_GEN_MEMBER(bbakraid_snd_interrupt); + + u16 bbakraid_eeprom_r(); + void bbakraid_eeprom_w(u8 data); + + required_ioport m_eepromout; + required_device m_eeprom; +}; + + +class nprobowl_state : public batrider_state +{ +public: + nprobowl_state(const machine_config &mconfig, device_type type, const char *tag) + : batrider_state(mconfig, type, tag) + { } + + void nprobowl(machine_config &config) ATTR_COLD; + +private: + void nprobowl_68k_mem(address_map &map) ATTR_COLD; +}; + + + +void batrider_state::batrider_tx_gfxram_w(offs_t offset, u16 data, u16 mem_mask) +{ + /*** Dynamic GFX decoding for Batrider / Battle Bakraid ***/ + + const u16 oldword = m_tx_gfxram[offset]; + + if (oldword != data) + { + COMBINE_DATA(&m_tx_gfxram[offset]); + m_gfxdecode->gfx(0)->mark_dirty(offset/16); + } +} + +void batrider_state::batrider_textdata_dma_w(u16 data) +{ + /*** Dynamic Text GFX decoding for Batrider ***/ + /*** Only done once during start-up ***/ + m_dma_space->set_bank(1); + for (int i = 0; i < (0x8000 >> 1); i++) + { + m_dma_space->write16(i, m_mainram[i]); + } +} + +void batrider_state::batrider_pal_text_dma_w(u16 data) +{ + // FIXME: In batrider and bbakraid, the text layer and palette RAM + // are probably DMA'd from main RAM by writing here at every vblank, + // rather than being directly accessible to the 68K like the other games + m_dma_space->set_bank(0); + for (int i = 0; i < (0x3400 >> 1); i++) + { + m_dma_space->write16(i, m_mainram[i]); + } +} + +void batrider_state::batrider_objectbank_w(offs_t offset, u8 data) +{ + data &= 0xf; + if (m_gfxrom_bank[offset] != data) + { + m_gfxrom_bank[offset] = data; + m_vdp->set_dirty(); + } +} + +void batrider_state::batrider_bank_cb(u8 layer, u32 &code) +{ + code = (m_gfxrom_bank[code >> 15] << 15) | (code & 0x7fff); +} + + +void batrider_state::video_start() +{ + raizing_base_state::video_start(); + + m_screen->register_screen_bitmap(m_custom_priority_bitmap); + m_vdp->custom_priority_bitmap = &m_custom_priority_bitmap; + + m_vdp->disable_sprite_buffer(); // disable buffering on this game + + /* Create the Text tilemap for this game */ + m_gfxdecode->gfx(0)->set_source(reinterpret_cast(m_tx_gfxram.target())); + + create_tx_tilemap(0x1d4, 0x16b); + + /* Has special banking */ + save_item(NAME(m_gfxrom_bank)); +} + + +u16 batrider_state::batrider_z80_busack_r() +{ + // Bit 0x01 returns the status of BUSAK from the Z80. + // These accesses are made when the 68K wants to read the Z80 + // ROM code. Failure to return the correct status incurrs a Sound Error. + + return m_z80_busreq; // Loop BUSRQ to BUSAK +} + + +void batrider_state::batrider_z80_busreq_w(u8 data) +{ + m_z80_busreq = (data & 0x01); // see batrider_z80_busack_r above +} + + +u16 batrider_state::batrider_z80rom_r(offs_t offset) +{ + return m_z80_rom[offset]; +} + +// these two latches are always written together, via a single move.l instruction +void batrider_state::batrider_soundlatch_w(u8 data) +{ + m_soundlatch[0]->write(data & 0xff); + m_audiocpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE); +} + + +void batrider_state::batrider_soundlatch2_w(u8 data) +{ + m_soundlatch[1]->write(data & 0xff); + m_audiocpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE); +} + +void batrider_state::batrider_unknown_sound_w(u16 data) +{ + // the 68K writes here when it wants a sound acknowledge IRQ from the Z80 + // for bbakraid this is on every sound command; for batrider, only on certain commands +} + + +void batrider_state::batrider_clear_sndirq_w(u16 data) +{ + // not sure whether this is correct + // the 68K writes here during the sound IRQ handler, and nowhere else... + m_maincpu->set_input_line(m_sndirq_line, CLEAR_LINE); +} + + +void batrider_state::batrider_sndirq_w(u8 data) +{ + // if batrider_clear_sndirq_w() is correct, should this be ASSERT_LINE? + m_maincpu->set_input_line(m_sndirq_line, HOLD_LINE); +} + + +void batrider_state::batrider_clear_nmi_w(u8 data) +{ + m_audiocpu->set_input_line(INPUT_LINE_NMI, CLEAR_LINE); +} + + +u16 bbakraid_state::bbakraid_eeprom_r() +{ + // Bit 0x01 returns the status of BUSAK from the Z80. + // BUSRQ is activated via bit 0x10 on the EEPROM write port. + // These accesses are made when the 68K wants to read the Z80 + // ROM code. Failure to return the correct status incurrs a Sound Error. + + u8 data; + data = ((m_eeprom->do_read() & 0x01) << 4); + data |= ((m_z80_busreq >> 4) & 0x01); // Loop BUSRQ to BUSAK + + return data; +} + + +void bbakraid_state::bbakraid_eeprom_w(u8 data) +{ + if (data & ~0x1f) + logerror("CPU #0 PC:%06X - Unknown EEPROM data being written %02X\n",m_maincpu->pc(),data); + + m_eepromout->write(data, 0xff); + + m_z80_busreq = data & 0x10; // see bbakraid_eeprom_r above +} + +void batrider_state::machine_start() +{ + raizing_base_state::machine_start(); + + save_item(NAME(m_z80_busreq)); +} + + +INTERRUPT_GEN_MEMBER(bbakraid_state::bbakraid_snd_interrupt) +{ + device.execute().set_input_line(0, HOLD_LINE); +} + +void batrider_state::machine_reset() +{ + raizing_base_state::machine_reset(); + + common_bgaregga_reset(); +} + +static INPUT_PORTS_START( batrider ) + PORT_START("IN") // Player Inputs + PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1) + PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1) + PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1) + PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1) + PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(1) + PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(1) + PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_PLAYER(1) + PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2) + PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2) + PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2) + PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2) + PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2) + PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(2) + PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_PLAYER(2) + PORT_BIT( 0x8080, IP_ACTIVE_HIGH, IPT_UNKNOWN ) + + PORT_START("DSW") // DSWA and DSWB + PORT_SERVICE_DIPLOC(0x0001, IP_ACTIVE_HIGH, "SW1:!1") + PORT_DIPNAME( 0x0002, 0x0000, "Credits to Start" ) PORT_CONDITION("DSW", 0x001c, NOTEQUALS, 0x001c) PORT_DIPLOCATION("SW1:!2") + PORT_DIPSETTING( 0x0000, "1" ) PORT_CONDITION("DSW", 0x001c, NOTEQUALS, 0x001c) + PORT_DIPSETTING( 0x0002, "2" ) PORT_CONDITION("DSW", 0x001c, NOTEQUALS, 0x001c) + PORT_DIPNAME( 0x0002, 0x0000, "Joystick Mode" ) PORT_CONDITION("DSW", 0x001c, EQUALS, 0x001c) PORT_DIPLOCATION("SW1:!2") + PORT_DIPSETTING( 0x0000, DEF_STR( Normal ) ) PORT_CONDITION("DSW", 0x001c, EQUALS, 0x001c) + PORT_DIPSETTING( 0x0002, "90 degrees ACW" ) PORT_CONDITION("DSW", 0x001c, EQUALS, 0x001c) + PORT_DIPNAME( 0x001c, 0x0000, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:!3,!4,!5") + PORT_DIPSETTING( 0x0018, DEF_STR( 4C_1C ) ) + PORT_DIPSETTING( 0x0014, DEF_STR( 3C_1C ) ) + PORT_DIPSETTING( 0x0010, DEF_STR( 2C_1C ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( 1C_1C ) ) + PORT_DIPSETTING( 0x0004, DEF_STR( 1C_2C ) ) + PORT_DIPSETTING( 0x0008, DEF_STR( 1C_3C ) ) + PORT_DIPSETTING( 0x000c, DEF_STR( 1C_4C ) ) + PORT_DIPSETTING( 0x001c, DEF_STR( Free_Play ) ) + PORT_DIPNAME( 0x00e0, 0x0000, DEF_STR( Coin_B ) ) PORT_CONDITION("DSW", 0x001c, NOTEQUALS, 0x001c) PORT_DIPLOCATION("SW1:!6,!7,!8") + PORT_DIPSETTING( 0x00c0, DEF_STR( 4C_1C ) ) PORT_CONDITION("DSW", 0x001c, NOTEQUALS, 0x001c) + PORT_DIPSETTING( 0x00a0, DEF_STR( 3C_1C ) ) PORT_CONDITION("DSW", 0x001c, NOTEQUALS, 0x001c) + PORT_DIPSETTING( 0x0080, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW", 0x001c, NOTEQUALS, 0x001c) + PORT_DIPSETTING( 0x0000, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW", 0x001c, NOTEQUALS, 0x001c) +// PORT_DIPSETTING( 0x00e0, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW", 0x001c, NOTEQUALS, 0x001c) + PORT_DIPSETTING( 0x0020, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW", 0x001c, NOTEQUALS, 0x001c) + PORT_DIPSETTING( 0x0040, DEF_STR( 1C_3C ) ) PORT_CONDITION("DSW", 0x001c, NOTEQUALS, 0x001c) + PORT_DIPSETTING( 0x0060, DEF_STR( 1C_4C ) ) PORT_CONDITION("DSW", 0x001c, NOTEQUALS, 0x001c) + // When Coin_A is set to Free_Play, Coin_A becomes Coin_A and Coin_B, and the following dips occur + PORT_DIPNAME( 0x0020, 0x0000, "Hit Score" ) PORT_CONDITION("DSW", 0x001c, EQUALS, 0x001c) PORT_DIPLOCATION("SW1:!6") + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) PORT_CONDITION("DSW", 0x001c, EQUALS, 0x001c) + PORT_DIPSETTING( 0x0020, DEF_STR( On ) ) PORT_CONDITION("DSW", 0x001c, EQUALS, 0x001c) + PORT_DIPNAME( 0x0040, 0x0000, "Sound Effect" ) PORT_CONDITION("DSW", 0x001c, EQUALS, 0x001c) PORT_DIPLOCATION("SW1:!7") + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) PORT_CONDITION("DSW", 0x001c, EQUALS, 0x001c) + PORT_DIPSETTING( 0x0040, DEF_STR( On ) ) PORT_CONDITION("DSW", 0x001c, EQUALS, 0x001c) + PORT_DIPNAME( 0x0080, 0x0000, "Music" ) PORT_CONDITION("DSW", 0x001c, EQUALS, 0x001c) PORT_DIPLOCATION("SW1:!8") + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) PORT_CONDITION("DSW", 0x001c, EQUALS, 0x001c) + PORT_DIPSETTING( 0x0080, DEF_STR( On ) ) PORT_CONDITION("DSW", 0x001c, EQUALS, 0x001c) + PORT_DIPNAME( 0x0300, 0x0000, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:!1,!2") + PORT_DIPSETTING( 0x0100, DEF_STR( Easy ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( Normal ) ) + PORT_DIPSETTING( 0x0200, DEF_STR( Hard ) ) + PORT_DIPSETTING( 0x0300, DEF_STR( Very_Hard ) ) + PORT_DIPNAME( 0x0c00, 0x0000, "Timer" ) PORT_DIPLOCATION("SW2:!3,!4") + PORT_DIPSETTING( 0x0c00, DEF_STR( Highest ) ) + PORT_DIPSETTING( 0x0800, DEF_STR( High ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( Normal ) ) + PORT_DIPSETTING( 0x0400, DEF_STR( Low ) ) + PORT_DIPNAME( 0x3000, 0x0000, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:!5,!6") + PORT_DIPSETTING( 0x3000, "1" ) + PORT_DIPSETTING( 0x2000, "2" ) + PORT_DIPSETTING( 0x0000, "3" ) + PORT_DIPSETTING( 0x1000, "4" ) + PORT_DIPNAME( 0xc000, 0x0000, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW2:!7,!8") + PORT_DIPSETTING( 0xc000, DEF_STR( None ) ) + PORT_DIPSETTING( 0x8000, "Every 2000k" ) + PORT_DIPSETTING( 0x0000, "Every 1500k" ) + PORT_DIPSETTING( 0x4000, "Every 1000k" ) + + PORT_START("SYS-DSW") // Coin/System and DSWC + PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_SERVICE1 ) + PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_UNKNOWN) + TOAPLAN_TEST_SWITCH( 0x0004, IP_ACTIVE_HIGH ) + PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_COIN1 ) + PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_COIN2 ) + PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_START1 ) + PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_START2 ) + PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_UNKNOWN ) + PORT_DIPNAME( 0x0100, 0x0000, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW3:!1") + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0100, DEF_STR( On ) ) + PORT_DIPNAME( 0x0200, 0x0000, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW3:!2") + PORT_DIPSETTING( 0x0200, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0400, 0x0000, "Stage Edit" ) PORT_DIPLOCATION("SW3:!3") + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0400, DEF_STR( On ) ) + PORT_DIPNAME( 0x0800, 0x0000, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("SW3:!4") + PORT_DIPSETTING( 0x0800, DEF_STR( No ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( Yes ) ) + PORT_DIPNAME( 0x1000, 0x0000, "Invulnerability (Cheat)" ) PORT_DIPLOCATION("SW3:!5") + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x1000, DEF_STR( On ) ) + // These dips are shown only when Coin_A is set to Free_Play, but they work in normal play mode too + PORT_DIPNAME( 0x2000, 0x0000, "Guest Players" ) PORT_DIPLOCATION("SW3:!6") + PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x4000, 0x0000, "Player Select" ) PORT_DIPLOCATION("SW3:!7") + PORT_DIPSETTING( 0x4000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x8000, 0x0000, "Special Course" ) PORT_DIPLOCATION("SW3:!8") + PORT_DIPSETTING( 0x8000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) +INPUT_PORTS_END + + +static INPUT_PORTS_START( batriderj ) + PORT_INCLUDE( batrider ) + + PORT_MODIFY("SYS-DSW") // Coin/System and DSWC + // These dips are shown only when Coin_A is set to Free_Play, but they work in normal play mode too + PORT_DIPNAME( 0x2000, 0x0000, "Guest Players" ) PORT_DIPLOCATION("SW3:!6") + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x2000, DEF_STR( On ) ) + PORT_DIPNAME( 0x4000, 0x0000, "Player Select" ) PORT_DIPLOCATION("SW3:!7") + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x4000, DEF_STR( On ) ) + PORT_DIPNAME( 0x8000, 0x0000, "Special Course" ) PORT_DIPLOCATION("SW3:!8") + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x8000, DEF_STR( On ) ) +INPUT_PORTS_END + + +static INPUT_PORTS_START( bbakraid ) + PORT_INCLUDE( batrider ) + + PORT_MODIFY("DSW") // DSWA and DSWB + PORT_DIPNAME( 0xc000, 0x0000, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW2:!7,!8") + PORT_DIPSETTING( 0xc000, DEF_STR( None ) ) + PORT_DIPSETTING( 0x8000, "Every 4000k" ) + PORT_DIPSETTING( 0x4000, "Every 3000k" ) + PORT_DIPSETTING( 0x0000, "Every 2000k" ) + + PORT_MODIFY("SYS-DSW") // Coin/System and DSW-3 + PORT_DIPNAME( 0x2000, 0x0000, "Save Scores" ) PORT_DIPLOCATION("SW3:!6") + PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x4000, 0x0000, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW3:!7") + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x4000, DEF_STR( On ) ) + PORT_DIPNAME( 0x8000, 0x0000, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW3:!8") + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x8000, DEF_STR( On ) ) + + PORT_START( "EEPROMOUT" ) + PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", FUNC(eeprom_serial_93cxx_device::cs_write)) + PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", FUNC(eeprom_serial_93cxx_device::di_write)) + PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", FUNC(eeprom_serial_93cxx_device::clk_write)) +INPUT_PORTS_END + + +static INPUT_PORTS_START( nprobowl ) + PORT_START("IN") // Player Inputs + PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_COIN1 ) + PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_SERVICE1 ) + PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_START1 ) + PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_START2 ) + PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("Set (Relay)") + PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // no effect in test mode + PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("Gutter L") + PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("Gutter R") + PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // no effect in test mode + PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_NAME("Ballout") + PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_NAME("Ballpass") + PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_BUTTON6 ) PORT_NAME("Mot Home") + PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // no effect in test mode + PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // no effect in test mode + PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // no effect in test mode + PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // no effect in test mode + + PORT_START("DSW") // SW0323 and SW0324 + PORT_SERVICE_DIPLOC( 0x0001, IP_ACTIVE_HIGH, "SW0323:!1") + PORT_DIPUNKNOWN_DIPLOC(0x0002, 0x0000, "SW0323:!2") + PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW0323:!3") + PORT_DIPSETTING( 0x0004, DEF_STR( On ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPUNKNOWN_DIPLOC(0x0008, 0x0000, "SW0323:!4") + PORT_DIPNAME( 0x0070, 0x0000, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW0323:!5,!6,!7") + PORT_DIPSETTING( 0x0070, DEF_STR( 5C_1C ) ) + PORT_DIPSETTING( 0x0060, DEF_STR( 4C_1C ) ) + PORT_DIPSETTING( 0x0050, DEF_STR( 3C_1C ) ) + PORT_DIPSETTING( 0x0040, DEF_STR( 2C_1C ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( 1C_1C ) ) + PORT_DIPSETTING( 0x0010, DEF_STR( 1C_2C ) ) + PORT_DIPSETTING( 0x0020, DEF_STR( 1C_3C ) ) + PORT_DIPSETTING( 0x0030, DEF_STR( 1C_4C ) ) + PORT_DIPNAME( 0x0080, 0x0000, DEF_STR( Free_Play ) ) PORT_DIPLOCATION("SW0323:!8") + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0080, DEF_STR( On ) ) + PORT_DIPUNKNOWN_DIPLOC(0x0100, 0x0000, "SW0324:!1") + PORT_DIPUNKNOWN_DIPLOC(0x0200, 0x0000, "SW0324:!2") + PORT_DIPUNKNOWN_DIPLOC(0x0400, 0x0000, "SW0324:!3") + PORT_DIPUNKNOWN_DIPLOC(0x0800, 0x0000, "SW0324:!4") + PORT_DIPUNKNOWN_DIPLOC(0x1000, 0x0000, "SW0324:!5") + PORT_DIPUNKNOWN_DIPLOC(0x2000, 0x0000, "SW0324:!6") + PORT_DIPUNKNOWN_DIPLOC(0x4000, 0x0000, "SW0324:!7") + PORT_DIPUNKNOWN_DIPLOC(0x8000, 0x0000, "SW0324:!8") + + PORT_START("UNK") // ?? + PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_UNKNOWN ) + PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_UNKNOWN ) + PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_UNKNOWN ) + PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_UNKNOWN ) + PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_UNKNOWN ) + PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_UNKNOWN ) + PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_UNKNOWN ) + PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_UNKNOWN ) + PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_UNKNOWN ) + PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_UNKNOWN ) + PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_UNKNOWN ) + PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_UNKNOWN ) + PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_UNKNOWN ) + PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_UNKNOWN ) + PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_UNKNOWN ) + PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_UNKNOWN ) +INPUT_PORTS_END + + +void batrider_state::batrider_dma_mem(address_map &map) +{ + map(0x0000, 0x1fff).ram().w(FUNC(batrider_state::tx_videoram_w)).share(m_tx_videoram); + map(0x2000, 0x2fff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); + map(0x3000, 0x31ff).ram().share(m_tx_lineselect); + map(0x3200, 0x33ff).ram().w(FUNC(batrider_state::tx_linescroll_w)).share(m_tx_linescroll); + map(0x3400, 0x7fff).ram(); + map(0x8000, 0xffff).ram().w(FUNC(batrider_state::batrider_tx_gfxram_w)).share(m_tx_gfxram); +} + + +void batrider_state::batrider_68k_mem(address_map &map) +{ + map(0x000000, 0x1fffff).rom(); + // actually 200000 - 20ffff is probably all main RAM, and the text and palette RAM are written via DMA + map(0x200000, 0x207fff).ram().share(m_mainram); + map(0x208000, 0x20ffff).ram(); + map(0x300000, 0x37ffff).r(FUNC(batrider_state::batrider_z80rom_r)); + map(0x400000, 0x40000d).lrw16( + NAME([this](offs_t offset, u16 mem_mask) { return m_vdp->read(offset ^ (0xc/2), mem_mask); }), + NAME([this](offs_t offset, u16 data, u16 mem_mask) { m_vdp->write(offset ^ (0xc/2), data, mem_mask); })); + map(0x500000, 0x500001).portr("IN"); + map(0x500002, 0x500003).portr("SYS-DSW"); + map(0x500004, 0x500005).portr("DSW"); + map(0x500006, 0x500007).r(m_vdp, FUNC(gp9001vdp_device::vdpcount_r)); + map(0x500009, 0x500009).r(m_soundlatch[2], FUNC(generic_latch_8_device::read)); + map(0x50000b, 0x50000b).r(m_soundlatch[3], FUNC(generic_latch_8_device::read)); + map(0x50000c, 0x50000d).r(FUNC(batrider_state::batrider_z80_busack_r)); + map(0x500011, 0x500011).w("coincounter", FUNC(toaplan_coincounter_device::coin_w)); + map(0x500021, 0x500021).w(FUNC(batrider_state::batrider_soundlatch_w)); + map(0x500023, 0x500023).w(FUNC(batrider_state::batrider_soundlatch2_w)); + map(0x500024, 0x500025).w(FUNC(batrider_state::batrider_unknown_sound_w)); + map(0x500026, 0x500027).w(FUNC(batrider_state::batrider_clear_sndirq_w)); + map(0x500061, 0x500061).w(FUNC(batrider_state::batrider_z80_busreq_w)); + map(0x500080, 0x500081).w(FUNC(batrider_state::batrider_textdata_dma_w)); + map(0x500082, 0x500083).w(FUNC(batrider_state::batrider_pal_text_dma_w)); + map(0x5000c0, 0x5000cf).w(FUNC(batrider_state::batrider_objectbank_w)).umask16(0x00ff); +} + + +void bbakraid_state::bbakraid_68k_mem(address_map &map) +{ + map(0x000000, 0x1fffff).rom(); + // actually 200000 - 20ffff is probably all main RAM, and the text and palette RAM are written via DMA + map(0x200000, 0x207fff).ram().share(m_mainram); + map(0x208000, 0x20ffff).ram(); + map(0x300000, 0x33ffff).r(FUNC(bbakraid_state::batrider_z80rom_r)); + map(0x400000, 0x40000d).lrw16( + NAME([this](offs_t offset, u16 mem_mask) { return m_vdp->read(offset ^ (0xc/2), mem_mask); }), + NAME([this](offs_t offset, u16 data, u16 mem_mask) { m_vdp->write(offset ^ (0xc/2), data, mem_mask); })); + map(0x500000, 0x500001).portr("IN"); + map(0x500002, 0x500003).portr("SYS-DSW"); + map(0x500004, 0x500005).portr("DSW"); + map(0x500006, 0x500007).r(m_vdp, FUNC(gp9001vdp_device::vdpcount_r)); + map(0x500009, 0x500009).w("coincounter", FUNC(toaplan_coincounter_device::coin_w)); + map(0x500011, 0x500011).r(m_soundlatch[2], FUNC(generic_latch_8_device::read)); + map(0x500013, 0x500013).r(m_soundlatch[3], FUNC(generic_latch_8_device::read)); + map(0x500015, 0x500015).w(FUNC(bbakraid_state::batrider_soundlatch_w)); + map(0x500017, 0x500017).w(FUNC(bbakraid_state::batrider_soundlatch2_w)); + map(0x500018, 0x500019).r(FUNC(bbakraid_state::bbakraid_eeprom_r)); + map(0x50001a, 0x50001b).w(FUNC(bbakraid_state::batrider_unknown_sound_w)); + map(0x50001c, 0x50001d).w(FUNC(bbakraid_state::batrider_clear_sndirq_w)); + map(0x50001f, 0x50001f).w(FUNC(bbakraid_state::bbakraid_eeprom_w)); + map(0x500080, 0x500081).w(FUNC(bbakraid_state::batrider_textdata_dma_w)); + map(0x500082, 0x500083).w(FUNC(bbakraid_state::batrider_pal_text_dma_w)); + map(0x5000c0, 0x5000cf).w(FUNC(bbakraid_state::batrider_objectbank_w)).umask16(0x00ff); +} + + +void nprobowl_state::nprobowl_68k_mem(address_map &map) // TODO: verify everything, implement oki banking +{ + map(0x000000, 0x0fffff).rom(); + map(0x200000, 0x207fff).ram().share(m_mainram); + map(0x208000, 0x20ffff).ram(); + map(0x400000, 0x40000d).lrw16( + NAME([this](offs_t offset, u16 mem_mask) { return m_vdp->read(offset ^ (0xc/2), mem_mask); }), + NAME([this](offs_t offset, u16 data, u16 mem_mask) { m_vdp->write(offset ^ (0xc/2), data, mem_mask); })); + map(0x500000, 0x500001).portr("IN"); + map(0x500002, 0x500003).portr("UNK"); + map(0x500004, 0x500005).portr("DSW"); + //map(0x500010, 0x500011).w(); + //map(0x500012, 0x500013).w(); + map(0x500021, 0x500021).w(m_oki[0], FUNC(okim6295_device::write)); + //map(0x500040, 0x500041).w(); + //map(0x500042, 0x500043).w(); + map(0x500060, 0x500061).lr16(NAME([this] () -> u16 { return machine().rand(); })); // TODO: Hack, probably checks something in the mechanical part, verify + map(0x500080, 0x500081).w(FUNC(nprobowl_state::batrider_textdata_dma_w)); + map(0x500082, 0x500083).w(FUNC(nprobowl_state::batrider_pal_text_dma_w)); +} + + +void batrider_state::batrider_sound_z80_mem(address_map &map) +{ + map(0x0000, 0x7fff).rom(); + map(0x8000, 0xbfff).bankr(m_audiobank); + map(0xc000, 0xdfff).ram(); +} + + +void batrider_state::batrider_sound_z80_port(address_map &map) +{ + map.global_mask(0xff); + map(0x40, 0x40).w(m_soundlatch[2], FUNC(generic_latch_8_device::write)); + map(0x42, 0x42).w(m_soundlatch[3], FUNC(generic_latch_8_device::write)); + map(0x44, 0x44).w(FUNC(batrider_state::batrider_sndirq_w)); + map(0x46, 0x46).w(FUNC(batrider_state::batrider_clear_nmi_w)); + map(0x48, 0x48).r(m_soundlatch[0], FUNC(generic_latch_8_device::read)); + map(0x4a, 0x4a).r(m_soundlatch[1], FUNC(generic_latch_8_device::read)); + map(0x80, 0x81).rw("ymsnd", FUNC(ym2151_device::read), FUNC(ym2151_device::write)); + map(0x82, 0x82).rw(m_oki[0], FUNC(okim6295_device::read), FUNC(okim6295_device::write)); + map(0x84, 0x84).rw(m_oki[1], FUNC(okim6295_device::read), FUNC(okim6295_device::write)); + map(0x88, 0x88).w(FUNC(batrider_state::raizing_z80_bankswitch_w)); + map(0xc0, 0xc6).w(FUNC(batrider_state::raizing_oki_bankswitch_w)); +} + + +void bbakraid_state::bbakraid_sound_z80_mem(address_map &map) +{ + map(0x0000, 0xbfff).rom(); // No banking? ROM only contains code and data up to 0x28DC + map(0xc000, 0xffff).ram(); +} + + +void bbakraid_state::bbakraid_sound_z80_port(address_map &map) +{ + map.global_mask(0xff); + map(0x40, 0x40).w(m_soundlatch[2], FUNC(generic_latch_8_device::write)); + map(0x42, 0x42).w(m_soundlatch[3], FUNC(generic_latch_8_device::write)); + map(0x44, 0x44).w(FUNC(bbakraid_state::batrider_sndirq_w)); + map(0x46, 0x46).w(FUNC(bbakraid_state::batrider_clear_nmi_w)); + map(0x48, 0x48).r(m_soundlatch[0], FUNC(generic_latch_8_device::read)); + map(0x4a, 0x4a).r(m_soundlatch[1], FUNC(generic_latch_8_device::read)); + map(0x80, 0x81).rw("ymz", FUNC(ymz280b_device::read), FUNC(ymz280b_device::write)); +} + +#define XOR(a) WORD_XOR_LE(a) +#define LOC(x) (x+XOR(0)) + +static const gfx_layout batrider_tx_tilelayout = +{ + 8,8, /* 8x8 characters */ + 1024, /* 1024 characters */ + 4, /* 4 bits per pixel */ + { STEP4(0,1) }, + { XOR(0)*4, XOR(1)*4, XOR(2)*4, XOR(3)*4, XOR(4)*4, XOR(5)*4, XOR(6)*4, XOR(7)*4 }, + { STEP8(0,4*8) }, + 8*8*4 +}; + +static GFXDECODE_START( gfx_batrider ) + GFXDECODE_ENTRY( nullptr, 0, batrider_tx_tilelayout, 64*16, 64 ) +GFXDECODE_END + + +void batrider_state::batrider(machine_config &config) +{ + /* basic machine hardware */ + M68000(config, m_maincpu, 32_MHz_XTAL/2); // 16MHz, 32MHz Oscillator (verified) + m_maincpu->set_addrmap(AS_PROGRAM, &batrider_state::batrider_68k_mem); + m_maincpu->reset_cb().set(FUNC(batrider_state::reset_audiocpu)); + + Z80(config, m_audiocpu, 32_MHz_XTAL/6); // 5.333MHz, 32MHz Oscillator (verified) + m_audiocpu->set_addrmap(AS_PROGRAM, &batrider_state::batrider_sound_z80_mem); + m_audiocpu->set_addrmap(AS_IO, &batrider_state::batrider_sound_z80_port); + + TOAPLAN_COINCOUNTER(config, m_coincounter, 0); + + config.set_maximum_quantum(attotime::from_hz(600)); + + ADDRESS_MAP_BANK(config, m_dma_space, 0); + m_dma_space->set_addrmap(0, &batrider_state::batrider_dma_mem); + m_dma_space->set_endianness(ENDIANNESS_BIG); + m_dma_space->set_data_width(16); + m_dma_space->set_addr_width(16); + m_dma_space->set_stride(0x8000); + + /* video hardware */ + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_video_attributes(VIDEO_UPDATE_BEFORE_VBLANK); + m_screen->set_raw(27_MHz_XTAL/4, 432, 0, 320, 262, 0, 240); + m_screen->set_screen_update(FUNC(batrider_state::screen_update)); + m_screen->screen_vblank().set(FUNC(batrider_state::screen_vblank)); + m_screen->set_palette(m_palette); + + GFXDECODE(config, m_gfxdecode, m_palette, gfx_batrider); + PALETTE(config, m_palette).set_format(palette_device::xBGR_555, gp9001vdp_device::VDP_PALETTE_LENGTH); + + GP9001_VDP(config, m_vdp, 27_MHz_XTAL); + m_vdp->set_palette(m_palette); + m_vdp->set_tile_callback(FUNC(batrider_state::batrider_bank_cb)); + m_vdp->vint_out_cb().set_inputline(m_maincpu, M68K_IRQ_2); + + /* sound hardware */ + SPEAKER(config, "mono").front_center(); + + // these two latches are always written together, via a single move.l instruction + GENERIC_LATCH_8(config, m_soundlatch[0]); + GENERIC_LATCH_8(config, m_soundlatch[1]); + GENERIC_LATCH_8(config, m_soundlatch[2]); + GENERIC_LATCH_8(config, m_soundlatch[3]); + + YM2151(config, "ymsnd", 32_MHz_XTAL/8).add_route(ALL_OUTPUTS, "mono", 0.25); // 4MHz, 32MHz Oscillator (verified) + + OKIM6295(config, m_oki[0], 32_MHz_XTAL/10, okim6295_device::PIN7_HIGH); + m_oki[0]->set_addrmap(0, &batrider_state::raizing_oki<0>); + m_oki[0]->add_route(ALL_OUTPUTS, "mono", 0.5); + + OKIM6295(config, m_oki[1], 32_MHz_XTAL/10, okim6295_device::PIN7_LOW); + m_oki[1]->set_addrmap(0, &batrider_state::raizing_oki<1>); + m_oki[1]->add_route(ALL_OUTPUTS, "mono", 0.5); +} + + +void bbakraid_state::bbakraid(machine_config &config) +{ + /* basic machine hardware */ + M68000(config, m_maincpu, 32_MHz_XTAL/2); // 16MHz, 32MHz Oscillator + m_maincpu->set_addrmap(AS_PROGRAM, &bbakraid_state::bbakraid_68k_mem); + m_maincpu->reset_cb().set(FUNC(bbakraid_state::reset_audiocpu)); + + Z80(config, m_audiocpu, XTAL(32'000'000)/6); /* 5.3333MHz , 32MHz Oscillator */ + m_audiocpu->set_addrmap(AS_PROGRAM, &bbakraid_state::bbakraid_sound_z80_mem); + m_audiocpu->set_addrmap(AS_IO, &bbakraid_state::bbakraid_sound_z80_port); + m_audiocpu->set_periodic_int(FUNC(bbakraid_state::bbakraid_snd_interrupt), attotime::from_hz(XTAL(32'000'000) / 6 / 12000)); // sound CPU clock (divider unverified) + + TOAPLAN_COINCOUNTER(config, m_coincounter, 0); + + config.set_maximum_quantum(attotime::from_hz(600)); + + EEPROM_93C66_8BIT(config, m_eeprom); + + ADDRESS_MAP_BANK(config, m_dma_space, 0); + m_dma_space->set_addrmap(0, &bbakraid_state::batrider_dma_mem); + m_dma_space->set_endianness(ENDIANNESS_BIG); + m_dma_space->set_data_width(16); + m_dma_space->set_addr_width(16); + m_dma_space->set_stride(0x8000); + + /* video hardware */ + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_video_attributes(VIDEO_UPDATE_BEFORE_VBLANK); + m_screen->set_raw(27_MHz_XTAL/4, 432, 0, 320, 262, 0, 240); + m_screen->set_screen_update(FUNC(bbakraid_state::screen_update)); + m_screen->screen_vblank().set(FUNC(bbakraid_state::screen_vblank)); + m_screen->set_palette(m_palette); + + GFXDECODE(config, m_gfxdecode, m_palette, gfx_batrider); + PALETTE(config, m_palette).set_format(palette_device::xBGR_555, gp9001vdp_device::VDP_PALETTE_LENGTH); + + GP9001_VDP(config, m_vdp, 27_MHz_XTAL); + m_vdp->set_palette(m_palette); + m_vdp->set_tile_callback(FUNC(bbakraid_state::batrider_bank_cb)); + m_vdp->vint_out_cb().set_inputline(m_maincpu, M68K_IRQ_1); + + /* sound hardware */ + SPEAKER(config, "mono").front_center(); + + // these two latches are always written together, via a single move.l instruction + GENERIC_LATCH_8(config, m_soundlatch[0]); + GENERIC_LATCH_8(config, m_soundlatch[1]); + GENERIC_LATCH_8(config, m_soundlatch[2]); + GENERIC_LATCH_8(config, m_soundlatch[3]); + + YMZ280B(config, "ymz", 16.9344_MHz_XTAL).add_route(ALL_OUTPUTS, "mono", 1.0); + // IRQ not used ??? Connected to a test pin (TP082) +} + + +void nprobowl_state::nprobowl(machine_config &config) +{ + // basic machine hardware + M68000(config, m_maincpu, 32_MHz_XTAL / 2); // 32MHz Oscillator, divisor not verified + m_maincpu->set_addrmap(AS_PROGRAM, &nprobowl_state::nprobowl_68k_mem); + m_maincpu->reset_cb().set(FUNC(nprobowl_state::reset_audiocpu)); + + ADDRESS_MAP_BANK(config, m_dma_space, 0); + m_dma_space->set_addrmap(0, &nprobowl_state::batrider_dma_mem); + m_dma_space->set_endianness(ENDIANNESS_BIG); + m_dma_space->set_data_width(16); + m_dma_space->set_addr_width(16); + m_dma_space->set_stride(0x8000); + + TOAPLAN_COINCOUNTER(config, m_coincounter, 0); + + // video hardware + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_video_attributes(VIDEO_UPDATE_BEFORE_VBLANK); + m_screen->set_raw(27_MHz_XTAL/4, 432, 0, 320, 262, 0, 240); + m_screen->set_screen_update(FUNC(nprobowl_state::screen_update)); + m_screen->screen_vblank().set(FUNC(nprobowl_state::screen_vblank)); + m_screen->set_palette(m_palette); + + GFXDECODE(config, m_gfxdecode, m_palette, gfx_batrider); + PALETTE(config, m_palette).set_format(palette_device::xBGR_555, gp9001vdp_device::VDP_PALETTE_LENGTH); + + GP9001_VDP(config, m_vdp, 27_MHz_XTAL); + m_vdp->set_palette(m_palette); + m_vdp->vint_out_cb().set_inputline(m_maincpu, M68K_IRQ_2); + + // sound hardware + SPEAKER(config, "mono").front_center(); + + OKIM6295(config, m_oki[0], 32_MHz_XTAL/8, okim6295_device::PIN7_HIGH).add_route(ALL_OUTPUTS, "mono", 1.0); // divisor not verified + // TODO: banking +} + + +void batrider_state::init_batrider() +{ + m_audiobank->configure_entries(0, 16, &m_z80_rom[0], 0x4000); + install_raizing_okibank(0); + install_raizing_okibank(1); + m_sndirq_line = 4; +} + + +void bbakraid_state::init_bbakraid() +{ + m_sndirq_line = 2; +} + + +/* + The region of Batrider is controlled by the first byte of rom prg0.u22 + only sets which have been dumped from original PCBs are supported + + original ROM labels have no indication of the region. + + valid values are: + ( * denotes that this set has been found on an original PCB ) + + 00 : Nippon * + 01 : USA * + 02 : Europe * + 03 : Asia + 04 : German (sic) + 05 : Austria + 06 : Belgium + 07 : Denmark + 08 : Finland + 09 : France + 0A : Great Britain + 0B : Greece + 0C : The Netherlands + 0D : Italy + 0E : Norway + 0F : Portugal + 10 : Spain + 11 : Sweden + 12 : Switzerland + 13 : Australia + 14 : New Zealand + 15 : Taiwan + 16 : Hong Kong + 17 : Korea * + 18 : China * + 19 : No Region? + 1A+: Invalid + + For future reference, that would mean the following + + ROM_LOAD16_BYTE( "prg0_nippon.u22", 0x000000, 0x080000, CRC(4f3fc729) SHA1(b32d51c254741b82171a86c271679522a7aefd34) ) + ROM_LOAD16_BYTE( "prg0_usa.u22", 0x000000, 0x080000, CRC(2049d007) SHA1(f2a43547a6fc5083b03c1d59a85abbf6e1ce4cd9) ) + ROM_LOAD16_BYTE( "prg0_europe.u22", 0x000000, 0x080000, CRC(91d3e975) SHA1(682885fc17f2424d475c282f239f42faf1aae076) ) + ROM_LOAD16_BYTE( "prg0_asia.u22", 0x000000, 0x080000, CRC(fea5fe5b) SHA1(0008336ecd3886485ab1d9678880b1a0bc788f40) ) + ROM_LOAD16_BYTE( "prg0_german.u22", 0x000000, 0x080000, CRC(29969dd0) SHA1(eb8ad84b772508b6befb35afb11a0d6193c6a060) ) + ROM_LOAD16_BYTE( "prg0_austria.u22", 0x000000, 0x080000, CRC(46e08afe) SHA1(a6f46581d0f7285704fbf1ac57476c96f4dcbec2) ) + ROM_LOAD16_BYTE( "prg0_belgium.u22", 0x000000, 0x080000, CRC(f77ab38c) SHA1(8be87175250345d3e31d95ec204805071eae81f6) ) + ROM_LOAD16_BYTE( "prg0_denmark.u22", 0x000000, 0x080000, CRC(980ca4a2) SHA1(4f29eaa5ba6b94d96c527f80188657abc8f4dcd0) ) + ROM_LOAD16_BYTE( "prg0_finland.u22", 0x000000, 0x080000, CRC(826d72db) SHA1(be4bca0143f43c13361fd56974eb9b1ce7bd1740) ) + ROM_LOAD16_BYTE( "prg0_france.u22", 0x000000, 0x080000, CRC(ed1b65f5) SHA1(1e08957c0f7ed65695fb1ceb961ab765f8a97c89) ) + ROM_LOAD16_BYTE( "prg0_greatbritain.u22", 0x000000, 0x080000, CRC(5c815c87) SHA1(dea89944cd9a3fa6991b214495dc7123a505d39b) ) + ROM_LOAD16_BYTE( "prg0_greece.u22", 0x000000, 0x080000, CRC(33f74ba9) SHA1(fe770415584b037152b37a75fe468d3c52dcb3cd) ) + ROM_LOAD16_BYTE( "prg0_netherlands.u22", 0x000000, 0x080000, CRC(e4c42822) SHA1(8bfd286c42d7f2b3c88757b9a8b818be90b73f48) ) + ROM_LOAD16_BYTE( "prg0_italy.u22", 0x000000, 0x080000, CRC(8bb23f0c) SHA1(b448bba312a8d583a981f6633cbc14af99fdbb06) ) + ROM_LOAD16_BYTE( "prg0_norway.u22", 0x000000, 0x080000, CRC(3a28067e) SHA1(9435e6ce90b8d740a545469e6edb35d1af11ceab) ) + ROM_LOAD16_BYTE( "prg0_portugal.u22", 0x000000, 0x080000, CRC(555e1150) SHA1(5c9ae898244a23a4184f9613f42d9aa9530468b9) ) + ROM_LOAD16_BYTE( "prg0_spain.u22", 0x000000, 0x080000, CRC(0eebaa8c) SHA1(e305e90434e7f322a33e42a642362f770d3eb0e5) ) + ROM_LOAD16_BYTE( "prg0_sweden.u22", 0x000000, 0x080000, CRC(619dbda2) SHA1(9e88ba104a5cffcced3b93ca711487a82b0fddde) ) + ROM_LOAD16_BYTE( "prg0_switzerland.u22", 0x000000, 0x080000, CRC(d00784d0) SHA1(0b809414ce910684ca39216086f7d26fd2adeded) ) + ROM_LOAD16_BYTE( "prg0_australia.u22", 0x000000, 0x080000, CRC(bf7193fe) SHA1(9af50fffc6ef23e300bf7b5e90b0dee6e4f4ad05) ) + ROM_LOAD16_BYTE( "prg0_newzealand.u22", 0x000000, 0x080000, CRC(6842f075) SHA1(125b303c064d2f0b539ecadcb205756e7fd1334e) ) + ROM_LOAD16_BYTE( "prg0_taiwan.u22", 0x000000, 0x080000, CRC(0734e75b) SHA1(17a8fb4f8fda3c234ed976490193ba308cac08fe) ) + ROM_LOAD16_BYTE( "prg0_hongkong.u22", 0x000000, 0x080000, CRC(b6aede29) SHA1(580f29db6a2c2cea43966413778362694992a675) ) + ROM_LOAD16_BYTE( "prg0_korea.u22", 0x000000, 0x080000, CRC(d9d8c907) SHA1(69c197f2a41f288913f042de9eb8274c0df3ac27) ) + ROM_LOAD16_BYTE( "prg0_china.u22", 0x000000, 0x080000, CRC(c3b91f7e) SHA1(6b2376c37808dccda296d90ccd7f577ccff4e4dc) ) + ROM_LOAD16_BYTE( "prg0_none.u22", 0x000000, 0x080000, CRC(accf0850) SHA1(d93e4e80443a40c3a9575dbf21927ef0d1a039b9) ) + */ + + +ROM_START( batrider ) + ROM_REGION( 0x200000, "maincpu", 0 ) /* Main 68k code */ + ROM_LOAD16_BYTE( "prg0_europe.u22", 0x000000, 0x080000, CRC(91d3e975) SHA1(682885fc17f2424d475c282f239f42faf1aae076) ) + ROM_LOAD16_BYTE( "prg1b.u23", 0x000001, 0x080000, CRC(8e70b492) SHA1(f84f2039826ae815afb058d71c1dbd190f9d524d) ) + ROM_LOAD16_BYTE( "prg2.u21" , 0x100000, 0x080000, CRC(bdaa5fbf) SHA1(abd72ac633c0c8e7b4b1d7902c0d6e014ba995fe) ) + ROM_LOAD16_BYTE( "prg3.u24" , 0x100001, 0x080000, CRC(7aa9f941) SHA1(99bdbad7a96d461073b06a53c50fc57c2fd6fc6d) ) + + ROM_REGION( 0x40000, "audiocpu", 0 ) /* Sound Z80 code + bank */ + ROM_LOAD( "snd.u77", 0x00000, 0x40000, CRC(56682696) SHA1(a372450d9a6d535123dfc31d8116074b168ab646) ) + + ROM_REGION( 0x1000000, "gp9001", 0 ) + ROM_LOAD( "rom-1.bin", 0x000000, 0x400000, CRC(0df69ca2) SHA1(49670347ebd7e1067ff988cf842b275b7ee7b5f7) ) + ROM_LOAD( "rom-3.bin", 0x400000, 0x400000, CRC(60167d38) SHA1(fd2429808c59ef51fd5f5db84ea89a8dc504186e) ) + ROM_LOAD( "rom-2.bin", 0x800000, 0x400000, CRC(1bfea593) SHA1(ce06dc3097ae56b0df56d104bbf7efc9b5d968d4) ) + ROM_LOAD( "rom-4.bin", 0xc00000, 0x400000, CRC(bee03c94) SHA1(5bc1e6769c42857c03456426b502fcb86a114f19) ) + + ROM_REGION( 0x100000, "oki1", 0 ) /* ADPCM Samples 1 */ + ROM_LOAD( "rom-5.bin", 0x000000, 0x100000, CRC(4274daf6) SHA1(85557b4707d529e5914f03c7a856864f5c24950e) ) + + ROM_REGION( 0x100000, "oki2", 0 ) /* ADPCM Samples 2 */ + ROM_LOAD( "rom-6.bin", 0x000000, 0x100000, CRC(2a1c2426) SHA1(8abc3688ffc5ebb94b8d5118d4fa0908f07fe791) ) +ROM_END + + +ROM_START( batrideru ) + ROM_REGION( 0x200000, "maincpu", 0 ) /* Main 68k code */ + ROM_LOAD16_BYTE( "prg0_usa.u22", 0x000000, 0x080000, CRC(2049d007) SHA1(f2a43547a6fc5083b03c1d59a85abbf6e1ce4cd9) ) + ROM_LOAD16_BYTE( "prg1b.u23", 0x000001, 0x080000, CRC(8e70b492) SHA1(f84f2039826ae815afb058d71c1dbd190f9d524d) ) + ROM_LOAD16_BYTE( "prg2.u21" , 0x100000, 0x080000, CRC(bdaa5fbf) SHA1(abd72ac633c0c8e7b4b1d7902c0d6e014ba995fe) ) + ROM_LOAD16_BYTE( "prg3.u24" , 0x100001, 0x080000, CRC(7aa9f941) SHA1(99bdbad7a96d461073b06a53c50fc57c2fd6fc6d) ) + + ROM_REGION( 0x40000, "audiocpu", 0 ) /* Sound Z80 code + bank */ + ROM_LOAD( "snd.u77", 0x00000, 0x40000, CRC(56682696) SHA1(a372450d9a6d535123dfc31d8116074b168ab646) ) + + ROM_REGION( 0x1000000, "gp9001", 0 ) + ROM_LOAD( "rom-1.bin", 0x000000, 0x400000, CRC(0df69ca2) SHA1(49670347ebd7e1067ff988cf842b275b7ee7b5f7) ) + ROM_LOAD( "rom-3.bin", 0x400000, 0x400000, CRC(60167d38) SHA1(fd2429808c59ef51fd5f5db84ea89a8dc504186e) ) + ROM_LOAD( "rom-2.bin", 0x800000, 0x400000, CRC(1bfea593) SHA1(ce06dc3097ae56b0df56d104bbf7efc9b5d968d4) ) + ROM_LOAD( "rom-4.bin", 0xc00000, 0x400000, CRC(bee03c94) SHA1(5bc1e6769c42857c03456426b502fcb86a114f19) ) + + ROM_REGION( 0x100000, "oki1", 0 ) /* ADPCM Samples 1 */ + ROM_LOAD( "rom-5.bin", 0x000000, 0x100000, CRC(4274daf6) SHA1(85557b4707d529e5914f03c7a856864f5c24950e) ) + + ROM_REGION( 0x100000, "oki2", 0 ) /* ADPCM Samples 2 */ + ROM_LOAD( "rom-6.bin", 0x000000, 0x100000, CRC(2a1c2426) SHA1(8abc3688ffc5ebb94b8d5118d4fa0908f07fe791) ) +ROM_END + + +ROM_START( batriderc ) + ROM_REGION( 0x200000, "maincpu", 0 ) /* Main 68k code */ + ROM_LOAD16_BYTE( "prg0_china.u22", 0x000000, 0x080000, CRC(c3b91f7e) SHA1(6b2376c37808dccda296d90ccd7f577ccff4e4dc) ) + ROM_LOAD16_BYTE( "prg1b.u23", 0x000001, 0x080000, CRC(8e70b492) SHA1(f84f2039826ae815afb058d71c1dbd190f9d524d) ) + ROM_LOAD16_BYTE( "prg2.u21" , 0x100000, 0x080000, CRC(bdaa5fbf) SHA1(abd72ac633c0c8e7b4b1d7902c0d6e014ba995fe) ) + ROM_LOAD16_BYTE( "prg3.u24" , 0x100001, 0x080000, CRC(7aa9f941) SHA1(99bdbad7a96d461073b06a53c50fc57c2fd6fc6d) ) + + ROM_REGION( 0x40000, "audiocpu", 0 ) /* Sound Z80 code + bank */ + ROM_LOAD( "snd.u77", 0x00000, 0x40000, CRC(56682696) SHA1(a372450d9a6d535123dfc31d8116074b168ab646) ) + + ROM_REGION( 0x1000000, "gp9001", 0 ) + ROM_LOAD( "rom-1.bin", 0x000000, 0x400000, CRC(0df69ca2) SHA1(49670347ebd7e1067ff988cf842b275b7ee7b5f7) ) + ROM_LOAD( "rom-3.bin", 0x400000, 0x400000, CRC(60167d38) SHA1(fd2429808c59ef51fd5f5db84ea89a8dc504186e) ) + ROM_LOAD( "rom-2.bin", 0x800000, 0x400000, CRC(1bfea593) SHA1(ce06dc3097ae56b0df56d104bbf7efc9b5d968d4) ) + ROM_LOAD( "rom-4.bin", 0xc00000, 0x400000, CRC(bee03c94) SHA1(5bc1e6769c42857c03456426b502fcb86a114f19) ) + + ROM_REGION( 0x100000, "oki1", 0 ) /* ADPCM Samples 1 */ + ROM_LOAD( "rom-5.bin", 0x000000, 0x100000, CRC(4274daf6) SHA1(85557b4707d529e5914f03c7a856864f5c24950e) ) + + ROM_REGION( 0x100000, "oki2", 0 ) /* ADPCM Samples 2 */ + ROM_LOAD( "rom-6.bin", 0x000000, 0x100000, CRC(2a1c2426) SHA1(8abc3688ffc5ebb94b8d5118d4fa0908f07fe791) ) +ROM_END + + +ROM_START( batriderj ) + ROM_REGION( 0x200000, "maincpu", 0 ) /* Main 68k code */ + ROM_LOAD16_BYTE( "prg0b.u22", 0x000000, 0x080000, CRC(4f3fc729) SHA1(b32d51c254741b82171a86c271679522a7aefd34) ) + ROM_LOAD16_BYTE( "prg1b.u23", 0x000001, 0x080000, CRC(8e70b492) SHA1(f84f2039826ae815afb058d71c1dbd190f9d524d) ) + ROM_LOAD16_BYTE( "prg2.u21" , 0x100000, 0x080000, CRC(bdaa5fbf) SHA1(abd72ac633c0c8e7b4b1d7902c0d6e014ba995fe) ) + ROM_LOAD16_BYTE( "prg3.u24" , 0x100001, 0x080000, CRC(7aa9f941) SHA1(99bdbad7a96d461073b06a53c50fc57c2fd6fc6d) ) + + ROM_REGION( 0x40000, "audiocpu", 0 ) /* Sound Z80 code + bank */ + ROM_LOAD( "snd.u77", 0x00000, 0x40000, CRC(56682696) SHA1(a372450d9a6d535123dfc31d8116074b168ab646) ) + + ROM_REGION( 0x1000000, "gp9001", 0 ) + ROM_LOAD( "rom-1.bin", 0x000000, 0x400000, CRC(0df69ca2) SHA1(49670347ebd7e1067ff988cf842b275b7ee7b5f7) ) + ROM_LOAD( "rom-3.bin", 0x400000, 0x400000, CRC(60167d38) SHA1(fd2429808c59ef51fd5f5db84ea89a8dc504186e) ) + ROM_LOAD( "rom-2.bin", 0x800000, 0x400000, CRC(1bfea593) SHA1(ce06dc3097ae56b0df56d104bbf7efc9b5d968d4) ) + ROM_LOAD( "rom-4.bin", 0xc00000, 0x400000, CRC(bee03c94) SHA1(5bc1e6769c42857c03456426b502fcb86a114f19) ) + + ROM_REGION( 0x100000, "oki1", 0 ) /* ADPCM Samples 1 */ + ROM_LOAD( "rom-5.bin", 0x000000, 0x100000, CRC(4274daf6) SHA1(85557b4707d529e5914f03c7a856864f5c24950e) ) + + ROM_REGION( 0x100000, "oki2", 0 ) /* ADPCM Samples 2 */ + ROM_LOAD( "rom-6.bin", 0x000000, 0x100000, CRC(2a1c2426) SHA1(8abc3688ffc5ebb94b8d5118d4fa0908f07fe791) ) +ROM_END + + +ROM_START( batriderk ) + ROM_REGION( 0x200000, "maincpu", 0 ) /* Main 68k code */ + ROM_LOAD16_BYTE( "prg0_korea.u22", 0x000000, 0x080000, CRC(d9d8c907) SHA1(69c197f2a41f288913f042de9eb8274c0df3ac27) ) + ROM_LOAD16_BYTE( "prg1b.u23", 0x000001, 0x080000, CRC(8e70b492) SHA1(f84f2039826ae815afb058d71c1dbd190f9d524d) ) + ROM_LOAD16_BYTE( "prg2.u21" , 0x100000, 0x080000, CRC(bdaa5fbf) SHA1(abd72ac633c0c8e7b4b1d7902c0d6e014ba995fe) ) + ROM_LOAD16_BYTE( "prg3.u24" , 0x100001, 0x080000, CRC(7aa9f941) SHA1(99bdbad7a96d461073b06a53c50fc57c2fd6fc6d) ) + + ROM_REGION( 0x40000, "audiocpu", 0 ) /* Sound Z80 code + bank */ + ROM_LOAD( "snd.u77", 0x00000, 0x40000, CRC(56682696) SHA1(a372450d9a6d535123dfc31d8116074b168ab646) ) + + ROM_REGION( 0x1000000, "gp9001", 0 ) + ROM_LOAD( "rom-1.bin", 0x000000, 0x400000, CRC(0df69ca2) SHA1(49670347ebd7e1067ff988cf842b275b7ee7b5f7) ) + ROM_LOAD( "rom-3.bin", 0x400000, 0x400000, CRC(60167d38) SHA1(fd2429808c59ef51fd5f5db84ea89a8dc504186e) ) + ROM_LOAD( "rom-2.bin", 0x800000, 0x400000, CRC(1bfea593) SHA1(ce06dc3097ae56b0df56d104bbf7efc9b5d968d4) ) + ROM_LOAD( "rom-4.bin", 0xc00000, 0x400000, CRC(bee03c94) SHA1(5bc1e6769c42857c03456426b502fcb86a114f19) ) + + ROM_REGION( 0x100000, "oki1", 0 ) /* ADPCM Samples 1 */ + ROM_LOAD( "rom-5.bin", 0x000000, 0x100000, CRC(4274daf6) SHA1(85557b4707d529e5914f03c7a856864f5c24950e) ) + + ROM_REGION( 0x100000, "oki2", 0 ) /* ADPCM Samples 2 */ + ROM_LOAD( "rom-6.bin", 0x000000, 0x100000, CRC(2a1c2426) SHA1(8abc3688ffc5ebb94b8d5118d4fa0908f07fe791) ) +ROM_END + +/* older version, might have only been released in Japan, Hong Kong and Taiwan? */ +ROM_START( batriderja ) + ROM_REGION( 0x200000, "maincpu", 0 ) /* Main 68k code */ + ROM_LOAD16_BYTE( "prg0.bin", 0x000000, 0x080000, CRC(f93ea27c) SHA1(41023c2ee1efd70b5aa9c70e1ddd9e5c3d51d68a) ) + ROM_LOAD16_BYTE( "prg1.u23", 0x000001, 0x080000, CRC(8ae7f592) SHA1(8a20ebf85eca621f578d2302c3a3988647b077a7) ) + ROM_LOAD16_BYTE( "prg2.u21", 0x100000, 0x080000, CRC(bdaa5fbf) SHA1(abd72ac633c0c8e7b4b1d7902c0d6e014ba995fe) ) + ROM_LOAD16_BYTE( "prg3.u24", 0x100001, 0x080000, CRC(7aa9f941) SHA1(99bdbad7a96d461073b06a53c50fc57c2fd6fc6d) ) + + ROM_REGION( 0x40000, "audiocpu", 0 ) /* Sound Z80 code + bank */ + ROM_LOAD( "snd.u77", 0x00000, 0x40000, CRC(56682696) SHA1(a372450d9a6d535123dfc31d8116074b168ab646) ) + + ROM_REGION( 0x1000000, "gp9001", 0 ) + ROM_LOAD( "rom-1.bin", 0x000000, 0x400000, CRC(0df69ca2) SHA1(49670347ebd7e1067ff988cf842b275b7ee7b5f7) ) + ROM_LOAD( "rom-3.bin", 0x400000, 0x400000, CRC(60167d38) SHA1(fd2429808c59ef51fd5f5db84ea89a8dc504186e) ) + ROM_LOAD( "rom-2.bin", 0x800000, 0x400000, CRC(1bfea593) SHA1(ce06dc3097ae56b0df56d104bbf7efc9b5d968d4) ) + ROM_LOAD( "rom-4.bin", 0xc00000, 0x400000, CRC(bee03c94) SHA1(5bc1e6769c42857c03456426b502fcb86a114f19) ) + + ROM_REGION( 0x100000, "oki1", 0 ) /* ADPCM Samples 1 */ + ROM_LOAD( "rom-5.bin", 0x000000, 0x100000, CRC(4274daf6) SHA1(85557b4707d529e5914f03c7a856864f5c24950e) ) + + ROM_REGION( 0x100000, "oki2", 0 ) /* ADPCM Samples 2 */ + ROM_LOAD( "rom-6.bin", 0x000000, 0x100000, CRC(2a1c2426) SHA1(8abc3688ffc5ebb94b8d5118d4fa0908f07fe791) ) +ROM_END + + +ROM_START( batriderhk ) + ROM_REGION( 0x200000, "maincpu", 0 ) /* Main 68k code */ + ROM_LOAD16_BYTE( "prg0.u22", 0x000000, 0x080000, CRC(00afbb7c) SHA1(a4b6331e0fcab7d0c43fc43adb701f1248247b41) ) + ROM_LOAD16_BYTE( "prg1.u23", 0x000001, 0x080000, CRC(8ae7f592) SHA1(8a20ebf85eca621f578d2302c3a3988647b077a7) ) + ROM_LOAD16_BYTE( "prg2.u21", 0x100000, 0x080000, CRC(bdaa5fbf) SHA1(abd72ac633c0c8e7b4b1d7902c0d6e014ba995fe) ) + ROM_LOAD16_BYTE( "prg3.u24", 0x100001, 0x080000, CRC(7aa9f941) SHA1(99bdbad7a96d461073b06a53c50fc57c2fd6fc6d) ) + + ROM_REGION( 0x40000, "audiocpu", 0 ) /* Sound Z80 code + bank */ + ROM_LOAD( "snd.u77", 0x00000, 0x40000, CRC(56682696) SHA1(a372450d9a6d535123dfc31d8116074b168ab646) ) + + ROM_REGION( 0x1000000, "gp9001", 0 ) + ROM_LOAD( "rom-1.bin", 0x000000, 0x400000, CRC(0df69ca2) SHA1(49670347ebd7e1067ff988cf842b275b7ee7b5f7) ) + ROM_LOAD( "rom-3.bin", 0x400000, 0x400000, CRC(60167d38) SHA1(fd2429808c59ef51fd5f5db84ea89a8dc504186e) ) + ROM_LOAD( "rom-2.bin", 0x800000, 0x400000, CRC(1bfea593) SHA1(ce06dc3097ae56b0df56d104bbf7efc9b5d968d4) ) + ROM_LOAD( "rom-4.bin", 0xc00000, 0x400000, CRC(bee03c94) SHA1(5bc1e6769c42857c03456426b502fcb86a114f19) ) + + ROM_REGION( 0x100000, "oki1", 0 ) /* ADPCM Samples 1 */ + ROM_LOAD( "rom-5.bin", 0x000000, 0x100000, CRC(4274daf6) SHA1(85557b4707d529e5914f03c7a856864f5c24950e) ) + + ROM_REGION( 0x100000, "oki2", 0 ) /* ADPCM Samples 2 */ + ROM_LOAD( "rom-6.bin", 0x000000, 0x100000, CRC(2a1c2426) SHA1(8abc3688ffc5ebb94b8d5118d4fa0908f07fe791) ) +ROM_END + + +ROM_START( batridert ) + ROM_REGION( 0x200000, "maincpu", 0 ) /* Main 68k code */ + ROM_LOAD16_BYTE( "u22.bin", 0x000000, 0x080000, CRC(b135820e) SHA1(c222887d18a0a3ea0fcc973b95b29d69c86f7ec3) ) + ROM_LOAD16_BYTE( "prg1.u23", 0x000001, 0x080000, CRC(8ae7f592) SHA1(8a20ebf85eca621f578d2302c3a3988647b077a7) ) + ROM_LOAD16_BYTE( "prg2.u21", 0x100000, 0x080000, CRC(bdaa5fbf) SHA1(abd72ac633c0c8e7b4b1d7902c0d6e014ba995fe) ) + ROM_LOAD16_BYTE( "prg3.u24", 0x100001, 0x080000, CRC(7aa9f941) SHA1(99bdbad7a96d461073b06a53c50fc57c2fd6fc6d) ) + + ROM_REGION( 0x40000, "audiocpu", 0 ) /* Sound Z80 code + bank */ + ROM_LOAD( "snd.u77", 0x00000, 0x40000, CRC(56682696) SHA1(a372450d9a6d535123dfc31d8116074b168ab646) ) + + ROM_REGION( 0x1000000, "gp9001", 0 ) + ROM_LOAD( "rom-1.bin", 0x000000, 0x400000, CRC(0df69ca2) SHA1(49670347ebd7e1067ff988cf842b275b7ee7b5f7) ) + ROM_LOAD( "rom-3.bin", 0x400000, 0x400000, CRC(60167d38) SHA1(fd2429808c59ef51fd5f5db84ea89a8dc504186e) ) + ROM_LOAD( "rom-2.bin", 0x800000, 0x400000, CRC(1bfea593) SHA1(ce06dc3097ae56b0df56d104bbf7efc9b5d968d4) ) + ROM_LOAD( "rom-4.bin", 0xc00000, 0x400000, CRC(bee03c94) SHA1(5bc1e6769c42857c03456426b502fcb86a114f19) ) + + ROM_REGION( 0x100000, "oki1", 0 ) /* ADPCM Samples 1 */ + ROM_LOAD( "rom-5.bin", 0x000000, 0x100000, CRC(4274daf6) SHA1(85557b4707d529e5914f03c7a856864f5c24950e) ) + + ROM_REGION( 0x100000, "oki2", 0 ) /* ADPCM Samples 2 */ + ROM_LOAD( "rom-6.bin", 0x000000, 0x100000, CRC(2a1c2426) SHA1(8abc3688ffc5ebb94b8d5118d4fa0908f07fe791) ) +ROM_END + + + +/* +Battle Bakraid +Raizing/8ing, 1999 + +PCB Layout +---------- + +ET68-V99 +|-----------------------------------------------------| +|TA8201 16.93MHz ROM-6 6264 | +| YAC516 | +| YMZ280B-F ROM-7 SND_U0720 | +| | +| VOL ROM-8 Z80 | +| | +| 341256 | +| 93C66 | +| 341256 XILINX | +|J XC95108 | +|A 27MHz 32MHz | +|M | +|M DIPSW1 341256 341256| +|A XILINX XILINK | +| DIPSW2 XC95144 XC95108 341256 341256| +| | +| DIPSW3 | +| MACH211 PRG1_U023 | +| TEST_SW 68000 | +| PRG0_U022 | +| | +| PRG3_U024 | +| L7A0498 | +| GP9001 PRG2_U021 | +| ROM-0 ROM-1 (QFP208) | +| | +| 6264 MN414260 | +| ROM-2 ROM-3 | +| 6264 MN414260 | +|-----------------------------------------------------| +Notes: + ROM-0 to ROM-3 - 32M DIP42 + ROM-6 to ROM-8 - 32M DIP42 Byte Mode + 68000 clock - 16.000MHz (32/2) + Z80 clock - 5.33333MHz (32/6) + VSync - 60Hz + HSync - 15.39kHz +*/ + + + +ROM_START( bbakraid ) + ROM_REGION( 0x200000, "maincpu", 0 ) /* Main 68k code */ + ROM_LOAD16_BYTE( "prg0u022_usa.bin", 0x000000, 0x080000, CRC(95fb2ffd) SHA1(c7f502f3945249573b66226e8bacc6a9bc230693) ) + ROM_LOAD16_BYTE( "prg1u023.new", 0x000001, 0x080000, CRC(4ae9aa64) SHA1(45fdf72141c4c9f24a38d4218c65874799b9c868) ) + ROM_LOAD16_BYTE( "prg2u021.bin", 0x100000, 0x080000, CRC(ffba8656) SHA1(6526bb65fad3384de3f301a7d1095cbf03757433) ) + ROM_LOAD16_BYTE( "prg3u024.bin", 0x100001, 0x080000, CRC(834b8ad6) SHA1(0dd6223bb0749819ad29811eeb04fd08d937abb0) ) + + ROM_REGION( 0x20000, "audiocpu", 0 ) /* Sound Z80 code */ + ROM_LOAD( "sndu0720.bin", 0x00000, 0x20000, CRC(e62ab246) SHA1(00d23689dd423ecd4024c58b5903d16e890f1dff) ) + + ROM_REGION( 0x1000000, "gp9001", 0 ) + ROM_LOAD( "gfxu0510.bin", 0x000000, 0x400000, CRC(9cca3446) SHA1(1123f8b8bfbe59a2c572cdf61f1ad27ff37f0f0d) ) + ROM_LOAD( "gfxu0512.bin", 0x400000, 0x400000, CRC(a2a281d5) SHA1(d9a6623f9433ad682223f9780c26cd1523ebc5c5) ) + ROM_LOAD( "gfxu0511.bin", 0x800000, 0x400000, CRC(e16472c0) SHA1(6068d679a8b3b65e05acd58a7ce9ead90177049f) ) + ROM_LOAD( "gfxu0513.bin", 0xc00000, 0x400000, CRC(8bb635a0) SHA1(9064f1a2d8bb88ddbca702fb8556d0dfe6a5cadc) ) + + ROM_REGION( 0x0c00000, "ymz", 0 ) /* YMZ280B Samples */ + ROM_LOAD( "rom6.829", 0x000000, 0x400000, CRC(8848b4a0) SHA1(e0dce136c5d5a4c1a92b863e57848cd5927d06f1) ) + ROM_LOAD( "rom7.830", 0x400000, 0x400000, CRC(d6224267) SHA1(5c9b7b13effbef9f707811f84bfe50ca85e605e3) ) + ROM_LOAD( "rom8.831", 0x800000, 0x400000, CRC(a101dfb0) SHA1(4b729b0d562e09df35438e9e6b457b8de2690a6e) ) + + ROM_REGION( 0x200, "eeprom", 0 ) + ROM_LOAD( "eeprom-bbakraid-new.bin", 0x000, 0x200, CRC(35c9275a) SHA1(1282034adf3c7a24545fd273729867058dc93027) ) +ROM_END + + +ROM_START( bbakraidc ) + ROM_REGION( 0x200000, "maincpu", 0 ) /* Main 68k code */ + ROM_LOAD16_BYTE( "prg0u022_china.bin", 0x000000, 0x080000, CRC(760be084) SHA1(096c8a2336492d7370ae25f3385faebf6e9c3eca) ) + ROM_LOAD16_BYTE( "prg1u023.new", 0x000001, 0x080000, CRC(4ae9aa64) SHA1(45fdf72141c4c9f24a38d4218c65874799b9c868) ) + ROM_LOAD16_BYTE( "prg2u021.bin", 0x100000, 0x080000, CRC(ffba8656) SHA1(6526bb65fad3384de3f301a7d1095cbf03757433) ) + ROM_LOAD16_BYTE( "prg3u024.bin", 0x100001, 0x080000, CRC(834b8ad6) SHA1(0dd6223bb0749819ad29811eeb04fd08d937abb0) ) + + ROM_REGION( 0x20000, "audiocpu", 0 ) /* Sound Z80 code */ + ROM_LOAD( "sndu0720.bin", 0x00000, 0x20000, CRC(e62ab246) SHA1(00d23689dd423ecd4024c58b5903d16e890f1dff) ) + + ROM_REGION( 0x1000000, "gp9001", 0 ) + ROM_LOAD( "gfxu0510.bin", 0x000000, 0x400000, CRC(9cca3446) SHA1(1123f8b8bfbe59a2c572cdf61f1ad27ff37f0f0d) ) + ROM_LOAD( "gfxu0512.bin", 0x400000, 0x400000, CRC(a2a281d5) SHA1(d9a6623f9433ad682223f9780c26cd1523ebc5c5) ) + ROM_LOAD( "gfxu0511.bin", 0x800000, 0x400000, CRC(e16472c0) SHA1(6068d679a8b3b65e05acd58a7ce9ead90177049f) ) + ROM_LOAD( "gfxu0513.bin", 0xc00000, 0x400000, CRC(8bb635a0) SHA1(9064f1a2d8bb88ddbca702fb8556d0dfe6a5cadc) ) + + ROM_REGION( 0x0c00000, "ymz", 0 ) /* YMZ280B Samples */ + ROM_LOAD( "rom6.829", 0x000000, 0x400000, CRC(8848b4a0) SHA1(e0dce136c5d5a4c1a92b863e57848cd5927d06f1) ) + ROM_LOAD( "rom7.830", 0x400000, 0x400000, CRC(d6224267) SHA1(5c9b7b13effbef9f707811f84bfe50ca85e605e3) ) + ROM_LOAD( "rom8.831", 0x800000, 0x400000, CRC(a101dfb0) SHA1(4b729b0d562e09df35438e9e6b457b8de2690a6e) ) + + ROM_REGION( 0x200, "eeprom", 0 ) + ROM_LOAD( "eeprom-bbakraid-new.bin", 0x000, 0x200, CRC(35c9275a) SHA1(1282034adf3c7a24545fd273729867058dc93027) ) +ROM_END + + +ROM_START( bbakraidj ) + ROM_REGION( 0x200000, "maincpu", 0 ) /* Main 68k code */ + ROM_LOAD16_BYTE( "prg0u022.new", 0x000000, 0x080000, CRC(fa8d38d3) SHA1(aba91d87a8a62d3fe1139b4437b16e2f844264ad) ) + ROM_LOAD16_BYTE( "prg1u023.new", 0x000001, 0x080000, CRC(4ae9aa64) SHA1(45fdf72141c4c9f24a38d4218c65874799b9c868) ) + ROM_LOAD16_BYTE( "prg2u021.bin", 0x100000, 0x080000, CRC(ffba8656) SHA1(6526bb65fad3384de3f301a7d1095cbf03757433) ) + ROM_LOAD16_BYTE( "prg3u024.bin", 0x100001, 0x080000, CRC(834b8ad6) SHA1(0dd6223bb0749819ad29811eeb04fd08d937abb0) ) + + ROM_REGION( 0x20000, "audiocpu", 0 ) /* Sound Z80 code */ + ROM_LOAD( "sndu0720.bin", 0x00000, 0x20000, CRC(e62ab246) SHA1(00d23689dd423ecd4024c58b5903d16e890f1dff) ) + + ROM_REGION( 0x1000000, "gp9001", 0 ) + ROM_LOAD( "gfxu0510.bin", 0x000000, 0x400000, CRC(9cca3446) SHA1(1123f8b8bfbe59a2c572cdf61f1ad27ff37f0f0d) ) + ROM_LOAD( "gfxu0512.bin", 0x400000, 0x400000, CRC(a2a281d5) SHA1(d9a6623f9433ad682223f9780c26cd1523ebc5c5) ) + ROM_LOAD( "gfxu0511.bin", 0x800000, 0x400000, CRC(e16472c0) SHA1(6068d679a8b3b65e05acd58a7ce9ead90177049f) ) + ROM_LOAD( "gfxu0513.bin", 0xc00000, 0x400000, CRC(8bb635a0) SHA1(9064f1a2d8bb88ddbca702fb8556d0dfe6a5cadc) ) + + ROM_REGION( 0x0c00000, "ymz", 0 ) /* YMZ280B Samples */ + ROM_LOAD( "rom6.829", 0x000000, 0x400000, CRC(8848b4a0) SHA1(e0dce136c5d5a4c1a92b863e57848cd5927d06f1) ) + ROM_LOAD( "rom7.830", 0x400000, 0x400000, CRC(d6224267) SHA1(5c9b7b13effbef9f707811f84bfe50ca85e605e3) ) + ROM_LOAD( "rom8.831", 0x800000, 0x400000, CRC(a101dfb0) SHA1(4b729b0d562e09df35438e9e6b457b8de2690a6e) ) + + ROM_REGION( 0x200, "eeprom", 0 ) + ROM_LOAD( "eeprom-bbakraid-new.bin", 0x000, 0x200, CRC(35c9275a) SHA1(1282034adf3c7a24545fd273729867058dc93027) ) +ROM_END + + +ROM_START( bbakraidja ) + ROM_REGION( 0x200000, "maincpu", 0 ) /* Main 68k code */ + ROM_LOAD16_BYTE( "prg0u022.bin", 0x000000, 0x080000, CRC(0dd59512) SHA1(c6a4e6aa49c6ac3b04ae62a0a4cc8084ae048381) ) + ROM_LOAD16_BYTE( "prg1u023.bin", 0x000001, 0x080000, CRC(fecde223) SHA1(eb5ac0eda49b4b0f3d25d8a8bb356e77a453d3a7) ) + ROM_LOAD16_BYTE( "prg2u021.bin", 0x100000, 0x080000, CRC(ffba8656) SHA1(6526bb65fad3384de3f301a7d1095cbf03757433) ) + ROM_LOAD16_BYTE( "prg3u024.bin", 0x100001, 0x080000, CRC(834b8ad6) SHA1(0dd6223bb0749819ad29811eeb04fd08d937abb0) ) + + ROM_REGION( 0x20000, "audiocpu", 0 ) /* Sound Z80 code */ + ROM_LOAD( "sndu0720.bin", 0x00000, 0x20000, CRC(e62ab246) SHA1(00d23689dd423ecd4024c58b5903d16e890f1dff) ) + + ROM_REGION( 0x1000000, "gp9001", 0 ) + ROM_LOAD( "gfxu0510.bin", 0x000000, 0x400000, CRC(9cca3446) SHA1(1123f8b8bfbe59a2c572cdf61f1ad27ff37f0f0d) ) + ROM_LOAD( "gfxu0512.bin", 0x400000, 0x400000, CRC(a2a281d5) SHA1(d9a6623f9433ad682223f9780c26cd1523ebc5c5) ) + ROM_LOAD( "gfxu0511.bin", 0x800000, 0x400000, CRC(e16472c0) SHA1(6068d679a8b3b65e05acd58a7ce9ead90177049f) ) + ROM_LOAD( "gfxu0513.bin", 0xc00000, 0x400000, CRC(8bb635a0) SHA1(9064f1a2d8bb88ddbca702fb8556d0dfe6a5cadc) ) + + ROM_REGION( 0x0c00000, "ymz", 0 ) /* YMZ280B Samples */ + ROM_LOAD( "rom6.829", 0x000000, 0x400000, CRC(8848b4a0) SHA1(e0dce136c5d5a4c1a92b863e57848cd5927d06f1) ) + ROM_LOAD( "rom7.830", 0x400000, 0x400000, CRC(d6224267) SHA1(5c9b7b13effbef9f707811f84bfe50ca85e605e3) ) + ROM_LOAD( "rom8.831", 0x800000, 0x400000, CRC(a101dfb0) SHA1(4b729b0d562e09df35438e9e6b457b8de2690a6e) ) + + ROM_REGION( 0x200, "eeprom", 0 ) + ROM_LOAD( "eeprom-bbakraid.bin", 0x000, 0x200, CRC(7f97d347) SHA1(3096c399019924dbb7d6673483f6a011f89467c6) ) +ROM_END + + +// dedicated PCB marked Pro Bowl +ROM_START( nprobowl ) + ROM_REGION( 0x200000, "maincpu", 0 ) + ROM_LOAD16_BYTE( "newprobowl-prg0-u021", 0x000000, 0x080000, CRC(3a57f122) SHA1(cc361c295f23bc0479ba49eb15de2ec6ca535a56) ) // 11xxxxxxxxxxxxxxxxx = 0xFF + ROM_LOAD16_BYTE( "newprobowl-prg1-u024", 0x000001, 0x080000, CRC(9e9bb58a) SHA1(3d2159bde418dee5d89e3df9a248b4b1989e6ee9) ) // 11xxxxxxxxxxxxxxxxx = 0xFF + + ROM_REGION( 0x200000, "gp9001", 0 ) + ROM_LOAD16_BYTE( "newprobowl-chr1-u0519", 0x000000, 0x80000, CRC(6700a9bf) SHA1(12a72aa0b91119fbbed994aec702a6869af6f287) ) + ROM_LOAD16_BYTE( "newprobowl-chr0-u0518", 0x000001, 0x80000, CRC(0736cccd) SHA1(5a4b691be1df697fef3847456c0f4bb3466c403f) ) + ROM_LOAD16_BYTE( "newprobowl-chr2-u0520", 0x100000, 0x80000, CRC(e5f6d0b6) SHA1(6e1a4792698be4b478118e8c82edb0cf3e2286f2) ) + ROM_LOAD16_BYTE( "newprobowl-chr3-u0521", 0x100001, 0x80000, CRC(00c21951) SHA1(922abde172fb82b504dce41b95227740f16208a7) ) + + ROM_REGION( 0x100000, "oki1", 0 ) + ROM_LOAD( "newprobowl-adpcm0-u0834", 0x00000, 0x80000, CRC(3b40b161) SHA1(ff8ba38dd7e0dadbf72810470e3d9afb1cd983d2) ) + ROM_LOAD( "newprobowl-adpcm1-u0835", 0x80000, 0x80000, CRC(8c191e60) SHA1(f81c2849ffc553d921fc680cd50c2997b834c44a) ) +ROM_END + +ROM_START( probowl2 ) // identical to New Pro Bowl but for slight mods to the GFX ROMs to display the different title + ROM_REGION( 0x200000, "maincpu", 0 ) + ROM_LOAD16_BYTE( "probowl2.prg0.u021", 0x000000, 0x080000, CRC(3a57f122) SHA1(cc361c295f23bc0479ba49eb15de2ec6ca535a56) ) // 11xxxxxxxxxxxxxxxxx = 0xFF + ROM_LOAD16_BYTE( "probowl2.prg1.u024", 0x000001, 0x080000, CRC(9e9bb58a) SHA1(3d2159bde418dee5d89e3df9a248b4b1989e6ee9) ) // 11xxxxxxxxxxxxxxxxx = 0xFF + + ROM_REGION( 0x200000, "gp9001", 0 ) + ROM_LOAD16_BYTE( "probowl2.chr1.u0519", 0x000000, 0x80000, CRC(66a5c9cd) SHA1(b8edc6a66e3929af2a1399e5fb6fc341b9789136) ) + ROM_LOAD16_BYTE( "probowl2.chr0.u0518", 0x000001, 0x80000, CRC(b4439673) SHA1(5ca19d9c3c3cce9485fb9bd5224f0b14abe07f49) ) + ROM_LOAD16_BYTE( "probowl2.chr2.u0520", 0x100000, 0x80000, CRC(e05be3a0) SHA1(922c6f094358cf3df790063e68d5dd4a32d46b06) ) + ROM_LOAD16_BYTE( "probowl2.chr3.u0521", 0x100001, 0x80000, CRC(55e2565f) SHA1(b6a570b736a9b30e26d2a59b53f218ef5cd6f0f6) ) + + ROM_REGION( 0x100000, "oki1", 0 ) + ROM_LOAD( "probowl2.adpcm0.u0834", 0x00000, 0x80000, CRC(be2fb43f) SHA1(f3f9bc522f4668852b751f291cef0000bb86b779) ) + ROM_LOAD( "probowl2.adpcm1.u0835", 0x80000, 0x80000, CRC(8c191e60) SHA1(f81c2849ffc553d921fc680cd50c2997b834c44a) ) +ROM_END + +} // anonymous namespace + +// these are all based on Version B, even if only the Japan version states 'version B' +GAME( 1998, batrider, 0, batrider, batrider, batrider_state, init_batrider, ROT270, "Raizing / Eighting", "Armed Police Batrider (Europe) (Fri Feb 13 1998)", MACHINE_SUPPORTS_SAVE ) +GAME( 1998, batrideru, batrider, batrider, batrider, batrider_state, init_batrider, ROT270, "Raizing / Eighting", "Armed Police Batrider (USA) (Fri Feb 13 1998)", MACHINE_SUPPORTS_SAVE ) +GAME( 1998, batriderc, batrider, batrider, batrider, batrider_state, init_batrider, ROT270, "Raizing / Eighting", "Armed Police Batrider (China) (Fri Feb 13 1998)", MACHINE_SUPPORTS_SAVE ) +GAME( 1998, batriderj, batrider, batrider, batriderj, batrider_state, init_batrider, ROT270, "Raizing / Eighting", "Armed Police Batrider (Japan, B version) (Fri Feb 13 1998)", MACHINE_SUPPORTS_SAVE ) +GAME( 1998, batriderk, batrider, batrider, batrider, batrider_state, init_batrider, ROT270, "Raizing / Eighting", "Armed Police Batrider (Korea) (Fri Feb 13 1998)", MACHINE_SUPPORTS_SAVE ) +// older revision of the code +GAME( 1998, batriderja, batrider, batrider, batriderj, batrider_state, init_batrider, ROT270, "Raizing / Eighting", "Armed Police Batrider (Japan, older version) (Mon Dec 22 1997)", MACHINE_SUPPORTS_SAVE ) +GAME( 1998, batriderhk, batrider, batrider, batrider, batrider_state, init_batrider, ROT270, "Raizing / Eighting", "Armed Police Batrider (Hong Kong) (Mon Dec 22 1997)", MACHINE_SUPPORTS_SAVE ) +GAME( 1998, batridert, batrider, batrider, batrider, batrider_state, init_batrider, ROT270, "Raizing / Eighting", "Armed Police Batrider (Taiwan) (Mon Dec 22 1997)", MACHINE_SUPPORTS_SAVE ) + +// Battle Bakraid +// the 'unlimited' version is a newer revision of the code +GAME( 1999, bbakraid, 0, bbakraid, bbakraid, bbakraid_state, init_bbakraid, ROT270, "Eighting", "Battle Bakraid - Unlimited Version (USA) (Tue Jun 8 1999)", MACHINE_SUPPORTS_SAVE ) +GAME( 1999, bbakraidc, bbakraid, bbakraid, bbakraid, bbakraid_state, init_bbakraid, ROT270, "Eighting", "Battle Bakraid - Unlimited Version (China) (Tue Jun 8 1999)", MACHINE_SUPPORTS_SAVE ) +GAME( 1999, bbakraidj, bbakraid, bbakraid, bbakraid, bbakraid_state, init_bbakraid, ROT270, "Eighting", "Battle Bakraid - Unlimited Version (Japan) (Tue Jun 8 1999)", MACHINE_SUPPORTS_SAVE ) +// older revision of the code +GAME( 1999, bbakraidja, bbakraid, bbakraid, bbakraid, bbakraid_state, init_bbakraid, ROT270, "Eighting", "Battle Bakraid (Japan) (Wed Apr 7 1999)", MACHINE_SUPPORTS_SAVE ) + +// dedicated PCB +GAME( 1996, nprobowl, 0, nprobowl, nprobowl, nprobowl_state, empty_init, ROT0, "Zuck / Able Corp", "New Pro Bowl", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_MECHANICAL | MACHINE_SUPPORTS_SAVE ) // bad GFXs, no sound banking, controls, etc +GAME( 1996, probowl2, nprobowl, nprobowl, nprobowl, nprobowl_state, empty_init, ROT0, "Zuck / Able Corp", "Pro Bowl 2", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_MECHANICAL | MACHINE_SUPPORTS_SAVE ) // bad GFXs, no sound banking, controls, etc diff --git a/src/mame/toaplan/snowbro2.cpp b/src/mame/toaplan/snowbro2.cpp new file mode 100644 index 00000000000..131464c50d9 --- /dev/null +++ b/src/mame/toaplan/snowbro2.cpp @@ -0,0 +1,451 @@ +// license:BSD-3-Clause +// copyright-holders:Quench, Yochizo, David Haywood + +#include "emu.h" + +#include "gp9001.h" +#include "toaplan_coincounter.h" +#include "toaplipt.h" + +#include "cpu/m68000/m68000.h" +#include "sound/okim6295.h" +#include "sound/ymopm.h" + +#include "emupal.h" +#include "screen.h" +#include "speaker.h" +#include "tilemap.h" + +/* +Name Board No Maker Game name +---------------------------------------------------------------------------- +snowbro2 TP-033 Hanafram Snow Bros. 2 - With New Elves + +*/ + +namespace { + +class snowbro2_state : public driver_device +{ +public: + snowbro2_state(const machine_config &mconfig, device_type type, const char *tag) + : driver_device(mconfig, type, tag) + , m_maincpu(*this, "maincpu") + , m_vdp(*this, "gp9001") + , m_oki(*this, "oki") + , m_screen(*this, "screen") + , m_palette(*this, "palette") + { } + + void snowbro2(machine_config &config) ATTR_COLD; + void snowbro2b3(machine_config &config) ATTR_COLD; + +protected: + virtual void video_start() override ATTR_COLD; + + void snowbro2_68k_mem(address_map &map) ATTR_COLD; + void snowbro2b3_68k_mem(address_map &map) ATTR_COLD; + + u32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + void screen_vblank(int state); + void sb2_oki_bankswitch_w(u8 data); + +private: + required_device m_maincpu; + required_device m_vdp; + required_device m_oki; + required_device m_screen; + required_device m_palette; + bitmap_ind8 m_custom_priority_bitmap; +}; + + +void snowbro2_state::video_start() +{ + m_screen->register_screen_bitmap(m_custom_priority_bitmap); + m_vdp->custom_priority_bitmap = &m_custom_priority_bitmap; +} + +u32 snowbro2_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + bitmap.fill(0, cliprect); + m_custom_priority_bitmap.fill(0, cliprect); + m_vdp->render_vdp(bitmap, cliprect); + return 0; +} + +void snowbro2_state::screen_vblank(int state) +{ + if (state) // rising edge + { + m_vdp->screen_eof(); + } +} + +void snowbro2_state::sb2_oki_bankswitch_w(u8 data) +{ + m_oki->set_rom_bank(data & 1); +} + +static INPUT_PORTS_START( base ) + PORT_START("IN1") + TOAPLAN_JOY_UDLR_2_BUTTONS( 1 ) + + PORT_START("IN2") + TOAPLAN_JOY_UDLR_2_BUTTONS( 2 ) + + PORT_START("SYS") + PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_SERVICE1 ) + PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_TILT ) + TOAPLAN_TEST_SWITCH( 0x04, IP_ACTIVE_HIGH ) + PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_COIN1 ) + PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_COIN2 ) + PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_START1 ) + PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_START2 ) + PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_UNKNOWN ) + + PORT_START("DSWA") + TOAPLAN_MACHINE_NO_COCKTAIL_LOC(SW1) + // Coinage on bit mask 0x00f0 + PORT_BIT( 0x00f0, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // Modified below + + PORT_START("DSWB") + TOAPLAN_DIFFICULTY_LOC(SW2) + // Per-game features on bit mask 0x00fc + PORT_BIT( 0x00fc, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // Modified below +INPUT_PORTS_END + +static INPUT_PORTS_START( snowbro2 ) + PORT_INCLUDE( base ) + + PORT_START("IN3") + PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(3) PORT_8WAY + PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(3) PORT_8WAY + PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(3) PORT_8WAY + PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(3) PORT_8WAY + PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(3) + PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(3) + PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_START3 ) + PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_UNKNOWN ) + + PORT_START("IN4") + PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(4) PORT_8WAY + PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(4) PORT_8WAY + PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(4) PORT_8WAY + PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(4) PORT_8WAY + PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(4) + PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(4) + PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_START4 ) + PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_UNKNOWN ) + + PORT_MODIFY("DSWA") + PORT_DIPNAME( 0x0001, 0x0000, DEF_STR( Continue_Price ) ) PORT_DIPLOCATION("SW1:!1") + PORT_DIPSETTING( 0x0000, DEF_STR( Normal ) ) + PORT_DIPSETTING( 0x0001, "Discount" ) + // Various features on bit mask 0x000e - see above + TOAPLAN_COINAGE_DUAL_LOC( JMPR, 0x1c00, 0x0800, SW1 ) + + PORT_MODIFY("DSWB") + // Difficulty on bit mask 0x0003 - see above + PORT_DIPNAME( 0x000c, 0x0000, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW2:!3,!4") + PORT_DIPSETTING( 0x000c, DEF_STR( None ) ) + PORT_DIPSETTING( 0x0008, "200k only" ) + PORT_DIPSETTING( 0x0000, "100k only" ) + PORT_DIPSETTING( 0x0004, "100k and every 500k" ) + PORT_DIPNAME( 0x0030, 0x0000, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:!5,!6") + PORT_DIPSETTING( 0x0030, "1" ) + PORT_DIPSETTING( 0x0020, "2" ) + PORT_DIPSETTING( 0x0000, "3" ) + PORT_DIPSETTING( 0x0010, "4" ) + PORT_DIPNAME( 0x0040, 0x0000, "Invulnerability (Cheat)" ) PORT_DIPLOCATION("SW2:!7") + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0040, DEF_STR( On ) ) + PORT_DIPNAME( 0x0080, 0x0000, "Maximum Players" ) PORT_DIPLOCATION("SW2:!8") + PORT_DIPSETTING( 0x0080, "2" ) + PORT_DIPSETTING( 0x0000, "4" ) + + PORT_START("JMPR") + PORT_CONFNAME( 0x2000, 0x0000, "Show All Rights Reserved" ) //PORT_CONFLOCATION("JP:!1") + PORT_CONFSETTING( 0x0000, DEF_STR( No ) ) + PORT_CONFSETTING( 0x2000, DEF_STR( Yes ) ) + PORT_CONFNAME( 0x1c00, 0x0800, DEF_STR( Region ) ) //PORT_CONFLOCATION("JP:!4,!3,!2") + PORT_CONFSETTING( 0x0800, DEF_STR( Europe ) ) + PORT_CONFSETTING( 0x0400, DEF_STR( USA ) ) + PORT_CONFSETTING( 0x0000, DEF_STR( Japan ) ) + PORT_CONFSETTING( 0x0c00, DEF_STR( Korea ) ) + PORT_CONFSETTING( 0x1000, DEF_STR( Hong_Kong ) ) + PORT_CONFSETTING( 0x1400, DEF_STR( Taiwan ) ) + PORT_CONFSETTING( 0x1800, DEF_STR( Southeast_Asia ) ) +// PORT_CONFSETTING( 0x1c00, DEF_STR( Unused ) ) + PORT_BIT( 0xc3ff, IP_ACTIVE_HIGH, IPT_UNKNOWN ) +INPUT_PORTS_END + +static INPUT_PORTS_START( snowbro2b3 ) + PORT_START("IN1") + PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(1) PORT_8WAY + PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1) PORT_8WAY + PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1) PORT_8WAY + PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1) PORT_8WAY + PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(1) + PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(1) + PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_UNKNOWN ) + PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_UNKNOWN ) + PORT_BIT( 0xff00, IP_ACTIVE_HIGH, IPT_UNKNOWN ) + + PORT_START("IN2") + PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(2) PORT_8WAY + PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2) PORT_8WAY + PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2) PORT_8WAY + PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2) PORT_8WAY + PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2) + PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(2) + PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_UNKNOWN ) + PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_UNKNOWN ) + PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_SERVICE1 ) + PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_TILT ) + TOAPLAN_TEST_SWITCH( 0x0400, IP_ACTIVE_HIGH ) + PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_COIN1 ) + PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_COIN2 ) + PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_START1 ) + PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_START2 ) + PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_UNKNOWN ) + + PORT_START("IN3") + PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(3) PORT_8WAY + PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(3) PORT_8WAY + PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(3) PORT_8WAY + PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(3) PORT_8WAY + PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(3) + PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(3) + PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_START3 ) + PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_UNKNOWN ) + PORT_BIT( 0xff00, IP_ACTIVE_HIGH, IPT_UNKNOWN ) + + PORT_START("IN4") + PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(4) PORT_8WAY + PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(4) PORT_8WAY + PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(4) PORT_8WAY + PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(4) PORT_8WAY + PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(4) + PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(4) + PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_START4 ) + PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_UNKNOWN ) + PORT_BIT( 0xff00, IP_ACTIVE_HIGH, IPT_UNKNOWN ) + + PORT_START("DSWA") + PORT_DIPNAME( 0x01, 0x00, DEF_STR( Continue_Price ) ) PORT_DIPLOCATION("SW1:!1") + PORT_DIPSETTING( 0x00, DEF_STR( Normal ) ) + PORT_DIPSETTING( 0x01, "Discount" ) + PORT_DIPNAME( 0x02, 0x00, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW1:!2") + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x02, DEF_STR( On ) ) + PORT_SERVICE_DIPLOC( 0x04, IP_ACTIVE_HIGH, "SW1:!3" ) + PORT_DIPNAME( 0x08, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:!4") + PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x30, 0x00, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:!5,!6") + PORT_DIPSETTING( 0x30, DEF_STR( 4C_1C ) ) + PORT_DIPSETTING( 0x20, DEF_STR( 3C_1C ) ) + PORT_DIPSETTING( 0x10, DEF_STR( 2C_1C ) ) + PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) + PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW1:!7,!8") + PORT_DIPSETTING( 0x00, DEF_STR( 1C_2C ) ) + PORT_DIPSETTING( 0x40, DEF_STR( 1C_3C ) ) + PORT_DIPSETTING( 0x80, DEF_STR( 1C_4C ) ) + PORT_DIPSETTING( 0xc0, DEF_STR( 1C_6C ) ) + + PORT_START("DSWB") + PORT_DIPNAME( 0x03, 0x00, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:!1,!2") + PORT_DIPSETTING( 0x01, DEF_STR( Easy ) ) + PORT_DIPSETTING( 0x00, DEF_STR( Normal ) ) + PORT_DIPSETTING( 0x02, DEF_STR( Hard ) ) + PORT_DIPSETTING( 0x03, DEF_STR( Very_Hard ) ) + PORT_DIPNAME( 0x000c, 0x0000, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW2:!3,!4") + PORT_DIPSETTING( 0x000c, DEF_STR( None ) ) + PORT_DIPSETTING( 0x0008, "200k only" ) + PORT_DIPSETTING( 0x0000, "100k only" ) + PORT_DIPSETTING( 0x0004, "100k and every 500k" ) + PORT_DIPNAME( 0x0030, 0x0000, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:!5,!6") + PORT_DIPSETTING( 0x0030, "1" ) + PORT_DIPSETTING( 0x0020, "2" ) + PORT_DIPSETTING( 0x0000, "3" ) + PORT_DIPSETTING( 0x0010, "4" ) + PORT_DIPNAME( 0x0040, 0x0000, "Invulnerability (Cheat)" ) PORT_DIPLOCATION("SW2:!7") + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0040, DEF_STR( On ) ) + PORT_DIPNAME( 0x0080, 0x0000, "Maximum Players" ) PORT_DIPLOCATION("SW2:!8") + PORT_DIPSETTING( 0x0080, "2" ) + PORT_DIPSETTING( 0x0000, "4" ) +INPUT_PORTS_END + +void snowbro2_state::snowbro2_68k_mem(address_map &map) +{ + map(0x000000, 0x07ffff).rom(); + map(0x100000, 0x10ffff).ram(); + map(0x300000, 0x30000d).rw(m_vdp, FUNC(gp9001vdp_device::read), FUNC(gp9001vdp_device::write)); + map(0x400000, 0x400fff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); + map(0x500000, 0x500003).rw("ymsnd", FUNC(ym2151_device::read), FUNC(ym2151_device::write)).umask16(0x00ff); + map(0x600001, 0x600001).rw(m_oki, FUNC(okim6295_device::read), FUNC(okim6295_device::write)); + map(0x700000, 0x700001).portr("JMPR"); + map(0x700004, 0x700005).portr("DSWA"); + map(0x700008, 0x700009).portr("DSWB"); + map(0x70000c, 0x70000d).portr("IN1"); + map(0x700010, 0x700011).portr("IN2"); + map(0x700014, 0x700015).portr("IN3"); + map(0x700018, 0x700019).portr("IN4"); + map(0x70001c, 0x70001d).portr("SYS"); + map(0x700031, 0x700031).w(FUNC(snowbro2_state::sb2_oki_bankswitch_w)); + map(0x700035, 0x700035).w("coincounter", FUNC(toaplan_coincounter_device::coin_w)); +} + +void snowbro2_state::snowbro2b3_68k_mem(address_map &map) +{ + map(0x000000, 0x07ffff).rom(); + map(0x100000, 0x10ffff).ram(); + map(0x404000, 0x404fff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); + map(0x500000, 0x500003).rw("ymsnd", FUNC(ym2151_device::read), FUNC(ym2151_device::write)).umask16(0x00ff); + map(0x600001, 0x600001).rw(m_oki, FUNC(okim6295_device::read), FUNC(okim6295_device::write)); + map(0x700004, 0x700005).portr("DSWA"); + map(0x700008, 0x700009).portr("DSWB"); + map(0x70000c, 0x70000d).portr("IN1"); + map(0x700010, 0x700011).portr("IN2"); + map(0x700014, 0x700015).portr("IN3"); + map(0x700018, 0x700019).portr("IN4"); + map(0x700035, 0x700035).w("coincounter", FUNC(toaplan_coincounter_device::coin_w)); + map(0x700041, 0x700041).w(FUNC(snowbro2_state::sb2_oki_bankswitch_w)); + map(0xff0000, 0xff2fff).rw(m_vdp, FUNC(gp9001vdp_device::bootleg_videoram16_r), FUNC(gp9001vdp_device::bootleg_videoram16_w)); + map(0xff3000, 0xff37ff).rw(m_vdp, FUNC(gp9001vdp_device::bootleg_spriteram16_r), FUNC(gp9001vdp_device::bootleg_spriteram16_w)); + map(0xff8000, 0xff800f).w(m_vdp, FUNC(gp9001vdp_device::bootleg_scroll_w)); +} + +void snowbro2_state::snowbro2(machine_config &config) +{ + /* basic machine hardware */ + M68000(config, m_maincpu, 32_MHz_XTAL/2); + m_maincpu->set_addrmap(AS_PROGRAM, &snowbro2_state::snowbro2_68k_mem); + + TOAPLAN_COINCOUNTER(config, "coincounter", 0); + + /* video hardware */ + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_video_attributes(VIDEO_UPDATE_BEFORE_VBLANK); + m_screen->set_raw(27_MHz_XTAL/4, 432, 0, 320, 262, 0, 240); + m_screen->set_screen_update(FUNC(snowbro2_state::screen_update)); + m_screen->screen_vblank().set(FUNC(snowbro2_state::screen_vblank)); + m_screen->set_palette(m_palette); + + PALETTE(config, m_palette).set_format(palette_device::xBGR_555, gp9001vdp_device::VDP_PALETTE_LENGTH); + + GP9001_VDP(config, m_vdp, 27_MHz_XTAL); + m_vdp->set_palette(m_palette); + m_vdp->vint_out_cb().set_inputline(m_maincpu, M68K_IRQ_4); + + /* sound hardware */ + SPEAKER(config, "mono").front_center(); + + YM2151(config, "ymsnd", 27_MHz_XTAL/8).add_route(ALL_OUTPUTS, "mono", 0.5); + + OKIM6295(config, m_oki, 16_MHz_XTAL/4, okim6295_device::PIN7_LOW); + m_oki->add_route(ALL_OUTPUTS, "mono", 0.5); +} + +void snowbro2_state::snowbro2b3(machine_config &config) +{ + snowbro2(config); + + m_maincpu->set_addrmap(AS_PROGRAM, &snowbro2_state::snowbro2b3_68k_mem); + m_maincpu->set_vblank_int("screen", FUNC(snowbro2_state::irq2_line_hold)); + + m_vdp->vint_out_cb().set_nop(); + m_vdp->set_bootleg_extra_offsets(0x02e, 0x1f0, 0x02e, 0x1ee, 0x02e, 0x1ef, 0x1e9, 0x1ef); +} + + +ROM_START( snowbro2 ) + ROM_REGION( 0x080000, "maincpu", 0 ) /* Main 68K code */ + ROM_LOAD16_WORD_SWAP( "pro-4", 0x000000, 0x080000, CRC(4c7ee341) SHA1(ad46c605a38565d0148daac301be4e4b72302fe7) ) + + ROM_REGION( 0x300000, "gp9001", 0 ) + ROM_LOAD( "rom2-l", 0x000000, 0x100000, CRC(e9d366a9) SHA1(e87e3966fce3395324b90db6c134b3345104c04b) ) + ROM_LOAD( "rom2-h", 0x100000, 0x080000, CRC(9aab7a62) SHA1(611f6a15fdbac5d3063426a365538c1482e996bf) ) + ROM_LOAD( "rom3-l", 0x180000, 0x100000, CRC(eb06e332) SHA1(7cd597bfffc153d178530c0f0903bebd751c9dd1) ) + ROM_LOAD( "rom3-h", 0x280000, 0x080000, CRC(df4a952a) SHA1(b76af61c8437caca573ff1312832898666a611aa) ) + + ROM_REGION( 0x80000, "oki", 0 ) /* ADPCM Samples */ + ROM_LOAD( "rom4", 0x00000, 0x80000, CRC(638f341e) SHA1(aa3fca25f099339ece1878ea730c5e9f18ec4823) ) +ROM_END + +ROM_START( snowbro2b ) // seems to be the same data as the main set, but with the extra user1 rom and different rom layout + ROM_REGION( 0x080000, "maincpu", 0 ) /* Main 68K code - difference with main set is year changed from 1994 to 1998 and upper FFFF fill changed to 00FF fill */ + ROM_LOAD16_BYTE( "sb2-prg1.u39", 0x000000, 0x040000, CRC(e1fec8a2) SHA1(30c1a351070d784da9ba0dca68be8a262dba2045) ) + ROM_LOAD16_BYTE( "sb2-prg0.u23", 0x000001, 0x040000, CRC(b473cd57) SHA1(331130faa9de01b3ca93845174e8c3684bd269c7) ) + + ROM_REGION( 0x400000, "gp9001", 0 ) + ROM_LOAD( "sb2-gfx.u177", 0x000000, 0x200000, CRC(ebeec910) SHA1(e179f393b98135caa8419b68cd979038ab47a413) ) + ROM_LOAD( "sb2-gfx.u175", 0x200000, 0x200000, CRC(e349c75b) SHA1(7d40d00fc0e15a68c427fe94db410bb7cbe00117) ) + + ROM_REGION( 0x80000, "oki", 0 ) /* ADPCM Samples */ + ROM_LOAD( "sb2-snd-4.u17", 0x00000, 0x80000, CRC(638f341e) SHA1(aa3fca25f099339ece1878ea730c5e9f18ec4823) ) + + ROM_REGION( 0x8000, "user1", 0 ) /* ??? Some sort of table - same as other bootleg boards */ + ROM_LOAD( "sb2-unk.u100", 0x0000, 0x8000, CRC(456dd16e) SHA1(84779ee64d3ea33ba1ba4dee39b504a81c6811a1) ) +ROM_END + +ROM_START( snowbro2b2 ) // seems to mostly be the same data, but with copyright changed to Q Elec. Only set with staff credits still present. Also differently arranged graphics ROMs data. + ROM_REGION( 0x080000, "maincpu", 0 ) /* Main 68K code */ + ROM_LOAD16_WORD_SWAP( "rom10.bin", 0x000000, 0x080000, CRC(3e96da41) SHA1(692211d40f506efb9cb49848521de2da7890e248) ) // 27c04002 + + ROM_REGION( 0x300000, "gp9001", 0 ) + ROM_LOAD16_BYTE( "rom07.bin", 0x000000, 0x080000, CRC(c54ae0b3) SHA1(94099b2da52eb12638799eab0819fe8a13aa3879) ) // 27c040 + ROM_LOAD16_BYTE( "rom05.bin", 0x000001, 0x080000, CRC(af3c74d1) SHA1(e97a688db50dfe41723452a9f652564e89e367ed) ) // 27c040 + ROM_LOAD16_BYTE( "rom08.bin", 0x100000, 0x040000, CRC(72812088) SHA1(1c0d410a7dd8de0bc48b7ff677979ad269966f7d) ) // 27c02001 + ROM_LOAD16_BYTE( "rom06.bin", 0x100001, 0x040000, CRC(c8f80774) SHA1(004752d7dfa08c3beb774f545fe3260d328abff0) ) // 27c02001 + ROM_LOAD16_BYTE( "rom03.bin", 0x180000, 0x080000, CRC(42fecbd7) SHA1(96dc9d5495d7830400ca7475c6613119099e93f2) ) // 27c040 + ROM_LOAD16_BYTE( "rom01.bin", 0x180001, 0x080000, CRC(e7134937) SHA1(7c12e7c6b08f804613e5ea0db8d622bda01bc036) ) // 27c040 + ROM_LOAD16_BYTE( "rom04.bin", 0x280000, 0x040000, CRC(3343b7a7) SHA1(10efcb2dfae635f005773655faa573bf51ddc6a3) ) // 27c020 + ROM_LOAD16_BYTE( "rom02.bin", 0x280001, 0x040000, CRC(af4d9551) SHA1(adcf1641e37b239b1ae4322b5710d49e53c30684) ) // 27c020 + + ROM_REGION( 0x80000, "oki", 0 ) /* ADPCM Samples */ + ROM_LOAD( "rom09.bin", 0x00000, 0x80000, CRC(638f341e) SHA1(aa3fca25f099339ece1878ea730c5e9f18ec4823) ) +ROM_END + +ROM_START( snowbro2b3 ) // SK000616 PCB, no original parts, seems hardcoded on Europe region + ROM_REGION( 0x080000, "maincpu", 0 ) + ROM_LOAD16_WORD_SWAP( "prg", 0x000000, 0x080000, CRC(8ce2ede2) SHA1(ddd8a2aa442cd5bb3a7d393b9b5c06fd981e7c61) ) + + ROM_REGION( 0x400000, "gp9001", 0 ) // not actually a GP9001 + ROM_LOAD( "gfx2", 0x100000, 0x100000, CRC(a3be41af) SHA1(4cb1ce9c47bf8bbf7d1e36f6a1d276ce52957cfb) ) + ROM_CONTINUE( 0x000000, 0x100000 ) + ROM_LOAD( "gfx1", 0x300000, 0x100000, CRC(8df1ab06) SHA1(2a28caf7d545dc05acfcd2a8d2ffbd9f710af45d) ) + ROM_CONTINUE( 0x200000, 0x100000 ) + + ROM_REGION( 0x80000, "oki", 0 ) + ROM_LOAD( "voice", 0x00000, 0x80000, CRC(638f341e) SHA1(aa3fca25f099339ece1878ea730c5e9f18ec4823) ) +ROM_END + +ROM_START( snowbro2ny ) // Nyanko + ROM_REGION( 0x080000, "maincpu", 0 ) /* Main 68K code */ + ROM_LOAD16_WORD_SWAP( "rom1_c8.u61", 0x000000, 0x080000, CRC(9e6eb76b) SHA1(9e8b356dabedeb4ae9e08d60fbf6ed4a09edc0bd) ) + + ROM_REGION( 0x300000, "gp9001", 0 ) + ROM_LOAD( "rom2-l_tp-033.u13", 0x000000, 0x100000, CRC(e9d366a9) SHA1(e87e3966fce3395324b90db6c134b3345104c04b) ) + ROM_LOAD( "rom2-h_c10.u26", 0x100000, 0x080000, CRC(9aab7a62) SHA1(611f6a15fdbac5d3063426a365538c1482e996bf) ) + ROM_LOAD( "rom3-l_tp-033.u12", 0x180000, 0x100000, CRC(eb06e332) SHA1(7cd597bfffc153d178530c0f0903bebd751c9dd1) ) + ROM_LOAD( "rom3-h_c9.u27", 0x280000, 0x080000, CRC(6de2b059) SHA1(695e789849c34de5d83e40b0e834b2106fcd78db) ) + + ROM_REGION( 0x80000, "oki", 0 ) /* ADPCM Samples */ + ROM_LOAD( "rom4-tp-033.u33", 0x00000, 0x80000, CRC(638f341e) SHA1(aa3fca25f099339ece1878ea730c5e9f18ec4823) ) + + ROM_REGION( 0x345, "plds", 0 ) + ROM_LOAD( "13_gal16v8-25lnc.u91", 0x000, 0x117, NO_DUMP ) // Protected + ROM_LOAD( "14_gal16v8-25lnc.u92", 0x117, 0x117, NO_DUMP ) // Protected + ROM_LOAD( "15_gal16v8-25lnc.u93", 0x22e, 0x117, NO_DUMP ) // Protected +ROM_END + +} // anonymous namespace + +GAME( 1994, snowbro2, 0, snowbro2, snowbro2, snowbro2_state, empty_init, ROT0, "Hanafram", "Snow Bros. 2 - With New Elves / Otenki Paradise (Hanafram)", MACHINE_SUPPORTS_SAVE ) +GAME( 1994, snowbro2ny, snowbro2, snowbro2, snowbro2, snowbro2_state, empty_init, ROT0, "Nyanko", "Snow Bros. 2 - With New Elves / Otenki Paradise (Nyanko)", MACHINE_SUPPORTS_SAVE ) // not a bootleg, has original parts (the "GP9001 L7A0498 TOA PLAN" IC and the three mask ROMs) +GAME( 1998, snowbro2b, snowbro2, snowbro2, snowbro2, snowbro2_state, empty_init, ROT0, "bootleg", "Snow Bros. 2 - With New Elves / Otenki Paradise (bootleg, set 1)", MACHINE_SUPPORTS_SAVE ) +GAME( 1994, snowbro2b2, snowbro2, snowbro2, snowbro2, snowbro2_state, empty_init, ROT0, "bootleg (Q Elec)", "Snow Bros. 2 - With New Elves / Otenki Paradise (bootleg, set 2)", MACHINE_SUPPORTS_SAVE ) // possibly not a bootleg, has some original parts +GAME( 1994, snowbro2b3, snowbro2, snowbro2b3, snowbro2b3, snowbro2_state, empty_init, ROT0, "bootleg", "Snow Bros. 2 - With New Elves / Otenki Paradise (bootleg, set 3)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) // GFX offsets not 100% correct diff --git a/src/mame/toaplan/sunwise.cpp b/src/mame/toaplan/sunwise.cpp new file mode 100644 index 00000000000..9bc18ebc81b --- /dev/null +++ b/src/mame/toaplan/sunwise.cpp @@ -0,0 +1,591 @@ +// license:BSD-3-Clause +// copyright-holders:Quench, Yochizo, David Haywood + +#include "emu.h" + +#include "gp9001.h" +#include "toaplan_coincounter.h" +#include "toaplipt.h" + +#include "cpu/m68000/m68000.h" +#include "machine/nvram.h" +#include "machine/ticket.h" +#include "machine/upd4992.h" +#include "sound/okim6295.h" + +#include "emupal.h" +#include "screen.h" +#include "speaker.h" +#include "tilemap.h" + +/***************************************************************************** + +Name Board No Maker Game name +---------------------------------------------------------------------------- +pwrkick SW931201 Sunwise Power Kick +burgkids SW931201 Sunwise Burger Kids +othldrby S951060-VGP Sunwise Othello Derby + + +Notes on Power Kick coin inputs: +- The 10 yen input is "Key In" according to the bookkeeping screen, but is + an otherwise normal coin input with a counter and a lockout (sharing the + latter with the "medal" coin). +- The 100 yen input never adds any credits except in "Coin Function Check," + instead dispensing its value into the hopper immediately. + +To reset the NVRAM in Othello Derby, hold P1 Button 1 down while booting. + +*****************************************************************************/ + +namespace { + +class sunwise_state : public driver_device +{ +public: + sunwise_state(const machine_config &mconfig, device_type type, const char *tag) + : driver_device(mconfig, type, tag) + , m_rtc(*this, "rtc") + , m_hopper(*this, "hopper") + , m_maincpu(*this, "maincpu") + , m_vdp(*this, "gp9001") + , m_oki(*this, "oki") + , m_screen(*this, "screen") + , m_palette(*this, "palette") + { } + + void othldrby(machine_config &config); + void pwrkick(machine_config &config); + +protected: + virtual void video_start() override ATTR_COLD; + + void common_mem(address_map &map) ATTR_COLD; + void pwrkick_68k_mem(address_map &map) ATTR_COLD; + void othldrby_68k_mem(address_map &map) ATTR_COLD; + + u32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + void screen_vblank(int state); + + void sw_oki_bankswitch_w(u8 data); + +private: + void pwrkick_coin_w(u8 data); + void pwrkick_coin_lockout_w(u8 data); + + required_device m_rtc; + optional_device m_hopper; // pwrkick only + + required_device m_maincpu; + required_device m_vdp; + required_device m_oki; + required_device m_screen; + required_device m_palette; + bitmap_ind8 m_custom_priority_bitmap; +}; + +void sunwise_state::video_start() +{ + m_screen->register_screen_bitmap(m_custom_priority_bitmap); + m_vdp->custom_priority_bitmap = &m_custom_priority_bitmap; +} + + +u32 sunwise_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + bitmap.fill(0, cliprect); + m_custom_priority_bitmap.fill(0, cliprect); + m_vdp->render_vdp(bitmap, cliprect); + return 0; +} + +void sunwise_state::screen_vblank(int state) +{ + if (state) // rising edge + { + m_vdp->screen_eof(); + } +} + +void sunwise_state::sw_oki_bankswitch_w(u8 data) +{ + m_oki->set_rom_bank(data & 1); +} + + + +static INPUT_PORTS_START( pwrkick ) + PORT_START("DSWA") + PORT_DIPNAME( 0x03, 0x00, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:!1,!2") + PORT_DIPSETTING( 0x00, DEF_STR( Easy ) ) + PORT_DIPSETTING( 0x01, DEF_STR( Normal ) ) + PORT_DIPSETTING( 0x02, DEF_STR( Hard ) ) + PORT_DIPSETTING( 0x03, DEF_STR( Very_Hard ) ) + PORT_DIPNAME( 0x5c, 0x00, "Payout" ) PORT_DIPLOCATION("SW1:!3,!4,!5,!7") + PORT_DIPSETTING( 0x00, "110" ) // Service mode displays values as 1-8, ignoring SW1:7 + PORT_DIPSETTING( 0x04, "105" ) + PORT_DIPSETTING( 0x08, "100" ) + PORT_DIPSETTING( 0x0c, "95" ) + PORT_DIPSETTING( 0x10, "90" ) + PORT_DIPSETTING( 0x14, "85" ) + PORT_DIPSETTING( 0x18, "80" ) + PORT_DIPSETTING( 0x1c, "75" ) + PORT_DIPSETTING( 0x40, "70" ) + PORT_DIPSETTING( 0x44, "65" ) + PORT_DIPSETTING( 0x48, "60" ) + PORT_DIPSETTING( 0x4c, "55" ) + PORT_DIPSETTING( 0x50, "50" ) + PORT_DIPSETTING( 0x54, "45" ) + PORT_DIPSETTING( 0x58, "40" ) + PORT_DIPSETTING( 0x5c, "35" ) + PORT_DIPNAME( 0x20, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:!6") + PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x80, 0x00, "Diagnostic" ) PORT_DIPLOCATION("SW1:!8") + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x80, DEF_STR( On ) ) + + PORT_START("DSWB") + PORT_DIPNAME( 0x03, 0x00, "Play Credit" ) PORT_DIPLOCATION("SW2:!1,!2") + PORT_DIPSETTING( 0x00, u8"¥10" ) + PORT_DIPSETTING( 0x01, u8"¥20" ) + PORT_DIPSETTING( 0x02, u8"¥30" ) + PORT_DIPSETTING( 0x03, u8"¥40" ) + PORT_DIPNAME( 0x0c, 0x00, "Coin Exchange" ) PORT_DIPLOCATION("SW2:!3,!4") + PORT_DIPSETTING( 0x00, "12" ) + PORT_DIPSETTING( 0x04, "10" ) + PORT_DIPSETTING( 0x08, "6" ) + PORT_DIPSETTING( 0x0c, "5" ) + PORT_DIPNAME( 0x30, 0x00, "Game Mode" ) PORT_DIPLOCATION("SW2:!5,!6") + PORT_DIPSETTING( 0x00, DEF_STR( Normal ) ) + PORT_DIPSETTING( 0x10, "Shot" ) + PORT_DIPSETTING( 0x20, "Auto" ) + PORT_DIPSETTING( 0x30, "S-Manual" ) + PORT_DIPUNUSED_DIPLOC( 0x40, 0x00, "SW2:!7" ) + PORT_DIPUNUSED_DIPLOC( 0x80, 0x00, "SW2:!8" ) + + PORT_START("DSWC") + PORT_DIPUNUSED_DIPLOC( 0x01, 0x00, "SW3:!1" ) + PORT_DIPUNUSED_DIPLOC( 0x02, 0x00, "SW3:!2" ) + PORT_DIPUNUSED_DIPLOC( 0x04, 0x00, "SW3:!3" ) + PORT_DIPUNUSED_DIPLOC( 0x08, 0x00, "SW3:!4" ) + PORT_DIPUNUSED_DIPLOC( 0x10, 0x00, "SW3:!5" ) + PORT_DIPUNUSED_DIPLOC( 0x20, 0x00, "SW3:!6" ) + PORT_DIPUNUSED_DIPLOC( 0x40, 0x00, "SW3:!7" ) + PORT_DIPUNUSED_DIPLOC( 0x80, 0x00, "SW3:!8" ) + + PORT_START("IN1") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 ) + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SLOT_STOP1 ) PORT_NAME("Left") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SLOT_STOP2 ) PORT_NAME("Center") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SLOT_STOP3 ) PORT_NAME("Right") + PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED ) + + PORT_START("IN2") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN2 ) PORT_NAME(u8"Coin 2 (¥10)") + PORT_SERVICE_NO_TOGGLE( 0x02, IP_ACTIVE_HIGH ) + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SLOT_STOP4 ) PORT_NAME("Down") // does this button really exist? + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", FUNC(ticket_dispenser_device::line_r)) + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_MEMORY_RESET ) + PORT_BIT( 0xe0, IP_ACTIVE_HIGH, IPT_UNUSED ) + + PORT_START("SYS") + PORT_BIT( 0x03, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_COIN3 ) PORT_NAME(u8"Coin Exchange (¥100)") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_GAMBLE_BOOK ) + PORT_BIT( 0x30, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_GAMBLE_SERVICE ) PORT_NAME("Attendant Key") + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_NAME("Coin 1 (Medal)") + + // The specific "Payout" button shown on the test screen and diagnostic menu does not exist. +INPUT_PORTS_END + +static INPUT_PORTS_START( burgkids ) + PORT_START("DSWA") + PORT_DIPNAME( 0x03, 0x00, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:!1,!2") + PORT_DIPSETTING( 0x00, DEF_STR( Easy ) ) + PORT_DIPSETTING( 0x01, DEF_STR( Normal ) ) + PORT_DIPSETTING( 0x02, DEF_STR( Hard ) ) + PORT_DIPSETTING( 0x03, DEF_STR( Very_Hard ) ) + PORT_DIPNAME( 0x5c, 0x00, "Payout" ) PORT_DIPLOCATION("SW1:!3,!4,!5,!7") + PORT_DIPSETTING( 0x00, "110" ) // Service mode displays values as 1-8, ignoring SW1:7 + PORT_DIPSETTING( 0x04, "105" ) + PORT_DIPSETTING( 0x08, "100" ) + PORT_DIPSETTING( 0x0c, "95" ) + PORT_DIPSETTING( 0x10, "90" ) + PORT_DIPSETTING( 0x14, "85" ) + PORT_DIPSETTING( 0x18, "80" ) + PORT_DIPSETTING( 0x1c, "75" ) + PORT_DIPSETTING( 0x40, "70" ) + PORT_DIPSETTING( 0x44, "65" ) + PORT_DIPSETTING( 0x48, "60" ) + PORT_DIPSETTING( 0x4c, "55" ) + PORT_DIPSETTING( 0x50, "50" ) + PORT_DIPSETTING( 0x54, "45" ) + PORT_DIPSETTING( 0x58, "40" ) + PORT_DIPSETTING( 0x5c, "35" ) + PORT_DIPNAME( 0x20, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:!6") + PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPUNUSED_DIPLOC( 0x80, 0x00, "SW2:!8" ) + + PORT_START("DSWB") + PORT_DIPNAME( 0x03, 0x00, "Play Credit" ) PORT_DIPLOCATION("SW2:!1,!2") + PORT_DIPSETTING( 0x00, u8"¥10" ) + PORT_DIPSETTING( 0x01, u8"¥20" ) + PORT_DIPSETTING( 0x02, u8"¥30" ) + PORT_DIPSETTING( 0x03, u8"¥40" ) + PORT_DIPNAME( 0x1c, 0x00, "Coin Exchange" ) PORT_DIPLOCATION("SW2:!3,!4,!5") + PORT_DIPSETTING( 0x00, "12" ) + PORT_DIPSETTING( 0x04, "11" ) + PORT_DIPSETTING( 0x08, "10" ) + PORT_DIPSETTING( 0x0c, "6" ) + PORT_DIPSETTING( 0x10, "5" ) + PORT_DIPSETTING( 0x14, "4" ) + PORT_DIPSETTING( 0x18, "3" ) + PORT_DIPSETTING( 0x1c, DEF_STR ( Off ) ) + PORT_DIPUNUSED_DIPLOC( 0x20, 0x00, "SW2:!6" ) + PORT_DIPUNUSED_DIPLOC( 0x40, 0x00, "SW2:!7" ) + PORT_DIPUNUSED_DIPLOC( 0x80, 0x00, "SW2:!8" ) + + PORT_START("DSWC") + PORT_DIPUNUSED_DIPLOC( 0x01, 0x00, "SW3:!1" ) + PORT_DIPUNUSED_DIPLOC( 0x02, 0x00, "SW3:!2" ) + PORT_DIPUNUSED_DIPLOC( 0x04, 0x00, "SW3:!3" ) + PORT_DIPUNUSED_DIPLOC( 0x08, 0x00, "SW3:!4" ) + PORT_DIPUNUSED_DIPLOC( 0x10, 0x00, "SW3:!5" ) + PORT_DIPUNUSED_DIPLOC( 0x20, 0x00, "SW3:!6" ) + PORT_DIPUNUSED_DIPLOC( 0x40, 0x00, "SW3:!7" ) + PORT_DIPUNUSED_DIPLOC( 0x80, 0x00, "SW3:!8" ) + + PORT_START("IN1") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 ) + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SLOT_STOP1 ) PORT_NAME("1") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SLOT_STOP2 ) PORT_NAME("2") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SLOT_STOP3 ) PORT_NAME("3") + PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED ) + + PORT_START("IN2") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN2 ) PORT_NAME(u8"Coin 2 (¥10)") + PORT_SERVICE_NO_TOGGLE( 0x02, IP_ACTIVE_HIGH ) + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SLOT_STOP4 ) PORT_NAME("Down") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", FUNC(ticket_dispenser_device::line_r)) + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_MEMORY_RESET ) + PORT_BIT( 0xe0, IP_ACTIVE_HIGH, IPT_UNUSED ) + + PORT_START("SYS") + PORT_BIT( 0x03, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_COIN3 ) PORT_NAME(u8"Coin Exchange (¥100)") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_GAMBLE_BOOK ) + PORT_BIT( 0x30, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_GAMBLE_SERVICE ) PORT_NAME("Attendant Key") + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_NAME("Coin 1 (Medal)") +INPUT_PORTS_END + + +static INPUT_PORTS_START( 2b ) + PORT_START("IN1") + TOAPLAN_JOY_UDLR_2_BUTTONS( 1 ) + + PORT_START("IN2") + TOAPLAN_JOY_UDLR_2_BUTTONS( 2 ) + + PORT_START("SYS") + PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_SERVICE1 ) + PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_TILT ) + TOAPLAN_TEST_SWITCH( 0x04, IP_ACTIVE_HIGH ) + PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_COIN1 ) + PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_COIN2 ) + PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_START1 ) + PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_START2 ) + PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_UNKNOWN ) + + PORT_START("DSWA") + TOAPLAN_MACHINE_NO_COCKTAIL_LOC(SW1) + // Coinage on bit mask 0x00f0 + PORT_BIT( 0x00f0, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // Modified below + + PORT_START("DSWB") + TOAPLAN_DIFFICULTY_LOC(SW2) + // Per-game features on bit mask 0x00fc + PORT_BIT( 0x00fc, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // Modified below +INPUT_PORTS_END + + +static INPUT_PORTS_START( base ) + PORT_INCLUDE( 2b ) + + PORT_MODIFY("IN1") + TOAPLAN_JOY_UDLR_3_BUTTONS( 1 ) + + PORT_MODIFY("IN2") + TOAPLAN_JOY_UDLR_3_BUTTONS( 2 ) +INPUT_PORTS_END + + +static INPUT_PORTS_START( othldrby ) + PORT_INCLUDE( base ) + + PORT_MODIFY("SYS") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_IMPULSE(1) + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_COIN2 ) PORT_IMPULSE(1) + + PORT_MODIFY("DSWA") + PORT_DIPNAME( 0x01, 0x00, DEF_STR( Demo_Sounds ) ) + PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x02, 0x00, DEF_STR( Flip_Screen ) ) + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x02, DEF_STR( On ) ) + PORT_SERVICE( 0x04, IP_ACTIVE_HIGH ) + PORT_DIPNAME( 0x08, 0x00, DEF_STR( Allow_Continue ) ) + PORT_DIPSETTING( 0x08, DEF_STR( No ) ) + PORT_DIPSETTING( 0x00, DEF_STR( Yes ) ) + PORT_DIPNAME( 0x30, 0x00, DEF_STR( Coin_A ) ) + PORT_DIPSETTING( 0x30, DEF_STR( 3C_1C ) ) + PORT_DIPSETTING( 0x20, DEF_STR( 2C_1C ) ) + PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) + PORT_DIPSETTING( 0x10, DEF_STR( 1C_2C ) ) + PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Coin_B ) ) + PORT_DIPSETTING( 0xc0, DEF_STR( 3C_1C ) ) + PORT_DIPSETTING( 0x80, DEF_STR( 2C_1C ) ) + PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) + PORT_DIPSETTING( 0x40, DEF_STR( 1C_2C ) ) + + PORT_MODIFY("DSWB") + PORT_DIPNAME( 0x03, 0x00, DEF_STR( Difficulty ) ) + PORT_DIPSETTING( 0x01, DEF_STR( Easy ) ) + PORT_DIPSETTING( 0x00, DEF_STR( Normal ) ) + PORT_DIPSETTING( 0x02, DEF_STR( Hard ) ) + PORT_DIPSETTING( 0x03, DEF_STR( Very_Hard ) ) + PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unused ) ) + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x04, DEF_STR( On ) ) + PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unused ) ) + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x08, DEF_STR( On ) ) + PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unused ) ) + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x10, DEF_STR( On ) ) + PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unused ) ) + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x20, DEF_STR( On ) ) + PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unused ) ) + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x40, DEF_STR( On ) ) + PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unused ) ) + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x80, DEF_STR( On ) ) +INPUT_PORTS_END + + +void sunwise_state::pwrkick_coin_w(u8 data) +{ + machine().bookkeeping().coin_counter_w(0, BIT(data, 1)); // medal + machine().bookkeeping().coin_counter_w(1, BIT(data, 3)); // 10 yen + machine().bookkeeping().coin_counter_w(2, BIT(data, 0)); // 100 yen + m_hopper->motor_w(BIT(data, 7)); +} + +void sunwise_state::pwrkick_coin_lockout_w(u8 data) +{ + machine().bookkeeping().coin_lockout_w(0, BIT(~data, 2)); + machine().bookkeeping().coin_lockout_w(1, BIT(~data, 2)); + machine().bookkeeping().coin_lockout_w(2, BIT(~data, 1)); +} + + +void sunwise_state::common_mem(address_map &map) +{ + map(0x000000, 0x07ffff).rom(); + map(0x100000, 0x103fff).ram().share("nvram"); // Only 10022C-10037B is actually saved as NVRAM + map(0x104000, 0x10ffff).ram(); + + map(0x200000, 0x20000f).rw(m_rtc, FUNC(upd4992_device::read), FUNC(upd4992_device::write)).umask16(0x00ff); + map(0x300000, 0x30000d).rw(m_vdp, FUNC(gp9001vdp_device::read), FUNC(gp9001vdp_device::write)); + map(0x400000, 0x400fff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); + map(0x600001, 0x600001).rw(m_oki, FUNC(okim6295_device::read), FUNC(okim6295_device::write)); + + map(0x700000, 0x700001).r(m_vdp, FUNC(gp9001vdp_device::vdpcount_r)); + map(0x700004, 0x700005).portr("DSWA"); + map(0x700008, 0x700009).portr("DSWB"); + map(0x70001c, 0x70001d).portr("SYS"); + map(0x700031, 0x700031).w(FUNC(sunwise_state::sw_oki_bankswitch_w)); +} + +void sunwise_state::pwrkick_68k_mem(address_map &map) +{ + common_mem(map); + + map(0x70000c, 0x70000d).portr("IN1"); + map(0x700014, 0x700015).portr("IN2"); + map(0x700018, 0x700019).portr("DSWC"); + map(0x700035, 0x700035).w(FUNC(sunwise_state::pwrkick_coin_w)); + map(0x700039, 0x700039).w(FUNC(sunwise_state::pwrkick_coin_lockout_w)); +} + +void sunwise_state::othldrby_68k_mem(address_map &map) +{ + common_mem(map); + + map(0x70000c, 0x70000d).portr("IN1"); + map(0x700010, 0x700011).portr("IN2"); + map(0x700035, 0x700035).w("coincounter", FUNC(toaplan_coincounter_device::coin_w)); +} + + +void sunwise_state::pwrkick(machine_config &config) // Sunwise SW931201-1 PCB (27.000MHz, 20.000MHz & 16.000MHz OSCs) +{ + /* basic machine hardware */ + M68000(config, m_maincpu, 20_MHz_XTAL/2); // verified on PCB + m_maincpu->set_addrmap(AS_PROGRAM, &sunwise_state::pwrkick_68k_mem); + + UPD4992(config, m_rtc, 32.768_kHz_XTAL); + + NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); + + TICKET_DISPENSER(config, m_hopper, attotime::from_msec(50)); // duration is probably wrong + + /* video hardware */ + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_video_attributes(VIDEO_UPDATE_BEFORE_VBLANK); + m_screen->set_raw(27_MHz_XTAL/4, 432, 0, 320, 262, 0, 240); + m_screen->set_screen_update(FUNC(sunwise_state::screen_update)); + m_screen->screen_vblank().set(FUNC(sunwise_state::screen_vblank)); + m_screen->set_palette(m_palette); + + PALETTE(config, m_palette).set_format(palette_device::xBGR_555, gp9001vdp_device::VDP_PALETTE_LENGTH); + + GP9001_VDP(config, m_vdp, 27_MHz_XTAL); + m_vdp->set_palette(m_palette); + m_vdp->vint_out_cb().set_inputline(m_maincpu, M68K_IRQ_4); + + /* sound hardware */ + SPEAKER(config, "mono").front_center(); + // empty YM2151 socket + OKIM6295(config, m_oki, 16_MHz_XTAL/4, okim6295_device::PIN7_LOW); // verified on PCB + m_oki->add_route(ALL_OUTPUTS, "mono", 0.5); +} + +void sunwise_state::othldrby(machine_config &config) // Sunwise S951060-VGP PCB (27.000MHz, 20.000MHz & 16.000MHz OSCs) +{ + /* basic machine hardware */ + M68000(config, m_maincpu, 20_MHz_XTAL/2); // assumed same as pwrkick + m_maincpu->set_addrmap(AS_PROGRAM, &sunwise_state::othldrby_68k_mem); + + TOAPLAN_COINCOUNTER(config, "coincounter", 0); + + UPD4992(config, m_rtc, 32.768_kHz_XTAL); + + NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); + + /* video hardware */ + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_video_attributes(VIDEO_UPDATE_BEFORE_VBLANK); + m_screen->set_raw(27_MHz_XTAL/4, 432, 0, 320, 262, 0, 240); + m_screen->set_screen_update(FUNC(sunwise_state::screen_update)); + m_screen->screen_vblank().set(FUNC(sunwise_state::screen_vblank)); + m_screen->set_palette(m_palette); + + PALETTE(config, m_palette).set_format(palette_device::xBGR_555, gp9001vdp_device::VDP_PALETTE_LENGTH); + + GP9001_VDP(config, m_vdp, 27_MHz_XTAL); + m_vdp->set_palette(m_palette); + m_vdp->vint_out_cb().set_inputline(m_maincpu, M68K_IRQ_4); + + /* sound hardware */ + SPEAKER(config, "mono").front_center(); + + OKIM6295(config, m_oki, 16_MHz_XTAL/4, okim6295_device::PIN7_LOW); // assumed same as pwrkick + m_oki->add_route(ALL_OUTPUTS, "mono", 0.5); +} + + +ROM_START( pwrkick ) // Sunwise SW931201-1 PCB - 8-liner connections + ROM_REGION( 0x80000, "maincpu", ROMREGION_ERASE00 ) + ROM_LOAD16_WORD_SWAP( "1.u61", 0x000000, 0x080000, CRC(118b5899) SHA1(7a1637a63eb17e3892d79aede5730013a1dc00f9) ) + + ROM_REGION( 0x100000, "gp9001", ROMREGION_ERASE00 ) + ROM_LOAD( "2.u26", 0x000000, 0x080000, CRC(a190eaea) SHA1(2c7b8c8026873e0f591fbcbc2e72b196ef84e162) ) + ROM_LOAD( "3.u27", 0x080000, 0x080000, CRC(0b81e038) SHA1(8376617ae519a8ef604f20b26e941aa5b8066602) ) + + ROM_REGION( 0x80000, "oki", ROMREGION_ERASE00 ) + ROM_LOAD( "4.u33", 0x000000, 0x080000, CRC(3ab742f1) SHA1(ce8ca02ca57fd77872e421ce601afd017d3518a0) ) +ROM_END + +/* + +Burger Kids, 1995 Sunwise + +SW931201-1 ++--||||||-----------------------------------------+ +| YM3014* YM2151* | +| TDA1519A M6295 FFK4.U33 BT1 | +| U31* | +| 16.000MHz 32.768kHz D4992C | +| MB3771 | +|8 | +|- U67* | +|L FFK1.U61 62256 | +|I U68* 62256 | +|N GAL16V8B TMP68HC000P-12 | +|E | +|R | +| 1635 27.000MHz FFK3.U27 | +| GAL16V8B 1635 20.000MHz U12* | +| SW1 GAL16V8B +---------+ FFK2.U26 | +| SW2 | L7A0498 | U13* | +| SW3 | GP9001 | 4256 4256 | +| 6216 +---------+ 4256 4256 | +| 6216 4256 4256 | ++-------------------------------------------------+ + +NOTE: This PCB uses an 8-Liner style edge connector + +* Denotes unpopulated components + + CPU: Toshiba TMP68HC000P-12 + Sound: OKI M6295 + Video: L7A0498 GP9001 QFP208 + OSC: 27MHz, 20MHz, 16MHz & 32.768kHz + RAM: MB81C4256A-70P - 256K x 4-bit DRAM + HM62256BLP-9 - 32K x 8-bit SRAM + IMS1635P-25 - 8K x 8-bit SRAM + XRM6216-10 - 2K x 8-bit SRAM + Other: 8 Position Dipswitch x 3 + NEC D4992 CMOS 8-Bit Parallel I/O Calendar Clock + MB3771 Voltage monitor + BT1 - CR2550 3Volt battery + +NOTE: Sunwise's S951060-VGP PCB uses identical componenets to the SW931201 but has a standard JAMMA connector +*/ + +ROM_START( burgkids ) // Sunwise SW931201-1 PCB - 8-liner connections + ROM_REGION( 0x80000, "maincpu", ROMREGION_ERASE00 ) + ROM_LOAD16_WORD_SWAP( "ffk1.u61", 0x000000, 0x080000, CRC(ac96cb0d) SHA1(2ce5c06d61f3ff18b222619e41d09e46d44c5bab) ) + + ROM_REGION( 0x100000, "gp9001", ROMREGION_ERASE00 ) + ROM_LOAD( "ffk2.u26", 0x000000, 0x080000, CRC(09f7b0ae) SHA1(f340f27a601ff89f143398263d822b8f340eea6e) ) + ROM_LOAD( "ffk3.u27", 0x080000, 0x080000, CRC(63c761bc) SHA1(f0ee1dc6aaeacff23e55d072102b814c7ef30550) ) + + ROM_REGION( 0x80000, "oki", ROMREGION_ERASE00 ) + ROM_LOAD( "ffk4.u33", 0x000000, 0x080000, CRC(3b032d4f) SHA1(69056bf205aadf6c9fee56ce396b11a5187caa03) ) +ROM_END + +ROM_START( othldrby ) // Sunwise S951060-VGP PCB - JAMMA compliant (components identical to Sunwise SW931201-1 PCB) + ROM_REGION( 0x080000, "maincpu", 0 ) + ROM_LOAD16_WORD_SWAP( "sunwise_db0_1.u61", 0x00000, 0x80000, CRC(6b4008d3) SHA1(4cf838c47563ba482be8364b2e115569a4a06c83) ) + + ROM_REGION( 0x400000, "gp9001", 0 ) + ROM_LOAD( "db0-r2.u26", 0x000000, 0x200000, CRC(4efff265) SHA1(4cd239ff42f532495946cb52bd1fee412f84e192) ) // mask ROMs + ROM_LOAD( "db0-r3.u27", 0x200000, 0x200000, CRC(5c142b38) SHA1(5466a8b061a0f2545493de0f96fd4387beea276a) ) + + ROM_REGION( 0x080000, "oki", 0 ) /* OKIM6295 samples */ + ROM_LOAD( "sunwise_db0_4.u33", 0x00000, 0x80000, CRC(a9701868) SHA1(9ee89556666d358e8d3915622573b3ba660048b8) ) +ROM_END + +} // anonymous namespace + +GAME( 1994, pwrkick, 0, pwrkick, pwrkick, sunwise_state, empty_init, ROT0, "Sunwise", "Power Kick (Japan)", 0 ) +GAME( 1995, burgkids, 0, pwrkick, burgkids, sunwise_state, empty_init, ROT0, "Sunwise", "Burger Kids (Japan)", 0 ) +GAME( 1995, othldrby, 0, othldrby, othldrby, sunwise_state, empty_init, ROT0, "Sunwise", "Othello Derby (Japan)", 0 ) diff --git a/src/mame/toaplan/tekipaki.cpp b/src/mame/toaplan/tekipaki.cpp new file mode 100644 index 00000000000..fad8b50f8be --- /dev/null +++ b/src/mame/toaplan/tekipaki.cpp @@ -0,0 +1,350 @@ +// license:BSD-3-Clause +// copyright-holders:Quench, Yochizo, David Haywood + +#include "emu.h" + +#include "gp9001.h" +#include "toaplan_coincounter.h" +#include "toaplipt.h" + +#include "cpu/m68000/m68000.h" +#include "cpu/z180/hd647180x.h" +#include "machine/gen_latch.h" +#include "sound/ymopl.h" + +#include "emupal.h" +#include "screen.h" +#include "speaker.h" +#include "tilemap.h" + +/* + +Name Board No Maker Game name +---------------------------------------------------------------------------- +tekipaki TP-020 Toaplan Teki Paki +tekipakit TP-020 Toaplan Teki Paki (location test) +whoopee *TP-025/TP-020 Toaplan Pipi & Bibis / Whoopee!! (Teki Paki hardware) + + * This version of Whoopee!! is on a board labeled TP-020 + (same board number, and same hardware, as Teki Paki) + but the ROMs are labeled TP-025. + +To Do / Unknowns: + - Whoopee/Teki Paki sometimes tests bit 5 of the region jumper port + just after testing for vblank. Why? +*/ + +namespace { + +class tekipaki_state : public driver_device +{ +public: + tekipaki_state(const machine_config &mconfig, device_type type, const char *tag) + : driver_device(mconfig, type, tag) + , m_maincpu(*this, "maincpu") + , m_audiocpu(*this, "audiocpu") + , m_vdp(*this, "gp9001") + , m_screen(*this, "screen") + , m_palette(*this, "palette") + , m_soundlatch(*this, "soundlatch") + { } + + void tekipaki(machine_config &config); + + int c2map_r(); + +protected: + virtual void video_start() override ATTR_COLD; + +private: + u32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + void screen_vblank(int state); + u8 tekipaki_cmdavailable_r(); + + void tekipaki_68k_mem(address_map &map) ATTR_COLD; + void hd647180_io_map(address_map &map) ATTR_COLD; + + required_device m_maincpu; + optional_device m_audiocpu; + required_device m_vdp; + required_device m_screen; + required_device m_palette; + optional_device m_soundlatch; + bitmap_ind8 m_custom_priority_bitmap; +}; + + +void tekipaki_state::video_start() +{ + m_screen->register_screen_bitmap(m_custom_priority_bitmap); + m_vdp->custom_priority_bitmap = &m_custom_priority_bitmap; +} + + +u32 tekipaki_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + bitmap.fill(0, cliprect); + m_custom_priority_bitmap.fill(0, cliprect); + m_vdp->render_vdp(bitmap, cliprect); + return 0; +} + +void tekipaki_state::screen_vblank(int state) +{ + if (state) // rising edge + { + m_vdp->screen_eof(); + } +} + + +static INPUT_PORTS_START( base ) + PORT_START("IN1") + TOAPLAN_JOY_UDLR_2_BUTTONS( 1 ) + + PORT_START("IN2") + TOAPLAN_JOY_UDLR_2_BUTTONS( 2 ) + + PORT_START("SYS") + PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_SERVICE1 ) + PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_TILT ) + TOAPLAN_TEST_SWITCH( 0x04, IP_ACTIVE_HIGH ) + PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_COIN1 ) + PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_COIN2 ) + PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_START1 ) + PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_START2 ) + PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_UNKNOWN ) + + PORT_START("DSWA") + TOAPLAN_MACHINE_NO_COCKTAIL_LOC(SW1) + // Coinage on bit mask 0x00f0 + PORT_BIT( 0x00f0, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // Modified below + + PORT_START("DSWB") + TOAPLAN_DIFFICULTY_LOC(SW2) + // Per-game features on bit mask 0x00fc + PORT_BIT( 0x00fc, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // Modified below +INPUT_PORTS_END + + +static INPUT_PORTS_START( tekipaki ) + PORT_INCLUDE( base ) + + PORT_MODIFY("DSWA") + // Various features on bit mask 0x000f - see above + TOAPLAN_COINAGE_DUAL_LOC( JMPR, 0x0f, 0x02, SW1 ) + + PORT_MODIFY("DSWB") + // Difficulty on bit mask 0x0003 - see above + // "Stop Mode" corresponds to "Invulnerability" in the other games + // (i.e. it enables pause and slow motion) + PORT_DIPNAME( 0x0004, 0x0000, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW2:!3") + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0004, DEF_STR( On ) ) + PORT_DIPNAME( 0x0008, 0x0000, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW2:!4") + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0008, DEF_STR( On ) ) + PORT_DIPNAME( 0x0010, 0x0000, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW2:!5") + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0010, DEF_STR( On ) ) + PORT_DIPNAME( 0x0020, 0x0000, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW2:!6") + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0020, DEF_STR( On ) ) + PORT_DIPNAME( 0x0040, 0x0000, "Stop Mode (Cheat)" ) PORT_DIPLOCATION("SW2:!7") + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0040, DEF_STR( On ) ) + PORT_DIPNAME( 0x0080, 0x0000, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW2:!8") + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0080, DEF_STR( On ) ) + + PORT_START("JMPR") + PORT_CONFNAME( 0x000f, 0x0002, DEF_STR( Region ) ) PORT_DIPLOCATION("JP:!4,!3,!2,!1") + PORT_CONFSETTING( 0x0002, DEF_STR( Europe ) ) + PORT_CONFSETTING( 0x0001, DEF_STR( USA ) ) + PORT_CONFSETTING( 0x0000, DEF_STR( Japan ) ) + PORT_CONFSETTING( 0x0003, DEF_STR( Hong_Kong ) ) + PORT_CONFSETTING( 0x0004, DEF_STR( Korea ) ) + PORT_CONFSETTING( 0x0005, DEF_STR( Taiwan ) ) + PORT_CONFSETTING( 0x0006, "Taiwan (Spacy Co., Ltd." ) + PORT_CONFSETTING( 0x0007, "USA (Romstar, Inc.)" ) + PORT_CONFSETTING( 0x0008, "Hong Kong (Honest Trading Co.)" ) +// PORT_CONFSETTING( 0x0009, DEF_STR( Japan ) ) // English title screen +// PORT_CONFSETTING( 0x000a, DEF_STR( Japan ) ) +// PORT_CONFSETTING( 0x000b, DEF_STR( Japan ) ) +// PORT_CONFSETTING( 0x000c, DEF_STR( Japan ) ) +// PORT_CONFSETTING( 0x000d, DEF_STR( Japan ) ) +// PORT_CONFSETTING( 0x000e, DEF_STR( Japan ) ) + PORT_CONFSETTING( 0x000f, "Japan (Distributed by Tecmo)" ) + PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(FUNC(tekipaki_state::c2map_r)) +INPUT_PORTS_END + +static INPUT_PORTS_START( whoopee ) + PORT_INCLUDE( base ) + + PORT_MODIFY("DSWA") + // Various features on bit mask 0x000f - see above + TOAPLAN_COINAGE_DUAL_LOC( JMPR, 0x06, 0x06, SW1 ) + + PORT_MODIFY("DSWB") + // Difficulty on bit mask 0x0003 - see above + PORT_DIPNAME( 0x000c, 0x0000, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW2:!3,!4") + PORT_DIPSETTING( 0x000c, DEF_STR( None ) ) + PORT_DIPSETTING( 0x0008, "200k only" ) + PORT_DIPSETTING( 0x0000, "200k and every 300k" ) + PORT_DIPSETTING( 0x0004, "150k and every 200k" ) + PORT_DIPNAME( 0x0030, 0x0000, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:!5,!6") + PORT_DIPSETTING( 0x0030, "1" ) + PORT_DIPSETTING( 0x0020, "2" ) + PORT_DIPSETTING( 0x0000, "3" ) + PORT_DIPSETTING( 0x0010, "5" ) + PORT_DIPNAME( 0x0040, 0x0000, "Invulnerability (Cheat)" ) PORT_DIPLOCATION("SW2:!7") + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0040, DEF_STR( On ) ) + PORT_DIPNAME( 0x0080, 0x0000, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW2:!8") + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0080, DEF_STR( On ) ) + + PORT_START("JMPR") + PORT_CONFNAME( 0x0008, 0x0000, "Nudity" ) //PORT_CONFLOCATION("JP:!1") + PORT_CONFSETTING( 0x0008, DEF_STR( Low ) ) + PORT_CONFSETTING( 0x0000, "High, but censored" ) + PORT_CONFNAME( 0x0007, 0x0006, DEF_STR( Region ) ) //PORT_CONFLOCATION("JP:!4,!3,!2") + PORT_CONFSETTING( 0x0006, DEF_STR( Europe ) ) + PORT_CONFSETTING( 0x0004, DEF_STR( USA ) ) + PORT_CONFSETTING( 0x0000, DEF_STR( Japan ) ) + PORT_CONFSETTING( 0x0001, DEF_STR( Asia ) ) + PORT_CONFSETTING( 0x0002, "Hong Kong (Honest Trading Co.)" ) + PORT_CONFSETTING( 0x0003, DEF_STR( Taiwan ) ) + PORT_CONFSETTING( 0x0005, "USA (Romstar, Inc.)" ) + PORT_CONFSETTING( 0x0007, "Europe (Nova Apparate GMBH & Co.)" ) + PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(FUNC(tekipaki_state::c2map_r)) // bit 0x10 sound ready +INPUT_PORTS_END + +int tekipaki_state::c2map_r() +{ + // bit 4 high signifies secondary CPU is ready + // bit 5 is tested low before V-Blank bit ??? + return m_soundlatch->pending_r() ? 0x00 : 0x01; +} + +u8 tekipaki_state::tekipaki_cmdavailable_r() +{ + if (m_soundlatch->pending_r()) return 0xff; + else return 0x00; +}; + + +void tekipaki_state::tekipaki_68k_mem(address_map &map) +{ + map(0x000000, 0x01ffff).rom(); + map(0x020000, 0x03ffff).rom(); // extra for Whoopee + map(0x080000, 0x082fff).ram(); + map(0x0c0000, 0x0c0fff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); + map(0x140000, 0x14000d).rw(m_vdp, FUNC(gp9001vdp_device::read), FUNC(gp9001vdp_device::write)); + map(0x180000, 0x180001).portr("DSWA"); + map(0x180010, 0x180011).portr("DSWB"); + map(0x180020, 0x180021).portr("SYS"); + map(0x180030, 0x180031).portr("JMPR"); // CPU 2 busy and Region Jumper block + map(0x180041, 0x180041).w("coincounter", FUNC(toaplan_coincounter_device::coin_w)); + map(0x180050, 0x180051).portr("IN1"); + map(0x180060, 0x180061).portr("IN2"); + map(0x180071, 0x180071).w(m_soundlatch, FUNC(generic_latch_8_device::write)); +} + +void tekipaki_state::hd647180_io_map(address_map &map) +{ + map.global_mask(0xff); + + map(0x60, 0x60).nopr(); + map(0x70, 0x75).nopw(); // DDRs are written with the wrong upper addresses! + map(0x84, 0x84).r(m_soundlatch, FUNC(generic_latch_8_device::read)); + + map(0x82, 0x82).rw("ymsnd", FUNC(ym3812_device::status_r), FUNC(ym3812_device::address_w)); + map(0x83, 0x83).w("ymsnd", FUNC(ym3812_device::data_w)); +} + +void tekipaki_state::tekipaki(machine_config &config) +{ + /* basic machine hardware */ + M68000(config, m_maincpu, 10_MHz_XTAL); // 10MHz Oscillator + m_maincpu->set_addrmap(AS_PROGRAM, &tekipaki_state::tekipaki_68k_mem); + m_maincpu->reset_cb().set_inputline(m_audiocpu, INPUT_LINE_RESET); + + hd647180x_device &audiocpu(HD647180X(config, m_audiocpu, 10_MHz_XTAL)); + // 16k byte ROM and 512 byte RAM are internal + audiocpu.set_addrmap(AS_IO, &tekipaki_state::hd647180_io_map); + audiocpu.in_pa_callback().set(FUNC(tekipaki_state::tekipaki_cmdavailable_r)); + + TOAPLAN_COINCOUNTER(config, "coincounter", 0); + + config.set_maximum_quantum(attotime::from_hz(600)); + + /* video hardware */ + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_video_attributes(VIDEO_UPDATE_BEFORE_VBLANK); + m_screen->set_raw(27_MHz_XTAL/4, 432, 0, 320, 262, 0, 240); + m_screen->set_screen_update(FUNC(tekipaki_state::screen_update)); + m_screen->screen_vblank().set(FUNC(tekipaki_state::screen_vblank)); + m_screen->set_palette(m_palette); + + PALETTE(config, m_palette).set_format(palette_device::xBGR_555, gp9001vdp_device::VDP_PALETTE_LENGTH); + + GP9001_VDP(config, m_vdp, 27_MHz_XTAL); + m_vdp->set_palette(m_palette); + m_vdp->vint_out_cb().set_inputline(m_maincpu, M68K_IRQ_4); + + /* sound hardware */ + SPEAKER(config, "mono").front_center(); + + GENERIC_LATCH_8(config, m_soundlatch); + + ym3812_device &ymsnd(YM3812(config, "ymsnd", 27_MHz_XTAL/8)); + ymsnd.irq_handler().set_inputline(m_audiocpu, 0); + ymsnd.add_route(ALL_OUTPUTS, "mono", 1.0); +} + +ROM_START( tekipaki ) + ROM_REGION( 0x040000, "maincpu", 0 ) /* Main 68K code */ + ROM_LOAD16_BYTE( "tp020-1.bin", 0x000000, 0x010000, CRC(d8420bd5) SHA1(30c1ad9e053cd7e79adb42aa428ebee28e144755) ) + ROM_LOAD16_BYTE( "tp020-2.bin", 0x000001, 0x010000, CRC(7222de8e) SHA1(8352ae23efc24a2e20cc24b6d37cb8fc6b1a730c) ) + + ROM_REGION( 0x8000, "audiocpu", 0 ) /* Sound HD647180 code */ + ROM_LOAD( "hd647180.020", 0x00000, 0x08000, CRC(d5157c12) SHA1(b2c6c087bb539456a9e562d0b40f05dde26cacd3) ) + + ROM_REGION( 0x100000, "gp9001", 0 ) + ROM_LOAD( "tp020-4.bin", 0x000000, 0x080000, CRC(3ebbe41e) SHA1(cea196c5f83e1a23d5b538a0db9bbbffa7af5118) ) + ROM_LOAD( "tp020-3.bin", 0x080000, 0x080000, CRC(2d5e2201) SHA1(5846c844eedd48305c1c67dc645b6e070b3f5b98) ) +ROM_END + + +ROM_START( tekipakit ) /* Location Test version */ + ROM_REGION( 0x040000, "maincpu", 0 ) /* Main 68K code */ + ROM_LOAD16_BYTE( "e.e5", 0x000000, 0x010000, CRC(89affc73) SHA1(3930bf0c2528de28dcb0cf2cd537adb62a2172e3) ) /* hand written "E" 27C512 chip */ + ROM_LOAD16_BYTE( "o.e6", 0x000001, 0x010000, CRC(a2244558) SHA1(5291cfbea4d4d1c45d6d4bd21b3c466459a0fa17) ) /* hand written "O" 27C512 chip */ + + ROM_REGION( 0x8000, "audiocpu", 0 ) /* Sound HD647180 code */ + ROM_LOAD( "hd647180.020", 0x00000, 0x08000, CRC(d5157c12) SHA1(b2c6c087bb539456a9e562d0b40f05dde26cacd3) ) + + ROM_REGION( 0x100000, "gp9001", 0 ) + ROM_LOAD( "0-1_4.4_cb45.a16", 0x000000, 0x080000, CRC(35e14729) SHA1(8c929604953b78c6e72744a38e06a988510193a5) ) /* hand written "0-1 4/4 CB45" 27C402 chip */ + ROM_LOAD( "3-4_4.4_547d.a15", 0x080000, 0x080000, CRC(41975fcc) SHA1(f850d5a9638d41bb69f204a9cd54e2fd693b57ef) ) /* hand written "3-4 4/4 547D" 27C402 chip */ +ROM_END + +ROM_START( whoopee ) + ROM_REGION( 0x040000, "maincpu", 0 ) /* Main 68K code */ + ROM_LOAD16_BYTE( "whoopee.1", 0x000000, 0x020000, CRC(28882e7e) SHA1(8fcd278a7d005eb81cd9e461139c0c0f756a4fa4) ) + ROM_LOAD16_BYTE( "whoopee.2", 0x000001, 0x020000, CRC(6796f133) SHA1(d4e657be260ba3fd3f0556ade617882513b52685) ) + + ROM_REGION( 0x10000, "audiocpu", 0 ) /* Sound HD647180 code */ + ROM_LOAD( "hd647180.025", 0x00000, 0x08000, CRC(c02436f6) SHA1(385343f88991646ec23b385eaea82718f1251ea6) ) + + ROM_REGION( 0x200000, "gp9001", 0 ) + ROM_LOAD( "tp025-4.bin", 0x000000, 0x100000, CRC(ab97f744) SHA1(c1620e614345dbd5c6567e4cb6f55c61b900d0ee) ) + ROM_LOAD( "tp025-3.bin", 0x100000, 0x100000, CRC(7b16101e) SHA1(ae0119bbfa0937d18c4fbb0a3ef7cdc3b9fa6b56) ) +ROM_END + +} // anonymous namespace + +GAME( 1991, tekipaki, 0, tekipaki, tekipaki, tekipaki_state, empty_init, ROT0, "Toaplan", "Teki Paki", MACHINE_SUPPORTS_SAVE ) +GAME( 1991, tekipakit, tekipaki, tekipaki, tekipaki, tekipaki_state, empty_init, ROT0, "Toaplan", "Teki Paki (location test)", MACHINE_SUPPORTS_SAVE ) +GAME( 1991, whoopee, pipibibs, tekipaki, whoopee, tekipaki_state, empty_init, ROT0, "Toaplan", "Pipi & Bibis / Whoopee!! (Teki Paki hardware)", MACHINE_SUPPORTS_SAVE ) // original Whoopee!! boards have a HD647180 instead of Z80 diff --git a/src/mame/toaplan/toaplan2.cpp b/src/mame/toaplan/toaplan2.cpp deleted file mode 100644 index 8006a943299..00000000000 --- a/src/mame/toaplan/toaplan2.cpp +++ /dev/null @@ -1,6548 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Quench, Yochizo, David Haywood -// thanks-to:Richard Bush -/***************************************************************************** - - ToaPlan game hardware from 1991 - 1994 - Raizing/8ing game hardware from 1993 onwards - ------------------------------------------------- - Driver by: Quench and Yochizo - Original othldrby.c by Nicola Salmoria - - Raizing games and Truxton 2 are heavily dependent on the Raine source - - many thanks to Richard Bush and the Raine team. [Yochizo] - - -Supported games: - - Name Board No Maker Game name - ---------------------------------------------------------------------------- - tekipaki TP-020 Toaplan Teki Paki - tekipakit TP-020 Toaplan Teki Paki (location test) - ghox TP-021 Toaplan Ghox (Spinner with single up/down axis control) - ghoxj TP-021 Toaplan Ghox (8-Way Joystick controls) - dogyuun TP-022 Toaplan Dogyuun - dogyuuna TP-022 Toaplan Dogyuun (older) - dogyuunt TP-022 Toaplan Dogyuun (location test) - kbash TP-023 Toaplan Knuckle Bash - kbash2 bootleg Toaplan Knuckle Bash 2 - truxton2 TP-024 Toaplan Truxton 2 / Tatsujin Oh - pipibibs TP-025 Toaplan Pipi & Bibis / Whoopee!! (set 1) - pipibibsa TP-025 Toaplan Pipi & Bibis / Whoopee!! (set 2) - pipibibsp TP-025 Toaplan Pipi & Bibis / Whoopee!! (Prototype) - pipibibsbl bootleg Toaplan Pipi & Bibis / Whoopee!! (based of the prototype) - whoopee *TP-025/TP-020 Toaplan Pipi & Bibis / Whoopee!! (Teki Paki hardware) - fixeight TP-026 Toaplan FixEight - fixeightbl bootleg Toaplan FixEight - grindstm TP-027 Toaplan Grind Stormer (1992) - grindstma TP-027 Toaplan Grind Stormer (1992) (older) - vfive TP-027 Toaplan V-V (V-Five) (1993 - Japan only) - batsugun TP-030 Toaplan Batsugun - batsuguna TP-030 Toaplan Batsugun (older) - batsugunsp TP-030 Toaplan Batsugun (Special Version) - enmadaio TP-031 Toaplan Enma Daio - pwrkick SW931201 Sunwise Power Kick - burgkids SW931201 Sunwise Burger Kids - othldrby S951060-VGP Sunwise Othello Derby - snowbro2 TP-033 Hanafram Snow Bros. 2 - With New Elves - - * This version of Whoopee!! is on a board labeled TP-020 - (same board number, and same hardware, as Teki Paki) - but the ROMs are labeled TP-025. - - sstriker RA-MA7893-01 Raizing Sorcer Striker - sstrikera RA-MA7893-01 Raizing Sorcer Striker (Unite Trading license) - mahoudai RA-MA7893-01 Raizing Mahou Daisakusen (Japan) - kingdmgp RA-MA9402-03 Raizing/8ing Kingdom Grandprix - shippumd RA-MA9402-03 Raizing/8ing Shippu Mahou Daisakusen (Japan) - bgaregga RA9503 Raizing/8ing Battle Garegga (World - Sat Feb 3 1996) - bgareggat RA9503 Raizing/8ing Battle Garegga (location test - Wed Jan 17 1996) - bgareggahk RA9503 Raizing/8ing Battle Garegga (Hong Kong (and Austria?) - Sat Feb 3 1996) - bgareggatw RA9503 Raizing/8ing Battle Garegga (Taiwan (and Germany?) - Thu Feb 1 1996) - bgaregganv RA9503 Raizing/8ing Battle Garegga - New Version (Hong Kong (and Austria?) - Sat Mar 2 1996) - bgareggat2 RA9503 Raizing/8ing Battle Garegga - Type 2 (World - Sat Mar 2 1996) - bgareggacn RA9503 Raizing/8ing Battle Garegga - Type 2 (China (and Denmark?) - Tue Apr 2 1996) - batrider RA9704 Raizing/8ing Armed Police Batrider (Europe - Fri Feb 13 1998) - batrideru RA9704 Raizing/8ing Armed Police Batrider (USA - Fri Feb 13 1998) - batriderc RA9704 Raizing/8ing Armed Police Batrider (China - Fri Feb 13 1998) - batriderj RA9704 Raizing/8ing Armed Police Batrider - B Version (Japan - Fri Feb 13 1998) - batriderk RA9704 Raizing/8ing Armed Police Batrider (Korea - Fri Feb 13 1998) - batriderja RA9704 Raizing/8ing Armed Police Batrider (Japan - Mon Dec 22 1997) - batridert RA9704 Raizing/8ing Armed Police Batrider (Taiwan - Mon Dec 22 1997) - bbakraid ET68-V99 8ing Battle Bakraid - Unlimited Version (USA - Tue Jun 8th, 1999) - bbakraidj ET68-V99 8ing Battle Bakraid - Unlimited Version (Japan - Tue Jun 8th, 1999) - bbakraidja ET68-V99 8ing Battle Bakraid (Japan - Wed Apr 7th, 1999) - - SET NOTES: - - ghox - The ghoxj set displays an English title screen when the jumpers are set for Japan/Taito, - and fails to display the "Winners Don't Use Drugs" logo when set for USA/Taito (either - Taito America or Taito Japan). - - dogyuun - In the location test version, if you are hit while you have a bomb, the bomb explodes - automatically and saves you from dying. In the final released version, the bomb explodes - but you die anyway. - The only difference between the dogyuun and dogyuuna sets is some of the region jumper - settings; see the INPUT_PORTS definitions. - - truxton2 - Although the truxton2 PCB has only standard JAMMA mono audio output, and uses a YM3014B - mono DAC, the YM2151 music is actually sequenced in stereo. In toaplan2.h, uncomment - "#define TRUXTON2_STEREO" to hear the game's music the way it was originally composed. - Difficulty is much lower when the region is set to Europe or USA than when set to any - Asian region, independent of the "Difficulty" dipswitches. See the code beginning at - 1FE94 (RAM address 1002D6 contains 0 if region is an Asian region, 1 if Europe or USA) - - fixeight - The same program is used for all regions, and the region can be changed just by swapping - EEPROMs. However, the V25 code also recognizes a secret input that rewrites the EEPROM to - use any one of the 14 recognized regional licenses, using the state of the player 1 and - player 2 button inputs held in conjunction with it as a 4-bit binary code: - - Region Button input - ------------------------ ------------------------------------ - Korea, Taito license No buttons - Korea P1 button 1 - Hong Kong, Taito license P1 button 2 - Hong Kong P1 buttons 1 & 2 - Taiwan, Taito license P2 button 1 - Taiwan P1 button 1 + P2 button 1 - SE Asia, Taito license P1 button 2 + P2 button 1 - Southeast Asia P1 buttons 1 & 2 + P2 button 1 - Europe, Taito license P2 button 2 - Europe P1 button 1 + P2 button 2 - USA, Taito license P1 button 2 + P2 button 2 - USA P1 buttons 1 & 2 + P2 button 2 - (Invalid) P2 buttons 1 & 2 - (Invalid) P1 button 1 + P2 buttons 1 & 2 - Japan P1 button 2 + P2 buttons 1 & 2 - Japan, Taito license P1 buttons 1 & 2 + P2 buttons 1 & 2 - - grindstm - Code at 20A26 in vfive forces region to Japan. All sets have some NOPs at reset vector, - and the NEC V25 CPU test that the other games do is skipped. Furthermore, all sets have - a broken ROM checksum routine that reads address ranges that don't match the actual - location or size of the ROM, and that has a hack at the end so it always passes. - Normally you would expect to see code like this in a bootleg, but the NOPs and other - oddities are identical among three different sets. - - batsugun - The Special Version has many changes to make the game easier: it adds an autofire button, - replaces the regular bomb with the more powerful double bomb (which in the original version - required both players in a two player game to press their bomb buttons at once), gives you - a shield that can absorb one hit each time your ship "levels up", etc. It also changes the - colors of the title screen, ship select screen, stages, and enemies. - batsugun compared to batsuguna has code that looks more like the Special Version, but it - doesn't have any of the Special Version features. All the differences between batsugun - and batsuguna look like bug fixes that were carried over into the Special Version. - - sstriker - The mahoudai set reads the region jumpers, but the lookup tables in ROM that map jumper - settings to copyright text, coinage settings, etc., contain identical values for every - jumper setting, effectively ignoring the jumpers and forcing the region to Japan. - On the other hand, sstriker has its title screen and all its text in English even when - the region is set to Japan. This seems odd but has been verified correct on two boards. - The only difference between sstriker and sstrikera is the copyright text displayed when - the region is set to Korea. - - kingdmgp - The kingdmgp and shippumd sets have identical program ROMs but a different graphics ROM - for the text layer. Setting the region to Japan with the kingdmgp ROM, or to anything other - than Japan with the shippumd ROM, results in a corrupt title screen and unreadable text. - In kingdmgp some of the tiles needed for the credits screen in attract mode have been - stripped out, resulting in boxes where letters should be. It doesn't seem very professional - but appears to be a genuine release. A lot of boards being sold as 'Kingdom Grand Prix' are - in fact conversions using Neill Corlett's hack. - - bgaregga - The later versions change the small bullet-shaped enemy bullets to bright yellow balls, - eliminate the flying metal debris from explosions, and require additional joystick input - to access the Extended, Harder, Special, and Stage Edit hidden features. - In addition to these changes, the bgareggat2 set uses only two buttons. Instead of being - able to change the formation of your options with the third button, each of the selectable - ships has a different, fixed option formation. However, the third button can still be used - to select an alternate ship color and to enter the secret character and Stage Edit codes. - - batrider - Batrider was marketed as a two button game, and the regular ships all use only the first - two buttons, but in the original version you need the third button in order to control the - options of the hidden Battle Garegga ships. - This problem was fixed in the B Version, which lets you change the Battle Garegga ships' - option formation using Street Fighter style joystick commands (as well as by using the third - button, if the cabinet has one) - - bbakraid - Because players managed to counter stop the original Battle Bakraid not long after release, - the Unlimited Version, which can display more score digits, was released as a ROM upgrade. - The upgrade also fixes the bug in the original version that prevented the unlocking of - Team Edit mode from being saved in the EEPROM. - - - **************************************************************************** - * Battle Garegga and Armed Police Batrider have secret characters * - * and game features. * - * Try to input the following commands to use them. * - * ======================================================================== * - * Battle Garegga * - * The button you use to select your ship not only determines its * - * color, but affects its characteristics. * - * A: Default characteristics. * - * B: Slightly higher speed than A type. * - * C: Slightly smaller hitbox than A type. * - * A+B+C: Same speed as B type and same hitbox as C type. * - * * - * After inserting a coin (pushing a credit button), input * - * UP UP DOWN DOWN LEFT RIGHT LEFT RIGHT A B C START * - * then you can use Mahou Daisakusen characters. * - * * - * Note: In versions of the game dated Mar 2 1996 or later, you must * - * hold the joystick RIGHT in addition to the specified button(s) * - * when entering any of the following commands. Even if Stage Edit * - * is enabled via dipswitch, you need to hold RIGHT to use it. * - * * - * EXTENDED: After inserting a coin, hold A and press START. * - * You play through all stages twice before the game ends. * - * HARDER: After inserting a coin, hold B and press START. * - * Difficulty is increased. * - * SPECIAL: After inserting a coin, hold A and B and press START. * - * Combination of EXTENDED and HARDER modes. * - * STAGE EDIT: After inserting a coin, hold C and press START. * - * You can choose what order to play Stage 2, 3 and 4 in, * - * or even skip them. * - * * - * EXTENDED, HARDER, and SPECIAL modes each have their own high score list. * - * ------------------------------------------------------------------------ * - * Armed Police Batrider * - * The button you use to select your ship not only determines its * - * color, but affects its characteristics. * - * A: High main shot power, low option shot power. * - * Average speed. Default autofire rate is 15 Hz. * - * B: Low main shot power, high option shot power. Slightly * - * slower than A type. Default autofire rate is 12 Hz. * - * C: High main shot and option shot power, but lowest speed. * - * Default autofire rate is 20 Hz. * - * START: Low main shot and option shot power, but highest speed. * - * Default autofire rate is 10 Hz. * - * * - * Note: The following features can also be enabled via dipswitches. * - * * - * PLAYER SELECT: After inserting a coin, input * - * UP UP DOWN DOWN LEFT RIGHT LEFT RIGHT B A * - * You can select a single character instead of a team. * - * GUEST PLAYERS: After inserting a coin, input * - * UP UP DOWN DOWN LEFT RIGHT LEFT RIGHT A B * - * You can use Mahou Daisakusen and Battle Garegga characters. * - * SPECIAL COURSE: After inserting a coin, input * - * UP DOWN UP DOWN LEFT RIGHT LEFT RIGHT A B * - * You can select the Special course, which consists of bosses only. * - * STAGE EDIT: When you select your course, press A and B simultaneously. * - * You can choose what order to play Stage 2, 3 and 4 in, * - * or even skip them. * - **************************************************************************** - - - ############################################################################ - # In Battle Bakraid, the button you use to select your ship not only # - # determines its color, but affects its characteristics. # - # A: Increased main shot power. Default autofire rate is 20 Hz. # - # B: Increased bomb blast duration. Default autofire rate is 12 Hz. # - # C: Increased side shot power. Default autofire rate is 15 Hz. # - # START: Increased speed. Default autofire rate is 10 Hz. # - # # - # STAGE EDIT: When you select your course, press A and B simultaneously. # - # You can choose what order to play Stage 2, 3, 4 and 5 in, # - # or even skip them. Stage Edit can also be enabled via dipswitch. # - # ======================================================================== # - # Battle Bakraid has unlocking codes to gain access to extra players # - # and game features. Once each feature is unlocked, it is saved in EEPROM # - # and remains unlocked until you erase the EEPROM from the service mode. # - # However, in the original (non-Unlimited) version, the unlocking of # - # Team Edit is not saved in EEPROM, apparently due to a bug. # - # Special thanks go to the 'R8ZING Shooter Tribute' page for finding # - # and publishing this info. # - # ======================================================================== # - # PLAYER SELECT: PHASE 2 # - # Result: 3 more fighter planes available. # - # Code: UP UP DOWN DOWN LEFT RIGHT LEFT RIGHT A B Start # - # Conditions: # - # 1. Start from the title screen # - # 2. Insert Coin # - # 3. Watch the 20 sec. counter and enter each part of the code right # - # between the counting. # - # Example: 12,up,11,up,10,down,9,down,8,left,7,right,6.left,5,r.. # - # After entering the [B] button a chime should sound. Phase 2 unlocked! # - # ------------------------------------------------------------------------ # - # PLAYER SELECT: PHASE 3 # - # Result: 2 more fighter planes available. # - # Code: UP UP DOWN DOWN LEFT RIGHT LEFT RIGHT B A Start # - # Conditions: # - # 1. Unlock Player Select Phase 2 first # - # 2. Insert Coin # - # 3. Watch the 20 sec. counter and enter each part of the code right # - # between the counting. # - # Important: The entering of this code has to be finished before the # - # counter passes 10 ! To do so, you will have to start after coin # - # insertion, right before it starts to count: # - # Example: up,19,up,18,down,17,down,16,left,15,right,14.left,.. # - # After entering the [A] button a chime should sound. Phase 3 unlocked! # - # ------------------------------------------------------------------------ # - # TEAM EDIT: ENABLE # - # Result: Unlocks the 'team edit' feature to select a team of different # - # ships like in Batrider. # - # Code: UP DOWN UP DOWN LEFT RIGHT LEFT RIGHT A B Start # - # Conditions: # - # 1. Unlock Player Select Phase 2 and Phase 3 first # - # 2. Insert Coin # - # 3. Watch the 20 sec. counter and enter each part of the code right # - # between the counting. # - # Important: This code hast to be entered so that the counter is at 0 when # - # you press the final button [B]. To do so, start after second 9: # - # Example: 9,up,8,down,7,up,6,down,5,left,4,right,3,left,2,right,1,A,0,B # - # After entering the [B] button a chime should sound. Team edit unlocked! # - # # - # Note: In the Japan version, to use Team Edit after unlocking it, # - # you must hold UP or DOWN while selecting your course. # - # In the USA version, if Team Edit is unlocked, the game asks you # - # if you want to use it after you select your course. # - # ------------------------------------------------------------------------ # - # SPECIAL COURSE: ENABLE # - # Result: Unlocks the Special course, a game mode where you fight the # - # bosses only. # - # Code: UP DOWN UP DOWN LEFT RIGHT LEFT RIGHT B A Start # - # Conditions: # - # 1. Start from the title screen # - # 2. Hold [C] button # - # 3. Insert Coin # - # 4. Watch the 20 sec. counter and enter each part of the code right # - # between the counting. # - # 5. Release [C] button # - # After entering the [A] button a chime should sound. Special course # - # unlocked! # - ############################################################################ - - - -*************** Hardware Info *************** - -CPU: - MC68000P10 - TMP68HC000N-16 - -Sound CPU/MCU: - HD647180X0FS6 (Hitachi Z180 Compatible CPU with internal 16k ROM) - Z84C0006PEC (Z80) - NEC V25 - -Sound Chips: - YM3812 + YM3014B (DAC) - YM2151 + YM3014B - YM2151 + YM3014B + M6295 - YM2151 + YM3012 (DAC) + M6295 + M6295 - YMZ280B-F + YAC516-E (DAC) - -Graphics Custom 208pin QFP: - GP9001 L7A0498 TOA PLAN - (emulated in toaplan/gp9001.cpp) - -********************************************************************* - -Game status: - -Teki Paki Working. MCU type is a Hitachi HD647180. -Ghox Working, MCU type is a Hitachi HD647180. -Dogyuun Working. MCU type is a NEC V25. Chip is a PLCC94 stamped 'TS-002-MACH'.* -Knuckle Bash Working. MCU type is a NEC V25. Chip is a PLCC94 stamped 'TS-004-DASH'.* -Truxton 2 Working. -Pipi & Bibis Working. -Pipi & Bibis (Teki Paki h/w) Working, MCU type is a Hitachi HD647180. -Pipi & Bibis bootleg Working. One unknown ROM. -FixEight Working. MCU type is a NEC V25. Chip is a PLCC94 stamped 'TS-001-TURBO' -FixEight bootleg Working. One unknown ROM (same as pipibibs bootleg one). Region hardcoded to Korea (@ $4d8) -Grind Stormer / VFive Working. MCU type is a NEC V25. Chip is a PLCC94 stamped 'TS-007-SPY'.* -Batsugun / Batsugun Sp' Working. MCU type is a NEC V25. Chip is a PLCC94 stamped 'TS-007-SPY'.* -Snow Bros. 2 Working. -Mahou Daisakusen Working. -Shippu Mahou Daisakusen Working. -Battle Garegga Working. -Armed Police Batrider Working. -Battle Bakraid Working. - -* Some PCBs use another version stamped 'NITRO' which is the same chip type. - MACH, DASH and SPY seem to be the same chip (same encryption table) - Batsugun has the CPU hooked up in non-encrypted mode. - -Notes: - See Input Port definition header below, for instructions - on how to enter pause/slow motion modes. - -To Do / Unknowns: - - Whoopee/Teki Paki sometimes tests bit 5 of the region jumper port - just after testing for vblank. Why? - - Priority problem on 2nd player side of selection screen in Fixeight bootleg. - - Fixeight bootleg text in sound check mode does not display properly - with the CPU set to 10MHz (ok at 16MHz). Possible error in video_count_r routine. - - Need to sort out the video status register. - - Find out how exactly how sound CPU communication really works in bgaregga/batrider/bbakraid - current emulation seems to work (plays all sounds), but there are still some unknown reads/writes - - Music timing is bit different on bbakraid. - reference : https://www.youtube.com/watch?v=zjrWs0iHQ5A - -Notes on Power Kick coin inputs: -- The 10 yen input is "Key In" according to the bookkeeping screen, but is - an otherwise normal coin input with a counter and a lockout (sharing the - latter with the "medal" coin). -- The 100 yen input never adds any credits except in "Coin Function Check," - instead dispensing its value into the hopper immediately. - -To reset the NVRAM in Othello Derby, hold P1 Button 1 down while booting. - -*****************************************************************************/ - - -#include "emu.h" -#include "toaplan2.h" -#include "toaplipt.h" - -#include "cpu/nec/v25.h" -#include "cpu/z80/z80.h" -#include "cpu/z180/hd647180x.h" -#include "machine/nvram.h" -#include "sound/ymopm.h" -#include "sound/ymopl.h" -#include "sound/ymz280b.h" -#include "speaker.h" - - -//#define TRUXTON2_STEREO /* Uncomment to hear truxton2 music in stereo */ - -constexpr unsigned toaplan2_state::T2PALETTE_LENGTH; - - -/*************************************************************************** - Initialisation handlers -***************************************************************************/ - - -void ghox_state::machine_start() -{ - toaplan2_state::machine_start(); - save_item(NAME(m_old_paddle_h)); -} - - -void truxton2_state::machine_start() -{ - toaplan2_state::machine_start(); - save_item(NAME(m_z80_busreq)); -} - - -void toaplan2_state::toaplan2_reset(int state) -{ - if (m_audiocpu != nullptr) - m_audiocpu->pulse_input_line(INPUT_LINE_RESET, attotime::zero); -} - - -void ghox_state::machine_reset() -{ - toaplan2_state::machine_reset(); - m_old_paddle_h[0] = 0; - m_old_paddle_h[1] = 0; -} - - -MACHINE_RESET_MEMBER(truxton2_state, bgaregga) -{ - toaplan2_state::machine_reset(); - for (int chip = 0; chip < 2; chip++) - { - for (int i = 0; i < 8; i++) - { - if (m_raizing_okibank[chip][i] != nullptr) - m_raizing_okibank[chip][i]->set_entry(0); - } - } -} - - -void toaplan2_state::init_dogyuun() -{ - m_sound_reset_bit = 0x20; -} - - -void truxton2_state::init_fixeight() -{ - m_sound_reset_bit = 0x08; -} - - -void toaplan2_state::init_fixeightbl() -{ - u8 *ROM = memregion("oki1")->base(); - - m_okibank->configure_entries(0, 5, &ROM[0x30000], 0x10000); -} - - -void toaplan2_state::init_vfive() -{ - m_sound_reset_bit = 0x10; -} - - -void toaplan2_state::init_pipibibsbl() -{ - u16 *ROM = (u16 *)(memregion("maincpu")->base()); - - for (int i = 0; i < (0x040000/2); i += 4) - { - ROM[i+0] = bitswap<16>(ROM[i+0],0x1,0x5,0x6,0x7,0x8,0x2,0x0,0x9,0xe,0xd,0x4,0x3,0xf,0xa,0xb,0xc); - ROM[i+1] = bitswap<16>(ROM[i+1],0x5,0x3,0x1,0xf,0xd,0xb,0x9,0x0,0x2,0x4,0x6,0x8,0xa,0xc,0xe,0x7); - ROM[i+2] = bitswap<16>(ROM[i+2],0xc,0xd,0xe,0xf,0x8,0x9,0xa,0xb,0x3,0x2,0x1,0x0,0x7,0x6,0x5,0x4); - ROM[i+3] = bitswap<16>(ROM[i+3],0x8,0x9,0xa,0xb,0xc,0xd,0xe,0xf,0x3,0x2,0x1,0x0,0x7,0x6,0x5,0x4); - } -} - -void truxton2_state::install_raizing_okibank(int chip) -{ - assert(m_oki_rom[chip] && m_raizing_okibank[chip][0]); - - for (int i = 0; i < 4; i++) - { - m_raizing_okibank[chip][i]->configure_entries(0, 16, &m_oki_rom[chip][(i * 0x100)], 0x10000); - } - m_raizing_okibank[chip][4]->configure_entries(0, 16, &m_oki_rom[chip][0x400], 0x10000); - for (int i = 5; i < 8; i++) - { - m_raizing_okibank[chip][i]->configure_entries(0, 16, &m_oki_rom[chip][0], 0x10000); - } -} - -void truxton2_state::init_bgaregga() -{ - u8 *Z80 = memregion("audiocpu")->base(); - - m_audiobank->configure_entries(0, 8, Z80, 0x4000); // Test mode only, Mirror of First 128KB Areas? - m_audiobank->configure_entries(8, 8, Z80, 0x4000); - install_raizing_okibank(0); -} - - -void truxton2_state::init_batrider() -{ - u8 *Z80 = memregion("audiocpu")->base(); - - m_audiobank->configure_entries(0, 16, Z80, 0x4000); - install_raizing_okibank(0); - install_raizing_okibank(1); - m_sndirq_line = 4; -} - - -void truxton2_state::init_bbakraid() -{ - m_sndirq_line = 2; -} - -void toaplan2_state::init_enmadaio() -{ - u8 *ROM = memregion("oki1")->base(); - - m_okibank->configure_entries(0, 0x60, ROM, 0x40000); - m_okibank->set_entry(0); -} - - -/*************************************************************************** - Toaplan games -***************************************************************************/ - -void toaplan2_state::cpu_space_fixeightbl_map(address_map &map) -{ - map(0xfffff0, 0xffffff).m(m_maincpu, FUNC(m68000_base_device::autovectors_map)); - map(0xfffff5, 0xfffff5).lr8(NAME([this] () { m_maincpu->set_input_line(M68K_IRQ_2, CLEAR_LINE); return m68000_device::autovector(2); })); -} - -void toaplan2_state::cpu_space_pipibibsbl_map(address_map &map) -{ - map(0xfffff0, 0xffffff).m(m_maincpu, FUNC(m68000_base_device::autovectors_map)); - map(0xfffff9, 0xfffff9).lr8(NAME([this] () { m_maincpu->set_input_line(M68K_IRQ_4, CLEAR_LINE); return m68000_device::autovector(4); })); -} - - -u16 toaplan2_state::video_count_r() -{ - /* +---------+---------+--------+---------------------------+ */ - /* | /H-Sync | /V-Sync | /Blank | Scanline Count | */ - /* | Bit 15 | Bit 14 | Bit 8 | Bit 7-0 (count from #EF) | */ - /* +---------+---------+--------+---------------------------+ */ - /*************** Control Signals are active low ***************/ - - int vpos = m_screen->vpos(); - - u16 video_status = 0xff00; // Set signals inactive - - vpos = (vpos + 15) % 262; - - if (!m_vdp[0]->hsync_r()) - video_status &= ~0x8000; - if (!m_vdp[0]->vsync_r()) - video_status &= ~0x4000; - if (!m_vdp[0]->fblank_r()) - video_status &= ~0x0100; - if (vpos < 256) - video_status |= (vpos & 0xff); - else - video_status |= 0xff; - -// logerror("VC: vpos=%04x hpos=%04x VBL=%04x\n",vpos,hpos,m_screen->vblank()); - - return video_status; -} - - -void toaplan2_state::coin_w(u8 data) -{ - /* +----------------+------ Bits 7-5 not used ------+--------------+ */ - /* | Coin Lockout 2 | Coin Lockout 1 | Coin Count 2 | Coin Count 1 | */ - /* | Bit 3 | Bit 2 | Bit 1 | Bit 0 | */ - - if (data & 0x0f) - { - machine().bookkeeping().coin_lockout_w(0, BIT(~data, 2)); - machine().bookkeeping().coin_lockout_w(1, BIT(~data, 3)); - machine().bookkeeping().coin_counter_w(0, BIT( data, 0)); - machine().bookkeeping().coin_counter_w(1, BIT( data, 1)); - } - else - { - machine().bookkeeping().coin_lockout_global_w(1); // Lock all coin slots - } - if (data & 0xf0) - { - logerror("Writing unknown upper bits (%02x) to coin control\n",data); - } -} - -void pwrkick_state::pwrkick_coin_w(u8 data) -{ - machine().bookkeeping().coin_counter_w(0, BIT(data, 1)); // medal - machine().bookkeeping().coin_counter_w(1, BIT(data, 3)); // 10 yen - machine().bookkeeping().coin_counter_w(2, BIT(data, 0)); // 100 yen - m_hopper->motor_w(BIT(data, 7)); -} - -void pwrkick_state::pwrkick_coin_lockout_w(u8 data) -{ - machine().bookkeeping().coin_lockout_w(0, BIT(~data, 2)); - machine().bookkeeping().coin_lockout_w(1, BIT(~data, 2)); - machine().bookkeeping().coin_lockout_w(2, BIT(~data, 1)); -} - - -void toaplan2_state::coin_sound_reset_w(u8 data) -{ - logerror("coin_sound_reset_w %02x\n",data); - - coin_w(data & ~m_sound_reset_bit); - sound_reset_w(data & m_sound_reset_bit); -} - - -void truxton2_state::shippumd_coin_w(u8 data) -{ - coin_w(data & ~0x10); - m_oki[0]->set_rom_bank(BIT(data, 4)); -} - - -u8 toaplan2_state::shared_ram_r(offs_t offset) -{ - return m_shared_ram[offset]; -} - - -void toaplan2_state::shared_ram_w(offs_t offset, u8 data) -{ - m_shared_ram[offset] = data; -} - - -int toaplan2_state::c2map_r() -{ - // For Teki Paki hardware - // bit 4 high signifies secondary CPU is ready - // bit 5 is tested low before V-Blank bit ??? - - return m_soundlatch[0]->pending_r() ? 0x00 : 0x01; -} - - -template -u16 ghox_state::ghox_h_analog_r() -{ - const s8 new_value = m_io_pad[Which]->read(); - const s8 result = new_value - m_old_paddle_h[Which]; - if (!machine().side_effects_disabled()) - m_old_paddle_h[Which] = new_value; - return result; -} - - -void toaplan2_state::sound_reset_w(u8 data) -{ - m_audiocpu->set_input_line(INPUT_LINE_RESET, (data & m_sound_reset_bit) ? CLEAR_LINE : ASSERT_LINE); -} - -template -void toaplan2_state::oki_bankswitch_w(u8 data) -{ - m_oki[Chip]->set_rom_bank(data & 1); -} - -void toaplan2_state::fixeightbl_oki_bankswitch_w(u8 data) -{ - data &= 7; - if (data <= 4) m_okibank->set_entry(data); -} - - -/*************************************************************************** - Raizing games -***************************************************************************/ - - -void truxton2_state::raizing_z80_bankswitch_w(u8 data) -{ - m_audiobank->set_entry(data & 0x0f); -} - - -// bgaregga and batrider don't actually have a NMK112, but rather a GAL -// programmed to bankswitch the sound ROMs in a similar fashion. -// it may not be a coincidence that the composer and sound designer for -// these two games, Manabu "Santaruru" Namiki, came to Raizing from NMK... - -void truxton2_state::raizing_oki_bankswitch_w(offs_t offset, u8 data) -{ - m_raizing_okibank[(offset & 4) >> 2][offset & 3]->set_entry(data & 0xf); - m_raizing_okibank[(offset & 4) >> 2][4 + (offset & 3)]->set_entry(data & 0xf); - offset++; - data >>= 4; - m_raizing_okibank[(offset & 4) >> 2][offset & 3]->set_entry(data & 0xf); - m_raizing_okibank[(offset & 4) >> 2][4 + (offset & 3)]->set_entry(data & 0xf); -} - - -u8 truxton2_state::bgaregga_E01D_r() -{ - // the Z80 reads this address during its IRQ routine, - // and reads the soundlatch only if the lowest bit is clear. - return m_soundlatch[0]->pending_r() ? 0 : 1; -} - - -u16 truxton2_state::batrider_z80_busack_r() -{ - // Bit 0x01 returns the status of BUSAK from the Z80. - // These accesses are made when the 68K wants to read the Z80 - // ROM code. Failure to return the correct status incurrs a Sound Error. - - return m_z80_busreq; // Loop BUSRQ to BUSAK -} - - -void truxton2_state::batrider_z80_busreq_w(u8 data) -{ - m_z80_busreq = (data & 0x01); // see batrider_z80_busack_r above -} - - -u16 truxton2_state::batrider_z80rom_r(offs_t offset) -{ - return m_z80_rom[offset]; -} - -// these two latches are always written together, via a single move.l instruction -void truxton2_state::batrider_soundlatch_w(u8 data) -{ - m_soundlatch[0]->write(data & 0xff); - m_audiocpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE); -} - - -void truxton2_state::batrider_soundlatch2_w(u8 data) -{ - m_soundlatch[1]->write(data & 0xff); - m_audiocpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE); -} - -void truxton2_state::batrider_unknown_sound_w(u16 data) -{ - // the 68K writes here when it wants a sound acknowledge IRQ from the Z80 - // for bbakraid this is on every sound command; for batrider, only on certain commands -} - - -void truxton2_state::batrider_clear_sndirq_w(u16 data) -{ - // not sure whether this is correct - // the 68K writes here during the sound IRQ handler, and nowhere else... - m_maincpu->set_input_line(m_sndirq_line, CLEAR_LINE); -} - - -void truxton2_state::batrider_sndirq_w(u8 data) -{ - // if batrider_clear_sndirq_w() is correct, should this be ASSERT_LINE? - m_maincpu->set_input_line(m_sndirq_line, HOLD_LINE); -} - - -void truxton2_state::batrider_clear_nmi_w(u8 data) -{ - m_audiocpu->set_input_line(INPUT_LINE_NMI, CLEAR_LINE); -} - - -u16 truxton2_state::bbakraid_eeprom_r() -{ - // Bit 0x01 returns the status of BUSAK from the Z80. - // BUSRQ is activated via bit 0x10 on the EEPROM write port. - // These accesses are made when the 68K wants to read the Z80 - // ROM code. Failure to return the correct status incurrs a Sound Error. - - u8 data; - data = ((m_eeprom->do_read() & 0x01) << 4); - data |= ((m_z80_busreq >> 4) & 0x01); // Loop BUSRQ to BUSAK - - return data; -} - - -void truxton2_state::bbakraid_eeprom_w(u8 data) -{ - if (data & ~0x1f) - logerror("CPU #0 PC:%06X - Unknown EEPROM data being written %02X\n",m_maincpu->pc(),data); - - m_eepromout->write(data, 0xff); - - m_z80_busreq = data & 0x10; // see bbakraid_eeprom_r above -} - - -INTERRUPT_GEN_MEMBER(truxton2_state::bbakraid_snd_interrupt) -{ - device.execute().set_input_line(0, HOLD_LINE); -} - - -void toaplan2_state::tekipaki_68k_mem(address_map &map) -{ - map(0x000000, 0x01ffff).rom(); - map(0x020000, 0x03ffff).rom(); // extra for Whoopee - map(0x080000, 0x082fff).ram(); - map(0x0c0000, 0x0c0fff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); - map(0x140000, 0x14000d).rw(m_vdp[0], FUNC(gp9001vdp_device::read), FUNC(gp9001vdp_device::write)); - map(0x180000, 0x180001).portr("DSWA"); - map(0x180010, 0x180011).portr("DSWB"); - map(0x180020, 0x180021).portr("SYS"); - map(0x180030, 0x180031).portr("JMPR"); // CPU 2 busy and Region Jumper block - map(0x180041, 0x180041).w(FUNC(toaplan2_state::coin_w)); - map(0x180050, 0x180051).portr("IN1"); - map(0x180060, 0x180061).portr("IN2"); - map(0x180071, 0x180071).w(m_soundlatch[0], FUNC(generic_latch_8_device::write)); -} - - -void ghox_state::ghox_68k_mem(address_map &map) -{ - map(0x000000, 0x03ffff).rom(); - map(0x040000, 0x040001).r(FUNC(ghox_state::ghox_h_analog_r<1>)); - map(0x080000, 0x083fff).ram(); - map(0x0c0000, 0x0c0fff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); - map(0x100000, 0x100001).r(FUNC(ghox_state::ghox_h_analog_r<0>)); - map(0x140000, 0x14000d).rw(m_vdp[0], FUNC(gp9001vdp_device::read), FUNC(gp9001vdp_device::write)); - map(0x180000, 0x180fff).rw(FUNC(ghox_state::shared_ram_r), FUNC(ghox_state::shared_ram_w)).umask16(0x00ff); - map(0x181001, 0x181001).w(FUNC(ghox_state::coin_w)); - map(0x18100c, 0x18100d).portr("JMPR"); -} - - -void toaplan2_state::dogyuun_68k_mem(address_map &map) -{ - map(0x000000, 0x07ffff).rom(); - map(0x100000, 0x103fff).ram(); - map(0x200010, 0x200011).portr("IN1"); - map(0x200014, 0x200015).portr("IN2"); - map(0x200018, 0x200019).portr("SYS"); - map(0x20001d, 0x20001d).w(FUNC(toaplan2_state::coin_sound_reset_w)); // Coin count/lock + v25 reset line - map(0x210000, 0x21ffff).rw(FUNC(toaplan2_state::shared_ram_r), FUNC(toaplan2_state::shared_ram_w)).umask16(0x00ff); - map(0x300000, 0x30000d).rw(m_vdp[0], FUNC(gp9001vdp_device::read), FUNC(gp9001vdp_device::write)); - map(0x400000, 0x400fff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); - map(0x500000, 0x50000d).rw(m_vdp[1], FUNC(gp9001vdp_device::read), FUNC(gp9001vdp_device::write)); - map(0x700000, 0x700001).r(FUNC(toaplan2_state::video_count_r)); // test bit 8 -} - - -void toaplan2_state::dogyuunto_68k_mem(address_map &map) -{ - map(0x000000, 0x07ffff).rom(); - map(0x100000, 0x103fff).ram(); - map(0x218000, 0x218fff).rw(FUNC(toaplan2_state::shared_ram_r), FUNC(toaplan2_state::shared_ram_w)).umask16(0x00ff); // reads the same area as the finished game on startup, but then uses only this part - map(0x21c01d, 0x21c01d).w(FUNC(toaplan2_state::coin_sound_reset_w)); // Coin count/lock + Z80 reset line - map(0x21c020, 0x21c021).portr("IN1"); - map(0x21c024, 0x21c025).portr("IN2"); - map(0x21c028, 0x21c029).portr("SYS"); - map(0x21c02c, 0x21c02d).portr("DSWA"); - map(0x21c030, 0x21c031).portr("DSWB"); - map(0x300000, 0x30000d).rw(m_vdp[0], FUNC(gp9001vdp_device::read), FUNC(gp9001vdp_device::write)); - map(0x400000, 0x400fff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); - map(0x500000, 0x50000d).rw(m_vdp[1], FUNC(gp9001vdp_device::read), FUNC(gp9001vdp_device::write)); - map(0x700000, 0x700001).r(FUNC(toaplan2_state::video_count_r)); // test bit 8 -} - - -void toaplan2_state::kbash_68k_mem(address_map &map) -{ - map(0x000000, 0x07ffff).rom(); - map(0x100000, 0x103fff).ram(); - map(0x200000, 0x200fff).rw(FUNC(toaplan2_state::shared_ram_r), FUNC(toaplan2_state::shared_ram_w)).umask16(0x00ff); - map(0x208010, 0x208011).portr("IN1"); - map(0x208014, 0x208015).portr("IN2"); - map(0x208018, 0x208019).portr("SYS"); - map(0x20801d, 0x20801d).w(FUNC(toaplan2_state::coin_w)); - map(0x300000, 0x30000d).rw(m_vdp[0], FUNC(gp9001vdp_device::read), FUNC(gp9001vdp_device::write)); - map(0x400000, 0x400fff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); - map(0x700000, 0x700001).r(FUNC(toaplan2_state::video_count_r)); // test bit 8 -} - - -void toaplan2_state::kbash2_68k_mem(address_map &map) -{ - map(0x000000, 0x07ffff).rom(); - map(0x100000, 0x103fff).ram(); - map(0x104000, 0x10401f).ram(); // Sound related? - map(0x200000, 0x200001).noprw(); // Left over from original code - Sound Number write, Status read - map(0x200002, 0x200003).nopw(); // Left over from original code - Reset Sound - map(0x200004, 0x200005).portr("DSWA"); - map(0x200008, 0x200009).portr("DSWB"); - map(0x20000c, 0x20000d).portr("JMPR"); - map(0x200010, 0x200011).portr("IN1"); - map(0x200014, 0x200015).portr("IN2"); - map(0x200018, 0x200019).portr("SYS"); - map(0x200021, 0x200021).rw(m_oki[1], FUNC(okim6295_device::read), FUNC(okim6295_device::write)); - map(0x200025, 0x200025).rw(m_oki[0], FUNC(okim6295_device::read), FUNC(okim6295_device::write)); - map(0x200029, 0x200029).w(FUNC(toaplan2_state::oki_bankswitch_w<0>)); - map(0x20002c, 0x20002d).r(FUNC(toaplan2_state::video_count_r)); - map(0x300000, 0x30000d).rw(m_vdp[0], FUNC(gp9001vdp_device::read), FUNC(gp9001vdp_device::write)); - map(0x400000, 0x400fff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); -} - - -void truxton2_state::truxton2_68k_mem(address_map &map) -{ - map(0x000000, 0x07ffff).rom(); - map(0x100000, 0x10ffff).ram(); - map(0x200000, 0x20000d).rw(m_vdp[0], FUNC(gp9001vdp_device::read), FUNC(gp9001vdp_device::write)); - map(0x300000, 0x300fff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); - map(0x400000, 0x401fff).ram().w(FUNC(truxton2_state::tx_videoram_w)).share(m_tx_videoram); - map(0x402000, 0x402fff).ram().share(m_tx_lineselect); - map(0x403000, 0x4031ff).ram().w(FUNC(truxton2_state::tx_linescroll_w)).share(m_tx_linescroll); - map(0x403200, 0x403fff).ram(); - map(0x500000, 0x50ffff).ram().w(FUNC(truxton2_state::tx_gfxram_w)).share(m_tx_gfxram); - map(0x600000, 0x600001).r(FUNC(truxton2_state::video_count_r)); - map(0x700000, 0x700001).portr("DSWA"); - map(0x700002, 0x700003).portr("DSWB"); - map(0x700004, 0x700005).portr("JMPR"); - map(0x700006, 0x700007).portr("IN1"); - map(0x700008, 0x700009).portr("IN2"); - map(0x70000a, 0x70000b).portr("SYS"); - map(0x700011, 0x700011).rw(m_oki[0], FUNC(okim6295_device::read), FUNC(okim6295_device::write)); - map(0x700014, 0x700017).rw("ymsnd", FUNC(ym2151_device::read), FUNC(ym2151_device::write)).umask16(0x00ff); - map(0x70001f, 0x70001f).w(FUNC(truxton2_state::coin_w)); -} - - -void toaplan2_state::pipibibs_68k_mem(address_map &map) -{ - map(0x000000, 0x03ffff).rom(); - map(0x080000, 0x082fff).ram(); - map(0x0c0000, 0x0c0fff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); - map(0x140000, 0x14000d).rw(m_vdp[0], FUNC(gp9001vdp_device::read), FUNC(gp9001vdp_device::write)); - map(0x190000, 0x190fff).rw(FUNC(toaplan2_state::shared_ram_r), FUNC(toaplan2_state::shared_ram_w)).umask16(0x00ff); - map(0x19c01d, 0x19c01d).w(FUNC(toaplan2_state::coin_w)); - map(0x19c020, 0x19c021).portr("DSWA"); - map(0x19c024, 0x19c025).portr("DSWB"); - map(0x19c028, 0x19c029).portr("JMPR"); - map(0x19c02c, 0x19c02d).portr("SYS"); - map(0x19c030, 0x19c031).portr("IN1"); - map(0x19c034, 0x19c035).portr("IN2"); -} - -// odd scroll registers -void toaplan2_state::pipibibi_bootleg_68k_mem(address_map &map) -{ - map(0x000000, 0x03ffff).rom(); - map(0x080000, 0x082fff).ram(); - map(0x083000, 0x0837ff).rw(m_vdp[0], FUNC(gp9001vdp_device::bootleg_spriteram16_r), FUNC(gp9001vdp_device::bootleg_spriteram16_w)); // SpriteRAM - map(0x083800, 0x087fff).ram(); // SpriteRAM (unused) - map(0x0c0000, 0x0c0fff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); - map(0x120000, 0x120fff).ram(); // Copy of SpriteRAM ? -// map(0x13f000, 0x13f001).nopw(); // ??? - map(0x180000, 0x182fff).rw(m_vdp[0], FUNC(gp9001vdp_device::bootleg_videoram16_r), FUNC(gp9001vdp_device::bootleg_videoram16_w)); // TileRAM - map(0x188000, 0x18800f).w(m_vdp[0], FUNC(gp9001vdp_device::bootleg_scroll_w)); - map(0x190003, 0x190003).r(FUNC(toaplan2_state::shared_ram_r)); // Z80 ready ? - map(0x190011, 0x190011).w(FUNC(toaplan2_state::shared_ram_w)); // Z80 task to perform - map(0x19c01d, 0x19c01d).w(FUNC(toaplan2_state::coin_w)); - map(0x19c020, 0x19c021).portr("DSWA"); - map(0x19c024, 0x19c025).portr("DSWB"); - map(0x19c028, 0x19c029).portr("JMPR"); - map(0x19c02c, 0x19c02d).portr("SYS"); - map(0x19c030, 0x19c031).portr("IN1"); - map(0x19c034, 0x19c035).portr("IN2"); -} - - -void truxton2_state::fixeight_68k_mem(address_map &map) -{ - map(0x000000, 0x07ffff).rom(); - map(0x100000, 0x103fff).ram(); - map(0x200000, 0x200001).portr("IN1"); - map(0x200004, 0x200005).portr("IN2"); - map(0x200008, 0x200009).portr("IN3"); - map(0x200010, 0x200011).portr("SYS"); - map(0x20001d, 0x20001d).w(FUNC(truxton2_state::coin_w)); - map(0x280000, 0x28ffff).rw(FUNC(truxton2_state::shared_ram_r), FUNC(truxton2_state::shared_ram_w)).umask16(0x00ff); - map(0x300000, 0x30000d).rw(m_vdp[0], FUNC(gp9001vdp_device::read), FUNC(gp9001vdp_device::write)); - map(0x400000, 0x400fff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); - map(0x500000, 0x501fff).ram().w(FUNC(truxton2_state::tx_videoram_w)).share(m_tx_videoram); - map(0x502000, 0x5021ff).ram().share(m_tx_lineselect); - map(0x503000, 0x5031ff).ram().w(FUNC(truxton2_state::tx_linescroll_w)).share(m_tx_linescroll); - map(0x600000, 0x60ffff).ram().w(FUNC(truxton2_state::tx_gfxram_w)).share(m_tx_gfxram); - map(0x700000, 0x700001).w(FUNC(truxton2_state::sound_reset_w)).umask16(0x00ff).cswidth(16); - map(0x800000, 0x800001).r(FUNC(truxton2_state::video_count_r)); -} - - -void truxton2_state::fixeightbl_68k_mem(address_map &map) -{ - map(0x000000, 0x0fffff).rom(); // 0-7ffff ? - map(0x100000, 0x10ffff).ram(); // 100000-107fff 105000-105xxx 106000-106xxx 108000 - related to sound ? - map(0x200000, 0x200001).portr("IN1"); - map(0x200004, 0x200005).portr("IN2"); - map(0x200008, 0x200009).portr("IN3"); - map(0x20000c, 0x20000d).portr("DSWB"); - map(0x200010, 0x200011).portr("SYS"); - map(0x200015, 0x200015).w(FUNC(truxton2_state::fixeightbl_oki_bankswitch_w)); // Sound banking. Code at $4084c, $5070 - map(0x200019, 0x200019).rw(m_oki[0], FUNC(okim6295_device::read), FUNC(okim6295_device::write)); - map(0x20001c, 0x20001d).portr("DSWA"); - map(0x300000, 0x30000d).rw(m_vdp[0], FUNC(gp9001vdp_device::read), FUNC(gp9001vdp_device::write)); - map(0x400000, 0x400fff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); - map(0x500000, 0x501fff).ram().w(FUNC(truxton2_state::tx_videoram_w)).share(m_tx_videoram); - map(0x700000, 0x700001).r(FUNC(truxton2_state::video_count_r)); - map(0x800000, 0x87ffff).rom().region("maincpu", 0x80000); -} - - -void toaplan2_state::vfive_68k_mem(address_map &map) -{ - map(0x000000, 0x07ffff).rom(); - map(0x100000, 0x103fff).ram(); -// map(0x200000, 0x20ffff).noprw(); // Read at startup by broken ROM checksum code - see notes - map(0x200010, 0x200011).portr("IN1"); - map(0x200014, 0x200015).portr("IN2"); - map(0x200018, 0x200019).portr("SYS"); - map(0x20001d, 0x20001d).w(FUNC(toaplan2_state::coin_sound_reset_w)); // Coin count/lock + v25 reset line - map(0x210000, 0x21ffff).rw(FUNC(toaplan2_state::shared_ram_r), FUNC(toaplan2_state::shared_ram_w)).umask16(0x00ff); - map(0x300000, 0x30000d).rw(m_vdp[0], FUNC(gp9001vdp_device::read), FUNC(gp9001vdp_device::write)); - map(0x400000, 0x400fff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); - map(0x700000, 0x700001).r(FUNC(toaplan2_state::video_count_r)); -} - - -void toaplan2_state::batsugun_68k_mem(address_map &map) -{ - map(0x000000, 0x07ffff).rom(); - map(0x100000, 0x10ffff).ram(); - map(0x200010, 0x200011).portr("IN1"); - map(0x200014, 0x200015).portr("IN2"); - map(0x200018, 0x200019).portr("SYS"); - map(0x20001d, 0x20001d).w(FUNC(toaplan2_state::coin_sound_reset_w)); // Coin count/lock + v25 reset line - map(0x210000, 0x21ffff).rw(FUNC(toaplan2_state::shared_ram_r), FUNC(toaplan2_state::shared_ram_w)).umask16(0x00ff); - map(0x300000, 0x30000d).rw(m_vdp[0], FUNC(gp9001vdp_device::read), FUNC(gp9001vdp_device::write)); - map(0x400000, 0x400fff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); - map(0x500000, 0x50000d).rw(m_vdp[1], FUNC(gp9001vdp_device::read), FUNC(gp9001vdp_device::write)); - map(0x700000, 0x700001).r(FUNC(toaplan2_state::video_count_r)); -} - -void toaplan2_state::batsugunbl_68k_mem(address_map &map) -{ - map(0x000000, 0x07ffff).rom(); - map(0x100000, 0x10ffff).ram(); - // map(0x200004, 0x200005).r() // only cleared at boot? - map(0x200005, 0x200005).w(FUNC(toaplan2_state::fixeightbl_oki_bankswitch_w)); // TODO: doesn't sound correct - map(0x200009, 0x200009).rw(m_oki[0], FUNC(okim6295_device::read), FUNC(okim6295_device::write)); - map(0x200010, 0x200011).portr("IN1"); - map(0x200014, 0x200015).portr("IN2"); - map(0x200018, 0x200019).portr("SYS"); - map(0x20001c, 0x20001d).nopw(); // leftover code from the original? - map(0x21f004, 0x21f005).portr("DSWA"); - map(0x21f006, 0x21f007).portr("DSWB"); - map(0x21f008, 0x21f009).portr("JMPR"); - map(0x300000, 0x30000d).rw(m_vdp[0], FUNC(gp9001vdp_device::read), FUNC(gp9001vdp_device::write)); - map(0x400000, 0x400fff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); - map(0x500000, 0x50000d).rw(m_vdp[1], FUNC(gp9001vdp_device::read), FUNC(gp9001vdp_device::write)); - map(0x700000, 0x700001).r(FUNC(toaplan2_state::video_count_r)); -} - -void pwrkick_state::pwrkick_68k_mem(address_map &map) -{ - map(0x000000, 0x07ffff).rom(); - map(0x100000, 0x103fff).ram().share("nvram"); // Only 10022C-10037B is actually saved as NVRAM - map(0x104000, 0x10ffff).ram(); - - map(0x200000, 0x20000f).rw(m_rtc, FUNC(upd4992_device::read), FUNC(upd4992_device::write)).umask16(0x00ff); - map(0x300000, 0x30000d).rw(m_vdp[0], FUNC(gp9001vdp_device::read), FUNC(gp9001vdp_device::write)); - map(0x400000, 0x400fff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); - map(0x600001, 0x600001).rw(m_oki[0], FUNC(okim6295_device::read), FUNC(okim6295_device::write)); - - map(0x700000, 0x700001).r(FUNC(pwrkick_state::video_count_r)); - map(0x700004, 0x700005).portr("DSWA"); - map(0x700008, 0x700009).portr("DSWB"); - map(0x70000c, 0x70000d).portr("IN1"); - map(0x700014, 0x700015).portr("IN2"); - map(0x700018, 0x700019).portr("DSWC"); - map(0x70001c, 0x70001d).portr("SYS"); - map(0x700031, 0x700031).w(FUNC(pwrkick_state::oki_bankswitch_w<0>)); - map(0x700035, 0x700035).w(FUNC(pwrkick_state::pwrkick_coin_w)); - map(0x700039, 0x700039).w(FUNC(pwrkick_state::pwrkick_coin_lockout_w)); -} - -void pwrkick_state::othldrby_68k_mem(address_map &map) -{ - map(0x000000, 0x07ffff).rom(); - map(0x100000, 0x103fff).ram().share("nvram"); // Only 10331E-103401 is actually saved as NVRAM - map(0x104000, 0x10ffff).ram(); - - map(0x200000, 0x20000f).rw(m_rtc, FUNC(upd4992_device::read), FUNC(upd4992_device::write)).umask16(0x00ff); - map(0x300000, 0x30000d).rw(m_vdp[0], FUNC(gp9001vdp_device::read), FUNC(gp9001vdp_device::write)); - map(0x400000, 0x400fff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); - map(0x600001, 0x600001).rw(m_oki[0], FUNC(okim6295_device::read), FUNC(okim6295_device::write)); - - map(0x700000, 0x700001).r(FUNC(pwrkick_state::video_count_r)); - map(0x700004, 0x700005).portr("DSWA"); - map(0x700008, 0x700009).portr("DSWB"); - map(0x70000c, 0x70000d).portr("IN1"); - map(0x700010, 0x700011).portr("IN2"); - map(0x70001c, 0x70001d).portr("SYS"); - map(0x700031, 0x700031).w(FUNC(pwrkick_state::oki_bankswitch_w<0>)); - map(0x700035, 0x700035).w(FUNC(pwrkick_state::coin_w)); -} - - -void toaplan2_state::enmadaio_oki_bank_w(offs_t offset, u16 data, u16 mem_mask) -{ - data &= mem_mask; - - if (data < 0x60) - { - m_okibank->set_entry(data); - } - else - { - logerror("enmadaio_oki_bank_w >=0x60 (%04x)\n",data); - } -} - -void toaplan2_state::enmadaio_68k_mem(address_map &map) -{ - map(0x000000, 0x07ffff).rom(); - map(0x100000, 0x103fff).ram(); //.share("nvram"); - map(0x104000, 0x10ffff).ram(); - - map(0x200000, 0x20000d).rw(m_vdp[0], FUNC(gp9001vdp_device::read), FUNC(gp9001vdp_device::write)); - map(0x300000, 0x300fff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); - map(0x400000, 0x400003).rw("ymsnd", FUNC(ym2151_device::read), FUNC(ym2151_device::write)).umask16(0x00ff); - map(0x500001, 0x500001).rw(m_oki[0], FUNC(okim6295_device::read), FUNC(okim6295_device::write)); - - map(0x700000, 0x700001).r(FUNC(toaplan2_state::video_count_r)); - - map(0x700004, 0x700005).portr("DSWA"); - map(0x70000c, 0x70000d).portr("MISC2"); - map(0x700010, 0x700011).portr("MISC3"); - map(0x700014, 0x700015).portr("MISC4"); - map(0x700018, 0x700019).portr("SYS"); - map(0x70001c, 0x70001d).portr("UNK"); //.portr("SYS"); - - map(0x700020, 0x700021).w(FUNC(toaplan2_state::enmadaio_oki_bank_w)); // oki bank - - map(0x700028, 0x700029).nopw(); - map(0x70003c, 0x70003d).nopw(); - map(0x70002c, 0x70002d).nopw(); -} - -void toaplan2_state::snowbro2_68k_mem(address_map &map) -{ - map(0x000000, 0x07ffff).rom(); - map(0x100000, 0x10ffff).ram(); - map(0x300000, 0x30000d).rw(m_vdp[0], FUNC(gp9001vdp_device::read), FUNC(gp9001vdp_device::write)); - map(0x400000, 0x400fff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); - map(0x500000, 0x500003).rw("ymsnd", FUNC(ym2151_device::read), FUNC(ym2151_device::write)).umask16(0x00ff); - map(0x600001, 0x600001).rw(m_oki[0], FUNC(okim6295_device::read), FUNC(okim6295_device::write)); - map(0x700000, 0x700001).portr("JMPR"); - map(0x700004, 0x700005).portr("DSWA"); - map(0x700008, 0x700009).portr("DSWB"); - map(0x70000c, 0x70000d).portr("IN1"); - map(0x700010, 0x700011).portr("IN2"); - map(0x700014, 0x700015).portr("IN3"); - map(0x700018, 0x700019).portr("IN4"); - map(0x70001c, 0x70001d).portr("SYS"); - map(0x700031, 0x700031).w(FUNC(toaplan2_state::oki_bankswitch_w<0>)); - map(0x700035, 0x700035).w(FUNC(toaplan2_state::coin_w)); -} - -void toaplan2_state::snowbro2b3_68k_mem(address_map &map) -{ - map(0x000000, 0x07ffff).rom(); - map(0x100000, 0x10ffff).ram(); - map(0x404000, 0x404fff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); - map(0x500000, 0x500003).rw("ymsnd", FUNC(ym2151_device::read), FUNC(ym2151_device::write)).umask16(0x00ff); - map(0x600001, 0x600001).rw(m_oki[0], FUNC(okim6295_device::read), FUNC(okim6295_device::write)); - map(0x700004, 0x700005).portr("DSWA"); - map(0x700008, 0x700009).portr("DSWB"); - map(0x70000c, 0x70000d).portr("IN1"); - map(0x700010, 0x700011).portr("IN2"); - map(0x700014, 0x700015).portr("IN3"); - map(0x700018, 0x700019).portr("IN4"); - map(0x700035, 0x700035).w(FUNC(toaplan2_state::coin_w)); - map(0x700041, 0x700041).w(FUNC(toaplan2_state::oki_bankswitch_w<0>)); - map(0xff0000, 0xff2fff).rw(m_vdp[0], FUNC(gp9001vdp_device::bootleg_videoram16_r), FUNC(gp9001vdp_device::bootleg_videoram16_w)); - map(0xff3000, 0xff37ff).rw(m_vdp[0], FUNC(gp9001vdp_device::bootleg_spriteram16_r), FUNC(gp9001vdp_device::bootleg_spriteram16_w)); - map(0xff8000, 0xff800f).w(m_vdp[0], FUNC(gp9001vdp_device::bootleg_scroll_w)); -} - - -void truxton2_state::mahoudai_68k_mem(address_map &map) -{ - map(0x000000, 0x07ffff).rom(); - map(0x100000, 0x10ffff).ram(); - map(0x218000, 0x21bfff).rw(FUNC(truxton2_state::shared_ram_r), FUNC(truxton2_state::shared_ram_w)).umask16(0x00ff); - map(0x21c01d, 0x21c01d).w(FUNC(truxton2_state::coin_w)); - map(0x21c020, 0x21c021).portr("IN1"); - map(0x21c024, 0x21c025).portr("IN2"); - map(0x21c028, 0x21c029).portr("SYS"); - map(0x21c02c, 0x21c02d).portr("DSWA"); - map(0x21c030, 0x21c031).portr("DSWB"); - map(0x21c034, 0x21c035).portr("JMPR"); - map(0x21c03c, 0x21c03d).r(FUNC(truxton2_state::video_count_r)); - map(0x300000, 0x30000d).rw(m_vdp[0], FUNC(gp9001vdp_device::read), FUNC(gp9001vdp_device::write)); - map(0x400000, 0x400fff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); - map(0x401000, 0x4017ff).ram(); // Unused palette RAM - map(0x500000, 0x501fff).ram().w(FUNC(truxton2_state::tx_videoram_w)).share(m_tx_videoram); - map(0x502000, 0x502fff).ram().share(m_tx_lineselect); - map(0x503000, 0x5031ff).ram().w(FUNC(truxton2_state::tx_linescroll_w)).share(m_tx_linescroll); - map(0x503200, 0x503fff).ram(); -} - - -void truxton2_state::shippumd_68k_mem(address_map &map) -{ - map(0x000000, 0x0fffff).rom(); - map(0x100000, 0x10ffff).ram(); - map(0x218000, 0x21bfff).rw(FUNC(truxton2_state::shared_ram_r), FUNC(truxton2_state::shared_ram_w)).umask16(0x00ff); -// map(0x21c008, 0x21c009).nopw(); // ??? - map(0x21c01d, 0x21c01d).w(FUNC(truxton2_state::shippumd_coin_w)); // Coin count/lock + oki bankswitch - map(0x21c020, 0x21c021).portr("IN1"); - map(0x21c024, 0x21c025).portr("IN2"); - map(0x21c028, 0x21c029).portr("SYS"); - map(0x21c02c, 0x21c02d).portr("DSWA"); - map(0x21c030, 0x21c031).portr("DSWB"); - map(0x21c034, 0x21c035).portr("JMPR"); - map(0x21c03c, 0x21c03d).r(FUNC(truxton2_state::video_count_r)); - map(0x300000, 0x30000d).rw(m_vdp[0], FUNC(gp9001vdp_device::read), FUNC(gp9001vdp_device::write)); - map(0x400000, 0x400fff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); - map(0x401000, 0x4017ff).ram(); // Unused palette RAM - map(0x500000, 0x501fff).ram().w(FUNC(truxton2_state::tx_videoram_w)).share(m_tx_videoram); - map(0x502000, 0x502fff).ram().share(m_tx_lineselect); - map(0x503000, 0x5031ff).ram().w(FUNC(truxton2_state::tx_linescroll_w)).share(m_tx_linescroll); - map(0x503200, 0x503fff).ram(); -} - - -void truxton2_state::bgaregga_68k_mem(address_map &map) -{ - map(0x000000, 0x0fffff).rom(); - map(0x100000, 0x10ffff).ram(); - map(0x218000, 0x21bfff).rw(FUNC(truxton2_state::shared_ram_r), FUNC(truxton2_state::shared_ram_w)).umask16(0x00ff); - map(0x21c01d, 0x21c01d).w(FUNC(truxton2_state::coin_w)); - map(0x21c020, 0x21c021).portr("IN1"); - map(0x21c024, 0x21c025).portr("IN2"); - map(0x21c028, 0x21c029).portr("SYS"); - map(0x21c02c, 0x21c02d).portr("DSWA"); - map(0x21c030, 0x21c031).portr("DSWB"); - map(0x21c034, 0x21c035).portr("JMPR"); - map(0x21c03c, 0x21c03d).r(FUNC(truxton2_state::video_count_r)); - map(0x300000, 0x30000d).rw(m_vdp[0], FUNC(gp9001vdp_device::read), FUNC(gp9001vdp_device::write)); - map(0x400000, 0x400fff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); - map(0x500000, 0x501fff).ram().w(FUNC(truxton2_state::tx_videoram_w)).share(m_tx_videoram); - map(0x502000, 0x502fff).ram().share(m_tx_lineselect); - map(0x503000, 0x5031ff).ram().w(FUNC(truxton2_state::tx_linescroll_w)).share(m_tx_linescroll); - map(0x503200, 0x503fff).ram(); - map(0x600001, 0x600001).w(m_soundlatch[0], FUNC(generic_latch_8_device::write)); -} - - -void truxton2_state::batrider_dma_mem(address_map &map) -{ - map(0x0000, 0x1fff).ram().w(FUNC(truxton2_state::tx_videoram_w)).share(m_tx_videoram); - map(0x2000, 0x2fff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); - map(0x3000, 0x31ff).ram().share(m_tx_lineselect); - map(0x3200, 0x33ff).ram().w(FUNC(truxton2_state::tx_linescroll_w)).share(m_tx_linescroll); - map(0x3400, 0x7fff).ram(); - map(0x8000, 0xffff).ram().w(FUNC(truxton2_state::batrider_tx_gfxram_w)).share(m_tx_gfxram); -} - - -void truxton2_state::batrider_68k_mem(address_map &map) -{ - map(0x000000, 0x1fffff).rom(); - // actually 200000 - 20ffff is probably all main RAM, and the text and palette RAM are written via DMA - map(0x200000, 0x207fff).ram().share(m_mainram); - map(0x208000, 0x20ffff).ram(); - map(0x300000, 0x37ffff).r(FUNC(truxton2_state::batrider_z80rom_r)); - map(0x400000, 0x40000d).lrw16( - NAME([this](offs_t offset, u16 mem_mask) { return m_vdp[0]->read(offset ^ (0xc/2), mem_mask); }), - NAME([this](offs_t offset, u16 data, u16 mem_mask) { m_vdp[0]->write(offset ^ (0xc/2), data, mem_mask); })); - map(0x500000, 0x500001).portr("IN"); - map(0x500002, 0x500003).portr("SYS-DSW"); - map(0x500004, 0x500005).portr("DSW"); - map(0x500006, 0x500007).r(FUNC(truxton2_state::video_count_r)); - map(0x500009, 0x500009).r(m_soundlatch[2], FUNC(generic_latch_8_device::read)); - map(0x50000b, 0x50000b).r(m_soundlatch[3], FUNC(generic_latch_8_device::read)); - map(0x50000c, 0x50000d).r(FUNC(truxton2_state::batrider_z80_busack_r)); - map(0x500011, 0x500011).w(FUNC(truxton2_state::coin_w)); - map(0x500021, 0x500021).w(FUNC(truxton2_state::batrider_soundlatch_w)); - map(0x500023, 0x500023).w(FUNC(truxton2_state::batrider_soundlatch2_w)); - map(0x500024, 0x500025).w(FUNC(truxton2_state::batrider_unknown_sound_w)); - map(0x500026, 0x500027).w(FUNC(truxton2_state::batrider_clear_sndirq_w)); - map(0x500061, 0x500061).w(FUNC(truxton2_state::batrider_z80_busreq_w)); - map(0x500080, 0x500081).w(FUNC(truxton2_state::batrider_textdata_dma_w)); - map(0x500082, 0x500083).w(FUNC(truxton2_state::batrider_pal_text_dma_w)); - map(0x5000c0, 0x5000cf).w(FUNC(truxton2_state::batrider_objectbank_w)).umask16(0x00ff); -} - - -void truxton2_state::bbakraid_68k_mem(address_map &map) -{ - map(0x000000, 0x1fffff).rom(); - // actually 200000 - 20ffff is probably all main RAM, and the text and palette RAM are written via DMA - map(0x200000, 0x207fff).ram().share(m_mainram); - map(0x208000, 0x20ffff).ram(); - map(0x300000, 0x33ffff).r(FUNC(truxton2_state::batrider_z80rom_r)); - map(0x400000, 0x40000d).lrw16( - NAME([this](offs_t offset, u16 mem_mask) { return m_vdp[0]->read(offset ^ (0xc/2), mem_mask); }), - NAME([this](offs_t offset, u16 data, u16 mem_mask) { m_vdp[0]->write(offset ^ (0xc/2), data, mem_mask); })); - map(0x500000, 0x500001).portr("IN"); - map(0x500002, 0x500003).portr("SYS-DSW"); - map(0x500004, 0x500005).portr("DSW"); - map(0x500006, 0x500007).r(FUNC(truxton2_state::video_count_r)); - map(0x500009, 0x500009).w(FUNC(truxton2_state::coin_w)); - map(0x500011, 0x500011).r(m_soundlatch[2], FUNC(generic_latch_8_device::read)); - map(0x500013, 0x500013).r(m_soundlatch[3], FUNC(generic_latch_8_device::read)); - map(0x500015, 0x500015).w(FUNC(truxton2_state::batrider_soundlatch_w)); - map(0x500017, 0x500017).w(FUNC(truxton2_state::batrider_soundlatch2_w)); - map(0x500018, 0x500019).r(FUNC(truxton2_state::bbakraid_eeprom_r)); - map(0x50001a, 0x50001b).w(FUNC(truxton2_state::batrider_unknown_sound_w)); - map(0x50001c, 0x50001d).w(FUNC(truxton2_state::batrider_clear_sndirq_w)); - map(0x50001f, 0x50001f).w(FUNC(truxton2_state::bbakraid_eeprom_w)); - map(0x500080, 0x500081).w(FUNC(truxton2_state::batrider_textdata_dma_w)); - map(0x500082, 0x500083).w(FUNC(truxton2_state::batrider_pal_text_dma_w)); - map(0x5000c0, 0x5000cf).w(FUNC(truxton2_state::batrider_objectbank_w)).umask16(0x00ff); -} - - -void truxton2_state::nprobowl_68k_mem(address_map &map) // TODO: verify everything, implement oki banking -{ - map(0x000000, 0x0fffff).rom(); - map(0x200000, 0x207fff).ram().share(m_mainram); - map(0x208000, 0x20ffff).ram(); - map(0x400000, 0x40000d).lrw16( - NAME([this](offs_t offset, u16 mem_mask) { return m_vdp[0]->read(offset ^ (0xc/2), mem_mask); }), - NAME([this](offs_t offset, u16 data, u16 mem_mask) { m_vdp[0]->write(offset ^ (0xc/2), data, mem_mask); })); - map(0x500000, 0x500001).portr("IN"); - map(0x500002, 0x500003).portr("UNK"); - map(0x500004, 0x500005).portr("DSW"); - //map(0x500010, 0x500011).w(); - //map(0x500012, 0x500013).w(); - map(0x500021, 0x500021).w(m_oki[0], FUNC(okim6295_device::write)); - //map(0x500040, 0x500041).w(); - //map(0x500042, 0x500043).w(); - map(0x500060, 0x500061).lr16(NAME([this] () -> u16 { return machine().rand(); })); // TODO: Hack, probably checks something in the mechanical part, verify - map(0x500080, 0x500081).w(FUNC(truxton2_state::batrider_textdata_dma_w)); - map(0x500082, 0x500083).w(FUNC(truxton2_state::batrider_pal_text_dma_w)); -} - - -void toaplan2_state::pipibibs_sound_z80_mem(address_map &map) -{ - map(0x0000, 0x7fff).rom(); - map(0x8000, 0x87ff).ram().share(m_shared_ram); - map(0xe000, 0xe001).rw("ymsnd", FUNC(ym3812_device::read), FUNC(ym3812_device::write)); -} - - -void truxton2_state::raizing_sound_z80_mem(address_map &map) -{ - map(0x0000, 0xbfff).rom(); - map(0xc000, 0xdfff).ram().share(m_shared_ram); - map(0xe000, 0xe001).rw("ymsnd", FUNC(ym2151_device::read), FUNC(ym2151_device::write)); - map(0xe004, 0xe004).rw(m_oki[0], FUNC(okim6295_device::read), FUNC(okim6295_device::write)); - map(0xe00e, 0xe00e).w(FUNC(truxton2_state::coin_w)); -} - - -void truxton2_state::bgaregga_sound_z80_mem(address_map &map) -{ - map(0x0000, 0x7fff).rom(); - map(0x8000, 0xbfff).bankr(m_audiobank); - map(0xc000, 0xdfff).ram().share(m_shared_ram); - map(0xe000, 0xe001).rw("ymsnd", FUNC(ym2151_device::read), FUNC(ym2151_device::write)); - map(0xe004, 0xe004).rw(m_oki[0], FUNC(okim6295_device::read), FUNC(okim6295_device::write)); - map(0xe006, 0xe008).w(FUNC(truxton2_state::raizing_oki_bankswitch_w)); - map(0xe00a, 0xe00a).w(FUNC(truxton2_state::raizing_z80_bankswitch_w)); - map(0xe00c, 0xe00c).w(m_soundlatch[0], FUNC(generic_latch_8_device::acknowledge_w)); - map(0xe01c, 0xe01c).r(m_soundlatch[0], FUNC(generic_latch_8_device::read)); - map(0xe01d, 0xe01d).r(FUNC(truxton2_state::bgaregga_E01D_r)); -} - - -void truxton2_state::batrider_sound_z80_mem(address_map &map) -{ - map(0x0000, 0x7fff).rom(); - map(0x8000, 0xbfff).bankr(m_audiobank); - map(0xc000, 0xdfff).ram(); -} - - -void truxton2_state::batrider_sound_z80_port(address_map &map) -{ - map.global_mask(0xff); - map(0x40, 0x40).w(m_soundlatch[2], FUNC(generic_latch_8_device::write)); - map(0x42, 0x42).w(m_soundlatch[3], FUNC(generic_latch_8_device::write)); - map(0x44, 0x44).w(FUNC(truxton2_state::batrider_sndirq_w)); - map(0x46, 0x46).w(FUNC(truxton2_state::batrider_clear_nmi_w)); - map(0x48, 0x48).r(m_soundlatch[0], FUNC(generic_latch_8_device::read)); - map(0x4a, 0x4a).r(m_soundlatch[1], FUNC(generic_latch_8_device::read)); - map(0x80, 0x81).rw("ymsnd", FUNC(ym2151_device::read), FUNC(ym2151_device::write)); - map(0x82, 0x82).rw(m_oki[0], FUNC(okim6295_device::read), FUNC(okim6295_device::write)); - map(0x84, 0x84).rw(m_oki[1], FUNC(okim6295_device::read), FUNC(okim6295_device::write)); - map(0x88, 0x88).w(FUNC(truxton2_state::raizing_z80_bankswitch_w)); - map(0xc0, 0xc6).w(FUNC(truxton2_state::raizing_oki_bankswitch_w)); -} - - -void truxton2_state::bbakraid_sound_z80_mem(address_map &map) -{ - map(0x0000, 0xbfff).rom(); // No banking? ROM only contains code and data up to 0x28DC - map(0xc000, 0xffff).ram(); -} - - -void truxton2_state::bbakraid_sound_z80_port(address_map &map) -{ - map.global_mask(0xff); - map(0x40, 0x40).w(m_soundlatch[2], FUNC(generic_latch_8_device::write)); - map(0x42, 0x42).w(m_soundlatch[3], FUNC(generic_latch_8_device::write)); - map(0x44, 0x44).w(FUNC(truxton2_state::batrider_sndirq_w)); - map(0x46, 0x46).w(FUNC(truxton2_state::batrider_clear_nmi_w)); - map(0x48, 0x48).r(m_soundlatch[0], FUNC(generic_latch_8_device::read)); - map(0x4a, 0x4a).r(m_soundlatch[1], FUNC(generic_latch_8_device::read)); - map(0x80, 0x81).rw("ymz", FUNC(ymz280b_device::read), FUNC(ymz280b_device::write)); -} - - -void toaplan2_state::dogyuunto_sound_z80_mem(address_map &map) -{ - map(0x0000, 0x7fff).rom(); - map(0xc000, 0xc7ff).ram().share(m_shared_ram); - map(0xe000, 0xe001).rw("ymsnd", FUNC(ym2151_device::read), FUNC(ym2151_device::write)); - map(0xe004, 0xe004).rw(m_oki[0], FUNC(okim6295_device::read), FUNC(okim6295_device::write)); -} - - -void toaplan2_state::v25_mem(address_map &map) -{ - map(0x00000, 0x00001).rw("ymsnd", FUNC(ym2151_device::read), FUNC(ym2151_device::write)); - map(0x00004, 0x00004).rw(m_oki[0], FUNC(okim6295_device::read), FUNC(okim6295_device::write)); - map(0x80000, 0x87fff).mirror(0x78000).ram().share(m_shared_ram); -} - - -void toaplan2_state::kbash_v25_mem(address_map &map) -{ - map(0x00000, 0x007ff).ram().share(m_shared_ram); - map(0x04000, 0x04001).rw("ymsnd", FUNC(ym2151_device::read), FUNC(ym2151_device::write)); - map(0x04002, 0x04002).rw(m_oki[0], FUNC(okim6295_device::read), FUNC(okim6295_device::write)); - map(0x80000, 0x87fff).mirror(0x78000).rom().region("audiocpu", 0); -} - - -void truxton2_state::fixeight_v25_mem(address_map &map) -{ - map(0x00000, 0x00000).portr("IN1"); - map(0x00002, 0x00002).portr("IN2"); - map(0x00004, 0x00004).portr("IN3"); - map(0x0000a, 0x0000b).rw("ymsnd", FUNC(ym2151_device::read), FUNC(ym2151_device::write)); - map(0x0000c, 0x0000c).rw(m_oki[0], FUNC(okim6295_device::read), FUNC(okim6295_device::write)); - map(0x80000, 0x87fff).mirror(0x78000).ram().share(m_shared_ram); -} - - -void toaplan2_state::vfive_v25_mem(address_map &map) -{ - map(0x00000, 0x00001).rw("ymsnd", FUNC(ym2151_device::read), FUNC(ym2151_device::write)); - map(0x80000, 0x87fff).mirror(0x78000).ram().share(m_shared_ram); -} - - -void toaplan2_state::fixeightbl_oki(address_map &map) -{ - map(0x00000, 0x2ffff).rom(); - map(0x30000, 0x3ffff).bankr(m_okibank); -} - -void toaplan2_state::enmadaio_oki(address_map &map) -{ - map(0x00000, 0x3ffff).bankr(m_okibank); -} - -// similar as NMK112, but GAL-driven; NOT actual NMK112 is present -template -void truxton2_state::raizing_oki(address_map &map) -{ - map(0x00000, 0x000ff).bankr(m_raizing_okibank[Chip][0]); - map(0x00100, 0x001ff).bankr(m_raizing_okibank[Chip][1]); - map(0x00200, 0x002ff).bankr(m_raizing_okibank[Chip][2]); - map(0x00300, 0x003ff).bankr(m_raizing_okibank[Chip][3]); - map(0x00400, 0x0ffff).bankr(m_raizing_okibank[Chip][4]); - map(0x10000, 0x1ffff).bankr(m_raizing_okibank[Chip][5]); - map(0x20000, 0x2ffff).bankr(m_raizing_okibank[Chip][6]); - map(0x30000, 0x3ffff).bankr(m_raizing_okibank[Chip][7]); -} - - -u8 toaplan2_state::tekipaki_cmdavailable_r() -{ - if (m_soundlatch[0]->pending_r()) return 0xff; - else return 0x00; -}; - -void toaplan2_state::hd647180_io_map(address_map &map) -{ - map.global_mask(0xff); - - map(0x60, 0x60).nopr(); - map(0x70, 0x75).nopw(); // DDRs are written with the wrong upper addresses! - map(0x84, 0x84).r(m_soundlatch[0], FUNC(generic_latch_8_device::read)); - - map(0x82, 0x82).rw("ymsnd", FUNC(ym3812_device::status_r), FUNC(ym3812_device::address_w)); - map(0x83, 0x83).w("ymsnd", FUNC(ym3812_device::data_w)); -} - - -void ghox_state::ghox_hd647180_mem_map(address_map &map) -{ - map(0x40000, 0x407ff).ram().share(m_shared_ram); - - map(0x80002, 0x80002).portr("DSWA"); - map(0x80004, 0x80004).portr("DSWB"); - map(0x80006, 0x80006).nopr(); // nothing? - map(0x80008, 0x80008).portr("IN1"); - map(0x8000a, 0x8000a).portr("IN2"); - - map(0x8000c, 0x8000e).portr("SYS"); - - map(0x8000e, 0x8000f).rw("ymsnd", FUNC(ym2151_device::read), FUNC(ym2151_device::write)); -} - -/***************************************************************************** - Input Port definitions - The following commands are available when the Invulnerability dipswitch - is set (or, in some games, also when the JAMMA Test switch is pressed): - - P2 start : pause - P1 start : resume - Hold P1 start & P2 start : slow motion - - In bgaregga, batrider and bbakraid, the commands are different: - - Tap P1 start : pause/resume - Hold P1 start : slow motion - - Additional per-game test features are as follows: - - truxton2 - While playing in invulnerable mode, press button 3 to suicide. - - fixeight - While playing in invulnerable mode, press button 3 to suicide - (player 1 and player 2 only) - - batsugun - While playing in invulnerable mode, press the following buttons - to stage skip: - - P2 button 3 & P2 button 1 : Skip to end of stage 1 - P2 button 3 & P2 button 2 : Skip to end of stage 2 - P2 button 3 : Skip to end of stage 3 - - sstriker - While playing in invulnerable mode as player 2, press - /kingdmgp P2 button 3 to skip to the end of the current stage. - - bgaregga - Press and hold P1 button 1, P1 button 2 and P1 button 3 while - powering on in service mode to enter the special service mode. - "OPTIONS" and "PLAY DATAS" are added to the menu, and the - dipswitch display will show the region jumpers (normally hidden). - Choose "GAME MODE" from the special service mode to enter the - special game mode. In the special game mode, you can use pause - and slow motion even when not playing in invulnerable mode. - - batrider - While playing in invulnerable mode, press P1 Start and P2 Start - to skip directly to the ending scene. - - batrider - Press and hold P1 button 1, P1 button 2 and P1 button 3 while - /bbakraid powering on in service mode to enter the special service mode. - You can change the game's region by pressing left/right. - Choose "GAME MODE" from the special service mode to enter the - special game mode. In the special game mode, you can use pause - and slow motion even when not playing in invulnerable mode. - While the game is paused in special mode, press button 3 to - display debugging information. - -*****************************************************************************/ - - -static INPUT_PORTS_START( toaplan2_2b ) - PORT_START("IN1") - TOAPLAN_JOY_UDLR_2_BUTTONS( 1 ) - - PORT_START("IN2") - TOAPLAN_JOY_UDLR_2_BUTTONS( 2 ) - - PORT_START("SYS") - PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_SERVICE1 ) - PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_TILT ) - TOAPLAN_TEST_SWITCH( 0x04, IP_ACTIVE_HIGH ) - PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_COIN1 ) - PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_COIN2 ) - PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_START1 ) - PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_START2 ) - PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_UNKNOWN ) - - PORT_START("DSWA") - TOAPLAN_MACHINE_NO_COCKTAIL_LOC(SW1) - // Coinage on bit mask 0x00f0 - PORT_BIT( 0x00f0, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // Modified below - - PORT_START("DSWB") - TOAPLAN_DIFFICULTY_LOC(SW2) - // Per-game features on bit mask 0x00fc - PORT_BIT( 0x00fc, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // Modified below -INPUT_PORTS_END - - -static INPUT_PORTS_START( toaplan2_3b ) - PORT_INCLUDE( toaplan2_2b ) - - PORT_MODIFY("IN1") - TOAPLAN_JOY_UDLR_3_BUTTONS( 1 ) - - PORT_MODIFY("IN2") - TOAPLAN_JOY_UDLR_3_BUTTONS( 2 ) -INPUT_PORTS_END - - -static INPUT_PORTS_START( tekipaki ) - PORT_INCLUDE( toaplan2_2b ) - - PORT_MODIFY("DSWA") - // Various features on bit mask 0x000f - see above - TOAPLAN_COINAGE_DUAL_LOC( JMPR, 0x0f, 0x02, SW1 ) - - PORT_MODIFY("DSWB") - // Difficulty on bit mask 0x0003 - see above - // "Stop Mode" corresponds to "Invulnerability" in the other games - // (i.e. it enables pause and slow motion) - PORT_DIPNAME( 0x0004, 0x0000, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW2:!3") - PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0004, DEF_STR( On ) ) - PORT_DIPNAME( 0x0008, 0x0000, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW2:!4") - PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0008, DEF_STR( On ) ) - PORT_DIPNAME( 0x0010, 0x0000, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW2:!5") - PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0010, DEF_STR( On ) ) - PORT_DIPNAME( 0x0020, 0x0000, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW2:!6") - PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0020, DEF_STR( On ) ) - PORT_DIPNAME( 0x0040, 0x0000, "Stop Mode (Cheat)" ) PORT_DIPLOCATION("SW2:!7") - PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0040, DEF_STR( On ) ) - PORT_DIPNAME( 0x0080, 0x0000, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW2:!8") - PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0080, DEF_STR( On ) ) - - PORT_START("JMPR") - PORT_CONFNAME( 0x000f, 0x0002, DEF_STR( Region ) ) PORT_DIPLOCATION("JP:!4,!3,!2,!1") - PORT_CONFSETTING( 0x0002, DEF_STR( Europe ) ) - PORT_CONFSETTING( 0x0001, DEF_STR( USA ) ) - PORT_CONFSETTING( 0x0000, DEF_STR( Japan ) ) - PORT_CONFSETTING( 0x0003, DEF_STR( Hong_Kong ) ) - PORT_CONFSETTING( 0x0004, DEF_STR( Korea ) ) - PORT_CONFSETTING( 0x0005, DEF_STR( Taiwan ) ) - PORT_CONFSETTING( 0x0006, "Taiwan (Spacy Co., Ltd." ) - PORT_CONFSETTING( 0x0007, "USA (Romstar, Inc.)" ) - PORT_CONFSETTING( 0x0008, "Hong Kong (Honest Trading Co.)" ) -// PORT_CONFSETTING( 0x0009, DEF_STR( Japan ) ) // English title screen -// PORT_CONFSETTING( 0x000a, DEF_STR( Japan ) ) -// PORT_CONFSETTING( 0x000b, DEF_STR( Japan ) ) -// PORT_CONFSETTING( 0x000c, DEF_STR( Japan ) ) -// PORT_CONFSETTING( 0x000d, DEF_STR( Japan ) ) -// PORT_CONFSETTING( 0x000e, DEF_STR( Japan ) ) - PORT_CONFSETTING( 0x000f, "Japan (Distributed by Tecmo)" ) - PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(FUNC(toaplan2_state::c2map_r)) -INPUT_PORTS_END - - -static INPUT_PORTS_START( ghox ) - PORT_INCLUDE( toaplan2_2b ) - - PORT_MODIFY("DSWA") - // Various features on bit mask 0x000f - see above - TOAPLAN_COINAGE_DUAL_LOC( JMPR, 0x80000, 0x80000, SW1 ) - - PORT_MODIFY("DSWB") - // Difficulty on bit mask 0x0003 - see above - // "Debug Mode" corresponds to "Invulnerability" in the other games - // (i.e. it enables pause and slow motion) - PORT_DIPNAME( 0x000c, 0x0000, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW2:!3,!4") - PORT_DIPSETTING( 0x000c, DEF_STR( None ) ) - PORT_DIPSETTING( 0x0008, "100k only" ) - PORT_DIPSETTING( 0x0004, "100k and 300k" ) - PORT_DIPSETTING( 0x0000, "100k and every 200k" ) - PORT_DIPNAME( 0x0030, 0x0000, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:!5,!6") - PORT_DIPSETTING( 0x0030, "1" ) - PORT_DIPSETTING( 0x0020, "2" ) - PORT_DIPSETTING( 0x0000, "3" ) - PORT_DIPSETTING( 0x0010, "5" ) - PORT_DIPNAME( 0x0040, 0x0000, "Debug Mode (Cheat)" ) PORT_DIPLOCATION("SW2:!7") - PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0040, DEF_STR( On ) ) - PORT_DIPNAME( 0x0080, 0x0000, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW2:!8") - PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0080, DEF_STR( On ) ) - - PORT_START("JMPR") - // Bit Mask 0x80000 is used here to signify European Coinage for MAME purposes - not read on the real board! - PORT_CONFNAME( 0x8000f, 0x80002, DEF_STR( Region ) ) //PORT_CONFLOCATION("JP:!4,!3,!2,!1,FAKE:!1") - PORT_CONFSETTING( 0x80002, DEF_STR( Europe ) ) - PORT_CONFSETTING( 0x00001, DEF_STR( USA ) ) - PORT_CONFSETTING( 0x00000, DEF_STR( Japan ) ) - PORT_CONFSETTING( 0x00003, "Hong Kong (Honest Trading Co.)" ) - PORT_CONFSETTING( 0x00004, DEF_STR( Korea ) ) - PORT_CONFSETTING( 0x00005, DEF_STR( Taiwan ) ) - PORT_CONFSETTING( 0x80006, "Spain & Portugal (APM Electronics S.A.)" ) - PORT_CONFSETTING( 0x80007, "Italy (Star Electronica SRL)" ) - PORT_CONFSETTING( 0x80008, "UK (JP Leisure Limited)" ) - PORT_CONFSETTING( 0x00009, "USA (Romstar, Inc.)" ) - PORT_CONFSETTING( 0x8000a, "Europe (Nova Apparate GMBH & Co.)" ) - PORT_CONFSETTING( 0x0000b, "USA (Taito America Corporation)" ) - PORT_CONFSETTING( 0x0000c, "USA (Taito Corporation Japan)" ) - PORT_CONFSETTING( 0x8000d, "Europe (Taito Corporation Japan)" ) - PORT_CONFSETTING( 0x0000e, "Japan (Licensed to [blank])" ) // English title screen - PORT_CONFSETTING( 0x0000f, "Japan (Taito Corporation)" ) - - PORT_START("PAD1") /* Paddle 1 (left-right) read at $100000 */ - PORT_BIT( 0xff, 0x00, IPT_DIAL ) PORT_SENSITIVITY(25) PORT_KEYDELTA(15) PORT_PLAYER(1) - PORT_BIT( 0xff00, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // Unknown/Unused - - PORT_START("PAD2") /* Paddle 2 (left-right) read at $040000 */ - PORT_BIT( 0xff, 0x00, IPT_DIAL ) PORT_SENSITIVITY(25) PORT_KEYDELTA(15) PORT_PLAYER(2) - PORT_BIT( 0xff00, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // Unknown/Unused -INPUT_PORTS_END - - -static INPUT_PORTS_START( ghoxjo ) - PORT_INCLUDE( ghox ) - - PORT_MODIFY("JMPR") - // Bit Mask 0x80000 is used here to signify European Coinage for MAME purposes - not read on the real board! - PORT_CONFNAME( 0x8000f, 0x80002, DEF_STR( Region ) ) //PORT_CONFLOCATION("JP:!4,!3,!2,!1,FAKE:!1") - PORT_CONFSETTING( 0x80002, DEF_STR( Europe ) ) - PORT_CONFSETTING( 0x00001, DEF_STR( USA ) ) - PORT_CONFSETTING( 0x00000, DEF_STR( Japan ) ) - PORT_CONFSETTING( 0x00003, "Hong Kong (Honest Trading Co.)" ) - PORT_CONFSETTING( 0x00004, DEF_STR( Korea ) ) - PORT_CONFSETTING( 0x00005, DEF_STR( Taiwan ) ) - PORT_CONFSETTING( 0x80006, "Spain & Portugal (APM Electronics S.A.)" ) - PORT_CONFSETTING( 0x80007, "Italy (Star Electronica SRL)" ) - PORT_CONFSETTING( 0x80008, "UK (JP Leisure Limited)" ) - PORT_CONFSETTING( 0x00009, "USA (Romstar, Inc.)" ) - PORT_CONFSETTING( 0x8000a, "Europe (Nova Apparate GMBH & Co.)" ) - PORT_CONFSETTING( 0x0000b, "Japan (Unused) [b]" ) - PORT_CONFSETTING( 0x0000c, "Japan (Unused) [c]" ) - PORT_CONFSETTING( 0x0000d, "Japan (Unused) [d]" ) - PORT_CONFSETTING( 0x0000e, "Japan (Unused) [e]" ) - PORT_CONFSETTING( 0x0000f, "Japan (Unused) [f]" ) -INPUT_PORTS_END - - -static INPUT_PORTS_START( dogyuun ) - PORT_INCLUDE( toaplan2_3b ) - - PORT_MODIFY("DSWA") - PORT_DIPNAME( 0x0001, 0x0000, DEF_STR( Free_Play) ) PORT_DIPLOCATION("SW1:!1") - PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0001, DEF_STR( On ) ) - // Various features on bit mask 0x000e - see above - TOAPLAN_COINAGE_DUAL_LOC( JMPR, 0x8000, 0x8000, SW1 ) - - PORT_MODIFY("DSWB") - // Difficulty on bit mask 0x0003 - see above - PORT_DIPNAME( 0x000c, 0x0000, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW2:!3,!4") - PORT_DIPSETTING( 0x000c, DEF_STR( None ) ) - PORT_DIPSETTING( 0x0008, "400k only" ) - PORT_DIPSETTING( 0x0000, "200k only" ) - PORT_DIPSETTING( 0x0004, "200k, 400k and 600k" ) - PORT_DIPNAME( 0x0030, 0x0000, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:!5,!6") - PORT_DIPSETTING( 0x0030, "1" ) - PORT_DIPSETTING( 0x0020, "2" ) - PORT_DIPSETTING( 0x0000, "3" ) - PORT_DIPSETTING( 0x0010, "5" ) - PORT_DIPNAME( 0x0040, 0x0000, "Invulnerability (Cheat)" ) PORT_DIPLOCATION("SW2:!7") - PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0040, DEF_STR( On ) ) - PORT_DIPNAME( 0x0080, 0x0000, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("SW2:!8") - PORT_DIPSETTING( 0x0080, DEF_STR( No ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( Yes ) ) - - PORT_START("JMPR") - // Bit Mask 0x8000 is used here to signify European Coinage for MAME purposes - not read on the real board! - // "No speedups": all speedup items in game are replaced with bombs - PORT_CONFNAME( 0x80f0, 0x8030, DEF_STR( Region ) ) //PORT_CONFLOCATION("JP:!4,!3,!2,!1,FAKE:!1") - PORT_CONFSETTING( 0x8030, DEF_STR( Europe ) ) - PORT_CONFSETTING( 0x0010, DEF_STR( USA ) ) - PORT_CONFSETTING( 0x0020, "USA (Atari Games Corp.)" ) - PORT_CONFSETTING( 0x0000, DEF_STR( Japan ) ) - PORT_CONFSETTING( 0x0040, "Hong Kong (Charterfield); no speedups" ) - PORT_CONFSETTING( 0x0050, "Korea (Unite Trading); no speedups" ) - PORT_CONFSETTING( 0x0060, "Taiwan; no speedups" ) - PORT_CONFSETTING( 0x0070, "USA; no speedups" ) - PORT_CONFSETTING( 0x0080, "Southeast Asia (Charterfield); no speedups" ) - PORT_CONFSETTING( 0x0090, "Hong Kong (Charterfield)" ) - PORT_CONFSETTING( 0x00a0, "Korea (Unite Trading)" ) - PORT_CONFSETTING( 0x00b0, DEF_STR( Taiwan ) ) - PORT_CONFSETTING( 0x00c0, "USA (Atari Games Corp.); no speedups" ) - PORT_CONFSETTING( 0x00d0, "Southeast Asia (Charterfield)" ) - PORT_CONFSETTING( 0x80e0, "Europe; no speedups" ) - PORT_CONFSETTING( 0x00f0, "Japan (Taito Corp.)" ) -INPUT_PORTS_END - - -static INPUT_PORTS_START( dogyuuna ) - PORT_INCLUDE( dogyuun ) - - PORT_MODIFY("DSWA") - TOAPLAN_COINAGE_DUAL_LOC( JMPR, 0xf0, 0x30, SW1 ) - - PORT_MODIFY("JMPR") - // "No speedups": all speedup items in game are replaced with bombs - PORT_CONFNAME( 0x00f0, 0x0030, DEF_STR( Region ) ) //PORT_CONFLOCATION("JP:!4,!3,!2,!1") - PORT_CONFSETTING( 0x0030, DEF_STR( Europe ) ) - PORT_CONFSETTING( 0x0010, DEF_STR( USA ) ) - PORT_CONFSETTING( 0x0020, "USA (Atari Games Corp.)" ) - PORT_CONFSETTING( 0x0000, DEF_STR( Japan ) ) - PORT_CONFSETTING( 0x0040, "Hong Kong (Charterfield); no speedups" ) - PORT_CONFSETTING( 0x0050, "Korea (Unite Trading); no speedups" ) - PORT_CONFSETTING( 0x0060, "Taiwan; no speedups" ) -// PORT_CONFSETTING( 0x0070, "Taiwan (Licensed to ???????); no speedups" ) - PORT_CONFSETTING( 0x0080, "Southeast Asia (Charterfield); no speedups" ) - PORT_CONFSETTING( 0x0090, "Hong Kong (Charterfield)" ) - PORT_CONFSETTING( 0x00a0, "Korea (Unite Trading)" ) - PORT_CONFSETTING( 0x00b0, DEF_STR( Taiwan ) ) -// PORT_CONFSETTING( 0x00c0, "Taiwan (Licensed to ???????)" ) - PORT_CONFSETTING( 0x00d0, "Southeast Asia (Charterfield)" ) -// PORT_CONFSETTING( 0x00e0, DEF_STR( Unused ) ) - PORT_CONFSETTING( 0x00f0, "Japan (Taito Corp.)" ) -INPUT_PORTS_END - - -static INPUT_PORTS_START( dogyuunt ) - PORT_INCLUDE( dogyuun ) - - PORT_MODIFY("DSWA") - TOAPLAN_COINAGE_DUAL_LOC( JMPR, 0xf0, 0x20, SW1 ) - - PORT_MODIFY("JMPR") - PORT_CONFNAME( 0x00f0, 0x0020, DEF_STR( Region ) ) //PORT_CONFLOCATION("JP:!4,!3,!2,!1") - PORT_CONFSETTING( 0x0020, DEF_STR( Europe ) ) - PORT_CONFSETTING( 0x0010, DEF_STR( USA ) ) - PORT_CONFSETTING( 0x0000, DEF_STR( Japan ) ) - PORT_CONFSETTING( 0x0030, DEF_STR( Hong_Kong ) ) - PORT_CONFSETTING( 0x0040, DEF_STR( Korea ) ) - PORT_CONFSETTING( 0x0050, DEF_STR( Taiwan ) ) - PORT_CONFSETTING( 0x0060, "Southeast Asia (Charterfield)" ) - PORT_CONFSETTING( 0x0070, "USA (Romstar, Inc.)" ) - PORT_CONFSETTING( 0x0080, "Hong Kong (Honest Trading Co.)" ) - PORT_CONFSETTING( 0x0090, "Korea (JC Trading Corp.)" ) - PORT_CONFSETTING( 0x00a0, "USA (Fabtek)" ) -// PORT_CONFSETTING( 0x00b0, DEF_STR( Unused ) ) -// PORT_CONFSETTING( 0x00c0, DEF_STR( Unused ) ) -// PORT_CONFSETTING( 0x00d0, DEF_STR( Unused ) ) -// PORT_CONFSETTING( 0x00e0, DEF_STR( Unused ) ) - PORT_CONFSETTING( 0x00f0, "Japan (Taito Corp.)" ) -INPUT_PORTS_END - - -static INPUT_PORTS_START( kbash ) - PORT_INCLUDE( toaplan2_3b ) - - PORT_MODIFY("DSWA") - PORT_DIPNAME( 0x0001, 0x0000, DEF_STR( Continue_Price ) ) PORT_DIPLOCATION("SW1:!1") - PORT_DIPSETTING( 0x0000, DEF_STR( Normal ) ) - PORT_DIPSETTING( 0x0001, "Discount" ) - // Various features on bit mask 0x000e - see above - TOAPLAN_COINAGE_DUAL_LOC( JMPR, 0x70, 0x20, SW1 ) - - PORT_MODIFY("DSWB") - // Difficulty on bit mask 0x0003 - see above - PORT_DIPNAME( 0x000c, 0x0000, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW2:!3,!4") - PORT_DIPSETTING( 0x000c, DEF_STR( None ) ) - PORT_DIPSETTING( 0x0008, "200k only" ) - PORT_DIPSETTING( 0x0004, "100k only" ) - PORT_DIPSETTING( 0x0000, "100k and 400k" ) - PORT_DIPNAME( 0x0030, 0x0000, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:!5,!6") - PORT_DIPSETTING( 0x0030, "1" ) - PORT_DIPSETTING( 0x0000, "2" ) - PORT_DIPSETTING( 0x0020, "3" ) - PORT_DIPSETTING( 0x0010, "4" ) - PORT_DIPNAME( 0x0040, 0x0000, "Invulnerability (Cheat)" ) PORT_DIPLOCATION("SW2:!7") - PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0040, DEF_STR( On ) ) - PORT_DIPNAME( 0x0080, 0x0000, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("SW2:!8") - PORT_DIPSETTING( 0x0080, DEF_STR( No ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( Yes ) ) - - PORT_START("JMPR") - PORT_CONFNAME( 0x00f0, 0x0020, DEF_STR( Region ) ) //PORT_CONFLOCATION("JP:!4,!3,!2,!1") - PORT_CONFSETTING( 0x0020, "Europe, USA (Atari Games)" ) // European coinage - PORT_CONFSETTING( 0x0010, "USA, Europe (Atari Games)" ) - PORT_CONFSETTING( 0x0000, DEF_STR( Japan ) ) - PORT_CONFSETTING( 0x0030, DEF_STR( Korea ) ) - PORT_CONFSETTING( 0x0040, DEF_STR( Hong_Kong ) ) - PORT_CONFSETTING( 0x0050, DEF_STR( Taiwan ) ) - PORT_CONFSETTING( 0x0060, DEF_STR( Southeast_Asia ) ) // Service Mode wrongly shows European coinage -// PORT_CONFSETTING( 0x0070, DEF_STR( Unused ) ) -// PORT_CONFSETTING( 0x0080, DEF_STR( Unused ) ) - PORT_CONFSETTING( 0x0090, DEF_STR( USA ) ) - PORT_CONFSETTING( 0x00a0, DEF_STR( Europe ) ) // European coinage -// PORT_CONFSETTING( 0x00b0, DEF_STR( Unused ) ) -// PORT_CONFSETTING( 0x00c0, DEF_STR( Unused ) ) -// PORT_CONFSETTING( 0x00d0, DEF_STR( Unused ) ) -// PORT_CONFSETTING( 0x00e0, DEF_STR( Unused ) ) // Service Mode wrongly shows European coinage -// PORT_CONFSETTING( 0x00f0, DEF_STR( Unused ) ) -INPUT_PORTS_END - -static INPUT_PORTS_START( kbashk ) - PORT_INCLUDE( kbash ) - - PORT_MODIFY("JMPR") - PORT_CONFNAME( 0x00f0, 0x0000, DEF_STR( Region ) ) //PORT_CONFLOCATION("JP:!4,!3,!2,!1") - PORT_CONFSETTING( 0x0000, "Japan (Taito license)" ) // Taito license - PORT_CONFSETTING( 0x0010, DEF_STR( Unused ) ) - PORT_CONFSETTING( 0x0020, DEF_STR( Unused ) ) - PORT_CONFSETTING( 0x0030, DEF_STR( Korea ) ) - PORT_CONFSETTING( 0x0040, DEF_STR( Hong_Kong ) ) - PORT_CONFSETTING( 0x0050, DEF_STR( Taiwan ) ) - PORT_CONFSETTING( 0x0060, DEF_STR( Southeast_Asia ) ) - PORT_CONFSETTING( 0x0070, DEF_STR( Unused ) ) - PORT_CONFSETTING( 0x0080, DEF_STR( Japan ) ) // no Taito license - PORT_CONFSETTING( 0x0090, DEF_STR( Unused ) ) - PORT_CONFSETTING( 0x00a0, DEF_STR( Unused ) ) - PORT_CONFSETTING( 0x00b0, DEF_STR( Korea ) ) - PORT_CONFSETTING( 0x00c0, DEF_STR( Hong_Kong )) - PORT_CONFSETTING( 0x00d0, DEF_STR( Taiwan )) - PORT_CONFSETTING( 0x00e0, DEF_STR( Southeast_Asia )) - PORT_CONFSETTING( 0x00f0, DEF_STR( Unused ) ) -INPUT_PORTS_END - -static INPUT_PORTS_START( kbash2 ) - PORT_INCLUDE( kbash ) - - PORT_MODIFY("DSWA") - TOAPLAN_COINAGE_DUAL_LOC( JMPR, 0x07, 0x02, SW1 ) - - PORT_MODIFY("JMPR") - PORT_CONFNAME( 0x000f, 0x0006, DEF_STR( Region ) ) //PORT_CONFLOCATION("JP:!4,!3,!2,!1") - PORT_CONFSETTING( 0x0000, "Japan (Taito Corp.)" ) -// PORT_CONFSETTING( 0x0001, DEF_STR( Unused ) ) -// PORT_CONFSETTING( 0x0002, DEF_STR( Unused ) ) // European coinage - PORT_CONFSETTING( 0x0003, "Korea (Unite Trading)" ) - PORT_CONFSETTING( 0x0004, DEF_STR( Hong_Kong ) ) - PORT_CONFSETTING( 0x0005, DEF_STR( Taiwan ) ) - PORT_CONFSETTING( 0x0006, "Southeast Asia (Charterfield)" ) // Service Mode wrongly shows European coinage -// PORT_CONFSETTING( 0x0007, DEF_STR( Unused ) ) - PORT_CONFSETTING( 0x0008, DEF_STR( Japan ) ) -// PORT_CONFSETTING( 0x0009, DEF_STR( Unused ) ) -// PORT_CONFSETTING( 0x000a, DEF_STR( Unused ) ) // European coinage - PORT_CONFSETTING( 0x000b, DEF_STR( Korea ) ) -// PORT_CONFSETTING( 0x000c, DEF_STR( Hong_Kong ) ) -// PORT_CONFSETTING( 0x000d, DEF_STR( Taiwan ) ) - PORT_CONFSETTING( 0x000e, DEF_STR( Southeast_Asia ) ) // Service Mode wrongly shows European coinage -// PORT_CONFSETTING( 0x000f, DEF_STR( Unused ) ) - PORT_BIT( 0x00f0, IP_ACTIVE_HIGH, IPT_UNKNOWN ) -INPUT_PORTS_END - - -static INPUT_PORTS_START( truxton2 ) - PORT_INCLUDE( toaplan2_3b ) - - PORT_MODIFY("IN1") - PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Fast Scrolling (Cheat)") - - PORT_MODIFY("DSWA") - PORT_DIPNAME( 0x0001, 0x0000, "Rapid Fire" ) PORT_DIPLOCATION("SW1:!1") - PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - // Various features on bit mask 0x000e - see above - TOAPLAN_COINAGE_DUAL_LOC( JMPR, 0x0f, 0x02, SW1 ) - - PORT_MODIFY("DSWB") - // Difficulty on bit mask 0x0003 - see above - PORT_DIPNAME( 0x000c, 0x0000, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW2:!3,!4") - PORT_DIPSETTING( 0x000c, "200k only" ) - PORT_DIPSETTING( 0x0008, "100k only" ) - PORT_DIPSETTING( 0x0004, "100k and 250k" ) - PORT_DIPSETTING( 0x0000, "70k and 200k" ) - PORT_DIPNAME( 0x0030, 0x0000, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:!5,!6") - PORT_DIPSETTING( 0x0030, "2" ) - PORT_DIPSETTING( 0x0000, "3" ) - PORT_DIPSETTING( 0x0020, "4" ) - PORT_DIPSETTING( 0x0010, "5" ) - PORT_DIPNAME( 0x0040, 0x0000, "Invulnerability (Cheat)" ) PORT_DIPLOCATION("SW2:!7") - PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0040, DEF_STR( On ) ) - PORT_DIPNAME( 0x0080, 0x0000, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("SW2:!8") - PORT_DIPSETTING( 0x0080, DEF_STR( No ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( Yes ) ) - - PORT_START("JMPR") - PORT_CONFNAME( 0x000f, 0x0002, DEF_STR( Region ) ) //PORT_CONFLOCATION("JP:!4,!3,!2,!1") - PORT_CONFSETTING( 0x0002, DEF_STR( Europe ) ) - PORT_CONFSETTING( 0x0001, DEF_STR( USA ) ) - PORT_CONFSETTING( 0x0000, DEF_STR( Japan ) ) - PORT_CONFSETTING( 0x0003, DEF_STR( Hong_Kong ) ) - PORT_CONFSETTING( 0x0004, DEF_STR( Korea ) ) - PORT_CONFSETTING( 0x0005, DEF_STR( Taiwan ) ) - PORT_CONFSETTING( 0x0006, "Southeast Asia (Charterfield)" ) - PORT_CONFSETTING( 0x0007, "USA (Romstar, Inc.)" ) - PORT_CONFSETTING( 0x0008, "Hong Kong (Honest Trading Co.)" ) - PORT_CONFSETTING( 0x0009, "Korea (JC Trading Corp.)" ) - PORT_CONFSETTING( 0x000a, "USA (Fabtek)" ) -// PORT_CONFSETTING( 0x000b, DEF_STR( Unused ) ) -// PORT_CONFSETTING( 0x000c, DEF_STR( Unused ) ) -// PORT_CONFSETTING( 0x000d, DEF_STR( Unused ) ) -// PORT_CONFSETTING( 0x000e, DEF_STR( Unused ) ) - PORT_CONFSETTING( 0x000f, "Japan (Taito Corp.)" ) -INPUT_PORTS_END - - -static INPUT_PORTS_START( pipibibs ) - PORT_INCLUDE( toaplan2_2b ) - - PORT_MODIFY("DSWA") - // Various features on bit mask 0x000f - see above - TOAPLAN_COINAGE_DUAL_LOC( JMPR, 0x06, 0x06, SW1 ) - - PORT_MODIFY("DSWB") - // Difficulty on bit mask 0x0003 - see above - PORT_DIPNAME( 0x000c, 0x0000, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW2:!3,!4") - PORT_DIPSETTING( 0x000c, DEF_STR( None ) ) - PORT_DIPSETTING( 0x0008, "200k only" ) - PORT_DIPSETTING( 0x0000, "200k and every 300k" ) - PORT_DIPSETTING( 0x0004, "150k and every 200k" ) - PORT_DIPNAME( 0x0030, 0x0000, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:!5,!6") - PORT_DIPSETTING( 0x0030, "1" ) - PORT_DIPSETTING( 0x0020, "2" ) - PORT_DIPSETTING( 0x0000, "3" ) - PORT_DIPSETTING( 0x0010, "5" ) - PORT_DIPNAME( 0x0040, 0x0000, "Invulnerability (Cheat)" ) PORT_DIPLOCATION("SW2:!7") - PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0040, DEF_STR( On ) ) - PORT_DIPNAME( 0x0080, 0x0000, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW2:!8") - PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0080, DEF_STR( On ) ) - - PORT_START("JMPR") - PORT_CONFNAME( 0x0008, 0x0000, "Nudity" ) //PORT_CONFLOCATION("JP:!1") - PORT_CONFSETTING( 0x0008, DEF_STR( Low ) ) - PORT_CONFSETTING( 0x0000, "High, but censored" ) - PORT_CONFNAME( 0x0007, 0x0006, DEF_STR( Region ) ) //PORT_CONFLOCATION("JP:!4,!3,!2") - PORT_CONFSETTING( 0x0006, DEF_STR( Europe ) ) - PORT_CONFSETTING( 0x0004, DEF_STR( USA ) ) - PORT_CONFSETTING( 0x0000, DEF_STR( Japan ) ) - PORT_CONFSETTING( 0x0001, DEF_STR( Asia ) ) - PORT_CONFSETTING( 0x0002, "Hong Kong (Honest Trading Co.)" ) - PORT_CONFSETTING( 0x0003, DEF_STR( Taiwan ) ) - PORT_CONFSETTING( 0x0005, "USA (Romstar, Inc.)" ) - PORT_CONFSETTING( 0x0007, "Europe (Nova Apparate GMBH & Co.)" ) -INPUT_PORTS_END - - -static INPUT_PORTS_START( pipibibsp ) - PORT_INCLUDE( pipibibs ) - - PORT_MODIFY("DSWA") - // Various features on bit mask 0x000d - see above - TOAPLAN_COINAGE_DUAL_LOC( JMPR, 0x80000, 0x80000, SW1 ) - - PORT_MODIFY("JMPR") - // Bit Mask 0x80000 is used here to signify European Coinage for MAME purposes - not read on the real board! - PORT_CONFNAME( 0x80007, 0x00002, DEF_STR( Region ) ) //PORT_CONFLOCATION("JP:!4,!3,!2,FAKE:!1") - PORT_CONFSETTING( 0x00002, DEF_STR( World ) ) - PORT_CONFSETTING( 0x80005, DEF_STR( Europe ) ) - PORT_CONFSETTING( 0x00004, DEF_STR( USA ) ) - PORT_CONFSETTING( 0x00000, "Japan (Ryouta Kikaku)" ) - PORT_CONFSETTING( 0x00001, "Hong Kong (Honest Trading Co.)" ) - PORT_CONFSETTING( 0x80006, "Spain & Portugal (APM Electronics S.A.)" ) - PORT_CONFSETTING( 0x00007, "World (Ryouta Kikaku)" ) -INPUT_PORTS_END - - -static INPUT_PORTS_START( whoopee ) - PORT_INCLUDE( pipibibs ) - - PORT_MODIFY("JMPR") - PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(FUNC(toaplan2_state::c2map_r)) // bit 0x10 sound ready -INPUT_PORTS_END - - -static INPUT_PORTS_START( pipibibsbl ) - PORT_INCLUDE( pipibibs ) - - PORT_MODIFY("DSWA") - PORT_DIPNAME( 0x0002, 0x0000, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW1:!2") // In Test Mode, it shows as Normal/Invert Screen - HW doesn't support it - PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0002, DEF_STR( On ) ) - // Various features on bit mask 0x000d - see above - TOAPLAN_COINAGE_DUAL_LOC( JMPR, 0x80000, 0x80000, SW1 ) - - PORT_MODIFY("JMPR") - // Bit Mask 0x80000 is used here to signify European Coinage for MAME purposes - not read on the real board! - PORT_CONFNAME( 0x80007, 0x00002, DEF_STR( Region ) ) //PORT_CONFLOCATION("JP:!4,!3,!2,FAKE:!1") - PORT_CONFSETTING( 0x00002, DEF_STR( World ) ) - PORT_CONFSETTING( 0x80005, DEF_STR( Europe ) ) - PORT_CONFSETTING( 0x00004, DEF_STR( USA ) ) - PORT_CONFSETTING( 0x00000, "Japan (Ryouta Kikaku)" ) - PORT_CONFSETTING( 0x00001, "Hong Kong (Honest Trading Co.)" ) - PORT_CONFSETTING( 0x80006, "Spain & Portugal (APM Electronics S.A.)" ) - PORT_CONFSETTING( 0x00007, "World (Ryouta Kikaku)" ) -INPUT_PORTS_END - - -static INPUT_PORTS_START( fixeight ) - // The Suicide buttons are technically P1 and P2 Button 3, but we hook - // them up as IPT_OTHER so each player has the same number of buttons. - PORT_START("IN1") - PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(1) PORT_8WAY - PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1) PORT_8WAY - PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1) PORT_8WAY - PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1) PORT_8WAY - PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(1) - PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(1) - PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P1 Suicide (Cheat)") - PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_UNKNOWN ) - PORT_BIT( 0xff00, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // Unknown/Unused - - PORT_START("IN2") - PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(2) PORT_8WAY - PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2) PORT_8WAY - PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2) PORT_8WAY - PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2) PORT_8WAY - PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2) - PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(2) - PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P2 Suicide (Cheat)") - PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_UNKNOWN ) - PORT_BIT( 0xff00, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // Unknown/Unused - - PORT_START("IN3") - PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(3) PORT_8WAY - PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(3) PORT_8WAY - PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(3) PORT_8WAY - PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(3) PORT_8WAY - PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(3) - PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(3) - PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_START3 ) - PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_MEMORY_RESET ) PORT_NAME("Region Reset") - PORT_BIT( 0xff00, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // Unknown/Unused - - PORT_START("SYS") - PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_COIN3 ) - PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_TILT ) - PORT_SERVICE_NO_TOGGLE(0x0004, IP_ACTIVE_HIGH) // Service input is a pushbutton marked 'Test SW' - PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_COIN1 ) - PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_COIN2 ) - PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_START1 ) - PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_START2 ) - PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_UNKNOWN ) - PORT_BIT( 0xff00, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // Unknown/Unused - - PORT_START("EEPROM") - PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", FUNC(eeprom_serial_93cxx_device::cs_write)) - PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", FUNC(eeprom_serial_93cxx_device::clk_write)) - PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", FUNC(eeprom_serial_93cxx_device::di_write)) - PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", FUNC(eeprom_serial_93cxx_device::do_read)) -INPUT_PORTS_END - - -static INPUT_PORTS_START( fixeightbl ) - PORT_INCLUDE( toaplan2_2b ) - - PORT_MODIFY("SYS") - PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_COIN3 ) - PORT_SERVICE_NO_TOGGLE(0x0004, IP_ACTIVE_HIGH) // Service input is a pushbutton marked 'Test SW' - - PORT_START("IN3") - PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(3) PORT_8WAY - PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(3) PORT_8WAY - PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(3) PORT_8WAY - PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(3) PORT_8WAY - PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(3) - PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(3) - PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_START3 ) - PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_UNKNOWN ) - PORT_BIT( 0xff00, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // Unknown/Unused - - PORT_MODIFY("DSWA") - PORT_DIPNAME( 0x0001, 0x0000, "Maximum Players" ) PORT_DIPLOCATION("SW1:!1") - PORT_DIPSETTING( 0x0000, "2" ) - PORT_DIPSETTING( 0x0001, "3" ) - PORT_DIPNAME( 0x0002, 0x0000, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW1:!2") // This video HW doesn't support flip screen - PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0002, DEF_STR( On ) ) - PORT_DIPNAME( 0x0004, 0x0004, "Shooting Style" ) PORT_DIPLOCATION("SW1:!3") - PORT_DIPSETTING( 0x0004, "Semi-Auto" ) - PORT_DIPSETTING( 0x0000, "Full-Auto" ) - // Various features on bit mask 0x0008 - see above - TOAPLAN_COINAGE_JAPAN_LOC(SW1) - - PORT_MODIFY("DSWB") - // Difficulty on bit mask 0x0003 - see above - PORT_DIPNAME( 0x000c, 0x0000, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW2:!3,!4") - PORT_DIPSETTING( 0x000c, DEF_STR( None ) ) - PORT_DIPSETTING( 0x0000, "500k and every 500k" ) - PORT_DIPSETTING( 0x0008, "300k only" ) - PORT_DIPSETTING( 0x0004, "300k and every 300k" ) - PORT_DIPNAME( 0x0030, 0x0000, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:!5,!6") - PORT_DIPSETTING( 0x0030, "1" ) - PORT_DIPSETTING( 0x0020, "2" ) - PORT_DIPSETTING( 0x0000, "3" ) - PORT_DIPSETTING( 0x0010, "5" ) - PORT_DIPNAME( 0x0040, 0x0000, "Invulnerability (Cheat)" ) PORT_DIPLOCATION("SW2:!7") - PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0040, DEF_STR( On ) ) - PORT_DIPNAME( 0x0080, 0x0000, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("SW2:!8") - PORT_DIPSETTING( 0x0080, DEF_STR( No ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( Yes ) ) -INPUT_PORTS_END - - -static INPUT_PORTS_START( grindstm ) - PORT_INCLUDE( toaplan2_2b ) - - PORT_MODIFY("DSWA") - PORT_DIPNAME( 0x0001, 0x0000, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW1:!1") - PORT_DIPSETTING( 0x0000, DEF_STR( Upright ) ) - PORT_DIPSETTING( 0x0001, DEF_STR( Cocktail ) ) - // Various features on bit mask 0x000e - see above - TOAPLAN_COINAGE_DUAL_LOC( JMPR, 0xe0, 0x80, SW1 ) - - PORT_MODIFY("DSWB") - // Difficulty on bit mask 0x0003 - see above - PORT_DIPNAME( 0x000c, 0x0000, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW2:!3,!4") - PORT_DIPSETTING( 0x000c, DEF_STR( None ) ) - PORT_DIPSETTING( 0x0008, "200k only" ) - PORT_DIPSETTING( 0x0000, "300k and 800k" ) - PORT_DIPSETTING( 0x0004, "300k and every 800k" ) - PORT_DIPNAME( 0x0030, 0x0000, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:!5,!6") - PORT_DIPSETTING( 0x0030, "1" ) - PORT_DIPSETTING( 0x0020, "2" ) - PORT_DIPSETTING( 0x0000, "3" ) - PORT_DIPSETTING( 0x0010, "5" ) - PORT_DIPNAME( 0x0040, 0x0000, "Invulnerability (Cheat)" ) PORT_DIPLOCATION("SW2:!7") - PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0040, DEF_STR( On ) ) - PORT_DIPNAME( 0x0080, 0x0000, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("SW2:!8") - PORT_DIPSETTING( 0x0080, DEF_STR( No ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( Yes ) ) - - PORT_START("JMPR") - // Code in many places in game tests if region is >= 0xC. Effects on gameplay? - PORT_CONFNAME( 0x00f0, 0x0090, DEF_STR( Region ) ) //PORT_CONFLOCATION("JP:!4,!3,!2,!1") - PORT_CONFSETTING( 0x0090, DEF_STR( Europe ) ) -// PORT_CONFSETTING( 0x0080, DEF_STR( Europe ) ) - PORT_CONFSETTING( 0x00b0, DEF_STR( USA ) ) - PORT_CONFSETTING( 0x00a0, "USA (American Sammy Corporation)" ) - PORT_CONFSETTING( 0x0070, DEF_STR( Southeast_Asia ) ) - PORT_CONFSETTING( 0x0060, "Southeast Asia (Charterfield)" ) - PORT_CONFSETTING( 0x0050, DEF_STR( Taiwan ) ) - PORT_CONFSETTING( 0x0040, "Taiwan (Anomoto International Inc.)" ) - PORT_CONFSETTING( 0x0030, DEF_STR( Hong_Kong ) ) - PORT_CONFSETTING( 0x0020, "Hong Kong (Charterfield)" ) - PORT_CONFSETTING( 0x0010, DEF_STR( Korea ) ) - PORT_CONFSETTING( 0x0000, "Korea (Unite Trading)" ) - PORT_CONFSETTING( 0x00d0, "USA; different?" ) - PORT_CONFSETTING( 0x00c0, "USA (American Sammy Corporation); different?" ) - PORT_CONFSETTING( 0x00e0, "Korea; different?" ) -// PORT_CONFSETTING( 0x00f0, "Korea; different?" ) -INPUT_PORTS_END - - -static INPUT_PORTS_START( grindstma ) - PORT_INCLUDE( grindstm ) - - PORT_MODIFY("JMPR") - // Code in many places in game tests if region is >= 0xC. Effects on gameplay? - PORT_CONFNAME( 0x00f0, 0x0090, DEF_STR( Region ) ) //PORT_CONFLOCATION("JP:!4,!3,!2,!1") - PORT_CONFSETTING( 0x0090, DEF_STR( Europe ) ) -// PORT_CONFSETTING( 0x0080, DEF_STR( Europe ) ) - PORT_CONFSETTING( 0x00b0, DEF_STR( USA ) ) - PORT_CONFSETTING( 0x00a0, "USA (Atari Games Corp.)" ) - PORT_CONFSETTING( 0x0070, DEF_STR( Southeast_Asia ) ) - PORT_CONFSETTING( 0x0060, "Southeast Asia (Charterfield)" ) - PORT_CONFSETTING( 0x0050, DEF_STR( Taiwan ) ) -// PORT_CONFSETTING( 0x0040, DEF_STR( Taiwan ) ) - PORT_CONFSETTING( 0x0030, DEF_STR( Hong_Kong ) ) - PORT_CONFSETTING( 0x0020, "Hong Kong (Charterfield)" ) - PORT_CONFSETTING( 0x0010, DEF_STR( Korea ) ) - PORT_CONFSETTING( 0x0000, "Korea (Unite Trading)" ) - PORT_CONFSETTING( 0x00c0, "Korea; different?" ) -// PORT_CONFSETTING( 0x00d0, "Korea; different?" ) -// PORT_CONFSETTING( 0x00e0, "Korea; different?" ) -// PORT_CONFSETTING( 0x00f0, "Korea; different?" ) -INPUT_PORTS_END - - -static INPUT_PORTS_START( vfive ) - PORT_INCLUDE( grindstm ) - - PORT_MODIFY("DSWA") - TOAPLAN_COINAGE_JAPAN_LOC(SW1) - - PORT_MODIFY("JMPR") - // Region is forced to Japan in this set. - // Code at $9238 tests bit 7. - // (Actually bit 3, but the V25 shifts the jumper byte before storing it in shared RAM) - // Runs twice near end of stage 1, once when each of the two boss tanks appears. Effect? - // Also, if bit 7 is set and bits 6-5 are clear, service mode wrongly shows European coinage - // (due to code left in from Grind Stormer: see code at $210A4 and lookup table at $211FA) - PORT_CONFNAME( 0x0030, 0x0000, "Copyright" ) //PORT_CONFLOCATION("JP:!4,!3") - PORT_CONFSETTING( 0x0000, "All Rights Reserved" ) -// PORT_CONFSETTING( 0x0010, "All Rights Reserved" ) -// PORT_CONFSETTING( 0x0020, "All Rights Reserved" ) - PORT_CONFSETTING( 0x0030, "Licensed to Taito Corp." ) - PORT_CONFNAME( 0x0040, 0x0000, DEF_STR( Unused ) ) //PORT_CONFLOCATION("JP:!2") - PORT_CONFSETTING( 0x0000, DEF_STR( Off ) ) - PORT_CONFSETTING( 0x0040, DEF_STR( On ) ) - PORT_CONFNAME( 0x0080, 0x0000, DEF_STR( Unknown ) ) //PORT_CONFLOCATION("JP:!1") - PORT_CONFSETTING( 0x0000, DEF_STR( Off ) ) - PORT_CONFSETTING( 0x0080, DEF_STR( On ) ) -INPUT_PORTS_END - - -static INPUT_PORTS_START( batsugun ) - PORT_INCLUDE( toaplan2_3b ) - - PORT_MODIFY("DSWA") - PORT_DIPNAME( 0x0001, 0x0000, DEF_STR( Continue_Price ) ) PORT_DIPLOCATION("SW1:!1") - PORT_DIPSETTING( 0x0000, DEF_STR( Normal ) ) - PORT_DIPSETTING( 0x0001, "Discount" ) - // Various features on bit mask 0x000e - see above - TOAPLAN_COINAGE_JAPAN_LOC(SW1) // European coinage shown in Service Mode but not actually used - - PORT_MODIFY("DSWB") - // Difficulty on bit mask 0x0003 - see above - PORT_DIPNAME( 0x000c, 0x0000, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW2:!3,!4") - PORT_DIPSETTING( 0x000c, DEF_STR( None ) ) - PORT_DIPSETTING( 0x0008, "1500k only" ) - PORT_DIPSETTING( 0x0000, "1000k only" ) - PORT_DIPSETTING( 0x0004, "500k and every 600k" ) - PORT_DIPNAME( 0x0030, 0x0000, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:!5,!6") - PORT_DIPSETTING( 0x0030, "1" ) - PORT_DIPSETTING( 0x0020, "2" ) - PORT_DIPSETTING( 0x0000, "3" ) - PORT_DIPSETTING( 0x0010, "5" ) - PORT_DIPNAME( 0x0040, 0x0000, "Invulnerability (Cheat)" ) PORT_DIPLOCATION("SW2:!7") - PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0040, DEF_STR( On ) ) - PORT_DIPNAME( 0x0080, 0x0000, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("SW2:!8") - PORT_DIPSETTING( 0x0080, DEF_STR( No ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( Yes ) ) - - PORT_START("JMPR") - PORT_CONFNAME( 0x00f0, 0x0090, DEF_STR( Region ) ) //PORT_CONFLOCATION("JP:!4,!3,!2,!1") - PORT_CONFSETTING( 0x0090, DEF_STR( Europe ) ) - PORT_CONFSETTING( 0x0080, "Europe (Taito Corp.)" ) - PORT_CONFSETTING( 0x00b0, DEF_STR( USA ) ) - PORT_CONFSETTING( 0x00a0, "USA (Taito Corp.)" ) - PORT_CONFSETTING( 0x00f0, DEF_STR( Japan ) ) -// PORT_CONFSETTING( 0x00e0, DEF_STR( Japan ) ) - PORT_CONFSETTING( 0x00d0, "Japan (Taito Corp.)" ) -// PORT_CONFSETTING( 0x00c0, "Japan (Taito Corp.)" ) - PORT_CONFSETTING( 0x0070, DEF_STR( Southeast_Asia ) ) - PORT_CONFSETTING( 0x0060, "Southeast Asia (Taito Corp.)" ) - PORT_CONFSETTING( 0x0050, DEF_STR( Taiwan ) ) - PORT_CONFSETTING( 0x0040, "Taiwan (Taito Corp.)" ) - PORT_CONFSETTING( 0x0030, DEF_STR( Hong_Kong ) ) - PORT_CONFSETTING( 0x0020, "Hong Kong (Taito Corp.)" ) - PORT_CONFSETTING( 0x0010, DEF_STR( Korea ) ) - PORT_CONFSETTING( 0x0000, "Korea (Unite Trading)" ) -INPUT_PORTS_END - - -static INPUT_PORTS_START( batsugunbl ) - PORT_INCLUDE( batsugun ) - - PORT_MODIFY("JMPR") - PORT_CONFNAME( 0x000f, 0x0009, DEF_STR( Region ) ) //PORT_CONFLOCATION("JP:!4,!3,!2,!1") - PORT_CONFSETTING( 0x0009, DEF_STR( Europe ) ) - PORT_CONFSETTING( 0x0008, "Europe (Taito Corp.)" ) - PORT_CONFSETTING( 0x000b, DEF_STR( USA ) ) - PORT_CONFSETTING( 0x000a, "USA (Taito Corp.)" ) - PORT_CONFSETTING( 0x000f, DEF_STR( Japan ) ) -// PORT_CONFSETTING( 0x000e, DEF_STR( Japan ) ) - PORT_CONFSETTING( 0x000d, "Japan (Taito Corp.)" ) -// PORT_CONFSETTING( 0x000c, "Japan (Taito Corp.)" ) - PORT_CONFSETTING( 0x0007, DEF_STR( Southeast_Asia ) ) - PORT_CONFSETTING( 0x0006, "Southeast Asia (Taito Corp.)" ) - PORT_CONFSETTING( 0x0005, DEF_STR( Taiwan ) ) - PORT_CONFSETTING( 0x0004, "Taiwan (Taito Corp.)" ) - PORT_CONFSETTING( 0x0003, DEF_STR( Hong_Kong ) ) - PORT_CONFSETTING( 0x0002, "Hong Kong (Taito Corp.)" ) - PORT_CONFSETTING( 0x0001, DEF_STR( Korea ) ) - PORT_CONFSETTING( 0x0000, "Korea (Unite Trading)" ) - PORT_CONFNAME( 0x00f0, 0x00f0, "(null)" ) -INPUT_PORTS_END - - -static INPUT_PORTS_START( pwrkick ) - PORT_START("DSWA") - PORT_DIPNAME( 0x03, 0x00, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:!1,!2") - PORT_DIPSETTING( 0x00, DEF_STR( Easy ) ) - PORT_DIPSETTING( 0x01, DEF_STR( Normal ) ) - PORT_DIPSETTING( 0x02, DEF_STR( Hard ) ) - PORT_DIPSETTING( 0x03, DEF_STR( Very_Hard ) ) - PORT_DIPNAME( 0x5c, 0x00, "Payout" ) PORT_DIPLOCATION("SW1:!3,!4,!5,!7") - PORT_DIPSETTING( 0x00, "110" ) // Service mode displays values as 1-8, ignoring SW1:7 - PORT_DIPSETTING( 0x04, "105" ) - PORT_DIPSETTING( 0x08, "100" ) - PORT_DIPSETTING( 0x0c, "95" ) - PORT_DIPSETTING( 0x10, "90" ) - PORT_DIPSETTING( 0x14, "85" ) - PORT_DIPSETTING( 0x18, "80" ) - PORT_DIPSETTING( 0x1c, "75" ) - PORT_DIPSETTING( 0x40, "70" ) - PORT_DIPSETTING( 0x44, "65" ) - PORT_DIPSETTING( 0x48, "60" ) - PORT_DIPSETTING( 0x4c, "55" ) - PORT_DIPSETTING( 0x50, "50" ) - PORT_DIPSETTING( 0x54, "45" ) - PORT_DIPSETTING( 0x58, "40" ) - PORT_DIPSETTING( 0x5c, "35" ) - PORT_DIPNAME( 0x20, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:!6") - PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x80, 0x00, "Diagnostic" ) PORT_DIPLOCATION("SW1:!8") - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x80, DEF_STR( On ) ) - - PORT_START("DSWB") - PORT_DIPNAME( 0x03, 0x00, "Play Credit" ) PORT_DIPLOCATION("SW2:!1,!2") - PORT_DIPSETTING( 0x00, u8"¥10" ) - PORT_DIPSETTING( 0x01, u8"¥20" ) - PORT_DIPSETTING( 0x02, u8"¥30" ) - PORT_DIPSETTING( 0x03, u8"¥40" ) - PORT_DIPNAME( 0x0c, 0x00, "Coin Exchange" ) PORT_DIPLOCATION("SW2:!3,!4") - PORT_DIPSETTING( 0x00, "12" ) - PORT_DIPSETTING( 0x04, "10" ) - PORT_DIPSETTING( 0x08, "6" ) - PORT_DIPSETTING( 0x0c, "5" ) - PORT_DIPNAME( 0x30, 0x00, "Game Mode" ) PORT_DIPLOCATION("SW2:!5,!6") - PORT_DIPSETTING( 0x00, DEF_STR( Normal ) ) - PORT_DIPSETTING( 0x10, "Shot" ) - PORT_DIPSETTING( 0x20, "Auto" ) - PORT_DIPSETTING( 0x30, "S-Manual" ) - PORT_DIPUNUSED_DIPLOC( 0x40, 0x00, "SW2:!7" ) - PORT_DIPUNUSED_DIPLOC( 0x80, 0x00, "SW2:!8" ) - - PORT_START("DSWC") - PORT_DIPUNUSED_DIPLOC( 0x01, 0x00, "SW3:!1" ) - PORT_DIPUNUSED_DIPLOC( 0x02, 0x00, "SW3:!2" ) - PORT_DIPUNUSED_DIPLOC( 0x04, 0x00, "SW3:!3" ) - PORT_DIPUNUSED_DIPLOC( 0x08, 0x00, "SW3:!4" ) - PORT_DIPUNUSED_DIPLOC( 0x10, 0x00, "SW3:!5" ) - PORT_DIPUNUSED_DIPLOC( 0x20, 0x00, "SW3:!6" ) - PORT_DIPUNUSED_DIPLOC( 0x40, 0x00, "SW3:!7" ) - PORT_DIPUNUSED_DIPLOC( 0x80, 0x00, "SW3:!8" ) - - PORT_START("IN1") - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 ) - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SLOT_STOP1 ) PORT_NAME("Left") - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SLOT_STOP2 ) PORT_NAME("Center") - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SLOT_STOP3 ) PORT_NAME("Right") - PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED ) - - PORT_START("IN2") - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN2 ) PORT_NAME(u8"Coin 2 (¥10)") - PORT_SERVICE_NO_TOGGLE( 0x02, IP_ACTIVE_HIGH ) - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SLOT_STOP4 ) PORT_NAME("Down") // does this button really exist? - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", FUNC(ticket_dispenser_device::line_r)) - PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_MEMORY_RESET ) - PORT_BIT( 0xe0, IP_ACTIVE_HIGH, IPT_UNUSED ) - - PORT_START("SYS") - PORT_BIT( 0x03, IP_ACTIVE_HIGH, IPT_UNUSED ) - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_COIN3 ) PORT_NAME(u8"Coin Exchange (¥100)") - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_GAMBLE_BOOK ) - PORT_BIT( 0x30, IP_ACTIVE_HIGH, IPT_UNUSED ) - PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_GAMBLE_SERVICE ) PORT_NAME("Attendant Key") - PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_NAME("Coin 1 (Medal)") - - // The specific "Payout" button shown on the test screen and diagnostic menu does not exist. -INPUT_PORTS_END - -static INPUT_PORTS_START( burgkids ) - PORT_START("DSWA") - PORT_DIPNAME( 0x03, 0x00, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:!1,!2") - PORT_DIPSETTING( 0x00, DEF_STR( Easy ) ) - PORT_DIPSETTING( 0x01, DEF_STR( Normal ) ) - PORT_DIPSETTING( 0x02, DEF_STR( Hard ) ) - PORT_DIPSETTING( 0x03, DEF_STR( Very_Hard ) ) - PORT_DIPNAME( 0x5c, 0x00, "Payout" ) PORT_DIPLOCATION("SW1:!3,!4,!5,!7") - PORT_DIPSETTING( 0x00, "110" ) // Service mode displays values as 1-8, ignoring SW1:7 - PORT_DIPSETTING( 0x04, "105" ) - PORT_DIPSETTING( 0x08, "100" ) - PORT_DIPSETTING( 0x0c, "95" ) - PORT_DIPSETTING( 0x10, "90" ) - PORT_DIPSETTING( 0x14, "85" ) - PORT_DIPSETTING( 0x18, "80" ) - PORT_DIPSETTING( 0x1c, "75" ) - PORT_DIPSETTING( 0x40, "70" ) - PORT_DIPSETTING( 0x44, "65" ) - PORT_DIPSETTING( 0x48, "60" ) - PORT_DIPSETTING( 0x4c, "55" ) - PORT_DIPSETTING( 0x50, "50" ) - PORT_DIPSETTING( 0x54, "45" ) - PORT_DIPSETTING( 0x58, "40" ) - PORT_DIPSETTING( 0x5c, "35" ) - PORT_DIPNAME( 0x20, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:!6") - PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPUNUSED_DIPLOC( 0x80, 0x00, "SW2:!8" ) - - PORT_START("DSWB") - PORT_DIPNAME( 0x03, 0x00, "Play Credit" ) PORT_DIPLOCATION("SW2:!1,!2") - PORT_DIPSETTING( 0x00, u8"¥10" ) - PORT_DIPSETTING( 0x01, u8"¥20" ) - PORT_DIPSETTING( 0x02, u8"¥30" ) - PORT_DIPSETTING( 0x03, u8"¥40" ) - PORT_DIPNAME( 0x1c, 0x00, "Coin Exchange" ) PORT_DIPLOCATION("SW2:!3,!4,!5") - PORT_DIPSETTING( 0x00, "12" ) - PORT_DIPSETTING( 0x04, "11" ) - PORT_DIPSETTING( 0x08, "10" ) - PORT_DIPSETTING( 0x0c, "6" ) - PORT_DIPSETTING( 0x10, "5" ) - PORT_DIPSETTING( 0x14, "4" ) - PORT_DIPSETTING( 0x18, "3" ) - PORT_DIPSETTING( 0x1c, DEF_STR ( Off ) ) - PORT_DIPUNUSED_DIPLOC( 0x20, 0x00, "SW2:!6" ) - PORT_DIPUNUSED_DIPLOC( 0x40, 0x00, "SW2:!7" ) - PORT_DIPUNUSED_DIPLOC( 0x80, 0x00, "SW2:!8" ) - - PORT_START("DSWC") - PORT_DIPUNUSED_DIPLOC( 0x01, 0x00, "SW3:!1" ) - PORT_DIPUNUSED_DIPLOC( 0x02, 0x00, "SW3:!2" ) - PORT_DIPUNUSED_DIPLOC( 0x04, 0x00, "SW3:!3" ) - PORT_DIPUNUSED_DIPLOC( 0x08, 0x00, "SW3:!4" ) - PORT_DIPUNUSED_DIPLOC( 0x10, 0x00, "SW3:!5" ) - PORT_DIPUNUSED_DIPLOC( 0x20, 0x00, "SW3:!6" ) - PORT_DIPUNUSED_DIPLOC( 0x40, 0x00, "SW3:!7" ) - PORT_DIPUNUSED_DIPLOC( 0x80, 0x00, "SW3:!8" ) - - PORT_START("IN1") - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 ) - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SLOT_STOP1 ) PORT_NAME("1") - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SLOT_STOP2 ) PORT_NAME("2") - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SLOT_STOP3 ) PORT_NAME("3") - PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED ) - - PORT_START("IN2") - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN2 ) PORT_NAME(u8"Coin 2 (¥10)") - PORT_SERVICE_NO_TOGGLE( 0x02, IP_ACTIVE_HIGH ) - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SLOT_STOP4 ) PORT_NAME("Down") - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", FUNC(ticket_dispenser_device::line_r)) - PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_MEMORY_RESET ) - PORT_BIT( 0xe0, IP_ACTIVE_HIGH, IPT_UNUSED ) - - PORT_START("SYS") - PORT_BIT( 0x03, IP_ACTIVE_HIGH, IPT_UNUSED ) - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_COIN3 ) PORT_NAME(u8"Coin Exchange (¥100)") - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_GAMBLE_BOOK ) - PORT_BIT( 0x30, IP_ACTIVE_HIGH, IPT_UNUSED ) - PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_GAMBLE_SERVICE ) PORT_NAME("Attendant Key") - PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_NAME("Coin 1 (Medal)") -INPUT_PORTS_END - -static INPUT_PORTS_START( othldrby ) - PORT_INCLUDE( toaplan2_3b ) - - PORT_MODIFY("SYS") - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_IMPULSE(1) - PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_COIN2 ) PORT_IMPULSE(1) - - PORT_MODIFY("DSWA") - PORT_DIPNAME( 0x01, 0x00, DEF_STR( Demo_Sounds ) ) - PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x02, 0x00, DEF_STR( Flip_Screen ) ) - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x02, DEF_STR( On ) ) - PORT_SERVICE( 0x04, IP_ACTIVE_HIGH ) - PORT_DIPNAME( 0x08, 0x00, DEF_STR( Allow_Continue ) ) - PORT_DIPSETTING( 0x08, DEF_STR( No ) ) - PORT_DIPSETTING( 0x00, DEF_STR( Yes ) ) - PORT_DIPNAME( 0x30, 0x00, DEF_STR( Coin_A ) ) - PORT_DIPSETTING( 0x30, DEF_STR( 3C_1C ) ) - PORT_DIPSETTING( 0x20, DEF_STR( 2C_1C ) ) - PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) - PORT_DIPSETTING( 0x10, DEF_STR( 1C_2C ) ) - PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Coin_B ) ) - PORT_DIPSETTING( 0xc0, DEF_STR( 3C_1C ) ) - PORT_DIPSETTING( 0x80, DEF_STR( 2C_1C ) ) - PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) - PORT_DIPSETTING( 0x40, DEF_STR( 1C_2C ) ) - - PORT_MODIFY("DSWB") - PORT_DIPNAME( 0x03, 0x00, DEF_STR( Difficulty ) ) - PORT_DIPSETTING( 0x01, DEF_STR( Easy ) ) - PORT_DIPSETTING( 0x00, DEF_STR( Normal ) ) - PORT_DIPSETTING( 0x02, DEF_STR( Hard ) ) - PORT_DIPSETTING( 0x03, DEF_STR( Very_Hard ) ) - PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unused ) ) - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x04, DEF_STR( On ) ) - PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unused ) ) - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x08, DEF_STR( On ) ) - PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unused ) ) - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x10, DEF_STR( On ) ) - PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unused ) ) - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x20, DEF_STR( On ) ) - PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unused ) ) - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x40, DEF_STR( On ) ) - PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unused ) ) - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x80, DEF_STR( On ) ) -INPUT_PORTS_END - - -static INPUT_PORTS_START( enmadaio ) - PORT_START("SYS") - PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_SERVICE1 ) - PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_TILT ) - TOAPLAN_TEST_SWITCH( 0x04, IP_ACTIVE_HIGH ) - PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_COIN1 ) - PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_COIN2 ) - PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_START1 ) - PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_START2 ) - PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_UNKNOWN ) - - PORT_START("DSWA") - PORT_DIPNAME( 0x0001, 0x0000, "Game Mode" ) - PORT_DIPSETTING( 0x0000, "Normal Game" ) - PORT_DIPSETTING( 0x0001, "Stop and Slow Mode" ) - PORT_DIPNAME( 0x0002, 0x0000, DEF_STR( Flip_Screen ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0002, DEF_STR( On ) ) - PORT_DIPNAME( 0x0004, 0x0000, DEF_STR( Unknown ) ) // unused - PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0004, DEF_STR( On ) ) - PORT_DIPNAME( 0x0008, 0x0000, DEF_STR( Demo_Sounds ) ) - PORT_DIPSETTING( 0x0008, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0030, 0x0030, DEF_STR( Coin_A ) ) - PORT_DIPSETTING( 0x0030, DEF_STR( 1C_1C ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( 2C_1C ) ) - PORT_DIPSETTING( 0x0010, DEF_STR( 3C_1C ) ) - PORT_DIPSETTING( 0x0020, DEF_STR( 4C_1C ) ) - PORT_DIPNAME( 0x0040, 0x0000, DEF_STR( Unknown ) ) // unused - PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0040, DEF_STR( On ) ) - PORT_DIPNAME( 0x0080, 0x0000, DEF_STR( Unknown ) ) // unused - PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0080, DEF_STR( On ) ) - - PORT_START("MISC2") // should be DSWB? but not even read in test mode display? - PORT_DIPNAME( 0x0001, 0x0001, "2" ) - PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0002, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0008, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0020, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0200, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0400, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0800, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x1000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x4000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x8000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - - PORT_START("MISC3") - PORT_DIPNAME( 0x0001, 0x0001, "3" ) - PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0002, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0008, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("yes") - PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("no") - PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0200, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0400, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0800, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x1000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x4000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x8000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - - PORT_START("MISC4") - PORT_DIPNAME( 0x0001, 0x0001, "4" ) - PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0002, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0004, 0x0000, "Status of Something 1" ) // gives error in attract mode otherwise - PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0008, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0020, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0040, 0x0000, "Status of Something 2" ) // turn this off and it comes up with an error - PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0200, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0400, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0800, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x1000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x4000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x8000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - - PORT_START("UNK") - PORT_BIT( 0xff, 0x00, IPT_DIAL ) PORT_SENSITIVITY(30) PORT_KEYDELTA(15) // this is the sensor, not sure what it measures, pulse / heartbeat? - PORT_DIPNAME( 0x0100, 0x0100, "Freeze" ) // not sure - PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0200, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0400, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0800, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x1000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x4000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x8000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - -INPUT_PORTS_END - -static INPUT_PORTS_START( snowbro2 ) - PORT_INCLUDE( toaplan2_2b ) - - PORT_START("IN3") - PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(3) PORT_8WAY - PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(3) PORT_8WAY - PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(3) PORT_8WAY - PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(3) PORT_8WAY - PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(3) - PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(3) - PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_START3 ) - PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_UNKNOWN ) - - PORT_START("IN4") - PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(4) PORT_8WAY - PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(4) PORT_8WAY - PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(4) PORT_8WAY - PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(4) PORT_8WAY - PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(4) - PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(4) - PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_START4 ) - PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_UNKNOWN ) - - PORT_MODIFY("DSWA") - PORT_DIPNAME( 0x0001, 0x0000, DEF_STR( Continue_Price ) ) PORT_DIPLOCATION("SW1:!1") - PORT_DIPSETTING( 0x0000, DEF_STR( Normal ) ) - PORT_DIPSETTING( 0x0001, "Discount" ) - // Various features on bit mask 0x000e - see above - TOAPLAN_COINAGE_DUAL_LOC( JMPR, 0x1c00, 0x0800, SW1 ) - - PORT_MODIFY("DSWB") - // Difficulty on bit mask 0x0003 - see above - PORT_DIPNAME( 0x000c, 0x0000, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW2:!3,!4") - PORT_DIPSETTING( 0x000c, DEF_STR( None ) ) - PORT_DIPSETTING( 0x0008, "200k only" ) - PORT_DIPSETTING( 0x0000, "100k only" ) - PORT_DIPSETTING( 0x0004, "100k and every 500k" ) - PORT_DIPNAME( 0x0030, 0x0000, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:!5,!6") - PORT_DIPSETTING( 0x0030, "1" ) - PORT_DIPSETTING( 0x0020, "2" ) - PORT_DIPSETTING( 0x0000, "3" ) - PORT_DIPSETTING( 0x0010, "4" ) - PORT_DIPNAME( 0x0040, 0x0000, "Invulnerability (Cheat)" ) PORT_DIPLOCATION("SW2:!7") - PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0040, DEF_STR( On ) ) - PORT_DIPNAME( 0x0080, 0x0000, "Maximum Players" ) PORT_DIPLOCATION("SW2:!8") - PORT_DIPSETTING( 0x0080, "2" ) - PORT_DIPSETTING( 0x0000, "4" ) - - PORT_START("JMPR") - PORT_CONFNAME( 0x2000, 0x0000, "Show All Rights Reserved" ) //PORT_CONFLOCATION("JP:!1") - PORT_CONFSETTING( 0x0000, DEF_STR( No ) ) - PORT_CONFSETTING( 0x2000, DEF_STR( Yes ) ) - PORT_CONFNAME( 0x1c00, 0x0800, DEF_STR( Region ) ) //PORT_CONFLOCATION("JP:!4,!3,!2") - PORT_CONFSETTING( 0x0800, DEF_STR( Europe ) ) - PORT_CONFSETTING( 0x0400, DEF_STR( USA ) ) - PORT_CONFSETTING( 0x0000, DEF_STR( Japan ) ) - PORT_CONFSETTING( 0x0c00, DEF_STR( Korea ) ) - PORT_CONFSETTING( 0x1000, DEF_STR( Hong_Kong ) ) - PORT_CONFSETTING( 0x1400, DEF_STR( Taiwan ) ) - PORT_CONFSETTING( 0x1800, DEF_STR( Southeast_Asia ) ) -// PORT_CONFSETTING( 0x1c00, DEF_STR( Unused ) ) - PORT_BIT( 0xc3ff, IP_ACTIVE_HIGH, IPT_UNKNOWN ) -INPUT_PORTS_END - - -static INPUT_PORTS_START( snowbro2b3 ) - PORT_START("IN1") - PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(1) PORT_8WAY - PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1) PORT_8WAY - PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1) PORT_8WAY - PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1) PORT_8WAY - PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(1) - PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(1) - PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_UNKNOWN ) - PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_UNKNOWN ) - PORT_BIT( 0xff00, IP_ACTIVE_HIGH, IPT_UNKNOWN ) - - PORT_START("IN2") - PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(2) PORT_8WAY - PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2) PORT_8WAY - PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2) PORT_8WAY - PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2) PORT_8WAY - PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2) - PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(2) - PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_UNKNOWN ) - PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_UNKNOWN ) - PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_SERVICE1 ) - PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_TILT ) - TOAPLAN_TEST_SWITCH( 0x0400, IP_ACTIVE_HIGH ) - PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_COIN1 ) - PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_COIN2 ) - PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_START1 ) - PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_START2 ) - PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_UNKNOWN ) - - PORT_START("IN3") - PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(3) PORT_8WAY - PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(3) PORT_8WAY - PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(3) PORT_8WAY - PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(3) PORT_8WAY - PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(3) - PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(3) - PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_START3 ) - PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_UNKNOWN ) - PORT_BIT( 0xff00, IP_ACTIVE_HIGH, IPT_UNKNOWN ) - - PORT_START("IN4") - PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(4) PORT_8WAY - PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(4) PORT_8WAY - PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(4) PORT_8WAY - PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(4) PORT_8WAY - PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(4) - PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(4) - PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_START4 ) - PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_UNKNOWN ) - PORT_BIT( 0xff00, IP_ACTIVE_HIGH, IPT_UNKNOWN ) - - PORT_START("DSWA") - PORT_DIPNAME( 0x01, 0x00, DEF_STR( Continue_Price ) ) PORT_DIPLOCATION("SW1:!1") - PORT_DIPSETTING( 0x00, DEF_STR( Normal ) ) - PORT_DIPSETTING( 0x01, "Discount" ) - PORT_DIPNAME( 0x02, 0x00, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW1:!2") - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x02, DEF_STR( On ) ) - PORT_SERVICE_DIPLOC( 0x04, IP_ACTIVE_HIGH, "SW1:!3" ) - PORT_DIPNAME( 0x08, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:!4") - PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x30, 0x00, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:!5,!6") - PORT_DIPSETTING( 0x30, DEF_STR( 4C_1C ) ) - PORT_DIPSETTING( 0x20, DEF_STR( 3C_1C ) ) - PORT_DIPSETTING( 0x10, DEF_STR( 2C_1C ) ) - PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) - PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW1:!7,!8") - PORT_DIPSETTING( 0x00, DEF_STR( 1C_2C ) ) - PORT_DIPSETTING( 0x40, DEF_STR( 1C_3C ) ) - PORT_DIPSETTING( 0x80, DEF_STR( 1C_4C ) ) - PORT_DIPSETTING( 0xc0, DEF_STR( 1C_6C ) ) - - PORT_START("DSWB") - PORT_DIPNAME( 0x03, 0x00, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:!1,!2") - PORT_DIPSETTING( 0x01, DEF_STR( Easy ) ) - PORT_DIPSETTING( 0x00, DEF_STR( Normal ) ) - PORT_DIPSETTING( 0x02, DEF_STR( Hard ) ) - PORT_DIPSETTING( 0x03, DEF_STR( Very_Hard ) ) - PORT_DIPNAME( 0x000c, 0x0000, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW2:!3,!4") - PORT_DIPSETTING( 0x000c, DEF_STR( None ) ) - PORT_DIPSETTING( 0x0008, "200k only" ) - PORT_DIPSETTING( 0x0000, "100k only" ) - PORT_DIPSETTING( 0x0004, "100k and every 500k" ) - PORT_DIPNAME( 0x0030, 0x0000, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:!5,!6") - PORT_DIPSETTING( 0x0030, "1" ) - PORT_DIPSETTING( 0x0020, "2" ) - PORT_DIPSETTING( 0x0000, "3" ) - PORT_DIPSETTING( 0x0010, "4" ) - PORT_DIPNAME( 0x0040, 0x0000, "Invulnerability (Cheat)" ) PORT_DIPLOCATION("SW2:!7") - PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0040, DEF_STR( On ) ) - PORT_DIPNAME( 0x0080, 0x0000, "Maximum Players" ) PORT_DIPLOCATION("SW2:!8") - PORT_DIPSETTING( 0x0080, "2" ) - PORT_DIPSETTING( 0x0000, "4" ) -INPUT_PORTS_END - - -static INPUT_PORTS_START( sstriker ) - PORT_INCLUDE( toaplan2_3b ) - - PORT_MODIFY("DSWA") - PORT_DIPNAME( 0x0001, 0x0000, DEF_STR( Free_Play ) ) PORT_DIPLOCATION("SW1:!1") - PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0001, DEF_STR( On ) ) - // Various features on bit mask 0x000e - see above - TOAPLAN_COINAGE_DUAL_LOC( JMPR, 0x0e, 0x04, SW1 ) - - PORT_MODIFY("DSWB") - // Difficulty on bit mask 0x0003 - see above - PORT_DIPNAME( 0x000c, 0x0000, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW2:!3,!4") - PORT_DIPSETTING( 0x000c, DEF_STR( None ) ) - PORT_DIPSETTING( 0x0008, "200k only" ) - PORT_DIPSETTING( 0x0000, "Every 300k" ) - PORT_DIPSETTING( 0x0004, "200k and 500k" ) - PORT_DIPNAME( 0x0030, 0x0000, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:!5,!6") - PORT_DIPSETTING( 0x0030, "1" ) - PORT_DIPSETTING( 0x0020, "2" ) - PORT_DIPSETTING( 0x0000, "3" ) - PORT_DIPSETTING( 0x0010, "5" ) - PORT_DIPNAME( 0x0040, 0x0000, "Invulnerability (Cheat)" ) PORT_DIPLOCATION("SW2:!7") - PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0040, DEF_STR( On ) ) - PORT_DIPNAME( 0x0080, 0x0000, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("SW2:!8") - PORT_DIPSETTING( 0x0080, DEF_STR( No ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( Yes ) ) - - PORT_START("JMPR") - PORT_CONFNAME( 0x0001, 0x0001, "FBI Logo" ) //PORT_CONFLOCATION("JP:!4") - PORT_CONFSETTING( 0x0001, DEF_STR( Off ) ) - PORT_CONFSETTING( 0x0000, DEF_STR( On ) ) - PORT_CONFNAME( 0x000e, 0x0004, DEF_STR( Region ) ) //PORT_CONFLOCATION("JP:!3,!2,!1") - PORT_CONFSETTING( 0x0004, DEF_STR( Europe ) ) - PORT_CONFSETTING( 0x0002, DEF_STR( USA ) ) - PORT_CONFSETTING( 0x0000, DEF_STR( Japan ) ) - PORT_CONFSETTING( 0x0006, DEF_STR( Southeast_Asia ) ) - PORT_CONFSETTING( 0x0008, DEF_STR( China ) ) - PORT_CONFSETTING( 0x000a, DEF_STR( Korea ) ) - PORT_CONFSETTING( 0x000c, DEF_STR( Hong_Kong ) ) - PORT_CONFSETTING( 0x000e, DEF_STR( Taiwan ) ) -INPUT_PORTS_END - - -static INPUT_PORTS_START( sstrikerk ) // Although the region jumper is functional, it's a Korean board / version - PORT_INCLUDE( sstriker ) - - PORT_MODIFY("JMPR") - PORT_CONFNAME( 0x000e, 0x000a, DEF_STR( Region ) ) //PORT_CONFLOCATION("JP:!3,!2,!1") - PORT_CONFSETTING( 0x0004, DEF_STR( Europe ) ) - PORT_CONFSETTING( 0x0002, DEF_STR( USA ) ) - PORT_CONFSETTING( 0x0000, DEF_STR( Japan ) ) - PORT_CONFSETTING( 0x0006, DEF_STR( Southeast_Asia ) ) - PORT_CONFSETTING( 0x0008, DEF_STR( China ) ) - PORT_CONFSETTING( 0x000a, "Korea (Unite Trading)" ) - PORT_CONFSETTING( 0x000c, DEF_STR( Hong_Kong ) ) - PORT_CONFSETTING( 0x000e, DEF_STR( Taiwan ) ) -INPUT_PORTS_END - - -static INPUT_PORTS_START( mahoudai ) - PORT_INCLUDE( sstriker ) - - PORT_MODIFY("JMPR") - // Effectively unused by this set - see notes - PORT_BIT( 0xffff, IP_ACTIVE_HIGH, IPT_UNKNOWN ) -INPUT_PORTS_END - - -static INPUT_PORTS_START( kingdmgp ) - PORT_INCLUDE( sstriker ) - - // The code and lookup tables pertaining to the jumpers are almost identical to sstriker. - // However, this set apparently lacks (reachable) code to display the FBI logo, - // even though the logo itself is present in the gfx ROMs. - PORT_MODIFY("JMPR") - PORT_CONFNAME( 0x0001, 0x0000, DEF_STR( Unused ) ) //PORT_CONFLOCATION("JP:!4") - PORT_CONFSETTING( 0x0000, DEF_STR( Off ) ) - PORT_CONFSETTING( 0x0001, DEF_STR( On ) ) - PORT_CONFNAME( 0x000e, 0x0004, DEF_STR( Region ) ) //PORT_CONFLOCATION("JP:!3,!2,!1") - PORT_CONFSETTING( 0x0004, DEF_STR( Europe ) ) - PORT_CONFSETTING( 0x0002, DEF_STR( USA ) ) -// PORT_CONFSETTING( 0x0000, DEF_STR( Japan ) ) // Corrupt title screen and text - use shippumd - PORT_CONFSETTING( 0x0006, DEF_STR( Southeast_Asia ) ) - PORT_CONFSETTING( 0x0008, DEF_STR( China ) ) - PORT_CONFSETTING( 0x000a, "Korea (Unite Trading license)" ) - PORT_CONFSETTING( 0x000c, DEF_STR( Hong_Kong ) ) - PORT_CONFSETTING( 0x000e, DEF_STR( Taiwan ) ) -INPUT_PORTS_END - - -static INPUT_PORTS_START( shippumd ) - PORT_INCLUDE( sstriker ) - - PORT_MODIFY("JMPR") - // Title screen and text are corrupt for anything but Japan - PORT_BIT( 0xffff, IP_ACTIVE_HIGH, IPT_UNKNOWN ) -INPUT_PORTS_END - - -static INPUT_PORTS_START( bgaregga ) - PORT_START("IN1") - PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(1) PORT_8WAY - PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1) PORT_8WAY - PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1) PORT_8WAY - PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1) PORT_8WAY - PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(1) - PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(1) - PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_PLAYER(1) - PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_UNKNOWN ) - PORT_BIT( 0xff00, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // Unknown/Unused - - PORT_START("IN2") - PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(2) PORT_8WAY - PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2) PORT_8WAY - PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2) PORT_8WAY - PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2) PORT_8WAY - PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2) - PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(2) - PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_PLAYER(2) - PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_UNKNOWN ) - PORT_BIT( 0xff00, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // Unknown/Unused - - PORT_START("SYS") - PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_SERVICE1 ) - PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_UNKNOWN ) - TOAPLAN_TEST_SWITCH( 0x04, IP_ACTIVE_HIGH ) - PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_COIN1 ) - PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_COIN2 ) - PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_START1 ) - PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_START2 ) - PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_UNKNOWN ) - PORT_BIT( 0xff00, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // Unknown/Unused - - PORT_START("DSWA") - PORT_SERVICE_DIPLOC(0x0001, IP_ACTIVE_HIGH, "SW1:!1") - PORT_DIPNAME( 0x0002, 0x0000, "Credits to Start" ) PORT_DIPLOCATION("SW1:!2") - PORT_DIPSETTING( 0x0000, "1" ) - PORT_DIPSETTING( 0x0002, "2" ) - PORT_DIPNAME( 0x001c, 0x0000, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:!3,!4,!5") - PORT_DIPSETTING( 0x0018, DEF_STR( 4C_1C ) ) - PORT_DIPSETTING( 0x0014, DEF_STR( 3C_1C ) ) - PORT_DIPSETTING( 0x0010, DEF_STR( 2C_1C ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( 1C_1C ) ) - PORT_DIPSETTING( 0x0004, DEF_STR( 1C_2C ) ) - PORT_DIPSETTING( 0x0008, DEF_STR( 1C_3C ) ) - PORT_DIPSETTING( 0x000c, DEF_STR( 1C_4C ) ) - PORT_DIPSETTING( 0x001c, DEF_STR( Free_Play ) ) - PORT_DIPNAME( 0x00e0, 0x0000, DEF_STR( Coin_B ) ) PORT_CONDITION("DSWA", 0x001c, NOTEQUALS, 0x001c) PORT_DIPLOCATION("SW1:!6,!7,!8") - PORT_DIPSETTING( 0x00c0, DEF_STR( 4C_1C ) ) PORT_CONDITION("DSWA", 0x001c, NOTEQUALS, 0x001c) - PORT_DIPSETTING( 0x00a0, DEF_STR( 3C_1C ) ) PORT_CONDITION("DSWA", 0x001c, NOTEQUALS, 0x001c) - PORT_DIPSETTING( 0x0080, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSWA", 0x001c, NOTEQUALS, 0x001c) - PORT_DIPSETTING( 0x0000, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSWA", 0x001c, NOTEQUALS, 0x001c) -// PORT_DIPSETTING( 0x00e0, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSWA", 0x001c, NOTEQUALS, 0x001c) - PORT_DIPSETTING( 0x0020, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSWA", 0x001c, NOTEQUALS, 0x001c) - PORT_DIPSETTING( 0x0040, DEF_STR( 1C_3C ) ) PORT_CONDITION("DSWA", 0x001c, NOTEQUALS, 0x001c) - PORT_DIPSETTING( 0x0060, DEF_STR( 1C_4C ) ) PORT_CONDITION("DSWA", 0x001c, NOTEQUALS, 0x001c) - // When Coin_A is set to Free_Play, Coin_A becomes Coin_A and Coin_B, and the following dips occur - PORT_DIPNAME( 0x0020, 0x0000, "Joystick Mode" ) PORT_CONDITION("DSWA", 0x001c, EQUALS, 0x001c) PORT_DIPLOCATION("SW1:!6") - PORT_DIPSETTING( 0x0000, "90 degrees ACW" ) PORT_CONDITION("DSWA", 0x001c, EQUALS, 0x001c) - PORT_DIPSETTING( 0x0020, DEF_STR( Normal ) ) PORT_CONDITION("DSWA", 0x001c, EQUALS, 0x001c) - PORT_DIPNAME( 0x0040, 0x0000, "Effect" ) PORT_CONDITION("DSWA", 0x001c, EQUALS, 0x001c) PORT_DIPLOCATION("SW1:!7") - PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) PORT_CONDITION("DSWA", 0x001c, EQUALS, 0x001c) - PORT_DIPSETTING( 0x0040, DEF_STR( On ) ) PORT_CONDITION("DSWA", 0x001c, EQUALS, 0x001c) - PORT_DIPNAME( 0x0080, 0x0000, "Music" ) PORT_CONDITION("DSWA", 0x001c, EQUALS, 0x001c) PORT_DIPLOCATION("SW1:!8") - PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) PORT_CONDITION("DSWA", 0x001c, EQUALS, 0x001c) - PORT_DIPSETTING( 0x0080, DEF_STR( On ) ) PORT_CONDITION("DSWA", 0x001c, EQUALS, 0x001c) - - PORT_START("DSWB") - PORT_DIPNAME( 0x0003, 0x0000, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:!1,!2") - PORT_DIPSETTING( 0x0001, DEF_STR( Easy ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( Normal ) ) - PORT_DIPSETTING( 0x0002, DEF_STR( Hard ) ) - PORT_DIPSETTING( 0x0003, DEF_STR( Very_Hard ) ) - PORT_DIPNAME( 0x0004, 0x0000, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW2:!3") - PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0004, DEF_STR( On ) ) - PORT_DIPNAME( 0x0008, 0x0000, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:!4") - PORT_DIPSETTING( 0x0008, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0070, 0x0000, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:!5,!6,!7") - PORT_DIPSETTING( 0x0030, "1" ) - PORT_DIPSETTING( 0x0020, "2" ) - PORT_DIPSETTING( 0x0000, "3" ) - PORT_DIPSETTING( 0x0010, "4" ) - PORT_DIPSETTING( 0x0040, "5" ) - PORT_DIPSETTING( 0x0050, "6" ) - PORT_DIPSETTING( 0x0060, DEF_STR( Infinite ) ) - PORT_DIPSETTING( 0x0070, "Invulnerability (Cheat)" ) - PORT_DIPNAME( 0x0080, 0x0000, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW2:!8") - PORT_DIPSETTING( 0x0000, DEF_STR( None ) ) PORT_CONDITION("JMPR",0x0003,NOTEQUALS,0x0000) // Non-Japan - PORT_DIPSETTING( 0x0080, "Every 2000k" ) PORT_CONDITION("JMPR",0x0003,NOTEQUALS,0x0000) // Non-Japan - PORT_DIPSETTING( 0x0080, "1000k and 2000k" ) PORT_CONDITION("JMPR",0x0003,EQUALS,0x0000) // Japan - PORT_DIPSETTING( 0x0000, "Every 1000k" ) PORT_CONDITION("JMPR",0x0003,EQUALS,0x0000) // Japan - - PORT_START("JMPR") // DSW3 and jumper - PORT_DIPNAME( 0x0008, 0x0000, "Stage Edit" ) PORT_DIPLOCATION("SW3:!1") - PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0008, DEF_STR( On ) ) - PORT_DIPNAME( 0x0004, 0x0000, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("SW3:!2") - PORT_DIPSETTING( 0x0004, DEF_STR( No ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( Yes ) ) - PORT_CONFNAME( 0x0003, 0x0001, DEF_STR( Region ) ) //PORT_CONFLOCATION("JP:!2,!1") - PORT_CONFSETTING( 0x0001, "Europe (Tuning)" ) - PORT_CONFSETTING( 0x0002, "USA (Fabtek)" ) - PORT_CONFSETTING( 0x0000, DEF_STR( Japan ) ) - PORT_CONFSETTING( 0x0003, DEF_STR( Asia ) ) -INPUT_PORTS_END - - -static INPUT_PORTS_START( bgareggahk ) - PORT_INCLUDE( bgaregga ) - - PORT_MODIFY("JMPR") - PORT_CONFNAME( 0x0003, 0x0003, DEF_STR( Region ) ) //PORT_CONFLOCATION("JP:!2,!1") - PORT_CONFSETTING( 0x0001, "Austria (Tuning)" ) - // These two settings end up reporting ROM-0 as BAD -// PORT_CONFSETTING( 0x0002, "USA (Fabtek)" ) -// PORT_CONFSETTING( 0x0000, DEF_STR( Japan ) ) - PORT_CONFSETTING( 0x0003, "Hong Kong (Metrotainment)" ) -INPUT_PORTS_END - - -static INPUT_PORTS_START( bgareggatw ) - PORT_INCLUDE( bgaregga ) - - PORT_MODIFY("JMPR") - PORT_CONFNAME( 0x0003, 0x0003, DEF_STR( Region ) ) //PORT_CONFLOCATION("JP:!2,!1") - PORT_CONFSETTING( 0x0001, "Germany (Tuning)" ) - // These two settings end up reporting ROM-0 as BAD -// PORT_CONFSETTING( 0x0002, "USA (Fabtek)" ) -// PORT_CONFSETTING( 0x0000, DEF_STR( Japan ) ) - PORT_CONFSETTING( 0x0003, "Taiwan (Liang Hwa)" ) -INPUT_PORTS_END - - -static INPUT_PORTS_START( bgareggak ) - PORT_INCLUDE( bgaregga ) - - PORT_MODIFY("JMPR") - PORT_CONFNAME( 0x0003, 0x0003, DEF_STR( Region ) ) //PORT_CONFLOCATION("JP:!2,!1") - PORT_CONFSETTING( 0x0001, "Greece" ) - PORT_CONFSETTING( 0x0003, "Korea" ) -INPUT_PORTS_END - - -static INPUT_PORTS_START( bgareggacn ) - PORT_INCLUDE( bgaregga ) - - PORT_MODIFY("JMPR") - PORT_CONFNAME( 0x0003, 0x0003, DEF_STR( Region ) ) //PORT_CONFLOCATION("JP:!2,!1") - PORT_CONFSETTING( 0x0001, "Denmark (Tuning)" ) - // These two settings end up reporting ROM-0 as BAD -// PORT_CONFSETTING( 0x0002, "USA (Fabtek)" ) -// PORT_CONFSETTING( 0x0000, DEF_STR( Japan ) ) - PORT_CONFSETTING( 0x0003, DEF_STR( China ) ) -INPUT_PORTS_END - - -static INPUT_PORTS_START( bgareggabl ) - PORT_INCLUDE( bgaregga ) - - PORT_MODIFY("DSWB") // Always uses bonus life settings from Japan region - PORT_DIPNAME( 0x0080, 0x0000, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW2:!8") - PORT_DIPSETTING( 0x0080, "1000k and 2000k" ) - PORT_DIPSETTING( 0x0000, "Every 1000k" ) - - PORT_MODIFY("JMPR") // Region is hard-coded - PORT_BIT( 0x0003, IP_ACTIVE_HIGH, IPT_UNKNOWN ) -INPUT_PORTS_END - - -static INPUT_PORTS_START( batrider ) - PORT_START("IN") // Player Inputs - PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1) - PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1) - PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1) - PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1) - PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(1) - PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(1) - PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_PLAYER(1) - PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2) - PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2) - PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2) - PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2) - PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2) - PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(2) - PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_PLAYER(2) - PORT_BIT( 0x8080, IP_ACTIVE_HIGH, IPT_UNKNOWN ) - - PORT_START("DSW") // DSWA and DSWB - PORT_SERVICE_DIPLOC(0x0001, IP_ACTIVE_HIGH, "SW1:!1") - PORT_DIPNAME( 0x0002, 0x0000, "Credits to Start" ) PORT_CONDITION("DSW", 0x001c, NOTEQUALS, 0x001c) PORT_DIPLOCATION("SW1:!2") - PORT_DIPSETTING( 0x0000, "1" ) PORT_CONDITION("DSW", 0x001c, NOTEQUALS, 0x001c) - PORT_DIPSETTING( 0x0002, "2" ) PORT_CONDITION("DSW", 0x001c, NOTEQUALS, 0x001c) - PORT_DIPNAME( 0x0002, 0x0000, "Joystick Mode" ) PORT_CONDITION("DSW", 0x001c, EQUALS, 0x001c) PORT_DIPLOCATION("SW1:!2") - PORT_DIPSETTING( 0x0000, DEF_STR( Normal ) ) PORT_CONDITION("DSW", 0x001c, EQUALS, 0x001c) - PORT_DIPSETTING( 0x0002, "90 degrees ACW" ) PORT_CONDITION("DSW", 0x001c, EQUALS, 0x001c) - PORT_DIPNAME( 0x001c, 0x0000, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:!3,!4,!5") - PORT_DIPSETTING( 0x0018, DEF_STR( 4C_1C ) ) - PORT_DIPSETTING( 0x0014, DEF_STR( 3C_1C ) ) - PORT_DIPSETTING( 0x0010, DEF_STR( 2C_1C ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( 1C_1C ) ) - PORT_DIPSETTING( 0x0004, DEF_STR( 1C_2C ) ) - PORT_DIPSETTING( 0x0008, DEF_STR( 1C_3C ) ) - PORT_DIPSETTING( 0x000c, DEF_STR( 1C_4C ) ) - PORT_DIPSETTING( 0x001c, DEF_STR( Free_Play ) ) - PORT_DIPNAME( 0x00e0, 0x0000, DEF_STR( Coin_B ) ) PORT_CONDITION("DSW", 0x001c, NOTEQUALS, 0x001c) PORT_DIPLOCATION("SW1:!6,!7,!8") - PORT_DIPSETTING( 0x00c0, DEF_STR( 4C_1C ) ) PORT_CONDITION("DSW", 0x001c, NOTEQUALS, 0x001c) - PORT_DIPSETTING( 0x00a0, DEF_STR( 3C_1C ) ) PORT_CONDITION("DSW", 0x001c, NOTEQUALS, 0x001c) - PORT_DIPSETTING( 0x0080, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW", 0x001c, NOTEQUALS, 0x001c) - PORT_DIPSETTING( 0x0000, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW", 0x001c, NOTEQUALS, 0x001c) -// PORT_DIPSETTING( 0x00e0, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW", 0x001c, NOTEQUALS, 0x001c) - PORT_DIPSETTING( 0x0020, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW", 0x001c, NOTEQUALS, 0x001c) - PORT_DIPSETTING( 0x0040, DEF_STR( 1C_3C ) ) PORT_CONDITION("DSW", 0x001c, NOTEQUALS, 0x001c) - PORT_DIPSETTING( 0x0060, DEF_STR( 1C_4C ) ) PORT_CONDITION("DSW", 0x001c, NOTEQUALS, 0x001c) - // When Coin_A is set to Free_Play, Coin_A becomes Coin_A and Coin_B, and the following dips occur - PORT_DIPNAME( 0x0020, 0x0000, "Hit Score" ) PORT_CONDITION("DSW", 0x001c, EQUALS, 0x001c) PORT_DIPLOCATION("SW1:!6") - PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) PORT_CONDITION("DSW", 0x001c, EQUALS, 0x001c) - PORT_DIPSETTING( 0x0020, DEF_STR( On ) ) PORT_CONDITION("DSW", 0x001c, EQUALS, 0x001c) - PORT_DIPNAME( 0x0040, 0x0000, "Sound Effect" ) PORT_CONDITION("DSW", 0x001c, EQUALS, 0x001c) PORT_DIPLOCATION("SW1:!7") - PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) PORT_CONDITION("DSW", 0x001c, EQUALS, 0x001c) - PORT_DIPSETTING( 0x0040, DEF_STR( On ) ) PORT_CONDITION("DSW", 0x001c, EQUALS, 0x001c) - PORT_DIPNAME( 0x0080, 0x0000, "Music" ) PORT_CONDITION("DSW", 0x001c, EQUALS, 0x001c) PORT_DIPLOCATION("SW1:!8") - PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) PORT_CONDITION("DSW", 0x001c, EQUALS, 0x001c) - PORT_DIPSETTING( 0x0080, DEF_STR( On ) ) PORT_CONDITION("DSW", 0x001c, EQUALS, 0x001c) - PORT_DIPNAME( 0x0300, 0x0000, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:!1,!2") - PORT_DIPSETTING( 0x0100, DEF_STR( Easy ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( Normal ) ) - PORT_DIPSETTING( 0x0200, DEF_STR( Hard ) ) - PORT_DIPSETTING( 0x0300, DEF_STR( Very_Hard ) ) - PORT_DIPNAME( 0x0c00, 0x0000, "Timer" ) PORT_DIPLOCATION("SW2:!3,!4") - PORT_DIPSETTING( 0x0c00, DEF_STR( Highest ) ) - PORT_DIPSETTING( 0x0800, DEF_STR( High ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( Normal ) ) - PORT_DIPSETTING( 0x0400, DEF_STR( Low ) ) - PORT_DIPNAME( 0x3000, 0x0000, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:!5,!6") - PORT_DIPSETTING( 0x3000, "1" ) - PORT_DIPSETTING( 0x2000, "2" ) - PORT_DIPSETTING( 0x0000, "3" ) - PORT_DIPSETTING( 0x1000, "4" ) - PORT_DIPNAME( 0xc000, 0x0000, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW2:!7,!8") - PORT_DIPSETTING( 0xc000, DEF_STR( None ) ) - PORT_DIPSETTING( 0x8000, "Every 2000k" ) - PORT_DIPSETTING( 0x0000, "Every 1500k" ) - PORT_DIPSETTING( 0x4000, "Every 1000k" ) - - PORT_START("SYS-DSW") // Coin/System and DSWC - PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_SERVICE1 ) - PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_UNKNOWN) - TOAPLAN_TEST_SWITCH( 0x0004, IP_ACTIVE_HIGH ) - PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_COIN1 ) - PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_COIN2 ) - PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_START1 ) - PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_START2 ) - PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_UNKNOWN ) - PORT_DIPNAME( 0x0100, 0x0000, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW3:!1") - PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0100, DEF_STR( On ) ) - PORT_DIPNAME( 0x0200, 0x0000, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW3:!2") - PORT_DIPSETTING( 0x0200, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0400, 0x0000, "Stage Edit" ) PORT_DIPLOCATION("SW3:!3") - PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0400, DEF_STR( On ) ) - PORT_DIPNAME( 0x0800, 0x0000, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("SW3:!4") - PORT_DIPSETTING( 0x0800, DEF_STR( No ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( Yes ) ) - PORT_DIPNAME( 0x1000, 0x0000, "Invulnerability (Cheat)" ) PORT_DIPLOCATION("SW3:!5") - PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x1000, DEF_STR( On ) ) - // These dips are shown only when Coin_A is set to Free_Play, but they work in normal play mode too - PORT_DIPNAME( 0x2000, 0x0000, "Guest Players" ) PORT_DIPLOCATION("SW3:!6") - PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x4000, 0x0000, "Player Select" ) PORT_DIPLOCATION("SW3:!7") - PORT_DIPSETTING( 0x4000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x8000, 0x0000, "Special Course" ) PORT_DIPLOCATION("SW3:!8") - PORT_DIPSETTING( 0x8000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) -INPUT_PORTS_END - - -static INPUT_PORTS_START( batriderj ) - PORT_INCLUDE( batrider ) - - PORT_MODIFY("SYS-DSW") // Coin/System and DSWC - // These dips are shown only when Coin_A is set to Free_Play, but they work in normal play mode too - PORT_DIPNAME( 0x2000, 0x0000, "Guest Players" ) PORT_DIPLOCATION("SW3:!6") - PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x2000, DEF_STR( On ) ) - PORT_DIPNAME( 0x4000, 0x0000, "Player Select" ) PORT_DIPLOCATION("SW3:!7") - PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x4000, DEF_STR( On ) ) - PORT_DIPNAME( 0x8000, 0x0000, "Special Course" ) PORT_DIPLOCATION("SW3:!8") - PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x8000, DEF_STR( On ) ) -INPUT_PORTS_END - - -static INPUT_PORTS_START( bbakraid ) - PORT_INCLUDE( batrider ) - - PORT_MODIFY("DSW") // DSWA and DSWB - PORT_DIPNAME( 0xc000, 0x0000, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW2:!7,!8") - PORT_DIPSETTING( 0xc000, DEF_STR( None ) ) - PORT_DIPSETTING( 0x8000, "Every 4000k" ) - PORT_DIPSETTING( 0x4000, "Every 3000k" ) - PORT_DIPSETTING( 0x0000, "Every 2000k" ) - - PORT_MODIFY("SYS-DSW") // Coin/System and DSW-3 - PORT_DIPNAME( 0x2000, 0x0000, "Save Scores" ) PORT_DIPLOCATION("SW3:!6") - PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x4000, 0x0000, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW3:!7") - PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x4000, DEF_STR( On ) ) - PORT_DIPNAME( 0x8000, 0x0000, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW3:!8") - PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x8000, DEF_STR( On ) ) - - PORT_START( "EEPROMOUT" ) - PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", FUNC(eeprom_serial_93cxx_device::cs_write)) - PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", FUNC(eeprom_serial_93cxx_device::di_write)) - PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", FUNC(eeprom_serial_93cxx_device::clk_write)) -INPUT_PORTS_END - - -static INPUT_PORTS_START( nprobowl ) - PORT_START("IN") // Player Inputs - PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_COIN1 ) - PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_SERVICE1 ) - PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_START1 ) - PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_START2 ) - PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("Set (Relay)") - PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // no effect in test mode - PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("Gutter L") - PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("Gutter R") - PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // no effect in test mode - PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_NAME("Ballout") - PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_NAME("Ballpass") - PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_BUTTON6 ) PORT_NAME("Mot Home") - PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // no effect in test mode - PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // no effect in test mode - PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // no effect in test mode - PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // no effect in test mode - - PORT_START("DSW") // SW0323 and SW0324 - PORT_SERVICE_DIPLOC( 0x0001, IP_ACTIVE_HIGH, "SW0323:!1") - PORT_DIPUNKNOWN_DIPLOC(0x0002, 0x0000, "SW0323:!2") - PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW0323:!3") - PORT_DIPSETTING( 0x0004, DEF_STR( On ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) - PORT_DIPUNKNOWN_DIPLOC(0x0008, 0x0000, "SW0323:!4") - PORT_DIPNAME( 0x0070, 0x0000, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW0323:!5,!6,!7") - PORT_DIPSETTING( 0x0070, DEF_STR( 5C_1C ) ) - PORT_DIPSETTING( 0x0060, DEF_STR( 4C_1C ) ) - PORT_DIPSETTING( 0x0050, DEF_STR( 3C_1C ) ) - PORT_DIPSETTING( 0x0040, DEF_STR( 2C_1C ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( 1C_1C ) ) - PORT_DIPSETTING( 0x0010, DEF_STR( 1C_2C ) ) - PORT_DIPSETTING( 0x0020, DEF_STR( 1C_3C ) ) - PORT_DIPSETTING( 0x0030, DEF_STR( 1C_4C ) ) - PORT_DIPNAME( 0x0080, 0x0000, DEF_STR( Free_Play ) ) PORT_DIPLOCATION("SW0323:!8") - PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0080, DEF_STR( On ) ) - PORT_DIPUNKNOWN_DIPLOC(0x0100, 0x0000, "SW0324:!1") - PORT_DIPUNKNOWN_DIPLOC(0x0200, 0x0000, "SW0324:!2") - PORT_DIPUNKNOWN_DIPLOC(0x0400, 0x0000, "SW0324:!3") - PORT_DIPUNKNOWN_DIPLOC(0x0800, 0x0000, "SW0324:!4") - PORT_DIPUNKNOWN_DIPLOC(0x1000, 0x0000, "SW0324:!5") - PORT_DIPUNKNOWN_DIPLOC(0x2000, 0x0000, "SW0324:!6") - PORT_DIPUNKNOWN_DIPLOC(0x4000, 0x0000, "SW0324:!7") - PORT_DIPUNKNOWN_DIPLOC(0x8000, 0x0000, "SW0324:!8") - - PORT_START("UNK") // ?? - PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_UNKNOWN ) - PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_UNKNOWN ) - PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_UNKNOWN ) - PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_UNKNOWN ) - PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_UNKNOWN ) - PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_UNKNOWN ) - PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_UNKNOWN ) - PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_UNKNOWN ) - PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_UNKNOWN ) - PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_UNKNOWN ) - PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_UNKNOWN ) - PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_UNKNOWN ) - PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_UNKNOWN ) - PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_UNKNOWN ) - PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_UNKNOWN ) - PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_UNKNOWN ) -INPUT_PORTS_END - - -// Text layer graphics -- ROM based in some games, RAM based in others -// See video/gp9001.cpp for the main graphics layouts - -#define XOR(a) WORD_XOR_LE(a) -#define LOC(x) (x+XOR(0)) - -static const gfx_layout truxton2_tx_tilelayout = -{ - 8,8, /* 8x8 characters */ - 1024, /* 1024 characters */ - 4, /* 4 bits per pixel */ - { STEP4(0,1) }, - { LOC(0)*4, LOC(1)*4, LOC(4)*4, LOC(5)*4, LOC(8)*4, LOC(9)*4, LOC(12)*4, LOC(13)*4 }, - { STEP8(0,8*8) }, - 8*8*8 -}; - -static const gfx_layout batrider_tx_tilelayout = -{ - 8,8, /* 8x8 characters */ - 1024, /* 1024 characters */ - 4, /* 4 bits per pixel */ - { STEP4(0,1) }, - { XOR(0)*4, XOR(1)*4, XOR(2)*4, XOR(3)*4, XOR(4)*4, XOR(5)*4, XOR(6)*4, XOR(7)*4 }, - { STEP8(0,4*8) }, - 8*8*4 -}; - -static GFXDECODE_START( gfx_truxton2 ) - GFXDECODE_ENTRY( nullptr, 0, truxton2_tx_tilelayout, 64*16, 64 ) -GFXDECODE_END - -static GFXDECODE_START( gfx_textrom ) - GFXDECODE_ENTRY( "text", 0, gfx_8x8x4_packed_msb, 64*16, 64 ) -GFXDECODE_END - -static GFXDECODE_START( gfx_batrider ) - GFXDECODE_ENTRY( nullptr, 0, batrider_tx_tilelayout, 64*16, 64 ) -GFXDECODE_END - - -void toaplan2_state::tekipaki(machine_config &config) -{ - /* basic machine hardware */ - M68000(config, m_maincpu, 10_MHz_XTAL); // 10MHz Oscillator - m_maincpu->set_addrmap(AS_PROGRAM, &toaplan2_state::tekipaki_68k_mem); - m_maincpu->reset_cb().set(FUNC(toaplan2_state::toaplan2_reset)); - - hd647180x_device &audiocpu(HD647180X(config, m_audiocpu, 10_MHz_XTAL)); - // 16k byte ROM and 512 byte RAM are internal - audiocpu.set_addrmap(AS_IO, &toaplan2_state::hd647180_io_map); - audiocpu.in_pa_callback().set(FUNC(toaplan2_state::tekipaki_cmdavailable_r)); - - config.set_maximum_quantum(attotime::from_hz(600)); - - /* video hardware */ - SCREEN(config, m_screen, SCREEN_TYPE_RASTER); - m_screen->set_video_attributes(VIDEO_UPDATE_BEFORE_VBLANK); - m_screen->set_raw(27_MHz_XTAL/4, 432, 0, 320, 262, 0, 240); - //m_screen->set_refresh_hz(60); - //m_screen->set_size(432, 262); - //m_screen->set_visarea(0, 319, 0, 239); - m_screen->set_screen_update(FUNC(toaplan2_state::screen_update_toaplan2)); - m_screen->screen_vblank().set(FUNC(toaplan2_state::screen_vblank)); - m_screen->set_palette(m_palette); - - PALETTE(config, m_palette).set_format(palette_device::xBGR_555, T2PALETTE_LENGTH); - - GP9001_VDP(config, m_vdp[0], 27_MHz_XTAL); - m_vdp[0]->set_palette(m_palette); - m_vdp[0]->vint_out_cb().set_inputline(m_maincpu, M68K_IRQ_4); - - MCFG_VIDEO_START_OVERRIDE(toaplan2_state,toaplan2) - - /* sound hardware */ - SPEAKER(config, "mono").front_center(); - - GENERIC_LATCH_8(config, m_soundlatch[0]); - - ym3812_device &ymsnd(YM3812(config, "ymsnd", 27_MHz_XTAL/8)); - ymsnd.irq_handler().set_inputline(m_audiocpu, 0); - ymsnd.add_route(ALL_OUTPUTS, "mono", 1.0); -} - -void ghox_state::ghox(machine_config &config) -{ - /* basic machine hardware */ - M68000(config, m_maincpu, 10_MHz_XTAL); /* verified on pcb */ - m_maincpu->set_addrmap(AS_PROGRAM, &ghox_state::ghox_68k_mem); - m_maincpu->reset_cb().set(FUNC(ghox_state::toaplan2_reset)); - - HD647180X(config, m_audiocpu, 10_MHz_XTAL); - m_audiocpu->set_addrmap(AS_PROGRAM, &ghox_state::ghox_hd647180_mem_map); - - config.set_maximum_quantum(attotime::from_hz(600)); - - /* video hardware */ - SCREEN(config, m_screen, SCREEN_TYPE_RASTER); - m_screen->set_video_attributes(VIDEO_UPDATE_BEFORE_VBLANK); - m_screen->set_raw(27_MHz_XTAL/4, 432, 0, 320, 262, 0, 240); - //m_screen->set_refresh_hz(60); - //m_screen->set_size(432, 262); - //m_screen->set_visarea(0, 319, 0, 239); - m_screen->set_screen_update(FUNC(ghox_state::screen_update_toaplan2)); - m_screen->screen_vblank().set(FUNC(ghox_state::screen_vblank)); - m_screen->set_palette(m_palette); - - PALETTE(config, m_palette).set_format(palette_device::xBGR_555, T2PALETTE_LENGTH); - - GP9001_VDP(config, m_vdp[0], 27_MHz_XTAL); - m_vdp[0]->set_palette(m_palette); - m_vdp[0]->vint_out_cb().set_inputline(m_maincpu, M68K_IRQ_4); - - MCFG_VIDEO_START_OVERRIDE(ghox_state,toaplan2) - - /* sound hardware */ - SPEAKER(config, "mono").front_center(); - - YM2151(config, "ymsnd", 27_MHz_XTAL/8).add_route(ALL_OUTPUTS, "mono", 0.5); // verified on pcb -} - -/* probably dogyuun, vfive and kbash use the same decryption table; -those 3 games have been seen with the NITRO905 chip, other alias are -ts002mach for dogyuun, ts004dash for kbash and ts007spy for vfive */ - -static const u8 nitro_decryption_table[256] = { - 0x1b,0x56,0x75,0x88,0x8c,0x06,0x58,0x72, 0x83,0x86,0x36,0x1a,0x5f,0xd3,0x8c,0xe9, /* 00 */ - /* *//* *//* *//* *//* *//* *//* *//* */ /* *//* *//* *//* *//* *//* *//* *//* */ - 0x22,0x0f,0x03,0x2a,0xeb,0x2a,0xf9,0x0f, 0xa4,0xbd,0x75,0xf3,0x4f,0x53,0x8e,0xfe, /* 10 */ - /*W*//*W*//*r*//*W*//*r*//*W*//*W*//*r*/ /*r*//*a*//*r*//*r*//*r*//*W*//*x*//*r*/ - 0x87,0xe8,0xb1,0x8d,0x36,0xb5,0x43,0x73, 0x2a,0x5b,0xf9,0x02,0x24,0x8a,0x03,0x80, /* 20 */ - /*a*//*r*//*r*//*r*//*x*//*r*//*r*//*r*/ /*W*//*r*//*W*//*W*//*a*//*r*//*a*//*r*/ - 0x86,0x8b,0xd1,0x3e,0x8d,0x3e,0x58,0xfb, 0xc3,0x79,0xbd,0xb7,0x8a,0xe8,0x0f,0x81, /* 30 */ - /*a*//*a*//*a*//*a*//*r*//*r*//*a*//*r*/ /*r*//*a*//*a*//*W*//*r*//*r*//*r*//*r*/ - 0xb7,0xd0,0x8b,0xeb,0xff,0xb8,0x90,0x8b, 0x5e,0xa2,0x90,0xc1,0xab,0xb4,0x80,0x59, /* 40 */ - /*r*//*r*//*a*//*r*//*a*//*x*/ /*a*/ /*W*//*W*/ /*r*//*W*//*r*//*a*/ - 0x87,0x72,0xb5,0xbd,0xb0,0x88,0x50,0x0f, 0xfe,0xd2,0xc3,0x90,0x8a,0x90,0xf9,0x75, /* 50 */ - /*W*//*a*//*a*//*r*//*r*//*a*//*a*//*a*/ /*r*//*W*//*r*/ /*r*/ /*W*//*r*/ - 0x1a,0xb3,0x74,0x0a,0x68,0x24,0xbb,0x90, 0x75,0x47,0xfe,0x2c,0xbe,0xc3,0x88,0xd2, /* 60 */ - /*W*//*r*//*a*//*r*//*a*//*a*//*W*/ /*r*//*a*//*r*//*W*//*W*//*a*//*r*//*a*/ - 0x3e,0xc1,0x8c,0x33,0x0f,0x4f,0x8b,0x90, 0xb9,0x1e,0xff,0xa2,0x3e,0x22,0xbe,0x57, /* 70 */ - /*r*//*W*//*r*//*r*//*a*/ /*a*/ /*r*//*r*//*a*//*r*//*a*//*W*//*r*//*a*/ - 0x81,0x3a,0xf6,0x88,0xeb,0xb1,0x89,0x8a, 0x32,0x80,0x0f,0xb1,0x48,0xc3,0x68,0x72, /* 80 */ - /*r*//*r*//*r*//*r*//*a*//*W*//*a*//*r*/ /*r*//*r*//*r*//*a*//*x*//*a*//*a*//*r*/ - 0x53,0x02,0xc0,0x02,0xe8,0xb4,0x74,0xbc, 0x90,0x58,0x0a,0xf3,0x75,0xc6,0x90,0xe8, /* 90 */ - /*a*//*W*//*r*//*W*//*r*//*r*//*r*//*x*/ /*a*//*r*//*r*//*r*//*x*/ /*r*/ - 0x26,0x50,0xfc,0x8c,0x06,0xb1,0xc3,0xd1, 0xeb,0x83,0xa4,0xbf,0x26,0x4b,0x46,0xfe, /* a0 */ - /*r*//*a*//*a*//*r*/ /*a*//*r*//*W*/ /*a*//*r*//*r*//*r*//*r*//*W*//*a*//*r*/ - 0xe2,0x89,0xb3,0x88,0x03,0x56,0x0f,0x38, 0xbb,0x0c,0x90,0x0f,0x07,0x8a,0x8a,0x33, /* b0 */ - /*r*//*a*//*W*//*r*//*a*//*W*//*r*//*W*/ /*W*//*W*/ /*a*//*r*//*r*//*r*//*x*/ - 0xfe,0xf9,0xb1,0xa0,0x45,0x36,0x22,0x5e, 0x8a,0xbe,0xc6,0xea,0x3c,0xb2,0x1e,0xe8, /* c0 */ - /*r*//*W*//*r*//*r*//*r*//*r*//*W*//*r*/ /*r*//*W*//*x*//*x*//*r*//*?*//*r*//*r*/ - 0x90,0xeb,0x55,0xf6,0x8a,0xb0,0x5d,0xc0, 0xbb,0x8d,0xf6,0xd0,0xd1,0x88,0x4d,0x90, /* d0 */ - /*a*//*r*//*r*//*a*//*a*//*r*//*W*/ /*x*//*r*//*r*//*a*//*W*//*r*//*W*/ - 0x51,0x51,0x74,0xbd,0x32,0xd1,0xc6,0xd2, 0x53,0xc7,0xab,0x36,0x50,0xe9,0x33,0xb3, /* e0 */ - /*r*//*a*//*r*//*r*//*r*//*W*/ /*a*/ /*r*//*x*//*r*//*r*//*W*//*a*//*r*//*W*/ - 0x2e,0x05,0x88,0x59,0x74,0x74,0x22,0x8e, 0x8a,0x8a,0x36,0x08,0x0f,0x45,0x90,0x2e, /* f0 */ - /*r*//*W*//*r*//*r*//*a*//*a*//*W*//*x*/ /*r*//*r*//*x*//*a*//*r*//*a*/ /*r*/ -}; - -/* -dogyuun -a5272 cd - -kbash - -vfive -a4849 cd - -*/ - -void toaplan2_state::dogyuun(machine_config &config) -{ - /* basic machine hardware */ - M68000(config, m_maincpu, 25_MHz_XTAL/2); /* verified on pcb */ - m_maincpu->set_addrmap(AS_PROGRAM, &toaplan2_state::dogyuun_68k_mem); - m_maincpu->reset_cb().set(FUNC(toaplan2_state::toaplan2_reset)); - - v25_device &audiocpu(V25(config, m_audiocpu, 25_MHz_XTAL/2)); /* NEC V25 type Toaplan marked CPU ??? */ - audiocpu.set_addrmap(AS_PROGRAM, &toaplan2_state::v25_mem); - audiocpu.set_decryption_table(nitro_decryption_table); - audiocpu.pt_in_cb().set_ioport("DSWB").exor(0xff); - audiocpu.p0_in_cb().set_ioport("DSWA").exor(0xff); - audiocpu.p1_in_cb().set_ioport("JMPR").exor(0xff); - audiocpu.p2_out_cb().set_nop(); // bit 0 is FAULT according to kbash schematic - - /* video hardware */ - SCREEN(config, m_screen, SCREEN_TYPE_RASTER); - m_screen->set_video_attributes(VIDEO_UPDATE_BEFORE_VBLANK); - m_screen->set_raw(27_MHz_XTAL/4, 432, 0, 320, 262, 0, 240); - m_screen->set_screen_update(FUNC(toaplan2_state::screen_update_dogyuun)); - m_screen->screen_vblank().set(FUNC(toaplan2_state::screen_vblank)); - m_screen->set_palette(m_palette); - - PALETTE(config, m_palette).set_format(palette_device::xBGR_555, T2PALETTE_LENGTH); - - GP9001_VDP(config, m_vdp[0], 27_MHz_XTAL); - m_vdp[0]->set_palette(m_palette); - m_vdp[0]->vint_out_cb().set_inputline(m_maincpu, M68K_IRQ_4); - - GP9001_VDP(config, m_vdp[1], 27_MHz_XTAL); - m_vdp[1]->set_palette(m_palette); - - MCFG_VIDEO_START_OVERRIDE(toaplan2_state,toaplan2) - - /* sound hardware */ - SPEAKER(config, "mono").front_center(); - - YM2151(config, "ymsnd", 27_MHz_XTAL/8).add_route(ALL_OUTPUTS, "mono", 0.5); // verified on pcb - - OKIM6295(config, m_oki[0], 25_MHz_XTAL/24, okim6295_device::PIN7_HIGH); // verified on PCB - m_oki[0]->add_route(ALL_OUTPUTS, "mono", 0.5); -} - - -void toaplan2_state::dogyuunto(machine_config &config) -{ - dogyuun(config); - - m_maincpu->set_addrmap(AS_PROGRAM, &toaplan2_state::dogyuunto_68k_mem); - m_maincpu->set_clock(24_MHz_XTAL / 2); // 24 MHz instead of 25 - - z80_device &audiocpu(Z80(config.replace(), "audiocpu", 27_MHz_XTAL / 8)); // guessed divisor - audiocpu.set_addrmap(AS_PROGRAM, &toaplan2_state::dogyuunto_sound_z80_mem); - - m_oki[0]->set_clock(1.056_MHz_XTAL); // blue resonator 1056J -} - - -void toaplan2_state::kbash(machine_config &config) -{ - /* basic machine hardware */ - M68000(config, m_maincpu, 16_MHz_XTAL); /* 16MHz Oscillator */ - m_maincpu->set_addrmap(AS_PROGRAM, &toaplan2_state::kbash_68k_mem); - m_maincpu->reset_cb().set(FUNC(toaplan2_state::toaplan2_reset)); - - /* ROM based v25 */ - v25_device &audiocpu(V25(config, m_audiocpu, 16_MHz_XTAL)); /* NEC V25 type Toaplan marked CPU ??? */ - audiocpu.set_addrmap(AS_PROGRAM, &toaplan2_state::kbash_v25_mem); - audiocpu.set_decryption_table(nitro_decryption_table); - audiocpu.pt_in_cb().set_ioport("DSWA").exor(0xff); - audiocpu.p0_in_cb().set_ioport("DSWB").exor(0xff); - audiocpu.p1_in_cb().set_ioport("JMPR").exor(0xff); - audiocpu.p2_out_cb().set_nop(); // bit 0 is FAULT according to kbash schematic - - /* video hardware */ - SCREEN(config, m_screen, SCREEN_TYPE_RASTER); - m_screen->set_video_attributes(VIDEO_UPDATE_BEFORE_VBLANK); - m_screen->set_raw(27_MHz_XTAL/4, 432, 0, 320, 262, 0, 240); - //m_screen->set_refresh_hz(60); - //m_screen->set_size(432, 262); - //m_screen->set_visarea(0, 319, 0, 239); - m_screen->set_screen_update(FUNC(toaplan2_state::screen_update_toaplan2)); - m_screen->screen_vblank().set(FUNC(toaplan2_state::screen_vblank)); - m_screen->set_palette(m_palette); - - PALETTE(config, m_palette).set_format(palette_device::xBGR_555, T2PALETTE_LENGTH); - - GP9001_VDP(config, m_vdp[0], 27_MHz_XTAL); - m_vdp[0]->set_palette(m_palette); - m_vdp[0]->vint_out_cb().set_inputline(m_maincpu, M68K_IRQ_4); - - MCFG_VIDEO_START_OVERRIDE(toaplan2_state,toaplan2) - - /* sound hardware */ - SPEAKER(config, "mono").front_center(); - - YM2151(config, "ymsnd", 27_MHz_XTAL/8).add_route(ALL_OUTPUTS, "mono", 0.5); - - OKIM6295(config, m_oki[0], 32_MHz_XTAL/32, okim6295_device::PIN7_HIGH); - m_oki[0]->add_route(ALL_OUTPUTS, "mono", 0.5); -} - - -void toaplan2_state::kbash2(machine_config &config) -{ - /* basic machine hardware */ - M68000(config, m_maincpu, 16_MHz_XTAL); /* 16MHz Oscillator */ - m_maincpu->set_addrmap(AS_PROGRAM, &toaplan2_state::kbash2_68k_mem); - m_maincpu->reset_cb().set(FUNC(toaplan2_state::toaplan2_reset)); - - /* video hardware */ - SCREEN(config, m_screen, SCREEN_TYPE_RASTER); - m_screen->set_video_attributes(VIDEO_UPDATE_BEFORE_VBLANK); - m_screen->set_raw(27_MHz_XTAL/4, 432, 0, 320, 262, 0, 240); - //m_screen->set_refresh_hz(60); - //m_screen->set_size(432, 262); - //m_screen->set_visarea(0, 319, 0, 239); - m_screen->set_screen_update(FUNC(toaplan2_state::screen_update_toaplan2)); - m_screen->screen_vblank().set(FUNC(toaplan2_state::screen_vblank)); - m_screen->set_palette(m_palette); - - PALETTE(config, m_palette).set_format(palette_device::xBGR_555, T2PALETTE_LENGTH); - - GP9001_VDP(config, m_vdp[0], 27_MHz_XTAL); - m_vdp[0]->set_palette(m_palette); - m_vdp[0]->vint_out_cb().set_inputline(m_maincpu, M68K_IRQ_4); - - MCFG_VIDEO_START_OVERRIDE(toaplan2_state,toaplan2) - - /* sound hardware */ - SPEAKER(config, "mono").front_center(); - - OKIM6295(config, m_oki[0], 16_MHz_XTAL/16, okim6295_device::PIN7_HIGH); - m_oki[0]->add_route(ALL_OUTPUTS, "mono", 0.5); - - OKIM6295(config, m_oki[1], 16_MHz_XTAL/16, okim6295_device::PIN7_HIGH); - m_oki[1]->add_route(ALL_OUTPUTS, "mono", 0.5); -} - - -void truxton2_state::truxton2(machine_config &config) -{ - /* basic machine hardware */ - M68000(config, m_maincpu, 16_MHz_XTAL); /* verified on pcb */ - m_maincpu->set_addrmap(AS_PROGRAM, &truxton2_state::truxton2_68k_mem); - m_maincpu->reset_cb().set(FUNC(truxton2_state::toaplan2_reset)); - - /* video hardware */ - SCREEN(config, m_screen, SCREEN_TYPE_RASTER); - m_screen->set_video_attributes(VIDEO_UPDATE_BEFORE_VBLANK); - m_screen->set_raw(27_MHz_XTAL/4, 432, 0, 320, 262, 0, 240); - m_screen->set_screen_update(FUNC(truxton2_state::screen_update_truxton2)); - m_screen->screen_vblank().set(FUNC(truxton2_state::screen_vblank)); - m_screen->set_palette(m_palette); - - GFXDECODE(config, m_gfxdecode, m_palette, gfx_truxton2); - PALETTE(config, m_palette).set_format(palette_device::xBGR_555, T2PALETTE_LENGTH); - - GP9001_VDP(config, m_vdp[0], 27_MHz_XTAL); - m_vdp[0]->set_palette(m_palette); - m_vdp[0]->vint_out_cb().set_inputline(m_maincpu, M68K_IRQ_2); - - MCFG_VIDEO_START_OVERRIDE(truxton2_state,truxton2) - - /* sound hardware */ -#ifdef TRUXTON2_STEREO // music data is stereo... - SPEAKER(config, "lspeaker").front_left(); - SPEAKER(config, "rspeaker").front_right(); - - YM2151(config, "ymsnd", 27_MHz_XTAL/8).add_route(0, "lspeaker", 0.5).add_route(1, "rspeaker", 0.5); - - OKIM6295(config, m_oki[0], 16_MHz_XTAL/4, okim6295_device::PIN7_LOW); - m_oki[0]->add_route(ALL_OUTPUTS, "lspeaker", 0.5); - m_oki[0]->add_route(ALL_OUTPUTS, "rspeaker", 0.5); -#else // ...but the hardware is mono - SPEAKER(config, "mono").front_center(); - - YM2151(config, "ymsnd", 27_MHz_XTAL/8).add_route(ALL_OUTPUTS, "mono", 0.5); // verified on PCB - - OKIM6295(config, m_oki[0], 16_MHz_XTAL/4, okim6295_device::PIN7_LOW); // verified on PCB - m_oki[0]->add_route(ALL_OUTPUTS, "mono", 0.5); -#endif -} - - -void toaplan2_state::pipibibs(machine_config &config) -{ - /* basic machine hardware */ - M68000(config, m_maincpu, 10_MHz_XTAL); // verified on PCB - m_maincpu->set_addrmap(AS_PROGRAM, &toaplan2_state::pipibibs_68k_mem); - m_maincpu->reset_cb().set(FUNC(toaplan2_state::toaplan2_reset)); - - Z80(config, m_audiocpu, 27_MHz_XTAL/8); // verified on PCB - m_audiocpu->set_addrmap(AS_PROGRAM, &toaplan2_state::pipibibs_sound_z80_mem); - - config.set_maximum_quantum(attotime::from_hz(600)); - - /* video hardware */ - SCREEN(config, m_screen, SCREEN_TYPE_RASTER); - m_screen->set_video_attributes(VIDEO_UPDATE_BEFORE_VBLANK); - m_screen->set_raw(27_MHz_XTAL/4, 432, 0, 320, 262, 0, 240); - //m_screen->set_refresh_hz(60); - //m_screen->set_size(432, 262); - //m_screen->set_visarea(0, 319, 0, 239); - m_screen->set_screen_update(FUNC(toaplan2_state::screen_update_toaplan2)); - m_screen->screen_vblank().set(FUNC(toaplan2_state::screen_vblank)); - m_screen->set_palette(m_palette); - - PALETTE(config, m_palette).set_format(palette_device::xBGR_555, T2PALETTE_LENGTH); - - GP9001_VDP(config, m_vdp[0], 27_MHz_XTAL); - m_vdp[0]->set_palette(m_palette); - m_vdp[0]->vint_out_cb().set_inputline(m_maincpu, M68K_IRQ_4); - - MCFG_VIDEO_START_OVERRIDE(toaplan2_state,toaplan2) - - /* sound hardware */ - SPEAKER(config, "mono").front_center(); - - ym3812_device &ymsnd(YM3812(config, "ymsnd", 27_MHz_XTAL/8)); // verified on PCB - ymsnd.irq_handler().set_inputline(m_audiocpu, 0); - ymsnd.add_route(ALL_OUTPUTS, "mono", 1.0); -} - - -void toaplan2_state::pipibibsbl(machine_config &config) -{ - /* basic machine hardware */ - M68000(config, m_maincpu, 12_MHz_XTAL); // ??? (position labeled "68000-12" but 10 MHz-rated parts used) - m_maincpu->set_addrmap(AS_PROGRAM, &toaplan2_state::pipibibi_bootleg_68k_mem); - m_maincpu->set_addrmap(m68000_base_device::AS_CPU_SPACE, &toaplan2_state::cpu_space_pipibibsbl_map); - m_maincpu->reset_cb().set(FUNC(toaplan2_state::toaplan2_reset)); - - Z80(config, m_audiocpu, 12_MHz_XTAL / 2); // GoldStar Z8400B; clock source and divider unknown - m_audiocpu->set_addrmap(AS_PROGRAM, &toaplan2_state::pipibibs_sound_z80_mem); - - config.set_maximum_quantum(attotime::from_hz(600)); - - /* video hardware */ - SCREEN(config, m_screen, SCREEN_TYPE_RASTER); - m_screen->set_video_attributes(VIDEO_UPDATE_BEFORE_VBLANK); - m_screen->set_raw(28.322_MHz_XTAL / 4, 450, 0, 320, 262, 0, 240); // guess, but this is within NTSC parameters - m_screen->set_screen_update(FUNC(toaplan2_state::screen_update_toaplan2)); - m_screen->screen_vblank().set(FUNC(toaplan2_state::screen_vblank)); - m_screen->set_palette(m_palette); - - PALETTE(config, m_palette).set_format(palette_device::xBGR_555, T2PALETTE_LENGTH); - - GP9001_VDP(config, m_vdp[0], 27_MHz_XTAL); // FIXME: bootleg has no VDP - m_vdp[0]->set_palette(m_palette); - m_vdp[0]->vint_out_cb().set_inputline(m_maincpu, M68K_IRQ_4, ASSERT_LINE); - m_vdp[0]->set_bootleg_extra_offsets(0x01f, 0x1ef, 0x01d, 0x1ef, 0x01b, 0x1ef, 0x1d4, 0x1f7); - - MCFG_VIDEO_START_OVERRIDE(toaplan2_state,toaplan2) - - /* sound hardware */ - SPEAKER(config, "mono").front_center(); - - ym3812_device &ymsnd(YM3812(config, "ymsnd", 28.322_MHz_XTAL / 8)); // ??? - ymsnd.irq_handler().set_inputline(m_audiocpu, 0); - ymsnd.add_route(ALL_OUTPUTS, "mono", 1.0); -} - -/* x = modified to match batsugun 'unencrypted' code - '?' likewise, but not so sure about them */ -/* e = opcodes used in the EEPROM service routine */ -/* this one seems more different to the other tables */ -static const u8 ts001turbo_decryption_table[256] = { - 0x90,0x05,0x57,0x5f,0xfe,0x4f,0xbd,0x36, 0x80,0x8b,0x8a,0x0a,0x89,0x90,0x47,0x80, /* 00 */ - /*r*//*r*//*r*//*r*//*r*//*r*//*r*/ /*r*//*r*//*r*//*r*//*r*/ /*r*//*r*/ - 0x22,0x90,0x90,0x5d,0x81,0x3c,0xb5,0x83, 0x68,0xff,0x75,0x75,0x8d,0x5b,0x8a,0x38, /* 10 */ - /*r*/ /*r*//*r*//*r*//*r*//*r*/ /*r*//*r*//*r*//*r*//*r*//*r*//*r*//*r*/ - 0x8b,0xeb,0xd2,0x0a,0xb4,0xc7,0x46,0xd1, 0x0a,0x53,0xbd,0x77,0x22,0xff,0x1f,0x03, /* 20 */ - /*a*//*r*//*r*//*r*//*r*//*r*//*r*//*r*/ /*r*//*r*//*r*//*e*//*r*//*r*//*?*//*r*/ - 0xfb,0x45,0xc3,0x02,0x90,0x0f,0xa3,0x02, 0x0f,0xb7,0x90,0x24,0xc6,0xeb,0x1b,0x32, /* 30 */ - /*r*//*r*//*r*//*r*/ /*r*//*e*//*r*/ /*r*//*r*/ /*r*//*r*//*r*//*r*//*r*/ - 0x8d,0xb9,0xfe,0x08,0x88,0x90,0x8a,0x8a, 0x75,0x8a,0xbd,0x58,0xfe,0x51,0x1e,0x8b, /* 40 */ - /*r*//*r*//*r*//*r*//*r*/ /*r*//*r*/ /*r*//*r*//*r*//*r*//*r*//*r*//*r*//*r*/ - 0x0f,0x22,0xf6,0x90,0xc3,0x36,0x03,0x8d, 0xbb,0x16,0xbc,0x90,0x0f,0x5e,0xf9,0x2e, /* 50 */ - /*r*//*r*//*r*/ /*r*//*r*//*r*//*r*/ /*r*//*?*//*r*/ /*r*//*r*//*r*//*r*/ - 0x90,0x90,0x59,0x90,0xbb,0x1a,0x0c,0x8d, 0x89,0x72,0x83,0xa4,0xc3,0xb3,0x8b,0xe9, /* 60 */ - /*r*/ /*r*//*r*//*r*//*r*/ /*a*//*r*//*r*//*r*//*r*//*r*//*r*//*r*/ - 0x81,0x43,0xa0,0x2c,0x0f,0x55,0xf3,0x36, 0xb0,0x59,0xe8,0x03,0x26,0xe9,0x22,0xb0, /* 70 */ - /*r*//*r*//*r*//*r*//*r*//*r*//*r*//*r*/ /*r*//*r*//*r*//*r*//*r*//*r*//*r*//*r*/ - 0x90,0x8e,0x24,0x8a,0xd0,0x3e,0xc3,0x3a, 0x90,0x79,0x57,0x16,0x88,0x86,0x24,0x74, /* 80 */ - /*r*//*r*//*r*//*r*//*r*//*r*//*r*/ /*a*//*r*//*r*//*r*//*r*//*r*//*r*/ - 0x33,0xc3,0x53,0xb8,0xab,0x75,0x90,0x90, 0x8e,0xb1,0xe9,0x5d,0xf9,0x02,0x3c,0x90, /* 90 */ - /*x*//*r*//*r*//*r*//*r*//*r*/ /*r*//*r*//*r*//*r*//*r*//*r*//*r*/ - 0x80,0xd3,0x89,0xe8,0x90,0x90,0x2a,0x74, 0x90,0x5f,0xf6,0x88,0x4f,0x56,0x8c,0x03, /* a0 */ - /*r*//*a*//*r*//*r*/ /*r*//*r*/ /*r*//*r*//*r*//*r*//*r*//*r*//*r*/ - 0x47,0xa1,0x88,0x90,0x03,0xfe,0x90,0xfc, 0x2a,0x90,0x33,0x07,0xb1,0x50,0x0f,0x3e, /* b0 */ - /*r*//*e*//*r*/ /*r*//*r*/ /*r*/ /*r*/ /*r*//*r*//*r*//*r*//*r*//*r*/ - 0xbd,0x4d,0xf3,0xbf,0x59,0xd2,0xea,0xc6, 0x2a,0x74,0x72,0xe2,0x3e,0x2e,0x90,0x2e, /* c0 */ - /*r*//*r*//*r*//*r*//*r*//*a*//*x*//*r*/ /*r*//*r*//*r*//*r*//*r*//*r*/ /*r*/ - 0x2e,0x73,0x88,0x72,0x45,0x5d,0xc1,0xb9, 0x32,0x38,0x88,0xc1,0xa0,0x06,0x45,0x90, /* d0 */ - /*r*//*r*//*r*//*r*//*r*//*r*//*r*//*r*/ /*r*//*r*//*r*//*r*//*a*//*r*//*r*/ - 0x90,0x86,0x4b,0x87,0x90,0x8a,0x3b,0xab, 0x33,0xbe,0x90,0x32,0xbd,0xc7,0xb2,0x80, /* e0 */ - /*r*//*r*//*r*/ /*r*//*?*//*r*/ /*r*//*r*/ /*r*//*r*//*r*//*?*//*r*/ - 0x0f,0x75,0xc0,0xb9,0x07,0x74,0x3e,0xa2, 0x8a,0x48,0x3e,0x8d,0xeb,0x90,0xfe,0x90, /* f0 */ - /*r*//*r*//*r*//*r*//*r*//*r*//*r*//*r*/ /*r*//*x*//*r*//*r*//*r*/ /*r*/ -}; - - -void truxton2_state::fixeight(machine_config &config) -{ - /* basic machine hardware */ - M68000(config, m_maincpu, 16_MHz_XTAL); // verified on PCB - m_maincpu->set_addrmap(AS_PROGRAM, &truxton2_state::fixeight_68k_mem); - m_maincpu->reset_cb().set(FUNC(truxton2_state::toaplan2_reset)); - - v25_device &audiocpu(V25(config, m_audiocpu, 16_MHz_XTAL)); // NEC V25 type Toaplan marked CPU ??? - audiocpu.set_addrmap(AS_PROGRAM, &truxton2_state::fixeight_v25_mem); - audiocpu.set_decryption_table(ts001turbo_decryption_table); - audiocpu.p0_in_cb().set_ioport("EEPROM"); - audiocpu.p0_out_cb().set_ioport("EEPROM"); - - EEPROM_93C46_16BIT(config, m_eeprom); - - /* video hardware */ - SCREEN(config, m_screen, SCREEN_TYPE_RASTER); - m_screen->set_video_attributes(VIDEO_UPDATE_BEFORE_VBLANK); - m_screen->set_raw(27_MHz_XTAL/4, 432, 0, 320, 262, 0, 240); // verified on PCB - m_screen->set_screen_update(FUNC(truxton2_state::screen_update_truxton2)); - m_screen->screen_vblank().set(FUNC(truxton2_state::screen_vblank)); - m_screen->set_palette(m_palette); - - GFXDECODE(config, m_gfxdecode, m_palette, gfx_truxton2); - PALETTE(config, m_palette).set_format(palette_device::xBGR_555, T2PALETTE_LENGTH); - - GP9001_VDP(config, m_vdp[0], 27_MHz_XTAL); - m_vdp[0]->set_palette(m_palette); - m_vdp[0]->vint_out_cb().set_inputline(m_maincpu, M68K_IRQ_4); - - MCFG_VIDEO_START_OVERRIDE(truxton2_state,truxton2) - - /* sound hardware */ - SPEAKER(config, "mono").front_center(); - - YM2151(config, "ymsnd", 27_MHz_XTAL/8).add_route(ALL_OUTPUTS, "mono", 0.5); /* verified on pcb */ - - OKIM6295(config, m_oki[0], 16_MHz_XTAL/16, okim6295_device::PIN7_HIGH); /* verified on pcb */ - m_oki[0]->add_route(ALL_OUTPUTS, "mono", 0.5); -} - - -void truxton2_state::fixeightbl(machine_config &config) -{ - /* basic machine hardware */ - M68000(config, m_maincpu, XTAL(10'000'000)); /* 10MHz Oscillator */ - m_maincpu->set_addrmap(AS_PROGRAM, &truxton2_state::fixeightbl_68k_mem); - m_maincpu->set_addrmap(m68000_base_device::AS_CPU_SPACE, &truxton2_state::cpu_space_fixeightbl_map); - m_maincpu->reset_cb().set(FUNC(truxton2_state::toaplan2_reset)); - - /* video hardware */ - SCREEN(config, m_screen, SCREEN_TYPE_RASTER); - m_screen->set_video_attributes(VIDEO_UPDATE_BEFORE_VBLANK); - m_screen->set_raw(27_MHz_XTAL/4, 432, 0, 320, 262, 0, 240); - //m_screen->set_refresh_hz(60); - //m_screen->set_size(432, 262); - //m_screen->set_visarea(0, 319, 0, 239); - m_screen->set_screen_update(FUNC(truxton2_state::screen_update_bootleg)); - m_screen->screen_vblank().set(FUNC(truxton2_state::screen_vblank)); - m_screen->set_palette(m_palette); - - GFXDECODE(config, m_gfxdecode, m_palette, gfx_textrom); - PALETTE(config, m_palette).set_format(palette_device::xBGR_555, T2PALETTE_LENGTH); - - GP9001_VDP(config, m_vdp[0], 27_MHz_XTAL); - m_vdp[0]->set_palette(m_palette); - m_vdp[0]->vint_out_cb().set_inputline(m_maincpu, M68K_IRQ_2, ASSERT_LINE); - - MCFG_VIDEO_START_OVERRIDE(truxton2_state,fixeightbl) - - /* sound hardware */ - SPEAKER(config, "mono").front_center(); - - OKIM6295(config, m_oki[0], 14_MHz_XTAL/16, okim6295_device::PIN7_LOW); - m_oki[0]->add_route(ALL_OUTPUTS, "mono", 1.0); - m_oki[0]->set_addrmap(0, &truxton2_state::fixeightbl_oki); -} - - -void toaplan2_state::vfive(machine_config &config) -{ - /* basic machine hardware */ - M68000(config, m_maincpu, 20_MHz_XTAL/2); // verified on PCB - m_maincpu->set_addrmap(AS_PROGRAM, &toaplan2_state::vfive_68k_mem); - m_maincpu->reset_cb().set(FUNC(toaplan2_state::toaplan2_reset)); - - v25_device &audiocpu(V25(config, m_audiocpu, 20_MHz_XTAL/2)); // Verified on PCB, NEC V25 type Toaplan mark scratched out - audiocpu.set_addrmap(AS_PROGRAM, &toaplan2_state::vfive_v25_mem); - audiocpu.set_decryption_table(nitro_decryption_table); - audiocpu.pt_in_cb().set_ioport("DSWA").exor(0xff); - audiocpu.p0_in_cb().set_ioport("DSWB").exor(0xff); - audiocpu.p1_in_cb().set_ioport("JMPR").exor(0xff); - audiocpu.p2_out_cb().set_nop(); // bit 0 is FAULT according to kbash schematic - - /* video hardware */ - SCREEN(config, m_screen, SCREEN_TYPE_RASTER); - m_screen->set_video_attributes(VIDEO_UPDATE_BEFORE_VBLANK); - m_screen->set_raw(27_MHz_XTAL/4, 432, 0, 320, 262, 0, 240); // verified on PCB - m_screen->set_screen_update(FUNC(toaplan2_state::screen_update_toaplan2)); - m_screen->screen_vblank().set(FUNC(toaplan2_state::screen_vblank)); - m_screen->set_palette(m_palette); - - PALETTE(config, m_palette).set_format(palette_device::xBGR_555, T2PALETTE_LENGTH); - - GP9001_VDP(config, m_vdp[0], 27_MHz_XTAL); - m_vdp[0]->set_palette(m_palette); - m_vdp[0]->vint_out_cb().set_inputline(m_maincpu, M68K_IRQ_4); - - MCFG_VIDEO_START_OVERRIDE(toaplan2_state,toaplan2) - - /* sound hardware */ - SPEAKER(config, "mono").front_center(); - - YM2151(config, "ymsnd", 27_MHz_XTAL/8).add_route(ALL_OUTPUTS, "mono", 0.5); // verified on PCB -} - - -void toaplan2_state::batsugun(machine_config &config) -{ - /* basic machine hardware */ - M68000(config, m_maincpu, 32_MHz_XTAL/2); // 16MHz, 32MHz Oscillator - m_maincpu->set_addrmap(AS_PROGRAM, &toaplan2_state::batsugun_68k_mem); - m_maincpu->reset_cb().set(FUNC(toaplan2_state::toaplan2_reset)); - - v25_device &audiocpu(V25(config, m_audiocpu, 32_MHz_XTAL/2)); // NEC V25 type Toaplan marked CPU ??? - audiocpu.set_addrmap(AS_PROGRAM, &toaplan2_state::v25_mem); - audiocpu.pt_in_cb().set_ioport("DSWA").exor(0xff); - audiocpu.p0_in_cb().set_ioport("DSWB").exor(0xff); - audiocpu.p1_in_cb().set_ioport("JMPR").exor(0xff); - audiocpu.p2_out_cb().set_nop(); // bit 0 is FAULT according to kbash schematic - - /* video hardware */ - SCREEN(config, m_screen, SCREEN_TYPE_RASTER); - m_screen->set_video_attributes(VIDEO_UPDATE_BEFORE_VBLANK); - m_screen->set_raw(27_MHz_XTAL/4, 432, 0, 320, 262, 0, 240); - //m_screen->set_refresh_hz(60); - //m_screen->set_size(432, 262); - //m_screen->set_visarea(0, 319, 0, 239); - m_screen->set_screen_update(FUNC(toaplan2_state::screen_update_batsugun)); - m_screen->screen_vblank().set(FUNC(toaplan2_state::screen_vblank)); - m_screen->set_palette(m_palette); - - PALETTE(config, m_palette).set_format(palette_device::xBGR_555, T2PALETTE_LENGTH); - - GP9001_VDP(config, m_vdp[0], 27_MHz_XTAL); - m_vdp[0]->set_palette(m_palette); - m_vdp[0]->vint_out_cb().set_inputline(m_maincpu, M68K_IRQ_4); - - GP9001_VDP(config, m_vdp[1], 27_MHz_XTAL); - m_vdp[1]->set_palette(m_palette); - - MCFG_VIDEO_START_OVERRIDE(toaplan2_state,toaplan2) - - /* sound hardware */ - SPEAKER(config, "mono").front_center(); - - YM2151(config, "ymsnd", 27_MHz_XTAL/8).add_route(ALL_OUTPUTS, "mono", 0.5); - - OKIM6295(config, m_oki[0], 32_MHz_XTAL/8, okim6295_device::PIN7_LOW); - m_oki[0]->add_route(ALL_OUTPUTS, "mono", 0.5); -} - -void toaplan2_state::batsugunbl(machine_config &config) -{ - batsugun(config); - - m_maincpu->set_addrmap(AS_PROGRAM, &toaplan2_state::batsugunbl_68k_mem); - m_maincpu->set_addrmap(m68000_base_device::AS_CPU_SPACE, &toaplan2_state::cpu_space_fixeightbl_map); - - m_vdp[0]->vint_out_cb().set_inputline(m_maincpu, M68K_IRQ_2, ASSERT_LINE); - - MCFG_VIDEO_START_OVERRIDE(toaplan2_state, batsugunbl) - - config.device_remove("audiocpu"); - config.device_remove("ymsnd"); - - m_oki[0]->set_addrmap(0, &toaplan2_state::fixeightbl_oki); -} - -void pwrkick_state::pwrkick(machine_config &config) // Sunwise SW931201-1 PCB (27.000MHz, 20.000MHz & 16.000MHz OSCs) -{ - /* basic machine hardware */ - M68000(config, m_maincpu, 20_MHz_XTAL/2); // verified on PCB - m_maincpu->set_addrmap(AS_PROGRAM, &pwrkick_state::pwrkick_68k_mem); - m_maincpu->reset_cb().set(FUNC(pwrkick_state::toaplan2_reset)); - - UPD4992(config, m_rtc, 32.768_kHz_XTAL); - - NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); - - TICKET_DISPENSER(config, m_hopper, attotime::from_msec(50)); // duration is probably wrong - - /* video hardware */ - SCREEN(config, m_screen, SCREEN_TYPE_RASTER); - m_screen->set_video_attributes(VIDEO_UPDATE_BEFORE_VBLANK); - m_screen->set_raw(27_MHz_XTAL/4, 432, 0, 320, 262, 0, 240); - m_screen->set_screen_update(FUNC(pwrkick_state::screen_update_toaplan2)); - m_screen->screen_vblank().set(FUNC(pwrkick_state::screen_vblank)); - m_screen->set_palette(m_palette); - - PALETTE(config, m_palette).set_format(palette_device::xBGR_555, T2PALETTE_LENGTH); - - GP9001_VDP(config, m_vdp[0], 27_MHz_XTAL); - m_vdp[0]->set_palette(m_palette); - m_vdp[0]->vint_out_cb().set_inputline(m_maincpu, M68K_IRQ_4); - - MCFG_VIDEO_START_OVERRIDE(pwrkick_state,toaplan2) - - /* sound hardware */ - SPEAKER(config, "mono").front_center(); - // empty YM2151 socket - OKIM6295(config, m_oki[0], 16_MHz_XTAL/4, okim6295_device::PIN7_LOW); // verified on PCB - m_oki[0]->add_route(ALL_OUTPUTS, "mono", 0.5); -} - -void pwrkick_state::othldrby(machine_config &config) // Sunwise S951060-VGP PCB (27.000MHz, 20.000MHz & 16.000MHz OSCs) -{ - /* basic machine hardware */ - M68000(config, m_maincpu, 20_MHz_XTAL/2); // assumed same as pwrkick - m_maincpu->set_addrmap(AS_PROGRAM, &pwrkick_state::othldrby_68k_mem); - m_maincpu->reset_cb().set(FUNC(pwrkick_state::toaplan2_reset)); - - UPD4992(config, m_rtc, 32.768_kHz_XTAL); - - NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); - - /* video hardware */ - SCREEN(config, m_screen, SCREEN_TYPE_RASTER); - m_screen->set_video_attributes(VIDEO_UPDATE_BEFORE_VBLANK); - m_screen->set_raw(27_MHz_XTAL/4, 432, 0, 320, 262, 0, 240); - m_screen->set_screen_update(FUNC(pwrkick_state::screen_update_toaplan2)); - m_screen->screen_vblank().set(FUNC(pwrkick_state::screen_vblank)); - m_screen->set_palette(m_palette); - - PALETTE(config, m_palette).set_format(palette_device::xBGR_555, T2PALETTE_LENGTH); - - GP9001_VDP(config, m_vdp[0], 27_MHz_XTAL); - m_vdp[0]->set_palette(m_palette); - m_vdp[0]->vint_out_cb().set_inputline(m_maincpu, M68K_IRQ_4); - - MCFG_VIDEO_START_OVERRIDE(pwrkick_state,toaplan2) - - /* sound hardware */ - SPEAKER(config, "mono").front_center(); - - OKIM6295(config, m_oki[0], 16_MHz_XTAL/4, okim6295_device::PIN7_LOW); // assumed same as pwrkick - m_oki[0]->add_route(ALL_OUTPUTS, "mono", 0.5); -} - - -void toaplan2_state::enmadaio(machine_config &config) -{ - /* basic machine hardware */ - M68000(config, m_maincpu, 20_MHz_XTAL/2); - m_maincpu->set_addrmap(AS_PROGRAM, &toaplan2_state::enmadaio_68k_mem); - m_maincpu->reset_cb().set(FUNC(toaplan2_state::toaplan2_reset)); - - /* video hardware */ - SCREEN(config, m_screen, SCREEN_TYPE_RASTER); - m_screen->set_video_attributes(VIDEO_UPDATE_BEFORE_VBLANK); - m_screen->set_raw(27_MHz_XTAL/4, 432, 0, 320, 262, 0, 240); - m_screen->set_screen_update(FUNC(toaplan2_state::screen_update_toaplan2)); - m_screen->screen_vblank().set(FUNC(toaplan2_state::screen_vblank)); - m_screen->set_palette(m_palette); - - PALETTE(config, m_palette).set_format(palette_device::xBGR_555, T2PALETTE_LENGTH); - - GP9001_VDP(config, m_vdp[0], 27_MHz_XTAL); - m_vdp[0]->set_palette(m_palette); - m_vdp[0]->vint_out_cb().set_inputline(m_maincpu, M68K_IRQ_4); - - MCFG_VIDEO_START_OVERRIDE(toaplan2_state,toaplan2) - - /* sound hardware */ - SPEAKER(config, "mono").front_center(); - - YM2151(config, "ymsnd", 27_MHz_XTAL/8).add_route(ALL_OUTPUTS, "mono", 0.5); - - OKIM6295(config, m_oki[0], 16_MHz_XTAL/4, okim6295_device::PIN7_LOW); // pin7 not confirmed - m_oki[0]->set_addrmap(0, &toaplan2_state::enmadaio_oki); - m_oki[0]->add_route(ALL_OUTPUTS, "mono", 0.5); -} - -void toaplan2_state::snowbro2(machine_config &config) -{ - /* basic machine hardware */ - M68000(config, m_maincpu, 32_MHz_XTAL/2); - m_maincpu->set_addrmap(AS_PROGRAM, &toaplan2_state::snowbro2_68k_mem); - m_maincpu->reset_cb().set(FUNC(toaplan2_state::toaplan2_reset)); - - /* video hardware */ - SCREEN(config, m_screen, SCREEN_TYPE_RASTER); - m_screen->set_video_attributes(VIDEO_UPDATE_BEFORE_VBLANK); - m_screen->set_raw(27_MHz_XTAL/4, 432, 0, 320, 262, 0, 240); - //m_screen->set_refresh_hz(60); - //m_screen->set_size(432, 262); - //m_screen->set_visarea(0, 319, 0, 239); - m_screen->set_screen_update(FUNC(toaplan2_state::screen_update_toaplan2)); - m_screen->screen_vblank().set(FUNC(toaplan2_state::screen_vblank)); - m_screen->set_palette(m_palette); - - PALETTE(config, m_palette).set_format(palette_device::xBGR_555, T2PALETTE_LENGTH); - - GP9001_VDP(config, m_vdp[0], 27_MHz_XTAL); - m_vdp[0]->set_palette(m_palette); - m_vdp[0]->vint_out_cb().set_inputline(m_maincpu, M68K_IRQ_4); - - MCFG_VIDEO_START_OVERRIDE(toaplan2_state,toaplan2) - - /* sound hardware */ - SPEAKER(config, "mono").front_center(); - - YM2151(config, "ymsnd", 27_MHz_XTAL/8).add_route(ALL_OUTPUTS, "mono", 0.5); - - OKIM6295(config, m_oki[0], 16_MHz_XTAL/4, okim6295_device::PIN7_LOW); - m_oki[0]->add_route(ALL_OUTPUTS, "mono", 0.5); -} - -void toaplan2_state::snowbro2b3(machine_config &config) -{ - snowbro2(config); - - m_maincpu->set_addrmap(AS_PROGRAM, &toaplan2_state::snowbro2b3_68k_mem); - m_maincpu->set_vblank_int("screen", FUNC(toaplan2_state::irq2_line_hold)); - - m_vdp[0]->vint_out_cb().set_nop(); - m_vdp[0]->set_bootleg_extra_offsets(0x02e, 0x1f0, 0x02e, 0x1ee, 0x02e, 0x1ef, 0x1e9, 0x1ef); -} - - -void truxton2_state::mahoudai(machine_config &config) -{ - /* basic machine hardware */ - M68000(config, m_maincpu, 32_MHz_XTAL/2); // 16MHz, 32MHz Oscillator - m_maincpu->set_addrmap(AS_PROGRAM, &truxton2_state::mahoudai_68k_mem); - m_maincpu->reset_cb().set(FUNC(truxton2_state::toaplan2_reset)); - - Z80(config, m_audiocpu, 32_MHz_XTAL/8); // 4MHz, 32MHz Oscillator - m_audiocpu->set_addrmap(AS_PROGRAM, &truxton2_state::raizing_sound_z80_mem); - - config.set_maximum_quantum(attotime::from_hz(600)); - - /* video hardware */ - SCREEN(config, m_screen, SCREEN_TYPE_RASTER); - m_screen->set_video_attributes(VIDEO_UPDATE_BEFORE_VBLANK); - m_screen->set_raw(27_MHz_XTAL/4, 432, 0, 320, 262, 0, 240); - //m_screen->set_refresh_hz(60); - //m_screen->set_size(432, 262); - //m_screen->set_visarea(0, 319, 0, 239); - m_screen->set_screen_update(FUNC(truxton2_state::screen_update_truxton2)); - m_screen->screen_vblank().set(FUNC(truxton2_state::screen_vblank)); - m_screen->set_palette(m_palette); - - GFXDECODE(config, m_gfxdecode, m_palette, gfx_textrom); - PALETTE(config, m_palette).set_format(palette_device::xBGR_555, T2PALETTE_LENGTH); - - GP9001_VDP(config, m_vdp[0], 27_MHz_XTAL); - m_vdp[0]->set_palette(m_palette); - m_vdp[0]->vint_out_cb().set_inputline(m_maincpu, M68K_IRQ_4); - - MCFG_VIDEO_START_OVERRIDE(truxton2_state,bgaregga) - - /* sound hardware */ - SPEAKER(config, "mono").front_center(); - - YM2151(config, "ymsnd", 27_MHz_XTAL/8).add_route(ALL_OUTPUTS, "mono", 0.35); - - OKIM6295(config, m_oki[0], 32_MHz_XTAL/32, okim6295_device::PIN7_HIGH); - m_oki[0]->add_route(ALL_OUTPUTS, "mono", 0.5); -} - - -void truxton2_state::shippumd(machine_config &config) -{ - mahoudai(config); - /* basic machine hardware */ - m_maincpu->set_addrmap(AS_PROGRAM, &truxton2_state::shippumd_68k_mem); -} - -void truxton2_state::bgaregga(machine_config &config) -{ - /* basic machine hardware */ - M68000(config, m_maincpu, 32_MHz_XTAL/2); // 16MHz, 32MHz Oscillator - m_maincpu->set_addrmap(AS_PROGRAM, &truxton2_state::bgaregga_68k_mem); - m_maincpu->reset_cb().set(FUNC(truxton2_state::toaplan2_reset)); - - Z80(config, m_audiocpu, 32_MHz_XTAL/8); // 4MHz, 32MHz Oscillator - m_audiocpu->set_addrmap(AS_PROGRAM, &truxton2_state::bgaregga_sound_z80_mem); - - config.set_maximum_quantum(attotime::from_hz(6000)); - - MCFG_MACHINE_RESET_OVERRIDE(truxton2_state,bgaregga) - - /* video hardware */ - SCREEN(config, m_screen, SCREEN_TYPE_RASTER); - m_screen->set_video_attributes(VIDEO_UPDATE_BEFORE_VBLANK); - m_screen->set_raw(27_MHz_XTAL/4, 432, 0, 320, 262, 0, 240); - //m_screen->set_refresh_hz(60); - //m_screen->set_size(432, 262); - //m_screen->set_visarea(0, 319, 0, 239); - m_screen->set_screen_update(FUNC(truxton2_state::screen_update_truxton2)); - m_screen->screen_vblank().set(FUNC(truxton2_state::screen_vblank)); - m_screen->set_palette(m_palette); - - GFXDECODE(config, m_gfxdecode, m_palette, gfx_textrom); - PALETTE(config, m_palette).set_format(palette_device::xBGR_555, T2PALETTE_LENGTH); - - GP9001_VDP(config, m_vdp[0], 27_MHz_XTAL); - m_vdp[0]->set_palette(m_palette); - m_vdp[0]->vint_out_cb().set_inputline(m_maincpu, M68K_IRQ_4); - - MCFG_VIDEO_START_OVERRIDE(truxton2_state,bgaregga) - - /* sound hardware */ - SPEAKER(config, "mono").front_center(); - - GENERIC_LATCH_8(config, m_soundlatch[0]); - m_soundlatch[0]->data_pending_callback().set_inputline(m_audiocpu, 0); - m_soundlatch[0]->set_separate_acknowledge(true); - - YM2151(config, "ymsnd", 32_MHz_XTAL/8).add_route(ALL_OUTPUTS, "mono", 0.3); - - OKIM6295(config, m_oki[0], 32_MHz_XTAL/16, okim6295_device::PIN7_HIGH); - m_oki[0]->set_addrmap(0, &truxton2_state::raizing_oki<0>); - m_oki[0]->add_route(ALL_OUTPUTS, "mono", 0.6); -} - - -void truxton2_state::bgareggabl(machine_config &config) -{ - bgaregga(config); - MCFG_VIDEO_START_OVERRIDE(truxton2_state,bgareggabl) - - m_screen->set_screen_update(FUNC(truxton2_state::screen_update_bootleg)); -} - -void truxton2_state::batrider(machine_config &config) -{ - /* basic machine hardware */ - M68000(config, m_maincpu, 32_MHz_XTAL/2); // 16MHz, 32MHz Oscillator (verified) - m_maincpu->set_addrmap(AS_PROGRAM, &truxton2_state::batrider_68k_mem); - m_maincpu->reset_cb().set(FUNC(truxton2_state::toaplan2_reset)); - - Z80(config, m_audiocpu, 32_MHz_XTAL/6); // 5.333MHz, 32MHz Oscillator (verified) - m_audiocpu->set_addrmap(AS_PROGRAM, &truxton2_state::batrider_sound_z80_mem); - m_audiocpu->set_addrmap(AS_IO, &truxton2_state::batrider_sound_z80_port); - - config.set_maximum_quantum(attotime::from_hz(600)); - - MCFG_MACHINE_RESET_OVERRIDE(truxton2_state,bgaregga) - - ADDRESS_MAP_BANK(config, m_dma_space, 0); - m_dma_space->set_addrmap(0, &truxton2_state::batrider_dma_mem); - m_dma_space->set_endianness(ENDIANNESS_BIG); - m_dma_space->set_data_width(16); - m_dma_space->set_addr_width(16); - m_dma_space->set_stride(0x8000); - - /* video hardware */ - SCREEN(config, m_screen, SCREEN_TYPE_RASTER); - m_screen->set_video_attributes(VIDEO_UPDATE_BEFORE_VBLANK); - m_screen->set_raw(27_MHz_XTAL/4, 432, 0, 320, 262, 0, 240); - //m_screen->set_refresh_hz(60); - //m_screen->set_size(432, 262); - //m_screen->set_visarea(0, 319, 0, 239); - m_screen->set_screen_update(FUNC(truxton2_state::screen_update_truxton2)); - m_screen->screen_vblank().set(FUNC(truxton2_state::screen_vblank)); - m_screen->set_palette(m_palette); - - GFXDECODE(config, m_gfxdecode, m_palette, gfx_batrider); - PALETTE(config, m_palette).set_format(palette_device::xBGR_555, T2PALETTE_LENGTH); - - GP9001_VDP(config, m_vdp[0], 27_MHz_XTAL); - m_vdp[0]->set_palette(m_palette); - m_vdp[0]->set_tile_callback(FUNC(truxton2_state::batrider_bank_cb)); - m_vdp[0]->vint_out_cb().set_inputline(m_maincpu, M68K_IRQ_2); - - MCFG_VIDEO_START_OVERRIDE(truxton2_state,batrider) - - /* sound hardware */ - SPEAKER(config, "mono").front_center(); - - // these two latches are always written together, via a single move.l instruction - GENERIC_LATCH_8(config, m_soundlatch[0]); - GENERIC_LATCH_8(config, m_soundlatch[1]); - GENERIC_LATCH_8(config, m_soundlatch[2]); - GENERIC_LATCH_8(config, m_soundlatch[3]); - - YM2151(config, "ymsnd", 32_MHz_XTAL/8).add_route(ALL_OUTPUTS, "mono", 0.25); // 4MHz, 32MHz Oscillator (verified) - - OKIM6295(config, m_oki[0], 32_MHz_XTAL/10, okim6295_device::PIN7_HIGH); - m_oki[0]->set_addrmap(0, &truxton2_state::raizing_oki<0>); - m_oki[0]->add_route(ALL_OUTPUTS, "mono", 0.5); - - OKIM6295(config, m_oki[1], 32_MHz_XTAL/10, okim6295_device::PIN7_LOW); - m_oki[1]->set_addrmap(0, &truxton2_state::raizing_oki<1>); - m_oki[1]->add_route(ALL_OUTPUTS, "mono", 0.5); -} - - -void truxton2_state::bbakraid(machine_config &config) -{ - /* basic machine hardware */ - M68000(config, m_maincpu, 32_MHz_XTAL/2); // 16MHz, 32MHz Oscillator - m_maincpu->set_addrmap(AS_PROGRAM, &truxton2_state::bbakraid_68k_mem); - m_maincpu->reset_cb().set(FUNC(truxton2_state::toaplan2_reset)); - - Z80(config, m_audiocpu, XTAL(32'000'000)/6); /* 5.3333MHz , 32MHz Oscillator */ - m_audiocpu->set_addrmap(AS_PROGRAM, &truxton2_state::bbakraid_sound_z80_mem); - m_audiocpu->set_addrmap(AS_IO, &truxton2_state::bbakraid_sound_z80_port); - m_audiocpu->set_periodic_int(FUNC(truxton2_state::bbakraid_snd_interrupt), attotime::from_hz(XTAL(32'000'000) / 6 / 12000)); // sound CPU clock (divider unverified) - - config.set_maximum_quantum(attotime::from_hz(600)); - - EEPROM_93C66_8BIT(config, m_eeprom); - - ADDRESS_MAP_BANK(config, m_dma_space, 0); - m_dma_space->set_addrmap(0, &truxton2_state::batrider_dma_mem); - m_dma_space->set_endianness(ENDIANNESS_BIG); - m_dma_space->set_data_width(16); - m_dma_space->set_addr_width(16); - m_dma_space->set_stride(0x8000); - - /* video hardware */ - SCREEN(config, m_screen, SCREEN_TYPE_RASTER); - m_screen->set_video_attributes(VIDEO_UPDATE_BEFORE_VBLANK); - m_screen->set_raw(27_MHz_XTAL/4, 432, 0, 320, 262, 0, 240); - //m_screen->set_refresh_hz(60); - //m_screen->set_size(432, 262); - //m_screen->set_visarea(0, 319, 0, 239); - m_screen->set_screen_update(FUNC(truxton2_state::screen_update_truxton2)); - m_screen->screen_vblank().set(FUNC(truxton2_state::screen_vblank)); - m_screen->set_palette(m_palette); - - GFXDECODE(config, m_gfxdecode, m_palette, gfx_batrider); - PALETTE(config, m_palette).set_format(palette_device::xBGR_555, T2PALETTE_LENGTH); - - GP9001_VDP(config, m_vdp[0], 27_MHz_XTAL); - m_vdp[0]->set_palette(m_palette); - m_vdp[0]->set_tile_callback(FUNC(truxton2_state::batrider_bank_cb)); - m_vdp[0]->vint_out_cb().set_inputline(m_maincpu, M68K_IRQ_1); - - MCFG_VIDEO_START_OVERRIDE(truxton2_state,batrider) - - /* sound hardware */ - SPEAKER(config, "mono").front_center(); - - // these two latches are always written together, via a single move.l instruction - GENERIC_LATCH_8(config, m_soundlatch[0]); - GENERIC_LATCH_8(config, m_soundlatch[1]); - GENERIC_LATCH_8(config, m_soundlatch[2]); - GENERIC_LATCH_8(config, m_soundlatch[3]); - - YMZ280B(config, "ymz", 16.9344_MHz_XTAL).add_route(ALL_OUTPUTS, "mono", 1.0); - // IRQ not used ??? Connected to a test pin (TP082) -} - - -void truxton2_state::nprobowl(machine_config &config) -{ - // basic machine hardware - M68000(config, m_maincpu, 32_MHz_XTAL / 2); // 32MHz Oscillator, divisor not verified - m_maincpu->set_addrmap(AS_PROGRAM, &truxton2_state::nprobowl_68k_mem); - m_maincpu->reset_cb().set(FUNC(truxton2_state::toaplan2_reset)); - - ADDRESS_MAP_BANK(config, m_dma_space, 0); - m_dma_space->set_addrmap(0, &truxton2_state::batrider_dma_mem); - m_dma_space->set_endianness(ENDIANNESS_BIG); - m_dma_space->set_data_width(16); - m_dma_space->set_addr_width(16); - m_dma_space->set_stride(0x8000); - - // video hardware - SCREEN(config, m_screen, SCREEN_TYPE_RASTER); - m_screen->set_video_attributes(VIDEO_UPDATE_BEFORE_VBLANK); - m_screen->set_raw(27_MHz_XTAL/4, 432, 0, 320, 262, 0, 240); - //m_screen->set_refresh_hz(60); - //m_screen->set_size(432, 262); - //m_screen->set_visarea(0, 319, 0, 239); - m_screen->set_screen_update(FUNC(truxton2_state::screen_update_truxton2)); - m_screen->screen_vblank().set(FUNC(truxton2_state::screen_vblank)); - m_screen->set_palette(m_palette); - - GFXDECODE(config, m_gfxdecode, m_palette, gfx_batrider); - PALETTE(config, m_palette).set_format(palette_device::xBGR_555, T2PALETTE_LENGTH); - - GP9001_VDP(config, m_vdp[0], 27_MHz_XTAL); - m_vdp[0]->set_palette(m_palette); - m_vdp[0]->vint_out_cb().set_inputline(m_maincpu, M68K_IRQ_2); - - MCFG_VIDEO_START_OVERRIDE(truxton2_state, batrider) - - // sound hardware - SPEAKER(config, "mono").front_center(); - - OKIM6295(config, m_oki[0], 32_MHz_XTAL/8, okim6295_device::PIN7_HIGH).add_route(ALL_OUTPUTS, "mono", 1.0); // divisor not verified - // TODO: banking -} - - -/*************************************************************************** - - Game driver(s) - -***************************************************************************/ - -/* -------------------------- Toaplan games ------------------------- */ - -ROM_START( tekipaki ) - ROM_REGION( 0x040000, "maincpu", 0 ) /* Main 68K code */ - ROM_LOAD16_BYTE( "tp020-1.bin", 0x000000, 0x010000, CRC(d8420bd5) SHA1(30c1ad9e053cd7e79adb42aa428ebee28e144755) ) - ROM_LOAD16_BYTE( "tp020-2.bin", 0x000001, 0x010000, CRC(7222de8e) SHA1(8352ae23efc24a2e20cc24b6d37cb8fc6b1a730c) ) - - ROM_REGION( 0x8000, "audiocpu", 0 ) /* Sound HD647180 code */ - ROM_LOAD( "hd647180.020", 0x00000, 0x08000, CRC(d5157c12) SHA1(b2c6c087bb539456a9e562d0b40f05dde26cacd3) ) - - ROM_REGION( 0x100000, "gp9001_0", 0 ) - ROM_LOAD( "tp020-4.bin", 0x000000, 0x080000, CRC(3ebbe41e) SHA1(cea196c5f83e1a23d5b538a0db9bbbffa7af5118) ) - ROM_LOAD( "tp020-3.bin", 0x080000, 0x080000, CRC(2d5e2201) SHA1(5846c844eedd48305c1c67dc645b6e070b3f5b98) ) -ROM_END - - -ROM_START( tekipakit ) /* Location Test version */ - ROM_REGION( 0x040000, "maincpu", 0 ) /* Main 68K code */ - ROM_LOAD16_BYTE( "e.e5", 0x000000, 0x010000, CRC(89affc73) SHA1(3930bf0c2528de28dcb0cf2cd537adb62a2172e3) ) /* hand written "E" 27C512 chip */ - ROM_LOAD16_BYTE( "o.e6", 0x000001, 0x010000, CRC(a2244558) SHA1(5291cfbea4d4d1c45d6d4bd21b3c466459a0fa17) ) /* hand written "O" 27C512 chip */ - - ROM_REGION( 0x8000, "audiocpu", 0 ) /* Sound HD647180 code */ - ROM_LOAD( "hd647180.020", 0x00000, 0x08000, CRC(d5157c12) SHA1(b2c6c087bb539456a9e562d0b40f05dde26cacd3) ) - - ROM_REGION( 0x100000, "gp9001_0", 0 ) - ROM_LOAD( "0-1_4.4_cb45.a16", 0x000000, 0x080000, CRC(35e14729) SHA1(8c929604953b78c6e72744a38e06a988510193a5) ) /* hand written "0-1 4/4 CB45" 27C402 chip */ - ROM_LOAD( "3-4_4.4_547d.a15", 0x080000, 0x080000, CRC(41975fcc) SHA1(f850d5a9638d41bb69f204a9cd54e2fd693b57ef) ) /* hand written "3-4 4/4 547D" 27C402 chip */ -ROM_END - - -ROM_START( ghox ) /* Spinner with single axis (up/down) controls */ - ROM_REGION( 0x040000, "maincpu", 0 ) /* Main 68K code */ - ROM_LOAD16_BYTE( "tp021-01.u10", 0x000000, 0x020000, CRC(9e56ac67) SHA1(daf241d9e55a6e60fc004ed61f787641595b1e62) ) - ROM_LOAD16_BYTE( "tp021-02.u11", 0x000001, 0x020000, CRC(15cac60f) SHA1(6efa3a50a5dfe6ef4072738d6a7d0d95dca8a675) ) - - ROM_REGION( 0x10000, "audiocpu", 0 ) /* Sound HD647180 code */ - ROM_LOAD( "hd647180.021", 0x00000, 0x08000, CRC(6ab59e5b) SHA1(d814dd3a8f1ee638794e2bd422eed4247ba4a15e) ) - - ROM_REGION( 0x100000, "gp9001_0", 0 ) - ROM_LOAD( "tp021-03.u36", 0x000000, 0x080000, CRC(a15d8e9d) SHA1(640a33997bdce8e84bea6a944139716379839037) ) - ROM_LOAD( "tp021-04.u37", 0x080000, 0x080000, CRC(26ed1c9a) SHA1(37da8af86ea24327444c2d4ad3dfbd936208d43d) ) -ROM_END - - -ROM_START( ghoxj ) /* 8-way joystick for controls */ - ROM_REGION( 0x040000, "maincpu", 0 ) /* Main 68K code */ - ROM_LOAD16_BYTE( "tp021-01a.u10", 0x000000, 0x020000, CRC(c11b13c8) SHA1(da7defc1d3b6ddded910ba56c31fbbdb5ed57b09) ) - ROM_LOAD16_BYTE( "tp021-02a.u11", 0x000001, 0x020000, CRC(8d426767) SHA1(1ed4a8bcbf4352257e7d58cb5c2c91eb48c2f047) ) - - ROM_REGION( 0x10000, "audiocpu", 0 ) /* Sound HD647180 code */ - ROM_LOAD( "hd647180.021", 0x00000, 0x08000, CRC(6ab59e5b) SHA1(d814dd3a8f1ee638794e2bd422eed4247ba4a15e) ) - - ROM_REGION( 0x100000, "gp9001_0", 0 ) - ROM_LOAD( "tp021-03.u36", 0x000000, 0x080000, CRC(a15d8e9d) SHA1(640a33997bdce8e84bea6a944139716379839037) ) - ROM_LOAD( "tp021-04.u37", 0x080000, 0x080000, CRC(26ed1c9a) SHA1(37da8af86ea24327444c2d4ad3dfbd936208d43d) ) -ROM_END - -ROM_START( ghoxjo ) /* older version (with fewer regions) of the 8-way joystick version */ - ROM_REGION( 0x040000, "maincpu", 0 ) /* Main 68K code */ - ROM_LOAD16_BYTE( "tp021-01.ghoxsticker.u10", 0x000000, 0x020000, CRC(ad3a8817) SHA1(317267e0c00934a86bf05c5afd6c69a7944a2ed3) ) // TP021 ?01? label covered with a handwriten 'GHOX' sticker - ROM_LOAD16_BYTE( "tp021-02.ghoxsticker.u11", 0x000001, 0x020000, CRC(2340e981) SHA1(d8e3f55e67fe6500f9e6c7eed1388dc895c5f574) ) // TP021 ?02? label covered with a handwriten 'GHOX' sticker - - ROM_REGION( 0x10000, "audiocpu", 0 ) /* Sound HD647180 code */ - ROM_LOAD( "hd647180.021", 0x00000, 0x08000, CRC(6ab59e5b) SHA1(d814dd3a8f1ee638794e2bd422eed4247ba4a15e) ) - - ROM_REGION( 0x100000, "gp9001_0", 0 ) - ROM_LOAD( "tp021-03.u36", 0x000000, 0x080000, CRC(a15d8e9d) SHA1(640a33997bdce8e84bea6a944139716379839037) ) - ROM_LOAD( "tp021-04.u37", 0x080000, 0x080000, CRC(26ed1c9a) SHA1(37da8af86ea24327444c2d4ad3dfbd936208d43d) ) -ROM_END - - -ROM_START( dogyuun ) - ROM_REGION( 0x080000, "maincpu", 0 ) /* Main 68K code */ - ROM_LOAD16_WORD_SWAP( "tp022_01.r16", 0x000000, 0x080000, CRC(79eb2429) SHA1(088c5ed0ed77557ab71f52cafe35028e3648ae1e) ) - - /* Secondary CPU is a Toaplan marked chip, (TS-002-MACH TOA PLAN) */ - /* It's a NEC V25 (PLCC94) (encrypted program uploaded by main CPU) */ - - ROM_REGION( 0x200000, "gp9001_0", 0 ) - ROM_LOAD16_WORD_SWAP( "tp022_3.w92", 0x000000, 0x100000, CRC(191b595f) SHA1(89344946daa18087cc83f92027cf5da659b1c7a5) ) - ROM_LOAD16_WORD_SWAP( "tp022_4.w93", 0x100000, 0x100000, CRC(d58d29ca) SHA1(90d142fef37764ef817347a2bed77892a288a077) ) - - ROM_REGION( 0x400000, "gp9001_1", 0 ) - ROM_LOAD16_WORD_SWAP( "tp022_5.w16", 0x000000, 0x200000, CRC(d4c1db45) SHA1(f5655467149ba737128c2f54c9c6cdaca6e4c35c) ) - ROM_LOAD16_WORD_SWAP( "tp022_6.w17", 0x200000, 0x200000, CRC(d48dc74f) SHA1(081b5a00a2ff2bd82b98b30aab3cb5b6ae1014d5) ) - - ROM_REGION( 0x40000, "oki1", 0 ) /* ADPCM Samples */ - ROM_LOAD( "tp022_2.w30", 0x00000, 0x40000, CRC(043271b3) SHA1(c7eaa929e55dd956579b824ea9d20a1d0129a925) ) -ROM_END - - -ROM_START( dogyuuna ) - ROM_REGION( 0x080000, "maincpu", 0 ) /* Main 68K code */ - ROM_LOAD16_WORD_SWAP( "01.u64", 0x000000, 0x080000, CRC(fe5bd7f4) SHA1(9c725466112a514c9ed0fb074422d291c175c3f4) ) - - /* Secondary CPU is a Toaplan marked chip, (TS-002-MACH TOA PLAN) */ - /* It's a NEC V25 (PLCC94) (encrypted program uploaded by main CPU) */ - - ROM_REGION( 0x200000, "gp9001_0", 0 ) - ROM_LOAD16_WORD_SWAP( "tp022_3.w92", 0x000000, 0x100000, CRC(191b595f) SHA1(89344946daa18087cc83f92027cf5da659b1c7a5) ) - ROM_LOAD16_WORD_SWAP( "tp022_4.w93", 0x100000, 0x100000, CRC(d58d29ca) SHA1(90d142fef37764ef817347a2bed77892a288a077) ) - - ROM_REGION( 0x400000, "gp9001_1", 0 ) - ROM_LOAD16_WORD_SWAP( "tp022_5.w16", 0x000000, 0x200000, CRC(d4c1db45) SHA1(f5655467149ba737128c2f54c9c6cdaca6e4c35c) ) - ROM_LOAD16_WORD_SWAP( "tp022_6.w17", 0x200000, 0x200000, CRC(d48dc74f) SHA1(081b5a00a2ff2bd82b98b30aab3cb5b6ae1014d5) ) - - ROM_REGION( 0x40000, "oki1", 0 ) /* ADPCM Samples */ - ROM_LOAD( "tp022_2.w30", 0x00000, 0x40000, CRC(043271b3) SHA1(c7eaa929e55dd956579b824ea9d20a1d0129a925) ) -ROM_END - - -// found on a standard TP-022-1 PCB, main CPU ROM had a MR sticker. It's a little closer to the location test than to the released versions (i.e region configuration). -ROM_START( dogyuunb ) - ROM_REGION( 0x080000, "maincpu", 0 ) // Main 68K code - ROM_LOAD16_WORD_SWAP( "mr.u64", 0x000000, 0x080000, CRC(4dc258dc) SHA1(ac2783030a8367a20bfad282942c2aa383156291) ) // M27C4002 - - // Secondary CPU is a Toaplan marked chip, (TS-002-MACH TOA PLAN) - // It's a NEC V25 (PLCC94) (encrypted program uploaded by main CPU) - - ROM_REGION( 0x200000, "gp9001_0", 0 ) - ROM_LOAD16_WORD_SWAP( "tp022_3.w92", 0x000000, 0x100000, CRC(191b595f) SHA1(89344946daa18087cc83f92027cf5da659b1c7a5) ) - ROM_LOAD16_WORD_SWAP( "tp022_4.w93", 0x100000, 0x100000, CRC(d58d29ca) SHA1(90d142fef37764ef817347a2bed77892a288a077) ) - - ROM_REGION( 0x400000, "gp9001_1", 0 ) - ROM_LOAD16_WORD_SWAP( "tp022_5.w16", 0x000000, 0x200000, CRC(d4c1db45) SHA1(f5655467149ba737128c2f54c9c6cdaca6e4c35c) ) - ROM_LOAD16_WORD_SWAP( "tp022_6.w17", 0x200000, 0x200000, CRC(d48dc74f) SHA1(081b5a00a2ff2bd82b98b30aab3cb5b6ae1014d5) ) - - ROM_REGION( 0x40000, "oki1", 0 ) - ROM_LOAD( "tp022_2.w30", 0x00000, 0x40000, CRC(043271b3) SHA1(c7eaa929e55dd956579b824ea9d20a1d0129a925) ) -ROM_END - - -ROM_START( dogyuunt ) - ROM_REGION( 0x080000, "maincpu", 0 ) /* Main 68K code */ - ROM_LOAD16_WORD_SWAP( "sample10.9.u64.bin", 0x000000, 0x080000, CRC(585f5016) SHA1(18d57843f33a560a3bb4b6aef176f7ef795b742d) ) - - /* Secondary CPU is a Toaplan marked chip, (TS-002-MACH TOA PLAN) */ - /* It's a NEC V25 (PLCC94) (encrypted program uploaded by main CPU) */ - - ROM_REGION( 0x200000, "gp9001_0", 0 ) - ROM_LOAD16_WORD_SWAP( "tp022_3.w92", 0x000000, 0x100000, CRC(191b595f) SHA1(89344946daa18087cc83f92027cf5da659b1c7a5) ) - ROM_LOAD16_WORD_SWAP( "tp022_4.w93", 0x100000, 0x100000, CRC(d58d29ca) SHA1(90d142fef37764ef817347a2bed77892a288a077) ) - - ROM_REGION( 0x400000, "gp9001_1", 0 ) - ROM_LOAD16_WORD_SWAP( "tp022_5.w16", 0x000000, 0x200000, CRC(d4c1db45) SHA1(f5655467149ba737128c2f54c9c6cdaca6e4c35c) ) - ROM_LOAD16_WORD_SWAP( "tp022_6.w17", 0x200000, 0x200000, CRC(d48dc74f) SHA1(081b5a00a2ff2bd82b98b30aab3cb5b6ae1014d5) ) - - ROM_REGION( 0x40000, "oki1", 0 ) /* ADPCM Samples */ - ROM_LOAD( "tp022_2.w30", 0x00000, 0x40000, CRC(043271b3) SHA1(c7eaa929e55dd956579b824ea9d20a1d0129a925) ) -ROM_END - - -/* -This set came on a TX-022 PCB (different from the final version, TP-022). -Seems the game is always in 'debug mode' according to the test menu (dip has no effect). Still, it has no invicibility effect. -Couldn't find a read for the region settings jumpers. -Hardware differences according to the dumper: -* Two GCUs have nearly identical sections copy-pasted, one above the other. -* Toaplan HK-1000 ceramic module is used for inputs; the final implements the logic separately. -* Inputs mapped in the main CPU address space. -* No NEC V25 sound CPU; instead, there is a Z80 with its own ROM. -* Sound amp pinout is reversed; mounted to the underside as a bodge fix (this is how I received it). -* Board is marked "TX-022" instead of "TP-022". A halfway point from the development code "GX-022" -*/ -ROM_START( dogyuunto ) - ROM_REGION( 0x080000, "maincpu", 0 ) - ROM_LOAD16_WORD_SWAP( "8-25.u11", 0x000000, 0x080000, CRC(4d3c952f) SHA1(194f3065c513238921047ead8b425c3d0538b9a7) ) // real hand-written label is '8/25' - - ROM_REGION( 0x08000, "audiocpu", 0 ) - ROM_LOAD( "u25", 0x00000, 0x08000, CRC(41a34a7e) SHA1(c4f7833249436fd064c7088c9776d12dee4a7d39) ) // only had a white label - - // the GP9001 mask ROMs were not dumped for this set, but the ROM codes match so they are believed identical - ROM_REGION( 0x200000, "gp9001_0", 0 ) - ROM_LOAD16_WORD_SWAP( "tp022_3.w92", 0x000000, 0x100000, CRC(191b595f) SHA1(89344946daa18087cc83f92027cf5da659b1c7a5) ) - ROM_LOAD16_WORD_SWAP( "tp022_4.w93", 0x100000, 0x100000, CRC(d58d29ca) SHA1(90d142fef37764ef817347a2bed77892a288a077) ) - - ROM_REGION( 0x400000, "gp9001_1", 0 ) - ROM_LOAD16_WORD_SWAP( "tp022_5.w16", 0x000000, 0x200000, CRC(d4c1db45) SHA1(f5655467149ba737128c2f54c9c6cdaca6e4c35c) ) - ROM_LOAD16_WORD_SWAP( "tp022_6.w17", 0x200000, 0x200000, CRC(d48dc74f) SHA1(081b5a00a2ff2bd82b98b30aab3cb5b6ae1014d5) ) - - // this may have some corruption (only 24, apparently random, bytes differ from the standard ROM), however preserve it for now until it has been verified. - ROM_REGION( 0x40000, "oki1", 0 ) - ROM_LOAD( "2m.u29", 0x00000, 0x40000, CRC(5e7a77d8) SHA1(da6beb5e8e015965ff42fd52f5aa0c0ae5bcee4f) ) // '2M' hand-written -ROM_END - - -ROM_START( kbash ) - ROM_REGION( 0x080000, "maincpu", 0 ) /* Main 68K code */ - ROM_LOAD16_WORD_SWAP( "tp023_01.bin", 0x000000, 0x080000, CRC(2965f81d) SHA1(46f2df30fa92c80ba5a37f75e756424e15534784) ) - - /* Secondary CPU is a Toaplan marked chip, (TS-004-Dash TOA PLAN) */ - /* It's a NEC V25 (PLCC94) (encrypted) */ - - ROM_REGION( 0x8000, "audiocpu", 0 ) /* Sound CPU code */ - ROM_LOAD( "tp023_02.bin", 0x0000, 0x8000, CRC(4cd882a1) SHA1(7199a5c384918f775f0815e09c46b2a58141814a) ) - - ROM_REGION( 0x800000, "gp9001_0", 0 ) - ROM_LOAD( "tp023_3.bin", 0x000000, 0x200000, CRC(32ad508b) SHA1(e473489beaf649d3e5236770eb043327e309850c) ) - ROM_LOAD( "tp023_5.bin", 0x200000, 0x200000, CRC(b84c90eb) SHA1(17a1531d884d9a9696d1b25d65f9155f02396e0e) ) - ROM_LOAD( "tp023_4.bin", 0x400000, 0x200000, CRC(e493c077) SHA1(0edcfb70483ad07206695d9283031b85cd198a36) ) - ROM_LOAD( "tp023_6.bin", 0x600000, 0x200000, CRC(9084b50a) SHA1(03b58278619524d2f09a4b1c152d5e057e792a56) ) - - ROM_REGION( 0x40000, "oki1", 0 ) /* ADPCM Samples */ - ROM_LOAD( "tp023_7.bin", 0x00000, 0x40000, CRC(3732318f) SHA1(f0768459f5ad2dee53d408a0a5ae3a314864e667) ) -ROM_END - -ROM_START( kbashk ) - ROM_REGION( 0x080000, "maincpu", 0 ) /* Main 68K code */ - ROM_LOAD16_WORD_SWAP( "tp023_01.u52", 0x000000, 0x080000, CRC(099aefbc) SHA1(8daa0deffe221e1bb5a8744ced18c23ad319ffd3) ) // same label as parent? - - /* Secondary CPU is a Toaplan marked chip, (TS-004-Dash TOA PLAN) */ - /* It's a NEC V25 (PLCC94) (encrypted) */ - - ROM_REGION( 0x8000, "audiocpu", 0 ) /* Sound CPU code */ - ROM_LOAD( "tp023_02.bin", 0x0000, 0x8000, CRC(4cd882a1) SHA1(7199a5c384918f775f0815e09c46b2a58141814a) ) - - ROM_REGION( 0x800000, "gp9001_0", 0 ) - ROM_LOAD( "tp023_3.bin", 0x000000, 0x200000, CRC(32ad508b) SHA1(e473489beaf649d3e5236770eb043327e309850c) ) - ROM_LOAD( "tp023_5.bin", 0x200000, 0x200000, CRC(b84c90eb) SHA1(17a1531d884d9a9696d1b25d65f9155f02396e0e) ) - ROM_LOAD( "tp023_4.bin", 0x400000, 0x200000, CRC(e493c077) SHA1(0edcfb70483ad07206695d9283031b85cd198a36) ) - ROM_LOAD( "tp023_6.bin", 0x600000, 0x200000, CRC(9084b50a) SHA1(03b58278619524d2f09a4b1c152d5e057e792a56) ) - - ROM_REGION( 0x40000, "oki1", 0 ) /* ADPCM Samples */ - ROM_LOAD( "tp023_7.bin", 0x00000, 0x40000, CRC(3732318f) SHA1(f0768459f5ad2dee53d408a0a5ae3a314864e667) ) -ROM_END - -// all labels handwritten. Given the AOU on the audio ROM, maybe a prototype destined to be showed there? -// GFX ROMs are on 4 riser boards. They are smaller but contain the same data as the final version. -// Only different ROMs are the main and audio CPU ones -ROM_START( kbashp ) - ROM_REGION( 0x080000, "maincpu", 0 ) - ROM_LOAD16_WORD_SWAP( "2-19.u52", 0x000000, 0x080000, CRC(60dfdfec) SHA1(ca61433c8f7b1b765a699c375c946f113beeccc4) ) // actually 2/19 - - /* Secondary CPU is a Toaplan marked chip, (NITRO TOA PLAN 509) */ - /* It's a NEC V25 (PLCC94) (encrypted) */ - - ROM_REGION( 0x8000, "audiocpu", 0 ) - ROM_LOAD( "aou-nb-sound.u34", 0x0000, 0x8000, CRC(26ba8fb1) SHA1(4259c4704f0fea0c8befa2e60a0838280b23a507) ) - - ROM_REGION( 0x800000, "gp9001_0", 0 ) - ROM_LOAD( "0.u1", 0x000000, 0x080000, CRC(1b87ffa5) SHA1(fbd5ac9e9635c1f5b1b896a3d504b827c0a99679) ) - ROM_LOAD( "2.u2", 0x080000, 0x080000, CRC(a411457e) SHA1(6b515e6524aa4fb1785d99556fefb0434368de84) ) - ROM_LOAD( "4.u3", 0x100000, 0x080000, CRC(631f770d) SHA1(0f0c11bc5549ed68d20dfc6ae51c3caec65aab88) ) - ROM_LOAD( "6.u4", 0x180000, 0x080000, CRC(5a46d262) SHA1(56d5180196b5acf76b700e627878998e88a21f3c) ) - ROM_LOAD( "8.u1", 0x200000, 0x080000, CRC(11b1c986) SHA1(05260c6cc5ab4239b52549e0dcda8853fc1fcd3a) ) - ROM_LOAD( "a.u2", 0x280000, 0x080000, CRC(4c4b47ce) SHA1(a41a27ac96bd9eb57bc4bd8b6592b70e86ad16d3) ) - ROM_LOAD( "c.u3", 0x300000, 0x080000, CRC(1ccc6a19) SHA1(d5735c2f075d81018021ec9e8642104227b67ace) ) - ROM_LOAD( "e.u4", 0x380000, 0x080000, CRC(731ad154) SHA1(78efce53000d170098b57342641299aacb7a82aa) ) - ROM_LOAD( "3.u1", 0x400000, 0x080000, CRC(7fbe0452) SHA1(c9b8c0d7126382fcdf8b5fa9a4466292954c88f7) ) - ROM_LOAD( "1.u2", 0x480000, 0x080000, CRC(6cd94e90) SHA1(9957ad69f8e80370dbf2cd863d0646241236f6b4) ) - ROM_LOAD( "5.u3", 0x500000, 0x080000, CRC(9cb4884e) SHA1(f596902b7740de4c262b4b18ac17eccca566ea77) ) - ROM_LOAD( "7.u4", 0x580000, 0x080000, CRC(53c2e0b6) SHA1(ee1128ad41ae3c68ef32d4211dd5205a9a5bb216) ) - ROM_LOAD( "g.u1", 0x600000, 0x080000, CRC(a63c795c) SHA1(30d3bb29cd73b31e233229f9304e3b87feaf01f3) ) - ROM_LOAD( "b.u2", 0x680000, 0x080000, CRC(32f8c39b) SHA1(a9029910c0b4fc3693081056a0afb9bcf9c0e699) ) - ROM_LOAD( "d.u3", 0x700000, 0x080000, CRC(40ac17d5) SHA1(140c67cf86ce545469fbe899b1f38c3a070908c9) ) - ROM_LOAD( "f.u4", 0x780000, 0x080000, CRC(2ca4eb83) SHA1(0d7c4242a82aba49cafd96ee5b051918d1b23b08) ) - - ROM_REGION( 0x40000, "oki1", 0 ) - ROM_LOAD( "2m-nb-pcm.u40", 0x00000, 0x40000, CRC(3732318f) SHA1(f0768459f5ad2dee53d408a0a5ae3a314864e667) ) -ROM_END - -/* -Knuckle Bash 2 -This is a hacked version of Knuckle Bash on bootleg/Korean/Chinese -hardware showing (C)Toaplan 1999 Licensed to Charterfield - -PCB Layout ----------- - -|--------------------------------------------| -|UPC1241 EPROM MECAT-S | -| LM324 | -| M6295 M6295 | -| PAL 62256 M5M51008 | -| 62256 MECAT-M M5M51008 | -| 6116 M5M51008 | -|J 6116 14.31818MHz M5M51008 | -|A 68000 | -|M 16MHz | -|M PAL | -|A PAL | -| |-------| | -| |ACTEL | PAL | -| |A40MX04| PAL | -| | | | -| DSW1 |-------| 050917-10 | -| |ACTEL | | -| DSW2 |A40MX04| MECAT-12 | -|62256 | | | -|62256 |-------| MECAT-34 | -|--------------------------------------------| -Notes: - 68000 clock 16.000MHz - M6295 clock 1.000MHz [16/16]. Sample rate (Hz) 16000000/16/132 - M5M51008 - Mitsubishi M5M51008 128k x8 SRAM (SOP32) - 62256 - 32k x8 SRAM - 6116 - 2k x8 SRAM - VSync 60Hz - HSync 15.68kHz -*/ - -ROM_START( kbash2 ) - ROM_REGION( 0x80000, "maincpu", 0 ) /* Main 68K code */ - ROM_LOAD16_WORD_SWAP( "mecat-m", 0x000000, 0x80000, CRC(bd2263c6) SHA1(eb794c0fc9c1fb4337114d48149283d42d22e4b3) ) - - ROM_REGION( 0x800000, "gp9001_0", 0 ) - ROM_LOAD( "mecat-34", 0x000000, 0x400000, CRC(6be7b37e) SHA1(13160ad0712fee932bb98cc226e651895b19228a) ) - ROM_LOAD( "mecat-12", 0x400000, 0x400000, CRC(49e46b1f) SHA1(d12b12696a8473eb34f3cd247ab060289a6c0e9c) ) - - ROM_REGION( 0x80000, "oki1", 0 ) /* ADPCM Music */ - ROM_LOAD( "mecat-s", 0x00000, 0x80000, CRC(3eb7adf4) SHA1(b0e6e99726b854858bd0e69eb77f12b9664b35e6) ) - - ROM_REGION( 0x40000, "oki2", 0 ) /* ADPCM Samples */ - ROM_LOAD( "eprom", 0x00000, 0x40000, CRC(31115cb9) SHA1(c79ea01bd865e2fc3aaab3ff05483c8fd27e5c98) ) - - ROM_REGION( 0x10000, "user1", 0 ) /* ??? Some sort of table - same as in pipibibi*/ - ROM_LOAD( "050917-10", 0x0000, 0x10000, CRC(6b213183) SHA1(599c59d155d11edb151bfaed1d24ef964462a447) ) -ROM_END - - -ROM_START( truxton2 ) - ROM_REGION( 0x080000, "maincpu", 0 ) /* Main 68K code */ - /* program ROM is byte swapped ! */ - ROM_LOAD16_WORD( "tp024_1.bin", 0x000000, 0x080000, CRC(f5cfe6ee) SHA1(30979888a4cd6500244117748f28386a7e20a169) ) - - ROM_REGION( 0x200000, "gp9001_0", 0 ) - ROM_LOAD( "tp024_4.bin", 0x000000, 0x100000, CRC(805c449e) SHA1(fdf985344145bd320b88b9b0c25e73066c9b2ada) ) - ROM_LOAD( "tp024_3.bin", 0x100000, 0x100000, CRC(47587164) SHA1(bac493e2d5507286b984957b289c929335d27eaa) ) - - ROM_REGION( 0x80000, "oki1", 0 ) /* ADPCM Samples */ - ROM_LOAD( "tp024_2.bin", 0x00000, 0x80000, CRC(f2f6cae4) SHA1(bb4e8c36531bed97ced4696ca12fd40ede2531aa) ) -ROM_END - - -ROM_START( pipibibs ) - ROM_REGION( 0x040000, "maincpu", 0 ) /* Main 68K code */ - ROM_LOAD16_BYTE( "tp025-1.bin", 0x000000, 0x020000, CRC(b2ea8659) SHA1(400431b656dbfbd5a9bc5961c3ea04c4d38b6f77) ) - ROM_LOAD16_BYTE( "tp025-2.bin", 0x000001, 0x020000, CRC(dc53b939) SHA1(e4de371f97ba7c350273ad43b7f58ff31672a269) ) - - ROM_REGION( 0x10000, "audiocpu", 0 ) /* Sound Z80 code */ - ROM_LOAD( "tp025-5.bin", 0x0000, 0x8000, CRC(bf8ffde5) SHA1(79c09cc9a0ea979f5af5a7e5ad671ea486f5f43e) ) - - ROM_REGION( 0x200000, "gp9001_0", 0 ) - ROM_LOAD( "tp025-4.bin", 0x000000, 0x100000, CRC(ab97f744) SHA1(c1620e614345dbd5c6567e4cb6f55c61b900d0ee) ) - ROM_LOAD( "tp025-3.bin", 0x100000, 0x100000, CRC(7b16101e) SHA1(ae0119bbfa0937d18c4fbb0a3ef7cdc3b9fa6b56) ) -ROM_END - - -ROM_START( pipibibsa ) - ROM_REGION( 0x040000, "maincpu", 0 ) /* Main 68K code */ - ROM_LOAD16_BYTE( "tp025-1.alt.bin", 0x000000, 0x020000, CRC(3e522d98) SHA1(043dd76b99e130909e47063d4cc773177a2eaccf) ) - ROM_LOAD16_BYTE( "tp025-2.alt.bin", 0x000001, 0x020000, CRC(48370485) SHA1(9895e086c9a5eeec4f454cbc6098adb2f66d4e11) ) - - ROM_REGION( 0x10000, "audiocpu", 0 ) /* Sound Z80 code */ - ROM_LOAD( "tp025-5.bin", 0x0000, 0x8000, CRC(bf8ffde5) SHA1(79c09cc9a0ea979f5af5a7e5ad671ea486f5f43e) ) - - ROM_REGION( 0x200000, "gp9001_0", 0 ) - ROM_LOAD( "tp025-4.bin", 0x000000, 0x100000, CRC(ab97f744) SHA1(c1620e614345dbd5c6567e4cb6f55c61b900d0ee) ) - ROM_LOAD( "tp025-3.bin", 0x100000, 0x100000, CRC(7b16101e) SHA1(ae0119bbfa0937d18c4fbb0a3ef7cdc3b9fa6b56) ) -ROM_END - - -ROM_START( whoopee ) - ROM_REGION( 0x040000, "maincpu", 0 ) /* Main 68K code */ - ROM_LOAD16_BYTE( "whoopee.1", 0x000000, 0x020000, CRC(28882e7e) SHA1(8fcd278a7d005eb81cd9e461139c0c0f756a4fa4) ) - ROM_LOAD16_BYTE( "whoopee.2", 0x000001, 0x020000, CRC(6796f133) SHA1(d4e657be260ba3fd3f0556ade617882513b52685) ) - - ROM_REGION( 0x10000, "audiocpu", 0 ) /* Sound HD647180 code */ - ROM_LOAD( "hd647180.025", 0x00000, 0x08000, CRC(c02436f6) SHA1(385343f88991646ec23b385eaea82718f1251ea6) ) - - ROM_REGION( 0x200000, "gp9001_0", 0 ) - ROM_LOAD( "tp025-4.bin", 0x000000, 0x100000, CRC(ab97f744) SHA1(c1620e614345dbd5c6567e4cb6f55c61b900d0ee) ) - ROM_LOAD( "tp025-3.bin", 0x100000, 0x100000, CRC(7b16101e) SHA1(ae0119bbfa0937d18c4fbb0a3ef7cdc3b9fa6b56) ) -ROM_END - - -ROM_START( pipibibsp ) - ROM_REGION( 0x080000, "maincpu", 0 ) /* Main 68K code */ - ROM_LOAD16_BYTE( "pip_cpu_e", 0x000000, 0x020000, CRC(ae3205bd) SHA1(1613fec637dfed213433dca0d267e49f4848df81) ) - ROM_LOAD16_BYTE( "pip_cpu_o", 0x000001, 0x020000, CRC(241669a9) SHA1(234e0bb819453e16625d15d2cf22496bbc547943) ) - - ROM_REGION( 0x10000, "audiocpu", 0 ) /* Sound Z80 code */ - ROM_LOAD( "pip_snd", 0x0000, 0x8000, CRC(8ebf183b) SHA1(602b138c85b02d121d007f6788b322aa107c7d91) ) - - ROM_REGION( 0x200000, "gp9001_0", 0 ) - ROM_LOAD( "cg_01_l", 0x000000, 0x080000, CRC(21d1ef46) SHA1(d7ccbe56eb08be421c241065cbaa99cc9cca4d73) ) - ROM_LOAD( "cg_01_h", 0x080000, 0x080000, CRC(d5726328) SHA1(26401ba8ce22fda161306b91d70afefa959cde8c) ) - ROM_LOAD( "cg_23_l", 0x100000, 0x080000, CRC(114d41d0) SHA1(d1166d495d92c6082fffbed422deb7605c5a41a2) ) - ROM_LOAD( "cg_23_h", 0x180000, 0x080000, CRC(e0468152) SHA1(f5a872d8658e959ec6cce51c7798291b5b973f15) ) -ROM_END - - -// TODO: this runs on oneshot.cpp hardware. Move to that driver and remove the hacks in video/gp9001.cpp needed to run it in this driver -ROM_START( pipibibsbl ) /* Based off the proto code. */ - ROM_REGION( 0x040000, "maincpu", 0 ) /* Main 68K code */ - ROM_LOAD16_BYTE( "ppbb06.bin", 0x000000, 0x020000, CRC(14c92515) SHA1(2d7f7c89272bb2a8115f163ad651bef3bca5107e) ) - ROM_LOAD16_BYTE( "ppbb05.bin", 0x000001, 0x020000, CRC(3d51133c) SHA1(d7bd94ad11e9aeb5a5165c5ac6f71950849bcd2f) ) - - ROM_REGION( 0x10000, "audiocpu", 0 ) /* Sound Z80 code */ - ROM_LOAD( "ppbb08.bin", 0x0000, 0x8000, CRC(101c0358) SHA1(162e02d00b7bdcdd3b48a0cd0527b7428435ec50) ) // same data as komocomo in oneshot.cpp - - ROM_REGION( 0x200000, "gp9001_0", 0 ) - /* GFX data differs slightly from Toaplan boards ??? */ - ROM_LOAD16_BYTE( "ppbb01.bin", 0x000000, 0x080000, CRC(0fcae44b) SHA1(ac72bc79e3a5d0a81647c312d310d00ace017272) ) - ROM_LOAD16_BYTE( "ppbb02.bin", 0x000001, 0x080000, CRC(8bfcdf87) SHA1(4537a7d646d3014f069c6fd0be457bb32e2f18ac) ) - ROM_LOAD16_BYTE( "ppbb03.bin", 0x100000, 0x080000, CRC(abdd2b8b) SHA1(a4246dd63515f01d1227c9a9e16d9f1c739ee39e) ) - ROM_LOAD16_BYTE( "ppbb04.bin", 0x100001, 0x080000, CRC(70faa734) SHA1(4448f4dbded56c142e57293d371e0a422c3a667e) ) - - ROM_REGION( 0x8000, "user1", 0 ) /* ??? Some sort of table */ - ROM_LOAD( "ppbb07.bin", 0x0000, 0x8000, CRC(456dd16e) SHA1(84779ee64d3ea33ba1ba4dee39b504a81c6811a1) ) // 1xxxxxxxxxxxxxx = 0xFF, same data as komocomo in oneshot.cpp -ROM_END - - -// TODO: determine if this is the correct driver or if this needs to be moved somewhere else, too -ROM_START( pipibibsbl2 ) // PIPI001 PCB - ROM_REGION( 0x040000, "maincpu", 0 ) /* Main 68K code */ - ROM_LOAD16_BYTE( "06.bin", 0x000000, 0x020000, CRC(25f49c2f) SHA1(a61246ec8a07ba14ee0a01c3458c59840b435c0b) ) - ROM_LOAD16_BYTE( "07.bin", 0x000001, 0x020000, CRC(15250177) SHA1(a5ee5ccc219f300d7387b45dc8f8b72fd0f37d7e) ) - - ROM_REGION( 0x20000, "audiocpu", 0 ) /* Sound Z80 code */ - ROM_LOAD( "08.bin", 0x00000, 0x10000, CRC(f2080071) SHA1(68cbae9559879b2dc19c41a7efbd13ab4a569d3f) ) // // 1ST AND 2ND HALF IDENTICAL, same as komocomo in oneshot.cpp - - ROM_REGION( 0x200000, "gp9001_0", 0 ) - ROM_LOAD16_BYTE( "01.bin", 0x000000, 0x80000, CRC(505e9e9f) SHA1(998995d94585d785263cc926f68632065aa6c366) ) - ROM_LOAD16_BYTE( "02.bin", 0x000001, 0x80000, CRC(860018f5) SHA1(7f42dffb27940629447d688e1771b4ecf04f3b43) ) - ROM_LOAD16_BYTE( "03.bin", 0x100000, 0x80000, CRC(ece1bc0f) SHA1(d29f1520f1a3a9d276d36af650bc0d70bcb5b8da) ) - ROM_LOAD16_BYTE( "04.bin", 0x100001, 0x80000, CRC(f328d7a3) SHA1(2c4fb5d6202f847aaf7c7be719c0c92b8bb5946b) ) - - ROM_REGION( 0x20000, "user1", 0 ) - ROM_LOAD( "5.bin", 0x00000, 0x20000, CRC(8107c4bd) SHA1(64e2fafa808c16c722454b611a8492a4620a925c) ) // motherboard ROM, unknown purpose -ROM_END - -ROM_START( pipibibsbl3 ) - ROM_REGION( 0x040000, "maincpu", 0 ) // Main 68K code, not scrambled - ROM_LOAD16_BYTE( "5.bin", 0x000000, 0x020000, CRC(7fab770c) SHA1(c96808870c5906e0203f38114702bd660e491a7d) ) - ROM_LOAD16_BYTE( "6.bin", 0x000001, 0x020000, CRC(9007ef00) SHA1(594052be7351e0b8e30f83abd9a91ab1429d82ef) ) - - ROM_REGION( 0x10000, "audiocpu", 0 ) // Sound Z80 code - ROM_LOAD( "7.bin", 0x0000, 0x8000, CRC(101c0358) SHA1(162e02d00b7bdcdd3b48a0cd0527b7428435ec50) ) // same data as komocomo in oneshot.cpp - - ROM_REGION( 0x200000, "gp9001_0", 0 ) - // GFX data differs slightly from Toaplan boards ??? - ROM_LOAD16_BYTE( "4.bin", 0x000000, 0x080000, CRC(0fcae44b) SHA1(ac72bc79e3a5d0a81647c312d310d00ace017272) ) - ROM_LOAD16_BYTE( "3.bin", 0x000001, 0x080000, CRC(8bfcdf87) SHA1(4537a7d646d3014f069c6fd0be457bb32e2f18ac) ) - ROM_LOAD16_BYTE( "2.bin", 0x100000, 0x080000, CRC(abdd2b8b) SHA1(a4246dd63515f01d1227c9a9e16d9f1c739ee39e) ) - ROM_LOAD16_BYTE( "1.bin", 0x100001, 0x080000, CRC(70faa734) SHA1(4448f4dbded56c142e57293d371e0a422c3a667e) ) - - ROM_REGION( 0x8000, "user1", 0 ) // ??? Some sort of table - ROM_LOAD( "8.bin", 0x0000, 0x8000, CRC(456dd16e) SHA1(84779ee64d3ea33ba1ba4dee39b504a81c6811a1) ) // 1xxxxxxxxxxxxxx = 0xFF, same data as komocomo in oneshot.cpp -ROM_END - -#define ROMS_FIXEIGHT \ - ROM_REGION( 0x080000, "maincpu", 0 ) \ - ROM_LOAD16_WORD_SWAP( "tp-026-1", 0x000000, 0x080000, CRC(f7b1746a) SHA1(0bbea6f111b818bc9b9b2060af4fe900f37cf7f9) ) \ - ROM_REGION( 0x400000, "gp9001_0", 0 ) \ - ROM_LOAD( "tp-026-3", 0x000000, 0x200000, CRC(e5578d98) SHA1(280d2b716d955e767d311fc9596823852435b6d7) ) \ - ROM_LOAD( "tp-026-4", 0x200000, 0x200000, CRC(b760cb53) SHA1(bc9c5e49e45cdda0f774be0038aa4deb21d4d285) ) \ - ROM_REGION( 0x40000, "oki1", 0 ) \ - ROM_LOAD( "tp-026-2", 0x00000, 0x40000, CRC(85063f1f) SHA1(1bf4d77494de421c98f6273b9876e60d827a6826) ) - -// note you may need to byteswap these EEPROM files to reprogram the original chip, this is the same for many supported in MAME. - -ROM_START( fixeightkt ) - ROMS_FIXEIGHT - ROM_REGION16_BE( 0x80, "eeprom", 0 ) - ROM_LOAD( "fixeightkt.nv", 0x00, 0x80, CRC(08fa73ba) SHA1(b7761d3dd3f4485e55c8ef2cf1a840ca771ee2fc) ) -ROM_END - -ROM_START( fixeightk ) - ROMS_FIXEIGHT - ROM_REGION16_BE( 0x80, "eeprom", 0 ) - ROM_LOAD( "fixeightk.nv", 0x00, 0x80, CRC(cac91c6f) SHA1(55b284f081753d60abff63493094322756b7f0c5) ) -ROM_END - -ROM_START( fixeightht ) - ROMS_FIXEIGHT - ROM_REGION16_BE( 0x80, "eeprom", 0 ) - ROM_LOAD( "fixeightht.nv", 0x00, 0x80, CRC(57edaa51) SHA1(b8d50e82590b8cbbbcafec5f9cfbc91e4c286db5) ) -ROM_END - -ROM_START( fixeighth ) - ROMS_FIXEIGHT - ROM_REGION16_BE( 0x80, "eeprom", 0 ) - ROM_LOAD( "fixeighth.nv", 0x00, 0x80, CRC(95dec584) SHA1(1c309074b51da5a5263dee00403296946e41067b) ) -ROM_END - -ROM_START( fixeighttwt ) - ROMS_FIXEIGHT - ROM_REGION16_BE( 0x80, "eeprom", 0 ) - ROM_LOAD( "fixeighttwt.nv", 0x00, 0x80, CRC(b6d5c06c) SHA1(7fda380ac6835a983c57d093ccad7bd76893c9ba)) -ROM_END - -ROM_START( fixeighttw ) - ROMS_FIXEIGHT - ROM_REGION16_BE( 0x80, "eeprom", 0 ) - ROM_LOAD( "fixeighttw.nv", 0x00, 0x80, CRC(74e6afb9) SHA1(87bdc95eb0d2d54375de2c622557d503e14154be)) -ROM_END - -ROM_START( fixeightat ) - ROMS_FIXEIGHT - ROM_REGION16_BE( 0x80, "eeprom", 0 ) - ROM_LOAD( "fixeightat.nv", 0x00, 0x80,CRC(e9c21987) SHA1(7f699e38deb84902ed62b857a3d2b4e3ea1475bb) ) -ROM_END - -ROM_START( fixeighta ) - ROMS_FIXEIGHT - ROM_REGION16_BE( 0x80, "eeprom", 0 ) - ROM_LOAD( "fixeighta.nv", 0x00, 0x80, CRC(2bf17652) SHA1(4ec6f188e63610d258cd6b2432d2200d61d80bed)) -ROM_END - -ROM_START( fixeightt ) - ROMS_FIXEIGHT - ROM_REGION16_BE( 0x80, "eeprom", 0 ) - ROM_LOAD( "fixeightt.nv", 0x00, 0x80, CRC(c0da4a05) SHA1(3686161244e3e8be0e2fdb5fc5c24e39a7aeba85) ) -ROM_END - -ROM_START( fixeight ) - ROMS_FIXEIGHT - ROM_REGION16_BE( 0x80, "eeprom", 0 ) - ROM_LOAD( "fixeight.nv", 0x00, 0x80, CRC(02e925d0) SHA1(5839d10aceff84916ea99e9c6afcdc90eef7468b) ) -ROM_END - -ROM_START( fixeightut ) - ROMS_FIXEIGHT - ROM_REGION16_BE( 0x80, "eeprom", 0 ) - ROM_LOAD( "fixeightut.nv", 0x00, 0x80, CRC(9fcd93ee) SHA1(4f2750f09d9b8ff358a2fd6c7a4a8ba6de67017a) ) -ROM_END - -ROM_START( fixeightu ) - ROMS_FIXEIGHT - ROM_REGION16_BE( 0x80, "eeprom", 0 ) - ROM_LOAD( "fixeightu.nv", 0x00, 0x80, CRC(5dfefc3b) SHA1(5203525c58e2ae10575af2e277a5696bd64c5b60) ) -ROM_END - -ROM_START( fixeightj ) - ROMS_FIXEIGHT - ROM_REGION16_BE( 0x80, "eeprom", 0 ) - ROM_LOAD( "fixeightj.nv", 0x00, 0x80, CRC(21e22038) SHA1(29fb10061e62799bb5e4171e144daac49f0cdf06) ) -ROM_END - -ROM_START( fixeightjt ) - ROMS_FIXEIGHT - ROM_REGION16_BE( 0x80, "eeprom", 0 ) - ROM_LOAD( "fixeightjt.nv", 0x00, 0x80, CRC(e3d14fed) SHA1(ee4982ef195240c5eaa5005ca1d591901fb01b47) ) -ROM_END - - -/* -Fix Eight (bootleg) -Toaplan, 1992 - -PCB Layout ----------- - -|--------------------------------------------| -| 1.BIN PAL 14MHz PAL| -| M6295 PAL | -| PAL 6116 4.BIN 681000 681000| -| 6116 | -| 6116 681000 681000| -|J 6116 PAL | -|A PAL | -|M | -|M 62256 62256 PAL | -|A 2.BIN 3.BIN PAL | -| PAL | -| 68000 PAL | -| DSW2 |------| 5.BIN | -| DSW1 6264 |TPC | | -| 3.579545MHz |1020 | 6.BIN | -| 10MHz 6264 |------| 7.BIN | -|--------------------------------------------| -Notes: - 68000 clock at 10.000MHz - M6295 clock at 875kHz [14M/16]. Sample rate = 875000 / 165 - VSync at 60Hz - 6116 - 2k x8 SRAM (x4) - 6264 - 8k x8 SRAM (x2) - 62256 - 32k x8 SRAM (x2) - 681000- 128k x8 SRAM (x4) -*/ - - -ROM_START( fixeightbl ) - ROM_REGION( 0x100000, "maincpu", 0 ) /* Main 68K code */ - ROM_LOAD16_BYTE( "3.bin", 0x000000, 0x80000, CRC(cc77d4b4) SHA1(4d3376cbae13d90c6314d8bb9236c2183fc6253c) ) - ROM_LOAD16_BYTE( "2.bin", 0x000001, 0x80000, CRC(ed715488) SHA1(37be9bc8ff6b54a1f660d89469c6c2da6301e9cd) ) - - ROM_REGION( 0x400000, "gp9001_0", 0 ) - ROM_LOAD( "tp-026-3", 0x000000, 0x200000, CRC(e5578d98) SHA1(280d2b716d955e767d311fc9596823852435b6d7) ) - ROM_LOAD( "tp-026-4", 0x200000, 0x200000, CRC(b760cb53) SHA1(bc9c5e49e45cdda0f774be0038aa4deb21d4d285) ) - - ROM_REGION( 0x08000, "text", 0) - ROM_LOAD( "4.bin", 0x00000, 0x08000, CRC(a6aca465) SHA1(2b331faeee1832e0adc5218254a99d66331862c6) ) - - ROM_REGION( 0x80000, "oki1", 0 ) /* ADPCM Samples */ - ROM_LOAD( "1.bin", 0x00000, 0x80000, CRC(888f19ac) SHA1(d2f4f8b7be7a0fdb95baa0af8930e50e2f875c05) ) - - ROM_REGION( 0x8000, "user1", 0 ) /* ??? Some sort of table - same as in pipibibsbl */ - ROM_LOAD( "5.bin", 0x0000, 0x8000, CRC(456dd16e) SHA1(84779ee64d3ea33ba1ba4dee39b504a81c6811a1) ) -ROM_END - - -ROM_START( grindstm ) - ROM_REGION( 0x080000, "maincpu", 0 ) /* Main 68K code */ - ROM_LOAD16_WORD_SWAP( "01.bin", 0x000000, 0x080000, CRC(4923f790) SHA1(1c2d66b432d190d0fb6ac7ca0ec0687aea3ccbf4) ) - - /* Secondary CPU is a Toaplan marked chip, (TS-007-Spy TOA PLAN) */ - /* It's a NEC V25 (PLCC94) (encrypted program uploaded by main CPU) */ - - ROM_REGION( 0x200000, "gp9001_0", 0 ) - ROM_LOAD( "tp027_02.bin", 0x000000, 0x100000, CRC(877b45e8) SHA1(b3ed8d8dbbe51a1919afc55d619d2b6771971493) ) - ROM_LOAD( "tp027_03.bin", 0x100000, 0x100000, CRC(b1fc6362) SHA1(5e97e3cce31be57689d394a50178cda4d80cce5f) ) -ROM_END - - -ROM_START( grindstma ) - ROM_REGION( 0x080000, "maincpu", 0 ) /* Main 68K code */ - ROM_LOAD16_WORD_SWAP( "tp027-01.rom", 0x000000, 0x080000, CRC(8d8c0392) SHA1(824dde274c8bef8a87c54d8ccdda7f0feb8d11e1) ) - - /* Secondary CPU is a Toaplan marked chip, (TS-007-Spy TOA PLAN) */ - /* It's a NEC V25 (PLCC94) (encrypted program uploaded by main CPU) */ - - ROM_REGION( 0x200000, "gp9001_0", 0 ) - ROM_LOAD( "tp027_02.bin", 0x000000, 0x100000, CRC(877b45e8) SHA1(b3ed8d8dbbe51a1919afc55d619d2b6771971493) ) - ROM_LOAD( "tp027_03.bin", 0x100000, 0x100000, CRC(b1fc6362) SHA1(5e97e3cce31be57689d394a50178cda4d80cce5f) ) -ROM_END - - -ROM_START( vfive ) - ROM_REGION( 0x080000, "maincpu", 0 ) /* Main 68K code */ - ROM_LOAD16_WORD_SWAP( "tp027_01.bin", 0x000000, 0x080000, CRC(731d50f4) SHA1(794255d0a809cda9170f5bac473df9d7f0efdac8) ) - - /* Secondary CPU is a Toaplan marked chip, (TS-007-Spy TOA PLAN) */ - /* It's a NEC V25 (PLCC94) (encrypted program uploaded by main CPU) */ - - ROM_REGION( 0x200000, "gp9001_0", 0 ) - ROM_LOAD( "tp027_02.bin", 0x000000, 0x100000, CRC(877b45e8) SHA1(b3ed8d8dbbe51a1919afc55d619d2b6771971493) ) - ROM_LOAD( "tp027_03.bin", 0x100000, 0x100000, CRC(b1fc6362) SHA1(5e97e3cce31be57689d394a50178cda4d80cce5f) ) -ROM_END - - -ROM_START( batsugun ) - ROM_REGION( 0x080000, "maincpu", 0 ) /* Main 68K code */ - ROM_LOAD16_WORD_SWAP( "tp030_1a.bin", 0x000000, 0x080000, CRC(cb1d4554) SHA1(ef31f24d77e1c13bdf5558a04a6253e2e3e6a790) ) - - /* Secondary CPU is a Toaplan marked chip, (TS-007-Spy TOA PLAN) */ - /* It's a NEC V25 (PLCC94) (program uploaded by main CPU) */ - - ROM_REGION( 0x400000, "gp9001_0", 0 ) - ROM_LOAD( "tp030_3l.bin", 0x000000, 0x100000, CRC(3024b793) SHA1(e161db940f069279356fca2c5bf2753f07773705) ) - ROM_LOAD( "tp030_3h.bin", 0x100000, 0x100000, CRC(ed75730b) SHA1(341f0f728144a049486d996c9bb14078578c6879) ) - ROM_LOAD( "tp030_4l.bin", 0x200000, 0x100000, CRC(fedb9861) SHA1(4b0917056bd359b21935358c6bcc729262be6417) ) - ROM_LOAD( "tp030_4h.bin", 0x300000, 0x100000, CRC(d482948b) SHA1(31be7dc5cff072403b783bf203b9805ffcad7284) ) - - ROM_REGION( 0x200000, "gp9001_1", 0 ) - ROM_LOAD( "tp030_5.bin", 0x000000, 0x100000, CRC(bcf5ba05) SHA1(40f98888a29cdd30cda5dfb60fdc667c69b0fdb0) ) - ROM_LOAD( "tp030_6.bin", 0x100000, 0x100000, CRC(0666fecd) SHA1(aa8f921fc51590b5b05bbe0b0ad0cce5ff359c64) ) - - ROM_REGION( 0x40000, "oki1", 0 ) /* ADPCM Samples */ - ROM_LOAD( "tp030_2.bin", 0x00000, 0x40000, CRC(276146f5) SHA1(bf11d1f6782cefcad77d52af4f7e6054a8f93440) ) - - ROM_REGION( 0x1000, "plds", 0 ) /* Logic for mixing output of both GP9001 GFX controllers */ - ROM_LOAD( "tp030_u19_gal16v8b-15.bin", 0x0000, 0x117, CRC(f71669e8) SHA1(ec1fbe04605fee864af4b01f001af227938c9f21) ) -// ROM_LOAD( "tp030_u19_gal16v8b-15.jed", 0x0000, 0x991, CRC(31be54a2) SHA1(06278942a9a2ea858c0352b2ef5a65bf329b7b82) ) -ROM_END - -ROM_START( batsuguna ) - ROM_REGION( 0x080000, "maincpu", 0 ) /* Main 68K code */ - ROM_LOAD16_WORD_SWAP( "tp030_01.bin", 0x000000, 0x080000, CRC(3873d7dd) SHA1(baf6187d7d554cfcf4a86b63f07fc30df7ef84c9) ) - - /* Secondary CPU is a Toaplan marked chip, (TS-007-Spy TOA PLAN) */ - /* It's a NEC V25 (PLCC94) (program uploaded by main CPU) */ - - ROM_REGION( 0x400000, "gp9001_0", 0 ) - ROM_LOAD( "tp030_3l.bin", 0x000000, 0x100000, CRC(3024b793) SHA1(e161db940f069279356fca2c5bf2753f07773705) ) - ROM_LOAD( "tp030_3h.bin", 0x100000, 0x100000, CRC(ed75730b) SHA1(341f0f728144a049486d996c9bb14078578c6879) ) - ROM_LOAD( "tp030_4l.bin", 0x200000, 0x100000, CRC(fedb9861) SHA1(4b0917056bd359b21935358c6bcc729262be6417) ) - ROM_LOAD( "tp030_4h.bin", 0x300000, 0x100000, CRC(d482948b) SHA1(31be7dc5cff072403b783bf203b9805ffcad7284) ) - - ROM_REGION( 0x200000, "gp9001_1", 0 ) - ROM_LOAD( "tp030_5.bin", 0x000000, 0x100000, CRC(bcf5ba05) SHA1(40f98888a29cdd30cda5dfb60fdc667c69b0fdb0) ) - ROM_LOAD( "tp030_6.bin", 0x100000, 0x100000, CRC(0666fecd) SHA1(aa8f921fc51590b5b05bbe0b0ad0cce5ff359c64) ) - - ROM_REGION( 0x40000, "oki1", 0 ) /* ADPCM Samples */ - ROM_LOAD( "tp030_2.bin", 0x00000, 0x40000, CRC(276146f5) SHA1(bf11d1f6782cefcad77d52af4f7e6054a8f93440) ) - - ROM_REGION( 0x1000, "plds", 0 ) /* Logic for mixing output of both GP9001 GFX controllers */ - ROM_LOAD( "tp030_u19_gal16v8b-15.bin", 0x0000, 0x117, CRC(f71669e8) SHA1(ec1fbe04605fee864af4b01f001af227938c9f21) ) -ROM_END - -ROM_START( batsugunb ) - ROM_REGION( 0x080000, "maincpu", 0 ) /* Main 68K code */ - ROM_LOAD16_WORD_SWAP( "large_rom1.bin", 0x000000, 0x080000, CRC(c9de8ed8) SHA1(8de9acd26e83c8ea3388137da528704116aa7bdb) ) - - /* Secondary CPU is a Toaplan marked chip, (TS-007-Spy TOA PLAN) */ - /* It's a NEC V25 (PLCC94) (program uploaded by main CPU) */ - - ROM_REGION( 0x400000, "gp9001_0", 0 ) - ROM_LOAD16_BYTE( "rom12.bin", 0x000000, 0x080000, CRC(d25affc6) SHA1(00803ae5a2bc06edbfb9ea6e3df51f195bbee8cb) ) - ROM_LOAD16_BYTE( "rom6.bin", 0x000001, 0x080000, CRC(ddd6df60) SHA1(3b46945c51e7b10b473d98916f075e8def336ce7) ) - ROM_LOAD16_BYTE( "rom11.bin", 0x100000, 0x080000, CRC(ed72fe3e) SHA1(5c0f4d5cc84b45e1924dacfa4c0b602cc1600b2f) ) - ROM_LOAD16_BYTE( "rom5.bin", 0x100001, 0x080000, CRC(fd44b33b) SHA1(791cf6056a2dbafa5f41f1dcf686947ee990647d) ) - ROM_LOAD16_BYTE( "rom10.bin", 0x200000, 0x080000, CRC(86b2c6a9) SHA1(b3f39246012c6cd9df69a6797d56479523b33bcb) ) - ROM_LOAD16_BYTE( "rom4.bin", 0x200001, 0x080000, CRC(e7c1c623) SHA1(0d8922ce901b5f74f1bd397d5d9c6ab4e918b1d1) ) - ROM_LOAD16_BYTE( "rom9.bin", 0x300000, 0x080000, CRC(fda8ee00) SHA1(d5ea617a72b2721386eb2dfc15b76de2e30f069c) ) - ROM_LOAD16_BYTE( "rom3.bin", 0x300001, 0x080000, CRC(a7c4dee8) SHA1(94e2dda067612fac810157f8cf392b685b38798b) ) - - ROM_REGION( 0x200000, "gp9001_1", 0 ) - ROM_LOAD16_BYTE( "rom8.bin", 0x000000, 0x080000, CRC(a2c6a170) SHA1(154048ddc8ca2b4e9617e142d904ad2698b0ad02) ) - ROM_LOAD16_BYTE( "rom2.bin", 0x000001, 0x080000, CRC(a457e202) SHA1(4a9f2f95c866fc9d40af1c57ce1940f0a6dc1b82) ) - ROM_LOAD16_BYTE( "rom7.bin", 0x100000, 0x080000, CRC(8644518f) SHA1(570141deeb796cfae57600d5a518d34bb6dc14d0) ) - ROM_LOAD16_BYTE( "rom1.bin", 0x100001, 0x080000, CRC(8e339897) SHA1(80e84c291f287c0783bddfcb1b7ebf78c154cadc) ) - - ROM_REGION( 0x40000, "oki1", 0 ) /* ADPCM Samples */ - ROM_LOAD( "rom13.bin", 0x00000, 0x40000, CRC(276146f5) SHA1(bf11d1f6782cefcad77d52af4f7e6054a8f93440) ) - - ROM_REGION( 0x1000, "plds", 0 ) /* Logic for mixing output of both GP9001 GFX controllers */ - ROM_LOAD( "tp030_u19_gal16v8b-15.bin", 0x0000, 0x117, CRC(f71669e8) SHA1(ec1fbe04605fee864af4b01f001af227938c9f21) ) -// ROM_LOAD( "tp030_u19_gal16v8b-15.jed", 0x0000, 0x991, CRC(31be54a2) SHA1(06278942a9a2ea858c0352b2ef5a65bf329b7b82) ) -ROM_END - -// very similar to batsuguna, same main CPU label, seems to have just a tiny bit more code -ROM_START( batsugunc ) - ROM_REGION( 0x080000, "maincpu", 0 ) // Main 68K code - ROM_LOAD16_WORD_SWAP( "tp-030_01.u69", 0x000000, 0x080000, CRC(545305c4) SHA1(9411ad7fe0be89a9f04b9116c9c709dc5e98c345) ) - - /* Secondary CPU is a Toaplan marked chip, (TS-007-Spy TOA PLAN) */ - /* It's a NEC V25 (PLCC94) (program uploaded by main CPU) */ - - ROM_REGION( 0x400000, "gp9001_0", 0 ) - ROM_LOAD( "tp030_rom3-l.u55", 0x000000, 0x100000, CRC(3024b793) SHA1(e161db940f069279356fca2c5bf2753f07773705) ) - ROM_LOAD( "tp030_rom3-h.u56", 0x100000, 0x100000, CRC(ed75730b) SHA1(341f0f728144a049486d996c9bb14078578c6879) ) - ROM_LOAD( "tp030_rom4-l.u54", 0x200000, 0x100000, CRC(fedb9861) SHA1(4b0917056bd359b21935358c6bcc729262be6417) ) - ROM_LOAD( "tp030_rom4-h.u57", 0x300000, 0x100000, CRC(d482948b) SHA1(31be7dc5cff072403b783bf203b9805ffcad7284) ) - - ROM_REGION( 0x200000, "gp9001_1", 0 ) - ROM_LOAD( "tp030_rom5.u32", 0x000000, 0x100000, CRC(bcf5ba05) SHA1(40f98888a29cdd30cda5dfb60fdc667c69b0fdb0) ) - ROM_LOAD( "tp030_rom6.u31", 0x100000, 0x100000, CRC(0666fecd) SHA1(aa8f921fc51590b5b05bbe0b0ad0cce5ff359c64) ) - - ROM_REGION( 0x40000, "oki1", 0 ) - ROM_LOAD( "tp030_rom2.u65", 0x00000, 0x40000, CRC(276146f5) SHA1(bf11d1f6782cefcad77d52af4f7e6054a8f93440) ) - - ROM_REGION( 0x1000, "plds", 0 ) // Logic for mixing output of both GP9001 GFX controllers - ROM_LOAD( "tp030_u19_gal16v8b-15.bin", 0x0000, 0x117, CRC(f71669e8) SHA1(ec1fbe04605fee864af4b01f001af227938c9f21) ) -// ROM_LOAD( "tp030_u19_gal16v8b-15.jed", 0x0000, 0x991, CRC(31be54a2) SHA1(06278942a9a2ea858c0352b2ef5a65bf329b7b82) ) -ROM_END - -ROM_START( batsugunsp ) - ROM_REGION( 0x080000, "maincpu", 0 ) /* Main 68K code */ - ROM_LOAD16_WORD_SWAP( "tp-030sp.u69", 0x000000, 0x080000, CRC(8072a0cd) SHA1(3a0a9cdf894926a16800c4882a2b00383d981367) ) - - /* Secondary CPU is a Toaplan marked chip, (TS-007-Spy TOA PLAN) */ - /* It's a NEC V25 (PLCC94) (program uploaded by main CPU) */ - - ROM_REGION( 0x400000, "gp9001_0", 0 ) - ROM_LOAD( "tp030_3l.bin", 0x000000, 0x100000, CRC(3024b793) SHA1(e161db940f069279356fca2c5bf2753f07773705) ) - ROM_LOAD( "tp030_3h.bin", 0x100000, 0x100000, CRC(ed75730b) SHA1(341f0f728144a049486d996c9bb14078578c6879) ) - ROM_LOAD( "tp030_4l.bin", 0x200000, 0x100000, CRC(fedb9861) SHA1(4b0917056bd359b21935358c6bcc729262be6417) ) - ROM_LOAD( "tp030_4h.bin", 0x300000, 0x100000, CRC(d482948b) SHA1(31be7dc5cff072403b783bf203b9805ffcad7284) ) - - ROM_REGION( 0x200000, "gp9001_1", 0 ) - ROM_LOAD( "tp030_5.bin", 0x000000, 0x100000, CRC(bcf5ba05) SHA1(40f98888a29cdd30cda5dfb60fdc667c69b0fdb0) ) - ROM_LOAD( "tp030_6.bin", 0x100000, 0x100000, CRC(0666fecd) SHA1(aa8f921fc51590b5b05bbe0b0ad0cce5ff359c64) ) - - ROM_REGION( 0x40000, "oki1", 0 ) /* ADPCM Samples */ - ROM_LOAD( "tp030_2.bin", 0x00000, 0x40000, CRC(276146f5) SHA1(bf11d1f6782cefcad77d52af4f7e6054a8f93440) ) - - ROM_REGION( 0x1000, "plds", 0 ) /* Logic for mixing output of both GP9001 GFX controllers */ - ROM_LOAD( "tp030_u19_gal16v8b-15.bin", 0x0000, 0x117, CRC(f71669e8) SHA1(ec1fbe04605fee864af4b01f001af227938c9f21) ) -ROM_END - -// a cost-cutting bootleg PCB with only M68000 + OKIM6295. A pair of TPC1020 seem to do the job of the GP9001s. -// according to the dumper 'audio is pretty garbage, and some sprites overlay the UI incorrectly' -ROM_START( batsugunbl ) - ROM_REGION( 0x080000, "maincpu", 0 ) - ROM_LOAD16_WORD_SWAP( "27c240.bin", 0x000000, 0x080000, CRC(a34df8bb) SHA1(10d456f5437b21a95fd8018bdb19a08a110241c4) ) - - ROM_REGION( 0x400000, "gp9001_0", 0 ) // same as original - ROM_LOAD( "27c8100-j.bin", 0x000000, 0x100000, CRC(3024b793) SHA1(e161db940f069279356fca2c5bf2753f07773705) ) - ROM_LOAD( "27c8100-k.bin", 0x100000, 0x100000, CRC(ed75730b) SHA1(341f0f728144a049486d996c9bb14078578c6879) ) - ROM_LOAD( "27c8100-l.bin", 0x200000, 0x100000, CRC(fedb9861) SHA1(4b0917056bd359b21935358c6bcc729262be6417) ) - ROM_LOAD( "27c8100-m.bin", 0x300000, 0x100000, CRC(d482948b) SHA1(31be7dc5cff072403b783bf203b9805ffcad7284) ) - - ROM_REGION( 0x200000, "gp9001_1", 0 ) // same as original - ROM_LOAD( "27c8100-n.bin", 0x000000, 0x100000, CRC(bcf5ba05) SHA1(40f98888a29cdd30cda5dfb60fdc667c69b0fdb0) ) - ROM_LOAD( "27c8100-o.bin", 0x100000, 0x100000, CRC(0666fecd) SHA1(aa8f921fc51590b5b05bbe0b0ad0cce5ff359c64) ) - - ROM_REGION( 0x80000, "oki1", 0 ) // more samples to compensate for missing YM2151 - ROM_LOAD( "27c040.bin", 0x00000, 0x80000, CRC(1f8ec1b6) SHA1(28107a90d29613ceddc001df2556543b33c1294c) ) -ROM_END - -ROM_START( pwrkick ) // Sunwise SW931201-1 PCB - 8-liner connections - ROM_REGION( 0x80000, "maincpu", ROMREGION_ERASE00 ) - ROM_LOAD16_WORD_SWAP( "1.u61", 0x000000, 0x080000, CRC(118b5899) SHA1(7a1637a63eb17e3892d79aede5730013a1dc00f9) ) - - ROM_REGION( 0x100000, "gp9001_0", ROMREGION_ERASE00 ) - ROM_LOAD( "2.u26", 0x000000, 0x080000, CRC(a190eaea) SHA1(2c7b8c8026873e0f591fbcbc2e72b196ef84e162) ) - ROM_LOAD( "3.u27", 0x080000, 0x080000, CRC(0b81e038) SHA1(8376617ae519a8ef604f20b26e941aa5b8066602) ) - - ROM_REGION( 0x80000, "oki1", ROMREGION_ERASE00 ) - ROM_LOAD( "4.u33", 0x000000, 0x080000, CRC(3ab742f1) SHA1(ce8ca02ca57fd77872e421ce601afd017d3518a0) ) -ROM_END - -/* - -Burger Kids, 1995 Sunwise - -SW931201-1 -+--||||||-----------------------------------------+ -| YM3014* YM2151* | -| TDA1519A M6295 FFK4.U33 BT1 | -| U31* | -| 16.000MHz 32.768kHz D4992C | -| MB3771 | -|8 | -|- U67* | -|L FFK1.U61 62256 | -|I U68* 62256 | -|N GAL16V8B TMP68HC000P-12 | -|E | -|R | -| 1635 27.000MHz FFK3.U27 | -| GAL16V8B 1635 20.000MHz U12* | -| SW1 GAL16V8B +---------+ FFK2.U26 | -| SW2 | L7A0498 | U13* | -| SW3 | GP9001 | 4256 4256 | -| 6216 +---------+ 4256 4256 | -| 6216 4256 4256 | -+-------------------------------------------------+ - -NOTE: This PCB uses an 8-Liner style edge connector - -* Denotes unpopulated components - - CPU: Toshiba TMP68HC000P-12 - Sound: OKI M6295 - Video: L7A0498 GP9001 QFP208 - OSC: 27MHz, 20MHz, 16MHz & 32.768kHz - RAM: MB81C4256A-70P - 256K x 4-bit DRAM - HM62256BLP-9 - 32K x 8-bit SRAM - IMS1635P-25 - 8K x 8-bit SRAM - XRM6216-10 - 2K x 8-bit SRAM - Other: 8 Position Dipswitch x 3 - NEC D4992 CMOS 8-Bit Parallel I/O Calendar Clock - MB3771 Voltage monitor - BT1 - CR2550 3Volt battery - -NOTE: Sunwise's S951060-VGP PCB uses identical componenets to the SW931201 but has a standard JAMMA connector -*/ - -ROM_START( burgkids ) // Sunwise SW931201-1 PCB - 8-liner connections - ROM_REGION( 0x80000, "maincpu", ROMREGION_ERASE00 ) - ROM_LOAD16_WORD_SWAP( "ffk1.u61", 0x000000, 0x080000, CRC(ac96cb0d) SHA1(2ce5c06d61f3ff18b222619e41d09e46d44c5bab) ) - - ROM_REGION( 0x100000, "gp9001_0", ROMREGION_ERASE00 ) - ROM_LOAD( "ffk2.u26", 0x000000, 0x080000, CRC(09f7b0ae) SHA1(f340f27a601ff89f143398263d822b8f340eea6e) ) - ROM_LOAD( "ffk3.u27", 0x080000, 0x080000, CRC(63c761bc) SHA1(f0ee1dc6aaeacff23e55d072102b814c7ef30550) ) - - ROM_REGION( 0x80000, "oki1", ROMREGION_ERASE00 ) - ROM_LOAD( "ffk4.u33", 0x000000, 0x080000, CRC(3b032d4f) SHA1(69056bf205aadf6c9fee56ce396b11a5187caa03) ) -ROM_END - -ROM_START( othldrby ) // Sunwise S951060-VGP PCB - JAMMA compliant (components identical to Sunwise SW931201-1 PCB) - ROM_REGION( 0x080000, "maincpu", 0 ) - ROM_LOAD16_WORD_SWAP( "sunwise_db0_1.u61", 0x00000, 0x80000, CRC(6b4008d3) SHA1(4cf838c47563ba482be8364b2e115569a4a06c83) ) - - ROM_REGION( 0x400000, "gp9001_0", 0 ) - ROM_LOAD( "db0-r2.u26", 0x000000, 0x200000, CRC(4efff265) SHA1(4cd239ff42f532495946cb52bd1fee412f84e192) ) // mask ROMs - ROM_LOAD( "db0-r3.u27", 0x200000, 0x200000, CRC(5c142b38) SHA1(5466a8b061a0f2545493de0f96fd4387beea276a) ) - - ROM_REGION( 0x080000, "oki1", 0 ) /* OKIM6295 samples */ - ROM_LOAD( "sunwise_db0_4.u33", 0x00000, 0x80000, CRC(a9701868) SHA1(9ee89556666d358e8d3915622573b3ba660048b8) ) -ROM_END - -ROM_START( enmadaio ) - ROM_REGION( 0x080000, "maincpu", 0 ) - ROM_LOAD16_WORD_SWAP( "03n_u53.c8", 0x00000, 0x80000, CRC(1a6ca2ee) SHA1(13d34a10004ca172db7953e2be8daa90fc5b62ed) ) - - ROM_REGION( 0x200000, "gp9001_0", 0 ) - ROM_LOAD( "rom4_u30.c19", 0x000000, 0x100000, CRC(7a012d8b) SHA1(a33d9490573a9fd1e799d3fe567f991926851c51) ) - ROM_LOAD( "rom5_u31.c18", 0x100000, 0x100000, CRC(60b127ab) SHA1(98785dfd6a86b4bd2c9786f6f72796c023b5b73a) ) - - ROM_REGION( 0x1800000, "oki1", 0 ) /* OKIM6295 samples */ // each rom contains 8 0x40000 banks, there are 12 roms, so 96 (0x60) banks here! - ROM_LOAD( "rom6_u65.a1", 0x0000000, 0x0200000, CRC(f33c6c0b) SHA1(06d73cd5b6d27de4d68f2dde1ed4dfa72b9a9178) ) - ROM_LOAD( "rom7_u66.a3", 0x0200000, 0x0200000, CRC(1306f8b3) SHA1(21b0d3180f1f4af77074c35c66844e38a464fea0) ) - ROM_LOAD( "rom8_u61.a4", 0x0400000, 0x0200000, CRC(4f211c00) SHA1(b067de95ad595a4915effefb83789e4e3d9db6f9) ) - ROM_LOAD( "rom9_u62.a6", 0x0600000, 0x0200000, CRC(292d3ef6) SHA1(d027d4c64e57f46e444ee83b62f6c3bdf02e4eed) ) - ROM_LOAD( "rom10_u67.a8", 0x0800000, 0x0200000, CRC(5219bf86) SHA1(946c8fcf3c04a88517d1a66ccd56609d22da945f) ) - ROM_LOAD( "rom11_u68.a10", 0x0a00000, 0x0200000, CRC(56fe4b1d) SHA1(2ea0413b435dd178174eb66d38dc9f7ab3d07ba5) ) - ROM_LOAD( "rom12_u63.a11", 0x0c00000, 0x0200000, CRC(cc48ff18) SHA1(10f6d9f445c9244b797846450f0c94700ccc7367) ) - ROM_LOAD( "rom13_u64.a13", 0x0e00000, 0x0200000, CRC(a3cd181a) SHA1(6a87479c24a61f7ac940e9c9bb62a18f26c9c843) ) - ROM_LOAD( "rom14_u69.a14", 0x1000000, 0x0200000, CRC(5d8cddec) SHA1(1912850d065d4ce1a1cdfd5a704218e660b5345b) ) - ROM_LOAD( "rom15_u70.a16", 0x1200000, 0x0200000, CRC(c75012f5) SHA1(b1ba0abab3eb8e9e3778eecab4951d828c85cecb) ) - ROM_LOAD( "rom16_u71.a18", 0x1400000, 0x0200000, CRC(efd02b0d) SHA1(b23fa3298fc29086f9ab05bc58775ff47b4cb7a9) ) - ROM_LOAD( "rom17_u72.a19", 0x1600000, 0x0200000, CRC(6b8717c3) SHA1(b5b7e35deaa2f34bccd1e83844d4bc0be845d0b8) ) -ROM_END - -ROM_START( snowbro2 ) - ROM_REGION( 0x080000, "maincpu", 0 ) /* Main 68K code */ - ROM_LOAD16_WORD_SWAP( "pro-4", 0x000000, 0x080000, CRC(4c7ee341) SHA1(ad46c605a38565d0148daac301be4e4b72302fe7) ) - - ROM_REGION( 0x300000, "gp9001_0", 0 ) - ROM_LOAD( "rom2-l", 0x000000, 0x100000, CRC(e9d366a9) SHA1(e87e3966fce3395324b90db6c134b3345104c04b) ) - ROM_LOAD( "rom2-h", 0x100000, 0x080000, CRC(9aab7a62) SHA1(611f6a15fdbac5d3063426a365538c1482e996bf) ) - ROM_LOAD( "rom3-l", 0x180000, 0x100000, CRC(eb06e332) SHA1(7cd597bfffc153d178530c0f0903bebd751c9dd1) ) - ROM_LOAD( "rom3-h", 0x280000, 0x080000, CRC(df4a952a) SHA1(b76af61c8437caca573ff1312832898666a611aa) ) - - ROM_REGION( 0x80000, "oki1", 0 ) /* ADPCM Samples */ - ROM_LOAD( "rom4", 0x00000, 0x80000, CRC(638f341e) SHA1(aa3fca25f099339ece1878ea730c5e9f18ec4823) ) -ROM_END - -ROM_START( snowbro2b ) // seems to be the same data as the main set, but with the extra user1 rom and different rom layout - ROM_REGION( 0x080000, "maincpu", 0 ) /* Main 68K code - difference with main set is year changed from 1994 to 1998 and upper FFFF fill changed to 00FF fill */ - ROM_LOAD16_BYTE( "sb2-prg1.u39", 0x000000, 0x040000, CRC(e1fec8a2) SHA1(30c1a351070d784da9ba0dca68be8a262dba2045) ) - ROM_LOAD16_BYTE( "sb2-prg0.u23", 0x000001, 0x040000, CRC(b473cd57) SHA1(331130faa9de01b3ca93845174e8c3684bd269c7) ) - - ROM_REGION( 0x400000, "gp9001_0", 0 ) - ROM_LOAD( "sb2-gfx.u177", 0x000000, 0x200000, CRC(ebeec910) SHA1(e179f393b98135caa8419b68cd979038ab47a413) ) - ROM_LOAD( "sb2-gfx.u175", 0x200000, 0x200000, CRC(e349c75b) SHA1(7d40d00fc0e15a68c427fe94db410bb7cbe00117) ) - - ROM_REGION( 0x80000, "oki1", 0 ) /* ADPCM Samples */ - ROM_LOAD( "sb2-snd-4.u17", 0x00000, 0x80000, CRC(638f341e) SHA1(aa3fca25f099339ece1878ea730c5e9f18ec4823) ) - - ROM_REGION( 0x8000, "user1", 0 ) /* ??? Some sort of table - same as other bootleg boards */ - ROM_LOAD( "sb2-unk.u100", 0x0000, 0x8000, CRC(456dd16e) SHA1(84779ee64d3ea33ba1ba4dee39b504a81c6811a1) ) -ROM_END - -ROM_START( snowbro2b2 ) // seems to mostly be the same data, but with copyright changed to Q Elec. Only set with staff credits still present. Also differently arranged graphics ROMs data. - ROM_REGION( 0x080000, "maincpu", 0 ) /* Main 68K code */ - ROM_LOAD16_WORD_SWAP( "rom10.bin", 0x000000, 0x080000, CRC(3e96da41) SHA1(692211d40f506efb9cb49848521de2da7890e248) ) // 27c04002 - - ROM_REGION( 0x300000, "gp9001_0", 0 ) - ROM_LOAD16_BYTE( "rom07.bin", 0x000000, 0x080000, CRC(c54ae0b3) SHA1(94099b2da52eb12638799eab0819fe8a13aa3879) ) // 27c040 - ROM_LOAD16_BYTE( "rom05.bin", 0x000001, 0x080000, CRC(af3c74d1) SHA1(e97a688db50dfe41723452a9f652564e89e367ed) ) // 27c040 - ROM_LOAD16_BYTE( "rom08.bin", 0x100000, 0x040000, CRC(72812088) SHA1(1c0d410a7dd8de0bc48b7ff677979ad269966f7d) ) // 27c02001 - ROM_LOAD16_BYTE( "rom06.bin", 0x100001, 0x040000, CRC(c8f80774) SHA1(004752d7dfa08c3beb774f545fe3260d328abff0) ) // 27c02001 - ROM_LOAD16_BYTE( "rom03.bin", 0x180000, 0x080000, CRC(42fecbd7) SHA1(96dc9d5495d7830400ca7475c6613119099e93f2) ) // 27c040 - ROM_LOAD16_BYTE( "rom01.bin", 0x180001, 0x080000, CRC(e7134937) SHA1(7c12e7c6b08f804613e5ea0db8d622bda01bc036) ) // 27c040 - ROM_LOAD16_BYTE( "rom04.bin", 0x280000, 0x040000, CRC(3343b7a7) SHA1(10efcb2dfae635f005773655faa573bf51ddc6a3) ) // 27c020 - ROM_LOAD16_BYTE( "rom02.bin", 0x280001, 0x040000, CRC(af4d9551) SHA1(adcf1641e37b239b1ae4322b5710d49e53c30684) ) // 27c020 - - ROM_REGION( 0x80000, "oki1", 0 ) /* ADPCM Samples */ - ROM_LOAD( "rom09.bin", 0x00000, 0x80000, CRC(638f341e) SHA1(aa3fca25f099339ece1878ea730c5e9f18ec4823) ) -ROM_END - -ROM_START( snowbro2b3 ) // SK000616 PCB, no original parts, seems hardcoded on Europe region - ROM_REGION( 0x080000, "maincpu", 0 ) - ROM_LOAD16_WORD_SWAP( "prg", 0x000000, 0x080000, CRC(8ce2ede2) SHA1(ddd8a2aa442cd5bb3a7d393b9b5c06fd981e7c61) ) - - ROM_REGION( 0x400000, "gp9001_0", 0 ) // not actually a GP9001 - ROM_LOAD( "gfx2", 0x100000, 0x100000, CRC(a3be41af) SHA1(4cb1ce9c47bf8bbf7d1e36f6a1d276ce52957cfb) ) - ROM_CONTINUE( 0x000000, 0x100000 ) - ROM_LOAD( "gfx1", 0x300000, 0x100000, CRC(8df1ab06) SHA1(2a28caf7d545dc05acfcd2a8d2ffbd9f710af45d) ) - ROM_CONTINUE( 0x200000, 0x100000 ) - - ROM_REGION( 0x80000, "oki1", 0 ) - ROM_LOAD( "voice", 0x00000, 0x80000, CRC(638f341e) SHA1(aa3fca25f099339ece1878ea730c5e9f18ec4823) ) -ROM_END - -ROM_START( snowbro2ny ) // Nyanko - ROM_REGION( 0x080000, "maincpu", 0 ) /* Main 68K code */ - ROM_LOAD16_WORD_SWAP( "rom1_c8.u61", 0x000000, 0x080000, CRC(9e6eb76b) SHA1(9e8b356dabedeb4ae9e08d60fbf6ed4a09edc0bd) ) - - ROM_REGION( 0x300000, "gp9001_0", 0 ) - ROM_LOAD( "rom2-l_tp-033.u13", 0x000000, 0x100000, CRC(e9d366a9) SHA1(e87e3966fce3395324b90db6c134b3345104c04b) ) - ROM_LOAD( "rom2-h_c10.u26", 0x100000, 0x080000, CRC(9aab7a62) SHA1(611f6a15fdbac5d3063426a365538c1482e996bf) ) - ROM_LOAD( "rom3-l_tp-033.u12", 0x180000, 0x100000, CRC(eb06e332) SHA1(7cd597bfffc153d178530c0f0903bebd751c9dd1) ) - ROM_LOAD( "rom3-h_c9.u27", 0x280000, 0x080000, CRC(6de2b059) SHA1(695e789849c34de5d83e40b0e834b2106fcd78db) ) - - ROM_REGION( 0x80000, "oki1", 0 ) /* ADPCM Samples */ - ROM_LOAD( "rom4-tp-033.u33", 0x00000, 0x80000, CRC(638f341e) SHA1(aa3fca25f099339ece1878ea730c5e9f18ec4823) ) - - ROM_REGION( 0x345, "plds", 0 ) - ROM_LOAD( "13_gal16v8-25lnc.u91", 0x000, 0x117, NO_DUMP ) // Protected - ROM_LOAD( "14_gal16v8-25lnc.u92", 0x117, 0x117, NO_DUMP ) // Protected - ROM_LOAD( "15_gal16v8-25lnc.u93", 0x22e, 0x117, NO_DUMP ) // Protected -ROM_END - -/* -------------------------- Raizing games ------------------------- */ - - -/* -For the two sets of Sorcer Striker (World) the only differences -are 2 bytes plus a corrected checksum for each set: - -File Offset sstriker sstrikera - 0x160 17 0B <-- Rom checksum value - 0x161 79 6D <-- Rom checksum value - - 0x92C 18 0C <-- Index of copyright strings to display for Korea - 0x92D 18 0C <-- Index of copyright strings to display for Korea - -0C points to the strings "LICENSED TO UNITE TRADING" / "FOR KOREA". -18 points to a pair of empty strings. - -Printed labels for the eproms look like: - -RA-MA-01 - 01 -RAIZING - -Both English and Japanese sets use the same labels and numbers for the roms -even if the roms contain different code / data. -*/ - -ROM_START( sstriker ) - ROM_REGION( 0x080000, "maincpu", 0 ) /* Main 68K code */ - ROM_LOAD16_WORD_SWAP( "ra-ma_01_01.u65", 0x000000, 0x080000, CRC(708fd51d) SHA1(167186d4cf13af37ec0fa6a59c738c54dbbf3c7c) ) - - ROM_REGION( 0x10000, "audiocpu", 0 ) /* Sound Z80 code */ - ROM_LOAD( "ra-ma-01_02.u66", 0x00000, 0x10000, CRC(eabfa46d) SHA1(402c99ebf88f9025f74f0a28ced22b7882a65eb3) ) - - ROM_REGION( 0x200000, "gp9001_0", 0 ) - ROM_LOAD( "ra-ma01-rom2.u2", 0x000000, 0x100000, CRC(54e2bd95) SHA1(341359dd46152615675bb90e8a184216c8feebff) ) - ROM_LOAD( "ra-ma01-rom3.u1", 0x100000, 0x100000, CRC(21cd378f) SHA1(e1695bccec949d18b1c03e9c42dca384554b0d7c) ) - - ROM_REGION( 0x008000, "text", 0 ) - ROM_LOAD( "ra-ma-01_05.u81", 0x000000, 0x008000, CRC(88b58841) SHA1(1d16b538c11a291bd1f46a510bfbd6259b45a0b5) ) - - ROM_REGION( 0x40000, "oki1", 0 ) /* ADPCM Samples */ - ROM_LOAD( "ra-ma01-rom1.u57", 0x00000, 0x40000, CRC(6edb2ab8) SHA1(e3032e8eda2686f30df4b7a088c5a4d4d45782ed) ) -ROM_END - - -ROM_START( sstrikerk ) - ROM_REGION( 0x080000, "maincpu", 0 ) /* Main 68K code */ - ROM_LOAD16_WORD_SWAP( "ra-ma-01_01.u65", 0x000000, 0x080000, CRC(92259f84) SHA1(127e62e407d95efd360bfe2cac9577f326abf6ef) ) - - ROM_REGION( 0x10000, "audiocpu", 0 ) /* Sound Z80 code */ - ROM_LOAD( "ra-ma-01_02.u66", 0x00000, 0x10000, CRC(eabfa46d) SHA1(402c99ebf88f9025f74f0a28ced22b7882a65eb3) ) - - ROM_REGION( 0x200000, "gp9001_0", 0 ) - ROM_LOAD( "ra-ma01-rom2.u2", 0x000000, 0x100000, CRC(54e2bd95) SHA1(341359dd46152615675bb90e8a184216c8feebff) ) - ROM_LOAD( "ra-ma01-rom3.u1", 0x100000, 0x100000, CRC(21cd378f) SHA1(e1695bccec949d18b1c03e9c42dca384554b0d7c) ) - // also seen with 4 smaller ROMs instead of 2 - // 01.bin ra-ma01-rom2.u2 [even] IDENTICAL - // 02.bin ra-ma01-rom2.u2 [odd] IDENTICAL - // 03.bin ra-ma01-rom3.u1 [even] IDENTICAL - // 04.bin ra-ma01-rom3.u1 [odd] IDENTICAL - - ROM_REGION( 0x008000, "text", 0 ) - ROM_LOAD( "ra-ma-01_05.u81", 0x000000, 0x008000, CRC(88b58841) SHA1(1d16b538c11a291bd1f46a510bfbd6259b45a0b5) ) - - ROM_REGION( 0x40000, "oki1", 0 ) /* ADPCM Samples */ - ROM_LOAD( "ra-ma01-rom1.u57", 0x00000, 0x40000, CRC(6edb2ab8) SHA1(e3032e8eda2686f30df4b7a088c5a4d4d45782ed) ) -ROM_END - - -ROM_START( mahoudai ) - ROM_REGION( 0x080000, "maincpu", 0 ) /* Main 68K code */ - ROM_LOAD16_WORD_SWAP( "ra_ma_01_01.u65", 0x000000, 0x080000, CRC(970ccc5c) SHA1(c87cab83bde0284e631f02e50068407fee81d941) ) - - ROM_REGION( 0x10000, "audiocpu", 0 ) /* Sound Z80 code */ - ROM_LOAD( "ra-ma-01_02.u66", 0x00000, 0x10000, CRC(eabfa46d) SHA1(402c99ebf88f9025f74f0a28ced22b7882a65eb3) ) - - ROM_REGION( 0x200000, "gp9001_0", 0 ) - ROM_LOAD( "ra-ma01-rom2.u2", 0x000000, 0x100000, CRC(54e2bd95) SHA1(341359dd46152615675bb90e8a184216c8feebff) ) - ROM_LOAD( "ra-ma01-rom3.u1", 0x100000, 0x100000, CRC(21cd378f) SHA1(e1695bccec949d18b1c03e9c42dca384554b0d7c) ) - - ROM_REGION( 0x008000, "text", 0 ) - ROM_LOAD( "ra_ma_01_05.u81", 0x000000, 0x008000, CRC(c00d1e80) SHA1(53e64c4c0c6309130b37597d13b44a9e95b717d8) ) - - ROM_REGION( 0x40000, "oki1", 0 ) /* ADPCM Samples */ - ROM_LOAD( "ra-ma01-rom1.u57", 0x00000, 0x40000, CRC(6edb2ab8) SHA1(e3032e8eda2686f30df4b7a088c5a4d4d45782ed) ) -ROM_END - - -ROM_START( kingdmgp ) - ROM_REGION( 0x100000, "maincpu", 0 ) /* Main 68K code */ - ROM_LOAD16_BYTE( "ma02rom1.bin", 0x000000, 0x080000, CRC(a678b149) SHA1(8c1a631e023dbba0a3fa6cd1b7d10dec1663213a) ) - ROM_LOAD16_BYTE( "ma02rom0.bin", 0x000001, 0x080000, CRC(f226a212) SHA1(526acf3d05fdc88054a772fbea3de2af532bf3d2) ) - - ROM_REGION( 0x10000, "audiocpu", 0 ) /* Sound Z80 code */ - ROM_LOAD( "ma02rom2.bin", 0x00000, 0x10000, CRC(dde8a57e) SHA1(f522a3f17e229c71512464349760a9e27778bf6a) ) - - ROM_REGION( 0x400000, "gp9001_0", 0 ) - ROM_LOAD( "ma02rom3.bin", 0x000000, 0x200000, CRC(0e797142) SHA1(a480ccd151e49b886d3175a6deff56e1f2c26c3e) ) - ROM_LOAD( "ma02rom4.bin", 0x200000, 0x200000, CRC(72a6fa53) SHA1(ce92e65205b84361cfb90305a61e9541b5c4dc2f) ) - - ROM_REGION( 0x008000, "text", 0 ) - ROM_LOAD( "ma02rom5.eng", 0x000000, 0x008000, CRC(8c28460b) SHA1(0aed170762f6044896a7e608df60bbd37c583a71) ) - - ROM_REGION( 0x80000, "oki1", 0 ) /* ADPCM Samples */ - ROM_LOAD( "ma02rom6.bin", 0x00000, 0x80000, CRC(199e7cae) SHA1(0f5e13cc8ec42c80bb4bbff90aba29cdb15213d4) ) -ROM_END - - -ROM_START( shippumd ) - ROM_REGION( 0x100000, "maincpu", 0 ) /* Main 68K code */ - ROM_LOAD16_BYTE( "ma02rom1.bin", 0x000000, 0x080000, CRC(a678b149) SHA1(8c1a631e023dbba0a3fa6cd1b7d10dec1663213a) ) - ROM_LOAD16_BYTE( "ma02rom0.bin", 0x000001, 0x080000, CRC(f226a212) SHA1(526acf3d05fdc88054a772fbea3de2af532bf3d2) ) - - ROM_REGION( 0x10000, "audiocpu", 0 ) /* Sound Z80 code */ - ROM_LOAD( "ma02rom2.bin", 0x00000, 0x10000, CRC(dde8a57e) SHA1(f522a3f17e229c71512464349760a9e27778bf6a) ) - - ROM_REGION( 0x400000, "gp9001_0", 0 ) - ROM_LOAD( "ma02rom3.bin", 0x000000, 0x200000, CRC(0e797142) SHA1(a480ccd151e49b886d3175a6deff56e1f2c26c3e) ) - ROM_LOAD( "ma02rom4.bin", 0x200000, 0x200000, CRC(72a6fa53) SHA1(ce92e65205b84361cfb90305a61e9541b5c4dc2f) ) - - ROM_REGION( 0x008000, "text", 0 ) - ROM_LOAD( "ma02rom5.bin", 0x000000, 0x008000, CRC(116ae559) SHA1(4cc2d2a23cc0aefd457111b7990e47184e79204c) ) - - ROM_REGION( 0x80000, "oki1", 0 ) /* ADPCM Samples */ - ROM_LOAD( "ma02rom6.bin", 0x00000, 0x80000, CRC(199e7cae) SHA1(0f5e13cc8ec42c80bb4bbff90aba29cdb15213d4) ) -ROM_END - -ROM_START( bgareggat ) - /* Dumped from a location test board, with some minor changes compared to the final. - * All ROMs are socketed - * All PAL/GALs are socketed - * PLDs at U33, U125 are PALCE16V8H/4 instead of GAL16V8B as usual (no functional impact) - * JP4 features four DIP switches, instead of two DIPs + two jumpers as in the final. - - The date codes are written referencing Heisei year 8 (1996). - - The program ROMs feature hand-written labels formatted like this: - BATTLE GAREGGA - PRG 0 - 8.1.17. - */ - ROM_REGION( 0x100000, "maincpu", 0 ) /* Main 68K code */ - ROM_LOAD16_BYTE( "battlegaregga-prg0-8-1-17.bin", 0x000000, 0x080000, CRC(c032176f) SHA1(799ba0424489361dd2f814afaf841326bc23300c) ) - ROM_LOAD16_BYTE( "battlegaregga-prg1-8-1-17.bin", 0x000001, 0x080000, CRC(3822f375) SHA1(a5a84cf48c86d8ac97f401280667658d7f451896) ) - - /* Hand-written label that reads - BATTLE GAREGGA - SND - 8.1.18. ロケVer. - */ - ROM_REGION( 0x20000, "audiocpu", 0 ) /* Sound Z80 code + bank */ - ROM_LOAD( "battlegaregga-snd-8-1-18-loke-ver.bin", 0x00000, 0x20000, CRC(f5ea56f7) SHA1(9db04069b378dbad6626fd29d3762e3361b9aa0d) ) - - /* Stored on NEC ES23C16000W Mask ROMs with no Raizing/8ing custom markings.*/ - ROM_REGION( 0x800000, "gp9001_0", 0 ) - ROM_LOAD( "rom4.bin", 0x000000, 0x200000, CRC(b333d81f) SHA1(5481465f1304334fd55798be2f44324c57c2dbcb) ) - ROM_LOAD( "rom3.bin", 0x200000, 0x200000, CRC(51b9ebfb) SHA1(30e0c326f5175aa436df8dba08f6f4e08130b92f) ) - ROM_LOAD( "rom2.bin", 0x400000, 0x200000, CRC(b330e5e2) SHA1(5d48e9d56f99d093b6390e0af1609fd796df2d35) ) - ROM_LOAD( "rom1.bin", 0x600000, 0x200000, CRC(7eafdd70) SHA1(7c8da8e86c3f9491719b1d7d5d285568d7614f38) ) - - /* Hand-written label that reads - BATTLE GAREGGA - TEXT - 8.1.17. 8AA6 - - 8AA6 is the checksum of the text ROM, which matches release. - */ - ROM_REGION( 0x008000, "text", 0 ) - ROM_LOAD( "text.u81", 0x00000, 0x08000, CRC(e67fd534) SHA1(987d0edffc2c243a13d4567319ea3d185eaadbf8) ) - - /* Stored on an NEC ES23C8001EJ Mask ROM with no Raizing/8ing custom markings.*/ - ROM_REGION( 0x100000, "oki1", 0 ) /* ADPCM Samples */ - ROM_LOAD( "rom5.bin", 0x000000, 0x100000, CRC(f6d49863) SHA1(3a3c354852adad06e8a051511abfab7606bce382) ) -ROM_END - -ROM_START( bgaregga ) - ROM_REGION( 0x100000, "maincpu", 0 ) /* Main 68K code */ - ROM_LOAD16_BYTE( "prg0.bin", 0x000000, 0x080000, CRC(f80c2fc2) SHA1(a9aac5c7f5439b6fe8d1b3db1fb02a27cc28fdf6) ) - ROM_LOAD16_BYTE( "prg1.bin", 0x000001, 0x080000, CRC(2ccfdd1e) SHA1(7a9f11f851854f3f8389b9c3c0906ebb8dc28712) ) - - ROM_REGION( 0x20000, "audiocpu", 0 ) /* Sound Z80 code + bank */ - ROM_LOAD( "snd.bin", 0x00000, 0x20000, CRC(68632952) SHA1(fb834db83157948e2b420b6051102a9c6ac3969b) ) - - ROM_REGION( 0x800000, "gp9001_0", 0 ) - ROM_LOAD( "rom4.bin", 0x000000, 0x200000, CRC(b333d81f) SHA1(5481465f1304334fd55798be2f44324c57c2dbcb) ) - ROM_LOAD( "rom3.bin", 0x200000, 0x200000, CRC(51b9ebfb) SHA1(30e0c326f5175aa436df8dba08f6f4e08130b92f) ) - ROM_LOAD( "rom2.bin", 0x400000, 0x200000, CRC(b330e5e2) SHA1(5d48e9d56f99d093b6390e0af1609fd796df2d35) ) - ROM_LOAD( "rom1.bin", 0x600000, 0x200000, CRC(7eafdd70) SHA1(7c8da8e86c3f9491719b1d7d5d285568d7614f38) ) - - ROM_REGION( 0x008000, "text", 0 ) - ROM_LOAD( "text.u81", 0x00000, 0x08000, CRC(e67fd534) SHA1(987d0edffc2c243a13d4567319ea3d185eaadbf8) ) - - ROM_REGION( 0x100000, "oki1", 0 ) /* ADPCM Samples */ - ROM_LOAD( "rom5.bin", 0x000000, 0x100000, CRC(f6d49863) SHA1(3a3c354852adad06e8a051511abfab7606bce382) ) -ROM_END - - -ROM_START( bgareggahk ) - ROM_REGION( 0x100000, "maincpu", 0 ) /* Main 68K code */ - ROM_LOAD16_BYTE( "prg_0.rom", 0x000000, 0x080000, CRC(26e0019e) SHA1(5197001f5d59246b137e19ed1952a8207b25d4c0) ) - ROM_LOAD16_BYTE( "prg_1.rom", 0x000001, 0x080000, CRC(2ccfdd1e) SHA1(7a9f11f851854f3f8389b9c3c0906ebb8dc28712) ) - - ROM_REGION( 0x20000, "audiocpu", 0 ) /* Sound Z80 code + bank */ - ROM_LOAD( "snd.bin", 0x00000, 0x20000, CRC(68632952) SHA1(fb834db83157948e2b420b6051102a9c6ac3969b) ) - - ROM_REGION( 0x800000, "gp9001_0", 0 ) - ROM_LOAD( "rom4.bin", 0x000000, 0x200000, CRC(b333d81f) SHA1(5481465f1304334fd55798be2f44324c57c2dbcb) ) - ROM_LOAD( "rom3.bin", 0x200000, 0x200000, CRC(51b9ebfb) SHA1(30e0c326f5175aa436df8dba08f6f4e08130b92f) ) - ROM_LOAD( "rom2.bin", 0x400000, 0x200000, CRC(b330e5e2) SHA1(5d48e9d56f99d093b6390e0af1609fd796df2d35) ) - ROM_LOAD( "rom1.bin", 0x600000, 0x200000, CRC(7eafdd70) SHA1(7c8da8e86c3f9491719b1d7d5d285568d7614f38) ) - - ROM_REGION( 0x008000, "text", 0 ) - ROM_LOAD( "text.u81", 0x00000, 0x08000, CRC(e67fd534) SHA1(987d0edffc2c243a13d4567319ea3d185eaadbf8) ) - - ROM_REGION( 0x100000, "oki1", 0 ) /* ADPCM Samples */ - ROM_LOAD( "rom5.bin", 0x000000, 0x100000, CRC(f6d49863) SHA1(3a3c354852adad06e8a051511abfab7606bce382) ) -ROM_END - - -ROM_START( bgareggatw ) - ROM_REGION( 0x100000, "maincpu", 0 ) /* Main 68K code */ - ROM_LOAD16_BYTE( "garegga_prg0.u123", 0x000000, 0x080000, CRC(235b7405) SHA1(a2434801df4231a6b48f6c63f47c202d25a89e79) ) - ROM_LOAD16_BYTE( "garegga_prg1.u65", 0x000001, 0x080000, CRC(c29ccf6a) SHA1(38806e0b4ff852f4bfefd80c56ca23f71623e275) ) - - ROM_REGION( 0x20000, "audiocpu", 0 ) /* Sound Z80 code + bank */ - ROM_LOAD( "snd.bin", 0x00000, 0x20000, CRC(68632952) SHA1(fb834db83157948e2b420b6051102a9c6ac3969b) ) - - ROM_REGION( 0x800000, "gp9001_0", 0 ) - ROM_LOAD( "rom4.bin", 0x000000, 0x200000, CRC(b333d81f) SHA1(5481465f1304334fd55798be2f44324c57c2dbcb) ) - ROM_LOAD( "rom3.bin", 0x200000, 0x200000, CRC(51b9ebfb) SHA1(30e0c326f5175aa436df8dba08f6f4e08130b92f) ) - ROM_LOAD( "rom2.bin", 0x400000, 0x200000, CRC(b330e5e2) SHA1(5d48e9d56f99d093b6390e0af1609fd796df2d35) ) - ROM_LOAD( "rom1.bin", 0x600000, 0x200000, CRC(7eafdd70) SHA1(7c8da8e86c3f9491719b1d7d5d285568d7614f38) ) - - ROM_REGION( 0x008000, "text", 0 ) - ROM_LOAD( "text.u81", 0x00000, 0x08000, CRC(e67fd534) SHA1(987d0edffc2c243a13d4567319ea3d185eaadbf8) ) - - ROM_REGION( 0x100000, "oki1", 0 ) /* ADPCM Samples */ - ROM_LOAD( "rom5.bin", 0x000000, 0x100000, CRC(f6d49863) SHA1(3a3c354852adad06e8a051511abfab7606bce382) ) -ROM_END - - -// only the program ROMs' dumps were provided for this set. -// According to the dumper: 'In the Korea Region Setting, DIP SWITCH's 'STAGE EDIT' does not work and -// the C button (formation change) function in the in-game is also deleted.' -ROM_START( bgareggak ) - ROM_REGION( 0x100000, "maincpu", 0 ) // Main 68K code - ROM_LOAD16_BYTE( "prg0.bin", 0x000000, 0x080000, CRC(40a108a7) SHA1(cc3227dc87ffefb961dbcdff146e787dbfbdfc2c) ) - ROM_LOAD16_BYTE( "prg1.bin", 0x000001, 0x080000, CRC(45a6e48a) SHA1(f4d4158b8556b4261291ba9905b9731623b47e54) ) - - ROM_REGION( 0x20000, "audiocpu", 0 ) // Sound Z80 code + bank - ROM_LOAD( "snd.bin", 0x00000, 0x20000, BAD_DUMP CRC(68632952) SHA1(fb834db83157948e2b420b6051102a9c6ac3969b) ) - - ROM_REGION( 0x800000, "gp9001_0", 0 ) - ROM_LOAD( "rom4.bin", 0x000000, 0x200000, BAD_DUMP CRC(b333d81f) SHA1(5481465f1304334fd55798be2f44324c57c2dbcb) ) - ROM_LOAD( "rom3.bin", 0x200000, 0x200000, BAD_DUMP CRC(51b9ebfb) SHA1(30e0c326f5175aa436df8dba08f6f4e08130b92f) ) - ROM_LOAD( "rom2.bin", 0x400000, 0x200000, BAD_DUMP CRC(b330e5e2) SHA1(5d48e9d56f99d093b6390e0af1609fd796df2d35) ) - ROM_LOAD( "rom1.bin", 0x600000, 0x200000, BAD_DUMP CRC(7eafdd70) SHA1(7c8da8e86c3f9491719b1d7d5d285568d7614f38) ) - - ROM_REGION( 0x008000, "text", 0 ) - ROM_LOAD( "text.u81", 0x00000, 0x08000, BAD_DUMP CRC(e67fd534) SHA1(987d0edffc2c243a13d4567319ea3d185eaadbf8) ) - - ROM_REGION( 0x100000, "oki1", 0 ) // ADPCM Samples - ROM_LOAD( "rom5.bin", 0x000000, 0x100000, BAD_DUMP CRC(f6d49863) SHA1(3a3c354852adad06e8a051511abfab7606bce382) ) -ROM_END - - -ROM_START( bgaregganv ) - ROM_REGION( 0x100000, "maincpu", 0 ) /* Main 68K code */ - ROM_LOAD16_BYTE( "prg_0.bin", 0x000000, 0x080000, CRC(951ecc07) SHA1(a82e4b59e4a974566e59f3ab2fbae1aec7d88a2b) ) - ROM_LOAD16_BYTE( "prg_1.bin", 0x000001, 0x080000, CRC(729a60c6) SHA1(cb6f5d138bb82c32910f42d8ee16fa573a23cef3) ) - - ROM_REGION( 0x20000, "audiocpu", 0 ) /* Sound Z80 code + bank */ - ROM_LOAD( "snd.bin", 0x00000, 0x20000, CRC(68632952) SHA1(fb834db83157948e2b420b6051102a9c6ac3969b) ) - - ROM_REGION( 0x800000, "gp9001_0", 0 ) - ROM_LOAD( "rom4.bin", 0x000000, 0x200000, CRC(b333d81f) SHA1(5481465f1304334fd55798be2f44324c57c2dbcb) ) - ROM_LOAD( "rom3.bin", 0x200000, 0x200000, CRC(51b9ebfb) SHA1(30e0c326f5175aa436df8dba08f6f4e08130b92f) ) - ROM_LOAD( "rom2.bin", 0x400000, 0x200000, CRC(b330e5e2) SHA1(5d48e9d56f99d093b6390e0af1609fd796df2d35) ) - ROM_LOAD( "rom1.bin", 0x600000, 0x200000, CRC(7eafdd70) SHA1(7c8da8e86c3f9491719b1d7d5d285568d7614f38) ) - - ROM_REGION( 0x008000, "text", 0 ) - ROM_LOAD( "text.u81", 0x00000, 0x08000, CRC(e67fd534) SHA1(987d0edffc2c243a13d4567319ea3d185eaadbf8) ) - - ROM_REGION( 0x100000, "oki1", 0 ) /* ADPCM Samples */ - ROM_LOAD( "rom5.bin", 0x000000, 0x100000, CRC(f6d49863) SHA1(3a3c354852adad06e8a051511abfab7606bce382) ) -ROM_END - - -ROM_START( bgareggat2 ) - ROM_REGION( 0x100000, "maincpu", 0 ) /* Main 68K code */ - ROM_LOAD16_BYTE( "prg0", 0x000000, 0x080000, CRC(84094099) SHA1(49fc68a8bcdae4477e20eade9dd569de88b0b798) ) - ROM_LOAD16_BYTE( "prg1", 0x000001, 0x080000, CRC(46f92fe4) SHA1(62a02cc1dbdc3ac362339aebb62368eb89b06bad) ) - - ROM_REGION( 0x20000, "audiocpu", 0 ) /* Sound Z80 code + bank */ - ROM_LOAD( "snd.bin", 0x00000, 0x20000, CRC(68632952) SHA1(fb834db83157948e2b420b6051102a9c6ac3969b) ) - - ROM_REGION( 0x800000, "gp9001_0", 0 ) - ROM_LOAD( "rom4.bin", 0x000000, 0x200000, CRC(b333d81f) SHA1(5481465f1304334fd55798be2f44324c57c2dbcb) ) - ROM_LOAD( "rom3.bin", 0x200000, 0x200000, CRC(51b9ebfb) SHA1(30e0c326f5175aa436df8dba08f6f4e08130b92f) ) - ROM_LOAD( "rom2.bin", 0x400000, 0x200000, CRC(b330e5e2) SHA1(5d48e9d56f99d093b6390e0af1609fd796df2d35) ) - ROM_LOAD( "rom1.bin", 0x600000, 0x200000, CRC(7eafdd70) SHA1(7c8da8e86c3f9491719b1d7d5d285568d7614f38) ) - - ROM_REGION( 0x008000, "text", 0 ) - ROM_LOAD( "text.u81", 0x00000, 0x08000, CRC(e67fd534) SHA1(987d0edffc2c243a13d4567319ea3d185eaadbf8) ) - - ROM_REGION( 0x100000, "oki1", 0 ) /* ADPCM Samples */ - ROM_LOAD( "rom5.bin", 0x000000, 0x100000, CRC(f6d49863) SHA1(3a3c354852adad06e8a051511abfab7606bce382) ) -ROM_END - - -ROM_START( bgareggacn ) - ROM_REGION( 0x100000, "maincpu", 0 ) /* Main 68K code */ - ROM_LOAD16_BYTE( "u123", 0x000000, 0x080000, CRC(88a4e66a) SHA1(ca97e564eed0c5e028b937312e55da56400d5c8c) ) - ROM_LOAD16_BYTE( "u65", 0x000001, 0x080000, CRC(5dea32a3) SHA1(59df6689e3eb5ea9e49a758604d21a64c65ca14d) ) - - ROM_REGION( 0x20000, "audiocpu", 0 ) /* Sound Z80 code + bank */ - ROM_LOAD( "snd.bin", 0x00000, 0x20000, CRC(68632952) SHA1(fb834db83157948e2b420b6051102a9c6ac3969b) ) - - ROM_REGION( 0x800000, "gp9001_0", 0 ) - ROM_LOAD( "rom4.bin", 0x000000, 0x200000, CRC(b333d81f) SHA1(5481465f1304334fd55798be2f44324c57c2dbcb) ) - ROM_LOAD( "rom3.bin", 0x200000, 0x200000, CRC(51b9ebfb) SHA1(30e0c326f5175aa436df8dba08f6f4e08130b92f) ) - ROM_LOAD( "rom2.bin", 0x400000, 0x200000, CRC(b330e5e2) SHA1(5d48e9d56f99d093b6390e0af1609fd796df2d35) ) - ROM_LOAD( "rom1.bin", 0x600000, 0x200000, CRC(7eafdd70) SHA1(7c8da8e86c3f9491719b1d7d5d285568d7614f38) ) - - ROM_REGION( 0x008000, "text", 0 ) - ROM_LOAD( "text.u81", 0x00000, 0x08000, CRC(e67fd534) SHA1(987d0edffc2c243a13d4567319ea3d185eaadbf8) ) - - ROM_REGION( 0x100000, "oki1", 0 ) /* ADPCM Samples */ - ROM_LOAD( "rom5.bin", 0x000000, 0x100000, CRC(f6d49863) SHA1(3a3c354852adad06e8a051511abfab7606bce382) ) -ROM_END - -// 1945二代 (1945 Èr Dài) -ROM_START( bgareggabl ) - ROM_REGION( 0x100000, "maincpu", 0 ) /* Main 68K code */ - ROM_LOAD16_WORD_SWAP( "xt-8m.bin", 0x000000, 0x100000, CRC(4a6657cb) SHA1(1838956e7597eaa78ea5ee58d0ccc79cbbd7ded5) ) - - ROM_REGION( 0x20000, "audiocpu", 0 ) /* Sound Z80 code + bank */ - ROM_LOAD( "snd.bin", 0x00000, 0x20000, CRC(68632952) SHA1(fb834db83157948e2b420b6051102a9c6ac3969b) ) - - ROM_REGION( 0x800000, "gp9001_0", 0 ) - ROM_LOAD( "6@-322", 0x000000, 0x400000, CRC(37fe48ed) SHA1(ded5d13c33b4582310cdfb3dd52c052f741c00c5) ) /* == rom4.bin+rom3.bin */ - ROM_LOAD( "5@-322", 0x400000, 0x400000, CRC(5a06c031) SHA1(ee241ff90117cec1f33ab163601a9d5c75609739) ) /* == rom2.bin+rom1.bin */ - - ROM_REGION( 0x008000, "text", 0 ) - ROM_LOAD( "1@-256", 0x00000, 0x08000, CRC(760dcd14) SHA1(e151e5d7ca5557277f306b9484ec021f4edf1e07) ) - - ROM_REGION( 0x010000, "user1", 0 ) // not graphics - ROM_LOAD( "2@-256", 0x00000, 0x08000, CRC(456dd16e) SHA1(84779ee64d3ea33ba1ba4dee39b504a81c6811a1) ) - - ROM_REGION( 0x100000, "oki1", 0 ) /* ADPCM Samples */ - ROM_LOAD( "rom5.bin", 0x000000, 0x100000, CRC(f6d49863) SHA1(3a3c354852adad06e8a051511abfab7606bce382) ) -ROM_END - -// 雷神传 (Léishén Chuán) -ROM_START( bgareggabla ) - ROM_REGION( 0x100000, "maincpu", 0 ) /* Main 68K code */ - ROM_LOAD16_WORD_SWAP( "27c8100.mon-sys", 0x000000, 0x100000, CRC(d334e5aa) SHA1(41607b5630d7b92a96607ea95c5b55ad43745857) ) - - ROM_REGION( 0x20000, "audiocpu", 0 ) /* Sound Z80 code + bank */ - ROM_LOAD( "snd.bin", 0x00000, 0x20000, CRC(68632952) SHA1(fb834db83157948e2b420b6051102a9c6ac3969b) ) - - ROM_REGION( 0x800000, "gp9001_0", 0 ) - ROM_LOAD( "rom4.bin", 0x000000, 0x200000, CRC(b333d81f) SHA1(5481465f1304334fd55798be2f44324c57c2dbcb) ) - ROM_LOAD( "rom3.bin", 0x200000, 0x200000, CRC(51b9ebfb) SHA1(30e0c326f5175aa436df8dba08f6f4e08130b92f) ) - ROM_LOAD( "rom2.bin", 0x400000, 0x200000, CRC(b330e5e2) SHA1(5d48e9d56f99d093b6390e0af1609fd796df2d35) ) - ROM_LOAD( "rom1.bin", 0x600000, 0x200000, CRC(7eafdd70) SHA1(7c8da8e86c3f9491719b1d7d5d285568d7614f38) ) - - ROM_REGION( 0x008000, "text", 0 ) - ROM_LOAD( "text.bin", 0x00000, 0x08000, CRC(00d100bd) SHA1(fb6028e3519d6588a966d1b16d47453db2e51fd7)) - - ROM_REGION( 0x010000, "user1", 0 ) // not graphics - ROM_LOAD( "base.bin", 0x00000, 0x08000, CRC(456dd16e) SHA1(84779ee64d3ea33ba1ba4dee39b504a81c6811a1) ) - - ROM_REGION( 0x100000, "oki1", 0 ) /* ADPCM Samples */ - ROM_LOAD( "rom5.bin", 0x000000, 0x100000, CRC(f6d49863) SHA1(3a3c354852adad06e8a051511abfab7606bce382) ) -ROM_END - -ROM_START( bgareggablj ) // fixed on Japanese region - ROM_REGION( 0x100000, "maincpu", 0 ) // Main 68K code - ROM_LOAD16_WORD_SWAP( "sys.bin", 0x000000, 0x100000, CRC(b2a1225f) SHA1(dda00aa5e7ce3f39bb0eebbcd9500ef22a5d74d3) ) // 1ST AND 2ND HALF IDENTICAL - ROM_IGNORE( 0x100000 ) - - ROM_REGION( 0x20000, "audiocpu", 0 ) // Sound Z80 code + bank - ROM_LOAD( "snd.bin", 0x00000, 0x20000, CRC(68632952) SHA1(fb834db83157948e2b420b6051102a9c6ac3969b) ) - - ROM_REGION( 0x800000, "gp9001_0", 0 ) - ROM_LOAD( "322_2.bin", 0x000000, 0x400000, CRC(37fe48ed) SHA1(ded5d13c33b4582310cdfb3dd52c052f741c00c5) ) // == rom4.bin+rom3.bin - ROM_LOAD( "322_1.bin", 0x400000, 0x400000, CRC(5a06c031) SHA1(ee241ff90117cec1f33ab163601a9d5c75609739) ) // == rom2.bin+rom1.bin - - ROM_REGION( 0x008000, "text", 0 ) - ROM_LOAD( "text.bin", 0x00000, 0x08000, CRC(e67fd534) SHA1(987d0edffc2c243a13d4567319ea3d185eaadbf8) ) - - ROM_REGION( 0x010000, "user1", 0 ) // not graphics - ROM_LOAD( "base.bin", 0x00000, 0x08000, CRC(456dd16e) SHA1(84779ee64d3ea33ba1ba4dee39b504a81c6811a1) ) - - ROM_REGION( 0x100000, "oki1", 0 ) // ADPCM Samples - ROM_LOAD( "rom5.bin", 0x000000, 0x100000, CRC(f6d49863) SHA1(3a3c354852adad06e8a051511abfab7606bce382) ) -ROM_END - -/* - The region of Batrider is controlled by the first byte of rom prg0.u22 - only sets which have been dumped from original PCBs are supported - - original ROM labels have no indication of the region. - - valid values are: - ( * denotes that this set has been found on an original PCB ) - - 00 : Nippon * - 01 : USA * - 02 : Europe * - 03 : Asia - 04 : German (sic) - 05 : Austria - 06 : Belgium - 07 : Denmark - 08 : Finland - 09 : France - 0A : Great Britain - 0B : Greece - 0C : The Netherlands - 0D : Italy - 0E : Norway - 0F : Portugal - 10 : Spain - 11 : Sweden - 12 : Switzerland - 13 : Australia - 14 : New Zealand - 15 : Taiwan - 16 : Hong Kong - 17 : Korea * - 18 : China * - 19 : No Region? - 1A+: Invalid - - For future reference, that would mean the following - - ROM_LOAD16_BYTE( "prg0_nippon.u22", 0x000000, 0x080000, CRC(4f3fc729) SHA1(b32d51c254741b82171a86c271679522a7aefd34) ) - ROM_LOAD16_BYTE( "prg0_usa.u22", 0x000000, 0x080000, CRC(2049d007) SHA1(f2a43547a6fc5083b03c1d59a85abbf6e1ce4cd9) ) - ROM_LOAD16_BYTE( "prg0_europe.u22", 0x000000, 0x080000, CRC(91d3e975) SHA1(682885fc17f2424d475c282f239f42faf1aae076) ) - ROM_LOAD16_BYTE( "prg0_asia.u22", 0x000000, 0x080000, CRC(fea5fe5b) SHA1(0008336ecd3886485ab1d9678880b1a0bc788f40) ) - ROM_LOAD16_BYTE( "prg0_german.u22", 0x000000, 0x080000, CRC(29969dd0) SHA1(eb8ad84b772508b6befb35afb11a0d6193c6a060) ) - ROM_LOAD16_BYTE( "prg0_austria.u22", 0x000000, 0x080000, CRC(46e08afe) SHA1(a6f46581d0f7285704fbf1ac57476c96f4dcbec2) ) - ROM_LOAD16_BYTE( "prg0_belgium.u22", 0x000000, 0x080000, CRC(f77ab38c) SHA1(8be87175250345d3e31d95ec204805071eae81f6) ) - ROM_LOAD16_BYTE( "prg0_denmark.u22", 0x000000, 0x080000, CRC(980ca4a2) SHA1(4f29eaa5ba6b94d96c527f80188657abc8f4dcd0) ) - ROM_LOAD16_BYTE( "prg0_finland.u22", 0x000000, 0x080000, CRC(826d72db) SHA1(be4bca0143f43c13361fd56974eb9b1ce7bd1740) ) - ROM_LOAD16_BYTE( "prg0_france.u22", 0x000000, 0x080000, CRC(ed1b65f5) SHA1(1e08957c0f7ed65695fb1ceb961ab765f8a97c89) ) - ROM_LOAD16_BYTE( "prg0_greatbritain.u22", 0x000000, 0x080000, CRC(5c815c87) SHA1(dea89944cd9a3fa6991b214495dc7123a505d39b) ) - ROM_LOAD16_BYTE( "prg0_greece.u22", 0x000000, 0x080000, CRC(33f74ba9) SHA1(fe770415584b037152b37a75fe468d3c52dcb3cd) ) - ROM_LOAD16_BYTE( "prg0_netherlands.u22", 0x000000, 0x080000, CRC(e4c42822) SHA1(8bfd286c42d7f2b3c88757b9a8b818be90b73f48) ) - ROM_LOAD16_BYTE( "prg0_italy.u22", 0x000000, 0x080000, CRC(8bb23f0c) SHA1(b448bba312a8d583a981f6633cbc14af99fdbb06) ) - ROM_LOAD16_BYTE( "prg0_norway.u22", 0x000000, 0x080000, CRC(3a28067e) SHA1(9435e6ce90b8d740a545469e6edb35d1af11ceab) ) - ROM_LOAD16_BYTE( "prg0_portugal.u22", 0x000000, 0x080000, CRC(555e1150) SHA1(5c9ae898244a23a4184f9613f42d9aa9530468b9) ) - ROM_LOAD16_BYTE( "prg0_spain.u22", 0x000000, 0x080000, CRC(0eebaa8c) SHA1(e305e90434e7f322a33e42a642362f770d3eb0e5) ) - ROM_LOAD16_BYTE( "prg0_sweden.u22", 0x000000, 0x080000, CRC(619dbda2) SHA1(9e88ba104a5cffcced3b93ca711487a82b0fddde) ) - ROM_LOAD16_BYTE( "prg0_switzerland.u22", 0x000000, 0x080000, CRC(d00784d0) SHA1(0b809414ce910684ca39216086f7d26fd2adeded) ) - ROM_LOAD16_BYTE( "prg0_australia.u22", 0x000000, 0x080000, CRC(bf7193fe) SHA1(9af50fffc6ef23e300bf7b5e90b0dee6e4f4ad05) ) - ROM_LOAD16_BYTE( "prg0_newzealand.u22", 0x000000, 0x080000, CRC(6842f075) SHA1(125b303c064d2f0b539ecadcb205756e7fd1334e) ) - ROM_LOAD16_BYTE( "prg0_taiwan.u22", 0x000000, 0x080000, CRC(0734e75b) SHA1(17a8fb4f8fda3c234ed976490193ba308cac08fe) ) - ROM_LOAD16_BYTE( "prg0_hongkong.u22", 0x000000, 0x080000, CRC(b6aede29) SHA1(580f29db6a2c2cea43966413778362694992a675) ) - ROM_LOAD16_BYTE( "prg0_korea.u22", 0x000000, 0x080000, CRC(d9d8c907) SHA1(69c197f2a41f288913f042de9eb8274c0df3ac27) ) - ROM_LOAD16_BYTE( "prg0_china.u22", 0x000000, 0x080000, CRC(c3b91f7e) SHA1(6b2376c37808dccda296d90ccd7f577ccff4e4dc) ) - ROM_LOAD16_BYTE( "prg0_none.u22", 0x000000, 0x080000, CRC(accf0850) SHA1(d93e4e80443a40c3a9575dbf21927ef0d1a039b9) ) - */ - - -ROM_START( batrider ) - ROM_REGION( 0x200000, "maincpu", 0 ) /* Main 68k code */ - ROM_LOAD16_BYTE( "prg0_europe.u22", 0x000000, 0x080000, CRC(91d3e975) SHA1(682885fc17f2424d475c282f239f42faf1aae076) ) - ROM_LOAD16_BYTE( "prg1b.u23", 0x000001, 0x080000, CRC(8e70b492) SHA1(f84f2039826ae815afb058d71c1dbd190f9d524d) ) - ROM_LOAD16_BYTE( "prg2.u21" , 0x100000, 0x080000, CRC(bdaa5fbf) SHA1(abd72ac633c0c8e7b4b1d7902c0d6e014ba995fe) ) - ROM_LOAD16_BYTE( "prg3.u24" , 0x100001, 0x080000, CRC(7aa9f941) SHA1(99bdbad7a96d461073b06a53c50fc57c2fd6fc6d) ) - - ROM_REGION( 0x40000, "audiocpu", 0 ) /* Sound Z80 code + bank */ - ROM_LOAD( "snd.u77", 0x00000, 0x40000, CRC(56682696) SHA1(a372450d9a6d535123dfc31d8116074b168ab646) ) - - ROM_REGION( 0x1000000, "gp9001_0", 0 ) - ROM_LOAD( "rom-1.bin", 0x000000, 0x400000, CRC(0df69ca2) SHA1(49670347ebd7e1067ff988cf842b275b7ee7b5f7) ) - ROM_LOAD( "rom-3.bin", 0x400000, 0x400000, CRC(60167d38) SHA1(fd2429808c59ef51fd5f5db84ea89a8dc504186e) ) - ROM_LOAD( "rom-2.bin", 0x800000, 0x400000, CRC(1bfea593) SHA1(ce06dc3097ae56b0df56d104bbf7efc9b5d968d4) ) - ROM_LOAD( "rom-4.bin", 0xc00000, 0x400000, CRC(bee03c94) SHA1(5bc1e6769c42857c03456426b502fcb86a114f19) ) - - ROM_REGION( 0x100000, "oki1", 0 ) /* ADPCM Samples 1 */ - ROM_LOAD( "rom-5.bin", 0x000000, 0x100000, CRC(4274daf6) SHA1(85557b4707d529e5914f03c7a856864f5c24950e) ) - - ROM_REGION( 0x100000, "oki2", 0 ) /* ADPCM Samples 2 */ - ROM_LOAD( "rom-6.bin", 0x000000, 0x100000, CRC(2a1c2426) SHA1(8abc3688ffc5ebb94b8d5118d4fa0908f07fe791) ) -ROM_END - - -ROM_START( batrideru ) - ROM_REGION( 0x200000, "maincpu", 0 ) /* Main 68k code */ - ROM_LOAD16_BYTE( "prg0_usa.u22", 0x000000, 0x080000, CRC(2049d007) SHA1(f2a43547a6fc5083b03c1d59a85abbf6e1ce4cd9) ) - ROM_LOAD16_BYTE( "prg1b.u23", 0x000001, 0x080000, CRC(8e70b492) SHA1(f84f2039826ae815afb058d71c1dbd190f9d524d) ) - ROM_LOAD16_BYTE( "prg2.u21" , 0x100000, 0x080000, CRC(bdaa5fbf) SHA1(abd72ac633c0c8e7b4b1d7902c0d6e014ba995fe) ) - ROM_LOAD16_BYTE( "prg3.u24" , 0x100001, 0x080000, CRC(7aa9f941) SHA1(99bdbad7a96d461073b06a53c50fc57c2fd6fc6d) ) - - ROM_REGION( 0x40000, "audiocpu", 0 ) /* Sound Z80 code + bank */ - ROM_LOAD( "snd.u77", 0x00000, 0x40000, CRC(56682696) SHA1(a372450d9a6d535123dfc31d8116074b168ab646) ) - - ROM_REGION( 0x1000000, "gp9001_0", 0 ) - ROM_LOAD( "rom-1.bin", 0x000000, 0x400000, CRC(0df69ca2) SHA1(49670347ebd7e1067ff988cf842b275b7ee7b5f7) ) - ROM_LOAD( "rom-3.bin", 0x400000, 0x400000, CRC(60167d38) SHA1(fd2429808c59ef51fd5f5db84ea89a8dc504186e) ) - ROM_LOAD( "rom-2.bin", 0x800000, 0x400000, CRC(1bfea593) SHA1(ce06dc3097ae56b0df56d104bbf7efc9b5d968d4) ) - ROM_LOAD( "rom-4.bin", 0xc00000, 0x400000, CRC(bee03c94) SHA1(5bc1e6769c42857c03456426b502fcb86a114f19) ) - - ROM_REGION( 0x100000, "oki1", 0 ) /* ADPCM Samples 1 */ - ROM_LOAD( "rom-5.bin", 0x000000, 0x100000, CRC(4274daf6) SHA1(85557b4707d529e5914f03c7a856864f5c24950e) ) - - ROM_REGION( 0x100000, "oki2", 0 ) /* ADPCM Samples 2 */ - ROM_LOAD( "rom-6.bin", 0x000000, 0x100000, CRC(2a1c2426) SHA1(8abc3688ffc5ebb94b8d5118d4fa0908f07fe791) ) -ROM_END - - -ROM_START( batriderc ) - ROM_REGION( 0x200000, "maincpu", 0 ) /* Main 68k code */ - ROM_LOAD16_BYTE( "prg0_china.u22", 0x000000, 0x080000, CRC(c3b91f7e) SHA1(6b2376c37808dccda296d90ccd7f577ccff4e4dc) ) - ROM_LOAD16_BYTE( "prg1b.u23", 0x000001, 0x080000, CRC(8e70b492) SHA1(f84f2039826ae815afb058d71c1dbd190f9d524d) ) - ROM_LOAD16_BYTE( "prg2.u21" , 0x100000, 0x080000, CRC(bdaa5fbf) SHA1(abd72ac633c0c8e7b4b1d7902c0d6e014ba995fe) ) - ROM_LOAD16_BYTE( "prg3.u24" , 0x100001, 0x080000, CRC(7aa9f941) SHA1(99bdbad7a96d461073b06a53c50fc57c2fd6fc6d) ) - - ROM_REGION( 0x40000, "audiocpu", 0 ) /* Sound Z80 code + bank */ - ROM_LOAD( "snd.u77", 0x00000, 0x40000, CRC(56682696) SHA1(a372450d9a6d535123dfc31d8116074b168ab646) ) - - ROM_REGION( 0x1000000, "gp9001_0", 0 ) - ROM_LOAD( "rom-1.bin", 0x000000, 0x400000, CRC(0df69ca2) SHA1(49670347ebd7e1067ff988cf842b275b7ee7b5f7) ) - ROM_LOAD( "rom-3.bin", 0x400000, 0x400000, CRC(60167d38) SHA1(fd2429808c59ef51fd5f5db84ea89a8dc504186e) ) - ROM_LOAD( "rom-2.bin", 0x800000, 0x400000, CRC(1bfea593) SHA1(ce06dc3097ae56b0df56d104bbf7efc9b5d968d4) ) - ROM_LOAD( "rom-4.bin", 0xc00000, 0x400000, CRC(bee03c94) SHA1(5bc1e6769c42857c03456426b502fcb86a114f19) ) - - ROM_REGION( 0x100000, "oki1", 0 ) /* ADPCM Samples 1 */ - ROM_LOAD( "rom-5.bin", 0x000000, 0x100000, CRC(4274daf6) SHA1(85557b4707d529e5914f03c7a856864f5c24950e) ) - - ROM_REGION( 0x100000, "oki2", 0 ) /* ADPCM Samples 2 */ - ROM_LOAD( "rom-6.bin", 0x000000, 0x100000, CRC(2a1c2426) SHA1(8abc3688ffc5ebb94b8d5118d4fa0908f07fe791) ) -ROM_END - - -ROM_START( batriderj ) - ROM_REGION( 0x200000, "maincpu", 0 ) /* Main 68k code */ - ROM_LOAD16_BYTE( "prg0b.u22", 0x000000, 0x080000, CRC(4f3fc729) SHA1(b32d51c254741b82171a86c271679522a7aefd34) ) - ROM_LOAD16_BYTE( "prg1b.u23", 0x000001, 0x080000, CRC(8e70b492) SHA1(f84f2039826ae815afb058d71c1dbd190f9d524d) ) - ROM_LOAD16_BYTE( "prg2.u21" , 0x100000, 0x080000, CRC(bdaa5fbf) SHA1(abd72ac633c0c8e7b4b1d7902c0d6e014ba995fe) ) - ROM_LOAD16_BYTE( "prg3.u24" , 0x100001, 0x080000, CRC(7aa9f941) SHA1(99bdbad7a96d461073b06a53c50fc57c2fd6fc6d) ) - - ROM_REGION( 0x40000, "audiocpu", 0 ) /* Sound Z80 code + bank */ - ROM_LOAD( "snd.u77", 0x00000, 0x40000, CRC(56682696) SHA1(a372450d9a6d535123dfc31d8116074b168ab646) ) - - ROM_REGION( 0x1000000, "gp9001_0", 0 ) - ROM_LOAD( "rom-1.bin", 0x000000, 0x400000, CRC(0df69ca2) SHA1(49670347ebd7e1067ff988cf842b275b7ee7b5f7) ) - ROM_LOAD( "rom-3.bin", 0x400000, 0x400000, CRC(60167d38) SHA1(fd2429808c59ef51fd5f5db84ea89a8dc504186e) ) - ROM_LOAD( "rom-2.bin", 0x800000, 0x400000, CRC(1bfea593) SHA1(ce06dc3097ae56b0df56d104bbf7efc9b5d968d4) ) - ROM_LOAD( "rom-4.bin", 0xc00000, 0x400000, CRC(bee03c94) SHA1(5bc1e6769c42857c03456426b502fcb86a114f19) ) - - ROM_REGION( 0x100000, "oki1", 0 ) /* ADPCM Samples 1 */ - ROM_LOAD( "rom-5.bin", 0x000000, 0x100000, CRC(4274daf6) SHA1(85557b4707d529e5914f03c7a856864f5c24950e) ) - - ROM_REGION( 0x100000, "oki2", 0 ) /* ADPCM Samples 2 */ - ROM_LOAD( "rom-6.bin", 0x000000, 0x100000, CRC(2a1c2426) SHA1(8abc3688ffc5ebb94b8d5118d4fa0908f07fe791) ) -ROM_END - - -ROM_START( batriderk ) - ROM_REGION( 0x200000, "maincpu", 0 ) /* Main 68k code */ - ROM_LOAD16_BYTE( "prg0_korea.u22", 0x000000, 0x080000, CRC(d9d8c907) SHA1(69c197f2a41f288913f042de9eb8274c0df3ac27) ) - ROM_LOAD16_BYTE( "prg1b.u23", 0x000001, 0x080000, CRC(8e70b492) SHA1(f84f2039826ae815afb058d71c1dbd190f9d524d) ) - ROM_LOAD16_BYTE( "prg2.u21" , 0x100000, 0x080000, CRC(bdaa5fbf) SHA1(abd72ac633c0c8e7b4b1d7902c0d6e014ba995fe) ) - ROM_LOAD16_BYTE( "prg3.u24" , 0x100001, 0x080000, CRC(7aa9f941) SHA1(99bdbad7a96d461073b06a53c50fc57c2fd6fc6d) ) - - ROM_REGION( 0x40000, "audiocpu", 0 ) /* Sound Z80 code + bank */ - ROM_LOAD( "snd.u77", 0x00000, 0x40000, CRC(56682696) SHA1(a372450d9a6d535123dfc31d8116074b168ab646) ) - - ROM_REGION( 0x1000000, "gp9001_0", 0 ) - ROM_LOAD( "rom-1.bin", 0x000000, 0x400000, CRC(0df69ca2) SHA1(49670347ebd7e1067ff988cf842b275b7ee7b5f7) ) - ROM_LOAD( "rom-3.bin", 0x400000, 0x400000, CRC(60167d38) SHA1(fd2429808c59ef51fd5f5db84ea89a8dc504186e) ) - ROM_LOAD( "rom-2.bin", 0x800000, 0x400000, CRC(1bfea593) SHA1(ce06dc3097ae56b0df56d104bbf7efc9b5d968d4) ) - ROM_LOAD( "rom-4.bin", 0xc00000, 0x400000, CRC(bee03c94) SHA1(5bc1e6769c42857c03456426b502fcb86a114f19) ) - - ROM_REGION( 0x100000, "oki1", 0 ) /* ADPCM Samples 1 */ - ROM_LOAD( "rom-5.bin", 0x000000, 0x100000, CRC(4274daf6) SHA1(85557b4707d529e5914f03c7a856864f5c24950e) ) - - ROM_REGION( 0x100000, "oki2", 0 ) /* ADPCM Samples 2 */ - ROM_LOAD( "rom-6.bin", 0x000000, 0x100000, CRC(2a1c2426) SHA1(8abc3688ffc5ebb94b8d5118d4fa0908f07fe791) ) -ROM_END - -/* older version, might have only been released in Japan, Hong Kong and Taiwan? */ -ROM_START( batriderja ) - ROM_REGION( 0x200000, "maincpu", 0 ) /* Main 68k code */ - ROM_LOAD16_BYTE( "prg0.bin", 0x000000, 0x080000, CRC(f93ea27c) SHA1(41023c2ee1efd70b5aa9c70e1ddd9e5c3d51d68a) ) - ROM_LOAD16_BYTE( "prg1.u23", 0x000001, 0x080000, CRC(8ae7f592) SHA1(8a20ebf85eca621f578d2302c3a3988647b077a7) ) - ROM_LOAD16_BYTE( "prg2.u21", 0x100000, 0x080000, CRC(bdaa5fbf) SHA1(abd72ac633c0c8e7b4b1d7902c0d6e014ba995fe) ) - ROM_LOAD16_BYTE( "prg3.u24", 0x100001, 0x080000, CRC(7aa9f941) SHA1(99bdbad7a96d461073b06a53c50fc57c2fd6fc6d) ) - - ROM_REGION( 0x40000, "audiocpu", 0 ) /* Sound Z80 code + bank */ - ROM_LOAD( "snd.u77", 0x00000, 0x40000, CRC(56682696) SHA1(a372450d9a6d535123dfc31d8116074b168ab646) ) - - ROM_REGION( 0x1000000, "gp9001_0", 0 ) - ROM_LOAD( "rom-1.bin", 0x000000, 0x400000, CRC(0df69ca2) SHA1(49670347ebd7e1067ff988cf842b275b7ee7b5f7) ) - ROM_LOAD( "rom-3.bin", 0x400000, 0x400000, CRC(60167d38) SHA1(fd2429808c59ef51fd5f5db84ea89a8dc504186e) ) - ROM_LOAD( "rom-2.bin", 0x800000, 0x400000, CRC(1bfea593) SHA1(ce06dc3097ae56b0df56d104bbf7efc9b5d968d4) ) - ROM_LOAD( "rom-4.bin", 0xc00000, 0x400000, CRC(bee03c94) SHA1(5bc1e6769c42857c03456426b502fcb86a114f19) ) - - ROM_REGION( 0x100000, "oki1", 0 ) /* ADPCM Samples 1 */ - ROM_LOAD( "rom-5.bin", 0x000000, 0x100000, CRC(4274daf6) SHA1(85557b4707d529e5914f03c7a856864f5c24950e) ) - - ROM_REGION( 0x100000, "oki2", 0 ) /* ADPCM Samples 2 */ - ROM_LOAD( "rom-6.bin", 0x000000, 0x100000, CRC(2a1c2426) SHA1(8abc3688ffc5ebb94b8d5118d4fa0908f07fe791) ) -ROM_END - - -ROM_START( batriderhk ) - ROM_REGION( 0x200000, "maincpu", 0 ) /* Main 68k code */ - ROM_LOAD16_BYTE( "prg0.u22", 0x000000, 0x080000, CRC(00afbb7c) SHA1(a4b6331e0fcab7d0c43fc43adb701f1248247b41) ) - ROM_LOAD16_BYTE( "prg1.u23", 0x000001, 0x080000, CRC(8ae7f592) SHA1(8a20ebf85eca621f578d2302c3a3988647b077a7) ) - ROM_LOAD16_BYTE( "prg2.u21", 0x100000, 0x080000, CRC(bdaa5fbf) SHA1(abd72ac633c0c8e7b4b1d7902c0d6e014ba995fe) ) - ROM_LOAD16_BYTE( "prg3.u24", 0x100001, 0x080000, CRC(7aa9f941) SHA1(99bdbad7a96d461073b06a53c50fc57c2fd6fc6d) ) - - ROM_REGION( 0x40000, "audiocpu", 0 ) /* Sound Z80 code + bank */ - ROM_LOAD( "snd.u77", 0x00000, 0x40000, CRC(56682696) SHA1(a372450d9a6d535123dfc31d8116074b168ab646) ) - - ROM_REGION( 0x1000000, "gp9001_0", 0 ) - ROM_LOAD( "rom-1.bin", 0x000000, 0x400000, CRC(0df69ca2) SHA1(49670347ebd7e1067ff988cf842b275b7ee7b5f7) ) - ROM_LOAD( "rom-3.bin", 0x400000, 0x400000, CRC(60167d38) SHA1(fd2429808c59ef51fd5f5db84ea89a8dc504186e) ) - ROM_LOAD( "rom-2.bin", 0x800000, 0x400000, CRC(1bfea593) SHA1(ce06dc3097ae56b0df56d104bbf7efc9b5d968d4) ) - ROM_LOAD( "rom-4.bin", 0xc00000, 0x400000, CRC(bee03c94) SHA1(5bc1e6769c42857c03456426b502fcb86a114f19) ) - - ROM_REGION( 0x100000, "oki1", 0 ) /* ADPCM Samples 1 */ - ROM_LOAD( "rom-5.bin", 0x000000, 0x100000, CRC(4274daf6) SHA1(85557b4707d529e5914f03c7a856864f5c24950e) ) - - ROM_REGION( 0x100000, "oki2", 0 ) /* ADPCM Samples 2 */ - ROM_LOAD( "rom-6.bin", 0x000000, 0x100000, CRC(2a1c2426) SHA1(8abc3688ffc5ebb94b8d5118d4fa0908f07fe791) ) -ROM_END - - -ROM_START( batridert ) - ROM_REGION( 0x200000, "maincpu", 0 ) /* Main 68k code */ - ROM_LOAD16_BYTE( "u22.bin", 0x000000, 0x080000, CRC(b135820e) SHA1(c222887d18a0a3ea0fcc973b95b29d69c86f7ec3) ) - ROM_LOAD16_BYTE( "prg1.u23", 0x000001, 0x080000, CRC(8ae7f592) SHA1(8a20ebf85eca621f578d2302c3a3988647b077a7) ) - ROM_LOAD16_BYTE( "prg2.u21", 0x100000, 0x080000, CRC(bdaa5fbf) SHA1(abd72ac633c0c8e7b4b1d7902c0d6e014ba995fe) ) - ROM_LOAD16_BYTE( "prg3.u24", 0x100001, 0x080000, CRC(7aa9f941) SHA1(99bdbad7a96d461073b06a53c50fc57c2fd6fc6d) ) - - ROM_REGION( 0x40000, "audiocpu", 0 ) /* Sound Z80 code + bank */ - ROM_LOAD( "snd.u77", 0x00000, 0x40000, CRC(56682696) SHA1(a372450d9a6d535123dfc31d8116074b168ab646) ) - - ROM_REGION( 0x1000000, "gp9001_0", 0 ) - ROM_LOAD( "rom-1.bin", 0x000000, 0x400000, CRC(0df69ca2) SHA1(49670347ebd7e1067ff988cf842b275b7ee7b5f7) ) - ROM_LOAD( "rom-3.bin", 0x400000, 0x400000, CRC(60167d38) SHA1(fd2429808c59ef51fd5f5db84ea89a8dc504186e) ) - ROM_LOAD( "rom-2.bin", 0x800000, 0x400000, CRC(1bfea593) SHA1(ce06dc3097ae56b0df56d104bbf7efc9b5d968d4) ) - ROM_LOAD( "rom-4.bin", 0xc00000, 0x400000, CRC(bee03c94) SHA1(5bc1e6769c42857c03456426b502fcb86a114f19) ) - - ROM_REGION( 0x100000, "oki1", 0 ) /* ADPCM Samples 1 */ - ROM_LOAD( "rom-5.bin", 0x000000, 0x100000, CRC(4274daf6) SHA1(85557b4707d529e5914f03c7a856864f5c24950e) ) - - ROM_REGION( 0x100000, "oki2", 0 ) /* ADPCM Samples 2 */ - ROM_LOAD( "rom-6.bin", 0x000000, 0x100000, CRC(2a1c2426) SHA1(8abc3688ffc5ebb94b8d5118d4fa0908f07fe791) ) -ROM_END - - - -/* -Battle Bakraid -Raizing/8ing, 1999 - -PCB Layout ----------- - -ET68-V99 -|-----------------------------------------------------| -|TA8201 16.93MHz ROM-6 6264 | -| YAC516 | -| YMZ280B-F ROM-7 SND_U0720 | -| | -| VOL ROM-8 Z80 | -| | -| 341256 | -| 93C66 | -| 341256 XILINX | -|J XC95108 | -|A 27MHz 32MHz | -|M | -|M DIPSW1 341256 341256| -|A XILINX XILINK | -| DIPSW2 XC95144 XC95108 341256 341256| -| | -| DIPSW3 | -| MACH211 PRG1_U023 | -| TEST_SW 68000 | -| PRG0_U022 | -| | -| PRG3_U024 | -| L7A0498 | -| GP9001 PRG2_U021 | -| ROM-0 ROM-1 (QFP208) | -| | -| 6264 MN414260 | -| ROM-2 ROM-3 | -| 6264 MN414260 | -|-----------------------------------------------------| -Notes: - ROM-0 to ROM-3 - 32M DIP42 - ROM-6 to ROM-8 - 32M DIP42 Byte Mode - 68000 clock - 16.000MHz (32/2) - Z80 clock - 5.33333MHz (32/6) - VSync - 60Hz - HSync - 15.39kHz -*/ - - - -ROM_START( bbakraid ) - ROM_REGION( 0x200000, "maincpu", 0 ) /* Main 68k code */ - ROM_LOAD16_BYTE( "prg0u022_usa.bin", 0x000000, 0x080000, CRC(95fb2ffd) SHA1(c7f502f3945249573b66226e8bacc6a9bc230693) ) - ROM_LOAD16_BYTE( "prg1u023.new", 0x000001, 0x080000, CRC(4ae9aa64) SHA1(45fdf72141c4c9f24a38d4218c65874799b9c868) ) - ROM_LOAD16_BYTE( "prg2u021.bin", 0x100000, 0x080000, CRC(ffba8656) SHA1(6526bb65fad3384de3f301a7d1095cbf03757433) ) - ROM_LOAD16_BYTE( "prg3u024.bin", 0x100001, 0x080000, CRC(834b8ad6) SHA1(0dd6223bb0749819ad29811eeb04fd08d937abb0) ) - - ROM_REGION( 0x20000, "audiocpu", 0 ) /* Sound Z80 code */ - ROM_LOAD( "sndu0720.bin", 0x00000, 0x20000, CRC(e62ab246) SHA1(00d23689dd423ecd4024c58b5903d16e890f1dff) ) - - ROM_REGION( 0x1000000, "gp9001_0", 0 ) - ROM_LOAD( "gfxu0510.bin", 0x000000, 0x400000, CRC(9cca3446) SHA1(1123f8b8bfbe59a2c572cdf61f1ad27ff37f0f0d) ) - ROM_LOAD( "gfxu0512.bin", 0x400000, 0x400000, CRC(a2a281d5) SHA1(d9a6623f9433ad682223f9780c26cd1523ebc5c5) ) - ROM_LOAD( "gfxu0511.bin", 0x800000, 0x400000, CRC(e16472c0) SHA1(6068d679a8b3b65e05acd58a7ce9ead90177049f) ) - ROM_LOAD( "gfxu0513.bin", 0xc00000, 0x400000, CRC(8bb635a0) SHA1(9064f1a2d8bb88ddbca702fb8556d0dfe6a5cadc) ) - - ROM_REGION( 0x0c00000, "ymz", 0 ) /* YMZ280B Samples */ - ROM_LOAD( "rom6.829", 0x000000, 0x400000, CRC(8848b4a0) SHA1(e0dce136c5d5a4c1a92b863e57848cd5927d06f1) ) - ROM_LOAD( "rom7.830", 0x400000, 0x400000, CRC(d6224267) SHA1(5c9b7b13effbef9f707811f84bfe50ca85e605e3) ) - ROM_LOAD( "rom8.831", 0x800000, 0x400000, CRC(a101dfb0) SHA1(4b729b0d562e09df35438e9e6b457b8de2690a6e) ) - - ROM_REGION( 0x200, "eeprom", 0 ) - ROM_LOAD( "eeprom-bbakraid-new.bin", 0x000, 0x200, CRC(35c9275a) SHA1(1282034adf3c7a24545fd273729867058dc93027) ) -ROM_END - - -ROM_START( bbakraidc ) - ROM_REGION( 0x200000, "maincpu", 0 ) /* Main 68k code */ - ROM_LOAD16_BYTE( "prg0u022_china.bin", 0x000000, 0x080000, CRC(760be084) SHA1(096c8a2336492d7370ae25f3385faebf6e9c3eca) ) - ROM_LOAD16_BYTE( "prg1u023.new", 0x000001, 0x080000, CRC(4ae9aa64) SHA1(45fdf72141c4c9f24a38d4218c65874799b9c868) ) - ROM_LOAD16_BYTE( "prg2u021.bin", 0x100000, 0x080000, CRC(ffba8656) SHA1(6526bb65fad3384de3f301a7d1095cbf03757433) ) - ROM_LOAD16_BYTE( "prg3u024.bin", 0x100001, 0x080000, CRC(834b8ad6) SHA1(0dd6223bb0749819ad29811eeb04fd08d937abb0) ) - - ROM_REGION( 0x20000, "audiocpu", 0 ) /* Sound Z80 code */ - ROM_LOAD( "sndu0720.bin", 0x00000, 0x20000, CRC(e62ab246) SHA1(00d23689dd423ecd4024c58b5903d16e890f1dff) ) - - ROM_REGION( 0x1000000, "gp9001_0", 0 ) - ROM_LOAD( "gfxu0510.bin", 0x000000, 0x400000, CRC(9cca3446) SHA1(1123f8b8bfbe59a2c572cdf61f1ad27ff37f0f0d) ) - ROM_LOAD( "gfxu0512.bin", 0x400000, 0x400000, CRC(a2a281d5) SHA1(d9a6623f9433ad682223f9780c26cd1523ebc5c5) ) - ROM_LOAD( "gfxu0511.bin", 0x800000, 0x400000, CRC(e16472c0) SHA1(6068d679a8b3b65e05acd58a7ce9ead90177049f) ) - ROM_LOAD( "gfxu0513.bin", 0xc00000, 0x400000, CRC(8bb635a0) SHA1(9064f1a2d8bb88ddbca702fb8556d0dfe6a5cadc) ) - - ROM_REGION( 0x0c00000, "ymz", 0 ) /* YMZ280B Samples */ - ROM_LOAD( "rom6.829", 0x000000, 0x400000, CRC(8848b4a0) SHA1(e0dce136c5d5a4c1a92b863e57848cd5927d06f1) ) - ROM_LOAD( "rom7.830", 0x400000, 0x400000, CRC(d6224267) SHA1(5c9b7b13effbef9f707811f84bfe50ca85e605e3) ) - ROM_LOAD( "rom8.831", 0x800000, 0x400000, CRC(a101dfb0) SHA1(4b729b0d562e09df35438e9e6b457b8de2690a6e) ) - - ROM_REGION( 0x200, "eeprom", 0 ) - ROM_LOAD( "eeprom-bbakraid-new.bin", 0x000, 0x200, CRC(35c9275a) SHA1(1282034adf3c7a24545fd273729867058dc93027) ) -ROM_END - - -ROM_START( bbakraidj ) - ROM_REGION( 0x200000, "maincpu", 0 ) /* Main 68k code */ - ROM_LOAD16_BYTE( "prg0u022.new", 0x000000, 0x080000, CRC(fa8d38d3) SHA1(aba91d87a8a62d3fe1139b4437b16e2f844264ad) ) - ROM_LOAD16_BYTE( "prg1u023.new", 0x000001, 0x080000, CRC(4ae9aa64) SHA1(45fdf72141c4c9f24a38d4218c65874799b9c868) ) - ROM_LOAD16_BYTE( "prg2u021.bin", 0x100000, 0x080000, CRC(ffba8656) SHA1(6526bb65fad3384de3f301a7d1095cbf03757433) ) - ROM_LOAD16_BYTE( "prg3u024.bin", 0x100001, 0x080000, CRC(834b8ad6) SHA1(0dd6223bb0749819ad29811eeb04fd08d937abb0) ) - - ROM_REGION( 0x20000, "audiocpu", 0 ) /* Sound Z80 code */ - ROM_LOAD( "sndu0720.bin", 0x00000, 0x20000, CRC(e62ab246) SHA1(00d23689dd423ecd4024c58b5903d16e890f1dff) ) - - ROM_REGION( 0x1000000, "gp9001_0", 0 ) - ROM_LOAD( "gfxu0510.bin", 0x000000, 0x400000, CRC(9cca3446) SHA1(1123f8b8bfbe59a2c572cdf61f1ad27ff37f0f0d) ) - ROM_LOAD( "gfxu0512.bin", 0x400000, 0x400000, CRC(a2a281d5) SHA1(d9a6623f9433ad682223f9780c26cd1523ebc5c5) ) - ROM_LOAD( "gfxu0511.bin", 0x800000, 0x400000, CRC(e16472c0) SHA1(6068d679a8b3b65e05acd58a7ce9ead90177049f) ) - ROM_LOAD( "gfxu0513.bin", 0xc00000, 0x400000, CRC(8bb635a0) SHA1(9064f1a2d8bb88ddbca702fb8556d0dfe6a5cadc) ) - - ROM_REGION( 0x0c00000, "ymz", 0 ) /* YMZ280B Samples */ - ROM_LOAD( "rom6.829", 0x000000, 0x400000, CRC(8848b4a0) SHA1(e0dce136c5d5a4c1a92b863e57848cd5927d06f1) ) - ROM_LOAD( "rom7.830", 0x400000, 0x400000, CRC(d6224267) SHA1(5c9b7b13effbef9f707811f84bfe50ca85e605e3) ) - ROM_LOAD( "rom8.831", 0x800000, 0x400000, CRC(a101dfb0) SHA1(4b729b0d562e09df35438e9e6b457b8de2690a6e) ) - - ROM_REGION( 0x200, "eeprom", 0 ) - ROM_LOAD( "eeprom-bbakraid-new.bin", 0x000, 0x200, CRC(35c9275a) SHA1(1282034adf3c7a24545fd273729867058dc93027) ) -ROM_END - - -ROM_START( bbakraidja ) - ROM_REGION( 0x200000, "maincpu", 0 ) /* Main 68k code */ - ROM_LOAD16_BYTE( "prg0u022.bin", 0x000000, 0x080000, CRC(0dd59512) SHA1(c6a4e6aa49c6ac3b04ae62a0a4cc8084ae048381) ) - ROM_LOAD16_BYTE( "prg1u023.bin", 0x000001, 0x080000, CRC(fecde223) SHA1(eb5ac0eda49b4b0f3d25d8a8bb356e77a453d3a7) ) - ROM_LOAD16_BYTE( "prg2u021.bin", 0x100000, 0x080000, CRC(ffba8656) SHA1(6526bb65fad3384de3f301a7d1095cbf03757433) ) - ROM_LOAD16_BYTE( "prg3u024.bin", 0x100001, 0x080000, CRC(834b8ad6) SHA1(0dd6223bb0749819ad29811eeb04fd08d937abb0) ) - - ROM_REGION( 0x20000, "audiocpu", 0 ) /* Sound Z80 code */ - ROM_LOAD( "sndu0720.bin", 0x00000, 0x20000, CRC(e62ab246) SHA1(00d23689dd423ecd4024c58b5903d16e890f1dff) ) - - ROM_REGION( 0x1000000, "gp9001_0", 0 ) - ROM_LOAD( "gfxu0510.bin", 0x000000, 0x400000, CRC(9cca3446) SHA1(1123f8b8bfbe59a2c572cdf61f1ad27ff37f0f0d) ) - ROM_LOAD( "gfxu0512.bin", 0x400000, 0x400000, CRC(a2a281d5) SHA1(d9a6623f9433ad682223f9780c26cd1523ebc5c5) ) - ROM_LOAD( "gfxu0511.bin", 0x800000, 0x400000, CRC(e16472c0) SHA1(6068d679a8b3b65e05acd58a7ce9ead90177049f) ) - ROM_LOAD( "gfxu0513.bin", 0xc00000, 0x400000, CRC(8bb635a0) SHA1(9064f1a2d8bb88ddbca702fb8556d0dfe6a5cadc) ) - - ROM_REGION( 0x0c00000, "ymz", 0 ) /* YMZ280B Samples */ - ROM_LOAD( "rom6.829", 0x000000, 0x400000, CRC(8848b4a0) SHA1(e0dce136c5d5a4c1a92b863e57848cd5927d06f1) ) - ROM_LOAD( "rom7.830", 0x400000, 0x400000, CRC(d6224267) SHA1(5c9b7b13effbef9f707811f84bfe50ca85e605e3) ) - ROM_LOAD( "rom8.831", 0x800000, 0x400000, CRC(a101dfb0) SHA1(4b729b0d562e09df35438e9e6b457b8de2690a6e) ) - - ROM_REGION( 0x200, "eeprom", 0 ) - ROM_LOAD( "eeprom-bbakraid.bin", 0x000, 0x200, CRC(7f97d347) SHA1(3096c399019924dbb7d6673483f6a011f89467c6) ) -ROM_END - - -// dedicated PCB marked Pro Bowl -ROM_START( nprobowl ) - ROM_REGION( 0x200000, "maincpu", 0 ) - ROM_LOAD16_BYTE( "newprobowl-prg0-u021", 0x000000, 0x080000, CRC(3a57f122) SHA1(cc361c295f23bc0479ba49eb15de2ec6ca535a56) ) // 11xxxxxxxxxxxxxxxxx = 0xFF - ROM_LOAD16_BYTE( "newprobowl-prg1-u024", 0x000001, 0x080000, CRC(9e9bb58a) SHA1(3d2159bde418dee5d89e3df9a248b4b1989e6ee9) ) // 11xxxxxxxxxxxxxxxxx = 0xFF - - ROM_REGION( 0x200000, "gp9001_0", 0 ) - ROM_LOAD16_BYTE( "newprobowl-chr1-u0519", 0x000000, 0x80000, CRC(6700a9bf) SHA1(12a72aa0b91119fbbed994aec702a6869af6f287) ) - ROM_LOAD16_BYTE( "newprobowl-chr0-u0518", 0x000001, 0x80000, CRC(0736cccd) SHA1(5a4b691be1df697fef3847456c0f4bb3466c403f) ) - ROM_LOAD16_BYTE( "newprobowl-chr2-u0520", 0x100000, 0x80000, CRC(e5f6d0b6) SHA1(6e1a4792698be4b478118e8c82edb0cf3e2286f2) ) - ROM_LOAD16_BYTE( "newprobowl-chr3-u0521", 0x100001, 0x80000, CRC(00c21951) SHA1(922abde172fb82b504dce41b95227740f16208a7) ) - - ROM_REGION( 0x100000, "oki1", 0 ) - ROM_LOAD( "newprobowl-adpcm0-u0834", 0x00000, 0x80000, CRC(3b40b161) SHA1(ff8ba38dd7e0dadbf72810470e3d9afb1cd983d2) ) - ROM_LOAD( "newprobowl-adpcm1-u0835", 0x80000, 0x80000, CRC(8c191e60) SHA1(f81c2849ffc553d921fc680cd50c2997b834c44a) ) -ROM_END - -ROM_START( probowl2 ) // identical to New Pro Bowl but for slight mods to the GFX ROMs to display the different title - ROM_REGION( 0x200000, "maincpu", 0 ) - ROM_LOAD16_BYTE( "probowl2.prg0.u021", 0x000000, 0x080000, CRC(3a57f122) SHA1(cc361c295f23bc0479ba49eb15de2ec6ca535a56) ) // 11xxxxxxxxxxxxxxxxx = 0xFF - ROM_LOAD16_BYTE( "probowl2.prg1.u024", 0x000001, 0x080000, CRC(9e9bb58a) SHA1(3d2159bde418dee5d89e3df9a248b4b1989e6ee9) ) // 11xxxxxxxxxxxxxxxxx = 0xFF - - ROM_REGION( 0x200000, "gp9001_0", 0 ) - ROM_LOAD16_BYTE( "probowl2.chr1.u0519", 0x000000, 0x80000, CRC(66a5c9cd) SHA1(b8edc6a66e3929af2a1399e5fb6fc341b9789136) ) - ROM_LOAD16_BYTE( "probowl2.chr0.u0518", 0x000001, 0x80000, CRC(b4439673) SHA1(5ca19d9c3c3cce9485fb9bd5224f0b14abe07f49) ) - ROM_LOAD16_BYTE( "probowl2.chr2.u0520", 0x100000, 0x80000, CRC(e05be3a0) SHA1(922c6f094358cf3df790063e68d5dd4a32d46b06) ) - ROM_LOAD16_BYTE( "probowl2.chr3.u0521", 0x100001, 0x80000, CRC(55e2565f) SHA1(b6a570b736a9b30e26d2a59b53f218ef5cd6f0f6) ) - - ROM_REGION( 0x100000, "oki1", 0 ) - ROM_LOAD( "probowl2.adpcm0.u0834", 0x00000, 0x80000, CRC(be2fb43f) SHA1(f3f9bc522f4668852b751f291cef0000bb86b779) ) - ROM_LOAD( "probowl2.adpcm1.u0835", 0x80000, 0x80000, CRC(8c191e60) SHA1(f81c2849ffc553d921fc680cd50c2997b834c44a) ) -ROM_END - - -// The following is in order of Toaplan Board/game numbers -// See list at top of file - -// ( YEAR NAME PARENT MACHINE INPUT STATE INIT MONITOR COMPANY FULLNAME FLAGS ) -GAME( 1991, tekipaki, 0, tekipaki, tekipaki, toaplan2_state, empty_init, ROT0, "Toaplan", "Teki Paki", MACHINE_SUPPORTS_SAVE ) -GAME( 1991, tekipakit, tekipaki, tekipaki, tekipaki, toaplan2_state, empty_init, ROT0, "Toaplan", "Teki Paki (location test)", MACHINE_SUPPORTS_SAVE ) - -GAME( 1991, ghox, 0, ghox, ghox, ghox_state, empty_init, ROT270, "Toaplan", "Ghox (spinner)", MACHINE_SUPPORTS_SAVE ) -GAME( 1991, ghoxj, ghox, ghox, ghox, ghox_state, empty_init, ROT270, "Toaplan", "Ghox (joystick)", MACHINE_SUPPORTS_SAVE ) -GAME( 1991, ghoxjo, ghox, ghox, ghoxjo, ghox_state, empty_init, ROT270, "Toaplan", "Ghox (joystick, older)", MACHINE_SUPPORTS_SAVE ) - -GAME( 1992, dogyuun, 0, dogyuun, dogyuun, toaplan2_state, init_dogyuun, ROT270, "Toaplan", "Dogyuun", MACHINE_SUPPORTS_SAVE ) -GAME( 1992, dogyuuna, dogyuun, dogyuun, dogyuuna, toaplan2_state, init_dogyuun, ROT270, "Toaplan", "Dogyuun (older set)", MACHINE_SUPPORTS_SAVE ) -GAME( 1992, dogyuunb, dogyuun, dogyuun, dogyuunt, toaplan2_state, init_dogyuun, ROT270, "Toaplan", "Dogyuun (oldest set)", MACHINE_SUPPORTS_SAVE ) // maybe a newer location test version, instead -GAME( 1992, dogyuunt, dogyuun, dogyuun, dogyuunt, toaplan2_state, init_dogyuun, ROT270, "Toaplan", "Dogyuun (10/9/1992 location test)", MACHINE_SUPPORTS_SAVE ) -GAME( 1992, dogyuunto, dogyuun, dogyuunto, dogyuunt, toaplan2_state, init_vfive, ROT270, "Toaplan", "Dogyuun (8/25/1992 location test)", MACHINE_SUPPORTS_SAVE ) - -GAME( 1993, kbash, 0, kbash, kbash, toaplan2_state, empty_init, ROT0, "Toaplan / Atari", "Knuckle Bash", MACHINE_SUPPORTS_SAVE ) // Atari license shown for some regions. -GAME( 1993, kbashk, kbash, kbash, kbashk, toaplan2_state, empty_init, ROT0, "Toaplan / Taito", "Knuckle Bash (Korean PCB)", MACHINE_SUPPORTS_SAVE ) // Japan region has optional Taito license, maybe the original Japan release? -GAME( 1993, kbashp, kbash, kbash, kbash, toaplan2_state, empty_init, ROT0, "Toaplan / Taito", "Knuckle Bash (location test)", MACHINE_SUPPORTS_SAVE ) - -GAME( 1999, kbash2, 0, kbash2, kbash2, toaplan2_state, empty_init, ROT0, "bootleg", "Knuckle Bash 2 (bootleg)", MACHINE_SUPPORTS_SAVE ) - -GAME( 1992, truxton2, 0, truxton2, truxton2, truxton2_state, empty_init, ROT270, "Toaplan", "Truxton II / Tatsujin Oh", MACHINE_SUPPORTS_SAVE ) - -GAME( 1991, pipibibs, 0, pipibibs, pipibibs, toaplan2_state, empty_init, ROT0, "Toaplan", "Pipi & Bibis / Whoopee!! (Z80 sound cpu, set 1)", MACHINE_SUPPORTS_SAVE ) -GAME( 1991, pipibibsa, pipibibs, pipibibs, pipibibs, toaplan2_state, empty_init, ROT0, "Toaplan", "Pipi & Bibis / Whoopee!! (Z80 sound cpu, set 2)", MACHINE_SUPPORTS_SAVE ) -GAME( 1991, pipibibsp, pipibibs, pipibibs, pipibibsp, toaplan2_state, empty_init, ROT0, "Toaplan", "Pipi & Bibis / Whoopee!! (prototype)", MACHINE_SUPPORTS_SAVE ) -GAME( 1991, whoopee, pipibibs, tekipaki, whoopee, toaplan2_state, empty_init, ROT0, "Toaplan", "Pipi & Bibis / Whoopee!! (Teki Paki hardware)", MACHINE_SUPPORTS_SAVE ) // original Whoopee!! boards have a HD647180 instead of Z80 - -GAME( 1991, pipibibsbl, pipibibs, pipibibsbl, pipibibsbl, toaplan2_state, init_pipibibsbl, ROT0, "bootleg (Ryouta Kikaku)", "Pipi & Bibis / Whoopee!! (Ryouta Kikaku bootleg, encrypted)", MACHINE_SUPPORTS_SAVE ) -GAME( 1991, pipibibsbl2, pipibibs, pipibibsbl, pipibibsbl, toaplan2_state, empty_init, ROT0, "bootleg", "Pipi & Bibis / Whoopee!! (bootleg, decrypted)", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) // different memory map, not scrambled -GAME( 1991, pipibibsbl3, pipibibs, pipibibsbl, pipibibsbl, toaplan2_state, empty_init, ROT0, "bootleg (Ryouta Kikaku)", "Pipi & Bibis / Whoopee!! (Ryouta Kikaku bootleg, decrypted)", MACHINE_SUPPORTS_SAVE ) - -GAME( 1993, enmadaio, 0, enmadaio, enmadaio, toaplan2_state, init_enmadaio, ROT0, "Toaplan / Taito", "Enma Daio (Japan)", 0 ) // TP-031 - -// region is in eeprom (and also requires correct return value from a v25 mapped address??) -GAME( 1992, fixeight, 0, fixeight, fixeight, truxton2_state, init_fixeight, ROT270, "Toaplan", "FixEight (Europe)", MACHINE_SUPPORTS_SAVE ) -GAME( 1992, fixeightk, fixeight, fixeight, fixeight, truxton2_state, init_fixeight, ROT270, "Toaplan", "FixEight (Korea)", MACHINE_SUPPORTS_SAVE ) -GAME( 1992, fixeighth, fixeight, fixeight, fixeight, truxton2_state, init_fixeight, ROT270, "Toaplan", "FixEight (Hong Kong)", MACHINE_SUPPORTS_SAVE ) -GAME( 1992, fixeighttw, fixeight, fixeight, fixeight, truxton2_state, init_fixeight, ROT270, "Toaplan", "FixEight (Taiwan)", MACHINE_SUPPORTS_SAVE ) -GAME( 1992, fixeighta, fixeight, fixeight, fixeight, truxton2_state, init_fixeight, ROT270, "Toaplan", "FixEight (Southeast Asia)", MACHINE_SUPPORTS_SAVE ) -GAME( 1992, fixeightu, fixeight, fixeight, fixeight, truxton2_state, init_fixeight, ROT270, "Toaplan", "FixEight (USA)", MACHINE_SUPPORTS_SAVE ) -GAME( 1992, fixeightj, fixeight, fixeight, fixeight, truxton2_state, init_fixeight, ROT270, "Toaplan", "FixEight - Jigoku no Eiyuu Densetsu (Japan)", MACHINE_SUPPORTS_SAVE ) -GAME( 1992, fixeightt, fixeight, fixeight, fixeight, truxton2_state, init_fixeight, ROT270, "Toaplan (Taito license)", "FixEight (Europe, Taito license)", MACHINE_SUPPORTS_SAVE ) -GAME( 1992, fixeightkt, fixeight, fixeight, fixeight, truxton2_state, init_fixeight, ROT270, "Toaplan (Taito license)", "FixEight (Korea, Taito license)", MACHINE_SUPPORTS_SAVE ) -GAME( 1992, fixeightht, fixeight, fixeight, fixeight, truxton2_state, init_fixeight, ROT270, "Toaplan (Taito license)", "FixEight (Hong Kong, Taito license)", MACHINE_SUPPORTS_SAVE ) -GAME( 1992, fixeighttwt, fixeight, fixeight, fixeight, truxton2_state, init_fixeight, ROT270, "Toaplan (Taito license)", "FixEight (Taiwan, Taito license)", MACHINE_SUPPORTS_SAVE ) -GAME( 1992, fixeightat, fixeight, fixeight, fixeight, truxton2_state, init_fixeight, ROT270, "Toaplan (Taito license)", "FixEight (Southeast Asia, Taito license)", MACHINE_SUPPORTS_SAVE ) -GAME( 1992, fixeightut, fixeight, fixeight, fixeight, truxton2_state, init_fixeight, ROT270, "Toaplan (Taito license)", "FixEight (USA, Taito license)", MACHINE_SUPPORTS_SAVE ) -GAME( 1992, fixeightjt, fixeight, fixeight, fixeight, truxton2_state, init_fixeight, ROT270, "Toaplan (Taito license)", "FixEight - Jigoku no Eiyuu Densetsu (Japan, Taito license)", MACHINE_SUPPORTS_SAVE ) - -GAME( 1992, fixeightbl, fixeight, fixeightbl, fixeightbl, truxton2_state, init_fixeightbl, ROT270, "bootleg", "FixEight (Korea, bootleg)", MACHINE_SUPPORTS_SAVE ) - -GAME( 1992, grindstm, 0, vfive, grindstm, toaplan2_state, init_vfive, ROT270, "Toaplan", "Grind Stormer", MACHINE_SUPPORTS_SAVE ) -GAME( 1992, grindstma, grindstm, vfive, grindstma, toaplan2_state, init_vfive, ROT270, "Toaplan", "Grind Stormer (older set)", MACHINE_SUPPORTS_SAVE ) -GAME( 1993, vfive, grindstm, vfive, vfive, toaplan2_state, init_vfive, ROT270, "Toaplan", "V-Five (Japan)", MACHINE_SUPPORTS_SAVE ) - -GAME( 1993, batsugun, 0, batsugun, batsugun, toaplan2_state, init_dogyuun, ROT270, "Toaplan", "Batsugun", MACHINE_SUPPORTS_SAVE ) -GAME( 1993, batsuguna, batsugun, batsugun, batsugun, toaplan2_state, init_dogyuun, ROT270, "Toaplan", "Batsugun (older, set 1)", MACHINE_SUPPORTS_SAVE ) -GAME( 1993, batsugunc, batsugun, batsugun, batsugun, toaplan2_state, init_dogyuun, ROT270, "Toaplan", "Batsugun (older, set 2)", MACHINE_SUPPORTS_SAVE ) -GAME( 1993, batsugunb, batsugun, batsugun, batsugun, toaplan2_state, init_dogyuun, ROT270, "Toaplan", "Batsugun (Korean PCB)", MACHINE_SUPPORTS_SAVE ) // cheap looking PCB (same 'TP-030' numbering as original) but without Mask ROMs. Still has original customs etc. Jumpers were set to the Korea Unite Trading license, so likely made in Korea, not a bootleg tho. -GAME( 1993, batsugunsp, batsugun, batsugun, batsugun, toaplan2_state, init_dogyuun, ROT270, "Toaplan", "Batsugun - Special Version", MACHINE_SUPPORTS_SAVE ) -GAME( 1993, batsugunbl, batsugun, batsugunbl, batsugunbl, toaplan2_state, init_fixeightbl, ROT270, "Toaplan", "Batsugun (bootleg)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) // needs correct GFX offsets and oki banking fix - -GAME( 1994, pwrkick, 0, pwrkick, pwrkick, pwrkick_state, empty_init, ROT0, "Sunwise", "Power Kick (Japan)", 0 ) -GAME( 1995, burgkids, 0, pwrkick, burgkids, pwrkick_state, empty_init, ROT0, "Sunwise", "Burger Kids (Japan)", 0 ) -GAME( 1995, othldrby, 0, othldrby, othldrby, pwrkick_state, empty_init, ROT0, "Sunwise", "Othello Derby (Japan)", 0 ) - -GAME( 1994, snowbro2, 0, snowbro2, snowbro2, toaplan2_state, empty_init, ROT0, "Hanafram", "Snow Bros. 2 - With New Elves / Otenki Paradise (Hanafram)", MACHINE_SUPPORTS_SAVE ) -GAME( 1994, snowbro2ny, snowbro2, snowbro2, snowbro2, toaplan2_state, empty_init, ROT0, "Nyanko", "Snow Bros. 2 - With New Elves / Otenki Paradise (Nyanko)", MACHINE_SUPPORTS_SAVE ) // not a bootleg, has original parts (the "GP9001 L7A0498 TOA PLAN" IC and the three mask ROMs) -GAME( 1998, snowbro2b, snowbro2, snowbro2, snowbro2, toaplan2_state, empty_init, ROT0, "bootleg", "Snow Bros. 2 - With New Elves / Otenki Paradise (bootleg, set 1)", MACHINE_SUPPORTS_SAVE ) -GAME( 1994, snowbro2b2, snowbro2, snowbro2, snowbro2, toaplan2_state, empty_init, ROT0, "bootleg (Q Elec)", "Snow Bros. 2 - With New Elves / Otenki Paradise (bootleg, set 2)", MACHINE_SUPPORTS_SAVE ) // possibly not a bootleg, has some original parts -GAME( 1994, snowbro2b3, snowbro2, snowbro2b3, snowbro2b3, toaplan2_state, empty_init, ROT0, "bootleg", "Snow Bros. 2 - With New Elves / Otenki Paradise (bootleg, set 3)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) // GFX offsets not 100% correct - -GAME( 1993, sstriker, 0, mahoudai, sstriker, truxton2_state, empty_init, ROT270, "Raizing", "Sorcer Striker", MACHINE_SUPPORTS_SAVE ) // verified on two different PCBs -GAME( 1993, sstrikerk, sstriker, mahoudai, sstrikerk, truxton2_state, empty_init, ROT270, "Raizing (Unite Trading license)", "Sorcer Striker (Korea)", MACHINE_SUPPORTS_SAVE ) // Although the region jumper is functional, it's a Korean board / version -GAME( 1993, mahoudai, sstriker, mahoudai, mahoudai, truxton2_state, empty_init, ROT270, "Raizing (Able license)", "Mahou Daisakusen (Japan)", MACHINE_SUPPORTS_SAVE ) - -GAME( 1994, kingdmgp, 0, shippumd, kingdmgp, truxton2_state, empty_init, ROT270, "Raizing / Eighting", "Kingdom Grandprix", MACHINE_SUPPORTS_SAVE ) // from Korean board, missing letters on credits screen but this is correct -GAME( 1994, shippumd, kingdmgp, shippumd, shippumd, truxton2_state, empty_init, ROT270, "Raizing / Eighting", "Shippu Mahou Daisakusen (Japan)", MACHINE_SUPPORTS_SAVE ) - -GAME( 1996, bgaregga, 0, bgaregga, bgaregga, truxton2_state, init_bgaregga, ROT270, "Raizing / Eighting", "Battle Garegga (Europe / USA / Japan / Asia) (Sat Feb 3 1996)", MACHINE_SUPPORTS_SAVE ) -GAME( 1996, bgareggat, bgaregga, bgaregga, bgaregga, truxton2_state, init_bgaregga, ROT270, "Raizing / Eighting", "Battle Garegga (location test) (Wed Jan 17 1996)", MACHINE_SUPPORTS_SAVE ) -GAME( 1996, bgareggahk, bgaregga, bgaregga, bgareggahk, truxton2_state, init_bgaregga, ROT270, "Raizing / Eighting", "Battle Garegga (Austria / Hong Kong) (Sat Feb 3 1996)", MACHINE_SUPPORTS_SAVE ) -GAME( 1996, bgareggatw, bgaregga, bgaregga, bgareggatw, truxton2_state, init_bgaregga, ROT270, "Raizing / Eighting", "Battle Garegga (Taiwan / Germany) (Thu Feb 1 1996)", MACHINE_SUPPORTS_SAVE ) -GAME( 1996, bgareggak, bgaregga, bgaregga, bgareggak, truxton2_state, init_bgaregga, ROT270, "Raizing / Eighting", "Battle Garegga (Korea / Greece) (Wed Feb 7 1996)", MACHINE_SUPPORTS_SAVE ) -GAME( 1996, bgaregganv, bgaregga, bgaregga, bgareggahk, truxton2_state, init_bgaregga, ROT270, "Raizing / Eighting", "Battle Garegga - New Version (Austria / Hong Kong) (Sat Mar 2 1996)", MACHINE_SUPPORTS_SAVE ) // displays New Version only when set to HK -GAME( 1996, bgareggat2, bgaregga, bgaregga, bgaregga, truxton2_state, init_bgaregga, ROT270, "Raizing / Eighting", "Battle Garegga - Type 2 (Europe / USA / Japan / Asia) (Sat Mar 2 1996)", MACHINE_SUPPORTS_SAVE ) // displays Type 2 only when set to Europe -GAME( 1996, bgareggacn, bgaregga, bgaregga, bgareggacn, truxton2_state, init_bgaregga, ROT270, "Raizing / Eighting", "Battle Garegga - Type 2 (Denmark / China) (Tue Apr 2 1996)", MACHINE_SUPPORTS_SAVE ) // displays Type 2 only when set to Denmark -GAME( 1998, bgareggabl, bgaregga, bgareggabl, bgareggabl, truxton2_state, init_bgaregga, ROT270, "bootleg (Melody)", "1945 Er Dai / 1945 Part-2 (Chinese hack of Battle Garegga)", MACHINE_SUPPORTS_SAVE ) // based on Thu Feb 1 1996 set, Region hardcoded to China -GAME( 1997, bgareggabla, bgaregga, bgareggabl, bgareggabl, truxton2_state, init_bgaregga, ROT270, "bootleg (Melody)", "Leishen Chuan / Thunder Deity Biography (Chinese hack of Battle Garegga)", MACHINE_SUPPORTS_SAVE ) // based on Thu Feb 1 1996 set, Region hardcoded to Asia -GAME( 1996, bgareggablj, bgaregga, bgareggabl, bgareggabl, truxton2_state, init_bgaregga, ROT270, "bootleg", "Battle Garegga (Japan, bootleg) (Sat Feb 3 1996)", MACHINE_SUPPORTS_SAVE ) - -// these are all based on Version B, even if only the Japan version states 'version B' -GAME( 1998, batrider, 0, batrider, batrider, truxton2_state, init_batrider, ROT270, "Raizing / Eighting", "Armed Police Batrider (Europe) (Fri Feb 13 1998)", MACHINE_SUPPORTS_SAVE ) -GAME( 1998, batrideru, batrider, batrider, batrider, truxton2_state, init_batrider, ROT270, "Raizing / Eighting", "Armed Police Batrider (USA) (Fri Feb 13 1998)", MACHINE_SUPPORTS_SAVE ) -GAME( 1998, batriderc, batrider, batrider, batrider, truxton2_state, init_batrider, ROT270, "Raizing / Eighting", "Armed Police Batrider (China) (Fri Feb 13 1998)", MACHINE_SUPPORTS_SAVE ) -GAME( 1998, batriderj, batrider, batrider, batriderj, truxton2_state, init_batrider, ROT270, "Raizing / Eighting", "Armed Police Batrider (Japan, B version) (Fri Feb 13 1998)", MACHINE_SUPPORTS_SAVE ) -GAME( 1998, batriderk, batrider, batrider, batrider, truxton2_state, init_batrider, ROT270, "Raizing / Eighting", "Armed Police Batrider (Korea) (Fri Feb 13 1998)", MACHINE_SUPPORTS_SAVE ) -// older revision of the code -GAME( 1998, batriderja, batrider, batrider, batriderj, truxton2_state, init_batrider, ROT270, "Raizing / Eighting", "Armed Police Batrider (Japan, older version) (Mon Dec 22 1997)", MACHINE_SUPPORTS_SAVE ) -GAME( 1998, batriderhk, batrider, batrider, batrider, truxton2_state, init_batrider, ROT270, "Raizing / Eighting", "Armed Police Batrider (Hong Kong) (Mon Dec 22 1997)", MACHINE_SUPPORTS_SAVE ) -GAME( 1998, batridert, batrider, batrider, batrider, truxton2_state, init_batrider, ROT270, "Raizing / Eighting", "Armed Police Batrider (Taiwan) (Mon Dec 22 1997)", MACHINE_SUPPORTS_SAVE ) - -// Battle Bakraid -// the 'unlimited' version is a newer revision of the code -GAME( 1999, bbakraid, 0, bbakraid, bbakraid, truxton2_state, init_bbakraid, ROT270, "Eighting", "Battle Bakraid - Unlimited Version (USA) (Tue Jun 8 1999)", MACHINE_SUPPORTS_SAVE ) -GAME( 1999, bbakraidc, bbakraid, bbakraid, bbakraid, truxton2_state, init_bbakraid, ROT270, "Eighting", "Battle Bakraid - Unlimited Version (China) (Tue Jun 8 1999)", MACHINE_SUPPORTS_SAVE ) -GAME( 1999, bbakraidj, bbakraid, bbakraid, bbakraid, truxton2_state, init_bbakraid, ROT270, "Eighting", "Battle Bakraid - Unlimited Version (Japan) (Tue Jun 8 1999)", MACHINE_SUPPORTS_SAVE ) -// older revision of the code -GAME( 1999, bbakraidja, bbakraid, bbakraid, bbakraid, truxton2_state, init_bbakraid, ROT270, "Eighting", "Battle Bakraid (Japan) (Wed Apr 7 1999)", MACHINE_SUPPORTS_SAVE ) - -// dedicated PCB -GAME( 1996, nprobowl, 0, nprobowl, nprobowl, truxton2_state, empty_init, ROT0, "Zuck / Able Corp", "New Pro Bowl", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_MECHANICAL | MACHINE_SUPPORTS_SAVE ) // bad GFXs, no sound banking, controls, etc -GAME( 1996, probowl2, nprobowl, nprobowl, nprobowl, truxton2_state, empty_init, ROT0, "Zuck / Able Corp", "Pro Bowl 2", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_MECHANICAL | MACHINE_SUPPORTS_SAVE ) // bad GFXs, no sound banking, controls, etc diff --git a/src/mame/toaplan/toaplan2.h b/src/mame/toaplan/toaplan2.h deleted file mode 100644 index 4b7a5d7f4e1..00000000000 --- a/src/mame/toaplan/toaplan2.h +++ /dev/null @@ -1,307 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Quench, Yochizo, David Haywood -#ifndef MAME_TOAPLAN_TOAPLAN2_H -#define MAME_TOAPLAN_TOAPLAN2_H - -#pragma once - -#include "cpu/m68000/m68000.h" -#include "machine/bankdev.h" -#include "machine/eepromser.h" -#include "machine/gen_latch.h" -#include "machine/ticket.h" -#include "machine/upd4992.h" -#include "gp9001.h" -#include "sound/okim6295.h" -#include "emupal.h" -#include "screen.h" -#include "tilemap.h" - -/**************** Machine stuff ******************/ - -class toaplan2_state : public driver_device -{ -public: - toaplan2_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag) - , m_shared_ram(*this, "shared_ram") - , m_mainram(*this, "mainram") - , m_maincpu(*this, "maincpu") - , m_audiocpu(*this, "audiocpu") - , m_vdp(*this, "gp9001_%u", 0U) - , m_oki(*this, "oki%u", 1U) - , m_eeprom(*this, "eeprom") - , m_gfxdecode(*this, "gfxdecode") - , m_screen(*this, "screen") - , m_palette(*this, "palette") - , m_soundlatch(*this, "soundlatch%u", 1U) - , m_z80_rom(*this, "audiocpu") - , m_oki_rom(*this, "oki%u", 1U) - , m_okibank(*this, "okibank") - { } - - void batsugun(machine_config &config); - void batsugunbl(machine_config &config); - void dogyuun(machine_config &config); - void dogyuunto(machine_config &config); - void enmadaio(machine_config &config); - void kbash(machine_config &config); - void kbash2(machine_config &config); - void pipibibs(machine_config &config); - void pipibibsbl(machine_config &config); - void snowbro2(machine_config &config); - void snowbro2b3(machine_config &config); - void tekipaki(machine_config &config); - void vfive(machine_config &config); - - void init_dogyuun(); - void init_enmadaio(); - void init_fixeightbl(); - void init_pipibibsbl(); - void init_vfive(); - - int c2map_r(); - -protected: - // We encode priority with colour in the tilemaps, so need a larger palette - static constexpr unsigned T2PALETTE_LENGTH = 0x10000; - - optional_shared_ptr m_shared_ram; // 8 bit RAM shared between 68K and sound CPU - optional_shared_ptr m_mainram; - - required_device m_maincpu; - optional_device m_audiocpu; - optional_device_array m_vdp; - optional_device_array m_oki; - optional_device m_eeprom; - optional_device m_gfxdecode; - required_device m_screen; - required_device m_palette; - optional_device_array m_soundlatch; // tekipaki, batrider, bgaregga, batsugun - - optional_region_ptr m_z80_rom; - optional_region_ptr_array m_oki_rom; - optional_memory_bank m_okibank; - - u8 m_sound_reset_bit = 0; /* 0x20 for dogyuun/batsugun, 0x10 for vfive, 0x08 for fixeight */ - - bitmap_ind8 m_custom_priority_bitmap; - bitmap_ind16 m_secondary_render_bitmap; - - u16 video_count_r(); - void coin_w(u8 data); - void coin_sound_reset_w(u8 data); - u8 shared_ram_r(offs_t offset); - void shared_ram_w(offs_t offset, u8 data); - void sound_reset_w(u8 data); - void fixeightbl_oki_bankswitch_w(u8 data); - - template void oki_bankswitch_w(u8 data); - void enmadaio_oki_bank_w(offs_t offset, u16 data, u16 mem_mask = ~0); - - DECLARE_VIDEO_START(toaplan2); - DECLARE_VIDEO_START(batsugunbl); - - // Teki Paki sound - u8 tekipaki_cmdavailable_r(); - - u32 screen_update_toaplan2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - u32 screen_update_dogyuun(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - u32 screen_update_batsugun(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - void screen_vblank(int state); - void cpu_space_fixeightbl_map(address_map &map) ATTR_COLD; - void cpu_space_pipibibsbl_map(address_map &map) ATTR_COLD; - - void toaplan2_reset(int state); - - void batsugun_68k_mem(address_map &map) ATTR_COLD; - void batsugunbl_68k_mem(address_map &map) ATTR_COLD; - void dogyuun_68k_mem(address_map &map) ATTR_COLD; - void dogyuunto_68k_mem(address_map &map) ATTR_COLD; - void dogyuunto_sound_z80_mem(address_map &map) ATTR_COLD; - void enmadaio_68k_mem(address_map &map) ATTR_COLD; - void enmadaio_oki(address_map &map) ATTR_COLD; - void fixeightbl_oki(address_map &map) ATTR_COLD; - void hd647180_io_map(address_map &map) ATTR_COLD; - void kbash2_68k_mem(address_map &map) ATTR_COLD; - void kbash_68k_mem(address_map &map) ATTR_COLD; - void kbash_v25_mem(address_map &map) ATTR_COLD; - void pipibibi_bootleg_68k_mem(address_map &map) ATTR_COLD; - void pipibibs_68k_mem(address_map &map) ATTR_COLD; - void pipibibs_sound_z80_mem(address_map &map) ATTR_COLD; - void snowbro2_68k_mem(address_map &map) ATTR_COLD; - void snowbro2b3_68k_mem(address_map &map) ATTR_COLD; - void tekipaki_68k_mem(address_map &map) ATTR_COLD; - void v25_mem(address_map &map) ATTR_COLD; - void vfive_68k_mem(address_map &map) ATTR_COLD; - void vfive_v25_mem(address_map &map) ATTR_COLD; -}; - -// with paddle -class ghox_state : public toaplan2_state -{ -public: - ghox_state(const machine_config &mconfig, device_type type, const char *tag) - : toaplan2_state(mconfig, type, tag) - , m_io_pad(*this, "PAD%u", 1U) - { } - - void ghox(machine_config &config); - -protected: - virtual void machine_start() override ATTR_COLD; - virtual void machine_reset() override ATTR_COLD; - -private: - required_ioport_array<2> m_io_pad; - - s8 m_old_paddle_h[2] = {0}; - - template u16 ghox_h_analog_r(); - - void ghox_68k_mem(address_map &map) ATTR_COLD; - void ghox_hd647180_mem_map(address_map &map) ATTR_COLD; -}; - -// with text layer -class truxton2_state : public toaplan2_state -{ -public: - truxton2_state(const machine_config &mconfig, device_type type, const char *tag) - : toaplan2_state(mconfig, type, tag) - , m_tx_videoram(*this, "tx_videoram") - , m_tx_lineselect(*this, "tx_lineselect") - , m_tx_linescroll(*this, "tx_linescroll") - , m_tx_gfxram(*this, "tx_gfxram") - , m_dma_space(*this, "dma_space") - , m_audiobank(*this, "audiobank") - , m_raizing_okibank{ - { *this, "raizing_okibank0_%u", 0U }, - { *this, "raizing_okibank1_%u", 0U } } - , m_eepromout(*this, "EEPROMOUT") - { } - - void batrider(machine_config &config); - void bbakraid(machine_config &config); - void bgaregga(machine_config &config); - void bgareggabl(machine_config &config); - void fixeight(machine_config &config); - void fixeightbl(machine_config &config); - void mahoudai(machine_config &config); - void nprobowl(machine_config &config); - void shippumd(machine_config &config); - void truxton2(machine_config &config); - - void init_batrider(); - void init_bbakraid(); - void init_bgaregga(); - void init_fixeight(); - -protected: - virtual void machine_start() override ATTR_COLD; - virtual void device_post_load() override; - -private: - required_shared_ptr m_tx_videoram; - optional_shared_ptr m_tx_lineselect; - optional_shared_ptr m_tx_linescroll; - optional_shared_ptr m_tx_gfxram; - - optional_device m_dma_space; - - optional_memory_bank m_audiobank; - optional_memory_bank_array<8> m_raizing_okibank[2]; - - optional_ioport m_eepromout; - - u8 m_sndirq_line = 0; /* IRQ4 for batrider, IRQ2 for bbakraid */ - u8 m_z80_busreq = 0; - u16 m_gfxrom_bank[8]{}; /* Batrider object bank */ - - tilemap_t *m_tx_tilemap = nullptr; /* Tilemap for extra-text-layer */ - - void shippumd_coin_w(u8 data); - void raizing_z80_bankswitch_w(u8 data); - void raizing_oki_bankswitch_w(offs_t offset, u8 data); - u8 bgaregga_E01D_r(); - u16 batrider_z80_busack_r(); - void batrider_z80_busreq_w(u8 data); - u16 batrider_z80rom_r(offs_t offset); - void batrider_soundlatch_w(u8 data); - void batrider_soundlatch2_w(u8 data); - void batrider_unknown_sound_w(u16 data); - void batrider_clear_sndirq_w(u16 data); - void batrider_sndirq_w(u8 data); - void batrider_clear_nmi_w(u8 data); - u16 bbakraid_eeprom_r(); - void bbakraid_eeprom_w(u8 data); - void tx_videoram_w(offs_t offset, u16 data, u16 mem_mask = ~0); - void tx_linescroll_w(offs_t offset, u16 data, u16 mem_mask = ~0); - void tx_gfxram_w(offs_t offset, u16 data, u16 mem_mask = ~0); - void batrider_tx_gfxram_w(offs_t offset, u16 data, u16 mem_mask = ~0); - void batrider_textdata_dma_w(u16 data); - void batrider_pal_text_dma_w(u16 data); - void batrider_objectbank_w(offs_t offset, u8 data); - void batrider_bank_cb(u8 layer, u32 &code); - - void install_raizing_okibank(int chip); - - TILE_GET_INFO_MEMBER(get_text_tile_info); - DECLARE_MACHINE_RESET(bgaregga); - DECLARE_VIDEO_START(truxton2); - DECLARE_VIDEO_START(fixeightbl); - DECLARE_VIDEO_START(bgaregga); - DECLARE_VIDEO_START(bgareggabl); - DECLARE_VIDEO_START(batrider); - - u32 screen_update_truxton2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - u32 screen_update_bootleg(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - INTERRUPT_GEN_MEMBER(bbakraid_snd_interrupt); - void create_tx_tilemap(int dx = 0, int dx_flipped = 0); - - void batrider_68k_mem(address_map &map) ATTR_COLD; - void batrider_dma_mem(address_map &map) ATTR_COLD; - void batrider_sound_z80_mem(address_map &map) ATTR_COLD; - void batrider_sound_z80_port(address_map &map) ATTR_COLD; - void bbakraid_68k_mem(address_map &map) ATTR_COLD; - void bbakraid_sound_z80_mem(address_map &map) ATTR_COLD; - void bbakraid_sound_z80_port(address_map &map) ATTR_COLD; - void bgaregga_68k_mem(address_map &map) ATTR_COLD; - void bgaregga_sound_z80_mem(address_map &map) ATTR_COLD; - void fixeight_68k_mem(address_map &map) ATTR_COLD; - void fixeight_v25_mem(address_map &map) ATTR_COLD; - void fixeightbl_68k_mem(address_map &map) ATTR_COLD; - void mahoudai_68k_mem(address_map &map) ATTR_COLD; - void nprobowl_68k_mem(address_map &map) ATTR_COLD; - template void raizing_oki(address_map &map) ATTR_COLD; - void raizing_sound_z80_mem(address_map &map) ATTR_COLD; - void shippumd_68k_mem(address_map &map) ATTR_COLD; - void truxton2_68k_mem(address_map &map) ATTR_COLD; -}; - - -// with RTC, hopper -class pwrkick_state : public toaplan2_state -{ -public: - pwrkick_state(const machine_config &mconfig, device_type type, const char *tag) - : toaplan2_state(mconfig, type, tag) - , m_rtc(*this, "rtc") - , m_hopper(*this, "hopper") - { } - - void othldrby(machine_config &config); - void pwrkick(machine_config &config); - -private: - required_device m_rtc; - optional_device m_hopper; - - void pwrkick_coin_w(u8 data); - void pwrkick_coin_lockout_w(u8 data); - - void othldrby_68k_mem(address_map &map) ATTR_COLD; - void pwrkick_68k_mem(address_map &map) ATTR_COLD; -}; - -#endif // MAME_TOAPLAN_TOAPLAN2_H diff --git a/src/mame/toaplan/toaplan2_v.cpp b/src/mame/toaplan/toaplan2_v.cpp deleted file mode 100644 index 51b6b03fbb4..00000000000 --- a/src/mame/toaplan/toaplan2_v.cpp +++ /dev/null @@ -1,404 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Quench, Yochizo, David Haywood -/*************************************************************************** - - Functions to emulate additional video hardware on several Toaplan2 games. - The main video is handled by the GP9001 (see gp9001.cpp) - - Extra-text RAM format - - Truxton 2, Fixeight and Raizing games have an extra-text layer. - - Text RAM format $0000-1FFF (actually its probably $0000-0FFF) - ---- --xx xxxx xxxx = Tile number - xxxx xx-- ---- ---- = Color (0 - 3Fh) + 40h - - Line select / flip $0000-01EF (some games go to $01FF (excess?)) - ---x xxxx xxxx xxxx = Line select for each line - x--- ---- ---- ---- = X flip for each line ??? - - Line scroll $0000-01EF (some games go to $01FF (excess?)) - ---- ---x xxxx xxxx = X scroll for each line - - -***************************************************************************/ - -#include "emu.h" -#include "toaplan2.h" - - -/*************************************************************************** - - Callbacks for the TileMap code - -***************************************************************************/ - -TILE_GET_INFO_MEMBER(truxton2_state::get_text_tile_info) -{ - const u16 attrib = m_tx_videoram[tile_index]; - const u32 tile_number = attrib & 0x3ff; - const u32 color = attrib >> 10; - tileinfo.set(0, - tile_number, - color, - 0); -} - -/*************************************************************************** - - Start the video hardware emulation. - -***************************************************************************/ - - -void truxton2_state::create_tx_tilemap(int dx, int dx_flipped) -{ - m_tx_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(truxton2_state::get_text_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); - - m_tx_tilemap->set_scroll_rows(8*32); /* line scrolling */ - m_tx_tilemap->set_scroll_cols(1); - m_tx_tilemap->set_scrolldx(dx, dx_flipped); - m_tx_tilemap->set_transparent_pen(0); -} - -void truxton2_state::device_post_load() -{ - if (m_tx_gfxram != nullptr) - m_gfxdecode->gfx(0)->mark_all_dirty(); -} - -VIDEO_START_MEMBER(toaplan2_state,toaplan2) -{ - /* our current VDP implementation needs this bitmap to work with */ - m_screen->register_screen_bitmap(m_custom_priority_bitmap); - - if (m_vdp[0] != nullptr) - { - m_secondary_render_bitmap.reset(); - m_vdp[0]->custom_priority_bitmap = &m_custom_priority_bitmap; - } - - if (m_vdp[1] != nullptr) - { - m_screen->register_screen_bitmap(m_secondary_render_bitmap); - m_vdp[1]->custom_priority_bitmap = &m_custom_priority_bitmap; - } -} - -VIDEO_START_MEMBER(truxton2_state,truxton2) -{ - VIDEO_START_CALL_MEMBER(toaplan2); - - /* Create the Text tilemap for this game */ - m_gfxdecode->gfx(0)->set_source(reinterpret_cast(m_tx_gfxram.target())); - - create_tx_tilemap(0x1d5, 0x16a); -} - -VIDEO_START_MEMBER(truxton2_state,fixeightbl) -{ - VIDEO_START_CALL_MEMBER(toaplan2); - - /* Create the Text tilemap for this game */ - create_tx_tilemap(); - - /* This bootleg has additional layer offsets on the VDP */ - m_vdp[0]->set_tm_extra_offsets(0, -0x1d6 - 26, -0x1ef - 15, 0, 0); - m_vdp[0]->set_tm_extra_offsets(1, -0x1d8 - 22, -0x1ef - 15, 0, 0); - m_vdp[0]->set_tm_extra_offsets(2, -0x1da - 18, -0x1ef - 15, 0, 0); - m_vdp[0]->set_sp_extra_offsets(8/*-0x1cc - 64*/, 8/*-0x1ef - 128*/, 0, 0); - - m_vdp[0]->init_scroll_regs(); -} - -VIDEO_START_MEMBER(toaplan2_state, batsugunbl) -{ - VIDEO_START_CALL_MEMBER(toaplan2); - - // This bootleg has additional layer offsets. TODO: further refinement needed - m_vdp[0]->set_tm_extra_offsets(0, 0, 0, 0, 0); - m_vdp[0]->set_tm_extra_offsets(1, 0, 0, 0, 0); - m_vdp[0]->set_tm_extra_offsets(2, 0, 0, 0, 0); - m_vdp[0]->set_sp_extra_offsets(0x37, 0x07, 0, 0); - - m_vdp[1]->set_tm_extra_offsets(0, -0x05, 0x07, 0, 0); - m_vdp[1]->set_tm_extra_offsets(1, -0x05, 0x07, 0, 0); - m_vdp[1]->set_tm_extra_offsets(2, 0, 0, 0, 0); - m_vdp[1]->set_sp_extra_offsets(0x39, 0x12, 0, 0); - - m_vdp[0]->init_scroll_regs(); - m_vdp[1]->init_scroll_regs(); -} - -VIDEO_START_MEMBER(truxton2_state,bgaregga) -{ - VIDEO_START_CALL_MEMBER(toaplan2); - - /* Create the Text tilemap for this game */ - create_tx_tilemap(0x1d4, 0x16b); -} - -VIDEO_START_MEMBER(truxton2_state,bgareggabl) -{ - VIDEO_START_CALL_MEMBER(toaplan2); - - /* Create the Text tilemap for this game */ - create_tx_tilemap(4, 4); -} - -VIDEO_START_MEMBER(truxton2_state,batrider) -{ - VIDEO_START_CALL_MEMBER(toaplan2); - - m_vdp[0]->disable_sprite_buffer(); // disable buffering on this game - - /* Create the Text tilemap for this game */ - m_gfxdecode->gfx(0)->set_source(reinterpret_cast(m_tx_gfxram.target())); - - create_tx_tilemap(0x1d4, 0x16b); - - /* Has special banking */ - save_item(NAME(m_gfxrom_bank)); -} - -void truxton2_state::tx_videoram_w(offs_t offset, u16 data, u16 mem_mask) -{ - COMBINE_DATA(&m_tx_videoram[offset]); - if (offset < 64*32) - m_tx_tilemap->mark_tile_dirty(offset); -} - -void truxton2_state::tx_linescroll_w(offs_t offset, u16 data, u16 mem_mask) -{ - /*** Line-Scroll RAM for Text Layer ***/ - COMBINE_DATA(&m_tx_linescroll[offset]); - - m_tx_tilemap->set_scrollx(offset, m_tx_linescroll[offset]); -} - -void truxton2_state::tx_gfxram_w(offs_t offset, u16 data, u16 mem_mask) -{ - /*** Dynamic GFX decoding for Truxton 2 / FixEight ***/ - - const u16 oldword = m_tx_gfxram[offset]; - - if (oldword != data) - { - COMBINE_DATA(&m_tx_gfxram[offset]); - m_gfxdecode->gfx(0)->mark_dirty(offset/32); - } -} - -void truxton2_state::batrider_tx_gfxram_w(offs_t offset, u16 data, u16 mem_mask) -{ - /*** Dynamic GFX decoding for Batrider / Battle Bakraid ***/ - - const u16 oldword = m_tx_gfxram[offset]; - - if (oldword != data) - { - COMBINE_DATA(&m_tx_gfxram[offset]); - m_gfxdecode->gfx(0)->mark_dirty(offset/16); - } -} - -void truxton2_state::batrider_textdata_dma_w(u16 data) -{ - /*** Dynamic Text GFX decoding for Batrider ***/ - /*** Only done once during start-up ***/ - m_dma_space->set_bank(1); - for (int i = 0; i < (0x8000 >> 1); i++) - { - m_dma_space->write16(i, m_mainram[i]); - } -} - -void truxton2_state::batrider_pal_text_dma_w(u16 data) -{ - // FIXME: In batrider and bbakraid, the text layer and palette RAM - // are probably DMA'd from main RAM by writing here at every vblank, - // rather than being directly accessible to the 68K like the other games - m_dma_space->set_bank(0); - for (int i = 0; i < (0x3400 >> 1); i++) - { - m_dma_space->write16(i, m_mainram[i]); - } -} - -void truxton2_state::batrider_objectbank_w(offs_t offset, u8 data) -{ - data &= 0xf; - if (m_gfxrom_bank[offset] != data) - { - m_gfxrom_bank[offset] = data; - m_vdp[0]->set_dirty(); - } -} - -void truxton2_state::batrider_bank_cb(u8 layer, u32 &code) -{ - code = (m_gfxrom_bank[code >> 15] << 15) | (code & 0x7fff); -} - -// Dogyuun doesn't appear to require fancy mixing? -u32 toaplan2_state::screen_update_dogyuun(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) -{ - bitmap.fill(0, cliprect); - if (m_vdp[1]) - { - m_custom_priority_bitmap.fill(0, cliprect); - m_vdp[1]->render_vdp(bitmap, cliprect); - } - if (m_vdp[0]) - { - m_custom_priority_bitmap.fill(0, cliprect); - m_vdp[0]->render_vdp(bitmap, cliprect); - } - - return 0; -} - - -// renders to 2 bitmaps, and mixes output -u32 toaplan2_state::screen_update_batsugun(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) -{ -// bitmap.fill(0, cliprect); -// gp9001_custom_priority_bitmap->fill(0, cliprect); - - if (m_vdp[0]) - { - bitmap.fill(0, cliprect); - m_custom_priority_bitmap.fill(0, cliprect); - m_vdp[0]->render_vdp(bitmap, cliprect); - } - if (m_vdp[1]) - { - m_secondary_render_bitmap.fill(0, cliprect); - m_custom_priority_bitmap.fill(0, cliprect); - m_vdp[1]->render_vdp(m_secondary_render_bitmap, cliprect); - } - - // key test places in batsugun - // level 2 - the two layers of clouds (will appear under background, or over ships if wrong) - // level 3 - the special effect 'layer' which should be under everything (will appear over background if wrong) - // level 4(?) - the large clouds (will obscure player if wrong) - // high score entry - letters will be missing if wrong - // end credits - various issues if wrong, clouds like level 2 - // - // when implemented based directly on the PAL equation it doesn't work, however, my own equations roughly based - // on that do. - // - - if (m_vdp[0] && m_vdp[1]) - { - for (int y = cliprect.min_y; y <= cliprect.max_y; y++) - { - u16 *const src_vdp0 = &bitmap.pix(y); - u16 const *const src_vdp1 = &m_secondary_render_bitmap.pix(y); - - for (int x = cliprect.min_x; x <= cliprect.max_x; x++) - { - const u16 GPU0_LUTaddr = src_vdp0[x]; - const u16 GPU1_LUTaddr = src_vdp1[x]; - - // these equations is derived from the PAL, but doesn't seem to work? - - const bool COMPARISON = ((GPU0_LUTaddr & 0x0780) > (GPU1_LUTaddr & 0x0780)); - - // note: GPU1_LUTaddr & 0x000f - transparency check for vdp1? (gfx are 4bpp, the low 4 bits of the lookup would be the pixel data value) -#if 0 - int result = - ((GPU0_LUTaddr & 0x0008) & !COMPARISON) - | ((GPU0_LUTaddr & 0x0008) & !(GPU1_LUTaddr & 0x000f)) - | ((GPU0_LUTaddr & 0x0004) & !COMPARISON) - | ((GPU0_LUTaddr & 0x0004) & !(GPU1_LUTaddr & 0x000f)) - | ((GPU0_LUTaddr & 0x0002) & !COMPARISON) - | ((GPU0_LUTaddr & 0x0002) & !(GPU1_LUTaddr & 0x000f)) - | ((GPU0_LUTaddr & 0x0001) & !COMPARISON) - | ((GPU0_LUTaddr & 0x0001) & !(GPU1_LUTaddr & 0x000f)); - - if (result) src_vdp0[x] = GPU0_LUTaddr; - else src_vdp0[x] = GPU1_LUTaddr; -#endif - // this seems to work tho? - if (!(GPU1_LUTaddr & 0x000f)) - { - src_vdp0[x] = GPU0_LUTaddr; - } - else - { - if (!(GPU0_LUTaddr & 0x000f)) - { - src_vdp0[x] = GPU1_LUTaddr; // bg pen - } - else - { - if (COMPARISON) - { - src_vdp0[x] = GPU1_LUTaddr; - } - else - { - src_vdp0[x] = GPU0_LUTaddr; - } - - } - } - } - } - } - - return 0; -} - - -u32 toaplan2_state::screen_update_toaplan2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) -{ - bitmap.fill(0, cliprect); - m_custom_priority_bitmap.fill(0, cliprect); - m_vdp[0]->render_vdp(bitmap, cliprect); - - return 0; -} - - -/* fixeightbl and bgareggabl do not use the lineselect or linescroll tables */ -u32 truxton2_state::screen_update_bootleg(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) -{ - screen_update_toaplan2(screen, bitmap, cliprect); - m_tx_tilemap->draw(screen, bitmap, cliprect, 0); - return 0; -} - - -u32 truxton2_state::screen_update_truxton2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) -{ - screen_update_toaplan2(screen, bitmap, cliprect); - - rectangle clip = cliprect; - - /* it seems likely that flipx can be set per line! */ - /* however, none of the games does it, and emulating it in the */ - /* MAME tilemap system without being ultra slow would be tricky */ - m_tx_tilemap->set_flip(m_tx_lineselect[0] & 0x8000 ? 0 : TILEMAP_FLIPX); - - /* line select is used for 'for use in' and '8ing' screen on bbakraid, 'Raizing' logo on batrider */ - for (int y = cliprect.min_y; y <= cliprect.max_y; y++) - { - clip.min_y = clip.max_y = y; - m_tx_tilemap->set_scrolly(0, m_tx_lineselect[y] - y); - m_tx_tilemap->draw(screen, bitmap, clip, 0); - } - return 0; -} - - -void toaplan2_state::screen_vblank(int state) -{ - // rising edge - if (state) - { - if (m_vdp[0]) m_vdp[0]->screen_eof(); - if (m_vdp[1]) m_vdp[1]->screen_eof(); - } -} diff --git a/src/mame/toaplan/toaplan_coincounter.cpp b/src/mame/toaplan/toaplan_coincounter.cpp new file mode 100644 index 00000000000..c6f5dddf592 --- /dev/null +++ b/src/mame/toaplan/toaplan_coincounter.cpp @@ -0,0 +1,43 @@ +// license:BSD-3-Clause +// copyright-holders:Quench, Yochizo, David Haywood + +#include "emu.h" +#include "toaplan_coincounter.h" + +DEFINE_DEVICE_TYPE(TOAPLAN_COINCOUNTER, toaplan_coincounter_device, "toaplan_coincounter", "Toaplan Coin Counter") + +toaplan_coincounter_device::toaplan_coincounter_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : device_t(mconfig, TOAPLAN_COINCOUNTER, tag, owner, clock) +{ +} + +void toaplan_coincounter_device::device_start() +{ +} + +void toaplan_coincounter_device::device_reset() +{ +} + +void toaplan_coincounter_device::coin_w(u8 data) +{ + /* +----------------+------ Bits 7-5 not used ------+--------------+ */ + /* | Coin Lockout 2 | Coin Lockout 1 | Coin Count 2 | Coin Count 1 | */ + /* | Bit 3 | Bit 2 | Bit 1 | Bit 0 | */ + + if (data & 0x0f) + { + machine().bookkeeping().coin_lockout_w(0, BIT(~data, 2)); + machine().bookkeeping().coin_lockout_w(1, BIT(~data, 3)); + machine().bookkeeping().coin_counter_w(0, BIT( data, 0)); + machine().bookkeeping().coin_counter_w(1, BIT( data, 1)); + } + else + { + machine().bookkeeping().coin_lockout_global_w(1); // Lock all coin slots + } + if (data & 0xf0) + { + logerror("Writing unknown upper bits (%02x) to coin control\n",data); + } +} diff --git a/src/mame/toaplan/toaplan_coincounter.h b/src/mame/toaplan/toaplan_coincounter.h new file mode 100644 index 00000000000..60eaad87f25 --- /dev/null +++ b/src/mame/toaplan/toaplan_coincounter.h @@ -0,0 +1,25 @@ +// license:BSD-3-Clause +// copyright-holders:Quench, Yochizo, David Haywood + +#ifndef MAME_TOAPLAN_TOAPLAN_COINCOUNTER_H +#define MAME_TOAPLAN_TOAPLAN_COINCOUNTER_H + +#pragma once + +class toaplan_coincounter_device : public device_t +{ +public: + toaplan_coincounter_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); + + void coin_w(u8 data); + +protected: + virtual void device_start() override ATTR_COLD; + virtual void device_reset() override ATTR_COLD; + +private: +}; + +DECLARE_DEVICE_TYPE(TOAPLAN_COINCOUNTER, toaplan_coincounter_device) + +#endif // MAME_TOAPLAN_TOAPLAN_COINCOUNTER_H diff --git a/src/mame/toaplan/toaplan_v25_tables.h b/src/mame/toaplan/toaplan_v25_tables.h new file mode 100644 index 00000000000..fcce0870303 --- /dev/null +++ b/src/mame/toaplan/toaplan_v25_tables.h @@ -0,0 +1,179 @@ +// license:BSD-3-Clause +// copyright-holders:Quench, Yochizo, David Haywood + +#ifndef MAME_TOAPLAN_TOAPLAN_V25_TABLES_H +#define MAME_TOAPLAN_TOAPLAN_V25_TABLES_H + +#pragma once + +class toaplan_v25_tables +{ +public: + + ////////////////////////////////////////////////////////////////////////////// + // Table used by dogyuun, kbash, vfive + ////////////////////////////////////////////////////////////////////////////// + + /* probably dogyuun, vfive and kbash use the same decryption table; + those 3 games have been seen with the NITRO905 chip, other alias are + ts002mach for dogyuun, ts004dash for kbash and ts007spy for vfive */ + + static constexpr u8 nitro_decryption_table[256] = { + 0x1b,0x56,0x75,0x88,0x8c,0x06,0x58,0x72, 0x83,0x86,0x36,0x1a,0x5f,0xd3,0x8c,0xe9, /* 00 */ + /* *//* *//* *//* *//* *//* *//* *//* */ /* *//* *//* *//* *//* *//* *//* *//* */ + 0x22,0x0f,0x03,0x2a,0xeb,0x2a,0xf9,0x0f, 0xa4,0xbd,0x75,0xf3,0x4f,0x53,0x8e,0xfe, /* 10 */ + /*W*//*W*//*r*//*W*//*r*//*W*//*W*//*r*/ /*r*//*a*//*r*//*r*//*r*//*W*//*x*//*r*/ + 0x87,0xe8,0xb1,0x8d,0x36,0xb5,0x43,0x73, 0x2a,0x5b,0xf9,0x02,0x24,0x8a,0x03,0x80, /* 20 */ + /*a*//*r*//*r*//*r*//*x*//*r*//*r*//*r*/ /*W*//*r*//*W*//*W*//*a*//*r*//*a*//*r*/ + 0x86,0x8b,0xd1,0x3e,0x8d,0x3e,0x58,0xfb, 0xc3,0x79,0xbd,0xb7,0x8a,0xe8,0x0f,0x81, /* 30 */ + /*a*//*a*//*a*//*a*//*r*//*r*//*a*//*r*/ /*r*//*a*//*a*//*W*//*r*//*r*//*r*//*r*/ + 0xb7,0xd0,0x8b,0xeb,0xff,0xb8,0x90,0x8b, 0x5e,0xa2,0x90,0xc1,0xab,0xb4,0x80,0x59, /* 40 */ + /*r*//*r*//*a*//*r*//*a*//*x*/ /*a*/ /*W*//*W*/ /*r*//*W*//*r*//*a*/ + 0x87,0x72,0xb5,0xbd,0xb0,0x88,0x50,0x0f, 0xfe,0xd2,0xc3,0x90,0x8a,0x90,0xf9,0x75, /* 50 */ + /*W*//*a*//*a*//*r*//*r*//*a*//*a*//*a*/ /*r*//*W*//*r*/ /*r*/ /*W*//*r*/ + 0x1a,0xb3,0x74,0x0a,0x68,0x24,0xbb,0x90, 0x75,0x47,0xfe,0x2c,0xbe,0xc3,0x88,0xd2, /* 60 */ + /*W*//*r*//*a*//*r*//*a*//*a*//*W*/ /*r*//*a*//*r*//*W*//*W*//*a*//*r*//*a*/ + 0x3e,0xc1,0x8c,0x33,0x0f,0x4f,0x8b,0x90, 0xb9,0x1e,0xff,0xa2,0x3e,0x22,0xbe,0x57, /* 70 */ + /*r*//*W*//*r*//*r*//*a*/ /*a*/ /*r*//*r*//*a*//*r*//*a*//*W*//*r*//*a*/ + 0x81,0x3a,0xf6,0x88,0xeb,0xb1,0x89,0x8a, 0x32,0x80,0x0f,0xb1,0x48,0xc3,0x68,0x72, /* 80 */ + /*r*//*r*//*r*//*r*//*a*//*W*//*a*//*r*/ /*r*//*r*//*r*//*a*//*x*//*a*//*a*//*r*/ + 0x53,0x02,0xc0,0x02,0xe8,0xb4,0x74,0xbc, 0x90,0x58,0x0a,0xf3,0x75,0xc6,0x90,0xe8, /* 90 */ + /*a*//*W*//*r*//*W*//*r*//*r*//*r*//*x*/ /*a*//*r*//*r*//*r*//*x*/ /*r*/ + 0x26,0x50,0xfc,0x8c,0x06,0xb1,0xc3,0xd1, 0xeb,0x83,0xa4,0xbf,0x26,0x4b,0x46,0xfe, /* a0 */ + /*r*//*a*//*a*//*r*/ /*a*//*r*//*W*/ /*a*//*r*//*r*//*r*//*r*//*W*//*a*//*r*/ + 0xe2,0x89,0xb3,0x88,0x03,0x56,0x0f,0x38, 0xbb,0x0c,0x90,0x0f,0x07,0x8a,0x8a,0x33, /* b0 */ + /*r*//*a*//*W*//*r*//*a*//*W*//*r*//*W*/ /*W*//*W*/ /*a*//*r*//*r*//*r*//*x*/ + 0xfe,0xf9,0xb1,0xa0,0x45,0x36,0x22,0x5e, 0x8a,0xbe,0xc6,0xea,0x3c,0xb2,0x1e,0xe8, /* c0 */ + /*r*//*W*//*r*//*r*//*r*//*r*//*W*//*r*/ /*r*//*W*//*x*//*x*//*r*//*?*//*r*//*r*/ + 0x90,0xeb,0x55,0xf6,0x8a,0xb0,0x5d,0xc0, 0xbb,0x8d,0xf6,0xd0,0xd1,0x88,0x4d,0x90, /* d0 */ + /*a*//*r*//*r*//*a*//*a*//*r*//*W*/ /*x*//*r*//*r*//*a*//*W*//*r*//*W*/ + 0x51,0x51,0x74,0xbd,0x32,0xd1,0xc6,0xd2, 0x53,0xc7,0xab,0x36,0x50,0xe9,0x33,0xb3, /* e0 */ + /*r*//*a*//*r*//*r*//*r*//*W*/ /*a*/ /*r*//*x*//*r*//*r*//*W*//*a*//*r*//*W*/ + 0x2e,0x05,0x88,0x59,0x74,0x74,0x22,0x8e, 0x8a,0x8a,0x36,0x08,0x0f,0x45,0x90,0x2e, /* f0 */ + /*r*//*W*//*r*//*r*//*a*//*a*//*W*//*x*/ /*r*//*r*//*x*//*a*//*r*//*a*/ /*r*/ + }; + + ////////////////////////////////////////////////////////////////////////////// + // Table used by fixeight + ////////////////////////////////////////////////////////////////////////////// + + /* x = modified to match batsugun 'unencrypted' code - '?' likewise, but not so sure about them */ + /* e = opcodes used in the EEPROM service routine */ + /* this one seems more different to the other tables */ + static constexpr u8 ts001turbo_decryption_table[256] = { + 0x90,0x05,0x57,0x5f,0xfe,0x4f,0xbd,0x36, 0x80,0x8b,0x8a,0x0a,0x89,0x90,0x47,0x80, /* 00 */ + /*r*//*r*//*r*//*r*//*r*//*r*//*r*/ /*r*//*r*//*r*//*r*//*r*/ /*r*//*r*/ + 0x22,0x90,0x90,0x5d,0x81,0x3c,0xb5,0x83, 0x68,0xff,0x75,0x75,0x8d,0x5b,0x8a,0x38, /* 10 */ + /*r*/ /*r*//*r*//*r*//*r*//*r*/ /*r*//*r*//*r*//*r*//*r*//*r*//*r*//*r*/ + 0x8b,0xeb,0xd2,0x0a,0xb4,0xc7,0x46,0xd1, 0x0a,0x53,0xbd,0x77,0x22,0xff,0x1f,0x03, /* 20 */ + /*a*//*r*//*r*//*r*//*r*//*r*//*r*//*r*/ /*r*//*r*//*r*//*e*//*r*//*r*//*?*//*r*/ + 0xfb,0x45,0xc3,0x02,0x90,0x0f,0xa3,0x02, 0x0f,0xb7,0x90,0x24,0xc6,0xeb,0x1b,0x32, /* 30 */ + /*r*//*r*//*r*//*r*/ /*r*//*e*//*r*/ /*r*//*r*/ /*r*//*r*//*r*//*r*//*r*/ + 0x8d,0xb9,0xfe,0x08,0x88,0x90,0x8a,0x8a, 0x75,0x8a,0xbd,0x58,0xfe,0x51,0x1e,0x8b, /* 40 */ + /*r*//*r*//*r*//*r*//*r*/ /*r*//*r*/ /*r*//*r*//*r*//*r*//*r*//*r*//*r*//*r*/ + 0x0f,0x22,0xf6,0x90,0xc3,0x36,0x03,0x8d, 0xbb,0x16,0xbc,0x90,0x0f,0x5e,0xf9,0x2e, /* 50 */ + /*r*//*r*//*r*/ /*r*//*r*//*r*//*r*/ /*r*//*?*//*r*/ /*r*//*r*//*r*//*r*/ + 0x90,0x90,0x59,0x90,0xbb,0x1a,0x0c,0x8d, 0x89,0x72,0x83,0xa4,0xc3,0xb3,0x8b,0xe9, /* 60 */ + /*r*/ /*r*//*r*//*r*//*r*/ /*a*//*r*//*r*//*r*//*r*//*r*//*r*//*r*/ + 0x81,0x43,0xa0,0x2c,0x0f,0x55,0xf3,0x36, 0xb0,0x59,0xe8,0x03,0x26,0xe9,0x22,0xb0, /* 70 */ + /*r*//*r*//*r*//*r*//*r*//*r*//*r*//*r*/ /*r*//*r*//*r*//*r*//*r*//*r*//*r*//*r*/ + 0x90,0x8e,0x24,0x8a,0xd0,0x3e,0xc3,0x3a, 0x90,0x79,0x57,0x16,0x88,0x86,0x24,0x74, /* 80 */ + /*r*//*r*//*r*//*r*//*r*//*r*//*r*/ /*a*//*r*//*r*//*r*//*r*//*r*//*r*/ + 0x33,0xc3,0x53,0xb8,0xab,0x75,0x90,0x90, 0x8e,0xb1,0xe9,0x5d,0xf9,0x02,0x3c,0x90, /* 90 */ + /*x*//*r*//*r*//*r*//*r*//*r*/ /*r*//*r*//*r*//*r*//*r*//*r*//*r*/ + 0x80,0xd3,0x89,0xe8,0x90,0x90,0x2a,0x74, 0x90,0x5f,0xf6,0x88,0x4f,0x56,0x8c,0x03, /* a0 */ + /*r*//*a*//*r*//*r*/ /*r*//*r*/ /*r*//*r*//*r*//*r*//*r*//*r*//*r*/ + 0x47,0xa1,0x88,0x90,0x03,0xfe,0x90,0xfc, 0x2a,0x90,0x33,0x07,0xb1,0x50,0x0f,0x3e, /* b0 */ + /*r*//*e*//*r*/ /*r*//*r*/ /*r*/ /*r*/ /*r*//*r*//*r*//*r*//*r*//*r*/ + 0xbd,0x4d,0xf3,0xbf,0x59,0xd2,0xea,0xc6, 0x2a,0x74,0x72,0xe2,0x3e,0x2e,0x90,0x2e, /* c0 */ + /*r*//*r*//*r*//*r*//*r*//*a*//*x*//*r*/ /*r*//*r*//*r*//*r*//*r*//*r*/ /*r*/ + 0x2e,0x73,0x88,0x72,0x45,0x5d,0xc1,0xb9, 0x32,0x38,0x88,0xc1,0xa0,0x06,0x45,0x90, /* d0 */ + /*r*//*r*//*r*//*r*//*r*//*r*//*r*//*r*/ /*r*//*r*//*r*//*r*//*a*//*r*//*r*/ + 0x90,0x86,0x4b,0x87,0x90,0x8a,0x3b,0xab, 0x33,0xbe,0x90,0x32,0xbd,0xc7,0xb2,0x80, /* e0 */ + /*r*//*r*//*r*/ /*r*//*?*//*r*/ /*r*//*r*/ /*r*//*r*//*r*//*?*//*r*/ + 0x0f,0x75,0xc0,0xb9,0x07,0x74,0x3e,0xa2, 0x8a,0x48,0x3e,0x8d,0xeb,0x90,0xfe,0x90, /* f0 */ + /*r*//*r*//*r*//*r*//*r*//*r*//*r*//*r*/ /*r*//*x*//*r*//*r*//*r*/ /*r*/ + }; + + + ////////////////////////////////////////////////////////////////////////////// + // Table used by DT7 + ////////////////////////////////////////////////////////////////////////////// + + // single byte default-opcode + #define UNKO 0xfc + + // complete guess, wrong, just to get correct opcode size for DASM + #define G_62 0xa0 // very likely wrong (or is it?) + + // some kind of branch, not sure which + // it's used after compares in blocks, sometimes with a 'be' then a 'br' straight after, so it must be a condition that could also fail a be and fall to the br + //#define G_B0 0x74 + #define G_B0 0x79 + //#define G_B0 0x75 + + // 6b @ 73827 + #define G_6B 0x34 // must be a 2 byte operation on al? after an AND, 2nd byte is 0x08 + + // 59 @ 73505 and 7379B (maybe ret?, or di?) + //#define G_59 0xfa + #define G_59 0xc3 + + static constexpr u8 dt7_decryption_table[256] = { + // 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07, 0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f, /* 00 */ + UNKO,0xea,0x8a,0x51,0x8b,UNKO,0x48,0x3c, 0x75,0x50,0x75,0x88,0x03,0x03,UNKO,0x36, + + // 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17, 0x18,0x19,0x1a,0x1b,0x1c,0x1d,0x1e,0x1f, /* 10 */ + 0x8a,0x0f,0x8a,0x3c,0xe2,0xe8,0xc6,0xc7, 0x24,0x4d,0x68,0x3e,0x0c,0x33,0xbb,UNKO, + + // 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27, 0x28,0x29,0x2a,0x2b,0x2c,0x2d,0x2e,0x2f, /* 20 */ + 0xbb,0xc6,0x1f,0x36,0x24,0xeb,0xe8,UNKO, 0x02,0x38,0x0f,0x45,0x8d,0x45,0x36,0xc6, + + // 0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37, 0x38,0x39,0x3a,0x3b,0x3c,0x3d,0x3e,0x3f, /* 30 */ + 0x53,0x8b,0x81,0x22,0xf9,0xbe,0x75,0x55, 0x45,0x51,0x5d,0x3e,0x0f,0x88,0x72,0x74, + + // 0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47, 0x48,0x49,0x4a,0x4b,0x4c,0x4d,0x4e,0x4f, /* 40 */ + 0x1e,0xb7,0x50,0xd0,0xe2,0xb1,0x0a,0xf3, 0xc7,0xff,0x8a,0x75,0x88,0xb5,UNKO,0xb3, + + // 0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57, 0x58,0x59,0x5a,0x5b,0x5c,0x5d,0x5e,0x5f, /* 50 */ + 0xc3,0x80,0x53,0x59,0x88,UNKO,0x87,0x45, 0x03,G_59,0x0c,0x36,0x5f,0x16,0x55,UNKO, + + // 0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67, 0x68,0x69,0x6a,0x6b,0x6c,0x6d,0x6e,0x6f, /* 60 */ + 0x0a,UNKO,G_62,0x89,0x88,0x57,0x2e,0xb1, 0x75,0x43,0x3a,G_6B,0x86,0x3a,0x03,0x58, + + // 0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77, 0x78,0x79,0x7a,0x7b,0x7c,0x7d,0x7e,0x7f, /* 70 */ + 0x46,0x33,0xe8,0x0f,0x0f,0xbb,0x59,0xc7, 0x2e,0xc6,0x53,0x3a,0xc0,0xfe,0x02,0x47, + + // 0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87, 0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f, /* 80 */ + 0xa0,0x2c,0xeb,0x24,UNKO,0xc3,0x8a,0x8e, 0x16,0x74,0x8a,0x33,0x4b,0x05,0x89,0x79, + + // 0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97, 0x98,0x99,0x9a,0x9b,0x9c,0x9d,0x9e,0x9f, /* 90 */ + 0xb4,0xd2,0x0f,0xbd,0xfb,0x3e,0x22,0x2a, 0x47,0xfe,0x8a,0xc3,0x03,0x5e,0xb3,0x07, + + // 0xa0,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7, 0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf, /* a0 */ + 0x86,0x1b,0x81,0xf3,0x86,0xe9,0x53,0x74, 0x80,0xab,0xb1,0xc3,0xd0,0x88,0x2e,0xa4, + + // 0xb0,0xb1,0xb2,0xb3,0xb4,0xb5,0xb6,0xb7, 0xb8,0xb9,0xba,0xbb,0xbc,0xbd,0xbe,0xbf, /* b0 */ + G_B0,0x5b,0x87,UNKO,0xc3,0x8c,0xff,0x8a, 0x50,0xeb,0x56,0x0c,UNKO,0xfc,0x83,0x74, + + // 0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7, 0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0xcf, /* c0 */ + 0x26,UNKO,0xfe,0xbd,0x03,0xfe,0xb4,0xfe, 0x06,0xb8,0xc6,UNKO,0x45,0x73,0xb5,0x51, + + // 0xd0,0xd1,0xd2,0xd3,0xd4,0xd5,0xd6,0xd7, 0xd8,0xd9,0xda,0xdb,0xdc,0xdd,0xde,0xdf, /* d0 */ + UNKO,0xa4,0xf9,0xc0,0x5b,0xab,0xf6,UNKO, 0x32,0xd3,0xeb,0xb9,0x73,0x89,0xbd,0x4d, + + // 0xe0,0xe1,0xe2,0xe3,0xe4,0xe5,0xe6,0xe7, 0xe8,0xe9,0xea,0xeb,0xec,0xed,0xee,0xef, /* e0 */ + 0xb8,0xb9,0x74,0x07,0x0a,0xb0,0x4f,0x0f, 0xe8,0x47,0xeb,0x50,0xd1,0xd0,0x5d,0x72, + + // 0xf0,0xf1,0xf2,0xf3,0xf4,0xf5,0xf6,0xf7, 0xf8,0xf9,0xfa,0xfb,0xfc,0xfd,0xfe,0xff, /* f0 */ + 0x2e,0xe2,0xc1,0xe8,0xa2,0x53,0x0f,0x73, 0x3a,0xbf,0xbb,0x46,0x1a,0x3c,0x1a,0xbc, + }; + + #undef UNKO + #undef G_62 + #undef G_B0 + #undef G_6B + #undef G_59 +}; + +#endif // MAME_TOAPLAN_TOAPLAN_V25_TABLES_H diff --git a/src/mame/toaplan/truxton2.cpp b/src/mame/toaplan/truxton2.cpp new file mode 100644 index 00000000000..e2350d30fcd --- /dev/null +++ b/src/mame/toaplan/truxton2.cpp @@ -0,0 +1,382 @@ +// license:BSD-3-Clause +// copyright-holders:Quench, Yochizo, David Haywood + +#include "emu.h" + +#include "gp9001.h" +#include "toaplan_coincounter.h" +#include "toaplipt.h" + +#include "cpu/m68000/m68000.h" +#include "sound/okim6295.h" +#include "sound/ymopm.h" + +#include "emupal.h" +#include "screen.h" +#include "speaker.h" +#include "tilemap.h" + +//#define TRUXTON2_STEREO /* Uncomment to hear truxton2 music in stereo */ + +/* +Name Board No Maker Game name +---------------------------------------------------------------------------- +truxton2 TP-024 Toaplan Truxton 2 / Tatsujin Oh + +truxton2 - Although the truxton2 PCB has only standard JAMMA mono audio output, and uses a YM3014B + mono DAC, the YM2151 music is actually sequenced in stereo. In toaplan2.h, uncomment + "#define TRUXTON2_STEREO" to hear the game's music the way it was originally composed. + Difficulty is much lower when the region is set to Europe or USA than when set to any + Asian region, independent of the "Difficulty" dipswitches. See the code beginning at + 1FE94 (RAM address 1002D6 contains 0 if region is an Asian region, 1 if Europe or USA) + +*/ + +namespace { + +class truxton2_state : public driver_device +{ +public: + truxton2_state(const machine_config &mconfig, device_type type, const char *tag) + : driver_device(mconfig, type, tag) + , m_tx_videoram(*this, "tx_videoram") + , m_tx_lineselect(*this, "tx_lineselect") + , m_tx_linescroll(*this, "tx_linescroll") + , m_tx_gfxram(*this, "tx_gfxram") + , m_maincpu(*this, "maincpu") + , m_vdp(*this, "gp9001") + , m_oki(*this, "oki") + , m_gfxdecode(*this, "gfxdecode") + , m_screen(*this, "screen") + , m_palette(*this, "palette") + { } + + void truxton2(machine_config &config); + +protected: + virtual void video_start() override ATTR_COLD; + + u32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + void create_tx_tilemap(int dx = 0, int dx_flipped = 0); + virtual void device_post_load() override; + + void screen_vblank(int state); + void tx_gfxram_w(offs_t offset, u16 data, u16 mem_mask = ~0); + void truxton2_68k_mem(address_map &map) ATTR_COLD; + + void tx_videoram_w(offs_t offset, u16 data, u16 mem_mask = ~0); + void tx_linescroll_w(offs_t offset, u16 data, u16 mem_mask = ~0); + TILE_GET_INFO_MEMBER(get_text_tile_info); + +private: + tilemap_t *m_tx_tilemap = nullptr; /* Tilemap for extra-text-layer */ + required_shared_ptr m_tx_videoram; + required_shared_ptr m_tx_lineselect; + required_shared_ptr m_tx_linescroll; + required_shared_ptr m_tx_gfxram; + + required_device m_maincpu; + required_device m_vdp; + required_device m_oki; + required_device m_gfxdecode; + required_device m_screen; + required_device m_palette; + bitmap_ind8 m_custom_priority_bitmap; +}; + +/* + Extra-text RAM format + + Truxton 2 (and Fixeight + Raizing games have an extra-text layer) + + Text RAM format $0000-1FFF (actually its probably $0000-0FFF) + ---- --xx xxxx xxxx = Tile number + xxxx xx-- ---- ---- = Color (0 - 3Fh) + 40h + + Line select / flip $0000-01EF (some games go to $01FF (excess?)) + ---x xxxx xxxx xxxx = Line select for each line + x--- ---- ---- ---- = X flip for each line ??? + + Line scroll $0000-01EF (some games go to $01FF (excess?)) + ---- ---x xxxx xxxx = X scroll for each line +*/ + +void truxton2_state::device_post_load() +{ + m_gfxdecode->gfx(0)->mark_all_dirty(); +} + + +TILE_GET_INFO_MEMBER(truxton2_state::get_text_tile_info) +{ + const u16 attrib = m_tx_videoram[tile_index]; + const u32 tile_number = attrib & 0x3ff; + const u32 color = attrib >> 10; + tileinfo.set(0, + tile_number, + color, + 0); +} + +void truxton2_state::tx_videoram_w(offs_t offset, u16 data, u16 mem_mask) +{ + COMBINE_DATA(&m_tx_videoram[offset]); + if (offset < 64*32) + m_tx_tilemap->mark_tile_dirty(offset); +} + +void truxton2_state::tx_linescroll_w(offs_t offset, u16 data, u16 mem_mask) +{ + /*** Line-Scroll RAM for Text Layer ***/ + COMBINE_DATA(&m_tx_linescroll[offset]); + + m_tx_tilemap->set_scrollx(offset, m_tx_linescroll[offset]); +} + + + +void truxton2_state::screen_vblank(int state) +{ + if (state) // rising edge + { + m_vdp->screen_eof(); + } +} + + + +u32 truxton2_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + bitmap.fill(0, cliprect); + m_custom_priority_bitmap.fill(0, cliprect); + m_vdp->render_vdp(bitmap, cliprect); + rectangle clip = cliprect; + + /* it seems likely that flipx can be set per line! */ + /* however, none of the games does it, and emulating it in the */ + /* MAME tilemap system without being ultra slow would be tricky */ + m_tx_tilemap->set_flip(m_tx_lineselect[0] & 0x8000 ? 0 : TILEMAP_FLIPX); + + /* line select is used for 'for use in' and '8ing' screen on bbakraid, 'Raizing' logo on batrider */ + for (int y = cliprect.min_y; y <= cliprect.max_y; y++) + { + clip.min_y = clip.max_y = y; + m_tx_tilemap->set_scrolly(0, m_tx_lineselect[y] - y); + m_tx_tilemap->draw(screen, bitmap, clip, 0); + } + return 0; +} + +void truxton2_state::create_tx_tilemap(int dx, int dx_flipped) +{ + m_tx_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(truxton2_state::get_text_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); + + m_tx_tilemap->set_scroll_rows(8*32); /* line scrolling */ + m_tx_tilemap->set_scroll_cols(1); + m_tx_tilemap->set_scrolldx(dx, dx_flipped); + m_tx_tilemap->set_transparent_pen(0); +} + +void truxton2_state::tx_gfxram_w(offs_t offset, u16 data, u16 mem_mask) +{ + const u16 oldword = m_tx_gfxram[offset]; + if (oldword != data) + { + COMBINE_DATA(&m_tx_gfxram[offset]); + m_gfxdecode->gfx(0)->mark_dirty(offset/32); + } +} + +void truxton2_state::video_start() +{ + m_screen->register_screen_bitmap(m_custom_priority_bitmap); + m_vdp->custom_priority_bitmap = &m_custom_priority_bitmap; + + m_gfxdecode->gfx(0)->set_source(reinterpret_cast(m_tx_gfxram.target())); + create_tx_tilemap(0x1d5, 0x16a); +} + + +static INPUT_PORTS_START( base ) + PORT_START("IN1") + TOAPLAN_JOY_UDLR_3_BUTTONS( 1 ) + + PORT_START("IN2") + TOAPLAN_JOY_UDLR_3_BUTTONS( 2 ) + + PORT_START("SYS") + PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_SERVICE1 ) + PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_TILT ) + TOAPLAN_TEST_SWITCH( 0x04, IP_ACTIVE_HIGH ) + PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_COIN1 ) + PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_COIN2 ) + PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_START1 ) + PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_START2 ) + PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_UNKNOWN ) + + PORT_START("DSWA") + TOAPLAN_MACHINE_NO_COCKTAIL_LOC(SW1) + // Coinage on bit mask 0x00f0 + PORT_BIT( 0x00f0, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // Modified below + + PORT_START("DSWB") + TOAPLAN_DIFFICULTY_LOC(SW2) + // Per-game features on bit mask 0x00fc + PORT_BIT( 0x00fc, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // Modified below +INPUT_PORTS_END + +static INPUT_PORTS_START( truxton2 ) + PORT_INCLUDE( base ) + + PORT_MODIFY("IN1") + PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Fast Scrolling (Cheat)") + + PORT_MODIFY("DSWA") + PORT_DIPNAME( 0x0001, 0x0000, "Rapid Fire" ) PORT_DIPLOCATION("SW1:!1") + PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + // Various features on bit mask 0x000e - see above + TOAPLAN_COINAGE_DUAL_LOC( JMPR, 0x0f, 0x02, SW1 ) + + PORT_MODIFY("DSWB") + // Difficulty on bit mask 0x0003 - see above + PORT_DIPNAME( 0x000c, 0x0000, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW2:!3,!4") + PORT_DIPSETTING( 0x000c, "200k only" ) + PORT_DIPSETTING( 0x0008, "100k only" ) + PORT_DIPSETTING( 0x0004, "100k and 250k" ) + PORT_DIPSETTING( 0x0000, "70k and 200k" ) + PORT_DIPNAME( 0x0030, 0x0000, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:!5,!6") + PORT_DIPSETTING( 0x0030, "2" ) + PORT_DIPSETTING( 0x0000, "3" ) + PORT_DIPSETTING( 0x0020, "4" ) + PORT_DIPSETTING( 0x0010, "5" ) + PORT_DIPNAME( 0x0040, 0x0000, "Invulnerability (Cheat)" ) PORT_DIPLOCATION("SW2:!7") + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0040, DEF_STR( On ) ) + PORT_DIPNAME( 0x0080, 0x0000, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("SW2:!8") + PORT_DIPSETTING( 0x0080, DEF_STR( No ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( Yes ) ) + + PORT_START("JMPR") + PORT_CONFNAME( 0x000f, 0x0002, DEF_STR( Region ) ) //PORT_CONFLOCATION("JP:!4,!3,!2,!1") + PORT_CONFSETTING( 0x0002, DEF_STR( Europe ) ) + PORT_CONFSETTING( 0x0001, DEF_STR( USA ) ) + PORT_CONFSETTING( 0x0000, DEF_STR( Japan ) ) + PORT_CONFSETTING( 0x0003, DEF_STR( Hong_Kong ) ) + PORT_CONFSETTING( 0x0004, DEF_STR( Korea ) ) + PORT_CONFSETTING( 0x0005, DEF_STR( Taiwan ) ) + PORT_CONFSETTING( 0x0006, "Southeast Asia (Charterfield)" ) + PORT_CONFSETTING( 0x0007, "USA (Romstar, Inc.)" ) + PORT_CONFSETTING( 0x0008, "Hong Kong (Honest Trading Co.)" ) + PORT_CONFSETTING( 0x0009, "Korea (JC Trading Corp.)" ) + PORT_CONFSETTING( 0x000a, "USA (Fabtek)" ) +// PORT_CONFSETTING( 0x000b, DEF_STR( Unused ) ) +// PORT_CONFSETTING( 0x000c, DEF_STR( Unused ) ) +// PORT_CONFSETTING( 0x000d, DEF_STR( Unused ) ) +// PORT_CONFSETTING( 0x000e, DEF_STR( Unused ) ) + PORT_CONFSETTING( 0x000f, "Japan (Taito Corp.)" ) +INPUT_PORTS_END + + +void truxton2_state::truxton2_68k_mem(address_map &map) +{ + map(0x000000, 0x07ffff).rom(); + map(0x100000, 0x10ffff).ram(); + map(0x200000, 0x20000d).rw(m_vdp, FUNC(gp9001vdp_device::read), FUNC(gp9001vdp_device::write)); + map(0x300000, 0x300fff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); + map(0x400000, 0x401fff).ram().w(FUNC(truxton2_state::tx_videoram_w)).share(m_tx_videoram); + map(0x402000, 0x402fff).ram().share(m_tx_lineselect); + map(0x403000, 0x4031ff).ram().w(FUNC(truxton2_state::tx_linescroll_w)).share(m_tx_linescroll); + map(0x403200, 0x403fff).ram(); + map(0x500000, 0x50ffff).ram().w(FUNC(truxton2_state::tx_gfxram_w)).share(m_tx_gfxram); + map(0x600000, 0x600001).r(m_vdp, FUNC(gp9001vdp_device::vdpcount_r)); + map(0x700000, 0x700001).portr("DSWA"); + map(0x700002, 0x700003).portr("DSWB"); + map(0x700004, 0x700005).portr("JMPR"); + map(0x700006, 0x700007).portr("IN1"); + map(0x700008, 0x700009).portr("IN2"); + map(0x70000a, 0x70000b).portr("SYS"); + map(0x700011, 0x700011).rw(m_oki, FUNC(okim6295_device::read), FUNC(okim6295_device::write)); + map(0x700014, 0x700017).rw("ymsnd", FUNC(ym2151_device::read), FUNC(ym2151_device::write)).umask16(0x00ff); + map(0x70001f, 0x70001f).w("coincounter", FUNC(toaplan_coincounter_device::coin_w)); +} + +#define XOR(a) WORD_XOR_LE(a) +#define LOC(x) (x+XOR(0)) + +static const gfx_layout truxton2_tx_tilelayout = +{ + 8,8, /* 8x8 characters */ + 1024, /* 1024 characters */ + 4, /* 4 bits per pixel */ + { STEP4(0,1) }, + { LOC(0)*4, LOC(1)*4, LOC(4)*4, LOC(5)*4, LOC(8)*4, LOC(9)*4, LOC(12)*4, LOC(13)*4 }, + { STEP8(0,8*8) }, + 8*8*8 +}; + + +static GFXDECODE_START( gfx ) + GFXDECODE_ENTRY( nullptr, 0, truxton2_tx_tilelayout, 64*16, 64 ) +GFXDECODE_END + + +void truxton2_state::truxton2(machine_config &config) +{ + /* basic machine hardware */ + M68000(config, m_maincpu, 16_MHz_XTAL); /* verified on pcb */ + m_maincpu->set_addrmap(AS_PROGRAM, &truxton2_state::truxton2_68k_mem); + + TOAPLAN_COINCOUNTER(config, "coincounter", 0); + + /* video hardware */ + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_video_attributes(VIDEO_UPDATE_BEFORE_VBLANK); + m_screen->set_raw(27_MHz_XTAL/4, 432, 0, 320, 262, 0, 240); + m_screen->set_screen_update(FUNC(truxton2_state::screen_update)); + m_screen->screen_vblank().set(FUNC(truxton2_state::screen_vblank)); + m_screen->set_palette(m_palette); + + GFXDECODE(config, m_gfxdecode, m_palette, gfx); + PALETTE(config, m_palette).set_format(palette_device::xBGR_555, gp9001vdp_device::VDP_PALETTE_LENGTH); + + GP9001_VDP(config, m_vdp, 27_MHz_XTAL); + m_vdp->set_palette(m_palette); + m_vdp->vint_out_cb().set_inputline(m_maincpu, M68K_IRQ_2); + + /* sound hardware */ +#ifdef TRUXTON2_STEREO // music data is stereo... + SPEAKER(config, "lspeaker").front_left(); + SPEAKER(config, "rspeaker").front_right(); + + YM2151(config, "ymsnd", 27_MHz_XTAL/8).add_route(0, "lspeaker", 0.5).add_route(1, "rspeaker", 0.5); + + OKIM6295(config, m_oki, 16_MHz_XTAL/4, okim6295_device::PIN7_LOW); + m_oki->add_route(ALL_OUTPUTS, "lspeaker", 0.5); + m_oki->add_route(ALL_OUTPUTS, "rspeaker", 0.5); +#else // ...but the hardware is mono + SPEAKER(config, "mono").front_center(); + + YM2151(config, "ymsnd", 27_MHz_XTAL/8).add_route(ALL_OUTPUTS, "mono", 0.5); // verified on PCB + + OKIM6295(config, m_oki, 16_MHz_XTAL/4, okim6295_device::PIN7_LOW); // verified on PCB + m_oki->add_route(ALL_OUTPUTS, "mono", 0.5); +#endif +} + +ROM_START( truxton2 ) + ROM_REGION( 0x080000, "maincpu", 0 ) /* Main 68K code */ + /* program ROM is byte swapped ! */ + ROM_LOAD16_WORD( "tp024_1.bin", 0x000000, 0x080000, CRC(f5cfe6ee) SHA1(30979888a4cd6500244117748f28386a7e20a169) ) + + ROM_REGION( 0x200000, "gp9001", 0 ) + ROM_LOAD( "tp024_4.bin", 0x000000, 0x100000, CRC(805c449e) SHA1(fdf985344145bd320b88b9b0c25e73066c9b2ada) ) + ROM_LOAD( "tp024_3.bin", 0x100000, 0x100000, CRC(47587164) SHA1(bac493e2d5507286b984957b289c929335d27eaa) ) + + ROM_REGION( 0x80000, "oki", 0 ) /* ADPCM Samples */ + ROM_LOAD( "tp024_2.bin", 0x00000, 0x80000, CRC(f2f6cae4) SHA1(bb4e8c36531bed97ced4696ca12fd40ede2531aa) ) +ROM_END + +} // anonymous namespace + +GAME( 1992, truxton2, 0, truxton2, truxton2, truxton2_state, empty_init, ROT270, "Toaplan", "Truxton II / Tatsujin Oh", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/toaplan/vfive.cpp b/src/mame/toaplan/vfive.cpp new file mode 100644 index 00000000000..da6c9e17697 --- /dev/null +++ b/src/mame/toaplan/vfive.cpp @@ -0,0 +1,349 @@ +// license:BSD-3-Clause +// copyright-holders:Quench, Yochizo, David Haywood + +#include "emu.h" + +#include "gp9001.h" +#include "toaplan_coincounter.h" +#include "toaplan_v25_tables.h" +#include "toaplipt.h" + +#include "cpu/m68000/m68000.h" +#include "cpu/nec/v25.h" +#include "sound/ymopm.h" + +#include "emupal.h" +#include "screen.h" +#include "speaker.h" +#include "tilemap.h" + +/* +Name Board No Maker Game name +---------------------------------------------------------------------------- +grindstm TP-027 Toaplan Grind Stormer (1992) +grindstma TP-027 Toaplan Grind Stormer (1992) (older) +vfive TP-027 Toaplan V-V (V-Five) (1993 - Japan only) + + +grindstm - Code at 20A26 in vfive forces region to Japan. All sets have some NOPs at reset vector, + and the NEC V25 CPU test that the other games do is skipped. Furthermore, all sets have + a broken ROM checksum routine that reads address ranges that don't match the actual + location or size of the ROM, and that has a hack at the end so it always passes. + Normally you would expect to see code like this in a bootleg, but the NOPs and other + oddities are identical among three different sets. +*/ + +namespace { + +class vfive_state : public driver_device +{ +public: + vfive_state(const machine_config &mconfig, device_type type, const char *tag) + : driver_device(mconfig, type, tag) + , m_shared_ram(*this, "shared_ram") + , m_maincpu(*this, "maincpu") + , m_audiocpu(*this, "audiocpu") + , m_vdp(*this, "gp9001") + , m_screen(*this, "screen") + , m_palette(*this, "palette") + , m_coincounter(*this, "coincounter") + { } + void vfive(machine_config &config); + +protected: + virtual void machine_reset() override ATTR_COLD; + virtual void video_start() override ATTR_COLD; + +private: + void vfive_68k_mem(address_map &map) ATTR_COLD; + void vfive_v25_mem(address_map &map) ATTR_COLD; + + u8 shared_ram_r(offs_t offset) { return m_shared_ram[offset]; } + void shared_ram_w(offs_t offset, u8 data) { m_shared_ram[offset] = data; } + void coin_sound_reset_w(u8 data); + void reset_audiocpu(int state); + + u32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + void screen_vblank(int state); + + required_shared_ptr m_shared_ram; // 8 bit RAM shared between 68K and sound CPU + required_device m_maincpu; + required_device m_audiocpu; + required_device m_vdp; + required_device m_screen; + required_device m_palette; + required_device m_coincounter; + bitmap_ind8 m_custom_priority_bitmap; +}; + + +void vfive_state::video_start() +{ + m_screen->register_screen_bitmap(m_custom_priority_bitmap); + m_vdp->custom_priority_bitmap = &m_custom_priority_bitmap; +} + +u32 vfive_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + bitmap.fill(0, cliprect); + m_custom_priority_bitmap.fill(0, cliprect); + m_vdp->render_vdp(bitmap, cliprect); + return 0; +} + +void vfive_state::screen_vblank(int state) +{ + if (state) // rising edge + { + m_vdp->screen_eof(); + } +} + +void vfive_state::reset_audiocpu(int state) +{ + if (state) + coin_sound_reset_w(0); +} + +void vfive_state::machine_reset() +{ + coin_sound_reset_w(0); +} + +void vfive_state::coin_sound_reset_w(u8 data) +{ + m_coincounter->coin_w(data & ~0x10); + m_audiocpu->set_input_line(INPUT_LINE_RESET, (data & 0x10) ? CLEAR_LINE : ASSERT_LINE); +} + +static INPUT_PORTS_START( base ) + PORT_START("IN1") + TOAPLAN_JOY_UDLR_2_BUTTONS( 1 ) + + PORT_START("IN2") + TOAPLAN_JOY_UDLR_2_BUTTONS( 2 ) + + PORT_START("SYS") + PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_SERVICE1 ) + PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_TILT ) + TOAPLAN_TEST_SWITCH( 0x04, IP_ACTIVE_HIGH ) + PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_COIN1 ) + PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_COIN2 ) + PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_START1 ) + PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_START2 ) + PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_UNKNOWN ) + + PORT_START("DSWA") + TOAPLAN_MACHINE_NO_COCKTAIL_LOC(SW1) + // Coinage on bit mask 0x00f0 + PORT_BIT( 0x00f0, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // Modified below + + PORT_START("DSWB") + TOAPLAN_DIFFICULTY_LOC(SW2) + // Per-game features on bit mask 0x00fc + PORT_BIT( 0x00fc, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // Modified below +INPUT_PORTS_END + +static INPUT_PORTS_START( grindstm ) + PORT_INCLUDE( base ) + + PORT_MODIFY("DSWA") + PORT_DIPNAME( 0x0001, 0x0000, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW1:!1") + PORT_DIPSETTING( 0x0000, DEF_STR( Upright ) ) + PORT_DIPSETTING( 0x0001, DEF_STR( Cocktail ) ) + TOAPLAN_COINAGE_DUAL_LOC( JMPR, 0xe0, 0x80, SW1 ) + + PORT_MODIFY("DSWB") + PORT_DIPNAME( 0x000c, 0x0000, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW2:!3,!4") + PORT_DIPSETTING( 0x000c, DEF_STR( None ) ) + PORT_DIPSETTING( 0x0008, "200k only" ) + PORT_DIPSETTING( 0x0000, "300k and 800k" ) + PORT_DIPSETTING( 0x0004, "300k and every 800k" ) + PORT_DIPNAME( 0x0030, 0x0000, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:!5,!6") + PORT_DIPSETTING( 0x0030, "1" ) + PORT_DIPSETTING( 0x0020, "2" ) + PORT_DIPSETTING( 0x0000, "3" ) + PORT_DIPSETTING( 0x0010, "5" ) + PORT_DIPNAME( 0x0040, 0x0000, "Invulnerability (Cheat)" ) PORT_DIPLOCATION("SW2:!7") + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0040, DEF_STR( On ) ) + PORT_DIPNAME( 0x0080, 0x0000, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("SW2:!8") + PORT_DIPSETTING( 0x0080, DEF_STR( No ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( Yes ) ) + + PORT_START("JMPR") + // Code in many places in game tests if region is >= 0xC. Effects on gameplay? + PORT_CONFNAME( 0x00f0, 0x0090, DEF_STR( Region ) ) //PORT_CONFLOCATION("JP:!4,!3,!2,!1") + PORT_CONFSETTING( 0x0090, DEF_STR( Europe ) ) +// PORT_CONFSETTING( 0x0080, DEF_STR( Europe ) ) + PORT_CONFSETTING( 0x00b0, DEF_STR( USA ) ) + PORT_CONFSETTING( 0x00a0, "USA (American Sammy Corporation)" ) + PORT_CONFSETTING( 0x0070, DEF_STR( Southeast_Asia ) ) + PORT_CONFSETTING( 0x0060, "Southeast Asia (Charterfield)" ) + PORT_CONFSETTING( 0x0050, DEF_STR( Taiwan ) ) + PORT_CONFSETTING( 0x0040, "Taiwan (Anomoto International Inc.)" ) + PORT_CONFSETTING( 0x0030, DEF_STR( Hong_Kong ) ) + PORT_CONFSETTING( 0x0020, "Hong Kong (Charterfield)" ) + PORT_CONFSETTING( 0x0010, DEF_STR( Korea ) ) + PORT_CONFSETTING( 0x0000, "Korea (Unite Trading)" ) + PORT_CONFSETTING( 0x00d0, "USA; different?" ) + PORT_CONFSETTING( 0x00c0, "USA (American Sammy Corporation); different?" ) + PORT_CONFSETTING( 0x00e0, "Korea; different?" ) +// PORT_CONFSETTING( 0x00f0, "Korea; different?" ) +INPUT_PORTS_END + +static INPUT_PORTS_START( grindstma ) + PORT_INCLUDE( grindstm ) + + PORT_MODIFY("JMPR") + // Code in many places in game tests if region is >= 0xC. Effects on gameplay? + PORT_CONFNAME( 0x00f0, 0x0090, DEF_STR( Region ) ) //PORT_CONFLOCATION("JP:!4,!3,!2,!1") + PORT_CONFSETTING( 0x0090, DEF_STR( Europe ) ) +// PORT_CONFSETTING( 0x0080, DEF_STR( Europe ) ) + PORT_CONFSETTING( 0x00b0, DEF_STR( USA ) ) + PORT_CONFSETTING( 0x00a0, "USA (Atari Games Corp.)" ) + PORT_CONFSETTING( 0x0070, DEF_STR( Southeast_Asia ) ) + PORT_CONFSETTING( 0x0060, "Southeast Asia (Charterfield)" ) + PORT_CONFSETTING( 0x0050, DEF_STR( Taiwan ) ) +// PORT_CONFSETTING( 0x0040, DEF_STR( Taiwan ) ) + PORT_CONFSETTING( 0x0030, DEF_STR( Hong_Kong ) ) + PORT_CONFSETTING( 0x0020, "Hong Kong (Charterfield)" ) + PORT_CONFSETTING( 0x0010, DEF_STR( Korea ) ) + PORT_CONFSETTING( 0x0000, "Korea (Unite Trading)" ) + PORT_CONFSETTING( 0x00c0, "Korea; different?" ) +// PORT_CONFSETTING( 0x00d0, "Korea; different?" ) +// PORT_CONFSETTING( 0x00e0, "Korea; different?" ) +// PORT_CONFSETTING( 0x00f0, "Korea; different?" ) +INPUT_PORTS_END + +static INPUT_PORTS_START( vfive ) + PORT_INCLUDE( grindstm ) + + PORT_MODIFY("DSWA") + TOAPLAN_COINAGE_JAPAN_LOC(SW1) + + PORT_MODIFY("JMPR") + // Region is forced to Japan in this set. + // Code at $9238 tests bit 7. + // (Actually bit 3, but the V25 shifts the jumper byte before storing it in shared RAM) + // Runs twice near end of stage 1, once when each of the two boss tanks appears. Effect? + // Also, if bit 7 is set and bits 6-5 are clear, service mode wrongly shows European coinage + // (due to code left in from Grind Stormer: see code at $210A4 and lookup table at $211FA) + PORT_CONFNAME( 0x0030, 0x0000, "Copyright" ) //PORT_CONFLOCATION("JP:!4,!3") + PORT_CONFSETTING( 0x0000, "All Rights Reserved" ) +// PORT_CONFSETTING( 0x0010, "All Rights Reserved" ) +// PORT_CONFSETTING( 0x0020, "All Rights Reserved" ) + PORT_CONFSETTING( 0x0030, "Licensed to Taito Corp." ) + PORT_CONFNAME( 0x0040, 0x0000, DEF_STR( Unused ) ) //PORT_CONFLOCATION("JP:!2") + PORT_CONFSETTING( 0x0000, DEF_STR( Off ) ) + PORT_CONFSETTING( 0x0040, DEF_STR( On ) ) + PORT_CONFNAME( 0x0080, 0x0000, DEF_STR( Unknown ) ) //PORT_CONFLOCATION("JP:!1") + PORT_CONFSETTING( 0x0000, DEF_STR( Off ) ) + PORT_CONFSETTING( 0x0080, DEF_STR( On ) ) +INPUT_PORTS_END + +void vfive_state::vfive_68k_mem(address_map &map) +{ + map(0x000000, 0x07ffff).rom(); + map(0x100000, 0x103fff).ram(); +// map(0x200000, 0x20ffff).noprw(); // Read at startup by broken ROM checksum code - see notes + map(0x200010, 0x200011).portr("IN1"); + map(0x200014, 0x200015).portr("IN2"); + map(0x200018, 0x200019).portr("SYS"); + map(0x20001d, 0x20001d).w(FUNC(vfive_state::coin_sound_reset_w)); // Coin count/lock + v25 reset line + map(0x210000, 0x21ffff).rw(FUNC(vfive_state::shared_ram_r), FUNC(vfive_state::shared_ram_w)).umask16(0x00ff); + map(0x300000, 0x30000d).rw(m_vdp, FUNC(gp9001vdp_device::read), FUNC(gp9001vdp_device::write)); + map(0x400000, 0x400fff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); + map(0x700000, 0x700001).r(m_vdp, FUNC(gp9001vdp_device::vdpcount_r)); +} + + +void vfive_state::vfive_v25_mem(address_map &map) +{ + map(0x00000, 0x00001).rw("ymsnd", FUNC(ym2151_device::read), FUNC(ym2151_device::write)); + map(0x80000, 0x87fff).mirror(0x78000).ram().share(m_shared_ram); +} + + +void vfive_state::vfive(machine_config &config) +{ + /* basic machine hardware */ + M68000(config, m_maincpu, 20_MHz_XTAL/2); // verified on PCB + m_maincpu->set_addrmap(AS_PROGRAM, &vfive_state::vfive_68k_mem); + m_maincpu->reset_cb().set(FUNC(vfive_state::reset_audiocpu)); + + v25_device &audiocpu(V25(config, m_audiocpu, 20_MHz_XTAL/2)); // Verified on PCB, NEC V25 type Toaplan mark scratched out + audiocpu.set_addrmap(AS_PROGRAM, &vfive_state::vfive_v25_mem); + audiocpu.set_decryption_table(toaplan_v25_tables::nitro_decryption_table); + audiocpu.pt_in_cb().set_ioport("DSWA").exor(0xff); + audiocpu.p0_in_cb().set_ioport("DSWB").exor(0xff); + audiocpu.p1_in_cb().set_ioport("JMPR").exor(0xff); + audiocpu.p2_out_cb().set_nop(); // bit 0 is FAULT according to kbash schematic + + TOAPLAN_COINCOUNTER(config, m_coincounter, 0); + + /* video hardware */ + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_video_attributes(VIDEO_UPDATE_BEFORE_VBLANK); + m_screen->set_raw(27_MHz_XTAL/4, 432, 0, 320, 262, 0, 240); // verified on PCB + m_screen->set_screen_update(FUNC(vfive_state::screen_update)); + m_screen->screen_vblank().set(FUNC(vfive_state::screen_vblank)); + m_screen->set_palette(m_palette); + + PALETTE(config, m_palette).set_format(palette_device::xBGR_555, gp9001vdp_device::VDP_PALETTE_LENGTH); + + GP9001_VDP(config, m_vdp, 27_MHz_XTAL); + m_vdp->set_palette(m_palette); + m_vdp->vint_out_cb().set_inputline(m_maincpu, M68K_IRQ_4); + + /* sound hardware */ + SPEAKER(config, "mono").front_center(); + + YM2151(config, "ymsnd", 27_MHz_XTAL/8).add_route(ALL_OUTPUTS, "mono", 0.5); // verified on PCB +} + + + +ROM_START( grindstm ) + ROM_REGION( 0x080000, "maincpu", 0 ) /* Main 68K code */ + ROM_LOAD16_WORD_SWAP( "01.bin", 0x000000, 0x080000, CRC(4923f790) SHA1(1c2d66b432d190d0fb6ac7ca0ec0687aea3ccbf4) ) + + /* Secondary CPU is a Toaplan marked chip, (TS-007-Spy TOA PLAN) */ + /* It's a NEC V25 (PLCC94) (encrypted program uploaded by main CPU) */ + + ROM_REGION( 0x200000, "gp9001", 0 ) + ROM_LOAD( "tp027_02.bin", 0x000000, 0x100000, CRC(877b45e8) SHA1(b3ed8d8dbbe51a1919afc55d619d2b6771971493) ) + ROM_LOAD( "tp027_03.bin", 0x100000, 0x100000, CRC(b1fc6362) SHA1(5e97e3cce31be57689d394a50178cda4d80cce5f) ) +ROM_END + + +ROM_START( grindstma ) + ROM_REGION( 0x080000, "maincpu", 0 ) /* Main 68K code */ + ROM_LOAD16_WORD_SWAP( "tp027-01.rom", 0x000000, 0x080000, CRC(8d8c0392) SHA1(824dde274c8bef8a87c54d8ccdda7f0feb8d11e1) ) + + /* Secondary CPU is a Toaplan marked chip, (TS-007-Spy TOA PLAN) */ + /* It's a NEC V25 (PLCC94) (encrypted program uploaded by main CPU) */ + + ROM_REGION( 0x200000, "gp9001", 0 ) + ROM_LOAD( "tp027_02.bin", 0x000000, 0x100000, CRC(877b45e8) SHA1(b3ed8d8dbbe51a1919afc55d619d2b6771971493) ) + ROM_LOAD( "tp027_03.bin", 0x100000, 0x100000, CRC(b1fc6362) SHA1(5e97e3cce31be57689d394a50178cda4d80cce5f) ) +ROM_END + + +ROM_START( vfive ) + ROM_REGION( 0x080000, "maincpu", 0 ) /* Main 68K code */ + ROM_LOAD16_WORD_SWAP( "tp027_01.bin", 0x000000, 0x080000, CRC(731d50f4) SHA1(794255d0a809cda9170f5bac473df9d7f0efdac8) ) + + /* Secondary CPU is a Toaplan marked chip, (TS-007-Spy TOA PLAN) */ + /* It's a NEC V25 (PLCC94) (encrypted program uploaded by main CPU) */ + + ROM_REGION( 0x200000, "gp9001", 0 ) + ROM_LOAD( "tp027_02.bin", 0x000000, 0x100000, CRC(877b45e8) SHA1(b3ed8d8dbbe51a1919afc55d619d2b6771971493) ) + ROM_LOAD( "tp027_03.bin", 0x100000, 0x100000, CRC(b1fc6362) SHA1(5e97e3cce31be57689d394a50178cda4d80cce5f) ) +ROM_END + +} // anonymous namespace + +GAME( 1992, grindstm, 0, vfive, grindstm, vfive_state, empty_init, ROT270, "Toaplan", "Grind Stormer", MACHINE_SUPPORTS_SAVE ) +GAME( 1992, grindstma, grindstm, vfive, grindstma, vfive_state, empty_init, ROT270, "Toaplan", "Grind Stormer (older set)", MACHINE_SUPPORTS_SAVE ) +GAME( 1993, vfive, grindstm, vfive, vfive, vfive_state, empty_init, ROT270, "Toaplan", "V-Five (Japan)", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/upl/mouser.cpp b/src/mame/upl/mouser.cpp index 0ab11da4cb8..a67425da0a8 100644 --- a/src/mame/upl/mouser.cpp +++ b/src/mame/upl/mouser.cpp @@ -119,7 +119,7 @@ void mouser_state::palette(palette_device &palette) const // blue component bit0 = BIT(color_prom[i], 6); bit1 = BIT(color_prom[i], 7); - int const b = 0x4f * bit0 + 0xa8 * bit1; + int const b = 0x52 * bit0 + 0xad * bit1; palette.set_pen_color(i, rgb_t(r, g, b)); } diff --git a/src/mame/venture/suprridr.cpp b/src/mame/venture/suprridr.cpp index 1bb12b10e4e..254b82a34d8 100644 --- a/src/mame/venture/suprridr.cpp +++ b/src/mame/venture/suprridr.cpp @@ -238,7 +238,7 @@ void suprridr_state::palette(palette_device &palette) const // blue component bit0 = BIT(color_prom[i], 6); bit1 = BIT(color_prom[i], 7); - int const b = 0x4f * bit0 + 0xa8 * bit1; + int const b = 0x52 * bit0 + 0xad * bit1; palette.set_pen_color(i, rgb_t(r, g, b)); } diff --git a/src/mame/wing/luckgrln.cpp b/src/mame/wing/luckgrln.cpp index 9860c25914f..bbe42c42118 100644 --- a/src/mame/wing/luckgrln.cpp +++ b/src/mame/wing/luckgrln.cpp @@ -3,9 +3,9 @@ /* Lucky Girl (newer 1991 version on different hardware?) - -- there is an early 'Lucky Girl' which appears to be running on Nichibutsu like hardware. + -- there is an early 'Lucky Girl' which runs on Nichibutsu like hardware. - The program rom extracted from the Z180 also refers to this as Lucky 74.. + The program ROM extracted from the Z180 also refers to this as Lucky 74.. TODO: - sound (what's the sound chip?) @@ -129,7 +129,6 @@ class luckgrln_state : public driver_device memory_share_creator m_palette_ram; output_finder<12> m_lamps; - uint8_t m_nmi_enable; tilemap_t *m_reel_tilemap[4]; uint16_t m_palette_index; @@ -145,7 +144,6 @@ class luckgrln_state : public driver_device uint8_t test_r(); template TILE_GET_INFO_MEMBER(get_reel_tile_info); uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - INTERRUPT_GEN_MEMBER(irq); void _7smash_io(address_map &map) ATTR_COLD; void _7smash_map(address_map &map) ATTR_COLD; @@ -158,8 +156,6 @@ class luckgrln_state : public driver_device void luckgrln_state::machine_start() { m_lamps.resolve(); - - save_item(NAME(m_nmi_enable)); } template @@ -347,15 +343,8 @@ void luckgrln_state::_7smash_map(address_map &map) void luckgrln_state::output_w(uint8_t data) { - data &= 0xc7; - - /* correct? */ - if (data==0x84) - m_nmi_enable = 0; - else if (data==0x85) - m_nmi_enable = 1; - else - printf("output_w unk data %02x\n",data); + if (data & 0x01) + m_maincpu->set_input_line(INPUT_LINE_NMI, CLEAR_LINE); } @@ -845,18 +834,12 @@ static GFXDECODE_START( gfx_luckgrln ) GFXDECODE_ENTRY( "reels", 0, tiles8x32_layout, 0, 64 ) GFXDECODE_END -INTERRUPT_GEN_MEMBER(luckgrln_state::irq) -{ - if(m_nmi_enable) - m_maincpu->pulse_input_line(INPUT_LINE_NMI, attotime::zero); -} - void luckgrln_state::luckgrln(machine_config &config) { - HD647180X(config, m_maincpu, 16000000); + HD647180X(config, m_maincpu, 12_MHz_XTAL); m_maincpu->set_addrmap(AS_PROGRAM, &luckgrln_state::mainmap); m_maincpu->set_addrmap(AS_IO, &luckgrln_state::luckgrln_io); - m_maincpu->set_vblank_int("screen", FUNC(luckgrln_state::irq)); + m_maincpu->set_vblank_int("screen", FUNC(luckgrln_state::nmi_line_assert)); m_maincpu->out_pa_callback().set(FUNC(luckgrln_state::output_w)); hd6845s_device &crtc(HD6845S(config, "crtc", 12_MHz_XTAL / 8)); /* HD6845SP; unknown clock, hand tuned to get ~60 fps */ @@ -939,6 +922,24 @@ ROM_START( luckgrln ) ROM_LOAD( "falcon.6", 0x40000, 0x20000, CRC(bfb02c87) SHA1(1b5ca562ed76eb3f1b4a52d379a6af07e79b6ee5) ) ROM_END +ROM_START( luckstrn ) + ROM_REGION( 0x4000, "maincpu", 0 ) // internal Z180 ROM + ROM_LOAD( "internal_rom", 0x0000, 0x4000, NO_DUMP ) + + ROM_REGION( 0x20000, "rom_data", 0 ) // external data / CPU ROM + ROM_LOAD( "12.t1", 0x00000, 0x20000, CRC(5e7e6a84) SHA1(7d8eb14c7b83b0555ba60065796de7950c612485) ) + + ROM_REGION( 0x60000, "reels", 0 ) + ROM_LOAD( "1.c1", 0x00000, 0x20000, CRC(1fca2f4f) SHA1(e54595e387c3a742ebf777a2c2795c2d64ec166b) ) // 1ST AND 2ND HALF IDENTICAL, half unused, 5bpp + ROM_LOAD( "2.e1", 0x20000, 0x20000, CRC(311a1801) SHA1(ed822dc5b38408221dfbde767abd675c53a766f8) ) + ROM_LOAD( "3.h1", 0x40000, 0x20000, CRC(ae557bbd) SHA1(4b4ddb5fbb36019c4bd0cfab6a229f3ad09ac95a) ) + + ROM_REGION( 0x60000, "gfx2", 0 ) + ROM_LOAD( "4.l1", 0x00000, 0x20000, CRC(00a1b66d) SHA1(107306689032d5a56fc9337e22a447bad4c371e4) ) // half unused, 5bpp + ROM_LOAD( "5.n1", 0x20000, 0x20000, CRC(df29763e) SHA1(5468cccae98aa7e5b141cdb1fc899f418c79f6e7) ) + ROM_LOAD( "6.r1", 0x40000, 0x20000, CRC(16823fb7) SHA1(e62b5fbf7a105df128dd9dd6d45e59f0ffef5bb8) ) +ROM_END + ROM_START( 7smash ) ROM_REGION( 0x20000, "maincpu", ROMREGION_ERASE00 ) ROM_LOAD( "eagle.8", 0x000000, 0x020000, CRC(b115c5d5) SHA1(3f80613886b7f8092ec914c9bfb416078aca82a3) ) @@ -968,4 +969,5 @@ ROM_END // YEAR NAME PARENT MACHINE INPUT CLASS INIT ROT COMPANY FULL NAME FLAGS LAYOUT GAMEL( 1991, luckgrln, 0, luckgrln, luckgrln, luckgrln_state, init_luckgrln, ROT0, "Wing Co., Ltd.", "Lucky Girl (newer Z180 based hardware)", MACHINE_NO_SOUND | MACHINE_SUPPORTS_SAVE, layout_luckgrln ) +GAMEL( 1991, luckstrn, 0, luckgrln, luckgrln, luckgrln_state, init_luckgrln, ROT0, "Wing Co., Ltd.", "Lucky Star (newer Z180 based hardware)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND | MACHINE_SUPPORTS_SAVE, layout_luckgrln ) // missing internal ROM dump GAMEL( 1993, 7smash, 0, _7smash, _7smash, luckgrln_state, empty_init, ROT0, "Sovic", "7 Smash", MACHINE_NO_SOUND | MACHINE_SUPPORTS_SAVE, layout_7smash ) diff --git a/src/mame/wing/lucky74.cpp b/src/mame/wing/lucky74.cpp index d389a33cf55..02fa4355e60 100644 --- a/src/mame/wing/lucky74.cpp +++ b/src/mame/wing/lucky74.cpp @@ -1691,6 +1691,39 @@ ROM_START( lucky74b ) ROM_LOAD( "luckyprom.c7", 0x0500, 0x0100, CRC(e62fd192) SHA1(86a189df2e2ccef6bd2a4e6d969e777fbba8cdf7) ) ROM_END +// PCB is very similar to Lucky 74, but it only has 4 PROMs +// title can be seen in GFX ROMs +ROM_START( lucky88w ) + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "a001.r1", 0x0000, 0x4000, NO_DUMP ) // internal ROM + + ROM_REGION( 0x20000, "fgtiles", 0 ) + ROM_LOAD( "1.e1", 0x00000, 0x8000, CRC(d8f25ced) SHA1(da2570b4f7050a471f4eb409fdf60c1bbc3d0308) ) + ROM_LOAD( "2.f1", 0x08000, 0x8000, CRC(2096aaeb) SHA1(3a9fcedc4c07fc75923a71e8216b69f9b92082a2) ) + ROM_LOAD( "3.h1", 0x10000, 0x8000, CRC(9e49f254) SHA1(14e6bec46fcb83206d0a612081ea92b3ede3e31d) ) + ROM_LOAD( "4.j1", 0x18000, 0x8000, CRC(dcf3d00e) SHA1(b9fca336dc39c93ea9254c027260e35994d56193) ) + + ROM_REGION( 0x10000, "bgtiles", 0 ) + ROM_LOAD( "17.f3", 0x00000, 0x4000, CRC(0b106f4f) SHA1(d2b4f5cc540af2af9c7af87b03b06529ffbdd825) ) // 1ST AND 2ND HALF IDENTICAL + ROM_IGNORE( 0x4000 ) + ROM_LOAD( "16.e3", 0x04000, 0x4000, CRC(2a9bcb30) SHA1(dc847ff021971a76016c9cd1c05d28518339a704) ) // 1ST AND 2ND HALF IDENTICAL + ROM_IGNORE( 0x4000 ) + ROM_LOAD( "18.h3", 0x08000, 0x4000, CRC(fbf2b129) SHA1(df607adaaa943586909c7d966b73398850ed34d3) ) // 1ST AND 2ND HALF IDENTICAL + ROM_IGNORE( 0x4000 ) + ROM_LOAD( "19.j3", 0x0c000, 0x4000, CRC(d2cf3fb1) SHA1(9f58b9b5284ecdfbf7ee63b45ffbc40d323e7382) ) // 1ST AND 2ND HALF IDENTICAL + ROM_IGNORE( 0x4000 ) + + ROM_REGION( 0x20000, "adpcm", 0 ) + ROM_LOAD( "5.l1", 0x00000, 0x10000, CRC(43f72252) SHA1(b0828443b2f03fbfbd84be8b5f6287783e62c19e) ) + ROM_FILL( 0x10000, 0x10000, 0xff ) // empty socket + + ROM_REGION( 0x0600, "proms", ROMREGION_ERASE00 ) // TODO: will need own palette decode + ROM_LOAD( "prom.f6", 0x0000, 0x0100, CRC(cc4d8f01) SHA1(41cb61dc0a84f62948ddc9007c96756880bb8497) ) + ROM_LOAD( "prom.h6", 0x0100, 0x0100, CRC(016fe2f7) SHA1(909f815a61e759fdf998674ee383512ecd8fee65) ) + ROM_LOAD( "prom.j6", 0x0200, 0x0100, CRC(68cf4ac0) SHA1(decc8b092036cfe113435857f8f561d427204554) ) + ROM_LOAD( "prom.k6", 0x0300, 0x0100, CRC(021ee22f) SHA1(79c1f8cceba382b9c7c27a31934a70e9e421780a) ) +ROM_END + /* Exciting Black Jack. @@ -1751,8 +1784,9 @@ ROM_END * Game Drivers * **********************************************/ -// YEAR NAME PARENT MACHINE INPUT STATS INIT ROT COMPANY FULLNAME FLAGS LAYOUT -GAMEL( 1988, lucky74, 0, lucky74, lucky74, lucky74_state, empty_init, ROT0, "Wing Co., Ltd.", "Lucky 74 (bootleg, set 1)", MACHINE_SUPPORTS_SAVE, layout_lucky74 ) -GAMEL( 1988, lucky74a, lucky74, lucky74, lucky74a, lucky74_state, empty_init, ROT0, "Wing Co., Ltd.", "Lucky 74 (bootleg, set 3)", MACHINE_SUPPORTS_SAVE, layout_lucky74 ) -GAMEL( 1988, lucky74b, lucky74, lucky74, lucky74, lucky74_state, empty_init, ROT0, "Wing Co., Ltd.", "Lucky 74 (bootleg, set 2)", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE, layout_lucky74 ) -GAME( 1989, excitbj, 0, lucky74, excitbj, lucky74_state, empty_init, ROT0, "Sega", "Exciting Black Jack", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) +// YEAR NAME PARENT MACHINE INPUT STATS INIT ROT COMPANY FULLNAME FLAGS LAYOUT +GAMEL( 1988, lucky74, 0, lucky74, lucky74, lucky74_state, empty_init, ROT0, "Wing Co., Ltd.", "Lucky 74 (bootleg, set 1)", MACHINE_SUPPORTS_SAVE, layout_lucky74 ) +GAMEL( 1988, lucky74a, lucky74, lucky74, lucky74a, lucky74_state, empty_init, ROT0, "Wing Co., Ltd.", "Lucky 74 (bootleg, set 3)", MACHINE_SUPPORTS_SAVE, layout_lucky74 ) +GAMEL( 1988, lucky74b, lucky74, lucky74, lucky74, lucky74_state, empty_init, ROT0, "Wing Co., Ltd.", "Lucky 74 (bootleg, set 2)", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE, layout_lucky74 ) +GAME( 1988, lucky88w, 0, lucky74, lucky74, lucky74_state, empty_init, ROT0, "Wing Co., Ltd.", "Lucky 88 (Wing)", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) // undumped internal ROM +GAME( 1989, excitbj, 0, lucky74, excitbj, lucky74_state, empty_init, ROT0, "Sega", "Exciting Black Jack", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/wing/superwng.cpp b/src/mame/wing/superwng.cpp index 08e0e7caf3f..fe93c5b9f2f 100644 --- a/src/mame/wing/superwng.cpp +++ b/src/mame/wing/superwng.cpp @@ -223,7 +223,7 @@ void superwng_state::palette(palette_device &palette) const bit0 = BIT(colors[i], 6); bit1 = BIT(colors[i], 7); - int const b = 0x4f * bit0 + 0xa8 * bit1; + int const b = 0x52 * bit0 + 0xad * bit1; palette.set_pen_color(i, rgb_t(r, g, b)); } diff --git a/src/mame/zaccaria/galaxia.cpp b/src/mame/zaccaria/galaxia.cpp new file mode 100644 index 00000000000..2e37bc9221a --- /dev/null +++ b/src/mame/zaccaria/galaxia.cpp @@ -0,0 +1,855 @@ +// license:BSD-3-Clause +// copyright-holders: David Haywood, hap + +/* + +Galaxia by Zaccaria (1979) +Also released in several regions as "Super Galaxians". +Set regions are unknown, so all are currently named Galaxia. + +Taken from an untested board. + +1K byte files were 2708 or equivalent. +512 byte file is a 82S130 PROM. + +This is not a direct pirate of Galaxian as you might think from the name. +The game uses a Signetics 2650A CPU with three 40-pin 2636 chips, which are +responsible for basic sound and some video functions. + +Other than that, the video hardware looks like it's similar to Galaxian +(2 x 2114, 2 x 2101, 2 x EPROM) but there is no attack RAM and the graphics +EPROMS are 2708. The graphics EPROMS do contain Galaxian-like graphics... + +Quick PCB sketch: + ------------------------------------------------------------------------------ + | | + | 13l 13i 13h | + | | + | PROM 11l 11i 11h S2636 S2621 XTAL | +|6-| 14.31818 | + | 10i 10h S2636 | +|5-| | +|--| 8i 8h S2636 S2650A | +|--| | +|--| | + | | +|4-| | +|--| | +|--| | +|--| | + | | +|3-| | +|--| | +|--| | +|--| DSW | + | 3d | +|2-| DSW |-1| + | 1d |--| + | |--| + ------------------------------------------------------------------------------ + +Astro Wars (port of Astro Fighter) is on a stripped down board of Galaxia, +using only one 2636 chip, less RAM, and no PROM. + +HW has many similarities with quasar.cpp / misc/cvs.cpp / zac1b1120.cpp +real hardware video of Astro Wars can be seen here: youtu.be/eSrQFBMeDlM + +-------------------------------------------------------------------------------- + +TODO: +- astrowar resets at the boss fight, very likely a bad bit in one ROM (MT7016) +- verify if extended play dipswitch values are correct for astrowar, and + identify unknown dipswitch +- What are ports 0 and 4 read for in galaxiaa? Is it some sort of protection? + It's also suspicious that they moved IN0 to the main memory map. +- What is port 5 exactly for? If it doesn't return 0xff, collision is disabled, + maybe for testing/debugging? +- Are there other versions of galaxia with different colors? The alternate sets + in MAME took the gfx roms from the 1st dumped version, but there are references + online showing that not all versions look alike. +- support screen raw params, blanking is much like how laserbat hardware does it + and is needed to correct the speed in all machines +- provide accurate sprite/bg sync in astrowar +- improve starfield: density, blink rate, x repeat of 240, and the checkerboard + pattern (fast forward MAME to see) are all correct, the RNG is not right? + It may differ per PCB, not all PCB videos have the same star RNG pattern. +- add sound board emulation (info is in the schematics) +- add support for flip screen + +*/ + +#include "emu.h" + +#include "cpu/s2650/s2650.h" +#include "machine/s2636.h" +#include "sound/dac.h" + +#include "emupal.h" +#include "screen.h" +#include "speaker.h" +#include "tilemap.h" + + +namespace { + +class galaxia_state : public driver_device +{ +public: + galaxia_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), + m_maincpu(*this, "maincpu"), + m_s2636(*this, "s2636_%u", 0U), + m_gfxdecode(*this, "gfxdecode"), + m_screen(*this, "screen"), + m_palette(*this, "palette"), + m_video_ram(*this, "video_ram", 0x400, ENDIANNESS_BIG), + m_color_ram(*this, "color_ram", 0x400, ENDIANNESS_BIG), + m_bullet_ram(*this, "bullet_ram"), + m_ram_view(*this, "video_color_ram_view") + { } + + void galaxia(machine_config &config) ATTR_COLD; + void galaxiaa(machine_config &config) ATTR_COLD; + +protected: + virtual void machine_start() override ATTR_COLD; + virtual void machine_reset() override ATTR_COLD; + virtual void video_start() override ATTR_COLD; + + // max stars is more than it needs to be, to allow experimenting with the star generator + static constexpr u16 MAX_STARS = 0x800; + static constexpr u8 STAR_PEN = 0x18; + + // devices + required_device m_maincpu; + optional_device_array m_s2636; + required_device m_gfxdecode; + required_device m_screen; + required_device m_palette; + + // memory + memory_share_creator m_video_ram; + memory_share_creator m_color_ram; + required_shared_ptr m_bullet_ram; + + memory_view m_ram_view; + + bitmap_ind16 m_temp_bitmap; + tilemap_t *m_bg_tilemap = nullptr; + + u8 m_collision = 0; + bool m_stars_on = false; + u16 m_stars_scroll = 0; + u16 m_total_stars = 0; + + struct star_t + { + u16 x = 0; + u16 y = 0; + u8 color = 0; + }; + star_t m_stars[MAX_STARS]; + + template void video_w(offs_t offset, u8 data); + void galaxia_mem(address_map &map) ATTR_COLD; + void galaxiaa_mem(address_map &map) ATTR_COLD; + void galaxia_io(address_map &map) ATTR_COLD; + void galaxiaa_io(address_map &map) ATTR_COLD; + void galaxia_data(address_map &map) ATTR_COLD; + + TILE_GET_INFO_MEMBER(get_bg_tile_info); + + void stars_palette(palette_device &palette) const ATTR_COLD; + virtual void palette(palette_device &palette) const ATTR_COLD; + void draw_background(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + virtual u32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + + void scroll_stars(int state); + void init_stars() ATTR_COLD; + void update_stars(bitmap_ind16 &bitmap, const rectangle &cliprect); + + void scroll_w(u8 data); + u8 collision_r(); + u8 collision_clear_r(); + void ctrlport_w(u8 data); + void dataport_w(u8 data); +}; + +class astrowar_state : public galaxia_state +{ +public: + astrowar_state(const machine_config &mconfig, device_type type, const char *tag) : + galaxia_state(mconfig, type, tag) + { } + + void astrowar(machine_config &config) ATTR_COLD; + +protected: + virtual void palette(palette_device &palette) const override ATTR_COLD; + virtual u32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) override; + +private: + void astrowar_mem(address_map &map) ATTR_COLD; +}; + + +void galaxia_state::machine_start() +{ + save_item(NAME(m_collision)); + save_item(NAME(m_stars_on)); + save_item(NAME(m_stars_scroll)); +} + +void galaxia_state::machine_reset() +{ + m_collision = 0; + m_stars_on = false; + m_stars_scroll = 0; +} + + + +/******************************************************************************* + Palette +*******************************************************************************/ + +void galaxia_state::stars_palette(palette_device &palette) const +{ + // 6bpp pens for the stars + for (int i = 0; i < 0x40; i++) + { + int b = pal2bit(BIT(i, 1) << 1 | BIT(i, 0)); + int g = pal2bit(BIT(i, 3) << 1 | BIT(i, 2)); + int r = pal2bit(BIT(i, 5) << 1 | BIT(i, 4)); + + palette.set_pen_color(i + STAR_PEN, r, g, b); + } +} + +void galaxia_state::palette(palette_device &palette) const +{ + u8 const *const color_prom = memregion("proms")->base(); + + // background from A5-A8 + for (int i = 0; i < 0x10; i++) + { + int index = bitswap<4>(i, 0, 1, 2, 3) << 5; + u8 data = color_prom[index]; + + palette.set_pen_color(i, pal1bit(BIT(data, 0)), pal1bit(BIT(data, 1)), pal1bit(BIT(data, 2))); + } + + // sprites from A0-A3 + for (int i = 0; i < 8; i++) + { + u8 data = ~color_prom[i] & 7; + palette.set_pen_color(i | 0x10, pal1bit(BIT(data, 2)), pal1bit(BIT(data, 1)), pal1bit(BIT(data, 0))); + } + + stars_palette(palette); +} + +void astrowar_state::palette(palette_device &palette) const +{ + for (int i = 0; i < 8; i++) + { + // background + palette.set_pen_color(i * 2, 0, 0, 0); + palette.set_pen_color(i * 2 + 1, pal1bit(BIT(~i, 2)), pal1bit(BIT(~i, 1)), pal1bit(BIT(~i, 0))); + + // sprites + palette.set_pen_color(i | 0x10, pal1bit(BIT(i, 0)), pal1bit(BIT(i, 1)), pal1bit(BIT(i, 2))); + } + + stars_palette(palette); +} + + + +/******************************************************************************* + Stars +*******************************************************************************/ + +void galaxia_state::init_stars() +{ + u32 generator = 0; + m_total_stars = 0; + + // precalculate the star background + for (int y = 0; y < 272; y++) + { + for (int x = 0; x < 480; x++) + { + generator <<= 1; + generator |= BIT(~generator, 17) ^ BIT(generator, 5); + + // stars are enabled if the shift register output is 0, and bits 1-7 are set + if ((generator & 0x200fe) == 0xfe && m_total_stars != MAX_STARS) + { + m_stars[m_total_stars].x = x; + m_stars[m_total_stars].y = y; + m_stars[m_total_stars].color = generator >> 8 & 0x3f; + + m_total_stars++; + } + } + } +} + +void galaxia_state::update_stars(bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + for (int offs = 0; offs < m_total_stars; offs++) + { + u8 x = ((m_stars[offs].x + m_stars_scroll) >> 1) % 240; + u16 y = m_stars[offs].y; + + if ((BIT(y, 4) ^ BIT(y, 8) ^ BIT(x, 5))) + { + if (cliprect.contains(x, y)) + bitmap.pix(y, x) = STAR_PEN + m_stars[offs].color; + } + } +} + +void galaxia_state::scroll_stars(int state) +{ + if (state) + m_stars_scroll++; + + m_stars_scroll %= 480; +} + + + +/******************************************************************************* + Background +*******************************************************************************/ + +TILE_GET_INFO_MEMBER(galaxia_state::get_bg_tile_info) +{ + u8 code = m_video_ram[tile_index]; // d7 unused for galaxia + u8 color = m_color_ram[tile_index]; // highest bits unused + + tileinfo.set(0, code, color, 0); +} + +void galaxia_state::video_start() +{ + init_stars(); + + m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(galaxia_state::get_bg_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 32, 32); + m_bg_tilemap->set_transparent_pen(0); + m_bg_tilemap->set_scroll_cols(8); + + m_screen->register_screen_bitmap(m_temp_bitmap); +} + +static GFXDECODE_START( gfx_galaxia ) + GFXDECODE_ENTRY( "tiles", 0, gfx_8x8x2_planar, 0, 4 ) +GFXDECODE_END + +static GFXDECODE_START( gfx_astrowar ) + GFXDECODE_ENTRY( "tiles", 0, gfx_8x8x1, 0, 8 ) +GFXDECODE_END + + +void galaxia_state::draw_background(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + bitmap.fill(m_palette->black_pen(), cliprect); + + if (m_stars_on) + update_stars(bitmap, cliprect); + + // tilemap doesn't wrap + rectangle bg_clip = cliprect; + bg_clip.max_y = 32*8-1; + bg_clip &= cliprect; + + m_temp_bitmap.fill(0, cliprect); + m_bg_tilemap->draw(screen, m_temp_bitmap, bg_clip, 0); + copybitmap_trans(bitmap, m_temp_bitmap, 0, 0, 0, 0, cliprect, 0); +} + + + +/******************************************************************************* + Screen Update +*******************************************************************************/ + +u32 galaxia_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + bitmap_ind16 const &s2636_0_bitmap = m_s2636[0]->update(cliprect); + bitmap_ind16 const &s2636_1_bitmap = m_s2636[1]->update(cliprect); + bitmap_ind16 const &s2636_2_bitmap = m_s2636[2]->update(cliprect); + + draw_background(screen, bitmap, cliprect); + + for (int y = cliprect.top(); y <= cliprect.bottom(); y++) + { + for (int x = cliprect.left(); x <= cliprect.right(); x++) + { + int const bullet_pos = (((y < 0x100) ? m_bullet_ram[y] : 0) ^ 0xff) - 8; + bool const bullet = (bullet_pos != 0xff - 8) && (x <= bullet_pos && x > bullet_pos - 4); + bool const background = (m_temp_bitmap.pix(y, x) & 3) != 0; + + // draw bullets + if (bullet) + { + // background vs. bullet collision detection + if (background) m_collision |= 0x80; + + // draw white 1x4-size bullet + bitmap.pix(y, x) = m_palette->white_pen(); + } + + // copy the S2636 images into the main bitmap and check collision + int const pixel0 = s2636_0_bitmap.pix(y, x); + int const pixel1 = s2636_1_bitmap.pix(y, x); + int const pixel2 = s2636_2_bitmap.pix(y, x); + + int const pixel = pixel0 | pixel1 | pixel2; + + if (S2636_IS_PIXEL_DRAWN(pixel)) + { + // S2636 vs. S2636 collision detection + if (S2636_IS_PIXEL_DRAWN(pixel0) && S2636_IS_PIXEL_DRAWN(pixel1)) m_collision |= 0x01; + if (S2636_IS_PIXEL_DRAWN(pixel1) && S2636_IS_PIXEL_DRAWN(pixel2)) m_collision |= 0x02; + if (S2636_IS_PIXEL_DRAWN(pixel2) && S2636_IS_PIXEL_DRAWN(pixel0)) m_collision |= 0x04; + + // S2636 vs. bullet collision detection + if (bullet) m_collision |= 0x08; + + // S2636 vs. background collision detection + if (background) + { + /* bit4 causes problems on 2nd level + if (S2636_IS_PIXEL_DRAWN(pixel0)) m_collision |= 0x10; */ + if (S2636_IS_PIXEL_DRAWN(pixel1)) m_collision |= 0x20; + if (S2636_IS_PIXEL_DRAWN(pixel2)) m_collision |= 0x40; + } + + bitmap.pix(y, x) = S2636_PIXEL_COLOR(pixel) | 0x10; + } + } + } + + return 0; +} + + +u32 astrowar_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + // astrowar has only one S2636 + bitmap_ind16 const &s2636_0_bitmap = m_s2636[0]->update(cliprect); + + draw_background(screen, bitmap, cliprect); + + for (int y = cliprect.top(); y <= cliprect.bottom(); y++) + { + for (int x = cliprect.left(); x <= cliprect.right(); x++) + { + int const bullet_pos = (((y < 0x100) ? m_bullet_ram[y] : 0) ^ 0xff) - 8; + bool const bullet = (bullet_pos != 0xff - 8) && (x <= bullet_pos && x > bullet_pos - 4); + + // draw bullets first + if (bullet) + { + // background vs. bullet collision detection + if (m_temp_bitmap.pix(y, x) & 1) + m_collision |= 0x02; + + // draw white 1x4-size bullet + bitmap.pix(y, x) = m_palette->white_pen(); + } + } + + for (int x = cliprect.left(); x <= cliprect.right(); x++) + { + // NOTE: similar to zac1b1120.cpp, the sprite chip runs at a different frequency than the background generator + // the exact timing ratio is unknown, so we'll have to do with guesswork + float const s_ratio = 256.0f / 196.0f; + + float const sx = x * s_ratio; + if (int(sx + 0.5f) > cliprect.right()) + break; + + // copy the S2636 bitmap into the main bitmap and check collision + int const pixel = s2636_0_bitmap.pix(y, x); + + if (S2636_IS_PIXEL_DRAWN(pixel)) + { + // S2636 vs. background collision detection + if ((m_temp_bitmap.pix(y, int(sx)) | m_temp_bitmap.pix(y, int(sx + 0.5f))) & 1) + m_collision |= 0x01; + + bitmap.pix(y, int(sx)) = S2636_PIXEL_COLOR(pixel) | 0x10; + bitmap.pix(y, int(sx + 0.5f)) = S2636_PIXEL_COLOR(pixel) | 0x10; + } + } + } + + return 0; +} + + + +/******************************************************************************* + I/O +*******************************************************************************/ + +template +void galaxia_state::video_w(offs_t offset, u8 data) +{ + m_bg_tilemap->mark_tile_dirty(offset); + Which ? m_video_ram[offset] = data : m_color_ram[offset] = data; +} + +void galaxia_state::scroll_w(u8 data) +{ + // fixed scrolling area + for (int i = 1; i < 6; i++) + m_bg_tilemap->set_scrolly(i, data); +} + +u8 galaxia_state::collision_r() +{ + return m_collision; +} + +u8 galaxia_state::collision_clear_r() +{ + if (!machine().side_effects_disabled()) + m_collision = 0; + + return 0; +} + +void galaxia_state::ctrlport_w(u8 data) +{ + // d0: triggers on every new credit + // d1: coin counter? if you put a coin in slot A, galaxia constantly + // strobes sets and clears the bit. if you put a coin in slot B + // however, the bit is set and cleared only once. + + // d3: flip screen + //flip_screen_set(BIT(data, 3)); + + // d5: enable stars + m_stars_on = bool(BIT(data, 5)); + + // other bits: unknown +} + +void galaxia_state::dataport_w(u8 data) +{ + // seems to be related to sound board comms +} + + + +/******************************************************************************* + Address Maps +*******************************************************************************/ + +void galaxia_state::galaxia_mem(address_map &map) +{ + map(0x0000, 0x13ff).rom(); + map(0x1400, 0x14ff).mirror(0x6000).ram().share(m_bullet_ram); + map(0x1500, 0x15ff).mirror(0x6000).rw(m_s2636[0], FUNC(s2636_device::read_data), FUNC(s2636_device::write_data)); + map(0x1600, 0x16ff).mirror(0x6000).rw(m_s2636[1], FUNC(s2636_device::read_data), FUNC(s2636_device::write_data)); + map(0x1700, 0x17ff).mirror(0x6000).rw(m_s2636[2], FUNC(s2636_device::read_data), FUNC(s2636_device::write_data)); + map(0x1800, 0x1bff).mirror(0x6000).view(m_ram_view); + m_ram_view[0](0x1800, 0x1bff).ram().w(FUNC(galaxia_state::video_w<0>)).share(m_color_ram); + m_ram_view[1](0x1800, 0x1bff).ram().w(FUNC(galaxia_state::video_w<1>)).share(m_video_ram); + map(0x1c00, 0x1fff).mirror(0x6000).ram(); + map(0x2000, 0x33ff).rom(); +} + +void galaxia_state::galaxiaa_mem(address_map &map) +{ + galaxia_state::galaxia_mem(map); + map(0x7214, 0x7214).portr("IN0"); +} + +void astrowar_state::astrowar_mem(address_map &map) +{ + map(0x0000, 0x13ff).rom(); + map(0x1400, 0x14ff).mirror(0x6000).ram(); + map(0x1500, 0x15ff).mirror(0x6000).rw(m_s2636[0], FUNC(s2636_device::read_data), FUNC(s2636_device::write_data)); + map(0x1800, 0x1bff).mirror(0x6000).view(m_ram_view); + m_ram_view[0](0x1800, 0x1bff).ram().w(FUNC(astrowar_state::video_w<0>)).share(m_color_ram); + m_ram_view[1](0x1800, 0x1bff).ram().w(FUNC(astrowar_state::video_w<1>)).share(m_video_ram); + map(0x1c00, 0x1cff).mirror(0x6000).ram().share(m_bullet_ram); + map(0x2000, 0x33ff).rom(); +} + +void galaxia_state::galaxia_io(address_map &map) +{ + map.global_mask(0x07); + map(0x00, 0x00).w(FUNC(galaxia_state::scroll_w)).portr("IN0"); + map(0x02, 0x02).portr("IN1"); + map(0x05, 0x05).lr8(NAME([] () { return 0xff; })); + map(0x06, 0x06).portr("DSW0"); + map(0x07, 0x07).portr("DSW1"); +} + +void galaxia_state::galaxiaa_io(address_map &map) +{ + galaxia_state::galaxia_io(map); + map(0x00, 0x00).unmapr(); +} + +void galaxia_state::galaxia_data(address_map &map) +{ + map(S2650_CTRL_PORT, S2650_CTRL_PORT).rw(FUNC(galaxia_state::collision_r), FUNC(galaxia_state::ctrlport_w)); + map(S2650_DATA_PORT, S2650_DATA_PORT).rw(FUNC(galaxia_state::collision_clear_r), FUNC(galaxia_state::dataport_w)); +} + + + +/******************************************************************************* + Inputs +*******************************************************************************/ + +static INPUT_PORTS_START( galaxia ) + PORT_START("IN0") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(1) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(1) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) + PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED ) + + PORT_START("IN1") + PORT_BIT( 0x03, IP_ACTIVE_HIGH, IPT_UNKNOWN ) + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_PLAYER(2) + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_PLAYER(2) + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY + PORT_BIT( 0xc0, IP_ACTIVE_HIGH, IPT_UNUSED ) + + PORT_START("DSW0") + PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("3N:7,6") + PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) + PORT_DIPSETTING( 0x01, DEF_STR( 1C_2C ) ) + PORT_DIPSETTING( 0x02, DEF_STR( 1C_3C ) ) + PORT_DIPSETTING( 0x03, DEF_STR( 1C_5C ) ) + PORT_DIPNAME( 0x04, 0x04, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("3N:5") + PORT_DIPSETTING( 0x00, DEF_STR( 2C_1C ) ) + PORT_DIPSETTING( 0x04, DEF_STR( 1C_1C ) ) + PORT_DIPNAME( 0x08, 0x00, DEF_STR( Lives ) ) PORT_DIPLOCATION("3N:4") + PORT_DIPSETTING( 0x00, "3" ) + PORT_DIPSETTING( 0x08, "5" ) + PORT_DIPNAME( 0x30, 0x00, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("3N:3,2") + PORT_DIPSETTING( 0x00, DEF_STR( Easy ) ) + PORT_DIPSETTING( 0x10, DEF_STR( Medium ) ) + PORT_DIPSETTING( 0x20, DEF_STR( Medium ) ) + PORT_DIPSETTING( 0x30, DEF_STR( Hard ) ) + PORT_BIT( 0xc0, IP_ACTIVE_HIGH, IPT_UNUSED ) + + PORT_START("DSW1") + PORT_DIPNAME( 0x01, 0x00, "High Score" ) PORT_DIPLOCATION("2N:7") + PORT_DIPSETTING( 0x00, DEF_STR( Normal ) ) + PORT_DIPSETTING( 0x01, "Random" ) + PORT_DIPNAME( 0x06, 0x00, "Random H.S." ) PORT_DIPLOCATION("2N:6,5") // only if high score is set to random + PORT_DIPSETTING( 0x00, DEF_STR( Low ) ) + PORT_DIPSETTING( 0x02, DEF_STR( Medium ) ) + PORT_DIPSETTING( 0x04, "Medium-High" ) + PORT_DIPSETTING( 0x06, DEF_STR( High ) ) + PORT_DIPNAME( 0x18, 0x10, "Extended Play" ) PORT_DIPLOCATION("2N:4,3") + PORT_DIPSETTING( 0x00, DEF_STR( None ) ) + PORT_DIPSETTING( 0x08, "2500" ) + PORT_DIPSETTING( 0x10, "3500" ) + PORT_DIPSETTING( 0x18, "5500" ) + PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) ) PORT_DIPLOCATION("2N:2") + PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) +INPUT_PORTS_END + +static INPUT_PORTS_START( galaxiaa ) + PORT_INCLUDE( galaxia ) + + PORT_MODIFY("IN0") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 ) + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 ) + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_COIN2 ) PORT_IMPULSE(1) + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_IMPULSE(1) + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2) + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON1 ) + PORT_BIT( 0xc0, IP_ACTIVE_HIGH, IPT_UNUSED ) +INPUT_PORTS_END + + + +/******************************************************************************* + Machine Configs +*******************************************************************************/ + +void galaxia_state::galaxia(machine_config &config) +{ + // basic machine hardware + S2650(config, m_maincpu, 14.318181_MHz_XTAL / 8); + m_maincpu->set_addrmap(AS_PROGRAM, &galaxia_state::galaxia_mem); + m_maincpu->set_addrmap(AS_IO, &galaxia_state::galaxia_io); + m_maincpu->set_addrmap(AS_DATA, &galaxia_state::galaxia_data); + m_maincpu->sense_handler().set("screen", FUNC(screen_device::vblank)); + m_maincpu->flag_handler().set([this] (int state) { m_ram_view.select(state); }); + m_maincpu->intack_handler().set([this]() { m_maincpu->set_input_line(0, CLEAR_LINE); return 0x03; }); + + // video hardware + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_video_attributes(VIDEO_ALWAYS_UPDATE); + m_screen->set_refresh_hz(50); + m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(3500)); + m_screen->set_size(256, 312); + m_screen->set_visarea(0*8, 29*8-1, 0*8, 34*8-1); + m_screen->set_screen_update(FUNC(galaxia_state::screen_update)); + m_screen->set_palette(m_palette); + m_screen->screen_vblank().set_inputline(m_maincpu, 0, ASSERT_LINE); + m_screen->screen_vblank().append(FUNC(galaxia_state::scroll_stars)); + + GFXDECODE(config, m_gfxdecode, m_palette, gfx_galaxia); + PALETTE(config, m_palette, FUNC(galaxia_state::palette), 0x18 + 0x40); + + S2636(config, m_s2636[0], 0); + m_s2636[0]->set_offsets(3, -26); + m_s2636[0]->add_route(ALL_OUTPUTS, "mono", 0.25); + + S2636(config, m_s2636[1], 0); + m_s2636[1]->set_offsets(3, -26); + m_s2636[1]->add_route(ALL_OUTPUTS, "mono", 0.25); + + S2636(config, m_s2636[2], 0); + m_s2636[2]->set_offsets(3, -26); + m_s2636[2]->add_route(ALL_OUTPUTS, "mono", 0.25); + + // sound hardware + SPEAKER(config, "mono").front_center(); +} + +void galaxia_state::galaxiaa(machine_config &config) +{ + galaxia(config); + + // basic machine hardware + m_maincpu->set_addrmap(AS_PROGRAM, &galaxia_state::galaxiaa_mem); + m_maincpu->set_addrmap(AS_IO, &galaxia_state::galaxiaa_io); +} + +void astrowar_state::astrowar(machine_config &config) +{ + galaxia(config); + + // basic machine hardware + m_maincpu->set_addrmap(AS_PROGRAM, &astrowar_state::astrowar_mem); + + // video hardware + GFXDECODE(config.replace(), m_gfxdecode, m_palette, gfx_astrowar); + + m_s2636[0]->set_offsets(3, -8); + config.device_remove("s2636_1"); + config.device_remove("s2636_2"); +} + + + +/******************************************************************************* + ROM Definitions +*******************************************************************************/ + +ROM_START( galaxia ) + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "galaxia.8h", 0x00000, 0x0400, CRC(f3b4ffde) SHA1(15b004e7821bfc145158b1e9435f061c524f6b86) ) + ROM_LOAD( "galaxia.10h", 0x00400, 0x0400, CRC(6d07fdd4) SHA1(d7d4b345a055275d59951788569db370bccd5195) ) + ROM_LOAD( "galaxia.11h", 0x00800, 0x0400, CRC(1520eb3d) SHA1(3683174da701e1124af0f9c2ee4a9a84f3fea33a) ) + ROM_LOAD( "galaxia.13h", 0x00c00, 0x0400, CRC(1d22219b) SHA1(6ab8ea8c78db30d80de98879018726d0420d30fe) ) + ROM_LOAD( "galaxia.8i", 0x01000, 0x0400, CRC(45b88599) SHA1(3b79c21db1aa9d80fac81ac5a554e438805febd1) ) + ROM_LOAD( "galaxia.10i", 0x02000, 0x0400, CRC(76bd9fe3) SHA1(1abc8e40063aaa9140ea5e0341127eb0a7e86c88) ) + ROM_LOAD( "galaxia.11i", 0x02400, 0x0400, CRC(4456808a) SHA1(f9e8cfdde0e17f13f1be297b2b4503ccc959b33c) ) + ROM_LOAD( "galaxia.13i", 0x02800, 0x0400, CRC(cf653b9a) SHA1(fef5943de60cb5ba2459fc6ae7419e29c96a76cd) ) + ROM_LOAD( "galaxia.11l", 0x02c00, 0x0400, CRC(50c6a645) SHA1(46638907bc393df6be25fc7461d73047d1746ffc) ) + ROM_LOAD( "galaxia.13l", 0x03000, 0x0400, CRC(3a9c38c7) SHA1(d1e934092b69c0f3f9636eba05a1d8a6d9588e6b) ) + + ROM_REGION( 0x0800, "tiles", 0 ) + ROM_LOAD( "galaxia.3d", 0x00000, 0x0400, CRC(1dc30185) SHA1(e3c75eecb80b376ece98f602e1b9587487841824) ) // taken from galaxiaa + ROM_LOAD( "galaxia.1d", 0x00400, 0x0400, CRC(2dd50aab) SHA1(758d7a5383c9a1ee134d99e3f7025819cfbe0e0f) ) // taken from galaxiaa + + ROM_REGION( 0x0200, "proms", 0 ) + ROM_LOAD( "prom.11o", 0x0000, 0x0200, CRC(ae816417) SHA1(9497857d13c943a2735c3b85798199054e613b2c) ) // colors + priority +ROM_END + +ROM_START( galaxiaa ) + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "galaxia.8h", 0x00000, 0x0400, CRC(f3b4ffde) SHA1(15b004e7821bfc145158b1e9435f061c524f6b86) ) + ROM_LOAD( "galaxia.10h", 0x00400, 0x0400, CRC(6d07fdd4) SHA1(d7d4b345a055275d59951788569db370bccd5195) ) + ROM_LOAD( "galaxia.11h", 0x00800, 0x0400, CRC(1520eb3d) SHA1(3683174da701e1124af0f9c2ee4a9a84f3fea33a) ) + ROM_LOAD( "galaxia.13h", 0x00c00, 0x0400, CRC(1d22219b) SHA1(6ab8ea8c78db30d80de98879018726d0420d30fe) ) + ROM_LOAD( "galaxia.8i", 0x01000, 0x0400, CRC(45b88599) SHA1(3b79c21db1aa9d80fac81ac5a554e438805febd1) ) + ROM_LOAD( "galaxia.10i", 0x02000, 0x0400, CRC(c0baa654) SHA1(80e0880c32ad285fbce0f7f552268b964b97cab3) ) // sldh + ROM_LOAD( "galaxia.11i", 0x02400, 0x0400, CRC(4456808a) SHA1(f9e8cfdde0e17f13f1be297b2b4503ccc959b33c) ) + ROM_LOAD( "galaxia.13i", 0x02800, 0x0400, CRC(cf653b9a) SHA1(fef5943de60cb5ba2459fc6ae7419e29c96a76cd) ) + ROM_LOAD( "galaxia.11l", 0x02c00, 0x0400, CRC(50c6a645) SHA1(46638907bc393df6be25fc7461d73047d1746ffc) ) + ROM_LOAD( "galaxia.13l", 0x03000, 0x0400, CRC(3a9c38c7) SHA1(d1e934092b69c0f3f9636eba05a1d8a6d9588e6b) ) + + ROM_REGION( 0x0800, "tiles", 0 ) + ROM_LOAD( "galaxia.3d", 0x00000, 0x0400, CRC(1dc30185) SHA1(e3c75eecb80b376ece98f602e1b9587487841824) ) + ROM_LOAD( "galaxia.1d", 0x00400, 0x0400, CRC(2dd50aab) SHA1(758d7a5383c9a1ee134d99e3f7025819cfbe0e0f) ) + + ROM_REGION( 0x0200, "proms", 0 ) + ROM_LOAD( "prom.11o", 0x0000, 0x0200, CRC(ae816417) SHA1(9497857d13c943a2735c3b85798199054e613b2c) ) // colors + priority +ROM_END + +ROM_START( galaxiab ) + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "galaxia.8h", 0x00000, 0x0400, CRC(f3b4ffde) SHA1(15b004e7821bfc145158b1e9435f061c524f6b86) ) + ROM_LOAD( "galaxia.10h", 0x00400, 0x0400, CRC(6d07fdd4) SHA1(d7d4b345a055275d59951788569db370bccd5195) ) + ROM_LOAD( "galaxia.11h", 0x00800, 0x0400, CRC(5682d56f) SHA1(15afb3296e93f8371d36b686ce372f917bd5b771) ) // sldh + ROM_LOAD( "galaxia.13h", 0x00c00, 0x0400, CRC(80dafe84) SHA1(8a71a05f1b0ddba36bf748a4801f3a78f63af1db) ) // sldh + ROM_LOAD( "galaxia.8i", 0x01000, 0x0400, CRC(45b88599) SHA1(3b79c21db1aa9d80fac81ac5a554e438805febd1) ) + ROM_LOAD( "galaxia.10i", 0x02000, 0x0400, CRC(76bd9fe3) SHA1(1abc8e40063aaa9140ea5e0341127eb0a7e86c88) ) + ROM_LOAD( "galaxia.11i", 0x02400, 0x0400, CRC(4456808a) SHA1(f9e8cfdde0e17f13f1be297b2b4503ccc959b33c) ) + ROM_LOAD( "galaxia.13i", 0x02800, 0x0400, CRC(ffe86fdb) SHA1(67b02a5c39dbe515b6d68583c8831b0dae15374a) ) // sldh + ROM_LOAD( "galaxia.11l", 0x02c00, 0x0400, CRC(8e3f5343) SHA1(6298be9bb33975854cb3d009b89913b1a8018aee) ) // sldh + ROM_LOAD( "galaxia.13l", 0x03000, 0x0400, CRC(3a9c38c7) SHA1(d1e934092b69c0f3f9636eba05a1d8a6d9588e6b) ) + + ROM_REGION( 0x0800, "tiles", 0 ) + ROM_LOAD( "galaxia.3d", 0x00000, 0x0400, CRC(1dc30185) SHA1(e3c75eecb80b376ece98f602e1b9587487841824) ) // taken from galaxiaa + ROM_LOAD( "galaxia.1d", 0x00400, 0x0400, CRC(2dd50aab) SHA1(758d7a5383c9a1ee134d99e3f7025819cfbe0e0f) ) // taken from galaxiaa + + ROM_REGION( 0x0200, "proms", 0 ) + ROM_LOAD( "prom.11o", 0x0000, 0x0200, CRC(ae816417) SHA1(9497857d13c943a2735c3b85798199054e613b2c) ) // colors + priority +ROM_END + + +ROM_START( astrowar ) + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "astro.8h", 0x00000, 0x0400, CRC(b0ec246c) SHA1(f9123b5e317938655f5e8b3f8a5810d0b2b7c7af) ) + ROM_LOAD( "astro.10h", 0x00400, 0x0400, CRC(090d360f) SHA1(528ddcdc30a5a291bd8850ff6f134fcc19af562f) ) + ROM_LOAD( "astro.11h", 0x00800, 0x0400, CRC(72ab1378) SHA1(50743c64c4775076aa6f1d8ab2e05c14884bf0ba) ) + ROM_LOAD( "astro.13h", 0x00c00, 0x0400, CRC(2dc4c895) SHA1(831afbfd4ebfd6522ab0758222bc6f9826148a5d) ) + ROM_LOAD( "astro.8i", 0x01000, 0x0400, CRC(ab87fbfc) SHA1(34b670f96c260f186c643e588995ae5d80377784) ) + ROM_LOAD( "astro.10i", 0x02000, 0x0400, CRC(533675c1) SHA1(69cc066e1874a135a53a21b7b2461bda456504f1) ) + ROM_LOAD( "astro.11i", 0x02400, 0x0400, CRC(59cf8901) SHA1(e849d4c99350b7e3453c156d91618b71b5be1163) ) + ROM_LOAD( "astro.13i", 0x02800, 0x0400, CRC(5149c121) SHA1(232ba594e283fb25c31d8ae0b7d8315a81852a71) BAD_DUMP ) // suspected bad byte at 0x2a00 + ROM_LOAD( "astro.11l", 0x02c00, 0x0400, CRC(29f52f57) SHA1(5cb50b82e09c537eeaeae167351fca686fde8228) ) + ROM_LOAD( "astro.13l", 0x03000, 0x0400, CRC(882cdb87) SHA1(062ee8d296316cbce2eb62e72774aa4181e9847d) ) + + ROM_REGION( 0x0800, "tiles", 0 ) + ROM_LOAD( "astro.1d", 0x00000, 0x0400, CRC(6053f834) SHA1(e0b76800c241b3c8010c09869cecbc109b25310a) ) + ROM_LOAD( "astro.3d", 0x00400, 0x0400, CRC(822505aa) SHA1(f9d3465e14bb850a286f8b4f42aa0a4044413b67) ) +ROM_END + +} // anonymous namespace + + + +/******************************************************************************* + Game Drivers +*******************************************************************************/ + +// YEAR, NAME, PARENT, MACHINE, INPUT, CLASS, INIT, SCREEN, COMPANY, FULLNAME, FLAGS +GAME( 1979, galaxia, 0, galaxia, galaxia, galaxia_state, empty_init, ROT90, "Zaccaria / Zelco", "Galaxia (set 1)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS | MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE ) +GAME( 1979, galaxiaa, galaxia, galaxiaa, galaxiaa, galaxia_state, empty_init, ROT90, "Zaccaria / Zelco", "Galaxia (set 2)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS | MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE ) // protected? +GAME( 1979, galaxiab, galaxia, galaxia, galaxia, galaxia_state, empty_init, ROT90, "Zaccaria / Zelco", "Galaxia (set 3)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS | MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE ) +GAME( 1980, astrowar, 0, astrowar, galaxia, astrowar_state, empty_init, ROT90, "Zaccaria / Zelco", "Astro Wars", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS | MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/zaccaria/laserbat_v.cpp b/src/mame/zaccaria/laserbat_v.cpp index ab6da08c718..110712e9c6b 100644 --- a/src/mame/zaccaria/laserbat_v.cpp +++ b/src/mame/zaccaria/laserbat_v.cpp @@ -219,16 +219,14 @@ TIMER_CALLBACK_MEMBER(laserbat_state_base::video_line) // update the PVIs if (!y) { - m_pvi[0]->render_first_line(); - m_pvi[1]->render_first_line(); - m_pvi[2]->render_first_line(); - } - else - { - m_pvi[0]->render_next_line(); - m_pvi[1]->render_next_line(); - m_pvi[2]->render_next_line(); + m_pvi[0]->start_new_frame(); + m_pvi[1]->start_new_frame(); + m_pvi[2]->start_new_frame(); } + m_pvi[0]->render_next_line(); + m_pvi[1]->render_next_line(); + m_pvi[2]->render_next_line(); + uint16_t const *const pvi1_row = &m_pvi[0]->bitmap().pix(y); uint16_t const *const pvi2_row = &m_pvi[1]->bitmap().pix(y); uint16_t const *const pvi3_row = &m_pvi[2]->bitmap().pix(y); @@ -319,7 +317,7 @@ void laserbat_state::laserbat_palette(palette_device &palette) const for red and green. LSB for blue is always effectively 1. The middle group is the MSB. Yet another crazy thing they did. - Each colour channel has an emitter follower buffer amlpifier + Each colour channel has an emitter follower buffer amplifier biased with a 1k resistor to +5V and a 3k3 resistor to ground. Output is adjusted by connecting additional resistors across the leg to ground using an open collector buffer - 270R, 820R and diff --git a/src/mame/cvs/quasar.cpp b/src/mame/zaccaria/quasar.cpp similarity index 57% rename from src/mame/cvs/quasar.cpp rename to src/mame/zaccaria/quasar.cpp index 0e7992aa138..58ed64e7307 100644 --- a/src/mame/cvs/quasar.cpp +++ b/src/mame/zaccaria/quasar.cpp @@ -1,20 +1,32 @@ // license:BSD-3-Clause // copyright-holders: Mike Coates, Pierpaolo Prazzoli -/************************************************************************ +/******************************************************************************* Zaccaria Quasar Driver by Mike Coates and Pierpaolo Prazzoli +Zaccaria S2650 games share various levels of design with the Century Video +System (CVS) games. + +Shooting seems to mix custom boards from Zaccaria and sound boards from CVS, +hinting at a strong link between the two companies. + +Zaccaria are an Italian company, Century were based in Manchester UK. + TODO: -- Sound (missing invader effect - still not sure all noise in correct places) -- Phase 3 - seems awfully hard - dip settings ? -- Hook up Coin Counter -- Test/Service Mode - not working? -- No attract demo? is this correct? +- missing enemy shooting sound effect, needs netlist sound +- missing color cycling effect after beating 3rd level? seen on an arcade video +- where is the flipscreen signal? +- test/service input isn't working? + +It's picky about vblank duration: If it's too short, parts of the game run too +slow. Or if it's too long, parts of the game run too fast, and eg. the 3rd level +becomes nearly unbeatable. The implemented duration of 3500us approximately +matches what was seen on a PCB video. -************************************************************************* +******************************************************************************** Quasar by Zaccaria (1980) @@ -26,60 +38,91 @@ Quasar by Zaccaria (1980) I8085 Sound Board -************************************************************************/ +*******************************************************************************/ #include "emu.h" -#include "cvs_base.h" - #include "cpu/mcs48/mcs48.h" +#include "cpu/s2650/s2650.h" +#include "machine/gen_latch.h" +#include "machine/s2636.h" +#include "sound/dac.h" +#include "emupal.h" +#include "screen.h" #include "speaker.h" namespace { -class quasar_state : public cvs_base_state +class quasar_state : public driver_device { public: - quasar_state(const machine_config &mconfig, device_type type, const char *tag) - : cvs_base_state(mconfig, type, tag) - , m_soundlatch(*this, "soundlatch") - , m_in(*this, "IN%u", 0U) - , m_dsw(*this, "DSW%u", 0U) - , m_effectram(*this, "effectram", 0x400, ENDIANNESS_BIG) + quasar_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), + m_maincpu(*this, "maincpu"), + m_audiocpu(*this, "audiocpu"), + m_soundlatch(*this, "soundlatch"), + m_s2636(*this, "s2636%u", 0U), + m_gfxdecode(*this, "gfxdecode"), + m_screen(*this, "screen"), + m_palette(*this, "palette"), + m_in(*this, "IN%u", 0U), + m_dsw(*this, "DSW%u", 0U), + m_video_ram(*this, "video_ram", 0x400, ENDIANNESS_BIG), + m_color_ram(*this, "color_ram", 0x400, ENDIANNESS_BIG), + m_effectram(*this, "effectram", 0x400, ENDIANNESS_BIG), + m_bullet_ram(*this, "bullet_ram") { } void quasar(machine_config &config) ATTR_COLD; + // sound test switch is tied to mcu interrupt pin + DECLARE_INPUT_CHANGED_MEMBER(soundtest_switch) { m_audiocpu->set_input_line(0, newval ? CLEAR_LINE : ASSERT_LINE); } + protected: virtual void machine_start() override ATTR_COLD; virtual void machine_reset() override ATTR_COLD; virtual void video_start() override ATTR_COLD; private: + // devices + required_device m_maincpu; + required_device m_audiocpu; required_device m_soundlatch; - + required_device_array m_s2636; + required_device m_gfxdecode; + required_device m_screen; + required_device m_palette; required_ioport_array<2> m_in; required_ioport_array<3> m_dsw; - memory_share_creator m_effectram; - - uint8_t m_effectcontrol = 0U; - uint8_t m_page = 0U; - uint8_t m_io_page = 0U; - - void video_page_select_w(offs_t offset, uint8_t data); - void io_page_select_w(offs_t offset, uint8_t data); - void video_w(offs_t offset, uint8_t data); - uint8_t io_r(); - void bullet_w(offs_t offset, uint8_t data); - void sh_command_w(uint8_t data); - uint8_t sh_command_r(); + // memory + memory_share_creator m_video_ram; + memory_share_creator m_color_ram; + memory_share_creator m_effectram; + required_shared_ptr m_bullet_ram; + + bitmap_ind16 m_collision_background; + u8 m_collision = 0U; + u8 m_effectcontrol = 0U; + + u8 m_page = 0U; + u8 m_io_page = 0U; + + void video_page_select_w(offs_t offset, u8 data); + void io_page_select_w(offs_t offset, u8 data); + void video_w(offs_t offset, u8 data); + u8 io_r(); + void bullet_w(offs_t offset, u8 data); + u8 collision_r(); + u8 collision_clear_r(); + void sh_command_w(u8 data); + u8 sh_command_r(); int audio_t1_r(); void palette(palette_device &palette) const ATTR_COLD; - uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + u32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void program(address_map &map) ATTR_COLD; void data(address_map &map) ATTR_COLD; @@ -88,22 +131,31 @@ class quasar_state : public cvs_base_state void sound_portmap(address_map &map) ATTR_COLD; }; +void quasar_state::machine_start() +{ + // register state save + save_item(NAME(m_collision)); + save_item(NAME(m_effectcontrol)); + save_item(NAME(m_page)); + save_item(NAME(m_io_page)); +} -/*************************************************************************** - - Zaccaria S2650 games share various levels of design with the Century Video - System (CVS) games, and hence some routines are shared from there. +void quasar_state::machine_reset() +{ + m_collision = 0; + m_page = 0; + m_io_page = 8; +} - Shooting seems to mix custom boards from Zaccaria and sound boards from CVS - hinting at a strong link between the two companies. - Zaccaria are an Italian company, Century were based in Manchester UK -***************************************************************************/ +/******************************************************************************* + Video +*******************************************************************************/ void quasar_state::palette(palette_device &palette) const { - uint8_t const *const color_prom = memregion("proms")->base(); + u8 const *const color_prom = memregion("proms")->base(); // standard 1 bit per color palette (background and sprites) for (int i = 0; i < 8; i++) @@ -115,33 +167,29 @@ void quasar_state::palette(palette_device &palette) const int bit0, bit1, bit2; // red component - bit0 = BIT(i, 0); - bit1 = BIT(i, 1); - bit2 = BIT(i, 2); + bit0 = BIT(i, 7); + bit1 = BIT(i, 6); + bit2 = BIT(i, 5); int const r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; // green component - bit0 = BIT(i, 3); - bit1 = BIT(i, 4); - bit2 = BIT(i, 5); + bit0 = BIT(i, 4); + bit1 = BIT(i, 3); + bit2 = BIT(i, 2); int const g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; // blue component - bit0 = BIT(i, 6); - bit1 = BIT(i, 7); + bit0 = BIT(i, 1); + bit1 = BIT(i, 0); int const b = 0x4f * bit0 + 0xa8 * bit1; - // intensity 0 - palette.set_indirect_color(0x100 + i, rgb_t::black()); - - // intensity 1 - palette.set_indirect_color(0x200 + i, rgb_t(r >> 2, g >> 2, b >> 2)); - - // intensity 2 - palette.set_indirect_color(0x300 + i, rgb_t((r >> 2) + (r >> 3), (g >> 2) + (g >> 3), (b >> 2) + (b >> 2))); - - // intensity 3 - palette.set_indirect_color(0x400 + i, rgb_t(r >> 1, g >> 1, b >> 1)); + // 4 intensities + float level = 0.0f; + for (int j = 0; j < 4; j++) + { + palette.set_indirect_color(0x100 * (j + 1) + i, rgb_t(r * level, g * level, b * level)); + level += 0.2f; + } } // Address 0-2 from graphic ROM @@ -170,18 +218,17 @@ void quasar_state::video_start() save_item(NAME(m_collision_background)); } -uint32_t quasar_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +u32 quasar_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { // for every character in the video RAM for (int offs = 0; offs < 0x0400; offs++) { - uint8_t const code = m_video_ram[offs]; - uint8_t const x = (offs & 0x1f) << 3; - uint8_t const y = (offs >> 5) << 3; + u8 const code = m_video_ram[offs]; + u8 const x = (offs & 0x1f) << 3; + u8 const y = (offs >> 5) << 3; // While we have the current character code, draw the effects layer // intensity / on and off controlled by latch - int const forecolor = 0x208 + m_effectram[offs] + (256 * (((m_effectcontrol >> 4) ^ 3) & 3)); for (int ox = 0; ox < 8; ox++) @@ -195,7 +242,6 @@ uint32_t quasar_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap 0, 0, x, y, 0); - // background for Collision Detection (it can only hit certain items) if ((m_color_ram[offs] & 7) == 0) { @@ -217,20 +263,23 @@ uint32_t quasar_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap { if (m_bullet_ram[offs] != 0) { - for (int ct = 0; ct < 1; ct++) + for (int ct = 0; ct < 4; ct++) { - int const bx = 255 - 9 - m_bullet_ram[offs] - ct; + int const bx = 255 - 8 - m_bullet_ram[offs] - (ct & 1); + int const by = offs - (ct >> 1); - // bullet/object Collision - if (s2636_0_bitmap.pix(offs, bx) != 0) m_collision_register |= 0x04; - if (s2636_2_bitmap.pix(offs, bx) != 0) m_collision_register |= 0x08; + if (cliprect.contains(bx, by)) + { + // bullet/object Collision + if (s2636_0_bitmap.pix(by, bx) != 0) m_collision |= 0x04; + if (s2636_2_bitmap.pix(by, bx) != 0) m_collision |= 0x08; - bitmap.pix(offs, bx) = 7; + bitmap.pix(by, bx) = 7; + } } } } - // mix and copy the S2636 images into the main bitmap, also check for collision for (int y = cliprect.top(); y <= cliprect.bottom(); y++) { @@ -249,8 +298,8 @@ uint32_t quasar_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap // S2636 vs. background collision detection if (m_palette->pen_indirect(m_collision_background.pix(y, x))) { - if (S2636_IS_PIXEL_DRAWN(pixel0)) m_collision_register |= 0x01; - if (S2636_IS_PIXEL_DRAWN(pixel2)) m_collision_register |= 0x02; + if (S2636_IS_PIXEL_DRAWN(pixel0)) m_collision |= 0x01; + if (S2636_IS_PIXEL_DRAWN(pixel2)) m_collision |= 0x02; } } } @@ -260,76 +309,72 @@ uint32_t quasar_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap } -/************************************************************************ - - Quasar memory layout - - Paging for screen is controlled by OUT to 0,1,2 or 3 - Paging for IO ports is controlled by OUT to 8,9,A or B +/******************************************************************************* + Quasar memory layout +*******************************************************************************/ -************************************************************************/ - -void quasar_state::video_page_select_w(offs_t offset, uint8_t data) +void quasar_state::video_page_select_w(offs_t offset, u8 data) { m_page = offset & 0x03; } -void quasar_state::io_page_select_w(offs_t offset, uint8_t data) +void quasar_state::io_page_select_w(offs_t offset, u8 data) { m_io_page = offset & 0x03; + + if (offset == 0) + { + // coincounters are here, they keep triggering if the coin is held active (hence the PORT_IMPULSE) + machine().bookkeeping().coin_counter_w(0, BIT(~data, 3)); + machine().bookkeeping().coin_counter_w(1, BIT(~data, 2)); + } } -void quasar_state::video_w(offs_t offset, uint8_t data) +void quasar_state::video_w(offs_t offset, u8 data) { + // paging for screen is controlled by OUT to 0,1,2 or 3 switch (m_page) { - case 0: m_video_ram[offset] = data; break; - case 1: m_color_ram[offset] = data & 7; break; // 3 bits of ram only - 3 x 2102 - case 2: m_effectram[offset] = data; break; - case 3: m_effectcontrol = data; break; + case 0: m_video_ram[offset] = data; break; + case 1: m_color_ram[offset] = data & 7; break; // 3 bits of ram only - 3 x 2102 + case 2: m_effectram[offset] = data; break; + case 3: m_effectcontrol = data; break; } } -uint8_t quasar_state::io_r() +u8 quasar_state::io_r() { - uint8_t ans = 0; + u8 data = 0; + // paging for IO ports is controlled by OUT to 8,9,A or B switch (m_io_page) { - case 0: ans = m_in[0]->read(); break; - case 1: ans = m_in[1]->read(); break; - case 2: ans = m_dsw[0]->read(); break; - case 3: ans = m_dsw[1]->read(); break; + case 0: data = m_in[0]->read(); break; + case 1: data = m_in[1]->read(); break; + case 2: data = m_dsw[0]->read(); break; + case 3: data = m_dsw[1]->read(); break; } - return ans; + return data; } -void quasar_state::bullet_w(offs_t offset, uint8_t data) +void quasar_state::bullet_w(offs_t offset, u8 data) { - m_bullet_ram[offset] = (data ^ 0xff); + m_bullet_ram[offset] = data ^ 0xff; } -void quasar_state::sh_command_w(uint8_t data) +u8 quasar_state::collision_r() { - // bit 4 = Sound Invader : Linked to an NE555V circuit - // Not handled yet - - // lower nibble = command to I8035 - // not necessarily like this, but it seems to work better than direct mapping - // (although schematics has it as direct - but then the schematics are wrong elsewhere to!) - m_soundlatch->write(bitswap<4>(data,3,0,2,1)); + return m_collision; } -uint8_t quasar_state::sh_command_r() +u8 quasar_state::collision_clear_r() { - return m_soundlatch->read() + (m_dsw[2]->read() & 0x30); -} + if (!machine().side_effects_disabled()) + m_collision = 0; -int quasar_state::audio_t1_r() -{ - return m_soundlatch->read() == 0; + return 0; } // memory map taken from the manual @@ -357,14 +402,34 @@ void quasar_state::io(address_map &map) void quasar_state::data(address_map &map) { map(S2650_CTRL_PORT, S2650_CTRL_PORT).r(FUNC(quasar_state::collision_r)).nopw(); - map(S2650_DATA_PORT, S2650_DATA_PORT).rw(FUNC(quasar_state::collision_clear), FUNC(quasar_state::sh_command_w)); + map(S2650_DATA_PORT, S2650_DATA_PORT).rw(FUNC(quasar_state::collision_clear_r), FUNC(quasar_state::sh_command_w)); } -/************************************* - * - * Sound board memory handlers - * - *************************************/ + + +/******************************************************************************* + Sound board memory handlers +*******************************************************************************/ + +void quasar_state::sh_command_w(u8 data) +{ + // bit 4 = Sound Invader : Linked to an NE555V circuit + // Not handled yet + + // lower nibble = command to I8035 + m_soundlatch->write(data & 0xf); +} + +u8 quasar_state::sh_command_r() +{ + return m_soundlatch->read() | (m_dsw[2]->read() & 0x30); +} + +int quasar_state::audio_t1_r() +{ + // all 4 sound bits are NANDed together + return m_soundlatch->read() == 0; +} void quasar_state::sound_map(address_map &map) { @@ -377,104 +442,90 @@ void quasar_state::sound_portmap(address_map &map) map(0x80, 0x80).r(FUNC(quasar_state::sh_command_r)); } -/************************************************************************ - Inputs -************************************************************************/ +/******************************************************************************* + Input Ports +*******************************************************************************/ static INPUT_PORTS_START( quasar ) PORT_START("IN0") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 ) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN2 ) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN1 ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(1) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(1) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_TILT ) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SERVICE ) // test switch + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SERVICE1 ) // test switch? PORT_START("IN1") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) // table (from manual) + PORT_CONFNAME( 0x01, 0x01, DEF_STR( Cabinet ) ) + PORT_CONFSETTING( 0x01, DEF_STR( Upright ) ) + PORT_CONFSETTING( 0x00, DEF_STR( Cocktail ) ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_COCKTAIL PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_COCKTAIL PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 ) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) // count enable (from manual) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) // count enable (from manual) PORT_START("DSW0") - PORT_DIPNAME( 0x0c, 0x04, DEF_STR( Coin_A ) ) // confirmed - PORT_DIPSETTING( 0x00, DEF_STR( 2C_1C ) ) - PORT_DIPSETTING( 0x04, DEF_STR( 1C_1C ) ) - PORT_DIPSETTING( 0x08, DEF_STR( 1C_2C ) ) - PORT_DIPSETTING( 0x0c, DEF_STR( 1C_3C ) ) - PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coin_B ) ) // confirmed + PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW1:1,2") PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) PORT_DIPSETTING( 0x01, DEF_STR( 1C_2C ) ) PORT_DIPSETTING( 0x02, DEF_STR( 1C_3C ) ) PORT_DIPSETTING( 0x03, DEF_STR( 1C_5C ) ) - PORT_DIPNAME( 0x30, 0x00, "Number of Rockets" ) // confirmed + PORT_DIPNAME( 0x0c, 0x04, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:3,4") + PORT_DIPSETTING( 0x00, DEF_STR( 2C_1C ) ) + PORT_DIPSETTING( 0x04, DEF_STR( 1C_1C ) ) + PORT_DIPSETTING( 0x08, DEF_STR( 1C_2C ) ) + PORT_DIPSETTING( 0x0c, DEF_STR( 1C_3C ) ) + PORT_DIPNAME( 0x30, 0x10, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:5,6") PORT_DIPSETTING( 0x00, "3" ) PORT_DIPSETTING( 0x10, "4" ) PORT_DIPSETTING( 0x20, "5" ) PORT_DIPSETTING( 0x30, "6" ) - PORT_DIPNAME( 0x40, 0x00, DEF_STR( Free_Play ) ) // requires initial coin, but doesn't decrease coins on game over + PORT_DIPNAME( 0x40, 0x00, DEF_STR( Free_Play ) ) PORT_DIPLOCATION("SW1:7") // requires initial coin, but doesn't decrease coins on game over PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) PORT_DIPSETTING( 0x40, DEF_STR( On ) ) - PORT_DIPNAME( 0x80, 0x80, "Test Mode" ) // confirmed - PORT_DIPSETTING( 0x00, "Collisions excluded" ) - PORT_DIPSETTING( 0x80, "Collisions included" ) + PORT_DIPNAME( 0x80, 0x80, "Collision Detection" ) PORT_DIPLOCATION("SW1:8") + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x80, DEF_STR( On ) ) PORT_START("DSW1") - PORT_DIPNAME( 0x07, 0x01, "High Score" ) - PORT_DIPSETTING( 0x00, "No H.S." ) // this option only wants bit 0 OFF - PORT_DIPSETTING( 0x01, "Normal H.S." ) - PORT_DIPSETTING( 0x03, "Low H.S." ) - PORT_DIPSETTING( 0x05, "Medium H.S." ) - PORT_DIPSETTING( 0x07, "High H.S." ) - PORT_DIPNAME( 0x18, 0x10, DEF_STR( Difficulty ) ) - PORT_DIPSETTING( 0x18, DEF_STR( Easy ) ) - PORT_DIPSETTING( 0x10, DEF_STR( Medium ) ) - PORT_DIPSETTING( 0x08, DEF_STR( Difficult ) ) - PORT_DIPSETTING( 0x00, DEF_STR( Very_Difficult ) ) - PORT_DIPNAME( 0x60, 0x20, "Extended Play" ) - PORT_DIPSETTING( 0x20, "5500" ) // confirmed + PORT_DIPNAME( 0x01, 0x00, "High Score" ) PORT_DIPLOCATION("SW2:1") + PORT_DIPSETTING( 0x00, DEF_STR( Normal ) ) + PORT_DIPSETTING( 0x01, "Random" ) + PORT_DIPNAME( 0x06, 0x04, "Random H.S." ) PORT_DIPLOCATION("SW2:2,3") // only if high score is set to random + PORT_DIPSETTING( 0x02, DEF_STR( Low ) ) + PORT_DIPSETTING( 0x04, DEF_STR( Medium ) ) + PORT_DIPSETTING( 0x06, "Medium-High" ) + PORT_DIPSETTING( 0x00, DEF_STR( High ) ) + PORT_DIPNAME( 0x18, 0x00, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:4,5") + PORT_DIPSETTING( 0x00, DEF_STR( Easy ) ) + PORT_DIPSETTING( 0x08, DEF_STR( Medium ) ) + PORT_DIPSETTING( 0x10, DEF_STR( Difficult ) ) + PORT_DIPSETTING( 0x18, DEF_STR( Very_Difficult ) ) + PORT_DIPNAME( 0x60, 0x40, "Extended Play" ) PORT_DIPLOCATION("SW2:6,7") + PORT_DIPSETTING( 0x00, DEF_STR( None ) ) + PORT_DIPSETTING( 0x20, "5500" ) PORT_DIPSETTING( 0x40, "7500" ) PORT_DIPSETTING( 0x60, "9500" ) - PORT_DIPSETTING( 0x00, "17500" ) - PORT_DIPNAME( 0x80, 0x80, "Full Screen Rocket" ) // confirmed - PORT_DIPSETTING( 0x80, "Stop at edge" ) - PORT_DIPSETTING( 0x00, "Wrap Around" ) + PORT_DIPNAME( 0x80, 0x80, "Rocket At Edge" ) PORT_DIPLOCATION("SW2:8") // only for phase 2 (the Asteroids style level) + PORT_DIPSETTING( 0x80, "Stop" ) + PORT_DIPSETTING( 0x00, "Wrap" ) PORT_START("DSW2") -#if 0 - PORT_DIPNAME( 0x0f, 0x00, "Noise to play" ) - PORT_DIPSETTING( 0x00, "00" ) - PORT_DIPSETTING( 0x01, "01" ) - PORT_DIPSETTING( 0x02, "02" ) - PORT_DIPSETTING( 0x03, "03" ) - PORT_DIPSETTING( 0x04, "04" ) - PORT_DIPSETTING( 0x05, "05" ) - PORT_DIPSETTING( 0x06, "06" ) - PORT_DIPSETTING( 0x07, "07" ) - PORT_DIPSETTING( 0x08, "08" ) - PORT_DIPSETTING( 0x09, "09" ) - PORT_DIPSETTING( 0x0a, "0A" ) - PORT_DIPSETTING( 0x0b, "0B" ) - PORT_DIPSETTING( 0x0c, "0C" ) - PORT_DIPSETTING( 0x0d, "0D" ) - PORT_DIPSETTING( 0x0e, "0E" ) - PORT_DIPSETTING( 0x0f, "0F" ) -#endif - PORT_DIPNAME( 0x10, 0x10, "Sound Test" ) - PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unused ) ) - PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) + PORT_DIPNAME( 0x01, 0x01, "Sound Test" ) PORT_DIPLOCATION("SOUND:1") PORT_CHANGED_MEMBER(DEVICE_SELF, FUNC(quasar_state::soundtest_switch), 0) + PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - + PORT_DIPNAME( 0x30, 0x20, "Sound Program" ) PORT_DIPLOCATION("SOUND:3,4") + PORT_DIPSETTING( 0x00, "Invalid 1" ) + PORT_DIPSETTING( 0x10, "Invalid 1" ) + PORT_DIPSETTING( 0x30, "Invalid 2" ) + PORT_DIPSETTING( 0x20, "Quasar" ) INPUT_PORTS_END static const gfx_layout charlayout = @@ -494,54 +545,35 @@ static GFXDECODE_START( gfx_quasar ) GFXDECODE_ENTRY( "tiles", 0x0000, charlayout, 0, 64+1 ) GFXDECODE_END -// **************************************** -// Quasar S2650 Main CPU, I8035 sound board -// **************************************** - -void quasar_state::machine_start() -{ - cvs_base_state::machine_start(); - - // register state save - save_item(NAME(m_effectcontrol)); - save_item(NAME(m_page)); - save_item(NAME(m_io_page)); -} -void quasar_state::machine_reset() -{ - cvs_base_state::machine_reset(); - m_effectcontrol = 0; - m_page = 0; - m_io_page = 8; -} +/******************************************************************************* + Machine Configuration +*******************************************************************************/ void quasar_state::quasar(machine_config &config) { // basic machine hardware - S2650(config, m_maincpu, 14'318'000 / 4); // 14 mhz crystal divide by 4 on board + S2650(config, m_maincpu, 14.318181_MHz_XTAL / 8); m_maincpu->set_addrmap(AS_PROGRAM, &quasar_state::program); m_maincpu->set_addrmap(AS_IO, &quasar_state::io); m_maincpu->set_addrmap(AS_DATA, &quasar_state::data); m_maincpu->set_vblank_int("screen", FUNC(quasar_state::irq0_line_assert)); m_maincpu->sense_handler().set("screen", FUNC(screen_device::vblank)); - m_maincpu->intack_handler().set([this]() { m_maincpu->set_input_line(0, CLEAR_LINE); return 0x03; }); + m_maincpu->intack_handler().set([this]() { m_maincpu->set_input_line(0, CLEAR_LINE); return 0x0a; }); - i8035_device &soundcpu(I8035(config, "soundcpu", 6'000'000)); // 6MHz crystal divide by 15 in CPU - soundcpu.set_addrmap(AS_PROGRAM, &quasar_state::sound_map); - soundcpu.set_addrmap(AS_IO, &quasar_state::sound_portmap); - soundcpu.t1_in_cb().set(FUNC(quasar_state::audio_t1_r)); - soundcpu.p1_out_cb().set("dac", FUNC(dac_byte_interface::data_w)); - - config.set_maximum_quantum(attotime::from_hz(6000)); + I8035(config, m_audiocpu, 6_MHz_XTAL); + m_audiocpu->set_addrmap(AS_PROGRAM, &quasar_state::sound_map); + m_audiocpu->set_addrmap(AS_IO, &quasar_state::sound_portmap); + m_audiocpu->t1_in_cb().set(FUNC(quasar_state::audio_t1_r)); + m_audiocpu->p1_out_cb().set("dac", FUNC(dac_byte_interface::data_w)); // video hardware SCREEN(config, m_screen, SCREEN_TYPE_RASTER); m_screen->set_video_attributes(VIDEO_ALWAYS_UPDATE); - m_screen->set_refresh_hz(50); // From dot clock - m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(2500)); // not accurate - m_screen->set_size(256, 256); + m_screen->set_refresh_hz(50); // from dot clock + m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(3500)); + m_screen->set_size(256, 312); m_screen->set_visarea(1*8+1, 29*8-1, 2*8, 32*8-1); m_screen->set_screen_update(FUNC(quasar_state::screen_update)); m_screen->set_palette(m_palette); @@ -550,21 +582,30 @@ void quasar_state::quasar(machine_config &config) PALETTE(config, m_palette, FUNC(quasar_state::palette), (64 + 1) * 8 + (4 * 256), 0x500); S2636(config, m_s2636[0], 0); - m_s2636[0]->set_offsets(CVS_S2636_Y_OFFSET - 8, CVS_S2636_X_OFFSET - 9); + m_s2636[0]->set_offsets(-13, -35); + m_s2636[0]->add_route(ALL_OUTPUTS, "mono", 0.2); S2636(config, m_s2636[1], 0); - m_s2636[1]->set_offsets(CVS_S2636_Y_OFFSET - 8, CVS_S2636_X_OFFSET - 9); + m_s2636[1]->set_offsets(-13, -35); + m_s2636[1]->add_route(ALL_OUTPUTS, "mono", 0.2); S2636(config, m_s2636[2], 0); - m_s2636[2]->set_offsets(CVS_S2636_Y_OFFSET - 8, CVS_S2636_X_OFFSET - 9); + m_s2636[2]->set_offsets(-13, -35); + m_s2636[2]->add_route(ALL_OUTPUTS, "mono", 0.2); // sound hardware GENERIC_LATCH_8(config, m_soundlatch); - SPEAKER(config, "speaker").front_center(); - DAC_8BIT_R2R(config, "dac", 0).add_route(ALL_OUTPUTS, "speaker", 1.0); // unknown DAC + SPEAKER(config, "mono").front_center(); + DAC_8BIT_R2R(config, "dac", 0).add_route(ALL_OUTPUTS, "mono", 0.2); // LM1408 } + + +/******************************************************************************* + ROM Definitions +*******************************************************************************/ + ROM_START( quasar ) ROM_REGION( 0x8000, "maincpu", 0 ) ROM_LOAD( "7b_01.bin", 0x0000, 0x0400, CRC(20a7feaf) SHA1(ab89087efca2fcb9568f49ba117755ae2c1bd3a3) ) @@ -583,7 +624,7 @@ ROM_START( quasar ) ROM_LOAD( "3c_09.bin", 0x2c00, 0x0400, CRC(ef87c2cb) SHA1(1ba10dd3996c047e595c54a37c1abb44df3b63c6) ) ROM_LOAD( "2c_10.bin", 0x3000, 0x0400, CRC(be6c4f84) SHA1(b3a779457bd0d33ccb23c21a7e7cd4a6fc78bb7f) ) - ROM_REGION( 0x1000, "soundcpu", 0 ) + ROM_REGION( 0x1000, "audiocpu", 0 ) ROM_LOAD( "quasar.snd", 0x0000, 0x0800, CRC(9e489768) SHA1(a9f01ef0a6512543bbdfec56037f37a0440b2b94) ) ROM_REGION( 0x1800, "tiles", 0 ) @@ -613,7 +654,7 @@ ROM_START( quasara ) ROM_LOAD( "3c_09.bin", 0x2c00, 0x0400, CRC(ef87c2cb) SHA1(1ba10dd3996c047e595c54a37c1abb44df3b63c6) ) ROM_LOAD( "2c_10a.bin", 0x3000, 0x0400, CRC(a31c0435) SHA1(48e1c5da455610145310dfe4c6b6e4302b531876) ) // different from quasar set - ROM_REGION( 0x1000, "soundcpu", 0 ) + ROM_REGION( 0x1000, "audiocpu", 0 ) ROM_LOAD( "quasar.snd", 0x0000, 0x0800, CRC(9e489768) SHA1(a9f01ef0a6512543bbdfec56037f37a0440b2b94) ) ROM_REGION( 0x1800, "tiles", 0 ) @@ -628,5 +669,11 @@ ROM_END } // anonymous namespace -GAME( 1980, quasar, 0, quasar, quasar, quasar_state, empty_init, ROT90, "Zaccaria / Zelco", "Quasar (set 1)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) -GAME( 1980, quasara, quasar, quasar, quasar, quasar_state, empty_init, ROT90, "Zaccaria / Zelco", "Quasar (set 2)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) + +/******************************************************************************* + Game Drivers +*******************************************************************************/ + +// YEAR, NAME, PARENT, MACHINE, INPUT, CLASS, INIT, SCREEN, COMPANY, FULLNAME, FLAGS +GAME( 1980, quasar, 0, quasar, quasar, quasar_state, empty_init, ROT90, "Zaccaria / Zelco", "Quasar (set 1)", MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) +GAME( 1980, quasara, quasar, quasar, quasar, quasar_state, empty_init, ROT90, "Zaccaria / Zelco", "Quasar (set 2)", MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/zaccaria/zaccaria.cpp b/src/mame/zaccaria/zaccaria.cpp index c38f2b85b90..c8693a7ae4e 100644 --- a/src/mame/zaccaria/zaccaria.cpp +++ b/src/mame/zaccaria/zaccaria.cpp @@ -24,9 +24,12 @@ thanks to Andrea Babich for the manual. - some minor color issues (see video) - testing dips in service mode, they don't match what MAME's UI shows - (i.e. dip 5 in the UI causes dip 8 to change in service mode display). + (i.e. dip 5 in the UI causes dip 8 to change in service mode display). A dip listing is available online. +- get rid of (&machine().system() == &GAME_NAME(monymony)) and check and see if the + protection handler should also apply to monymony2 that was added later + Notes: - The protection device at 1A on the ROM board (1B11147) is unidentified on the @@ -44,14 +47,83 @@ thanks to Andrea Babich for the manual. ***************************************************************************/ #include "emu.h" -#include "zaccaria.h" +#include "zaccaria_a.h" #include "cpu/z80/z80.h" #include "machine/74259.h" #include "machine/i8255.h" #include "machine/watchdog.h" +#include "video/resnet.h" + +#include "emupal.h" #include "screen.h" #include "speaker.h" +#include "tilemap.h" + +GAME_EXTERN(monymony); + + +namespace { + +class zaccaria_state : public driver_device +{ +public: + zaccaria_state(const machine_config &mconfig, device_type type, const char *tag) + : driver_device(mconfig, type, tag) + , m_maincpu(*this, "maincpu") + , m_gfxdecode(*this, "gfxdecode") + , m_palette(*this, "palette") + , m_audiopcb(*this, "audiopcb") + , m_videoram(*this, "videoram") + , m_attributesram(*this, "attributesram") + , m_spriteram(*this, "spriteram%u", 1U) + , m_dsw_port(*this, "DSW.%u", 0) + , m_coins(*this, "COINS") + { } + + void zaccaria(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: + uint8_t dsw_r(); + uint8_t prot1_r(offs_t offset); + uint8_t prot2_r(offs_t offset); + void coin_w(int state); + void nmi_mask_w(int state); + void videoram_w(offs_t offset, uint8_t data); + void attributes_w(offs_t offset, uint8_t data); + uint8_t read_attr(offs_t offset, int which); + void update_colscroll(); + void flip_screen_x_w(int state); + void dsw_sel_w(uint8_t data); + TILE_GET_INFO_MEMBER(get_tile_info); + void palette(palette_device &palette) const; + uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + void vblank_irq(int state); + void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, uint8_t *spriteram, int color, int section); + + void main_map(address_map &map) ATTR_COLD; + + required_device m_maincpu; + required_device m_gfxdecode; + required_device m_palette; + required_device m_audiopcb; + + required_shared_ptr m_videoram; + required_shared_ptr m_attributesram; + required_shared_ptr_array m_spriteram; + + required_ioport_array<3> m_dsw_port; + required_ioport m_coins; + + uint8_t m_dsw_sel = 0; + tilemap_t *m_bg_tilemap = nullptr; + uint8_t m_nmi_mask = 0; +}; void zaccaria_state::machine_start() @@ -65,6 +137,254 @@ void zaccaria_state::machine_reset() m_dsw_sel = 0; } + + +/*************************************************************************** + + Convert the color PROMs into a more useable format. + + +Here's the hookup from the proms (82s131) to the r-g-b-outputs + + Prom 9F 74LS374 + ----------- ____________ + 12 | 3 2 |---680 ohm----| blue out + 11 | 4 5 |---1k ohm-----| (+ 470 ohm pulldown) + 10 | 7 6 |---820 ohm-------| + 9 | 8 9 |---1k ohm--------| green out + Prom 9G | | | (+ 390 ohm pulldown) + 12 | 13 12 |---1.2k ohm------| + 11 | 14 15 |---820 ohm----------| + 10 | 17 16 |---1k ohm-----------| red out + 9 | 18 19 |---1.2k ohm---------| (+ 390 ohm pulldown) + |__________| + + +***************************************************************************/ + +void zaccaria_state::palette(palette_device &palette) const +{ + uint8_t const *const color_prom = memregion("proms")->base(); + static constexpr int resistances_rg[] = { 1200, 1000, 820 }; + static constexpr int resistances_b[] = { 1000, 820 }; + + double weights_rg[3], weights_b[2]; + compute_resistor_weights(0, 0xff, -1.0, + 3, resistances_rg, weights_rg, 390, 0, + 2, resistances_b, weights_b, 470, 0, + 0, nullptr, nullptr, 0, 0); + + for (int i = 0; i < 0x200; i++) + { + /* + TODO: I'm not sure, but I think that pen 0 must always be black, otherwise + there's some junk brown background in Jack Rabbit. + From the schematics it seems that the background color can be changed, but + I'm not sure where it would be taken from; I think the high bits of + attributesram, but they are always 0 in these games so they would turn out + black anyway. + */ + if (!(i & 0x038)) + palette.set_indirect_color(i, rgb_t::black()); + else + { + int bit0, bit1, bit2; + + // red component + bit0 = BIT(color_prom[i + 0x000], 3); + bit1 = BIT(color_prom[i + 0x000], 2); + bit2 = BIT(color_prom[i + 0x000], 1); + int const r = combine_weights(weights_rg, bit0, bit1, bit2); + + // green component + bit0 = BIT(color_prom[i + 0x000], 0); + bit1 = BIT(color_prom[i + 0x200], 3); + bit2 = BIT(color_prom[i + 0x200], 2); + int const g = combine_weights(weights_rg, bit0, bit1, bit2); + + // blue component + bit0 = BIT(color_prom[i + 0x200], 1); + bit1 = BIT(color_prom[i + 0x200], 0); + int const b = combine_weights(weights_b, bit0, bit1); + + palette.set_indirect_color(i, rgb_t(r, g, b)); + } + } + + /* There are 512 unique colors, which seem to be organized in 8 blocks */ + /* of 64. In each block, colors are not in the usual sequential order */ + /* but in interleaved order, like Phoenix. Additionally, colors for */ + /* background and sprites are interleaved. */ + for (int i = 0; i < 8; i++) + for (int j = 0; j < 4; j++) + for (int k = 0; k < 8; k++) + // swap j and k to make the colors sequential + palette.set_pen_indirect(0 + 32 * i + 8 * j + k, 64 * i + 8 * k + 2 * j); + + for (int i = 0; i < 8; i++) + for (int j = 0; j < 4; j++) + for (int k = 0; k < 8; k++) + // swap j and k to make the colors sequential + palette.set_pen_indirect(256 + 32 * i + 8 * j + k, 64 * i + 8 * k + 2 * j + 1); +} + + + +/*************************************************************************** + + Callbacks for the TileMap code + +***************************************************************************/ + +TILE_GET_INFO_MEMBER(zaccaria_state::get_tile_info) +{ + uint8_t attr = m_videoram[tile_index | 0x400]; + uint16_t code = m_videoram[tile_index] | ((attr & 0x03) << 8); + attr = (attr & 0x0c) >> 2 | (read_attr(tile_index, 1) & 0x07) << 2; + + tileinfo.set(0, code, attr, 0); +} + + + +/*************************************************************************** + + Start the video hardware emulation. + +***************************************************************************/ + +void zaccaria_state::video_start() +{ + m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(zaccaria_state::get_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 32, 32); + + m_bg_tilemap->set_scroll_cols(32); +} + + + +/*************************************************************************** + + Display refresh + +***************************************************************************/ + +/* sprite format: + + 76543210 +0 xxxxxxxx x +1 x....... flipy + .x...... flipx + ..xxxxxx code low +2 xx...... code high + ..xxx... ? + .....xxx color +3 xxxxxxxx y + +offsets 1 and 2 are swapped if accessed from spriteram2 + +*/ +void zaccaria_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, uint8_t *spriteram, int color, int section) +{ + int o1 = 1 + section; + int o2 = 2 - section; + + for (int offs = 0; offs < 0x20; offs += 4) + { + int sx = spriteram[offs + 3] + 1; + int sy = 242 - spriteram[offs]; + int flipx = spriteram[offs + o1] & 0x40; + int flipy = spriteram[offs + o1] & 0x80; + + if (sx == 1) continue; + + if (flip_screen_x()) + { + sx = 240 - sx; + flipx = !flipx; + } + if (flip_screen_y()) + { + sy = 240 - sy; + flipy = !flipy; + } + + m_gfxdecode->gfx(1)->transpen(bitmap, cliprect, + (spriteram[offs + o1] & 0x3f) + (spriteram[offs + o2] & 0xc0), + ((spriteram[offs + o2] & 0x07) << 2) | color, + flipx, flipy, sx, sy, 0); + } +} + +uint32_t zaccaria_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + m_bg_tilemap->draw(screen, bitmap, cliprect); + + // 3 layers of sprites, each with their own palette and priorities + // Not perfect yet, does spriteram(1) layer have a priority bit somewhere? + draw_sprites(bitmap, cliprect, m_spriteram[1], 2, 1); + draw_sprites(bitmap, cliprect, m_spriteram[0], 1, 0); + draw_sprites(bitmap, cliprect, m_spriteram[1] + 0x20, 0, 1); + + return 0; +} + + + +/*************************************************************************** + + Memory handlers + +***************************************************************************/ + +void zaccaria_state::vblank_irq(int state) +{ + if (state && m_nmi_mask) + m_maincpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE); +} + +void zaccaria_state::videoram_w(offs_t offset, uint8_t data) +{ + m_videoram[offset] = data; + m_bg_tilemap->mark_tile_dirty(offset & 0x3ff); +} + +void zaccaria_state::attributes_w(offs_t offset, uint8_t data) +{ + uint8_t prev = m_attributesram[offset]; + m_attributesram[offset] = data; + + if (prev != data) + { + if (offset & 1) + { + uint8_t mask = flip_screen_x() ? 0x1f : 0; + for (int i = offset / 2; i < 0x400; i += 0x20) + m_bg_tilemap->mark_tile_dirty(i ^ mask); + } + else + update_colscroll(); + } +} + +uint8_t zaccaria_state::read_attr(offs_t offset, int which) +{ + if (flip_screen_x()) offset ^= 0x1f; + return m_attributesram[(offset << 1 & 0x3f) | (which & 1)]; +} + +void zaccaria_state::update_colscroll() +{ + for (int i = 0; i < 0x20; i++) + m_bg_tilemap->set_scrolly(i, read_attr(i, 0)); +} + +void zaccaria_state::flip_screen_x_w(int state) +{ + flip_screen_x_set(state); + update_colscroll(); +} + + void zaccaria_state::dsw_sel_w(uint8_t data) { switch (data & 0xf0) @@ -93,8 +413,6 @@ uint8_t zaccaria_state::dsw_r() } -GAME_EXTERN(monymony); - uint8_t zaccaria_state::prot1_r(offs_t offset) { switch (offset) @@ -166,6 +484,13 @@ void zaccaria_state::main_map(address_map &map) } + +/*************************************************************************** + + Input ports + +***************************************************************************/ + static INPUT_PORTS_START( monymony ) PORT_START("DSW.0") PORT_DIPNAME( 0x03, 0x01, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW 5I:1,2") @@ -308,6 +633,13 @@ static INPUT_PORTS_START( jackrabt ) INPUT_PORTS_END + +/*************************************************************************** + + GFX layouts + +***************************************************************************/ + static const gfx_layout spritelayout = { 16,16, @@ -327,12 +659,12 @@ static GFXDECODE_START( gfx_zaccaria ) GFXDECODE_END -void zaccaria_state::vblank_irq(int state) -{ - if (state && m_nmi_mask) - m_maincpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE); -} +/*************************************************************************** + + Machine config + +***************************************************************************/ void zaccaria_state::zaccaria(machine_config &config) { @@ -376,39 +708,39 @@ void zaccaria_state::zaccaria(machine_config &config) /*************************************************************************** - Game driver(s) + ROM definitions ***************************************************************************/ ROM_START( monymony ) ROM_REGION( 0x10000, "maincpu", 0 ) - ROM_LOAD( "cpu1.1a", 0x0000, 0x1000, CRC(13c227ca) SHA1(be305d112917904dd130b08f6b5186e3fbcb858a) ) + ROM_LOAD( "cpu1.1a", 0x0000, 0x1000, CRC(13c227ca) SHA1(be305d112917904dd130b08f6b5186e3fbcb858a) ) ROM_CONTINUE( 0x8000, 0x1000 ) - ROM_LOAD( "cpu2.1b", 0x1000, 0x1000, CRC(87372545) SHA1(04618d007a93b3f6706f56b10bdf39727d7d748d) ) + ROM_LOAD( "cpu2.1b", 0x1000, 0x1000, CRC(87372545) SHA1(04618d007a93b3f6706f56b10bdf39727d7d748d) ) ROM_CONTINUE( 0x9000, 0x1000 ) - ROM_LOAD( "cpu3.1c", 0x2000, 0x1000, CRC(6aea9c01) SHA1(36a57f4dfae52d674dcf55d2b93dbacf734866b1) ) + ROM_LOAD( "cpu3.1c", 0x2000, 0x1000, CRC(6aea9c01) SHA1(36a57f4dfae52d674dcf55d2b93dbacf734866b1) ) ROM_CONTINUE( 0xa000, 0x1000 ) - ROM_LOAD( "cpu4.1d", 0x3000, 0x1000, CRC(5fdec451) SHA1(0f955c907e0a61a725a951018fdf5cc321139863) ) + ROM_LOAD( "cpu4.1d", 0x3000, 0x1000, CRC(5fdec451) SHA1(0f955c907e0a61a725a951018fdf5cc321139863) ) ROM_CONTINUE( 0xb000, 0x1000 ) - ROM_LOAD( "cpu5.2a", 0x4000, 0x1000, CRC(af830e3c) SHA1(bed57c341ae3500f147efe31bcf01f81466ec1c0) ) + ROM_LOAD( "cpu5.2a", 0x4000, 0x1000, CRC(af830e3c) SHA1(bed57c341ae3500f147efe31bcf01f81466ec1c0) ) ROM_CONTINUE( 0xc000, 0x1000 ) - ROM_LOAD( "cpu6.2c", 0x5000, 0x1000, CRC(31da62b1) SHA1(486f07087244f8537510afacb64ddd59eb512a4d) ) + ROM_LOAD( "cpu6.2c", 0x5000, 0x1000, CRC(31da62b1) SHA1(486f07087244f8537510afacb64ddd59eb512a4d) ) ROM_CONTINUE( 0xd000, 0x1000 ) ROM_REGION( 0x10000, "audiopcb:melodycpu", 0 ) // 64k for first 6802 - ROM_LOAD( "snd13.2g", 0x8000, 0x2000, CRC(78b01b98) SHA1(2aabed56cdae9463deb513c0c5021f6c8dfd271e) ) - ROM_LOAD( "snd9.1i", 0xc000, 0x2000, CRC(94e3858b) SHA1(04961f67b95798b530bd83355dec612389f22255) ) + ROM_LOAD( "snd13.2g", 0x8000, 0x2000, CRC(78b01b98) SHA1(2aabed56cdae9463deb513c0c5021f6c8dfd271e) ) + ROM_LOAD( "snd9.1i", 0xc000, 0x2000, CRC(94e3858b) SHA1(04961f67b95798b530bd83355dec612389f22255) ) ROM_REGION( 0x10000, "audiopcb:audiocpu", 0 ) // 64k for second 6802 - ROM_LOAD( "snd8.1h", 0x2000, 0x1000, CRC(aad76193) SHA1(e08fc184efced392ee902c4cc9daaaf3310cdfe2) ) + ROM_LOAD( "snd8.1h", 0x2000, 0x1000, CRC(aad76193) SHA1(e08fc184efced392ee902c4cc9daaaf3310cdfe2) ) ROM_CONTINUE( 0x6000, 0x1000 ) - ROM_LOAD( "snd7.1g", 0x3000, 0x1000, CRC(1e8ffe3e) SHA1(858ee7abe88d5801237e519cae2b50ae4bf33a58) ) + ROM_LOAD( "snd7.1g", 0x3000, 0x1000, CRC(1e8ffe3e) SHA1(858ee7abe88d5801237e519cae2b50ae4bf33a58) ) ROM_CONTINUE( 0x7000, 0x1000 ) ROM_REGION( 0x6000, "gfx1", 0 ) - ROM_LOAD( "bg1.2d", 0x0000, 0x2000, CRC(82ab4d1a) SHA1(5aaf42a508df236f2e7c844d377132d73053907b) ) - ROM_LOAD( "bg2.1f", 0x2000, 0x2000, CRC(40d4e4d1) SHA1(79cbade30f1c9269e70ddb9c4332cfe1e8dc50a9) ) - ROM_LOAD( "bg3.1e", 0x4000, 0x2000, CRC(36980455) SHA1(4140b0cd4137c8f209124b12d9c0eb3b04f91991) ) + ROM_LOAD( "bg1.2d", 0x0000, 0x2000, CRC(82ab4d1a) SHA1(5aaf42a508df236f2e7c844d377132d73053907b) ) + ROM_LOAD( "bg2.1f", 0x2000, 0x2000, CRC(40d4e4d1) SHA1(79cbade30f1c9269e70ddb9c4332cfe1e8dc50a9) ) + ROM_LOAD( "bg3.1e", 0x4000, 0x2000, CRC(36980455) SHA1(4140b0cd4137c8f209124b12d9c0eb3b04f91991) ) ROM_REGION( 0x0400, "proms", 0 ) ROM_LOAD( "9g", 0x0000, 0x0200, CRC(fc9a0f21) SHA1(2a93d684645ee1b70315386127223151582ab370) ) @@ -417,33 +749,33 @@ ROM_END ROM_START( monymony2 ) ROM_REGION( 0x10000, "maincpu", 0 ) - ROM_LOAD( "cpu1.1a", 0x0000, 0x1000, CRC(907225b2) SHA1(88955d21deee8364e391413c8e59361ca5f7e534) ) + ROM_LOAD( "cpu1.1a", 0x0000, 0x1000, CRC(907225b2) SHA1(88955d21deee8364e391413c8e59361ca5f7e534) ) ROM_CONTINUE( 0x8000, 0x1000 ) - ROM_LOAD( "cpu2.1b", 0x1000, 0x1000, CRC(87372545) SHA1(04618d007a93b3f6706f56b10bdf39727d7d748d) ) + ROM_LOAD( "cpu2.1b", 0x1000, 0x1000, CRC(87372545) SHA1(04618d007a93b3f6706f56b10bdf39727d7d748d) ) ROM_CONTINUE( 0x9000, 0x1000 ) - ROM_LOAD( "cpu3.1c", 0x2000, 0x1000, CRC(3c874c16) SHA1(5607475638c3c313a8150aaa0e3b653226c2442a) ) + ROM_LOAD( "cpu3.1c", 0x2000, 0x1000, CRC(3c874c16) SHA1(5607475638c3c313a8150aaa0e3b653226c2442a) ) ROM_CONTINUE( 0xa000, 0x1000 ) - ROM_LOAD( "cpu4.1d", 0x3000, 0x1000, CRC(5fdec451) SHA1(0f955c907e0a61a725a951018fdf5cc321139863) ) + ROM_LOAD( "cpu4.1d", 0x3000, 0x1000, CRC(5fdec451) SHA1(0f955c907e0a61a725a951018fdf5cc321139863) ) ROM_CONTINUE( 0xb000, 0x1000 ) - ROM_LOAD( "cpu5.2a", 0x4000, 0x1000, CRC(af830e3c) SHA1(bed57c341ae3500f147efe31bcf01f81466ec1c0) ) + ROM_LOAD( "cpu5.2a", 0x4000, 0x1000, CRC(af830e3c) SHA1(bed57c341ae3500f147efe31bcf01f81466ec1c0) ) ROM_CONTINUE( 0xc000, 0x1000 ) - ROM_LOAD( "cpu6.2c", 0x5000, 0x1000, CRC(31da62b1) SHA1(486f07087244f8537510afacb64ddd59eb512a4d) ) + ROM_LOAD( "cpu6.2c", 0x5000, 0x1000, CRC(31da62b1) SHA1(486f07087244f8537510afacb64ddd59eb512a4d) ) ROM_CONTINUE( 0xd000, 0x1000 ) ROM_REGION( 0x10000, "audiopcb:melodycpu", 0 ) // 64k for first 6802 - ROM_LOAD( "snd13.2g", 0x8000, 0x2000, CRC(78b01b98) SHA1(2aabed56cdae9463deb513c0c5021f6c8dfd271e) ) - ROM_LOAD( "snd9.1i", 0xc000, 0x2000, CRC(94e3858b) SHA1(04961f67b95798b530bd83355dec612389f22255) ) + ROM_LOAD( "snd13.2g", 0x8000, 0x2000, CRC(78b01b98) SHA1(2aabed56cdae9463deb513c0c5021f6c8dfd271e) ) + ROM_LOAD( "snd9.1i", 0xc000, 0x2000, CRC(94e3858b) SHA1(04961f67b95798b530bd83355dec612389f22255) ) ROM_REGION( 0x10000, "audiopcb:audiocpu", 0 ) // 64k for second 6802 - ROM_LOAD( "snd8.1h", 0x2000, 0x1000, CRC(aad76193) SHA1(e08fc184efced392ee902c4cc9daaaf3310cdfe2) ) + ROM_LOAD( "snd8.1h", 0x2000, 0x1000, CRC(aad76193) SHA1(e08fc184efced392ee902c4cc9daaaf3310cdfe2) ) ROM_CONTINUE( 0x6000, 0x1000 ) - ROM_LOAD( "snd7.1g", 0x3000, 0x1000, CRC(1e8ffe3e) SHA1(858ee7abe88d5801237e519cae2b50ae4bf33a58) ) + ROM_LOAD( "snd7.1g", 0x3000, 0x1000, CRC(1e8ffe3e) SHA1(858ee7abe88d5801237e519cae2b50ae4bf33a58) ) ROM_CONTINUE( 0x7000, 0x1000 ) ROM_REGION( 0x6000, "gfx1", 0 ) - ROM_LOAD( "bg1.2d", 0x0000, 0x2000, CRC(82ab4d1a) SHA1(5aaf42a508df236f2e7c844d377132d73053907b) ) - ROM_LOAD( "bg2.1f", 0x2000, 0x2000, CRC(40d4e4d1) SHA1(79cbade30f1c9269e70ddb9c4332cfe1e8dc50a9) ) - ROM_LOAD( "bg3.1e", 0x4000, 0x2000, CRC(36980455) SHA1(4140b0cd4137c8f209124b12d9c0eb3b04f91991) ) + ROM_LOAD( "bg1.2d", 0x0000, 0x2000, CRC(82ab4d1a) SHA1(5aaf42a508df236f2e7c844d377132d73053907b) ) + ROM_LOAD( "bg2.1f", 0x2000, 0x2000, CRC(40d4e4d1) SHA1(79cbade30f1c9269e70ddb9c4332cfe1e8dc50a9) ) + ROM_LOAD( "bg3.1e", 0x4000, 0x2000, CRC(36980455) SHA1(4140b0cd4137c8f209124b12d9c0eb3b04f91991) ) ROM_REGION( 0x0400, "proms", 0 ) ROM_LOAD( "9g", 0x0000, 0x0200, CRC(fc9a0f21) SHA1(2a93d684645ee1b70315386127223151582ab370) ) @@ -465,16 +797,16 @@ ROM_START( jackrabt ) ROM_LOAD( "cpu-01.5h", 0xc000, 0x1000, CRC(785e1a01) SHA1(a748d300be9455cad4f912e01c2279bb8465edfe) ) ROM_LOAD( "cpu-01.6h", 0xd000, 0x1000, CRC(dd5979cf) SHA1(e9afe7002b2258a1c3132bdd951c6e20d473fb6a) ) /* This set was also found with bigger program ROMs (but for the first which matches) - ROM_LOAD( "cpu-01-2.1b", 0x1000, 0x1000, CRC(1af79299) SHA1(8e68606a31aa7a7940ff90a7059f56ca7db0ac7c) ) - ROM_CONTINUE( 0x9000, 0x1000) - ROM_LOAD( "cpu-01-3.1c", 0x2000, 0x1000, CRC(a02d5bc7) SHA1(1cb0ad29e7895b80053212bdf9aab9efe334326a) ) - ROM_CONTINUE( 0xa000, 0x1000) - ROM_LOAD( "cpu-01-4.1d", 0x3000, 0x1000) CRC(8e7fbbb3) SHA1(3d57ddf6a47d5f28e4fd24002e948287803a2438) ) - ROM_CONTINUE( 0xb000, 0x1000) - ROM_LOAD( "cpu-01-5.2a", 0x4000, 0x1000, CRC(2f3aa2a4) SHA1(4256894f178980abf187bb5424f9d738fcae2623) ) - ROM_CONTINUE( 0xc000, 0x1000) - ROM_LOAD( "cpu-01-6.2c", 0x5000, 0x1000, CRC(c38228c0) SHA1(1ccc720b0d64b16c268a2bcfb8990f3c71b65913) ) - ROM_CONTINUE( 0xd000, 0x1000) + ROM_LOAD( "cpu-01-2.1b", 0x1000, 0x1000, CRC(1af79299) SHA1(8e68606a31aa7a7940ff90a7059f56ca7db0ac7c) ) + ROM_CONTINUE( 0x9000, 0x1000) + ROM_LOAD( "cpu-01-3.1c", 0x2000, 0x1000, CRC(a02d5bc7) SHA1(1cb0ad29e7895b80053212bdf9aab9efe334326a) ) + ROM_CONTINUE( 0xa000, 0x1000) + ROM_LOAD( "cpu-01-4.1d", 0x3000, 0x1000) CRC(8e7fbbb3) SHA1(3d57ddf6a47d5f28e4fd24002e948287803a2438) ) + ROM_CONTINUE( 0xb000, 0x1000) + ROM_LOAD( "cpu-01-5.2a", 0x4000, 0x1000, CRC(2f3aa2a4) SHA1(4256894f178980abf187bb5424f9d738fcae2623) ) + ROM_CONTINUE( 0xc000, 0x1000) + ROM_LOAD( "cpu-01-6.2c", 0x5000, 0x1000, CRC(c38228c0) SHA1(1ccc720b0d64b16c268a2bcfb8990f3c71b65913) ) + ROM_CONTINUE( 0xd000, 0x1000) */ ROM_REGION( 0x10000, "audiopcb:melodycpu", 0 ) // 64k for first 6802 @@ -577,7 +909,15 @@ ROM_START( jackrabts ) ROM_LOAD( "jr-ic9f", 0x0200, 0x0200, CRC(085914d1) SHA1(3d6f9318f5a9f08ce89e4184e3efb9881f671fa7) ) ROM_END +} // anonymous namespace + + +/*************************************************************************** + + Game drivers + +***************************************************************************/ GAME( 1983, monymony, 0, zaccaria, monymony, zaccaria_state, empty_init, ROT90, "Zaccaria", "Money Money (set 1)", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) GAME( 1983, monymony2, monymony, zaccaria, monymony, zaccaria_state, empty_init, ROT90, "Zaccaria", "Money Money (set 2)", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/zaccaria/zaccaria.h b/src/mame/zaccaria/zaccaria.h deleted file mode 100644 index 4355b6c47c5..00000000000 --- a/src/mame/zaccaria/zaccaria.h +++ /dev/null @@ -1,72 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Nicola Salmoria -#ifndef MAME_ZACCARIA_ZACCARIA_H -#define MAME_ZACCARIA_ZACCARIA_H - -#pragma once - -#include "zaccaria_a.h" -#include "emupal.h" -#include "tilemap.h" - -class zaccaria_state : public driver_device -{ -public: - zaccaria_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag) - , m_maincpu(*this, "maincpu") - , m_gfxdecode(*this, "gfxdecode") - , m_palette(*this, "palette") - , m_audiopcb(*this, "audiopcb") - , m_videoram(*this, "videoram") - , m_attributesram(*this, "attributesram") - , m_spriteram(*this, "spriteram%u", 1U) - , m_dsw_port(*this, "DSW.%u", 0) - , m_coins(*this, "COINS") - { } - - void zaccaria(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: - uint8_t dsw_r(); - uint8_t prot1_r(offs_t offset); - uint8_t prot2_r(offs_t offset); - void coin_w(int state); - void nmi_mask_w(int state); - void videoram_w(offs_t offset, uint8_t data); - void attributes_w(offs_t offset, uint8_t data); - uint8_t read_attr(offs_t offset, int which); - void update_colscroll(); - void flip_screen_x_w(int state); - void dsw_sel_w(uint8_t data); - TILE_GET_INFO_MEMBER(get_tile_info); - void palette(palette_device &palette) const; - uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - void vblank_irq(int state); - void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, uint8_t *spriteram, int color, int section); - - void main_map(address_map &map) ATTR_COLD; - - required_device m_maincpu; - required_device m_gfxdecode; - required_device m_palette; - required_device m_audiopcb; - - required_shared_ptr m_videoram; - required_shared_ptr m_attributesram; - required_shared_ptr_array m_spriteram; - - required_ioport_array<3> m_dsw_port; - required_ioport m_coins; - - uint8_t m_dsw_sel = 0; - tilemap_t *m_bg_tilemap = nullptr; - uint8_t m_nmi_mask = 0; -}; - -#endif // MAME_ZACCARIA_ZACCARIA_H diff --git a/src/mame/zaccaria/zaccaria_v.cpp b/src/mame/zaccaria/zaccaria_v.cpp deleted file mode 100644 index bb26cb12b50..00000000000 --- a/src/mame/zaccaria/zaccaria_v.cpp +++ /dev/null @@ -1,252 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Nicola Salmoria -/*************************************************************************** - - video\zaccaria.cpp - - Functions to emulate the video hardware of the machine. - -***************************************************************************/ - -#include "emu.h" -#include "video/resnet.h" -#include "zaccaria.h" - - -/*************************************************************************** - - Convert the color PROMs into a more useable format. - - -Here's the hookup from the proms (82s131) to the r-g-b-outputs - - Prom 9F 74LS374 - ----------- ____________ - 12 | 3 2 |---680 ohm----| blue out - 11 | 4 5 |---1k ohm-----| (+ 470 ohm pulldown) - 10 | 7 6 |---820 ohm-------| - 9 | 8 9 |---1k ohm--------| green out - Prom 9G | | | (+ 390 ohm pulldown) - 12 | 13 12 |---1.2k ohm------| - 11 | 14 15 |---820 ohm----------| - 10 | 17 16 |---1k ohm-----------| red out - 9 | 18 19 |---1.2k ohm---------| (+ 390 ohm pulldown) - |__________| - - -***************************************************************************/ -void zaccaria_state::palette(palette_device &palette) const -{ - uint8_t const *const color_prom = memregion("proms")->base(); - static constexpr int resistances_rg[] = { 1200, 1000, 820 }; - static constexpr int resistances_b[] = { 1000, 820 }; - - double weights_rg[3], weights_b[2]; - compute_resistor_weights(0, 0xff, -1.0, - 3, resistances_rg, weights_rg, 390, 0, - 2, resistances_b, weights_b, 470, 0, - 0, nullptr, nullptr, 0, 0); - - for (int i = 0; i < 0x200; i++) - { - /* - TODO: I'm not sure, but I think that pen 0 must always be black, otherwise - there's some junk brown background in Jack Rabbit. - From the schematics it seems that the background color can be changed, but - I'm not sure where it would be taken from; I think the high bits of - attributesram, but they are always 0 in these games so they would turn out - black anyway. - */ - if (!(i & 0x038)) - palette.set_indirect_color(i, rgb_t::black()); - else - { - int bit0, bit1, bit2; - - // red component - bit0 = BIT(color_prom[i + 0x000], 3); - bit1 = BIT(color_prom[i + 0x000], 2); - bit2 = BIT(color_prom[i + 0x000], 1); - int const r = combine_weights(weights_rg, bit0, bit1, bit2); - - // green component - bit0 = BIT(color_prom[i + 0x000], 0); - bit1 = BIT(color_prom[i + 0x200], 3); - bit2 = BIT(color_prom[i + 0x200], 2); - int const g = combine_weights(weights_rg, bit0, bit1, bit2); - - // blue component - bit0 = BIT(color_prom[i + 0x200], 1); - bit1 = BIT(color_prom[i + 0x200], 0); - int const b = combine_weights(weights_b, bit0, bit1); - - palette.set_indirect_color(i, rgb_t(r, g, b)); - } - } - - /* There are 512 unique colors, which seem to be organized in 8 blocks */ - /* of 64. In each block, colors are not in the usual sequential order */ - /* but in interleaved order, like Phoenix. Additionally, colors for */ - /* background and sprites are interleaved. */ - for (int i = 0; i < 8; i++) - for (int j = 0; j < 4; j++) - for (int k = 0; k < 8; k++) - // swap j and k to make the colors sequential - palette.set_pen_indirect(0 + 32 * i + 8 * j + k, 64 * i + 8 * k + 2 * j); - - for (int i = 0; i < 8; i++) - for (int j = 0; j < 4; j++) - for (int k = 0; k < 8; k++) - // swap j and k to make the colors sequential - palette.set_pen_indirect(256 + 32 * i + 8 * j + k, 64 * i + 8 * k + 2 * j + 1); -} - - - -/*************************************************************************** - - Callbacks for the TileMap code - -***************************************************************************/ - -TILE_GET_INFO_MEMBER(zaccaria_state::get_tile_info) -{ - uint8_t attr = m_videoram[tile_index | 0x400]; - uint16_t code = m_videoram[tile_index] | ((attr & 0x03) << 8); - attr = (attr & 0x0c) >> 2 | (read_attr(tile_index, 1) & 0x07) << 2; - - tileinfo.set(0, code, attr, 0); -} - - - -/*************************************************************************** - - Start the video hardware emulation. - -***************************************************************************/ - -void zaccaria_state::video_start() -{ - m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(zaccaria_state::get_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 32, 32); - - m_bg_tilemap->set_scroll_cols(32); -} - - - -/*************************************************************************** - - Memory handlers - -***************************************************************************/ - -void zaccaria_state::videoram_w(offs_t offset, uint8_t data) -{ - m_videoram[offset] = data; - m_bg_tilemap->mark_tile_dirty(offset & 0x3ff); -} - -void zaccaria_state::attributes_w(offs_t offset, uint8_t data) -{ - uint8_t prev = m_attributesram[offset]; - m_attributesram[offset] = data; - - if (prev != data) - { - if (offset & 1) - { - uint8_t mask = flip_screen_x() ? 0x1f : 0; - for (int i = offset / 2; i < 0x400; i += 0x20) - m_bg_tilemap->mark_tile_dirty(i ^ mask); - } - else - update_colscroll(); - } -} - -uint8_t zaccaria_state::read_attr(offs_t offset, int which) -{ - if (flip_screen_x()) offset ^= 0x1f; - return m_attributesram[(offset << 1 & 0x3f) | (which & 1)]; -} - -void zaccaria_state::update_colscroll() -{ - for (int i = 0; i < 0x20; i++) - m_bg_tilemap->set_scrolly(i, read_attr(i, 0)); -} - -void zaccaria_state::flip_screen_x_w(int state) -{ - flip_screen_x_set(state); - update_colscroll(); -} - - - -/*************************************************************************** - - Display refresh - -***************************************************************************/ - -/* sprite format: - - 76543210 -0 xxxxxxxx x -1 x....... flipy - .x...... flipx - ..xxxxxx code low -2 xx...... code high - ..xxx... ? - .....xxx color -3 xxxxxxxx y - -offsets 1 and 2 are swapped if accessed from spriteram2 - -*/ -void zaccaria_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, uint8_t *spriteram, int color, int section) -{ - int o1 = 1 + section; - int o2 = 2 - section; - - for (int offs = 0; offs < 0x20; offs += 4) - { - int sx = spriteram[offs + 3] + 1; - int sy = 242 - spriteram[offs]; - int flipx = spriteram[offs + o1] & 0x40; - int flipy = spriteram[offs + o1] & 0x80; - - if (sx == 1) continue; - - if (flip_screen_x()) - { - sx = 240 - sx; - flipx = !flipx; - } - if (flip_screen_y()) - { - sy = 240 - sy; - flipy = !flipy; - } - - m_gfxdecode->gfx(1)->transpen(bitmap, cliprect, - (spriteram[offs + o1] & 0x3f) + (spriteram[offs + o2] & 0xc0), - ((spriteram[offs + o2] & 0x07) << 2) | color, - flipx, flipy, sx, sy, 0); - } -} - -uint32_t zaccaria_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) -{ - m_bg_tilemap->draw(screen, bitmap, cliprect); - - // 3 layers of sprites, each with their own palette and priorities - // Not perfect yet, does spriteram(1) layer have a priority bit somewhere? - draw_sprites(bitmap, cliprect, m_spriteram[1], 2, 1); - draw_sprites(bitmap, cliprect, m_spriteram[0], 1, 0); - draw_sprites(bitmap, cliprect, m_spriteram[1] + 0x20, 0, 1); - - return 0; -} diff --git a/src/osd/windows/winmain.cpp b/src/osd/windows/winmain.cpp index 542b0b1d596..904d19f70a8 100644 --- a/src/osd/windows/winmain.cpp +++ b/src/osd/windows/winmain.cpp @@ -121,7 +121,6 @@ static int is_double_click_start(int argc); //MESSUI start int main_(int argc, char *argv[]) { - printf("main_ Begin\n");fflush(stdout); std::vector args = osd_get_command_line(argc, argv); // use small output buffers on non-TTYs (i.e. pipes) @@ -160,7 +159,6 @@ int main_(int argc, char *argv[]) osd_output::pop(&winerror); } - printf("main_ End\n");fflush(stdout); return result; } //MESSUI end diff --git a/src/osd/winui/winui.cpp b/src/osd/winui/winui.cpp index e4ad73a1b84..d5ca9776b8a 100644 --- a/src/osd/winui/winui.cpp +++ b/src/osd/winui/winui.cpp @@ -1413,12 +1413,7 @@ void UpdateScreenShot() //printf("Update Screenshot: H\n");fflush(stdout); if (have_selection) - { - if (!g_szSelectedItem.empty()) - LoadScreenShot(Picker_GetSelectedItem(hwndList), g_szSelectedItem, TabView_GetCurrentTab(hTabCtrl)); - else - LoadScreenShot(Picker_GetSelectedItem(hwndList), "", TabView_GetCurrentTab(hTabCtrl)); - } + LoadScreenShot(Picker_GetSelectedItem(hwndList), g_szSelectedItem, TabView_GetCurrentTab(hTabCtrl)); // figure out if we have a history or not, to place our other windows properly //printf("Update Screenshot: I\n");fflush(stdout); diff --git a/src/tools/imgtool/modules/fat.cpp b/src/tools/imgtool/modules/fat.cpp index f61d073b5f8..d6611932c0d 100644 --- a/src/tools/imgtool/modules/fat.cpp +++ b/src/tools/imgtool/modules/fat.cpp @@ -140,6 +140,7 @@ #include "multibyte.h" #include "unicode.h" +#include #include #include #include @@ -179,6 +180,18 @@ struct fat_file struct fat_dirent { + fat_dirent() : + directory(0), + eof(0), + filesize(0), + first_cluster(0), + dirent_sector_index(0), + dirent_sector_offset(0) + { + std::fill(std::begin(long_filename), std::end(long_filename), 0); + std::fill(std::begin(short_filename), std::end(short_filename), 0); + } + char long_filename[512]; char short_filename[13]; unsigned int directory : 1; @@ -1273,15 +1286,16 @@ static uint32_t fat_setup_time(time_t ansi_time) -static imgtoolerr_t fat_read_dirent(imgtool::partition &partition, fat_file *file, - fat_dirent &ent, fat_freeentry_info *freeent) +static imgtoolerr_t fat_read_dirent( + imgtool::partition &partition, + fat_file *file, + fat_dirent &ent, + fat_freeentry_info *freeent) { imgtoolerr_t err; //const fat_partition_info *disk_info; uint8_t entry[FAT_DIRENT_SIZE]; size_t bytes_read; - int i, j; - char32_t ch; char16_t lfn_buf[512]; size_t lfn_len = 0; int lfn_lastentry = 0; @@ -1290,7 +1304,7 @@ static imgtoolerr_t fat_read_dirent(imgtool::partition &partition, fat_file *fil assert(file->directory); lfn_buf[0] = '\0'; - memset(&ent, 0, sizeof(ent)); + ent = fat_dirent(); //disk_info = fat_get_partition_info(partition); /* The first eight bytes of a FAT directory entry is a blank padded name @@ -1351,7 +1365,7 @@ static imgtoolerr_t fat_read_dirent(imgtool::partition &partition, fat_file *fil } } } - while((entry[0] == 0x2E) || (entry[0] == 0xE5) || (entry[11] == 0x0F)); + while ((entry[0] == 0x2E) || (entry[0] == 0xE5) || (entry[11] == 0x0F)); /* no more directory entries? */ if (entry[0] == '\0') @@ -1369,14 +1383,14 @@ static imgtoolerr_t fat_read_dirent(imgtool::partition &partition, fat_file *fil /* only use the LFN if the checksum passes */ if (lfn_checksum == fat_calc_filename_checksum(entry)) { - i = 0; - j = 0; + int i = 0, j = 0; + char32_t ch; do { i += uchar_from_utf16(&ch, &lfn_buf[i], std::size(lfn_buf) - i); j += utf8_from_uchar(&ent.long_filename[j], std::size(ent.long_filename) - j, ch); } - while(ch != 0); + while (ch != 0); } } diff --git a/src/tools/imgtool/modules/vzdos.cpp b/src/tools/imgtool/modules/vzdos.cpp index 37183a90861..b7dee751434 100644 --- a/src/tools/imgtool/modules/vzdos.cpp +++ b/src/tools/imgtool/modules/vzdos.cpp @@ -19,6 +19,7 @@ #include "multibyte.h" #include "opresolv.h" +#include #include #include #include @@ -51,20 +52,21 @@ as track map, with one bit for each sector used. /* vzdos directry entry */ struct vzdos_dirent { - char ftype; - char delimitor; - char fname[8]; + struct { + char ftype; + char delimitor; + char fname[8]; + } node; uint8_t start_track; uint8_t start_sector; uint16_t start_address; uint16_t end_address; - vzdos_dirent() + vzdos_dirent() : + start_track(0), start_sector(0), + start_address(0), end_address(0) { - ftype = delimitor = '\0'; - fname[0] = '\0'; - start_track = start_sector = 0; - start_address = end_address = 0; + memset(&node, 0, sizeof(node)); } }; @@ -160,8 +162,7 @@ static imgtoolerr_t vzdos_write_sector_data(imgtool::image &img, int track, int static imgtoolerr_t vzdos_clear_sector(imgtool::image &img, int track, int sector) { uint8_t data[DATA_SIZE + 2]; - - memset(data, 0x00, sizeof(data)); + std::fill(std::begin(data), std::end(data), 0x00); return vzdos_write_sector_data(img, track, sector, data); } @@ -169,21 +170,21 @@ static imgtoolerr_t vzdos_clear_sector(imgtool::image &img, int track, int secto /* return a directory entry for an index */ static imgtoolerr_t vzdos_get_dirent(imgtool::image &img, int index, vzdos_dirent *ent) { - int ret, entry; uint8_t buffer[DATA_SIZE + 2]; - ret = vzdos_read_sector_data(img, 0, (int) index / 8, buffer); - if (ret) return (imgtoolerr_t)ret; + imgtoolerr_t const ret = vzdos_read_sector_data(img, 0, int(index) / 8, buffer); + if (IMGTOOLERR_SUCCESS != ret) + return ret; - entry = ((index % 8) * sizeof(vzdos_dirent)); + int const entry = ((index % 8) * sizeof(vzdos_dirent)); - memcpy(ent, &buffer[entry], 10); + memcpy(&ent->node, &buffer[entry], 10); ent->start_track = buffer[entry + 10]; ent->start_sector = buffer[entry + 11]; ent->start_address = get_u16le(&buffer[entry + 12]); ent->end_address = get_u16le(&buffer[entry + 14]); - if (ent->ftype == 0x00) + if (ent->node.ftype == 0x00) return IMGTOOLERR_FILENOTFOUND; /* check values */ @@ -224,20 +225,12 @@ static imgtoolerr_t vzdos_set_dirent(imgtool::image &img, int index, vzdos_diren /* clear a directory entry */ static imgtoolerr_t vzdos_clear_dirent(imgtool::image &img, int index) { - int ret; vzdos_dirent entry; - - memset(&entry, 0x00, sizeof(vzdos_dirent)); - - ret = vzdos_set_dirent(img, index, entry); - if (ret) return (imgtoolerr_t)ret; - - return IMGTOOLERR_SUCCESS; + return vzdos_set_dirent(img, index, entry); } /* search the index for a directory entry */ static imgtoolerr_t vzdos_searchentry(imgtool::image &image, const char *fname, int *entry) { - int i, len, ret; vzdos_dirent ent; char filename[9]; @@ -249,23 +242,23 @@ static imgtoolerr_t vzdos_searchentry(imgtool::image &image, const char *fname, *entry = -1; - for (i = 0; i < MAX_DIRENTS; i++) { - ret = vzdos_get_dirent(image, i, &ent); - if (ret) return (imgtoolerr_t)ret; + for (int i = 0; i < MAX_DIRENTS; i++) { + imgtoolerr_t const ret = vzdos_get_dirent(image, i, &ent); + if (IMGTOOLERR_SUCCESS != ret) + return ret; - len = vzdos_get_fname_len(ent.fname) + 1; + int const len = vzdos_get_fname_len(ent.node.fname) + 1; if (strlen(fname) != len) continue; - memset(filename, 0x00, sizeof(filename)); - memcpy(filename, ent.fname, len); + std::fill(std::begin(filename), std::end(filename), 0x00); + memcpy(filename, ent.node.fname, len); if (!core_stricmp(fname, filename)) { *entry = i; break; } - } if (*entry == -1) @@ -362,7 +355,6 @@ static imgtoolerr_t vzdos_free_trackmap(imgtool::image &img, int *track, int *se static imgtoolerr_t vzdos_write_formatted_sector(imgtool::image &img, int track, int sector) { - int ret; uint8_t sector_data[DATA_SIZE + 4 + 24]; static const uint8_t sector_header[24] = { @@ -371,15 +363,16 @@ static imgtoolerr_t vzdos_write_formatted_sector(imgtool::image &img, int track, 0x80, 0x80, 0x80, 0x00, 0xC3, 0x18, 0xE7, 0xFE }; - memset(sector_data, 0x00, sizeof(sector_data)); + std::fill(std::begin(sector_data), std::end(sector_data), 0x00); memcpy(sector_data, sector_header, sizeof(sector_header)); sector_data[10] = (uint8_t) track; /* current track */ sector_data[11] = (uint8_t) sector; /* current sector */ sector_data[12] = (uint8_t) track + sector; /* checksum-8 */ - ret = floppy_write_sector(imgtool_floppy(img), 0, track, sector_order[sector], 0, sector_data, sizeof(sector_data), 0); /* TODO: pass ddam argument from imgtool */ - if (ret) return (imgtoolerr_t)ret; + floperr_t const ret = floppy_write_sector(imgtool_floppy(img), 0, track, sector_order[sector], 0, sector_data, sizeof(sector_data), 0); /* TODO: pass ddam argument from imgtool */ + if (FLOPPY_ERROR_SUCCESS != ret) + return IMGTOOLERR_WRITEERROR; return IMGTOOLERR_SUCCESS; } @@ -427,15 +420,15 @@ static imgtoolerr_t vzdos_diskimage_nextenum(imgtool::directory &enumeration, im /* kill trailing spaces */ for (len = 7; len > 0; len--) { - if (dirent.fname[len] != 0x20) { + if (dirent.node.fname[len] != 0x20) { break; } } - memcpy(ent.filename, &dirent.fname, len + 1); + memcpy(ent.filename, &dirent.node.fname, len + 1); ent.filesize = dirent.end_address - dirent.start_address; - switch (dirent.ftype) + switch (dirent.node.ftype) { case 0x01: type = "Deleted"; break; case 'T': type = "Basic"; break; @@ -620,8 +613,8 @@ static imgtoolerr_t vzdos_writefile(imgtool::partition &partition, int offset, i return IMGTOOLERR_READONLY; /* check for already existing filename -> overwrite */ - strcpy(filename, entry->fname); - filename[vzdos_get_fname_len(entry->fname) + 1] = 0x00; + strcpy(filename, entry->node.fname); + filename[vzdos_get_fname_len(entry->node.fname) + 1] = 0x00; ret = vzdos_get_dirent_fname(img, filename, &temp_entry); if (!ret) { /* file already exists, delete it */ @@ -705,8 +698,6 @@ static imgtoolerr_t vzdos_writefile(imgtool::partition &partition, int offset, i /* create a new file or overwrite a file */ static imgtoolerr_t vzdos_diskimage_writefile(imgtool::partition &partition, const char *filename, const char *fork, imgtool::stream &sourcef, util::option_resolution *opts) { - imgtoolerr_t ret; - int ftype; vzdos_dirent entry; /* TODO: check for leading spaces and strip */ @@ -714,34 +705,31 @@ static imgtoolerr_t vzdos_diskimage_writefile(imgtool::partition &partition, con return IMGTOOLERR_BADFILENAME; /* prepare directory entry */ - ftype = opts->lookup_int('T'); + int const ftype = opts->lookup_int('T'); switch (ftype) { case 0: - entry.ftype = 'T'; + entry.node.ftype = 'T'; entry.start_address = 31465; break; case 1: - entry.ftype = 'B'; + entry.node.ftype = 'B'; entry.start_address = 31465; /* ??? */ break; case 2: - entry.ftype = 'D'; + entry.node.ftype = 'D'; entry.start_address = 31465; /* ??? */ break; default: break; } - entry.delimitor = ':'; - memset(&entry.fname, 0x20, 8); /* pad with spaces */ - memcpy(&entry.fname, filename, strlen(filename)); + entry.node.delimitor = ':'; + memset(&entry.node.fname, 0x20, 8); /* pad with spaces */ + memcpy(&entry.node.fname, filename, strlen(filename)); /* write file to disk */ - ret = vzdos_writefile(partition, 0, sourcef, &entry); - if (ret) return ret; - - return IMGTOOLERR_SUCCESS; + return vzdos_writefile(partition, 0, sourcef, &entry); } static imgtoolerr_t vzdos_diskimage_suggesttransfer(imgtool::partition &partition, const char *fname, imgtool::transfer_suggestion *suggestions, size_t suggestions_length) @@ -754,7 +742,7 @@ static imgtoolerr_t vzdos_diskimage_suggesttransfer(imgtool::partition &partitio ret = vzdos_get_dirent_fname(image, fname, &entry); if (ret) return ret; - switch (entry.ftype) { + switch (entry.node.ftype) { case 'B': suggestions[0].viability = imgtool::SUGGESTION_RECOMMENDED; suggestions[0].filter = filter_vzsnapshot_getinfo; @@ -827,7 +815,7 @@ static imgtoolerr_t vzsnapshot_readfile(imgtool::partition &partition, const cha header[1] = 'Z'; header[2] = 'F'; - switch (entry.ftype) { + switch (entry.node.ftype) { case 'B': header[3] = '1'; header[21] = 0xF1; @@ -842,7 +830,7 @@ static imgtoolerr_t vzsnapshot_readfile(imgtool::partition &partition, const cha } memset(header + 4, 0x00, 17); - memcpy(header + 4, entry.fname, vzdos_get_fname_len(entry.fname) + 1); + memcpy(header + 4, entry.node.fname, vzdos_get_fname_len(entry.node.fname) + 1); put_u16le(&header[22], entry.start_address); /* write header to file */ @@ -866,21 +854,21 @@ static imgtoolerr_t vzsnapshot_writefile(imgtool::partition &partition, const ch sourcef.read(header, sizeof(header)); /* prepare directory entry */ - entry.ftype = header[21] == 0xF1 ? 'B' : 'T'; - entry.delimitor = ':'; - entry.start_address = get_u16le(&header[22]); + entry.node.ftype = (header[21] == 0xF1) ? 'B' : 'T'; + entry.node.delimitor = ':'; + entry.start_address = get_u16le(&header[22]); /* filename from header or directly? */ fnameopt = opts->lookup_int('F'); if (fnameopt == 0) { - memcpy(&entry.fname, &header[4], 8); + memcpy(&entry.node.fname, &header[4], 8); } else { /* TODO: check for leading spaces and strip */ if (strlen(filename) > 8 || strlen(filename) < 1) return IMGTOOLERR_BADFILENAME; - memcpy(&entry.fname, filename, strlen(filename) - 3); + memcpy(&entry.node.fname, filename, strlen(filename) - 3); } /* write file to disk */ diff --git a/src/tools/romcmp.cpp b/src/tools/romcmp.cpp index 01a234b9736..e3ae03c8f5e 100644 --- a/src/tools/romcmp.cpp +++ b/src/tools/romcmp.cpp @@ -559,7 +559,10 @@ static int load_files(int i, int *found, const char *path) else { if (zip->decompress(file.buf.get(), file.size)) + { + printf("%s: Decompression failed\n", file.name.c_str()); file.free(); + } } file.listed = 0; diff --git a/src/tools/unidasm.cpp b/src/tools/unidasm.cpp index 4ccce7f1eeb..dadf946e5ac 100644 --- a/src/tools/unidasm.cpp +++ b/src/tools/unidasm.cpp @@ -197,6 +197,7 @@ using util::BIT; #include "cpu/unsp/unspdasm.h" #include "cpu/upd177x/upd177xd.h" #include "cpu/upd7725/dasm7725.h" +#include "cpu/upd777/upd777dasm.h" #include "cpu/upd7810/upd7810_dasm.h" #include "cpu/upd78k/upd78k0d.h" #include "cpu/upd78k/upd78k1d.h" @@ -673,6 +674,7 @@ static const dasm_table_entry dasm_table[] = { "unsp12", be, -1, []() -> util::disasm_interface * { return new unsp_12_disassembler; } }, { "unsp20", be, -1, []() -> util::disasm_interface * { return new unsp_20_disassembler; } }, { "upd177x", be, -1, []() -> util::disasm_interface * { return new upd177x_disassembler; } }, + { "upd777", be, -1, []() -> util::disasm_interface * { return new upd777_disassembler; } }, { "upd7725", be, -2, []() -> util::disasm_interface * { return new necdsp_disassembler; } }, { "upd7801", le, 0, []() -> util::disasm_interface * { return new upd7801_disassembler; } }, { "upd78c05", le, 0, []() -> util::disasm_interface * { return new upd78c05_disassembler; } },